diff --git a/dist/mermaid.js b/dist/mermaid.js index 97b1ac2..d7afa41 100644 --- a/dist/mermaid.js +++ b/dist/mermaid.js @@ -1,21 +1,55 @@ -(function(global2, factory) { - typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.mermaid = factory()); -})(this, function() { - var _a, _b; - "use strict"; +"use strict"; +var __esbuild_esm_mermaid = (() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true }); + var __esm = (fn3, res) => function __init() { + return fn3 && (res = (0, fn3[__getOwnPropNames(fn3)[0]])(fn3 = 0)), res; + }; + var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps = (to, from2, except, desc) => { + if (from2 && typeof from2 === "object" || typeof from2 === "function") { + for (let key of __getOwnPropNames(from2)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable }); + } + return to; + }; + var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + + // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js function dedent(templ) { var values2 = []; - for (var _i6 = 1; _i6 < arguments.length; _i6++) { - values2[_i6 - 1] = arguments[_i6]; + for (var _i = 1; _i < arguments.length; _i++) { + values2[_i - 1] = arguments[_i]; } var strings = Array.from(typeof templ === "string" ? [templ] : templ); strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, ""); var indentLengths = strings.reduce(function(arr, str2) { - var matches = str2.match(/\n([\t ]+|(?!\s).)/g); - if (matches) { - return arr.concat(matches.map(function(match) { - var _a2, _b2; - return (_b2 = (_a2 = match.match(/[\t ]/g)) === null || _a2 === void 0 ? void 0 : _a2.length) !== null && _b2 !== void 0 ? _b2 : 0; + var matches33 = str2.match(/\n([\t ]+|(?!\s).)/g); + if (matches33) { + return arr.concat(matches33.map(function(match2) { + var _a, _b; + return (_b = (_a = match2.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; })); } return arr; @@ -27,9 +61,9 @@ }); } strings[0] = strings[0].replace(/^\r?\n/, ""); - var string2 = strings[0]; + var string3 = strings[0]; values2.forEach(function(value2, i2) { - var endentations = string2.match(/(?:^|\n)( *)$/); + var endentations = string3.match(/(?:^|\n)( *)$/); var endentation = endentations ? endentations[1] : ""; var indentedValue = value2; if (typeof value2 === "string" && value2.includes("\n")) { @@ -37,11871 +71,20700 @@ return i3 === 0 ? str2 : "" + endentation + str2; }).join("\n"); } - string2 += indentedValue + strings[i2 + 1]; + string3 += indentedValue + strings[i2 + 1]; }); - return string2; - } - var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; - function getDefaultExportFromCjs(x2) { - return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; - } - var dayjs_min = { exports: {} }; - (function(module2, exports2) { - !function(t, e) { - module2.exports = e(); - }(commonjsGlobal, function() { - var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i2 = "second", s = "minute", u = "hour", a = "day", o = "week", c2 = "month", f2 = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t4) { - var e3 = ["th", "st", "nd", "rd"], n2 = t4 % 100; - return "[" + t4 + (e3[(n2 - 20) % 10] || e3[n2] || e3[0]) + "]"; - } }, m = function(t4, e3, n2) { - var r2 = String(t4); - return !r2 || r2.length >= e3 ? t4 : "" + Array(e3 + 1 - r2.length).join(n2) + t4; - }, v = { s: m, z: function(t4) { - var e3 = -t4.utcOffset(), n2 = Math.abs(e3), r2 = Math.floor(n2 / 60), i3 = n2 % 60; - return (e3 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i3, 2, "0"); - }, m: function t4(e3, n2) { - if (e3.date() < n2.date()) - return -t4(n2, e3); - var r2 = 12 * (n2.year() - e3.year()) + (n2.month() - e3.month()), i3 = e3.clone().add(r2, c2), s2 = n2 - i3 < 0, u2 = e3.clone().add(r2 + (s2 ? -1 : 1), c2); - return +(-(r2 + (n2 - i3) / (s2 ? i3 - u2 : u2 - i3)) || 0); - }, a: function(t4) { - return t4 < 0 ? Math.ceil(t4) || 0 : Math.floor(t4); - }, p: function(t4) { - return { M: c2, y: h, w: o, d: a, D: d, h: u, m: s, s: i2, ms: r, Q: f2 }[t4] || String(t4 || "").toLowerCase().replace(/s$/, ""); - }, u: function(t4) { - return void 0 === t4; - } }, g = "en", D2 = {}; - D2[g] = M; - var p = "$isDayjsObject", S2 = function(t4) { - return t4 instanceof _2 || !(!t4 || !t4[p]); - }, w2 = function t4(e3, n2, r2) { - var i3; - if (!e3) - return g; - if ("string" == typeof e3) { - var s2 = e3.toLowerCase(); - D2[s2] && (i3 = s2), n2 && (D2[s2] = n2, i3 = s2); - var u2 = e3.split("-"); - if (!i3 && u2.length > 1) - return t4(u2[0]); - } else { - var a2 = e3.name; - D2[a2] = e3, i3 = a2; - } - return !r2 && i3 && (g = i3), i3 || !r2 && g; - }, O = function(t4, e3) { - if (S2(t4)) - return t4.clone(); - var n2 = "object" == typeof e3 ? e3 : {}; - return n2.date = t4, n2.args = arguments, new _2(n2); - }, b = v; - b.l = w2, b.i = S2, b.w = function(t4, e3) { - return O(t4, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset }); - }; - var _2 = function() { - function M2(t4) { - this.$L = w2(t4.locale, null, true), this.parse(t4), this.$x = this.$x || t4.x || {}, this[p] = true; - } - var m2 = M2.prototype; - return m2.parse = function(t4) { - this.$d = function(t5) { - var e3 = t5.date, n2 = t5.utc; - if (null === e3) - return /* @__PURE__ */ new Date(NaN); - if (b.u(e3)) - return /* @__PURE__ */ new Date(); - if (e3 instanceof Date) - return new Date(e3); - if ("string" == typeof e3 && !/Z$/i.test(e3)) { - var r2 = e3.match($); - if (r2) { - var i3 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3); - return n2 ? new Date(Date.UTC(r2[1], i3, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i3, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2); - } - } - return new Date(e3); - }(t4), this.init(); - }, m2.init = function() { - var t4 = this.$d; - this.$y = t4.getFullYear(), this.$M = t4.getMonth(), this.$D = t4.getDate(), this.$W = t4.getDay(), this.$H = t4.getHours(), this.$m = t4.getMinutes(), this.$s = t4.getSeconds(), this.$ms = t4.getMilliseconds(); - }, m2.$utils = function() { - return b; - }, m2.isValid = function() { - return !(this.$d.toString() === l); - }, m2.isSame = function(t4, e3) { - var n2 = O(t4); - return this.startOf(e3) <= n2 && n2 <= this.endOf(e3); - }, m2.isAfter = function(t4, e3) { - return O(t4) < this.startOf(e3); - }, m2.isBefore = function(t4, e3) { - return this.endOf(e3) < O(t4); - }, m2.$g = function(t4, e3, n2) { - return b.u(t4) ? this[e3] : this.set(n2, t4); - }, m2.unix = function() { - return Math.floor(this.valueOf() / 1e3); - }, m2.valueOf = function() { - return this.$d.getTime(); - }, m2.startOf = function(t4, e3) { - var n2 = this, r2 = !!b.u(e3) || e3, f3 = b.p(t4), l2 = function(t5, e4) { - var i3 = b.w(n2.$u ? Date.UTC(n2.$y, e4, t5) : new Date(n2.$y, e4, t5), n2); - return r2 ? i3 : i3.endOf(a); - }, $2 = function(t5, e4) { - return b.w(n2.toDate()[t5].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n2); - }, y3 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : ""); - switch (f3) { - case h: - return r2 ? l2(1, 0) : l2(31, 11); - case c2: - return r2 ? l2(1, M3) : l2(0, M3 + 1); - case o: - var g2 = this.$locale().weekStart || 0, D3 = (y3 < g2 ? y3 + 7 : y3) - g2; - return l2(r2 ? m3 - D3 : m3 + (6 - D3), M3); - case a: - case d: - return $2(v2 + "Hours", 0); - case u: - return $2(v2 + "Minutes", 1); - case s: - return $2(v2 + "Seconds", 2); - case i2: - return $2(v2 + "Milliseconds", 3); - default: - return this.clone(); - } - }, m2.endOf = function(t4) { - return this.startOf(t4, false); - }, m2.$set = function(t4, e3) { - var n2, o2 = b.p(t4), f3 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f3 + "Date", n2[d] = f3 + "Date", n2[c2] = f3 + "Month", n2[h] = f3 + "FullYear", n2[u] = f3 + "Hours", n2[s] = f3 + "Minutes", n2[i2] = f3 + "Seconds", n2[r] = f3 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e3 - this.$W) : e3; - if (o2 === c2 || o2 === h) { - var y3 = this.clone().set(d, 1); - y3.$d[l2]($2), y3.init(), this.$d = y3.set(d, Math.min(this.$D, y3.daysInMonth())).$d; - } else - l2 && this.$d[l2]($2); - return this.init(), this; - }, m2.set = function(t4, e3) { - return this.clone().$set(t4, e3); - }, m2.get = function(t4) { - return this[b.p(t4)](); - }, m2.add = function(r2, f3) { - var d2, l2 = this; - r2 = Number(r2); - var $2 = b.p(f3), y3 = function(t4) { - var e3 = O(l2); - return b.w(e3.date(e3.date() + Math.round(t4 * r2)), l2); + return string3; + } + var init_esm = __esm({ + "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() { + "use strict"; + __name(dedent, "dedent"); + } + }); + + // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js + var require_dayjs_min = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js"(exports2, module2) { + "use strict"; + !function(t4, e3) { + "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e3() : "function" == typeof define && define.amd ? define(e3) : (t4 = "undefined" != typeof globalThis ? globalThis : t4 || self).dayjs = e3(); + }(exports2, function() { + "use strict"; + var t4 = 1e3, e3 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c3 = "month", f3 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $3 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y5 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: /* @__PURE__ */ __name(function(t5) { + var e4 = ["th", "st", "nd", "rd"], n3 = t5 % 100; + return "[" + t5 + (e4[(n3 - 20) % 10] || e4[n3] || e4[0]) + "]"; + }, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t5, e4, n3) { + var r3 = String(t5); + return !r3 || r3.length >= e4 ? t5 : "" + Array(e4 + 1 - r3.length).join(n3) + t5; + }, "m"), v3 = { s: m2, z: /* @__PURE__ */ __name(function(t5) { + var e4 = -t5.utcOffset(), n3 = Math.abs(e4), r3 = Math.floor(n3 / 60), i3 = n3 % 60; + return (e4 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0"); + }, "z"), m: /* @__PURE__ */ __name(function t5(e4, n3) { + if (e4.date() < n3.date()) return -t5(n3, e4); + var r3 = 12 * (n3.year() - e4.year()) + (n3.month() - e4.month()), i3 = e4.clone().add(r3, c3), s3 = n3 - i3 < 0, u3 = e4.clone().add(r3 + (s3 ? -1 : 1), c3); + return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0); + }, "t"), a: /* @__PURE__ */ __name(function(t5) { + return t5 < 0 ? Math.ceil(t5) || 0 : Math.floor(t5); + }, "a"), p: /* @__PURE__ */ __name(function(t5) { + return { M: c3, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f3 }[t5] || String(t5 || "").toLowerCase().replace(/s$/, ""); + }, "p"), u: /* @__PURE__ */ __name(function(t5) { + return void 0 === t5; + }, "u") }, g2 = "en", D3 = {}; + D3[g2] = M2; + var p3 = "$isDayjsObject", S3 = /* @__PURE__ */ __name(function(t5) { + return t5 instanceof _2 || !(!t5 || !t5[p3]); + }, "S"), w3 = /* @__PURE__ */ __name(function t5(e4, n3, r3) { + var i3; + if (!e4) return g2; + if ("string" == typeof e4) { + var s3 = e4.toLowerCase(); + D3[s3] && (i3 = s3), n3 && (D3[s3] = n3, i3 = s3); + var u3 = e4.split("-"); + if (!i3 && u3.length > 1) return t5(u3[0]); + } else { + var a3 = e4.name; + D3[a3] = e4, i3 = a3; + } + return !r3 && i3 && (g2 = i3), i3 || !r3 && g2; + }, "t"), O2 = /* @__PURE__ */ __name(function(t5, e4) { + if (S3(t5)) return t5.clone(); + var n3 = "object" == typeof e4 ? e4 : {}; + return n3.date = t5, n3.args = arguments, new _2(n3); + }, "O"), b2 = v3; + b2.l = w3, b2.i = S3, b2.w = function(t5, e4) { + return O2(t5, { locale: e4.$L, utc: e4.$u, x: e4.$x, $offset: e4.$offset }); + }; + var _2 = function() { + function M3(t5) { + this.$L = w3(t5.locale, null, true), this.parse(t5), this.$x = this.$x || t5.x || {}, this[p3] = true; + } + __name(M3, "M"); + var m3 = M3.prototype; + return m3.parse = function(t5) { + this.$d = function(t6) { + var e4 = t6.date, n3 = t6.utc; + if (null === e4) return /* @__PURE__ */ new Date(NaN); + if (b2.u(e4)) return /* @__PURE__ */ new Date(); + if (e4 instanceof Date) return new Date(e4); + if ("string" == typeof e4 && !/Z$/i.test(e4)) { + var r3 = e4.match($3); + if (r3) { + var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3); + return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3); + } + } + return new Date(e4); + }(t5), this.init(); + }, m3.init = function() { + var t5 = this.$d; + this.$y = t5.getFullYear(), this.$M = t5.getMonth(), this.$D = t5.getDate(), this.$W = t5.getDay(), this.$H = t5.getHours(), this.$m = t5.getMinutes(), this.$s = t5.getSeconds(), this.$ms = t5.getMilliseconds(); + }, m3.$utils = function() { + return b2; + }, m3.isValid = function() { + return !(this.$d.toString() === l2); + }, m3.isSame = function(t5, e4) { + var n3 = O2(t5); + return this.startOf(e4) <= n3 && n3 <= this.endOf(e4); + }, m3.isAfter = function(t5, e4) { + return O2(t5) < this.startOf(e4); + }, m3.isBefore = function(t5, e4) { + return this.endOf(e4) < O2(t5); + }, m3.$g = function(t5, e4, n3) { + return b2.u(t5) ? this[e4] : this.set(n3, t5); + }, m3.unix = function() { + return Math.floor(this.valueOf() / 1e3); + }, m3.valueOf = function() { + return this.$d.getTime(); + }, m3.startOf = function(t5, e4) { + var n3 = this, r3 = !!b2.u(e4) || e4, f4 = b2.p(t5), l3 = /* @__PURE__ */ __name(function(t6, e6) { + var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e6, t6) : new Date(n3.$y, e6, t6), n3); + return r3 ? i3 : i3.endOf(a2); + }, "l"), $4 = /* @__PURE__ */ __name(function(t6, e6) { + return b2.w(n3.toDate()[t6].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e6)), n3); + }, "$"), y6 = this.$W, M4 = this.$M, m4 = this.$D, v4 = "set" + (this.$u ? "UTC" : ""); + switch (f4) { + case h2: + return r3 ? l3(1, 0) : l3(31, 11); + case c3: + return r3 ? l3(1, M4) : l3(0, M4 + 1); + case o2: + var g3 = this.$locale().weekStart || 0, D4 = (y6 < g3 ? y6 + 7 : y6) - g3; + return l3(r3 ? m4 - D4 : m4 + (6 - D4), M4); + case a2: + case d2: + return $4(v4 + "Hours", 0); + case u2: + return $4(v4 + "Minutes", 1); + case s2: + return $4(v4 + "Seconds", 2); + case i2: + return $4(v4 + "Milliseconds", 3); + default: + return this.clone(); + } + }, m3.endOf = function(t5) { + return this.startOf(t5, false); + }, m3.$set = function(t5, e4) { + var n3, o3 = b2.p(t5), f4 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f4 + "Date", n3[d2] = f4 + "Date", n3[c3] = f4 + "Month", n3[h2] = f4 + "FullYear", n3[u2] = f4 + "Hours", n3[s2] = f4 + "Minutes", n3[i2] = f4 + "Seconds", n3[r2] = f4 + "Milliseconds", n3)[o3], $4 = o3 === a2 ? this.$D + (e4 - this.$W) : e4; + if (o3 === c3 || o3 === h2) { + var y6 = this.clone().set(d2, 1); + y6.$d[l3]($4), y6.init(), this.$d = y6.set(d2, Math.min(this.$D, y6.daysInMonth())).$d; + } else l3 && this.$d[l3]($4); + return this.init(), this; + }, m3.set = function(t5, e4) { + return this.clone().$set(t5, e4); + }, m3.get = function(t5) { + return this[b2.p(t5)](); + }, m3.add = function(r3, f4) { + var d3, l3 = this; + r3 = Number(r3); + var $4 = b2.p(f4), y6 = /* @__PURE__ */ __name(function(t5) { + var e4 = O2(l3); + return b2.w(e4.date(e4.date() + Math.round(t5 * r3)), l3); + }, "y"); + if ($4 === c3) return this.set(c3, this.$M + r3); + if ($4 === h2) return this.set(h2, this.$y + r3); + if ($4 === a2) return y6(1); + if ($4 === o2) return y6(7); + var M4 = (d3 = {}, d3[s2] = e3, d3[u2] = n2, d3[i2] = t4, d3)[$4] || 1, m4 = this.$d.getTime() + r3 * M4; + return b2.w(m4, this); + }, m3.subtract = function(t5, e4) { + return this.add(-1 * t5, e4); + }, m3.format = function(t5) { + var e4 = this, n3 = this.$locale(); + if (!this.isValid()) return n3.invalidDate || l2; + var r3 = t5 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c4 = n3.months, f4 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t6, n4, i4, s4) { + return t6 && (t6[n4] || t6(e4, r3)) || i4[n4].slice(0, s4); + }, "h"), d3 = /* @__PURE__ */ __name(function(t6) { + return b2.s(s3 % 12 || 12, t6, "0"); + }, "d"), $4 = f4 || function(t6, e6, n4) { + var r4 = t6 < 12 ? "AM" : "PM"; + return n4 ? r4.toLowerCase() : r4; + }; + return r3.replace(y5, function(t6, r4) { + return r4 || function(t7) { + switch (t7) { + case "YY": + return String(e4.$y).slice(-2); + case "YYYY": + return b2.s(e4.$y, 4, "0"); + case "M": + return a3 + 1; + case "MM": + return b2.s(a3 + 1, 2, "0"); + case "MMM": + return h3(n3.monthsShort, a3, c4, 3); + case "MMMM": + return h3(c4, a3); + case "D": + return e4.$D; + case "DD": + return b2.s(e4.$D, 2, "0"); + case "d": + return String(e4.$W); + case "dd": + return h3(n3.weekdaysMin, e4.$W, o3, 2); + case "ddd": + return h3(n3.weekdaysShort, e4.$W, o3, 3); + case "dddd": + return o3[e4.$W]; + case "H": + return String(s3); + case "HH": + return b2.s(s3, 2, "0"); + case "h": + return d3(1); + case "hh": + return d3(2); + case "a": + return $4(s3, u3, true); + case "A": + return $4(s3, u3, false); + case "m": + return String(u3); + case "mm": + return b2.s(u3, 2, "0"); + case "s": + return String(e4.$s); + case "ss": + return b2.s(e4.$s, 2, "0"); + case "SSS": + return b2.s(e4.$ms, 3, "0"); + case "Z": + return i3; + } + return null; + }(t6) || i3.replace(":", ""); + }); + }, m3.utcOffset = function() { + return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); + }, m3.diff = function(r3, d3, l3) { + var $4, y6 = this, M4 = b2.p(d3), m4 = O2(r3), v4 = (m4.utcOffset() - this.utcOffset()) * e3, g3 = this - m4, D4 = /* @__PURE__ */ __name(function() { + return b2.m(y6, m4); + }, "D"); + switch (M4) { + case h2: + $4 = D4() / 12; + break; + case c3: + $4 = D4(); + break; + case f3: + $4 = D4() / 3; + break; + case o2: + $4 = (g3 - v4) / 6048e5; + break; + case a2: + $4 = (g3 - v4) / 864e5; + break; + case u2: + $4 = g3 / n2; + break; + case s2: + $4 = g3 / e3; + break; + case i2: + $4 = g3 / t4; + break; + default: + $4 = g3; + } + return l3 ? $4 : b2.a($4); + }, m3.daysInMonth = function() { + return this.endOf(c3).$D; + }, m3.$locale = function() { + return D3[this.$L]; + }, m3.locale = function(t5, e4) { + if (!t5) return this.$L; + var n3 = this.clone(), r3 = w3(t5, e4, true); + return r3 && (n3.$L = r3), n3; + }, m3.clone = function() { + return b2.w(this.$d, this); + }, m3.toDate = function() { + return new Date(this.valueOf()); + }, m3.toJSON = function() { + return this.isValid() ? this.toISOString() : null; + }, m3.toISOString = function() { + return this.$d.toISOString(); + }, m3.toString = function() { + return this.$d.toUTCString(); + }, M3; + }(), k2 = _2.prototype; + return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c3], ["$y", h2], ["$D", d2]].forEach(function(t5) { + k2[t5[1]] = function(e4) { + return this.$g(e4, t5[0], t5[1]); }; - if ($2 === c2) - return this.set(c2, this.$M + r2); - if ($2 === h) - return this.set(h, this.$y + r2); - if ($2 === a) - return y3(1); - if ($2 === o) - return y3(7); - var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i2] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3; - return b.w(m3, this); - }, m2.subtract = function(t4, e3) { - return this.add(-1 * t4, e3); - }, m2.format = function(t4) { - var e3 = this, n2 = this.$locale(); - if (!this.isValid()) - return n2.invalidDate || l; - var r2 = t4 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c3 = n2.months, f3 = n2.meridiem, h2 = function(t5, n3, i4, s3) { - return t5 && (t5[n3] || t5(e3, r2)) || i4[n3].slice(0, s3); - }, d2 = function(t5) { - return b.s(s2 % 12 || 12, t5, "0"); - }, $2 = f3 || function(t5, e4, n3) { - var r3 = t5 < 12 ? "AM" : "PM"; - return n3 ? r3.toLowerCase() : r3; + }), O2.extend = function(t5, e4) { + return t5.$i || (t5(e4, _2, O2), t5.$i = true), O2; + }, O2.locale = w3, O2.isDayjs = S3, O2.unix = function(t5) { + return O2(1e3 * t5); + }, O2.en = D3[g2], O2.Ls = D3, O2.p = {}, O2; + }); + } + }); + + // src/logger.ts + var import_dayjs, LEVELS, log, setLogLevel, format; + var init_logger = __esm({ + "src/logger.ts"() { + "use strict"; + import_dayjs = __toESM(require_dayjs_min(), 1); + LEVELS = { + trace: 0, + debug: 1, + info: 2, + warn: 3, + error: 4, + fatal: 5 + }; + log = { + trace: /* @__PURE__ */ __name((..._args) => { + }, "trace"), + debug: /* @__PURE__ */ __name((..._args) => { + }, "debug"), + info: /* @__PURE__ */ __name((..._args) => { + }, "info"), + warn: /* @__PURE__ */ __name((..._args) => { + }, "warn"), + error: /* @__PURE__ */ __name((..._args) => { + }, "error"), + fatal: /* @__PURE__ */ __name((..._args) => { + }, "fatal") + }; + setLogLevel = /* @__PURE__ */ __name(function(level = "fatal") { + let numericLevel = LEVELS.fatal; + if (typeof level === "string") { + if (level.toLowerCase() in LEVELS) { + numericLevel = LEVELS[level]; + } + } else if (typeof level === "number") { + numericLevel = level; + } + log.trace = () => { + }; + log.debug = () => { + }; + log.info = () => { + }; + log.warn = () => { + }; + log.error = () => { + }; + log.fatal = () => { + }; + if (numericLevel <= LEVELS.fatal) { + log.fatal = console.error ? console.error.bind(console, format("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format("FATAL")); + } + if (numericLevel <= LEVELS.error) { + log.error = console.error ? console.error.bind(console, format("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format("ERROR")); + } + if (numericLevel <= LEVELS.warn) { + log.warn = console.warn ? console.warn.bind(console, format("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format("WARN")); + } + if (numericLevel <= LEVELS.info) { + log.info = console.info ? console.info.bind(console, format("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format("INFO")); + } + if (numericLevel <= LEVELS.debug) { + log.debug = console.debug ? console.debug.bind(console, format("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("DEBUG")); + } + if (numericLevel <= LEVELS.trace) { + log.trace = console.debug ? console.debug.bind(console, format("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("TRACE")); + } + }, "setLogLevel"); + format = /* @__PURE__ */ __name((level) => { + const time4 = (0, import_dayjs.default)().format("ss.SSS"); + return `%c${time4} : ${level} : `; + }, "format"); + } + }); + + // src/diagram-api/regexes.ts + var frontMatterRegex, directiveRegex, anyCommentRegex; + var init_regexes = __esm({ + "src/diagram-api/regexes.ts"() { + "use strict"; + frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s; + directiveRegex = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi; + anyCommentRegex = /\s*%%.*\n/gm; + } + }); + + // src/errors.ts + var UnknownDiagramError; + var init_errors = __esm({ + "src/errors.ts"() { + "use strict"; + UnknownDiagramError = class extends Error { + static { + __name(this, "UnknownDiagramError"); + } + constructor(message) { + super(message); + this.name = "UnknownDiagramError"; + } + }; + } + }); + + // src/diagram-api/detectType.ts + var detectors, detectType, registerLazyLoadedDiagrams, addDetector, getDiagramLoader; + var init_detectType = __esm({ + "src/diagram-api/detectType.ts"() { + "use strict"; + init_logger(); + init_regexes(); + init_errors(); + detectors = {}; + detectType = /* @__PURE__ */ __name(function(text2, config6) { + text2 = text2.replace(frontMatterRegex, "").replace(directiveRegex, "").replace(anyCommentRegex, "\n"); + for (const [key, { detector: detector24 }] of Object.entries(detectors)) { + const diagram23 = detector24(text2, config6); + if (diagram23) { + return key; + } + } + throw new UnknownDiagramError( + `No diagram type detected matching given configuration for text: ${text2}` + ); + }, "detectType"); + registerLazyLoadedDiagrams = /* @__PURE__ */ __name((...diagrams2) => { + for (const { id: id26, detector: detector24, loader: loader25 } of diagrams2) { + addDetector(id26, detector24, loader25); + } + }, "registerLazyLoadedDiagrams"); + addDetector = /* @__PURE__ */ __name((key, detector24, loader25) => { + if (detectors[key]) { + log.warn(`Detector with key ${key} already exists. Overwriting.`); + } + detectors[key] = { detector: detector24, loader: loader25 }; + log.debug(`Detector with key ${key} added${loader25 ? " with loader" : ""}`); + }, "addDetector"); + getDiagramLoader = /* @__PURE__ */ __name((key) => { + return detectors[key].loader; + }, "getDiagramLoader"); + } + }); + + // src/diagrams/c4/parser/c4Diagram.jison + var parser, c4Diagram_default; + var init_c4Diagram = __esm({ + "src/diagrams/c4/parser/c4Diagram.jison"() { + "use strict"; + parser = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" }, + productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 3: + yy.setDirection("TB"); + break; + case 4: + yy.setDirection("BT"); + break; + case 5: + yy.setDirection("RL"); + break; + case 6: + yy.setDirection("LR"); + break; + case 8: + case 9: + case 10: + case 11: + case 12: + yy.setC4Type($$[$0 - 3]); + break; + case 19: + yy.setTitle($$[$0].substring(6)); + this.$ = $$[$0].substring(6); + break; + case 20: + yy.setAccDescription($$[$0].substring(15)); + this.$ = $$[$0].substring(15); + break; + case 21: + this.$ = $$[$0].trim(); + yy.setTitle(this.$); + break; + case 22: + case 23: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 28: + $$[$0].splice(2, 0, "ENTERPRISE"); + yy.addPersonOrSystemBoundary(...$$[$0]); + this.$ = $$[$0]; + break; + case 29: + $$[$0].splice(2, 0, "SYSTEM"); + yy.addPersonOrSystemBoundary(...$$[$0]); + this.$ = $$[$0]; + break; + case 30: + yy.addPersonOrSystemBoundary(...$$[$0]); + this.$ = $$[$0]; + break; + case 31: + $$[$0].splice(2, 0, "CONTAINER"); + yy.addContainerBoundary(...$$[$0]); + this.$ = $$[$0]; + break; + case 32: + yy.addDeploymentNode("node", ...$$[$0]); + this.$ = $$[$0]; + break; + case 33: + yy.addDeploymentNode("nodeL", ...$$[$0]); + this.$ = $$[$0]; + break; + case 34: + yy.addDeploymentNode("nodeR", ...$$[$0]); + this.$ = $$[$0]; + break; + case 35: + yy.popBoundaryParseStack(); + break; + case 39: + yy.addPersonOrSystem("person", ...$$[$0]); + this.$ = $$[$0]; + break; + case 40: + yy.addPersonOrSystem("external_person", ...$$[$0]); + this.$ = $$[$0]; + break; + case 41: + yy.addPersonOrSystem("system", ...$$[$0]); + this.$ = $$[$0]; + break; + case 42: + yy.addPersonOrSystem("system_db", ...$$[$0]); + this.$ = $$[$0]; + break; + case 43: + yy.addPersonOrSystem("system_queue", ...$$[$0]); + this.$ = $$[$0]; + break; + case 44: + yy.addPersonOrSystem("external_system", ...$$[$0]); + this.$ = $$[$0]; + break; + case 45: + yy.addPersonOrSystem("external_system_db", ...$$[$0]); + this.$ = $$[$0]; + break; + case 46: + yy.addPersonOrSystem("external_system_queue", ...$$[$0]); + this.$ = $$[$0]; + break; + case 47: + yy.addContainer("container", ...$$[$0]); + this.$ = $$[$0]; + break; + case 48: + yy.addContainer("container_db", ...$$[$0]); + this.$ = $$[$0]; + break; + case 49: + yy.addContainer("container_queue", ...$$[$0]); + this.$ = $$[$0]; + break; + case 50: + yy.addContainer("external_container", ...$$[$0]); + this.$ = $$[$0]; + break; + case 51: + yy.addContainer("external_container_db", ...$$[$0]); + this.$ = $$[$0]; + break; + case 52: + yy.addContainer("external_container_queue", ...$$[$0]); + this.$ = $$[$0]; + break; + case 53: + yy.addComponent("component", ...$$[$0]); + this.$ = $$[$0]; + break; + case 54: + yy.addComponent("component_db", ...$$[$0]); + this.$ = $$[$0]; + break; + case 55: + yy.addComponent("component_queue", ...$$[$0]); + this.$ = $$[$0]; + break; + case 56: + yy.addComponent("external_component", ...$$[$0]); + this.$ = $$[$0]; + break; + case 57: + yy.addComponent("external_component_db", ...$$[$0]); + this.$ = $$[$0]; + break; + case 58: + yy.addComponent("external_component_queue", ...$$[$0]); + this.$ = $$[$0]; + break; + case 60: + yy.addRel("rel", ...$$[$0]); + this.$ = $$[$0]; + break; + case 61: + yy.addRel("birel", ...$$[$0]); + this.$ = $$[$0]; + break; + case 62: + yy.addRel("rel_u", ...$$[$0]); + this.$ = $$[$0]; + break; + case 63: + yy.addRel("rel_d", ...$$[$0]); + this.$ = $$[$0]; + break; + case 64: + yy.addRel("rel_l", ...$$[$0]); + this.$ = $$[$0]; + break; + case 65: + yy.addRel("rel_r", ...$$[$0]); + this.$ = $$[$0]; + break; + case 66: + yy.addRel("rel_b", ...$$[$0]); + this.$ = $$[$0]; + break; + case 67: + $$[$0].splice(0, 1); + yy.addRel("rel", ...$$[$0]); + this.$ = $$[$0]; + break; + case 68: + yy.updateElStyle("update_el_style", ...$$[$0]); + this.$ = $$[$0]; + break; + case 69: + yy.updateRelStyle("update_rel_style", ...$$[$0]); + this.$ = $$[$0]; + break; + case 70: + yy.updateLayoutConfig("update_layout_config", ...$$[$0]); + this.$ = $$[$0]; + break; + case 71: + this.$ = [$$[$0]]; + break; + case 72: + $$[$0].unshift($$[$0 - 1]); + this.$ = $$[$0]; + break; + case 73: + case 75: + this.$ = $$[$0].trim(); + break; + case 74: + let kv = {}; + kv[$$[$0 - 1].trim()] = $$[$0].trim(); + this.$ = kv; + break; + case 76: + this.$ = ""; + break; + } + }, "anonymous"), + table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o2($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o2($VH, [2, 14]), o2($VI, [2, 16], { 12: [1, 76] }), o2($VH, [2, 36], { 12: [1, 77] }), o2($VJ, [2, 19]), o2($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o2($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o2($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o2($VH, [2, 15]), o2($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o2($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o2($VJ, [2, 21]), o2($VJ, [2, 22]), o2($VO, [2, 39]), o2($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o2($VQ, [2, 73]), { 78: [1, 133] }, o2($VQ, [2, 75]), o2($VQ, [2, 76]), o2($VO, [2, 40]), o2($VO, [2, 41]), o2($VO, [2, 42]), o2($VO, [2, 43]), o2($VO, [2, 44]), o2($VO, [2, 45]), o2($VO, [2, 46]), o2($VO, [2, 47]), o2($VO, [2, 48]), o2($VO, [2, 49]), o2($VO, [2, 50]), o2($VO, [2, 51]), o2($VO, [2, 52]), o2($VO, [2, 53]), o2($VO, [2, 54]), o2($VO, [2, 55]), o2($VO, [2, 56]), o2($VO, [2, 57]), o2($VO, [2, 58]), o2($VO, [2, 60]), o2($VO, [2, 61]), o2($VO, [2, 62]), o2($VO, [2, 63]), o2($VO, [2, 64]), o2($VO, [2, 65]), o2($VO, [2, 66]), o2($VO, [2, 67]), o2($VO, [2, 68]), o2($VO, [2, 69]), o2($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o2($VR, [2, 28]), o2($VR, [2, 29]), o2($VR, [2, 30]), o2($VR, [2, 31]), o2($VR, [2, 32]), o2($VR, [2, 33]), o2($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o2($VI, [2, 18]), o2($VH, [2, 38]), o2($VP, [2, 72]), o2($VQ, [2, 74]), o2($VO, [2, 24]), o2($VO, [2, 35]), o2($VS, [2, 25]), o2($VS, [2, 26], { 12: [1, 138] }), o2($VS, [2, 27])], + defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; + } + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; + } + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } + } + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: {}, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + return 6; + break; + case 1: + return 7; + break; + case 2: + return 8; + break; + case 3: + return 9; + break; + case 4: + return 22; + break; + case 5: + return 23; + break; + case 6: + this.begin("acc_title"); + return 24; + break; + case 7: + this.popState(); + return "acc_title_value"; + break; + case 8: + this.begin("acc_descr"); + return 26; + break; + case 9: + this.popState(); + return "acc_descr_value"; + break; + case 10: + this.begin("acc_descr_multiline"); + break; + case 11: + this.popState(); + break; + case 12: + return "acc_descr_multiline_value"; + break; + case 13: + break; + case 14: + c; + break; + case 15: + return 12; + break; + case 16: + break; + case 17: + return 11; + break; + case 18: + return 15; + break; + case 19: + return 16; + break; + case 20: + return 17; + break; + case 21: + return 18; + break; + case 22: + this.begin("person_ext"); + return 45; + break; + case 23: + this.begin("person"); + return 44; + break; + case 24: + this.begin("system_ext_queue"); + return 51; + break; + case 25: + this.begin("system_ext_db"); + return 50; + break; + case 26: + this.begin("system_ext"); + return 49; + break; + case 27: + this.begin("system_queue"); + return 48; + break; + case 28: + this.begin("system_db"); + return 47; + break; + case 29: + this.begin("system"); + return 46; + break; + case 30: + this.begin("boundary"); + return 37; + break; + case 31: + this.begin("enterprise_boundary"); + return 34; + break; + case 32: + this.begin("system_boundary"); + return 36; + break; + case 33: + this.begin("container_ext_queue"); + return 57; + break; + case 34: + this.begin("container_ext_db"); + return 56; + break; + case 35: + this.begin("container_ext"); + return 55; + break; + case 36: + this.begin("container_queue"); + return 54; + break; + case 37: + this.begin("container_db"); + return 53; + break; + case 38: + this.begin("container"); + return 52; + break; + case 39: + this.begin("container_boundary"); + return 38; + break; + case 40: + this.begin("component_ext_queue"); + return 63; + break; + case 41: + this.begin("component_ext_db"); + return 62; + break; + case 42: + this.begin("component_ext"); + return 61; + break; + case 43: + this.begin("component_queue"); + return 60; + break; + case 44: + this.begin("component_db"); + return 59; + break; + case 45: + this.begin("component"); + return 58; + break; + case 46: + this.begin("node"); + return 39; + break; + case 47: + this.begin("node"); + return 39; + break; + case 48: + this.begin("node_l"); + return 40; + break; + case 49: + this.begin("node_r"); + return 41; + break; + case 50: + this.begin("rel"); + return 64; + break; + case 51: + this.begin("birel"); + return 65; + break; + case 52: + this.begin("rel_u"); + return 66; + break; + case 53: + this.begin("rel_u"); + return 66; + break; + case 54: + this.begin("rel_d"); + return 67; + break; + case 55: + this.begin("rel_d"); + return 67; + break; + case 56: + this.begin("rel_l"); + return 68; + break; + case 57: + this.begin("rel_l"); + return 68; + break; + case 58: + this.begin("rel_r"); + return 69; + break; + case 59: + this.begin("rel_r"); + return 69; + break; + case 60: + this.begin("rel_b"); + return 70; + break; + case 61: + this.begin("rel_index"); + return 71; + break; + case 62: + this.begin("update_el_style"); + return 72; + break; + case 63: + this.begin("update_rel_style"); + return 73; + break; + case 64: + this.begin("update_layout_config"); + return 74; + break; + case 65: + return "EOF_IN_STRUCT"; + break; + case 66: + this.begin("attribute"); + return "ATTRIBUTE_EMPTY"; + break; + case 67: + this.begin("attribute"); + break; + case 68: + this.popState(); + this.popState(); + break; + case 69: + return 80; + break; + case 70: + break; + case 71: + return 80; + break; + case 72: + this.begin("string"); + break; + case 73: + this.popState(); + break; + case 74: + return "STR"; + break; + case 75: + this.begin("string_kv"); + break; + case 76: + this.begin("string_kv_key"); + return "STR_KEY"; + break; + case 77: + this.popState(); + this.begin("string_kv_value"); + break; + case 78: + return "STR_VALUE"; + break; + case 79: + this.popState(); + this.popState(); + break; + case 80: + return "STR"; + break; + case 81: + return "LBRACE"; + break; + case 82: + return "RBRACE"; + break; + case 83: + return "SPACE"; + break; + case 84: + return "EOL"; + break; + case 85: + return 14; + break; + } + }, "anonymous"), + rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/], + conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } } }; - return r2.replace(y2, function(t5, r3) { - return r3 || function(t6) { - switch (t6) { - case "YY": - return String(e3.$y).slice(-2); - case "YYYY": - return b.s(e3.$y, 4, "0"); - case "M": - return a2 + 1; - case "MM": - return b.s(a2 + 1, 2, "0"); - case "MMM": - return h2(n2.monthsShort, a2, c3, 3); - case "MMMM": - return h2(c3, a2); - case "D": - return e3.$D; - case "DD": - return b.s(e3.$D, 2, "0"); - case "d": - return String(e3.$W); - case "dd": - return h2(n2.weekdaysMin, e3.$W, o2, 2); - case "ddd": - return h2(n2.weekdaysShort, e3.$W, o2, 3); - case "dddd": - return o2[e3.$W]; - case "H": - return String(s2); - case "HH": - return b.s(s2, 2, "0"); - case "h": - return d2(1); - case "hh": - return d2(2); - case "a": - return $2(s2, u2, true); - case "A": - return $2(s2, u2, false); - case "m": - return String(u2); - case "mm": - return b.s(u2, 2, "0"); - case "s": - return String(e3.$s); - case "ss": - return b.s(e3.$s, 2, "0"); - case "SSS": - return b.s(e3.$ms, 3, "0"); - case "Z": - return i3; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser.parser = parser; + c4Diagram_default = parser; + } + }); + + // src/assignWithDepth.ts + var assignWithDepth, assignWithDepth_default; + var init_assignWithDepth = __esm({ + "src/assignWithDepth.ts"() { + "use strict"; + assignWithDepth = /* @__PURE__ */ __name((dst, src, { depth = 2, clobber = false } = {}) => { + const config6 = { depth, clobber }; + if (Array.isArray(src) && !Array.isArray(dst)) { + src.forEach((s2) => assignWithDepth(dst, s2, config6)); + return dst; + } else if (Array.isArray(src) && Array.isArray(dst)) { + src.forEach((s2) => { + if (!dst.includes(s2)) { + dst.push(s2); + } + }); + return dst; + } + if (dst === void 0 || depth <= 0) { + if (dst !== void 0 && dst !== null && typeof dst === "object" && typeof src === "object") { + return Object.assign(dst, src); + } else { + return src; + } + } + if (src !== void 0 && typeof dst === "object" && typeof src === "object") { + Object.keys(src).forEach((key) => { + if (typeof src[key] === "object" && (dst[key] === void 0 || typeof dst[key] === "object")) { + if (dst[key] === void 0) { + dst[key] = Array.isArray(src[key]) ? [] : {}; } - return null; - }(t5) || i3.replace(":", ""); + dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber }); + } else if (clobber || typeof dst[key] !== "object" && typeof src[key] !== "object") { + dst[key] = src[key]; + } }); - }, m2.utcOffset = function() { - return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, m2.diff = function(r2, d2, l2) { - var $2, y3 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D3 = function() { - return b.m(y3, m3); - }; - switch (M3) { - case h: - $2 = D3() / 12; - break; - case c2: - $2 = D3(); - break; - case f2: - $2 = D3() / 3; - break; - case o: - $2 = (g2 - v2) / 6048e5; - break; - case a: - $2 = (g2 - v2) / 864e5; - break; - case u: - $2 = g2 / n; - break; - case s: - $2 = g2 / e; - break; - case i2: - $2 = g2 / t; - break; + } + return dst; + }, "assignWithDepth"); + assignWithDepth_default = assignWithDepth; + } + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/channel.js + var Channel, channel_default; + var init_channel = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/channel.js"() { + "use strict"; + Channel = { + /* CLAMP */ + min: { + r: 0, + g: 0, + b: 0, + s: 0, + l: 0, + a: 0 + }, + max: { + r: 255, + g: 255, + b: 255, + h: 360, + s: 100, + l: 100, + a: 1 + }, + clamp: { + r: /* @__PURE__ */ __name((r2) => r2 >= 255 ? 255 : r2 < 0 ? 0 : r2, "r"), + g: /* @__PURE__ */ __name((g2) => g2 >= 255 ? 255 : g2 < 0 ? 0 : g2, "g"), + b: /* @__PURE__ */ __name((b2) => b2 >= 255 ? 255 : b2 < 0 ? 0 : b2, "b"), + h: /* @__PURE__ */ __name((h2) => h2 % 360, "h"), + s: /* @__PURE__ */ __name((s2) => s2 >= 100 ? 100 : s2 < 0 ? 0 : s2, "s"), + l: /* @__PURE__ */ __name((l2) => l2 >= 100 ? 100 : l2 < 0 ? 0 : l2, "l"), + a: /* @__PURE__ */ __name((a2) => a2 >= 1 ? 1 : a2 < 0 ? 0 : a2, "a") + }, + /* CONVERSION */ + //SOURCE: https://planetcalc.com/7779 + toLinear: /* @__PURE__ */ __name((c3) => { + const n2 = c3 / 255; + return c3 > 0.03928 ? Math.pow((n2 + 0.055) / 1.055, 2.4) : n2 / 12.92; + }, "toLinear"), + //SOURCE: https://gist.github.com/mjackson/5311256 + hue2rgb: /* @__PURE__ */ __name((p3, q2, t4) => { + if (t4 < 0) + t4 += 1; + if (t4 > 1) + t4 -= 1; + if (t4 < 1 / 6) + return p3 + (q2 - p3) * 6 * t4; + if (t4 < 1 / 2) + return q2; + if (t4 < 2 / 3) + return p3 + (q2 - p3) * (2 / 3 - t4) * 6; + return p3; + }, "hue2rgb"), + hsl2rgb: /* @__PURE__ */ __name(({ h: h2, s: s2, l: l2 }, channel2) => { + if (!s2) + return l2 * 2.55; + h2 /= 360; + s2 /= 100; + l2 /= 100; + const q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2; + const p3 = 2 * l2 - q2; + switch (channel2) { + case "r": + return Channel.hue2rgb(p3, q2, h2 + 1 / 3) * 255; + case "g": + return Channel.hue2rgb(p3, q2, h2) * 255; + case "b": + return Channel.hue2rgb(p3, q2, h2 - 1 / 3) * 255; + } + }, "hsl2rgb"), + rgb2hsl: /* @__PURE__ */ __name(({ r: r2, g: g2, b: b2 }, channel2) => { + r2 /= 255; + g2 /= 255; + b2 /= 255; + const max10 = Math.max(r2, g2, b2); + const min9 = Math.min(r2, g2, b2); + const l2 = (max10 + min9) / 2; + if (channel2 === "l") + return l2 * 100; + if (max10 === min9) + return 0; + const d2 = max10 - min9; + const s2 = l2 > 0.5 ? d2 / (2 - max10 - min9) : d2 / (max10 + min9); + if (channel2 === "s") + return s2 * 100; + switch (max10) { + case r2: + return ((g2 - b2) / d2 + (g2 < b2 ? 6 : 0)) * 60; + case g2: + return ((b2 - r2) / d2 + 2) * 60; + case b2: + return ((r2 - g2) / d2 + 4) * 60; default: - $2 = g2; - } - return l2 ? $2 : b.a($2); - }, m2.daysInMonth = function() { - return this.endOf(c2).$D; - }, m2.$locale = function() { - return D2[this.$L]; - }, m2.locale = function(t4, e3) { - if (!t4) - return this.$L; - var n2 = this.clone(), r2 = w2(t4, e3, true); - return r2 && (n2.$L = r2), n2; - }, m2.clone = function() { - return b.w(this.$d, this); - }, m2.toDate = function() { - return new Date(this.valueOf()); - }, m2.toJSON = function() { - return this.isValid() ? this.toISOString() : null; - }, m2.toISOString = function() { - return this.$d.toISOString(); - }, m2.toString = function() { - return this.$d.toUTCString(); - }, M2; - }(), k = _2.prototype; - return O.prototype = k, [["$ms", r], ["$s", i2], ["$m", s], ["$H", u], ["$W", a], ["$M", c2], ["$y", h], ["$D", d]].forEach(function(t4) { - k[t4[1]] = function(e3) { - return this.$g(e3, t4[0], t4[1]); - }; - }), O.extend = function(t4, e3) { - return t4.$i || (t4(e3, _2, O), t4.$i = true), O; - }, O.locale = w2, O.isDayjs = S2, O.unix = function(t4) { - return O(1e3 * t4); - }, O.en = D2[g], O.Ls = D2, O.p = {}, O; - }); - })(dayjs_min); - var dayjs_minExports = dayjs_min.exports; - const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports); - const LEVELS = { - trace: 0, - debug: 1, - info: 2, - warn: 3, - error: 4, - fatal: 5 - }; - const log$1 = { - trace: (..._args) => { - }, - debug: (..._args) => { - }, - info: (..._args) => { - }, - warn: (..._args) => { - }, - error: (..._args) => { - }, - fatal: (..._args) => { + return -1; + } + }, "rgb2hsl") + }; + channel_default = Channel; } - }; - const setLogLevel$1 = function(level = "fatal") { - let numericLevel = LEVELS.fatal; - if (typeof level === "string") { - level = level.toLowerCase(); - if (level in LEVELS) { - numericLevel = LEVELS[level]; - } - } else if (typeof level === "number") { - numericLevel = level; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/lang.js + var Lang, lang_default; + var init_lang = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/lang.js"() { + "use strict"; + Lang = { + /* API */ + clamp: /* @__PURE__ */ __name((number7, lower2, upper) => { + if (lower2 > upper) + return Math.min(lower2, Math.max(upper, number7)); + return Math.min(upper, Math.max(lower2, number7)); + }, "clamp"), + round: /* @__PURE__ */ __name((number7) => { + return Math.round(number7 * 1e10) / 1e10; + }, "round") + }; + lang_default = Lang; } - log$1.trace = () => { - }; - log$1.debug = () => { - }; - log$1.info = () => { - }; - log$1.warn = () => { - }; - log$1.error = () => { - }; - log$1.fatal = () => { - }; - if (numericLevel <= LEVELS.fatal) { - log$1.fatal = console.error ? console.error.bind(console, format$1("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format$1("FATAL")); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/unit.js + var Unit, unit_default; + var init_unit = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/unit.js"() { + "use strict"; + Unit = { + /* API */ + dec2hex: /* @__PURE__ */ __name((dec) => { + const hex2 = Math.round(dec).toString(16); + return hex2.length > 1 ? hex2 : `0${hex2}`; + }, "dec2hex") + }; + unit_default = Unit; } - if (numericLevel <= LEVELS.error) { - log$1.error = console.error ? console.error.bind(console, format$1("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format$1("ERROR")); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/index.js + var Utils, utils_default; + var init_utils = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/utils/index.js"() { + "use strict"; + init_channel(); + init_lang(); + init_unit(); + Utils = { + channel: channel_default, + lang: lang_default, + unit: unit_default + }; + utils_default = Utils; } - if (numericLevel <= LEVELS.warn) { - log$1.warn = console.warn ? console.warn.bind(console, format$1("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format$1("WARN")); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/constants.js + var DEC2HEX, TYPE; + var init_constants = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/constants.js"() { + "use strict"; + init_utils(); + DEC2HEX = {}; + for (let i2 = 0; i2 <= 255; i2++) + DEC2HEX[i2] = utils_default.unit.dec2hex(i2); + TYPE = { + ALL: 0, + RGB: 1, + HSL: 2 + }; } - if (numericLevel <= LEVELS.info) { - log$1.info = console.info ? console.info.bind(console, format$1("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format$1("INFO")); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/type.js + var Type, type_default; + var init_type = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/type.js"() { + "use strict"; + init_constants(); + Type = class { + static { + __name(this, "Type"); + } + constructor() { + this.type = TYPE.ALL; + } + /* API */ + get() { + return this.type; + } + set(type3) { + if (this.type && this.type !== type3) + throw new Error("Cannot change both RGB and HSL channels at the same time"); + this.type = type3; + } + reset() { + this.type = TYPE.ALL; + } + is(type3) { + return this.type === type3; + } + }; + type_default = Type; } - if (numericLevel <= LEVELS.debug) { - log$1.debug = console.debug ? console.debug.bind(console, format$1("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format$1("DEBUG")); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/index.js + var Channels, channels_default; + var init_channels = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/index.js"() { + "use strict"; + init_utils(); + init_type(); + init_constants(); + Channels = class { + static { + __name(this, "Channels"); + } + /* CONSTRUCTOR */ + constructor(data5, color2) { + this.color = color2; + this.changed = false; + this.data = data5; + this.type = new type_default(); + } + /* API */ + set(data5, color2) { + this.color = color2; + this.changed = false; + this.data = data5; + this.type.type = TYPE.ALL; + return this; + } + /* HELPERS */ + _ensureHSL() { + const data5 = this.data; + const { h: h2, s: s2, l: l2 } = data5; + if (h2 === void 0) + data5.h = utils_default.channel.rgb2hsl(data5, "h"); + if (s2 === void 0) + data5.s = utils_default.channel.rgb2hsl(data5, "s"); + if (l2 === void 0) + data5.l = utils_default.channel.rgb2hsl(data5, "l"); + } + _ensureRGB() { + const data5 = this.data; + const { r: r2, g: g2, b: b2 } = data5; + if (r2 === void 0) + data5.r = utils_default.channel.hsl2rgb(data5, "r"); + if (g2 === void 0) + data5.g = utils_default.channel.hsl2rgb(data5, "g"); + if (b2 === void 0) + data5.b = utils_default.channel.hsl2rgb(data5, "b"); + } + /* GETTERS */ + get r() { + const data5 = this.data; + const r2 = data5.r; + if (!this.type.is(TYPE.HSL) && r2 !== void 0) + return r2; + this._ensureHSL(); + return utils_default.channel.hsl2rgb(data5, "r"); + } + get g() { + const data5 = this.data; + const g2 = data5.g; + if (!this.type.is(TYPE.HSL) && g2 !== void 0) + return g2; + this._ensureHSL(); + return utils_default.channel.hsl2rgb(data5, "g"); + } + get b() { + const data5 = this.data; + const b2 = data5.b; + if (!this.type.is(TYPE.HSL) && b2 !== void 0) + return b2; + this._ensureHSL(); + return utils_default.channel.hsl2rgb(data5, "b"); + } + get h() { + const data5 = this.data; + const h2 = data5.h; + if (!this.type.is(TYPE.RGB) && h2 !== void 0) + return h2; + this._ensureRGB(); + return utils_default.channel.rgb2hsl(data5, "h"); + } + get s() { + const data5 = this.data; + const s2 = data5.s; + if (!this.type.is(TYPE.RGB) && s2 !== void 0) + return s2; + this._ensureRGB(); + return utils_default.channel.rgb2hsl(data5, "s"); + } + get l() { + const data5 = this.data; + const l2 = data5.l; + if (!this.type.is(TYPE.RGB) && l2 !== void 0) + return l2; + this._ensureRGB(); + return utils_default.channel.rgb2hsl(data5, "l"); + } + get a() { + return this.data.a; + } + /* SETTERS */ + set r(r2) { + this.type.set(TYPE.RGB); + this.changed = true; + this.data.r = r2; + } + set g(g2) { + this.type.set(TYPE.RGB); + this.changed = true; + this.data.g = g2; + } + set b(b2) { + this.type.set(TYPE.RGB); + this.changed = true; + this.data.b = b2; + } + set h(h2) { + this.type.set(TYPE.HSL); + this.changed = true; + this.data.h = h2; + } + set s(s2) { + this.type.set(TYPE.HSL); + this.changed = true; + this.data.s = s2; + } + set l(l2) { + this.type.set(TYPE.HSL); + this.changed = true; + this.data.l = l2; + } + set a(a2) { + this.changed = true; + this.data.a = a2; + } + }; + channels_default = Channels; } - if (numericLevel <= LEVELS.trace) { - log$1.trace = console.debug ? console.debug.bind(console, format$1("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format$1("TRACE")); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/reusable.js + var channels, reusable_default; + var init_reusable = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/channels/reusable.js"() { + "use strict"; + init_channels(); + channels = new channels_default({ r: 0, g: 0, b: 0, a: 0 }, "transparent"); + reusable_default = channels; } - }; - const format$1 = (level) => { - const time2 = dayjs().format("ss.SSS"); - return `%c${time2} : ${level} : `; - }; - var dist = {}; - (function(exports2) { - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sanitizeUrl = exports2.BLANK_URL = void 0; - var invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im; - var htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g; - var htmlCtrlEntityRegex = /&(newline|tab);/gi; - var ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim; - var urlSchemeRegex = /^.+(:|:)/gim; - var relativeFirstCharacters = [".", "/"]; - exports2.BLANK_URL = "about:blank"; - function isRelativeUrlWithoutProtocol(url) { - return relativeFirstCharacters.indexOf(url[0]) > -1; - } - function decodeHtmlCharacters(str2) { - var removedNullByte = str2.replace(ctrlCharactersRegex, ""); - return removedNullByte.replace(htmlEntitiesRegex, function(match, dec) { - return String.fromCharCode(dec); - }); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hex.js + var Hex, hex_default; + var init_hex = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hex.js"() { + "use strict"; + init_reusable(); + init_constants(); + Hex = { + /* VARIABLES */ + re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i, + /* API */ + parse: /* @__PURE__ */ __name((color2) => { + if (color2.charCodeAt(0) !== 35) + return; + const match2 = color2.match(Hex.re); + if (!match2) + return; + const hex2 = match2[1]; + const dec = parseInt(hex2, 16); + const length2 = hex2.length; + const hasAlpha = length2 % 4 === 0; + const isFullLength = length2 > 4; + const multiplier = isFullLength ? 1 : 17; + const bits = isFullLength ? 8 : 4; + const bitsOffset = hasAlpha ? 0 : -1; + const mask = isFullLength ? 255 : 15; + return reusable_default.set({ + r: (dec >> bits * (bitsOffset + 3) & mask) * multiplier, + g: (dec >> bits * (bitsOffset + 2) & mask) * multiplier, + b: (dec >> bits * (bitsOffset + 1) & mask) * multiplier, + a: hasAlpha ? (dec & mask) * multiplier / 255 : 1 + }, color2); + }, "parse"), + stringify: /* @__PURE__ */ __name((channels2) => { + const { r: r2, g: g2, b: b2, a: a2 } = channels2; + if (a2 < 1) { + return `#${DEC2HEX[Math.round(r2)]}${DEC2HEX[Math.round(g2)]}${DEC2HEX[Math.round(b2)]}${DEC2HEX[Math.round(a2 * 255)]}`; + } else { + return `#${DEC2HEX[Math.round(r2)]}${DEC2HEX[Math.round(g2)]}${DEC2HEX[Math.round(b2)]}`; + } + }, "stringify") + }; + hex_default = Hex; } - function sanitizeUrl(url) { - if (!url) { - return exports2.BLANK_URL; - } - var sanitizedUrl = decodeHtmlCharacters(url).replace(htmlCtrlEntityRegex, "").replace(ctrlCharactersRegex, "").trim(); - if (!sanitizedUrl) { - return exports2.BLANK_URL; - } - if (isRelativeUrlWithoutProtocol(sanitizedUrl)) { - return sanitizedUrl; - } - var urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex); - if (!urlSchemeParseResults) { - return sanitizedUrl; - } - var urlScheme = urlSchemeParseResults[0]; - if (invalidProtocolRegex.test(urlScheme)) { - return exports2.BLANK_URL; - } - return sanitizedUrl; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hsl.js + var HSL, hsl_default; + var init_hsl = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/hsl.js"() { + "use strict"; + init_utils(); + init_reusable(); + HSL = { + /* VARIABLES */ + re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i, + hueRe: /^(.+?)(deg|grad|rad|turn)$/i, + /* HELPERS */ + _hue2deg: /* @__PURE__ */ __name((hue2) => { + const match2 = hue2.match(HSL.hueRe); + if (match2) { + const [, number7, unit2] = match2; + switch (unit2) { + case "grad": + return utils_default.channel.clamp.h(parseFloat(number7) * 0.9); + case "rad": + return utils_default.channel.clamp.h(parseFloat(number7) * 180 / Math.PI); + case "turn": + return utils_default.channel.clamp.h(parseFloat(number7) * 360); + } + } + return utils_default.channel.clamp.h(parseFloat(hue2)); + }, "_hue2deg"), + /* API */ + parse: /* @__PURE__ */ __name((color2) => { + const charCode = color2.charCodeAt(0); + if (charCode !== 104 && charCode !== 72) + return; + const match2 = color2.match(HSL.re); + if (!match2) + return; + const [, h2, s2, l2, a2, isAlphaPercentage] = match2; + return reusable_default.set({ + h: HSL._hue2deg(h2), + s: utils_default.channel.clamp.s(parseFloat(s2)), + l: utils_default.channel.clamp.l(parseFloat(l2)), + a: a2 ? utils_default.channel.clamp.a(isAlphaPercentage ? parseFloat(a2) / 100 : parseFloat(a2)) : 1 + }, color2); + }, "parse"), + stringify: /* @__PURE__ */ __name((channels2) => { + const { h: h2, s: s2, l: l2, a: a2 } = channels2; + if (a2 < 1) { + return `hsla(${utils_default.lang.round(h2)}, ${utils_default.lang.round(s2)}%, ${utils_default.lang.round(l2)}%, ${a2})`; + } else { + return `hsl(${utils_default.lang.round(h2)}, ${utils_default.lang.round(s2)}%, ${utils_default.lang.round(l2)}%)`; + } + }, "stringify") + }; + hsl_default = HSL; } - exports2.sanitizeUrl = sanitizeUrl; - })(dist); - function ascending$1(a, b) { - return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; - } - function descending$1(a, b) { - return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; - } - function bisector(f2) { - let compare1, compare2, delta; - if (f2.length !== 2) { - compare1 = ascending$1; - compare2 = (d, x2) => ascending$1(f2(d), x2); - delta = (d, x2) => f2(d) - x2; - } else { - compare1 = f2 === ascending$1 || f2 === descending$1 ? f2 : zero$1; - compare2 = f2; - delta = f2; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/keyword.js + var Keyword, keyword_default; + var init_keyword = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/keyword.js"() { + "use strict"; + init_hex(); + Keyword = { + /* VARIABLES */ + colors: { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyanaqua: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgreen: "#006400", + darkgrey: "#a9a9a9", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + gold: "#ffd700", + goldenrod: "#daa520", + gray: "#808080", + green: "#008000", + greenyellow: "#adff2f", + grey: "#808080", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavender: "#e6e6fa", + lavenderblush: "#fff0f5", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgreen: "#90ee90", + lightgrey: "#d3d3d3", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370db", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#db7093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + rebeccapurple: "#663399", + red: "#ff0000", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + transparent: "#00000000", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00", + yellowgreen: "#9acd32" + }, + /* API */ + parse: /* @__PURE__ */ __name((color2) => { + color2 = color2.toLowerCase(); + const hex2 = Keyword.colors[color2]; + if (!hex2) + return; + return hex_default.parse(hex2); + }, "parse"), + stringify: /* @__PURE__ */ __name((channels2) => { + const hex2 = hex_default.stringify(channels2); + for (const name in Keyword.colors) { + if (Keyword.colors[name] === hex2) + return name; + } + return; + }, "stringify") + }; + keyword_default = Keyword; } - function left2(a, x2, lo = 0, hi = a.length) { - if (lo < hi) { - if (compare1(x2, x2) !== 0) - return hi; - do { - const mid = lo + hi >>> 1; - if (compare2(a[mid], x2) < 0) - lo = mid + 1; - else - hi = mid; - } while (lo < hi); - } - return lo; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/rgb.js + var RGB, rgb_default; + var init_rgb = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/rgb.js"() { + "use strict"; + init_utils(); + init_reusable(); + RGB = { + /* VARIABLES */ + re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i, + /* API */ + parse: /* @__PURE__ */ __name((color2) => { + const charCode = color2.charCodeAt(0); + if (charCode !== 114 && charCode !== 82) + return; + const match2 = color2.match(RGB.re); + if (!match2) + return; + const [, r2, isRedPercentage, g2, isGreenPercentage, b2, isBluePercentage, a2, isAlphaPercentage] = match2; + return reusable_default.set({ + r: utils_default.channel.clamp.r(isRedPercentage ? parseFloat(r2) * 2.55 : parseFloat(r2)), + g: utils_default.channel.clamp.g(isGreenPercentage ? parseFloat(g2) * 2.55 : parseFloat(g2)), + b: utils_default.channel.clamp.b(isBluePercentage ? parseFloat(b2) * 2.55 : parseFloat(b2)), + a: a2 ? utils_default.channel.clamp.a(isAlphaPercentage ? parseFloat(a2) / 100 : parseFloat(a2)) : 1 + }, color2); + }, "parse"), + stringify: /* @__PURE__ */ __name((channels2) => { + const { r: r2, g: g2, b: b2, a: a2 } = channels2; + if (a2 < 1) { + return `rgba(${utils_default.lang.round(r2)}, ${utils_default.lang.round(g2)}, ${utils_default.lang.round(b2)}, ${utils_default.lang.round(a2)})`; + } else { + return `rgb(${utils_default.lang.round(r2)}, ${utils_default.lang.round(g2)}, ${utils_default.lang.round(b2)})`; + } + }, "stringify") + }; + rgb_default = RGB; } - function right2(a, x2, lo = 0, hi = a.length) { - if (lo < hi) { - if (compare1(x2, x2) !== 0) - return hi; - do { - const mid = lo + hi >>> 1; - if (compare2(a[mid], x2) <= 0) - lo = mid + 1; - else - hi = mid; - } while (lo < hi); - } - return lo; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/index.js + var Color, color_default; + var init_color = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/color/index.js"() { + "use strict"; + init_hex(); + init_hsl(); + init_keyword(); + init_rgb(); + init_constants(); + Color = { + /* VARIABLES */ + format: { + keyword: keyword_default, + hex: hex_default, + rgb: rgb_default, + rgba: rgb_default, + hsl: hsl_default, + hsla: hsl_default + }, + /* API */ + parse: /* @__PURE__ */ __name((color2) => { + if (typeof color2 !== "string") + return color2; + const channels2 = hex_default.parse(color2) || rgb_default.parse(color2) || hsl_default.parse(color2) || keyword_default.parse(color2); + if (channels2) + return channels2; + throw new Error(`Unsupported color format: "${color2}"`); + }, "parse"), + stringify: /* @__PURE__ */ __name((channels2) => { + if (!channels2.changed && channels2.color) + return channels2.color; + if (channels2.type.is(TYPE.HSL) || channels2.data.r === void 0) { + return hsl_default.stringify(channels2); + } else if (channels2.a < 1 || !Number.isInteger(channels2.r) || !Number.isInteger(channels2.g) || !Number.isInteger(channels2.b)) { + return rgb_default.stringify(channels2); + } else { + return hex_default.stringify(channels2); + } + }, "stringify") + }; + color_default = Color; } - function center2(a, x2, lo = 0, hi = a.length) { - const i2 = left2(a, x2, lo, hi - 1); - return i2 > lo && delta(a[i2 - 1], x2) > -delta(a[i2], x2) ? i2 - 1 : i2; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/change.js + var change, change_default; + var init_change = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/change.js"() { + "use strict"; + init_utils(); + init_color(); + change = /* @__PURE__ */ __name((color2, channels2) => { + const ch = color_default.parse(color2); + for (const c3 in channels2) { + ch[c3] = utils_default.channel.clamp[c3](channels2[c3]); + } + return color_default.stringify(ch); + }, "change"); + change_default = change; } - return { left: left2, center: center2, right: right2 }; - } - function zero$1() { - return 0; - } - function number$3(x2) { - return x2 === null ? NaN : +x2; - } - const ascendingBisect = bisector(ascending$1); - const bisectRight = ascendingBisect.right; - bisector(number$3).center; - const bisect = bisectRight; - class InternMap extends Map { - constructor(entries2, key = keyof) { - super(); - Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } }); - if (entries2 != null) - for (const [key2, value2] of entries2) - this.set(key2, value2); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/rgba.js + var rgba, rgba_default; + var init_rgba = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/rgba.js"() { + "use strict"; + init_utils(); + init_reusable(); + init_color(); + init_change(); + rgba = /* @__PURE__ */ __name((r2, g2, b2 = 0, a2 = 1) => { + if (typeof r2 !== "number") + return change_default(r2, { a: g2 }); + const channels2 = reusable_default.set({ + r: utils_default.channel.clamp.r(r2), + g: utils_default.channel.clamp.g(g2), + b: utils_default.channel.clamp.b(b2), + a: utils_default.channel.clamp.a(a2) + }); + return color_default.stringify(channels2); + }, "rgba"); + rgba_default = rgba; } - get(key) { - return super.get(intern_get(this, key)); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/channel.js + var channel, channel_default2; + var init_channel2 = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/channel.js"() { + "use strict"; + init_utils(); + init_color(); + channel = /* @__PURE__ */ __name((color2, channel2) => { + return utils_default.lang.round(color_default.parse(color2)[channel2]); + }, "channel"); + channel_default2 = channel; } - has(key) { - return super.has(intern_get(this, key)); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/luminance.js + var luminance, luminance_default; + var init_luminance = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/luminance.js"() { + "use strict"; + init_utils(); + init_color(); + luminance = /* @__PURE__ */ __name((color2) => { + const { r: r2, g: g2, b: b2 } = color_default.parse(color2); + const luminance2 = 0.2126 * utils_default.channel.toLinear(r2) + 0.7152 * utils_default.channel.toLinear(g2) + 0.0722 * utils_default.channel.toLinear(b2); + return utils_default.lang.round(luminance2); + }, "luminance"); + luminance_default = luminance; } - set(key, value2) { - return super.set(intern_set(this, key), value2); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_light.js + var isLight, is_light_default; + var init_is_light = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_light.js"() { + "use strict"; + init_luminance(); + isLight = /* @__PURE__ */ __name((color2) => { + return luminance_default(color2) >= 0.5; + }, "isLight"); + is_light_default = isLight; } - delete(key) { - return super.delete(intern_delete(this, key)); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_dark.js + var isDark, is_dark_default; + var init_is_dark = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/is_dark.js"() { + "use strict"; + init_is_light(); + isDark = /* @__PURE__ */ __name((color2) => { + return !is_light_default(color2); + }, "isDark"); + is_dark_default = isDark; } - } - function intern_get({ _intern, _key }, value2) { - const key = _key(value2); - return _intern.has(key) ? _intern.get(key) : value2; - } - function intern_set({ _intern, _key }, value2) { - const key = _key(value2); - if (_intern.has(key)) - return _intern.get(key); - _intern.set(key, value2); - return value2; - } - function intern_delete({ _intern, _key }, value2) { - const key = _key(value2); - if (_intern.has(key)) { - value2 = _intern.get(key); - _intern.delete(key); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust_channel.js + var adjustChannel, adjust_channel_default; + var init_adjust_channel = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust_channel.js"() { + "use strict"; + init_utils(); + init_color(); + adjustChannel = /* @__PURE__ */ __name((color2, channel2, amount) => { + const channels2 = color_default.parse(color2); + const amountCurrent = channels2[channel2]; + const amountNext = utils_default.channel.clamp[channel2](amountCurrent + amount); + if (amountCurrent !== amountNext) + channels2[channel2] = amountNext; + return color_default.stringify(channels2); + }, "adjustChannel"); + adjust_channel_default = adjustChannel; } - return value2; - } - function keyof(value2) { - return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2; - } - const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2); - function tickSpec(start2, stop, count) { - const step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1; - let i1, i2, inc; - if (power < 0) { - inc = Math.pow(10, -power) / factor; - i1 = Math.round(start2 * inc); - i2 = Math.round(stop * inc); - if (i1 / inc < start2) - ++i1; - if (i2 / inc > stop) - --i2; - inc = -inc; - } else { - inc = Math.pow(10, power) * factor; - i1 = Math.round(start2 / inc); - i2 = Math.round(stop / inc); - if (i1 * inc < start2) - ++i1; - if (i2 * inc > stop) - --i2; - } - if (i2 < i1 && 0.5 <= count && count < 2) - return tickSpec(start2, stop, count * 2); - return [i1, i2, inc]; - } - function ticks(start2, stop, count) { - stop = +stop, start2 = +start2, count = +count; - if (!(count > 0)) - return []; - if (start2 === stop) - return [start2]; - const reverse = stop < start2, [i1, i2, inc] = reverse ? tickSpec(stop, start2, count) : tickSpec(start2, stop, count); - if (!(i2 >= i1)) - return []; - const n = i2 - i1 + 1, ticks2 = new Array(n); - if (reverse) { - if (inc < 0) - for (let i3 = 0; i3 < n; ++i3) - ticks2[i3] = (i2 - i3) / -inc; - else - for (let i3 = 0; i3 < n; ++i3) - ticks2[i3] = (i2 - i3) * inc; - } else { - if (inc < 0) - for (let i3 = 0; i3 < n; ++i3) - ticks2[i3] = (i1 + i3) / -inc; - else - for (let i3 = 0; i3 < n; ++i3) - ticks2[i3] = (i1 + i3) * inc; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/lighten.js + var lighten, lighten_default; + var init_lighten = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/lighten.js"() { + "use strict"; + init_adjust_channel(); + lighten = /* @__PURE__ */ __name((color2, amount) => { + return adjust_channel_default(color2, "l", amount); + }, "lighten"); + lighten_default = lighten; } - return ticks2; - } - function tickIncrement(start2, stop, count) { - stop = +stop, start2 = +start2, count = +count; - return tickSpec(start2, stop, count)[2]; - } - function tickStep(start2, stop, count) { - stop = +stop, start2 = +start2, count = +count; - const reverse = stop < start2, inc = reverse ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count); - return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc); - } - function max$3(values2, valueof) { - let max2; - if (valueof === void 0) { - for (const value2 of values2) { - if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) { - max2 = value2; - } - } - } else { - let index2 = -1; - for (let value2 of values2) { - if ((value2 = valueof(value2, ++index2, values2)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) { - max2 = value2; - } - } + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/darken.js + var darken, darken_default; + var init_darken = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/darken.js"() { + "use strict"; + init_adjust_channel(); + darken = /* @__PURE__ */ __name((color2, amount) => { + return adjust_channel_default(color2, "l", -amount); + }, "darken"); + darken_default = darken; } - return max2; - } - function min$3(values2, valueof) { - let min2; - if (valueof === void 0) { - for (const value2 of values2) { - if (value2 != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) { - min2 = value2; - } - } - } else { - let index2 = -1; - for (let value2 of values2) { - if ((value2 = valueof(value2, ++index2, values2)) != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) { - min2 = value2; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust.js + var adjust, adjust_default; + var init_adjust = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/adjust.js"() { + "use strict"; + init_color(); + init_change(); + adjust = /* @__PURE__ */ __name((color2, channels2) => { + const ch = color_default.parse(color2); + const changes = {}; + for (const c3 in channels2) { + if (!channels2[c3]) + continue; + changes[c3] = ch[c3] + channels2[c3]; } - } + return change_default(color2, changes); + }, "adjust"); + adjust_default = adjust; } - return min2; - } - function range$2(start2, stop, step) { - start2 = +start2, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n < 3 ? 1 : +step; - var i2 = -1, n = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range2 = new Array(n); - while (++i2 < n) { - range2[i2] = start2 + i2 * step; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/mix.js + var mix, mix_default; + var init_mix = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/mix.js"() { + "use strict"; + init_color(); + init_rgba(); + mix = /* @__PURE__ */ __name((color1, color2, weight8 = 50) => { + const { r: r1, g: g1, b: b1, a: a1 } = color_default.parse(color1); + const { r: r2, g: g2, b: b2, a: a2 } = color_default.parse(color2); + const weightScale = weight8 / 100; + const weightNormalized = weightScale * 2 - 1; + const alphaDelta = a1 - a2; + const weight1combined = weightNormalized * alphaDelta === -1 ? weightNormalized : (weightNormalized + alphaDelta) / (1 + weightNormalized * alphaDelta); + const weight1 = (weight1combined + 1) / 2; + const weight22 = 1 - weight1; + const r3 = r1 * weight1 + r2 * weight22; + const g3 = g1 * weight1 + g2 * weight22; + const b3 = b1 * weight1 + b2 * weight22; + const a3 = a1 * weightScale + a2 * (1 - weightScale); + return rgba_default(r3, g3, b3, a3); + }, "mix"); + mix_default = mix; } - return range2; - } - function identity$5(x2) { - return x2; - } - var top = 1, right$1 = 2, bottom = 3, left$1 = 4, epsilon$3 = 1e-6; - function translateX(x2) { - return "translate(" + x2 + ",0)"; - } - function translateY(y2) { - return "translate(0," + y2 + ")"; - } - function number$2(scale) { - return (d) => +scale(d); - } - function center$1(scale, offset) { - offset = Math.max(0, scale.bandwidth() - offset * 2) / 2; - if (scale.round()) - offset = Math.round(offset); - return (d) => +scale(d) + offset; - } - function entering() { - return !this.__axis; - } - function axis(orient, scale) { - var tickArguments = [], tickValues = null, tickFormat2 = null, tickSizeInner = 6, tickSizeOuter = 6, tickPadding = 3, offset = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : 0.5, k = orient === top || orient === left$1 ? -1 : 1, x2 = orient === left$1 || orient === right$1 ? "x" : "y", transform = orient === top || orient === bottom ? translateX : translateY; - function axis2(context) { - var values2 = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues, format2 = tickFormat2 == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity$5 : tickFormat2, spacing2 = Math.max(tickSizeInner, 0) + tickPadding, range2 = scale.range(), range0 = +range2[0] + offset, range1 = +range2[range2.length - 1] + offset, position2 = (scale.bandwidth ? center$1 : number$2)(scale.copy(), offset), selection2 = context.selection ? context.selection() : context, path2 = selection2.selectAll(".domain").data([null]), tick = selection2.selectAll(".tick").data(values2, scale).order(), tickExit = tick.exit(), tickEnter = tick.enter().append("g").attr("class", "tick"), line2 = tick.select("line"), text2 = tick.select("text"); - path2 = path2.merge(path2.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")); - tick = tick.merge(tickEnter); - line2 = line2.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x2 + "2", k * tickSizeInner)); - text2 = text2.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x2, k * spacing2).attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em")); - if (context !== selection2) { - path2 = path2.transition(context); - tick = tick.transition(context); - line2 = line2.transition(context); - text2 = text2.transition(context); - tickExit = tickExit.transition(context).attr("opacity", epsilon$3).attr("transform", function(d) { - return isFinite(d = position2(d)) ? transform(d + offset) : this.getAttribute("transform"); - }); - tickEnter.attr("opacity", epsilon$3).attr("transform", function(d) { - var p = this.parentNode.__axis; - return transform((p && isFinite(p = p(d)) ? p : position2(d)) + offset); - }); - } - tickExit.remove(); - path2.attr("d", orient === left$1 || orient === right$1 ? tickSizeOuter ? "M" + k * tickSizeOuter + "," + range0 + "H" + offset + "V" + range1 + "H" + k * tickSizeOuter : "M" + offset + "," + range0 + "V" + range1 : tickSizeOuter ? "M" + range0 + "," + k * tickSizeOuter + "V" + offset + "H" + range1 + "V" + k * tickSizeOuter : "M" + range0 + "," + offset + "H" + range1); - tick.attr("opacity", 1).attr("transform", function(d) { - return transform(position2(d) + offset); - }); - line2.attr(x2 + "2", k * tickSizeInner); - text2.attr(x2, k * spacing2).text(format2); - selection2.filter(entering).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", orient === right$1 ? "start" : orient === left$1 ? "end" : "middle"); - selection2.each(function() { - this.__axis = position2; - }); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/invert.js + var invert, invert_default; + var init_invert = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/invert.js"() { + "use strict"; + init_color(); + init_mix(); + invert = /* @__PURE__ */ __name((color2, weight8 = 100) => { + const inverse = color_default.parse(color2); + inverse.r = 255 - inverse.r; + inverse.g = 255 - inverse.g; + inverse.b = 255 - inverse.b; + return mix_default(inverse, color2, weight8); + }, "invert"); + invert_default = invert; } - axis2.scale = function(_2) { - return arguments.length ? (scale = _2, axis2) : scale; - }; - axis2.ticks = function() { - return tickArguments = Array.from(arguments), axis2; - }; - axis2.tickArguments = function(_2) { - return arguments.length ? (tickArguments = _2 == null ? [] : Array.from(_2), axis2) : tickArguments.slice(); - }; - axis2.tickValues = function(_2) { - return arguments.length ? (tickValues = _2 == null ? null : Array.from(_2), axis2) : tickValues && tickValues.slice(); - }; - axis2.tickFormat = function(_2) { - return arguments.length ? (tickFormat2 = _2, axis2) : tickFormat2; - }; - axis2.tickSize = function(_2) { - return arguments.length ? (tickSizeInner = tickSizeOuter = +_2, axis2) : tickSizeInner; - }; - axis2.tickSizeInner = function(_2) { - return arguments.length ? (tickSizeInner = +_2, axis2) : tickSizeInner; - }; - axis2.tickSizeOuter = function(_2) { - return arguments.length ? (tickSizeOuter = +_2, axis2) : tickSizeOuter; - }; - axis2.tickPadding = function(_2) { - return arguments.length ? (tickPadding = +_2, axis2) : tickPadding; - }; - axis2.offset = function(_2) { - return arguments.length ? (offset = +_2, axis2) : offset; - }; - return axis2; - } - function axisTop(scale) { - return axis(top, scale); - } - function axisBottom(scale) { - return axis(bottom, scale); - } - var noop$2 = { value: () => { - } }; - function dispatch() { - for (var i2 = 0, n = arguments.length, _2 = {}, t; i2 < n; ++i2) { - if (!(t = arguments[i2] + "") || t in _2 || /[\s.]/.test(t)) - throw new Error("illegal type: " + t); - _2[t] = []; + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/index.js + var init_methods = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/index.js"() { + "use strict"; + init_rgba(); + init_channel2(); + init_is_dark(); + init_lighten(); + init_darken(); + init_adjust(); + init_invert(); } - return new Dispatch(_2); - } - function Dispatch(_2) { - this._ = _2; - } - function parseTypenames$1(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i2 = t.indexOf("."); - if (i2 >= 0) - name = t.slice(i2 + 1), t = t.slice(0, i2); - if (t && !types.hasOwnProperty(t)) - throw new Error("unknown type: " + t); - return { type: t, name }; - }); - } - Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _2 = this._, T2 = parseTypenames$1(typename + "", _2), t, i2 = -1, n = T2.length; - if (arguments.length < 2) { - while (++i2 < n) - if ((t = (typename = T2[i2]).type) && (t = get$3(_2[t], typename.name))) - return t; - return; - } - if (callback != null && typeof callback !== "function") - throw new Error("invalid callback: " + callback); - while (++i2 < n) { - if (t = (typename = T2[i2]).type) - _2[t] = set$3(_2[t], typename.name, callback); - else if (callback == null) - for (t in _2) - _2[t] = set$3(_2[t], typename.name, null); - } - return this; - }, - copy: function() { - var copy2 = {}, _2 = this._; - for (var t in _2) - copy2[t] = _2[t].slice(); - return new Dispatch(copy2); - }, - call: function(type2, that) { - if ((n = arguments.length - 2) > 0) - for (var args = new Array(n), i2 = 0, n, t; i2 < n; ++i2) - args[i2] = arguments[i2 + 2]; - if (!this._.hasOwnProperty(type2)) - throw new Error("unknown type: " + type2); - for (t = this._[type2], i2 = 0, n = t.length; i2 < n; ++i2) - t[i2].value.apply(that, args); - }, - apply: function(type2, that, args) { - if (!this._.hasOwnProperty(type2)) - throw new Error("unknown type: " + type2); - for (var t = this._[type2], i2 = 0, n = t.length; i2 < n; ++i2) - t[i2].value.apply(that, args); + }); + + // ../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/index.js + var init_dist = __esm({ + "../../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/index.js"() { + "use strict"; + init_methods(); } - }; - function get$3(type2, name) { - for (var i2 = 0, n = type2.length, c2; i2 < n; ++i2) { - if ((c2 = type2[i2]).name === name) { - return c2.value; - } + }); + + // src/themes/erDiagram-oldHardcodedValues.ts + var oldAttributeBackgroundColorOdd, oldAttributeBackgroundColorEven; + var init_erDiagram_oldHardcodedValues = __esm({ + "src/themes/erDiagram-oldHardcodedValues.ts"() { + "use strict"; + oldAttributeBackgroundColorOdd = "#ffffff"; + oldAttributeBackgroundColorEven = "#f2f2f2"; } - } - function set$3(type2, name, callback) { - for (var i2 = 0, n = type2.length; i2 < n; ++i2) { - if (type2[i2].name === name) { - type2[i2] = noop$2, type2 = type2.slice(0, i2).concat(type2.slice(i2 + 1)); - break; - } + }); + + // src/themes/theme-helpers.js + var mkBorder; + var init_theme_helpers = __esm({ + "src/themes/theme-helpers.js"() { + "use strict"; + init_dist(); + mkBorder = /* @__PURE__ */ __name((col, darkMode) => darkMode ? adjust_default(col, { s: -40, l: 10 }) : adjust_default(col, { s: -40, l: -10 }), "mkBorder"); } - if (callback != null) - type2.push({ name, value: callback }); - return type2; - } - var xhtml = "http://www.w3.org/1999/xhtml"; - const namespaces$1 = { - svg: "http://www.w3.org/2000/svg", - xhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" - }; - function namespace(name) { - var prefix = name += "", i2 = prefix.indexOf(":"); - if (i2 >= 0 && (prefix = name.slice(0, i2)) !== "xmlns") - name = name.slice(i2 + 1); - return namespaces$1.hasOwnProperty(prefix) ? { space: namespaces$1[prefix], local: name } : name; - } - function creatorInherit(name) { - return function() { - var document2 = this.ownerDocument, uri = this.namespaceURI; - return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name); - }; - } - function creatorFixed(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; - } - function creator(name) { - var fullname = namespace(name); - return (fullname.local ? creatorFixed : creatorInherit)(fullname); - } - function none() { - } - function selector(selector2) { - return selector2 == null ? none : function() { - return this.querySelector(selector2); - }; - } - function selection_select(select) { - if (typeof select !== "function") - select = selector(select); - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node2, subnode, i2 = 0; i2 < n; ++i2) { - if ((node2 = group[i2]) && (subnode = select.call(node2, node2.__data__, i2, group))) { - if ("__data__" in node2) - subnode.__data__ = node2.__data__; - subgroup[i2] = subnode; + }); + + // src/themes/theme-base.js + var Theme, getThemeVariables; + var init_theme_base = __esm({ + "src/themes/theme-base.js"() { + "use strict"; + init_dist(); + init_erDiagram_oldHardcodedValues(); + init_theme_helpers(); + Theme = class { + static { + __name(this, "Theme"); + } + constructor() { + this.background = "#f4f4f4"; + this.primaryColor = "#fff4dd"; + this.noteBkgColor = "#fff5ad"; + this.noteTextColor = "#333"; + this.THEME_COLOR_LIMIT = 12; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = "16px"; + } + updateColors() { + this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333"); + this.secondaryColor = this.secondaryColor || adjust_default(this.primaryColor, { h: -120 }); + this.tertiaryColor = this.tertiaryColor || adjust_default(this.primaryColor, { h: 180, l: 5 }); + this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode); + this.secondaryBorderColor = this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode); + this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode); + this.noteBkgColor = this.noteBkgColor || "#fff5ad"; + this.noteTextColor = this.noteTextColor || "#333"; + this.secondaryTextColor = this.secondaryTextColor || invert_default(this.secondaryColor); + this.tertiaryTextColor = this.tertiaryTextColor || invert_default(this.tertiaryColor); + this.lineColor = this.lineColor || invert_default(this.background); + this.arrowheadColor = this.arrowheadColor || invert_default(this.background); + this.textColor = this.textColor || this.primaryTextColor; + this.border2 = this.border2 || this.tertiaryBorderColor; + this.nodeBkg = this.nodeBkg || this.primaryColor; + this.mainBkg = this.mainBkg || this.primaryColor; + this.nodeBorder = this.nodeBorder || this.primaryBorderColor; + this.clusterBkg = this.clusterBkg || this.tertiaryColor; + this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor; + this.defaultLinkColor = this.defaultLinkColor || this.lineColor; + this.titleColor = this.titleColor || this.tertiaryTextColor; + this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? darken_default(this.secondaryColor, 30) : this.secondaryColor); + this.nodeTextColor = this.nodeTextColor || this.primaryTextColor; + this.actorBorder = this.actorBorder || this.primaryBorderColor; + this.actorBkg = this.actorBkg || this.mainBkg; + this.actorTextColor = this.actorTextColor || this.primaryTextColor; + this.actorLineColor = this.actorLineColor || this.actorBorder; + this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg; + this.signalColor = this.signalColor || this.textColor; + this.signalTextColor = this.signalTextColor || this.textColor; + this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder; + this.labelTextColor = this.labelTextColor || this.actorTextColor; + this.loopTextColor = this.loopTextColor || this.actorTextColor; + this.activationBorderColor = this.activationBorderColor || darken_default(this.secondaryColor, 10); + this.activationBkgColor = this.activationBkgColor || this.secondaryColor; + this.sequenceNumberColor = this.sequenceNumberColor || invert_default(this.lineColor); + this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor; + this.altSectionBkgColor = this.altSectionBkgColor || "white"; + this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor; + this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor; + this.excludeBkgColor = this.excludeBkgColor || "#eeeeee"; + this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor; + this.taskBkgColor = this.taskBkgColor || this.primaryColor; + this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor; + this.activeTaskBkgColor = this.activeTaskBkgColor || lighten_default(this.primaryColor, 23); + this.gridColor = this.gridColor || "lightgrey"; + this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey"; + this.doneTaskBorderColor = this.doneTaskBorderColor || "grey"; + this.critBorderColor = this.critBorderColor || "#ff8888"; + this.critBkgColor = this.critBkgColor || "red"; + this.todayLineColor = this.todayLineColor || "red"; + this.taskTextColor = this.taskTextColor || this.textColor; + this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor; + this.taskTextLightColor = this.taskTextLightColor || this.textColor; + this.taskTextColor = this.taskTextColor || this.primaryTextColor; + this.taskTextDarkColor = this.taskTextDarkColor || this.textColor; + this.taskTextClickableColor = this.taskTextClickableColor || "#003163"; + this.personBorder = this.personBorder || this.primaryBorderColor; + this.personBkg = this.personBkg || this.mainBkg; + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || this.tertiaryColor; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.nodeBorder; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + this.specialStateColor = this.lineColor; + this.cScale0 = this.cScale0 || this.primaryColor; + this.cScale1 = this.cScale1 || this.secondaryColor; + this.cScale2 = this.cScale2 || this.tertiaryColor; + this.cScale3 = this.cScale3 || adjust_default(this.primaryColor, { h: 30 }); + this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 }); + this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 }); + this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 }); + this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 }); + this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210, l: 150 }); + this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 }); + this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 }); + this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 }); + if (this.darkMode) { + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScale" + i2] = darken_default(this["cScale" + i2], 75); + } + } else { + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScale" + i2] = darken_default(this["cScale" + i2], 25); + } + } + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert_default(this["cScale" + i2]); + } + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + if (this.darkMode) { + this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten_default(this["cScale" + i2], 10); + } else { + this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 10); + } + } + this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor; + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; + } + const multiplier = this.darkMode ? -4 : -1; + for (let i2 = 0; i2 < 5; i2++) { + this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 180, s: -15, l: multiplier * (5 + i2 * 3) }); + this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 180, s: -15, l: multiplier * (8 + i2 * 3) }); + } + this.classText = this.classText || this.textColor; + this.fillType0 = this.fillType0 || this.primaryColor; + this.fillType1 = this.fillType1 || this.secondaryColor; + this.fillType2 = this.fillType2 || adjust_default(this.primaryColor, { h: 64 }); + this.fillType3 = this.fillType3 || adjust_default(this.secondaryColor, { h: 64 }); + this.fillType4 = this.fillType4 || adjust_default(this.primaryColor, { h: -64 }); + this.fillType5 = this.fillType5 || adjust_default(this.secondaryColor, { h: -64 }); + this.fillType6 = this.fillType6 || adjust_default(this.primaryColor, { h: 128 }); + this.fillType7 = this.fillType7 || adjust_default(this.secondaryColor, { h: 128 }); + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || this.tertiaryColor; + this.pie4 = this.pie4 || adjust_default(this.primaryColor, { l: -10 }); + this.pie5 = this.pie5 || adjust_default(this.secondaryColor, { l: -10 }); + this.pie6 = this.pie6 || adjust_default(this.tertiaryColor, { l: -10 }); + this.pie7 = this.pie7 || adjust_default(this.primaryColor, { h: 60, l: -10 }); + this.pie8 = this.pie8 || adjust_default(this.primaryColor, { h: -60, l: -10 }); + this.pie9 = this.pie9 || adjust_default(this.primaryColor, { h: 120, l: 0 }); + this.pie10 = this.pie10 || adjust_default(this.primaryColor, { h: 60, l: -20 }); + this.pie11 = this.pie11 || adjust_default(this.primaryColor, { h: -60, l: -20 }); + this.pie12 = this.pie12 || adjust_default(this.primaryColor, { h: 120, l: -10 }); + this.pieTitleTextSize = this.pieTitleTextSize || "25px"; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || "17px"; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || "17px"; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || "black"; + this.pieStrokeWidth = this.pieStrokeWidth || "2px"; + this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; + this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; + this.pieOpacity = this.pieOpacity || "0.7"; + this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; + this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 }); + this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 }); + this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 }); + this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; + this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 }); + this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 }); + this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 }); + this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill); + this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; + this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; + this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; + this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; + this.xyChart = { + backgroundColor: this.xyChart?.backgroundColor || this.background, + titleColor: this.xyChart?.titleColor || this.primaryTextColor, + xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor, + xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor, + xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor, + xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor, + yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor, + yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor, + yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor, + yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor, + plotColorPalette: this.xyChart?.plotColorPalette || "#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0" + }; + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || "1"; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken_default(this.secondaryColor, 30) : this.secondaryColor); + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || adjust_default(this.primaryColor, { h: -30 }); + this.git4 = this.git4 || adjust_default(this.primaryColor, { h: -60 }); + this.git5 = this.git5 || adjust_default(this.primaryColor, { h: -90 }); + this.git6 = this.git6 || adjust_default(this.primaryColor, { h: 60 }); + this.git7 = this.git7 || adjust_default(this.primaryColor, { h: 120 }); + if (this.darkMode) { + this.git0 = lighten_default(this.git0, 25); + this.git1 = lighten_default(this.git1, 25); + this.git2 = lighten_default(this.git2, 25); + this.git3 = lighten_default(this.git3, 25); + this.git4 = lighten_default(this.git4, 25); + this.git5 = lighten_default(this.git5, 25); + this.git6 = lighten_default(this.git6, 25); + this.git7 = lighten_default(this.git7, 25); + } else { + this.git0 = darken_default(this.git0, 25); + this.git1 = darken_default(this.git1, 25); + this.git2 = darken_default(this.git2, 25); + this.git3 = darken_default(this.git3, 25); + this.git4 = darken_default(this.git4, 25); + this.git5 = darken_default(this.git5, 25); + this.git6 = darken_default(this.git6, 25); + this.git7 = darken_default(this.git7, 25); + } + this.gitInv0 = this.gitInv0 || invert_default(this.git0); + this.gitInv1 = this.gitInv1 || invert_default(this.git1); + this.gitInv2 = this.gitInv2 || invert_default(this.git2); + this.gitInv3 = this.gitInv3 || invert_default(this.git3); + this.gitInv4 = this.gitInv4 || invert_default(this.git4); + this.gitInv5 = this.gitInv5 || invert_default(this.git5); + this.gitInv6 = this.gitInv6 || invert_default(this.git6); + this.gitInv7 = this.gitInv7 || invert_default(this.git7); + this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor); + this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor; + this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor; + this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || "10px"; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || "10px"; + this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + } + calculate(overrides) { + if (typeof overrides !== "object") { + this.updateColors(); + return; + } + const keys3 = Object.keys(overrides); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); + this.updateColors(); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); } - } + }; + getThemeVariables = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - return new Selection$1(subgroups, this._parents); - } - function array$1(x2) { - return x2 == null ? [] : Array.isArray(x2) ? x2 : Array.from(x2); - } - function empty() { - return []; - } - function selectorAll(selector2) { - return selector2 == null ? empty : function() { - return this.querySelectorAll(selector2); - }; - } - function arrayAll(select) { - return function() { - return array$1(select.apply(this, arguments)); - }; - } - function selection_selectAll(select) { - if (typeof select === "function") - select = arrayAll(select); - else - select = selectorAll(select); - for (var groups = this._groups, m = groups.length, subgroups = [], parents2 = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node2, i2 = 0; i2 < n; ++i2) { - if (node2 = group[i2]) { - subgroups.push(select.call(node2, node2.__data__, i2, group)); - parents2.push(node2); + }); + + // src/themes/theme-dark.js + var Theme2, getThemeVariables2; + var init_theme_dark = __esm({ + "src/themes/theme-dark.js"() { + "use strict"; + init_dist(); + init_theme_helpers(); + Theme2 = class { + static { + __name(this, "Theme"); + } + constructor() { + this.background = "#333"; + this.primaryColor = "#1f2020"; + this.secondaryColor = lighten_default(this.primaryColor, 16); + this.tertiaryColor = adjust_default(this.primaryColor, { h: -160 }); + this.primaryBorderColor = invert_default(this.background); + this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); + this.primaryTextColor = invert_default(this.primaryColor); + this.secondaryTextColor = invert_default(this.secondaryColor); + this.tertiaryTextColor = invert_default(this.tertiaryColor); + this.lineColor = invert_default(this.background); + this.textColor = invert_default(this.background); + this.mainBkg = "#1f2020"; + this.secondBkg = "calculated"; + this.mainContrastColor = "lightgrey"; + this.darkTextColor = lighten_default(invert_default("#323D47"), 10); + this.lineColor = "calculated"; + this.border1 = "#ccc"; + this.border2 = rgba_default(255, 255, 255, 0.25); + this.arrowheadColor = "calculated"; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = "16px"; + this.labelBackground = "#181818"; + this.textColor = "#ccc"; + this.THEME_COLOR_LIMIT = 12; + this.nodeBkg = "calculated"; + this.nodeBorder = "calculated"; + this.clusterBkg = "calculated"; + this.clusterBorder = "calculated"; + this.defaultLinkColor = "calculated"; + this.titleColor = "#F9FFFE"; + this.edgeLabelBackground = "calculated"; + this.actorBorder = "calculated"; + this.actorBkg = "calculated"; + this.actorTextColor = "calculated"; + this.actorLineColor = "calculated"; + this.signalColor = "calculated"; + this.signalTextColor = "calculated"; + this.labelBoxBkgColor = "calculated"; + this.labelBoxBorderColor = "calculated"; + this.labelTextColor = "calculated"; + this.loopTextColor = "calculated"; + this.noteBorderColor = "calculated"; + this.noteBkgColor = "#fff5ad"; + this.noteTextColor = "calculated"; + this.activationBorderColor = "calculated"; + this.activationBkgColor = "calculated"; + this.sequenceNumberColor = "black"; + this.sectionBkgColor = darken_default("#EAE8D9", 30); + this.altSectionBkgColor = "calculated"; + this.sectionBkgColor2 = "#EAE8D9"; + this.excludeBkgColor = darken_default(this.sectionBkgColor, 10); + this.taskBorderColor = rgba_default(255, 255, 255, 70); + this.taskBkgColor = "calculated"; + this.taskTextColor = "calculated"; + this.taskTextLightColor = "calculated"; + this.taskTextOutsideColor = "calculated"; + this.taskTextClickableColor = "#003163"; + this.activeTaskBorderColor = rgba_default(255, 255, 255, 50); + this.activeTaskBkgColor = "#81B1DB"; + this.gridColor = "calculated"; + this.doneTaskBkgColor = "calculated"; + this.doneTaskBorderColor = "grey"; + this.critBorderColor = "#E83737"; + this.critBkgColor = "#E83737"; + this.taskTextDarkColor = "calculated"; + this.todayLineColor = "#DB5757"; + this.personBorder = this.primaryBorderColor; + this.personBkg = this.mainBkg; + this.labelColor = "calculated"; + this.errorBkgColor = "#a44141"; + this.errorTextColor = "#ddd"; + } + updateColors() { + this.secondBkg = lighten_default(this.mainBkg, 16); + this.lineColor = this.mainContrastColor; + this.arrowheadColor = this.mainContrastColor; + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.edgeLabelBackground = lighten_default(this.labelBackground, 25); + this.actorBorder = this.border1; + this.actorBkg = this.mainBkg; + this.actorTextColor = this.mainContrastColor; + this.actorLineColor = this.actorBorder; + this.signalColor = this.mainContrastColor; + this.signalTextColor = this.mainContrastColor; + this.labelBoxBkgColor = this.actorBkg; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.mainContrastColor; + this.loopTextColor = this.mainContrastColor; + this.noteBorderColor = this.secondaryBorderColor; + this.noteBkgColor = this.secondBkg; + this.noteTextColor = this.secondaryTextColor; + this.activationBorderColor = this.border1; + this.activationBkgColor = this.secondBkg; + this.altSectionBkgColor = this.background; + this.taskBkgColor = lighten_default(this.mainBkg, 23); + this.taskTextColor = this.darkTextColor; + this.taskTextLightColor = this.mainContrastColor; + this.taskTextOutsideColor = this.taskTextLightColor; + this.gridColor = this.mainContrastColor; + this.doneTaskBkgColor = this.mainContrastColor; + this.taskTextDarkColor = this.darkTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || "#555"; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = "#f4f4f4"; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = adjust_default(this.primaryColor, { h: 64 }); + this.fillType3 = adjust_default(this.secondaryColor, { h: 64 }); + this.fillType4 = adjust_default(this.primaryColor, { h: -64 }); + this.fillType5 = adjust_default(this.secondaryColor, { h: -64 }); + this.fillType6 = adjust_default(this.primaryColor, { h: 128 }); + this.fillType7 = adjust_default(this.secondaryColor, { h: 128 }); + this.cScale1 = this.cScale1 || "#0b0000"; + this.cScale2 = this.cScale2 || "#4d1037"; + this.cScale3 = this.cScale3 || "#3f5258"; + this.cScale4 = this.cScale4 || "#4f2f1b"; + this.cScale5 = this.cScale5 || "#6e0a0a"; + this.cScale6 = this.cScale6 || "#3b0048"; + this.cScale7 = this.cScale7 || "#995a01"; + this.cScale8 = this.cScale8 || "#154706"; + this.cScale9 = this.cScale9 || "#161722"; + this.cScale10 = this.cScale10 || "#00296f"; + this.cScale11 = this.cScale11 || "#01629c"; + this.cScale12 = this.cScale12 || "#010029"; + this.cScale0 = this.cScale0 || this.primaryColor; + this.cScale1 = this.cScale1 || this.secondaryColor; + this.cScale2 = this.cScale2 || this.tertiaryColor; + this.cScale3 = this.cScale3 || adjust_default(this.primaryColor, { h: 30 }); + this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 }); + this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 }); + this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 }); + this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 }); + this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210 }); + this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 }); + this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 }); + this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 }); + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert_default(this["cScale" + i2]); + } + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten_default(this["cScale" + i2], 10); + } + for (let i2 = 0; i2 < 5; i2++) { + this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(-10 + i2 * 4) }); + this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(-7 + i2 * 4) }); + } + this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor); + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; + } + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["pie" + i2] = this["cScale" + i2]; + } + this.pieTitleTextSize = this.pieTitleTextSize || "25px"; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || "17px"; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || "17px"; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || "black"; + this.pieStrokeWidth = this.pieStrokeWidth || "2px"; + this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; + this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; + this.pieOpacity = this.pieOpacity || "0.7"; + this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; + this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 }); + this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 }); + this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 }); + this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; + this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 }); + this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 }); + this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 }); + this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill); + this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; + this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; + this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; + this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; + this.xyChart = { + backgroundColor: this.xyChart?.backgroundColor || this.background, + titleColor: this.xyChart?.titleColor || this.primaryTextColor, + xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor, + xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor, + xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor, + xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor, + yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor, + yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor, + yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor, + yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor, + plotColorPalette: this.xyChart?.plotColorPalette || "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22" + }; + this.packet = { + startByteColor: this.primaryTextColor, + endByteColor: this.primaryTextColor, + labelColor: this.primaryTextColor, + titleColor: this.primaryTextColor, + blockStrokeColor: this.primaryTextColor, + blockFillColor: this.background + }; + this.classText = this.primaryTextColor; + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || "1"; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken_default(this.secondaryColor, 30) : this.secondaryColor); + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + this.git0 = lighten_default(this.secondaryColor, 20); + this.git1 = lighten_default(this.pie2 || this.secondaryColor, 20); + this.git2 = lighten_default(this.pie3 || this.tertiaryColor, 20); + this.git3 = lighten_default(this.pie4 || adjust_default(this.primaryColor, { h: -30 }), 20); + this.git4 = lighten_default(this.pie5 || adjust_default(this.primaryColor, { h: -60 }), 20); + this.git5 = lighten_default(this.pie6 || adjust_default(this.primaryColor, { h: -90 }), 10); + this.git6 = lighten_default(this.pie7 || adjust_default(this.primaryColor, { h: 60 }), 10); + this.git7 = lighten_default(this.pie8 || adjust_default(this.primaryColor, { h: 120 }), 20); + this.gitInv0 = this.gitInv0 || invert_default(this.git0); + this.gitInv1 = this.gitInv1 || invert_default(this.git1); + this.gitInv2 = this.gitInv2 || invert_default(this.git2); + this.gitInv3 = this.gitInv3 || invert_default(this.git3); + this.gitInv4 = this.gitInv4 || invert_default(this.git4); + this.gitInv5 = this.gitInv5 || invert_default(this.git5); + this.gitInv6 = this.gitInv6 || invert_default(this.git6); + this.gitInv7 = this.gitInv7 || invert_default(this.git7); + this.gitBranchLabel0 = this.gitBranchLabel0 || invert_default(this.labelTextColor); + this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || invert_default(this.labelTextColor); + this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || "10px"; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || "10px"; + this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || lighten_default(this.background, 12); + this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || lighten_default(this.background, 2); + this.nodeBorder = this.nodeBorder || "#999"; + } + calculate(overrides) { + if (typeof overrides !== "object") { + this.updateColors(); + return; + } + const keys3 = Object.keys(overrides); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); + this.updateColors(); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); } - } + }; + getThemeVariables2 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme2(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - return new Selection$1(subgroups, parents2); - } - function matcher(selector2) { - return function() { - return this.matches(selector2); - }; - } - function childMatcher(selector2) { - return function(node2) { - return node2.matches(selector2); - }; - } - var find$3 = Array.prototype.find; - function childFind(match) { - return function() { - return find$3.call(this.children, match); - }; - } - function childFirst() { - return this.firstElementChild; - } - function selection_selectChild(match) { - return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match))); - } - var filter$1 = Array.prototype.filter; - function children() { - return Array.from(this.children); - } - function childrenFilter(match) { - return function() { - return filter$1.call(this.children, match); - }; - } - function selection_selectChildren(match) { - return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match))); - } - function selection_filter(match) { - if (typeof match !== "function") - match = matcher(match); - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node2, i2 = 0; i2 < n; ++i2) { - if ((node2 = group[i2]) && match.call(node2, node2.__data__, i2, group)) { - subgroup.push(node2); + }); + + // src/themes/theme-default.js + var Theme3, getThemeVariables3; + var init_theme_default = __esm({ + "src/themes/theme-default.js"() { + "use strict"; + init_dist(); + init_theme_helpers(); + init_erDiagram_oldHardcodedValues(); + Theme3 = class { + static { + __name(this, "Theme"); + } + constructor() { + this.background = "#f4f4f4"; + this.primaryColor = "#ECECFF"; + this.secondaryColor = adjust_default(this.primaryColor, { h: 120 }); + this.secondaryColor = "#ffffde"; + this.tertiaryColor = adjust_default(this.primaryColor, { h: -160 }); + this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode); + this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); + this.primaryTextColor = invert_default(this.primaryColor); + this.secondaryTextColor = invert_default(this.secondaryColor); + this.tertiaryTextColor = invert_default(this.tertiaryColor); + this.lineColor = invert_default(this.background); + this.textColor = invert_default(this.background); + this.background = "white"; + this.mainBkg = "#ECECFF"; + this.secondBkg = "#ffffde"; + this.lineColor = "#333333"; + this.border1 = "#9370DB"; + this.border2 = "#aaaa33"; + this.arrowheadColor = "#333333"; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = "16px"; + this.labelBackground = "rgba(232,232,232, 0.8)"; + this.textColor = "#333"; + this.THEME_COLOR_LIMIT = 12; + this.nodeBkg = "calculated"; + this.nodeBorder = "calculated"; + this.clusterBkg = "calculated"; + this.clusterBorder = "calculated"; + this.defaultLinkColor = "calculated"; + this.titleColor = "calculated"; + this.edgeLabelBackground = "calculated"; + this.actorBorder = "calculated"; + this.actorBkg = "calculated"; + this.actorTextColor = "black"; + this.actorLineColor = "calculated"; + this.signalColor = "calculated"; + this.signalTextColor = "calculated"; + this.labelBoxBkgColor = "calculated"; + this.labelBoxBorderColor = "calculated"; + this.labelTextColor = "calculated"; + this.loopTextColor = "calculated"; + this.noteBorderColor = "calculated"; + this.noteBkgColor = "#fff5ad"; + this.noteTextColor = "calculated"; + this.activationBorderColor = "#666"; + this.activationBkgColor = "#f4f4f4"; + this.sequenceNumberColor = "white"; + this.sectionBkgColor = "calculated"; + this.altSectionBkgColor = "calculated"; + this.sectionBkgColor2 = "calculated"; + this.excludeBkgColor = "#eeeeee"; + this.taskBorderColor = "calculated"; + this.taskBkgColor = "calculated"; + this.taskTextLightColor = "calculated"; + this.taskTextColor = this.taskTextLightColor; + this.taskTextDarkColor = "calculated"; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.taskTextClickableColor = "calculated"; + this.activeTaskBorderColor = "calculated"; + this.activeTaskBkgColor = "calculated"; + this.gridColor = "calculated"; + this.doneTaskBkgColor = "calculated"; + this.doneTaskBorderColor = "calculated"; + this.critBorderColor = "calculated"; + this.critBkgColor = "calculated"; + this.todayLineColor = "calculated"; + this.sectionBkgColor = rgba_default(102, 102, 255, 0.49); + this.altSectionBkgColor = "white"; + this.sectionBkgColor2 = "#fff400"; + this.taskBorderColor = "#534fbc"; + this.taskBkgColor = "#8a90dd"; + this.taskTextLightColor = "white"; + this.taskTextColor = "calculated"; + this.taskTextDarkColor = "black"; + this.taskTextOutsideColor = "calculated"; + this.taskTextClickableColor = "#003163"; + this.activeTaskBorderColor = "#534fbc"; + this.activeTaskBkgColor = "#bfc7ff"; + this.gridColor = "lightgrey"; + this.doneTaskBkgColor = "lightgrey"; + this.doneTaskBorderColor = "grey"; + this.critBorderColor = "#ff8888"; + this.critBkgColor = "red"; + this.todayLineColor = "red"; + this.personBorder = this.primaryBorderColor; + this.personBkg = this.mainBkg; + this.labelColor = "black"; + this.errorBkgColor = "#552222"; + this.errorTextColor = "#552222"; + this.updateColors(); + } + updateColors() { + this.cScale0 = this.cScale0 || this.primaryColor; + this.cScale1 = this.cScale1 || this.secondaryColor; + this.cScale2 = this.cScale2 || this.tertiaryColor; + this.cScale3 = this.cScale3 || adjust_default(this.primaryColor, { h: 30 }); + this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 }); + this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 }); + this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 }); + this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 }); + this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210 }); + this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 }); + this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 }); + this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 }); + this["cScalePeer1"] = this["cScalePeer1"] || darken_default(this.secondaryColor, 45); + this["cScalePeer2"] = this["cScalePeer2"] || darken_default(this.tertiaryColor, 40); + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScale" + i2] = darken_default(this["cScale" + i2], 10); + this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 25); + } + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleInv" + i2] = this["cScaleInv" + i2] || adjust_default(this["cScale" + i2], { h: 180 }); + } + for (let i2 = 0; i2 < 5; i2++) { + this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 30, l: -(5 + i2 * 5) }); + this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 30, l: -(7 + i2 * 5) }); + } + this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor; + if (this.labelTextColor !== "calculated") { + this.cScaleLabel0 = this.cScaleLabel0 || invert_default(this.labelTextColor); + this.cScaleLabel3 = this.cScaleLabel3 || invert_default(this.labelTextColor); + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.labelTextColor; + } + } + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.titleColor = this.textColor; + this.edgeLabelBackground = this.labelBackground; + this.actorBorder = lighten_default(this.border1, 23); + this.actorBkg = this.mainBkg; + this.labelBoxBkgColor = this.actorBkg; + this.signalColor = this.textColor; + this.signalTextColor = this.textColor; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.actorTextColor; + this.loopTextColor = this.actorTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.actorTextColor; + this.actorLineColor = this.actorBorder; + this.taskTextColor = this.taskTextLightColor; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || "#f0f0f0"; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.nodeBorder; + this.specialStateColor = this.lineColor; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + this.classText = this.primaryTextColor; + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = adjust_default(this.primaryColor, { h: 64 }); + this.fillType3 = adjust_default(this.secondaryColor, { h: 64 }); + this.fillType4 = adjust_default(this.primaryColor, { h: -64 }); + this.fillType5 = adjust_default(this.secondaryColor, { h: -64 }); + this.fillType6 = adjust_default(this.primaryColor, { h: 128 }); + this.fillType7 = adjust_default(this.secondaryColor, { h: 128 }); + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || adjust_default(this.tertiaryColor, { l: -40 }); + this.pie4 = this.pie4 || adjust_default(this.primaryColor, { l: -10 }); + this.pie5 = this.pie5 || adjust_default(this.secondaryColor, { l: -30 }); + this.pie6 = this.pie6 || adjust_default(this.tertiaryColor, { l: -20 }); + this.pie7 = this.pie7 || adjust_default(this.primaryColor, { h: 60, l: -20 }); + this.pie8 = this.pie8 || adjust_default(this.primaryColor, { h: -60, l: -40 }); + this.pie9 = this.pie9 || adjust_default(this.primaryColor, { h: 120, l: -40 }); + this.pie10 = this.pie10 || adjust_default(this.primaryColor, { h: 60, l: -40 }); + this.pie11 = this.pie11 || adjust_default(this.primaryColor, { h: -90, l: -40 }); + this.pie12 = this.pie12 || adjust_default(this.primaryColor, { h: 120, l: -30 }); + this.pieTitleTextSize = this.pieTitleTextSize || "25px"; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || "17px"; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || "17px"; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || "black"; + this.pieStrokeWidth = this.pieStrokeWidth || "2px"; + this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; + this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; + this.pieOpacity = this.pieOpacity || "0.7"; + this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; + this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 }); + this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 }); + this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 }); + this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; + this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 }); + this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 }); + this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 }); + this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill); + this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; + this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; + this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; + this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; + this.xyChart = { + backgroundColor: this.xyChart?.backgroundColor || this.background, + titleColor: this.xyChart?.titleColor || this.primaryTextColor, + xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor, + xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor, + xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor, + xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor, + yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor, + yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor, + yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor, + yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor, + plotColorPalette: this.xyChart?.plotColorPalette || "#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3" + }; + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || "1"; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || adjust_default(this.primaryColor, { h: -30 }); + this.git4 = this.git4 || adjust_default(this.primaryColor, { h: -60 }); + this.git5 = this.git5 || adjust_default(this.primaryColor, { h: -90 }); + this.git6 = this.git6 || adjust_default(this.primaryColor, { h: 60 }); + this.git7 = this.git7 || adjust_default(this.primaryColor, { h: 120 }); + if (this.darkMode) { + this.git0 = lighten_default(this.git0, 25); + this.git1 = lighten_default(this.git1, 25); + this.git2 = lighten_default(this.git2, 25); + this.git3 = lighten_default(this.git3, 25); + this.git4 = lighten_default(this.git4, 25); + this.git5 = lighten_default(this.git5, 25); + this.git6 = lighten_default(this.git6, 25); + this.git7 = lighten_default(this.git7, 25); + } else { + this.git0 = darken_default(this.git0, 25); + this.git1 = darken_default(this.git1, 25); + this.git2 = darken_default(this.git2, 25); + this.git3 = darken_default(this.git3, 25); + this.git4 = darken_default(this.git4, 25); + this.git5 = darken_default(this.git5, 25); + this.git6 = darken_default(this.git6, 25); + this.git7 = darken_default(this.git7, 25); + } + this.gitInv0 = this.gitInv0 || darken_default(invert_default(this.git0), 25); + this.gitInv1 = this.gitInv1 || invert_default(this.git1); + this.gitInv2 = this.gitInv2 || invert_default(this.git2); + this.gitInv3 = this.gitInv3 || invert_default(this.git3); + this.gitInv4 = this.gitInv4 || invert_default(this.git4); + this.gitInv5 = this.gitInv5 || invert_default(this.git5); + this.gitInv6 = this.gitInv6 || invert_default(this.git6); + this.gitInv7 = this.gitInv7 || invert_default(this.git7); + this.gitBranchLabel0 = this.gitBranchLabel0 || invert_default(this.labelTextColor); + this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || invert_default(this.labelTextColor); + this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || "10px"; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || "10px"; + this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + } + calculate(overrides) { + if (typeof overrides !== "object") { + this.updateColors(); + return; + } + const keys3 = Object.keys(overrides); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); + this.updateColors(); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); } - } - } - return new Selection$1(subgroups, this._parents); - } - function sparse(update2) { - return new Array(update2.length); - } - function selection_enter() { - return new Selection$1(this._enter || this._groups.map(sparse), this._parents); - } - function EnterNode(parent, datum2) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum2; - } - EnterNode.prototype = { - constructor: EnterNode, - appendChild: function(child) { - return this._parent.insertBefore(child, this._next); - }, - insertBefore: function(child, next2) { - return this._parent.insertBefore(child, next2); - }, - querySelector: function(selector2) { - return this._parent.querySelector(selector2); - }, - querySelectorAll: function(selector2) { - return this._parent.querySelectorAll(selector2); - } - }; - function constant$5(x2) { - return function() { - return x2; - }; - } - function bindIndex(parent, group, enter2, update2, exit2, data) { - var i2 = 0, node2, groupLength2 = group.length, dataLength = data.length; - for (; i2 < dataLength; ++i2) { - if (node2 = group[i2]) { - node2.__data__ = data[i2]; - update2[i2] = node2; - } else { - enter2[i2] = new EnterNode(parent, data[i2]); - } - } - for (; i2 < groupLength2; ++i2) { - if (node2 = group[i2]) { - exit2[i2] = node2; - } + }; + getThemeVariables3 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme3(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - } - function bindKey(parent, group, enter2, update2, exit2, data, key) { - var i2, node2, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength2 = group.length, dataLength = data.length, keyValues = new Array(groupLength2), keyValue; - for (i2 = 0; i2 < groupLength2; ++i2) { - if (node2 = group[i2]) { - keyValues[i2] = keyValue = key.call(node2, node2.__data__, i2, group) + ""; - if (nodeByKeyValue.has(keyValue)) { - exit2[i2] = node2; - } else { - nodeByKeyValue.set(keyValue, node2); + }); + + // src/themes/theme-forest.js + var Theme4, getThemeVariables4; + var init_theme_forest = __esm({ + "src/themes/theme-forest.js"() { + "use strict"; + init_dist(); + init_erDiagram_oldHardcodedValues(); + init_theme_helpers(); + Theme4 = class { + static { + __name(this, "Theme"); + } + constructor() { + this.background = "#f4f4f4"; + this.primaryColor = "#cde498"; + this.secondaryColor = "#cdffb2"; + this.background = "white"; + this.mainBkg = "#cde498"; + this.secondBkg = "#cdffb2"; + this.lineColor = "green"; + this.border1 = "#13540c"; + this.border2 = "#6eaa49"; + this.arrowheadColor = "green"; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = "16px"; + this.tertiaryColor = lighten_default("#cde498", 10); + this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode); + this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); + this.primaryTextColor = invert_default(this.primaryColor); + this.secondaryTextColor = invert_default(this.secondaryColor); + this.tertiaryTextColor = invert_default(this.primaryColor); + this.lineColor = invert_default(this.background); + this.textColor = invert_default(this.background); + this.THEME_COLOR_LIMIT = 12; + this.nodeBkg = "calculated"; + this.nodeBorder = "calculated"; + this.clusterBkg = "calculated"; + this.clusterBorder = "calculated"; + this.defaultLinkColor = "calculated"; + this.titleColor = "#333"; + this.edgeLabelBackground = "#e8e8e8"; + this.actorBorder = "calculated"; + this.actorBkg = "calculated"; + this.actorTextColor = "black"; + this.actorLineColor = "calculated"; + this.signalColor = "#333"; + this.signalTextColor = "#333"; + this.labelBoxBkgColor = "calculated"; + this.labelBoxBorderColor = "#326932"; + this.labelTextColor = "calculated"; + this.loopTextColor = "calculated"; + this.noteBorderColor = "calculated"; + this.noteBkgColor = "#fff5ad"; + this.noteTextColor = "calculated"; + this.activationBorderColor = "#666"; + this.activationBkgColor = "#f4f4f4"; + this.sequenceNumberColor = "white"; + this.sectionBkgColor = "#6eaa49"; + this.altSectionBkgColor = "white"; + this.sectionBkgColor2 = "#6eaa49"; + this.excludeBkgColor = "#eeeeee"; + this.taskBorderColor = "calculated"; + this.taskBkgColor = "#487e3a"; + this.taskTextLightColor = "white"; + this.taskTextColor = "calculated"; + this.taskTextDarkColor = "black"; + this.taskTextOutsideColor = "calculated"; + this.taskTextClickableColor = "#003163"; + this.activeTaskBorderColor = "calculated"; + this.activeTaskBkgColor = "calculated"; + this.gridColor = "lightgrey"; + this.doneTaskBkgColor = "lightgrey"; + this.doneTaskBorderColor = "grey"; + this.critBorderColor = "#ff8888"; + this.critBkgColor = "red"; + this.todayLineColor = "red"; + this.personBorder = this.primaryBorderColor; + this.personBkg = this.mainBkg; + this.labelColor = "black"; + this.errorBkgColor = "#552222"; + this.errorTextColor = "#552222"; + } + updateColors() { + this.actorBorder = darken_default(this.mainBkg, 20); + this.actorBkg = this.mainBkg; + this.labelBoxBkgColor = this.actorBkg; + this.labelTextColor = this.actorTextColor; + this.loopTextColor = this.actorTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.actorTextColor; + this.actorLineColor = this.actorBorder; + this.cScale0 = this.cScale0 || this.primaryColor; + this.cScale1 = this.cScale1 || this.secondaryColor; + this.cScale2 = this.cScale2 || this.tertiaryColor; + this.cScale3 = this.cScale3 || adjust_default(this.primaryColor, { h: 30 }); + this.cScale4 = this.cScale4 || adjust_default(this.primaryColor, { h: 60 }); + this.cScale5 = this.cScale5 || adjust_default(this.primaryColor, { h: 90 }); + this.cScale6 = this.cScale6 || adjust_default(this.primaryColor, { h: 120 }); + this.cScale7 = this.cScale7 || adjust_default(this.primaryColor, { h: 150 }); + this.cScale8 = this.cScale8 || adjust_default(this.primaryColor, { h: 210 }); + this.cScale9 = this.cScale9 || adjust_default(this.primaryColor, { h: 270 }); + this.cScale10 = this.cScale10 || adjust_default(this.primaryColor, { h: 300 }); + this.cScale11 = this.cScale11 || adjust_default(this.primaryColor, { h: 330 }); + this["cScalePeer1"] = this["cScalePeer1"] || darken_default(this.secondaryColor, 45); + this["cScalePeer2"] = this["cScalePeer2"] || darken_default(this.tertiaryColor, 40); + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScale" + i2] = darken_default(this["cScale" + i2], 10); + this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 25); + } + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleInv" + i2] = this["cScaleInv" + i2] || adjust_default(this["cScale" + i2], { h: 180 }); + } + this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor; + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; + } + for (let i2 = 0; i2 < 5; i2++) { + this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(5 + i2 * 5) }); + this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { h: 30, s: -30, l: -(8 + i2 * 5) }); + } + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.taskBorderColor = this.border1; + this.taskTextColor = this.taskTextLightColor; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.activeTaskBorderColor = this.taskBorderColor; + this.activeTaskBkgColor = this.mainBkg; + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || "#f0f0f0"; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = this.lineColor; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + this.classText = this.primaryTextColor; + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = adjust_default(this.primaryColor, { h: 64 }); + this.fillType3 = adjust_default(this.secondaryColor, { h: 64 }); + this.fillType4 = adjust_default(this.primaryColor, { h: -64 }); + this.fillType5 = adjust_default(this.secondaryColor, { h: -64 }); + this.fillType6 = adjust_default(this.primaryColor, { h: 128 }); + this.fillType7 = adjust_default(this.secondaryColor, { h: 128 }); + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || this.tertiaryColor; + this.pie4 = this.pie4 || adjust_default(this.primaryColor, { l: -30 }); + this.pie5 = this.pie5 || adjust_default(this.secondaryColor, { l: -30 }); + this.pie6 = this.pie6 || adjust_default(this.tertiaryColor, { h: 40, l: -40 }); + this.pie7 = this.pie7 || adjust_default(this.primaryColor, { h: 60, l: -10 }); + this.pie8 = this.pie8 || adjust_default(this.primaryColor, { h: -60, l: -10 }); + this.pie9 = this.pie9 || adjust_default(this.primaryColor, { h: 120, l: 0 }); + this.pie10 = this.pie10 || adjust_default(this.primaryColor, { h: 60, l: -50 }); + this.pie11 = this.pie11 || adjust_default(this.primaryColor, { h: -60, l: -50 }); + this.pie12 = this.pie12 || adjust_default(this.primaryColor, { h: 120, l: -50 }); + this.pieTitleTextSize = this.pieTitleTextSize || "25px"; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || "17px"; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || "17px"; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || "black"; + this.pieStrokeWidth = this.pieStrokeWidth || "2px"; + this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; + this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; + this.pieOpacity = this.pieOpacity || "0.7"; + this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; + this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 }); + this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 }); + this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 }); + this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; + this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 }); + this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 }); + this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 }); + this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill); + this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; + this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; + this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; + this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; + this.packet = { + startByteColor: this.primaryTextColor, + endByteColor: this.primaryTextColor, + labelColor: this.primaryTextColor, + titleColor: this.primaryTextColor, + blockStrokeColor: this.primaryTextColor, + blockFillColor: this.mainBkg + }; + this.xyChart = { + backgroundColor: this.xyChart?.backgroundColor || this.background, + titleColor: this.xyChart?.titleColor || this.primaryTextColor, + xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor, + xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor, + xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor, + xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor, + yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor, + yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor, + yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor, + yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor, + plotColorPalette: this.xyChart?.plotColorPalette || "#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176" + }; + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || "1"; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || adjust_default(this.primaryColor, { h: -30 }); + this.git4 = this.git4 || adjust_default(this.primaryColor, { h: -60 }); + this.git5 = this.git5 || adjust_default(this.primaryColor, { h: -90 }); + this.git6 = this.git6 || adjust_default(this.primaryColor, { h: 60 }); + this.git7 = this.git7 || adjust_default(this.primaryColor, { h: 120 }); + if (this.darkMode) { + this.git0 = lighten_default(this.git0, 25); + this.git1 = lighten_default(this.git1, 25); + this.git2 = lighten_default(this.git2, 25); + this.git3 = lighten_default(this.git3, 25); + this.git4 = lighten_default(this.git4, 25); + this.git5 = lighten_default(this.git5, 25); + this.git6 = lighten_default(this.git6, 25); + this.git7 = lighten_default(this.git7, 25); + } else { + this.git0 = darken_default(this.git0, 25); + this.git1 = darken_default(this.git1, 25); + this.git2 = darken_default(this.git2, 25); + this.git3 = darken_default(this.git3, 25); + this.git4 = darken_default(this.git4, 25); + this.git5 = darken_default(this.git5, 25); + this.git6 = darken_default(this.git6, 25); + this.git7 = darken_default(this.git7, 25); + } + this.gitInv0 = this.gitInv0 || invert_default(this.git0); + this.gitInv1 = this.gitInv1 || invert_default(this.git1); + this.gitInv2 = this.gitInv2 || invert_default(this.git2); + this.gitInv3 = this.gitInv3 || invert_default(this.git3); + this.gitInv4 = this.gitInv4 || invert_default(this.git4); + this.gitInv5 = this.gitInv5 || invert_default(this.git5); + this.gitInv6 = this.gitInv6 || invert_default(this.git6); + this.gitInv7 = this.gitInv7 || invert_default(this.git7); + this.gitBranchLabel0 = this.gitBranchLabel0 || invert_default(this.labelTextColor); + this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || invert_default(this.labelTextColor); + this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || "10px"; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || "10px"; + this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + } + calculate(overrides) { + if (typeof overrides !== "object") { + this.updateColors(); + return; + } + const keys3 = Object.keys(overrides); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); + this.updateColors(); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); } - } - } - for (i2 = 0; i2 < dataLength; ++i2) { - keyValue = key.call(parent, data[i2], i2, data) + ""; - if (node2 = nodeByKeyValue.get(keyValue)) { - update2[i2] = node2; - node2.__data__ = data[i2]; - nodeByKeyValue.delete(keyValue); - } else { - enter2[i2] = new EnterNode(parent, data[i2]); - } - } - for (i2 = 0; i2 < groupLength2; ++i2) { - if ((node2 = group[i2]) && nodeByKeyValue.get(keyValues[i2]) === node2) { - exit2[i2] = node2; - } - } - } - function datum(node2) { - return node2.__data__; - } - function selection_data(value2, key) { - if (!arguments.length) - return Array.from(this, datum); - var bind = key ? bindKey : bindIndex, parents2 = this._parents, groups = this._groups; - if (typeof value2 !== "function") - value2 = constant$5(value2); - for (var m = groups.length, update2 = new Array(m), enter2 = new Array(m), exit2 = new Array(m), j = 0; j < m; ++j) { - var parent = parents2[j], group = groups[j], groupLength2 = group.length, data = arraylike(value2.call(parent, parent && parent.__data__, j, parents2)), dataLength = data.length, enterGroup = enter2[j] = new Array(dataLength), updateGroup = update2[j] = new Array(dataLength), exitGroup = exit2[j] = new Array(groupLength2); - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - for (var i0 = 0, i1 = 0, previous2, next2; i0 < dataLength; ++i0) { - if (previous2 = enterGroup[i0]) { - if (i0 >= i1) - i1 = i0 + 1; - while (!(next2 = updateGroup[i1]) && ++i1 < dataLength) - ; - previous2._next = next2 || null; - } - } - } - update2 = new Selection$1(update2, parents2); - update2._enter = enter2; - update2._exit = exit2; - return update2; - } - function arraylike(data) { - return typeof data === "object" && "length" in data ? data : Array.from(data); - } - function selection_exit() { - return new Selection$1(this._exit || this._groups.map(sparse), this._parents); - } - function selection_join(onenter, onupdate, onexit) { - var enter2 = this.enter(), update2 = this, exit2 = this.exit(); - if (typeof onenter === "function") { - enter2 = onenter(enter2); - if (enter2) - enter2 = enter2.selection(); - } else { - enter2 = enter2.append(onenter + ""); - } - if (onupdate != null) { - update2 = onupdate(update2); - if (update2) - update2 = update2.selection(); + }; + getThemeVariables4 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme4(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - if (onexit == null) - exit2.remove(); - else - onexit(exit2); - return enter2 && update2 ? enter2.merge(update2).order() : update2; - } - function selection_merge(context) { - var selection2 = context.selection ? context.selection() : context; - for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge2 = merges[j] = new Array(n), node2, i2 = 0; i2 < n; ++i2) { - if (node2 = group0[i2] || group1[i2]) { - merge2[i2] = node2; + }); + + // src/themes/theme-neutral.js + var Theme5, getThemeVariables5; + var init_theme_neutral = __esm({ + "src/themes/theme-neutral.js"() { + "use strict"; + init_dist(); + init_theme_helpers(); + init_erDiagram_oldHardcodedValues(); + Theme5 = class { + static { + __name(this, "Theme"); + } + constructor() { + this.primaryColor = "#eee"; + this.contrast = "#707070"; + this.secondaryColor = lighten_default(this.contrast, 55); + this.background = "#ffffff"; + this.tertiaryColor = adjust_default(this.primaryColor, { h: -160 }); + this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode); + this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); + this.primaryTextColor = invert_default(this.primaryColor); + this.secondaryTextColor = invert_default(this.secondaryColor); + this.tertiaryTextColor = invert_default(this.tertiaryColor); + this.lineColor = invert_default(this.background); + this.textColor = invert_default(this.background); + this.mainBkg = "#eee"; + this.secondBkg = "calculated"; + this.lineColor = "#666"; + this.border1 = "#999"; + this.border2 = "calculated"; + this.note = "#ffa"; + this.text = "#333"; + this.critical = "#d42"; + this.done = "#bbb"; + this.arrowheadColor = "#333333"; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = "16px"; + this.THEME_COLOR_LIMIT = 12; + this.nodeBkg = "calculated"; + this.nodeBorder = "calculated"; + this.clusterBkg = "calculated"; + this.clusterBorder = "calculated"; + this.defaultLinkColor = "calculated"; + this.titleColor = "calculated"; + this.edgeLabelBackground = "white"; + this.actorBorder = "calculated"; + this.actorBkg = "calculated"; + this.actorTextColor = "calculated"; + this.actorLineColor = this.actorBorder; + this.signalColor = "calculated"; + this.signalTextColor = "calculated"; + this.labelBoxBkgColor = "calculated"; + this.labelBoxBorderColor = "calculated"; + this.labelTextColor = "calculated"; + this.loopTextColor = "calculated"; + this.noteBorderColor = "calculated"; + this.noteBkgColor = "calculated"; + this.noteTextColor = "calculated"; + this.activationBorderColor = "#666"; + this.activationBkgColor = "#f4f4f4"; + this.sequenceNumberColor = "white"; + this.sectionBkgColor = "calculated"; + this.altSectionBkgColor = "white"; + this.sectionBkgColor2 = "calculated"; + this.excludeBkgColor = "#eeeeee"; + this.taskBorderColor = "calculated"; + this.taskBkgColor = "calculated"; + this.taskTextLightColor = "white"; + this.taskTextColor = "calculated"; + this.taskTextDarkColor = "calculated"; + this.taskTextOutsideColor = "calculated"; + this.taskTextClickableColor = "#003163"; + this.activeTaskBorderColor = "calculated"; + this.activeTaskBkgColor = "calculated"; + this.gridColor = "calculated"; + this.doneTaskBkgColor = "calculated"; + this.doneTaskBorderColor = "calculated"; + this.critBkgColor = "calculated"; + this.critBorderColor = "calculated"; + this.todayLineColor = "calculated"; + this.personBorder = this.primaryBorderColor; + this.personBkg = this.mainBkg; + this.labelColor = "black"; + this.errorBkgColor = "#552222"; + this.errorTextColor = "#552222"; + } + updateColors() { + this.secondBkg = lighten_default(this.contrast, 55); + this.border2 = this.contrast; + this.actorBorder = lighten_default(this.border1, 23); + this.actorBkg = this.mainBkg; + this.actorTextColor = this.text; + this.actorLineColor = this.actorBorder; + this.signalColor = this.text; + this.signalTextColor = this.text; + this.labelBoxBkgColor = this.actorBkg; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.text; + this.loopTextColor = this.text; + this.noteBorderColor = "#999"; + this.noteBkgColor = "#666"; + this.noteTextColor = "#fff"; + this.cScale0 = this.cScale0 || "#555"; + this.cScale1 = this.cScale1 || "#F4F4F4"; + this.cScale2 = this.cScale2 || "#555"; + this.cScale3 = this.cScale3 || "#BBB"; + this.cScale4 = this.cScale4 || "#777"; + this.cScale5 = this.cScale5 || "#999"; + this.cScale6 = this.cScale6 || "#DDD"; + this.cScale7 = this.cScale7 || "#FFF"; + this.cScale8 = this.cScale8 || "#DDD"; + this.cScale9 = this.cScale9 || "#BBB"; + this.cScale10 = this.cScale10 || "#999"; + this.cScale11 = this.cScale11 || "#777"; + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert_default(this["cScale" + i2]); + } + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + if (this.darkMode) { + this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten_default(this["cScale" + i2], 10); + } else { + this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken_default(this["cScale" + i2], 10); + } + } + this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor); + this.cScaleLabel0 = this.cScaleLabel0 || this.cScale1; + this.cScaleLabel2 = this.cScaleLabel2 || this.cScale1; + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; + } + for (let i2 = 0; i2 < 5; i2++) { + this["surface" + i2] = this["surface" + i2] || adjust_default(this.mainBkg, { l: -(5 + i2 * 5) }); + this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust_default(this.mainBkg, { l: -(8 + i2 * 5) }); + } + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.titleColor = this.text; + this.sectionBkgColor = lighten_default(this.contrast, 30); + this.sectionBkgColor2 = lighten_default(this.contrast, 30); + this.taskBorderColor = darken_default(this.contrast, 10); + this.taskBkgColor = this.contrast; + this.taskTextColor = this.taskTextLightColor; + this.taskTextDarkColor = this.text; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.activeTaskBorderColor = this.taskBorderColor; + this.activeTaskBkgColor = this.mainBkg; + this.gridColor = lighten_default(this.border1, 30); + this.doneTaskBkgColor = this.done; + this.doneTaskBorderColor = this.lineColor; + this.critBkgColor = this.critical; + this.critBorderColor = darken_default(this.critBkgColor, 10); + this.todayLineColor = this.critBkgColor; + this.transitionColor = this.transitionColor || "#000"; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || "#f4f4f4"; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.stateBorder = this.stateBorder || "#000"; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = "#222"; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.classText = this.primaryTextColor; + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = adjust_default(this.primaryColor, { h: 64 }); + this.fillType3 = adjust_default(this.secondaryColor, { h: 64 }); + this.fillType4 = adjust_default(this.primaryColor, { h: -64 }); + this.fillType5 = adjust_default(this.secondaryColor, { h: -64 }); + this.fillType6 = adjust_default(this.primaryColor, { h: 128 }); + this.fillType7 = adjust_default(this.secondaryColor, { h: 128 }); + for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { + this["pie" + i2] = this["cScale" + i2]; + } + this.pie12 = this.pie0; + this.pieTitleTextSize = this.pieTitleTextSize || "25px"; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || "17px"; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || "17px"; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || "black"; + this.pieStrokeWidth = this.pieStrokeWidth || "2px"; + this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; + this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; + this.pieOpacity = this.pieOpacity || "0.7"; + this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; + this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 }); + this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 }); + this.quadrant4Fill = this.quadrant4Fill || adjust_default(this.primaryColor, { r: 15, g: 15, b: 15 }); + this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; + this.quadrant2TextFill = this.quadrant2TextFill || adjust_default(this.primaryTextColor, { r: -5, g: -5, b: -5 }); + this.quadrant3TextFill = this.quadrant3TextFill || adjust_default(this.primaryTextColor, { r: -10, g: -10, b: -10 }); + this.quadrant4TextFill = this.quadrant4TextFill || adjust_default(this.primaryTextColor, { r: -15, g: -15, b: -15 }); + this.quadrantPointFill = this.quadrantPointFill || is_dark_default(this.quadrant1Fill) ? lighten_default(this.quadrant1Fill) : darken_default(this.quadrant1Fill); + this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; + this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; + this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; + this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; + this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; + this.xyChart = { + backgroundColor: this.xyChart?.backgroundColor || this.background, + titleColor: this.xyChart?.titleColor || this.primaryTextColor, + xAxisTitleColor: this.xyChart?.xAxisTitleColor || this.primaryTextColor, + xAxisLabelColor: this.xyChart?.xAxisLabelColor || this.primaryTextColor, + xAxisTickColor: this.xyChart?.xAxisTickColor || this.primaryTextColor, + xAxisLineColor: this.xyChart?.xAxisLineColor || this.primaryTextColor, + yAxisTitleColor: this.xyChart?.yAxisTitleColor || this.primaryTextColor, + yAxisLabelColor: this.xyChart?.yAxisLabelColor || this.primaryTextColor, + yAxisTickColor: this.xyChart?.yAxisTickColor || this.primaryTextColor, + yAxisLineColor: this.xyChart?.yAxisLineColor || this.primaryTextColor, + plotColorPalette: this.xyChart?.plotColorPalette || "#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0" + }; + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || "1"; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + this.git0 = darken_default(this.pie1, 25) || this.primaryColor; + this.git1 = this.pie2 || this.secondaryColor; + this.git2 = this.pie3 || this.tertiaryColor; + this.git3 = this.pie4 || adjust_default(this.primaryColor, { h: -30 }); + this.git4 = this.pie5 || adjust_default(this.primaryColor, { h: -60 }); + this.git5 = this.pie6 || adjust_default(this.primaryColor, { h: -90 }); + this.git6 = this.pie7 || adjust_default(this.primaryColor, { h: 60 }); + this.git7 = this.pie8 || adjust_default(this.primaryColor, { h: 120 }); + this.gitInv0 = this.gitInv0 || invert_default(this.git0); + this.gitInv1 = this.gitInv1 || invert_default(this.git1); + this.gitInv2 = this.gitInv2 || invert_default(this.git2); + this.gitInv3 = this.gitInv3 || invert_default(this.git3); + this.gitInv4 = this.gitInv4 || invert_default(this.git4); + this.gitInv5 = this.gitInv5 || invert_default(this.git5); + this.gitInv6 = this.gitInv6 || invert_default(this.git6); + this.gitInv7 = this.gitInv7 || invert_default(this.git7); + this.branchLabelColor = this.branchLabelColor || this.labelTextColor; + this.gitBranchLabel0 = this.branchLabelColor; + this.gitBranchLabel1 = "white"; + this.gitBranchLabel2 = this.branchLabelColor; + this.gitBranchLabel3 = "white"; + this.gitBranchLabel4 = this.branchLabelColor; + this.gitBranchLabel5 = this.branchLabelColor; + this.gitBranchLabel6 = this.branchLabelColor; + this.gitBranchLabel7 = this.branchLabelColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || "10px"; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || "10px"; + this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; + this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; + } + calculate(overrides) { + if (typeof overrides !== "object") { + this.updateColors(); + return; + } + const keys3 = Object.keys(overrides); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); + this.updateColors(); + keys3.forEach((k2) => { + this[k2] = overrides[k2]; + }); } - } - } - for (; j < m0; ++j) { - merges[j] = groups0[j]; + }; + getThemeVariables5 = /* @__PURE__ */ __name((userOverrides) => { + const theme = new Theme5(); + theme.calculate(userOverrides); + return theme; + }, "getThemeVariables"); } - return new Selection$1(merges, this._parents); - } - function selection_order() { - for (var groups = this._groups, j = -1, m = groups.length; ++j < m; ) { - for (var group = groups[j], i2 = group.length - 1, next2 = group[i2], node2; --i2 >= 0; ) { - if (node2 = group[i2]) { - if (next2 && node2.compareDocumentPosition(next2) ^ 4) - next2.parentNode.insertBefore(node2, next2); - next2 = node2; + }); + + // src/themes/index.js + var themes_default; + var init_themes = __esm({ + "src/themes/index.js"() { + "use strict"; + init_theme_base(); + init_theme_dark(); + init_theme_default(); + init_theme_forest(); + init_theme_neutral(); + themes_default = { + base: { + getThemeVariables + }, + dark: { + getThemeVariables: getThemeVariables2 + }, + default: { + getThemeVariables: getThemeVariables3 + }, + forest: { + getThemeVariables: getThemeVariables4 + }, + neutral: { + getThemeVariables: getThemeVariables5 } - } + }; } - return this; - } - function selection_sort(compare) { - if (!compare) - compare = ascending; - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; + }); + + // src/schemas/config.schema.yaml?only-defaults=true + var config_schema_default; + var init_config_schema = __esm({ + "src/schemas/config.schema.yaml?only-defaults=true"() { + "use strict"; + config_schema_default = { + "flowchart": { + "useMaxWidth": true, + "titleTopMargin": 25, + "subGraphTitleMargin": { + "top": 0, + "bottom": 0 + }, + "diagramPadding": 8, + "htmlLabels": true, + "nodeSpacing": 50, + "rankSpacing": 50, + "curve": "basis", + "padding": 15, + "defaultRenderer": "dagre-wrapper", + "wrappingWidth": 200 + }, + "sequence": { + "useMaxWidth": true, + "hideUnusedParticipants": false, + "activationWidth": 10, + "diagramMarginX": 50, + "diagramMarginY": 10, + "actorMargin": 50, + "width": 150, + "height": 65, + "boxMargin": 10, + "boxTextMargin": 5, + "noteMargin": 10, + "messageMargin": 35, + "messageAlign": "center", + "mirrorActors": true, + "forceMenus": false, + "bottomMarginAdj": 1, + "rightAngles": false, + "showSequenceNumbers": false, + "actorFontSize": 14, + "actorFontFamily": '"Open Sans", sans-serif', + "actorFontWeight": 400, + "noteFontSize": 14, + "noteFontFamily": '"trebuchet ms", verdana, arial, sans-serif', + "noteFontWeight": 400, + "noteAlign": "center", + "messageFontSize": 16, + "messageFontFamily": '"trebuchet ms", verdana, arial, sans-serif', + "messageFontWeight": 400, + "wrap": false, + "wrapPadding": 10, + "labelBoxWidth": 50, + "labelBoxHeight": 20 + }, + "gantt": { + "useMaxWidth": true, + "titleTopMargin": 25, + "barHeight": 20, + "barGap": 4, + "topPadding": 50, + "rightPadding": 75, + "leftPadding": 75, + "gridLineStartPadding": 35, + "fontSize": 11, + "sectionFontSize": 11, + "numberSectionStyles": 4, + "axisFormat": "%Y-%m-%d", + "topAxis": false, + "displayMode": "", + "weekday": "sunday" + }, + "journey": { + "useMaxWidth": true, + "diagramMarginX": 50, + "diagramMarginY": 10, + "leftMargin": 150, + "width": 150, + "height": 50, + "boxMargin": 10, + "boxTextMargin": 5, + "noteMargin": 10, + "messageMargin": 35, + "messageAlign": "center", + "bottomMarginAdj": 1, + "rightAngles": false, + "taskFontSize": 14, + "taskFontFamily": '"Open Sans", sans-serif', + "taskMargin": 50, + "activationWidth": 10, + "textPlacement": "fo", + "actorColours": [ + "#8FBC8F", + "#7CFC00", + "#00FFFF", + "#20B2AA", + "#B0E0E6", + "#FFFFE0" + ], + "sectionFills": [ + "#191970", + "#8B008B", + "#4B0082", + "#2F4F4F", + "#800000", + "#8B4513", + "#00008B" + ], + "sectionColours": [ + "#fff" + ] + }, + "class": { + "useMaxWidth": true, + "titleTopMargin": 25, + "arrowMarkerAbsolute": false, + "dividerMargin": 10, + "padding": 5, + "textHeight": 10, + "defaultRenderer": "dagre-wrapper", + "htmlLabels": false + }, + "state": { + "useMaxWidth": true, + "titleTopMargin": 25, + "dividerMargin": 10, + "sizeUnit": 5, + "padding": 8, + "textHeight": 10, + "titleShift": -15, + "noteMargin": 10, + "forkWidth": 70, + "forkHeight": 7, + "miniPadding": 2, + "fontSizeFactor": 5.02, + "fontSize": 24, + "labelHeight": 16, + "edgeLengthFactor": "20", + "compositTitleSize": 35, + "radius": 5, + "defaultRenderer": "dagre-wrapper" + }, + "er": { + "useMaxWidth": true, + "titleTopMargin": 25, + "diagramPadding": 20, + "layoutDirection": "TB", + "minEntityWidth": 100, + "minEntityHeight": 75, + "entityPadding": 15, + "stroke": "gray", + "fill": "honeydew", + "fontSize": 12 + }, + "pie": { + "useMaxWidth": true, + "textPosition": 0.75 + }, + "quadrantChart": { + "useMaxWidth": true, + "chartWidth": 500, + "chartHeight": 500, + "titleFontSize": 20, + "titlePadding": 10, + "quadrantPadding": 5, + "xAxisLabelPadding": 5, + "yAxisLabelPadding": 5, + "xAxisLabelFontSize": 16, + "yAxisLabelFontSize": 16, + "quadrantLabelFontSize": 16, + "quadrantTextTopPadding": 5, + "pointTextPadding": 5, + "pointLabelFontSize": 12, + "pointRadius": 5, + "xAxisPosition": "top", + "yAxisPosition": "left", + "quadrantInternalBorderStrokeWidth": 1, + "quadrantExternalBorderStrokeWidth": 2 + }, + "xyChart": { + "useMaxWidth": true, + "width": 700, + "height": 500, + "titleFontSize": 20, + "titlePadding": 10, + "showTitle": true, + "xAxis": { + "$ref": "#/$defs/XYChartAxisConfig", + "showLabel": true, + "labelFontSize": 14, + "labelPadding": 5, + "showTitle": true, + "titleFontSize": 16, + "titlePadding": 5, + "showTick": true, + "tickLength": 5, + "tickWidth": 2, + "showAxisLine": true, + "axisLineWidth": 2 + }, + "yAxis": { + "$ref": "#/$defs/XYChartAxisConfig", + "showLabel": true, + "labelFontSize": 14, + "labelPadding": 5, + "showTitle": true, + "titleFontSize": 16, + "titlePadding": 5, + "showTick": true, + "tickLength": 5, + "tickWidth": 2, + "showAxisLine": true, + "axisLineWidth": 2 + }, + "chartOrientation": "vertical", + "plotReservedSpacePercent": 50 + }, + "requirement": { + "useMaxWidth": true, + "rect_fill": "#f9f9f9", + "text_color": "#333", + "rect_border_size": "0.5px", + "rect_border_color": "#bbb", + "rect_min_width": 200, + "rect_min_height": 200, + "fontSize": 14, + "rect_padding": 10, + "line_height": 20 + }, + "mindmap": { + "useMaxWidth": true, + "padding": 10, + "maxNodeWidth": 200 + }, + "timeline": { + "useMaxWidth": true, + "diagramMarginX": 50, + "diagramMarginY": 10, + "leftMargin": 150, + "width": 150, + "height": 50, + "boxMargin": 10, + "boxTextMargin": 5, + "noteMargin": 10, + "messageMargin": 35, + "messageAlign": "center", + "bottomMarginAdj": 1, + "rightAngles": false, + "taskFontSize": 14, + "taskFontFamily": '"Open Sans", sans-serif', + "taskMargin": 50, + "activationWidth": 10, + "textPlacement": "fo", + "actorColours": [ + "#8FBC8F", + "#7CFC00", + "#00FFFF", + "#20B2AA", + "#B0E0E6", + "#FFFFE0" + ], + "sectionFills": [ + "#191970", + "#8B008B", + "#4B0082", + "#2F4F4F", + "#800000", + "#8B4513", + "#00008B" + ], + "sectionColours": [ + "#fff" + ], + "disableMulticolor": false + }, + "gitGraph": { + "useMaxWidth": true, + "titleTopMargin": 25, + "diagramPadding": 8, + "nodeLabel": { + "width": 75, + "height": 100, + "x": -25, + "y": 0 + }, + "mainBranchName": "main", + "mainBranchOrder": 0, + "showCommitLabel": true, + "showBranches": true, + "rotateCommitLabel": true, + "parallelCommits": false, + "arrowMarkerAbsolute": false + }, + "c4": { + "useMaxWidth": true, + "diagramMarginX": 50, + "diagramMarginY": 10, + "c4ShapeMargin": 50, + "c4ShapePadding": 20, + "width": 216, + "height": 60, + "boxMargin": 10, + "c4ShapeInRow": 4, + "nextLinePaddingX": 0, + "c4BoundaryInRow": 2, + "personFontSize": 14, + "personFontFamily": '"Open Sans", sans-serif', + "personFontWeight": "normal", + "external_personFontSize": 14, + "external_personFontFamily": '"Open Sans", sans-serif', + "external_personFontWeight": "normal", + "systemFontSize": 14, + "systemFontFamily": '"Open Sans", sans-serif', + "systemFontWeight": "normal", + "external_systemFontSize": 14, + "external_systemFontFamily": '"Open Sans", sans-serif', + "external_systemFontWeight": "normal", + "system_dbFontSize": 14, + "system_dbFontFamily": '"Open Sans", sans-serif', + "system_dbFontWeight": "normal", + "external_system_dbFontSize": 14, + "external_system_dbFontFamily": '"Open Sans", sans-serif', + "external_system_dbFontWeight": "normal", + "system_queueFontSize": 14, + "system_queueFontFamily": '"Open Sans", sans-serif', + "system_queueFontWeight": "normal", + "external_system_queueFontSize": 14, + "external_system_queueFontFamily": '"Open Sans", sans-serif', + "external_system_queueFontWeight": "normal", + "boundaryFontSize": 14, + "boundaryFontFamily": '"Open Sans", sans-serif', + "boundaryFontWeight": "normal", + "messageFontSize": 12, + "messageFontFamily": '"Open Sans", sans-serif', + "messageFontWeight": "normal", + "containerFontSize": 14, + "containerFontFamily": '"Open Sans", sans-serif', + "containerFontWeight": "normal", + "external_containerFontSize": 14, + "external_containerFontFamily": '"Open Sans", sans-serif', + "external_containerFontWeight": "normal", + "container_dbFontSize": 14, + "container_dbFontFamily": '"Open Sans", sans-serif', + "container_dbFontWeight": "normal", + "external_container_dbFontSize": 14, + "external_container_dbFontFamily": '"Open Sans", sans-serif', + "external_container_dbFontWeight": "normal", + "container_queueFontSize": 14, + "container_queueFontFamily": '"Open Sans", sans-serif', + "container_queueFontWeight": "normal", + "external_container_queueFontSize": 14, + "external_container_queueFontFamily": '"Open Sans", sans-serif', + "external_container_queueFontWeight": "normal", + "componentFontSize": 14, + "componentFontFamily": '"Open Sans", sans-serif', + "componentFontWeight": "normal", + "external_componentFontSize": 14, + "external_componentFontFamily": '"Open Sans", sans-serif', + "external_componentFontWeight": "normal", + "component_dbFontSize": 14, + "component_dbFontFamily": '"Open Sans", sans-serif', + "component_dbFontWeight": "normal", + "external_component_dbFontSize": 14, + "external_component_dbFontFamily": '"Open Sans", sans-serif', + "external_component_dbFontWeight": "normal", + "component_queueFontSize": 14, + "component_queueFontFamily": '"Open Sans", sans-serif', + "component_queueFontWeight": "normal", + "external_component_queueFontSize": 14, + "external_component_queueFontFamily": '"Open Sans", sans-serif', + "external_component_queueFontWeight": "normal", + "wrap": true, + "wrapPadding": 10, + "person_bg_color": "#08427B", + "person_border_color": "#073B6F", + "external_person_bg_color": "#686868", + "external_person_border_color": "#8A8A8A", + "system_bg_color": "#1168BD", + "system_border_color": "#3C7FC0", + "system_db_bg_color": "#1168BD", + "system_db_border_color": "#3C7FC0", + "system_queue_bg_color": "#1168BD", + "system_queue_border_color": "#3C7FC0", + "external_system_bg_color": "#999999", + "external_system_border_color": "#8A8A8A", + "external_system_db_bg_color": "#999999", + "external_system_db_border_color": "#8A8A8A", + "external_system_queue_bg_color": "#999999", + "external_system_queue_border_color": "#8A8A8A", + "container_bg_color": "#438DD5", + "container_border_color": "#3C7FC0", + "container_db_bg_color": "#438DD5", + "container_db_border_color": "#3C7FC0", + "container_queue_bg_color": "#438DD5", + "container_queue_border_color": "#3C7FC0", + "external_container_bg_color": "#B3B3B3", + "external_container_border_color": "#A6A6A6", + "external_container_db_bg_color": "#B3B3B3", + "external_container_db_border_color": "#A6A6A6", + "external_container_queue_bg_color": "#B3B3B3", + "external_container_queue_border_color": "#A6A6A6", + "component_bg_color": "#85BBF0", + "component_border_color": "#78A8D8", + "component_db_bg_color": "#85BBF0", + "component_db_border_color": "#78A8D8", + "component_queue_bg_color": "#85BBF0", + "component_queue_border_color": "#78A8D8", + "external_component_bg_color": "#CCCCCC", + "external_component_border_color": "#BFBFBF", + "external_component_db_bg_color": "#CCCCCC", + "external_component_db_border_color": "#BFBFBF", + "external_component_queue_bg_color": "#CCCCCC", + "external_component_queue_border_color": "#BFBFBF" + }, + "sankey": { + "useMaxWidth": true, + "width": 600, + "height": 400, + "linkColor": "gradient", + "nodeAlignment": "justify", + "showValues": true, + "prefix": "", + "suffix": "" + }, + "block": { + "useMaxWidth": true, + "padding": 8 + }, + "packet": { + "useMaxWidth": true, + "rowHeight": 32, + "bitWidth": 32, + "bitsPerRow": 32, + "showBits": true, + "paddingX": 5, + "paddingY": 5 + }, + "theme": "default", + "look": "classic", + "handDrawnSeed": 0, + "layout": "dagre", + "maxTextSize": 5e4, + "maxEdges": 500, + "darkMode": false, + "fontFamily": '"trebuchet ms", verdana, arial, sans-serif;', + "logLevel": 5, + "securityLevel": "strict", + "startOnLoad": true, + "arrowMarkerAbsolute": false, + "secure": [ + "secure", + "securityLevel", + "startOnLoad", + "maxTextSize", + "suppressErrorRendering", + "maxEdges" + ], + "legacyMathML": false, + "forceLegacyMathML": false, + "deterministicIds": false, + "fontSize": 16, + "markdownAutoWrap": true, + "suppressErrorRendering": false + }; } - for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node2, i2 = 0; i2 < n; ++i2) { - if (node2 = group[i2]) { - sortgroup[i2] = node2; + }); + + // src/defaultConfig.ts + var config, keyify, configKeys, defaultConfig_default; + var init_defaultConfig = __esm({ + "src/defaultConfig.ts"() { + "use strict"; + init_themes(); + init_config_schema(); + config = { + ...config_schema_default, + // Set, even though they're `undefined` so that `configKeys` finds these keys + // TODO: Should we replace these with `null` so that they can go in the JSON Schema? + deterministicIDSeed: void 0, + elk: { + mergeEdges: false, + nodePlacementStrategy: "SIMPLE" + }, + themeCSS: void 0, + // add non-JSON default config values + themeVariables: themes_default.default.getThemeVariables(), + sequence: { + ...config_schema_default.sequence, + messageFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + }, "messageFont"), + noteFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.noteFontFamily, + fontSize: this.noteFontSize, + fontWeight: this.noteFontWeight + }; + }, "noteFont"), + actorFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.actorFontFamily, + fontSize: this.actorFontSize, + fontWeight: this.actorFontWeight + }; + }, "actorFont") + }, + gantt: { + ...config_schema_default.gantt, + tickInterval: void 0, + useWidth: void 0 + // can probably be removed since `configKeys` already includes this + }, + c4: { + ...config_schema_default.c4, + useWidth: void 0, + personFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.personFontFamily, + fontSize: this.personFontSize, + fontWeight: this.personFontWeight + }; + }, "personFont"), + external_personFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_personFontFamily, + fontSize: this.external_personFontSize, + fontWeight: this.external_personFontWeight + }; + }, "external_personFont"), + systemFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.systemFontFamily, + fontSize: this.systemFontSize, + fontWeight: this.systemFontWeight + }; + }, "systemFont"), + external_systemFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_systemFontFamily, + fontSize: this.external_systemFontSize, + fontWeight: this.external_systemFontWeight + }; + }, "external_systemFont"), + system_dbFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.system_dbFontFamily, + fontSize: this.system_dbFontSize, + fontWeight: this.system_dbFontWeight + }; + }, "system_dbFont"), + external_system_dbFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_system_dbFontFamily, + fontSize: this.external_system_dbFontSize, + fontWeight: this.external_system_dbFontWeight + }; + }, "external_system_dbFont"), + system_queueFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.system_queueFontFamily, + fontSize: this.system_queueFontSize, + fontWeight: this.system_queueFontWeight + }; + }, "system_queueFont"), + external_system_queueFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_system_queueFontFamily, + fontSize: this.external_system_queueFontSize, + fontWeight: this.external_system_queueFontWeight + }; + }, "external_system_queueFont"), + containerFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.containerFontFamily, + fontSize: this.containerFontSize, + fontWeight: this.containerFontWeight + }; + }, "containerFont"), + external_containerFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_containerFontFamily, + fontSize: this.external_containerFontSize, + fontWeight: this.external_containerFontWeight + }; + }, "external_containerFont"), + container_dbFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.container_dbFontFamily, + fontSize: this.container_dbFontSize, + fontWeight: this.container_dbFontWeight + }; + }, "container_dbFont"), + external_container_dbFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_container_dbFontFamily, + fontSize: this.external_container_dbFontSize, + fontWeight: this.external_container_dbFontWeight + }; + }, "external_container_dbFont"), + container_queueFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.container_queueFontFamily, + fontSize: this.container_queueFontSize, + fontWeight: this.container_queueFontWeight + }; + }, "container_queueFont"), + external_container_queueFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_container_queueFontFamily, + fontSize: this.external_container_queueFontSize, + fontWeight: this.external_container_queueFontWeight + }; + }, "external_container_queueFont"), + componentFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.componentFontFamily, + fontSize: this.componentFontSize, + fontWeight: this.componentFontWeight + }; + }, "componentFont"), + external_componentFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_componentFontFamily, + fontSize: this.external_componentFontSize, + fontWeight: this.external_componentFontWeight + }; + }, "external_componentFont"), + component_dbFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.component_dbFontFamily, + fontSize: this.component_dbFontSize, + fontWeight: this.component_dbFontWeight + }; + }, "component_dbFont"), + external_component_dbFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_component_dbFontFamily, + fontSize: this.external_component_dbFontSize, + fontWeight: this.external_component_dbFontWeight + }; + }, "external_component_dbFont"), + component_queueFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.component_queueFontFamily, + fontSize: this.component_queueFontSize, + fontWeight: this.component_queueFontWeight + }; + }, "component_queueFont"), + external_component_queueFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.external_component_queueFontFamily, + fontSize: this.external_component_queueFontSize, + fontWeight: this.external_component_queueFontWeight + }; + }, "external_component_queueFont"), + boundaryFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.boundaryFontFamily, + fontSize: this.boundaryFontSize, + fontWeight: this.boundaryFontWeight + }; + }, "boundaryFont"), + messageFont: /* @__PURE__ */ __name(function() { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + }, "messageFont") + }, + pie: { + ...config_schema_default.pie, + useWidth: 984 + }, + xyChart: { + ...config_schema_default.xyChart, + useWidth: void 0 + }, + requirement: { + ...config_schema_default.requirement, + useWidth: void 0 + }, + packet: { + ...config_schema_default.packet } - } - sortgroup.sort(compareNode); - } - return new Selection$1(sortgroups, this._parents).order(); - } - function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; - } - function selection_call() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; - } - function selection_nodes() { - return Array.from(this); - } - function selection_node() { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i2 = 0, n = group.length; i2 < n; ++i2) { - var node2 = group[i2]; - if (node2) - return node2; - } + }; + keyify = /* @__PURE__ */ __name((obj, prefix = "") => Object.keys(obj).reduce((res, el) => { + if (Array.isArray(obj[el])) { + return res; + } else if (typeof obj[el] === "object" && obj[el] !== null) { + return [...res, prefix + el, ...keyify(obj[el], "")]; + } + return [...res, prefix + el]; + }, []), "keyify"); + configKeys = new Set(keyify(config, "")); + defaultConfig_default = config; } - return null; - } - function selection_size() { - let size2 = 0; - for (const node2 of this) - ++size2; - return size2; - } - function selection_empty() { - return !this.node(); - } - function selection_each(callback) { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i2 = 0, n = group.length, node2; i2 < n; ++i2) { - if (node2 = group[i2]) - callback.call(node2, node2.__data__, i2, group); - } + }); + + // src/utils/sanitizeDirective.ts + var sanitizeDirective, sanitizeCss; + var init_sanitizeDirective = __esm({ + "src/utils/sanitizeDirective.ts"() { + "use strict"; + init_defaultConfig(); + init_logger(); + sanitizeDirective = /* @__PURE__ */ __name((args) => { + log.debug("sanitizeDirective called with", args); + if (typeof args !== "object" || args == null) { + return; + } + if (Array.isArray(args)) { + args.forEach((arg) => sanitizeDirective(arg)); + return; + } + for (const key of Object.keys(args)) { + log.debug("Checking key", key); + if (key.startsWith("__") || key.includes("proto") || key.includes("constr") || !configKeys.has(key) || args[key] == null) { + log.debug("sanitize deleting key: ", key); + delete args[key]; + continue; + } + if (typeof args[key] === "object") { + log.debug("sanitizing object", key); + sanitizeDirective(args[key]); + continue; + } + const cssMatchers = ["themeCSS", "fontFamily", "altFontFamily"]; + for (const cssKey of cssMatchers) { + if (key.includes(cssKey)) { + log.debug("sanitizing css option", key); + args[key] = sanitizeCss(args[key]); + } + } + } + if (args.themeVariables) { + for (const k2 of Object.keys(args.themeVariables)) { + const val = args.themeVariables[k2]; + if (val?.match && !val.match(/^[\d "#%(),.;A-Za-z]+$/)) { + args.themeVariables[k2] = ""; + } + } + } + log.debug("After sanitization", args); + }, "sanitizeDirective"); + sanitizeCss = /* @__PURE__ */ __name((str2) => { + let startCnt = 0; + let endCnt = 0; + for (const element3 of str2) { + if (startCnt < endCnt) { + return "{ /* ERROR: Unbalanced CSS */ }"; + } + if (element3 === "{") { + startCnt++; + } else if (element3 === "}") { + endCnt++; + } + } + if (startCnt !== endCnt) { + return "{ /* ERROR: Unbalanced CSS */ }"; + } + return str2; + }, "sanitizeCss"); } - return this; - } - function attrRemove$1(name) { - return function() { - this.removeAttribute(name); - }; - } - function attrRemoveNS$1(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - function attrConstant$1(name, value2) { - return function() { - this.setAttribute(name, value2); - }; - } - function attrConstantNS$1(fullname, value2) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value2); - }; - } - function attrFunction$1(name, value2) { - return function() { - var v = value2.apply(this, arguments); - if (v == null) - this.removeAttribute(name); - else - this.setAttribute(name, v); - }; - } - function attrFunctionNS$1(fullname, value2) { - return function() { - var v = value2.apply(this, arguments); - if (v == null) - this.removeAttributeNS(fullname.space, fullname.local); - else - this.setAttributeNS(fullname.space, fullname.local, v); - }; - } - function selection_attr(name, value2) { - var fullname = namespace(name); - if (arguments.length < 2) { - var node2 = this.node(); - return fullname.local ? node2.getAttributeNS(fullname.space, fullname.local) : node2.getAttribute(fullname); + }); + + // src/config.ts + var defaultConfig, siteConfig, configFromInitialize, directives, currentConfig, updateCurrentConfig, setSiteConfig, saveConfigFromInitialize, updateSiteConfig, getSiteConfig, setConfig, getConfig, sanitize, addDirective, reset, ConfigWarning, issuedWarnings, issueWarning, checkConfig; + var init_config = __esm({ + "src/config.ts"() { + "use strict"; + init_assignWithDepth(); + init_logger(); + init_themes(); + init_defaultConfig(); + init_sanitizeDirective(); + defaultConfig = Object.freeze(defaultConfig_default); + siteConfig = assignWithDepth_default({}, defaultConfig); + directives = []; + currentConfig = assignWithDepth_default({}, defaultConfig); + updateCurrentConfig = /* @__PURE__ */ __name((siteCfg, _directives) => { + let cfg = assignWithDepth_default({}, siteCfg); + let sumOfDirectives = {}; + for (const d2 of _directives) { + sanitize(d2); + sumOfDirectives = assignWithDepth_default(sumOfDirectives, d2); + } + cfg = assignWithDepth_default(cfg, sumOfDirectives); + if (sumOfDirectives.theme && sumOfDirectives.theme in themes_default) { + const tmpConfigFromInitialize = assignWithDepth_default({}, configFromInitialize); + const themeVariables = assignWithDepth_default( + tmpConfigFromInitialize.themeVariables || {}, + sumOfDirectives.themeVariables + ); + if (cfg.theme && cfg.theme in themes_default) { + cfg.themeVariables = themes_default[cfg.theme].getThemeVariables(themeVariables); + } + } + currentConfig = cfg; + checkConfig(currentConfig); + return currentConfig; + }, "updateCurrentConfig"); + setSiteConfig = /* @__PURE__ */ __name((conf8) => { + siteConfig = assignWithDepth_default({}, defaultConfig); + siteConfig = assignWithDepth_default(siteConfig, conf8); + if (conf8.theme && themes_default[conf8.theme]) { + siteConfig.themeVariables = themes_default[conf8.theme].getThemeVariables(conf8.themeVariables); + } + updateCurrentConfig(siteConfig, directives); + return siteConfig; + }, "setSiteConfig"); + saveConfigFromInitialize = /* @__PURE__ */ __name((conf8) => { + configFromInitialize = assignWithDepth_default({}, conf8); + }, "saveConfigFromInitialize"); + updateSiteConfig = /* @__PURE__ */ __name((conf8) => { + siteConfig = assignWithDepth_default(siteConfig, conf8); + updateCurrentConfig(siteConfig, directives); + return siteConfig; + }, "updateSiteConfig"); + getSiteConfig = /* @__PURE__ */ __name(() => { + return assignWithDepth_default({}, siteConfig); + }, "getSiteConfig"); + setConfig = /* @__PURE__ */ __name((conf8) => { + checkConfig(conf8); + assignWithDepth_default(currentConfig, conf8); + return getConfig(); + }, "setConfig"); + getConfig = /* @__PURE__ */ __name(() => { + return assignWithDepth_default({}, currentConfig); + }, "getConfig"); + sanitize = /* @__PURE__ */ __name((options3) => { + if (!options3) { + return; + } + ["secure", ...siteConfig.secure ?? []].forEach((key) => { + if (Object.hasOwn(options3, key)) { + log.debug(`Denied attempt to modify a secure key ${key}`, options3[key]); + delete options3[key]; + } + }); + Object.keys(options3).forEach((key) => { + if (key.startsWith("__")) { + delete options3[key]; + } + }); + Object.keys(options3).forEach((key) => { + if (typeof options3[key] === "string" && (options3[key].includes("<") || options3[key].includes(">") || options3[key].includes("url(data:"))) { + delete options3[key]; + } + if (typeof options3[key] === "object") { + sanitize(options3[key]); + } + }); + }, "sanitize"); + addDirective = /* @__PURE__ */ __name((directive) => { + sanitizeDirective(directive); + if (directive.fontFamily && !directive.themeVariables?.fontFamily) { + directive.themeVariables = { + ...directive.themeVariables, + fontFamily: directive.fontFamily + }; + } + directives.push(directive); + updateCurrentConfig(siteConfig, directives); + }, "addDirective"); + reset = /* @__PURE__ */ __name((config6 = siteConfig) => { + directives = []; + updateCurrentConfig(config6, directives); + }, "reset"); + ConfigWarning = { + LAZY_LOAD_DEPRECATED: "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead." + }; + issuedWarnings = {}; + issueWarning = /* @__PURE__ */ __name((warning) => { + if (issuedWarnings[warning]) { + return; + } + log.warn(ConfigWarning[warning]); + issuedWarnings[warning] = true; + }, "issueWarning"); + checkConfig = /* @__PURE__ */ __name((config6) => { + if (!config6) { + return; + } + if (config6.lazyLoadedDiagrams || config6.loadExternalDiagramsAtStartup) { + issueWarning("LAZY_LOAD_DEPRECATED"); + } + }, "checkConfig"); } - return this.each((value2 == null ? fullname.local ? attrRemoveNS$1 : attrRemove$1 : typeof value2 === "function" ? fullname.local ? attrFunctionNS$1 : attrFunction$1 : fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, value2)); - } - function defaultView(node2) { - return node2.ownerDocument && node2.ownerDocument.defaultView || node2.document && node2 || node2.defaultView; - } - function styleRemove$1(name) { - return function() { - this.style.removeProperty(name); - }; - } - function styleConstant$1(name, value2, priority) { - return function() { - this.style.setProperty(name, value2, priority); - }; - } - function styleFunction$1(name, value2, priority) { - return function() { - var v = value2.apply(this, arguments); - if (v == null) - this.style.removeProperty(name); - else - this.style.setProperty(name, v, priority); - }; - } - function selection_style(name, value2, priority) { - return arguments.length > 1 ? this.each((value2 == null ? styleRemove$1 : typeof value2 === "function" ? styleFunction$1 : styleConstant$1)(name, value2, priority == null ? "" : priority)) : styleValue(this.node(), name); - } - function styleValue(node2, name) { - return node2.style.getPropertyValue(name) || defaultView(node2).getComputedStyle(node2, null).getPropertyValue(name); - } - function propertyRemove(name) { - return function() { - delete this[name]; - }; - } - function propertyConstant(name, value2) { - return function() { - this[name] = value2; - }; - } - function propertyFunction(name, value2) { - return function() { - var v = value2.apply(this, arguments); - if (v == null) - delete this[name]; - else - this[name] = v; - }; - } - function selection_property(name, value2) { - return arguments.length > 1 ? this.each((value2 == null ? propertyRemove : typeof value2 === "function" ? propertyFunction : propertyConstant)(name, value2)) : this.node()[name]; - } - function classArray(string2) { - return string2.trim().split(/^|\s+/); - } - function classList(node2) { - return node2.classList || new ClassList(node2); + }); + + // ../../node_modules/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.js + var require_purify = __commonJS({ + "../../node_modules/.pnpm/dompurify@3.1.6/node_modules/dompurify/dist/purify.js"(exports2, module2) { + "use strict"; + (function(global2, factory) { + typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.DOMPurify = factory()); + })(exports2, function() { + "use strict"; + const { + entries, + setPrototypeOf, + isFrozen, + getPrototypeOf, + getOwnPropertyDescriptor + } = Object; + let { + freeze, + seal, + create: create2 + } = Object; + let { + apply: apply4, + construct + } = typeof Reflect !== "undefined" && Reflect; + if (!freeze) { + freeze = /* @__PURE__ */ __name(function freeze2(x5) { + return x5; + }, "freeze"); + } + if (!seal) { + seal = /* @__PURE__ */ __name(function seal2(x5) { + return x5; + }, "seal"); + } + if (!apply4) { + apply4 = /* @__PURE__ */ __name(function apply5(fun, thisValue, args) { + return fun.apply(thisValue, args); + }, "apply"); + } + if (!construct) { + construct = /* @__PURE__ */ __name(function construct2(Func, args) { + return new Func(...args); + }, "construct"); + } + const arrayForEach = unapply(Array.prototype.forEach); + const arrayPop = unapply(Array.prototype.pop); + const arrayPush2 = unapply(Array.prototype.push); + const stringToLowerCase = unapply(String.prototype.toLowerCase); + const stringToString = unapply(String.prototype.toString); + const stringMatch = unapply(String.prototype.match); + const stringReplace = unapply(String.prototype.replace); + const stringIndexOf = unapply(String.prototype.indexOf); + const stringTrim = unapply(String.prototype.trim); + const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); + const regExpTest = unapply(RegExp.prototype.test); + const typeErrorCreate = unconstruct(TypeError); + function unapply(func) { + return function(thisArg) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return apply4(func, thisArg, args); + }; + } + __name(unapply, "unapply"); + function unconstruct(func) { + return function() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return construct(func, args); + }; + } + __name(unconstruct, "unconstruct"); + function addToSet(set6, array4) { + let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase; + if (setPrototypeOf) { + setPrototypeOf(set6, null); + } + let l2 = array4.length; + while (l2--) { + let element3 = array4[l2]; + if (typeof element3 === "string") { + const lcElement = transformCaseFunc(element3); + if (lcElement !== element3) { + if (!isFrozen(array4)) { + array4[l2] = lcElement; + } + element3 = lcElement; + } + } + set6[element3] = true; + } + return set6; + } + __name(addToSet, "addToSet"); + function cleanArray(array4) { + for (let index = 0; index < array4.length; index++) { + const isPropertyExist = objectHasOwnProperty(array4, index); + if (!isPropertyExist) { + array4[index] = null; + } + } + return array4; + } + __name(cleanArray, "cleanArray"); + function clone5(object3) { + const newObject = create2(null); + for (const [property2, value2] of entries(object3)) { + const isPropertyExist = objectHasOwnProperty(object3, property2); + if (isPropertyExist) { + if (Array.isArray(value2)) { + newObject[property2] = cleanArray(value2); + } else if (value2 && typeof value2 === "object" && value2.constructor === Object) { + newObject[property2] = clone5(value2); + } else { + newObject[property2] = value2; + } + } + } + return newObject; + } + __name(clone5, "clone"); + function lookupGetter(object3, prop) { + while (object3 !== null) { + const desc = getOwnPropertyDescriptor(object3, prop); + if (desc) { + if (desc.get) { + return unapply(desc.get); + } + if (typeof desc.value === "function") { + return unapply(desc.value); + } + } + object3 = getPrototypeOf(object3); + } + function fallbackValue() { + return null; + } + __name(fallbackValue, "fallbackValue"); + return fallbackValue; + } + __name(lookupGetter, "lookupGetter"); + const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]); + const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]); + const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]); + const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]); + const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]); + const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]); + const text2 = freeze(["#text"]); + const html2 = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]); + const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]); + const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]); + const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]); + const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); + const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); + const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm); + const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); + const ARIA_ATTR = seal(/^aria-[\-\w]+$/); + const IS_ALLOWED_URI = seal( + /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i + // eslint-disable-line no-useless-escape + ); + const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); + const ATTR_WHITESPACE = seal( + /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g + // eslint-disable-line no-control-regex + ); + const DOCTYPE_NAME = seal(/^html$/i); + const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); + var EXPRESSIONS = /* @__PURE__ */ Object.freeze({ + __proto__: null, + MUSTACHE_EXPR, + ERB_EXPR, + TMPLIT_EXPR, + DATA_ATTR, + ARIA_ATTR, + IS_ALLOWED_URI, + IS_SCRIPT_OR_DATA, + ATTR_WHITESPACE, + DOCTYPE_NAME, + CUSTOM_ELEMENT + }); + const NODE_TYPE = { + element: 1, + attribute: 2, + text: 3, + cdataSection: 4, + entityReference: 5, + // Deprecated + entityNode: 6, + // Deprecated + progressingInstruction: 7, + comment: 8, + document: 9, + documentType: 10, + documentFragment: 11, + notation: 12 + // Deprecated + }; + const getGlobal = /* @__PURE__ */ __name(function getGlobal2() { + return typeof window === "undefined" ? null : window; + }, "getGlobal"); + const _createTrustedTypesPolicy = /* @__PURE__ */ __name(function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) { + if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") { + return null; + } + let suffix = null; + const ATTR_NAME = "data-tt-policy-suffix"; + if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { + suffix = purifyHostElement.getAttribute(ATTR_NAME); + } + const policyName = "dompurify" + (suffix ? "#" + suffix : ""); + try { + return trustedTypes.createPolicy(policyName, { + createHTML(html3) { + return html3; + }, + createScriptURL(scriptUrl) { + return scriptUrl; + } + }); + } catch (_2) { + console.warn("TrustedTypes policy " + policyName + " could not be created."); + return null; + } + }, "_createTrustedTypesPolicy"); + function createDOMPurify() { + let window3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(); + const DOMPurify3 = /* @__PURE__ */ __name((root4) => createDOMPurify(root4), "DOMPurify"); + DOMPurify3.version = "3.1.6"; + DOMPurify3.removed = []; + if (!window3 || !window3.document || window3.document.nodeType !== NODE_TYPE.document) { + DOMPurify3.isSupported = false; + return DOMPurify3; + } + let { + document: document2 + } = window3; + const originalDocument = document2; + const currentScript = originalDocument.currentScript; + const { + DocumentFragment: DocumentFragment2, + HTMLTemplateElement, + Node, + Element: Element3, + NodeFilter, + NamedNodeMap = window3.NamedNodeMap || window3.MozNamedAttrMap, + HTMLFormElement, + DOMParser, + trustedTypes + } = window3; + const ElementPrototype = Element3.prototype; + const cloneNode = lookupGetter(ElementPrototype, "cloneNode"); + const remove3 = lookupGetter(ElementPrototype, "remove"); + const getNextSibling = lookupGetter(ElementPrototype, "nextSibling"); + const getChildNodes = lookupGetter(ElementPrototype, "childNodes"); + const getParentNode = lookupGetter(ElementPrototype, "parentNode"); + if (typeof HTMLTemplateElement === "function") { + const template = document2.createElement("template"); + if (template.content && template.content.ownerDocument) { + document2 = template.content.ownerDocument; + } + } + let trustedTypesPolicy; + let emptyHTML = ""; + const { + implementation, + createNodeIterator, + createDocumentFragment, + getElementsByTagName + } = document2; + const { + importNode + } = originalDocument; + let hooks = {}; + DOMPurify3.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0; + const { + MUSTACHE_EXPR: MUSTACHE_EXPR2, + ERB_EXPR: ERB_EXPR2, + TMPLIT_EXPR: TMPLIT_EXPR2, + DATA_ATTR: DATA_ATTR2, + ARIA_ATTR: ARIA_ATTR2, + IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2, + ATTR_WHITESPACE: ATTR_WHITESPACE2, + CUSTOM_ELEMENT: CUSTOM_ELEMENT2 + } = EXPRESSIONS; + let { + IS_ALLOWED_URI: IS_ALLOWED_URI$1 + } = EXPRESSIONS; + let ALLOWED_TAGS = null; + const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text2]); + let ALLOWED_ATTR = null; + const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html2, ...svg, ...mathMl, ...xml]); + let CUSTOM_ELEMENT_HANDLING = Object.seal(create2(null, { + tagNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + attributeNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + allowCustomizedBuiltInElements: { + writable: true, + configurable: false, + enumerable: true, + value: false + } + })); + let FORBID_TAGS = null; + let FORBID_ATTR = null; + let ALLOW_ARIA_ATTR = true; + let ALLOW_DATA_ATTR = true; + let ALLOW_UNKNOWN_PROTOCOLS = false; + let ALLOW_SELF_CLOSE_IN_ATTR = true; + let SAFE_FOR_TEMPLATES = false; + let SAFE_FOR_XML = true; + let WHOLE_DOCUMENT = false; + let SET_CONFIG = false; + let FORCE_BODY = false; + let RETURN_DOM = false; + let RETURN_DOM_FRAGMENT = false; + let RETURN_TRUSTED_TYPE = false; + let SANITIZE_DOM = true; + let SANITIZE_NAMED_PROPS = false; + const SANITIZE_NAMED_PROPS_PREFIX = "user-content-"; + let KEEP_CONTENT = true; + let IN_PLACE = false; + let USE_PROFILES = {}; + let FORBID_CONTENTS = null; + const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); + let DATA_URI_TAGS = null; + const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); + let URI_SAFE_ATTRIBUTES = null; + const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]); + const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; + const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; + const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; + let NAMESPACE = HTML_NAMESPACE; + let IS_EMPTY_INPUT = false; + let ALLOWED_NAMESPACES = null; + const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); + let PARSER_MEDIA_TYPE = null; + const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; + const DEFAULT_PARSER_MEDIA_TYPE = "text/html"; + let transformCaseFunc = null; + let CONFIG = null; + const formElement = document2.createElement("form"); + const isRegexOrFunction = /* @__PURE__ */ __name(function isRegexOrFunction2(testValue) { + return testValue instanceof RegExp || testValue instanceof Function; + }, "isRegexOrFunction"); + const _parseConfig = /* @__PURE__ */ __name(function _parseConfig2() { + let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + if (CONFIG && CONFIG === cfg) { + return; + } + if (!cfg || typeof cfg !== "object") { + cfg = {}; + } + cfg = clone5(cfg); + PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes + SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; + transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; + ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; + ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; + ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; + URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet( + clone5(DEFAULT_URI_SAFE_ATTRIBUTES), + // eslint-disable-line indent + cfg.ADD_URI_SAFE_ATTR, + // eslint-disable-line indent + transformCaseFunc + // eslint-disable-line indent + ) : DEFAULT_URI_SAFE_ATTRIBUTES; + DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet( + clone5(DEFAULT_DATA_URI_TAGS), + // eslint-disable-line indent + cfg.ADD_DATA_URI_TAGS, + // eslint-disable-line indent + transformCaseFunc + // eslint-disable-line indent + ) : DEFAULT_DATA_URI_TAGS; + FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; + FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {}; + FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {}; + USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false; + ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; + ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; + ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; + ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; + SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; + SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; + WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; + RETURN_DOM = cfg.RETURN_DOM || false; + RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; + RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; + FORCE_BODY = cfg.FORCE_BODY || false; + SANITIZE_DOM = cfg.SANITIZE_DOM !== false; + SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; + KEEP_CONTENT = cfg.KEEP_CONTENT !== false; + IN_PLACE = cfg.IN_PLACE || false; + IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; + NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; + CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { + CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { + CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") { + CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; + } + if (SAFE_FOR_TEMPLATES) { + ALLOW_DATA_ATTR = false; + } + if (RETURN_DOM_FRAGMENT) { + RETURN_DOM = true; + } + if (USE_PROFILES) { + ALLOWED_TAGS = addToSet({}, text2); + ALLOWED_ATTR = []; + if (USE_PROFILES.html === true) { + addToSet(ALLOWED_TAGS, html$1); + addToSet(ALLOWED_ATTR, html2); + } + if (USE_PROFILES.svg === true) { + addToSet(ALLOWED_TAGS, svg$1); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.svgFilters === true) { + addToSet(ALLOWED_TAGS, svgFilters); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.mathMl === true) { + addToSet(ALLOWED_TAGS, mathMl$1); + addToSet(ALLOWED_ATTR, mathMl); + addToSet(ALLOWED_ATTR, xml); + } + } + if (cfg.ADD_TAGS) { + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { + ALLOWED_TAGS = clone5(ALLOWED_TAGS); + } + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); + } + if (cfg.ADD_ATTR) { + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { + ALLOWED_ATTR = clone5(ALLOWED_ATTR); + } + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); + } + if (cfg.ADD_URI_SAFE_ATTR) { + addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); + } + if (cfg.FORBID_CONTENTS) { + if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { + FORBID_CONTENTS = clone5(FORBID_CONTENTS); + } + addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); + } + if (KEEP_CONTENT) { + ALLOWED_TAGS["#text"] = true; + } + if (WHOLE_DOCUMENT) { + addToSet(ALLOWED_TAGS, ["html", "head", "body"]); + } + if (ALLOWED_TAGS.table) { + addToSet(ALLOWED_TAGS, ["tbody"]); + delete FORBID_TAGS.tbody; + } + if (cfg.TRUSTED_TYPES_POLICY) { + if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + } + if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + } + trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; + emptyHTML = trustedTypesPolicy.createHTML(""); + } else { + if (trustedTypesPolicy === void 0) { + trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); + } + if (trustedTypesPolicy !== null && typeof emptyHTML === "string") { + emptyHTML = trustedTypesPolicy.createHTML(""); + } + } + if (freeze) { + freeze(cfg); + } + CONFIG = cfg; + }, "_parseConfig"); + const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]); + const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "annotation-xml"]); + const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]); + const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); + const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); + const _checkValidNamespace = /* @__PURE__ */ __name(function _checkValidNamespace2(element3) { + let parent4 = getParentNode(element3); + if (!parent4 || !parent4.tagName) { + parent4 = { + namespaceURI: NAMESPACE, + tagName: "template" + }; + } + const tagName = stringToLowerCase(element3.tagName); + const parentTagName = stringToLowerCase(parent4.tagName); + if (!ALLOWED_NAMESPACES[element3.namespaceURI]) { + return false; + } + if (element3.namespaceURI === SVG_NAMESPACE) { + if (parent4.namespaceURI === HTML_NAMESPACE) { + return tagName === "svg"; + } + if (parent4.namespaceURI === MATHML_NAMESPACE) { + return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); + } + return Boolean(ALL_SVG_TAGS[tagName]); + } + if (element3.namespaceURI === MATHML_NAMESPACE) { + if (parent4.namespaceURI === HTML_NAMESPACE) { + return tagName === "math"; + } + if (parent4.namespaceURI === SVG_NAMESPACE) { + return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; + } + return Boolean(ALL_MATHML_TAGS[tagName]); + } + if (element3.namespaceURI === HTML_NAMESPACE) { + if (parent4.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { + return false; + } + if (parent4.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { + return false; + } + return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); + } + if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element3.namespaceURI]) { + return true; + } + return false; + }, "_checkValidNamespace"); + const _forceRemove = /* @__PURE__ */ __name(function _forceRemove2(node2) { + arrayPush2(DOMPurify3.removed, { + element: node2 + }); + try { + getParentNode(node2).removeChild(node2); + } catch (_2) { + remove3(node2); + } + }, "_forceRemove"); + const _removeAttribute = /* @__PURE__ */ __name(function _removeAttribute2(name, node2) { + try { + arrayPush2(DOMPurify3.removed, { + attribute: node2.getAttributeNode(name), + from: node2 + }); + } catch (_2) { + arrayPush2(DOMPurify3.removed, { + attribute: null, + from: node2 + }); + } + node2.removeAttribute(name); + if (name === "is" && !ALLOWED_ATTR[name]) { + if (RETURN_DOM || RETURN_DOM_FRAGMENT) { + try { + _forceRemove(node2); + } catch (_2) { + } + } else { + try { + node2.setAttribute(name, ""); + } catch (_2) { + } + } + } + }, "_removeAttribute"); + const _initDocument = /* @__PURE__ */ __name(function _initDocument2(dirty) { + let doc = null; + let leadingWhitespace = null; + if (FORCE_BODY) { + dirty = "" + dirty; + } else { + const matches33 = stringMatch(dirty, /^[\r\n\t ]+/); + leadingWhitespace = matches33 && matches33[0]; + } + if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) { + dirty = '' + dirty + ""; + } + const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; + if (NAMESPACE === HTML_NAMESPACE) { + try { + doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); + } catch (_2) { + } + } + if (!doc || !doc.documentElement) { + doc = implementation.createDocument(NAMESPACE, "template", null); + try { + doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; + } catch (_2) { + } + } + const body = doc.body || doc.documentElement; + if (dirty && leadingWhitespace) { + body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null); + } + if (NAMESPACE === HTML_NAMESPACE) { + return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0]; + } + return WHOLE_DOCUMENT ? doc.documentElement : body; + }, "_initDocument"); + const _createNodeIterator = /* @__PURE__ */ __name(function _createNodeIterator2(root4) { + return createNodeIterator.call( + root4.ownerDocument || root4, + root4, + // eslint-disable-next-line no-bitwise + NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, + null + ); + }, "_createNodeIterator"); + const _isClobbered = /* @__PURE__ */ __name(function _isClobbered2(elm) { + return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function"); + }, "_isClobbered"); + const _isNode = /* @__PURE__ */ __name(function _isNode2(object3) { + return typeof Node === "function" && object3 instanceof Node; + }, "_isNode"); + const _executeHook = /* @__PURE__ */ __name(function _executeHook2(entryPoint, currentNode, data5) { + if (!hooks[entryPoint]) { + return; + } + arrayForEach(hooks[entryPoint], (hook2) => { + hook2.call(DOMPurify3, currentNode, data5, CONFIG); + }); + }, "_executeHook"); + const _sanitizeElements = /* @__PURE__ */ __name(function _sanitizeElements2(currentNode) { + let content = null; + _executeHook("beforeSanitizeElements", currentNode, null); + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + return true; + } + const tagName = transformCaseFunc(currentNode.nodeName); + _executeHook("uponSanitizeElement", currentNode, { + tagName, + allowedTags: ALLOWED_TAGS + }); + if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) { + _forceRemove(currentNode); + return true; + } + if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { + _forceRemove(currentNode); + return true; + } + if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { + _forceRemove(currentNode); + return true; + } + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { + return false; + } + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { + return false; + } + } + if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { + const parentNode = getParentNode(currentNode) || currentNode.parentNode; + const childNodes = getChildNodes(currentNode) || currentNode.childNodes; + if (childNodes && parentNode) { + const childCount = childNodes.length; + for (let i2 = childCount - 1; i2 >= 0; --i2) { + const childClone = cloneNode(childNodes[i2], true); + childClone.__removalCount = (currentNode.__removalCount || 0) + 1; + parentNode.insertBefore(childClone, getNextSibling(currentNode)); + } + } + } + _forceRemove(currentNode); + return true; + } + if (currentNode instanceof Element3 && !_checkValidNamespace(currentNode)) { + _forceRemove(currentNode); + return true; + } + if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { + _forceRemove(currentNode); + return true; + } + if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { + content = currentNode.textContent; + arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { + content = stringReplace(content, expr, " "); + }); + if (currentNode.textContent !== content) { + arrayPush2(DOMPurify3.removed, { + element: currentNode.cloneNode() + }); + currentNode.textContent = content; + } + } + _executeHook("afterSanitizeElements", currentNode, null); + return false; + }, "_sanitizeElements"); + const _isValidAttribute = /* @__PURE__ */ __name(function _isValidAttribute2(lcTag, lcName, value2) { + if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value2 in document2 || value2 in formElement)) { + return false; + } + if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName)) ; + else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName)) ; + else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { + if ( + // First condition does a very basic check if a) it's basically a valid custom element tagname AND + // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck + _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND + // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value2) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value2)) + ) ; + else { + return false; + } + } else if (URI_SAFE_ATTRIBUTES[lcName]) ; + else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value2, ATTR_WHITESPACE2, ""))) ; + else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value2, "data:") === 0 && DATA_URI_TAGS[lcTag]) ; + else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value2, ATTR_WHITESPACE2, ""))) ; + else if (value2) { + return false; + } else ; + return true; + }, "_isValidAttribute"); + const _isBasicCustomElement = /* @__PURE__ */ __name(function _isBasicCustomElement2(tagName) { + return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2); + }, "_isBasicCustomElement"); + const _sanitizeAttributes = /* @__PURE__ */ __name(function _sanitizeAttributes2(currentNode) { + _executeHook("beforeSanitizeAttributes", currentNode, null); + const { + attributes + } = currentNode; + if (!attributes) { + return; + } + const hookEvent = { + attrName: "", + attrValue: "", + keepAttr: true, + allowedAttributes: ALLOWED_ATTR + }; + let l2 = attributes.length; + while (l2--) { + const attr = attributes[l2]; + const { + name, + namespaceURI, + value: attrValue + } = attr; + const lcName = transformCaseFunc(name); + let value2 = name === "value" ? attrValue : stringTrim(attrValue); + hookEvent.attrName = lcName; + hookEvent.attrValue = value2; + hookEvent.keepAttr = true; + hookEvent.forceKeepAttr = void 0; + _executeHook("uponSanitizeAttribute", currentNode, hookEvent); + value2 = hookEvent.attrValue; + if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value2)) { + _removeAttribute(name, currentNode); + continue; + } + if (hookEvent.forceKeepAttr) { + continue; + } + _removeAttribute(name, currentNode); + if (!hookEvent.keepAttr) { + continue; + } + if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value2)) { + _removeAttribute(name, currentNode); + continue; + } + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { + value2 = stringReplace(value2, expr, " "); + }); + } + const lcTag = transformCaseFunc(currentNode.nodeName); + if (!_isValidAttribute(lcTag, lcName, value2)) { + continue; + } + if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) { + _removeAttribute(name, currentNode); + value2 = SANITIZE_NAMED_PROPS_PREFIX + value2; + } + if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") { + if (namespaceURI) ; + else { + switch (trustedTypes.getAttributeType(lcTag, lcName)) { + case "TrustedHTML": { + value2 = trustedTypesPolicy.createHTML(value2); + break; + } + case "TrustedScriptURL": { + value2 = trustedTypesPolicy.createScriptURL(value2); + break; + } + } + } + } + try { + if (namespaceURI) { + currentNode.setAttributeNS(namespaceURI, name, value2); + } else { + currentNode.setAttribute(name, value2); + } + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + } else { + arrayPop(DOMPurify3.removed); + } + } catch (_2) { + } + } + _executeHook("afterSanitizeAttributes", currentNode, null); + }, "_sanitizeAttributes"); + const _sanitizeShadowDOM = /* @__PURE__ */ __name(function _sanitizeShadowDOM2(fragment) { + let shadowNode = null; + const shadowIterator = _createNodeIterator(fragment); + _executeHook("beforeSanitizeShadowDOM", fragment, null); + while (shadowNode = shadowIterator.nextNode()) { + _executeHook("uponSanitizeShadowNode", shadowNode, null); + if (_sanitizeElements(shadowNode)) { + continue; + } + if (shadowNode.content instanceof DocumentFragment2) { + _sanitizeShadowDOM2(shadowNode.content); + } + _sanitizeAttributes(shadowNode); + } + _executeHook("afterSanitizeShadowDOM", fragment, null); + }, "_sanitizeShadowDOM"); + DOMPurify3.sanitize = function(dirty) { + let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + let body = null; + let importedNode = null; + let currentNode = null; + let returnNode = null; + IS_EMPTY_INPUT = !dirty; + if (IS_EMPTY_INPUT) { + dirty = ""; + } + if (typeof dirty !== "string" && !_isNode(dirty)) { + if (typeof dirty.toString === "function") { + dirty = dirty.toString(); + if (typeof dirty !== "string") { + throw typeErrorCreate("dirty is not a string, aborting"); + } + } else { + throw typeErrorCreate("toString is not a function"); + } + } + if (!DOMPurify3.isSupported) { + return dirty; + } + if (!SET_CONFIG) { + _parseConfig(cfg); + } + DOMPurify3.removed = []; + if (typeof dirty === "string") { + IN_PLACE = false; + } + if (IN_PLACE) { + if (dirty.nodeName) { + const tagName = transformCaseFunc(dirty.nodeName); + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place"); + } + } + } else if (dirty instanceof Node) { + body = _initDocument(""); + importedNode = body.ownerDocument.importNode(dirty, true); + if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") { + body = importedNode; + } else if (importedNode.nodeName === "HTML") { + body = importedNode; + } else { + body.appendChild(importedNode); + } + } else { + if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes + dirty.indexOf("<") === -1) { + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; + } + body = _initDocument(dirty); + if (!body) { + return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ""; + } + } + if (body && FORCE_BODY) { + _forceRemove(body.firstChild); + } + const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); + while (currentNode = nodeIterator.nextNode()) { + if (_sanitizeElements(currentNode)) { + continue; + } + if (currentNode.content instanceof DocumentFragment2) { + _sanitizeShadowDOM(currentNode.content); + } + _sanitizeAttributes(currentNode); + } + if (IN_PLACE) { + return dirty; + } + if (RETURN_DOM) { + if (RETURN_DOM_FRAGMENT) { + returnNode = createDocumentFragment.call(body.ownerDocument); + while (body.firstChild) { + returnNode.appendChild(body.firstChild); + } + } else { + returnNode = body; + } + if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { + returnNode = importNode.call(originalDocument, returnNode, true); + } + return returnNode; + } + let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; + if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { + serializedHTML = "\n" + serializedHTML; + } + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { + serializedHTML = stringReplace(serializedHTML, expr, " "); + }); + } + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; + }; + DOMPurify3.setConfig = function() { + let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + _parseConfig(cfg); + SET_CONFIG = true; + }; + DOMPurify3.clearConfig = function() { + CONFIG = null; + SET_CONFIG = false; + }; + DOMPurify3.isValidAttribute = function(tag2, attr, value2) { + if (!CONFIG) { + _parseConfig({}); + } + const lcTag = transformCaseFunc(tag2); + const lcName = transformCaseFunc(attr); + return _isValidAttribute(lcTag, lcName, value2); + }; + DOMPurify3.addHook = function(entryPoint, hookFunction) { + if (typeof hookFunction !== "function") { + return; + } + hooks[entryPoint] = hooks[entryPoint] || []; + arrayPush2(hooks[entryPoint], hookFunction); + }; + DOMPurify3.removeHook = function(entryPoint) { + if (hooks[entryPoint]) { + return arrayPop(hooks[entryPoint]); + } + }; + DOMPurify3.removeHooks = function(entryPoint) { + if (hooks[entryPoint]) { + hooks[entryPoint] = []; + } + }; + DOMPurify3.removeAllHooks = function() { + hooks = {}; + }; + return DOMPurify3; + } + __name(createDOMPurify, "createDOMPurify"); + var purify = createDOMPurify(); + return purify; + }); + } + }); + + // ../../node_modules/.pnpm/katex@0.16.11/node_modules/katex/dist/katex.mjs + var katex_exports = {}; + __export(katex_exports, { + default: () => katex + }); + function escape2(text2) { + return String(text2).replace(ESCAPE_REGEX, (match2) => ESCAPE_LOOKUP[match2]); } - function ClassList(node2) { - this._node = node2; - this._names = classArray(node2.getAttribute("class") || ""); + function getDefaultValue(schema2) { + if (schema2.default) { + return schema2.default; + } + var type3 = schema2.type; + var defaultType = Array.isArray(type3) ? type3[0] : type3; + if (typeof defaultType !== "string") { + return defaultType.enum[0]; + } + switch (defaultType) { + case "boolean": + return false; + case "string": + return ""; + case "number": + return 0; + case "object": + return {}; + } } - ClassList.prototype = { - add: function(name) { - var i2 = this._names.indexOf(name); - if (i2 < 0) { - this._names.push(name); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name) { - var i2 = this._names.indexOf(name); - if (i2 >= 0) { - this._names.splice(i2, 1); - this._node.setAttribute("class", this._names.join(" ")); + function scriptFromCodepoint(codepoint) { + for (var i2 = 0; i2 < scriptData.length; i2++) { + var script = scriptData[i2]; + for (var _i = 0; _i < script.blocks.length; _i++) { + var block3 = script.blocks[_i]; + if (codepoint >= block3[0] && codepoint <= block3[1]) { + return script.name; + } } - }, - contains: function(name) { - return this._names.indexOf(name) >= 0; } - }; - function classedAdd(node2, names) { - var list2 = classList(node2), i2 = -1, n = names.length; - while (++i2 < n) - list2.add(names[i2]); - } - function classedRemove(node2, names) { - var list2 = classList(node2), i2 = -1, n = names.length; - while (++i2 < n) - list2.remove(names[i2]); - } - function classedTrue(names) { - return function() { - classedAdd(this, names); - }; - } - function classedFalse(names) { - return function() { - classedRemove(this, names); - }; - } - function classedFunction(names, value2) { - return function() { - (value2.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; + return null; } - function selection_classed(name, value2) { - var names = classArray(name + ""); - if (arguments.length < 2) { - var list2 = classList(this.node()), i2 = -1, n = names.length; - while (++i2 < n) - if (!list2.contains(names[i2])) - return false; - return true; + function supportedCodepoint(codepoint) { + for (var i2 = 0; i2 < allBlocks.length; i2 += 2) { + if (codepoint >= allBlocks[i2] && codepoint <= allBlocks[i2 + 1]) { + return true; + } } - return this.each((typeof value2 === "function" ? classedFunction : value2 ? classedTrue : classedFalse)(names, value2)); - } - function textRemove() { - this.textContent = ""; + return false; } - function textConstant$1(value2) { - return function() { - this.textContent = value2; - }; + function setFontMetrics(fontName, metrics) { + fontMetricsData[fontName] = metrics; } - function textFunction$1(value2) { - return function() { - var v = value2.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; + function getCharacterMetrics(character2, font, mode) { + if (!fontMetricsData[font]) { + throw new Error("Font metrics not found for font: " + font + "."); + } + var ch = character2.charCodeAt(0); + var metrics = fontMetricsData[font][ch]; + if (!metrics && character2[0] in extraCharacterMap) { + ch = extraCharacterMap[character2[0]].charCodeAt(0); + metrics = fontMetricsData[font][ch]; + } + if (!metrics && mode === "text") { + if (supportedCodepoint(ch)) { + metrics = fontMetricsData[font][77]; + } + } + if (metrics) { + return { + depth: metrics[0], + height: metrics[1], + italic: metrics[2], + skew: metrics[3], + width: metrics[4] + }; + } } - function selection_text(value2) { - return arguments.length ? this.each(value2 == null ? textRemove : (typeof value2 === "function" ? textFunction$1 : textConstant$1)(value2)) : this.node().textContent; + function getGlobalMetrics(size5) { + var sizeIndex; + if (size5 >= 5) { + sizeIndex = 0; + } else if (size5 >= 3) { + sizeIndex = 1; + } else { + sizeIndex = 2; + } + if (!fontMetricsBySizeIndex[sizeIndex]) { + var metrics = fontMetricsBySizeIndex[sizeIndex] = { + cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18 + }; + for (var key in sigmasAndXis) { + if (sigmasAndXis.hasOwnProperty(key)) { + metrics[key] = sigmasAndXis[key][sizeIndex]; + } + } + } + return fontMetricsBySizeIndex[sizeIndex]; } - function htmlRemove() { - this.innerHTML = ""; + function assertSymbolDomNode(group2) { + if (group2 instanceof SymbolNode) { + return group2; + } else { + throw new Error("Expected symbolNode but got " + String(group2) + "."); + } } - function htmlConstant(value2) { - return function() { - this.innerHTML = value2; - }; + function assertSpan(group2) { + if (group2 instanceof Span) { + return group2; + } else { + throw new Error("Expected span but got " + String(group2) + "."); + } } - function htmlFunction(value2) { - return function() { - var v = value2.apply(this, arguments); - this.innerHTML = v == null ? "" : v; + function defineSymbol(mode, font, group2, replace2, name, acceptUnicodeChar) { + symbols[mode][name] = { + font, + group: group2, + replace: replace2 }; + if (acceptUnicodeChar && replace2) { + symbols[mode][replace2] = symbols[mode][name]; + } } - function selection_html(value2) { - return arguments.length ? this.each(value2 == null ? htmlRemove : (typeof value2 === "function" ? htmlFunction : htmlConstant)(value2)) : this.node().innerHTML; - } - function raise() { - if (this.nextSibling) - this.parentNode.appendChild(this); - } - function selection_raise() { - return this.each(raise); - } - function lower() { - if (this.previousSibling) - this.parentNode.insertBefore(this, this.parentNode.firstChild); - } - function selection_lower() { - return this.each(lower); - } - function selection_append(name) { - var create2 = typeof name === "function" ? name : creator(name); - return this.select(function() { - return this.appendChild(create2.apply(this, arguments)); - }); - } - function constantNull() { - return null; - } - function selection_insert(name, before) { - var create2 = typeof name === "function" ? name : creator(name), select = before == null ? constantNull : typeof before === "function" ? before : selector(before); - return this.select(function() { - return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null); - }); - } - function remove() { - var parent = this.parentNode; - if (parent) - parent.removeChild(this); - } - function selection_remove() { - return this.each(remove); - } - function selection_cloneShallow() { - var clone2 = this.cloneNode(false), parent = this.parentNode; - return parent ? parent.insertBefore(clone2, this.nextSibling) : clone2; - } - function selection_cloneDeep() { - var clone2 = this.cloneNode(true), parent = this.parentNode; - return parent ? parent.insertBefore(clone2, this.nextSibling) : clone2; - } - function selection_clone(deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); - } - function selection_datum(value2) { - return arguments.length ? this.property("__data__", value2) : this.node().__data__; - } - function contextListener(listener) { - return function(event) { - listener.call(this, event, this.__data__); + function defineFunction(_ref) { + var { + type: type3, + names, + props, + handler, + htmlBuilder: htmlBuilder3, + mathmlBuilder: mathmlBuilder3 + } = _ref; + var data5 = { + type: type3, + numArgs: props.numArgs, + argTypes: props.argTypes, + allowedInArgument: !!props.allowedInArgument, + allowedInText: !!props.allowedInText, + allowedInMath: props.allowedInMath === void 0 ? true : props.allowedInMath, + numOptionalArgs: props.numOptionalArgs || 0, + infix: !!props.infix, + primitive: !!props.primitive, + handler }; + for (var i2 = 0; i2 < names.length; ++i2) { + _functions[names[i2]] = data5; + } + if (type3) { + if (htmlBuilder3) { + _htmlGroupBuilders[type3] = htmlBuilder3; + } + if (mathmlBuilder3) { + _mathmlGroupBuilders[type3] = mathmlBuilder3; + } + } } - function parseTypenames(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i2 = t.indexOf("."); - if (i2 >= 0) - name = t.slice(i2 + 1), t = t.slice(0, i2); - return { type: t, name }; + function defineFunctionBuilders(_ref2) { + var { + type: type3, + htmlBuilder: htmlBuilder3, + mathmlBuilder: mathmlBuilder3 + } = _ref2; + defineFunction({ + type: type3, + names: [], + props: { + numArgs: 0 + }, + handler() { + throw new Error("Should never be called."); + }, + htmlBuilder: htmlBuilder3, + mathmlBuilder: mathmlBuilder3 }); } - function onRemove(typename) { - return function() { - var on = this.__on; - if (!on) - return; - for (var j = 0, i2 = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - } else { - on[++i2] = o; - } - } - if (++i2) - on.length = i2; - else - delete this.__on; - }; + function buildHTMLUnbreakable(children2, options3) { + var body = makeSpan$1(["base"], children2, options3); + var strut = makeSpan$1(["strut"]); + strut.style.height = makeEm(body.height + body.depth); + if (body.depth) { + strut.style.verticalAlign = makeEm(-body.depth); + } + body.children.unshift(strut); + return body; } - function onAdd(typename, value2, options2) { - return function() { - var on = this.__on, o, listener = contextListener(value2); - if (on) - for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - this.addEventListener(o.type, o.listener = listener, o.options = options2); - o.value = value2; - return; + function buildHTML(tree, options3) { + var tag2 = null; + if (tree.length === 1 && tree[0].type === "tag") { + tag2 = tree[0].tag; + tree = tree[0].body; + } + var expression = buildExpression$1(tree, options3, "root"); + var eqnNum; + if (expression.length === 2 && expression[1].hasClass("tag")) { + eqnNum = expression.pop(); + } + var children2 = []; + var parts = []; + for (var i2 = 0; i2 < expression.length; i2++) { + parts.push(expression[i2]); + if (expression[i2].hasClass("mbin") || expression[i2].hasClass("mrel") || expression[i2].hasClass("allowbreak")) { + var nobreak = false; + while (i2 < expression.length - 1 && expression[i2 + 1].hasClass("mspace") && !expression[i2 + 1].hasClass("newline")) { + i2++; + parts.push(expression[i2]); + if (expression[i2].hasClass("nobreak")) { + nobreak = true; } } - this.addEventListener(typename.type, listener, options2); - o = { type: typename.type, name: typename.name, value: value2, listener, options: options2 }; - if (!on) - this.__on = [o]; - else - on.push(o); - }; - } - function selection_on(typename, value2, options2) { - var typenames = parseTypenames(typename + ""), i2, n = typenames.length, t; - if (arguments.length < 2) { - var on = this.node().__on; - if (on) - for (var j = 0, m = on.length, o; j < m; ++j) { - for (i2 = 0, o = on[j]; i2 < n; ++i2) { - if ((t = typenames[i2]).type === o.type && t.name === o.name) { - return o.value; - } - } + if (!nobreak) { + children2.push(buildHTMLUnbreakable(parts, options3)); + parts = []; } - return; + } else if (expression[i2].hasClass("newline")) { + parts.pop(); + if (parts.length > 0) { + children2.push(buildHTMLUnbreakable(parts, options3)); + parts = []; + } + children2.push(expression[i2]); + } } - on = value2 ? onAdd : onRemove; - for (i2 = 0; i2 < n; ++i2) - this.each(on(typenames[i2], value2, options2)); - return this; + if (parts.length > 0) { + children2.push(buildHTMLUnbreakable(parts, options3)); + } + var tagChild; + if (tag2) { + tagChild = buildHTMLUnbreakable(buildExpression$1(tag2, options3, true)); + tagChild.classes = ["tag"]; + children2.push(tagChild); + } else if (eqnNum) { + children2.push(eqnNum); + } + var htmlNode = makeSpan$1(["katex-html"], children2); + htmlNode.setAttribute("aria-hidden", "true"); + if (tagChild) { + var strut = tagChild.children[0]; + strut.style.height = makeEm(htmlNode.height + htmlNode.depth); + if (htmlNode.depth) { + strut.style.verticalAlign = makeEm(-htmlNode.depth); + } + } + return htmlNode; } - function dispatchEvent(node2, type2, params) { - var window2 = defaultView(node2), event = window2.CustomEvent; - if (typeof event === "function") { - event = new event(type2, params); + function newDocumentFragment(children2) { + return new DocumentFragment(children2); + } + function buildMathML(tree, texExpression, options3, isDisplayMode, forMathmlOnly) { + var expression = buildExpression2(tree, options3); + var wrapper; + if (expression.length === 1 && expression[0] instanceof MathNode && utils.contains(["mrow", "mtable"], expression[0].type)) { + wrapper = expression[0]; } else { - event = window2.document.createEvent("Event"); - if (params) - event.initEvent(type2, params.bubbles, params.cancelable), event.detail = params.detail; - else - event.initEvent(type2, false, false); + wrapper = new mathMLTree.MathNode("mrow", expression); } - node2.dispatchEvent(event); - } - function dispatchConstant(type2, params) { - return function() { - return dispatchEvent(this, type2, params); - }; + var annotation = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(texExpression)]); + annotation.setAttribute("encoding", "application/x-tex"); + var semantics = new mathMLTree.MathNode("semantics", [wrapper, annotation]); + var math2 = new mathMLTree.MathNode("math", [semantics]); + math2.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"); + if (isDisplayMode) { + math2.setAttribute("display", "block"); + } + var wrapperClass = forMathmlOnly ? "katex" : "katex-mathml"; + return buildCommon.makeSpan([wrapperClass], [math2]); } - function dispatchFunction(type2, params) { - return function() { - return dispatchEvent(this, type2, params.apply(this, arguments)); - }; + function assertNodeType(node2, type3) { + if (!node2 || node2.type !== type3) { + throw new Error("Expected node of type " + type3 + ", but got " + (node2 ? "node of type " + node2.type : String(node2))); + } + return node2; } - function selection_dispatch(type2, params) { - return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params)); + function assertSymbolNodeType(node2) { + var typedNode = checkSymbolNodeType(node2); + if (!typedNode) { + throw new Error("Expected node of symbol group type, but got " + (node2 ? "node of type " + node2.type : String(node2))); + } + return typedNode; } - function* selection_iterator() { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i2 = 0, n = group.length, node2; i2 < n; ++i2) { - if (node2 = group[i2]) - yield node2; - } + function checkSymbolNodeType(node2) { + if (node2 && (node2.type === "atom" || NON_ATOMS.hasOwnProperty(node2.type))) { + return node2; } + return null; } - var root$2 = [null]; - function Selection$1(groups, parents2) { - this._groups = groups; - this._parents = parents2; - } - function selection() { - return new Selection$1([[document.documentElement]], root$2); - } - function selection_selection() { - return this; - } - Selection$1.prototype = selection.prototype = { - constructor: Selection$1, - select: selection_select, - selectAll: selection_selectAll, - selectChild: selection_selectChild, - selectChildren: selection_selectChildren, - filter: selection_filter, - data: selection_data, - enter: selection_enter, - exit: selection_exit, - join: selection_join, - merge: selection_merge, - selection: selection_selection, - order: selection_order, - sort: selection_sort, - call: selection_call, - nodes: selection_nodes, - node: selection_node, - size: selection_size, - empty: selection_empty, - each: selection_each, - attr: selection_attr, - style: selection_style, - property: selection_property, - classed: selection_classed, - text: selection_text, - html: selection_html, - raise: selection_raise, - lower: selection_lower, - append: selection_append, - insert: selection_insert, - remove: selection_remove, - clone: selection_clone, - datum: selection_datum, - on: selection_on, - dispatch: selection_dispatch, - [Symbol.iterator]: selection_iterator - }; - function d3select(selector2) { - return typeof selector2 === "string" ? new Selection$1([[document.querySelector(selector2)]], [document.documentElement]) : new Selection$1([[selector2]], root$2); - } - function selectAll(selector2) { - return typeof selector2 === "string" ? new Selection$1([document.querySelectorAll(selector2)], [document.documentElement]) : new Selection$1([array$1(selector2)], root$2); - } - function define2(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; - } - function extend$1(parent, definition2) { - var prototype = Object.create(parent.prototype); - for (var key in definition2) - prototype[key] = definition2[key]; - return prototype; - } - function Color$2() { - } - var darker = 0.7; - var brighter = 1 / darker; - var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); - var named = { - aliceblue: 15792383, - antiquewhite: 16444375, - aqua: 65535, - aquamarine: 8388564, - azure: 15794175, - beige: 16119260, - bisque: 16770244, - black: 0, - blanchedalmond: 16772045, - blue: 255, - blueviolet: 9055202, - brown: 10824234, - burlywood: 14596231, - cadetblue: 6266528, - chartreuse: 8388352, - chocolate: 13789470, - coral: 16744272, - cornflowerblue: 6591981, - cornsilk: 16775388, - crimson: 14423100, - cyan: 65535, - darkblue: 139, - darkcyan: 35723, - darkgoldenrod: 12092939, - darkgray: 11119017, - darkgreen: 25600, - darkgrey: 11119017, - darkkhaki: 12433259, - darkmagenta: 9109643, - darkolivegreen: 5597999, - darkorange: 16747520, - darkorchid: 10040012, - darkred: 9109504, - darksalmon: 15308410, - darkseagreen: 9419919, - darkslateblue: 4734347, - darkslategray: 3100495, - darkslategrey: 3100495, - darkturquoise: 52945, - darkviolet: 9699539, - deeppink: 16716947, - deepskyblue: 49151, - dimgray: 6908265, - dimgrey: 6908265, - dodgerblue: 2003199, - firebrick: 11674146, - floralwhite: 16775920, - forestgreen: 2263842, - fuchsia: 16711935, - gainsboro: 14474460, - ghostwhite: 16316671, - gold: 16766720, - goldenrod: 14329120, - gray: 8421504, - green: 32768, - greenyellow: 11403055, - grey: 8421504, - honeydew: 15794160, - hotpink: 16738740, - indianred: 13458524, - indigo: 4915330, - ivory: 16777200, - khaki: 15787660, - lavender: 15132410, - lavenderblush: 16773365, - lawngreen: 8190976, - lemonchiffon: 16775885, - lightblue: 11393254, - lightcoral: 15761536, - lightcyan: 14745599, - lightgoldenrodyellow: 16448210, - lightgray: 13882323, - lightgreen: 9498256, - lightgrey: 13882323, - lightpink: 16758465, - lightsalmon: 16752762, - lightseagreen: 2142890, - lightskyblue: 8900346, - lightslategray: 7833753, - lightslategrey: 7833753, - lightsteelblue: 11584734, - lightyellow: 16777184, - lime: 65280, - limegreen: 3329330, - linen: 16445670, - magenta: 16711935, - maroon: 8388608, - mediumaquamarine: 6737322, - mediumblue: 205, - mediumorchid: 12211667, - mediumpurple: 9662683, - mediumseagreen: 3978097, - mediumslateblue: 8087790, - mediumspringgreen: 64154, - mediumturquoise: 4772300, - mediumvioletred: 13047173, - midnightblue: 1644912, - mintcream: 16121850, - mistyrose: 16770273, - moccasin: 16770229, - navajowhite: 16768685, - navy: 128, - oldlace: 16643558, - olive: 8421376, - olivedrab: 7048739, - orange: 16753920, - orangered: 16729344, - orchid: 14315734, - palegoldenrod: 15657130, - palegreen: 10025880, - paleturquoise: 11529966, - palevioletred: 14381203, - papayawhip: 16773077, - peachpuff: 16767673, - peru: 13468991, - pink: 16761035, - plum: 14524637, - powderblue: 11591910, - purple: 8388736, - rebeccapurple: 6697881, - red: 16711680, - rosybrown: 12357519, - royalblue: 4286945, - saddlebrown: 9127187, - salmon: 16416882, - sandybrown: 16032864, - seagreen: 3050327, - seashell: 16774638, - sienna: 10506797, - silver: 12632256, - skyblue: 8900331, - slateblue: 6970061, - slategray: 7372944, - slategrey: 7372944, - snow: 16775930, - springgreen: 65407, - steelblue: 4620980, - tan: 13808780, - teal: 32896, - thistle: 14204888, - tomato: 16737095, - turquoise: 4251856, - violet: 15631086, - wheat: 16113331, - white: 16777215, - whitesmoke: 16119285, - yellow: 16776960, - yellowgreen: 10145074 - }; - define2(Color$2, color, { - copy(channels2) { - return Object.assign(new this.constructor(), this, channels2); - }, - displayable() { - return this.rgb().displayable(); - }, - hex: color_formatHex, - // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHex8: color_formatHex8, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb - }); - function color_formatHex() { - return this.rgb().formatHex(); - } - function color_formatHex8() { - return this.rgb().formatHex8(); - } - function color_formatHsl() { - return hslConvert(this).formatHsl(); - } - function color_formatRgb() { - return this.rgb().formatRgb(); - } - function color(format2) { - var m, l; - format2 = (format2 + "").trim().toLowerCase(); - return (m = reHex.exec(format2)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba$2(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba$2(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format2)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format2)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format2)) ? rgba$2(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format2)) ? rgba$2(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; - } - function rgbn(n) { - return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1); - } - function rgba$2(r, g, b, a) { - if (a <= 0) - r = g = b = NaN; - return new Rgb(r, g, b, a); - } - function rgbConvert(o) { - if (!(o instanceof Color$2)) - o = color(o); - if (!o) - return new Rgb(); - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); - } - function rgb(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); - } - function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; + function htmlBuilder$9(group2, options3) { + var elements3 = buildExpression$1(group2.body, options3, true); + return makeSpan2([group2.mclass], elements3, options3); } - define2(Rgb, rgb, extend$1(Color$2, { - brighter(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb() { - return this; - }, - clamp() { - return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); - }, - displayable() { - return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, - // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatHex8: rgb_formatHex8, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb - })); - function rgb_formatHex() { - return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; - } - function rgb_formatHex8() { - return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; - } - function rgb_formatRgb() { - const a = clampa(this.opacity); - return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`; - } - function clampa(opacity) { - return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity)); - } - function clampi(value2) { - return Math.max(0, Math.min(255, Math.round(value2) || 0)); - } - function hex(value2) { - value2 = clampi(value2); - return (value2 < 16 ? "0" : "") + value2.toString(16); - } - function hsla(h, s, l, a) { - if (a <= 0) - h = s = l = NaN; - else if (l <= 0 || l >= 1) - h = s = NaN; - else if (s <= 0) - h = NaN; - return new Hsl(h, s, l, a); - } - function hslConvert(o) { - if (o instanceof Hsl) - return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color$2)) - o = color(o); - if (!o) - return new Hsl(); - if (o instanceof Hsl) - return o; - o = o.rgb(); - var r = o.r / 255, g = o.g / 255, b = o.b / 255, min2 = Math.min(r, g, b), max2 = Math.max(r, g, b), h = NaN, s = max2 - min2, l = (max2 + min2) / 2; - if (s) { - if (r === max2) - h = (g - b) / s + (g < b) * 6; - else if (g === max2) - h = (b - r) / s + 2; - else - h = (r - g) / s + 4; - s /= l < 0.5 ? max2 + min2 : 2 - max2 - min2; - h *= 60; + function mathmlBuilder$8(group2, options3) { + var node2; + var inner2 = buildExpression2(group2.body, options3); + if (group2.mclass === "minner") { + node2 = new mathMLTree.MathNode("mpadded", inner2); + } else if (group2.mclass === "mord") { + if (group2.isCharacterBox) { + node2 = inner2[0]; + node2.type = "mi"; + } else { + node2 = new mathMLTree.MathNode("mi", inner2); + } } else { - s = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s, l, o.opacity); - } - function hsl(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); - } - function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - define2(Hsl, hsl, extend$1(Color$2, { - brighter(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb() { - var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity - ); - }, - clamp() { - return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); - }, - displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1); - }, - formatHsl() { - const a = clampa(this.opacity); - return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`; - } - })); - function clamph(value2) { - value2 = (value2 || 0) % 360; - return value2 < 0 ? value2 + 360 : value2; - } - function clampt(value2) { - return Math.max(0, Math.min(1, value2 || 0)); - } - function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; - } - const radians = Math.PI / 180; - const degrees$1 = 180 / Math.PI; - const K = 18, Xn = 0.96422, Yn = 1, Zn = 0.82521, t0$1 = 4 / 29, t1$1 = 6 / 29, t2 = 3 * t1$1 * t1$1, t3 = t1$1 * t1$1 * t1$1; - function labConvert(o) { - if (o instanceof Lab) - return new Lab(o.l, o.a, o.b, o.opacity); - if (o instanceof Hcl) - return hcl2lab(o); - if (!(o instanceof Rgb)) - o = rgbConvert(o); - var r = rgb2lrgb(o.r), g = rgb2lrgb(o.g), b = rgb2lrgb(o.b), y2 = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x2, z; - if (r === g && g === b) - x2 = z = y2; - else { - x2 = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); - z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); + if (group2.isCharacterBox) { + node2 = inner2[0]; + node2.type = "mo"; + } else { + node2 = new mathMLTree.MathNode("mo", inner2); + } + if (group2.mclass === "mbin") { + node2.attributes.lspace = "0.22em"; + node2.attributes.rspace = "0.22em"; + } else if (group2.mclass === "mpunct") { + node2.attributes.lspace = "0em"; + node2.attributes.rspace = "0.17em"; + } else if (group2.mclass === "mopen" || group2.mclass === "mclose") { + node2.attributes.lspace = "0em"; + node2.attributes.rspace = "0em"; + } else if (group2.mclass === "minner") { + node2.attributes.lspace = "0.0556em"; + node2.attributes.width = "+0.1111em"; + } } - return new Lab(116 * y2 - 16, 500 * (x2 - y2), 200 * (y2 - z), o.opacity); - } - function lab(l, a, b, opacity) { - return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); - } - function Lab(l, a, b, opacity) { - this.l = +l; - this.a = +a; - this.b = +b; - this.opacity = +opacity; + return node2; } - define2(Lab, lab, extend$1(Color$2, { - brighter(k) { - return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - darker(k) { - return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - rgb() { - var y2 = (this.l + 16) / 116, x2 = isNaN(this.a) ? y2 : y2 + this.a / 500, z = isNaN(this.b) ? y2 : y2 - this.b / 200; - x2 = Xn * lab2xyz(x2); - y2 = Yn * lab2xyz(y2); - z = Zn * lab2xyz(z); - return new Rgb( - lrgb2rgb(3.1338561 * x2 - 1.6168667 * y2 - 0.4906146 * z), - lrgb2rgb(-0.9787684 * x2 + 1.9161415 * y2 + 0.033454 * z), - lrgb2rgb(0.0719453 * x2 - 0.2289914 * y2 + 1.4052427 * z), - this.opacity - ); + function cdArrow(arrowChar, labels, parser21) { + var funcName = cdArrowFunctionName[arrowChar]; + switch (funcName) { + case "\\\\cdrightarrow": + case "\\\\cdleftarrow": + return parser21.callFunction(funcName, [labels[0]], [labels[1]]); + case "\\uparrow": + case "\\downarrow": { + var leftLabel = parser21.callFunction("\\\\cdleft", [labels[0]], []); + var bareArrow = { + type: "atom", + text: funcName, + mode: "math", + family: "rel" + }; + var sizedArrow = parser21.callFunction("\\Big", [bareArrow], []); + var rightLabel = parser21.callFunction("\\\\cdright", [labels[1]], []); + var arrowGroup = { + type: "ordgroup", + mode: "math", + body: [leftLabel, sizedArrow, rightLabel] + }; + return parser21.callFunction("\\\\cdparent", [arrowGroup], []); + } + case "\\\\cdlongequal": + return parser21.callFunction("\\\\cdlongequal", [], []); + case "\\Vert": { + var arrow = { + type: "textord", + text: "\\Vert", + mode: "math" + }; + return parser21.callFunction("\\Big", [arrow], []); + } + default: + return { + type: "textord", + text: " ", + mode: "math" + }; } - })); - function xyz2lab(t) { - return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0$1; - } - function lab2xyz(t) { - return t > t1$1 ? t * t * t : t2 * (t - t0$1); - } - function lrgb2rgb(x2) { - return 255 * (x2 <= 31308e-7 ? 12.92 * x2 : 1.055 * Math.pow(x2, 1 / 2.4) - 0.055); - } - function rgb2lrgb(x2) { - return (x2 /= 255) <= 0.04045 ? x2 / 12.92 : Math.pow((x2 + 0.055) / 1.055, 2.4); - } - function hclConvert(o) { - if (o instanceof Hcl) - return new Hcl(o.h, o.c, o.l, o.opacity); - if (!(o instanceof Lab)) - o = labConvert(o); - if (o.a === 0 && o.b === 0) - return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); - var h = Math.atan2(o.b, o.a) * degrees$1; - return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); - } - function hcl$1(h, c2, l, opacity) { - return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c2, l, opacity == null ? 1 : opacity); - } - function Hcl(h, c2, l, opacity) { - this.h = +h; - this.c = +c2; - this.l = +l; - this.opacity = +opacity; - } - function hcl2lab(o) { - if (isNaN(o.h)) - return new Lab(o.l, 0, 0, o.opacity); - var h = o.h * radians; - return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); - } - define2(Hcl, hcl$1, extend$1(Color$2, { - brighter(k) { - return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); - }, - darker(k) { - return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); - }, - rgb() { - return hcl2lab(this).rgb(); - } - })); - const constant$4 = (x2) => () => x2; - function linear$1(a, d) { - return function(t) { - return a + t * d; - }; - } - function exponential(a, b, y2) { - return a = Math.pow(a, y2), b = Math.pow(b, y2) - a, y2 = 1 / y2, function(t) { - return Math.pow(a + t * b, y2); - }; - } - function hue(a, b) { - var d = b - a; - return d ? linear$1(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant$4(isNaN(a) ? b : a); - } - function gamma(y2) { - return (y2 = +y2) === 1 ? nogamma : function(a, b) { - return b - a ? exponential(a, b, y2) : constant$4(isNaN(a) ? b : a); - }; - } - function nogamma(a, b) { - var d = b - a; - return d ? linear$1(a, d) : constant$4(isNaN(a) ? b : a); - } - const interpolateRgb = function rgbGamma(y2) { - var color2 = gamma(y2); - function rgb$1(start2, end2) { - var r = color2((start2 = rgb(start2)).r, (end2 = rgb(end2)).r), g = color2(start2.g, end2.g), b = color2(start2.b, end2.b), opacity = nogamma(start2.opacity, end2.opacity); - return function(t) { - start2.r = r(t); - start2.g = g(t); - start2.b = b(t); - start2.opacity = opacity(t); - return start2 + ""; - }; - } - rgb$1.gamma = rgbGamma; - return rgb$1; - }(1); - function numberArray(a, b) { - if (!b) - b = []; - var n = a ? Math.min(b.length, a.length) : 0, c2 = b.slice(), i2; - return function(t) { - for (i2 = 0; i2 < n; ++i2) - c2[i2] = a[i2] * (1 - t) + b[i2] * t; - return c2; - }; - } - function isNumberArray(x2) { - return ArrayBuffer.isView(x2) && !(x2 instanceof DataView); - } - function genericArray(a, b) { - var nb = b ? b.length : 0, na = a ? Math.min(nb, a.length) : 0, x2 = new Array(na), c2 = new Array(nb), i2; - for (i2 = 0; i2 < na; ++i2) - x2[i2] = interpolate$1(a[i2], b[i2]); - for (; i2 < nb; ++i2) - c2[i2] = b[i2]; - return function(t) { - for (i2 = 0; i2 < na; ++i2) - c2[i2] = x2[i2](t); - return c2; - }; - } - function date$1(a, b) { - var d = /* @__PURE__ */ new Date(); - return a = +a, b = +b, function(t) { - return d.setTime(a * (1 - t) + b * t), d; - }; } - function interpolateNumber(a, b) { - return a = +a, b = +b, function(t) { - return a * (1 - t) + b * t; - }; - } - function object(a, b) { - var i2 = {}, c2 = {}, k; - if (a === null || typeof a !== "object") - a = {}; - if (b === null || typeof b !== "object") - b = {}; - for (k in b) { - if (k in a) { - i2[k] = interpolate$1(a[k], b[k]); + function parseCD(parser21) { + var parsedRows = []; + parser21.gullet.beginGroup(); + parser21.gullet.macros.set("\\cr", "\\\\\\relax"); + parser21.gullet.beginGroup(); + while (true) { + parsedRows.push(parser21.parseExpression(false, "\\\\")); + parser21.gullet.endGroup(); + parser21.gullet.beginGroup(); + var next3 = parser21.fetch().text; + if (next3 === "&" || next3 === "\\\\") { + parser21.consume(); + } else if (next3 === "\\end") { + if (parsedRows[parsedRows.length - 1].length === 0) { + parsedRows.pop(); + } + break; } else { - c2[k] = b[k]; + throw new ParseError("Expected \\\\ or \\cr or \\end", parser21.nextToken); } } - return function(t) { - for (k in i2) - c2[k] = i2[k](t); - return c2; - }; - } - var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g"); - function zero(b) { - return function() { - return b; - }; - } - function one$1(b) { - return function(t) { - return b(t) + ""; - }; - } - function interpolateString(a, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s = [], q = []; - a = a + "", b = b + ""; - while ((am = reA.exec(a)) && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { - bs = b.slice(bi, bs); - if (s[i2]) - s[i2] += bs; - else - s[++i2] = bs; + var row = []; + var body = [row]; + for (var i2 = 0; i2 < parsedRows.length; i2++) { + var rowNodes = parsedRows[i2]; + var cell = newCell(); + for (var j2 = 0; j2 < rowNodes.length; j2++) { + if (!isStartOfArrow(rowNodes[j2])) { + cell.body.push(rowNodes[j2]); + } else { + row.push(cell); + j2 += 1; + var arrowChar = assertSymbolNodeType(rowNodes[j2]).text; + var labels = new Array(2); + labels[0] = { + type: "ordgroup", + mode: "math", + body: [] + }; + labels[1] = { + type: "ordgroup", + mode: "math", + body: [] + }; + if ("=|.".indexOf(arrowChar) > -1) ; + else if ("<>AV".indexOf(arrowChar) > -1) { + for (var labelNum = 0; labelNum < 2; labelNum++) { + var inLabel = true; + for (var k2 = j2 + 1; k2 < rowNodes.length; k2++) { + if (isLabelEnd(rowNodes[k2], arrowChar)) { + inLabel = false; + j2 = k2; + break; + } + if (isStartOfArrow(rowNodes[k2])) { + throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[k2]); + } + labels[labelNum].body.push(rowNodes[k2]); + } + if (inLabel) { + throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[j2]); + } + } + } else { + throw new ParseError('Expected one of "<>AV=|." after @', rowNodes[j2]); + } + var arrow = cdArrow(arrowChar, labels, parser21); + var wrappedArrow = { + type: "styling", + body: [arrow], + mode: "math", + style: "display" + // CD is always displaystyle. + }; + row.push(wrappedArrow); + cell = newCell(); + } } - if ((am = am[0]) === (bm = bm[0])) { - if (s[i2]) - s[i2] += bm; - else - s[++i2] = bm; + if (i2 % 2 === 0) { + row.push(cell); } else { - s[++i2] = null; - q.push({ i: i2, x: interpolateNumber(am, bm) }); + row.shift(); } - bi = reB.lastIndex; - } - if (bi < b.length) { - bs = b.slice(bi); - if (s[i2]) - s[i2] += bs; - else - s[++i2] = bs; + row = []; + body.push(row); } - return s.length < 2 ? q[0] ? one$1(q[0].x) : zero(b) : (b = q.length, function(t) { - for (var i3 = 0, o; i3 < b; ++i3) - s[(o = q[i3]).i] = o.x(t); - return s.join(""); + parser21.gullet.endGroup(); + parser21.gullet.endGroup(); + var cols = new Array(body[0].length).fill({ + type: "align", + align: "c", + pregap: 0.25, + // CD package sets \enskip between columns. + postgap: 0.25 + // So pre and post each get half an \enskip, i.e. 0.25em. }); - } - function interpolate$1(a, b) { - var t = typeof b, c2; - return b == null || t === "boolean" ? constant$4(b) : (t === "number" ? interpolateNumber : t === "string" ? (c2 = color(b)) ? (b = c2, interpolateRgb) : interpolateString : b instanceof color ? interpolateRgb : b instanceof Date ? date$1 : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a, b); - } - function interpolateRound(a, b) { - return a = +a, b = +b, function(t) { - return Math.round(a * (1 - t) + b * t); - }; - } - var degrees = 180 / Math.PI; - var identity$4 = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 - }; - function decompose(a, b, c2, d, e, f2) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a * a + b * b)) - a /= scaleX, b /= scaleX; - if (skewX = a * c2 + b * d) - c2 -= a * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c2 * c2 + d * d)) - c2 /= scaleY, d /= scaleY, skewX /= scaleY; - if (a * d < b * c2) - a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; return { - translateX: e, - translateY: f2, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX, - scaleY + type: "array", + mode: "math", + body, + arraystretch: 1, + addJot: true, + rowGaps: [null], + cols, + colSeparationType: "CD", + hLinesBeforeRow: new Array(body.length + 1).fill([]) }; } - var svgNode; - function parseCss(value2) { - const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value2 + ""); - return m.isIdentity ? identity$4 : decompose(m.a, m.b, m.c, m.d, m.e, m.f); - } - function parseSvg(value2) { - if (value2 == null) - return identity$4; - if (!svgNode) - svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value2); - if (!(value2 = svgNode.transform.baseVal.consolidate())) - return identity$4; - value2 = value2.matrix; - return decompose(value2.a, value2.b, value2.c, value2.d, value2.e, value2.f); + function checkDelimiter(delim, context) { + var symDelim = checkSymbolNodeType(delim); + if (symDelim && utils.contains(delimiters, symDelim.text)) { + return symDelim; + } else if (symDelim) { + throw new ParseError("Invalid delimiter '" + symDelim.text + "' after '" + context.funcName + "'", delim); + } else { + throw new ParseError("Invalid delimiter type '" + delim.type + "'", delim); + } } - function interpolateTransform(parse2, pxComma, pxParen, degParen) { - function pop(s) { - return s.length ? s.pop() + " " : ""; + function assertParsed(group2) { + if (!group2.body) { + throw new Error("Bug: The leftright ParseNode wasn't fully parsed."); } - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i2 = s.push("translate(", null, pxComma, null, pxParen); - q.push({ i: i2 - 4, x: interpolateNumber(xa, xb) }, { i: i2 - 2, x: interpolateNumber(ya, yb) }); - } else if (xb || yb) { - s.push("translate(" + xb + pxComma + yb + pxParen); - } + } + function defineEnvironment(_ref) { + var { + type: type3, + names, + props, + handler, + htmlBuilder: htmlBuilder3, + mathmlBuilder: mathmlBuilder3 + } = _ref; + var data5 = { + type: type3, + numArgs: props.numArgs || 0, + allowedInText: false, + numOptionalArgs: 0, + handler + }; + for (var i2 = 0; i2 < names.length; ++i2) { + _environments[names[i2]] = data5; } - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) - b += 360; - else if (b - a > 180) - a += 360; - q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) }); - } else if (b) { - s.push(pop(s) + "rotate(" + b + degParen); - } + if (htmlBuilder3) { + _htmlGroupBuilders[type3] = htmlBuilder3; } - function skewX(a, b, s, q) { - if (a !== b) { - q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) }); - } else if (b) { - s.push(pop(s) + "skewX(" + b + degParen); - } + if (mathmlBuilder3) { + _mathmlGroupBuilders[type3] = mathmlBuilder3; } - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i2 = s.push(pop(s) + "scale(", null, ",", null, ")"); - q.push({ i: i2 - 4, x: interpolateNumber(xa, xb) }, { i: i2 - 2, x: interpolateNumber(ya, yb) }); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + "scale(" + xb + "," + yb + ")"); - } - } - return function(a, b) { - var s = [], q = []; - a = parse2(a), b = parse2(b); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; - return function(t) { - var i2 = -1, n = q.length, o; - while (++i2 < n) - s[(o = q[i2]).i] = o.x(t); - return s.join(""); - }; - }; - } - var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); - var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); - function hcl(hue2) { - return function(start2, end2) { - var h = hue2((start2 = hcl$1(start2)).h, (end2 = hcl$1(end2)).h), c2 = nogamma(start2.c, end2.c), l = nogamma(start2.l, end2.l), opacity = nogamma(start2.opacity, end2.opacity); - return function(t) { - start2.h = h(t); - start2.c = c2(t); - start2.l = l(t); - start2.opacity = opacity(t); - return start2 + ""; - }; - }; - } - const interpolateHcl = hcl(hue); - var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance === "object" && performance.now ? performance : Date, setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f2) { - setTimeout(f2, 17); - }; - function now$2() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); } - function clearNow() { - clockNow = 0; - } - function Timer() { - this._call = this._time = this._next = null; + function defineMacro(name, body) { + _macros[name] = body; } - Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function(callback, delay, time2) { - if (typeof callback !== "function") - throw new TypeError("callback is not a function"); - time2 = (time2 == null ? now$2() : +time2) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) - taskTail._next = this; - else - taskHead = this; - taskTail = this; - } - this._call = callback; - this._time = time2; - sleep(); - }, - stop: function() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } + function getHLines(parser21) { + var hlineInfo = []; + parser21.consumeSpaces(); + var nxt = parser21.fetch().text; + if (nxt === "\\relax") { + parser21.consume(); + parser21.consumeSpaces(); + nxt = parser21.fetch().text; } - }; - function timer(callback, delay, time2) { - var t = new Timer(); - t.restart(callback, delay, time2); - return t; - } - function timerFlush() { - now$2(); - ++frame; - var t = taskHead, e; - while (t) { - if ((e = clockNow - t._time) >= 0) - t._call.call(void 0, e); - t = t._next; + while (nxt === "\\hline" || nxt === "\\hdashline") { + parser21.consume(); + hlineInfo.push(nxt === "\\hdashline"); + parser21.consumeSpaces(); + nxt = parser21.fetch().text; } - --frame; + return hlineInfo; } - function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame = timeout$1 = 0; - try { - timerFlush(); - } finally { - frame = 0; - nap(); - clockNow = 0; + function getAutoTag(name) { + if (name.indexOf("ed") === -1) { + return name.indexOf("*") === -1; } } - function poke() { - var now2 = clock.now(), delay = now2 - clockLast; - if (delay > pokeDelay) - clockSkew -= delay, clockLast = now2; - } - function nap() { - var t02, t12 = taskHead, t22, time2 = Infinity; - while (t12) { - if (t12._call) { - if (time2 > t12._time) - time2 = t12._time; - t02 = t12, t12 = t12._next; + function parseArray(parser21, _ref, style3) { + var { + hskipBeforeAndAfter, + addJot, + cols, + arraystretch, + colSeparationType, + autoTag, + singleRow, + emptySingleRow, + maxNumCols, + leqno + } = _ref; + parser21.gullet.beginGroup(); + if (!singleRow) { + parser21.gullet.macros.set("\\cr", "\\\\\\relax"); + } + if (!arraystretch) { + var stretch = parser21.gullet.expandMacroAsText("\\arraystretch"); + if (stretch == null) { + arraystretch = 1; } else { - t22 = t12._next, t12._next = null; - t12 = t02 ? t02._next = t22 : taskHead = t22; + arraystretch = parseFloat(stretch); + if (!arraystretch || arraystretch < 0) { + throw new ParseError("Invalid \\arraystretch: " + stretch); + } } } - taskTail = t02; - sleep(time2); - } - function sleep(time2) { - if (frame) - return; - if (timeout$1) - timeout$1 = clearTimeout(timeout$1); - var delay = time2 - clockNow; - if (delay > 24) { - if (time2 < Infinity) - timeout$1 = setTimeout(wake, time2 - clock.now() - clockSkew); - if (interval) - interval = clearInterval(interval); - } else { - if (!interval) - clockLast = clock.now(), interval = setInterval(poke, pokeDelay); - frame = 1, setFrame(wake); - } - } - function timeout(callback, delay, time2) { - var t = new Timer(); - delay = delay == null ? 0 : +delay; - t.restart((elapsed) => { - t.stop(); - callback(elapsed + delay); - }, delay, time2); - return t; - } - var emptyOn = dispatch("start", "end", "cancel", "interrupt"); - var emptyTween = []; - var CREATED = 0; - var SCHEDULED = 1; - var STARTING = 2; - var STARTED = 3; - var RUNNING = 4; - var ENDING = 5; - var ENDED = 6; - function schedule(node2, name, id2, index2, group, timing) { - var schedules = node2.__transition; - if (!schedules) - node2.__transition = {}; - else if (id2 in schedules) - return; - create$1(node2, id2, { - name, - index: index2, - // For context during callback. - group, - // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED - }); - } - function init$1(node2, id2) { - var schedule2 = get$2(node2, id2); - if (schedule2.state > CREATED) - throw new Error("too late; already scheduled"); - return schedule2; - } - function set$2(node2, id2) { - var schedule2 = get$2(node2, id2); - if (schedule2.state > STARTED) - throw new Error("too late; already running"); - return schedule2; - } - function get$2(node2, id2) { - var schedule2 = node2.__transition; - if (!schedule2 || !(schedule2 = schedule2[id2])) - throw new Error("transition not found"); - return schedule2; - } - function create$1(node2, id2, self2) { - var schedules = node2.__transition, tween; - schedules[id2] = self2; - self2.timer = timer(schedule2, 0, self2.time); - function schedule2(elapsed) { - self2.state = SCHEDULED; - self2.timer.restart(start2, self2.delay, self2.time); - if (self2.delay <= elapsed) - start2(elapsed - self2.delay); - } - function start2(elapsed) { - var i2, j, n, o; - if (self2.state !== SCHEDULED) - return stop(); - for (i2 in schedules) { - o = schedules[i2]; - if (o.name !== self2.name) - continue; - if (o.state === STARTED) - return timeout(start2); - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call("interrupt", node2, node2.__data__, o.index, o.group); - delete schedules[i2]; - } else if (+i2 < id2) { - o.state = ENDED; - o.timer.stop(); - o.on.call("cancel", node2, node2.__data__, o.index, o.group); - delete schedules[i2]; - } + parser21.gullet.beginGroup(); + var row = []; + var body = [row]; + var rowGaps = []; + var hLinesBeforeRow = []; + var tags2 = autoTag != null ? [] : void 0; + function beginRow() { + if (autoTag) { + parser21.gullet.macros.set("\\@eqnsw", "1", true); } - timeout(function() { - if (self2.state === STARTED) { - self2.state = RUNNING; - self2.timer.restart(tick, self2.delay, self2.time); - tick(elapsed); - } - }); - self2.state = STARTING; - self2.on.call("start", node2, node2.__data__, self2.index, self2.group); - if (self2.state !== STARTING) - return; - self2.state = STARTED; - tween = new Array(n = self2.tween.length); - for (i2 = 0, j = -1; i2 < n; ++i2) { - if (o = self2.tween[i2].value.call(node2, node2.__data__, self2.index, self2.group)) { - tween[++j] = o; + } + __name(beginRow, "beginRow"); + function endRow() { + if (tags2) { + if (parser21.gullet.macros.get("\\df@tag")) { + tags2.push(parser21.subparse([new Token("\\df@tag")])); + parser21.gullet.macros.set("\\df@tag", void 0, true); + } else { + tags2.push(Boolean(autoTag) && parser21.gullet.macros.get("\\@eqnsw") === "1"); } } - tween.length = j + 1; } - function tick(elapsed) { - var t = elapsed < self2.duration ? self2.ease.call(null, elapsed / self2.duration) : (self2.timer.restart(stop), self2.state = ENDING, 1), i2 = -1, n = tween.length; - while (++i2 < n) { - tween[i2].call(node2, t); + __name(endRow, "endRow"); + beginRow(); + hLinesBeforeRow.push(getHLines(parser21)); + while (true) { + var cell = parser21.parseExpression(false, singleRow ? "\\end" : "\\\\"); + parser21.gullet.endGroup(); + parser21.gullet.beginGroup(); + cell = { + type: "ordgroup", + mode: parser21.mode, + body: cell + }; + if (style3) { + cell = { + type: "styling", + mode: parser21.mode, + style: style3, + body: [cell] + }; } - if (self2.state === ENDING) { - self2.on.call("end", node2, node2.__data__, self2.index, self2.group); - stop(); + row.push(cell); + var next3 = parser21.fetch().text; + if (next3 === "&") { + if (maxNumCols && row.length === maxNumCols) { + if (singleRow || colSeparationType) { + throw new ParseError("Too many tab characters: &", parser21.nextToken); + } else { + parser21.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); + } + } + parser21.consume(); + } else if (next3 === "\\end") { + endRow(); + if (row.length === 1 && cell.type === "styling" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) { + body.pop(); + } + if (hLinesBeforeRow.length < body.length + 1) { + hLinesBeforeRow.push([]); + } + break; + } else if (next3 === "\\\\") { + parser21.consume(); + var size5 = void 0; + if (parser21.gullet.future().text !== " ") { + size5 = parser21.parseSizeGroup(true); + } + rowGaps.push(size5 ? size5.value : null); + endRow(); + hLinesBeforeRow.push(getHLines(parser21)); + row = []; + body.push(row); + beginRow(); + } else { + throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser21.nextToken); } } - function stop() { - self2.state = ENDED; - self2.timer.stop(); - delete schedules[id2]; - for (var i2 in schedules) - return; - delete node2.__transition; + parser21.gullet.endGroup(); + parser21.gullet.endGroup(); + return { + type: "array", + mode: parser21.mode, + addJot, + arraystretch, + body, + cols, + rowGaps, + hskipBeforeAndAfter, + hLinesBeforeRow, + colSeparationType, + tags: tags2, + leqno + }; + } + function dCellStyle(envName) { + if (envName.slice(0, 1) === "d") { + return "display"; + } else { + return "text"; } } - function interrupt(node2, name) { - var schedules = node2.__transition, schedule2, active, empty2 = true, i2; - if (!schedules) - return; - name = name == null ? null : name + ""; - for (i2 in schedules) { - if ((schedule2 = schedules[i2]).name !== name) { - empty2 = false; - continue; + function sizingGroup(value2, options3, baseOptions) { + var inner2 = buildExpression$1(value2, options3, false); + var multiplier = options3.sizeMultiplier / baseOptions.sizeMultiplier; + for (var i2 = 0; i2 < inner2.length; i2++) { + var pos = inner2[i2].classes.indexOf("sizing"); + if (pos < 0) { + Array.prototype.push.apply(inner2[i2].classes, options3.sizingClasses(baseOptions)); + } else if (inner2[i2].classes[pos + 1] === "reset-size" + options3.size) { + inner2[i2].classes[pos + 1] = "reset-size" + baseOptions.size; } - active = schedule2.state > STARTING && schedule2.state < ENDING; - schedule2.state = ENDED; - schedule2.timer.stop(); - schedule2.on.call(active ? "interrupt" : "cancel", node2, node2.__data__, schedule2.index, schedule2.group); - delete schedules[i2]; + inner2[i2].height *= multiplier; + inner2[i2].depth *= multiplier; } - if (empty2) - delete node2.__transition; - } - function selection_interrupt(name) { - return this.each(function() { - interrupt(this, name); - }); + return buildCommon.makeFragment(inner2); } - function tweenRemove(id2, name) { - var tween0, tween1; - return function() { - var schedule2 = set$2(this, id2), tween = schedule2.tween; - if (tween !== tween0) { - tween1 = tween0 = tween; - for (var i2 = 0, n = tween1.length; i2 < n; ++i2) { - if (tween1[i2].name === name) { - tween1 = tween1.slice(); - tween1.splice(i2, 1); - break; + var SourceLocation, Token, ParseError, contains, deflt, uppercase, hyphenate, ESCAPE_LOOKUP, ESCAPE_REGEX, getBaseElem, isCharacterBox, assert, protocolFromUrl, utils, SETTINGS_SCHEMA, Settings, Style, D, Dc, T, Tc, S, Sc, SS, SSc, styles, sup, sub, fracNum, fracDen, cramp, text$1, Style$1, scriptData, allBlocks, hLinePad, sqrtMain, sqrtSize1, sqrtSize2, sqrtSize3, sqrtSize4, phasePath, sqrtTall, sqrtPath, innerPath, path, tallDelim, DocumentFragment, fontMetricsData, sigmasAndXis, extraCharacterMap, fontMetricsBySizeIndex, sizeStyleMap, sizeMultipliers, sizeAtStyle, Options, ptPerUnit, relativeUnit, validUnit, calculateSize, makeEm, createClass, initNode, toNode, toMarkup, Span, Anchor, Img, iCombinations, SymbolNode, SvgNode, PathNode, LineNode, ATOMS, NON_ATOMS, symbols, math, text, main, ams, accent, bin, close, inner, mathord, op, open, punct, rel, spacing, textord, ligatures, mathTextSymbols, ch, i2, textSymbols, _ch, _i, letters, _ch2, _i2, wideChar, _ch3, _i3, _ch4, _i4, extraLatin, _ch5, _i5, wideLatinLetterData, wideNumeralData, wideCharacterFont, lookupSymbol, makeSymbol, mathsym, boldsymbol, makeOrd, canCombine, tryCombineChars, sizeElementFromChildren, makeSpan$2, makeSvgSpan, makeLineSpan, makeAnchor, makeFragment, wrapFragment, getVListChildrenAndDepth, makeVList, makeGlue, retrieveTextFontName, fontMap, svgData, staticSvg, buildCommon, thinspace, mediumspace, thickspace, spacings, tightSpacings, _functions, _htmlGroupBuilders, _mathmlGroupBuilders, normalizeArgument, ordargument, makeSpan$1, binLeftCanceller, binRightCanceller, styleMap$1, DomEnum, buildExpression$1, traverseNonSpaceNodes, checkPartialGroup, getOutermostNode, getTypeOfDomTree, makeNullDelimiter, buildGroup$1, MathNode, TextNode, SpaceNode, mathMLTree, makeText, makeRow, getVariant, buildExpression2, buildExpressionRow, buildGroup2, optionsFromSettings, displayWrap, buildTree, buildHTMLTree, stretchyCodePoint, mathMLnode, katexImagesData, groupLength, svgSpan, encloseSpan, stretchy, htmlBuilder$a, mathmlBuilder$9, NON_STRETCHY_ACCENT_REGEX, paddedNode, makeSpan2, binrelClass, cdArrowFunctionName, newCell, isStartOfArrow, isLabelEnd, htmlBuilder$8, mathmlBuilder$7, globalMap, checkControlSequence, getRHS, letCommand, getMetrics, styleWrap, centerSpan, makeSmallDelim, mathrmSize, makeLargeDelim, makeGlyphSpan, makeInner, lapInEms, lap, verts, doubleVerts, makeStackedDelim, vbPad, emPad, sqrtSvg, makeSqrtImage, stackLargeDelimiters, stackAlwaysDelimiters, stackNeverDelimiters, sizeToMaxHeight, makeSizedDelim, stackNeverDelimiterSequence, stackAlwaysDelimiterSequence, stackLargeDelimiterSequence, delimTypeToFont, traverseSequence, makeCustomSizedDelim, makeLeftRightDelim, delimiter, delimiterSizes, delimiters, htmlBuilder$7, mathmlBuilder$6, _environments, _macros, validateAmsEnvironmentContext, htmlBuilder$6, alignMap, mathmlBuilder$5, alignedHandler, environments, htmlBuilder$5, mathmlBuilder$4, fontAliases, adjustStyle, htmlBuilder$4, mathmlBuilder$3, stylArray, delimFromValue, htmlBuilder$3, mathmlBuilder$2, sizeData, chooseMathStyle, assembleSupSub, noSuccessor, htmlBuilder$2, mathmlBuilder$1, singleCharBigOps, singleCharIntegrals, htmlBuilder$1, mathmlBuilder2, sizeFuncs, htmlBuilder2, styleMap, htmlBuilderDelegate, defaultVariant, cssSpace, regularSpace, pad, textFontFamilies, textFontWeights, textFontShapes, optionsWithFont, makeVerb, functions, spaceRegexString, controlWordRegexString, controlSymbolRegexString, controlWordWhitespaceRegexString, controlSpaceRegexString, combiningDiacriticalMarkString, combiningDiacriticalMarksEndRegex, tokenRegexString, Lexer, Namespace, macros, digitToNumber, newcommand, dotsByToken, spaceAfterDots, latexRaiseA, braketHelper, implicitCommands, MacroExpander, unicodeSubRegEx, uSubsAndSups, unicodeAccents, unicodeSymbols, Parser, parseTree, render, renderToString, generateParseTree, renderError, renderToDomTree, renderToHTMLTree, katex; + var init_katex = __esm({ + "../../node_modules/.pnpm/katex@0.16.11/node_modules/katex/dist/katex.mjs"() { + "use strict"; + SourceLocation = class _SourceLocation { + static { + __name(this, "SourceLocation"); + } + // The + prefix indicates that these fields aren't writeable + // Lexer holding the input string. + // Start offset, zero-based inclusive. + // End offset, zero-based exclusive. + constructor(lexer2, start3, end2) { + this.lexer = void 0; + this.start = void 0; + this.end = void 0; + this.lexer = lexer2; + this.start = start3; + this.end = end2; + } + /** + * Merges two `SourceLocation`s from location providers, given they are + * provided in order of appearance. + * - Returns the first one's location if only the first is provided. + * - Returns a merged range of the first and the last if both are provided + * and their lexers match. + * - Otherwise, returns null. + */ + static range(first3, second2) { + if (!second2) { + return first3 && first3.loc; + } else if (!first3 || !first3.loc || !second2.loc || first3.loc.lexer !== second2.loc.lexer) { + return null; + } else { + return new _SourceLocation(first3.loc.lexer, first3.loc.start, second2.loc.end); + } + } + }; + Token = class _Token { + static { + __name(this, "Token"); + } + // don't expand the token + // used in \noexpand + constructor(text2, loc) { + this.text = void 0; + this.loc = void 0; + this.noexpand = void 0; + this.treatAsRelax = void 0; + this.text = text2; + this.loc = loc; + } + /** + * Given a pair of tokens (this and endToken), compute a `Token` encompassing + * the whole input range enclosed by these two. + */ + range(endToken, text2) { + return new _Token(text2, SourceLocation.range(this, endToken)); + } + }; + ParseError = class _ParseError { + static { + __name(this, "ParseError"); + } + // Error start position based on passed-in Token or ParseNode. + // Length of affected text based on passed-in Token or ParseNode. + // The underlying error message without any context added. + constructor(message, token2) { + this.name = void 0; + this.position = void 0; + this.length = void 0; + this.rawMessage = void 0; + var error3 = "KaTeX parse error: " + message; + var start3; + var end2; + var loc = token2 && token2.loc; + if (loc && loc.start <= loc.end) { + var input = loc.lexer.input; + start3 = loc.start; + end2 = loc.end; + if (start3 === input.length) { + error3 += " at end of input: "; + } else { + error3 += " at position " + (start3 + 1) + ": "; + } + var underlined = input.slice(start3, end2).replace(/[^]/g, "$&\u0332"); + var left3; + if (start3 > 15) { + left3 = "\u2026" + input.slice(start3 - 15, start3); + } else { + left3 = input.slice(0, start3); + } + var right3; + if (end2 + 15 < input.length) { + right3 = input.slice(end2, end2 + 15) + "\u2026"; + } else { + right3 = input.slice(end2); + } + error3 += left3 + underlined + right3; + } + var self2 = new Error(error3); + self2.name = "ParseError"; + self2.__proto__ = _ParseError.prototype; + self2.position = start3; + if (start3 != null && end2 != null) { + self2.length = end2 - start3; } + self2.rawMessage = message; + return self2; } - } - schedule2.tween = tween1; - }; - } - function tweenFunction(id2, name, value2) { - var tween0, tween1; - if (typeof value2 !== "function") - throw new Error(); - return function() { - var schedule2 = set$2(this, id2), tween = schedule2.tween; - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for (var t = { name, value: value2 }, i2 = 0, n = tween1.length; i2 < n; ++i2) { - if (tween1[i2].name === name) { - tween1[i2] = t; - break; + }; + ParseError.prototype.__proto__ = Error.prototype; + contains = /* @__PURE__ */ __name(function contains2(list2, elem) { + return list2.indexOf(elem) !== -1; + }, "contains"); + deflt = /* @__PURE__ */ __name(function deflt2(setting, defaultIfUndefined) { + return setting === void 0 ? defaultIfUndefined : setting; + }, "deflt"); + uppercase = /([A-Z])/g; + hyphenate = /* @__PURE__ */ __name(function hyphenate2(str2) { + return str2.replace(uppercase, "-$1").toLowerCase(); + }, "hyphenate"); + ESCAPE_LOOKUP = { + "&": "&", + ">": ">", + "<": "<", + '"': """, + "'": "'" + }; + ESCAPE_REGEX = /[&><"']/g; + __name(escape2, "escape"); + getBaseElem = /* @__PURE__ */ __name(function getBaseElem2(group2) { + if (group2.type === "ordgroup") { + if (group2.body.length === 1) { + return getBaseElem2(group2.body[0]); + } else { + return group2; + } + } else if (group2.type === "color") { + if (group2.body.length === 1) { + return getBaseElem2(group2.body[0]); + } else { + return group2; } + } else if (group2.type === "font") { + return getBaseElem2(group2.body); + } else { + return group2; } - if (i2 === n) - tween1.push(t); - } - schedule2.tween = tween1; - }; - } - function transition_tween(name, value2) { - var id2 = this._id; - name += ""; - if (arguments.length < 2) { - var tween = get$2(this.node(), id2).tween; - for (var i2 = 0, n = tween.length, t; i2 < n; ++i2) { - if ((t = tween[i2]).name === name) { - return t.value; + }, "getBaseElem"); + isCharacterBox = /* @__PURE__ */ __name(function isCharacterBox2(group2) { + var baseElem = getBaseElem(group2); + return baseElem.type === "mathord" || baseElem.type === "textord" || baseElem.type === "atom"; + }, "isCharacterBox"); + assert = /* @__PURE__ */ __name(function assert2(value2) { + if (!value2) { + throw new Error("Expected non-null, but got " + String(value2)); } - } - return null; - } - return this.each((value2 == null ? tweenRemove : tweenFunction)(id2, name, value2)); - } - function tweenValue(transition, name, value2) { - var id2 = transition._id; - transition.each(function() { - var schedule2 = set$2(this, id2); - (schedule2.value || (schedule2.value = {}))[name] = value2.apply(this, arguments); - }); - return function(node2) { - return get$2(node2, id2).value[name]; - }; - } - function interpolate(a, b) { - var c2; - return (typeof b === "number" ? interpolateNumber : b instanceof color ? interpolateRgb : (c2 = color(b)) ? (b = c2, interpolateRgb) : interpolateString)(a, b); - } - function attrRemove(name) { - return function() { - this.removeAttribute(name); - }; - } - function attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - function attrConstant(name, interpolate2, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = this.getAttribute(name); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1); - }; - } - function attrConstantNS(fullname, interpolate2, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1); - }; - } - function attrFunction(name, interpolate2, value2) { - var string00, string10, interpolate0; - return function() { - var string0, value1 = value2(this), string1; - if (value1 == null) - return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ""; - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1)); - }; - } - function attrFunctionNS(fullname, interpolate2, value2) { - var string00, string10, interpolate0; - return function() { - var string0, value1 = value2(this), string1; - if (value1 == null) - return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ""; - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1)); - }; - } - function transition_attr(name, value2) { - var fullname = namespace(name), i2 = fullname === "transform" ? interpolateTransformSvg : interpolate; - return this.attrTween(name, typeof value2 === "function" ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i2, tweenValue(this, "attr." + name, value2)) : value2 == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) : (fullname.local ? attrConstantNS : attrConstant)(fullname, i2, value2)); - } - function attrInterpolate(name, i2) { - return function(t) { - this.setAttribute(name, i2.call(this, t)); - }; - } - function attrInterpolateNS(fullname, i2) { - return function(t) { - this.setAttributeNS(fullname.space, fullname.local, i2.call(this, t)); - }; - } - function attrTweenNS(fullname, value2) { - var t02, i0; - function tween() { - var i2 = value2.apply(this, arguments); - if (i2 !== i0) - t02 = (i0 = i2) && attrInterpolateNS(fullname, i2); - return t02; - } - tween._value = value2; - return tween; - } - function attrTween(name, value2) { - var t02, i0; - function tween() { - var i2 = value2.apply(this, arguments); - if (i2 !== i0) - t02 = (i0 = i2) && attrInterpolate(name, i2); - return t02; - } - tween._value = value2; - return tween; - } - function transition_attrTween(name, value2) { - var key = "attr." + name; - if (arguments.length < 2) - return (key = this.tween(key)) && key._value; - if (value2 == null) - return this.tween(key, null); - if (typeof value2 !== "function") - throw new Error(); - var fullname = namespace(name); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value2)); - } - function delayFunction(id2, value2) { - return function() { - init$1(this, id2).delay = +value2.apply(this, arguments); - }; - } - function delayConstant(id2, value2) { - return value2 = +value2, function() { - init$1(this, id2).delay = value2; - }; - } - function transition_delay(value2) { - var id2 = this._id; - return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id2, value2)) : get$2(this.node(), id2).delay; - } - function durationFunction(id2, value2) { - return function() { - set$2(this, id2).duration = +value2.apply(this, arguments); - }; - } - function durationConstant(id2, value2) { - return value2 = +value2, function() { - set$2(this, id2).duration = value2; - }; - } - function transition_duration(value2) { - var id2 = this._id; - return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id2, value2)) : get$2(this.node(), id2).duration; - } - function easeConstant(id2, value2) { - if (typeof value2 !== "function") - throw new Error(); - return function() { - set$2(this, id2).ease = value2; - }; - } - function transition_ease(value2) { - var id2 = this._id; - return arguments.length ? this.each(easeConstant(id2, value2)) : get$2(this.node(), id2).ease; - } - function easeVarying(id2, value2) { - return function() { - var v = value2.apply(this, arguments); - if (typeof v !== "function") - throw new Error(); - set$2(this, id2).ease = v; - }; - } - function transition_easeVarying(value2) { - if (typeof value2 !== "function") - throw new Error(); - return this.each(easeVarying(this._id, value2)); - } - function transition_filter(match) { - if (typeof match !== "function") - match = matcher(match); - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node2, i2 = 0; i2 < n; ++i2) { - if ((node2 = group[i2]) && match.call(node2, node2.__data__, i2, group)) { - subgroup.push(node2); + return value2; + }, "assert"); + protocolFromUrl = /* @__PURE__ */ __name(function protocolFromUrl2(url) { + var protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(url); + if (!protocol) { + return "_relative"; } - } - } - return new Transition(subgroups, this._parents, this._name, this._id); - } - function transition_merge(transition) { - if (transition._id !== this._id) - throw new Error(); - for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge2 = merges[j] = new Array(n), node2, i2 = 0; i2 < n; ++i2) { - if (node2 = group0[i2] || group1[i2]) { - merge2[i2] = node2; + if (protocol[2] !== ":") { + return null; } - } - } - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - return new Transition(merges, this._parents, this._name, this._id); - } - function start$1(name) { - return (name + "").trim().split(/^|\s+/).every(function(t) { - var i2 = t.indexOf("."); - if (i2 >= 0) - t = t.slice(0, i2); - return !t || t === "start"; - }); - } - function onFunction(id2, name, listener) { - var on0, on1, sit = start$1(name) ? init$1 : set$2; - return function() { - var schedule2 = sit(this, id2), on = schedule2.on; - if (on !== on0) - (on1 = (on0 = on).copy()).on(name, listener); - schedule2.on = on1; - }; - } - function transition_on(name, listener) { - var id2 = this._id; - return arguments.length < 2 ? get$2(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener)); - } - function removeFunction(id2) { - return function() { - var parent = this.parentNode; - for (var i2 in this.__transition) - if (+i2 !== id2) - return; - if (parent) - parent.removeChild(this); - }; - } - function transition_remove() { - return this.on("end.remove", removeFunction(this._id)); - } - function transition_select(select) { - var name = this._name, id2 = this._id; - if (typeof select !== "function") - select = selector(select); - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node2, subnode, i2 = 0; i2 < n; ++i2) { - if ((node2 = group[i2]) && (subnode = select.call(node2, node2.__data__, i2, group))) { - if ("__data__" in node2) - subnode.__data__ = node2.__data__; - subgroup[i2] = subnode; - schedule(subgroup[i2], name, id2, i2, subgroup, get$2(node2, id2)); + if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) { + return null; } - } - } - return new Transition(subgroups, this._parents, name, id2); - } - function transition_selectAll(select) { - var name = this._name, id2 = this._id; - if (typeof select !== "function") - select = selectorAll(select); - for (var groups = this._groups, m = groups.length, subgroups = [], parents2 = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node2, i2 = 0; i2 < n; ++i2) { - if (node2 = group[i2]) { - for (var children2 = select.call(node2, node2.__data__, i2, group), child, inherit2 = get$2(node2, id2), k = 0, l = children2.length; k < l; ++k) { - if (child = children2[k]) { - schedule(child, name, id2, k, children2, inherit2); + return protocol[1].toLowerCase(); + }, "protocolFromUrl"); + utils = { + contains, + deflt, + escape: escape2, + hyphenate, + getBaseElem, + isCharacterBox, + protocolFromUrl + }; + SETTINGS_SCHEMA = { + displayMode: { + type: "boolean", + description: "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.", + cli: "-d, --display-mode" + }, + output: { + type: { + enum: ["htmlAndMathml", "html", "mathml"] + }, + description: "Determines the markup language of the output.", + cli: "-F, --format " + }, + leqno: { + type: "boolean", + description: "Render display math in leqno style (left-justified tags)." + }, + fleqn: { + type: "boolean", + description: "Render display math flush left." + }, + throwOnError: { + type: "boolean", + default: true, + cli: "-t, --no-throw-on-error", + cliDescription: "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error." + }, + errorColor: { + type: "string", + default: "#cc0000", + cli: "-c, --error-color ", + cliDescription: "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.", + cliProcessor: /* @__PURE__ */ __name((color2) => "#" + color2, "cliProcessor") + }, + macros: { + type: "object", + cli: "-m, --macro ", + cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).", + cliDefault: [], + cliProcessor: /* @__PURE__ */ __name((def2, defs2) => { + defs2.push(def2); + return defs2; + }, "cliProcessor") + }, + minRuleThickness: { + type: "number", + description: "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.", + processor: /* @__PURE__ */ __name((t4) => Math.max(0, t4), "processor"), + cli: "--min-rule-thickness ", + cliProcessor: parseFloat + }, + colorIsTextColor: { + type: "boolean", + description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.", + cli: "-b, --color-is-text-color" + }, + strict: { + type: [{ + enum: ["warn", "ignore", "error"] + }, "boolean", "function"], + description: "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.", + cli: "-S, --strict", + cliDefault: false + }, + trust: { + type: ["boolean", "function"], + description: "Trust the input, enabling all HTML features such as \\url.", + cli: "-T, --trust" + }, + maxSize: { + type: "number", + default: Infinity, + description: "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large", + processor: /* @__PURE__ */ __name((s2) => Math.max(0, s2), "processor"), + cli: "-s, --max-size ", + cliProcessor: parseInt + }, + maxExpand: { + type: "number", + default: 1e3, + description: "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.", + processor: /* @__PURE__ */ __name((n2) => Math.max(0, n2), "processor"), + cli: "-e, --max-expand ", + cliProcessor: /* @__PURE__ */ __name((n2) => n2 === "Infinity" ? Infinity : parseInt(n2), "cliProcessor") + }, + globalGroup: { + type: "boolean", + cli: false + } + }; + __name(getDefaultValue, "getDefaultValue"); + Settings = class { + static { + __name(this, "Settings"); + } + constructor(options3) { + this.displayMode = void 0; + this.output = void 0; + this.leqno = void 0; + this.fleqn = void 0; + this.throwOnError = void 0; + this.errorColor = void 0; + this.macros = void 0; + this.minRuleThickness = void 0; + this.colorIsTextColor = void 0; + this.strict = void 0; + this.trust = void 0; + this.maxSize = void 0; + this.maxExpand = void 0; + this.globalGroup = void 0; + options3 = options3 || {}; + for (var prop in SETTINGS_SCHEMA) { + if (SETTINGS_SCHEMA.hasOwnProperty(prop)) { + var schema2 = SETTINGS_SCHEMA[prop]; + this[prop] = options3[prop] !== void 0 ? schema2.processor ? schema2.processor(options3[prop]) : options3[prop] : getDefaultValue(schema2); + } + } + } + /** + * Report nonstrict (non-LaTeX-compatible) input. + * Can safely not be called if `this.strict` is false in JavaScript. + */ + reportNonstrict(errorCode, errorMsg, token2) { + var strict = this.strict; + if (typeof strict === "function") { + strict = strict(errorCode, errorMsg, token2); + } + if (!strict || strict === "ignore") { + return; + } else if (strict === true || strict === "error") { + throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token2); + } else if (strict === "warn") { + typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]")); + } else { + typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]")); + } + } + /** + * Check whether to apply strict (LaTeX-adhering) behavior for unusual + * input (like `\\`). Unlike `nonstrict`, will not throw an error; + * instead, "error" translates to a return value of `true`, while "ignore" + * translates to a return value of `false`. May still print a warning: + * "warn" prints a warning and returns `false`. + * This is for the second category of `errorCode`s listed in the README. + */ + useStrictBehavior(errorCode, errorMsg, token2) { + var strict = this.strict; + if (typeof strict === "function") { + try { + strict = strict(errorCode, errorMsg, token2); + } catch (error3) { + strict = "error"; } } - subgroups.push(children2); - parents2.push(node2); + if (!strict || strict === "ignore") { + return false; + } else if (strict === true || strict === "error") { + return true; + } else if (strict === "warn") { + typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]")); + return false; + } else { + typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]")); + return false; + } } - } - } - return new Transition(subgroups, parents2, name, id2); - } - var Selection = selection.prototype.constructor; - function transition_selection() { - return new Selection(this._groups, this._parents); - } - function styleNull(name, interpolate2) { - var string00, string10, interpolate0; - return function() { - var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, string10 = string1); - }; - } - function styleRemove(name) { - return function() { - this.style.removeProperty(name); - }; - } - function styleConstant(name, interpolate2, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = styleValue(this, name); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1); - }; - } - function styleFunction(name, interpolate2, value2) { - var string00, string10, interpolate0; - return function() { - var string0 = styleValue(this, name), value1 = value2(this), string1 = value1 + ""; - if (value1 == null) - string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1)); - }; - } - function styleMaybeRemove(id2, name) { - var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2; - return function() { - var schedule2 = set$2(this, id2), on = schedule2.on, listener = schedule2.value[key] == null ? remove2 || (remove2 = styleRemove(name)) : void 0; - if (on !== on0 || listener0 !== listener) - (on1 = (on0 = on).copy()).on(event, listener0 = listener); - schedule2.on = on1; - }; - } - function transition_style(name, value2, priority) { - var i2 = (name += "") === "transform" ? interpolateTransformCss : interpolate; - return value2 == null ? this.styleTween(name, styleNull(name, i2)).on("end.style." + name, styleRemove(name)) : typeof value2 === "function" ? this.styleTween(name, styleFunction(name, i2, tweenValue(this, "style." + name, value2))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant(name, i2, value2), priority).on("end.style." + name, null); - } - function styleInterpolate(name, i2, priority) { - return function(t) { - this.style.setProperty(name, i2.call(this, t), priority); - }; - } - function styleTween(name, value2, priority) { - var t, i0; - function tween() { - var i2 = value2.apply(this, arguments); - if (i2 !== i0) - t = (i0 = i2) && styleInterpolate(name, i2, priority); - return t; - } - tween._value = value2; - return tween; - } - function transition_styleTween(name, value2, priority) { - var key = "style." + (name += ""); - if (arguments.length < 2) - return (key = this.tween(key)) && key._value; - if (value2 == null) - return this.tween(key, null); - if (typeof value2 !== "function") - throw new Error(); - return this.tween(key, styleTween(name, value2, priority == null ? "" : priority)); - } - function textConstant(value2) { - return function() { - this.textContent = value2; - }; - } - function textFunction(value2) { - return function() { - var value1 = value2(this); - this.textContent = value1 == null ? "" : value1; - }; - } - function transition_text(value2) { - return this.tween("text", typeof value2 === "function" ? textFunction(tweenValue(this, "text", value2)) : textConstant(value2 == null ? "" : value2 + "")); - } - function textInterpolate(i2) { - return function(t) { - this.textContent = i2.call(this, t); - }; - } - function textTween(value2) { - var t02, i0; - function tween() { - var i2 = value2.apply(this, arguments); - if (i2 !== i0) - t02 = (i0 = i2) && textInterpolate(i2); - return t02; - } - tween._value = value2; - return tween; - } - function transition_textTween(value2) { - var key = "text"; - if (arguments.length < 1) - return (key = this.tween(key)) && key._value; - if (value2 == null) - return this.tween(key, null); - if (typeof value2 !== "function") - throw new Error(); - return this.tween(key, textTween(value2)); - } - function transition_transition() { - var name = this._name, id0 = this._id, id1 = newId(); - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node2, i2 = 0; i2 < n; ++i2) { - if (node2 = group[i2]) { - var inherit2 = get$2(node2, id0); - schedule(node2, name, id1, i2, group, { - time: inherit2.time + inherit2.delay + inherit2.duration, - delay: 0, - duration: inherit2.duration, - ease: inherit2.ease + /** + * Check whether to test potentially dangerous input, and return + * `true` (trusted) or `false` (untrusted). The sole argument `context` + * should be an object with `command` field specifying the relevant LaTeX + * command (as a string starting with `\`), and any other arguments, etc. + * If `context` has a `url` field, a `protocol` field will automatically + * get added by this function (changing the specified object). + */ + isTrusted(context) { + if (context.url && !context.protocol) { + var protocol = utils.protocolFromUrl(context.url); + if (protocol == null) { + return false; + } + context.protocol = protocol; + } + var trust = typeof this.trust === "function" ? this.trust(context) : this.trust; + return Boolean(trust); + } + }; + Style = class { + static { + __name(this, "Style"); + } + constructor(id26, size5, cramped) { + this.id = void 0; + this.size = void 0; + this.cramped = void 0; + this.id = id26; + this.size = size5; + this.cramped = cramped; + } + /** + * Get the style of a superscript given a base in the current style. + */ + sup() { + return styles[sup[this.id]]; + } + /** + * Get the style of a subscript given a base in the current style. + */ + sub() { + return styles[sub[this.id]]; + } + /** + * Get the style of a fraction numerator given the fraction in the current + * style. + */ + fracNum() { + return styles[fracNum[this.id]]; + } + /** + * Get the style of a fraction denominator given the fraction in the current + * style. + */ + fracDen() { + return styles[fracDen[this.id]]; + } + /** + * Get the cramped version of a style (in particular, cramping a cramped style + * doesn't change the style). + */ + cramp() { + return styles[cramp[this.id]]; + } + /** + * Get a text or display version of this style. + */ + text() { + return styles[text$1[this.id]]; + } + /** + * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle) + */ + isTight() { + return this.size >= 2; + } + }; + D = 0; + Dc = 1; + T = 2; + Tc = 3; + S = 4; + Sc = 5; + SS = 6; + SSc = 7; + styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)]; + sup = [S, Sc, S, Sc, SS, SSc, SS, SSc]; + sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc]; + fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc]; + fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc]; + cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc]; + text$1 = [D, Dc, T, Tc, T, Tc, T, Tc]; + Style$1 = { + DISPLAY: styles[D], + TEXT: styles[T], + SCRIPT: styles[S], + SCRIPTSCRIPT: styles[SS] + }; + scriptData = [{ + // Latin characters beyond the Latin-1 characters we have metrics for. + // Needed for Czech, Hungarian and Turkish text, for example. + name: "latin", + blocks: [ + [256, 591], + // Latin Extended-A and Latin Extended-B + [768, 879] + // Combining Diacritical marks + ] + }, { + // The Cyrillic script used by Russian and related languages. + // A Cyrillic subset used to be supported as explicitly defined + // symbols in symbols.js + name: "cyrillic", + blocks: [[1024, 1279]] + }, { + // Armenian + name: "armenian", + blocks: [[1328, 1423]] + }, { + // The Brahmic scripts of South and Southeast Asia + // Devanagari (0900–097F) + // Bengali (0980–09FF) + // Gurmukhi (0A00–0A7F) + // Gujarati (0A80–0AFF) + // Oriya (0B00–0B7F) + // Tamil (0B80–0BFF) + // Telugu (0C00–0C7F) + // Kannada (0C80–0CFF) + // Malayalam (0D00–0D7F) + // Sinhala (0D80–0DFF) + // Thai (0E00–0E7F) + // Lao (0E80–0EFF) + // Tibetan (0F00–0FFF) + // Myanmar (1000–109F) + name: "brahmic", + blocks: [[2304, 4255]] + }, { + name: "georgian", + blocks: [[4256, 4351]] + }, { + // Chinese and Japanese. + // The "k" in cjk is for Korean, but we've separated Korean out + name: "cjk", + blocks: [ + [12288, 12543], + // CJK symbols and punctuation, Hiragana, Katakana + [19968, 40879], + // CJK ideograms + [65280, 65376] + // Fullwidth punctuation + // TODO: add halfwidth Katakana and Romanji glyphs + ] + }, { + // Korean + name: "hangul", + blocks: [[44032, 55215]] + }]; + __name(scriptFromCodepoint, "scriptFromCodepoint"); + allBlocks = []; + scriptData.forEach((s2) => s2.blocks.forEach((b2) => allBlocks.push(...b2))); + __name(supportedCodepoint, "supportedCodepoint"); + hLinePad = 80; + sqrtMain = /* @__PURE__ */ __name(function sqrtMain2(extraVinculum, hLinePad2) { + return "M95," + (622 + extraVinculum + hLinePad2) + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + extraVinculum / 2.075 + " -" + extraVinculum + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + (40 + extraVinculum) + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + (834 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z"; + }, "sqrtMain"); + sqrtSize1 = /* @__PURE__ */ __name(function sqrtSize12(extraVinculum, hLinePad2) { + return "M263," + (601 + extraVinculum + hLinePad2) + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + extraVinculum / 2.084 + " -" + extraVinculum + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + (40 + extraVinculum) + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z"; + }, "sqrtSize1"); + sqrtSize2 = /* @__PURE__ */ __name(function sqrtSize22(extraVinculum, hLinePad2) { + return "M983 " + (10 + extraVinculum + hLinePad2) + "\nl" + extraVinculum / 3.13 + " -" + extraVinculum + "\nc4,-6.7,10,-10,18,-10 H400000v" + (40 + extraVinculum) + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z"; + }, "sqrtSize2"); + sqrtSize3 = /* @__PURE__ */ __name(function sqrtSize32(extraVinculum, hLinePad2) { + return "M424," + (2398 + extraVinculum + hLinePad2) + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + extraVinculum / 4.223 + " -" + extraVinculum + "c4,-6.7,10,-10,18,-10 H400000\nv" + (40 + extraVinculum) + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + (1001 + extraVinculum) + " " + hLinePad2 + "\nh400000v" + (40 + extraVinculum) + "h-400000z"; + }, "sqrtSize3"); + sqrtSize4 = /* @__PURE__ */ __name(function sqrtSize42(extraVinculum, hLinePad2) { + return "M473," + (2713 + extraVinculum + hLinePad2) + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + extraVinculum / 5.298 + " -" + extraVinculum + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + (40 + extraVinculum) + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "H1017.7z"; + }, "sqrtSize4"); + phasePath = /* @__PURE__ */ __name(function phasePath2(y5) { + var x5 = y5 / 2; + return "M400000 " + y5 + " H0 L" + x5 + " 0 l65 45 L145 " + (y5 - 80) + " H400000z"; + }, "phasePath"); + sqrtTall = /* @__PURE__ */ __name(function sqrtTall2(extraVinculum, hLinePad2, viewBoxHeight) { + var vertSegment = viewBoxHeight - 54 - hLinePad2 - extraVinculum; + return "M702 " + (extraVinculum + hLinePad2) + "H400000" + (40 + extraVinculum) + "\nH742v" + vertSegment + "l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 " + hLinePad2 + "H400000v" + (40 + extraVinculum) + "H742z"; + }, "sqrtTall"); + sqrtPath = /* @__PURE__ */ __name(function sqrtPath2(size5, extraVinculum, viewBoxHeight) { + extraVinculum = 1e3 * extraVinculum; + var path4 = ""; + switch (size5) { + case "sqrtMain": + path4 = sqrtMain(extraVinculum, hLinePad); + break; + case "sqrtSize1": + path4 = sqrtSize1(extraVinculum, hLinePad); + break; + case "sqrtSize2": + path4 = sqrtSize2(extraVinculum, hLinePad); + break; + case "sqrtSize3": + path4 = sqrtSize3(extraVinculum, hLinePad); + break; + case "sqrtSize4": + path4 = sqrtSize4(extraVinculum, hLinePad); + break; + case "sqrtTall": + path4 = sqrtTall(extraVinculum, hLinePad, viewBoxHeight); + } + return path4; + }, "sqrtPath"); + innerPath = /* @__PURE__ */ __name(function innerPath2(name, height2) { + switch (name) { + case "\u239C": + return "M291 0 H417 V" + height2 + " H291z M291 0 H417 V" + height2 + " H291z"; + case "\u2223": + return "M145 0 H188 V" + height2 + " H145z M145 0 H188 V" + height2 + " H145z"; + case "\u2225": + return "M145 0 H188 V" + height2 + " H145z M145 0 H188 V" + height2 + " H145z" + ("M367 0 H410 V" + height2 + " H367z M367 0 H410 V" + height2 + " H367z"); + case "\u239F": + return "M457 0 H583 V" + height2 + " H457z M457 0 H583 V" + height2 + " H457z"; + case "\u23A2": + return "M319 0 H403 V" + height2 + " H319z M319 0 H403 V" + height2 + " H319z"; + case "\u23A5": + return "M263 0 H347 V" + height2 + " H263z M263 0 H347 V" + height2 + " H263z"; + case "\u23AA": + return "M384 0 H504 V" + height2 + " H384z M384 0 H504 V" + height2 + " H384z"; + case "\u23D0": + return "M312 0 H355 V" + height2 + " H312z M312 0 H355 V" + height2 + " H312z"; + case "\u2016": + return "M257 0 H300 V" + height2 + " H257z M257 0 H300 V" + height2 + " H257z" + ("M478 0 H521 V" + height2 + " H478z M478 0 H521 V" + height2 + " H478z"); + default: + return ""; + } + }, "innerPath"); + path = { + // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main + doubleleftarrow: "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z", + // doublerightarrow is from glyph U+21D2 in font KaTeX Main + doublerightarrow: "M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z", + // leftarrow is from glyph U+2190 in font KaTeX Main + leftarrow: "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z", + // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular + leftbrace: "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z", + leftbraceunder: "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z", + // overgroup is from the MnSymbol package (public domain) + leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z", + leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z", + // Harpoons are from glyph U+21BD in font KaTeX Main + leftharpoon: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z", + leftharpoonplus: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z", + leftharpoondown: "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z", + leftharpoondownplus: "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z", + // hook is from glyph U+21A9 in font KaTeX Main + lefthook: "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z", + leftlinesegment: "M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z", + leftmapsto: "M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z", + // tofrom is from glyph U+21C4 in font KaTeX AMS Regular + leftToFrom: "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z", + longequal: "M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z", + midbrace: "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z", + midbraceunder: "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z", + oiintSize1: "M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z", + oiintSize2: "M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z", + oiiintSize1: "M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z", + oiiintSize2: "M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z", + rightarrow: "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z", + rightbrace: "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z", + rightbraceunder: "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z", + rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z", + rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z", + rightharpoon: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z", + rightharpoonplus: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z", + rightharpoondown: "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z", + rightharpoondownplus: "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z", + righthook: "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z", + rightlinesegment: "M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z", + rightToFrom: "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z", + // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular + twoheadleftarrow: "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z", + twoheadrightarrow: "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z", + // tilde1 is a modified version of a glyph from the MnSymbol package + tilde1: "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z", + // ditto tilde2, tilde3, & tilde4 + tilde2: "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z", + tilde3: "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z", + tilde4: "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z", + // vec is from glyph U+20D7 in font KaTeX Main + vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z", + // widehat1 is a modified version of a glyph from the MnSymbol package + widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z", + // ditto widehat2, widehat3, & widehat4 + widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", + widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", + widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", + // widecheck paths are all inverted versions of widehat + widecheck1: "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z", + widecheck2: "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", + widecheck3: "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", + widecheck4: "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", + // The next ten paths support reaction arrows from the mhchem package. + // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX + // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main + baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z", + // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main + rightarrowabovebar: "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z", + // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end. + // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em + baraboveshortleftharpoon: "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z", + rightharpoonaboveshortbar: "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z", + shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z", + shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z" + }; + tallDelim = /* @__PURE__ */ __name(function tallDelim2(label, midHeight) { + switch (label) { + case "lbrack": + return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + midHeight + " v1759 h84z"; + case "rbrack": + return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v" + midHeight + " v1759 h84z"; + case "vert": + return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z"; + case "doublevert": + return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z\nM367 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v" + midHeight + " v585 h43z"; + case "lfloor": + return "M319 602 V0 H403 V602 v" + midHeight + " v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z"; + case "rfloor": + return "M319 602 V0 H403 V602 v" + midHeight + " v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z"; + case "lceil": + return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v602 h84z\nM403 1759 V0 H319 V1759 v" + midHeight + " v602 h84z"; + case "rceil": + return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v602 h84z\nM347 1759 V0 h-84 V1759 v" + midHeight + " v602 h84z"; + case "lparen": + return "M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0," + (midHeight + 84) + "c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-" + (midHeight + 92) + "c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z"; + case "rparen": + return "M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0," + (midHeight + 9) + "\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-" + (midHeight + 144) + "c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z"; + default: + throw new Error("Unknown stretchy delimiter."); + } + }, "tallDelim"); + DocumentFragment = class { + static { + __name(this, "DocumentFragment"); + } + // HtmlDomNode + // Never used; needed for satisfying interface. + constructor(children2) { + this.children = void 0; + this.classes = void 0; + this.height = void 0; + this.depth = void 0; + this.maxFontSize = void 0; + this.style = void 0; + this.children = children2; + this.classes = []; + this.height = 0; + this.depth = 0; + this.maxFontSize = 0; + this.style = {}; + } + hasClass(className) { + return utils.contains(this.classes, className); + } + /** Convert the fragment into a node. */ + toNode() { + var frag = document.createDocumentFragment(); + for (var i2 = 0; i2 < this.children.length; i2++) { + frag.appendChild(this.children[i2].toNode()); + } + return frag; + } + /** Convert the fragment into HTML markup. */ + toMarkup() { + var markup = ""; + for (var i2 = 0; i2 < this.children.length; i2++) { + markup += this.children[i2].toMarkup(); + } + return markup; + } + /** + * Converts the math node into a string, similar to innerText. Applies to + * MathDomNode's only. + */ + toText() { + var toText = /* @__PURE__ */ __name((child) => child.toText(), "toText"); + return this.children.map(toText).join(""); + } + }; + fontMetricsData = { + "AMS-Regular": { + "32": [0, 0, 0, 0, 0.25], + "65": [0, 0.68889, 0, 0, 0.72222], + "66": [0, 0.68889, 0, 0, 0.66667], + "67": [0, 0.68889, 0, 0, 0.72222], + "68": [0, 0.68889, 0, 0, 0.72222], + "69": [0, 0.68889, 0, 0, 0.66667], + "70": [0, 0.68889, 0, 0, 0.61111], + "71": [0, 0.68889, 0, 0, 0.77778], + "72": [0, 0.68889, 0, 0, 0.77778], + "73": [0, 0.68889, 0, 0, 0.38889], + "74": [0.16667, 0.68889, 0, 0, 0.5], + "75": [0, 0.68889, 0, 0, 0.77778], + "76": [0, 0.68889, 0, 0, 0.66667], + "77": [0, 0.68889, 0, 0, 0.94445], + "78": [0, 0.68889, 0, 0, 0.72222], + "79": [0.16667, 0.68889, 0, 0, 0.77778], + "80": [0, 0.68889, 0, 0, 0.61111], + "81": [0.16667, 0.68889, 0, 0, 0.77778], + "82": [0, 0.68889, 0, 0, 0.72222], + "83": [0, 0.68889, 0, 0, 0.55556], + "84": [0, 0.68889, 0, 0, 0.66667], + "85": [0, 0.68889, 0, 0, 0.72222], + "86": [0, 0.68889, 0, 0, 0.72222], + "87": [0, 0.68889, 0, 0, 1], + "88": [0, 0.68889, 0, 0, 0.72222], + "89": [0, 0.68889, 0, 0, 0.72222], + "90": [0, 0.68889, 0, 0, 0.66667], + "107": [0, 0.68889, 0, 0, 0.55556], + "160": [0, 0, 0, 0, 0.25], + "165": [0, 0.675, 0.025, 0, 0.75], + "174": [0.15559, 0.69224, 0, 0, 0.94666], + "240": [0, 0.68889, 0, 0, 0.55556], + "295": [0, 0.68889, 0, 0, 0.54028], + "710": [0, 0.825, 0, 0, 2.33334], + "732": [0, 0.9, 0, 0, 2.33334], + "770": [0, 0.825, 0, 0, 2.33334], + "771": [0, 0.9, 0, 0, 2.33334], + "989": [0.08167, 0.58167, 0, 0, 0.77778], + "1008": [0, 0.43056, 0.04028, 0, 0.66667], + "8245": [0, 0.54986, 0, 0, 0.275], + "8463": [0, 0.68889, 0, 0, 0.54028], + "8487": [0, 0.68889, 0, 0, 0.72222], + "8498": [0, 0.68889, 0, 0, 0.55556], + "8502": [0, 0.68889, 0, 0, 0.66667], + "8503": [0, 0.68889, 0, 0, 0.44445], + "8504": [0, 0.68889, 0, 0, 0.66667], + "8513": [0, 0.68889, 0, 0, 0.63889], + "8592": [-0.03598, 0.46402, 0, 0, 0.5], + "8594": [-0.03598, 0.46402, 0, 0, 0.5], + "8602": [-0.13313, 0.36687, 0, 0, 1], + "8603": [-0.13313, 0.36687, 0, 0, 1], + "8606": [0.01354, 0.52239, 0, 0, 1], + "8608": [0.01354, 0.52239, 0, 0, 1], + "8610": [0.01354, 0.52239, 0, 0, 1.11111], + "8611": [0.01354, 0.52239, 0, 0, 1.11111], + "8619": [0, 0.54986, 0, 0, 1], + "8620": [0, 0.54986, 0, 0, 1], + "8621": [-0.13313, 0.37788, 0, 0, 1.38889], + "8622": [-0.13313, 0.36687, 0, 0, 1], + "8624": [0, 0.69224, 0, 0, 0.5], + "8625": [0, 0.69224, 0, 0, 0.5], + "8630": [0, 0.43056, 0, 0, 1], + "8631": [0, 0.43056, 0, 0, 1], + "8634": [0.08198, 0.58198, 0, 0, 0.77778], + "8635": [0.08198, 0.58198, 0, 0, 0.77778], + "8638": [0.19444, 0.69224, 0, 0, 0.41667], + "8639": [0.19444, 0.69224, 0, 0, 0.41667], + "8642": [0.19444, 0.69224, 0, 0, 0.41667], + "8643": [0.19444, 0.69224, 0, 0, 0.41667], + "8644": [0.1808, 0.675, 0, 0, 1], + "8646": [0.1808, 0.675, 0, 0, 1], + "8647": [0.1808, 0.675, 0, 0, 1], + "8648": [0.19444, 0.69224, 0, 0, 0.83334], + "8649": [0.1808, 0.675, 0, 0, 1], + "8650": [0.19444, 0.69224, 0, 0, 0.83334], + "8651": [0.01354, 0.52239, 0, 0, 1], + "8652": [0.01354, 0.52239, 0, 0, 1], + "8653": [-0.13313, 0.36687, 0, 0, 1], + "8654": [-0.13313, 0.36687, 0, 0, 1], + "8655": [-0.13313, 0.36687, 0, 0, 1], + "8666": [0.13667, 0.63667, 0, 0, 1], + "8667": [0.13667, 0.63667, 0, 0, 1], + "8669": [-0.13313, 0.37788, 0, 0, 1], + "8672": [-0.064, 0.437, 0, 0, 1.334], + "8674": [-0.064, 0.437, 0, 0, 1.334], + "8705": [0, 0.825, 0, 0, 0.5], + "8708": [0, 0.68889, 0, 0, 0.55556], + "8709": [0.08167, 0.58167, 0, 0, 0.77778], + "8717": [0, 0.43056, 0, 0, 0.42917], + "8722": [-0.03598, 0.46402, 0, 0, 0.5], + "8724": [0.08198, 0.69224, 0, 0, 0.77778], + "8726": [0.08167, 0.58167, 0, 0, 0.77778], + "8733": [0, 0.69224, 0, 0, 0.77778], + "8736": [0, 0.69224, 0, 0, 0.72222], + "8737": [0, 0.69224, 0, 0, 0.72222], + "8738": [0.03517, 0.52239, 0, 0, 0.72222], + "8739": [0.08167, 0.58167, 0, 0, 0.22222], + "8740": [0.25142, 0.74111, 0, 0, 0.27778], + "8741": [0.08167, 0.58167, 0, 0, 0.38889], + "8742": [0.25142, 0.74111, 0, 0, 0.5], + "8756": [0, 0.69224, 0, 0, 0.66667], + "8757": [0, 0.69224, 0, 0, 0.66667], + "8764": [-0.13313, 0.36687, 0, 0, 0.77778], + "8765": [-0.13313, 0.37788, 0, 0, 0.77778], + "8769": [-0.13313, 0.36687, 0, 0, 0.77778], + "8770": [-0.03625, 0.46375, 0, 0, 0.77778], + "8774": [0.30274, 0.79383, 0, 0, 0.77778], + "8776": [-0.01688, 0.48312, 0, 0, 0.77778], + "8778": [0.08167, 0.58167, 0, 0, 0.77778], + "8782": [0.06062, 0.54986, 0, 0, 0.77778], + "8783": [0.06062, 0.54986, 0, 0, 0.77778], + "8785": [0.08198, 0.58198, 0, 0, 0.77778], + "8786": [0.08198, 0.58198, 0, 0, 0.77778], + "8787": [0.08198, 0.58198, 0, 0, 0.77778], + "8790": [0, 0.69224, 0, 0, 0.77778], + "8791": [0.22958, 0.72958, 0, 0, 0.77778], + "8796": [0.08198, 0.91667, 0, 0, 0.77778], + "8806": [0.25583, 0.75583, 0, 0, 0.77778], + "8807": [0.25583, 0.75583, 0, 0, 0.77778], + "8808": [0.25142, 0.75726, 0, 0, 0.77778], + "8809": [0.25142, 0.75726, 0, 0, 0.77778], + "8812": [0.25583, 0.75583, 0, 0, 0.5], + "8814": [0.20576, 0.70576, 0, 0, 0.77778], + "8815": [0.20576, 0.70576, 0, 0, 0.77778], + "8816": [0.30274, 0.79383, 0, 0, 0.77778], + "8817": [0.30274, 0.79383, 0, 0, 0.77778], + "8818": [0.22958, 0.72958, 0, 0, 0.77778], + "8819": [0.22958, 0.72958, 0, 0, 0.77778], + "8822": [0.1808, 0.675, 0, 0, 0.77778], + "8823": [0.1808, 0.675, 0, 0, 0.77778], + "8828": [0.13667, 0.63667, 0, 0, 0.77778], + "8829": [0.13667, 0.63667, 0, 0, 0.77778], + "8830": [0.22958, 0.72958, 0, 0, 0.77778], + "8831": [0.22958, 0.72958, 0, 0, 0.77778], + "8832": [0.20576, 0.70576, 0, 0, 0.77778], + "8833": [0.20576, 0.70576, 0, 0, 0.77778], + "8840": [0.30274, 0.79383, 0, 0, 0.77778], + "8841": [0.30274, 0.79383, 0, 0, 0.77778], + "8842": [0.13597, 0.63597, 0, 0, 0.77778], + "8843": [0.13597, 0.63597, 0, 0, 0.77778], + "8847": [0.03517, 0.54986, 0, 0, 0.77778], + "8848": [0.03517, 0.54986, 0, 0, 0.77778], + "8858": [0.08198, 0.58198, 0, 0, 0.77778], + "8859": [0.08198, 0.58198, 0, 0, 0.77778], + "8861": [0.08198, 0.58198, 0, 0, 0.77778], + "8862": [0, 0.675, 0, 0, 0.77778], + "8863": [0, 0.675, 0, 0, 0.77778], + "8864": [0, 0.675, 0, 0, 0.77778], + "8865": [0, 0.675, 0, 0, 0.77778], + "8872": [0, 0.69224, 0, 0, 0.61111], + "8873": [0, 0.69224, 0, 0, 0.72222], + "8874": [0, 0.69224, 0, 0, 0.88889], + "8876": [0, 0.68889, 0, 0, 0.61111], + "8877": [0, 0.68889, 0, 0, 0.61111], + "8878": [0, 0.68889, 0, 0, 0.72222], + "8879": [0, 0.68889, 0, 0, 0.72222], + "8882": [0.03517, 0.54986, 0, 0, 0.77778], + "8883": [0.03517, 0.54986, 0, 0, 0.77778], + "8884": [0.13667, 0.63667, 0, 0, 0.77778], + "8885": [0.13667, 0.63667, 0, 0, 0.77778], + "8888": [0, 0.54986, 0, 0, 1.11111], + "8890": [0.19444, 0.43056, 0, 0, 0.55556], + "8891": [0.19444, 0.69224, 0, 0, 0.61111], + "8892": [0.19444, 0.69224, 0, 0, 0.61111], + "8901": [0, 0.54986, 0, 0, 0.27778], + "8903": [0.08167, 0.58167, 0, 0, 0.77778], + "8905": [0.08167, 0.58167, 0, 0, 0.77778], + "8906": [0.08167, 0.58167, 0, 0, 0.77778], + "8907": [0, 0.69224, 0, 0, 0.77778], + "8908": [0, 0.69224, 0, 0, 0.77778], + "8909": [-0.03598, 0.46402, 0, 0, 0.77778], + "8910": [0, 0.54986, 0, 0, 0.76042], + "8911": [0, 0.54986, 0, 0, 0.76042], + "8912": [0.03517, 0.54986, 0, 0, 0.77778], + "8913": [0.03517, 0.54986, 0, 0, 0.77778], + "8914": [0, 0.54986, 0, 0, 0.66667], + "8915": [0, 0.54986, 0, 0, 0.66667], + "8916": [0, 0.69224, 0, 0, 0.66667], + "8918": [0.0391, 0.5391, 0, 0, 0.77778], + "8919": [0.0391, 0.5391, 0, 0, 0.77778], + "8920": [0.03517, 0.54986, 0, 0, 1.33334], + "8921": [0.03517, 0.54986, 0, 0, 1.33334], + "8922": [0.38569, 0.88569, 0, 0, 0.77778], + "8923": [0.38569, 0.88569, 0, 0, 0.77778], + "8926": [0.13667, 0.63667, 0, 0, 0.77778], + "8927": [0.13667, 0.63667, 0, 0, 0.77778], + "8928": [0.30274, 0.79383, 0, 0, 0.77778], + "8929": [0.30274, 0.79383, 0, 0, 0.77778], + "8934": [0.23222, 0.74111, 0, 0, 0.77778], + "8935": [0.23222, 0.74111, 0, 0, 0.77778], + "8936": [0.23222, 0.74111, 0, 0, 0.77778], + "8937": [0.23222, 0.74111, 0, 0, 0.77778], + "8938": [0.20576, 0.70576, 0, 0, 0.77778], + "8939": [0.20576, 0.70576, 0, 0, 0.77778], + "8940": [0.30274, 0.79383, 0, 0, 0.77778], + "8941": [0.30274, 0.79383, 0, 0, 0.77778], + "8994": [0.19444, 0.69224, 0, 0, 0.77778], + "8995": [0.19444, 0.69224, 0, 0, 0.77778], + "9416": [0.15559, 0.69224, 0, 0, 0.90222], + "9484": [0, 0.69224, 0, 0, 0.5], + "9488": [0, 0.69224, 0, 0, 0.5], + "9492": [0, 0.37788, 0, 0, 0.5], + "9496": [0, 0.37788, 0, 0, 0.5], + "9585": [0.19444, 0.68889, 0, 0, 0.88889], + "9586": [0.19444, 0.74111, 0, 0, 0.88889], + "9632": [0, 0.675, 0, 0, 0.77778], + "9633": [0, 0.675, 0, 0, 0.77778], + "9650": [0, 0.54986, 0, 0, 0.72222], + "9651": [0, 0.54986, 0, 0, 0.72222], + "9654": [0.03517, 0.54986, 0, 0, 0.77778], + "9660": [0, 0.54986, 0, 0, 0.72222], + "9661": [0, 0.54986, 0, 0, 0.72222], + "9664": [0.03517, 0.54986, 0, 0, 0.77778], + "9674": [0.11111, 0.69224, 0, 0, 0.66667], + "9733": [0.19444, 0.69224, 0, 0, 0.94445], + "10003": [0, 0.69224, 0, 0, 0.83334], + "10016": [0, 0.69224, 0, 0, 0.83334], + "10731": [0.11111, 0.69224, 0, 0, 0.66667], + "10846": [0.19444, 0.75583, 0, 0, 0.61111], + "10877": [0.13667, 0.63667, 0, 0, 0.77778], + "10878": [0.13667, 0.63667, 0, 0, 0.77778], + "10885": [0.25583, 0.75583, 0, 0, 0.77778], + "10886": [0.25583, 0.75583, 0, 0, 0.77778], + "10887": [0.13597, 0.63597, 0, 0, 0.77778], + "10888": [0.13597, 0.63597, 0, 0, 0.77778], + "10889": [0.26167, 0.75726, 0, 0, 0.77778], + "10890": [0.26167, 0.75726, 0, 0, 0.77778], + "10891": [0.48256, 0.98256, 0, 0, 0.77778], + "10892": [0.48256, 0.98256, 0, 0, 0.77778], + "10901": [0.13667, 0.63667, 0, 0, 0.77778], + "10902": [0.13667, 0.63667, 0, 0, 0.77778], + "10933": [0.25142, 0.75726, 0, 0, 0.77778], + "10934": [0.25142, 0.75726, 0, 0, 0.77778], + "10935": [0.26167, 0.75726, 0, 0, 0.77778], + "10936": [0.26167, 0.75726, 0, 0, 0.77778], + "10937": [0.26167, 0.75726, 0, 0, 0.77778], + "10938": [0.26167, 0.75726, 0, 0, 0.77778], + "10949": [0.25583, 0.75583, 0, 0, 0.77778], + "10950": [0.25583, 0.75583, 0, 0, 0.77778], + "10955": [0.28481, 0.79383, 0, 0, 0.77778], + "10956": [0.28481, 0.79383, 0, 0, 0.77778], + "57350": [0.08167, 0.58167, 0, 0, 0.22222], + "57351": [0.08167, 0.58167, 0, 0, 0.38889], + "57352": [0.08167, 0.58167, 0, 0, 0.77778], + "57353": [0, 0.43056, 0.04028, 0, 0.66667], + "57356": [0.25142, 0.75726, 0, 0, 0.77778], + "57357": [0.25142, 0.75726, 0, 0, 0.77778], + "57358": [0.41951, 0.91951, 0, 0, 0.77778], + "57359": [0.30274, 0.79383, 0, 0, 0.77778], + "57360": [0.30274, 0.79383, 0, 0, 0.77778], + "57361": [0.41951, 0.91951, 0, 0, 0.77778], + "57366": [0.25142, 0.75726, 0, 0, 0.77778], + "57367": [0.25142, 0.75726, 0, 0, 0.77778], + "57368": [0.25142, 0.75726, 0, 0, 0.77778], + "57369": [0.25142, 0.75726, 0, 0, 0.77778], + "57370": [0.13597, 0.63597, 0, 0, 0.77778], + "57371": [0.13597, 0.63597, 0, 0, 0.77778] + }, + "Caligraphic-Regular": { + "32": [0, 0, 0, 0, 0.25], + "65": [0, 0.68333, 0, 0.19445, 0.79847], + "66": [0, 0.68333, 0.03041, 0.13889, 0.65681], + "67": [0, 0.68333, 0.05834, 0.13889, 0.52653], + "68": [0, 0.68333, 0.02778, 0.08334, 0.77139], + "69": [0, 0.68333, 0.08944, 0.11111, 0.52778], + "70": [0, 0.68333, 0.09931, 0.11111, 0.71875], + "71": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487], + "72": [0, 0.68333, 965e-5, 0.11111, 0.84452], + "73": [0, 0.68333, 0.07382, 0, 0.54452], + "74": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778], + "75": [0, 0.68333, 0.01445, 0.05556, 0.76195], + "76": [0, 0.68333, 0, 0.13889, 0.68972], + "77": [0, 0.68333, 0, 0.13889, 1.2009], + "78": [0, 0.68333, 0.14736, 0.08334, 0.82049], + "79": [0, 0.68333, 0.02778, 0.11111, 0.79611], + "80": [0, 0.68333, 0.08222, 0.08334, 0.69556], + "81": [0.09722, 0.68333, 0, 0.11111, 0.81667], + "82": [0, 0.68333, 0, 0.08334, 0.8475], + "83": [0, 0.68333, 0.075, 0.13889, 0.60556], + "84": [0, 0.68333, 0.25417, 0, 0.54464], + "85": [0, 0.68333, 0.09931, 0.08334, 0.62583], + "86": [0, 0.68333, 0.08222, 0, 0.61278], + "87": [0, 0.68333, 0.08222, 0.08334, 0.98778], + "88": [0, 0.68333, 0.14643, 0.13889, 0.7133], + "89": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834], + "90": [0, 0.68333, 0.07944, 0.13889, 0.72473], + "160": [0, 0, 0, 0, 0.25] + }, + "Fraktur-Regular": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69141, 0, 0, 0.29574], + "34": [0, 0.69141, 0, 0, 0.21471], + "38": [0, 0.69141, 0, 0, 0.73786], + "39": [0, 0.69141, 0, 0, 0.21201], + "40": [0.24982, 0.74947, 0, 0, 0.38865], + "41": [0.24982, 0.74947, 0, 0, 0.38865], + "42": [0, 0.62119, 0, 0, 0.27764], + "43": [0.08319, 0.58283, 0, 0, 0.75623], + "44": [0, 0.10803, 0, 0, 0.27764], + "45": [0.08319, 0.58283, 0, 0, 0.75623], + "46": [0, 0.10803, 0, 0, 0.27764], + "47": [0.24982, 0.74947, 0, 0, 0.50181], + "48": [0, 0.47534, 0, 0, 0.50181], + "49": [0, 0.47534, 0, 0, 0.50181], + "50": [0, 0.47534, 0, 0, 0.50181], + "51": [0.18906, 0.47534, 0, 0, 0.50181], + "52": [0.18906, 0.47534, 0, 0, 0.50181], + "53": [0.18906, 0.47534, 0, 0, 0.50181], + "54": [0, 0.69141, 0, 0, 0.50181], + "55": [0.18906, 0.47534, 0, 0, 0.50181], + "56": [0, 0.69141, 0, 0, 0.50181], + "57": [0.18906, 0.47534, 0, 0, 0.50181], + "58": [0, 0.47534, 0, 0, 0.21606], + "59": [0.12604, 0.47534, 0, 0, 0.21606], + "61": [-0.13099, 0.36866, 0, 0, 0.75623], + "63": [0, 0.69141, 0, 0, 0.36245], + "65": [0, 0.69141, 0, 0, 0.7176], + "66": [0, 0.69141, 0, 0, 0.88397], + "67": [0, 0.69141, 0, 0, 0.61254], + "68": [0, 0.69141, 0, 0, 0.83158], + "69": [0, 0.69141, 0, 0, 0.66278], + "70": [0.12604, 0.69141, 0, 0, 0.61119], + "71": [0, 0.69141, 0, 0, 0.78539], + "72": [0.06302, 0.69141, 0, 0, 0.7203], + "73": [0, 0.69141, 0, 0, 0.55448], + "74": [0.12604, 0.69141, 0, 0, 0.55231], + "75": [0, 0.69141, 0, 0, 0.66845], + "76": [0, 0.69141, 0, 0, 0.66602], + "77": [0, 0.69141, 0, 0, 1.04953], + "78": [0, 0.69141, 0, 0, 0.83212], + "79": [0, 0.69141, 0, 0, 0.82699], + "80": [0.18906, 0.69141, 0, 0, 0.82753], + "81": [0.03781, 0.69141, 0, 0, 0.82699], + "82": [0, 0.69141, 0, 0, 0.82807], + "83": [0, 0.69141, 0, 0, 0.82861], + "84": [0, 0.69141, 0, 0, 0.66899], + "85": [0, 0.69141, 0, 0, 0.64576], + "86": [0, 0.69141, 0, 0, 0.83131], + "87": [0, 0.69141, 0, 0, 1.04602], + "88": [0, 0.69141, 0, 0, 0.71922], + "89": [0.18906, 0.69141, 0, 0, 0.83293], + "90": [0.12604, 0.69141, 0, 0, 0.60201], + "91": [0.24982, 0.74947, 0, 0, 0.27764], + "93": [0.24982, 0.74947, 0, 0, 0.27764], + "94": [0, 0.69141, 0, 0, 0.49965], + "97": [0, 0.47534, 0, 0, 0.50046], + "98": [0, 0.69141, 0, 0, 0.51315], + "99": [0, 0.47534, 0, 0, 0.38946], + "100": [0, 0.62119, 0, 0, 0.49857], + "101": [0, 0.47534, 0, 0, 0.40053], + "102": [0.18906, 0.69141, 0, 0, 0.32626], + "103": [0.18906, 0.47534, 0, 0, 0.5037], + "104": [0.18906, 0.69141, 0, 0, 0.52126], + "105": [0, 0.69141, 0, 0, 0.27899], + "106": [0, 0.69141, 0, 0, 0.28088], + "107": [0, 0.69141, 0, 0, 0.38946], + "108": [0, 0.69141, 0, 0, 0.27953], + "109": [0, 0.47534, 0, 0, 0.76676], + "110": [0, 0.47534, 0, 0, 0.52666], + "111": [0, 0.47534, 0, 0, 0.48885], + "112": [0.18906, 0.52396, 0, 0, 0.50046], + "113": [0.18906, 0.47534, 0, 0, 0.48912], + "114": [0, 0.47534, 0, 0, 0.38919], + "115": [0, 0.47534, 0, 0, 0.44266], + "116": [0, 0.62119, 0, 0, 0.33301], + "117": [0, 0.47534, 0, 0, 0.5172], + "118": [0, 0.52396, 0, 0, 0.5118], + "119": [0, 0.52396, 0, 0, 0.77351], + "120": [0.18906, 0.47534, 0, 0, 0.38865], + "121": [0.18906, 0.47534, 0, 0, 0.49884], + "122": [0.18906, 0.47534, 0, 0, 0.39054], + "160": [0, 0, 0, 0, 0.25], + "8216": [0, 0.69141, 0, 0, 0.21471], + "8217": [0, 0.69141, 0, 0, 0.21471], + "58112": [0, 0.62119, 0, 0, 0.49749], + "58113": [0, 0.62119, 0, 0, 0.4983], + "58114": [0.18906, 0.69141, 0, 0, 0.33328], + "58115": [0.18906, 0.69141, 0, 0, 0.32923], + "58116": [0.18906, 0.47534, 0, 0, 0.50343], + "58117": [0, 0.69141, 0, 0, 0.33301], + "58118": [0, 0.62119, 0, 0, 0.33409], + "58119": [0, 0.47534, 0, 0, 0.50073] + }, + "Main-Bold": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69444, 0, 0, 0.35], + "34": [0, 0.69444, 0, 0, 0.60278], + "35": [0.19444, 0.69444, 0, 0, 0.95833], + "36": [0.05556, 0.75, 0, 0, 0.575], + "37": [0.05556, 0.75, 0, 0, 0.95833], + "38": [0, 0.69444, 0, 0, 0.89444], + "39": [0, 0.69444, 0, 0, 0.31944], + "40": [0.25, 0.75, 0, 0, 0.44722], + "41": [0.25, 0.75, 0, 0, 0.44722], + "42": [0, 0.75, 0, 0, 0.575], + "43": [0.13333, 0.63333, 0, 0, 0.89444], + "44": [0.19444, 0.15556, 0, 0, 0.31944], + "45": [0, 0.44444, 0, 0, 0.38333], + "46": [0, 0.15556, 0, 0, 0.31944], + "47": [0.25, 0.75, 0, 0, 0.575], + "48": [0, 0.64444, 0, 0, 0.575], + "49": [0, 0.64444, 0, 0, 0.575], + "50": [0, 0.64444, 0, 0, 0.575], + "51": [0, 0.64444, 0, 0, 0.575], + "52": [0, 0.64444, 0, 0, 0.575], + "53": [0, 0.64444, 0, 0, 0.575], + "54": [0, 0.64444, 0, 0, 0.575], + "55": [0, 0.64444, 0, 0, 0.575], + "56": [0, 0.64444, 0, 0, 0.575], + "57": [0, 0.64444, 0, 0, 0.575], + "58": [0, 0.44444, 0, 0, 0.31944], + "59": [0.19444, 0.44444, 0, 0, 0.31944], + "60": [0.08556, 0.58556, 0, 0, 0.89444], + "61": [-0.10889, 0.39111, 0, 0, 0.89444], + "62": [0.08556, 0.58556, 0, 0, 0.89444], + "63": [0, 0.69444, 0, 0, 0.54305], + "64": [0, 0.69444, 0, 0, 0.89444], + "65": [0, 0.68611, 0, 0, 0.86944], + "66": [0, 0.68611, 0, 0, 0.81805], + "67": [0, 0.68611, 0, 0, 0.83055], + "68": [0, 0.68611, 0, 0, 0.88194], + "69": [0, 0.68611, 0, 0, 0.75555], + "70": [0, 0.68611, 0, 0, 0.72361], + "71": [0, 0.68611, 0, 0, 0.90416], + "72": [0, 0.68611, 0, 0, 0.9], + "73": [0, 0.68611, 0, 0, 0.43611], + "74": [0, 0.68611, 0, 0, 0.59444], + "75": [0, 0.68611, 0, 0, 0.90138], + "76": [0, 0.68611, 0, 0, 0.69166], + "77": [0, 0.68611, 0, 0, 1.09166], + "78": [0, 0.68611, 0, 0, 0.9], + "79": [0, 0.68611, 0, 0, 0.86388], + "80": [0, 0.68611, 0, 0, 0.78611], + "81": [0.19444, 0.68611, 0, 0, 0.86388], + "82": [0, 0.68611, 0, 0, 0.8625], + "83": [0, 0.68611, 0, 0, 0.63889], + "84": [0, 0.68611, 0, 0, 0.8], + "85": [0, 0.68611, 0, 0, 0.88472], + "86": [0, 0.68611, 0.01597, 0, 0.86944], + "87": [0, 0.68611, 0.01597, 0, 1.18888], + "88": [0, 0.68611, 0, 0, 0.86944], + "89": [0, 0.68611, 0.02875, 0, 0.86944], + "90": [0, 0.68611, 0, 0, 0.70277], + "91": [0.25, 0.75, 0, 0, 0.31944], + "92": [0.25, 0.75, 0, 0, 0.575], + "93": [0.25, 0.75, 0, 0, 0.31944], + "94": [0, 0.69444, 0, 0, 0.575], + "95": [0.31, 0.13444, 0.03194, 0, 0.575], + "97": [0, 0.44444, 0, 0, 0.55902], + "98": [0, 0.69444, 0, 0, 0.63889], + "99": [0, 0.44444, 0, 0, 0.51111], + "100": [0, 0.69444, 0, 0, 0.63889], + "101": [0, 0.44444, 0, 0, 0.52708], + "102": [0, 0.69444, 0.10903, 0, 0.35139], + "103": [0.19444, 0.44444, 0.01597, 0, 0.575], + "104": [0, 0.69444, 0, 0, 0.63889], + "105": [0, 0.69444, 0, 0, 0.31944], + "106": [0.19444, 0.69444, 0, 0, 0.35139], + "107": [0, 0.69444, 0, 0, 0.60694], + "108": [0, 0.69444, 0, 0, 0.31944], + "109": [0, 0.44444, 0, 0, 0.95833], + "110": [0, 0.44444, 0, 0, 0.63889], + "111": [0, 0.44444, 0, 0, 0.575], + "112": [0.19444, 0.44444, 0, 0, 0.63889], + "113": [0.19444, 0.44444, 0, 0, 0.60694], + "114": [0, 0.44444, 0, 0, 0.47361], + "115": [0, 0.44444, 0, 0, 0.45361], + "116": [0, 0.63492, 0, 0, 0.44722], + "117": [0, 0.44444, 0, 0, 0.63889], + "118": [0, 0.44444, 0.01597, 0, 0.60694], + "119": [0, 0.44444, 0.01597, 0, 0.83055], + "120": [0, 0.44444, 0, 0, 0.60694], + "121": [0.19444, 0.44444, 0.01597, 0, 0.60694], + "122": [0, 0.44444, 0, 0, 0.51111], + "123": [0.25, 0.75, 0, 0, 0.575], + "124": [0.25, 0.75, 0, 0, 0.31944], + "125": [0.25, 0.75, 0, 0, 0.575], + "126": [0.35, 0.34444, 0, 0, 0.575], + "160": [0, 0, 0, 0, 0.25], + "163": [0, 0.69444, 0, 0, 0.86853], + "168": [0, 0.69444, 0, 0, 0.575], + "172": [0, 0.44444, 0, 0, 0.76666], + "176": [0, 0.69444, 0, 0, 0.86944], + "177": [0.13333, 0.63333, 0, 0, 0.89444], + "184": [0.17014, 0, 0, 0, 0.51111], + "198": [0, 0.68611, 0, 0, 1.04166], + "215": [0.13333, 0.63333, 0, 0, 0.89444], + "216": [0.04861, 0.73472, 0, 0, 0.89444], + "223": [0, 0.69444, 0, 0, 0.59722], + "230": [0, 0.44444, 0, 0, 0.83055], + "247": [0.13333, 0.63333, 0, 0, 0.89444], + "248": [0.09722, 0.54167, 0, 0, 0.575], + "305": [0, 0.44444, 0, 0, 0.31944], + "338": [0, 0.68611, 0, 0, 1.16944], + "339": [0, 0.44444, 0, 0, 0.89444], + "567": [0.19444, 0.44444, 0, 0, 0.35139], + "710": [0, 0.69444, 0, 0, 0.575], + "711": [0, 0.63194, 0, 0, 0.575], + "713": [0, 0.59611, 0, 0, 0.575], + "714": [0, 0.69444, 0, 0, 0.575], + "715": [0, 0.69444, 0, 0, 0.575], + "728": [0, 0.69444, 0, 0, 0.575], + "729": [0, 0.69444, 0, 0, 0.31944], + "730": [0, 0.69444, 0, 0, 0.86944], + "732": [0, 0.69444, 0, 0, 0.575], + "733": [0, 0.69444, 0, 0, 0.575], + "915": [0, 0.68611, 0, 0, 0.69166], + "916": [0, 0.68611, 0, 0, 0.95833], + "920": [0, 0.68611, 0, 0, 0.89444], + "923": [0, 0.68611, 0, 0, 0.80555], + "926": [0, 0.68611, 0, 0, 0.76666], + "928": [0, 0.68611, 0, 0, 0.9], + "931": [0, 0.68611, 0, 0, 0.83055], + "933": [0, 0.68611, 0, 0, 0.89444], + "934": [0, 0.68611, 0, 0, 0.83055], + "936": [0, 0.68611, 0, 0, 0.89444], + "937": [0, 0.68611, 0, 0, 0.83055], + "8211": [0, 0.44444, 0.03194, 0, 0.575], + "8212": [0, 0.44444, 0.03194, 0, 1.14999], + "8216": [0, 0.69444, 0, 0, 0.31944], + "8217": [0, 0.69444, 0, 0, 0.31944], + "8220": [0, 0.69444, 0, 0, 0.60278], + "8221": [0, 0.69444, 0, 0, 0.60278], + "8224": [0.19444, 0.69444, 0, 0, 0.51111], + "8225": [0.19444, 0.69444, 0, 0, 0.51111], + "8242": [0, 0.55556, 0, 0, 0.34444], + "8407": [0, 0.72444, 0.15486, 0, 0.575], + "8463": [0, 0.69444, 0, 0, 0.66759], + "8465": [0, 0.69444, 0, 0, 0.83055], + "8467": [0, 0.69444, 0, 0, 0.47361], + "8472": [0.19444, 0.44444, 0, 0, 0.74027], + "8476": [0, 0.69444, 0, 0, 0.83055], + "8501": [0, 0.69444, 0, 0, 0.70277], + "8592": [-0.10889, 0.39111, 0, 0, 1.14999], + "8593": [0.19444, 0.69444, 0, 0, 0.575], + "8594": [-0.10889, 0.39111, 0, 0, 1.14999], + "8595": [0.19444, 0.69444, 0, 0, 0.575], + "8596": [-0.10889, 0.39111, 0, 0, 1.14999], + "8597": [0.25, 0.75, 0, 0, 0.575], + "8598": [0.19444, 0.69444, 0, 0, 1.14999], + "8599": [0.19444, 0.69444, 0, 0, 1.14999], + "8600": [0.19444, 0.69444, 0, 0, 1.14999], + "8601": [0.19444, 0.69444, 0, 0, 1.14999], + "8636": [-0.10889, 0.39111, 0, 0, 1.14999], + "8637": [-0.10889, 0.39111, 0, 0, 1.14999], + "8640": [-0.10889, 0.39111, 0, 0, 1.14999], + "8641": [-0.10889, 0.39111, 0, 0, 1.14999], + "8656": [-0.10889, 0.39111, 0, 0, 1.14999], + "8657": [0.19444, 0.69444, 0, 0, 0.70277], + "8658": [-0.10889, 0.39111, 0, 0, 1.14999], + "8659": [0.19444, 0.69444, 0, 0, 0.70277], + "8660": [-0.10889, 0.39111, 0, 0, 1.14999], + "8661": [0.25, 0.75, 0, 0, 0.70277], + "8704": [0, 0.69444, 0, 0, 0.63889], + "8706": [0, 0.69444, 0.06389, 0, 0.62847], + "8707": [0, 0.69444, 0, 0, 0.63889], + "8709": [0.05556, 0.75, 0, 0, 0.575], + "8711": [0, 0.68611, 0, 0, 0.95833], + "8712": [0.08556, 0.58556, 0, 0, 0.76666], + "8715": [0.08556, 0.58556, 0, 0, 0.76666], + "8722": [0.13333, 0.63333, 0, 0, 0.89444], + "8723": [0.13333, 0.63333, 0, 0, 0.89444], + "8725": [0.25, 0.75, 0, 0, 0.575], + "8726": [0.25, 0.75, 0, 0, 0.575], + "8727": [-0.02778, 0.47222, 0, 0, 0.575], + "8728": [-0.02639, 0.47361, 0, 0, 0.575], + "8729": [-0.02639, 0.47361, 0, 0, 0.575], + "8730": [0.18, 0.82, 0, 0, 0.95833], + "8733": [0, 0.44444, 0, 0, 0.89444], + "8734": [0, 0.44444, 0, 0, 1.14999], + "8736": [0, 0.69224, 0, 0, 0.72222], + "8739": [0.25, 0.75, 0, 0, 0.31944], + "8741": [0.25, 0.75, 0, 0, 0.575], + "8743": [0, 0.55556, 0, 0, 0.76666], + "8744": [0, 0.55556, 0, 0, 0.76666], + "8745": [0, 0.55556, 0, 0, 0.76666], + "8746": [0, 0.55556, 0, 0, 0.76666], + "8747": [0.19444, 0.69444, 0.12778, 0, 0.56875], + "8764": [-0.10889, 0.39111, 0, 0, 0.89444], + "8768": [0.19444, 0.69444, 0, 0, 0.31944], + "8771": [222e-5, 0.50222, 0, 0, 0.89444], + "8773": [0.027, 0.638, 0, 0, 0.894], + "8776": [0.02444, 0.52444, 0, 0, 0.89444], + "8781": [222e-5, 0.50222, 0, 0, 0.89444], + "8801": [222e-5, 0.50222, 0, 0, 0.89444], + "8804": [0.19667, 0.69667, 0, 0, 0.89444], + "8805": [0.19667, 0.69667, 0, 0, 0.89444], + "8810": [0.08556, 0.58556, 0, 0, 1.14999], + "8811": [0.08556, 0.58556, 0, 0, 1.14999], + "8826": [0.08556, 0.58556, 0, 0, 0.89444], + "8827": [0.08556, 0.58556, 0, 0, 0.89444], + "8834": [0.08556, 0.58556, 0, 0, 0.89444], + "8835": [0.08556, 0.58556, 0, 0, 0.89444], + "8838": [0.19667, 0.69667, 0, 0, 0.89444], + "8839": [0.19667, 0.69667, 0, 0, 0.89444], + "8846": [0, 0.55556, 0, 0, 0.76666], + "8849": [0.19667, 0.69667, 0, 0, 0.89444], + "8850": [0.19667, 0.69667, 0, 0, 0.89444], + "8851": [0, 0.55556, 0, 0, 0.76666], + "8852": [0, 0.55556, 0, 0, 0.76666], + "8853": [0.13333, 0.63333, 0, 0, 0.89444], + "8854": [0.13333, 0.63333, 0, 0, 0.89444], + "8855": [0.13333, 0.63333, 0, 0, 0.89444], + "8856": [0.13333, 0.63333, 0, 0, 0.89444], + "8857": [0.13333, 0.63333, 0, 0, 0.89444], + "8866": [0, 0.69444, 0, 0, 0.70277], + "8867": [0, 0.69444, 0, 0, 0.70277], + "8868": [0, 0.69444, 0, 0, 0.89444], + "8869": [0, 0.69444, 0, 0, 0.89444], + "8900": [-0.02639, 0.47361, 0, 0, 0.575], + "8901": [-0.02639, 0.47361, 0, 0, 0.31944], + "8902": [-0.02778, 0.47222, 0, 0, 0.575], + "8968": [0.25, 0.75, 0, 0, 0.51111], + "8969": [0.25, 0.75, 0, 0, 0.51111], + "8970": [0.25, 0.75, 0, 0, 0.51111], + "8971": [0.25, 0.75, 0, 0, 0.51111], + "8994": [-0.13889, 0.36111, 0, 0, 1.14999], + "8995": [-0.13889, 0.36111, 0, 0, 1.14999], + "9651": [0.19444, 0.69444, 0, 0, 1.02222], + "9657": [-0.02778, 0.47222, 0, 0, 0.575], + "9661": [0.19444, 0.69444, 0, 0, 1.02222], + "9667": [-0.02778, 0.47222, 0, 0, 0.575], + "9711": [0.19444, 0.69444, 0, 0, 1.14999], + "9824": [0.12963, 0.69444, 0, 0, 0.89444], + "9825": [0.12963, 0.69444, 0, 0, 0.89444], + "9826": [0.12963, 0.69444, 0, 0, 0.89444], + "9827": [0.12963, 0.69444, 0, 0, 0.89444], + "9837": [0, 0.75, 0, 0, 0.44722], + "9838": [0.19444, 0.69444, 0, 0, 0.44722], + "9839": [0.19444, 0.69444, 0, 0, 0.44722], + "10216": [0.25, 0.75, 0, 0, 0.44722], + "10217": [0.25, 0.75, 0, 0, 0.44722], + "10815": [0, 0.68611, 0, 0, 0.9], + "10927": [0.19667, 0.69667, 0, 0, 0.89444], + "10928": [0.19667, 0.69667, 0, 0, 0.89444], + "57376": [0.19444, 0.69444, 0, 0, 0] + }, + "Main-BoldItalic": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69444, 0.11417, 0, 0.38611], + "34": [0, 0.69444, 0.07939, 0, 0.62055], + "35": [0.19444, 0.69444, 0.06833, 0, 0.94444], + "37": [0.05556, 0.75, 0.12861, 0, 0.94444], + "38": [0, 0.69444, 0.08528, 0, 0.88555], + "39": [0, 0.69444, 0.12945, 0, 0.35555], + "40": [0.25, 0.75, 0.15806, 0, 0.47333], + "41": [0.25, 0.75, 0.03306, 0, 0.47333], + "42": [0, 0.75, 0.14333, 0, 0.59111], + "43": [0.10333, 0.60333, 0.03306, 0, 0.88555], + "44": [0.19444, 0.14722, 0, 0, 0.35555], + "45": [0, 0.44444, 0.02611, 0, 0.41444], + "46": [0, 0.14722, 0, 0, 0.35555], + "47": [0.25, 0.75, 0.15806, 0, 0.59111], + "48": [0, 0.64444, 0.13167, 0, 0.59111], + "49": [0, 0.64444, 0.13167, 0, 0.59111], + "50": [0, 0.64444, 0.13167, 0, 0.59111], + "51": [0, 0.64444, 0.13167, 0, 0.59111], + "52": [0.19444, 0.64444, 0.13167, 0, 0.59111], + "53": [0, 0.64444, 0.13167, 0, 0.59111], + "54": [0, 0.64444, 0.13167, 0, 0.59111], + "55": [0.19444, 0.64444, 0.13167, 0, 0.59111], + "56": [0, 0.64444, 0.13167, 0, 0.59111], + "57": [0, 0.64444, 0.13167, 0, 0.59111], + "58": [0, 0.44444, 0.06695, 0, 0.35555], + "59": [0.19444, 0.44444, 0.06695, 0, 0.35555], + "61": [-0.10889, 0.39111, 0.06833, 0, 0.88555], + "63": [0, 0.69444, 0.11472, 0, 0.59111], + "64": [0, 0.69444, 0.09208, 0, 0.88555], + "65": [0, 0.68611, 0, 0, 0.86555], + "66": [0, 0.68611, 0.0992, 0, 0.81666], + "67": [0, 0.68611, 0.14208, 0, 0.82666], + "68": [0, 0.68611, 0.09062, 0, 0.87555], + "69": [0, 0.68611, 0.11431, 0, 0.75666], + "70": [0, 0.68611, 0.12903, 0, 0.72722], + "71": [0, 0.68611, 0.07347, 0, 0.89527], + "72": [0, 0.68611, 0.17208, 0, 0.8961], + "73": [0, 0.68611, 0.15681, 0, 0.47166], + "74": [0, 0.68611, 0.145, 0, 0.61055], + "75": [0, 0.68611, 0.14208, 0, 0.89499], + "76": [0, 0.68611, 0, 0, 0.69777], + "77": [0, 0.68611, 0.17208, 0, 1.07277], + "78": [0, 0.68611, 0.17208, 0, 0.8961], + "79": [0, 0.68611, 0.09062, 0, 0.85499], + "80": [0, 0.68611, 0.0992, 0, 0.78721], + "81": [0.19444, 0.68611, 0.09062, 0, 0.85499], + "82": [0, 0.68611, 0.02559, 0, 0.85944], + "83": [0, 0.68611, 0.11264, 0, 0.64999], + "84": [0, 0.68611, 0.12903, 0, 0.7961], + "85": [0, 0.68611, 0.17208, 0, 0.88083], + "86": [0, 0.68611, 0.18625, 0, 0.86555], + "87": [0, 0.68611, 0.18625, 0, 1.15999], + "88": [0, 0.68611, 0.15681, 0, 0.86555], + "89": [0, 0.68611, 0.19803, 0, 0.86555], + "90": [0, 0.68611, 0.14208, 0, 0.70888], + "91": [0.25, 0.75, 0.1875, 0, 0.35611], + "93": [0.25, 0.75, 0.09972, 0, 0.35611], + "94": [0, 0.69444, 0.06709, 0, 0.59111], + "95": [0.31, 0.13444, 0.09811, 0, 0.59111], + "97": [0, 0.44444, 0.09426, 0, 0.59111], + "98": [0, 0.69444, 0.07861, 0, 0.53222], + "99": [0, 0.44444, 0.05222, 0, 0.53222], + "100": [0, 0.69444, 0.10861, 0, 0.59111], + "101": [0, 0.44444, 0.085, 0, 0.53222], + "102": [0.19444, 0.69444, 0.21778, 0, 0.4], + "103": [0.19444, 0.44444, 0.105, 0, 0.53222], + "104": [0, 0.69444, 0.09426, 0, 0.59111], + "105": [0, 0.69326, 0.11387, 0, 0.35555], + "106": [0.19444, 0.69326, 0.1672, 0, 0.35555], + "107": [0, 0.69444, 0.11111, 0, 0.53222], + "108": [0, 0.69444, 0.10861, 0, 0.29666], + "109": [0, 0.44444, 0.09426, 0, 0.94444], + "110": [0, 0.44444, 0.09426, 0, 0.64999], + "111": [0, 0.44444, 0.07861, 0, 0.59111], + "112": [0.19444, 0.44444, 0.07861, 0, 0.59111], + "113": [0.19444, 0.44444, 0.105, 0, 0.53222], + "114": [0, 0.44444, 0.11111, 0, 0.50167], + "115": [0, 0.44444, 0.08167, 0, 0.48694], + "116": [0, 0.63492, 0.09639, 0, 0.385], + "117": [0, 0.44444, 0.09426, 0, 0.62055], + "118": [0, 0.44444, 0.11111, 0, 0.53222], + "119": [0, 0.44444, 0.11111, 0, 0.76777], + "120": [0, 0.44444, 0.12583, 0, 0.56055], + "121": [0.19444, 0.44444, 0.105, 0, 0.56166], + "122": [0, 0.44444, 0.13889, 0, 0.49055], + "126": [0.35, 0.34444, 0.11472, 0, 0.59111], + "160": [0, 0, 0, 0, 0.25], + "168": [0, 0.69444, 0.11473, 0, 0.59111], + "176": [0, 0.69444, 0, 0, 0.94888], + "184": [0.17014, 0, 0, 0, 0.53222], + "198": [0, 0.68611, 0.11431, 0, 1.02277], + "216": [0.04861, 0.73472, 0.09062, 0, 0.88555], + "223": [0.19444, 0.69444, 0.09736, 0, 0.665], + "230": [0, 0.44444, 0.085, 0, 0.82666], + "248": [0.09722, 0.54167, 0.09458, 0, 0.59111], + "305": [0, 0.44444, 0.09426, 0, 0.35555], + "338": [0, 0.68611, 0.11431, 0, 1.14054], + "339": [0, 0.44444, 0.085, 0, 0.82666], + "567": [0.19444, 0.44444, 0.04611, 0, 0.385], + "710": [0, 0.69444, 0.06709, 0, 0.59111], + "711": [0, 0.63194, 0.08271, 0, 0.59111], + "713": [0, 0.59444, 0.10444, 0, 0.59111], + "714": [0, 0.69444, 0.08528, 0, 0.59111], + "715": [0, 0.69444, 0, 0, 0.59111], + "728": [0, 0.69444, 0.10333, 0, 0.59111], + "729": [0, 0.69444, 0.12945, 0, 0.35555], + "730": [0, 0.69444, 0, 0, 0.94888], + "732": [0, 0.69444, 0.11472, 0, 0.59111], + "733": [0, 0.69444, 0.11472, 0, 0.59111], + "915": [0, 0.68611, 0.12903, 0, 0.69777], + "916": [0, 0.68611, 0, 0, 0.94444], + "920": [0, 0.68611, 0.09062, 0, 0.88555], + "923": [0, 0.68611, 0, 0, 0.80666], + "926": [0, 0.68611, 0.15092, 0, 0.76777], + "928": [0, 0.68611, 0.17208, 0, 0.8961], + "931": [0, 0.68611, 0.11431, 0, 0.82666], + "933": [0, 0.68611, 0.10778, 0, 0.88555], + "934": [0, 0.68611, 0.05632, 0, 0.82666], + "936": [0, 0.68611, 0.10778, 0, 0.88555], + "937": [0, 0.68611, 0.0992, 0, 0.82666], + "8211": [0, 0.44444, 0.09811, 0, 0.59111], + "8212": [0, 0.44444, 0.09811, 0, 1.18221], + "8216": [0, 0.69444, 0.12945, 0, 0.35555], + "8217": [0, 0.69444, 0.12945, 0, 0.35555], + "8220": [0, 0.69444, 0.16772, 0, 0.62055], + "8221": [0, 0.69444, 0.07939, 0, 0.62055] + }, + "Main-Italic": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69444, 0.12417, 0, 0.30667], + "34": [0, 0.69444, 0.06961, 0, 0.51444], + "35": [0.19444, 0.69444, 0.06616, 0, 0.81777], + "37": [0.05556, 0.75, 0.13639, 0, 0.81777], + "38": [0, 0.69444, 0.09694, 0, 0.76666], + "39": [0, 0.69444, 0.12417, 0, 0.30667], + "40": [0.25, 0.75, 0.16194, 0, 0.40889], + "41": [0.25, 0.75, 0.03694, 0, 0.40889], + "42": [0, 0.75, 0.14917, 0, 0.51111], + "43": [0.05667, 0.56167, 0.03694, 0, 0.76666], + "44": [0.19444, 0.10556, 0, 0, 0.30667], + "45": [0, 0.43056, 0.02826, 0, 0.35778], + "46": [0, 0.10556, 0, 0, 0.30667], + "47": [0.25, 0.75, 0.16194, 0, 0.51111], + "48": [0, 0.64444, 0.13556, 0, 0.51111], + "49": [0, 0.64444, 0.13556, 0, 0.51111], + "50": [0, 0.64444, 0.13556, 0, 0.51111], + "51": [0, 0.64444, 0.13556, 0, 0.51111], + "52": [0.19444, 0.64444, 0.13556, 0, 0.51111], + "53": [0, 0.64444, 0.13556, 0, 0.51111], + "54": [0, 0.64444, 0.13556, 0, 0.51111], + "55": [0.19444, 0.64444, 0.13556, 0, 0.51111], + "56": [0, 0.64444, 0.13556, 0, 0.51111], + "57": [0, 0.64444, 0.13556, 0, 0.51111], + "58": [0, 0.43056, 0.0582, 0, 0.30667], + "59": [0.19444, 0.43056, 0.0582, 0, 0.30667], + "61": [-0.13313, 0.36687, 0.06616, 0, 0.76666], + "63": [0, 0.69444, 0.1225, 0, 0.51111], + "64": [0, 0.69444, 0.09597, 0, 0.76666], + "65": [0, 0.68333, 0, 0, 0.74333], + "66": [0, 0.68333, 0.10257, 0, 0.70389], + "67": [0, 0.68333, 0.14528, 0, 0.71555], + "68": [0, 0.68333, 0.09403, 0, 0.755], + "69": [0, 0.68333, 0.12028, 0, 0.67833], + "70": [0, 0.68333, 0.13305, 0, 0.65277], + "71": [0, 0.68333, 0.08722, 0, 0.77361], + "72": [0, 0.68333, 0.16389, 0, 0.74333], + "73": [0, 0.68333, 0.15806, 0, 0.38555], + "74": [0, 0.68333, 0.14028, 0, 0.525], + "75": [0, 0.68333, 0.14528, 0, 0.76888], + "76": [0, 0.68333, 0, 0, 0.62722], + "77": [0, 0.68333, 0.16389, 0, 0.89666], + "78": [0, 0.68333, 0.16389, 0, 0.74333], + "79": [0, 0.68333, 0.09403, 0, 0.76666], + "80": [0, 0.68333, 0.10257, 0, 0.67833], + "81": [0.19444, 0.68333, 0.09403, 0, 0.76666], + "82": [0, 0.68333, 0.03868, 0, 0.72944], + "83": [0, 0.68333, 0.11972, 0, 0.56222], + "84": [0, 0.68333, 0.13305, 0, 0.71555], + "85": [0, 0.68333, 0.16389, 0, 0.74333], + "86": [0, 0.68333, 0.18361, 0, 0.74333], + "87": [0, 0.68333, 0.18361, 0, 0.99888], + "88": [0, 0.68333, 0.15806, 0, 0.74333], + "89": [0, 0.68333, 0.19383, 0, 0.74333], + "90": [0, 0.68333, 0.14528, 0, 0.61333], + "91": [0.25, 0.75, 0.1875, 0, 0.30667], + "93": [0.25, 0.75, 0.10528, 0, 0.30667], + "94": [0, 0.69444, 0.06646, 0, 0.51111], + "95": [0.31, 0.12056, 0.09208, 0, 0.51111], + "97": [0, 0.43056, 0.07671, 0, 0.51111], + "98": [0, 0.69444, 0.06312, 0, 0.46], + "99": [0, 0.43056, 0.05653, 0, 0.46], + "100": [0, 0.69444, 0.10333, 0, 0.51111], + "101": [0, 0.43056, 0.07514, 0, 0.46], + "102": [0.19444, 0.69444, 0.21194, 0, 0.30667], + "103": [0.19444, 0.43056, 0.08847, 0, 0.46], + "104": [0, 0.69444, 0.07671, 0, 0.51111], + "105": [0, 0.65536, 0.1019, 0, 0.30667], + "106": [0.19444, 0.65536, 0.14467, 0, 0.30667], + "107": [0, 0.69444, 0.10764, 0, 0.46], + "108": [0, 0.69444, 0.10333, 0, 0.25555], + "109": [0, 0.43056, 0.07671, 0, 0.81777], + "110": [0, 0.43056, 0.07671, 0, 0.56222], + "111": [0, 0.43056, 0.06312, 0, 0.51111], + "112": [0.19444, 0.43056, 0.06312, 0, 0.51111], + "113": [0.19444, 0.43056, 0.08847, 0, 0.46], + "114": [0, 0.43056, 0.10764, 0, 0.42166], + "115": [0, 0.43056, 0.08208, 0, 0.40889], + "116": [0, 0.61508, 0.09486, 0, 0.33222], + "117": [0, 0.43056, 0.07671, 0, 0.53666], + "118": [0, 0.43056, 0.10764, 0, 0.46], + "119": [0, 0.43056, 0.10764, 0, 0.66444], + "120": [0, 0.43056, 0.12042, 0, 0.46389], + "121": [0.19444, 0.43056, 0.08847, 0, 0.48555], + "122": [0, 0.43056, 0.12292, 0, 0.40889], + "126": [0.35, 0.31786, 0.11585, 0, 0.51111], + "160": [0, 0, 0, 0, 0.25], + "168": [0, 0.66786, 0.10474, 0, 0.51111], + "176": [0, 0.69444, 0, 0, 0.83129], + "184": [0.17014, 0, 0, 0, 0.46], + "198": [0, 0.68333, 0.12028, 0, 0.88277], + "216": [0.04861, 0.73194, 0.09403, 0, 0.76666], + "223": [0.19444, 0.69444, 0.10514, 0, 0.53666], + "230": [0, 0.43056, 0.07514, 0, 0.71555], + "248": [0.09722, 0.52778, 0.09194, 0, 0.51111], + "338": [0, 0.68333, 0.12028, 0, 0.98499], + "339": [0, 0.43056, 0.07514, 0, 0.71555], + "710": [0, 0.69444, 0.06646, 0, 0.51111], + "711": [0, 0.62847, 0.08295, 0, 0.51111], + "713": [0, 0.56167, 0.10333, 0, 0.51111], + "714": [0, 0.69444, 0.09694, 0, 0.51111], + "715": [0, 0.69444, 0, 0, 0.51111], + "728": [0, 0.69444, 0.10806, 0, 0.51111], + "729": [0, 0.66786, 0.11752, 0, 0.30667], + "730": [0, 0.69444, 0, 0, 0.83129], + "732": [0, 0.66786, 0.11585, 0, 0.51111], + "733": [0, 0.69444, 0.1225, 0, 0.51111], + "915": [0, 0.68333, 0.13305, 0, 0.62722], + "916": [0, 0.68333, 0, 0, 0.81777], + "920": [0, 0.68333, 0.09403, 0, 0.76666], + "923": [0, 0.68333, 0, 0, 0.69222], + "926": [0, 0.68333, 0.15294, 0, 0.66444], + "928": [0, 0.68333, 0.16389, 0, 0.74333], + "931": [0, 0.68333, 0.12028, 0, 0.71555], + "933": [0, 0.68333, 0.11111, 0, 0.76666], + "934": [0, 0.68333, 0.05986, 0, 0.71555], + "936": [0, 0.68333, 0.11111, 0, 0.76666], + "937": [0, 0.68333, 0.10257, 0, 0.71555], + "8211": [0, 0.43056, 0.09208, 0, 0.51111], + "8212": [0, 0.43056, 0.09208, 0, 1.02222], + "8216": [0, 0.69444, 0.12417, 0, 0.30667], + "8217": [0, 0.69444, 0.12417, 0, 0.30667], + "8220": [0, 0.69444, 0.1685, 0, 0.51444], + "8221": [0, 0.69444, 0.06961, 0, 0.51444], + "8463": [0, 0.68889, 0, 0, 0.54028] + }, + "Main-Regular": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69444, 0, 0, 0.27778], + "34": [0, 0.69444, 0, 0, 0.5], + "35": [0.19444, 0.69444, 0, 0, 0.83334], + "36": [0.05556, 0.75, 0, 0, 0.5], + "37": [0.05556, 0.75, 0, 0, 0.83334], + "38": [0, 0.69444, 0, 0, 0.77778], + "39": [0, 0.69444, 0, 0, 0.27778], + "40": [0.25, 0.75, 0, 0, 0.38889], + "41": [0.25, 0.75, 0, 0, 0.38889], + "42": [0, 0.75, 0, 0, 0.5], + "43": [0.08333, 0.58333, 0, 0, 0.77778], + "44": [0.19444, 0.10556, 0, 0, 0.27778], + "45": [0, 0.43056, 0, 0, 0.33333], + "46": [0, 0.10556, 0, 0, 0.27778], + "47": [0.25, 0.75, 0, 0, 0.5], + "48": [0, 0.64444, 0, 0, 0.5], + "49": [0, 0.64444, 0, 0, 0.5], + "50": [0, 0.64444, 0, 0, 0.5], + "51": [0, 0.64444, 0, 0, 0.5], + "52": [0, 0.64444, 0, 0, 0.5], + "53": [0, 0.64444, 0, 0, 0.5], + "54": [0, 0.64444, 0, 0, 0.5], + "55": [0, 0.64444, 0, 0, 0.5], + "56": [0, 0.64444, 0, 0, 0.5], + "57": [0, 0.64444, 0, 0, 0.5], + "58": [0, 0.43056, 0, 0, 0.27778], + "59": [0.19444, 0.43056, 0, 0, 0.27778], + "60": [0.0391, 0.5391, 0, 0, 0.77778], + "61": [-0.13313, 0.36687, 0, 0, 0.77778], + "62": [0.0391, 0.5391, 0, 0, 0.77778], + "63": [0, 0.69444, 0, 0, 0.47222], + "64": [0, 0.69444, 0, 0, 0.77778], + "65": [0, 0.68333, 0, 0, 0.75], + "66": [0, 0.68333, 0, 0, 0.70834], + "67": [0, 0.68333, 0, 0, 0.72222], + "68": [0, 0.68333, 0, 0, 0.76389], + "69": [0, 0.68333, 0, 0, 0.68056], + "70": [0, 0.68333, 0, 0, 0.65278], + "71": [0, 0.68333, 0, 0, 0.78472], + "72": [0, 0.68333, 0, 0, 0.75], + "73": [0, 0.68333, 0, 0, 0.36111], + "74": [0, 0.68333, 0, 0, 0.51389], + "75": [0, 0.68333, 0, 0, 0.77778], + "76": [0, 0.68333, 0, 0, 0.625], + "77": [0, 0.68333, 0, 0, 0.91667], + "78": [0, 0.68333, 0, 0, 0.75], + "79": [0, 0.68333, 0, 0, 0.77778], + "80": [0, 0.68333, 0, 0, 0.68056], + "81": [0.19444, 0.68333, 0, 0, 0.77778], + "82": [0, 0.68333, 0, 0, 0.73611], + "83": [0, 0.68333, 0, 0, 0.55556], + "84": [0, 0.68333, 0, 0, 0.72222], + "85": [0, 0.68333, 0, 0, 0.75], + "86": [0, 0.68333, 0.01389, 0, 0.75], + "87": [0, 0.68333, 0.01389, 0, 1.02778], + "88": [0, 0.68333, 0, 0, 0.75], + "89": [0, 0.68333, 0.025, 0, 0.75], + "90": [0, 0.68333, 0, 0, 0.61111], + "91": [0.25, 0.75, 0, 0, 0.27778], + "92": [0.25, 0.75, 0, 0, 0.5], + "93": [0.25, 0.75, 0, 0, 0.27778], + "94": [0, 0.69444, 0, 0, 0.5], + "95": [0.31, 0.12056, 0.02778, 0, 0.5], + "97": [0, 0.43056, 0, 0, 0.5], + "98": [0, 0.69444, 0, 0, 0.55556], + "99": [0, 0.43056, 0, 0, 0.44445], + "100": [0, 0.69444, 0, 0, 0.55556], + "101": [0, 0.43056, 0, 0, 0.44445], + "102": [0, 0.69444, 0.07778, 0, 0.30556], + "103": [0.19444, 0.43056, 0.01389, 0, 0.5], + "104": [0, 0.69444, 0, 0, 0.55556], + "105": [0, 0.66786, 0, 0, 0.27778], + "106": [0.19444, 0.66786, 0, 0, 0.30556], + "107": [0, 0.69444, 0, 0, 0.52778], + "108": [0, 0.69444, 0, 0, 0.27778], + "109": [0, 0.43056, 0, 0, 0.83334], + "110": [0, 0.43056, 0, 0, 0.55556], + "111": [0, 0.43056, 0, 0, 0.5], + "112": [0.19444, 0.43056, 0, 0, 0.55556], + "113": [0.19444, 0.43056, 0, 0, 0.52778], + "114": [0, 0.43056, 0, 0, 0.39167], + "115": [0, 0.43056, 0, 0, 0.39445], + "116": [0, 0.61508, 0, 0, 0.38889], + "117": [0, 0.43056, 0, 0, 0.55556], + "118": [0, 0.43056, 0.01389, 0, 0.52778], + "119": [0, 0.43056, 0.01389, 0, 0.72222], + "120": [0, 0.43056, 0, 0, 0.52778], + "121": [0.19444, 0.43056, 0.01389, 0, 0.52778], + "122": [0, 0.43056, 0, 0, 0.44445], + "123": [0.25, 0.75, 0, 0, 0.5], + "124": [0.25, 0.75, 0, 0, 0.27778], + "125": [0.25, 0.75, 0, 0, 0.5], + "126": [0.35, 0.31786, 0, 0, 0.5], + "160": [0, 0, 0, 0, 0.25], + "163": [0, 0.69444, 0, 0, 0.76909], + "167": [0.19444, 0.69444, 0, 0, 0.44445], + "168": [0, 0.66786, 0, 0, 0.5], + "172": [0, 0.43056, 0, 0, 0.66667], + "176": [0, 0.69444, 0, 0, 0.75], + "177": [0.08333, 0.58333, 0, 0, 0.77778], + "182": [0.19444, 0.69444, 0, 0, 0.61111], + "184": [0.17014, 0, 0, 0, 0.44445], + "198": [0, 0.68333, 0, 0, 0.90278], + "215": [0.08333, 0.58333, 0, 0, 0.77778], + "216": [0.04861, 0.73194, 0, 0, 0.77778], + "223": [0, 0.69444, 0, 0, 0.5], + "230": [0, 0.43056, 0, 0, 0.72222], + "247": [0.08333, 0.58333, 0, 0, 0.77778], + "248": [0.09722, 0.52778, 0, 0, 0.5], + "305": [0, 0.43056, 0, 0, 0.27778], + "338": [0, 0.68333, 0, 0, 1.01389], + "339": [0, 0.43056, 0, 0, 0.77778], + "567": [0.19444, 0.43056, 0, 0, 0.30556], + "710": [0, 0.69444, 0, 0, 0.5], + "711": [0, 0.62847, 0, 0, 0.5], + "713": [0, 0.56778, 0, 0, 0.5], + "714": [0, 0.69444, 0, 0, 0.5], + "715": [0, 0.69444, 0, 0, 0.5], + "728": [0, 0.69444, 0, 0, 0.5], + "729": [0, 0.66786, 0, 0, 0.27778], + "730": [0, 0.69444, 0, 0, 0.75], + "732": [0, 0.66786, 0, 0, 0.5], + "733": [0, 0.69444, 0, 0, 0.5], + "915": [0, 0.68333, 0, 0, 0.625], + "916": [0, 0.68333, 0, 0, 0.83334], + "920": [0, 0.68333, 0, 0, 0.77778], + "923": [0, 0.68333, 0, 0, 0.69445], + "926": [0, 0.68333, 0, 0, 0.66667], + "928": [0, 0.68333, 0, 0, 0.75], + "931": [0, 0.68333, 0, 0, 0.72222], + "933": [0, 0.68333, 0, 0, 0.77778], + "934": [0, 0.68333, 0, 0, 0.72222], + "936": [0, 0.68333, 0, 0, 0.77778], + "937": [0, 0.68333, 0, 0, 0.72222], + "8211": [0, 0.43056, 0.02778, 0, 0.5], + "8212": [0, 0.43056, 0.02778, 0, 1], + "8216": [0, 0.69444, 0, 0, 0.27778], + "8217": [0, 0.69444, 0, 0, 0.27778], + "8220": [0, 0.69444, 0, 0, 0.5], + "8221": [0, 0.69444, 0, 0, 0.5], + "8224": [0.19444, 0.69444, 0, 0, 0.44445], + "8225": [0.19444, 0.69444, 0, 0, 0.44445], + "8230": [0, 0.123, 0, 0, 1.172], + "8242": [0, 0.55556, 0, 0, 0.275], + "8407": [0, 0.71444, 0.15382, 0, 0.5], + "8463": [0, 0.68889, 0, 0, 0.54028], + "8465": [0, 0.69444, 0, 0, 0.72222], + "8467": [0, 0.69444, 0, 0.11111, 0.41667], + "8472": [0.19444, 0.43056, 0, 0.11111, 0.63646], + "8476": [0, 0.69444, 0, 0, 0.72222], + "8501": [0, 0.69444, 0, 0, 0.61111], + "8592": [-0.13313, 0.36687, 0, 0, 1], + "8593": [0.19444, 0.69444, 0, 0, 0.5], + "8594": [-0.13313, 0.36687, 0, 0, 1], + "8595": [0.19444, 0.69444, 0, 0, 0.5], + "8596": [-0.13313, 0.36687, 0, 0, 1], + "8597": [0.25, 0.75, 0, 0, 0.5], + "8598": [0.19444, 0.69444, 0, 0, 1], + "8599": [0.19444, 0.69444, 0, 0, 1], + "8600": [0.19444, 0.69444, 0, 0, 1], + "8601": [0.19444, 0.69444, 0, 0, 1], + "8614": [0.011, 0.511, 0, 0, 1], + "8617": [0.011, 0.511, 0, 0, 1.126], + "8618": [0.011, 0.511, 0, 0, 1.126], + "8636": [-0.13313, 0.36687, 0, 0, 1], + "8637": [-0.13313, 0.36687, 0, 0, 1], + "8640": [-0.13313, 0.36687, 0, 0, 1], + "8641": [-0.13313, 0.36687, 0, 0, 1], + "8652": [0.011, 0.671, 0, 0, 1], + "8656": [-0.13313, 0.36687, 0, 0, 1], + "8657": [0.19444, 0.69444, 0, 0, 0.61111], + "8658": [-0.13313, 0.36687, 0, 0, 1], + "8659": [0.19444, 0.69444, 0, 0, 0.61111], + "8660": [-0.13313, 0.36687, 0, 0, 1], + "8661": [0.25, 0.75, 0, 0, 0.61111], + "8704": [0, 0.69444, 0, 0, 0.55556], + "8706": [0, 0.69444, 0.05556, 0.08334, 0.5309], + "8707": [0, 0.69444, 0, 0, 0.55556], + "8709": [0.05556, 0.75, 0, 0, 0.5], + "8711": [0, 0.68333, 0, 0, 0.83334], + "8712": [0.0391, 0.5391, 0, 0, 0.66667], + "8715": [0.0391, 0.5391, 0, 0, 0.66667], + "8722": [0.08333, 0.58333, 0, 0, 0.77778], + "8723": [0.08333, 0.58333, 0, 0, 0.77778], + "8725": [0.25, 0.75, 0, 0, 0.5], + "8726": [0.25, 0.75, 0, 0, 0.5], + "8727": [-0.03472, 0.46528, 0, 0, 0.5], + "8728": [-0.05555, 0.44445, 0, 0, 0.5], + "8729": [-0.05555, 0.44445, 0, 0, 0.5], + "8730": [0.2, 0.8, 0, 0, 0.83334], + "8733": [0, 0.43056, 0, 0, 0.77778], + "8734": [0, 0.43056, 0, 0, 1], + "8736": [0, 0.69224, 0, 0, 0.72222], + "8739": [0.25, 0.75, 0, 0, 0.27778], + "8741": [0.25, 0.75, 0, 0, 0.5], + "8743": [0, 0.55556, 0, 0, 0.66667], + "8744": [0, 0.55556, 0, 0, 0.66667], + "8745": [0, 0.55556, 0, 0, 0.66667], + "8746": [0, 0.55556, 0, 0, 0.66667], + "8747": [0.19444, 0.69444, 0.11111, 0, 0.41667], + "8764": [-0.13313, 0.36687, 0, 0, 0.77778], + "8768": [0.19444, 0.69444, 0, 0, 0.27778], + "8771": [-0.03625, 0.46375, 0, 0, 0.77778], + "8773": [-0.022, 0.589, 0, 0, 0.778], + "8776": [-0.01688, 0.48312, 0, 0, 0.77778], + "8781": [-0.03625, 0.46375, 0, 0, 0.77778], + "8784": [-0.133, 0.673, 0, 0, 0.778], + "8801": [-0.03625, 0.46375, 0, 0, 0.77778], + "8804": [0.13597, 0.63597, 0, 0, 0.77778], + "8805": [0.13597, 0.63597, 0, 0, 0.77778], + "8810": [0.0391, 0.5391, 0, 0, 1], + "8811": [0.0391, 0.5391, 0, 0, 1], + "8826": [0.0391, 0.5391, 0, 0, 0.77778], + "8827": [0.0391, 0.5391, 0, 0, 0.77778], + "8834": [0.0391, 0.5391, 0, 0, 0.77778], + "8835": [0.0391, 0.5391, 0, 0, 0.77778], + "8838": [0.13597, 0.63597, 0, 0, 0.77778], + "8839": [0.13597, 0.63597, 0, 0, 0.77778], + "8846": [0, 0.55556, 0, 0, 0.66667], + "8849": [0.13597, 0.63597, 0, 0, 0.77778], + "8850": [0.13597, 0.63597, 0, 0, 0.77778], + "8851": [0, 0.55556, 0, 0, 0.66667], + "8852": [0, 0.55556, 0, 0, 0.66667], + "8853": [0.08333, 0.58333, 0, 0, 0.77778], + "8854": [0.08333, 0.58333, 0, 0, 0.77778], + "8855": [0.08333, 0.58333, 0, 0, 0.77778], + "8856": [0.08333, 0.58333, 0, 0, 0.77778], + "8857": [0.08333, 0.58333, 0, 0, 0.77778], + "8866": [0, 0.69444, 0, 0, 0.61111], + "8867": [0, 0.69444, 0, 0, 0.61111], + "8868": [0, 0.69444, 0, 0, 0.77778], + "8869": [0, 0.69444, 0, 0, 0.77778], + "8872": [0.249, 0.75, 0, 0, 0.867], + "8900": [-0.05555, 0.44445, 0, 0, 0.5], + "8901": [-0.05555, 0.44445, 0, 0, 0.27778], + "8902": [-0.03472, 0.46528, 0, 0, 0.5], + "8904": [5e-3, 0.505, 0, 0, 0.9], + "8942": [0.03, 0.903, 0, 0, 0.278], + "8943": [-0.19, 0.313, 0, 0, 1.172], + "8945": [-0.1, 0.823, 0, 0, 1.282], + "8968": [0.25, 0.75, 0, 0, 0.44445], + "8969": [0.25, 0.75, 0, 0, 0.44445], + "8970": [0.25, 0.75, 0, 0, 0.44445], + "8971": [0.25, 0.75, 0, 0, 0.44445], + "8994": [-0.14236, 0.35764, 0, 0, 1], + "8995": [-0.14236, 0.35764, 0, 0, 1], + "9136": [0.244, 0.744, 0, 0, 0.412], + "9137": [0.244, 0.745, 0, 0, 0.412], + "9651": [0.19444, 0.69444, 0, 0, 0.88889], + "9657": [-0.03472, 0.46528, 0, 0, 0.5], + "9661": [0.19444, 0.69444, 0, 0, 0.88889], + "9667": [-0.03472, 0.46528, 0, 0, 0.5], + "9711": [0.19444, 0.69444, 0, 0, 1], + "9824": [0.12963, 0.69444, 0, 0, 0.77778], + "9825": [0.12963, 0.69444, 0, 0, 0.77778], + "9826": [0.12963, 0.69444, 0, 0, 0.77778], + "9827": [0.12963, 0.69444, 0, 0, 0.77778], + "9837": [0, 0.75, 0, 0, 0.38889], + "9838": [0.19444, 0.69444, 0, 0, 0.38889], + "9839": [0.19444, 0.69444, 0, 0, 0.38889], + "10216": [0.25, 0.75, 0, 0, 0.38889], + "10217": [0.25, 0.75, 0, 0, 0.38889], + "10222": [0.244, 0.744, 0, 0, 0.412], + "10223": [0.244, 0.745, 0, 0, 0.412], + "10229": [0.011, 0.511, 0, 0, 1.609], + "10230": [0.011, 0.511, 0, 0, 1.638], + "10231": [0.011, 0.511, 0, 0, 1.859], + "10232": [0.024, 0.525, 0, 0, 1.609], + "10233": [0.024, 0.525, 0, 0, 1.638], + "10234": [0.024, 0.525, 0, 0, 1.858], + "10236": [0.011, 0.511, 0, 0, 1.638], + "10815": [0, 0.68333, 0, 0, 0.75], + "10927": [0.13597, 0.63597, 0, 0, 0.77778], + "10928": [0.13597, 0.63597, 0, 0, 0.77778], + "57376": [0.19444, 0.69444, 0, 0, 0] + }, + "Math-BoldItalic": { + "32": [0, 0, 0, 0, 0.25], + "48": [0, 0.44444, 0, 0, 0.575], + "49": [0, 0.44444, 0, 0, 0.575], + "50": [0, 0.44444, 0, 0, 0.575], + "51": [0.19444, 0.44444, 0, 0, 0.575], + "52": [0.19444, 0.44444, 0, 0, 0.575], + "53": [0.19444, 0.44444, 0, 0, 0.575], + "54": [0, 0.64444, 0, 0, 0.575], + "55": [0.19444, 0.44444, 0, 0, 0.575], + "56": [0, 0.64444, 0, 0, 0.575], + "57": [0.19444, 0.44444, 0, 0, 0.575], + "65": [0, 0.68611, 0, 0, 0.86944], + "66": [0, 0.68611, 0.04835, 0, 0.8664], + "67": [0, 0.68611, 0.06979, 0, 0.81694], + "68": [0, 0.68611, 0.03194, 0, 0.93812], + "69": [0, 0.68611, 0.05451, 0, 0.81007], + "70": [0, 0.68611, 0.15972, 0, 0.68889], + "71": [0, 0.68611, 0, 0, 0.88673], + "72": [0, 0.68611, 0.08229, 0, 0.98229], + "73": [0, 0.68611, 0.07778, 0, 0.51111], + "74": [0, 0.68611, 0.10069, 0, 0.63125], + "75": [0, 0.68611, 0.06979, 0, 0.97118], + "76": [0, 0.68611, 0, 0, 0.75555], + "77": [0, 0.68611, 0.11424, 0, 1.14201], + "78": [0, 0.68611, 0.11424, 0, 0.95034], + "79": [0, 0.68611, 0.03194, 0, 0.83666], + "80": [0, 0.68611, 0.15972, 0, 0.72309], + "81": [0.19444, 0.68611, 0, 0, 0.86861], + "82": [0, 0.68611, 421e-5, 0, 0.87235], + "83": [0, 0.68611, 0.05382, 0, 0.69271], + "84": [0, 0.68611, 0.15972, 0, 0.63663], + "85": [0, 0.68611, 0.11424, 0, 0.80027], + "86": [0, 0.68611, 0.25555, 0, 0.67778], + "87": [0, 0.68611, 0.15972, 0, 1.09305], + "88": [0, 0.68611, 0.07778, 0, 0.94722], + "89": [0, 0.68611, 0.25555, 0, 0.67458], + "90": [0, 0.68611, 0.06979, 0, 0.77257], + "97": [0, 0.44444, 0, 0, 0.63287], + "98": [0, 0.69444, 0, 0, 0.52083], + "99": [0, 0.44444, 0, 0, 0.51342], + "100": [0, 0.69444, 0, 0, 0.60972], + "101": [0, 0.44444, 0, 0, 0.55361], + "102": [0.19444, 0.69444, 0.11042, 0, 0.56806], + "103": [0.19444, 0.44444, 0.03704, 0, 0.5449], + "104": [0, 0.69444, 0, 0, 0.66759], + "105": [0, 0.69326, 0, 0, 0.4048], + "106": [0.19444, 0.69326, 0.0622, 0, 0.47083], + "107": [0, 0.69444, 0.01852, 0, 0.6037], + "108": [0, 0.69444, 88e-4, 0, 0.34815], + "109": [0, 0.44444, 0, 0, 1.0324], + "110": [0, 0.44444, 0, 0, 0.71296], + "111": [0, 0.44444, 0, 0, 0.58472], + "112": [0.19444, 0.44444, 0, 0, 0.60092], + "113": [0.19444, 0.44444, 0.03704, 0, 0.54213], + "114": [0, 0.44444, 0.03194, 0, 0.5287], + "115": [0, 0.44444, 0, 0, 0.53125], + "116": [0, 0.63492, 0, 0, 0.41528], + "117": [0, 0.44444, 0, 0, 0.68102], + "118": [0, 0.44444, 0.03704, 0, 0.56666], + "119": [0, 0.44444, 0.02778, 0, 0.83148], + "120": [0, 0.44444, 0, 0, 0.65903], + "121": [0.19444, 0.44444, 0.03704, 0, 0.59028], + "122": [0, 0.44444, 0.04213, 0, 0.55509], + "160": [0, 0, 0, 0, 0.25], + "915": [0, 0.68611, 0.15972, 0, 0.65694], + "916": [0, 0.68611, 0, 0, 0.95833], + "920": [0, 0.68611, 0.03194, 0, 0.86722], + "923": [0, 0.68611, 0, 0, 0.80555], + "926": [0, 0.68611, 0.07458, 0, 0.84125], + "928": [0, 0.68611, 0.08229, 0, 0.98229], + "931": [0, 0.68611, 0.05451, 0, 0.88507], + "933": [0, 0.68611, 0.15972, 0, 0.67083], + "934": [0, 0.68611, 0, 0, 0.76666], + "936": [0, 0.68611, 0.11653, 0, 0.71402], + "937": [0, 0.68611, 0.04835, 0, 0.8789], + "945": [0, 0.44444, 0, 0, 0.76064], + "946": [0.19444, 0.69444, 0.03403, 0, 0.65972], + "947": [0.19444, 0.44444, 0.06389, 0, 0.59003], + "948": [0, 0.69444, 0.03819, 0, 0.52222], + "949": [0, 0.44444, 0, 0, 0.52882], + "950": [0.19444, 0.69444, 0.06215, 0, 0.50833], + "951": [0.19444, 0.44444, 0.03704, 0, 0.6], + "952": [0, 0.69444, 0.03194, 0, 0.5618], + "953": [0, 0.44444, 0, 0, 0.41204], + "954": [0, 0.44444, 0, 0, 0.66759], + "955": [0, 0.69444, 0, 0, 0.67083], + "956": [0.19444, 0.44444, 0, 0, 0.70787], + "957": [0, 0.44444, 0.06898, 0, 0.57685], + "958": [0.19444, 0.69444, 0.03021, 0, 0.50833], + "959": [0, 0.44444, 0, 0, 0.58472], + "960": [0, 0.44444, 0.03704, 0, 0.68241], + "961": [0.19444, 0.44444, 0, 0, 0.6118], + "962": [0.09722, 0.44444, 0.07917, 0, 0.42361], + "963": [0, 0.44444, 0.03704, 0, 0.68588], + "964": [0, 0.44444, 0.13472, 0, 0.52083], + "965": [0, 0.44444, 0.03704, 0, 0.63055], + "966": [0.19444, 0.44444, 0, 0, 0.74722], + "967": [0.19444, 0.44444, 0, 0, 0.71805], + "968": [0.19444, 0.69444, 0.03704, 0, 0.75833], + "969": [0, 0.44444, 0.03704, 0, 0.71782], + "977": [0, 0.69444, 0, 0, 0.69155], + "981": [0.19444, 0.69444, 0, 0, 0.7125], + "982": [0, 0.44444, 0.03194, 0, 0.975], + "1009": [0.19444, 0.44444, 0, 0, 0.6118], + "1013": [0, 0.44444, 0, 0, 0.48333], + "57649": [0, 0.44444, 0, 0, 0.39352], + "57911": [0.19444, 0.44444, 0, 0, 0.43889] + }, + "Math-Italic": { + "32": [0, 0, 0, 0, 0.25], + "48": [0, 0.43056, 0, 0, 0.5], + "49": [0, 0.43056, 0, 0, 0.5], + "50": [0, 0.43056, 0, 0, 0.5], + "51": [0.19444, 0.43056, 0, 0, 0.5], + "52": [0.19444, 0.43056, 0, 0, 0.5], + "53": [0.19444, 0.43056, 0, 0, 0.5], + "54": [0, 0.64444, 0, 0, 0.5], + "55": [0.19444, 0.43056, 0, 0, 0.5], + "56": [0, 0.64444, 0, 0, 0.5], + "57": [0.19444, 0.43056, 0, 0, 0.5], + "65": [0, 0.68333, 0, 0.13889, 0.75], + "66": [0, 0.68333, 0.05017, 0.08334, 0.75851], + "67": [0, 0.68333, 0.07153, 0.08334, 0.71472], + "68": [0, 0.68333, 0.02778, 0.05556, 0.82792], + "69": [0, 0.68333, 0.05764, 0.08334, 0.7382], + "70": [0, 0.68333, 0.13889, 0.08334, 0.64306], + "71": [0, 0.68333, 0, 0.08334, 0.78625], + "72": [0, 0.68333, 0.08125, 0.05556, 0.83125], + "73": [0, 0.68333, 0.07847, 0.11111, 0.43958], + "74": [0, 0.68333, 0.09618, 0.16667, 0.55451], + "75": [0, 0.68333, 0.07153, 0.05556, 0.84931], + "76": [0, 0.68333, 0, 0.02778, 0.68056], + "77": [0, 0.68333, 0.10903, 0.08334, 0.97014], + "78": [0, 0.68333, 0.10903, 0.08334, 0.80347], + "79": [0, 0.68333, 0.02778, 0.08334, 0.76278], + "80": [0, 0.68333, 0.13889, 0.08334, 0.64201], + "81": [0.19444, 0.68333, 0, 0.08334, 0.79056], + "82": [0, 0.68333, 773e-5, 0.08334, 0.75929], + "83": [0, 0.68333, 0.05764, 0.08334, 0.6132], + "84": [0, 0.68333, 0.13889, 0.08334, 0.58438], + "85": [0, 0.68333, 0.10903, 0.02778, 0.68278], + "86": [0, 0.68333, 0.22222, 0, 0.58333], + "87": [0, 0.68333, 0.13889, 0, 0.94445], + "88": [0, 0.68333, 0.07847, 0.08334, 0.82847], + "89": [0, 0.68333, 0.22222, 0, 0.58056], + "90": [0, 0.68333, 0.07153, 0.08334, 0.68264], + "97": [0, 0.43056, 0, 0, 0.52859], + "98": [0, 0.69444, 0, 0, 0.42917], + "99": [0, 0.43056, 0, 0.05556, 0.43276], + "100": [0, 0.69444, 0, 0.16667, 0.52049], + "101": [0, 0.43056, 0, 0.05556, 0.46563], + "102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959], + "103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697], + "104": [0, 0.69444, 0, 0, 0.57616], + "105": [0, 0.65952, 0, 0, 0.34451], + "106": [0.19444, 0.65952, 0.05724, 0, 0.41181], + "107": [0, 0.69444, 0.03148, 0, 0.5206], + "108": [0, 0.69444, 0.01968, 0.08334, 0.29838], + "109": [0, 0.43056, 0, 0, 0.87801], + "110": [0, 0.43056, 0, 0, 0.60023], + "111": [0, 0.43056, 0, 0.05556, 0.48472], + "112": [0.19444, 0.43056, 0, 0.08334, 0.50313], + "113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641], + "114": [0, 0.43056, 0.02778, 0.05556, 0.45116], + "115": [0, 0.43056, 0, 0.05556, 0.46875], + "116": [0, 0.61508, 0, 0.08334, 0.36111], + "117": [0, 0.43056, 0, 0.02778, 0.57246], + "118": [0, 0.43056, 0.03588, 0.02778, 0.48472], + "119": [0, 0.43056, 0.02691, 0.08334, 0.71592], + "120": [0, 0.43056, 0, 0.02778, 0.57153], + "121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028], + "122": [0, 0.43056, 0.04398, 0.05556, 0.46505], + "160": [0, 0, 0, 0, 0.25], + "915": [0, 0.68333, 0.13889, 0.08334, 0.61528], + "916": [0, 0.68333, 0, 0.16667, 0.83334], + "920": [0, 0.68333, 0.02778, 0.08334, 0.76278], + "923": [0, 0.68333, 0, 0.16667, 0.69445], + "926": [0, 0.68333, 0.07569, 0.08334, 0.74236], + "928": [0, 0.68333, 0.08125, 0.05556, 0.83125], + "931": [0, 0.68333, 0.05764, 0.08334, 0.77986], + "933": [0, 0.68333, 0.13889, 0.05556, 0.58333], + "934": [0, 0.68333, 0, 0.08334, 0.66667], + "936": [0, 0.68333, 0.11, 0.05556, 0.61222], + "937": [0, 0.68333, 0.05017, 0.08334, 0.7724], + "945": [0, 0.43056, 37e-4, 0.02778, 0.6397], + "946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563], + "947": [0.19444, 0.43056, 0.05556, 0, 0.51773], + "948": [0, 0.69444, 0.03785, 0.05556, 0.44444], + "949": [0, 0.43056, 0, 0.08334, 0.46632], + "950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375], + "951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653], + "952": [0, 0.69444, 0.02778, 0.08334, 0.46944], + "953": [0, 0.43056, 0, 0.05556, 0.35394], + "954": [0, 0.43056, 0, 0, 0.57616], + "955": [0, 0.69444, 0, 0, 0.58334], + "956": [0.19444, 0.43056, 0, 0.02778, 0.60255], + "957": [0, 0.43056, 0.06366, 0.02778, 0.49398], + "958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375], + "959": [0, 0.43056, 0, 0.05556, 0.48472], + "960": [0, 0.43056, 0.03588, 0, 0.57003], + "961": [0.19444, 0.43056, 0, 0.08334, 0.51702], + "962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285], + "963": [0, 0.43056, 0.03588, 0, 0.57141], + "964": [0, 0.43056, 0.1132, 0.02778, 0.43715], + "965": [0, 0.43056, 0.03588, 0.02778, 0.54028], + "966": [0.19444, 0.43056, 0, 0.08334, 0.65417], + "967": [0.19444, 0.43056, 0, 0.05556, 0.62569], + "968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139], + "969": [0, 0.43056, 0.03588, 0, 0.62245], + "977": [0, 0.69444, 0, 0.08334, 0.59144], + "981": [0.19444, 0.69444, 0, 0.08334, 0.59583], + "982": [0, 0.43056, 0.02778, 0, 0.82813], + "1009": [0.19444, 0.43056, 0, 0.08334, 0.51702], + "1013": [0, 0.43056, 0, 0.05556, 0.4059], + "57649": [0, 0.43056, 0, 0.02778, 0.32246], + "57911": [0.19444, 0.43056, 0, 0.08334, 0.38403] + }, + "SansSerif-Bold": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69444, 0, 0, 0.36667], + "34": [0, 0.69444, 0, 0, 0.55834], + "35": [0.19444, 0.69444, 0, 0, 0.91667], + "36": [0.05556, 0.75, 0, 0, 0.55], + "37": [0.05556, 0.75, 0, 0, 1.02912], + "38": [0, 0.69444, 0, 0, 0.83056], + "39": [0, 0.69444, 0, 0, 0.30556], + "40": [0.25, 0.75, 0, 0, 0.42778], + "41": [0.25, 0.75, 0, 0, 0.42778], + "42": [0, 0.75, 0, 0, 0.55], + "43": [0.11667, 0.61667, 0, 0, 0.85556], + "44": [0.10556, 0.13056, 0, 0, 0.30556], + "45": [0, 0.45833, 0, 0, 0.36667], + "46": [0, 0.13056, 0, 0, 0.30556], + "47": [0.25, 0.75, 0, 0, 0.55], + "48": [0, 0.69444, 0, 0, 0.55], + "49": [0, 0.69444, 0, 0, 0.55], + "50": [0, 0.69444, 0, 0, 0.55], + "51": [0, 0.69444, 0, 0, 0.55], + "52": [0, 0.69444, 0, 0, 0.55], + "53": [0, 0.69444, 0, 0, 0.55], + "54": [0, 0.69444, 0, 0, 0.55], + "55": [0, 0.69444, 0, 0, 0.55], + "56": [0, 0.69444, 0, 0, 0.55], + "57": [0, 0.69444, 0, 0, 0.55], + "58": [0, 0.45833, 0, 0, 0.30556], + "59": [0.10556, 0.45833, 0, 0, 0.30556], + "61": [-0.09375, 0.40625, 0, 0, 0.85556], + "63": [0, 0.69444, 0, 0, 0.51945], + "64": [0, 0.69444, 0, 0, 0.73334], + "65": [0, 0.69444, 0, 0, 0.73334], + "66": [0, 0.69444, 0, 0, 0.73334], + "67": [0, 0.69444, 0, 0, 0.70278], + "68": [0, 0.69444, 0, 0, 0.79445], + "69": [0, 0.69444, 0, 0, 0.64167], + "70": [0, 0.69444, 0, 0, 0.61111], + "71": [0, 0.69444, 0, 0, 0.73334], + "72": [0, 0.69444, 0, 0, 0.79445], + "73": [0, 0.69444, 0, 0, 0.33056], + "74": [0, 0.69444, 0, 0, 0.51945], + "75": [0, 0.69444, 0, 0, 0.76389], + "76": [0, 0.69444, 0, 0, 0.58056], + "77": [0, 0.69444, 0, 0, 0.97778], + "78": [0, 0.69444, 0, 0, 0.79445], + "79": [0, 0.69444, 0, 0, 0.79445], + "80": [0, 0.69444, 0, 0, 0.70278], + "81": [0.10556, 0.69444, 0, 0, 0.79445], + "82": [0, 0.69444, 0, 0, 0.70278], + "83": [0, 0.69444, 0, 0, 0.61111], + "84": [0, 0.69444, 0, 0, 0.73334], + "85": [0, 0.69444, 0, 0, 0.76389], + "86": [0, 0.69444, 0.01528, 0, 0.73334], + "87": [0, 0.69444, 0.01528, 0, 1.03889], + "88": [0, 0.69444, 0, 0, 0.73334], + "89": [0, 0.69444, 0.0275, 0, 0.73334], + "90": [0, 0.69444, 0, 0, 0.67223], + "91": [0.25, 0.75, 0, 0, 0.34306], + "93": [0.25, 0.75, 0, 0, 0.34306], + "94": [0, 0.69444, 0, 0, 0.55], + "95": [0.35, 0.10833, 0.03056, 0, 0.55], + "97": [0, 0.45833, 0, 0, 0.525], + "98": [0, 0.69444, 0, 0, 0.56111], + "99": [0, 0.45833, 0, 0, 0.48889], + "100": [0, 0.69444, 0, 0, 0.56111], + "101": [0, 0.45833, 0, 0, 0.51111], + "102": [0, 0.69444, 0.07639, 0, 0.33611], + "103": [0.19444, 0.45833, 0.01528, 0, 0.55], + "104": [0, 0.69444, 0, 0, 0.56111], + "105": [0, 0.69444, 0, 0, 0.25556], + "106": [0.19444, 0.69444, 0, 0, 0.28611], + "107": [0, 0.69444, 0, 0, 0.53056], + "108": [0, 0.69444, 0, 0, 0.25556], + "109": [0, 0.45833, 0, 0, 0.86667], + "110": [0, 0.45833, 0, 0, 0.56111], + "111": [0, 0.45833, 0, 0, 0.55], + "112": [0.19444, 0.45833, 0, 0, 0.56111], + "113": [0.19444, 0.45833, 0, 0, 0.56111], + "114": [0, 0.45833, 0.01528, 0, 0.37222], + "115": [0, 0.45833, 0, 0, 0.42167], + "116": [0, 0.58929, 0, 0, 0.40417], + "117": [0, 0.45833, 0, 0, 0.56111], + "118": [0, 0.45833, 0.01528, 0, 0.5], + "119": [0, 0.45833, 0.01528, 0, 0.74445], + "120": [0, 0.45833, 0, 0, 0.5], + "121": [0.19444, 0.45833, 0.01528, 0, 0.5], + "122": [0, 0.45833, 0, 0, 0.47639], + "126": [0.35, 0.34444, 0, 0, 0.55], + "160": [0, 0, 0, 0, 0.25], + "168": [0, 0.69444, 0, 0, 0.55], + "176": [0, 0.69444, 0, 0, 0.73334], + "180": [0, 0.69444, 0, 0, 0.55], + "184": [0.17014, 0, 0, 0, 0.48889], + "305": [0, 0.45833, 0, 0, 0.25556], + "567": [0.19444, 0.45833, 0, 0, 0.28611], + "710": [0, 0.69444, 0, 0, 0.55], + "711": [0, 0.63542, 0, 0, 0.55], + "713": [0, 0.63778, 0, 0, 0.55], + "728": [0, 0.69444, 0, 0, 0.55], + "729": [0, 0.69444, 0, 0, 0.30556], + "730": [0, 0.69444, 0, 0, 0.73334], + "732": [0, 0.69444, 0, 0, 0.55], + "733": [0, 0.69444, 0, 0, 0.55], + "915": [0, 0.69444, 0, 0, 0.58056], + "916": [0, 0.69444, 0, 0, 0.91667], + "920": [0, 0.69444, 0, 0, 0.85556], + "923": [0, 0.69444, 0, 0, 0.67223], + "926": [0, 0.69444, 0, 0, 0.73334], + "928": [0, 0.69444, 0, 0, 0.79445], + "931": [0, 0.69444, 0, 0, 0.79445], + "933": [0, 0.69444, 0, 0, 0.85556], + "934": [0, 0.69444, 0, 0, 0.79445], + "936": [0, 0.69444, 0, 0, 0.85556], + "937": [0, 0.69444, 0, 0, 0.79445], + "8211": [0, 0.45833, 0.03056, 0, 0.55], + "8212": [0, 0.45833, 0.03056, 0, 1.10001], + "8216": [0, 0.69444, 0, 0, 0.30556], + "8217": [0, 0.69444, 0, 0, 0.30556], + "8220": [0, 0.69444, 0, 0, 0.55834], + "8221": [0, 0.69444, 0, 0, 0.55834] + }, + "SansSerif-Italic": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69444, 0.05733, 0, 0.31945], + "34": [0, 0.69444, 316e-5, 0, 0.5], + "35": [0.19444, 0.69444, 0.05087, 0, 0.83334], + "36": [0.05556, 0.75, 0.11156, 0, 0.5], + "37": [0.05556, 0.75, 0.03126, 0, 0.83334], + "38": [0, 0.69444, 0.03058, 0, 0.75834], + "39": [0, 0.69444, 0.07816, 0, 0.27778], + "40": [0.25, 0.75, 0.13164, 0, 0.38889], + "41": [0.25, 0.75, 0.02536, 0, 0.38889], + "42": [0, 0.75, 0.11775, 0, 0.5], + "43": [0.08333, 0.58333, 0.02536, 0, 0.77778], + "44": [0.125, 0.08333, 0, 0, 0.27778], + "45": [0, 0.44444, 0.01946, 0, 0.33333], + "46": [0, 0.08333, 0, 0, 0.27778], + "47": [0.25, 0.75, 0.13164, 0, 0.5], + "48": [0, 0.65556, 0.11156, 0, 0.5], + "49": [0, 0.65556, 0.11156, 0, 0.5], + "50": [0, 0.65556, 0.11156, 0, 0.5], + "51": [0, 0.65556, 0.11156, 0, 0.5], + "52": [0, 0.65556, 0.11156, 0, 0.5], + "53": [0, 0.65556, 0.11156, 0, 0.5], + "54": [0, 0.65556, 0.11156, 0, 0.5], + "55": [0, 0.65556, 0.11156, 0, 0.5], + "56": [0, 0.65556, 0.11156, 0, 0.5], + "57": [0, 0.65556, 0.11156, 0, 0.5], + "58": [0, 0.44444, 0.02502, 0, 0.27778], + "59": [0.125, 0.44444, 0.02502, 0, 0.27778], + "61": [-0.13, 0.37, 0.05087, 0, 0.77778], + "63": [0, 0.69444, 0.11809, 0, 0.47222], + "64": [0, 0.69444, 0.07555, 0, 0.66667], + "65": [0, 0.69444, 0, 0, 0.66667], + "66": [0, 0.69444, 0.08293, 0, 0.66667], + "67": [0, 0.69444, 0.11983, 0, 0.63889], + "68": [0, 0.69444, 0.07555, 0, 0.72223], + "69": [0, 0.69444, 0.11983, 0, 0.59722], + "70": [0, 0.69444, 0.13372, 0, 0.56945], + "71": [0, 0.69444, 0.11983, 0, 0.66667], + "72": [0, 0.69444, 0.08094, 0, 0.70834], + "73": [0, 0.69444, 0.13372, 0, 0.27778], + "74": [0, 0.69444, 0.08094, 0, 0.47222], + "75": [0, 0.69444, 0.11983, 0, 0.69445], + "76": [0, 0.69444, 0, 0, 0.54167], + "77": [0, 0.69444, 0.08094, 0, 0.875], + "78": [0, 0.69444, 0.08094, 0, 0.70834], + "79": [0, 0.69444, 0.07555, 0, 0.73611], + "80": [0, 0.69444, 0.08293, 0, 0.63889], + "81": [0.125, 0.69444, 0.07555, 0, 0.73611], + "82": [0, 0.69444, 0.08293, 0, 0.64584], + "83": [0, 0.69444, 0.09205, 0, 0.55556], + "84": [0, 0.69444, 0.13372, 0, 0.68056], + "85": [0, 0.69444, 0.08094, 0, 0.6875], + "86": [0, 0.69444, 0.1615, 0, 0.66667], + "87": [0, 0.69444, 0.1615, 0, 0.94445], + "88": [0, 0.69444, 0.13372, 0, 0.66667], + "89": [0, 0.69444, 0.17261, 0, 0.66667], + "90": [0, 0.69444, 0.11983, 0, 0.61111], + "91": [0.25, 0.75, 0.15942, 0, 0.28889], + "93": [0.25, 0.75, 0.08719, 0, 0.28889], + "94": [0, 0.69444, 0.0799, 0, 0.5], + "95": [0.35, 0.09444, 0.08616, 0, 0.5], + "97": [0, 0.44444, 981e-5, 0, 0.48056], + "98": [0, 0.69444, 0.03057, 0, 0.51667], + "99": [0, 0.44444, 0.08336, 0, 0.44445], + "100": [0, 0.69444, 0.09483, 0, 0.51667], + "101": [0, 0.44444, 0.06778, 0, 0.44445], + "102": [0, 0.69444, 0.21705, 0, 0.30556], + "103": [0.19444, 0.44444, 0.10836, 0, 0.5], + "104": [0, 0.69444, 0.01778, 0, 0.51667], + "105": [0, 0.67937, 0.09718, 0, 0.23889], + "106": [0.19444, 0.67937, 0.09162, 0, 0.26667], + "107": [0, 0.69444, 0.08336, 0, 0.48889], + "108": [0, 0.69444, 0.09483, 0, 0.23889], + "109": [0, 0.44444, 0.01778, 0, 0.79445], + "110": [0, 0.44444, 0.01778, 0, 0.51667], + "111": [0, 0.44444, 0.06613, 0, 0.5], + "112": [0.19444, 0.44444, 0.0389, 0, 0.51667], + "113": [0.19444, 0.44444, 0.04169, 0, 0.51667], + "114": [0, 0.44444, 0.10836, 0, 0.34167], + "115": [0, 0.44444, 0.0778, 0, 0.38333], + "116": [0, 0.57143, 0.07225, 0, 0.36111], + "117": [0, 0.44444, 0.04169, 0, 0.51667], + "118": [0, 0.44444, 0.10836, 0, 0.46111], + "119": [0, 0.44444, 0.10836, 0, 0.68334], + "120": [0, 0.44444, 0.09169, 0, 0.46111], + "121": [0.19444, 0.44444, 0.10836, 0, 0.46111], + "122": [0, 0.44444, 0.08752, 0, 0.43472], + "126": [0.35, 0.32659, 0.08826, 0, 0.5], + "160": [0, 0, 0, 0, 0.25], + "168": [0, 0.67937, 0.06385, 0, 0.5], + "176": [0, 0.69444, 0, 0, 0.73752], + "184": [0.17014, 0, 0, 0, 0.44445], + "305": [0, 0.44444, 0.04169, 0, 0.23889], + "567": [0.19444, 0.44444, 0.04169, 0, 0.26667], + "710": [0, 0.69444, 0.0799, 0, 0.5], + "711": [0, 0.63194, 0.08432, 0, 0.5], + "713": [0, 0.60889, 0.08776, 0, 0.5], + "714": [0, 0.69444, 0.09205, 0, 0.5], + "715": [0, 0.69444, 0, 0, 0.5], + "728": [0, 0.69444, 0.09483, 0, 0.5], + "729": [0, 0.67937, 0.07774, 0, 0.27778], + "730": [0, 0.69444, 0, 0, 0.73752], + "732": [0, 0.67659, 0.08826, 0, 0.5], + "733": [0, 0.69444, 0.09205, 0, 0.5], + "915": [0, 0.69444, 0.13372, 0, 0.54167], + "916": [0, 0.69444, 0, 0, 0.83334], + "920": [0, 0.69444, 0.07555, 0, 0.77778], + "923": [0, 0.69444, 0, 0, 0.61111], + "926": [0, 0.69444, 0.12816, 0, 0.66667], + "928": [0, 0.69444, 0.08094, 0, 0.70834], + "931": [0, 0.69444, 0.11983, 0, 0.72222], + "933": [0, 0.69444, 0.09031, 0, 0.77778], + "934": [0, 0.69444, 0.04603, 0, 0.72222], + "936": [0, 0.69444, 0.09031, 0, 0.77778], + "937": [0, 0.69444, 0.08293, 0, 0.72222], + "8211": [0, 0.44444, 0.08616, 0, 0.5], + "8212": [0, 0.44444, 0.08616, 0, 1], + "8216": [0, 0.69444, 0.07816, 0, 0.27778], + "8217": [0, 0.69444, 0.07816, 0, 0.27778], + "8220": [0, 0.69444, 0.14205, 0, 0.5], + "8221": [0, 0.69444, 316e-5, 0, 0.5] + }, + "SansSerif-Regular": { + "32": [0, 0, 0, 0, 0.25], + "33": [0, 0.69444, 0, 0, 0.31945], + "34": [0, 0.69444, 0, 0, 0.5], + "35": [0.19444, 0.69444, 0, 0, 0.83334], + "36": [0.05556, 0.75, 0, 0, 0.5], + "37": [0.05556, 0.75, 0, 0, 0.83334], + "38": [0, 0.69444, 0, 0, 0.75834], + "39": [0, 0.69444, 0, 0, 0.27778], + "40": [0.25, 0.75, 0, 0, 0.38889], + "41": [0.25, 0.75, 0, 0, 0.38889], + "42": [0, 0.75, 0, 0, 0.5], + "43": [0.08333, 0.58333, 0, 0, 0.77778], + "44": [0.125, 0.08333, 0, 0, 0.27778], + "45": [0, 0.44444, 0, 0, 0.33333], + "46": [0, 0.08333, 0, 0, 0.27778], + "47": [0.25, 0.75, 0, 0, 0.5], + "48": [0, 0.65556, 0, 0, 0.5], + "49": [0, 0.65556, 0, 0, 0.5], + "50": [0, 0.65556, 0, 0, 0.5], + "51": [0, 0.65556, 0, 0, 0.5], + "52": [0, 0.65556, 0, 0, 0.5], + "53": [0, 0.65556, 0, 0, 0.5], + "54": [0, 0.65556, 0, 0, 0.5], + "55": [0, 0.65556, 0, 0, 0.5], + "56": [0, 0.65556, 0, 0, 0.5], + "57": [0, 0.65556, 0, 0, 0.5], + "58": [0, 0.44444, 0, 0, 0.27778], + "59": [0.125, 0.44444, 0, 0, 0.27778], + "61": [-0.13, 0.37, 0, 0, 0.77778], + "63": [0, 0.69444, 0, 0, 0.47222], + "64": [0, 0.69444, 0, 0, 0.66667], + "65": [0, 0.69444, 0, 0, 0.66667], + "66": [0, 0.69444, 0, 0, 0.66667], + "67": [0, 0.69444, 0, 0, 0.63889], + "68": [0, 0.69444, 0, 0, 0.72223], + "69": [0, 0.69444, 0, 0, 0.59722], + "70": [0, 0.69444, 0, 0, 0.56945], + "71": [0, 0.69444, 0, 0, 0.66667], + "72": [0, 0.69444, 0, 0, 0.70834], + "73": [0, 0.69444, 0, 0, 0.27778], + "74": [0, 0.69444, 0, 0, 0.47222], + "75": [0, 0.69444, 0, 0, 0.69445], + "76": [0, 0.69444, 0, 0, 0.54167], + "77": [0, 0.69444, 0, 0, 0.875], + "78": [0, 0.69444, 0, 0, 0.70834], + "79": [0, 0.69444, 0, 0, 0.73611], + "80": [0, 0.69444, 0, 0, 0.63889], + "81": [0.125, 0.69444, 0, 0, 0.73611], + "82": [0, 0.69444, 0, 0, 0.64584], + "83": [0, 0.69444, 0, 0, 0.55556], + "84": [0, 0.69444, 0, 0, 0.68056], + "85": [0, 0.69444, 0, 0, 0.6875], + "86": [0, 0.69444, 0.01389, 0, 0.66667], + "87": [0, 0.69444, 0.01389, 0, 0.94445], + "88": [0, 0.69444, 0, 0, 0.66667], + "89": [0, 0.69444, 0.025, 0, 0.66667], + "90": [0, 0.69444, 0, 0, 0.61111], + "91": [0.25, 0.75, 0, 0, 0.28889], + "93": [0.25, 0.75, 0, 0, 0.28889], + "94": [0, 0.69444, 0, 0, 0.5], + "95": [0.35, 0.09444, 0.02778, 0, 0.5], + "97": [0, 0.44444, 0, 0, 0.48056], + "98": [0, 0.69444, 0, 0, 0.51667], + "99": [0, 0.44444, 0, 0, 0.44445], + "100": [0, 0.69444, 0, 0, 0.51667], + "101": [0, 0.44444, 0, 0, 0.44445], + "102": [0, 0.69444, 0.06944, 0, 0.30556], + "103": [0.19444, 0.44444, 0.01389, 0, 0.5], + "104": [0, 0.69444, 0, 0, 0.51667], + "105": [0, 0.67937, 0, 0, 0.23889], + "106": [0.19444, 0.67937, 0, 0, 0.26667], + "107": [0, 0.69444, 0, 0, 0.48889], + "108": [0, 0.69444, 0, 0, 0.23889], + "109": [0, 0.44444, 0, 0, 0.79445], + "110": [0, 0.44444, 0, 0, 0.51667], + "111": [0, 0.44444, 0, 0, 0.5], + "112": [0.19444, 0.44444, 0, 0, 0.51667], + "113": [0.19444, 0.44444, 0, 0, 0.51667], + "114": [0, 0.44444, 0.01389, 0, 0.34167], + "115": [0, 0.44444, 0, 0, 0.38333], + "116": [0, 0.57143, 0, 0, 0.36111], + "117": [0, 0.44444, 0, 0, 0.51667], + "118": [0, 0.44444, 0.01389, 0, 0.46111], + "119": [0, 0.44444, 0.01389, 0, 0.68334], + "120": [0, 0.44444, 0, 0, 0.46111], + "121": [0.19444, 0.44444, 0.01389, 0, 0.46111], + "122": [0, 0.44444, 0, 0, 0.43472], + "126": [0.35, 0.32659, 0, 0, 0.5], + "160": [0, 0, 0, 0, 0.25], + "168": [0, 0.67937, 0, 0, 0.5], + "176": [0, 0.69444, 0, 0, 0.66667], + "184": [0.17014, 0, 0, 0, 0.44445], + "305": [0, 0.44444, 0, 0, 0.23889], + "567": [0.19444, 0.44444, 0, 0, 0.26667], + "710": [0, 0.69444, 0, 0, 0.5], + "711": [0, 0.63194, 0, 0, 0.5], + "713": [0, 0.60889, 0, 0, 0.5], + "714": [0, 0.69444, 0, 0, 0.5], + "715": [0, 0.69444, 0, 0, 0.5], + "728": [0, 0.69444, 0, 0, 0.5], + "729": [0, 0.67937, 0, 0, 0.27778], + "730": [0, 0.69444, 0, 0, 0.66667], + "732": [0, 0.67659, 0, 0, 0.5], + "733": [0, 0.69444, 0, 0, 0.5], + "915": [0, 0.69444, 0, 0, 0.54167], + "916": [0, 0.69444, 0, 0, 0.83334], + "920": [0, 0.69444, 0, 0, 0.77778], + "923": [0, 0.69444, 0, 0, 0.61111], + "926": [0, 0.69444, 0, 0, 0.66667], + "928": [0, 0.69444, 0, 0, 0.70834], + "931": [0, 0.69444, 0, 0, 0.72222], + "933": [0, 0.69444, 0, 0, 0.77778], + "934": [0, 0.69444, 0, 0, 0.72222], + "936": [0, 0.69444, 0, 0, 0.77778], + "937": [0, 0.69444, 0, 0, 0.72222], + "8211": [0, 0.44444, 0.02778, 0, 0.5], + "8212": [0, 0.44444, 0.02778, 0, 1], + "8216": [0, 0.69444, 0, 0, 0.27778], + "8217": [0, 0.69444, 0, 0, 0.27778], + "8220": [0, 0.69444, 0, 0, 0.5], + "8221": [0, 0.69444, 0, 0, 0.5] + }, + "Script-Regular": { + "32": [0, 0, 0, 0, 0.25], + "65": [0, 0.7, 0.22925, 0, 0.80253], + "66": [0, 0.7, 0.04087, 0, 0.90757], + "67": [0, 0.7, 0.1689, 0, 0.66619], + "68": [0, 0.7, 0.09371, 0, 0.77443], + "69": [0, 0.7, 0.18583, 0, 0.56162], + "70": [0, 0.7, 0.13634, 0, 0.89544], + "71": [0, 0.7, 0.17322, 0, 0.60961], + "72": [0, 0.7, 0.29694, 0, 0.96919], + "73": [0, 0.7, 0.19189, 0, 0.80907], + "74": [0.27778, 0.7, 0.19189, 0, 1.05159], + "75": [0, 0.7, 0.31259, 0, 0.91364], + "76": [0, 0.7, 0.19189, 0, 0.87373], + "77": [0, 0.7, 0.15981, 0, 1.08031], + "78": [0, 0.7, 0.3525, 0, 0.9015], + "79": [0, 0.7, 0.08078, 0, 0.73787], + "80": [0, 0.7, 0.08078, 0, 1.01262], + "81": [0, 0.7, 0.03305, 0, 0.88282], + "82": [0, 0.7, 0.06259, 0, 0.85], + "83": [0, 0.7, 0.19189, 0, 0.86767], + "84": [0, 0.7, 0.29087, 0, 0.74697], + "85": [0, 0.7, 0.25815, 0, 0.79996], + "86": [0, 0.7, 0.27523, 0, 0.62204], + "87": [0, 0.7, 0.27523, 0, 0.80532], + "88": [0, 0.7, 0.26006, 0, 0.94445], + "89": [0, 0.7, 0.2939, 0, 0.70961], + "90": [0, 0.7, 0.24037, 0, 0.8212], + "160": [0, 0, 0, 0, 0.25] + }, + "Size1-Regular": { + "32": [0, 0, 0, 0, 0.25], + "40": [0.35001, 0.85, 0, 0, 0.45834], + "41": [0.35001, 0.85, 0, 0, 0.45834], + "47": [0.35001, 0.85, 0, 0, 0.57778], + "91": [0.35001, 0.85, 0, 0, 0.41667], + "92": [0.35001, 0.85, 0, 0, 0.57778], + "93": [0.35001, 0.85, 0, 0, 0.41667], + "123": [0.35001, 0.85, 0, 0, 0.58334], + "125": [0.35001, 0.85, 0, 0, 0.58334], + "160": [0, 0, 0, 0, 0.25], + "710": [0, 0.72222, 0, 0, 0.55556], + "732": [0, 0.72222, 0, 0, 0.55556], + "770": [0, 0.72222, 0, 0, 0.55556], + "771": [0, 0.72222, 0, 0, 0.55556], + "8214": [-99e-5, 0.601, 0, 0, 0.77778], + "8593": [1e-5, 0.6, 0, 0, 0.66667], + "8595": [1e-5, 0.6, 0, 0, 0.66667], + "8657": [1e-5, 0.6, 0, 0, 0.77778], + "8659": [1e-5, 0.6, 0, 0, 0.77778], + "8719": [0.25001, 0.75, 0, 0, 0.94445], + "8720": [0.25001, 0.75, 0, 0, 0.94445], + "8721": [0.25001, 0.75, 0, 0, 1.05556], + "8730": [0.35001, 0.85, 0, 0, 1], + "8739": [-599e-5, 0.606, 0, 0, 0.33333], + "8741": [-599e-5, 0.606, 0, 0, 0.55556], + "8747": [0.30612, 0.805, 0.19445, 0, 0.47222], + "8748": [0.306, 0.805, 0.19445, 0, 0.47222], + "8749": [0.306, 0.805, 0.19445, 0, 0.47222], + "8750": [0.30612, 0.805, 0.19445, 0, 0.47222], + "8896": [0.25001, 0.75, 0, 0, 0.83334], + "8897": [0.25001, 0.75, 0, 0, 0.83334], + "8898": [0.25001, 0.75, 0, 0, 0.83334], + "8899": [0.25001, 0.75, 0, 0, 0.83334], + "8968": [0.35001, 0.85, 0, 0, 0.47222], + "8969": [0.35001, 0.85, 0, 0, 0.47222], + "8970": [0.35001, 0.85, 0, 0, 0.47222], + "8971": [0.35001, 0.85, 0, 0, 0.47222], + "9168": [-99e-5, 0.601, 0, 0, 0.66667], + "10216": [0.35001, 0.85, 0, 0, 0.47222], + "10217": [0.35001, 0.85, 0, 0, 0.47222], + "10752": [0.25001, 0.75, 0, 0, 1.11111], + "10753": [0.25001, 0.75, 0, 0, 1.11111], + "10754": [0.25001, 0.75, 0, 0, 1.11111], + "10756": [0.25001, 0.75, 0, 0, 0.83334], + "10758": [0.25001, 0.75, 0, 0, 0.83334] + }, + "Size2-Regular": { + "32": [0, 0, 0, 0, 0.25], + "40": [0.65002, 1.15, 0, 0, 0.59722], + "41": [0.65002, 1.15, 0, 0, 0.59722], + "47": [0.65002, 1.15, 0, 0, 0.81111], + "91": [0.65002, 1.15, 0, 0, 0.47222], + "92": [0.65002, 1.15, 0, 0, 0.81111], + "93": [0.65002, 1.15, 0, 0, 0.47222], + "123": [0.65002, 1.15, 0, 0, 0.66667], + "125": [0.65002, 1.15, 0, 0, 0.66667], + "160": [0, 0, 0, 0, 0.25], + "710": [0, 0.75, 0, 0, 1], + "732": [0, 0.75, 0, 0, 1], + "770": [0, 0.75, 0, 0, 1], + "771": [0, 0.75, 0, 0, 1], + "8719": [0.55001, 1.05, 0, 0, 1.27778], + "8720": [0.55001, 1.05, 0, 0, 1.27778], + "8721": [0.55001, 1.05, 0, 0, 1.44445], + "8730": [0.65002, 1.15, 0, 0, 1], + "8747": [0.86225, 1.36, 0.44445, 0, 0.55556], + "8748": [0.862, 1.36, 0.44445, 0, 0.55556], + "8749": [0.862, 1.36, 0.44445, 0, 0.55556], + "8750": [0.86225, 1.36, 0.44445, 0, 0.55556], + "8896": [0.55001, 1.05, 0, 0, 1.11111], + "8897": [0.55001, 1.05, 0, 0, 1.11111], + "8898": [0.55001, 1.05, 0, 0, 1.11111], + "8899": [0.55001, 1.05, 0, 0, 1.11111], + "8968": [0.65002, 1.15, 0, 0, 0.52778], + "8969": [0.65002, 1.15, 0, 0, 0.52778], + "8970": [0.65002, 1.15, 0, 0, 0.52778], + "8971": [0.65002, 1.15, 0, 0, 0.52778], + "10216": [0.65002, 1.15, 0, 0, 0.61111], + "10217": [0.65002, 1.15, 0, 0, 0.61111], + "10752": [0.55001, 1.05, 0, 0, 1.51112], + "10753": [0.55001, 1.05, 0, 0, 1.51112], + "10754": [0.55001, 1.05, 0, 0, 1.51112], + "10756": [0.55001, 1.05, 0, 0, 1.11111], + "10758": [0.55001, 1.05, 0, 0, 1.11111] + }, + "Size3-Regular": { + "32": [0, 0, 0, 0, 0.25], + "40": [0.95003, 1.45, 0, 0, 0.73611], + "41": [0.95003, 1.45, 0, 0, 0.73611], + "47": [0.95003, 1.45, 0, 0, 1.04445], + "91": [0.95003, 1.45, 0, 0, 0.52778], + "92": [0.95003, 1.45, 0, 0, 1.04445], + "93": [0.95003, 1.45, 0, 0, 0.52778], + "123": [0.95003, 1.45, 0, 0, 0.75], + "125": [0.95003, 1.45, 0, 0, 0.75], + "160": [0, 0, 0, 0, 0.25], + "710": [0, 0.75, 0, 0, 1.44445], + "732": [0, 0.75, 0, 0, 1.44445], + "770": [0, 0.75, 0, 0, 1.44445], + "771": [0, 0.75, 0, 0, 1.44445], + "8730": [0.95003, 1.45, 0, 0, 1], + "8968": [0.95003, 1.45, 0, 0, 0.58334], + "8969": [0.95003, 1.45, 0, 0, 0.58334], + "8970": [0.95003, 1.45, 0, 0, 0.58334], + "8971": [0.95003, 1.45, 0, 0, 0.58334], + "10216": [0.95003, 1.45, 0, 0, 0.75], + "10217": [0.95003, 1.45, 0, 0, 0.75] + }, + "Size4-Regular": { + "32": [0, 0, 0, 0, 0.25], + "40": [1.25003, 1.75, 0, 0, 0.79167], + "41": [1.25003, 1.75, 0, 0, 0.79167], + "47": [1.25003, 1.75, 0, 0, 1.27778], + "91": [1.25003, 1.75, 0, 0, 0.58334], + "92": [1.25003, 1.75, 0, 0, 1.27778], + "93": [1.25003, 1.75, 0, 0, 0.58334], + "123": [1.25003, 1.75, 0, 0, 0.80556], + "125": [1.25003, 1.75, 0, 0, 0.80556], + "160": [0, 0, 0, 0, 0.25], + "710": [0, 0.825, 0, 0, 1.8889], + "732": [0, 0.825, 0, 0, 1.8889], + "770": [0, 0.825, 0, 0, 1.8889], + "771": [0, 0.825, 0, 0, 1.8889], + "8730": [1.25003, 1.75, 0, 0, 1], + "8968": [1.25003, 1.75, 0, 0, 0.63889], + "8969": [1.25003, 1.75, 0, 0, 0.63889], + "8970": [1.25003, 1.75, 0, 0, 0.63889], + "8971": [1.25003, 1.75, 0, 0, 0.63889], + "9115": [0.64502, 1.155, 0, 0, 0.875], + "9116": [1e-5, 0.6, 0, 0, 0.875], + "9117": [0.64502, 1.155, 0, 0, 0.875], + "9118": [0.64502, 1.155, 0, 0, 0.875], + "9119": [1e-5, 0.6, 0, 0, 0.875], + "9120": [0.64502, 1.155, 0, 0, 0.875], + "9121": [0.64502, 1.155, 0, 0, 0.66667], + "9122": [-99e-5, 0.601, 0, 0, 0.66667], + "9123": [0.64502, 1.155, 0, 0, 0.66667], + "9124": [0.64502, 1.155, 0, 0, 0.66667], + "9125": [-99e-5, 0.601, 0, 0, 0.66667], + "9126": [0.64502, 1.155, 0, 0, 0.66667], + "9127": [1e-5, 0.9, 0, 0, 0.88889], + "9128": [0.65002, 1.15, 0, 0, 0.88889], + "9129": [0.90001, 0, 0, 0, 0.88889], + "9130": [0, 0.3, 0, 0, 0.88889], + "9131": [1e-5, 0.9, 0, 0, 0.88889], + "9132": [0.65002, 1.15, 0, 0, 0.88889], + "9133": [0.90001, 0, 0, 0, 0.88889], + "9143": [0.88502, 0.915, 0, 0, 1.05556], + "10216": [1.25003, 1.75, 0, 0, 0.80556], + "10217": [1.25003, 1.75, 0, 0, 0.80556], + "57344": [-499e-5, 0.605, 0, 0, 1.05556], + "57345": [-499e-5, 0.605, 0, 0, 1.05556], + "57680": [0, 0.12, 0, 0, 0.45], + "57681": [0, 0.12, 0, 0, 0.45], + "57682": [0, 0.12, 0, 0, 0.45], + "57683": [0, 0.12, 0, 0, 0.45] + }, + "Typewriter-Regular": { + "32": [0, 0, 0, 0, 0.525], + "33": [0, 0.61111, 0, 0, 0.525], + "34": [0, 0.61111, 0, 0, 0.525], + "35": [0, 0.61111, 0, 0, 0.525], + "36": [0.08333, 0.69444, 0, 0, 0.525], + "37": [0.08333, 0.69444, 0, 0, 0.525], + "38": [0, 0.61111, 0, 0, 0.525], + "39": [0, 0.61111, 0, 0, 0.525], + "40": [0.08333, 0.69444, 0, 0, 0.525], + "41": [0.08333, 0.69444, 0, 0, 0.525], + "42": [0, 0.52083, 0, 0, 0.525], + "43": [-0.08056, 0.53055, 0, 0, 0.525], + "44": [0.13889, 0.125, 0, 0, 0.525], + "45": [-0.08056, 0.53055, 0, 0, 0.525], + "46": [0, 0.125, 0, 0, 0.525], + "47": [0.08333, 0.69444, 0, 0, 0.525], + "48": [0, 0.61111, 0, 0, 0.525], + "49": [0, 0.61111, 0, 0, 0.525], + "50": [0, 0.61111, 0, 0, 0.525], + "51": [0, 0.61111, 0, 0, 0.525], + "52": [0, 0.61111, 0, 0, 0.525], + "53": [0, 0.61111, 0, 0, 0.525], + "54": [0, 0.61111, 0, 0, 0.525], + "55": [0, 0.61111, 0, 0, 0.525], + "56": [0, 0.61111, 0, 0, 0.525], + "57": [0, 0.61111, 0, 0, 0.525], + "58": [0, 0.43056, 0, 0, 0.525], + "59": [0.13889, 0.43056, 0, 0, 0.525], + "60": [-0.05556, 0.55556, 0, 0, 0.525], + "61": [-0.19549, 0.41562, 0, 0, 0.525], + "62": [-0.05556, 0.55556, 0, 0, 0.525], + "63": [0, 0.61111, 0, 0, 0.525], + "64": [0, 0.61111, 0, 0, 0.525], + "65": [0, 0.61111, 0, 0, 0.525], + "66": [0, 0.61111, 0, 0, 0.525], + "67": [0, 0.61111, 0, 0, 0.525], + "68": [0, 0.61111, 0, 0, 0.525], + "69": [0, 0.61111, 0, 0, 0.525], + "70": [0, 0.61111, 0, 0, 0.525], + "71": [0, 0.61111, 0, 0, 0.525], + "72": [0, 0.61111, 0, 0, 0.525], + "73": [0, 0.61111, 0, 0, 0.525], + "74": [0, 0.61111, 0, 0, 0.525], + "75": [0, 0.61111, 0, 0, 0.525], + "76": [0, 0.61111, 0, 0, 0.525], + "77": [0, 0.61111, 0, 0, 0.525], + "78": [0, 0.61111, 0, 0, 0.525], + "79": [0, 0.61111, 0, 0, 0.525], + "80": [0, 0.61111, 0, 0, 0.525], + "81": [0.13889, 0.61111, 0, 0, 0.525], + "82": [0, 0.61111, 0, 0, 0.525], + "83": [0, 0.61111, 0, 0, 0.525], + "84": [0, 0.61111, 0, 0, 0.525], + "85": [0, 0.61111, 0, 0, 0.525], + "86": [0, 0.61111, 0, 0, 0.525], + "87": [0, 0.61111, 0, 0, 0.525], + "88": [0, 0.61111, 0, 0, 0.525], + "89": [0, 0.61111, 0, 0, 0.525], + "90": [0, 0.61111, 0, 0, 0.525], + "91": [0.08333, 0.69444, 0, 0, 0.525], + "92": [0.08333, 0.69444, 0, 0, 0.525], + "93": [0.08333, 0.69444, 0, 0, 0.525], + "94": [0, 0.61111, 0, 0, 0.525], + "95": [0.09514, 0, 0, 0, 0.525], + "96": [0, 0.61111, 0, 0, 0.525], + "97": [0, 0.43056, 0, 0, 0.525], + "98": [0, 0.61111, 0, 0, 0.525], + "99": [0, 0.43056, 0, 0, 0.525], + "100": [0, 0.61111, 0, 0, 0.525], + "101": [0, 0.43056, 0, 0, 0.525], + "102": [0, 0.61111, 0, 0, 0.525], + "103": [0.22222, 0.43056, 0, 0, 0.525], + "104": [0, 0.61111, 0, 0, 0.525], + "105": [0, 0.61111, 0, 0, 0.525], + "106": [0.22222, 0.61111, 0, 0, 0.525], + "107": [0, 0.61111, 0, 0, 0.525], + "108": [0, 0.61111, 0, 0, 0.525], + "109": [0, 0.43056, 0, 0, 0.525], + "110": [0, 0.43056, 0, 0, 0.525], + "111": [0, 0.43056, 0, 0, 0.525], + "112": [0.22222, 0.43056, 0, 0, 0.525], + "113": [0.22222, 0.43056, 0, 0, 0.525], + "114": [0, 0.43056, 0, 0, 0.525], + "115": [0, 0.43056, 0, 0, 0.525], + "116": [0, 0.55358, 0, 0, 0.525], + "117": [0, 0.43056, 0, 0, 0.525], + "118": [0, 0.43056, 0, 0, 0.525], + "119": [0, 0.43056, 0, 0, 0.525], + "120": [0, 0.43056, 0, 0, 0.525], + "121": [0.22222, 0.43056, 0, 0, 0.525], + "122": [0, 0.43056, 0, 0, 0.525], + "123": [0.08333, 0.69444, 0, 0, 0.525], + "124": [0.08333, 0.69444, 0, 0, 0.525], + "125": [0.08333, 0.69444, 0, 0, 0.525], + "126": [0, 0.61111, 0, 0, 0.525], + "127": [0, 0.61111, 0, 0, 0.525], + "160": [0, 0, 0, 0, 0.525], + "176": [0, 0.61111, 0, 0, 0.525], + "184": [0.19445, 0, 0, 0, 0.525], + "305": [0, 0.43056, 0, 0, 0.525], + "567": [0.22222, 0.43056, 0, 0, 0.525], + "711": [0, 0.56597, 0, 0, 0.525], + "713": [0, 0.56555, 0, 0, 0.525], + "714": [0, 0.61111, 0, 0, 0.525], + "715": [0, 0.61111, 0, 0, 0.525], + "728": [0, 0.61111, 0, 0, 0.525], + "730": [0, 0.61111, 0, 0, 0.525], + "770": [0, 0.61111, 0, 0, 0.525], + "771": [0, 0.61111, 0, 0, 0.525], + "776": [0, 0.61111, 0, 0, 0.525], + "915": [0, 0.61111, 0, 0, 0.525], + "916": [0, 0.61111, 0, 0, 0.525], + "920": [0, 0.61111, 0, 0, 0.525], + "923": [0, 0.61111, 0, 0, 0.525], + "926": [0, 0.61111, 0, 0, 0.525], + "928": [0, 0.61111, 0, 0, 0.525], + "931": [0, 0.61111, 0, 0, 0.525], + "933": [0, 0.61111, 0, 0, 0.525], + "934": [0, 0.61111, 0, 0, 0.525], + "936": [0, 0.61111, 0, 0, 0.525], + "937": [0, 0.61111, 0, 0, 0.525], + "8216": [0, 0.61111, 0, 0, 0.525], + "8217": [0, 0.61111, 0, 0, 0.525], + "8242": [0, 0.61111, 0, 0, 0.525], + "9251": [0.11111, 0.21944, 0, 0, 0.525] + } + }; + sigmasAndXis = { + slant: [0.25, 0.25, 0.25], + // sigma1 + space: [0, 0, 0], + // sigma2 + stretch: [0, 0, 0], + // sigma3 + shrink: [0, 0, 0], + // sigma4 + xHeight: [0.431, 0.431, 0.431], + // sigma5 + quad: [1, 1.171, 1.472], + // sigma6 + extraSpace: [0, 0, 0], + // sigma7 + num1: [0.677, 0.732, 0.925], + // sigma8 + num2: [0.394, 0.384, 0.387], + // sigma9 + num3: [0.444, 0.471, 0.504], + // sigma10 + denom1: [0.686, 0.752, 1.025], + // sigma11 + denom2: [0.345, 0.344, 0.532], + // sigma12 + sup1: [0.413, 0.503, 0.504], + // sigma13 + sup2: [0.363, 0.431, 0.404], + // sigma14 + sup3: [0.289, 0.286, 0.294], + // sigma15 + sub1: [0.15, 0.143, 0.2], + // sigma16 + sub2: [0.247, 0.286, 0.4], + // sigma17 + supDrop: [0.386, 0.353, 0.494], + // sigma18 + subDrop: [0.05, 0.071, 0.1], + // sigma19 + delim1: [2.39, 1.7, 1.98], + // sigma20 + delim2: [1.01, 1.157, 1.42], + // sigma21 + axisHeight: [0.25, 0.25, 0.25], + // sigma22 + // These font metrics are extracted from TeX by using tftopl on cmex10.tfm; + // they correspond to the font parameters of the extension fonts (family 3). + // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to + // match cmex7, we'd use cmex7.tfm values for script and scriptscript + // values. + defaultRuleThickness: [0.04, 0.049, 0.049], + // xi8; cmex7: 0.049 + bigOpSpacing1: [0.111, 0.111, 0.111], + // xi9 + bigOpSpacing2: [0.166, 0.166, 0.166], + // xi10 + bigOpSpacing3: [0.2, 0.2, 0.2], + // xi11 + bigOpSpacing4: [0.6, 0.611, 0.611], + // xi12; cmex7: 0.611 + bigOpSpacing5: [0.1, 0.143, 0.143], + // xi13; cmex7: 0.143 + // The \sqrt rule width is taken from the height of the surd character. + // Since we use the same font at all sizes, this thickness doesn't scale. + sqrtRuleThickness: [0.04, 0.04, 0.04], + // This value determines how large a pt is, for metrics which are defined + // in terms of pts. + // This value is also used in katex.scss; if you change it make sure the + // values match. + ptPerEm: [10, 10, 10], + // The space between adjacent `|` columns in an array definition. From + // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm. + doubleRuleSep: [0.2, 0.2, 0.2], + // The width of separator lines in {array} environments. From + // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm. + arrayRuleWidth: [0.04, 0.04, 0.04], + // Two values from LaTeX source2e: + fboxsep: [0.3, 0.3, 0.3], + // 3 pt / ptPerEm + fboxrule: [0.04, 0.04, 0.04] + // 0.4 pt / ptPerEm + }; + extraCharacterMap = { + // Latin-1 + "\xC5": "A", + "\xD0": "D", + "\xDE": "o", + "\xE5": "a", + "\xF0": "d", + "\xFE": "o", + // Cyrillic + "\u0410": "A", + "\u0411": "B", + "\u0412": "B", + "\u0413": "F", + "\u0414": "A", + "\u0415": "E", + "\u0416": "K", + "\u0417": "3", + "\u0418": "N", + "\u0419": "N", + "\u041A": "K", + "\u041B": "N", + "\u041C": "M", + "\u041D": "H", + "\u041E": "O", + "\u041F": "N", + "\u0420": "P", + "\u0421": "C", + "\u0422": "T", + "\u0423": "y", + "\u0424": "O", + "\u0425": "X", + "\u0426": "U", + "\u0427": "h", + "\u0428": "W", + "\u0429": "W", + "\u042A": "B", + "\u042B": "X", + "\u042C": "B", + "\u042D": "3", + "\u042E": "X", + "\u042F": "R", + "\u0430": "a", + "\u0431": "b", + "\u0432": "a", + "\u0433": "r", + "\u0434": "y", + "\u0435": "e", + "\u0436": "m", + "\u0437": "e", + "\u0438": "n", + "\u0439": "n", + "\u043A": "n", + "\u043B": "n", + "\u043C": "m", + "\u043D": "n", + "\u043E": "o", + "\u043F": "n", + "\u0440": "p", + "\u0441": "c", + "\u0442": "o", + "\u0443": "y", + "\u0444": "b", + "\u0445": "x", + "\u0446": "n", + "\u0447": "n", + "\u0448": "w", + "\u0449": "w", + "\u044A": "a", + "\u044B": "m", + "\u044C": "a", + "\u044D": "e", + "\u044E": "m", + "\u044F": "r" + }; + __name(setFontMetrics, "setFontMetrics"); + __name(getCharacterMetrics, "getCharacterMetrics"); + fontMetricsBySizeIndex = {}; + __name(getGlobalMetrics, "getGlobalMetrics"); + sizeStyleMap = [ + // Each element contains [textsize, scriptsize, scriptscriptsize]. + // The size mappings are taken from TeX with \normalsize=10pt. + [1, 1, 1], + // size1: [5, 5, 5] \tiny + [2, 1, 1], + // size2: [6, 5, 5] + [3, 1, 1], + // size3: [7, 5, 5] \scriptsize + [4, 2, 1], + // size4: [8, 6, 5] \footnotesize + [5, 2, 1], + // size5: [9, 6, 5] \small + [6, 3, 1], + // size6: [10, 7, 5] \normalsize + [7, 4, 2], + // size7: [12, 8, 6] \large + [8, 6, 3], + // size8: [14.4, 10, 7] \Large + [9, 7, 6], + // size9: [17.28, 12, 10] \LARGE + [10, 8, 7], + // size10: [20.74, 14.4, 12] \huge + [11, 10, 9] + // size11: [24.88, 20.74, 17.28] \HUGE + ]; + sizeMultipliers = [ + // fontMetrics.js:getGlobalMetrics also uses size indexes, so if + // you change size indexes, change that function. + 0.5, + 0.6, + 0.7, + 0.8, + 0.9, + 1, + 1.2, + 1.44, + 1.728, + 2.074, + 2.488 + ]; + sizeAtStyle = /* @__PURE__ */ __name(function sizeAtStyle2(size5, style3) { + return style3.size < 2 ? size5 : sizeStyleMap[size5 - 1][style3.size - 1]; + }, "sizeAtStyle"); + Options = class _Options { + static { + __name(this, "Options"); + } + // A font family applies to a group of fonts (i.e. SansSerif), while a font + // represents a specific font (i.e. SansSerif Bold). + // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm + /** + * The base size index. + */ + constructor(data5) { + this.style = void 0; + this.color = void 0; + this.size = void 0; + this.textSize = void 0; + this.phantom = void 0; + this.font = void 0; + this.fontFamily = void 0; + this.fontWeight = void 0; + this.fontShape = void 0; + this.sizeMultiplier = void 0; + this.maxSize = void 0; + this.minRuleThickness = void 0; + this._fontMetrics = void 0; + this.style = data5.style; + this.color = data5.color; + this.size = data5.size || _Options.BASESIZE; + this.textSize = data5.textSize || this.size; + this.phantom = !!data5.phantom; + this.font = data5.font || ""; + this.fontFamily = data5.fontFamily || ""; + this.fontWeight = data5.fontWeight || ""; + this.fontShape = data5.fontShape || ""; + this.sizeMultiplier = sizeMultipliers[this.size - 1]; + this.maxSize = data5.maxSize; + this.minRuleThickness = data5.minRuleThickness; + this._fontMetrics = void 0; + } + /** + * Returns a new options object with the same properties as "this". Properties + * from "extension" will be copied to the new options object. + */ + extend(extension5) { + var data5 = { + style: this.style, + size: this.size, + textSize: this.textSize, + color: this.color, + phantom: this.phantom, + font: this.font, + fontFamily: this.fontFamily, + fontWeight: this.fontWeight, + fontShape: this.fontShape, + maxSize: this.maxSize, + minRuleThickness: this.minRuleThickness + }; + for (var key in extension5) { + if (extension5.hasOwnProperty(key)) { + data5[key] = extension5[key]; + } + } + return new _Options(data5); + } + /** + * Return an options object with the given style. If `this.style === style`, + * returns `this`. + */ + havingStyle(style3) { + if (this.style === style3) { + return this; + } else { + return this.extend({ + style: style3, + size: sizeAtStyle(this.textSize, style3) + }); + } + } + /** + * Return an options object with a cramped version of the current style. If + * the current style is cramped, returns `this`. + */ + havingCrampedStyle() { + return this.havingStyle(this.style.cramp()); + } + /** + * Return an options object with the given size and in at least `\textstyle`. + * Returns `this` if appropriate. + */ + havingSize(size5) { + if (this.size === size5 && this.textSize === size5) { + return this; + } else { + return this.extend({ + style: this.style.text(), + size: size5, + textSize: size5, + sizeMultiplier: sizeMultipliers[size5 - 1] + }); + } + } + /** + * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted, + * changes to at least `\textstyle`. + */ + havingBaseStyle(style3) { + style3 = style3 || this.style.text(); + var wantSize = sizeAtStyle(_Options.BASESIZE, style3); + if (this.size === wantSize && this.textSize === _Options.BASESIZE && this.style === style3) { + return this; + } else { + return this.extend({ + style: style3, + size: wantSize + }); + } + } + /** + * Remove the effect of sizing changes such as \Huge. + * Keep the effect of the current style, such as \scriptstyle. + */ + havingBaseSizing() { + var size5; + switch (this.style.id) { + case 4: + case 5: + size5 = 3; + break; + case 6: + case 7: + size5 = 1; + break; + default: + size5 = 6; + } + return this.extend({ + style: this.style.text(), + size: size5 }); } - } - } - return new Transition(groups, this._parents, name, id1); - } - function transition_end() { - var on0, on1, that = this, id2 = that._id, size2 = that.size(); - return new Promise(function(resolve, reject) { - var cancel = { value: reject }, end2 = { value: function() { - if (--size2 === 0) - resolve(); - } }; - that.each(function() { - var schedule2 = set$2(this, id2), on = schedule2.on; - if (on !== on0) { - on1 = (on0 = on).copy(); - on1._.cancel.push(cancel); - on1._.interrupt.push(cancel); - on1._.end.push(end2); + /** + * Create a new options object with the given color. + */ + withColor(color2) { + return this.extend({ + color: color2 + }); } - schedule2.on = on1; - }); - if (size2 === 0) - resolve(); - }); - } - var id$m = 0; - function Transition(groups, parents2, name, id2) { - this._groups = groups; - this._parents = parents2; - this._name = name; - this._id = id2; - } - function newId() { - return ++id$m; - } - var selection_prototype = selection.prototype; - Transition.prototype = { - constructor: Transition, - select: transition_select, - selectAll: transition_selectAll, - selectChild: selection_prototype.selectChild, - selectChildren: selection_prototype.selectChildren, - filter: transition_filter, - merge: transition_merge, - selection: transition_selection, - transition: transition_transition, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: transition_on, - attr: transition_attr, - attrTween: transition_attrTween, - style: transition_style, - styleTween: transition_styleTween, - text: transition_text, - textTween: transition_textTween, - remove: transition_remove, - tween: transition_tween, - delay: transition_delay, - duration: transition_duration, - ease: transition_ease, - easeVarying: transition_easeVarying, - end: transition_end, - [Symbol.iterator]: selection_prototype[Symbol.iterator] - }; - function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; - } - var defaultTiming = { - time: null, - // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut - }; - function inherit(node2, id2) { - var timing; - while (!(timing = node2.__transition) || !(timing = timing[id2])) { - if (!(node2 = node2.parentNode)) { - throw new Error(`transition ${id2} not found`); - } - } - return timing; - } - function selection_transition(name) { - var id2, timing; - if (name instanceof Transition) { - id2 = name._id, name = name._name; - } else { - id2 = newId(), (timing = defaultTiming).time = now$2(), name = name == null ? null : name + ""; - } - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node2, i2 = 0; i2 < n; ++i2) { - if (node2 = group[i2]) { - schedule(node2, name, id2, i2, group, timing || inherit(node2, id2)); + /** + * Create a new options object with "phantom" set to true. + */ + withPhantom() { + return this.extend({ + phantom: true + }); } - } - } - return new Transition(groups, this._parents, name, id2); - } - selection.prototype.interrupt = selection_interrupt; - selection.prototype.transition = selection_transition; - const pi$2 = Math.PI, tau$2 = 2 * pi$2, epsilon$2 = 1e-6, tauEpsilon$1 = tau$2 - epsilon$2; - function append$1(strings) { - this._ += strings[0]; - for (let i2 = 1, n = strings.length; i2 < n; ++i2) { - this._ += arguments[i2] + strings[i2]; - } - } - function appendRound(digits) { - let d = Math.floor(digits); - if (!(d >= 0)) - throw new Error(`invalid digits: ${digits}`); - if (d > 15) - return append$1; - const k = 10 ** d; - return function(strings) { - this._ += strings[0]; - for (let i2 = 1, n = strings.length; i2 < n; ++i2) { - this._ += Math.round(arguments[i2] * k) / k + strings[i2]; - } - }; - } - let Path$1 = class Path { - constructor(digits) { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; - this._ = ""; - this._append = digits == null ? append$1 : appendRound(digits); - } - moveTo(x2, y2) { - this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`; - } - closePath() { - if (this._x1 !== null) { - this._x1 = this._x0, this._y1 = this._y0; - this._append`Z`; - } - } - lineTo(x2, y2) { - this._append`L${this._x1 = +x2},${this._y1 = +y2}`; - } - quadraticCurveTo(x1, y1, x2, y2) { - this._append`Q${+x1},${+y1},${this._x1 = +x2},${this._y1 = +y2}`; - } - bezierCurveTo(x1, y1, x2, y2, x3, y3) { - this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`; - } - arcTo(x1, y1, x2, y2, r) { - x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; - if (r < 0) - throw new Error(`negative radius: ${r}`); - let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01; - if (this._x1 === null) { - this._append`M${this._x1 = x1},${this._y1 = y1}`; - } else if (!(l01_2 > epsilon$2)) - ; - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$2) || !r) { - this._append`L${this._x1 = x1},${this._y1 = y1}`; - } else { - let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi$2 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21; - if (Math.abs(t01 - 1) > epsilon$2) { - this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`; + /** + * Creates a new options object with the given math font or old text font. + * @type {[type]} + */ + withFont(font) { + return this.extend({ + font + }); } - this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`; - } - } - arc(x2, y2, r, a0, a1, ccw) { - x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw; - if (r < 0) - throw new Error(`negative radius: ${r}`); - let dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; - if (this._x1 === null) { - this._append`M${x0},${y0}`; - } else if (Math.abs(this._x1 - x0) > epsilon$2 || Math.abs(this._y1 - y0) > epsilon$2) { - this._append`L${x0},${y0}`; - } - if (!r) - return; - if (da < 0) - da = da % tau$2 + tau$2; - if (da > tauEpsilon$1) { - this._append`A${r},${r},0,1,${cw},${x2 - dx},${y2 - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`; - } else if (da > epsilon$2) { - this._append`A${r},${r},0,${+(da >= pi$2)},${cw},${this._x1 = x2 + r * Math.cos(a1)},${this._y1 = y2 + r * Math.sin(a1)}`; - } - } - rect(x2, y2, w2, h) { - this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w2 = +w2}v${+h}h${-w2}Z`; - } - toString() { - return this._; - } - }; - function responseText(response) { - if (!response.ok) - throw new Error(response.status + " " + response.statusText); - return response.text(); - } - function text$4(input, init2) { - return fetch(input, init2).then(responseText); - } - function parser$x(type2) { - return (input, init2) => text$4(input, init2).then((text2) => new DOMParser().parseFromString(text2, type2)); - } - var svg$2 = parser$x("image/svg+xml"); - function formatDecimal(x2) { - return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10); - } - function formatDecimalParts(x2, p) { - if ((i2 = (x2 = p ? x2.toExponential(p - 1) : x2.toExponential()).indexOf("e")) < 0) - return null; - var i2, coefficient = x2.slice(0, i2); - return [ - coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, - +x2.slice(i2 + 1) - ]; - } - function exponent(x2) { - return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN; - } - function formatGroup(grouping, thousands) { - return function(value2, width2) { - var i2 = value2.length, t = [], j = 0, g = grouping[0], length2 = 0; - while (i2 > 0 && g > 0) { - if (length2 + g + 1 > width2) - g = Math.max(1, width2 - length2); - t.push(value2.substring(i2 -= g, i2 + g)); - if ((length2 += g + 1) > width2) - break; - g = grouping[j = (j + 1) % grouping.length]; - } - return t.reverse().join(thousands); - }; - } - function formatNumerals(numerals) { - return function(value2) { - return value2.replace(/[0-9]/g, function(i2) { - return numerals[+i2]; - }); - }; - } - var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; - function formatSpecifier(specifier) { - if (!(match = re.exec(specifier))) - throw new Error("invalid format: " + specifier); - var match; - return new FormatSpecifier({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10] - }); - } - formatSpecifier.prototype = FormatSpecifier.prototype; - function FormatSpecifier(specifier) { - this.fill = specifier.fill === void 0 ? " " : specifier.fill + ""; - this.align = specifier.align === void 0 ? ">" : specifier.align + ""; - this.sign = specifier.sign === void 0 ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === void 0 ? void 0 : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === void 0 ? "" : specifier.type + ""; - } - FormatSpecifier.prototype.toString = function() { - return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; - }; - function formatTrim(s) { - out: - for (var n = s.length, i2 = 1, i0 = -1, i1; i2 < n; ++i2) { - switch (s[i2]) { - case ".": - i0 = i1 = i2; - break; - case "0": - if (i0 === 0) - i0 = i2; - i1 = i2; - break; - default: - if (!+s[i2]) - break out; - if (i0 > 0) - i0 = 0; - break; + /** + * Create a new options objects with the given fontFamily. + */ + withTextFontFamily(fontFamily) { + return this.extend({ + fontFamily, + font: "" + }); } - } - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; - } - var prefixExponent; - function formatPrefixAuto(x2, p) { - var d = formatDecimalParts(x2, p); - if (!d) - return x2 + ""; - var coefficient = d[0], exponent2 = d[1], i2 = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n = coefficient.length; - return i2 === n ? coefficient : i2 > n ? coefficient + new Array(i2 - n + 1).join("0") : i2 > 0 ? coefficient.slice(0, i2) + "." + coefficient.slice(i2) : "0." + new Array(1 - i2).join("0") + formatDecimalParts(x2, Math.max(0, p + i2 - 1))[0]; - } - function formatRounded(x2, p) { - var d = formatDecimalParts(x2, p); - if (!d) - return x2 + ""; - var coefficient = d[0], exponent2 = d[1]; - return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0"); - } - const formatTypes = { - "%": (x2, p) => (x2 * 100).toFixed(p), - "b": (x2) => Math.round(x2).toString(2), - "c": (x2) => x2 + "", - "d": formatDecimal, - "e": (x2, p) => x2.toExponential(p), - "f": (x2, p) => x2.toFixed(p), - "g": (x2, p) => x2.toPrecision(p), - "o": (x2) => Math.round(x2).toString(8), - "p": (x2, p) => formatRounded(x2 * 100, p), - "r": formatRounded, - "s": formatPrefixAuto, - "X": (x2) => Math.round(x2).toString(16).toUpperCase(), - "x": (x2) => Math.round(x2).toString(16) - }; - function identity$3(x2) { - return x2; - } - var map$2 = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; - function formatLocale$1(locale2) { - var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity$3 : formatGroup(map$2.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity$3 : formatNumerals(map$2.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "−" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + ""; - function newFormat(specifier) { - specifier = formatSpecifier(specifier); - var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero2 = specifier.zero, width2 = specifier.width, comma = specifier.comma, precision = specifier.precision, trim2 = specifier.trim, type2 = specifier.type; - if (type2 === "n") - comma = true, type2 = "g"; - else if (!formatTypes[type2]) - precision === void 0 && (precision = 12), trim2 = true, type2 = "g"; - if (zero2 || fill === "0" && align === "=") - zero2 = true, fill = "0", align = "="; - var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : ""; - var formatType = formatTypes[type2], maybeSuffix = /[defgprs%]/.test(type2); - precision = precision === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); - function format2(value2) { - var valuePrefix = prefix, valueSuffix = suffix, i2, n, c2; - if (type2 === "c") { - valueSuffix = formatType(value2) + valueSuffix; - value2 = ""; + /** + * Creates a new options object with the given font weight + */ + withTextFontWeight(fontWeight) { + return this.extend({ + fontWeight, + font: "" + }); + } + /** + * Creates a new options object with the given font weight + */ + withTextFontShape(fontShape) { + return this.extend({ + fontShape, + font: "" + }); + } + /** + * Return the CSS sizing classes required to switch from enclosing options + * `oldOptions` to `this`. Returns an array of classes. + */ + sizingClasses(oldOptions) { + if (oldOptions.size !== this.size) { + return ["sizing", "reset-size" + oldOptions.size, "size" + this.size]; + } else { + return []; + } + } + /** + * Return the CSS sizing classes required to switch to the base size. Like + * `this.havingSize(BASESIZE).sizingClasses(this)`. + */ + baseSizingClasses() { + if (this.size !== _Options.BASESIZE) { + return ["sizing", "reset-size" + this.size, "size" + _Options.BASESIZE]; + } else { + return []; + } + } + /** + * Return the font metrics for this size. + */ + fontMetrics() { + if (!this._fontMetrics) { + this._fontMetrics = getGlobalMetrics(this.size); + } + return this._fontMetrics; + } + /** + * Gets the CSS color of the current options object + */ + getColor() { + if (this.phantom) { + return "transparent"; + } else { + return this.color; + } + } + }; + Options.BASESIZE = 6; + ptPerUnit = { + // https://en.wikibooks.org/wiki/LaTeX/Lengths and + // https://tex.stackexchange.com/a/8263 + "pt": 1, + // TeX point + "mm": 7227 / 2540, + // millimeter + "cm": 7227 / 254, + // centimeter + "in": 72.27, + // inch + "bp": 803 / 800, + // big (PostScript) points + "pc": 12, + // pica + "dd": 1238 / 1157, + // didot + "cc": 14856 / 1157, + // cicero (12 didot) + "nd": 685 / 642, + // new didot + "nc": 1370 / 107, + // new cicero (12 new didot) + "sp": 1 / 65536, + // scaled point (TeX's internal smallest unit) + // https://tex.stackexchange.com/a/41371 + "px": 803 / 800 + // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX + }; + relativeUnit = { + "ex": true, + "em": true, + "mu": true + }; + validUnit = /* @__PURE__ */ __name(function validUnit2(unit2) { + if (typeof unit2 !== "string") { + unit2 = unit2.unit; + } + return unit2 in ptPerUnit || unit2 in relativeUnit || unit2 === "ex"; + }, "validUnit"); + calculateSize = /* @__PURE__ */ __name(function calculateSize2(sizeValue, options3) { + var scale; + if (sizeValue.unit in ptPerUnit) { + scale = ptPerUnit[sizeValue.unit] / options3.fontMetrics().ptPerEm / options3.sizeMultiplier; + } else if (sizeValue.unit === "mu") { + scale = options3.fontMetrics().cssEmPerMu; } else { - value2 = +value2; - var valueNegative = value2 < 0 || 1 / value2 < 0; - value2 = isNaN(value2) ? nan : formatType(Math.abs(value2), precision); - if (trim2) - value2 = formatTrim(value2); - if (valueNegative && +value2 === 0 && sign2 !== "+") - valueNegative = false; - valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix; - valueSuffix = (type2 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : ""); - if (maybeSuffix) { - i2 = -1, n = value2.length; - while (++i2 < n) { - if (c2 = value2.charCodeAt(i2), 48 > c2 || c2 > 57) { - valueSuffix = (c2 === 46 ? decimal + value2.slice(i2 + 1) : value2.slice(i2)) + valueSuffix; - value2 = value2.slice(0, i2); - break; - } + var unitOptions; + if (options3.style.isTight()) { + unitOptions = options3.havingStyle(options3.style.text()); + } else { + unitOptions = options3; + } + if (sizeValue.unit === "ex") { + scale = unitOptions.fontMetrics().xHeight; + } else if (sizeValue.unit === "em") { + scale = unitOptions.fontMetrics().quad; + } else { + throw new ParseError("Invalid unit: '" + sizeValue.unit + "'"); + } + if (unitOptions !== options3) { + scale *= unitOptions.sizeMultiplier / options3.sizeMultiplier; + } + } + return Math.min(sizeValue.number * scale, options3.maxSize); + }, "calculateSize"); + makeEm = /* @__PURE__ */ __name(function makeEm2(n2) { + return +n2.toFixed(4) + "em"; + }, "makeEm"); + createClass = /* @__PURE__ */ __name(function createClass2(classes6) { + return classes6.filter((cls) => cls).join(" "); + }, "createClass"); + initNode = /* @__PURE__ */ __name(function initNode2(classes6, options3, style3) { + this.classes = classes6 || []; + this.attributes = {}; + this.height = 0; + this.depth = 0; + this.maxFontSize = 0; + this.style = style3 || {}; + if (options3) { + if (options3.style.isTight()) { + this.classes.push("mtight"); + } + var color2 = options3.getColor(); + if (color2) { + this.style.color = color2; + } + } + }, "initNode"); + toNode = /* @__PURE__ */ __name(function toNode2(tagName) { + var node2 = document.createElement(tagName); + node2.className = createClass(this.classes); + for (var style3 in this.style) { + if (this.style.hasOwnProperty(style3)) { + node2.style[style3] = this.style[style3]; + } + } + for (var attr in this.attributes) { + if (this.attributes.hasOwnProperty(attr)) { + node2.setAttribute(attr, this.attributes[attr]); + } + } + for (var i2 = 0; i2 < this.children.length; i2++) { + node2.appendChild(this.children[i2].toNode()); + } + return node2; + }, "toNode"); + toMarkup = /* @__PURE__ */ __name(function toMarkup2(tagName) { + var markup = "<" + tagName; + if (this.classes.length) { + markup += ' class="' + utils.escape(createClass(this.classes)) + '"'; + } + var styles3 = ""; + for (var style3 in this.style) { + if (this.style.hasOwnProperty(style3)) { + styles3 += utils.hyphenate(style3) + ":" + this.style[style3] + ";"; + } + } + if (styles3) { + markup += ' style="' + utils.escape(styles3) + '"'; + } + for (var attr in this.attributes) { + if (this.attributes.hasOwnProperty(attr)) { + markup += " " + attr + '="' + utils.escape(this.attributes[attr]) + '"'; + } + } + markup += ">"; + for (var i2 = 0; i2 < this.children.length; i2++) { + markup += this.children[i2].toMarkup(); + } + markup += ""; + return markup; + }, "toMarkup"); + Span = class { + static { + __name(this, "Span"); + } + constructor(classes6, children2, options3, style3) { + this.children = void 0; + this.attributes = void 0; + this.classes = void 0; + this.height = void 0; + this.depth = void 0; + this.width = void 0; + this.maxFontSize = void 0; + this.style = void 0; + initNode.call(this, classes6, options3, style3); + this.children = children2 || []; + } + /** + * Sets an arbitrary attribute on the span. Warning: use this wisely. Not + * all browsers support attributes the same, and having too many custom + * attributes is probably bad. + */ + setAttribute(attribute, value2) { + this.attributes[attribute] = value2; + } + hasClass(className) { + return utils.contains(this.classes, className); + } + toNode() { + return toNode.call(this, "span"); + } + toMarkup() { + return toMarkup.call(this, "span"); + } + }; + Anchor = class { + static { + __name(this, "Anchor"); + } + constructor(href, classes6, children2, options3) { + this.children = void 0; + this.attributes = void 0; + this.classes = void 0; + this.height = void 0; + this.depth = void 0; + this.maxFontSize = void 0; + this.style = void 0; + initNode.call(this, classes6, options3); + this.children = children2 || []; + this.setAttribute("href", href); + } + setAttribute(attribute, value2) { + this.attributes[attribute] = value2; + } + hasClass(className) { + return utils.contains(this.classes, className); + } + toNode() { + return toNode.call(this, "a"); + } + toMarkup() { + return toMarkup.call(this, "a"); + } + }; + Img = class { + static { + __name(this, "Img"); + } + constructor(src, alt, style3) { + this.src = void 0; + this.alt = void 0; + this.classes = void 0; + this.height = void 0; + this.depth = void 0; + this.maxFontSize = void 0; + this.style = void 0; + this.alt = alt; + this.src = src; + this.classes = ["mord"]; + this.style = style3; + } + hasClass(className) { + return utils.contains(this.classes, className); + } + toNode() { + var node2 = document.createElement("img"); + node2.src = this.src; + node2.alt = this.alt; + node2.className = "mord"; + for (var style3 in this.style) { + if (this.style.hasOwnProperty(style3)) { + node2.style[style3] = this.style[style3]; } } + return node2; } - if (comma && !zero2) - value2 = group(value2, Infinity); - var length2 = valuePrefix.length + value2.length + valueSuffix.length, padding2 = length2 < width2 ? new Array(width2 - length2 + 1).join(fill) : ""; - if (comma && zero2) - value2 = group(padding2 + value2, padding2.length ? width2 - valueSuffix.length : Infinity), padding2 = ""; - switch (align) { - case "<": - value2 = valuePrefix + value2 + valueSuffix + padding2; - break; - case "=": - value2 = valuePrefix + padding2 + value2 + valueSuffix; - break; - case "^": - value2 = padding2.slice(0, length2 = padding2.length >> 1) + valuePrefix + value2 + valueSuffix + padding2.slice(length2); - break; - default: - value2 = padding2 + valuePrefix + value2 + valueSuffix; - break; + toMarkup() { + var markup = '' + utils.escape(this.alt) + ' 0) { + span = document.createElement("span"); + span.style.marginRight = makeEm(this.italic); + } + if (this.classes.length > 0) { + span = span || document.createElement("span"); + span.className = createClass(this.classes); + } + for (var style3 in this.style) { + if (this.style.hasOwnProperty(style3)) { + span = span || document.createElement("span"); + span.style[style3] = this.style[style3]; + } + } + if (span) { + span.appendChild(node2); + return span; + } else { + return node2; + } + } + /** + * Creates markup for a symbol node. + */ + toMarkup() { + var needsSpan = false; + var markup = " 0) { + styles3 += "margin-right:" + this.italic + "em;"; + } + for (var style3 in this.style) { + if (this.style.hasOwnProperty(style3)) { + styles3 += utils.hyphenate(style3) + ":" + this.style[style3] + ";"; + } + } + if (styles3) { + needsSpan = true; + markup += ' style="' + utils.escape(styles3) + '"'; + } + var escaped = utils.escape(this.text); + if (needsSpan) { + markup += ">"; + markup += escaped; + markup += ""; + return markup; + } else { + return escaped; + } } - return numerals(value2); - } - format2.toString = function() { - return specifier + ""; }; - return format2; - } - function formatPrefix2(specifier, value2) { - var f2 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value2) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3]; - return function(value3) { - return f2(k * value3) + prefix; + SvgNode = class { + static { + __name(this, "SvgNode"); + } + constructor(children2, attributes) { + this.children = void 0; + this.attributes = void 0; + this.children = children2 || []; + this.attributes = attributes || {}; + } + toNode() { + var svgNS = "http://www.w3.org/2000/svg"; + var node2 = document.createElementNS(svgNS, "svg"); + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + node2.setAttribute(attr, this.attributes[attr]); + } + } + for (var i2 = 0; i2 < this.children.length; i2++) { + node2.appendChild(this.children[i2].toNode()); + } + return node2; + } + toMarkup() { + var markup = ' b) - t = a, a = b, b = t; - return function(x2) { - return Math.max(a, Math.min(b, x2)); - }; - } - function bimap(domain, range2, interpolate2) { - var d0 = domain[0], d1 = domain[1], r0 = range2[0], r1 = range2[1]; - if (d1 < d0) - d0 = normalize(d1, d0), r0 = interpolate2(r1, r0); - else - d0 = normalize(d0, d1), r0 = interpolate2(r0, r1); - return function(x2) { - return r0(d0(x2)); - }; - } - function polymap(domain, range2, interpolate2) { - var j = Math.min(domain.length, range2.length) - 1, d = new Array(j), r = new Array(j), i2 = -1; - if (domain[j] < domain[0]) { - domain = domain.slice().reverse(); - range2 = range2.slice().reverse(); - } - while (++i2 < j) { - d[i2] = normalize(domain[i2], domain[i2 + 1]); - r[i2] = interpolate2(range2[i2], range2[i2 + 1]); - } - return function(x2) { - var i3 = bisect(domain, x2, 1, j) - 1; - return r[i3](d[i3](x2)); - }; - } - function copy$1(source, target) { - return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown()); - } - function transformer() { - var domain = unit$1, range2 = unit$1, interpolate2 = interpolate$1, transform, untransform, unknown, clamp = identity$2, piecewise, output, input; - function rescale() { - var n = Math.min(domain.length, range2.length); - if (clamp !== identity$2) - clamp = clamper(domain[0], domain[n - 1]); - piecewise = n > 2 ? polymap : bimap; - output = input = null; - return scale; - } - function scale(x2) { - return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise(domain.map(transform), range2, interpolate2)))(transform(clamp(x2))); - } - scale.invert = function(y2) { - return clamp(untransform((input || (input = piecewise(range2, domain.map(transform), interpolateNumber)))(y2))); - }; - scale.domain = function(_2) { - return arguments.length ? (domain = Array.from(_2, number$1), rescale()) : domain.slice(); - }; - scale.range = function(_2) { - return arguments.length ? (range2 = Array.from(_2), rescale()) : range2.slice(); - }; - scale.rangeRound = function(_2) { - return range2 = Array.from(_2), interpolate2 = interpolateRound, rescale(); - }; - scale.clamp = function(_2) { - return arguments.length ? (clamp = _2 ? true : identity$2, rescale()) : clamp !== identity$2; - }; - scale.interpolate = function(_2) { - return arguments.length ? (interpolate2 = _2, rescale()) : interpolate2; - }; - scale.unknown = function(_2) { - return arguments.length ? (unknown = _2, scale) : unknown; - }; - return function(t, u) { - transform = t, untransform = u; - return rescale(); - }; - } - function continuous() { - return transformer()(identity$2, identity$2); - } - function tickFormat(start2, stop, count, specifier) { - var step = tickStep(start2, stop, count), precision; - specifier = formatSpecifier(specifier == null ? ",f" : specifier); - switch (specifier.type) { - case "s": { - var value2 = Math.max(Math.abs(start2), Math.abs(stop)); - if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value2))) - specifier.precision = precision; - return formatPrefix(specifier, value2); - } - case "": - case "e": - case "g": - case "p": - case "r": { - if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start2), Math.abs(stop))))) - specifier.precision = precision - (specifier.type === "e"); - break; - } - case "f": - case "%": { - if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) - specifier.precision = precision - (specifier.type === "%") * 2; - break; - } - } - return format(specifier); - } - function linearish(scale) { - var domain = scale.domain; - scale.ticks = function(count) { - var d = domain(); - return ticks(d[0], d[d.length - 1], count == null ? 10 : count); - }; - scale.tickFormat = function(count, specifier) { - var d = domain(); - return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier); - }; - scale.nice = function(count) { - if (count == null) - count = 10; - var d = domain(); - var i0 = 0; - var i1 = d.length - 1; - var start2 = d[i0]; - var stop = d[i1]; - var prestep; - var step; - var maxIter = 10; - if (stop < start2) { - step = start2, start2 = stop, stop = step; - step = i0, i0 = i1, i1 = step; - } - while (maxIter-- > 0) { - step = tickIncrement(start2, stop, count); - if (step === prestep) { - d[i0] = start2; - d[i1] = stop; - return domain(d); - } else if (step > 0) { - start2 = Math.floor(start2 / step) * step; - stop = Math.ceil(stop / step) * step; - } else if (step < 0) { - start2 = Math.ceil(start2 * step) / step; - stop = Math.floor(stop * step) / step; + PathNode = class { + static { + __name(this, "PathNode"); + } + constructor(pathName, alternate) { + this.pathName = void 0; + this.alternate = void 0; + this.pathName = pathName; + this.alternate = alternate; + } + toNode() { + var svgNS = "http://www.w3.org/2000/svg"; + var node2 = document.createElementNS(svgNS, "path"); + if (this.alternate) { + node2.setAttribute("d", this.alternate); + } else { + node2.setAttribute("d", path[this.pathName]); + } + return node2; + } + toMarkup() { + if (this.alternate) { + return ''; + } else { + return ''; + } + } + }; + LineNode = class { + static { + __name(this, "LineNode"); + } + constructor(attributes) { + this.attributes = void 0; + this.attributes = attributes || {}; + } + toNode() { + var svgNS = "http://www.w3.org/2000/svg"; + var node2 = document.createElementNS(svgNS, "line"); + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + node2.setAttribute(attr, this.attributes[attr]); + } + } + return node2; + } + toMarkup() { + var markup = "", "\\gt", true); + defineSymbol(math, main, rel, "\u2208", "\\in", true); + defineSymbol(math, main, rel, "\uE020", "\\@not"); + defineSymbol(math, main, rel, "\u2282", "\\subset", true); + defineSymbol(math, main, rel, "\u2283", "\\supset", true); + defineSymbol(math, main, rel, "\u2286", "\\subseteq", true); + defineSymbol(math, main, rel, "\u2287", "\\supseteq", true); + defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true); + defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true); + defineSymbol(math, main, rel, "\u22A8", "\\models"); + defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true); + defineSymbol(math, main, rel, "\u2264", "\\le"); + defineSymbol(math, main, rel, "\u2264", "\\leq", true); + defineSymbol(math, main, rel, "<", "\\lt", true); + defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true); + defineSymbol(math, main, rel, "\u2192", "\\to"); + defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true); + defineSymbol(math, ams, rel, "\u2270", "\\nleq", true); + defineSymbol(math, main, spacing, "\xA0", "\\ "); + defineSymbol(math, main, spacing, "\xA0", "\\space"); + defineSymbol(math, main, spacing, "\xA0", "\\nobreakspace"); + defineSymbol(text, main, spacing, "\xA0", "\\ "); + defineSymbol(text, main, spacing, "\xA0", " "); + defineSymbol(text, main, spacing, "\xA0", "\\space"); + defineSymbol(text, main, spacing, "\xA0", "\\nobreakspace"); + defineSymbol(math, main, spacing, null, "\\nobreak"); + defineSymbol(math, main, spacing, null, "\\allowbreak"); + defineSymbol(math, main, punct, ",", ","); + defineSymbol(math, main, punct, ";", ";"); + defineSymbol(math, ams, bin, "\u22BC", "\\barwedge", true); + defineSymbol(math, ams, bin, "\u22BB", "\\veebar", true); + defineSymbol(math, main, bin, "\u2299", "\\odot", true); + defineSymbol(math, main, bin, "\u2295", "\\oplus", true); + defineSymbol(math, main, bin, "\u2297", "\\otimes", true); + defineSymbol(math, main, textord, "\u2202", "\\partial", true); + defineSymbol(math, main, bin, "\u2298", "\\oslash", true); + defineSymbol(math, ams, bin, "\u229A", "\\circledcirc", true); + defineSymbol(math, ams, bin, "\u22A1", "\\boxdot", true); + defineSymbol(math, main, bin, "\u25B3", "\\bigtriangleup"); + defineSymbol(math, main, bin, "\u25BD", "\\bigtriangledown"); + defineSymbol(math, main, bin, "\u2020", "\\dagger"); + defineSymbol(math, main, bin, "\u22C4", "\\diamond"); + defineSymbol(math, main, bin, "\u22C6", "\\star"); + defineSymbol(math, main, bin, "\u25C3", "\\triangleleft"); + defineSymbol(math, main, bin, "\u25B9", "\\triangleright"); + defineSymbol(math, main, open, "{", "\\{"); + defineSymbol(text, main, textord, "{", "\\{"); + defineSymbol(text, main, textord, "{", "\\textbraceleft"); + defineSymbol(math, main, close, "}", "\\}"); + defineSymbol(text, main, textord, "}", "\\}"); + defineSymbol(text, main, textord, "}", "\\textbraceright"); + defineSymbol(math, main, open, "{", "\\lbrace"); + defineSymbol(math, main, close, "}", "\\rbrace"); + defineSymbol(math, main, open, "[", "\\lbrack", true); + defineSymbol(text, main, textord, "[", "\\lbrack", true); + defineSymbol(math, main, close, "]", "\\rbrack", true); + defineSymbol(text, main, textord, "]", "\\rbrack", true); + defineSymbol(math, main, open, "(", "\\lparen", true); + defineSymbol(math, main, close, ")", "\\rparen", true); + defineSymbol(text, main, textord, "<", "\\textless", true); + defineSymbol(text, main, textord, ">", "\\textgreater", true); + defineSymbol(math, main, open, "\u230A", "\\lfloor", true); + defineSymbol(math, main, close, "\u230B", "\\rfloor", true); + defineSymbol(math, main, open, "\u2308", "\\lceil", true); + defineSymbol(math, main, close, "\u2309", "\\rceil", true); + defineSymbol(math, main, textord, "\\", "\\backslash"); + defineSymbol(math, main, textord, "\u2223", "|"); + defineSymbol(math, main, textord, "\u2223", "\\vert"); + defineSymbol(text, main, textord, "|", "\\textbar", true); + defineSymbol(math, main, textord, "\u2225", "\\|"); + defineSymbol(math, main, textord, "\u2225", "\\Vert"); + defineSymbol(text, main, textord, "\u2225", "\\textbardbl"); + defineSymbol(text, main, textord, "~", "\\textasciitilde"); + defineSymbol(text, main, textord, "\\", "\\textbackslash"); + defineSymbol(text, main, textord, "^", "\\textasciicircum"); + defineSymbol(math, main, rel, "\u2191", "\\uparrow", true); + defineSymbol(math, main, rel, "\u21D1", "\\Uparrow", true); + defineSymbol(math, main, rel, "\u2193", "\\downarrow", true); + defineSymbol(math, main, rel, "\u21D3", "\\Downarrow", true); + defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true); + defineSymbol(math, main, rel, "\u21D5", "\\Updownarrow", true); + defineSymbol(math, main, op, "\u2210", "\\coprod"); + defineSymbol(math, main, op, "\u22C1", "\\bigvee"); + defineSymbol(math, main, op, "\u22C0", "\\bigwedge"); + defineSymbol(math, main, op, "\u2A04", "\\biguplus"); + defineSymbol(math, main, op, "\u22C2", "\\bigcap"); + defineSymbol(math, main, op, "\u22C3", "\\bigcup"); + defineSymbol(math, main, op, "\u222B", "\\int"); + defineSymbol(math, main, op, "\u222B", "\\intop"); + defineSymbol(math, main, op, "\u222C", "\\iint"); + defineSymbol(math, main, op, "\u222D", "\\iiint"); + defineSymbol(math, main, op, "\u220F", "\\prod"); + defineSymbol(math, main, op, "\u2211", "\\sum"); + defineSymbol(math, main, op, "\u2A02", "\\bigotimes"); + defineSymbol(math, main, op, "\u2A01", "\\bigoplus"); + defineSymbol(math, main, op, "\u2A00", "\\bigodot"); + defineSymbol(math, main, op, "\u222E", "\\oint"); + defineSymbol(math, main, op, "\u222F", "\\oiint"); + defineSymbol(math, main, op, "\u2230", "\\oiiint"); + defineSymbol(math, main, op, "\u2A06", "\\bigsqcup"); + defineSymbol(math, main, op, "\u222B", "\\smallint"); + defineSymbol(text, main, inner, "\u2026", "\\textellipsis"); + defineSymbol(math, main, inner, "\u2026", "\\mathellipsis"); + defineSymbol(text, main, inner, "\u2026", "\\ldots", true); + defineSymbol(math, main, inner, "\u2026", "\\ldots", true); + defineSymbol(math, main, inner, "\u22EF", "\\@cdots", true); + defineSymbol(math, main, inner, "\u22F1", "\\ddots", true); + defineSymbol(math, main, textord, "\u22EE", "\\varvdots"); + defineSymbol(math, main, accent, "\u02CA", "\\acute"); + defineSymbol(math, main, accent, "\u02CB", "\\grave"); + defineSymbol(math, main, accent, "\xA8", "\\ddot"); + defineSymbol(math, main, accent, "~", "\\tilde"); + defineSymbol(math, main, accent, "\u02C9", "\\bar"); + defineSymbol(math, main, accent, "\u02D8", "\\breve"); + defineSymbol(math, main, accent, "\u02C7", "\\check"); + defineSymbol(math, main, accent, "^", "\\hat"); + defineSymbol(math, main, accent, "\u20D7", "\\vec"); + defineSymbol(math, main, accent, "\u02D9", "\\dot"); + defineSymbol(math, main, accent, "\u02DA", "\\mathring"); + defineSymbol(math, main, mathord, "\uE131", "\\@imath"); + defineSymbol(math, main, mathord, "\uE237", "\\@jmath"); + defineSymbol(math, main, textord, "\u0131", "\u0131"); + defineSymbol(math, main, textord, "\u0237", "\u0237"); + defineSymbol(text, main, textord, "\u0131", "\\i", true); + defineSymbol(text, main, textord, "\u0237", "\\j", true); + defineSymbol(text, main, textord, "\xDF", "\\ss", true); + defineSymbol(text, main, textord, "\xE6", "\\ae", true); + defineSymbol(text, main, textord, "\u0153", "\\oe", true); + defineSymbol(text, main, textord, "\xF8", "\\o", true); + defineSymbol(text, main, textord, "\xC6", "\\AE", true); + defineSymbol(text, main, textord, "\u0152", "\\OE", true); + defineSymbol(text, main, textord, "\xD8", "\\O", true); + defineSymbol(text, main, accent, "\u02CA", "\\'"); + defineSymbol(text, main, accent, "\u02CB", "\\`"); + defineSymbol(text, main, accent, "\u02C6", "\\^"); + defineSymbol(text, main, accent, "\u02DC", "\\~"); + defineSymbol(text, main, accent, "\u02C9", "\\="); + defineSymbol(text, main, accent, "\u02D8", "\\u"); + defineSymbol(text, main, accent, "\u02D9", "\\."); + defineSymbol(text, main, accent, "\xB8", "\\c"); + defineSymbol(text, main, accent, "\u02DA", "\\r"); + defineSymbol(text, main, accent, "\u02C7", "\\v"); + defineSymbol(text, main, accent, "\xA8", '\\"'); + defineSymbol(text, main, accent, "\u02DD", "\\H"); + defineSymbol(text, main, accent, "\u25EF", "\\textcircled"); + ligatures = { + "--": true, + "---": true, + "``": true, + "''": true + }; + defineSymbol(text, main, textord, "\u2013", "--", true); + defineSymbol(text, main, textord, "\u2013", "\\textendash"); + defineSymbol(text, main, textord, "\u2014", "---", true); + defineSymbol(text, main, textord, "\u2014", "\\textemdash"); + defineSymbol(text, main, textord, "\u2018", "`", true); + defineSymbol(text, main, textord, "\u2018", "\\textquoteleft"); + defineSymbol(text, main, textord, "\u2019", "'", true); + defineSymbol(text, main, textord, "\u2019", "\\textquoteright"); + defineSymbol(text, main, textord, "\u201C", "``", true); + defineSymbol(text, main, textord, "\u201C", "\\textquotedblleft"); + defineSymbol(text, main, textord, "\u201D", "''", true); + defineSymbol(text, main, textord, "\u201D", "\\textquotedblright"); + defineSymbol(math, main, textord, "\xB0", "\\degree", true); + defineSymbol(text, main, textord, "\xB0", "\\degree"); + defineSymbol(text, main, textord, "\xB0", "\\textdegree", true); + defineSymbol(math, main, textord, "\xA3", "\\pounds"); + defineSymbol(math, main, textord, "\xA3", "\\mathsterling", true); + defineSymbol(text, main, textord, "\xA3", "\\pounds"); + defineSymbol(text, main, textord, "\xA3", "\\textsterling", true); + defineSymbol(math, ams, textord, "\u2720", "\\maltese"); + defineSymbol(text, ams, textord, "\u2720", "\\maltese"); + mathTextSymbols = '0123456789/@."'; + for (i2 = 0; i2 < mathTextSymbols.length; i2++) { + ch = mathTextSymbols.charAt(i2); + defineSymbol(math, main, textord, ch, ch); + } + textSymbols = '0123456789!@*()-=+";:?/.,'; + for (_i = 0; _i < textSymbols.length; _i++) { + _ch = textSymbols.charAt(_i); + defineSymbol(text, main, textord, _ch, _ch); + } + letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + for (_i2 = 0; _i2 < letters.length; _i2++) { + _ch2 = letters.charAt(_i2); + defineSymbol(math, main, mathord, _ch2, _ch2); + defineSymbol(text, main, textord, _ch2, _ch2); + } + defineSymbol(math, ams, textord, "C", "\u2102"); + defineSymbol(text, ams, textord, "C", "\u2102"); + defineSymbol(math, ams, textord, "H", "\u210D"); + defineSymbol(text, ams, textord, "H", "\u210D"); + defineSymbol(math, ams, textord, "N", "\u2115"); + defineSymbol(text, ams, textord, "N", "\u2115"); + defineSymbol(math, ams, textord, "P", "\u2119"); + defineSymbol(text, ams, textord, "P", "\u2119"); + defineSymbol(math, ams, textord, "Q", "\u211A"); + defineSymbol(text, ams, textord, "Q", "\u211A"); + defineSymbol(math, ams, textord, "R", "\u211D"); + defineSymbol(text, ams, textord, "R", "\u211D"); + defineSymbol(math, ams, textord, "Z", "\u2124"); + defineSymbol(text, ams, textord, "Z", "\u2124"); + defineSymbol(math, main, mathord, "h", "\u210E"); + defineSymbol(text, main, mathord, "h", "\u210E"); + wideChar = ""; + for (_i3 = 0; _i3 < letters.length; _i3++) { + _ch3 = letters.charAt(_i3); + wideChar = String.fromCharCode(55349, 56320 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56372 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56424 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56580 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56684 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56736 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56788 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56840 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56944 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + if (_i3 < 26) { + wideChar = String.fromCharCode(55349, 56632 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + wideChar = String.fromCharCode(55349, 56476 + _i3); + defineSymbol(math, main, mathord, _ch3, wideChar); + defineSymbol(text, main, textord, _ch3, wideChar); + } + } + wideChar = String.fromCharCode(55349, 56668); + defineSymbol(math, main, mathord, "k", wideChar); + defineSymbol(text, main, textord, "k", wideChar); + for (_i4 = 0; _i4 < 10; _i4++) { + _ch4 = _i4.toString(); + wideChar = String.fromCharCode(55349, 57294 + _i4); + defineSymbol(math, main, mathord, _ch4, wideChar); + defineSymbol(text, main, textord, _ch4, wideChar); + wideChar = String.fromCharCode(55349, 57314 + _i4); + defineSymbol(math, main, mathord, _ch4, wideChar); + defineSymbol(text, main, textord, _ch4, wideChar); + wideChar = String.fromCharCode(55349, 57324 + _i4); + defineSymbol(math, main, mathord, _ch4, wideChar); + defineSymbol(text, main, textord, _ch4, wideChar); + wideChar = String.fromCharCode(55349, 57334 + _i4); + defineSymbol(math, main, mathord, _ch4, wideChar); + defineSymbol(text, main, textord, _ch4, wideChar); + } + extraLatin = "\xD0\xDE\xFE"; + for (_i5 = 0; _i5 < extraLatin.length; _i5++) { + _ch5 = extraLatin.charAt(_i5); + defineSymbol(math, main, mathord, _ch5, _ch5); + defineSymbol(text, main, textord, _ch5, _ch5); + } + wideLatinLetterData = [ + ["mathbf", "textbf", "Main-Bold"], + // A-Z bold upright + ["mathbf", "textbf", "Main-Bold"], + // a-z bold upright + ["mathnormal", "textit", "Math-Italic"], + // A-Z italic + ["mathnormal", "textit", "Math-Italic"], + // a-z italic + ["boldsymbol", "boldsymbol", "Main-BoldItalic"], + // A-Z bold italic + ["boldsymbol", "boldsymbol", "Main-BoldItalic"], + // a-z bold italic + // Map fancy A-Z letters to script, not calligraphic. + // This aligns with unicode-math and math fonts (except Cambria Math). + ["mathscr", "textscr", "Script-Regular"], + // A-Z script + ["", "", ""], + // a-z script. No font + ["", "", ""], + // A-Z bold script. No font + ["", "", ""], + // a-z bold script. No font + ["mathfrak", "textfrak", "Fraktur-Regular"], + // A-Z Fraktur + ["mathfrak", "textfrak", "Fraktur-Regular"], + // a-z Fraktur + ["mathbb", "textbb", "AMS-Regular"], + // A-Z double-struck + ["mathbb", "textbb", "AMS-Regular"], + // k double-struck + // Note that we are using a bold font, but font metrics for regular Fraktur. + ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], + // A-Z bold Fraktur + ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], + // a-z bold Fraktur + ["mathsf", "textsf", "SansSerif-Regular"], + // A-Z sans-serif + ["mathsf", "textsf", "SansSerif-Regular"], + // a-z sans-serif + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + // A-Z bold sans-serif + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + // a-z bold sans-serif + ["mathitsf", "textitsf", "SansSerif-Italic"], + // A-Z italic sans-serif + ["mathitsf", "textitsf", "SansSerif-Italic"], + // a-z italic sans-serif + ["", "", ""], + // A-Z bold italic sans. No font + ["", "", ""], + // a-z bold italic sans. No font + ["mathtt", "texttt", "Typewriter-Regular"], + // A-Z monospace + ["mathtt", "texttt", "Typewriter-Regular"] + // a-z monospace + ]; + wideNumeralData = [ + ["mathbf", "textbf", "Main-Bold"], + // 0-9 bold + ["", "", ""], + // 0-9 double-struck. No KaTeX font. + ["mathsf", "textsf", "SansSerif-Regular"], + // 0-9 sans-serif + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + // 0-9 bold sans-serif + ["mathtt", "texttt", "Typewriter-Regular"] + // 0-9 monospace + ]; + wideCharacterFont = /* @__PURE__ */ __name(function wideCharacterFont2(wideChar2, mode) { + var H2 = wideChar2.charCodeAt(0); + var L2 = wideChar2.charCodeAt(1); + var codePoint = (H2 - 55296) * 1024 + (L2 - 56320) + 65536; + var j2 = mode === "math" ? 0 : 1; + if (119808 <= codePoint && codePoint < 120484) { + var i2 = Math.floor((codePoint - 119808) / 26); + return [wideLatinLetterData[i2][2], wideLatinLetterData[i2][j2]]; + } else if (120782 <= codePoint && codePoint <= 120831) { + var _i = Math.floor((codePoint - 120782) / 10); + return [wideNumeralData[_i][2], wideNumeralData[_i][j2]]; + } else if (codePoint === 120485 || codePoint === 120486) { + return [wideLatinLetterData[0][2], wideLatinLetterData[0][j2]]; + } else if (120486 < codePoint && codePoint < 120782) { + return ["", ""]; } else { - break; + throw new ParseError("Unsupported character: " + wideChar2); } - prestep = step; - } - return scale; - }; - return scale; - } - function linear() { - var scale = continuous(); - scale.copy = function() { - return copy$1(scale, linear()); - }; - initRange.apply(scale, arguments); - return linearish(scale); - } - function nice(domain, interval2) { - domain = domain.slice(); - var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t; - if (x1 < x0) { - t = i0, i0 = i1, i1 = t; - t = x0, x0 = x1, x1 = t; - } - domain[i0] = interval2.floor(x0); - domain[i1] = interval2.ceil(x1); - return domain; - } - const t0 = /* @__PURE__ */ new Date(), t1 = /* @__PURE__ */ new Date(); - function timeInterval(floori, offseti, count, field) { - function interval2(date2) { - return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2; - } - interval2.floor = (date2) => { - return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2; - }; - interval2.ceil = (date2) => { - return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2; - }; - interval2.round = (date2) => { - const d0 = interval2(date2), d1 = interval2.ceil(date2); - return date2 - d0 < d1 - date2 ? d0 : d1; - }; - interval2.offset = (date2, step) => { - return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2; - }; - interval2.range = (start2, stop, step) => { - const range2 = []; - start2 = interval2.ceil(start2); - step = step == null ? 1 : Math.floor(step); - if (!(start2 < stop) || !(step > 0)) - return range2; - let previous2; - do - range2.push(previous2 = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2); - while (previous2 < start2 && start2 < stop); - return range2; - }; - interval2.filter = (test) => { - return timeInterval((date2) => { - if (date2 >= date2) - while (floori(date2), !test(date2)) - date2.setTime(date2 - 1); - }, (date2, step) => { - if (date2 >= date2) { - if (step < 0) - while (++step <= 0) { - while (offseti(date2, -1), !test(date2)) { + }, "wideCharacterFont"); + lookupSymbol = /* @__PURE__ */ __name(function lookupSymbol2(value2, fontName, mode) { + if (symbols[mode][value2] && symbols[mode][value2].replace) { + value2 = symbols[mode][value2].replace; + } + return { + value: value2, + metrics: getCharacterMetrics(value2, fontName, mode) + }; + }, "lookupSymbol"); + makeSymbol = /* @__PURE__ */ __name(function makeSymbol2(value2, fontName, mode, options3, classes6) { + var lookup2 = lookupSymbol(value2, fontName, mode); + var metrics = lookup2.metrics; + value2 = lookup2.value; + var symbolNode; + if (metrics) { + var italic = metrics.italic; + if (mode === "text" || options3 && options3.font === "mathit") { + italic = 0; + } + symbolNode = new SymbolNode(value2, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes6); + } else { + typeof console !== "undefined" && console.warn("No character metrics " + ("for '" + value2 + "' in style '" + fontName + "' and mode '" + mode + "'")); + symbolNode = new SymbolNode(value2, 0, 0, 0, 0, 0, classes6); + } + if (options3) { + symbolNode.maxFontSize = options3.sizeMultiplier; + if (options3.style.isTight()) { + symbolNode.classes.push("mtight"); + } + var color2 = options3.getColor(); + if (color2) { + symbolNode.style.color = color2; + } + } + return symbolNode; + }, "makeSymbol"); + mathsym = /* @__PURE__ */ __name(function mathsym2(value2, mode, options3, classes6) { + if (classes6 === void 0) { + classes6 = []; + } + if (options3.font === "boldsymbol" && lookupSymbol(value2, "Main-Bold", mode).metrics) { + return makeSymbol(value2, "Main-Bold", mode, options3, classes6.concat(["mathbf"])); + } else if (value2 === "\\" || symbols[mode][value2].font === "main") { + return makeSymbol(value2, "Main-Regular", mode, options3, classes6); + } else { + return makeSymbol(value2, "AMS-Regular", mode, options3, classes6.concat(["amsrm"])); + } + }, "mathsym"); + boldsymbol = /* @__PURE__ */ __name(function boldsymbol2(value2, mode, options3, classes6, type3) { + if (type3 !== "textord" && lookupSymbol(value2, "Math-BoldItalic", mode).metrics) { + return { + fontName: "Math-BoldItalic", + fontClass: "boldsymbol" + }; + } else { + return { + fontName: "Main-Bold", + fontClass: "mathbf" + }; + } + }, "boldsymbol"); + makeOrd = /* @__PURE__ */ __name(function makeOrd2(group2, options3, type3) { + var mode = group2.mode; + var text2 = group2.text; + var classes6 = ["mord"]; + var isFont = mode === "math" || mode === "text" && options3.font; + var fontOrFamily = isFont ? options3.font : options3.fontFamily; + var wideFontName = ""; + var wideFontClass = ""; + if (text2.charCodeAt(0) === 55349) { + [wideFontName, wideFontClass] = wideCharacterFont(text2, mode); + } + if (wideFontName.length > 0) { + return makeSymbol(text2, wideFontName, mode, options3, classes6.concat(wideFontClass)); + } else if (fontOrFamily) { + var fontName; + var fontClasses; + if (fontOrFamily === "boldsymbol") { + var fontData = boldsymbol(text2, mode, options3, classes6, type3); + fontName = fontData.fontName; + fontClasses = [fontData.fontClass]; + } else if (isFont) { + fontName = fontMap[fontOrFamily].fontName; + fontClasses = [fontOrFamily]; + } else { + fontName = retrieveTextFontName(fontOrFamily, options3.fontWeight, options3.fontShape); + fontClasses = [fontOrFamily, options3.fontWeight, options3.fontShape]; + } + if (lookupSymbol(text2, fontName, mode).metrics) { + return makeSymbol(text2, fontName, mode, options3, classes6.concat(fontClasses)); + } else if (ligatures.hasOwnProperty(text2) && fontName.slice(0, 10) === "Typewriter") { + var parts = []; + for (var i2 = 0; i2 < text2.length; i2++) { + parts.push(makeSymbol(text2[i2], fontName, mode, options3, classes6.concat(fontClasses))); + } + return makeFragment(parts); + } + } + if (type3 === "mathord") { + return makeSymbol(text2, "Math-Italic", mode, options3, classes6.concat(["mathnormal"])); + } else if (type3 === "textord") { + var font = symbols[mode][text2] && symbols[mode][text2].font; + if (font === "ams") { + var _fontName = retrieveTextFontName("amsrm", options3.fontWeight, options3.fontShape); + return makeSymbol(text2, _fontName, mode, options3, classes6.concat("amsrm", options3.fontWeight, options3.fontShape)); + } else if (font === "main" || !font) { + var _fontName2 = retrieveTextFontName("textrm", options3.fontWeight, options3.fontShape); + return makeSymbol(text2, _fontName2, mode, options3, classes6.concat(options3.fontWeight, options3.fontShape)); + } else { + var _fontName3 = retrieveTextFontName(font, options3.fontWeight, options3.fontShape); + return makeSymbol(text2, _fontName3, mode, options3, classes6.concat(_fontName3, options3.fontWeight, options3.fontShape)); + } + } else { + throw new Error("unexpected type: " + type3 + " in makeOrd"); + } + }, "makeOrd"); + canCombine = /* @__PURE__ */ __name((prev2, next3) => { + if (createClass(prev2.classes) !== createClass(next3.classes) || prev2.skew !== next3.skew || prev2.maxFontSize !== next3.maxFontSize) { + return false; + } + if (prev2.classes.length === 1) { + var cls = prev2.classes[0]; + if (cls === "mbin" || cls === "mord") { + return false; + } + } + for (var style3 in prev2.style) { + if (prev2.style.hasOwnProperty(style3) && prev2.style[style3] !== next3.style[style3]) { + return false; + } + } + for (var _style in next3.style) { + if (next3.style.hasOwnProperty(_style) && prev2.style[_style] !== next3.style[_style]) { + return false; + } + } + return true; + }, "canCombine"); + tryCombineChars = /* @__PURE__ */ __name((chars) => { + for (var i2 = 0; i2 < chars.length - 1; i2++) { + var prev2 = chars[i2]; + var next3 = chars[i2 + 1]; + if (prev2 instanceof SymbolNode && next3 instanceof SymbolNode && canCombine(prev2, next3)) { + prev2.text += next3.text; + prev2.height = Math.max(prev2.height, next3.height); + prev2.depth = Math.max(prev2.depth, next3.depth); + prev2.italic = next3.italic; + chars.splice(i2 + 1, 1); + i2--; + } + } + return chars; + }, "tryCombineChars"); + sizeElementFromChildren = /* @__PURE__ */ __name(function sizeElementFromChildren2(elem) { + var height2 = 0; + var depth = 0; + var maxFontSize = 0; + for (var i2 = 0; i2 < elem.children.length; i2++) { + var child = elem.children[i2]; + if (child.height > height2) { + height2 = child.height; + } + if (child.depth > depth) { + depth = child.depth; + } + if (child.maxFontSize > maxFontSize) { + maxFontSize = child.maxFontSize; + } + } + elem.height = height2; + elem.depth = depth; + elem.maxFontSize = maxFontSize; + }, "sizeElementFromChildren"); + makeSpan$2 = /* @__PURE__ */ __name(function makeSpan(classes6, children2, options3, style3) { + var span = new Span(classes6, children2, options3, style3); + sizeElementFromChildren(span); + return span; + }, "makeSpan"); + makeSvgSpan = /* @__PURE__ */ __name((classes6, children2, options3, style3) => new Span(classes6, children2, options3, style3), "makeSvgSpan"); + makeLineSpan = /* @__PURE__ */ __name(function makeLineSpan2(className, options3, thickness) { + var line2 = makeSpan$2([className], [], options3); + line2.height = Math.max(thickness || options3.fontMetrics().defaultRuleThickness, options3.minRuleThickness); + line2.style.borderBottomWidth = makeEm(line2.height); + line2.maxFontSize = 1; + return line2; + }, "makeLineSpan"); + makeAnchor = /* @__PURE__ */ __name(function makeAnchor2(href, classes6, children2, options3) { + var anchor = new Anchor(href, classes6, children2, options3); + sizeElementFromChildren(anchor); + return anchor; + }, "makeAnchor"); + makeFragment = /* @__PURE__ */ __name(function makeFragment2(children2) { + var fragment = new DocumentFragment(children2); + sizeElementFromChildren(fragment); + return fragment; + }, "makeFragment"); + wrapFragment = /* @__PURE__ */ __name(function wrapFragment2(group2, options3) { + if (group2 instanceof DocumentFragment) { + return makeSpan$2([], [group2], options3); + } + return group2; + }, "wrapFragment"); + getVListChildrenAndDepth = /* @__PURE__ */ __name(function getVListChildrenAndDepth2(params) { + if (params.positionType === "individualShift") { + var oldChildren = params.children; + var children2 = [oldChildren[0]]; + var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth; + var currPos = _depth; + for (var i2 = 1; i2 < oldChildren.length; i2++) { + var diff2 = -oldChildren[i2].shift - currPos - oldChildren[i2].elem.depth; + var size5 = diff2 - (oldChildren[i2 - 1].elem.height + oldChildren[i2 - 1].elem.depth); + currPos = currPos + diff2; + children2.push({ + type: "kern", + size: size5 + }); + children2.push(oldChildren[i2]); + } + return { + children: children2, + depth: _depth + }; + } + var depth; + if (params.positionType === "top") { + var bottom2 = params.positionData; + for (var _i = 0; _i < params.children.length; _i++) { + var child = params.children[_i]; + bottom2 -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth; + } + depth = bottom2; + } else if (params.positionType === "bottom") { + depth = -params.positionData; + } else { + var firstChild = params.children[0]; + if (firstChild.type !== "elem") { + throw new Error('First child must have type "elem".'); + } + if (params.positionType === "shift") { + depth = -firstChild.elem.depth - params.positionData; + } else if (params.positionType === "firstBaseline") { + depth = -firstChild.elem.depth; + } else { + throw new Error("Invalid positionType " + params.positionType + "."); + } + } + return { + children: params.children, + depth + }; + }, "getVListChildrenAndDepth"); + makeVList = /* @__PURE__ */ __name(function makeVList2(params, options3) { + var { + children: children2, + depth + } = getVListChildrenAndDepth(params); + var pstrutSize = 0; + for (var i2 = 0; i2 < children2.length; i2++) { + var child = children2[i2]; + if (child.type === "elem") { + var elem = child.elem; + pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height); + } + } + pstrutSize += 2; + var pstrut = makeSpan$2(["pstrut"], []); + pstrut.style.height = makeEm(pstrutSize); + var realChildren = []; + var minPos = depth; + var maxPos2 = depth; + var currPos = depth; + for (var _i2 = 0; _i2 < children2.length; _i2++) { + var _child = children2[_i2]; + if (_child.type === "kern") { + currPos += _child.size; + } else { + var _elem = _child.elem; + var classes6 = _child.wrapperClasses || []; + var style3 = _child.wrapperStyle || {}; + var childWrap = makeSpan$2(classes6, [pstrut, _elem], void 0, style3); + childWrap.style.top = makeEm(-pstrutSize - currPos - _elem.depth); + if (_child.marginLeft) { + childWrap.style.marginLeft = _child.marginLeft; + } + if (_child.marginRight) { + childWrap.style.marginRight = _child.marginRight; + } + realChildren.push(childWrap); + currPos += _elem.height + _elem.depth; + } + minPos = Math.min(minPos, currPos); + maxPos2 = Math.max(maxPos2, currPos); + } + var vlist = makeSpan$2(["vlist"], realChildren); + vlist.style.height = makeEm(maxPos2); + var rows; + if (minPos < 0) { + var emptySpan = makeSpan$2([], []); + var depthStrut = makeSpan$2(["vlist"], [emptySpan]); + depthStrut.style.height = makeEm(-minPos); + var topStrut = makeSpan$2(["vlist-s"], [new SymbolNode("\u200B")]); + rows = [makeSpan$2(["vlist-r"], [vlist, topStrut]), makeSpan$2(["vlist-r"], [depthStrut])]; + } else { + rows = [makeSpan$2(["vlist-r"], [vlist])]; + } + var vtable = makeSpan$2(["vlist-t"], rows); + if (rows.length === 2) { + vtable.classes.push("vlist-t2"); + } + vtable.height = maxPos2; + vtable.depth = -minPos; + return vtable; + }, "makeVList"); + makeGlue = /* @__PURE__ */ __name((measurement, options3) => { + var rule = makeSpan$2(["mspace"], [], options3); + var size5 = calculateSize(measurement, options3); + rule.style.marginRight = makeEm(size5); + return rule; + }, "makeGlue"); + retrieveTextFontName = /* @__PURE__ */ __name(function retrieveTextFontName2(fontFamily, fontWeight, fontShape) { + var baseFontName = ""; + switch (fontFamily) { + case "amsrm": + baseFontName = "AMS"; + break; + case "textrm": + baseFontName = "Main"; + break; + case "textsf": + baseFontName = "SansSerif"; + break; + case "texttt": + baseFontName = "Typewriter"; + break; + default: + baseFontName = fontFamily; + } + var fontStylesName; + if (fontWeight === "textbf" && fontShape === "textit") { + fontStylesName = "BoldItalic"; + } else if (fontWeight === "textbf") { + fontStylesName = "Bold"; + } else if (fontWeight === "textit") { + fontStylesName = "Italic"; + } else { + fontStylesName = "Regular"; + } + return baseFontName + "-" + fontStylesName; + }, "retrieveTextFontName"); + fontMap = { + // styles + "mathbf": { + variant: "bold", + fontName: "Main-Bold" + }, + "mathrm": { + variant: "normal", + fontName: "Main-Regular" + }, + "textit": { + variant: "italic", + fontName: "Main-Italic" + }, + "mathit": { + variant: "italic", + fontName: "Main-Italic" + }, + "mathnormal": { + variant: "italic", + fontName: "Math-Italic" + }, + // "boldsymbol" is missing because they require the use of multiple fonts: + // Math-BoldItalic and Main-Bold. This is handled by a special case in + // makeOrd which ends up calling boldsymbol. + // families + "mathbb": { + variant: "double-struck", + fontName: "AMS-Regular" + }, + "mathcal": { + variant: "script", + fontName: "Caligraphic-Regular" + }, + "mathfrak": { + variant: "fraktur", + fontName: "Fraktur-Regular" + }, + "mathscr": { + variant: "script", + fontName: "Script-Regular" + }, + "mathsf": { + variant: "sans-serif", + fontName: "SansSerif-Regular" + }, + "mathtt": { + variant: "monospace", + fontName: "Typewriter-Regular" + } + }; + svgData = { + // path, width, height + vec: ["vec", 0.471, 0.714], + // values from the font glyph + oiintSize1: ["oiintSize1", 0.957, 0.499], + // oval to overlay the integrand + oiintSize2: ["oiintSize2", 1.472, 0.659], + oiiintSize1: ["oiiintSize1", 1.304, 0.499], + oiiintSize2: ["oiiintSize2", 1.98, 0.659] + }; + staticSvg = /* @__PURE__ */ __name(function staticSvg2(value2, options3) { + var [pathName, width3, height2] = svgData[value2]; + var path4 = new PathNode(pathName); + var svgNode2 = new SvgNode([path4], { + "width": makeEm(width3), + "height": makeEm(height2), + // Override CSS rule `.katex svg { width: 100% }` + "style": "width:" + makeEm(width3), + "viewBox": "0 0 " + 1e3 * width3 + " " + 1e3 * height2, + "preserveAspectRatio": "xMinYMin" + }); + var span = makeSvgSpan(["overlay"], [svgNode2], options3); + span.height = height2; + span.style.height = makeEm(height2); + span.style.width = makeEm(width3); + return span; + }, "staticSvg"); + buildCommon = { + fontMap, + makeSymbol, + mathsym, + makeSpan: makeSpan$2, + makeSvgSpan, + makeLineSpan, + makeAnchor, + makeFragment, + wrapFragment, + makeVList, + makeOrd, + makeGlue, + staticSvg, + svgData, + tryCombineChars + }; + thinspace = { + number: 3, + unit: "mu" + }; + mediumspace = { + number: 4, + unit: "mu" + }; + thickspace = { + number: 5, + unit: "mu" + }; + spacings = { + mord: { + mop: thinspace, + mbin: mediumspace, + mrel: thickspace, + minner: thinspace + }, + mop: { + mord: thinspace, + mop: thinspace, + mrel: thickspace, + minner: thinspace + }, + mbin: { + mord: mediumspace, + mop: mediumspace, + mopen: mediumspace, + minner: mediumspace + }, + mrel: { + mord: thickspace, + mop: thickspace, + mopen: thickspace, + minner: thickspace + }, + mopen: {}, + mclose: { + mop: thinspace, + mbin: mediumspace, + mrel: thickspace, + minner: thinspace + }, + mpunct: { + mord: thinspace, + mop: thinspace, + mrel: thickspace, + mopen: thinspace, + mclose: thinspace, + mpunct: thinspace, + minner: thinspace + }, + minner: { + mord: thinspace, + mop: thinspace, + mbin: mediumspace, + mrel: thickspace, + mopen: thinspace, + mpunct: thinspace, + minner: thinspace + } + }; + tightSpacings = { + mord: { + mop: thinspace + }, + mop: { + mord: thinspace, + mop: thinspace + }, + mbin: {}, + mrel: {}, + mopen: {}, + mclose: { + mop: thinspace + }, + mpunct: {}, + minner: { + mop: thinspace + } + }; + _functions = {}; + _htmlGroupBuilders = {}; + _mathmlGroupBuilders = {}; + __name(defineFunction, "defineFunction"); + __name(defineFunctionBuilders, "defineFunctionBuilders"); + normalizeArgument = /* @__PURE__ */ __name(function normalizeArgument2(arg) { + return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg; + }, "normalizeArgument"); + ordargument = /* @__PURE__ */ __name(function ordargument2(arg) { + return arg.type === "ordgroup" ? arg.body : [arg]; + }, "ordargument"); + makeSpan$1 = buildCommon.makeSpan; + binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"]; + binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"]; + styleMap$1 = { + "display": Style$1.DISPLAY, + "text": Style$1.TEXT, + "script": Style$1.SCRIPT, + "scriptscript": Style$1.SCRIPTSCRIPT + }; + DomEnum = { + mord: "mord", + mop: "mop", + mbin: "mbin", + mrel: "mrel", + mopen: "mopen", + mclose: "mclose", + mpunct: "mpunct", + minner: "minner" + }; + buildExpression$1 = /* @__PURE__ */ __name(function buildExpression(expression, options3, isRealGroup, surrounding) { + if (surrounding === void 0) { + surrounding = [null, null]; + } + var groups = []; + for (var i2 = 0; i2 < expression.length; i2++) { + var output2 = buildGroup$1(expression[i2], options3); + if (output2 instanceof DocumentFragment) { + var children2 = output2.children; + groups.push(...children2); + } else { + groups.push(output2); + } + } + buildCommon.tryCombineChars(groups); + if (!isRealGroup) { + return groups; + } + var glueOptions = options3; + if (expression.length === 1) { + var node2 = expression[0]; + if (node2.type === "sizing") { + glueOptions = options3.havingSize(node2.size); + } else if (node2.type === "styling") { + glueOptions = options3.havingStyle(styleMap$1[node2.style]); + } + } + var dummyPrev = makeSpan$1([surrounding[0] || "leftmost"], [], options3); + var dummyNext = makeSpan$1([surrounding[1] || "rightmost"], [], options3); + var isRoot = isRealGroup === "root"; + traverseNonSpaceNodes(groups, (node3, prev2) => { + var prevType = prev2.classes[0]; + var type3 = node3.classes[0]; + if (prevType === "mbin" && utils.contains(binRightCanceller, type3)) { + prev2.classes[0] = "mord"; + } else if (type3 === "mbin" && utils.contains(binLeftCanceller, prevType)) { + node3.classes[0] = "mord"; + } + }, { + node: dummyPrev + }, dummyNext, isRoot); + traverseNonSpaceNodes(groups, (node3, prev2) => { + var prevType = getTypeOfDomTree(prev2); + var type3 = getTypeOfDomTree(node3); + var space = prevType && type3 ? node3.hasClass("mtight") ? tightSpacings[prevType][type3] : spacings[prevType][type3] : null; + if (space) { + return buildCommon.makeGlue(space, glueOptions); + } + }, { + node: dummyPrev + }, dummyNext, isRoot); + return groups; + }, "buildExpression"); + traverseNonSpaceNodes = /* @__PURE__ */ __name(function traverseNonSpaceNodes2(nodes6, callback, prev2, next3, isRoot) { + if (next3) { + nodes6.push(next3); + } + var i2 = 0; + for (; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; + var partialGroup = checkPartialGroup(node2); + if (partialGroup) { + traverseNonSpaceNodes2(partialGroup.children, callback, prev2, null, isRoot); + continue; + } + var nonspace = !node2.hasClass("mspace"); + if (nonspace) { + var result = callback(node2, prev2.node); + if (result) { + if (prev2.insertAfter) { + prev2.insertAfter(result); + } else { + nodes6.unshift(result); + i2++; } } - else - while (--step >= 0) { - while (offseti(date2, 1), !test(date2)) { - } + } + if (nonspace) { + prev2.node = node2; + } else if (isRoot && node2.hasClass("newline")) { + prev2.node = makeSpan$1(["leftmost"]); + } + prev2.insertAfter = /* @__PURE__ */ ((index) => (n2) => { + nodes6.splice(index + 1, 0, n2); + i2++; + })(i2); + } + if (next3) { + nodes6.pop(); + } + }, "traverseNonSpaceNodes"); + checkPartialGroup = /* @__PURE__ */ __name(function checkPartialGroup2(node2) { + if (node2 instanceof DocumentFragment || node2 instanceof Anchor || node2 instanceof Span && node2.hasClass("enclosing")) { + return node2; + } + return null; + }, "checkPartialGroup"); + getOutermostNode = /* @__PURE__ */ __name(function getOutermostNode2(node2, side) { + var partialGroup = checkPartialGroup(node2); + if (partialGroup) { + var children2 = partialGroup.children; + if (children2.length) { + if (side === "right") { + return getOutermostNode2(children2[children2.length - 1], "right"); + } else if (side === "left") { + return getOutermostNode2(children2[0], "left"); } + } + } + return node2; + }, "getOutermostNode"); + getTypeOfDomTree = /* @__PURE__ */ __name(function getTypeOfDomTree2(node2, side) { + if (!node2) { + return null; + } + if (side) { + node2 = getOutermostNode(node2, side); + } + return DomEnum[node2.classes[0]] || null; + }, "getTypeOfDomTree"); + makeNullDelimiter = /* @__PURE__ */ __name(function makeNullDelimiter2(options3, classes6) { + var moreClasses = ["nulldelimiter"].concat(options3.baseSizingClasses()); + return makeSpan$1(classes6.concat(moreClasses)); + }, "makeNullDelimiter"); + buildGroup$1 = /* @__PURE__ */ __name(function buildGroup(group2, options3, baseOptions) { + if (!group2) { + return makeSpan$1(); + } + if (_htmlGroupBuilders[group2.type]) { + var groupNode = _htmlGroupBuilders[group2.type](group2, options3); + if (baseOptions && options3.size !== baseOptions.size) { + groupNode = makeSpan$1(options3.sizingClasses(baseOptions), [groupNode], options3); + var multiplier = options3.sizeMultiplier / baseOptions.sizeMultiplier; + groupNode.height *= multiplier; + groupNode.depth *= multiplier; + } + return groupNode; + } else { + throw new ParseError("Got group of unknown type: '" + group2.type + "'"); + } + }, "buildGroup"); + __name(buildHTMLUnbreakable, "buildHTMLUnbreakable"); + __name(buildHTML, "buildHTML"); + __name(newDocumentFragment, "newDocumentFragment"); + MathNode = class { + static { + __name(this, "MathNode"); + } + constructor(type3, children2, classes6) { + this.type = void 0; + this.attributes = void 0; + this.children = void 0; + this.classes = void 0; + this.type = type3; + this.attributes = {}; + this.children = children2 || []; + this.classes = classes6 || []; + } + /** + * Sets an attribute on a MathML node. MathML depends on attributes to convey a + * semantic content, so this is used heavily. + */ + setAttribute(name, value2) { + this.attributes[name] = value2; + } + /** + * Gets an attribute on a MathML node. + */ + getAttribute(name) { + return this.attributes[name]; + } + /** + * Converts the math node into a MathML-namespaced DOM element. + */ + toNode() { + var node2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + node2.setAttribute(attr, this.attributes[attr]); + } + } + if (this.classes.length > 0) { + node2.className = createClass(this.classes); + } + for (var i2 = 0; i2 < this.children.length; i2++) { + node2.appendChild(this.children[i2].toNode()); + } + return node2; + } + /** + * Converts the math node into an HTML markup string. + */ + toMarkup() { + var markup = "<" + this.type; + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + markup += " " + attr + '="'; + markup += utils.escape(this.attributes[attr]); + markup += '"'; + } + } + if (this.classes.length > 0) { + markup += ' class ="' + utils.escape(createClass(this.classes)) + '"'; + } + markup += ">"; + for (var i2 = 0; i2 < this.children.length; i2++) { + markup += this.children[i2].toMarkup(); + } + markup += ""; + return markup; + } + /** + * Converts the math node into a string, similar to innerText, but escaped. + */ + toText() { + return this.children.map((child) => child.toText()).join(""); + } + }; + TextNode = class { + static { + __name(this, "TextNode"); + } + constructor(text2) { + this.text = void 0; + this.text = text2; + } + /** + * Converts the text node into a DOM text node. + */ + toNode() { + return document.createTextNode(this.text); + } + /** + * Converts the text node into escaped HTML markup + * (representing the text itself). + */ + toMarkup() { + return utils.escape(this.toText()); + } + /** + * Converts the text node into a string + * (representing the text itself). + */ + toText() { + return this.text; + } + }; + SpaceNode = class { + static { + __name(this, "SpaceNode"); + } + /** + * Create a Space node with width given in CSS ems. + */ + constructor(width3) { + this.width = void 0; + this.character = void 0; + this.width = width3; + if (width3 >= 0.05555 && width3 <= 0.05556) { + this.character = "\u200A"; + } else if (width3 >= 0.1666 && width3 <= 0.1667) { + this.character = "\u2009"; + } else if (width3 >= 0.2222 && width3 <= 0.2223) { + this.character = "\u2005"; + } else if (width3 >= 0.2777 && width3 <= 0.2778) { + this.character = "\u2005\u200A"; + } else if (width3 >= -0.05556 && width3 <= -0.05555) { + this.character = "\u200A\u2063"; + } else if (width3 >= -0.1667 && width3 <= -0.1666) { + this.character = "\u2009\u2063"; + } else if (width3 >= -0.2223 && width3 <= -0.2222) { + this.character = "\u205F\u2063"; + } else if (width3 >= -0.2778 && width3 <= -0.2777) { + this.character = "\u2005\u2063"; + } else { + this.character = null; + } + } + /** + * Converts the math node into a MathML-namespaced DOM element. + */ + toNode() { + if (this.character) { + return document.createTextNode(this.character); + } else { + var node2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace"); + node2.setAttribute("width", makeEm(this.width)); + return node2; + } + } + /** + * Converts the math node into an HTML markup string. + */ + toMarkup() { + if (this.character) { + return "" + this.character + ""; + } else { + return ''; + } + } + /** + * Converts the math node into a string, similar to innerText. + */ + toText() { + if (this.character) { + return this.character; + } else { + return " "; + } } - }); - }; - if (count) { - interval2.count = (start2, end2) => { - t0.setTime(+start2), t1.setTime(+end2); - floori(t0), floori(t1); - return Math.floor(count(t0, t1)); }; - interval2.every = (step) => { - step = Math.floor(step); - return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field ? (d) => field(d) % step === 0 : (d) => interval2.count(0, d) % step === 0); + mathMLTree = { + MathNode, + TextNode, + SpaceNode, + newDocumentFragment }; - } - return interval2; - } - const millisecond = timeInterval(() => { - }, (date2, step) => { - date2.setTime(+date2 + step); - }, (start2, end2) => { - return end2 - start2; - }); - millisecond.every = (k) => { - k = Math.floor(k); - if (!isFinite(k) || !(k > 0)) - return null; - if (!(k > 1)) - return millisecond; - return timeInterval((date2) => { - date2.setTime(Math.floor(date2 / k) * k); - }, (date2, step) => { - date2.setTime(+date2 + step * k); - }, (start2, end2) => { - return (end2 - start2) / k; - }); - }; - millisecond.range; - const durationSecond = 1e3; - const durationMinute = durationSecond * 60; - const durationHour = durationMinute * 60; - const durationDay = durationHour * 24; - const durationWeek = durationDay * 7; - const durationMonth = durationDay * 30; - const durationYear = durationDay * 365; - const second = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds()); - }, (date2, step) => { - date2.setTime(+date2 + step * durationSecond); - }, (start2, end2) => { - return (end2 - start2) / durationSecond; - }, (date2) => { - return date2.getUTCSeconds(); - }); - second.range; - const timeMinute = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond); - }, (date2, step) => { - date2.setTime(+date2 + step * durationMinute); - }, (start2, end2) => { - return (end2 - start2) / durationMinute; - }, (date2) => { - return date2.getMinutes(); - }); - timeMinute.range; - const utcMinute = timeInterval((date2) => { - date2.setUTCSeconds(0, 0); - }, (date2, step) => { - date2.setTime(+date2 + step * durationMinute); - }, (start2, end2) => { - return (end2 - start2) / durationMinute; - }, (date2) => { - return date2.getUTCMinutes(); - }); - utcMinute.range; - const timeHour = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute); - }, (date2, step) => { - date2.setTime(+date2 + step * durationHour); - }, (start2, end2) => { - return (end2 - start2) / durationHour; - }, (date2) => { - return date2.getHours(); - }); - timeHour.range; - const utcHour = timeInterval((date2) => { - date2.setUTCMinutes(0, 0, 0); - }, (date2, step) => { - date2.setTime(+date2 + step * durationHour); - }, (start2, end2) => { - return (end2 - start2) / durationHour; - }, (date2) => { - return date2.getUTCHours(); - }); - utcHour.range; - const timeDay = timeInterval( - (date2) => date2.setHours(0, 0, 0, 0), - (date2, step) => date2.setDate(date2.getDate() + step), - (start2, end2) => (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationDay, - (date2) => date2.getDate() - 1 - ); - timeDay.range; - const utcDay = timeInterval((date2) => { - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCDate(date2.getUTCDate() + step); - }, (start2, end2) => { - return (end2 - start2) / durationDay; - }, (date2) => { - return date2.getUTCDate() - 1; - }); - utcDay.range; - const unixDay = timeInterval((date2) => { - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCDate(date2.getUTCDate() + step); - }, (start2, end2) => { - return (end2 - start2) / durationDay; - }, (date2) => { - return Math.floor(date2 / durationDay); - }); - unixDay.range; - function timeWeekday(i2) { - return timeInterval((date2) => { - date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7); - date2.setHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setDate(date2.getDate() + step * 7); - }, (start2, end2) => { - return (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationWeek; - }); - } - const timeSunday = timeWeekday(0); - const timeMonday = timeWeekday(1); - const timeTuesday = timeWeekday(2); - const timeWednesday = timeWeekday(3); - const timeThursday = timeWeekday(4); - const timeFriday = timeWeekday(5); - const timeSaturday = timeWeekday(6); - timeSunday.range; - timeMonday.range; - timeTuesday.range; - timeWednesday.range; - timeThursday.range; - timeFriday.range; - timeSaturday.range; - function utcWeekday(i2) { - return timeInterval((date2) => { - date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCDate(date2.getUTCDate() + step * 7); - }, (start2, end2) => { - return (end2 - start2) / durationWeek; - }); - } - const utcSunday = utcWeekday(0); - const utcMonday = utcWeekday(1); - const utcTuesday = utcWeekday(2); - const utcWednesday = utcWeekday(3); - const utcThursday = utcWeekday(4); - const utcFriday = utcWeekday(5); - const utcSaturday = utcWeekday(6); - utcSunday.range; - utcMonday.range; - utcTuesday.range; - utcWednesday.range; - utcThursday.range; - utcFriday.range; - utcSaturday.range; - const timeMonth = timeInterval((date2) => { - date2.setDate(1); - date2.setHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setMonth(date2.getMonth() + step); - }, (start2, end2) => { - return end2.getMonth() - start2.getMonth() + (end2.getFullYear() - start2.getFullYear()) * 12; - }, (date2) => { - return date2.getMonth(); - }); - timeMonth.range; - const utcMonth = timeInterval((date2) => { - date2.setUTCDate(1); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCMonth(date2.getUTCMonth() + step); - }, (start2, end2) => { - return end2.getUTCMonth() - start2.getUTCMonth() + (end2.getUTCFullYear() - start2.getUTCFullYear()) * 12; - }, (date2) => { - return date2.getUTCMonth(); - }); - utcMonth.range; - const timeYear = timeInterval((date2) => { - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setFullYear(date2.getFullYear() + step); - }, (start2, end2) => { - return end2.getFullYear() - start2.getFullYear(); - }, (date2) => { - return date2.getFullYear(); - }); - timeYear.every = (k) => { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date2) => { - date2.setFullYear(Math.floor(date2.getFullYear() / k) * k); - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setFullYear(date2.getFullYear() + step * k); - }); - }; - timeYear.range; - const utcYear = timeInterval((date2) => { - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCFullYear(date2.getUTCFullYear() + step); - }, (start2, end2) => { - return end2.getUTCFullYear() - start2.getUTCFullYear(); - }, (date2) => { - return date2.getUTCFullYear(); - }); - utcYear.every = (k) => { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date2) => { - date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k) * k); - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCFullYear(date2.getUTCFullYear() + step * k); - }); - }; - utcYear.range; - function ticker(year, month, week, day, hour, minute) { - const tickIntervals = [ - [second, 1, durationSecond], - [second, 5, 5 * durationSecond], - [second, 15, 15 * durationSecond], - [second, 30, 30 * durationSecond], - [minute, 1, durationMinute], - [minute, 5, 5 * durationMinute], - [minute, 15, 15 * durationMinute], - [minute, 30, 30 * durationMinute], - [hour, 1, durationHour], - [hour, 3, 3 * durationHour], - [hour, 6, 6 * durationHour], - [hour, 12, 12 * durationHour], - [day, 1, durationDay], - [day, 2, 2 * durationDay], - [week, 1, durationWeek], - [month, 1, durationMonth], - [month, 3, 3 * durationMonth], - [year, 1, durationYear] - ]; - function ticks2(start2, stop, count) { - const reverse = stop < start2; - if (reverse) - [start2, stop] = [stop, start2]; - const interval2 = count && typeof count.range === "function" ? count : tickInterval2(start2, stop, count); - const ticks3 = interval2 ? interval2.range(start2, +stop + 1) : []; - return reverse ? ticks3.reverse() : ticks3; - } - function tickInterval2(start2, stop, count) { - const target = Math.abs(stop - start2) / count; - const i2 = bisector(([, , step2]) => step2).right(tickIntervals, target); - if (i2 === tickIntervals.length) - return year.every(tickStep(start2 / durationYear, stop / durationYear, count)); - if (i2 === 0) - return millisecond.every(Math.max(tickStep(start2, stop, count), 1)); - const [t, step] = tickIntervals[target / tickIntervals[i2 - 1][2] < tickIntervals[i2][2] / target ? i2 - 1 : i2]; - return t.every(step); - } - return [ticks2, tickInterval2]; - } - const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute); - function localDate(d) { - if (0 <= d.y && d.y < 100) { - var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); - date2.setFullYear(d.y); - return date2; - } - return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); - } - function utcDate(d) { - if (0 <= d.y && d.y < 100) { - var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); - date2.setUTCFullYear(d.y); - return date2; - } - return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); - } - function newDate(y2, m, d) { - return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 }; - } - function formatLocale(locale2) { - var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths; - var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths); - var formats = { - "a": formatShortWeekday, - "A": formatWeekday, - "b": formatShortMonth, - "B": formatMonth, - "c": null, - "d": formatDayOfMonth, - "e": formatDayOfMonth, - "f": formatMicroseconds, - "g": formatYearISO, - "G": formatFullYearISO, - "H": formatHour24, - "I": formatHour12, - "j": formatDayOfYear, - "L": formatMilliseconds, - "m": formatMonthNumber, - "M": formatMinutes, - "p": formatPeriod, - "q": formatQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatSeconds, - "u": formatWeekdayNumberMonday, - "U": formatWeekNumberSunday, - "V": formatWeekNumberISO, - "w": formatWeekdayNumberSunday, - "W": formatWeekNumberMonday, - "x": null, - "X": null, - "y": formatYear, - "Y": formatFullYear, - "Z": formatZone, - "%": formatLiteralPercent - }; - var utcFormats = { - "a": formatUTCShortWeekday, - "A": formatUTCWeekday, - "b": formatUTCShortMonth, - "B": formatUTCMonth, - "c": null, - "d": formatUTCDayOfMonth, - "e": formatUTCDayOfMonth, - "f": formatUTCMicroseconds, - "g": formatUTCYearISO, - "G": formatUTCFullYearISO, - "H": formatUTCHour24, - "I": formatUTCHour12, - "j": formatUTCDayOfYear, - "L": formatUTCMilliseconds, - "m": formatUTCMonthNumber, - "M": formatUTCMinutes, - "p": formatUTCPeriod, - "q": formatUTCQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatUTCSeconds, - "u": formatUTCWeekdayNumberMonday, - "U": formatUTCWeekNumberSunday, - "V": formatUTCWeekNumberISO, - "w": formatUTCWeekdayNumberSunday, - "W": formatUTCWeekNumberMonday, - "x": null, - "X": null, - "y": formatUTCYear, - "Y": formatUTCFullYear, - "Z": formatUTCZone, - "%": formatLiteralPercent - }; - var parses = { - "a": parseShortWeekday, - "A": parseWeekday, - "b": parseShortMonth, - "B": parseMonth, - "c": parseLocaleDateTime, - "d": parseDayOfMonth, - "e": parseDayOfMonth, - "f": parseMicroseconds, - "g": parseYear, - "G": parseFullYear, - "H": parseHour24, - "I": parseHour24, - "j": parseDayOfYear, - "L": parseMilliseconds, - "m": parseMonthNumber, - "M": parseMinutes, - "p": parsePeriod, - "q": parseQuarter, - "Q": parseUnixTimestamp, - "s": parseUnixTimestampSeconds, - "S": parseSeconds, - "u": parseWeekdayNumberMonday, - "U": parseWeekNumberSunday, - "V": parseWeekNumberISO, - "w": parseWeekdayNumberSunday, - "W": parseWeekNumberMonday, - "x": parseLocaleDate, - "X": parseLocaleTime, - "y": parseYear, - "Y": parseFullYear, - "Z": parseZone, - "%": parseLiteralPercent - }; - formats.x = newFormat(locale_date, formats); - formats.X = newFormat(locale_time, formats); - formats.c = newFormat(locale_dateTime, formats); - utcFormats.x = newFormat(locale_date, utcFormats); - utcFormats.X = newFormat(locale_time, utcFormats); - utcFormats.c = newFormat(locale_dateTime, utcFormats); - function newFormat(specifier, formats2) { - return function(date2) { - var string2 = [], i2 = -1, j = 0, n = specifier.length, c2, pad2, format2; - if (!(date2 instanceof Date)) - date2 = /* @__PURE__ */ new Date(+date2); - while (++i2 < n) { - if (specifier.charCodeAt(i2) === 37) { - string2.push(specifier.slice(j, i2)); - if ((pad2 = pads[c2 = specifier.charAt(++i2)]) != null) - c2 = specifier.charAt(++i2); - else - pad2 = c2 === "e" ? " " : "0"; - if (format2 = formats2[c2]) - c2 = format2(date2, pad2); - string2.push(c2); - j = i2 + 1; + makeText = /* @__PURE__ */ __name(function makeText2(text2, mode, options3) { + if (symbols[mode][text2] && symbols[mode][text2].replace && text2.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(text2) && options3 && (options3.fontFamily && options3.fontFamily.slice(4, 6) === "tt" || options3.font && options3.font.slice(4, 6) === "tt"))) { + text2 = symbols[mode][text2].replace; + } + return new mathMLTree.TextNode(text2); + }, "makeText"); + makeRow = /* @__PURE__ */ __name(function makeRow2(body) { + if (body.length === 1) { + return body[0]; + } else { + return new mathMLTree.MathNode("mrow", body); + } + }, "makeRow"); + getVariant = /* @__PURE__ */ __name(function getVariant2(group2, options3) { + if (options3.fontFamily === "texttt") { + return "monospace"; + } else if (options3.fontFamily === "textsf") { + if (options3.fontShape === "textit" && options3.fontWeight === "textbf") { + return "sans-serif-bold-italic"; + } else if (options3.fontShape === "textit") { + return "sans-serif-italic"; + } else if (options3.fontWeight === "textbf") { + return "bold-sans-serif"; + } else { + return "sans-serif"; } + } else if (options3.fontShape === "textit" && options3.fontWeight === "textbf") { + return "bold-italic"; + } else if (options3.fontShape === "textit") { + return "italic"; + } else if (options3.fontWeight === "textbf") { + return "bold"; } - string2.push(specifier.slice(j, i2)); - return string2.join(""); - }; - } - function newParse(specifier, Z) { - return function(string2) { - var d = newDate(1900, void 0, 1), i2 = parseSpecifier(d, specifier, string2 += "", 0), week, day; - if (i2 != string2.length) + var font = options3.font; + if (!font || font === "mathnormal") { return null; - if ("Q" in d) - return new Date(d.Q); - if ("s" in d) - return new Date(d.s * 1e3 + ("L" in d ? d.L : 0)); - if (Z && !("Z" in d)) - d.Z = 0; - if ("p" in d) - d.H = d.H % 12 + d.p * 12; - if (d.m === void 0) - d.m = "q" in d ? d.q : 0; - if ("V" in d) { - if (d.V < 1 || d.V > 53) - return null; - if (!("w" in d)) - d.w = 1; - if ("Z" in d) { - week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); - week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week); - week = utcDay.offset(week, (d.V - 1) * 7); - d.y = week.getUTCFullYear(); - d.m = week.getUTCMonth(); - d.d = week.getUTCDate() + (d.w + 6) % 7; + } + var mode = group2.mode; + if (font === "mathit") { + return "italic"; + } else if (font === "boldsymbol") { + return group2.type === "textord" ? "bold" : "bold-italic"; + } else if (font === "mathbf") { + return "bold"; + } else if (font === "mathbb") { + return "double-struck"; + } else if (font === "mathfrak") { + return "fraktur"; + } else if (font === "mathscr" || font === "mathcal") { + return "script"; + } else if (font === "mathsf") { + return "sans-serif"; + } else if (font === "mathtt") { + return "monospace"; + } + var text2 = group2.text; + if (utils.contains(["\\imath", "\\jmath"], text2)) { + return null; + } + if (symbols[mode][text2] && symbols[mode][text2].replace) { + text2 = symbols[mode][text2].replace; + } + var fontName = buildCommon.fontMap[font].fontName; + if (getCharacterMetrics(text2, fontName, mode)) { + return buildCommon.fontMap[font].variant; + } + return null; + }, "getVariant"); + buildExpression2 = /* @__PURE__ */ __name(function buildExpression3(expression, options3, isOrdgroup) { + if (expression.length === 1) { + var group2 = buildGroup2(expression[0], options3); + if (isOrdgroup && group2 instanceof MathNode && group2.type === "mo") { + group2.setAttribute("lspace", "0em"); + group2.setAttribute("rspace", "0em"); + } + return [group2]; + } + var groups = []; + var lastGroup; + for (var i2 = 0; i2 < expression.length; i2++) { + var _group = buildGroup2(expression[i2], options3); + if (_group instanceof MathNode && lastGroup instanceof MathNode) { + if (_group.type === "mtext" && lastGroup.type === "mtext" && _group.getAttribute("mathvariant") === lastGroup.getAttribute("mathvariant")) { + lastGroup.children.push(..._group.children); + continue; + } else if (_group.type === "mn" && lastGroup.type === "mn") { + lastGroup.children.push(..._group.children); + continue; + } else if (_group.type === "mi" && _group.children.length === 1 && lastGroup.type === "mn") { + var child = _group.children[0]; + if (child instanceof TextNode && child.text === ".") { + lastGroup.children.push(..._group.children); + continue; + } + } else if (lastGroup.type === "mi" && lastGroup.children.length === 1) { + var lastChild = lastGroup.children[0]; + if (lastChild instanceof TextNode && lastChild.text === "\u0338" && (_group.type === "mo" || _group.type === "mi" || _group.type === "mn")) { + var _child = _group.children[0]; + if (_child instanceof TextNode && _child.text.length > 0) { + _child.text = _child.text.slice(0, 1) + "\u0338" + _child.text.slice(1); + groups.pop(); + } + } + } + } + groups.push(_group); + lastGroup = _group; + } + return groups; + }, "buildExpression"); + buildExpressionRow = /* @__PURE__ */ __name(function buildExpressionRow2(expression, options3, isOrdgroup) { + return makeRow(buildExpression2(expression, options3, isOrdgroup)); + }, "buildExpressionRow"); + buildGroup2 = /* @__PURE__ */ __name(function buildGroup3(group2, options3) { + if (!group2) { + return new mathMLTree.MathNode("mrow"); + } + if (_mathmlGroupBuilders[group2.type]) { + var result = _mathmlGroupBuilders[group2.type](group2, options3); + return result; + } else { + throw new ParseError("Got group of unknown type: '" + group2.type + "'"); + } + }, "buildGroup"); + __name(buildMathML, "buildMathML"); + optionsFromSettings = /* @__PURE__ */ __name(function optionsFromSettings2(settings) { + return new Options({ + style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT, + maxSize: settings.maxSize, + minRuleThickness: settings.minRuleThickness + }); + }, "optionsFromSettings"); + displayWrap = /* @__PURE__ */ __name(function displayWrap2(node2, settings) { + if (settings.displayMode) { + var classes6 = ["katex-display"]; + if (settings.leqno) { + classes6.push("leqno"); + } + if (settings.fleqn) { + classes6.push("fleqn"); + } + node2 = buildCommon.makeSpan(classes6, [node2]); + } + return node2; + }, "displayWrap"); + buildTree = /* @__PURE__ */ __name(function buildTree2(tree, expression, settings) { + var options3 = optionsFromSettings(settings); + var katexNode; + if (settings.output === "mathml") { + return buildMathML(tree, expression, options3, settings.displayMode, true); + } else if (settings.output === "html") { + var htmlNode = buildHTML(tree, options3); + katexNode = buildCommon.makeSpan(["katex"], [htmlNode]); + } else { + var mathMLNode = buildMathML(tree, expression, options3, settings.displayMode, false); + var _htmlNode = buildHTML(tree, options3); + katexNode = buildCommon.makeSpan(["katex"], [mathMLNode, _htmlNode]); + } + return displayWrap(katexNode, settings); + }, "buildTree"); + buildHTMLTree = /* @__PURE__ */ __name(function buildHTMLTree2(tree, expression, settings) { + var options3 = optionsFromSettings(settings); + var htmlNode = buildHTML(tree, options3); + var katexNode = buildCommon.makeSpan(["katex"], [htmlNode]); + return displayWrap(katexNode, settings); + }, "buildHTMLTree"); + stretchyCodePoint = { + widehat: "^", + widecheck: "\u02C7", + widetilde: "~", + utilde: "~", + overleftarrow: "\u2190", + underleftarrow: "\u2190", + xleftarrow: "\u2190", + overrightarrow: "\u2192", + underrightarrow: "\u2192", + xrightarrow: "\u2192", + underbrace: "\u23DF", + overbrace: "\u23DE", + overgroup: "\u23E0", + undergroup: "\u23E1", + overleftrightarrow: "\u2194", + underleftrightarrow: "\u2194", + xleftrightarrow: "\u2194", + Overrightarrow: "\u21D2", + xRightarrow: "\u21D2", + overleftharpoon: "\u21BC", + xleftharpoonup: "\u21BC", + overrightharpoon: "\u21C0", + xrightharpoonup: "\u21C0", + xLeftarrow: "\u21D0", + xLeftrightarrow: "\u21D4", + xhookleftarrow: "\u21A9", + xhookrightarrow: "\u21AA", + xmapsto: "\u21A6", + xrightharpoondown: "\u21C1", + xleftharpoondown: "\u21BD", + xrightleftharpoons: "\u21CC", + xleftrightharpoons: "\u21CB", + xtwoheadleftarrow: "\u219E", + xtwoheadrightarrow: "\u21A0", + xlongequal: "=", + xtofrom: "\u21C4", + xrightleftarrows: "\u21C4", + xrightequilibrium: "\u21CC", + // Not a perfect match. + xleftequilibrium: "\u21CB", + // None better available. + "\\cdrightarrow": "\u2192", + "\\cdleftarrow": "\u2190", + "\\cdlongequal": "=" + }; + mathMLnode = /* @__PURE__ */ __name(function mathMLnode2(label) { + var node2 = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[label.replace(/^\\/, "")])]); + node2.setAttribute("stretchy", "true"); + return node2; + }, "mathMLnode"); + katexImagesData = { + // path(s), minWidth, height, align + overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], + overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], + underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], + underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], + xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"], + "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"], + // CD minwwidth2.5pc + xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"], + "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"], + Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"], + xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"], + xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"], + overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"], + xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"], + xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"], + overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"], + xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"], + xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"], + xlongequal: [["longequal"], 0.888, 334, "xMinYMin"], + "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"], + xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"], + xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"], + overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522], + overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548], + underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548], + underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522], + xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522], + xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560], + xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716], + xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716], + xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522], + xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522], + overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522], + underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522], + overgroup: [["leftgroup", "rightgroup"], 0.888, 342], + undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342], + xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522], + xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528], + // The next three arrows are from the mhchem package. + // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the + // document as \xrightarrow or \xrightleftharpoons. Those have + // min-length = 1.75em, so we set min-length on these next three to match. + xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901], + xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716], + xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716] + }; + groupLength = /* @__PURE__ */ __name(function groupLength2(arg) { + if (arg.type === "ordgroup") { + return arg.body.length; + } else { + return 1; + } + }, "groupLength"); + svgSpan = /* @__PURE__ */ __name(function svgSpan2(group2, options3) { + function buildSvgSpan_() { + var viewBoxWidth = 4e5; + var label = group2.label.slice(1); + if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], label)) { + var grp = group2; + var numChars = groupLength(grp.base); + var viewBoxHeight; + var pathName; + var _height; + if (numChars > 5) { + if (label === "widehat" || label === "widecheck") { + viewBoxHeight = 420; + viewBoxWidth = 2364; + _height = 0.42; + pathName = label + "4"; + } else { + viewBoxHeight = 312; + viewBoxWidth = 2340; + _height = 0.34; + pathName = "tilde4"; + } + } else { + var imgIndex = [1, 1, 2, 2, 3, 3][numChars]; + if (label === "widehat" || label === "widecheck") { + viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex]; + viewBoxHeight = [0, 239, 300, 360, 420][imgIndex]; + _height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex]; + pathName = label + imgIndex; + } else { + viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex]; + viewBoxHeight = [0, 260, 286, 306, 312][imgIndex]; + _height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex]; + pathName = "tilde" + imgIndex; + } + } + var path4 = new PathNode(pathName); + var svgNode2 = new SvgNode([path4], { + "width": "100%", + "height": makeEm(_height), + "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight, + "preserveAspectRatio": "none" + }); + return { + span: buildCommon.makeSvgSpan([], [svgNode2], options3), + minWidth: 0, + height: _height + }; } else { - week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); - week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week); - week = timeDay.offset(week, (d.V - 1) * 7); - d.y = week.getFullYear(); - d.m = week.getMonth(); - d.d = week.getDate() + (d.w + 6) % 7; - } - } else if ("W" in d || "U" in d) { - if (!("w" in d)) - d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; - day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); - d.m = 0; - d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; - } - if ("Z" in d) { - d.H += d.Z / 100 | 0; - d.M += d.Z % 100; - return utcDate(d); - } - return localDate(d); - }; - } - function parseSpecifier(d, specifier, string2, j) { - var i2 = 0, n = specifier.length, m = string2.length, c2, parse2; - while (i2 < n) { - if (j >= m) - return -1; - c2 = specifier.charCodeAt(i2++); - if (c2 === 37) { - c2 = specifier.charAt(i2++); - parse2 = parses[c2 in pads ? specifier.charAt(i2++) : c2]; - if (!parse2 || (j = parse2(d, string2, j)) < 0) - return -1; - } else if (c2 != string2.charCodeAt(j++)) { - return -1; + var spans = []; + var data5 = katexImagesData[label]; + var [paths, _minWidth, _viewBoxHeight] = data5; + var _height2 = _viewBoxHeight / 1e3; + var numSvgChildren = paths.length; + var widthClasses; + var aligns; + if (numSvgChildren === 1) { + var align1 = data5[3]; + widthClasses = ["hide-tail"]; + aligns = [align1]; + } else if (numSvgChildren === 2) { + widthClasses = ["halfarrow-left", "halfarrow-right"]; + aligns = ["xMinYMin", "xMaxYMin"]; + } else if (numSvgChildren === 3) { + widthClasses = ["brace-left", "brace-center", "brace-right"]; + aligns = ["xMinYMin", "xMidYMin", "xMaxYMin"]; + } else { + throw new Error("Correct katexImagesData or update code here to support\n " + numSvgChildren + " children."); + } + for (var i2 = 0; i2 < numSvgChildren; i2++) { + var _path = new PathNode(paths[i2]); + var _svgNode = new SvgNode([_path], { + "width": "400em", + "height": makeEm(_height2), + "viewBox": "0 0 " + viewBoxWidth + " " + _viewBoxHeight, + "preserveAspectRatio": aligns[i2] + " slice" + }); + var _span = buildCommon.makeSvgSpan([widthClasses[i2]], [_svgNode], options3); + if (numSvgChildren === 1) { + return { + span: _span, + minWidth: _minWidth, + height: _height2 + }; + } else { + _span.style.height = makeEm(_height2); + spans.push(_span); + } + } + return { + span: buildCommon.makeSpan(["stretchy"], spans, options3), + minWidth: _minWidth, + height: _height2 + }; + } } - } - return j; - } - function parsePeriod(d, string2, i2) { - var n = periodRe.exec(string2.slice(i2)); - return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; - } - function parseShortWeekday(d, string2, i2) { - var n = shortWeekdayRe.exec(string2.slice(i2)); - return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; - } - function parseWeekday(d, string2, i2) { - var n = weekdayRe.exec(string2.slice(i2)); - return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; - } - function parseShortMonth(d, string2, i2) { - var n = shortMonthRe.exec(string2.slice(i2)); - return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; - } - function parseMonth(d, string2, i2) { - var n = monthRe.exec(string2.slice(i2)); - return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i2 + n[0].length) : -1; - } - function parseLocaleDateTime(d, string2, i2) { - return parseSpecifier(d, locale_dateTime, string2, i2); - } - function parseLocaleDate(d, string2, i2) { - return parseSpecifier(d, locale_date, string2, i2); - } - function parseLocaleTime(d, string2, i2) { - return parseSpecifier(d, locale_time, string2, i2); - } - function formatShortWeekday(d) { - return locale_shortWeekdays[d.getDay()]; - } - function formatWeekday(d) { - return locale_weekdays[d.getDay()]; - } - function formatShortMonth(d) { - return locale_shortMonths[d.getMonth()]; - } - function formatMonth(d) { - return locale_months[d.getMonth()]; - } - function formatPeriod(d) { - return locale_periods[+(d.getHours() >= 12)]; - } - function formatQuarter(d) { - return 1 + ~~(d.getMonth() / 3); - } - function formatUTCShortWeekday(d) { - return locale_shortWeekdays[d.getUTCDay()]; - } - function formatUTCWeekday(d) { - return locale_weekdays[d.getUTCDay()]; - } - function formatUTCShortMonth(d) { - return locale_shortMonths[d.getUTCMonth()]; - } - function formatUTCMonth(d) { - return locale_months[d.getUTCMonth()]; - } - function formatUTCPeriod(d) { - return locale_periods[+(d.getUTCHours() >= 12)]; - } - function formatUTCQuarter(d) { - return 1 + ~~(d.getUTCMonth() / 3); - } - return { - format: function(specifier) { - var f2 = newFormat(specifier += "", formats); - f2.toString = function() { - return specifier; - }; - return f2; - }, - parse: function(specifier) { - var p = newParse(specifier += "", false); - p.toString = function() { - return specifier; - }; - return p; - }, - utcFormat: function(specifier) { - var f2 = newFormat(specifier += "", utcFormats); - f2.toString = function() { - return specifier; - }; - return f2; - }, - utcParse: function(specifier) { - var p = newParse(specifier += "", true); - p.toString = function() { - return specifier; - }; - return p; - } - }; - } - var pads = { "-": "", "_": " ", "0": "0" }, numberRe = /^\s*\d+/, percentRe = /^%/, requoteRe = /[\\^$*+?|[\]().{}]/g; - function pad$1(value2, fill, width2) { - var sign2 = value2 < 0 ? "-" : "", string2 = (sign2 ? -value2 : value2) + "", length2 = string2.length; - return sign2 + (length2 < width2 ? new Array(width2 - length2 + 1).join(fill) + string2 : string2); - } - function requote(s) { - return s.replace(requoteRe, "\\$&"); - } - function formatRe(names) { - return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); - } - function formatLookup(names) { - return new Map(names.map((name, i2) => [name.toLowerCase(), i2])); - } - function parseWeekdayNumberSunday(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 1)); - return n ? (d.w = +n[0], i2 + n[0].length) : -1; - } - function parseWeekdayNumberMonday(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 1)); - return n ? (d.u = +n[0], i2 + n[0].length) : -1; - } - function parseWeekNumberSunday(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.U = +n[0], i2 + n[0].length) : -1; - } - function parseWeekNumberISO(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.V = +n[0], i2 + n[0].length) : -1; - } - function parseWeekNumberMonday(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.W = +n[0], i2 + n[0].length) : -1; - } - function parseFullYear(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 4)); - return n ? (d.y = +n[0], i2 + n[0].length) : -1; - } - function parseYear(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i2 + n[0].length) : -1; - } - function parseZone(d, string2, i2) { - var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i2, i2 + 6)); - return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i2 + n[0].length) : -1; - } - function parseQuarter(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 1)); - return n ? (d.q = n[0] * 3 - 3, i2 + n[0].length) : -1; - } - function parseMonthNumber(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.m = n[0] - 1, i2 + n[0].length) : -1; - } - function parseDayOfMonth(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.d = +n[0], i2 + n[0].length) : -1; - } - function parseDayOfYear(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 3)); - return n ? (d.m = 0, d.d = +n[0], i2 + n[0].length) : -1; - } - function parseHour24(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.H = +n[0], i2 + n[0].length) : -1; - } - function parseMinutes(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.M = +n[0], i2 + n[0].length) : -1; - } - function parseSeconds(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 2)); - return n ? (d.S = +n[0], i2 + n[0].length) : -1; - } - function parseMilliseconds(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 3)); - return n ? (d.L = +n[0], i2 + n[0].length) : -1; - } - function parseMicroseconds(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2, i2 + 6)); - return n ? (d.L = Math.floor(n[0] / 1e3), i2 + n[0].length) : -1; - } - function parseLiteralPercent(d, string2, i2) { - var n = percentRe.exec(string2.slice(i2, i2 + 1)); - return n ? i2 + n[0].length : -1; - } - function parseUnixTimestamp(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2)); - return n ? (d.Q = +n[0], i2 + n[0].length) : -1; - } - function parseUnixTimestampSeconds(d, string2, i2) { - var n = numberRe.exec(string2.slice(i2)); - return n ? (d.s = +n[0], i2 + n[0].length) : -1; - } - function formatDayOfMonth(d, p) { - return pad$1(d.getDate(), p, 2); - } - function formatHour24(d, p) { - return pad$1(d.getHours(), p, 2); - } - function formatHour12(d, p) { - return pad$1(d.getHours() % 12 || 12, p, 2); - } - function formatDayOfYear(d, p) { - return pad$1(1 + timeDay.count(timeYear(d), d), p, 3); - } - function formatMilliseconds(d, p) { - return pad$1(d.getMilliseconds(), p, 3); - } - function formatMicroseconds(d, p) { - return formatMilliseconds(d, p) + "000"; - } - function formatMonthNumber(d, p) { - return pad$1(d.getMonth() + 1, p, 2); - } - function formatMinutes(d, p) { - return pad$1(d.getMinutes(), p, 2); - } - function formatSeconds(d, p) { - return pad$1(d.getSeconds(), p, 2); - } - function formatWeekdayNumberMonday(d) { - var day = d.getDay(); - return day === 0 ? 7 : day; - } - function formatWeekNumberSunday(d, p) { - return pad$1(timeSunday.count(timeYear(d) - 1, d), p, 2); - } - function dISO(d) { - var day = d.getDay(); - return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); - } - function formatWeekNumberISO(d, p) { - d = dISO(d); - return pad$1(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2); - } - function formatWeekdayNumberSunday(d) { - return d.getDay(); - } - function formatWeekNumberMonday(d, p) { - return pad$1(timeMonday.count(timeYear(d) - 1, d), p, 2); - } - function formatYear(d, p) { - return pad$1(d.getFullYear() % 100, p, 2); - } - function formatYearISO(d, p) { - d = dISO(d); - return pad$1(d.getFullYear() % 100, p, 2); - } - function formatFullYear(d, p) { - return pad$1(d.getFullYear() % 1e4, p, 4); - } - function formatFullYearISO(d, p) { - var day = d.getDay(); - d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); - return pad$1(d.getFullYear() % 1e4, p, 4); - } - function formatZone(d) { - var z = d.getTimezoneOffset(); - return (z > 0 ? "-" : (z *= -1, "+")) + pad$1(z / 60 | 0, "0", 2) + pad$1(z % 60, "0", 2); - } - function formatUTCDayOfMonth(d, p) { - return pad$1(d.getUTCDate(), p, 2); - } - function formatUTCHour24(d, p) { - return pad$1(d.getUTCHours(), p, 2); - } - function formatUTCHour12(d, p) { - return pad$1(d.getUTCHours() % 12 || 12, p, 2); - } - function formatUTCDayOfYear(d, p) { - return pad$1(1 + utcDay.count(utcYear(d), d), p, 3); - } - function formatUTCMilliseconds(d, p) { - return pad$1(d.getUTCMilliseconds(), p, 3); - } - function formatUTCMicroseconds(d, p) { - return formatUTCMilliseconds(d, p) + "000"; - } - function formatUTCMonthNumber(d, p) { - return pad$1(d.getUTCMonth() + 1, p, 2); - } - function formatUTCMinutes(d, p) { - return pad$1(d.getUTCMinutes(), p, 2); - } - function formatUTCSeconds(d, p) { - return pad$1(d.getUTCSeconds(), p, 2); - } - function formatUTCWeekdayNumberMonday(d) { - var dow = d.getUTCDay(); - return dow === 0 ? 7 : dow; - } - function formatUTCWeekNumberSunday(d, p) { - return pad$1(utcSunday.count(utcYear(d) - 1, d), p, 2); - } - function UTCdISO(d) { - var day = d.getUTCDay(); - return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); - } - function formatUTCWeekNumberISO(d, p) { - d = UTCdISO(d); - return pad$1(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2); - } - function formatUTCWeekdayNumberSunday(d) { - return d.getUTCDay(); - } - function formatUTCWeekNumberMonday(d, p) { - return pad$1(utcMonday.count(utcYear(d) - 1, d), p, 2); - } - function formatUTCYear(d, p) { - return pad$1(d.getUTCFullYear() % 100, p, 2); - } - function formatUTCYearISO(d, p) { - d = UTCdISO(d); - return pad$1(d.getUTCFullYear() % 100, p, 2); - } - function formatUTCFullYear(d, p) { - return pad$1(d.getUTCFullYear() % 1e4, p, 4); - } - function formatUTCFullYearISO(d, p) { - var day = d.getUTCDay(); - d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); - return pad$1(d.getUTCFullYear() % 1e4, p, 4); - } - function formatUTCZone() { - return "+0000"; - } - function formatLiteralPercent() { - return "%"; - } - function formatUnixTimestamp(d) { - return +d; - } - function formatUnixTimestampSeconds(d) { - return Math.floor(+d / 1e3); - } - var locale; - var timeFormat; - defaultLocale({ - dateTime: "%x, %X", - date: "%-m/%-d/%Y", - time: "%-I:%M:%S %p", - periods: ["AM", "PM"], - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] - }); - function defaultLocale(definition2) { - locale = formatLocale(definition2); - timeFormat = locale.format; - locale.parse; - locale.utcFormat; - locale.utcParse; - return locale; - } - function date(t) { - return new Date(t); - } - function number(t) { - return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t); - } - function calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format2) { - var scale = continuous(), invert2 = scale.invert, domain = scale.domain; - var formatMillisecond = format2(".%L"), formatSecond = format2(":%S"), formatMinute = format2("%I:%M"), formatHour = format2("%I %p"), formatDay = format2("%a %d"), formatWeek = format2("%b %d"), formatMonth = format2("%B"), formatYear2 = format2("%Y"); - function tickFormat2(date2) { - return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2); - } - scale.invert = function(y2) { - return new Date(invert2(y2)); - }; - scale.domain = function(_2) { - return arguments.length ? domain(Array.from(_2, number)) : domain().map(date); - }; - scale.ticks = function(interval2) { - var d = domain(); - return ticks2(d[0], d[d.length - 1], interval2 == null ? 10 : interval2); - }; - scale.tickFormat = function(count, specifier) { - return specifier == null ? tickFormat2 : format2(specifier); - }; - scale.nice = function(interval2) { - var d = domain(); - if (!interval2 || typeof interval2.range !== "function") - interval2 = tickInterval2(d[0], d[d.length - 1], interval2 == null ? 10 : interval2); - return interval2 ? domain(nice(d, interval2)) : scale; - }; - scale.copy = function() { - return copy$1(scale, calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format2)); - }; - return scale; - } - function time$1() { - return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); - } - function colors(specifier) { - var n = specifier.length / 6 | 0, colors2 = new Array(n), i2 = 0; - while (i2 < n) - colors2[i2] = "#" + specifier.slice(i2 * 6, ++i2 * 6); - return colors2; - } - const d3schemeTableau10 = colors("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"); - function constant$3(x2) { - return function constant2() { - return x2; - }; - } - const abs$1 = Math.abs; - const atan2 = Math.atan2; - const cos = Math.cos; - const max$2 = Math.max; - const min$2 = Math.min; - const sin = Math.sin; - const sqrt = Math.sqrt; - const epsilon$1 = 1e-12; - const pi$1 = Math.PI; - const halfPi = pi$1 / 2; - const tau$1 = 2 * pi$1; - function acos(x2) { - return x2 > 1 ? 0 : x2 < -1 ? pi$1 : Math.acos(x2); - } - function asin(x2) { - return x2 >= 1 ? halfPi : x2 <= -1 ? -halfPi : Math.asin(x2); - } - function withPath(shape) { - let digits = 3; - shape.digits = function(_2) { - if (!arguments.length) - return digits; - if (_2 == null) { - digits = null; - } else { - const d = Math.floor(_2); - if (!(d >= 0)) - throw new RangeError(`invalid digits: ${_2}`); - digits = d; - } - return shape; - }; - return () => new Path$1(digits); - } - function arcInnerRadius(d) { - return d.innerRadius; - } - function arcOuterRadius(d) { - return d.outerRadius; - } - function arcStartAngle(d) { - return d.startAngle; - } - function arcEndAngle(d) { - return d.endAngle; - } - function arcPadAngle(d) { - return d && d.padAngle; - } - function intersect$1(x0, y0, x1, y1, x2, y2, x3, y3) { - var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10; - if (t * t < epsilon$1) - return; - t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; - return [x0 + t * x10, y0 + t * y10]; - } - function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { - var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D2 = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max$2(0, r * r * d2 - D2 * D2)), cx0 = (D2 * dy - dx * d) / d2, cy0 = (-D2 * dx - dy * d) / d2, cx1 = (D2 * dy + dx * d) / d2, cy1 = (-D2 * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00; - if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) - cx0 = cx1, cy0 = cy1; - return { - cx: cx0, - cy: cy0, - x01: -ox, - y01: -oy, - x11: cx0 * (r1 / r - 1), - y11: cy0 * (r1 / r - 1) - }; - } - function d3arc() { - var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant$3(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path2 = withPath(arc); - function arc() { - var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs$1(a1 - a0), cw = a1 > a0; - if (!context) - context = buffer = path2(); - if (r1 < r0) - r = r1, r1 = r0, r0 = r; - if (!(r1 > epsilon$1)) - context.moveTo(0, 0); - else if (da > tau$1 - epsilon$1) { - context.moveTo(r1 * cos(a0), r1 * sin(a0)); - context.arc(0, 0, r1, a0, a1, !cw); - if (r0 > epsilon$1) { - context.moveTo(r0 * cos(a1), r0 * sin(a1)); - context.arc(0, 0, r0, a1, a0, cw); + __name(buildSvgSpan_, "buildSvgSpan_"); + var { + span, + minWidth, + height: height2 + } = buildSvgSpan_(); + span.height = height2; + span.style.height = makeEm(height2); + if (minWidth > 0) { + span.style.minWidth = makeEm(minWidth); } - } else { - var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon$1 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min$2(abs$1(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t02, t12; - if (rp > epsilon$1) { - var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap)); - if ((da0 -= p0 * 2) > epsilon$1) - p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0; - else - da0 = 0, a00 = a10 = (a0 + a1) / 2; - if ((da1 -= p1 * 2) > epsilon$1) - p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1; - else - da1 = 0, a01 = a11 = (a0 + a1) / 2; + return span; + }, "svgSpan"); + encloseSpan = /* @__PURE__ */ __name(function encloseSpan2(inner2, label, topPad, bottomPad, options3) { + var img; + var totalHeight = inner2.height + inner2.depth + topPad + bottomPad; + if (/fbox|color|angl/.test(label)) { + img = buildCommon.makeSpan(["stretchy", label], [], options3); + if (label === "fbox") { + var color2 = options3.color && options3.getColor(); + if (color2) { + img.style.borderColor = color2; + } + } + } else { + var lines = []; + if (/^[bx]cancel$/.test(label)) { + lines.push(new LineNode({ + "x1": "0", + "y1": "0", + "x2": "100%", + "y2": "100%", + "stroke-width": "0.046em" + })); + } + if (/^x?cancel$/.test(label)) { + lines.push(new LineNode({ + "x1": "0", + "y1": "100%", + "x2": "100%", + "y2": "0", + "stroke-width": "0.046em" + })); + } + var svgNode2 = new SvgNode(lines, { + "width": "100%", + "height": makeEm(totalHeight) + }); + img = buildCommon.makeSvgSpan([], [svgNode2], options3); + } + img.height = totalHeight; + img.style.height = makeEm(totalHeight); + return img; + }, "encloseSpan"); + stretchy = { + encloseSpan, + mathMLnode, + svgSpan + }; + __name(assertNodeType, "assertNodeType"); + __name(assertSymbolNodeType, "assertSymbolNodeType"); + __name(checkSymbolNodeType, "checkSymbolNodeType"); + htmlBuilder$a = /* @__PURE__ */ __name((grp, options3) => { + var base; + var group2; + var supSubGroup; + if (grp && grp.type === "supsub") { + group2 = assertNodeType(grp.base, "accent"); + base = group2.base; + grp.base = base; + supSubGroup = assertSpan(buildGroup$1(grp, options3)); + grp.base = group2; + } else { + group2 = assertNodeType(grp, "accent"); + base = group2.base; + } + var body = buildGroup$1(base, options3.havingCrampedStyle()); + var mustShift = group2.isShifty && utils.isCharacterBox(base); + var skew = 0; + if (mustShift) { + var baseChar = utils.getBaseElem(base); + var baseGroup = buildGroup$1(baseChar, options3.havingCrampedStyle()); + skew = assertSymbolDomNode(baseGroup).skew; + } + var accentBelow = group2.label === "\\c"; + var clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options3.fontMetrics().xHeight); + var accentBody; + if (!group2.isStretchy) { + var accent2; + var width3; + if (group2.label === "\\vec") { + accent2 = buildCommon.staticSvg("vec", options3); + width3 = buildCommon.svgData.vec[1]; + } else { + accent2 = buildCommon.makeOrd({ + mode: group2.mode, + text: group2.label + }, options3, "textord"); + accent2 = assertSymbolDomNode(accent2); + accent2.italic = 0; + width3 = accent2.width; + if (accentBelow) { + clearance += accent2.depth; + } + } + accentBody = buildCommon.makeSpan(["accent-body"], [accent2]); + var accentFull = group2.label === "\\textcircled"; + if (accentFull) { + accentBody.classes.push("accent-full"); + clearance = body.height; + } + var left3 = skew; + if (!accentFull) { + left3 -= width3 / 2; + } + accentBody.style.left = makeEm(left3); + if (group2.label === "\\textcircled") { + accentBody.style.top = ".2em"; + } + accentBody = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: body + }, { + type: "kern", + size: -clearance + }, { + type: "elem", + elem: accentBody + }] + }, options3); + } else { + accentBody = stretchy.svgSpan(group2, options3); + accentBody = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: body + }, { + type: "elem", + elem: accentBody, + wrapperClasses: ["svg-align"], + wrapperStyle: skew > 0 ? { + width: "calc(100% - " + makeEm(2 * skew) + ")", + marginLeft: makeEm(2 * skew) + } : void 0 + }] + }, options3); + } + var accentWrap = buildCommon.makeSpan(["mord", "accent"], [accentBody], options3); + if (supSubGroup) { + supSubGroup.children[0] = accentWrap; + supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height); + supSubGroup.classes[0] = "mord"; + return supSubGroup; + } else { + return accentWrap; } - var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10); - if (rc > epsilon$1) { - var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc; - if (da < pi$1) { - if (oc = intersect$1(x01, y01, x00, y00, x11, y11, x10, y10)) { - var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]); - rc0 = min$2(rc, (r0 - lc) / (kc - 1)); - rc1 = min$2(rc, (r1 - lc) / (kc + 1)); + }, "htmlBuilder$a"); + mathmlBuilder$9 = /* @__PURE__ */ __name((group2, options3) => { + var accentNode = group2.isStretchy ? stretchy.mathMLnode(group2.label) : new mathMLTree.MathNode("mo", [makeText(group2.label, group2.mode)]); + var node2 = new mathMLTree.MathNode("mover", [buildGroup2(group2.base, options3), accentNode]); + node2.setAttribute("accent", "true"); + return node2; + }, "mathmlBuilder$9"); + NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((accent2) => "\\" + accent2).join("|")); + defineFunction({ + type: "accent", + names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"], + props: { + numArgs: 1 + }, + handler: /* @__PURE__ */ __name((context, args) => { + var base = normalizeArgument(args[0]); + var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName); + var isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck"; + return { + type: "accent", + mode: context.parser.mode, + label: context.funcName, + isStretchy, + isShifty, + base + }; + }, "handler"), + htmlBuilder: htmlBuilder$a, + mathmlBuilder: mathmlBuilder$9 + }); + defineFunction({ + type: "accent", + names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"], + props: { + numArgs: 1, + allowedInText: true, + allowedInMath: true, + // unless in strict mode + argTypes: ["primitive"] + }, + handler: /* @__PURE__ */ __name((context, args) => { + var base = args[0]; + var mode = context.parser.mode; + if (mode === "math") { + context.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + context.funcName + " works only in text mode"); + mode = "text"; + } + return { + type: "accent", + mode, + label: context.funcName, + isStretchy: false, + isShifty: true, + base + }; + }, "handler"), + htmlBuilder: htmlBuilder$a, + mathmlBuilder: mathmlBuilder$9 + }); + defineFunction({ + type: "accentUnder", + names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"], + props: { + numArgs: 1 + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21, + funcName + } = _ref; + var base = args[0]; + return { + type: "accentUnder", + mode: parser21.mode, + label: funcName, + base + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var innerGroup = buildGroup$1(group2.base, options3); + var accentBody = stretchy.svgSpan(group2, options3); + var kern = group2.label === "\\utilde" ? 0.12 : 0; + var vlist = buildCommon.makeVList({ + positionType: "top", + positionData: innerGroup.height, + children: [{ + type: "elem", + elem: accentBody, + wrapperClasses: ["svg-align"] + }, { + type: "kern", + size: kern + }, { + type: "elem", + elem: innerGroup + }] + }, options3); + return buildCommon.makeSpan(["mord", "accentunder"], [vlist], options3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var accentNode = stretchy.mathMLnode(group2.label); + var node2 = new mathMLTree.MathNode("munder", [buildGroup2(group2.base, options3), accentNode]); + node2.setAttribute("accentunder", "true"); + return node2; + }, "mathmlBuilder") + }); + paddedNode = /* @__PURE__ */ __name((group2) => { + var node2 = new mathMLTree.MathNode("mpadded", group2 ? [group2] : []); + node2.setAttribute("width", "+0.6em"); + node2.setAttribute("lspace", "0.3em"); + return node2; + }, "paddedNode"); + defineFunction({ + type: "xArrow", + names: [ + "\\xleftarrow", + "\\xrightarrow", + "\\xLeftarrow", + "\\xRightarrow", + "\\xleftrightarrow", + "\\xLeftrightarrow", + "\\xhookleftarrow", + "\\xhookrightarrow", + "\\xmapsto", + "\\xrightharpoondown", + "\\xrightharpoonup", + "\\xleftharpoondown", + "\\xleftharpoonup", + "\\xrightleftharpoons", + "\\xleftrightharpoons", + "\\xlongequal", + "\\xtwoheadrightarrow", + "\\xtwoheadleftarrow", + "\\xtofrom", + // The next 3 functions are here to support the mhchem extension. + // Direct use of these functions is discouraged and may break someday. + "\\xrightleftarrows", + "\\xrightequilibrium", + "\\xleftequilibrium", + // The next 3 functions are here only to support the {CD} environment. + "\\\\cdrightarrow", + "\\\\cdleftarrow", + "\\\\cdlongequal" + ], + props: { + numArgs: 1, + numOptionalArgs: 1 + }, + handler(_ref, args, optArgs) { + var { + parser: parser21, + funcName + } = _ref; + return { + type: "xArrow", + mode: parser21.mode, + label: funcName, + body: args[0], + below: optArgs[0] + }; + }, + // Flow is unable to correctly infer the type of `group`, even though it's + // unambiguously determined from the passed-in `type` above. + htmlBuilder(group2, options3) { + var style3 = options3.style; + var newOptions = options3.havingStyle(style3.sup()); + var upperGroup = buildCommon.wrapFragment(buildGroup$1(group2.body, newOptions, options3), options3); + var arrowPrefix = group2.label.slice(0, 2) === "\\x" ? "x" : "cd"; + upperGroup.classes.push(arrowPrefix + "-arrow-pad"); + var lowerGroup; + if (group2.below) { + newOptions = options3.havingStyle(style3.sub()); + lowerGroup = buildCommon.wrapFragment(buildGroup$1(group2.below, newOptions, options3), options3); + lowerGroup.classes.push(arrowPrefix + "-arrow-pad"); + } + var arrowBody = stretchy.svgSpan(group2, options3); + var arrowShift = -options3.fontMetrics().axisHeight + 0.5 * arrowBody.height; + var upperShift = -options3.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; + if (upperGroup.depth > 0.25 || group2.label === "\\xleftequilibrium") { + upperShift -= upperGroup.depth; + } + var vlist; + if (lowerGroup) { + var lowerShift = -options3.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111; + vlist = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: upperGroup, + shift: upperShift + }, { + type: "elem", + elem: arrowBody, + shift: arrowShift + }, { + type: "elem", + elem: lowerGroup, + shift: lowerShift + }] + }, options3); + } else { + vlist = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: upperGroup, + shift: upperShift + }, { + type: "elem", + elem: arrowBody, + shift: arrowShift + }] + }, options3); + } + vlist.children[0].children[0].children[1].classes.push("svg-align"); + return buildCommon.makeSpan(["mrel", "x-arrow"], [vlist], options3); + }, + mathmlBuilder(group2, options3) { + var arrowNode = stretchy.mathMLnode(group2.label); + arrowNode.setAttribute("minsize", group2.label.charAt(0) === "x" ? "1.75em" : "3.0em"); + var node2; + if (group2.body) { + var upperNode = paddedNode(buildGroup2(group2.body, options3)); + if (group2.below) { + var lowerNode = paddedNode(buildGroup2(group2.below, options3)); + node2 = new mathMLTree.MathNode("munderover", [arrowNode, lowerNode, upperNode]); } else { - rc0 = rc1 = 0; + node2 = new mathMLTree.MathNode("mover", [arrowNode, upperNode]); } + } else if (group2.below) { + var _lowerNode = paddedNode(buildGroup2(group2.below, options3)); + node2 = new mathMLTree.MathNode("munder", [arrowNode, _lowerNode]); + } else { + node2 = paddedNode(); + node2 = new mathMLTree.MathNode("mover", [arrowNode, node2]); } + return node2; } - if (!(da1 > epsilon$1)) - context.moveTo(x01, y01); - else if (rc1 > epsilon$1) { - t02 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); - t12 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); - context.moveTo(t02.cx + t02.x01, t02.cy + t02.y01); - if (rc1 < rc) - context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw); - else { - context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw); - context.arc(0, 0, r1, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), !cw); - context.arc(t12.cx, t12.cy, rc1, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw); - } - } else - context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); - if (!(r0 > epsilon$1) || !(da0 > epsilon$1)) - context.lineTo(x10, y10); - else if (rc0 > epsilon$1) { - t02 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); - t12 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); - context.lineTo(t02.cx + t02.x01, t02.cy + t02.y01); - if (rc0 < rc) - context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw); - else { - context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw); - context.arc(0, 0, r0, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), cw); - context.arc(t12.cx, t12.cy, rc0, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw); - } - } else - context.arc(0, 0, r0, a10, a00, cw); - } - context.closePath(); - if (buffer) - return context = null, buffer + "" || null; - } - arc.centroid = function() { - var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi$1 / 2; - return [cos(a) * r, sin(a) * r]; - }; - arc.innerRadius = function(_2) { - return arguments.length ? (innerRadius = typeof _2 === "function" ? _2 : constant$3(+_2), arc) : innerRadius; - }; - arc.outerRadius = function(_2) { - return arguments.length ? (outerRadius = typeof _2 === "function" ? _2 : constant$3(+_2), arc) : outerRadius; - }; - arc.cornerRadius = function(_2) { - return arguments.length ? (cornerRadius = typeof _2 === "function" ? _2 : constant$3(+_2), arc) : cornerRadius; - }; - arc.padRadius = function(_2) { - return arguments.length ? (padRadius = _2 == null ? null : typeof _2 === "function" ? _2 : constant$3(+_2), arc) : padRadius; - }; - arc.startAngle = function(_2) { - return arguments.length ? (startAngle = typeof _2 === "function" ? _2 : constant$3(+_2), arc) : startAngle; - }; - arc.endAngle = function(_2) { - return arguments.length ? (endAngle = typeof _2 === "function" ? _2 : constant$3(+_2), arc) : endAngle; - }; - arc.padAngle = function(_2) { - return arguments.length ? (padAngle = typeof _2 === "function" ? _2 : constant$3(+_2), arc) : padAngle; - }; - arc.context = function(_2) { - return arguments.length ? (context = _2 == null ? null : _2, arc) : context; - }; - return arc; - } - function array(x2) { - return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2); - } - function Linear(context) { - this._context = context; - } - Linear.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 1) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - default: - this._context.lineTo(x2, y2); - break; - } - } - }; - function curveLinear(context) { - return new Linear(context); - } - function x$1(p) { - return p[0]; - } - function y$1(p) { - return p[1]; - } - function line$1(x2, y2) { - var defined = constant$3(true), context = null, curve = curveLinear, output = null, path2 = withPath(line2); - x2 = typeof x2 === "function" ? x2 : x2 === void 0 ? x$1 : constant$3(x2); - y2 = typeof y2 === "function" ? y2 : y2 === void 0 ? y$1 : constant$3(y2); - function line2(data) { - var i2, n = (data = array(data)).length, d, defined0 = false, buffer; - if (context == null) - output = curve(buffer = path2()); - for (i2 = 0; i2 <= n; ++i2) { - if (!(i2 < n && defined(d = data[i2], i2, data)) === defined0) { - if (defined0 = !defined0) - output.lineStart(); - else - output.lineEnd(); - } - if (defined0) - output.point(+x2(d, i2, data), +y2(d, i2, data)); - } - if (buffer) - return output = null, buffer + "" || null; - } - line2.x = function(_2) { - return arguments.length ? (x2 = typeof _2 === "function" ? _2 : constant$3(+_2), line2) : x2; - }; - line2.y = function(_2) { - return arguments.length ? (y2 = typeof _2 === "function" ? _2 : constant$3(+_2), line2) : y2; - }; - line2.defined = function(_2) { - return arguments.length ? (defined = typeof _2 === "function" ? _2 : constant$3(!!_2), line2) : defined; - }; - line2.curve = function(_2) { - return arguments.length ? (curve = _2, context != null && (output = curve(context)), line2) : curve; - }; - line2.context = function(_2) { - return arguments.length ? (_2 == null ? context = output = null : output = curve(context = _2), line2) : context; - }; - return line2; - } - function descending(a, b) { - return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; - } - function identity$1(d) { - return d; - } - function d3pie() { - var value2 = identity$1, sortValues = descending, sort2 = null, startAngle = constant$3(0), endAngle = constant$3(tau$1), padAngle = constant$3(0); - function pie2(data) { - var i2, n = (data = array(data)).length, j, k, sum2 = 0, index2 = new Array(n), arcs = new Array(n), a0 = +startAngle.apply(this, arguments), da = Math.min(tau$1, Math.max(-tau$1, endAngle.apply(this, arguments) - a0)), a1, p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), pa = p * (da < 0 ? -1 : 1), v; - for (i2 = 0; i2 < n; ++i2) { - if ((v = arcs[index2[i2] = i2] = +value2(data[i2], i2, data)) > 0) { - sum2 += v; + }); + makeSpan2 = buildCommon.makeSpan; + __name(htmlBuilder$9, "htmlBuilder$9"); + __name(mathmlBuilder$8, "mathmlBuilder$8"); + defineFunction({ + type: "mclass", + names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"], + props: { + numArgs: 1, + primitive: true + }, + handler(_ref, args) { + var { + parser: parser21, + funcName + } = _ref; + var body = args[0]; + return { + type: "mclass", + mode: parser21.mode, + mclass: "m" + funcName.slice(5), + // TODO(kevinb): don't prefix with 'm' + body: ordargument(body), + isCharacterBox: utils.isCharacterBox(body) + }; + }, + htmlBuilder: htmlBuilder$9, + mathmlBuilder: mathmlBuilder$8 + }); + binrelClass = /* @__PURE__ */ __name((arg) => { + var atom2 = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg; + if (atom2.type === "atom" && (atom2.family === "bin" || atom2.family === "rel")) { + return "m" + atom2.family; + } else { + return "mord"; } - } - if (sortValues != null) - index2.sort(function(i3, j2) { - return sortValues(arcs[i3], arcs[j2]); - }); - else if (sort2 != null) - index2.sort(function(i3, j2) { - return sort2(data[i3], data[j2]); - }); - for (i2 = 0, k = sum2 ? (da - n * pa) / sum2 : 0; i2 < n; ++i2, a0 = a1) { - j = index2[i2], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = { - data: data[j], - index: i2, - value: v, - startAngle: a0, - endAngle: a1, - padAngle: p + }, "binrelClass"); + defineFunction({ + type: "mclass", + names: ["\\@binrel"], + props: { + numArgs: 2 + }, + handler(_ref2, args) { + var { + parser: parser21 + } = _ref2; + return { + type: "mclass", + mode: parser21.mode, + mclass: binrelClass(args[0]), + body: ordargument(args[1]), + isCharacterBox: utils.isCharacterBox(args[1]) + }; + } + }); + defineFunction({ + type: "mclass", + names: ["\\stackrel", "\\overset", "\\underset"], + props: { + numArgs: 2 + }, + handler(_ref3, args) { + var { + parser: parser21, + funcName + } = _ref3; + var baseArg = args[1]; + var shiftedArg = args[0]; + var mclass; + if (funcName !== "\\stackrel") { + mclass = binrelClass(baseArg); + } else { + mclass = "mrel"; + } + var baseOp = { + type: "op", + mode: baseArg.mode, + limits: true, + alwaysHandleSupSub: true, + parentIsSupSub: false, + symbol: false, + suppressBaseShift: funcName !== "\\stackrel", + body: ordargument(baseArg) + }; + var supsub = { + type: "supsub", + mode: shiftedArg.mode, + base: baseOp, + sup: funcName === "\\underset" ? null : shiftedArg, + sub: funcName === "\\underset" ? shiftedArg : null + }; + return { + type: "mclass", + mode: parser21.mode, + mclass, + body: [supsub], + isCharacterBox: utils.isCharacterBox(supsub) + }; + }, + htmlBuilder: htmlBuilder$9, + mathmlBuilder: mathmlBuilder$8 + }); + defineFunction({ + type: "pmb", + names: ["\\pmb"], + props: { + numArgs: 1, + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + return { + type: "pmb", + mode: parser21.mode, + mclass: binrelClass(args[0]), + body: ordargument(args[0]) + }; + }, + htmlBuilder(group2, options3) { + var elements3 = buildExpression$1(group2.body, options3, true); + var node2 = buildCommon.makeSpan([group2.mclass], elements3, options3); + node2.style.textShadow = "0.02em 0.01em 0.04px"; + return node2; + }, + mathmlBuilder(group2, style3) { + var inner2 = buildExpression2(group2.body, style3); + var node2 = new mathMLTree.MathNode("mstyle", inner2); + node2.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"); + return node2; + } + }); + cdArrowFunctionName = { + ">": "\\\\cdrightarrow", + "<": "\\\\cdleftarrow", + "=": "\\\\cdlongequal", + "A": "\\uparrow", + "V": "\\downarrow", + "|": "\\Vert", + ".": "no arrow" + }; + newCell = /* @__PURE__ */ __name(() => { + return { + type: "styling", + body: [], + mode: "math", + style: "display" }; - } - return arcs; - } - pie2.value = function(_2) { - return arguments.length ? (value2 = typeof _2 === "function" ? _2 : constant$3(+_2), pie2) : value2; - }; - pie2.sortValues = function(_2) { - return arguments.length ? (sortValues = _2, sort2 = null, pie2) : sortValues; - }; - pie2.sort = function(_2) { - return arguments.length ? (sort2 = _2, sortValues = null, pie2) : sort2; - }; - pie2.startAngle = function(_2) { - return arguments.length ? (startAngle = typeof _2 === "function" ? _2 : constant$3(+_2), pie2) : startAngle; - }; - pie2.endAngle = function(_2) { - return arguments.length ? (endAngle = typeof _2 === "function" ? _2 : constant$3(+_2), pie2) : endAngle; - }; - pie2.padAngle = function(_2) { - return arguments.length ? (padAngle = typeof _2 === "function" ? _2 : constant$3(+_2), pie2) : padAngle; - }; - return pie2; - } - class Bump { - constructor(context, x2) { - this._context = context; - this._x = x2; - } - areaStart() { - this._line = 0; - } - areaEnd() { - this._line = NaN; - } - lineStart() { - this._point = 0; - } - lineEnd() { - if (this._line || this._line !== 0 && this._point === 1) - this._context.closePath(); - this._line = 1 - this._line; - } - point(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: { - this._point = 1; - if (this._line) - this._context.lineTo(x2, y2); - else - this._context.moveTo(x2, y2); - break; + }, "newCell"); + isStartOfArrow = /* @__PURE__ */ __name((node2) => { + return node2.type === "textord" && node2.text === "@"; + }, "isStartOfArrow"); + isLabelEnd = /* @__PURE__ */ __name((node2, endChar) => { + return (node2.type === "mathord" || node2.type === "atom") && node2.text === endChar; + }, "isLabelEnd"); + __name(cdArrow, "cdArrow"); + __name(parseCD, "parseCD"); + defineFunction({ + type: "cdlabel", + names: ["\\\\cdleft", "\\\\cdright"], + props: { + numArgs: 1 + }, + handler(_ref, args) { + var { + parser: parser21, + funcName + } = _ref; + return { + type: "cdlabel", + mode: parser21.mode, + side: funcName.slice(4), + label: args[0] + }; + }, + htmlBuilder(group2, options3) { + var newOptions = options3.havingStyle(options3.style.sup()); + var label = buildCommon.wrapFragment(buildGroup$1(group2.label, newOptions, options3), options3); + label.classes.push("cd-label-" + group2.side); + label.style.bottom = makeEm(0.8 - label.depth); + label.height = 0; + label.depth = 0; + return label; + }, + mathmlBuilder(group2, options3) { + var label = new mathMLTree.MathNode("mrow", [buildGroup2(group2.label, options3)]); + label = new mathMLTree.MathNode("mpadded", [label]); + label.setAttribute("width", "0"); + if (group2.side === "left") { + label.setAttribute("lspace", "-1width"); + } + label.setAttribute("voffset", "0.7em"); + label = new mathMLTree.MathNode("mstyle", [label]); + label.setAttribute("displaystyle", "false"); + label.setAttribute("scriptlevel", "1"); + return label; } - case 1: - this._point = 2; - default: { - if (this._x) - this._context.bezierCurveTo(this._x0 = (this._x0 + x2) / 2, this._y0, this._x0, y2, x2, y2); - else - this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y2) / 2, x2, this._y0, x2, y2); - break; + }); + defineFunction({ + type: "cdlabelparent", + names: ["\\\\cdparent"], + props: { + numArgs: 1 + }, + handler(_ref2, args) { + var { + parser: parser21 + } = _ref2; + return { + type: "cdlabelparent", + mode: parser21.mode, + fragment: args[0] + }; + }, + htmlBuilder(group2, options3) { + var parent4 = buildCommon.wrapFragment(buildGroup$1(group2.fragment, options3), options3); + parent4.classes.push("cd-vert-arrow"); + return parent4; + }, + mathmlBuilder(group2, options3) { + return new mathMLTree.MathNode("mrow", [buildGroup2(group2.fragment, options3)]); } - } - this._x0 = x2, this._y0 = y2; - } - } - function bumpX(context) { - return new Bump(context, true); - } - function bumpY(context) { - return new Bump(context, false); - } - function noop$1() { - } - function point$6(that, x2, y2) { - that._context.bezierCurveTo( - (2 * that._x0 + that._x1) / 3, - (2 * that._y0 + that._y1) / 3, - (that._x0 + 2 * that._x1) / 3, - (that._y0 + 2 * that._y1) / 3, - (that._x0 + 4 * that._x1 + x2) / 6, - (that._y0 + 4 * that._y1 + y2) / 6 - ); - } - function Basis(context) { - this._context = context; - } - Basis.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 3: - point$6(this, this._x1, this._y1); - case 2: - this._context.lineTo(this._x1, this._y1); - break; - } - if (this._line || this._line !== 0 && this._point === 1) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); - default: - point$6(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } - }; - function curveBasis(context) { - return new Basis(context); - } - function BasisClosed(context) { - this._context = context; - } - BasisClosed.prototype = { - areaStart: noop$1, - areaEnd: noop$1, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x2, this._y2); - this._context.closePath(); - break; + }); + defineFunction({ + type: "textord", + names: ["\\@char"], + props: { + numArgs: 1, + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + var arg = assertNodeType(args[0], "ordgroup"); + var group2 = arg.body; + var number7 = ""; + for (var i2 = 0; i2 < group2.length; i2++) { + var node2 = assertNodeType(group2[i2], "textord"); + number7 += node2.text; + } + var code = parseInt(number7); + var text2; + if (isNaN(code)) { + throw new ParseError("\\@char has non-numeric argument " + number7); + } else if (code < 0 || code >= 1114111) { + throw new ParseError("\\@char with invalid code point " + number7); + } else if (code <= 65535) { + text2 = String.fromCharCode(code); + } else { + code -= 65536; + text2 = String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); + } + return { + type: "textord", + mode: parser21.mode, + text: text2 + }; } - case 2: { - this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); - this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); - this._context.closePath(); - break; + }); + htmlBuilder$8 = /* @__PURE__ */ __name((group2, options3) => { + var elements3 = buildExpression$1(group2.body, options3.withColor(group2.color), false); + return buildCommon.makeFragment(elements3); + }, "htmlBuilder$8"); + mathmlBuilder$7 = /* @__PURE__ */ __name((group2, options3) => { + var inner2 = buildExpression2(group2.body, options3.withColor(group2.color)); + var node2 = new mathMLTree.MathNode("mstyle", inner2); + node2.setAttribute("mathcolor", group2.color); + return node2; + }, "mathmlBuilder$7"); + defineFunction({ + type: "color", + names: ["\\textcolor"], + props: { + numArgs: 2, + allowedInText: true, + argTypes: ["color", "original"] + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + var color2 = assertNodeType(args[0], "color-token").color; + var body = args[1]; + return { + type: "color", + mode: parser21.mode, + color: color2, + body: ordargument(body) + }; + }, + htmlBuilder: htmlBuilder$8, + mathmlBuilder: mathmlBuilder$7 + }); + defineFunction({ + type: "color", + names: ["\\color"], + props: { + numArgs: 1, + allowedInText: true, + argTypes: ["color"] + }, + handler(_ref2, args) { + var { + parser: parser21, + breakOnTokenText + } = _ref2; + var color2 = assertNodeType(args[0], "color-token").color; + parser21.gullet.macros.set("\\current@color", color2); + var body = parser21.parseExpression(true, breakOnTokenText); + return { + type: "color", + mode: parser21.mode, + color: color2, + body + }; + }, + htmlBuilder: htmlBuilder$8, + mathmlBuilder: mathmlBuilder$7 + }); + defineFunction({ + type: "cr", + names: ["\\\\"], + props: { + numArgs: 0, + numOptionalArgs: 0, + allowedInText: true + }, + handler(_ref, args, optArgs) { + var { + parser: parser21 + } = _ref; + var size5 = parser21.gullet.future().text === "[" ? parser21.parseSizeGroup(true) : null; + var newLine = !parser21.settings.displayMode || !parser21.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode"); + return { + type: "cr", + mode: parser21.mode, + newLine, + size: size5 && assertNodeType(size5, "size").value + }; + }, + // The following builders are called only at the top level, + // not within tabular/array environments. + htmlBuilder(group2, options3) { + var span = buildCommon.makeSpan(["mspace"], [], options3); + if (group2.newLine) { + span.classes.push("newline"); + if (group2.size) { + span.style.marginTop = makeEm(calculateSize(group2.size, options3)); + } + } + return span; + }, + mathmlBuilder(group2, options3) { + var node2 = new mathMLTree.MathNode("mspace"); + if (group2.newLine) { + node2.setAttribute("linebreak", "newline"); + if (group2.size) { + node2.setAttribute("height", makeEm(calculateSize(group2.size, options3))); + } + } + return node2; } - case 3: { - this.point(this._x2, this._y2); - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - break; + }); + globalMap = { + "\\global": "\\global", + "\\long": "\\\\globallong", + "\\\\globallong": "\\\\globallong", + "\\def": "\\gdef", + "\\gdef": "\\gdef", + "\\edef": "\\xdef", + "\\xdef": "\\xdef", + "\\let": "\\\\globallet", + "\\futurelet": "\\\\globalfuture" + }; + checkControlSequence = /* @__PURE__ */ __name((tok) => { + var name = tok.text; + if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) { + throw new ParseError("Expected a control sequence", tok); + } + return name; + }, "checkControlSequence"); + getRHS = /* @__PURE__ */ __name((parser21) => { + var tok = parser21.gullet.popToken(); + if (tok.text === "=") { + tok = parser21.gullet.popToken(); + if (tok.text === " ") { + tok = parser21.gullet.popToken(); + } + } + return tok; + }, "getRHS"); + letCommand = /* @__PURE__ */ __name((parser21, name, tok, global2) => { + var macro = parser21.gullet.macros.get(tok.text); + if (macro == null) { + tok.noexpand = true; + macro = { + tokens: [tok], + numArgs: 0, + // reproduce the same behavior in expansion + unexpandable: !parser21.gullet.isExpandable(tok.text) + }; } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._x2 = x2, this._y2 = y2; - break; - case 1: - this._point = 2; - this._x3 = x2, this._y3 = y2; - break; - case 2: - this._point = 3; - this._x4 = x2, this._y4 = y2; - this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6); - break; - default: - point$6(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } - }; - function curveBasisClosed(context) { - return new BasisClosed(context); - } - function BasisOpen(context) { - this._context = context; - } - BasisOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6; - this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); - break; - case 3: - this._point = 4; - default: - point$6(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } - }; - function curveBasisOpen(context) { - return new BasisOpen(context); - } - function Bundle(context, beta) { - this._basis = new Basis(context); - this._beta = beta; - } - Bundle.prototype = { - lineStart: function() { - this._x = []; - this._y = []; - this._basis.lineStart(); - }, - lineEnd: function() { - var x2 = this._x, y2 = this._y, j = x2.length - 1; - if (j > 0) { - var x0 = x2[0], y0 = y2[0], dx = x2[j] - x0, dy = y2[j] - y0, i2 = -1, t; - while (++i2 <= j) { - t = i2 / j; - this._basis.point( - this._beta * x2[i2] + (1 - this._beta) * (x0 + t * dx), - this._beta * y2[i2] + (1 - this._beta) * (y0 + t * dy) - ); + parser21.gullet.macros.set(name, macro, global2); + }, "letCommand"); + defineFunction({ + type: "internal", + names: [ + "\\global", + "\\long", + "\\\\globallong" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: true + }, + handler(_ref) { + var { + parser: parser21, + funcName + } = _ref; + parser21.consumeSpaces(); + var token2 = parser21.fetch(); + if (globalMap[token2.text]) { + if (funcName === "\\global" || funcName === "\\\\globallong") { + token2.text = globalMap[token2.text]; + } + return assertNodeType(parser21.parseFunction(), "internal"); + } + throw new ParseError("Invalid token after macro prefix", token2); } - } - this._x = this._y = null; - this._basis.lineEnd(); - }, - point: function(x2, y2) { - this._x.push(+x2); - this._y.push(+y2); - } - }; - const curveBundle = function custom(beta) { - function bundle(context) { - return beta === 1 ? new Basis(context) : new Bundle(context, beta); - } - bundle.beta = function(beta2) { - return custom(+beta2); - }; - return bundle; - }(0.85); - function point$5(that, x2, y2) { - that._context.bezierCurveTo( - that._x1 + that._k * (that._x2 - that._x0), - that._y1 + that._k * (that._y2 - that._y0), - that._x2 + that._k * (that._x1 - x2), - that._y2 + that._k * (that._y1 - y2), - that._x2, - that._y2 - ); - } - function Cardinal(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; - } - Cardinal.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - break; - case 3: - point$5(this, this._x1, this._y1); - break; - } - if (this._line || this._line !== 0 && this._point === 1) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - this._x1 = x2, this._y1 = y2; - break; - case 2: - this._point = 3; - default: - point$5(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } - }; - const curveCardinal = function custom(tension) { - function cardinal(context) { - return new Cardinal(context, tension); - } - cardinal.tension = function(tension2) { - return custom(+tension2); - }; - return cardinal; - }(0); - function CardinalClosed(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; - } - CardinalClosed.prototype = { - areaStart: noop$1, - areaEnd: noop$1, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x3, this._y3); - this._context.closePath(); - break; + }); + defineFunction({ + type: "internal", + names: ["\\def", "\\gdef", "\\edef", "\\xdef"], + props: { + numArgs: 0, + allowedInText: true, + primitive: true + }, + handler(_ref2) { + var { + parser: parser21, + funcName + } = _ref2; + var tok = parser21.gullet.popToken(); + var name = tok.text; + if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) { + throw new ParseError("Expected a control sequence", tok); + } + var numArgs = 0; + var insert; + var delimiters2 = [[]]; + while (parser21.gullet.future().text !== "{") { + tok = parser21.gullet.popToken(); + if (tok.text === "#") { + if (parser21.gullet.future().text === "{") { + insert = parser21.gullet.future(); + delimiters2[numArgs].push("{"); + break; + } + tok = parser21.gullet.popToken(); + if (!/^[1-9]$/.test(tok.text)) { + throw new ParseError('Invalid argument number "' + tok.text + '"'); + } + if (parseInt(tok.text) !== numArgs + 1) { + throw new ParseError('Argument number "' + tok.text + '" out of order'); + } + numArgs++; + delimiters2.push([]); + } else if (tok.text === "EOF") { + throw new ParseError("Expected a macro definition"); + } else { + delimiters2[numArgs].push(tok.text); + } + } + var { + tokens: tokens2 + } = parser21.gullet.consumeArg(); + if (insert) { + tokens2.unshift(insert); + } + if (funcName === "\\edef" || funcName === "\\xdef") { + tokens2 = parser21.gullet.expandTokens(tokens2); + tokens2.reverse(); + } + parser21.gullet.macros.set(name, { + tokens: tokens2, + numArgs, + delimiters: delimiters2 + }, funcName === globalMap[funcName]); + return { + type: "internal", + mode: parser21.mode + }; } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; + }); + defineFunction({ + type: "internal", + names: [ + "\\let", + "\\\\globallet" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: true, + primitive: true + }, + handler(_ref3) { + var { + parser: parser21, + funcName + } = _ref3; + var name = checkControlSequence(parser21.gullet.popToken()); + parser21.gullet.consumeSpaces(); + var tok = getRHS(parser21); + letCommand(parser21, name, tok, funcName === "\\\\globallet"); + return { + type: "internal", + mode: parser21.mode + }; } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; + }); + defineFunction({ + type: "internal", + names: [ + "\\futurelet", + "\\\\globalfuture" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: true, + primitive: true + }, + handler(_ref4) { + var { + parser: parser21, + funcName + } = _ref4; + var name = checkControlSequence(parser21.gullet.popToken()); + var middle = parser21.gullet.popToken(); + var tok = parser21.gullet.popToken(); + letCommand(parser21, name, tok, funcName === "\\\\globalfuture"); + parser21.gullet.pushToken(tok); + parser21.gullet.pushToken(middle); + return { + type: "internal", + mode: parser21.mode + }; } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x2, this._y3 = y2; - break; - case 1: - this._point = 2; - this._context.moveTo(this._x4 = x2, this._y4 = y2); - break; - case 2: - this._point = 3; - this._x5 = x2, this._y5 = y2; - break; - default: - point$5(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } - }; - const curveCardinalClosed = function custom(tension) { - function cardinal(context) { - return new CardinalClosed(context, tension); - } - cardinal.tension = function(tension2) { - return custom(+tension2); - }; - return cardinal; - }(0); - function CardinalOpen(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; - } - CardinalOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - case 3: - this._point = 4; - default: - point$5(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } - }; - const curveCardinalOpen = function custom(tension) { - function cardinal(context) { - return new CardinalOpen(context, tension); - } - cardinal.tension = function(tension2) { - return custom(+tension2); - }; - return cardinal; - }(0); - function point$4(that, x2, y2) { - var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2; - if (that._l01_a > epsilon$1) { - var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a); - x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; - y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; - } - if (that._l23_a > epsilon$1) { - var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a); - x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m; - y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m; - } - that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2); - } - function CatmullRom(context, alpha) { - this._context = context; - this._alpha = alpha; - } - CatmullRom.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - break; - case 3: - this.point(this._x2, this._y2); - break; - } - if (this._line || this._line !== 0 && this._point === 1) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - default: - point$4(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } - }; - const curveCatmullRom = function custom(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom(+alpha2); - }; - return catmullRom; - }(0.5); - function CatmullRomClosed(context, alpha) { - this._context = context; - this._alpha = alpha; - } - CatmullRomClosed.prototype = { - areaStart: noop$1, - areaEnd: noop$1, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; + }); + getMetrics = /* @__PURE__ */ __name(function getMetrics2(symbol, font, mode) { + var replace2 = symbols.math[symbol] && symbols.math[symbol].replace; + var metrics = getCharacterMetrics(replace2 || symbol, font, mode); + if (!metrics) { + throw new Error("Unsupported symbol " + symbol + " and font size " + font + "."); + } + return metrics; + }, "getMetrics"); + styleWrap = /* @__PURE__ */ __name(function styleWrap2(delim, toStyle, options3, classes6) { + var newOptions = options3.havingBaseStyle(toStyle); + var span = buildCommon.makeSpan(classes6.concat(newOptions.sizingClasses(options3)), [delim], options3); + var delimSizeMultiplier = newOptions.sizeMultiplier / options3.sizeMultiplier; + span.height *= delimSizeMultiplier; + span.depth *= delimSizeMultiplier; + span.maxFontSize = newOptions.sizeMultiplier; + return span; + }, "styleWrap"); + centerSpan = /* @__PURE__ */ __name(function centerSpan2(span, options3, style3) { + var newOptions = options3.havingBaseStyle(style3); + var shift2 = (1 - options3.sizeMultiplier / newOptions.sizeMultiplier) * options3.fontMetrics().axisHeight; + span.classes.push("delimcenter"); + span.style.top = makeEm(shift2); + span.height -= shift2; + span.depth += shift2; + }, "centerSpan"); + makeSmallDelim = /* @__PURE__ */ __name(function makeSmallDelim2(delim, style3, center4, options3, mode, classes6) { + var text2 = buildCommon.makeSymbol(delim, "Main-Regular", mode, options3); + var span = styleWrap(text2, style3, options3, classes6); + if (center4) { + centerSpan(span, options3, style3); } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; + return span; + }, "makeSmallDelim"); + mathrmSize = /* @__PURE__ */ __name(function mathrmSize2(value2, size5, mode, options3) { + return buildCommon.makeSymbol(value2, "Size" + size5 + "-Regular", mode, options3); + }, "mathrmSize"); + makeLargeDelim = /* @__PURE__ */ __name(function makeLargeDelim2(delim, size5, center4, options3, mode, classes6) { + var inner2 = mathrmSize(delim, size5, mode, options3); + var span = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size5], [inner2], options3), Style$1.TEXT, options3, classes6); + if (center4) { + centerSpan(span, options3, Style$1.TEXT); } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x2, this._y3 = y2; - break; - case 1: - this._point = 2; - this._context.moveTo(this._x4 = x2, this._y4 = y2); - break; - case 2: - this._point = 3; - this._x5 = x2, this._y5 = y2; - break; - default: - point$4(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } - }; - const curveCatmullRomClosed = function custom(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom(+alpha2); - }; - return catmullRom; - }(0.5); - function CatmullRomOpen(context, alpha) { - this._context = context; - this._alpha = alpha; - } - CatmullRomOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - case 3: - this._point = 4; - default: - point$4(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } - }; - const curveCatmullRomOpen = function custom(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom(+alpha2); - }; - return catmullRom; - }(0.5); - function LinearClosed(context) { - this._context = context; - } - LinearClosed.prototype = { - areaStart: noop$1, - areaEnd: noop$1, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._point) - this._context.closePath(); - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) - this._context.lineTo(x2, y2); - else - this._point = 1, this._context.moveTo(x2, y2); - } - }; - function curveLinearClosed(context) { - return new LinearClosed(context); - } - function sign(x2) { - return x2 < 0 ? -1 : 1; - } - function slope3(that, x2, y2) { - var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1); - return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; - } - function slope2(that, t) { - var h = that._x1 - that._x0; - return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; - } - function point$3(that, t02, t12) { - var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3; - that._context.bezierCurveTo(x0 + dx, y0 + dx * t02, x1 - dx, y1 - dx * t12, x1, y1); - } - function MonotoneX(context) { - this._context = context; - } - MonotoneX.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x1, this._y1); - break; - case 3: - point$3(this, this._t0, slope2(this, this._t0)); - break; - } - if (this._line || this._line !== 0 && this._point === 1) - this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - var t12 = NaN; - x2 = +x2, y2 = +y2; - if (x2 === this._x1 && y2 === this._y1) - return; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - point$3(this, slope2(this, t12 = slope3(this, x2, y2)), t12); - break; - default: - point$3(this, this._t0, t12 = slope3(this, x2, y2)); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - this._t0 = t12; - } - }; - function MonotoneY(context) { - this._context = new ReflectContext(context); - } - (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) { - MonotoneX.prototype.point.call(this, y2, x2); - }; - function ReflectContext(context) { - this._context = context; - } - ReflectContext.prototype = { - moveTo: function(x2, y2) { - this._context.moveTo(y2, x2); - }, - closePath: function() { - this._context.closePath(); - }, - lineTo: function(x2, y2) { - this._context.lineTo(y2, x2); - }, - bezierCurveTo: function(x1, y1, x2, y2, x3, y3) { - this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3); - } - }; - function monotoneX(context) { - return new MonotoneX(context); - } - function monotoneY(context) { - return new MonotoneY(context); - } - function Natural(context) { - this._context = context; - } - Natural.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x = []; - this._y = []; - }, - lineEnd: function() { - var x2 = this._x, y2 = this._y, n = x2.length; - if (n) { - this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]); - if (n === 2) { - this._context.lineTo(x2[1], y2[1]); + return span; + }, "makeLargeDelim"); + makeGlyphSpan = /* @__PURE__ */ __name(function makeGlyphSpan2(symbol, font, mode) { + var sizeClass; + if (font === "Size1-Regular") { + sizeClass = "delim-size1"; } else { - var px = controlPoints(x2), py = controlPoints(y2); - for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { - this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]); - } + sizeClass = "delim-size4"; } - } - if (this._line || this._line !== 0 && n === 1) - this._context.closePath(); - this._line = 1 - this._line; - this._x = this._y = null; - }, - point: function(x2, y2) { - this._x.push(+x2); - this._y.push(+y2); - } - }; - function controlPoints(x2) { - var i2, n = x2.length - 1, m, a = new Array(n), b = new Array(n), r = new Array(n); - a[0] = 0, b[0] = 2, r[0] = x2[0] + 2 * x2[1]; - for (i2 = 1; i2 < n - 1; ++i2) - a[i2] = 1, b[i2] = 4, r[i2] = 4 * x2[i2] + 2 * x2[i2 + 1]; - a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x2[n - 1] + x2[n]; - for (i2 = 1; i2 < n; ++i2) - m = a[i2] / b[i2 - 1], b[i2] -= m, r[i2] -= m * r[i2 - 1]; - a[n - 1] = r[n - 1] / b[n - 1]; - for (i2 = n - 2; i2 >= 0; --i2) - a[i2] = (r[i2] - a[i2 + 1]) / b[i2]; - b[n - 1] = (x2[n] + a[n - 1]) / 2; - for (i2 = 0; i2 < n - 1; ++i2) - b[i2] = 2 * x2[i2 + 1] - a[i2 + 1]; - return [a, b]; - } - function curveNatural(context) { - return new Natural(context); - } - function Step(context, t) { - this._context = context; - this._t = t; - } - Step.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x = this._y = NaN; - this._point = 0; - }, - lineEnd: function() { - if (0 < this._t && this._t < 1 && this._point === 2) - this._context.lineTo(this._x, this._y); - if (this._line || this._line !== 0 && this._point === 1) - this._context.closePath(); - if (this._line >= 0) - this._t = 1 - this._t, this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - default: { - if (this._t <= 0) { - this._context.lineTo(this._x, y2); - this._context.lineTo(x2, y2); + var corner = buildCommon.makeSpan(["delimsizinginner", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]); + return { + type: "elem", + elem: corner + }; + }, "makeGlyphSpan"); + makeInner = /* @__PURE__ */ __name(function makeInner2(ch, height2, options3) { + var width3 = fontMetricsData["Size4-Regular"][ch.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][ch.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][ch.charCodeAt(0)][4]; + var path4 = new PathNode("inner", innerPath(ch, Math.round(1e3 * height2))); + var svgNode2 = new SvgNode([path4], { + "width": makeEm(width3), + "height": makeEm(height2), + // Override CSS rule `.katex svg { width: 100% }` + "style": "width:" + makeEm(width3), + "viewBox": "0 0 " + 1e3 * width3 + " " + Math.round(1e3 * height2), + "preserveAspectRatio": "xMinYMin" + }); + var span = buildCommon.makeSvgSpan([], [svgNode2], options3); + span.height = height2; + span.style.height = makeEm(height2); + span.style.width = makeEm(width3); + return { + type: "elem", + elem: span + }; + }, "makeInner"); + lapInEms = 8e-3; + lap = { + type: "kern", + size: -1 * lapInEms + }; + verts = ["|", "\\lvert", "\\rvert", "\\vert"]; + doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"]; + makeStackedDelim = /* @__PURE__ */ __name(function makeStackedDelim2(delim, heightTotal, center4, options3, mode, classes6) { + var top2; + var middle; + var repeat2; + var bottom2; + var svgLabel = ""; + var viewBoxWidth = 0; + top2 = repeat2 = bottom2 = delim; + middle = null; + var font = "Size1-Regular"; + if (delim === "\\uparrow") { + repeat2 = bottom2 = "\u23D0"; + } else if (delim === "\\Uparrow") { + repeat2 = bottom2 = "\u2016"; + } else if (delim === "\\downarrow") { + top2 = repeat2 = "\u23D0"; + } else if (delim === "\\Downarrow") { + top2 = repeat2 = "\u2016"; + } else if (delim === "\\updownarrow") { + top2 = "\\uparrow"; + repeat2 = "\u23D0"; + bottom2 = "\\downarrow"; + } else if (delim === "\\Updownarrow") { + top2 = "\\Uparrow"; + repeat2 = "\u2016"; + bottom2 = "\\Downarrow"; + } else if (utils.contains(verts, delim)) { + repeat2 = "\u2223"; + svgLabel = "vert"; + viewBoxWidth = 333; + } else if (utils.contains(doubleVerts, delim)) { + repeat2 = "\u2225"; + svgLabel = "doublevert"; + viewBoxWidth = 556; + } else if (delim === "[" || delim === "\\lbrack") { + top2 = "\u23A1"; + repeat2 = "\u23A2"; + bottom2 = "\u23A3"; + font = "Size4-Regular"; + svgLabel = "lbrack"; + viewBoxWidth = 667; + } else if (delim === "]" || delim === "\\rbrack") { + top2 = "\u23A4"; + repeat2 = "\u23A5"; + bottom2 = "\u23A6"; + font = "Size4-Regular"; + svgLabel = "rbrack"; + viewBoxWidth = 667; + } else if (delim === "\\lfloor" || delim === "\u230A") { + repeat2 = top2 = "\u23A2"; + bottom2 = "\u23A3"; + font = "Size4-Regular"; + svgLabel = "lfloor"; + viewBoxWidth = 667; + } else if (delim === "\\lceil" || delim === "\u2308") { + top2 = "\u23A1"; + repeat2 = bottom2 = "\u23A2"; + font = "Size4-Regular"; + svgLabel = "lceil"; + viewBoxWidth = 667; + } else if (delim === "\\rfloor" || delim === "\u230B") { + repeat2 = top2 = "\u23A5"; + bottom2 = "\u23A6"; + font = "Size4-Regular"; + svgLabel = "rfloor"; + viewBoxWidth = 667; + } else if (delim === "\\rceil" || delim === "\u2309") { + top2 = "\u23A4"; + repeat2 = bottom2 = "\u23A5"; + font = "Size4-Regular"; + svgLabel = "rceil"; + viewBoxWidth = 667; + } else if (delim === "(" || delim === "\\lparen") { + top2 = "\u239B"; + repeat2 = "\u239C"; + bottom2 = "\u239D"; + font = "Size4-Regular"; + svgLabel = "lparen"; + viewBoxWidth = 875; + } else if (delim === ")" || delim === "\\rparen") { + top2 = "\u239E"; + repeat2 = "\u239F"; + bottom2 = "\u23A0"; + font = "Size4-Regular"; + svgLabel = "rparen"; + viewBoxWidth = 875; + } else if (delim === "\\{" || delim === "\\lbrace") { + top2 = "\u23A7"; + middle = "\u23A8"; + bottom2 = "\u23A9"; + repeat2 = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\}" || delim === "\\rbrace") { + top2 = "\u23AB"; + middle = "\u23AC"; + bottom2 = "\u23AD"; + repeat2 = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\lgroup" || delim === "\u27EE") { + top2 = "\u23A7"; + bottom2 = "\u23A9"; + repeat2 = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\rgroup" || delim === "\u27EF") { + top2 = "\u23AB"; + bottom2 = "\u23AD"; + repeat2 = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\lmoustache" || delim === "\u23B0") { + top2 = "\u23A7"; + bottom2 = "\u23AD"; + repeat2 = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\rmoustache" || delim === "\u23B1") { + top2 = "\u23AB"; + bottom2 = "\u23A9"; + repeat2 = "\u23AA"; + font = "Size4-Regular"; + } + var topMetrics = getMetrics(top2, font, mode); + var topHeightTotal = topMetrics.height + topMetrics.depth; + var repeatMetrics = getMetrics(repeat2, font, mode); + var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth; + var bottomMetrics = getMetrics(bottom2, font, mode); + var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth; + var middleHeightTotal = 0; + var middleFactor = 1; + if (middle !== null) { + var middleMetrics = getMetrics(middle, font, mode); + middleHeightTotal = middleMetrics.height + middleMetrics.depth; + middleFactor = 2; + } + var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal; + var repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal))); + var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal; + var axisHeight = options3.fontMetrics().axisHeight; + if (center4) { + axisHeight *= options3.sizeMultiplier; + } + var depth = realHeightTotal / 2 - axisHeight; + var stack = []; + if (svgLabel.length > 0) { + var midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal; + var viewBoxHeight = Math.round(realHeightTotal * 1e3); + var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1e3)); + var path4 = new PathNode(svgLabel, pathStr); + var width3 = (viewBoxWidth / 1e3).toFixed(3) + "em"; + var height2 = (viewBoxHeight / 1e3).toFixed(3) + "em"; + var svg = new SvgNode([path4], { + "width": width3, + "height": height2, + "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight + }); + var wrapper = buildCommon.makeSvgSpan([], [svg], options3); + wrapper.height = viewBoxHeight / 1e3; + wrapper.style.width = width3; + wrapper.style.height = height2; + stack.push({ + type: "elem", + elem: wrapper + }); + } else { + stack.push(makeGlyphSpan(bottom2, font, mode)); + stack.push(lap); + if (middle === null) { + var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms; + stack.push(makeInner(repeat2, innerHeight, options3)); } else { - var x1 = this._x * (1 - this._t) + x2 * this._t; - this._context.lineTo(x1, this._y); - this._context.lineTo(x1, y2); - } - break; - } - } - this._x = x2, this._y = y2; - } - }; - function curveStep(context) { - return new Step(context, 0.5); - } - function stepBefore(context) { - return new Step(context, 0); - } - function stepAfter(context) { - return new Step(context, 1); - } - function Transform(k, x2, y2) { - this.k = k; - this.x = x2; - this.y = y2; - } - Transform.prototype = { - constructor: Transform, - scale: function(k) { - return k === 1 ? this : new Transform(this.k * k, this.x, this.y); - }, - translate: function(x2, y2) { - return x2 === 0 & y2 === 0 ? this : new Transform(this.k, this.x + this.k * x2, this.y + this.k * y2); - }, - apply: function(point2) { - return [point2[0] * this.k + this.x, point2[1] * this.k + this.y]; - }, - applyX: function(x2) { - return x2 * this.k + this.x; - }, - applyY: function(y2) { - return y2 * this.k + this.y; - }, - invert: function(location2) { - return [(location2[0] - this.x) / this.k, (location2[1] - this.y) / this.k]; - }, - invertX: function(x2) { - return (x2 - this.x) / this.k; - }, - invertY: function(y2) { - return (y2 - this.y) / this.k; - }, - rescaleX: function(x2) { - return x2.copy().domain(x2.range().map(this.invertX, this).map(x2.invert, x2)); - }, - rescaleY: function(y2) { - return y2.copy().domain(y2.range().map(this.invertY, this).map(y2.invert, y2)); - }, - toString: function() { - return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; - } - }; - Transform.prototype; - /*! @license DOMPurify 3.0.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.9/LICENSE */ - const { - entries, - setPrototypeOf, - isFrozen, - getPrototypeOf, - getOwnPropertyDescriptor - } = Object; - let { - freeze, - seal, - create - } = Object; - let { - apply: apply$2, - construct - } = typeof Reflect !== "undefined" && Reflect; - if (!freeze) { - freeze = function freeze2(x2) { - return x2; - }; - } - if (!seal) { - seal = function seal2(x2) { - return x2; - }; - } - if (!apply$2) { - apply$2 = function apply2(fun, thisValue, args) { - return fun.apply(thisValue, args); - }; - } - if (!construct) { - construct = function construct2(Func, args) { - return new Func(...args); - }; - } - const arrayForEach = unapply(Array.prototype.forEach); - const arrayPop = unapply(Array.prototype.pop); - const arrayPush$1 = unapply(Array.prototype.push); - const stringToLowerCase = unapply(String.prototype.toLowerCase); - const stringToString = unapply(String.prototype.toString); - const stringMatch = unapply(String.prototype.match); - const stringReplace = unapply(String.prototype.replace); - const stringIndexOf = unapply(String.prototype.indexOf); - const stringTrim = unapply(String.prototype.trim); - const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); - const regExpTest = unapply(RegExp.prototype.test); - const typeErrorCreate = unconstruct(TypeError); - function unapply(func) { - return function(thisArg) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - return apply$2(func, thisArg, args); - }; - } - function unconstruct(func) { - return function() { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - return construct(func, args); - }; - } - function addToSet(set2, array2) { - let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase; - if (setPrototypeOf) { - setPrototypeOf(set2, null); - } - let l = array2.length; - while (l--) { - let element2 = array2[l]; - if (typeof element2 === "string") { - const lcElement = transformCaseFunc(element2); - if (lcElement !== element2) { - if (!isFrozen(array2)) { - array2[l] = lcElement; - } - element2 = lcElement; - } - } - set2[element2] = true; - } - return set2; - } - function cleanArray(array2) { - for (let index2 = 0; index2 < array2.length; index2++) { - const isPropertyExist = objectHasOwnProperty(array2, index2); - if (!isPropertyExist) { - array2[index2] = null; - } - } - return array2; - } - function clone$2(object2) { - const newObject = create(null); - for (const [property2, value2] of entries(object2)) { - const isPropertyExist = objectHasOwnProperty(object2, property2); - if (isPropertyExist) { - if (Array.isArray(value2)) { - newObject[property2] = cleanArray(value2); - } else if (value2 && typeof value2 === "object" && value2.constructor === Object) { - newObject[property2] = clone$2(value2); + var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms; + stack.push(makeInner(repeat2, _innerHeight, options3)); + stack.push(lap); + stack.push(makeGlyphSpan(middle, font, mode)); + stack.push(lap); + stack.push(makeInner(repeat2, _innerHeight, options3)); + } + stack.push(lap); + stack.push(makeGlyphSpan(top2, font, mode)); + } + var newOptions = options3.havingBaseStyle(Style$1.TEXT); + var inner2 = buildCommon.makeVList({ + positionType: "bottom", + positionData: depth, + children: stack + }, newOptions); + return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [inner2], newOptions), Style$1.TEXT, options3, classes6); + }, "makeStackedDelim"); + vbPad = 80; + emPad = 0.08; + sqrtSvg = /* @__PURE__ */ __name(function sqrtSvg2(sqrtName, height2, viewBoxHeight, extraVinculum, options3) { + var path4 = sqrtPath(sqrtName, extraVinculum, viewBoxHeight); + var pathNode = new PathNode(sqrtName, path4); + var svg = new SvgNode([pathNode], { + // Note: 1000:1 ratio of viewBox to document em width. + "width": "400em", + "height": makeEm(height2), + "viewBox": "0 0 400000 " + viewBoxHeight, + "preserveAspectRatio": "xMinYMin slice" + }); + return buildCommon.makeSvgSpan(["hide-tail"], [svg], options3); + }, "sqrtSvg"); + makeSqrtImage = /* @__PURE__ */ __name(function makeSqrtImage2(height2, options3) { + var newOptions = options3.havingBaseSizing(); + var delim = traverseSequence("\\surd", height2 * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions); + var sizeMultiplier = newOptions.sizeMultiplier; + var extraVinculum = Math.max(0, options3.minRuleThickness - options3.fontMetrics().sqrtRuleThickness); + var span; + var spanHeight = 0; + var texHeight = 0; + var viewBoxHeight = 0; + var advanceWidth; + if (delim.type === "small") { + viewBoxHeight = 1e3 + 1e3 * extraVinculum + vbPad; + if (height2 < 1) { + sizeMultiplier = 1; + } else if (height2 < 1.4) { + sizeMultiplier = 0.7; + } + spanHeight = (1 + extraVinculum + emPad) / sizeMultiplier; + texHeight = (1 + extraVinculum) / sizeMultiplier; + span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum, options3); + span.style.minWidth = "0.853em"; + advanceWidth = 0.833 / sizeMultiplier; + } else if (delim.type === "large") { + viewBoxHeight = (1e3 + vbPad) * sizeToMaxHeight[delim.size]; + texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier; + spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad) / sizeMultiplier; + span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight, extraVinculum, options3); + span.style.minWidth = "1.02em"; + advanceWidth = 1 / sizeMultiplier; } else { - newObject[property2] = value2; - } - } - } - return newObject; - } - function lookupGetter(object2, prop) { - while (object2 !== null) { - const desc = getOwnPropertyDescriptor(object2, prop); - if (desc) { - if (desc.get) { - return unapply(desc.get); - } - if (typeof desc.value === "function") { - return unapply(desc.value); - } - } - object2 = getPrototypeOf(object2); - } - function fallbackValue() { - return null; - } - return fallbackValue; - } - const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]); - const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]); - const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]); - const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]); - const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]); - const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]); - const text$3 = freeze(["#text"]); - const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]); - const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]); - const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]); - const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]); - const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); - const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); - const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm); - const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); - const ARIA_ATTR = seal(/^aria-[\-\w]+$/); - const IS_ALLOWED_URI = seal( - /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i - // eslint-disable-line no-useless-escape - ); - const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); - const ATTR_WHITESPACE = seal( - /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g - // eslint-disable-line no-control-regex - ); - const DOCTYPE_NAME = seal(/^html$/i); - var EXPRESSIONS = /* @__PURE__ */ Object.freeze({ - __proto__: null, - MUSTACHE_EXPR, - ERB_EXPR, - TMPLIT_EXPR, - DATA_ATTR, - ARIA_ATTR, - IS_ALLOWED_URI, - IS_SCRIPT_OR_DATA, - ATTR_WHITESPACE, - DOCTYPE_NAME - }); - const getGlobal = function getGlobal2() { - return typeof window === "undefined" ? null : window; - }; - const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) { - if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") { - return null; - } - let suffix = null; - const ATTR_NAME = "data-tt-policy-suffix"; - if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { - suffix = purifyHostElement.getAttribute(ATTR_NAME); - } - const policyName = "dompurify" + (suffix ? "#" + suffix : ""); - try { - return trustedTypes.createPolicy(policyName, { - createHTML(html2) { - return html2; - }, - createScriptURL(scriptUrl) { - return scriptUrl; - } - }); - } catch (_2) { - console.warn("TrustedTypes policy " + policyName + " could not be created."); - return null; - } - }; - function createDOMPurify() { - let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(); - const DOMPurify = (root2) => createDOMPurify(root2); - DOMPurify.version = "3.0.9"; - DOMPurify.removed = []; - if (!window2 || !window2.document || window2.document.nodeType !== 9) { - DOMPurify.isSupported = false; - return DOMPurify; - } - let { - document: document2 - } = window2; - const originalDocument = document2; - const currentScript = originalDocument.currentScript; - const { - DocumentFragment: DocumentFragment2, - HTMLTemplateElement, - Node, - Element, - NodeFilter, - NamedNodeMap = window2.NamedNodeMap || window2.MozNamedAttrMap, - HTMLFormElement, - DOMParser: DOMParser2, - trustedTypes - } = window2; - const ElementPrototype = Element.prototype; - const cloneNode = lookupGetter(ElementPrototype, "cloneNode"); - const getNextSibling = lookupGetter(ElementPrototype, "nextSibling"); - const getChildNodes = lookupGetter(ElementPrototype, "childNodes"); - const getParentNode = lookupGetter(ElementPrototype, "parentNode"); - if (typeof HTMLTemplateElement === "function") { - const template = document2.createElement("template"); - if (template.content && template.content.ownerDocument) { - document2 = template.content.ownerDocument; - } - } - let trustedTypesPolicy; - let emptyHTML = ""; - const { - implementation, - createNodeIterator, - createDocumentFragment, - getElementsByTagName - } = document2; - const { - importNode - } = originalDocument; - let hooks = {}; - DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0; - const { - MUSTACHE_EXPR: MUSTACHE_EXPR2, - ERB_EXPR: ERB_EXPR2, - TMPLIT_EXPR: TMPLIT_EXPR2, - DATA_ATTR: DATA_ATTR2, - ARIA_ATTR: ARIA_ATTR2, - IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2, - ATTR_WHITESPACE: ATTR_WHITESPACE2 - } = EXPRESSIONS; - let { - IS_ALLOWED_URI: IS_ALLOWED_URI$1 - } = EXPRESSIONS; - let ALLOWED_TAGS = null; - const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text$3]); - let ALLOWED_ATTR = null; - const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); - let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { - tagNameCheck: { - writable: true, - configurable: false, - enumerable: true, - value: null - }, - attributeNameCheck: { - writable: true, - configurable: false, - enumerable: true, - value: null - }, - allowCustomizedBuiltInElements: { - writable: true, - configurable: false, - enumerable: true, - value: false - } - })); - let FORBID_TAGS = null; - let FORBID_ATTR = null; - let ALLOW_ARIA_ATTR = true; - let ALLOW_DATA_ATTR = true; - let ALLOW_UNKNOWN_PROTOCOLS = false; - let ALLOW_SELF_CLOSE_IN_ATTR = true; - let SAFE_FOR_TEMPLATES = false; - let WHOLE_DOCUMENT = false; - let SET_CONFIG = false; - let FORCE_BODY = false; - let RETURN_DOM = false; - let RETURN_DOM_FRAGMENT = false; - let RETURN_TRUSTED_TYPE = false; - let SANITIZE_DOM = true; - let SANITIZE_NAMED_PROPS = false; - const SANITIZE_NAMED_PROPS_PREFIX = "user-content-"; - let KEEP_CONTENT = true; - let IN_PLACE = false; - let USE_PROFILES = {}; - let FORBID_CONTENTS = null; - const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); - let DATA_URI_TAGS = null; - const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); - let URI_SAFE_ATTRIBUTES = null; - const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]); - const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; - const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; - const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; - let NAMESPACE = HTML_NAMESPACE; - let IS_EMPTY_INPUT = false; - let ALLOWED_NAMESPACES = null; - const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); - let PARSER_MEDIA_TYPE = null; - const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; - const DEFAULT_PARSER_MEDIA_TYPE = "text/html"; - let transformCaseFunc = null; - let CONFIG = null; - const formElement = document2.createElement("form"); - const isRegexOrFunction = function isRegexOrFunction2(testValue) { - return testValue instanceof RegExp || testValue instanceof Function; - }; - const _parseConfig = function _parseConfig2() { - let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - if (CONFIG && CONFIG === cfg) { - return; - } - if (!cfg || typeof cfg !== "object") { - cfg = {}; - } - cfg = clone$2(cfg); - PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes - SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; - transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; - ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; - ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; - ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; - URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet( - clone$2(DEFAULT_URI_SAFE_ATTRIBUTES), - // eslint-disable-line indent - cfg.ADD_URI_SAFE_ATTR, - // eslint-disable-line indent - transformCaseFunc - // eslint-disable-line indent - ) : DEFAULT_URI_SAFE_ATTRIBUTES; - DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet( - clone$2(DEFAULT_DATA_URI_TAGS), - // eslint-disable-line indent - cfg.ADD_DATA_URI_TAGS, - // eslint-disable-line indent - transformCaseFunc - // eslint-disable-line indent - ) : DEFAULT_DATA_URI_TAGS; - FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; - FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {}; - FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {}; - USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false; - ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; - ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; - ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; - ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; - SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; - WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; - RETURN_DOM = cfg.RETURN_DOM || false; - RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; - RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; - FORCE_BODY = cfg.FORCE_BODY || false; - SANITIZE_DOM = cfg.SANITIZE_DOM !== false; - SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; - KEEP_CONTENT = cfg.KEEP_CONTENT !== false; - IN_PLACE = cfg.IN_PLACE || false; - IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; - NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; - CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; - if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { - CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; - } - if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { - CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; - } - if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") { - CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; - } - if (SAFE_FOR_TEMPLATES) { - ALLOW_DATA_ATTR = false; - } - if (RETURN_DOM_FRAGMENT) { - RETURN_DOM = true; - } - if (USE_PROFILES) { - ALLOWED_TAGS = addToSet({}, text$3); - ALLOWED_ATTR = []; - if (USE_PROFILES.html === true) { - addToSet(ALLOWED_TAGS, html$1); - addToSet(ALLOWED_ATTR, html); - } - if (USE_PROFILES.svg === true) { - addToSet(ALLOWED_TAGS, svg$1); - addToSet(ALLOWED_ATTR, svg); - addToSet(ALLOWED_ATTR, xml); - } - if (USE_PROFILES.svgFilters === true) { - addToSet(ALLOWED_TAGS, svgFilters); - addToSet(ALLOWED_ATTR, svg); - addToSet(ALLOWED_ATTR, xml); - } - if (USE_PROFILES.mathMl === true) { - addToSet(ALLOWED_TAGS, mathMl$1); - addToSet(ALLOWED_ATTR, mathMl); - addToSet(ALLOWED_ATTR, xml); - } - } - if (cfg.ADD_TAGS) { - if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { - ALLOWED_TAGS = clone$2(ALLOWED_TAGS); - } - addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); - } - if (cfg.ADD_ATTR) { - if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { - ALLOWED_ATTR = clone$2(ALLOWED_ATTR); - } - addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); - } - if (cfg.ADD_URI_SAFE_ATTR) { - addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); - } - if (cfg.FORBID_CONTENTS) { - if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { - FORBID_CONTENTS = clone$2(FORBID_CONTENTS); - } - addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); - } - if (KEEP_CONTENT) { - ALLOWED_TAGS["#text"] = true; - } - if (WHOLE_DOCUMENT) { - addToSet(ALLOWED_TAGS, ["html", "head", "body"]); - } - if (ALLOWED_TAGS.table) { - addToSet(ALLOWED_TAGS, ["tbody"]); - delete FORBID_TAGS.tbody; - } - if (cfg.TRUSTED_TYPES_POLICY) { - if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") { - throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); - } - if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") { - throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); - } - trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; - emptyHTML = trustedTypesPolicy.createHTML(""); - } else { - if (trustedTypesPolicy === void 0) { - trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); - } - if (trustedTypesPolicy !== null && typeof emptyHTML === "string") { - emptyHTML = trustedTypesPolicy.createHTML(""); - } - } - if (freeze) { - freeze(cfg); - } - CONFIG = cfg; - }; - const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]); - const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]); - const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]); - const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); - const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); - const _checkValidNamespace = function _checkValidNamespace2(element2) { - let parent = getParentNode(element2); - if (!parent || !parent.tagName) { - parent = { - namespaceURI: NAMESPACE, - tagName: "template" + spanHeight = height2 + extraVinculum + emPad; + texHeight = height2 + extraVinculum; + viewBoxHeight = Math.floor(1e3 * height2 + extraVinculum) + vbPad; + span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum, options3); + span.style.minWidth = "0.742em"; + advanceWidth = 1.056; + } + span.height = texHeight; + span.style.height = makeEm(spanHeight); + return { + span, + advanceWidth, + // Calculate the actual line width. + // This actually should depend on the chosen font -- e.g. \boldmath + // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and + // have thicker rules. + ruleWidth: (options3.fontMetrics().sqrtRuleThickness + extraVinculum) * sizeMultiplier }; - } - const tagName = stringToLowerCase(element2.tagName); - const parentTagName = stringToLowerCase(parent.tagName); - if (!ALLOWED_NAMESPACES[element2.namespaceURI]) { - return false; - } - if (element2.namespaceURI === SVG_NAMESPACE) { - if (parent.namespaceURI === HTML_NAMESPACE) { - return tagName === "svg"; - } - if (parent.namespaceURI === MATHML_NAMESPACE) { - return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); - } - return Boolean(ALL_SVG_TAGS[tagName]); - } - if (element2.namespaceURI === MATHML_NAMESPACE) { - if (parent.namespaceURI === HTML_NAMESPACE) { - return tagName === "math"; - } - if (parent.namespaceURI === SVG_NAMESPACE) { - return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; - } - return Boolean(ALL_MATHML_TAGS[tagName]); - } - if (element2.namespaceURI === HTML_NAMESPACE) { - if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { - return false; + }, "makeSqrtImage"); + stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230A", "\u230B", "\\lceil", "\\rceil", "\u2308", "\u2309", "\\surd"]; + stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27EE", "\u27EF", "\\lmoustache", "\\rmoustache", "\u23B0", "\u23B1"]; + stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"]; + sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3]; + makeSizedDelim = /* @__PURE__ */ __name(function makeSizedDelim2(delim, size5, options3, mode, classes6) { + if (delim === "<" || delim === "\\lt" || delim === "\u27E8") { + delim = "\\langle"; + } else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") { + delim = "\\rangle"; + } + if (utils.contains(stackLargeDelimiters, delim) || utils.contains(stackNeverDelimiters, delim)) { + return makeLargeDelim(delim, size5, false, options3, mode, classes6); + } else if (utils.contains(stackAlwaysDelimiters, delim)) { + return makeStackedDelim(delim, sizeToMaxHeight[size5], false, options3, mode, classes6); + } else { + throw new ParseError("Illegal delimiter: '" + delim + "'"); } - if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { - return false; + }, "makeSizedDelim"); + stackNeverDelimiterSequence = [{ + type: "small", + style: Style$1.SCRIPTSCRIPT + }, { + type: "small", + style: Style$1.SCRIPT + }, { + type: "small", + style: Style$1.TEXT + }, { + type: "large", + size: 1 + }, { + type: "large", + size: 2 + }, { + type: "large", + size: 3 + }, { + type: "large", + size: 4 + }]; + stackAlwaysDelimiterSequence = [{ + type: "small", + style: Style$1.SCRIPTSCRIPT + }, { + type: "small", + style: Style$1.SCRIPT + }, { + type: "small", + style: Style$1.TEXT + }, { + type: "stack" + }]; + stackLargeDelimiterSequence = [{ + type: "small", + style: Style$1.SCRIPTSCRIPT + }, { + type: "small", + style: Style$1.SCRIPT + }, { + type: "small", + style: Style$1.TEXT + }, { + type: "large", + size: 1 + }, { + type: "large", + size: 2 + }, { + type: "large", + size: 3 + }, { + type: "large", + size: 4 + }, { + type: "stack" + }]; + delimTypeToFont = /* @__PURE__ */ __name(function delimTypeToFont2(type3) { + if (type3.type === "small") { + return "Main-Regular"; + } else if (type3.type === "large") { + return "Size" + type3.size + "-Regular"; + } else if (type3.type === "stack") { + return "Size4-Regular"; + } else { + throw new Error("Add support for delim type '" + type3.type + "' here."); + } + }, "delimTypeToFont"); + traverseSequence = /* @__PURE__ */ __name(function traverseSequence2(delim, height2, sequence, options3) { + var start3 = Math.min(2, 3 - options3.style.size); + for (var i2 = start3; i2 < sequence.length; i2++) { + if (sequence[i2].type === "stack") { + break; + } + var metrics = getMetrics(delim, delimTypeToFont(sequence[i2]), "math"); + var heightDepth = metrics.height + metrics.depth; + if (sequence[i2].type === "small") { + var newOptions = options3.havingBaseStyle(sequence[i2].style); + heightDepth *= newOptions.sizeMultiplier; + } + if (heightDepth > height2) { + return sequence[i2]; + } + } + return sequence[sequence.length - 1]; + }, "traverseSequence"); + makeCustomSizedDelim = /* @__PURE__ */ __name(function makeCustomSizedDelim2(delim, height2, center4, options3, mode, classes6) { + if (delim === "<" || delim === "\\lt" || delim === "\u27E8") { + delim = "\\langle"; + } else if (delim === ">" || delim === "\\gt" || delim === "\u27E9") { + delim = "\\rangle"; + } + var sequence; + if (utils.contains(stackNeverDelimiters, delim)) { + sequence = stackNeverDelimiterSequence; + } else if (utils.contains(stackLargeDelimiters, delim)) { + sequence = stackLargeDelimiterSequence; + } else { + sequence = stackAlwaysDelimiterSequence; } - return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); - } - if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element2.namespaceURI]) { - return true; - } - return false; - }; - const _forceRemove = function _forceRemove2(node2) { - arrayPush$1(DOMPurify.removed, { - element: node2 - }); - try { - node2.parentNode.removeChild(node2); - } catch (_2) { - node2.remove(); - } - }; - const _removeAttribute = function _removeAttribute2(name, node2) { - try { - arrayPush$1(DOMPurify.removed, { - attribute: node2.getAttributeNode(name), - from: node2 - }); - } catch (_2) { - arrayPush$1(DOMPurify.removed, { - attribute: null, - from: node2 - }); - } - node2.removeAttribute(name); - if (name === "is" && !ALLOWED_ATTR[name]) { - if (RETURN_DOM || RETURN_DOM_FRAGMENT) { - try { - _forceRemove(node2); - } catch (_2) { - } + var delimType = traverseSequence(delim, height2, sequence, options3); + if (delimType.type === "small") { + return makeSmallDelim(delim, delimType.style, center4, options3, mode, classes6); + } else if (delimType.type === "large") { + return makeLargeDelim(delim, delimType.size, center4, options3, mode, classes6); } else { - try { - node2.setAttribute(name, ""); - } catch (_2) { + return makeStackedDelim(delim, height2, center4, options3, mode, classes6); + } + }, "makeCustomSizedDelim"); + makeLeftRightDelim = /* @__PURE__ */ __name(function makeLeftRightDelim2(delim, height2, depth, options3, mode, classes6) { + var axisHeight = options3.fontMetrics().axisHeight * options3.sizeMultiplier; + var delimiterFactor = 901; + var delimiterExtend = 5 / options3.fontMetrics().ptPerEm; + var maxDistFromAxis = Math.max(height2 - axisHeight, depth + axisHeight); + var totalHeight = Math.max( + // In real TeX, calculations are done using integral values which are + // 65536 per pt, or 655360 per em. So, the division here truncates in + // TeX but doesn't here, producing different results. If we wanted to + // exactly match TeX's calculation, we could do + // Math.floor(655360 * maxDistFromAxis / 500) * + // delimiterFactor / 655360 + // (To see the difference, compare + // x^{x^{\left(\rule{0.1em}{0.68em}\right)}} + // in TeX and KaTeX) + maxDistFromAxis / 500 * delimiterFactor, + 2 * maxDistFromAxis - delimiterExtend + ); + return makeCustomSizedDelim(delim, totalHeight, true, options3, mode, classes6); + }, "makeLeftRightDelim"); + delimiter = { + sqrtImage: makeSqrtImage, + sizedDelim: makeSizedDelim, + sizeToMaxHeight, + customSizedDelim: makeCustomSizedDelim, + leftRightDelim: makeLeftRightDelim + }; + delimiterSizes = { + "\\bigl": { + mclass: "mopen", + size: 1 + }, + "\\Bigl": { + mclass: "mopen", + size: 2 + }, + "\\biggl": { + mclass: "mopen", + size: 3 + }, + "\\Biggl": { + mclass: "mopen", + size: 4 + }, + "\\bigr": { + mclass: "mclose", + size: 1 + }, + "\\Bigr": { + mclass: "mclose", + size: 2 + }, + "\\biggr": { + mclass: "mclose", + size: 3 + }, + "\\Biggr": { + mclass: "mclose", + size: 4 + }, + "\\bigm": { + mclass: "mrel", + size: 1 + }, + "\\Bigm": { + mclass: "mrel", + size: 2 + }, + "\\biggm": { + mclass: "mrel", + size: 3 + }, + "\\Biggm": { + mclass: "mrel", + size: 4 + }, + "\\big": { + mclass: "mord", + size: 1 + }, + "\\Big": { + mclass: "mord", + size: 2 + }, + "\\bigg": { + mclass: "mord", + size: 3 + }, + "\\Bigg": { + mclass: "mord", + size: 4 + } + }; + delimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230A", "\u230B", "\\lceil", "\\rceil", "\u2308", "\u2309", "<", ">", "\\langle", "\u27E8", "\\rangle", "\u27E9", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27EE", "\u27EF", "\\lmoustache", "\\rmoustache", "\u23B0", "\u23B1", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]; + __name(checkDelimiter, "checkDelimiter"); + defineFunction({ + type: "delimsizing", + names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"], + props: { + numArgs: 1, + argTypes: ["primitive"] + }, + handler: /* @__PURE__ */ __name((context, args) => { + var delim = checkDelimiter(args[0], context); + return { + type: "delimsizing", + mode: context.parser.mode, + size: delimiterSizes[context.funcName].size, + mclass: delimiterSizes[context.funcName].mclass, + delim: delim.text + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + if (group2.delim === ".") { + return buildCommon.makeSpan([group2.mclass]); + } + return delimiter.sizedDelim(group2.delim, group2.size, options3, group2.mode, [group2.mclass]); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2) => { + var children2 = []; + if (group2.delim !== ".") { + children2.push(makeText(group2.delim, group2.mode)); } - } - } - }; - const _initDocument = function _initDocument2(dirty) { - let doc = null; - let leadingWhitespace = null; - if (FORCE_BODY) { - dirty = "" + dirty; - } else { - const matches = stringMatch(dirty, /^[\r\n\t ]+/); - leadingWhitespace = matches && matches[0]; - } - if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) { - dirty = '' + dirty + ""; - } - const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; - if (NAMESPACE === HTML_NAMESPACE) { - try { - doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); - } catch (_2) { - } - } - if (!doc || !doc.documentElement) { - doc = implementation.createDocument(NAMESPACE, "template", null); - try { - doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; - } catch (_2) { - } - } - const body = doc.body || doc.documentElement; - if (dirty && leadingWhitespace) { - body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null); - } - if (NAMESPACE === HTML_NAMESPACE) { - return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0]; - } - return WHOLE_DOCUMENT ? doc.documentElement : body; - }; - const _createNodeIterator = function _createNodeIterator2(root2) { - return createNodeIterator.call( - root2.ownerDocument || root2, - root2, - // eslint-disable-next-line no-bitwise - NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, - null - ); - }; - const _isClobbered = function _isClobbered2(elm) { - return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function"); - }; - const _isNode = function _isNode2(object2) { - return typeof Node === "function" && object2 instanceof Node; - }; - const _executeHook = function _executeHook2(entryPoint, currentNode, data) { - if (!hooks[entryPoint]) { - return; - } - arrayForEach(hooks[entryPoint], (hook) => { - hook.call(DOMPurify, currentNode, data, CONFIG); - }); - }; - const _sanitizeElements = function _sanitizeElements2(currentNode) { - let content2 = null; - _executeHook("beforeSanitizeElements", currentNode, null); - if (_isClobbered(currentNode)) { - _forceRemove(currentNode); - return true; - } - const tagName = transformCaseFunc(currentNode.nodeName); - _executeHook("uponSanitizeElement", currentNode, { - tagName, - allowedTags: ALLOWED_TAGS - }); - if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) { - _forceRemove(currentNode); - return true; - } - if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { - if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { - if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { - return false; + var node2 = new mathMLTree.MathNode("mo", children2); + if (group2.mclass === "mopen" || group2.mclass === "mclose") { + node2.setAttribute("fence", "true"); + } else { + node2.setAttribute("fence", "false"); } - if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { - return false; + node2.setAttribute("stretchy", "true"); + var size5 = makeEm(delimiter.sizeToMaxHeight[group2.size]); + node2.setAttribute("minsize", size5); + node2.setAttribute("maxsize", size5); + return node2; + }, "mathmlBuilder") + }); + __name(assertParsed, "assertParsed"); + defineFunction({ + type: "leftright-right", + names: ["\\right"], + props: { + numArgs: 1, + primitive: true + }, + handler: /* @__PURE__ */ __name((context, args) => { + var color2 = context.parser.gullet.macros.get("\\current@color"); + if (color2 && typeof color2 !== "string") { + throw new ParseError("\\current@color set to non-string in \\right"); } - } - if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { - const parentNode = getParentNode(currentNode) || currentNode.parentNode; - const childNodes = getChildNodes(currentNode) || currentNode.childNodes; - if (childNodes && parentNode) { - const childCount = childNodes.length; - for (let i2 = childCount - 1; i2 >= 0; --i2) { - parentNode.insertBefore(cloneNode(childNodes[i2], true), getNextSibling(currentNode)); + return { + type: "leftright-right", + mode: context.parser.mode, + delim: checkDelimiter(args[0], context).text, + color: color2 + // undefined if not set via \color + }; + }, "handler") + }); + defineFunction({ + type: "leftright", + names: ["\\left"], + props: { + numArgs: 1, + primitive: true + }, + handler: /* @__PURE__ */ __name((context, args) => { + var delim = checkDelimiter(args[0], context); + var parser21 = context.parser; + ++parser21.leftrightDepth; + var body = parser21.parseExpression(false); + --parser21.leftrightDepth; + parser21.expect("\\right", false); + var right3 = assertNodeType(parser21.parseFunction(), "leftright-right"); + return { + type: "leftright", + mode: parser21.mode, + body, + left: delim.text, + right: right3.delim, + rightColor: right3.color + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + assertParsed(group2); + var inner2 = buildExpression$1(group2.body, options3, true, ["mopen", "mclose"]); + var innerHeight = 0; + var innerDepth = 0; + var hadMiddle = false; + for (var i2 = 0; i2 < inner2.length; i2++) { + if (inner2[i2].isMiddle) { + hadMiddle = true; + } else { + innerHeight = Math.max(inner2[i2].height, innerHeight); + innerDepth = Math.max(inner2[i2].depth, innerDepth); } } - } - _forceRemove(currentNode); - return true; - } - if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { - _forceRemove(currentNode); - return true; - } - if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { - _forceRemove(currentNode); - return true; - } - if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) { - content2 = currentNode.textContent; - arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { - content2 = stringReplace(content2, expr, " "); - }); - if (currentNode.textContent !== content2) { - arrayPush$1(DOMPurify.removed, { - element: currentNode.cloneNode() - }); - currentNode.textContent = content2; - } - } - _executeHook("afterSanitizeElements", currentNode, null); - return false; - }; - const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value2) { - if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value2 in document2 || value2 in formElement)) { - return false; - } - if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName)) - ; - else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName)) - ; - else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { - if ( - // First condition does a very basic check if a) it's basically a valid custom element tagname AND - // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck - // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck - _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND - // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck - lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value2) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value2)) - ) - ; - else { - return false; - } - } else if (URI_SAFE_ATTRIBUTES[lcName]) - ; - else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value2, ATTR_WHITESPACE2, ""))) - ; - else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value2, "data:") === 0 && DATA_URI_TAGS[lcTag]) - ; - else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value2, ATTR_WHITESPACE2, ""))) - ; - else if (value2) { - return false; - } else - ; - return true; - }; - const _isBasicCustomElement = function _isBasicCustomElement2(tagName) { - return tagName !== "annotation-xml" && tagName.indexOf("-") > 0; - }; - const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) { - _executeHook("beforeSanitizeAttributes", currentNode, null); - const { - attributes - } = currentNode; - if (!attributes) { - return; - } - const hookEvent = { - attrName: "", - attrValue: "", - keepAttr: true, - allowedAttributes: ALLOWED_ATTR - }; - let l = attributes.length; - while (l--) { - const attr = attributes[l]; - const { - name, - namespaceURI, - value: attrValue - } = attr; - const lcName = transformCaseFunc(name); - let value2 = name === "value" ? attrValue : stringTrim(attrValue); - hookEvent.attrName = lcName; - hookEvent.attrValue = value2; - hookEvent.keepAttr = true; - hookEvent.forceKeepAttr = void 0; - _executeHook("uponSanitizeAttribute", currentNode, hookEvent); - value2 = hookEvent.attrValue; - if (hookEvent.forceKeepAttr) { - continue; - } - _removeAttribute(name, currentNode); - if (!hookEvent.keepAttr) { - continue; - } - if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value2)) { - _removeAttribute(name, currentNode); - continue; - } - if (SAFE_FOR_TEMPLATES) { - arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { - value2 = stringReplace(value2, expr, " "); - }); - } - const lcTag = transformCaseFunc(currentNode.nodeName); - if (!_isValidAttribute(lcTag, lcName, value2)) { - continue; - } - if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) { - _removeAttribute(name, currentNode); - value2 = SANITIZE_NAMED_PROPS_PREFIX + value2; - } - if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") { - if (namespaceURI) - ; - else { - switch (trustedTypes.getAttributeType(lcTag, lcName)) { - case "TrustedHTML": { - value2 = trustedTypesPolicy.createHTML(value2); - break; - } - case "TrustedScriptURL": { - value2 = trustedTypesPolicy.createScriptURL(value2); - break; + innerHeight *= options3.sizeMultiplier; + innerDepth *= options3.sizeMultiplier; + var leftDelim; + if (group2.left === ".") { + leftDelim = makeNullDelimiter(options3, ["mopen"]); + } else { + leftDelim = delimiter.leftRightDelim(group2.left, innerHeight, innerDepth, options3, group2.mode, ["mopen"]); + } + inner2.unshift(leftDelim); + if (hadMiddle) { + for (var _i = 1; _i < inner2.length; _i++) { + var middleDelim = inner2[_i]; + var isMiddle = middleDelim.isMiddle; + if (isMiddle) { + inner2[_i] = delimiter.leftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group2.mode, []); } } } - } - try { - if (namespaceURI) { - currentNode.setAttributeNS(namespaceURI, name, value2); + var rightDelim; + if (group2.right === ".") { + rightDelim = makeNullDelimiter(options3, ["mclose"]); } else { - currentNode.setAttribute(name, value2); - } - arrayPop(DOMPurify.removed); - } catch (_2) { - } - } - _executeHook("afterSanitizeAttributes", currentNode, null); - }; - const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) { - let shadowNode = null; - const shadowIterator = _createNodeIterator(fragment); - _executeHook("beforeSanitizeShadowDOM", fragment, null); - while (shadowNode = shadowIterator.nextNode()) { - _executeHook("uponSanitizeShadowNode", shadowNode, null); - if (_sanitizeElements(shadowNode)) { - continue; - } - if (shadowNode.content instanceof DocumentFragment2) { - _sanitizeShadowDOM2(shadowNode.content); - } - _sanitizeAttributes(shadowNode); - } - _executeHook("afterSanitizeShadowDOM", fragment, null); - }; - DOMPurify.sanitize = function(dirty) { - let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - let body = null; - let importedNode = null; - let currentNode = null; - let returnNode = null; - IS_EMPTY_INPUT = !dirty; - if (IS_EMPTY_INPUT) { - dirty = ""; - } - if (typeof dirty !== "string" && !_isNode(dirty)) { - if (typeof dirty.toString === "function") { - dirty = dirty.toString(); - if (typeof dirty !== "string") { - throw typeErrorCreate("dirty is not a string, aborting"); + var colorOptions = group2.rightColor ? options3.withColor(group2.rightColor) : options3; + rightDelim = delimiter.leftRightDelim(group2.right, innerHeight, innerDepth, colorOptions, group2.mode, ["mclose"]); + } + inner2.push(rightDelim); + return buildCommon.makeSpan(["minner"], inner2, options3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + assertParsed(group2); + var inner2 = buildExpression2(group2.body, options3); + if (group2.left !== ".") { + var leftNode = new mathMLTree.MathNode("mo", [makeText(group2.left, group2.mode)]); + leftNode.setAttribute("fence", "true"); + inner2.unshift(leftNode); + } + if (group2.right !== ".") { + var rightNode = new mathMLTree.MathNode("mo", [makeText(group2.right, group2.mode)]); + rightNode.setAttribute("fence", "true"); + if (group2.rightColor) { + rightNode.setAttribute("mathcolor", group2.rightColor); + } + inner2.push(rightNode); + } + return makeRow(inner2); + }, "mathmlBuilder") + }); + defineFunction({ + type: "middle", + names: ["\\middle"], + props: { + numArgs: 1, + primitive: true + }, + handler: /* @__PURE__ */ __name((context, args) => { + var delim = checkDelimiter(args[0], context); + if (!context.parser.leftrightDepth) { + throw new ParseError("\\middle without preceding \\left", delim); } + return { + type: "middle", + mode: context.parser.mode, + delim: delim.text + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var middleDelim; + if (group2.delim === ".") { + middleDelim = makeNullDelimiter(options3, []); + } else { + middleDelim = delimiter.sizedDelim(group2.delim, 1, options3, group2.mode, []); + var isMiddle = { + delim: group2.delim, + options: options3 + }; + middleDelim.isMiddle = isMiddle; + } + return middleDelim; + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var textNode = group2.delim === "\\vert" || group2.delim === "|" ? makeText("|", "text") : makeText(group2.delim, group2.mode); + var middleNode = new mathMLTree.MathNode("mo", [textNode]); + middleNode.setAttribute("fence", "true"); + middleNode.setAttribute("lspace", "0.05em"); + middleNode.setAttribute("rspace", "0.05em"); + return middleNode; + }, "mathmlBuilder") + }); + htmlBuilder$7 = /* @__PURE__ */ __name((group2, options3) => { + var inner2 = buildCommon.wrapFragment(buildGroup$1(group2.body, options3), options3); + var label = group2.label.slice(1); + var scale = options3.sizeMultiplier; + var img; + var imgShift = 0; + var isSingleChar = utils.isCharacterBox(group2.body); + if (label === "sout") { + img = buildCommon.makeSpan(["stretchy", "sout"]); + img.height = options3.fontMetrics().defaultRuleThickness / scale; + imgShift = -0.5 * options3.fontMetrics().xHeight; + } else if (label === "phase") { + var lineWeight = calculateSize({ + number: 0.6, + unit: "pt" + }, options3); + var clearance = calculateSize({ + number: 0.35, + unit: "ex" + }, options3); + var newOptions = options3.havingBaseSizing(); + scale = scale / newOptions.sizeMultiplier; + var angleHeight = inner2.height + inner2.depth + lineWeight + clearance; + inner2.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight); + var viewBoxHeight = Math.floor(1e3 * angleHeight * scale); + var path4 = phasePath(viewBoxHeight); + var svgNode2 = new SvgNode([new PathNode("phase", path4)], { + "width": "400em", + "height": makeEm(viewBoxHeight / 1e3), + "viewBox": "0 0 400000 " + viewBoxHeight, + "preserveAspectRatio": "xMinYMin slice" + }); + img = buildCommon.makeSvgSpan(["hide-tail"], [svgNode2], options3); + img.style.height = makeEm(angleHeight); + imgShift = inner2.depth + lineWeight + clearance; + } else { + if (/cancel/.test(label)) { + if (!isSingleChar) { + inner2.classes.push("cancel-pad"); + } + } else if (label === "angl") { + inner2.classes.push("anglpad"); + } else { + inner2.classes.push("boxpad"); + } + var topPad = 0; + var bottomPad = 0; + var ruleThickness = 0; + if (/box/.test(label)) { + ruleThickness = Math.max( + options3.fontMetrics().fboxrule, + // default + options3.minRuleThickness + // User override. + ); + topPad = options3.fontMetrics().fboxsep + (label === "colorbox" ? 0 : ruleThickness); + bottomPad = topPad; + } else if (label === "angl") { + ruleThickness = Math.max(options3.fontMetrics().defaultRuleThickness, options3.minRuleThickness); + topPad = 4 * ruleThickness; + bottomPad = Math.max(0, 0.25 - inner2.depth); + } else { + topPad = isSingleChar ? 0.2 : 0; + bottomPad = topPad; + } + img = stretchy.encloseSpan(inner2, label, topPad, bottomPad, options3); + if (/fbox|boxed|fcolorbox/.test(label)) { + img.style.borderStyle = "solid"; + img.style.borderWidth = makeEm(ruleThickness); + } else if (label === "angl" && ruleThickness !== 0.049) { + img.style.borderTopWidth = makeEm(ruleThickness); + img.style.borderRightWidth = makeEm(ruleThickness); + } + imgShift = inner2.depth + bottomPad; + if (group2.backgroundColor) { + img.style.backgroundColor = group2.backgroundColor; + if (group2.borderColor) { + img.style.borderColor = group2.borderColor; + } + } + } + var vlist; + if (group2.backgroundColor) { + vlist = buildCommon.makeVList({ + positionType: "individualShift", + children: [ + // Put the color background behind inner; + { + type: "elem", + elem: img, + shift: imgShift + }, + { + type: "elem", + elem: inner2, + shift: 0 + } + ] + }, options3); } else { - throw typeErrorCreate("toString is not a function"); + var classes6 = /cancel|phase/.test(label) ? ["svg-align"] : []; + vlist = buildCommon.makeVList({ + positionType: "individualShift", + children: [ + // Write the \cancel stroke on top of inner. + { + type: "elem", + elem: inner2, + shift: 0 + }, + { + type: "elem", + elem: img, + shift: imgShift, + wrapperClasses: classes6 + } + ] + }, options3); } - } - if (!DOMPurify.isSupported) { - return dirty; - } - if (!SET_CONFIG) { - _parseConfig(cfg); - } - DOMPurify.removed = []; - if (typeof dirty === "string") { - IN_PLACE = false; - } - if (IN_PLACE) { - if (dirty.nodeName) { - const tagName = transformCaseFunc(dirty.nodeName); - if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { - throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place"); - } + if (/cancel/.test(label)) { + vlist.height = inner2.height; + vlist.depth = inner2.depth; } - } else if (dirty instanceof Node) { - body = _initDocument(""); - importedNode = body.ownerDocument.importNode(dirty, true); - if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") { - body = importedNode; - } else if (importedNode.nodeName === "HTML") { - body = importedNode; + if (/cancel/.test(label) && !isSingleChar) { + return buildCommon.makeSpan(["mord", "cancel-lap"], [vlist], options3); } else { - body.appendChild(importedNode); - } - } else { - if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes - dirty.indexOf("<") === -1) { - return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; + return buildCommon.makeSpan(["mord"], [vlist], options3); + } + }, "htmlBuilder$7"); + mathmlBuilder$6 = /* @__PURE__ */ __name((group2, options3) => { + var fboxsep = 0; + var node2 = new mathMLTree.MathNode(group2.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup2(group2.body, options3)]); + switch (group2.label) { + case "\\cancel": + node2.setAttribute("notation", "updiagonalstrike"); + break; + case "\\bcancel": + node2.setAttribute("notation", "downdiagonalstrike"); + break; + case "\\phase": + node2.setAttribute("notation", "phasorangle"); + break; + case "\\sout": + node2.setAttribute("notation", "horizontalstrike"); + break; + case "\\fbox": + node2.setAttribute("notation", "box"); + break; + case "\\angl": + node2.setAttribute("notation", "actuarial"); + break; + case "\\fcolorbox": + case "\\colorbox": + fboxsep = options3.fontMetrics().fboxsep * options3.fontMetrics().ptPerEm; + node2.setAttribute("width", "+" + 2 * fboxsep + "pt"); + node2.setAttribute("height", "+" + 2 * fboxsep + "pt"); + node2.setAttribute("lspace", fboxsep + "pt"); + node2.setAttribute("voffset", fboxsep + "pt"); + if (group2.label === "\\fcolorbox") { + var thk = Math.max( + options3.fontMetrics().fboxrule, + // default + options3.minRuleThickness + // user override + ); + node2.setAttribute("style", "border: " + thk + "em solid " + String(group2.borderColor)); + } + break; + case "\\xcancel": + node2.setAttribute("notation", "updiagonalstrike downdiagonalstrike"); + break; } - body = _initDocument(dirty); - if (!body) { - return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ""; + if (group2.backgroundColor) { + node2.setAttribute("mathbackground", group2.backgroundColor); } - } - if (body && FORCE_BODY) { - _forceRemove(body.firstChild); - } - const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); - while (currentNode = nodeIterator.nextNode()) { - if (_sanitizeElements(currentNode)) { - continue; + return node2; + }, "mathmlBuilder$6"); + defineFunction({ + type: "enclose", + names: ["\\colorbox"], + props: { + numArgs: 2, + allowedInText: true, + argTypes: ["color", "text"] + }, + handler(_ref, args, optArgs) { + var { + parser: parser21, + funcName + } = _ref; + var color2 = assertNodeType(args[0], "color-token").color; + var body = args[1]; + return { + type: "enclose", + mode: parser21.mode, + label: funcName, + backgroundColor: color2, + body + }; + }, + htmlBuilder: htmlBuilder$7, + mathmlBuilder: mathmlBuilder$6 + }); + defineFunction({ + type: "enclose", + names: ["\\fcolorbox"], + props: { + numArgs: 3, + allowedInText: true, + argTypes: ["color", "color", "text"] + }, + handler(_ref2, args, optArgs) { + var { + parser: parser21, + funcName + } = _ref2; + var borderColor = assertNodeType(args[0], "color-token").color; + var backgroundColor = assertNodeType(args[1], "color-token").color; + var body = args[2]; + return { + type: "enclose", + mode: parser21.mode, + label: funcName, + backgroundColor, + borderColor, + body + }; + }, + htmlBuilder: htmlBuilder$7, + mathmlBuilder: mathmlBuilder$6 + }); + defineFunction({ + type: "enclose", + names: ["\\fbox"], + props: { + numArgs: 1, + argTypes: ["hbox"], + allowedInText: true + }, + handler(_ref3, args) { + var { + parser: parser21 + } = _ref3; + return { + type: "enclose", + mode: parser21.mode, + label: "\\fbox", + body: args[0] + }; } - if (currentNode.content instanceof DocumentFragment2) { - _sanitizeShadowDOM(currentNode.content); + }); + defineFunction({ + type: "enclose", + names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"], + props: { + numArgs: 1 + }, + handler(_ref4, args) { + var { + parser: parser21, + funcName + } = _ref4; + var body = args[0]; + return { + type: "enclose", + mode: parser21.mode, + label: funcName, + body + }; + }, + htmlBuilder: htmlBuilder$7, + mathmlBuilder: mathmlBuilder$6 + }); + defineFunction({ + type: "enclose", + names: ["\\angl"], + props: { + numArgs: 1, + argTypes: ["hbox"], + allowedInText: false + }, + handler(_ref5, args) { + var { + parser: parser21 + } = _ref5; + return { + type: "enclose", + mode: parser21.mode, + label: "\\angl", + body: args[0] + }; } - _sanitizeAttributes(currentNode); - } - if (IN_PLACE) { - return dirty; - } - if (RETURN_DOM) { - if (RETURN_DOM_FRAGMENT) { - returnNode = createDocumentFragment.call(body.ownerDocument); - while (body.firstChild) { - returnNode.appendChild(body.firstChild); + }); + _environments = {}; + __name(defineEnvironment, "defineEnvironment"); + _macros = {}; + __name(defineMacro, "defineMacro"); + __name(getHLines, "getHLines"); + validateAmsEnvironmentContext = /* @__PURE__ */ __name((context) => { + var settings = context.parser.settings; + if (!settings.displayMode) { + throw new ParseError("{" + context.envName + "} can be used only in display mode."); + } + }, "validateAmsEnvironmentContext"); + __name(getAutoTag, "getAutoTag"); + __name(parseArray, "parseArray"); + __name(dCellStyle, "dCellStyle"); + htmlBuilder$6 = /* @__PURE__ */ __name(function htmlBuilder(group2, options3) { + var r2; + var c3; + var nr = group2.body.length; + var hLinesBeforeRow = group2.hLinesBeforeRow; + var nc = 0; + var body = new Array(nr); + var hlines = []; + var ruleThickness = Math.max( + // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em. + options3.fontMetrics().arrayRuleWidth, + options3.minRuleThickness + // User override. + ); + var pt = 1 / options3.fontMetrics().ptPerEm; + var arraycolsep = 5 * pt; + if (group2.colSeparationType && group2.colSeparationType === "small") { + var localMultiplier = options3.havingStyle(Style$1.SCRIPT).sizeMultiplier; + arraycolsep = 0.2778 * (localMultiplier / options3.sizeMultiplier); + } + var baselineskip = group2.colSeparationType === "CD" ? calculateSize({ + number: 3, + unit: "ex" + }, options3) : 12 * pt; + var jot = 3 * pt; + var arrayskip = group2.arraystretch * baselineskip; + var arstrutHeight = 0.7 * arrayskip; + var arstrutDepth = 0.3 * arrayskip; + var totalHeight = 0; + function setHLinePos(hlinesInGap) { + for (var i2 = 0; i2 < hlinesInGap.length; ++i2) { + if (i2 > 0) { + totalHeight += 0.25; + } + hlines.push({ + pos: totalHeight, + isDashed: hlinesInGap[i2] + }); } - } else { - returnNode = body; } - if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { - returnNode = importNode.call(originalDocument, returnNode, true); + __name(setHLinePos, "setHLinePos"); + setHLinePos(hLinesBeforeRow[0]); + for (r2 = 0; r2 < group2.body.length; ++r2) { + var inrow = group2.body[r2]; + var height2 = arstrutHeight; + var depth = arstrutDepth; + if (nc < inrow.length) { + nc = inrow.length; + } + var outrow = new Array(inrow.length); + for (c3 = 0; c3 < inrow.length; ++c3) { + var elt = buildGroup$1(inrow[c3], options3); + if (depth < elt.depth) { + depth = elt.depth; + } + if (height2 < elt.height) { + height2 = elt.height; + } + outrow[c3] = elt; + } + var rowGap = group2.rowGaps[r2]; + var gap = 0; + if (rowGap) { + gap = calculateSize(rowGap, options3); + if (gap > 0) { + gap += arstrutDepth; + if (depth < gap) { + depth = gap; + } + gap = 0; + } + } + if (group2.addJot) { + depth += jot; + } + outrow.height = height2; + outrow.depth = depth; + totalHeight += height2; + outrow.pos = totalHeight; + totalHeight += depth + gap; + body[r2] = outrow; + setHLinePos(hLinesBeforeRow[r2 + 1]); + } + var offset = totalHeight / 2 + options3.fontMetrics().axisHeight; + var colDescriptions = group2.cols || []; + var cols = []; + var colSep; + var colDescrNum; + var tagSpans = []; + if (group2.tags && group2.tags.some((tag3) => tag3)) { + for (r2 = 0; r2 < nr; ++r2) { + var rw = body[r2]; + var shift2 = rw.pos - offset; + var tag2 = group2.tags[r2]; + var tagSpan = void 0; + if (tag2 === true) { + tagSpan = buildCommon.makeSpan(["eqn-num"], [], options3); + } else if (tag2 === false) { + tagSpan = buildCommon.makeSpan([], [], options3); + } else { + tagSpan = buildCommon.makeSpan([], buildExpression$1(tag2, options3, true), options3); + } + tagSpan.depth = rw.depth; + tagSpan.height = rw.height; + tagSpans.push({ + type: "elem", + elem: tagSpan, + shift: shift2 + }); + } } - return returnNode; - } - let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; - if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { - serializedHTML = "\n" + serializedHTML; - } - if (SAFE_FOR_TEMPLATES) { - arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { - serializedHTML = stringReplace(serializedHTML, expr, " "); - }); - } - return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; - }; - DOMPurify.setConfig = function() { - let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - _parseConfig(cfg); - SET_CONFIG = true; - }; - DOMPurify.clearConfig = function() { - CONFIG = null; - SET_CONFIG = false; - }; - DOMPurify.isValidAttribute = function(tag, attr, value2) { - if (!CONFIG) { - _parseConfig({}); - } - const lcTag = transformCaseFunc(tag); - const lcName = transformCaseFunc(attr); - return _isValidAttribute(lcTag, lcName, value2); - }; - DOMPurify.addHook = function(entryPoint, hookFunction) { - if (typeof hookFunction !== "function") { - return; - } - hooks[entryPoint] = hooks[entryPoint] || []; - arrayPush$1(hooks[entryPoint], hookFunction); - }; - DOMPurify.removeHook = function(entryPoint) { - if (hooks[entryPoint]) { - return arrayPop(hooks[entryPoint]); - } - }; - DOMPurify.removeHooks = function(entryPoint) { - if (hooks[entryPoint]) { - hooks[entryPoint] = []; - } - }; - DOMPurify.removeAllHooks = function() { - hooks = {}; - }; - return DOMPurify; - } - var purify = createDOMPurify(); - const lineBreakRegex = //gi; - const getRows = (s) => { - if (!s) { - return [""]; - } - const str2 = breakToPlaceholder(s).replace(/\\n/g, "#br#"); - return str2.split("#br#"); - }; - const setupDompurifyHooksIfNotSetup = (() => { - let setup = false; - return () => { - if (!setup) { - setupDompurifyHooks(); - setup = true; - } - }; - })(); - function setupDompurifyHooks() { - const TEMPORARY_ATTRIBUTE = "data-temp-href-target"; - purify.addHook("beforeSanitizeAttributes", (node2) => { - if (node2.tagName === "A" && node2.hasAttribute("target")) { - node2.setAttribute(TEMPORARY_ATTRIBUTE, node2.getAttribute("target") || ""); - } - }); - purify.addHook("afterSanitizeAttributes", (node2) => { - if (node2.tagName === "A" && node2.hasAttribute(TEMPORARY_ATTRIBUTE)) { - node2.setAttribute("target", node2.getAttribute(TEMPORARY_ATTRIBUTE) || ""); - node2.removeAttribute(TEMPORARY_ATTRIBUTE); - if (node2.getAttribute("target") === "_blank") { - node2.setAttribute("rel", "noopener"); - } - } - }); - } - const removeScript = (txt) => { - setupDompurifyHooksIfNotSetup(); - const sanitizedText = purify.sanitize(txt); - return sanitizedText; - }; - const sanitizeMore = (text2, config2) => { - var _a2; - if (((_a2 = config2.flowchart) == null ? void 0 : _a2.htmlLabels) !== false) { - const level = config2.securityLevel; - if (level === "antiscript" || level === "strict") { - text2 = removeScript(text2); - } else if (level !== "loose") { - text2 = breakToPlaceholder(text2); - text2 = text2.replace(//g, ">"); - text2 = text2.replace(/=/g, "="); - text2 = placeholderToBreak(text2); - } - } - return text2; - }; - const sanitizeText$6 = (text2, config2) => { - if (!text2) { - return text2; - } - if (config2.dompurifyConfig) { - text2 = purify.sanitize(sanitizeMore(text2, config2), config2.dompurifyConfig).toString(); - } else { - text2 = purify.sanitize(sanitizeMore(text2, config2), { - FORBID_TAGS: ["style"] - }).toString(); - } - return text2; - }; - const sanitizeTextOrArray = (a, config2) => { - if (typeof a === "string") { - return sanitizeText$6(a, config2); - } - return a.flat().map((x2) => sanitizeText$6(x2, config2)); - }; - const hasBreaks = (text2) => { - return lineBreakRegex.test(text2); - }; - const splitBreaks = (text2) => { - return text2.split(lineBreakRegex); - }; - const placeholderToBreak = (s) => { - return s.replace(/#br#/g, "
"); - }; - const breakToPlaceholder = (s) => { - return s.replace(lineBreakRegex, "#br#"); - }; - const getUrl = (useAbsolute) => { - let url = ""; - if (useAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replaceAll(/\(/g, "\\("); - url = url.replaceAll(/\)/g, "\\)"); - } - return url; - }; - const evaluate = (val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true; - const getMax = function(...values2) { - const newValues = values2.filter((value2) => { - return !isNaN(value2); - }); - return Math.max(...newValues); - }; - const getMin = function(...values2) { - const newValues = values2.filter((value2) => { - return !isNaN(value2); - }); - return Math.min(...newValues); - }; - const parseGenericTypes = function(input) { - const inputSets = input.split(/(,)/); - const output = []; - for (let i2 = 0; i2 < inputSets.length; i2++) { - let thisSet = inputSets[i2]; - if (thisSet === "," && i2 > 0 && i2 + 1 < inputSets.length) { - const previousSet = inputSets[i2 - 1]; - const nextSet = inputSets[i2 + 1]; - if (shouldCombineSets(previousSet, nextSet)) { - thisSet = previousSet + "," + nextSet; - i2++; - output.pop(); - } - } - output.push(processSet(thisSet)); - } - return output.join(""); - }; - const countOccurrence = (string2, substring) => { - return Math.max(0, string2.split(substring).length - 1); - }; - const shouldCombineSets = (previousSet, nextSet) => { - const prevCount = countOccurrence(previousSet, "~"); - const nextCount = countOccurrence(nextSet, "~"); - return prevCount === 1 && nextCount === 1; - }; - const processSet = (input) => { - const tildeCount = countOccurrence(input, "~"); - let hasStartingTilde = false; - if (tildeCount <= 1) { - return input; - } - if (tildeCount % 2 !== 0 && input.startsWith("~")) { - input = input.substring(1); - hasStartingTilde = true; - } - const chars = [...input]; - let first = chars.indexOf("~"); - let last2 = chars.lastIndexOf("~"); - while (first !== -1 && last2 !== -1 && first !== last2) { - chars[first] = "<"; - chars[last2] = ">"; - first = chars.indexOf("~"); - last2 = chars.lastIndexOf("~"); - } - if (hasStartingTilde) { - chars.unshift("~"); - } - return chars.join(""); - }; - const isMathMLSupported = () => window.MathMLElement !== void 0; - const katexRegex = /\$\$(.*)\$\$/g; - const hasKatex = (text2) => { - var _a2; - return (((_a2 = text2.match(katexRegex)) == null ? void 0 : _a2.length) ?? 0) > 0; - }; - const calculateMathMLDimensions = async (text2, config2) => { - text2 = await renderKatex(text2, config2); - const divElem = document.createElement("div"); - divElem.innerHTML = text2; - divElem.id = "katex-temp"; - divElem.style.visibility = "hidden"; - divElem.style.position = "absolute"; - divElem.style.top = "0"; - const body = document.querySelector("body"); - body == null ? void 0 : body.insertAdjacentElement("beforeend", divElem); - const dim = { width: divElem.clientWidth, height: divElem.clientHeight }; - divElem.remove(); - return dim; - }; - const renderKatex = async (text2, config2) => { - if (!hasKatex(text2)) { - return text2; - } - if (!isMathMLSupported() && !config2.legacyMathML) { - return text2.replace(katexRegex, "MathML is unsupported in this environment."); - } - const { default: katex2 } = await Promise.resolve().then(() => katex$1); - return text2.split(lineBreakRegex).map( - (line2) => hasKatex(line2) ? ` -
- ${line2} -
- ` : `
${line2}
` - ).join("").replace( - katexRegex, - (_2, c2) => katex2.renderToString(c2, { - throwOnError: true, - displayMode: true, - output: isMathMLSupported() ? "mathml" : "htmlAndMathml" - }).replace(/\n/g, " ").replace(//g, "") - ); - }; - const common$1 = { - getRows, - sanitizeText: sanitizeText$6, - sanitizeTextOrArray, - hasBreaks, - splitBreaks, - lineBreakRegex, - removeScript, - getUrl, - evaluate, - getMax, - getMin - }; - const Channel = { - /* CLAMP */ - min: { - r: 0, - g: 0, - b: 0, - s: 0, - l: 0, - a: 0 - }, - max: { - r: 255, - g: 255, - b: 255, - h: 360, - s: 100, - l: 100, - a: 1 - }, - clamp: { - r: (r) => r >= 255 ? 255 : r < 0 ? 0 : r, - g: (g) => g >= 255 ? 255 : g < 0 ? 0 : g, - b: (b) => b >= 255 ? 255 : b < 0 ? 0 : b, - h: (h) => h % 360, - s: (s) => s >= 100 ? 100 : s < 0 ? 0 : s, - l: (l) => l >= 100 ? 100 : l < 0 ? 0 : l, - a: (a) => a >= 1 ? 1 : a < 0 ? 0 : a - }, - /* CONVERSION */ - //SOURCE: https://planetcalc.com/7779 - toLinear: (c2) => { - const n = c2 / 255; - return c2 > 0.03928 ? Math.pow((n + 0.055) / 1.055, 2.4) : n / 12.92; - }, - //SOURCE: https://gist.github.com/mjackson/5311256 - hue2rgb: (p, q, t) => { - if (t < 0) - t += 1; - if (t > 1) - t -= 1; - if (t < 1 / 6) - return p + (q - p) * 6 * t; - if (t < 1 / 2) - return q; - if (t < 2 / 3) - return p + (q - p) * (2 / 3 - t) * 6; - return p; - }, - hsl2rgb: ({ h, s, l }, channel2) => { - if (!s) - return l * 2.55; - h /= 360; - s /= 100; - l /= 100; - const q = l < 0.5 ? l * (1 + s) : l + s - l * s; - const p = 2 * l - q; - switch (channel2) { - case "r": - return Channel.hue2rgb(p, q, h + 1 / 3) * 255; - case "g": - return Channel.hue2rgb(p, q, h) * 255; - case "b": - return Channel.hue2rgb(p, q, h - 1 / 3) * 255; - } - }, - rgb2hsl: ({ r, g, b }, channel2) => { - r /= 255; - g /= 255; - b /= 255; - const max2 = Math.max(r, g, b); - const min2 = Math.min(r, g, b); - const l = (max2 + min2) / 2; - if (channel2 === "l") - return l * 100; - if (max2 === min2) - return 0; - const d = max2 - min2; - const s = l > 0.5 ? d / (2 - max2 - min2) : d / (max2 + min2); - if (channel2 === "s") - return s * 100; - switch (max2) { - case r: - return ((g - b) / d + (g < b ? 6 : 0)) * 60; - case g: - return ((b - r) / d + 2) * 60; - case b: - return ((r - g) / d + 4) * 60; - default: - return -1; - } - } - }; - const channel$2 = Channel; - const Lang = { - /* API */ - clamp: (number2, lower2, upper) => { - if (lower2 > upper) - return Math.min(lower2, Math.max(upper, number2)); - return Math.min(upper, Math.max(lower2, number2)); - }, - round: (number2) => { - return Math.round(number2 * 1e10) / 1e10; - } - }; - const lang = Lang; - const Unit = { - /* API */ - dec2hex: (dec) => { - const hex2 = Math.round(dec).toString(16); - return hex2.length > 1 ? hex2 : `0${hex2}`; - } - }; - const unit = Unit; - const Utils = { - channel: channel$2, - lang, - unit - }; - const _ = Utils; - const DEC2HEX = {}; - for (let i2 = 0; i2 <= 255; i2++) - DEC2HEX[i2] = _.unit.dec2hex(i2); - const TYPE = { - ALL: 0, - RGB: 1, - HSL: 2 - }; - class Type { - constructor() { - this.type = TYPE.ALL; - } - /* API */ - get() { - return this.type; - } - set(type2) { - if (this.type && this.type !== type2) - throw new Error("Cannot change both RGB and HSL channels at the same time"); - this.type = type2; - } - reset() { - this.type = TYPE.ALL; - } - is(type2) { - return this.type === type2; - } - } - const Type$2 = Type; - class Channels { - /* CONSTRUCTOR */ - constructor(data, color2) { - this.color = color2; - this.changed = false; - this.data = data; - this.type = new Type$2(); - } - /* API */ - set(data, color2) { - this.color = color2; - this.changed = false; - this.data = data; - this.type.type = TYPE.ALL; - return this; - } - /* HELPERS */ - _ensureHSL() { - const data = this.data; - const { h, s, l } = data; - if (h === void 0) - data.h = _.channel.rgb2hsl(data, "h"); - if (s === void 0) - data.s = _.channel.rgb2hsl(data, "s"); - if (l === void 0) - data.l = _.channel.rgb2hsl(data, "l"); - } - _ensureRGB() { - const data = this.data; - const { r, g, b } = data; - if (r === void 0) - data.r = _.channel.hsl2rgb(data, "r"); - if (g === void 0) - data.g = _.channel.hsl2rgb(data, "g"); - if (b === void 0) - data.b = _.channel.hsl2rgb(data, "b"); - } - /* GETTERS */ - get r() { - const data = this.data; - const r = data.r; - if (!this.type.is(TYPE.HSL) && r !== void 0) - return r; - this._ensureHSL(); - return _.channel.hsl2rgb(data, "r"); - } - get g() { - const data = this.data; - const g = data.g; - if (!this.type.is(TYPE.HSL) && g !== void 0) - return g; - this._ensureHSL(); - return _.channel.hsl2rgb(data, "g"); - } - get b() { - const data = this.data; - const b = data.b; - if (!this.type.is(TYPE.HSL) && b !== void 0) - return b; - this._ensureHSL(); - return _.channel.hsl2rgb(data, "b"); - } - get h() { - const data = this.data; - const h = data.h; - if (!this.type.is(TYPE.RGB) && h !== void 0) - return h; - this._ensureRGB(); - return _.channel.rgb2hsl(data, "h"); - } - get s() { - const data = this.data; - const s = data.s; - if (!this.type.is(TYPE.RGB) && s !== void 0) - return s; - this._ensureRGB(); - return _.channel.rgb2hsl(data, "s"); - } - get l() { - const data = this.data; - const l = data.l; - if (!this.type.is(TYPE.RGB) && l !== void 0) - return l; - this._ensureRGB(); - return _.channel.rgb2hsl(data, "l"); - } - get a() { - return this.data.a; - } - /* SETTERS */ - set r(r) { - this.type.set(TYPE.RGB); - this.changed = true; - this.data.r = r; - } - set g(g) { - this.type.set(TYPE.RGB); - this.changed = true; - this.data.g = g; - } - set b(b) { - this.type.set(TYPE.RGB); - this.changed = true; - this.data.b = b; - } - set h(h) { - this.type.set(TYPE.HSL); - this.changed = true; - this.data.h = h; - } - set s(s) { - this.type.set(TYPE.HSL); - this.changed = true; - this.data.s = s; - } - set l(l) { - this.type.set(TYPE.HSL); - this.changed = true; - this.data.l = l; - } - set a(a) { - this.changed = true; - this.data.a = a; - } - } - const Channels$1 = Channels; - const channels = new Channels$1({ r: 0, g: 0, b: 0, a: 0 }, "transparent"); - const ChannelsReusable = channels; - const Hex = { - /* VARIABLES */ - re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i, - /* API */ - parse: (color2) => { - if (color2.charCodeAt(0) !== 35) - return; - const match = color2.match(Hex.re); - if (!match) - return; - const hex2 = match[1]; - const dec = parseInt(hex2, 16); - const length2 = hex2.length; - const hasAlpha = length2 % 4 === 0; - const isFullLength = length2 > 4; - const multiplier = isFullLength ? 1 : 17; - const bits = isFullLength ? 8 : 4; - const bitsOffset = hasAlpha ? 0 : -1; - const mask = isFullLength ? 255 : 15; - return ChannelsReusable.set({ - r: (dec >> bits * (bitsOffset + 3) & mask) * multiplier, - g: (dec >> bits * (bitsOffset + 2) & mask) * multiplier, - b: (dec >> bits * (bitsOffset + 1) & mask) * multiplier, - a: hasAlpha ? (dec & mask) * multiplier / 255 : 1 - }, color2); - }, - stringify: (channels2) => { - const { r, g, b, a } = channels2; - if (a < 1) { - return `#${DEC2HEX[Math.round(r)]}${DEC2HEX[Math.round(g)]}${DEC2HEX[Math.round(b)]}${DEC2HEX[Math.round(a * 255)]}`; - } else { - return `#${DEC2HEX[Math.round(r)]}${DEC2HEX[Math.round(g)]}${DEC2HEX[Math.round(b)]}`; - } - } - }; - const Hex$1 = Hex; - const HSL = { - /* VARIABLES */ - re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i, - hueRe: /^(.+?)(deg|grad|rad|turn)$/i, - /* HELPERS */ - _hue2deg: (hue2) => { - const match = hue2.match(HSL.hueRe); - if (match) { - const [, number2, unit2] = match; - switch (unit2) { - case "grad": - return _.channel.clamp.h(parseFloat(number2) * 0.9); - case "rad": - return _.channel.clamp.h(parseFloat(number2) * 180 / Math.PI); - case "turn": - return _.channel.clamp.h(parseFloat(number2) * 360); - } - } - return _.channel.clamp.h(parseFloat(hue2)); - }, - /* API */ - parse: (color2) => { - const charCode = color2.charCodeAt(0); - if (charCode !== 104 && charCode !== 72) - return; - const match = color2.match(HSL.re); - if (!match) - return; - const [, h, s, l, a, isAlphaPercentage] = match; - return ChannelsReusable.set({ - h: HSL._hue2deg(h), - s: _.channel.clamp.s(parseFloat(s)), - l: _.channel.clamp.l(parseFloat(l)), - a: a ? _.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1 - }, color2); - }, - stringify: (channels2) => { - const { h, s, l, a } = channels2; - if (a < 1) { - return `hsla(${_.lang.round(h)}, ${_.lang.round(s)}%, ${_.lang.round(l)}%, ${a})`; - } else { - return `hsl(${_.lang.round(h)}, ${_.lang.round(s)}%, ${_.lang.round(l)}%)`; - } - } - }; - const HSL$1 = HSL; - const Keyword = { - /* VARIABLES */ - colors: { - aliceblue: "#f0f8ff", - antiquewhite: "#faebd7", - aqua: "#00ffff", - aquamarine: "#7fffd4", - azure: "#f0ffff", - beige: "#f5f5dc", - bisque: "#ffe4c4", - black: "#000000", - blanchedalmond: "#ffebcd", - blue: "#0000ff", - blueviolet: "#8a2be2", - brown: "#a52a2a", - burlywood: "#deb887", - cadetblue: "#5f9ea0", - chartreuse: "#7fff00", - chocolate: "#d2691e", - coral: "#ff7f50", - cornflowerblue: "#6495ed", - cornsilk: "#fff8dc", - crimson: "#dc143c", - cyanaqua: "#00ffff", - darkblue: "#00008b", - darkcyan: "#008b8b", - darkgoldenrod: "#b8860b", - darkgray: "#a9a9a9", - darkgreen: "#006400", - darkgrey: "#a9a9a9", - darkkhaki: "#bdb76b", - darkmagenta: "#8b008b", - darkolivegreen: "#556b2f", - darkorange: "#ff8c00", - darkorchid: "#9932cc", - darkred: "#8b0000", - darksalmon: "#e9967a", - darkseagreen: "#8fbc8f", - darkslateblue: "#483d8b", - darkslategray: "#2f4f4f", - darkslategrey: "#2f4f4f", - darkturquoise: "#00ced1", - darkviolet: "#9400d3", - deeppink: "#ff1493", - deepskyblue: "#00bfff", - dimgray: "#696969", - dimgrey: "#696969", - dodgerblue: "#1e90ff", - firebrick: "#b22222", - floralwhite: "#fffaf0", - forestgreen: "#228b22", - fuchsia: "#ff00ff", - gainsboro: "#dcdcdc", - ghostwhite: "#f8f8ff", - gold: "#ffd700", - goldenrod: "#daa520", - gray: "#808080", - green: "#008000", - greenyellow: "#adff2f", - grey: "#808080", - honeydew: "#f0fff0", - hotpink: "#ff69b4", - indianred: "#cd5c5c", - indigo: "#4b0082", - ivory: "#fffff0", - khaki: "#f0e68c", - lavender: "#e6e6fa", - lavenderblush: "#fff0f5", - lawngreen: "#7cfc00", - lemonchiffon: "#fffacd", - lightblue: "#add8e6", - lightcoral: "#f08080", - lightcyan: "#e0ffff", - lightgoldenrodyellow: "#fafad2", - lightgray: "#d3d3d3", - lightgreen: "#90ee90", - lightgrey: "#d3d3d3", - lightpink: "#ffb6c1", - lightsalmon: "#ffa07a", - lightseagreen: "#20b2aa", - lightskyblue: "#87cefa", - lightslategray: "#778899", - lightslategrey: "#778899", - lightsteelblue: "#b0c4de", - lightyellow: "#ffffe0", - lime: "#00ff00", - limegreen: "#32cd32", - linen: "#faf0e6", - magenta: "#ff00ff", - maroon: "#800000", - mediumaquamarine: "#66cdaa", - mediumblue: "#0000cd", - mediumorchid: "#ba55d3", - mediumpurple: "#9370db", - mediumseagreen: "#3cb371", - mediumslateblue: "#7b68ee", - mediumspringgreen: "#00fa9a", - mediumturquoise: "#48d1cc", - mediumvioletred: "#c71585", - midnightblue: "#191970", - mintcream: "#f5fffa", - mistyrose: "#ffe4e1", - moccasin: "#ffe4b5", - navajowhite: "#ffdead", - navy: "#000080", - oldlace: "#fdf5e6", - olive: "#808000", - olivedrab: "#6b8e23", - orange: "#ffa500", - orangered: "#ff4500", - orchid: "#da70d6", - palegoldenrod: "#eee8aa", - palegreen: "#98fb98", - paleturquoise: "#afeeee", - palevioletred: "#db7093", - papayawhip: "#ffefd5", - peachpuff: "#ffdab9", - peru: "#cd853f", - pink: "#ffc0cb", - plum: "#dda0dd", - powderblue: "#b0e0e6", - purple: "#800080", - rebeccapurple: "#663399", - red: "#ff0000", - rosybrown: "#bc8f8f", - royalblue: "#4169e1", - saddlebrown: "#8b4513", - salmon: "#fa8072", - sandybrown: "#f4a460", - seagreen: "#2e8b57", - seashell: "#fff5ee", - sienna: "#a0522d", - silver: "#c0c0c0", - skyblue: "#87ceeb", - slateblue: "#6a5acd", - slategray: "#708090", - slategrey: "#708090", - snow: "#fffafa", - springgreen: "#00ff7f", - tan: "#d2b48c", - teal: "#008080", - thistle: "#d8bfd8", - transparent: "#00000000", - turquoise: "#40e0d0", - violet: "#ee82ee", - wheat: "#f5deb3", - white: "#ffffff", - whitesmoke: "#f5f5f5", - yellow: "#ffff00", - yellowgreen: "#9acd32" - }, - /* API */ - parse: (color2) => { - color2 = color2.toLowerCase(); - const hex2 = Keyword.colors[color2]; - if (!hex2) - return; - return Hex$1.parse(hex2); - }, - stringify: (channels2) => { - const hex2 = Hex$1.stringify(channels2); - for (const name in Keyword.colors) { - if (Keyword.colors[name] === hex2) - return name; - } - return; - } - }; - const Keyword$1 = Keyword; - const RGB = { - /* VARIABLES */ - re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i, - /* API */ - parse: (color2) => { - const charCode = color2.charCodeAt(0); - if (charCode !== 114 && charCode !== 82) - return; - const match = color2.match(RGB.re); - if (!match) - return; - const [, r, isRedPercentage, g, isGreenPercentage, b, isBluePercentage, a, isAlphaPercentage] = match; - return ChannelsReusable.set({ - r: _.channel.clamp.r(isRedPercentage ? parseFloat(r) * 2.55 : parseFloat(r)), - g: _.channel.clamp.g(isGreenPercentage ? parseFloat(g) * 2.55 : parseFloat(g)), - b: _.channel.clamp.b(isBluePercentage ? parseFloat(b) * 2.55 : parseFloat(b)), - a: a ? _.channel.clamp.a(isAlphaPercentage ? parseFloat(a) / 100 : parseFloat(a)) : 1 - }, color2); - }, - stringify: (channels2) => { - const { r, g, b, a } = channels2; - if (a < 1) { - return `rgba(${_.lang.round(r)}, ${_.lang.round(g)}, ${_.lang.round(b)}, ${_.lang.round(a)})`; - } else { - return `rgb(${_.lang.round(r)}, ${_.lang.round(g)}, ${_.lang.round(b)})`; - } - } - }; - const RGB$1 = RGB; - const Color = { - /* VARIABLES */ - format: { - keyword: Keyword$1, - hex: Hex$1, - rgb: RGB$1, - rgba: RGB$1, - hsl: HSL$1, - hsla: HSL$1 - }, - /* API */ - parse: (color2) => { - if (typeof color2 !== "string") - return color2; - const channels2 = Hex$1.parse(color2) || RGB$1.parse(color2) || HSL$1.parse(color2) || Keyword$1.parse(color2); - if (channels2) - return channels2; - throw new Error(`Unsupported color format: "${color2}"`); - }, - stringify: (channels2) => { - if (!channels2.changed && channels2.color) - return channels2.color; - if (channels2.type.is(TYPE.HSL) || channels2.data.r === void 0) { - return HSL$1.stringify(channels2); - } else if (channels2.a < 1 || !Number.isInteger(channels2.r) || !Number.isInteger(channels2.g) || !Number.isInteger(channels2.b)) { - return RGB$1.stringify(channels2); - } else { - return Hex$1.stringify(channels2); - } - } - }; - const Color$1 = Color; - const change = (color2, channels2) => { - const ch2 = Color$1.parse(color2); - for (const c2 in channels2) { - ch2[c2] = _.channel.clamp[c2](channels2[c2]); - } - return Color$1.stringify(ch2); - }; - const change$1 = change; - const rgba = (r, g, b = 0, a = 1) => { - if (typeof r !== "number") - return change$1(r, { a: g }); - const channels2 = ChannelsReusable.set({ - r: _.channel.clamp.r(r), - g: _.channel.clamp.g(g), - b: _.channel.clamp.b(b), - a: _.channel.clamp.a(a) - }); - return Color$1.stringify(channels2); - }; - const rgba$1 = rgba; - const channel = (color2, channel2) => { - return _.lang.round(Color$1.parse(color2)[channel2]); - }; - const channel$1 = channel; - const luminance = (color2) => { - const { r, g, b } = Color$1.parse(color2); - const luminance2 = 0.2126 * _.channel.toLinear(r) + 0.7152 * _.channel.toLinear(g) + 0.0722 * _.channel.toLinear(b); - return _.lang.round(luminance2); - }; - const luminance$1 = luminance; - const isLight = (color2) => { - return luminance$1(color2) >= 0.5; - }; - const isLight$1 = isLight; - const isDark = (color2) => { - return !isLight$1(color2); - }; - const isDark$1 = isDark; - const adjustChannel = (color2, channel2, amount) => { - const channels2 = Color$1.parse(color2); - const amountCurrent = channels2[channel2]; - const amountNext = _.channel.clamp[channel2](amountCurrent + amount); - if (amountCurrent !== amountNext) - channels2[channel2] = amountNext; - return Color$1.stringify(channels2); - }; - const adjustChannel$1 = adjustChannel; - const lighten = (color2, amount) => { - return adjustChannel$1(color2, "l", amount); - }; - const lighten$1 = lighten; - const darken = (color2, amount) => { - return adjustChannel$1(color2, "l", -amount); - }; - const darken$1 = darken; - const adjust$1 = (color2, channels2) => { - const ch2 = Color$1.parse(color2); - const changes = {}; - for (const c2 in channels2) { - if (!channels2[c2]) - continue; - changes[c2] = ch2[c2] + channels2[c2]; - } - return change$1(color2, changes); - }; - const adjust$2 = adjust$1; - const mix = (color1, color2, weight = 50) => { - const { r: r1, g: g1, b: b1, a: a1 } = Color$1.parse(color1); - const { r: r2, g: g2, b: b2, a: a2 } = Color$1.parse(color2); - const weightScale = weight / 100; - const weightNormalized = weightScale * 2 - 1; - const alphaDelta = a1 - a2; - const weight1combined = weightNormalized * alphaDelta === -1 ? weightNormalized : (weightNormalized + alphaDelta) / (1 + weightNormalized * alphaDelta); - const weight1 = (weight1combined + 1) / 2; - const weight2 = 1 - weight1; - const r = r1 * weight1 + r2 * weight2; - const g = g1 * weight1 + g2 * weight2; - const b = b1 * weight1 + b2 * weight2; - const a = a1 * weightScale + a2 * (1 - weightScale); - return rgba$1(r, g, b, a); - }; - const mix$1 = mix; - const invert = (color2, weight = 100) => { - const inverse = Color$1.parse(color2); - inverse.r = 255 - inverse.r; - inverse.g = 255 - inverse.g; - inverse.b = 255 - inverse.b; - return mix$1(inverse, color2, weight); - }; - const invert$1 = invert; - const mkBorder = (col, darkMode) => darkMode ? adjust$2(col, { s: -40, l: 10 }) : adjust$2(col, { s: -40, l: -10 }); - const oldAttributeBackgroundColorOdd = "#ffffff"; - const oldAttributeBackgroundColorEven = "#f2f2f2"; - let Theme$4 = class Theme { - constructor() { - this.background = "#f4f4f4"; - this.primaryColor = "#fff4dd"; - this.noteBkgColor = "#fff5ad"; - this.noteTextColor = "#333"; - this.THEME_COLOR_LIMIT = 12; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = "16px"; - } - updateColors() { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k; - this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333"); - this.secondaryColor = this.secondaryColor || adjust$2(this.primaryColor, { h: -120 }); - this.tertiaryColor = this.tertiaryColor || adjust$2(this.primaryColor, { h: 180, l: 5 }); - this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode); - this.secondaryBorderColor = this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode); - this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode); - this.noteBkgColor = this.noteBkgColor || "#fff5ad"; - this.noteTextColor = this.noteTextColor || "#333"; - this.secondaryTextColor = this.secondaryTextColor || invert$1(this.secondaryColor); - this.tertiaryTextColor = this.tertiaryTextColor || invert$1(this.tertiaryColor); - this.lineColor = this.lineColor || invert$1(this.background); - this.arrowheadColor = this.arrowheadColor || invert$1(this.background); - this.textColor = this.textColor || this.primaryTextColor; - this.border2 = this.border2 || this.tertiaryBorderColor; - this.nodeBkg = this.nodeBkg || this.primaryColor; - this.mainBkg = this.mainBkg || this.primaryColor; - this.nodeBorder = this.nodeBorder || this.primaryBorderColor; - this.clusterBkg = this.clusterBkg || this.tertiaryColor; - this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor; - this.defaultLinkColor = this.defaultLinkColor || this.lineColor; - this.titleColor = this.titleColor || this.tertiaryTextColor; - this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? darken$1(this.secondaryColor, 30) : this.secondaryColor); - this.nodeTextColor = this.nodeTextColor || this.primaryTextColor; - this.actorBorder = this.actorBorder || this.primaryBorderColor; - this.actorBkg = this.actorBkg || this.mainBkg; - this.actorTextColor = this.actorTextColor || this.primaryTextColor; - this.actorLineColor = this.actorLineColor || "grey"; - this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg; - this.signalColor = this.signalColor || this.textColor; - this.signalTextColor = this.signalTextColor || this.textColor; - this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder; - this.labelTextColor = this.labelTextColor || this.actorTextColor; - this.loopTextColor = this.loopTextColor || this.actorTextColor; - this.activationBorderColor = this.activationBorderColor || darken$1(this.secondaryColor, 10); - this.activationBkgColor = this.activationBkgColor || this.secondaryColor; - this.sequenceNumberColor = this.sequenceNumberColor || invert$1(this.lineColor); - this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor; - this.altSectionBkgColor = this.altSectionBkgColor || "white"; - this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor; - this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor; - this.excludeBkgColor = this.excludeBkgColor || "#eeeeee"; - this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor; - this.taskBkgColor = this.taskBkgColor || this.primaryColor; - this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor; - this.activeTaskBkgColor = this.activeTaskBkgColor || lighten$1(this.primaryColor, 23); - this.gridColor = this.gridColor || "lightgrey"; - this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey"; - this.doneTaskBorderColor = this.doneTaskBorderColor || "grey"; - this.critBorderColor = this.critBorderColor || "#ff8888"; - this.critBkgColor = this.critBkgColor || "red"; - this.todayLineColor = this.todayLineColor || "red"; - this.taskTextColor = this.taskTextColor || this.textColor; - this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor; - this.taskTextLightColor = this.taskTextLightColor || this.textColor; - this.taskTextColor = this.taskTextColor || this.primaryTextColor; - this.taskTextDarkColor = this.taskTextDarkColor || this.textColor; - this.taskTextClickableColor = this.taskTextClickableColor || "#003163"; - this.personBorder = this.personBorder || this.primaryBorderColor; - this.personBkg = this.personBkg || this.mainBkg; - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || this.tertiaryColor; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.nodeBorder; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.transitionColor = this.transitionColor || this.lineColor; - this.specialStateColor = this.lineColor; - this.cScale0 = this.cScale0 || this.primaryColor; - this.cScale1 = this.cScale1 || this.secondaryColor; - this.cScale2 = this.cScale2 || this.tertiaryColor; - this.cScale3 = this.cScale3 || adjust$2(this.primaryColor, { h: 30 }); - this.cScale4 = this.cScale4 || adjust$2(this.primaryColor, { h: 60 }); - this.cScale5 = this.cScale5 || adjust$2(this.primaryColor, { h: 90 }); - this.cScale6 = this.cScale6 || adjust$2(this.primaryColor, { h: 120 }); - this.cScale7 = this.cScale7 || adjust$2(this.primaryColor, { h: 150 }); - this.cScale8 = this.cScale8 || adjust$2(this.primaryColor, { h: 210, l: 150 }); - this.cScale9 = this.cScale9 || adjust$2(this.primaryColor, { h: 270 }); - this.cScale10 = this.cScale10 || adjust$2(this.primaryColor, { h: 300 }); - this.cScale11 = this.cScale11 || adjust$2(this.primaryColor, { h: 330 }); - if (this.darkMode) { - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScale" + i2] = darken$1(this["cScale" + i2], 75); - } - } else { - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScale" + i2] = darken$1(this["cScale" + i2], 25); + for ( + c3 = 0, colDescrNum = 0; + // Continue while either there are more columns or more column + // descriptions, so trailing separators don't get lost. + c3 < nc || colDescrNum < colDescriptions.length; + ++c3, ++colDescrNum + ) { + var colDescr = colDescriptions[colDescrNum] || {}; + var firstSeparator = true; + while (colDescr.type === "separator") { + if (!firstSeparator) { + colSep = buildCommon.makeSpan(["arraycolsep"], []); + colSep.style.width = makeEm(options3.fontMetrics().doubleRuleSep); + cols.push(colSep); + } + if (colDescr.separator === "|" || colDescr.separator === ":") { + var lineType3 = colDescr.separator === "|" ? "solid" : "dashed"; + var separator = buildCommon.makeSpan(["vertical-separator"], [], options3); + separator.style.height = makeEm(totalHeight); + separator.style.borderRightWidth = makeEm(ruleThickness); + separator.style.borderRightStyle = lineType3; + separator.style.margin = "0 " + makeEm(-ruleThickness / 2); + var _shift = totalHeight - offset; + if (_shift) { + separator.style.verticalAlign = makeEm(-_shift); + } + cols.push(separator); + } else { + throw new ParseError("Invalid separator type: " + colDescr.separator); + } + colDescrNum++; + colDescr = colDescriptions[colDescrNum] || {}; + firstSeparator = false; + } + if (c3 >= nc) { + continue; + } + var sepwidth = void 0; + if (c3 > 0 || group2.hskipBeforeAndAfter) { + sepwidth = utils.deflt(colDescr.pregap, arraycolsep); + if (sepwidth !== 0) { + colSep = buildCommon.makeSpan(["arraycolsep"], []); + colSep.style.width = makeEm(sepwidth); + cols.push(colSep); + } + } + var col = []; + for (r2 = 0; r2 < nr; ++r2) { + var row = body[r2]; + var elem = row[c3]; + if (!elem) { + continue; + } + var _shift2 = row.pos - offset; + elem.depth = row.depth; + elem.height = row.height; + col.push({ + type: "elem", + elem, + shift: _shift2 + }); + } + col = buildCommon.makeVList({ + positionType: "individualShift", + children: col + }, options3); + col = buildCommon.makeSpan(["col-align-" + (colDescr.align || "c")], [col]); + cols.push(col); + if (c3 < nc - 1 || group2.hskipBeforeAndAfter) { + sepwidth = utils.deflt(colDescr.postgap, arraycolsep); + if (sepwidth !== 0) { + colSep = buildCommon.makeSpan(["arraycolsep"], []); + colSep.style.width = makeEm(sepwidth); + cols.push(colSep); + } + } + } + body = buildCommon.makeSpan(["mtable"], cols); + if (hlines.length > 0) { + var line2 = buildCommon.makeLineSpan("hline", options3, ruleThickness); + var dashes = buildCommon.makeLineSpan("hdashline", options3, ruleThickness); + var vListElems = [{ + type: "elem", + elem: body, + shift: 0 + }]; + while (hlines.length > 0) { + var hline = hlines.pop(); + var lineShift = hline.pos - offset; + if (hline.isDashed) { + vListElems.push({ + type: "elem", + elem: dashes, + shift: lineShift + }); + } else { + vListElems.push({ + type: "elem", + elem: line2, + shift: lineShift + }); + } + } + body = buildCommon.makeVList({ + positionType: "individualShift", + children: vListElems + }, options3); } - } - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert$1(this["cScale" + i2]); - } - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - if (this.darkMode) { - this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten$1(this["cScale" + i2], 10); + if (tagSpans.length === 0) { + return buildCommon.makeSpan(["mord"], [body], options3); } else { - this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken$1(this["cScale" + i2], 10); - } - } - this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor; - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; - } - const multiplier = this.darkMode ? -4 : -1; - for (let i2 = 0; i2 < 5; i2++) { - this["surface" + i2] = this["surface" + i2] || adjust$2(this.mainBkg, { h: 180, s: -15, l: multiplier * (5 + i2 * 3) }); - this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust$2(this.mainBkg, { h: 180, s: -15, l: multiplier * (8 + i2 * 3) }); - } - this.classText = this.classText || this.textColor; - this.fillType0 = this.fillType0 || this.primaryColor; - this.fillType1 = this.fillType1 || this.secondaryColor; - this.fillType2 = this.fillType2 || adjust$2(this.primaryColor, { h: 64 }); - this.fillType3 = this.fillType3 || adjust$2(this.secondaryColor, { h: 64 }); - this.fillType4 = this.fillType4 || adjust$2(this.primaryColor, { h: -64 }); - this.fillType5 = this.fillType5 || adjust$2(this.secondaryColor, { h: -64 }); - this.fillType6 = this.fillType6 || adjust$2(this.primaryColor, { h: 128 }); - this.fillType7 = this.fillType7 || adjust$2(this.secondaryColor, { h: 128 }); - this.pie1 = this.pie1 || this.primaryColor; - this.pie2 = this.pie2 || this.secondaryColor; - this.pie3 = this.pie3 || this.tertiaryColor; - this.pie4 = this.pie4 || adjust$2(this.primaryColor, { l: -10 }); - this.pie5 = this.pie5 || adjust$2(this.secondaryColor, { l: -10 }); - this.pie6 = this.pie6 || adjust$2(this.tertiaryColor, { l: -10 }); - this.pie7 = this.pie7 || adjust$2(this.primaryColor, { h: 60, l: -10 }); - this.pie8 = this.pie8 || adjust$2(this.primaryColor, { h: -60, l: -10 }); - this.pie9 = this.pie9 || adjust$2(this.primaryColor, { h: 120, l: 0 }); - this.pie10 = this.pie10 || adjust$2(this.primaryColor, { h: 60, l: -20 }); - this.pie11 = this.pie11 || adjust$2(this.primaryColor, { h: -60, l: -20 }); - this.pie12 = this.pie12 || adjust$2(this.primaryColor, { h: 120, l: -10 }); - this.pieTitleTextSize = this.pieTitleTextSize || "25px"; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || "17px"; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || "17px"; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || "black"; - this.pieStrokeWidth = this.pieStrokeWidth || "2px"; - this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; - this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; - this.pieOpacity = this.pieOpacity || "0.7"; - this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; - this.quadrant2Fill = this.quadrant2Fill || adjust$2(this.primaryColor, { r: 5, g: 5, b: 5 }); - this.quadrant3Fill = this.quadrant3Fill || adjust$2(this.primaryColor, { r: 10, g: 10, b: 10 }); - this.quadrant4Fill = this.quadrant4Fill || adjust$2(this.primaryColor, { r: 15, g: 15, b: 15 }); - this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; - this.quadrant2TextFill = this.quadrant2TextFill || adjust$2(this.primaryTextColor, { r: -5, g: -5, b: -5 }); - this.quadrant3TextFill = this.quadrant3TextFill || adjust$2(this.primaryTextColor, { r: -10, g: -10, b: -10 }); - this.quadrant4TextFill = this.quadrant4TextFill || adjust$2(this.primaryTextColor, { r: -15, g: -15, b: -15 }); - this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill); - this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; - this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; - this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; - this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; - this.xyChart = { - backgroundColor: ((_a2 = this.xyChart) == null ? void 0 : _a2.backgroundColor) || this.background, - titleColor: ((_b2 = this.xyChart) == null ? void 0 : _b2.titleColor) || this.primaryTextColor, - xAxisTitleColor: ((_c = this.xyChart) == null ? void 0 : _c.xAxisTitleColor) || this.primaryTextColor, - xAxisLabelColor: ((_d = this.xyChart) == null ? void 0 : _d.xAxisLabelColor) || this.primaryTextColor, - xAxisTickColor: ((_e = this.xyChart) == null ? void 0 : _e.xAxisTickColor) || this.primaryTextColor, - xAxisLineColor: ((_f = this.xyChart) == null ? void 0 : _f.xAxisLineColor) || this.primaryTextColor, - yAxisTitleColor: ((_g = this.xyChart) == null ? void 0 : _g.yAxisTitleColor) || this.primaryTextColor, - yAxisLabelColor: ((_h = this.xyChart) == null ? void 0 : _h.yAxisLabelColor) || this.primaryTextColor, - yAxisTickColor: ((_i6 = this.xyChart) == null ? void 0 : _i6.yAxisTickColor) || this.primaryTextColor, - yAxisLineColor: ((_j = this.xyChart) == null ? void 0 : _j.yAxisLineColor) || this.primaryTextColor, - plotColorPalette: ((_k = this.xyChart) == null ? void 0 : _k.plotColorPalette) || "#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0" - }; - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || "1"; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken$1(this.secondaryColor, 30) : this.secondaryColor); - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; - this.git0 = this.git0 || this.primaryColor; - this.git1 = this.git1 || this.secondaryColor; - this.git2 = this.git2 || this.tertiaryColor; - this.git3 = this.git3 || adjust$2(this.primaryColor, { h: -30 }); - this.git4 = this.git4 || adjust$2(this.primaryColor, { h: -60 }); - this.git5 = this.git5 || adjust$2(this.primaryColor, { h: -90 }); - this.git6 = this.git6 || adjust$2(this.primaryColor, { h: 60 }); - this.git7 = this.git7 || adjust$2(this.primaryColor, { h: 120 }); - if (this.darkMode) { - this.git0 = lighten$1(this.git0, 25); - this.git1 = lighten$1(this.git1, 25); - this.git2 = lighten$1(this.git2, 25); - this.git3 = lighten$1(this.git3, 25); - this.git4 = lighten$1(this.git4, 25); - this.git5 = lighten$1(this.git5, 25); - this.git6 = lighten$1(this.git6, 25); - this.git7 = lighten$1(this.git7, 25); - } else { - this.git0 = darken$1(this.git0, 25); - this.git1 = darken$1(this.git1, 25); - this.git2 = darken$1(this.git2, 25); - this.git3 = darken$1(this.git3, 25); - this.git4 = darken$1(this.git4, 25); - this.git5 = darken$1(this.git5, 25); - this.git6 = darken$1(this.git6, 25); - this.git7 = darken$1(this.git7, 25); - } - this.gitInv0 = this.gitInv0 || invert$1(this.git0); - this.gitInv1 = this.gitInv1 || invert$1(this.git1); - this.gitInv2 = this.gitInv2 || invert$1(this.git2); - this.gitInv3 = this.gitInv3 || invert$1(this.git3); - this.gitInv4 = this.gitInv4 || invert$1(this.git4); - this.gitInv5 = this.gitInv5 || invert$1(this.git5); - this.gitInv6 = this.gitInv6 || invert$1(this.git6); - this.gitInv7 = this.gitInv7 || invert$1(this.git7); - this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor); - this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor; - this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor; - this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor; - this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor; - this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor; - this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor; - this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor; - this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor; - this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; - this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; - this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; - this.tagLabelFontSize = this.tagLabelFontSize || "10px"; - this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; - this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; - this.commitLabelFontSize = this.commitLabelFontSize || "10px"; - this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; - this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; - } - calculate(overrides) { - if (typeof overrides !== "object") { - this.updateColors(); - return; - } - const keys2 = Object.keys(overrides); - keys2.forEach((k) => { - this[k] = overrides[k]; + var eqnNumCol = buildCommon.makeVList({ + positionType: "individualShift", + children: tagSpans + }, options3); + eqnNumCol = buildCommon.makeSpan(["tag"], [eqnNumCol], options3); + return buildCommon.makeFragment([body, eqnNumCol]); + } + }, "htmlBuilder"); + alignMap = { + c: "center ", + l: "left ", + r: "right " + }; + mathmlBuilder$5 = /* @__PURE__ */ __name(function mathmlBuilder(group2, options3) { + var tbl = []; + var glue = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]); + var tag2 = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]); + for (var i2 = 0; i2 < group2.body.length; i2++) { + var rw = group2.body[i2]; + var row = []; + for (var j2 = 0; j2 < rw.length; j2++) { + row.push(new mathMLTree.MathNode("mtd", [buildGroup2(rw[j2], options3)])); + } + if (group2.tags && group2.tags[i2]) { + row.unshift(glue); + row.push(glue); + if (group2.leqno) { + row.unshift(tag2); + } else { + row.push(tag2); + } + } + tbl.push(new mathMLTree.MathNode("mtr", row)); + } + var table = new mathMLTree.MathNode("mtable", tbl); + var gap = group2.arraystretch === 0.5 ? 0.1 : 0.16 + group2.arraystretch - 1 + (group2.addJot ? 0.09 : 0); + table.setAttribute("rowspacing", makeEm(gap)); + var menclose = ""; + var align = ""; + if (group2.cols && group2.cols.length > 0) { + var cols = group2.cols; + var columnLines = ""; + var prevTypeWasAlign = false; + var iStart = 0; + var iEnd = cols.length; + if (cols[0].type === "separator") { + menclose += "top "; + iStart = 1; + } + if (cols[cols.length - 1].type === "separator") { + menclose += "bottom "; + iEnd -= 1; + } + for (var _i = iStart; _i < iEnd; _i++) { + if (cols[_i].type === "align") { + align += alignMap[cols[_i].align]; + if (prevTypeWasAlign) { + columnLines += "none "; + } + prevTypeWasAlign = true; + } else if (cols[_i].type === "separator") { + if (prevTypeWasAlign) { + columnLines += cols[_i].separator === "|" ? "solid " : "dashed "; + prevTypeWasAlign = false; + } + } + } + table.setAttribute("columnalign", align.trim()); + if (/[sd]/.test(columnLines)) { + table.setAttribute("columnlines", columnLines.trim()); + } + } + if (group2.colSeparationType === "align") { + var _cols = group2.cols || []; + var spacing2 = ""; + for (var _i2 = 1; _i2 < _cols.length; _i2++) { + spacing2 += _i2 % 2 ? "0em " : "1em "; + } + table.setAttribute("columnspacing", spacing2.trim()); + } else if (group2.colSeparationType === "alignat" || group2.colSeparationType === "gather") { + table.setAttribute("columnspacing", "0em"); + } else if (group2.colSeparationType === "small") { + table.setAttribute("columnspacing", "0.2778em"); + } else if (group2.colSeparationType === "CD") { + table.setAttribute("columnspacing", "0.5em"); + } else { + table.setAttribute("columnspacing", "1em"); + } + var rowLines = ""; + var hlines = group2.hLinesBeforeRow; + menclose += hlines[0].length > 0 ? "left " : ""; + menclose += hlines[hlines.length - 1].length > 0 ? "right " : ""; + for (var _i3 = 1; _i3 < hlines.length - 1; _i3++) { + rowLines += hlines[_i3].length === 0 ? "none " : hlines[_i3][0] ? "dashed " : "solid "; + } + if (/[sd]/.test(rowLines)) { + table.setAttribute("rowlines", rowLines.trim()); + } + if (menclose !== "") { + table = new mathMLTree.MathNode("menclose", [table]); + table.setAttribute("notation", menclose.trim()); + } + if (group2.arraystretch && group2.arraystretch < 1) { + table = new mathMLTree.MathNode("mstyle", [table]); + table.setAttribute("scriptlevel", "1"); + } + return table; + }, "mathmlBuilder"); + alignedHandler = /* @__PURE__ */ __name(function alignedHandler2(context, args) { + if (context.envName.indexOf("ed") === -1) { + validateAmsEnvironmentContext(context); + } + var cols = []; + var separationType = context.envName.indexOf("at") > -1 ? "alignat" : "align"; + var isSplit = context.envName === "split"; + var res = parseArray(context.parser, { + cols, + addJot: true, + autoTag: isSplit ? void 0 : getAutoTag(context.envName), + emptySingleRow: true, + colSeparationType: separationType, + maxNumCols: isSplit ? 2 : void 0, + leqno: context.parser.settings.leqno + }, "display"); + var numMaths; + var numCols = 0; + var emptyGroup = { + type: "ordgroup", + mode: context.mode, + body: [] + }; + if (args[0] && args[0].type === "ordgroup") { + var arg0 = ""; + for (var i2 = 0; i2 < args[0].body.length; i2++) { + var textord2 = assertNodeType(args[0].body[i2], "textord"); + arg0 += textord2.text; + } + numMaths = Number(arg0); + numCols = numMaths * 2; + } + var isAligned = !numCols; + res.body.forEach(function(row) { + for (var _i4 = 1; _i4 < row.length; _i4 += 2) { + var styling = assertNodeType(row[_i4], "styling"); + var ordgroup = assertNodeType(styling.body[0], "ordgroup"); + ordgroup.body.unshift(emptyGroup); + } + if (!isAligned) { + var curMaths = row.length / 2; + if (numMaths < curMaths) { + throw new ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]); + } + } else if (numCols < row.length) { + numCols = row.length; + } + }); + for (var _i5 = 0; _i5 < numCols; ++_i5) { + var align = "r"; + var pregap = 0; + if (_i5 % 2 === 1) { + align = "l"; + } else if (_i5 > 0 && isAligned) { + pregap = 1; + } + cols[_i5] = { + type: "align", + align, + pregap, + postgap: 0 + }; + } + res.colSeparationType = isAligned ? "align" : "alignat"; + return res; + }, "alignedHandler"); + defineEnvironment({ + type: "array", + names: ["array", "darray"], + props: { + numArgs: 1 + }, + handler(context, args) { + var symNode = checkSymbolNodeType(args[0]); + var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; + var cols = colalign.map(function(nde) { + var node2 = assertSymbolNodeType(nde); + var ca = node2.text; + if ("lcr".indexOf(ca) !== -1) { + return { + type: "align", + align: ca + }; + } else if (ca === "|") { + return { + type: "separator", + separator: "|" + }; + } else if (ca === ":") { + return { + type: "separator", + separator: ":" + }; + } + throw new ParseError("Unknown column alignment: " + ca, nde); + }); + var res = { + cols, + hskipBeforeAndAfter: true, + // \@preamble in lttab.dtx + maxNumCols: cols.length + }; + return parseArray(context.parser, res, dCellStyle(context.envName)); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"], + props: { + numArgs: 0 + }, + handler(context) { + var delimiters2 = { + "matrix": null, + "pmatrix": ["(", ")"], + "bmatrix": ["[", "]"], + "Bmatrix": ["\\{", "\\}"], + "vmatrix": ["|", "|"], + "Vmatrix": ["\\Vert", "\\Vert"] + }[context.envName.replace("*", "")]; + var colAlign = "c"; + var payload = { + hskipBeforeAndAfter: false, + cols: [{ + type: "align", + align: colAlign + }] + }; + if (context.envName.charAt(context.envName.length - 1) === "*") { + var parser21 = context.parser; + parser21.consumeSpaces(); + if (parser21.fetch().text === "[") { + parser21.consume(); + parser21.consumeSpaces(); + colAlign = parser21.fetch().text; + if ("lcr".indexOf(colAlign) === -1) { + throw new ParseError("Expected l or c or r", parser21.nextToken); + } + parser21.consume(); + parser21.consumeSpaces(); + parser21.expect("]"); + parser21.consume(); + payload.cols = [{ + type: "align", + align: colAlign + }]; + } + } + var res = parseArray(context.parser, payload, dCellStyle(context.envName)); + var numCols = Math.max(0, ...res.body.map((row) => row.length)); + res.cols = new Array(numCols).fill({ + type: "align", + align: colAlign + }); + return delimiters2 ? { + type: "leftright", + mode: context.mode, + body: [res], + left: delimiters2[0], + right: delimiters2[1], + rightColor: void 0 + // \right uninfluenced by \color in array + } : res; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - } - }; - const getThemeVariables$4 = (userOverrides) => { - const theme2 = new Theme$4(); - theme2.calculate(userOverrides); - return theme2; - }; - let Theme$3 = class Theme { - constructor() { - this.background = "#333"; - this.primaryColor = "#1f2020"; - this.secondaryColor = lighten$1(this.primaryColor, 16); - this.tertiaryColor = adjust$2(this.primaryColor, { h: -160 }); - this.primaryBorderColor = invert$1(this.background); - this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); - this.primaryTextColor = invert$1(this.primaryColor); - this.secondaryTextColor = invert$1(this.secondaryColor); - this.tertiaryTextColor = invert$1(this.tertiaryColor); - this.lineColor = invert$1(this.background); - this.textColor = invert$1(this.background); - this.mainBkg = "#1f2020"; - this.secondBkg = "calculated"; - this.mainContrastColor = "lightgrey"; - this.darkTextColor = lighten$1(invert$1("#323D47"), 10); - this.lineColor = "calculated"; - this.border1 = "#81B1DB"; - this.border2 = rgba$1(255, 255, 255, 0.25); - this.arrowheadColor = "calculated"; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = "16px"; - this.labelBackground = "#181818"; - this.textColor = "#ccc"; - this.THEME_COLOR_LIMIT = 12; - this.nodeBkg = "calculated"; - this.nodeBorder = "calculated"; - this.clusterBkg = "calculated"; - this.clusterBorder = "calculated"; - this.defaultLinkColor = "calculated"; - this.titleColor = "#F9FFFE"; - this.edgeLabelBackground = "calculated"; - this.actorBorder = "calculated"; - this.actorBkg = "calculated"; - this.actorTextColor = "calculated"; - this.actorLineColor = "calculated"; - this.signalColor = "calculated"; - this.signalTextColor = "calculated"; - this.labelBoxBkgColor = "calculated"; - this.labelBoxBorderColor = "calculated"; - this.labelTextColor = "calculated"; - this.loopTextColor = "calculated"; - this.noteBorderColor = "calculated"; - this.noteBkgColor = "#fff5ad"; - this.noteTextColor = "calculated"; - this.activationBorderColor = "calculated"; - this.activationBkgColor = "calculated"; - this.sequenceNumberColor = "black"; - this.sectionBkgColor = darken$1("#EAE8D9", 30); - this.altSectionBkgColor = "calculated"; - this.sectionBkgColor2 = "#EAE8D9"; - this.excludeBkgColor = darken$1(this.sectionBkgColor, 10); - this.taskBorderColor = rgba$1(255, 255, 255, 70); - this.taskBkgColor = "calculated"; - this.taskTextColor = "calculated"; - this.taskTextLightColor = "calculated"; - this.taskTextOutsideColor = "calculated"; - this.taskTextClickableColor = "#003163"; - this.activeTaskBorderColor = rgba$1(255, 255, 255, 50); - this.activeTaskBkgColor = "#81B1DB"; - this.gridColor = "calculated"; - this.doneTaskBkgColor = "calculated"; - this.doneTaskBorderColor = "grey"; - this.critBorderColor = "#E83737"; - this.critBkgColor = "#E83737"; - this.taskTextDarkColor = "calculated"; - this.todayLineColor = "#DB5757"; - this.personBorder = this.primaryBorderColor; - this.personBkg = this.mainBkg; - this.labelColor = "calculated"; - this.errorBkgColor = "#a44141"; - this.errorTextColor = "#ddd"; - } - updateColors() { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k; - this.secondBkg = lighten$1(this.mainBkg, 16); - this.lineColor = this.mainContrastColor; - this.arrowheadColor = this.mainContrastColor; - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.edgeLabelBackground = lighten$1(this.labelBackground, 25); - this.actorBorder = this.border1; - this.actorBkg = this.mainBkg; - this.actorTextColor = this.mainContrastColor; - this.actorLineColor = this.mainContrastColor; - this.signalColor = this.mainContrastColor; - this.signalTextColor = this.mainContrastColor; - this.labelBoxBkgColor = this.actorBkg; - this.labelBoxBorderColor = this.actorBorder; - this.labelTextColor = this.mainContrastColor; - this.loopTextColor = this.mainContrastColor; - this.noteBorderColor = this.secondaryBorderColor; - this.noteBkgColor = this.secondBkg; - this.noteTextColor = this.secondaryTextColor; - this.activationBorderColor = this.border1; - this.activationBkgColor = this.secondBkg; - this.altSectionBkgColor = this.background; - this.taskBkgColor = lighten$1(this.mainBkg, 23); - this.taskTextColor = this.darkTextColor; - this.taskTextLightColor = this.mainContrastColor; - this.taskTextOutsideColor = this.taskTextLightColor; - this.gridColor = this.mainContrastColor; - this.doneTaskBkgColor = this.mainContrastColor; - this.taskTextDarkColor = this.darkTextColor; - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || "#555"; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.primaryBorderColor; - this.specialStateColor = "#f4f4f4"; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = adjust$2(this.primaryColor, { h: 64 }); - this.fillType3 = adjust$2(this.secondaryColor, { h: 64 }); - this.fillType4 = adjust$2(this.primaryColor, { h: -64 }); - this.fillType5 = adjust$2(this.secondaryColor, { h: -64 }); - this.fillType6 = adjust$2(this.primaryColor, { h: 128 }); - this.fillType7 = adjust$2(this.secondaryColor, { h: 128 }); - this.cScale1 = this.cScale1 || "#0b0000"; - this.cScale2 = this.cScale2 || "#4d1037"; - this.cScale3 = this.cScale3 || "#3f5258"; - this.cScale4 = this.cScale4 || "#4f2f1b"; - this.cScale5 = this.cScale5 || "#6e0a0a"; - this.cScale6 = this.cScale6 || "#3b0048"; - this.cScale7 = this.cScale7 || "#995a01"; - this.cScale8 = this.cScale8 || "#154706"; - this.cScale9 = this.cScale9 || "#161722"; - this.cScale10 = this.cScale10 || "#00296f"; - this.cScale11 = this.cScale11 || "#01629c"; - this.cScale12 = this.cScale12 || "#010029"; - this.cScale0 = this.cScale0 || this.primaryColor; - this.cScale1 = this.cScale1 || this.secondaryColor; - this.cScale2 = this.cScale2 || this.tertiaryColor; - this.cScale3 = this.cScale3 || adjust$2(this.primaryColor, { h: 30 }); - this.cScale4 = this.cScale4 || adjust$2(this.primaryColor, { h: 60 }); - this.cScale5 = this.cScale5 || adjust$2(this.primaryColor, { h: 90 }); - this.cScale6 = this.cScale6 || adjust$2(this.primaryColor, { h: 120 }); - this.cScale7 = this.cScale7 || adjust$2(this.primaryColor, { h: 150 }); - this.cScale8 = this.cScale8 || adjust$2(this.primaryColor, { h: 210 }); - this.cScale9 = this.cScale9 || adjust$2(this.primaryColor, { h: 270 }); - this.cScale10 = this.cScale10 || adjust$2(this.primaryColor, { h: 300 }); - this.cScale11 = this.cScale11 || adjust$2(this.primaryColor, { h: 330 }); - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert$1(this["cScale" + i2]); - } - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten$1(this["cScale" + i2], 10); - } - for (let i2 = 0; i2 < 5; i2++) { - this["surface" + i2] = this["surface" + i2] || adjust$2(this.mainBkg, { h: 30, s: -30, l: -(-10 + i2 * 4) }); - this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust$2(this.mainBkg, { h: 30, s: -30, l: -(-7 + i2 * 4) }); - } - this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor); - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; - } - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["pie" + i2] = this["cScale" + i2]; - } - this.pieTitleTextSize = this.pieTitleTextSize || "25px"; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || "17px"; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || "17px"; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || "black"; - this.pieStrokeWidth = this.pieStrokeWidth || "2px"; - this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; - this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; - this.pieOpacity = this.pieOpacity || "0.7"; - this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; - this.quadrant2Fill = this.quadrant2Fill || adjust$2(this.primaryColor, { r: 5, g: 5, b: 5 }); - this.quadrant3Fill = this.quadrant3Fill || adjust$2(this.primaryColor, { r: 10, g: 10, b: 10 }); - this.quadrant4Fill = this.quadrant4Fill || adjust$2(this.primaryColor, { r: 15, g: 15, b: 15 }); - this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; - this.quadrant2TextFill = this.quadrant2TextFill || adjust$2(this.primaryTextColor, { r: -5, g: -5, b: -5 }); - this.quadrant3TextFill = this.quadrant3TextFill || adjust$2(this.primaryTextColor, { r: -10, g: -10, b: -10 }); - this.quadrant4TextFill = this.quadrant4TextFill || adjust$2(this.primaryTextColor, { r: -15, g: -15, b: -15 }); - this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill); - this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; - this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; - this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; - this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; - this.xyChart = { - backgroundColor: ((_a2 = this.xyChart) == null ? void 0 : _a2.backgroundColor) || this.background, - titleColor: ((_b2 = this.xyChart) == null ? void 0 : _b2.titleColor) || this.primaryTextColor, - xAxisTitleColor: ((_c = this.xyChart) == null ? void 0 : _c.xAxisTitleColor) || this.primaryTextColor, - xAxisLabelColor: ((_d = this.xyChart) == null ? void 0 : _d.xAxisLabelColor) || this.primaryTextColor, - xAxisTickColor: ((_e = this.xyChart) == null ? void 0 : _e.xAxisTickColor) || this.primaryTextColor, - xAxisLineColor: ((_f = this.xyChart) == null ? void 0 : _f.xAxisLineColor) || this.primaryTextColor, - yAxisTitleColor: ((_g = this.xyChart) == null ? void 0 : _g.yAxisTitleColor) || this.primaryTextColor, - yAxisLabelColor: ((_h = this.xyChart) == null ? void 0 : _h.yAxisLabelColor) || this.primaryTextColor, - yAxisTickColor: ((_i6 = this.xyChart) == null ? void 0 : _i6.yAxisTickColor) || this.primaryTextColor, - yAxisLineColor: ((_j = this.xyChart) == null ? void 0 : _j.yAxisLineColor) || this.primaryTextColor, - plotColorPalette: ((_k = this.xyChart) == null ? void 0 : _k.plotColorPalette) || "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22" - }; - this.classText = this.primaryTextColor; - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || "1"; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken$1(this.secondaryColor, 30) : this.secondaryColor); - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; - this.git0 = lighten$1(this.secondaryColor, 20); - this.git1 = lighten$1(this.pie2 || this.secondaryColor, 20); - this.git2 = lighten$1(this.pie3 || this.tertiaryColor, 20); - this.git3 = lighten$1(this.pie4 || adjust$2(this.primaryColor, { h: -30 }), 20); - this.git4 = lighten$1(this.pie5 || adjust$2(this.primaryColor, { h: -60 }), 20); - this.git5 = lighten$1(this.pie6 || adjust$2(this.primaryColor, { h: -90 }), 10); - this.git6 = lighten$1(this.pie7 || adjust$2(this.primaryColor, { h: 60 }), 10); - this.git7 = lighten$1(this.pie8 || adjust$2(this.primaryColor, { h: 120 }), 20); - this.gitInv0 = this.gitInv0 || invert$1(this.git0); - this.gitInv1 = this.gitInv1 || invert$1(this.git1); - this.gitInv2 = this.gitInv2 || invert$1(this.git2); - this.gitInv3 = this.gitInv3 || invert$1(this.git3); - this.gitInv4 = this.gitInv4 || invert$1(this.git4); - this.gitInv5 = this.gitInv5 || invert$1(this.git5); - this.gitInv6 = this.gitInv6 || invert$1(this.git6); - this.gitInv7 = this.gitInv7 || invert$1(this.git7); - this.gitBranchLabel0 = this.gitBranchLabel0 || invert$1(this.labelTextColor); - this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; - this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; - this.gitBranchLabel3 = this.gitBranchLabel3 || invert$1(this.labelTextColor); - this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; - this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; - this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; - this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; - this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; - this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; - this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; - this.tagLabelFontSize = this.tagLabelFontSize || "10px"; - this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; - this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; - this.commitLabelFontSize = this.commitLabelFontSize || "10px"; - this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || lighten$1(this.background, 12); - this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || lighten$1(this.background, 2); - } - calculate(overrides) { - if (typeof overrides !== "object") { - this.updateColors(); - return; - } - const keys2 = Object.keys(overrides); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["smallmatrix"], + props: { + numArgs: 0 + }, + handler(context) { + var payload = { + arraystretch: 0.5 + }; + var res = parseArray(context.parser, payload, "script"); + res.colSeparationType = "small"; + return res; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["subarray"], + props: { + numArgs: 1 + }, + handler(context, args) { + var symNode = checkSymbolNodeType(args[0]); + var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; + var cols = colalign.map(function(nde) { + var node2 = assertSymbolNodeType(nde); + var ca = node2.text; + if ("lc".indexOf(ca) !== -1) { + return { + type: "align", + align: ca + }; + } + throw new ParseError("Unknown column alignment: " + ca, nde); + }); + if (cols.length > 1) { + throw new ParseError("{subarray} can contain only one column"); + } + var res = { + cols, + hskipBeforeAndAfter: false, + arraystretch: 0.5 + }; + res = parseArray(context.parser, res, "script"); + if (res.body.length > 0 && res.body[0].length > 1) { + throw new ParseError("{subarray} can contain only one column"); + } + return res; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - } - }; - const getThemeVariables$3 = (userOverrides) => { - const theme2 = new Theme$3(); - theme2.calculate(userOverrides); - return theme2; - }; - let Theme$2 = class Theme { - constructor() { - this.background = "#f4f4f4"; - this.primaryColor = "#ECECFF"; - this.secondaryColor = adjust$2(this.primaryColor, { h: 120 }); - this.secondaryColor = "#ffffde"; - this.tertiaryColor = adjust$2(this.primaryColor, { h: -160 }); - this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode); - this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); - this.primaryTextColor = invert$1(this.primaryColor); - this.secondaryTextColor = invert$1(this.secondaryColor); - this.tertiaryTextColor = invert$1(this.tertiaryColor); - this.lineColor = invert$1(this.background); - this.textColor = invert$1(this.background); - this.background = "white"; - this.mainBkg = "#ECECFF"; - this.secondBkg = "#ffffde"; - this.lineColor = "#333333"; - this.border1 = "#9370DB"; - this.border2 = "#aaaa33"; - this.arrowheadColor = "#333333"; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = "16px"; - this.labelBackground = "#e8e8e8"; - this.textColor = "#333"; - this.THEME_COLOR_LIMIT = 12; - this.nodeBkg = "calculated"; - this.nodeBorder = "calculated"; - this.clusterBkg = "calculated"; - this.clusterBorder = "calculated"; - this.defaultLinkColor = "calculated"; - this.titleColor = "calculated"; - this.edgeLabelBackground = "calculated"; - this.actorBorder = "calculated"; - this.actorBkg = "calculated"; - this.actorTextColor = "black"; - this.actorLineColor = "grey"; - this.signalColor = "calculated"; - this.signalTextColor = "calculated"; - this.labelBoxBkgColor = "calculated"; - this.labelBoxBorderColor = "calculated"; - this.labelTextColor = "calculated"; - this.loopTextColor = "calculated"; - this.noteBorderColor = "calculated"; - this.noteBkgColor = "#fff5ad"; - this.noteTextColor = "calculated"; - this.activationBorderColor = "#666"; - this.activationBkgColor = "#f4f4f4"; - this.sequenceNumberColor = "white"; - this.sectionBkgColor = "calculated"; - this.altSectionBkgColor = "calculated"; - this.sectionBkgColor2 = "calculated"; - this.excludeBkgColor = "#eeeeee"; - this.taskBorderColor = "calculated"; - this.taskBkgColor = "calculated"; - this.taskTextLightColor = "calculated"; - this.taskTextColor = this.taskTextLightColor; - this.taskTextDarkColor = "calculated"; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.taskTextClickableColor = "calculated"; - this.activeTaskBorderColor = "calculated"; - this.activeTaskBkgColor = "calculated"; - this.gridColor = "calculated"; - this.doneTaskBkgColor = "calculated"; - this.doneTaskBorderColor = "calculated"; - this.critBorderColor = "calculated"; - this.critBkgColor = "calculated"; - this.todayLineColor = "calculated"; - this.sectionBkgColor = rgba$1(102, 102, 255, 0.49); - this.altSectionBkgColor = "white"; - this.sectionBkgColor2 = "#fff400"; - this.taskBorderColor = "#534fbc"; - this.taskBkgColor = "#8a90dd"; - this.taskTextLightColor = "white"; - this.taskTextColor = "calculated"; - this.taskTextDarkColor = "black"; - this.taskTextOutsideColor = "calculated"; - this.taskTextClickableColor = "#003163"; - this.activeTaskBorderColor = "#534fbc"; - this.activeTaskBkgColor = "#bfc7ff"; - this.gridColor = "lightgrey"; - this.doneTaskBkgColor = "lightgrey"; - this.doneTaskBorderColor = "grey"; - this.critBorderColor = "#ff8888"; - this.critBkgColor = "red"; - this.todayLineColor = "red"; - this.personBorder = this.primaryBorderColor; - this.personBkg = this.mainBkg; - this.labelColor = "black"; - this.errorBkgColor = "#552222"; - this.errorTextColor = "#552222"; - this.updateColors(); - } - updateColors() { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k; - this.cScale0 = this.cScale0 || this.primaryColor; - this.cScale1 = this.cScale1 || this.secondaryColor; - this.cScale2 = this.cScale2 || this.tertiaryColor; - this.cScale3 = this.cScale3 || adjust$2(this.primaryColor, { h: 30 }); - this.cScale4 = this.cScale4 || adjust$2(this.primaryColor, { h: 60 }); - this.cScale5 = this.cScale5 || adjust$2(this.primaryColor, { h: 90 }); - this.cScale6 = this.cScale6 || adjust$2(this.primaryColor, { h: 120 }); - this.cScale7 = this.cScale7 || adjust$2(this.primaryColor, { h: 150 }); - this.cScale8 = this.cScale8 || adjust$2(this.primaryColor, { h: 210 }); - this.cScale9 = this.cScale9 || adjust$2(this.primaryColor, { h: 270 }); - this.cScale10 = this.cScale10 || adjust$2(this.primaryColor, { h: 300 }); - this.cScale11 = this.cScale11 || adjust$2(this.primaryColor, { h: 330 }); - this["cScalePeer1"] = this["cScalePeer1"] || darken$1(this.secondaryColor, 45); - this["cScalePeer2"] = this["cScalePeer2"] || darken$1(this.tertiaryColor, 40); - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScale" + i2] = darken$1(this["cScale" + i2], 10); - this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken$1(this["cScale" + i2], 25); - } - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleInv" + i2] = this["cScaleInv" + i2] || adjust$2(this["cScale" + i2], { h: 180 }); - } - for (let i2 = 0; i2 < 5; i2++) { - this["surface" + i2] = this["surface" + i2] || adjust$2(this.mainBkg, { h: 30, l: -(5 + i2 * 5) }); - this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust$2(this.mainBkg, { h: 30, l: -(7 + i2 * 5) }); - } - this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor; - if (this.labelTextColor !== "calculated") { - this.cScaleLabel0 = this.cScaleLabel0 || invert$1(this.labelTextColor); - this.cScaleLabel3 = this.cScaleLabel3 || invert$1(this.labelTextColor); - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.labelTextColor; - } - } - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.titleColor = this.textColor; - this.edgeLabelBackground = this.labelBackground; - this.actorBorder = lighten$1(this.border1, 23); - this.actorBkg = this.mainBkg; - this.labelBoxBkgColor = this.actorBkg; - this.signalColor = this.textColor; - this.signalTextColor = this.textColor; - this.labelBoxBorderColor = this.actorBorder; - this.labelTextColor = this.actorTextColor; - this.loopTextColor = this.actorTextColor; - this.noteBorderColor = this.border2; - this.noteTextColor = this.actorTextColor; - this.taskTextColor = this.taskTextLightColor; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || "#f0f0f0"; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.nodeBorder; - this.specialStateColor = this.lineColor; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.transitionColor = this.transitionColor || this.lineColor; - this.classText = this.primaryTextColor; - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = adjust$2(this.primaryColor, { h: 64 }); - this.fillType3 = adjust$2(this.secondaryColor, { h: 64 }); - this.fillType4 = adjust$2(this.primaryColor, { h: -64 }); - this.fillType5 = adjust$2(this.secondaryColor, { h: -64 }); - this.fillType6 = adjust$2(this.primaryColor, { h: 128 }); - this.fillType7 = adjust$2(this.secondaryColor, { h: 128 }); - this.pie1 = this.pie1 || this.primaryColor; - this.pie2 = this.pie2 || this.secondaryColor; - this.pie3 = this.pie3 || adjust$2(this.tertiaryColor, { l: -40 }); - this.pie4 = this.pie4 || adjust$2(this.primaryColor, { l: -10 }); - this.pie5 = this.pie5 || adjust$2(this.secondaryColor, { l: -30 }); - this.pie6 = this.pie6 || adjust$2(this.tertiaryColor, { l: -20 }); - this.pie7 = this.pie7 || adjust$2(this.primaryColor, { h: 60, l: -20 }); - this.pie8 = this.pie8 || adjust$2(this.primaryColor, { h: -60, l: -40 }); - this.pie9 = this.pie9 || adjust$2(this.primaryColor, { h: 120, l: -40 }); - this.pie10 = this.pie10 || adjust$2(this.primaryColor, { h: 60, l: -40 }); - this.pie11 = this.pie11 || adjust$2(this.primaryColor, { h: -90, l: -40 }); - this.pie12 = this.pie12 || adjust$2(this.primaryColor, { h: 120, l: -30 }); - this.pieTitleTextSize = this.pieTitleTextSize || "25px"; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || "17px"; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || "17px"; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || "black"; - this.pieStrokeWidth = this.pieStrokeWidth || "2px"; - this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; - this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; - this.pieOpacity = this.pieOpacity || "0.7"; - this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; - this.quadrant2Fill = this.quadrant2Fill || adjust$2(this.primaryColor, { r: 5, g: 5, b: 5 }); - this.quadrant3Fill = this.quadrant3Fill || adjust$2(this.primaryColor, { r: 10, g: 10, b: 10 }); - this.quadrant4Fill = this.quadrant4Fill || adjust$2(this.primaryColor, { r: 15, g: 15, b: 15 }); - this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; - this.quadrant2TextFill = this.quadrant2TextFill || adjust$2(this.primaryTextColor, { r: -5, g: -5, b: -5 }); - this.quadrant3TextFill = this.quadrant3TextFill || adjust$2(this.primaryTextColor, { r: -10, g: -10, b: -10 }); - this.quadrant4TextFill = this.quadrant4TextFill || adjust$2(this.primaryTextColor, { r: -15, g: -15, b: -15 }); - this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill); - this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; - this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; - this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; - this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; - this.xyChart = { - backgroundColor: ((_a2 = this.xyChart) == null ? void 0 : _a2.backgroundColor) || this.background, - titleColor: ((_b2 = this.xyChart) == null ? void 0 : _b2.titleColor) || this.primaryTextColor, - xAxisTitleColor: ((_c = this.xyChart) == null ? void 0 : _c.xAxisTitleColor) || this.primaryTextColor, - xAxisLabelColor: ((_d = this.xyChart) == null ? void 0 : _d.xAxisLabelColor) || this.primaryTextColor, - xAxisTickColor: ((_e = this.xyChart) == null ? void 0 : _e.xAxisTickColor) || this.primaryTextColor, - xAxisLineColor: ((_f = this.xyChart) == null ? void 0 : _f.xAxisLineColor) || this.primaryTextColor, - yAxisTitleColor: ((_g = this.xyChart) == null ? void 0 : _g.yAxisTitleColor) || this.primaryTextColor, - yAxisLabelColor: ((_h = this.xyChart) == null ? void 0 : _h.yAxisLabelColor) || this.primaryTextColor, - yAxisTickColor: ((_i6 = this.xyChart) == null ? void 0 : _i6.yAxisTickColor) || this.primaryTextColor, - yAxisLineColor: ((_j = this.xyChart) == null ? void 0 : _j.yAxisLineColor) || this.primaryTextColor, - plotColorPalette: ((_k = this.xyChart) == null ? void 0 : _k.plotColorPalette) || "#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3" - }; - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || "1"; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; - this.git0 = this.git0 || this.primaryColor; - this.git1 = this.git1 || this.secondaryColor; - this.git2 = this.git2 || this.tertiaryColor; - this.git3 = this.git3 || adjust$2(this.primaryColor, { h: -30 }); - this.git4 = this.git4 || adjust$2(this.primaryColor, { h: -60 }); - this.git5 = this.git5 || adjust$2(this.primaryColor, { h: -90 }); - this.git6 = this.git6 || adjust$2(this.primaryColor, { h: 60 }); - this.git7 = this.git7 || adjust$2(this.primaryColor, { h: 120 }); - if (this.darkMode) { - this.git0 = lighten$1(this.git0, 25); - this.git1 = lighten$1(this.git1, 25); - this.git2 = lighten$1(this.git2, 25); - this.git3 = lighten$1(this.git3, 25); - this.git4 = lighten$1(this.git4, 25); - this.git5 = lighten$1(this.git5, 25); - this.git6 = lighten$1(this.git6, 25); - this.git7 = lighten$1(this.git7, 25); - } else { - this.git0 = darken$1(this.git0, 25); - this.git1 = darken$1(this.git1, 25); - this.git2 = darken$1(this.git2, 25); - this.git3 = darken$1(this.git3, 25); - this.git4 = darken$1(this.git4, 25); - this.git5 = darken$1(this.git5, 25); - this.git6 = darken$1(this.git6, 25); - this.git7 = darken$1(this.git7, 25); - } - this.gitInv0 = this.gitInv0 || darken$1(invert$1(this.git0), 25); - this.gitInv1 = this.gitInv1 || invert$1(this.git1); - this.gitInv2 = this.gitInv2 || invert$1(this.git2); - this.gitInv3 = this.gitInv3 || invert$1(this.git3); - this.gitInv4 = this.gitInv4 || invert$1(this.git4); - this.gitInv5 = this.gitInv5 || invert$1(this.git5); - this.gitInv6 = this.gitInv6 || invert$1(this.git6); - this.gitInv7 = this.gitInv7 || invert$1(this.git7); - this.gitBranchLabel0 = this.gitBranchLabel0 || invert$1(this.labelTextColor); - this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; - this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; - this.gitBranchLabel3 = this.gitBranchLabel3 || invert$1(this.labelTextColor); - this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; - this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; - this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; - this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; - this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; - this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; - this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; - this.tagLabelFontSize = this.tagLabelFontSize || "10px"; - this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; - this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; - this.commitLabelFontSize = this.commitLabelFontSize || "10px"; - this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; - this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; - } - calculate(overrides) { - if (typeof overrides !== "object") { - this.updateColors(); - return; - } - const keys2 = Object.keys(overrides); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["cases", "dcases", "rcases", "drcases"], + props: { + numArgs: 0 + }, + handler(context) { + var payload = { + arraystretch: 1.2, + cols: [{ + type: "align", + align: "l", + pregap: 0, + // TODO(kevinb) get the current style. + // For now we use the metrics for TEXT style which is what we were + // doing before. Before attempting to get the current style we + // should look at TeX's behavior especially for \over and matrices. + postgap: 1 + /* 1em quad */ + }, { + type: "align", + align: "l", + pregap: 0, + postgap: 0 + }] + }; + var res = parseArray(context.parser, payload, dCellStyle(context.envName)); + return { + type: "leftright", + mode: context.mode, + body: [res], + left: context.envName.indexOf("r") > -1 ? "." : "\\{", + right: context.envName.indexOf("r") > -1 ? "\\}" : ".", + rightColor: void 0 + }; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["align", "align*", "aligned", "split"], + props: { + numArgs: 0 + }, + handler: alignedHandler, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - } - }; - const getThemeVariables$2 = (userOverrides) => { - const theme2 = new Theme$2(); - theme2.calculate(userOverrides); - return theme2; - }; - let Theme$1 = class Theme { - constructor() { - this.background = "#f4f4f4"; - this.primaryColor = "#cde498"; - this.secondaryColor = "#cdffb2"; - this.background = "white"; - this.mainBkg = "#cde498"; - this.secondBkg = "#cdffb2"; - this.lineColor = "green"; - this.border1 = "#13540c"; - this.border2 = "#6eaa49"; - this.arrowheadColor = "green"; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = "16px"; - this.tertiaryColor = lighten$1("#cde498", 10); - this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode); - this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); - this.primaryTextColor = invert$1(this.primaryColor); - this.secondaryTextColor = invert$1(this.secondaryColor); - this.tertiaryTextColor = invert$1(this.primaryColor); - this.lineColor = invert$1(this.background); - this.textColor = invert$1(this.background); - this.THEME_COLOR_LIMIT = 12; - this.nodeBkg = "calculated"; - this.nodeBorder = "calculated"; - this.clusterBkg = "calculated"; - this.clusterBorder = "calculated"; - this.defaultLinkColor = "calculated"; - this.titleColor = "#333"; - this.edgeLabelBackground = "#e8e8e8"; - this.actorBorder = "calculated"; - this.actorBkg = "calculated"; - this.actorTextColor = "black"; - this.actorLineColor = "grey"; - this.signalColor = "#333"; - this.signalTextColor = "#333"; - this.labelBoxBkgColor = "calculated"; - this.labelBoxBorderColor = "#326932"; - this.labelTextColor = "calculated"; - this.loopTextColor = "calculated"; - this.noteBorderColor = "calculated"; - this.noteBkgColor = "#fff5ad"; - this.noteTextColor = "calculated"; - this.activationBorderColor = "#666"; - this.activationBkgColor = "#f4f4f4"; - this.sequenceNumberColor = "white"; - this.sectionBkgColor = "#6eaa49"; - this.altSectionBkgColor = "white"; - this.sectionBkgColor2 = "#6eaa49"; - this.excludeBkgColor = "#eeeeee"; - this.taskBorderColor = "calculated"; - this.taskBkgColor = "#487e3a"; - this.taskTextLightColor = "white"; - this.taskTextColor = "calculated"; - this.taskTextDarkColor = "black"; - this.taskTextOutsideColor = "calculated"; - this.taskTextClickableColor = "#003163"; - this.activeTaskBorderColor = "calculated"; - this.activeTaskBkgColor = "calculated"; - this.gridColor = "lightgrey"; - this.doneTaskBkgColor = "lightgrey"; - this.doneTaskBorderColor = "grey"; - this.critBorderColor = "#ff8888"; - this.critBkgColor = "red"; - this.todayLineColor = "red"; - this.personBorder = this.primaryBorderColor; - this.personBkg = this.mainBkg; - this.labelColor = "black"; - this.errorBkgColor = "#552222"; - this.errorTextColor = "#552222"; - } - updateColors() { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k; - this.actorBorder = darken$1(this.mainBkg, 20); - this.actorBkg = this.mainBkg; - this.labelBoxBkgColor = this.actorBkg; - this.labelTextColor = this.actorTextColor; - this.loopTextColor = this.actorTextColor; - this.noteBorderColor = this.border2; - this.noteTextColor = this.actorTextColor; - this.cScale0 = this.cScale0 || this.primaryColor; - this.cScale1 = this.cScale1 || this.secondaryColor; - this.cScale2 = this.cScale2 || this.tertiaryColor; - this.cScale3 = this.cScale3 || adjust$2(this.primaryColor, { h: 30 }); - this.cScale4 = this.cScale4 || adjust$2(this.primaryColor, { h: 60 }); - this.cScale5 = this.cScale5 || adjust$2(this.primaryColor, { h: 90 }); - this.cScale6 = this.cScale6 || adjust$2(this.primaryColor, { h: 120 }); - this.cScale7 = this.cScale7 || adjust$2(this.primaryColor, { h: 150 }); - this.cScale8 = this.cScale8 || adjust$2(this.primaryColor, { h: 210 }); - this.cScale9 = this.cScale9 || adjust$2(this.primaryColor, { h: 270 }); - this.cScale10 = this.cScale10 || adjust$2(this.primaryColor, { h: 300 }); - this.cScale11 = this.cScale11 || adjust$2(this.primaryColor, { h: 330 }); - this["cScalePeer1"] = this["cScalePeer1"] || darken$1(this.secondaryColor, 45); - this["cScalePeer2"] = this["cScalePeer2"] || darken$1(this.tertiaryColor, 40); - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScale" + i2] = darken$1(this["cScale" + i2], 10); - this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken$1(this["cScale" + i2], 25); - } - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleInv" + i2] = this["cScaleInv" + i2] || adjust$2(this["cScale" + i2], { h: 180 }); - } - this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor; - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; - } - for (let i2 = 0; i2 < 5; i2++) { - this["surface" + i2] = this["surface" + i2] || adjust$2(this.mainBkg, { h: 30, s: -30, l: -(5 + i2 * 5) }); - this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust$2(this.mainBkg, { h: 30, s: -30, l: -(8 + i2 * 5) }); - } - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.taskBorderColor = this.border1; - this.taskTextColor = this.taskTextLightColor; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.activeTaskBorderColor = this.taskBorderColor; - this.activeTaskBkgColor = this.mainBkg; - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || "#f0f0f0"; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.primaryBorderColor; - this.specialStateColor = this.lineColor; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.transitionColor = this.transitionColor || this.lineColor; - this.classText = this.primaryTextColor; - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = adjust$2(this.primaryColor, { h: 64 }); - this.fillType3 = adjust$2(this.secondaryColor, { h: 64 }); - this.fillType4 = adjust$2(this.primaryColor, { h: -64 }); - this.fillType5 = adjust$2(this.secondaryColor, { h: -64 }); - this.fillType6 = adjust$2(this.primaryColor, { h: 128 }); - this.fillType7 = adjust$2(this.secondaryColor, { h: 128 }); - this.pie1 = this.pie1 || this.primaryColor; - this.pie2 = this.pie2 || this.secondaryColor; - this.pie3 = this.pie3 || this.tertiaryColor; - this.pie4 = this.pie4 || adjust$2(this.primaryColor, { l: -30 }); - this.pie5 = this.pie5 || adjust$2(this.secondaryColor, { l: -30 }); - this.pie6 = this.pie6 || adjust$2(this.tertiaryColor, { h: 40, l: -40 }); - this.pie7 = this.pie7 || adjust$2(this.primaryColor, { h: 60, l: -10 }); - this.pie8 = this.pie8 || adjust$2(this.primaryColor, { h: -60, l: -10 }); - this.pie9 = this.pie9 || adjust$2(this.primaryColor, { h: 120, l: 0 }); - this.pie10 = this.pie10 || adjust$2(this.primaryColor, { h: 60, l: -50 }); - this.pie11 = this.pie11 || adjust$2(this.primaryColor, { h: -60, l: -50 }); - this.pie12 = this.pie12 || adjust$2(this.primaryColor, { h: 120, l: -50 }); - this.pieTitleTextSize = this.pieTitleTextSize || "25px"; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || "17px"; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || "17px"; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || "black"; - this.pieStrokeWidth = this.pieStrokeWidth || "2px"; - this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; - this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; - this.pieOpacity = this.pieOpacity || "0.7"; - this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; - this.quadrant2Fill = this.quadrant2Fill || adjust$2(this.primaryColor, { r: 5, g: 5, b: 5 }); - this.quadrant3Fill = this.quadrant3Fill || adjust$2(this.primaryColor, { r: 10, g: 10, b: 10 }); - this.quadrant4Fill = this.quadrant4Fill || adjust$2(this.primaryColor, { r: 15, g: 15, b: 15 }); - this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; - this.quadrant2TextFill = this.quadrant2TextFill || adjust$2(this.primaryTextColor, { r: -5, g: -5, b: -5 }); - this.quadrant3TextFill = this.quadrant3TextFill || adjust$2(this.primaryTextColor, { r: -10, g: -10, b: -10 }); - this.quadrant4TextFill = this.quadrant4TextFill || adjust$2(this.primaryTextColor, { r: -15, g: -15, b: -15 }); - this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill); - this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; - this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; - this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; - this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; - this.xyChart = { - backgroundColor: ((_a2 = this.xyChart) == null ? void 0 : _a2.backgroundColor) || this.background, - titleColor: ((_b2 = this.xyChart) == null ? void 0 : _b2.titleColor) || this.primaryTextColor, - xAxisTitleColor: ((_c = this.xyChart) == null ? void 0 : _c.xAxisTitleColor) || this.primaryTextColor, - xAxisLabelColor: ((_d = this.xyChart) == null ? void 0 : _d.xAxisLabelColor) || this.primaryTextColor, - xAxisTickColor: ((_e = this.xyChart) == null ? void 0 : _e.xAxisTickColor) || this.primaryTextColor, - xAxisLineColor: ((_f = this.xyChart) == null ? void 0 : _f.xAxisLineColor) || this.primaryTextColor, - yAxisTitleColor: ((_g = this.xyChart) == null ? void 0 : _g.yAxisTitleColor) || this.primaryTextColor, - yAxisLabelColor: ((_h = this.xyChart) == null ? void 0 : _h.yAxisLabelColor) || this.primaryTextColor, - yAxisTickColor: ((_i6 = this.xyChart) == null ? void 0 : _i6.yAxisTickColor) || this.primaryTextColor, - yAxisLineColor: ((_j = this.xyChart) == null ? void 0 : _j.yAxisLineColor) || this.primaryTextColor, - plotColorPalette: ((_k = this.xyChart) == null ? void 0 : _k.plotColorPalette) || "#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176" - }; - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || "1"; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; - this.git0 = this.git0 || this.primaryColor; - this.git1 = this.git1 || this.secondaryColor; - this.git2 = this.git2 || this.tertiaryColor; - this.git3 = this.git3 || adjust$2(this.primaryColor, { h: -30 }); - this.git4 = this.git4 || adjust$2(this.primaryColor, { h: -60 }); - this.git5 = this.git5 || adjust$2(this.primaryColor, { h: -90 }); - this.git6 = this.git6 || adjust$2(this.primaryColor, { h: 60 }); - this.git7 = this.git7 || adjust$2(this.primaryColor, { h: 120 }); - if (this.darkMode) { - this.git0 = lighten$1(this.git0, 25); - this.git1 = lighten$1(this.git1, 25); - this.git2 = lighten$1(this.git2, 25); - this.git3 = lighten$1(this.git3, 25); - this.git4 = lighten$1(this.git4, 25); - this.git5 = lighten$1(this.git5, 25); - this.git6 = lighten$1(this.git6, 25); - this.git7 = lighten$1(this.git7, 25); - } else { - this.git0 = darken$1(this.git0, 25); - this.git1 = darken$1(this.git1, 25); - this.git2 = darken$1(this.git2, 25); - this.git3 = darken$1(this.git3, 25); - this.git4 = darken$1(this.git4, 25); - this.git5 = darken$1(this.git5, 25); - this.git6 = darken$1(this.git6, 25); - this.git7 = darken$1(this.git7, 25); - } - this.gitInv0 = this.gitInv0 || invert$1(this.git0); - this.gitInv1 = this.gitInv1 || invert$1(this.git1); - this.gitInv2 = this.gitInv2 || invert$1(this.git2); - this.gitInv3 = this.gitInv3 || invert$1(this.git3); - this.gitInv4 = this.gitInv4 || invert$1(this.git4); - this.gitInv5 = this.gitInv5 || invert$1(this.git5); - this.gitInv6 = this.gitInv6 || invert$1(this.git6); - this.gitInv7 = this.gitInv7 || invert$1(this.git7); - this.gitBranchLabel0 = this.gitBranchLabel0 || invert$1(this.labelTextColor); - this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; - this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; - this.gitBranchLabel3 = this.gitBranchLabel3 || invert$1(this.labelTextColor); - this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; - this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; - this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; - this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; - this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; - this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; - this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; - this.tagLabelFontSize = this.tagLabelFontSize || "10px"; - this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; - this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; - this.commitLabelFontSize = this.commitLabelFontSize || "10px"; - this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; - this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; - } - calculate(overrides) { - if (typeof overrides !== "object") { - this.updateColors(); - return; - } - const keys2 = Object.keys(overrides); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["gathered", "gather", "gather*"], + props: { + numArgs: 0 + }, + handler(context) { + if (utils.contains(["gather", "gather*"], context.envName)) { + validateAmsEnvironmentContext(context); + } + var res = { + cols: [{ + type: "align", + align: "c" + }], + addJot: true, + colSeparationType: "gather", + autoTag: getAutoTag(context.envName), + emptySingleRow: true, + leqno: context.parser.settings.leqno + }; + return parseArray(context.parser, res, "display"); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["alignat", "alignat*", "alignedat"], + props: { + numArgs: 1 + }, + handler: alignedHandler, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - } - }; - const getThemeVariables$1 = (userOverrides) => { - const theme2 = new Theme$1(); - theme2.calculate(userOverrides); - return theme2; - }; - class Theme { - constructor() { - this.primaryColor = "#eee"; - this.contrast = "#707070"; - this.secondaryColor = lighten$1(this.contrast, 55); - this.background = "#ffffff"; - this.tertiaryColor = adjust$2(this.primaryColor, { h: -160 }); - this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode); - this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode); - this.primaryTextColor = invert$1(this.primaryColor); - this.secondaryTextColor = invert$1(this.secondaryColor); - this.tertiaryTextColor = invert$1(this.tertiaryColor); - this.lineColor = invert$1(this.background); - this.textColor = invert$1(this.background); - this.mainBkg = "#eee"; - this.secondBkg = "calculated"; - this.lineColor = "#666"; - this.border1 = "#999"; - this.border2 = "calculated"; - this.note = "#ffa"; - this.text = "#333"; - this.critical = "#d42"; - this.done = "#bbb"; - this.arrowheadColor = "#333333"; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = "16px"; - this.THEME_COLOR_LIMIT = 12; - this.nodeBkg = "calculated"; - this.nodeBorder = "calculated"; - this.clusterBkg = "calculated"; - this.clusterBorder = "calculated"; - this.defaultLinkColor = "calculated"; - this.titleColor = "calculated"; - this.edgeLabelBackground = "white"; - this.actorBorder = "calculated"; - this.actorBkg = "calculated"; - this.actorTextColor = "calculated"; - this.actorLineColor = "calculated"; - this.signalColor = "calculated"; - this.signalTextColor = "calculated"; - this.labelBoxBkgColor = "calculated"; - this.labelBoxBorderColor = "calculated"; - this.labelTextColor = "calculated"; - this.loopTextColor = "calculated"; - this.noteBorderColor = "calculated"; - this.noteBkgColor = "calculated"; - this.noteTextColor = "calculated"; - this.activationBorderColor = "#666"; - this.activationBkgColor = "#f4f4f4"; - this.sequenceNumberColor = "white"; - this.sectionBkgColor = "calculated"; - this.altSectionBkgColor = "white"; - this.sectionBkgColor2 = "calculated"; - this.excludeBkgColor = "#eeeeee"; - this.taskBorderColor = "calculated"; - this.taskBkgColor = "calculated"; - this.taskTextLightColor = "white"; - this.taskTextColor = "calculated"; - this.taskTextDarkColor = "calculated"; - this.taskTextOutsideColor = "calculated"; - this.taskTextClickableColor = "#003163"; - this.activeTaskBorderColor = "calculated"; - this.activeTaskBkgColor = "calculated"; - this.gridColor = "calculated"; - this.doneTaskBkgColor = "calculated"; - this.doneTaskBorderColor = "calculated"; - this.critBkgColor = "calculated"; - this.critBorderColor = "calculated"; - this.todayLineColor = "calculated"; - this.personBorder = this.primaryBorderColor; - this.personBkg = this.mainBkg; - this.labelColor = "black"; - this.errorBkgColor = "#552222"; - this.errorTextColor = "#552222"; - } - updateColors() { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k; - this.secondBkg = lighten$1(this.contrast, 55); - this.border2 = this.contrast; - this.actorBorder = lighten$1(this.border1, 23); - this.actorBkg = this.mainBkg; - this.actorTextColor = this.text; - this.actorLineColor = this.lineColor; - this.signalColor = this.text; - this.signalTextColor = this.text; - this.labelBoxBkgColor = this.actorBkg; - this.labelBoxBorderColor = this.actorBorder; - this.labelTextColor = this.text; - this.loopTextColor = this.text; - this.noteBorderColor = "#999"; - this.noteBkgColor = "#666"; - this.noteTextColor = "#fff"; - this.cScale0 = this.cScale0 || "#555"; - this.cScale1 = this.cScale1 || "#F4F4F4"; - this.cScale2 = this.cScale2 || "#555"; - this.cScale3 = this.cScale3 || "#BBB"; - this.cScale4 = this.cScale4 || "#777"; - this.cScale5 = this.cScale5 || "#999"; - this.cScale6 = this.cScale6 || "#DDD"; - this.cScale7 = this.cScale7 || "#FFF"; - this.cScale8 = this.cScale8 || "#DDD"; - this.cScale9 = this.cScale9 || "#BBB"; - this.cScale10 = this.cScale10 || "#999"; - this.cScale11 = this.cScale11 || "#777"; - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleInv" + i2] = this["cScaleInv" + i2] || invert$1(this["cScale" + i2]); - } - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - if (this.darkMode) { - this["cScalePeer" + i2] = this["cScalePeer" + i2] || lighten$1(this["cScale" + i2], 10); - } else { - this["cScalePeer" + i2] = this["cScalePeer" + i2] || darken$1(this["cScale" + i2], 10); - } - } - this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor); - this["cScaleLabel0"] = this["cScaleLabel0"] || this.cScale1; - this["cScaleLabel2"] = this["cScaleLabel2"] || this.cScale1; - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["cScaleLabel" + i2] = this["cScaleLabel" + i2] || this.scaleLabelColor; - } - for (let i2 = 0; i2 < 5; i2++) { - this["surface" + i2] = this["surface" + i2] || adjust$2(this.mainBkg, { l: -(5 + i2 * 5) }); - this["surfacePeer" + i2] = this["surfacePeer" + i2] || adjust$2(this.mainBkg, { l: -(8 + i2 * 5) }); - } - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.titleColor = this.text; - this.sectionBkgColor = lighten$1(this.contrast, 30); - this.sectionBkgColor2 = lighten$1(this.contrast, 30); - this.taskBorderColor = darken$1(this.contrast, 10); - this.taskBkgColor = this.contrast; - this.taskTextColor = this.taskTextLightColor; - this.taskTextDarkColor = this.text; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.activeTaskBorderColor = this.taskBorderColor; - this.activeTaskBkgColor = this.mainBkg; - this.gridColor = lighten$1(this.border1, 30); - this.doneTaskBkgColor = this.done; - this.doneTaskBorderColor = this.lineColor; - this.critBkgColor = this.critical; - this.critBorderColor = darken$1(this.critBkgColor, 10); - this.todayLineColor = this.critBkgColor; - this.transitionColor = this.transitionColor || "#000"; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || "#f4f4f4"; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.stateBorder = this.stateBorder || "#000"; - this.innerEndBackground = this.primaryBorderColor; - this.specialStateColor = "#222"; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.classText = this.primaryTextColor; - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = adjust$2(this.primaryColor, { h: 64 }); - this.fillType3 = adjust$2(this.secondaryColor, { h: 64 }); - this.fillType4 = adjust$2(this.primaryColor, { h: -64 }); - this.fillType5 = adjust$2(this.secondaryColor, { h: -64 }); - this.fillType6 = adjust$2(this.primaryColor, { h: 128 }); - this.fillType7 = adjust$2(this.secondaryColor, { h: 128 }); - for (let i2 = 0; i2 < this.THEME_COLOR_LIMIT; i2++) { - this["pie" + i2] = this["cScale" + i2]; - } - this.pie12 = this.pie0; - this.pieTitleTextSize = this.pieTitleTextSize || "25px"; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || "17px"; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || "17px"; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || "black"; - this.pieStrokeWidth = this.pieStrokeWidth || "2px"; - this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; - this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; - this.pieOpacity = this.pieOpacity || "0.7"; - this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; - this.quadrant2Fill = this.quadrant2Fill || adjust$2(this.primaryColor, { r: 5, g: 5, b: 5 }); - this.quadrant3Fill = this.quadrant3Fill || adjust$2(this.primaryColor, { r: 10, g: 10, b: 10 }); - this.quadrant4Fill = this.quadrant4Fill || adjust$2(this.primaryColor, { r: 15, g: 15, b: 15 }); - this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor; - this.quadrant2TextFill = this.quadrant2TextFill || adjust$2(this.primaryTextColor, { r: -5, g: -5, b: -5 }); - this.quadrant3TextFill = this.quadrant3TextFill || adjust$2(this.primaryTextColor, { r: -10, g: -10, b: -10 }); - this.quadrant4TextFill = this.quadrant4TextFill || adjust$2(this.primaryTextColor, { r: -15, g: -15, b: -15 }); - this.quadrantPointFill = this.quadrantPointFill || isDark$1(this.quadrant1Fill) ? lighten$1(this.quadrant1Fill) : darken$1(this.quadrant1Fill); - this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor; - this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor; - this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor; - this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor; - this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor; - this.xyChart = { - backgroundColor: ((_a2 = this.xyChart) == null ? void 0 : _a2.backgroundColor) || this.background, - titleColor: ((_b2 = this.xyChart) == null ? void 0 : _b2.titleColor) || this.primaryTextColor, - xAxisTitleColor: ((_c = this.xyChart) == null ? void 0 : _c.xAxisTitleColor) || this.primaryTextColor, - xAxisLabelColor: ((_d = this.xyChart) == null ? void 0 : _d.xAxisLabelColor) || this.primaryTextColor, - xAxisTickColor: ((_e = this.xyChart) == null ? void 0 : _e.xAxisTickColor) || this.primaryTextColor, - xAxisLineColor: ((_f = this.xyChart) == null ? void 0 : _f.xAxisLineColor) || this.primaryTextColor, - yAxisTitleColor: ((_g = this.xyChart) == null ? void 0 : _g.yAxisTitleColor) || this.primaryTextColor, - yAxisLabelColor: ((_h = this.xyChart) == null ? void 0 : _h.yAxisLabelColor) || this.primaryTextColor, - yAxisTickColor: ((_i6 = this.xyChart) == null ? void 0 : _i6.yAxisTickColor) || this.primaryTextColor, - yAxisLineColor: ((_j = this.xyChart) == null ? void 0 : _j.yAxisLineColor) || this.primaryTextColor, - plotColorPalette: ((_k = this.xyChart) == null ? void 0 : _k.plotColorPalette) || "#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0" - }; - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || "1"; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; - this.git0 = darken$1(this.pie1, 25) || this.primaryColor; - this.git1 = this.pie2 || this.secondaryColor; - this.git2 = this.pie3 || this.tertiaryColor; - this.git3 = this.pie4 || adjust$2(this.primaryColor, { h: -30 }); - this.git4 = this.pie5 || adjust$2(this.primaryColor, { h: -60 }); - this.git5 = this.pie6 || adjust$2(this.primaryColor, { h: -90 }); - this.git6 = this.pie7 || adjust$2(this.primaryColor, { h: 60 }); - this.git7 = this.pie8 || adjust$2(this.primaryColor, { h: 120 }); - this.gitInv0 = this.gitInv0 || invert$1(this.git0); - this.gitInv1 = this.gitInv1 || invert$1(this.git1); - this.gitInv2 = this.gitInv2 || invert$1(this.git2); - this.gitInv3 = this.gitInv3 || invert$1(this.git3); - this.gitInv4 = this.gitInv4 || invert$1(this.git4); - this.gitInv5 = this.gitInv5 || invert$1(this.git5); - this.gitInv6 = this.gitInv6 || invert$1(this.git6); - this.gitInv7 = this.gitInv7 || invert$1(this.git7); - this.branchLabelColor = this.branchLabelColor || this.labelTextColor; - this.gitBranchLabel0 = this.branchLabelColor; - this.gitBranchLabel1 = "white"; - this.gitBranchLabel2 = this.branchLabelColor; - this.gitBranchLabel3 = "white"; - this.gitBranchLabel4 = this.branchLabelColor; - this.gitBranchLabel5 = this.branchLabelColor; - this.gitBranchLabel6 = this.branchLabelColor; - this.gitBranchLabel7 = this.branchLabelColor; - this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; - this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; - this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; - this.tagLabelFontSize = this.tagLabelFontSize || "10px"; - this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; - this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; - this.commitLabelFontSize = this.commitLabelFontSize || "10px"; - this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd; - this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; - } - calculate(overrides) { - if (typeof overrides !== "object") { - this.updateColors(); - return; - } - const keys2 = Object.keys(overrides); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["equation", "equation*"], + props: { + numArgs: 0 + }, + handler(context) { + validateAmsEnvironmentContext(context); + var res = { + autoTag: getAutoTag(context.envName), + emptySingleRow: true, + singleRow: true, + maxNumCols: 1, + leqno: context.parser.settings.leqno + }; + return parseArray(context.parser, res, "display"); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - this.updateColors(); - keys2.forEach((k) => { - this[k] = overrides[k]; + defineEnvironment({ + type: "array", + names: ["CD"], + props: { + numArgs: 0 + }, + handler(context) { + validateAmsEnvironmentContext(context); + return parseCD(context.parser); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 }); - } - } - const getThemeVariables = (userOverrides) => { - const theme2 = new Theme(); - theme2.calculate(userOverrides); - return theme2; - }; - const theme = { - base: { - getThemeVariables: getThemeVariables$4 - }, - dark: { - getThemeVariables: getThemeVariables$3 - }, - default: { - getThemeVariables: getThemeVariables$2 - }, - forest: { - getThemeVariables: getThemeVariables$1 - }, - neutral: { - getThemeVariables - } - }; - const defaultConfigJson = { - "flowchart": { - "useMaxWidth": true, - "titleTopMargin": 25, - "subGraphTitleMargin": { - "top": 0, - "bottom": 0 - }, - "diagramPadding": 8, - "htmlLabels": true, - "nodeSpacing": 50, - "rankSpacing": 50, - "curve": "basis", - "padding": 15, - "defaultRenderer": "dagre-wrapper", - "wrappingWidth": 200 - }, - "sequence": { - "useMaxWidth": true, - "hideUnusedParticipants": false, - "activationWidth": 10, - "diagramMarginX": 50, - "diagramMarginY": 10, - "actorMargin": 50, - "width": 150, - "height": 65, - "boxMargin": 10, - "boxTextMargin": 5, - "noteMargin": 10, - "messageMargin": 35, - "messageAlign": "center", - "mirrorActors": true, - "forceMenus": false, - "bottomMarginAdj": 1, - "rightAngles": false, - "showSequenceNumbers": false, - "actorFontSize": 14, - "actorFontFamily": '"Open Sans", sans-serif', - "actorFontWeight": 400, - "noteFontSize": 14, - "noteFontFamily": '"trebuchet ms", verdana, arial, sans-serif', - "noteFontWeight": 400, - "noteAlign": "center", - "messageFontSize": 16, - "messageFontFamily": '"trebuchet ms", verdana, arial, sans-serif', - "messageFontWeight": 400, - "wrap": false, - "wrapPadding": 10, - "labelBoxWidth": 50, - "labelBoxHeight": 20 - }, - "gantt": { - "useMaxWidth": true, - "titleTopMargin": 25, - "barHeight": 20, - "barGap": 4, - "topPadding": 50, - "rightPadding": 75, - "leftPadding": 75, - "gridLineStartPadding": 35, - "fontSize": 11, - "sectionFontSize": 11, - "numberSectionStyles": 4, - "axisFormat": "%Y-%m-%d", - "topAxis": false, - "displayMode": "", - "weekday": "sunday" - }, - "journey": { - "useMaxWidth": true, - "diagramMarginX": 50, - "diagramMarginY": 10, - "leftMargin": 150, - "width": 150, - "height": 50, - "boxMargin": 10, - "boxTextMargin": 5, - "noteMargin": 10, - "messageMargin": 35, - "messageAlign": "center", - "bottomMarginAdj": 1, - "rightAngles": false, - "taskFontSize": 14, - "taskFontFamily": '"Open Sans", sans-serif', - "taskMargin": 50, - "activationWidth": 10, - "textPlacement": "fo", - "actorColours": [ - "#8FBC8F", - "#7CFC00", - "#00FFFF", - "#20B2AA", - "#B0E0E6", - "#FFFFE0" - ], - "sectionFills": [ - "#191970", - "#8B008B", - "#4B0082", - "#2F4F4F", - "#800000", - "#8B4513", - "#00008B" - ], - "sectionColours": [ - "#fff" - ] - }, - "class": { - "useMaxWidth": true, - "titleTopMargin": 25, - "arrowMarkerAbsolute": false, - "dividerMargin": 10, - "padding": 5, - "textHeight": 10, - "defaultRenderer": "dagre-wrapper", - "htmlLabels": false - }, - "state": { - "useMaxWidth": true, - "titleTopMargin": 25, - "dividerMargin": 10, - "sizeUnit": 5, - "padding": 8, - "textHeight": 10, - "titleShift": -15, - "noteMargin": 10, - "forkWidth": 70, - "forkHeight": 7, - "miniPadding": 2, - "fontSizeFactor": 5.02, - "fontSize": 24, - "labelHeight": 16, - "edgeLengthFactor": "20", - "compositTitleSize": 35, - "radius": 5, - "defaultRenderer": "dagre-wrapper" - }, - "er": { - "useMaxWidth": true, - "titleTopMargin": 25, - "diagramPadding": 20, - "layoutDirection": "TB", - "minEntityWidth": 100, - "minEntityHeight": 75, - "entityPadding": 15, - "stroke": "gray", - "fill": "honeydew", - "fontSize": 12 - }, - "pie": { - "useMaxWidth": true, - "textPosition": 0.75 - }, - "quadrantChart": { - "useMaxWidth": true, - "chartWidth": 500, - "chartHeight": 500, - "titleFontSize": 20, - "titlePadding": 10, - "quadrantPadding": 5, - "xAxisLabelPadding": 5, - "yAxisLabelPadding": 5, - "xAxisLabelFontSize": 16, - "yAxisLabelFontSize": 16, - "quadrantLabelFontSize": 16, - "quadrantTextTopPadding": 5, - "pointTextPadding": 5, - "pointLabelFontSize": 12, - "pointRadius": 5, - "xAxisPosition": "top", - "yAxisPosition": "left", - "quadrantInternalBorderStrokeWidth": 1, - "quadrantExternalBorderStrokeWidth": 2 - }, - "xyChart": { - "useMaxWidth": true, - "width": 700, - "height": 500, - "titleFontSize": 20, - "titlePadding": 10, - "showTitle": true, - "xAxis": { - "$ref": "#/$defs/XYChartAxisConfig", - "showLabel": true, - "labelFontSize": 14, - "labelPadding": 5, - "showTitle": true, - "titleFontSize": 16, - "titlePadding": 5, - "showTick": true, - "tickLength": 5, - "tickWidth": 2, - "showAxisLine": true, - "axisLineWidth": 2 - }, - "yAxis": { - "$ref": "#/$defs/XYChartAxisConfig", - "showLabel": true, - "labelFontSize": 14, - "labelPadding": 5, - "showTitle": true, - "titleFontSize": 16, - "titlePadding": 5, - "showTick": true, - "tickLength": 5, - "tickWidth": 2, - "showAxisLine": true, - "axisLineWidth": 2 - }, - "chartOrientation": "vertical", - "plotReservedSpacePercent": 50 - }, - "requirement": { - "useMaxWidth": true, - "rect_fill": "#f9f9f9", - "text_color": "#333", - "rect_border_size": "0.5px", - "rect_border_color": "#bbb", - "rect_min_width": 200, - "rect_min_height": 200, - "fontSize": 14, - "rect_padding": 10, - "line_height": 20 - }, - "mindmap": { - "useMaxWidth": true, - "padding": 10, - "maxNodeWidth": 200 - }, - "timeline": { - "useMaxWidth": true, - "diagramMarginX": 50, - "diagramMarginY": 10, - "leftMargin": 150, - "width": 150, - "height": 50, - "boxMargin": 10, - "boxTextMargin": 5, - "noteMargin": 10, - "messageMargin": 35, - "messageAlign": "center", - "bottomMarginAdj": 1, - "rightAngles": false, - "taskFontSize": 14, - "taskFontFamily": '"Open Sans", sans-serif', - "taskMargin": 50, - "activationWidth": 10, - "textPlacement": "fo", - "actorColours": [ - "#8FBC8F", - "#7CFC00", - "#00FFFF", - "#20B2AA", - "#B0E0E6", - "#FFFFE0" - ], - "sectionFills": [ - "#191970", - "#8B008B", - "#4B0082", - "#2F4F4F", - "#800000", - "#8B4513", - "#00008B" - ], - "sectionColours": [ - "#fff" - ], - "disableMulticolor": false - }, - "gitGraph": { - "useMaxWidth": true, - "titleTopMargin": 25, - "diagramPadding": 8, - "nodeLabel": { - "width": 75, - "height": 100, - "x": -25, - "y": 0 - }, - "mainBranchName": "main", - "mainBranchOrder": 0, - "showCommitLabel": true, - "showBranches": true, - "rotateCommitLabel": true, - "parallelCommits": false, - "arrowMarkerAbsolute": false - }, - "c4": { - "useMaxWidth": true, - "diagramMarginX": 50, - "diagramMarginY": 10, - "c4ShapeMargin": 50, - "c4ShapePadding": 20, - "width": 216, - "height": 60, - "boxMargin": 10, - "c4ShapeInRow": 4, - "nextLinePaddingX": 0, - "c4BoundaryInRow": 2, - "personFontSize": 14, - "personFontFamily": '"Open Sans", sans-serif', - "personFontWeight": "normal", - "external_personFontSize": 14, - "external_personFontFamily": '"Open Sans", sans-serif', - "external_personFontWeight": "normal", - "systemFontSize": 14, - "systemFontFamily": '"Open Sans", sans-serif', - "systemFontWeight": "normal", - "external_systemFontSize": 14, - "external_systemFontFamily": '"Open Sans", sans-serif', - "external_systemFontWeight": "normal", - "system_dbFontSize": 14, - "system_dbFontFamily": '"Open Sans", sans-serif', - "system_dbFontWeight": "normal", - "external_system_dbFontSize": 14, - "external_system_dbFontFamily": '"Open Sans", sans-serif', - "external_system_dbFontWeight": "normal", - "system_queueFontSize": 14, - "system_queueFontFamily": '"Open Sans", sans-serif', - "system_queueFontWeight": "normal", - "external_system_queueFontSize": 14, - "external_system_queueFontFamily": '"Open Sans", sans-serif', - "external_system_queueFontWeight": "normal", - "boundaryFontSize": 14, - "boundaryFontFamily": '"Open Sans", sans-serif', - "boundaryFontWeight": "normal", - "messageFontSize": 12, - "messageFontFamily": '"Open Sans", sans-serif', - "messageFontWeight": "normal", - "containerFontSize": 14, - "containerFontFamily": '"Open Sans", sans-serif', - "containerFontWeight": "normal", - "external_containerFontSize": 14, - "external_containerFontFamily": '"Open Sans", sans-serif', - "external_containerFontWeight": "normal", - "container_dbFontSize": 14, - "container_dbFontFamily": '"Open Sans", sans-serif', - "container_dbFontWeight": "normal", - "external_container_dbFontSize": 14, - "external_container_dbFontFamily": '"Open Sans", sans-serif', - "external_container_dbFontWeight": "normal", - "container_queueFontSize": 14, - "container_queueFontFamily": '"Open Sans", sans-serif', - "container_queueFontWeight": "normal", - "external_container_queueFontSize": 14, - "external_container_queueFontFamily": '"Open Sans", sans-serif', - "external_container_queueFontWeight": "normal", - "componentFontSize": 14, - "componentFontFamily": '"Open Sans", sans-serif', - "componentFontWeight": "normal", - "external_componentFontSize": 14, - "external_componentFontFamily": '"Open Sans", sans-serif', - "external_componentFontWeight": "normal", - "component_dbFontSize": 14, - "component_dbFontFamily": '"Open Sans", sans-serif', - "component_dbFontWeight": "normal", - "external_component_dbFontSize": 14, - "external_component_dbFontFamily": '"Open Sans", sans-serif', - "external_component_dbFontWeight": "normal", - "component_queueFontSize": 14, - "component_queueFontFamily": '"Open Sans", sans-serif', - "component_queueFontWeight": "normal", - "external_component_queueFontSize": 14, - "external_component_queueFontFamily": '"Open Sans", sans-serif', - "external_component_queueFontWeight": "normal", - "wrap": true, - "wrapPadding": 10, - "person_bg_color": "#08427B", - "person_border_color": "#073B6F", - "external_person_bg_color": "#686868", - "external_person_border_color": "#8A8A8A", - "system_bg_color": "#1168BD", - "system_border_color": "#3C7FC0", - "system_db_bg_color": "#1168BD", - "system_db_border_color": "#3C7FC0", - "system_queue_bg_color": "#1168BD", - "system_queue_border_color": "#3C7FC0", - "external_system_bg_color": "#999999", - "external_system_border_color": "#8A8A8A", - "external_system_db_bg_color": "#999999", - "external_system_db_border_color": "#8A8A8A", - "external_system_queue_bg_color": "#999999", - "external_system_queue_border_color": "#8A8A8A", - "container_bg_color": "#438DD5", - "container_border_color": "#3C7FC0", - "container_db_bg_color": "#438DD5", - "container_db_border_color": "#3C7FC0", - "container_queue_bg_color": "#438DD5", - "container_queue_border_color": "#3C7FC0", - "external_container_bg_color": "#B3B3B3", - "external_container_border_color": "#A6A6A6", - "external_container_db_bg_color": "#B3B3B3", - "external_container_db_border_color": "#A6A6A6", - "external_container_queue_bg_color": "#B3B3B3", - "external_container_queue_border_color": "#A6A6A6", - "component_bg_color": "#85BBF0", - "component_border_color": "#78A8D8", - "component_db_bg_color": "#85BBF0", - "component_db_border_color": "#78A8D8", - "component_queue_bg_color": "#85BBF0", - "component_queue_border_color": "#78A8D8", - "external_component_bg_color": "#CCCCCC", - "external_component_border_color": "#BFBFBF", - "external_component_db_bg_color": "#CCCCCC", - "external_component_db_border_color": "#BFBFBF", - "external_component_queue_bg_color": "#CCCCCC", - "external_component_queue_border_color": "#BFBFBF" - }, - "sankey": { - "useMaxWidth": true, - "width": 600, - "height": 400, - "linkColor": "gradient", - "nodeAlignment": "justify", - "showValues": true, - "prefix": "", - "suffix": "" - }, - "block": { - "useMaxWidth": true, - "padding": 8 - }, - "theme": "default", - "maxTextSize": 5e4, - "maxEdges": 500, - "darkMode": false, - "fontFamily": '"trebuchet ms", verdana, arial, sans-serif;', - "logLevel": 5, - "securityLevel": "strict", - "startOnLoad": true, - "arrowMarkerAbsolute": false, - "secure": [ - "secure", - "securityLevel", - "startOnLoad", - "maxTextSize", - "maxEdges" - ], - "legacyMathML": false, - "deterministicIds": false, - "fontSize": 16 - }; - const config$4 = { - ...defaultConfigJson, - // Set, even though they're `undefined` so that `configKeys` finds these keys - // TODO: Should we replace these with `null` so that they can go in the JSON Schema? - deterministicIDSeed: void 0, - themeCSS: void 0, - // add non-JSON default config values - themeVariables: theme["default"].getThemeVariables(), - sequence: { - ...defaultConfigJson.sequence, - messageFont: function() { - return { - fontFamily: this.messageFontFamily, - fontSize: this.messageFontSize, - fontWeight: this.messageFontWeight - }; - }, - noteFont: function() { - return { - fontFamily: this.noteFontFamily, - fontSize: this.noteFontSize, - fontWeight: this.noteFontWeight - }; - }, - actorFont: function() { - return { - fontFamily: this.actorFontFamily, - fontSize: this.actorFontSize, - fontWeight: this.actorFontWeight - }; - } - }, - gantt: { - ...defaultConfigJson.gantt, - tickInterval: void 0, - useWidth: void 0 - // can probably be removed since `configKeys` already includes this - }, - c4: { - ...defaultConfigJson.c4, - useWidth: void 0, - personFont: function() { - return { - fontFamily: this.personFontFamily, - fontSize: this.personFontSize, - fontWeight: this.personFontWeight - }; - }, - external_personFont: function() { - return { - fontFamily: this.external_personFontFamily, - fontSize: this.external_personFontSize, - fontWeight: this.external_personFontWeight - }; - }, - systemFont: function() { - return { - fontFamily: this.systemFontFamily, - fontSize: this.systemFontSize, - fontWeight: this.systemFontWeight - }; - }, - external_systemFont: function() { - return { - fontFamily: this.external_systemFontFamily, - fontSize: this.external_systemFontSize, - fontWeight: this.external_systemFontWeight - }; - }, - system_dbFont: function() { - return { - fontFamily: this.system_dbFontFamily, - fontSize: this.system_dbFontSize, - fontWeight: this.system_dbFontWeight - }; - }, - external_system_dbFont: function() { - return { - fontFamily: this.external_system_dbFontFamily, - fontSize: this.external_system_dbFontSize, - fontWeight: this.external_system_dbFontWeight - }; - }, - system_queueFont: function() { - return { - fontFamily: this.system_queueFontFamily, - fontSize: this.system_queueFontSize, - fontWeight: this.system_queueFontWeight - }; - }, - external_system_queueFont: function() { - return { - fontFamily: this.external_system_queueFontFamily, - fontSize: this.external_system_queueFontSize, - fontWeight: this.external_system_queueFontWeight - }; - }, - containerFont: function() { - return { - fontFamily: this.containerFontFamily, - fontSize: this.containerFontSize, - fontWeight: this.containerFontWeight - }; - }, - external_containerFont: function() { - return { - fontFamily: this.external_containerFontFamily, - fontSize: this.external_containerFontSize, - fontWeight: this.external_containerFontWeight - }; - }, - container_dbFont: function() { - return { - fontFamily: this.container_dbFontFamily, - fontSize: this.container_dbFontSize, - fontWeight: this.container_dbFontWeight - }; - }, - external_container_dbFont: function() { - return { - fontFamily: this.external_container_dbFontFamily, - fontSize: this.external_container_dbFontSize, - fontWeight: this.external_container_dbFontWeight - }; - }, - container_queueFont: function() { - return { - fontFamily: this.container_queueFontFamily, - fontSize: this.container_queueFontSize, - fontWeight: this.container_queueFontWeight - }; - }, - external_container_queueFont: function() { - return { - fontFamily: this.external_container_queueFontFamily, - fontSize: this.external_container_queueFontSize, - fontWeight: this.external_container_queueFontWeight - }; - }, - componentFont: function() { - return { - fontFamily: this.componentFontFamily, - fontSize: this.componentFontSize, - fontWeight: this.componentFontWeight - }; - }, - external_componentFont: function() { - return { - fontFamily: this.external_componentFontFamily, - fontSize: this.external_componentFontSize, - fontWeight: this.external_componentFontWeight - }; - }, - component_dbFont: function() { - return { - fontFamily: this.component_dbFontFamily, - fontSize: this.component_dbFontSize, - fontWeight: this.component_dbFontWeight - }; - }, - external_component_dbFont: function() { - return { - fontFamily: this.external_component_dbFontFamily, - fontSize: this.external_component_dbFontSize, - fontWeight: this.external_component_dbFontWeight - }; - }, - component_queueFont: function() { - return { - fontFamily: this.component_queueFontFamily, - fontSize: this.component_queueFontSize, - fontWeight: this.component_queueFontWeight - }; - }, - external_component_queueFont: function() { - return { - fontFamily: this.external_component_queueFontFamily, - fontSize: this.external_component_queueFontSize, - fontWeight: this.external_component_queueFontWeight - }; - }, - boundaryFont: function() { - return { - fontFamily: this.boundaryFontFamily, - fontSize: this.boundaryFontSize, - fontWeight: this.boundaryFontWeight - }; - }, - messageFont: function() { - return { - fontFamily: this.messageFontFamily, - fontSize: this.messageFontSize, - fontWeight: this.messageFontWeight - }; - } - }, - pie: { - ...defaultConfigJson.pie, - useWidth: 984 - }, - xyChart: { - ...defaultConfigJson.xyChart, - useWidth: void 0 - }, - requirement: { - ...defaultConfigJson.requirement, - useWidth: void 0 - }, - gitGraph: { - ...defaultConfigJson.gitGraph, - // TODO: This is a temporary override for `gitGraph`, since every other - // diagram does have `useMaxWidth`, but instead sets it to `true`. - // Should we set this to `true` instead? - useMaxWidth: false - }, - sankey: { - ...defaultConfigJson.sankey, - // this is false, unlike every other diagram (other than gitGraph) - // TODO: can we make this default to `true` instead? - useMaxWidth: false - } - }; - const keyify = (obj, prefix = "") => Object.keys(obj).reduce((res, el) => { - if (Array.isArray(obj[el])) { - return res; - } else if (typeof obj[el] === "object" && obj[el] !== null) { - return [...res, prefix + el, ...keyify(obj[el], "")]; - } - return [...res, prefix + el]; - }, []); - const configKeys = new Set(keyify(config$4, "")); - const defaultConfig$2 = config$4; - const sanitizeDirective = (args) => { - log$1.debug("sanitizeDirective called with", args); - if (typeof args !== "object" || args == null) { - return; - } - if (Array.isArray(args)) { - args.forEach((arg) => sanitizeDirective(arg)); - return; - } - for (const key of Object.keys(args)) { - log$1.debug("Checking key", key); - if (key.startsWith("__") || key.includes("proto") || key.includes("constr") || !configKeys.has(key) || args[key] == null) { - log$1.debug("sanitize deleting key: ", key); - delete args[key]; - continue; - } - if (typeof args[key] === "object") { - log$1.debug("sanitizing object", key); - sanitizeDirective(args[key]); - continue; - } - const cssMatchers = ["themeCSS", "fontFamily", "altFontFamily"]; - for (const cssKey of cssMatchers) { - if (key.includes(cssKey)) { - log$1.debug("sanitizing css option", key); - args[key] = sanitizeCss(args[key]); + defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}"); + defineMacro("\\notag", "\\nonumber"); + defineFunction({ + type: "text", + // Doesn't matter what this is. + names: ["\\hline", "\\hdashline"], + props: { + numArgs: 0, + allowedInText: true, + allowedInMath: true + }, + handler(context, args) { + throw new ParseError(context.funcName + " valid only within array environment"); } - } - } - if (args.themeVariables) { - for (const k of Object.keys(args.themeVariables)) { - const val = args.themeVariables[k]; - if ((val == null ? void 0 : val.match) && !val.match(/^[\d "#%(),.;A-Za-z]+$/)) { - args.themeVariables[k] = ""; + }); + environments = _environments; + defineFunction({ + type: "environment", + names: ["\\begin", "\\end"], + props: { + numArgs: 1, + argTypes: ["text"] + }, + handler(_ref, args) { + var { + parser: parser21, + funcName + } = _ref; + var nameGroup = args[0]; + if (nameGroup.type !== "ordgroup") { + throw new ParseError("Invalid environment name", nameGroup); + } + var envName = ""; + for (var i2 = 0; i2 < nameGroup.body.length; ++i2) { + envName += assertNodeType(nameGroup.body[i2], "textord").text; + } + if (funcName === "\\begin") { + if (!environments.hasOwnProperty(envName)) { + throw new ParseError("No such environment: " + envName, nameGroup); + } + var env = environments[envName]; + var { + args: _args, + optArgs + } = parser21.parseArguments("\\begin{" + envName + "}", env); + var context = { + mode: parser21.mode, + envName, + parser: parser21 + }; + var result = env.handler(context, _args, optArgs); + parser21.expect("\\end", false); + var endNameToken = parser21.nextToken; + var end2 = assertNodeType(parser21.parseFunction(), "environment"); + if (end2.name !== envName) { + throw new ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end2.name + "}", endNameToken); + } + return result; + } + return { + type: "environment", + mode: parser21.mode, + name: envName, + nameGroup + }; } - } - } - log$1.debug("After sanitization", args); - }; - const sanitizeCss = (str2) => { - let startCnt = 0; - let endCnt = 0; - for (const element2 of str2) { - if (startCnt < endCnt) { - return "{ /* ERROR: Unbalanced CSS */ }"; - } - if (element2 === "{") { - startCnt++; - } else if (element2 === "}") { - endCnt++; - } - } - if (startCnt !== endCnt) { - return "{ /* ERROR: Unbalanced CSS */ }"; - } - return str2; - }; - const frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s; - const directiveRegex = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi; - const anyCommentRegex = /\s*%%.*\n/gm; - class UnknownDiagramError extends Error { - constructor(message) { - super(message); - this.name = "UnknownDiagramError"; - } - } - const detectors = {}; - const detectType = function(text2, config2) { - text2 = text2.replace(frontMatterRegex, "").replace(directiveRegex, "").replace(anyCommentRegex, "\n"); - for (const [key, { detector: detector2 }] of Object.entries(detectors)) { - const diagram2 = detector2(text2, config2); - if (diagram2) { - return key; - } - } - throw new UnknownDiagramError( - `No diagram type detected matching given configuration for text: ${text2}` - ); - }; - const registerLazyLoadedDiagrams = (...diagrams2) => { - for (const { id: id2, detector: detector2, loader: loader2 } of diagrams2) { - addDetector(id2, detector2, loader2); - } - }; - const addDetector = (key, detector2, loader2) => { - if (detectors[key]) { - log$1.error(`Detector with key ${key} already exists`); - } else { - detectors[key] = { detector: detector2, loader: loader2 }; - } - log$1.debug(`Detector with key ${key} added${loader2 ? " with loader" : ""}`); - }; - const getDiagramLoader = (key) => { - return detectors[key].loader; - }; - const assignWithDepth = (dst, src, { depth = 2, clobber = false } = {}) => { - const config2 = { depth, clobber }; - if (Array.isArray(src) && !Array.isArray(dst)) { - src.forEach((s) => assignWithDepth(dst, s, config2)); - return dst; - } else if (Array.isArray(src) && Array.isArray(dst)) { - src.forEach((s) => { - if (!dst.includes(s)) { - dst.push(s); + }); + htmlBuilder$5 = /* @__PURE__ */ __name((group2, options3) => { + var font = group2.font; + var newOptions = options3.withFont(font); + return buildGroup$1(group2.body, newOptions); + }, "htmlBuilder$5"); + mathmlBuilder$4 = /* @__PURE__ */ __name((group2, options3) => { + var font = group2.font; + var newOptions = options3.withFont(font); + return buildGroup2(group2.body, newOptions); + }, "mathmlBuilder$4"); + fontAliases = { + "\\Bbb": "\\mathbb", + "\\bold": "\\mathbf", + "\\frak": "\\mathfrak", + "\\bm": "\\boldsymbol" + }; + defineFunction({ + type: "font", + names: [ + // styles, except \boldsymbol defined below + "\\mathrm", + "\\mathit", + "\\mathbf", + "\\mathnormal", + // families + "\\mathbb", + "\\mathcal", + "\\mathfrak", + "\\mathscr", + "\\mathsf", + "\\mathtt", + // aliases, except \bm defined below + "\\Bbb", + "\\bold", + "\\frak" + ], + props: { + numArgs: 1, + allowedInArgument: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21, + funcName + } = _ref; + var body = normalizeArgument(args[0]); + var func = funcName; + if (func in fontAliases) { + func = fontAliases[func]; + } + return { + type: "font", + mode: parser21.mode, + font: func.slice(1), + body + }; + }, "handler"), + htmlBuilder: htmlBuilder$5, + mathmlBuilder: mathmlBuilder$4 + }); + defineFunction({ + type: "mclass", + names: ["\\boldsymbol", "\\bm"], + props: { + numArgs: 1 + }, + handler: /* @__PURE__ */ __name((_ref2, args) => { + var { + parser: parser21 + } = _ref2; + var body = args[0]; + var isCharacterBox3 = utils.isCharacterBox(body); + return { + type: "mclass", + mode: parser21.mode, + mclass: binrelClass(body), + body: [{ + type: "font", + mode: parser21.mode, + font: "boldsymbol", + body + }], + isCharacterBox: isCharacterBox3 + }; + }, "handler") + }); + defineFunction({ + type: "font", + names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"], + props: { + numArgs: 0, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref3, args) => { + var { + parser: parser21, + funcName, + breakOnTokenText + } = _ref3; + var { + mode + } = parser21; + var body = parser21.parseExpression(true, breakOnTokenText); + var style3 = "math" + funcName.slice(1); + return { + type: "font", + mode, + font: style3, + body: { + type: "ordgroup", + mode: parser21.mode, + body + } + }; + }, "handler"), + htmlBuilder: htmlBuilder$5, + mathmlBuilder: mathmlBuilder$4 + }); + adjustStyle = /* @__PURE__ */ __name((size5, originalStyle) => { + var style3 = originalStyle; + if (size5 === "display") { + style3 = style3.id >= Style$1.SCRIPT.id ? style3.text() : Style$1.DISPLAY; + } else if (size5 === "text" && style3.size === Style$1.DISPLAY.size) { + style3 = Style$1.TEXT; + } else if (size5 === "script") { + style3 = Style$1.SCRIPT; + } else if (size5 === "scriptscript") { + style3 = Style$1.SCRIPTSCRIPT; + } + return style3; + }, "adjustStyle"); + htmlBuilder$4 = /* @__PURE__ */ __name((group2, options3) => { + var style3 = adjustStyle(group2.size, options3.style); + var nstyle = style3.fracNum(); + var dstyle = style3.fracDen(); + var newOptions; + newOptions = options3.havingStyle(nstyle); + var numerm = buildGroup$1(group2.numer, newOptions, options3); + if (group2.continued) { + var hStrut = 8.5 / options3.fontMetrics().ptPerEm; + var dStrut = 3.5 / options3.fontMetrics().ptPerEm; + numerm.height = numerm.height < hStrut ? hStrut : numerm.height; + numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth; + } + newOptions = options3.havingStyle(dstyle); + var denomm = buildGroup$1(group2.denom, newOptions, options3); + var rule; + var ruleWidth; + var ruleSpacing; + if (group2.hasBarLine) { + if (group2.barSize) { + ruleWidth = calculateSize(group2.barSize, options3); + rule = buildCommon.makeLineSpan("frac-line", options3, ruleWidth); + } else { + rule = buildCommon.makeLineSpan("frac-line", options3); + } + ruleWidth = rule.height; + ruleSpacing = rule.height; + } else { + rule = null; + ruleWidth = 0; + ruleSpacing = options3.fontMetrics().defaultRuleThickness; + } + var numShift; + var clearance; + var denomShift; + if (style3.size === Style$1.DISPLAY.size || group2.size === "display") { + numShift = options3.fontMetrics().num1; + if (ruleWidth > 0) { + clearance = 3 * ruleSpacing; + } else { + clearance = 7 * ruleSpacing; + } + denomShift = options3.fontMetrics().denom1; + } else { + if (ruleWidth > 0) { + numShift = options3.fontMetrics().num2; + clearance = ruleSpacing; + } else { + numShift = options3.fontMetrics().num3; + clearance = 3 * ruleSpacing; + } + denomShift = options3.fontMetrics().denom2; + } + var frac; + if (!rule) { + var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift); + if (candidateClearance < clearance) { + numShift += 0.5 * (clearance - candidateClearance); + denomShift += 0.5 * (clearance - candidateClearance); + } + frac = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: denomm, + shift: denomShift + }, { + type: "elem", + elem: numerm, + shift: -numShift + }] + }, options3); + } else { + var axisHeight = options3.fontMetrics().axisHeight; + if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) { + numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth)); + } + if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) { + denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift)); + } + var midShift = -(axisHeight - 0.5 * ruleWidth); + frac = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: denomm, + shift: denomShift + }, { + type: "elem", + elem: rule, + shift: midShift + }, { + type: "elem", + elem: numerm, + shift: -numShift + }] + }, options3); + } + newOptions = options3.havingStyle(style3); + frac.height *= newOptions.sizeMultiplier / options3.sizeMultiplier; + frac.depth *= newOptions.sizeMultiplier / options3.sizeMultiplier; + var delimSize; + if (style3.size === Style$1.DISPLAY.size) { + delimSize = options3.fontMetrics().delim1; + } else if (style3.size === Style$1.SCRIPTSCRIPT.size) { + delimSize = options3.havingStyle(Style$1.SCRIPT).fontMetrics().delim2; + } else { + delimSize = options3.fontMetrics().delim2; } + var leftDelim; + var rightDelim; + if (group2.leftDelim == null) { + leftDelim = makeNullDelimiter(options3, ["mopen"]); + } else { + leftDelim = delimiter.customSizedDelim(group2.leftDelim, delimSize, true, options3.havingStyle(style3), group2.mode, ["mopen"]); + } + if (group2.continued) { + rightDelim = buildCommon.makeSpan([]); + } else if (group2.rightDelim == null) { + rightDelim = makeNullDelimiter(options3, ["mclose"]); + } else { + rightDelim = delimiter.customSizedDelim(group2.rightDelim, delimSize, true, options3.havingStyle(style3), group2.mode, ["mclose"]); + } + return buildCommon.makeSpan(["mord"].concat(newOptions.sizingClasses(options3)), [leftDelim, buildCommon.makeSpan(["mfrac"], [frac]), rightDelim], options3); + }, "htmlBuilder$4"); + mathmlBuilder$3 = /* @__PURE__ */ __name((group2, options3) => { + var node2 = new mathMLTree.MathNode("mfrac", [buildGroup2(group2.numer, options3), buildGroup2(group2.denom, options3)]); + if (!group2.hasBarLine) { + node2.setAttribute("linethickness", "0px"); + } else if (group2.barSize) { + var ruleWidth = calculateSize(group2.barSize, options3); + node2.setAttribute("linethickness", makeEm(ruleWidth)); + } + var style3 = adjustStyle(group2.size, options3.style); + if (style3.size !== options3.style.size) { + node2 = new mathMLTree.MathNode("mstyle", [node2]); + var isDisplay = style3.size === Style$1.DISPLAY.size ? "true" : "false"; + node2.setAttribute("displaystyle", isDisplay); + node2.setAttribute("scriptlevel", "0"); + } + if (group2.leftDelim != null || group2.rightDelim != null) { + var withDelims = []; + if (group2.leftDelim != null) { + var leftOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group2.leftDelim.replace("\\", ""))]); + leftOp.setAttribute("fence", "true"); + withDelims.push(leftOp); + } + withDelims.push(node2); + if (group2.rightDelim != null) { + var rightOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group2.rightDelim.replace("\\", ""))]); + rightOp.setAttribute("fence", "true"); + withDelims.push(rightOp); + } + return makeRow(withDelims); + } + return node2; + }, "mathmlBuilder$3"); + defineFunction({ + type: "genfrac", + names: [ + "\\dfrac", + "\\frac", + "\\tfrac", + "\\dbinom", + "\\binom", + "\\tbinom", + "\\\\atopfrac", + // can’t be entered directly + "\\\\bracefrac", + "\\\\brackfrac" + // ditto + ], + props: { + numArgs: 2, + allowedInArgument: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21, + funcName + } = _ref; + var numer = args[0]; + var denom = args[1]; + var hasBarLine; + var leftDelim = null; + var rightDelim = null; + var size5 = "auto"; + switch (funcName) { + case "\\dfrac": + case "\\frac": + case "\\tfrac": + hasBarLine = true; + break; + case "\\\\atopfrac": + hasBarLine = false; + break; + case "\\dbinom": + case "\\binom": + case "\\tbinom": + hasBarLine = false; + leftDelim = "("; + rightDelim = ")"; + break; + case "\\\\bracefrac": + hasBarLine = false; + leftDelim = "\\{"; + rightDelim = "\\}"; + break; + case "\\\\brackfrac": + hasBarLine = false; + leftDelim = "["; + rightDelim = "]"; + break; + default: + throw new Error("Unrecognized genfrac command"); + } + switch (funcName) { + case "\\dfrac": + case "\\dbinom": + size5 = "display"; + break; + case "\\tfrac": + case "\\tbinom": + size5 = "text"; + break; + } + return { + type: "genfrac", + mode: parser21.mode, + continued: false, + numer, + denom, + hasBarLine, + leftDelim, + rightDelim, + size: size5, + barSize: null + }; + }, "handler"), + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 }); - return dst; - } - if (dst === void 0 || depth <= 0) { - if (dst !== void 0 && dst !== null && typeof dst === "object" && typeof src === "object") { - return Object.assign(dst, src); - } else { - return src; - } - } - if (src !== void 0 && typeof dst === "object" && typeof src === "object") { - Object.keys(src).forEach((key) => { - if (typeof src[key] === "object" && (dst[key] === void 0 || typeof dst[key] === "object")) { - if (dst[key] === void 0) { - dst[key] = Array.isArray(src[key]) ? [] : {}; + defineFunction({ + type: "genfrac", + names: ["\\cfrac"], + props: { + numArgs: 2 + }, + handler: /* @__PURE__ */ __name((_ref2, args) => { + var { + parser: parser21, + funcName + } = _ref2; + var numer = args[0]; + var denom = args[1]; + return { + type: "genfrac", + mode: parser21.mode, + continued: true, + numer, + denom, + hasBarLine: true, + leftDelim: null, + rightDelim: null, + size: "display", + barSize: null + }; + }, "handler") + }); + defineFunction({ + type: "infix", + names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"], + props: { + numArgs: 0, + infix: true + }, + handler(_ref3) { + var { + parser: parser21, + funcName, + token: token2 + } = _ref3; + var replaceWith; + switch (funcName) { + case "\\over": + replaceWith = "\\frac"; + break; + case "\\choose": + replaceWith = "\\binom"; + break; + case "\\atop": + replaceWith = "\\\\atopfrac"; + break; + case "\\brace": + replaceWith = "\\\\bracefrac"; + break; + case "\\brack": + replaceWith = "\\\\brackfrac"; + break; + default: + throw new Error("Unrecognized infix genfrac command"); } - dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber }); - } else if (clobber || typeof dst[key] !== "object" && typeof src[key] !== "object") { - dst[key] = src[key]; + return { + type: "infix", + mode: parser21.mode, + replaceWith, + token: token2 + }; } }); - } - return dst; - }; - const assignWithDepth$1 = assignWithDepth; - var freeGlobal = typeof global == "object" && global && global.Object === Object && global; - const freeGlobal$1 = freeGlobal; - var freeSelf = typeof self == "object" && self && self.Object === Object && self; - var root = freeGlobal$1 || freeSelf || Function("return this")(); - const root$1 = root; - var Symbol$1 = root$1.Symbol; - const Symbol$2 = Symbol$1; - var objectProto$i = Object.prototype; - var hasOwnProperty$g = objectProto$i.hasOwnProperty; - var nativeObjectToString$1 = objectProto$i.toString; - var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; - function getRawTag(value2) { - var isOwn = hasOwnProperty$g.call(value2, symToStringTag$1), tag = value2[symToStringTag$1]; - try { - value2[symToStringTag$1] = void 0; - var unmasked = true; - } catch (e) { - } - var result = nativeObjectToString$1.call(value2); - if (unmasked) { - if (isOwn) { - value2[symToStringTag$1] = tag; - } else { - delete value2[symToStringTag$1]; - } - } - return result; - } - var objectProto$h = Object.prototype; - var nativeObjectToString = objectProto$h.toString; - function objectToString(value2) { - return nativeObjectToString.call(value2); - } - var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; - var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0; - function baseGetTag(value2) { - if (value2 == null) { - return value2 === void 0 ? undefinedTag : nullTag; - } - return symToStringTag && symToStringTag in Object(value2) ? getRawTag(value2) : objectToString(value2); - } - function isObject$1(value2) { - var type2 = typeof value2; - return value2 != null && (type2 == "object" || type2 == "function"); - } - var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; - function isFunction(value2) { - if (!isObject$1(value2)) { - return false; - } - var tag = baseGetTag(value2); - return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag; - } - var coreJsData = root$1["__core-js_shared__"]; - const coreJsData$1 = coreJsData; - var maskSrcKey = function() { - var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || ""); - return uid ? "Symbol(src)_1." + uid : ""; - }(); - function isMasked(func) { - return !!maskSrcKey && maskSrcKey in func; - } - var funcProto$2 = Function.prototype; - var funcToString$2 = funcProto$2.toString; - function toSource(func) { - if (func != null) { - try { - return funcToString$2.call(func); - } catch (e) { - } - try { - return func + ""; - } catch (e) { - } - } - return ""; - } - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - var reIsHostCtor = /^\[object .+?Constructor\]$/; - var funcProto$1 = Function.prototype, objectProto$g = Object.prototype; - var funcToString$1 = funcProto$1.toString; - var hasOwnProperty$f = objectProto$g.hasOwnProperty; - var reIsNative = RegExp( - "^" + funcToString$1.call(hasOwnProperty$f).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" - ); - function baseIsNative(value2) { - if (!isObject$1(value2) || isMasked(value2)) { - return false; - } - var pattern = isFunction(value2) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value2)); - } - function getValue(object2, key) { - return object2 == null ? void 0 : object2[key]; - } - function getNative(object2, key) { - var value2 = getValue(object2, key); - return baseIsNative(value2) ? value2 : void 0; - } - var nativeCreate = getNative(Object, "create"); - const nativeCreate$1 = nativeCreate; - function hashClear() { - this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {}; - this.size = 0; - } - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - var HASH_UNDEFINED$2 = "__lodash_hash_undefined__"; - var objectProto$f = Object.prototype; - var hasOwnProperty$e = objectProto$f.hasOwnProperty; - function hashGet(key) { - var data = this.__data__; - if (nativeCreate$1) { - var result = data[key]; - return result === HASH_UNDEFINED$2 ? void 0 : result; - } - return hasOwnProperty$e.call(data, key) ? data[key] : void 0; - } - var objectProto$e = Object.prototype; - var hasOwnProperty$d = objectProto$e.hasOwnProperty; - function hashHas(key) { - var data = this.__data__; - return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$d.call(data, key); - } - var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; - function hashSet(key, value2) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = nativeCreate$1 && value2 === void 0 ? HASH_UNDEFINED$1 : value2; - return this; - } - function Hash(entries2) { - var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index2 < length2) { - var entry = entries2[index2]; - this.set(entry[0], entry[1]); - } - } - Hash.prototype.clear = hashClear; - Hash.prototype["delete"] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - function eq(value2, other) { - return value2 === other || value2 !== value2 && other !== other; - } - function assocIndexOf(array2, key) { - var length2 = array2.length; - while (length2--) { - if (eq(array2[length2][0], key)) { - return length2; - } - } - return -1; - } - var arrayProto = Array.prototype; - var splice$1 = arrayProto.splice; - function listCacheDelete(key) { - var data = this.__data__, index2 = assocIndexOf(data, key); - if (index2 < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index2 == lastIndex) { - data.pop(); - } else { - splice$1.call(data, index2, 1); - } - --this.size; - return true; - } - function listCacheGet(key) { - var data = this.__data__, index2 = assocIndexOf(data, key); - return index2 < 0 ? void 0 : data[index2][1]; - } - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - function listCacheSet(key, value2) { - var data = this.__data__, index2 = assocIndexOf(data, key); - if (index2 < 0) { - ++this.size; - data.push([key, value2]); - } else { - data[index2][1] = value2; - } - return this; - } - function ListCache(entries2) { - var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index2 < length2) { - var entry = entries2[index2]; - this.set(entry[0], entry[1]); - } - } - ListCache.prototype.clear = listCacheClear; - ListCache.prototype["delete"] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - var Map$1 = getNative(root$1, "Map"); - const Map$2 = Map$1; - function mapCacheClear() { - this.size = 0; - this.__data__ = { - "hash": new Hash(), - "map": new (Map$2 || ListCache)(), - "string": new Hash() - }; - } - function isKeyable(value2) { - var type2 = typeof value2; - return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value2 !== "__proto__" : value2 === null; - } - function getMapData(map2, key) { - var data = map2.__data__; - return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; - } - function mapCacheDelete(key) { - var result = getMapData(this, key)["delete"](key); - this.size -= result ? 1 : 0; - return result; - } - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - function mapCacheSet(key, value2) { - var data = getMapData(this, key), size2 = data.size; - data.set(key, value2); - this.size += data.size == size2 ? 0 : 1; - return this; - } - function MapCache(entries2) { - var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index2 < length2) { - var entry = entries2[index2]; - this.set(entry[0], entry[1]); - } - } - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype["delete"] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - var FUNC_ERROR_TEXT = "Expected a function"; - function memoize(func, resolver2) { - if (typeof func != "function" || resolver2 != null && typeof resolver2 != "function") { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, key = resolver2 ? resolver2.apply(this, args) : args[0], cache = memoized.cache; - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache)(); - return memoized; - } - memoize.Cache = MapCache; - function stackClear() { - this.__data__ = new ListCache(); - this.size = 0; - } - function stackDelete(key) { - var data = this.__data__, result = data["delete"](key); - this.size = data.size; - return result; - } - function stackGet(key) { - return this.__data__.get(key); - } - function stackHas(key) { - return this.__data__.has(key); - } - var LARGE_ARRAY_SIZE$1 = 200; - function stackSet(key, value2) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs2 = data.__data__; - if (!Map$2 || pairs2.length < LARGE_ARRAY_SIZE$1 - 1) { - pairs2.push([key, value2]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs2); - } - data.set(key, value2); - this.size = data.size; - return this; - } - function Stack(entries2) { - var data = this.__data__ = new ListCache(entries2); - this.size = data.size; - } - Stack.prototype.clear = stackClear; - Stack.prototype["delete"] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - var defineProperty = function() { - try { - var func = getNative(Object, "defineProperty"); - func({}, "", {}); - return func; - } catch (e) { - } - }(); - const defineProperty$1 = defineProperty; - function baseAssignValue(object2, key, value2) { - if (key == "__proto__" && defineProperty$1) { - defineProperty$1(object2, key, { - "configurable": true, - "enumerable": true, - "value": value2, - "writable": true + stylArray = ["display", "text", "script", "scriptscript"]; + delimFromValue = /* @__PURE__ */ __name(function delimFromValue2(delimString) { + var delim = null; + if (delimString.length > 0) { + delim = delimString; + delim = delim === "." ? null : delim; + } + return delim; + }, "delimFromValue"); + defineFunction({ + type: "genfrac", + names: ["\\genfrac"], + props: { + numArgs: 6, + allowedInArgument: true, + argTypes: ["math", "math", "size", "text", "math", "math"] + }, + handler(_ref4, args) { + var { + parser: parser21 + } = _ref4; + var numer = args[4]; + var denom = args[5]; + var leftNode = normalizeArgument(args[0]); + var leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null; + var rightNode = normalizeArgument(args[1]); + var rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null; + var barNode = assertNodeType(args[2], "size"); + var hasBarLine; + var barSize = null; + if (barNode.isBlank) { + hasBarLine = true; + } else { + barSize = barNode.value; + hasBarLine = barSize.number > 0; + } + var size5 = "auto"; + var styl = args[3]; + if (styl.type === "ordgroup") { + if (styl.body.length > 0) { + var textOrd = assertNodeType(styl.body[0], "textord"); + size5 = stylArray[Number(textOrd.text)]; + } + } else { + styl = assertNodeType(styl, "textord"); + size5 = stylArray[Number(styl.text)]; + } + return { + type: "genfrac", + mode: parser21.mode, + numer, + denom, + continued: false, + hasBarLine, + barSize, + leftDelim, + rightDelim, + size: size5 + }; + }, + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 }); - } else { - object2[key] = value2; - } - } - function assignMergeValue(object2, key, value2) { - if (value2 !== void 0 && !eq(object2[key], value2) || value2 === void 0 && !(key in object2)) { - baseAssignValue(object2, key, value2); - } - } - function createBaseFor(fromRight) { - return function(object2, iteratee, keysFunc) { - var index2 = -1, iterable = Object(object2), props = keysFunc(object2), length2 = props.length; - while (length2--) { - var key = props[fromRight ? length2 : ++index2]; - if (iteratee(iterable[key], key, iterable) === false) { - break; + defineFunction({ + type: "infix", + names: ["\\above"], + props: { + numArgs: 1, + argTypes: ["size"], + infix: true + }, + handler(_ref5, args) { + var { + parser: parser21, + funcName, + token: token2 + } = _ref5; + return { + type: "infix", + mode: parser21.mode, + replaceWith: "\\\\abovefrac", + size: assertNodeType(args[0], "size").value, + token: token2 + }; } - } - return object2; - }; - } - var baseFor = createBaseFor(); - const baseFor$1 = baseFor; - var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports; - var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module; - var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2; - var Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0; - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2); - buffer.copy(result); - return result; - } - var Uint8Array$1 = root$1.Uint8Array; - const Uint8Array$2 = Uint8Array$1; - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array$2(result).set(new Uint8Array$2(arrayBuffer)); - return result; - } - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - function copyArray(source, array2) { - var index2 = -1, length2 = source.length; - array2 || (array2 = Array(length2)); - while (++index2 < length2) { - array2[index2] = source[index2]; - } - return array2; - } - var objectCreate = Object.create; - var baseCreate = function() { - function object2() { - } - return function(proto) { - if (!isObject$1(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object2.prototype = proto; - var result = new object2(); - object2.prototype = void 0; - return result; - }; - }(); - const baseCreate$1 = baseCreate; - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - var getPrototype = overArg(Object.getPrototypeOf, Object); - const getPrototype$1 = getPrototype; - var objectProto$d = Object.prototype; - function isPrototype(value2) { - var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$d; - return value2 === proto; - } - function initCloneObject(object2) { - return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate$1(getPrototype$1(object2)) : {}; - } - function isObjectLike(value2) { - return value2 != null && typeof value2 == "object"; - } - var argsTag$3 = "[object Arguments]"; - function baseIsArguments(value2) { - return isObjectLike(value2) && baseGetTag(value2) == argsTag$3; - } - var objectProto$c = Object.prototype; - var hasOwnProperty$c = objectProto$c.hasOwnProperty; - var propertyIsEnumerable$1 = objectProto$c.propertyIsEnumerable; - var isArguments = baseIsArguments(function() { - return arguments; - }()) ? baseIsArguments : function(value2) { - return isObjectLike(value2) && hasOwnProperty$c.call(value2, "callee") && !propertyIsEnumerable$1.call(value2, "callee"); - }; - const isArguments$1 = isArguments; - var isArray = Array.isArray; - const isArray$1 = isArray; - var MAX_SAFE_INTEGER$1 = 9007199254740991; - function isLength(value2) { - return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER$1; - } - function isArrayLike(value2) { - return value2 != null && isLength(value2.length) && !isFunction(value2); - } - function isArrayLikeObject(value2) { - return isObjectLike(value2) && isArrayLike(value2); - } - function stubFalse() { - return false; - } - var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports; - var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module; - var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; - var Buffer = moduleExports$1 ? root$1.Buffer : void 0; - var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0; - var isBuffer = nativeIsBuffer || stubFalse; - const isBuffer$1 = isBuffer; - var objectTag$4 = "[object Object]"; - var funcProto = Function.prototype, objectProto$b = Object.prototype; - var funcToString = funcProto.toString; - var hasOwnProperty$b = objectProto$b.hasOwnProperty; - var objectCtorString = funcToString.call(Object); - function isPlainObject(value2) { - if (!isObjectLike(value2) || baseGetTag(value2) != objectTag$4) { - return false; - } - var proto = getPrototype$1(value2); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty$b.call(proto, "constructor") && proto.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; - } - var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$6 = "[object Map]", numberTag$3 = "[object Number]", objectTag$3 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$6 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]"; - var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]"; - var typedArrayTags = {}; - typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true; - typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$6] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$6] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false; - function baseIsTypedArray(value2) { - return isObjectLike(value2) && isLength(value2.length) && !!typedArrayTags[baseGetTag(value2)]; - } - function baseUnary(func) { - return function(value2) { - return func(value2); - }; - } - var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; - var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; - var moduleExports = freeModule && freeModule.exports === freeExports; - var freeProcess = moduleExports && freeGlobal$1.process; - var nodeUtil = function() { - try { - var types = freeModule && freeModule.require && freeModule.require("util").types; - if (types) { - return types; - } - return freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (e) { - } - }(); - const nodeUtil$1 = nodeUtil; - var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray; - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - const isTypedArray$1 = isTypedArray; - function safeGet(object2, key) { - if (key === "constructor" && typeof object2[key] === "function") { - return; - } - if (key == "__proto__") { - return; - } - return object2[key]; - } - var objectProto$a = Object.prototype; - var hasOwnProperty$a = objectProto$a.hasOwnProperty; - function assignValue(object2, key, value2) { - var objValue = object2[key]; - if (!(hasOwnProperty$a.call(object2, key) && eq(objValue, value2)) || value2 === void 0 && !(key in object2)) { - baseAssignValue(object2, key, value2); - } - } - function copyObject(source, props, object2, customizer) { - var isNew = !object2; - object2 || (object2 = {}); - var index2 = -1, length2 = props.length; - while (++index2 < length2) { - var key = props[index2]; - var newValue = customizer ? customizer(object2[key], source[key], key, object2, source) : void 0; - if (newValue === void 0) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object2, key, newValue); - } else { - assignValue(object2, key, newValue); - } - } - return object2; - } - function baseTimes(n, iteratee) { - var index2 = -1, result = Array(n); - while (++index2 < n) { - result[index2] = iteratee(index2); - } - return result; - } - var MAX_SAFE_INTEGER = 9007199254740991; - var reIsUint = /^(?:0|[1-9]\d*)$/; - function isIndex(value2, length2) { - var type2 = typeof value2; - length2 = length2 == null ? MAX_SAFE_INTEGER : length2; - return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2); - } - var objectProto$9 = Object.prototype; - var hasOwnProperty$9 = objectProto$9.hasOwnProperty; - function arrayLikeKeys(value2, inherited) { - var isArr = isArray$1(value2), isArg = !isArr && isArguments$1(value2), isBuff = !isArr && !isArg && isBuffer$1(value2), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value2), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value2.length, String) : [], length2 = result.length; - for (var key in value2) { - if ((inherited || hasOwnProperty$9.call(value2, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. - (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. - isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. - isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. - isIndex(key, length2)))) { - result.push(key); - } - } - return result; - } - function nativeKeysIn(object2) { - var result = []; - if (object2 != null) { - for (var key in Object(object2)) { - result.push(key); - } - } - return result; - } - var objectProto$8 = Object.prototype; - var hasOwnProperty$8 = objectProto$8.hasOwnProperty; - function baseKeysIn(object2) { - if (!isObject$1(object2)) { - return nativeKeysIn(object2); - } - var isProto = isPrototype(object2), result = []; - for (var key in object2) { - if (!(key == "constructor" && (isProto || !hasOwnProperty$8.call(object2, key)))) { - result.push(key); - } - } - return result; - } - function keysIn(object2) { - return isArrayLike(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2); - } - function toPlainObject(value2) { - return copyObject(value2, keysIn(value2)); - } - function baseMergeDeep(object2, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object2, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); - if (stacked) { - assignMergeValue(object2, key, stacked); - return; - } - var newValue = customizer ? customizer(objValue, srcValue, key + "", object2, source, stack) : void 0; - var isCommon = newValue === void 0; - if (isCommon) { - var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer$1(srcValue), isTyped = !isArr && !isBuff && isTypedArray$1(srcValue); - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray$1(objValue)) { - newValue = objValue; - } else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); + }); + defineFunction({ + type: "genfrac", + names: ["\\\\abovefrac"], + props: { + numArgs: 3, + argTypes: ["math", "size", "math"] + }, + handler: /* @__PURE__ */ __name((_ref6, args) => { + var { + parser: parser21, + funcName + } = _ref6; + var numer = args[0]; + var barSize = assert(assertNodeType(args[1], "infix").size); + var denom = args[2]; + var hasBarLine = barSize.number > 0; + return { + type: "genfrac", + mode: parser21.mode, + numer, + denom, + continued: false, + hasBarLine, + barSize, + leftDelim: null, + rightDelim: null, + size: "auto" + }; + }, "handler"), + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 + }); + htmlBuilder$3 = /* @__PURE__ */ __name((grp, options3) => { + var style3 = options3.style; + var supSubGroup; + var group2; + if (grp.type === "supsub") { + supSubGroup = grp.sup ? buildGroup$1(grp.sup, options3.havingStyle(style3.sup()), options3) : buildGroup$1(grp.sub, options3.havingStyle(style3.sub()), options3); + group2 = assertNodeType(grp.base, "horizBrace"); } else { - newValue = []; + group2 = assertNodeType(grp, "horizBrace"); + } + var body = buildGroup$1(group2.base, options3.havingBaseStyle(Style$1.DISPLAY)); + var braceBody = stretchy.svgSpan(group2, options3); + var vlist; + if (group2.isOver) { + vlist = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: body + }, { + type: "kern", + size: 0.1 + }, { + type: "elem", + elem: braceBody + }] + }, options3); + vlist.children[0].children[0].children[1].classes.push("svg-align"); + } else { + vlist = buildCommon.makeVList({ + positionType: "bottom", + positionData: body.depth + 0.1 + braceBody.height, + children: [{ + type: "elem", + elem: braceBody + }, { + type: "kern", + size: 0.1 + }, { + type: "elem", + elem: body + }] + }, options3); + vlist.children[0].children[0].children[0].classes.push("svg-align"); + } + if (supSubGroup) { + var vSpan = buildCommon.makeSpan(["mord", group2.isOver ? "mover" : "munder"], [vlist], options3); + if (group2.isOver) { + vlist = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: vSpan + }, { + type: "kern", + size: 0.2 + }, { + type: "elem", + elem: supSubGroup + }] + }, options3); + } else { + vlist = buildCommon.makeVList({ + positionType: "bottom", + positionData: vSpan.depth + 0.2 + supSubGroup.height + supSubGroup.depth, + children: [{ + type: "elem", + elem: supSubGroup + }, { + type: "kern", + size: 0.2 + }, { + type: "elem", + elem: vSpan + }] + }, options3); + } + } + return buildCommon.makeSpan(["mord", group2.isOver ? "mover" : "munder"], [vlist], options3); + }, "htmlBuilder$3"); + mathmlBuilder$2 = /* @__PURE__ */ __name((group2, options3) => { + var accentNode = stretchy.mathMLnode(group2.label); + return new mathMLTree.MathNode(group2.isOver ? "mover" : "munder", [buildGroup2(group2.base, options3), accentNode]); + }, "mathmlBuilder$2"); + defineFunction({ + type: "horizBrace", + names: ["\\overbrace", "\\underbrace"], + props: { + numArgs: 1 + }, + handler(_ref, args) { + var { + parser: parser21, + funcName + } = _ref; + return { + type: "horizBrace", + mode: parser21.mode, + label: funcName, + isOver: /^\\over/.test(funcName), + base: args[0] + }; + }, + htmlBuilder: htmlBuilder$3, + mathmlBuilder: mathmlBuilder$2 + }); + defineFunction({ + type: "href", + names: ["\\href"], + props: { + numArgs: 2, + argTypes: ["url", "original"], + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21 + } = _ref; + var body = args[1]; + var href = assertNodeType(args[0], "url").url; + if (!parser21.settings.isTrusted({ + command: "\\href", + url: href + })) { + return parser21.formatUnsupportedCmd("\\href"); + } + return { + type: "href", + mode: parser21.mode, + href, + body: ordargument(body) + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var elements3 = buildExpression$1(group2.body, options3, false); + return buildCommon.makeAnchor(group2.href, [], elements3, options3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var math2 = buildExpressionRow(group2.body, options3); + if (!(math2 instanceof MathNode)) { + math2 = new MathNode("mrow", [math2]); + } + math2.setAttribute("href", group2.href); + return math2; + }, "mathmlBuilder") + }); + defineFunction({ + type: "href", + names: ["\\url"], + props: { + numArgs: 1, + argTypes: ["url"], + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref2, args) => { + var { + parser: parser21 + } = _ref2; + var href = assertNodeType(args[0], "url").url; + if (!parser21.settings.isTrusted({ + command: "\\url", + url: href + })) { + return parser21.formatUnsupportedCmd("\\url"); + } + var chars = []; + for (var i2 = 0; i2 < href.length; i2++) { + var c3 = href[i2]; + if (c3 === "~") { + c3 = "\\textasciitilde"; + } + chars.push({ + type: "textord", + mode: "text", + text: c3 + }); + } + var body = { + type: "text", + mode: parser21.mode, + font: "\\texttt", + body: chars + }; + return { + type: "href", + mode: parser21.mode, + href, + body: ordargument(body) + }; + }, "handler") + }); + defineFunction({ + type: "hbox", + names: ["\\hbox"], + props: { + numArgs: 1, + argTypes: ["text"], + allowedInText: true, + primitive: true + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + return { + type: "hbox", + mode: parser21.mode, + body: ordargument(args[0]) + }; + }, + htmlBuilder(group2, options3) { + var elements3 = buildExpression$1(group2.body, options3, false); + return buildCommon.makeFragment(elements3); + }, + mathmlBuilder(group2, options3) { + return new mathMLTree.MathNode("mrow", buildExpression2(group2.body, options3)); } - } else if (isPlainObject(srcValue) || isArguments$1(srcValue)) { - newValue = objValue; - if (isArguments$1(objValue)) { - newValue = toPlainObject(objValue); - } else if (!isObject$1(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); + }); + defineFunction({ + type: "html", + names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"], + props: { + numArgs: 2, + argTypes: ["raw", "original"], + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21, + funcName, + token: token2 + } = _ref; + var value2 = assertNodeType(args[0], "raw").string; + var body = args[1]; + if (parser21.settings.strict) { + parser21.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode"); + } + var trustContext; + var attributes = {}; + switch (funcName) { + case "\\htmlClass": + attributes.class = value2; + trustContext = { + command: "\\htmlClass", + class: value2 + }; + break; + case "\\htmlId": + attributes.id = value2; + trustContext = { + command: "\\htmlId", + id: value2 + }; + break; + case "\\htmlStyle": + attributes.style = value2; + trustContext = { + command: "\\htmlStyle", + style: value2 + }; + break; + case "\\htmlData": { + var data5 = value2.split(","); + for (var i2 = 0; i2 < data5.length; i2++) { + var keyVal = data5[i2].split("="); + if (keyVal.length !== 2) { + throw new ParseError("Error parsing key-value for \\htmlData"); + } + attributes["data-" + keyVal[0].trim()] = keyVal[1].trim(); + } + trustContext = { + command: "\\htmlData", + attributes + }; + break; + } + default: + throw new Error("Unrecognized html command"); + } + if (!parser21.settings.isTrusted(trustContext)) { + return parser21.formatUnsupportedCmd(funcName); + } + return { + type: "html", + mode: parser21.mode, + attributes, + body: ordargument(body) + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var elements3 = buildExpression$1(group2.body, options3, false); + var classes6 = ["enclosing"]; + if (group2.attributes.class) { + classes6.push(...group2.attributes.class.trim().split(/\s+/)); + } + var span = buildCommon.makeSpan(classes6, elements3, options3); + for (var attr in group2.attributes) { + if (attr !== "class" && group2.attributes.hasOwnProperty(attr)) { + span.setAttribute(attr, group2.attributes[attr]); + } + } + return span; + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + return buildExpressionRow(group2.body, options3); + }, "mathmlBuilder") + }); + defineFunction({ + type: "htmlmathml", + names: ["\\html@mathml"], + props: { + numArgs: 2, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21 + } = _ref; + return { + type: "htmlmathml", + mode: parser21.mode, + html: ordargument(args[0]), + mathml: ordargument(args[1]) + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var elements3 = buildExpression$1(group2.html, options3, false); + return buildCommon.makeFragment(elements3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + return buildExpressionRow(group2.mathml, options3); + }, "mathmlBuilder") + }); + sizeData = /* @__PURE__ */ __name(function sizeData2(str2) { + if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str2)) { + return { + number: +str2, + unit: "bp" + }; + } else { + var match2 = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str2); + if (!match2) { + throw new ParseError("Invalid size: '" + str2 + "' in \\includegraphics"); + } + var data5 = { + number: +(match2[1] + match2[2]), + // sign + magnitude, cast to number + unit: match2[3] + }; + if (!validUnit(data5)) { + throw new ParseError("Invalid unit: '" + data5.unit + "' in \\includegraphics."); + } + return data5; } - } else { - isCommon = false; - } - } - if (isCommon) { - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack["delete"](srcValue); - } - assignMergeValue(object2, key, newValue); - } - function baseMerge(object2, source, srcIndex, customizer, stack) { - if (object2 === source) { - return; - } - baseFor$1(source, function(srcValue, key) { - stack || (stack = new Stack()); - if (isObject$1(srcValue)) { - baseMergeDeep(object2, source, key, srcIndex, baseMerge, customizer, stack); - } else { - var newValue = customizer ? customizer(safeGet(object2, key), srcValue, key + "", object2, source, stack) : void 0; - if (newValue === void 0) { - newValue = srcValue; + }, "sizeData"); + defineFunction({ + type: "includegraphics", + names: ["\\includegraphics"], + props: { + numArgs: 1, + numOptionalArgs: 1, + argTypes: ["raw", "url"], + allowedInText: false + }, + handler: /* @__PURE__ */ __name((_ref, args, optArgs) => { + var { + parser: parser21 + } = _ref; + var width3 = { + number: 0, + unit: "em" + }; + var height2 = { + number: 0.9, + unit: "em" + }; + var totalheight = { + number: 0, + unit: "em" + }; + var alt = ""; + if (optArgs[0]) { + var attributeStr = assertNodeType(optArgs[0], "raw").string; + var attributes = attributeStr.split(","); + for (var i2 = 0; i2 < attributes.length; i2++) { + var keyVal = attributes[i2].split("="); + if (keyVal.length === 2) { + var str2 = keyVal[1].trim(); + switch (keyVal[0].trim()) { + case "alt": + alt = str2; + break; + case "width": + width3 = sizeData(str2); + break; + case "height": + height2 = sizeData(str2); + break; + case "totalheight": + totalheight = sizeData(str2); + break; + default: + throw new ParseError("Invalid key: '" + keyVal[0] + "' in \\includegraphics."); + } + } + } + } + var src = assertNodeType(args[0], "url").url; + if (alt === "") { + alt = src; + alt = alt.replace(/^.*[\\/]/, ""); + alt = alt.substring(0, alt.lastIndexOf(".")); + } + if (!parser21.settings.isTrusted({ + command: "\\includegraphics", + url: src + })) { + return parser21.formatUnsupportedCmd("\\includegraphics"); + } + return { + type: "includegraphics", + mode: parser21.mode, + alt, + width: width3, + height: height2, + totalheight, + src + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var height2 = calculateSize(group2.height, options3); + var depth = 0; + if (group2.totalheight.number > 0) { + depth = calculateSize(group2.totalheight, options3) - height2; + } + var width3 = 0; + if (group2.width.number > 0) { + width3 = calculateSize(group2.width, options3); + } + var style3 = { + height: makeEm(height2 + depth) + }; + if (width3 > 0) { + style3.width = makeEm(width3); + } + if (depth > 0) { + style3.verticalAlign = makeEm(-depth); + } + var node2 = new Img(group2.src, group2.alt, style3); + node2.height = height2; + node2.depth = depth; + return node2; + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var node2 = new mathMLTree.MathNode("mglyph", []); + node2.setAttribute("alt", group2.alt); + var height2 = calculateSize(group2.height, options3); + var depth = 0; + if (group2.totalheight.number > 0) { + depth = calculateSize(group2.totalheight, options3) - height2; + node2.setAttribute("valign", makeEm(-depth)); + } + node2.setAttribute("height", makeEm(height2 + depth)); + if (group2.width.number > 0) { + var width3 = calculateSize(group2.width, options3); + node2.setAttribute("width", makeEm(width3)); + } + node2.setAttribute("src", group2.src); + return node2; + }, "mathmlBuilder") + }); + defineFunction({ + type: "kern", + names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"], + props: { + numArgs: 1, + argTypes: ["size"], + primitive: true, + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser21, + funcName + } = _ref; + var size5 = assertNodeType(args[0], "size"); + if (parser21.settings.strict) { + var mathFunction = funcName[1] === "m"; + var muUnit = size5.value.unit === "mu"; + if (mathFunction) { + if (!muUnit) { + parser21.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size5.value.unit + " units")); + } + if (parser21.mode !== "math") { + parser21.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode"); + } + } else { + if (muUnit) { + parser21.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units"); + } + } + } + return { + type: "kern", + mode: parser21.mode, + dimension: size5.value + }; + }, + htmlBuilder(group2, options3) { + return buildCommon.makeGlue(group2.dimension, options3); + }, + mathmlBuilder(group2, options3) { + var dimension = calculateSize(group2.dimension, options3); + return new mathMLTree.SpaceNode(dimension); } - assignMergeValue(object2, key, newValue); - } - }, keysIn); - } - function identity(value2) { - return value2; - } - function apply$1(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - var nativeMax$2 = Math.max; - function overRest(func, start2, transform) { - start2 = nativeMax$2(start2 === void 0 ? func.length - 1 : start2, 0); - return function() { - var args = arguments, index2 = -1, length2 = nativeMax$2(args.length - start2, 0), array2 = Array(length2); - while (++index2 < length2) { - array2[index2] = args[start2 + index2]; - } - index2 = -1; - var otherArgs = Array(start2 + 1); - while (++index2 < start2) { - otherArgs[index2] = args[index2]; - } - otherArgs[start2] = transform(array2); - return apply$1(func, this, otherArgs); - }; - } - function constant$2(value2) { - return function() { - return value2; - }; - } - var baseSetToString = !defineProperty$1 ? identity : function(func, string2) { - return defineProperty$1(func, "toString", { - "configurable": true, - "enumerable": false, - "value": constant$2(string2), - "writable": true - }); - }; - const baseSetToString$1 = baseSetToString; - var HOT_COUNT = 800, HOT_SPAN = 16; - var nativeNow = Date.now; - function shortOut(func) { - var count = 0, lastCalled = 0; - return function() { - var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; + }); + defineFunction({ + type: "lap", + names: ["\\mathllap", "\\mathrlap", "\\mathclap"], + props: { + numArgs: 1, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21, + funcName + } = _ref; + var body = args[0]; + return { + type: "lap", + mode: parser21.mode, + alignment: funcName.slice(5), + body + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var inner2; + if (group2.alignment === "clap") { + inner2 = buildCommon.makeSpan([], [buildGroup$1(group2.body, options3)]); + inner2 = buildCommon.makeSpan(["inner"], [inner2], options3); + } else { + inner2 = buildCommon.makeSpan(["inner"], [buildGroup$1(group2.body, options3)]); + } + var fix = buildCommon.makeSpan(["fix"], []); + var node2 = buildCommon.makeSpan([group2.alignment], [inner2, fix], options3); + var strut = buildCommon.makeSpan(["strut"]); + strut.style.height = makeEm(node2.height + node2.depth); + if (node2.depth) { + strut.style.verticalAlign = makeEm(-node2.depth); + } + node2.children.unshift(strut); + node2 = buildCommon.makeSpan(["thinbox"], [node2], options3); + return buildCommon.makeSpan(["mord", "vbox"], [node2], options3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var node2 = new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options3)]); + if (group2.alignment !== "rlap") { + var offset = group2.alignment === "llap" ? "-1" : "-0.5"; + node2.setAttribute("lspace", offset + "width"); + } + node2.setAttribute("width", "0px"); + return node2; + }, "mathmlBuilder") + }); + defineFunction({ + type: "styling", + names: ["\\(", "$"], + props: { + numArgs: 0, + allowedInText: true, + allowedInMath: false + }, + handler(_ref, args) { + var { + funcName, + parser: parser21 + } = _ref; + var outerMode = parser21.mode; + parser21.switchMode("math"); + var close2 = funcName === "\\(" ? "\\)" : "$"; + var body = parser21.parseExpression(false, close2); + parser21.expect(close2); + parser21.switchMode(outerMode); + return { + type: "styling", + mode: parser21.mode, + style: "text", + body + }; } - } else { - count = 0; - } - return func.apply(void 0, arguments); - }; - } - var setToString = shortOut(baseSetToString$1); - const setToString$1 = setToString; - function baseRest(func, start2) { - return setToString$1(overRest(func, start2, identity), func + ""); - } - function isIterateeCall(value2, index2, object2) { - if (!isObject$1(object2)) { - return false; - } - var type2 = typeof index2; - if (type2 == "number" ? isArrayLike(object2) && isIndex(index2, object2.length) : type2 == "string" && index2 in object2) { - return eq(object2[index2], value2); - } - return false; - } - function createAssigner(assigner) { - return baseRest(function(object2, sources) { - var index2 = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0; - customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length2 < 3 ? void 0 : customizer; - length2 = 1; - } - object2 = Object(object2); - while (++index2 < length2) { - var source = sources[index2]; - if (source) { - assigner(object2, source, index2, customizer); + }); + defineFunction({ + type: "text", + // Doesn't matter what this is. + names: ["\\)", "\\]"], + props: { + numArgs: 0, + allowedInText: true, + allowedInMath: false + }, + handler(context, args) { + throw new ParseError("Mismatched " + context.funcName); } - } - return object2; - }); - } - var merge$2 = createAssigner(function(object2, source, srcIndex) { - baseMerge(object2, source, srcIndex); - }); - const merge$3 = merge$2; - const ZERO_WIDTH_SPACE = "​"; - const d3CurveTypes = { - curveBasis, - curveBasisClosed, - curveBasisOpen, - curveBumpX: bumpX, - curveBumpY: bumpY, - curveBundle, - curveCardinalClosed, - curveCardinalOpen, - curveCardinal, - curveCatmullRomClosed, - curveCatmullRomOpen, - curveCatmullRom, - curveLinear, - curveLinearClosed, - curveMonotoneX: monotoneX, - curveMonotoneY: monotoneY, - curveNatural, - curveStep, - curveStepAfter: stepAfter, - curveStepBefore: stepBefore - }; - const directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi; - const detectInit = function(text2, config2) { - const inits = detectDirective(text2, /(?:init\b)|(?:initialize\b)/); - let results = {}; - if (Array.isArray(inits)) { - const args = inits.map((init2) => init2.args); - sanitizeDirective(args); - results = assignWithDepth$1(results, [...args]); - } else { - results = inits.args; - } - if (!results) { - return; - } - let type2 = detectType(text2, config2); - const prop = "config"; - if (results[prop] !== void 0) { - if (type2 === "flowchart-v2") { - type2 = "flowchart"; - } - results[type2] = results[prop]; - delete results[prop]; - } - return results; - }; - const detectDirective = function(text2, type2 = null) { - try { - const commentWithoutDirectives = new RegExp( - `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).* -`, - "ig" - ); - text2 = text2.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"'); - log$1.debug( - `Detecting diagram directive${type2 !== null ? " type:" + type2 : ""} based on the text:${text2}` - ); - let match; - const result = []; - while ((match = directiveRegex.exec(text2)) !== null) { - if (match.index === directiveRegex.lastIndex) { - directiveRegex.lastIndex++; + }); + chooseMathStyle = /* @__PURE__ */ __name((group2, options3) => { + switch (options3.style.size) { + case Style$1.DISPLAY.size: + return group2.display; + case Style$1.TEXT.size: + return group2.text; + case Style$1.SCRIPT.size: + return group2.script; + case Style$1.SCRIPTSCRIPT.size: + return group2.scriptscript; + default: + return group2.text; } - if (match && !type2 || type2 && match[1] && match[1].match(type2) || type2 && match[2] && match[2].match(type2)) { - const type22 = match[1] ? match[1] : match[2]; - const args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null; - result.push({ type: type22, args }); + }, "chooseMathStyle"); + defineFunction({ + type: "mathchoice", + names: ["\\mathchoice"], + props: { + numArgs: 4, + primitive: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21 + } = _ref; + return { + type: "mathchoice", + mode: parser21.mode, + display: ordargument(args[0]), + text: ordargument(args[1]), + script: ordargument(args[2]), + scriptscript: ordargument(args[3]) + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var body = chooseMathStyle(group2, options3); + var elements3 = buildExpression$1(body, options3, false); + return buildCommon.makeFragment(elements3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var body = chooseMathStyle(group2, options3); + return buildExpressionRow(body, options3); + }, "mathmlBuilder") + }); + assembleSupSub = /* @__PURE__ */ __name((base, supGroup, subGroup, options3, style3, slant, baseShift) => { + base = buildCommon.makeSpan([], [base]); + var subIsSingleCharacter = subGroup && utils.isCharacterBox(subGroup); + var sub2; + var sup2; + if (supGroup) { + var elem = buildGroup$1(supGroup, options3.havingStyle(style3.sup()), options3); + sup2 = { + elem, + kern: Math.max(options3.fontMetrics().bigOpSpacing1, options3.fontMetrics().bigOpSpacing3 - elem.depth) + }; } - } - if (result.length === 0) { - return { type: text2, args: null }; - } - return result.length === 1 ? result[0] : result; - } catch (error) { - log$1.error( - `ERROR: ${error.message} - Unable to parse directive type: '${type2}' based on the text: '${text2}'` - ); - return { type: void 0, args: null }; - } - }; - const removeDirectives = function(text2) { - return text2.replace(directiveRegex, ""); - }; - const isSubstringInArray = function(str2, arr) { - for (const [i2, element2] of arr.entries()) { - if (element2.match(str2)) { - return i2; - } - } - return -1; - }; - function interpolateToCurve(interpolate2, defaultCurve) { - if (!interpolate2) { - return defaultCurve; - } - const curveName = `curve${interpolate2.charAt(0).toUpperCase() + interpolate2.slice(1)}`; - return d3CurveTypes[curveName] ?? defaultCurve; - } - function formatUrl(linkStr, config2) { - const url = linkStr.trim(); - if (!url) { - return void 0; - } - if (config2.securityLevel !== "loose") { - return dist.sanitizeUrl(url); - } - return url; - } - const runFunc = (functionName, ...params) => { - const arrPaths = functionName.split("."); - const len = arrPaths.length - 1; - const fnName = arrPaths[len]; - let obj = window; - for (let i2 = 0; i2 < len; i2++) { - obj = obj[arrPaths[i2]]; - if (!obj) { - log$1.error(`Function name: ${functionName} not found in window`); - return; - } - } - obj[fnName](...params); - }; - function distance(p1, p2) { - if (!p1 || !p2) { - return 0; - } - return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); - } - function traverseEdge(points) { - let prevPoint; - let totalDistance = 0; - points.forEach((point2) => { - totalDistance += distance(point2, prevPoint); - prevPoint = point2; - }); - const remainingDistance = totalDistance / 2; - return calculatePoint(points, remainingDistance); - } - function calcLabelPosition(points) { - if (points.length === 1) { - return points[0]; - } - return traverseEdge(points); - } - const roundNumber = (num, precision = 2) => { - const factor = Math.pow(10, precision); - return Math.round(num * factor) / factor; - }; - const calculatePoint = (points, distanceToTraverse) => { - let prevPoint = void 0; - let remainingDistance = distanceToTraverse; - for (const point2 of points) { - if (prevPoint) { - const vectorDistance = distance(point2, prevPoint); - if (vectorDistance < remainingDistance) { - remainingDistance -= vectorDistance; + if (subGroup) { + var _elem = buildGroup$1(subGroup, options3.havingStyle(style3.sub()), options3); + sub2 = { + elem: _elem, + kern: Math.max(options3.fontMetrics().bigOpSpacing2, options3.fontMetrics().bigOpSpacing4 - _elem.height) + }; + } + var finalGroup; + if (sup2 && sub2) { + var bottom2 = options3.fontMetrics().bigOpSpacing5 + sub2.elem.height + sub2.elem.depth + sub2.kern + base.depth + baseShift; + finalGroup = buildCommon.makeVList({ + positionType: "bottom", + positionData: bottom2, + children: [{ + type: "kern", + size: options3.fontMetrics().bigOpSpacing5 + }, { + type: "elem", + elem: sub2.elem, + marginLeft: makeEm(-slant) + }, { + type: "kern", + size: sub2.kern + }, { + type: "elem", + elem: base + }, { + type: "kern", + size: sup2.kern + }, { + type: "elem", + elem: sup2.elem, + marginLeft: makeEm(slant) + }, { + type: "kern", + size: options3.fontMetrics().bigOpSpacing5 + }] + }, options3); + } else if (sub2) { + var top2 = base.height - baseShift; + finalGroup = buildCommon.makeVList({ + positionType: "top", + positionData: top2, + children: [{ + type: "kern", + size: options3.fontMetrics().bigOpSpacing5 + }, { + type: "elem", + elem: sub2.elem, + marginLeft: makeEm(-slant) + }, { + type: "kern", + size: sub2.kern + }, { + type: "elem", + elem: base + }] + }, options3); + } else if (sup2) { + var _bottom = base.depth + baseShift; + finalGroup = buildCommon.makeVList({ + positionType: "bottom", + positionData: _bottom, + children: [{ + type: "elem", + elem: base + }, { + type: "kern", + size: sup2.kern + }, { + type: "elem", + elem: sup2.elem, + marginLeft: makeEm(slant) + }, { + type: "kern", + size: options3.fontMetrics().bigOpSpacing5 + }] + }, options3); + } else { + return base; + } + var parts = [finalGroup]; + if (sub2 && slant !== 0 && !subIsSingleCharacter) { + var spacer = buildCommon.makeSpan(["mspace"], [], options3); + spacer.style.marginRight = makeEm(slant); + parts.unshift(spacer); + } + return buildCommon.makeSpan(["mop", "op-limits"], parts, options3); + }, "assembleSupSub"); + noSuccessor = ["\\smallint"]; + htmlBuilder$2 = /* @__PURE__ */ __name((grp, options3) => { + var supGroup; + var subGroup; + var hasLimits = false; + var group2; + if (grp.type === "supsub") { + supGroup = grp.sup; + subGroup = grp.sub; + group2 = assertNodeType(grp.base, "op"); + hasLimits = true; } else { - const distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) { - return prevPoint; + group2 = assertNodeType(grp, "op"); + } + var style3 = options3.style; + var large = false; + if (style3.size === Style$1.DISPLAY.size && group2.symbol && !utils.contains(noSuccessor, group2.name)) { + large = true; + } + var base; + if (group2.symbol) { + var fontName = large ? "Size2-Regular" : "Size1-Regular"; + var stash = ""; + if (group2.name === "\\oiint" || group2.name === "\\oiiint") { + stash = group2.name.slice(1); + group2.name = stash === "oiint" ? "\\iint" : "\\iiint"; + } + base = buildCommon.makeSymbol(group2.name, fontName, "math", options3, ["mop", "op-symbol", large ? "large-op" : "small-op"]); + if (stash.length > 0) { + var italic = base.italic; + var oval = buildCommon.staticSvg(stash + "Size" + (large ? "2" : "1"), options3); + base = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: base, + shift: 0 + }, { + type: "elem", + elem: oval, + shift: large ? 0.08 : 0 + }] + }, options3); + group2.name = "\\" + stash; + base.classes.unshift("mop"); + base.italic = italic; + } + } else if (group2.body) { + var inner2 = buildExpression$1(group2.body, options3, true); + if (inner2.length === 1 && inner2[0] instanceof SymbolNode) { + base = inner2[0]; + base.classes[0] = "mop"; + } else { + base = buildCommon.makeSpan(["mop"], inner2, options3); } - if (distanceRatio >= 1) { - return { x: point2.x, y: point2.y }; + } else { + var output2 = []; + for (var i2 = 1; i2 < group2.name.length; i2++) { + output2.push(buildCommon.mathsym(group2.name[i2], group2.mode, options3)); } - if (distanceRatio > 0 && distanceRatio < 1) { - return { - x: roundNumber((1 - distanceRatio) * prevPoint.x + distanceRatio * point2.x, 5), - y: roundNumber((1 - distanceRatio) * prevPoint.y + distanceRatio * point2.y, 5) - }; + base = buildCommon.makeSpan(["mop"], output2, options3); + } + var baseShift = 0; + var slant = 0; + if ((base instanceof SymbolNode || group2.name === "\\oiint" || group2.name === "\\oiiint") && !group2.suppressBaseShift) { + baseShift = (base.height - base.depth) / 2 - options3.fontMetrics().axisHeight; + slant = base.italic; + } + if (hasLimits) { + return assembleSupSub(base, supGroup, subGroup, options3, style3, slant, baseShift); + } else { + if (baseShift) { + base.style.position = "relative"; + base.style.top = makeEm(baseShift); } + return base; } - } - prevPoint = point2; - } - throw new Error("Could not find a suitable point for the given distance"); - }; - const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => { - log$1.info(`our points ${JSON.stringify(points)}`); - if (points[0] !== initialPosition) { - points = points.reverse(); - } - const distanceToCardinalityPoint = 25; - const center2 = calculatePoint(points, distanceToCardinalityPoint); - const d = isRelationTypePresent ? 10 : 5; - const angle = Math.atan2(points[0].y - center2.y, points[0].x - center2.x); - const cardinalityPosition = { x: 0, y: 0 }; - cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center2.x) / 2; - cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center2.y) / 2; - return cardinalityPosition; - }; - function calcTerminalLabelPosition(terminalMarkerSize, position2, _points) { - const points = structuredClone(_points); - log$1.info("our points", points); - if (position2 !== "start_left" && position2 !== "start_right") { - points.reverse(); - } - const distanceToCardinalityPoint = 25 + terminalMarkerSize; - const center2 = calculatePoint(points, distanceToCardinalityPoint); - const d = 10 + terminalMarkerSize * 0.5; - const angle = Math.atan2(points[0].y - center2.y, points[0].x - center2.x); - const cardinalityPosition = { x: 0, y: 0 }; - if (position2 === "start_left") { - cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center2.x) / 2; - cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center2.y) / 2; - } else if (position2 === "end_right") { - cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center2.x) / 2 - 5; - cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center2.y) / 2 - 5; - } else if (position2 === "end_left") { - cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center2.x) / 2 - 5; - cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center2.y) / 2 - 5; - } else { - cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center2.x) / 2; - cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center2.y) / 2; - } - return cardinalityPosition; - } - function getStylesFromArray(arr) { - let style = ""; - let labelStyle = ""; - for (const element2 of arr) { - if (element2 !== void 0) { - if (element2.startsWith("color:") || element2.startsWith("text-align:")) { - labelStyle = labelStyle + element2 + ";"; + }, "htmlBuilder$2"); + mathmlBuilder$1 = /* @__PURE__ */ __name((group2, options3) => { + var node2; + if (group2.symbol) { + node2 = new MathNode("mo", [makeText(group2.name, group2.mode)]); + if (utils.contains(noSuccessor, group2.name)) { + node2.setAttribute("largeop", "false"); + } + } else if (group2.body) { + node2 = new MathNode("mo", buildExpression2(group2.body, options3)); } else { - style = style + element2 + ";"; + node2 = new MathNode("mi", [new TextNode(group2.name.slice(1))]); + var operator = new MathNode("mo", [makeText("\u2061", "text")]); + if (group2.parentIsSupSub) { + node2 = new MathNode("mrow", [node2, operator]); + } else { + node2 = newDocumentFragment([node2, operator]); + } } - } - } - return { style, labelStyle }; - } - let cnt$2 = 0; - const generateId$2 = () => { - cnt$2++; - return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt$2; - }; - function makeRandomHex(length2) { - let result = ""; - const characters2 = "0123456789abcdef"; - const charactersLength = characters2.length; - for (let i2 = 0; i2 < length2; i2++) { - result += characters2.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; - } - const random = (options2) => { - return makeRandomHex(options2.length); - }; - const getTextObj$3 = function() { - return { - x: 0, - y: 0, - fill: void 0, - anchor: "start", - style: "#666", - width: 100, - height: 100, - textMargin: 0, - rx: 0, - ry: 0, - valign: void 0, - text: "" - }; - }; - const drawSimpleText = function(elem, textData) { - const nText = textData.text.replace(common$1.lineBreakRegex, " "); - const [, _fontSizePx] = parseFontSize(textData.fontSize); - const textElem = elem.append("text"); - textElem.attr("x", textData.x); - textElem.attr("y", textData.y); - textElem.style("text-anchor", textData.anchor); - textElem.style("font-family", textData.fontFamily); - textElem.style("font-size", _fontSizePx); - textElem.style("font-weight", textData.fontWeight); - textElem.attr("fill", textData.fill); - if (textData.class !== void 0) { - textElem.attr("class", textData.class); - } - const span = textElem.append("tspan"); - span.attr("x", textData.x + textData.textMargin * 2); - span.attr("fill", textData.fill); - span.text(nText); - return textElem; - }; - const wrapLabel = memoize( - (label, maxWidth, config2) => { - if (!label) { - return label; - } - config2 = Object.assign( - { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "
" }, - config2 - ); - if (common$1.lineBreakRegex.test(label)) { - return label; - } - const words = label.split(" "); - const completedLines = []; - let nextLine = ""; - words.forEach((word, index2) => { - const wordLength = calculateTextWidth(`${word} `, config2); - const nextLineLength = calculateTextWidth(nextLine, config2); - if (wordLength > maxWidth) { - const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config2); - completedLines.push(nextLine, ...hyphenatedStrings); - nextLine = remainingWord; - } else if (nextLineLength + wordLength >= maxWidth) { - completedLines.push(nextLine); - nextLine = word; + return node2; + }, "mathmlBuilder$1"); + singleCharBigOps = { + "\u220F": "\\prod", + "\u2210": "\\coprod", + "\u2211": "\\sum", + "\u22C0": "\\bigwedge", + "\u22C1": "\\bigvee", + "\u22C2": "\\bigcap", + "\u22C3": "\\bigcup", + "\u2A00": "\\bigodot", + "\u2A01": "\\bigoplus", + "\u2A02": "\\bigotimes", + "\u2A04": "\\biguplus", + "\u2A06": "\\bigsqcup" + }; + defineFunction({ + type: "op", + names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "\u220F", "\u2210", "\u2211", "\u22C0", "\u22C1", "\u22C2", "\u22C3", "\u2A00", "\u2A01", "\u2A02", "\u2A04", "\u2A06"], + props: { + numArgs: 0 + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21, + funcName + } = _ref; + var fName = funcName; + if (fName.length === 1) { + fName = singleCharBigOps[fName]; + } + return { + type: "op", + mode: parser21.mode, + limits: true, + parentIsSupSub: false, + symbol: true, + name: fName + }; + }, "handler"), + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 + }); + defineFunction({ + type: "op", + names: ["\\mathop"], + props: { + numArgs: 1, + primitive: true + }, + handler: /* @__PURE__ */ __name((_ref2, args) => { + var { + parser: parser21 + } = _ref2; + var body = args[0]; + return { + type: "op", + mode: parser21.mode, + limits: false, + parentIsSupSub: false, + symbol: false, + body: ordargument(body) + }; + }, "handler"), + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 + }); + singleCharIntegrals = { + "\u222B": "\\int", + "\u222C": "\\iint", + "\u222D": "\\iiint", + "\u222E": "\\oint", + "\u222F": "\\oiint", + "\u2230": "\\oiiint" + }; + defineFunction({ + type: "op", + names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"], + props: { + numArgs: 0 + }, + handler(_ref3) { + var { + parser: parser21, + funcName + } = _ref3; + return { + type: "op", + mode: parser21.mode, + limits: false, + parentIsSupSub: false, + symbol: false, + name: funcName + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 + }); + defineFunction({ + type: "op", + names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"], + props: { + numArgs: 0 + }, + handler(_ref4) { + var { + parser: parser21, + funcName + } = _ref4; + return { + type: "op", + mode: parser21.mode, + limits: true, + parentIsSupSub: false, + symbol: false, + name: funcName + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 + }); + defineFunction({ + type: "op", + names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "\u222B", "\u222C", "\u222D", "\u222E", "\u222F", "\u2230"], + props: { + numArgs: 0 + }, + handler(_ref5) { + var { + parser: parser21, + funcName + } = _ref5; + var fName = funcName; + if (fName.length === 1) { + fName = singleCharIntegrals[fName]; + } + return { + type: "op", + mode: parser21.mode, + limits: false, + parentIsSupSub: false, + symbol: true, + name: fName + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 + }); + htmlBuilder$1 = /* @__PURE__ */ __name((grp, options3) => { + var supGroup; + var subGroup; + var hasLimits = false; + var group2; + if (grp.type === "supsub") { + supGroup = grp.sup; + subGroup = grp.sub; + group2 = assertNodeType(grp.base, "operatorname"); + hasLimits = true; + } else { + group2 = assertNodeType(grp, "operatorname"); + } + var base; + if (group2.body.length > 0) { + var body = group2.body.map((child2) => { + var childText = child2.text; + if (typeof childText === "string") { + return { + type: "textord", + mode: child2.mode, + text: childText + }; + } else { + return child2; + } + }); + var expression = buildExpression$1(body, options3.withFont("mathrm"), true); + for (var i2 = 0; i2 < expression.length; i2++) { + var child = expression[i2]; + if (child instanceof SymbolNode) { + child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*"); + } + } + base = buildCommon.makeSpan(["mop"], expression, options3); } else { - nextLine = [nextLine, word].filter(Boolean).join(" "); + base = buildCommon.makeSpan(["mop"], [], options3); + } + if (hasLimits) { + return assembleSupSub(base, supGroup, subGroup, options3, options3.style, 0, 0); + } else { + return base; + } + }, "htmlBuilder$1"); + mathmlBuilder2 = /* @__PURE__ */ __name((group2, options3) => { + var expression = buildExpression2(group2.body, options3.withFont("mathrm")); + var isAllString = true; + for (var i2 = 0; i2 < expression.length; i2++) { + var node2 = expression[i2]; + if (node2 instanceof mathMLTree.SpaceNode) ; + else if (node2 instanceof mathMLTree.MathNode) { + switch (node2.type) { + case "mi": + case "mn": + case "ms": + case "mspace": + case "mtext": + break; + case "mo": { + var child = node2.children[0]; + if (node2.children.length === 1 && child instanceof mathMLTree.TextNode) { + child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*"); + } else { + isAllString = false; + } + break; + } + default: + isAllString = false; + } + } else { + isAllString = false; + } } - const currentWord = index2 + 1; - const isLastWord = currentWord === words.length; - if (isLastWord) { - completedLines.push(nextLine); + if (isAllString) { + var word = expression.map((node3) => node3.toText()).join(""); + expression = [new mathMLTree.TextNode(word)]; } + var identifier2 = new mathMLTree.MathNode("mi", expression); + identifier2.setAttribute("mathvariant", "normal"); + var operator = new mathMLTree.MathNode("mo", [makeText("\u2061", "text")]); + if (group2.parentIsSupSub) { + return new mathMLTree.MathNode("mrow", [identifier2, operator]); + } else { + return mathMLTree.newDocumentFragment([identifier2, operator]); + } + }, "mathmlBuilder"); + defineFunction({ + type: "operatorname", + names: ["\\operatorname@", "\\operatornamewithlimits"], + props: { + numArgs: 1 + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21, + funcName + } = _ref; + var body = args[0]; + return { + type: "operatorname", + mode: parser21.mode, + body: ordargument(body), + alwaysHandleSupSub: funcName === "\\operatornamewithlimits", + limits: false, + parentIsSupSub: false + }; + }, "handler"), + htmlBuilder: htmlBuilder$1, + mathmlBuilder: mathmlBuilder2 }); - return completedLines.filter((line2) => line2 !== "").join(config2.joinWith); - }, - (label, maxWidth, config2) => `${label}${maxWidth}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}${config2.joinWith}` - ); - const breakString = memoize( - (word, maxWidth, hyphenCharacter = "-", config2) => { - config2 = Object.assign( - { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 }, - config2 - ); - const characters2 = [...word]; - const lines = []; - let currentLine = ""; - characters2.forEach((character2, index2) => { - const nextLine = `${currentLine}${character2}`; - const lineWidth = calculateTextWidth(nextLine, config2); - if (lineWidth >= maxWidth) { - const currentCharacter = index2 + 1; - const isLastLine = characters2.length === currentCharacter; - const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`; - lines.push(isLastLine ? nextLine : hyphenatedNextLine); - currentLine = ""; + defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@"); + defineFunctionBuilders({ + type: "ordgroup", + htmlBuilder(group2, options3) { + if (group2.semisimple) { + return buildCommon.makeFragment(buildExpression$1(group2.body, options3, false)); + } + return buildCommon.makeSpan(["mord"], buildExpression$1(group2.body, options3, true), options3); + }, + mathmlBuilder(group2, options3) { + return buildExpressionRow(group2.body, options3, true); + } + }); + defineFunction({ + type: "overline", + names: ["\\overline"], + props: { + numArgs: 1 + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + var body = args[0]; + return { + type: "overline", + mode: parser21.mode, + body + }; + }, + htmlBuilder(group2, options3) { + var innerGroup = buildGroup$1(group2.body, options3.havingCrampedStyle()); + var line2 = buildCommon.makeLineSpan("overline-line", options3); + var defaultRuleThickness = options3.fontMetrics().defaultRuleThickness; + var vlist = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: innerGroup + }, { + type: "kern", + size: 3 * defaultRuleThickness + }, { + type: "elem", + elem: line2 + }, { + type: "kern", + size: defaultRuleThickness + }] + }, options3); + return buildCommon.makeSpan(["mord", "overline"], [vlist], options3); + }, + mathmlBuilder(group2, options3) { + var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]); + operator.setAttribute("stretchy", "true"); + var node2 = new mathMLTree.MathNode("mover", [buildGroup2(group2.body, options3), operator]); + node2.setAttribute("accent", "true"); + return node2; + } + }); + defineFunction({ + type: "phantom", + names: ["\\phantom"], + props: { + numArgs: 1, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + parser: parser21 + } = _ref; + var body = args[0]; + return { + type: "phantom", + mode: parser21.mode, + body: ordargument(body) + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var elements3 = buildExpression$1(group2.body, options3.withPhantom(), false); + return buildCommon.makeFragment(elements3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var inner2 = buildExpression2(group2.body, options3); + return new mathMLTree.MathNode("mphantom", inner2); + }, "mathmlBuilder") + }); + defineFunction({ + type: "hphantom", + names: ["\\hphantom"], + props: { + numArgs: 1, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref2, args) => { + var { + parser: parser21 + } = _ref2; + var body = args[0]; + return { + type: "hphantom", + mode: parser21.mode, + body + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var node2 = buildCommon.makeSpan([], [buildGroup$1(group2.body, options3.withPhantom())]); + node2.height = 0; + node2.depth = 0; + if (node2.children) { + for (var i2 = 0; i2 < node2.children.length; i2++) { + node2.children[i2].height = 0; + node2.children[i2].depth = 0; + } + } + node2 = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: node2 + }] + }, options3); + return buildCommon.makeSpan(["mord"], [node2], options3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var inner2 = buildExpression2(ordargument(group2.body), options3); + var phantom = new mathMLTree.MathNode("mphantom", inner2); + var node2 = new mathMLTree.MathNode("mpadded", [phantom]); + node2.setAttribute("height", "0px"); + node2.setAttribute("depth", "0px"); + return node2; + }, "mathmlBuilder") + }); + defineFunction({ + type: "vphantom", + names: ["\\vphantom"], + props: { + numArgs: 1, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref3, args) => { + var { + parser: parser21 + } = _ref3; + var body = args[0]; + return { + type: "vphantom", + mode: parser21.mode, + body + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var inner2 = buildCommon.makeSpan(["inner"], [buildGroup$1(group2.body, options3.withPhantom())]); + var fix = buildCommon.makeSpan(["fix"], []); + return buildCommon.makeSpan(["mord", "rlap"], [inner2, fix], options3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var inner2 = buildExpression2(ordargument(group2.body), options3); + var phantom = new mathMLTree.MathNode("mphantom", inner2); + var node2 = new mathMLTree.MathNode("mpadded", [phantom]); + node2.setAttribute("width", "0px"); + return node2; + }, "mathmlBuilder") + }); + defineFunction({ + type: "raisebox", + names: ["\\raisebox"], + props: { + numArgs: 2, + argTypes: ["size", "hbox"], + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + var amount = assertNodeType(args[0], "size").value; + var body = args[1]; + return { + type: "raisebox", + mode: parser21.mode, + dy: amount, + body + }; + }, + htmlBuilder(group2, options3) { + var body = buildGroup$1(group2.body, options3); + var dy = calculateSize(group2.dy, options3); + return buildCommon.makeVList({ + positionType: "shift", + positionData: -dy, + children: [{ + type: "elem", + elem: body + }] + }, options3); + }, + mathmlBuilder(group2, options3) { + var node2 = new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options3)]); + var dy = group2.dy.number + group2.dy.unit; + node2.setAttribute("voffset", dy); + return node2; + } + }); + defineFunction({ + type: "internal", + names: ["\\relax"], + props: { + numArgs: 0, + allowedInText: true + }, + handler(_ref) { + var { + parser: parser21 + } = _ref; + return { + type: "internal", + mode: parser21.mode + }; + } + }); + defineFunction({ + type: "rule", + names: ["\\rule"], + props: { + numArgs: 2, + numOptionalArgs: 1, + argTypes: ["size", "size", "size"] + }, + handler(_ref, args, optArgs) { + var { + parser: parser21 + } = _ref; + var shift2 = optArgs[0]; + var width3 = assertNodeType(args[0], "size"); + var height2 = assertNodeType(args[1], "size"); + return { + type: "rule", + mode: parser21.mode, + shift: shift2 && assertNodeType(shift2, "size").value, + width: width3.value, + height: height2.value + }; + }, + htmlBuilder(group2, options3) { + var rule = buildCommon.makeSpan(["mord", "rule"], [], options3); + var width3 = calculateSize(group2.width, options3); + var height2 = calculateSize(group2.height, options3); + var shift2 = group2.shift ? calculateSize(group2.shift, options3) : 0; + rule.style.borderRightWidth = makeEm(width3); + rule.style.borderTopWidth = makeEm(height2); + rule.style.bottom = makeEm(shift2); + rule.width = width3; + rule.height = height2 + shift2; + rule.depth = -shift2; + rule.maxFontSize = height2 * 1.125 * options3.sizeMultiplier; + return rule; + }, + mathmlBuilder(group2, options3) { + var width3 = calculateSize(group2.width, options3); + var height2 = calculateSize(group2.height, options3); + var shift2 = group2.shift ? calculateSize(group2.shift, options3) : 0; + var color2 = options3.color && options3.getColor() || "black"; + var rule = new mathMLTree.MathNode("mspace"); + rule.setAttribute("mathbackground", color2); + rule.setAttribute("width", makeEm(width3)); + rule.setAttribute("height", makeEm(height2)); + var wrapper = new mathMLTree.MathNode("mpadded", [rule]); + if (shift2 >= 0) { + wrapper.setAttribute("height", makeEm(shift2)); + } else { + wrapper.setAttribute("height", makeEm(shift2)); + wrapper.setAttribute("depth", makeEm(-shift2)); + } + wrapper.setAttribute("voffset", makeEm(shift2)); + return wrapper; + } + }); + __name(sizingGroup, "sizingGroup"); + sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"]; + htmlBuilder2 = /* @__PURE__ */ __name((group2, options3) => { + var newOptions = options3.havingSize(group2.size); + return sizingGroup(group2.body, newOptions, options3); + }, "htmlBuilder"); + defineFunction({ + type: "sizing", + names: sizeFuncs, + props: { + numArgs: 0, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args) => { + var { + breakOnTokenText, + funcName, + parser: parser21 + } = _ref; + var body = parser21.parseExpression(false, breakOnTokenText); + return { + type: "sizing", + mode: parser21.mode, + // Figure out what size to use based on the list of functions above + size: sizeFuncs.indexOf(funcName) + 1, + body + }; + }, "handler"), + htmlBuilder: htmlBuilder2, + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var newOptions = options3.havingSize(group2.size); + var inner2 = buildExpression2(group2.body, newOptions); + var node2 = new mathMLTree.MathNode("mstyle", inner2); + node2.setAttribute("mathsize", makeEm(newOptions.sizeMultiplier)); + return node2; + }, "mathmlBuilder") + }); + defineFunction({ + type: "smash", + names: ["\\smash"], + props: { + numArgs: 1, + numOptionalArgs: 1, + allowedInText: true + }, + handler: /* @__PURE__ */ __name((_ref, args, optArgs) => { + var { + parser: parser21 + } = _ref; + var smashHeight = false; + var smashDepth = false; + var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup"); + if (tbArg) { + var letter = ""; + for (var i2 = 0; i2 < tbArg.body.length; ++i2) { + var node2 = tbArg.body[i2]; + letter = node2.text; + if (letter === "t") { + smashHeight = true; + } else if (letter === "b") { + smashDepth = true; + } else { + smashHeight = false; + smashDepth = false; + break; + } + } + } else { + smashHeight = true; + smashDepth = true; + } + var body = args[0]; + return { + type: "smash", + mode: parser21.mode, + body, + smashHeight, + smashDepth + }; + }, "handler"), + htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var node2 = buildCommon.makeSpan([], [buildGroup$1(group2.body, options3)]); + if (!group2.smashHeight && !group2.smashDepth) { + return node2; + } + if (group2.smashHeight) { + node2.height = 0; + if (node2.children) { + for (var i2 = 0; i2 < node2.children.length; i2++) { + node2.children[i2].height = 0; + } + } + } + if (group2.smashDepth) { + node2.depth = 0; + if (node2.children) { + for (var _i = 0; _i < node2.children.length; _i++) { + node2.children[_i].depth = 0; + } + } + } + var smashedNode = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: node2 + }] + }, options3); + return buildCommon.makeSpan(["mord"], [smashedNode], options3); + }, "htmlBuilder"), + mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { + var node2 = new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options3)]); + if (group2.smashHeight) { + node2.setAttribute("height", "0px"); + } + if (group2.smashDepth) { + node2.setAttribute("depth", "0px"); + } + return node2; + }, "mathmlBuilder") + }); + defineFunction({ + type: "sqrt", + names: ["\\sqrt"], + props: { + numArgs: 1, + numOptionalArgs: 1 + }, + handler(_ref, args, optArgs) { + var { + parser: parser21 + } = _ref; + var index = optArgs[0]; + var body = args[0]; + return { + type: "sqrt", + mode: parser21.mode, + body, + index + }; + }, + htmlBuilder(group2, options3) { + var inner2 = buildGroup$1(group2.body, options3.havingCrampedStyle()); + if (inner2.height === 0) { + inner2.height = options3.fontMetrics().xHeight; + } + inner2 = buildCommon.wrapFragment(inner2, options3); + var metrics = options3.fontMetrics(); + var theta = metrics.defaultRuleThickness; + var phi = theta; + if (options3.style.id < Style$1.TEXT.id) { + phi = options3.fontMetrics().xHeight; + } + var lineClearance = theta + phi / 4; + var minDelimiterHeight = inner2.height + inner2.depth + lineClearance + theta; + var { + span: img, + ruleWidth, + advanceWidth + } = delimiter.sqrtImage(minDelimiterHeight, options3); + var delimDepth = img.height - ruleWidth; + if (delimDepth > inner2.height + inner2.depth + lineClearance) { + lineClearance = (lineClearance + delimDepth - inner2.height - inner2.depth) / 2; + } + var imgShift = img.height - inner2.height - lineClearance - ruleWidth; + inner2.style.paddingLeft = makeEm(advanceWidth); + var body = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: inner2, + wrapperClasses: ["svg-align"] + }, { + type: "kern", + size: -(inner2.height + imgShift) + }, { + type: "elem", + elem: img + }, { + type: "kern", + size: ruleWidth + }] + }, options3); + if (!group2.index) { + return buildCommon.makeSpan(["mord", "sqrt"], [body], options3); + } else { + var newOptions = options3.havingStyle(Style$1.SCRIPTSCRIPT); + var rootm = buildGroup$1(group2.index, newOptions, options3); + var toShift = 0.6 * (body.height - body.depth); + var rootVList = buildCommon.makeVList({ + positionType: "shift", + positionData: -toShift, + children: [{ + type: "elem", + elem: rootm + }] + }, options3); + var rootVListWrap = buildCommon.makeSpan(["root"], [rootVList]); + return buildCommon.makeSpan(["mord", "sqrt"], [rootVListWrap, body], options3); + } + }, + mathmlBuilder(group2, options3) { + var { + body, + index + } = group2; + return index ? new mathMLTree.MathNode("mroot", [buildGroup2(body, options3), buildGroup2(index, options3)]) : new mathMLTree.MathNode("msqrt", [buildGroup2(body, options3)]); + } + }); + styleMap = { + "display": Style$1.DISPLAY, + "text": Style$1.TEXT, + "script": Style$1.SCRIPT, + "scriptscript": Style$1.SCRIPTSCRIPT + }; + defineFunction({ + type: "styling", + names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"], + props: { + numArgs: 0, + allowedInText: true, + primitive: true + }, + handler(_ref, args) { + var { + breakOnTokenText, + funcName, + parser: parser21 + } = _ref; + var body = parser21.parseExpression(true, breakOnTokenText); + var style3 = funcName.slice(1, funcName.length - 5); + return { + type: "styling", + mode: parser21.mode, + // Figure out what style to use by pulling out the style from + // the function name + style: style3, + body + }; + }, + htmlBuilder(group2, options3) { + var newStyle = styleMap[group2.style]; + var newOptions = options3.havingStyle(newStyle).withFont(""); + return sizingGroup(group2.body, newOptions, options3); + }, + mathmlBuilder(group2, options3) { + var newStyle = styleMap[group2.style]; + var newOptions = options3.havingStyle(newStyle); + var inner2 = buildExpression2(group2.body, newOptions); + var node2 = new mathMLTree.MathNode("mstyle", inner2); + var styleAttributes = { + "display": ["0", "true"], + "text": ["0", "false"], + "script": ["1", "false"], + "scriptscript": ["2", "false"] + }; + var attr = styleAttributes[group2.style]; + node2.setAttribute("scriptlevel", attr[0]); + node2.setAttribute("displaystyle", attr[1]); + return node2; + } + }); + htmlBuilderDelegate = /* @__PURE__ */ __name(function htmlBuilderDelegate2(group2, options3) { + var base = group2.base; + if (!base) { + return null; + } else if (base.type === "op") { + var delegate = base.limits && (options3.style.size === Style$1.DISPLAY.size || base.alwaysHandleSupSub); + return delegate ? htmlBuilder$2 : null; + } else if (base.type === "operatorname") { + var _delegate = base.alwaysHandleSupSub && (options3.style.size === Style$1.DISPLAY.size || base.limits); + return _delegate ? htmlBuilder$1 : null; + } else if (base.type === "accent") { + return utils.isCharacterBox(base.base) ? htmlBuilder$a : null; + } else if (base.type === "horizBrace") { + var isSup = !group2.sub; + return isSup === base.isOver ? htmlBuilder$3 : null; } else { - currentLine = nextLine; + return null; + } + }, "htmlBuilderDelegate"); + defineFunctionBuilders({ + type: "supsub", + htmlBuilder(group2, options3) { + var builderDelegate = htmlBuilderDelegate(group2, options3); + if (builderDelegate) { + return builderDelegate(group2, options3); + } + var { + base: valueBase, + sup: valueSup, + sub: valueSub + } = group2; + var base = buildGroup$1(valueBase, options3); + var supm; + var subm; + var metrics = options3.fontMetrics(); + var supShift = 0; + var subShift = 0; + var isCharacterBox3 = valueBase && utils.isCharacterBox(valueBase); + if (valueSup) { + var newOptions = options3.havingStyle(options3.style.sup()); + supm = buildGroup$1(valueSup, newOptions, options3); + if (!isCharacterBox3) { + supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options3.sizeMultiplier; + } + } + if (valueSub) { + var _newOptions = options3.havingStyle(options3.style.sub()); + subm = buildGroup$1(valueSub, _newOptions, options3); + if (!isCharacterBox3) { + subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options3.sizeMultiplier; + } + } + var minSupShift; + if (options3.style === Style$1.DISPLAY) { + minSupShift = metrics.sup1; + } else if (options3.style.cramped) { + minSupShift = metrics.sup3; + } else { + minSupShift = metrics.sup2; + } + var multiplier = options3.sizeMultiplier; + var marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier); + var marginLeft = null; + if (subm) { + var isOiint = group2.base && group2.base.type === "op" && group2.base.name && (group2.base.name === "\\oiint" || group2.base.name === "\\oiiint"); + if (base instanceof SymbolNode || isOiint) { + marginLeft = makeEm(-base.italic); + } + } + var supsub; + if (supm && subm) { + supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight); + subShift = Math.max(subShift, metrics.sub2); + var ruleWidth = metrics.defaultRuleThickness; + var maxWidth = 4 * ruleWidth; + if (supShift - supm.depth - (subm.height - subShift) < maxWidth) { + subShift = maxWidth - (supShift - supm.depth) + subm.height; + var psi = 0.8 * metrics.xHeight - (supShift - supm.depth); + if (psi > 0) { + supShift += psi; + subShift -= psi; + } + } + var vlistElem = [{ + type: "elem", + elem: subm, + shift: subShift, + marginRight, + marginLeft + }, { + type: "elem", + elem: supm, + shift: -supShift, + marginRight + }]; + supsub = buildCommon.makeVList({ + positionType: "individualShift", + children: vlistElem + }, options3); + } else if (subm) { + subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight); + var _vlistElem = [{ + type: "elem", + elem: subm, + marginLeft, + marginRight + }]; + supsub = buildCommon.makeVList({ + positionType: "shift", + positionData: subShift, + children: _vlistElem + }, options3); + } else if (supm) { + supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight); + supsub = buildCommon.makeVList({ + positionType: "shift", + positionData: -supShift, + children: [{ + type: "elem", + elem: supm, + marginRight + }] + }, options3); + } else { + throw new Error("supsub must have either sup or sub."); + } + var mclass = getTypeOfDomTree(base, "right") || "mord"; + return buildCommon.makeSpan([mclass], [base, buildCommon.makeSpan(["msupsub"], [supsub])], options3); + }, + mathmlBuilder(group2, options3) { + var isBrace = false; + var isOver; + var isSup; + if (group2.base && group2.base.type === "horizBrace") { + isSup = !!group2.sup; + if (isSup === group2.base.isOver) { + isBrace = true; + isOver = group2.base.isOver; + } + } + if (group2.base && (group2.base.type === "op" || group2.base.type === "operatorname")) { + group2.base.parentIsSupSub = true; + } + var children2 = [buildGroup2(group2.base, options3)]; + if (group2.sub) { + children2.push(buildGroup2(group2.sub, options3)); + } + if (group2.sup) { + children2.push(buildGroup2(group2.sup, options3)); + } + var nodeType2; + if (isBrace) { + nodeType2 = isOver ? "mover" : "munder"; + } else if (!group2.sub) { + var base = group2.base; + if (base && base.type === "op" && base.limits && (options3.style === Style$1.DISPLAY || base.alwaysHandleSupSub)) { + nodeType2 = "mover"; + } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options3.style === Style$1.DISPLAY)) { + nodeType2 = "mover"; + } else { + nodeType2 = "msup"; + } + } else if (!group2.sup) { + var _base = group2.base; + if (_base && _base.type === "op" && _base.limits && (options3.style === Style$1.DISPLAY || _base.alwaysHandleSupSub)) { + nodeType2 = "munder"; + } else if (_base && _base.type === "operatorname" && _base.alwaysHandleSupSub && (_base.limits || options3.style === Style$1.DISPLAY)) { + nodeType2 = "munder"; + } else { + nodeType2 = "msub"; + } + } else { + var _base2 = group2.base; + if (_base2 && _base2.type === "op" && _base2.limits && options3.style === Style$1.DISPLAY) { + nodeType2 = "munderover"; + } else if (_base2 && _base2.type === "operatorname" && _base2.alwaysHandleSupSub && (options3.style === Style$1.DISPLAY || _base2.limits)) { + nodeType2 = "munderover"; + } else { + nodeType2 = "msubsup"; + } + } + return new mathMLTree.MathNode(nodeType2, children2); } }); - return { hyphenatedStrings: lines, remainingWord: currentLine }; - }, - (word, maxWidth, hyphenCharacter = "-", config2) => `${word}${maxWidth}${hyphenCharacter}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}` - ); - function calculateTextHeight(text2, config2) { - return calculateTextDimensions(text2, config2).height; - } - function calculateTextWidth(text2, config2) { - return calculateTextDimensions(text2, config2).width; - } - const calculateTextDimensions = memoize( - (text2, config2) => { - const { fontSize = 12, fontFamily = "Arial", fontWeight = 400 } = config2; - if (!text2) { - return { width: 0, height: 0 }; - } - const [, _fontSizePx] = parseFontSize(fontSize); - const fontFamilies = ["sans-serif", fontFamily]; - const lines = text2.split(common$1.lineBreakRegex); - const dims = []; - const body = d3select("body"); - if (!body.remove) { - return { width: 0, height: 0, lineHeight: 0 }; - } - const g = body.append("svg"); - for (const fontFamily2 of fontFamilies) { - let cHeight = 0; - const dim = { width: 0, height: 0, lineHeight: 0 }; - for (const line2 of lines) { - const textObj = getTextObj$3(); - textObj.text = line2 || ZERO_WIDTH_SPACE; - const textElem = drawSimpleText(g, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2); - const bBox = (textElem._groups || textElem)[0][0].getBBox(); - if (bBox.width === 0 && bBox.height === 0) { - throw new Error("svg element not in render tree"); - } - dim.width = Math.round(Math.max(dim.width, bBox.width)); - cHeight = Math.round(bBox.height); - dim.height += cHeight; - dim.lineHeight = Math.round(Math.max(dim.lineHeight, cHeight)); - } - dims.push(dim); - } - g.remove(); - const index2 = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1; - return dims[index2]; - }, - (text2, config2) => `${text2}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}` - ); - class InitIDGenerator { - constructor(deterministic = false, seed) { - this.count = 0; - this.count = seed ? seed.length : 0; - this.next = deterministic ? () => this.count++ : () => Date.now(); - } - } - let decoder; - const entityDecode = function(html2) { - decoder = decoder || document.createElement("div"); - html2 = escape(html2).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";"); - decoder.innerHTML = html2; - return unescape(decoder.textContent); - }; - function isDetailedError(error) { - return "str" in error; - } - const insertTitle = (parent, cssClass, titleTopMargin, title2) => { - var _a2; - if (!title2) { - return; - } - const bounds2 = (_a2 = parent.node()) == null ? void 0 : _a2.getBBox(); - if (!bounds2) { - return; - } - parent.append("text").text(title2).attr("x", bounds2.x + bounds2.width / 2).attr("y", -titleTopMargin).attr("class", cssClass); - }; - const parseFontSize = (fontSize) => { - if (typeof fontSize === "number") { - return [fontSize, fontSize + "px"]; - } - const fontSizeNumber = parseInt(fontSize ?? "", 10); - if (Number.isNaN(fontSizeNumber)) { - return [void 0, void 0]; - } else if (fontSize === String(fontSizeNumber)) { - return [fontSizeNumber, fontSize + "px"]; - } else { - return [fontSizeNumber, fontSize]; - } - }; - function cleanAndMerge(defaultData, data) { - return merge$3({}, defaultData, data); - } - const utils$1 = { - assignWithDepth: assignWithDepth$1, - wrapLabel, - calculateTextHeight, - calculateTextWidth, - calculateTextDimensions, - cleanAndMerge, - detectInit, - detectDirective, - isSubstringInArray, - interpolateToCurve, - calcLabelPosition, - calcCardinalityPosition, - calcTerminalLabelPosition, - formatUrl, - getStylesFromArray, - generateId: generateId$2, - random, - runFunc, - entityDecode, - insertTitle, - parseFontSize, - InitIDGenerator - }; - const encodeEntities = function(text2) { - let txt = text2; - txt = txt.replace(/style.*:\S*#.*;/g, function(s) { - return s.substring(0, s.length - 1); - }); - txt = txt.replace(/classDef.*:\S*#.*;/g, function(s) { - return s.substring(0, s.length - 1); - }); - txt = txt.replace(/#\w+;/g, function(s) { - const innerTxt = s.substring(1, s.length - 1); - const isInt = /^\+?\d+$/.test(innerTxt); - if (isInt) { - return "fl°°" + innerTxt + "¶ß"; - } else { - return "fl°" + innerTxt + "¶ß"; - } - }); - return txt; - }; - const decodeEntities = function(text2) { - return text2.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";"); - }; - var COMMENT = "comm"; - var RULESET = "rule"; - var DECLARATION = "decl"; - var IMPORT = "@import"; - var KEYFRAMES = "@keyframes"; - var LAYER = "@layer"; - var abs = Math.abs; - var from = String.fromCharCode; - function trim(value2) { - return value2.trim(); - } - function replace(value2, pattern, replacement) { - return value2.replace(pattern, replacement); - } - function indexof(value2, search2, position2) { - return value2.indexOf(search2, position2); - } - function charat(value2, index2) { - return value2.charCodeAt(index2) | 0; - } - function substr(value2, begin, end2) { - return value2.slice(begin, end2); - } - function strlen(value2) { - return value2.length; - } - function sizeof(value2) { - return value2.length; - } - function append(value2, array2) { - return array2.push(value2), value2; - } - var line = 1; - var column = 1; - var length = 0; - var position$2 = 0; - var character = 0; - var characters = ""; - function node$1(value2, root2, parent, type2, props, children2, length2, siblings) { - return { value: value2, root: root2, parent, type: type2, props, children: children2, line, column, length: length2, return: "", siblings }; - } - function char() { - return character; - } - function prev() { - character = position$2 > 0 ? charat(characters, --position$2) : 0; - if (column--, character === 10) - column = 1, line--; - return character; - } - function next$1() { - character = position$2 < length ? charat(characters, position$2++) : 0; - if (column++, character === 10) - column = 1, line++; - return character; - } - function peek() { - return charat(characters, position$2); - } - function caret() { - return position$2; - } - function slice$1(begin, end2) { - return substr(characters, begin, end2); - } - function token(type2) { - switch (type2) { - case 0: - case 9: - case 10: - case 13: - case 32: - return 5; - case 33: - case 43: - case 44: - case 47: - case 62: - case 64: - case 126: - case 59: - case 123: - case 125: - return 4; - case 58: - return 3; - case 34: - case 39: - case 40: - case 91: - return 2; - case 41: - case 93: - return 1; - } - return 0; - } - function alloc(value2) { - return line = column = 1, length = strlen(characters = value2), position$2 = 0, []; - } - function dealloc(value2) { - return characters = "", value2; - } - function delimit(type2) { - return trim(slice$1(position$2 - 1, delimiter$1(type2 === 91 ? type2 + 2 : type2 === 40 ? type2 + 1 : type2))); - } - function whitespace(type2) { - while (character = peek()) - if (character < 33) - next$1(); - else - break; - return token(type2) > 2 || token(character) > 3 ? "" : " "; - } - function escaping(index2, count) { - while (--count && next$1()) - if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) - break; - return slice$1(index2, caret() + (count < 6 && peek() == 32 && next$1() == 32)); - } - function delimiter$1(type2) { - while (next$1()) - switch (character) { - case type2: - return position$2; - case 34: - case 39: - if (type2 !== 34 && type2 !== 39) - delimiter$1(character); - break; - case 40: - if (type2 === 41) - delimiter$1(type2); - break; - case 92: - next$1(); - break; - } - return position$2; - } - function commenter(type2, index2) { - while (next$1()) - if (type2 + character === 47 + 10) - break; - else if (type2 + character === 42 + 42 && peek() === 47) - break; - return "/*" + slice$1(index2, position$2 - 1) + "*" + from(type2 === 47 ? type2 : next$1()); - } - function identifier(index2) { - while (!token(peek())) - next$1(); - return slice$1(index2, position$2); - } - function compile(value2) { - return dealloc(parse$4("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2)); - } - function parse$4(value2, root2, parent, rule, rules, rulesets, pseudo, points, declarations) { - var index2 = 0; - var offset = 0; - var length2 = pseudo; - var atrule = 0; - var property2 = 0; - var previous2 = 0; - var variable = 1; - var scanning = 1; - var ampersand = 1; - var character2 = 0; - var type2 = ""; - var props = rules; - var children2 = rulesets; - var reference = rule; - var characters2 = type2; - while (scanning) - switch (previous2 = character2, character2 = next$1()) { - case 40: - if (previous2 != 108 && charat(characters2, length2 - 1) == 58) { - if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index2 ? points[index2 - 1] : 0)) != -1) - ampersand = -1; - break; + defineFunctionBuilders({ + type: "atom", + htmlBuilder(group2, options3) { + return buildCommon.mathsym(group2.text, group2.mode, options3, ["m" + group2.family]); + }, + mathmlBuilder(group2, options3) { + var node2 = new mathMLTree.MathNode("mo", [makeText(group2.text, group2.mode)]); + if (group2.family === "bin") { + var variant = getVariant(group2, options3); + if (variant === "bold-italic") { + node2.setAttribute("mathvariant", variant); + } + } else if (group2.family === "punct") { + node2.setAttribute("separator", "true"); + } else if (group2.family === "open" || group2.family === "close") { + node2.setAttribute("stretchy", "false"); } - case 34: - case 39: - case 91: - characters2 += delimit(character2); - break; - case 9: - case 10: - case 13: - case 32: - characters2 += whitespace(previous2); - break; - case 92: - characters2 += escaping(caret() - 1, 7); - continue; - case 47: - switch (peek()) { - case 42: - case 47: - append(comment(commenter(next$1(), caret()), root2, parent, declarations), declarations); - break; - default: - characters2 += "/"; + return node2; + } + }); + defaultVariant = { + "mi": "italic", + "mn": "normal", + "mtext": "normal" + }; + defineFunctionBuilders({ + type: "mathord", + htmlBuilder(group2, options3) { + return buildCommon.makeOrd(group2, options3, "mathord"); + }, + mathmlBuilder(group2, options3) { + var node2 = new mathMLTree.MathNode("mi", [makeText(group2.text, group2.mode, options3)]); + var variant = getVariant(group2, options3) || "italic"; + if (variant !== defaultVariant[node2.type]) { + node2.setAttribute("mathvariant", variant); } - break; - case 123 * variable: - points[index2++] = strlen(characters2) * ampersand; - case 125 * variable: - case 59: - case 0: - switch (character2) { - case 0: - case 125: - scanning = 0; - case 59 + offset: - if (ampersand == -1) - characters2 = replace(characters2, /\f/g, ""); - if (property2 > 0 && strlen(characters2) - length2) - append(property2 > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2, declarations), declarations); - break; - case 59: - characters2 += ";"; - default: - append(reference = ruleset(characters2, root2, parent, index2, offset, rules, points, type2, props = [], children2 = [], length2, rulesets), rulesets); - if (character2 === 123) - if (offset === 0) - parse$4(characters2, root2, reference, reference, props, rulesets, length2, points, children2); - else - switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) { - case 100: - case 108: - case 109: - case 115: - parse$4(value2, reference, reference, rule && append(ruleset(value2, reference, reference, 0, 0, rules, points, type2, rules, props = [], length2, children2), children2), rules, children2, length2, points, rule ? props : children2); - break; - default: - parse$4(characters2, reference, reference, reference, [""], children2, 0, points, children2); - } + return node2; + } + }); + defineFunctionBuilders({ + type: "textord", + htmlBuilder(group2, options3) { + return buildCommon.makeOrd(group2, options3, "textord"); + }, + mathmlBuilder(group2, options3) { + var text2 = makeText(group2.text, group2.mode, options3); + var variant = getVariant(group2, options3) || "normal"; + var node2; + if (group2.mode === "text") { + node2 = new mathMLTree.MathNode("mtext", [text2]); + } else if (/[0-9]/.test(group2.text)) { + node2 = new mathMLTree.MathNode("mn", [text2]); + } else if (group2.text === "\\prime") { + node2 = new mathMLTree.MathNode("mo", [text2]); + } else { + node2 = new mathMLTree.MathNode("mi", [text2]); } - index2 = offset = property2 = 0, variable = ampersand = 1, type2 = characters2 = "", length2 = pseudo; - break; - case 58: - length2 = 1 + strlen(characters2), property2 = previous2; - default: - if (variable < 1) { - if (character2 == 123) - --variable; - else if (character2 == 125 && variable++ == 0 && prev() == 125) - continue; + if (variant !== defaultVariant[node2.type]) { + node2.setAttribute("mathvariant", variant); } - switch (characters2 += from(character2), character2 * variable) { - case 38: - ampersand = offset > 0 ? 1 : (characters2 += "\f", -1); - break; - case 44: - points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1; - break; - case 64: - if (peek() === 45) - characters2 += delimit(next$1()); - atrule = peek(), offset = length2 = strlen(type2 = characters2 += identifier(caret())), character2++; - break; - case 45: - if (previous2 === 45 && strlen(characters2) == 2) - variable = 0; + return node2; + } + }); + cssSpace = { + "\\nobreak": "nobreak", + "\\allowbreak": "allowbreak" + }; + regularSpace = { + " ": {}, + "\\ ": {}, + "~": { + className: "nobreak" + }, + "\\space": {}, + "\\nobreakspace": { + className: "nobreak" + } + }; + defineFunctionBuilders({ + type: "spacing", + htmlBuilder(group2, options3) { + if (regularSpace.hasOwnProperty(group2.text)) { + var className = regularSpace[group2.text].className || ""; + if (group2.mode === "text") { + var ord = buildCommon.makeOrd(group2, options3, "textord"); + ord.classes.push(className); + return ord; + } else { + return buildCommon.makeSpan(["mspace", className], [buildCommon.mathsym(group2.text, group2.mode, options3)], options3); + } + } else if (cssSpace.hasOwnProperty(group2.text)) { + return buildCommon.makeSpan(["mspace", cssSpace[group2.text]], [], options3); + } else { + throw new ParseError('Unknown type of space "' + group2.text + '"'); } - } - return rulesets; - } - function ruleset(value2, root2, parent, index2, offset, rules, points, type2, props, children2, length2, siblings) { - var post = offset - 1; - var rule = offset === 0 ? rules : [""]; - var size2 = sizeof(rule); - for (var i2 = 0, j = 0, k = 0; i2 < index2; ++i2) - for (var x2 = 0, y2 = substr(value2, post + 1, post = abs(j = points[i2])), z = value2; x2 < size2; ++x2) - if (z = trim(j > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2]))) - props[k++] = z; - return node$1(value2, root2, parent, offset === 0 ? RULESET : type2, props, children2, length2, siblings); - } - function comment(value2, root2, parent, siblings) { - return node$1(value2, root2, parent, COMMENT, from(char()), substr(value2, 2, -2), 0, siblings); - } - function declaration(value2, root2, parent, length2, siblings) { - return node$1(value2, root2, parent, DECLARATION, substr(value2, 0, length2), substr(value2, length2 + 1, -1), length2, siblings); - } - function serialize(children2, callback) { - var output = ""; - for (var i2 = 0; i2 < children2.length; i2++) - output += callback(children2[i2], i2, children2, callback) || ""; - return output; - } - function stringify(element2, index2, children2, callback) { - switch (element2.type) { - case LAYER: - if (element2.children.length) - break; - case IMPORT: - case DECLARATION: - return element2.return = element2.return || element2.value; - case COMMENT: - return ""; - case KEYFRAMES: - return element2.return = element2.value + "{" + serialize(element2.children, callback) + "}"; - case RULESET: - if (!strlen(element2.value = element2.props.join(","))) - return ""; - } - return strlen(children2 = serialize(element2.children, callback)) ? element2.return = element2.value + "{" + children2 + "}" : ""; - } - const version$1 = "10.9.1"; - const defaultConfig$1 = Object.freeze(defaultConfig$2); - let siteConfig = assignWithDepth$1({}, defaultConfig$1); - let configFromInitialize; - let directives = []; - let currentConfig = assignWithDepth$1({}, defaultConfig$1); - const updateCurrentConfig = (siteCfg, _directives) => { - let cfg = assignWithDepth$1({}, siteCfg); - let sumOfDirectives = {}; - for (const d of _directives) { - sanitize(d); - sumOfDirectives = assignWithDepth$1(sumOfDirectives, d); - } - cfg = assignWithDepth$1(cfg, sumOfDirectives); - if (sumOfDirectives.theme && sumOfDirectives.theme in theme) { - const tmpConfigFromInitialize = assignWithDepth$1({}, configFromInitialize); - const themeVariables = assignWithDepth$1( - tmpConfigFromInitialize.themeVariables || {}, - sumOfDirectives.themeVariables - ); - if (cfg.theme && cfg.theme in theme) { - cfg.themeVariables = theme[cfg.theme].getThemeVariables(themeVariables); - } - } - currentConfig = cfg; - checkConfig(currentConfig); - return currentConfig; - }; - const setSiteConfig = (conf2) => { - siteConfig = assignWithDepth$1({}, defaultConfig$1); - siteConfig = assignWithDepth$1(siteConfig, conf2); - if (conf2.theme && theme[conf2.theme]) { - siteConfig.themeVariables = theme[conf2.theme].getThemeVariables(conf2.themeVariables); - } - updateCurrentConfig(siteConfig, directives); - return siteConfig; - }; - const saveConfigFromInitialize = (conf2) => { - configFromInitialize = assignWithDepth$1({}, conf2); - }; - const updateSiteConfig = (conf2) => { - siteConfig = assignWithDepth$1(siteConfig, conf2); - updateCurrentConfig(siteConfig, directives); - return siteConfig; - }; - const getSiteConfig = () => { - return assignWithDepth$1({}, siteConfig); - }; - const setConfig$1 = (conf2) => { - checkConfig(conf2); - assignWithDepth$1(currentConfig, conf2); - return getConfig$2(); - }; - const getConfig$2 = () => { - return assignWithDepth$1({}, currentConfig); - }; - const sanitize = (options2) => { - if (!options2) { - return; - } - ["secure", ...siteConfig.secure ?? []].forEach((key) => { - if (Object.hasOwn(options2, key)) { - log$1.debug(`Denied attempt to modify a secure key ${key}`, options2[key]); - delete options2[key]; - } - }); - Object.keys(options2).forEach((key) => { - if (key.startsWith("__")) { - delete options2[key]; - } - }); - Object.keys(options2).forEach((key) => { - if (typeof options2[key] === "string" && (options2[key].includes("<") || options2[key].includes(">") || options2[key].includes("url(data:"))) { - delete options2[key]; - } - if (typeof options2[key] === "object") { - sanitize(options2[key]); - } - }); - }; - const addDirective = (directive) => { - sanitizeDirective(directive); - if (directive.fontFamily && (!directive.themeVariables || !directive.themeVariables.fontFamily)) { - directive.themeVariables = { fontFamily: directive.fontFamily }; - } - directives.push(directive); - updateCurrentConfig(siteConfig, directives); - }; - const reset = (config2 = siteConfig) => { - directives = []; - updateCurrentConfig(config2, directives); - }; - const ConfigWarning = { - LAZY_LOAD_DEPRECATED: "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead." - }; - const issuedWarnings = {}; - const issueWarning = (warning) => { - if (issuedWarnings[warning]) { - return; - } - log$1.warn(ConfigWarning[warning]); - issuedWarnings[warning] = true; - }; - const checkConfig = (config2) => { - if (!config2) { - return; - } - if (config2.lazyLoadedDiagrams || config2.loadExternalDiagramsAtStartup) { - issueWarning("LAZY_LOAD_DEPRECATED"); - } - }; - const id$l = "c4"; - const detector$l = (txt) => { - return /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt); - }; - const loader$m = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => c4Diagram); - return { id: id$l, diagram: diagram2 }; - }; - const plugin$j = { - id: id$l, - detector: detector$l, - loader: loader$m - }; - const c4 = plugin$j; - const id$k = "flowchart"; - const detector$k = (txt, config2) => { - var _a2, _b2; - if (((_a2 = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a2.defaultRenderer) === "dagre-wrapper" || ((_b2 = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b2.defaultRenderer) === "elk") { - return false; - } - return /^\s*graph/.test(txt); - }; - const loader$l = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => flowDiagram); - return { id: id$k, diagram: diagram2 }; - }; - const plugin$i = { - id: id$k, - detector: detector$k, - loader: loader$l - }; - const flowchart = plugin$i; - const id$j = "flowchart-v2"; - const detector$j = (txt, config2) => { - var _a2, _b2, _c; - if (((_a2 = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a2.defaultRenderer) === "dagre-d3" || ((_b2 = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b2.defaultRenderer) === "elk") { - return false; - } - if (/^\s*graph/.test(txt) && ((_c = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _c.defaultRenderer) === "dagre-wrapper") { - return true; - } - return /^\s*flowchart/.test(txt); - }; - const loader$k = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => flowDiagramV2); - return { id: id$j, diagram: diagram2 }; - }; - const plugin$h = { - id: id$j, - detector: detector$j, - loader: loader$k - }; - const flowchartV2 = plugin$h; - const id$i = "er"; - const detector$i = (txt) => { - return /^\s*erDiagram/.test(txt); - }; - const loader$j = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => erDiagram); - return { id: id$i, diagram: diagram2 }; - }; - const plugin$g = { - id: id$i, - detector: detector$i, - loader: loader$j - }; - const er = plugin$g; - const id$h = "gitGraph"; - const detector$h = (txt) => { - return /^\s*gitGraph/.test(txt); - }; - const loader$i = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => gitGraphDiagram); - return { id: id$h, diagram: diagram2 }; - }; - const plugin$f = { - id: id$h, - detector: detector$h, - loader: loader$i - }; - const git = plugin$f; - const id$g = "gantt"; - const detector$g = (txt) => { - return /^\s*gantt/.test(txt); - }; - const loader$h = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => ganttDiagram); - return { id: id$g, diagram: diagram2 }; - }; - const plugin$e = { - id: id$g, - detector: detector$g, - loader: loader$h - }; - const gantt = plugin$e; - const id$f = "info"; - const detector$f = (txt) => { - return /^\s*info/.test(txt); - }; - const loader$g = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => infoDiagram); - return { id: id$f, diagram: diagram2 }; - }; - const info$1 = { - id: id$f, - detector: detector$f, - loader: loader$g - }; - const id$e = "pie"; - const detector$e = (txt) => { - return /^\s*pie/.test(txt); - }; - const loader$f = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => pieDiagram); - return { id: id$e, diagram: diagram2 }; - }; - const pie = { - id: id$e, - detector: detector$e, - loader: loader$f - }; - const id$d = "quadrantChart"; - const detector$d = (txt) => { - return /^\s*quadrantChart/.test(txt); - }; - const loader$e = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => quadrantDiagram); - return { id: id$d, diagram: diagram2 }; - }; - const plugin$d = { - id: id$d, - detector: detector$d, - loader: loader$e - }; - const quadrantChart = plugin$d; - const id$c = "xychart"; - const detector$c = (txt) => { - return /^\s*xychart-beta/.test(txt); - }; - const loader$d = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => xychartDiagram); - return { id: id$c, diagram: diagram2 }; - }; - const plugin$c = { - id: id$c, - detector: detector$c, - loader: loader$d - }; - const xychart = plugin$c; - const id$b = "requirement"; - const detector$b = (txt) => { - return /^\s*requirement(Diagram)?/.test(txt); - }; - const loader$c = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => requirementDiagram); - return { id: id$b, diagram: diagram2 }; - }; - const plugin$b = { - id: id$b, - detector: detector$b, - loader: loader$c - }; - const requirement = plugin$b; - const id$a = "sequence"; - const detector$a = (txt) => { - return /^\s*sequenceDiagram/.test(txt); - }; - const loader$b = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => sequenceDiagram); - return { id: id$a, diagram: diagram2 }; - }; - const plugin$a = { - id: id$a, - detector: detector$a, - loader: loader$b - }; - const sequence = plugin$a; - const id$9 = "class"; - const detector$9 = (txt, config2) => { - var _a2; - if (((_a2 = config2 == null ? void 0 : config2.class) == null ? void 0 : _a2.defaultRenderer) === "dagre-wrapper") { - return false; - } - return /^\s*classDiagram/.test(txt); - }; - const loader$a = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => classDiagram); - return { id: id$9, diagram: diagram2 }; - }; - const plugin$9 = { - id: id$9, - detector: detector$9, - loader: loader$a - }; - const classDiagram$1 = plugin$9; - const id$8 = "classDiagram"; - const detector$8 = (txt, config2) => { - var _a2; - if (/^\s*classDiagram/.test(txt) && ((_a2 = config2 == null ? void 0 : config2.class) == null ? void 0 : _a2.defaultRenderer) === "dagre-wrapper") { - return true; - } - return /^\s*classDiagram-v2/.test(txt); - }; - const loader$9 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => classDiagramV2); - return { id: id$8, diagram: diagram2 }; - }; - const plugin$8 = { - id: id$8, - detector: detector$8, - loader: loader$9 - }; - const classDiagramV2$1 = plugin$8; - const id$7 = "state"; - const detector$7 = (txt, config2) => { - var _a2; - if (((_a2 = config2 == null ? void 0 : config2.state) == null ? void 0 : _a2.defaultRenderer) === "dagre-wrapper") { - return false; - } - return /^\s*stateDiagram/.test(txt); - }; - const loader$8 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => stateDiagram); - return { id: id$7, diagram: diagram2 }; - }; - const plugin$7 = { - id: id$7, - detector: detector$7, - loader: loader$8 - }; - const state$1 = plugin$7; - const id$6 = "stateDiagram"; - const detector$6 = (txt, config2) => { - var _a2; - if (/^\s*stateDiagram-v2/.test(txt)) { - return true; - } - if (/^\s*stateDiagram/.test(txt) && ((_a2 = config2 == null ? void 0 : config2.state) == null ? void 0 : _a2.defaultRenderer) === "dagre-wrapper") { - return true; - } - return false; - }; - const loader$7 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => stateDiagramV2); - return { id: id$6, diagram: diagram2 }; - }; - const plugin$6 = { - id: id$6, - detector: detector$6, - loader: loader$7 - }; - const stateV2 = plugin$6; - const id$5 = "journey"; - const detector$5 = (txt) => { - return /^\s*journey/.test(txt); - }; - const loader$6 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => journeyDiagram); - return { id: id$5, diagram: diagram2 }; - }; - const plugin$5 = { - id: id$5, - detector: detector$5, - loader: loader$6 - }; - const journey = plugin$5; - const d3Attrs = function(d3Elem, attrs) { - for (let attr of attrs) { - d3Elem.attr(attr[0], attr[1]); + }, + mathmlBuilder(group2, options3) { + var node2; + if (regularSpace.hasOwnProperty(group2.text)) { + node2 = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode("\xA0")]); + } else if (cssSpace.hasOwnProperty(group2.text)) { + return new mathMLTree.MathNode("mspace"); + } else { + throw new ParseError('Unknown type of space "' + group2.text + '"'); + } + return node2; + } + }); + pad = /* @__PURE__ */ __name(() => { + var padNode = new mathMLTree.MathNode("mtd", []); + padNode.setAttribute("width", "50%"); + return padNode; + }, "pad"); + defineFunctionBuilders({ + type: "tag", + mathmlBuilder(group2, options3) { + var table = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group2.body, options3)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group2.tag, options3)])])]); + table.setAttribute("width", "100%"); + return table; + } + }); + textFontFamilies = { + "\\text": void 0, + "\\textrm": "textrm", + "\\textsf": "textsf", + "\\texttt": "texttt", + "\\textnormal": "textrm" + }; + textFontWeights = { + "\\textbf": "textbf", + "\\textmd": "textmd" + }; + textFontShapes = { + "\\textit": "textit", + "\\textup": "textup" + }; + optionsWithFont = /* @__PURE__ */ __name((group2, options3) => { + var font = group2.font; + if (!font) { + return options3; + } else if (textFontFamilies[font]) { + return options3.withTextFontFamily(textFontFamilies[font]); + } else if (textFontWeights[font]) { + return options3.withTextFontWeight(textFontWeights[font]); + } else if (font === "\\emph") { + return options3.fontShape === "textit" ? options3.withTextFontShape("textup") : options3.withTextFontShape("textit"); + } + return options3.withTextFontShape(textFontShapes[font]); + }, "optionsWithFont"); + defineFunction({ + type: "text", + names: [ + // Font families + "\\text", + "\\textrm", + "\\textsf", + "\\texttt", + "\\textnormal", + // Font weights + "\\textbf", + "\\textmd", + // Font Shapes + "\\textit", + "\\textup", + "\\emph" + ], + props: { + numArgs: 1, + argTypes: ["text"], + allowedInArgument: true, + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser21, + funcName + } = _ref; + var body = args[0]; + return { + type: "text", + mode: parser21.mode, + body: ordargument(body), + font: funcName + }; + }, + htmlBuilder(group2, options3) { + var newOptions = optionsWithFont(group2, options3); + var inner2 = buildExpression$1(group2.body, newOptions, true); + return buildCommon.makeSpan(["mord", "text"], inner2, newOptions); + }, + mathmlBuilder(group2, options3) { + var newOptions = optionsWithFont(group2, options3); + return buildExpressionRow(group2.body, newOptions); + } + }); + defineFunction({ + type: "underline", + names: ["\\underline"], + props: { + numArgs: 1, + allowedInText: true + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + return { + type: "underline", + mode: parser21.mode, + body: args[0] + }; + }, + htmlBuilder(group2, options3) { + var innerGroup = buildGroup$1(group2.body, options3); + var line2 = buildCommon.makeLineSpan("underline-line", options3); + var defaultRuleThickness = options3.fontMetrics().defaultRuleThickness; + var vlist = buildCommon.makeVList({ + positionType: "top", + positionData: innerGroup.height, + children: [{ + type: "kern", + size: defaultRuleThickness + }, { + type: "elem", + elem: line2 + }, { + type: "kern", + size: 3 * defaultRuleThickness + }, { + type: "elem", + elem: innerGroup + }] + }, options3); + return buildCommon.makeSpan(["mord", "underline"], [vlist], options3); + }, + mathmlBuilder(group2, options3) { + var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("\u203E")]); + operator.setAttribute("stretchy", "true"); + var node2 = new mathMLTree.MathNode("munder", [buildGroup2(group2.body, options3), operator]); + node2.setAttribute("accentunder", "true"); + return node2; + } + }); + defineFunction({ + type: "vcenter", + names: ["\\vcenter"], + props: { + numArgs: 1, + argTypes: ["original"], + // In LaTeX, \vcenter can act only on a box. + allowedInText: false + }, + handler(_ref, args) { + var { + parser: parser21 + } = _ref; + return { + type: "vcenter", + mode: parser21.mode, + body: args[0] + }; + }, + htmlBuilder(group2, options3) { + var body = buildGroup$1(group2.body, options3); + var axisHeight = options3.fontMetrics().axisHeight; + var dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight)); + return buildCommon.makeVList({ + positionType: "shift", + positionData: dy, + children: [{ + type: "elem", + elem: body + }] + }, options3); + }, + mathmlBuilder(group2, options3) { + return new mathMLTree.MathNode("mpadded", [buildGroup2(group2.body, options3)], ["vcenter"]); + } + }); + defineFunction({ + type: "verb", + names: ["\\verb"], + props: { + numArgs: 0, + allowedInText: true + }, + handler(context, args, optArgs) { + throw new ParseError("\\verb ended by end of line instead of matching delimiter"); + }, + htmlBuilder(group2, options3) { + var text2 = makeVerb(group2); + var body = []; + var newOptions = options3.havingStyle(options3.style.text()); + for (var i2 = 0; i2 < text2.length; i2++) { + var c3 = text2[i2]; + if (c3 === "~") { + c3 = "\\textasciitilde"; + } + body.push(buildCommon.makeSymbol(c3, "Typewriter-Regular", group2.mode, newOptions, ["mord", "texttt"])); + } + return buildCommon.makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options3)), buildCommon.tryCombineChars(body), newOptions); + }, + mathmlBuilder(group2, options3) { + var text2 = new mathMLTree.TextNode(makeVerb(group2)); + var node2 = new mathMLTree.MathNode("mtext", [text2]); + node2.setAttribute("mathvariant", "monospace"); + return node2; + } + }); + makeVerb = /* @__PURE__ */ __name((group2) => group2.body.replace(/ /g, group2.star ? "\u2423" : "\xA0"), "makeVerb"); + functions = _functions; + spaceRegexString = "[ \r\n ]"; + controlWordRegexString = "\\\\[a-zA-Z@]+"; + controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]"; + controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*"; + controlSpaceRegexString = "\\\\(\n|[ \r ]+\n?)[ \r ]*"; + combiningDiacriticalMarkString = "[\u0300-\u036F]"; + combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$"); + tokenRegexString = "(" + spaceRegexString + "+)|" + // whitespace + (controlSpaceRegexString + "|") + // \whitespace + "([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + // single codepoint + (combiningDiacriticalMarkString + "*") + // ...plus accents + "|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair + (combiningDiacriticalMarkString + "*") + // ...plus accents + "|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred + ("|" + controlWordWhitespaceRegexString) + // \macroName + spaces + ("|" + controlSymbolRegexString + ")"); + Lexer = class { + static { + __name(this, "Lexer"); + } + // Category codes. The lexer only supports comment characters (14) for now. + // MacroExpander additionally distinguishes active (13). + constructor(input, settings) { + this.input = void 0; + this.settings = void 0; + this.tokenRegex = void 0; + this.catcodes = void 0; + this.input = input; + this.settings = settings; + this.tokenRegex = new RegExp(tokenRegexString, "g"); + this.catcodes = { + "%": 14, + // comment character + "~": 13 + // active character + }; + } + setCatcode(char2, code) { + this.catcodes[char2] = code; + } + /** + * This function lexes a single token. + */ + lex() { + var input = this.input; + var pos = this.tokenRegex.lastIndex; + if (pos === input.length) { + return new Token("EOF", new SourceLocation(this, pos, pos)); + } + var match2 = this.tokenRegex.exec(input); + if (match2 === null || match2.index !== pos) { + throw new ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1))); + } + var text2 = match2[6] || match2[3] || (match2[2] ? "\\ " : " "); + if (this.catcodes[text2] === 14) { + var nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex); + if (nlIndex === -1) { + this.tokenRegex.lastIndex = input.length; + this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)"); + } else { + this.tokenRegex.lastIndex = nlIndex + 1; + } + return this.lex(); + } + return new Token(text2, new SourceLocation(this, pos, this.tokenRegex.lastIndex)); + } + }; + Namespace = class { + static { + __name(this, "Namespace"); + } + /** + * Both arguments are optional. The first argument is an object of + * built-in mappings which never change. The second argument is an object + * of initial (global-level) mappings, which will constantly change + * according to any global/top-level `set`s done. + */ + constructor(builtins, globalMacros) { + if (builtins === void 0) { + builtins = {}; + } + if (globalMacros === void 0) { + globalMacros = {}; + } + this.current = void 0; + this.builtins = void 0; + this.undefStack = void 0; + this.current = globalMacros; + this.builtins = builtins; + this.undefStack = []; + } + /** + * Start a new nested group, affecting future local `set`s. + */ + beginGroup() { + this.undefStack.push({}); + } + /** + * End current nested group, restoring values before the group began. + */ + endGroup() { + if (this.undefStack.length === 0) { + throw new ParseError("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug"); + } + var undefs = this.undefStack.pop(); + for (var undef2 in undefs) { + if (undefs.hasOwnProperty(undef2)) { + if (undefs[undef2] == null) { + delete this.current[undef2]; + } else { + this.current[undef2] = undefs[undef2]; + } + } + } + } + /** + * Ends all currently nested groups (if any), restoring values before the + * groups began. Useful in case of an error in the middle of parsing. + */ + endGroups() { + while (this.undefStack.length > 0) { + this.endGroup(); + } + } + /** + * Detect whether `name` has a definition. Equivalent to + * `get(name) != null`. + */ + has(name) { + return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name); + } + /** + * Get the current value of a name, or `undefined` if there is no value. + * + * Note: Do not use `if (namespace.get(...))` to detect whether a macro + * is defined, as the definition may be the empty string which evaluates + * to `false` in JavaScript. Use `if (namespace.get(...) != null)` or + * `if (namespace.has(...))`. + */ + get(name) { + if (this.current.hasOwnProperty(name)) { + return this.current[name]; + } else { + return this.builtins[name]; + } + } + /** + * Set the current value of a name, and optionally set it globally too. + * Local set() sets the current value and (when appropriate) adds an undo + * operation to the undo stack. Global set() may change the undo + * operation at every level, so takes time linear in their number. + * A value of undefined means to delete existing definitions. + */ + set(name, value2, global2) { + if (global2 === void 0) { + global2 = false; + } + if (global2) { + for (var i2 = 0; i2 < this.undefStack.length; i2++) { + delete this.undefStack[i2][name]; + } + if (this.undefStack.length > 0) { + this.undefStack[this.undefStack.length - 1][name] = value2; + } + } else { + var top2 = this.undefStack[this.undefStack.length - 1]; + if (top2 && !top2.hasOwnProperty(name)) { + top2[name] = this.current[name]; + } + } + if (value2 == null) { + delete this.current[name]; + } else { + this.current[name] = value2; + } + } + }; + macros = _macros; + defineMacro("\\noexpand", function(context) { + var t4 = context.popToken(); + if (context.isExpandable(t4.text)) { + t4.noexpand = true; + t4.treatAsRelax = true; + } + return { + tokens: [t4], + numArgs: 0 + }; + }); + defineMacro("\\expandafter", function(context) { + var t4 = context.popToken(); + context.expandOnce(true); + return { + tokens: [t4], + numArgs: 0 + }; + }); + defineMacro("\\@firstoftwo", function(context) { + var args = context.consumeArgs(2); + return { + tokens: args[0], + numArgs: 0 + }; + }); + defineMacro("\\@secondoftwo", function(context) { + var args = context.consumeArgs(2); + return { + tokens: args[1], + numArgs: 0 + }; + }); + defineMacro("\\@ifnextchar", function(context) { + var args = context.consumeArgs(3); + context.consumeSpaces(); + var nextToken = context.future(); + if (args[0].length === 1 && args[0][0].text === nextToken.text) { + return { + tokens: args[1], + numArgs: 0 + }; + } else { + return { + tokens: args[2], + numArgs: 0 + }; + } + }); + defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}"); + defineMacro("\\TextOrMath", function(context) { + var args = context.consumeArgs(2); + if (context.mode === "text") { + return { + tokens: args[0], + numArgs: 0 + }; + } else { + return { + tokens: args[1], + numArgs: 0 + }; + } + }); + digitToNumber = { + "0": 0, + "1": 1, + "2": 2, + "3": 3, + "4": 4, + "5": 5, + "6": 6, + "7": 7, + "8": 8, + "9": 9, + "a": 10, + "A": 10, + "b": 11, + "B": 11, + "c": 12, + "C": 12, + "d": 13, + "D": 13, + "e": 14, + "E": 14, + "f": 15, + "F": 15 + }; + defineMacro("\\char", function(context) { + var token2 = context.popToken(); + var base; + var number7 = ""; + if (token2.text === "'") { + base = 8; + token2 = context.popToken(); + } else if (token2.text === '"') { + base = 16; + token2 = context.popToken(); + } else if (token2.text === "`") { + token2 = context.popToken(); + if (token2.text[0] === "\\") { + number7 = token2.text.charCodeAt(1); + } else if (token2.text === "EOF") { + throw new ParseError("\\char` missing argument"); + } else { + number7 = token2.text.charCodeAt(0); + } + } else { + base = 10; + } + if (base) { + number7 = digitToNumber[token2.text]; + if (number7 == null || number7 >= base) { + throw new ParseError("Invalid base-" + base + " digit " + token2.text); + } + var digit; + while ((digit = digitToNumber[context.future().text]) != null && digit < base) { + number7 *= base; + number7 += digit; + context.popToken(); + } + } + return "\\@char{" + number7 + "}"; + }); + newcommand = /* @__PURE__ */ __name((context, existsOK, nonexistsOK) => { + var arg = context.consumeArg().tokens; + if (arg.length !== 1) { + throw new ParseError("\\newcommand's first argument must be a macro name"); + } + var name = arg[0].text; + var exists2 = context.isDefined(name); + if (exists2 && !existsOK) { + throw new ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand")); + } + if (!exists2 && !nonexistsOK) { + throw new ParseError("\\renewcommand{" + name + "} when command " + name + " does not yet exist; use \\newcommand"); + } + var numArgs = 0; + arg = context.consumeArg().tokens; + if (arg.length === 1 && arg[0].text === "[") { + var argText = ""; + var token2 = context.expandNextToken(); + while (token2.text !== "]" && token2.text !== "EOF") { + argText += token2.text; + token2 = context.expandNextToken(); + } + if (!argText.match(/^\s*[0-9]+\s*$/)) { + throw new ParseError("Invalid number of arguments: " + argText); + } + numArgs = parseInt(argText); + arg = context.consumeArg().tokens; + } + context.macros.set(name, { + tokens: arg, + numArgs + }); + return ""; + }, "newcommand"); + defineMacro("\\newcommand", (context) => newcommand(context, false, true)); + defineMacro("\\renewcommand", (context) => newcommand(context, true, false)); + defineMacro("\\providecommand", (context) => newcommand(context, true, true)); + defineMacro("\\message", (context) => { + var arg = context.consumeArgs(1)[0]; + console.log(arg.reverse().map((token2) => token2.text).join("")); + return ""; + }); + defineMacro("\\errmessage", (context) => { + var arg = context.consumeArgs(1)[0]; + console.error(arg.reverse().map((token2) => token2.text).join("")); + return ""; + }); + defineMacro("\\show", (context) => { + var tok = context.popToken(); + var name = tok.text; + console.log(tok, context.macros.get(name), functions[name], symbols.math[name], symbols.text[name]); + return ""; + }); + defineMacro("\\bgroup", "{"); + defineMacro("\\egroup", "}"); + defineMacro("~", "\\nobreakspace"); + defineMacro("\\lq", "`"); + defineMacro("\\rq", "'"); + defineMacro("\\aa", "\\r a"); + defineMacro("\\AA", "\\r A"); + defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`\xA9}"); + defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"); + defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"); + defineMacro("\u212C", "\\mathscr{B}"); + defineMacro("\u2130", "\\mathscr{E}"); + defineMacro("\u2131", "\\mathscr{F}"); + defineMacro("\u210B", "\\mathscr{H}"); + defineMacro("\u2110", "\\mathscr{I}"); + defineMacro("\u2112", "\\mathscr{L}"); + defineMacro("\u2133", "\\mathscr{M}"); + defineMacro("\u211B", "\\mathscr{R}"); + defineMacro("\u212D", "\\mathfrak{C}"); + defineMacro("\u210C", "\\mathfrak{H}"); + defineMacro("\u2128", "\\mathfrak{Z}"); + defineMacro("\\Bbbk", "\\Bbb{k}"); + defineMacro("\xB7", "\\cdotp"); + defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"); + defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"); + defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"); + defineMacro("\\mathstrut", "\\vphantom{(}"); + defineMacro("\\underbar", "\\underline{\\text{#1}}"); + defineMacro("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'); + defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"); + defineMacro("\\ne", "\\neq"); + defineMacro("\u2260", "\\neq"); + defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"); + defineMacro("\u2209", "\\notin"); + defineMacro("\u2258", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"); + defineMacro("\u2259", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"); + defineMacro("\u225A", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"); + defineMacro("\u225B", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"); + defineMacro("\u225D", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"); + defineMacro("\u225E", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"); + defineMacro("\u225F", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"); + defineMacro("\u27C2", "\\perp"); + defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}"); + defineMacro("\u220C", "\\notni"); + defineMacro("\u231C", "\\ulcorner"); + defineMacro("\u231D", "\\urcorner"); + defineMacro("\u231E", "\\llcorner"); + defineMacro("\u231F", "\\lrcorner"); + defineMacro("\xA9", "\\copyright"); + defineMacro("\xAE", "\\textregistered"); + defineMacro("\uFE0F", "\\textregistered"); + defineMacro("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'); + defineMacro("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'); + defineMacro("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'); + defineMacro("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'); + defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}"); + defineMacro("\u22EE", "\\vdots"); + defineMacro("\\varGamma", "\\mathit{\\Gamma}"); + defineMacro("\\varDelta", "\\mathit{\\Delta}"); + defineMacro("\\varTheta", "\\mathit{\\Theta}"); + defineMacro("\\varLambda", "\\mathit{\\Lambda}"); + defineMacro("\\varXi", "\\mathit{\\Xi}"); + defineMacro("\\varPi", "\\mathit{\\Pi}"); + defineMacro("\\varSigma", "\\mathit{\\Sigma}"); + defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}"); + defineMacro("\\varPhi", "\\mathit{\\Phi}"); + defineMacro("\\varPsi", "\\mathit{\\Psi}"); + defineMacro("\\varOmega", "\\mathit{\\Omega}"); + defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"); + defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"); + defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"); + defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"); + defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"); + defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); + dotsByToken = { + ",": "\\dotsc", + "\\not": "\\dotsb", + // \keybin@ checks for the following: + "+": "\\dotsb", + "=": "\\dotsb", + "<": "\\dotsb", + ">": "\\dotsb", + "-": "\\dotsb", + "*": "\\dotsb", + ":": "\\dotsb", + // Symbols whose definition starts with \DOTSB: + "\\DOTSB": "\\dotsb", + "\\coprod": "\\dotsb", + "\\bigvee": "\\dotsb", + "\\bigwedge": "\\dotsb", + "\\biguplus": "\\dotsb", + "\\bigcap": "\\dotsb", + "\\bigcup": "\\dotsb", + "\\prod": "\\dotsb", + "\\sum": "\\dotsb", + "\\bigotimes": "\\dotsb", + "\\bigoplus": "\\dotsb", + "\\bigodot": "\\dotsb", + "\\bigsqcup": "\\dotsb", + "\\And": "\\dotsb", + "\\longrightarrow": "\\dotsb", + "\\Longrightarrow": "\\dotsb", + "\\longleftarrow": "\\dotsb", + "\\Longleftarrow": "\\dotsb", + "\\longleftrightarrow": "\\dotsb", + "\\Longleftrightarrow": "\\dotsb", + "\\mapsto": "\\dotsb", + "\\longmapsto": "\\dotsb", + "\\hookrightarrow": "\\dotsb", + "\\doteq": "\\dotsb", + // Symbols whose definition starts with \mathbin: + "\\mathbin": "\\dotsb", + // Symbols whose definition starts with \mathrel: + "\\mathrel": "\\dotsb", + "\\relbar": "\\dotsb", + "\\Relbar": "\\dotsb", + "\\xrightarrow": "\\dotsb", + "\\xleftarrow": "\\dotsb", + // Symbols whose definition starts with \DOTSI: + "\\DOTSI": "\\dotsi", + "\\int": "\\dotsi", + "\\oint": "\\dotsi", + "\\iint": "\\dotsi", + "\\iiint": "\\dotsi", + "\\iiiint": "\\dotsi", + "\\idotsint": "\\dotsi", + // Symbols whose definition starts with \DOTSX: + "\\DOTSX": "\\dotsx" + }; + defineMacro("\\dots", function(context) { + var thedots = "\\dotso"; + var next3 = context.expandAfterFuture().text; + if (next3 in dotsByToken) { + thedots = dotsByToken[next3]; + } else if (next3.slice(0, 4) === "\\not") { + thedots = "\\dotsb"; + } else if (next3 in symbols.math) { + if (utils.contains(["bin", "rel"], symbols.math[next3].group)) { + thedots = "\\dotsb"; + } + } + return thedots; + }); + spaceAfterDots = { + // \rightdelim@ checks for the following: + ")": true, + "]": true, + "\\rbrack": true, + "\\}": true, + "\\rbrace": true, + "\\rangle": true, + "\\rceil": true, + "\\rfloor": true, + "\\rgroup": true, + "\\rmoustache": true, + "\\right": true, + "\\bigr": true, + "\\biggr": true, + "\\Bigr": true, + "\\Biggr": true, + // \extra@ also tests for the following: + "$": true, + // \extrap@ checks for the following: + ";": true, + ".": true, + ",": true + }; + defineMacro("\\dotso", function(context) { + var next3 = context.future().text; + if (next3 in spaceAfterDots) { + return "\\ldots\\,"; + } else { + return "\\ldots"; + } + }); + defineMacro("\\dotsc", function(context) { + var next3 = context.future().text; + if (next3 in spaceAfterDots && next3 !== ",") { + return "\\ldots\\,"; + } else { + return "\\ldots"; + } + }); + defineMacro("\\cdots", function(context) { + var next3 = context.future().text; + if (next3 in spaceAfterDots) { + return "\\@cdots\\,"; + } else { + return "\\@cdots"; + } + }); + defineMacro("\\dotsb", "\\cdots"); + defineMacro("\\dotsm", "\\cdots"); + defineMacro("\\dotsi", "\\!\\cdots"); + defineMacro("\\dotsx", "\\ldots\\,"); + defineMacro("\\DOTSI", "\\relax"); + defineMacro("\\DOTSB", "\\relax"); + defineMacro("\\DOTSX", "\\relax"); + defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"); + defineMacro("\\,", "\\tmspace+{3mu}{.1667em}"); + defineMacro("\\thinspace", "\\,"); + defineMacro("\\>", "\\mskip{4mu}"); + defineMacro("\\:", "\\tmspace+{4mu}{.2222em}"); + defineMacro("\\medspace", "\\:"); + defineMacro("\\;", "\\tmspace+{5mu}{.2777em}"); + defineMacro("\\thickspace", "\\;"); + defineMacro("\\!", "\\tmspace-{3mu}{.1667em}"); + defineMacro("\\negthinspace", "\\!"); + defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}"); + defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}"); + defineMacro("\\enspace", "\\kern.5em "); + defineMacro("\\enskip", "\\hskip.5em\\relax"); + defineMacro("\\quad", "\\hskip1em\\relax"); + defineMacro("\\qquad", "\\hskip2em\\relax"); + defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren"); + defineMacro("\\tag@paren", "\\tag@literal{({#1})}"); + defineMacro("\\tag@literal", (context) => { + if (context.macros.get("\\df@tag")) { + throw new ParseError("Multiple \\tag"); + } + return "\\gdef\\df@tag{\\text{#1}}"; + }); + defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"); + defineMacro("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"); + defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}"); + defineMacro("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"); + defineMacro("\\newline", "\\\\\\relax"); + defineMacro("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}"); + latexRaiseA = makeEm(fontMetricsData["Main-Regular"]["T".charCodeAt(0)][1] - 0.7 * fontMetricsData["Main-Regular"]["A".charCodeAt(0)][1]); + defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}"); + defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}"); + defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace"); + defineMacro("\\@hspace", "\\hskip #1\\relax"); + defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax"); + defineMacro("\\ordinarycolon", ":"); + defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}"); + defineMacro("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'); + defineMacro("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'); + defineMacro("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'); + defineMacro("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'); + defineMacro("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'); + defineMacro("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'); + defineMacro("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'); + defineMacro("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'); + defineMacro("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'); + defineMacro("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'); + defineMacro("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'); + defineMacro("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'); + defineMacro("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'); + defineMacro("\u2237", "\\dblcolon"); + defineMacro("\u2239", "\\eqcolon"); + defineMacro("\u2254", "\\coloneqq"); + defineMacro("\u2255", "\\eqqcolon"); + defineMacro("\u2A74", "\\Coloneqq"); + defineMacro("\\ratio", "\\vcentcolon"); + defineMacro("\\coloncolon", "\\dblcolon"); + defineMacro("\\colonequals", "\\coloneqq"); + defineMacro("\\coloncolonequals", "\\Coloneqq"); + defineMacro("\\equalscolon", "\\eqqcolon"); + defineMacro("\\equalscoloncolon", "\\Eqqcolon"); + defineMacro("\\colonminus", "\\coloneq"); + defineMacro("\\coloncolonminus", "\\Coloneq"); + defineMacro("\\minuscolon", "\\eqcolon"); + defineMacro("\\minuscoloncolon", "\\Eqcolon"); + defineMacro("\\coloncolonapprox", "\\Colonapprox"); + defineMacro("\\coloncolonsim", "\\Colonsim"); + defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); + defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"); + defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); + defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"); + defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"); + defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}"); + defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}"); + defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}"); + defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}"); + defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}"); + defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}"); + defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}"); + defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}"); + defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{\u2269}"); + defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{\u2268}"); + defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{\u2271}"); + defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{\u2271}"); + defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{\u2270}"); + defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{\u2270}"); + defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{\u2224}"); + defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{\u2226}"); + defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{\u2288}"); + defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{\u2289}"); + defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{\u228A}"); + defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{\u2ACB}"); + defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{\u228B}"); + defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{\u2ACC}"); + defineMacro("\\imath", "\\html@mathml{\\@imath}{\u0131}"); + defineMacro("\\jmath", "\\html@mathml{\\@jmath}{\u0237}"); + defineMacro("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"); + defineMacro("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"); + defineMacro("\u27E6", "\\llbracket"); + defineMacro("\u27E7", "\\rrbracket"); + defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"); + defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"); + defineMacro("\u2983", "\\lBrace"); + defineMacro("\u2984", "\\rBrace"); + defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}"); + defineMacro("\u29B5", "\\minuso"); + defineMacro("\\darr", "\\downarrow"); + defineMacro("\\dArr", "\\Downarrow"); + defineMacro("\\Darr", "\\Downarrow"); + defineMacro("\\lang", "\\langle"); + defineMacro("\\rang", "\\rangle"); + defineMacro("\\uarr", "\\uparrow"); + defineMacro("\\uArr", "\\Uparrow"); + defineMacro("\\Uarr", "\\Uparrow"); + defineMacro("\\N", "\\mathbb{N}"); + defineMacro("\\R", "\\mathbb{R}"); + defineMacro("\\Z", "\\mathbb{Z}"); + defineMacro("\\alef", "\\aleph"); + defineMacro("\\alefsym", "\\aleph"); + defineMacro("\\Alpha", "\\mathrm{A}"); + defineMacro("\\Beta", "\\mathrm{B}"); + defineMacro("\\bull", "\\bullet"); + defineMacro("\\Chi", "\\mathrm{X}"); + defineMacro("\\clubs", "\\clubsuit"); + defineMacro("\\cnums", "\\mathbb{C}"); + defineMacro("\\Complex", "\\mathbb{C}"); + defineMacro("\\Dagger", "\\ddagger"); + defineMacro("\\diamonds", "\\diamondsuit"); + defineMacro("\\empty", "\\emptyset"); + defineMacro("\\Epsilon", "\\mathrm{E}"); + defineMacro("\\Eta", "\\mathrm{H}"); + defineMacro("\\exist", "\\exists"); + defineMacro("\\harr", "\\leftrightarrow"); + defineMacro("\\hArr", "\\Leftrightarrow"); + defineMacro("\\Harr", "\\Leftrightarrow"); + defineMacro("\\hearts", "\\heartsuit"); + defineMacro("\\image", "\\Im"); + defineMacro("\\infin", "\\infty"); + defineMacro("\\Iota", "\\mathrm{I}"); + defineMacro("\\isin", "\\in"); + defineMacro("\\Kappa", "\\mathrm{K}"); + defineMacro("\\larr", "\\leftarrow"); + defineMacro("\\lArr", "\\Leftarrow"); + defineMacro("\\Larr", "\\Leftarrow"); + defineMacro("\\lrarr", "\\leftrightarrow"); + defineMacro("\\lrArr", "\\Leftrightarrow"); + defineMacro("\\Lrarr", "\\Leftrightarrow"); + defineMacro("\\Mu", "\\mathrm{M}"); + defineMacro("\\natnums", "\\mathbb{N}"); + defineMacro("\\Nu", "\\mathrm{N}"); + defineMacro("\\Omicron", "\\mathrm{O}"); + defineMacro("\\plusmn", "\\pm"); + defineMacro("\\rarr", "\\rightarrow"); + defineMacro("\\rArr", "\\Rightarrow"); + defineMacro("\\Rarr", "\\Rightarrow"); + defineMacro("\\real", "\\Re"); + defineMacro("\\reals", "\\mathbb{R}"); + defineMacro("\\Reals", "\\mathbb{R}"); + defineMacro("\\Rho", "\\mathrm{P}"); + defineMacro("\\sdot", "\\cdot"); + defineMacro("\\sect", "\\S"); + defineMacro("\\spades", "\\spadesuit"); + defineMacro("\\sub", "\\subset"); + defineMacro("\\sube", "\\subseteq"); + defineMacro("\\supe", "\\supseteq"); + defineMacro("\\Tau", "\\mathrm{T}"); + defineMacro("\\thetasym", "\\vartheta"); + defineMacro("\\weierp", "\\wp"); + defineMacro("\\Zeta", "\\mathrm{Z}"); + defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}"); + defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}"); + defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits"); + defineMacro("\\bra", "\\mathinner{\\langle{#1}|}"); + defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}"); + defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}"); + defineMacro("\\Bra", "\\left\\langle#1\\right|"); + defineMacro("\\Ket", "\\left|#1\\right\\rangle"); + braketHelper = /* @__PURE__ */ __name((one4) => (context) => { + var left3 = context.consumeArg().tokens; + var middle = context.consumeArg().tokens; + var middleDouble = context.consumeArg().tokens; + var right3 = context.consumeArg().tokens; + var oldMiddle = context.macros.get("|"); + var oldMiddleDouble = context.macros.get("\\|"); + context.macros.beginGroup(); + var midMacro = /* @__PURE__ */ __name((double) => (context2) => { + if (one4) { + context2.macros.set("|", oldMiddle); + if (middleDouble.length) { + context2.macros.set("\\|", oldMiddleDouble); + } + } + var doubled = double; + if (!double && middleDouble.length) { + var nextToken = context2.future(); + if (nextToken.text === "|") { + context2.popToken(); + doubled = true; + } + } + return { + tokens: doubled ? middleDouble : middle, + numArgs: 0 + }; + }, "midMacro"); + context.macros.set("|", midMacro(false)); + if (middleDouble.length) { + context.macros.set("\\|", midMacro(true)); + } + var arg = context.consumeArg().tokens; + var expanded = context.expandTokens([ + ...right3, + ...arg, + ...left3 + // reversed + ]); + context.macros.endGroup(); + return { + tokens: expanded.reverse(), + numArgs: 0 + }; + }, "braketHelper"); + defineMacro("\\bra@ket", braketHelper(false)); + defineMacro("\\bra@set", braketHelper(true)); + defineMacro("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"); + defineMacro("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"); + defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"); + defineMacro("\\angln", "{\\angl n}"); + defineMacro("\\blue", "\\textcolor{##6495ed}{#1}"); + defineMacro("\\orange", "\\textcolor{##ffa500}{#1}"); + defineMacro("\\pink", "\\textcolor{##ff00af}{#1}"); + defineMacro("\\red", "\\textcolor{##df0030}{#1}"); + defineMacro("\\green", "\\textcolor{##28ae7b}{#1}"); + defineMacro("\\gray", "\\textcolor{gray}{#1}"); + defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}"); + defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}"); + defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}"); + defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}"); + defineMacro("\\blueD", "\\textcolor{##11accd}{#1}"); + defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}"); + defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}"); + defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}"); + defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}"); + defineMacro("\\tealD", "\\textcolor{##01a995}{#1}"); + defineMacro("\\tealE", "\\textcolor{##208170}{#1}"); + defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}"); + defineMacro("\\greenB", "\\textcolor{##8af281}{#1}"); + defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}"); + defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}"); + defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}"); + defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}"); + defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}"); + defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}"); + defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}"); + defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}"); + defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}"); + defineMacro("\\redB", "\\textcolor{##ff8482}{#1}"); + defineMacro("\\redC", "\\textcolor{##f9685d}{#1}"); + defineMacro("\\redD", "\\textcolor{##e84d39}{#1}"); + defineMacro("\\redE", "\\textcolor{##bc2612}{#1}"); + defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}"); + defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}"); + defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}"); + defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}"); + defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}"); + defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}"); + defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}"); + defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}"); + defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}"); + defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}"); + defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}"); + defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}"); + defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}"); + defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}"); + defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}"); + defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}"); + defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}"); + defineMacro("\\grayE", "\\textcolor{##babec2}{#1}"); + defineMacro("\\grayF", "\\textcolor{##888d93}{#1}"); + defineMacro("\\grayG", "\\textcolor{##626569}{#1}"); + defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}"); + defineMacro("\\grayI", "\\textcolor{##21242c}{#1}"); + defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}"); + defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}"); + implicitCommands = { + "^": true, + // Parser.js + "_": true, + // Parser.js + "\\limits": true, + // Parser.js + "\\nolimits": true + // Parser.js + }; + MacroExpander = class { + static { + __name(this, "MacroExpander"); + } + constructor(input, settings, mode) { + this.settings = void 0; + this.expansionCount = void 0; + this.lexer = void 0; + this.macros = void 0; + this.stack = void 0; + this.mode = void 0; + this.settings = settings; + this.expansionCount = 0; + this.feed(input); + this.macros = new Namespace(macros, settings.macros); + this.mode = mode; + this.stack = []; + } + /** + * Feed a new input string to the same MacroExpander + * (with existing macros etc.). + */ + feed(input) { + this.lexer = new Lexer(input, this.settings); + } + /** + * Switches between "text" and "math" modes. + */ + switchMode(newMode) { + this.mode = newMode; + } + /** + * Start a new group nesting within all namespaces. + */ + beginGroup() { + this.macros.beginGroup(); + } + /** + * End current group nesting within all namespaces. + */ + endGroup() { + this.macros.endGroup(); + } + /** + * Ends all currently nested groups (if any), restoring values before the + * groups began. Useful in case of an error in the middle of parsing. + */ + endGroups() { + this.macros.endGroups(); + } + /** + * Returns the topmost token on the stack, without expanding it. + * Similar in behavior to TeX's `\futurelet`. + */ + future() { + if (this.stack.length === 0) { + this.pushToken(this.lexer.lex()); + } + return this.stack[this.stack.length - 1]; + } + /** + * Remove and return the next unexpanded token. + */ + popToken() { + this.future(); + return this.stack.pop(); + } + /** + * Add a given token to the token stack. In particular, this get be used + * to put back a token returned from one of the other methods. + */ + pushToken(token2) { + this.stack.push(token2); + } + /** + * Append an array of tokens to the token stack. + */ + pushTokens(tokens2) { + this.stack.push(...tokens2); + } + /** + * Find an macro argument without expanding tokens and append the array of + * tokens to the token stack. Uses Token as a container for the result. + */ + scanArgument(isOptional) { + var start3; + var end2; + var tokens2; + if (isOptional) { + this.consumeSpaces(); + if (this.future().text !== "[") { + return null; + } + start3 = this.popToken(); + ({ + tokens: tokens2, + end: end2 + } = this.consumeArg(["]"])); + } else { + ({ + tokens: tokens2, + start: start3, + end: end2 + } = this.consumeArg()); + } + this.pushToken(new Token("EOF", end2.loc)); + this.pushTokens(tokens2); + return start3.range(end2, ""); + } + /** + * Consume all following space tokens, without expansion. + */ + consumeSpaces() { + for (; ; ) { + var token2 = this.future(); + if (token2.text === " ") { + this.stack.pop(); + } else { + break; + } + } + } + /** + * Consume an argument from the token stream, and return the resulting array + * of tokens and start/end token. + */ + consumeArg(delims) { + var tokens2 = []; + var isDelimited = delims && delims.length > 0; + if (!isDelimited) { + this.consumeSpaces(); + } + var start3 = this.future(); + var tok; + var depth = 0; + var match2 = 0; + do { + tok = this.popToken(); + tokens2.push(tok); + if (tok.text === "{") { + ++depth; + } else if (tok.text === "}") { + --depth; + if (depth === -1) { + throw new ParseError("Extra }", tok); + } + } else if (tok.text === "EOF") { + throw new ParseError("Unexpected end of input in a macro argument, expected '" + (delims && isDelimited ? delims[match2] : "}") + "'", tok); + } + if (delims && isDelimited) { + if ((depth === 0 || depth === 1 && delims[match2] === "{") && tok.text === delims[match2]) { + ++match2; + if (match2 === delims.length) { + tokens2.splice(-match2, match2); + break; + } + } else { + match2 = 0; + } + } + } while (depth !== 0 || isDelimited); + if (start3.text === "{" && tokens2[tokens2.length - 1].text === "}") { + tokens2.pop(); + tokens2.shift(); + } + tokens2.reverse(); + return { + tokens: tokens2, + start: start3, + end: tok + }; + } + /** + * Consume the specified number of (delimited) arguments from the token + * stream and return the resulting array of arguments. + */ + consumeArgs(numArgs, delimiters2) { + if (delimiters2) { + if (delimiters2.length !== numArgs + 1) { + throw new ParseError("The length of delimiters doesn't match the number of args!"); + } + var delims = delimiters2[0]; + for (var i2 = 0; i2 < delims.length; i2++) { + var tok = this.popToken(); + if (delims[i2] !== tok.text) { + throw new ParseError("Use of the macro doesn't match its definition", tok); + } + } + } + var args = []; + for (var _i = 0; _i < numArgs; _i++) { + args.push(this.consumeArg(delimiters2 && delimiters2[_i + 1]).tokens); + } + return args; + } + /** + * Increment `expansionCount` by the specified amount. + * Throw an error if it exceeds `maxExpand`. + */ + countExpansion(amount) { + this.expansionCount += amount; + if (this.expansionCount > this.settings.maxExpand) { + throw new ParseError("Too many expansions: infinite loop or need to increase maxExpand setting"); + } + } + /** + * Expand the next token only once if possible. + * + * If the token is expanded, the resulting tokens will be pushed onto + * the stack in reverse order, and the number of such tokens will be + * returned. This number might be zero or positive. + * + * If not, the return value is `false`, and the next token remains at the + * top of the stack. + * + * In either case, the next token will be on the top of the stack, + * or the stack will be empty (in case of empty expansion + * and no other tokens). + * + * Used to implement `expandAfterFuture` and `expandNextToken`. + * + * If expandableOnly, only expandable tokens are expanded and + * an undefined control sequence results in an error. + */ + expandOnce(expandableOnly) { + var topToken = this.popToken(); + var name = topToken.text; + var expansion = !topToken.noexpand ? this._getExpansion(name) : null; + if (expansion == null || expandableOnly && expansion.unexpandable) { + if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) { + throw new ParseError("Undefined control sequence: " + name); + } + this.pushToken(topToken); + return false; + } + this.countExpansion(1); + var tokens2 = expansion.tokens; + var args = this.consumeArgs(expansion.numArgs, expansion.delimiters); + if (expansion.numArgs) { + tokens2 = tokens2.slice(); + for (var i2 = tokens2.length - 1; i2 >= 0; --i2) { + var tok = tokens2[i2]; + if (tok.text === "#") { + if (i2 === 0) { + throw new ParseError("Incomplete placeholder at end of macro body", tok); + } + tok = tokens2[--i2]; + if (tok.text === "#") { + tokens2.splice(i2 + 1, 1); + } else if (/^[1-9]$/.test(tok.text)) { + tokens2.splice(i2, 2, ...args[+tok.text - 1]); + } else { + throw new ParseError("Not a valid argument number", tok); + } + } + } + } + this.pushTokens(tokens2); + return tokens2.length; + } + /** + * Expand the next token only once (if possible), and return the resulting + * top token on the stack (without removing anything from the stack). + * Similar in behavior to TeX's `\expandafter\futurelet`. + * Equivalent to expandOnce() followed by future(). + */ + expandAfterFuture() { + this.expandOnce(); + return this.future(); + } + /** + * Recursively expand first token, then return first non-expandable token. + */ + expandNextToken() { + for (; ; ) { + if (this.expandOnce() === false) { + var token2 = this.stack.pop(); + if (token2.treatAsRelax) { + token2.text = "\\relax"; + } + return token2; + } + } + throw new Error(); + } + /** + * Fully expand the given macro name and return the resulting list of + * tokens, or return `undefined` if no such macro is defined. + */ + expandMacro(name) { + return this.macros.has(name) ? this.expandTokens([new Token(name)]) : void 0; + } + /** + * Fully expand the given token stream and return the resulting list of + * tokens. Note that the input tokens are in reverse order, but the + * output tokens are in forward order. + */ + expandTokens(tokens2) { + var output2 = []; + var oldStackLength = this.stack.length; + this.pushTokens(tokens2); + while (this.stack.length > oldStackLength) { + if (this.expandOnce(true) === false) { + var token2 = this.stack.pop(); + if (token2.treatAsRelax) { + token2.noexpand = false; + token2.treatAsRelax = false; + } + output2.push(token2); + } + } + this.countExpansion(output2.length); + return output2; + } + /** + * Fully expand the given macro name and return the result as a string, + * or return `undefined` if no such macro is defined. + */ + expandMacroAsText(name) { + var tokens2 = this.expandMacro(name); + if (tokens2) { + return tokens2.map((token2) => token2.text).join(""); + } else { + return tokens2; + } + } + /** + * Returns the expanded macro as a reversed array of tokens and a macro + * argument count. Or returns `null` if no such macro. + */ + _getExpansion(name) { + var definition = this.macros.get(name); + if (definition == null) { + return definition; + } + if (name.length === 1) { + var catcode = this.lexer.catcodes[name]; + if (catcode != null && catcode !== 13) { + return; + } + } + var expansion = typeof definition === "function" ? definition(this) : definition; + if (typeof expansion === "string") { + var numArgs = 0; + if (expansion.indexOf("#") !== -1) { + var stripped = expansion.replace(/##/g, ""); + while (stripped.indexOf("#" + (numArgs + 1)) !== -1) { + ++numArgs; + } + } + var bodyLexer = new Lexer(expansion, this.settings); + var tokens2 = []; + var tok = bodyLexer.lex(); + while (tok.text !== "EOF") { + tokens2.push(tok); + tok = bodyLexer.lex(); + } + tokens2.reverse(); + var expanded = { + tokens: tokens2, + numArgs + }; + return expanded; + } + return expansion; + } + /** + * Determine whether a command is currently "defined" (has some + * functionality), meaning that it's a macro (in the current group), + * a function, a symbol, or one of the special commands listed in + * `implicitCommands`. + */ + isDefined(name) { + return this.macros.has(name) || functions.hasOwnProperty(name) || symbols.math.hasOwnProperty(name) || symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name); + } + /** + * Determine whether a command is expandable. + */ + isExpandable(name) { + var macro = this.macros.get(name); + return macro != null ? typeof macro === "string" || typeof macro === "function" || !macro.unexpandable : functions.hasOwnProperty(name) && !functions[name].primitive; + } + }; + unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/; + uSubsAndSups = Object.freeze({ + "\u208A": "+", + "\u208B": "-", + "\u208C": "=", + "\u208D": "(", + "\u208E": ")", + "\u2080": "0", + "\u2081": "1", + "\u2082": "2", + "\u2083": "3", + "\u2084": "4", + "\u2085": "5", + "\u2086": "6", + "\u2087": "7", + "\u2088": "8", + "\u2089": "9", + "\u2090": "a", + "\u2091": "e", + "\u2095": "h", + "\u1D62": "i", + "\u2C7C": "j", + "\u2096": "k", + "\u2097": "l", + "\u2098": "m", + "\u2099": "n", + "\u2092": "o", + "\u209A": "p", + "\u1D63": "r", + "\u209B": "s", + "\u209C": "t", + "\u1D64": "u", + "\u1D65": "v", + "\u2093": "x", + "\u1D66": "\u03B2", + "\u1D67": "\u03B3", + "\u1D68": "\u03C1", + "\u1D69": "\u03D5", + "\u1D6A": "\u03C7", + "\u207A": "+", + "\u207B": "-", + "\u207C": "=", + "\u207D": "(", + "\u207E": ")", + "\u2070": "0", + "\xB9": "1", + "\xB2": "2", + "\xB3": "3", + "\u2074": "4", + "\u2075": "5", + "\u2076": "6", + "\u2077": "7", + "\u2078": "8", + "\u2079": "9", + "\u1D2C": "A", + "\u1D2E": "B", + "\u1D30": "D", + "\u1D31": "E", + "\u1D33": "G", + "\u1D34": "H", + "\u1D35": "I", + "\u1D36": "J", + "\u1D37": "K", + "\u1D38": "L", + "\u1D39": "M", + "\u1D3A": "N", + "\u1D3C": "O", + "\u1D3E": "P", + "\u1D3F": "R", + "\u1D40": "T", + "\u1D41": "U", + "\u2C7D": "V", + "\u1D42": "W", + "\u1D43": "a", + "\u1D47": "b", + "\u1D9C": "c", + "\u1D48": "d", + "\u1D49": "e", + "\u1DA0": "f", + "\u1D4D": "g", + "\u02B0": "h", + "\u2071": "i", + "\u02B2": "j", + "\u1D4F": "k", + "\u02E1": "l", + "\u1D50": "m", + "\u207F": "n", + "\u1D52": "o", + "\u1D56": "p", + "\u02B3": "r", + "\u02E2": "s", + "\u1D57": "t", + "\u1D58": "u", + "\u1D5B": "v", + "\u02B7": "w", + "\u02E3": "x", + "\u02B8": "y", + "\u1DBB": "z", + "\u1D5D": "\u03B2", + "\u1D5E": "\u03B3", + "\u1D5F": "\u03B4", + "\u1D60": "\u03D5", + "\u1D61": "\u03C7", + "\u1DBF": "\u03B8" + }); + unicodeAccents = { + "\u0301": { + "text": "\\'", + "math": "\\acute" + }, + "\u0300": { + "text": "\\`", + "math": "\\grave" + }, + "\u0308": { + "text": '\\"', + "math": "\\ddot" + }, + "\u0303": { + "text": "\\~", + "math": "\\tilde" + }, + "\u0304": { + "text": "\\=", + "math": "\\bar" + }, + "\u0306": { + "text": "\\u", + "math": "\\breve" + }, + "\u030C": { + "text": "\\v", + "math": "\\check" + }, + "\u0302": { + "text": "\\^", + "math": "\\hat" + }, + "\u0307": { + "text": "\\.", + "math": "\\dot" + }, + "\u030A": { + "text": "\\r", + "math": "\\mathring" + }, + "\u030B": { + "text": "\\H" + }, + "\u0327": { + "text": "\\c" + } + }; + unicodeSymbols = { + "\xE1": "a\u0301", + "\xE0": "a\u0300", + "\xE4": "a\u0308", + "\u01DF": "a\u0308\u0304", + "\xE3": "a\u0303", + "\u0101": "a\u0304", + "\u0103": "a\u0306", + "\u1EAF": "a\u0306\u0301", + "\u1EB1": "a\u0306\u0300", + "\u1EB5": "a\u0306\u0303", + "\u01CE": "a\u030C", + "\xE2": "a\u0302", + "\u1EA5": "a\u0302\u0301", + "\u1EA7": "a\u0302\u0300", + "\u1EAB": "a\u0302\u0303", + "\u0227": "a\u0307", + "\u01E1": "a\u0307\u0304", + "\xE5": "a\u030A", + "\u01FB": "a\u030A\u0301", + "\u1E03": "b\u0307", + "\u0107": "c\u0301", + "\u1E09": "c\u0327\u0301", + "\u010D": "c\u030C", + "\u0109": "c\u0302", + "\u010B": "c\u0307", + "\xE7": "c\u0327", + "\u010F": "d\u030C", + "\u1E0B": "d\u0307", + "\u1E11": "d\u0327", + "\xE9": "e\u0301", + "\xE8": "e\u0300", + "\xEB": "e\u0308", + "\u1EBD": "e\u0303", + "\u0113": "e\u0304", + "\u1E17": "e\u0304\u0301", + "\u1E15": "e\u0304\u0300", + "\u0115": "e\u0306", + "\u1E1D": "e\u0327\u0306", + "\u011B": "e\u030C", + "\xEA": "e\u0302", + "\u1EBF": "e\u0302\u0301", + "\u1EC1": "e\u0302\u0300", + "\u1EC5": "e\u0302\u0303", + "\u0117": "e\u0307", + "\u0229": "e\u0327", + "\u1E1F": "f\u0307", + "\u01F5": "g\u0301", + "\u1E21": "g\u0304", + "\u011F": "g\u0306", + "\u01E7": "g\u030C", + "\u011D": "g\u0302", + "\u0121": "g\u0307", + "\u0123": "g\u0327", + "\u1E27": "h\u0308", + "\u021F": "h\u030C", + "\u0125": "h\u0302", + "\u1E23": "h\u0307", + "\u1E29": "h\u0327", + "\xED": "i\u0301", + "\xEC": "i\u0300", + "\xEF": "i\u0308", + "\u1E2F": "i\u0308\u0301", + "\u0129": "i\u0303", + "\u012B": "i\u0304", + "\u012D": "i\u0306", + "\u01D0": "i\u030C", + "\xEE": "i\u0302", + "\u01F0": "j\u030C", + "\u0135": "j\u0302", + "\u1E31": "k\u0301", + "\u01E9": "k\u030C", + "\u0137": "k\u0327", + "\u013A": "l\u0301", + "\u013E": "l\u030C", + "\u013C": "l\u0327", + "\u1E3F": "m\u0301", + "\u1E41": "m\u0307", + "\u0144": "n\u0301", + "\u01F9": "n\u0300", + "\xF1": "n\u0303", + "\u0148": "n\u030C", + "\u1E45": "n\u0307", + "\u0146": "n\u0327", + "\xF3": "o\u0301", + "\xF2": "o\u0300", + "\xF6": "o\u0308", + "\u022B": "o\u0308\u0304", + "\xF5": "o\u0303", + "\u1E4D": "o\u0303\u0301", + "\u1E4F": "o\u0303\u0308", + "\u022D": "o\u0303\u0304", + "\u014D": "o\u0304", + "\u1E53": "o\u0304\u0301", + "\u1E51": "o\u0304\u0300", + "\u014F": "o\u0306", + "\u01D2": "o\u030C", + "\xF4": "o\u0302", + "\u1ED1": "o\u0302\u0301", + "\u1ED3": "o\u0302\u0300", + "\u1ED7": "o\u0302\u0303", + "\u022F": "o\u0307", + "\u0231": "o\u0307\u0304", + "\u0151": "o\u030B", + "\u1E55": "p\u0301", + "\u1E57": "p\u0307", + "\u0155": "r\u0301", + "\u0159": "r\u030C", + "\u1E59": "r\u0307", + "\u0157": "r\u0327", + "\u015B": "s\u0301", + "\u1E65": "s\u0301\u0307", + "\u0161": "s\u030C", + "\u1E67": "s\u030C\u0307", + "\u015D": "s\u0302", + "\u1E61": "s\u0307", + "\u015F": "s\u0327", + "\u1E97": "t\u0308", + "\u0165": "t\u030C", + "\u1E6B": "t\u0307", + "\u0163": "t\u0327", + "\xFA": "u\u0301", + "\xF9": "u\u0300", + "\xFC": "u\u0308", + "\u01D8": "u\u0308\u0301", + "\u01DC": "u\u0308\u0300", + "\u01D6": "u\u0308\u0304", + "\u01DA": "u\u0308\u030C", + "\u0169": "u\u0303", + "\u1E79": "u\u0303\u0301", + "\u016B": "u\u0304", + "\u1E7B": "u\u0304\u0308", + "\u016D": "u\u0306", + "\u01D4": "u\u030C", + "\xFB": "u\u0302", + "\u016F": "u\u030A", + "\u0171": "u\u030B", + "\u1E7D": "v\u0303", + "\u1E83": "w\u0301", + "\u1E81": "w\u0300", + "\u1E85": "w\u0308", + "\u0175": "w\u0302", + "\u1E87": "w\u0307", + "\u1E98": "w\u030A", + "\u1E8D": "x\u0308", + "\u1E8B": "x\u0307", + "\xFD": "y\u0301", + "\u1EF3": "y\u0300", + "\xFF": "y\u0308", + "\u1EF9": "y\u0303", + "\u0233": "y\u0304", + "\u0177": "y\u0302", + "\u1E8F": "y\u0307", + "\u1E99": "y\u030A", + "\u017A": "z\u0301", + "\u017E": "z\u030C", + "\u1E91": "z\u0302", + "\u017C": "z\u0307", + "\xC1": "A\u0301", + "\xC0": "A\u0300", + "\xC4": "A\u0308", + "\u01DE": "A\u0308\u0304", + "\xC3": "A\u0303", + "\u0100": "A\u0304", + "\u0102": "A\u0306", + "\u1EAE": "A\u0306\u0301", + "\u1EB0": "A\u0306\u0300", + "\u1EB4": "A\u0306\u0303", + "\u01CD": "A\u030C", + "\xC2": "A\u0302", + "\u1EA4": "A\u0302\u0301", + "\u1EA6": "A\u0302\u0300", + "\u1EAA": "A\u0302\u0303", + "\u0226": "A\u0307", + "\u01E0": "A\u0307\u0304", + "\xC5": "A\u030A", + "\u01FA": "A\u030A\u0301", + "\u1E02": "B\u0307", + "\u0106": "C\u0301", + "\u1E08": "C\u0327\u0301", + "\u010C": "C\u030C", + "\u0108": "C\u0302", + "\u010A": "C\u0307", + "\xC7": "C\u0327", + "\u010E": "D\u030C", + "\u1E0A": "D\u0307", + "\u1E10": "D\u0327", + "\xC9": "E\u0301", + "\xC8": "E\u0300", + "\xCB": "E\u0308", + "\u1EBC": "E\u0303", + "\u0112": "E\u0304", + "\u1E16": "E\u0304\u0301", + "\u1E14": "E\u0304\u0300", + "\u0114": "E\u0306", + "\u1E1C": "E\u0327\u0306", + "\u011A": "E\u030C", + "\xCA": "E\u0302", + "\u1EBE": "E\u0302\u0301", + "\u1EC0": "E\u0302\u0300", + "\u1EC4": "E\u0302\u0303", + "\u0116": "E\u0307", + "\u0228": "E\u0327", + "\u1E1E": "F\u0307", + "\u01F4": "G\u0301", + "\u1E20": "G\u0304", + "\u011E": "G\u0306", + "\u01E6": "G\u030C", + "\u011C": "G\u0302", + "\u0120": "G\u0307", + "\u0122": "G\u0327", + "\u1E26": "H\u0308", + "\u021E": "H\u030C", + "\u0124": "H\u0302", + "\u1E22": "H\u0307", + "\u1E28": "H\u0327", + "\xCD": "I\u0301", + "\xCC": "I\u0300", + "\xCF": "I\u0308", + "\u1E2E": "I\u0308\u0301", + "\u0128": "I\u0303", + "\u012A": "I\u0304", + "\u012C": "I\u0306", + "\u01CF": "I\u030C", + "\xCE": "I\u0302", + "\u0130": "I\u0307", + "\u0134": "J\u0302", + "\u1E30": "K\u0301", + "\u01E8": "K\u030C", + "\u0136": "K\u0327", + "\u0139": "L\u0301", + "\u013D": "L\u030C", + "\u013B": "L\u0327", + "\u1E3E": "M\u0301", + "\u1E40": "M\u0307", + "\u0143": "N\u0301", + "\u01F8": "N\u0300", + "\xD1": "N\u0303", + "\u0147": "N\u030C", + "\u1E44": "N\u0307", + "\u0145": "N\u0327", + "\xD3": "O\u0301", + "\xD2": "O\u0300", + "\xD6": "O\u0308", + "\u022A": "O\u0308\u0304", + "\xD5": "O\u0303", + "\u1E4C": "O\u0303\u0301", + "\u1E4E": "O\u0303\u0308", + "\u022C": "O\u0303\u0304", + "\u014C": "O\u0304", + "\u1E52": "O\u0304\u0301", + "\u1E50": "O\u0304\u0300", + "\u014E": "O\u0306", + "\u01D1": "O\u030C", + "\xD4": "O\u0302", + "\u1ED0": "O\u0302\u0301", + "\u1ED2": "O\u0302\u0300", + "\u1ED6": "O\u0302\u0303", + "\u022E": "O\u0307", + "\u0230": "O\u0307\u0304", + "\u0150": "O\u030B", + "\u1E54": "P\u0301", + "\u1E56": "P\u0307", + "\u0154": "R\u0301", + "\u0158": "R\u030C", + "\u1E58": "R\u0307", + "\u0156": "R\u0327", + "\u015A": "S\u0301", + "\u1E64": "S\u0301\u0307", + "\u0160": "S\u030C", + "\u1E66": "S\u030C\u0307", + "\u015C": "S\u0302", + "\u1E60": "S\u0307", + "\u015E": "S\u0327", + "\u0164": "T\u030C", + "\u1E6A": "T\u0307", + "\u0162": "T\u0327", + "\xDA": "U\u0301", + "\xD9": "U\u0300", + "\xDC": "U\u0308", + "\u01D7": "U\u0308\u0301", + "\u01DB": "U\u0308\u0300", + "\u01D5": "U\u0308\u0304", + "\u01D9": "U\u0308\u030C", + "\u0168": "U\u0303", + "\u1E78": "U\u0303\u0301", + "\u016A": "U\u0304", + "\u1E7A": "U\u0304\u0308", + "\u016C": "U\u0306", + "\u01D3": "U\u030C", + "\xDB": "U\u0302", + "\u016E": "U\u030A", + "\u0170": "U\u030B", + "\u1E7C": "V\u0303", + "\u1E82": "W\u0301", + "\u1E80": "W\u0300", + "\u1E84": "W\u0308", + "\u0174": "W\u0302", + "\u1E86": "W\u0307", + "\u1E8C": "X\u0308", + "\u1E8A": "X\u0307", + "\xDD": "Y\u0301", + "\u1EF2": "Y\u0300", + "\u0178": "Y\u0308", + "\u1EF8": "Y\u0303", + "\u0232": "Y\u0304", + "\u0176": "Y\u0302", + "\u1E8E": "Y\u0307", + "\u0179": "Z\u0301", + "\u017D": "Z\u030C", + "\u1E90": "Z\u0302", + "\u017B": "Z\u0307", + "\u03AC": "\u03B1\u0301", + "\u1F70": "\u03B1\u0300", + "\u1FB1": "\u03B1\u0304", + "\u1FB0": "\u03B1\u0306", + "\u03AD": "\u03B5\u0301", + "\u1F72": "\u03B5\u0300", + "\u03AE": "\u03B7\u0301", + "\u1F74": "\u03B7\u0300", + "\u03AF": "\u03B9\u0301", + "\u1F76": "\u03B9\u0300", + "\u03CA": "\u03B9\u0308", + "\u0390": "\u03B9\u0308\u0301", + "\u1FD2": "\u03B9\u0308\u0300", + "\u1FD1": "\u03B9\u0304", + "\u1FD0": "\u03B9\u0306", + "\u03CC": "\u03BF\u0301", + "\u1F78": "\u03BF\u0300", + "\u03CD": "\u03C5\u0301", + "\u1F7A": "\u03C5\u0300", + "\u03CB": "\u03C5\u0308", + "\u03B0": "\u03C5\u0308\u0301", + "\u1FE2": "\u03C5\u0308\u0300", + "\u1FE1": "\u03C5\u0304", + "\u1FE0": "\u03C5\u0306", + "\u03CE": "\u03C9\u0301", + "\u1F7C": "\u03C9\u0300", + "\u038E": "\u03A5\u0301", + "\u1FEA": "\u03A5\u0300", + "\u03AB": "\u03A5\u0308", + "\u1FE9": "\u03A5\u0304", + "\u1FE8": "\u03A5\u0306", + "\u038F": "\u03A9\u0301", + "\u1FFA": "\u03A9\u0300" + }; + Parser = class _Parser2 { + static { + __name(this, "Parser"); + } + constructor(input, settings) { + this.mode = void 0; + this.gullet = void 0; + this.settings = void 0; + this.leftrightDepth = void 0; + this.nextToken = void 0; + this.mode = "math"; + this.gullet = new MacroExpander(input, settings, this.mode); + this.settings = settings; + this.leftrightDepth = 0; + } + /** + * Checks a result to make sure it has the right type, and throws an + * appropriate error otherwise. + */ + expect(text2, consume) { + if (consume === void 0) { + consume = true; + } + if (this.fetch().text !== text2) { + throw new ParseError("Expected '" + text2 + "', got '" + this.fetch().text + "'", this.fetch()); + } + if (consume) { + this.consume(); + } + } + /** + * Discards the current lookahead token, considering it consumed. + */ + consume() { + this.nextToken = null; + } + /** + * Return the current lookahead token, or if there isn't one (at the + * beginning, or if the previous lookahead token was consume()d), + * fetch the next token as the new lookahead token and return it. + */ + fetch() { + if (this.nextToken == null) { + this.nextToken = this.gullet.expandNextToken(); + } + return this.nextToken; + } + /** + * Switches between "text" and "math" modes. + */ + switchMode(newMode) { + this.mode = newMode; + this.gullet.switchMode(newMode); + } + /** + * Main parsing function, which parses an entire input. + */ + parse() { + if (!this.settings.globalGroup) { + this.gullet.beginGroup(); + } + if (this.settings.colorIsTextColor) { + this.gullet.macros.set("\\color", "\\textcolor"); + } + try { + var parse8 = this.parseExpression(false); + this.expect("EOF"); + if (!this.settings.globalGroup) { + this.gullet.endGroup(); + } + return parse8; + } finally { + this.gullet.endGroups(); + } + } + /** + * Fully parse a separate sequence of tokens as a separate job. + * Tokens should be specified in reverse order, as in a MacroDefinition. + */ + subparse(tokens2) { + var oldToken = this.nextToken; + this.consume(); + this.gullet.pushToken(new Token("}")); + this.gullet.pushTokens(tokens2); + var parse8 = this.parseExpression(false); + this.expect("}"); + this.nextToken = oldToken; + return parse8; + } + /** + * Parses an "expression", which is a list of atoms. + * + * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This + * happens when functions have higher precedence han infix + * nodes in implicit parses. + * + * `breakOnTokenText`: The text of the token that the expression should end + * with, or `null` if something else should end the + * expression. + */ + parseExpression(breakOnInfix, breakOnTokenText) { + var body = []; + while (true) { + if (this.mode === "math") { + this.consumeSpaces(); + } + var lex2 = this.fetch(); + if (_Parser2.endOfExpression.indexOf(lex2.text) !== -1) { + break; + } + if (breakOnTokenText && lex2.text === breakOnTokenText) { + break; + } + if (breakOnInfix && functions[lex2.text] && functions[lex2.text].infix) { + break; + } + var atom2 = this.parseAtom(breakOnTokenText); + if (!atom2) { + break; + } else if (atom2.type === "internal") { + continue; + } + body.push(atom2); + } + if (this.mode === "text") { + this.formLigatures(body); + } + return this.handleInfixNodes(body); + } + /** + * Rewrites infix operators such as \over with corresponding commands such + * as \frac. + * + * There can only be one infix operator per group. If there's more than one + * then the expression is ambiguous. This can be resolved by adding {}. + */ + handleInfixNodes(body) { + var overIndex = -1; + var funcName; + for (var i2 = 0; i2 < body.length; i2++) { + if (body[i2].type === "infix") { + if (overIndex !== -1) { + throw new ParseError("only one infix operator per group", body[i2].token); + } + overIndex = i2; + funcName = body[i2].replaceWith; + } + } + if (overIndex !== -1 && funcName) { + var numerNode; + var denomNode; + var numerBody = body.slice(0, overIndex); + var denomBody = body.slice(overIndex + 1); + if (numerBody.length === 1 && numerBody[0].type === "ordgroup") { + numerNode = numerBody[0]; + } else { + numerNode = { + type: "ordgroup", + mode: this.mode, + body: numerBody + }; + } + if (denomBody.length === 1 && denomBody[0].type === "ordgroup") { + denomNode = denomBody[0]; + } else { + denomNode = { + type: "ordgroup", + mode: this.mode, + body: denomBody + }; + } + var node2; + if (funcName === "\\\\abovefrac") { + node2 = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []); + } else { + node2 = this.callFunction(funcName, [numerNode, denomNode], []); + } + return [node2]; + } else { + return body; + } + } + /** + * Handle a subscript or superscript with nice errors. + */ + handleSupSubscript(name) { + var symbolToken = this.fetch(); + var symbol = symbolToken.text; + this.consume(); + this.consumeSpaces(); + var group2 = this.parseGroup(name); + if (!group2) { + throw new ParseError("Expected group after '" + symbol + "'", symbolToken); + } + return group2; + } + /** + * Converts the textual input of an unsupported command into a text node + * contained within a color node whose color is determined by errorColor + */ + formatUnsupportedCmd(text2) { + var textordArray = []; + for (var i2 = 0; i2 < text2.length; i2++) { + textordArray.push({ + type: "textord", + mode: "text", + text: text2[i2] + }); + } + var textNode = { + type: "text", + mode: this.mode, + body: textordArray + }; + var colorNode = { + type: "color", + mode: this.mode, + color: this.settings.errorColor, + body: [textNode] + }; + return colorNode; + } + /** + * Parses a group with optional super/subscripts. + */ + parseAtom(breakOnTokenText) { + var base = this.parseGroup("atom", breakOnTokenText); + if (this.mode === "text") { + return base; + } + var superscript; + var subscript; + while (true) { + this.consumeSpaces(); + var lex2 = this.fetch(); + if (lex2.text === "\\limits" || lex2.text === "\\nolimits") { + if (base && base.type === "op") { + var limits = lex2.text === "\\limits"; + base.limits = limits; + base.alwaysHandleSupSub = true; + } else if (base && base.type === "operatorname") { + if (base.alwaysHandleSupSub) { + base.limits = lex2.text === "\\limits"; + } + } else { + throw new ParseError("Limit controls must follow a math operator", lex2); + } + this.consume(); + } else if (lex2.text === "^") { + if (superscript) { + throw new ParseError("Double superscript", lex2); + } + superscript = this.handleSupSubscript("superscript"); + } else if (lex2.text === "_") { + if (subscript) { + throw new ParseError("Double subscript", lex2); + } + subscript = this.handleSupSubscript("subscript"); + } else if (lex2.text === "'") { + if (superscript) { + throw new ParseError("Double superscript", lex2); + } + var prime = { + type: "textord", + mode: this.mode, + text: "\\prime" + }; + var primes = [prime]; + this.consume(); + while (this.fetch().text === "'") { + primes.push(prime); + this.consume(); + } + if (this.fetch().text === "^") { + primes.push(this.handleSupSubscript("superscript")); + } + superscript = { + type: "ordgroup", + mode: this.mode, + body: primes + }; + } else if (uSubsAndSups[lex2.text]) { + var isSub = unicodeSubRegEx.test(lex2.text); + var subsupTokens = []; + subsupTokens.push(new Token(uSubsAndSups[lex2.text])); + this.consume(); + while (true) { + var token2 = this.fetch().text; + if (!uSubsAndSups[token2]) { + break; + } + if (unicodeSubRegEx.test(token2) !== isSub) { + break; + } + subsupTokens.unshift(new Token(uSubsAndSups[token2])); + this.consume(); + } + var body = this.subparse(subsupTokens); + if (isSub) { + subscript = { + type: "ordgroup", + mode: "math", + body + }; + } else { + superscript = { + type: "ordgroup", + mode: "math", + body + }; + } + } else { + break; + } + } + if (superscript || subscript) { + return { + type: "supsub", + mode: this.mode, + base, + sup: superscript, + sub: subscript + }; + } else { + return base; + } + } + /** + * Parses an entire function, including its base and all of its arguments. + */ + parseFunction(breakOnTokenText, name) { + var token2 = this.fetch(); + var func = token2.text; + var funcData = functions[func]; + if (!funcData) { + return null; + } + this.consume(); + if (name && name !== "atom" && !funcData.allowedInArgument) { + throw new ParseError("Got function '" + func + "' with no arguments" + (name ? " as " + name : ""), token2); + } else if (this.mode === "text" && !funcData.allowedInText) { + throw new ParseError("Can't use function '" + func + "' in text mode", token2); + } else if (this.mode === "math" && funcData.allowedInMath === false) { + throw new ParseError("Can't use function '" + func + "' in math mode", token2); + } + var { + args, + optArgs + } = this.parseArguments(func, funcData); + return this.callFunction(func, args, optArgs, token2, breakOnTokenText); + } + /** + * Call a function handler with a suitable context and arguments. + */ + callFunction(name, args, optArgs, token2, breakOnTokenText) { + var context = { + funcName: name, + parser: this, + token: token2, + breakOnTokenText + }; + var func = functions[name]; + if (func && func.handler) { + return func.handler(context, args, optArgs); + } else { + throw new ParseError("No function handler for " + name); + } + } + /** + * Parses the arguments of a function or environment + */ + parseArguments(func, funcData) { + var totalArgs = funcData.numArgs + funcData.numOptionalArgs; + if (totalArgs === 0) { + return { + args: [], + optArgs: [] + }; + } + var args = []; + var optArgs = []; + for (var i2 = 0; i2 < totalArgs; i2++) { + var argType = funcData.argTypes && funcData.argTypes[i2]; + var isOptional = i2 < funcData.numOptionalArgs; + if (funcData.primitive && argType == null || // \sqrt expands into primitive if optional argument doesn't exist + funcData.type === "sqrt" && i2 === 1 && optArgs[0] == null) { + argType = "primitive"; + } + var arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional); + if (isOptional) { + optArgs.push(arg); + } else if (arg != null) { + args.push(arg); + } else { + throw new ParseError("Null argument, please report this as a bug"); + } + } + return { + args, + optArgs + }; + } + /** + * Parses a group when the mode is changing. + */ + parseGroupOfType(name, type3, optional2) { + switch (type3) { + case "color": + return this.parseColorGroup(optional2); + case "size": + return this.parseSizeGroup(optional2); + case "url": + return this.parseUrlGroup(optional2); + case "math": + case "text": + return this.parseArgumentGroup(optional2, type3); + case "hbox": { + var group2 = this.parseArgumentGroup(optional2, "text"); + return group2 != null ? { + type: "styling", + mode: group2.mode, + body: [group2], + style: "text" + // simulate \textstyle + } : null; + } + case "raw": { + var token2 = this.parseStringGroup("raw", optional2); + return token2 != null ? { + type: "raw", + mode: "text", + string: token2.text + } : null; + } + case "primitive": { + if (optional2) { + throw new ParseError("A primitive argument cannot be optional"); + } + var _group = this.parseGroup(name); + if (_group == null) { + throw new ParseError("Expected group as " + name, this.fetch()); + } + return _group; + } + case "original": + case null: + case void 0: + return this.parseArgumentGroup(optional2); + default: + throw new ParseError("Unknown group type as " + name, this.fetch()); + } + } + /** + * Discard any space tokens, fetching the next non-space token. + */ + consumeSpaces() { + while (this.fetch().text === " ") { + this.consume(); + } + } + /** + * Parses a group, essentially returning the string formed by the + * brace-enclosed tokens plus some position information. + */ + parseStringGroup(modeName, optional2) { + var argToken = this.gullet.scanArgument(optional2); + if (argToken == null) { + return null; + } + var str2 = ""; + var nextToken; + while ((nextToken = this.fetch()).text !== "EOF") { + str2 += nextToken.text; + this.consume(); + } + this.consume(); + argToken.text = str2; + return argToken; + } + /** + * Parses a regex-delimited group: the largest sequence of tokens + * whose concatenated strings match `regex`. Returns the string + * formed by the tokens plus some position information. + */ + parseRegexGroup(regex, modeName) { + var firstToken = this.fetch(); + var lastToken = firstToken; + var str2 = ""; + var nextToken; + while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str2 + nextToken.text)) { + lastToken = nextToken; + str2 += lastToken.text; + this.consume(); + } + if (str2 === "") { + throw new ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken); + } + return firstToken.range(lastToken, str2); + } + /** + * Parses a color description. + */ + parseColorGroup(optional2) { + var res = this.parseStringGroup("color", optional2); + if (res == null) { + return null; + } + var match2 = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(res.text); + if (!match2) { + throw new ParseError("Invalid color: '" + res.text + "'", res); + } + var color2 = match2[0]; + if (/^[0-9a-f]{6}$/i.test(color2)) { + color2 = "#" + color2; + } + return { + type: "color-token", + mode: this.mode, + color: color2 + }; + } + /** + * Parses a size specification, consisting of magnitude and unit. + */ + parseSizeGroup(optional2) { + var res; + var isBlank = false; + this.gullet.consumeSpaces(); + if (!optional2 && this.gullet.future().text !== "{") { + res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size"); + } else { + res = this.parseStringGroup("size", optional2); + } + if (!res) { + return null; + } + if (!optional2 && res.text.length === 0) { + res.text = "0pt"; + isBlank = true; + } + var match2 = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text); + if (!match2) { + throw new ParseError("Invalid size: '" + res.text + "'", res); + } + var data5 = { + number: +(match2[1] + match2[2]), + // sign + magnitude, cast to number + unit: match2[3] + }; + if (!validUnit(data5)) { + throw new ParseError("Invalid unit: '" + data5.unit + "'", res); + } + return { + type: "size", + mode: this.mode, + value: data5, + isBlank + }; + } + /** + * Parses an URL, checking escaped letters and allowed protocols, + * and setting the catcode of % as an active character (as in \hyperref). + */ + parseUrlGroup(optional2) { + this.gullet.lexer.setCatcode("%", 13); + this.gullet.lexer.setCatcode("~", 12); + var res = this.parseStringGroup("url", optional2); + this.gullet.lexer.setCatcode("%", 14); + this.gullet.lexer.setCatcode("~", 13); + if (res == null) { + return null; + } + var url = res.text.replace(/\\([#$%&~_^{}])/g, "$1"); + return { + type: "url", + mode: this.mode, + url + }; + } + /** + * Parses an argument with the mode specified. + */ + parseArgumentGroup(optional2, mode) { + var argToken = this.gullet.scanArgument(optional2); + if (argToken == null) { + return null; + } + var outerMode = this.mode; + if (mode) { + this.switchMode(mode); + } + this.gullet.beginGroup(); + var expression = this.parseExpression(false, "EOF"); + this.expect("EOF"); + this.gullet.endGroup(); + var result = { + type: "ordgroup", + mode: this.mode, + loc: argToken.loc, + body: expression + }; + if (mode) { + this.switchMode(outerMode); + } + return result; + } + /** + * Parses an ordinary group, which is either a single nucleus (like "x") + * or an expression in braces (like "{x+y}") or an implicit group, a group + * that starts at the current position, and ends right before a higher explicit + * group ends, or at EOF. + */ + parseGroup(name, breakOnTokenText) { + var firstToken = this.fetch(); + var text2 = firstToken.text; + var result; + if (text2 === "{" || text2 === "\\begingroup") { + this.consume(); + var groupEnd = text2 === "{" ? "}" : "\\endgroup"; + this.gullet.beginGroup(); + var expression = this.parseExpression(false, groupEnd); + var lastToken = this.fetch(); + this.expect(groupEnd); + this.gullet.endGroup(); + result = { + type: "ordgroup", + mode: this.mode, + loc: SourceLocation.range(firstToken, lastToken), + body: expression, + // A group formed by \begingroup...\endgroup is a semi-simple group + // which doesn't affect spacing in math mode, i.e., is transparent. + // https://tex.stackexchange.com/questions/1930/when-should-one- + // use-begingroup-instead-of-bgroup + semisimple: text2 === "\\begingroup" || void 0 + }; + } else { + result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol(); + if (result == null && text2[0] === "\\" && !implicitCommands.hasOwnProperty(text2)) { + if (this.settings.throwOnError) { + throw new ParseError("Undefined control sequence: " + text2, firstToken); + } + result = this.formatUnsupportedCmd(text2); + this.consume(); + } + } + return result; + } + /** + * Form ligature-like combinations of characters for text mode. + * This includes inputs like "--", "---", "``" and "''". + * The result will simply replace multiple textord nodes with a single + * character in each value by a single textord node having multiple + * characters in its value. The representation is still ASCII source. + * The group will be modified in place. + */ + formLigatures(group2) { + var n2 = group2.length - 1; + for (var i2 = 0; i2 < n2; ++i2) { + var a2 = group2[i2]; + var v3 = a2.text; + if (v3 === "-" && group2[i2 + 1].text === "-") { + if (i2 + 1 < n2 && group2[i2 + 2].text === "-") { + group2.splice(i2, 3, { + type: "textord", + mode: "text", + loc: SourceLocation.range(a2, group2[i2 + 2]), + text: "---" + }); + n2 -= 2; + } else { + group2.splice(i2, 2, { + type: "textord", + mode: "text", + loc: SourceLocation.range(a2, group2[i2 + 1]), + text: "--" + }); + n2 -= 1; + } + } + if ((v3 === "'" || v3 === "`") && group2[i2 + 1].text === v3) { + group2.splice(i2, 2, { + type: "textord", + mode: "text", + loc: SourceLocation.range(a2, group2[i2 + 1]), + text: v3 + v3 + }); + n2 -= 1; + } + } + } + /** + * Parse a single symbol out of the string. Here, we handle single character + * symbols and special functions like \verb. + */ + parseSymbol() { + var nucleus = this.fetch(); + var text2 = nucleus.text; + if (/^\\verb[^a-zA-Z]/.test(text2)) { + this.consume(); + var arg = text2.slice(5); + var star2 = arg.charAt(0) === "*"; + if (star2) { + arg = arg.slice(1); + } + if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) { + throw new ParseError("\\verb assertion failed --\n please report what input caused this bug"); + } + arg = arg.slice(1, -1); + return { + type: "verb", + mode: "text", + body: arg, + star: star2 + }; + } + if (unicodeSymbols.hasOwnProperty(text2[0]) && !symbols[this.mode][text2[0]]) { + if (this.settings.strict && this.mode === "math") { + this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + text2[0] + '" used in math mode', nucleus); + } + text2 = unicodeSymbols[text2[0]] + text2.slice(1); + } + var match2 = combiningDiacriticalMarksEndRegex.exec(text2); + if (match2) { + text2 = text2.substring(0, match2.index); + if (text2 === "i") { + text2 = "\u0131"; + } else if (text2 === "j") { + text2 = "\u0237"; + } + } + var symbol; + if (symbols[this.mode][text2]) { + if (this.settings.strict && this.mode === "math" && extraLatin.indexOf(text2) >= 0) { + this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + text2[0] + '" used in math mode', nucleus); + } + var group2 = symbols[this.mode][text2].group; + var loc = SourceLocation.range(nucleus); + var s2; + if (ATOMS.hasOwnProperty(group2)) { + var family = group2; + s2 = { + type: "atom", + mode: this.mode, + family, + loc, + text: text2 + }; + } else { + s2 = { + type: group2, + mode: this.mode, + loc, + text: text2 + }; + } + symbol = s2; + } else if (text2.charCodeAt(0) >= 128) { + if (this.settings.strict) { + if (!supportedCodepoint(text2.charCodeAt(0))) { + this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + text2[0] + '"' + (" (" + text2.charCodeAt(0) + ")"), nucleus); + } else if (this.mode === "math") { + this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + text2[0] + '" used in math mode', nucleus); + } + } + symbol = { + type: "textord", + mode: "text", + loc: SourceLocation.range(nucleus), + text: text2 + }; + } else { + return null; + } + this.consume(); + if (match2) { + for (var i2 = 0; i2 < match2[0].length; i2++) { + var accent2 = match2[0][i2]; + if (!unicodeAccents[accent2]) { + throw new ParseError("Unknown accent ' " + accent2 + "'", nucleus); + } + var command = unicodeAccents[accent2][this.mode] || unicodeAccents[accent2].text; + if (!command) { + throw new ParseError("Accent " + accent2 + " unsupported in " + this.mode + " mode", nucleus); + } + symbol = { + type: "accent", + mode: this.mode, + loc: SourceLocation.range(nucleus), + label: command, + isStretchy: false, + isShifty: true, + // $FlowFixMe + base: symbol + }; + } + } + return symbol; + } + }; + Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"]; + parseTree = /* @__PURE__ */ __name(function parseTree2(toParse, settings) { + if (!(typeof toParse === "string" || toParse instanceof String)) { + throw new TypeError("KaTeX can only parse string typed expression"); + } + var parser21 = new Parser(toParse, settings); + delete parser21.gullet.macros.current["\\df@tag"]; + var tree = parser21.parse(); + delete parser21.gullet.macros.current["\\current@color"]; + delete parser21.gullet.macros.current["\\color"]; + if (parser21.gullet.macros.get("\\df@tag")) { + if (!settings.displayMode) { + throw new ParseError("\\tag works only in display equations"); + } + tree = [{ + type: "tag", + mode: "text", + body: tree, + tag: parser21.subparse([new Token("\\df@tag")]) + }]; + } + return tree; + }, "parseTree"); + render = /* @__PURE__ */ __name(function render2(expression, baseNode, options3) { + baseNode.textContent = ""; + var node2 = renderToDomTree(expression, options3).toNode(); + baseNode.appendChild(node2); + }, "render"); + if (typeof document !== "undefined") { + if (document.compatMode !== "CSS1Compat") { + typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."); + render = /* @__PURE__ */ __name(function render8() { + throw new ParseError("KaTeX doesn't work in quirks mode."); + }, "render"); + } + } + renderToString = /* @__PURE__ */ __name(function renderToString2(expression, options3) { + var markup = renderToDomTree(expression, options3).toMarkup(); + return markup; + }, "renderToString"); + generateParseTree = /* @__PURE__ */ __name(function generateParseTree2(expression, options3) { + var settings = new Settings(options3); + return parseTree(expression, settings); + }, "generateParseTree"); + renderError = /* @__PURE__ */ __name(function renderError2(error3, expression, options3) { + if (options3.throwOnError || !(error3 instanceof ParseError)) { + throw error3; + } + var node2 = buildCommon.makeSpan(["katex-error"], [new SymbolNode(expression)]); + node2.setAttribute("title", error3.toString()); + node2.setAttribute("style", "color:" + options3.errorColor); + return node2; + }, "renderError"); + renderToDomTree = /* @__PURE__ */ __name(function renderToDomTree2(expression, options3) { + var settings = new Settings(options3); + try { + var tree = parseTree(expression, settings); + return buildTree(tree, expression, settings); + } catch (error3) { + return renderError(error3, expression, settings); + } + }, "renderToDomTree"); + renderToHTMLTree = /* @__PURE__ */ __name(function renderToHTMLTree2(expression, options3) { + var settings = new Settings(options3); + try { + var tree = parseTree(expression, settings); + return buildHTMLTree(tree, expression, settings); + } catch (error3) { + return renderError(error3, expression, settings); + } + }, "renderToHTMLTree"); + katex = { + /** + * Current KaTeX version + */ + version: "0.16.11", + /** + * Renders the given LaTeX into an HTML+MathML combination, and adds + * it as a child to the specified DOM node. + */ + render, + /** + * Renders the given LaTeX into an HTML+MathML combination string, + * for sending to the client. + */ + renderToString, + /** + * KaTeX error, usually during parsing. + */ + ParseError, + /** + * The shema of Settings + */ + SETTINGS_SCHEMA, + /** + * Parses the given LaTeX into KaTeX's internal parse tree structure, + * without rendering to HTML or MathML. + * + * NOTE: This method is not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __parse: generateParseTree, + /** + * Renders the given LaTeX into an HTML+MathML internal DOM tree + * representation, without flattening that representation to a string. + * + * NOTE: This method is not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __renderToDomTree: renderToDomTree, + /** + * Renders the given LaTeX into an HTML internal DOM tree representation, + * without MathML and without flattening that representation to a string. + * + * NOTE: This method is not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __renderToHTMLTree: renderToHTMLTree, + /** + * extends internal font metrics object with a new object + * each key in the new object represents a font name + */ + __setFontMetrics: setFontMetrics, + /** + * adds a new symbol to builtin symbols table + */ + __defineSymbol: defineSymbol, + /** + * adds a new function to builtin function list, + * which directly produce parse tree elements + * and have their own html/mathml builders + */ + __defineFunction: defineFunction, + /** + * adds a new macro to builtin macro list + */ + __defineMacro: defineMacro, + /** + * Expose the dom tree node types, which can be useful for type checking nodes. + * + * NOTE: This method is not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __domTree: { + Span, + Anchor, + SymbolNode, + SvgNode, + PathNode, + LineNode + } + }; } - }; - const calculateSvgSizeAttrs = function(height, width2, useMaxWidth) { - let attrs = /* @__PURE__ */ new Map(); - if (useMaxWidth) { - attrs.set("width", "100%"); - attrs.set("style", `max-width: ${width2}px;`); - } else { - attrs.set("height", height); - attrs.set("width", width2); + }); + + // src/diagrams/common/common.ts + function setupDompurifyHooks() { + const TEMPORARY_ATTRIBUTE = "data-temp-href-target"; + import_dompurify.default.addHook("beforeSanitizeAttributes", (node2) => { + if (node2.tagName === "A" && node2.hasAttribute("target")) { + node2.setAttribute(TEMPORARY_ATTRIBUTE, node2.getAttribute("target") ?? ""); + } + }); + import_dompurify.default.addHook("afterSanitizeAttributes", (node2) => { + if (node2.tagName === "A" && node2.hasAttribute(TEMPORARY_ATTRIBUTE)) { + node2.setAttribute("target", node2.getAttribute(TEMPORARY_ATTRIBUTE) ?? ""); + node2.removeAttribute(TEMPORARY_ATTRIBUTE); + if (node2.getAttribute("target") === "_blank") { + node2.setAttribute("rel", "noopener"); + } + } + }); + } + var import_dompurify, lineBreakRegex, getRows, setupDompurifyHooksIfNotSetup, removeScript, sanitizeMore, sanitizeText, sanitizeTextOrArray, hasBreaks, splitBreaks, placeholderToBreak, breakToPlaceholder, getUrl, evaluate, getMax, getMin, parseGenericTypes, countOccurrence, shouldCombineSets, processSet, isMathMLSupported, katexRegex, hasKatex, calculateMathMLDimensions, renderKatex, common_default; + var init_common = __esm({ + "src/diagrams/common/common.ts"() { + "use strict"; + import_dompurify = __toESM(require_purify(), 1); + lineBreakRegex = //gi; + getRows = /* @__PURE__ */ __name((s2) => { + if (!s2) { + return [""]; + } + const str2 = breakToPlaceholder(s2).replace(/\\n/g, "#br#"); + return str2.split("#br#"); + }, "getRows"); + setupDompurifyHooksIfNotSetup = /* @__PURE__ */ (() => { + let setup = false; + return () => { + if (!setup) { + setupDompurifyHooks(); + setup = true; + } + }; + })(); + __name(setupDompurifyHooks, "setupDompurifyHooks"); + removeScript = /* @__PURE__ */ __name((txt) => { + setupDompurifyHooksIfNotSetup(); + const sanitizedText = import_dompurify.default.sanitize(txt); + return sanitizedText; + }, "removeScript"); + sanitizeMore = /* @__PURE__ */ __name((text2, config6) => { + if (config6.flowchart?.htmlLabels !== false) { + const level = config6.securityLevel; + if (level === "antiscript" || level === "strict") { + text2 = removeScript(text2); + } else if (level !== "loose") { + text2 = breakToPlaceholder(text2); + text2 = text2.replace(//g, ">"); + text2 = text2.replace(/=/g, "="); + text2 = placeholderToBreak(text2); + } + } + return text2; + }, "sanitizeMore"); + sanitizeText = /* @__PURE__ */ __name((text2, config6) => { + if (!text2) { + return text2; + } + if (config6.dompurifyConfig) { + text2 = import_dompurify.default.sanitize(sanitizeMore(text2, config6), config6.dompurifyConfig).toString(); + } else { + text2 = import_dompurify.default.sanitize(sanitizeMore(text2, config6), { + FORBID_TAGS: ["style"] + }).toString(); + } + return text2; + }, "sanitizeText"); + sanitizeTextOrArray = /* @__PURE__ */ __name((a2, config6) => { + if (typeof a2 === "string") { + return sanitizeText(a2, config6); + } + return a2.flat().map((x5) => sanitizeText(x5, config6)); + }, "sanitizeTextOrArray"); + hasBreaks = /* @__PURE__ */ __name((text2) => { + return lineBreakRegex.test(text2); + }, "hasBreaks"); + splitBreaks = /* @__PURE__ */ __name((text2) => { + return text2.split(lineBreakRegex); + }, "splitBreaks"); + placeholderToBreak = /* @__PURE__ */ __name((s2) => { + return s2.replace(/#br#/g, "
"); + }, "placeholderToBreak"); + breakToPlaceholder = /* @__PURE__ */ __name((s2) => { + return s2.replace(lineBreakRegex, "#br#"); + }, "breakToPlaceholder"); + getUrl = /* @__PURE__ */ __name((useAbsolute) => { + let url = ""; + if (useAbsolute) { + url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; + url = url.replaceAll(/\(/g, "\\("); + url = url.replaceAll(/\)/g, "\\)"); + } + return url; + }, "getUrl"); + evaluate = /* @__PURE__ */ __name((val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true, "evaluate"); + getMax = /* @__PURE__ */ __name(function(...values2) { + const newValues = values2.filter((value2) => { + return !isNaN(value2); + }); + return Math.max(...newValues); + }, "getMax"); + getMin = /* @__PURE__ */ __name(function(...values2) { + const newValues = values2.filter((value2) => { + return !isNaN(value2); + }); + return Math.min(...newValues); + }, "getMin"); + parseGenericTypes = /* @__PURE__ */ __name(function(input) { + const inputSets = input.split(/(,)/); + const output2 = []; + for (let i2 = 0; i2 < inputSets.length; i2++) { + let thisSet = inputSets[i2]; + if (thisSet === "," && i2 > 0 && i2 + 1 < inputSets.length) { + const previousSet = inputSets[i2 - 1]; + const nextSet = inputSets[i2 + 1]; + if (shouldCombineSets(previousSet, nextSet)) { + thisSet = previousSet + "," + nextSet; + i2++; + output2.pop(); + } + } + output2.push(processSet(thisSet)); + } + return output2.join(""); + }, "parseGenericTypes"); + countOccurrence = /* @__PURE__ */ __name((string3, substring) => { + return Math.max(0, string3.split(substring).length - 1); + }, "countOccurrence"); + shouldCombineSets = /* @__PURE__ */ __name((previousSet, nextSet) => { + const prevCount = countOccurrence(previousSet, "~"); + const nextCount = countOccurrence(nextSet, "~"); + return prevCount === 1 && nextCount === 1; + }, "shouldCombineSets"); + processSet = /* @__PURE__ */ __name((input) => { + const tildeCount = countOccurrence(input, "~"); + let hasStartingTilde = false; + if (tildeCount <= 1) { + return input; + } + if (tildeCount % 2 !== 0 && input.startsWith("~")) { + input = input.substring(1); + hasStartingTilde = true; + } + const chars = [...input]; + let first3 = chars.indexOf("~"); + let last3 = chars.lastIndexOf("~"); + while (first3 !== -1 && last3 !== -1 && first3 !== last3) { + chars[first3] = "<"; + chars[last3] = ">"; + first3 = chars.indexOf("~"); + last3 = chars.lastIndexOf("~"); + } + if (hasStartingTilde) { + chars.unshift("~"); + } + return chars.join(""); + }, "processSet"); + isMathMLSupported = /* @__PURE__ */ __name(() => window.MathMLElement !== void 0, "isMathMLSupported"); + katexRegex = /\$\$(.*)\$\$/g; + hasKatex = /* @__PURE__ */ __name((text2) => (text2.match(katexRegex)?.length ?? 0) > 0, "hasKatex"); + calculateMathMLDimensions = /* @__PURE__ */ __name(async (text2, config6) => { + text2 = await renderKatex(text2, config6); + const divElem = document.createElement("div"); + divElem.innerHTML = text2; + divElem.id = "katex-temp"; + divElem.style.visibility = "hidden"; + divElem.style.position = "absolute"; + divElem.style.top = "0"; + const body = document.querySelector("body"); + body?.insertAdjacentElement("beforeend", divElem); + const dim = { width: divElem.clientWidth, height: divElem.clientHeight }; + divElem.remove(); + return dim; + }, "calculateMathMLDimensions"); + renderKatex = /* @__PURE__ */ __name(async (text2, config6) => { + if (!hasKatex(text2)) { + return text2; + } + if (!(isMathMLSupported() || config6.legacyMathML || config6.forceLegacyMathML)) { + return text2.replace(katexRegex, "MathML is unsupported in this environment."); + } + const { default: katex2 } = await Promise.resolve().then(() => (init_katex(), katex_exports)); + const outputMode = config6.forceLegacyMathML || !isMathMLSupported() && config6.legacyMathML ? "htmlAndMathml" : "mathml"; + return text2.split(lineBreakRegex).map( + (line2) => hasKatex(line2) ? `
${line2}
` : `
${line2}
` + ).join("").replace( + katexRegex, + (_2, c3) => katex2.renderToString(c3, { + throwOnError: true, + displayMode: true, + output: outputMode + }).replace(/\n/g, " ").replace(//g, "") + ); + }, "renderKatex"); + common_default = { + getRows, + sanitizeText, + sanitizeTextOrArray, + hasBreaks, + splitBreaks, + lineBreakRegex, + removeScript, + getUrl, + evaluate, + getMax, + getMin + }; } - return attrs; - }; - const configureSvgSize = function(svgElem, height, width2, useMaxWidth) { - const attrs = calculateSvgSizeAttrs(height, width2, useMaxWidth); - d3Attrs(svgElem, attrs); - }; - const setupGraphViewbox$1 = function(graph, svgElem, padding2, useMaxWidth) { - const svgBounds = svgElem.node().getBBox(); - const sWidth = svgBounds.width; - const sHeight = svgBounds.height; - log$1.info(`SVG bounds: ${sWidth}x${sHeight}`, svgBounds); - let width2 = 0; - let height = 0; - log$1.info(`Graph bounds: ${width2}x${height}`, graph); - width2 = sWidth + padding2 * 2; - height = sHeight + padding2 * 2; - log$1.info(`Calculated bounds: ${width2}x${height}`); - configureSvgSize(svgElem, height, width2, useMaxWidth); - const vBox = `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${svgBounds.width + 2 * padding2} ${svgBounds.height + 2 * padding2}`; - svgElem.attr("viewBox", vBox); - }; - const themes = {}; - const getStyles$f = (type2, userStyles, options2) => { - let diagramStyles = ""; - if (type2 in themes && themes[type2]) { - diagramStyles = themes[type2](options2); - } else { - log$1.warn(`No theme found for ${type2}`); + }); + + // src/setupGraphViewbox.js + var d3Attrs, calculateSvgSizeAttrs, configureSvgSize, setupGraphViewbox; + var init_setupGraphViewbox = __esm({ + "src/setupGraphViewbox.js"() { + "use strict"; + init_logger(); + d3Attrs = /* @__PURE__ */ __name(function(d3Elem, attrs) { + for (let attr of attrs) { + d3Elem.attr(attr[0], attr[1]); + } + }, "d3Attrs"); + calculateSvgSizeAttrs = /* @__PURE__ */ __name(function(height2, width3, useMaxWidth) { + let attrs = /* @__PURE__ */ new Map(); + if (useMaxWidth) { + attrs.set("width", "100%"); + attrs.set("style", `max-width: ${width3}px;`); + } else { + attrs.set("height", height2); + attrs.set("width", width3); + } + return attrs; + }, "calculateSvgSizeAttrs"); + configureSvgSize = /* @__PURE__ */ __name(function(svgElem, height2, width3, useMaxWidth) { + const attrs = calculateSvgSizeAttrs(height2, width3, useMaxWidth); + d3Attrs(svgElem, attrs); + }, "configureSvgSize"); + setupGraphViewbox = /* @__PURE__ */ __name(function(graph, svgElem, padding3, useMaxWidth) { + const svgBounds = svgElem.node().getBBox(); + const sWidth = svgBounds.width; + const sHeight = svgBounds.height; + log.info(`SVG bounds: ${sWidth}x${sHeight}`, svgBounds); + let width3 = 0; + let height2 = 0; + log.info(`Graph bounds: ${width3}x${height2}`, graph); + width3 = sWidth + padding3 * 2; + height2 = sHeight + padding3 * 2; + log.info(`Calculated bounds: ${width3}x${height2}`); + configureSvgSize(svgElem, height2, width3, useMaxWidth); + const vBox = `${svgBounds.x - padding3} ${svgBounds.y - padding3} ${svgBounds.width + 2 * padding3} ${svgBounds.height + 2 * padding3}`; + svgElem.attr("viewBox", vBox); + }, "setupGraphViewbox"); } - return ` & { - font-family: ${options2.fontFamily}; - font-size: ${options2.fontSize}; - fill: ${options2.textColor} + }); + + // src/styles.ts + var themes, getStyles, addStylesForDiagram, styles_default; + var init_styles = __esm({ + "src/styles.ts"() { + "use strict"; + init_logger(); + themes = {}; + getStyles = /* @__PURE__ */ __name((type3, userStyles, options3) => { + let diagramStyles = ""; + if (type3 in themes && themes[type3]) { + diagramStyles = themes[type3](options3); + } else { + log.warn(`No theme found for ${type3}`); + } + return ` & { + font-family: ${options3.fontFamily}; + font-size: ${options3.fontSize}; + fill: ${options3.textColor} } /* Classes common for multiple diagrams */ & .error-icon { - fill: ${options2.errorBkgColor}; + fill: ${options3.errorBkgColor}; } & .error-text { - fill: ${options2.errorTextColor}; - stroke: ${options2.errorTextColor}; + fill: ${options3.errorTextColor}; + stroke: ${options3.errorTextColor}; } & .edge-thickness-normal { - stroke-width: 2px; + stroke-width: 1px; } & .edge-thickness-thick { stroke-width: 3.5px @@ -11909,7 +20772,10 @@ & .edge-pattern-solid { stroke-dasharray: 0; } - + & .edge-thickness-invisible { + stroke-width: 0; + fill: none; + } & .edge-pattern-dashed{ stroke-dasharray: 3; } @@ -11918,163675 +20784,87710 @@ } & .marker { - fill: ${options2.lineColor}; - stroke: ${options2.lineColor}; + fill: ${options3.lineColor}; + stroke: ${options3.lineColor}; } & .marker.cross { - stroke: ${options2.lineColor}; + stroke: ${options3.lineColor}; } & svg { - font-family: ${options2.fontFamily}; - font-size: ${options2.fontSize}; + font-family: ${options3.fontFamily}; + font-size: ${options3.fontSize}; } + & p { + margin: 0 + } ${diagramStyles} ${userStyles} `; - }; - const addStylesForDiagram = (type2, diagramTheme) => { - if (diagramTheme !== void 0) { - themes[type2] = diagramTheme; - } - }; - const getStyles$g = getStyles$f; - let accTitle = ""; - let diagramTitle = ""; - let accDescription = ""; - const sanitizeText$5 = (txt) => sanitizeText$6(txt, getConfig$2()); - const clear$n = () => { - accTitle = ""; - accDescription = ""; - diagramTitle = ""; - }; - const setAccTitle = (txt) => { - accTitle = sanitizeText$5(txt).replace(/^\s+/g, ""); - }; - const getAccTitle = () => accTitle; - const setAccDescription = (txt) => { - accDescription = sanitizeText$5(txt).replace(/\n\s+/g, "\n"); - }; - const getAccDescription = () => accDescription; - const setDiagramTitle = (txt) => { - diagramTitle = sanitizeText$5(txt); - }; - const getDiagramTitle = () => diagramTitle; - const commonDb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - clear: clear$n, - getAccDescription, - getAccTitle, - getDiagramTitle, - setAccDescription, - setAccTitle, - setDiagramTitle - }, Symbol.toStringTag, { value: "Module" })); - const log = log$1; - const setLogLevel = setLogLevel$1; - const getConfig$1 = getConfig$2; - const setConfig = setConfig$1; - const defaultConfig = defaultConfig$1; - const sanitizeText$4 = (text2) => sanitizeText$6(text2, getConfig$1()); - const setupGraphViewbox = setupGraphViewbox$1; - const getCommonDb$1 = () => { - return commonDb; - }; - const diagrams = {}; - const registerDiagram = (id2, diagram2, detector2) => { - var _a2; - if (diagrams[id2]) { - throw new Error(`Diagram ${id2} already registered.`); - } - diagrams[id2] = diagram2; - if (detector2) { - addDetector(id2, detector2); - } - addStylesForDiagram(id2, diagram2.styles); - (_a2 = diagram2.injectUtils) == null ? void 0 : _a2.call( - diagram2, - log, - setLogLevel, - getConfig$1, - sanitizeText$4, - setupGraphViewbox, - getCommonDb$1(), - () => { - } - ); - }; - const getDiagram = (name) => { - if (name in diagrams) { - return diagrams[name]; + }, "getStyles"); + addStylesForDiagram = /* @__PURE__ */ __name((type3, diagramTheme) => { + if (diagramTheme !== void 0) { + themes[type3] = diagramTheme; + } + }, "addStylesForDiagram"); + styles_default = getStyles; } - throw new DiagramNotFoundError(name); - }; - class DiagramNotFoundError extends Error { - constructor(name) { - super(`Diagram ${name} not found.`); - } - } - const selectSvgElement = (id2) => { - var _a2; - const { securityLevel } = getConfig$1(); - let root2 = d3select("body"); - if (securityLevel === "sandbox") { - const sandboxElement = d3select(`#i${id2}`); - const doc = ((_a2 = sandboxElement.node()) == null ? void 0 : _a2.contentDocument) ?? document; - root2 = d3select(doc.body); - } - const svg2 = root2.select(`#${id2}`); - return svg2; - }; - const draw$m = (_text, id2, version2) => { - log$1.debug("rendering svg for syntax error\n"); - const svg2 = selectSvgElement(id2); - const g = svg2.append("g"); - svg2.attr("viewBox", "0 0 2412 512"); - configureSvgSize(svg2, 100, 512, true); - g.append("path").attr("class", "error-icon").attr( - "d", - "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z" - ); - g.append("path").attr("class", "error-icon").attr( - "d", - "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z" - ); - g.append("path").attr("class", "error-icon").attr( - "d", - "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z" - ); - g.append("path").attr("class", "error-icon").attr( - "d", - "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z" - ); - g.append("path").attr("class", "error-icon").attr( - "d", - "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z" - ); - g.append("path").attr("class", "error-icon").attr( - "d", - "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z" - ); - g.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text"); - g.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${version2}`); - }; - const renderer$h = { draw: draw$m }; - const errorRenderer = renderer$h; - const diagram$m = { - db: {}, - renderer: renderer$h, - parser: { - parser: { yy: {} }, - parse: () => { - return; - } + }); + + // src/diagrams/common/commonDb.ts + var commonDb_exports = {}; + __export(commonDb_exports, { + clear: () => clear, + getAccDescription: () => getAccDescription, + getAccTitle: () => getAccTitle, + getDiagramTitle: () => getDiagramTitle, + setAccDescription: () => setAccDescription, + setAccTitle: () => setAccTitle, + setDiagramTitle: () => setDiagramTitle + }); + var accTitle, diagramTitle, accDescription, sanitizeText2, clear, setAccTitle, getAccTitle, setAccDescription, getAccDescription, setDiagramTitle, getDiagramTitle; + var init_commonDb = __esm({ + "src/diagrams/common/commonDb.ts"() { + "use strict"; + init_common(); + init_config(); + accTitle = ""; + diagramTitle = ""; + accDescription = ""; + sanitizeText2 = /* @__PURE__ */ __name((txt) => sanitizeText(txt, getConfig()), "sanitizeText"); + clear = /* @__PURE__ */ __name(() => { + accTitle = ""; + accDescription = ""; + diagramTitle = ""; + }, "clear"); + setAccTitle = /* @__PURE__ */ __name((txt) => { + accTitle = sanitizeText2(txt).replace(/^\s+/g, ""); + }, "setAccTitle"); + getAccTitle = /* @__PURE__ */ __name(() => accTitle, "getAccTitle"); + setAccDescription = /* @__PURE__ */ __name((txt) => { + accDescription = sanitizeText2(txt).replace(/\n\s+/g, "\n"); + }, "setAccDescription"); + getAccDescription = /* @__PURE__ */ __name(() => accDescription, "getAccDescription"); + setDiagramTitle = /* @__PURE__ */ __name((txt) => { + diagramTitle = sanitizeText2(txt); + }, "setDiagramTitle"); + getDiagramTitle = /* @__PURE__ */ __name(() => diagramTitle, "getDiagramTitle"); } - }; - const errorDiagram = diagram$m; - const id$4 = "flowchart-elk"; - const detector$4 = (txt, config2) => { - var _a2; - if ( - // If diagram explicitly states flowchart-elk - /^\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk - /^\s*flowchart|graph/.test(txt) && ((_a2 = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a2.defaultRenderer) === "elk" - ) { - return true; - } - return false; - }; - const loader$5 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => flowchartElkDefinition); - return { id: id$4, diagram: diagram2 }; - }; - const plugin$4 = { - id: id$4, - detector: detector$4, - loader: loader$5 - }; - const flowchartElk = plugin$4; - const id$3 = "timeline"; - const detector$3 = (txt) => { - return /^\s*timeline/.test(txt); - }; - const loader$4 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => timelineDefinition); - return { id: id$3, diagram: diagram2 }; - }; - const plugin$3 = { - id: id$3, - detector: detector$3, - loader: loader$4 - }; - const timeline = plugin$3; - const id$2 = "mindmap"; - const detector$2 = (txt) => { - return /^\s*mindmap/.test(txt); - }; - const loader$3 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => mindmapDefinition); - return { id: id$2, diagram: diagram2 }; - }; - const plugin$2 = { - id: id$2, - detector: detector$2, - loader: loader$3 - }; - const mindmap = plugin$2; - const id$1 = "sankey"; - const detector$1 = (txt) => { - return /^\s*sankey-beta/.test(txt); - }; - const loader$2 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => sankeyDiagram); - return { id: id$1, diagram: diagram2 }; - }; - const plugin$1 = { - id: id$1, - detector: detector$1, - loader: loader$2 - }; - const sankey = plugin$1; - const id = "block"; - const detector = (txt) => { - return /^\s*block-beta/.test(txt); - }; - const loader$1 = async () => { - const { diagram: diagram2 } = await Promise.resolve().then(() => blockDiagram); - return { id, diagram: diagram2 }; - }; - const plugin = { - id, - detector, - loader: loader$1 - }; - const block = plugin; - let hasLoadedDiagrams = false; - const addDiagrams = () => { - if (hasLoadedDiagrams) { - return; + }); + + // src/diagram-api/diagramAPI.ts + var log2, setLogLevel2, getConfig2, setConfig2, defaultConfig2, sanitizeText3, setupGraphViewbox2, getCommonDb, diagrams, registerDiagram, getDiagram, DiagramNotFoundError; + var init_diagramAPI = __esm({ + "src/diagram-api/diagramAPI.ts"() { + "use strict"; + init_detectType(); + init_logger(); + init_config(); + init_common(); + init_setupGraphViewbox(); + init_styles(); + init_commonDb(); + log2 = log; + setLogLevel2 = setLogLevel; + getConfig2 = getConfig; + setConfig2 = setConfig; + defaultConfig2 = defaultConfig; + sanitizeText3 = /* @__PURE__ */ __name((text2) => sanitizeText(text2, getConfig2()), "sanitizeText"); + setupGraphViewbox2 = setupGraphViewbox; + getCommonDb = /* @__PURE__ */ __name(() => { + return commonDb_exports; + }, "getCommonDb"); + diagrams = {}; + registerDiagram = /* @__PURE__ */ __name((id26, diagram23, detector24) => { + if (diagrams[id26]) { + log2.warn(`Diagram with id ${id26} already registered. Overwriting.`); + } + diagrams[id26] = diagram23; + if (detector24) { + addDetector(id26, detector24); + } + addStylesForDiagram(id26, diagram23.styles); + diagram23.injectUtils?.( + log2, + setLogLevel2, + getConfig2, + sanitizeText3, + setupGraphViewbox2, + getCommonDb(), + () => { + } + ); + }, "registerDiagram"); + getDiagram = /* @__PURE__ */ __name((name) => { + if (name in diagrams) { + return diagrams[name]; + } + throw new DiagramNotFoundError(name); + }, "getDiagram"); + DiagramNotFoundError = class extends Error { + static { + __name(this, "DiagramNotFoundError"); + } + constructor(name) { + super(`Diagram ${name} not found.`); + } + }; } - hasLoadedDiagrams = true; - registerDiagram("error", errorDiagram, (text2) => { - return text2.toLowerCase().trim() === "error"; - }); - registerDiagram( - "---", - // --- diagram type may appear if YAML front-matter is not parsed correctly - { - db: { - clear: () => { + }); + + // src/diagrams/c4/c4Db.js + var c4ShapeArray, boundaryParseStack, currentBoundaryParse, parentBoundaryParse, boundaries, rels, title, wrapEnabled, c4ShapeInRow, c4BoundaryInRow, c4Type, getC4Type, setC4Type, addRel, addPersonOrSystem, addContainer, addComponent, addPersonOrSystemBoundary, addContainerBoundary, addDeploymentNode, popBoundaryParseStack, updateElStyle, updateRelStyle, updateLayoutConfig, getC4ShapeInRow, getC4BoundaryInRow, getCurrentBoundaryParse, getParentBoundaryParse, getC4ShapeArray, getC4Shape, getC4ShapeKeys, getBoundaries, getBoundarys, getRels, getTitle, setWrap, autoWrap, clear2, LINETYPE, ARROWTYPE, PLACEMENT, setTitle, c4Db_default; + var init_c4Db = __esm({ + "src/diagrams/c4/c4Db.js"() { + "use strict"; + init_diagramAPI(); + init_common(); + init_commonDb(); + c4ShapeArray = []; + boundaryParseStack = [""]; + currentBoundaryParse = "global"; + parentBoundaryParse = ""; + boundaries = [ + { + alias: "global", + label: { text: "global" }, + type: { text: "global" }, + tags: null, + link: null, + parentBoundary: "" + } + ]; + rels = []; + title = ""; + wrapEnabled = false; + c4ShapeInRow = 4; + c4BoundaryInRow = 2; + getC4Type = /* @__PURE__ */ __name(function() { + return c4Type; + }, "getC4Type"); + setC4Type = /* @__PURE__ */ __name(function(c4TypeParam) { + let sanitizedText = sanitizeText(c4TypeParam, getConfig2()); + c4Type = sanitizedText; + }, "setC4Type"); + addRel = /* @__PURE__ */ __name(function(type3, from2, to, label, techn, descr, sprite, tags2, link3) { + if (type3 === void 0 || type3 === null || from2 === void 0 || from2 === null || to === void 0 || to === null || label === void 0 || label === null) { + return; + } + let rel2 = {}; + const old = rels.find((rel3) => rel3.from === from2 && rel3.to === to); + if (old) { + rel2 = old; + } else { + rels.push(rel2); + } + rel2.type = type3; + rel2.from = from2; + rel2.to = to; + rel2.label = { text: label }; + if (techn === void 0 || techn === null) { + rel2.techn = { text: "" }; + } else { + if (typeof techn === "object") { + let [key, value2] = Object.entries(techn)[0]; + rel2[key] = { text: value2 }; + } else { + rel2.techn = { text: techn }; } - }, - styles: {}, - // should never be used - renderer: { - draw: () => { + } + if (descr === void 0 || descr === null) { + rel2.descr = { text: "" }; + } else { + if (typeof descr === "object") { + let [key, value2] = Object.entries(descr)[0]; + rel2[key] = { text: value2 }; + } else { + rel2.descr = { text: descr }; } - }, - parser: { - parser: { yy: {} }, - parse: () => { - throw new Error( - "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks" - ); + } + if (typeof sprite === "object") { + let [key, value2] = Object.entries(sprite)[0]; + rel2[key] = value2; + } else { + rel2.sprite = sprite; + } + if (typeof tags2 === "object") { + let [key, value2] = Object.entries(tags2)[0]; + rel2[key] = value2; + } else { + rel2.tags = tags2; + } + if (typeof link3 === "object") { + let [key, value2] = Object.entries(link3)[0]; + rel2[key] = value2; + } else { + rel2.link = link3; + } + rel2.wrap = autoWrap(); + }, "addRel"); + addPersonOrSystem = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, descr, sprite, tags2, link3) { + if (alias === null || label === null) { + return; + } + let personOrSystem = {}; + const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias); + if (old && alias === old.alias) { + personOrSystem = old; + } else { + personOrSystem.alias = alias; + c4ShapeArray.push(personOrSystem); + } + if (label === void 0 || label === null) { + personOrSystem.label = { text: "" }; + } else { + personOrSystem.label = { text: label }; + } + if (descr === void 0 || descr === null) { + personOrSystem.descr = { text: "" }; + } else { + if (typeof descr === "object") { + let [key, value2] = Object.entries(descr)[0]; + personOrSystem[key] = { text: value2 }; + } else { + personOrSystem.descr = { text: descr }; } - }, - init: () => null - // no op - }, - (text2) => { - return text2.toLowerCase().trimStart().startsWith("---"); + } + if (typeof sprite === "object") { + let [key, value2] = Object.entries(sprite)[0]; + personOrSystem[key] = value2; + } else { + personOrSystem.sprite = sprite; + } + if (typeof tags2 === "object") { + let [key, value2] = Object.entries(tags2)[0]; + personOrSystem[key] = value2; + } else { + personOrSystem.tags = tags2; + } + if (typeof link3 === "object") { + let [key, value2] = Object.entries(link3)[0]; + personOrSystem[key] = value2; + } else { + personOrSystem.link = link3; + } + personOrSystem.typeC4Shape = { text: typeC4Shape }; + personOrSystem.parentBoundary = currentBoundaryParse; + personOrSystem.wrap = autoWrap(); + }, "addPersonOrSystem"); + addContainer = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link3) { + if (alias === null || label === null) { + return; + } + let container2 = {}; + const old = c4ShapeArray.find((container3) => container3.alias === alias); + if (old && alias === old.alias) { + container2 = old; + } else { + container2.alias = alias; + c4ShapeArray.push(container2); + } + if (label === void 0 || label === null) { + container2.label = { text: "" }; + } else { + container2.label = { text: label }; + } + if (techn === void 0 || techn === null) { + container2.techn = { text: "" }; + } else { + if (typeof techn === "object") { + let [key, value2] = Object.entries(techn)[0]; + container2[key] = { text: value2 }; + } else { + container2.techn = { text: techn }; + } + } + if (descr === void 0 || descr === null) { + container2.descr = { text: "" }; + } else { + if (typeof descr === "object") { + let [key, value2] = Object.entries(descr)[0]; + container2[key] = { text: value2 }; + } else { + container2.descr = { text: descr }; + } + } + if (typeof sprite === "object") { + let [key, value2] = Object.entries(sprite)[0]; + container2[key] = value2; + } else { + container2.sprite = sprite; + } + if (typeof tags2 === "object") { + let [key, value2] = Object.entries(tags2)[0]; + container2[key] = value2; + } else { + container2.tags = tags2; + } + if (typeof link3 === "object") { + let [key, value2] = Object.entries(link3)[0]; + container2[key] = value2; + } else { + container2.link = link3; + } + container2.wrap = autoWrap(); + container2.typeC4Shape = { text: typeC4Shape }; + container2.parentBoundary = currentBoundaryParse; + }, "addContainer"); + addComponent = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link3) { + if (alias === null || label === null) { + return; + } + let component2 = {}; + const old = c4ShapeArray.find((component3) => component3.alias === alias); + if (old && alias === old.alias) { + component2 = old; + } else { + component2.alias = alias; + c4ShapeArray.push(component2); + } + if (label === void 0 || label === null) { + component2.label = { text: "" }; + } else { + component2.label = { text: label }; + } + if (techn === void 0 || techn === null) { + component2.techn = { text: "" }; + } else { + if (typeof techn === "object") { + let [key, value2] = Object.entries(techn)[0]; + component2[key] = { text: value2 }; + } else { + component2.techn = { text: techn }; + } + } + if (descr === void 0 || descr === null) { + component2.descr = { text: "" }; + } else { + if (typeof descr === "object") { + let [key, value2] = Object.entries(descr)[0]; + component2[key] = { text: value2 }; + } else { + component2.descr = { text: descr }; + } + } + if (typeof sprite === "object") { + let [key, value2] = Object.entries(sprite)[0]; + component2[key] = value2; + } else { + component2.sprite = sprite; + } + if (typeof tags2 === "object") { + let [key, value2] = Object.entries(tags2)[0]; + component2[key] = value2; + } else { + component2.tags = tags2; + } + if (typeof link3 === "object") { + let [key, value2] = Object.entries(link3)[0]; + component2[key] = value2; + } else { + component2.link = link3; + } + component2.wrap = autoWrap(); + component2.typeC4Shape = { text: typeC4Shape }; + component2.parentBoundary = currentBoundaryParse; + }, "addComponent"); + addPersonOrSystemBoundary = /* @__PURE__ */ __name(function(alias, label, type3, tags2, link3) { + if (alias === null || label === null) { + return; + } + let boundary = {}; + const old = boundaries.find((boundary2) => boundary2.alias === alias); + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundaries.push(boundary); + } + if (label === void 0 || label === null) { + boundary.label = { text: "" }; + } else { + boundary.label = { text: label }; + } + if (type3 === void 0 || type3 === null) { + boundary.type = { text: "system" }; + } else { + if (typeof type3 === "object") { + let [key, value2] = Object.entries(type3)[0]; + boundary[key] = { text: value2 }; + } else { + boundary.type = { text: type3 }; + } + } + if (typeof tags2 === "object") { + let [key, value2] = Object.entries(tags2)[0]; + boundary[key] = value2; + } else { + boundary.tags = tags2; + } + if (typeof link3 === "object") { + let [key, value2] = Object.entries(link3)[0]; + boundary[key] = value2; + } else { + boundary.link = link3; + } + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); + }, "addPersonOrSystemBoundary"); + addContainerBoundary = /* @__PURE__ */ __name(function(alias, label, type3, tags2, link3) { + if (alias === null || label === null) { + return; + } + let boundary = {}; + const old = boundaries.find((boundary2) => boundary2.alias === alias); + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundaries.push(boundary); + } + if (label === void 0 || label === null) { + boundary.label = { text: "" }; + } else { + boundary.label = { text: label }; + } + if (type3 === void 0 || type3 === null) { + boundary.type = { text: "container" }; + } else { + if (typeof type3 === "object") { + let [key, value2] = Object.entries(type3)[0]; + boundary[key] = { text: value2 }; + } else { + boundary.type = { text: type3 }; + } + } + if (typeof tags2 === "object") { + let [key, value2] = Object.entries(tags2)[0]; + boundary[key] = value2; + } else { + boundary.tags = tags2; + } + if (typeof link3 === "object") { + let [key, value2] = Object.entries(link3)[0]; + boundary[key] = value2; + } else { + boundary.link = link3; + } + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); + }, "addContainerBoundary"); + addDeploymentNode = /* @__PURE__ */ __name(function(nodeType2, alias, label, type3, descr, sprite, tags2, link3) { + if (alias === null || label === null) { + return; + } + let boundary = {}; + const old = boundaries.find((boundary2) => boundary2.alias === alias); + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundaries.push(boundary); + } + if (label === void 0 || label === null) { + boundary.label = { text: "" }; + } else { + boundary.label = { text: label }; + } + if (type3 === void 0 || type3 === null) { + boundary.type = { text: "node" }; + } else { + if (typeof type3 === "object") { + let [key, value2] = Object.entries(type3)[0]; + boundary[key] = { text: value2 }; + } else { + boundary.type = { text: type3 }; + } + } + if (descr === void 0 || descr === null) { + boundary.descr = { text: "" }; + } else { + if (typeof descr === "object") { + let [key, value2] = Object.entries(descr)[0]; + boundary[key] = { text: value2 }; + } else { + boundary.descr = { text: descr }; + } + } + if (typeof tags2 === "object") { + let [key, value2] = Object.entries(tags2)[0]; + boundary[key] = value2; + } else { + boundary.tags = tags2; + } + if (typeof link3 === "object") { + let [key, value2] = Object.entries(link3)[0]; + boundary[key] = value2; + } else { + boundary.link = link3; + } + boundary.nodeType = nodeType2; + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); + }, "addDeploymentNode"); + popBoundaryParseStack = /* @__PURE__ */ __name(function() { + currentBoundaryParse = parentBoundaryParse; + boundaryParseStack.pop(); + parentBoundaryParse = boundaryParseStack.pop(); + boundaryParseStack.push(parentBoundaryParse); + }, "popBoundaryParseStack"); + updateElStyle = /* @__PURE__ */ __name(function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) { + let old = c4ShapeArray.find((element3) => element3.alias === elementName); + if (old === void 0) { + old = boundaries.find((element3) => element3.alias === elementName); + if (old === void 0) { + return; + } + } + if (bgColor !== void 0 && bgColor !== null) { + if (typeof bgColor === "object") { + let [key, value2] = Object.entries(bgColor)[0]; + old[key] = value2; + } else { + old.bgColor = bgColor; + } + } + if (fontColor !== void 0 && fontColor !== null) { + if (typeof fontColor === "object") { + let [key, value2] = Object.entries(fontColor)[0]; + old[key] = value2; + } else { + old.fontColor = fontColor; + } + } + if (borderColor !== void 0 && borderColor !== null) { + if (typeof borderColor === "object") { + let [key, value2] = Object.entries(borderColor)[0]; + old[key] = value2; + } else { + old.borderColor = borderColor; + } + } + if (shadowing !== void 0 && shadowing !== null) { + if (typeof shadowing === "object") { + let [key, value2] = Object.entries(shadowing)[0]; + old[key] = value2; + } else { + old.shadowing = shadowing; + } + } + if (shape !== void 0 && shape !== null) { + if (typeof shape === "object") { + let [key, value2] = Object.entries(shape)[0]; + old[key] = value2; + } else { + old.shape = shape; + } + } + if (sprite !== void 0 && sprite !== null) { + if (typeof sprite === "object") { + let [key, value2] = Object.entries(sprite)[0]; + old[key] = value2; + } else { + old.sprite = sprite; + } + } + if (techn !== void 0 && techn !== null) { + if (typeof techn === "object") { + let [key, value2] = Object.entries(techn)[0]; + old[key] = value2; + } else { + old.techn = techn; + } + } + if (legendText !== void 0 && legendText !== null) { + if (typeof legendText === "object") { + let [key, value2] = Object.entries(legendText)[0]; + old[key] = value2; + } else { + old.legendText = legendText; + } + } + if (legendSprite !== void 0 && legendSprite !== null) { + if (typeof legendSprite === "object") { + let [key, value2] = Object.entries(legendSprite)[0]; + old[key] = value2; + } else { + old.legendSprite = legendSprite; + } + } + }, "updateElStyle"); + updateRelStyle = /* @__PURE__ */ __name(function(typeC4Shape, from2, to, textColor, lineColor, offsetX, offsetY) { + const old = rels.find((rel2) => rel2.from === from2 && rel2.to === to); + if (old === void 0) { + return; + } + if (textColor !== void 0 && textColor !== null) { + if (typeof textColor === "object") { + let [key, value2] = Object.entries(textColor)[0]; + old[key] = value2; + } else { + old.textColor = textColor; + } + } + if (lineColor !== void 0 && lineColor !== null) { + if (typeof lineColor === "object") { + let [key, value2] = Object.entries(lineColor)[0]; + old[key] = value2; + } else { + old.lineColor = lineColor; + } + } + if (offsetX !== void 0 && offsetX !== null) { + if (typeof offsetX === "object") { + let [key, value2] = Object.entries(offsetX)[0]; + old[key] = parseInt(value2); + } else { + old.offsetX = parseInt(offsetX); + } + } + if (offsetY !== void 0 && offsetY !== null) { + if (typeof offsetY === "object") { + let [key, value2] = Object.entries(offsetY)[0]; + old[key] = parseInt(value2); + } else { + old.offsetY = parseInt(offsetY); + } + } + }, "updateRelStyle"); + updateLayoutConfig = /* @__PURE__ */ __name(function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) { + let c4ShapeInRowValue = c4ShapeInRow; + let c4BoundaryInRowValue = c4BoundaryInRow; + if (typeof c4ShapeInRowParam === "object") { + const value2 = Object.values(c4ShapeInRowParam)[0]; + c4ShapeInRowValue = parseInt(value2); + } else { + c4ShapeInRowValue = parseInt(c4ShapeInRowParam); + } + if (typeof c4BoundaryInRowParam === "object") { + const value2 = Object.values(c4BoundaryInRowParam)[0]; + c4BoundaryInRowValue = parseInt(value2); + } else { + c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); + } + if (c4ShapeInRowValue >= 1) { + c4ShapeInRow = c4ShapeInRowValue; + } + if (c4BoundaryInRowValue >= 1) { + c4BoundaryInRow = c4BoundaryInRowValue; + } + }, "updateLayoutConfig"); + getC4ShapeInRow = /* @__PURE__ */ __name(function() { + return c4ShapeInRow; + }, "getC4ShapeInRow"); + getC4BoundaryInRow = /* @__PURE__ */ __name(function() { + return c4BoundaryInRow; + }, "getC4BoundaryInRow"); + getCurrentBoundaryParse = /* @__PURE__ */ __name(function() { + return currentBoundaryParse; + }, "getCurrentBoundaryParse"); + getParentBoundaryParse = /* @__PURE__ */ __name(function() { + return parentBoundaryParse; + }, "getParentBoundaryParse"); + getC4ShapeArray = /* @__PURE__ */ __name(function(parentBoundary) { + if (parentBoundary === void 0 || parentBoundary === null) { + return c4ShapeArray; + } else { + return c4ShapeArray.filter((personOrSystem) => { + return personOrSystem.parentBoundary === parentBoundary; + }); + } + }, "getC4ShapeArray"); + getC4Shape = /* @__PURE__ */ __name(function(alias) { + return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias); + }, "getC4Shape"); + getC4ShapeKeys = /* @__PURE__ */ __name(function(parentBoundary) { + return Object.keys(getC4ShapeArray(parentBoundary)); + }, "getC4ShapeKeys"); + getBoundaries = /* @__PURE__ */ __name(function(parentBoundary) { + if (parentBoundary === void 0 || parentBoundary === null) { + return boundaries; + } else { + return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary); + } + }, "getBoundaries"); + getBoundarys = getBoundaries; + getRels = /* @__PURE__ */ __name(function() { + return rels; + }, "getRels"); + getTitle = /* @__PURE__ */ __name(function() { + return title; + }, "getTitle"); + setWrap = /* @__PURE__ */ __name(function(wrapSetting) { + wrapEnabled = wrapSetting; + }, "setWrap"); + autoWrap = /* @__PURE__ */ __name(function() { + return wrapEnabled; + }, "autoWrap"); + clear2 = /* @__PURE__ */ __name(function() { + c4ShapeArray = []; + boundaries = [ + { + alias: "global", + label: { text: "global" }, + type: { text: "global" }, + tags: null, + link: null, + parentBoundary: "" + } + ]; + parentBoundaryParse = ""; + currentBoundaryParse = "global"; + boundaryParseStack = [""]; + rels = []; + boundaryParseStack = [""]; + title = ""; + wrapEnabled = false; + c4ShapeInRow = 4; + c4BoundaryInRow = 2; + }, "clear"); + LINETYPE = { + SOLID: 0, + DOTTED: 1, + NOTE: 2, + SOLID_CROSS: 3, + DOTTED_CROSS: 4, + SOLID_OPEN: 5, + DOTTED_OPEN: 6, + LOOP_START: 10, + LOOP_END: 11, + ALT_START: 12, + ALT_ELSE: 13, + ALT_END: 14, + OPT_START: 15, + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18, + PAR_START: 19, + PAR_AND: 20, + PAR_END: 21, + RECT_START: 22, + RECT_END: 23, + SOLID_POINT: 24, + DOTTED_POINT: 25 + }; + ARROWTYPE = { + FILLED: 0, + OPEN: 1 + }; + PLACEMENT = { + LEFTOF: 0, + RIGHTOF: 1, + OVER: 2 + }; + setTitle = /* @__PURE__ */ __name(function(txt) { + let sanitizedText = sanitizeText(txt, getConfig2()); + title = sanitizedText; + }, "setTitle"); + c4Db_default = { + addPersonOrSystem, + addPersonOrSystemBoundary, + addContainer, + addContainerBoundary, + addComponent, + addDeploymentNode, + popBoundaryParseStack, + addRel, + updateElStyle, + updateRelStyle, + updateLayoutConfig, + autoWrap, + setWrap, + getC4ShapeArray, + getC4Shape, + getC4ShapeKeys, + getBoundaries, + getBoundarys, + getCurrentBoundaryParse, + getParentBoundaryParse, + getRels, + getTitle, + getC4Type, + getC4ShapeInRow, + getC4BoundaryInRow, + setAccTitle, + getAccTitle, + getAccDescription, + setAccDescription, + getConfig: /* @__PURE__ */ __name(() => getConfig2().c4, "getConfig"), + clear: clear2, + LINETYPE, + ARROWTYPE, + PLACEMENT, + setTitle, + setC4Type + // apply, + }; + } + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js + function ascending(a2, b2) { + return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN; + } + var init_ascending = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js"() { + "use strict"; + __name(ascending, "ascending"); + } + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js + function descending(a2, b2) { + return a2 == null || b2 == null ? NaN : b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN; + } + var init_descending = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js"() { + "use strict"; + __name(descending, "descending"); + } + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js + function bisector(f3) { + let compare1, compare2, delta; + if (f3.length !== 2) { + compare1 = ascending; + compare2 = /* @__PURE__ */ __name((d2, x5) => ascending(f3(d2), x5), "compare2"); + delta = /* @__PURE__ */ __name((d2, x5) => f3(d2) - x5, "delta"); + } else { + compare1 = f3 === ascending || f3 === descending ? f3 : zero; + compare2 = f3; + delta = f3; + } + function left3(a2, x5, lo = 0, hi = a2.length) { + if (lo < hi) { + if (compare1(x5, x5) !== 0) return hi; + do { + const mid = lo + hi >>> 1; + if (compare2(a2[mid], x5) < 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); } - ); - registerLazyLoadedDiagrams( - c4, - classDiagramV2$1, - classDiagram$1, - er, - gantt, - info$1, - pie, - requirement, - sequence, - flowchartElk, - flowchartV2, - flowchart, - mindmap, - timeline, - git, - stateV2, - state$1, - journey, - quadrantChart, - sankey, - xychart, - block - ); - }; - class Diagram { - constructor(text2, metadata = {}) { - this.text = text2; - this.metadata = metadata; - this.type = "graph"; - this.text = encodeEntities(text2); - this.text += "\n"; - const cnf = getConfig$2(); - try { - this.type = detectType(text2, cnf); - } catch (e) { - this.type = "error"; - this.detectError = e; - } - const diagram2 = getDiagram(this.type); - log$1.debug("Type " + this.type); - this.db = diagram2.db; - this.renderer = diagram2.renderer; - this.parser = diagram2.parser; - this.parser.parser.yy = this.db; - this.init = diagram2.init; - this.parse(); - } - parse() { - var _a2, _b2, _c, _d, _e; - if (this.detectError) { - throw this.detectError; - } - (_b2 = (_a2 = this.db).clear) == null ? void 0 : _b2.call(_a2); - const config2 = getConfig$2(); - (_c = this.init) == null ? void 0 : _c.call(this, config2); - if (this.metadata.title) { - (_e = (_d = this.db).setDiagramTitle) == null ? void 0 : _e.call(_d, this.metadata.title); - } - this.parser.parse(this.text); - } - async render(id2, version2) { - await this.renderer.draw(this.text, id2, version2, this); + return lo; } - getParser() { - return this.parser; + __name(left3, "left"); + function right3(a2, x5, lo = 0, hi = a2.length) { + if (lo < hi) { + if (compare1(x5, x5) !== 0) return hi; + do { + const mid = lo + hi >>> 1; + if (compare2(a2[mid], x5) <= 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); + } + return lo; } - getType() { - return this.type; + __name(right3, "right"); + function center4(a2, x5, lo = 0, hi = a2.length) { + const i2 = left3(a2, x5, lo, hi - 1); + return i2 > lo && delta(a2[i2 - 1], x5) > -delta(a2[i2], x5) ? i2 - 1 : i2; } + __name(center4, "center"); + return { left: left3, center: center4, right: right3 }; } - const getDiagramFromText$1 = async (text2, metadata = {}) => { - const type2 = detectType(text2, getConfig$2()); - try { - getDiagram(type2); - } catch (error) { - const loader2 = getDiagramLoader(type2); - if (!loader2) { - throw new UnknownDiagramError(`Diagram ${type2} not found.`); - } - const { id: id2, diagram: diagram2 } = await loader2(); - registerDiagram(id2, diagram2); + function zero() { + return 0; + } + var init_bisector = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js"() { + "use strict"; + init_ascending(); + init_descending(); + __name(bisector, "bisector"); + __name(zero, "zero"); } - return new Diagram(text2, metadata); - }; - let interactionFunctions = []; - const attachFunctions = () => { - interactionFunctions.forEach((f2) => { - f2(); - }); - interactionFunctions = []; - }; - var nativeKeys = overArg(Object.keys, Object); - const nativeKeys$1 = nativeKeys; - var objectProto$7 = Object.prototype; - var hasOwnProperty$7 = objectProto$7.hasOwnProperty; - function baseKeys(object2) { - if (!isPrototype(object2)) { - return nativeKeys$1(object2); + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/number.js + function number(x5) { + return x5 === null ? NaN : +x5; + } + var init_number = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/number.js"() { + "use strict"; + __name(number, "number"); } - var result = []; - for (var key in Object(object2)) { - if (hasOwnProperty$7.call(object2, key) && key != "constructor") { - result.push(key); - } + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisect.js + var ascendingBisect, bisectRight, bisectLeft, bisectCenter, bisect_default; + var init_bisect = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisect.js"() { + "use strict"; + init_ascending(); + init_bisector(); + init_number(); + ascendingBisect = bisector(ascending); + bisectRight = ascendingBisect.right; + bisectLeft = ascendingBisect.left; + bisectCenter = bisector(number).center; + bisect_default = bisectRight; } - return result; + }); + + // ../../node_modules/.pnpm/internmap@2.0.3/node_modules/internmap/src/index.js + function intern_get({ _intern, _key }, value2) { + const key = _key(value2); + return _intern.has(key) ? _intern.get(key) : value2; + } + function intern_set({ _intern, _key }, value2) { + const key = _key(value2); + if (_intern.has(key)) return _intern.get(key); + _intern.set(key, value2); + return value2; + } + function intern_delete({ _intern, _key }, value2) { + const key = _key(value2); + if (_intern.has(key)) { + value2 = _intern.get(key); + _intern.delete(key); + } + return value2; + } + function keyof(value2) { + return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2; } - var DataView$1 = getNative(root$1, "DataView"); - const DataView$2 = DataView$1; - var Promise$1 = getNative(root$1, "Promise"); - const Promise$2 = Promise$1; - var Set$1 = getNative(root$1, "Set"); - const Set$2 = Set$1; - var WeakMap = getNative(root$1, "WeakMap"); - const WeakMap$1 = WeakMap; - var mapTag$5 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$5 = "[object Set]", weakMapTag$1 = "[object WeakMap]"; - var dataViewTag$3 = "[object DataView]"; - var dataViewCtorString = toSource(DataView$2), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$2), weakMapCtorString = toSource(WeakMap$1); - var getTag = baseGetTag; - if (DataView$2 && getTag(new DataView$2(new ArrayBuffer(1))) != dataViewTag$3 || Map$2 && getTag(new Map$2()) != mapTag$5 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$2 && getTag(new Set$2()) != setTag$5 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) { - getTag = function(value2) { - var result = baseGetTag(value2), Ctor = result == objectTag$2 ? value2.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: - return dataViewTag$3; - case mapCtorString: - return mapTag$5; - case promiseCtorString: - return promiseTag; - case setCtorString: - return setTag$5; - case weakMapCtorString: - return weakMapTag$1; + var InternMap; + var init_src = __esm({ + "../../node_modules/.pnpm/internmap@2.0.3/node_modules/internmap/src/index.js"() { + "use strict"; + InternMap = class extends Map { + static { + __name(this, "InternMap"); } - } - return result; - }; + constructor(entries, key = keyof) { + super(); + Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } }); + if (entries != null) for (const [key2, value2] of entries) this.set(key2, value2); + } + get(key) { + return super.get(intern_get(this, key)); + } + has(key) { + return super.has(intern_get(this, key)); + } + set(key, value2) { + return super.set(intern_set(this, key), value2); + } + delete(key) { + return super.delete(intern_delete(this, key)); + } + }; + __name(intern_get, "intern_get"); + __name(intern_set, "intern_set"); + __name(intern_delete, "intern_delete"); + __name(keyof, "keyof"); + } + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js + function tickSpec(start3, stop5, count) { + const step3 = (stop5 - start3) / Math.max(0, count), power = Math.floor(Math.log10(step3)), error3 = step3 / Math.pow(10, power), factor = error3 >= e10 ? 10 : error3 >= e5 ? 5 : error3 >= e2 ? 2 : 1; + let i1, i2, inc; + if (power < 0) { + inc = Math.pow(10, -power) / factor; + i1 = Math.round(start3 * inc); + i2 = Math.round(stop5 * inc); + if (i1 / inc < start3) ++i1; + if (i2 / inc > stop5) --i2; + inc = -inc; + } else { + inc = Math.pow(10, power) * factor; + i1 = Math.round(start3 / inc); + i2 = Math.round(stop5 / inc); + if (i1 * inc < start3) ++i1; + if (i2 * inc > stop5) --i2; + } + if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start3, stop5, count * 2); + return [i1, i2, inc]; } - const getTag$1 = getTag; - var mapTag$4 = "[object Map]", setTag$4 = "[object Set]"; - var objectProto$6 = Object.prototype; - var hasOwnProperty$6 = objectProto$6.hasOwnProperty; - function isEmpty(value2) { - if (value2 == null) { - return true; + function ticks(start3, stop5, count) { + stop5 = +stop5, start3 = +start3, count = +count; + if (!(count > 0)) return []; + if (start3 === stop5) return [start3]; + const reverse2 = stop5 < start3, [i1, i2, inc] = reverse2 ? tickSpec(stop5, start3, count) : tickSpec(start3, stop5, count); + if (!(i2 >= i1)) return []; + const n2 = i2 - i1 + 1, ticks2 = new Array(n2); + if (reverse2) { + if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) / -inc; + else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) * inc; + } else { + if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) / -inc; + else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) * inc; } - if (isArrayLike(value2) && (isArray$1(value2) || typeof value2 == "string" || typeof value2.splice == "function" || isBuffer$1(value2) || isTypedArray$1(value2) || isArguments$1(value2))) { - return !value2.length; + return ticks2; + } + function tickIncrement(start3, stop5, count) { + stop5 = +stop5, start3 = +start3, count = +count; + return tickSpec(start3, stop5, count)[2]; + } + function tickStep(start3, stop5, count) { + stop5 = +stop5, start3 = +start3, count = +count; + const reverse2 = stop5 < start3, inc = reverse2 ? tickIncrement(stop5, start3, count) : tickIncrement(start3, stop5, count); + return (reverse2 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc); + } + var e10, e5, e2; + var init_ticks = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js"() { + "use strict"; + e10 = Math.sqrt(50); + e5 = Math.sqrt(10); + e2 = Math.sqrt(2); + __name(tickSpec, "tickSpec"); + __name(ticks, "ticks"); + __name(tickIncrement, "tickIncrement"); + __name(tickStep, "tickStep"); } - var tag = getTag$1(value2); - if (tag == mapTag$4 || tag == setTag$4) { - return !value2.size; + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js + function max(values2, valueof) { + let max10; + if (valueof === void 0) { + for (const value2 of values2) { + if (value2 != null && (max10 < value2 || max10 === void 0 && value2 >= value2)) { + max10 = value2; + } + } + } else { + let index = -1; + for (let value2 of values2) { + if ((value2 = valueof(value2, ++index, values2)) != null && (max10 < value2 || max10 === void 0 && value2 >= value2)) { + max10 = value2; + } + } } - if (isPrototype(value2)) { - return !baseKeys(value2).length; + return max10; + } + var init_max = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js"() { + "use strict"; + __name(max, "max"); } - for (var key in value2) { - if (hasOwnProperty$6.call(value2, key)) { - return false; + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js + function min(values2, valueof) { + let min9; + if (valueof === void 0) { + for (const value2 of values2) { + if (value2 != null && (min9 > value2 || min9 === void 0 && value2 >= value2)) { + min9 = value2; + } + } + } else { + let index = -1; + for (let value2 of values2) { + if ((value2 = valueof(value2, ++index, values2)) != null && (min9 > value2 || min9 === void 0 && value2 >= value2)) { + min9 = value2; + } } } - return true; + return min9; } - const SVG_ROLE = "graphics-document document"; - function setA11yDiagramInfo(svg2, diagramType) { - svg2.attr("role", SVG_ROLE); - if (diagramType !== "") { - svg2.attr("aria-roledescription", diagramType); + var init_min = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js"() { + "use strict"; + __name(min, "min"); } + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/range.js + function range(start3, stop5, step3) { + start3 = +start3, stop5 = +stop5, step3 = (n2 = arguments.length) < 2 ? (stop5 = start3, start3 = 0, 1) : n2 < 3 ? 1 : +step3; + var i2 = -1, n2 = Math.max(0, Math.ceil((stop5 - start3) / step3)) | 0, range3 = new Array(n2); + while (++i2 < n2) { + range3[i2] = start3 + i2 * step3; + } + return range3; } - function addSVGa11yTitleDescription(svg2, a11yTitle, a11yDesc, baseId) { - if (svg2.insert === void 0) { - return; + var init_range = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/range.js"() { + "use strict"; + __name(range, "range"); } - if (a11yDesc) { - const descId = `chart-desc-${baseId}`; - svg2.attr("aria-describedby", descId); - svg2.insert("desc", ":first-child").attr("id", descId).text(a11yDesc); + }); + + // ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/index.js + var init_src2 = __esm({ + "../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/index.js"() { + "use strict"; + init_bisect(); + init_bisector(); + init_max(); + init_min(); + init_range(); + init_ticks(); + init_src(); } - if (a11yTitle) { - const titleId = `chart-title-${baseId}`; - svg2.attr("aria-labelledby", titleId); - svg2.insert("title", ":first-child").attr("id", titleId).text(a11yTitle); + }); + + // ../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/identity.js + function identity_default(x5) { + return x5; + } + var init_identity = __esm({ + "../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/identity.js"() { + "use strict"; + __name(identity_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/axis.js + function translateX(x5) { + return "translate(" + x5 + ",0)"; } - const cleanupComments = (text2) => { - return text2.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart(); - }; - /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ - function isNothing(subject) { - return typeof subject === "undefined" || subject === null; + function translateY(y5) { + return "translate(0," + y5 + ")"; } - function isObject(subject) { - return typeof subject === "object" && subject !== null; + function number2(scale) { + return (d2) => +scale(d2); } - function toArray(sequence2) { - if (Array.isArray(sequence2)) - return sequence2; - else if (isNothing(sequence2)) - return []; - return [sequence2]; + function center(scale, offset) { + offset = Math.max(0, scale.bandwidth() - offset * 2) / 2; + if (scale.round()) offset = Math.round(offset); + return (d2) => +scale(d2) + offset; } - function extend(target, source) { - var index2, length2, key, sourceKeys; - if (source) { - sourceKeys = Object.keys(source); - for (index2 = 0, length2 = sourceKeys.length; index2 < length2; index2 += 1) { - key = sourceKeys[index2]; - target[key] = source[key]; + function entering() { + return !this.__axis; + } + function axis(orient, scale) { + var tickArguments = [], tickValues = null, tickFormat2 = null, tickSizeInner = 6, tickSizeOuter = 6, tickPadding = 3, offset = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : 0.5, k2 = orient === top || orient === left ? -1 : 1, x5 = orient === left || orient === right ? "x" : "y", transform8 = orient === top || orient === bottom ? translateX : translateY; + function axis2(context) { + var values2 = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues, format3 = tickFormat2 == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity_default : tickFormat2, spacing2 = Math.max(tickSizeInner, 0) + tickPadding, range3 = scale.range(), range0 = +range3[0] + offset, range1 = +range3[range3.length - 1] + offset, position5 = (scale.bandwidth ? center : number2)(scale.copy(), offset), selection2 = context.selection ? context.selection() : context, path4 = selection2.selectAll(".domain").data([null]), tick = selection2.selectAll(".tick").data(values2, scale).order(), tickExit = tick.exit(), tickEnter = tick.enter().append("g").attr("class", "tick"), line2 = tick.select("line"), text2 = tick.select("text"); + path4 = path4.merge(path4.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")); + tick = tick.merge(tickEnter); + line2 = line2.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x5 + "2", k2 * tickSizeInner)); + text2 = text2.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x5, k2 * spacing2).attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em")); + if (context !== selection2) { + path4 = path4.transition(context); + tick = tick.transition(context); + line2 = line2.transition(context); + text2 = text2.transition(context); + tickExit = tickExit.transition(context).attr("opacity", epsilon).attr("transform", function(d2) { + return isFinite(d2 = position5(d2)) ? transform8(d2 + offset) : this.getAttribute("transform"); + }); + tickEnter.attr("opacity", epsilon).attr("transform", function(d2) { + var p3 = this.parentNode.__axis; + return transform8((p3 && isFinite(p3 = p3(d2)) ? p3 : position5(d2)) + offset); + }); } + tickExit.remove(); + path4.attr("d", orient === left || orient === right ? tickSizeOuter ? "M" + k2 * tickSizeOuter + "," + range0 + "H" + offset + "V" + range1 + "H" + k2 * tickSizeOuter : "M" + offset + "," + range0 + "V" + range1 : tickSizeOuter ? "M" + range0 + "," + k2 * tickSizeOuter + "V" + offset + "H" + range1 + "V" + k2 * tickSizeOuter : "M" + range0 + "," + offset + "H" + range1); + tick.attr("opacity", 1).attr("transform", function(d2) { + return transform8(position5(d2) + offset); + }); + line2.attr(x5 + "2", k2 * tickSizeInner); + text2.attr(x5, k2 * spacing2).text(format3); + selection2.filter(entering).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle"); + selection2.each(function() { + this.__axis = position5; + }); } - return target; + __name(axis2, "axis"); + axis2.scale = function(_2) { + return arguments.length ? (scale = _2, axis2) : scale; + }; + axis2.ticks = function() { + return tickArguments = Array.from(arguments), axis2; + }; + axis2.tickArguments = function(_2) { + return arguments.length ? (tickArguments = _2 == null ? [] : Array.from(_2), axis2) : tickArguments.slice(); + }; + axis2.tickValues = function(_2) { + return arguments.length ? (tickValues = _2 == null ? null : Array.from(_2), axis2) : tickValues && tickValues.slice(); + }; + axis2.tickFormat = function(_2) { + return arguments.length ? (tickFormat2 = _2, axis2) : tickFormat2; + }; + axis2.tickSize = function(_2) { + return arguments.length ? (tickSizeInner = tickSizeOuter = +_2, axis2) : tickSizeInner; + }; + axis2.tickSizeInner = function(_2) { + return arguments.length ? (tickSizeInner = +_2, axis2) : tickSizeInner; + }; + axis2.tickSizeOuter = function(_2) { + return arguments.length ? (tickSizeOuter = +_2, axis2) : tickSizeOuter; + }; + axis2.tickPadding = function(_2) { + return arguments.length ? (tickPadding = +_2, axis2) : tickPadding; + }; + axis2.offset = function(_2) { + return arguments.length ? (offset = +_2, axis2) : offset; + }; + return axis2; } - function repeat(string2, count) { - var result = "", cycle; - for (cycle = 0; cycle < count; cycle += 1) { - result += string2; - } - return result; + function axisTop(scale) { + return axis(top, scale); } - function isNegativeZero(number2) { - return number2 === 0 && Number.NEGATIVE_INFINITY === 1 / number2; + function axisBottom(scale) { + return axis(bottom, scale); } - var isNothing_1 = isNothing; - var isObject_1 = isObject; - var toArray_1 = toArray; - var repeat_1 = repeat; - var isNegativeZero_1 = isNegativeZero; - var extend_1 = extend; - var common = { - isNothing: isNothing_1, - isObject: isObject_1, - toArray: toArray_1, - repeat: repeat_1, - isNegativeZero: isNegativeZero_1, - extend: extend_1 - }; - function formatError(exception2, compact) { - var where = "", message = exception2.reason || "(unknown reason)"; - if (!exception2.mark) - return message; - if (exception2.mark.name) { - where += 'in "' + exception2.mark.name + '" '; + var top, right, bottom, left, epsilon; + var init_axis = __esm({ + "../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/axis.js"() { + "use strict"; + init_identity(); + top = 1; + right = 2; + bottom = 3; + left = 4; + epsilon = 1e-6; + __name(translateX, "translateX"); + __name(translateY, "translateY"); + __name(number2, "number"); + __name(center, "center"); + __name(entering, "entering"); + __name(axis, "axis"); + __name(axisTop, "axisTop"); + __name(axisBottom, "axisBottom"); } - where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")"; - if (!compact && exception2.mark.snippet) { - where += "\n\n" + exception2.mark.snippet; + }); + + // ../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/index.js + var init_src3 = __esm({ + "../../node_modules/.pnpm/d3-axis@3.0.0/node_modules/d3-axis/src/index.js"() { + "use strict"; + init_axis(); } - return message + " " + where; - } - function YAMLException$1(reason, mark) { - Error.call(this); - this.name = "YAMLException"; - this.reason = reason; - this.mark = mark; - this.message = formatError(this, false); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = new Error().stack || ""; + }); + + // ../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js + function dispatch() { + for (var i2 = 0, n2 = arguments.length, _2 = {}, t4; i2 < n2; ++i2) { + if (!(t4 = arguments[i2] + "") || t4 in _2 || /[\s.]/.test(t4)) throw new Error("illegal type: " + t4); + _2[t4] = []; } + return new Dispatch(_2); } - YAMLException$1.prototype = Object.create(Error.prototype); - YAMLException$1.prototype.constructor = YAMLException$1; - YAMLException$1.prototype.toString = function toString2(compact) { - return this.name + ": " + formatError(this, compact); - }; - var exception = YAMLException$1; - function getLine(buffer, lineStart, lineEnd, position2, maxLineLength) { - var head2 = ""; - var tail = ""; - var maxHalfLength = Math.floor(maxLineLength / 2) - 1; - if (position2 - lineStart > maxHalfLength) { - head2 = " ... "; - lineStart = position2 - maxHalfLength + head2.length; - } - if (lineEnd - position2 > maxHalfLength) { - tail = " ..."; - lineEnd = position2 + maxHalfLength - tail.length; - } - return { - str: head2 + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail, - pos: position2 - lineStart + head2.length - // relative position - }; + function Dispatch(_2) { + this._ = _2; } - function padStart(string2, max2) { - return common.repeat(" ", max2 - string2.length) + string2; + function parseTypenames(typenames, types) { + return typenames.trim().split(/^|\s+/).map(function(t4) { + var name = "", i2 = t4.indexOf("."); + if (i2 >= 0) name = t4.slice(i2 + 1), t4 = t4.slice(0, i2); + if (t4 && !types.hasOwnProperty(t4)) throw new Error("unknown type: " + t4); + return { type: t4, name }; + }); } - function makeSnippet(mark, options2) { - options2 = Object.create(options2 || null); - if (!mark.buffer) - return null; - if (!options2.maxLength) - options2.maxLength = 79; - if (typeof options2.indent !== "number") - options2.indent = 1; - if (typeof options2.linesBefore !== "number") - options2.linesBefore = 3; - if (typeof options2.linesAfter !== "number") - options2.linesAfter = 2; - var re2 = /\r?\n|\r|\0/g; - var lineStarts = [0]; - var lineEnds = []; - var match; - var foundLineNo = -1; - while (match = re2.exec(mark.buffer)) { - lineEnds.push(match.index); - lineStarts.push(match.index + match[0].length); - if (mark.position <= match.index && foundLineNo < 0) { - foundLineNo = lineStarts.length - 2; + function get(type3, name) { + for (var i2 = 0, n2 = type3.length, c3; i2 < n2; ++i2) { + if ((c3 = type3[i2]).name === name) { + return c3.value; } } - if (foundLineNo < 0) - foundLineNo = lineStarts.length - 1; - var result = "", i2, line2; - var lineNoLength = Math.min(mark.line + options2.linesAfter, lineEnds.length).toString().length; - var maxLineLength = options2.maxLength - (options2.indent + lineNoLength + 3); - for (i2 = 1; i2 <= options2.linesBefore; i2++) { - if (foundLineNo - i2 < 0) + } + function set(type3, name, callback) { + for (var i2 = 0, n2 = type3.length; i2 < n2; ++i2) { + if (type3[i2].name === name) { + type3[i2] = noop, type3 = type3.slice(0, i2).concat(type3.slice(i2 + 1)); break; - line2 = getLine( - mark.buffer, - lineStarts[foundLineNo - i2], - lineEnds[foundLineNo - i2], - mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i2]), - maxLineLength - ); - result = common.repeat(" ", options2.indent) + padStart((mark.line - i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result; + } } - line2 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); - result += common.repeat(" ", options2.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line2.str + "\n"; - result += common.repeat("-", options2.indent + lineNoLength + 3 + line2.pos) + "^\n"; - for (i2 = 1; i2 <= options2.linesAfter; i2++) { - if (foundLineNo + i2 >= lineEnds.length) - break; - line2 = getLine( - mark.buffer, - lineStarts[foundLineNo + i2], - lineEnds[foundLineNo + i2], - mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i2]), - maxLineLength - ); - result += common.repeat(" ", options2.indent) + padStart((mark.line + i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n"; + if (callback != null) type3.push({ name, value: callback }); + return type3; + } + var noop, dispatch_default; + var init_dispatch = __esm({ + "../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js"() { + "use strict"; + noop = { value: /* @__PURE__ */ __name(() => { + }, "value") }; + __name(dispatch, "dispatch"); + __name(Dispatch, "Dispatch"); + __name(parseTypenames, "parseTypenames"); + Dispatch.prototype = dispatch.prototype = { + constructor: Dispatch, + on: /* @__PURE__ */ __name(function(typename, callback) { + var _2 = this._, T3 = parseTypenames(typename + "", _2), t4, i2 = -1, n2 = T3.length; + if (arguments.length < 2) { + while (++i2 < n2) if ((t4 = (typename = T3[i2]).type) && (t4 = get(_2[t4], typename.name))) return t4; + return; + } + if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); + while (++i2 < n2) { + if (t4 = (typename = T3[i2]).type) _2[t4] = set(_2[t4], typename.name, callback); + else if (callback == null) for (t4 in _2) _2[t4] = set(_2[t4], typename.name, null); + } + return this; + }, "on"), + copy: /* @__PURE__ */ __name(function() { + var copy6 = {}, _2 = this._; + for (var t4 in _2) copy6[t4] = _2[t4].slice(); + return new Dispatch(copy6); + }, "copy"), + call: /* @__PURE__ */ __name(function(type3, that) { + if ((n2 = arguments.length - 2) > 0) for (var args = new Array(n2), i2 = 0, n2, t4; i2 < n2; ++i2) args[i2] = arguments[i2 + 2]; + if (!this._.hasOwnProperty(type3)) throw new Error("unknown type: " + type3); + for (t4 = this._[type3], i2 = 0, n2 = t4.length; i2 < n2; ++i2) t4[i2].value.apply(that, args); + }, "call"), + apply: /* @__PURE__ */ __name(function(type3, that, args) { + if (!this._.hasOwnProperty(type3)) throw new Error("unknown type: " + type3); + for (var t4 = this._[type3], i2 = 0, n2 = t4.length; i2 < n2; ++i2) t4[i2].value.apply(that, args); + }, "apply") + }; + __name(get, "get"); + __name(set, "set"); + dispatch_default = dispatch; } - return result.replace(/\n$/, ""); - } - var snippet = makeSnippet; - var TYPE_CONSTRUCTOR_OPTIONS = [ - "kind", - "multi", - "resolve", - "construct", - "instanceOf", - "predicate", - "represent", - "representName", - "defaultStyle", - "styleAliases" - ]; - var YAML_NODE_KINDS = [ - "scalar", - "sequence", - "mapping" - ]; - function compileStyleAliases(map2) { - var result = {}; - if (map2 !== null) { - Object.keys(map2).forEach(function(style) { - map2[style].forEach(function(alias) { - result[String(alias)] = style; - }); - }); + }); + + // ../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/index.js + var init_src4 = __esm({ + "../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/index.js"() { + "use strict"; + init_dispatch(); } - return result; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js + var xhtml, namespaces_default; + var init_namespaces = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js"() { + "use strict"; + xhtml = "http://www.w3.org/1999/xhtml"; + namespaces_default = { + svg: "http://www.w3.org/2000/svg", + xhtml, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" + }; + } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js + function namespace_default(name) { + var prefix = name += "", i2 = prefix.indexOf(":"); + if (i2 >= 0 && (prefix = name.slice(0, i2)) !== "xmlns") name = name.slice(i2 + 1); + return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name; } - function Type$1(tag, options2) { - options2 = options2 || {}; - Object.keys(options2).forEach(function(name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - this.options = options2; - this.tag = tag; - this.kind = options2["kind"] || null; - this.resolve = options2["resolve"] || function() { - return true; + var init_namespace = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js"() { + "use strict"; + init_namespaces(); + __name(namespace_default, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js + function creatorInherit(name) { + return function() { + var document2 = this.ownerDocument, uri = this.namespaceURI; + return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name); }; - this.construct = options2["construct"] || function(data) { - return data; + } + function creatorFixed(fullname) { + return function() { + return this.ownerDocument.createElementNS(fullname.space, fullname.local); }; - this.instanceOf = options2["instanceOf"] || null; - this.predicate = options2["predicate"] || null; - this.represent = options2["represent"] || null; - this.representName = options2["representName"] || null; - this.defaultStyle = options2["defaultStyle"] || null; - this.multi = options2["multi"] || false; - this.styleAliases = compileStyleAliases(options2["styleAliases"] || null); - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } } - var type = Type$1; - function compileList(schema2, name) { - var result = []; - schema2[name].forEach(function(currentType) { - var newIndex = result.length; - result.forEach(function(previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { - newIndex = previousIndex; - } - }); - result[newIndex] = currentType; - }); - return result; + function creator_default(name) { + var fullname = namespace_default(name); + return (fullname.local ? creatorFixed : creatorInherit)(fullname); } - function compileMap() { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {}, - multi: { - scalar: [], - sequence: [], - mapping: [], - fallback: [] - } - }, index2, length2; - function collectType(type2) { - if (type2.multi) { - result.multi[type2.kind].push(type2); - result.multi["fallback"].push(type2); - } else { - result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2; - } - } - for (index2 = 0, length2 = arguments.length; index2 < length2; index2 += 1) { - arguments[index2].forEach(collectType); + var init_creator = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js"() { + "use strict"; + init_namespace(); + init_namespaces(); + __name(creatorInherit, "creatorInherit"); + __name(creatorFixed, "creatorFixed"); + __name(creator_default, "default"); } - return result; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js + function none() { } - function Schema$1(definition2) { - return this.extend(definition2); + function selector_default(selector) { + return selector == null ? none : function() { + return this.querySelector(selector); + }; } - Schema$1.prototype.extend = function extend2(definition2) { - var implicit2 = []; - var explicit = []; - if (definition2 instanceof type) { - explicit.push(definition2); - } else if (Array.isArray(definition2)) { - explicit = explicit.concat(definition2); - } else if (definition2 && (Array.isArray(definition2.implicit) || Array.isArray(definition2.explicit))) { - if (definition2.implicit) - implicit2 = implicit2.concat(definition2.implicit); - if (definition2.explicit) - explicit = explicit.concat(definition2.explicit); - } else { - throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + var init_selector = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js"() { + "use strict"; + __name(none, "none"); + __name(selector_default, "default"); } - implicit2.forEach(function(type$1) { - if (!(type$1 instanceof type)) { - throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); - } - if (type$1.loadKind && type$1.loadKind !== "scalar") { - throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); - } - if (type$1.multi) { - throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); - } - }); - explicit.forEach(function(type$1) { - if (!(type$1 instanceof type)) { - throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js + function select_default(select) { + if (typeof select !== "function") select = selector_default(select); + for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, subgroup = subgroups[j2] = new Array(n2), node2, subnode, i2 = 0; i2 < n2; ++i2) { + if ((node2 = group2[i2]) && (subnode = select.call(node2, node2.__data__, i2, group2))) { + if ("__data__" in node2) subnode.__data__ = node2.__data__; + subgroup[i2] = subnode; + } } - }); - var result = Object.create(Schema$1.prototype); - result.implicit = (this.implicit || []).concat(implicit2); - result.explicit = (this.explicit || []).concat(explicit); - result.compiledImplicit = compileList(result, "implicit"); - result.compiledExplicit = compileList(result, "explicit"); - result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); - return result; - }; - var schema = Schema$1; - var str = new type("tag:yaml.org,2002:str", { - kind: "scalar", - construct: function(data) { - return data !== null ? data : ""; } - }); - var seq$1 = new type("tag:yaml.org,2002:seq", { - kind: "sequence", - construct: function(data) { - return data !== null ? data : []; + return new Selection(subgroups, this._parents); + } + var init_select = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js"() { + "use strict"; + init_selection(); + init_selector(); + __name(select_default, "default"); } }); - var map$1 = new type("tag:yaml.org,2002:map", { - kind: "mapping", - construct: function(data) { - return data !== null ? data : {}; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js + function array(x5) { + return x5 == null ? [] : Array.isArray(x5) ? x5 : Array.from(x5); + } + var init_array = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js"() { + "use strict"; + __name(array, "array"); } }); - var failsafe = new schema({ - explicit: [ - str, - seq$1, - map$1 - ] - }); - function resolveYamlNull(data) { - if (data === null) - return true; - var max2 = data.length; - return max2 === 1 && data === "~" || max2 === 4 && (data === "null" || data === "Null" || data === "NULL"); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js + function empty() { + return []; } - function constructYamlNull() { - return null; + function selectorAll_default(selector) { + return selector == null ? empty : function() { + return this.querySelectorAll(selector); + }; } - function isNull(object2) { - return object2 === null; + var init_selectorAll = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js"() { + "use strict"; + __name(empty, "empty"); + __name(selectorAll_default, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js + function arrayAll(select) { + return function() { + return array(select.apply(this, arguments)); + }; } - var _null = new type("tag:yaml.org,2002:null", { - kind: "scalar", - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function() { - return "~"; - }, - lowercase: function() { - return "null"; - }, - uppercase: function() { - return "NULL"; - }, - camelcase: function() { - return "Null"; - }, - empty: function() { - return ""; + function selectAll_default(select) { + if (typeof select === "function") select = arrayAll(select); + else select = selectorAll_default(select); + for (var groups = this._groups, m2 = groups.length, subgroups = [], parents4 = [], j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) { + if (node2 = group2[i2]) { + subgroups.push(select.call(node2, node2.__data__, i2, group2)); + parents4.push(node2); + } } - }, - defaultStyle: "lowercase" + } + return new Selection(subgroups, parents4); + } + var init_selectAll = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js"() { + "use strict"; + init_selection(); + init_array(); + init_selectorAll(); + __name(arrayAll, "arrayAll"); + __name(selectAll_default, "default"); + } }); - function resolveYamlBoolean(data) { - if (data === null) - return false; - var max2 = data.length; - return max2 === 4 && (data === "true" || data === "True" || data === "TRUE") || max2 === 5 && (data === "false" || data === "False" || data === "FALSE"); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js + function matcher_default(selector) { + return function() { + return this.matches(selector); + }; } - function constructYamlBoolean(data) { - return data === "true" || data === "True" || data === "TRUE"; + function childMatcher(selector) { + return function(node2) { + return node2.matches(selector); + }; } - function isBoolean(object2) { - return Object.prototype.toString.call(object2) === "[object Boolean]"; + var init_matcher = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js"() { + "use strict"; + __name(matcher_default, "default"); + __name(childMatcher, "childMatcher"); + } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js + function childFind(match2) { + return function() { + return find.call(this.children, match2); + }; } - var bool = new type("tag:yaml.org,2002:bool", { - kind: "scalar", - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function(object2) { - return object2 ? "true" : "false"; - }, - uppercase: function(object2) { - return object2 ? "TRUE" : "FALSE"; - }, - camelcase: function(object2) { - return object2 ? "True" : "False"; - } - }, - defaultStyle: "lowercase" + function childFirst() { + return this.firstElementChild; + } + function selectChild_default(match2) { + return this.select(match2 == null ? childFirst : childFind(typeof match2 === "function" ? match2 : childMatcher(match2))); + } + var find; + var init_selectChild = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js"() { + "use strict"; + init_matcher(); + find = Array.prototype.find; + __name(childFind, "childFind"); + __name(childFirst, "childFirst"); + __name(selectChild_default, "default"); + } }); - function isHexCode(c2) { - return 48 <= c2 && c2 <= 57 || 65 <= c2 && c2 <= 70 || 97 <= c2 && c2 <= 102; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js + function children() { + return Array.from(this.children); } - function isOctCode(c2) { - return 48 <= c2 && c2 <= 55; + function childrenFilter(match2) { + return function() { + return filter.call(this.children, match2); + }; } - function isDecCode(c2) { - return 48 <= c2 && c2 <= 57; + function selectChildren_default(match2) { + return this.selectAll(match2 == null ? children : childrenFilter(typeof match2 === "function" ? match2 : childMatcher(match2))); } - function resolveYamlInteger(data) { - if (data === null) - return false; - var max2 = data.length, index2 = 0, hasDigits = false, ch2; - if (!max2) - return false; - ch2 = data[index2]; - if (ch2 === "-" || ch2 === "+") { - ch2 = data[++index2]; + var filter; + var init_selectChildren = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js"() { + "use strict"; + init_matcher(); + filter = Array.prototype.filter; + __name(children, "children"); + __name(childrenFilter, "childrenFilter"); + __name(selectChildren_default, "default"); } - if (ch2 === "0") { - if (index2 + 1 === max2) - return true; - ch2 = data[++index2]; - if (ch2 === "b") { - index2++; - for (; index2 < max2; index2++) { - ch2 = data[index2]; - if (ch2 === "_") - continue; - if (ch2 !== "0" && ch2 !== "1") - return false; - hasDigits = true; - } - return hasDigits && ch2 !== "_"; - } - if (ch2 === "x") { - index2++; - for (; index2 < max2; index2++) { - ch2 = data[index2]; - if (ch2 === "_") - continue; - if (!isHexCode(data.charCodeAt(index2))) - return false; - hasDigits = true; - } - return hasDigits && ch2 !== "_"; - } - if (ch2 === "o") { - index2++; - for (; index2 < max2; index2++) { - ch2 = data[index2]; - if (ch2 === "_") - continue; - if (!isOctCode(data.charCodeAt(index2))) - return false; - hasDigits = true; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js + function filter_default(match2) { + if (typeof match2 !== "function") match2 = matcher_default(match2); + for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, subgroup = subgroups[j2] = [], node2, i2 = 0; i2 < n2; ++i2) { + if ((node2 = group2[i2]) && match2.call(node2, node2.__data__, i2, group2)) { + subgroup.push(node2); } - return hasDigits && ch2 !== "_"; } } - if (ch2 === "_") - return false; - for (; index2 < max2; index2++) { - ch2 = data[index2]; - if (ch2 === "_") - continue; - if (!isDecCode(data.charCodeAt(index2))) { - return false; - } - hasDigits = true; - } - if (!hasDigits || ch2 === "_") - return false; - return true; + return new Selection(subgroups, this._parents); } - function constructYamlInteger(data) { - var value2 = data, sign2 = 1, ch2; - if (value2.indexOf("_") !== -1) { - value2 = value2.replace(/_/g, ""); - } - ch2 = value2[0]; - if (ch2 === "-" || ch2 === "+") { - if (ch2 === "-") - sign2 = -1; - value2 = value2.slice(1); - ch2 = value2[0]; + var init_filter = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js"() { + "use strict"; + init_selection(); + init_matcher(); + __name(filter_default, "default"); } - if (value2 === "0") - return 0; - if (ch2 === "0") { - if (value2[1] === "b") - return sign2 * parseInt(value2.slice(2), 2); - if (value2[1] === "x") - return sign2 * parseInt(value2.slice(2), 16); - if (value2[1] === "o") - return sign2 * parseInt(value2.slice(2), 8); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js + function sparse_default(update2) { + return new Array(update2.length); + } + var init_sparse = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js"() { + "use strict"; + __name(sparse_default, "default"); } - return sign2 * parseInt(value2, 10); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js + function enter_default() { + return new Selection(this._enter || this._groups.map(sparse_default), this._parents); } - function isInteger(object2) { - return Object.prototype.toString.call(object2) === "[object Number]" && (object2 % 1 === 0 && !common.isNegativeZero(object2)); + function EnterNode(parent4, datum2) { + this.ownerDocument = parent4.ownerDocument; + this.namespaceURI = parent4.namespaceURI; + this._next = null; + this._parent = parent4; + this.__data__ = datum2; } - var int = new type("tag:yaml.org,2002:int", { - kind: "scalar", - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function(obj) { - return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); - }, - octal: function(obj) { - return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); - }, - decimal: function(obj) { - return obj.toString(10); - }, - /* eslint-disable max-len */ - hexadecimal: function(obj) { - return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); - } - }, - defaultStyle: "decimal", - styleAliases: { - binary: [2, "bin"], - octal: [8, "oct"], - decimal: [10, "dec"], - hexadecimal: [16, "hex"] + var init_enter = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js"() { + "use strict"; + init_sparse(); + init_selection(); + __name(enter_default, "default"); + __name(EnterNode, "EnterNode"); + EnterNode.prototype = { + constructor: EnterNode, + appendChild: /* @__PURE__ */ __name(function(child) { + return this._parent.insertBefore(child, this._next); + }, "appendChild"), + insertBefore: /* @__PURE__ */ __name(function(child, next3) { + return this._parent.insertBefore(child, next3); + }, "insertBefore"), + querySelector: /* @__PURE__ */ __name(function(selector) { + return this._parent.querySelector(selector); + }, "querySelector"), + querySelectorAll: /* @__PURE__ */ __name(function(selector) { + return this._parent.querySelectorAll(selector); + }, "querySelectorAll") + }; } }); - var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" - ); - function resolveYamlFloat(data) { - if (data === null) - return false; - if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === "_") { - return false; - } - return true; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js + function constant_default(x5) { + return function() { + return x5; + }; } - function constructYamlFloat(data) { - var value2, sign2; - value2 = data.replace(/_/g, "").toLowerCase(); - sign2 = value2[0] === "-" ? -1 : 1; - if ("+-".indexOf(value2[0]) >= 0) { - value2 = value2.slice(1); + var init_constant = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js"() { + "use strict"; + __name(constant_default, "default"); } - if (value2 === ".inf") { - return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - } else if (value2 === ".nan") { - return NaN; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js + function bindIndex(parent4, group2, enter, update2, exit, data5) { + var i2 = 0, node2, groupLength3 = group2.length, dataLength = data5.length; + for (; i2 < dataLength; ++i2) { + if (node2 = group2[i2]) { + node2.__data__ = data5[i2]; + update2[i2] = node2; + } else { + enter[i2] = new EnterNode(parent4, data5[i2]); + } + } + for (; i2 < groupLength3; ++i2) { + if (node2 = group2[i2]) { + exit[i2] = node2; + } } - return sign2 * parseFloat(value2, 10); } - var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - function representYamlFloat(object2, style) { - var res; - if (isNaN(object2)) { - switch (style) { - case "lowercase": - return ".nan"; - case "uppercase": - return ".NAN"; - case "camelcase": - return ".NaN"; + function bindKey(parent4, group2, enter, update2, exit, data5, key) { + var i2, node2, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength3 = group2.length, dataLength = data5.length, keyValues = new Array(groupLength3), keyValue; + for (i2 = 0; i2 < groupLength3; ++i2) { + if (node2 = group2[i2]) { + keyValues[i2] = keyValue = key.call(node2, node2.__data__, i2, group2) + ""; + if (nodeByKeyValue.has(keyValue)) { + exit[i2] = node2; + } else { + nodeByKeyValue.set(keyValue, node2); + } } - } else if (Number.POSITIVE_INFINITY === object2) { - switch (style) { - case "lowercase": - return ".inf"; - case "uppercase": - return ".INF"; - case "camelcase": - return ".Inf"; + } + for (i2 = 0; i2 < dataLength; ++i2) { + keyValue = key.call(parent4, data5[i2], i2, data5) + ""; + if (node2 = nodeByKeyValue.get(keyValue)) { + update2[i2] = node2; + node2.__data__ = data5[i2]; + nodeByKeyValue.delete(keyValue); + } else { + enter[i2] = new EnterNode(parent4, data5[i2]); } - } else if (Number.NEGATIVE_INFINITY === object2) { - switch (style) { - case "lowercase": - return "-.inf"; - case "uppercase": - return "-.INF"; - case "camelcase": - return "-.Inf"; + } + for (i2 = 0; i2 < groupLength3; ++i2) { + if ((node2 = group2[i2]) && nodeByKeyValue.get(keyValues[i2]) === node2) { + exit[i2] = node2; } - } else if (common.isNegativeZero(object2)) { - return "-0.0"; } - res = object2.toString(10); - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; } - function isFloat(object2) { - return Object.prototype.toString.call(object2) === "[object Number]" && (object2 % 1 !== 0 || common.isNegativeZero(object2)); - } - var float = new type("tag:yaml.org,2002:float", { - kind: "scalar", - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: "lowercase" - }); - var json = failsafe.extend({ - implicit: [ - _null, - bool, - int, - float - ] - }); - var core = json; - var YAML_DATE_REGEXP = new RegExp( - "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" - ); - var YAML_TIMESTAMP_REGEXP = new RegExp( - "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" - ); - function resolveYamlTimestamp(data) { - if (data === null) - return false; - if (YAML_DATE_REGEXP.exec(data) !== null) - return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) - return true; - return false; + function datum(node2) { + return node2.__data__; } - function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second2, fraction = 0, delta = null, tz_hour, tz_minute, date2; - match = YAML_DATE_REGEXP.exec(data); - if (match === null) - match = YAML_TIMESTAMP_REGEXP.exec(data); - if (match === null) - throw new Error("Date resolve error"); - year = +match[1]; - month = +match[2] - 1; - day = +match[3]; - if (!match[4]) { - return new Date(Date.UTC(year, month, day)); - } - hour = +match[4]; - minute = +match[5]; - second2 = +match[6]; - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { - fraction += "0"; + function data_default(value2, key) { + if (!arguments.length) return Array.from(this, datum); + var bind = key ? bindKey : bindIndex, parents4 = this._parents, groups = this._groups; + if (typeof value2 !== "function") value2 = constant_default(value2); + for (var m2 = groups.length, update2 = new Array(m2), enter = new Array(m2), exit = new Array(m2), j2 = 0; j2 < m2; ++j2) { + var parent4 = parents4[j2], group2 = groups[j2], groupLength3 = group2.length, data5 = arraylike(value2.call(parent4, parent4 && parent4.__data__, j2, parents4)), dataLength = data5.length, enterGroup = enter[j2] = new Array(dataLength), updateGroup = update2[j2] = new Array(dataLength), exitGroup = exit[j2] = new Array(groupLength3); + bind(parent4, group2, enterGroup, updateGroup, exitGroup, data5, key); + for (var i0 = 0, i1 = 0, previous, next3; i0 < dataLength; ++i0) { + if (previous = enterGroup[i0]) { + if (i0 >= i1) i1 = i0 + 1; + while (!(next3 = updateGroup[i1]) && ++i1 < dataLength) ; + previous._next = next3 || null; + } } - fraction = +fraction; - } - if (match[9]) { - tz_hour = +match[10]; - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 6e4; - if (match[9] === "-") - delta = -delta; } - date2 = new Date(Date.UTC(year, month, day, hour, minute, second2, fraction)); - if (delta) - date2.setTime(date2.getTime() - delta); - return date2; - } - function representYamlTimestamp(object2) { - return object2.toISOString(); + update2 = new Selection(update2, parents4); + update2._enter = enter; + update2._exit = exit; + return update2; } - var timestamp = new type("tag:yaml.org,2002:timestamp", { - kind: "scalar", - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp + function arraylike(data5) { + return typeof data5 === "object" && "length" in data5 ? data5 : Array.from(data5); + } + var init_data = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js"() { + "use strict"; + init_selection(); + init_enter(); + init_constant(); + __name(bindIndex, "bindIndex"); + __name(bindKey, "bindKey"); + __name(datum, "datum"); + __name(data_default, "default"); + __name(arraylike, "arraylike"); + } }); - function resolveYamlMerge(data) { - return data === "<<" || data === null; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js + function exit_default() { + return new Selection(this._exit || this._groups.map(sparse_default), this._parents); } - var merge$1 = new type("tag:yaml.org,2002:merge", { - kind: "scalar", - resolve: resolveYamlMerge + var init_exit = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js"() { + "use strict"; + init_sparse(); + init_selection(); + __name(exit_default, "default"); + } }); - var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; - function resolveYamlBinary(data) { - if (data === null) - return false; - var code, idx, bitlen = 0, max2 = data.length, map2 = BASE64_MAP; - for (idx = 0; idx < max2; idx++) { - code = map2.indexOf(data.charAt(idx)); - if (code > 64) - continue; - if (code < 0) - return false; - bitlen += 6; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js + function join_default(onenter, onupdate, onexit) { + var enter = this.enter(), update2 = this, exit = this.exit(); + if (typeof onenter === "function") { + enter = onenter(enter); + if (enter) enter = enter.selection(); + } else { + enter = enter.append(onenter + ""); } - return bitlen % 8 === 0; + if (onupdate != null) { + update2 = onupdate(update2); + if (update2) update2 = update2.selection(); + } + if (onexit == null) exit.remove(); + else onexit(exit); + return enter && update2 ? enter.merge(update2).order() : update2; } - function constructYamlBinary(data) { - var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max2 = input.length, map2 = BASE64_MAP, bits = 0, result = []; - for (idx = 0; idx < max2; idx++) { - if (idx % 4 === 0 && idx) { - result.push(bits >> 16 & 255); - result.push(bits >> 8 & 255); - result.push(bits & 255); + var init_join = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js"() { + "use strict"; + __name(join_default, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js + function merge_default(context) { + var selection2 = context.selection ? context.selection() : context; + for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j2 = 0; j2 < m2; ++j2) { + for (var group0 = groups0[j2], group1 = groups1[j2], n2 = group0.length, merge5 = merges[j2] = new Array(n2), node2, i2 = 0; i2 < n2; ++i2) { + if (node2 = group0[i2] || group1[i2]) { + merge5[i2] = node2; + } } - bits = bits << 6 | map2.indexOf(input.charAt(idx)); } - tailbits = max2 % 4 * 6; - if (tailbits === 0) { - result.push(bits >> 16 & 255); - result.push(bits >> 8 & 255); - result.push(bits & 255); - } else if (tailbits === 18) { - result.push(bits >> 10 & 255); - result.push(bits >> 2 & 255); - } else if (tailbits === 12) { - result.push(bits >> 4 & 255); + for (; j2 < m0; ++j2) { + merges[j2] = groups0[j2]; } - return new Uint8Array(result); + return new Selection(merges, this._parents); } - function representYamlBinary(object2) { - var result = "", bits = 0, idx, tail, max2 = object2.length, map2 = BASE64_MAP; - for (idx = 0; idx < max2; idx++) { - if (idx % 3 === 0 && idx) { - result += map2[bits >> 18 & 63]; - result += map2[bits >> 12 & 63]; - result += map2[bits >> 6 & 63]; - result += map2[bits & 63]; - } - bits = (bits << 8) + object2[idx]; + var init_merge = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js"() { + "use strict"; + init_selection(); + __name(merge_default, "default"); } - tail = max2 % 3; - if (tail === 0) { - result += map2[bits >> 18 & 63]; - result += map2[bits >> 12 & 63]; - result += map2[bits >> 6 & 63]; - result += map2[bits & 63]; - } else if (tail === 2) { - result += map2[bits >> 10 & 63]; - result += map2[bits >> 4 & 63]; - result += map2[bits << 2 & 63]; - result += map2[64]; - } else if (tail === 1) { - result += map2[bits >> 2 & 63]; - result += map2[bits << 4 & 63]; - result += map2[64]; - result += map2[64]; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js + function order_default() { + for (var groups = this._groups, j2 = -1, m2 = groups.length; ++j2 < m2; ) { + for (var group2 = groups[j2], i2 = group2.length - 1, next3 = group2[i2], node2; --i2 >= 0; ) { + if (node2 = group2[i2]) { + if (next3 && node2.compareDocumentPosition(next3) ^ 4) next3.parentNode.insertBefore(node2, next3); + next3 = node2; + } + } } - return result; - } - function isBinary(obj) { - return Object.prototype.toString.call(obj) === "[object Uint8Array]"; + return this; } - var binary = new type("tag:yaml.org,2002:binary", { - kind: "scalar", - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary + var init_order = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js"() { + "use strict"; + __name(order_default, "default"); + } }); - var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; - var _toString$2 = Object.prototype.toString; - function resolveYamlOmap(data) { - if (data === null) - return true; - var objectKeys = [], index2, length2, pair, pairKey, pairHasKey, object2 = data; - for (index2 = 0, length2 = object2.length; index2 < length2; index2 += 1) { - pair = object2[index2]; - pairHasKey = false; - if (_toString$2.call(pair) !== "[object Object]") - return false; - for (pairKey in pair) { - if (_hasOwnProperty$3.call(pair, pairKey)) { - if (!pairHasKey) - pairHasKey = true; - else - return false; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js + function sort_default(compare) { + if (!compare) compare = ascending2; + function compareNode(a2, b2) { + return a2 && b2 ? compare(a2.__data__, b2.__data__) : !a2 - !b2; + } + __name(compareNode, "compareNode"); + for (var groups = this._groups, m2 = groups.length, sortgroups = new Array(m2), j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, sortgroup = sortgroups[j2] = new Array(n2), node2, i2 = 0; i2 < n2; ++i2) { + if (node2 = group2[i2]) { + sortgroup[i2] = node2; } } - if (!pairHasKey) - return false; - if (objectKeys.indexOf(pairKey) === -1) - objectKeys.push(pairKey); - else - return false; + sortgroup.sort(compareNode); } - return true; + return new Selection(sortgroups, this._parents).order(); } - function constructYamlOmap(data) { - return data !== null ? data : []; + function ascending2(a2, b2) { + return a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN; } - var omap = new type("tag:yaml.org,2002:omap", { - kind: "sequence", - resolve: resolveYamlOmap, - construct: constructYamlOmap - }); - var _toString$1 = Object.prototype.toString; - function resolveYamlPairs(data) { - if (data === null) - return true; - var index2, length2, pair, keys2, result, object2 = data; - result = new Array(object2.length); - for (index2 = 0, length2 = object2.length; index2 < length2; index2 += 1) { - pair = object2[index2]; - if (_toString$1.call(pair) !== "[object Object]") - return false; - keys2 = Object.keys(pair); - if (keys2.length !== 1) - return false; - result[index2] = [keys2[0], pair[keys2[0]]]; + var init_sort = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js"() { + "use strict"; + init_selection(); + __name(sort_default, "default"); + __name(ascending2, "ascending"); } - return true; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js + function call_default() { + var callback = arguments[0]; + arguments[0] = this; + callback.apply(null, arguments); + return this; } - function constructYamlPairs(data) { - if (data === null) - return []; - var index2, length2, pair, keys2, result, object2 = data; - result = new Array(object2.length); - for (index2 = 0, length2 = object2.length; index2 < length2; index2 += 1) { - pair = object2[index2]; - keys2 = Object.keys(pair); - result[index2] = [keys2[0], pair[keys2[0]]]; + var init_call = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js"() { + "use strict"; + __name(call_default, "default"); } - return result; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js + function nodes_default() { + return Array.from(this); } - var pairs = new type("tag:yaml.org,2002:pairs", { - kind: "sequence", - resolve: resolveYamlPairs, - construct: constructYamlPairs + var init_nodes = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js"() { + "use strict"; + __name(nodes_default, "default"); + } }); - var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; - function resolveYamlSet(data) { - if (data === null) - return true; - var key, object2 = data; - for (key in object2) { - if (_hasOwnProperty$2.call(object2, key)) { - if (object2[key] !== null) - return false; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js + function node_default() { + for (var groups = this._groups, j2 = 0, m2 = groups.length; j2 < m2; ++j2) { + for (var group2 = groups[j2], i2 = 0, n2 = group2.length; i2 < n2; ++i2) { + var node2 = group2[i2]; + if (node2) return node2; } } - return true; - } - function constructYamlSet(data) { - return data !== null ? data : {}; + return null; } - var set$1 = new type("tag:yaml.org,2002:set", { - kind: "mapping", - resolve: resolveYamlSet, - construct: constructYamlSet - }); - var _default = core.extend({ - implicit: [ - timestamp, - merge$1 - ], - explicit: [ - binary, - omap, - pairs, - set$1 - ] + var init_node = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js"() { + "use strict"; + __name(node_default, "default"); + } }); - var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; - var CONTEXT_FLOW_IN = 1; - var CONTEXT_FLOW_OUT = 2; - var CONTEXT_BLOCK_IN = 3; - var CONTEXT_BLOCK_OUT = 4; - var CHOMPING_CLIP = 1; - var CHOMPING_STRIP = 2; - var CHOMPING_KEEP = 3; - var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; - var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; - var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; - var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - function _class(obj) { - return Object.prototype.toString.call(obj); - } - function is_EOL(c2) { - return c2 === 10 || c2 === 13; - } - function is_WHITE_SPACE(c2) { - return c2 === 9 || c2 === 32; - } - function is_WS_OR_EOL(c2) { - return c2 === 9 || c2 === 32 || c2 === 10 || c2 === 13; - } - function is_FLOW_INDICATOR(c2) { - return c2 === 44 || c2 === 91 || c2 === 93 || c2 === 123 || c2 === 125; + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js + function size_default() { + let size5 = 0; + for (const node2 of this) ++size5; + return size5; } - function fromHexCode(c2) { - var lc; - if (48 <= c2 && c2 <= 57) { - return c2 - 48; - } - lc = c2 | 32; - if (97 <= lc && lc <= 102) { - return lc - 97 + 10; + var init_size = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js"() { + "use strict"; + __name(size_default, "default"); } - return -1; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js + function empty_default() { + return !this.node(); } - function escapedHexLen(c2) { - if (c2 === 120) { - return 2; - } - if (c2 === 117) { - return 4; + var init_empty = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js"() { + "use strict"; + __name(empty_default, "default"); } - if (c2 === 85) { - return 8; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js + function each_default(callback) { + for (var groups = this._groups, j2 = 0, m2 = groups.length; j2 < m2; ++j2) { + for (var group2 = groups[j2], i2 = 0, n2 = group2.length, node2; i2 < n2; ++i2) { + if (node2 = group2[i2]) callback.call(node2, node2.__data__, i2, group2); + } } - return 0; + return this; } - function fromDecimalCode(c2) { - if (48 <= c2 && c2 <= 57) { - return c2 - 48; + var init_each = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js"() { + "use strict"; + __name(each_default, "default"); } - return -1; - } - function simpleEscapeSequence(c2) { - return c2 === 48 ? "\0" : c2 === 97 ? "\x07" : c2 === 98 ? "\b" : c2 === 116 ? " " : c2 === 9 ? " " : c2 === 110 ? "\n" : c2 === 118 ? "\v" : c2 === 102 ? "\f" : c2 === 114 ? "\r" : c2 === 101 ? "\x1B" : c2 === 32 ? " " : c2 === 34 ? '"' : c2 === 47 ? "/" : c2 === 92 ? "\\" : c2 === 78 ? "…" : c2 === 95 ? " " : c2 === 76 ? "\u2028" : c2 === 80 ? "\u2029" : ""; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js + function attrRemove(name) { + return function() { + this.removeAttribute(name); + }; } - function charFromCodepoint(c2) { - if (c2 <= 65535) { - return String.fromCharCode(c2); - } - return String.fromCharCode( - (c2 - 65536 >> 10) + 55296, - (c2 - 65536 & 1023) + 56320 - ); + function attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; } - var simpleEscapeCheck = new Array(256); - var simpleEscapeMap = new Array(256); - for (var i$1 = 0; i$1 < 256; i$1++) { - simpleEscapeCheck[i$1] = simpleEscapeSequence(i$1) ? 1 : 0; - simpleEscapeMap[i$1] = simpleEscapeSequence(i$1); + function attrConstant(name, value2) { + return function() { + this.setAttribute(name, value2); + }; } - function State$1(input, options2) { - this.input = input; - this.filename = options2["filename"] || null; - this.schema = options2["schema"] || _default; - this.onWarning = options2["onWarning"] || null; - this.legacy = options2["legacy"] || false; - this.json = options2["json"] || false; - this.listener = options2["listener"] || null; - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - this.firstTabInLine = -1; - this.documents = []; + function attrConstantNS(fullname, value2) { + return function() { + this.setAttributeNS(fullname.space, fullname.local, value2); + }; } - function generateError(state2, message) { - var mark = { - name: state2.filename, - buffer: state2.input.slice(0, -1), - // omit trailing \0 - position: state2.position, - line: state2.line, - column: state2.position - state2.lineStart + function attrFunction(name, value2) { + return function() { + var v3 = value2.apply(this, arguments); + if (v3 == null) this.removeAttribute(name); + else this.setAttribute(name, v3); }; - mark.snippet = snippet(mark); - return new exception(message, mark); } - function throwError(state2, message) { - throw generateError(state2, message); + function attrFunctionNS(fullname, value2) { + return function() { + var v3 = value2.apply(this, arguments); + if (v3 == null) this.removeAttributeNS(fullname.space, fullname.local); + else this.setAttributeNS(fullname.space, fullname.local, v3); + }; } - function throwWarning(state2, message) { - if (state2.onWarning) { - state2.onWarning.call(null, generateError(state2, message)); + function attr_default(name, value2) { + var fullname = namespace_default(name); + if (arguments.length < 2) { + var node2 = this.node(); + return fullname.local ? node2.getAttributeNS(fullname.space, fullname.local) : node2.getAttribute(fullname); } + return this.each((value2 == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value2 === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value2)); } - var directiveHandlers = { - YAML: function handleYamlDirective(state2, name, args) { - var match, major, minor; - if (state2.version !== null) { - throwError(state2, "duplication of %YAML directive"); - } - if (args.length !== 1) { - throwError(state2, "YAML directive accepts exactly one argument"); - } - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - if (match === null) { - throwError(state2, "ill-formed argument of the YAML directive"); - } - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - if (major !== 1) { - throwError(state2, "unacceptable YAML version of the document"); - } - state2.version = args[0]; - state2.checkLineBreaks = minor < 2; - if (minor !== 1 && minor !== 2) { - throwWarning(state2, "unsupported YAML version of the document"); - } - }, - TAG: function handleTagDirective(state2, name, args) { - var handle, prefix; - if (args.length !== 2) { - throwError(state2, "TAG directive accepts exactly two arguments"); - } - handle = args[0]; - prefix = args[1]; - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state2, "ill-formed tag handle (first argument) of the TAG directive"); - } - if (_hasOwnProperty$1.call(state2.tagMap, handle)) { - throwError(state2, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state2, "ill-formed tag prefix (second argument) of the TAG directive"); - } - try { - prefix = decodeURIComponent(prefix); - } catch (err) { - throwError(state2, "tag prefix is malformed: " + prefix); - } - state2.tagMap[handle] = prefix; + var init_attr = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js"() { + "use strict"; + init_namespace(); + __name(attrRemove, "attrRemove"); + __name(attrRemoveNS, "attrRemoveNS"); + __name(attrConstant, "attrConstant"); + __name(attrConstantNS, "attrConstantNS"); + __name(attrFunction, "attrFunction"); + __name(attrFunctionNS, "attrFunctionNS"); + __name(attr_default, "default"); } - }; - function captureSegment(state2, start2, end2, checkJson) { - var _position, _length, _character, _result; - if (start2 < end2) { - _result = state2.input.slice(start2, end2); - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { - throwError(state2, "expected valid JSON character"); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state2, "the stream contains non-printable characters"); - } - state2.result += _result; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js + function window_default(node2) { + return node2.ownerDocument && node2.ownerDocument.defaultView || node2.document && node2 || node2.defaultView; + } + var init_window = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js"() { + "use strict"; + __name(window_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js + function styleRemove(name) { + return function() { + this.style.removeProperty(name); + }; } - function mergeMappings(state2, destination, source, overridableKeys) { - var sourceKeys, key, index2, quantity; - if (!common.isObject(source)) { - throwError(state2, "cannot merge mappings; the provided source object is unacceptable"); + function styleConstant(name, value2, priority3) { + return function() { + this.style.setProperty(name, value2, priority3); + }; + } + function styleFunction(name, value2, priority3) { + return function() { + var v3 = value2.apply(this, arguments); + if (v3 == null) this.style.removeProperty(name); + else this.style.setProperty(name, v3, priority3); + }; + } + function style_default(name, value2, priority3) { + return arguments.length > 1 ? this.each((value2 == null ? styleRemove : typeof value2 === "function" ? styleFunction : styleConstant)(name, value2, priority3 == null ? "" : priority3)) : styleValue(this.node(), name); + } + function styleValue(node2, name) { + return node2.style.getPropertyValue(name) || window_default(node2).getComputedStyle(node2, null).getPropertyValue(name); + } + var init_style = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js"() { + "use strict"; + init_window(); + __name(styleRemove, "styleRemove"); + __name(styleConstant, "styleConstant"); + __name(styleFunction, "styleFunction"); + __name(style_default, "default"); + __name(styleValue, "styleValue"); } - sourceKeys = Object.keys(source); - for (index2 = 0, quantity = sourceKeys.length; index2 < quantity; index2 += 1) { - key = sourceKeys[index2]; - if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; - } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js + function propertyRemove(name) { + return function() { + delete this[name]; + }; + } + function propertyConstant(name, value2) { + return function() { + this[name] = value2; + }; + } + function propertyFunction(name, value2) { + return function() { + var v3 = value2.apply(this, arguments); + if (v3 == null) delete this[name]; + else this[name] = v3; + }; + } + function property_default(name, value2) { + return arguments.length > 1 ? this.each((value2 == null ? propertyRemove : typeof value2 === "function" ? propertyFunction : propertyConstant)(name, value2)) : this.node()[name]; + } + var init_property = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js"() { + "use strict"; + __name(propertyRemove, "propertyRemove"); + __name(propertyConstant, "propertyConstant"); + __name(propertyFunction, "propertyFunction"); + __name(property_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js + function classArray(string3) { + return string3.trim().split(/^|\s+/); } - function storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { - var index2, quantity; - if (Array.isArray(keyNode)) { - keyNode = Array.prototype.slice.call(keyNode); - for (index2 = 0, quantity = keyNode.length; index2 < quantity; index2 += 1) { - if (Array.isArray(keyNode[index2])) { - throwError(state2, "nested arrays are not supported inside keys"); - } - if (typeof keyNode === "object" && _class(keyNode[index2]) === "[object Object]") { - keyNode[index2] = "[object Object]"; - } - } + function classList(node2) { + return node2.classList || new ClassList(node2); + } + function ClassList(node2) { + this._node = node2; + this._names = classArray(node2.getAttribute("class") || ""); + } + function classedAdd(node2, names) { + var list2 = classList(node2), i2 = -1, n2 = names.length; + while (++i2 < n2) list2.add(names[i2]); + } + function classedRemove(node2, names) { + var list2 = classList(node2), i2 = -1, n2 = names.length; + while (++i2 < n2) list2.remove(names[i2]); + } + function classedTrue(names) { + return function() { + classedAdd(this, names); + }; + } + function classedFalse(names) { + return function() { + classedRemove(this, names); + }; + } + function classedFunction(names, value2) { + return function() { + (value2.apply(this, arguments) ? classedAdd : classedRemove)(this, names); + }; + } + function classed_default(name, value2) { + var names = classArray(name + ""); + if (arguments.length < 2) { + var list2 = classList(this.node()), i2 = -1, n2 = names.length; + while (++i2 < n2) if (!list2.contains(names[i2])) return false; + return true; } - if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") { - keyNode = "[object Object]"; + return this.each((typeof value2 === "function" ? classedFunction : value2 ? classedTrue : classedFalse)(names, value2)); + } + var init_classed = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js"() { + "use strict"; + __name(classArray, "classArray"); + __name(classList, "classList"); + __name(ClassList, "ClassList"); + ClassList.prototype = { + add: /* @__PURE__ */ __name(function(name) { + var i2 = this._names.indexOf(name); + if (i2 < 0) { + this._names.push(name); + this._node.setAttribute("class", this._names.join(" ")); + } + }, "add"), + remove: /* @__PURE__ */ __name(function(name) { + var i2 = this._names.indexOf(name); + if (i2 >= 0) { + this._names.splice(i2, 1); + this._node.setAttribute("class", this._names.join(" ")); + } + }, "remove"), + contains: /* @__PURE__ */ __name(function(name) { + return this._names.indexOf(name) >= 0; + }, "contains") + }; + __name(classedAdd, "classedAdd"); + __name(classedRemove, "classedRemove"); + __name(classedTrue, "classedTrue"); + __name(classedFalse, "classedFalse"); + __name(classedFunction, "classedFunction"); + __name(classed_default, "default"); } - keyNode = String(keyNode); - if (_result === null) { - _result = {}; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js + function textRemove() { + this.textContent = ""; + } + function textConstant(value2) { + return function() { + this.textContent = value2; + }; + } + function textFunction(value2) { + return function() { + var v3 = value2.apply(this, arguments); + this.textContent = v3 == null ? "" : v3; + }; + } + function text_default(value2) { + return arguments.length ? this.each(value2 == null ? textRemove : (typeof value2 === "function" ? textFunction : textConstant)(value2)) : this.node().textContent; + } + var init_text = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js"() { + "use strict"; + __name(textRemove, "textRemove"); + __name(textConstant, "textConstant"); + __name(textFunction, "textFunction"); + __name(text_default, "default"); } - if (keyTag === "tag:yaml.org,2002:merge") { - if (Array.isArray(valueNode)) { - for (index2 = 0, quantity = valueNode.length; index2 < quantity; index2 += 1) { - mergeMappings(state2, _result, valueNode[index2], overridableKeys); - } - } else { - mergeMappings(state2, _result, valueNode, overridableKeys); - } - } else { - if (!state2.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) { - state2.line = startLine || state2.line; - state2.lineStart = startLineStart || state2.lineStart; - state2.position = startPos || state2.position; - throwError(state2, "duplicated mapping key"); - } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } - delete overridableKeys[keyNode]; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js + function htmlRemove() { + this.innerHTML = ""; + } + function htmlConstant(value2) { + return function() { + this.innerHTML = value2; + }; + } + function htmlFunction(value2) { + return function() { + var v3 = value2.apply(this, arguments); + this.innerHTML = v3 == null ? "" : v3; + }; + } + function html_default(value2) { + return arguments.length ? this.each(value2 == null ? htmlRemove : (typeof value2 === "function" ? htmlFunction : htmlConstant)(value2)) : this.node().innerHTML; + } + var init_html = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js"() { + "use strict"; + __name(htmlRemove, "htmlRemove"); + __name(htmlConstant, "htmlConstant"); + __name(htmlFunction, "htmlFunction"); + __name(html_default, "default"); } - return _result; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js + function raise() { + if (this.nextSibling) this.parentNode.appendChild(this); } - function readLineBreak(state2) { - var ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 === 10) { - state2.position++; - } else if (ch2 === 13) { - state2.position++; - if (state2.input.charCodeAt(state2.position) === 10) { - state2.position++; - } - } else { - throwError(state2, "a line break is expected"); + function raise_default() { + return this.each(raise); + } + var init_raise = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js"() { + "use strict"; + __name(raise, "raise"); + __name(raise_default, "default"); } - state2.line += 1; - state2.lineStart = state2.position; - state2.firstTabInLine = -1; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js + function lower() { + if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); } - function skipSeparationSpace(state2, allowComments, checkIndent) { - var lineBreaks = 0, ch2 = state2.input.charCodeAt(state2.position); - while (ch2 !== 0) { - while (is_WHITE_SPACE(ch2)) { - if (ch2 === 9 && state2.firstTabInLine === -1) { - state2.firstTabInLine = state2.position; - } - ch2 = state2.input.charCodeAt(++state2.position); - } - if (allowComments && ch2 === 35) { - do { - ch2 = state2.input.charCodeAt(++state2.position); - } while (ch2 !== 10 && ch2 !== 13 && ch2 !== 0); - } - if (is_EOL(ch2)) { - readLineBreak(state2); - ch2 = state2.input.charCodeAt(state2.position); - lineBreaks++; - state2.lineIndent = 0; - while (ch2 === 32) { - state2.lineIndent++; - ch2 = state2.input.charCodeAt(++state2.position); - } - } else { - break; - } + function lower_default() { + return this.each(lower); + } + var init_lower = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js"() { + "use strict"; + __name(lower, "lower"); + __name(lower_default, "default"); } - if (checkIndent !== -1 && lineBreaks !== 0 && state2.lineIndent < checkIndent) { - throwWarning(state2, "deficient indentation"); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js + function append_default(name) { + var create2 = typeof name === "function" ? name : creator_default(name); + return this.select(function() { + return this.appendChild(create2.apply(this, arguments)); + }); + } + var init_append = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js"() { + "use strict"; + init_creator(); + __name(append_default, "default"); } - return lineBreaks; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js + function constantNull() { + return null; } - function testDocumentSeparator(state2) { - var _position = state2.position, ch2; - ch2 = state2.input.charCodeAt(_position); - if ((ch2 === 45 || ch2 === 46) && ch2 === state2.input.charCodeAt(_position + 1) && ch2 === state2.input.charCodeAt(_position + 2)) { - _position += 3; - ch2 = state2.input.charCodeAt(_position); - if (ch2 === 0 || is_WS_OR_EOL(ch2)) { - return true; - } + function insert_default(name, before) { + var create2 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before); + return this.select(function() { + return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null); + }); + } + var init_insert = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js"() { + "use strict"; + init_creator(); + init_selector(); + __name(constantNull, "constantNull"); + __name(insert_default, "default"); } - return false; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js + function remove() { + var parent4 = this.parentNode; + if (parent4) parent4.removeChild(this); } - function writeFoldedLines(state2, count) { - if (count === 1) { - state2.result += " "; - } else if (count > 1) { - state2.result += common.repeat("\n", count - 1); + function remove_default() { + return this.each(remove); + } + var init_remove = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js"() { + "use strict"; + __name(remove, "remove"); + __name(remove_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js + function selection_cloneShallow() { + var clone5 = this.cloneNode(false), parent4 = this.parentNode; + return parent4 ? parent4.insertBefore(clone5, this.nextSibling) : clone5; } - function readPlainScalar(state2, nodeIndent, withinFlowCollection) { - var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state2.kind, _result = state2.result, ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (is_WS_OR_EOL(ch2) || is_FLOW_INDICATOR(ch2) || ch2 === 35 || ch2 === 38 || ch2 === 42 || ch2 === 33 || ch2 === 124 || ch2 === 62 || ch2 === 39 || ch2 === 34 || ch2 === 37 || ch2 === 64 || ch2 === 96) { - return false; + function selection_cloneDeep() { + var clone5 = this.cloneNode(true), parent4 = this.parentNode; + return parent4 ? parent4.insertBefore(clone5, this.nextSibling) : clone5; + } + function clone_default(deep) { + return this.select(deep ? selection_cloneDeep : selection_cloneShallow); + } + var init_clone = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js"() { + "use strict"; + __name(selection_cloneShallow, "selection_cloneShallow"); + __name(selection_cloneDeep, "selection_cloneDeep"); + __name(clone_default, "default"); } - if (ch2 === 63 || ch2 === 45) { - following = state2.input.charCodeAt(state2.position + 1); - if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js + function datum_default(value2) { + return arguments.length ? this.property("__data__", value2) : this.node().__data__; + } + var init_datum = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js"() { + "use strict"; + __name(datum_default, "default"); } - state2.kind = "scalar"; - state2.result = ""; - captureStart = captureEnd = state2.position; - hasPendingContent = false; - while (ch2 !== 0) { - if (ch2 === 58) { - following = state2.input.charCodeAt(state2.position + 1); - if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - } else if (ch2 === 35) { - preceding = state2.input.charCodeAt(state2.position - 1); - if (is_WS_OR_EOL(preceding)) { - break; - } - } else if (state2.position === state2.lineStart && testDocumentSeparator(state2) || withinFlowCollection && is_FLOW_INDICATOR(ch2)) { - break; - } else if (is_EOL(ch2)) { - _line = state2.line; - _lineStart = state2.lineStart; - _lineIndent = state2.lineIndent; - skipSeparationSpace(state2, false, -1); - if (state2.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch2 = state2.input.charCodeAt(state2.position); - continue; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js + function contextListener(listener) { + return function(event3) { + listener.call(this, event3, this.__data__); + }; + } + function parseTypenames2(typenames) { + return typenames.trim().split(/^|\s+/).map(function(t4) { + var name = "", i2 = t4.indexOf("."); + if (i2 >= 0) name = t4.slice(i2 + 1), t4 = t4.slice(0, i2); + return { type: t4, name }; + }); + } + function onRemove(typename) { + return function() { + var on3 = this.__on; + if (!on3) return; + for (var j2 = 0, i2 = -1, m2 = on3.length, o2; j2 < m2; ++j2) { + if (o2 = on3[j2], (!typename.type || o2.type === typename.type) && o2.name === typename.name) { + this.removeEventListener(o2.type, o2.listener, o2.options); } else { - state2.position = captureEnd; - state2.line = _line; - state2.lineStart = _lineStart; - state2.lineIndent = _lineIndent; - break; + on3[++i2] = o2; } } - if (hasPendingContent) { - captureSegment(state2, captureStart, captureEnd, false); - writeFoldedLines(state2, state2.line - _line); - captureStart = captureEnd = state2.position; - hasPendingContent = false; - } - if (!is_WHITE_SPACE(ch2)) { - captureEnd = state2.position + 1; - } - ch2 = state2.input.charCodeAt(++state2.position); - } - captureSegment(state2, captureStart, captureEnd, false); - if (state2.result) { - return true; - } - state2.kind = _kind; - state2.result = _result; - return false; + if (++i2) on3.length = i2; + else delete this.__on; + }; } - function readSingleQuotedScalar(state2, nodeIndent) { - var ch2, captureStart, captureEnd; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 !== 39) { - return false; - } - state2.kind = "scalar"; - state2.result = ""; - state2.position++; - captureStart = captureEnd = state2.position; - while ((ch2 = state2.input.charCodeAt(state2.position)) !== 0) { - if (ch2 === 39) { - captureSegment(state2, captureStart, state2.position, true); - ch2 = state2.input.charCodeAt(++state2.position); - if (ch2 === 39) { - captureStart = state2.position; - state2.position++; - captureEnd = state2.position; - } else { - return true; + function onAdd(typename, value2, options3) { + return function() { + var on3 = this.__on, o2, listener = contextListener(value2); + if (on3) for (var j2 = 0, m2 = on3.length; j2 < m2; ++j2) { + if ((o2 = on3[j2]).type === typename.type && o2.name === typename.name) { + this.removeEventListener(o2.type, o2.listener, o2.options); + this.addEventListener(o2.type, o2.listener = listener, o2.options = options3); + o2.value = value2; + return; } - } else if (is_EOL(ch2)) { - captureSegment(state2, captureStart, captureEnd, true); - writeFoldedLines(state2, skipSeparationSpace(state2, false, nodeIndent)); - captureStart = captureEnd = state2.position; - } else if (state2.position === state2.lineStart && testDocumentSeparator(state2)) { - throwError(state2, "unexpected end of the document within a single quoted scalar"); - } else { - state2.position++; - captureEnd = state2.position; } - } - throwError(state2, "unexpected end of the stream within a single quoted scalar"); + this.addEventListener(typename.type, listener, options3); + o2 = { type: typename.type, name: typename.name, value: value2, listener, options: options3 }; + if (!on3) this.__on = [o2]; + else on3.push(o2); + }; } - function readDoubleQuotedScalar(state2, nodeIndent) { - var captureStart, captureEnd, hexLength, hexResult, tmp, ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 !== 34) { - return false; - } - state2.kind = "scalar"; - state2.result = ""; - state2.position++; - captureStart = captureEnd = state2.position; - while ((ch2 = state2.input.charCodeAt(state2.position)) !== 0) { - if (ch2 === 34) { - captureSegment(state2, captureStart, state2.position, true); - state2.position++; - return true; - } else if (ch2 === 92) { - captureSegment(state2, captureStart, state2.position, true); - ch2 = state2.input.charCodeAt(++state2.position); - if (is_EOL(ch2)) { - skipSeparationSpace(state2, false, nodeIndent); - } else if (ch2 < 256 && simpleEscapeCheck[ch2]) { - state2.result += simpleEscapeMap[ch2]; - state2.position++; - } else if ((tmp = escapedHexLen(ch2)) > 0) { - hexLength = tmp; - hexResult = 0; - for (; hexLength > 0; hexLength--) { - ch2 = state2.input.charCodeAt(++state2.position); - if ((tmp = fromHexCode(ch2)) >= 0) { - hexResult = (hexResult << 4) + tmp; - } else { - throwError(state2, "expected hexadecimal character"); - } + function on_default(typename, value2, options3) { + var typenames = parseTypenames2(typename + ""), i2, n2 = typenames.length, t4; + if (arguments.length < 2) { + var on3 = this.node().__on; + if (on3) for (var j2 = 0, m2 = on3.length, o2; j2 < m2; ++j2) { + for (i2 = 0, o2 = on3[j2]; i2 < n2; ++i2) { + if ((t4 = typenames[i2]).type === o2.type && t4.name === o2.name) { + return o2.value; } - state2.result += charFromCodepoint(hexResult); - state2.position++; - } else { - throwError(state2, "unknown escape sequence"); - } - captureStart = captureEnd = state2.position; - } else if (is_EOL(ch2)) { - captureSegment(state2, captureStart, captureEnd, true); - writeFoldedLines(state2, skipSeparationSpace(state2, false, nodeIndent)); - captureStart = captureEnd = state2.position; - } else if (state2.position === state2.lineStart && testDocumentSeparator(state2)) { - throwError(state2, "unexpected end of the document within a double quoted scalar"); - } else { - state2.position++; - captureEnd = state2.position; + } } + return; } - throwError(state2, "unexpected end of the stream within a double quoted scalar"); + on3 = value2 ? onAdd : onRemove; + for (i2 = 0; i2 < n2; ++i2) this.each(on3(typenames[i2], value2, options3)); + return this; } - function readFlowCollection(state2, nodeIndent) { - var readNext = true, _line, _lineStart, _pos, _tag = state2.tag, _result, _anchor = state2.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 === 91) { - terminator = 93; - isMapping = false; - _result = []; - } else if (ch2 === 123) { - terminator = 125; - isMapping = true; - _result = {}; - } else { - return false; - } - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = _result; - } - ch2 = state2.input.charCodeAt(++state2.position); - while (ch2 !== 0) { - skipSeparationSpace(state2, true, nodeIndent); - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 === terminator) { - state2.position++; - state2.tag = _tag; - state2.anchor = _anchor; - state2.kind = isMapping ? "mapping" : "sequence"; - state2.result = _result; - return true; - } else if (!readNext) { - throwError(state2, "missed comma between flow collection entries"); - } else if (ch2 === 44) { - throwError(state2, "expected the node content, but found ','"); - } - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - if (ch2 === 63) { - following = state2.input.charCodeAt(state2.position + 1); - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state2.position++; - skipSeparationSpace(state2, true, nodeIndent); - } - } - _line = state2.line; - _lineStart = state2.lineStart; - _pos = state2.position; - composeNode(state2, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state2.tag; - keyNode = state2.result; - skipSeparationSpace(state2, true, nodeIndent); - ch2 = state2.input.charCodeAt(state2.position); - if ((isExplicitPair || state2.line === _line) && ch2 === 58) { - isPair = true; - ch2 = state2.input.charCodeAt(++state2.position); - skipSeparationSpace(state2, true, nodeIndent); - composeNode(state2, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state2.result; - } - if (isMapping) { - storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); - } else if (isPair) { - _result.push(storeMappingPair(state2, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); - } else { - _result.push(keyNode); - } - skipSeparationSpace(state2, true, nodeIndent); - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 === 44) { - readNext = true; - ch2 = state2.input.charCodeAt(++state2.position); - } else { - readNext = false; - } + var init_on = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js"() { + "use strict"; + __name(contextListener, "contextListener"); + __name(parseTypenames2, "parseTypenames"); + __name(onRemove, "onRemove"); + __name(onAdd, "onAdd"); + __name(on_default, "default"); } - throwError(state2, "unexpected end of the stream within a flow collection"); - } - function readBlockScalar(state2, nodeIndent) { - var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 === 124) { - folding = false; - } else if (ch2 === 62) { - folding = true; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js + function dispatchEvent(node2, type3, params) { + var window3 = window_default(node2), event3 = window3.CustomEvent; + if (typeof event3 === "function") { + event3 = new event3(type3, params); } else { - return false; - } - state2.kind = "scalar"; - state2.result = ""; - while (ch2 !== 0) { - ch2 = state2.input.charCodeAt(++state2.position); - if (ch2 === 43 || ch2 === 45) { - if (CHOMPING_CLIP === chomping) { - chomping = ch2 === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state2, "repeat of a chomping mode identifier"); - } - } else if ((tmp = fromDecimalCode(ch2)) >= 0) { - if (tmp === 0) { - throwError(state2, "bad explicit indentation width of a block scalar; it cannot be less than one"); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state2, "repeat of an indentation width identifier"); - } - } else { - break; - } + event3 = window3.document.createEvent("Event"); + if (params) event3.initEvent(type3, params.bubbles, params.cancelable), event3.detail = params.detail; + else event3.initEvent(type3, false, false); } - if (is_WHITE_SPACE(ch2)) { - do { - ch2 = state2.input.charCodeAt(++state2.position); - } while (is_WHITE_SPACE(ch2)); - if (ch2 === 35) { - do { - ch2 = state2.input.charCodeAt(++state2.position); - } while (!is_EOL(ch2) && ch2 !== 0); - } + node2.dispatchEvent(event3); + } + function dispatchConstant(type3, params) { + return function() { + return dispatchEvent(this, type3, params); + }; + } + function dispatchFunction(type3, params) { + return function() { + return dispatchEvent(this, type3, params.apply(this, arguments)); + }; + } + function dispatch_default2(type3, params) { + return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type3, params)); + } + var init_dispatch2 = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js"() { + "use strict"; + init_window(); + __name(dispatchEvent, "dispatchEvent"); + __name(dispatchConstant, "dispatchConstant"); + __name(dispatchFunction, "dispatchFunction"); + __name(dispatch_default2, "default"); } - while (ch2 !== 0) { - readLineBreak(state2); - state2.lineIndent = 0; - ch2 = state2.input.charCodeAt(state2.position); - while ((!detectedIndent || state2.lineIndent < textIndent) && ch2 === 32) { - state2.lineIndent++; - ch2 = state2.input.charCodeAt(++state2.position); - } - if (!detectedIndent && state2.lineIndent > textIndent) { - textIndent = state2.lineIndent; - } - if (is_EOL(ch2)) { - emptyLines++; - continue; - } - if (state2.lineIndent < textIndent) { - if (chomping === CHOMPING_KEEP) { - state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { - state2.result += "\n"; - } - } - break; - } - if (folding) { - if (is_WHITE_SPACE(ch2)) { - atMoreIndented = true; - state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); - } else if (atMoreIndented) { - atMoreIndented = false; - state2.result += common.repeat("\n", emptyLines + 1); - } else if (emptyLines === 0) { - if (didReadContent) { - state2.result += " "; - } - } else { - state2.result += common.repeat("\n", emptyLines); - } - } else { - state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); - } - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state2.position; - while (!is_EOL(ch2) && ch2 !== 0) { - ch2 = state2.input.charCodeAt(++state2.position); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js + function* iterator_default() { + for (var groups = this._groups, j2 = 0, m2 = groups.length; j2 < m2; ++j2) { + for (var group2 = groups[j2], i2 = 0, n2 = group2.length, node2; i2 < n2; ++i2) { + if (node2 = group2[i2]) yield node2; } - captureSegment(state2, captureStart, state2.position, false); } - return true; } - function readBlockSequence(state2, nodeIndent) { - var _line, _tag = state2.tag, _anchor = state2.anchor, _result = [], following, detected = false, ch2; - if (state2.firstTabInLine !== -1) - return false; - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = _result; - } - ch2 = state2.input.charCodeAt(state2.position); - while (ch2 !== 0) { - if (state2.firstTabInLine !== -1) { - state2.position = state2.firstTabInLine; - throwError(state2, "tab characters must not be used in indentation"); - } - if (ch2 !== 45) { - break; - } - following = state2.input.charCodeAt(state2.position + 1); - if (!is_WS_OR_EOL(following)) { - break; - } - detected = true; - state2.position++; - if (skipSeparationSpace(state2, true, -1)) { - if (state2.lineIndent <= nodeIndent) { - _result.push(null); - ch2 = state2.input.charCodeAt(state2.position); - continue; - } - } - _line = state2.line; - composeNode(state2, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state2.result); - skipSeparationSpace(state2, true, -1); - ch2 = state2.input.charCodeAt(state2.position); - if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch2 !== 0) { - throwError(state2, "bad indentation of a sequence entry"); - } else if (state2.lineIndent < nodeIndent) { - break; - } + var init_iterator = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js"() { + "use strict"; + __name(iterator_default, "default"); } - if (detected) { - state2.tag = _tag; - state2.anchor = _anchor; - state2.kind = "sequence"; - state2.result = _result; - return true; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js + function Selection(groups, parents4) { + this._groups = groups; + this._parents = parents4; + } + function selection() { + return new Selection([[document.documentElement]], root); + } + function selection_selection() { + return this; + } + var root, selection_default; + var init_selection = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js"() { + "use strict"; + init_select(); + init_selectAll(); + init_selectChild(); + init_selectChildren(); + init_filter(); + init_data(); + init_enter(); + init_exit(); + init_join(); + init_merge(); + init_order(); + init_sort(); + init_call(); + init_nodes(); + init_node(); + init_size(); + init_empty(); + init_each(); + init_attr(); + init_style(); + init_property(); + init_classed(); + init_text(); + init_html(); + init_raise(); + init_lower(); + init_append(); + init_insert(); + init_remove(); + init_clone(); + init_datum(); + init_on(); + init_dispatch2(); + init_iterator(); + root = [null]; + __name(Selection, "Selection"); + __name(selection, "selection"); + __name(selection_selection, "selection_selection"); + Selection.prototype = selection.prototype = { + constructor: Selection, + select: select_default, + selectAll: selectAll_default, + selectChild: selectChild_default, + selectChildren: selectChildren_default, + filter: filter_default, + data: data_default, + enter: enter_default, + exit: exit_default, + join: join_default, + merge: merge_default, + selection: selection_selection, + order: order_default, + sort: sort_default, + call: call_default, + nodes: nodes_default, + node: node_default, + size: size_default, + empty: empty_default, + each: each_default, + attr: attr_default, + style: style_default, + property: property_default, + classed: classed_default, + text: text_default, + html: html_default, + raise: raise_default, + lower: lower_default, + append: append_default, + insert: insert_default, + remove: remove_default, + clone: clone_default, + datum: datum_default, + on: on_default, + dispatch: dispatch_default2, + [Symbol.iterator]: iterator_default + }; + selection_default = selection; } - return false; + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js + function select_default2(selector) { + return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root); } - function readBlockMapping(state2, nodeIndent, flowIndent) { - var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state2.tag, _anchor = state2.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch2; - if (state2.firstTabInLine !== -1) - return false; - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = _result; - } - ch2 = state2.input.charCodeAt(state2.position); - while (ch2 !== 0) { - if (!atExplicitKey && state2.firstTabInLine !== -1) { - state2.position = state2.firstTabInLine; - throwError(state2, "tab characters must not be used in indentation"); - } - following = state2.input.charCodeAt(state2.position + 1); - _line = state2.line; - if ((ch2 === 63 || ch2 === 58) && is_WS_OR_EOL(following)) { - if (ch2 === 63) { - if (atExplicitKey) { - storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } - detected = true; - atExplicitKey = true; - allowCompact = true; - } else if (atExplicitKey) { - atExplicitKey = false; - allowCompact = true; - } else { - throwError(state2, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); - } - state2.position += 1; - ch2 = following; - } else { - _keyLine = state2.line; - _keyLineStart = state2.lineStart; - _keyPos = state2.position; - if (!composeNode(state2, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - break; - } - if (state2.line === _line) { - ch2 = state2.input.charCodeAt(state2.position); - while (is_WHITE_SPACE(ch2)) { - ch2 = state2.input.charCodeAt(++state2.position); - } - if (ch2 === 58) { - ch2 = state2.input.charCodeAt(++state2.position); - if (!is_WS_OR_EOL(ch2)) { - throwError(state2, "a whitespace character is expected after the key-value separator within a block mapping"); - } - if (atExplicitKey) { - storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state2.tag; - keyNode = state2.result; - } else if (detected) { - throwError(state2, "can not read an implicit mapping pair; a colon is missed"); - } else { - state2.tag = _tag; - state2.anchor = _anchor; - return true; - } - } else if (detected) { - throwError(state2, "can not read a block mapping entry; a multiline key may not be an implicit key"); - } else { - state2.tag = _tag; - state2.anchor = _anchor; - return true; - } - } - if (state2.line === _line || state2.lineIndent > nodeIndent) { - if (atExplicitKey) { - _keyLine = state2.line; - _keyLineStart = state2.lineStart; - _keyPos = state2.position; - } - if (composeNode(state2, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state2.result; - } else { - valueNode = state2.result; - } - } - if (!atExplicitKey) { - storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } - skipSeparationSpace(state2, true, -1); - ch2 = state2.input.charCodeAt(state2.position); - } - if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch2 !== 0) { - throwError(state2, "bad indentation of a mapping entry"); - } else if (state2.lineIndent < nodeIndent) { - break; - } + var init_select2 = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js"() { + "use strict"; + init_selection(); + __name(select_default2, "default"); } - if (atExplicitKey) { - storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + }); + + // ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/index.js + var init_src5 = __esm({ + "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/index.js"() { + "use strict"; + init_matcher(); + init_namespace(); + init_select2(); + init_selection(); + init_selector(); + init_selectorAll(); + init_style(); } - if (detected) { - state2.tag = _tag; - state2.anchor = _anchor; - state2.kind = "mapping"; - state2.result = _result; + }); + + // ../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/index.js + var init_src6 = __esm({ + "../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/index.js"() { + "use strict"; } - return detected; + }); + + // ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js + function define_default(constructor, factory, prototype) { + constructor.prototype = factory.prototype = prototype; + prototype.constructor = constructor; } - function readTagProperty(state2) { - var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 !== 33) - return false; - if (state2.tag !== null) { - throwError(state2, "duplication of a tag property"); - } - ch2 = state2.input.charCodeAt(++state2.position); - if (ch2 === 60) { - isVerbatim = true; - ch2 = state2.input.charCodeAt(++state2.position); - } else if (ch2 === 33) { - isNamed = true; - tagHandle = "!!"; - ch2 = state2.input.charCodeAt(++state2.position); - } else { - tagHandle = "!"; + function extend(parent4, definition) { + var prototype = Object.create(parent4.prototype); + for (var key in definition) prototype[key] = definition[key]; + return prototype; + } + var init_define = __esm({ + "../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js"() { + "use strict"; + __name(define_default, "default"); + __name(extend, "extend"); } - _position = state2.position; - if (isVerbatim) { - do { - ch2 = state2.input.charCodeAt(++state2.position); - } while (ch2 !== 0 && ch2 !== 62); - if (state2.position < state2.length) { - tagName = state2.input.slice(_position, state2.position); - ch2 = state2.input.charCodeAt(++state2.position); - } else { - throwError(state2, "unexpected end of the stream within a verbatim tag"); - } - } else { - while (ch2 !== 0 && !is_WS_OR_EOL(ch2)) { - if (ch2 === 33) { - if (!isNamed) { - tagHandle = state2.input.slice(_position - 1, state2.position + 1); - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state2, "named tag handle cannot contain such characters"); - } - isNamed = true; - _position = state2.position + 1; - } else { - throwError(state2, "tag suffix cannot contain exclamation marks"); - } - } - ch2 = state2.input.charCodeAt(++state2.position); - } - tagName = state2.input.slice(_position, state2.position); - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state2, "tag suffix cannot contain flow indicator characters"); - } + }); + + // ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js + function Color2() { + } + function color_formatHex() { + return this.rgb().formatHex(); + } + function color_formatHex8() { + return this.rgb().formatHex8(); + } + function color_formatHsl() { + return hslConvert(this).formatHsl(); + } + function color_formatRgb() { + return this.rgb().formatRgb(); + } + function color(format3) { + var m2, l2; + format3 = (format3 + "").trim().toLowerCase(); + return (m2 = reHex.exec(format3)) ? (l2 = m2[1].length, m2 = parseInt(m2[1], 16), l2 === 6 ? rgbn(m2) : l2 === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l2 === 8 ? rgba2(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l2 === 4 ? rgba2(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format3)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format3)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format3)) ? rgba2(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format3)) ? rgba2(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format3)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format3)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format3) ? rgbn(named[format3]) : format3 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; + } + function rgbn(n2) { + return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1); + } + function rgba2(r2, g2, b2, a2) { + if (a2 <= 0) r2 = g2 = b2 = NaN; + return new Rgb(r2, g2, b2, a2); + } + function rgbConvert(o2) { + if (!(o2 instanceof Color2)) o2 = color(o2); + if (!o2) return new Rgb(); + o2 = o2.rgb(); + return new Rgb(o2.r, o2.g, o2.b, o2.opacity); + } + function rgb(r2, g2, b2, opacity) { + return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g2, b2, opacity == null ? 1 : opacity); + } + function Rgb(r2, g2, b2, opacity) { + this.r = +r2; + this.g = +g2; + this.b = +b2; + this.opacity = +opacity; + } + function rgb_formatHex() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; + } + function rgb_formatHex8() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; + } + function rgb_formatRgb() { + const a2 = clampa(this.opacity); + return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`; + } + function clampa(opacity) { + return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity)); + } + function clampi(value2) { + return Math.max(0, Math.min(255, Math.round(value2) || 0)); + } + function hex(value2) { + value2 = clampi(value2); + return (value2 < 16 ? "0" : "") + value2.toString(16); + } + function hsla(h2, s2, l2, a2) { + if (a2 <= 0) h2 = s2 = l2 = NaN; + else if (l2 <= 0 || l2 >= 1) h2 = s2 = NaN; + else if (s2 <= 0) h2 = NaN; + return new Hsl(h2, s2, l2, a2); + } + function hslConvert(o2) { + if (o2 instanceof Hsl) return new Hsl(o2.h, o2.s, o2.l, o2.opacity); + if (!(o2 instanceof Color2)) o2 = color(o2); + if (!o2) return new Hsl(); + if (o2 instanceof Hsl) return o2; + o2 = o2.rgb(); + var r2 = o2.r / 255, g2 = o2.g / 255, b2 = o2.b / 255, min9 = Math.min(r2, g2, b2), max10 = Math.max(r2, g2, b2), h2 = NaN, s2 = max10 - min9, l2 = (max10 + min9) / 2; + if (s2) { + if (r2 === max10) h2 = (g2 - b2) / s2 + (g2 < b2) * 6; + else if (g2 === max10) h2 = (b2 - r2) / s2 + 2; + else h2 = (r2 - g2) / s2 + 4; + s2 /= l2 < 0.5 ? max10 + min9 : 2 - max10 - min9; + h2 *= 60; + } else { + s2 = l2 > 0 && l2 < 1 ? 0 : h2; } - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state2, "tag name cannot contain such characters: " + tagName); + return new Hsl(h2, s2, l2, o2.opacity); + } + function hsl(h2, s2, l2, opacity) { + return arguments.length === 1 ? hslConvert(h2) : new Hsl(h2, s2, l2, opacity == null ? 1 : opacity); + } + function Hsl(h2, s2, l2, opacity) { + this.h = +h2; + this.s = +s2; + this.l = +l2; + this.opacity = +opacity; + } + function clamph(value2) { + value2 = (value2 || 0) % 360; + return value2 < 0 ? value2 + 360 : value2; + } + function clampt(value2) { + return Math.max(0, Math.min(1, value2 || 0)); + } + function hsl2rgb(h2, m1, m2) { + return (h2 < 60 ? m1 + (m2 - m1) * h2 / 60 : h2 < 180 ? m2 : h2 < 240 ? m1 + (m2 - m1) * (240 - h2) / 60 : m1) * 255; + } + var darker, brighter, reI, reN, reP, reHex, reRgbInteger, reRgbPercent, reRgbaInteger, reRgbaPercent, reHslPercent, reHslaPercent, named; + var init_color2 = __esm({ + "../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js"() { + "use strict"; + init_define(); + __name(Color2, "Color"); + darker = 0.7; + brighter = 1 / darker; + reI = "\\s*([+-]?\\d+)\\s*"; + reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*"; + reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*"; + reHex = /^#([0-9a-f]{3,8})$/; + reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`); + reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`); + reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`); + reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`); + reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`); + reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); + named = { + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + rebeccapurple: 6697881, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 + }; + define_default(Color2, color, { + copy(channels2) { + return Object.assign(new this.constructor(), this, channels2); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: color_formatHex, + // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHex8: color_formatHex8, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb + }); + __name(color_formatHex, "color_formatHex"); + __name(color_formatHex8, "color_formatHex8"); + __name(color_formatHsl, "color_formatHsl"); + __name(color_formatRgb, "color_formatRgb"); + __name(color, "color"); + __name(rgbn, "rgbn"); + __name(rgba2, "rgba"); + __name(rgbConvert, "rgbConvert"); + __name(rgb, "rgb"); + __name(Rgb, "Rgb"); + define_default(Rgb, rgb, extend(Color2, { + brighter(k2) { + k2 = k2 == null ? brighter : Math.pow(brighter, k2); + return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); + }, + darker(k2) { + k2 = k2 == null ? darker : Math.pow(darker, k2); + return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); + }, + displayable() { + return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1); + }, + hex: rgb_formatHex, + // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatHex8: rgb_formatHex8, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb + })); + __name(rgb_formatHex, "rgb_formatHex"); + __name(rgb_formatHex8, "rgb_formatHex8"); + __name(rgb_formatRgb, "rgb_formatRgb"); + __name(clampa, "clampa"); + __name(clampi, "clampi"); + __name(hex, "hex"); + __name(hsla, "hsla"); + __name(hslConvert, "hslConvert"); + __name(hsl, "hsl"); + __name(Hsl, "Hsl"); + define_default(Hsl, hsl, extend(Color2, { + brighter(k2) { + k2 = k2 == null ? brighter : Math.pow(brighter, k2); + return new Hsl(this.h, this.s, this.l * k2, this.opacity); + }, + darker(k2) { + k2 = k2 == null ? darker : Math.pow(darker, k2); + return new Hsl(this.h, this.s, this.l * k2, this.opacity); + }, + rgb() { + var h2 = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h2) || isNaN(this.s) ? 0 : this.s, l2 = this.l, m2 = l2 + (l2 < 0.5 ? l2 : 1 - l2) * s2, m1 = 2 * l2 - m2; + return new Rgb( + hsl2rgb(h2 >= 240 ? h2 - 240 : h2 + 120, m1, m2), + hsl2rgb(h2, m1, m2), + hsl2rgb(h2 < 120 ? h2 + 240 : h2 - 120, m1, m2), + this.opacity + ); + }, + clamp() { + return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); + }, + displayable() { + return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1); + }, + formatHsl() { + const a2 = clampa(this.opacity); + return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`; + } + })); + __name(clamph, "clamph"); + __name(clampt, "clampt"); + __name(hsl2rgb, "hsl2rgb"); } - try { - tagName = decodeURIComponent(tagName); - } catch (err) { - throwError(state2, "tag name is malformed: " + tagName); + }); + + // ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/math.js + var radians, degrees; + var init_math = __esm({ + "../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/math.js"() { + "use strict"; + radians = Math.PI / 180; + degrees = 180 / Math.PI; } - if (isVerbatim) { - state2.tag = tagName; - } else if (_hasOwnProperty$1.call(state2.tagMap, tagHandle)) { - state2.tag = state2.tagMap[tagHandle] + tagName; - } else if (tagHandle === "!") { - state2.tag = "!" + tagName; - } else if (tagHandle === "!!") { - state2.tag = "tag:yaml.org,2002:" + tagName; - } else { - throwError(state2, 'undeclared tag handle "' + tagHandle + '"'); + }); + + // ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/lab.js + function labConvert(o2) { + if (o2 instanceof Lab) return new Lab(o2.l, o2.a, o2.b, o2.opacity); + if (o2 instanceof Hcl) return hcl2lab(o2); + if (!(o2 instanceof Rgb)) o2 = rgbConvert(o2); + var r2 = rgb2lrgb(o2.r), g2 = rgb2lrgb(o2.g), b2 = rgb2lrgb(o2.b), y5 = xyz2lab((0.2225045 * r2 + 0.7168786 * g2 + 0.0606169 * b2) / Yn), x5, z2; + if (r2 === g2 && g2 === b2) x5 = z2 = y5; + else { + x5 = xyz2lab((0.4360747 * r2 + 0.3850649 * g2 + 0.1430804 * b2) / Xn); + z2 = xyz2lab((0.0139322 * r2 + 0.0971045 * g2 + 0.7141733 * b2) / Zn); } - return true; + return new Lab(116 * y5 - 16, 500 * (x5 - y5), 200 * (y5 - z2), o2.opacity); } - function readAnchorProperty(state2) { - var _position, ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 !== 38) - return false; - if (state2.anchor !== null) { - throwError(state2, "duplication of an anchor property"); - } - ch2 = state2.input.charCodeAt(++state2.position); - _position = state2.position; - while (ch2 !== 0 && !is_WS_OR_EOL(ch2) && !is_FLOW_INDICATOR(ch2)) { - ch2 = state2.input.charCodeAt(++state2.position); + function lab(l2, a2, b2, opacity) { + return arguments.length === 1 ? labConvert(l2) : new Lab(l2, a2, b2, opacity == null ? 1 : opacity); + } + function Lab(l2, a2, b2, opacity) { + this.l = +l2; + this.a = +a2; + this.b = +b2; + this.opacity = +opacity; + } + function xyz2lab(t4) { + return t4 > t3 ? Math.pow(t4, 1 / 3) : t4 / t2 + t0; + } + function lab2xyz(t4) { + return t4 > t1 ? t4 * t4 * t4 : t2 * (t4 - t0); + } + function lrgb2rgb(x5) { + return 255 * (x5 <= 31308e-7 ? 12.92 * x5 : 1.055 * Math.pow(x5, 1 / 2.4) - 0.055); + } + function rgb2lrgb(x5) { + return (x5 /= 255) <= 0.04045 ? x5 / 12.92 : Math.pow((x5 + 0.055) / 1.055, 2.4); + } + function hclConvert(o2) { + if (o2 instanceof Hcl) return new Hcl(o2.h, o2.c, o2.l, o2.opacity); + if (!(o2 instanceof Lab)) o2 = labConvert(o2); + if (o2.a === 0 && o2.b === 0) return new Hcl(NaN, 0 < o2.l && o2.l < 100 ? 0 : NaN, o2.l, o2.opacity); + var h2 = Math.atan2(o2.b, o2.a) * degrees; + return new Hcl(h2 < 0 ? h2 + 360 : h2, Math.sqrt(o2.a * o2.a + o2.b * o2.b), o2.l, o2.opacity); + } + function hcl(h2, c3, l2, opacity) { + return arguments.length === 1 ? hclConvert(h2) : new Hcl(h2, c3, l2, opacity == null ? 1 : opacity); + } + function Hcl(h2, c3, l2, opacity) { + this.h = +h2; + this.c = +c3; + this.l = +l2; + this.opacity = +opacity; + } + function hcl2lab(o2) { + if (isNaN(o2.h)) return new Lab(o2.l, 0, 0, o2.opacity); + var h2 = o2.h * radians; + return new Lab(o2.l, Math.cos(h2) * o2.c, Math.sin(h2) * o2.c, o2.opacity); + } + var K, Xn, Yn, Zn, t0, t1, t2, t3; + var init_lab = __esm({ + "../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/lab.js"() { + "use strict"; + init_define(); + init_color2(); + init_math(); + K = 18; + Xn = 0.96422; + Yn = 1; + Zn = 0.82521; + t0 = 4 / 29; + t1 = 6 / 29; + t2 = 3 * t1 * t1; + t3 = t1 * t1 * t1; + __name(labConvert, "labConvert"); + __name(lab, "lab"); + __name(Lab, "Lab"); + define_default(Lab, lab, extend(Color2, { + brighter(k2) { + return new Lab(this.l + K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity); + }, + darker(k2) { + return new Lab(this.l - K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity); + }, + rgb() { + var y5 = (this.l + 16) / 116, x5 = isNaN(this.a) ? y5 : y5 + this.a / 500, z2 = isNaN(this.b) ? y5 : y5 - this.b / 200; + x5 = Xn * lab2xyz(x5); + y5 = Yn * lab2xyz(y5); + z2 = Zn * lab2xyz(z2); + return new Rgb( + lrgb2rgb(3.1338561 * x5 - 1.6168667 * y5 - 0.4906146 * z2), + lrgb2rgb(-0.9787684 * x5 + 1.9161415 * y5 + 0.033454 * z2), + lrgb2rgb(0.0719453 * x5 - 0.2289914 * y5 + 1.4052427 * z2), + this.opacity + ); + } + })); + __name(xyz2lab, "xyz2lab"); + __name(lab2xyz, "lab2xyz"); + __name(lrgb2rgb, "lrgb2rgb"); + __name(rgb2lrgb, "rgb2lrgb"); + __name(hclConvert, "hclConvert"); + __name(hcl, "hcl"); + __name(Hcl, "Hcl"); + __name(hcl2lab, "hcl2lab"); + define_default(Hcl, hcl, extend(Color2, { + brighter(k2) { + return new Hcl(this.h, this.c, this.l + K * (k2 == null ? 1 : k2), this.opacity); + }, + darker(k2) { + return new Hcl(this.h, this.c, this.l - K * (k2 == null ? 1 : k2), this.opacity); + }, + rgb() { + return hcl2lab(this).rgb(); + } + })); } - if (state2.position === _position) { - throwError(state2, "name of an anchor node must contain at least one character"); + }); + + // ../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/index.js + var init_src7 = __esm({ + "../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/index.js"() { + "use strict"; + init_color2(); + init_lab(); } - state2.anchor = state2.input.slice(_position, state2.position); - return true; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basis.js + function basis(t13, v0, v12, v22, v3) { + var t22 = t13 * t13, t32 = t22 * t13; + return ((1 - 3 * t13 + 3 * t22 - t32) * v0 + (4 - 6 * t22 + 3 * t32) * v12 + (1 + 3 * t13 + 3 * t22 - 3 * t32) * v22 + t32 * v3) / 6; + } + function basis_default(values2) { + var n2 = values2.length - 1; + return function(t4) { + var i2 = t4 <= 0 ? t4 = 0 : t4 >= 1 ? (t4 = 1, n2 - 1) : Math.floor(t4 * n2), v12 = values2[i2], v22 = values2[i2 + 1], v0 = i2 > 0 ? values2[i2 - 1] : 2 * v12 - v22, v3 = i2 < n2 - 1 ? values2[i2 + 2] : 2 * v22 - v12; + return basis((t4 - i2 / n2) * n2, v0, v12, v22, v3); + }; } - function readAlias(state2) { - var _position, alias, ch2; - ch2 = state2.input.charCodeAt(state2.position); - if (ch2 !== 42) - return false; - ch2 = state2.input.charCodeAt(++state2.position); - _position = state2.position; - while (ch2 !== 0 && !is_WS_OR_EOL(ch2) && !is_FLOW_INDICATOR(ch2)) { - ch2 = state2.input.charCodeAt(++state2.position); + var init_basis = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basis.js"() { + "use strict"; + __name(basis, "basis"); + __name(basis_default, "default"); } - if (state2.position === _position) { - throwError(state2, "name of an alias node must contain at least one character"); + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basisClosed.js + function basisClosed_default(values2) { + var n2 = values2.length; + return function(t4) { + var i2 = Math.floor(((t4 %= 1) < 0 ? ++t4 : t4) * n2), v0 = values2[(i2 + n2 - 1) % n2], v12 = values2[i2 % n2], v22 = values2[(i2 + 1) % n2], v3 = values2[(i2 + 2) % n2]; + return basis((t4 - i2 / n2) * n2, v0, v12, v22, v3); + }; + } + var init_basisClosed = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basisClosed.js"() { + "use strict"; + init_basis(); + __name(basisClosed_default, "default"); } - alias = state2.input.slice(_position, state2.position); - if (!_hasOwnProperty$1.call(state2.anchorMap, alias)) { - throwError(state2, 'unidentified alias "' + alias + '"'); + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js + var constant_default2; + var init_constant2 = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js"() { + "use strict"; + constant_default2 = /* @__PURE__ */ __name((x5) => () => x5, "default"); } - state2.result = state2.anchorMap[alias]; - skipSeparationSpace(state2, true, -1); - return true; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js + function linear(a2, d2) { + return function(t4) { + return a2 + t4 * d2; + }; + } + function exponential(a2, b2, y5) { + return a2 = Math.pow(a2, y5), b2 = Math.pow(b2, y5) - a2, y5 = 1 / y5, function(t4) { + return Math.pow(a2 + t4 * b2, y5); + }; } - function composeNode(state2, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent; - if (state2.listener !== null) { - state2.listener("open", state2); + function hue(a2, b2) { + var d2 = b2 - a2; + return d2 ? linear(a2, d2 > 180 || d2 < -180 ? d2 - 360 * Math.round(d2 / 360) : d2) : constant_default2(isNaN(a2) ? b2 : a2); + } + function gamma(y5) { + return (y5 = +y5) === 1 ? nogamma : function(a2, b2) { + return b2 - a2 ? exponential(a2, b2, y5) : constant_default2(isNaN(a2) ? b2 : a2); + }; + } + function nogamma(a2, b2) { + var d2 = b2 - a2; + return d2 ? linear(a2, d2) : constant_default2(isNaN(a2) ? b2 : a2); + } + var init_color3 = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js"() { + "use strict"; + init_constant2(); + __name(linear, "linear"); + __name(exponential, "exponential"); + __name(hue, "hue"); + __name(gamma, "gamma"); + __name(nogamma, "nogamma"); } - state2.tag = null; - state2.anchor = null; - state2.kind = null; - state2.result = null; - allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; - if (allowToSeek) { - if (skipSeparationSpace(state2, true, -1)) { - atNewLine = true; - if (state2.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state2.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state2.lineIndent < parentIndent) { - indentStatus = -1; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js + function rgbSpline(spline) { + return function(colors2) { + var n2 = colors2.length, r2 = new Array(n2), g2 = new Array(n2), b2 = new Array(n2), i2, color2; + for (i2 = 0; i2 < n2; ++i2) { + color2 = rgb(colors2[i2]); + r2[i2] = color2.r || 0; + g2[i2] = color2.g || 0; + b2[i2] = color2.b || 0; + } + r2 = spline(r2); + g2 = spline(g2); + b2 = spline(b2); + color2.opacity = 1; + return function(t4) { + color2.r = r2(t4); + color2.g = g2(t4); + color2.b = b2(t4); + return color2 + ""; + }; + }; + } + var rgb_default2, rgbBasis, rgbBasisClosed; + var init_rgb2 = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js"() { + "use strict"; + init_src7(); + init_basis(); + init_basisClosed(); + init_color3(); + rgb_default2 = (/* @__PURE__ */ __name(function rgbGamma(y5) { + var color2 = gamma(y5); + function rgb2(start3, end2) { + var r2 = color2((start3 = rgb(start3)).r, (end2 = rgb(end2)).r), g2 = color2(start3.g, end2.g), b2 = color2(start3.b, end2.b), opacity = nogamma(start3.opacity, end2.opacity); + return function(t4) { + start3.r = r2(t4); + start3.g = g2(t4); + start3.b = b2(t4); + start3.opacity = opacity(t4); + return start3 + ""; + }; } - } + __name(rgb2, "rgb"); + rgb2.gamma = rgbGamma; + return rgb2; + }, "rgbGamma"))(1); + __name(rgbSpline, "rgbSpline"); + rgbBasis = rgbSpline(basis_default); + rgbBasisClosed = rgbSpline(basisClosed_default); } - if (indentStatus === 1) { - while (readTagProperty(state2) || readAnchorProperty(state2)) { - if (skipSeparationSpace(state2, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - if (state2.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state2.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state2.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js + function numberArray_default(a2, b2) { + if (!b2) b2 = []; + var n2 = a2 ? Math.min(b2.length, a2.length) : 0, c3 = b2.slice(), i2; + return function(t4) { + for (i2 = 0; i2 < n2; ++i2) c3[i2] = a2[i2] * (1 - t4) + b2[i2] * t4; + return c3; + }; + } + function isNumberArray(x5) { + return ArrayBuffer.isView(x5) && !(x5 instanceof DataView); + } + var init_numberArray = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js"() { + "use strict"; + __name(numberArray_default, "default"); + __name(isNumberArray, "isNumberArray"); } - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js + function genericArray(a2, b2) { + var nb = b2 ? b2.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x5 = new Array(na), c3 = new Array(nb), i2; + for (i2 = 0; i2 < na; ++i2) x5[i2] = value_default(a2[i2], b2[i2]); + for (; i2 < nb; ++i2) c3[i2] = b2[i2]; + return function(t4) { + for (i2 = 0; i2 < na; ++i2) c3[i2] = x5[i2](t4); + return c3; + }; + } + var init_array2 = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js"() { + "use strict"; + init_value(); + __name(genericArray, "genericArray"); } - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - blockIndent = state2.position - state2.lineStart; - if (indentStatus === 1) { - if (allowBlockCollections && (readBlockSequence(state2, blockIndent) || readBlockMapping(state2, blockIndent, flowIndent)) || readFlowCollection(state2, flowIndent)) { - hasContent = true; - } else { - if (allowBlockScalars && readBlockScalar(state2, flowIndent) || readSingleQuotedScalar(state2, flowIndent) || readDoubleQuotedScalar(state2, flowIndent)) { - hasContent = true; - } else if (readAlias(state2)) { - hasContent = true; - if (state2.tag !== null || state2.anchor !== null) { - throwError(state2, "alias node should not have any properties"); - } - } else if (readPlainScalar(state2, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - if (state2.tag === null) { - state2.tag = "?"; - } - } - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = state2.result; - } - } - } else if (indentStatus === 0) { - hasContent = allowBlockCollections && readBlockSequence(state2, blockIndent); - } + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js + function date_default(a2, b2) { + var d2 = /* @__PURE__ */ new Date(); + return a2 = +a2, b2 = +b2, function(t4) { + return d2.setTime(a2 * (1 - t4) + b2 * t4), d2; + }; + } + var init_date = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js"() { + "use strict"; + __name(date_default, "default"); } - if (state2.tag === null) { - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = state2.result; - } - } else if (state2.tag === "?") { - if (state2.result !== null && state2.kind !== "scalar") { - throwError(state2, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state2.kind + '"'); - } - for (typeIndex = 0, typeQuantity = state2.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type2 = state2.implicitTypes[typeIndex]; - if (type2.resolve(state2.result)) { - state2.result = type2.construct(state2.result); - state2.tag = type2.tag; - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = state2.result; - } - break; - } - } - } else if (state2.tag !== "!") { - if (_hasOwnProperty$1.call(state2.typeMap[state2.kind || "fallback"], state2.tag)) { - type2 = state2.typeMap[state2.kind || "fallback"][state2.tag]; - } else { - type2 = null; - typeList = state2.typeMap.multi[state2.kind || "fallback"]; - for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { - if (state2.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { - type2 = typeList[typeIndex]; - break; - } - } - } - if (!type2) { - throwError(state2, "unknown tag !<" + state2.tag + ">"); - } - if (state2.result !== null && type2.kind !== state2.kind) { - throwError(state2, "unacceptable node kind for !<" + state2.tag + '> tag; it should be "' + type2.kind + '", not "' + state2.kind + '"'); - } - if (!type2.resolve(state2.result, state2.tag)) { - throwError(state2, "cannot resolve a node with !<" + state2.tag + "> explicit tag"); + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js + function number_default(a2, b2) { + return a2 = +a2, b2 = +b2, function(t4) { + return a2 * (1 - t4) + b2 * t4; + }; + } + var init_number2 = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js"() { + "use strict"; + __name(number_default, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js + function object_default(a2, b2) { + var i2 = {}, c3 = {}, k2; + if (a2 === null || typeof a2 !== "object") a2 = {}; + if (b2 === null || typeof b2 !== "object") b2 = {}; + for (k2 in b2) { + if (k2 in a2) { + i2[k2] = value_default(a2[k2], b2[k2]); } else { - state2.result = type2.construct(state2.result, state2.tag); - if (state2.anchor !== null) { - state2.anchorMap[state2.anchor] = state2.result; - } + c3[k2] = b2[k2]; } } - if (state2.listener !== null) { - state2.listener("close", state2); + return function(t4) { + for (k2 in i2) c3[k2] = i2[k2](t4); + return c3; + }; + } + var init_object = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js"() { + "use strict"; + init_value(); + __name(object_default, "default"); } - return state2.tag !== null || state2.anchor !== null || hasContent; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js + function zero2(b2) { + return function() { + return b2; + }; } - function readDocument(state2) { - var documentStart = state2.position, _position, directiveName, directiveArgs, hasDirectives = false, ch2; - state2.version = null; - state2.checkLineBreaks = state2.legacy; - state2.tagMap = /* @__PURE__ */ Object.create(null); - state2.anchorMap = /* @__PURE__ */ Object.create(null); - while ((ch2 = state2.input.charCodeAt(state2.position)) !== 0) { - skipSeparationSpace(state2, true, -1); - ch2 = state2.input.charCodeAt(state2.position); - if (state2.lineIndent > 0 || ch2 !== 37) { - break; - } - hasDirectives = true; - ch2 = state2.input.charCodeAt(++state2.position); - _position = state2.position; - while (ch2 !== 0 && !is_WS_OR_EOL(ch2)) { - ch2 = state2.input.charCodeAt(++state2.position); - } - directiveName = state2.input.slice(_position, state2.position); - directiveArgs = []; - if (directiveName.length < 1) { - throwError(state2, "directive name must not be less than one character in length"); - } - while (ch2 !== 0) { - while (is_WHITE_SPACE(ch2)) { - ch2 = state2.input.charCodeAt(++state2.position); - } - if (ch2 === 35) { - do { - ch2 = state2.input.charCodeAt(++state2.position); - } while (ch2 !== 0 && !is_EOL(ch2)); - break; - } - if (is_EOL(ch2)) - break; - _position = state2.position; - while (ch2 !== 0 && !is_WS_OR_EOL(ch2)) { - ch2 = state2.input.charCodeAt(++state2.position); - } - directiveArgs.push(state2.input.slice(_position, state2.position)); + function one(b2) { + return function(t4) { + return b2(t4) + ""; + }; + } + function string_default(a2, b2) { + var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s2 = [], q2 = []; + a2 = a2 + "", b2 = b2 + ""; + while ((am = reA.exec(a2)) && (bm = reB.exec(b2))) { + if ((bs = bm.index) > bi) { + bs = b2.slice(bi, bs); + if (s2[i2]) s2[i2] += bs; + else s2[++i2] = bs; } - if (ch2 !== 0) - readLineBreak(state2); - if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state2, directiveName, directiveArgs); + if ((am = am[0]) === (bm = bm[0])) { + if (s2[i2]) s2[i2] += bm; + else s2[++i2] = bm; } else { - throwWarning(state2, 'unknown document directive "' + directiveName + '"'); + s2[++i2] = null; + q2.push({ i: i2, x: number_default(am, bm) }); } + bi = reB.lastIndex; } - skipSeparationSpace(state2, true, -1); - if (state2.lineIndent === 0 && state2.input.charCodeAt(state2.position) === 45 && state2.input.charCodeAt(state2.position + 1) === 45 && state2.input.charCodeAt(state2.position + 2) === 45) { - state2.position += 3; - skipSeparationSpace(state2, true, -1); - } else if (hasDirectives) { - throwError(state2, "directives end mark is expected"); - } - composeNode(state2, state2.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state2, true, -1); - if (state2.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state2.input.slice(documentStart, state2.position))) { - throwWarning(state2, "non-ASCII line breaks are interpreted as content"); + if (bi < b2.length) { + bs = b2.slice(bi); + if (s2[i2]) s2[i2] += bs; + else s2[++i2] = bs; } - state2.documents.push(state2.result); - if (state2.position === state2.lineStart && testDocumentSeparator(state2)) { - if (state2.input.charCodeAt(state2.position) === 46) { - state2.position += 3; - skipSeparationSpace(state2, true, -1); - } - return; + return s2.length < 2 ? q2[0] ? one(q2[0].x) : zero2(b2) : (b2 = q2.length, function(t4) { + for (var i3 = 0, o2; i3 < b2; ++i3) s2[(o2 = q2[i3]).i] = o2.x(t4); + return s2.join(""); + }); + } + var reA, reB; + var init_string = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js"() { + "use strict"; + init_number2(); + reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; + reB = new RegExp(reA.source, "g"); + __name(zero2, "zero"); + __name(one, "one"); + __name(string_default, "default"); } - if (state2.position < state2.length - 1) { - throwError(state2, "end of the stream or a document separator is expected"); - } else { - return; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js + function value_default(a2, b2) { + var t4 = typeof b2, c3; + return b2 == null || t4 === "boolean" ? constant_default2(b2) : (t4 === "number" ? number_default : t4 === "string" ? (c3 = color(b2)) ? (b2 = c3, rgb_default2) : string_default : b2 instanceof color ? rgb_default2 : b2 instanceof Date ? date_default : isNumberArray(b2) ? numberArray_default : Array.isArray(b2) ? genericArray : typeof b2.valueOf !== "function" && typeof b2.toString !== "function" || isNaN(b2) ? object_default : number_default)(a2, b2); + } + var init_value = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js"() { + "use strict"; + init_src7(); + init_rgb2(); + init_array2(); + init_date(); + init_number2(); + init_object(); + init_string(); + init_constant2(); + init_numberArray(); + __name(value_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/round.js + function round_default(a2, b2) { + return a2 = +a2, b2 = +b2, function(t4) { + return Math.round(a2 * (1 - t4) + b2 * t4); + }; } - function loadDocuments(input, options2) { - input = String(input); - options2 = options2 || {}; - if (input.length !== 0) { - if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) { - input += "\n"; - } - if (input.charCodeAt(0) === 65279) { - input = input.slice(1); - } + var init_round = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/round.js"() { + "use strict"; + __name(round_default, "default"); } - var state2 = new State$1(input, options2); - var nullpos = input.indexOf("\0"); - if (nullpos !== -1) { - state2.position = nullpos; - throwError(state2, "null byte is not allowed in input"); + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js + function decompose_default(a2, b2, c3, d2, e3, f3) { + var scaleX, scaleY, skewX; + if (scaleX = Math.sqrt(a2 * a2 + b2 * b2)) a2 /= scaleX, b2 /= scaleX; + if (skewX = a2 * c3 + b2 * d2) c3 -= a2 * skewX, d2 -= b2 * skewX; + if (scaleY = Math.sqrt(c3 * c3 + d2 * d2)) c3 /= scaleY, d2 /= scaleY, skewX /= scaleY; + if (a2 * d2 < b2 * c3) a2 = -a2, b2 = -b2, skewX = -skewX, scaleX = -scaleX; + return { + translateX: e3, + translateY: f3, + rotate: Math.atan2(b2, a2) * degrees2, + skewX: Math.atan(skewX) * degrees2, + scaleX, + scaleY + }; + } + var degrees2, identity; + var init_decompose = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js"() { + "use strict"; + degrees2 = 180 / Math.PI; + identity = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 + }; + __name(decompose_default, "default"); } - state2.input += "\0"; - while (state2.input.charCodeAt(state2.position) === 32) { - state2.lineIndent += 1; - state2.position += 1; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js + function parseCss(value2) { + const m2 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value2 + ""); + return m2.isIdentity ? identity : decompose_default(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f); + } + function parseSvg(value2) { + if (value2 == null) return identity; + if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); + svgNode.setAttribute("transform", value2); + if (!(value2 = svgNode.transform.baseVal.consolidate())) return identity; + value2 = value2.matrix; + return decompose_default(value2.a, value2.b, value2.c, value2.d, value2.e, value2.f); + } + var svgNode; + var init_parse = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js"() { + "use strict"; + init_decompose(); + __name(parseCss, "parseCss"); + __name(parseSvg, "parseSvg"); } - while (state2.position < state2.length - 1) { - readDocument(state2); + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js + function interpolateTransform(parse8, pxComma, pxParen, degParen) { + function pop(s2) { + return s2.length ? s2.pop() + " " : ""; } - return state2.documents; - } - function loadAll$1(input, iterator, options2) { - if (iterator !== null && typeof iterator === "object" && typeof options2 === "undefined") { - options2 = iterator; - iterator = null; + __name(pop, "pop"); + function translate(xa, ya, xb, yb, s2, q2) { + if (xa !== xb || ya !== yb) { + var i2 = s2.push("translate(", null, pxComma, null, pxParen); + q2.push({ i: i2 - 4, x: number_default(xa, xb) }, { i: i2 - 2, x: number_default(ya, yb) }); + } else if (xb || yb) { + s2.push("translate(" + xb + pxComma + yb + pxParen); + } } - var documents2 = loadDocuments(input, options2); - if (typeof iterator !== "function") { - return documents2; + __name(translate, "translate"); + function rotate(a2, b2, s2, q2) { + if (a2 !== b2) { + if (a2 - b2 > 180) b2 += 360; + else if (b2 - a2 > 180) a2 += 360; + q2.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default(a2, b2) }); + } else if (b2) { + s2.push(pop(s2) + "rotate(" + b2 + degParen); + } } - for (var index2 = 0, length2 = documents2.length; index2 < length2; index2 += 1) { - iterator(documents2[index2]); + __name(rotate, "rotate"); + function skewX(a2, b2, s2, q2) { + if (a2 !== b2) { + q2.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b2) }); + } else if (b2) { + s2.push(pop(s2) + "skewX(" + b2 + degParen); + } } + __name(skewX, "skewX"); + function scale(xa, ya, xb, yb, s2, q2) { + if (xa !== xb || ya !== yb) { + var i2 = s2.push(pop(s2) + "scale(", null, ",", null, ")"); + q2.push({ i: i2 - 4, x: number_default(xa, xb) }, { i: i2 - 2, x: number_default(ya, yb) }); + } else if (xb !== 1 || yb !== 1) { + s2.push(pop(s2) + "scale(" + xb + "," + yb + ")"); + } + } + __name(scale, "scale"); + return function(a2, b2) { + var s2 = [], q2 = []; + a2 = parse8(a2), b2 = parse8(b2); + translate(a2.translateX, a2.translateY, b2.translateX, b2.translateY, s2, q2); + rotate(a2.rotate, b2.rotate, s2, q2); + skewX(a2.skewX, b2.skewX, s2, q2); + scale(a2.scaleX, a2.scaleY, b2.scaleX, b2.scaleY, s2, q2); + a2 = b2 = null; + return function(t4) { + var i2 = -1, n2 = q2.length, o2; + while (++i2 < n2) s2[(o2 = q2[i2]).i] = o2.x(t4); + return s2.join(""); + }; + }; } - function load$1(input, options2) { - var documents2 = loadDocuments(input, options2); - if (documents2.length === 0) { - return void 0; - } else if (documents2.length === 1) { - return documents2[0]; + var interpolateTransformCss, interpolateTransformSvg; + var init_transform = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js"() { + "use strict"; + init_number2(); + init_parse(); + __name(interpolateTransform, "interpolateTransform"); + interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); + interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); } - throw new exception("expected a single document in the stream, but found more"); - } - var loadAll_1 = loadAll$1; - var load_1 = load$1; - var loader = { - loadAll: loadAll_1, - load: load_1 - }; - var JSON_SCHEMA = json; - var load = loader.load; - function extractFrontMatter(text2) { - const matches = text2.match(frontMatterRegex); - if (!matches) { - return { - text: text2, - metadata: {} + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/hcl.js + function hcl2(hue2) { + return function(start3, end2) { + var h2 = hue2((start3 = hcl(start3)).h, (end2 = hcl(end2)).h), c3 = nogamma(start3.c, end2.c), l2 = nogamma(start3.l, end2.l), opacity = nogamma(start3.opacity, end2.opacity); + return function(t4) { + start3.h = h2(t4); + start3.c = c3(t4); + start3.l = l2(t4); + start3.opacity = opacity(t4); + return start3 + ""; }; - } - let parsed = load(matches[1], { - // To support config, we need JSON schema. - // https://www.yaml.org/spec/1.2/spec.html#id2803231 - schema: JSON_SCHEMA - }) ?? {}; - parsed = typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {}; - const metadata = {}; - if (parsed.displayMode) { - metadata.displayMode = parsed.displayMode.toString(); - } - if (parsed.title) { - metadata.title = parsed.title.toString(); - } - if (parsed.config) { - metadata.config = parsed.config; - } - return { - text: text2.slice(matches[0].length), - metadata }; } - const cleanupText = (code) => { - return code.replace(/\r\n?/g, "\n").replace( - /<(\w+)([^>]*)>/g, - (match, tag, attributes) => "<" + tag + attributes.replace(/="([^"]*)"/g, "='$1'") + ">" - ); - }; - const processFrontmatter = (code) => { - const { text: text2, metadata } = extractFrontMatter(code); - const { displayMode: displayMode2, title: title2, config: config2 = {} } = metadata; - if (displayMode2) { - if (!config2.gantt) { - config2.gantt = {}; - } - config2.gantt.displayMode = displayMode2; + var hcl_default, hclLong; + var init_hcl = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/hcl.js"() { + "use strict"; + init_src7(); + init_color3(); + __name(hcl2, "hcl"); + hcl_default = hcl2(hue); + hclLong = hcl2(nogamma); } - return { title: title2, config: config2, text: text2 }; - }; - const processDirectives = (code) => { - const initDirective = utils$1.detectInit(code) ?? {}; - const wrapDirectives = utils$1.detectDirective(code, "wrap"); - if (Array.isArray(wrapDirectives)) { - initDirective.wrap = wrapDirectives.some(({ type: type2 }) => { - }); - } else if ((wrapDirectives == null ? void 0 : wrapDirectives.type) === "wrap") { - initDirective.wrap = true; + }); + + // ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/index.js + var init_src8 = __esm({ + "../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/index.js"() { + "use strict"; + init_value(); + init_number2(); + init_round(); + init_string(); + init_transform(); + init_rgb2(); + init_hcl(); } - return { - text: removeDirectives(code), - directive: initDirective - }; - }; - function preprocessDiagram(code) { - const cleanedCode = cleanupText(code); - const frontMatterResult = processFrontmatter(cleanedCode); - const directiveResult = processDirectives(frontMatterResult.text); - const config2 = cleanAndMerge(frontMatterResult.config, directiveResult.directive); - code = cleanupComments(directiveResult.text); - return { - code, - title: frontMatterResult.title, - config: config2 - }; + }); + + // ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js + function now() { + return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); } - const MAX_TEXTLENGTH = 5e4; - const MAX_TEXTLENGTH_EXCEEDED_MSG = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa"; - const SECURITY_LVL_SANDBOX = "sandbox"; - const SECURITY_LVL_LOOSE = "loose"; - const XMLNS_SVG_STD = "http://www.w3.org/2000/svg"; - const XMLNS_XLINK_STD = "http://www.w3.org/1999/xlink"; - const XMLNS_XHTML_STD = "http://www.w3.org/1999/xhtml"; - const IFRAME_WIDTH = "100%"; - const IFRAME_HEIGHT = "100%"; - const IFRAME_STYLES = "border:0;margin:0;"; - const IFRAME_BODY_STYLE = "margin:0"; - const IFRAME_SANDBOX_OPTS = "allow-top-navigation-by-user-activation allow-popups"; - const IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.'; - const DOMPURIFY_TAGS = ["foreignobject"]; - const DOMPURIFY_ATTR = ["dominant-baseline"]; - function processAndSetConfigs(text2) { - const processed2 = preprocessDiagram(text2); - reset(); - addDirective(processed2.config ?? {}); - return processed2; + function clearNow() { + clockNow = 0; } - async function parse$3(text2, parseOptions) { - addDiagrams(); - text2 = processAndSetConfigs(text2).code; + function Timer() { + this._call = this._time = this._next = null; + } + function timer(callback, delay2, time4) { + var t4 = new Timer(); + t4.restart(callback, delay2, time4); + return t4; + } + function timerFlush() { + now(); + ++frame; + var t4 = taskHead, e3; + while (t4) { + if ((e3 = clockNow - t4._time) >= 0) t4._call.call(void 0, e3); + t4 = t4._next; + } + --frame; + } + function wake() { + clockNow = (clockLast = clock.now()) + clockSkew; + frame = timeout = 0; try { - await getDiagramFromText(text2); - } catch (error) { - if (parseOptions == null ? void 0 : parseOptions.suppressErrors) { - return false; + timerFlush(); + } finally { + frame = 0; + nap(); + clockNow = 0; + } + } + function poke() { + var now4 = clock.now(), delay2 = now4 - clockLast; + if (delay2 > pokeDelay) clockSkew -= delay2, clockLast = now4; + } + function nap() { + var t03, t13 = taskHead, t22, time4 = Infinity; + while (t13) { + if (t13._call) { + if (time4 > t13._time) time4 = t13._time; + t03 = t13, t13 = t13._next; + } else { + t22 = t13._next, t13._next = null; + t13 = t03 ? t03._next = t22 : taskHead = t22; } - throw error; } - return true; + taskTail = t03; + sleep(time4); } - const cssImportantStyles = (cssClass, element2, cssClasses = []) => { - return ` -.${cssClass} ${element2} { ${cssClasses.join(" !important; ")} !important; }`; - }; - const createCssStyles = (config2, classDefs = {}) => { - var _a2; - let cssStyles = ""; - if (config2.themeCSS !== void 0) { - cssStyles += ` -${config2.themeCSS}`; + function sleep(time4) { + if (frame) return; + if (timeout) timeout = clearTimeout(timeout); + var delay2 = time4 - clockNow; + if (delay2 > 24) { + if (time4 < Infinity) timeout = setTimeout(wake, time4 - clock.now() - clockSkew); + if (interval) interval = clearInterval(interval); + } else { + if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); + frame = 1, setFrame(wake); } - if (config2.fontFamily !== void 0) { - cssStyles += ` -:root { --mermaid-font-family: ${config2.fontFamily}}`; + } + var frame, timeout, interval, pokeDelay, taskHead, taskTail, clockLast, clockNow, clockSkew, clock, setFrame; + var init_timer = __esm({ + "../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js"() { + "use strict"; + frame = 0; + timeout = 0; + interval = 0; + pokeDelay = 1e3; + clockLast = 0; + clockNow = 0; + clockSkew = 0; + clock = typeof performance === "object" && performance.now ? performance : Date; + setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f3) { + setTimeout(f3, 17); + }; + __name(now, "now"); + __name(clearNow, "clearNow"); + __name(Timer, "Timer"); + Timer.prototype = timer.prototype = { + constructor: Timer, + restart: /* @__PURE__ */ __name(function(callback, delay2, time4) { + if (typeof callback !== "function") throw new TypeError("callback is not a function"); + time4 = (time4 == null ? now() : +time4) + (delay2 == null ? 0 : +delay2); + if (!this._next && taskTail !== this) { + if (taskTail) taskTail._next = this; + else taskHead = this; + taskTail = this; + } + this._call = callback; + this._time = time4; + sleep(); + }, "restart"), + stop: /* @__PURE__ */ __name(function() { + if (this._call) { + this._call = null; + this._time = Infinity; + sleep(); + } + }, "stop") + }; + __name(timer, "timer"); + __name(timerFlush, "timerFlush"); + __name(wake, "wake"); + __name(poke, "poke"); + __name(nap, "nap"); + __name(sleep, "sleep"); } - if (config2.altFontFamily !== void 0) { - cssStyles += ` -:root { --mermaid-alt-font-family: ${config2.altFontFamily}}`; + }); + + // ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js + function timeout_default(callback, delay2, time4) { + var t4 = new Timer(); + delay2 = delay2 == null ? 0 : +delay2; + t4.restart((elapsed) => { + t4.stop(); + callback(elapsed + delay2); + }, delay2, time4); + return t4; + } + var init_timeout = __esm({ + "../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js"() { + "use strict"; + init_timer(); + __name(timeout_default, "default"); } - if (!isEmpty(classDefs)) { - const htmlLabels = config2.htmlLabels || ((_a2 = config2.flowchart) == null ? void 0 : _a2.htmlLabels); - const cssHtmlElements = ["> *", "span"]; - const cssShapeElements = ["rect", "polygon", "ellipse", "circle", "path"]; - const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements; - for (const classId in classDefs) { - const styleClassDef = classDefs[classId]; - if (!isEmpty(styleClassDef.styles)) { - cssElements.forEach((cssElement) => { - cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles); - }); + }); + + // ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/index.js + var init_src9 = __esm({ + "../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/index.js"() { + "use strict"; + init_timer(); + init_timeout(); + } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js + function schedule_default(node2, name, id26, index, group2, timing) { + var schedules = node2.__transition; + if (!schedules) node2.__transition = {}; + else if (id26 in schedules) return; + create(node2, id26, { + name, + index, + // For context during callback. + group: group2, + // For context during callback. + on: emptyOn, + tween: emptyTween, + time: timing.time, + delay: timing.delay, + duration: timing.duration, + ease: timing.ease, + timer: null, + state: CREATED + }); + } + function init(node2, id26) { + var schedule = get2(node2, id26); + if (schedule.state > CREATED) throw new Error("too late; already scheduled"); + return schedule; + } + function set2(node2, id26) { + var schedule = get2(node2, id26); + if (schedule.state > STARTED) throw new Error("too late; already running"); + return schedule; + } + function get2(node2, id26) { + var schedule = node2.__transition; + if (!schedule || !(schedule = schedule[id26])) throw new Error("transition not found"); + return schedule; + } + function create(node2, id26, self2) { + var schedules = node2.__transition, tween; + schedules[id26] = self2; + self2.timer = timer(schedule, 0, self2.time); + function schedule(elapsed) { + self2.state = SCHEDULED; + self2.timer.restart(start3, self2.delay, self2.time); + if (self2.delay <= elapsed) start3(elapsed - self2.delay); + } + __name(schedule, "schedule"); + function start3(elapsed) { + var i2, j2, n2, o2; + if (self2.state !== SCHEDULED) return stop5(); + for (i2 in schedules) { + o2 = schedules[i2]; + if (o2.name !== self2.name) continue; + if (o2.state === STARTED) return timeout_default(start3); + if (o2.state === RUNNING) { + o2.state = ENDED; + o2.timer.stop(); + o2.on.call("interrupt", node2, node2.__data__, o2.index, o2.group); + delete schedules[i2]; + } else if (+i2 < id26) { + o2.state = ENDED; + o2.timer.stop(); + o2.on.call("cancel", node2, node2.__data__, o2.index, o2.group); + delete schedules[i2]; + } + } + timeout_default(function() { + if (self2.state === STARTED) { + self2.state = RUNNING; + self2.timer.restart(tick, self2.delay, self2.time); + tick(elapsed); } - if (!isEmpty(styleClassDef.textStyles)) { - cssStyles += cssImportantStyles(styleClassDef.id, "tspan", styleClassDef.textStyles); + }); + self2.state = STARTING; + self2.on.call("start", node2, node2.__data__, self2.index, self2.group); + if (self2.state !== STARTING) return; + self2.state = STARTED; + tween = new Array(n2 = self2.tween.length); + for (i2 = 0, j2 = -1; i2 < n2; ++i2) { + if (o2 = self2.tween[i2].value.call(node2, node2.__data__, self2.index, self2.group)) { + tween[++j2] = o2; } } + tween.length = j2 + 1; } - return cssStyles; - }; - const createUserStyles = (config2, graphType, classDefs, svgId) => { - const userCSSstyles = createCssStyles(config2, classDefs); - const allStyles = getStyles$g(graphType, userCSSstyles, config2.themeVariables); - return serialize(compile(`${svgId}{${allStyles}}`), stringify); - }; - const cleanUpSvgCode = (svgCode = "", inSandboxMode, useArrowMarkerUrls) => { - let cleanedUpSvg = svgCode; - if (!useArrowMarkerUrls && !inSandboxMode) { - cleanedUpSvg = cleanedUpSvg.replace( - /marker-end="url\([\d+./:=?A-Za-z-]*?#/g, - 'marker-end="url(#' - ); - } - cleanedUpSvg = decodeEntities(cleanedUpSvg); - cleanedUpSvg = cleanedUpSvg.replace(/
/g, "
"); - return cleanedUpSvg; - }; - const putIntoIFrame = (svgCode = "", svgElement) => { - var _a2, _b2; - const height = ((_b2 = (_a2 = svgElement == null ? void 0 : svgElement.viewBox) == null ? void 0 : _a2.baseVal) == null ? void 0 : _b2.height) ? svgElement.viewBox.baseVal.height + "px" : IFRAME_HEIGHT; - const base64encodedSrc = btoa('' + svgCode + ""); - return ``; - }; - const appendDivSvgG = (parentRoot, id2, enclosingDivId, divStyle, svgXlink) => { - const enclosingDiv = parentRoot.append("div"); - enclosingDiv.attr("id", enclosingDivId); - if (divStyle) { - enclosingDiv.attr("style", divStyle); + __name(start3, "start"); + function tick(elapsed) { + var t4 = elapsed < self2.duration ? self2.ease.call(null, elapsed / self2.duration) : (self2.timer.restart(stop5), self2.state = ENDING, 1), i2 = -1, n2 = tween.length; + while (++i2 < n2) { + tween[i2].call(node2, t4); + } + if (self2.state === ENDING) { + self2.on.call("end", node2, node2.__data__, self2.index, self2.group); + stop5(); + } } - const svgNode2 = enclosingDiv.append("svg").attr("id", id2).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD); - if (svgXlink) { - svgNode2.attr("xmlns:xlink", svgXlink); + __name(tick, "tick"); + function stop5() { + self2.state = ENDED; + self2.timer.stop(); + delete schedules[id26]; + for (var i2 in schedules) return; + delete node2.__transition; } - svgNode2.append("g"); - return parentRoot; - }; - function sandboxedIframe(parentNode, iFrameId) { - return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); - } - const removeExistingElements = (doc, id2, divId, iFrameId) => { - var _a2, _b2, _c; - (_a2 = doc.getElementById(id2)) == null ? void 0 : _a2.remove(); - (_b2 = doc.getElementById(divId)) == null ? void 0 : _b2.remove(); - (_c = doc.getElementById(iFrameId)) == null ? void 0 : _c.remove(); - }; - const render$4 = async function(id2, text2, svgContainingElement) { - var _a2, _b2, _c, _d, _e, _f; - addDiagrams(); - const processed2 = processAndSetConfigs(text2); - text2 = processed2.code; - const config2 = getConfig$2(); - log$1.debug(config2); - if (text2.length > ((config2 == null ? void 0 : config2.maxTextSize) ?? MAX_TEXTLENGTH)) { - text2 = MAX_TEXTLENGTH_EXCEEDED_MSG; + __name(stop5, "stop"); + } + var emptyOn, emptyTween, CREATED, SCHEDULED, STARTING, STARTED, RUNNING, ENDING, ENDED; + var init_schedule = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js"() { + "use strict"; + init_src4(); + init_src9(); + emptyOn = dispatch_default("start", "end", "cancel", "interrupt"); + emptyTween = []; + CREATED = 0; + SCHEDULED = 1; + STARTING = 2; + STARTED = 3; + RUNNING = 4; + ENDING = 5; + ENDED = 6; + __name(schedule_default, "default"); + __name(init, "init"); + __name(set2, "set"); + __name(get2, "get"); + __name(create, "create"); } - const idSelector = "#" + id2; - const iFrameID = "i" + id2; - const iFrameID_selector = "#" + iFrameID; - const enclosingDivID = "d" + id2; - const enclosingDivID_selector = "#" + enclosingDivID; - let root2 = d3select("body"); - const isSandboxed = config2.securityLevel === SECURITY_LVL_SANDBOX; - const isLooseSecurityLevel = config2.securityLevel === SECURITY_LVL_LOOSE; - const fontFamily = config2.fontFamily; - if (svgContainingElement !== void 0) { - if (svgContainingElement) { - svgContainingElement.innerHTML = ""; - } - if (isSandboxed) { - const iframe = sandboxedIframe(d3select(svgContainingElement), iFrameID); - root2 = d3select(iframe.nodes()[0].contentDocument.body); - root2.node().style.margin = 0; - } else { - root2 = d3select(svgContainingElement); - } - appendDivSvgG(root2, id2, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD); - } else { - removeExistingElements(document, id2, enclosingDivID, iFrameID); - if (isSandboxed) { - const iframe = sandboxedIframe(d3select("body"), iFrameID); - root2 = d3select(iframe.nodes()[0].contentDocument.body); - root2.node().style.margin = 0; - } else { - root2 = d3select("body"); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js + function interrupt_default(node2, name) { + var schedules = node2.__transition, schedule, active, empty3 = true, i2; + if (!schedules) return; + name = name == null ? null : name + ""; + for (i2 in schedules) { + if ((schedule = schedules[i2]).name !== name) { + empty3 = false; + continue; } - appendDivSvgG(root2, id2, enclosingDivID); + active = schedule.state > STARTING && schedule.state < ENDING; + schedule.state = ENDED; + schedule.timer.stop(); + schedule.on.call(active ? "interrupt" : "cancel", node2, node2.__data__, schedule.index, schedule.group); + delete schedules[i2]; } - let diag; - let parseEncounteredException; - try { - diag = await getDiagramFromText(text2, { title: processed2.title }); - } catch (error) { - diag = new Diagram("error"); - parseEncounteredException = error; + if (empty3) delete node2.__transition; + } + var init_interrupt = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js"() { + "use strict"; + init_schedule(); + __name(interrupt_default, "default"); } - const element2 = root2.select(enclosingDivID_selector).node(); - const diagramType = diag.type; - const svg2 = element2.firstChild; - const firstChild = svg2.firstChild; - const diagramClassDefs = (_b2 = (_a2 = diag.renderer).getClasses) == null ? void 0 : _b2.call(_a2, text2, diag); - const rules = createUserStyles(config2, diagramType, diagramClassDefs, idSelector); - const style1 = document.createElement("style"); - style1.innerHTML = rules; - svg2.insertBefore(style1, firstChild); - try { - await diag.renderer.draw(text2, id2, version$1, diag); - } catch (e) { - errorRenderer.draw(text2, id2, version$1); - throw e; - } - const svgNode2 = root2.select(`${enclosingDivID_selector} svg`); - const a11yTitle = (_d = (_c = diag.db).getAccTitle) == null ? void 0 : _d.call(_c); - const a11yDescr = (_f = (_e = diag.db).getAccDescription) == null ? void 0 : _f.call(_e); - addA11yInfo(diagramType, svgNode2, a11yTitle, a11yDescr); - root2.select(`[id="${id2}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD); - let svgCode = root2.select(enclosingDivID_selector).node().innerHTML; - log$1.debug("config.arrowMarkerAbsolute", config2.arrowMarkerAbsolute); - svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config2.arrowMarkerAbsolute)); - if (isSandboxed) { - const svgEl = root2.select(enclosingDivID_selector + " svg").node(); - svgCode = putIntoIFrame(svgCode, svgEl); - } else if (!isLooseSecurityLevel) { - svgCode = purify.sanitize(svgCode, { - ADD_TAGS: DOMPURIFY_TAGS, - ADD_ATTR: DOMPURIFY_ATTR - }); - } - attachFunctions(); - if (parseEncounteredException) { - throw parseEncounteredException; - } - const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector; - const node2 = d3select(tmpElementSelector).node(); - if (node2 && "remove" in node2) { - node2.remove(); - } - return { - svg: svgCode, - bindFunctions: diag.db.bindFunctions - }; - }; - function initialize$1(options2 = {}) { - var _a2; - if ((options2 == null ? void 0 : options2.fontFamily) && !((_a2 = options2.themeVariables) == null ? void 0 : _a2.fontFamily)) { - if (!options2.themeVariables) { - options2.themeVariables = {}; - } - options2.themeVariables.fontFamily = options2.fontFamily; - } - saveConfigFromInitialize(options2); - if ((options2 == null ? void 0 : options2.theme) && options2.theme in theme) { - options2.themeVariables = theme[options2.theme].getThemeVariables( - options2.themeVariables - ); - } else if (options2) { - options2.themeVariables = theme.default.getThemeVariables(options2.themeVariables); - } - const config2 = typeof options2 === "object" ? setSiteConfig(options2) : getSiteConfig(); - setLogLevel$1(config2.logLevel); - addDiagrams(); - } - const getDiagramFromText = (text2, metadata = {}) => { - const { code } = preprocessDiagram(text2); - return getDiagramFromText$1(code, metadata); - }; - function addA11yInfo(diagramType, svgNode2, a11yTitle, a11yDescr) { - setA11yDiagramInfo(svgNode2, diagramType); - addSVGa11yTitleDescription(svgNode2, a11yTitle, a11yDescr, svgNode2.attr("id")); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js + function interrupt_default2(name) { + return this.each(function() { + interrupt_default(this, name); + }); } - const mermaidAPI = Object.freeze({ - render: render$4, - parse: parse$3, - getDiagramFromText, - initialize: initialize$1, - getConfig: getConfig$2, - setConfig: setConfig$1, - getSiteConfig, - updateSiteConfig, - reset: () => { - reset(); - }, - globalReset: () => { - reset(defaultConfig$1); - }, - defaultConfig: defaultConfig$1 + var init_interrupt2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js"() { + "use strict"; + init_interrupt(); + __name(interrupt_default2, "default"); + } }); - setLogLevel$1(getConfig$2().logLevel); - reset(getConfig$2()); - const loadRegisteredDiagrams = async () => { - log$1.debug(`Loading registered diagrams`); - const results = await Promise.allSettled( - Object.entries(detectors).map(async ([key, { detector: detector2, loader: loader2 }]) => { - if (loader2) { - try { - getDiagram(key); - } catch (error) { - try { - const { diagram: diagram2, id: id2 } = await loader2(); - registerDiagram(id2, diagram2, detector2); - } catch (err) { - log$1.error(`Failed to load external diagram with key ${key}. Removing from detectors.`); - delete detectors[key]; - throw err; - } + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js + function tweenRemove(id26, name) { + var tween0, tween1; + return function() { + var schedule = set2(this, id26), tween = schedule.tween; + if (tween !== tween0) { + tween1 = tween0 = tween; + for (var i2 = 0, n2 = tween1.length; i2 < n2; ++i2) { + if (tween1[i2].name === name) { + tween1 = tween1.slice(); + tween1.splice(i2, 1); + break; } } - }) - ); - const failed = results.filter((result) => result.status === "rejected"); - if (failed.length > 0) { - log$1.error(`Failed to load ${failed.length} external diagrams`); - for (const res of failed) { - log$1.error(res); - } - throw new Error(`Failed to load ${failed.length} external diagrams`); - } - }; - const handleError = (error, errors, parseError) => { - log$1.warn(error); - if (isDetailedError(error)) { - if (parseError) { - parseError(error.str, error.hash); - } - errors.push({ ...error, message: error.str, error }); - } else { - if (parseError) { - parseError(error); - } - if (error instanceof Error) { - errors.push({ - str: error.message, - message: error.message, - hash: error.name, - error - }); - } - } - }; - const run$3 = async function(options2 = { - querySelector: ".mermaid" - }) { - try { - await runThrowsErrors(options2); - } catch (e) { - if (isDetailedError(e)) { - log$1.error(e.str); - } - if (mermaid.parseError) { - mermaid.parseError(e); - } - if (!options2.suppressErrors) { - log$1.error("Use the suppressErrors option to suppress these errors"); - throw e; - } - } - }; - const runThrowsErrors = async function({ postRenderCallback, querySelector, nodes: nodes2 } = { - querySelector: ".mermaid" - }) { - const conf2 = mermaidAPI.getConfig(); - log$1.debug(`${!postRenderCallback ? "No " : ""}Callback function found`); - let nodesToProcess; - if (nodes2) { - nodesToProcess = nodes2; - } else if (querySelector) { - nodesToProcess = document.querySelectorAll(querySelector); - } else { - throw new Error("Nodes and querySelector are both undefined"); - } - log$1.debug(`Found ${nodesToProcess.length} diagrams`); - if ((conf2 == null ? void 0 : conf2.startOnLoad) !== void 0) { - log$1.debug("Start On Load: " + (conf2 == null ? void 0 : conf2.startOnLoad)); - mermaidAPI.updateSiteConfig({ startOnLoad: conf2 == null ? void 0 : conf2.startOnLoad }); - } - const idGenerator = new utils$1.InitIDGenerator(conf2.deterministicIds, conf2.deterministicIDSeed); - let txt; - const errors = []; - for (const element2 of Array.from(nodesToProcess)) { - log$1.info("Rendering diagram: " + element2.id); - /*! Check if previously processed */ - if (element2.getAttribute("data-processed")) { - continue; } - element2.setAttribute("data-processed", "true"); - const id2 = `mermaid-${idGenerator.next()}`; - txt = element2.innerHTML; - txt = dedent(utils$1.entityDecode(txt)).trim().replace(//gi, "
"); - const init2 = utils$1.detectInit(txt); - if (init2) { - log$1.debug("Detected early reinit: ", init2); - } - try { - const { svg: svg2, bindFunctions: bindFunctions2 } = await render$3(id2, txt, element2); - element2.innerHTML = svg2; - if (postRenderCallback) { - await postRenderCallback(id2); + schedule.tween = tween1; + }; + } + function tweenFunction(id26, name, value2) { + var tween0, tween1; + if (typeof value2 !== "function") throw new Error(); + return function() { + var schedule = set2(this, id26), tween = schedule.tween; + if (tween !== tween0) { + tween1 = (tween0 = tween).slice(); + for (var t4 = { name, value: value2 }, i2 = 0, n2 = tween1.length; i2 < n2; ++i2) { + if (tween1[i2].name === name) { + tween1[i2] = t4; + break; + } } - if (bindFunctions2) { - bindFunctions2(element2); + if (i2 === n2) tween1.push(t4); + } + schedule.tween = tween1; + }; + } + function tween_default(name, value2) { + var id26 = this._id; + name += ""; + if (arguments.length < 2) { + var tween = get2(this.node(), id26).tween; + for (var i2 = 0, n2 = tween.length, t4; i2 < n2; ++i2) { + if ((t4 = tween[i2]).name === name) { + return t4.value; } - } catch (error) { - handleError(error, errors, mermaid.parseError); } + return null; } - if (errors.length > 0) { - throw errors[0]; + return this.each((value2 == null ? tweenRemove : tweenFunction)(id26, name, value2)); + } + function tweenValue(transition2, name, value2) { + var id26 = transition2._id; + transition2.each(function() { + var schedule = set2(this, id26); + (schedule.value || (schedule.value = {}))[name] = value2.apply(this, arguments); + }); + return function(node2) { + return get2(node2, id26).value[name]; + }; + } + var init_tween = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js"() { + "use strict"; + init_schedule(); + __name(tweenRemove, "tweenRemove"); + __name(tweenFunction, "tweenFunction"); + __name(tween_default, "default"); + __name(tweenValue, "tweenValue"); } - }; - const initialize = function(config2) { - mermaidAPI.initialize(config2); - }; - const init = async function(config2, nodes2, callback) { - log$1.warn("mermaid.init is deprecated. Please use run instead."); - if (config2) { - initialize(config2); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js + function interpolate_default(a2, b2) { + var c3; + return (typeof b2 === "number" ? number_default : b2 instanceof color ? rgb_default2 : (c3 = color(b2)) ? (b2 = c3, rgb_default2) : string_default)(a2, b2); + } + var init_interpolate = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js"() { + "use strict"; + init_src7(); + init_src8(); + __name(interpolate_default, "default"); } - const runOptions = { postRenderCallback: callback, querySelector: ".mermaid" }; - if (typeof nodes2 === "string") { - runOptions.querySelector = nodes2; - } else if (nodes2) { - if (nodes2 instanceof HTMLElement) { - runOptions.nodes = [nodes2]; - } else { - runOptions.nodes = nodes2; - } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js + function attrRemove2(name) { + return function() { + this.removeAttribute(name); + }; + } + function attrRemoveNS2(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; + } + function attrConstant2(name, interpolate, value1) { + var string00, string1 = value1 + "", interpolate0; + return function() { + var string0 = this.getAttribute(name); + return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); + }; + } + function attrConstantNS2(fullname, interpolate, value1) { + var string00, string1 = value1 + "", interpolate0; + return function() { + var string0 = this.getAttributeNS(fullname.space, fullname.local); + return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); + }; + } + function attrFunction2(name, interpolate, value2) { + var string00, string10, interpolate0; + return function() { + var string0, value1 = value2(this), string1; + if (value1 == null) return void this.removeAttribute(name); + string0 = this.getAttribute(name); + string1 = value1 + ""; + return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; + } + function attrFunctionNS2(fullname, interpolate, value2) { + var string00, string10, interpolate0; + return function() { + var string0, value1 = value2(this), string1; + if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); + string0 = this.getAttributeNS(fullname.space, fullname.local); + string1 = value1 + ""; + return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; + } + function attr_default2(name, value2) { + var fullname = namespace_default(name), i2 = fullname === "transform" ? interpolateTransformSvg : interpolate_default; + return this.attrTween(name, typeof value2 === "function" ? (fullname.local ? attrFunctionNS2 : attrFunction2)(fullname, i2, tweenValue(this, "attr." + name, value2)) : value2 == null ? (fullname.local ? attrRemoveNS2 : attrRemove2)(fullname) : (fullname.local ? attrConstantNS2 : attrConstant2)(fullname, i2, value2)); + } + var init_attr2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js"() { + "use strict"; + init_src8(); + init_src5(); + init_tween(); + init_interpolate(); + __name(attrRemove2, "attrRemove"); + __name(attrRemoveNS2, "attrRemoveNS"); + __name(attrConstant2, "attrConstant"); + __name(attrConstantNS2, "attrConstantNS"); + __name(attrFunction2, "attrFunction"); + __name(attrFunctionNS2, "attrFunctionNS"); + __name(attr_default2, "default"); } - await run$3(runOptions); - }; - const registerExternalDiagrams = async (diagrams2, { - lazyLoad = true - } = {}) => { - registerLazyLoadedDiagrams(...diagrams2); - if (lazyLoad === false) { - await loadRegisteredDiagrams(); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js + function attrInterpolate(name, i2) { + return function(t4) { + this.setAttribute(name, i2.call(this, t4)); + }; + } + function attrInterpolateNS(fullname, i2) { + return function(t4) { + this.setAttributeNS(fullname.space, fullname.local, i2.call(this, t4)); + }; + } + function attrTweenNS(fullname, value2) { + var t03, i0; + function tween() { + var i2 = value2.apply(this, arguments); + if (i2 !== i0) t03 = (i0 = i2) && attrInterpolateNS(fullname, i2); + return t03; } - }; - const contentLoaded = function() { - if (mermaid.startOnLoad) { - const { startOnLoad } = mermaidAPI.getConfig(); - if (startOnLoad) { - mermaid.run().catch((err) => log$1.error("Mermaid failed to initialize", err)); - } + __name(tween, "tween"); + tween._value = value2; + return tween; + } + function attrTween(name, value2) { + var t03, i0; + function tween() { + var i2 = value2.apply(this, arguments); + if (i2 !== i0) t03 = (i0 = i2) && attrInterpolate(name, i2); + return t03; } - }; - if (typeof document !== "undefined") { - /*! - * Wait for document loaded before starting the execution - */ - window.addEventListener("load", contentLoaded, false); + __name(tween, "tween"); + tween._value = value2; + return tween; } - const setParseErrorHandler = function(parseErrorHandler) { - mermaid.parseError = parseErrorHandler; - }; - const executionQueue = []; - let executionQueueRunning = false; - const executeQueue = async () => { - if (executionQueueRunning) { - return; + function attrTween_default(name, value2) { + var key = "attr." + name; + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value2 == null) return this.tween(key, null); + if (typeof value2 !== "function") throw new Error(); + var fullname = namespace_default(name); + return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value2)); + } + var init_attrTween = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js"() { + "use strict"; + init_src5(); + __name(attrInterpolate, "attrInterpolate"); + __name(attrInterpolateNS, "attrInterpolateNS"); + __name(attrTweenNS, "attrTweenNS"); + __name(attrTween, "attrTween"); + __name(attrTween_default, "default"); } - executionQueueRunning = true; - while (executionQueue.length > 0) { - const f2 = executionQueue.shift(); - if (f2) { - try { - await f2(); - } catch (e) { - log$1.error("Error executing queue", e); - } - } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js + function delayFunction(id26, value2) { + return function() { + init(this, id26).delay = +value2.apply(this, arguments); + }; + } + function delayConstant(id26, value2) { + return value2 = +value2, function() { + init(this, id26).delay = value2; + }; + } + function delay_default(value2) { + var id26 = this._id; + return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id26, value2)) : get2(this.node(), id26).delay; + } + var init_delay = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js"() { + "use strict"; + init_schedule(); + __name(delayFunction, "delayFunction"); + __name(delayConstant, "delayConstant"); + __name(delay_default, "default"); } - executionQueueRunning = false; - }; - const parse$2 = async (text2, parseOptions) => { - return new Promise((resolve, reject) => { - const performCall = () => new Promise((res, rej) => { - mermaidAPI.parse(text2, parseOptions).then( - (r) => { - res(r); - resolve(r); - }, - (e) => { - var _a2; - log$1.error("Error parsing", e); - (_a2 = mermaid.parseError) == null ? void 0 : _a2.call(mermaid, e); - rej(e); - reject(e); - } - ); - }); - executionQueue.push(performCall); - executeQueue().catch(reject); - }); - }; - const render$3 = (id2, text2, container) => { - return new Promise((resolve, reject) => { - const performCall = () => new Promise((res, rej) => { - mermaidAPI.render(id2, text2, container).then( - (r) => { - res(r); - resolve(r); - }, - (e) => { - var _a2; - log$1.error("Error parsing", e); - (_a2 = mermaid.parseError) == null ? void 0 : _a2.call(mermaid, e); - rej(e); - reject(e); - } - ); - }); - executionQueue.push(performCall); - executeQueue().catch(reject); - }); - }; - const mermaid = { - startOnLoad: true, - mermaidAPI, - parse: parse$2, - render: render$3, - init, - run: run$3, - registerExternalDiagrams, - initialize, - parseError: void 0, - contentLoaded, - setParseErrorHandler, - detectType - }; - class SourceLocation { - // The + prefix indicates that these fields aren't writeable - // Lexer holding the input string. - // Start offset, zero-based inclusive. - // End offset, zero-based exclusive. - constructor(lexer, start2, end2) { - this.lexer = void 0; - this.start = void 0; - this.end = void 0; - this.lexer = lexer; - this.start = start2; - this.end = end2; - } - /** - * Merges two `SourceLocation`s from location providers, given they are - * provided in order of appearance. - * - Returns the first one's location if only the first is provided. - * - Returns a merged range of the first and the last if both are provided - * and their lexers match. - * - Otherwise, returns null. - */ - static range(first, second2) { - if (!second2) { - return first && first.loc; - } else if (!first || !first.loc || !second2.loc || first.loc.lexer !== second2.loc.lexer) { - return null; - } else { - return new SourceLocation(first.loc.lexer, first.loc.start, second2.loc.end); - } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js + function durationFunction(id26, value2) { + return function() { + set2(this, id26).duration = +value2.apply(this, arguments); + }; + } + function durationConstant(id26, value2) { + return value2 = +value2, function() { + set2(this, id26).duration = value2; + }; + } + function duration_default(value2) { + var id26 = this._id; + return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id26, value2)) : get2(this.node(), id26).duration; + } + var init_duration = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js"() { + "use strict"; + init_schedule(); + __name(durationFunction, "durationFunction"); + __name(durationConstant, "durationConstant"); + __name(duration_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js + function easeConstant(id26, value2) { + if (typeof value2 !== "function") throw new Error(); + return function() { + set2(this, id26).ease = value2; + }; } - class Token { - // don't expand the token - // used in \noexpand - constructor(text2, loc) { - this.text = void 0; - this.loc = void 0; - this.noexpand = void 0; - this.treatAsRelax = void 0; - this.text = text2; - this.loc = loc; - } - /** - * Given a pair of tokens (this and endToken), compute a `Token` encompassing - * the whole input range enclosed by these two. - */ - range(endToken, text2) { - return new Token(text2, SourceLocation.range(this, endToken)); - } - } - class ParseError { - // Error start position based on passed-in Token or ParseNode. - // Length of affected text based on passed-in Token or ParseNode. - // The underlying error message without any context added. - constructor(message, token2) { - this.name = void 0; - this.position = void 0; - this.length = void 0; - this.rawMessage = void 0; - var error = "KaTeX parse error: " + message; - var start2; - var end2; - var loc = token2 && token2.loc; - if (loc && loc.start <= loc.end) { - var input = loc.lexer.input; - start2 = loc.start; - end2 = loc.end; - if (start2 === input.length) { - error += " at end of input: "; - } else { - error += " at position " + (start2 + 1) + ": "; - } - var underlined = input.slice(start2, end2).replace(/[^]/g, "$&̲"); - var left2; - if (start2 > 15) { - left2 = "…" + input.slice(start2 - 15, start2); - } else { - left2 = input.slice(0, start2); - } - var right2; - if (end2 + 15 < input.length) { - right2 = input.slice(end2, end2 + 15) + "…"; - } else { - right2 = input.slice(end2); - } - error += left2 + underlined + right2; - } - var self2 = new Error(error); - self2.name = "ParseError"; - self2.__proto__ = ParseError.prototype; - self2.position = start2; - if (start2 != null && end2 != null) { - self2.length = end2 - start2; - } - self2.rawMessage = message; - return self2; + function ease_default(value2) { + var id26 = this._id; + return arguments.length ? this.each(easeConstant(id26, value2)) : get2(this.node(), id26).ease; + } + var init_ease = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js"() { + "use strict"; + init_schedule(); + __name(easeConstant, "easeConstant"); + __name(ease_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js + function easeVarying(id26, value2) { + return function() { + var v3 = value2.apply(this, arguments); + if (typeof v3 !== "function") throw new Error(); + set2(this, id26).ease = v3; + }; } - ParseError.prototype.__proto__ = Error.prototype; - var contains = function contains2(list2, elem) { - return list2.indexOf(elem) !== -1; - }; - var deflt = function deflt2(setting, defaultIfUndefined) { - return setting === void 0 ? defaultIfUndefined : setting; - }; - var uppercase = /([A-Z])/g; - var hyphenate = function hyphenate2(str2) { - return str2.replace(uppercase, "-$1").toLowerCase(); - }; - var ESCAPE_LOOKUP = { - "&": "&", - ">": ">", - "<": "<", - '"': """, - "'": "'" - }; - var ESCAPE_REGEX = /[&><"']/g; - function escape$1(text2) { - return String(text2).replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]); - } - var getBaseElem = function getBaseElem2(group) { - if (group.type === "ordgroup") { - if (group.body.length === 1) { - return getBaseElem2(group.body[0]); - } else { - return group; - } - } else if (group.type === "color") { - if (group.body.length === 1) { - return getBaseElem2(group.body[0]); - } else { - return group; + function easeVarying_default(value2) { + if (typeof value2 !== "function") throw new Error(); + return this.each(easeVarying(this._id, value2)); + } + var init_easeVarying = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js"() { + "use strict"; + init_schedule(); + __name(easeVarying, "easeVarying"); + __name(easeVarying_default, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js + function filter_default2(match2) { + if (typeof match2 !== "function") match2 = matcher_default(match2); + for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, subgroup = subgroups[j2] = [], node2, i2 = 0; i2 < n2; ++i2) { + if ((node2 = group2[i2]) && match2.call(node2, node2.__data__, i2, group2)) { + subgroup.push(node2); + } } - } else if (group.type === "font") { - return getBaseElem2(group.body); - } else { - return group; } - }; - var isCharacterBox = function isCharacterBox2(group) { - var baseElem = getBaseElem(group); - return baseElem.type === "mathord" || baseElem.type === "textord" || baseElem.type === "atom"; - }; - var assert = function assert2(value2) { - if (!value2) { - throw new Error("Expected non-null, but got " + String(value2)); + return new Transition(subgroups, this._parents, this._name, this._id); + } + var init_filter2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js"() { + "use strict"; + init_src5(); + init_transition2(); + __name(filter_default2, "default"); } - return value2; - }; - var protocolFromUrl = function protocolFromUrl2(url) { - var protocol = /^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(url); - return protocol != null ? protocol[1] : "_relative"; - }; - var utils = { - contains, - deflt, - escape: escape$1, - hyphenate, - getBaseElem, - isCharacterBox, - protocolFromUrl - }; - var SETTINGS_SCHEMA = { - displayMode: { - type: "boolean", - description: "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.", - cli: "-d, --display-mode" - }, - output: { - type: { - enum: ["htmlAndMathml", "html", "mathml"] - }, - description: "Determines the markup language of the output.", - cli: "-F, --format " - }, - leqno: { - type: "boolean", - description: "Render display math in leqno style (left-justified tags)." - }, - fleqn: { - type: "boolean", - description: "Render display math flush left." - }, - throwOnError: { - type: "boolean", - default: true, - cli: "-t, --no-throw-on-error", - cliDescription: "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error." - }, - errorColor: { - type: "string", - default: "#cc0000", - cli: "-c, --error-color ", - cliDescription: "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.", - cliProcessor: (color2) => "#" + color2 - }, - macros: { - type: "object", - cli: "-m, --macro ", - cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).", - cliDefault: [], - cliProcessor: (def, defs) => { - defs.push(def); - return defs; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js + function merge_default2(transition2) { + if (transition2._id !== this._id) throw new Error(); + for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j2 = 0; j2 < m2; ++j2) { + for (var group0 = groups0[j2], group1 = groups1[j2], n2 = group0.length, merge5 = merges[j2] = new Array(n2), node2, i2 = 0; i2 < n2; ++i2) { + if (node2 = group0[i2] || group1[i2]) { + merge5[i2] = node2; + } } - }, - minRuleThickness: { - type: "number", - description: "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.", - processor: (t) => Math.max(0, t), - cli: "--min-rule-thickness ", - cliProcessor: parseFloat - }, - colorIsTextColor: { - type: "boolean", - description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.", - cli: "-b, --color-is-text-color" - }, - strict: { - type: [{ - enum: ["warn", "ignore", "error"] - }, "boolean", "function"], - description: "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.", - cli: "-S, --strict", - cliDefault: false - }, - trust: { - type: ["boolean", "function"], - description: "Trust the input, enabling all HTML features such as \\url.", - cli: "-T, --trust" - }, - maxSize: { - type: "number", - default: Infinity, - description: "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large", - processor: (s) => Math.max(0, s), - cli: "-s, --max-size ", - cliProcessor: parseInt - }, - maxExpand: { - type: "number", - default: 1e3, - description: "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.", - processor: (n) => Math.max(0, n), - cli: "-e, --max-expand ", - cliProcessor: (n) => n === "Infinity" ? Infinity : parseInt(n) - }, - globalGroup: { - type: "boolean", - cli: false } - }; - function getDefaultValue(schema2) { - if (schema2.default) { - return schema2.default; + for (; j2 < m0; ++j2) { + merges[j2] = groups0[j2]; } - var type2 = schema2.type; - var defaultType = Array.isArray(type2) ? type2[0] : type2; - if (typeof defaultType !== "string") { - return defaultType.enum[0]; + return new Transition(merges, this._parents, this._name, this._id); + } + var init_merge2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js"() { + "use strict"; + init_transition2(); + __name(merge_default2, "default"); } - switch (defaultType) { - case "boolean": - return false; - case "string": - return ""; - case "number": - return 0; - case "object": - return {}; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js + function start(name) { + return (name + "").trim().split(/^|\s+/).every(function(t4) { + var i2 = t4.indexOf("."); + if (i2 >= 0) t4 = t4.slice(0, i2); + return !t4 || t4 === "start"; + }); + } + function onFunction(id26, name, listener) { + var on0, on1, sit = start(name) ? init : set2; + return function() { + var schedule = sit(this, id26), on3 = schedule.on; + if (on3 !== on0) (on1 = (on0 = on3).copy()).on(name, listener); + schedule.on = on1; + }; + } + function on_default2(name, listener) { + var id26 = this._id; + return arguments.length < 2 ? get2(this.node(), id26).on.on(name) : this.each(onFunction(id26, name, listener)); + } + var init_on2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js"() { + "use strict"; + init_schedule(); + __name(start, "start"); + __name(onFunction, "onFunction"); + __name(on_default2, "default"); } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js + function removeFunction(id26) { + return function() { + var parent4 = this.parentNode; + for (var i2 in this.__transition) if (+i2 !== id26) return; + if (parent4) parent4.removeChild(this); + }; } - class Settings { - constructor(options2) { - this.displayMode = void 0; - this.output = void 0; - this.leqno = void 0; - this.fleqn = void 0; - this.throwOnError = void 0; - this.errorColor = void 0; - this.macros = void 0; - this.minRuleThickness = void 0; - this.colorIsTextColor = void 0; - this.strict = void 0; - this.trust = void 0; - this.maxSize = void 0; - this.maxExpand = void 0; - this.globalGroup = void 0; - options2 = options2 || {}; - for (var prop in SETTINGS_SCHEMA) { - if (SETTINGS_SCHEMA.hasOwnProperty(prop)) { - var schema2 = SETTINGS_SCHEMA[prop]; - this[prop] = options2[prop] !== void 0 ? schema2.processor ? schema2.processor(options2[prop]) : options2[prop] : getDefaultValue(schema2); - } - } - } - /** - * Report nonstrict (non-LaTeX-compatible) input. - * Can safely not be called if `this.strict` is false in JavaScript. - */ - reportNonstrict(errorCode, errorMsg, token2) { - var strict = this.strict; - if (typeof strict === "function") { - strict = strict(errorCode, errorMsg, token2); - } - if (!strict || strict === "ignore") { - return; - } else if (strict === true || strict === "error") { - throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token2); - } else if (strict === "warn") { - typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]")); - } else { - typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]")); - } - } - /** - * Check whether to apply strict (LaTeX-adhering) behavior for unusual - * input (like `\\`). Unlike `nonstrict`, will not throw an error; - * instead, "error" translates to a return value of `true`, while "ignore" - * translates to a return value of `false`. May still print a warning: - * "warn" prints a warning and returns `false`. - * This is for the second category of `errorCode`s listed in the README. - */ - useStrictBehavior(errorCode, errorMsg, token2) { - var strict = this.strict; - if (typeof strict === "function") { - try { - strict = strict(errorCode, errorMsg, token2); - } catch (error) { - strict = "error"; - } - } - if (!strict || strict === "ignore") { - return false; - } else if (strict === true || strict === "error") { - return true; - } else if (strict === "warn") { - typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]")); - return false; - } else { - typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]")); - return false; - } + function remove_default2() { + return this.on("end.remove", removeFunction(this._id)); + } + var init_remove2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js"() { + "use strict"; + __name(removeFunction, "removeFunction"); + __name(remove_default2, "default"); } - /** - * Check whether to test potentially dangerous input, and return - * `true` (trusted) or `false` (untrusted). The sole argument `context` - * should be an object with `command` field specifying the relevant LaTeX - * command (as a string starting with `\`), and any other arguments, etc. - * If `context` has a `url` field, a `protocol` field will automatically - * get added by this function (changing the specified object). - */ - isTrusted(context) { - if (context.url && !context.protocol) { - context.protocol = utils.protocolFromUrl(context.url); - } - var trust = typeof this.trust === "function" ? this.trust(context) : this.trust; - return Boolean(trust); - } - } - class Style { - constructor(id2, size2, cramped) { - this.id = void 0; - this.size = void 0; - this.cramped = void 0; - this.id = id2; - this.size = size2; - this.cramped = cramped; - } - /** - * Get the style of a superscript given a base in the current style. - */ - sup() { - return styles$a[sup[this.id]]; - } - /** - * Get the style of a subscript given a base in the current style. - */ - sub() { - return styles$a[sub[this.id]]; - } - /** - * Get the style of a fraction numerator given the fraction in the current - * style. - */ - fracNum() { - return styles$a[fracNum[this.id]]; - } - /** - * Get the style of a fraction denominator given the fraction in the current - * style. - */ - fracDen() { - return styles$a[fracDen[this.id]]; - } - /** - * Get the cramped version of a style (in particular, cramping a cramped style - * doesn't change the style). - */ - cramp() { - return styles$a[cramp[this.id]]; - } - /** - * Get a text or display version of this style. - */ - text() { - return styles$a[text$1$1[this.id]]; - } - /** - * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle) - */ - isTight() { - return this.size >= 2; - } - } - var D = 0; - var Dc = 1; - var T = 2; - var Tc = 3; - var S = 4; - var Sc = 5; - var SS = 6; - var SSc = 7; - var styles$a = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)]; - var sup = [S, Sc, S, Sc, SS, SSc, SS, SSc]; - var sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc]; - var fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc]; - var fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc]; - var cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc]; - var text$1$1 = [D, Dc, T, Tc, T, Tc, T, Tc]; - var Style$1 = { - DISPLAY: styles$a[D], - TEXT: styles$a[T], - SCRIPT: styles$a[S], - SCRIPTSCRIPT: styles$a[SS] - }; - var scriptData = [{ - // Latin characters beyond the Latin-1 characters we have metrics for. - // Needed for Czech, Hungarian and Turkish text, for example. - name: "latin", - blocks: [ - [256, 591], - // Latin Extended-A and Latin Extended-B - [768, 879] - // Combining Diacritical marks - ] - }, { - // The Cyrillic script used by Russian and related languages. - // A Cyrillic subset used to be supported as explicitly defined - // symbols in symbols.js - name: "cyrillic", - blocks: [[1024, 1279]] - }, { - // Armenian - name: "armenian", - blocks: [[1328, 1423]] - }, { - // The Brahmic scripts of South and Southeast Asia - // Devanagari (0900–097F) - // Bengali (0980–09FF) - // Gurmukhi (0A00–0A7F) - // Gujarati (0A80–0AFF) - // Oriya (0B00–0B7F) - // Tamil (0B80–0BFF) - // Telugu (0C00–0C7F) - // Kannada (0C80–0CFF) - // Malayalam (0D00–0D7F) - // Sinhala (0D80–0DFF) - // Thai (0E00–0E7F) - // Lao (0E80–0EFF) - // Tibetan (0F00–0FFF) - // Myanmar (1000–109F) - name: "brahmic", - blocks: [[2304, 4255]] - }, { - name: "georgian", - blocks: [[4256, 4351]] - }, { - // Chinese and Japanese. - // The "k" in cjk is for Korean, but we've separated Korean out - name: "cjk", - blocks: [ - [12288, 12543], - // CJK symbols and punctuation, Hiragana, Katakana - [19968, 40879], - // CJK ideograms - [65280, 65376] - // Fullwidth punctuation - // TODO: add halfwidth Katakana and Romanji glyphs - ] - }, { - // Korean - name: "hangul", - blocks: [[44032, 55215]] - }]; - function scriptFromCodepoint(codepoint) { - for (var i2 = 0; i2 < scriptData.length; i2++) { - var script = scriptData[i2]; - for (var _i6 = 0; _i6 < script.blocks.length; _i6++) { - var block2 = script.blocks[_i6]; - if (codepoint >= block2[0] && codepoint <= block2[1]) { - return script.name; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js + function select_default3(select) { + var name = this._name, id26 = this._id; + if (typeof select !== "function") select = selector_default(select); + for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, subgroup = subgroups[j2] = new Array(n2), node2, subnode, i2 = 0; i2 < n2; ++i2) { + if ((node2 = group2[i2]) && (subnode = select.call(node2, node2.__data__, i2, group2))) { + if ("__data__" in node2) subnode.__data__ = node2.__data__; + subgroup[i2] = subnode; + schedule_default(subgroup[i2], name, id26, i2, subgroup, get2(node2, id26)); } } } - return null; + return new Transition(subgroups, this._parents, name, id26); } - var allBlocks = []; - scriptData.forEach((s) => s.blocks.forEach((b) => allBlocks.push(...b))); - function supportedCodepoint(codepoint) { - for (var i2 = 0; i2 < allBlocks.length; i2 += 2) { - if (codepoint >= allBlocks[i2] && codepoint <= allBlocks[i2 + 1]) { - return true; + var init_select3 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js"() { + "use strict"; + init_src5(); + init_transition2(); + init_schedule(); + __name(select_default3, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js + function selectAll_default2(select) { + var name = this._name, id26 = this._id; + if (typeof select !== "function") select = selectorAll_default(select); + for (var groups = this._groups, m2 = groups.length, subgroups = [], parents4 = [], j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) { + if (node2 = group2[i2]) { + for (var children2 = select.call(node2, node2.__data__, i2, group2), child, inherit2 = get2(node2, id26), k2 = 0, l2 = children2.length; k2 < l2; ++k2) { + if (child = children2[k2]) { + schedule_default(child, name, id26, k2, children2, inherit2); + } + } + subgroups.push(children2); + parents4.push(node2); + } } } - return false; + return new Transition(subgroups, parents4, name, id26); } - var hLinePad = 80; - var sqrtMain = function sqrtMain2(extraVinculum, hLinePad2) { - return "M95," + (622 + extraVinculum + hLinePad2) + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + extraVinculum / 2.075 + " -" + extraVinculum + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + (40 + extraVinculum) + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + (834 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize1 = function sqrtSize12(extraVinculum, hLinePad2) { - return "M263," + (601 + extraVinculum + hLinePad2) + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + extraVinculum / 2.084 + " -" + extraVinculum + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + (40 + extraVinculum) + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize2 = function sqrtSize22(extraVinculum, hLinePad2) { - return "M983 " + (10 + extraVinculum + hLinePad2) + "\nl" + extraVinculum / 3.13 + " -" + extraVinculum + "\nc4,-6.7,10,-10,18,-10 H400000v" + (40 + extraVinculum) + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize3 = function sqrtSize32(extraVinculum, hLinePad2) { - return "M424," + (2398 + extraVinculum + hLinePad2) + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + extraVinculum / 4.223 + " -" + extraVinculum + "c4,-6.7,10,-10,18,-10 H400000\nv" + (40 + extraVinculum) + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + (1001 + extraVinculum) + " " + hLinePad2 + "\nh400000v" + (40 + extraVinculum) + "h-400000z"; - }; - var sqrtSize4 = function sqrtSize42(extraVinculum, hLinePad2) { - return "M473," + (2713 + extraVinculum + hLinePad2) + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + extraVinculum / 5.298 + " -" + extraVinculum + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + (40 + extraVinculum) + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + (1001 + extraVinculum) + " " + hLinePad2 + "h400000v" + (40 + extraVinculum) + "H1017.7z"; - }; - var phasePath = function phasePath2(y2) { - var x2 = y2 / 2; - return "M400000 " + y2 + " H0 L" + x2 + " 0 l65 45 L145 " + (y2 - 80) + " H400000z"; - }; - var sqrtTall = function sqrtTall2(extraVinculum, hLinePad2, viewBoxHeight) { - var vertSegment = viewBoxHeight - 54 - hLinePad2 - extraVinculum; - return "M702 " + (extraVinculum + hLinePad2) + "H400000" + (40 + extraVinculum) + "\nH742v" + vertSegment + "l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 " + hLinePad2 + "H400000v" + (40 + extraVinculum) + "H742z"; - }; - var sqrtPath = function sqrtPath2(size2, extraVinculum, viewBoxHeight) { - extraVinculum = 1e3 * extraVinculum; - var path2 = ""; - switch (size2) { - case "sqrtMain": - path2 = sqrtMain(extraVinculum, hLinePad); - break; - case "sqrtSize1": - path2 = sqrtSize1(extraVinculum, hLinePad); - break; - case "sqrtSize2": - path2 = sqrtSize2(extraVinculum, hLinePad); - break; - case "sqrtSize3": - path2 = sqrtSize3(extraVinculum, hLinePad); - break; - case "sqrtSize4": - path2 = sqrtSize4(extraVinculum, hLinePad); - break; - case "sqrtTall": - path2 = sqrtTall(extraVinculum, hLinePad, viewBoxHeight); - } - return path2; - }; - var innerPath = function innerPath2(name, height) { - switch (name) { - case "⎜": - return "M291 0 H417 V" + height + " H291z M291 0 H417 V" + height + " H291z"; - case "∣": - return "M145 0 H188 V" + height + " H145z M145 0 H188 V" + height + " H145z"; - case "∥": - return "M145 0 H188 V" + height + " H145z M145 0 H188 V" + height + " H145z" + ("M367 0 H410 V" + height + " H367z M367 0 H410 V" + height + " H367z"); - case "⎟": - return "M457 0 H583 V" + height + " H457z M457 0 H583 V" + height + " H457z"; - case "⎢": - return "M319 0 H403 V" + height + " H319z M319 0 H403 V" + height + " H319z"; - case "⎥": - return "M263 0 H347 V" + height + " H263z M263 0 H347 V" + height + " H263z"; - case "⎪": - return "M384 0 H504 V" + height + " H384z M384 0 H504 V" + height + " H384z"; - case "⏐": - return "M312 0 H355 V" + height + " H312z M312 0 H355 V" + height + " H312z"; - case "‖": - return "M257 0 H300 V" + height + " H257z M257 0 H300 V" + height + " H257z" + ("M478 0 H521 V" + height + " H478z M478 0 H521 V" + height + " H478z"); - default: - return ""; + var init_selectAll2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js"() { + "use strict"; + init_src5(); + init_transition2(); + init_schedule(); + __name(selectAll_default2, "default"); } - }; - var path$1 = { - // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main - doubleleftarrow: "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z", - // doublerightarrow is from glyph U+21D2 in font KaTeX Main - doublerightarrow: "M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z", - // leftarrow is from glyph U+2190 in font KaTeX Main - leftarrow: "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z", - // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular - leftbrace: "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z", - leftbraceunder: "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z", - // overgroup is from the MnSymbol package (public domain) - leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z", - leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z", - // Harpoons are from glyph U+21BD in font KaTeX Main - leftharpoon: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z", - leftharpoonplus: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z", - leftharpoondown: "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z", - leftharpoondownplus: "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z", - // hook is from glyph U+21A9 in font KaTeX Main - lefthook: "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z", - leftlinesegment: "M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z", - leftmapsto: "M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z", - // tofrom is from glyph U+21C4 in font KaTeX AMS Regular - leftToFrom: "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z", - longequal: "M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z", - midbrace: "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z", - midbraceunder: "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z", - oiintSize1: "M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z", - oiintSize2: "M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z", - oiiintSize1: "M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z", - oiiintSize2: "M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z", - rightarrow: "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z", - rightbrace: "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z", - rightbraceunder: "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z", - rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z", - rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z", - rightharpoon: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z", - rightharpoonplus: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z", - rightharpoondown: "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z", - rightharpoondownplus: "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z", - righthook: "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z", - rightlinesegment: "M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z", - rightToFrom: "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z", - // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular - twoheadleftarrow: "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z", - twoheadrightarrow: "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z", - // tilde1 is a modified version of a glyph from the MnSymbol package - tilde1: "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z", - // ditto tilde2, tilde3, & tilde4 - tilde2: "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z", - tilde3: "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z", - tilde4: "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z", - // vec is from glyph U+20D7 in font KaTeX Main - vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z", - // widehat1 is a modified version of a glyph from the MnSymbol package - widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z", - // ditto widehat2, widehat3, & widehat4 - widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", - widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", - widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", - // widecheck paths are all inverted versions of widehat - widecheck1: "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z", - widecheck2: "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", - widecheck3: "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", - widecheck4: "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", - // The next ten paths support reaction arrows from the mhchem package. - // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX - // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main - baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z", - // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main - rightarrowabovebar: "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z", - // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end. - // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em - baraboveshortleftharpoon: "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z", - rightharpoonaboveshortbar: "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z", - shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z", - shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z" - }; - var tallDelim = function tallDelim2(label, midHeight) { - switch (label) { - case "lbrack": - return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + midHeight + " v1759 h84z"; - case "rbrack": - return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v" + midHeight + " v1759 h84z"; - case "vert": - return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z"; - case "doublevert": - return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z\nM367 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v" + midHeight + " v585 h43z"; - case "lfloor": - return "M319 602 V0 H403 V602 v" + midHeight + " v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z"; - case "rfloor": - return "M319 602 V0 H403 V602 v" + midHeight + " v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z"; - case "lceil": - return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v602 h84z\nM403 1759 V0 H319 V1759 v" + midHeight + " v602 h84z"; - case "rceil": - return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v602 h84z\nM347 1759 V0 h-84 V1759 v" + midHeight + " v602 h84z"; - case "lparen": - return "M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0," + (midHeight + 84) + "c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-" + (midHeight + 92) + "c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z"; - case "rparen": - return "M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0," + (midHeight + 9) + "\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-" + (midHeight + 144) + "c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z"; - default: - throw new Error("Unknown stretchy delimiter."); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js + function selection_default2() { + return new Selection2(this._groups, this._parents); + } + var Selection2; + var init_selection2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js"() { + "use strict"; + init_src5(); + Selection2 = selection_default.prototype.constructor; + __name(selection_default2, "default"); } - }; - class DocumentFragment { - // HtmlDomNode - // Never used; needed for satisfying interface. - constructor(children2) { - this.children = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.maxFontSize = void 0; - this.style = void 0; - this.children = children2; - this.classes = []; - this.height = 0; - this.depth = 0; - this.maxFontSize = 0; - this.style = {}; - } - hasClass(className) { - return utils.contains(this.classes, className); - } - /** Convert the fragment into a node. */ - toNode() { - var frag = document.createDocumentFragment(); - for (var i2 = 0; i2 < this.children.length; i2++) { - frag.appendChild(this.children[i2].toNode()); - } - return frag; - } - /** Convert the fragment into HTML markup. */ - toMarkup() { - var markup = ""; - for (var i2 = 0; i2 < this.children.length; i2++) { - markup += this.children[i2].toMarkup(); - } - return markup; - } - /** - * Converts the math node into a string, similar to innerText. Applies to - * MathDomNode's only. - */ - toText() { - var toText = (child) => child.toText(); - return this.children.map(toText).join(""); - } - } - var fontMetricsData = { - "AMS-Regular": { - "32": [0, 0, 0, 0, 0.25], - "65": [0, 0.68889, 0, 0, 0.72222], - "66": [0, 0.68889, 0, 0, 0.66667], - "67": [0, 0.68889, 0, 0, 0.72222], - "68": [0, 0.68889, 0, 0, 0.72222], - "69": [0, 0.68889, 0, 0, 0.66667], - "70": [0, 0.68889, 0, 0, 0.61111], - "71": [0, 0.68889, 0, 0, 0.77778], - "72": [0, 0.68889, 0, 0, 0.77778], - "73": [0, 0.68889, 0, 0, 0.38889], - "74": [0.16667, 0.68889, 0, 0, 0.5], - "75": [0, 0.68889, 0, 0, 0.77778], - "76": [0, 0.68889, 0, 0, 0.66667], - "77": [0, 0.68889, 0, 0, 0.94445], - "78": [0, 0.68889, 0, 0, 0.72222], - "79": [0.16667, 0.68889, 0, 0, 0.77778], - "80": [0, 0.68889, 0, 0, 0.61111], - "81": [0.16667, 0.68889, 0, 0, 0.77778], - "82": [0, 0.68889, 0, 0, 0.72222], - "83": [0, 0.68889, 0, 0, 0.55556], - "84": [0, 0.68889, 0, 0, 0.66667], - "85": [0, 0.68889, 0, 0, 0.72222], - "86": [0, 0.68889, 0, 0, 0.72222], - "87": [0, 0.68889, 0, 0, 1], - "88": [0, 0.68889, 0, 0, 0.72222], - "89": [0, 0.68889, 0, 0, 0.72222], - "90": [0, 0.68889, 0, 0, 0.66667], - "107": [0, 0.68889, 0, 0, 0.55556], - "160": [0, 0, 0, 0, 0.25], - "165": [0, 0.675, 0.025, 0, 0.75], - "174": [0.15559, 0.69224, 0, 0, 0.94666], - "240": [0, 0.68889, 0, 0, 0.55556], - "295": [0, 0.68889, 0, 0, 0.54028], - "710": [0, 0.825, 0, 0, 2.33334], - "732": [0, 0.9, 0, 0, 2.33334], - "770": [0, 0.825, 0, 0, 2.33334], - "771": [0, 0.9, 0, 0, 2.33334], - "989": [0.08167, 0.58167, 0, 0, 0.77778], - "1008": [0, 0.43056, 0.04028, 0, 0.66667], - "8245": [0, 0.54986, 0, 0, 0.275], - "8463": [0, 0.68889, 0, 0, 0.54028], - "8487": [0, 0.68889, 0, 0, 0.72222], - "8498": [0, 0.68889, 0, 0, 0.55556], - "8502": [0, 0.68889, 0, 0, 0.66667], - "8503": [0, 0.68889, 0, 0, 0.44445], - "8504": [0, 0.68889, 0, 0, 0.66667], - "8513": [0, 0.68889, 0, 0, 0.63889], - "8592": [-0.03598, 0.46402, 0, 0, 0.5], - "8594": [-0.03598, 0.46402, 0, 0, 0.5], - "8602": [-0.13313, 0.36687, 0, 0, 1], - "8603": [-0.13313, 0.36687, 0, 0, 1], - "8606": [0.01354, 0.52239, 0, 0, 1], - "8608": [0.01354, 0.52239, 0, 0, 1], - "8610": [0.01354, 0.52239, 0, 0, 1.11111], - "8611": [0.01354, 0.52239, 0, 0, 1.11111], - "8619": [0, 0.54986, 0, 0, 1], - "8620": [0, 0.54986, 0, 0, 1], - "8621": [-0.13313, 0.37788, 0, 0, 1.38889], - "8622": [-0.13313, 0.36687, 0, 0, 1], - "8624": [0, 0.69224, 0, 0, 0.5], - "8625": [0, 0.69224, 0, 0, 0.5], - "8630": [0, 0.43056, 0, 0, 1], - "8631": [0, 0.43056, 0, 0, 1], - "8634": [0.08198, 0.58198, 0, 0, 0.77778], - "8635": [0.08198, 0.58198, 0, 0, 0.77778], - "8638": [0.19444, 0.69224, 0, 0, 0.41667], - "8639": [0.19444, 0.69224, 0, 0, 0.41667], - "8642": [0.19444, 0.69224, 0, 0, 0.41667], - "8643": [0.19444, 0.69224, 0, 0, 0.41667], - "8644": [0.1808, 0.675, 0, 0, 1], - "8646": [0.1808, 0.675, 0, 0, 1], - "8647": [0.1808, 0.675, 0, 0, 1], - "8648": [0.19444, 0.69224, 0, 0, 0.83334], - "8649": [0.1808, 0.675, 0, 0, 1], - "8650": [0.19444, 0.69224, 0, 0, 0.83334], - "8651": [0.01354, 0.52239, 0, 0, 1], - "8652": [0.01354, 0.52239, 0, 0, 1], - "8653": [-0.13313, 0.36687, 0, 0, 1], - "8654": [-0.13313, 0.36687, 0, 0, 1], - "8655": [-0.13313, 0.36687, 0, 0, 1], - "8666": [0.13667, 0.63667, 0, 0, 1], - "8667": [0.13667, 0.63667, 0, 0, 1], - "8669": [-0.13313, 0.37788, 0, 0, 1], - "8672": [-0.064, 0.437, 0, 0, 1.334], - "8674": [-0.064, 0.437, 0, 0, 1.334], - "8705": [0, 0.825, 0, 0, 0.5], - "8708": [0, 0.68889, 0, 0, 0.55556], - "8709": [0.08167, 0.58167, 0, 0, 0.77778], - "8717": [0, 0.43056, 0, 0, 0.42917], - "8722": [-0.03598, 0.46402, 0, 0, 0.5], - "8724": [0.08198, 0.69224, 0, 0, 0.77778], - "8726": [0.08167, 0.58167, 0, 0, 0.77778], - "8733": [0, 0.69224, 0, 0, 0.77778], - "8736": [0, 0.69224, 0, 0, 0.72222], - "8737": [0, 0.69224, 0, 0, 0.72222], - "8738": [0.03517, 0.52239, 0, 0, 0.72222], - "8739": [0.08167, 0.58167, 0, 0, 0.22222], - "8740": [0.25142, 0.74111, 0, 0, 0.27778], - "8741": [0.08167, 0.58167, 0, 0, 0.38889], - "8742": [0.25142, 0.74111, 0, 0, 0.5], - "8756": [0, 0.69224, 0, 0, 0.66667], - "8757": [0, 0.69224, 0, 0, 0.66667], - "8764": [-0.13313, 0.36687, 0, 0, 0.77778], - "8765": [-0.13313, 0.37788, 0, 0, 0.77778], - "8769": [-0.13313, 0.36687, 0, 0, 0.77778], - "8770": [-0.03625, 0.46375, 0, 0, 0.77778], - "8774": [0.30274, 0.79383, 0, 0, 0.77778], - "8776": [-0.01688, 0.48312, 0, 0, 0.77778], - "8778": [0.08167, 0.58167, 0, 0, 0.77778], - "8782": [0.06062, 0.54986, 0, 0, 0.77778], - "8783": [0.06062, 0.54986, 0, 0, 0.77778], - "8785": [0.08198, 0.58198, 0, 0, 0.77778], - "8786": [0.08198, 0.58198, 0, 0, 0.77778], - "8787": [0.08198, 0.58198, 0, 0, 0.77778], - "8790": [0, 0.69224, 0, 0, 0.77778], - "8791": [0.22958, 0.72958, 0, 0, 0.77778], - "8796": [0.08198, 0.91667, 0, 0, 0.77778], - "8806": [0.25583, 0.75583, 0, 0, 0.77778], - "8807": [0.25583, 0.75583, 0, 0, 0.77778], - "8808": [0.25142, 0.75726, 0, 0, 0.77778], - "8809": [0.25142, 0.75726, 0, 0, 0.77778], - "8812": [0.25583, 0.75583, 0, 0, 0.5], - "8814": [0.20576, 0.70576, 0, 0, 0.77778], - "8815": [0.20576, 0.70576, 0, 0, 0.77778], - "8816": [0.30274, 0.79383, 0, 0, 0.77778], - "8817": [0.30274, 0.79383, 0, 0, 0.77778], - "8818": [0.22958, 0.72958, 0, 0, 0.77778], - "8819": [0.22958, 0.72958, 0, 0, 0.77778], - "8822": [0.1808, 0.675, 0, 0, 0.77778], - "8823": [0.1808, 0.675, 0, 0, 0.77778], - "8828": [0.13667, 0.63667, 0, 0, 0.77778], - "8829": [0.13667, 0.63667, 0, 0, 0.77778], - "8830": [0.22958, 0.72958, 0, 0, 0.77778], - "8831": [0.22958, 0.72958, 0, 0, 0.77778], - "8832": [0.20576, 0.70576, 0, 0, 0.77778], - "8833": [0.20576, 0.70576, 0, 0, 0.77778], - "8840": [0.30274, 0.79383, 0, 0, 0.77778], - "8841": [0.30274, 0.79383, 0, 0, 0.77778], - "8842": [0.13597, 0.63597, 0, 0, 0.77778], - "8843": [0.13597, 0.63597, 0, 0, 0.77778], - "8847": [0.03517, 0.54986, 0, 0, 0.77778], - "8848": [0.03517, 0.54986, 0, 0, 0.77778], - "8858": [0.08198, 0.58198, 0, 0, 0.77778], - "8859": [0.08198, 0.58198, 0, 0, 0.77778], - "8861": [0.08198, 0.58198, 0, 0, 0.77778], - "8862": [0, 0.675, 0, 0, 0.77778], - "8863": [0, 0.675, 0, 0, 0.77778], - "8864": [0, 0.675, 0, 0, 0.77778], - "8865": [0, 0.675, 0, 0, 0.77778], - "8872": [0, 0.69224, 0, 0, 0.61111], - "8873": [0, 0.69224, 0, 0, 0.72222], - "8874": [0, 0.69224, 0, 0, 0.88889], - "8876": [0, 0.68889, 0, 0, 0.61111], - "8877": [0, 0.68889, 0, 0, 0.61111], - "8878": [0, 0.68889, 0, 0, 0.72222], - "8879": [0, 0.68889, 0, 0, 0.72222], - "8882": [0.03517, 0.54986, 0, 0, 0.77778], - "8883": [0.03517, 0.54986, 0, 0, 0.77778], - "8884": [0.13667, 0.63667, 0, 0, 0.77778], - "8885": [0.13667, 0.63667, 0, 0, 0.77778], - "8888": [0, 0.54986, 0, 0, 1.11111], - "8890": [0.19444, 0.43056, 0, 0, 0.55556], - "8891": [0.19444, 0.69224, 0, 0, 0.61111], - "8892": [0.19444, 0.69224, 0, 0, 0.61111], - "8901": [0, 0.54986, 0, 0, 0.27778], - "8903": [0.08167, 0.58167, 0, 0, 0.77778], - "8905": [0.08167, 0.58167, 0, 0, 0.77778], - "8906": [0.08167, 0.58167, 0, 0, 0.77778], - "8907": [0, 0.69224, 0, 0, 0.77778], - "8908": [0, 0.69224, 0, 0, 0.77778], - "8909": [-0.03598, 0.46402, 0, 0, 0.77778], - "8910": [0, 0.54986, 0, 0, 0.76042], - "8911": [0, 0.54986, 0, 0, 0.76042], - "8912": [0.03517, 0.54986, 0, 0, 0.77778], - "8913": [0.03517, 0.54986, 0, 0, 0.77778], - "8914": [0, 0.54986, 0, 0, 0.66667], - "8915": [0, 0.54986, 0, 0, 0.66667], - "8916": [0, 0.69224, 0, 0, 0.66667], - "8918": [0.0391, 0.5391, 0, 0, 0.77778], - "8919": [0.0391, 0.5391, 0, 0, 0.77778], - "8920": [0.03517, 0.54986, 0, 0, 1.33334], - "8921": [0.03517, 0.54986, 0, 0, 1.33334], - "8922": [0.38569, 0.88569, 0, 0, 0.77778], - "8923": [0.38569, 0.88569, 0, 0, 0.77778], - "8926": [0.13667, 0.63667, 0, 0, 0.77778], - "8927": [0.13667, 0.63667, 0, 0, 0.77778], - "8928": [0.30274, 0.79383, 0, 0, 0.77778], - "8929": [0.30274, 0.79383, 0, 0, 0.77778], - "8934": [0.23222, 0.74111, 0, 0, 0.77778], - "8935": [0.23222, 0.74111, 0, 0, 0.77778], - "8936": [0.23222, 0.74111, 0, 0, 0.77778], - "8937": [0.23222, 0.74111, 0, 0, 0.77778], - "8938": [0.20576, 0.70576, 0, 0, 0.77778], - "8939": [0.20576, 0.70576, 0, 0, 0.77778], - "8940": [0.30274, 0.79383, 0, 0, 0.77778], - "8941": [0.30274, 0.79383, 0, 0, 0.77778], - "8994": [0.19444, 0.69224, 0, 0, 0.77778], - "8995": [0.19444, 0.69224, 0, 0, 0.77778], - "9416": [0.15559, 0.69224, 0, 0, 0.90222], - "9484": [0, 0.69224, 0, 0, 0.5], - "9488": [0, 0.69224, 0, 0, 0.5], - "9492": [0, 0.37788, 0, 0, 0.5], - "9496": [0, 0.37788, 0, 0, 0.5], - "9585": [0.19444, 0.68889, 0, 0, 0.88889], - "9586": [0.19444, 0.74111, 0, 0, 0.88889], - "9632": [0, 0.675, 0, 0, 0.77778], - "9633": [0, 0.675, 0, 0, 0.77778], - "9650": [0, 0.54986, 0, 0, 0.72222], - "9651": [0, 0.54986, 0, 0, 0.72222], - "9654": [0.03517, 0.54986, 0, 0, 0.77778], - "9660": [0, 0.54986, 0, 0, 0.72222], - "9661": [0, 0.54986, 0, 0, 0.72222], - "9664": [0.03517, 0.54986, 0, 0, 0.77778], - "9674": [0.11111, 0.69224, 0, 0, 0.66667], - "9733": [0.19444, 0.69224, 0, 0, 0.94445], - "10003": [0, 0.69224, 0, 0, 0.83334], - "10016": [0, 0.69224, 0, 0, 0.83334], - "10731": [0.11111, 0.69224, 0, 0, 0.66667], - "10846": [0.19444, 0.75583, 0, 0, 0.61111], - "10877": [0.13667, 0.63667, 0, 0, 0.77778], - "10878": [0.13667, 0.63667, 0, 0, 0.77778], - "10885": [0.25583, 0.75583, 0, 0, 0.77778], - "10886": [0.25583, 0.75583, 0, 0, 0.77778], - "10887": [0.13597, 0.63597, 0, 0, 0.77778], - "10888": [0.13597, 0.63597, 0, 0, 0.77778], - "10889": [0.26167, 0.75726, 0, 0, 0.77778], - "10890": [0.26167, 0.75726, 0, 0, 0.77778], - "10891": [0.48256, 0.98256, 0, 0, 0.77778], - "10892": [0.48256, 0.98256, 0, 0, 0.77778], - "10901": [0.13667, 0.63667, 0, 0, 0.77778], - "10902": [0.13667, 0.63667, 0, 0, 0.77778], - "10933": [0.25142, 0.75726, 0, 0, 0.77778], - "10934": [0.25142, 0.75726, 0, 0, 0.77778], - "10935": [0.26167, 0.75726, 0, 0, 0.77778], - "10936": [0.26167, 0.75726, 0, 0, 0.77778], - "10937": [0.26167, 0.75726, 0, 0, 0.77778], - "10938": [0.26167, 0.75726, 0, 0, 0.77778], - "10949": [0.25583, 0.75583, 0, 0, 0.77778], - "10950": [0.25583, 0.75583, 0, 0, 0.77778], - "10955": [0.28481, 0.79383, 0, 0, 0.77778], - "10956": [0.28481, 0.79383, 0, 0, 0.77778], - "57350": [0.08167, 0.58167, 0, 0, 0.22222], - "57351": [0.08167, 0.58167, 0, 0, 0.38889], - "57352": [0.08167, 0.58167, 0, 0, 0.77778], - "57353": [0, 0.43056, 0.04028, 0, 0.66667], - "57356": [0.25142, 0.75726, 0, 0, 0.77778], - "57357": [0.25142, 0.75726, 0, 0, 0.77778], - "57358": [0.41951, 0.91951, 0, 0, 0.77778], - "57359": [0.30274, 0.79383, 0, 0, 0.77778], - "57360": [0.30274, 0.79383, 0, 0, 0.77778], - "57361": [0.41951, 0.91951, 0, 0, 0.77778], - "57366": [0.25142, 0.75726, 0, 0, 0.77778], - "57367": [0.25142, 0.75726, 0, 0, 0.77778], - "57368": [0.25142, 0.75726, 0, 0, 0.77778], - "57369": [0.25142, 0.75726, 0, 0, 0.77778], - "57370": [0.13597, 0.63597, 0, 0, 0.77778], - "57371": [0.13597, 0.63597, 0, 0, 0.77778] - }, - "Caligraphic-Regular": { - "32": [0, 0, 0, 0, 0.25], - "65": [0, 0.68333, 0, 0.19445, 0.79847], - "66": [0, 0.68333, 0.03041, 0.13889, 0.65681], - "67": [0, 0.68333, 0.05834, 0.13889, 0.52653], - "68": [0, 0.68333, 0.02778, 0.08334, 0.77139], - "69": [0, 0.68333, 0.08944, 0.11111, 0.52778], - "70": [0, 0.68333, 0.09931, 0.11111, 0.71875], - "71": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487], - "72": [0, 0.68333, 965e-5, 0.11111, 0.84452], - "73": [0, 0.68333, 0.07382, 0, 0.54452], - "74": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778], - "75": [0, 0.68333, 0.01445, 0.05556, 0.76195], - "76": [0, 0.68333, 0, 0.13889, 0.68972], - "77": [0, 0.68333, 0, 0.13889, 1.2009], - "78": [0, 0.68333, 0.14736, 0.08334, 0.82049], - "79": [0, 0.68333, 0.02778, 0.11111, 0.79611], - "80": [0, 0.68333, 0.08222, 0.08334, 0.69556], - "81": [0.09722, 0.68333, 0, 0.11111, 0.81667], - "82": [0, 0.68333, 0, 0.08334, 0.8475], - "83": [0, 0.68333, 0.075, 0.13889, 0.60556], - "84": [0, 0.68333, 0.25417, 0, 0.54464], - "85": [0, 0.68333, 0.09931, 0.08334, 0.62583], - "86": [0, 0.68333, 0.08222, 0, 0.61278], - "87": [0, 0.68333, 0.08222, 0.08334, 0.98778], - "88": [0, 0.68333, 0.14643, 0.13889, 0.7133], - "89": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834], - "90": [0, 0.68333, 0.07944, 0.13889, 0.72473], - "160": [0, 0, 0, 0, 0.25] - }, - "Fraktur-Regular": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69141, 0, 0, 0.29574], - "34": [0, 0.69141, 0, 0, 0.21471], - "38": [0, 0.69141, 0, 0, 0.73786], - "39": [0, 0.69141, 0, 0, 0.21201], - "40": [0.24982, 0.74947, 0, 0, 0.38865], - "41": [0.24982, 0.74947, 0, 0, 0.38865], - "42": [0, 0.62119, 0, 0, 0.27764], - "43": [0.08319, 0.58283, 0, 0, 0.75623], - "44": [0, 0.10803, 0, 0, 0.27764], - "45": [0.08319, 0.58283, 0, 0, 0.75623], - "46": [0, 0.10803, 0, 0, 0.27764], - "47": [0.24982, 0.74947, 0, 0, 0.50181], - "48": [0, 0.47534, 0, 0, 0.50181], - "49": [0, 0.47534, 0, 0, 0.50181], - "50": [0, 0.47534, 0, 0, 0.50181], - "51": [0.18906, 0.47534, 0, 0, 0.50181], - "52": [0.18906, 0.47534, 0, 0, 0.50181], - "53": [0.18906, 0.47534, 0, 0, 0.50181], - "54": [0, 0.69141, 0, 0, 0.50181], - "55": [0.18906, 0.47534, 0, 0, 0.50181], - "56": [0, 0.69141, 0, 0, 0.50181], - "57": [0.18906, 0.47534, 0, 0, 0.50181], - "58": [0, 0.47534, 0, 0, 0.21606], - "59": [0.12604, 0.47534, 0, 0, 0.21606], - "61": [-0.13099, 0.36866, 0, 0, 0.75623], - "63": [0, 0.69141, 0, 0, 0.36245], - "65": [0, 0.69141, 0, 0, 0.7176], - "66": [0, 0.69141, 0, 0, 0.88397], - "67": [0, 0.69141, 0, 0, 0.61254], - "68": [0, 0.69141, 0, 0, 0.83158], - "69": [0, 0.69141, 0, 0, 0.66278], - "70": [0.12604, 0.69141, 0, 0, 0.61119], - "71": [0, 0.69141, 0, 0, 0.78539], - "72": [0.06302, 0.69141, 0, 0, 0.7203], - "73": [0, 0.69141, 0, 0, 0.55448], - "74": [0.12604, 0.69141, 0, 0, 0.55231], - "75": [0, 0.69141, 0, 0, 0.66845], - "76": [0, 0.69141, 0, 0, 0.66602], - "77": [0, 0.69141, 0, 0, 1.04953], - "78": [0, 0.69141, 0, 0, 0.83212], - "79": [0, 0.69141, 0, 0, 0.82699], - "80": [0.18906, 0.69141, 0, 0, 0.82753], - "81": [0.03781, 0.69141, 0, 0, 0.82699], - "82": [0, 0.69141, 0, 0, 0.82807], - "83": [0, 0.69141, 0, 0, 0.82861], - "84": [0, 0.69141, 0, 0, 0.66899], - "85": [0, 0.69141, 0, 0, 0.64576], - "86": [0, 0.69141, 0, 0, 0.83131], - "87": [0, 0.69141, 0, 0, 1.04602], - "88": [0, 0.69141, 0, 0, 0.71922], - "89": [0.18906, 0.69141, 0, 0, 0.83293], - "90": [0.12604, 0.69141, 0, 0, 0.60201], - "91": [0.24982, 0.74947, 0, 0, 0.27764], - "93": [0.24982, 0.74947, 0, 0, 0.27764], - "94": [0, 0.69141, 0, 0, 0.49965], - "97": [0, 0.47534, 0, 0, 0.50046], - "98": [0, 0.69141, 0, 0, 0.51315], - "99": [0, 0.47534, 0, 0, 0.38946], - "100": [0, 0.62119, 0, 0, 0.49857], - "101": [0, 0.47534, 0, 0, 0.40053], - "102": [0.18906, 0.69141, 0, 0, 0.32626], - "103": [0.18906, 0.47534, 0, 0, 0.5037], - "104": [0.18906, 0.69141, 0, 0, 0.52126], - "105": [0, 0.69141, 0, 0, 0.27899], - "106": [0, 0.69141, 0, 0, 0.28088], - "107": [0, 0.69141, 0, 0, 0.38946], - "108": [0, 0.69141, 0, 0, 0.27953], - "109": [0, 0.47534, 0, 0, 0.76676], - "110": [0, 0.47534, 0, 0, 0.52666], - "111": [0, 0.47534, 0, 0, 0.48885], - "112": [0.18906, 0.52396, 0, 0, 0.50046], - "113": [0.18906, 0.47534, 0, 0, 0.48912], - "114": [0, 0.47534, 0, 0, 0.38919], - "115": [0, 0.47534, 0, 0, 0.44266], - "116": [0, 0.62119, 0, 0, 0.33301], - "117": [0, 0.47534, 0, 0, 0.5172], - "118": [0, 0.52396, 0, 0, 0.5118], - "119": [0, 0.52396, 0, 0, 0.77351], - "120": [0.18906, 0.47534, 0, 0, 0.38865], - "121": [0.18906, 0.47534, 0, 0, 0.49884], - "122": [0.18906, 0.47534, 0, 0, 0.39054], - "160": [0, 0, 0, 0, 0.25], - "8216": [0, 0.69141, 0, 0, 0.21471], - "8217": [0, 0.69141, 0, 0, 0.21471], - "58112": [0, 0.62119, 0, 0, 0.49749], - "58113": [0, 0.62119, 0, 0, 0.4983], - "58114": [0.18906, 0.69141, 0, 0, 0.33328], - "58115": [0.18906, 0.69141, 0, 0, 0.32923], - "58116": [0.18906, 0.47534, 0, 0, 0.50343], - "58117": [0, 0.69141, 0, 0, 0.33301], - "58118": [0, 0.62119, 0, 0, 0.33409], - "58119": [0, 0.47534, 0, 0, 0.50073] - }, - "Main-Bold": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69444, 0, 0, 0.35], - "34": [0, 0.69444, 0, 0, 0.60278], - "35": [0.19444, 0.69444, 0, 0, 0.95833], - "36": [0.05556, 0.75, 0, 0, 0.575], - "37": [0.05556, 0.75, 0, 0, 0.95833], - "38": [0, 0.69444, 0, 0, 0.89444], - "39": [0, 0.69444, 0, 0, 0.31944], - "40": [0.25, 0.75, 0, 0, 0.44722], - "41": [0.25, 0.75, 0, 0, 0.44722], - "42": [0, 0.75, 0, 0, 0.575], - "43": [0.13333, 0.63333, 0, 0, 0.89444], - "44": [0.19444, 0.15556, 0, 0, 0.31944], - "45": [0, 0.44444, 0, 0, 0.38333], - "46": [0, 0.15556, 0, 0, 0.31944], - "47": [0.25, 0.75, 0, 0, 0.575], - "48": [0, 0.64444, 0, 0, 0.575], - "49": [0, 0.64444, 0, 0, 0.575], - "50": [0, 0.64444, 0, 0, 0.575], - "51": [0, 0.64444, 0, 0, 0.575], - "52": [0, 0.64444, 0, 0, 0.575], - "53": [0, 0.64444, 0, 0, 0.575], - "54": [0, 0.64444, 0, 0, 0.575], - "55": [0, 0.64444, 0, 0, 0.575], - "56": [0, 0.64444, 0, 0, 0.575], - "57": [0, 0.64444, 0, 0, 0.575], - "58": [0, 0.44444, 0, 0, 0.31944], - "59": [0.19444, 0.44444, 0, 0, 0.31944], - "60": [0.08556, 0.58556, 0, 0, 0.89444], - "61": [-0.10889, 0.39111, 0, 0, 0.89444], - "62": [0.08556, 0.58556, 0, 0, 0.89444], - "63": [0, 0.69444, 0, 0, 0.54305], - "64": [0, 0.69444, 0, 0, 0.89444], - "65": [0, 0.68611, 0, 0, 0.86944], - "66": [0, 0.68611, 0, 0, 0.81805], - "67": [0, 0.68611, 0, 0, 0.83055], - "68": [0, 0.68611, 0, 0, 0.88194], - "69": [0, 0.68611, 0, 0, 0.75555], - "70": [0, 0.68611, 0, 0, 0.72361], - "71": [0, 0.68611, 0, 0, 0.90416], - "72": [0, 0.68611, 0, 0, 0.9], - "73": [0, 0.68611, 0, 0, 0.43611], - "74": [0, 0.68611, 0, 0, 0.59444], - "75": [0, 0.68611, 0, 0, 0.90138], - "76": [0, 0.68611, 0, 0, 0.69166], - "77": [0, 0.68611, 0, 0, 1.09166], - "78": [0, 0.68611, 0, 0, 0.9], - "79": [0, 0.68611, 0, 0, 0.86388], - "80": [0, 0.68611, 0, 0, 0.78611], - "81": [0.19444, 0.68611, 0, 0, 0.86388], - "82": [0, 0.68611, 0, 0, 0.8625], - "83": [0, 0.68611, 0, 0, 0.63889], - "84": [0, 0.68611, 0, 0, 0.8], - "85": [0, 0.68611, 0, 0, 0.88472], - "86": [0, 0.68611, 0.01597, 0, 0.86944], - "87": [0, 0.68611, 0.01597, 0, 1.18888], - "88": [0, 0.68611, 0, 0, 0.86944], - "89": [0, 0.68611, 0.02875, 0, 0.86944], - "90": [0, 0.68611, 0, 0, 0.70277], - "91": [0.25, 0.75, 0, 0, 0.31944], - "92": [0.25, 0.75, 0, 0, 0.575], - "93": [0.25, 0.75, 0, 0, 0.31944], - "94": [0, 0.69444, 0, 0, 0.575], - "95": [0.31, 0.13444, 0.03194, 0, 0.575], - "97": [0, 0.44444, 0, 0, 0.55902], - "98": [0, 0.69444, 0, 0, 0.63889], - "99": [0, 0.44444, 0, 0, 0.51111], - "100": [0, 0.69444, 0, 0, 0.63889], - "101": [0, 0.44444, 0, 0, 0.52708], - "102": [0, 0.69444, 0.10903, 0, 0.35139], - "103": [0.19444, 0.44444, 0.01597, 0, 0.575], - "104": [0, 0.69444, 0, 0, 0.63889], - "105": [0, 0.69444, 0, 0, 0.31944], - "106": [0.19444, 0.69444, 0, 0, 0.35139], - "107": [0, 0.69444, 0, 0, 0.60694], - "108": [0, 0.69444, 0, 0, 0.31944], - "109": [0, 0.44444, 0, 0, 0.95833], - "110": [0, 0.44444, 0, 0, 0.63889], - "111": [0, 0.44444, 0, 0, 0.575], - "112": [0.19444, 0.44444, 0, 0, 0.63889], - "113": [0.19444, 0.44444, 0, 0, 0.60694], - "114": [0, 0.44444, 0, 0, 0.47361], - "115": [0, 0.44444, 0, 0, 0.45361], - "116": [0, 0.63492, 0, 0, 0.44722], - "117": [0, 0.44444, 0, 0, 0.63889], - "118": [0, 0.44444, 0.01597, 0, 0.60694], - "119": [0, 0.44444, 0.01597, 0, 0.83055], - "120": [0, 0.44444, 0, 0, 0.60694], - "121": [0.19444, 0.44444, 0.01597, 0, 0.60694], - "122": [0, 0.44444, 0, 0, 0.51111], - "123": [0.25, 0.75, 0, 0, 0.575], - "124": [0.25, 0.75, 0, 0, 0.31944], - "125": [0.25, 0.75, 0, 0, 0.575], - "126": [0.35, 0.34444, 0, 0, 0.575], - "160": [0, 0, 0, 0, 0.25], - "163": [0, 0.69444, 0, 0, 0.86853], - "168": [0, 0.69444, 0, 0, 0.575], - "172": [0, 0.44444, 0, 0, 0.76666], - "176": [0, 0.69444, 0, 0, 0.86944], - "177": [0.13333, 0.63333, 0, 0, 0.89444], - "184": [0.17014, 0, 0, 0, 0.51111], - "198": [0, 0.68611, 0, 0, 1.04166], - "215": [0.13333, 0.63333, 0, 0, 0.89444], - "216": [0.04861, 0.73472, 0, 0, 0.89444], - "223": [0, 0.69444, 0, 0, 0.59722], - "230": [0, 0.44444, 0, 0, 0.83055], - "247": [0.13333, 0.63333, 0, 0, 0.89444], - "248": [0.09722, 0.54167, 0, 0, 0.575], - "305": [0, 0.44444, 0, 0, 0.31944], - "338": [0, 0.68611, 0, 0, 1.16944], - "339": [0, 0.44444, 0, 0, 0.89444], - "567": [0.19444, 0.44444, 0, 0, 0.35139], - "710": [0, 0.69444, 0, 0, 0.575], - "711": [0, 0.63194, 0, 0, 0.575], - "713": [0, 0.59611, 0, 0, 0.575], - "714": [0, 0.69444, 0, 0, 0.575], - "715": [0, 0.69444, 0, 0, 0.575], - "728": [0, 0.69444, 0, 0, 0.575], - "729": [0, 0.69444, 0, 0, 0.31944], - "730": [0, 0.69444, 0, 0, 0.86944], - "732": [0, 0.69444, 0, 0, 0.575], - "733": [0, 0.69444, 0, 0, 0.575], - "915": [0, 0.68611, 0, 0, 0.69166], - "916": [0, 0.68611, 0, 0, 0.95833], - "920": [0, 0.68611, 0, 0, 0.89444], - "923": [0, 0.68611, 0, 0, 0.80555], - "926": [0, 0.68611, 0, 0, 0.76666], - "928": [0, 0.68611, 0, 0, 0.9], - "931": [0, 0.68611, 0, 0, 0.83055], - "933": [0, 0.68611, 0, 0, 0.89444], - "934": [0, 0.68611, 0, 0, 0.83055], - "936": [0, 0.68611, 0, 0, 0.89444], - "937": [0, 0.68611, 0, 0, 0.83055], - "8211": [0, 0.44444, 0.03194, 0, 0.575], - "8212": [0, 0.44444, 0.03194, 0, 1.14999], - "8216": [0, 0.69444, 0, 0, 0.31944], - "8217": [0, 0.69444, 0, 0, 0.31944], - "8220": [0, 0.69444, 0, 0, 0.60278], - "8221": [0, 0.69444, 0, 0, 0.60278], - "8224": [0.19444, 0.69444, 0, 0, 0.51111], - "8225": [0.19444, 0.69444, 0, 0, 0.51111], - "8242": [0, 0.55556, 0, 0, 0.34444], - "8407": [0, 0.72444, 0.15486, 0, 0.575], - "8463": [0, 0.69444, 0, 0, 0.66759], - "8465": [0, 0.69444, 0, 0, 0.83055], - "8467": [0, 0.69444, 0, 0, 0.47361], - "8472": [0.19444, 0.44444, 0, 0, 0.74027], - "8476": [0, 0.69444, 0, 0, 0.83055], - "8501": [0, 0.69444, 0, 0, 0.70277], - "8592": [-0.10889, 0.39111, 0, 0, 1.14999], - "8593": [0.19444, 0.69444, 0, 0, 0.575], - "8594": [-0.10889, 0.39111, 0, 0, 1.14999], - "8595": [0.19444, 0.69444, 0, 0, 0.575], - "8596": [-0.10889, 0.39111, 0, 0, 1.14999], - "8597": [0.25, 0.75, 0, 0, 0.575], - "8598": [0.19444, 0.69444, 0, 0, 1.14999], - "8599": [0.19444, 0.69444, 0, 0, 1.14999], - "8600": [0.19444, 0.69444, 0, 0, 1.14999], - "8601": [0.19444, 0.69444, 0, 0, 1.14999], - "8636": [-0.10889, 0.39111, 0, 0, 1.14999], - "8637": [-0.10889, 0.39111, 0, 0, 1.14999], - "8640": [-0.10889, 0.39111, 0, 0, 1.14999], - "8641": [-0.10889, 0.39111, 0, 0, 1.14999], - "8656": [-0.10889, 0.39111, 0, 0, 1.14999], - "8657": [0.19444, 0.69444, 0, 0, 0.70277], - "8658": [-0.10889, 0.39111, 0, 0, 1.14999], - "8659": [0.19444, 0.69444, 0, 0, 0.70277], - "8660": [-0.10889, 0.39111, 0, 0, 1.14999], - "8661": [0.25, 0.75, 0, 0, 0.70277], - "8704": [0, 0.69444, 0, 0, 0.63889], - "8706": [0, 0.69444, 0.06389, 0, 0.62847], - "8707": [0, 0.69444, 0, 0, 0.63889], - "8709": [0.05556, 0.75, 0, 0, 0.575], - "8711": [0, 0.68611, 0, 0, 0.95833], - "8712": [0.08556, 0.58556, 0, 0, 0.76666], - "8715": [0.08556, 0.58556, 0, 0, 0.76666], - "8722": [0.13333, 0.63333, 0, 0, 0.89444], - "8723": [0.13333, 0.63333, 0, 0, 0.89444], - "8725": [0.25, 0.75, 0, 0, 0.575], - "8726": [0.25, 0.75, 0, 0, 0.575], - "8727": [-0.02778, 0.47222, 0, 0, 0.575], - "8728": [-0.02639, 0.47361, 0, 0, 0.575], - "8729": [-0.02639, 0.47361, 0, 0, 0.575], - "8730": [0.18, 0.82, 0, 0, 0.95833], - "8733": [0, 0.44444, 0, 0, 0.89444], - "8734": [0, 0.44444, 0, 0, 1.14999], - "8736": [0, 0.69224, 0, 0, 0.72222], - "8739": [0.25, 0.75, 0, 0, 0.31944], - "8741": [0.25, 0.75, 0, 0, 0.575], - "8743": [0, 0.55556, 0, 0, 0.76666], - "8744": [0, 0.55556, 0, 0, 0.76666], - "8745": [0, 0.55556, 0, 0, 0.76666], - "8746": [0, 0.55556, 0, 0, 0.76666], - "8747": [0.19444, 0.69444, 0.12778, 0, 0.56875], - "8764": [-0.10889, 0.39111, 0, 0, 0.89444], - "8768": [0.19444, 0.69444, 0, 0, 0.31944], - "8771": [222e-5, 0.50222, 0, 0, 0.89444], - "8773": [0.027, 0.638, 0, 0, 0.894], - "8776": [0.02444, 0.52444, 0, 0, 0.89444], - "8781": [222e-5, 0.50222, 0, 0, 0.89444], - "8801": [222e-5, 0.50222, 0, 0, 0.89444], - "8804": [0.19667, 0.69667, 0, 0, 0.89444], - "8805": [0.19667, 0.69667, 0, 0, 0.89444], - "8810": [0.08556, 0.58556, 0, 0, 1.14999], - "8811": [0.08556, 0.58556, 0, 0, 1.14999], - "8826": [0.08556, 0.58556, 0, 0, 0.89444], - "8827": [0.08556, 0.58556, 0, 0, 0.89444], - "8834": [0.08556, 0.58556, 0, 0, 0.89444], - "8835": [0.08556, 0.58556, 0, 0, 0.89444], - "8838": [0.19667, 0.69667, 0, 0, 0.89444], - "8839": [0.19667, 0.69667, 0, 0, 0.89444], - "8846": [0, 0.55556, 0, 0, 0.76666], - "8849": [0.19667, 0.69667, 0, 0, 0.89444], - "8850": [0.19667, 0.69667, 0, 0, 0.89444], - "8851": [0, 0.55556, 0, 0, 0.76666], - "8852": [0, 0.55556, 0, 0, 0.76666], - "8853": [0.13333, 0.63333, 0, 0, 0.89444], - "8854": [0.13333, 0.63333, 0, 0, 0.89444], - "8855": [0.13333, 0.63333, 0, 0, 0.89444], - "8856": [0.13333, 0.63333, 0, 0, 0.89444], - "8857": [0.13333, 0.63333, 0, 0, 0.89444], - "8866": [0, 0.69444, 0, 0, 0.70277], - "8867": [0, 0.69444, 0, 0, 0.70277], - "8868": [0, 0.69444, 0, 0, 0.89444], - "8869": [0, 0.69444, 0, 0, 0.89444], - "8900": [-0.02639, 0.47361, 0, 0, 0.575], - "8901": [-0.02639, 0.47361, 0, 0, 0.31944], - "8902": [-0.02778, 0.47222, 0, 0, 0.575], - "8968": [0.25, 0.75, 0, 0, 0.51111], - "8969": [0.25, 0.75, 0, 0, 0.51111], - "8970": [0.25, 0.75, 0, 0, 0.51111], - "8971": [0.25, 0.75, 0, 0, 0.51111], - "8994": [-0.13889, 0.36111, 0, 0, 1.14999], - "8995": [-0.13889, 0.36111, 0, 0, 1.14999], - "9651": [0.19444, 0.69444, 0, 0, 1.02222], - "9657": [-0.02778, 0.47222, 0, 0, 0.575], - "9661": [0.19444, 0.69444, 0, 0, 1.02222], - "9667": [-0.02778, 0.47222, 0, 0, 0.575], - "9711": [0.19444, 0.69444, 0, 0, 1.14999], - "9824": [0.12963, 0.69444, 0, 0, 0.89444], - "9825": [0.12963, 0.69444, 0, 0, 0.89444], - "9826": [0.12963, 0.69444, 0, 0, 0.89444], - "9827": [0.12963, 0.69444, 0, 0, 0.89444], - "9837": [0, 0.75, 0, 0, 0.44722], - "9838": [0.19444, 0.69444, 0, 0, 0.44722], - "9839": [0.19444, 0.69444, 0, 0, 0.44722], - "10216": [0.25, 0.75, 0, 0, 0.44722], - "10217": [0.25, 0.75, 0, 0, 0.44722], - "10815": [0, 0.68611, 0, 0, 0.9], - "10927": [0.19667, 0.69667, 0, 0, 0.89444], - "10928": [0.19667, 0.69667, 0, 0, 0.89444], - "57376": [0.19444, 0.69444, 0, 0, 0] - }, - "Main-BoldItalic": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69444, 0.11417, 0, 0.38611], - "34": [0, 0.69444, 0.07939, 0, 0.62055], - "35": [0.19444, 0.69444, 0.06833, 0, 0.94444], - "37": [0.05556, 0.75, 0.12861, 0, 0.94444], - "38": [0, 0.69444, 0.08528, 0, 0.88555], - "39": [0, 0.69444, 0.12945, 0, 0.35555], - "40": [0.25, 0.75, 0.15806, 0, 0.47333], - "41": [0.25, 0.75, 0.03306, 0, 0.47333], - "42": [0, 0.75, 0.14333, 0, 0.59111], - "43": [0.10333, 0.60333, 0.03306, 0, 0.88555], - "44": [0.19444, 0.14722, 0, 0, 0.35555], - "45": [0, 0.44444, 0.02611, 0, 0.41444], - "46": [0, 0.14722, 0, 0, 0.35555], - "47": [0.25, 0.75, 0.15806, 0, 0.59111], - "48": [0, 0.64444, 0.13167, 0, 0.59111], - "49": [0, 0.64444, 0.13167, 0, 0.59111], - "50": [0, 0.64444, 0.13167, 0, 0.59111], - "51": [0, 0.64444, 0.13167, 0, 0.59111], - "52": [0.19444, 0.64444, 0.13167, 0, 0.59111], - "53": [0, 0.64444, 0.13167, 0, 0.59111], - "54": [0, 0.64444, 0.13167, 0, 0.59111], - "55": [0.19444, 0.64444, 0.13167, 0, 0.59111], - "56": [0, 0.64444, 0.13167, 0, 0.59111], - "57": [0, 0.64444, 0.13167, 0, 0.59111], - "58": [0, 0.44444, 0.06695, 0, 0.35555], - "59": [0.19444, 0.44444, 0.06695, 0, 0.35555], - "61": [-0.10889, 0.39111, 0.06833, 0, 0.88555], - "63": [0, 0.69444, 0.11472, 0, 0.59111], - "64": [0, 0.69444, 0.09208, 0, 0.88555], - "65": [0, 0.68611, 0, 0, 0.86555], - "66": [0, 0.68611, 0.0992, 0, 0.81666], - "67": [0, 0.68611, 0.14208, 0, 0.82666], - "68": [0, 0.68611, 0.09062, 0, 0.87555], - "69": [0, 0.68611, 0.11431, 0, 0.75666], - "70": [0, 0.68611, 0.12903, 0, 0.72722], - "71": [0, 0.68611, 0.07347, 0, 0.89527], - "72": [0, 0.68611, 0.17208, 0, 0.8961], - "73": [0, 0.68611, 0.15681, 0, 0.47166], - "74": [0, 0.68611, 0.145, 0, 0.61055], - "75": [0, 0.68611, 0.14208, 0, 0.89499], - "76": [0, 0.68611, 0, 0, 0.69777], - "77": [0, 0.68611, 0.17208, 0, 1.07277], - "78": [0, 0.68611, 0.17208, 0, 0.8961], - "79": [0, 0.68611, 0.09062, 0, 0.85499], - "80": [0, 0.68611, 0.0992, 0, 0.78721], - "81": [0.19444, 0.68611, 0.09062, 0, 0.85499], - "82": [0, 0.68611, 0.02559, 0, 0.85944], - "83": [0, 0.68611, 0.11264, 0, 0.64999], - "84": [0, 0.68611, 0.12903, 0, 0.7961], - "85": [0, 0.68611, 0.17208, 0, 0.88083], - "86": [0, 0.68611, 0.18625, 0, 0.86555], - "87": [0, 0.68611, 0.18625, 0, 1.15999], - "88": [0, 0.68611, 0.15681, 0, 0.86555], - "89": [0, 0.68611, 0.19803, 0, 0.86555], - "90": [0, 0.68611, 0.14208, 0, 0.70888], - "91": [0.25, 0.75, 0.1875, 0, 0.35611], - "93": [0.25, 0.75, 0.09972, 0, 0.35611], - "94": [0, 0.69444, 0.06709, 0, 0.59111], - "95": [0.31, 0.13444, 0.09811, 0, 0.59111], - "97": [0, 0.44444, 0.09426, 0, 0.59111], - "98": [0, 0.69444, 0.07861, 0, 0.53222], - "99": [0, 0.44444, 0.05222, 0, 0.53222], - "100": [0, 0.69444, 0.10861, 0, 0.59111], - "101": [0, 0.44444, 0.085, 0, 0.53222], - "102": [0.19444, 0.69444, 0.21778, 0, 0.4], - "103": [0.19444, 0.44444, 0.105, 0, 0.53222], - "104": [0, 0.69444, 0.09426, 0, 0.59111], - "105": [0, 0.69326, 0.11387, 0, 0.35555], - "106": [0.19444, 0.69326, 0.1672, 0, 0.35555], - "107": [0, 0.69444, 0.11111, 0, 0.53222], - "108": [0, 0.69444, 0.10861, 0, 0.29666], - "109": [0, 0.44444, 0.09426, 0, 0.94444], - "110": [0, 0.44444, 0.09426, 0, 0.64999], - "111": [0, 0.44444, 0.07861, 0, 0.59111], - "112": [0.19444, 0.44444, 0.07861, 0, 0.59111], - "113": [0.19444, 0.44444, 0.105, 0, 0.53222], - "114": [0, 0.44444, 0.11111, 0, 0.50167], - "115": [0, 0.44444, 0.08167, 0, 0.48694], - "116": [0, 0.63492, 0.09639, 0, 0.385], - "117": [0, 0.44444, 0.09426, 0, 0.62055], - "118": [0, 0.44444, 0.11111, 0, 0.53222], - "119": [0, 0.44444, 0.11111, 0, 0.76777], - "120": [0, 0.44444, 0.12583, 0, 0.56055], - "121": [0.19444, 0.44444, 0.105, 0, 0.56166], - "122": [0, 0.44444, 0.13889, 0, 0.49055], - "126": [0.35, 0.34444, 0.11472, 0, 0.59111], - "160": [0, 0, 0, 0, 0.25], - "168": [0, 0.69444, 0.11473, 0, 0.59111], - "176": [0, 0.69444, 0, 0, 0.94888], - "184": [0.17014, 0, 0, 0, 0.53222], - "198": [0, 0.68611, 0.11431, 0, 1.02277], - "216": [0.04861, 0.73472, 0.09062, 0, 0.88555], - "223": [0.19444, 0.69444, 0.09736, 0, 0.665], - "230": [0, 0.44444, 0.085, 0, 0.82666], - "248": [0.09722, 0.54167, 0.09458, 0, 0.59111], - "305": [0, 0.44444, 0.09426, 0, 0.35555], - "338": [0, 0.68611, 0.11431, 0, 1.14054], - "339": [0, 0.44444, 0.085, 0, 0.82666], - "567": [0.19444, 0.44444, 0.04611, 0, 0.385], - "710": [0, 0.69444, 0.06709, 0, 0.59111], - "711": [0, 0.63194, 0.08271, 0, 0.59111], - "713": [0, 0.59444, 0.10444, 0, 0.59111], - "714": [0, 0.69444, 0.08528, 0, 0.59111], - "715": [0, 0.69444, 0, 0, 0.59111], - "728": [0, 0.69444, 0.10333, 0, 0.59111], - "729": [0, 0.69444, 0.12945, 0, 0.35555], - "730": [0, 0.69444, 0, 0, 0.94888], - "732": [0, 0.69444, 0.11472, 0, 0.59111], - "733": [0, 0.69444, 0.11472, 0, 0.59111], - "915": [0, 0.68611, 0.12903, 0, 0.69777], - "916": [0, 0.68611, 0, 0, 0.94444], - "920": [0, 0.68611, 0.09062, 0, 0.88555], - "923": [0, 0.68611, 0, 0, 0.80666], - "926": [0, 0.68611, 0.15092, 0, 0.76777], - "928": [0, 0.68611, 0.17208, 0, 0.8961], - "931": [0, 0.68611, 0.11431, 0, 0.82666], - "933": [0, 0.68611, 0.10778, 0, 0.88555], - "934": [0, 0.68611, 0.05632, 0, 0.82666], - "936": [0, 0.68611, 0.10778, 0, 0.88555], - "937": [0, 0.68611, 0.0992, 0, 0.82666], - "8211": [0, 0.44444, 0.09811, 0, 0.59111], - "8212": [0, 0.44444, 0.09811, 0, 1.18221], - "8216": [0, 0.69444, 0.12945, 0, 0.35555], - "8217": [0, 0.69444, 0.12945, 0, 0.35555], - "8220": [0, 0.69444, 0.16772, 0, 0.62055], - "8221": [0, 0.69444, 0.07939, 0, 0.62055] - }, - "Main-Italic": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69444, 0.12417, 0, 0.30667], - "34": [0, 0.69444, 0.06961, 0, 0.51444], - "35": [0.19444, 0.69444, 0.06616, 0, 0.81777], - "37": [0.05556, 0.75, 0.13639, 0, 0.81777], - "38": [0, 0.69444, 0.09694, 0, 0.76666], - "39": [0, 0.69444, 0.12417, 0, 0.30667], - "40": [0.25, 0.75, 0.16194, 0, 0.40889], - "41": [0.25, 0.75, 0.03694, 0, 0.40889], - "42": [0, 0.75, 0.14917, 0, 0.51111], - "43": [0.05667, 0.56167, 0.03694, 0, 0.76666], - "44": [0.19444, 0.10556, 0, 0, 0.30667], - "45": [0, 0.43056, 0.02826, 0, 0.35778], - "46": [0, 0.10556, 0, 0, 0.30667], - "47": [0.25, 0.75, 0.16194, 0, 0.51111], - "48": [0, 0.64444, 0.13556, 0, 0.51111], - "49": [0, 0.64444, 0.13556, 0, 0.51111], - "50": [0, 0.64444, 0.13556, 0, 0.51111], - "51": [0, 0.64444, 0.13556, 0, 0.51111], - "52": [0.19444, 0.64444, 0.13556, 0, 0.51111], - "53": [0, 0.64444, 0.13556, 0, 0.51111], - "54": [0, 0.64444, 0.13556, 0, 0.51111], - "55": [0.19444, 0.64444, 0.13556, 0, 0.51111], - "56": [0, 0.64444, 0.13556, 0, 0.51111], - "57": [0, 0.64444, 0.13556, 0, 0.51111], - "58": [0, 0.43056, 0.0582, 0, 0.30667], - "59": [0.19444, 0.43056, 0.0582, 0, 0.30667], - "61": [-0.13313, 0.36687, 0.06616, 0, 0.76666], - "63": [0, 0.69444, 0.1225, 0, 0.51111], - "64": [0, 0.69444, 0.09597, 0, 0.76666], - "65": [0, 0.68333, 0, 0, 0.74333], - "66": [0, 0.68333, 0.10257, 0, 0.70389], - "67": [0, 0.68333, 0.14528, 0, 0.71555], - "68": [0, 0.68333, 0.09403, 0, 0.755], - "69": [0, 0.68333, 0.12028, 0, 0.67833], - "70": [0, 0.68333, 0.13305, 0, 0.65277], - "71": [0, 0.68333, 0.08722, 0, 0.77361], - "72": [0, 0.68333, 0.16389, 0, 0.74333], - "73": [0, 0.68333, 0.15806, 0, 0.38555], - "74": [0, 0.68333, 0.14028, 0, 0.525], - "75": [0, 0.68333, 0.14528, 0, 0.76888], - "76": [0, 0.68333, 0, 0, 0.62722], - "77": [0, 0.68333, 0.16389, 0, 0.89666], - "78": [0, 0.68333, 0.16389, 0, 0.74333], - "79": [0, 0.68333, 0.09403, 0, 0.76666], - "80": [0, 0.68333, 0.10257, 0, 0.67833], - "81": [0.19444, 0.68333, 0.09403, 0, 0.76666], - "82": [0, 0.68333, 0.03868, 0, 0.72944], - "83": [0, 0.68333, 0.11972, 0, 0.56222], - "84": [0, 0.68333, 0.13305, 0, 0.71555], - "85": [0, 0.68333, 0.16389, 0, 0.74333], - "86": [0, 0.68333, 0.18361, 0, 0.74333], - "87": [0, 0.68333, 0.18361, 0, 0.99888], - "88": [0, 0.68333, 0.15806, 0, 0.74333], - "89": [0, 0.68333, 0.19383, 0, 0.74333], - "90": [0, 0.68333, 0.14528, 0, 0.61333], - "91": [0.25, 0.75, 0.1875, 0, 0.30667], - "93": [0.25, 0.75, 0.10528, 0, 0.30667], - "94": [0, 0.69444, 0.06646, 0, 0.51111], - "95": [0.31, 0.12056, 0.09208, 0, 0.51111], - "97": [0, 0.43056, 0.07671, 0, 0.51111], - "98": [0, 0.69444, 0.06312, 0, 0.46], - "99": [0, 0.43056, 0.05653, 0, 0.46], - "100": [0, 0.69444, 0.10333, 0, 0.51111], - "101": [0, 0.43056, 0.07514, 0, 0.46], - "102": [0.19444, 0.69444, 0.21194, 0, 0.30667], - "103": [0.19444, 0.43056, 0.08847, 0, 0.46], - "104": [0, 0.69444, 0.07671, 0, 0.51111], - "105": [0, 0.65536, 0.1019, 0, 0.30667], - "106": [0.19444, 0.65536, 0.14467, 0, 0.30667], - "107": [0, 0.69444, 0.10764, 0, 0.46], - "108": [0, 0.69444, 0.10333, 0, 0.25555], - "109": [0, 0.43056, 0.07671, 0, 0.81777], - "110": [0, 0.43056, 0.07671, 0, 0.56222], - "111": [0, 0.43056, 0.06312, 0, 0.51111], - "112": [0.19444, 0.43056, 0.06312, 0, 0.51111], - "113": [0.19444, 0.43056, 0.08847, 0, 0.46], - "114": [0, 0.43056, 0.10764, 0, 0.42166], - "115": [0, 0.43056, 0.08208, 0, 0.40889], - "116": [0, 0.61508, 0.09486, 0, 0.33222], - "117": [0, 0.43056, 0.07671, 0, 0.53666], - "118": [0, 0.43056, 0.10764, 0, 0.46], - "119": [0, 0.43056, 0.10764, 0, 0.66444], - "120": [0, 0.43056, 0.12042, 0, 0.46389], - "121": [0.19444, 0.43056, 0.08847, 0, 0.48555], - "122": [0, 0.43056, 0.12292, 0, 0.40889], - "126": [0.35, 0.31786, 0.11585, 0, 0.51111], - "160": [0, 0, 0, 0, 0.25], - "168": [0, 0.66786, 0.10474, 0, 0.51111], - "176": [0, 0.69444, 0, 0, 0.83129], - "184": [0.17014, 0, 0, 0, 0.46], - "198": [0, 0.68333, 0.12028, 0, 0.88277], - "216": [0.04861, 0.73194, 0.09403, 0, 0.76666], - "223": [0.19444, 0.69444, 0.10514, 0, 0.53666], - "230": [0, 0.43056, 0.07514, 0, 0.71555], - "248": [0.09722, 0.52778, 0.09194, 0, 0.51111], - "338": [0, 0.68333, 0.12028, 0, 0.98499], - "339": [0, 0.43056, 0.07514, 0, 0.71555], - "710": [0, 0.69444, 0.06646, 0, 0.51111], - "711": [0, 0.62847, 0.08295, 0, 0.51111], - "713": [0, 0.56167, 0.10333, 0, 0.51111], - "714": [0, 0.69444, 0.09694, 0, 0.51111], - "715": [0, 0.69444, 0, 0, 0.51111], - "728": [0, 0.69444, 0.10806, 0, 0.51111], - "729": [0, 0.66786, 0.11752, 0, 0.30667], - "730": [0, 0.69444, 0, 0, 0.83129], - "732": [0, 0.66786, 0.11585, 0, 0.51111], - "733": [0, 0.69444, 0.1225, 0, 0.51111], - "915": [0, 0.68333, 0.13305, 0, 0.62722], - "916": [0, 0.68333, 0, 0, 0.81777], - "920": [0, 0.68333, 0.09403, 0, 0.76666], - "923": [0, 0.68333, 0, 0, 0.69222], - "926": [0, 0.68333, 0.15294, 0, 0.66444], - "928": [0, 0.68333, 0.16389, 0, 0.74333], - "931": [0, 0.68333, 0.12028, 0, 0.71555], - "933": [0, 0.68333, 0.11111, 0, 0.76666], - "934": [0, 0.68333, 0.05986, 0, 0.71555], - "936": [0, 0.68333, 0.11111, 0, 0.76666], - "937": [0, 0.68333, 0.10257, 0, 0.71555], - "8211": [0, 0.43056, 0.09208, 0, 0.51111], - "8212": [0, 0.43056, 0.09208, 0, 1.02222], - "8216": [0, 0.69444, 0.12417, 0, 0.30667], - "8217": [0, 0.69444, 0.12417, 0, 0.30667], - "8220": [0, 0.69444, 0.1685, 0, 0.51444], - "8221": [0, 0.69444, 0.06961, 0, 0.51444], - "8463": [0, 0.68889, 0, 0, 0.54028] - }, - "Main-Regular": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69444, 0, 0, 0.27778], - "34": [0, 0.69444, 0, 0, 0.5], - "35": [0.19444, 0.69444, 0, 0, 0.83334], - "36": [0.05556, 0.75, 0, 0, 0.5], - "37": [0.05556, 0.75, 0, 0, 0.83334], - "38": [0, 0.69444, 0, 0, 0.77778], - "39": [0, 0.69444, 0, 0, 0.27778], - "40": [0.25, 0.75, 0, 0, 0.38889], - "41": [0.25, 0.75, 0, 0, 0.38889], - "42": [0, 0.75, 0, 0, 0.5], - "43": [0.08333, 0.58333, 0, 0, 0.77778], - "44": [0.19444, 0.10556, 0, 0, 0.27778], - "45": [0, 0.43056, 0, 0, 0.33333], - "46": [0, 0.10556, 0, 0, 0.27778], - "47": [0.25, 0.75, 0, 0, 0.5], - "48": [0, 0.64444, 0, 0, 0.5], - "49": [0, 0.64444, 0, 0, 0.5], - "50": [0, 0.64444, 0, 0, 0.5], - "51": [0, 0.64444, 0, 0, 0.5], - "52": [0, 0.64444, 0, 0, 0.5], - "53": [0, 0.64444, 0, 0, 0.5], - "54": [0, 0.64444, 0, 0, 0.5], - "55": [0, 0.64444, 0, 0, 0.5], - "56": [0, 0.64444, 0, 0, 0.5], - "57": [0, 0.64444, 0, 0, 0.5], - "58": [0, 0.43056, 0, 0, 0.27778], - "59": [0.19444, 0.43056, 0, 0, 0.27778], - "60": [0.0391, 0.5391, 0, 0, 0.77778], - "61": [-0.13313, 0.36687, 0, 0, 0.77778], - "62": [0.0391, 0.5391, 0, 0, 0.77778], - "63": [0, 0.69444, 0, 0, 0.47222], - "64": [0, 0.69444, 0, 0, 0.77778], - "65": [0, 0.68333, 0, 0, 0.75], - "66": [0, 0.68333, 0, 0, 0.70834], - "67": [0, 0.68333, 0, 0, 0.72222], - "68": [0, 0.68333, 0, 0, 0.76389], - "69": [0, 0.68333, 0, 0, 0.68056], - "70": [0, 0.68333, 0, 0, 0.65278], - "71": [0, 0.68333, 0, 0, 0.78472], - "72": [0, 0.68333, 0, 0, 0.75], - "73": [0, 0.68333, 0, 0, 0.36111], - "74": [0, 0.68333, 0, 0, 0.51389], - "75": [0, 0.68333, 0, 0, 0.77778], - "76": [0, 0.68333, 0, 0, 0.625], - "77": [0, 0.68333, 0, 0, 0.91667], - "78": [0, 0.68333, 0, 0, 0.75], - "79": [0, 0.68333, 0, 0, 0.77778], - "80": [0, 0.68333, 0, 0, 0.68056], - "81": [0.19444, 0.68333, 0, 0, 0.77778], - "82": [0, 0.68333, 0, 0, 0.73611], - "83": [0, 0.68333, 0, 0, 0.55556], - "84": [0, 0.68333, 0, 0, 0.72222], - "85": [0, 0.68333, 0, 0, 0.75], - "86": [0, 0.68333, 0.01389, 0, 0.75], - "87": [0, 0.68333, 0.01389, 0, 1.02778], - "88": [0, 0.68333, 0, 0, 0.75], - "89": [0, 0.68333, 0.025, 0, 0.75], - "90": [0, 0.68333, 0, 0, 0.61111], - "91": [0.25, 0.75, 0, 0, 0.27778], - "92": [0.25, 0.75, 0, 0, 0.5], - "93": [0.25, 0.75, 0, 0, 0.27778], - "94": [0, 0.69444, 0, 0, 0.5], - "95": [0.31, 0.12056, 0.02778, 0, 0.5], - "97": [0, 0.43056, 0, 0, 0.5], - "98": [0, 0.69444, 0, 0, 0.55556], - "99": [0, 0.43056, 0, 0, 0.44445], - "100": [0, 0.69444, 0, 0, 0.55556], - "101": [0, 0.43056, 0, 0, 0.44445], - "102": [0, 0.69444, 0.07778, 0, 0.30556], - "103": [0.19444, 0.43056, 0.01389, 0, 0.5], - "104": [0, 0.69444, 0, 0, 0.55556], - "105": [0, 0.66786, 0, 0, 0.27778], - "106": [0.19444, 0.66786, 0, 0, 0.30556], - "107": [0, 0.69444, 0, 0, 0.52778], - "108": [0, 0.69444, 0, 0, 0.27778], - "109": [0, 0.43056, 0, 0, 0.83334], - "110": [0, 0.43056, 0, 0, 0.55556], - "111": [0, 0.43056, 0, 0, 0.5], - "112": [0.19444, 0.43056, 0, 0, 0.55556], - "113": [0.19444, 0.43056, 0, 0, 0.52778], - "114": [0, 0.43056, 0, 0, 0.39167], - "115": [0, 0.43056, 0, 0, 0.39445], - "116": [0, 0.61508, 0, 0, 0.38889], - "117": [0, 0.43056, 0, 0, 0.55556], - "118": [0, 0.43056, 0.01389, 0, 0.52778], - "119": [0, 0.43056, 0.01389, 0, 0.72222], - "120": [0, 0.43056, 0, 0, 0.52778], - "121": [0.19444, 0.43056, 0.01389, 0, 0.52778], - "122": [0, 0.43056, 0, 0, 0.44445], - "123": [0.25, 0.75, 0, 0, 0.5], - "124": [0.25, 0.75, 0, 0, 0.27778], - "125": [0.25, 0.75, 0, 0, 0.5], - "126": [0.35, 0.31786, 0, 0, 0.5], - "160": [0, 0, 0, 0, 0.25], - "163": [0, 0.69444, 0, 0, 0.76909], - "167": [0.19444, 0.69444, 0, 0, 0.44445], - "168": [0, 0.66786, 0, 0, 0.5], - "172": [0, 0.43056, 0, 0, 0.66667], - "176": [0, 0.69444, 0, 0, 0.75], - "177": [0.08333, 0.58333, 0, 0, 0.77778], - "182": [0.19444, 0.69444, 0, 0, 0.61111], - "184": [0.17014, 0, 0, 0, 0.44445], - "198": [0, 0.68333, 0, 0, 0.90278], - "215": [0.08333, 0.58333, 0, 0, 0.77778], - "216": [0.04861, 0.73194, 0, 0, 0.77778], - "223": [0, 0.69444, 0, 0, 0.5], - "230": [0, 0.43056, 0, 0, 0.72222], - "247": [0.08333, 0.58333, 0, 0, 0.77778], - "248": [0.09722, 0.52778, 0, 0, 0.5], - "305": [0, 0.43056, 0, 0, 0.27778], - "338": [0, 0.68333, 0, 0, 1.01389], - "339": [0, 0.43056, 0, 0, 0.77778], - "567": [0.19444, 0.43056, 0, 0, 0.30556], - "710": [0, 0.69444, 0, 0, 0.5], - "711": [0, 0.62847, 0, 0, 0.5], - "713": [0, 0.56778, 0, 0, 0.5], - "714": [0, 0.69444, 0, 0, 0.5], - "715": [0, 0.69444, 0, 0, 0.5], - "728": [0, 0.69444, 0, 0, 0.5], - "729": [0, 0.66786, 0, 0, 0.27778], - "730": [0, 0.69444, 0, 0, 0.75], - "732": [0, 0.66786, 0, 0, 0.5], - "733": [0, 0.69444, 0, 0, 0.5], - "915": [0, 0.68333, 0, 0, 0.625], - "916": [0, 0.68333, 0, 0, 0.83334], - "920": [0, 0.68333, 0, 0, 0.77778], - "923": [0, 0.68333, 0, 0, 0.69445], - "926": [0, 0.68333, 0, 0, 0.66667], - "928": [0, 0.68333, 0, 0, 0.75], - "931": [0, 0.68333, 0, 0, 0.72222], - "933": [0, 0.68333, 0, 0, 0.77778], - "934": [0, 0.68333, 0, 0, 0.72222], - "936": [0, 0.68333, 0, 0, 0.77778], - "937": [0, 0.68333, 0, 0, 0.72222], - "8211": [0, 0.43056, 0.02778, 0, 0.5], - "8212": [0, 0.43056, 0.02778, 0, 1], - "8216": [0, 0.69444, 0, 0, 0.27778], - "8217": [0, 0.69444, 0, 0, 0.27778], - "8220": [0, 0.69444, 0, 0, 0.5], - "8221": [0, 0.69444, 0, 0, 0.5], - "8224": [0.19444, 0.69444, 0, 0, 0.44445], - "8225": [0.19444, 0.69444, 0, 0, 0.44445], - "8230": [0, 0.123, 0, 0, 1.172], - "8242": [0, 0.55556, 0, 0, 0.275], - "8407": [0, 0.71444, 0.15382, 0, 0.5], - "8463": [0, 0.68889, 0, 0, 0.54028], - "8465": [0, 0.69444, 0, 0, 0.72222], - "8467": [0, 0.69444, 0, 0.11111, 0.41667], - "8472": [0.19444, 0.43056, 0, 0.11111, 0.63646], - "8476": [0, 0.69444, 0, 0, 0.72222], - "8501": [0, 0.69444, 0, 0, 0.61111], - "8592": [-0.13313, 0.36687, 0, 0, 1], - "8593": [0.19444, 0.69444, 0, 0, 0.5], - "8594": [-0.13313, 0.36687, 0, 0, 1], - "8595": [0.19444, 0.69444, 0, 0, 0.5], - "8596": [-0.13313, 0.36687, 0, 0, 1], - "8597": [0.25, 0.75, 0, 0, 0.5], - "8598": [0.19444, 0.69444, 0, 0, 1], - "8599": [0.19444, 0.69444, 0, 0, 1], - "8600": [0.19444, 0.69444, 0, 0, 1], - "8601": [0.19444, 0.69444, 0, 0, 1], - "8614": [0.011, 0.511, 0, 0, 1], - "8617": [0.011, 0.511, 0, 0, 1.126], - "8618": [0.011, 0.511, 0, 0, 1.126], - "8636": [-0.13313, 0.36687, 0, 0, 1], - "8637": [-0.13313, 0.36687, 0, 0, 1], - "8640": [-0.13313, 0.36687, 0, 0, 1], - "8641": [-0.13313, 0.36687, 0, 0, 1], - "8652": [0.011, 0.671, 0, 0, 1], - "8656": [-0.13313, 0.36687, 0, 0, 1], - "8657": [0.19444, 0.69444, 0, 0, 0.61111], - "8658": [-0.13313, 0.36687, 0, 0, 1], - "8659": [0.19444, 0.69444, 0, 0, 0.61111], - "8660": [-0.13313, 0.36687, 0, 0, 1], - "8661": [0.25, 0.75, 0, 0, 0.61111], - "8704": [0, 0.69444, 0, 0, 0.55556], - "8706": [0, 0.69444, 0.05556, 0.08334, 0.5309], - "8707": [0, 0.69444, 0, 0, 0.55556], - "8709": [0.05556, 0.75, 0, 0, 0.5], - "8711": [0, 0.68333, 0, 0, 0.83334], - "8712": [0.0391, 0.5391, 0, 0, 0.66667], - "8715": [0.0391, 0.5391, 0, 0, 0.66667], - "8722": [0.08333, 0.58333, 0, 0, 0.77778], - "8723": [0.08333, 0.58333, 0, 0, 0.77778], - "8725": [0.25, 0.75, 0, 0, 0.5], - "8726": [0.25, 0.75, 0, 0, 0.5], - "8727": [-0.03472, 0.46528, 0, 0, 0.5], - "8728": [-0.05555, 0.44445, 0, 0, 0.5], - "8729": [-0.05555, 0.44445, 0, 0, 0.5], - "8730": [0.2, 0.8, 0, 0, 0.83334], - "8733": [0, 0.43056, 0, 0, 0.77778], - "8734": [0, 0.43056, 0, 0, 1], - "8736": [0, 0.69224, 0, 0, 0.72222], - "8739": [0.25, 0.75, 0, 0, 0.27778], - "8741": [0.25, 0.75, 0, 0, 0.5], - "8743": [0, 0.55556, 0, 0, 0.66667], - "8744": [0, 0.55556, 0, 0, 0.66667], - "8745": [0, 0.55556, 0, 0, 0.66667], - "8746": [0, 0.55556, 0, 0, 0.66667], - "8747": [0.19444, 0.69444, 0.11111, 0, 0.41667], - "8764": [-0.13313, 0.36687, 0, 0, 0.77778], - "8768": [0.19444, 0.69444, 0, 0, 0.27778], - "8771": [-0.03625, 0.46375, 0, 0, 0.77778], - "8773": [-0.022, 0.589, 0, 0, 0.778], - "8776": [-0.01688, 0.48312, 0, 0, 0.77778], - "8781": [-0.03625, 0.46375, 0, 0, 0.77778], - "8784": [-0.133, 0.673, 0, 0, 0.778], - "8801": [-0.03625, 0.46375, 0, 0, 0.77778], - "8804": [0.13597, 0.63597, 0, 0, 0.77778], - "8805": [0.13597, 0.63597, 0, 0, 0.77778], - "8810": [0.0391, 0.5391, 0, 0, 1], - "8811": [0.0391, 0.5391, 0, 0, 1], - "8826": [0.0391, 0.5391, 0, 0, 0.77778], - "8827": [0.0391, 0.5391, 0, 0, 0.77778], - "8834": [0.0391, 0.5391, 0, 0, 0.77778], - "8835": [0.0391, 0.5391, 0, 0, 0.77778], - "8838": [0.13597, 0.63597, 0, 0, 0.77778], - "8839": [0.13597, 0.63597, 0, 0, 0.77778], - "8846": [0, 0.55556, 0, 0, 0.66667], - "8849": [0.13597, 0.63597, 0, 0, 0.77778], - "8850": [0.13597, 0.63597, 0, 0, 0.77778], - "8851": [0, 0.55556, 0, 0, 0.66667], - "8852": [0, 0.55556, 0, 0, 0.66667], - "8853": [0.08333, 0.58333, 0, 0, 0.77778], - "8854": [0.08333, 0.58333, 0, 0, 0.77778], - "8855": [0.08333, 0.58333, 0, 0, 0.77778], - "8856": [0.08333, 0.58333, 0, 0, 0.77778], - "8857": [0.08333, 0.58333, 0, 0, 0.77778], - "8866": [0, 0.69444, 0, 0, 0.61111], - "8867": [0, 0.69444, 0, 0, 0.61111], - "8868": [0, 0.69444, 0, 0, 0.77778], - "8869": [0, 0.69444, 0, 0, 0.77778], - "8872": [0.249, 0.75, 0, 0, 0.867], - "8900": [-0.05555, 0.44445, 0, 0, 0.5], - "8901": [-0.05555, 0.44445, 0, 0, 0.27778], - "8902": [-0.03472, 0.46528, 0, 0, 0.5], - "8904": [5e-3, 0.505, 0, 0, 0.9], - "8942": [0.03, 0.903, 0, 0, 0.278], - "8943": [-0.19, 0.313, 0, 0, 1.172], - "8945": [-0.1, 0.823, 0, 0, 1.282], - "8968": [0.25, 0.75, 0, 0, 0.44445], - "8969": [0.25, 0.75, 0, 0, 0.44445], - "8970": [0.25, 0.75, 0, 0, 0.44445], - "8971": [0.25, 0.75, 0, 0, 0.44445], - "8994": [-0.14236, 0.35764, 0, 0, 1], - "8995": [-0.14236, 0.35764, 0, 0, 1], - "9136": [0.244, 0.744, 0, 0, 0.412], - "9137": [0.244, 0.745, 0, 0, 0.412], - "9651": [0.19444, 0.69444, 0, 0, 0.88889], - "9657": [-0.03472, 0.46528, 0, 0, 0.5], - "9661": [0.19444, 0.69444, 0, 0, 0.88889], - "9667": [-0.03472, 0.46528, 0, 0, 0.5], - "9711": [0.19444, 0.69444, 0, 0, 1], - "9824": [0.12963, 0.69444, 0, 0, 0.77778], - "9825": [0.12963, 0.69444, 0, 0, 0.77778], - "9826": [0.12963, 0.69444, 0, 0, 0.77778], - "9827": [0.12963, 0.69444, 0, 0, 0.77778], - "9837": [0, 0.75, 0, 0, 0.38889], - "9838": [0.19444, 0.69444, 0, 0, 0.38889], - "9839": [0.19444, 0.69444, 0, 0, 0.38889], - "10216": [0.25, 0.75, 0, 0, 0.38889], - "10217": [0.25, 0.75, 0, 0, 0.38889], - "10222": [0.244, 0.744, 0, 0, 0.412], - "10223": [0.244, 0.745, 0, 0, 0.412], - "10229": [0.011, 0.511, 0, 0, 1.609], - "10230": [0.011, 0.511, 0, 0, 1.638], - "10231": [0.011, 0.511, 0, 0, 1.859], - "10232": [0.024, 0.525, 0, 0, 1.609], - "10233": [0.024, 0.525, 0, 0, 1.638], - "10234": [0.024, 0.525, 0, 0, 1.858], - "10236": [0.011, 0.511, 0, 0, 1.638], - "10815": [0, 0.68333, 0, 0, 0.75], - "10927": [0.13597, 0.63597, 0, 0, 0.77778], - "10928": [0.13597, 0.63597, 0, 0, 0.77778], - "57376": [0.19444, 0.69444, 0, 0, 0] - }, - "Math-BoldItalic": { - "32": [0, 0, 0, 0, 0.25], - "48": [0, 0.44444, 0, 0, 0.575], - "49": [0, 0.44444, 0, 0, 0.575], - "50": [0, 0.44444, 0, 0, 0.575], - "51": [0.19444, 0.44444, 0, 0, 0.575], - "52": [0.19444, 0.44444, 0, 0, 0.575], - "53": [0.19444, 0.44444, 0, 0, 0.575], - "54": [0, 0.64444, 0, 0, 0.575], - "55": [0.19444, 0.44444, 0, 0, 0.575], - "56": [0, 0.64444, 0, 0, 0.575], - "57": [0.19444, 0.44444, 0, 0, 0.575], - "65": [0, 0.68611, 0, 0, 0.86944], - "66": [0, 0.68611, 0.04835, 0, 0.8664], - "67": [0, 0.68611, 0.06979, 0, 0.81694], - "68": [0, 0.68611, 0.03194, 0, 0.93812], - "69": [0, 0.68611, 0.05451, 0, 0.81007], - "70": [0, 0.68611, 0.15972, 0, 0.68889], - "71": [0, 0.68611, 0, 0, 0.88673], - "72": [0, 0.68611, 0.08229, 0, 0.98229], - "73": [0, 0.68611, 0.07778, 0, 0.51111], - "74": [0, 0.68611, 0.10069, 0, 0.63125], - "75": [0, 0.68611, 0.06979, 0, 0.97118], - "76": [0, 0.68611, 0, 0, 0.75555], - "77": [0, 0.68611, 0.11424, 0, 1.14201], - "78": [0, 0.68611, 0.11424, 0, 0.95034], - "79": [0, 0.68611, 0.03194, 0, 0.83666], - "80": [0, 0.68611, 0.15972, 0, 0.72309], - "81": [0.19444, 0.68611, 0, 0, 0.86861], - "82": [0, 0.68611, 421e-5, 0, 0.87235], - "83": [0, 0.68611, 0.05382, 0, 0.69271], - "84": [0, 0.68611, 0.15972, 0, 0.63663], - "85": [0, 0.68611, 0.11424, 0, 0.80027], - "86": [0, 0.68611, 0.25555, 0, 0.67778], - "87": [0, 0.68611, 0.15972, 0, 1.09305], - "88": [0, 0.68611, 0.07778, 0, 0.94722], - "89": [0, 0.68611, 0.25555, 0, 0.67458], - "90": [0, 0.68611, 0.06979, 0, 0.77257], - "97": [0, 0.44444, 0, 0, 0.63287], - "98": [0, 0.69444, 0, 0, 0.52083], - "99": [0, 0.44444, 0, 0, 0.51342], - "100": [0, 0.69444, 0, 0, 0.60972], - "101": [0, 0.44444, 0, 0, 0.55361], - "102": [0.19444, 0.69444, 0.11042, 0, 0.56806], - "103": [0.19444, 0.44444, 0.03704, 0, 0.5449], - "104": [0, 0.69444, 0, 0, 0.66759], - "105": [0, 0.69326, 0, 0, 0.4048], - "106": [0.19444, 0.69326, 0.0622, 0, 0.47083], - "107": [0, 0.69444, 0.01852, 0, 0.6037], - "108": [0, 0.69444, 88e-4, 0, 0.34815], - "109": [0, 0.44444, 0, 0, 1.0324], - "110": [0, 0.44444, 0, 0, 0.71296], - "111": [0, 0.44444, 0, 0, 0.58472], - "112": [0.19444, 0.44444, 0, 0, 0.60092], - "113": [0.19444, 0.44444, 0.03704, 0, 0.54213], - "114": [0, 0.44444, 0.03194, 0, 0.5287], - "115": [0, 0.44444, 0, 0, 0.53125], - "116": [0, 0.63492, 0, 0, 0.41528], - "117": [0, 0.44444, 0, 0, 0.68102], - "118": [0, 0.44444, 0.03704, 0, 0.56666], - "119": [0, 0.44444, 0.02778, 0, 0.83148], - "120": [0, 0.44444, 0, 0, 0.65903], - "121": [0.19444, 0.44444, 0.03704, 0, 0.59028], - "122": [0, 0.44444, 0.04213, 0, 0.55509], - "160": [0, 0, 0, 0, 0.25], - "915": [0, 0.68611, 0.15972, 0, 0.65694], - "916": [0, 0.68611, 0, 0, 0.95833], - "920": [0, 0.68611, 0.03194, 0, 0.86722], - "923": [0, 0.68611, 0, 0, 0.80555], - "926": [0, 0.68611, 0.07458, 0, 0.84125], - "928": [0, 0.68611, 0.08229, 0, 0.98229], - "931": [0, 0.68611, 0.05451, 0, 0.88507], - "933": [0, 0.68611, 0.15972, 0, 0.67083], - "934": [0, 0.68611, 0, 0, 0.76666], - "936": [0, 0.68611, 0.11653, 0, 0.71402], - "937": [0, 0.68611, 0.04835, 0, 0.8789], - "945": [0, 0.44444, 0, 0, 0.76064], - "946": [0.19444, 0.69444, 0.03403, 0, 0.65972], - "947": [0.19444, 0.44444, 0.06389, 0, 0.59003], - "948": [0, 0.69444, 0.03819, 0, 0.52222], - "949": [0, 0.44444, 0, 0, 0.52882], - "950": [0.19444, 0.69444, 0.06215, 0, 0.50833], - "951": [0.19444, 0.44444, 0.03704, 0, 0.6], - "952": [0, 0.69444, 0.03194, 0, 0.5618], - "953": [0, 0.44444, 0, 0, 0.41204], - "954": [0, 0.44444, 0, 0, 0.66759], - "955": [0, 0.69444, 0, 0, 0.67083], - "956": [0.19444, 0.44444, 0, 0, 0.70787], - "957": [0, 0.44444, 0.06898, 0, 0.57685], - "958": [0.19444, 0.69444, 0.03021, 0, 0.50833], - "959": [0, 0.44444, 0, 0, 0.58472], - "960": [0, 0.44444, 0.03704, 0, 0.68241], - "961": [0.19444, 0.44444, 0, 0, 0.6118], - "962": [0.09722, 0.44444, 0.07917, 0, 0.42361], - "963": [0, 0.44444, 0.03704, 0, 0.68588], - "964": [0, 0.44444, 0.13472, 0, 0.52083], - "965": [0, 0.44444, 0.03704, 0, 0.63055], - "966": [0.19444, 0.44444, 0, 0, 0.74722], - "967": [0.19444, 0.44444, 0, 0, 0.71805], - "968": [0.19444, 0.69444, 0.03704, 0, 0.75833], - "969": [0, 0.44444, 0.03704, 0, 0.71782], - "977": [0, 0.69444, 0, 0, 0.69155], - "981": [0.19444, 0.69444, 0, 0, 0.7125], - "982": [0, 0.44444, 0.03194, 0, 0.975], - "1009": [0.19444, 0.44444, 0, 0, 0.6118], - "1013": [0, 0.44444, 0, 0, 0.48333], - "57649": [0, 0.44444, 0, 0, 0.39352], - "57911": [0.19444, 0.44444, 0, 0, 0.43889] - }, - "Math-Italic": { - "32": [0, 0, 0, 0, 0.25], - "48": [0, 0.43056, 0, 0, 0.5], - "49": [0, 0.43056, 0, 0, 0.5], - "50": [0, 0.43056, 0, 0, 0.5], - "51": [0.19444, 0.43056, 0, 0, 0.5], - "52": [0.19444, 0.43056, 0, 0, 0.5], - "53": [0.19444, 0.43056, 0, 0, 0.5], - "54": [0, 0.64444, 0, 0, 0.5], - "55": [0.19444, 0.43056, 0, 0, 0.5], - "56": [0, 0.64444, 0, 0, 0.5], - "57": [0.19444, 0.43056, 0, 0, 0.5], - "65": [0, 0.68333, 0, 0.13889, 0.75], - "66": [0, 0.68333, 0.05017, 0.08334, 0.75851], - "67": [0, 0.68333, 0.07153, 0.08334, 0.71472], - "68": [0, 0.68333, 0.02778, 0.05556, 0.82792], - "69": [0, 0.68333, 0.05764, 0.08334, 0.7382], - "70": [0, 0.68333, 0.13889, 0.08334, 0.64306], - "71": [0, 0.68333, 0, 0.08334, 0.78625], - "72": [0, 0.68333, 0.08125, 0.05556, 0.83125], - "73": [0, 0.68333, 0.07847, 0.11111, 0.43958], - "74": [0, 0.68333, 0.09618, 0.16667, 0.55451], - "75": [0, 0.68333, 0.07153, 0.05556, 0.84931], - "76": [0, 0.68333, 0, 0.02778, 0.68056], - "77": [0, 0.68333, 0.10903, 0.08334, 0.97014], - "78": [0, 0.68333, 0.10903, 0.08334, 0.80347], - "79": [0, 0.68333, 0.02778, 0.08334, 0.76278], - "80": [0, 0.68333, 0.13889, 0.08334, 0.64201], - "81": [0.19444, 0.68333, 0, 0.08334, 0.79056], - "82": [0, 0.68333, 773e-5, 0.08334, 0.75929], - "83": [0, 0.68333, 0.05764, 0.08334, 0.6132], - "84": [0, 0.68333, 0.13889, 0.08334, 0.58438], - "85": [0, 0.68333, 0.10903, 0.02778, 0.68278], - "86": [0, 0.68333, 0.22222, 0, 0.58333], - "87": [0, 0.68333, 0.13889, 0, 0.94445], - "88": [0, 0.68333, 0.07847, 0.08334, 0.82847], - "89": [0, 0.68333, 0.22222, 0, 0.58056], - "90": [0, 0.68333, 0.07153, 0.08334, 0.68264], - "97": [0, 0.43056, 0, 0, 0.52859], - "98": [0, 0.69444, 0, 0, 0.42917], - "99": [0, 0.43056, 0, 0.05556, 0.43276], - "100": [0, 0.69444, 0, 0.16667, 0.52049], - "101": [0, 0.43056, 0, 0.05556, 0.46563], - "102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959], - "103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697], - "104": [0, 0.69444, 0, 0, 0.57616], - "105": [0, 0.65952, 0, 0, 0.34451], - "106": [0.19444, 0.65952, 0.05724, 0, 0.41181], - "107": [0, 0.69444, 0.03148, 0, 0.5206], - "108": [0, 0.69444, 0.01968, 0.08334, 0.29838], - "109": [0, 0.43056, 0, 0, 0.87801], - "110": [0, 0.43056, 0, 0, 0.60023], - "111": [0, 0.43056, 0, 0.05556, 0.48472], - "112": [0.19444, 0.43056, 0, 0.08334, 0.50313], - "113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641], - "114": [0, 0.43056, 0.02778, 0.05556, 0.45116], - "115": [0, 0.43056, 0, 0.05556, 0.46875], - "116": [0, 0.61508, 0, 0.08334, 0.36111], - "117": [0, 0.43056, 0, 0.02778, 0.57246], - "118": [0, 0.43056, 0.03588, 0.02778, 0.48472], - "119": [0, 0.43056, 0.02691, 0.08334, 0.71592], - "120": [0, 0.43056, 0, 0.02778, 0.57153], - "121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028], - "122": [0, 0.43056, 0.04398, 0.05556, 0.46505], - "160": [0, 0, 0, 0, 0.25], - "915": [0, 0.68333, 0.13889, 0.08334, 0.61528], - "916": [0, 0.68333, 0, 0.16667, 0.83334], - "920": [0, 0.68333, 0.02778, 0.08334, 0.76278], - "923": [0, 0.68333, 0, 0.16667, 0.69445], - "926": [0, 0.68333, 0.07569, 0.08334, 0.74236], - "928": [0, 0.68333, 0.08125, 0.05556, 0.83125], - "931": [0, 0.68333, 0.05764, 0.08334, 0.77986], - "933": [0, 0.68333, 0.13889, 0.05556, 0.58333], - "934": [0, 0.68333, 0, 0.08334, 0.66667], - "936": [0, 0.68333, 0.11, 0.05556, 0.61222], - "937": [0, 0.68333, 0.05017, 0.08334, 0.7724], - "945": [0, 0.43056, 37e-4, 0.02778, 0.6397], - "946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563], - "947": [0.19444, 0.43056, 0.05556, 0, 0.51773], - "948": [0, 0.69444, 0.03785, 0.05556, 0.44444], - "949": [0, 0.43056, 0, 0.08334, 0.46632], - "950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375], - "951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653], - "952": [0, 0.69444, 0.02778, 0.08334, 0.46944], - "953": [0, 0.43056, 0, 0.05556, 0.35394], - "954": [0, 0.43056, 0, 0, 0.57616], - "955": [0, 0.69444, 0, 0, 0.58334], - "956": [0.19444, 0.43056, 0, 0.02778, 0.60255], - "957": [0, 0.43056, 0.06366, 0.02778, 0.49398], - "958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375], - "959": [0, 0.43056, 0, 0.05556, 0.48472], - "960": [0, 0.43056, 0.03588, 0, 0.57003], - "961": [0.19444, 0.43056, 0, 0.08334, 0.51702], - "962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285], - "963": [0, 0.43056, 0.03588, 0, 0.57141], - "964": [0, 0.43056, 0.1132, 0.02778, 0.43715], - "965": [0, 0.43056, 0.03588, 0.02778, 0.54028], - "966": [0.19444, 0.43056, 0, 0.08334, 0.65417], - "967": [0.19444, 0.43056, 0, 0.05556, 0.62569], - "968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139], - "969": [0, 0.43056, 0.03588, 0, 0.62245], - "977": [0, 0.69444, 0, 0.08334, 0.59144], - "981": [0.19444, 0.69444, 0, 0.08334, 0.59583], - "982": [0, 0.43056, 0.02778, 0, 0.82813], - "1009": [0.19444, 0.43056, 0, 0.08334, 0.51702], - "1013": [0, 0.43056, 0, 0.05556, 0.4059], - "57649": [0, 0.43056, 0, 0.02778, 0.32246], - "57911": [0.19444, 0.43056, 0, 0.08334, 0.38403] - }, - "SansSerif-Bold": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69444, 0, 0, 0.36667], - "34": [0, 0.69444, 0, 0, 0.55834], - "35": [0.19444, 0.69444, 0, 0, 0.91667], - "36": [0.05556, 0.75, 0, 0, 0.55], - "37": [0.05556, 0.75, 0, 0, 1.02912], - "38": [0, 0.69444, 0, 0, 0.83056], - "39": [0, 0.69444, 0, 0, 0.30556], - "40": [0.25, 0.75, 0, 0, 0.42778], - "41": [0.25, 0.75, 0, 0, 0.42778], - "42": [0, 0.75, 0, 0, 0.55], - "43": [0.11667, 0.61667, 0, 0, 0.85556], - "44": [0.10556, 0.13056, 0, 0, 0.30556], - "45": [0, 0.45833, 0, 0, 0.36667], - "46": [0, 0.13056, 0, 0, 0.30556], - "47": [0.25, 0.75, 0, 0, 0.55], - "48": [0, 0.69444, 0, 0, 0.55], - "49": [0, 0.69444, 0, 0, 0.55], - "50": [0, 0.69444, 0, 0, 0.55], - "51": [0, 0.69444, 0, 0, 0.55], - "52": [0, 0.69444, 0, 0, 0.55], - "53": [0, 0.69444, 0, 0, 0.55], - "54": [0, 0.69444, 0, 0, 0.55], - "55": [0, 0.69444, 0, 0, 0.55], - "56": [0, 0.69444, 0, 0, 0.55], - "57": [0, 0.69444, 0, 0, 0.55], - "58": [0, 0.45833, 0, 0, 0.30556], - "59": [0.10556, 0.45833, 0, 0, 0.30556], - "61": [-0.09375, 0.40625, 0, 0, 0.85556], - "63": [0, 0.69444, 0, 0, 0.51945], - "64": [0, 0.69444, 0, 0, 0.73334], - "65": [0, 0.69444, 0, 0, 0.73334], - "66": [0, 0.69444, 0, 0, 0.73334], - "67": [0, 0.69444, 0, 0, 0.70278], - "68": [0, 0.69444, 0, 0, 0.79445], - "69": [0, 0.69444, 0, 0, 0.64167], - "70": [0, 0.69444, 0, 0, 0.61111], - "71": [0, 0.69444, 0, 0, 0.73334], - "72": [0, 0.69444, 0, 0, 0.79445], - "73": [0, 0.69444, 0, 0, 0.33056], - "74": [0, 0.69444, 0, 0, 0.51945], - "75": [0, 0.69444, 0, 0, 0.76389], - "76": [0, 0.69444, 0, 0, 0.58056], - "77": [0, 0.69444, 0, 0, 0.97778], - "78": [0, 0.69444, 0, 0, 0.79445], - "79": [0, 0.69444, 0, 0, 0.79445], - "80": [0, 0.69444, 0, 0, 0.70278], - "81": [0.10556, 0.69444, 0, 0, 0.79445], - "82": [0, 0.69444, 0, 0, 0.70278], - "83": [0, 0.69444, 0, 0, 0.61111], - "84": [0, 0.69444, 0, 0, 0.73334], - "85": [0, 0.69444, 0, 0, 0.76389], - "86": [0, 0.69444, 0.01528, 0, 0.73334], - "87": [0, 0.69444, 0.01528, 0, 1.03889], - "88": [0, 0.69444, 0, 0, 0.73334], - "89": [0, 0.69444, 0.0275, 0, 0.73334], - "90": [0, 0.69444, 0, 0, 0.67223], - "91": [0.25, 0.75, 0, 0, 0.34306], - "93": [0.25, 0.75, 0, 0, 0.34306], - "94": [0, 0.69444, 0, 0, 0.55], - "95": [0.35, 0.10833, 0.03056, 0, 0.55], - "97": [0, 0.45833, 0, 0, 0.525], - "98": [0, 0.69444, 0, 0, 0.56111], - "99": [0, 0.45833, 0, 0, 0.48889], - "100": [0, 0.69444, 0, 0, 0.56111], - "101": [0, 0.45833, 0, 0, 0.51111], - "102": [0, 0.69444, 0.07639, 0, 0.33611], - "103": [0.19444, 0.45833, 0.01528, 0, 0.55], - "104": [0, 0.69444, 0, 0, 0.56111], - "105": [0, 0.69444, 0, 0, 0.25556], - "106": [0.19444, 0.69444, 0, 0, 0.28611], - "107": [0, 0.69444, 0, 0, 0.53056], - "108": [0, 0.69444, 0, 0, 0.25556], - "109": [0, 0.45833, 0, 0, 0.86667], - "110": [0, 0.45833, 0, 0, 0.56111], - "111": [0, 0.45833, 0, 0, 0.55], - "112": [0.19444, 0.45833, 0, 0, 0.56111], - "113": [0.19444, 0.45833, 0, 0, 0.56111], - "114": [0, 0.45833, 0.01528, 0, 0.37222], - "115": [0, 0.45833, 0, 0, 0.42167], - "116": [0, 0.58929, 0, 0, 0.40417], - "117": [0, 0.45833, 0, 0, 0.56111], - "118": [0, 0.45833, 0.01528, 0, 0.5], - "119": [0, 0.45833, 0.01528, 0, 0.74445], - "120": [0, 0.45833, 0, 0, 0.5], - "121": [0.19444, 0.45833, 0.01528, 0, 0.5], - "122": [0, 0.45833, 0, 0, 0.47639], - "126": [0.35, 0.34444, 0, 0, 0.55], - "160": [0, 0, 0, 0, 0.25], - "168": [0, 0.69444, 0, 0, 0.55], - "176": [0, 0.69444, 0, 0, 0.73334], - "180": [0, 0.69444, 0, 0, 0.55], - "184": [0.17014, 0, 0, 0, 0.48889], - "305": [0, 0.45833, 0, 0, 0.25556], - "567": [0.19444, 0.45833, 0, 0, 0.28611], - "710": [0, 0.69444, 0, 0, 0.55], - "711": [0, 0.63542, 0, 0, 0.55], - "713": [0, 0.63778, 0, 0, 0.55], - "728": [0, 0.69444, 0, 0, 0.55], - "729": [0, 0.69444, 0, 0, 0.30556], - "730": [0, 0.69444, 0, 0, 0.73334], - "732": [0, 0.69444, 0, 0, 0.55], - "733": [0, 0.69444, 0, 0, 0.55], - "915": [0, 0.69444, 0, 0, 0.58056], - "916": [0, 0.69444, 0, 0, 0.91667], - "920": [0, 0.69444, 0, 0, 0.85556], - "923": [0, 0.69444, 0, 0, 0.67223], - "926": [0, 0.69444, 0, 0, 0.73334], - "928": [0, 0.69444, 0, 0, 0.79445], - "931": [0, 0.69444, 0, 0, 0.79445], - "933": [0, 0.69444, 0, 0, 0.85556], - "934": [0, 0.69444, 0, 0, 0.79445], - "936": [0, 0.69444, 0, 0, 0.85556], - "937": [0, 0.69444, 0, 0, 0.79445], - "8211": [0, 0.45833, 0.03056, 0, 0.55], - "8212": [0, 0.45833, 0.03056, 0, 1.10001], - "8216": [0, 0.69444, 0, 0, 0.30556], - "8217": [0, 0.69444, 0, 0, 0.30556], - "8220": [0, 0.69444, 0, 0, 0.55834], - "8221": [0, 0.69444, 0, 0, 0.55834] - }, - "SansSerif-Italic": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69444, 0.05733, 0, 0.31945], - "34": [0, 0.69444, 316e-5, 0, 0.5], - "35": [0.19444, 0.69444, 0.05087, 0, 0.83334], - "36": [0.05556, 0.75, 0.11156, 0, 0.5], - "37": [0.05556, 0.75, 0.03126, 0, 0.83334], - "38": [0, 0.69444, 0.03058, 0, 0.75834], - "39": [0, 0.69444, 0.07816, 0, 0.27778], - "40": [0.25, 0.75, 0.13164, 0, 0.38889], - "41": [0.25, 0.75, 0.02536, 0, 0.38889], - "42": [0, 0.75, 0.11775, 0, 0.5], - "43": [0.08333, 0.58333, 0.02536, 0, 0.77778], - "44": [0.125, 0.08333, 0, 0, 0.27778], - "45": [0, 0.44444, 0.01946, 0, 0.33333], - "46": [0, 0.08333, 0, 0, 0.27778], - "47": [0.25, 0.75, 0.13164, 0, 0.5], - "48": [0, 0.65556, 0.11156, 0, 0.5], - "49": [0, 0.65556, 0.11156, 0, 0.5], - "50": [0, 0.65556, 0.11156, 0, 0.5], - "51": [0, 0.65556, 0.11156, 0, 0.5], - "52": [0, 0.65556, 0.11156, 0, 0.5], - "53": [0, 0.65556, 0.11156, 0, 0.5], - "54": [0, 0.65556, 0.11156, 0, 0.5], - "55": [0, 0.65556, 0.11156, 0, 0.5], - "56": [0, 0.65556, 0.11156, 0, 0.5], - "57": [0, 0.65556, 0.11156, 0, 0.5], - "58": [0, 0.44444, 0.02502, 0, 0.27778], - "59": [0.125, 0.44444, 0.02502, 0, 0.27778], - "61": [-0.13, 0.37, 0.05087, 0, 0.77778], - "63": [0, 0.69444, 0.11809, 0, 0.47222], - "64": [0, 0.69444, 0.07555, 0, 0.66667], - "65": [0, 0.69444, 0, 0, 0.66667], - "66": [0, 0.69444, 0.08293, 0, 0.66667], - "67": [0, 0.69444, 0.11983, 0, 0.63889], - "68": [0, 0.69444, 0.07555, 0, 0.72223], - "69": [0, 0.69444, 0.11983, 0, 0.59722], - "70": [0, 0.69444, 0.13372, 0, 0.56945], - "71": [0, 0.69444, 0.11983, 0, 0.66667], - "72": [0, 0.69444, 0.08094, 0, 0.70834], - "73": [0, 0.69444, 0.13372, 0, 0.27778], - "74": [0, 0.69444, 0.08094, 0, 0.47222], - "75": [0, 0.69444, 0.11983, 0, 0.69445], - "76": [0, 0.69444, 0, 0, 0.54167], - "77": [0, 0.69444, 0.08094, 0, 0.875], - "78": [0, 0.69444, 0.08094, 0, 0.70834], - "79": [0, 0.69444, 0.07555, 0, 0.73611], - "80": [0, 0.69444, 0.08293, 0, 0.63889], - "81": [0.125, 0.69444, 0.07555, 0, 0.73611], - "82": [0, 0.69444, 0.08293, 0, 0.64584], - "83": [0, 0.69444, 0.09205, 0, 0.55556], - "84": [0, 0.69444, 0.13372, 0, 0.68056], - "85": [0, 0.69444, 0.08094, 0, 0.6875], - "86": [0, 0.69444, 0.1615, 0, 0.66667], - "87": [0, 0.69444, 0.1615, 0, 0.94445], - "88": [0, 0.69444, 0.13372, 0, 0.66667], - "89": [0, 0.69444, 0.17261, 0, 0.66667], - "90": [0, 0.69444, 0.11983, 0, 0.61111], - "91": [0.25, 0.75, 0.15942, 0, 0.28889], - "93": [0.25, 0.75, 0.08719, 0, 0.28889], - "94": [0, 0.69444, 0.0799, 0, 0.5], - "95": [0.35, 0.09444, 0.08616, 0, 0.5], - "97": [0, 0.44444, 981e-5, 0, 0.48056], - "98": [0, 0.69444, 0.03057, 0, 0.51667], - "99": [0, 0.44444, 0.08336, 0, 0.44445], - "100": [0, 0.69444, 0.09483, 0, 0.51667], - "101": [0, 0.44444, 0.06778, 0, 0.44445], - "102": [0, 0.69444, 0.21705, 0, 0.30556], - "103": [0.19444, 0.44444, 0.10836, 0, 0.5], - "104": [0, 0.69444, 0.01778, 0, 0.51667], - "105": [0, 0.67937, 0.09718, 0, 0.23889], - "106": [0.19444, 0.67937, 0.09162, 0, 0.26667], - "107": [0, 0.69444, 0.08336, 0, 0.48889], - "108": [0, 0.69444, 0.09483, 0, 0.23889], - "109": [0, 0.44444, 0.01778, 0, 0.79445], - "110": [0, 0.44444, 0.01778, 0, 0.51667], - "111": [0, 0.44444, 0.06613, 0, 0.5], - "112": [0.19444, 0.44444, 0.0389, 0, 0.51667], - "113": [0.19444, 0.44444, 0.04169, 0, 0.51667], - "114": [0, 0.44444, 0.10836, 0, 0.34167], - "115": [0, 0.44444, 0.0778, 0, 0.38333], - "116": [0, 0.57143, 0.07225, 0, 0.36111], - "117": [0, 0.44444, 0.04169, 0, 0.51667], - "118": [0, 0.44444, 0.10836, 0, 0.46111], - "119": [0, 0.44444, 0.10836, 0, 0.68334], - "120": [0, 0.44444, 0.09169, 0, 0.46111], - "121": [0.19444, 0.44444, 0.10836, 0, 0.46111], - "122": [0, 0.44444, 0.08752, 0, 0.43472], - "126": [0.35, 0.32659, 0.08826, 0, 0.5], - "160": [0, 0, 0, 0, 0.25], - "168": [0, 0.67937, 0.06385, 0, 0.5], - "176": [0, 0.69444, 0, 0, 0.73752], - "184": [0.17014, 0, 0, 0, 0.44445], - "305": [0, 0.44444, 0.04169, 0, 0.23889], - "567": [0.19444, 0.44444, 0.04169, 0, 0.26667], - "710": [0, 0.69444, 0.0799, 0, 0.5], - "711": [0, 0.63194, 0.08432, 0, 0.5], - "713": [0, 0.60889, 0.08776, 0, 0.5], - "714": [0, 0.69444, 0.09205, 0, 0.5], - "715": [0, 0.69444, 0, 0, 0.5], - "728": [0, 0.69444, 0.09483, 0, 0.5], - "729": [0, 0.67937, 0.07774, 0, 0.27778], - "730": [0, 0.69444, 0, 0, 0.73752], - "732": [0, 0.67659, 0.08826, 0, 0.5], - "733": [0, 0.69444, 0.09205, 0, 0.5], - "915": [0, 0.69444, 0.13372, 0, 0.54167], - "916": [0, 0.69444, 0, 0, 0.83334], - "920": [0, 0.69444, 0.07555, 0, 0.77778], - "923": [0, 0.69444, 0, 0, 0.61111], - "926": [0, 0.69444, 0.12816, 0, 0.66667], - "928": [0, 0.69444, 0.08094, 0, 0.70834], - "931": [0, 0.69444, 0.11983, 0, 0.72222], - "933": [0, 0.69444, 0.09031, 0, 0.77778], - "934": [0, 0.69444, 0.04603, 0, 0.72222], - "936": [0, 0.69444, 0.09031, 0, 0.77778], - "937": [0, 0.69444, 0.08293, 0, 0.72222], - "8211": [0, 0.44444, 0.08616, 0, 0.5], - "8212": [0, 0.44444, 0.08616, 0, 1], - "8216": [0, 0.69444, 0.07816, 0, 0.27778], - "8217": [0, 0.69444, 0.07816, 0, 0.27778], - "8220": [0, 0.69444, 0.14205, 0, 0.5], - "8221": [0, 0.69444, 316e-5, 0, 0.5] - }, - "SansSerif-Regular": { - "32": [0, 0, 0, 0, 0.25], - "33": [0, 0.69444, 0, 0, 0.31945], - "34": [0, 0.69444, 0, 0, 0.5], - "35": [0.19444, 0.69444, 0, 0, 0.83334], - "36": [0.05556, 0.75, 0, 0, 0.5], - "37": [0.05556, 0.75, 0, 0, 0.83334], - "38": [0, 0.69444, 0, 0, 0.75834], - "39": [0, 0.69444, 0, 0, 0.27778], - "40": [0.25, 0.75, 0, 0, 0.38889], - "41": [0.25, 0.75, 0, 0, 0.38889], - "42": [0, 0.75, 0, 0, 0.5], - "43": [0.08333, 0.58333, 0, 0, 0.77778], - "44": [0.125, 0.08333, 0, 0, 0.27778], - "45": [0, 0.44444, 0, 0, 0.33333], - "46": [0, 0.08333, 0, 0, 0.27778], - "47": [0.25, 0.75, 0, 0, 0.5], - "48": [0, 0.65556, 0, 0, 0.5], - "49": [0, 0.65556, 0, 0, 0.5], - "50": [0, 0.65556, 0, 0, 0.5], - "51": [0, 0.65556, 0, 0, 0.5], - "52": [0, 0.65556, 0, 0, 0.5], - "53": [0, 0.65556, 0, 0, 0.5], - "54": [0, 0.65556, 0, 0, 0.5], - "55": [0, 0.65556, 0, 0, 0.5], - "56": [0, 0.65556, 0, 0, 0.5], - "57": [0, 0.65556, 0, 0, 0.5], - "58": [0, 0.44444, 0, 0, 0.27778], - "59": [0.125, 0.44444, 0, 0, 0.27778], - "61": [-0.13, 0.37, 0, 0, 0.77778], - "63": [0, 0.69444, 0, 0, 0.47222], - "64": [0, 0.69444, 0, 0, 0.66667], - "65": [0, 0.69444, 0, 0, 0.66667], - "66": [0, 0.69444, 0, 0, 0.66667], - "67": [0, 0.69444, 0, 0, 0.63889], - "68": [0, 0.69444, 0, 0, 0.72223], - "69": [0, 0.69444, 0, 0, 0.59722], - "70": [0, 0.69444, 0, 0, 0.56945], - "71": [0, 0.69444, 0, 0, 0.66667], - "72": [0, 0.69444, 0, 0, 0.70834], - "73": [0, 0.69444, 0, 0, 0.27778], - "74": [0, 0.69444, 0, 0, 0.47222], - "75": [0, 0.69444, 0, 0, 0.69445], - "76": [0, 0.69444, 0, 0, 0.54167], - "77": [0, 0.69444, 0, 0, 0.875], - "78": [0, 0.69444, 0, 0, 0.70834], - "79": [0, 0.69444, 0, 0, 0.73611], - "80": [0, 0.69444, 0, 0, 0.63889], - "81": [0.125, 0.69444, 0, 0, 0.73611], - "82": [0, 0.69444, 0, 0, 0.64584], - "83": [0, 0.69444, 0, 0, 0.55556], - "84": [0, 0.69444, 0, 0, 0.68056], - "85": [0, 0.69444, 0, 0, 0.6875], - "86": [0, 0.69444, 0.01389, 0, 0.66667], - "87": [0, 0.69444, 0.01389, 0, 0.94445], - "88": [0, 0.69444, 0, 0, 0.66667], - "89": [0, 0.69444, 0.025, 0, 0.66667], - "90": [0, 0.69444, 0, 0, 0.61111], - "91": [0.25, 0.75, 0, 0, 0.28889], - "93": [0.25, 0.75, 0, 0, 0.28889], - "94": [0, 0.69444, 0, 0, 0.5], - "95": [0.35, 0.09444, 0.02778, 0, 0.5], - "97": [0, 0.44444, 0, 0, 0.48056], - "98": [0, 0.69444, 0, 0, 0.51667], - "99": [0, 0.44444, 0, 0, 0.44445], - "100": [0, 0.69444, 0, 0, 0.51667], - "101": [0, 0.44444, 0, 0, 0.44445], - "102": [0, 0.69444, 0.06944, 0, 0.30556], - "103": [0.19444, 0.44444, 0.01389, 0, 0.5], - "104": [0, 0.69444, 0, 0, 0.51667], - "105": [0, 0.67937, 0, 0, 0.23889], - "106": [0.19444, 0.67937, 0, 0, 0.26667], - "107": [0, 0.69444, 0, 0, 0.48889], - "108": [0, 0.69444, 0, 0, 0.23889], - "109": [0, 0.44444, 0, 0, 0.79445], - "110": [0, 0.44444, 0, 0, 0.51667], - "111": [0, 0.44444, 0, 0, 0.5], - "112": [0.19444, 0.44444, 0, 0, 0.51667], - "113": [0.19444, 0.44444, 0, 0, 0.51667], - "114": [0, 0.44444, 0.01389, 0, 0.34167], - "115": [0, 0.44444, 0, 0, 0.38333], - "116": [0, 0.57143, 0, 0, 0.36111], - "117": [0, 0.44444, 0, 0, 0.51667], - "118": [0, 0.44444, 0.01389, 0, 0.46111], - "119": [0, 0.44444, 0.01389, 0, 0.68334], - "120": [0, 0.44444, 0, 0, 0.46111], - "121": [0.19444, 0.44444, 0.01389, 0, 0.46111], - "122": [0, 0.44444, 0, 0, 0.43472], - "126": [0.35, 0.32659, 0, 0, 0.5], - "160": [0, 0, 0, 0, 0.25], - "168": [0, 0.67937, 0, 0, 0.5], - "176": [0, 0.69444, 0, 0, 0.66667], - "184": [0.17014, 0, 0, 0, 0.44445], - "305": [0, 0.44444, 0, 0, 0.23889], - "567": [0.19444, 0.44444, 0, 0, 0.26667], - "710": [0, 0.69444, 0, 0, 0.5], - "711": [0, 0.63194, 0, 0, 0.5], - "713": [0, 0.60889, 0, 0, 0.5], - "714": [0, 0.69444, 0, 0, 0.5], - "715": [0, 0.69444, 0, 0, 0.5], - "728": [0, 0.69444, 0, 0, 0.5], - "729": [0, 0.67937, 0, 0, 0.27778], - "730": [0, 0.69444, 0, 0, 0.66667], - "732": [0, 0.67659, 0, 0, 0.5], - "733": [0, 0.69444, 0, 0, 0.5], - "915": [0, 0.69444, 0, 0, 0.54167], - "916": [0, 0.69444, 0, 0, 0.83334], - "920": [0, 0.69444, 0, 0, 0.77778], - "923": [0, 0.69444, 0, 0, 0.61111], - "926": [0, 0.69444, 0, 0, 0.66667], - "928": [0, 0.69444, 0, 0, 0.70834], - "931": [0, 0.69444, 0, 0, 0.72222], - "933": [0, 0.69444, 0, 0, 0.77778], - "934": [0, 0.69444, 0, 0, 0.72222], - "936": [0, 0.69444, 0, 0, 0.77778], - "937": [0, 0.69444, 0, 0, 0.72222], - "8211": [0, 0.44444, 0.02778, 0, 0.5], - "8212": [0, 0.44444, 0.02778, 0, 1], - "8216": [0, 0.69444, 0, 0, 0.27778], - "8217": [0, 0.69444, 0, 0, 0.27778], - "8220": [0, 0.69444, 0, 0, 0.5], - "8221": [0, 0.69444, 0, 0, 0.5] - }, - "Script-Regular": { - "32": [0, 0, 0, 0, 0.25], - "65": [0, 0.7, 0.22925, 0, 0.80253], - "66": [0, 0.7, 0.04087, 0, 0.90757], - "67": [0, 0.7, 0.1689, 0, 0.66619], - "68": [0, 0.7, 0.09371, 0, 0.77443], - "69": [0, 0.7, 0.18583, 0, 0.56162], - "70": [0, 0.7, 0.13634, 0, 0.89544], - "71": [0, 0.7, 0.17322, 0, 0.60961], - "72": [0, 0.7, 0.29694, 0, 0.96919], - "73": [0, 0.7, 0.19189, 0, 0.80907], - "74": [0.27778, 0.7, 0.19189, 0, 1.05159], - "75": [0, 0.7, 0.31259, 0, 0.91364], - "76": [0, 0.7, 0.19189, 0, 0.87373], - "77": [0, 0.7, 0.15981, 0, 1.08031], - "78": [0, 0.7, 0.3525, 0, 0.9015], - "79": [0, 0.7, 0.08078, 0, 0.73787], - "80": [0, 0.7, 0.08078, 0, 1.01262], - "81": [0, 0.7, 0.03305, 0, 0.88282], - "82": [0, 0.7, 0.06259, 0, 0.85], - "83": [0, 0.7, 0.19189, 0, 0.86767], - "84": [0, 0.7, 0.29087, 0, 0.74697], - "85": [0, 0.7, 0.25815, 0, 0.79996], - "86": [0, 0.7, 0.27523, 0, 0.62204], - "87": [0, 0.7, 0.27523, 0, 0.80532], - "88": [0, 0.7, 0.26006, 0, 0.94445], - "89": [0, 0.7, 0.2939, 0, 0.70961], - "90": [0, 0.7, 0.24037, 0, 0.8212], - "160": [0, 0, 0, 0, 0.25] - }, - "Size1-Regular": { - "32": [0, 0, 0, 0, 0.25], - "40": [0.35001, 0.85, 0, 0, 0.45834], - "41": [0.35001, 0.85, 0, 0, 0.45834], - "47": [0.35001, 0.85, 0, 0, 0.57778], - "91": [0.35001, 0.85, 0, 0, 0.41667], - "92": [0.35001, 0.85, 0, 0, 0.57778], - "93": [0.35001, 0.85, 0, 0, 0.41667], - "123": [0.35001, 0.85, 0, 0, 0.58334], - "125": [0.35001, 0.85, 0, 0, 0.58334], - "160": [0, 0, 0, 0, 0.25], - "710": [0, 0.72222, 0, 0, 0.55556], - "732": [0, 0.72222, 0, 0, 0.55556], - "770": [0, 0.72222, 0, 0, 0.55556], - "771": [0, 0.72222, 0, 0, 0.55556], - "8214": [-99e-5, 0.601, 0, 0, 0.77778], - "8593": [1e-5, 0.6, 0, 0, 0.66667], - "8595": [1e-5, 0.6, 0, 0, 0.66667], - "8657": [1e-5, 0.6, 0, 0, 0.77778], - "8659": [1e-5, 0.6, 0, 0, 0.77778], - "8719": [0.25001, 0.75, 0, 0, 0.94445], - "8720": [0.25001, 0.75, 0, 0, 0.94445], - "8721": [0.25001, 0.75, 0, 0, 1.05556], - "8730": [0.35001, 0.85, 0, 0, 1], - "8739": [-599e-5, 0.606, 0, 0, 0.33333], - "8741": [-599e-5, 0.606, 0, 0, 0.55556], - "8747": [0.30612, 0.805, 0.19445, 0, 0.47222], - "8748": [0.306, 0.805, 0.19445, 0, 0.47222], - "8749": [0.306, 0.805, 0.19445, 0, 0.47222], - "8750": [0.30612, 0.805, 0.19445, 0, 0.47222], - "8896": [0.25001, 0.75, 0, 0, 0.83334], - "8897": [0.25001, 0.75, 0, 0, 0.83334], - "8898": [0.25001, 0.75, 0, 0, 0.83334], - "8899": [0.25001, 0.75, 0, 0, 0.83334], - "8968": [0.35001, 0.85, 0, 0, 0.47222], - "8969": [0.35001, 0.85, 0, 0, 0.47222], - "8970": [0.35001, 0.85, 0, 0, 0.47222], - "8971": [0.35001, 0.85, 0, 0, 0.47222], - "9168": [-99e-5, 0.601, 0, 0, 0.66667], - "10216": [0.35001, 0.85, 0, 0, 0.47222], - "10217": [0.35001, 0.85, 0, 0, 0.47222], - "10752": [0.25001, 0.75, 0, 0, 1.11111], - "10753": [0.25001, 0.75, 0, 0, 1.11111], - "10754": [0.25001, 0.75, 0, 0, 1.11111], - "10756": [0.25001, 0.75, 0, 0, 0.83334], - "10758": [0.25001, 0.75, 0, 0, 0.83334] - }, - "Size2-Regular": { - "32": [0, 0, 0, 0, 0.25], - "40": [0.65002, 1.15, 0, 0, 0.59722], - "41": [0.65002, 1.15, 0, 0, 0.59722], - "47": [0.65002, 1.15, 0, 0, 0.81111], - "91": [0.65002, 1.15, 0, 0, 0.47222], - "92": [0.65002, 1.15, 0, 0, 0.81111], - "93": [0.65002, 1.15, 0, 0, 0.47222], - "123": [0.65002, 1.15, 0, 0, 0.66667], - "125": [0.65002, 1.15, 0, 0, 0.66667], - "160": [0, 0, 0, 0, 0.25], - "710": [0, 0.75, 0, 0, 1], - "732": [0, 0.75, 0, 0, 1], - "770": [0, 0.75, 0, 0, 1], - "771": [0, 0.75, 0, 0, 1], - "8719": [0.55001, 1.05, 0, 0, 1.27778], - "8720": [0.55001, 1.05, 0, 0, 1.27778], - "8721": [0.55001, 1.05, 0, 0, 1.44445], - "8730": [0.65002, 1.15, 0, 0, 1], - "8747": [0.86225, 1.36, 0.44445, 0, 0.55556], - "8748": [0.862, 1.36, 0.44445, 0, 0.55556], - "8749": [0.862, 1.36, 0.44445, 0, 0.55556], - "8750": [0.86225, 1.36, 0.44445, 0, 0.55556], - "8896": [0.55001, 1.05, 0, 0, 1.11111], - "8897": [0.55001, 1.05, 0, 0, 1.11111], - "8898": [0.55001, 1.05, 0, 0, 1.11111], - "8899": [0.55001, 1.05, 0, 0, 1.11111], - "8968": [0.65002, 1.15, 0, 0, 0.52778], - "8969": [0.65002, 1.15, 0, 0, 0.52778], - "8970": [0.65002, 1.15, 0, 0, 0.52778], - "8971": [0.65002, 1.15, 0, 0, 0.52778], - "10216": [0.65002, 1.15, 0, 0, 0.61111], - "10217": [0.65002, 1.15, 0, 0, 0.61111], - "10752": [0.55001, 1.05, 0, 0, 1.51112], - "10753": [0.55001, 1.05, 0, 0, 1.51112], - "10754": [0.55001, 1.05, 0, 0, 1.51112], - "10756": [0.55001, 1.05, 0, 0, 1.11111], - "10758": [0.55001, 1.05, 0, 0, 1.11111] - }, - "Size3-Regular": { - "32": [0, 0, 0, 0, 0.25], - "40": [0.95003, 1.45, 0, 0, 0.73611], - "41": [0.95003, 1.45, 0, 0, 0.73611], - "47": [0.95003, 1.45, 0, 0, 1.04445], - "91": [0.95003, 1.45, 0, 0, 0.52778], - "92": [0.95003, 1.45, 0, 0, 1.04445], - "93": [0.95003, 1.45, 0, 0, 0.52778], - "123": [0.95003, 1.45, 0, 0, 0.75], - "125": [0.95003, 1.45, 0, 0, 0.75], - "160": [0, 0, 0, 0, 0.25], - "710": [0, 0.75, 0, 0, 1.44445], - "732": [0, 0.75, 0, 0, 1.44445], - "770": [0, 0.75, 0, 0, 1.44445], - "771": [0, 0.75, 0, 0, 1.44445], - "8730": [0.95003, 1.45, 0, 0, 1], - "8968": [0.95003, 1.45, 0, 0, 0.58334], - "8969": [0.95003, 1.45, 0, 0, 0.58334], - "8970": [0.95003, 1.45, 0, 0, 0.58334], - "8971": [0.95003, 1.45, 0, 0, 0.58334], - "10216": [0.95003, 1.45, 0, 0, 0.75], - "10217": [0.95003, 1.45, 0, 0, 0.75] - }, - "Size4-Regular": { - "32": [0, 0, 0, 0, 0.25], - "40": [1.25003, 1.75, 0, 0, 0.79167], - "41": [1.25003, 1.75, 0, 0, 0.79167], - "47": [1.25003, 1.75, 0, 0, 1.27778], - "91": [1.25003, 1.75, 0, 0, 0.58334], - "92": [1.25003, 1.75, 0, 0, 1.27778], - "93": [1.25003, 1.75, 0, 0, 0.58334], - "123": [1.25003, 1.75, 0, 0, 0.80556], - "125": [1.25003, 1.75, 0, 0, 0.80556], - "160": [0, 0, 0, 0, 0.25], - "710": [0, 0.825, 0, 0, 1.8889], - "732": [0, 0.825, 0, 0, 1.8889], - "770": [0, 0.825, 0, 0, 1.8889], - "771": [0, 0.825, 0, 0, 1.8889], - "8730": [1.25003, 1.75, 0, 0, 1], - "8968": [1.25003, 1.75, 0, 0, 0.63889], - "8969": [1.25003, 1.75, 0, 0, 0.63889], - "8970": [1.25003, 1.75, 0, 0, 0.63889], - "8971": [1.25003, 1.75, 0, 0, 0.63889], - "9115": [0.64502, 1.155, 0, 0, 0.875], - "9116": [1e-5, 0.6, 0, 0, 0.875], - "9117": [0.64502, 1.155, 0, 0, 0.875], - "9118": [0.64502, 1.155, 0, 0, 0.875], - "9119": [1e-5, 0.6, 0, 0, 0.875], - "9120": [0.64502, 1.155, 0, 0, 0.875], - "9121": [0.64502, 1.155, 0, 0, 0.66667], - "9122": [-99e-5, 0.601, 0, 0, 0.66667], - "9123": [0.64502, 1.155, 0, 0, 0.66667], - "9124": [0.64502, 1.155, 0, 0, 0.66667], - "9125": [-99e-5, 0.601, 0, 0, 0.66667], - "9126": [0.64502, 1.155, 0, 0, 0.66667], - "9127": [1e-5, 0.9, 0, 0, 0.88889], - "9128": [0.65002, 1.15, 0, 0, 0.88889], - "9129": [0.90001, 0, 0, 0, 0.88889], - "9130": [0, 0.3, 0, 0, 0.88889], - "9131": [1e-5, 0.9, 0, 0, 0.88889], - "9132": [0.65002, 1.15, 0, 0, 0.88889], - "9133": [0.90001, 0, 0, 0, 0.88889], - "9143": [0.88502, 0.915, 0, 0, 1.05556], - "10216": [1.25003, 1.75, 0, 0, 0.80556], - "10217": [1.25003, 1.75, 0, 0, 0.80556], - "57344": [-499e-5, 0.605, 0, 0, 1.05556], - "57345": [-499e-5, 0.605, 0, 0, 1.05556], - "57680": [0, 0.12, 0, 0, 0.45], - "57681": [0, 0.12, 0, 0, 0.45], - "57682": [0, 0.12, 0, 0, 0.45], - "57683": [0, 0.12, 0, 0, 0.45] - }, - "Typewriter-Regular": { - "32": [0, 0, 0, 0, 0.525], - "33": [0, 0.61111, 0, 0, 0.525], - "34": [0, 0.61111, 0, 0, 0.525], - "35": [0, 0.61111, 0, 0, 0.525], - "36": [0.08333, 0.69444, 0, 0, 0.525], - "37": [0.08333, 0.69444, 0, 0, 0.525], - "38": [0, 0.61111, 0, 0, 0.525], - "39": [0, 0.61111, 0, 0, 0.525], - "40": [0.08333, 0.69444, 0, 0, 0.525], - "41": [0.08333, 0.69444, 0, 0, 0.525], - "42": [0, 0.52083, 0, 0, 0.525], - "43": [-0.08056, 0.53055, 0, 0, 0.525], - "44": [0.13889, 0.125, 0, 0, 0.525], - "45": [-0.08056, 0.53055, 0, 0, 0.525], - "46": [0, 0.125, 0, 0, 0.525], - "47": [0.08333, 0.69444, 0, 0, 0.525], - "48": [0, 0.61111, 0, 0, 0.525], - "49": [0, 0.61111, 0, 0, 0.525], - "50": [0, 0.61111, 0, 0, 0.525], - "51": [0, 0.61111, 0, 0, 0.525], - "52": [0, 0.61111, 0, 0, 0.525], - "53": [0, 0.61111, 0, 0, 0.525], - "54": [0, 0.61111, 0, 0, 0.525], - "55": [0, 0.61111, 0, 0, 0.525], - "56": [0, 0.61111, 0, 0, 0.525], - "57": [0, 0.61111, 0, 0, 0.525], - "58": [0, 0.43056, 0, 0, 0.525], - "59": [0.13889, 0.43056, 0, 0, 0.525], - "60": [-0.05556, 0.55556, 0, 0, 0.525], - "61": [-0.19549, 0.41562, 0, 0, 0.525], - "62": [-0.05556, 0.55556, 0, 0, 0.525], - "63": [0, 0.61111, 0, 0, 0.525], - "64": [0, 0.61111, 0, 0, 0.525], - "65": [0, 0.61111, 0, 0, 0.525], - "66": [0, 0.61111, 0, 0, 0.525], - "67": [0, 0.61111, 0, 0, 0.525], - "68": [0, 0.61111, 0, 0, 0.525], - "69": [0, 0.61111, 0, 0, 0.525], - "70": [0, 0.61111, 0, 0, 0.525], - "71": [0, 0.61111, 0, 0, 0.525], - "72": [0, 0.61111, 0, 0, 0.525], - "73": [0, 0.61111, 0, 0, 0.525], - "74": [0, 0.61111, 0, 0, 0.525], - "75": [0, 0.61111, 0, 0, 0.525], - "76": [0, 0.61111, 0, 0, 0.525], - "77": [0, 0.61111, 0, 0, 0.525], - "78": [0, 0.61111, 0, 0, 0.525], - "79": [0, 0.61111, 0, 0, 0.525], - "80": [0, 0.61111, 0, 0, 0.525], - "81": [0.13889, 0.61111, 0, 0, 0.525], - "82": [0, 0.61111, 0, 0, 0.525], - "83": [0, 0.61111, 0, 0, 0.525], - "84": [0, 0.61111, 0, 0, 0.525], - "85": [0, 0.61111, 0, 0, 0.525], - "86": [0, 0.61111, 0, 0, 0.525], - "87": [0, 0.61111, 0, 0, 0.525], - "88": [0, 0.61111, 0, 0, 0.525], - "89": [0, 0.61111, 0, 0, 0.525], - "90": [0, 0.61111, 0, 0, 0.525], - "91": [0.08333, 0.69444, 0, 0, 0.525], - "92": [0.08333, 0.69444, 0, 0, 0.525], - "93": [0.08333, 0.69444, 0, 0, 0.525], - "94": [0, 0.61111, 0, 0, 0.525], - "95": [0.09514, 0, 0, 0, 0.525], - "96": [0, 0.61111, 0, 0, 0.525], - "97": [0, 0.43056, 0, 0, 0.525], - "98": [0, 0.61111, 0, 0, 0.525], - "99": [0, 0.43056, 0, 0, 0.525], - "100": [0, 0.61111, 0, 0, 0.525], - "101": [0, 0.43056, 0, 0, 0.525], - "102": [0, 0.61111, 0, 0, 0.525], - "103": [0.22222, 0.43056, 0, 0, 0.525], - "104": [0, 0.61111, 0, 0, 0.525], - "105": [0, 0.61111, 0, 0, 0.525], - "106": [0.22222, 0.61111, 0, 0, 0.525], - "107": [0, 0.61111, 0, 0, 0.525], - "108": [0, 0.61111, 0, 0, 0.525], - "109": [0, 0.43056, 0, 0, 0.525], - "110": [0, 0.43056, 0, 0, 0.525], - "111": [0, 0.43056, 0, 0, 0.525], - "112": [0.22222, 0.43056, 0, 0, 0.525], - "113": [0.22222, 0.43056, 0, 0, 0.525], - "114": [0, 0.43056, 0, 0, 0.525], - "115": [0, 0.43056, 0, 0, 0.525], - "116": [0, 0.55358, 0, 0, 0.525], - "117": [0, 0.43056, 0, 0, 0.525], - "118": [0, 0.43056, 0, 0, 0.525], - "119": [0, 0.43056, 0, 0, 0.525], - "120": [0, 0.43056, 0, 0, 0.525], - "121": [0.22222, 0.43056, 0, 0, 0.525], - "122": [0, 0.43056, 0, 0, 0.525], - "123": [0.08333, 0.69444, 0, 0, 0.525], - "124": [0.08333, 0.69444, 0, 0, 0.525], - "125": [0.08333, 0.69444, 0, 0, 0.525], - "126": [0, 0.61111, 0, 0, 0.525], - "127": [0, 0.61111, 0, 0, 0.525], - "160": [0, 0, 0, 0, 0.525], - "176": [0, 0.61111, 0, 0, 0.525], - "184": [0.19445, 0, 0, 0, 0.525], - "305": [0, 0.43056, 0, 0, 0.525], - "567": [0.22222, 0.43056, 0, 0, 0.525], - "711": [0, 0.56597, 0, 0, 0.525], - "713": [0, 0.56555, 0, 0, 0.525], - "714": [0, 0.61111, 0, 0, 0.525], - "715": [0, 0.61111, 0, 0, 0.525], - "728": [0, 0.61111, 0, 0, 0.525], - "730": [0, 0.61111, 0, 0, 0.525], - "770": [0, 0.61111, 0, 0, 0.525], - "771": [0, 0.61111, 0, 0, 0.525], - "776": [0, 0.61111, 0, 0, 0.525], - "915": [0, 0.61111, 0, 0, 0.525], - "916": [0, 0.61111, 0, 0, 0.525], - "920": [0, 0.61111, 0, 0, 0.525], - "923": [0, 0.61111, 0, 0, 0.525], - "926": [0, 0.61111, 0, 0, 0.525], - "928": [0, 0.61111, 0, 0, 0.525], - "931": [0, 0.61111, 0, 0, 0.525], - "933": [0, 0.61111, 0, 0, 0.525], - "934": [0, 0.61111, 0, 0, 0.525], - "936": [0, 0.61111, 0, 0, 0.525], - "937": [0, 0.61111, 0, 0, 0.525], - "8216": [0, 0.61111, 0, 0, 0.525], - "8217": [0, 0.61111, 0, 0, 0.525], - "8242": [0, 0.61111, 0, 0, 0.525], - "9251": [0.11111, 0.21944, 0, 0, 0.525] + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js + function styleNull(name, interpolate) { + var string00, string10, interpolate0; + return function() { + var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name)); + return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1); + }; + } + function styleRemove2(name) { + return function() { + this.style.removeProperty(name); + }; + } + function styleConstant2(name, interpolate, value1) { + var string00, string1 = value1 + "", interpolate0; + return function() { + var string0 = styleValue(this, name); + return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); + }; + } + function styleFunction2(name, interpolate, value2) { + var string00, string10, interpolate0; + return function() { + var string0 = styleValue(this, name), value1 = value2(this), string1 = value1 + ""; + if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); + return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; + } + function styleMaybeRemove(id26, name) { + var on0, on1, listener0, key = "style." + name, event3 = "end." + key, remove3; + return function() { + var schedule = set2(this, id26), on3 = schedule.on, listener = schedule.value[key] == null ? remove3 || (remove3 = styleRemove2(name)) : void 0; + if (on3 !== on0 || listener0 !== listener) (on1 = (on0 = on3).copy()).on(event3, listener0 = listener); + schedule.on = on1; + }; + } + function style_default2(name, value2, priority3) { + var i2 = (name += "") === "transform" ? interpolateTransformCss : interpolate_default; + return value2 == null ? this.styleTween(name, styleNull(name, i2)).on("end.style." + name, styleRemove2(name)) : typeof value2 === "function" ? this.styleTween(name, styleFunction2(name, i2, tweenValue(this, "style." + name, value2))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant2(name, i2, value2), priority3).on("end.style." + name, null); + } + var init_style2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js"() { + "use strict"; + init_src8(); + init_src5(); + init_schedule(); + init_tween(); + init_interpolate(); + __name(styleNull, "styleNull"); + __name(styleRemove2, "styleRemove"); + __name(styleConstant2, "styleConstant"); + __name(styleFunction2, "styleFunction"); + __name(styleMaybeRemove, "styleMaybeRemove"); + __name(style_default2, "default"); } - }; - var sigmasAndXis = { - slant: [0.25, 0.25, 0.25], - // sigma1 - space: [0, 0, 0], - // sigma2 - stretch: [0, 0, 0], - // sigma3 - shrink: [0, 0, 0], - // sigma4 - xHeight: [0.431, 0.431, 0.431], - // sigma5 - quad: [1, 1.171, 1.472], - // sigma6 - extraSpace: [0, 0, 0], - // sigma7 - num1: [0.677, 0.732, 0.925], - // sigma8 - num2: [0.394, 0.384, 0.387], - // sigma9 - num3: [0.444, 0.471, 0.504], - // sigma10 - denom1: [0.686, 0.752, 1.025], - // sigma11 - denom2: [0.345, 0.344, 0.532], - // sigma12 - sup1: [0.413, 0.503, 0.504], - // sigma13 - sup2: [0.363, 0.431, 0.404], - // sigma14 - sup3: [0.289, 0.286, 0.294], - // sigma15 - sub1: [0.15, 0.143, 0.2], - // sigma16 - sub2: [0.247, 0.286, 0.4], - // sigma17 - supDrop: [0.386, 0.353, 0.494], - // sigma18 - subDrop: [0.05, 0.071, 0.1], - // sigma19 - delim1: [2.39, 1.7, 1.98], - // sigma20 - delim2: [1.01, 1.157, 1.42], - // sigma21 - axisHeight: [0.25, 0.25, 0.25], - // sigma22 - // These font metrics are extracted from TeX by using tftopl on cmex10.tfm; - // they correspond to the font parameters of the extension fonts (family 3). - // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to - // match cmex7, we'd use cmex7.tfm values for script and scriptscript - // values. - defaultRuleThickness: [0.04, 0.049, 0.049], - // xi8; cmex7: 0.049 - bigOpSpacing1: [0.111, 0.111, 0.111], - // xi9 - bigOpSpacing2: [0.166, 0.166, 0.166], - // xi10 - bigOpSpacing3: [0.2, 0.2, 0.2], - // xi11 - bigOpSpacing4: [0.6, 0.611, 0.611], - // xi12; cmex7: 0.611 - bigOpSpacing5: [0.1, 0.143, 0.143], - // xi13; cmex7: 0.143 - // The \sqrt rule width is taken from the height of the surd character. - // Since we use the same font at all sizes, this thickness doesn't scale. - sqrtRuleThickness: [0.04, 0.04, 0.04], - // This value determines how large a pt is, for metrics which are defined - // in terms of pts. - // This value is also used in katex.less; if you change it make sure the - // values match. - ptPerEm: [10, 10, 10], - // The space between adjacent `|` columns in an array definition. From - // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm. - doubleRuleSep: [0.2, 0.2, 0.2], - // The width of separator lines in {array} environments. From - // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm. - arrayRuleWidth: [0.04, 0.04, 0.04], - // Two values from LaTeX source2e: - fboxsep: [0.3, 0.3, 0.3], - // 3 pt / ptPerEm - fboxrule: [0.04, 0.04, 0.04] - // 0.4 pt / ptPerEm - }; - var extraCharacterMap = { - // Latin-1 - "Å": "A", - "Ð": "D", - "Þ": "o", - "å": "a", - "ð": "d", - "þ": "o", - // Cyrillic - "А": "A", - "Б": "B", - "В": "B", - "Г": "F", - "Д": "A", - "Е": "E", - "Ж": "K", - "З": "3", - "И": "N", - "Й": "N", - "К": "K", - "Л": "N", - "М": "M", - "Н": "H", - "О": "O", - "П": "N", - "Р": "P", - "С": "C", - "Т": "T", - "У": "y", - "Ф": "O", - "Х": "X", - "Ц": "U", - "Ч": "h", - "Ш": "W", - "Щ": "W", - "Ъ": "B", - "Ы": "X", - "Ь": "B", - "Э": "3", - "Ю": "X", - "Я": "R", - "а": "a", - "б": "b", - "в": "a", - "г": "r", - "д": "y", - "е": "e", - "ж": "m", - "з": "e", - "и": "n", - "й": "n", - "к": "n", - "л": "n", - "м": "m", - "н": "n", - "о": "o", - "п": "n", - "р": "p", - "с": "c", - "т": "o", - "у": "y", - "ф": "b", - "х": "x", - "ц": "n", - "ч": "n", - "ш": "w", - "щ": "w", - "ъ": "a", - "ы": "m", - "ь": "a", - "э": "e", - "ю": "m", - "я": "r" - }; - function setFontMetrics(fontName, metrics) { - fontMetricsData[fontName] = metrics; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js + function styleInterpolate(name, i2, priority3) { + return function(t4) { + this.style.setProperty(name, i2.call(this, t4), priority3); + }; } - function getCharacterMetrics(character2, font, mode) { - if (!fontMetricsData[font]) { - throw new Error("Font metrics not found for font: " + font + "."); + function styleTween(name, value2, priority3) { + var t4, i0; + function tween() { + var i2 = value2.apply(this, arguments); + if (i2 !== i0) t4 = (i0 = i2) && styleInterpolate(name, i2, priority3); + return t4; } - var ch2 = character2.charCodeAt(0); - var metrics = fontMetricsData[font][ch2]; - if (!metrics && character2[0] in extraCharacterMap) { - ch2 = extraCharacterMap[character2[0]].charCodeAt(0); - metrics = fontMetricsData[font][ch2]; + __name(tween, "tween"); + tween._value = value2; + return tween; + } + function styleTween_default(name, value2, priority3) { + var key = "style." + (name += ""); + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value2 == null) return this.tween(key, null); + if (typeof value2 !== "function") throw new Error(); + return this.tween(key, styleTween(name, value2, priority3 == null ? "" : priority3)); + } + var init_styleTween = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js"() { + "use strict"; + __name(styleInterpolate, "styleInterpolate"); + __name(styleTween, "styleTween"); + __name(styleTween_default, "default"); } - if (!metrics && mode === "text") { - if (supportedCodepoint(ch2)) { - metrics = fontMetricsData[font][77]; - } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js + function textConstant2(value2) { + return function() { + this.textContent = value2; + }; + } + function textFunction2(value2) { + return function() { + var value1 = value2(this); + this.textContent = value1 == null ? "" : value1; + }; + } + function text_default2(value2) { + return this.tween("text", typeof value2 === "function" ? textFunction2(tweenValue(this, "text", value2)) : textConstant2(value2 == null ? "" : value2 + "")); + } + var init_text2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js"() { + "use strict"; + init_tween(); + __name(textConstant2, "textConstant"); + __name(textFunction2, "textFunction"); + __name(text_default2, "default"); } - if (metrics) { - return { - depth: metrics[0], - height: metrics[1], - italic: metrics[2], - skew: metrics[3], - width: metrics[4] - }; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js + function textInterpolate(i2) { + return function(t4) { + this.textContent = i2.call(this, t4); + }; + } + function textTween(value2) { + var t03, i0; + function tween() { + var i2 = value2.apply(this, arguments); + if (i2 !== i0) t03 = (i0 = i2) && textInterpolate(i2); + return t03; } + __name(tween, "tween"); + tween._value = value2; + return tween; } - var fontMetricsBySizeIndex = {}; - function getGlobalMetrics(size2) { - var sizeIndex; - if (size2 >= 5) { - sizeIndex = 0; - } else if (size2 >= 3) { - sizeIndex = 1; - } else { - sizeIndex = 2; + function textTween_default(value2) { + var key = "text"; + if (arguments.length < 1) return (key = this.tween(key)) && key._value; + if (value2 == null) return this.tween(key, null); + if (typeof value2 !== "function") throw new Error(); + return this.tween(key, textTween(value2)); + } + var init_textTween = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js"() { + "use strict"; + __name(textInterpolate, "textInterpolate"); + __name(textTween, "textTween"); + __name(textTween_default, "default"); } - if (!fontMetricsBySizeIndex[sizeIndex]) { - var metrics = fontMetricsBySizeIndex[sizeIndex] = { - cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18 - }; - for (var key in sigmasAndXis) { - if (sigmasAndXis.hasOwnProperty(key)) { - metrics[key] = sigmasAndXis[key][sizeIndex]; + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js + function transition_default() { + var name = this._name, id0 = this._id, id1 = newId(); + for (var groups = this._groups, m2 = groups.length, j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) { + if (node2 = group2[i2]) { + var inherit2 = get2(node2, id0); + schedule_default(node2, name, id1, i2, group2, { + time: inherit2.time + inherit2.delay + inherit2.duration, + delay: 0, + duration: inherit2.duration, + ease: inherit2.ease + }); } } } - return fontMetricsBySizeIndex[sizeIndex]; + return new Transition(groups, this._parents, name, id1); } - var sizeStyleMap = [ - // Each element contains [textsize, scriptsize, scriptscriptsize]. - // The size mappings are taken from TeX with \normalsize=10pt. - [1, 1, 1], - // size1: [5, 5, 5] \tiny - [2, 1, 1], - // size2: [6, 5, 5] - [3, 1, 1], - // size3: [7, 5, 5] \scriptsize - [4, 2, 1], - // size4: [8, 6, 5] \footnotesize - [5, 2, 1], - // size5: [9, 6, 5] \small - [6, 3, 1], - // size6: [10, 7, 5] \normalsize - [7, 4, 2], - // size7: [12, 8, 6] \large - [8, 6, 3], - // size8: [14.4, 10, 7] \Large - [9, 7, 6], - // size9: [17.28, 12, 10] \LARGE - [10, 8, 7], - // size10: [20.74, 14.4, 12] \huge - [11, 10, 9] - // size11: [24.88, 20.74, 17.28] \HUGE - ]; - var sizeMultipliers = [ - // fontMetrics.js:getGlobalMetrics also uses size indexes, so if - // you change size indexes, change that function. - 0.5, - 0.6, - 0.7, - 0.8, - 0.9, - 1, - 1.2, - 1.44, - 1.728, - 2.074, - 2.488 - ]; - var sizeAtStyle = function sizeAtStyle2(size2, style) { - return style.size < 2 ? size2 : sizeStyleMap[size2 - 1][style.size - 1]; - }; - class Options { - // A font family applies to a group of fonts (i.e. SansSerif), while a font - // represents a specific font (i.e. SansSerif Bold). - // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm - /** - * The base size index. - */ - constructor(data) { - this.style = void 0; - this.color = void 0; - this.size = void 0; - this.textSize = void 0; - this.phantom = void 0; - this.font = void 0; - this.fontFamily = void 0; - this.fontWeight = void 0; - this.fontShape = void 0; - this.sizeMultiplier = void 0; - this.maxSize = void 0; - this.minRuleThickness = void 0; - this._fontMetrics = void 0; - this.style = data.style; - this.color = data.color; - this.size = data.size || Options.BASESIZE; - this.textSize = data.textSize || this.size; - this.phantom = !!data.phantom; - this.font = data.font || ""; - this.fontFamily = data.fontFamily || ""; - this.fontWeight = data.fontWeight || ""; - this.fontShape = data.fontShape || ""; - this.sizeMultiplier = sizeMultipliers[this.size - 1]; - this.maxSize = data.maxSize; - this.minRuleThickness = data.minRuleThickness; - this._fontMetrics = void 0; - } - /** - * Returns a new options object with the same properties as "this". Properties - * from "extension" will be copied to the new options object. - */ - extend(extension2) { - var data = { - style: this.style, - size: this.size, - textSize: this.textSize, - color: this.color, - phantom: this.phantom, - font: this.font, - fontFamily: this.fontFamily, - fontWeight: this.fontWeight, - fontShape: this.fontShape, - maxSize: this.maxSize, - minRuleThickness: this.minRuleThickness - }; - for (var key in extension2) { - if (extension2.hasOwnProperty(key)) { - data[key] = extension2[key]; - } - } - return new Options(data); - } - /** - * Return an options object with the given style. If `this.style === style`, - * returns `this`. - */ - havingStyle(style) { - if (this.style === style) { - return this; - } else { - return this.extend({ - style, - size: sizeAtStyle(this.textSize, style) - }); - } + var init_transition = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js"() { + "use strict"; + init_transition2(); + init_schedule(); + __name(transition_default, "default"); } - /** - * Return an options object with a cramped version of the current style. If - * the current style is cramped, returns `this`. - */ - havingCrampedStyle() { - return this.havingStyle(this.style.cramp()); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js + function end_default() { + var on0, on1, that = this, id26 = that._id, size5 = that.size(); + return new Promise(function(resolve3, reject3) { + var cancel = { value: reject3 }, end2 = { value: /* @__PURE__ */ __name(function() { + if (--size5 === 0) resolve3(); + }, "value") }; + that.each(function() { + var schedule = set2(this, id26), on3 = schedule.on; + if (on3 !== on0) { + on1 = (on0 = on3).copy(); + on1._.cancel.push(cancel); + on1._.interrupt.push(cancel); + on1._.end.push(end2); + } + schedule.on = on1; + }); + if (size5 === 0) resolve3(); + }); + } + var init_end = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js"() { + "use strict"; + init_schedule(); + __name(end_default, "default"); } - /** - * Return an options object with the given size and in at least `\textstyle`. - * Returns `this` if appropriate. - */ - havingSize(size2) { - if (this.size === size2 && this.textSize === size2) { - return this; - } else { - return this.extend({ - style: this.style.text(), - size: size2, - textSize: size2, - sizeMultiplier: sizeMultipliers[size2 - 1] - }); - } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js + function Transition(groups, parents4, name, id26) { + this._groups = groups; + this._parents = parents4; + this._name = name; + this._id = id26; + } + function transition(name) { + return selection_default().transition(name); + } + function newId() { + return ++id; + } + var id, selection_prototype; + var init_transition2 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js"() { + "use strict"; + init_src5(); + init_attr2(); + init_attrTween(); + init_delay(); + init_duration(); + init_ease(); + init_easeVarying(); + init_filter2(); + init_merge2(); + init_on2(); + init_remove2(); + init_select3(); + init_selectAll2(); + init_selection2(); + init_style2(); + init_styleTween(); + init_text2(); + init_textTween(); + init_transition(); + init_tween(); + init_end(); + id = 0; + __name(Transition, "Transition"); + __name(transition, "transition"); + __name(newId, "newId"); + selection_prototype = selection_default.prototype; + Transition.prototype = transition.prototype = { + constructor: Transition, + select: select_default3, + selectAll: selectAll_default2, + selectChild: selection_prototype.selectChild, + selectChildren: selection_prototype.selectChildren, + filter: filter_default2, + merge: merge_default2, + selection: selection_default2, + transition: transition_default, + call: selection_prototype.call, + nodes: selection_prototype.nodes, + node: selection_prototype.node, + size: selection_prototype.size, + empty: selection_prototype.empty, + each: selection_prototype.each, + on: on_default2, + attr: attr_default2, + attrTween: attrTween_default, + style: style_default2, + styleTween: styleTween_default, + text: text_default2, + textTween: textTween_default, + remove: remove_default2, + tween: tween_default, + delay: delay_default, + duration: duration_default, + ease: ease_default, + easeVarying: easeVarying_default, + end: end_default, + [Symbol.iterator]: selection_prototype[Symbol.iterator] + }; } - /** - * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted, - * changes to at least `\textstyle`. - */ - havingBaseStyle(style) { - style = style || this.style.text(); - var wantSize = sizeAtStyle(Options.BASESIZE, style); - if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) { - return this; - } else { - return this.extend({ - style, - size: wantSize - }); - } + }); + + // ../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js + function cubicInOut(t4) { + return ((t4 *= 2) <= 1 ? t4 * t4 * t4 : (t4 -= 2) * t4 * t4 + 2) / 2; + } + var init_cubic = __esm({ + "../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js"() { + "use strict"; + __name(cubicInOut, "cubicInOut"); } - /** - * Remove the effect of sizing changes such as \Huge. - * Keep the effect of the current style, such as \scriptstyle. - */ - havingBaseSizing() { - var size2; - switch (this.style.id) { - case 4: - case 5: - size2 = 3; - break; - case 6: - case 7: - size2 = 1; - break; - default: - size2 = 6; + }); + + // ../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/index.js + var init_src10 = __esm({ + "../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/index.js"() { + "use strict"; + init_cubic(); + } + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js + function inherit(node2, id26) { + var timing; + while (!(timing = node2.__transition) || !(timing = timing[id26])) { + if (!(node2 = node2.parentNode)) { + throw new Error(`transition ${id26} not found`); } - return this.extend({ - style: this.style.text(), - size: size2 - }); } - /** - * Create a new options object with the given color. - */ - withColor(color2) { - return this.extend({ - color: color2 - }); + return timing; + } + function transition_default2(name) { + var id26, timing; + if (name instanceof Transition) { + id26 = name._id, name = name._name; + } else { + id26 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; } - /** - * Create a new options object with "phantom" set to true. - */ - withPhantom() { - return this.extend({ - phantom: true - }); + for (var groups = this._groups, m2 = groups.length, j2 = 0; j2 < m2; ++j2) { + for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) { + if (node2 = group2[i2]) { + schedule_default(node2, name, id26, i2, group2, timing || inherit(node2, id26)); + } + } } - /** - * Creates a new options object with the given math font or old text font. - * @type {[type]} - */ - withFont(font) { - return this.extend({ - font - }); + return new Transition(groups, this._parents, name, id26); + } + var defaultTiming; + var init_transition3 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js"() { + "use strict"; + init_transition2(); + init_schedule(); + init_src10(); + init_src9(); + defaultTiming = { + time: null, + // Set on use. + delay: 0, + duration: 250, + ease: cubicInOut + }; + __name(inherit, "inherit"); + __name(transition_default2, "default"); } - /** - * Create a new options objects with the given fontFamily. - */ - withTextFontFamily(fontFamily) { - return this.extend({ - fontFamily, - font: "" - }); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js + var init_selection3 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js"() { + "use strict"; + init_src5(); + init_interrupt2(); + init_transition3(); + selection_default.prototype.interrupt = interrupt_default2; + selection_default.prototype.transition = transition_default2; } - /** - * Creates a new options object with the given font weight - */ - withTextFontWeight(fontWeight) { - return this.extend({ - fontWeight, - font: "" - }); + }); + + // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/index.js + var init_src11 = __esm({ + "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/index.js"() { + "use strict"; + init_selection3(); } - /** - * Creates a new options object with the given font weight - */ - withTextFontShape(fontShape) { - return this.extend({ - fontShape, - font: "" - }); + }); + + // ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/constant.js + var init_constant3 = __esm({ + "../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/constant.js"() { + "use strict"; } - /** - * Return the CSS sizing classes required to switch from enclosing options - * `oldOptions` to `this`. Returns an array of classes. - */ - sizingClasses(oldOptions) { - if (oldOptions.size !== this.size) { - return ["sizing", "reset-size" + oldOptions.size, "size" + this.size]; - } else { - return []; - } + }); + + // ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/event.js + var init_event = __esm({ + "../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/event.js"() { + "use strict"; } - /** - * Return the CSS sizing classes required to switch to the base size. Like - * `this.havingSize(BASESIZE).sizingClasses(this)`. - */ - baseSizingClasses() { - if (this.size !== Options.BASESIZE) { - return ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE]; - } else { - return []; - } + }); + + // ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/noevent.js + var init_noevent = __esm({ + "../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/noevent.js"() { + "use strict"; } - /** - * Return the font metrics for this size. - */ - fontMetrics() { - if (!this._fontMetrics) { - this._fontMetrics = getGlobalMetrics(this.size); - } - return this._fontMetrics; + }); + + // ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/brush.js + function number1(e3) { + return [+e3[0], +e3[1]]; + } + function number22(e3) { + return [number1(e3[0]), number1(e3[1])]; + } + function type(t4) { + return { type: t4 }; + } + var abs, max2, min2, X, Y, XY; + var init_brush = __esm({ + "../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/brush.js"() { + "use strict"; + init_src11(); + init_constant3(); + init_event(); + init_noevent(); + ({ abs, max: max2, min: min2 } = Math); + __name(number1, "number1"); + __name(number22, "number2"); + X = { + name: "x", + handles: ["w", "e"].map(type), + input: /* @__PURE__ */ __name(function(x5, e3) { + return x5 == null ? null : [[+x5[0], e3[0][1]], [+x5[1], e3[1][1]]]; + }, "input"), + output: /* @__PURE__ */ __name(function(xy) { + return xy && [xy[0][0], xy[1][0]]; + }, "output") + }; + Y = { + name: "y", + handles: ["n", "s"].map(type), + input: /* @__PURE__ */ __name(function(y5, e3) { + return y5 == null ? null : [[e3[0][0], +y5[0]], [e3[1][0], +y5[1]]]; + }, "input"), + output: /* @__PURE__ */ __name(function(xy) { + return xy && [xy[0][1], xy[1][1]]; + }, "output") + }; + XY = { + name: "xy", + handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type), + input: /* @__PURE__ */ __name(function(xy) { + return xy == null ? null : number22(xy); + }, "input"), + output: /* @__PURE__ */ __name(function(xy) { + return xy; + }, "output") + }; + __name(type, "type"); } - /** - * Gets the CSS color of the current options object - */ - getColor() { - if (this.phantom) { - return "transparent"; - } else { - return this.color; - } - } - } - Options.BASESIZE = 6; - var ptPerUnit = { - // https://en.wikibooks.org/wiki/LaTeX/Lengths and - // https://tex.stackexchange.com/a/8263 - "pt": 1, - // TeX point - "mm": 7227 / 2540, - // millimeter - "cm": 7227 / 254, - // centimeter - "in": 72.27, - // inch - "bp": 803 / 800, - // big (PostScript) points - "pc": 12, - // pica - "dd": 1238 / 1157, - // didot - "cc": 14856 / 1157, - // cicero (12 didot) - "nd": 685 / 642, - // new didot - "nc": 1370 / 107, - // new cicero (12 new didot) - "sp": 1 / 65536, - // scaled point (TeX's internal smallest unit) - // https://tex.stackexchange.com/a/41371 - "px": 803 / 800 - // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX - }; - var relativeUnit = { - "ex": true, - "em": true, - "mu": true - }; - var validUnit = function validUnit2(unit2) { - if (typeof unit2 !== "string") { - unit2 = unit2.unit; + }); + + // ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/index.js + var init_src12 = __esm({ + "../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/index.js"() { + "use strict"; + init_brush(); } - return unit2 in ptPerUnit || unit2 in relativeUnit || unit2 === "ex"; - }; - var calculateSize = function calculateSize2(sizeValue, options2) { - var scale; - if (sizeValue.unit in ptPerUnit) { - scale = ptPerUnit[sizeValue.unit] / options2.fontMetrics().ptPerEm / options2.sizeMultiplier; - } else if (sizeValue.unit === "mu") { - scale = options2.fontMetrics().cssEmPerMu; - } else { - var unitOptions; - if (options2.style.isTight()) { - unitOptions = options2.havingStyle(options2.style.text()); - } else { - unitOptions = options2; - } - if (sizeValue.unit === "ex") { - scale = unitOptions.fontMetrics().xHeight; - } else if (sizeValue.unit === "em") { - scale = unitOptions.fontMetrics().quad; - } else { - throw new ParseError("Invalid unit: '" + sizeValue.unit + "'"); - } - if (unitOptions !== options2) { - scale *= unitOptions.sizeMultiplier / options2.sizeMultiplier; - } + }); + + // ../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js + function append(strings) { + this._ += strings[0]; + for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) { + this._ += arguments[i2] + strings[i2]; } - return Math.min(sizeValue.number * scale, options2.maxSize); - }; - var makeEm = function makeEm2(n) { - return +n.toFixed(4) + "em"; - }; - var createClass = function createClass2(classes2) { - return classes2.filter((cls) => cls).join(" "); - }; - var initNode = function initNode2(classes2, options2, style) { - this.classes = classes2 || []; - this.attributes = {}; - this.height = 0; - this.depth = 0; - this.maxFontSize = 0; - this.style = style || {}; - if (options2) { - if (options2.style.isTight()) { - this.classes.push("mtight"); - } - var color2 = options2.getColor(); - if (color2) { - this.style.color = color2; + } + function appendRound(digits) { + let d2 = Math.floor(digits); + if (!(d2 >= 0)) throw new Error(`invalid digits: ${digits}`); + if (d2 > 15) return append; + const k2 = 10 ** d2; + return function(strings) { + this._ += strings[0]; + for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) { + this._ += Math.round(arguments[i2] * k2) / k2 + strings[i2]; } + }; + } + function path2() { + return new Path(); + } + var pi, tau, epsilon2, tauEpsilon, Path; + var init_path = __esm({ + "../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js"() { + "use strict"; + pi = Math.PI; + tau = 2 * pi; + epsilon2 = 1e-6; + tauEpsilon = tau - epsilon2; + __name(append, "append"); + __name(appendRound, "appendRound"); + Path = class { + static { + __name(this, "Path"); + } + constructor(digits) { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null; + this._ = ""; + this._append = digits == null ? append : appendRound(digits); + } + moveTo(x5, y5) { + this._append`M${this._x0 = this._x1 = +x5},${this._y0 = this._y1 = +y5}`; + } + closePath() { + if (this._x1 !== null) { + this._x1 = this._x0, this._y1 = this._y0; + this._append`Z`; + } + } + lineTo(x5, y5) { + this._append`L${this._x1 = +x5},${this._y1 = +y5}`; + } + quadraticCurveTo(x1, y1, x5, y5) { + this._append`Q${+x1},${+y1},${this._x1 = +x5},${this._y1 = +y5}`; + } + bezierCurveTo(x1, y1, x22, y22, x5, y5) { + this._append`C${+x1},${+y1},${+x22},${+y22},${this._x1 = +x5},${this._y1 = +y5}`; + } + arcTo(x1, y1, x22, y22, r2) { + x1 = +x1, y1 = +y1, x22 = +x22, y22 = +y22, r2 = +r2; + if (r2 < 0) throw new Error(`negative radius: ${r2}`); + let x0 = this._x1, y0 = this._y1, x21 = x22 - x1, y21 = y22 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01; + if (this._x1 === null) { + this._append`M${this._x1 = x1},${this._y1 = y1}`; + } else if (!(l01_2 > epsilon2)) ; + else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon2) || !r2) { + this._append`L${this._x1 = x1},${this._y1 = y1}`; + } else { + let x20 = x22 - x0, y20 = y22 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l2 = r2 * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l2 / l01, t21 = l2 / l21; + if (Math.abs(t01 - 1) > epsilon2) { + this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`; + } + this._append`A${r2},${r2},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`; + } + } + arc(x5, y5, r2, a0, a1, ccw) { + x5 = +x5, y5 = +y5, r2 = +r2, ccw = !!ccw; + if (r2 < 0) throw new Error(`negative radius: ${r2}`); + let dx = r2 * Math.cos(a0), dy = r2 * Math.sin(a0), x0 = x5 + dx, y0 = y5 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; + if (this._x1 === null) { + this._append`M${x0},${y0}`; + } else if (Math.abs(this._x1 - x0) > epsilon2 || Math.abs(this._y1 - y0) > epsilon2) { + this._append`L${x0},${y0}`; + } + if (!r2) return; + if (da < 0) da = da % tau + tau; + if (da > tauEpsilon) { + this._append`A${r2},${r2},0,1,${cw},${x5 - dx},${y5 - dy}A${r2},${r2},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`; + } else if (da > epsilon2) { + this._append`A${r2},${r2},0,${+(da >= pi)},${cw},${this._x1 = x5 + r2 * Math.cos(a1)},${this._y1 = y5 + r2 * Math.sin(a1)}`; + } + } + rect(x5, y5, w3, h2) { + this._append`M${this._x0 = this._x1 = +x5},${this._y0 = this._y1 = +y5}h${w3 = +w3}v${+h2}h${-w3}Z`; + } + toString() { + return this._; + } + }; + __name(path2, "path"); + path2.prototype = Path.prototype; } - }; - var toNode = function toNode2(tagName) { - var node2 = document.createElement(tagName); - node2.className = createClass(this.classes); - for (var style in this.style) { - if (this.style.hasOwnProperty(style)) { - node2.style[style] = this.style[style]; - } + }); + + // ../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/index.js + var init_src13 = __esm({ + "../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/index.js"() { + "use strict"; + init_path(); } - for (var attr in this.attributes) { - if (this.attributes.hasOwnProperty(attr)) { - node2.setAttribute(attr, this.attributes[attr]); - } + }); + + // ../../node_modules/.pnpm/d3-chord@3.0.1/node_modules/d3-chord/src/index.js + var init_src14 = __esm({ + "../../node_modules/.pnpm/d3-chord@3.0.1/node_modules/d3-chord/src/index.js"() { + "use strict"; } - for (var i2 = 0; i2 < this.children.length; i2++) { - node2.appendChild(this.children[i2].toNode()); + }); + + // ../../node_modules/.pnpm/d3-contour@4.0.2/node_modules/d3-contour/src/index.js + var init_src15 = __esm({ + "../../node_modules/.pnpm/d3-contour@4.0.2/node_modules/d3-contour/src/index.js"() { + "use strict"; } - return node2; - }; - var toMarkup = function toMarkup2(tagName) { - var markup = "<" + tagName; - if (this.classes.length) { - markup += ' class="' + utils.escape(createClass(this.classes)) + '"'; + }); + + // ../../node_modules/.pnpm/d3-delaunay@6.0.4/node_modules/d3-delaunay/src/index.js + var init_src16 = __esm({ + "../../node_modules/.pnpm/d3-delaunay@6.0.4/node_modules/d3-delaunay/src/index.js"() { + "use strict"; } - var styles2 = ""; - for (var style in this.style) { - if (this.style.hasOwnProperty(style)) { - styles2 += utils.hyphenate(style) + ":" + this.style[style] + ";"; - } + }); + + // ../../node_modules/.pnpm/d3-dsv@3.0.1/node_modules/d3-dsv/src/index.js + var init_src17 = __esm({ + "../../node_modules/.pnpm/d3-dsv@3.0.1/node_modules/d3-dsv/src/index.js"() { + "use strict"; } - if (styles2) { - markup += ' style="' + utils.escape(styles2) + '"'; + }); + + // ../../node_modules/.pnpm/d3-fetch@3.0.1/node_modules/d3-fetch/src/index.js + var init_src18 = __esm({ + "../../node_modules/.pnpm/d3-fetch@3.0.1/node_modules/d3-fetch/src/index.js"() { + "use strict"; } - for (var attr in this.attributes) { - if (this.attributes.hasOwnProperty(attr)) { - markup += " " + attr + '="' + utils.escape(this.attributes[attr]) + '"'; - } + }); + + // ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/index.js + var init_src19 = __esm({ + "../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/index.js"() { + "use strict"; } - markup += ">"; - for (var i2 = 0; i2 < this.children.length; i2++) { - markup += this.children[i2].toMarkup(); + }); + + // ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/index.js + var init_src20 = __esm({ + "../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/index.js"() { + "use strict"; } - markup += ""; - return markup; - }; - class Span { - constructor(classes2, children2, options2, style) { - this.children = void 0; - this.attributes = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.width = void 0; - this.maxFontSize = void 0; - this.style = void 0; - initNode.call(this, classes2, options2, style); - this.children = children2 || []; - } - /** - * Sets an arbitrary attribute on the span. Warning: use this wisely. Not - * all browsers support attributes the same, and having too many custom - * attributes is probably bad. - */ - setAttribute(attribute, value2) { - this.attributes[attribute] = value2; - } - hasClass(className) { - return utils.contains(this.classes, className); - } - toNode() { - return toNode.call(this, "span"); - } - toMarkup() { - return toMarkup.call(this, "span"); - } - } - class Anchor { - constructor(href, classes2, children2, options2) { - this.children = void 0; - this.attributes = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.maxFontSize = void 0; - this.style = void 0; - initNode.call(this, classes2, options2); - this.children = children2 || []; - this.setAttribute("href", href); - } - setAttribute(attribute, value2) { - this.attributes[attribute] = value2; - } - hasClass(className) { - return utils.contains(this.classes, className); - } - toNode() { - return toNode.call(this, "a"); - } - toMarkup() { - return toMarkup.call(this, "a"); - } - } - class Img { - constructor(src, alt, style) { - this.src = void 0; - this.alt = void 0; - this.classes = void 0; - this.height = void 0; - this.depth = void 0; - this.maxFontSize = void 0; - this.style = void 0; - this.alt = alt; - this.src = src; - this.classes = ["mord"]; - this.style = style; - } - hasClass(className) { - return utils.contains(this.classes, className); - } - toNode() { - var node2 = document.createElement("img"); - node2.src = this.src; - node2.alt = this.alt; - node2.className = "mord"; - for (var style in this.style) { - if (this.style.hasOwnProperty(style)) { - node2.style[style] = this.style[style]; - } - } - return node2; + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatDecimal.js + function formatDecimal_default(x5) { + return Math.abs(x5 = Math.round(x5)) >= 1e21 ? x5.toLocaleString("en").replace(/,/g, "") : x5.toString(10); + } + function formatDecimalParts(x5, p3) { + if ((i2 = (x5 = p3 ? x5.toExponential(p3 - 1) : x5.toExponential()).indexOf("e")) < 0) return null; + var i2, coefficient = x5.slice(0, i2); + return [ + coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, + +x5.slice(i2 + 1) + ]; + } + var init_formatDecimal = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatDecimal.js"() { + "use strict"; + __name(formatDecimal_default, "default"); + __name(formatDecimalParts, "formatDecimalParts"); } - toMarkup() { - var markup = "" + this.alt + " 0 && g2 > 0) { + if (length2 + g2 + 1 > width3) g2 = Math.max(1, width3 - length2); + t4.push(value2.substring(i2 -= g2, i2 + g2)); + if ((length2 += g2 + 1) > width3) break; + g2 = grouping[j2 = (j2 + 1) % grouping.length]; + } + return t4.reverse().join(thousands); + }; } - var iCombinations = { - "î": "ı̂", - "ï": "ı̈", - "í": "ı́", - // 'ī': '\u0131\u0304', // enable when we add Extended Latin - "ì": "ı̀" - }; - class SymbolNode { - constructor(text2, height, depth, italic, skew, width2, classes2, style) { - this.text = void 0; - this.height = void 0; - this.depth = void 0; - this.italic = void 0; - this.skew = void 0; - this.width = void 0; - this.maxFontSize = void 0; - this.classes = void 0; - this.style = void 0; - this.text = text2; - this.height = height || 0; - this.depth = depth || 0; - this.italic = italic || 0; - this.skew = skew || 0; - this.width = width2 || 0; - this.classes = classes2 || []; - this.style = style || {}; - this.maxFontSize = 0; - var script = scriptFromCodepoint(this.text.charCodeAt(0)); - if (script) { - this.classes.push(script + "_fallback"); - } - if (/[îïíì]/.test(this.text)) { - this.text = iCombinations[this.text]; - } - } - hasClass(className) { - return utils.contains(this.classes, className); - } - /** - * Creates a text node or span from a symbol node. Note that a span is only - * created if it is needed. - */ - toNode() { - var node2 = document.createTextNode(this.text); - var span = null; - if (this.italic > 0) { - span = document.createElement("span"); - span.style.marginRight = makeEm(this.italic); - } - if (this.classes.length > 0) { - span = span || document.createElement("span"); - span.className = createClass(this.classes); - } - for (var style in this.style) { - if (this.style.hasOwnProperty(style)) { - span = span || document.createElement("span"); - span.style[style] = this.style[style]; - } - } - if (span) { - span.appendChild(node2); - return span; - } else { - return node2; - } + var init_formatGroup = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatGroup.js"() { + "use strict"; + __name(formatGroup_default, "default"); } - /** - * Creates markup for a symbol node. - */ - toMarkup() { - var needsSpan = false; - var markup = " 0) { - styles2 += "margin-right:" + this.italic + "em;"; - } - for (var style in this.style) { - if (this.style.hasOwnProperty(style)) { - styles2 += utils.hyphenate(style) + ":" + this.style[style] + ";"; - } - } - if (styles2) { - needsSpan = true; - markup += ' style="' + utils.escape(styles2) + '"'; - } - var escaped = utils.escape(this.text); - if (needsSpan) { - markup += ">"; - markup += escaped; - markup += ""; - return markup; - } else { - return escaped; - } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatNumerals.js + function formatNumerals_default(numerals) { + return function(value2) { + return value2.replace(/[0-9]/g, function(i2) { + return numerals[+i2]; + }); + }; + } + var init_formatNumerals = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatNumerals.js"() { + "use strict"; + __name(formatNumerals_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatSpecifier.js + function formatSpecifier(specifier) { + if (!(match2 = re.exec(specifier))) throw new Error("invalid format: " + specifier); + var match2; + return new FormatSpecifier({ + fill: match2[1], + align: match2[2], + sign: match2[3], + symbol: match2[4], + zero: match2[5], + width: match2[6], + comma: match2[7], + precision: match2[8] && match2[8].slice(1), + trim: match2[9], + type: match2[10] + }); + } + function FormatSpecifier(specifier) { + this.fill = specifier.fill === void 0 ? " " : specifier.fill + ""; + this.align = specifier.align === void 0 ? ">" : specifier.align + ""; + this.sign = specifier.sign === void 0 ? "-" : specifier.sign + ""; + this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + ""; + this.zero = !!specifier.zero; + this.width = specifier.width === void 0 ? void 0 : +specifier.width; + this.comma = !!specifier.comma; + this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision; + this.trim = !!specifier.trim; + this.type = specifier.type === void 0 ? "" : specifier.type + ""; } - class SvgNode { - constructor(children2, attributes) { - this.children = void 0; - this.attributes = void 0; - this.children = children2 || []; - this.attributes = attributes || {}; + var re; + var init_formatSpecifier = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatSpecifier.js"() { + "use strict"; + re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; + __name(formatSpecifier, "formatSpecifier"); + formatSpecifier.prototype = FormatSpecifier.prototype; + __name(FormatSpecifier, "FormatSpecifier"); + FormatSpecifier.prototype.toString = function() { + return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; + }; } - toNode() { - var svgNS = "http://www.w3.org/2000/svg"; - var node2 = document.createElementNS(svgNS, "svg"); - for (var attr in this.attributes) { - if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { - node2.setAttribute(attr, this.attributes[attr]); - } - } - for (var i2 = 0; i2 < this.children.length; i2++) { - node2.appendChild(this.children[i2].toNode()); + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTrim.js + function formatTrim_default(s2) { + out: for (var n2 = s2.length, i2 = 1, i0 = -1, i1; i2 < n2; ++i2) { + switch (s2[i2]) { + case ".": + i0 = i1 = i2; + break; + case "0": + if (i0 === 0) i0 = i2; + i1 = i2; + break; + default: + if (!+s2[i2]) break out; + if (i0 > 0) i0 = 0; + break; } - return node2; } - toMarkup() { - var markup = ' 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2; + } + var init_formatTrim = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTrim.js"() { + "use strict"; + __name(formatTrim_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatPrefixAuto.js + function formatPrefixAuto_default(x5, p3) { + var d2 = formatDecimalParts(x5, p3); + if (!d2) return x5 + ""; + var coefficient = d2[0], exponent = d2[1], i2 = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n2 = coefficient.length; + return i2 === n2 ? coefficient : i2 > n2 ? coefficient + new Array(i2 - n2 + 1).join("0") : i2 > 0 ? coefficient.slice(0, i2) + "." + coefficient.slice(i2) : "0." + new Array(1 - i2).join("0") + formatDecimalParts(x5, Math.max(0, p3 + i2 - 1))[0]; } - class PathNode { - constructor(pathName, alternate) { - this.pathName = void 0; - this.alternate = void 0; - this.pathName = pathName; - this.alternate = alternate; + var prefixExponent; + var init_formatPrefixAuto = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatPrefixAuto.js"() { + "use strict"; + init_formatDecimal(); + __name(formatPrefixAuto_default, "default"); } - toNode() { - var svgNS = "http://www.w3.org/2000/svg"; - var node2 = document.createElementNS(svgNS, "path"); - if (this.alternate) { - node2.setAttribute("d", this.alternate); - } else { - node2.setAttribute("d", path$1[this.pathName]); - } - return node2; + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatRounded.js + function formatRounded_default(x5, p3) { + var d2 = formatDecimalParts(x5, p3); + if (!d2) return x5 + ""; + var coefficient = d2[0], exponent = d2[1]; + return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0"); + } + var init_formatRounded = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatRounded.js"() { + "use strict"; + init_formatDecimal(); + __name(formatRounded_default, "default"); } - toMarkup() { - if (this.alternate) { - return ""; - } else { - return ""; - } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTypes.js + var formatTypes_default; + var init_formatTypes = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/formatTypes.js"() { + "use strict"; + init_formatDecimal(); + init_formatPrefixAuto(); + init_formatRounded(); + formatTypes_default = { + "%": /* @__PURE__ */ __name((x5, p3) => (x5 * 100).toFixed(p3), "%"), + "b": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(2), "b"), + "c": /* @__PURE__ */ __name((x5) => x5 + "", "c"), + "d": formatDecimal_default, + "e": /* @__PURE__ */ __name((x5, p3) => x5.toExponential(p3), "e"), + "f": /* @__PURE__ */ __name((x5, p3) => x5.toFixed(p3), "f"), + "g": /* @__PURE__ */ __name((x5, p3) => x5.toPrecision(p3), "g"), + "o": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(8), "o"), + "p": /* @__PURE__ */ __name((x5, p3) => formatRounded_default(x5 * 100, p3), "p"), + "r": formatRounded_default, + "s": formatPrefixAuto_default, + "X": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(16).toUpperCase(), "X"), + "x": /* @__PURE__ */ __name((x5) => Math.round(x5).toString(16), "x") + }; } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/identity.js + function identity_default2(x5) { + return x5; } - class LineNode { - constructor(attributes) { - this.attributes = void 0; - this.attributes = attributes || {}; + var init_identity2 = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/identity.js"() { + "use strict"; + __name(identity_default2, "default"); } - toNode() { - var svgNS = "http://www.w3.org/2000/svg"; - var node2 = document.createElementNS(svgNS, "line"); - for (var attr in this.attributes) { - if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { - node2.setAttribute(attr, this.attributes[attr]); + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/locale.js + function locale_default(locale3) { + var group2 = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default2 : formatGroup_default(map.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default2 : formatNumerals_default(map.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus = locale3.minus === void 0 ? "\u2212" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + ""; + function newFormat(specifier) { + specifier = formatSpecifier(specifier); + var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width3 = specifier.width, comma = specifier.comma, precision = specifier.precision, trim2 = specifier.trim, type3 = specifier.type; + if (type3 === "n") comma = true, type3 = "g"; + else if (!formatTypes_default[type3]) precision === void 0 && (precision = 12), trim2 = true, type3 = "g"; + if (zero3 || fill === "0" && align === "=") zero3 = true, fill = "0", align = "="; + var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type3) ? "0" + type3.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type3) ? percent : ""; + var formatType = formatTypes_default[type3], maybeSuffix = /[defgprs%]/.test(type3); + precision = precision === void 0 ? 6 : /[gprs]/.test(type3) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); + function format3(value2) { + var valuePrefix = prefix, valueSuffix = suffix, i2, n2, c3; + if (type3 === "c") { + valueSuffix = formatType(value2) + valueSuffix; + value2 = ""; + } else { + value2 = +value2; + var valueNegative = value2 < 0 || 1 / value2 < 0; + value2 = isNaN(value2) ? nan : formatType(Math.abs(value2), precision); + if (trim2) value2 = formatTrim_default(value2); + if (valueNegative && +value2 === 0 && sign2 !== "+") valueNegative = false; + valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix; + valueSuffix = (type3 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : ""); + if (maybeSuffix) { + i2 = -1, n2 = value2.length; + while (++i2 < n2) { + if (c3 = value2.charCodeAt(i2), 48 > c3 || c3 > 57) { + valueSuffix = (c3 === 46 ? decimal + value2.slice(i2 + 1) : value2.slice(i2)) + valueSuffix; + value2 = value2.slice(0, i2); + break; + } + } + } } - } - return node2; - } - toMarkup() { - var markup = "> 1) + valuePrefix + value2 + valueSuffix + padding3.slice(length2); + break; + default: + value2 = padding3 + valuePrefix + value2 + valueSuffix; + break; } + return numerals(value2); } - markup += "/>"; - return markup; + __name(format3, "format"); + format3.toString = function() { + return specifier + ""; + }; + return format3; } + __name(newFormat, "newFormat"); + function formatPrefix2(specifier, value2) { + var f3 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e3 = Math.max(-8, Math.min(8, Math.floor(exponent_default(value2) / 3))) * 3, k2 = Math.pow(10, -e3), prefix = prefixes[8 + e3 / 3]; + return function(value3) { + return f3(k2 * value3) + prefix; + }; + } + __name(formatPrefix2, "formatPrefix"); + return { + format: newFormat, + formatPrefix: formatPrefix2 + }; } - function assertSymbolDomNode(group) { - if (group instanceof SymbolNode) { - return group; - } else { - throw new Error("Expected symbolNode but got " + String(group) + "."); + var map, prefixes; + var init_locale = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/locale.js"() { + "use strict"; + init_exponent(); + init_formatGroup(); + init_formatNumerals(); + init_formatSpecifier(); + init_formatTrim(); + init_formatTypes(); + init_formatPrefixAuto(); + init_identity2(); + map = Array.prototype.map; + prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; + __name(locale_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/defaultLocale.js + function defaultLocale(definition) { + locale = locale_default(definition); + format2 = locale.format; + formatPrefix = locale.formatPrefix; + return locale; } - function assertSpan(group) { - if (group instanceof Span) { - return group; - } else { - throw new Error("Expected span but got " + String(group) + "."); + var locale, format2, formatPrefix; + var init_defaultLocale = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/defaultLocale.js"() { + "use strict"; + init_locale(); + defaultLocale({ + thousands: ",", + grouping: [3], + currency: ["$", ""] + }); + __name(defaultLocale, "defaultLocale"); } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionFixed.js + function precisionFixed_default(step3) { + return Math.max(0, -exponent_default(Math.abs(step3))); } - var ATOMS = { - "bin": 1, - "close": 1, - "inner": 1, - "open": 1, - "punct": 1, - "rel": 1 - }; - var NON_ATOMS = { - "accent-token": 1, - "mathord": 1, - "op-token": 1, - "spacing": 1, - "textord": 1 - }; - var symbols = { - "math": {}, - "text": {} - }; - function defineSymbol(mode, font, group, replace2, name, acceptUnicodeChar) { - symbols[mode][name] = { - font, - group, - replace: replace2 - }; - if (acceptUnicodeChar && replace2) { - symbols[mode][replace2] = symbols[mode][name]; + var init_precisionFixed = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionFixed.js"() { + "use strict"; + init_exponent(); + __name(precisionFixed_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionPrefix.js + function precisionPrefix_default(step3, value2) { + return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value2) / 3))) * 3 - exponent_default(Math.abs(step3))); } - var math = "math"; - var text$2 = "text"; - var main = "main"; - var ams = "ams"; - var accent = "accent-token"; - var bin = "bin"; - var close = "close"; - var inner = "inner"; - var mathord = "mathord"; - var op = "op-token"; - var open = "open"; - var punct = "punct"; - var rel = "rel"; - var spacing = "spacing"; - var textord = "textord"; - defineSymbol(math, main, rel, "≡", "\\equiv", true); - defineSymbol(math, main, rel, "≺", "\\prec", true); - defineSymbol(math, main, rel, "≻", "\\succ", true); - defineSymbol(math, main, rel, "∼", "\\sim", true); - defineSymbol(math, main, rel, "⊥", "\\perp"); - defineSymbol(math, main, rel, "⪯", "\\preceq", true); - defineSymbol(math, main, rel, "⪰", "\\succeq", true); - defineSymbol(math, main, rel, "≃", "\\simeq", true); - defineSymbol(math, main, rel, "∣", "\\mid", true); - defineSymbol(math, main, rel, "≪", "\\ll", true); - defineSymbol(math, main, rel, "≫", "\\gg", true); - defineSymbol(math, main, rel, "≍", "\\asymp", true); - defineSymbol(math, main, rel, "∥", "\\parallel"); - defineSymbol(math, main, rel, "⋈", "\\bowtie", true); - defineSymbol(math, main, rel, "⌣", "\\smile", true); - defineSymbol(math, main, rel, "⊑", "\\sqsubseteq", true); - defineSymbol(math, main, rel, "⊒", "\\sqsupseteq", true); - defineSymbol(math, main, rel, "≐", "\\doteq", true); - defineSymbol(math, main, rel, "⌢", "\\frown", true); - defineSymbol(math, main, rel, "∋", "\\ni", true); - defineSymbol(math, main, rel, "∝", "\\propto", true); - defineSymbol(math, main, rel, "⊢", "\\vdash", true); - defineSymbol(math, main, rel, "⊣", "\\dashv", true); - defineSymbol(math, main, rel, "∋", "\\owns"); - defineSymbol(math, main, punct, ".", "\\ldotp"); - defineSymbol(math, main, punct, "⋅", "\\cdotp"); - defineSymbol(math, main, textord, "#", "\\#"); - defineSymbol(text$2, main, textord, "#", "\\#"); - defineSymbol(math, main, textord, "&", "\\&"); - defineSymbol(text$2, main, textord, "&", "\\&"); - defineSymbol(math, main, textord, "ℵ", "\\aleph", true); - defineSymbol(math, main, textord, "∀", "\\forall", true); - defineSymbol(math, main, textord, "ℏ", "\\hbar", true); - defineSymbol(math, main, textord, "∃", "\\exists", true); - defineSymbol(math, main, textord, "∇", "\\nabla", true); - defineSymbol(math, main, textord, "♭", "\\flat", true); - defineSymbol(math, main, textord, "ℓ", "\\ell", true); - defineSymbol(math, main, textord, "♮", "\\natural", true); - defineSymbol(math, main, textord, "♣", "\\clubsuit", true); - defineSymbol(math, main, textord, "℘", "\\wp", true); - defineSymbol(math, main, textord, "♯", "\\sharp", true); - defineSymbol(math, main, textord, "♢", "\\diamondsuit", true); - defineSymbol(math, main, textord, "ℜ", "\\Re", true); - defineSymbol(math, main, textord, "♡", "\\heartsuit", true); - defineSymbol(math, main, textord, "ℑ", "\\Im", true); - defineSymbol(math, main, textord, "♠", "\\spadesuit", true); - defineSymbol(math, main, textord, "§", "\\S", true); - defineSymbol(text$2, main, textord, "§", "\\S"); - defineSymbol(math, main, textord, "¶", "\\P", true); - defineSymbol(text$2, main, textord, "¶", "\\P"); - defineSymbol(math, main, textord, "†", "\\dag"); - defineSymbol(text$2, main, textord, "†", "\\dag"); - defineSymbol(text$2, main, textord, "†", "\\textdagger"); - defineSymbol(math, main, textord, "‡", "\\ddag"); - defineSymbol(text$2, main, textord, "‡", "\\ddag"); - defineSymbol(text$2, main, textord, "‡", "\\textdaggerdbl"); - defineSymbol(math, main, close, "⎱", "\\rmoustache", true); - defineSymbol(math, main, open, "⎰", "\\lmoustache", true); - defineSymbol(math, main, close, "⟯", "\\rgroup", true); - defineSymbol(math, main, open, "⟮", "\\lgroup", true); - defineSymbol(math, main, bin, "∓", "\\mp", true); - defineSymbol(math, main, bin, "⊖", "\\ominus", true); - defineSymbol(math, main, bin, "⊎", "\\uplus", true); - defineSymbol(math, main, bin, "⊓", "\\sqcap", true); - defineSymbol(math, main, bin, "∗", "\\ast"); - defineSymbol(math, main, bin, "⊔", "\\sqcup", true); - defineSymbol(math, main, bin, "◯", "\\bigcirc", true); - defineSymbol(math, main, bin, "∙", "\\bullet", true); - defineSymbol(math, main, bin, "‡", "\\ddagger"); - defineSymbol(math, main, bin, "≀", "\\wr", true); - defineSymbol(math, main, bin, "⨿", "\\amalg"); - defineSymbol(math, main, bin, "&", "\\And"); - defineSymbol(math, main, rel, "⟵", "\\longleftarrow", true); - defineSymbol(math, main, rel, "⇐", "\\Leftarrow", true); - defineSymbol(math, main, rel, "⟸", "\\Longleftarrow", true); - defineSymbol(math, main, rel, "⟶", "\\longrightarrow", true); - defineSymbol(math, main, rel, "⇒", "\\Rightarrow", true); - defineSymbol(math, main, rel, "⟹", "\\Longrightarrow", true); - defineSymbol(math, main, rel, "↔", "\\leftrightarrow", true); - defineSymbol(math, main, rel, "⟷", "\\longleftrightarrow", true); - defineSymbol(math, main, rel, "⇔", "\\Leftrightarrow", true); - defineSymbol(math, main, rel, "⟺", "\\Longleftrightarrow", true); - defineSymbol(math, main, rel, "↦", "\\mapsto", true); - defineSymbol(math, main, rel, "⟼", "\\longmapsto", true); - defineSymbol(math, main, rel, "↗", "\\nearrow", true); - defineSymbol(math, main, rel, "↩", "\\hookleftarrow", true); - defineSymbol(math, main, rel, "↪", "\\hookrightarrow", true); - defineSymbol(math, main, rel, "↘", "\\searrow", true); - defineSymbol(math, main, rel, "↼", "\\leftharpoonup", true); - defineSymbol(math, main, rel, "⇀", "\\rightharpoonup", true); - defineSymbol(math, main, rel, "↙", "\\swarrow", true); - defineSymbol(math, main, rel, "↽", "\\leftharpoondown", true); - defineSymbol(math, main, rel, "⇁", "\\rightharpoondown", true); - defineSymbol(math, main, rel, "↖", "\\nwarrow", true); - defineSymbol(math, main, rel, "⇌", "\\rightleftharpoons", true); - defineSymbol(math, ams, rel, "≮", "\\nless", true); - defineSymbol(math, ams, rel, "", "\\@nleqslant"); - defineSymbol(math, ams, rel, "", "\\@nleqq"); - defineSymbol(math, ams, rel, "⪇", "\\lneq", true); - defineSymbol(math, ams, rel, "≨", "\\lneqq", true); - defineSymbol(math, ams, rel, "", "\\@lvertneqq"); - defineSymbol(math, ams, rel, "⋦", "\\lnsim", true); - defineSymbol(math, ams, rel, "⪉", "\\lnapprox", true); - defineSymbol(math, ams, rel, "⊀", "\\nprec", true); - defineSymbol(math, ams, rel, "⋠", "\\npreceq", true); - defineSymbol(math, ams, rel, "⋨", "\\precnsim", true); - defineSymbol(math, ams, rel, "⪹", "\\precnapprox", true); - defineSymbol(math, ams, rel, "≁", "\\nsim", true); - defineSymbol(math, ams, rel, "", "\\@nshortmid"); - defineSymbol(math, ams, rel, "∤", "\\nmid", true); - defineSymbol(math, ams, rel, "⊬", "\\nvdash", true); - defineSymbol(math, ams, rel, "⊭", "\\nvDash", true); - defineSymbol(math, ams, rel, "⋪", "\\ntriangleleft"); - defineSymbol(math, ams, rel, "⋬", "\\ntrianglelefteq", true); - defineSymbol(math, ams, rel, "⊊", "\\subsetneq", true); - defineSymbol(math, ams, rel, "", "\\@varsubsetneq"); - defineSymbol(math, ams, rel, "⫋", "\\subsetneqq", true); - defineSymbol(math, ams, rel, "", "\\@varsubsetneqq"); - defineSymbol(math, ams, rel, "≯", "\\ngtr", true); - defineSymbol(math, ams, rel, "", "\\@ngeqslant"); - defineSymbol(math, ams, rel, "", "\\@ngeqq"); - defineSymbol(math, ams, rel, "⪈", "\\gneq", true); - defineSymbol(math, ams, rel, "≩", "\\gneqq", true); - defineSymbol(math, ams, rel, "", "\\@gvertneqq"); - defineSymbol(math, ams, rel, "⋧", "\\gnsim", true); - defineSymbol(math, ams, rel, "⪊", "\\gnapprox", true); - defineSymbol(math, ams, rel, "⊁", "\\nsucc", true); - defineSymbol(math, ams, rel, "⋡", "\\nsucceq", true); - defineSymbol(math, ams, rel, "⋩", "\\succnsim", true); - defineSymbol(math, ams, rel, "⪺", "\\succnapprox", true); - defineSymbol(math, ams, rel, "≆", "\\ncong", true); - defineSymbol(math, ams, rel, "", "\\@nshortparallel"); - defineSymbol(math, ams, rel, "∦", "\\nparallel", true); - defineSymbol(math, ams, rel, "⊯", "\\nVDash", true); - defineSymbol(math, ams, rel, "⋫", "\\ntriangleright"); - defineSymbol(math, ams, rel, "⋭", "\\ntrianglerighteq", true); - defineSymbol(math, ams, rel, "", "\\@nsupseteqq"); - defineSymbol(math, ams, rel, "⊋", "\\supsetneq", true); - defineSymbol(math, ams, rel, "", "\\@varsupsetneq"); - defineSymbol(math, ams, rel, "⫌", "\\supsetneqq", true); - defineSymbol(math, ams, rel, "", "\\@varsupsetneqq"); - defineSymbol(math, ams, rel, "⊮", "\\nVdash", true); - defineSymbol(math, ams, rel, "⪵", "\\precneqq", true); - defineSymbol(math, ams, rel, "⪶", "\\succneqq", true); - defineSymbol(math, ams, rel, "", "\\@nsubseteqq"); - defineSymbol(math, ams, bin, "⊴", "\\unlhd"); - defineSymbol(math, ams, bin, "⊵", "\\unrhd"); - defineSymbol(math, ams, rel, "↚", "\\nleftarrow", true); - defineSymbol(math, ams, rel, "↛", "\\nrightarrow", true); - defineSymbol(math, ams, rel, "⇍", "\\nLeftarrow", true); - defineSymbol(math, ams, rel, "⇏", "\\nRightarrow", true); - defineSymbol(math, ams, rel, "↮", "\\nleftrightarrow", true); - defineSymbol(math, ams, rel, "⇎", "\\nLeftrightarrow", true); - defineSymbol(math, ams, rel, "△", "\\vartriangle"); - defineSymbol(math, ams, textord, "ℏ", "\\hslash"); - defineSymbol(math, ams, textord, "▽", "\\triangledown"); - defineSymbol(math, ams, textord, "◊", "\\lozenge"); - defineSymbol(math, ams, textord, "Ⓢ", "\\circledS"); - defineSymbol(math, ams, textord, "®", "\\circledR"); - defineSymbol(text$2, ams, textord, "®", "\\circledR"); - defineSymbol(math, ams, textord, "∡", "\\measuredangle", true); - defineSymbol(math, ams, textord, "∄", "\\nexists"); - defineSymbol(math, ams, textord, "℧", "\\mho"); - defineSymbol(math, ams, textord, "Ⅎ", "\\Finv", true); - defineSymbol(math, ams, textord, "⅁", "\\Game", true); - defineSymbol(math, ams, textord, "‵", "\\backprime"); - defineSymbol(math, ams, textord, "▲", "\\blacktriangle"); - defineSymbol(math, ams, textord, "▼", "\\blacktriangledown"); - defineSymbol(math, ams, textord, "■", "\\blacksquare"); - defineSymbol(math, ams, textord, "⧫", "\\blacklozenge"); - defineSymbol(math, ams, textord, "★", "\\bigstar"); - defineSymbol(math, ams, textord, "∢", "\\sphericalangle", true); - defineSymbol(math, ams, textord, "∁", "\\complement", true); - defineSymbol(math, ams, textord, "ð", "\\eth", true); - defineSymbol(text$2, main, textord, "ð", "ð"); - defineSymbol(math, ams, textord, "╱", "\\diagup"); - defineSymbol(math, ams, textord, "╲", "\\diagdown"); - defineSymbol(math, ams, textord, "□", "\\square"); - defineSymbol(math, ams, textord, "□", "\\Box"); - defineSymbol(math, ams, textord, "◊", "\\Diamond"); - defineSymbol(math, ams, textord, "¥", "\\yen", true); - defineSymbol(text$2, ams, textord, "¥", "\\yen", true); - defineSymbol(math, ams, textord, "✓", "\\checkmark", true); - defineSymbol(text$2, ams, textord, "✓", "\\checkmark"); - defineSymbol(math, ams, textord, "ℶ", "\\beth", true); - defineSymbol(math, ams, textord, "ℸ", "\\daleth", true); - defineSymbol(math, ams, textord, "ℷ", "\\gimel", true); - defineSymbol(math, ams, textord, "ϝ", "\\digamma", true); - defineSymbol(math, ams, textord, "ϰ", "\\varkappa"); - defineSymbol(math, ams, open, "┌", "\\@ulcorner", true); - defineSymbol(math, ams, close, "┐", "\\@urcorner", true); - defineSymbol(math, ams, open, "└", "\\@llcorner", true); - defineSymbol(math, ams, close, "┘", "\\@lrcorner", true); - defineSymbol(math, ams, rel, "≦", "\\leqq", true); - defineSymbol(math, ams, rel, "⩽", "\\leqslant", true); - defineSymbol(math, ams, rel, "⪕", "\\eqslantless", true); - defineSymbol(math, ams, rel, "≲", "\\lesssim", true); - defineSymbol(math, ams, rel, "⪅", "\\lessapprox", true); - defineSymbol(math, ams, rel, "≊", "\\approxeq", true); - defineSymbol(math, ams, bin, "⋖", "\\lessdot"); - defineSymbol(math, ams, rel, "⋘", "\\lll", true); - defineSymbol(math, ams, rel, "≶", "\\lessgtr", true); - defineSymbol(math, ams, rel, "⋚", "\\lesseqgtr", true); - defineSymbol(math, ams, rel, "⪋", "\\lesseqqgtr", true); - defineSymbol(math, ams, rel, "≑", "\\doteqdot"); - defineSymbol(math, ams, rel, "≓", "\\risingdotseq", true); - defineSymbol(math, ams, rel, "≒", "\\fallingdotseq", true); - defineSymbol(math, ams, rel, "∽", "\\backsim", true); - defineSymbol(math, ams, rel, "⋍", "\\backsimeq", true); - defineSymbol(math, ams, rel, "⫅", "\\subseteqq", true); - defineSymbol(math, ams, rel, "⋐", "\\Subset", true); - defineSymbol(math, ams, rel, "⊏", "\\sqsubset", true); - defineSymbol(math, ams, rel, "≼", "\\preccurlyeq", true); - defineSymbol(math, ams, rel, "⋞", "\\curlyeqprec", true); - defineSymbol(math, ams, rel, "≾", "\\precsim", true); - defineSymbol(math, ams, rel, "⪷", "\\precapprox", true); - defineSymbol(math, ams, rel, "⊲", "\\vartriangleleft"); - defineSymbol(math, ams, rel, "⊴", "\\trianglelefteq"); - defineSymbol(math, ams, rel, "⊨", "\\vDash", true); - defineSymbol(math, ams, rel, "⊪", "\\Vvdash", true); - defineSymbol(math, ams, rel, "⌣", "\\smallsmile"); - defineSymbol(math, ams, rel, "⌢", "\\smallfrown"); - defineSymbol(math, ams, rel, "≏", "\\bumpeq", true); - defineSymbol(math, ams, rel, "≎", "\\Bumpeq", true); - defineSymbol(math, ams, rel, "≧", "\\geqq", true); - defineSymbol(math, ams, rel, "⩾", "\\geqslant", true); - defineSymbol(math, ams, rel, "⪖", "\\eqslantgtr", true); - defineSymbol(math, ams, rel, "≳", "\\gtrsim", true); - defineSymbol(math, ams, rel, "⪆", "\\gtrapprox", true); - defineSymbol(math, ams, bin, "⋗", "\\gtrdot"); - defineSymbol(math, ams, rel, "⋙", "\\ggg", true); - defineSymbol(math, ams, rel, "≷", "\\gtrless", true); - defineSymbol(math, ams, rel, "⋛", "\\gtreqless", true); - defineSymbol(math, ams, rel, "⪌", "\\gtreqqless", true); - defineSymbol(math, ams, rel, "≖", "\\eqcirc", true); - defineSymbol(math, ams, rel, "≗", "\\circeq", true); - defineSymbol(math, ams, rel, "≜", "\\triangleq", true); - defineSymbol(math, ams, rel, "∼", "\\thicksim"); - defineSymbol(math, ams, rel, "≈", "\\thickapprox"); - defineSymbol(math, ams, rel, "⫆", "\\supseteqq", true); - defineSymbol(math, ams, rel, "⋑", "\\Supset", true); - defineSymbol(math, ams, rel, "⊐", "\\sqsupset", true); - defineSymbol(math, ams, rel, "≽", "\\succcurlyeq", true); - defineSymbol(math, ams, rel, "⋟", "\\curlyeqsucc", true); - defineSymbol(math, ams, rel, "≿", "\\succsim", true); - defineSymbol(math, ams, rel, "⪸", "\\succapprox", true); - defineSymbol(math, ams, rel, "⊳", "\\vartriangleright"); - defineSymbol(math, ams, rel, "⊵", "\\trianglerighteq"); - defineSymbol(math, ams, rel, "⊩", "\\Vdash", true); - defineSymbol(math, ams, rel, "∣", "\\shortmid"); - defineSymbol(math, ams, rel, "∥", "\\shortparallel"); - defineSymbol(math, ams, rel, "≬", "\\between", true); - defineSymbol(math, ams, rel, "⋔", "\\pitchfork", true); - defineSymbol(math, ams, rel, "∝", "\\varpropto"); - defineSymbol(math, ams, rel, "◀", "\\blacktriangleleft"); - defineSymbol(math, ams, rel, "∴", "\\therefore", true); - defineSymbol(math, ams, rel, "∍", "\\backepsilon"); - defineSymbol(math, ams, rel, "▶", "\\blacktriangleright"); - defineSymbol(math, ams, rel, "∵", "\\because", true); - defineSymbol(math, ams, rel, "⋘", "\\llless"); - defineSymbol(math, ams, rel, "⋙", "\\gggtr"); - defineSymbol(math, ams, bin, "⊲", "\\lhd"); - defineSymbol(math, ams, bin, "⊳", "\\rhd"); - defineSymbol(math, ams, rel, "≂", "\\eqsim", true); - defineSymbol(math, main, rel, "⋈", "\\Join"); - defineSymbol(math, ams, rel, "≑", "\\Doteq", true); - defineSymbol(math, ams, bin, "∔", "\\dotplus", true); - defineSymbol(math, ams, bin, "∖", "\\smallsetminus"); - defineSymbol(math, ams, bin, "⋒", "\\Cap", true); - defineSymbol(math, ams, bin, "⋓", "\\Cup", true); - defineSymbol(math, ams, bin, "⩞", "\\doublebarwedge", true); - defineSymbol(math, ams, bin, "⊟", "\\boxminus", true); - defineSymbol(math, ams, bin, "⊞", "\\boxplus", true); - defineSymbol(math, ams, bin, "⋇", "\\divideontimes", true); - defineSymbol(math, ams, bin, "⋉", "\\ltimes", true); - defineSymbol(math, ams, bin, "⋊", "\\rtimes", true); - defineSymbol(math, ams, bin, "⋋", "\\leftthreetimes", true); - defineSymbol(math, ams, bin, "⋌", "\\rightthreetimes", true); - defineSymbol(math, ams, bin, "⋏", "\\curlywedge", true); - defineSymbol(math, ams, bin, "⋎", "\\curlyvee", true); - defineSymbol(math, ams, bin, "⊝", "\\circleddash", true); - defineSymbol(math, ams, bin, "⊛", "\\circledast", true); - defineSymbol(math, ams, bin, "⋅", "\\centerdot"); - defineSymbol(math, ams, bin, "⊺", "\\intercal", true); - defineSymbol(math, ams, bin, "⋒", "\\doublecap"); - defineSymbol(math, ams, bin, "⋓", "\\doublecup"); - defineSymbol(math, ams, bin, "⊠", "\\boxtimes", true); - defineSymbol(math, ams, rel, "⇢", "\\dashrightarrow", true); - defineSymbol(math, ams, rel, "⇠", "\\dashleftarrow", true); - defineSymbol(math, ams, rel, "⇇", "\\leftleftarrows", true); - defineSymbol(math, ams, rel, "⇆", "\\leftrightarrows", true); - defineSymbol(math, ams, rel, "⇚", "\\Lleftarrow", true); - defineSymbol(math, ams, rel, "↞", "\\twoheadleftarrow", true); - defineSymbol(math, ams, rel, "↢", "\\leftarrowtail", true); - defineSymbol(math, ams, rel, "↫", "\\looparrowleft", true); - defineSymbol(math, ams, rel, "⇋", "\\leftrightharpoons", true); - defineSymbol(math, ams, rel, "↶", "\\curvearrowleft", true); - defineSymbol(math, ams, rel, "↺", "\\circlearrowleft", true); - defineSymbol(math, ams, rel, "↰", "\\Lsh", true); - defineSymbol(math, ams, rel, "⇈", "\\upuparrows", true); - defineSymbol(math, ams, rel, "↿", "\\upharpoonleft", true); - defineSymbol(math, ams, rel, "⇃", "\\downharpoonleft", true); - defineSymbol(math, main, rel, "⊶", "\\origof", true); - defineSymbol(math, main, rel, "⊷", "\\imageof", true); - defineSymbol(math, ams, rel, "⊸", "\\multimap", true); - defineSymbol(math, ams, rel, "↭", "\\leftrightsquigarrow", true); - defineSymbol(math, ams, rel, "⇉", "\\rightrightarrows", true); - defineSymbol(math, ams, rel, "⇄", "\\rightleftarrows", true); - defineSymbol(math, ams, rel, "↠", "\\twoheadrightarrow", true); - defineSymbol(math, ams, rel, "↣", "\\rightarrowtail", true); - defineSymbol(math, ams, rel, "↬", "\\looparrowright", true); - defineSymbol(math, ams, rel, "↷", "\\curvearrowright", true); - defineSymbol(math, ams, rel, "↻", "\\circlearrowright", true); - defineSymbol(math, ams, rel, "↱", "\\Rsh", true); - defineSymbol(math, ams, rel, "⇊", "\\downdownarrows", true); - defineSymbol(math, ams, rel, "↾", "\\upharpoonright", true); - defineSymbol(math, ams, rel, "⇂", "\\downharpoonright", true); - defineSymbol(math, ams, rel, "⇝", "\\rightsquigarrow", true); - defineSymbol(math, ams, rel, "⇝", "\\leadsto"); - defineSymbol(math, ams, rel, "⇛", "\\Rrightarrow", true); - defineSymbol(math, ams, rel, "↾", "\\restriction"); - defineSymbol(math, main, textord, "‘", "`"); - defineSymbol(math, main, textord, "$", "\\$"); - defineSymbol(text$2, main, textord, "$", "\\$"); - defineSymbol(text$2, main, textord, "$", "\\textdollar"); - defineSymbol(math, main, textord, "%", "\\%"); - defineSymbol(text$2, main, textord, "%", "\\%"); - defineSymbol(math, main, textord, "_", "\\_"); - defineSymbol(text$2, main, textord, "_", "\\_"); - defineSymbol(text$2, main, textord, "_", "\\textunderscore"); - defineSymbol(math, main, textord, "∠", "\\angle", true); - defineSymbol(math, main, textord, "∞", "\\infty", true); - defineSymbol(math, main, textord, "′", "\\prime"); - defineSymbol(math, main, textord, "△", "\\triangle"); - defineSymbol(math, main, textord, "Γ", "\\Gamma", true); - defineSymbol(math, main, textord, "Δ", "\\Delta", true); - defineSymbol(math, main, textord, "Θ", "\\Theta", true); - defineSymbol(math, main, textord, "Λ", "\\Lambda", true); - defineSymbol(math, main, textord, "Ξ", "\\Xi", true); - defineSymbol(math, main, textord, "Π", "\\Pi", true); - defineSymbol(math, main, textord, "Σ", "\\Sigma", true); - defineSymbol(math, main, textord, "Υ", "\\Upsilon", true); - defineSymbol(math, main, textord, "Φ", "\\Phi", true); - defineSymbol(math, main, textord, "Ψ", "\\Psi", true); - defineSymbol(math, main, textord, "Ω", "\\Omega", true); - defineSymbol(math, main, textord, "A", "Α"); - defineSymbol(math, main, textord, "B", "Β"); - defineSymbol(math, main, textord, "E", "Ε"); - defineSymbol(math, main, textord, "Z", "Ζ"); - defineSymbol(math, main, textord, "H", "Η"); - defineSymbol(math, main, textord, "I", "Ι"); - defineSymbol(math, main, textord, "K", "Κ"); - defineSymbol(math, main, textord, "M", "Μ"); - defineSymbol(math, main, textord, "N", "Ν"); - defineSymbol(math, main, textord, "O", "Ο"); - defineSymbol(math, main, textord, "P", "Ρ"); - defineSymbol(math, main, textord, "T", "Τ"); - defineSymbol(math, main, textord, "X", "Χ"); - defineSymbol(math, main, textord, "¬", "\\neg", true); - defineSymbol(math, main, textord, "¬", "\\lnot"); - defineSymbol(math, main, textord, "⊤", "\\top"); - defineSymbol(math, main, textord, "⊥", "\\bot"); - defineSymbol(math, main, textord, "∅", "\\emptyset"); - defineSymbol(math, ams, textord, "∅", "\\varnothing"); - defineSymbol(math, main, mathord, "α", "\\alpha", true); - defineSymbol(math, main, mathord, "β", "\\beta", true); - defineSymbol(math, main, mathord, "γ", "\\gamma", true); - defineSymbol(math, main, mathord, "δ", "\\delta", true); - defineSymbol(math, main, mathord, "ϵ", "\\epsilon", true); - defineSymbol(math, main, mathord, "ζ", "\\zeta", true); - defineSymbol(math, main, mathord, "η", "\\eta", true); - defineSymbol(math, main, mathord, "θ", "\\theta", true); - defineSymbol(math, main, mathord, "ι", "\\iota", true); - defineSymbol(math, main, mathord, "κ", "\\kappa", true); - defineSymbol(math, main, mathord, "λ", "\\lambda", true); - defineSymbol(math, main, mathord, "μ", "\\mu", true); - defineSymbol(math, main, mathord, "ν", "\\nu", true); - defineSymbol(math, main, mathord, "ξ", "\\xi", true); - defineSymbol(math, main, mathord, "ο", "\\omicron", true); - defineSymbol(math, main, mathord, "π", "\\pi", true); - defineSymbol(math, main, mathord, "ρ", "\\rho", true); - defineSymbol(math, main, mathord, "σ", "\\sigma", true); - defineSymbol(math, main, mathord, "τ", "\\tau", true); - defineSymbol(math, main, mathord, "υ", "\\upsilon", true); - defineSymbol(math, main, mathord, "ϕ", "\\phi", true); - defineSymbol(math, main, mathord, "χ", "\\chi", true); - defineSymbol(math, main, mathord, "ψ", "\\psi", true); - defineSymbol(math, main, mathord, "ω", "\\omega", true); - defineSymbol(math, main, mathord, "ε", "\\varepsilon", true); - defineSymbol(math, main, mathord, "ϑ", "\\vartheta", true); - defineSymbol(math, main, mathord, "ϖ", "\\varpi", true); - defineSymbol(math, main, mathord, "ϱ", "\\varrho", true); - defineSymbol(math, main, mathord, "ς", "\\varsigma", true); - defineSymbol(math, main, mathord, "φ", "\\varphi", true); - defineSymbol(math, main, bin, "∗", "*", true); - defineSymbol(math, main, bin, "+", "+"); - defineSymbol(math, main, bin, "−", "-", true); - defineSymbol(math, main, bin, "⋅", "\\cdot", true); - defineSymbol(math, main, bin, "∘", "\\circ", true); - defineSymbol(math, main, bin, "÷", "\\div", true); - defineSymbol(math, main, bin, "±", "\\pm", true); - defineSymbol(math, main, bin, "×", "\\times", true); - defineSymbol(math, main, bin, "∩", "\\cap", true); - defineSymbol(math, main, bin, "∪", "\\cup", true); - defineSymbol(math, main, bin, "∖", "\\setminus", true); - defineSymbol(math, main, bin, "∧", "\\land"); - defineSymbol(math, main, bin, "∨", "\\lor"); - defineSymbol(math, main, bin, "∧", "\\wedge", true); - defineSymbol(math, main, bin, "∨", "\\vee", true); - defineSymbol(math, main, textord, "√", "\\surd"); - defineSymbol(math, main, open, "⟨", "\\langle", true); - defineSymbol(math, main, open, "∣", "\\lvert"); - defineSymbol(math, main, open, "∥", "\\lVert"); - defineSymbol(math, main, close, "?", "?"); - defineSymbol(math, main, close, "!", "!"); - defineSymbol(math, main, close, "⟩", "\\rangle", true); - defineSymbol(math, main, close, "∣", "\\rvert"); - defineSymbol(math, main, close, "∥", "\\rVert"); - defineSymbol(math, main, rel, "=", "="); - defineSymbol(math, main, rel, ":", ":"); - defineSymbol(math, main, rel, "≈", "\\approx", true); - defineSymbol(math, main, rel, "≅", "\\cong", true); - defineSymbol(math, main, rel, "≥", "\\ge"); - defineSymbol(math, main, rel, "≥", "\\geq", true); - defineSymbol(math, main, rel, "←", "\\gets"); - defineSymbol(math, main, rel, ">", "\\gt", true); - defineSymbol(math, main, rel, "∈", "\\in", true); - defineSymbol(math, main, rel, "", "\\@not"); - defineSymbol(math, main, rel, "⊂", "\\subset", true); - defineSymbol(math, main, rel, "⊃", "\\supset", true); - defineSymbol(math, main, rel, "⊆", "\\subseteq", true); - defineSymbol(math, main, rel, "⊇", "\\supseteq", true); - defineSymbol(math, ams, rel, "⊈", "\\nsubseteq", true); - defineSymbol(math, ams, rel, "⊉", "\\nsupseteq", true); - defineSymbol(math, main, rel, "⊨", "\\models"); - defineSymbol(math, main, rel, "←", "\\leftarrow", true); - defineSymbol(math, main, rel, "≤", "\\le"); - defineSymbol(math, main, rel, "≤", "\\leq", true); - defineSymbol(math, main, rel, "<", "\\lt", true); - defineSymbol(math, main, rel, "→", "\\rightarrow", true); - defineSymbol(math, main, rel, "→", "\\to"); - defineSymbol(math, ams, rel, "≱", "\\ngeq", true); - defineSymbol(math, ams, rel, "≰", "\\nleq", true); - defineSymbol(math, main, spacing, " ", "\\ "); - defineSymbol(math, main, spacing, " ", "\\space"); - defineSymbol(math, main, spacing, " ", "\\nobreakspace"); - defineSymbol(text$2, main, spacing, " ", "\\ "); - defineSymbol(text$2, main, spacing, " ", " "); - defineSymbol(text$2, main, spacing, " ", "\\space"); - defineSymbol(text$2, main, spacing, " ", "\\nobreakspace"); - defineSymbol(math, main, spacing, null, "\\nobreak"); - defineSymbol(math, main, spacing, null, "\\allowbreak"); - defineSymbol(math, main, punct, ",", ","); - defineSymbol(math, main, punct, ";", ";"); - defineSymbol(math, ams, bin, "⊼", "\\barwedge", true); - defineSymbol(math, ams, bin, "⊻", "\\veebar", true); - defineSymbol(math, main, bin, "⊙", "\\odot", true); - defineSymbol(math, main, bin, "⊕", "\\oplus", true); - defineSymbol(math, main, bin, "⊗", "\\otimes", true); - defineSymbol(math, main, textord, "∂", "\\partial", true); - defineSymbol(math, main, bin, "⊘", "\\oslash", true); - defineSymbol(math, ams, bin, "⊚", "\\circledcirc", true); - defineSymbol(math, ams, bin, "⊡", "\\boxdot", true); - defineSymbol(math, main, bin, "△", "\\bigtriangleup"); - defineSymbol(math, main, bin, "▽", "\\bigtriangledown"); - defineSymbol(math, main, bin, "†", "\\dagger"); - defineSymbol(math, main, bin, "⋄", "\\diamond"); - defineSymbol(math, main, bin, "⋆", "\\star"); - defineSymbol(math, main, bin, "◃", "\\triangleleft"); - defineSymbol(math, main, bin, "▹", "\\triangleright"); - defineSymbol(math, main, open, "{", "\\{"); - defineSymbol(text$2, main, textord, "{", "\\{"); - defineSymbol(text$2, main, textord, "{", "\\textbraceleft"); - defineSymbol(math, main, close, "}", "\\}"); - defineSymbol(text$2, main, textord, "}", "\\}"); - defineSymbol(text$2, main, textord, "}", "\\textbraceright"); - defineSymbol(math, main, open, "{", "\\lbrace"); - defineSymbol(math, main, close, "}", "\\rbrace"); - defineSymbol(math, main, open, "[", "\\lbrack", true); - defineSymbol(text$2, main, textord, "[", "\\lbrack", true); - defineSymbol(math, main, close, "]", "\\rbrack", true); - defineSymbol(text$2, main, textord, "]", "\\rbrack", true); - defineSymbol(math, main, open, "(", "\\lparen", true); - defineSymbol(math, main, close, ")", "\\rparen", true); - defineSymbol(text$2, main, textord, "<", "\\textless", true); - defineSymbol(text$2, main, textord, ">", "\\textgreater", true); - defineSymbol(math, main, open, "⌊", "\\lfloor", true); - defineSymbol(math, main, close, "⌋", "\\rfloor", true); - defineSymbol(math, main, open, "⌈", "\\lceil", true); - defineSymbol(math, main, close, "⌉", "\\rceil", true); - defineSymbol(math, main, textord, "\\", "\\backslash"); - defineSymbol(math, main, textord, "∣", "|"); - defineSymbol(math, main, textord, "∣", "\\vert"); - defineSymbol(text$2, main, textord, "|", "\\textbar", true); - defineSymbol(math, main, textord, "∥", "\\|"); - defineSymbol(math, main, textord, "∥", "\\Vert"); - defineSymbol(text$2, main, textord, "∥", "\\textbardbl"); - defineSymbol(text$2, main, textord, "~", "\\textasciitilde"); - defineSymbol(text$2, main, textord, "\\", "\\textbackslash"); - defineSymbol(text$2, main, textord, "^", "\\textasciicircum"); - defineSymbol(math, main, rel, "↑", "\\uparrow", true); - defineSymbol(math, main, rel, "⇑", "\\Uparrow", true); - defineSymbol(math, main, rel, "↓", "\\downarrow", true); - defineSymbol(math, main, rel, "⇓", "\\Downarrow", true); - defineSymbol(math, main, rel, "↕", "\\updownarrow", true); - defineSymbol(math, main, rel, "⇕", "\\Updownarrow", true); - defineSymbol(math, main, op, "∐", "\\coprod"); - defineSymbol(math, main, op, "⋁", "\\bigvee"); - defineSymbol(math, main, op, "⋀", "\\bigwedge"); - defineSymbol(math, main, op, "⨄", "\\biguplus"); - defineSymbol(math, main, op, "⋂", "\\bigcap"); - defineSymbol(math, main, op, "⋃", "\\bigcup"); - defineSymbol(math, main, op, "∫", "\\int"); - defineSymbol(math, main, op, "∫", "\\intop"); - defineSymbol(math, main, op, "∬", "\\iint"); - defineSymbol(math, main, op, "∭", "\\iiint"); - defineSymbol(math, main, op, "∏", "\\prod"); - defineSymbol(math, main, op, "∑", "\\sum"); - defineSymbol(math, main, op, "⨂", "\\bigotimes"); - defineSymbol(math, main, op, "⨁", "\\bigoplus"); - defineSymbol(math, main, op, "⨀", "\\bigodot"); - defineSymbol(math, main, op, "∮", "\\oint"); - defineSymbol(math, main, op, "∯", "\\oiint"); - defineSymbol(math, main, op, "∰", "\\oiiint"); - defineSymbol(math, main, op, "⨆", "\\bigsqcup"); - defineSymbol(math, main, op, "∫", "\\smallint"); - defineSymbol(text$2, main, inner, "…", "\\textellipsis"); - defineSymbol(math, main, inner, "…", "\\mathellipsis"); - defineSymbol(text$2, main, inner, "…", "\\ldots", true); - defineSymbol(math, main, inner, "…", "\\ldots", true); - defineSymbol(math, main, inner, "⋯", "\\@cdots", true); - defineSymbol(math, main, inner, "⋱", "\\ddots", true); - defineSymbol(math, main, textord, "⋮", "\\varvdots"); - defineSymbol(math, main, accent, "ˊ", "\\acute"); - defineSymbol(math, main, accent, "ˋ", "\\grave"); - defineSymbol(math, main, accent, "¨", "\\ddot"); - defineSymbol(math, main, accent, "~", "\\tilde"); - defineSymbol(math, main, accent, "ˉ", "\\bar"); - defineSymbol(math, main, accent, "˘", "\\breve"); - defineSymbol(math, main, accent, "ˇ", "\\check"); - defineSymbol(math, main, accent, "^", "\\hat"); - defineSymbol(math, main, accent, "⃗", "\\vec"); - defineSymbol(math, main, accent, "˙", "\\dot"); - defineSymbol(math, main, accent, "˚", "\\mathring"); - defineSymbol(math, main, mathord, "", "\\@imath"); - defineSymbol(math, main, mathord, "", "\\@jmath"); - defineSymbol(math, main, textord, "ı", "ı"); - defineSymbol(math, main, textord, "ȷ", "ȷ"); - defineSymbol(text$2, main, textord, "ı", "\\i", true); - defineSymbol(text$2, main, textord, "ȷ", "\\j", true); - defineSymbol(text$2, main, textord, "ß", "\\ss", true); - defineSymbol(text$2, main, textord, "æ", "\\ae", true); - defineSymbol(text$2, main, textord, "œ", "\\oe", true); - defineSymbol(text$2, main, textord, "ø", "\\o", true); - defineSymbol(text$2, main, textord, "Æ", "\\AE", true); - defineSymbol(text$2, main, textord, "Œ", "\\OE", true); - defineSymbol(text$2, main, textord, "Ø", "\\O", true); - defineSymbol(text$2, main, accent, "ˊ", "\\'"); - defineSymbol(text$2, main, accent, "ˋ", "\\`"); - defineSymbol(text$2, main, accent, "ˆ", "\\^"); - defineSymbol(text$2, main, accent, "˜", "\\~"); - defineSymbol(text$2, main, accent, "ˉ", "\\="); - defineSymbol(text$2, main, accent, "˘", "\\u"); - defineSymbol(text$2, main, accent, "˙", "\\."); - defineSymbol(text$2, main, accent, "¸", "\\c"); - defineSymbol(text$2, main, accent, "˚", "\\r"); - defineSymbol(text$2, main, accent, "ˇ", "\\v"); - defineSymbol(text$2, main, accent, "¨", '\\"'); - defineSymbol(text$2, main, accent, "˝", "\\H"); - defineSymbol(text$2, main, accent, "◯", "\\textcircled"); - var ligatures = { - "--": true, - "---": true, - "``": true, - "''": true - }; - defineSymbol(text$2, main, textord, "–", "--", true); - defineSymbol(text$2, main, textord, "–", "\\textendash"); - defineSymbol(text$2, main, textord, "—", "---", true); - defineSymbol(text$2, main, textord, "—", "\\textemdash"); - defineSymbol(text$2, main, textord, "‘", "`", true); - defineSymbol(text$2, main, textord, "‘", "\\textquoteleft"); - defineSymbol(text$2, main, textord, "’", "'", true); - defineSymbol(text$2, main, textord, "’", "\\textquoteright"); - defineSymbol(text$2, main, textord, "“", "``", true); - defineSymbol(text$2, main, textord, "“", "\\textquotedblleft"); - defineSymbol(text$2, main, textord, "”", "''", true); - defineSymbol(text$2, main, textord, "”", "\\textquotedblright"); - defineSymbol(math, main, textord, "°", "\\degree", true); - defineSymbol(text$2, main, textord, "°", "\\degree"); - defineSymbol(text$2, main, textord, "°", "\\textdegree", true); - defineSymbol(math, main, textord, "£", "\\pounds"); - defineSymbol(math, main, textord, "£", "\\mathsterling", true); - defineSymbol(text$2, main, textord, "£", "\\pounds"); - defineSymbol(text$2, main, textord, "£", "\\textsterling", true); - defineSymbol(math, ams, textord, "✠", "\\maltese"); - defineSymbol(text$2, ams, textord, "✠", "\\maltese"); - var mathTextSymbols = '0123456789/@."'; - for (var i = 0; i < mathTextSymbols.length; i++) { - var ch = mathTextSymbols.charAt(i); - defineSymbol(math, main, textord, ch, ch); - } - var textSymbols = '0123456789!@*()-=+";:?/.,'; - for (var _i = 0; _i < textSymbols.length; _i++) { - var _ch = textSymbols.charAt(_i); - defineSymbol(text$2, main, textord, _ch, _ch); - } - var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - for (var _i2 = 0; _i2 < letters.length; _i2++) { - var _ch2 = letters.charAt(_i2); - defineSymbol(math, main, mathord, _ch2, _ch2); - defineSymbol(text$2, main, textord, _ch2, _ch2); - } - defineSymbol(math, ams, textord, "C", "ℂ"); - defineSymbol(text$2, ams, textord, "C", "ℂ"); - defineSymbol(math, ams, textord, "H", "ℍ"); - defineSymbol(text$2, ams, textord, "H", "ℍ"); - defineSymbol(math, ams, textord, "N", "ℕ"); - defineSymbol(text$2, ams, textord, "N", "ℕ"); - defineSymbol(math, ams, textord, "P", "ℙ"); - defineSymbol(text$2, ams, textord, "P", "ℙ"); - defineSymbol(math, ams, textord, "Q", "ℚ"); - defineSymbol(text$2, ams, textord, "Q", "ℚ"); - defineSymbol(math, ams, textord, "R", "ℝ"); - defineSymbol(text$2, ams, textord, "R", "ℝ"); - defineSymbol(math, ams, textord, "Z", "ℤ"); - defineSymbol(text$2, ams, textord, "Z", "ℤ"); - defineSymbol(math, main, mathord, "h", "ℎ"); - defineSymbol(text$2, main, mathord, "h", "ℎ"); - var wideChar = ""; - for (var _i3 = 0; _i3 < letters.length; _i3++) { - var _ch3 = letters.charAt(_i3); - wideChar = String.fromCharCode(55349, 56320 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56372 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56424 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56580 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56684 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56736 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56788 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56840 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56944 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - if (_i3 < 26) { - wideChar = String.fromCharCode(55349, 56632 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - wideChar = String.fromCharCode(55349, 56476 + _i3); - defineSymbol(math, main, mathord, _ch3, wideChar); - defineSymbol(text$2, main, textord, _ch3, wideChar); - } - } - wideChar = String.fromCharCode(55349, 56668); - defineSymbol(math, main, mathord, "k", wideChar); - defineSymbol(text$2, main, textord, "k", wideChar); - for (var _i4 = 0; _i4 < 10; _i4++) { - var _ch4 = _i4.toString(); - wideChar = String.fromCharCode(55349, 57294 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(55349, 57314 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(55349, 57324 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - wideChar = String.fromCharCode(55349, 57334 + _i4); - defineSymbol(math, main, mathord, _ch4, wideChar); - defineSymbol(text$2, main, textord, _ch4, wideChar); - } - var extraLatin = "ÐÞþ"; - for (var _i5 = 0; _i5 < extraLatin.length; _i5++) { - var _ch5 = extraLatin.charAt(_i5); - defineSymbol(math, main, mathord, _ch5, _ch5); - defineSymbol(text$2, main, textord, _ch5, _ch5); - } - var wideLatinLetterData = [ - ["mathbf", "textbf", "Main-Bold"], - // A-Z bold upright - ["mathbf", "textbf", "Main-Bold"], - // a-z bold upright - ["mathnormal", "textit", "Math-Italic"], - // A-Z italic - ["mathnormal", "textit", "Math-Italic"], - // a-z italic - ["boldsymbol", "boldsymbol", "Main-BoldItalic"], - // A-Z bold italic - ["boldsymbol", "boldsymbol", "Main-BoldItalic"], - // a-z bold italic - // Map fancy A-Z letters to script, not calligraphic. - // This aligns with unicode-math and math fonts (except Cambria Math). - ["mathscr", "textscr", "Script-Regular"], - // A-Z script - ["", "", ""], - // a-z script. No font - ["", "", ""], - // A-Z bold script. No font - ["", "", ""], - // a-z bold script. No font - ["mathfrak", "textfrak", "Fraktur-Regular"], - // A-Z Fraktur - ["mathfrak", "textfrak", "Fraktur-Regular"], - // a-z Fraktur - ["mathbb", "textbb", "AMS-Regular"], - // A-Z double-struck - ["mathbb", "textbb", "AMS-Regular"], - // k double-struck - // Note that we are using a bold font, but font metrics for regular Fraktur. - ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], - // A-Z bold Fraktur - ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], - // a-z bold Fraktur - ["mathsf", "textsf", "SansSerif-Regular"], - // A-Z sans-serif - ["mathsf", "textsf", "SansSerif-Regular"], - // a-z sans-serif - ["mathboldsf", "textboldsf", "SansSerif-Bold"], - // A-Z bold sans-serif - ["mathboldsf", "textboldsf", "SansSerif-Bold"], - // a-z bold sans-serif - ["mathitsf", "textitsf", "SansSerif-Italic"], - // A-Z italic sans-serif - ["mathitsf", "textitsf", "SansSerif-Italic"], - // a-z italic sans-serif - ["", "", ""], - // A-Z bold italic sans. No font - ["", "", ""], - // a-z bold italic sans. No font - ["mathtt", "texttt", "Typewriter-Regular"], - // A-Z monospace - ["mathtt", "texttt", "Typewriter-Regular"] - // a-z monospace - ]; - var wideNumeralData = [ - ["mathbf", "textbf", "Main-Bold"], - // 0-9 bold - ["", "", ""], - // 0-9 double-struck. No KaTeX font. - ["mathsf", "textsf", "SansSerif-Regular"], - // 0-9 sans-serif - ["mathboldsf", "textboldsf", "SansSerif-Bold"], - // 0-9 bold sans-serif - ["mathtt", "texttt", "Typewriter-Regular"] - // 0-9 monospace - ]; - var wideCharacterFont = function wideCharacterFont2(wideChar2, mode) { - var H = wideChar2.charCodeAt(0); - var L = wideChar2.charCodeAt(1); - var codePoint = (H - 55296) * 1024 + (L - 56320) + 65536; - var j = mode === "math" ? 0 : 1; - if (119808 <= codePoint && codePoint < 120484) { - var i2 = Math.floor((codePoint - 119808) / 26); - return [wideLatinLetterData[i2][2], wideLatinLetterData[i2][j]]; - } else if (120782 <= codePoint && codePoint <= 120831) { - var _i6 = Math.floor((codePoint - 120782) / 10); - return [wideNumeralData[_i6][2], wideNumeralData[_i6][j]]; - } else if (codePoint === 120485 || codePoint === 120486) { - return [wideLatinLetterData[0][2], wideLatinLetterData[0][j]]; - } else if (120486 < codePoint && codePoint < 120782) { - return ["", ""]; - } else { - throw new ParseError("Unsupported character: " + wideChar2); + var init_precisionPrefix = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionPrefix.js"() { + "use strict"; + init_exponent(); + __name(precisionPrefix_default, "default"); } - }; - var lookupSymbol = function lookupSymbol2(value2, fontName, mode) { - if (symbols[mode][value2] && symbols[mode][value2].replace) { - value2 = symbols[mode][value2].replace; + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionRound.js + function precisionRound_default(step3, max10) { + step3 = Math.abs(step3), max10 = Math.abs(max10) - step3; + return Math.max(0, exponent_default(max10) - exponent_default(step3)) + 1; + } + var init_precisionRound = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/precisionRound.js"() { + "use strict"; + init_exponent(); + __name(precisionRound_default, "default"); } - return { - value: value2, - metrics: getCharacterMetrics(value2, fontName, mode) - }; - }; - var makeSymbol = function makeSymbol2(value2, fontName, mode, options2, classes2) { - var lookup = lookupSymbol(value2, fontName, mode); - var metrics = lookup.metrics; - value2 = lookup.value; - var symbolNode; - if (metrics) { - var italic = metrics.italic; - if (mode === "text" || options2 && options2.font === "mathit") { - italic = 0; - } - symbolNode = new SymbolNode(value2, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes2); - } else { - typeof console !== "undefined" && console.warn("No character metrics " + ("for '" + value2 + "' in style '" + fontName + "' and mode '" + mode + "'")); - symbolNode = new SymbolNode(value2, 0, 0, 0, 0, 0, classes2); + }); + + // ../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/index.js + var init_src21 = __esm({ + "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/index.js"() { + "use strict"; + init_defaultLocale(); + init_formatSpecifier(); + init_precisionFixed(); + init_precisionPrefix(); + init_precisionRound(); } - if (options2) { - symbolNode.maxFontSize = options2.sizeMultiplier; - if (options2.style.isTight()) { - symbolNode.classes.push("mtight"); - } - var color2 = options2.getColor(); - if (color2) { - symbolNode.style.color = color2; - } + }); + + // ../../node_modules/.pnpm/d3-geo@3.1.1/node_modules/d3-geo/src/index.js + var init_src22 = __esm({ + "../../node_modules/.pnpm/d3-geo@3.1.1/node_modules/d3-geo/src/index.js"() { + "use strict"; } - return symbolNode; - }; - var mathsym = function mathsym2(value2, mode, options2, classes2) { - if (classes2 === void 0) { - classes2 = []; - } - if (options2.font === "boldsymbol" && lookupSymbol(value2, "Main-Bold", mode).metrics) { - return makeSymbol(value2, "Main-Bold", mode, options2, classes2.concat(["mathbf"])); - } else if (value2 === "\\" || symbols[mode][value2].font === "main") { - return makeSymbol(value2, "Main-Regular", mode, options2, classes2); - } else { - return makeSymbol(value2, "AMS-Regular", mode, options2, classes2.concat(["amsrm"])); + }); + + // ../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/index.js + var init_src23 = __esm({ + "../../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/index.js"() { + "use strict"; } - }; - var boldsymbol = function boldsymbol2(value2, mode, options2, classes2, type2) { - if (type2 !== "textord" && lookupSymbol(value2, "Math-BoldItalic", mode).metrics) { - return { - fontName: "Math-BoldItalic", - fontClass: "boldsymbol" - }; - } else { - return { - fontName: "Main-Bold", - fontClass: "mathbf" - }; + }); + + // ../../node_modules/.pnpm/d3-polygon@3.0.1/node_modules/d3-polygon/src/index.js + var init_src24 = __esm({ + "../../node_modules/.pnpm/d3-polygon@3.0.1/node_modules/d3-polygon/src/index.js"() { + "use strict"; } - }; - var makeOrd = function makeOrd2(group, options2, type2) { - var mode = group.mode; - var text2 = group.text; - var classes2 = ["mord"]; - var isFont = mode === "math" || mode === "text" && options2.font; - var fontOrFamily = isFont ? options2.font : options2.fontFamily; - var wideFontName = ""; - var wideFontClass = ""; - if (text2.charCodeAt(0) === 55349) { - [wideFontName, wideFontClass] = wideCharacterFont(text2, mode); - } - if (wideFontName.length > 0) { - return makeSymbol(text2, wideFontName, mode, options2, classes2.concat(wideFontClass)); - } else if (fontOrFamily) { - var fontName; - var fontClasses; - if (fontOrFamily === "boldsymbol") { - var fontData = boldsymbol(text2, mode, options2, classes2, type2); - fontName = fontData.fontName; - fontClasses = [fontData.fontClass]; - } else if (isFont) { - fontName = fontMap[fontOrFamily].fontName; - fontClasses = [fontOrFamily]; - } else { - fontName = retrieveTextFontName(fontOrFamily, options2.fontWeight, options2.fontShape); - fontClasses = [fontOrFamily, options2.fontWeight, options2.fontShape]; - } - if (lookupSymbol(text2, fontName, mode).metrics) { - return makeSymbol(text2, fontName, mode, options2, classes2.concat(fontClasses)); - } else if (ligatures.hasOwnProperty(text2) && fontName.slice(0, 10) === "Typewriter") { - var parts = []; - for (var i2 = 0; i2 < text2.length; i2++) { - parts.push(makeSymbol(text2[i2], fontName, mode, options2, classes2.concat(fontClasses))); - } - return makeFragment(parts); - } - } - if (type2 === "mathord") { - return makeSymbol(text2, "Math-Italic", mode, options2, classes2.concat(["mathnormal"])); - } else if (type2 === "textord") { - var font = symbols[mode][text2] && symbols[mode][text2].font; - if (font === "ams") { - var _fontName = retrieveTextFontName("amsrm", options2.fontWeight, options2.fontShape); - return makeSymbol(text2, _fontName, mode, options2, classes2.concat("amsrm", options2.fontWeight, options2.fontShape)); - } else if (font === "main" || !font) { - var _fontName2 = retrieveTextFontName("textrm", options2.fontWeight, options2.fontShape); - return makeSymbol(text2, _fontName2, mode, options2, classes2.concat(options2.fontWeight, options2.fontShape)); - } else { - var _fontName3 = retrieveTextFontName(font, options2.fontWeight, options2.fontShape); - return makeSymbol(text2, _fontName3, mode, options2, classes2.concat(_fontName3, options2.fontWeight, options2.fontShape)); - } - } else { - throw new Error("unexpected type: " + type2 + " in makeOrd"); + }); + + // ../../node_modules/.pnpm/d3-random@3.0.1/node_modules/d3-random/src/index.js + var init_src25 = __esm({ + "../../node_modules/.pnpm/d3-random@3.0.1/node_modules/d3-random/src/index.js"() { + "use strict"; } - }; - var canCombine = (prev2, next2) => { - if (createClass(prev2.classes) !== createClass(next2.classes) || prev2.skew !== next2.skew || prev2.maxFontSize !== next2.maxFontSize) { - return false; + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js + function initRange(domain, range3) { + switch (arguments.length) { + case 0: + break; + case 1: + this.range(domain); + break; + default: + this.range(range3).domain(domain); + break; } - if (prev2.classes.length === 1) { - var cls = prev2.classes[0]; - if (cls === "mbin" || cls === "mord") { - return false; - } + return this; + } + var init_init = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js"() { + "use strict"; + __name(initRange, "initRange"); } - for (var style in prev2.style) { - if (prev2.style.hasOwnProperty(style) && prev2.style[style] !== next2.style[style]) { - return false; + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js + function ordinal() { + var index = new InternMap(), domain = [], range3 = [], unknown = implicit; + function scale(d2) { + let i2 = index.get(d2); + if (i2 === void 0) { + if (unknown !== implicit) return unknown; + index.set(d2, i2 = domain.push(d2) - 1); } + return range3[i2 % range3.length]; } - for (var _style in next2.style) { - if (next2.style.hasOwnProperty(_style) && prev2.style[_style] !== next2.style[_style]) { - return false; + __name(scale, "scale"); + scale.domain = function(_2) { + if (!arguments.length) return domain.slice(); + domain = [], index = new InternMap(); + for (const value2 of _2) { + if (index.has(value2)) continue; + index.set(value2, domain.push(value2) - 1); } + return scale; + }; + scale.range = function(_2) { + return arguments.length ? (range3 = Array.from(_2), scale) : range3.slice(); + }; + scale.unknown = function(_2) { + return arguments.length ? (unknown = _2, scale) : unknown; + }; + scale.copy = function() { + return ordinal(domain, range3).unknown(unknown); + }; + initRange.apply(scale, arguments); + return scale; + } + var implicit; + var init_ordinal = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js"() { + "use strict"; + init_src2(); + init_init(); + implicit = Symbol("implicit"); + __name(ordinal, "ordinal"); } - return true; - }; - var tryCombineChars = (chars) => { - for (var i2 = 0; i2 < chars.length - 1; i2++) { - var prev2 = chars[i2]; - var next2 = chars[i2 + 1]; - if (prev2 instanceof SymbolNode && next2 instanceof SymbolNode && canCombine(prev2, next2)) { - prev2.text += next2.text; - prev2.height = Math.max(prev2.height, next2.height); - prev2.depth = Math.max(prev2.depth, next2.depth); - prev2.italic = next2.italic; - chars.splice(i2 + 1, 1); - i2--; - } - } - return chars; - }; - var sizeElementFromChildren = function sizeElementFromChildren2(elem) { - var height = 0; - var depth = 0; - var maxFontSize = 0; - for (var i2 = 0; i2 < elem.children.length; i2++) { - var child = elem.children[i2]; - if (child.height > height) { - height = child.height; - } - if (child.depth > depth) { - depth = child.depth; - } - if (child.maxFontSize > maxFontSize) { - maxFontSize = child.maxFontSize; - } + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js + function band() { + var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step3, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5; + delete scale.unknown; + function rescale() { + var n2 = domain().length, reverse2 = r1 < r0, start3 = reverse2 ? r1 : r0, stop5 = reverse2 ? r0 : r1; + step3 = (stop5 - start3) / Math.max(1, n2 - paddingInner + paddingOuter * 2); + if (round) step3 = Math.floor(step3); + start3 += (stop5 - start3 - step3 * (n2 - paddingInner)) * align; + bandwidth = step3 * (1 - paddingInner); + if (round) start3 = Math.round(start3), bandwidth = Math.round(bandwidth); + var values2 = range(n2).map(function(i2) { + return start3 + step3 * i2; + }); + return ordinalRange(reverse2 ? values2.reverse() : values2); } - elem.height = height; - elem.depth = depth; - elem.maxFontSize = maxFontSize; - }; - var makeSpan$2 = function makeSpan2(classes2, children2, options2, style) { - var span = new Span(classes2, children2, options2, style); - sizeElementFromChildren(span); - return span; - }; - var makeSvgSpan = (classes2, children2, options2, style) => new Span(classes2, children2, options2, style); - var makeLineSpan = function makeLineSpan2(className, options2, thickness) { - var line2 = makeSpan$2([className], [], options2); - line2.height = Math.max(thickness || options2.fontMetrics().defaultRuleThickness, options2.minRuleThickness); - line2.style.borderBottomWidth = makeEm(line2.height); - line2.maxFontSize = 1; - return line2; - }; - var makeAnchor = function makeAnchor2(href, classes2, children2, options2) { - var anchor = new Anchor(href, classes2, children2, options2); - sizeElementFromChildren(anchor); - return anchor; - }; - var makeFragment = function makeFragment2(children2) { - var fragment = new DocumentFragment(children2); - sizeElementFromChildren(fragment); - return fragment; - }; - var wrapFragment = function wrapFragment2(group, options2) { - if (group instanceof DocumentFragment) { - return makeSpan$2([], [group], options2); + __name(rescale, "rescale"); + scale.domain = function(_2) { + return arguments.length ? (domain(_2), rescale()) : domain(); + }; + scale.range = function(_2) { + return arguments.length ? ([r0, r1] = _2, r0 = +r0, r1 = +r1, rescale()) : [r0, r1]; + }; + scale.rangeRound = function(_2) { + return [r0, r1] = _2, r0 = +r0, r1 = +r1, round = true, rescale(); + }; + scale.bandwidth = function() { + return bandwidth; + }; + scale.step = function() { + return step3; + }; + scale.round = function(_2) { + return arguments.length ? (round = !!_2, rescale()) : round; + }; + scale.padding = function(_2) { + return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_2), rescale()) : paddingInner; + }; + scale.paddingInner = function(_2) { + return arguments.length ? (paddingInner = Math.min(1, _2), rescale()) : paddingInner; + }; + scale.paddingOuter = function(_2) { + return arguments.length ? (paddingOuter = +_2, rescale()) : paddingOuter; + }; + scale.align = function(_2) { + return arguments.length ? (align = Math.max(0, Math.min(1, _2)), rescale()) : align; + }; + scale.copy = function() { + return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align); + }; + return initRange.apply(rescale(), arguments); + } + var init_band = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js"() { + "use strict"; + init_src2(); + init_init(); + init_ordinal(); + __name(band, "band"); } - return group; - }; - var getVListChildrenAndDepth = function getVListChildrenAndDepth2(params) { - if (params.positionType === "individualShift") { - var oldChildren = params.children; - var children2 = [oldChildren[0]]; - var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth; - var currPos = _depth; - for (var i2 = 1; i2 < oldChildren.length; i2++) { - var diff = -oldChildren[i2].shift - currPos - oldChildren[i2].elem.depth; - var size2 = diff - (oldChildren[i2 - 1].elem.height + oldChildren[i2 - 1].elem.depth); - currPos = currPos + diff; - children2.push({ - type: "kern", - size: size2 - }); - children2.push(oldChildren[i2]); - } - return { - children: children2, - depth: _depth - }; + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js + function constants(x5) { + return function() { + return x5; + }; + } + var init_constant4 = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js"() { + "use strict"; + __name(constants, "constants"); } - var depth; - if (params.positionType === "top") { - var bottom2 = params.positionData; - for (var _i6 = 0; _i6 < params.children.length; _i6++) { - var child = params.children[_i6]; - bottom2 -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth; - } - depth = bottom2; - } else if (params.positionType === "bottom") { - depth = -params.positionData; - } else { - var firstChild = params.children[0]; - if (firstChild.type !== "elem") { - throw new Error('First child must have type "elem".'); - } - if (params.positionType === "shift") { - depth = -firstChild.elem.depth - params.positionData; - } else if (params.positionType === "firstBaseline") { - depth = -firstChild.elem.depth; - } else { - throw new Error("Invalid positionType " + params.positionType + "."); - } + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js + function number3(x5) { + return +x5; + } + var init_number3 = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js"() { + "use strict"; + __name(number3, "number"); } - return { - children: params.children, - depth + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js + function identity2(x5) { + return x5; + } + function normalize(a2, b2) { + return (b2 -= a2 = +a2) ? function(x5) { + return (x5 - a2) / b2; + } : constants(isNaN(b2) ? NaN : 0.5); + } + function clamper(a2, b2) { + var t4; + if (a2 > b2) t4 = a2, a2 = b2, b2 = t4; + return function(x5) { + return Math.max(a2, Math.min(b2, x5)); }; - }; - var makeVList = function makeVList2(params, options2) { - var { - children: children2, - depth - } = getVListChildrenAndDepth(params); - var pstrutSize = 0; - for (var i2 = 0; i2 < children2.length; i2++) { - var child = children2[i2]; - if (child.type === "elem") { - var elem = child.elem; - pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height); - } - } - pstrutSize += 2; - var pstrut = makeSpan$2(["pstrut"], []); - pstrut.style.height = makeEm(pstrutSize); - var realChildren = []; - var minPos = depth; - var maxPos2 = depth; - var currPos = depth; - for (var _i22 = 0; _i22 < children2.length; _i22++) { - var _child = children2[_i22]; - if (_child.type === "kern") { - currPos += _child.size; - } else { - var _elem = _child.elem; - var classes2 = _child.wrapperClasses || []; - var style = _child.wrapperStyle || {}; - var childWrap = makeSpan$2(classes2, [pstrut, _elem], void 0, style); - childWrap.style.top = makeEm(-pstrutSize - currPos - _elem.depth); - if (_child.marginLeft) { - childWrap.style.marginLeft = _child.marginLeft; - } - if (_child.marginRight) { - childWrap.style.marginRight = _child.marginRight; - } - realChildren.push(childWrap); - currPos += _elem.height + _elem.depth; - } - minPos = Math.min(minPos, currPos); - maxPos2 = Math.max(maxPos2, currPos); - } - var vlist = makeSpan$2(["vlist"], realChildren); - vlist.style.height = makeEm(maxPos2); - var rows; - if (minPos < 0) { - var emptySpan = makeSpan$2([], []); - var depthStrut = makeSpan$2(["vlist"], [emptySpan]); - depthStrut.style.height = makeEm(-minPos); - var topStrut = makeSpan$2(["vlist-s"], [new SymbolNode("​")]); - rows = [makeSpan$2(["vlist-r"], [vlist, topStrut]), makeSpan$2(["vlist-r"], [depthStrut])]; - } else { - rows = [makeSpan$2(["vlist-r"], [vlist])]; + } + function bimap(domain, range3, interpolate) { + var d0 = domain[0], d1 = domain[1], r0 = range3[0], r1 = range3[1]; + if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0); + else d0 = normalize(d0, d1), r0 = interpolate(r0, r1); + return function(x5) { + return r0(d0(x5)); + }; + } + function polymap(domain, range3, interpolate) { + var j2 = Math.min(domain.length, range3.length) - 1, d2 = new Array(j2), r2 = new Array(j2), i2 = -1; + if (domain[j2] < domain[0]) { + domain = domain.slice().reverse(); + range3 = range3.slice().reverse(); } - var vtable = makeSpan$2(["vlist-t"], rows); - if (rows.length === 2) { - vtable.classes.push("vlist-t2"); + while (++i2 < j2) { + d2[i2] = normalize(domain[i2], domain[i2 + 1]); + r2[i2] = interpolate(range3[i2], range3[i2 + 1]); } - vtable.height = maxPos2; - vtable.depth = -minPos; - return vtable; - }; - var makeGlue = (measurement, options2) => { - var rule = makeSpan$2(["mspace"], [], options2); - var size2 = calculateSize(measurement, options2); - rule.style.marginRight = makeEm(size2); - return rule; - }; - var retrieveTextFontName = function retrieveTextFontName2(fontFamily, fontWeight, fontShape) { - var baseFontName = ""; - switch (fontFamily) { - case "amsrm": - baseFontName = "AMS"; - break; - case "textrm": - baseFontName = "Main"; - break; - case "textsf": - baseFontName = "SansSerif"; + return function(x5) { + var i3 = bisect_default(domain, x5, 1, j2) - 1; + return r2[i3](d2[i3](x5)); + }; + } + function copy(source, target) { + return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown()); + } + function transformer() { + var domain = unit, range3 = unit, interpolate = value_default, transform8, untransform, unknown, clamp = identity2, piecewise, output2, input; + function rescale() { + var n2 = Math.min(domain.length, range3.length); + if (clamp !== identity2) clamp = clamper(domain[0], domain[n2 - 1]); + piecewise = n2 > 2 ? polymap : bimap; + output2 = input = null; + return scale; + } + __name(rescale, "rescale"); + function scale(x5) { + return x5 == null || isNaN(x5 = +x5) ? unknown : (output2 || (output2 = piecewise(domain.map(transform8), range3, interpolate)))(transform8(clamp(x5))); + } + __name(scale, "scale"); + scale.invert = function(y5) { + return clamp(untransform((input || (input = piecewise(range3, domain.map(transform8), number_default)))(y5))); + }; + scale.domain = function(_2) { + return arguments.length ? (domain = Array.from(_2, number3), rescale()) : domain.slice(); + }; + scale.range = function(_2) { + return arguments.length ? (range3 = Array.from(_2), rescale()) : range3.slice(); + }; + scale.rangeRound = function(_2) { + return range3 = Array.from(_2), interpolate = round_default, rescale(); + }; + scale.clamp = function(_2) { + return arguments.length ? (clamp = _2 ? true : identity2, rescale()) : clamp !== identity2; + }; + scale.interpolate = function(_2) { + return arguments.length ? (interpolate = _2, rescale()) : interpolate; + }; + scale.unknown = function(_2) { + return arguments.length ? (unknown = _2, scale) : unknown; + }; + return function(t4, u2) { + transform8 = t4, untransform = u2; + return rescale(); + }; + } + function continuous() { + return transformer()(identity2, identity2); + } + var unit; + var init_continuous = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js"() { + "use strict"; + init_src2(); + init_src8(); + init_constant4(); + init_number3(); + unit = [0, 1]; + __name(identity2, "identity"); + __name(normalize, "normalize"); + __name(clamper, "clamper"); + __name(bimap, "bimap"); + __name(polymap, "polymap"); + __name(copy, "copy"); + __name(transformer, "transformer"); + __name(continuous, "continuous"); + } + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/tickFormat.js + function tickFormat(start3, stop5, count, specifier) { + var step3 = tickStep(start3, stop5, count), precision; + specifier = formatSpecifier(specifier == null ? ",f" : specifier); + switch (specifier.type) { + case "s": { + var value2 = Math.max(Math.abs(start3), Math.abs(stop5)); + if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step3, value2))) specifier.precision = precision; + return formatPrefix(specifier, value2); + } + case "": + case "e": + case "g": + case "p": + case "r": { + if (specifier.precision == null && !isNaN(precision = precisionRound_default(step3, Math.max(Math.abs(start3), Math.abs(stop5))))) specifier.precision = precision - (specifier.type === "e"); break; - case "texttt": - baseFontName = "Typewriter"; + } + case "f": + case "%": { + if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step3))) specifier.precision = precision - (specifier.type === "%") * 2; break; - default: - baseFontName = fontFamily; - } - var fontStylesName; - if (fontWeight === "textbf" && fontShape === "textit") { - fontStylesName = "BoldItalic"; - } else if (fontWeight === "textbf") { - fontStylesName = "Bold"; - } else if (fontWeight === "textit") { - fontStylesName = "Italic"; - } else { - fontStylesName = "Regular"; + } } - return baseFontName + "-" + fontStylesName; - }; - var fontMap = { - // styles - "mathbf": { - variant: "bold", - fontName: "Main-Bold" - }, - "mathrm": { - variant: "normal", - fontName: "Main-Regular" - }, - "textit": { - variant: "italic", - fontName: "Main-Italic" - }, - "mathit": { - variant: "italic", - fontName: "Main-Italic" - }, - "mathnormal": { - variant: "italic", - fontName: "Math-Italic" - }, - // "boldsymbol" is missing because they require the use of multiple fonts: - // Math-BoldItalic and Main-Bold. This is handled by a special case in - // makeOrd which ends up calling boldsymbol. - // families - "mathbb": { - variant: "double-struck", - fontName: "AMS-Regular" - }, - "mathcal": { - variant: "script", - fontName: "Caligraphic-Regular" - }, - "mathfrak": { - variant: "fraktur", - fontName: "Fraktur-Regular" - }, - "mathscr": { - variant: "script", - fontName: "Script-Regular" - }, - "mathsf": { - variant: "sans-serif", - fontName: "SansSerif-Regular" - }, - "mathtt": { - variant: "monospace", - fontName: "Typewriter-Regular" + return format2(specifier); + } + var init_tickFormat = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/tickFormat.js"() { + "use strict"; + init_src2(); + init_src21(); + __name(tickFormat, "tickFormat"); } - }; - var svgData = { - // path, width, height - vec: ["vec", 0.471, 0.714], - // values from the font glyph - oiintSize1: ["oiintSize1", 0.957, 0.499], - // oval to overlay the integrand - oiintSize2: ["oiintSize2", 1.472, 0.659], - oiiintSize1: ["oiiintSize1", 1.304, 0.499], - oiiintSize2: ["oiiintSize2", 1.98, 0.659] - }; - var staticSvg = function staticSvg2(value2, options2) { - var [pathName, width2, height] = svgData[value2]; - var path2 = new PathNode(pathName); - var svgNode2 = new SvgNode([path2], { - "width": makeEm(width2), - "height": makeEm(height), - // Override CSS rule `.katex svg { width: 100% }` - "style": "width:" + makeEm(width2), - "viewBox": "0 0 " + 1e3 * width2 + " " + 1e3 * height, - "preserveAspectRatio": "xMinYMin" - }); - var span = makeSvgSpan(["overlay"], [svgNode2], options2); - span.height = height; - span.style.height = makeEm(height); - span.style.width = makeEm(width2); - return span; - }; - var buildCommon = { - fontMap, - makeSymbol, - mathsym, - makeSpan: makeSpan$2, - makeSvgSpan, - makeLineSpan, - makeAnchor, - makeFragment, - wrapFragment, - makeVList, - makeOrd, - makeGlue, - staticSvg, - svgData, - tryCombineChars - }; - var thinspace = { - number: 3, - unit: "mu" - }; - var mediumspace = { - number: 4, - unit: "mu" - }; - var thickspace = { - number: 5, - unit: "mu" - }; - var spacings = { - mord: { - mop: thinspace, - mbin: mediumspace, - mrel: thickspace, - minner: thinspace - }, - mop: { - mord: thinspace, - mop: thinspace, - mrel: thickspace, - minner: thinspace - }, - mbin: { - mord: mediumspace, - mop: mediumspace, - mopen: mediumspace, - minner: mediumspace - }, - mrel: { - mord: thickspace, - mop: thickspace, - mopen: thickspace, - minner: thickspace - }, - mopen: {}, - mclose: { - mop: thinspace, - mbin: mediumspace, - mrel: thickspace, - minner: thinspace - }, - mpunct: { - mord: thinspace, - mop: thinspace, - mrel: thickspace, - mopen: thinspace, - mclose: thinspace, - mpunct: thinspace, - minner: thinspace - }, - minner: { - mord: thinspace, - mop: thinspace, - mbin: mediumspace, - mrel: thickspace, - mopen: thinspace, - mpunct: thinspace, - minner: thinspace - } - }; - var tightSpacings = { - mord: { - mop: thinspace - }, - mop: { - mord: thinspace, - mop: thinspace - }, - mbin: {}, - mrel: {}, - mopen: {}, - mclose: { - mop: thinspace - }, - mpunct: {}, - minner: { - mop: thinspace - } - }; - var _functions = {}; - var _htmlGroupBuilders = {}; - var _mathmlGroupBuilders = {}; - function defineFunction(_ref) { - var { - type: type2, - names, - props, - handler, - htmlBuilder: htmlBuilder2, - mathmlBuilder: mathmlBuilder2 - } = _ref; - var data = { - type: type2, - numArgs: props.numArgs, - argTypes: props.argTypes, - allowedInArgument: !!props.allowedInArgument, - allowedInText: !!props.allowedInText, - allowedInMath: props.allowedInMath === void 0 ? true : props.allowedInMath, - numOptionalArgs: props.numOptionalArgs || 0, - infix: !!props.infix, - primitive: !!props.primitive, - handler + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js + function linearish(scale) { + var domain = scale.domain; + scale.ticks = function(count) { + var d2 = domain(); + return ticks(d2[0], d2[d2.length - 1], count == null ? 10 : count); }; - for (var i2 = 0; i2 < names.length; ++i2) { - _functions[names[i2]] = data; - } - if (type2) { - if (htmlBuilder2) { - _htmlGroupBuilders[type2] = htmlBuilder2; + scale.tickFormat = function(count, specifier) { + var d2 = domain(); + return tickFormat(d2[0], d2[d2.length - 1], count == null ? 10 : count, specifier); + }; + scale.nice = function(count) { + if (count == null) count = 10; + var d2 = domain(); + var i0 = 0; + var i1 = d2.length - 1; + var start3 = d2[i0]; + var stop5 = d2[i1]; + var prestep; + var step3; + var maxIter = 10; + if (stop5 < start3) { + step3 = start3, start3 = stop5, stop5 = step3; + step3 = i0, i0 = i1, i1 = step3; } - if (mathmlBuilder2) { - _mathmlGroupBuilders[type2] = mathmlBuilder2; + while (maxIter-- > 0) { + step3 = tickIncrement(start3, stop5, count); + if (step3 === prestep) { + d2[i0] = start3; + d2[i1] = stop5; + return domain(d2); + } else if (step3 > 0) { + start3 = Math.floor(start3 / step3) * step3; + stop5 = Math.ceil(stop5 / step3) * step3; + } else if (step3 < 0) { + start3 = Math.ceil(start3 * step3) / step3; + stop5 = Math.floor(stop5 * step3) / step3; + } else { + break; + } + prestep = step3; } - } + return scale; + }; + return scale; } - function defineFunctionBuilders(_ref2) { - var { - type: type2, - htmlBuilder: htmlBuilder2, - mathmlBuilder: mathmlBuilder2 - } = _ref2; - defineFunction({ - type: type2, - names: [], - props: { - numArgs: 0 - }, - handler() { - throw new Error("Should never be called."); - }, - htmlBuilder: htmlBuilder2, - mathmlBuilder: mathmlBuilder2 - }); + function linear2() { + var scale = continuous(); + scale.copy = function() { + return copy(scale, linear2()); + }; + initRange.apply(scale, arguments); + return linearish(scale); } - var normalizeArgument = function normalizeArgument2(arg) { - return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg; - }; - var ordargument = function ordargument2(arg) { - return arg.type === "ordgroup" ? arg.body : [arg]; - }; - var makeSpan$1 = buildCommon.makeSpan; - var binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"]; - var binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"]; - var styleMap$1 = { - "display": Style$1.DISPLAY, - "text": Style$1.TEXT, - "script": Style$1.SCRIPT, - "scriptscript": Style$1.SCRIPTSCRIPT - }; - var DomEnum = { - mord: "mord", - mop: "mop", - mbin: "mbin", - mrel: "mrel", - mopen: "mopen", - mclose: "mclose", - mpunct: "mpunct", - minner: "minner" - }; - var buildExpression$1 = function buildExpression2(expression, options2, isRealGroup, surrounding) { - if (surrounding === void 0) { - surrounding = [null, null]; + var init_linear = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js"() { + "use strict"; + init_src2(); + init_continuous(); + init_init(); + init_tickFormat(); + __name(linearish, "linearish"); + __name(linear2, "linear"); } - var groups = []; - for (var i2 = 0; i2 < expression.length; i2++) { - var output = buildGroup$1(expression[i2], options2); - if (output instanceof DocumentFragment) { - var children2 = output.children; - groups.push(...children2); - } else { - groups.push(output); - } - } - buildCommon.tryCombineChars(groups); - if (!isRealGroup) { - return groups; - } - var glueOptions = options2; - if (expression.length === 1) { - var node2 = expression[0]; - if (node2.type === "sizing") { - glueOptions = options2.havingSize(node2.size); - } else if (node2.type === "styling") { - glueOptions = options2.havingStyle(styleMap$1[node2.style]); - } - } - var dummyPrev = makeSpan$1([surrounding[0] || "leftmost"], [], options2); - var dummyNext = makeSpan$1([surrounding[1] || "rightmost"], [], options2); - var isRoot = isRealGroup === "root"; - traverseNonSpaceNodes(groups, (node3, prev2) => { - var prevType = prev2.classes[0]; - var type2 = node3.classes[0]; - if (prevType === "mbin" && utils.contains(binRightCanceller, type2)) { - prev2.classes[0] = "mord"; - } else if (type2 === "mbin" && utils.contains(binLeftCanceller, prevType)) { - node3.classes[0] = "mord"; - } - }, { - node: dummyPrev - }, dummyNext, isRoot); - traverseNonSpaceNodes(groups, (node3, prev2) => { - var prevType = getTypeOfDomTree(prev2); - var type2 = getTypeOfDomTree(node3); - var space = prevType && type2 ? node3.hasClass("mtight") ? tightSpacings[prevType][type2] : spacings[prevType][type2] : null; - if (space) { - return buildCommon.makeGlue(space, glueOptions); - } - }, { - node: dummyPrev - }, dummyNext, isRoot); - return groups; - }; - var traverseNonSpaceNodes = function traverseNonSpaceNodes2(nodes2, callback, prev2, next2, isRoot) { - if (next2) { - nodes2.push(next2); - } - var i2 = 0; - for (; i2 < nodes2.length; i2++) { - var node2 = nodes2[i2]; - var partialGroup = checkPartialGroup(node2); - if (partialGroup) { - traverseNonSpaceNodes2(partialGroup.children, callback, prev2, null, isRoot); - continue; - } - var nonspace = !node2.hasClass("mspace"); - if (nonspace) { - var result = callback(node2, prev2.node); - if (result) { - if (prev2.insertAfter) { - prev2.insertAfter(result); - } else { - nodes2.unshift(result); - i2++; - } - } - } - if (nonspace) { - prev2.node = node2; - } else if (isRoot && node2.hasClass("newline")) { - prev2.node = makeSpan$1(["leftmost"]); - } - prev2.insertAfter = ((index2) => (n) => { - nodes2.splice(index2 + 1, 0, n); - i2++; - })(i2); + }); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/nice.js + function nice(domain, interval2) { + domain = domain.slice(); + var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t4; + if (x1 < x0) { + t4 = i0, i0 = i1, i1 = t4; + t4 = x0, x0 = x1, x1 = t4; } - if (next2) { - nodes2.pop(); + domain[i0] = interval2.floor(x0); + domain[i1] = interval2.ceil(x1); + return domain; + } + var init_nice = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/nice.js"() { + "use strict"; + __name(nice, "nice"); } - }; - var checkPartialGroup = function checkPartialGroup2(node2) { - if (node2 instanceof DocumentFragment || node2 instanceof Anchor || node2 instanceof Span && node2.hasClass("enclosing")) { - return node2; + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/interval.js + function timeInterval(floori, offseti, count, field) { + function interval2(date2) { + return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2; } - return null; - }; - var getOutermostNode = function getOutermostNode2(node2, side) { - var partialGroup = checkPartialGroup(node2); - if (partialGroup) { - var children2 = partialGroup.children; - if (children2.length) { - if (side === "right") { - return getOutermostNode2(children2[children2.length - 1], "right"); - } else if (side === "left") { - return getOutermostNode2(children2[0], "left"); + __name(interval2, "interval"); + interval2.floor = (date2) => { + return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2; + }; + interval2.ceil = (date2) => { + return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2; + }; + interval2.round = (date2) => { + const d0 = interval2(date2), d1 = interval2.ceil(date2); + return date2 - d0 < d1 - date2 ? d0 : d1; + }; + interval2.offset = (date2, step3) => { + return offseti(date2 = /* @__PURE__ */ new Date(+date2), step3 == null ? 1 : Math.floor(step3)), date2; + }; + interval2.range = (start3, stop5, step3) => { + const range3 = []; + start3 = interval2.ceil(start3); + step3 = step3 == null ? 1 : Math.floor(step3); + if (!(start3 < stop5) || !(step3 > 0)) return range3; + let previous; + do + range3.push(previous = /* @__PURE__ */ new Date(+start3)), offseti(start3, step3), floori(start3); + while (previous < start3 && start3 < stop5); + return range3; + }; + interval2.filter = (test) => { + return timeInterval((date2) => { + if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1); + }, (date2, step3) => { + if (date2 >= date2) { + if (step3 < 0) while (++step3 <= 0) { + while (offseti(date2, -1), !test(date2)) { + } + } + else while (--step3 >= 0) { + while (offseti(date2, 1), !test(date2)) { + } + } } - } + }); + }; + if (count) { + interval2.count = (start3, end2) => { + t02.setTime(+start3), t12.setTime(+end2); + floori(t02), floori(t12); + return Math.floor(count(t02, t12)); + }; + interval2.every = (step3) => { + step3 = Math.floor(step3); + return !isFinite(step3) || !(step3 > 0) ? null : !(step3 > 1) ? interval2 : interval2.filter(field ? (d2) => field(d2) % step3 === 0 : (d2) => interval2.count(0, d2) % step3 === 0); + }; } - return node2; - }; - var getTypeOfDomTree = function getTypeOfDomTree2(node2, side) { - if (!node2) { - return null; + return interval2; + } + var t02, t12; + var init_interval = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/interval.js"() { + "use strict"; + t02 = /* @__PURE__ */ new Date(); + t12 = /* @__PURE__ */ new Date(); + __name(timeInterval, "timeInterval"); } - if (side) { - node2 = getOutermostNode(node2, side); + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/millisecond.js + var millisecond, milliseconds; + var init_millisecond = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/millisecond.js"() { + "use strict"; + init_interval(); + millisecond = timeInterval(() => { + }, (date2, step3) => { + date2.setTime(+date2 + step3); + }, (start3, end2) => { + return end2 - start3; + }); + millisecond.every = (k2) => { + k2 = Math.floor(k2); + if (!isFinite(k2) || !(k2 > 0)) return null; + if (!(k2 > 1)) return millisecond; + return timeInterval((date2) => { + date2.setTime(Math.floor(date2 / k2) * k2); + }, (date2, step3) => { + date2.setTime(+date2 + step3 * k2); + }, (start3, end2) => { + return (end2 - start3) / k2; + }); + }; + milliseconds = millisecond.range; } - return DomEnum[node2.classes[0]] || null; - }; - var makeNullDelimiter = function makeNullDelimiter2(options2, classes2) { - var moreClasses = ["nulldelimiter"].concat(options2.baseSizingClasses()); - return makeSpan$1(classes2.concat(moreClasses)); - }; - var buildGroup$1 = function buildGroup2(group, options2, baseOptions) { - if (!group) { - return makeSpan$1(); - } - if (_htmlGroupBuilders[group.type]) { - var groupNode = _htmlGroupBuilders[group.type](group, options2); - if (baseOptions && options2.size !== baseOptions.size) { - groupNode = makeSpan$1(options2.sizingClasses(baseOptions), [groupNode], options2); - var multiplier = options2.sizeMultiplier / baseOptions.sizeMultiplier; - groupNode.height *= multiplier; - groupNode.depth *= multiplier; - } - return groupNode; - } else { - throw new ParseError("Got group of unknown type: '" + group.type + "'"); + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/duration.js + var durationSecond, durationMinute, durationHour, durationDay, durationWeek, durationMonth, durationYear; + var init_duration2 = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/duration.js"() { + "use strict"; + durationSecond = 1e3; + durationMinute = durationSecond * 60; + durationHour = durationMinute * 60; + durationDay = durationHour * 24; + durationWeek = durationDay * 7; + durationMonth = durationDay * 30; + durationYear = durationDay * 365; } - }; - function buildHTMLUnbreakable(children2, options2) { - var body = makeSpan$1(["base"], children2, options2); - var strut = makeSpan$1(["strut"]); - strut.style.height = makeEm(body.height + body.depth); - if (body.depth) { - strut.style.verticalAlign = makeEm(-body.depth); + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/second.js + var second, seconds; + var init_second = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/second.js"() { + "use strict"; + init_interval(); + init_duration2(); + second = timeInterval((date2) => { + date2.setTime(date2 - date2.getMilliseconds()); + }, (date2, step3) => { + date2.setTime(+date2 + step3 * durationSecond); + }, (start3, end2) => { + return (end2 - start3) / durationSecond; + }, (date2) => { + return date2.getUTCSeconds(); + }); + seconds = second.range; } - body.children.unshift(strut); - return body; - } - function buildHTML(tree, options2) { - var tag = null; - if (tree.length === 1 && tree[0].type === "tag") { - tag = tree[0].tag; - tree = tree[0].body; + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js + var timeMinute, timeMinutes, utcMinute, utcMinutes; + var init_minute = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js"() { + "use strict"; + init_interval(); + init_duration2(); + timeMinute = timeInterval((date2) => { + date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond); + }, (date2, step3) => { + date2.setTime(+date2 + step3 * durationMinute); + }, (start3, end2) => { + return (end2 - start3) / durationMinute; + }, (date2) => { + return date2.getMinutes(); + }); + timeMinutes = timeMinute.range; + utcMinute = timeInterval((date2) => { + date2.setUTCSeconds(0, 0); + }, (date2, step3) => { + date2.setTime(+date2 + step3 * durationMinute); + }, (start3, end2) => { + return (end2 - start3) / durationMinute; + }, (date2) => { + return date2.getUTCMinutes(); + }); + utcMinutes = utcMinute.range; } - var expression = buildExpression$1(tree, options2, "root"); - var eqnNum; - if (expression.length === 2 && expression[1].hasClass("tag")) { - eqnNum = expression.pop(); + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js + var timeHour, timeHours, utcHour, utcHours; + var init_hour = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js"() { + "use strict"; + init_interval(); + init_duration2(); + timeHour = timeInterval((date2) => { + date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute); + }, (date2, step3) => { + date2.setTime(+date2 + step3 * durationHour); + }, (start3, end2) => { + return (end2 - start3) / durationHour; + }, (date2) => { + return date2.getHours(); + }); + timeHours = timeHour.range; + utcHour = timeInterval((date2) => { + date2.setUTCMinutes(0, 0, 0); + }, (date2, step3) => { + date2.setTime(+date2 + step3 * durationHour); + }, (start3, end2) => { + return (end2 - start3) / durationHour; + }, (date2) => { + return date2.getUTCHours(); + }); + utcHours = utcHour.range; } - var children2 = []; - var parts = []; - for (var i2 = 0; i2 < expression.length; i2++) { - parts.push(expression[i2]); - if (expression[i2].hasClass("mbin") || expression[i2].hasClass("mrel") || expression[i2].hasClass("allowbreak")) { - var nobreak = false; - while (i2 < expression.length - 1 && expression[i2 + 1].hasClass("mspace") && !expression[i2 + 1].hasClass("newline")) { - i2++; - parts.push(expression[i2]); - if (expression[i2].hasClass("nobreak")) { - nobreak = true; - } - } - if (!nobreak) { - children2.push(buildHTMLUnbreakable(parts, options2)); - parts = []; - } - } else if (expression[i2].hasClass("newline")) { - parts.pop(); - if (parts.length > 0) { - children2.push(buildHTMLUnbreakable(parts, options2)); - parts = []; - } - children2.push(expression[i2]); - } + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/day.js + var timeDay, timeDays, utcDay, utcDays, unixDay, unixDays; + var init_day = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/day.js"() { + "use strict"; + init_interval(); + init_duration2(); + timeDay = timeInterval( + (date2) => date2.setHours(0, 0, 0, 0), + (date2, step3) => date2.setDate(date2.getDate() + step3), + (start3, end2) => (end2 - start3 - (end2.getTimezoneOffset() - start3.getTimezoneOffset()) * durationMinute) / durationDay, + (date2) => date2.getDate() - 1 + ); + timeDays = timeDay.range; + utcDay = timeInterval((date2) => { + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setUTCDate(date2.getUTCDate() + step3); + }, (start3, end2) => { + return (end2 - start3) / durationDay; + }, (date2) => { + return date2.getUTCDate() - 1; + }); + utcDays = utcDay.range; + unixDay = timeInterval((date2) => { + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setUTCDate(date2.getUTCDate() + step3); + }, (start3, end2) => { + return (end2 - start3) / durationDay; + }, (date2) => { + return Math.floor(date2 / durationDay); + }); + unixDays = unixDay.range; } - if (parts.length > 0) { - children2.push(buildHTMLUnbreakable(parts, options2)); + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/week.js + function timeWeekday(i2) { + return timeInterval((date2) => { + date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7); + date2.setHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setDate(date2.getDate() + step3 * 7); + }, (start3, end2) => { + return (end2 - start3 - (end2.getTimezoneOffset() - start3.getTimezoneOffset()) * durationMinute) / durationWeek; + }); + } + function utcWeekday(i2) { + return timeInterval((date2) => { + date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7); + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setUTCDate(date2.getUTCDate() + step3 * 7); + }, (start3, end2) => { + return (end2 - start3) / durationWeek; + }); + } + var timeSunday, timeMonday, timeTuesday, timeWednesday, timeThursday, timeFriday, timeSaturday, timeSundays, timeMondays, timeTuesdays, timeWednesdays, timeThursdays, timeFridays, timeSaturdays, utcSunday, utcMonday, utcTuesday, utcWednesday, utcThursday, utcFriday, utcSaturday, utcSundays, utcMondays, utcTuesdays, utcWednesdays, utcThursdays, utcFridays, utcSaturdays; + var init_week = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/week.js"() { + "use strict"; + init_interval(); + init_duration2(); + __name(timeWeekday, "timeWeekday"); + timeSunday = timeWeekday(0); + timeMonday = timeWeekday(1); + timeTuesday = timeWeekday(2); + timeWednesday = timeWeekday(3); + timeThursday = timeWeekday(4); + timeFriday = timeWeekday(5); + timeSaturday = timeWeekday(6); + timeSundays = timeSunday.range; + timeMondays = timeMonday.range; + timeTuesdays = timeTuesday.range; + timeWednesdays = timeWednesday.range; + timeThursdays = timeThursday.range; + timeFridays = timeFriday.range; + timeSaturdays = timeSaturday.range; + __name(utcWeekday, "utcWeekday"); + utcSunday = utcWeekday(0); + utcMonday = utcWeekday(1); + utcTuesday = utcWeekday(2); + utcWednesday = utcWeekday(3); + utcThursday = utcWeekday(4); + utcFriday = utcWeekday(5); + utcSaturday = utcWeekday(6); + utcSundays = utcSunday.range; + utcMondays = utcMonday.range; + utcTuesdays = utcTuesday.range; + utcWednesdays = utcWednesday.range; + utcThursdays = utcThursday.range; + utcFridays = utcFriday.range; + utcSaturdays = utcSaturday.range; } - var tagChild; - if (tag) { - tagChild = buildHTMLUnbreakable(buildExpression$1(tag, options2, true)); - tagChild.classes = ["tag"]; - children2.push(tagChild); - } else if (eqnNum) { - children2.push(eqnNum); + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/month.js + var timeMonth, timeMonths, utcMonth, utcMonths; + var init_month = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/month.js"() { + "use strict"; + init_interval(); + timeMonth = timeInterval((date2) => { + date2.setDate(1); + date2.setHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setMonth(date2.getMonth() + step3); + }, (start3, end2) => { + return end2.getMonth() - start3.getMonth() + (end2.getFullYear() - start3.getFullYear()) * 12; + }, (date2) => { + return date2.getMonth(); + }); + timeMonths = timeMonth.range; + utcMonth = timeInterval((date2) => { + date2.setUTCDate(1); + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setUTCMonth(date2.getUTCMonth() + step3); + }, (start3, end2) => { + return end2.getUTCMonth() - start3.getUTCMonth() + (end2.getUTCFullYear() - start3.getUTCFullYear()) * 12; + }, (date2) => { + return date2.getUTCMonth(); + }); + utcMonths = utcMonth.range; } - var htmlNode = makeSpan$1(["katex-html"], children2); - htmlNode.setAttribute("aria-hidden", "true"); - if (tagChild) { - var strut = tagChild.children[0]; - strut.style.height = makeEm(htmlNode.height + htmlNode.depth); - if (htmlNode.depth) { - strut.style.verticalAlign = makeEm(-htmlNode.depth); - } + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/year.js + var timeYear, timeYears, utcYear, utcYears; + var init_year = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/year.js"() { + "use strict"; + init_interval(); + timeYear = timeInterval((date2) => { + date2.setMonth(0, 1); + date2.setHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setFullYear(date2.getFullYear() + step3); + }, (start3, end2) => { + return end2.getFullYear() - start3.getFullYear(); + }, (date2) => { + return date2.getFullYear(); + }); + timeYear.every = (k2) => { + return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { + date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2); + date2.setMonth(0, 1); + date2.setHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setFullYear(date2.getFullYear() + step3 * k2); + }); + }; + timeYears = timeYear.range; + utcYear = timeInterval((date2) => { + date2.setUTCMonth(0, 1); + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setUTCFullYear(date2.getUTCFullYear() + step3); + }, (start3, end2) => { + return end2.getUTCFullYear() - start3.getUTCFullYear(); + }, (date2) => { + return date2.getUTCFullYear(); + }); + utcYear.every = (k2) => { + return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2); + date2.setUTCMonth(0, 1); + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step3) => { + date2.setUTCFullYear(date2.getUTCFullYear() + step3 * k2); + }); + }; + utcYears = utcYear.range; } - return htmlNode; - } - function newDocumentFragment(children2) { - return new DocumentFragment(children2); + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/ticks.js + function ticker(year, month, week, day, hour, minute) { + const tickIntervals = [ + [second, 1, durationSecond], + [second, 5, 5 * durationSecond], + [second, 15, 15 * durationSecond], + [second, 30, 30 * durationSecond], + [minute, 1, durationMinute], + [minute, 5, 5 * durationMinute], + [minute, 15, 15 * durationMinute], + [minute, 30, 30 * durationMinute], + [hour, 1, durationHour], + [hour, 3, 3 * durationHour], + [hour, 6, 6 * durationHour], + [hour, 12, 12 * durationHour], + [day, 1, durationDay], + [day, 2, 2 * durationDay], + [week, 1, durationWeek], + [month, 1, durationMonth], + [month, 3, 3 * durationMonth], + [year, 1, durationYear] + ]; + function ticks2(start3, stop5, count) { + const reverse2 = stop5 < start3; + if (reverse2) [start3, stop5] = [stop5, start3]; + const interval2 = count && typeof count.range === "function" ? count : tickInterval2(start3, stop5, count); + const ticks3 = interval2 ? interval2.range(start3, +stop5 + 1) : []; + return reverse2 ? ticks3.reverse() : ticks3; + } + __name(ticks2, "ticks"); + function tickInterval2(start3, stop5, count) { + const target = Math.abs(stop5 - start3) / count; + const i2 = bisector(([, , step4]) => step4).right(tickIntervals, target); + if (i2 === tickIntervals.length) return year.every(tickStep(start3 / durationYear, stop5 / durationYear, count)); + if (i2 === 0) return millisecond.every(Math.max(tickStep(start3, stop5, count), 1)); + const [t4, step3] = tickIntervals[target / tickIntervals[i2 - 1][2] < tickIntervals[i2][2] / target ? i2 - 1 : i2]; + return t4.every(step3); + } + __name(tickInterval2, "tickInterval"); + return [ticks2, tickInterval2]; } - class MathNode { - constructor(type2, children2, classes2) { - this.type = void 0; - this.attributes = void 0; - this.children = void 0; - this.classes = void 0; - this.type = type2; - this.attributes = {}; - this.children = children2 || []; - this.classes = classes2 || []; - } - /** - * Sets an attribute on a MathML node. MathML depends on attributes to convey a - * semantic content, so this is used heavily. - */ - setAttribute(name, value2) { - this.attributes[name] = value2; - } - /** - * Gets an attribute on a MathML node. - */ - getAttribute(name) { - return this.attributes[name]; - } - /** - * Converts the math node into a MathML-namespaced DOM element. - */ - toNode() { - var node2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); - for (var attr in this.attributes) { - if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { - node2.setAttribute(attr, this.attributes[attr]); - } - } - if (this.classes.length > 0) { - node2.className = createClass(this.classes); - } - for (var i2 = 0; i2 < this.children.length; i2++) { - node2.appendChild(this.children[i2].toNode()); - } - return node2; + var utcTicks, utcTickInterval, timeTicks, timeTickInterval; + var init_ticks2 = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/ticks.js"() { + "use strict"; + init_src2(); + init_duration2(); + init_millisecond(); + init_second(); + init_minute(); + init_hour(); + init_day(); + init_week(); + init_month(); + init_year(); + __name(ticker, "ticker"); + [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute); + [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute); } - /** - * Converts the math node into an HTML markup string. - */ - toMarkup() { - var markup = "<" + this.type; - for (var attr in this.attributes) { - if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { - markup += " " + attr + '="'; - markup += utils.escape(this.attributes[attr]); - markup += '"'; - } - } - if (this.classes.length > 0) { - markup += ' class ="' + utils.escape(createClass(this.classes)) + '"'; - } - markup += ">"; - for (var i2 = 0; i2 < this.children.length; i2++) { - markup += this.children[i2].toMarkup(); - } - markup += ""; - return markup; + }); + + // ../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/index.js + var init_src26 = __esm({ + "../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/index.js"() { + "use strict"; + init_millisecond(); + init_second(); + init_minute(); + init_hour(); + init_day(); + init_week(); + init_month(); + init_year(); + init_ticks2(); } - /** - * Converts the math node into a string, similar to innerText, but escaped. - */ - toText() { - return this.children.map((child) => child.toText()).join(""); + }); + + // ../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/locale.js + function localDate(d2) { + if (0 <= d2.y && d2.y < 100) { + var date2 = new Date(-1, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L); + date2.setFullYear(d2.y); + return date2; } + return new Date(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L); } - class TextNode { - constructor(text2) { - this.text = void 0; - this.text = text2; + function utcDate(d2) { + if (0 <= d2.y && d2.y < 100) { + var date2 = new Date(Date.UTC(-1, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L)); + date2.setUTCFullYear(d2.y); + return date2; } - /** - * Converts the text node into a DOM text node. - */ - toNode() { - return document.createTextNode(this.text); - } - /** - * Converts the text node into escaped HTML markup - * (representing the text itself). - */ - toMarkup() { - return utils.escape(this.toText()); - } - /** - * Converts the text node into a string - * (representing the text itself). - */ - toText() { - return this.text; - } - } - class SpaceNode { - /** - * Create a Space node with width given in CSS ems. - */ - constructor(width2) { - this.width = void 0; - this.character = void 0; - this.width = width2; - if (width2 >= 0.05555 && width2 <= 0.05556) { - this.character = " "; - } else if (width2 >= 0.1666 && width2 <= 0.1667) { - this.character = " "; - } else if (width2 >= 0.2222 && width2 <= 0.2223) { - this.character = " "; - } else if (width2 >= 0.2777 && width2 <= 0.2778) { - this.character = "  "; - } else if (width2 >= -0.05556 && width2 <= -0.05555) { - this.character = " ⁣"; - } else if (width2 >= -0.1667 && width2 <= -0.1666) { - this.character = " ⁣"; - } else if (width2 >= -0.2223 && width2 <= -0.2222) { - this.character = " ⁣"; - } else if (width2 >= -0.2778 && width2 <= -0.2777) { - this.character = " ⁣"; - } else { - this.character = null; + return new Date(Date.UTC(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L)); + } + function newDate(y5, m2, d2) { + return { y: y5, m: m2, d: d2, H: 0, M: 0, S: 0, L: 0 }; + } + function formatLocale(locale3) { + var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths; + var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths); + var formats = { + "a": formatShortWeekday, + "A": formatWeekday, + "b": formatShortMonth, + "B": formatMonth, + "c": null, + "d": formatDayOfMonth, + "e": formatDayOfMonth, + "f": formatMicroseconds, + "g": formatYearISO, + "G": formatFullYearISO, + "H": formatHour24, + "I": formatHour12, + "j": formatDayOfYear, + "L": formatMilliseconds, + "m": formatMonthNumber, + "M": formatMinutes, + "p": formatPeriod, + "q": formatQuarter, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, + "S": formatSeconds, + "u": formatWeekdayNumberMonday, + "U": formatWeekNumberSunday, + "V": formatWeekNumberISO, + "w": formatWeekdayNumberSunday, + "W": formatWeekNumberMonday, + "x": null, + "X": null, + "y": formatYear, + "Y": formatFullYear, + "Z": formatZone, + "%": formatLiteralPercent + }; + var utcFormats = { + "a": formatUTCShortWeekday, + "A": formatUTCWeekday, + "b": formatUTCShortMonth, + "B": formatUTCMonth, + "c": null, + "d": formatUTCDayOfMonth, + "e": formatUTCDayOfMonth, + "f": formatUTCMicroseconds, + "g": formatUTCYearISO, + "G": formatUTCFullYearISO, + "H": formatUTCHour24, + "I": formatUTCHour12, + "j": formatUTCDayOfYear, + "L": formatUTCMilliseconds, + "m": formatUTCMonthNumber, + "M": formatUTCMinutes, + "p": formatUTCPeriod, + "q": formatUTCQuarter, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, + "S": formatUTCSeconds, + "u": formatUTCWeekdayNumberMonday, + "U": formatUTCWeekNumberSunday, + "V": formatUTCWeekNumberISO, + "w": formatUTCWeekdayNumberSunday, + "W": formatUTCWeekNumberMonday, + "x": null, + "X": null, + "y": formatUTCYear, + "Y": formatUTCFullYear, + "Z": formatUTCZone, + "%": formatLiteralPercent + }; + var parses = { + "a": parseShortWeekday, + "A": parseWeekday, + "b": parseShortMonth, + "B": parseMonth, + "c": parseLocaleDateTime, + "d": parseDayOfMonth, + "e": parseDayOfMonth, + "f": parseMicroseconds, + "g": parseYear, + "G": parseFullYear, + "H": parseHour24, + "I": parseHour24, + "j": parseDayOfYear, + "L": parseMilliseconds, + "m": parseMonthNumber, + "M": parseMinutes, + "p": parsePeriod, + "q": parseQuarter, + "Q": parseUnixTimestamp, + "s": parseUnixTimestampSeconds, + "S": parseSeconds, + "u": parseWeekdayNumberMonday, + "U": parseWeekNumberSunday, + "V": parseWeekNumberISO, + "w": parseWeekdayNumberSunday, + "W": parseWeekNumberMonday, + "x": parseLocaleDate, + "X": parseLocaleTime, + "y": parseYear, + "Y": parseFullYear, + "Z": parseZone, + "%": parseLiteralPercent + }; + formats.x = newFormat(locale_date, formats); + formats.X = newFormat(locale_time, formats); + formats.c = newFormat(locale_dateTime, formats); + utcFormats.x = newFormat(locale_date, utcFormats); + utcFormats.X = newFormat(locale_time, utcFormats); + utcFormats.c = newFormat(locale_dateTime, utcFormats); + function newFormat(specifier, formats2) { + return function(date2) { + var string3 = [], i2 = -1, j2 = 0, n2 = specifier.length, c3, pad3, format3; + if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2); + while (++i2 < n2) { + if (specifier.charCodeAt(i2) === 37) { + string3.push(specifier.slice(j2, i2)); + if ((pad3 = pads[c3 = specifier.charAt(++i2)]) != null) c3 = specifier.charAt(++i2); + else pad3 = c3 === "e" ? " " : "0"; + if (format3 = formats2[c3]) c3 = format3(date2, pad3); + string3.push(c3); + j2 = i2 + 1; + } + } + string3.push(specifier.slice(j2, i2)); + return string3.join(""); + }; + } + __name(newFormat, "newFormat"); + function newParse(specifier, Z2) { + return function(string3) { + var d2 = newDate(1900, void 0, 1), i2 = parseSpecifier(d2, specifier, string3 += "", 0), week, day; + if (i2 != string3.length) return null; + if ("Q" in d2) return new Date(d2.Q); + if ("s" in d2) return new Date(d2.s * 1e3 + ("L" in d2 ? d2.L : 0)); + if (Z2 && !("Z" in d2)) d2.Z = 0; + if ("p" in d2) d2.H = d2.H % 12 + d2.p * 12; + if (d2.m === void 0) d2.m = "q" in d2 ? d2.q : 0; + if ("V" in d2) { + if (d2.V < 1 || d2.V > 53) return null; + if (!("w" in d2)) d2.w = 1; + if ("Z" in d2) { + week = utcDate(newDate(d2.y, 0, 1)), day = week.getUTCDay(); + week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week); + week = utcDay.offset(week, (d2.V - 1) * 7); + d2.y = week.getUTCFullYear(); + d2.m = week.getUTCMonth(); + d2.d = week.getUTCDate() + (d2.w + 6) % 7; + } else { + week = localDate(newDate(d2.y, 0, 1)), day = week.getDay(); + week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week); + week = timeDay.offset(week, (d2.V - 1) * 7); + d2.y = week.getFullYear(); + d2.m = week.getMonth(); + d2.d = week.getDate() + (d2.w + 6) % 7; + } + } else if ("W" in d2 || "U" in d2) { + if (!("w" in d2)) d2.w = "u" in d2 ? d2.u % 7 : "W" in d2 ? 1 : 0; + day = "Z" in d2 ? utcDate(newDate(d2.y, 0, 1)).getUTCDay() : localDate(newDate(d2.y, 0, 1)).getDay(); + d2.m = 0; + d2.d = "W" in d2 ? (d2.w + 6) % 7 + d2.W * 7 - (day + 5) % 7 : d2.w + d2.U * 7 - (day + 6) % 7; + } + if ("Z" in d2) { + d2.H += d2.Z / 100 | 0; + d2.M += d2.Z % 100; + return utcDate(d2); + } + return localDate(d2); + }; + } + __name(newParse, "newParse"); + function parseSpecifier(d2, specifier, string3, j2) { + var i2 = 0, n2 = specifier.length, m2 = string3.length, c3, parse8; + while (i2 < n2) { + if (j2 >= m2) return -1; + c3 = specifier.charCodeAt(i2++); + if (c3 === 37) { + c3 = specifier.charAt(i2++); + parse8 = parses[c3 in pads ? specifier.charAt(i2++) : c3]; + if (!parse8 || (j2 = parse8(d2, string3, j2)) < 0) return -1; + } else if (c3 != string3.charCodeAt(j2++)) { + return -1; + } } + return j2; } - /** - * Converts the math node into a MathML-namespaced DOM element. - */ - toNode() { - if (this.character) { - return document.createTextNode(this.character); - } else { - var node2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace"); - node2.setAttribute("width", makeEm(this.width)); - return node2; - } + __name(parseSpecifier, "parseSpecifier"); + function parsePeriod(d2, string3, i2) { + var n2 = periodRe.exec(string3.slice(i2)); + return n2 ? (d2.p = periodLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1; } - /** - * Converts the math node into an HTML markup string. - */ - toMarkup() { - if (this.character) { - return "" + this.character + ""; - } else { - return ''; - } + __name(parsePeriod, "parsePeriod"); + function parseShortWeekday(d2, string3, i2) { + var n2 = shortWeekdayRe.exec(string3.slice(i2)); + return n2 ? (d2.w = shortWeekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1; } - /** - * Converts the math node into a string, similar to innerText. - */ - toText() { - if (this.character) { - return this.character; - } else { - return " "; - } + __name(parseShortWeekday, "parseShortWeekday"); + function parseWeekday(d2, string3, i2) { + var n2 = weekdayRe.exec(string3.slice(i2)); + return n2 ? (d2.w = weekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1; } - } - var mathMLTree = { - MathNode, - TextNode, - SpaceNode, - newDocumentFragment - }; - var makeText = function makeText2(text2, mode, options2) { - if (symbols[mode][text2] && symbols[mode][text2].replace && text2.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(text2) && options2 && (options2.fontFamily && options2.fontFamily.slice(4, 6) === "tt" || options2.font && options2.font.slice(4, 6) === "tt"))) { - text2 = symbols[mode][text2].replace; + __name(parseWeekday, "parseWeekday"); + function parseShortMonth(d2, string3, i2) { + var n2 = shortMonthRe.exec(string3.slice(i2)); + return n2 ? (d2.m = shortMonthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1; } - return new mathMLTree.TextNode(text2); - }; - var makeRow = function makeRow2(body) { - if (body.length === 1) { - return body[0]; - } else { - return new mathMLTree.MathNode("mrow", body); + __name(parseShortMonth, "parseShortMonth"); + function parseMonth(d2, string3, i2) { + var n2 = monthRe.exec(string3.slice(i2)); + return n2 ? (d2.m = monthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1; } - }; - var getVariant = function getVariant2(group, options2) { - if (options2.fontFamily === "texttt") { - return "monospace"; - } else if (options2.fontFamily === "textsf") { - if (options2.fontShape === "textit" && options2.fontWeight === "textbf") { - return "sans-serif-bold-italic"; - } else if (options2.fontShape === "textit") { - return "sans-serif-italic"; - } else if (options2.fontWeight === "textbf") { - return "bold-sans-serif"; - } else { - return "sans-serif"; - } - } else if (options2.fontShape === "textit" && options2.fontWeight === "textbf") { - return "bold-italic"; - } else if (options2.fontShape === "textit") { - return "italic"; - } else if (options2.fontWeight === "textbf") { - return "bold"; + __name(parseMonth, "parseMonth"); + function parseLocaleDateTime(d2, string3, i2) { + return parseSpecifier(d2, locale_dateTime, string3, i2); } - var font = options2.font; - if (!font || font === "mathnormal") { - return null; + __name(parseLocaleDateTime, "parseLocaleDateTime"); + function parseLocaleDate(d2, string3, i2) { + return parseSpecifier(d2, locale_date, string3, i2); } - var mode = group.mode; - if (font === "mathit") { - return "italic"; - } else if (font === "boldsymbol") { - return group.type === "textord" ? "bold" : "bold-italic"; - } else if (font === "mathbf") { - return "bold"; - } else if (font === "mathbb") { - return "double-struck"; - } else if (font === "mathfrak") { - return "fraktur"; - } else if (font === "mathscr" || font === "mathcal") { - return "script"; - } else if (font === "mathsf") { - return "sans-serif"; - } else if (font === "mathtt") { - return "monospace"; - } - var text2 = group.text; - if (utils.contains(["\\imath", "\\jmath"], text2)) { - return null; + __name(parseLocaleDate, "parseLocaleDate"); + function parseLocaleTime(d2, string3, i2) { + return parseSpecifier(d2, locale_time, string3, i2); } - if (symbols[mode][text2] && symbols[mode][text2].replace) { - text2 = symbols[mode][text2].replace; + __name(parseLocaleTime, "parseLocaleTime"); + function formatShortWeekday(d2) { + return locale_shortWeekdays[d2.getDay()]; } - var fontName = buildCommon.fontMap[font].fontName; - if (getCharacterMetrics(text2, fontName, mode)) { - return buildCommon.fontMap[font].variant; + __name(formatShortWeekday, "formatShortWeekday"); + function formatWeekday(d2) { + return locale_weekdays[d2.getDay()]; } - return null; - }; - var buildExpression = function buildExpression2(expression, options2, isOrdgroup) { - if (expression.length === 1) { - var group = buildGroup(expression[0], options2); - if (isOrdgroup && group instanceof MathNode && group.type === "mo") { - group.setAttribute("lspace", "0em"); - group.setAttribute("rspace", "0em"); - } - return [group]; + __name(formatWeekday, "formatWeekday"); + function formatShortMonth(d2) { + return locale_shortMonths[d2.getMonth()]; } - var groups = []; - var lastGroup; - for (var i2 = 0; i2 < expression.length; i2++) { - var _group = buildGroup(expression[i2], options2); - if (_group instanceof MathNode && lastGroup instanceof MathNode) { - if (_group.type === "mtext" && lastGroup.type === "mtext" && _group.getAttribute("mathvariant") === lastGroup.getAttribute("mathvariant")) { - lastGroup.children.push(..._group.children); - continue; - } else if (_group.type === "mn" && lastGroup.type === "mn") { - lastGroup.children.push(..._group.children); - continue; - } else if (_group.type === "mi" && _group.children.length === 1 && lastGroup.type === "mn") { - var child = _group.children[0]; - if (child instanceof TextNode && child.text === ".") { - lastGroup.children.push(..._group.children); - continue; - } - } else if (lastGroup.type === "mi" && lastGroup.children.length === 1) { - var lastChild = lastGroup.children[0]; - if (lastChild instanceof TextNode && lastChild.text === "̸" && (_group.type === "mo" || _group.type === "mi" || _group.type === "mn")) { - var _child = _group.children[0]; - if (_child instanceof TextNode && _child.text.length > 0) { - _child.text = _child.text.slice(0, 1) + "̸" + _child.text.slice(1); - groups.pop(); - } - } - } - } - groups.push(_group); - lastGroup = _group; + __name(formatShortMonth, "formatShortMonth"); + function formatMonth(d2) { + return locale_months[d2.getMonth()]; } - return groups; - }; - var buildExpressionRow = function buildExpressionRow2(expression, options2, isOrdgroup) { - return makeRow(buildExpression(expression, options2, isOrdgroup)); - }; - var buildGroup = function buildGroup2(group, options2) { - if (!group) { - return new mathMLTree.MathNode("mrow"); + __name(formatMonth, "formatMonth"); + function formatPeriod(d2) { + return locale_periods[+(d2.getHours() >= 12)]; } - if (_mathmlGroupBuilders[group.type]) { - var result = _mathmlGroupBuilders[group.type](group, options2); - return result; - } else { - throw new ParseError("Got group of unknown type: '" + group.type + "'"); + __name(formatPeriod, "formatPeriod"); + function formatQuarter(d2) { + return 1 + ~~(d2.getMonth() / 3); } - }; - function buildMathML(tree, texExpression, options2, isDisplayMode, forMathmlOnly) { - var expression = buildExpression(tree, options2); - var wrapper; - if (expression.length === 1 && expression[0] instanceof MathNode && utils.contains(["mrow", "mtable"], expression[0].type)) { - wrapper = expression[0]; - } else { - wrapper = new mathMLTree.MathNode("mrow", expression); + __name(formatQuarter, "formatQuarter"); + function formatUTCShortWeekday(d2) { + return locale_shortWeekdays[d2.getUTCDay()]; } - var annotation = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(texExpression)]); - annotation.setAttribute("encoding", "application/x-tex"); - var semantics = new mathMLTree.MathNode("semantics", [wrapper, annotation]); - var math2 = new mathMLTree.MathNode("math", [semantics]); - math2.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"); - if (isDisplayMode) { - math2.setAttribute("display", "block"); + __name(formatUTCShortWeekday, "formatUTCShortWeekday"); + function formatUTCWeekday(d2) { + return locale_weekdays[d2.getUTCDay()]; } - var wrapperClass = forMathmlOnly ? "katex" : "katex-mathml"; - return buildCommon.makeSpan([wrapperClass], [math2]); - } - var optionsFromSettings = function optionsFromSettings2(settings) { - return new Options({ - style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT, - maxSize: settings.maxSize, - minRuleThickness: settings.minRuleThickness - }); - }; - var displayWrap = function displayWrap2(node2, settings) { - if (settings.displayMode) { - var classes2 = ["katex-display"]; - if (settings.leqno) { - classes2.push("leqno"); - } - if (settings.fleqn) { - classes2.push("fleqn"); - } - node2 = buildCommon.makeSpan(classes2, [node2]); + __name(formatUTCWeekday, "formatUTCWeekday"); + function formatUTCShortMonth(d2) { + return locale_shortMonths[d2.getUTCMonth()]; } - return node2; - }; - var buildTree = function buildTree2(tree, expression, settings) { - var options2 = optionsFromSettings(settings); - var katexNode; - if (settings.output === "mathml") { - return buildMathML(tree, expression, options2, settings.displayMode, true); - } else if (settings.output === "html") { - var htmlNode = buildHTML(tree, options2); - katexNode = buildCommon.makeSpan(["katex"], [htmlNode]); - } else { - var mathMLNode = buildMathML(tree, expression, options2, settings.displayMode, false); - var _htmlNode = buildHTML(tree, options2); - katexNode = buildCommon.makeSpan(["katex"], [mathMLNode, _htmlNode]); + __name(formatUTCShortMonth, "formatUTCShortMonth"); + function formatUTCMonth(d2) { + return locale_months[d2.getUTCMonth()]; } - return displayWrap(katexNode, settings); - }; - var buildHTMLTree = function buildHTMLTree2(tree, expression, settings) { - var options2 = optionsFromSettings(settings); - var htmlNode = buildHTML(tree, options2); - var katexNode = buildCommon.makeSpan(["katex"], [htmlNode]); - return displayWrap(katexNode, settings); - }; - var stretchyCodePoint = { - widehat: "^", - widecheck: "ˇ", - widetilde: "~", - utilde: "~", - overleftarrow: "←", - underleftarrow: "←", - xleftarrow: "←", - overrightarrow: "→", - underrightarrow: "→", - xrightarrow: "→", - underbrace: "⏟", - overbrace: "⏞", - overgroup: "⏠", - undergroup: "⏡", - overleftrightarrow: "↔", - underleftrightarrow: "↔", - xleftrightarrow: "↔", - Overrightarrow: "⇒", - xRightarrow: "⇒", - overleftharpoon: "↼", - xleftharpoonup: "↼", - overrightharpoon: "⇀", - xrightharpoonup: "⇀", - xLeftarrow: "⇐", - xLeftrightarrow: "⇔", - xhookleftarrow: "↩", - xhookrightarrow: "↪", - xmapsto: "↦", - xrightharpoondown: "⇁", - xleftharpoondown: "↽", - xrightleftharpoons: "⇌", - xleftrightharpoons: "⇋", - xtwoheadleftarrow: "↞", - xtwoheadrightarrow: "↠", - xlongequal: "=", - xtofrom: "⇄", - xrightleftarrows: "⇄", - xrightequilibrium: "⇌", - // Not a perfect match. - xleftequilibrium: "⇋", - // None better available. - "\\cdrightarrow": "→", - "\\cdleftarrow": "←", - "\\cdlongequal": "=" - }; - var mathMLnode = function mathMLnode2(label) { - var node2 = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[label.replace(/^\\/, "")])]); - node2.setAttribute("stretchy", "true"); - return node2; - }; - var katexImagesData = { - // path(s), minWidth, height, align - overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], - overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], - underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], - underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], - xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"], - "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"], - // CD minwwidth2.5pc - xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"], - "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"], - Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"], - xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"], - xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"], - overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"], - xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"], - xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"], - overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"], - xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"], - xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"], - xlongequal: [["longequal"], 0.888, 334, "xMinYMin"], - "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"], - xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"], - xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"], - overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522], - overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548], - underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548], - underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522], - xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522], - xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560], - xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716], - xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716], - xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522], - xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522], - overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522], - underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522], - overgroup: [["leftgroup", "rightgroup"], 0.888, 342], - undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342], - xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522], - xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528], - // The next three arrows are from the mhchem package. - // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the - // document as \xrightarrow or \xrightleftharpoons. Those have - // min-length = 1.75em, so we set min-length on these next three to match. - xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901], - xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716], - xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716] - }; - var groupLength = function groupLength2(arg) { - if (arg.type === "ordgroup") { - return arg.body.length; - } else { - return 1; + __name(formatUTCMonth, "formatUTCMonth"); + function formatUTCPeriod(d2) { + return locale_periods[+(d2.getUTCHours() >= 12)]; } - }; - var svgSpan = function svgSpan2(group, options2) { - function buildSvgSpan_() { - var viewBoxWidth = 4e5; - var label = group.label.slice(1); - if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], label)) { - var grp = group; - var numChars = groupLength(grp.base); - var viewBoxHeight; - var pathName; - var _height; - if (numChars > 5) { - if (label === "widehat" || label === "widecheck") { - viewBoxHeight = 420; - viewBoxWidth = 2364; - _height = 0.42; - pathName = label + "4"; - } else { - viewBoxHeight = 312; - viewBoxWidth = 2340; - _height = 0.34; - pathName = "tilde4"; - } - } else { - var imgIndex = [1, 1, 2, 2, 3, 3][numChars]; - if (label === "widehat" || label === "widecheck") { - viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex]; - viewBoxHeight = [0, 239, 300, 360, 420][imgIndex]; - _height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex]; - pathName = label + imgIndex; - } else { - viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex]; - viewBoxHeight = [0, 260, 286, 306, 312][imgIndex]; - _height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex]; - pathName = "tilde" + imgIndex; - } - } - var path2 = new PathNode(pathName); - var svgNode2 = new SvgNode([path2], { - "width": "100%", - "height": makeEm(_height), - "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight, - "preserveAspectRatio": "none" - }); - return { - span: buildCommon.makeSvgSpan([], [svgNode2], options2), - minWidth: 0, - height: _height + __name(formatUTCPeriod, "formatUTCPeriod"); + function formatUTCQuarter(d2) { + return 1 + ~~(d2.getUTCMonth() / 3); + } + __name(formatUTCQuarter, "formatUTCQuarter"); + return { + format: /* @__PURE__ */ __name(function(specifier) { + var f3 = newFormat(specifier += "", formats); + f3.toString = function() { + return specifier; }; - } else { - var spans = []; - var data = katexImagesData[label]; - var [paths, _minWidth, _viewBoxHeight] = data; - var _height2 = _viewBoxHeight / 1e3; - var numSvgChildren = paths.length; - var widthClasses; - var aligns; - if (numSvgChildren === 1) { - var align1 = data[3]; - widthClasses = ["hide-tail"]; - aligns = [align1]; - } else if (numSvgChildren === 2) { - widthClasses = ["halfarrow-left", "halfarrow-right"]; - aligns = ["xMinYMin", "xMaxYMin"]; - } else if (numSvgChildren === 3) { - widthClasses = ["brace-left", "brace-center", "brace-right"]; - aligns = ["xMinYMin", "xMidYMin", "xMaxYMin"]; - } else { - throw new Error("Correct katexImagesData or update code here to support\n " + numSvgChildren + " children."); - } - for (var i2 = 0; i2 < numSvgChildren; i2++) { - var _path = new PathNode(paths[i2]); - var _svgNode = new SvgNode([_path], { - "width": "400em", - "height": makeEm(_height2), - "viewBox": "0 0 " + viewBoxWidth + " " + _viewBoxHeight, - "preserveAspectRatio": aligns[i2] + " slice" - }); - var _span = buildCommon.makeSvgSpan([widthClasses[i2]], [_svgNode], options2); - if (numSvgChildren === 1) { - return { - span: _span, - minWidth: _minWidth, - height: _height2 - }; - } else { - _span.style.height = makeEm(_height2); - spans.push(_span); - } - } - return { - span: buildCommon.makeSpan(["stretchy"], spans, options2), - minWidth: _minWidth, - height: _height2 + return f3; + }, "format"), + parse: /* @__PURE__ */ __name(function(specifier) { + var p3 = newParse(specifier += "", false); + p3.toString = function() { + return specifier; }; - } - } - var { - span, - minWidth, - height - } = buildSvgSpan_(); - span.height = height; - span.style.height = makeEm(height); - if (minWidth > 0) { - span.style.minWidth = makeEm(minWidth); - } - return span; - }; - var encloseSpan = function encloseSpan2(inner2, label, topPad, bottomPad, options2) { - var img; - var totalHeight = inner2.height + inner2.depth + topPad + bottomPad; - if (/fbox|color|angl/.test(label)) { - img = buildCommon.makeSpan(["stretchy", label], [], options2); - if (label === "fbox") { - var color2 = options2.color && options2.getColor(); - if (color2) { - img.style.borderColor = color2; - } - } - } else { - var lines = []; - if (/^[bx]cancel$/.test(label)) { - lines.push(new LineNode({ - "x1": "0", - "y1": "0", - "x2": "100%", - "y2": "100%", - "stroke-width": "0.046em" - })); - } - if (/^x?cancel$/.test(label)) { - lines.push(new LineNode({ - "x1": "0", - "y1": "100%", - "x2": "100%", - "y2": "0", - "stroke-width": "0.046em" - })); - } - var svgNode2 = new SvgNode(lines, { - "width": "100%", - "height": makeEm(totalHeight) - }); - img = buildCommon.makeSvgSpan([], [svgNode2], options2); - } - img.height = totalHeight; - img.style.height = makeEm(totalHeight); - return img; - }; - var stretchy = { - encloseSpan, - mathMLnode, - svgSpan - }; - function assertNodeType(node2, type2) { - if (!node2 || node2.type !== type2) { - throw new Error("Expected node of type " + type2 + ", but got " + (node2 ? "node of type " + node2.type : String(node2))); - } - return node2; + return p3; + }, "parse"), + utcFormat: /* @__PURE__ */ __name(function(specifier) { + var f3 = newFormat(specifier += "", utcFormats); + f3.toString = function() { + return specifier; + }; + return f3; + }, "utcFormat"), + utcParse: /* @__PURE__ */ __name(function(specifier) { + var p3 = newParse(specifier += "", true); + p3.toString = function() { + return specifier; + }; + return p3; + }, "utcParse") + }; } - function assertSymbolNodeType(node2) { - var typedNode = checkSymbolNodeType(node2); - if (!typedNode) { - throw new Error("Expected node of symbol group type, but got " + (node2 ? "node of type " + node2.type : String(node2))); - } - return typedNode; + function pad2(value2, fill, width3) { + var sign2 = value2 < 0 ? "-" : "", string3 = (sign2 ? -value2 : value2) + "", length2 = string3.length; + return sign2 + (length2 < width3 ? new Array(width3 - length2 + 1).join(fill) + string3 : string3); } - function checkSymbolNodeType(node2) { - if (node2 && (node2.type === "atom" || NON_ATOMS.hasOwnProperty(node2.type))) { - return node2; - } - return null; + function requote(s2) { + return s2.replace(requoteRe, "\\$&"); } - var htmlBuilder$a = (grp, options2) => { - var base; - var group; - var supSubGroup; - if (grp && grp.type === "supsub") { - group = assertNodeType(grp.base, "accent"); - base = group.base; - grp.base = base; - supSubGroup = assertSpan(buildGroup$1(grp, options2)); - grp.base = group; - } else { - group = assertNodeType(grp, "accent"); - base = group.base; - } - var body = buildGroup$1(base, options2.havingCrampedStyle()); - var mustShift = group.isShifty && utils.isCharacterBox(base); - var skew = 0; - if (mustShift) { - var baseChar = utils.getBaseElem(base); - var baseGroup = buildGroup$1(baseChar, options2.havingCrampedStyle()); - skew = assertSymbolDomNode(baseGroup).skew; - } - var accentBelow = group.label === "\\c"; - var clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options2.fontMetrics().xHeight); - var accentBody; - if (!group.isStretchy) { - var accent2; - var width2; - if (group.label === "\\vec") { - accent2 = buildCommon.staticSvg("vec", options2); - width2 = buildCommon.svgData.vec[1]; - } else { - accent2 = buildCommon.makeOrd({ - mode: group.mode, - text: group.label - }, options2, "textord"); - accent2 = assertSymbolDomNode(accent2); - accent2.italic = 0; - width2 = accent2.width; - if (accentBelow) { - clearance += accent2.depth; - } - } - accentBody = buildCommon.makeSpan(["accent-body"], [accent2]); - var accentFull = group.label === "\\textcircled"; - if (accentFull) { - accentBody.classes.push("accent-full"); - clearance = body.height; - } - var left2 = skew; - if (!accentFull) { - left2 -= width2 / 2; - } - accentBody.style.left = makeEm(left2); - if (group.label === "\\textcircled") { - accentBody.style.top = ".2em"; - } - accentBody = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: body - }, { - type: "kern", - size: -clearance - }, { - type: "elem", - elem: accentBody - }] - }, options2); - } else { - accentBody = stretchy.svgSpan(group, options2); - accentBody = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: body - }, { - type: "elem", - elem: accentBody, - wrapperClasses: ["svg-align"], - wrapperStyle: skew > 0 ? { - width: "calc(100% - " + makeEm(2 * skew) + ")", - marginLeft: makeEm(2 * skew) - } : void 0 - }] - }, options2); - } - var accentWrap = buildCommon.makeSpan(["mord", "accent"], [accentBody], options2); - if (supSubGroup) { - supSubGroup.children[0] = accentWrap; - supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height); - supSubGroup.classes[0] = "mord"; - return supSubGroup; - } else { - return accentWrap; + function formatRe(names) { + return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); + } + function formatLookup(names) { + return new Map(names.map((name, i2) => [name.toLowerCase(), i2])); + } + function parseWeekdayNumberSunday(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 1)); + return n2 ? (d2.w = +n2[0], i2 + n2[0].length) : -1; + } + function parseWeekdayNumberMonday(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 1)); + return n2 ? (d2.u = +n2[0], i2 + n2[0].length) : -1; + } + function parseWeekNumberSunday(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.U = +n2[0], i2 + n2[0].length) : -1; + } + function parseWeekNumberISO(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.V = +n2[0], i2 + n2[0].length) : -1; + } + function parseWeekNumberMonday(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.W = +n2[0], i2 + n2[0].length) : -1; + } + function parseFullYear(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 4)); + return n2 ? (d2.y = +n2[0], i2 + n2[0].length) : -1; + } + function parseYear(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.y = +n2[0] + (+n2[0] > 68 ? 1900 : 2e3), i2 + n2[0].length) : -1; + } + function parseZone(d2, string3, i2) { + var n2 = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string3.slice(i2, i2 + 6)); + return n2 ? (d2.Z = n2[1] ? 0 : -(n2[2] + (n2[3] || "00")), i2 + n2[0].length) : -1; + } + function parseQuarter(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 1)); + return n2 ? (d2.q = n2[0] * 3 - 3, i2 + n2[0].length) : -1; + } + function parseMonthNumber(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.m = n2[0] - 1, i2 + n2[0].length) : -1; + } + function parseDayOfMonth(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.d = +n2[0], i2 + n2[0].length) : -1; + } + function parseDayOfYear(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 3)); + return n2 ? (d2.m = 0, d2.d = +n2[0], i2 + n2[0].length) : -1; + } + function parseHour24(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.H = +n2[0], i2 + n2[0].length) : -1; + } + function parseMinutes(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.M = +n2[0], i2 + n2[0].length) : -1; + } + function parseSeconds(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 2)); + return n2 ? (d2.S = +n2[0], i2 + n2[0].length) : -1; + } + function parseMilliseconds(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 3)); + return n2 ? (d2.L = +n2[0], i2 + n2[0].length) : -1; + } + function parseMicroseconds(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2, i2 + 6)); + return n2 ? (d2.L = Math.floor(n2[0] / 1e3), i2 + n2[0].length) : -1; + } + function parseLiteralPercent(d2, string3, i2) { + var n2 = percentRe.exec(string3.slice(i2, i2 + 1)); + return n2 ? i2 + n2[0].length : -1; + } + function parseUnixTimestamp(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2)); + return n2 ? (d2.Q = +n2[0], i2 + n2[0].length) : -1; + } + function parseUnixTimestampSeconds(d2, string3, i2) { + var n2 = numberRe.exec(string3.slice(i2)); + return n2 ? (d2.s = +n2[0], i2 + n2[0].length) : -1; + } + function formatDayOfMonth(d2, p3) { + return pad2(d2.getDate(), p3, 2); + } + function formatHour24(d2, p3) { + return pad2(d2.getHours(), p3, 2); + } + function formatHour12(d2, p3) { + return pad2(d2.getHours() % 12 || 12, p3, 2); + } + function formatDayOfYear(d2, p3) { + return pad2(1 + timeDay.count(timeYear(d2), d2), p3, 3); + } + function formatMilliseconds(d2, p3) { + return pad2(d2.getMilliseconds(), p3, 3); + } + function formatMicroseconds(d2, p3) { + return formatMilliseconds(d2, p3) + "000"; + } + function formatMonthNumber(d2, p3) { + return pad2(d2.getMonth() + 1, p3, 2); + } + function formatMinutes(d2, p3) { + return pad2(d2.getMinutes(), p3, 2); + } + function formatSeconds(d2, p3) { + return pad2(d2.getSeconds(), p3, 2); + } + function formatWeekdayNumberMonday(d2) { + var day = d2.getDay(); + return day === 0 ? 7 : day; + } + function formatWeekNumberSunday(d2, p3) { + return pad2(timeSunday.count(timeYear(d2) - 1, d2), p3, 2); + } + function dISO(d2) { + var day = d2.getDay(); + return day >= 4 || day === 0 ? timeThursday(d2) : timeThursday.ceil(d2); + } + function formatWeekNumberISO(d2, p3) { + d2 = dISO(d2); + return pad2(timeThursday.count(timeYear(d2), d2) + (timeYear(d2).getDay() === 4), p3, 2); + } + function formatWeekdayNumberSunday(d2) { + return d2.getDay(); + } + function formatWeekNumberMonday(d2, p3) { + return pad2(timeMonday.count(timeYear(d2) - 1, d2), p3, 2); + } + function formatYear(d2, p3) { + return pad2(d2.getFullYear() % 100, p3, 2); + } + function formatYearISO(d2, p3) { + d2 = dISO(d2); + return pad2(d2.getFullYear() % 100, p3, 2); + } + function formatFullYear(d2, p3) { + return pad2(d2.getFullYear() % 1e4, p3, 4); + } + function formatFullYearISO(d2, p3) { + var day = d2.getDay(); + d2 = day >= 4 || day === 0 ? timeThursday(d2) : timeThursday.ceil(d2); + return pad2(d2.getFullYear() % 1e4, p3, 4); + } + function formatZone(d2) { + var z2 = d2.getTimezoneOffset(); + return (z2 > 0 ? "-" : (z2 *= -1, "+")) + pad2(z2 / 60 | 0, "0", 2) + pad2(z2 % 60, "0", 2); + } + function formatUTCDayOfMonth(d2, p3) { + return pad2(d2.getUTCDate(), p3, 2); + } + function formatUTCHour24(d2, p3) { + return pad2(d2.getUTCHours(), p3, 2); + } + function formatUTCHour12(d2, p3) { + return pad2(d2.getUTCHours() % 12 || 12, p3, 2); + } + function formatUTCDayOfYear(d2, p3) { + return pad2(1 + utcDay.count(utcYear(d2), d2), p3, 3); + } + function formatUTCMilliseconds(d2, p3) { + return pad2(d2.getUTCMilliseconds(), p3, 3); + } + function formatUTCMicroseconds(d2, p3) { + return formatUTCMilliseconds(d2, p3) + "000"; + } + function formatUTCMonthNumber(d2, p3) { + return pad2(d2.getUTCMonth() + 1, p3, 2); + } + function formatUTCMinutes(d2, p3) { + return pad2(d2.getUTCMinutes(), p3, 2); + } + function formatUTCSeconds(d2, p3) { + return pad2(d2.getUTCSeconds(), p3, 2); + } + function formatUTCWeekdayNumberMonday(d2) { + var dow = d2.getUTCDay(); + return dow === 0 ? 7 : dow; + } + function formatUTCWeekNumberSunday(d2, p3) { + return pad2(utcSunday.count(utcYear(d2) - 1, d2), p3, 2); + } + function UTCdISO(d2) { + var day = d2.getUTCDay(); + return day >= 4 || day === 0 ? utcThursday(d2) : utcThursday.ceil(d2); + } + function formatUTCWeekNumberISO(d2, p3) { + d2 = UTCdISO(d2); + return pad2(utcThursday.count(utcYear(d2), d2) + (utcYear(d2).getUTCDay() === 4), p3, 2); + } + function formatUTCWeekdayNumberSunday(d2) { + return d2.getUTCDay(); + } + function formatUTCWeekNumberMonday(d2, p3) { + return pad2(utcMonday.count(utcYear(d2) - 1, d2), p3, 2); + } + function formatUTCYear(d2, p3) { + return pad2(d2.getUTCFullYear() % 100, p3, 2); + } + function formatUTCYearISO(d2, p3) { + d2 = UTCdISO(d2); + return pad2(d2.getUTCFullYear() % 100, p3, 2); + } + function formatUTCFullYear(d2, p3) { + return pad2(d2.getUTCFullYear() % 1e4, p3, 4); + } + function formatUTCFullYearISO(d2, p3) { + var day = d2.getUTCDay(); + d2 = day >= 4 || day === 0 ? utcThursday(d2) : utcThursday.ceil(d2); + return pad2(d2.getUTCFullYear() % 1e4, p3, 4); + } + function formatUTCZone() { + return "+0000"; + } + function formatLiteralPercent() { + return "%"; + } + function formatUnixTimestamp(d2) { + return +d2; + } + function formatUnixTimestampSeconds(d2) { + return Math.floor(+d2 / 1e3); + } + var pads, numberRe, percentRe, requoteRe; + var init_locale2 = __esm({ + "../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/locale.js"() { + "use strict"; + init_src26(); + __name(localDate, "localDate"); + __name(utcDate, "utcDate"); + __name(newDate, "newDate"); + __name(formatLocale, "formatLocale"); + pads = { "-": "", "_": " ", "0": "0" }; + numberRe = /^\s*\d+/; + percentRe = /^%/; + requoteRe = /[\\^$*+?|[\]().{}]/g; + __name(pad2, "pad"); + __name(requote, "requote"); + __name(formatRe, "formatRe"); + __name(formatLookup, "formatLookup"); + __name(parseWeekdayNumberSunday, "parseWeekdayNumberSunday"); + __name(parseWeekdayNumberMonday, "parseWeekdayNumberMonday"); + __name(parseWeekNumberSunday, "parseWeekNumberSunday"); + __name(parseWeekNumberISO, "parseWeekNumberISO"); + __name(parseWeekNumberMonday, "parseWeekNumberMonday"); + __name(parseFullYear, "parseFullYear"); + __name(parseYear, "parseYear"); + __name(parseZone, "parseZone"); + __name(parseQuarter, "parseQuarter"); + __name(parseMonthNumber, "parseMonthNumber"); + __name(parseDayOfMonth, "parseDayOfMonth"); + __name(parseDayOfYear, "parseDayOfYear"); + __name(parseHour24, "parseHour24"); + __name(parseMinutes, "parseMinutes"); + __name(parseSeconds, "parseSeconds"); + __name(parseMilliseconds, "parseMilliseconds"); + __name(parseMicroseconds, "parseMicroseconds"); + __name(parseLiteralPercent, "parseLiteralPercent"); + __name(parseUnixTimestamp, "parseUnixTimestamp"); + __name(parseUnixTimestampSeconds, "parseUnixTimestampSeconds"); + __name(formatDayOfMonth, "formatDayOfMonth"); + __name(formatHour24, "formatHour24"); + __name(formatHour12, "formatHour12"); + __name(formatDayOfYear, "formatDayOfYear"); + __name(formatMilliseconds, "formatMilliseconds"); + __name(formatMicroseconds, "formatMicroseconds"); + __name(formatMonthNumber, "formatMonthNumber"); + __name(formatMinutes, "formatMinutes"); + __name(formatSeconds, "formatSeconds"); + __name(formatWeekdayNumberMonday, "formatWeekdayNumberMonday"); + __name(formatWeekNumberSunday, "formatWeekNumberSunday"); + __name(dISO, "dISO"); + __name(formatWeekNumberISO, "formatWeekNumberISO"); + __name(formatWeekdayNumberSunday, "formatWeekdayNumberSunday"); + __name(formatWeekNumberMonday, "formatWeekNumberMonday"); + __name(formatYear, "formatYear"); + __name(formatYearISO, "formatYearISO"); + __name(formatFullYear, "formatFullYear"); + __name(formatFullYearISO, "formatFullYearISO"); + __name(formatZone, "formatZone"); + __name(formatUTCDayOfMonth, "formatUTCDayOfMonth"); + __name(formatUTCHour24, "formatUTCHour24"); + __name(formatUTCHour12, "formatUTCHour12"); + __name(formatUTCDayOfYear, "formatUTCDayOfYear"); + __name(formatUTCMilliseconds, "formatUTCMilliseconds"); + __name(formatUTCMicroseconds, "formatUTCMicroseconds"); + __name(formatUTCMonthNumber, "formatUTCMonthNumber"); + __name(formatUTCMinutes, "formatUTCMinutes"); + __name(formatUTCSeconds, "formatUTCSeconds"); + __name(formatUTCWeekdayNumberMonday, "formatUTCWeekdayNumberMonday"); + __name(formatUTCWeekNumberSunday, "formatUTCWeekNumberSunday"); + __name(UTCdISO, "UTCdISO"); + __name(formatUTCWeekNumberISO, "formatUTCWeekNumberISO"); + __name(formatUTCWeekdayNumberSunday, "formatUTCWeekdayNumberSunday"); + __name(formatUTCWeekNumberMonday, "formatUTCWeekNumberMonday"); + __name(formatUTCYear, "formatUTCYear"); + __name(formatUTCYearISO, "formatUTCYearISO"); + __name(formatUTCFullYear, "formatUTCFullYear"); + __name(formatUTCFullYearISO, "formatUTCFullYearISO"); + __name(formatUTCZone, "formatUTCZone"); + __name(formatLiteralPercent, "formatLiteralPercent"); + __name(formatUnixTimestamp, "formatUnixTimestamp"); + __name(formatUnixTimestampSeconds, "formatUnixTimestampSeconds"); } - }; - var mathmlBuilder$9 = (group, options2) => { - var accentNode = group.isStretchy ? stretchy.mathMLnode(group.label) : new mathMLTree.MathNode("mo", [makeText(group.label, group.mode)]); - var node2 = new mathMLTree.MathNode("mover", [buildGroup(group.base, options2), accentNode]); - node2.setAttribute("accent", "true"); - return node2; - }; - var NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((accent2) => "\\" + accent2).join("|")); - defineFunction({ - type: "accent", - names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"], - props: { - numArgs: 1 - }, - handler: (context, args) => { - var base = normalizeArgument(args[0]); - var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName); - var isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck"; - return { - type: "accent", - mode: context.parser.mode, - label: context.funcName, - isStretchy, - isShifty, - base - }; - }, - htmlBuilder: htmlBuilder$a, - mathmlBuilder: mathmlBuilder$9 - }); - defineFunction({ - type: "accent", - names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"], - props: { - numArgs: 1, - allowedInText: true, - allowedInMath: true, - // unless in strict mode - argTypes: ["primitive"] - }, - handler: (context, args) => { - var base = args[0]; - var mode = context.parser.mode; - if (mode === "math") { - context.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + context.funcName + " works only in text mode"); - mode = "text"; - } - return { - type: "accent", - mode, - label: context.funcName, - isStretchy: false, - isShifty: true, - base - }; - }, - htmlBuilder: htmlBuilder$a, - mathmlBuilder: mathmlBuilder$9 - }); - defineFunction({ - type: "accentUnder", - names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"], - props: { - numArgs: 1 - }, - handler: (_ref, args) => { - var { - parser: parser2, - funcName - } = _ref; - var base = args[0]; - return { - type: "accentUnder", - mode: parser2.mode, - label: funcName, - base - }; - }, - htmlBuilder: (group, options2) => { - var innerGroup = buildGroup$1(group.base, options2); - var accentBody = stretchy.svgSpan(group, options2); - var kern = group.label === "\\utilde" ? 0.12 : 0; - var vlist = buildCommon.makeVList({ - positionType: "top", - positionData: innerGroup.height, - children: [{ - type: "elem", - elem: accentBody, - wrapperClasses: ["svg-align"] - }, { - type: "kern", - size: kern - }, { - type: "elem", - elem: innerGroup - }] - }, options2); - return buildCommon.makeSpan(["mord", "accentunder"], [vlist], options2); - }, - mathmlBuilder: (group, options2) => { - var accentNode = stretchy.mathMLnode(group.label); - var node2 = new mathMLTree.MathNode("munder", [buildGroup(group.base, options2), accentNode]); - node2.setAttribute("accentunder", "true"); - return node2; + }); + + // ../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/defaultLocale.js + function defaultLocale2(definition) { + locale2 = formatLocale(definition); + timeFormat = locale2.format; + timeParse = locale2.parse; + utcFormat = locale2.utcFormat; + utcParse = locale2.utcParse; + return locale2; + } + var locale2, timeFormat, timeParse, utcFormat, utcParse; + var init_defaultLocale2 = __esm({ + "../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/defaultLocale.js"() { + "use strict"; + init_locale2(); + defaultLocale2({ + dateTime: "%x, %X", + date: "%-m/%-d/%Y", + time: "%-I:%M:%S %p", + periods: ["AM", "PM"], + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + }); + __name(defaultLocale2, "defaultLocale"); } }); - var paddedNode = (group) => { - var node2 = new mathMLTree.MathNode("mpadded", group ? [group] : []); - node2.setAttribute("width", "+0.6em"); - node2.setAttribute("lspace", "0.3em"); - return node2; - }; - defineFunction({ - type: "xArrow", - names: [ - "\\xleftarrow", - "\\xrightarrow", - "\\xLeftarrow", - "\\xRightarrow", - "\\xleftrightarrow", - "\\xLeftrightarrow", - "\\xhookleftarrow", - "\\xhookrightarrow", - "\\xmapsto", - "\\xrightharpoondown", - "\\xrightharpoonup", - "\\xleftharpoondown", - "\\xleftharpoonup", - "\\xrightleftharpoons", - "\\xleftrightharpoons", - "\\xlongequal", - "\\xtwoheadrightarrow", - "\\xtwoheadleftarrow", - "\\xtofrom", - // The next 3 functions are here to support the mhchem extension. - // Direct use of these functions is discouraged and may break someday. - "\\xrightleftarrows", - "\\xrightequilibrium", - "\\xleftequilibrium", - // The next 3 functions are here only to support the {CD} environment. - "\\\\cdrightarrow", - "\\\\cdleftarrow", - "\\\\cdlongequal" - ], - props: { - numArgs: 1, - numOptionalArgs: 1 - }, - handler(_ref, args, optArgs) { - var { - parser: parser2, - funcName - } = _ref; - return { - type: "xArrow", - mode: parser2.mode, - label: funcName, - body: args[0], - below: optArgs[0] - }; - }, - // Flow is unable to correctly infer the type of `group`, even though it's - // unambiguously determined from the passed-in `type` above. - htmlBuilder(group, options2) { - var style = options2.style; - var newOptions = options2.havingStyle(style.sup()); - var upperGroup = buildCommon.wrapFragment(buildGroup$1(group.body, newOptions, options2), options2); - var arrowPrefix = group.label.slice(0, 2) === "\\x" ? "x" : "cd"; - upperGroup.classes.push(arrowPrefix + "-arrow-pad"); - var lowerGroup; - if (group.below) { - newOptions = options2.havingStyle(style.sub()); - lowerGroup = buildCommon.wrapFragment(buildGroup$1(group.below, newOptions, options2), options2); - lowerGroup.classes.push(arrowPrefix + "-arrow-pad"); - } - var arrowBody = stretchy.svgSpan(group, options2); - var arrowShift = -options2.fontMetrics().axisHeight + 0.5 * arrowBody.height; - var upperShift = -options2.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; - if (upperGroup.depth > 0.25 || group.label === "\\xleftequilibrium") { - upperShift -= upperGroup.depth; - } - var vlist; - if (lowerGroup) { - var lowerShift = -options2.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111; - vlist = buildCommon.makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: upperGroup, - shift: upperShift - }, { - type: "elem", - elem: arrowBody, - shift: arrowShift - }, { - type: "elem", - elem: lowerGroup, - shift: lowerShift - }] - }, options2); - } else { - vlist = buildCommon.makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: upperGroup, - shift: upperShift - }, { - type: "elem", - elem: arrowBody, - shift: arrowShift - }] - }, options2); - } - vlist.children[0].children[0].children[1].classes.push("svg-align"); - return buildCommon.makeSpan(["mrel", "x-arrow"], [vlist], options2); - }, - mathmlBuilder(group, options2) { - var arrowNode = stretchy.mathMLnode(group.label); - arrowNode.setAttribute("minsize", group.label.charAt(0) === "x" ? "1.75em" : "3.0em"); - var node2; - if (group.body) { - var upperNode = paddedNode(buildGroup(group.body, options2)); - if (group.below) { - var lowerNode = paddedNode(buildGroup(group.below, options2)); - node2 = new mathMLTree.MathNode("munderover", [arrowNode, lowerNode, upperNode]); - } else { - node2 = new mathMLTree.MathNode("mover", [arrowNode, upperNode]); - } - } else if (group.below) { - var _lowerNode = paddedNode(buildGroup(group.below, options2)); - node2 = new mathMLTree.MathNode("munder", [arrowNode, _lowerNode]); - } else { - node2 = paddedNode(); - node2 = new mathMLTree.MathNode("mover", [arrowNode, node2]); - } - return node2; + + // ../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/index.js + var init_src27 = __esm({ + "../../node_modules/.pnpm/d3-time-format@4.1.0/node_modules/d3-time-format/src/index.js"() { + "use strict"; + init_defaultLocale2(); } }); - var makeSpan = buildCommon.makeSpan; - function htmlBuilder$9(group, options2) { - var elements2 = buildExpression$1(group.body, options2, true); - return makeSpan([group.mclass], elements2, options2); + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/time.js + function date(t4) { + return new Date(t4); } - function mathmlBuilder$8(group, options2) { - var node2; - var inner2 = buildExpression(group.body, options2); - if (group.mclass === "minner") { - node2 = new mathMLTree.MathNode("mpadded", inner2); - } else if (group.mclass === "mord") { - if (group.isCharacterBox) { - node2 = inner2[0]; - node2.type = "mi"; - } else { - node2 = new mathMLTree.MathNode("mi", inner2); - } - } else { - if (group.isCharacterBox) { - node2 = inner2[0]; - node2.type = "mo"; - } else { - node2 = new mathMLTree.MathNode("mo", inner2); - } - if (group.mclass === "mbin") { - node2.attributes.lspace = "0.22em"; - node2.attributes.rspace = "0.22em"; - } else if (group.mclass === "mpunct") { - node2.attributes.lspace = "0em"; - node2.attributes.rspace = "0.17em"; - } else if (group.mclass === "mopen" || group.mclass === "mclose") { - node2.attributes.lspace = "0em"; - node2.attributes.rspace = "0em"; - } else if (group.mclass === "minner") { - node2.attributes.lspace = "0.0556em"; - node2.attributes.width = "+0.1111em"; - } + function number4(t4) { + return t4 instanceof Date ? +t4 : +/* @__PURE__ */ new Date(+t4); + } + function calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format3) { + var scale = continuous(), invert2 = scale.invert, domain = scale.domain; + var formatMillisecond = format3(".%L"), formatSecond = format3(":%S"), formatMinute = format3("%I:%M"), formatHour = format3("%I %p"), formatDay = format3("%a %d"), formatWeek = format3("%b %d"), formatMonth = format3("%B"), formatYear2 = format3("%Y"); + function tickFormat2(date2) { + return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2); } - return node2; + __name(tickFormat2, "tickFormat"); + scale.invert = function(y5) { + return new Date(invert2(y5)); + }; + scale.domain = function(_2) { + return arguments.length ? domain(Array.from(_2, number4)) : domain().map(date); + }; + scale.ticks = function(interval2) { + var d2 = domain(); + return ticks2(d2[0], d2[d2.length - 1], interval2 == null ? 10 : interval2); + }; + scale.tickFormat = function(count, specifier) { + return specifier == null ? tickFormat2 : format3(specifier); + }; + scale.nice = function(interval2) { + var d2 = domain(); + if (!interval2 || typeof interval2.range !== "function") interval2 = tickInterval2(d2[0], d2[d2.length - 1], interval2 == null ? 10 : interval2); + return interval2 ? domain(nice(d2, interval2)) : scale; + }; + scale.copy = function() { + return copy(scale, calendar(ticks2, tickInterval2, year, month, week, day, hour, minute, second2, format3)); + }; + return scale; } - defineFunction({ - type: "mclass", - names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"], - props: { - numArgs: 1, - primitive: true - }, - handler(_ref, args) { - var { - parser: parser2, - funcName - } = _ref; - var body = args[0]; - return { - type: "mclass", - mode: parser2.mode, - mclass: "m" + funcName.slice(5), - // TODO(kevinb): don't prefix with 'm' - body: ordargument(body), - isCharacterBox: utils.isCharacterBox(body) - }; - }, - htmlBuilder: htmlBuilder$9, - mathmlBuilder: mathmlBuilder$8 + function time() { + return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); + } + var init_time = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/time.js"() { + "use strict"; + init_src26(); + init_src27(); + init_continuous(); + init_init(); + init_nice(); + __name(date, "date"); + __name(number4, "number"); + __name(calendar, "calendar"); + __name(time, "time"); + } }); - var binrelClass = (arg) => { - var atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg; - if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) { - return "m" + atom.family; - } else { - return "mord"; + + // ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/index.js + var init_src28 = __esm({ + "../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/index.js"() { + "use strict"; + init_band(); + init_linear(); + init_ordinal(); + init_time(); } - }; - defineFunction({ - type: "mclass", - names: ["\\@binrel"], - props: { - numArgs: 2 - }, - handler(_ref2, args) { - var { - parser: parser2 - } = _ref2; - return { - type: "mclass", - mode: parser2.mode, - mclass: binrelClass(args[0]), - body: ordargument(args[1]), - isCharacterBox: utils.isCharacterBox(args[1]) - }; + }); + + // ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/colors.js + function colors_default(specifier) { + var n2 = specifier.length / 6 | 0, colors2 = new Array(n2), i2 = 0; + while (i2 < n2) colors2[i2] = "#" + specifier.slice(i2 * 6, ++i2 * 6); + return colors2; + } + var init_colors = __esm({ + "../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/colors.js"() { + "use strict"; + __name(colors_default, "default"); } }); - defineFunction({ - type: "mclass", - names: ["\\stackrel", "\\overset", "\\underset"], - props: { - numArgs: 2 - }, - handler(_ref3, args) { - var { - parser: parser2, - funcName - } = _ref3; - var baseArg = args[1]; - var shiftedArg = args[0]; - var mclass; - if (funcName !== "\\stackrel") { - mclass = binrelClass(baseArg); + + // ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/categorical/Tableau10.js + var Tableau10_default; + var init_Tableau10 = __esm({ + "../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/categorical/Tableau10.js"() { + "use strict"; + init_colors(); + Tableau10_default = colors_default("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"); + } + }); + + // ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/index.js + var init_src29 = __esm({ + "../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/index.js"() { + "use strict"; + init_Tableau10(); + } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js + function constant_default4(x5) { + return /* @__PURE__ */ __name(function constant3() { + return x5; + }, "constant"); + } + var init_constant5 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js"() { + "use strict"; + __name(constant_default4, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/math.js + function acos(x5) { + return x5 > 1 ? 0 : x5 < -1 ? pi2 : Math.acos(x5); + } + function asin(x5) { + return x5 >= 1 ? halfPi : x5 <= -1 ? -halfPi : Math.asin(x5); + } + var abs2, atan2, cos, max3, min3, sin, sqrt, epsilon3, pi2, halfPi, tau2; + var init_math2 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/math.js"() { + "use strict"; + abs2 = Math.abs; + atan2 = Math.atan2; + cos = Math.cos; + max3 = Math.max; + min3 = Math.min; + sin = Math.sin; + sqrt = Math.sqrt; + epsilon3 = 1e-12; + pi2 = Math.PI; + halfPi = pi2 / 2; + tau2 = 2 * pi2; + __name(acos, "acos"); + __name(asin, "asin"); + } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js + function withPath(shape) { + let digits = 3; + shape.digits = function(_2) { + if (!arguments.length) return digits; + if (_2 == null) { + digits = null; } else { - mclass = "mrel"; + const d2 = Math.floor(_2); + if (!(d2 >= 0)) throw new RangeError(`invalid digits: ${_2}`); + digits = d2; } - var baseOp = { - type: "op", - mode: baseArg.mode, - limits: true, - alwaysHandleSupSub: true, - parentIsSupSub: false, - symbol: false, - suppressBaseShift: funcName !== "\\stackrel", - body: ordargument(baseArg) - }; - var supsub = { - type: "supsub", - mode: shiftedArg.mode, - base: baseOp, - sup: funcName === "\\underset" ? null : shiftedArg, - sub: funcName === "\\underset" ? shiftedArg : null - }; - return { - type: "mclass", - mode: parser2.mode, - mclass, - body: [supsub], - isCharacterBox: utils.isCharacterBox(supsub) - }; - }, - htmlBuilder: htmlBuilder$9, - mathmlBuilder: mathmlBuilder$8 - }); - defineFunction({ - type: "pmb", - names: ["\\pmb"], - props: { - numArgs: 1, - allowedInText: true - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - return { - type: "pmb", - mode: parser2.mode, - mclass: binrelClass(args[0]), - body: ordargument(args[0]) - }; - }, - htmlBuilder(group, options2) { - var elements2 = buildExpression$1(group.body, options2, true); - var node2 = buildCommon.makeSpan([group.mclass], elements2, options2); - node2.style.textShadow = "0.02em 0.01em 0.04px"; - return node2; - }, - mathmlBuilder(group, style) { - var inner2 = buildExpression(group.body, style); - var node2 = new mathMLTree.MathNode("mstyle", inner2); - node2.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"); - return node2; + return shape; + }; + return () => new Path(digits); + } + var init_path2 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js"() { + "use strict"; + init_src13(); + __name(withPath, "withPath"); } }); - var cdArrowFunctionName = { - ">": "\\\\cdrightarrow", - "<": "\\\\cdleftarrow", - "=": "\\\\cdlongequal", - "A": "\\uparrow", - "V": "\\downarrow", - "|": "\\Vert", - ".": "no arrow" - }; - var newCell = () => { + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/arc.js + function arcInnerRadius(d2) { + return d2.innerRadius; + } + function arcOuterRadius(d2) { + return d2.outerRadius; + } + function arcStartAngle(d2) { + return d2.startAngle; + } + function arcEndAngle(d2) { + return d2.endAngle; + } + function arcPadAngle(d2) { + return d2 && d2.padAngle; + } + function intersect(x0, y0, x1, y1, x22, y22, x32, y32) { + var x10 = x1 - x0, y10 = y1 - y0, x322 = x32 - x22, y322 = y32 - y22, t4 = y322 * x10 - x322 * y10; + if (t4 * t4 < epsilon3) return; + t4 = (x322 * (y0 - y22) - y322 * (x0 - x22)) / t4; + return [x0 + t4 * x10, y0 + t4 * y10]; + } + function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { + var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r2 = r1 - rc, D3 = x11 * y10 - x10 * y11, d3 = (dy < 0 ? -1 : 1) * sqrt(max3(0, r2 * r2 * d2 - D3 * D3)), cx0 = (D3 * dy - dx * d3) / d2, cy0 = (-D3 * dx - dy * d3) / d2, cx1 = (D3 * dy + dx * d3) / d2, cy1 = (-D3 * dx + dy * d3) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00; + if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; return { - type: "styling", - body: [], - mode: "math", - style: "display" + cx: cx0, + cy: cy0, + x01: -ox, + y01: -oy, + x11: cx0 * (r1 / r2 - 1), + y11: cy0 * (r1 / r2 - 1) }; - }; - var isStartOfArrow = (node2) => { - return node2.type === "textord" && node2.text === "@"; - }; - var isLabelEnd = (node2, endChar) => { - return (node2.type === "mathord" || node2.type === "atom") && node2.text === endChar; - }; - function cdArrow(arrowChar, labels, parser2) { - var funcName = cdArrowFunctionName[arrowChar]; - switch (funcName) { - case "\\\\cdrightarrow": - case "\\\\cdleftarrow": - return parser2.callFunction(funcName, [labels[0]], [labels[1]]); - case "\\uparrow": - case "\\downarrow": { - var leftLabel = parser2.callFunction("\\\\cdleft", [labels[0]], []); - var bareArrow = { - type: "atom", - text: funcName, - mode: "math", - family: "rel" - }; - var sizedArrow = parser2.callFunction("\\Big", [bareArrow], []); - var rightLabel = parser2.callFunction("\\\\cdright", [labels[1]], []); - var arrowGroup = { - type: "ordgroup", - mode: "math", - body: [leftLabel, sizedArrow, rightLabel] - }; - return parser2.callFunction("\\\\cdparent", [arrowGroup], []); - } - case "\\\\cdlongequal": - return parser2.callFunction("\\\\cdlongequal", [], []); - case "\\Vert": { - var arrow = { - type: "textord", - text: "\\Vert", - mode: "math" - }; - return parser2.callFunction("\\Big", [arrow], []); - } - default: - return { - type: "textord", - text: " ", - mode: "math" - }; - } } - function parseCD(parser2) { - var parsedRows = []; - parser2.gullet.beginGroup(); - parser2.gullet.macros.set("\\cr", "\\\\\\relax"); - parser2.gullet.beginGroup(); - while (true) { - parsedRows.push(parser2.parseExpression(false, "\\\\")); - parser2.gullet.endGroup(); - parser2.gullet.beginGroup(); - var next2 = parser2.fetch().text; - if (next2 === "&" || next2 === "\\\\") { - parser2.consume(); - } else if (next2 === "\\end") { - if (parsedRows[parsedRows.length - 1].length === 0) { - parsedRows.pop(); + function arc_default() { + var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default4(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path4 = withPath(arc); + function arc() { + var buffer, r2, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs2(a1 - a0), cw = a1 > a0; + if (!context) context = buffer = path4(); + if (r1 < r0) r2 = r1, r1 = r0, r0 = r2; + if (!(r1 > epsilon3)) context.moveTo(0, 0); + else if (da > tau2 - epsilon3) { + context.moveTo(r1 * cos(a0), r1 * sin(a0)); + context.arc(0, 0, r1, a0, a1, !cw); + if (r0 > epsilon3) { + context.moveTo(r0 * cos(a1), r0 * sin(a1)); + context.arc(0, 0, r0, a1, a0, cw); } - break; } else { - throw new ParseError("Expected \\\\ or \\cr or \\end", parser2.nextToken); - } - } - var row = []; - var body = [row]; - for (var i2 = 0; i2 < parsedRows.length; i2++) { - var rowNodes = parsedRows[i2]; - var cell = newCell(); - for (var j = 0; j < rowNodes.length; j++) { - if (!isStartOfArrow(rowNodes[j])) { - cell.body.push(rowNodes[j]); - } else { - row.push(cell); - j += 1; - var arrowChar = assertSymbolNodeType(rowNodes[j]).text; - var labels = new Array(2); - labels[0] = { - type: "ordgroup", - mode: "math", - body: [] - }; - labels[1] = { - type: "ordgroup", - mode: "math", - body: [] - }; - if ("=|.".indexOf(arrowChar) > -1) - ; - else if ("<>AV".indexOf(arrowChar) > -1) { - for (var labelNum = 0; labelNum < 2; labelNum++) { - var inLabel = true; - for (var k = j + 1; k < rowNodes.length; k++) { - if (isLabelEnd(rowNodes[k], arrowChar)) { - inLabel = false; - j = k; - break; - } - if (isStartOfArrow(rowNodes[k])) { - throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[k]); - } - labels[labelNum].body.push(rowNodes[k]); - } - if (inLabel) { - throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[j]); - } + var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon3 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min3(abs2(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t03, t13; + if (rp > epsilon3) { + var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap)); + if ((da0 -= p0 * 2) > epsilon3) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0; + else da0 = 0, a00 = a10 = (a0 + a1) / 2; + if ((da1 -= p1 * 2) > epsilon3) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1; + else da1 = 0, a01 = a11 = (a0 + a1) / 2; + } + var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10); + if (rc > epsilon3) { + var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc; + if (da < pi2) { + if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) { + var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]); + rc0 = min3(rc, (r0 - lc) / (kc - 1)); + rc1 = min3(rc, (r1 - lc) / (kc + 1)); + } else { + rc0 = rc1 = 0; } - } else { - throw new ParseError('Expected one of "<>AV=|." after @', rowNodes[j]); } - var arrow = cdArrow(arrowChar, labels, parser2); - var wrappedArrow = { - type: "styling", - body: [arrow], - mode: "math", - style: "display" - // CD is always displaystyle. - }; - row.push(wrappedArrow); - cell = newCell(); } + if (!(da1 > epsilon3)) context.moveTo(x01, y01); + else if (rc1 > epsilon3) { + t03 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); + t13 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); + context.moveTo(t03.cx + t03.x01, t03.cy + t03.y01); + if (rc1 < rc) context.arc(t03.cx, t03.cy, rc1, atan2(t03.y01, t03.x01), atan2(t13.y01, t13.x01), !cw); + else { + context.arc(t03.cx, t03.cy, rc1, atan2(t03.y01, t03.x01), atan2(t03.y11, t03.x11), !cw); + context.arc(0, 0, r1, atan2(t03.cy + t03.y11, t03.cx + t03.x11), atan2(t13.cy + t13.y11, t13.cx + t13.x11), !cw); + context.arc(t13.cx, t13.cy, rc1, atan2(t13.y11, t13.x11), atan2(t13.y01, t13.x01), !cw); + } + } else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); + if (!(r0 > epsilon3) || !(da0 > epsilon3)) context.lineTo(x10, y10); + else if (rc0 > epsilon3) { + t03 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); + t13 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); + context.lineTo(t03.cx + t03.x01, t03.cy + t03.y01); + if (rc0 < rc) context.arc(t03.cx, t03.cy, rc0, atan2(t03.y01, t03.x01), atan2(t13.y01, t13.x01), !cw); + else { + context.arc(t03.cx, t03.cy, rc0, atan2(t03.y01, t03.x01), atan2(t03.y11, t03.x11), !cw); + context.arc(0, 0, r0, atan2(t03.cy + t03.y11, t03.cx + t03.x11), atan2(t13.cy + t13.y11, t13.cx + t13.x11), cw); + context.arc(t13.cx, t13.cy, rc0, atan2(t13.y11, t13.x11), atan2(t13.y01, t13.x01), !cw); + } + } else context.arc(0, 0, r0, a10, a00, cw); } - if (i2 % 2 === 0) { - row.push(cell); - } else { - row.shift(); - } - row = []; - body.push(row); + context.closePath(); + if (buffer) return context = null, buffer + "" || null; } - parser2.gullet.endGroup(); - parser2.gullet.endGroup(); - var cols = new Array(body[0].length).fill({ - type: "align", - align: "c", - pregap: 0.25, - // CD package sets \enskip between columns. - postgap: 0.25 - // So pre and post each get half an \enskip, i.e. 0.25em. - }); - return { - type: "array", - mode: "math", - body, - arraystretch: 1, - addJot: true, - rowGaps: [null], - cols, - colSeparationType: "CD", - hLinesBeforeRow: new Array(body.length + 1).fill([]) + __name(arc, "arc"); + arc.centroid = function() { + var r2 = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi2 / 2; + return [cos(a2) * r2, sin(a2) * r2]; + }; + arc.innerRadius = function(_2) { + return arguments.length ? (innerRadius = typeof _2 === "function" ? _2 : constant_default4(+_2), arc) : innerRadius; + }; + arc.outerRadius = function(_2) { + return arguments.length ? (outerRadius = typeof _2 === "function" ? _2 : constant_default4(+_2), arc) : outerRadius; + }; + arc.cornerRadius = function(_2) { + return arguments.length ? (cornerRadius = typeof _2 === "function" ? _2 : constant_default4(+_2), arc) : cornerRadius; + }; + arc.padRadius = function(_2) { + return arguments.length ? (padRadius = _2 == null ? null : typeof _2 === "function" ? _2 : constant_default4(+_2), arc) : padRadius; + }; + arc.startAngle = function(_2) { + return arguments.length ? (startAngle = typeof _2 === "function" ? _2 : constant_default4(+_2), arc) : startAngle; + }; + arc.endAngle = function(_2) { + return arguments.length ? (endAngle = typeof _2 === "function" ? _2 : constant_default4(+_2), arc) : endAngle; + }; + arc.padAngle = function(_2) { + return arguments.length ? (padAngle = typeof _2 === "function" ? _2 : constant_default4(+_2), arc) : padAngle; + }; + arc.context = function(_2) { + return arguments.length ? (context = _2 == null ? null : _2, arc) : context; }; + return arc; } - defineFunction({ - type: "cdlabel", - names: ["\\\\cdleft", "\\\\cdright"], - props: { - numArgs: 1 - }, - handler(_ref, args) { - var { - parser: parser2, - funcName - } = _ref; - return { - type: "cdlabel", - mode: parser2.mode, - side: funcName.slice(4), - label: args[0] - }; - }, - htmlBuilder(group, options2) { - var newOptions = options2.havingStyle(options2.style.sup()); - var label = buildCommon.wrapFragment(buildGroup$1(group.label, newOptions, options2), options2); - label.classes.push("cd-label-" + group.side); - label.style.bottom = makeEm(0.8 - label.depth); - label.height = 0; - label.depth = 0; - return label; - }, - mathmlBuilder(group, options2) { - var label = new mathMLTree.MathNode("mrow", [buildGroup(group.label, options2)]); - label = new mathMLTree.MathNode("mpadded", [label]); - label.setAttribute("width", "0"); - if (group.side === "left") { - label.setAttribute("lspace", "-1width"); - } - label.setAttribute("voffset", "0.7em"); - label = new mathMLTree.MathNode("mstyle", [label]); - label.setAttribute("displaystyle", "false"); - label.setAttribute("scriptlevel", "1"); - return label; - } - }); - defineFunction({ - type: "cdlabelparent", - names: ["\\\\cdparent"], - props: { - numArgs: 1 - }, - handler(_ref2, args) { - var { - parser: parser2 - } = _ref2; - return { - type: "cdlabelparent", - mode: parser2.mode, - fragment: args[0] - }; - }, - htmlBuilder(group, options2) { - var parent = buildCommon.wrapFragment(buildGroup$1(group.fragment, options2), options2); - parent.classes.push("cd-vert-arrow"); - return parent; - }, - mathmlBuilder(group, options2) { - return new mathMLTree.MathNode("mrow", [buildGroup(group.fragment, options2)]); - } - }); - defineFunction({ - type: "textord", - names: ["\\@char"], - props: { - numArgs: 1, - allowedInText: true - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - var arg = assertNodeType(args[0], "ordgroup"); - var group = arg.body; - var number2 = ""; - for (var i2 = 0; i2 < group.length; i2++) { - var node2 = assertNodeType(group[i2], "textord"); - number2 += node2.text; - } - var code = parseInt(number2); - var text2; - if (isNaN(code)) { - throw new ParseError("\\@char has non-numeric argument " + number2); - } else if (code < 0 || code >= 1114111) { - throw new ParseError("\\@char with invalid code point " + number2); - } else if (code <= 65535) { - text2 = String.fromCharCode(code); - } else { - code -= 65536; - text2 = String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); - } - return { - type: "textord", - mode: parser2.mode, - text: text2 - }; + var init_arc = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/arc.js"() { + "use strict"; + init_constant5(); + init_math2(); + init_path2(); + __name(arcInnerRadius, "arcInnerRadius"); + __name(arcOuterRadius, "arcOuterRadius"); + __name(arcStartAngle, "arcStartAngle"); + __name(arcEndAngle, "arcEndAngle"); + __name(arcPadAngle, "arcPadAngle"); + __name(intersect, "intersect"); + __name(cornerTangents, "cornerTangents"); + __name(arc_default, "default"); } }); - var htmlBuilder$8 = (group, options2) => { - var elements2 = buildExpression$1(group.body, options2.withColor(group.color), false); - return buildCommon.makeFragment(elements2); - }; - var mathmlBuilder$7 = (group, options2) => { - var inner2 = buildExpression(group.body, options2.withColor(group.color)); - var node2 = new mathMLTree.MathNode("mstyle", inner2); - node2.setAttribute("mathcolor", group.color); - return node2; - }; - defineFunction({ - type: "color", - names: ["\\textcolor"], - props: { - numArgs: 2, - allowedInText: true, - argTypes: ["color", "original"] - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - var color2 = assertNodeType(args[0], "color-token").color; - var body = args[1]; - return { - type: "color", - mode: parser2.mode, - color: color2, - body: ordargument(body) - }; - }, - htmlBuilder: htmlBuilder$8, - mathmlBuilder: mathmlBuilder$7 - }); - defineFunction({ - type: "color", - names: ["\\color"], - props: { - numArgs: 1, - allowedInText: true, - argTypes: ["color"] - }, - handler(_ref2, args) { - var { - parser: parser2, - breakOnTokenText - } = _ref2; - var color2 = assertNodeType(args[0], "color-token").color; - parser2.gullet.macros.set("\\current@color", color2); - var body = parser2.parseExpression(true, breakOnTokenText); - return { - type: "color", - mode: parser2.mode, - color: color2, - body - }; - }, - htmlBuilder: htmlBuilder$8, - mathmlBuilder: mathmlBuilder$7 - }); - defineFunction({ - type: "cr", - names: ["\\\\"], - props: { - numArgs: 0, - numOptionalArgs: 0, - allowedInText: true - }, - handler(_ref, args, optArgs) { - var { - parser: parser2 - } = _ref; - var size2 = parser2.gullet.future().text === "[" ? parser2.parseSizeGroup(true) : null; - var newLine = !parser2.settings.displayMode || !parser2.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode"); - return { - type: "cr", - mode: parser2.mode, - newLine, - size: size2 && assertNodeType(size2, "size").value - }; - }, - // The following builders are called only at the top level, - // not within tabular/array environments. - htmlBuilder(group, options2) { - var span = buildCommon.makeSpan(["mspace"], [], options2); - if (group.newLine) { - span.classes.push("newline"); - if (group.size) { - span.style.marginTop = makeEm(calculateSize(group.size, options2)); - } - } - return span; - }, - mathmlBuilder(group, options2) { - var node2 = new mathMLTree.MathNode("mspace"); - if (group.newLine) { - node2.setAttribute("linebreak", "newline"); - if (group.size) { - node2.setAttribute("height", makeEm(calculateSize(group.size, options2))); - } - } - return node2; + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.js + function array_default(x5) { + return typeof x5 === "object" && "length" in x5 ? x5 : Array.from(x5); + } + var slice; + var init_array3 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/array.js"() { + "use strict"; + slice = Array.prototype.slice; + __name(array_default, "default"); } }); - var globalMap = { - "\\global": "\\global", - "\\long": "\\\\globallong", - "\\\\globallong": "\\\\globallong", - "\\def": "\\gdef", - "\\gdef": "\\gdef", - "\\edef": "\\xdef", - "\\xdef": "\\xdef", - "\\let": "\\\\globallet", - "\\futurelet": "\\\\globalfuture" - }; - var checkControlSequence = (tok) => { - var name = tok.text; - if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) { - throw new ParseError("Expected a control sequence", tok); - } - return name; - }; - var getRHS = (parser2) => { - var tok = parser2.gullet.popToken(); - if (tok.text === "=") { - tok = parser2.gullet.popToken(); - if (tok.text === " ") { - tok = parser2.gullet.popToken(); - } - } - return tok; - }; - var letCommand = (parser2, name, tok, global2) => { - var macro = parser2.gullet.macros.get(tok.text); - if (macro == null) { - tok.noexpand = true; - macro = { - tokens: [tok], - numArgs: 0, - // reproduce the same behavior in expansion - unexpandable: !parser2.gullet.isExpandable(tok.text) - }; - } - parser2.gullet.macros.set(name, macro, global2); - }; - defineFunction({ - type: "internal", - names: [ - "\\global", - "\\long", - "\\\\globallong" - // can’t be entered directly - ], - props: { - numArgs: 0, - allowedInText: true - }, - handler(_ref) { - var { - parser: parser2, - funcName - } = _ref; - parser2.consumeSpaces(); - var token2 = parser2.fetch(); - if (globalMap[token2.text]) { - if (funcName === "\\global" || funcName === "\\\\globallong") { - token2.text = globalMap[token2.text]; - } - return assertNodeType(parser2.parseFunction(), "internal"); - } - throw new ParseError("Invalid token after macro prefix", token2); - } - }); - defineFunction({ - type: "internal", - names: ["\\def", "\\gdef", "\\edef", "\\xdef"], - props: { - numArgs: 0, - allowedInText: true, - primitive: true - }, - handler(_ref2) { - var { - parser: parser2, - funcName - } = _ref2; - var tok = parser2.gullet.popToken(); - var name = tok.text; - if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) { - throw new ParseError("Expected a control sequence", tok); - } - var numArgs = 0; - var insert; - var delimiters2 = [[]]; - while (parser2.gullet.future().text !== "{") { - tok = parser2.gullet.popToken(); - if (tok.text === "#") { - if (parser2.gullet.future().text === "{") { - insert = parser2.gullet.future(); - delimiters2[numArgs].push("{"); - break; - } - tok = parser2.gullet.popToken(); - if (!/^[1-9]$/.test(tok.text)) { - throw new ParseError('Invalid argument number "' + tok.text + '"'); - } - if (parseInt(tok.text) !== numArgs + 1) { - throw new ParseError('Argument number "' + tok.text + '" out of order'); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js + function Linear(context) { + this._context = context; + } + function linear_default(context) { + return new Linear(context); + } + var init_linear2 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js"() { + "use strict"; + __name(Linear, "Linear"); + Linear.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x5, y5) : this._context.moveTo(x5, y5); + break; + case 1: + this._point = 2; + default: + this._context.lineTo(x5, y5); + break; } - numArgs++; - delimiters2.push([]); - } else if (tok.text === "EOF") { - throw new ParseError("Expected a macro definition"); - } else { - delimiters2[numArgs].push(tok.text); - } - } - var { - tokens - } = parser2.gullet.consumeArg(); - if (insert) { - tokens.unshift(insert); - } - if (funcName === "\\edef" || funcName === "\\xdef") { - tokens = parser2.gullet.expandTokens(tokens); - tokens.reverse(); - } - parser2.gullet.macros.set(name, { - tokens, - numArgs, - delimiters: delimiters2 - }, funcName === globalMap[funcName]); - return { - type: "internal", - mode: parser2.mode + }, "point") }; + __name(linear_default, "default"); } }); - defineFunction({ - type: "internal", - names: [ - "\\let", - "\\\\globallet" - // can’t be entered directly - ], - props: { - numArgs: 0, - allowedInText: true, - primitive: true - }, - handler(_ref3) { - var { - parser: parser2, - funcName - } = _ref3; - var name = checkControlSequence(parser2.gullet.popToken()); - parser2.gullet.consumeSpaces(); - var tok = getRHS(parser2); - letCommand(parser2, name, tok, funcName === "\\\\globallet"); - return { - type: "internal", - mode: parser2.mode - }; + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js + function x(p3) { + return p3[0]; + } + function y(p3) { + return p3[1]; + } + var init_point = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js"() { + "use strict"; + __name(x, "x"); + __name(y, "y"); } }); - defineFunction({ - type: "internal", - names: [ - "\\futurelet", - "\\\\globalfuture" - // can’t be entered directly - ], - props: { - numArgs: 0, - allowedInText: true, - primitive: true - }, - handler(_ref4) { - var { - parser: parser2, - funcName - } = _ref4; - var name = checkControlSequence(parser2.gullet.popToken()); - var middle = parser2.gullet.popToken(); - var tok = parser2.gullet.popToken(); - letCommand(parser2, name, tok, funcName === "\\\\globalfuture"); - parser2.gullet.pushToken(tok); - parser2.gullet.pushToken(middle); - return { - type: "internal", - mode: parser2.mode - }; + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js + function line_default(x5, y5) { + var defined = constant_default4(true), context = null, curve = linear_default, output2 = null, path4 = withPath(line2); + x5 = typeof x5 === "function" ? x5 : x5 === void 0 ? x : constant_default4(x5); + y5 = typeof y5 === "function" ? y5 : y5 === void 0 ? y : constant_default4(y5); + function line2(data5) { + var i2, n2 = (data5 = array_default(data5)).length, d2, defined0 = false, buffer; + if (context == null) output2 = curve(buffer = path4()); + for (i2 = 0; i2 <= n2; ++i2) { + if (!(i2 < n2 && defined(d2 = data5[i2], i2, data5)) === defined0) { + if (defined0 = !defined0) output2.lineStart(); + else output2.lineEnd(); + } + if (defined0) output2.point(+x5(d2, i2, data5), +y5(d2, i2, data5)); + } + if (buffer) return output2 = null, buffer + "" || null; + } + __name(line2, "line"); + line2.x = function(_2) { + return arguments.length ? (x5 = typeof _2 === "function" ? _2 : constant_default4(+_2), line2) : x5; + }; + line2.y = function(_2) { + return arguments.length ? (y5 = typeof _2 === "function" ? _2 : constant_default4(+_2), line2) : y5; + }; + line2.defined = function(_2) { + return arguments.length ? (defined = typeof _2 === "function" ? _2 : constant_default4(!!_2), line2) : defined; + }; + line2.curve = function(_2) { + return arguments.length ? (curve = _2, context != null && (output2 = curve(context)), line2) : curve; + }; + line2.context = function(_2) { + return arguments.length ? (_2 == null ? context = output2 = null : output2 = curve(context = _2), line2) : context; + }; + return line2; + } + var init_line = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js"() { + "use strict"; + init_array3(); + init_constant5(); + init_linear2(); + init_path2(); + init_point(); + __name(line_default, "default"); } }); - var getMetrics = function getMetrics2(symbol, font, mode) { - var replace2 = symbols.math[symbol] && symbols.math[symbol].replace; - var metrics = getCharacterMetrics(replace2 || symbol, font, mode); - if (!metrics) { - throw new Error("Unsupported symbol " + symbol + " and font size " + font + "."); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/descending.js + function descending_default(a2, b2) { + return b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN; + } + var init_descending2 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/descending.js"() { + "use strict"; + __name(descending_default, "default"); } - return metrics; - }; - var styleWrap = function styleWrap2(delim, toStyle, options2, classes2) { - var newOptions = options2.havingBaseStyle(toStyle); - var span = buildCommon.makeSpan(classes2.concat(newOptions.sizingClasses(options2)), [delim], options2); - var delimSizeMultiplier = newOptions.sizeMultiplier / options2.sizeMultiplier; - span.height *= delimSizeMultiplier; - span.depth *= delimSizeMultiplier; - span.maxFontSize = newOptions.sizeMultiplier; - return span; - }; - var centerSpan = function centerSpan2(span, options2, style) { - var newOptions = options2.havingBaseStyle(style); - var shift = (1 - options2.sizeMultiplier / newOptions.sizeMultiplier) * options2.fontMetrics().axisHeight; - span.classes.push("delimcenter"); - span.style.top = makeEm(shift); - span.height -= shift; - span.depth += shift; - }; - var makeSmallDelim = function makeSmallDelim2(delim, style, center2, options2, mode, classes2) { - var text2 = buildCommon.makeSymbol(delim, "Main-Regular", mode, options2); - var span = styleWrap(text2, style, options2, classes2); - if (center2) { - centerSpan(span, options2, style); + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/identity.js + function identity_default3(d2) { + return d2; + } + var init_identity3 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/identity.js"() { + "use strict"; + __name(identity_default3, "default"); } - return span; - }; - var mathrmSize = function mathrmSize2(value2, size2, mode, options2) { - return buildCommon.makeSymbol(value2, "Size" + size2 + "-Regular", mode, options2); - }; - var makeLargeDelim = function makeLargeDelim2(delim, size2, center2, options2, mode, classes2) { - var inner2 = mathrmSize(delim, size2, mode, options2); - var span = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + size2], [inner2], options2), Style$1.TEXT, options2, classes2); - if (center2) { - centerSpan(span, options2, Style$1.TEXT); - } - return span; - }; - var makeGlyphSpan = function makeGlyphSpan2(symbol, font, mode) { - var sizeClass; - if (font === "Size1-Regular") { - sizeClass = "delim-size1"; - } else { - sizeClass = "delim-size4"; + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/pie.js + function pie_default() { + var value2 = identity_default3, sortValues = descending_default, sort3 = null, startAngle = constant_default4(0), endAngle = constant_default4(tau2), padAngle = constant_default4(0); + function pie2(data5) { + var i2, n2 = (data5 = array_default(data5)).length, j2, k2, sum2 = 0, index = new Array(n2), arcs = new Array(n2), a0 = +startAngle.apply(this, arguments), da = Math.min(tau2, Math.max(-tau2, endAngle.apply(this, arguments) - a0)), a1, p3 = Math.min(Math.abs(da) / n2, padAngle.apply(this, arguments)), pa = p3 * (da < 0 ? -1 : 1), v3; + for (i2 = 0; i2 < n2; ++i2) { + if ((v3 = arcs[index[i2] = i2] = +value2(data5[i2], i2, data5)) > 0) { + sum2 += v3; + } + } + if (sortValues != null) index.sort(function(i3, j3) { + return sortValues(arcs[i3], arcs[j3]); + }); + else if (sort3 != null) index.sort(function(i3, j3) { + return sort3(data5[i3], data5[j3]); + }); + for (i2 = 0, k2 = sum2 ? (da - n2 * pa) / sum2 : 0; i2 < n2; ++i2, a0 = a1) { + j2 = index[i2], v3 = arcs[j2], a1 = a0 + (v3 > 0 ? v3 * k2 : 0) + pa, arcs[j2] = { + data: data5[j2], + index: i2, + value: v3, + startAngle: a0, + endAngle: a1, + padAngle: p3 + }; + } + return arcs; } - var corner = buildCommon.makeSpan(["delimsizinginner", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]); - return { - type: "elem", - elem: corner + __name(pie2, "pie"); + pie2.value = function(_2) { + return arguments.length ? (value2 = typeof _2 === "function" ? _2 : constant_default4(+_2), pie2) : value2; }; - }; - var makeInner = function makeInner2(ch2, height, options2) { - var width2 = fontMetricsData["Size4-Regular"][ch2.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][ch2.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][ch2.charCodeAt(0)][4]; - var path2 = new PathNode("inner", innerPath(ch2, Math.round(1e3 * height))); - var svgNode2 = new SvgNode([path2], { - "width": makeEm(width2), - "height": makeEm(height), - // Override CSS rule `.katex svg { width: 100% }` - "style": "width:" + makeEm(width2), - "viewBox": "0 0 " + 1e3 * width2 + " " + Math.round(1e3 * height), - "preserveAspectRatio": "xMinYMin" - }); - var span = buildCommon.makeSvgSpan([], [svgNode2], options2); - span.height = height; - span.style.height = makeEm(height); - span.style.width = makeEm(width2); - return { - type: "elem", - elem: span + pie2.sortValues = function(_2) { + return arguments.length ? (sortValues = _2, sort3 = null, pie2) : sortValues; }; - }; - var lapInEms = 8e-3; - var lap = { - type: "kern", - size: -1 * lapInEms - }; - var verts = ["|", "\\lvert", "\\rvert", "\\vert"]; - var doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"]; - var makeStackedDelim = function makeStackedDelim2(delim, heightTotal, center2, options2, mode, classes2) { - var top2; - var middle; - var repeat2; - var bottom2; - var svgLabel = ""; - var viewBoxWidth = 0; - top2 = repeat2 = bottom2 = delim; - middle = null; - var font = "Size1-Regular"; - if (delim === "\\uparrow") { - repeat2 = bottom2 = "⏐"; - } else if (delim === "\\Uparrow") { - repeat2 = bottom2 = "‖"; - } else if (delim === "\\downarrow") { - top2 = repeat2 = "⏐"; - } else if (delim === "\\Downarrow") { - top2 = repeat2 = "‖"; - } else if (delim === "\\updownarrow") { - top2 = "\\uparrow"; - repeat2 = "⏐"; - bottom2 = "\\downarrow"; - } else if (delim === "\\Updownarrow") { - top2 = "\\Uparrow"; - repeat2 = "‖"; - bottom2 = "\\Downarrow"; - } else if (utils.contains(verts, delim)) { - repeat2 = "∣"; - svgLabel = "vert"; - viewBoxWidth = 333; - } else if (utils.contains(doubleVerts, delim)) { - repeat2 = "∥"; - svgLabel = "doublevert"; - viewBoxWidth = 556; - } else if (delim === "[" || delim === "\\lbrack") { - top2 = "⎡"; - repeat2 = "⎢"; - bottom2 = "⎣"; - font = "Size4-Regular"; - svgLabel = "lbrack"; - viewBoxWidth = 667; - } else if (delim === "]" || delim === "\\rbrack") { - top2 = "⎤"; - repeat2 = "⎥"; - bottom2 = "⎦"; - font = "Size4-Regular"; - svgLabel = "rbrack"; - viewBoxWidth = 667; - } else if (delim === "\\lfloor" || delim === "⌊") { - repeat2 = top2 = "⎢"; - bottom2 = "⎣"; - font = "Size4-Regular"; - svgLabel = "lfloor"; - viewBoxWidth = 667; - } else if (delim === "\\lceil" || delim === "⌈") { - top2 = "⎡"; - repeat2 = bottom2 = "⎢"; - font = "Size4-Regular"; - svgLabel = "lceil"; - viewBoxWidth = 667; - } else if (delim === "\\rfloor" || delim === "⌋") { - repeat2 = top2 = "⎥"; - bottom2 = "⎦"; - font = "Size4-Regular"; - svgLabel = "rfloor"; - viewBoxWidth = 667; - } else if (delim === "\\rceil" || delim === "⌉") { - top2 = "⎤"; - repeat2 = bottom2 = "⎥"; - font = "Size4-Regular"; - svgLabel = "rceil"; - viewBoxWidth = 667; - } else if (delim === "(" || delim === "\\lparen") { - top2 = "⎛"; - repeat2 = "⎜"; - bottom2 = "⎝"; - font = "Size4-Regular"; - svgLabel = "lparen"; - viewBoxWidth = 875; - } else if (delim === ")" || delim === "\\rparen") { - top2 = "⎞"; - repeat2 = "⎟"; - bottom2 = "⎠"; - font = "Size4-Regular"; - svgLabel = "rparen"; - viewBoxWidth = 875; - } else if (delim === "\\{" || delim === "\\lbrace") { - top2 = "⎧"; - middle = "⎨"; - bottom2 = "⎩"; - repeat2 = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\}" || delim === "\\rbrace") { - top2 = "⎫"; - middle = "⎬"; - bottom2 = "⎭"; - repeat2 = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\lgroup" || delim === "⟮") { - top2 = "⎧"; - bottom2 = "⎩"; - repeat2 = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\rgroup" || delim === "⟯") { - top2 = "⎫"; - bottom2 = "⎭"; - repeat2 = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\lmoustache" || delim === "⎰") { - top2 = "⎧"; - bottom2 = "⎭"; - repeat2 = "⎪"; - font = "Size4-Regular"; - } else if (delim === "\\rmoustache" || delim === "⎱") { - top2 = "⎫"; - bottom2 = "⎩"; - repeat2 = "⎪"; - font = "Size4-Regular"; - } - var topMetrics = getMetrics(top2, font, mode); - var topHeightTotal = topMetrics.height + topMetrics.depth; - var repeatMetrics = getMetrics(repeat2, font, mode); - var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth; - var bottomMetrics = getMetrics(bottom2, font, mode); - var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth; - var middleHeightTotal = 0; - var middleFactor = 1; - if (middle !== null) { - var middleMetrics = getMetrics(middle, font, mode); - middleHeightTotal = middleMetrics.height + middleMetrics.depth; - middleFactor = 2; - } - var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal; - var repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal))); - var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal; - var axisHeight = options2.fontMetrics().axisHeight; - if (center2) { - axisHeight *= options2.sizeMultiplier; - } - var depth = realHeightTotal / 2 - axisHeight; - var stack = []; - if (svgLabel.length > 0) { - var midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal; - var viewBoxHeight = Math.round(realHeightTotal * 1e3); - var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1e3)); - var path2 = new PathNode(svgLabel, pathStr); - var width2 = (viewBoxWidth / 1e3).toFixed(3) + "em"; - var height = (viewBoxHeight / 1e3).toFixed(3) + "em"; - var svg2 = new SvgNode([path2], { - "width": width2, - "height": height, - "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight - }); - var wrapper = buildCommon.makeSvgSpan([], [svg2], options2); - wrapper.height = viewBoxHeight / 1e3; - wrapper.style.width = width2; - wrapper.style.height = height; - stack.push({ - type: "elem", - elem: wrapper - }); - } else { - stack.push(makeGlyphSpan(bottom2, font, mode)); - stack.push(lap); - if (middle === null) { - var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms; - stack.push(makeInner(repeat2, innerHeight, options2)); - } else { - var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms; - stack.push(makeInner(repeat2, _innerHeight, options2)); - stack.push(lap); - stack.push(makeGlyphSpan(middle, font, mode)); - stack.push(lap); - stack.push(makeInner(repeat2, _innerHeight, options2)); - } - stack.push(lap); - stack.push(makeGlyphSpan(top2, font, mode)); - } - var newOptions = options2.havingBaseStyle(Style$1.TEXT); - var inner2 = buildCommon.makeVList({ - positionType: "bottom", - positionData: depth, - children: stack - }, newOptions); - return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [inner2], newOptions), Style$1.TEXT, options2, classes2); - }; - var vbPad = 80; - var emPad = 0.08; - var sqrtSvg = function sqrtSvg2(sqrtName, height, viewBoxHeight, extraVinculum, options2) { - var path2 = sqrtPath(sqrtName, extraVinculum, viewBoxHeight); - var pathNode = new PathNode(sqrtName, path2); - var svg2 = new SvgNode([pathNode], { - // Note: 1000:1 ratio of viewBox to document em width. - "width": "400em", - "height": makeEm(height), - "viewBox": "0 0 400000 " + viewBoxHeight, - "preserveAspectRatio": "xMinYMin slice" - }); - return buildCommon.makeSvgSpan(["hide-tail"], [svg2], options2); - }; - var makeSqrtImage = function makeSqrtImage2(height, options2) { - var newOptions = options2.havingBaseSizing(); - var delim = traverseSequence("\\surd", height * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions); - var sizeMultiplier = newOptions.sizeMultiplier; - var extraVinculum = Math.max(0, options2.minRuleThickness - options2.fontMetrics().sqrtRuleThickness); - var span; - var spanHeight = 0; - var texHeight = 0; - var viewBoxHeight = 0; - var advanceWidth; - if (delim.type === "small") { - viewBoxHeight = 1e3 + 1e3 * extraVinculum + vbPad; - if (height < 1) { - sizeMultiplier = 1; - } else if (height < 1.4) { - sizeMultiplier = 0.7; - } - spanHeight = (1 + extraVinculum + emPad) / sizeMultiplier; - texHeight = (1 + extraVinculum) / sizeMultiplier; - span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum, options2); - span.style.minWidth = "0.853em"; - advanceWidth = 0.833 / sizeMultiplier; - } else if (delim.type === "large") { - viewBoxHeight = (1e3 + vbPad) * sizeToMaxHeight[delim.size]; - texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier; - spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad) / sizeMultiplier; - span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight, extraVinculum, options2); - span.style.minWidth = "1.02em"; - advanceWidth = 1 / sizeMultiplier; - } else { - spanHeight = height + extraVinculum + emPad; - texHeight = height + extraVinculum; - viewBoxHeight = Math.floor(1e3 * height + extraVinculum) + vbPad; - span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum, options2); - span.style.minWidth = "0.742em"; - advanceWidth = 1.056; - } - span.height = texHeight; - span.style.height = makeEm(spanHeight); - return { - span, - advanceWidth, - // Calculate the actual line width. - // This actually should depend on the chosen font -- e.g. \boldmath - // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and - // have thicker rules. - ruleWidth: (options2.fontMetrics().sqrtRuleThickness + extraVinculum) * sizeMultiplier + pie2.sort = function(_2) { + return arguments.length ? (sort3 = _2, sortValues = null, pie2) : sort3; }; - }; - var stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"]; - var stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"]; - var stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"]; - var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3]; - var makeSizedDelim = function makeSizedDelim2(delim, size2, options2, mode, classes2) { - if (delim === "<" || delim === "\\lt" || delim === "⟨") { - delim = "\\langle"; - } else if (delim === ">" || delim === "\\gt" || delim === "⟩") { - delim = "\\rangle"; - } - if (utils.contains(stackLargeDelimiters, delim) || utils.contains(stackNeverDelimiters, delim)) { - return makeLargeDelim(delim, size2, false, options2, mode, classes2); - } else if (utils.contains(stackAlwaysDelimiters, delim)) { - return makeStackedDelim(delim, sizeToMaxHeight[size2], false, options2, mode, classes2); - } else { - throw new ParseError("Illegal delimiter: '" + delim + "'"); - } - }; - var stackNeverDelimiterSequence = [{ - type: "small", - style: Style$1.SCRIPTSCRIPT - }, { - type: "small", - style: Style$1.SCRIPT - }, { - type: "small", - style: Style$1.TEXT - }, { - type: "large", - size: 1 - }, { - type: "large", - size: 2 - }, { - type: "large", - size: 3 - }, { - type: "large", - size: 4 - }]; - var stackAlwaysDelimiterSequence = [{ - type: "small", - style: Style$1.SCRIPTSCRIPT - }, { - type: "small", - style: Style$1.SCRIPT - }, { - type: "small", - style: Style$1.TEXT - }, { - type: "stack" - }]; - var stackLargeDelimiterSequence = [{ - type: "small", - style: Style$1.SCRIPTSCRIPT - }, { - type: "small", - style: Style$1.SCRIPT - }, { - type: "small", - style: Style$1.TEXT - }, { - type: "large", - size: 1 - }, { - type: "large", - size: 2 - }, { - type: "large", - size: 3 - }, { - type: "large", - size: 4 - }, { - type: "stack" - }]; - var delimTypeToFont = function delimTypeToFont2(type2) { - if (type2.type === "small") { - return "Main-Regular"; - } else if (type2.type === "large") { - return "Size" + type2.size + "-Regular"; - } else if (type2.type === "stack") { - return "Size4-Regular"; - } else { - throw new Error("Add support for delim type '" + type2.type + "' here."); - } - }; - var traverseSequence = function traverseSequence2(delim, height, sequence2, options2) { - var start2 = Math.min(2, 3 - options2.style.size); - for (var i2 = start2; i2 < sequence2.length; i2++) { - if (sequence2[i2].type === "stack") { - break; - } - var metrics = getMetrics(delim, delimTypeToFont(sequence2[i2]), "math"); - var heightDepth = metrics.height + metrics.depth; - if (sequence2[i2].type === "small") { - var newOptions = options2.havingBaseStyle(sequence2[i2].style); - heightDepth *= newOptions.sizeMultiplier; - } - if (heightDepth > height) { - return sequence2[i2]; - } + pie2.startAngle = function(_2) { + return arguments.length ? (startAngle = typeof _2 === "function" ? _2 : constant_default4(+_2), pie2) : startAngle; + }; + pie2.endAngle = function(_2) { + return arguments.length ? (endAngle = typeof _2 === "function" ? _2 : constant_default4(+_2), pie2) : endAngle; + }; + pie2.padAngle = function(_2) { + return arguments.length ? (padAngle = typeof _2 === "function" ? _2 : constant_default4(+_2), pie2) : padAngle; + }; + return pie2; + } + var init_pie = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/pie.js"() { + "use strict"; + init_array3(); + init_constant5(); + init_descending2(); + init_identity3(); + init_math2(); + __name(pie_default, "default"); } - return sequence2[sequence2.length - 1]; - }; - var makeCustomSizedDelim = function makeCustomSizedDelim2(delim, height, center2, options2, mode, classes2) { - if (delim === "<" || delim === "\\lt" || delim === "⟨") { - delim = "\\langle"; - } else if (delim === ">" || delim === "\\gt" || delim === "⟩") { - delim = "\\rangle"; - } - var sequence2; - if (utils.contains(stackNeverDelimiters, delim)) { - sequence2 = stackNeverDelimiterSequence; - } else if (utils.contains(stackLargeDelimiters, delim)) { - sequence2 = stackLargeDelimiterSequence; - } else { - sequence2 = stackAlwaysDelimiterSequence; + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bump.js + function bumpX(context) { + return new Bump(context, true); + } + function bumpY(context) { + return new Bump(context, false); + } + var Bump; + var init_bump = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bump.js"() { + "use strict"; + Bump = class { + static { + __name(this, "Bump"); + } + constructor(context, x5) { + this._context = context; + this._x = x5; + } + areaStart() { + this._line = 0; + } + areaEnd() { + this._line = NaN; + } + lineStart() { + this._point = 0; + } + lineEnd() { + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + } + point(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: { + this._point = 1; + if (this._line) this._context.lineTo(x5, y5); + else this._context.moveTo(x5, y5); + break; + } + case 1: + this._point = 2; + default: { + if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x5) / 2, this._y0, this._x0, y5, x5, y5); + else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y5) / 2, x5, this._y0, x5, y5); + break; + } + } + this._x0 = x5, this._y0 = y5; + } + }; + __name(bumpX, "bumpX"); + __name(bumpY, "bumpY"); } - var delimType = traverseSequence(delim, height, sequence2, options2); - if (delimType.type === "small") { - return makeSmallDelim(delim, delimType.style, center2, options2, mode, classes2); - } else if (delimType.type === "large") { - return makeLargeDelim(delim, delimType.size, center2, options2, mode, classes2); - } else { - return makeStackedDelim(delim, height, center2, options2, mode, classes2); + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/noop.js + function noop_default() { + } + var init_noop = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/noop.js"() { + "use strict"; + __name(noop_default, "default"); } - }; - var makeLeftRightDelim = function makeLeftRightDelim2(delim, height, depth, options2, mode, classes2) { - var axisHeight = options2.fontMetrics().axisHeight * options2.sizeMultiplier; - var delimiterFactor = 901; - var delimiterExtend = 5 / options2.fontMetrics().ptPerEm; - var maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight); - var totalHeight = Math.max( - // In real TeX, calculations are done using integral values which are - // 65536 per pt, or 655360 per em. So, the division here truncates in - // TeX but doesn't here, producing different results. If we wanted to - // exactly match TeX's calculation, we could do - // Math.floor(655360 * maxDistFromAxis / 500) * - // delimiterFactor / 655360 - // (To see the difference, compare - // x^{x^{\left(\rule{0.1em}{0.68em}\right)}} - // in TeX and KaTeX) - maxDistFromAxis / 500 * delimiterFactor, - 2 * maxDistFromAxis - delimiterExtend + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basis.js + function point2(that, x5, y5) { + that._context.bezierCurveTo( + (2 * that._x0 + that._x1) / 3, + (2 * that._y0 + that._y1) / 3, + (that._x0 + 2 * that._x1) / 3, + (that._y0 + 2 * that._y1) / 3, + (that._x0 + 4 * that._x1 + x5) / 6, + (that._y0 + 4 * that._y1 + y5) / 6 ); - return makeCustomSizedDelim(delim, totalHeight, true, options2, mode, classes2); - }; - var delimiter = { - sqrtImage: makeSqrtImage, - sizedDelim: makeSizedDelim, - sizeToMaxHeight, - customSizedDelim: makeCustomSizedDelim, - leftRightDelim: makeLeftRightDelim - }; - var delimiterSizes = { - "\\bigl": { - mclass: "mopen", - size: 1 - }, - "\\Bigl": { - mclass: "mopen", - size: 2 - }, - "\\biggl": { - mclass: "mopen", - size: 3 - }, - "\\Biggl": { - mclass: "mopen", - size: 4 - }, - "\\bigr": { - mclass: "mclose", - size: 1 - }, - "\\Bigr": { - mclass: "mclose", - size: 2 - }, - "\\biggr": { - mclass: "mclose", - size: 3 - }, - "\\Biggr": { - mclass: "mclose", - size: 4 - }, - "\\bigm": { - mclass: "mrel", - size: 1 - }, - "\\Bigm": { - mclass: "mrel", - size: 2 - }, - "\\biggm": { - mclass: "mrel", - size: 3 - }, - "\\Biggm": { - mclass: "mrel", - size: 4 - }, - "\\big": { - mclass: "mord", - size: 1 - }, - "\\Big": { - mclass: "mord", - size: 2 - }, - "\\bigg": { - mclass: "mord", - size: 3 - }, - "\\Bigg": { - mclass: "mord", - size: 4 - } - }; - var delimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "<", ">", "\\langle", "⟨", "\\rangle", "⟩", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]; - function checkDelimiter(delim, context) { - var symDelim = checkSymbolNodeType(delim); - if (symDelim && utils.contains(delimiters, symDelim.text)) { - return symDelim; - } else if (symDelim) { - throw new ParseError("Invalid delimiter '" + symDelim.text + "' after '" + context.funcName + "'", delim); - } else { - throw new ParseError("Invalid delimiter type '" + delim.type + "'", delim); - } } - defineFunction({ - type: "delimsizing", - names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"], - props: { - numArgs: 1, - argTypes: ["primitive"] - }, - handler: (context, args) => { - var delim = checkDelimiter(args[0], context); - return { - type: "delimsizing", - mode: context.parser.mode, - size: delimiterSizes[context.funcName].size, - mclass: delimiterSizes[context.funcName].mclass, - delim: delim.text + function Basis(context) { + this._context = context; + } + function basis_default2(context) { + return new Basis(context); + } + var init_basis2 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basis.js"() { + "use strict"; + __name(point2, "point"); + __name(Basis, "Basis"); + Basis.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._y0 = this._y1 = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + switch (this._point) { + case 3: + point2(this, this._x1, this._y1); + case 2: + this._context.lineTo(this._x1, this._y1); + break; + } + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x5, y5) : this._context.moveTo(x5, y5); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); + default: + point2(this, x5, y5); + break; + } + this._x0 = this._x1, this._x1 = x5; + this._y0 = this._y1, this._y1 = y5; + }, "point") }; - }, - htmlBuilder: (group, options2) => { - if (group.delim === ".") { - return buildCommon.makeSpan([group.mclass]); - } - return delimiter.sizedDelim(group.delim, group.size, options2, group.mode, [group.mclass]); - }, - mathmlBuilder: (group) => { - var children2 = []; - if (group.delim !== ".") { - children2.push(makeText(group.delim, group.mode)); - } - var node2 = new mathMLTree.MathNode("mo", children2); - if (group.mclass === "mopen" || group.mclass === "mclose") { - node2.setAttribute("fence", "true"); - } else { - node2.setAttribute("fence", "false"); - } - node2.setAttribute("stretchy", "true"); - var size2 = makeEm(delimiter.sizeToMaxHeight[group.size]); - node2.setAttribute("minsize", size2); - node2.setAttribute("maxsize", size2); - return node2; + __name(basis_default2, "default"); } }); - function assertParsed(group) { - if (!group.body) { - throw new Error("Bug: The leftright ParseNode wasn't fully parsed."); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisClosed.js + function BasisClosed(context) { + this._context = context; + } + function basisClosed_default2(context) { + return new BasisClosed(context); + } + var init_basisClosed2 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisClosed.js"() { + "use strict"; + init_noop(); + init_basis2(); + __name(BasisClosed, "BasisClosed"); + BasisClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x2, this._y2); + this._context.closePath(); + break; + } + case 2: { + this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); + this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x2, this._y2); + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + break; + } + } + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + this._x2 = x5, this._y2 = y5; + break; + case 1: + this._point = 2; + this._x3 = x5, this._y3 = y5; + break; + case 2: + this._point = 3; + this._x4 = x5, this._y4 = y5; + this._context.moveTo((this._x0 + 4 * this._x1 + x5) / 6, (this._y0 + 4 * this._y1 + y5) / 6); + break; + default: + point2(this, x5, y5); + break; + } + this._x0 = this._x1, this._x1 = x5; + this._y0 = this._y1, this._y1 = y5; + }, "point") + }; + __name(basisClosed_default2, "default"); } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisOpen.js + function BasisOpen(context) { + this._context = context; } - defineFunction({ - type: "leftright-right", - names: ["\\right"], - props: { - numArgs: 1, - primitive: true - }, - handler: (context, args) => { - var color2 = context.parser.gullet.macros.get("\\current@color"); - if (color2 && typeof color2 !== "string") { - throw new ParseError("\\current@color set to non-string in \\right"); - } - return { - type: "leftright-right", - mode: context.parser.mode, - delim: checkDelimiter(args[0], context).text, - color: color2 - // undefined if not set via \color + function basisOpen_default(context) { + return new BasisOpen(context); + } + var init_basisOpen = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/basisOpen.js"() { + "use strict"; + init_basis2(); + __name(BasisOpen, "BasisOpen"); + BasisOpen.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._y0 = this._y1 = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + var x0 = (this._x0 + 4 * this._x1 + x5) / 6, y0 = (this._y0 + 4 * this._y1 + y5) / 6; + this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); + break; + case 3: + this._point = 4; + default: + point2(this, x5, y5); + break; + } + this._x0 = this._x1, this._x1 = x5; + this._y0 = this._y1, this._y1 = y5; + }, "point") }; + __name(basisOpen_default, "default"); } }); - defineFunction({ - type: "leftright", - names: ["\\left"], - props: { - numArgs: 1, - primitive: true - }, - handler: (context, args) => { - var delim = checkDelimiter(args[0], context); - var parser2 = context.parser; - ++parser2.leftrightDepth; - var body = parser2.parseExpression(false); - --parser2.leftrightDepth; - parser2.expect("\\right", false); - var right2 = assertNodeType(parser2.parseFunction(), "leftright-right"); - return { - type: "leftright", - mode: parser2.mode, - body, - left: delim.text, - right: right2.delim, - rightColor: right2.color + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bundle.js + function Bundle(context, beta) { + this._basis = new Basis(context); + this._beta = beta; + } + var bundle_default; + var init_bundle = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/bundle.js"() { + "use strict"; + init_basis2(); + __name(Bundle, "Bundle"); + Bundle.prototype = { + lineStart: /* @__PURE__ */ __name(function() { + this._x = []; + this._y = []; + this._basis.lineStart(); + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + var x5 = this._x, y5 = this._y, j2 = x5.length - 1; + if (j2 > 0) { + var x0 = x5[0], y0 = y5[0], dx = x5[j2] - x0, dy = y5[j2] - y0, i2 = -1, t4; + while (++i2 <= j2) { + t4 = i2 / j2; + this._basis.point( + this._beta * x5[i2] + (1 - this._beta) * (x0 + t4 * dx), + this._beta * y5[i2] + (1 - this._beta) * (y0 + t4 * dy) + ); + } + } + this._x = this._y = null; + this._basis.lineEnd(); + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + this._x.push(+x5); + this._y.push(+y5); + }, "point") }; - }, - htmlBuilder: (group, options2) => { - assertParsed(group); - var inner2 = buildExpression$1(group.body, options2, true, ["mopen", "mclose"]); - var innerHeight = 0; - var innerDepth = 0; - var hadMiddle = false; - for (var i2 = 0; i2 < inner2.length; i2++) { - if (inner2[i2].isMiddle) { - hadMiddle = true; - } else { - innerHeight = Math.max(inner2[i2].height, innerHeight); - innerDepth = Math.max(inner2[i2].depth, innerDepth); + bundle_default = (/* @__PURE__ */ __name(function custom(beta) { + function bundle(context) { + return beta === 1 ? new Basis(context) : new Bundle(context, beta); } - } - innerHeight *= options2.sizeMultiplier; - innerDepth *= options2.sizeMultiplier; - var leftDelim; - if (group.left === ".") { - leftDelim = makeNullDelimiter(options2, ["mopen"]); - } else { - leftDelim = delimiter.leftRightDelim(group.left, innerHeight, innerDepth, options2, group.mode, ["mopen"]); - } - inner2.unshift(leftDelim); - if (hadMiddle) { - for (var _i6 = 1; _i6 < inner2.length; _i6++) { - var middleDelim = inner2[_i6]; - var isMiddle = middleDelim.isMiddle; - if (isMiddle) { - inner2[_i6] = delimiter.leftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group.mode, []); + __name(bundle, "bundle"); + bundle.beta = function(beta2) { + return custom(+beta2); + }; + return bundle; + }, "custom"))(0.85); + } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinal.js + function point3(that, x5, y5) { + that._context.bezierCurveTo( + that._x1 + that._k * (that._x2 - that._x0), + that._y1 + that._k * (that._y2 - that._y0), + that._x2 + that._k * (that._x1 - x5), + that._y2 + that._k * (that._y1 - y5), + that._x2, + that._y2 + ); + } + function Cardinal(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; + } + var cardinal_default; + var init_cardinal = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinal.js"() { + "use strict"; + __name(point3, "point"); + __name(Cardinal, "Cardinal"); + Cardinal.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + point3(this, this._x1, this._y1); + break; } - } - } - var rightDelim; - if (group.right === ".") { - rightDelim = makeNullDelimiter(options2, ["mclose"]); - } else { - var colorOptions = group.rightColor ? options2.withColor(group.rightColor) : options2; - rightDelim = delimiter.leftRightDelim(group.right, innerHeight, innerDepth, colorOptions, group.mode, ["mclose"]); - } - inner2.push(rightDelim); - return buildCommon.makeSpan(["minner"], inner2, options2); - }, - mathmlBuilder: (group, options2) => { - assertParsed(group); - var inner2 = buildExpression(group.body, options2); - if (group.left !== ".") { - var leftNode = new mathMLTree.MathNode("mo", [makeText(group.left, group.mode)]); - leftNode.setAttribute("fence", "true"); - inner2.unshift(leftNode); - } - if (group.right !== ".") { - var rightNode = new mathMLTree.MathNode("mo", [makeText(group.right, group.mode)]); - rightNode.setAttribute("fence", "true"); - if (group.rightColor) { - rightNode.setAttribute("mathcolor", group.rightColor); - } - inner2.push(rightNode); - } - return makeRow(inner2); - } - }); - defineFunction({ - type: "middle", - names: ["\\middle"], - props: { - numArgs: 1, - primitive: true - }, - handler: (context, args) => { - var delim = checkDelimiter(args[0], context); - if (!context.parser.leftrightDepth) { - throw new ParseError("\\middle without preceding \\left", delim); - } - return { - type: "middle", - mode: context.parser.mode, - delim: delim.text + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x5, y5) : this._context.moveTo(x5, y5); + break; + case 1: + this._point = 2; + this._x1 = x5, this._y1 = y5; + break; + case 2: + this._point = 3; + default: + point3(this, x5, y5); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y5; + }, "point") }; - }, - htmlBuilder: (group, options2) => { - var middleDelim; - if (group.delim === ".") { - middleDelim = makeNullDelimiter(options2, []); - } else { - middleDelim = delimiter.sizedDelim(group.delim, 1, options2, group.mode, []); - var isMiddle = { - delim: group.delim, - options: options2 - }; - middleDelim.isMiddle = isMiddle; - } - return middleDelim; - }, - mathmlBuilder: (group, options2) => { - var textNode = group.delim === "\\vert" || group.delim === "|" ? makeText("|", "text") : makeText(group.delim, group.mode); - var middleNode = new mathMLTree.MathNode("mo", [textNode]); - middleNode.setAttribute("fence", "true"); - middleNode.setAttribute("lspace", "0.05em"); - middleNode.setAttribute("rspace", "0.05em"); - return middleNode; - } - }); - var htmlBuilder$7 = (group, options2) => { - var inner2 = buildCommon.wrapFragment(buildGroup$1(group.body, options2), options2); - var label = group.label.slice(1); - var scale = options2.sizeMultiplier; - var img; - var imgShift = 0; - var isSingleChar = utils.isCharacterBox(group.body); - if (label === "sout") { - img = buildCommon.makeSpan(["stretchy", "sout"]); - img.height = options2.fontMetrics().defaultRuleThickness / scale; - imgShift = -0.5 * options2.fontMetrics().xHeight; - } else if (label === "phase") { - var lineWeight = calculateSize({ - number: 0.6, - unit: "pt" - }, options2); - var clearance = calculateSize({ - number: 0.35, - unit: "ex" - }, options2); - var newOptions = options2.havingBaseSizing(); - scale = scale / newOptions.sizeMultiplier; - var angleHeight = inner2.height + inner2.depth + lineWeight + clearance; - inner2.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight); - var viewBoxHeight = Math.floor(1e3 * angleHeight * scale); - var path2 = phasePath(viewBoxHeight); - var svgNode2 = new SvgNode([new PathNode("phase", path2)], { - "width": "400em", - "height": makeEm(viewBoxHeight / 1e3), - "viewBox": "0 0 400000 " + viewBoxHeight, - "preserveAspectRatio": "xMinYMin slice" - }); - img = buildCommon.makeSvgSpan(["hide-tail"], [svgNode2], options2); - img.style.height = makeEm(angleHeight); - imgShift = inner2.depth + lineWeight + clearance; - } else { - if (/cancel/.test(label)) { - if (!isSingleChar) { - inner2.classes.push("cancel-pad"); + cardinal_default = (/* @__PURE__ */ __name(function custom2(tension) { + function cardinal(context) { + return new Cardinal(context, tension); } - } else if (label === "angl") { - inner2.classes.push("anglpad"); - } else { - inner2.classes.push("boxpad"); - } - var topPad = 0; - var bottomPad = 0; - var ruleThickness = 0; - if (/box/.test(label)) { - ruleThickness = Math.max( - options2.fontMetrics().fboxrule, - // default - options2.minRuleThickness - // User override. - ); - topPad = options2.fontMetrics().fboxsep + (label === "colorbox" ? 0 : ruleThickness); - bottomPad = topPad; - } else if (label === "angl") { - ruleThickness = Math.max(options2.fontMetrics().defaultRuleThickness, options2.minRuleThickness); - topPad = 4 * ruleThickness; - bottomPad = Math.max(0, 0.25 - inner2.depth); - } else { - topPad = isSingleChar ? 0.2 : 0; - bottomPad = topPad; - } - img = stretchy.encloseSpan(inner2, label, topPad, bottomPad, options2); - if (/fbox|boxed|fcolorbox/.test(label)) { - img.style.borderStyle = "solid"; - img.style.borderWidth = makeEm(ruleThickness); - } else if (label === "angl" && ruleThickness !== 0.049) { - img.style.borderTopWidth = makeEm(ruleThickness); - img.style.borderRightWidth = makeEm(ruleThickness); - } - imgShift = inner2.depth + bottomPad; - if (group.backgroundColor) { - img.style.backgroundColor = group.backgroundColor; - if (group.borderColor) { - img.style.borderColor = group.borderColor; - } - } - } - var vlist; - if (group.backgroundColor) { - vlist = buildCommon.makeVList({ - positionType: "individualShift", - children: [ - // Put the color background behind inner; - { - type: "elem", - elem: img, - shift: imgShift - }, - { - type: "elem", - elem: inner2, - shift: 0 + __name(cardinal, "cardinal"); + cardinal.tension = function(tension2) { + return custom2(+tension2); + }; + return cardinal; + }, "custom"))(0); + } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalClosed.js + function CardinalClosed(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; + } + var cardinalClosed_default; + var init_cardinalClosed = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalClosed.js"() { + "use strict"; + init_noop(); + init_cardinal(); + __name(CardinalClosed, "CardinalClosed"); + CardinalClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + this.point(this._x5, this._y5); + break; + } } - ] - }, options2); - } else { - var classes2 = /cancel|phase/.test(label) ? ["svg-align"] : []; - vlist = buildCommon.makeVList({ - positionType: "individualShift", - children: [ - // Write the \cancel stroke on top of inner. - { - type: "elem", - elem: inner2, - shift: 0 - }, - { - type: "elem", - elem: img, - shift: imgShift, - wrapperClasses: classes2 + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + this._x3 = x5, this._y3 = y5; + break; + case 1: + this._point = 2; + this._context.moveTo(this._x4 = x5, this._y4 = y5); + break; + case 2: + this._point = 3; + this._x5 = x5, this._y5 = y5; + break; + default: + point3(this, x5, y5); + break; } - ] - }, options2); - } - if (/cancel/.test(label)) { - vlist.height = inner2.height; - vlist.depth = inner2.depth; - } - if (/cancel/.test(label) && !isSingleChar) { - return buildCommon.makeSpan(["mord", "cancel-lap"], [vlist], options2); - } else { - return buildCommon.makeSpan(["mord"], [vlist], options2); + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y5; + }, "point") + }; + cardinalClosed_default = (/* @__PURE__ */ __name(function custom3(tension) { + function cardinal(context) { + return new CardinalClosed(context, tension); + } + __name(cardinal, "cardinal"); + cardinal.tension = function(tension2) { + return custom3(+tension2); + }; + return cardinal; + }, "custom"))(0); } - }; - var mathmlBuilder$6 = (group, options2) => { - var fboxsep = 0; - var node2 = new mathMLTree.MathNode(group.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup(group.body, options2)]); - switch (group.label) { - case "\\cancel": - node2.setAttribute("notation", "updiagonalstrike"); - break; - case "\\bcancel": - node2.setAttribute("notation", "downdiagonalstrike"); - break; - case "\\phase": - node2.setAttribute("notation", "phasorangle"); - break; - case "\\sout": - node2.setAttribute("notation", "horizontalstrike"); - break; - case "\\fbox": - node2.setAttribute("notation", "box"); - break; - case "\\angl": - node2.setAttribute("notation", "actuarial"); - break; - case "\\fcolorbox": - case "\\colorbox": - fboxsep = options2.fontMetrics().fboxsep * options2.fontMetrics().ptPerEm; - node2.setAttribute("width", "+" + 2 * fboxsep + "pt"); - node2.setAttribute("height", "+" + 2 * fboxsep + "pt"); - node2.setAttribute("lspace", fboxsep + "pt"); - node2.setAttribute("voffset", fboxsep + "pt"); - if (group.label === "\\fcolorbox") { - var thk = Math.max( - options2.fontMetrics().fboxrule, - // default - options2.minRuleThickness - // user override - ); - node2.setAttribute("style", "border: " + thk + "em solid " + String(group.borderColor)); + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalOpen.js + function CardinalOpen(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; + } + var cardinalOpen_default; + var init_cardinalOpen = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinalOpen.js"() { + "use strict"; + init_cardinal(); + __name(CardinalOpen, "CardinalOpen"); + CardinalOpen.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + point3(this, x5, y5); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y5; + }, "point") + }; + cardinalOpen_default = (/* @__PURE__ */ __name(function custom4(tension) { + function cardinal(context) { + return new CardinalOpen(context, tension); } - break; - case "\\xcancel": - node2.setAttribute("notation", "updiagonalstrike downdiagonalstrike"); - break; + __name(cardinal, "cardinal"); + cardinal.tension = function(tension2) { + return custom4(+tension2); + }; + return cardinal; + }, "custom"))(0); } - if (group.backgroundColor) { - node2.setAttribute("mathbackground", group.backgroundColor); + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRom.js + function point4(that, x5, y5) { + var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2; + if (that._l01_a > epsilon3) { + var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n2 = 3 * that._l01_a * (that._l01_a + that._l12_a); + x1 = (x1 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n2; + y1 = (y1 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n2; } - return node2; - }; - defineFunction({ - type: "enclose", - names: ["\\colorbox"], - props: { - numArgs: 2, - allowedInText: true, - argTypes: ["color", "text"] - }, - handler(_ref, args, optArgs) { - var { - parser: parser2, - funcName - } = _ref; - var color2 = assertNodeType(args[0], "color-token").color; - var body = args[1]; - return { - type: "enclose", - mode: parser2.mode, - label: funcName, - backgroundColor: color2, - body - }; - }, - htmlBuilder: htmlBuilder$7, - mathmlBuilder: mathmlBuilder$6 - }); - defineFunction({ - type: "enclose", - names: ["\\fcolorbox"], - props: { - numArgs: 3, - allowedInText: true, - argTypes: ["color", "color", "text"] - }, - handler(_ref2, args, optArgs) { - var { - parser: parser2, - funcName - } = _ref2; - var borderColor = assertNodeType(args[0], "color-token").color; - var backgroundColor = assertNodeType(args[1], "color-token").color; - var body = args[2]; - return { - type: "enclose", - mode: parser2.mode, - label: funcName, - backgroundColor, - borderColor, - body - }; - }, - htmlBuilder: htmlBuilder$7, - mathmlBuilder: mathmlBuilder$6 - }); - defineFunction({ - type: "enclose", - names: ["\\fbox"], - props: { - numArgs: 1, - argTypes: ["hbox"], - allowedInText: true - }, - handler(_ref3, args) { - var { - parser: parser2 - } = _ref3; - return { - type: "enclose", - mode: parser2.mode, - label: "\\fbox", - body: args[0] + if (that._l23_a > epsilon3) { + var b2 = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m2 = 3 * that._l23_a * (that._l23_a + that._l12_a); + x22 = (x22 * b2 + that._x1 * that._l23_2a - x5 * that._l12_2a) / m2; + y22 = (y22 * b2 + that._y1 * that._l23_2a - y5 * that._l12_2a) / m2; + } + that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2); + } + function CatmullRom(context, alpha) { + this._context = context; + this._alpha = alpha; + } + var catmullRom_default; + var init_catmullRom = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRom.js"() { + "use strict"; + init_math2(); + init_cardinal(); + __name(point4, "point"); + __name(CatmullRom, "CatmullRom"); + CatmullRom.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + this.point(this._x2, this._y2); + break; + } + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + if (this._point) { + var x23 = this._x2 - x5, y23 = this._y2 - y5; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x5, y5) : this._context.moveTo(x5, y5); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + default: + point4(this, x5, y5); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y5; + }, "point") }; + catmullRom_default = (/* @__PURE__ */ __name(function custom5(alpha) { + function catmullRom(context) { + return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); + } + __name(catmullRom, "catmullRom"); + catmullRom.alpha = function(alpha2) { + return custom5(+alpha2); + }; + return catmullRom; + }, "custom"))(0.5); } }); - defineFunction({ - type: "enclose", - names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"], - props: { - numArgs: 1 - }, - handler(_ref4, args) { - var { - parser: parser2, - funcName - } = _ref4; - var body = args[0]; - return { - type: "enclose", - mode: parser2.mode, - label: funcName, - body + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomClosed.js + function CatmullRomClosed(context, alpha) { + this._context = context; + this._alpha = alpha; + } + var catmullRomClosed_default; + var init_catmullRomClosed = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomClosed.js"() { + "use strict"; + init_cardinalClosed(); + init_noop(); + init_catmullRom(); + __name(CatmullRomClosed, "CatmullRomClosed"); + CatmullRomClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; + this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + this.point(this._x5, this._y5); + break; + } + } + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + if (this._point) { + var x23 = this._x2 - x5, y23 = this._y2 - y5; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1; + this._x3 = x5, this._y3 = y5; + break; + case 1: + this._point = 2; + this._context.moveTo(this._x4 = x5, this._y4 = y5); + break; + case 2: + this._point = 3; + this._x5 = x5, this._y5 = y5; + break; + default: + point4(this, x5, y5); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y5; + }, "point") }; - }, - htmlBuilder: htmlBuilder$7, - mathmlBuilder: mathmlBuilder$6 - }); - defineFunction({ - type: "enclose", - names: ["\\angl"], - props: { - numArgs: 1, - argTypes: ["hbox"], - allowedInText: false - }, - handler(_ref5, args) { - var { - parser: parser2 - } = _ref5; - return { - type: "enclose", - mode: parser2.mode, - label: "\\angl", - body: args[0] + catmullRomClosed_default = (/* @__PURE__ */ __name(function custom6(alpha) { + function catmullRom(context) { + return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); + } + __name(catmullRom, "catmullRom"); + catmullRom.alpha = function(alpha2) { + return custom6(+alpha2); + }; + return catmullRom; + }, "custom"))(0.5); + } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomOpen.js + function CatmullRomOpen(context, alpha) { + this._context = context; + this._alpha = alpha; + } + var catmullRomOpen_default; + var init_catmullRomOpen = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRomOpen.js"() { + "use strict"; + init_cardinalOpen(); + init_catmullRom(); + __name(CatmullRomOpen, "CatmullRomOpen"); + CatmullRomOpen.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + if (this._point) { + var x23 = this._x2 - x5, y23 = this._y2 - y5; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + point4(this, x5, y5); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x5; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y5; + }, "point") }; + catmullRomOpen_default = (/* @__PURE__ */ __name(function custom7(alpha) { + function catmullRom(context) { + return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); + } + __name(catmullRom, "catmullRom"); + catmullRom.alpha = function(alpha2) { + return custom7(+alpha2); + }; + return catmullRom; + }, "custom"))(0.5); } }); - var _environments = {}; - function defineEnvironment(_ref) { - var { - type: type2, - names, - props, - handler, - htmlBuilder: htmlBuilder2, - mathmlBuilder: mathmlBuilder2 - } = _ref; - var data = { - type: type2, - numArgs: props.numArgs || 0, - allowedInText: false, - numOptionalArgs: 0, - handler - }; - for (var i2 = 0; i2 < names.length; ++i2) { - _environments[names[i2]] = data; + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linearClosed.js + function LinearClosed(context) { + this._context = context; + } + function linearClosed_default(context) { + return new LinearClosed(context); + } + var init_linearClosed = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linearClosed.js"() { + "use strict"; + init_noop(); + __name(LinearClosed, "LinearClosed"); + LinearClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: /* @__PURE__ */ __name(function() { + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + if (this._point) this._context.closePath(); + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + if (this._point) this._context.lineTo(x5, y5); + else this._point = 1, this._context.moveTo(x5, y5); + }, "point") + }; + __name(linearClosed_default, "default"); } - if (htmlBuilder2) { - _htmlGroupBuilders[type2] = htmlBuilder2; + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js + function sign(x5) { + return x5 < 0 ? -1 : 1; + } + function slope3(that, x22, y22) { + var h0 = that._x1 - that._x0, h1 = x22 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y22 - that._y1) / (h1 || h0 < 0 && -0), p3 = (s0 * h1 + s1 * h0) / (h0 + h1); + return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p3)) || 0; + } + function slope2(that, t4) { + var h2 = that._x1 - that._x0; + return h2 ? (3 * (that._y1 - that._y0) / h2 - t4) / 2 : t4; + } + function point5(that, t03, t13) { + var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3; + that._context.bezierCurveTo(x0 + dx, y0 + dx * t03, x1 - dx, y1 - dx * t13, x1, y1); + } + function MonotoneX(context) { + this._context = context; + } + function MonotoneY(context) { + this._context = new ReflectContext(context); + } + function ReflectContext(context) { + this._context = context; + } + function monotoneX(context) { + return new MonotoneX(context); + } + function monotoneY(context) { + return new MonotoneY(context); + } + var init_monotone = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js"() { + "use strict"; + __name(sign, "sign"); + __name(slope3, "slope3"); + __name(slope2, "slope2"); + __name(point5, "point"); + __name(MonotoneX, "MonotoneX"); + MonotoneX.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + switch (this._point) { + case 2: + this._context.lineTo(this._x1, this._y1); + break; + case 3: + point5(this, this._t0, slope2(this, this._t0)); + break; + } + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + var t13 = NaN; + x5 = +x5, y5 = +y5; + if (x5 === this._x1 && y5 === this._y1) return; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x5, y5) : this._context.moveTo(x5, y5); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + point5(this, slope2(this, t13 = slope3(this, x5, y5)), t13); + break; + default: + point5(this, this._t0, t13 = slope3(this, x5, y5)); + break; + } + this._x0 = this._x1, this._x1 = x5; + this._y0 = this._y1, this._y1 = y5; + this._t0 = t13; + }, "point") + }; + __name(MonotoneY, "MonotoneY"); + (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x5, y5) { + MonotoneX.prototype.point.call(this, y5, x5); + }; + __name(ReflectContext, "ReflectContext"); + ReflectContext.prototype = { + moveTo: /* @__PURE__ */ __name(function(x5, y5) { + this._context.moveTo(y5, x5); + }, "moveTo"), + closePath: /* @__PURE__ */ __name(function() { + this._context.closePath(); + }, "closePath"), + lineTo: /* @__PURE__ */ __name(function(x5, y5) { + this._context.lineTo(y5, x5); + }, "lineTo"), + bezierCurveTo: /* @__PURE__ */ __name(function(x1, y1, x22, y22, x5, y5) { + this._context.bezierCurveTo(y1, x1, y22, x22, y5, x5); + }, "bezierCurveTo") + }; + __name(monotoneX, "monotoneX"); + __name(monotoneY, "monotoneY"); } - if (mathmlBuilder2) { - _mathmlGroupBuilders[type2] = mathmlBuilder2; + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/natural.js + function Natural(context) { + this._context = context; + } + function controlPoints(x5) { + var i2, n2 = x5.length - 1, m2, a2 = new Array(n2), b2 = new Array(n2), r2 = new Array(n2); + a2[0] = 0, b2[0] = 2, r2[0] = x5[0] + 2 * x5[1]; + for (i2 = 1; i2 < n2 - 1; ++i2) a2[i2] = 1, b2[i2] = 4, r2[i2] = 4 * x5[i2] + 2 * x5[i2 + 1]; + a2[n2 - 1] = 2, b2[n2 - 1] = 7, r2[n2 - 1] = 8 * x5[n2 - 1] + x5[n2]; + for (i2 = 1; i2 < n2; ++i2) m2 = a2[i2] / b2[i2 - 1], b2[i2] -= m2, r2[i2] -= m2 * r2[i2 - 1]; + a2[n2 - 1] = r2[n2 - 1] / b2[n2 - 1]; + for (i2 = n2 - 2; i2 >= 0; --i2) a2[i2] = (r2[i2] - a2[i2 + 1]) / b2[i2]; + b2[n2 - 1] = (x5[n2] + a2[n2 - 1]) / 2; + for (i2 = 0; i2 < n2 - 1; ++i2) b2[i2] = 2 * x5[i2 + 1] - a2[i2 + 1]; + return [a2, b2]; + } + function natural_default(context) { + return new Natural(context); + } + var init_natural = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/natural.js"() { + "use strict"; + __name(Natural, "Natural"); + Natural.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x = []; + this._y = []; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + var x5 = this._x, y5 = this._y, n2 = x5.length; + if (n2) { + this._line ? this._context.lineTo(x5[0], y5[0]) : this._context.moveTo(x5[0], y5[0]); + if (n2 === 2) { + this._context.lineTo(x5[1], y5[1]); + } else { + var px = controlPoints(x5), py = controlPoints(y5); + for (var i0 = 0, i1 = 1; i1 < n2; ++i0, ++i1) { + this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x5[i1], y5[i1]); + } + } + } + if (this._line || this._line !== 0 && n2 === 1) this._context.closePath(); + this._line = 1 - this._line; + this._x = this._y = null; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + this._x.push(+x5); + this._y.push(+y5); + }, "point") + }; + __name(controlPoints, "controlPoints"); + __name(natural_default, "default"); } + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/step.js + function Step(context, t4) { + this._context = context; + this._t = t4; } - var _macros = {}; - function defineMacro(name, body) { - _macros[name] = body; + function step_default(context) { + return new Step(context, 0.5); } - function getHLines(parser2) { - var hlineInfo = []; - parser2.consumeSpaces(); - var nxt = parser2.fetch().text; - if (nxt === "\\relax") { - parser2.consume(); - parser2.consumeSpaces(); - nxt = parser2.fetch().text; + function stepBefore(context) { + return new Step(context, 0); + } + function stepAfter(context) { + return new Step(context, 1); + } + var init_step = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/step.js"() { + "use strict"; + __name(Step, "Step"); + Step.prototype = { + areaStart: /* @__PURE__ */ __name(function() { + this._line = 0; + }, "areaStart"), + areaEnd: /* @__PURE__ */ __name(function() { + this._line = NaN; + }, "areaEnd"), + lineStart: /* @__PURE__ */ __name(function() { + this._x = this._y = NaN; + this._point = 0; + }, "lineStart"), + lineEnd: /* @__PURE__ */ __name(function() { + if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; + }, "lineEnd"), + point: /* @__PURE__ */ __name(function(x5, y5) { + x5 = +x5, y5 = +y5; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x5, y5) : this._context.moveTo(x5, y5); + break; + case 1: + this._point = 2; + default: { + if (this._t <= 0) { + this._context.lineTo(this._x, y5); + this._context.lineTo(x5, y5); + } else { + var x1 = this._x * (1 - this._t) + x5 * this._t; + this._context.lineTo(x1, this._y); + this._context.lineTo(x1, y5); + } + break; + } + } + this._x = x5, this._y = y5; + }, "point") + }; + __name(step_default, "default"); + __name(stepBefore, "stepBefore"); + __name(stepAfter, "stepAfter"); } - while (nxt === "\\hline" || nxt === "\\hdashline") { - parser2.consume(); - hlineInfo.push(nxt === "\\hdashline"); - parser2.consumeSpaces(); - nxt = parser2.fetch().text; + }); + + // ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/index.js + var init_src30 = __esm({ + "../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/index.js"() { + "use strict"; + init_arc(); + init_line(); + init_pie(); + init_basisClosed2(); + init_basisOpen(); + init_basis2(); + init_bump(); + init_bundle(); + init_cardinalClosed(); + init_cardinalOpen(); + init_cardinal(); + init_catmullRomClosed(); + init_catmullRomOpen(); + init_catmullRom(); + init_linearClosed(); + init_linear2(); + init_monotone(); + init_natural(); + init_step(); } - return hlineInfo; - } - var validateAmsEnvironmentContext = (context) => { - var settings = context.parser.settings; - if (!settings.displayMode) { - throw new ParseError("{" + context.envName + "} can be used only in display mode."); + }); + + // ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js + var init_constant6 = __esm({ + "../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js"() { + "use strict"; } - }; - function getAutoTag(name) { - if (name.indexOf("ed") === -1) { - return name.indexOf("*") === -1; + }); + + // ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js + var init_event2 = __esm({ + "../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js"() { + "use strict"; } - } - function parseArray(parser2, _ref, style) { - var { - hskipBeforeAndAfter, - addJot, - cols, - arraystretch, - colSeparationType, - autoTag, - singleRow, - emptySingleRow, - maxNumCols, - leqno - } = _ref; - parser2.gullet.beginGroup(); - if (!singleRow) { - parser2.gullet.macros.set("\\cr", "\\\\\\relax"); + }); + + // ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js + function Transform(k2, x5, y5) { + this.k = k2; + this.x = x5; + this.y = y5; + } + function transform(node2) { + while (!node2.__zoom) if (!(node2 = node2.parentNode)) return identity3; + return node2.__zoom; + } + var identity3; + var init_transform2 = __esm({ + "../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js"() { + "use strict"; + __name(Transform, "Transform"); + Transform.prototype = { + constructor: Transform, + scale: /* @__PURE__ */ __name(function(k2) { + return k2 === 1 ? this : new Transform(this.k * k2, this.x, this.y); + }, "scale"), + translate: /* @__PURE__ */ __name(function(x5, y5) { + return x5 === 0 & y5 === 0 ? this : new Transform(this.k, this.x + this.k * x5, this.y + this.k * y5); + }, "translate"), + apply: /* @__PURE__ */ __name(function(point8) { + return [point8[0] * this.k + this.x, point8[1] * this.k + this.y]; + }, "apply"), + applyX: /* @__PURE__ */ __name(function(x5) { + return x5 * this.k + this.x; + }, "applyX"), + applyY: /* @__PURE__ */ __name(function(y5) { + return y5 * this.k + this.y; + }, "applyY"), + invert: /* @__PURE__ */ __name(function(location) { + return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; + }, "invert"), + invertX: /* @__PURE__ */ __name(function(x5) { + return (x5 - this.x) / this.k; + }, "invertX"), + invertY: /* @__PURE__ */ __name(function(y5) { + return (y5 - this.y) / this.k; + }, "invertY"), + rescaleX: /* @__PURE__ */ __name(function(x5) { + return x5.copy().domain(x5.range().map(this.invertX, this).map(x5.invert, x5)); + }, "rescaleX"), + rescaleY: /* @__PURE__ */ __name(function(y5) { + return y5.copy().domain(y5.range().map(this.invertY, this).map(y5.invert, y5)); + }, "rescaleY"), + toString: /* @__PURE__ */ __name(function() { + return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; + }, "toString") + }; + identity3 = new Transform(1, 0, 0); + transform.prototype = Transform.prototype; + __name(transform, "transform"); } - if (!arraystretch) { - var stretch = parser2.gullet.expandMacroAsText("\\arraystretch"); - if (stretch == null) { - arraystretch = 1; - } else { - arraystretch = parseFloat(stretch); - if (!arraystretch || arraystretch < 0) { - throw new ParseError("Invalid \\arraystretch: " + stretch); - } - } + }); + + // ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js + var init_noevent2 = __esm({ + "../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js"() { + "use strict"; } - parser2.gullet.beginGroup(); - var row = []; - var body = [row]; - var rowGaps = []; - var hLinesBeforeRow = []; - var tags2 = autoTag != null ? [] : void 0; - function beginRow() { - if (autoTag) { - parser2.gullet.macros.set("\\@eqnsw", "1", true); - } + }); + + // ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js + var init_zoom = __esm({ + "../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js"() { + "use strict"; + init_src11(); + init_constant6(); + init_event2(); + init_transform2(); + init_noevent2(); } - function endRow() { - if (tags2) { - if (parser2.gullet.macros.get("\\df@tag")) { - tags2.push(parser2.subparse([new Token("\\df@tag")])); - parser2.gullet.macros.set("\\df@tag", void 0, true); - } else { - tags2.push(Boolean(autoTag) && parser2.gullet.macros.get("\\@eqnsw") === "1"); - } - } + }); + + // ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/index.js + var init_src31 = __esm({ + "../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/index.js"() { + "use strict"; + init_zoom(); + init_transform2(); } - beginRow(); - hLinesBeforeRow.push(getHLines(parser2)); - while (true) { - var cell = parser2.parseExpression(false, singleRow ? "\\end" : "\\\\"); - parser2.gullet.endGroup(); - parser2.gullet.beginGroup(); - cell = { - type: "ordgroup", - mode: parser2.mode, - body: cell - }; - if (style) { - cell = { - type: "styling", - mode: parser2.mode, - style, - body: [cell] - }; + }); + + // ../../node_modules/.pnpm/d3@7.9.0/node_modules/d3/src/index.js + var init_src32 = __esm({ + "../../node_modules/.pnpm/d3@7.9.0/node_modules/d3/src/index.js"() { + "use strict"; + init_src2(); + init_src3(); + init_src12(); + init_src14(); + init_src7(); + init_src15(); + init_src16(); + init_src4(); + init_src6(); + init_src17(); + init_src10(); + init_src18(); + init_src20(); + init_src21(); + init_src22(); + init_src23(); + init_src8(); + init_src13(); + init_src24(); + init_src19(); + init_src25(); + init_src28(); + init_src29(); + init_src5(); + init_src30(); + init_src26(); + init_src27(); + init_src9(); + init_src11(); + init_src31(); + } + }); + + // ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/constants.js + var require_constants = __commonJS({ + "../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BLANK_URL = exports2.relativeFirstCharacters = exports2.whitespaceEscapeCharsRegex = exports2.urlSchemeRegex = exports2.ctrlCharactersRegex = exports2.htmlCtrlEntityRegex = exports2.htmlEntitiesRegex = exports2.invalidProtocolRegex = void 0; + exports2.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im; + exports2.htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g; + exports2.htmlCtrlEntityRegex = /&(newline|tab);/gi; + exports2.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim; + exports2.urlSchemeRegex = /^.+(:|:)/gim; + exports2.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g; + exports2.relativeFirstCharacters = [".", "/"]; + exports2.BLANK_URL = "about:blank"; + } + }); + + // ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/index.js + var require_dist = __commonJS({ + "../../node_modules/.pnpm/@braintree+sanitize-url@7.1.0/node_modules/@braintree/sanitize-url/dist/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sanitizeUrl = void 0; + var constants_1 = require_constants(); + function isRelativeUrlWithoutProtocol(url) { + return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1; + } + __name(isRelativeUrlWithoutProtocol, "isRelativeUrlWithoutProtocol"); + function decodeHtmlCharacters(str2) { + var removedNullByte = str2.replace(constants_1.ctrlCharactersRegex, ""); + return removedNullByte.replace(constants_1.htmlEntitiesRegex, function(match2, dec) { + return String.fromCharCode(dec); + }); } - row.push(cell); - var next2 = parser2.fetch().text; - if (next2 === "&") { - if (maxNumCols && row.length === maxNumCols) { - if (singleRow || colSeparationType) { - throw new ParseError("Too many tab characters: &", parser2.nextToken); - } else { - parser2.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); - } + __name(decodeHtmlCharacters, "decodeHtmlCharacters"); + function isValidUrl(url) { + return URL.canParse(url); + } + __name(isValidUrl, "isValidUrl"); + function decodeURI(uri) { + try { + return decodeURIComponent(uri); + } catch (e3) { + return uri; } - parser2.consume(); - } else if (next2 === "\\end") { - endRow(); - if (row.length === 1 && cell.type === "styling" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) { - body.pop(); + } + __name(decodeURI, "decodeURI"); + function sanitizeUrl6(url) { + if (!url) { + return constants_1.BLANK_URL; } - if (hLinesBeforeRow.length < body.length + 1) { - hLinesBeforeRow.push([]); + var charsToDecode; + var decodedUrl = decodeURI(url.trim()); + do { + decodedUrl = decodeHtmlCharacters(decodedUrl).replace(constants_1.htmlCtrlEntityRegex, "").replace(constants_1.ctrlCharactersRegex, "").replace(constants_1.whitespaceEscapeCharsRegex, "").trim(); + decodedUrl = decodeURI(decodedUrl); + charsToDecode = decodedUrl.match(constants_1.ctrlCharactersRegex) || decodedUrl.match(constants_1.htmlEntitiesRegex) || decodedUrl.match(constants_1.htmlCtrlEntityRegex) || decodedUrl.match(constants_1.whitespaceEscapeCharsRegex); + } while (charsToDecode && charsToDecode.length > 0); + var sanitizedUrl = decodedUrl; + if (!sanitizedUrl) { + return constants_1.BLANK_URL; } - break; - } else if (next2 === "\\\\") { - parser2.consume(); - var size2 = void 0; - if (parser2.gullet.future().text !== " ") { - size2 = parser2.parseSizeGroup(true); + if (isRelativeUrlWithoutProtocol(sanitizedUrl)) { + return sanitizedUrl; } - rowGaps.push(size2 ? size2.value : null); - endRow(); - hLinesBeforeRow.push(getHLines(parser2)); - row = []; - body.push(row); - beginRow(); - } else { - throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser2.nextToken); + var trimmedUrl = sanitizedUrl.trimStart(); + var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex); + if (!urlSchemeParseResults) { + return sanitizedUrl; + } + var urlScheme = urlSchemeParseResults[0].toLowerCase().trim(); + if (constants_1.invalidProtocolRegex.test(urlScheme)) { + return constants_1.BLANK_URL; + } + var backSanitized = trimmedUrl.replace(/\\/g, "/"); + if (urlScheme === "mailto:" || urlScheme.includes("://")) { + return backSanitized; + } + if (urlScheme === "http:" || urlScheme === "https:") { + if (!isValidUrl(backSanitized)) { + return constants_1.BLANK_URL; + } + var url_1 = new URL(backSanitized); + url_1.protocol = url_1.protocol.toLowerCase(); + url_1.hostname = url_1.hostname.toLowerCase(); + return url_1.toString(); + } + return backSanitized; } + __name(sanitizeUrl6, "sanitizeUrl"); + exports2.sanitizeUrl = sanitizeUrl6; } - parser2.gullet.endGroup(); - parser2.gullet.endGroup(); - return { - type: "array", - mode: parser2.mode, - addJot, - arraystretch, - body, - cols, - rowGaps, - hskipBeforeAndAfter, - hLinesBeforeRow, - colSeparationType, - tags: tags2, - leqno - }; - } - function dCellStyle(envName) { - if (envName.slice(0, 1) === "d") { - return "display"; - } else { - return "text"; - } - } - var htmlBuilder$6 = function htmlBuilder2(group, options2) { - var r; - var c2; - var nr = group.body.length; - var hLinesBeforeRow = group.hLinesBeforeRow; - var nc = 0; - var body = new Array(nr); - var hlines = []; - var ruleThickness = Math.max( - // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em. - options2.fontMetrics().arrayRuleWidth, - options2.minRuleThickness - // User override. - ); - var pt = 1 / options2.fontMetrics().ptPerEm; - var arraycolsep = 5 * pt; - if (group.colSeparationType && group.colSeparationType === "small") { - var localMultiplier = options2.havingStyle(Style$1.SCRIPT).sizeMultiplier; - arraycolsep = 0.2778 * (localMultiplier / options2.sizeMultiplier); - } - var baselineskip = group.colSeparationType === "CD" ? calculateSize({ - number: 3, - unit: "ex" - }, options2) : 12 * pt; - var jot = 3 * pt; - var arrayskip = group.arraystretch * baselineskip; - var arstrutHeight = 0.7 * arrayskip; - var arstrutDepth = 0.3 * arrayskip; - var totalHeight = 0; - function setHLinePos(hlinesInGap) { - for (var i2 = 0; i2 < hlinesInGap.length; ++i2) { - if (i2 > 0) { - totalHeight += 0.25; - } - hlines.push({ - pos: totalHeight, - isDashed: hlinesInGap[i2] - }); - } + }); + + // src/diagrams/common/svgDrawCommon.ts + var import_sanitize_url, drawRect, drawBackgroundRect, drawText, drawImage, drawEmbeddedImage, getNoteRect, getTextObj; + var init_svgDrawCommon = __esm({ + "src/diagrams/common/svgDrawCommon.ts"() { + "use strict"; + import_sanitize_url = __toESM(require_dist(), 1); + init_common(); + drawRect = /* @__PURE__ */ __name((element3, rectData) => { + const rectElement = element3.append("rect"); + rectElement.attr("x", rectData.x); + rectElement.attr("y", rectData.y); + rectElement.attr("fill", rectData.fill); + rectElement.attr("stroke", rectData.stroke); + rectElement.attr("width", rectData.width); + rectElement.attr("height", rectData.height); + if (rectData.name) { + rectElement.attr("name", rectData.name); + } + if (rectData.rx) { + rectElement.attr("rx", rectData.rx); + } + if (rectData.ry) { + rectElement.attr("ry", rectData.ry); + } + if (rectData.attrs !== void 0) { + for (const attrKey in rectData.attrs) { + rectElement.attr(attrKey, rectData.attrs[attrKey]); + } + } + if (rectData.class) { + rectElement.attr("class", rectData.class); + } + return rectElement; + }, "drawRect"); + drawBackgroundRect = /* @__PURE__ */ __name((element3, bounds4) => { + const rectData = { + x: bounds4.startx, + y: bounds4.starty, + width: bounds4.stopx - bounds4.startx, + height: bounds4.stopy - bounds4.starty, + fill: bounds4.fill, + stroke: bounds4.stroke, + class: "rect" + }; + const rectElement = drawRect(element3, rectData); + rectElement.lower(); + }, "drawBackgroundRect"); + drawText = /* @__PURE__ */ __name((element3, textData) => { + const nText = textData.text.replace(lineBreakRegex, " "); + const textElem = element3.append("text"); + textElem.attr("x", textData.x); + textElem.attr("y", textData.y); + textElem.attr("class", "legend"); + textElem.style("text-anchor", textData.anchor); + if (textData.class) { + textElem.attr("class", textData.class); + } + const tspan = textElem.append("tspan"); + tspan.attr("x", textData.x + textData.textMargin * 2); + tspan.text(nText); + return textElem; + }, "drawText"); + drawImage = /* @__PURE__ */ __name((elem, x5, y5, link3) => { + const imageElement = elem.append("image"); + imageElement.attr("x", x5); + imageElement.attr("y", y5); + const sanitizedLink = (0, import_sanitize_url.sanitizeUrl)(link3); + imageElement.attr("xlink:href", sanitizedLink); + }, "drawImage"); + drawEmbeddedImage = /* @__PURE__ */ __name((element3, x5, y5, link3) => { + const imageElement = element3.append("use"); + imageElement.attr("x", x5); + imageElement.attr("y", y5); + const sanitizedLink = (0, import_sanitize_url.sanitizeUrl)(link3); + imageElement.attr("xlink:href", `#${sanitizedLink}`); + }, "drawEmbeddedImage"); + getNoteRect = /* @__PURE__ */ __name(() => { + const noteRectData = { + x: 0, + y: 0, + width: 100, + height: 100, + fill: "#EDF2AE", + stroke: "#666", + anchor: "start", + rx: 0, + ry: 0 + }; + return noteRectData; + }, "getNoteRect"); + getTextObj = /* @__PURE__ */ __name(() => { + const testObject = { + x: 0, + y: 0, + width: 100, + height: 100, + "text-anchor": "start", + style: "#666", + textMargin: 0, + rx: 0, + ry: 0, + tspan: true + }; + return testObject; + }, "getTextObj"); } - setHLinePos(hLinesBeforeRow[0]); - for (r = 0; r < group.body.length; ++r) { - var inrow = group.body[r]; - var height = arstrutHeight; - var depth = arstrutDepth; - if (nc < inrow.length) { - nc = inrow.length; - } - var outrow = new Array(inrow.length); - for (c2 = 0; c2 < inrow.length; ++c2) { - var elt = buildGroup$1(inrow[c2], options2); - if (depth < elt.depth) { - depth = elt.depth; - } - if (height < elt.height) { - height = elt.height; - } - outrow[c2] = elt; - } - var rowGap = group.rowGaps[r]; - var gap = 0; - if (rowGap) { - gap = calculateSize(rowGap, options2); - if (gap > 0) { - gap += arstrutDepth; - if (depth < gap) { - depth = gap; - } - gap = 0; - } - } - if (group.addJot) { - depth += jot; - } - outrow.height = height; - outrow.depth = depth; - totalHeight += height; - outrow.pos = totalHeight; - totalHeight += depth + gap; - body[r] = outrow; - setHLinePos(hLinesBeforeRow[r + 1]); - } - var offset = totalHeight / 2 + options2.fontMetrics().axisHeight; - var colDescriptions = group.cols || []; - var cols = []; - var colSep; - var colDescrNum; - var tagSpans = []; - if (group.tags && group.tags.some((tag2) => tag2)) { - for (r = 0; r < nr; ++r) { - var rw = body[r]; - var shift = rw.pos - offset; - var tag = group.tags[r]; - var tagSpan = void 0; - if (tag === true) { - tagSpan = buildCommon.makeSpan(["eqn-num"], [], options2); - } else if (tag === false) { - tagSpan = buildCommon.makeSpan([], [], options2); - } else { - tagSpan = buildCommon.makeSpan([], buildExpression$1(tag, options2, true), options2); + }); + + // src/diagrams/c4/svgDraw.js + var import_sanitize_url2, drawRect2, drawImage2, drawRels, drawBoundary, drawC4Shape, insertDatabaseIcon, insertComputerIcon, insertClockIcon, insertArrowHead, insertArrowEnd, insertArrowFilledHead, insertDynamicNumber, insertArrowCrossHead, getC4ShapeFont, _drawTextCandidateFunc, svgDraw_default; + var init_svgDraw = __esm({ + "src/diagrams/c4/svgDraw.js"() { + "use strict"; + init_common(); + init_svgDrawCommon(); + import_sanitize_url2 = __toESM(require_dist(), 1); + drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) { + return drawRect(elem, rectData); + }, "drawRect"); + drawImage2 = /* @__PURE__ */ __name(function(elem, width3, height2, x5, y5, link3) { + const imageElem = elem.append("image"); + imageElem.attr("width", width3); + imageElem.attr("height", height2); + imageElem.attr("x", x5); + imageElem.attr("y", y5); + let sanitizedLink = link3.startsWith("data:image/png;base64") ? link3 : (0, import_sanitize_url2.sanitizeUrl)(link3); + imageElem.attr("xlink:href", sanitizedLink); + }, "drawImage"); + drawRels = /* @__PURE__ */ __name((elem, rels2, conf8) => { + const relsElem = elem.append("g"); + let i2 = 0; + for (let rel2 of rels2) { + let textColor = rel2.textColor ? rel2.textColor : "#444444"; + let strokeColor = rel2.lineColor ? rel2.lineColor : "#444444"; + let offsetX = rel2.offsetX ? parseInt(rel2.offsetX) : 0; + let offsetY = rel2.offsetY ? parseInt(rel2.offsetY) : 0; + let url = ""; + if (i2 === 0) { + let line2 = relsElem.append("line"); + line2.attr("x1", rel2.startPoint.x); + line2.attr("y1", rel2.startPoint.y); + line2.attr("x2", rel2.endPoint.x); + line2.attr("y2", rel2.endPoint.y); + line2.attr("stroke-width", "1"); + line2.attr("stroke", strokeColor); + line2.style("fill", "none"); + if (rel2.type !== "rel_b") { + line2.attr("marker-end", "url(" + url + "#arrowhead)"); + } + if (rel2.type === "birel" || rel2.type === "rel_b") { + line2.attr("marker-start", "url(" + url + "#arrowend)"); + } + i2 = -1; + } else { + let line2 = relsElem.append("path"); + line2.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr( + "d", + "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel2.startPoint.x).replaceAll("starty", rel2.startPoint.y).replaceAll( + "controlx", + rel2.startPoint.x + (rel2.endPoint.x - rel2.startPoint.x) / 2 - (rel2.endPoint.x - rel2.startPoint.x) / 4 + ).replaceAll("controly", rel2.startPoint.y + (rel2.endPoint.y - rel2.startPoint.y) / 2).replaceAll("stopx", rel2.endPoint.x).replaceAll("stopy", rel2.endPoint.y) + ); + if (rel2.type !== "rel_b") { + line2.attr("marker-end", "url(" + url + "#arrowhead)"); + } + if (rel2.type === "birel" || rel2.type === "rel_b") { + line2.attr("marker-start", "url(" + url + "#arrowend)"); + } + } + let messageConf = conf8.messageFont(); + _drawTextCandidateFunc(conf8)( + rel2.label.text, + relsElem, + Math.min(rel2.startPoint.x, rel2.endPoint.x) + Math.abs(rel2.endPoint.x - rel2.startPoint.x) / 2 + offsetX, + Math.min(rel2.startPoint.y, rel2.endPoint.y) + Math.abs(rel2.endPoint.y - rel2.startPoint.y) / 2 + offsetY, + rel2.label.width, + rel2.label.height, + { fill: textColor }, + messageConf + ); + if (rel2.techn && rel2.techn.text !== "") { + messageConf = conf8.messageFont(); + _drawTextCandidateFunc(conf8)( + "[" + rel2.techn.text + "]", + relsElem, + Math.min(rel2.startPoint.x, rel2.endPoint.x) + Math.abs(rel2.endPoint.x - rel2.startPoint.x) / 2 + offsetX, + Math.min(rel2.startPoint.y, rel2.endPoint.y) + Math.abs(rel2.endPoint.y - rel2.startPoint.y) / 2 + conf8.messageFontSize + 5 + offsetY, + Math.max(rel2.label.width, rel2.techn.width), + rel2.techn.height, + { fill: textColor, "font-style": "italic" }, + messageConf + ); + } } - tagSpan.depth = rw.depth; - tagSpan.height = rw.height; - tagSpans.push({ - type: "elem", - elem: tagSpan, - shift - }); - } - } - for ( - c2 = 0, colDescrNum = 0; - // Continue while either there are more columns or more column - // descriptions, so trailing separators don't get lost. - c2 < nc || colDescrNum < colDescriptions.length; - ++c2, ++colDescrNum - ) { - var colDescr = colDescriptions[colDescrNum] || {}; - var firstSeparator = true; - while (colDescr.type === "separator") { - if (!firstSeparator) { - colSep = buildCommon.makeSpan(["arraycolsep"], []); - colSep.style.width = makeEm(options2.fontMetrics().doubleRuleSep); - cols.push(colSep); - } - if (colDescr.separator === "|" || colDescr.separator === ":") { - var lineType2 = colDescr.separator === "|" ? "solid" : "dashed"; - var separator = buildCommon.makeSpan(["vertical-separator"], [], options2); - separator.style.height = makeEm(totalHeight); - separator.style.borderRightWidth = makeEm(ruleThickness); - separator.style.borderRightStyle = lineType2; - separator.style.margin = "0 " + makeEm(-ruleThickness / 2); - var _shift = totalHeight - offset; - if (_shift) { - separator.style.verticalAlign = makeEm(-_shift); - } - cols.push(separator); - } else { - throw new ParseError("Invalid separator type: " + colDescr.separator); + }, "drawRels"); + drawBoundary = /* @__PURE__ */ __name(function(elem, boundary, conf8) { + const boundaryElem = elem.append("g"); + let fillColor = boundary.bgColor ? boundary.bgColor : "none"; + let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444"; + let fontColor = boundary.fontColor ? boundary.fontColor : "black"; + let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" }; + if (boundary.nodeType) { + attrsValue = { "stroke-width": 1 }; + } + let rectData = { + x: boundary.x, + y: boundary.y, + fill: fillColor, + stroke: strokeColor, + width: boundary.width, + height: boundary.height, + rx: 2.5, + ry: 2.5, + attrs: attrsValue + }; + drawRect2(boundaryElem, rectData); + let boundaryConf = conf8.boundaryFont(); + boundaryConf.fontWeight = "bold"; + boundaryConf.fontSize = boundaryConf.fontSize + 2; + boundaryConf.fontColor = fontColor; + _drawTextCandidateFunc(conf8)( + boundary.label.text, + boundaryElem, + boundary.x, + boundary.y + boundary.label.Y, + boundary.width, + boundary.height, + { fill: "#444444" }, + boundaryConf + ); + if (boundary.type && boundary.type.text !== "") { + boundaryConf = conf8.boundaryFont(); + boundaryConf.fontColor = fontColor; + _drawTextCandidateFunc(conf8)( + boundary.type.text, + boundaryElem, + boundary.x, + boundary.y + boundary.type.Y, + boundary.width, + boundary.height, + { fill: "#444444" }, + boundaryConf + ); } - colDescrNum++; - colDescr = colDescriptions[colDescrNum] || {}; - firstSeparator = false; - } - if (c2 >= nc) { - continue; - } - var sepwidth = void 0; - if (c2 > 0 || group.hskipBeforeAndAfter) { - sepwidth = utils.deflt(colDescr.pregap, arraycolsep); - if (sepwidth !== 0) { - colSep = buildCommon.makeSpan(["arraycolsep"], []); - colSep.style.width = makeEm(sepwidth); - cols.push(colSep); + if (boundary.descr && boundary.descr.text !== "") { + boundaryConf = conf8.boundaryFont(); + boundaryConf.fontSize = boundaryConf.fontSize - 2; + boundaryConf.fontColor = fontColor; + _drawTextCandidateFunc(conf8)( + boundary.descr.text, + boundaryElem, + boundary.x, + boundary.y + boundary.descr.Y, + boundary.width, + boundary.height, + { fill: "#444444" }, + boundaryConf + ); } - } - var col = []; - for (r = 0; r < nr; ++r) { - var row = body[r]; - var elem = row[c2]; - if (!elem) { - continue; + }, "drawBoundary"); + drawC4Shape = /* @__PURE__ */ __name(function(elem, c4Shape, conf8) { + let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf8[c4Shape.typeC4Shape.text + "_bg_color"]; + let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf8[c4Shape.typeC4Shape.text + "_border_color"]; + let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF"; + let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; + switch (c4Shape.typeC4Shape.text) { + case "person": + personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; + break; + case "external_person": + personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="; + break; + } + const c4ShapeElem = elem.append("g"); + c4ShapeElem.attr("class", "person-man"); + const rect4 = getNoteRect(); + switch (c4Shape.typeC4Shape.text) { + case "person": + case "external_person": + case "system": + case "external_system": + case "container": + case "external_container": + case "component": + case "external_component": + rect4.x = c4Shape.x; + rect4.y = c4Shape.y; + rect4.fill = fillColor; + rect4.width = c4Shape.width; + rect4.height = c4Shape.height; + rect4.stroke = strokeColor; + rect4.rx = 2.5; + rect4.ry = 2.5; + rect4.attrs = { "stroke-width": 0.5 }; + drawRect2(c4ShapeElem, rect4); + break; + case "system_db": + case "external_system_db": + case "container_db": + case "external_container_db": + case "component_db": + case "external_component_db": + c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( + "d", + "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height) + ); + c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( + "d", + "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2) + ); + break; + case "system_queue": + case "external_system_queue": + case "container_queue": + case "external_container_queue": + case "component_queue": + case "external_component_queue": + c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( + "d", + "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2) + ); + c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( + "d", + "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2) + ); + break; } - var _shift2 = row.pos - offset; - elem.depth = row.depth; - elem.height = row.height; - col.push({ - type: "elem", - elem, - shift: _shift2 - }); - } - col = buildCommon.makeVList({ - positionType: "individualShift", - children: col - }, options2); - col = buildCommon.makeSpan(["col-align-" + (colDescr.align || "c")], [col]); - cols.push(col); - if (c2 < nc - 1 || group.hskipBeforeAndAfter) { - sepwidth = utils.deflt(colDescr.postgap, arraycolsep); - if (sepwidth !== 0) { - colSep = buildCommon.makeSpan(["arraycolsep"], []); - colSep.style.width = makeEm(sepwidth); - cols.push(colSep); - } - } - } - body = buildCommon.makeSpan(["mtable"], cols); - if (hlines.length > 0) { - var line2 = buildCommon.makeLineSpan("hline", options2, ruleThickness); - var dashes = buildCommon.makeLineSpan("hdashline", options2, ruleThickness); - var vListElems = [{ - type: "elem", - elem: body, - shift: 0 - }]; - while (hlines.length > 0) { - var hline = hlines.pop(); - var lineShift = hline.pos - offset; - if (hline.isDashed) { - vListElems.push({ - type: "elem", - elem: dashes, - shift: lineShift - }); - } else { - vListElems.push({ - type: "elem", - elem: line2, - shift: lineShift - }); + let c4ShapeFontConf = getC4ShapeFont(conf8, c4Shape.typeC4Shape.text); + c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>"); + switch (c4Shape.typeC4Shape.text) { + case "person": + case "external_person": + drawImage2( + c4ShapeElem, + 48, + 48, + c4Shape.x + c4Shape.width / 2 - 24, + c4Shape.y + c4Shape.image.Y, + personImg + ); + break; } - } - body = buildCommon.makeVList({ - positionType: "individualShift", - children: vListElems - }, options2); + let textFontConf = conf8[c4Shape.typeC4Shape.text + "Font"](); + textFontConf.fontWeight = "bold"; + textFontConf.fontSize = textFontConf.fontSize + 2; + textFontConf.fontColor = fontColor; + _drawTextCandidateFunc(conf8)( + c4Shape.label.text, + c4ShapeElem, + c4Shape.x, + c4Shape.y + c4Shape.label.Y, + c4Shape.width, + c4Shape.height, + { fill: fontColor }, + textFontConf + ); + textFontConf = conf8[c4Shape.typeC4Shape.text + "Font"](); + textFontConf.fontColor = fontColor; + if (c4Shape.techn && c4Shape.techn?.text !== "") { + _drawTextCandidateFunc(conf8)( + c4Shape.techn.text, + c4ShapeElem, + c4Shape.x, + c4Shape.y + c4Shape.techn.Y, + c4Shape.width, + c4Shape.height, + { fill: fontColor, "font-style": "italic" }, + textFontConf + ); + } else if (c4Shape.type && c4Shape.type.text !== "") { + _drawTextCandidateFunc(conf8)( + c4Shape.type.text, + c4ShapeElem, + c4Shape.x, + c4Shape.y + c4Shape.type.Y, + c4Shape.width, + c4Shape.height, + { fill: fontColor, "font-style": "italic" }, + textFontConf + ); + } + if (c4Shape.descr && c4Shape.descr.text !== "") { + textFontConf = conf8.personFont(); + textFontConf.fontColor = fontColor; + _drawTextCandidateFunc(conf8)( + c4Shape.descr.text, + c4ShapeElem, + c4Shape.x, + c4Shape.y + c4Shape.descr.Y, + c4Shape.width, + c4Shape.height, + { fill: fontColor }, + textFontConf + ); + } + return c4Shape.height; + }, "drawC4Shape"); + insertDatabaseIcon = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr( + "d", + "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z" + ); + }, "insertDatabaseIcon"); + insertComputerIcon = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( + "d", + "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z" + ); + }, "insertComputerIcon"); + insertClockIcon = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( + "d", + "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z" + ); + }, "insertClockIcon"); + insertArrowHead = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z"); + }, "insertArrowHead"); + insertArrowEnd = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z"); + }, "insertArrowEnd"); + insertArrowFilledHead = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + }, "insertArrowFilledHead"); + insertDynamicNumber = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6); + }, "insertDynamicNumber"); + insertArrowCrossHead = /* @__PURE__ */ __name(function(elem) { + const defs2 = elem.append("defs"); + const marker = defs2.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4); + marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z"); + marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7"); + }, "insertArrowCrossHead"); + getC4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => { + return { + fontFamily: cnf[typeC4Shape + "FontFamily"], + fontSize: cnf[typeC4Shape + "FontSize"], + fontWeight: cnf[typeC4Shape + "FontWeight"] + }; + }, "getC4ShapeFont"); + _drawTextCandidateFunc = /* @__PURE__ */ function() { + function byText(content, g2, x5, y5, width3, height2, textAttrs) { + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("text-anchor", "middle").text(content); + _setTextAttrs(text2, textAttrs); + } + __name(byText, "byText"); + function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const { fontSize, fontFamily, fontWeight } = conf8; + const lines = content.split(common_default.lineBreakRegex); + for (let i2 = 0; i2 < lines.length; i2++) { + const dy = i2 * fontSize - fontSize * (lines.length - 1) / 2; + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily); + text2.append("tspan").attr("dy", dy).text(lines[i2]).attr("alignment-baseline", "mathematical"); + _setTextAttrs(text2, textAttrs); + } + } + __name(byTspan, "byTspan"); + function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const s2 = g2.append("switch"); + const f3 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2); + const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); + text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); + byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8); + _setTextAttrs(text2, textAttrs); + } + __name(byFo, "byFo"); + function _setTextAttrs(toText, fromTextAttrsDict) { + for (const key in fromTextAttrsDict) { + if (fromTextAttrsDict.hasOwnProperty(key)) { + toText.attr(key, fromTextAttrsDict[key]); + } + } + } + __name(_setTextAttrs, "_setTextAttrs"); + return function(conf8) { + return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan; + }; + }(); + svgDraw_default = { + drawRect: drawRect2, + drawBoundary, + drawC4Shape, + drawRels, + drawImage: drawImage2, + insertArrowHead, + insertArrowEnd, + insertArrowFilledHead, + insertDynamicNumber, + insertArrowCrossHead, + insertDatabaseIcon, + insertComputerIcon, + insertClockIcon + }; } - if (tagSpans.length === 0) { - return buildCommon.makeSpan(["mord"], [body], options2); - } else { - var eqnNumCol = buildCommon.makeVList({ - positionType: "individualShift", - children: tagSpans - }, options2); - eqnNumCol = buildCommon.makeSpan(["tag"], [eqnNumCol], options2); - return buildCommon.makeFragment([body, eqnNumCol]); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js + var freeGlobal, freeGlobal_default; + var init_freeGlobal = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js"() { + "use strict"; + freeGlobal = typeof global == "object" && global && global.Object === Object && global; + freeGlobal_default = freeGlobal; } - }; - var alignMap = { - c: "center ", - l: "left ", - r: "right " - }; - var mathmlBuilder$5 = function mathmlBuilder2(group, options2) { - var tbl = []; - var glue = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]); - var tag = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]); - for (var i2 = 0; i2 < group.body.length; i2++) { - var rw = group.body[i2]; - var row = []; - for (var j = 0; j < rw.length; j++) { - row.push(new mathMLTree.MathNode("mtd", [buildGroup(rw[j], options2)])); - } - if (group.tags && group.tags[i2]) { - row.unshift(glue); - row.push(glue); - if (group.leqno) { - row.unshift(tag); - } else { - row.push(tag); - } - } - tbl.push(new mathMLTree.MathNode("mtr", row)); - } - var table = new mathMLTree.MathNode("mtable", tbl); - var gap = group.arraystretch === 0.5 ? 0.1 : 0.16 + group.arraystretch - 1 + (group.addJot ? 0.09 : 0); - table.setAttribute("rowspacing", makeEm(gap)); - var menclose = ""; - var align = ""; - if (group.cols && group.cols.length > 0) { - var cols = group.cols; - var columnLines = ""; - var prevTypeWasAlign = false; - var iStart = 0; - var iEnd = cols.length; - if (cols[0].type === "separator") { - menclose += "top "; - iStart = 1; - } - if (cols[cols.length - 1].type === "separator") { - menclose += "bottom "; - iEnd -= 1; - } - for (var _i6 = iStart; _i6 < iEnd; _i6++) { - if (cols[_i6].type === "align") { - align += alignMap[cols[_i6].align]; - if (prevTypeWasAlign) { - columnLines += "none "; - } - prevTypeWasAlign = true; - } else if (cols[_i6].type === "separator") { - if (prevTypeWasAlign) { - columnLines += cols[_i6].separator === "|" ? "solid " : "dashed "; - prevTypeWasAlign = false; - } - } - } - table.setAttribute("columnalign", align.trim()); - if (/[sd]/.test(columnLines)) { - table.setAttribute("columnlines", columnLines.trim()); - } - } - if (group.colSeparationType === "align") { - var _cols = group.cols || []; - var spacing2 = ""; - for (var _i22 = 1; _i22 < _cols.length; _i22++) { - spacing2 += _i22 % 2 ? "0em " : "1em "; - } - table.setAttribute("columnspacing", spacing2.trim()); - } else if (group.colSeparationType === "alignat" || group.colSeparationType === "gather") { - table.setAttribute("columnspacing", "0em"); - } else if (group.colSeparationType === "small") { - table.setAttribute("columnspacing", "0.2778em"); - } else if (group.colSeparationType === "CD") { - table.setAttribute("columnspacing", "0.5em"); - } else { - table.setAttribute("columnspacing", "1em"); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js + var freeSelf, root2, root_default; + var init_root = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js"() { + "use strict"; + init_freeGlobal(); + freeSelf = typeof self == "object" && self && self.Object === Object && self; + root2 = freeGlobal_default || freeSelf || Function("return this")(); + root_default = root2; } - var rowLines = ""; - var hlines = group.hLinesBeforeRow; - menclose += hlines[0].length > 0 ? "left " : ""; - menclose += hlines[hlines.length - 1].length > 0 ? "right " : ""; - for (var _i32 = 1; _i32 < hlines.length - 1; _i32++) { - rowLines += hlines[_i32].length === 0 ? "none " : hlines[_i32][0] ? "dashed " : "solid "; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js + var Symbol2, Symbol_default; + var init_Symbol = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js"() { + "use strict"; + init_root(); + Symbol2 = root_default.Symbol; + Symbol_default = Symbol2; } - if (/[sd]/.test(rowLines)) { - table.setAttribute("rowlines", rowLines.trim()); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js + function getRawTag(value2) { + var isOwn = hasOwnProperty.call(value2, symToStringTag), tag2 = value2[symToStringTag]; + try { + value2[symToStringTag] = void 0; + var unmasked = true; + } catch (e3) { } - if (menclose !== "") { - table = new mathMLTree.MathNode("menclose", [table]); - table.setAttribute("notation", menclose.trim()); + var result = nativeObjectToString.call(value2); + if (unmasked) { + if (isOwn) { + value2[symToStringTag] = tag2; + } else { + delete value2[symToStringTag]; + } } - if (group.arraystretch && group.arraystretch < 1) { - table = new mathMLTree.MathNode("mstyle", [table]); - table.setAttribute("scriptlevel", "1"); + return result; + } + var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, getRawTag_default; + var init_getRawTag = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js"() { + "use strict"; + init_Symbol(); + objectProto = Object.prototype; + hasOwnProperty = objectProto.hasOwnProperty; + nativeObjectToString = objectProto.toString; + symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0; + __name(getRawTag, "getRawTag"); + getRawTag_default = getRawTag; } - return table; - }; - var alignedHandler = function alignedHandler2(context, args) { - if (context.envName.indexOf("ed") === -1) { - validateAmsEnvironmentContext(context); - } - var cols = []; - var separationType = context.envName.indexOf("at") > -1 ? "alignat" : "align"; - var isSplit = context.envName === "split"; - var res = parseArray(context.parser, { - cols, - addJot: true, - autoTag: isSplit ? void 0 : getAutoTag(context.envName), - emptySingleRow: true, - colSeparationType: separationType, - maxNumCols: isSplit ? 2 : void 0, - leqno: context.parser.settings.leqno - }, "display"); - var numMaths; - var numCols = 0; - var emptyGroup = { - type: "ordgroup", - mode: context.mode, - body: [] - }; - if (args[0] && args[0].type === "ordgroup") { - var arg0 = ""; - for (var i2 = 0; i2 < args[0].body.length; i2++) { - var textord2 = assertNodeType(args[0].body[i2], "textord"); - arg0 += textord2.text; - } - numMaths = Number(arg0); - numCols = numMaths * 2; - } - var isAligned = !numCols; - res.body.forEach(function(row) { - for (var _i42 = 1; _i42 < row.length; _i42 += 2) { - var styling = assertNodeType(row[_i42], "styling"); - var ordgroup = assertNodeType(styling.body[0], "ordgroup"); - ordgroup.body.unshift(emptyGroup); - } - if (!isAligned) { - var curMaths = row.length / 2; - if (numMaths < curMaths) { - throw new ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]); - } - } else if (numCols < row.length) { - numCols = row.length; - } - }); - for (var _i52 = 0; _i52 < numCols; ++_i52) { - var align = "r"; - var pregap = 0; - if (_i52 % 2 === 1) { - align = "l"; - } else if (_i52 > 0 && isAligned) { - pregap = 1; - } - cols[_i52] = { - type: "align", - align, - pregap, - postgap: 0 - }; - } - res.colSeparationType = isAligned ? "align" : "alignat"; - return res; - }; - defineEnvironment({ - type: "array", - names: ["array", "darray"], - props: { - numArgs: 1 - }, - handler(context, args) { - var symNode = checkSymbolNodeType(args[0]); - var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; - var cols = colalign.map(function(nde) { - var node2 = assertSymbolNodeType(nde); - var ca = node2.text; - if ("lcr".indexOf(ca) !== -1) { - return { - type: "align", - align: ca - }; - } else if (ca === "|") { - return { - type: "separator", - separator: "|" - }; - } else if (ca === ":") { - return { - type: "separator", - separator: ":" - }; - } - throw new ParseError("Unknown column alignment: " + ca, nde); - }); - var res = { - cols, - hskipBeforeAndAfter: true, - // \@preamble in lttab.dtx - maxNumCols: cols.length - }; - return parseArray(context.parser, res, dCellStyle(context.envName)); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"], - props: { - numArgs: 0 - }, - handler(context) { - var delimiters2 = { - "matrix": null, - "pmatrix": ["(", ")"], - "bmatrix": ["[", "]"], - "Bmatrix": ["\\{", "\\}"], - "vmatrix": ["|", "|"], - "Vmatrix": ["\\Vert", "\\Vert"] - }[context.envName.replace("*", "")]; - var colAlign = "c"; - var payload = { - hskipBeforeAndAfter: false, - cols: [{ - type: "align", - align: colAlign - }] - }; - if (context.envName.charAt(context.envName.length - 1) === "*") { - var parser2 = context.parser; - parser2.consumeSpaces(); - if (parser2.fetch().text === "[") { - parser2.consume(); - parser2.consumeSpaces(); - colAlign = parser2.fetch().text; - if ("lcr".indexOf(colAlign) === -1) { - throw new ParseError("Expected l or c or r", parser2.nextToken); - } - parser2.consume(); - parser2.consumeSpaces(); - parser2.expect("]"); - parser2.consume(); - payload.cols = [{ - type: "align", - align: colAlign - }]; - } - } - var res = parseArray(context.parser, payload, dCellStyle(context.envName)); - var numCols = Math.max(0, ...res.body.map((row) => row.length)); - res.cols = new Array(numCols).fill({ - type: "align", - align: colAlign - }); - return delimiters2 ? { - type: "leftright", - mode: context.mode, - body: [res], - left: delimiters2[0], - right: delimiters2[1], - rightColor: void 0 - // \right uninfluenced by \color in array - } : res; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["smallmatrix"], - props: { - numArgs: 0 - }, - handler(context) { - var payload = { - arraystretch: 0.5 - }; - var res = parseArray(context.parser, payload, "script"); - res.colSeparationType = "small"; - return res; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["subarray"], - props: { - numArgs: 1 - }, - handler(context, args) { - var symNode = checkSymbolNodeType(args[0]); - var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body; - var cols = colalign.map(function(nde) { - var node2 = assertSymbolNodeType(nde); - var ca = node2.text; - if ("lc".indexOf(ca) !== -1) { - return { - type: "align", - align: ca - }; - } - throw new ParseError("Unknown column alignment: " + ca, nde); - }); - if (cols.length > 1) { - throw new ParseError("{subarray} can contain only one column"); - } - var res = { - cols, - hskipBeforeAndAfter: false, - arraystretch: 0.5 - }; - res = parseArray(context.parser, res, "script"); - if (res.body.length > 0 && res.body[0].length > 1) { - throw new ParseError("{subarray} can contain only one column"); - } - return res; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["cases", "dcases", "rcases", "drcases"], - props: { - numArgs: 0 - }, - handler(context) { - var payload = { - arraystretch: 1.2, - cols: [{ - type: "align", - align: "l", - pregap: 0, - // TODO(kevinb) get the current style. - // For now we use the metrics for TEXT style which is what we were - // doing before. Before attempting to get the current style we - // should look at TeX's behavior especially for \over and matrices. - postgap: 1 - /* 1em quad */ - }, { - type: "align", - align: "l", - pregap: 0, - postgap: 0 - }] - }; - var res = parseArray(context.parser, payload, dCellStyle(context.envName)); - return { - type: "leftright", - mode: context.mode, - body: [res], - left: context.envName.indexOf("r") > -1 ? "." : "\\{", - right: context.envName.indexOf("r") > -1 ? "\\}" : ".", - rightColor: void 0 - }; - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["align", "align*", "aligned", "split"], - props: { - numArgs: 0 - }, - handler: alignedHandler, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["gathered", "gather", "gather*"], - props: { - numArgs: 0 - }, - handler(context) { - if (utils.contains(["gather", "gather*"], context.envName)) { - validateAmsEnvironmentContext(context); - } - var res = { - cols: [{ - type: "align", - align: "c" - }], - addJot: true, - colSeparationType: "gather", - autoTag: getAutoTag(context.envName), - emptySingleRow: true, - leqno: context.parser.settings.leqno - }; - return parseArray(context.parser, res, "display"); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["alignat", "alignat*", "alignedat"], - props: { - numArgs: 1 - }, - handler: alignedHandler, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["equation", "equation*"], - props: { - numArgs: 0 - }, - handler(context) { - validateAmsEnvironmentContext(context); - var res = { - autoTag: getAutoTag(context.envName), - emptySingleRow: true, - singleRow: true, - maxNumCols: 1, - leqno: context.parser.settings.leqno - }; - return parseArray(context.parser, res, "display"); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineEnvironment({ - type: "array", - names: ["CD"], - props: { - numArgs: 0 - }, - handler(context) { - validateAmsEnvironmentContext(context); - return parseCD(context.parser); - }, - htmlBuilder: htmlBuilder$6, - mathmlBuilder: mathmlBuilder$5 - }); - defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}"); - defineMacro("\\notag", "\\nonumber"); - defineFunction({ - type: "text", - // Doesn't matter what this is. - names: ["\\hline", "\\hdashline"], - props: { - numArgs: 0, - allowedInText: true, - allowedInMath: true - }, - handler(context, args) { - throw new ParseError(context.funcName + " valid only within array environment"); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js + function objectToString(value2) { + return nativeObjectToString2.call(value2); + } + var objectProto2, nativeObjectToString2, objectToString_default; + var init_objectToString = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js"() { + "use strict"; + objectProto2 = Object.prototype; + nativeObjectToString2 = objectProto2.toString; + __name(objectToString, "objectToString"); + objectToString_default = objectToString; } }); - var environments = _environments; - defineFunction({ - type: "environment", - names: ["\\begin", "\\end"], - props: { - numArgs: 1, - argTypes: ["text"] - }, - handler(_ref, args) { - var { - parser: parser2, - funcName - } = _ref; - var nameGroup = args[0]; - if (nameGroup.type !== "ordgroup") { - throw new ParseError("Invalid environment name", nameGroup); - } - var envName = ""; - for (var i2 = 0; i2 < nameGroup.body.length; ++i2) { - envName += assertNodeType(nameGroup.body[i2], "textord").text; - } - if (funcName === "\\begin") { - if (!environments.hasOwnProperty(envName)) { - throw new ParseError("No such environment: " + envName, nameGroup); - } - var env = environments[envName]; - var { - args: _args, - optArgs - } = parser2.parseArguments("\\begin{" + envName + "}", env); - var context = { - mode: parser2.mode, - envName, - parser: parser2 - }; - var result = env.handler(context, _args, optArgs); - parser2.expect("\\end", false); - var endNameToken = parser2.nextToken; - var end2 = assertNodeType(parser2.parseFunction(), "environment"); - if (end2.name !== envName) { - throw new ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end2.name + "}", endNameToken); - } - return result; - } - return { - type: "environment", - mode: parser2.mode, - name: envName, - nameGroup - }; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js + function baseGetTag(value2) { + if (value2 == null) { + return value2 === void 0 ? undefinedTag : nullTag; + } + return symToStringTag2 && symToStringTag2 in Object(value2) ? getRawTag_default(value2) : objectToString_default(value2); + } + var nullTag, undefinedTag, symToStringTag2, baseGetTag_default; + var init_baseGetTag = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js"() { + "use strict"; + init_Symbol(); + init_getRawTag(); + init_objectToString(); + nullTag = "[object Null]"; + undefinedTag = "[object Undefined]"; + symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0; + __name(baseGetTag, "baseGetTag"); + baseGetTag_default = baseGetTag; } }); - var htmlBuilder$5 = (group, options2) => { - var font = group.font; - var newOptions = options2.withFont(font); - return buildGroup$1(group.body, newOptions); - }; - var mathmlBuilder$4 = (group, options2) => { - var font = group.font; - var newOptions = options2.withFont(font); - return buildGroup(group.body, newOptions); - }; - var fontAliases = { - "\\Bbb": "\\mathbb", - "\\bold": "\\mathbf", - "\\frak": "\\mathfrak", - "\\bm": "\\boldsymbol" - }; - defineFunction({ - type: "font", - names: [ - // styles, except \boldsymbol defined below - "\\mathrm", - "\\mathit", - "\\mathbf", - "\\mathnormal", - // families - "\\mathbb", - "\\mathcal", - "\\mathfrak", - "\\mathscr", - "\\mathsf", - "\\mathtt", - // aliases, except \bm defined below - "\\Bbb", - "\\bold", - "\\frak" - ], - props: { - numArgs: 1, - allowedInArgument: true - }, - handler: (_ref, args) => { - var { - parser: parser2, - funcName - } = _ref; - var body = normalizeArgument(args[0]); - var func = funcName; - if (func in fontAliases) { - func = fontAliases[func]; - } - return { - type: "font", - mode: parser2.mode, - font: func.slice(1), - body - }; - }, - htmlBuilder: htmlBuilder$5, - mathmlBuilder: mathmlBuilder$4 - }); - defineFunction({ - type: "mclass", - names: ["\\boldsymbol", "\\bm"], - props: { - numArgs: 1 - }, - handler: (_ref2, args) => { - var { - parser: parser2 - } = _ref2; - var body = args[0]; - var isCharacterBox2 = utils.isCharacterBox(body); - return { - type: "mclass", - mode: parser2.mode, - mclass: binrelClass(body), - body: [{ - type: "font", - mode: parser2.mode, - font: "boldsymbol", - body - }], - isCharacterBox: isCharacterBox2 - }; - } - }); - defineFunction({ - type: "font", - names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"], - props: { - numArgs: 0, - allowedInText: true - }, - handler: (_ref3, args) => { - var { - parser: parser2, - funcName, - breakOnTokenText - } = _ref3; - var { - mode - } = parser2; - var body = parser2.parseExpression(true, breakOnTokenText); - var style = "math" + funcName.slice(1); - return { - type: "font", - mode, - font: style, - body: { - type: "ordgroup", - mode: parser2.mode, - body - } - }; - }, - htmlBuilder: htmlBuilder$5, - mathmlBuilder: mathmlBuilder$4 - }); - var adjustStyle = (size2, originalStyle) => { - var style = originalStyle; - if (size2 === "display") { - style = style.id >= Style$1.SCRIPT.id ? style.text() : Style$1.DISPLAY; - } else if (size2 === "text" && style.size === Style$1.DISPLAY.size) { - style = Style$1.TEXT; - } else if (size2 === "script") { - style = Style$1.SCRIPT; - } else if (size2 === "scriptscript") { - style = Style$1.SCRIPTSCRIPT; - } - return style; - }; - var htmlBuilder$4 = (group, options2) => { - var style = adjustStyle(group.size, options2.style); - var nstyle = style.fracNum(); - var dstyle = style.fracDen(); - var newOptions; - newOptions = options2.havingStyle(nstyle); - var numerm = buildGroup$1(group.numer, newOptions, options2); - if (group.continued) { - var hStrut = 8.5 / options2.fontMetrics().ptPerEm; - var dStrut = 3.5 / options2.fontMetrics().ptPerEm; - numerm.height = numerm.height < hStrut ? hStrut : numerm.height; - numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth; - } - newOptions = options2.havingStyle(dstyle); - var denomm = buildGroup$1(group.denom, newOptions, options2); - var rule; - var ruleWidth; - var ruleSpacing; - if (group.hasBarLine) { - if (group.barSize) { - ruleWidth = calculateSize(group.barSize, options2); - rule = buildCommon.makeLineSpan("frac-line", options2, ruleWidth); - } else { - rule = buildCommon.makeLineSpan("frac-line", options2); - } - ruleWidth = rule.height; - ruleSpacing = rule.height; - } else { - rule = null; - ruleWidth = 0; - ruleSpacing = options2.fontMetrics().defaultRuleThickness; - } - var numShift; - var clearance; - var denomShift; - if (style.size === Style$1.DISPLAY.size || group.size === "display") { - numShift = options2.fontMetrics().num1; - if (ruleWidth > 0) { - clearance = 3 * ruleSpacing; - } else { - clearance = 7 * ruleSpacing; - } - denomShift = options2.fontMetrics().denom1; - } else { - if (ruleWidth > 0) { - numShift = options2.fontMetrics().num2; - clearance = ruleSpacing; - } else { - numShift = options2.fontMetrics().num3; - clearance = 3 * ruleSpacing; - } - denomShift = options2.fontMetrics().denom2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js + function isObject(value2) { + var type3 = typeof value2; + return value2 != null && (type3 == "object" || type3 == "function"); + } + var isObject_default; + var init_isObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js"() { + "use strict"; + __name(isObject, "isObject"); + isObject_default = isObject; } - var frac; - if (!rule) { - var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift); - if (candidateClearance < clearance) { - numShift += 0.5 * (clearance - candidateClearance); - denomShift += 0.5 * (clearance - candidateClearance); - } - frac = buildCommon.makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: denomm, - shift: denomShift - }, { - type: "elem", - elem: numerm, - shift: -numShift - }] - }, options2); - } else { - var axisHeight = options2.fontMetrics().axisHeight; - if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) { - numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth)); - } - if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) { - denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift)); - } - var midShift = -(axisHeight - 0.5 * ruleWidth); - frac = buildCommon.makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: denomm, - shift: denomShift - }, { - type: "elem", - elem: rule, - shift: midShift - }, { - type: "elem", - elem: numerm, - shift: -numShift - }] - }, options2); - } - newOptions = options2.havingStyle(style); - frac.height *= newOptions.sizeMultiplier / options2.sizeMultiplier; - frac.depth *= newOptions.sizeMultiplier / options2.sizeMultiplier; - var delimSize; - if (style.size === Style$1.DISPLAY.size) { - delimSize = options2.fontMetrics().delim1; - } else if (style.size === Style$1.SCRIPTSCRIPT.size) { - delimSize = options2.havingStyle(Style$1.SCRIPT).fontMetrics().delim2; - } else { - delimSize = options2.fontMetrics().delim2; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js + function isFunction(value2) { + if (!isObject_default(value2)) { + return false; } - var leftDelim; - var rightDelim; - if (group.leftDelim == null) { - leftDelim = makeNullDelimiter(options2, ["mopen"]); - } else { - leftDelim = delimiter.customSizedDelim(group.leftDelim, delimSize, true, options2.havingStyle(style), group.mode, ["mopen"]); + var tag2 = baseGetTag_default(value2); + return tag2 == funcTag || tag2 == genTag || tag2 == asyncTag || tag2 == proxyTag; + } + var asyncTag, funcTag, genTag, proxyTag, isFunction_default; + var init_isFunction = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js"() { + "use strict"; + init_baseGetTag(); + init_isObject(); + asyncTag = "[object AsyncFunction]"; + funcTag = "[object Function]"; + genTag = "[object GeneratorFunction]"; + proxyTag = "[object Proxy]"; + __name(isFunction, "isFunction"); + isFunction_default = isFunction; } - if (group.continued) { - rightDelim = buildCommon.makeSpan([]); - } else if (group.rightDelim == null) { - rightDelim = makeNullDelimiter(options2, ["mclose"]); - } else { - rightDelim = delimiter.customSizedDelim(group.rightDelim, delimSize, true, options2.havingStyle(style), group.mode, ["mclose"]); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js + var coreJsData, coreJsData_default; + var init_coreJsData = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js"() { + "use strict"; + init_root(); + coreJsData = root_default["__core-js_shared__"]; + coreJsData_default = coreJsData; } - return buildCommon.makeSpan(["mord"].concat(newOptions.sizingClasses(options2)), [leftDelim, buildCommon.makeSpan(["mfrac"], [frac]), rightDelim], options2); - }; - var mathmlBuilder$3 = (group, options2) => { - var node2 = new mathMLTree.MathNode("mfrac", [buildGroup(group.numer, options2), buildGroup(group.denom, options2)]); - if (!group.hasBarLine) { - node2.setAttribute("linethickness", "0px"); - } else if (group.barSize) { - var ruleWidth = calculateSize(group.barSize, options2); - node2.setAttribute("linethickness", makeEm(ruleWidth)); - } - var style = adjustStyle(group.size, options2.style); - if (style.size !== options2.style.size) { - node2 = new mathMLTree.MathNode("mstyle", [node2]); - var isDisplay = style.size === Style$1.DISPLAY.size ? "true" : "false"; - node2.setAttribute("displaystyle", isDisplay); - node2.setAttribute("scriptlevel", "0"); - } - if (group.leftDelim != null || group.rightDelim != null) { - var withDelims = []; - if (group.leftDelim != null) { - var leftOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.leftDelim.replace("\\", ""))]); - leftOp.setAttribute("fence", "true"); - withDelims.push(leftOp); - } - withDelims.push(node2); - if (group.rightDelim != null) { - var rightOp = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(group.rightDelim.replace("\\", ""))]); - rightOp.setAttribute("fence", "true"); - withDelims.push(rightOp); - } - return makeRow(withDelims); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + var maskSrcKey, isMasked_default; + var init_isMasked = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js"() { + "use strict"; + init_coreJsData(); + maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + __name(isMasked, "isMasked"); + isMasked_default = isMasked; } - return node2; - }; - defineFunction({ - type: "genfrac", - names: [ - "\\dfrac", - "\\frac", - "\\tfrac", - "\\dbinom", - "\\binom", - "\\tbinom", - "\\\\atopfrac", - // can’t be entered directly - "\\\\bracefrac", - "\\\\brackfrac" - // ditto - ], - props: { - numArgs: 2, - allowedInArgument: true - }, - handler: (_ref, args) => { - var { - parser: parser2, - funcName - } = _ref; - var numer = args[0]; - var denom = args[1]; - var hasBarLine; - var leftDelim = null; - var rightDelim = null; - var size2 = "auto"; - switch (funcName) { - case "\\dfrac": - case "\\frac": - case "\\tfrac": - hasBarLine = true; - break; - case "\\\\atopfrac": - hasBarLine = false; - break; - case "\\dbinom": - case "\\binom": - case "\\tbinom": - hasBarLine = false; - leftDelim = "("; - rightDelim = ")"; - break; - case "\\\\bracefrac": - hasBarLine = false; - leftDelim = "\\{"; - rightDelim = "\\}"; - break; - case "\\\\brackfrac": - hasBarLine = false; - leftDelim = "["; - rightDelim = "]"; - break; - default: - throw new Error("Unrecognized genfrac command"); - } - switch (funcName) { - case "\\dfrac": - case "\\dbinom": - size2 = "display"; - break; - case "\\tfrac": - case "\\tbinom": - size2 = "text"; - break; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e3) { } - return { - type: "genfrac", - mode: parser2.mode, - continued: false, - numer, - denom, - hasBarLine, - leftDelim, - rightDelim, - size: size2, - barSize: null - }; - }, - htmlBuilder: htmlBuilder$4, - mathmlBuilder: mathmlBuilder$3 - }); - defineFunction({ - type: "genfrac", - names: ["\\cfrac"], - props: { - numArgs: 2 - }, - handler: (_ref2, args) => { - var { - parser: parser2, - funcName - } = _ref2; - var numer = args[0]; - var denom = args[1]; - return { - type: "genfrac", - mode: parser2.mode, - continued: true, - numer, - denom, - hasBarLine: true, - leftDelim: null, - rightDelim: null, - size: "display", - barSize: null - }; - } - }); - defineFunction({ - type: "infix", - names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"], - props: { - numArgs: 0, - infix: true - }, - handler(_ref3) { - var { - parser: parser2, - funcName, - token: token2 - } = _ref3; - var replaceWith; - switch (funcName) { - case "\\over": - replaceWith = "\\frac"; - break; - case "\\choose": - replaceWith = "\\binom"; - break; - case "\\atop": - replaceWith = "\\\\atopfrac"; - break; - case "\\brace": - replaceWith = "\\\\bracefrac"; - break; - case "\\brack": - replaceWith = "\\\\brackfrac"; - break; - default: - throw new Error("Unrecognized infix genfrac command"); + try { + return func + ""; + } catch (e3) { } - return { - type: "infix", - mode: parser2.mode, - replaceWith, - token: token2 - }; + } + return ""; + } + var funcProto, funcToString, toSource_default; + var init_toSource = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js"() { + "use strict"; + funcProto = Function.prototype; + funcToString = funcProto.toString; + __name(toSource, "toSource"); + toSource_default = toSource; } }); - var stylArray = ["display", "text", "script", "scriptscript"]; - var delimFromValue = function delimFromValue2(delimString) { - var delim = null; - if (delimString.length > 0) { - delim = delimString; - delim = delim === "." ? null : delim; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js + function baseIsNative(value2) { + if (!isObject_default(value2) || isMasked_default(value2)) { + return false; } - return delim; - }; - defineFunction({ - type: "genfrac", - names: ["\\genfrac"], - props: { - numArgs: 6, - allowedInArgument: true, - argTypes: ["math", "math", "size", "text", "math", "math"] - }, - handler(_ref4, args) { - var { - parser: parser2 - } = _ref4; - var numer = args[4]; - var denom = args[5]; - var leftNode = normalizeArgument(args[0]); - var leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null; - var rightNode = normalizeArgument(args[1]); - var rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null; - var barNode = assertNodeType(args[2], "size"); - var hasBarLine; - var barSize = null; - if (barNode.isBlank) { - hasBarLine = true; - } else { - barSize = barNode.value; - hasBarLine = barSize.number > 0; - } - var size2 = "auto"; - var styl = args[3]; - if (styl.type === "ordgroup") { - if (styl.body.length > 0) { - var textOrd = assertNodeType(styl.body[0], "textord"); - size2 = stylArray[Number(textOrd.text)]; - } - } else { - styl = assertNodeType(styl, "textord"); - size2 = stylArray[Number(styl.text)]; - } - return { - type: "genfrac", - mode: parser2.mode, - numer, - denom, - continued: false, - hasBarLine, - barSize, - leftDelim, - rightDelim, - size: size2 - }; - }, - htmlBuilder: htmlBuilder$4, - mathmlBuilder: mathmlBuilder$3 - }); - defineFunction({ - type: "infix", - names: ["\\above"], - props: { - numArgs: 1, - argTypes: ["size"], - infix: true - }, - handler(_ref5, args) { - var { - parser: parser2, - funcName, - token: token2 - } = _ref5; - return { - type: "infix", - mode: parser2.mode, - replaceWith: "\\\\abovefrac", - size: assertNodeType(args[0], "size").value, - token: token2 - }; + var pattern = isFunction_default(value2) ? reIsNative : reIsHostCtor; + return pattern.test(toSource_default(value2)); + } + var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, baseIsNative_default; + var init_baseIsNative = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js"() { + "use strict"; + init_isFunction(); + init_isMasked(); + init_isObject(); + init_toSource(); + reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + reIsHostCtor = /^\[object .+?Constructor\]$/; + funcProto2 = Function.prototype; + objectProto3 = Object.prototype; + funcToString2 = funcProto2.toString; + hasOwnProperty2 = objectProto3.hasOwnProperty; + reIsNative = RegExp( + "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + __name(baseIsNative, "baseIsNative"); + baseIsNative_default = baseIsNative; } }); - defineFunction({ - type: "genfrac", - names: ["\\\\abovefrac"], - props: { - numArgs: 3, - argTypes: ["math", "size", "math"] - }, - handler: (_ref6, args) => { - var { - parser: parser2, - funcName - } = _ref6; - var numer = args[0]; - var barSize = assert(assertNodeType(args[1], "infix").size); - var denom = args[2]; - var hasBarLine = barSize.number > 0; - return { - type: "genfrac", - mode: parser2.mode, - numer, - denom, - continued: false, - hasBarLine, - barSize, - leftDelim: null, - rightDelim: null, - size: "auto" - }; - }, - htmlBuilder: htmlBuilder$4, - mathmlBuilder: mathmlBuilder$3 - }); - var htmlBuilder$3 = (grp, options2) => { - var style = options2.style; - var supSubGroup; - var group; - if (grp.type === "supsub") { - supSubGroup = grp.sup ? buildGroup$1(grp.sup, options2.havingStyle(style.sup()), options2) : buildGroup$1(grp.sub, options2.havingStyle(style.sub()), options2); - group = assertNodeType(grp.base, "horizBrace"); - } else { - group = assertNodeType(grp, "horizBrace"); - } - var body = buildGroup$1(group.base, options2.havingBaseStyle(Style$1.DISPLAY)); - var braceBody = stretchy.svgSpan(group, options2); - var vlist; - if (group.isOver) { - vlist = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: body - }, { - type: "kern", - size: 0.1 - }, { - type: "elem", - elem: braceBody - }] - }, options2); - vlist.children[0].children[0].children[1].classes.push("svg-align"); - } else { - vlist = buildCommon.makeVList({ - positionType: "bottom", - positionData: body.depth + 0.1 + braceBody.height, - children: [{ - type: "elem", - elem: braceBody - }, { - type: "kern", - size: 0.1 - }, { - type: "elem", - elem: body - }] - }, options2); - vlist.children[0].children[0].children[0].classes.push("svg-align"); - } - if (supSubGroup) { - var vSpan = buildCommon.makeSpan(["mord", group.isOver ? "mover" : "munder"], [vlist], options2); - if (group.isOver) { - vlist = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: vSpan - }, { - type: "kern", - size: 0.2 - }, { - type: "elem", - elem: supSubGroup - }] - }, options2); - } else { - vlist = buildCommon.makeVList({ - positionType: "bottom", - positionData: vSpan.depth + 0.2 + supSubGroup.height + supSubGroup.depth, - children: [{ - type: "elem", - elem: supSubGroup - }, { - type: "kern", - size: 0.2 - }, { - type: "elem", - elem: vSpan - }] - }, options2); - } + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js + function getValue(object3, key) { + return object3 == null ? void 0 : object3[key]; + } + var getValue_default; + var init_getValue = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js"() { + "use strict"; + __name(getValue, "getValue"); + getValue_default = getValue; } - return buildCommon.makeSpan(["mord", group.isOver ? "mover" : "munder"], [vlist], options2); - }; - var mathmlBuilder$2 = (group, options2) => { - var accentNode = stretchy.mathMLnode(group.label); - return new mathMLTree.MathNode(group.isOver ? "mover" : "munder", [buildGroup(group.base, options2), accentNode]); - }; - defineFunction({ - type: "horizBrace", - names: ["\\overbrace", "\\underbrace"], - props: { - numArgs: 1 - }, - handler(_ref, args) { - var { - parser: parser2, - funcName - } = _ref; - return { - type: "horizBrace", - mode: parser2.mode, - label: funcName, - isOver: /^\\over/.test(funcName), - base: args[0] - }; - }, - htmlBuilder: htmlBuilder$3, - mathmlBuilder: mathmlBuilder$2 - }); - defineFunction({ - type: "href", - names: ["\\href"], - props: { - numArgs: 2, - argTypes: ["url", "original"], - allowedInText: true - }, - handler: (_ref, args) => { - var { - parser: parser2 - } = _ref; - var body = args[1]; - var href = assertNodeType(args[0], "url").url; - if (!parser2.settings.isTrusted({ - command: "\\href", - url: href - })) { - return parser2.formatUnsupportedCmd("\\href"); - } - return { - type: "href", - mode: parser2.mode, - href, - body: ordargument(body) - }; - }, - htmlBuilder: (group, options2) => { - var elements2 = buildExpression$1(group.body, options2, false); - return buildCommon.makeAnchor(group.href, [], elements2, options2); - }, - mathmlBuilder: (group, options2) => { - var math2 = buildExpressionRow(group.body, options2); - if (!(math2 instanceof MathNode)) { - math2 = new MathNode("mrow", [math2]); - } - math2.setAttribute("href", group.href); - return math2; - } - }); - defineFunction({ - type: "href", - names: ["\\url"], - props: { - numArgs: 1, - argTypes: ["url"], - allowedInText: true - }, - handler: (_ref2, args) => { - var { - parser: parser2 - } = _ref2; - var href = assertNodeType(args[0], "url").url; - if (!parser2.settings.isTrusted({ - command: "\\url", - url: href - })) { - return parser2.formatUnsupportedCmd("\\url"); - } - var chars = []; - for (var i2 = 0; i2 < href.length; i2++) { - var c2 = href[i2]; - if (c2 === "~") { - c2 = "\\textasciitilde"; - } - chars.push({ - type: "textord", - mode: "text", - text: c2 - }); - } - var body = { - type: "text", - mode: parser2.mode, - font: "\\texttt", - body: chars - }; - return { - type: "href", - mode: parser2.mode, - href, - body: ordargument(body) - }; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js + function getNative(object3, key) { + var value2 = getValue_default(object3, key); + return baseIsNative_default(value2) ? value2 : void 0; + } + var getNative_default; + var init_getNative = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js"() { + "use strict"; + init_baseIsNative(); + init_getValue(); + __name(getNative, "getNative"); + getNative_default = getNative; } }); - defineFunction({ - type: "hbox", - names: ["\\hbox"], - props: { - numArgs: 1, - argTypes: ["text"], - allowedInText: true, - primitive: true - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - return { - type: "hbox", - mode: parser2.mode, - body: ordargument(args[0]) - }; - }, - htmlBuilder(group, options2) { - var elements2 = buildExpression$1(group.body, options2, false); - return buildCommon.makeFragment(elements2); - }, - mathmlBuilder(group, options2) { - return new mathMLTree.MathNode("mrow", buildExpression(group.body, options2)); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js + var nativeCreate, nativeCreate_default; + var init_nativeCreate = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js"() { + "use strict"; + init_getNative(); + nativeCreate = getNative_default(Object, "create"); + nativeCreate_default = nativeCreate; } }); - defineFunction({ - type: "html", - names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"], - props: { - numArgs: 2, - argTypes: ["raw", "original"], - allowedInText: true - }, - handler: (_ref, args) => { - var { - parser: parser2, - funcName, - token: token2 - } = _ref; - var value2 = assertNodeType(args[0], "raw").string; - var body = args[1]; - if (parser2.settings.strict) { - parser2.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode"); - } - var trustContext; - var attributes = {}; - switch (funcName) { - case "\\htmlClass": - attributes.class = value2; - trustContext = { - command: "\\htmlClass", - class: value2 - }; - break; - case "\\htmlId": - attributes.id = value2; - trustContext = { - command: "\\htmlId", - id: value2 - }; - break; - case "\\htmlStyle": - attributes.style = value2; - trustContext = { - command: "\\htmlStyle", - style: value2 - }; - break; - case "\\htmlData": { - var data = value2.split(","); - for (var i2 = 0; i2 < data.length; i2++) { - var keyVal = data[i2].split("="); - if (keyVal.length !== 2) { - throw new ParseError("Error parsing key-value for \\htmlData"); - } - attributes["data-" + keyVal[0].trim()] = keyVal[1].trim(); - } - trustContext = { - command: "\\htmlData", - attributes - }; - break; - } - default: - throw new Error("Unrecognized html command"); - } - if (!parser2.settings.isTrusted(trustContext)) { - return parser2.formatUnsupportedCmd(funcName); - } - return { - type: "html", - mode: parser2.mode, - attributes, - body: ordargument(body) - }; - }, - htmlBuilder: (group, options2) => { - var elements2 = buildExpression$1(group.body, options2, false); - var classes2 = ["enclosing"]; - if (group.attributes.class) { - classes2.push(...group.attributes.class.trim().split(/\s+/)); - } - var span = buildCommon.makeSpan(classes2, elements2, options2); - for (var attr in group.attributes) { - if (attr !== "class" && group.attributes.hasOwnProperty(attr)) { - span.setAttribute(attr, group.attributes[attr]); - } - } - return span; - }, - mathmlBuilder: (group, options2) => { - return buildExpressionRow(group.body, options2); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js + function hashClear() { + this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {}; + this.size = 0; + } + var hashClear_default; + var init_hashClear = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js"() { + "use strict"; + init_nativeCreate(); + __name(hashClear, "hashClear"); + hashClear_default = hashClear; } }); - defineFunction({ - type: "htmlmathml", - names: ["\\html@mathml"], - props: { - numArgs: 2, - allowedInText: true - }, - handler: (_ref, args) => { - var { - parser: parser2 - } = _ref; - return { - type: "htmlmathml", - mode: parser2.mode, - html: ordargument(args[0]), - mathml: ordargument(args[1]) - }; - }, - htmlBuilder: (group, options2) => { - var elements2 = buildExpression$1(group.html, options2, false); - return buildCommon.makeFragment(elements2); - }, - mathmlBuilder: (group, options2) => { - return buildExpressionRow(group.mathml, options2); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + var hashDelete_default; + var init_hashDelete = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js"() { + "use strict"; + __name(hashDelete, "hashDelete"); + hashDelete_default = hashDelete; } }); - var sizeData = function sizeData2(str2) { - if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str2)) { - return { - number: +str2, - unit: "bp" - }; - } else { - var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str2); - if (!match) { - throw new ParseError("Invalid size: '" + str2 + "' in \\includegraphics"); - } - var data = { - number: +(match[1] + match[2]), - // sign + magnitude, cast to number - unit: match[3] - }; - if (!validUnit(data)) { - throw new ParseError("Invalid unit: '" + data.unit + "' in \\includegraphics."); - } - return data; - } - }; - defineFunction({ - type: "includegraphics", - names: ["\\includegraphics"], - props: { - numArgs: 1, - numOptionalArgs: 1, - argTypes: ["raw", "url"], - allowedInText: false - }, - handler: (_ref, args, optArgs) => { - var { - parser: parser2 - } = _ref; - var width2 = { - number: 0, - unit: "em" - }; - var height = { - number: 0.9, - unit: "em" - }; - var totalheight = { - number: 0, - unit: "em" - }; - var alt = ""; - if (optArgs[0]) { - var attributeStr = assertNodeType(optArgs[0], "raw").string; - var attributes = attributeStr.split(","); - for (var i2 = 0; i2 < attributes.length; i2++) { - var keyVal = attributes[i2].split("="); - if (keyVal.length === 2) { - var str2 = keyVal[1].trim(); - switch (keyVal[0].trim()) { - case "alt": - alt = str2; - break; - case "width": - width2 = sizeData(str2); - break; - case "height": - height = sizeData(str2); - break; - case "totalheight": - totalheight = sizeData(str2); - break; - default: - throw new ParseError("Invalid key: '" + keyVal[0] + "' in \\includegraphics."); - } - } - } - } - var src = assertNodeType(args[0], "url").url; - if (alt === "") { - alt = src; - alt = alt.replace(/^.*[\\/]/, ""); - alt = alt.substring(0, alt.lastIndexOf(".")); - } - if (!parser2.settings.isTrusted({ - command: "\\includegraphics", - url: src - })) { - return parser2.formatUnsupportedCmd("\\includegraphics"); - } - return { - type: "includegraphics", - mode: parser2.mode, - alt, - width: width2, - height, - totalheight, - src - }; - }, - htmlBuilder: (group, options2) => { - var height = calculateSize(group.height, options2); - var depth = 0; - if (group.totalheight.number > 0) { - depth = calculateSize(group.totalheight, options2) - height; - } - var width2 = 0; - if (group.width.number > 0) { - width2 = calculateSize(group.width, options2); - } - var style = { - height: makeEm(height + depth) - }; - if (width2 > 0) { - style.width = makeEm(width2); - } - if (depth > 0) { - style.verticalAlign = makeEm(-depth); - } - var node2 = new Img(group.src, group.alt, style); - node2.height = height; - node2.depth = depth; - return node2; - }, - mathmlBuilder: (group, options2) => { - var node2 = new mathMLTree.MathNode("mglyph", []); - node2.setAttribute("alt", group.alt); - var height = calculateSize(group.height, options2); - var depth = 0; - if (group.totalheight.number > 0) { - depth = calculateSize(group.totalheight, options2) - height; - node2.setAttribute("valign", makeEm(-depth)); - } - node2.setAttribute("height", makeEm(height + depth)); - if (group.width.number > 0) { - var width2 = calculateSize(group.width, options2); - node2.setAttribute("width", makeEm(width2)); - } - node2.setAttribute("src", group.src); - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js + function hashGet(key) { + var data5 = this.__data__; + if (nativeCreate_default) { + var result = data5[key]; + return result === HASH_UNDEFINED ? void 0 : result; + } + return hasOwnProperty3.call(data5, key) ? data5[key] : void 0; + } + var HASH_UNDEFINED, objectProto4, hasOwnProperty3, hashGet_default; + var init_hashGet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js"() { + "use strict"; + init_nativeCreate(); + HASH_UNDEFINED = "__lodash_hash_undefined__"; + objectProto4 = Object.prototype; + hasOwnProperty3 = objectProto4.hasOwnProperty; + __name(hashGet, "hashGet"); + hashGet_default = hashGet; } }); - defineFunction({ - type: "kern", - names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"], - props: { - numArgs: 1, - argTypes: ["size"], - primitive: true, - allowedInText: true - }, - handler(_ref, args) { - var { - parser: parser2, - funcName - } = _ref; - var size2 = assertNodeType(args[0], "size"); - if (parser2.settings.strict) { - var mathFunction = funcName[1] === "m"; - var muUnit = size2.value.unit === "mu"; - if (mathFunction) { - if (!muUnit) { - parser2.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size2.value.unit + " units")); - } - if (parser2.mode !== "math") { - parser2.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode"); - } - } else { - if (muUnit) { - parser2.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units"); - } - } - } - return { - type: "kern", - mode: parser2.mode, - dimension: size2.value - }; - }, - htmlBuilder(group, options2) { - return buildCommon.makeGlue(group.dimension, options2); - }, - mathmlBuilder(group, options2) { - var dimension = calculateSize(group.dimension, options2); - return new mathMLTree.SpaceNode(dimension); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js + function hashHas(key) { + var data5 = this.__data__; + return nativeCreate_default ? data5[key] !== void 0 : hasOwnProperty4.call(data5, key); + } + var objectProto5, hasOwnProperty4, hashHas_default; + var init_hashHas = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js"() { + "use strict"; + init_nativeCreate(); + objectProto5 = Object.prototype; + hasOwnProperty4 = objectProto5.hasOwnProperty; + __name(hashHas, "hashHas"); + hashHas_default = hashHas; } }); - defineFunction({ - type: "lap", - names: ["\\mathllap", "\\mathrlap", "\\mathclap"], - props: { - numArgs: 1, - allowedInText: true - }, - handler: (_ref, args) => { - var { - parser: parser2, - funcName - } = _ref; - var body = args[0]; - return { - type: "lap", - mode: parser2.mode, - alignment: funcName.slice(5), - body - }; - }, - htmlBuilder: (group, options2) => { - var inner2; - if (group.alignment === "clap") { - inner2 = buildCommon.makeSpan([], [buildGroup$1(group.body, options2)]); - inner2 = buildCommon.makeSpan(["inner"], [inner2], options2); - } else { - inner2 = buildCommon.makeSpan(["inner"], [buildGroup$1(group.body, options2)]); - } - var fix = buildCommon.makeSpan(["fix"], []); - var node2 = buildCommon.makeSpan([group.alignment], [inner2, fix], options2); - var strut = buildCommon.makeSpan(["strut"]); - strut.style.height = makeEm(node2.height + node2.depth); - if (node2.depth) { - strut.style.verticalAlign = makeEm(-node2.depth); - } - node2.children.unshift(strut); - node2 = buildCommon.makeSpan(["thinbox"], [node2], options2); - return buildCommon.makeSpan(["mord", "vbox"], [node2], options2); - }, - mathmlBuilder: (group, options2) => { - var node2 = new mathMLTree.MathNode("mpadded", [buildGroup(group.body, options2)]); - if (group.alignment !== "rlap") { - var offset = group.alignment === "llap" ? "-1" : "-0.5"; - node2.setAttribute("lspace", offset + "width"); - } - node2.setAttribute("width", "0px"); - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js + function hashSet(key, value2) { + var data5 = this.__data__; + this.size += this.has(key) ? 0 : 1; + data5[key] = nativeCreate_default && value2 === void 0 ? HASH_UNDEFINED2 : value2; + return this; + } + var HASH_UNDEFINED2, hashSet_default; + var init_hashSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js"() { + "use strict"; + init_nativeCreate(); + HASH_UNDEFINED2 = "__lodash_hash_undefined__"; + __name(hashSet, "hashSet"); + hashSet_default = hashSet; } }); - defineFunction({ - type: "styling", - names: ["\\(", "$"], - props: { - numArgs: 0, - allowedInText: true, - allowedInMath: false - }, - handler(_ref, args) { - var { - funcName, - parser: parser2 - } = _ref; - var outerMode = parser2.mode; - parser2.switchMode("math"); - var close2 = funcName === "\\(" ? "\\)" : "$"; - var body = parser2.parseExpression(false, close2); - parser2.expect(close2); - parser2.switchMode(outerMode); - return { - type: "styling", - mode: parser2.mode, - style: "text", - body - }; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js + function Hash(entries) { + var index = -1, length2 = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length2) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - }); - defineFunction({ - type: "text", - // Doesn't matter what this is. - names: ["\\)", "\\]"], - props: { - numArgs: 0, - allowedInText: true, - allowedInMath: false - }, - handler(context, args) { - throw new ParseError("Mismatched " + context.funcName); - } - }); - var chooseMathStyle = (group, options2) => { - switch (options2.style.size) { - case Style$1.DISPLAY.size: - return group.display; - case Style$1.TEXT.size: - return group.text; - case Style$1.SCRIPT.size: - return group.script; - case Style$1.SCRIPTSCRIPT.size: - return group.scriptscript; - default: - return group.text; + } + var Hash_default; + var init_Hash = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js"() { + "use strict"; + init_hashClear(); + init_hashDelete(); + init_hashGet(); + init_hashHas(); + init_hashSet(); + __name(Hash, "Hash"); + Hash.prototype.clear = hashClear_default; + Hash.prototype["delete"] = hashDelete_default; + Hash.prototype.get = hashGet_default; + Hash.prototype.has = hashHas_default; + Hash.prototype.set = hashSet_default; + Hash_default = Hash; } - }; - defineFunction({ - type: "mathchoice", - names: ["\\mathchoice"], - props: { - numArgs: 4, - primitive: true - }, - handler: (_ref, args) => { - var { - parser: parser2 - } = _ref; - return { - type: "mathchoice", - mode: parser2.mode, - display: ordargument(args[0]), - text: ordargument(args[1]), - script: ordargument(args[2]), - scriptscript: ordargument(args[3]) - }; - }, - htmlBuilder: (group, options2) => { - var body = chooseMathStyle(group, options2); - var elements2 = buildExpression$1(body, options2, false); - return buildCommon.makeFragment(elements2); - }, - mathmlBuilder: (group, options2) => { - var body = chooseMathStyle(group, options2); - return buildExpressionRow(body, options2); - } - }); - var assembleSupSub = (base, supGroup, subGroup, options2, style, slant, baseShift) => { - base = buildCommon.makeSpan([], [base]); - var subIsSingleCharacter = subGroup && utils.isCharacterBox(subGroup); - var sub2; - var sup2; - if (supGroup) { - var elem = buildGroup$1(supGroup, options2.havingStyle(style.sup()), options2); - sup2 = { - elem, - kern: Math.max(options2.fontMetrics().bigOpSpacing1, options2.fontMetrics().bigOpSpacing3 - elem.depth) - }; - } - if (subGroup) { - var _elem = buildGroup$1(subGroup, options2.havingStyle(style.sub()), options2); - sub2 = { - elem: _elem, - kern: Math.max(options2.fontMetrics().bigOpSpacing2, options2.fontMetrics().bigOpSpacing4 - _elem.height) - }; - } - var finalGroup; - if (sup2 && sub2) { - var bottom2 = options2.fontMetrics().bigOpSpacing5 + sub2.elem.height + sub2.elem.depth + sub2.kern + base.depth + baseShift; - finalGroup = buildCommon.makeVList({ - positionType: "bottom", - positionData: bottom2, - children: [{ - type: "kern", - size: options2.fontMetrics().bigOpSpacing5 - }, { - type: "elem", - elem: sub2.elem, - marginLeft: makeEm(-slant) - }, { - type: "kern", - size: sub2.kern - }, { - type: "elem", - elem: base - }, { - type: "kern", - size: sup2.kern - }, { - type: "elem", - elem: sup2.elem, - marginLeft: makeEm(slant) - }, { - type: "kern", - size: options2.fontMetrics().bigOpSpacing5 - }] - }, options2); - } else if (sub2) { - var top2 = base.height - baseShift; - finalGroup = buildCommon.makeVList({ - positionType: "top", - positionData: top2, - children: [{ - type: "kern", - size: options2.fontMetrics().bigOpSpacing5 - }, { - type: "elem", - elem: sub2.elem, - marginLeft: makeEm(-slant) - }, { - type: "kern", - size: sub2.kern - }, { - type: "elem", - elem: base - }] - }, options2); - } else if (sup2) { - var _bottom = base.depth + baseShift; - finalGroup = buildCommon.makeVList({ - positionType: "bottom", - positionData: _bottom, - children: [{ - type: "elem", - elem: base - }, { - type: "kern", - size: sup2.kern - }, { - type: "elem", - elem: sup2.elem, - marginLeft: makeEm(slant) - }, { - type: "kern", - size: options2.fontMetrics().bigOpSpacing5 - }] - }, options2); - } else { - return base; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + var listCacheClear_default; + var init_listCacheClear = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js"() { + "use strict"; + __name(listCacheClear, "listCacheClear"); + listCacheClear_default = listCacheClear; } - var parts = [finalGroup]; - if (sub2 && slant !== 0 && !subIsSingleCharacter) { - var spacer = buildCommon.makeSpan(["mspace"], [], options2); - spacer.style.marginRight = makeEm(slant); - parts.unshift(spacer); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js + function eq(value2, other) { + return value2 === other || value2 !== value2 && other !== other; + } + var eq_default; + var init_eq = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js"() { + "use strict"; + __name(eq, "eq"); + eq_default = eq; } - return buildCommon.makeSpan(["mop", "op-limits"], parts, options2); - }; - var noSuccessor = ["\\smallint"]; - var htmlBuilder$2 = (grp, options2) => { - var supGroup; - var subGroup; - var hasLimits = false; - var group; - if (grp.type === "supsub") { - supGroup = grp.sup; - subGroup = grp.sub; - group = assertNodeType(grp.base, "op"); - hasLimits = true; - } else { - group = assertNodeType(grp, "op"); - } - var style = options2.style; - var large = false; - if (style.size === Style$1.DISPLAY.size && group.symbol && !utils.contains(noSuccessor, group.name)) { - large = true; - } - var base; - if (group.symbol) { - var fontName = large ? "Size2-Regular" : "Size1-Regular"; - var stash = ""; - if (group.name === "\\oiint" || group.name === "\\oiiint") { - stash = group.name.slice(1); - group.name = stash === "oiint" ? "\\iint" : "\\iiint"; - } - base = buildCommon.makeSymbol(group.name, fontName, "math", options2, ["mop", "op-symbol", large ? "large-op" : "small-op"]); - if (stash.length > 0) { - var italic = base.italic; - var oval = buildCommon.staticSvg(stash + "Size" + (large ? "2" : "1"), options2); - base = buildCommon.makeVList({ - positionType: "individualShift", - children: [{ - type: "elem", - elem: base, - shift: 0 - }, { - type: "elem", - elem: oval, - shift: large ? 0.08 : 0 - }] - }, options2); - group.name = "\\" + stash; - base.classes.unshift("mop"); - base.italic = italic; - } - } else if (group.body) { - var inner2 = buildExpression$1(group.body, options2, true); - if (inner2.length === 1 && inner2[0] instanceof SymbolNode) { - base = inner2[0]; - base.classes[0] = "mop"; - } else { - base = buildCommon.makeSpan(["mop"], inner2, options2); - } - } else { - var output = []; - for (var i2 = 1; i2 < group.name.length; i2++) { - output.push(buildCommon.mathsym(group.name[i2], group.mode, options2)); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js + function assocIndexOf(array4, key) { + var length2 = array4.length; + while (length2--) { + if (eq_default(array4[length2][0], key)) { + return length2; } - base = buildCommon.makeSpan(["mop"], output, options2); } - var baseShift = 0; - var slant = 0; - if ((base instanceof SymbolNode || group.name === "\\oiint" || group.name === "\\oiiint") && !group.suppressBaseShift) { - baseShift = (base.height - base.depth) / 2 - options2.fontMetrics().axisHeight; - slant = base.italic; + return -1; + } + var assocIndexOf_default; + var init_assocIndexOf = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js"() { + "use strict"; + init_eq(); + __name(assocIndexOf, "assocIndexOf"); + assocIndexOf_default = assocIndexOf; } - if (hasLimits) { - return assembleSupSub(base, supGroup, subGroup, options2, style, slant, baseShift); - } else { - if (baseShift) { - base.style.position = "relative"; - base.style.top = makeEm(baseShift); - } - return base; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js + function listCacheDelete(key) { + var data5 = this.__data__, index = assocIndexOf_default(data5, key); + if (index < 0) { + return false; } - }; - var mathmlBuilder$1 = (group, options2) => { - var node2; - if (group.symbol) { - node2 = new MathNode("mo", [makeText(group.name, group.mode)]); - if (utils.contains(noSuccessor, group.name)) { - node2.setAttribute("largeop", "false"); - } - } else if (group.body) { - node2 = new MathNode("mo", buildExpression(group.body, options2)); + var lastIndex = data5.length - 1; + if (index == lastIndex) { + data5.pop(); } else { - node2 = new MathNode("mi", [new TextNode(group.name.slice(1))]); - var operator = new MathNode("mo", [makeText("⁡", "text")]); - if (group.parentIsSupSub) { - node2 = new MathNode("mrow", [node2, operator]); - } else { - node2 = newDocumentFragment([node2, operator]); - } + splice.call(data5, index, 1); } - return node2; - }; - var singleCharBigOps = { - "∏": "\\prod", - "∐": "\\coprod", - "∑": "\\sum", - "⋀": "\\bigwedge", - "⋁": "\\bigvee", - "⋂": "\\bigcap", - "⋃": "\\bigcup", - "⨀": "\\bigodot", - "⨁": "\\bigoplus", - "⨂": "\\bigotimes", - "⨄": "\\biguplus", - "⨆": "\\bigsqcup" - }; - defineFunction({ - type: "op", - names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"], - props: { - numArgs: 0 - }, - handler: (_ref, args) => { - var { - parser: parser2, - funcName - } = _ref; - var fName = funcName; - if (fName.length === 1) { - fName = singleCharBigOps[fName]; - } - return { - type: "op", - mode: parser2.mode, - limits: true, - parentIsSupSub: false, - symbol: true, - name: fName - }; - }, - htmlBuilder: htmlBuilder$2, - mathmlBuilder: mathmlBuilder$1 - }); - defineFunction({ - type: "op", - names: ["\\mathop"], - props: { - numArgs: 1, - primitive: true - }, - handler: (_ref2, args) => { - var { - parser: parser2 - } = _ref2; - var body = args[0]; - return { - type: "op", - mode: parser2.mode, - limits: false, - parentIsSupSub: false, - symbol: false, - body: ordargument(body) - }; - }, - htmlBuilder: htmlBuilder$2, - mathmlBuilder: mathmlBuilder$1 - }); - var singleCharIntegrals = { - "∫": "\\int", - "∬": "\\iint", - "∭": "\\iiint", - "∮": "\\oint", - "∯": "\\oiint", - "∰": "\\oiiint" - }; - defineFunction({ - type: "op", - names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"], - props: { - numArgs: 0 - }, - handler(_ref3) { - var { - parser: parser2, - funcName - } = _ref3; - return { - type: "op", - mode: parser2.mode, - limits: false, - parentIsSupSub: false, - symbol: false, - name: funcName - }; - }, - htmlBuilder: htmlBuilder$2, - mathmlBuilder: mathmlBuilder$1 - }); - defineFunction({ - type: "op", - names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"], - props: { - numArgs: 0 - }, - handler(_ref4) { - var { - parser: parser2, - funcName - } = _ref4; - return { - type: "op", - mode: parser2.mode, - limits: true, - parentIsSupSub: false, - symbol: false, - name: funcName - }; - }, - htmlBuilder: htmlBuilder$2, - mathmlBuilder: mathmlBuilder$1 - }); - defineFunction({ - type: "op", - names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"], - props: { - numArgs: 0 - }, - handler(_ref5) { - var { - parser: parser2, - funcName - } = _ref5; - var fName = funcName; - if (fName.length === 1) { - fName = singleCharIntegrals[fName]; - } - return { - type: "op", - mode: parser2.mode, - limits: false, - parentIsSupSub: false, - symbol: true, - name: fName - }; - }, - htmlBuilder: htmlBuilder$2, - mathmlBuilder: mathmlBuilder$1 - }); - var htmlBuilder$1 = (grp, options2) => { - var supGroup; - var subGroup; - var hasLimits = false; - var group; - if (grp.type === "supsub") { - supGroup = grp.sup; - subGroup = grp.sub; - group = assertNodeType(grp.base, "operatorname"); - hasLimits = true; - } else { - group = assertNodeType(grp, "operatorname"); + --this.size; + return true; + } + var arrayProto, splice, listCacheDelete_default; + var init_listCacheDelete = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js"() { + "use strict"; + init_assocIndexOf(); + arrayProto = Array.prototype; + splice = arrayProto.splice; + __name(listCacheDelete, "listCacheDelete"); + listCacheDelete_default = listCacheDelete; } - var base; - if (group.body.length > 0) { - var body = group.body.map((child2) => { - var childText = child2.text; - if (typeof childText === "string") { - return { - type: "textord", - mode: child2.mode, - text: childText - }; - } else { - return child2; - } - }); - var expression = buildExpression$1(body, options2.withFont("mathrm"), true); - for (var i2 = 0; i2 < expression.length; i2++) { - var child = expression[i2]; - if (child instanceof SymbolNode) { - child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*"); - } - } - base = buildCommon.makeSpan(["mop"], expression, options2); - } else { - base = buildCommon.makeSpan(["mop"], [], options2); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js + function listCacheGet(key) { + var data5 = this.__data__, index = assocIndexOf_default(data5, key); + return index < 0 ? void 0 : data5[index][1]; + } + var listCacheGet_default; + var init_listCacheGet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js"() { + "use strict"; + init_assocIndexOf(); + __name(listCacheGet, "listCacheGet"); + listCacheGet_default = listCacheGet; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js + function listCacheHas(key) { + return assocIndexOf_default(this.__data__, key) > -1; + } + var listCacheHas_default; + var init_listCacheHas = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js"() { + "use strict"; + init_assocIndexOf(); + __name(listCacheHas, "listCacheHas"); + listCacheHas_default = listCacheHas; } - if (hasLimits) { - return assembleSupSub(base, supGroup, subGroup, options2, options2.style, 0, 0); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js + function listCacheSet(key, value2) { + var data5 = this.__data__, index = assocIndexOf_default(data5, key); + if (index < 0) { + ++this.size; + data5.push([key, value2]); } else { - return base; + data5[index][1] = value2; } - }; - var mathmlBuilder = (group, options2) => { - var expression = buildExpression(group.body, options2.withFont("mathrm")); - var isAllString = true; - for (var i2 = 0; i2 < expression.length; i2++) { - var node2 = expression[i2]; - if (node2 instanceof mathMLTree.SpaceNode) - ; - else if (node2 instanceof mathMLTree.MathNode) { - switch (node2.type) { - case "mi": - case "mn": - case "ms": - case "mspace": - case "mtext": - break; - case "mo": { - var child = node2.children[0]; - if (node2.children.length === 1 && child instanceof mathMLTree.TextNode) { - child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*"); - } else { - isAllString = false; - } - break; - } - default: - isAllString = false; - } - } else { - isAllString = false; - } + return this; + } + var listCacheSet_default; + var init_listCacheSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js"() { + "use strict"; + init_assocIndexOf(); + __name(listCacheSet, "listCacheSet"); + listCacheSet_default = listCacheSet; } - if (isAllString) { - var word = expression.map((node3) => node3.toText()).join(""); - expression = [new mathMLTree.TextNode(word)]; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js + function ListCache(entries) { + var index = -1, length2 = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length2) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - var identifier2 = new mathMLTree.MathNode("mi", expression); - identifier2.setAttribute("mathvariant", "normal"); - var operator = new mathMLTree.MathNode("mo", [makeText("⁡", "text")]); - if (group.parentIsSupSub) { - return new mathMLTree.MathNode("mrow", [identifier2, operator]); - } else { - return mathMLTree.newDocumentFragment([identifier2, operator]); + } + var ListCache_default; + var init_ListCache = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js"() { + "use strict"; + init_listCacheClear(); + init_listCacheDelete(); + init_listCacheGet(); + init_listCacheHas(); + init_listCacheSet(); + __name(ListCache, "ListCache"); + ListCache.prototype.clear = listCacheClear_default; + ListCache.prototype["delete"] = listCacheDelete_default; + ListCache.prototype.get = listCacheGet_default; + ListCache.prototype.has = listCacheHas_default; + ListCache.prototype.set = listCacheSet_default; + ListCache_default = ListCache; } - }; - defineFunction({ - type: "operatorname", - names: ["\\operatorname@", "\\operatornamewithlimits"], - props: { - numArgs: 1 - }, - handler: (_ref, args) => { - var { - parser: parser2, - funcName - } = _ref; - var body = args[0]; - return { - type: "operatorname", - mode: parser2.mode, - body: ordargument(body), - alwaysHandleSupSub: funcName === "\\operatornamewithlimits", - limits: false, - parentIsSupSub: false - }; - }, - htmlBuilder: htmlBuilder$1, - mathmlBuilder }); - defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@"); - defineFunctionBuilders({ - type: "ordgroup", - htmlBuilder(group, options2) { - if (group.semisimple) { - return buildCommon.makeFragment(buildExpression$1(group.body, options2, false)); - } - return buildCommon.makeSpan(["mord"], buildExpression$1(group.body, options2, true), options2); - }, - mathmlBuilder(group, options2) { - return buildExpressionRow(group.body, options2, true); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js + var Map2, Map_default; + var init_Map = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js"() { + "use strict"; + init_getNative(); + init_root(); + Map2 = getNative_default(root_default, "Map"); + Map_default = Map2; } }); - defineFunction({ - type: "overline", - names: ["\\overline"], - props: { - numArgs: 1 - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - var body = args[0]; - return { - type: "overline", - mode: parser2.mode, - body - }; - }, - htmlBuilder(group, options2) { - var innerGroup = buildGroup$1(group.body, options2.havingCrampedStyle()); - var line2 = buildCommon.makeLineSpan("overline-line", options2); - var defaultRuleThickness = options2.fontMetrics().defaultRuleThickness; - var vlist = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: innerGroup - }, { - type: "kern", - size: 3 * defaultRuleThickness - }, { - type: "elem", - elem: line2 - }, { - type: "kern", - size: defaultRuleThickness - }] - }, options2); - return buildCommon.makeSpan(["mord", "overline"], [vlist], options2); - }, - mathmlBuilder(group, options2) { - var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]); - operator.setAttribute("stretchy", "true"); - var node2 = new mathMLTree.MathNode("mover", [buildGroup(group.body, options2), operator]); - node2.setAttribute("accent", "true"); - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js + function mapCacheClear() { + this.size = 0; + this.__data__ = { + "hash": new Hash_default(), + "map": new (Map_default || ListCache_default)(), + "string": new Hash_default() + }; + } + var mapCacheClear_default; + var init_mapCacheClear = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js"() { + "use strict"; + init_Hash(); + init_ListCache(); + init_Map(); + __name(mapCacheClear, "mapCacheClear"); + mapCacheClear_default = mapCacheClear; } }); - defineFunction({ - type: "phantom", - names: ["\\phantom"], - props: { - numArgs: 1, - allowedInText: true - }, - handler: (_ref, args) => { - var { - parser: parser2 - } = _ref; - var body = args[0]; - return { - type: "phantom", - mode: parser2.mode, - body: ordargument(body) - }; - }, - htmlBuilder: (group, options2) => { - var elements2 = buildExpression$1(group.body, options2.withPhantom(), false); - return buildCommon.makeFragment(elements2); - }, - mathmlBuilder: (group, options2) => { - var inner2 = buildExpression(group.body, options2); - return new mathMLTree.MathNode("mphantom", inner2); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js + function isKeyable(value2) { + var type3 = typeof value2; + return type3 == "string" || type3 == "number" || type3 == "symbol" || type3 == "boolean" ? value2 !== "__proto__" : value2 === null; + } + var isKeyable_default; + var init_isKeyable = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js"() { + "use strict"; + __name(isKeyable, "isKeyable"); + isKeyable_default = isKeyable; } }); - defineFunction({ - type: "hphantom", - names: ["\\hphantom"], - props: { - numArgs: 1, - allowedInText: true - }, - handler: (_ref2, args) => { - var { - parser: parser2 - } = _ref2; - var body = args[0]; - return { - type: "hphantom", - mode: parser2.mode, - body - }; - }, - htmlBuilder: (group, options2) => { - var node2 = buildCommon.makeSpan([], [buildGroup$1(group.body, options2.withPhantom())]); - node2.height = 0; - node2.depth = 0; - if (node2.children) { - for (var i2 = 0; i2 < node2.children.length; i2++) { - node2.children[i2].height = 0; - node2.children[i2].depth = 0; - } - } - node2 = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: node2 - }] - }, options2); - return buildCommon.makeSpan(["mord"], [node2], options2); - }, - mathmlBuilder: (group, options2) => { - var inner2 = buildExpression(ordargument(group.body), options2); - var phantom = new mathMLTree.MathNode("mphantom", inner2); - var node2 = new mathMLTree.MathNode("mpadded", [phantom]); - node2.setAttribute("height", "0px"); - node2.setAttribute("depth", "0px"); - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js + function getMapData(map5, key) { + var data5 = map5.__data__; + return isKeyable_default(key) ? data5[typeof key == "string" ? "string" : "hash"] : data5.map; + } + var getMapData_default; + var init_getMapData = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js"() { + "use strict"; + init_isKeyable(); + __name(getMapData, "getMapData"); + getMapData_default = getMapData; } }); - defineFunction({ - type: "vphantom", - names: ["\\vphantom"], - props: { - numArgs: 1, - allowedInText: true - }, - handler: (_ref3, args) => { - var { - parser: parser2 - } = _ref3; - var body = args[0]; - return { - type: "vphantom", - mode: parser2.mode, - body - }; - }, - htmlBuilder: (group, options2) => { - var inner2 = buildCommon.makeSpan(["inner"], [buildGroup$1(group.body, options2.withPhantom())]); - var fix = buildCommon.makeSpan(["fix"], []); - return buildCommon.makeSpan(["mord", "rlap"], [inner2, fix], options2); - }, - mathmlBuilder: (group, options2) => { - var inner2 = buildExpression(ordargument(group.body), options2); - var phantom = new mathMLTree.MathNode("mphantom", inner2); - var node2 = new mathMLTree.MathNode("mpadded", [phantom]); - node2.setAttribute("width", "0px"); - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js + function mapCacheDelete(key) { + var result = getMapData_default(this, key)["delete"](key); + this.size -= result ? 1 : 0; + return result; + } + var mapCacheDelete_default; + var init_mapCacheDelete = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js"() { + "use strict"; + init_getMapData(); + __name(mapCacheDelete, "mapCacheDelete"); + mapCacheDelete_default = mapCacheDelete; } }); - defineFunction({ - type: "raisebox", - names: ["\\raisebox"], - props: { - numArgs: 2, - argTypes: ["size", "hbox"], - allowedInText: true - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - var amount = assertNodeType(args[0], "size").value; - var body = args[1]; - return { - type: "raisebox", - mode: parser2.mode, - dy: amount, - body - }; - }, - htmlBuilder(group, options2) { - var body = buildGroup$1(group.body, options2); - var dy = calculateSize(group.dy, options2); - return buildCommon.makeVList({ - positionType: "shift", - positionData: -dy, - children: [{ - type: "elem", - elem: body - }] - }, options2); - }, - mathmlBuilder(group, options2) { - var node2 = new mathMLTree.MathNode("mpadded", [buildGroup(group.body, options2)]); - var dy = group.dy.number + group.dy.unit; - node2.setAttribute("voffset", dy); - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js + function mapCacheGet(key) { + return getMapData_default(this, key).get(key); + } + var mapCacheGet_default; + var init_mapCacheGet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js"() { + "use strict"; + init_getMapData(); + __name(mapCacheGet, "mapCacheGet"); + mapCacheGet_default = mapCacheGet; } }); - defineFunction({ - type: "internal", - names: ["\\relax"], - props: { - numArgs: 0, - allowedInText: true - }, - handler(_ref) { - var { - parser: parser2 - } = _ref; - return { - type: "internal", - mode: parser2.mode - }; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js + function mapCacheHas(key) { + return getMapData_default(this, key).has(key); + } + var mapCacheHas_default; + var init_mapCacheHas = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js"() { + "use strict"; + init_getMapData(); + __name(mapCacheHas, "mapCacheHas"); + mapCacheHas_default = mapCacheHas; } }); - defineFunction({ - type: "rule", - names: ["\\rule"], - props: { - numArgs: 2, - numOptionalArgs: 1, - argTypes: ["size", "size", "size"] - }, - handler(_ref, args, optArgs) { - var { - parser: parser2 - } = _ref; - var shift = optArgs[0]; - var width2 = assertNodeType(args[0], "size"); - var height = assertNodeType(args[1], "size"); - return { - type: "rule", - mode: parser2.mode, - shift: shift && assertNodeType(shift, "size").value, - width: width2.value, - height: height.value - }; - }, - htmlBuilder(group, options2) { - var rule = buildCommon.makeSpan(["mord", "rule"], [], options2); - var width2 = calculateSize(group.width, options2); - var height = calculateSize(group.height, options2); - var shift = group.shift ? calculateSize(group.shift, options2) : 0; - rule.style.borderRightWidth = makeEm(width2); - rule.style.borderTopWidth = makeEm(height); - rule.style.bottom = makeEm(shift); - rule.width = width2; - rule.height = height + shift; - rule.depth = -shift; - rule.maxFontSize = height * 1.125 * options2.sizeMultiplier; - return rule; - }, - mathmlBuilder(group, options2) { - var width2 = calculateSize(group.width, options2); - var height = calculateSize(group.height, options2); - var shift = group.shift ? calculateSize(group.shift, options2) : 0; - var color2 = options2.color && options2.getColor() || "black"; - var rule = new mathMLTree.MathNode("mspace"); - rule.setAttribute("mathbackground", color2); - rule.setAttribute("width", makeEm(width2)); - rule.setAttribute("height", makeEm(height)); - var wrapper = new mathMLTree.MathNode("mpadded", [rule]); - if (shift >= 0) { - wrapper.setAttribute("height", makeEm(shift)); - } else { - wrapper.setAttribute("height", makeEm(shift)); - wrapper.setAttribute("depth", makeEm(-shift)); - } - wrapper.setAttribute("voffset", makeEm(shift)); - return wrapper; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js + function mapCacheSet(key, value2) { + var data5 = getMapData_default(this, key), size5 = data5.size; + data5.set(key, value2); + this.size += data5.size == size5 ? 0 : 1; + return this; + } + var mapCacheSet_default; + var init_mapCacheSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js"() { + "use strict"; + init_getMapData(); + __name(mapCacheSet, "mapCacheSet"); + mapCacheSet_default = mapCacheSet; } }); - function sizingGroup(value2, options2, baseOptions) { - var inner2 = buildExpression$1(value2, options2, false); - var multiplier = options2.sizeMultiplier / baseOptions.sizeMultiplier; - for (var i2 = 0; i2 < inner2.length; i2++) { - var pos = inner2[i2].classes.indexOf("sizing"); - if (pos < 0) { - Array.prototype.push.apply(inner2[i2].classes, options2.sizingClasses(baseOptions)); - } else if (inner2[i2].classes[pos + 1] === "reset-size" + options2.size) { - inner2[i2].classes[pos + 1] = "reset-size" + baseOptions.size; - } - inner2[i2].height *= multiplier; - inner2[i2].depth *= multiplier; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js + function MapCache(entries) { + var index = -1, length2 = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length2) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return buildCommon.makeFragment(inner2); } - var sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"]; - var htmlBuilder = (group, options2) => { - var newOptions = options2.havingSize(group.size); - return sizingGroup(group.body, newOptions, options2); - }; - defineFunction({ - type: "sizing", - names: sizeFuncs, - props: { - numArgs: 0, - allowedInText: true - }, - handler: (_ref, args) => { - var { - breakOnTokenText, - funcName, - parser: parser2 - } = _ref; - var body = parser2.parseExpression(false, breakOnTokenText); - return { - type: "sizing", - mode: parser2.mode, - // Figure out what size to use based on the list of functions above - size: sizeFuncs.indexOf(funcName) + 1, - body - }; - }, - htmlBuilder, - mathmlBuilder: (group, options2) => { - var newOptions = options2.havingSize(group.size); - var inner2 = buildExpression(group.body, newOptions); - var node2 = new mathMLTree.MathNode("mstyle", inner2); - node2.setAttribute("mathsize", makeEm(newOptions.sizeMultiplier)); - return node2; + var MapCache_default; + var init_MapCache = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js"() { + "use strict"; + init_mapCacheClear(); + init_mapCacheDelete(); + init_mapCacheGet(); + init_mapCacheHas(); + init_mapCacheSet(); + __name(MapCache, "MapCache"); + MapCache.prototype.clear = mapCacheClear_default; + MapCache.prototype["delete"] = mapCacheDelete_default; + MapCache.prototype.get = mapCacheGet_default; + MapCache.prototype.has = mapCacheHas_default; + MapCache.prototype.set = mapCacheSet_default; + MapCache_default = MapCache; } }); - defineFunction({ - type: "smash", - names: ["\\smash"], - props: { - numArgs: 1, - numOptionalArgs: 1, - allowedInText: true - }, - handler: (_ref, args, optArgs) => { - var { - parser: parser2 - } = _ref; - var smashHeight = false; - var smashDepth = false; - var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup"); - if (tbArg) { - var letter = ""; - for (var i2 = 0; i2 < tbArg.body.length; ++i2) { - var node2 = tbArg.body[i2]; - letter = node2.text; - if (letter === "t") { - smashHeight = true; - } else if (letter === "b") { - smashDepth = true; - } else { - smashHeight = false; - smashDepth = false; - break; - } - } - } else { - smashHeight = true; - smashDepth = true; - } - var body = args[0]; - return { - type: "smash", - mode: parser2.mode, - body, - smashHeight, - smashDepth - }; - }, - htmlBuilder: (group, options2) => { - var node2 = buildCommon.makeSpan([], [buildGroup$1(group.body, options2)]); - if (!group.smashHeight && !group.smashDepth) { - return node2; - } - if (group.smashHeight) { - node2.height = 0; - if (node2.children) { - for (var i2 = 0; i2 < node2.children.length; i2++) { - node2.children[i2].height = 0; - } - } - } - if (group.smashDepth) { - node2.depth = 0; - if (node2.children) { - for (var _i6 = 0; _i6 < node2.children.length; _i6++) { - node2.children[_i6].depth = 0; - } - } - } - var smashedNode = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: node2 - }] - }, options2); - return buildCommon.makeSpan(["mord"], [smashedNode], options2); - }, - mathmlBuilder: (group, options2) => { - var node2 = new mathMLTree.MathNode("mpadded", [buildGroup(group.body, options2)]); - if (group.smashHeight) { - node2.setAttribute("height", "0px"); - } - if (group.smashDepth) { - node2.setAttribute("depth", "0px"); - } - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js + function memoize(func, resolver3) { + if (typeof func != "function" || resolver3 != null && typeof resolver3 != "function") { + throw new TypeError(FUNC_ERROR_TEXT); } - }); - defineFunction({ - type: "sqrt", - names: ["\\sqrt"], - props: { - numArgs: 1, - numOptionalArgs: 1 - }, - handler(_ref, args, optArgs) { - var { - parser: parser2 - } = _ref; - var index2 = optArgs[0]; - var body = args[0]; - return { - type: "sqrt", - mode: parser2.mode, - body, - index: index2 - }; - }, - htmlBuilder(group, options2) { - var inner2 = buildGroup$1(group.body, options2.havingCrampedStyle()); - if (inner2.height === 0) { - inner2.height = options2.fontMetrics().xHeight; - } - inner2 = buildCommon.wrapFragment(inner2, options2); - var metrics = options2.fontMetrics(); - var theta = metrics.defaultRuleThickness; - var phi = theta; - if (options2.style.id < Style$1.TEXT.id) { - phi = options2.fontMetrics().xHeight; - } - var lineClearance = theta + phi / 4; - var minDelimiterHeight = inner2.height + inner2.depth + lineClearance + theta; - var { - span: img, - ruleWidth, - advanceWidth - } = delimiter.sqrtImage(minDelimiterHeight, options2); - var delimDepth = img.height - ruleWidth; - if (delimDepth > inner2.height + inner2.depth + lineClearance) { - lineClearance = (lineClearance + delimDepth - inner2.height - inner2.depth) / 2; - } - var imgShift = img.height - inner2.height - lineClearance - ruleWidth; - inner2.style.paddingLeft = makeEm(advanceWidth); - var body = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [{ - type: "elem", - elem: inner2, - wrapperClasses: ["svg-align"] - }, { - type: "kern", - size: -(inner2.height + imgShift) - }, { - type: "elem", - elem: img - }, { - type: "kern", - size: ruleWidth - }] - }, options2); - if (!group.index) { - return buildCommon.makeSpan(["mord", "sqrt"], [body], options2); - } else { - var newOptions = options2.havingStyle(Style$1.SCRIPTSCRIPT); - var rootm = buildGroup$1(group.index, newOptions, options2); - var toShift = 0.6 * (body.height - body.depth); - var rootVList = buildCommon.makeVList({ - positionType: "shift", - positionData: -toShift, - children: [{ - type: "elem", - elem: rootm - }] - }, options2); - var rootVListWrap = buildCommon.makeSpan(["root"], [rootVList]); - return buildCommon.makeSpan(["mord", "sqrt"], [rootVListWrap, body], options2); + var memoized = /* @__PURE__ */ __name(function() { + var args = arguments, key = resolver3 ? resolver3.apply(this, args) : args[0], cache3 = memoized.cache; + if (cache3.has(key)) { + return cache3.get(key); } - }, - mathmlBuilder(group, options2) { - var { - body, - index: index2 - } = group; - return index2 ? new mathMLTree.MathNode("mroot", [buildGroup(body, options2), buildGroup(index2, options2)]) : new mathMLTree.MathNode("msqrt", [buildGroup(body, options2)]); - } - }); - var styleMap = { - "display": Style$1.DISPLAY, - "text": Style$1.TEXT, - "script": Style$1.SCRIPT, - "scriptscript": Style$1.SCRIPTSCRIPT - }; - defineFunction({ - type: "styling", - names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"], - props: { - numArgs: 0, - allowedInText: true, - primitive: true - }, - handler(_ref, args) { - var { - breakOnTokenText, - funcName, - parser: parser2 - } = _ref; - var body = parser2.parseExpression(true, breakOnTokenText); - var style = funcName.slice(1, funcName.length - 5); - return { - type: "styling", - mode: parser2.mode, - // Figure out what style to use by pulling out the style from - // the function name - style, - body - }; - }, - htmlBuilder(group, options2) { - var newStyle = styleMap[group.style]; - var newOptions = options2.havingStyle(newStyle).withFont(""); - return sizingGroup(group.body, newOptions, options2); - }, - mathmlBuilder(group, options2) { - var newStyle = styleMap[group.style]; - var newOptions = options2.havingStyle(newStyle); - var inner2 = buildExpression(group.body, newOptions); - var node2 = new mathMLTree.MathNode("mstyle", inner2); - var styleAttributes = { - "display": ["0", "true"], - "text": ["0", "false"], - "script": ["1", "false"], - "scriptscript": ["2", "false"] - }; - var attr = styleAttributes[group.style]; - node2.setAttribute("scriptlevel", attr[0]); - node2.setAttribute("displaystyle", attr[1]); - return node2; + var result = func.apply(this, args); + memoized.cache = cache3.set(key, result) || cache3; + return result; + }, "memoized"); + memoized.cache = new (memoize.Cache || MapCache_default)(); + return memoized; + } + var FUNC_ERROR_TEXT, memoize_default; + var init_memoize = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js"() { + "use strict"; + init_MapCache(); + FUNC_ERROR_TEXT = "Expected a function"; + __name(memoize, "memoize"); + memoize.Cache = MapCache_default; + memoize_default = memoize; } }); - var htmlBuilderDelegate = function htmlBuilderDelegate2(group, options2) { - var base = group.base; - if (!base) { - return null; - } else if (base.type === "op") { - var delegate = base.limits && (options2.style.size === Style$1.DISPLAY.size || base.alwaysHandleSupSub); - return delegate ? htmlBuilder$2 : null; - } else if (base.type === "operatorname") { - var _delegate = base.alwaysHandleSupSub && (options2.style.size === Style$1.DISPLAY.size || base.limits); - return _delegate ? htmlBuilder$1 : null; - } else if (base.type === "accent") { - return utils.isCharacterBox(base.base) ? htmlBuilder$a : null; - } else if (base.type === "horizBrace") { - var isSup = !group.sub; - return isSup === base.isOver ? htmlBuilder$3 : null; - } else { - return null; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js + function stackClear() { + this.__data__ = new ListCache_default(); + this.size = 0; + } + var stackClear_default; + var init_stackClear = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js"() { + "use strict"; + init_ListCache(); + __name(stackClear, "stackClear"); + stackClear_default = stackClear; } - }; - defineFunctionBuilders({ - type: "supsub", - htmlBuilder(group, options2) { - var builderDelegate = htmlBuilderDelegate(group, options2); - if (builderDelegate) { - return builderDelegate(group, options2); - } - var { - base: valueBase, - sup: valueSup, - sub: valueSub - } = group; - var base = buildGroup$1(valueBase, options2); - var supm; - var subm; - var metrics = options2.fontMetrics(); - var supShift = 0; - var subShift = 0; - var isCharacterBox2 = valueBase && utils.isCharacterBox(valueBase); - if (valueSup) { - var newOptions = options2.havingStyle(options2.style.sup()); - supm = buildGroup$1(valueSup, newOptions, options2); - if (!isCharacterBox2) { - supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options2.sizeMultiplier; - } - } - if (valueSub) { - var _newOptions = options2.havingStyle(options2.style.sub()); - subm = buildGroup$1(valueSub, _newOptions, options2); - if (!isCharacterBox2) { - subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options2.sizeMultiplier; - } - } - var minSupShift; - if (options2.style === Style$1.DISPLAY) { - minSupShift = metrics.sup1; - } else if (options2.style.cramped) { - minSupShift = metrics.sup3; - } else { - minSupShift = metrics.sup2; - } - var multiplier = options2.sizeMultiplier; - var marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier); - var marginLeft = null; - if (subm) { - var isOiint = group.base && group.base.type === "op" && group.base.name && (group.base.name === "\\oiint" || group.base.name === "\\oiiint"); - if (base instanceof SymbolNode || isOiint) { - marginLeft = makeEm(-base.italic); - } - } - var supsub; - if (supm && subm) { - supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight); - subShift = Math.max(subShift, metrics.sub2); - var ruleWidth = metrics.defaultRuleThickness; - var maxWidth = 4 * ruleWidth; - if (supShift - supm.depth - (subm.height - subShift) < maxWidth) { - subShift = maxWidth - (supShift - supm.depth) + subm.height; - var psi = 0.8 * metrics.xHeight - (supShift - supm.depth); - if (psi > 0) { - supShift += psi; - subShift -= psi; - } - } - var vlistElem = [{ - type: "elem", - elem: subm, - shift: subShift, - marginRight, - marginLeft - }, { - type: "elem", - elem: supm, - shift: -supShift, - marginRight - }]; - supsub = buildCommon.makeVList({ - positionType: "individualShift", - children: vlistElem - }, options2); - } else if (subm) { - subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight); - var _vlistElem = [{ - type: "elem", - elem: subm, - marginLeft, - marginRight - }]; - supsub = buildCommon.makeVList({ - positionType: "shift", - positionData: subShift, - children: _vlistElem - }, options2); - } else if (supm) { - supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight); - supsub = buildCommon.makeVList({ - positionType: "shift", - positionData: -supShift, - children: [{ - type: "elem", - elem: supm, - marginRight - }] - }, options2); - } else { - throw new Error("supsub must have either sup or sub."); - } - var mclass = getTypeOfDomTree(base, "right") || "mord"; - return buildCommon.makeSpan([mclass], [base, buildCommon.makeSpan(["msupsub"], [supsub])], options2); - }, - mathmlBuilder(group, options2) { - var isBrace = false; - var isOver; - var isSup; - if (group.base && group.base.type === "horizBrace") { - isSup = !!group.sup; - if (isSup === group.base.isOver) { - isBrace = true; - isOver = group.base.isOver; - } - } - if (group.base && (group.base.type === "op" || group.base.type === "operatorname")) { - group.base.parentIsSupSub = true; - } - var children2 = [buildGroup(group.base, options2)]; - if (group.sub) { - children2.push(buildGroup(group.sub, options2)); - } - if (group.sup) { - children2.push(buildGroup(group.sup, options2)); - } - var nodeType2; - if (isBrace) { - nodeType2 = isOver ? "mover" : "munder"; - } else if (!group.sub) { - var base = group.base; - if (base && base.type === "op" && base.limits && (options2.style === Style$1.DISPLAY || base.alwaysHandleSupSub)) { - nodeType2 = "mover"; - } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options2.style === Style$1.DISPLAY)) { - nodeType2 = "mover"; - } else { - nodeType2 = "msup"; - } - } else if (!group.sup) { - var _base = group.base; - if (_base && _base.type === "op" && _base.limits && (options2.style === Style$1.DISPLAY || _base.alwaysHandleSupSub)) { - nodeType2 = "munder"; - } else if (_base && _base.type === "operatorname" && _base.alwaysHandleSupSub && (_base.limits || options2.style === Style$1.DISPLAY)) { - nodeType2 = "munder"; - } else { - nodeType2 = "msub"; - } - } else { - var _base2 = group.base; - if (_base2 && _base2.type === "op" && _base2.limits && options2.style === Style$1.DISPLAY) { - nodeType2 = "munderover"; - } else if (_base2 && _base2.type === "operatorname" && _base2.alwaysHandleSupSub && (options2.style === Style$1.DISPLAY || _base2.limits)) { - nodeType2 = "munderover"; - } else { - nodeType2 = "msubsup"; - } - } - return new mathMLTree.MathNode(nodeType2, children2); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js + function stackDelete(key) { + var data5 = this.__data__, result = data5["delete"](key); + this.size = data5.size; + return result; + } + var stackDelete_default; + var init_stackDelete = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js"() { + "use strict"; + __name(stackDelete, "stackDelete"); + stackDelete_default = stackDelete; } }); - defineFunctionBuilders({ - type: "atom", - htmlBuilder(group, options2) { - return buildCommon.mathsym(group.text, group.mode, options2, ["m" + group.family]); - }, - mathmlBuilder(group, options2) { - var node2 = new mathMLTree.MathNode("mo", [makeText(group.text, group.mode)]); - if (group.family === "bin") { - var variant = getVariant(group, options2); - if (variant === "bold-italic") { - node2.setAttribute("mathvariant", variant); - } - } else if (group.family === "punct") { - node2.setAttribute("separator", "true"); - } else if (group.family === "open" || group.family === "close") { - node2.setAttribute("stretchy", "false"); - } - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js + function stackGet(key) { + return this.__data__.get(key); + } + var stackGet_default; + var init_stackGet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js"() { + "use strict"; + __name(stackGet, "stackGet"); + stackGet_default = stackGet; } }); - var defaultVariant = { - "mi": "italic", - "mn": "normal", - "mtext": "normal" - }; - defineFunctionBuilders({ - type: "mathord", - htmlBuilder(group, options2) { - return buildCommon.makeOrd(group, options2, "mathord"); - }, - mathmlBuilder(group, options2) { - var node2 = new mathMLTree.MathNode("mi", [makeText(group.text, group.mode, options2)]); - var variant = getVariant(group, options2) || "italic"; - if (variant !== defaultVariant[node2.type]) { - node2.setAttribute("mathvariant", variant); - } - return node2; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js + function stackHas(key) { + return this.__data__.has(key); + } + var stackHas_default; + var init_stackHas = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js"() { + "use strict"; + __name(stackHas, "stackHas"); + stackHas_default = stackHas; } }); - defineFunctionBuilders({ - type: "textord", - htmlBuilder(group, options2) { - return buildCommon.makeOrd(group, options2, "textord"); - }, - mathmlBuilder(group, options2) { - var text2 = makeText(group.text, group.mode, options2); - var variant = getVariant(group, options2) || "normal"; - var node2; - if (group.mode === "text") { - node2 = new mathMLTree.MathNode("mtext", [text2]); - } else if (/[0-9]/.test(group.text)) { - node2 = new mathMLTree.MathNode("mn", [text2]); - } else if (group.text === "\\prime") { - node2 = new mathMLTree.MathNode("mo", [text2]); - } else { - node2 = new mathMLTree.MathNode("mi", [text2]); - } - if (variant !== defaultVariant[node2.type]) { - node2.setAttribute("mathvariant", variant); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js + function stackSet(key, value2) { + var data5 = this.__data__; + if (data5 instanceof ListCache_default) { + var pairs2 = data5.__data__; + if (!Map_default || pairs2.length < LARGE_ARRAY_SIZE - 1) { + pairs2.push([key, value2]); + this.size = ++data5.size; + return this; } - return node2; + data5 = this.__data__ = new MapCache_default(pairs2); + } + data5.set(key, value2); + this.size = data5.size; + return this; + } + var LARGE_ARRAY_SIZE, stackSet_default; + var init_stackSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js"() { + "use strict"; + init_ListCache(); + init_Map(); + init_MapCache(); + LARGE_ARRAY_SIZE = 200; + __name(stackSet, "stackSet"); + stackSet_default = stackSet; } }); - var cssSpace = { - "\\nobreak": "nobreak", - "\\allowbreak": "allowbreak" - }; - var regularSpace = { - " ": {}, - "\\ ": {}, - "~": { - className: "nobreak" - }, - "\\space": {}, - "\\nobreakspace": { - className: "nobreak" + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js + function Stack(entries) { + var data5 = this.__data__ = new ListCache_default(entries); + this.size = data5.size; + } + var Stack_default; + var init_Stack = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js"() { + "use strict"; + init_ListCache(); + init_stackClear(); + init_stackDelete(); + init_stackGet(); + init_stackHas(); + init_stackSet(); + __name(Stack, "Stack"); + Stack.prototype.clear = stackClear_default; + Stack.prototype["delete"] = stackDelete_default; + Stack.prototype.get = stackGet_default; + Stack.prototype.has = stackHas_default; + Stack.prototype.set = stackSet_default; + Stack_default = Stack; } - }; - defineFunctionBuilders({ - type: "spacing", - htmlBuilder(group, options2) { - if (regularSpace.hasOwnProperty(group.text)) { - var className = regularSpace[group.text].className || ""; - if (group.mode === "text") { - var ord = buildCommon.makeOrd(group, options2, "textord"); - ord.classes.push(className); - return ord; - } else { - return buildCommon.makeSpan(["mspace", className], [buildCommon.mathsym(group.text, group.mode, options2)], options2); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js + var defineProperty, defineProperty_default; + var init_defineProperty = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js"() { + "use strict"; + init_getNative(); + defineProperty = function() { + try { + var func = getNative_default(Object, "defineProperty"); + func({}, "", {}); + return func; + } catch (e3) { } - } else if (cssSpace.hasOwnProperty(group.text)) { - return buildCommon.makeSpan(["mspace", cssSpace[group.text]], [], options2); - } else { - throw new ParseError('Unknown type of space "' + group.text + '"'); - } - }, - mathmlBuilder(group, options2) { - var node2; - if (regularSpace.hasOwnProperty(group.text)) { - node2 = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode(" ")]); - } else if (cssSpace.hasOwnProperty(group.text)) { - return new mathMLTree.MathNode("mspace"); - } else { - throw new ParseError('Unknown type of space "' + group.text + '"'); - } - return node2; + }(); + defineProperty_default = defineProperty; } }); - var pad = () => { - var padNode = new mathMLTree.MathNode("mtd", []); - padNode.setAttribute("width", "50%"); - return padNode; - }; - defineFunctionBuilders({ - type: "tag", - mathmlBuilder(group, options2) { - var table = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group.body, options2)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(group.tag, options2)])])]); - table.setAttribute("width", "100%"); - return table; - } - }); - var textFontFamilies = { - "\\text": void 0, - "\\textrm": "textrm", - "\\textsf": "textsf", - "\\texttt": "texttt", - "\\textnormal": "textrm" - }; - var textFontWeights = { - "\\textbf": "textbf", - "\\textmd": "textmd" - }; - var textFontShapes = { - "\\textit": "textit", - "\\textup": "textup" - }; - var optionsWithFont = (group, options2) => { - var font = group.font; - if (!font) { - return options2; - } else if (textFontFamilies[font]) { - return options2.withTextFontFamily(textFontFamilies[font]); - } else if (textFontWeights[font]) { - return options2.withTextFontWeight(textFontWeights[font]); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js + function baseAssignValue(object3, key, value2) { + if (key == "__proto__" && defineProperty_default) { + defineProperty_default(object3, key, { + "configurable": true, + "enumerable": true, + "value": value2, + "writable": true + }); } else { - return options2.withTextFontShape(textFontShapes[font]); - } - }; - defineFunction({ - type: "text", - names: [ - // Font families - "\\text", - "\\textrm", - "\\textsf", - "\\texttt", - "\\textnormal", - // Font weights - "\\textbf", - "\\textmd", - // Font Shapes - "\\textit", - "\\textup" - ], - props: { - numArgs: 1, - argTypes: ["text"], - allowedInArgument: true, - allowedInText: true - }, - handler(_ref, args) { - var { - parser: parser2, - funcName - } = _ref; - var body = args[0]; - return { - type: "text", - mode: parser2.mode, - body: ordargument(body), - font: funcName - }; - }, - htmlBuilder(group, options2) { - var newOptions = optionsWithFont(group, options2); - var inner2 = buildExpression$1(group.body, newOptions, true); - return buildCommon.makeSpan(["mord", "text"], inner2, newOptions); - }, - mathmlBuilder(group, options2) { - var newOptions = optionsWithFont(group, options2); - return buildExpressionRow(group.body, newOptions); + object3[key] = value2; } - }); - defineFunction({ - type: "underline", - names: ["\\underline"], - props: { - numArgs: 1, - allowedInText: true - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - return { - type: "underline", - mode: parser2.mode, - body: args[0] - }; - }, - htmlBuilder(group, options2) { - var innerGroup = buildGroup$1(group.body, options2); - var line2 = buildCommon.makeLineSpan("underline-line", options2); - var defaultRuleThickness = options2.fontMetrics().defaultRuleThickness; - var vlist = buildCommon.makeVList({ - positionType: "top", - positionData: innerGroup.height, - children: [{ - type: "kern", - size: defaultRuleThickness - }, { - type: "elem", - elem: line2 - }, { - type: "kern", - size: 3 * defaultRuleThickness - }, { - type: "elem", - elem: innerGroup - }] - }, options2); - return buildCommon.makeSpan(["mord", "underline"], [vlist], options2); - }, - mathmlBuilder(group, options2) { - var operator = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]); - operator.setAttribute("stretchy", "true"); - var node2 = new mathMLTree.MathNode("munder", [buildGroup(group.body, options2), operator]); - node2.setAttribute("accentunder", "true"); - return node2; + } + var baseAssignValue_default; + var init_baseAssignValue = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js"() { + "use strict"; + init_defineProperty(); + __name(baseAssignValue, "baseAssignValue"); + baseAssignValue_default = baseAssignValue; } }); - defineFunction({ - type: "vcenter", - names: ["\\vcenter"], - props: { - numArgs: 1, - argTypes: ["original"], - // In LaTeX, \vcenter can act only on a box. - allowedInText: false - }, - handler(_ref, args) { - var { - parser: parser2 - } = _ref; - return { - type: "vcenter", - mode: parser2.mode, - body: args[0] - }; - }, - htmlBuilder(group, options2) { - var body = buildGroup$1(group.body, options2); - var axisHeight = options2.fontMetrics().axisHeight; - var dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight)); - return buildCommon.makeVList({ - positionType: "shift", - positionData: dy, - children: [{ - type: "elem", - elem: body - }] - }, options2); - }, - mathmlBuilder(group, options2) { - return new mathMLTree.MathNode("mpadded", [buildGroup(group.body, options2)], ["vcenter"]); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js + function assignMergeValue(object3, key, value2) { + if (value2 !== void 0 && !eq_default(object3[key], value2) || value2 === void 0 && !(key in object3)) { + baseAssignValue_default(object3, key, value2); } - }); - defineFunction({ - type: "verb", - names: ["\\verb"], - props: { - numArgs: 0, - allowedInText: true - }, - handler(context, args, optArgs) { - throw new ParseError("\\verb ended by end of line instead of matching delimiter"); - }, - htmlBuilder(group, options2) { - var text2 = makeVerb(group); - var body = []; - var newOptions = options2.havingStyle(options2.style.text()); - for (var i2 = 0; i2 < text2.length; i2++) { - var c2 = text2[i2]; - if (c2 === "~") { - c2 = "\\textasciitilde"; - } - body.push(buildCommon.makeSymbol(c2, "Typewriter-Regular", group.mode, newOptions, ["mord", "texttt"])); - } - return buildCommon.makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options2)), buildCommon.tryCombineChars(body), newOptions); - }, - mathmlBuilder(group, options2) { - var text2 = new mathMLTree.TextNode(makeVerb(group)); - var node2 = new mathMLTree.MathNode("mtext", [text2]); - node2.setAttribute("mathvariant", "monospace"); - return node2; + } + var assignMergeValue_default; + var init_assignMergeValue = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js"() { + "use strict"; + init_baseAssignValue(); + init_eq(); + __name(assignMergeValue, "assignMergeValue"); + assignMergeValue_default = assignMergeValue; } }); - var makeVerb = (group) => group.body.replace(/ /g, group.star ? "␣" : " "); - var functions$1 = _functions; - var spaceRegexString = "[ \r\n ]"; - var controlWordRegexString = "\\\\[a-zA-Z@]+"; - var controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]"; - var controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*"; - var controlSpaceRegexString = "\\\\(\n|[ \r ]+\n?)[ \r ]*"; - var combiningDiacriticalMarkString = "[̀-ͯ]"; - var combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$"); - var tokenRegexString = "(" + spaceRegexString + "+)|" + // whitespace - (controlSpaceRegexString + "|") + // \whitespace - "([!-\\[\\]-‧‪-퟿豈-￿]" + // single codepoint - (combiningDiacriticalMarkString + "*") + // ...plus accents - "|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair - (combiningDiacriticalMarkString + "*") + // ...plus accents - "|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred - ("|" + controlWordWhitespaceRegexString) + // \macroName + spaces - ("|" + controlSymbolRegexString + ")"); - class Lexer { - // Category codes. The lexer only supports comment characters (14) for now. - // MacroExpander additionally distinguishes active (13). - constructor(input, settings) { - this.input = void 0; - this.settings = void 0; - this.tokenRegex = void 0; - this.catcodes = void 0; - this.input = input; - this.settings = settings; - this.tokenRegex = new RegExp(tokenRegexString, "g"); - this.catcodes = { - "%": 14, - // comment character - "~": 13 - // active character - }; - } - setCatcode(char2, code) { - this.catcodes[char2] = code; - } - /** - * This function lexes a single token. - */ - lex() { - var input = this.input; - var pos = this.tokenRegex.lastIndex; - if (pos === input.length) { - return new Token("EOF", new SourceLocation(this, pos, pos)); - } - var match = this.tokenRegex.exec(input); - if (match === null || match.index !== pos) { - throw new ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1))); - } - var text2 = match[6] || match[3] || (match[2] ? "\\ " : " "); - if (this.catcodes[text2] === 14) { - var nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex); - if (nlIndex === -1) { - this.tokenRegex.lastIndex = input.length; - this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)"); - } else { - this.tokenRegex.lastIndex = nlIndex + 1; - } - return this.lex(); - } - return new Token(text2, new SourceLocation(this, pos, this.tokenRegex.lastIndex)); - } - } - class Namespace { - /** - * Both arguments are optional. The first argument is an object of - * built-in mappings which never change. The second argument is an object - * of initial (global-level) mappings, which will constantly change - * according to any global/top-level `set`s done. - */ - constructor(builtins, globalMacros) { - if (builtins === void 0) { - builtins = {}; - } - if (globalMacros === void 0) { - globalMacros = {}; - } - this.current = void 0; - this.builtins = void 0; - this.undefStack = void 0; - this.current = globalMacros; - this.builtins = builtins; - this.undefStack = []; - } - /** - * Start a new nested group, affecting future local `set`s. - */ - beginGroup() { - this.undefStack.push({}); - } - /** - * End current nested group, restoring values before the group began. - */ - endGroup() { - if (this.undefStack.length === 0) { - throw new ParseError("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug"); - } - var undefs = this.undefStack.pop(); - for (var undef in undefs) { - if (undefs.hasOwnProperty(undef)) { - if (undefs[undef] == null) { - delete this.current[undef]; - } else { - this.current[undef] = undefs[undef]; - } - } - } - } - /** - * Ends all currently nested groups (if any), restoring values before the - * groups began. Useful in case of an error in the middle of parsing. - */ - endGroups() { - while (this.undefStack.length > 0) { - this.endGroup(); - } - } - /** - * Detect whether `name` has a definition. Equivalent to - * `get(name) != null`. - */ - has(name) { - return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name); - } - /** - * Get the current value of a name, or `undefined` if there is no value. - * - * Note: Do not use `if (namespace.get(...))` to detect whether a macro - * is defined, as the definition may be the empty string which evaluates - * to `false` in JavaScript. Use `if (namespace.get(...) != null)` or - * `if (namespace.has(...))`. - */ - get(name) { - if (this.current.hasOwnProperty(name)) { - return this.current[name]; - } else { - return this.builtins[name]; - } - } - /** - * Set the current value of a name, and optionally set it globally too. - * Local set() sets the current value and (when appropriate) adds an undo - * operation to the undo stack. Global set() may change the undo - * operation at every level, so takes time linear in their number. - * A value of undefined means to delete existing definitions. - */ - set(name, value2, global2) { - if (global2 === void 0) { - global2 = false; - } - if (global2) { - for (var i2 = 0; i2 < this.undefStack.length; i2++) { - delete this.undefStack[i2][name]; - } - if (this.undefStack.length > 0) { - this.undefStack[this.undefStack.length - 1][name] = value2; - } - } else { - var top2 = this.undefStack[this.undefStack.length - 1]; - if (top2 && !top2.hasOwnProperty(name)) { - top2[name] = this.current[name]; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js + function createBaseFor(fromRight) { + return function(object3, iteratee, keysFunc) { + var index = -1, iterable = Object(object3), props = keysFunc(object3), length2 = props.length; + while (length2--) { + var key = props[fromRight ? length2 : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; } } - if (value2 == null) { - delete this.current[name]; - } else { - this.current[name] = value2; - } - } + return object3; + }; } - var macros = _macros; - defineMacro("\\noexpand", function(context) { - var t = context.popToken(); - if (context.isExpandable(t.text)) { - t.noexpand = true; - t.treatAsRelax = true; + var createBaseFor_default; + var init_createBaseFor = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js"() { + "use strict"; + __name(createBaseFor, "createBaseFor"); + createBaseFor_default = createBaseFor; } - return { - tokens: [t], - numArgs: 0 - }; }); - defineMacro("\\expandafter", function(context) { - var t = context.popToken(); - context.expandOnce(true); - return { - tokens: [t], - numArgs: 0 - }; - }); - defineMacro("\\@firstoftwo", function(context) { - var args = context.consumeArgs(2); - return { - tokens: args[0], - numArgs: 0 - }; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js + var baseFor, baseFor_default; + var init_baseFor = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js"() { + "use strict"; + init_createBaseFor(); + baseFor = createBaseFor_default(); + baseFor_default = baseFor; + } }); - defineMacro("\\@secondoftwo", function(context) { - var args = context.consumeArgs(2); - return { - tokens: args[1], - numArgs: 0 + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2); + buffer.copy(result); + return result; + } + var freeExports, freeModule, moduleExports, Buffer2, allocUnsafe, cloneBuffer_default; + var init_cloneBuffer = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js"() { + "use strict"; + init_root(); + freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + moduleExports = freeModule && freeModule.exports === freeExports; + Buffer2 = moduleExports ? root_default.Buffer : void 0; + allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0; + __name(cloneBuffer, "cloneBuffer"); + cloneBuffer_default = cloneBuffer; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js + var Uint8Array2, Uint8Array_default; + var init_Uint8Array = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js"() { + "use strict"; + init_root(); + Uint8Array2 = root_default.Uint8Array; + Uint8Array_default = Uint8Array2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer)); + return result; + } + var cloneArrayBuffer_default; + var init_cloneArrayBuffer = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js"() { + "use strict"; + init_Uint8Array(); + __name(cloneArrayBuffer, "cloneArrayBuffer"); + cloneArrayBuffer_default = cloneArrayBuffer; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + var cloneTypedArray_default; + var init_cloneTypedArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js"() { + "use strict"; + init_cloneArrayBuffer(); + __name(cloneTypedArray, "cloneTypedArray"); + cloneTypedArray_default = cloneTypedArray; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js + function copyArray(source, array4) { + var index = -1, length2 = source.length; + array4 || (array4 = Array(length2)); + while (++index < length2) { + array4[index] = source[index]; + } + return array4; + } + var copyArray_default; + var init_copyArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js"() { + "use strict"; + __name(copyArray, "copyArray"); + copyArray_default = copyArray; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js + var objectCreate, baseCreate, baseCreate_default; + var init_baseCreate = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js"() { + "use strict"; + init_isObject(); + objectCreate = Object.create; + baseCreate = /* @__PURE__ */ function() { + function object3() { + } + __name(object3, "object"); + return function(proto) { + if (!isObject_default(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object3.prototype = proto; + var result = new object3(); + object3.prototype = void 0; + return result; + }; + }(); + baseCreate_default = baseCreate; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js + function overArg(func, transform8) { + return function(arg) { + return func(transform8(arg)); }; + } + var overArg_default; + var init_overArg = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js"() { + "use strict"; + __name(overArg, "overArg"); + overArg_default = overArg; + } }); - defineMacro("\\@ifnextchar", function(context) { - var args = context.consumeArgs(3); - context.consumeSpaces(); - var nextToken = context.future(); - if (args[0].length === 1 && args[0][0].text === nextToken.text) { - return { - tokens: args[1], - numArgs: 0 - }; - } else { - return { - tokens: args[2], - numArgs: 0 - }; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getPrototype.js + var getPrototype, getPrototype_default; + var init_getPrototype = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getPrototype.js"() { + "use strict"; + init_overArg(); + getPrototype = overArg_default(Object.getPrototypeOf, Object); + getPrototype_default = getPrototype; } }); - defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}"); - defineMacro("\\TextOrMath", function(context) { - var args = context.consumeArgs(2); - if (context.mode === "text") { - return { - tokens: args[0], - numArgs: 0 - }; - } else { - return { - tokens: args[1], - numArgs: 0 - }; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js + function isPrototype(value2) { + var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto6; + return value2 === proto; + } + var objectProto6, isPrototype_default; + var init_isPrototype = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js"() { + "use strict"; + objectProto6 = Object.prototype; + __name(isPrototype, "isPrototype"); + isPrototype_default = isPrototype; } }); - var digitToNumber = { - "0": 0, - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "9": 9, - "a": 10, - "A": 10, - "b": 11, - "B": 11, - "c": 12, - "C": 12, - "d": 13, - "D": 13, - "e": 14, - "E": 14, - "f": 15, - "F": 15 - }; - defineMacro("\\char", function(context) { - var token2 = context.popToken(); - var base; - var number2 = ""; - if (token2.text === "'") { - base = 8; - token2 = context.popToken(); - } else if (token2.text === '"') { - base = 16; - token2 = context.popToken(); - } else if (token2.text === "`") { - token2 = context.popToken(); - if (token2.text[0] === "\\") { - number2 = token2.text.charCodeAt(1); - } else if (token2.text === "EOF") { - throw new ParseError("\\char` missing argument"); - } else { - number2 = token2.text.charCodeAt(0); - } - } else { - base = 10; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js + function initCloneObject(object3) { + return typeof object3.constructor == "function" && !isPrototype_default(object3) ? baseCreate_default(getPrototype_default(object3)) : {}; + } + var initCloneObject_default; + var init_initCloneObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js"() { + "use strict"; + init_baseCreate(); + init_getPrototype(); + init_isPrototype(); + __name(initCloneObject, "initCloneObject"); + initCloneObject_default = initCloneObject; } - if (base) { - number2 = digitToNumber[token2.text]; - if (number2 == null || number2 >= base) { - throw new ParseError("Invalid base-" + base + " digit " + token2.text); - } - var digit; - while ((digit = digitToNumber[context.future().text]) != null && digit < base) { - number2 *= base; - number2 += digit; - context.popToken(); - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js + function isObjectLike(value2) { + return value2 != null && typeof value2 == "object"; + } + var isObjectLike_default; + var init_isObjectLike = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js"() { + "use strict"; + __name(isObjectLike, "isObjectLike"); + isObjectLike_default = isObjectLike; } - return "\\@char{" + number2 + "}"; }); - var newcommand = (context, existsOK, nonexistsOK) => { - var arg = context.consumeArg().tokens; - if (arg.length !== 1) { - throw new ParseError("\\newcommand's first argument must be a macro name"); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js + function baseIsArguments(value2) { + return isObjectLike_default(value2) && baseGetTag_default(value2) == argsTag; + } + var argsTag, baseIsArguments_default; + var init_baseIsArguments = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js"() { + "use strict"; + init_baseGetTag(); + init_isObjectLike(); + argsTag = "[object Arguments]"; + __name(baseIsArguments, "baseIsArguments"); + baseIsArguments_default = baseIsArguments; } - var name = arg[0].text; - var exists2 = context.isDefined(name); - if (exists2 && !existsOK) { - throw new ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand")); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js + var objectProto7, hasOwnProperty5, propertyIsEnumerable, isArguments, isArguments_default; + var init_isArguments = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js"() { + "use strict"; + init_baseIsArguments(); + init_isObjectLike(); + objectProto7 = Object.prototype; + hasOwnProperty5 = objectProto7.hasOwnProperty; + propertyIsEnumerable = objectProto7.propertyIsEnumerable; + isArguments = baseIsArguments_default(/* @__PURE__ */ function() { + return arguments; + }()) ? baseIsArguments_default : function(value2) { + return isObjectLike_default(value2) && hasOwnProperty5.call(value2, "callee") && !propertyIsEnumerable.call(value2, "callee"); + }; + isArguments_default = isArguments; } - if (!exists2 && !nonexistsOK) { - throw new ParseError("\\renewcommand{" + name + "} when command " + name + " does not yet exist; use \\newcommand"); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js + var isArray, isArray_default; + var init_isArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js"() { + "use strict"; + isArray = Array.isArray; + isArray_default = isArray; } - var numArgs = 0; - arg = context.consumeArg().tokens; - if (arg.length === 1 && arg[0].text === "[") { - var argText = ""; - var token2 = context.expandNextToken(); - while (token2.text !== "]" && token2.text !== "EOF") { - argText += token2.text; - token2 = context.expandNextToken(); - } - if (!argText.match(/^\s*[0-9]+\s*$/)) { - throw new ParseError("Invalid number of arguments: " + argText); - } - numArgs = parseInt(argText); - arg = context.consumeArg().tokens; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js + function isLength(value2) { + return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER; + } + var MAX_SAFE_INTEGER, isLength_default; + var init_isLength = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js"() { + "use strict"; + MAX_SAFE_INTEGER = 9007199254740991; + __name(isLength, "isLength"); + isLength_default = isLength; } - context.macros.set(name, { - tokens: arg, - numArgs - }); - return ""; - }; - defineMacro("\\newcommand", (context) => newcommand(context, false, true)); - defineMacro("\\renewcommand", (context) => newcommand(context, true, false)); - defineMacro("\\providecommand", (context) => newcommand(context, true, true)); - defineMacro("\\message", (context) => { - var arg = context.consumeArgs(1)[0]; - console.log(arg.reverse().map((token2) => token2.text).join("")); - return ""; }); - defineMacro("\\errmessage", (context) => { - var arg = context.consumeArgs(1)[0]; - console.error(arg.reverse().map((token2) => token2.text).join("")); - return ""; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js + function isArrayLike(value2) { + return value2 != null && isLength_default(value2.length) && !isFunction_default(value2); + } + var isArrayLike_default; + var init_isArrayLike = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js"() { + "use strict"; + init_isFunction(); + init_isLength(); + __name(isArrayLike, "isArrayLike"); + isArrayLike_default = isArrayLike; + } }); - defineMacro("\\show", (context) => { - var tok = context.popToken(); - var name = tok.text; - console.log(tok, context.macros.get(name), functions$1[name], symbols.math[name], symbols.text[name]); - return ""; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLikeObject.js + function isArrayLikeObject(value2) { + return isObjectLike_default(value2) && isArrayLike_default(value2); + } + var isArrayLikeObject_default; + var init_isArrayLikeObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLikeObject.js"() { + "use strict"; + init_isArrayLike(); + init_isObjectLike(); + __name(isArrayLikeObject, "isArrayLikeObject"); + isArrayLikeObject_default = isArrayLikeObject; + } }); - defineMacro("\\bgroup", "{"); - defineMacro("\\egroup", "}"); - defineMacro("~", "\\nobreakspace"); - defineMacro("\\lq", "`"); - defineMacro("\\rq", "'"); - defineMacro("\\aa", "\\r a"); - defineMacro("\\AA", "\\r A"); - defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}"); - defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"); - defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"); - defineMacro("ℬ", "\\mathscr{B}"); - defineMacro("ℰ", "\\mathscr{E}"); - defineMacro("ℱ", "\\mathscr{F}"); - defineMacro("ℋ", "\\mathscr{H}"); - defineMacro("ℐ", "\\mathscr{I}"); - defineMacro("ℒ", "\\mathscr{L}"); - defineMacro("ℳ", "\\mathscr{M}"); - defineMacro("ℛ", "\\mathscr{R}"); - defineMacro("ℭ", "\\mathfrak{C}"); - defineMacro("ℌ", "\\mathfrak{H}"); - defineMacro("ℨ", "\\mathfrak{Z}"); - defineMacro("\\Bbbk", "\\Bbb{k}"); - defineMacro("·", "\\cdotp"); - defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"); - defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"); - defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"); - defineMacro("\\mathstrut", "\\vphantom{(}"); - defineMacro("\\underbar", "\\underline{\\text{#1}}"); - defineMacro("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'); - defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"); - defineMacro("\\ne", "\\neq"); - defineMacro("≠", "\\neq"); - defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"); - defineMacro("∉", "\\notin"); - defineMacro("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"); - defineMacro("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"); - defineMacro("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"); - defineMacro("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"); - defineMacro("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"); - defineMacro("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"); - defineMacro("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"); - defineMacro("⟂", "\\perp"); - defineMacro("‼", "\\mathclose{!\\mkern-0.8mu!}"); - defineMacro("∌", "\\notni"); - defineMacro("⌜", "\\ulcorner"); - defineMacro("⌝", "\\urcorner"); - defineMacro("⌞", "\\llcorner"); - defineMacro("⌟", "\\lrcorner"); - defineMacro("©", "\\copyright"); - defineMacro("®", "\\textregistered"); - defineMacro("️", "\\textregistered"); - defineMacro("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'); - defineMacro("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'); - defineMacro("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'); - defineMacro("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'); - defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}"); - defineMacro("⋮", "\\vdots"); - defineMacro("\\varGamma", "\\mathit{\\Gamma}"); - defineMacro("\\varDelta", "\\mathit{\\Delta}"); - defineMacro("\\varTheta", "\\mathit{\\Theta}"); - defineMacro("\\varLambda", "\\mathit{\\Lambda}"); - defineMacro("\\varXi", "\\mathit{\\Xi}"); - defineMacro("\\varPi", "\\mathit{\\Pi}"); - defineMacro("\\varSigma", "\\mathit{\\Sigma}"); - defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}"); - defineMacro("\\varPhi", "\\mathit{\\Phi}"); - defineMacro("\\varPsi", "\\mathit{\\Psi}"); - defineMacro("\\varOmega", "\\mathit{\\Omega}"); - defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"); - defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"); - defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"); - defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"); - defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"); - defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); - var dotsByToken = { - ",": "\\dotsc", - "\\not": "\\dotsb", - // \keybin@ checks for the following: - "+": "\\dotsb", - "=": "\\dotsb", - "<": "\\dotsb", - ">": "\\dotsb", - "-": "\\dotsb", - "*": "\\dotsb", - ":": "\\dotsb", - // Symbols whose definition starts with \DOTSB: - "\\DOTSB": "\\dotsb", - "\\coprod": "\\dotsb", - "\\bigvee": "\\dotsb", - "\\bigwedge": "\\dotsb", - "\\biguplus": "\\dotsb", - "\\bigcap": "\\dotsb", - "\\bigcup": "\\dotsb", - "\\prod": "\\dotsb", - "\\sum": "\\dotsb", - "\\bigotimes": "\\dotsb", - "\\bigoplus": "\\dotsb", - "\\bigodot": "\\dotsb", - "\\bigsqcup": "\\dotsb", - "\\And": "\\dotsb", - "\\longrightarrow": "\\dotsb", - "\\Longrightarrow": "\\dotsb", - "\\longleftarrow": "\\dotsb", - "\\Longleftarrow": "\\dotsb", - "\\longleftrightarrow": "\\dotsb", - "\\Longleftrightarrow": "\\dotsb", - "\\mapsto": "\\dotsb", - "\\longmapsto": "\\dotsb", - "\\hookrightarrow": "\\dotsb", - "\\doteq": "\\dotsb", - // Symbols whose definition starts with \mathbin: - "\\mathbin": "\\dotsb", - // Symbols whose definition starts with \mathrel: - "\\mathrel": "\\dotsb", - "\\relbar": "\\dotsb", - "\\Relbar": "\\dotsb", - "\\xrightarrow": "\\dotsb", - "\\xleftarrow": "\\dotsb", - // Symbols whose definition starts with \DOTSI: - "\\DOTSI": "\\dotsi", - "\\int": "\\dotsi", - "\\oint": "\\dotsi", - "\\iint": "\\dotsi", - "\\iiint": "\\dotsi", - "\\iiiint": "\\dotsi", - "\\idotsint": "\\dotsi", - // Symbols whose definition starts with \DOTSX: - "\\DOTSX": "\\dotsx" - }; - defineMacro("\\dots", function(context) { - var thedots = "\\dotso"; - var next2 = context.expandAfterFuture().text; - if (next2 in dotsByToken) { - thedots = dotsByToken[next2]; - } else if (next2.slice(0, 4) === "\\not") { - thedots = "\\dotsb"; - } else if (next2 in symbols.math) { - if (utils.contains(["bin", "rel"], symbols.math[next2].group)) { - thedots = "\\dotsb"; - } - } - return thedots; - }); - var spaceAfterDots = { - // \rightdelim@ checks for the following: - ")": true, - "]": true, - "\\rbrack": true, - "\\}": true, - "\\rbrace": true, - "\\rangle": true, - "\\rceil": true, - "\\rfloor": true, - "\\rgroup": true, - "\\rmoustache": true, - "\\right": true, - "\\bigr": true, - "\\biggr": true, - "\\Bigr": true, - "\\Biggr": true, - // \extra@ also tests for the following: - "$": true, - // \extrap@ checks for the following: - ";": true, - ".": true, - ",": true - }; - defineMacro("\\dotso", function(context) { - var next2 = context.future().text; - if (next2 in spaceAfterDots) { - return "\\ldots\\,"; - } else { - return "\\ldots"; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js + function stubFalse() { + return false; + } + var stubFalse_default; + var init_stubFalse = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js"() { + "use strict"; + __name(stubFalse, "stubFalse"); + stubFalse_default = stubFalse; } }); - defineMacro("\\dotsc", function(context) { - var next2 = context.future().text; - if (next2 in spaceAfterDots && next2 !== ",") { - return "\\ldots\\,"; - } else { - return "\\ldots"; + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js + var freeExports2, freeModule2, moduleExports2, Buffer3, nativeIsBuffer, isBuffer, isBuffer_default; + var init_isBuffer = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js"() { + "use strict"; + init_root(); + init_stubFalse(); + freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports; + freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module; + moduleExports2 = freeModule2 && freeModule2.exports === freeExports2; + Buffer3 = moduleExports2 ? root_default.Buffer : void 0; + nativeIsBuffer = Buffer3 ? Buffer3.isBuffer : void 0; + isBuffer = nativeIsBuffer || stubFalse_default; + isBuffer_default = isBuffer; } }); - defineMacro("\\cdots", function(context) { - var next2 = context.future().text; - if (next2 in spaceAfterDots) { - return "\\@cdots\\,"; - } else { - return "\\@cdots"; - } - }); - defineMacro("\\dotsb", "\\cdots"); - defineMacro("\\dotsm", "\\cdots"); - defineMacro("\\dotsi", "\\!\\cdots"); - defineMacro("\\dotsx", "\\ldots\\,"); - defineMacro("\\DOTSI", "\\relax"); - defineMacro("\\DOTSB", "\\relax"); - defineMacro("\\DOTSX", "\\relax"); - defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"); - defineMacro("\\,", "\\tmspace+{3mu}{.1667em}"); - defineMacro("\\thinspace", "\\,"); - defineMacro("\\>", "\\mskip{4mu}"); - defineMacro("\\:", "\\tmspace+{4mu}{.2222em}"); - defineMacro("\\medspace", "\\:"); - defineMacro("\\;", "\\tmspace+{5mu}{.2777em}"); - defineMacro("\\thickspace", "\\;"); - defineMacro("\\!", "\\tmspace-{3mu}{.1667em}"); - defineMacro("\\negthinspace", "\\!"); - defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}"); - defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}"); - defineMacro("\\enspace", "\\kern.5em "); - defineMacro("\\enskip", "\\hskip.5em\\relax"); - defineMacro("\\quad", "\\hskip1em\\relax"); - defineMacro("\\qquad", "\\hskip2em\\relax"); - defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren"); - defineMacro("\\tag@paren", "\\tag@literal{({#1})}"); - defineMacro("\\tag@literal", (context) => { - if (context.macros.get("\\df@tag")) { - throw new ParseError("Multiple \\tag"); - } - return "\\gdef\\df@tag{\\text{#1}}"; - }); - defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"); - defineMacro("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"); - defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}"); - defineMacro("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"); - defineMacro("\\newline", "\\\\\\relax"); - defineMacro("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}"); - var latexRaiseA = makeEm(fontMetricsData["Main-Regular"]["T".charCodeAt(0)][1] - 0.7 * fontMetricsData["Main-Regular"]["A".charCodeAt(0)][1]); - defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}"); - defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}"); - defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace"); - defineMacro("\\@hspace", "\\hskip #1\\relax"); - defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax"); - defineMacro("\\ordinarycolon", ":"); - defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}"); - defineMacro("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'); - defineMacro("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'); - defineMacro("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'); - defineMacro("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'); - defineMacro("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'); - defineMacro("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'); - defineMacro("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'); - defineMacro("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'); - defineMacro("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'); - defineMacro("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'); - defineMacro("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'); - defineMacro("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'); - defineMacro("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'); - defineMacro("∷", "\\dblcolon"); - defineMacro("∹", "\\eqcolon"); - defineMacro("≔", "\\coloneqq"); - defineMacro("≕", "\\eqqcolon"); - defineMacro("⩴", "\\Coloneqq"); - defineMacro("\\ratio", "\\vcentcolon"); - defineMacro("\\coloncolon", "\\dblcolon"); - defineMacro("\\colonequals", "\\coloneqq"); - defineMacro("\\coloncolonequals", "\\Coloneqq"); - defineMacro("\\equalscolon", "\\eqqcolon"); - defineMacro("\\equalscoloncolon", "\\Eqqcolon"); - defineMacro("\\colonminus", "\\coloneq"); - defineMacro("\\coloncolonminus", "\\Coloneq"); - defineMacro("\\minuscolon", "\\eqcolon"); - defineMacro("\\minuscoloncolon", "\\Eqcolon"); - defineMacro("\\coloncolonapprox", "\\Colonapprox"); - defineMacro("\\coloncolonsim", "\\Colonsim"); - defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); - defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"); - defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); - defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"); - defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"); - defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}"); - defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}"); - defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}"); - defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}"); - defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}"); - defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}"); - defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}"); - defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}"); - defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}"); - defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}"); - defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}"); - defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}"); - defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{≰}"); - defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}"); - defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}"); - defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}"); - defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}"); - defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}"); - defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}"); - defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}"); - defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}"); - defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}"); - defineMacro("\\imath", "\\html@mathml{\\@imath}{ı}"); - defineMacro("\\jmath", "\\html@mathml{\\@jmath}{ȷ}"); - defineMacro("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"); - defineMacro("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"); - defineMacro("⟦", "\\llbracket"); - defineMacro("⟧", "\\rrbracket"); - defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"); - defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"); - defineMacro("⦃", "\\lBrace"); - defineMacro("⦄", "\\rBrace"); - defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"); - defineMacro("⦵", "\\minuso"); - defineMacro("\\darr", "\\downarrow"); - defineMacro("\\dArr", "\\Downarrow"); - defineMacro("\\Darr", "\\Downarrow"); - defineMacro("\\lang", "\\langle"); - defineMacro("\\rang", "\\rangle"); - defineMacro("\\uarr", "\\uparrow"); - defineMacro("\\uArr", "\\Uparrow"); - defineMacro("\\Uarr", "\\Uparrow"); - defineMacro("\\N", "\\mathbb{N}"); - defineMacro("\\R", "\\mathbb{R}"); - defineMacro("\\Z", "\\mathbb{Z}"); - defineMacro("\\alef", "\\aleph"); - defineMacro("\\alefsym", "\\aleph"); - defineMacro("\\Alpha", "\\mathrm{A}"); - defineMacro("\\Beta", "\\mathrm{B}"); - defineMacro("\\bull", "\\bullet"); - defineMacro("\\Chi", "\\mathrm{X}"); - defineMacro("\\clubs", "\\clubsuit"); - defineMacro("\\cnums", "\\mathbb{C}"); - defineMacro("\\Complex", "\\mathbb{C}"); - defineMacro("\\Dagger", "\\ddagger"); - defineMacro("\\diamonds", "\\diamondsuit"); - defineMacro("\\empty", "\\emptyset"); - defineMacro("\\Epsilon", "\\mathrm{E}"); - defineMacro("\\Eta", "\\mathrm{H}"); - defineMacro("\\exist", "\\exists"); - defineMacro("\\harr", "\\leftrightarrow"); - defineMacro("\\hArr", "\\Leftrightarrow"); - defineMacro("\\Harr", "\\Leftrightarrow"); - defineMacro("\\hearts", "\\heartsuit"); - defineMacro("\\image", "\\Im"); - defineMacro("\\infin", "\\infty"); - defineMacro("\\Iota", "\\mathrm{I}"); - defineMacro("\\isin", "\\in"); - defineMacro("\\Kappa", "\\mathrm{K}"); - defineMacro("\\larr", "\\leftarrow"); - defineMacro("\\lArr", "\\Leftarrow"); - defineMacro("\\Larr", "\\Leftarrow"); - defineMacro("\\lrarr", "\\leftrightarrow"); - defineMacro("\\lrArr", "\\Leftrightarrow"); - defineMacro("\\Lrarr", "\\Leftrightarrow"); - defineMacro("\\Mu", "\\mathrm{M}"); - defineMacro("\\natnums", "\\mathbb{N}"); - defineMacro("\\Nu", "\\mathrm{N}"); - defineMacro("\\Omicron", "\\mathrm{O}"); - defineMacro("\\plusmn", "\\pm"); - defineMacro("\\rarr", "\\rightarrow"); - defineMacro("\\rArr", "\\Rightarrow"); - defineMacro("\\Rarr", "\\Rightarrow"); - defineMacro("\\real", "\\Re"); - defineMacro("\\reals", "\\mathbb{R}"); - defineMacro("\\Reals", "\\mathbb{R}"); - defineMacro("\\Rho", "\\mathrm{P}"); - defineMacro("\\sdot", "\\cdot"); - defineMacro("\\sect", "\\S"); - defineMacro("\\spades", "\\spadesuit"); - defineMacro("\\sub", "\\subset"); - defineMacro("\\sube", "\\subseteq"); - defineMacro("\\supe", "\\supseteq"); - defineMacro("\\Tau", "\\mathrm{T}"); - defineMacro("\\thetasym", "\\vartheta"); - defineMacro("\\weierp", "\\wp"); - defineMacro("\\Zeta", "\\mathrm{Z}"); - defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}"); - defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}"); - defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits"); - defineMacro("\\bra", "\\mathinner{\\langle{#1}|}"); - defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}"); - defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}"); - defineMacro("\\Bra", "\\left\\langle#1\\right|"); - defineMacro("\\Ket", "\\left|#1\\right\\rangle"); - var braketHelper = (one2) => (context) => { - var left2 = context.consumeArg().tokens; - var middle = context.consumeArg().tokens; - var middleDouble = context.consumeArg().tokens; - var right2 = context.consumeArg().tokens; - var oldMiddle = context.macros.get("|"); - var oldMiddleDouble = context.macros.get("\\|"); - context.macros.beginGroup(); - var midMacro = (double) => (context2) => { - if (one2) { - context2.macros.set("|", oldMiddle); - if (middleDouble.length) { - context2.macros.set("\\|", oldMiddleDouble); - } - } - var doubled = double; - if (!double && middleDouble.length) { - var nextToken = context2.future(); - if (nextToken.text === "|") { - context2.popToken(); - doubled = true; - } - } - return { - tokens: doubled ? middleDouble : middle, - numArgs: 0 - }; - }; - context.macros.set("|", midMacro(false)); - if (middleDouble.length) { - context.macros.set("\\|", midMacro(true)); - } - var arg = context.consumeArg().tokens; - var expanded = context.expandTokens([ - ...right2, - ...arg, - ...left2 - // reversed - ]); - context.macros.endGroup(); - return { - tokens: expanded.reverse(), - numArgs: 0 + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js + function isPlainObject(value2) { + if (!isObjectLike_default(value2) || baseGetTag_default(value2) != objectTag) { + return false; + } + var proto = getPrototype_default(value2); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty6.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString; + } + var objectTag, funcProto3, objectProto8, funcToString3, hasOwnProperty6, objectCtorString, isPlainObject_default; + var init_isPlainObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js"() { + "use strict"; + init_baseGetTag(); + init_getPrototype(); + init_isObjectLike(); + objectTag = "[object Object]"; + funcProto3 = Function.prototype; + objectProto8 = Object.prototype; + funcToString3 = funcProto3.toString; + hasOwnProperty6 = objectProto8.hasOwnProperty; + objectCtorString = funcToString3.call(Object); + __name(isPlainObject, "isPlainObject"); + isPlainObject_default = isPlainObject; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js + function baseIsTypedArray(value2) { + return isObjectLike_default(value2) && isLength_default(value2.length) && !!typedArrayTags[baseGetTag_default(value2)]; + } + var argsTag2, arrayTag, boolTag, dateTag, errorTag, funcTag2, mapTag, numberTag, objectTag2, regexpTag, setTag, stringTag, weakMapTag, arrayBufferTag, dataViewTag, float32Tag, float64Tag, int8Tag, int16Tag, int32Tag, uint8Tag, uint8ClampedTag, uint16Tag, uint32Tag, typedArrayTags, baseIsTypedArray_default; + var init_baseIsTypedArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js"() { + "use strict"; + init_baseGetTag(); + init_isLength(); + init_isObjectLike(); + argsTag2 = "[object Arguments]"; + arrayTag = "[object Array]"; + boolTag = "[object Boolean]"; + dateTag = "[object Date]"; + errorTag = "[object Error]"; + funcTag2 = "[object Function]"; + mapTag = "[object Map]"; + numberTag = "[object Number]"; + objectTag2 = "[object Object]"; + regexpTag = "[object RegExp]"; + setTag = "[object Set]"; + stringTag = "[object String]"; + weakMapTag = "[object WeakMap]"; + arrayBufferTag = "[object ArrayBuffer]"; + dataViewTag = "[object DataView]"; + float32Tag = "[object Float32Array]"; + float64Tag = "[object Float64Array]"; + int8Tag = "[object Int8Array]"; + int16Tag = "[object Int16Array]"; + int32Tag = "[object Int32Array]"; + uint8Tag = "[object Uint8Array]"; + uint8ClampedTag = "[object Uint8ClampedArray]"; + uint16Tag = "[object Uint16Array]"; + uint32Tag = "[object Uint32Array]"; + typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag2] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + __name(baseIsTypedArray, "baseIsTypedArray"); + baseIsTypedArray_default = baseIsTypedArray; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js + function baseUnary(func) { + return function(value2) { + return func(value2); }; - }; - defineMacro("\\bra@ket", braketHelper(false)); - defineMacro("\\bra@set", braketHelper(true)); - defineMacro("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"); - defineMacro("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"); - defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"); - defineMacro("\\angln", "{\\angl n}"); - defineMacro("\\blue", "\\textcolor{##6495ed}{#1}"); - defineMacro("\\orange", "\\textcolor{##ffa500}{#1}"); - defineMacro("\\pink", "\\textcolor{##ff00af}{#1}"); - defineMacro("\\red", "\\textcolor{##df0030}{#1}"); - defineMacro("\\green", "\\textcolor{##28ae7b}{#1}"); - defineMacro("\\gray", "\\textcolor{gray}{#1}"); - defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}"); - defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}"); - defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}"); - defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}"); - defineMacro("\\blueD", "\\textcolor{##11accd}{#1}"); - defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}"); - defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}"); - defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}"); - defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}"); - defineMacro("\\tealD", "\\textcolor{##01a995}{#1}"); - defineMacro("\\tealE", "\\textcolor{##208170}{#1}"); - defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}"); - defineMacro("\\greenB", "\\textcolor{##8af281}{#1}"); - defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}"); - defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}"); - defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}"); - defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}"); - defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}"); - defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}"); - defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}"); - defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}"); - defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}"); - defineMacro("\\redB", "\\textcolor{##ff8482}{#1}"); - defineMacro("\\redC", "\\textcolor{##f9685d}{#1}"); - defineMacro("\\redD", "\\textcolor{##e84d39}{#1}"); - defineMacro("\\redE", "\\textcolor{##bc2612}{#1}"); - defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}"); - defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}"); - defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}"); - defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}"); - defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}"); - defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}"); - defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}"); - defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}"); - defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}"); - defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}"); - defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}"); - defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}"); - defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}"); - defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}"); - defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}"); - defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}"); - defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}"); - defineMacro("\\grayE", "\\textcolor{##babec2}{#1}"); - defineMacro("\\grayF", "\\textcolor{##888d93}{#1}"); - defineMacro("\\grayG", "\\textcolor{##626569}{#1}"); - defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}"); - defineMacro("\\grayI", "\\textcolor{##21242c}{#1}"); - defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}"); - defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}"); - var implicitCommands = { - "^": true, - // Parser.js - "_": true, - // Parser.js - "\\limits": true, - // Parser.js - "\\nolimits": true - // Parser.js - }; - class MacroExpander { - constructor(input, settings, mode) { - this.settings = void 0; - this.expansionCount = void 0; - this.lexer = void 0; - this.macros = void 0; - this.stack = void 0; - this.mode = void 0; - this.settings = settings; - this.expansionCount = 0; - this.feed(input); - this.macros = new Namespace(macros, settings.macros); - this.mode = mode; - this.stack = []; - } - /** - * Feed a new input string to the same MacroExpander - * (with existing macros etc.). - */ - feed(input) { - this.lexer = new Lexer(input, this.settings); - } - /** - * Switches between "text" and "math" modes. - */ - switchMode(newMode) { - this.mode = newMode; - } - /** - * Start a new group nesting within all namespaces. - */ - beginGroup() { - this.macros.beginGroup(); - } - /** - * End current group nesting within all namespaces. - */ - endGroup() { - this.macros.endGroup(); - } - /** - * Ends all currently nested groups (if any), restoring values before the - * groups began. Useful in case of an error in the middle of parsing. - */ - endGroups() { - this.macros.endGroups(); - } - /** - * Returns the topmost token on the stack, without expanding it. - * Similar in behavior to TeX's `\futurelet`. - */ - future() { - if (this.stack.length === 0) { - this.pushToken(this.lexer.lex()); - } - return this.stack[this.stack.length - 1]; - } - /** - * Remove and return the next unexpanded token. - */ - popToken() { - this.future(); - return this.stack.pop(); - } - /** - * Add a given token to the token stack. In particular, this get be used - * to put back a token returned from one of the other methods. - */ - pushToken(token2) { - this.stack.push(token2); - } - /** - * Append an array of tokens to the token stack. - */ - pushTokens(tokens) { - this.stack.push(...tokens); - } - /** - * Find an macro argument without expanding tokens and append the array of - * tokens to the token stack. Uses Token as a container for the result. - */ - scanArgument(isOptional) { - var start2; - var end2; - var tokens; - if (isOptional) { - this.consumeSpaces(); - if (this.future().text !== "[") { - return null; - } - start2 = this.popToken(); - ({ - tokens, - end: end2 - } = this.consumeArg(["]"])); - } else { - ({ - tokens, - start: start2, - end: end2 - } = this.consumeArg()); - } - this.pushToken(new Token("EOF", end2.loc)); - this.pushTokens(tokens); - return start2.range(end2, ""); - } - /** - * Consume all following space tokens, without expansion. - */ - consumeSpaces() { - for (; ; ) { - var token2 = this.future(); - if (token2.text === " ") { - this.stack.pop(); - } else { - break; - } - } + } + var baseUnary_default; + var init_baseUnary = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js"() { + "use strict"; + __name(baseUnary, "baseUnary"); + baseUnary_default = baseUnary; } - /** - * Consume an argument from the token stream, and return the resulting array - * of tokens and start/end token. - */ - consumeArg(delims) { - var tokens = []; - var isDelimited = delims && delims.length > 0; - if (!isDelimited) { - this.consumeSpaces(); - } - var start2 = this.future(); - var tok; - var depth = 0; - var match = 0; - do { - tok = this.popToken(); - tokens.push(tok); - if (tok.text === "{") { - ++depth; - } else if (tok.text === "}") { - --depth; - if (depth === -1) { - throw new ParseError("Extra }", tok); - } - } else if (tok.text === "EOF") { - throw new ParseError("Unexpected end of input in a macro argument, expected '" + (delims && isDelimited ? delims[match] : "}") + "'", tok); - } - if (delims && isDelimited) { - if ((depth === 0 || depth === 1 && delims[match] === "{") && tok.text === delims[match]) { - ++match; - if (match === delims.length) { - tokens.splice(-match, match); - break; - } - } else { - match = 0; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js + var freeExports3, freeModule3, moduleExports3, freeProcess, nodeUtil, nodeUtil_default; + var init_nodeUtil = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js"() { + "use strict"; + init_freeGlobal(); + freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports; + freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module; + moduleExports3 = freeModule3 && freeModule3.exports === freeExports3; + freeProcess = moduleExports3 && freeGlobal_default.process; + nodeUtil = function() { + try { + var types = freeModule3 && freeModule3.require && freeModule3.require("util").types; + if (types) { + return types; } + return freeProcess && freeProcess.binding && freeProcess.binding("util"); + } catch (e3) { } - } while (depth !== 0 || isDelimited); - if (start2.text === "{" && tokens[tokens.length - 1].text === "}") { - tokens.pop(); - tokens.shift(); - } - tokens.reverse(); - return { - tokens, - start: start2, - end: tok - }; - } - /** - * Consume the specified number of (delimited) arguments from the token - * stream and return the resulting array of arguments. - */ - consumeArgs(numArgs, delimiters2) { - if (delimiters2) { - if (delimiters2.length !== numArgs + 1) { - throw new ParseError("The length of delimiters doesn't match the number of args!"); - } - var delims = delimiters2[0]; - for (var i2 = 0; i2 < delims.length; i2++) { - var tok = this.popToken(); - if (delims[i2] !== tok.text) { - throw new ParseError("Use of the macro doesn't match its definition", tok); - } - } - } - var args = []; - for (var _i6 = 0; _i6 < numArgs; _i6++) { - args.push(this.consumeArg(delimiters2 && delimiters2[_i6 + 1]).tokens); - } - return args; - } - /** - * Expand the next token only once if possible. - * - * If the token is expanded, the resulting tokens will be pushed onto - * the stack in reverse order, and the number of such tokens will be - * returned. This number might be zero or positive. - * - * If not, the return value is `false`, and the next token remains at the - * top of the stack. - * - * In either case, the next token will be on the top of the stack, - * or the stack will be empty (in case of empty expansion - * and no other tokens). - * - * Used to implement `expandAfterFuture` and `expandNextToken`. - * - * If expandableOnly, only expandable tokens are expanded and - * an undefined control sequence results in an error. - */ - expandOnce(expandableOnly) { - var topToken = this.popToken(); - var name = topToken.text; - var expansion = !topToken.noexpand ? this._getExpansion(name) : null; - if (expansion == null || expandableOnly && expansion.unexpandable) { - if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) { - throw new ParseError("Undefined control sequence: " + name); - } - this.pushToken(topToken); - return false; - } - this.expansionCount++; - if (this.expansionCount > this.settings.maxExpand) { - throw new ParseError("Too many expansions: infinite loop or need to increase maxExpand setting"); - } - var tokens = expansion.tokens; - var args = this.consumeArgs(expansion.numArgs, expansion.delimiters); - if (expansion.numArgs) { - tokens = tokens.slice(); - for (var i2 = tokens.length - 1; i2 >= 0; --i2) { - var tok = tokens[i2]; - if (tok.text === "#") { - if (i2 === 0) { - throw new ParseError("Incomplete placeholder at end of macro body", tok); - } - tok = tokens[--i2]; - if (tok.text === "#") { - tokens.splice(i2 + 1, 1); - } else if (/^[1-9]$/.test(tok.text)) { - tokens.splice(i2, 2, ...args[+tok.text - 1]); - } else { - throw new ParseError("Not a valid argument number", tok); - } - } - } - } - this.pushTokens(tokens); - return tokens.length; - } - /** - * Expand the next token only once (if possible), and return the resulting - * top token on the stack (without removing anything from the stack). - * Similar in behavior to TeX's `\expandafter\futurelet`. - * Equivalent to expandOnce() followed by future(). - */ - expandAfterFuture() { - this.expandOnce(); - return this.future(); - } - /** - * Recursively expand first token, then return first non-expandable token. - */ - expandNextToken() { - for (; ; ) { - if (this.expandOnce() === false) { - var token2 = this.stack.pop(); - if (token2.treatAsRelax) { - token2.text = "\\relax"; - } - return token2; - } - } - throw new Error(); - } - /** - * Fully expand the given macro name and return the resulting list of - * tokens, or return `undefined` if no such macro is defined. - */ - expandMacro(name) { - return this.macros.has(name) ? this.expandTokens([new Token(name)]) : void 0; - } - /** - * Fully expand the given token stream and return the resulting list of - * tokens. Note that the input tokens are in reverse order, but the - * output tokens are in forward order. - */ - expandTokens(tokens) { - var output = []; - var oldStackLength = this.stack.length; - this.pushTokens(tokens); - while (this.stack.length > oldStackLength) { - if (this.expandOnce(true) === false) { - var token2 = this.stack.pop(); - if (token2.treatAsRelax) { - token2.noexpand = false; - token2.treatAsRelax = false; - } - output.push(token2); - } - } - return output; - } - /** - * Fully expand the given macro name and return the result as a string, - * or return `undefined` if no such macro is defined. - */ - expandMacroAsText(name) { - var tokens = this.expandMacro(name); - if (tokens) { - return tokens.map((token2) => token2.text).join(""); - } else { - return tokens; - } + }(); + nodeUtil_default = nodeUtil; } - /** - * Returns the expanded macro as a reversed array of tokens and a macro - * argument count. Or returns `null` if no such macro. - */ - _getExpansion(name) { - var definition2 = this.macros.get(name); - if (definition2 == null) { - return definition2; - } - if (name.length === 1) { - var catcode = this.lexer.catcodes[name]; - if (catcode != null && catcode !== 13) { - return; - } - } - var expansion = typeof definition2 === "function" ? definition2(this) : definition2; - if (typeof expansion === "string") { - var numArgs = 0; - if (expansion.indexOf("#") !== -1) { - var stripped = expansion.replace(/##/g, ""); - while (stripped.indexOf("#" + (numArgs + 1)) !== -1) { - ++numArgs; - } - } - var bodyLexer = new Lexer(expansion, this.settings); - var tokens = []; - var tok = bodyLexer.lex(); - while (tok.text !== "EOF") { - tokens.push(tok); - tok = bodyLexer.lex(); - } - tokens.reverse(); - var expanded = { - tokens, - numArgs - }; - return expanded; - } - return expansion; - } - /** - * Determine whether a command is currently "defined" (has some - * functionality), meaning that it's a macro (in the current group), - * a function, a symbol, or one of the special commands listed in - * `implicitCommands`. - */ - isDefined(name) { - return this.macros.has(name) || functions$1.hasOwnProperty(name) || symbols.math.hasOwnProperty(name) || symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name); - } - /** - * Determine whether a command is expandable. - */ - isExpandable(name) { - var macro = this.macros.get(name); - return macro != null ? typeof macro === "string" || typeof macro === "function" || !macro.unexpandable : functions$1.hasOwnProperty(name) && !functions$1[name].primitive; - } - } - var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/; - var uSubsAndSups = Object.freeze({ - "₊": "+", - "₋": "-", - "₌": "=", - "₍": "(", - "₎": ")", - "₀": "0", - "₁": "1", - "₂": "2", - "₃": "3", - "₄": "4", - "₅": "5", - "₆": "6", - "₇": "7", - "₈": "8", - "₉": "9", - "ₐ": "a", - "ₑ": "e", - "ₕ": "h", - "ᵢ": "i", - "ⱼ": "j", - "ₖ": "k", - "ₗ": "l", - "ₘ": "m", - "ₙ": "n", - "ₒ": "o", - "ₚ": "p", - "ᵣ": "r", - "ₛ": "s", - "ₜ": "t", - "ᵤ": "u", - "ᵥ": "v", - "ₓ": "x", - "ᵦ": "β", - "ᵧ": "γ", - "ᵨ": "ρ", - "ᵩ": "ϕ", - "ᵪ": "χ", - "⁺": "+", - "⁻": "-", - "⁼": "=", - "⁽": "(", - "⁾": ")", - "⁰": "0", - "¹": "1", - "²": "2", - "³": "3", - "⁴": "4", - "⁵": "5", - "⁶": "6", - "⁷": "7", - "⁸": "8", - "⁹": "9", - "ᴬ": "A", - "ᴮ": "B", - "ᴰ": "D", - "ᴱ": "E", - "ᴳ": "G", - "ᴴ": "H", - "ᴵ": "I", - "ᴶ": "J", - "ᴷ": "K", - "ᴸ": "L", - "ᴹ": "M", - "ᴺ": "N", - "ᴼ": "O", - "ᴾ": "P", - "ᴿ": "R", - "ᵀ": "T", - "ᵁ": "U", - "ⱽ": "V", - "ᵂ": "W", - "ᵃ": "a", - "ᵇ": "b", - "ᶜ": "c", - "ᵈ": "d", - "ᵉ": "e", - "ᶠ": "f", - "ᵍ": "g", - "ʰ": "h", - "ⁱ": "i", - "ʲ": "j", - "ᵏ": "k", - "ˡ": "l", - "ᵐ": "m", - "ⁿ": "n", - "ᵒ": "o", - "ᵖ": "p", - "ʳ": "r", - "ˢ": "s", - "ᵗ": "t", - "ᵘ": "u", - "ᵛ": "v", - "ʷ": "w", - "ˣ": "x", - "ʸ": "y", - "ᶻ": "z", - "ᵝ": "β", - "ᵞ": "γ", - "ᵟ": "δ", - "ᵠ": "ϕ", - "ᵡ": "χ", - "ᶿ": "θ" - }); - var unicodeAccents = { - "́": { - "text": "\\'", - "math": "\\acute" - }, - "̀": { - "text": "\\`", - "math": "\\grave" - }, - "̈": { - "text": '\\"', - "math": "\\ddot" - }, - "̃": { - "text": "\\~", - "math": "\\tilde" - }, - "̄": { - "text": "\\=", - "math": "\\bar" - }, - "̆": { - "text": "\\u", - "math": "\\breve" - }, - "̌": { - "text": "\\v", - "math": "\\check" - }, - "̂": { - "text": "\\^", - "math": "\\hat" - }, - "̇": { - "text": "\\.", - "math": "\\dot" - }, - "̊": { - "text": "\\r", - "math": "\\mathring" - }, - "̋": { - "text": "\\H" - }, - "̧": { - "text": "\\c" + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js + var nodeIsTypedArray, isTypedArray, isTypedArray_default; + var init_isTypedArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js"() { + "use strict"; + init_baseIsTypedArray(); + init_baseUnary(); + init_nodeUtil(); + nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray; + isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default; + isTypedArray_default = isTypedArray; } - }; - var unicodeSymbols = { - "á": "á", - "à": "à", - "ä": "ä", - "ǟ": "ǟ", - "ã": "ã", - "ā": "ā", - "ă": "ă", - "ắ": "ắ", - "ằ": "ằ", - "ẵ": "ẵ", - "ǎ": "ǎ", - "â": "â", - "ấ": "ấ", - "ầ": "ầ", - "ẫ": "ẫ", - "ȧ": "ȧ", - "ǡ": "ǡ", - "å": "å", - "ǻ": "ǻ", - "ḃ": "ḃ", - "ć": "ć", - "ḉ": "ḉ", - "č": "č", - "ĉ": "ĉ", - "ċ": "ċ", - "ç": "ç", - "ď": "ď", - "ḋ": "ḋ", - "ḑ": "ḑ", - "é": "é", - "è": "è", - "ë": "ë", - "ẽ": "ẽ", - "ē": "ē", - "ḗ": "ḗ", - "ḕ": "ḕ", - "ĕ": "ĕ", - "ḝ": "ḝ", - "ě": "ě", - "ê": "ê", - "ế": "ế", - "ề": "ề", - "ễ": "ễ", - "ė": "ė", - "ȩ": "ȩ", - "ḟ": "ḟ", - "ǵ": "ǵ", - "ḡ": "ḡ", - "ğ": "ğ", - "ǧ": "ǧ", - "ĝ": "ĝ", - "ġ": "ġ", - "ģ": "ģ", - "ḧ": "ḧ", - "ȟ": "ȟ", - "ĥ": "ĥ", - "ḣ": "ḣ", - "ḩ": "ḩ", - "í": "í", - "ì": "ì", - "ï": "ï", - "ḯ": "ḯ", - "ĩ": "ĩ", - "ī": "ī", - "ĭ": "ĭ", - "ǐ": "ǐ", - "î": "î", - "ǰ": "ǰ", - "ĵ": "ĵ", - "ḱ": "ḱ", - "ǩ": "ǩ", - "ķ": "ķ", - "ĺ": "ĺ", - "ľ": "ľ", - "ļ": "ļ", - "ḿ": "ḿ", - "ṁ": "ṁ", - "ń": "ń", - "ǹ": "ǹ", - "ñ": "ñ", - "ň": "ň", - "ṅ": "ṅ", - "ņ": "ņ", - "ó": "ó", - "ò": "ò", - "ö": "ö", - "ȫ": "ȫ", - "õ": "õ", - "ṍ": "ṍ", - "ṏ": "ṏ", - "ȭ": "ȭ", - "ō": "ō", - "ṓ": "ṓ", - "ṑ": "ṑ", - "ŏ": "ŏ", - "ǒ": "ǒ", - "ô": "ô", - "ố": "ố", - "ồ": "ồ", - "ỗ": "ỗ", - "ȯ": "ȯ", - "ȱ": "ȱ", - "ő": "ő", - "ṕ": "ṕ", - "ṗ": "ṗ", - "ŕ": "ŕ", - "ř": "ř", - "ṙ": "ṙ", - "ŗ": "ŗ", - "ś": "ś", - "ṥ": "ṥ", - "š": "š", - "ṧ": "ṧ", - "ŝ": "ŝ", - "ṡ": "ṡ", - "ş": "ş", - "ẗ": "ẗ", - "ť": "ť", - "ṫ": "ṫ", - "ţ": "ţ", - "ú": "ú", - "ù": "ù", - "ü": "ü", - "ǘ": "ǘ", - "ǜ": "ǜ", - "ǖ": "ǖ", - "ǚ": "ǚ", - "ũ": "ũ", - "ṹ": "ṹ", - "ū": "ū", - "ṻ": "ṻ", - "ŭ": "ŭ", - "ǔ": "ǔ", - "û": "û", - "ů": "ů", - "ű": "ű", - "ṽ": "ṽ", - "ẃ": "ẃ", - "ẁ": "ẁ", - "ẅ": "ẅ", - "ŵ": "ŵ", - "ẇ": "ẇ", - "ẘ": "ẘ", - "ẍ": "ẍ", - "ẋ": "ẋ", - "ý": "ý", - "ỳ": "ỳ", - "ÿ": "ÿ", - "ỹ": "ỹ", - "ȳ": "ȳ", - "ŷ": "ŷ", - "ẏ": "ẏ", - "ẙ": "ẙ", - "ź": "ź", - "ž": "ž", - "ẑ": "ẑ", - "ż": "ż", - "Á": "Á", - "À": "À", - "Ä": "Ä", - "Ǟ": "Ǟ", - "Ã": "Ã", - "Ā": "Ā", - "Ă": "Ă", - "Ắ": "Ắ", - "Ằ": "Ằ", - "Ẵ": "Ẵ", - "Ǎ": "Ǎ", - "Â": "Â", - "Ấ": "Ấ", - "Ầ": "Ầ", - "Ẫ": "Ẫ", - "Ȧ": "Ȧ", - "Ǡ": "Ǡ", - "Å": "Å", - "Ǻ": "Ǻ", - "Ḃ": "Ḃ", - "Ć": "Ć", - "Ḉ": "Ḉ", - "Č": "Č", - "Ĉ": "Ĉ", - "Ċ": "Ċ", - "Ç": "Ç", - "Ď": "Ď", - "Ḋ": "Ḋ", - "Ḑ": "Ḑ", - "É": "É", - "È": "È", - "Ë": "Ë", - "Ẽ": "Ẽ", - "Ē": "Ē", - "Ḗ": "Ḗ", - "Ḕ": "Ḕ", - "Ĕ": "Ĕ", - "Ḝ": "Ḝ", - "Ě": "Ě", - "Ê": "Ê", - "Ế": "Ế", - "Ề": "Ề", - "Ễ": "Ễ", - "Ė": "Ė", - "Ȩ": "Ȩ", - "Ḟ": "Ḟ", - "Ǵ": "Ǵ", - "Ḡ": "Ḡ", - "Ğ": "Ğ", - "Ǧ": "Ǧ", - "Ĝ": "Ĝ", - "Ġ": "Ġ", - "Ģ": "Ģ", - "Ḧ": "Ḧ", - "Ȟ": "Ȟ", - "Ĥ": "Ĥ", - "Ḣ": "Ḣ", - "Ḩ": "Ḩ", - "Í": "Í", - "Ì": "Ì", - "Ï": "Ï", - "Ḯ": "Ḯ", - "Ĩ": "Ĩ", - "Ī": "Ī", - "Ĭ": "Ĭ", - "Ǐ": "Ǐ", - "Î": "Î", - "İ": "İ", - "Ĵ": "Ĵ", - "Ḱ": "Ḱ", - "Ǩ": "Ǩ", - "Ķ": "Ķ", - "Ĺ": "Ĺ", - "Ľ": "Ľ", - "Ļ": "Ļ", - "Ḿ": "Ḿ", - "Ṁ": "Ṁ", - "Ń": "Ń", - "Ǹ": "Ǹ", - "Ñ": "Ñ", - "Ň": "Ň", - "Ṅ": "Ṅ", - "Ņ": "Ņ", - "Ó": "Ó", - "Ò": "Ò", - "Ö": "Ö", - "Ȫ": "Ȫ", - "Õ": "Õ", - "Ṍ": "Ṍ", - "Ṏ": "Ṏ", - "Ȭ": "Ȭ", - "Ō": "Ō", - "Ṓ": "Ṓ", - "Ṑ": "Ṑ", - "Ŏ": "Ŏ", - "Ǒ": "Ǒ", - "Ô": "Ô", - "Ố": "Ố", - "Ồ": "Ồ", - "Ỗ": "Ỗ", - "Ȯ": "Ȯ", - "Ȱ": "Ȱ", - "Ő": "Ő", - "Ṕ": "Ṕ", - "Ṗ": "Ṗ", - "Ŕ": "Ŕ", - "Ř": "Ř", - "Ṙ": "Ṙ", - "Ŗ": "Ŗ", - "Ś": "Ś", - "Ṥ": "Ṥ", - "Š": "Š", - "Ṧ": "Ṧ", - "Ŝ": "Ŝ", - "Ṡ": "Ṡ", - "Ş": "Ş", - "Ť": "Ť", - "Ṫ": "Ṫ", - "Ţ": "Ţ", - "Ú": "Ú", - "Ù": "Ù", - "Ü": "Ü", - "Ǘ": "Ǘ", - "Ǜ": "Ǜ", - "Ǖ": "Ǖ", - "Ǚ": "Ǚ", - "Ũ": "Ũ", - "Ṹ": "Ṹ", - "Ū": "Ū", - "Ṻ": "Ṻ", - "Ŭ": "Ŭ", - "Ǔ": "Ǔ", - "Û": "Û", - "Ů": "Ů", - "Ű": "Ű", - "Ṽ": "Ṽ", - "Ẃ": "Ẃ", - "Ẁ": "Ẁ", - "Ẅ": "Ẅ", - "Ŵ": "Ŵ", - "Ẇ": "Ẇ", - "Ẍ": "Ẍ", - "Ẋ": "Ẋ", - "Ý": "Ý", - "Ỳ": "Ỳ", - "Ÿ": "Ÿ", - "Ỹ": "Ỹ", - "Ȳ": "Ȳ", - "Ŷ": "Ŷ", - "Ẏ": "Ẏ", - "Ź": "Ź", - "Ž": "Ž", - "Ẑ": "Ẑ", - "Ż": "Ż", - "ά": "ά", - "ὰ": "ὰ", - "ᾱ": "ᾱ", - "ᾰ": "ᾰ", - "έ": "έ", - "ὲ": "ὲ", - "ή": "ή", - "ὴ": "ὴ", - "ί": "ί", - "ὶ": "ὶ", - "ϊ": "ϊ", - "ΐ": "ΐ", - "ῒ": "ῒ", - "ῑ": "ῑ", - "ῐ": "ῐ", - "ό": "ό", - "ὸ": "ὸ", - "ύ": "ύ", - "ὺ": "ὺ", - "ϋ": "ϋ", - "ΰ": "ΰ", - "ῢ": "ῢ", - "ῡ": "ῡ", - "ῠ": "ῠ", - "ώ": "ώ", - "ὼ": "ὼ", - "Ύ": "Ύ", - "Ὺ": "Ὺ", - "Ϋ": "Ϋ", - "Ῡ": "Ῡ", - "Ῠ": "Ῠ", - "Ώ": "Ώ", - "Ὼ": "Ὼ" - }; - class Parser { - constructor(input, settings) { - this.mode = void 0; - this.gullet = void 0; - this.settings = void 0; - this.leftrightDepth = void 0; - this.nextToken = void 0; - this.mode = "math"; - this.gullet = new MacroExpander(input, settings, this.mode); - this.settings = settings; - this.leftrightDepth = 0; - } - /** - * Checks a result to make sure it has the right type, and throws an - * appropriate error otherwise. - */ - expect(text2, consume) { - if (consume === void 0) { - consume = true; - } - if (this.fetch().text !== text2) { - throw new ParseError("Expected '" + text2 + "', got '" + this.fetch().text + "'", this.fetch()); - } - if (consume) { - this.consume(); - } - } - /** - * Discards the current lookahead token, considering it consumed. - */ - consume() { - this.nextToken = null; - } - /** - * Return the current lookahead token, or if there isn't one (at the - * beginning, or if the previous lookahead token was consume()d), - * fetch the next token as the new lookahead token and return it. - */ - fetch() { - if (this.nextToken == null) { - this.nextToken = this.gullet.expandNextToken(); - } - return this.nextToken; - } - /** - * Switches between "text" and "math" modes. - */ - switchMode(newMode) { - this.mode = newMode; - this.gullet.switchMode(newMode); - } - /** - * Main parsing function, which parses an entire input. - */ - parse() { - if (!this.settings.globalGroup) { - this.gullet.beginGroup(); - } - if (this.settings.colorIsTextColor) { - this.gullet.macros.set("\\color", "\\textcolor"); - } - try { - var parse2 = this.parseExpression(false); - this.expect("EOF"); - if (!this.settings.globalGroup) { - this.gullet.endGroup(); - } - return parse2; - } finally { - this.gullet.endGroups(); - } - } - /** - * Fully parse a separate sequence of tokens as a separate job. - * Tokens should be specified in reverse order, as in a MacroDefinition. - */ - subparse(tokens) { - var oldToken = this.nextToken; - this.consume(); - this.gullet.pushToken(new Token("}")); - this.gullet.pushTokens(tokens); - var parse2 = this.parseExpression(false); - this.expect("}"); - this.nextToken = oldToken; - return parse2; - } - /** - * Parses an "expression", which is a list of atoms. - * - * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This - * happens when functions have higher precedence han infix - * nodes in implicit parses. - * - * `breakOnTokenText`: The text of the token that the expression should end - * with, or `null` if something else should end the - * expression. - */ - parseExpression(breakOnInfix, breakOnTokenText) { - var body = []; - while (true) { - if (this.mode === "math") { - this.consumeSpaces(); - } - var lex2 = this.fetch(); - if (Parser.endOfExpression.indexOf(lex2.text) !== -1) { - break; - } - if (breakOnTokenText && lex2.text === breakOnTokenText) { - break; - } - if (breakOnInfix && functions$1[lex2.text] && functions$1[lex2.text].infix) { - break; - } - var atom = this.parseAtom(breakOnTokenText); - if (!atom) { - break; - } else if (atom.type === "internal") { - continue; - } - body.push(atom); - } - if (this.mode === "text") { - this.formLigatures(body); - } - return this.handleInfixNodes(body); - } - /** - * Rewrites infix operators such as \over with corresponding commands such - * as \frac. - * - * There can only be one infix operator per group. If there's more than one - * then the expression is ambiguous. This can be resolved by adding {}. - */ - handleInfixNodes(body) { - var overIndex = -1; - var funcName; - for (var i2 = 0; i2 < body.length; i2++) { - if (body[i2].type === "infix") { - if (overIndex !== -1) { - throw new ParseError("only one infix operator per group", body[i2].token); - } - overIndex = i2; - funcName = body[i2].replaceWith; - } - } - if (overIndex !== -1 && funcName) { - var numerNode; - var denomNode; - var numerBody = body.slice(0, overIndex); - var denomBody = body.slice(overIndex + 1); - if (numerBody.length === 1 && numerBody[0].type === "ordgroup") { - numerNode = numerBody[0]; - } else { - numerNode = { - type: "ordgroup", - mode: this.mode, - body: numerBody - }; - } - if (denomBody.length === 1 && denomBody[0].type === "ordgroup") { - denomNode = denomBody[0]; - } else { - denomNode = { - type: "ordgroup", - mode: this.mode, - body: denomBody - }; - } - var node2; - if (funcName === "\\\\abovefrac") { - node2 = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []); - } else { - node2 = this.callFunction(funcName, [numerNode, denomNode], []); - } - return [node2]; - } else { - return body; - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js + function safeGet(object3, key) { + if (key === "constructor" && typeof object3[key] === "function") { + return; } - /** - * Handle a subscript or superscript with nice errors. - */ - handleSupSubscript(name) { - var symbolToken = this.fetch(); - var symbol = symbolToken.text; - this.consume(); - this.consumeSpaces(); - var group = this.parseGroup(name); - if (!group) { - throw new ParseError("Expected group after '" + symbol + "'", symbolToken); - } - return group; - } - /** - * Converts the textual input of an unsupported command into a text node - * contained within a color node whose color is determined by errorColor - */ - formatUnsupportedCmd(text2) { - var textordArray = []; - for (var i2 = 0; i2 < text2.length; i2++) { - textordArray.push({ - type: "textord", - mode: "text", - text: text2[i2] - }); - } - var textNode = { - type: "text", - mode: this.mode, - body: textordArray - }; - var colorNode = { - type: "color", - mode: this.mode, - color: this.settings.errorColor, - body: [textNode] - }; - return colorNode; - } - /** - * Parses a group with optional super/subscripts. - */ - parseAtom(breakOnTokenText) { - var base = this.parseGroup("atom", breakOnTokenText); - if (this.mode === "text") { - return base; - } - var superscript; - var subscript; - while (true) { - this.consumeSpaces(); - var lex2 = this.fetch(); - if (lex2.text === "\\limits" || lex2.text === "\\nolimits") { - if (base && base.type === "op") { - var limits = lex2.text === "\\limits"; - base.limits = limits; - base.alwaysHandleSupSub = true; - } else if (base && base.type === "operatorname") { - if (base.alwaysHandleSupSub) { - base.limits = lex2.text === "\\limits"; - } - } else { - throw new ParseError("Limit controls must follow a math operator", lex2); - } - this.consume(); - } else if (lex2.text === "^") { - if (superscript) { - throw new ParseError("Double superscript", lex2); - } - superscript = this.handleSupSubscript("superscript"); - } else if (lex2.text === "_") { - if (subscript) { - throw new ParseError("Double subscript", lex2); - } - subscript = this.handleSupSubscript("subscript"); - } else if (lex2.text === "'") { - if (superscript) { - throw new ParseError("Double superscript", lex2); - } - var prime = { - type: "textord", - mode: this.mode, - text: "\\prime" - }; - var primes = [prime]; - this.consume(); - while (this.fetch().text === "'") { - primes.push(prime); - this.consume(); - } - if (this.fetch().text === "^") { - primes.push(this.handleSupSubscript("superscript")); - } - superscript = { - type: "ordgroup", - mode: this.mode, - body: primes - }; - } else if (uSubsAndSups[lex2.text]) { - var str2 = uSubsAndSups[lex2.text]; - var isSub = unicodeSubRegEx.test(lex2.text); - this.consume(); - while (true) { - var token2 = this.fetch().text; - if (!uSubsAndSups[token2]) { - break; - } - if (unicodeSubRegEx.test(token2) !== isSub) { - break; - } - this.consume(); - str2 += uSubsAndSups[token2]; - } - var body = new Parser(str2, this.settings).parse(); - if (isSub) { - subscript = { - type: "ordgroup", - mode: "math", - body - }; - } else { - superscript = { - type: "ordgroup", - mode: "math", - body - }; - } - } else { - break; - } - } - if (superscript || subscript) { - return { - type: "supsub", - mode: this.mode, - base, - sup: superscript, - sub: subscript - }; - } else { - return base; - } + if (key == "__proto__") { + return; } - /** - * Parses an entire function, including its base and all of its arguments. - */ - parseFunction(breakOnTokenText, name) { - var token2 = this.fetch(); - var func = token2.text; - var funcData = functions$1[func]; - if (!funcData) { - return null; + return object3[key]; + } + var safeGet_default; + var init_safeGet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js"() { + "use strict"; + __name(safeGet, "safeGet"); + safeGet_default = safeGet; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js + function assignValue(object3, key, value2) { + var objValue = object3[key]; + if (!(hasOwnProperty7.call(object3, key) && eq_default(objValue, value2)) || value2 === void 0 && !(key in object3)) { + baseAssignValue_default(object3, key, value2); + } + } + var objectProto9, hasOwnProperty7, assignValue_default; + var init_assignValue = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js"() { + "use strict"; + init_baseAssignValue(); + init_eq(); + objectProto9 = Object.prototype; + hasOwnProperty7 = objectProto9.hasOwnProperty; + __name(assignValue, "assignValue"); + assignValue_default = assignValue; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js + function copyObject(source, props, object3, customizer) { + var isNew = !object3; + object3 || (object3 = {}); + var index = -1, length2 = props.length; + while (++index < length2) { + var key = props[index]; + var newValue = customizer ? customizer(object3[key], source[key], key, object3, source) : void 0; + if (newValue === void 0) { + newValue = source[key]; } - this.consume(); - if (name && name !== "atom" && !funcData.allowedInArgument) { - throw new ParseError("Got function '" + func + "' with no arguments" + (name ? " as " + name : ""), token2); - } else if (this.mode === "text" && !funcData.allowedInText) { - throw new ParseError("Can't use function '" + func + "' in text mode", token2); - } else if (this.mode === "math" && funcData.allowedInMath === false) { - throw new ParseError("Can't use function '" + func + "' in math mode", token2); - } - var { - args, - optArgs - } = this.parseArguments(func, funcData); - return this.callFunction(func, args, optArgs, token2, breakOnTokenText); - } - /** - * Call a function handler with a suitable context and arguments. - */ - callFunction(name, args, optArgs, token2, breakOnTokenText) { - var context = { - funcName: name, - parser: this, - token: token2, - breakOnTokenText - }; - var func = functions$1[name]; - if (func && func.handler) { - return func.handler(context, args, optArgs); + if (isNew) { + baseAssignValue_default(object3, key, newValue); } else { - throw new ParseError("No function handler for " + name); + assignValue_default(object3, key, newValue); } } - /** - * Parses the arguments of a function or environment - */ - parseArguments(func, funcData) { - var totalArgs = funcData.numArgs + funcData.numOptionalArgs; - if (totalArgs === 0) { - return { - args: [], - optArgs: [] - }; - } - var args = []; - var optArgs = []; - for (var i2 = 0; i2 < totalArgs; i2++) { - var argType = funcData.argTypes && funcData.argTypes[i2]; - var isOptional = i2 < funcData.numOptionalArgs; - if (funcData.primitive && argType == null || // \sqrt expands into primitive if optional argument doesn't exist - funcData.type === "sqrt" && i2 === 1 && optArgs[0] == null) { - argType = "primitive"; - } - var arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional); - if (isOptional) { - optArgs.push(arg); - } else if (arg != null) { - args.push(arg); - } else { - throw new ParseError("Null argument, please report this as a bug"); - } - } - return { - args, - optArgs - }; - } - /** - * Parses a group when the mode is changing. - */ - parseGroupOfType(name, type2, optional) { - switch (type2) { - case "color": - return this.parseColorGroup(optional); - case "size": - return this.parseSizeGroup(optional); - case "url": - return this.parseUrlGroup(optional); - case "math": - case "text": - return this.parseArgumentGroup(optional, type2); - case "hbox": { - var group = this.parseArgumentGroup(optional, "text"); - return group != null ? { - type: "styling", - mode: group.mode, - body: [group], - style: "text" - // simulate \textstyle - } : null; - } - case "raw": { - var token2 = this.parseStringGroup("raw", optional); - return token2 != null ? { - type: "raw", - mode: "text", - string: token2.text - } : null; - } - case "primitive": { - if (optional) { - throw new ParseError("A primitive argument cannot be optional"); - } - var _group = this.parseGroup(name); - if (_group == null) { - throw new ParseError("Expected group as " + name, this.fetch()); - } - return _group; - } - case "original": - case null: - case void 0: - return this.parseArgumentGroup(optional); - default: - throw new ParseError("Unknown group type as " + name, this.fetch()); - } + return object3; + } + var copyObject_default; + var init_copyObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js"() { + "use strict"; + init_assignValue(); + init_baseAssignValue(); + __name(copyObject, "copyObject"); + copyObject_default = copyObject; } - /** - * Discard any space tokens, fetching the next non-space token. - */ - consumeSpaces() { - while (this.fetch().text === " ") { - this.consume(); - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js + function baseTimes(n2, iteratee) { + var index = -1, result = Array(n2); + while (++index < n2) { + result[index] = iteratee(index); } - /** - * Parses a group, essentially returning the string formed by the - * brace-enclosed tokens plus some position information. - */ - parseStringGroup(modeName, optional) { - var argToken = this.gullet.scanArgument(optional); - if (argToken == null) { - return null; - } - var str2 = ""; - var nextToken; - while ((nextToken = this.fetch()).text !== "EOF") { - str2 += nextToken.text; - this.consume(); - } - this.consume(); - argToken.text = str2; - return argToken; - } - /** - * Parses a regex-delimited group: the largest sequence of tokens - * whose concatenated strings match `regex`. Returns the string - * formed by the tokens plus some position information. - */ - parseRegexGroup(regex, modeName) { - var firstToken = this.fetch(); - var lastToken = firstToken; - var str2 = ""; - var nextToken; - while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str2 + nextToken.text)) { - lastToken = nextToken; - str2 += lastToken.text; - this.consume(); - } - if (str2 === "") { - throw new ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken); - } - return firstToken.range(lastToken, str2); - } - /** - * Parses a color description. - */ - parseColorGroup(optional) { - var res = this.parseStringGroup("color", optional); - if (res == null) { - return null; - } - var match = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(res.text); - if (!match) { - throw new ParseError("Invalid color: '" + res.text + "'", res); - } - var color2 = match[0]; - if (/^[0-9a-f]{6}$/i.test(color2)) { - color2 = "#" + color2; - } - return { - type: "color-token", - mode: this.mode, - color: color2 - }; - } - /** - * Parses a size specification, consisting of magnitude and unit. - */ - parseSizeGroup(optional) { - var res; - var isBlank = false; - this.gullet.consumeSpaces(); - if (!optional && this.gullet.future().text !== "{") { - res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size"); - } else { - res = this.parseStringGroup("size", optional); - } - if (!res) { - return null; - } - if (!optional && res.text.length === 0) { - res.text = "0pt"; - isBlank = true; - } - var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text); - if (!match) { - throw new ParseError("Invalid size: '" + res.text + "'", res); - } - var data = { - number: +(match[1] + match[2]), - // sign + magnitude, cast to number - unit: match[3] - }; - if (!validUnit(data)) { - throw new ParseError("Invalid unit: '" + data.unit + "'", res); - } - return { - type: "size", - mode: this.mode, - value: data, - isBlank - }; - } - /** - * Parses an URL, checking escaped letters and allowed protocols, - * and setting the catcode of % as an active character (as in \hyperref). - */ - parseUrlGroup(optional) { - this.gullet.lexer.setCatcode("%", 13); - this.gullet.lexer.setCatcode("~", 12); - var res = this.parseStringGroup("url", optional); - this.gullet.lexer.setCatcode("%", 14); - this.gullet.lexer.setCatcode("~", 13); - if (res == null) { - return null; - } - var url = res.text.replace(/\\([#$%&~_^{}])/g, "$1"); - return { - type: "url", - mode: this.mode, - url - }; + return result; + } + var baseTimes_default; + var init_baseTimes = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js"() { + "use strict"; + __name(baseTimes, "baseTimes"); + baseTimes_default = baseTimes; } - /** - * Parses an argument with the mode specified. - */ - parseArgumentGroup(optional, mode) { - var argToken = this.gullet.scanArgument(optional); - if (argToken == null) { - return null; - } - var outerMode = this.mode; - if (mode) { - this.switchMode(mode); - } - this.gullet.beginGroup(); - var expression = this.parseExpression(false, "EOF"); - this.expect("EOF"); - this.gullet.endGroup(); - var result = { - type: "ordgroup", - mode: this.mode, - loc: argToken.loc, - body: expression - }; - if (mode) { - this.switchMode(outerMode); - } - return result; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js + function isIndex(value2, length2) { + var type3 = typeof value2; + length2 = length2 == null ? MAX_SAFE_INTEGER2 : length2; + return !!length2 && (type3 == "number" || type3 != "symbol" && reIsUint.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2); + } + var MAX_SAFE_INTEGER2, reIsUint, isIndex_default; + var init_isIndex = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js"() { + "use strict"; + MAX_SAFE_INTEGER2 = 9007199254740991; + reIsUint = /^(?:0|[1-9]\d*)$/; + __name(isIndex, "isIndex"); + isIndex_default = isIndex; } - /** - * Parses an ordinary group, which is either a single nucleus (like "x") - * or an expression in braces (like "{x+y}") or an implicit group, a group - * that starts at the current position, and ends right before a higher explicit - * group ends, or at EOF. - */ - parseGroup(name, breakOnTokenText) { - var firstToken = this.fetch(); - var text2 = firstToken.text; - var result; - if (text2 === "{" || text2 === "\\begingroup") { - this.consume(); - var groupEnd = text2 === "{" ? "}" : "\\endgroup"; - this.gullet.beginGroup(); - var expression = this.parseExpression(false, groupEnd); - var lastToken = this.fetch(); - this.expect(groupEnd); - this.gullet.endGroup(); - result = { - type: "ordgroup", - mode: this.mode, - loc: SourceLocation.range(firstToken, lastToken), - body: expression, - // A group formed by \begingroup...\endgroup is a semi-simple group - // which doesn't affect spacing in math mode, i.e., is transparent. - // https://tex.stackexchange.com/questions/1930/when-should-one- - // use-begingroup-instead-of-bgroup - semisimple: text2 === "\\begingroup" || void 0 - }; - } else { - result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol(); - if (result == null && text2[0] === "\\" && !implicitCommands.hasOwnProperty(text2)) { - if (this.settings.throwOnError) { - throw new ParseError("Undefined control sequence: " + text2, firstToken); - } - result = this.formatUnsupportedCmd(text2); - this.consume(); - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js + function arrayLikeKeys(value2, inherited) { + var isArr = isArray_default(value2), isArg = !isArr && isArguments_default(value2), isBuff = !isArr && !isArg && isBuffer_default(value2), isType2 = !isArr && !isArg && !isBuff && isTypedArray_default(value2), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes_default(value2.length, String) : [], length2 = result.length; + for (var key in value2) { + if ((inherited || hasOwnProperty8.call(value2, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. + (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. + isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. + isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. + isIndex_default(key, length2)))) { + result.push(key); } - return result; } - /** - * Form ligature-like combinations of characters for text mode. - * This includes inputs like "--", "---", "``" and "''". - * The result will simply replace multiple textord nodes with a single - * character in each value by a single textord node having multiple - * characters in its value. The representation is still ASCII source. - * The group will be modified in place. - */ - formLigatures(group) { - var n = group.length - 1; - for (var i2 = 0; i2 < n; ++i2) { - var a = group[i2]; - var v = a.text; - if (v === "-" && group[i2 + 1].text === "-") { - if (i2 + 1 < n && group[i2 + 2].text === "-") { - group.splice(i2, 3, { - type: "textord", - mode: "text", - loc: SourceLocation.range(a, group[i2 + 2]), - text: "---" - }); - n -= 2; - } else { - group.splice(i2, 2, { - type: "textord", - mode: "text", - loc: SourceLocation.range(a, group[i2 + 1]), - text: "--" - }); - n -= 1; - } - } - if ((v === "'" || v === "`") && group[i2 + 1].text === v) { - group.splice(i2, 2, { - type: "textord", - mode: "text", - loc: SourceLocation.range(a, group[i2 + 1]), - text: v + v - }); - n -= 1; - } + return result; + } + var objectProto10, hasOwnProperty8, arrayLikeKeys_default; + var init_arrayLikeKeys = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js"() { + "use strict"; + init_baseTimes(); + init_isArguments(); + init_isArray(); + init_isBuffer(); + init_isIndex(); + init_isTypedArray(); + objectProto10 = Object.prototype; + hasOwnProperty8 = objectProto10.hasOwnProperty; + __name(arrayLikeKeys, "arrayLikeKeys"); + arrayLikeKeys_default = arrayLikeKeys; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js + function nativeKeysIn(object3) { + var result = []; + if (object3 != null) { + for (var key in Object(object3)) { + result.push(key); } } - /** - * Parse a single symbol out of the string. Here, we handle single character - * symbols and special functions like \verb. - */ - parseSymbol() { - var nucleus = this.fetch(); - var text2 = nucleus.text; - if (/^\\verb[^a-zA-Z]/.test(text2)) { - this.consume(); - var arg = text2.slice(5); - var star = arg.charAt(0) === "*"; - if (star) { - arg = arg.slice(1); - } - if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) { - throw new ParseError("\\verb assertion failed --\n please report what input caused this bug"); - } - arg = arg.slice(1, -1); - return { - type: "verb", - mode: "text", - body: arg, - star - }; + return result; + } + var nativeKeysIn_default; + var init_nativeKeysIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js"() { + "use strict"; + __name(nativeKeysIn, "nativeKeysIn"); + nativeKeysIn_default = nativeKeysIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js + function baseKeysIn(object3) { + if (!isObject_default(object3)) { + return nativeKeysIn_default(object3); + } + var isProto = isPrototype_default(object3), result = []; + for (var key in object3) { + if (!(key == "constructor" && (isProto || !hasOwnProperty9.call(object3, key)))) { + result.push(key); } - if (unicodeSymbols.hasOwnProperty(text2[0]) && !symbols[this.mode][text2[0]]) { - if (this.settings.strict && this.mode === "math") { - this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + text2[0] + '" used in math mode', nucleus); - } - text2 = unicodeSymbols[text2[0]] + text2.slice(1); - } - var match = combiningDiacriticalMarksEndRegex.exec(text2); - if (match) { - text2 = text2.substring(0, match.index); - if (text2 === "i") { - text2 = "ı"; - } else if (text2 === "j") { - text2 = "ȷ"; - } - } - var symbol; - if (symbols[this.mode][text2]) { - if (this.settings.strict && this.mode === "math" && extraLatin.indexOf(text2) >= 0) { - this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + text2[0] + '" used in math mode', nucleus); - } - var group = symbols[this.mode][text2].group; - var loc = SourceLocation.range(nucleus); - var s; - if (ATOMS.hasOwnProperty(group)) { - var family = group; - s = { - type: "atom", - mode: this.mode, - family, - loc, - text: text2 - }; + } + return result; + } + var objectProto11, hasOwnProperty9, baseKeysIn_default; + var init_baseKeysIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js"() { + "use strict"; + init_isObject(); + init_isPrototype(); + init_nativeKeysIn(); + objectProto11 = Object.prototype; + hasOwnProperty9 = objectProto11.hasOwnProperty; + __name(baseKeysIn, "baseKeysIn"); + baseKeysIn_default = baseKeysIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js + function keysIn(object3) { + return isArrayLike_default(object3) ? arrayLikeKeys_default(object3, true) : baseKeysIn_default(object3); + } + var keysIn_default; + var init_keysIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js"() { + "use strict"; + init_arrayLikeKeys(); + init_baseKeysIn(); + init_isArrayLike(); + __name(keysIn, "keysIn"); + keysIn_default = keysIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js + function toPlainObject(value2) { + return copyObject_default(value2, keysIn_default(value2)); + } + var toPlainObject_default; + var init_toPlainObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js"() { + "use strict"; + init_copyObject(); + init_keysIn(); + __name(toPlainObject, "toPlainObject"); + toPlainObject_default = toPlainObject; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js + function baseMergeDeep(object3, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet_default(object3, key), srcValue = safeGet_default(source, key), stacked = stack.get(srcValue); + if (stacked) { + assignMergeValue_default(object3, key, stacked); + return; + } + var newValue = customizer ? customizer(objValue, srcValue, key + "", object3, source, stack) : void 0; + var isCommon2 = newValue === void 0; + if (isCommon2) { + var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue); + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray_default(objValue)) { + newValue = objValue; + } else if (isArrayLikeObject_default(objValue)) { + newValue = copyArray_default(objValue); + } else if (isBuff) { + isCommon2 = false; + newValue = cloneBuffer_default(srcValue, true); + } else if (isTyped) { + isCommon2 = false; + newValue = cloneTypedArray_default(srcValue, true); } else { - s = { - type: group, - mode: this.mode, - loc, - text: text2 - }; + newValue = []; } - symbol = s; - } else if (text2.charCodeAt(0) >= 128) { - if (this.settings.strict) { - if (!supportedCodepoint(text2.charCodeAt(0))) { - this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + text2[0] + '"' + (" (" + text2.charCodeAt(0) + ")"), nucleus); - } else if (this.mode === "math") { - this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + text2[0] + '" used in math mode', nucleus); - } + } else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) { + newValue = objValue; + if (isArguments_default(objValue)) { + newValue = toPlainObject_default(objValue); + } else if (!isObject_default(objValue) || isFunction_default(objValue)) { + newValue = initCloneObject_default(srcValue); } - symbol = { - type: "textord", - mode: "text", - loc: SourceLocation.range(nucleus), - text: text2 - }; } else { - return null; + isCommon2 = false; } - this.consume(); - if (match) { - for (var i2 = 0; i2 < match[0].length; i2++) { - var accent2 = match[0][i2]; - if (!unicodeAccents[accent2]) { - throw new ParseError("Unknown accent ' " + accent2 + "'", nucleus); - } - var command = unicodeAccents[accent2][this.mode] || unicodeAccents[accent2].text; - if (!command) { - throw new ParseError("Accent " + accent2 + " unsupported in " + this.mode + " mode", nucleus); - } - symbol = { - type: "accent", - mode: this.mode, - loc: SourceLocation.range(nucleus), - label: command, - isStretchy: false, - isShifty: true, - // $FlowFixMe - base: symbol - }; + } + if (isCommon2) { + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack["delete"](srcValue); + } + assignMergeValue_default(object3, key, newValue); + } + var baseMergeDeep_default; + var init_baseMergeDeep = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js"() { + "use strict"; + init_assignMergeValue(); + init_cloneBuffer(); + init_cloneTypedArray(); + init_copyArray(); + init_initCloneObject(); + init_isArguments(); + init_isArray(); + init_isArrayLikeObject(); + init_isBuffer(); + init_isFunction(); + init_isObject(); + init_isPlainObject(); + init_isTypedArray(); + init_safeGet(); + init_toPlainObject(); + __name(baseMergeDeep, "baseMergeDeep"); + baseMergeDeep_default = baseMergeDeep; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js + function baseMerge(object3, source, srcIndex, customizer, stack) { + if (object3 === source) { + return; + } + baseFor_default(source, function(srcValue, key) { + stack || (stack = new Stack_default()); + if (isObject_default(srcValue)) { + baseMergeDeep_default(object3, source, key, srcIndex, baseMerge, customizer, stack); + } else { + var newValue = customizer ? customizer(safeGet_default(object3, key), srcValue, key + "", object3, source, stack) : void 0; + if (newValue === void 0) { + newValue = srcValue; } + assignMergeValue_default(object3, key, newValue); } - return symbol; + }, keysIn_default); + } + var baseMerge_default; + var init_baseMerge = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js"() { + "use strict"; + init_Stack(); + init_assignMergeValue(); + init_baseFor(); + init_baseMergeDeep(); + init_isObject(); + init_keysIn(); + init_safeGet(); + __name(baseMerge, "baseMerge"); + baseMerge_default = baseMerge; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js + function identity4(value2) { + return value2; + } + var identity_default4; + var init_identity4 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js"() { + "use strict"; + __name(identity4, "identity"); + identity_default4 = identity4; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js + function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args[0]); + case 2: + return func.call(thisArg, args[0], args[1]); + case 3: + return func.call(thisArg, args[0], args[1], args[2]); } + return func.apply(thisArg, args); } - Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"]; - var parseTree = function parseTree2(toParse, settings) { - if (!(typeof toParse === "string" || toParse instanceof String)) { - throw new TypeError("KaTeX can only parse string typed expression"); + var apply_default; + var init_apply = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js"() { + "use strict"; + __name(apply, "apply"); + apply_default = apply; } - var parser2 = new Parser(toParse, settings); - delete parser2.gullet.macros.current["\\df@tag"]; - var tree = parser2.parse(); - delete parser2.gullet.macros.current["\\current@color"]; - delete parser2.gullet.macros.current["\\color"]; - if (parser2.gullet.macros.get("\\df@tag")) { - if (!settings.displayMode) { - throw new ParseError("\\tag works only in display equations"); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js + function overRest(func, start3, transform8) { + start3 = nativeMax(start3 === void 0 ? func.length - 1 : start3, 0); + return function() { + var args = arguments, index = -1, length2 = nativeMax(args.length - start3, 0), array4 = Array(length2); + while (++index < length2) { + array4[index] = args[start3 + index]; } - tree = [{ - type: "tag", - mode: "text", - body: tree, - tag: parser2.subparse([new Token("\\df@tag")]) - }]; + index = -1; + var otherArgs = Array(start3 + 1); + while (++index < start3) { + otherArgs[index] = args[index]; + } + otherArgs[start3] = transform8(array4); + return apply_default(func, this, otherArgs); + }; + } + var nativeMax, overRest_default; + var init_overRest = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js"() { + "use strict"; + init_apply(); + nativeMax = Math.max; + __name(overRest, "overRest"); + overRest_default = overRest; } - return tree; - }; - var render$2 = function render2(expression, baseNode, options2) { - baseNode.textContent = ""; - var node2 = renderToDomTree(expression, options2).toNode(); - baseNode.appendChild(node2); - }; - if (typeof document !== "undefined") { - if (document.compatMode !== "CSS1Compat") { - typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."); - render$2 = function render2() { - throw new ParseError("KaTeX doesn't work in quirks mode."); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js + function constant(value2) { + return function() { + return value2; + }; + } + var constant_default6; + var init_constant7 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js"() { + "use strict"; + __name(constant, "constant"); + constant_default6 = constant; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js + var baseSetToString, baseSetToString_default; + var init_baseSetToString = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js"() { + "use strict"; + init_constant7(); + init_defineProperty(); + init_identity4(); + baseSetToString = !defineProperty_default ? identity_default4 : function(func, string3) { + return defineProperty_default(func, "toString", { + "configurable": true, + "enumerable": false, + "value": constant_default6(string3), + "writable": true + }); }; + baseSetToString_default = baseSetToString; } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js + function shortOut(func) { + var count = 0, lastCalled = 0; + return function() { + var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(void 0, arguments); + }; } - var renderToString = function renderToString2(expression, options2) { - var markup = renderToDomTree(expression, options2).toMarkup(); - return markup; - }; - var generateParseTree = function generateParseTree2(expression, options2) { - var settings = new Settings(options2); - return parseTree(expression, settings); - }; - var renderError = function renderError2(error, expression, options2) { - if (options2.throwOnError || !(error instanceof ParseError)) { - throw error; + var HOT_COUNT, HOT_SPAN, nativeNow, shortOut_default; + var init_shortOut = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js"() { + "use strict"; + HOT_COUNT = 800; + HOT_SPAN = 16; + nativeNow = Date.now; + __name(shortOut, "shortOut"); + shortOut_default = shortOut; } - var node2 = buildCommon.makeSpan(["katex-error"], [new SymbolNode(expression)]); - node2.setAttribute("title", error.toString()); - node2.setAttribute("style", "color:" + options2.errorColor); - return node2; - }; - var renderToDomTree = function renderToDomTree2(expression, options2) { - var settings = new Settings(options2); - try { - var tree = parseTree(expression, settings); - return buildTree(tree, expression, settings); - } catch (error) { - return renderError(error, expression, settings); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js + var setToString, setToString_default; + var init_setToString = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js"() { + "use strict"; + init_baseSetToString(); + init_shortOut(); + setToString = shortOut_default(baseSetToString_default); + setToString_default = setToString; } - }; - var renderToHTMLTree = function renderToHTMLTree2(expression, options2) { - var settings = new Settings(options2); - try { - var tree = parseTree(expression, settings); - return buildHTMLTree(tree, expression, settings); - } catch (error) { - return renderError(error, expression, settings); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRest.js + function baseRest(func, start3) { + return setToString_default(overRest_default(func, start3, identity_default4), func + ""); + } + var baseRest_default; + var init_baseRest = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRest.js"() { + "use strict"; + init_identity4(); + init_overRest(); + init_setToString(); + __name(baseRest, "baseRest"); + baseRest_default = baseRest; } - }; - var katex = { - /** - * Current KaTeX version - */ - version: "0.16.9", - /** - * Renders the given LaTeX into an HTML+MathML combination, and adds - * it as a child to the specified DOM node. - */ - render: render$2, - /** - * Renders the given LaTeX into an HTML+MathML combination string, - * for sending to the client. - */ - renderToString, - /** - * KaTeX error, usually during parsing. - */ - ParseError, - /** - * The shema of Settings - */ - SETTINGS_SCHEMA, - /** - * Parses the given LaTeX into KaTeX's internal parse tree structure, - * without rendering to HTML or MathML. - * - * NOTE: This method is not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __parse: generateParseTree, - /** - * Renders the given LaTeX into an HTML+MathML internal DOM tree - * representation, without flattening that representation to a string. - * - * NOTE: This method is not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __renderToDomTree: renderToDomTree, - /** - * Renders the given LaTeX into an HTML internal DOM tree representation, - * without MathML and without flattening that representation to a string. - * - * NOTE: This method is not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __renderToHTMLTree: renderToHTMLTree, - /** - * extends internal font metrics object with a new object - * each key in the new object represents a font name - */ - __setFontMetrics: setFontMetrics, - /** - * adds a new symbol to builtin symbols table - */ - __defineSymbol: defineSymbol, - /** - * adds a new function to builtin function list, - * which directly produce parse tree elements - * and have their own html/mathml builders - */ - __defineFunction: defineFunction, - /** - * adds a new macro to builtin macro list - */ - __defineMacro: defineMacro, - /** - * Expose the dom tree node types, which can be useful for type checking nodes. - * - * NOTE: This method is not currently recommended for public use. - * The internal tree representation is unstable and is very likely - * to change. Use at your own risk. - */ - __domTree: { - Span, - Anchor, - SymbolNode, - SvgNode, - PathNode, - LineNode + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js + function isIterateeCall(value2, index, object3) { + if (!isObject_default(object3)) { + return false; } - }; - const katex$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - default: katex - }, Symbol.toStringTag, { value: "Module" })); - var parser$v = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" }, - productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 3: - yy.setDirection("TB"); - break; - case 4: - yy.setDirection("BT"); - break; - case 5: - yy.setDirection("RL"); - break; - case 6: - yy.setDirection("LR"); - break; - case 8: - case 9: - case 10: - case 11: - case 12: - yy.setC4Type($$[$0 - 3]); - break; - case 19: - yy.setTitle($$[$0].substring(6)); - this.$ = $$[$0].substring(6); - break; - case 20: - yy.setAccDescription($$[$0].substring(15)); - this.$ = $$[$0].substring(15); - break; - case 21: - this.$ = $$[$0].trim(); - yy.setTitle(this.$); - break; - case 22: - case 23: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 28: - case 29: - $$[$0].splice(2, 0, "ENTERPRISE"); - yy.addPersonOrSystemBoundary(...$$[$0]); - this.$ = $$[$0]; - break; - case 30: - yy.addPersonOrSystemBoundary(...$$[$0]); - this.$ = $$[$0]; - break; - case 31: - $$[$0].splice(2, 0, "CONTAINER"); - yy.addContainerBoundary(...$$[$0]); - this.$ = $$[$0]; - break; - case 32: - yy.addDeploymentNode("node", ...$$[$0]); - this.$ = $$[$0]; - break; - case 33: - yy.addDeploymentNode("nodeL", ...$$[$0]); - this.$ = $$[$0]; - break; - case 34: - yy.addDeploymentNode("nodeR", ...$$[$0]); - this.$ = $$[$0]; - break; - case 35: - yy.popBoundaryParseStack(); - break; - case 39: - yy.addPersonOrSystem("person", ...$$[$0]); - this.$ = $$[$0]; - break; - case 40: - yy.addPersonOrSystem("external_person", ...$$[$0]); - this.$ = $$[$0]; - break; - case 41: - yy.addPersonOrSystem("system", ...$$[$0]); - this.$ = $$[$0]; - break; - case 42: - yy.addPersonOrSystem("system_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 43: - yy.addPersonOrSystem("system_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 44: - yy.addPersonOrSystem("external_system", ...$$[$0]); - this.$ = $$[$0]; - break; - case 45: - yy.addPersonOrSystem("external_system_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 46: - yy.addPersonOrSystem("external_system_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 47: - yy.addContainer("container", ...$$[$0]); - this.$ = $$[$0]; - break; - case 48: - yy.addContainer("container_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 49: - yy.addContainer("container_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 50: - yy.addContainer("external_container", ...$$[$0]); - this.$ = $$[$0]; - break; - case 51: - yy.addContainer("external_container_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 52: - yy.addContainer("external_container_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 53: - yy.addComponent("component", ...$$[$0]); - this.$ = $$[$0]; - break; - case 54: - yy.addComponent("component_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 55: - yy.addComponent("component_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 56: - yy.addComponent("external_component", ...$$[$0]); - this.$ = $$[$0]; - break; - case 57: - yy.addComponent("external_component_db", ...$$[$0]); - this.$ = $$[$0]; - break; - case 58: - yy.addComponent("external_component_queue", ...$$[$0]); - this.$ = $$[$0]; - break; - case 60: - yy.addRel("rel", ...$$[$0]); - this.$ = $$[$0]; - break; - case 61: - yy.addRel("birel", ...$$[$0]); - this.$ = $$[$0]; - break; - case 62: - yy.addRel("rel_u", ...$$[$0]); - this.$ = $$[$0]; - break; - case 63: - yy.addRel("rel_d", ...$$[$0]); - this.$ = $$[$0]; - break; - case 64: - yy.addRel("rel_l", ...$$[$0]); - this.$ = $$[$0]; - break; - case 65: - yy.addRel("rel_r", ...$$[$0]); - this.$ = $$[$0]; - break; - case 66: - yy.addRel("rel_b", ...$$[$0]); - this.$ = $$[$0]; - break; - case 67: - $$[$0].splice(0, 1); - yy.addRel("rel", ...$$[$0]); - this.$ = $$[$0]; - break; - case 68: - yy.updateElStyle("update_el_style", ...$$[$0]); - this.$ = $$[$0]; - break; - case 69: - yy.updateRelStyle("update_rel_style", ...$$[$0]); - this.$ = $$[$0]; - break; - case 70: - yy.updateLayoutConfig("update_layout_config", ...$$[$0]); - this.$ = $$[$0]; - break; - case 71: - this.$ = [$$[$0]]; - break; - case 72: - $$[$0].unshift($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 73: - case 75: - this.$ = $$[$0].trim(); - break; - case 74: - let kv = {}; - kv[$$[$0 - 1].trim()] = $$[$0].trim(); - this.$ = kv; - break; - case 76: - this.$ = ""; - break; + var type3 = typeof index; + if (type3 == "number" ? isArrayLike_default(object3) && isIndex_default(index, object3.length) : type3 == "string" && index in object3) { + return eq_default(object3[index], value2); + } + return false; + } + var isIterateeCall_default; + var init_isIterateeCall = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js"() { + "use strict"; + init_eq(); + init_isArrayLike(); + init_isIndex(); + init_isObject(); + __name(isIterateeCall, "isIterateeCall"); + isIterateeCall_default = isIterateeCall; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAssigner.js + function createAssigner(assigner) { + return baseRest_default(function(object3, sources) { + var index = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0; + customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0; + if (guard && isIterateeCall_default(sources[0], sources[1], guard)) { + customizer = length2 < 3 ? void 0 : customizer; + length2 = 1; + } + object3 = Object(object3); + while (++index < length2) { + var source = sources[index]; + if (source) { + assigner(object3, source, index, customizer); } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VH, [2, 14]), o($VI, [2, 16], { 12: [1, 76] }), o($VH, [2, 36], { 12: [1, 77] }), o($VJ, [2, 19]), o($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o($VH, [2, 15]), o($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VJ, [2, 21]), o($VJ, [2, 22]), o($VO, [2, 39]), o($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o($VQ, [2, 73]), { 78: [1, 133] }, o($VQ, [2, 75]), o($VQ, [2, 76]), o($VO, [2, 40]), o($VO, [2, 41]), o($VO, [2, 42]), o($VO, [2, 43]), o($VO, [2, 44]), o($VO, [2, 45]), o($VO, [2, 46]), o($VO, [2, 47]), o($VO, [2, 48]), o($VO, [2, 49]), o($VO, [2, 50]), o($VO, [2, 51]), o($VO, [2, 52]), o($VO, [2, 53]), o($VO, [2, 54]), o($VO, [2, 55]), o($VO, [2, 56]), o($VO, [2, 57]), o($VO, [2, 58]), o($VO, [2, 60]), o($VO, [2, 61]), o($VO, [2, 62]), o($VO, [2, 63]), o($VO, [2, 64]), o($VO, [2, 65]), o($VO, [2, 66]), o($VO, [2, 67]), o($VO, [2, 68]), o($VO, [2, 69]), o($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o($VR, [2, 28]), o($VR, [2, 29]), o($VR, [2, 30]), o($VR, [2, 31]), o($VR, [2, 32]), o($VR, [2, 33]), o($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o($VI, [2, 18]), o($VH, [2, 38]), o($VP, [2, 72]), o($VQ, [2, 74]), o($VO, [2, 24]), o($VO, [2, 35]), o($VS, [2, 25]), o($VS, [2, 26], { 12: [1, 138] }), o($VS, [2, 27])], - defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); + } + return object3; + }); + } + var createAssigner_default; + var init_createAssigner = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAssigner.js"() { + "use strict"; + init_baseRest(); + init_isIterateeCall(); + __name(createAssigner, "createAssigner"); + createAssigner_default = createAssigner; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js + var merge, merge_default3; + var init_merge3 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js"() { + "use strict"; + init_baseMerge(); + init_createAssigner(); + merge = createAssigner_default(function(object3, source, srcIndex) { + baseMerge_default(object3, source, srcIndex); + }); + merge_default3 = merge; + } + }); + + // src/utils.ts + function interpolateToCurve(interpolate, defaultCurve) { + if (!interpolate) { + return defaultCurve; + } + const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`; + return d3CurveTypes[curveName] ?? defaultCurve; + } + function formatUrl(linkStr, config6) { + const url = linkStr.trim(); + if (!url) { + return void 0; + } + if (config6.securityLevel !== "loose") { + return (0, import_sanitize_url3.sanitizeUrl)(url); + } + return url; + } + function distance(p1, p22) { + if (!p1 || !p22) { + return 0; + } + return Math.sqrt(Math.pow(p22.x - p1.x, 2) + Math.pow(p22.y - p1.y, 2)); + } + function traverseEdge(points) { + let prevPoint; + let totalDistance = 0; + points.forEach((point8) => { + totalDistance += distance(point8, prevPoint); + prevPoint = point8; + }); + const remainingDistance = totalDistance / 2; + return calculatePoint(points, remainingDistance); + } + function calcLabelPosition(points) { + if (points.length === 1) { + return points[0]; + } + return traverseEdge(points); + } + function calcTerminalLabelPosition(terminalMarkerSize, position5, _points) { + const points = structuredClone(_points); + log.info("our points", points); + if (position5 !== "start_left" && position5 !== "start_right") { + points.reverse(); + } + const distanceToCardinalityPoint = 25 + terminalMarkerSize; + const center4 = calculatePoint(points, distanceToCardinalityPoint); + const d2 = 10 + terminalMarkerSize * 0.5; + const angle2 = Math.atan2(points[0].y - center4.y, points[0].x - center4.x); + const cardinalityPosition = { x: 0, y: 0 }; + if (position5 === "start_left") { + cardinalityPosition.x = Math.sin(angle2 + Math.PI) * d2 + (points[0].x + center4.x) / 2; + cardinalityPosition.y = -Math.cos(angle2 + Math.PI) * d2 + (points[0].y + center4.y) / 2; + } else if (position5 === "end_right") { + cardinalityPosition.x = Math.sin(angle2 - Math.PI) * d2 + (points[0].x + center4.x) / 2 - 5; + cardinalityPosition.y = -Math.cos(angle2 - Math.PI) * d2 + (points[0].y + center4.y) / 2 - 5; + } else if (position5 === "end_left") { + cardinalityPosition.x = Math.sin(angle2) * d2 + (points[0].x + center4.x) / 2 - 5; + cardinalityPosition.y = -Math.cos(angle2) * d2 + (points[0].y + center4.y) / 2 - 5; + } else { + cardinalityPosition.x = Math.sin(angle2) * d2 + (points[0].x + center4.x) / 2; + cardinalityPosition.y = -Math.cos(angle2) * d2 + (points[0].y + center4.y) / 2; + } + return cardinalityPosition; + } + function getStylesFromArray(arr) { + let style3 = ""; + let labelStyle = ""; + for (const element3 of arr) { + if (element3 !== void 0) { + if (element3.startsWith("color:") || element3.startsWith("text-align:")) { + labelStyle = labelStyle + element3 + ";"; } else { - var error = new Error(str2); - error.hash = hash; - throw error; + style3 = style3 + element3 + ";"; } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; + } + } + return { style: style3, labelStyle }; + } + function makeRandomHex(length2) { + let result = ""; + const characters2 = "0123456789abcdef"; + const charactersLength = characters2.length; + for (let i2 = 0; i2 < length2; i2++) { + result += characters2.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; + } + function calculateTextHeight(text2, config6) { + return calculateTextDimensions(text2, config6).height; + } + function calculateTextWidth(text2, config6) { + return calculateTextDimensions(text2, config6).width; + } + function isDetailedError(error3) { + return "str" in error3; + } + function cleanAndMerge(defaultData, data5) { + return merge_default3({}, defaultData, data5); + } + var import_sanitize_url3, ZERO_WIDTH_SPACE, d3CurveTypes, directiveWithoutOpen, detectInit, detectDirective, removeDirectives, isSubstringInArray, runFunc, roundNumber, calculatePoint, calcCardinalityPosition, cnt, generateId, random, getTextObj2, drawSimpleText, wrapLabel, breakString, calculateTextDimensions, InitIDGenerator, decoder, entityDecode, insertTitle, parseFontSize, utils_default2, encodeEntities, decodeEntities, getEdgeId; + var init_utils2 = __esm({ + "src/utils.ts"() { + "use strict"; + import_sanitize_url3 = __toESM(require_dist(), 1); + init_src32(); + init_common(); + init_sanitizeDirective(); + init_logger(); + init_detectType(); + init_assignWithDepth(); + init_memoize(); + init_merge3(); + init_regexes(); + ZERO_WIDTH_SPACE = "\u200B"; + d3CurveTypes = { + curveBasis: basis_default2, + curveBasisClosed: basisClosed_default2, + curveBasisOpen: basisOpen_default, + curveBumpX: bumpX, + curveBumpY: bumpY, + curveBundle: bundle_default, + curveCardinalClosed: cardinalClosed_default, + curveCardinalOpen: cardinalOpen_default, + curveCardinal: cardinal_default, + curveCatmullRomClosed: catmullRomClosed_default, + curveCatmullRomOpen: catmullRomOpen_default, + curveCatmullRom: catmullRom_default, + curveLinear: linear_default, + curveLinearClosed: linearClosed_default, + curveMonotoneX: monotoneX, + curveMonotoneY: monotoneY, + curveNatural: natural_default, + curveStep: step_default, + curveStepAfter: stepAfter, + curveStepBefore: stepBefore + }; + directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi; + detectInit = /* @__PURE__ */ __name(function(text2, config6) { + const inits = detectDirective(text2, /(?:init\b)|(?:initialize\b)/); + let results = {}; + if (Array.isArray(inits)) { + const args = inits.map((init3) => init3.args); + sanitizeDirective(args); + results = assignWithDepth_default(results, [...args]); } else { - this.parseError = Object.getPrototypeOf(this).parseError; + results = inits.args; } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; + if (!results) { + return; + } + let type3 = detectType(text2, config6); + const prop = "config"; + if (results[prop] !== void 0) { + if (type3 === "flowchart-v2") { + type3 = "flowchart"; } - return token2; + results[type3] = results[prop]; + delete results[prop]; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + return results; + }, "detectInit"); + detectDirective = /* @__PURE__ */ __name(function(text2, type3 = null) { + try { + const commentWithoutDirectives = new RegExp( + `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).* +`, + "ig" + ); + text2 = text2.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"'); + log.debug( + `Detecting diagram directive${type3 !== null ? " type:" + type3 : ""} based on the text:${text2}` + ); + let match2; + const result = []; + while ((match2 = directiveRegex.exec(text2)) !== null) { + if (match2.index === directiveRegex.lastIndex) { + directiveRegex.lastIndex++; } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } + if (match2 && !type3 || type3 && match2[1]?.match(type3) || type3 && match2[2]?.match(type3)) { + const type4 = match2[1] ? match2[1] : match2[2]; + const args = match2[3] ? match2[3].trim() : match2[4] ? JSON.parse(match2[4].trim()) : null; + result.push({ type: type4, args }); } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + if (result.length === 0) { + return { type: text2, args: null }; } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; + return result.length === 1 ? result[0] : result; + } catch (error3) { + log.error( + `ERROR: ${error3.message} - Unable to parse directive type: '${type3}' based on the text: '${text2}'` + ); + return { type: void 0, args: null }; + } + }, "detectDirective"); + removeDirectives = /* @__PURE__ */ __name(function(text2) { + return text2.replace(directiveRegex, ""); + }, "removeDirectives"); + isSubstringInArray = /* @__PURE__ */ __name(function(str2, arr) { + for (const [i2, element3] of arr.entries()) { + if (element3.match(str2)) { + return i2; + } + } + return -1; + }, "isSubstringInArray"); + __name(interpolateToCurve, "interpolateToCurve"); + __name(formatUrl, "formatUrl"); + runFunc = /* @__PURE__ */ __name((functionName, ...params) => { + const arrPaths = functionName.split("."); + const len = arrPaths.length - 1; + const fnName = arrPaths[len]; + let obj = window; + for (let i2 = 0; i2 < len; i2++) { + obj = obj[arrPaths[i2]]; + if (!obj) { + log.error(`Function name: ${functionName} not found in window`); + return; + } + } + obj[fnName](...params); + }, "runFunc"); + __name(distance, "distance"); + __name(traverseEdge, "traverseEdge"); + __name(calcLabelPosition, "calcLabelPosition"); + roundNumber = /* @__PURE__ */ __name((num, precision = 2) => { + const factor = Math.pow(10, precision); + return Math.round(num * factor) / factor; + }, "roundNumber"); + calculatePoint = /* @__PURE__ */ __name((points, distanceToTraverse) => { + let prevPoint = void 0; + let remainingDistance = distanceToTraverse; + for (const point8 of points) { + if (prevPoint) { + const vectorDistance = distance(point8, prevPoint); + if (vectorDistance < remainingDistance) { + remainingDistance -= vectorDistance; + } else { + const distanceRatio = remainingDistance / vectorDistance; + if (distanceRatio <= 0) { + return prevPoint; } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; + if (distanceRatio >= 1) { + return { x: point8.x, y: point8.y }; } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + if (distanceRatio > 0 && distanceRatio < 1) { + return { + x: roundNumber((1 - distanceRatio) * prevPoint.x + distanceRatio * point8.x, 5), + y: roundNumber((1 - distanceRatio) * prevPoint.y + distanceRatio * point8.y, 5) + }; + } + } } + prevPoint = point8; + } + throw new Error("Could not find a suitable point for the given distance"); + }, "calculatePoint"); + calcCardinalityPosition = /* @__PURE__ */ __name((isRelationTypePresent, points, initialPosition) => { + log.info(`our points ${JSON.stringify(points)}`); + if (points[0] !== initialPosition) { + points = points.reverse(); + } + const distanceToCardinalityPoint = 25; + const center4 = calculatePoint(points, distanceToCardinalityPoint); + const d2 = isRelationTypePresent ? 10 : 5; + const angle2 = Math.atan2(points[0].y - center4.y, points[0].x - center4.x); + const cardinalityPosition = { x: 0, y: 0 }; + cardinalityPosition.x = Math.sin(angle2) * d2 + (points[0].x + center4.x) / 2; + cardinalityPosition.y = -Math.cos(angle2) * d2 + (points[0].y + center4.y) / 2; + return cardinalityPosition; + }, "calcCardinalityPosition"); + __name(calcTerminalLabelPosition, "calcTerminalLabelPosition"); + __name(getStylesFromArray, "getStylesFromArray"); + cnt = 0; + generateId = /* @__PURE__ */ __name(() => { + cnt++; + return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt; + }, "generateId"); + __name(makeRandomHex, "makeRandomHex"); + random = /* @__PURE__ */ __name((options3) => { + return makeRandomHex(options3.length); + }, "random"); + getTextObj2 = /* @__PURE__ */ __name(function() { + return { + x: 0, + y: 0, + fill: void 0, + anchor: "start", + style: "#666", + width: 100, + height: 100, + textMargin: 0, + rx: 0, + ry: 0, + valign: void 0, + text: "" + }; + }, "getTextObj"); + drawSimpleText = /* @__PURE__ */ __name(function(elem, textData) { + const nText = textData.text.replace(common_default.lineBreakRegex, " "); + const [, _fontSizePx] = parseFontSize(textData.fontSize); + const textElem = elem.append("text"); + textElem.attr("x", textData.x); + textElem.attr("y", textData.y); + textElem.style("text-anchor", textData.anchor); + textElem.style("font-family", textData.fontFamily); + textElem.style("font-size", _fontSizePx); + textElem.style("font-weight", textData.fontWeight); + textElem.attr("fill", textData.fill); + if (textData.class !== void 0) { + textElem.attr("class", textData.class); } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); + const span = textElem.append("tspan"); + span.attr("x", textData.x + textData.textMargin * 2); + span.attr("fill", textData.fill); + span.text(nText); + return textElem; + }, "drawSimpleText"); + wrapLabel = memoize_default( + (label, maxWidth, config6) => { + if (!label) { + return label; + } + config6 = Object.assign( + { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "
" }, + config6 + ); + if (common_default.lineBreakRegex.test(label)) { + return label; + } + const words = label.split(" ").filter(Boolean); + const completedLines = []; + let nextLine = ""; + words.forEach((word, index) => { + const wordLength = calculateTextWidth(`${word} `, config6); + const nextLineLength = calculateTextWidth(nextLine, config6); + if (wordLength > maxWidth) { + const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config6); + completedLines.push(nextLine, ...hyphenatedStrings); + nextLine = remainingWord; + } else if (nextLineLength + wordLength >= maxWidth) { + completedLines.push(nextLine); + nextLine = word; + } else { + nextLine = [nextLine, word].filter(Boolean).join(" "); + } + const currentWord = index + 1; + const isLastWord = currentWord === words.length; + if (isLastWord) { + completedLines.push(nextLine); + } + }); + return completedLines.filter((line2) => line2 !== "").join(config6.joinWith); + }, + (label, maxWidth, config6) => `${label}${maxWidth}${config6.fontSize}${config6.fontWeight}${config6.fontFamily}${config6.joinWith}` + ); + breakString = memoize_default( + (word, maxWidth, hyphenCharacter = "-", config6) => { + config6 = Object.assign( + { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 }, + config6 + ); + const characters2 = [...word]; + const lines = []; + let currentLine = ""; + characters2.forEach((character2, index) => { + const nextLine = `${currentLine}${character2}`; + const lineWidth = calculateTextWidth(nextLine, config6); + if (lineWidth >= maxWidth) { + const currentCharacter = index + 1; + const isLastLine = characters2.length === currentCharacter; + const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`; + lines.push(isLastLine ? nextLine : hyphenatedNextLine); + currentLine = ""; + } else { + currentLine = nextLine; + } + }); + return { hyphenatedStrings: lines, remainingWord: currentLine }; + }, + (word, maxWidth, hyphenCharacter = "-", config6) => `${word}${maxWidth}${hyphenCharacter}${config6.fontSize}${config6.fontWeight}${config6.fontFamily}` + ); + __name(calculateTextHeight, "calculateTextHeight"); + __name(calculateTextWidth, "calculateTextWidth"); + calculateTextDimensions = memoize_default( + (text2, config6) => { + const { fontSize = 12, fontFamily = "Arial", fontWeight = 400 } = config6; + if (!text2) { + return { width: 0, height: 0 }; + } + const [, _fontSizePx] = parseFontSize(fontSize); + const fontFamilies = ["sans-serif", fontFamily]; + const lines = text2.split(common_default.lineBreakRegex); + const dims = []; + const body = select_default2("body"); + if (!body.remove) { + return { width: 0, height: 0, lineHeight: 0 }; + } + const g2 = body.append("svg"); + for (const fontFamily2 of fontFamilies) { + let cHeight = 0; + const dim = { width: 0, height: 0, lineHeight: 0 }; + for (const line2 of lines) { + const textObj = getTextObj2(); + textObj.text = line2 || ZERO_WIDTH_SPACE; + const textElem = drawSimpleText(g2, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2); + const bBox = (textElem._groups || textElem)[0][0].getBBox(); + if (bBox.width === 0 && bBox.height === 0) { + throw new Error("svg element not in render tree"); + } + dim.width = Math.round(Math.max(dim.width, bBox.width)); + cHeight = Math.round(bBox.height); + dim.height += cHeight; + dim.lineHeight = Math.round(Math.max(dim.lineHeight, cHeight)); + } + dims.push(dim); + } + g2.remove(); + const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1; + return dims[index]; + }, + (text2, config6) => `${text2}${config6.fontSize}${config6.fontWeight}${config6.fontFamily}` + ); + InitIDGenerator = class { + constructor(deterministic = false, seed) { + this.count = 0; + this.count = seed ? seed.length : 0; + this.next = deterministic ? () => this.count++ : () => Date.now(); + } + static { + __name(this, "InitIDGenerator"); + } + }; + entityDecode = /* @__PURE__ */ __name(function(html2) { + decoder = decoder || document.createElement("div"); + html2 = escape(html2).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";"); + decoder.innerHTML = html2; + return unescape(decoder.textContent); + }, "entityDecode"); + __name(isDetailedError, "isDetailedError"); + insertTitle = /* @__PURE__ */ __name((parent4, cssClass, titleTopMargin, title2) => { + if (!title2) { + return; + } + const bounds4 = parent4.node()?.getBBox(); + if (!bounds4) { + return; + } + parent4.append("text").text(title2).attr("x", bounds4.x + bounds4.width / 2).attr("y", -titleTopMargin).attr("class", cssClass); + }, "insertTitle"); + parseFontSize = /* @__PURE__ */ __name((fontSize) => { + if (typeof fontSize === "number") { + return [fontSize, fontSize + "px"]; + } + const fontSizeNumber = parseInt(fontSize ?? "", 10); + if (Number.isNaN(fontSizeNumber)) { + return [void 0, void 0]; + } else if (fontSize === String(fontSizeNumber)) { + return [fontSizeNumber, fontSize + "px"]; + } else { + return [fontSizeNumber, fontSize]; + } + }, "parseFontSize"); + __name(cleanAndMerge, "cleanAndMerge"); + utils_default2 = { + assignWithDepth: assignWithDepth_default, + wrapLabel, + calculateTextHeight, + calculateTextWidth, + calculateTextDimensions, + cleanAndMerge, + detectInit, + detectDirective, + isSubstringInArray, + interpolateToCurve, + calcLabelPosition, + calcCardinalityPosition, + calcTerminalLabelPosition, + formatUrl, + getStylesFromArray, + generateId, + random, + runFunc, + entityDecode, + insertTitle, + parseFontSize, + InitIDGenerator + }; + encodeEntities = /* @__PURE__ */ __name(function(text2) { + let txt = text2; + txt = txt.replace(/style.*:\S*#.*;/g, function(s2) { + return s2.substring(0, s2.length - 1); + }); + txt = txt.replace(/classDef.*:\S*#.*;/g, function(s2) { + return s2.substring(0, s2.length - 1); + }); + txt = txt.replace(/#\w+;/g, function(s2) { + const innerTxt = s2.substring(1, s2.length - 1); + const isInt = /^\+?\d+$/.test(innerTxt); + if (isInt) { + return "\uFB02\xB0\xB0" + innerTxt + "\xB6\xDF"; } else { - throw new Error(str2); + return "\uFB02\xB0" + innerTxt + "\xB6\xDF"; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 + }); + return txt; + }, "encodeEntities"); + decodeEntities = /* @__PURE__ */ __name(function(text2) { + return text2.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";"); + }, "decodeEntities"); + getEdgeId = /* @__PURE__ */ __name((from2, to, { + counter = 0, + prefix, + suffix + }) => { + return `${prefix ? `${prefix}_` : ""}${from2}_${to}_${counter}${suffix ? `_${suffix}` : ""}`; + }, "getEdgeId"); + } + }); + + // src/diagrams/c4/c4Renderer.js + function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) { + if (!c4Shape[textType].width) { + if (c4ShapeTextWrap) { + c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf); + c4Shape[textType].textLines = c4Shape[textType].text.split(common_default.lineBreakRegex).length; + c4Shape[textType].width = textLimitWidth; + c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf); + } else { + let lines = c4Shape[textType].text.split(common_default.lineBreakRegex); + c4Shape[textType].textLines = lines.length; + let lineHeight = 0; + c4Shape[textType].height = 0; + c4Shape[textType].width = 0; + for (const line2 of lines) { + c4Shape[textType].width = Math.max( + calculateTextWidth(line2, textConf), + c4Shape[textType].width + ); + lineHeight = calculateTextHeight(line2, textConf); + c4Shape[textType].height = c4Shape[textType].height + lineHeight; + } + } + } + } + function drawInsideBoundary(diagram23, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) { + let currentBounds = new Bounds(diagObj); + currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow2, currentBoundaries.length); + for (let [i2, currentBoundary] of currentBoundaries.entries()) { + let Y3 = 0; + currentBoundary.image = { width: 0, height: 0, Y: 0 }; + if (currentBoundary.sprite) { + currentBoundary.image.width = 48; + currentBoundary.image.height = 48; + currentBoundary.image.Y = Y3; + Y3 = currentBoundary.image.Y + currentBoundary.image.height; + } + let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap; + let currentBoundaryLabelConf = boundaryFont(conf); + currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2; + currentBoundaryLabelConf.fontWeight = "bold"; + calcC4ShapeTextWH( + "label", + currentBoundary, + currentBoundaryTextWrap, + currentBoundaryLabelConf, + currentBounds.data.widthLimit + ); + currentBoundary.label.Y = Y3 + 8; + Y3 = currentBoundary.label.Y + currentBoundary.label.height; + if (currentBoundary.type && currentBoundary.type.text !== "") { + currentBoundary.type.text = "[" + currentBoundary.type.text + "]"; + let currentBoundaryTypeConf = boundaryFont(conf); + calcC4ShapeTextWH( + "type", + currentBoundary, + currentBoundaryTextWrap, + currentBoundaryTypeConf, + currentBounds.data.widthLimit + ); + currentBoundary.type.Y = Y3 + 5; + Y3 = currentBoundary.type.Y + currentBoundary.type.height; + } + if (currentBoundary.descr && currentBoundary.descr.text !== "") { + let currentBoundaryDescrConf = boundaryFont(conf); + currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2; + calcC4ShapeTextWH( + "descr", + currentBoundary, + currentBoundaryTextWrap, + currentBoundaryDescrConf, + currentBounds.data.widthLimit + ); + currentBoundary.descr.Y = Y3 + 20; + Y3 = currentBoundary.descr.Y + currentBoundary.descr.height; + } + if (i2 == 0 || i2 % c4BoundaryInRow2 === 0) { + let _x = parentBounds.data.startx + conf.diagramMarginX; + let _y = parentBounds.data.stopy + conf.diagramMarginY + Y3; + currentBounds.setData(_x, _x, _y, _y); + } else { + let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx; + let _y = currentBounds.data.starty; + currentBounds.setData(_x, _x, _y, _y); + } + currentBounds.name = currentBoundary.alias; + let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias); + let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias); + if (currentPersonOrSystemKeys.length > 0) { + drawC4ShapeArray( + currentBounds, + diagram23, + currentPersonOrSystemArray, + currentPersonOrSystemKeys + ); + } + parentBoundaryAlias = currentBoundary.alias; + let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias); + if (nextCurrentBoundaries.length > 0) { + drawInsideBoundary( + diagram23, + parentBoundaryAlias, + currentBounds, + nextCurrentBoundaries, + diagObj + ); + } + if (currentBoundary.alias !== "global") { + drawBoundary2(diagram23, currentBoundary, currentBounds); + } + parentBounds.data.stopy = Math.max( + currentBounds.data.stopy + conf.c4ShapeMargin, + parentBounds.data.stopy + ); + parentBounds.data.stopx = Math.max( + currentBounds.data.stopx + conf.c4ShapeMargin, + parentBounds.data.stopx + ); + globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx); + globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy); + } + } + var globalBoundaryMaxX, globalBoundaryMaxY, c4ShapeInRow2, c4BoundaryInRow2, conf, Bounds, setConf, c4ShapeFont, boundaryFont, messageFont, drawBoundary2, drawC4ShapeArray, Point2, getIntersectPoint, getIntersectPoints, drawRels2, draw, c4Renderer_default; + var init_c4Renderer = __esm({ + "src/diagrams/c4/c4Renderer.js"() { + "use strict"; + init_src32(); + init_svgDraw(); + init_logger(); + init_c4Diagram(); + init_common(); + init_c4Db(); + init_diagramAPI(); + init_assignWithDepth(); + init_utils2(); + init_setupGraphViewbox(); + globalBoundaryMaxX = 0; + globalBoundaryMaxY = 0; + c4ShapeInRow2 = 4; + c4BoundaryInRow2 = 2; + parser.yy = c4Db_default; + conf = {}; + Bounds = class { + static { + __name(this, "Bounds"); + } + constructor(diagObj) { + this.name = ""; + this.data = {}; + this.data.startx = void 0; + this.data.stopx = void 0; + this.data.starty = void 0; + this.data.stopy = void 0; + this.data.widthLimit = void 0; + this.nextData = {}; + this.nextData.startx = void 0; + this.nextData.stopx = void 0; + this.nextData.starty = void 0; + this.nextData.stopy = void 0; + this.nextData.cnt = 0; + setConf(diagObj.db.getConfig()); + } + setData(startx, stopx, starty, stopy) { + this.nextData.startx = this.data.startx = startx; + this.nextData.stopx = this.data.stopx = stopx; + this.nextData.starty = this.data.starty = starty; + this.nextData.stopy = this.data.stopy = stopy; + } + updateVal(obj, key, val, fun) { + if (obj[key] === void 0) { + obj[key] = val; + } else { + obj[key] = fun(val, obj[key]); + } + } + insert(c4Shape) { + this.nextData.cnt = this.nextData.cnt + 1; + let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2; + let _stopx = _startx + c4Shape.width; + let _starty = this.nextData.starty + c4Shape.margin * 2; + let _stopy = _starty + c4Shape.height; + if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow2) { + _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX; + _starty = this.nextData.stopy + c4Shape.margin * 2; + this.nextData.stopx = _stopx = _startx + c4Shape.width; + this.nextData.starty = this.nextData.stopy; + this.nextData.stopy = _stopy = _starty + c4Shape.height; + this.nextData.cnt = 1; + } + c4Shape.x = _startx; + c4Shape.y = _starty; + this.updateVal(this.data, "startx", _startx, Math.min); + this.updateVal(this.data, "starty", _starty, Math.min); + this.updateVal(this.data, "stopx", _stopx, Math.max); + this.updateVal(this.data, "stopy", _stopy, Math.max); + this.updateVal(this.nextData, "startx", _startx, Math.min); + this.updateVal(this.nextData, "starty", _starty, Math.min); + this.updateVal(this.nextData, "stopx", _stopx, Math.max); + this.updateVal(this.nextData, "stopy", _stopy, Math.max); + } + init(diagObj) { + this.name = ""; + this.data = { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0, + widthLimit: void 0 }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + this.nextData = { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0, + cnt: 0 + }; + setConf(diagObj.db.getConfig()); + } + bumpLastMargin(margin) { + this.data.stopx += margin; + this.data.stopy += margin; + } + }; + setConf = /* @__PURE__ */ __name(function(cnf) { + assignWithDepth_default(conf, cnf); + if (cnf.fontFamily) { + conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily; + } + if (cnf.fontSize) { + conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize; + } + if (cnf.fontWeight) { + conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight; + } + }, "setConf"); + c4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => { + return { + fontFamily: cnf[typeC4Shape + "FontFamily"], + fontSize: cnf[typeC4Shape + "FontSize"], + fontWeight: cnf[typeC4Shape + "FontWeight"] + }; + }, "c4ShapeFont"); + boundaryFont = /* @__PURE__ */ __name((cnf) => { + return { + fontFamily: cnf.boundaryFontFamily, + fontSize: cnf.boundaryFontSize, + fontWeight: cnf.boundaryFontWeight + }; + }, "boundaryFont"); + messageFont = /* @__PURE__ */ __name((cnf) => { + return { + fontFamily: cnf.messageFontFamily, + fontSize: cnf.messageFontSize, + fontWeight: cnf.messageFontWeight + }; + }, "messageFont"); + __name(calcC4ShapeTextWH, "calcC4ShapeTextWH"); + drawBoundary2 = /* @__PURE__ */ __name(function(diagram23, boundary, bounds4) { + boundary.x = bounds4.data.startx; + boundary.y = bounds4.data.starty; + boundary.width = bounds4.data.stopx - bounds4.data.startx; + boundary.height = bounds4.data.stopy - bounds4.data.starty; + boundary.label.y = conf.c4ShapeMargin - 35; + let boundaryTextWrap = boundary.wrap && conf.wrap; + let boundaryLabelConf = boundaryFont(conf); + boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2; + boundaryLabelConf.fontWeight = "bold"; + let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf); + calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth); + svgDraw_default.drawBoundary(diagram23, boundary, conf); + }, "drawBoundary"); + drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram23, c4ShapeArray2, c4ShapeKeys) { + let Y3 = 0; + for (const c4ShapeKey of c4ShapeKeys) { + Y3 = 0; + const c4Shape = c4ShapeArray2[c4ShapeKey]; + let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2; + c4Shape.typeC4Shape.width = calculateTextWidth( + "\xAB" + c4Shape.typeC4Shape.text + "\xBB", + c4ShapeTypeConf + ); + c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2; + c4Shape.typeC4Shape.Y = conf.c4ShapePadding; + Y3 = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4; + c4Shape.image = { width: 0, height: 0, Y: 0 }; + switch (c4Shape.typeC4Shape.text) { + case "person": + case "external_person": + c4Shape.image.width = 48; + c4Shape.image.height = 48; + c4Shape.image.Y = Y3; + Y3 = c4Shape.image.Y + c4Shape.image.height; + break; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; + if (c4Shape.sprite) { + c4Shape.image.width = 48; + c4Shape.image.height = 48; + c4Shape.image.Y = Y3; + Y3 = c4Shape.image.Y + c4Shape.image.height; + } + let c4ShapeTextWrap = c4Shape.wrap && conf.wrap; + let textLimitWidth = conf.width - conf.c4ShapePadding * 2; + let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2; + c4ShapeLabelConf.fontWeight = "bold"; + calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth); + c4Shape.label.Y = Y3 + 8; + Y3 = c4Shape.label.Y + c4Shape.label.height; + if (c4Shape.type && c4Shape.type.text !== "") { + c4Shape.type.text = "[" + c4Shape.type.text + "]"; + let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth); + c4Shape.type.Y = Y3 + 5; + Y3 = c4Shape.type.Y + c4Shape.type.height; + } else if (c4Shape.techn && c4Shape.techn.text !== "") { + c4Shape.techn.text = "[" + c4Shape.techn.text + "]"; + let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text); + calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth); + c4Shape.techn.Y = Y3 + 5; + Y3 = c4Shape.techn.Y + c4Shape.techn.height; + } + let rectHeight = Y3; + let rectWidth = c4Shape.label.width; + if (c4Shape.descr && c4Shape.descr.text !== "") { + let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth); + c4Shape.descr.Y = Y3 + 20; + Y3 = c4Shape.descr.Y + c4Shape.descr.height; + rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width); + rectHeight = Y3 - c4Shape.descr.textLines * 5; + } + rectWidth = rectWidth + conf.c4ShapePadding; + c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width); + c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height); + c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin; + currentBounds.insert(c4Shape); + svgDraw_default.drawC4Shape(diagram23, c4Shape, conf); + } + currentBounds.bumpLastMargin(conf.c4ShapeMargin); + }, "drawC4ShapeArray"); + Point2 = class { + static { + __name(this, "Point"); + } + constructor(x5, y5) { + this.x = x5; + this.y = y5; + } + }; + getIntersectPoint = /* @__PURE__ */ __name(function(fromNode, endPoint) { + let x1 = fromNode.x; + let y1 = fromNode.y; + let x22 = endPoint.x; + let y22 = endPoint.y; + let fromCenterX = x1 + fromNode.width / 2; + let fromCenterY = y1 + fromNode.height / 2; + let dx = Math.abs(x1 - x22); + let dy = Math.abs(y1 - y22); + let tanDYX = dy / dx; + let fromDYX = fromNode.height / fromNode.width; + let returnPoint = null; + if (y1 == y22 && x1 < x22) { + returnPoint = new Point2(x1 + fromNode.width, fromCenterY); + } else if (y1 == y22 && x1 > x22) { + returnPoint = new Point2(x1, fromCenterY); + } else if (x1 == x22 && y1 < y22) { + returnPoint = new Point2(fromCenterX, y1 + fromNode.height); + } else if (x1 == x22 && y1 > y22) { + returnPoint = new Point2(fromCenterX, y1); + } + if (x1 > x22 && y1 < y22) { + if (fromDYX >= tanDYX) { + returnPoint = new Point2(x1, fromCenterY + tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point2( + fromCenterX - dx / dy * fromNode.height / 2, + y1 + fromNode.height + ); + } + } else if (x1 < x22 && y1 < y22) { + if (fromDYX >= tanDYX) { + returnPoint = new Point2(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2); } else { - this.yylloc.last_column++; + returnPoint = new Point2( + fromCenterX + dx / dy * fromNode.height / 2, + y1 + fromNode.height + ); } - if (this.options.ranges) { - this.yylloc.range[1]++; + } else if (x1 < x22 && y1 > y22) { + if (fromDYX >= tanDYX) { + returnPoint = new Point2(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point2(fromCenterX + fromNode.height / 2 * dx / dy, y1); } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + } else if (x1 > x22 && y1 > y22) { + if (fromDYX >= tanDYX) { + returnPoint = new Point2(x1, fromCenterY - fromNode.width / 2 * tanDYX); + } else { + returnPoint = new Point2(fromCenterX - fromNode.height / 2 * dx / dy, y1); + } + } + return returnPoint; + }, "getIntersectPoint"); + getIntersectPoints = /* @__PURE__ */ __name(function(fromNode, endNode) { + let endIntersectPoint = { x: 0, y: 0 }; + endIntersectPoint.x = endNode.x + endNode.width / 2; + endIntersectPoint.y = endNode.y + endNode.height / 2; + let startPoint = getIntersectPoint(fromNode, endIntersectPoint); + endIntersectPoint.x = fromNode.x + fromNode.width / 2; + endIntersectPoint.y = fromNode.y + fromNode.height / 2; + let endPoint = getIntersectPoint(endNode, endIntersectPoint); + return { startPoint, endPoint }; + }, "getIntersectPoints"); + drawRels2 = /* @__PURE__ */ __name(function(diagram23, rels2, getC4ShapeObj, diagObj) { + let i2 = 0; + for (let rel2 of rels2) { + i2 = i2 + 1; + let relTextWrap = rel2.wrap && conf.wrap; + let relConf = messageFont(conf); + let diagramType = diagObj.db.getC4Type(); + if (diagramType === "C4Dynamic") { + rel2.label.text = i2 + ": " + rel2.label.text; + } + let textLimitWidth = calculateTextWidth(rel2.label.text, relConf); + calcC4ShapeTextWH("label", rel2, relTextWrap, relConf, textLimitWidth); + if (rel2.techn && rel2.techn.text !== "") { + textLimitWidth = calculateTextWidth(rel2.techn.text, relConf); + calcC4ShapeTextWH("techn", rel2, relTextWrap, relConf, textLimitWidth); + } + if (rel2.descr && rel2.descr.text !== "") { + textLimitWidth = calculateTextWidth(rel2.descr.text, relConf); + calcC4ShapeTextWH("descr", rel2, relTextWrap, relConf, textLimitWidth); + } + let fromNode = getC4ShapeObj(rel2.from); + let endNode = getC4ShapeObj(rel2.to); + let points = getIntersectPoints(fromNode, endNode); + rel2.startPoint = points.startPoint; + rel2.endPoint = points.endPoint; + } + svgDraw_default.drawRels(diagram23, rels2, conf); + }, "drawRels"); + __name(drawInsideBoundary, "drawInsideBoundary"); + draw = /* @__PURE__ */ __name(function(_text, id26, _version, diagObj) { + conf = getConfig2().c4; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + let db7 = diagObj.db; + diagObj.db.setWrap(conf.wrap); + c4ShapeInRow2 = db7.getC4ShapeInRow(); + c4BoundaryInRow2 = db7.getC4BoundaryInRow(); + log.debug(`C:${JSON.stringify(conf, null, 2)}`); + const diagram23 = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); + svgDraw_default.insertComputerIcon(diagram23); + svgDraw_default.insertDatabaseIcon(diagram23); + svgDraw_default.insertClockIcon(diagram23); + let screenBounds = new Bounds(diagObj); + screenBounds.setData( + conf.diagramMarginX, + conf.diagramMarginX, + conf.diagramMarginY, + conf.diagramMarginY + ); + screenBounds.data.widthLimit = screen.availWidth; + globalBoundaryMaxX = conf.diagramMarginX; + globalBoundaryMaxY = conf.diagramMarginY; + const title2 = diagObj.db.getTitle(); + let currentBoundaries = diagObj.db.getBoundarys(""); + drawInsideBoundary(diagram23, "", screenBounds, currentBoundaries, diagObj); + svgDraw_default.insertArrowHead(diagram23); + svgDraw_default.insertArrowEnd(diagram23); + svgDraw_default.insertArrowCrossHead(diagram23); + svgDraw_default.insertArrowFilledHead(diagram23); + drawRels2(diagram23, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj); + screenBounds.data.stopx = globalBoundaryMaxX; + screenBounds.data.stopy = globalBoundaryMaxY; + const box = screenBounds.data; + let boxHeight = box.stopy - box.starty; + let height2 = boxHeight + 2 * conf.diagramMarginY; + let boxWidth = box.stopx - box.startx; + const width3 = boxWidth + 2 * conf.diagramMarginX; + if (title2) { + diagram23.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY); + } + configureSvgSize(diagram23, height2, width3, conf.useMaxWidth); + const extraVertForTitle = title2 ? 60 : 0; + diagram23.attr( + "viewBox", + box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle) + ); + log.debug(`models:`, box); + }, "draw"); + c4Renderer_default = { + drawPersonOrSystemArray: drawC4ShapeArray, + drawBoundary: drawBoundary2, + setConf, + draw + }; + } + }); + + // src/diagrams/c4/styles.js + var getStyles2, styles_default2; + var init_styles2 = __esm({ + "src/diagrams/c4/styles.js"() { + "use strict"; + getStyles2 = /* @__PURE__ */ __name((options3) => `.person { + stroke: ${options3.personBorder}; + fill: ${options3.personBkg}; + } +`, "getStyles"); + styles_default2 = getStyles2; + } + }); + + // src/diagrams/c4/c4Diagram.ts + var c4Diagram_exports = {}; + __export(c4Diagram_exports, { + diagram: () => diagram + }); + var diagram; + var init_c4Diagram2 = __esm({ + "src/diagrams/c4/c4Diagram.ts"() { + "use strict"; + init_c4Diagram(); + init_c4Db(); + init_c4Renderer(); + init_styles2(); + diagram = { + parser: c4Diagram_default, + db: c4Db_default, + renderer: c4Renderer_default, + styles: styles_default2, + init: /* @__PURE__ */ __name(({ c4, wrap: wrap3 }) => { + c4Renderer_default.setConf(c4); + c4Db_default.setWrap(wrap3); + }, "init") + }; + } + }); + + // src/diagrams/flowchart/flowDb.ts + function getCompiledStyles(classDefs) { + let compiledStyles = []; + for (const customClass of classDefs) { + const cssClass = classes.get(customClass); + if (cssClass?.styles) { + compiledStyles = [...compiledStyles, ...cssClass.styles ?? []].map((s2) => s2.trim()); + } + if (cssClass?.textStyles) { + compiledStyles = [...compiledStyles, ...cssClass.textStyles ?? []].map((s2) => s2.trim()); + } + } + return compiledStyles; + } + var MERMAID_DOM_ID_PREFIX, vertexCounter, config2, vertices, edges, classes, subGraphs, subGraphLookup, tooltips, subCount, firstGraphFlag, direction, version, funs, sanitizeText4, lookUpDomId, addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setTooltip, setClickFun, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, setupToolTips, clear3, setGen, defaultStyle, addSubGraph, getPosForId, secCount, posCrossRef, indexNodes2, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, destructStartLink, countChar, destructEndLink, destructLink, exists, makeUniq, lex, getTypeFromVertex, findNode, destructEdgeType, addNodeFromVertex, getData, flowDb_default; + var init_flowDb = __esm({ + "src/diagrams/flowchart/flowDb.ts"() { + "use strict"; + init_src32(); + init_utils2(); + init_diagramAPI(); + init_common(); + init_logger(); + init_commonDb(); + MERMAID_DOM_ID_PREFIX = "flowchart-"; + vertexCounter = 0; + config2 = getConfig2(); + vertices = /* @__PURE__ */ new Map(); + edges = []; + classes = /* @__PURE__ */ new Map(); + subGraphs = []; + subGraphLookup = /* @__PURE__ */ new Map(); + tooltips = /* @__PURE__ */ new Map(); + subCount = 0; + firstGraphFlag = true; + funs = []; + sanitizeText4 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, config2), "sanitizeText"); + lookUpDomId = /* @__PURE__ */ __name(function(id26) { + for (const vertex of vertices.values()) { + if (vertex.id === id26) { + return vertex.domId; + } + } + return id26; + }, "lookUpDomId"); + addVertex = /* @__PURE__ */ __name(function(id26, textObj, type3, style3, classes6, dir2, props = {}) { + if (!id26 || id26.trim().length === 0) { + return; + } + let txt; + let vertex = vertices.get(id26); + if (vertex === void 0) { + vertex = { + id: id26, + labelType: "text", + domId: MERMAID_DOM_ID_PREFIX + id26 + "-" + vertexCounter, + styles: [], + classes: [] }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + vertices.set(id26, vertex); + } + vertexCounter++; + if (textObj !== void 0) { + config2 = getConfig2(); + txt = sanitizeText4(textObj.text.trim()); + vertex.labelType = textObj.type; + if (txt.startsWith('"') && txt.endsWith('"')) { + txt = txt.substring(1, txt.length - 1); } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; + vertex.text = txt; + } else { + if (vertex.text === void 0) { + vertex.text = id26; + } + } + if (type3 !== void 0) { + vertex.type = type3; + } + if (style3 !== void 0 && style3 !== null) { + style3.forEach(function(s2) { + vertex.styles.push(s2); + }); + } + if (classes6 !== void 0 && classes6 !== null) { + classes6.forEach(function(s2) { + vertex.classes.push(s2); + }); + } + if (dir2 !== void 0) { + vertex.dir = dir2; + } + if (vertex.props === void 0) { + vertex.props = props; + } else if (props !== void 0) { + Object.assign(vertex.props, props); + } + }, "addVertex"); + addSingleLink = /* @__PURE__ */ __name(function(_start, _end, type3) { + const start3 = _start; + const end2 = _end; + const edge = { start: start3, end: end2, type: void 0, text: "", labelType: "text" }; + log.info("abc78 Got edge...", edge); + const linkTextObj = type3.text; + if (linkTextObj !== void 0) { + edge.text = sanitizeText4(linkTextObj.text.trim()); + if (edge.text.startsWith('"') && edge.text.endsWith('"')) { + edge.text = edge.text.substring(1, edge.text.length - 1); + } + edge.labelType = linkTextObj.type; + } + if (type3 !== void 0) { + edge.type = type3.type; + edge.stroke = type3.stroke; + edge.length = type3.length > 10 ? 10 : type3.length; + } + if (edges.length < (config2.maxEdges ?? 500)) { + log.info("Pushing edge..."); + edges.push(edge); + } else { + throw new Error( + `Edge limit exceeded. ${edges.length} edges found, but the limit is ${config2.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.` + ); + } + }, "addSingleLink"); + addLink = /* @__PURE__ */ __name(function(_start, _end, type3) { + log.info("addLink", _start, _end, type3); + for (const start3 of _start) { + for (const end2 of _end) { + addSingleLink(start3, end2, type3); + } + } + }, "addLink"); + updateLinkInterpolate = /* @__PURE__ */ __name(function(positions2, interpolate) { + positions2.forEach(function(pos) { + if (pos === "default") { + edges.defaultInterpolate = interpolate; } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + edges[pos].interpolate = interpolate; } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + }); + }, "updateLinkInterpolate"); + updateLink = /* @__PURE__ */ __name(function(positions2, style3) { + positions2.forEach(function(pos) { + if (typeof pos === "number" && pos >= edges.length) { + throw new Error( + `The index ${pos} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)` + ); } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + if (pos === "default") { + edges.defaultStyle = style3; + } else { + edges[pos].style = style3; + if ((edges[pos]?.style?.length ?? 0) > 0 && !edges[pos]?.style?.some((s2) => s2?.startsWith("fill"))) { + edges[pos]?.style?.push("fill:none"); } } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + }); + }, "updateLink"); + addClass = /* @__PURE__ */ __name(function(ids, style3) { + ids.split(",").forEach(function(id26) { + let classNode = classes.get(id26); + if (classNode === void 0) { + classNode = { id: id26, styles: [], textStyles: [] }; + classes.set(id26, classNode); + } + if (style3 !== void 0 && style3 !== null) { + style3.forEach(function(s2) { + if (/color/.exec(s2)) { + const newStyle = s2.replace("fill", "bgFill"); + classNode.textStyles.push(newStyle); + } + classNode.styles.push(s2); + }); } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; + }); + }, "addClass"); + setDirection = /* @__PURE__ */ __name(function(dir2) { + direction = dir2; + if (/.*/.exec(direction)) { + direction = "LR"; + } + if (/.*v/.exec(direction)) { + direction = "TB"; + } + if (direction === "TD") { + direction = "TB"; + } + }, "setDirection"); + setClass = /* @__PURE__ */ __name(function(ids, className) { + for (const id26 of ids.split(",")) { + const vertex = vertices.get(id26); + if (vertex) { + vertex.classes.push(className); + } + const subGraph = subGraphLookup.get(id26); + if (subGraph) { + subGraph.classes.push(className); + } + } + }, "setClass"); + setTooltip = /* @__PURE__ */ __name(function(ids, tooltip) { + if (tooltip === void 0) { + return; + } + tooltip = sanitizeText4(tooltip); + for (const id26 of ids.split(",")) { + tooltips.set(version === "gen-1" ? lookUpDomId(id26) : id26, tooltip); + } + }, "setTooltip"); + setClickFun = /* @__PURE__ */ __name(function(id26, functionName, functionArgs) { + const domId = lookUpDomId(id26); + if (getConfig2().securityLevel !== "loose") { + return; + } + if (functionName === void 0) { + return; + } + let argList = []; + if (typeof functionArgs === "string") { + argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + for (let i2 = 0; i2 < argList.length; i2++) { + let item = argList[i2].trim(); + if (item.startsWith('"') && item.endsWith('"')) { + item = item.substr(1, item.length - 2); + } + argList[i2] = item; + } + } + if (argList.length === 0) { + argList.push(id26); + } + const vertex = vertices.get(id26); + if (vertex) { + vertex.haveCallback = true; + funs.push(function() { + const elem = document.querySelector(`[id="${domId}"]`); + if (elem !== null) { + elem.addEventListener( + "click", + function() { + utils_default2.runFunc(functionName, ...argList); + }, + false + ); } - return false; + }); + } + }, "setClickFun"); + setLink = /* @__PURE__ */ __name(function(ids, linkStr, target) { + ids.split(",").forEach(function(id26) { + const vertex = vertices.get(id26); + if (vertex !== void 0) { + vertex.link = utils_default2.formatUrl(linkStr, config2); + vertex.linkTarget = target; } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } + }); + setClass(ids, "clickable"); + }, "setLink"); + getTooltip = /* @__PURE__ */ __name(function(id26) { + return tooltips.get(id26); + }, "getTooltip"); + setClickEvent = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { + ids.split(",").forEach(function(id26) { + setClickFun(id26, functionName, functionArgs); + }); + setClass(ids, "clickable"); + }, "setClickEvent"); + bindFunctions = /* @__PURE__ */ __name(function(element3) { + funs.forEach(function(fun) { + fun(element3); + }); + }, "bindFunctions"); + getDirection = /* @__PURE__ */ __name(function() { + return direction.trim(); + }, "getDirection"); + getVertices = /* @__PURE__ */ __name(function() { + return vertices; + }, "getVertices"); + getEdges = /* @__PURE__ */ __name(function() { + return edges; + }, "getEdges"); + getClasses = /* @__PURE__ */ __name(function() { + return classes; + }, "getClasses"); + setupToolTips = /* @__PURE__ */ __name(function(element3) { + let tooltipElem = select_default2(".mermaidTooltip"); + if ((tooltipElem._groups || tooltipElem)[0][0] === null) { + tooltipElem = select_default2("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); + } + const svg = select_default2(element3).select("svg"); + const nodes6 = svg.selectAll("g.node"); + nodes6.on("mouseover", function() { + const el = select_default2(this); + const title2 = el.attr("title"); + if (title2 === null) { + return; + } + const rect4 = this?.getBoundingClientRect(); + tooltipElem.transition().duration(200).style("opacity", ".9"); + tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect4.left + (rect4.right - rect4.left) / 2 + "px").style("top", window.scrollY + rect4.bottom + "px"); + tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, "
")); + el.classed("hover", true); + }).on("mouseout", function() { + tooltipElem.transition().duration(500).style("opacity", 0); + const el = select_default2(this); + el.classed("hover", false); + }); + }, "setupToolTips"); + funs.push(setupToolTips); + clear3 = /* @__PURE__ */ __name(function(ver = "gen-1") { + vertices = /* @__PURE__ */ new Map(); + classes = /* @__PURE__ */ new Map(); + edges = []; + funs = [setupToolTips]; + subGraphs = []; + subGraphLookup = /* @__PURE__ */ new Map(); + subCount = 0; + tooltips = /* @__PURE__ */ new Map(); + firstGraphFlag = true; + version = ver; + config2 = getConfig2(); + clear(); + }, "clear"); + setGen = /* @__PURE__ */ __name((ver) => { + version = ver || "gen-2"; + }, "setGen"); + defaultStyle = /* @__PURE__ */ __name(function() { + return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"; + }, "defaultStyle"); + addSubGraph = /* @__PURE__ */ __name(function(_id, list2, _title) { + let id26 = _id.text.trim(); + let title2 = _title.text; + if (_id === _title && /\s/.exec(_title.text)) { + id26 = void 0; + } + function uniq2(a2) { + const prims = { boolean: {}, number: {}, string: {} }; + const objs = []; + let dir3; + const nodeList2 = a2.filter(function(item) { + const type3 = typeof item; + if (item.stmt && item.stmt === "dir") { + dir3 = item.value; + return false; + } + if (item.trim() === "") { + return false; } + if (type3 in prims) { + return prims[type3].hasOwnProperty(item) ? false : prims[type3][item] = true; + } else { + return objs.includes(item) ? false : objs.push(item); + } + }); + return { nodeList: nodeList2, dir: dir3 }; + } + __name(uniq2, "uniq"); + const { nodeList, dir: dir2 } = uniq2(list2.flat()); + if (version === "gen-1") { + for (let i2 = 0; i2 < nodeList.length; i2++) { + nodeList[i2] = lookUpDomId(nodeList[i2]); + } + } + id26 = id26 ?? "subGraph" + subCount; + title2 = title2 || ""; + title2 = sanitizeText4(title2); + subCount = subCount + 1; + const subGraph = { + id: id26, + nodes: nodeList, + title: title2.trim(), + classes: [], + dir: dir2, + labelType: _title.type + }; + log.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir); + subGraph.nodes = makeUniq(subGraph, subGraphs).nodes; + subGraphs.push(subGraph); + subGraphLookup.set(id26, subGraph); + return id26; + }, "addSubGraph"); + getPosForId = /* @__PURE__ */ __name(function(id26) { + for (const [i2, subGraph] of subGraphs.entries()) { + if (subGraph.id === id26) { + return i2; } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + } + return -1; + }, "getPosForId"); + secCount = -1; + posCrossRef = []; + indexNodes2 = /* @__PURE__ */ __name(function(id26, pos) { + const nodes6 = subGraphs[pos].nodes; + secCount = secCount + 1; + if (secCount > 2e3) { + return { + result: false, + count: 0 + }; + } + posCrossRef[secCount] = pos; + if (subGraphs[pos].id === id26) { + return { + result: true, + count: 0 + }; + } + let count = 0; + let posCount = 1; + while (count < nodes6.length) { + const childPos = getPosForId(nodes6[count]); + if (childPos >= 0) { + const res = indexNodes2(id26, childPos); + if (res.result) { + return { + result: true, + count: posCount + res.count + }; + } else { + posCount = posCount + res.count; } - return false; } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + count = count + 1; + } + return { + result: false, + count: posCount + }; + }, "indexNodes2"); + getDepthFirstPos = /* @__PURE__ */ __name(function(pos) { + return posCrossRef[pos]; + }, "getDepthFirstPos"); + indexNodes = /* @__PURE__ */ __name(function() { + secCount = -1; + if (subGraphs.length > 0) { + indexNodes2("none", subGraphs.length - 1); + } + }, "indexNodes"); + getSubGraphs = /* @__PURE__ */ __name(function() { + return subGraphs; + }, "getSubGraphs"); + firstGraph = /* @__PURE__ */ __name(() => { + if (firstGraphFlag) { + firstGraphFlag = false; + return true; + } + return false; + }, "firstGraph"); + destructStartLink = /* @__PURE__ */ __name((_str) => { + let str2 = _str.trim(); + let type3 = "arrow_open"; + switch (str2[0]) { + case "<": + type3 = "arrow_point"; + str2 = str2.slice(1); + break; + case "x": + type3 = "arrow_cross"; + str2 = str2.slice(1); + break; + case "o": + type3 = "arrow_circle"; + str2 = str2.slice(1); + break; + } + let stroke = "normal"; + if (str2.includes("=")) { + stroke = "thick"; + } + if (str2.includes(".")) { + stroke = "dotted"; + } + return { type: type3, stroke }; + }, "destructStartLink"); + countChar = /* @__PURE__ */ __name((char2, str2) => { + const length2 = str2.length; + let count = 0; + for (let i2 = 0; i2 < length2; ++i2) { + if (str2[i2] === char2) { + ++count; } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + } + return count; + }, "countChar"); + destructEndLink = /* @__PURE__ */ __name((_str) => { + const str2 = _str.trim(); + let line2 = str2.slice(0, -1); + let type3 = "arrow_open"; + switch (str2.slice(-1)) { + case "x": + type3 = "arrow_cross"; + if (str2.startsWith("x")) { + type3 = "double_" + type3; + line2 = line2.slice(1); + } + break; + case ">": + type3 = "arrow_point"; + if (str2.startsWith("<")) { + type3 = "double_" + type3; + line2 = line2.slice(1); + } + break; + case "o": + type3 = "arrow_circle"; + if (str2.startsWith("o")) { + type3 = "double_" + type3; + line2 = line2.slice(1); + } + break; + } + let stroke = "normal"; + let length2 = line2.length - 1; + if (line2.startsWith("=")) { + stroke = "thick"; + } + if (line2.startsWith("~")) { + stroke = "invisible"; + } + const dots = countChar(".", line2); + if (dots) { + stroke = "dotted"; + length2 = dots; + } + return { type: type3, stroke, length: length2 }; + }, "destructEndLink"); + destructLink = /* @__PURE__ */ __name((_str, _startStr) => { + const info2 = destructEndLink(_str); + let startInfo; + if (_startStr) { + startInfo = destructStartLink(_startStr); + if (startInfo.stroke !== info2.stroke) { + return { type: "INVALID", stroke: "INVALID" }; } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); + if (startInfo.type === "arrow_open") { + startInfo.type = info2.type; } else { - return this.conditionStack[0]; + if (startInfo.type !== info2.type) { + return { type: "INVALID", stroke: "INVALID" }; + } + startInfo.type = "double_" + startInfo.type; } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + if (startInfo.type === "double_arrow") { + startInfo.type = "double_arrow_point"; } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; + startInfo.length = info2.length; + return startInfo; + } + return info2; + }, "destructLink"); + exists = /* @__PURE__ */ __name((allSgs, _id) => { + for (const sg of allSgs) { + if (sg.nodes.includes(_id)) { + return true; } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: {}, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - return 6; - case 1: - return 7; - case 2: - return 8; - case 3: - return 9; - case 4: - return 22; - case 5: - return 23; - case 6: - this.begin("acc_title"); - return 24; - case 7: - this.popState(); - return "acc_title_value"; - case 8: - this.begin("acc_descr"); - return 26; - case 9: - this.popState(); - return "acc_descr_value"; - case 10: - this.begin("acc_descr_multiline"); - break; - case 11: - this.popState(); - break; - case 12: - return "acc_descr_multiline_value"; - case 13: - break; - case 14: - c; - break; - case 15: - return 12; - case 16: - break; - case 17: - return 11; - case 18: - return 15; - case 19: - return 16; - case 20: - return 17; - case 21: - return 18; - case 22: - this.begin("person_ext"); - return 45; - case 23: - this.begin("person"); - return 44; - case 24: - this.begin("system_ext_queue"); - return 51; - case 25: - this.begin("system_ext_db"); - return 50; - case 26: - this.begin("system_ext"); - return 49; - case 27: - this.begin("system_queue"); - return 48; - case 28: - this.begin("system_db"); - return 47; - case 29: - this.begin("system"); - return 46; - case 30: - this.begin("boundary"); - return 37; - case 31: - this.begin("enterprise_boundary"); - return 34; - case 32: - this.begin("system_boundary"); - return 36; - case 33: - this.begin("container_ext_queue"); - return 57; - case 34: - this.begin("container_ext_db"); - return 56; - case 35: - this.begin("container_ext"); - return 55; - case 36: - this.begin("container_queue"); - return 54; - case 37: - this.begin("container_db"); - return 53; - case 38: - this.begin("container"); - return 52; - case 39: - this.begin("container_boundary"); - return 38; - case 40: - this.begin("component_ext_queue"); - return 63; - case 41: - this.begin("component_ext_db"); - return 62; - case 42: - this.begin("component_ext"); - return 61; - case 43: - this.begin("component_queue"); - return 60; - case 44: - this.begin("component_db"); - return 59; - case 45: - this.begin("component"); - return 58; - case 46: - this.begin("node"); - return 39; - case 47: - this.begin("node"); - return 39; - case 48: - this.begin("node_l"); - return 40; - case 49: - this.begin("node_r"); - return 41; - case 50: - this.begin("rel"); - return 64; - case 51: - this.begin("birel"); - return 65; - case 52: - this.begin("rel_u"); - return 66; - case 53: - this.begin("rel_u"); - return 66; - case 54: - this.begin("rel_d"); - return 67; - case 55: - this.begin("rel_d"); - return 67; - case 56: - this.begin("rel_l"); - return 68; - case 57: - this.begin("rel_l"); - return 68; - case 58: - this.begin("rel_r"); - return 69; - case 59: - this.begin("rel_r"); - return 69; - case 60: - this.begin("rel_b"); - return 70; - case 61: - this.begin("rel_index"); - return 71; - case 62: - this.begin("update_el_style"); - return 72; - case 63: - this.begin("update_rel_style"); - return 73; - case 64: - this.begin("update_layout_config"); - return 74; - case 65: - return "EOF_IN_STRUCT"; - case 66: - this.begin("attribute"); - return "ATTRIBUTE_EMPTY"; - case 67: - this.begin("attribute"); - break; - case 68: - this.popState(); - this.popState(); - break; - case 69: - return 80; - case 70: - break; - case 71: - return 80; - case 72: - this.begin("string"); - break; - case 73: - this.popState(); - break; - case 74: - return "STR"; - case 75: - this.begin("string_kv"); + } + return false; + }, "exists"); + makeUniq = /* @__PURE__ */ __name((sg, allSubgraphs) => { + const res = []; + sg.nodes.forEach((_id, pos) => { + if (!exists(allSubgraphs, _id)) { + res.push(sg.nodes[pos]); + } + }); + return { nodes: res }; + }, "makeUniq"); + lex = { + firstGraph + }; + getTypeFromVertex = /* @__PURE__ */ __name((vertex) => { + if (vertex.type === "square") { + return "squareRect"; + } + if (vertex.type === "round") { + return "roundedRect"; + } + return vertex.type ?? "squareRect"; + }, "getTypeFromVertex"); + findNode = /* @__PURE__ */ __name((nodes6, id26) => nodes6.find((node2) => node2.id === id26), "findNode"); + destructEdgeType = /* @__PURE__ */ __name((type3) => { + let arrowTypeStart = "none"; + let arrowTypeEnd = "arrow_point"; + switch (type3) { + case "arrow_point": + case "arrow_circle": + case "arrow_cross": + arrowTypeEnd = type3; + break; + case "double_arrow_point": + case "double_arrow_circle": + case "double_arrow_cross": + arrowTypeStart = type3.replace("double_", ""); + arrowTypeEnd = arrowTypeStart; + break; + } + return { arrowTypeStart, arrowTypeEnd }; + }, "destructEdgeType"); + addNodeFromVertex = /* @__PURE__ */ __name((vertex, nodes6, parentDB, subGraphDB, config6, look) => { + const parentId = parentDB.get(vertex.id); + const isGroup2 = subGraphDB.get(vertex.id) ?? false; + const node2 = findNode(nodes6, vertex.id); + if (node2) { + node2.cssStyles = vertex.styles; + node2.cssCompiledStyles = getCompiledStyles(vertex.classes); + node2.cssClasses = vertex.classes.join(" "); + } else { + nodes6.push({ + id: vertex.id, + label: vertex.text, + labelStyle: "", + parentId, + padding: config6.flowchart?.padding || 8, + cssStyles: vertex.styles, + cssCompiledStyles: getCompiledStyles(["default", "node", ...vertex.classes]), + cssClasses: "default " + vertex.classes.join(" "), + shape: getTypeFromVertex(vertex), + dir: vertex.dir, + domId: vertex.domId, + isGroup: isGroup2, + look, + link: vertex.link, + linkTarget: vertex.linkTarget, + tooltip: getTooltip(vertex.id) + }); + } + }, "addNodeFromVertex"); + __name(getCompiledStyles, "getCompiledStyles"); + getData = /* @__PURE__ */ __name(() => { + const config6 = getConfig2(); + const nodes6 = []; + const edges5 = []; + const subGraphs2 = getSubGraphs(); + const parentDB = /* @__PURE__ */ new Map(); + const subGraphDB = /* @__PURE__ */ new Map(); + for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) { + const subGraph = subGraphs2[i2]; + if (subGraph.nodes.length > 0) { + subGraphDB.set(subGraph.id, true); + } + for (const id26 of subGraph.nodes) { + parentDB.set(id26, subGraph.id); + } + } + for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) { + const subGraph = subGraphs2[i2]; + nodes6.push({ + id: subGraph.id, + label: subGraph.title, + labelStyle: "", + parentId: parentDB.get(subGraph.id), + padding: 8, + cssCompiledStyles: getCompiledStyles(subGraph.classes), + cssClasses: subGraph.classes.join(" "), + shape: "rect", + dir: subGraph.dir, + isGroup: true, + look: config6.look + }); + } + const n2 = getVertices(); + n2.forEach((vertex) => { + addNodeFromVertex(vertex, nodes6, parentDB, subGraphDB, config6, config6.look || "classic"); + }); + const e3 = getEdges(); + e3.forEach((rawEdge, index) => { + const { arrowTypeStart, arrowTypeEnd } = destructEdgeType(rawEdge.type); + const styles3 = [...e3.defaultStyle ?? []]; + if (rawEdge.style) { + styles3.push(...rawEdge.style); + } + const edge = { + id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: "L" }), + start: rawEdge.start, + end: rawEdge.end, + type: rawEdge.type ?? "normal", + label: rawEdge.text, + labelpos: "c", + thickness: rawEdge.stroke, + minlen: rawEdge.length, + classes: rawEdge?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link", + arrowTypeStart: rawEdge?.stroke === "invisible" ? "none" : arrowTypeStart, + arrowTypeEnd: rawEdge?.stroke === "invisible" ? "none" : arrowTypeEnd, + arrowheadStyle: "fill: #333", + labelStyle: styles3, + style: styles3, + pattern: rawEdge.stroke, + look: config6.look + }; + edges5.push(edge); + }); + return { nodes: nodes6, edges: edges5, other: {}, config: config6 }; + }, "getData"); + flowDb_default = { + defaultConfig: /* @__PURE__ */ __name(() => defaultConfig2.flowchart, "defaultConfig"), + setAccTitle, + getAccTitle, + getAccDescription, + getData, + setAccDescription, + addVertex, + lookUpDomId, + addLink, + updateLinkInterpolate, + updateLink, + addClass, + setDirection, + setClass, + setTooltip, + getTooltip, + setClickEvent, + setLink, + bindFunctions, + getDirection, + getVertices, + getEdges, + getClasses, + clear: clear3, + setGen, + defaultStyle, + addSubGraph, + getDepthFirstPos, + indexNodes, + getSubGraphs, + destructLink, + lex, + exists, + makeUniq, + setDiagramTitle, + getDiagramTitle + }; + } + }); + + // src/dagre-wrapper/blockArrowHelper.ts + var expandAndDeduplicateDirections, getArrowPoints; + var init_blockArrowHelper = __esm({ + "src/dagre-wrapper/blockArrowHelper.ts"() { + "use strict"; + expandAndDeduplicateDirections = /* @__PURE__ */ __name((directions) => { + const uniqueDirections = /* @__PURE__ */ new Set(); + for (const direction4 of directions) { + switch (direction4) { + case "x": + uniqueDirections.add("right"); + uniqueDirections.add("left"); break; - case 76: - this.begin("string_kv_key"); - return "STR_KEY"; - case 77: - this.popState(); - this.begin("string_kv_value"); + case "y": + uniqueDirections.add("up"); + uniqueDirections.add("down"); break; - case 78: - return "STR_VALUE"; - case 79: - this.popState(); - this.popState(); + default: + uniqueDirections.add(direction4); break; - case 80: - return "STR"; - case 81: - return "LBRACE"; - case 82: - return "RBRACE"; - case 83: - return "SPACE"; - case 84: - return "EOL"; - case 85: - return 14; } - }, - rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/], - conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$v.parser = parser$v; - const parser$w = parser$v; - let c4ShapeArray = []; - let boundaryParseStack = [""]; - let currentBoundaryParse = "global"; - let parentBoundaryParse = ""; - let boundaries = [ - { - alias: "global", - label: { text: "global" }, - type: { text: "global" }, - tags: null, - link: null, - parentBoundary: "" - } - ]; - let rels = []; - let title = ""; - let wrapEnabled = false; - let c4ShapeInRow$1 = 4; - let c4BoundaryInRow$1 = 2; - var c4Type; - const getC4Type = function() { - return c4Type; - }; - const setC4Type = function(c4TypeParam) { - let sanitizedText = sanitizeText$6(c4TypeParam, getConfig$1()); - c4Type = sanitizedText; - }; - const addRel = function(type2, from2, to, label, techn, descr, sprite, tags2, link2) { - if (type2 === void 0 || type2 === null || from2 === void 0 || from2 === null || to === void 0 || to === null || label === void 0 || label === null) { - return; - } - let rel2 = {}; - const old = rels.find((rel3) => rel3.from === from2 && rel3.to === to); - if (old) { - rel2 = old; - } else { - rels.push(rel2); - } - rel2.type = type2; - rel2.from = from2; - rel2.to = to; - rel2.label = { text: label }; - if (techn === void 0 || techn === null) { - rel2.techn = { text: "" }; - } else { - if (typeof techn === "object") { - let [key, value2] = Object.entries(techn)[0]; - rel2[key] = { text: value2 }; - } else { - rel2.techn = { text: techn }; - } - } - if (descr === void 0 || descr === null) { - rel2.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value2] = Object.entries(descr)[0]; - rel2[key] = { text: value2 }; - } else { - rel2.descr = { text: descr }; - } - } - if (typeof sprite === "object") { - let [key, value2] = Object.entries(sprite)[0]; - rel2[key] = value2; - } else { - rel2.sprite = sprite; - } - if (typeof tags2 === "object") { - let [key, value2] = Object.entries(tags2)[0]; - rel2[key] = value2; - } else { - rel2.tags = tags2; - } - if (typeof link2 === "object") { - let [key, value2] = Object.entries(link2)[0]; - rel2[key] = value2; - } else { - rel2.link = link2; - } - rel2.wrap = autoWrap$1(); - }; - const addPersonOrSystem = function(typeC4Shape, alias, label, descr, sprite, tags2, link2) { - if (alias === null || label === null) { - return; - } - let personOrSystem = {}; - const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias); - if (old && alias === old.alias) { - personOrSystem = old; - } else { - personOrSystem.alias = alias; - c4ShapeArray.push(personOrSystem); - } - if (label === void 0 || label === null) { - personOrSystem.label = { text: "" }; - } else { - personOrSystem.label = { text: label }; - } - if (descr === void 0 || descr === null) { - personOrSystem.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value2] = Object.entries(descr)[0]; - personOrSystem[key] = { text: value2 }; - } else { - personOrSystem.descr = { text: descr }; - } - } - if (typeof sprite === "object") { - let [key, value2] = Object.entries(sprite)[0]; - personOrSystem[key] = value2; - } else { - personOrSystem.sprite = sprite; - } - if (typeof tags2 === "object") { - let [key, value2] = Object.entries(tags2)[0]; - personOrSystem[key] = value2; - } else { - personOrSystem.tags = tags2; - } - if (typeof link2 === "object") { - let [key, value2] = Object.entries(link2)[0]; - personOrSystem[key] = value2; - } else { - personOrSystem.link = link2; - } - personOrSystem.typeC4Shape = { text: typeC4Shape }; - personOrSystem.parentBoundary = currentBoundaryParse; - personOrSystem.wrap = autoWrap$1(); - }; - const addContainer = function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link2) { - if (alias === null || label === null) { - return; - } - let container = {}; - const old = c4ShapeArray.find((container2) => container2.alias === alias); - if (old && alias === old.alias) { - container = old; - } else { - container.alias = alias; - c4ShapeArray.push(container); - } - if (label === void 0 || label === null) { - container.label = { text: "" }; - } else { - container.label = { text: label }; - } - if (techn === void 0 || techn === null) { - container.techn = { text: "" }; - } else { - if (typeof techn === "object") { - let [key, value2] = Object.entries(techn)[0]; - container[key] = { text: value2 }; - } else { - container.techn = { text: techn }; - } - } - if (descr === void 0 || descr === null) { - container.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value2] = Object.entries(descr)[0]; - container[key] = { text: value2 }; - } else { - container.descr = { text: descr }; - } - } - if (typeof sprite === "object") { - let [key, value2] = Object.entries(sprite)[0]; - container[key] = value2; - } else { - container.sprite = sprite; - } - if (typeof tags2 === "object") { - let [key, value2] = Object.entries(tags2)[0]; - container[key] = value2; - } else { - container.tags = tags2; - } - if (typeof link2 === "object") { - let [key, value2] = Object.entries(link2)[0]; - container[key] = value2; - } else { - container.link = link2; - } - container.wrap = autoWrap$1(); - container.typeC4Shape = { text: typeC4Shape }; - container.parentBoundary = currentBoundaryParse; - }; - const addComponent = function(typeC4Shape, alias, label, techn, descr, sprite, tags2, link2) { - if (alias === null || label === null) { - return; - } - let component = {}; - const old = c4ShapeArray.find((component2) => component2.alias === alias); - if (old && alias === old.alias) { - component = old; - } else { - component.alias = alias; - c4ShapeArray.push(component); - } - if (label === void 0 || label === null) { - component.label = { text: "" }; - } else { - component.label = { text: label }; - } - if (techn === void 0 || techn === null) { - component.techn = { text: "" }; - } else { - if (typeof techn === "object") { - let [key, value2] = Object.entries(techn)[0]; - component[key] = { text: value2 }; - } else { - component.techn = { text: techn }; - } - } - if (descr === void 0 || descr === null) { - component.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value2] = Object.entries(descr)[0]; - component[key] = { text: value2 }; - } else { - component.descr = { text: descr }; - } - } - if (typeof sprite === "object") { - let [key, value2] = Object.entries(sprite)[0]; - component[key] = value2; - } else { - component.sprite = sprite; - } - if (typeof tags2 === "object") { - let [key, value2] = Object.entries(tags2)[0]; - component[key] = value2; - } else { - component.tags = tags2; - } - if (typeof link2 === "object") { - let [key, value2] = Object.entries(link2)[0]; - component[key] = value2; - } else { - component.link = link2; - } - component.wrap = autoWrap$1(); - component.typeC4Shape = { text: typeC4Shape }; - component.parentBoundary = currentBoundaryParse; - }; - const addPersonOrSystemBoundary = function(alias, label, type2, tags2, link2) { - if (alias === null || label === null) { - return; - } - let boundary = {}; - const old = boundaries.find((boundary2) => boundary2.alias === alias); - if (old && alias === old.alias) { - boundary = old; - } else { - boundary.alias = alias; - boundaries.push(boundary); - } - if (label === void 0 || label === null) { - boundary.label = { text: "" }; - } else { - boundary.label = { text: label }; - } - if (type2 === void 0 || type2 === null) { - boundary.type = { text: "system" }; - } else { - if (typeof type2 === "object") { - let [key, value2] = Object.entries(type2)[0]; - boundary[key] = { text: value2 }; - } else { - boundary.type = { text: type2 }; - } - } - if (typeof tags2 === "object") { - let [key, value2] = Object.entries(tags2)[0]; - boundary[key] = value2; - } else { - boundary.tags = tags2; - } - if (typeof link2 === "object") { - let [key, value2] = Object.entries(link2)[0]; - boundary[key] = value2; - } else { - boundary.link = link2; - } - boundary.parentBoundary = currentBoundaryParse; - boundary.wrap = autoWrap$1(); - parentBoundaryParse = currentBoundaryParse; - currentBoundaryParse = alias; - boundaryParseStack.push(parentBoundaryParse); - }; - const addContainerBoundary = function(alias, label, type2, tags2, link2) { - if (alias === null || label === null) { - return; - } - let boundary = {}; - const old = boundaries.find((boundary2) => boundary2.alias === alias); - if (old && alias === old.alias) { - boundary = old; - } else { - boundary.alias = alias; - boundaries.push(boundary); - } - if (label === void 0 || label === null) { - boundary.label = { text: "" }; - } else { - boundary.label = { text: label }; - } - if (type2 === void 0 || type2 === null) { - boundary.type = { text: "container" }; - } else { - if (typeof type2 === "object") { - let [key, value2] = Object.entries(type2)[0]; - boundary[key] = { text: value2 }; - } else { - boundary.type = { text: type2 }; - } - } - if (typeof tags2 === "object") { - let [key, value2] = Object.entries(tags2)[0]; - boundary[key] = value2; - } else { - boundary.tags = tags2; - } - if (typeof link2 === "object") { - let [key, value2] = Object.entries(link2)[0]; - boundary[key] = value2; - } else { - boundary.link = link2; - } - boundary.parentBoundary = currentBoundaryParse; - boundary.wrap = autoWrap$1(); - parentBoundaryParse = currentBoundaryParse; - currentBoundaryParse = alias; - boundaryParseStack.push(parentBoundaryParse); - }; - const addDeploymentNode = function(nodeType2, alias, label, type2, descr, sprite, tags2, link2) { - if (alias === null || label === null) { - return; - } - let boundary = {}; - const old = boundaries.find((boundary2) => boundary2.alias === alias); - if (old && alias === old.alias) { - boundary = old; - } else { - boundary.alias = alias; - boundaries.push(boundary); - } - if (label === void 0 || label === null) { - boundary.label = { text: "" }; - } else { - boundary.label = { text: label }; - } - if (type2 === void 0 || type2 === null) { - boundary.type = { text: "node" }; - } else { - if (typeof type2 === "object") { - let [key, value2] = Object.entries(type2)[0]; - boundary[key] = { text: value2 }; - } else { - boundary.type = { text: type2 }; - } + } + return uniqueDirections; + }, "expandAndDeduplicateDirections"); + getArrowPoints = /* @__PURE__ */ __name((duplicatedDirections, bbox, node2) => { + const directions = expandAndDeduplicateDirections(duplicatedDirections); + const f3 = 2; + const height2 = bbox.height + 2 * node2.padding; + const midpoint3 = height2 / f3; + const width3 = bbox.width + 2 * midpoint3 + node2.padding; + const padding3 = node2.padding / 2; + if (directions.has("right") && directions.has("left") && directions.has("up") && directions.has("down")) { + return [ + // Bottom + { x: 0, y: 0 }, + { x: midpoint3, y: 0 }, + { x: width3 / 2, y: 2 * padding3 }, + { x: width3 - midpoint3, y: 0 }, + { x: width3, y: 0 }, + // Right + { x: width3, y: -height2 / 3 }, + { x: width3 + 2 * padding3, y: -height2 / 2 }, + { x: width3, y: -2 * height2 / 3 }, + { x: width3, y: -height2 }, + // Top + { x: width3 - midpoint3, y: -height2 }, + { x: width3 / 2, y: -height2 - 2 * padding3 }, + { x: midpoint3, y: -height2 }, + // Left + { x: 0, y: -height2 }, + { x: 0, y: -2 * height2 / 3 }, + { x: -2 * padding3, y: -height2 / 2 }, + { x: 0, y: -height2 / 3 } + ]; + } + if (directions.has("right") && directions.has("left") && directions.has("up")) { + return [ + { x: midpoint3, y: 0 }, + { x: width3 - midpoint3, y: 0 }, + { x: width3, y: -height2 / 2 }, + { x: width3 - midpoint3, y: -height2 }, + { x: midpoint3, y: -height2 }, + { x: 0, y: -height2 / 2 } + ]; + } + if (directions.has("right") && directions.has("left") && directions.has("down")) { + return [ + { x: 0, y: 0 }, + { x: midpoint3, y: -height2 }, + { x: width3 - midpoint3, y: -height2 }, + { x: width3, y: 0 } + ]; + } + if (directions.has("right") && directions.has("up") && directions.has("down")) { + return [ + { x: 0, y: 0 }, + { x: width3, y: -midpoint3 }, + { x: width3, y: -height2 + midpoint3 }, + { x: 0, y: -height2 } + ]; + } + if (directions.has("left") && directions.has("up") && directions.has("down")) { + return [ + { x: width3, y: 0 }, + { x: 0, y: -midpoint3 }, + { x: 0, y: -height2 + midpoint3 }, + { x: width3, y: -height2 } + ]; + } + if (directions.has("right") && directions.has("left")) { + return [ + { x: midpoint3, y: 0 }, + { x: midpoint3, y: -padding3 }, + { x: width3 - midpoint3, y: -padding3 }, + { x: width3 - midpoint3, y: 0 }, + { x: width3, y: -height2 / 2 }, + { x: width3 - midpoint3, y: -height2 }, + { x: width3 - midpoint3, y: -height2 + padding3 }, + { x: midpoint3, y: -height2 + padding3 }, + { x: midpoint3, y: -height2 }, + { x: 0, y: -height2 / 2 } + ]; + } + if (directions.has("up") && directions.has("down")) { + return [ + // Bottom center + { x: width3 / 2, y: 0 }, + // Left pont of bottom arrow + { x: 0, y: -padding3 }, + { x: midpoint3, y: -padding3 }, + // Left top over vertical section + { x: midpoint3, y: -height2 + padding3 }, + { x: 0, y: -height2 + padding3 }, + // Top of arrow + { x: width3 / 2, y: -height2 }, + { x: width3, y: -height2 + padding3 }, + // Top of right vertical bar + { x: width3 - midpoint3, y: -height2 + padding3 }, + { x: width3 - midpoint3, y: -padding3 }, + { x: width3, y: -padding3 } + ]; + } + if (directions.has("right") && directions.has("up")) { + return [ + { x: 0, y: 0 }, + { x: width3, y: -midpoint3 }, + { x: 0, y: -height2 } + ]; + } + if (directions.has("right") && directions.has("down")) { + return [ + { x: 0, y: 0 }, + { x: width3, y: 0 }, + { x: 0, y: -height2 } + ]; + } + if (directions.has("left") && directions.has("up")) { + return [ + { x: width3, y: 0 }, + { x: 0, y: -midpoint3 }, + { x: width3, y: -height2 } + ]; + } + if (directions.has("left") && directions.has("down")) { + return [ + { x: width3, y: 0 }, + { x: 0, y: 0 }, + { x: width3, y: -height2 } + ]; + } + if (directions.has("right")) { + return [ + { x: midpoint3, y: -padding3 }, + { x: midpoint3, y: -padding3 }, + { x: width3 - midpoint3, y: -padding3 }, + { x: width3 - midpoint3, y: 0 }, + { x: width3, y: -height2 / 2 }, + { x: width3 - midpoint3, y: -height2 }, + { x: width3 - midpoint3, y: -height2 + padding3 }, + // top left corner of arrow + { x: midpoint3, y: -height2 + padding3 }, + { x: midpoint3, y: -height2 + padding3 } + ]; + } + if (directions.has("left")) { + return [ + { x: midpoint3, y: 0 }, + { x: midpoint3, y: -padding3 }, + // Two points, the right corners + { x: width3 - midpoint3, y: -padding3 }, + { x: width3 - midpoint3, y: -height2 + padding3 }, + { x: midpoint3, y: -height2 + padding3 }, + { x: midpoint3, y: -height2 }, + { x: 0, y: -height2 / 2 } + ]; + } + if (directions.has("up")) { + return [ + // Bottom center + { x: midpoint3, y: -padding3 }, + // Left top over vertical section + { x: midpoint3, y: -height2 + padding3 }, + { x: 0, y: -height2 + padding3 }, + // Top of arrow + { x: width3 / 2, y: -height2 }, + { x: width3, y: -height2 + padding3 }, + // Top of right vertical bar + { x: width3 - midpoint3, y: -height2 + padding3 }, + { x: width3 - midpoint3, y: -padding3 } + ]; + } + if (directions.has("down")) { + return [ + // Bottom center + { x: width3 / 2, y: 0 }, + // Left pont of bottom arrow + { x: 0, y: -padding3 }, + { x: midpoint3, y: -padding3 }, + // Left top over vertical section + { x: midpoint3, y: -height2 + padding3 }, + { x: width3 - midpoint3, y: -height2 + padding3 }, + { x: width3 - midpoint3, y: -padding3 }, + { x: width3, y: -padding3 } + ]; + } + return [{ x: 0, y: 0 }]; + }, "getArrowPoints"); } - if (descr === void 0 || descr === null) { - boundary.descr = { text: "" }; - } else { - if (typeof descr === "object") { - let [key, value2] = Object.entries(descr)[0]; - boundary[key] = { text: value2 }; - } else { - boundary.descr = { text: descr }; + }); + + // ../../node_modules/.pnpm/marked@13.0.3/node_modules/marked/lib/marked.esm.js + function _getDefaults() { + return { + async: false, + breaks: false, + extensions: null, + gfm: true, + hooks: null, + pedantic: false, + renderer: null, + silent: false, + tokenizer: null, + walkTokens: null + }; + } + function changeDefaults(newDefaults) { + _defaults = newDefaults; + } + function escape$1(html2, encode) { + if (encode) { + if (escapeTest.test(html2)) { + return html2.replace(escapeReplace, getEscapeReplacement); } - } - if (typeof tags2 === "object") { - let [key, value2] = Object.entries(tags2)[0]; - boundary[key] = value2; - } else { - boundary.tags = tags2; - } - if (typeof link2 === "object") { - let [key, value2] = Object.entries(link2)[0]; - boundary[key] = value2; } else { - boundary.link = link2; - } - boundary.nodeType = nodeType2; - boundary.parentBoundary = currentBoundaryParse; - boundary.wrap = autoWrap$1(); - parentBoundaryParse = currentBoundaryParse; - currentBoundaryParse = alias; - boundaryParseStack.push(parentBoundaryParse); - }; - const popBoundaryParseStack = function() { - currentBoundaryParse = parentBoundaryParse; - boundaryParseStack.pop(); - parentBoundaryParse = boundaryParseStack.pop(); - boundaryParseStack.push(parentBoundaryParse); - }; - const updateElStyle = function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) { - let old = c4ShapeArray.find((element2) => element2.alias === elementName); - if (old === void 0) { - old = boundaries.find((element2) => element2.alias === elementName); - if (old === void 0) { - return; - } - } - if (bgColor !== void 0 && bgColor !== null) { - if (typeof bgColor === "object") { - let [key, value2] = Object.entries(bgColor)[0]; - old[key] = value2; - } else { - old.bgColor = bgColor; - } - } - if (fontColor !== void 0 && fontColor !== null) { - if (typeof fontColor === "object") { - let [key, value2] = Object.entries(fontColor)[0]; - old[key] = value2; - } else { - old.fontColor = fontColor; - } - } - if (borderColor !== void 0 && borderColor !== null) { - if (typeof borderColor === "object") { - let [key, value2] = Object.entries(borderColor)[0]; - old[key] = value2; - } else { - old.borderColor = borderColor; - } - } - if (shadowing !== void 0 && shadowing !== null) { - if (typeof shadowing === "object") { - let [key, value2] = Object.entries(shadowing)[0]; - old[key] = value2; - } else { - old.shadowing = shadowing; - } - } - if (shape !== void 0 && shape !== null) { - if (typeof shape === "object") { - let [key, value2] = Object.entries(shape)[0]; - old[key] = value2; - } else { - old.shape = shape; - } - } - if (sprite !== void 0 && sprite !== null) { - if (typeof sprite === "object") { - let [key, value2] = Object.entries(sprite)[0]; - old[key] = value2; - } else { - old.sprite = sprite; - } - } - if (techn !== void 0 && techn !== null) { - if (typeof techn === "object") { - let [key, value2] = Object.entries(techn)[0]; - old[key] = value2; - } else { - old.techn = techn; + if (escapeTestNoEncode.test(html2)) { + return html2.replace(escapeReplaceNoEncode, getEscapeReplacement); } } - if (legendText !== void 0 && legendText !== null) { - if (typeof legendText === "object") { - let [key, value2] = Object.entries(legendText)[0]; - old[key] = value2; - } else { - old.legendText = legendText; + return html2; + } + function unescape2(html2) { + return html2.replace(unescapeTest, (_2, n2) => { + n2 = n2.toLowerCase(); + if (n2 === "colon") + return ":"; + if (n2.charAt(0) === "#") { + return n2.charAt(1) === "x" ? String.fromCharCode(parseInt(n2.substring(2), 16)) : String.fromCharCode(+n2.substring(1)); } + return ""; + }); + } + function edit(regex, opt) { + let source = typeof regex === "string" ? regex : regex.source; + opt = opt || ""; + const obj = { + replace: /* @__PURE__ */ __name((name, val) => { + let valSource = typeof val === "string" ? val : val.source; + valSource = valSource.replace(caret, "$1"); + source = source.replace(name, valSource); + return obj; + }, "replace"), + getRegex: /* @__PURE__ */ __name(() => { + return new RegExp(source, opt); + }, "getRegex") + }; + return obj; + } + function cleanUrl(href) { + try { + href = encodeURI(href).replace(/%25/g, "%"); + } catch { + return null; } - if (legendSprite !== void 0 && legendSprite !== null) { - if (typeof legendSprite === "object") { - let [key, value2] = Object.entries(legendSprite)[0]; - old[key] = value2; + return href; + } + function splitCells(tableRow, count) { + const row = tableRow.replace(/\|/g, (match2, offset, str2) => { + let escaped = false; + let curr = offset; + while (--curr >= 0 && str2[curr] === "\\") + escaped = !escaped; + if (escaped) { + return "|"; } else { - old.legendSprite = legendSprite; + return " |"; } + }), cells = row.split(/ \|/); + let i2 = 0; + if (!cells[0].trim()) { + cells.shift(); } - }; - const updateRelStyle = function(typeC4Shape, from2, to, textColor, lineColor, offsetX, offsetY) { - const old = rels.find((rel2) => rel2.from === from2 && rel2.to === to); - if (old === void 0) { - return; + if (cells.length > 0 && !cells[cells.length - 1].trim()) { + cells.pop(); } - if (textColor !== void 0 && textColor !== null) { - if (typeof textColor === "object") { - let [key, value2] = Object.entries(textColor)[0]; - old[key] = value2; + if (count) { + if (cells.length > count) { + cells.splice(count); } else { - old.textColor = textColor; + while (cells.length < count) + cells.push(""); } } - if (lineColor !== void 0 && lineColor !== null) { - if (typeof lineColor === "object") { - let [key, value2] = Object.entries(lineColor)[0]; - old[key] = value2; - } else { - old.lineColor = lineColor; - } + for (; i2 < cells.length; i2++) { + cells[i2] = cells[i2].trim().replace(/\\\|/g, "|"); } - if (offsetX !== void 0 && offsetX !== null) { - if (typeof offsetX === "object") { - let [key, value2] = Object.entries(offsetX)[0]; - old[key] = parseInt(value2); - } else { - old.offsetX = parseInt(offsetX); - } + return cells; + } + function rtrim(str2, c3, invert2) { + const l2 = str2.length; + if (l2 === 0) { + return ""; } - if (offsetY !== void 0 && offsetY !== null) { - if (typeof offsetY === "object") { - let [key, value2] = Object.entries(offsetY)[0]; - old[key] = parseInt(value2); + let suffLen = 0; + while (suffLen < l2) { + const currChar = str2.charAt(l2 - suffLen - 1); + if (currChar === c3 && !invert2) { + suffLen++; + } else if (currChar !== c3 && invert2) { + suffLen++; } else { - old.offsetY = parseInt(offsetY); + break; } } - }; - const updateLayoutConfig = function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) { - let c4ShapeInRowValue = c4ShapeInRow$1; - let c4BoundaryInRowValue = c4BoundaryInRow$1; - if (typeof c4ShapeInRowParam === "object") { - const value2 = Object.values(c4ShapeInRowParam)[0]; - c4ShapeInRowValue = parseInt(value2); - } else { - c4ShapeInRowValue = parseInt(c4ShapeInRowParam); - } - if (typeof c4BoundaryInRowParam === "object") { - const value2 = Object.values(c4BoundaryInRowParam)[0]; - c4BoundaryInRowValue = parseInt(value2); - } else { - c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); - } - if (c4ShapeInRowValue >= 1) { - c4ShapeInRow$1 = c4ShapeInRowValue; - } - if (c4BoundaryInRowValue >= 1) { - c4BoundaryInRow$1 = c4BoundaryInRowValue; - } - }; - const getC4ShapeInRow = function() { - return c4ShapeInRow$1; - }; - const getC4BoundaryInRow = function() { - return c4BoundaryInRow$1; - }; - const getCurrentBoundaryParse = function() { - return currentBoundaryParse; - }; - const getParentBoundaryParse = function() { - return parentBoundaryParse; - }; - const getC4ShapeArray = function(parentBoundary) { - if (parentBoundary === void 0 || parentBoundary === null) { - return c4ShapeArray; - } else { - return c4ShapeArray.filter((personOrSystem) => { - return personOrSystem.parentBoundary === parentBoundary; - }); - } - }; - const getC4Shape = function(alias) { - return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias); - }; - const getC4ShapeKeys = function(parentBoundary) { - return Object.keys(getC4ShapeArray(parentBoundary)); - }; - const getBoundaries = function(parentBoundary) { - if (parentBoundary === void 0 || parentBoundary === null) { - return boundaries; - } else { - return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary); + return str2.slice(0, l2 - suffLen); + } + function findClosingBracket(str2, b2) { + if (str2.indexOf(b2[1]) === -1) { + return -1; } - }; - const getBoundarys = getBoundaries; - const getRels = function() { - return rels; - }; - const getTitle = function() { - return title; - }; - const setWrap$1 = function(wrapSetting) { - wrapEnabled = wrapSetting; - }; - const autoWrap$1 = function() { - return wrapEnabled; - }; - const clear$m = function() { - c4ShapeArray = []; - boundaries = [ - { - alias: "global", - label: { text: "global" }, - type: { text: "global" }, - tags: null, - link: null, - parentBoundary: "" - } - ]; - parentBoundaryParse = ""; - currentBoundaryParse = "global"; - boundaryParseStack = [""]; - rels = []; - boundaryParseStack = [""]; - title = ""; - wrapEnabled = false; - c4ShapeInRow$1 = 4; - c4BoundaryInRow$1 = 2; - }; - const LINETYPE$1 = { - SOLID: 0, - DOTTED: 1, - NOTE: 2, - SOLID_CROSS: 3, - DOTTED_CROSS: 4, - SOLID_OPEN: 5, - DOTTED_OPEN: 6, - LOOP_START: 10, - LOOP_END: 11, - ALT_START: 12, - ALT_ELSE: 13, - ALT_END: 14, - OPT_START: 15, - OPT_END: 16, - ACTIVE_START: 17, - ACTIVE_END: 18, - PAR_START: 19, - PAR_AND: 20, - PAR_END: 21, - RECT_START: 22, - RECT_END: 23, - SOLID_POINT: 24, - DOTTED_POINT: 25 - }; - const ARROWTYPE$1 = { - FILLED: 0, - OPEN: 1 - }; - const PLACEMENT$1 = { - LEFTOF: 0, - RIGHTOF: 1, - OVER: 2 - }; - const setTitle = function(txt) { - let sanitizedText = sanitizeText$6(txt, getConfig$1()); - title = sanitizedText; - }; - const db$g = { - addPersonOrSystem, - addPersonOrSystemBoundary, - addContainer, - addContainerBoundary, - addComponent, - addDeploymentNode, - popBoundaryParseStack, - addRel, - updateElStyle, - updateRelStyle, - updateLayoutConfig, - autoWrap: autoWrap$1, - setWrap: setWrap$1, - getC4ShapeArray, - getC4Shape, - getC4ShapeKeys, - getBoundaries, - getBoundarys, - getCurrentBoundaryParse, - getParentBoundaryParse, - getRels, - getTitle, - getC4Type, - getC4ShapeInRow, - getC4BoundaryInRow, - setAccTitle, - getAccTitle, - getAccDescription, - setAccDescription, - getConfig: () => getConfig$1().c4, - clear: clear$m, - LINETYPE: LINETYPE$1, - ARROWTYPE: ARROWTYPE$1, - PLACEMENT: PLACEMENT$1, - setTitle, - setC4Type - // apply, - }; - const drawRect$4 = (element2, rectData) => { - const rectElement = element2.append("rect"); - rectElement.attr("x", rectData.x); - rectElement.attr("y", rectData.y); - rectElement.attr("fill", rectData.fill); - rectElement.attr("stroke", rectData.stroke); - rectElement.attr("width", rectData.width); - rectElement.attr("height", rectData.height); - if (rectData.name) { - rectElement.attr("name", rectData.name); - } - rectData.rx !== void 0 && rectElement.attr("rx", rectData.rx); - rectData.ry !== void 0 && rectElement.attr("ry", rectData.ry); - if (rectData.attrs !== void 0) { - for (const attrKey in rectData.attrs) { - rectElement.attr(attrKey, rectData.attrs[attrKey]); - } - } - rectData.class !== void 0 && rectElement.attr("class", rectData.class); - return rectElement; - }; - const drawBackgroundRect$3 = (element2, bounds2) => { - const rectData = { - x: bounds2.startx, - y: bounds2.starty, - width: bounds2.stopx - bounds2.startx, - height: bounds2.stopy - bounds2.starty, - fill: bounds2.fill, - stroke: bounds2.stroke, - class: "rect" - }; - const rectElement = drawRect$4(element2, rectData); - rectElement.lower(); - }; - const drawText$4 = (element2, textData) => { - const nText = textData.text.replace(lineBreakRegex, " "); - const textElem = element2.append("text"); - textElem.attr("x", textData.x); - textElem.attr("y", textData.y); - textElem.attr("class", "legend"); - textElem.style("text-anchor", textData.anchor); - textData.class !== void 0 && textElem.attr("class", textData.class); - const tspan = textElem.append("tspan"); - tspan.attr("x", textData.x + textData.textMargin * 2); - tspan.text(nText); - return textElem; - }; - const drawImage$1 = (elem, x2, y2, link2) => { - const imageElement = elem.append("image"); - imageElement.attr("x", x2); - imageElement.attr("y", y2); - const sanitizedLink = dist.sanitizeUrl(link2); - imageElement.attr("xlink:href", sanitizedLink); - }; - const drawEmbeddedImage = (element2, x2, y2, link2) => { - const imageElement = element2.append("use"); - imageElement.attr("x", x2); - imageElement.attr("y", y2); - const sanitizedLink = dist.sanitizeUrl(link2); - imageElement.attr("xlink:href", `#${sanitizedLink}`); - }; - const getNoteRect$2 = () => { - const noteRectData = { - x: 0, - y: 0, - width: 100, - height: 100, - fill: "#EDF2AE", - stroke: "#666", - anchor: "start", - rx: 0, - ry: 0 - }; - return noteRectData; - }; - const getTextObj$2 = () => { - const testObject = { - x: 0, - y: 0, - width: 100, - height: 100, - "text-anchor": "start", - style: "#666", - textMargin: 0, - rx: 0, - ry: 0, - tspan: true - }; - return testObject; - }; - const drawRect$3 = function(elem, rectData) { - return drawRect$4(elem, rectData); - }; - const drawImage = function(elem, width2, height, x2, y2, link2) { - const imageElem = elem.append("image"); - imageElem.attr("width", width2); - imageElem.attr("height", height); - imageElem.attr("x", x2); - imageElem.attr("y", y2); - let sanitizedLink = link2.startsWith("data:image/png;base64") ? link2 : dist.sanitizeUrl(link2); - imageElem.attr("xlink:href", sanitizedLink); - }; - const drawRels$1 = (elem, rels2, conf2) => { - const relsElem = elem.append("g"); - let i2 = 0; - for (let rel2 of rels2) { - let textColor = rel2.textColor ? rel2.textColor : "#444444"; - let strokeColor = rel2.lineColor ? rel2.lineColor : "#444444"; - let offsetX = rel2.offsetX ? parseInt(rel2.offsetX) : 0; - let offsetY = rel2.offsetY ? parseInt(rel2.offsetY) : 0; - let url = ""; - if (i2 === 0) { - let line2 = relsElem.append("line"); - line2.attr("x1", rel2.startPoint.x); - line2.attr("y1", rel2.startPoint.y); - line2.attr("x2", rel2.endPoint.x); - line2.attr("y2", rel2.endPoint.y); - line2.attr("stroke-width", "1"); - line2.attr("stroke", strokeColor); - line2.style("fill", "none"); - if (rel2.type !== "rel_b") { - line2.attr("marker-end", "url(" + url + "#arrowhead)"); - } - if (rel2.type === "birel" || rel2.type === "rel_b") { - line2.attr("marker-start", "url(" + url + "#arrowend)"); - } - i2 = -1; - } else { - let line2 = relsElem.append("path"); - line2.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr( - "d", - "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel2.startPoint.x).replaceAll("starty", rel2.startPoint.y).replaceAll( - "controlx", - rel2.startPoint.x + (rel2.endPoint.x - rel2.startPoint.x) / 2 - (rel2.endPoint.x - rel2.startPoint.x) / 4 - ).replaceAll("controly", rel2.startPoint.y + (rel2.endPoint.y - rel2.startPoint.y) / 2).replaceAll("stopx", rel2.endPoint.x).replaceAll("stopy", rel2.endPoint.y) - ); - if (rel2.type !== "rel_b") { - line2.attr("marker-end", "url(" + url + "#arrowhead)"); - } - if (rel2.type === "birel" || rel2.type === "rel_b") { - line2.attr("marker-start", "url(" + url + "#arrowend)"); + let level = 0; + for (let i2 = 0; i2 < str2.length; i2++) { + if (str2[i2] === "\\") { + i2++; + } else if (str2[i2] === b2[0]) { + level++; + } else if (str2[i2] === b2[1]) { + level--; + if (level < 0) { + return i2; } } - let messageConf = conf2.messageFont(); - _drawTextCandidateFunc$3(conf2)( - rel2.label.text, - relsElem, - Math.min(rel2.startPoint.x, rel2.endPoint.x) + Math.abs(rel2.endPoint.x - rel2.startPoint.x) / 2 + offsetX, - Math.min(rel2.startPoint.y, rel2.endPoint.y) + Math.abs(rel2.endPoint.y - rel2.startPoint.y) / 2 + offsetY, - rel2.label.width, - rel2.label.height, - { fill: textColor }, - messageConf - ); - if (rel2.techn && rel2.techn.text !== "") { - messageConf = conf2.messageFont(); - _drawTextCandidateFunc$3(conf2)( - "[" + rel2.techn.text + "]", - relsElem, - Math.min(rel2.startPoint.x, rel2.endPoint.x) + Math.abs(rel2.endPoint.x - rel2.startPoint.x) / 2 + offsetX, - Math.min(rel2.startPoint.y, rel2.endPoint.y) + Math.abs(rel2.endPoint.y - rel2.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY, - Math.max(rel2.label.width, rel2.techn.width), - rel2.techn.height, - { fill: textColor, "font-style": "italic" }, - messageConf - ); - } - } - }; - const drawBoundary$1 = function(elem, boundary, conf2) { - const boundaryElem = elem.append("g"); - let fillColor = boundary.bgColor ? boundary.bgColor : "none"; - let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444"; - let fontColor = boundary.fontColor ? boundary.fontColor : "black"; - let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" }; - if (boundary.nodeType) { - attrsValue = { "stroke-width": 1 }; - } - let rectData = { - x: boundary.x, - y: boundary.y, - fill: fillColor, - stroke: strokeColor, - width: boundary.width, - height: boundary.height, - rx: 2.5, - ry: 2.5, - attrs: attrsValue - }; - drawRect$3(boundaryElem, rectData); - let boundaryConf = conf2.boundaryFont(); - boundaryConf.fontWeight = "bold"; - boundaryConf.fontSize = boundaryConf.fontSize + 2; - boundaryConf.fontColor = fontColor; - _drawTextCandidateFunc$3(conf2)( - boundary.label.text, - boundaryElem, - boundary.x, - boundary.y + boundary.label.Y, - boundary.width, - boundary.height, - { fill: "#444444" }, - boundaryConf - ); - if (boundary.type && boundary.type.text !== "") { - boundaryConf = conf2.boundaryFont(); - boundaryConf.fontColor = fontColor; - _drawTextCandidateFunc$3(conf2)( - boundary.type.text, - boundaryElem, - boundary.x, - boundary.y + boundary.type.Y, - boundary.width, - boundary.height, - { fill: "#444444" }, - boundaryConf - ); - } - if (boundary.descr && boundary.descr.text !== "") { - boundaryConf = conf2.boundaryFont(); - boundaryConf.fontSize = boundaryConf.fontSize - 2; - boundaryConf.fontColor = fontColor; - _drawTextCandidateFunc$3(conf2)( - boundary.descr.text, - boundaryElem, - boundary.x, - boundary.y + boundary.descr.Y, - boundary.width, - boundary.height, - { fill: "#444444" }, - boundaryConf - ); - } - }; - const drawC4Shape = function(elem, c4Shape, conf2) { - var _a2; - let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"]; - let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"]; - let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF"; - let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; - switch (c4Shape.typeC4Shape.text) { - case "person": - personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; - break; - case "external_person": - personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="; - break; - } - const c4ShapeElem = elem.append("g"); - c4ShapeElem.attr("class", "person-man"); - const rect2 = getNoteRect$2(); - switch (c4Shape.typeC4Shape.text) { - case "person": - case "external_person": - case "system": - case "external_system": - case "container": - case "external_container": - case "component": - case "external_component": - rect2.x = c4Shape.x; - rect2.y = c4Shape.y; - rect2.fill = fillColor; - rect2.width = c4Shape.width; - rect2.height = c4Shape.height; - rect2.stroke = strokeColor; - rect2.rx = 2.5; - rect2.ry = 2.5; - rect2.attrs = { "stroke-width": 0.5 }; - drawRect$3(c4ShapeElem, rect2); - break; - case "system_db": - case "external_system_db": - case "container_db": - case "external_container_db": - case "component_db": - case "external_component_db": - c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( - "d", - "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height) - ); - c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( - "d", - "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2) - ); - break; - case "system_queue": - case "external_system_queue": - case "container_queue": - case "external_container_queue": - case "component_queue": - case "external_component_queue": - c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( - "d", - "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2) - ); - c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr( - "d", - "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2) - ); - break; - } - let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text); - c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>"); - switch (c4Shape.typeC4Shape.text) { - case "person": - case "external_person": - drawImage( - c4ShapeElem, - 48, - 48, - c4Shape.x + c4Shape.width / 2 - 24, - c4Shape.y + c4Shape.image.Y, - personImg - ); - break; - } - let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"](); - textFontConf.fontWeight = "bold"; - textFontConf.fontSize = textFontConf.fontSize + 2; - textFontConf.fontColor = fontColor; - _drawTextCandidateFunc$3(conf2)( - c4Shape.label.text, - c4ShapeElem, - c4Shape.x, - c4Shape.y + c4Shape.label.Y, - c4Shape.width, - c4Shape.height, - { fill: fontColor }, - textFontConf - ); - textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"](); - textFontConf.fontColor = fontColor; - if (c4Shape.techn && ((_a2 = c4Shape.techn) == null ? void 0 : _a2.text) !== "") { - _drawTextCandidateFunc$3(conf2)( - c4Shape.techn.text, - c4ShapeElem, - c4Shape.x, - c4Shape.y + c4Shape.techn.Y, - c4Shape.width, - c4Shape.height, - { fill: fontColor, "font-style": "italic" }, - textFontConf - ); - } else if (c4Shape.type && c4Shape.type.text !== "") { - _drawTextCandidateFunc$3(conf2)( - c4Shape.type.text, - c4ShapeElem, - c4Shape.x, - c4Shape.y + c4Shape.type.Y, - c4Shape.width, - c4Shape.height, - { fill: fontColor, "font-style": "italic" }, - textFontConf - ); - } - if (c4Shape.descr && c4Shape.descr.text !== "") { - textFontConf = conf2.personFont(); - textFontConf.fontColor = fontColor; - _drawTextCandidateFunc$3(conf2)( - c4Shape.descr.text, - c4ShapeElem, - c4Shape.x, - c4Shape.y + c4Shape.descr.Y, - c4Shape.width, - c4Shape.height, - { fill: fontColor }, - textFontConf - ); } - return c4Shape.height; - }; - const insertDatabaseIcon$1 = function(elem) { - elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr( - "d", - "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z" - ); - }; - const insertComputerIcon$1 = function(elem) { - elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( - "d", - "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z" - ); - }; - const insertClockIcon$1 = function(elem) { - elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( - "d", - "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z" - ); - }; - const insertArrowHead$1 = function(elem) { - elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z"); - }; - const insertArrowEnd = function(elem) { - elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z"); - }; - const insertArrowFilledHead$1 = function(elem) { - elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); - }; - const insertDynamicNumber = function(elem) { - elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6); - }; - const insertArrowCrossHead$1 = function(elem) { - const defs = elem.append("defs"); - const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4); - marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z"); - marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7"); - }; - const getC4ShapeFont = (cnf, typeC4Shape) => { - return { - fontFamily: cnf[typeC4Shape + "FontFamily"], - fontSize: cnf[typeC4Shape + "FontSize"], - fontWeight: cnf[typeC4Shape + "FontWeight"] - }; - }; - const _drawTextCandidateFunc$3 = function() { - function byText(content2, g, x2, y2, width2, height, textAttrs) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height / 2 + 5).style("text-anchor", "middle").text(content2); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const { fontSize, fontFamily, fontWeight } = conf2; - const lines = content2.split(common$1.lineBreakRegex); - for (let i2 = 0; i2 < lines.length; i2++) { - const dy = i2 * fontSize - fontSize * (lines.length - 1) / 2; - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily); - text2.append("tspan").attr("dy", dy).text(lines[i2]).attr("alignment-baseline", "mathematical"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const s = g.append("switch"); - const f2 = s.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height); - const text2 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); - text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content2); - byTspan(content2, s, x2, y2, width2, height, textAttrs, conf2); - _setTextAttrs(text2, textAttrs); - } - function _setTextAttrs(toText, fromTextAttrsDict) { - for (const key in fromTextAttrsDict) { - if (fromTextAttrsDict.hasOwnProperty(key)) { - toText.attr(key, fromTextAttrsDict[key]); - } - } - } - return function(conf2) { - return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; - }; - }(); - const svgDraw$4 = { - drawRect: drawRect$3, - drawBoundary: drawBoundary$1, - drawC4Shape, - drawRels: drawRels$1, - drawImage, - insertArrowHead: insertArrowHead$1, - insertArrowEnd, - insertArrowFilledHead: insertArrowFilledHead$1, - insertDynamicNumber, - insertArrowCrossHead: insertArrowCrossHead$1, - insertDatabaseIcon: insertDatabaseIcon$1, - insertComputerIcon: insertComputerIcon$1, - insertClockIcon: insertClockIcon$1 - }; - let globalBoundaryMaxX = 0, globalBoundaryMaxY = 0; - let c4ShapeInRow = 4; - let c4BoundaryInRow = 2; - parser$v.yy = db$g; - let conf$9 = {}; - class Bounds { - constructor(diagObj) { - this.name = ""; - this.data = {}; - this.data.startx = void 0; - this.data.stopx = void 0; - this.data.starty = void 0; - this.data.stopy = void 0; - this.data.widthLimit = void 0; - this.nextData = {}; - this.nextData.startx = void 0; - this.nextData.stopx = void 0; - this.nextData.starty = void 0; - this.nextData.stopy = void 0; - this.nextData.cnt = 0; - setConf$9(diagObj.db.getConfig()); - } - setData(startx, stopx, starty, stopy) { - this.nextData.startx = this.data.startx = startx; - this.nextData.stopx = this.data.stopx = stopx; - this.nextData.starty = this.data.starty = starty; - this.nextData.stopy = this.data.stopy = stopy; - } - updateVal(obj, key, val, fun) { - if (obj[key] === void 0) { - obj[key] = val; - } else { - obj[key] = fun(val, obj[key]); - } - } - insert(c4Shape) { - this.nextData.cnt = this.nextData.cnt + 1; - let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2; - let _stopx = _startx + c4Shape.width; - let _starty = this.nextData.starty + c4Shape.margin * 2; - let _stopy = _starty + c4Shape.height; - if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow) { - _startx = this.nextData.startx + c4Shape.margin + conf$9.nextLinePaddingX; - _starty = this.nextData.stopy + c4Shape.margin * 2; - this.nextData.stopx = _stopx = _startx + c4Shape.width; - this.nextData.starty = this.nextData.stopy; - this.nextData.stopy = _stopy = _starty + c4Shape.height; - this.nextData.cnt = 1; - } - c4Shape.x = _startx; - c4Shape.y = _starty; - this.updateVal(this.data, "startx", _startx, Math.min); - this.updateVal(this.data, "starty", _starty, Math.min); - this.updateVal(this.data, "stopx", _stopx, Math.max); - this.updateVal(this.data, "stopy", _stopy, Math.max); - this.updateVal(this.nextData, "startx", _startx, Math.min); - this.updateVal(this.nextData, "starty", _starty, Math.min); - this.updateVal(this.nextData, "stopx", _stopx, Math.max); - this.updateVal(this.nextData, "stopy", _stopy, Math.max); - } - init(diagObj) { - this.name = ""; - this.data = { - startx: void 0, - stopx: void 0, - starty: void 0, - stopy: void 0, - widthLimit: void 0 - }; - this.nextData = { - startx: void 0, - stopx: void 0, - starty: void 0, - stopy: void 0, - cnt: 0 - }; - setConf$9(diagObj.db.getConfig()); - } - bumpLastMargin(margin) { - this.data.stopx += margin; - this.data.stopy += margin; - } - } - const setConf$9 = function(cnf) { - assignWithDepth$1(conf$9, cnf); - if (cnf.fontFamily) { - conf$9.personFontFamily = conf$9.systemFontFamily = conf$9.messageFontFamily = cnf.fontFamily; - } - if (cnf.fontSize) { - conf$9.personFontSize = conf$9.systemFontSize = conf$9.messageFontSize = cnf.fontSize; - } - if (cnf.fontWeight) { - conf$9.personFontWeight = conf$9.systemFontWeight = conf$9.messageFontWeight = cnf.fontWeight; + return -1; + } + function outputLink(cap, link3, raw, lexer2) { + const href = link3.href; + const title2 = link3.title ? escape$1(link3.title) : null; + const text2 = cap[1].replace(/\\([\[\]])/g, "$1"); + if (cap[0].charAt(0) !== "!") { + lexer2.state.inLink = true; + const token2 = { + type: "link", + raw, + href, + title: title2, + text: text2, + tokens: lexer2.inlineTokens(text2) + }; + lexer2.state.inLink = false; + return token2; } - }; - const c4ShapeFont = (cnf, typeC4Shape) => { return { - fontFamily: cnf[typeC4Shape + "FontFamily"], - fontSize: cnf[typeC4Shape + "FontSize"], - fontWeight: cnf[typeC4Shape + "FontWeight"] + type: "image", + raw, + href, + title: title2, + text: escape$1(text2) }; - }; - const boundaryFont = (cnf) => { - return { - fontFamily: cnf.boundaryFontFamily, - fontSize: cnf.boundaryFontSize, - fontWeight: cnf.boundaryFontWeight - }; - }; - const messageFont$1 = (cnf) => { - return { - fontFamily: cnf.messageFontFamily, - fontSize: cnf.messageFontSize, - fontWeight: cnf.messageFontWeight - }; - }; - function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) { - if (!c4Shape[textType].width) { - if (c4ShapeTextWrap) { - c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf); - c4Shape[textType].textLines = c4Shape[textType].text.split(common$1.lineBreakRegex).length; - c4Shape[textType].width = textLimitWidth; - c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf); - } else { - let lines = c4Shape[textType].text.split(common$1.lineBreakRegex); - c4Shape[textType].textLines = lines.length; - let lineHeight = 0; - c4Shape[textType].height = 0; - c4Shape[textType].width = 0; - for (const line2 of lines) { - c4Shape[textType].width = Math.max( - calculateTextWidth(line2, textConf), - c4Shape[textType].width - ); - lineHeight = calculateTextHeight(line2, textConf); - c4Shape[textType].height = c4Shape[textType].height + lineHeight; - } - } - } } - const drawBoundary = function(diagram2, boundary, bounds2) { - boundary.x = bounds2.data.startx; - boundary.y = bounds2.data.starty; - boundary.width = bounds2.data.stopx - bounds2.data.startx; - boundary.height = bounds2.data.stopy - bounds2.data.starty; - boundary.label.y = conf$9.c4ShapeMargin - 35; - let boundaryTextWrap = boundary.wrap && conf$9.wrap; - let boundaryLabelConf = boundaryFont(conf$9); - boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2; - boundaryLabelConf.fontWeight = "bold"; - let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf); - calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth); - svgDraw$4.drawBoundary(diagram2, boundary, conf$9); - }; - const drawC4ShapeArray = function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) { - let Y = 0; - for (const c4ShapeKey of c4ShapeKeys) { - Y = 0; - const c4Shape = c4ShapeArray2[c4ShapeKey]; - let c4ShapeTypeConf = c4ShapeFont(conf$9, c4Shape.typeC4Shape.text); - c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2; - c4Shape.typeC4Shape.width = calculateTextWidth( - "«" + c4Shape.typeC4Shape.text + "»", - c4ShapeTypeConf - ); - c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2; - c4Shape.typeC4Shape.Y = conf$9.c4ShapePadding; - Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4; - c4Shape.image = { width: 0, height: 0, Y: 0 }; - switch (c4Shape.typeC4Shape.text) { - case "person": - case "external_person": - c4Shape.image.width = 48; - c4Shape.image.height = 48; - c4Shape.image.Y = Y; - Y = c4Shape.image.Y + c4Shape.image.height; - break; - } - if (c4Shape.sprite) { - c4Shape.image.width = 48; - c4Shape.image.height = 48; - c4Shape.image.Y = Y; - Y = c4Shape.image.Y + c4Shape.image.height; - } - let c4ShapeTextWrap = c4Shape.wrap && conf$9.wrap; - let textLimitWidth = conf$9.width - conf$9.c4ShapePadding * 2; - let c4ShapeLabelConf = c4ShapeFont(conf$9, c4Shape.typeC4Shape.text); - c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2; - c4ShapeLabelConf.fontWeight = "bold"; - calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth); - c4Shape["label"].Y = Y + 8; - Y = c4Shape["label"].Y + c4Shape["label"].height; - if (c4Shape.type && c4Shape.type.text !== "") { - c4Shape.type.text = "[" + c4Shape.type.text + "]"; - let c4ShapeTypeConf2 = c4ShapeFont(conf$9, c4Shape.typeC4Shape.text); - calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth); - c4Shape["type"].Y = Y + 5; - Y = c4Shape["type"].Y + c4Shape["type"].height; - } else if (c4Shape.techn && c4Shape.techn.text !== "") { - c4Shape.techn.text = "[" + c4Shape.techn.text + "]"; - let c4ShapeTechnConf = c4ShapeFont(conf$9, c4Shape.techn.text); - calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth); - c4Shape["techn"].Y = Y + 5; - Y = c4Shape["techn"].Y + c4Shape["techn"].height; - } - let rectHeight = Y; - let rectWidth = c4Shape.label.width; - if (c4Shape.descr && c4Shape.descr.text !== "") { - let c4ShapeDescrConf = c4ShapeFont(conf$9, c4Shape.typeC4Shape.text); - calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth); - c4Shape["descr"].Y = Y + 20; - Y = c4Shape["descr"].Y + c4Shape["descr"].height; - rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width); - rectHeight = Y - c4Shape["descr"].textLines * 5; - } - rectWidth = rectWidth + conf$9.c4ShapePadding; - c4Shape.width = Math.max(c4Shape.width || conf$9.width, rectWidth, conf$9.width); - c4Shape.height = Math.max(c4Shape.height || conf$9.height, rectHeight, conf$9.height); - c4Shape.margin = c4Shape.margin || conf$9.c4ShapeMargin; - currentBounds.insert(c4Shape); - svgDraw$4.drawC4Shape(diagram2, c4Shape, conf$9); - } - currentBounds.bumpLastMargin(conf$9.c4ShapeMargin); - }; - let Point$1 = class Point { - constructor(x2, y2) { - this.x = x2; - this.y = y2; - } - }; - let getIntersectPoint = function(fromNode, endPoint) { - let x1 = fromNode.x; - let y1 = fromNode.y; - let x2 = endPoint.x; - let y2 = endPoint.y; - let fromCenterX = x1 + fromNode.width / 2; - let fromCenterY = y1 + fromNode.height / 2; - let dx = Math.abs(x1 - x2); - let dy = Math.abs(y1 - y2); - let tanDYX = dy / dx; - let fromDYX = fromNode.height / fromNode.width; - let returnPoint = null; - if (y1 == y2 && x1 < x2) { - returnPoint = new Point$1(x1 + fromNode.width, fromCenterY); - } else if (y1 == y2 && x1 > x2) { - returnPoint = new Point$1(x1, fromCenterY); - } else if (x1 == x2 && y1 < y2) { - returnPoint = new Point$1(fromCenterX, y1 + fromNode.height); - } else if (x1 == x2 && y1 > y2) { - returnPoint = new Point$1(fromCenterX, y1); - } - if (x1 > x2 && y1 < y2) { - if (fromDYX >= tanDYX) { - returnPoint = new Point$1(x1, fromCenterY + tanDYX * fromNode.width / 2); - } else { - returnPoint = new Point$1( - fromCenterX - dx / dy * fromNode.height / 2, - y1 + fromNode.height - ); - } - } else if (x1 < x2 && y1 < y2) { - if (fromDYX >= tanDYX) { - returnPoint = new Point$1(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2); - } else { - returnPoint = new Point$1( - fromCenterX + dx / dy * fromNode.height / 2, - y1 + fromNode.height - ); - } - } else if (x1 < x2 && y1 > y2) { - if (fromDYX >= tanDYX) { - returnPoint = new Point$1(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2); - } else { - returnPoint = new Point$1(fromCenterX + fromNode.height / 2 * dx / dy, y1); - } - } else if (x1 > x2 && y1 > y2) { - if (fromDYX >= tanDYX) { - returnPoint = new Point$1(x1, fromCenterY - fromNode.width / 2 * tanDYX); - } else { - returnPoint = new Point$1(fromCenterX - fromNode.height / 2 * dx / dy, y1); - } + function indentCodeCompensation(raw, text2) { + const matchIndentToCode = raw.match(/^(\s+)(?:```)/); + if (matchIndentToCode === null) { + return text2; } - return returnPoint; - }; - let getIntersectPoints = function(fromNode, endNode) { - let endIntersectPoint = { x: 0, y: 0 }; - endIntersectPoint.x = endNode.x + endNode.width / 2; - endIntersectPoint.y = endNode.y + endNode.height / 2; - let startPoint = getIntersectPoint(fromNode, endIntersectPoint); - endIntersectPoint.x = fromNode.x + fromNode.width / 2; - endIntersectPoint.y = fromNode.y + fromNode.height / 2; - let endPoint = getIntersectPoint(endNode, endIntersectPoint); - return { startPoint, endPoint }; - }; - const drawRels = function(diagram2, rels2, getC4ShapeObj, diagObj) { - let i2 = 0; - for (let rel2 of rels2) { - i2 = i2 + 1; - let relTextWrap = rel2.wrap && conf$9.wrap; - let relConf = messageFont$1(conf$9); - let diagramType = diagObj.db.getC4Type(); - if (diagramType === "C4Dynamic") { - rel2.label.text = i2 + ": " + rel2.label.text; - } - let textLimitWidth = calculateTextWidth(rel2.label.text, relConf); - calcC4ShapeTextWH("label", rel2, relTextWrap, relConf, textLimitWidth); - if (rel2.techn && rel2.techn.text !== "") { - textLimitWidth = calculateTextWidth(rel2.techn.text, relConf); - calcC4ShapeTextWH("techn", rel2, relTextWrap, relConf, textLimitWidth); - } - if (rel2.descr && rel2.descr.text !== "") { - textLimitWidth = calculateTextWidth(rel2.descr.text, relConf); - calcC4ShapeTextWH("descr", rel2, relTextWrap, relConf, textLimitWidth); - } - let fromNode = getC4ShapeObj(rel2.from); - let endNode = getC4ShapeObj(rel2.to); - let points = getIntersectPoints(fromNode, endNode); - rel2.startPoint = points.startPoint; - rel2.endPoint = points.endPoint; - } - svgDraw$4.drawRels(diagram2, rels2, conf$9); - }; - function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) { - let currentBounds = new Bounds(diagObj); - currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundaries.length); - for (let [i2, currentBoundary] of currentBoundaries.entries()) { - let Y = 0; - currentBoundary.image = { width: 0, height: 0, Y: 0 }; - if (currentBoundary.sprite) { - currentBoundary.image.width = 48; - currentBoundary.image.height = 48; - currentBoundary.image.Y = Y; - Y = currentBoundary.image.Y + currentBoundary.image.height; - } - let currentBoundaryTextWrap = currentBoundary.wrap && conf$9.wrap; - let currentBoundaryLabelConf = boundaryFont(conf$9); - currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2; - currentBoundaryLabelConf.fontWeight = "bold"; - calcC4ShapeTextWH( - "label", - currentBoundary, - currentBoundaryTextWrap, - currentBoundaryLabelConf, - currentBounds.data.widthLimit - ); - currentBoundary["label"].Y = Y + 8; - Y = currentBoundary["label"].Y + currentBoundary["label"].height; - if (currentBoundary.type && currentBoundary.type.text !== "") { - currentBoundary.type.text = "[" + currentBoundary.type.text + "]"; - let currentBoundaryTypeConf = boundaryFont(conf$9); - calcC4ShapeTextWH( - "type", - currentBoundary, - currentBoundaryTextWrap, - currentBoundaryTypeConf, - currentBounds.data.widthLimit - ); - currentBoundary["type"].Y = Y + 5; - Y = currentBoundary["type"].Y + currentBoundary["type"].height; - } - if (currentBoundary.descr && currentBoundary.descr.text !== "") { - let currentBoundaryDescrConf = boundaryFont(conf$9); - currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2; - calcC4ShapeTextWH( - "descr", - currentBoundary, - currentBoundaryTextWrap, - currentBoundaryDescrConf, - currentBounds.data.widthLimit - ); - currentBoundary["descr"].Y = Y + 20; - Y = currentBoundary["descr"].Y + currentBoundary["descr"].height; - } - if (i2 == 0 || i2 % c4BoundaryInRow === 0) { - let _x = parentBounds.data.startx + conf$9.diagramMarginX; - let _y = parentBounds.data.stopy + conf$9.diagramMarginY + Y; - currentBounds.setData(_x, _x, _y, _y); - } else { - let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf$9.diagramMarginX : currentBounds.data.startx; - let _y = currentBounds.data.starty; - currentBounds.setData(_x, _x, _y, _y); - } - currentBounds.name = currentBoundary.alias; - let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias); - let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias); - if (currentPersonOrSystemKeys.length > 0) { - drawC4ShapeArray( - currentBounds, - diagram2, - currentPersonOrSystemArray, - currentPersonOrSystemKeys - ); - } - parentBoundaryAlias = currentBoundary.alias; - let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias); - if (nextCurrentBoundaries.length > 0) { - drawInsideBoundary( - diagram2, - parentBoundaryAlias, - currentBounds, - nextCurrentBoundaries, - diagObj - ); + const indentToCode = matchIndentToCode[1]; + return text2.split("\n").map((node2) => { + const matchIndentInNode = node2.match(/^\s+/); + if (matchIndentInNode === null) { + return node2; } - if (currentBoundary.alias !== "global") { - drawBoundary(diagram2, currentBoundary, currentBounds); + const [indentInNode] = matchIndentInNode; + if (indentInNode.length >= indentToCode.length) { + return node2.slice(indentToCode.length); } - parentBounds.data.stopy = Math.max( - currentBounds.data.stopy + conf$9.c4ShapeMargin, - parentBounds.data.stopy - ); - parentBounds.data.stopx = Math.max( - currentBounds.data.stopx + conf$9.c4ShapeMargin, - parentBounds.data.stopx - ); - globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx); - globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy); - } - } - const draw$l = function(_text, id2, _version, diagObj) { - conf$9 = getConfig$1().c4; - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - let db2 = diagObj.db; - diagObj.db.setWrap(conf$9.wrap); - c4ShapeInRow = db2.getC4ShapeInRow(); - c4BoundaryInRow = db2.getC4BoundaryInRow(); - log$1.debug(`C:${JSON.stringify(conf$9, null, 2)}`); - const diagram2 = securityLevel === "sandbox" ? root2.select(`[id="${id2}"]`) : d3select(`[id="${id2}"]`); - svgDraw$4.insertComputerIcon(diagram2); - svgDraw$4.insertDatabaseIcon(diagram2); - svgDraw$4.insertClockIcon(diagram2); - let screenBounds = new Bounds(diagObj); - screenBounds.setData( - conf$9.diagramMarginX, - conf$9.diagramMarginX, - conf$9.diagramMarginY, - conf$9.diagramMarginY - ); - screenBounds.data.widthLimit = screen.availWidth; - globalBoundaryMaxX = conf$9.diagramMarginX; - globalBoundaryMaxY = conf$9.diagramMarginY; - const title2 = diagObj.db.getTitle(); - let currentBoundaries = diagObj.db.getBoundarys(""); - drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj); - svgDraw$4.insertArrowHead(diagram2); - svgDraw$4.insertArrowEnd(diagram2); - svgDraw$4.insertArrowCrossHead(diagram2); - svgDraw$4.insertArrowFilledHead(diagram2); - drawRels(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj); - screenBounds.data.stopx = globalBoundaryMaxX; - screenBounds.data.stopy = globalBoundaryMaxY; - const box = screenBounds.data; - let boxHeight = box.stopy - box.starty; - let height = boxHeight + 2 * conf$9.diagramMarginY; - let boxWidth = box.stopx - box.startx; - const width2 = boxWidth + 2 * conf$9.diagramMarginX; - if (title2) { - diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf$9.diagramMarginX).attr("y", box.starty + conf$9.diagramMarginY); - } - configureSvgSize(diagram2, height, width2, conf$9.useMaxWidth); - const extraVertForTitle = title2 ? 60 : 0; - diagram2.attr( - "viewBox", - box.startx - conf$9.diagramMarginX + " -" + (conf$9.diagramMarginY + extraVertForTitle) + " " + width2 + " " + (height + extraVertForTitle) - ); - log$1.debug(`models:`, box); - }; - const renderer$g = { - drawPersonOrSystemArray: drawC4ShapeArray, - drawBoundary, - setConf: setConf$9, - draw: draw$l - }; - const getStyles$e = (options2) => `.person { - stroke: ${options2.personBorder}; - fill: ${options2.personBkg}; - } -`; - const styles$9 = getStyles$e; - const diagram$l = { - parser: parser$w, - db: db$g, - renderer: renderer$g, - styles: styles$9, - init: ({ c4: c42, wrap: wrap2 }) => { - renderer$g.setConf(c42); - db$g.setWrap(wrap2); - } - }; - const c4Diagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$l - }, Symbol.toStringTag, { value: "Module" })); - var parser$t = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 4], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 8, 9, 10, 11, 27, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $V4 = [2, 2], $V5 = [1, 13], $V6 = [1, 14], $V7 = [1, 15], $V8 = [1, 16], $V9 = [1, 23], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 49], $Ve = [1, 48], $Vf = [1, 29], $Vg = [1, 30], $Vh = [1, 31], $Vi = [1, 32], $Vj = [1, 33], $Vk = [1, 44], $Vl = [1, 46], $Vm = [1, 42], $Vn = [1, 47], $Vo = [1, 43], $Vp = [1, 50], $Vq = [1, 45], $Vr = [1, 51], $Vs = [1, 52], $Vt = [1, 34], $Vu = [1, 35], $Vv = [1, 36], $Vw = [1, 37], $Vx = [1, 57], $Vy = [1, 8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $Vz = [1, 61], $VA = [1, 60], $VB = [1, 62], $VC = [8, 9, 11, 73, 75], $VD = [1, 88], $VE = [1, 93], $VF = [1, 92], $VG = [1, 89], $VH = [1, 85], $VI = [1, 91], $VJ = [1, 87], $VK = [1, 94], $VL = [1, 90], $VM = [1, 95], $VN = [1, 86], $VO = [8, 9, 10, 11, 73, 75], $VP = [8, 9, 10, 11, 44, 73, 75], $VQ = [8, 9, 10, 11, 29, 42, 44, 46, 48, 50, 52, 54, 56, 58, 61, 63, 65, 66, 68, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VR = [8, 9, 11, 42, 58, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VS = [42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VT = [1, 121], $VU = [1, 120], $VV = [1, 128], $VW = [1, 142], $VX = [1, 143], $VY = [1, 144], $VZ = [1, 145], $V_ = [1, 130], $V$ = [1, 132], $V01 = [1, 136], $V11 = [1, 137], $V21 = [1, 138], $V31 = [1, 139], $V41 = [1, 140], $V51 = [1, 141], $V61 = [1, 146], $V71 = [1, 147], $V81 = [1, 126], $V91 = [1, 127], $Va1 = [1, 134], $Vb1 = [1, 129], $Vc1 = [1, 133], $Vd1 = [1, 131], $Ve1 = [8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $Vf1 = [1, 149], $Vg1 = [8, 9, 11], $Vh1 = [8, 9, 10, 11, 14, 42, 58, 86, 102, 103, 106, 108, 111, 112, 113], $Vi1 = [1, 169], $Vj1 = [1, 165], $Vk1 = [1, 166], $Vl1 = [1, 170], $Vm1 = [1, 167], $Vn1 = [1, 168], $Vo1 = [75, 113, 116], $Vp1 = [8, 9, 10, 11, 12, 14, 27, 29, 32, 42, 58, 73, 81, 82, 83, 84, 85, 86, 87, 102, 106, 108, 111, 112, 113], $Vq1 = [10, 103], $Vr1 = [31, 47, 49, 51, 53, 55, 60, 62, 64, 65, 67, 69, 113, 114, 115], $Vs1 = [1, 235], $Vt1 = [1, 233], $Vu1 = [1, 237], $Vv1 = [1, 231], $Vw1 = [1, 232], $Vx1 = [1, 234], $Vy1 = [1, 236], $Vz1 = [1, 238], $VA1 = [1, 255], $VB1 = [8, 9, 11, 103], $VC1 = [8, 9, 10, 11, 58, 81, 102, 103, 106, 107, 108, 109]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "graphConfig": 4, "document": 5, "line": 6, "statement": 7, "SEMI": 8, "NEWLINE": 9, "SPACE": 10, "EOF": 11, "GRAPH": 12, "NODIR": 13, "DIR": 14, "FirstStmtSeparator": 15, "ending": 16, "endToken": 17, "spaceList": 18, "spaceListNewline": 19, "vertexStatement": 20, "separator": 21, "styleStatement": 22, "linkStyleStatement": 23, "classDefStatement": 24, "classStatement": 25, "clickStatement": 26, "subgraph": 27, "textNoTags": 28, "SQS": 29, "text": 30, "SQE": 31, "end": 32, "direction": 33, "acc_title": 34, "acc_title_value": 35, "acc_descr": 36, "acc_descr_value": 37, "acc_descr_multiline_value": 38, "link": 39, "node": 40, "styledVertex": 41, "AMP": 42, "vertex": 43, "STYLE_SEPARATOR": 44, "idString": 45, "DOUBLECIRCLESTART": 46, "DOUBLECIRCLEEND": 47, "PS": 48, "PE": 49, "(-": 50, "-)": 51, "STADIUMSTART": 52, "STADIUMEND": 53, "SUBROUTINESTART": 54, "SUBROUTINEEND": 55, "VERTEX_WITH_PROPS_START": 56, "NODE_STRING[field]": 57, "COLON": 58, "NODE_STRING[value]": 59, "PIPE": 60, "CYLINDERSTART": 61, "CYLINDEREND": 62, "DIAMOND_START": 63, "DIAMOND_STOP": 64, "TAGEND": 65, "TRAPSTART": 66, "TRAPEND": 67, "INVTRAPSTART": 68, "INVTRAPEND": 69, "linkStatement": 70, "arrowText": 71, "TESTSTR": 72, "START_LINK": 73, "edgeText": 74, "LINK": 75, "edgeTextToken": 76, "STR": 77, "MD_STR": 78, "textToken": 79, "keywords": 80, "STYLE": 81, "LINKSTYLE": 82, "CLASSDEF": 83, "CLASS": 84, "CLICK": 85, "DOWN": 86, "UP": 87, "textNoTagsToken": 88, "stylesOpt": 89, "idString[vertex]": 90, "idString[class]": 91, "CALLBACKNAME": 92, "CALLBACKARGS": 93, "HREF": 94, "LINK_TARGET": 95, "STR[link]": 96, "STR[tooltip]": 97, "alphaNum": 98, "DEFAULT": 99, "numList": 100, "INTERPOLATE": 101, "NUM": 102, "COMMA": 103, "style": 104, "styleComponent": 105, "NODE_STRING": 106, "UNIT": 107, "BRKT": 108, "PCT": 109, "idStringToken": 110, "MINUS": 111, "MULT": 112, "UNICODE_TEXT": 113, "TEXT": 114, "TAGSTART": 115, "EDGE_TEXT": 116, "alphaNumToken": 117, "direction_tb": 118, "direction_bt": 119, "direction_rl": 120, "direction_lr": 121, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "NODIR", 14: "DIR", 27: "subgraph", 29: "SQS", 31: "SQE", 32: "end", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 42: "AMP", 44: "STYLE_SEPARATOR", 46: "DOUBLECIRCLESTART", 47: "DOUBLECIRCLEEND", 48: "PS", 49: "PE", 50: "(-", 51: "-)", 52: "STADIUMSTART", 53: "STADIUMEND", 54: "SUBROUTINESTART", 55: "SUBROUTINEEND", 56: "VERTEX_WITH_PROPS_START", 57: "NODE_STRING[field]", 58: "COLON", 59: "NODE_STRING[value]", 60: "PIPE", 61: "CYLINDERSTART", 62: "CYLINDEREND", 63: "DIAMOND_START", 64: "DIAMOND_STOP", 65: "TAGEND", 66: "TRAPSTART", 67: "TRAPEND", 68: "INVTRAPSTART", 69: "INVTRAPEND", 72: "TESTSTR", 73: "START_LINK", 75: "LINK", 77: "STR", 78: "MD_STR", 81: "STYLE", 82: "LINKSTYLE", 83: "CLASSDEF", 84: "CLASS", 85: "CLICK", 86: "DOWN", 87: "UP", 90: "idString[vertex]", 91: "idString[class]", 92: "CALLBACKNAME", 93: "CALLBACKARGS", 94: "HREF", 95: "LINK_TARGET", 96: "STR[link]", 97: "STR[tooltip]", 99: "DEFAULT", 101: "INTERPOLATE", 102: "NUM", 103: "COMMA", 106: "NODE_STRING", 107: "UNIT", 108: "BRKT", 109: "PCT", 111: "MINUS", 112: "MULT", 113: "UNICODE_TEXT", 114: "TEXT", 115: "TAGSTART", 116: "EDGE_TEXT", 118: "direction_tb", 119: "direction_bt", 120: "direction_rl", 121: "direction_lr" }, - productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 3], [16, 2], [16, 1], [17, 1], [17, 1], [17, 1], [15, 1], [15, 1], [15, 2], [19, 2], [19, 2], [19, 1], [19, 1], [18, 2], [18, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 6], [7, 4], [7, 1], [7, 2], [7, 2], [7, 1], [21, 1], [21, 1], [21, 1], [20, 3], [20, 4], [20, 2], [20, 1], [40, 1], [40, 5], [41, 1], [41, 3], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 8], [43, 4], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 4], [43, 4], [43, 1], [39, 2], [39, 3], [39, 3], [39, 1], [39, 3], [74, 1], [74, 2], [74, 1], [74, 1], [70, 1], [71, 3], [30, 1], [30, 2], [30, 1], [30, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [28, 1], [28, 2], [28, 1], [28, 1], [24, 5], [25, 5], [26, 2], [26, 4], [26, 3], [26, 5], [26, 3], [26, 5], [26, 5], [26, 7], [26, 2], [26, 4], [26, 2], [26, 4], [26, 4], [26, 6], [22, 5], [23, 5], [23, 5], [23, 9], [23, 9], [23, 7], [23, 7], [100, 1], [100, 3], [89, 1], [89, 3], [104, 1], [104, 2], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [79, 1], [79, 1], [79, 1], [79, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [76, 1], [76, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [45, 1], [45, 2], [98, 1], [98, 2], [33, 1], [33, 1], [33, 1], [33, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 2: - this.$ = []; - break; - case 3: - if (!Array.isArray($$[$0]) || $$[$0].length > 0) { - $$[$0 - 1].push($$[$0]); + return node2; + }).join("\n"); + } + function marked(src, opt) { + return markedInstance.parse(src, opt); + } + var _defaults, escapeTest, escapeReplace, escapeTestNoEncode, escapeReplaceNoEncode, escapeReplacements, getEscapeReplacement, unescapeTest, caret, noopTest, _Tokenizer, newline, blockCode, fences, hr, heading, bullet, lheading, _paragraph, blockText, _blockLabel, def, list, _tag, _comment, html, paragraph, blockquote, blockNormal, gfmTable, blockGfm, blockPedantic, escape3, inlineCode, br, inlineText, _punctuation, punctuation, blockSkip, emStrongLDelim, emStrongRDelimAst, emStrongRDelimUnd, anyPunctuation, autolink, _inlineComment, tag, _inlineLabel, link, reflink, nolink, reflinkSearch, inlineNormal, inlinePedantic, inlineGfm, inlineBreaks, block, inline, _Lexer, _Renderer, _TextRenderer, _Parser, _Hooks, Marked, markedInstance, options, setOptions, use, walkTokens, parseInline, parser2, lexer; + var init_marked_esm = __esm({ + "../../node_modules/.pnpm/marked@13.0.3/node_modules/marked/lib/marked.esm.js"() { + "use strict"; + __name(_getDefaults, "_getDefaults"); + _defaults = _getDefaults(); + __name(changeDefaults, "changeDefaults"); + escapeTest = /[&<>"']/; + escapeReplace = new RegExp(escapeTest.source, "g"); + escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/; + escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g"); + escapeReplacements = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }; + getEscapeReplacement = /* @__PURE__ */ __name((ch) => escapeReplacements[ch], "getEscapeReplacement"); + __name(escape$1, "escape$1"); + unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; + __name(unescape2, "unescape"); + caret = /(^|[^\[])\^/g; + __name(edit, "edit"); + __name(cleanUrl, "cleanUrl"); + noopTest = { exec: /* @__PURE__ */ __name(() => null, "exec") }; + __name(splitCells, "splitCells"); + __name(rtrim, "rtrim"); + __name(findClosingBracket, "findClosingBracket"); + __name(outputLink, "outputLink"); + __name(indentCodeCompensation, "indentCodeCompensation"); + _Tokenizer = class { + static { + __name(this, "_Tokenizer"); + } + options; + rules; + // set by the lexer + lexer; + // set by the lexer + constructor(options3) { + this.options = options3 || _defaults; + } + space(src) { + const cap = this.rules.block.newline.exec(src); + if (cap && cap[0].length > 0) { + return { + type: "space", + raw: cap[0] + }; + } + } + code(src) { + const cap = this.rules.block.code.exec(src); + if (cap) { + const text2 = cap[0].replace(/^ {1,4}/gm, ""); + return { + type: "code", + raw: cap[0], + codeBlockStyle: "indented", + text: !this.options.pedantic ? rtrim(text2, "\n") : text2 + }; + } + } + fences(src) { + const cap = this.rules.block.fences.exec(src); + if (cap) { + const raw = cap[0]; + const text2 = indentCodeCompensation(raw, cap[3] || ""); + return { + type: "code", + raw, + lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2], + text: text2 + }; + } + } + heading(src) { + const cap = this.rules.block.heading.exec(src); + if (cap) { + let text2 = cap[2].trim(); + if (/#$/.test(text2)) { + const trimmed = rtrim(text2, "#"); + if (this.options.pedantic) { + text2 = trimmed.trim(); + } else if (!trimmed || / $/.test(trimmed)) { + text2 = trimmed.trim(); + } } - this.$ = $$[$0 - 1]; - break; - case 4: - case 176: - this.$ = $$[$0]; - break; - case 11: - yy.setDirection("TB"); - this.$ = "TB"; - break; - case 12: - yy.setDirection($$[$0 - 1]); - this.$ = $$[$0 - 1]; - break; - case 27: - this.$ = $$[$0 - 1].nodes; - break; - case 28: - case 29: - case 30: - case 31: - case 32: - this.$ = []; - break; - case 33: - this.$ = yy.addSubGraph($$[$0 - 6], $$[$0 - 1], $$[$0 - 4]); - break; - case 34: - this.$ = yy.addSubGraph($$[$0 - 3], $$[$0 - 1], $$[$0 - 3]); - break; - case 35: - this.$ = yy.addSubGraph(void 0, $$[$0 - 1], void 0); - break; - case 37: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 38: - case 39: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 43: - yy.addLink($$[$0 - 2].stmt, $$[$0], $$[$0 - 1]); - this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0 - 2].nodes) }; - break; - case 44: - yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]); - this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) }; - break; - case 45: - this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1] }; - break; - case 46: - this.$ = { stmt: $$[$0], nodes: $$[$0] }; - break; - case 47: - this.$ = [$$[$0]]; - break; - case 48: - this.$ = $$[$0 - 4].concat($$[$0]); - break; - case 49: - this.$ = $$[$0]; - break; - case 50: - this.$ = $$[$0 - 2]; - yy.setClass($$[$0 - 2], $$[$0]); - break; - case 51: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "square"); - break; - case 52: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "doublecircle"); - break; - case 53: - this.$ = $$[$0 - 5]; - yy.addVertex($$[$0 - 5], $$[$0 - 2], "circle"); - break; - case 54: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "ellipse"); - break; - case 55: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "stadium"); - break; - case 56: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "subroutine"); - break; - case 57: - this.$ = $$[$0 - 7]; - yy.addVertex($$[$0 - 7], $$[$0 - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[$$[$0 - 5], $$[$0 - 3]]])); - break; - case 58: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "cylinder"); - break; - case 59: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "round"); - break; - case 60: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "diamond"); - break; - case 61: - this.$ = $$[$0 - 5]; - yy.addVertex($$[$0 - 5], $$[$0 - 2], "hexagon"); - break; - case 62: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "odd"); - break; - case 63: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "trapezoid"); - break; - case 64: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "inv_trapezoid"); - break; - case 65: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_right"); - break; - case 66: - this.$ = $$[$0 - 3]; - yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_left"); - break; - case 67: - this.$ = $$[$0]; - yy.addVertex($$[$0]); - break; - case 68: - $$[$0 - 1].text = $$[$0]; - this.$ = $$[$0 - 1]; - break; - case 69: - case 70: - $$[$0 - 2].text = $$[$0 - 1]; - this.$ = $$[$0 - 2]; - break; - case 71: - this.$ = $$[$0]; - break; - case 72: - var inf = yy.destructLink($$[$0], $$[$0 - 2]); - this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length, "text": $$[$0 - 1] }; - break; - case 73: - this.$ = { text: $$[$0], type: "text" }; - break; - case 74: - this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; - break; - case 75: - this.$ = { text: $$[$0], type: "string" }; - break; - case 76: - this.$ = { text: $$[$0], type: "markdown" }; - break; - case 77: - var inf = yy.destructLink($$[$0]); - this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length }; - break; - case 78: - this.$ = $$[$0 - 1]; - break; - case 79: - this.$ = { text: $$[$0], type: "text" }; - break; - case 80: - this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; - break; - case 81: - this.$ = { text: $$[$0], type: "string" }; - break; - case 82: - case 97: - this.$ = { text: $$[$0], type: "markdown" }; - break; - case 94: - this.$ = { text: $$[$0], type: "text" }; - break; - case 95: - this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; - break; - case 96: - this.$ = { text: $$[$0], type: "text" }; - break; - case 98: - this.$ = $$[$0 - 4]; - yy.addClass($$[$0 - 2], $$[$0]); - break; - case 99: - this.$ = $$[$0 - 4]; - yy.setClass($$[$0 - 2], $$[$0]); - break; - case 100: - case 108: - this.$ = $$[$0 - 1]; - yy.setClickEvent($$[$0 - 1], $$[$0]); - break; - case 101: - case 109: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 2]); - yy.setTooltip($$[$0 - 3], $$[$0]); - break; - case 102: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 103: - this.$ = $$[$0 - 4]; - yy.setClickEvent($$[$0 - 4], $$[$0 - 3], $$[$0 - 2]); - yy.setTooltip($$[$0 - 4], $$[$0]); - break; - case 104: - this.$ = $$[$0 - 2]; - yy.setLink($$[$0 - 2], $$[$0]); - break; - case 105: - this.$ = $$[$0 - 4]; - yy.setLink($$[$0 - 4], $$[$0 - 2]); - yy.setTooltip($$[$0 - 4], $$[$0]); - break; - case 106: - this.$ = $$[$0 - 4]; - yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]); - break; - case 107: - this.$ = $$[$0 - 6]; - yy.setLink($$[$0 - 6], $$[$0 - 4], $$[$0]); - yy.setTooltip($$[$0 - 6], $$[$0 - 2]); - break; - case 110: - this.$ = $$[$0 - 1]; - yy.setLink($$[$0 - 1], $$[$0]); - break; - case 111: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 3], $$[$0 - 2]); - yy.setTooltip($$[$0 - 3], $$[$0]); - break; - case 112: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); - break; - case 113: - this.$ = $$[$0 - 5]; - yy.setLink($$[$0 - 5], $$[$0 - 4], $$[$0]); - yy.setTooltip($$[$0 - 5], $$[$0 - 2]); - break; - case 114: - this.$ = $$[$0 - 4]; - yy.addVertex($$[$0 - 2], void 0, void 0, $$[$0]); - break; - case 115: - this.$ = $$[$0 - 4]; - yy.updateLink([$$[$0 - 2]], $$[$0]); - break; - case 116: - this.$ = $$[$0 - 4]; - yy.updateLink($$[$0 - 2], $$[$0]); - break; - case 117: - this.$ = $$[$0 - 8]; - yy.updateLinkInterpolate([$$[$0 - 6]], $$[$0 - 2]); - yy.updateLink([$$[$0 - 6]], $$[$0]); - break; - case 118: - this.$ = $$[$0 - 8]; - yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]); - yy.updateLink($$[$0 - 6], $$[$0]); - break; - case 119: - this.$ = $$[$0 - 6]; - yy.updateLinkInterpolate([$$[$0 - 4]], $$[$0]); - break; - case 120: - this.$ = $$[$0 - 6]; - yy.updateLinkInterpolate($$[$0 - 4], $$[$0]); - break; - case 121: - case 123: - this.$ = [$$[$0]]; - break; - case 122: - case 124: - $$[$0 - 2].push($$[$0]); - this.$ = $$[$0 - 2]; - break; - case 126: - this.$ = $$[$0 - 1] + $$[$0]; - break; - case 174: - this.$ = $$[$0]; - break; - case 175: - this.$ = $$[$0 - 1] + "" + $$[$0]; - break; - case 177: - this.$ = $$[$0 - 1] + "" + $$[$0]; - break; - case 178: - this.$ = { stmt: "dir", value: "TB" }; - break; - case 179: - this.$ = { stmt: "dir", value: "BT" }; - break; - case 180: - this.$ = { stmt: "dir", value: "RL" }; - break; - case 181: - this.$ = { stmt: "dir", value: "LR" }; - break; - } - }, - table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 13: [1, 9], 14: [1, 10] }, { 1: [2, 1], 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, o($V3, [2, 9]), o($V3, [2, 10]), o($V3, [2, 11]), { 8: [1, 54], 9: [1, 55], 10: $Vx, 15: 53, 18: 56 }, o($Vy, [2, 3]), o($Vy, [2, 4]), o($Vy, [2, 5]), o($Vy, [2, 6]), o($Vy, [2, 7]), o($Vy, [2, 8]), { 8: $Vz, 9: $VA, 11: $VB, 21: 58, 39: 59, 70: 63, 73: [1, 64], 75: [1, 65] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 66 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 67 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 68 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 69 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 70 }, { 8: $Vz, 9: $VA, 10: [1, 71], 11: $VB, 21: 72 }, o($Vy, [2, 36]), { 35: [1, 73] }, { 37: [1, 74] }, o($Vy, [2, 39]), o($VC, [2, 46], { 18: 75, 10: $Vx }), { 10: [1, 76] }, { 10: [1, 77] }, { 10: [1, 78] }, { 10: [1, 79] }, { 14: $VD, 42: $VE, 58: $VF, 77: [1, 83], 86: $VG, 92: [1, 80], 94: [1, 81], 98: 82, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, o($Vy, [2, 178]), o($Vy, [2, 179]), o($Vy, [2, 180]), o($Vy, [2, 181]), o($VO, [2, 47]), o($VO, [2, 49], { 44: [1, 96] }), o($VP, [2, 67], { 110: 109, 29: [1, 97], 42: $Vd, 46: [1, 98], 48: [1, 99], 50: [1, 100], 52: [1, 101], 54: [1, 102], 56: [1, 103], 58: $Ve, 61: [1, 104], 63: [1, 105], 65: [1, 106], 66: [1, 107], 68: [1, 108], 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), o($VQ, [2, 174]), o($VQ, [2, 135]), o($VQ, [2, 136]), o($VQ, [2, 137]), o($VQ, [2, 138]), o($VQ, [2, 139]), o($VQ, [2, 140]), o($VQ, [2, 141]), o($VQ, [2, 142]), o($VQ, [2, 143]), o($VQ, [2, 144]), o($VQ, [2, 145]), o($V3, [2, 12]), o($V3, [2, 18]), o($V3, [2, 19]), { 9: [1, 110] }, o($VR, [2, 26], { 18: 111, 10: $Vx }), o($Vy, [2, 27]), { 40: 112, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o($Vy, [2, 40]), o($Vy, [2, 41]), o($Vy, [2, 42]), o($VS, [2, 71], { 71: 113, 60: [1, 115], 72: [1, 114] }), { 74: 116, 76: 117, 77: [1, 118], 78: [1, 119], 113: $VT, 116: $VU }, o([42, 58, 60, 72, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 77]), o($Vy, [2, 28]), o($Vy, [2, 29]), o($Vy, [2, 30]), o($Vy, [2, 31]), o($Vy, [2, 32]), { 10: $VV, 12: $VW, 14: $VX, 27: $VY, 28: 122, 32: $VZ, 42: $V_, 58: $V$, 73: $V01, 77: [1, 124], 78: [1, 125], 80: 135, 81: $V11, 82: $V21, 83: $V31, 84: $V41, 85: $V51, 86: $V61, 87: $V71, 88: 123, 102: $V81, 106: $V91, 108: $Va1, 111: $Vb1, 112: $Vc1, 113: $Vd1 }, o($Ve1, $V4, { 5: 148 }), o($Vy, [2, 37]), o($Vy, [2, 38]), o($VC, [2, 45], { 42: $Vf1 }), { 42: $Vd, 45: 150, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 99: [1, 151], 100: 152, 102: [1, 153] }, { 42: $Vd, 45: 154, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 42: $Vd, 45: 155, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o($Vg1, [2, 100], { 10: [1, 156], 93: [1, 157] }), { 77: [1, 158] }, o($Vg1, [2, 108], { 117: 160, 10: [1, 159], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o($Vg1, [2, 110], { 10: [1, 161] }), o($Vh1, [2, 176]), o($Vh1, [2, 163]), o($Vh1, [2, 164]), o($Vh1, [2, 165]), o($Vh1, [2, 166]), o($Vh1, [2, 167]), o($Vh1, [2, 168]), o($Vh1, [2, 169]), o($Vh1, [2, 170]), o($Vh1, [2, 171]), o($Vh1, [2, 172]), o($Vh1, [2, 173]), { 42: $Vd, 45: 162, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 30: 163, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 171, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 173, 48: [1, 172], 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 174, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 175, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 176, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 106: [1, 177] }, { 30: 178, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 179, 63: [1, 180], 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 181, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 182, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 183, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($VQ, [2, 175]), o($V3, [2, 20]), o($VR, [2, 25]), o($VC, [2, 43], { 18: 184, 10: $Vx }), o($VS, [2, 68], { 10: [1, 185] }), { 10: [1, 186] }, { 30: 187, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 75: [1, 188], 76: 189, 113: $VT, 116: $VU }, o($Vo1, [2, 73]), o($Vo1, [2, 75]), o($Vo1, [2, 76]), o($Vo1, [2, 161]), o($Vo1, [2, 162]), { 8: $Vz, 9: $VA, 10: $VV, 11: $VB, 12: $VW, 14: $VX, 21: 191, 27: $VY, 29: [1, 190], 32: $VZ, 42: $V_, 58: $V$, 73: $V01, 80: 135, 81: $V11, 82: $V21, 83: $V31, 84: $V41, 85: $V51, 86: $V61, 87: $V71, 88: 192, 102: $V81, 106: $V91, 108: $Va1, 111: $Vb1, 112: $Vc1, 113: $Vd1 }, o($Vp1, [2, 94]), o($Vp1, [2, 96]), o($Vp1, [2, 97]), o($Vp1, [2, 150]), o($Vp1, [2, 151]), o($Vp1, [2, 152]), o($Vp1, [2, 153]), o($Vp1, [2, 154]), o($Vp1, [2, 155]), o($Vp1, [2, 156]), o($Vp1, [2, 157]), o($Vp1, [2, 158]), o($Vp1, [2, 159]), o($Vp1, [2, 160]), o($Vp1, [2, 83]), o($Vp1, [2, 84]), o($Vp1, [2, 85]), o($Vp1, [2, 86]), o($Vp1, [2, 87]), o($Vp1, [2, 88]), o($Vp1, [2, 89]), o($Vp1, [2, 90]), o($Vp1, [2, 91]), o($Vp1, [2, 92]), o($Vp1, [2, 93]), { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 193], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, { 10: $Vx, 18: 194 }, { 10: [1, 195], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: [1, 196] }, { 10: [1, 197], 103: [1, 198] }, o($Vq1, [2, 121]), { 10: [1, 199], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: [1, 200], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 77: [1, 201] }, o($Vg1, [2, 102], { 10: [1, 202] }), o($Vg1, [2, 104], { 10: [1, 203] }), { 77: [1, 204] }, o($Vh1, [2, 177]), { 77: [1, 205], 95: [1, 206] }, o($VO, [2, 50], { 110: 109, 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), { 31: [1, 207], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($Vr1, [2, 79]), o($Vr1, [2, 81]), o($Vr1, [2, 82]), o($Vr1, [2, 146]), o($Vr1, [2, 147]), o($Vr1, [2, 148]), o($Vr1, [2, 149]), { 47: [1, 209], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 210, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 49: [1, 211], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 51: [1, 212], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 53: [1, 213], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 55: [1, 214], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 58: [1, 215] }, { 62: [1, 216], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 64: [1, 217], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 218, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 31: [1, 219], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 65: $Vi1, 67: [1, 220], 69: [1, 221], 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 65: $Vi1, 67: [1, 223], 69: [1, 222], 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($VC, [2, 44], { 42: $Vf1 }), o($VS, [2, 70]), o($VS, [2, 69]), { 60: [1, 224], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($VS, [2, 72]), o($Vo1, [2, 74]), { 30: 225, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($Ve1, $V4, { 5: 226 }), o($Vp1, [2, 95]), o($Vy, [2, 35]), { 41: 227, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 228, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 239, 101: [1, 240], 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 241, 101: [1, 242], 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 102: [1, 243] }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 244, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 42: $Vd, 45: 245, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o($Vg1, [2, 101]), { 77: [1, 246] }, { 77: [1, 247], 95: [1, 248] }, o($Vg1, [2, 109]), o($Vg1, [2, 111], { 10: [1, 249] }), o($Vg1, [2, 112]), o($VP, [2, 51]), o($Vr1, [2, 80]), o($VP, [2, 52]), { 49: [1, 250], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($VP, [2, 59]), o($VP, [2, 54]), o($VP, [2, 55]), o($VP, [2, 56]), { 106: [1, 251] }, o($VP, [2, 58]), o($VP, [2, 60]), { 64: [1, 252], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($VP, [2, 62]), o($VP, [2, 63]), o($VP, [2, 65]), o($VP, [2, 64]), o($VP, [2, 66]), o([10, 42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 78]), { 31: [1, 253], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 254], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, o($VO, [2, 48]), o($Vg1, [2, 114], { 103: $VA1 }), o($VB1, [2, 123], { 105: 256, 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }), o($VC1, [2, 125]), o($VC1, [2, 127]), o($VC1, [2, 128]), o($VC1, [2, 129]), o($VC1, [2, 130]), o($VC1, [2, 131]), o($VC1, [2, 132]), o($VC1, [2, 133]), o($VC1, [2, 134]), o($Vg1, [2, 115], { 103: $VA1 }), { 10: [1, 257] }, o($Vg1, [2, 116], { 103: $VA1 }), { 10: [1, 258] }, o($Vq1, [2, 122]), o($Vg1, [2, 98], { 103: $VA1 }), o($Vg1, [2, 99], { 110: 109, 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), o($Vg1, [2, 103]), o($Vg1, [2, 105], { 10: [1, 259] }), o($Vg1, [2, 106]), { 95: [1, 260] }, { 49: [1, 261] }, { 60: [1, 262] }, { 64: [1, 263] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 264 }, o($Vy, [2, 34]), { 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 104: 265, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, o($VC1, [2, 126]), { 14: $VD, 42: $VE, 58: $VF, 86: $VG, 98: 266, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, { 14: $VD, 42: $VE, 58: $VF, 86: $VG, 98: 267, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, { 95: [1, 268] }, o($Vg1, [2, 113]), o($VP, [2, 53]), { 30: 269, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o($VP, [2, 61]), o($Ve1, $V4, { 5: 270 }), o($VB1, [2, 124], { 105: 256, 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }), o($Vg1, [2, 119], { 117: 160, 10: [1, 271], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o($Vg1, [2, 120], { 117: 160, 10: [1, 272], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o($Vg1, [2, 107]), { 31: [1, 273], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 274], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 275, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 276, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, o($VP, [2, 57]), o($Vy, [2, 33]), o($Vg1, [2, 117], { 103: $VA1 }), o($Vg1, [2, 118], { 103: $VA1 })], - defaultActions: {}, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; + return { + type: "heading", + raw: cap[0], + depth: cap[1].length, + text: text2, + tokens: this.lexer.inline(text2) + }; } - return token2; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + hr(src) { + const cap = this.rules.block.hr.exec(src); + if (cap) { + return { + type: "hr", + raw: rtrim(cap[0], "\n") + }; + } + } + blockquote(src) { + const cap = this.rules.block.blockquote.exec(src); + if (cap) { + let lines = rtrim(cap[0], "\n").split("\n"); + let raw = ""; + let text2 = ""; + const tokens2 = []; + while (lines.length > 0) { + let inBlockquote = false; + const currentLines = []; + let i2; + for (i2 = 0; i2 < lines.length; i2++) { + if (/^ {0,3}>/.test(lines[i2])) { + currentLines.push(lines[i2]); + inBlockquote = true; + } else if (!inBlockquote) { + currentLines.push(lines[i2]); + } else { + break; + } + } + lines = lines.slice(i2); + const currentRaw = currentLines.join("\n"); + const currentText = currentRaw.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, "\n $1").replace(/^ {0,3}>[ \t]?/gm, ""); + raw = raw ? `${raw} +${currentRaw}` : currentRaw; + text2 = text2 ? `${text2} +${currentText}` : currentText; + const top2 = this.lexer.state.top; + this.lexer.state.top = true; + this.lexer.blockTokens(currentText, tokens2, true); + this.lexer.state.top = top2; + if (lines.length === 0) { + break; + } + const lastToken = tokens2[tokens2.length - 1]; + if (lastToken?.type === "code") { + break; + } else if (lastToken?.type === "blockquote") { + const oldToken = lastToken; + const newText = oldToken.raw + "\n" + lines.join("\n"); + const newToken = this.blockquote(newText); + tokens2[tokens2.length - 1] = newToken; + raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw; + text2 = text2.substring(0, text2.length - oldToken.text.length) + newToken.text; + break; + } else if (lastToken?.type === "list") { + const oldToken = lastToken; + const newText = oldToken.raw + "\n" + lines.join("\n"); + const newToken = this.list(newText); + tokens2[tokens2.length - 1] = newToken; + raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw; + text2 = text2.substring(0, text2.length - oldToken.raw.length) + newToken.raw; + lines = newText.substring(tokens2[tokens2.length - 1].raw.length).split("\n"); + continue; + } } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); + return { + type: "blockquote", + raw, + tokens: tokens2, + text: text2 + }; + } + } + list(src) { + let cap = this.rules.block.list.exec(src); + if (cap) { + let bull = cap[1].trim(); + const isordered = bull.length > 1; + const list2 = { + type: "list", + raw: "", + ordered: isordered, + start: isordered ? +bull.slice(0, -1) : "", + loose: false, + items: [] + }; + bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`; + if (this.options.pedantic) { + bull = isordered ? bull : "[*+-]"; + } + const itemRegex = new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`); + let endsWithBlankLine = false; + while (src) { + let endEarly = false; + let raw = ""; + let itemContents = ""; + if (!(cap = itemRegex.exec(src))) { + break; + } + if (this.rules.block.hr.test(src)) { + break; + } + raw = cap[0]; + src = src.substring(raw.length); + let line2 = cap[2].split("\n", 1)[0].replace(/^\t+/, (t4) => " ".repeat(3 * t4.length)); + let nextLine = src.split("\n", 1)[0]; + let blankLine = !line2.trim(); + let indent = 0; + if (this.options.pedantic) { + indent = 2; + itemContents = line2.trimStart(); + } else if (blankLine) { + indent = cap[1].length + 1; + } else { + indent = cap[2].search(/[^ ]/); + indent = indent > 4 ? 1 : indent; + itemContents = line2.slice(indent); + indent += cap[1].length; + } + if (blankLine && /^ *$/.test(nextLine)) { + raw += nextLine + "\n"; + src = src.substring(nextLine.length + 1); + endEarly = true; + } + if (!endEarly) { + const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`); + const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`); + const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`); + const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`); + while (src) { + const rawLine = src.split("\n", 1)[0]; + nextLine = rawLine; + if (this.options.pedantic) { + nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "); + } + if (fencesBeginRegex.test(nextLine)) { + break; + } + if (headingBeginRegex.test(nextLine)) { + break; + } + if (nextBulletRegex.test(nextLine)) { + break; + } + if (hrRegex.test(src)) { + break; + } + if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { + itemContents += "\n" + nextLine.slice(indent); + } else { + if (blankLine) { + break; + } + if (line2.search(/[^ ]/) >= 4) { + break; + } + if (fencesBeginRegex.test(line2)) { + break; + } + if (headingBeginRegex.test(line2)) { + break; + } + if (hrRegex.test(line2)) { + break; + } + itemContents += "\n" + nextLine; + } + if (!blankLine && !nextLine.trim()) { + blankLine = true; + } + raw += rawLine + "\n"; + src = src.substring(rawLine.length + 1); + line2 = nextLine.slice(indent); + } + } + if (!list2.loose) { + if (endsWithBlankLine) { + list2.loose = true; + } else if (/\n *\n *$/.test(raw)) { + endsWithBlankLine = true; + } + } + let istask = null; + let ischecked; + if (this.options.gfm) { + istask = /^\[[ xX]\] /.exec(itemContents); + if (istask) { + ischecked = istask[0] !== "[ ] "; + itemContents = itemContents.replace(/^\[[ xX]\] +/, ""); + } } + list2.items.push({ + type: "list_item", + raw, + task: !!istask, + checked: ischecked, + loose: false, + text: itemContents, + tokens: [] + }); + list2.raw += raw; } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; + list2.items[list2.items.length - 1].raw = list2.items[list2.items.length - 1].raw.trimEnd(); + list2.items[list2.items.length - 1].text = list2.items[list2.items.length - 1].text.trimEnd(); + list2.raw = list2.raw.trimEnd(); + for (let i2 = 0; i2 < list2.items.length; i2++) { + this.lexer.state.top = false; + list2.items[i2].tokens = this.lexer.blockTokens(list2.items[i2].text, []); + if (!list2.loose) { + const spacers = list2.items[i2].tokens.filter((t4) => t4.type === "space"); + const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t4) => /\n.*\n/.test(t4.raw)); + list2.loose = hasMultipleLineBreaks; } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; + } + if (list2.loose) { + for (let i2 = 0; i2 < list2.items.length; i2++) { + list2.items[i2].loose = true; } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + } + return list2; } } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + html(src) { + const cap = this.rules.block.html.exec(src); + if (cap) { + const token2 = { + type: "html", + block: true, + raw: cap[0], + pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style", + text: cap[0] + }; + return token2; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + } + def(src) { + const cap = this.rules.block.def.exec(src); + if (cap) { + const tag2 = cap[1].toLowerCase().replace(/\s+/g, " "); + const href = cap[2] ? cap[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : ""; + const title2 = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3]; + return { + type: "def", + tag: tag2, + raw: cap[0], + href, + title: title2 + }; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; + } + table(src) { + const cap = this.rules.block.table.exec(src); + if (!cap) { + return; } - if (this.options.ranges) { - this.yylloc.range[1]++; + if (!/[:|]/.test(cap[2])) { + return; } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + const headers = splitCells(cap[1]); + const aligns = cap[2].replace(/^\||\| *$/g, "").split("|"); + const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, "").split("\n") : []; + const item = { + type: "table", + raw: cap[0], + header: [], + align: [], + rows: [] }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + if (headers.length !== aligns.length) { + return; } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno + for (const align of aligns) { + if (/^ *-+: *$/.test(align)) { + item.align.push("right"); + } else if (/^ *:-+: *$/.test(align)) { + item.align.push("center"); + } else if (/^ *:-+ *$/.test(align)) { + item.align.push("left"); + } else { + item.align.push(null); + } + } + for (let i2 = 0; i2 < headers.length; i2++) { + item.header.push({ + text: headers[i2], + tokens: this.lexer.inline(headers[i2]), + header: true, + align: item.align[i2] }); } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + for (const row of rows) { + item.rows.push(splitCells(row, item.header.length).map((cell, i2) => { + return { + text: cell, + tokens: this.lexer.inline(cell), + header: false, + align: item.align[i2] + }; + })); } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done + return item; + } + lheading(src) { + const cap = this.rules.block.lheading.exec(src); + if (cap) { + return { + type: "heading", + raw: cap[0], + depth: cap[2].charAt(0) === "=" ? 1 : 2, + text: cap[1], + tokens: this.lexer.inline(cap[1]) + }; + } + } + paragraph(src) { + const cap = this.rules.block.paragraph.exec(src); + if (cap) { + const text2 = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1]; + return { + type: "paragraph", + raw: cap[0], + text: text2, + tokens: this.lexer.inline(text2) + }; + } + } + text(src) { + const cap = this.rules.block.text.exec(src); + if (cap) { + return { + type: "text", + raw: cap[0], + text: cap[0], + tokens: this.lexer.inline(cap[0]) }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + } + } + escape(src) { + const cap = this.rules.inline.escape.exec(src); + if (cap) { + return { + type: "escape", + raw: cap[0], + text: escape$1(cap[1]) + }; + } + } + tag(src) { + const cap = this.rules.inline.tag.exec(src); + if (cap) { + if (!this.lexer.state.inLink && /^/i.test(cap[0])) { + this.lexer.state.inLink = false; } + if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = true; + } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = false; + } + return { + type: "html", + raw: cap[0], + inLink: this.lexer.state.inLink, + inRawBlock: this.lexer.state.inRawBlock, + block: false, + text: cap[0] + }; } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + } + link(src) { + const cap = this.rules.inline.link.exec(src); + if (cap) { + const trimmedUrl = cap[2].trim(); + if (!this.options.pedantic && /^$/.test(trimmedUrl)) { + return; + } + const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\"); + if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { + return; + } + } else { + const lastParenIndex = findClosingBracket(cap[2], "()"); + if (lastParenIndex > -1) { + const start3 = cap[0].indexOf("!") === 0 ? 5 : 4; + const linkLen = start3 + cap[1].length + lastParenIndex; + cap[2] = cap[2].substring(0, lastParenIndex); + cap[0] = cap[0].substring(0, linkLen).trim(); + cap[3] = ""; + } + } + let href = cap[2]; + let title2 = ""; + if (this.options.pedantic) { + const link3 = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + if (link3) { + href = link3[1]; + title2 = link3[3]; + } + } else { + title2 = cap[3] ? cap[3].slice(1, -1) : ""; + } + href = href.trim(); + if (/^$/.test(trimmedUrl)) { + href = href.slice(1); + } else { + href = href.slice(1, -1); + } + } + return outputLink(cap, { + href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href, + title: title2 ? title2.replace(this.rules.inline.anyPunctuation, "$1") : title2 + }, cap[0], this.lexer); } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; + } + reflink(src, links3) { + let cap; + if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { + const linkString = (cap[2] || cap[1]).replace(/\s+/g, " "); + const link3 = links3[linkString.toLowerCase()]; + if (!link3) { + const text2 = cap[0].charAt(0); + return { + type: "text", + raw: text2, + text: text2 + }; } - return false; + return outputLink(cap, link3, cap[0], this.lexer); } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; + } + emStrong(src, maskedSrc, prevChar = "") { + let match2 = this.rules.inline.emStrongLDelim.exec(src); + if (!match2) + return; + if (match2[3] && prevChar.match(/[\p{L}\p{N}]/u)) + return; + const nextChar = match2[1] || match2[2] || ""; + if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) { + const lLength = [...match2[0]].length - 1; + let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0; + const endReg = match2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; + endReg.lastIndex = 0; + maskedSrc = maskedSrc.slice(-1 * src.length + lLength); + while ((match2 = endReg.exec(maskedSrc)) != null) { + rDelim = match2[1] || match2[2] || match2[3] || match2[4] || match2[5] || match2[6]; + if (!rDelim) + continue; + rLength = [...rDelim].length; + if (match2[3] || match2[4]) { + delimTotal += rLength; + continue; + } else if (match2[5] || match2[6]) { + if (lLength % 3 && !((lLength + rLength) % 3)) { + midDelimTotal += rLength; continue; - } else { - return false; } - } else if (!this.options.flex) { - break; } + delimTotal -= rLength; + if (delimTotal > 0) + continue; + rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); + const lastCharLength = [...match2[0]][0].length; + const raw = src.slice(0, lLength + match2.index + lastCharLength + rLength); + if (Math.min(lLength, rLength) % 2) { + const text3 = raw.slice(1, -1); + return { + type: "em", + raw, + text: text3, + tokens: this.lexer.inlineTokens(text3) + }; + } + const text2 = raw.slice(2, -2); + return { + type: "strong", + raw, + text: text2, + tokens: this.lexer.inlineTokens(text2) + }; } } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + } + codespan(src) { + const cap = this.rules.inline.code.exec(src); + if (cap) { + let text2 = cap[2].replace(/\n/g, " "); + const hasNonSpaceChars = /[^ ]/.test(text2); + const hasSpaceCharsOnBothEnds = /^ /.test(text2) && / $/.test(text2); + if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { + text2 = text2.substring(1, text2.length - 1); + } + text2 = escape$1(text2, true); + return { + type: "codespan", + raw: cap[0], + text: text2 + }; + } + } + br(src) { + const cap = this.rules.inline.br.exec(src); + if (cap) { + return { + type: "br", + raw: cap[0] + }; + } + } + del(src) { + const cap = this.rules.inline.del.exec(src); + if (cap) { + return { + type: "del", + raw: cap[0], + text: cap[2], + tokens: this.lexer.inlineTokens(cap[2]) + }; + } + } + autolink(src) { + const cap = this.rules.inline.autolink.exec(src); + if (cap) { + let text2, href; + if (cap[2] === "@") { + text2 = escape$1(cap[1]); + href = "mailto:" + text2; + } else { + text2 = escape$1(cap[1]); + href = text2; + } + return { + type: "link", + raw: cap[0], + text: text2, + href, + tokens: [ + { + type: "text", + raw: text2, + text: text2 + } + ] + }; + } + } + url(src) { + let cap; + if (cap = this.rules.inline.url.exec(src)) { + let text2, href; + if (cap[2] === "@") { + text2 = escape$1(cap[0]); + href = "mailto:" + text2; + } else { + let prevCapZero; + do { + prevCapZero = cap[0]; + cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? ""; + } while (prevCapZero !== cap[0]); + text2 = escape$1(cap[0]); + if (cap[1] === "www.") { + href = "http://" + cap[0]; + } else { + href = cap[0]; + } + } + return { + type: "link", + raw: cap[0], + text: text2, + href, + tokens: [ + { + type: "text", + raw: text2, + text: text2 + } + ] + }; + } + } + inlineText(src) { + const cap = this.rules.inline.text.exec(src); + if (cap) { + let text2; + if (this.lexer.state.inRawBlock) { + text2 = cap[0]; + } else { + text2 = escape$1(cap[0]); + } + return { + type: "text", + raw: cap[0], + text: text2 + }; + } + } + }; + newline = /^(?: *(?:\n|$))+/; + blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/; + fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/; + hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/; + heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/; + bullet = /(?:[*+-]|\d{1,9}[.)])/; + lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(); + _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/; + blockText = /^[^\n]+/; + _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/; + def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(); + list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex(); + _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul"; + _comment = /|$))/; + html = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); + paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(); + blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex(); + blockNormal = { + blockquote, + code: blockCode, + def, + fences, + heading, + hr, + html, + lheading, + list, + newline, + paragraph, + table: noopTest, + text: blockText + }; + gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(); + blockGfm = { + ...blockNormal, + table: gfmTable, + paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex() + }; + blockPedantic = { + ...blockNormal, + html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), + def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, + heading: /^(#{1,6})(.*)(?:\n+|$)/, + fences: noopTest, + // fences not supported + lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, + paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() + }; + escape3 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/; + inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/; + br = /^( {2,}|\\)\n(?!\s*$)/; + inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g; + emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, _punctuation).getRegex(); + emStrongRDelimAst = edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, _punctuation).getRegex(); + emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, _punctuation).getRegex(); + anyPunctuation = edit(/\\([punct])/, "gu").replace(/punct/g, _punctuation).getRegex(); + autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(); + _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex(); + tag = edit("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(); + _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; + link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(); + reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex(); + nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex(); + reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex(); + inlineNormal = { + _backpedal: noopTest, + // only used for GFM url + anyPunctuation, + autolink, + blockSkip, + br, + code: inlineCode, + del: noopTest, + emStrongLDelim, + emStrongRDelimAst, + emStrongRDelimUnd, + escape: escape3, + link, + nolink, + punctuation, + reflink, + reflinkSearch, + tag, + text: inlineText, + url: noopTest + }; + inlinePedantic = { + ...inlineNormal, + link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex() + }; + inlineGfm = { + ...inlineNormal, + escape: edit(escape3).replace("])", "~|])").getRegex(), + url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), + _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, + del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, + text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ { + return leading + " ".repeat(tabs.length); }); } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + let token2; + let lastToken; + let cutSrc; + while (src) { + if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((extTokenizer) => { + if (token2 = extTokenizer.call({ lexer: this }, src, tokens2)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + return true; + } + return false; + })) { + continue; + } + if (token2 = this.tokenizer.space(src)) { + src = src.substring(token2.raw.length); + if (token2.raw.length === 1 && tokens2.length > 0) { + tokens2[tokens2.length - 1].raw += "\n"; + } else { + tokens2.push(token2); + } + continue; + } + if (token2 = this.tokenizer.code(src)) { + src = src.substring(token2.raw.length); + lastToken = tokens2[tokens2.length - 1]; + if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) { + lastToken.raw += "\n" + token2.raw; + lastToken.text += "\n" + token2.text; + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else { + tokens2.push(token2); + } + continue; + } + if (token2 = this.tokenizer.fences(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.heading(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.hr(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.blockquote(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.list(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.html(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.def(src)) { + src = src.substring(token2.raw.length); + lastToken = tokens2[tokens2.length - 1]; + if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) { + lastToken.raw += "\n" + token2.raw; + lastToken.text += "\n" + token2.raw; + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else if (!this.tokens.links[token2.tag]) { + this.tokens.links[token2.tag] = { + href: token2.href, + title: token2.title + }; + } + continue; + } + if (token2 = this.tokenizer.table(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.lheading(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + cutSrc = src; + if (this.options.extensions && this.options.extensions.startBlock) { + let startIndex = Infinity; + const tempSrc = src.slice(1); + let tempStart; + this.options.extensions.startBlock.forEach((getStartIndex) => { + tempStart = getStartIndex.call({ lexer: this }, tempSrc); + if (typeof tempStart === "number" && tempStart >= 0) { + startIndex = Math.min(startIndex, tempStart); + } + }); + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + } + if (this.state.top && (token2 = this.tokenizer.paragraph(cutSrc))) { + lastToken = tokens2[tokens2.length - 1]; + if (lastParagraphClipped && lastToken?.type === "paragraph") { + lastToken.raw += "\n" + token2.raw; + lastToken.text += "\n" + token2.text; + this.inlineQueue.pop(); + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else { + tokens2.push(token2); + } + lastParagraphClipped = cutSrc.length !== src.length; + src = src.substring(token2.raw.length); + continue; + } + if (token2 = this.tokenizer.text(src)) { + src = src.substring(token2.raw.length); + lastToken = tokens2[tokens2.length - 1]; + if (lastToken && lastToken.type === "text") { + lastToken.raw += "\n" + token2.raw; + lastToken.text += "\n" + token2.text; + this.inlineQueue.pop(); + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else { + tokens2.push(token2); + } + continue; + } + if (src) { + const errMsg = "Infinite loop on byte: " + src.charCodeAt(0); + if (this.options.silent) { + console.error(errMsg); + break; + } else { + throw new Error(errMsg); + } + } } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + this.state.top = true; + return tokens2; + } + inline(src, tokens2 = []) { + this.inlineQueue.push({ src, tokens: tokens2 }); + return tokens2; + } + /** + * Lexing/Compiling + */ + inlineTokens(src, tokens2 = []) { + let token2, lastToken, cutSrc; + let maskedSrc = src; + let match2; + let keepPrevChar, prevChar; + if (this.tokens.links) { + const links3 = Object.keys(this.tokens.links); + if (links3.length > 0) { + while ((match2 = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { + if (links3.includes(match2[0].slice(match2[0].lastIndexOf("[") + 1, -1))) { + maskedSrc = maskedSrc.slice(0, match2.index) + "[" + "a".repeat(match2[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); + } + } + } } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + while ((match2 = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { + maskedSrc = maskedSrc.slice(0, match2.index) + "[" + "a".repeat(match2[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; + while ((match2 = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) { + maskedSrc = maskedSrc.slice(0, match2.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: {}, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - this.begin("acc_title"); - return 34; - case 1: - this.popState(); - return "acc_title_value"; - case 2: - this.begin("acc_descr"); - return 36; - case 3: - this.popState(); - return "acc_descr_value"; - case 4: - this.begin("acc_descr_multiline"); - break; - case 5: - this.popState(); - break; - case 6: - return "acc_descr_multiline_value"; - case 7: - this.begin("callbackname"); - break; - case 8: - this.popState(); - break; - case 9: - this.popState(); - this.begin("callbackargs"); - break; - case 10: - return 92; - case 11: - this.popState(); - break; - case 12: - return 93; - case 13: - return "MD_STR"; - case 14: - this.popState(); - break; - case 15: - this.begin("md_string"); - break; - case 16: - return "STR"; - case 17: - this.popState(); - break; - case 18: - this.pushState("string"); - break; - case 19: - return 81; - case 20: - return 99; - case 21: - return 82; - case 22: - return 101; - case 23: - return 83; - case 24: - return 84; - case 25: - return 94; - case 26: - this.begin("click"); - break; - case 27: - this.popState(); - break; - case 28: - return 85; - case 29: - if (yy.lex.firstGraph()) { - this.begin("dir"); - } - return 12; - case 30: - if (yy.lex.firstGraph()) { - this.begin("dir"); - } - return 12; - case 31: - if (yy.lex.firstGraph()) { - this.begin("dir"); - } - return 12; - case 32: - return 27; - case 33: - return 32; - case 34: - return 95; - case 35: - return 95; - case 36: - return 95; - case 37: - return 95; - case 38: - this.popState(); - return 13; - case 39: - this.popState(); - return 14; - case 40: - this.popState(); - return 14; - case 41: - this.popState(); - return 14; - case 42: - this.popState(); - return 14; - case 43: - this.popState(); - return 14; - case 44: - this.popState(); - return 14; - case 45: - this.popState(); - return 14; - case 46: - this.popState(); - return 14; - case 47: - this.popState(); - return 14; - case 48: - this.popState(); - return 14; - case 49: - return 118; - case 50: - return 119; - case 51: - return 120; - case 52: - return 121; - case 53: - return 102; - case 54: - return 108; - case 55: - return 44; - case 56: - return 58; - case 57: - return 42; - case 58: - return 8; - case 59: - return 103; - case 60: - return 112; - case 61: - this.popState(); - return 75; - case 62: - this.pushState("edgeText"); - return 73; - case 63: - return 116; - case 64: - this.popState(); - return 75; - case 65: - this.pushState("thickEdgeText"); - return 73; - case 66: - return 116; - case 67: - this.popState(); - return 75; - case 68: - this.pushState("dottedEdgeText"); - return 73; - case 69: - return 116; - case 70: - return 75; - case 71: - this.popState(); - return 51; - case 72: - return "TEXT"; - case 73: - this.pushState("ellipseText"); - return 50; - case 74: - this.popState(); - return 53; - case 75: - this.pushState("text"); - return 52; - case 76: - this.popState(); - return 55; - case 77: - this.pushState("text"); - return 54; - case 78: - return 56; - case 79: - this.pushState("text"); - return 65; - case 80: - this.popState(); - return 62; - case 81: - this.pushState("text"); - return 61; - case 82: - this.popState(); - return 47; - case 83: - this.pushState("text"); - return 46; - case 84: - this.popState(); - return 67; - case 85: - this.popState(); - return 69; - case 86: - return 114; - case 87: - this.pushState("trapText"); - return 66; - case 88: - this.pushState("trapText"); - return 68; - case 89: - return 115; - case 90: - return 65; - case 91: - return 87; - case 92: - return "SEP"; - case 93: - return 86; - case 94: - return 112; - case 95: - return 108; - case 96: - return 42; - case 97: - return 106; - case 98: - return 111; - case 99: - return 113; - case 100: - this.popState(); - return 60; - case 101: - this.pushState("text"); - return 60; - case 102: - this.popState(); - return 49; - case 103: - this.pushState("text"); - return 48; - case 104: - this.popState(); - return 31; - case 105: - this.pushState("text"); - return 29; - case 106: - this.popState(); - return 64; - case 107: - this.pushState("text"); - return 63; - case 108: - return "TEXT"; - case 109: - return "QUOTE"; - case 110: - return 9; - case 111: - return 10; - case 112: - return 11; + while (src) { + if (!keepPrevChar) { + prevChar = ""; + } + keepPrevChar = false; + if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((extTokenizer) => { + if (token2 = extTokenizer.call({ lexer: this }, src, tokens2)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + return true; + } + return false; + })) { + continue; + } + if (token2 = this.tokenizer.escape(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.tag(src)) { + src = src.substring(token2.raw.length); + lastToken = tokens2[tokens2.length - 1]; + if (lastToken && token2.type === "text" && lastToken.type === "text") { + lastToken.raw += token2.raw; + lastToken.text += token2.text; + } else { + tokens2.push(token2); + } + continue; + } + if (token2 = this.tokenizer.link(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.reflink(src, this.tokens.links)) { + src = src.substring(token2.raw.length); + lastToken = tokens2[tokens2.length - 1]; + if (lastToken && token2.type === "text" && lastToken.type === "text") { + lastToken.raw += token2.raw; + lastToken.text += token2.text; + } else { + tokens2.push(token2); + } + continue; + } + if (token2 = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.codespan(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.br(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.del(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (token2 = this.tokenizer.autolink(src)) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + if (!this.state.inLink && (token2 = this.tokenizer.url(src))) { + src = src.substring(token2.raw.length); + tokens2.push(token2); + continue; + } + cutSrc = src; + if (this.options.extensions && this.options.extensions.startInline) { + let startIndex = Infinity; + const tempSrc = src.slice(1); + let tempStart; + this.options.extensions.startInline.forEach((getStartIndex) => { + tempStart = getStartIndex.call({ lexer: this }, tempSrc); + if (typeof tempStart === "number" && tempStart >= 0) { + startIndex = Math.min(startIndex, tempStart); + } + }); + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + } + if (token2 = this.tokenizer.inlineText(cutSrc)) { + src = src.substring(token2.raw.length); + if (token2.raw.slice(-1) !== "_") { + prevChar = token2.raw.slice(-1); + } + keepPrevChar = true; + lastToken = tokens2[tokens2.length - 1]; + if (lastToken && lastToken.type === "text") { + lastToken.raw += token2.raw; + lastToken.text += token2.text; + } else { + tokens2.push(token2); + } + continue; + } + if (src) { + const errMsg = "Infinite loop on byte: " + src.charCodeAt(0); + if (this.options.silent) { + console.error(errMsg); + break; + } else { + throw new Error(errMsg); + } + } } - }, - rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:flowchart-elk\b)/, /^(?:graph\b)/, /^(?:flowchart\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:[^=]|=(?!))/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:[^\.]|\.(?!))/, /^(?:\s*~~[\~]+\s*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:[^\[\]\(\)\{\}\|\"]+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/], - conditions: { "callbackargs": { "rules": [11, 12, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "callbackname": { "rules": [8, 9, 10, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "href": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "click": { "rules": [15, 18, 27, 28, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "dottedEdgeText": { "rules": [15, 18, 67, 69, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "thickEdgeText": { "rules": [15, 18, 64, 66, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "edgeText": { "rules": [15, 18, 61, 63, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "trapText": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 84, 85, 86, 87, 88, 101, 103, 105, 107], "inclusive": false }, "ellipseText": { "rules": [15, 18, 70, 71, 72, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "text": { "rules": [15, 18, 70, 73, 74, 75, 76, 77, 80, 81, 82, 83, 87, 88, 100, 101, 102, 103, 104, 105, 106, 107, 108], "inclusive": false }, "vertex": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "dir": { "rules": [15, 18, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_descr_multiline": { "rules": [5, 6, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_descr": { "rules": [3, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_title": { "rules": [1, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "md_string": { "rules": [13, 14, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "string": { "rules": [15, 16, 17, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 67, 68, 70, 73, 75, 77, 78, 79, 81, 83, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 103, 105, 107, 109, 110, 111, 112], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$t.parser = parser$t; - const parser$u = parser$t; - const MERMAID_DOM_ID_PREFIX$1 = "flowchart-"; - let vertexCounter = 0; - let config$3 = getConfig$1(); - let vertices = {}; - let edges = []; - let classes$3 = {}; - let subGraphs = []; - let subGraphLookup = {}; - let tooltips = {}; - let subCount = 0; - let firstGraphFlag = true; - let direction$3; - let version; - let funs$1 = []; - const sanitizeText$3 = (txt) => common$1.sanitizeText(txt, config$3); - const lookUpDomId$1 = function(id2) { - const vertexKeys = Object.keys(vertices); - for (const vertexKey of vertexKeys) { - if (vertices[vertexKey].id === id2) { - return vertices[vertexKey].domId; - } - } - return id2; - }; - const addVertex = function(_id, textObj, type2, style, classes2, dir2, props = {}) { - let txt; - let id2 = _id; - if (id2 === void 0) { - return; - } - if (id2.trim().length === 0) { - return; - } - if (vertices[id2] === void 0) { - vertices[id2] = { - id: id2, - labelType: "text", - domId: MERMAID_DOM_ID_PREFIX$1 + id2 + "-" + vertexCounter, - styles: [], - classes: [] + return tokens2; + } }; - } - vertexCounter++; - if (textObj !== void 0) { - config$3 = getConfig$1(); - txt = sanitizeText$3(textObj.text.trim()); - vertices[id2].labelType = textObj.type; - if (txt[0] === '"' && txt[txt.length - 1] === '"') { - txt = txt.substring(1, txt.length - 1); - } - vertices[id2].text = txt; - } else { - if (vertices[id2].text === void 0) { - vertices[id2].text = _id; - } - } - if (type2 !== void 0) { - vertices[id2].type = type2; - } - if (style !== void 0 && style !== null) { - style.forEach(function(s) { - vertices[id2].styles.push(s); - }); - } - if (classes2 !== void 0 && classes2 !== null) { - classes2.forEach(function(s) { - vertices[id2].classes.push(s); - }); - } - if (dir2 !== void 0) { - vertices[id2].dir = dir2; - } - if (vertices[id2].props === void 0) { - vertices[id2].props = props; - } else if (props !== void 0) { - Object.assign(vertices[id2].props, props); - } - }; - const addSingleLink = function(_start, _end, type2) { - let start2 = _start; - let end2 = _end; - const edge = { start: start2, end: end2, type: void 0, text: "", labelType: "text" }; - log$1.info("abc78 Got edge...", edge); - const linkTextObj = type2.text; - if (linkTextObj !== void 0) { - edge.text = sanitizeText$3(linkTextObj.text.trim()); - if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') { - edge.text = edge.text.substring(1, edge.text.length - 1); - } - edge.labelType = linkTextObj.type; - } - if (type2 !== void 0) { - edge.type = type2.type; - edge.stroke = type2.stroke; - edge.length = type2.length; - } - if ((edge == null ? void 0 : edge.length) > 10) { - edge.length = 10; - } - if (edges.length < (config$3.maxEdges ?? 500)) { - log$1.info("abc78 pushing edge..."); - edges.push(edge); - } else { - throw new Error( - `Edge limit exceeded. ${edges.length} edges found, but the limit is ${config$3.maxEdges}. - -Initialize mermaid with maxEdges set to a higher number to allow more edges. -You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.` - ); - } - }; - const addLink$1 = function(_start, _end, type2) { - log$1.info("addLink (abc78)", _start, _end, type2); - let i2, j; - for (i2 = 0; i2 < _start.length; i2++) { - for (j = 0; j < _end.length; j++) { - addSingleLink(_start[i2], _end[j], type2); - } - } - }; - const updateLinkInterpolate = function(positions, interp) { - positions.forEach(function(pos) { - if (pos === "default") { - edges.defaultInterpolate = interp; - } else { - edges[pos].interpolate = interp; - } - }); - }; - const updateLink = function(positions, style) { - positions.forEach(function(pos) { - if (pos >= edges.length) { - throw new Error( - `The index ${pos} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)` - ); - } - if (pos === "default") { - edges.defaultStyle = style; - } else { - if (utils$1.isSubstringInArray("fill", style) === -1) { - style.push("fill:none"); + _Renderer = class { + static { + __name(this, "_Renderer"); } - edges[pos].style = style; - } - }); - }; - const addClass$1 = function(ids, style) { - ids.split(",").forEach(function(id2) { - if (classes$3[id2] === void 0) { - classes$3[id2] = { id: id2, styles: [], textStyles: [] }; - } - if (style !== void 0 && style !== null) { - style.forEach(function(s) { - if (s.match("color")) { - const newStyle = s.replace("fill", "bgFill").replace("color", "fill"); - classes$3[id2].textStyles.push(newStyle); - } - classes$3[id2].styles.push(s); - }); - } - }); - }; - const setDirection$3 = function(dir2) { - direction$3 = dir2; - if (direction$3.match(/.*/)) { - direction$3 = "LR"; - } - if (direction$3.match(/.*v/)) { - direction$3 = "TB"; - } - if (direction$3 === "TD") { - direction$3 = "TB"; - } - }; - const setClass$1 = function(ids, className) { - ids.split(",").forEach(function(_id) { - let id2 = _id; - if (vertices[id2] !== void 0) { - vertices[id2].classes.push(className); - } - if (subGraphLookup[id2] !== void 0) { - subGraphLookup[id2].classes.push(className); - } - }); - }; - const setTooltip$1 = function(ids, tooltip) { - ids.split(",").forEach(function(id2) { - if (tooltip !== void 0) { - tooltips[version === "gen-1" ? lookUpDomId$1(id2) : id2] = sanitizeText$3(tooltip); - } - }); - }; - const setClickFun$1 = function(id2, functionName, functionArgs) { - let domId = lookUpDomId$1(id2); - if (getConfig$1().securityLevel !== "loose") { - return; - } - if (functionName === void 0) { - return; - } - let argList = []; - if (typeof functionArgs === "string") { - argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); - for (let i2 = 0; i2 < argList.length; i2++) { - let item = argList[i2].trim(); - if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { - item = item.substr(1, item.length - 2); - } - argList[i2] = item; - } - } - if (argList.length === 0) { - argList.push(id2); - } - if (vertices[id2] !== void 0) { - vertices[id2].haveCallback = true; - funs$1.push(function() { - const elem = document.querySelector(`[id="${domId}"]`); - if (elem !== null) { - elem.addEventListener( - "click", - function() { - utils$1.runFunc(functionName, ...argList); - }, - false - ); + options; + parser; + // set by the parser + constructor(options3) { + this.options = options3 || _defaults; } - }); - } - }; - const setLink$2 = function(ids, linkStr, target) { - ids.split(",").forEach(function(id2) { - if (vertices[id2] !== void 0) { - vertices[id2].link = utils$1.formatUrl(linkStr, config$3); - vertices[id2].linkTarget = target; - } - }); - setClass$1(ids, "clickable"); - }; - const getTooltip$1 = function(id2) { - if (tooltips.hasOwnProperty(id2)) { - return tooltips[id2]; - } - return void 0; - }; - const setClickEvent$2 = function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id2) { - setClickFun$1(id2, functionName, functionArgs); - }); - setClass$1(ids, "clickable"); - }; - const bindFunctions$2 = function(element2) { - funs$1.forEach(function(fun) { - fun(element2); - }); - }; - const getDirection$3 = function() { - return direction$3.trim(); - }; - const getVertices = function() { - return vertices; - }; - const getEdges$1 = function() { - return edges; - }; - const getClasses$8 = function() { - return classes$3; - }; - const setupToolTips$1 = function(element2) { - let tooltipElem = d3select(".mermaidTooltip"); - if ((tooltipElem._groups || tooltipElem)[0][0] === null) { - tooltipElem = d3select("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); - } - const svg2 = d3select(element2).select("svg"); - const nodes2 = svg2.selectAll("g.node"); - nodes2.on("mouseover", function() { - const el = d3select(this); - const title2 = el.attr("title"); - if (title2 === null) { - return; - } - const rect2 = this.getBoundingClientRect(); - tooltipElem.transition().duration(200).style("opacity", ".9"); - tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect2.left + (rect2.right - rect2.left) / 2 + "px").style("top", window.scrollY + rect2.bottom + "px"); - tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, "
")); - el.classed("hover", true); - }).on("mouseout", function() { - tooltipElem.transition().duration(500).style("opacity", 0); - const el = d3select(this); - el.classed("hover", false); - }); - }; - funs$1.push(setupToolTips$1); - const clear$l = function(ver = "gen-1") { - vertices = {}; - classes$3 = {}; - edges = []; - funs$1 = [setupToolTips$1]; - subGraphs = []; - subGraphLookup = {}; - subCount = 0; - tooltips = {}; - firstGraphFlag = true; - version = ver; - config$3 = getConfig$1(); - clear$n(); - }; - const setGen = (ver) => { - version = ver || "gen-2"; - }; - const defaultStyle = function() { - return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"; - }; - const addSubGraph = function(_id, list2, _title) { - let id2 = _id.text.trim(); - let title2 = _title.text; - if (_id === _title && _title.text.match(/\s/)) { - id2 = void 0; - } - function uniq(a) { - const prims = { boolean: {}, number: {}, string: {} }; - const objs = []; - let dir3; - const nodeList2 = a.filter(function(item) { - const type2 = typeof item; - if (item.stmt && item.stmt === "dir") { - dir3 = item.value; - return false; + space(token2) { + return ""; } - if (item.trim() === "") { - return false; + code({ text: text2, lang, escaped }) { + const langString = (lang || "").match(/^\S*/)?.[0]; + const code = text2.replace(/\n$/, "") + "\n"; + if (!langString) { + return "
" + (escaped ? code : escape$1(code, true)) + "
\n"; + } + return '
' + (escaped ? code : escape$1(code, true)) + "
\n"; } - if (type2 in prims) { - return prims[type2].hasOwnProperty(item) ? false : prims[type2][item] = true; - } else { - return objs.includes(item) ? false : objs.push(item); + blockquote({ tokens: tokens2 }) { + const body = this.parser.parse(tokens2); + return `
+${body}
+`; } - }); - return { nodeList: nodeList2, dir: dir3 }; - } - let nodeList = []; - const { nodeList: nl, dir: dir2 } = uniq(nodeList.concat.apply(nodeList, list2)); - nodeList = nl; - if (version === "gen-1") { - for (let i2 = 0; i2 < nodeList.length; i2++) { - nodeList[i2] = lookUpDomId$1(nodeList[i2]); - } - } - id2 = id2 || "subGraph" + subCount; - title2 = title2 || ""; - title2 = sanitizeText$3(title2); - subCount = subCount + 1; - const subGraph = { - id: id2, - nodes: nodeList, - title: title2.trim(), - classes: [], - dir: dir2, - labelType: _title.type - }; - log$1.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir); - subGraph.nodes = makeUniq(subGraph, subGraphs).nodes; - subGraphs.push(subGraph); - subGraphLookup[id2] = subGraph; - return id2; - }; - const getPosForId = function(id2) { - for (const [i2, subGraph] of subGraphs.entries()) { - if (subGraph.id === id2) { - return i2; - } - } - return -1; - }; - let secCount = -1; - const posCrossRef = []; - const indexNodes2 = function(id2, pos) { - const nodes2 = subGraphs[pos].nodes; - secCount = secCount + 1; - if (secCount > 2e3) { - return; - } - posCrossRef[secCount] = pos; - if (subGraphs[pos].id === id2) { - return { - result: true, - count: 0 - }; - } - let count = 0; - let posCount = 1; - while (count < nodes2.length) { - const childPos = getPosForId(nodes2[count]); - if (childPos >= 0) { - const res = indexNodes2(id2, childPos); - if (res.result) { - return { - result: true, - count: posCount + res.count - }; - } else { - posCount = posCount + res.count; + html({ text: text2 }) { + return text2; } - } - count = count + 1; - } - return { - result: false, - count: posCount - }; - }; - const getDepthFirstPos = function(pos) { - return posCrossRef[pos]; - }; - const indexNodes = function() { - secCount = -1; - if (subGraphs.length > 0) { - indexNodes2("none", subGraphs.length - 1); - } - }; - const getSubGraphs = function() { - return subGraphs; - }; - const firstGraph = () => { - if (firstGraphFlag) { - firstGraphFlag = false; - return true; - } - return false; - }; - const destructStartLink = (_str) => { - let str2 = _str.trim(); - let type2 = "arrow_open"; - switch (str2[0]) { - case "<": - type2 = "arrow_point"; - str2 = str2.slice(1); - break; - case "x": - type2 = "arrow_cross"; - str2 = str2.slice(1); - break; - case "o": - type2 = "arrow_circle"; - str2 = str2.slice(1); - break; - } - let stroke = "normal"; - if (str2.includes("=")) { - stroke = "thick"; - } - if (str2.includes(".")) { - stroke = "dotted"; - } - return { type: type2, stroke }; - }; - const countChar = (char2, str2) => { - const length2 = str2.length; - let count = 0; - for (let i2 = 0; i2 < length2; ++i2) { - if (str2[i2] === char2) { - ++count; - } - } - return count; - }; - const destructEndLink = (_str) => { - const str2 = _str.trim(); - let line2 = str2.slice(0, -1); - let type2 = "arrow_open"; - switch (str2.slice(-1)) { - case "x": - type2 = "arrow_cross"; - if (str2[0] === "x") { - type2 = "double_" + type2; - line2 = line2.slice(1); + heading({ tokens: tokens2, depth }) { + return `${this.parser.parseInline(tokens2)} +`; } - break; - case ">": - type2 = "arrow_point"; - if (str2[0] === "<") { - type2 = "double_" + type2; - line2 = line2.slice(1); + hr(token2) { + return "
\n"; + } + list(token2) { + const ordered = token2.ordered; + const start3 = token2.start; + let body = ""; + for (let j2 = 0; j2 < token2.items.length; j2++) { + const item = token2.items[j2]; + body += this.listitem(item); + } + const type3 = ordered ? "ol" : "ul"; + const startAttr = ordered && start3 !== 1 ? ' start="' + start3 + '"' : ""; + return "<" + type3 + startAttr + ">\n" + body + "\n"; + } + listitem(item) { + let itemBody = ""; + if (item.task) { + const checkbox = this.checkbox({ checked: !!item.checked }); + if (item.loose) { + if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") { + item.tokens[0].text = checkbox + " " + item.tokens[0].text; + if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") { + item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text; + } + } else { + item.tokens.unshift({ + type: "text", + raw: checkbox + " ", + text: checkbox + " " + }); + } + } else { + itemBody += checkbox + " "; + } + } + itemBody += this.parser.parse(item.tokens, !!item.loose); + return `
  • ${itemBody}
  • +`; } - break; - case "o": - type2 = "arrow_circle"; - if (str2[0] === "o") { - type2 = "double_" + type2; - line2 = line2.slice(1); + checkbox({ checked }) { + return "'; } - break; - } - let stroke = "normal"; - let length2 = line2.length - 1; - if (line2[0] === "=") { - stroke = "thick"; - } - if (line2[0] === "~") { - stroke = "invisible"; + paragraph({ tokens: tokens2 }) { + return `

    ${this.parser.parseInline(tokens2)}

    +`; + } + table(token2) { + let header = ""; + let cell = ""; + for (let j2 = 0; j2 < token2.header.length; j2++) { + cell += this.tablecell(token2.header[j2]); + } + header += this.tablerow({ text: cell }); + let body = ""; + for (let j2 = 0; j2 < token2.rows.length; j2++) { + const row = token2.rows[j2]; + cell = ""; + for (let k2 = 0; k2 < row.length; k2++) { + cell += this.tablecell(row[k2]); + } + body += this.tablerow({ text: cell }); + } + if (body) + body = `${body}`; + return "\n\n" + header + "\n" + body + "
    \n"; + } + tablerow({ text: text2 }) { + return ` +${text2} +`; + } + tablecell(token2) { + const content = this.parser.parseInline(token2.tokens); + const type3 = token2.header ? "th" : "td"; + const tag2 = token2.align ? `<${type3} align="${token2.align}">` : `<${type3}>`; + return tag2 + content + ` +`; + } + /** + * span level renderer + */ + strong({ tokens: tokens2 }) { + return `${this.parser.parseInline(tokens2)}`; + } + em({ tokens: tokens2 }) { + return `${this.parser.parseInline(tokens2)}`; + } + codespan({ text: text2 }) { + return `${text2}`; + } + br(token2) { + return "
    "; + } + del({ tokens: tokens2 }) { + return `${this.parser.parseInline(tokens2)}`; + } + link({ href, title: title2, tokens: tokens2 }) { + const text2 = this.parser.parseInline(tokens2); + const cleanHref = cleanUrl(href); + if (cleanHref === null) { + return text2; + } + href = cleanHref; + let out = '
    "; + return out; + } + image({ href, title: title2, text: text2 }) { + const cleanHref = cleanUrl(href); + if (cleanHref === null) { + return text2; + } + href = cleanHref; + let out = `${text2} { + const tokens3 = genericToken[childTokens].flat(Infinity); + values2 = values2.concat(this.walkTokens(tokens3, callback)); + }); + } else if (genericToken.tokens) { + values2 = values2.concat(this.walkTokens(genericToken.tokens, callback)); + } + } + } + } + return values2; + } + use(...args) { + const extensions2 = this.defaults.extensions || { renderers: {}, childTokens: {} }; + args.forEach((pack) => { + const opts = { ...pack }; + opts.async = this.defaults.async || opts.async || false; + if (pack.extensions) { + pack.extensions.forEach((ext) => { + if (!ext.name) { + throw new Error("extension name required"); + } + if ("renderer" in ext) { + const prevRenderer = extensions2.renderers[ext.name]; + if (prevRenderer) { + extensions2.renderers[ext.name] = function(...args2) { + let ret = ext.renderer.apply(this, args2); + if (ret === false) { + ret = prevRenderer.apply(this, args2); + } + return ret; + }; + } else { + extensions2.renderers[ext.name] = ext.renderer; + } + } + if ("tokenizer" in ext) { + if (!ext.level || ext.level !== "block" && ext.level !== "inline") { + throw new Error("extension level must be 'block' or 'inline'"); + } + const extLevel = extensions2[ext.level]; + if (extLevel) { + extLevel.unshift(ext.tokenizer); + } else { + extensions2[ext.level] = [ext.tokenizer]; + } + if (ext.start) { + if (ext.level === "block") { + if (extensions2.startBlock) { + extensions2.startBlock.push(ext.start); + } else { + extensions2.startBlock = [ext.start]; + } + } else if (ext.level === "inline") { + if (extensions2.startInline) { + extensions2.startInline.push(ext.start); + } else { + extensions2.startInline = [ext.start]; + } + } + } + } + if ("childTokens" in ext && ext.childTokens) { + extensions2.childTokens[ext.name] = ext.childTokens; + } + }); + opts.extensions = extensions2; + } + if (pack.renderer) { + const renderer7 = this.defaults.renderer || new _Renderer(this.defaults); + for (const prop in pack.renderer) { + if (!(prop in renderer7)) { + throw new Error(`renderer '${prop}' does not exist`); + } + if (["options", "parser"].includes(prop)) { + continue; + } + const rendererProp = prop; + let rendererFunc = pack.renderer[rendererProp]; + if (!pack.useNewRenderer) { + rendererFunc = this.#convertRendererFunction(rendererFunc, rendererProp, renderer7); + } + const prevRenderer = renderer7[rendererProp]; + renderer7[rendererProp] = (...args2) => { + let ret = rendererFunc.apply(renderer7, args2); + if (ret === false) { + ret = prevRenderer.apply(renderer7, args2); + } + return ret || ""; + }; + } + opts.renderer = renderer7; + } + if (pack.tokenizer) { + const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults); + for (const prop in pack.tokenizer) { + if (!(prop in tokenizer)) { + throw new Error(`tokenizer '${prop}' does not exist`); + } + if (["options", "rules", "lexer"].includes(prop)) { + continue; + } + const tokenizerProp = prop; + const tokenizerFunc = pack.tokenizer[tokenizerProp]; + const prevTokenizer = tokenizer[tokenizerProp]; + tokenizer[tokenizerProp] = (...args2) => { + let ret = tokenizerFunc.apply(tokenizer, args2); + if (ret === false) { + ret = prevTokenizer.apply(tokenizer, args2); + } + return ret; + }; + } + opts.tokenizer = tokenizer; + } + if (pack.hooks) { + const hooks = this.defaults.hooks || new _Hooks(); + for (const prop in pack.hooks) { + if (!(prop in hooks)) { + throw new Error(`hook '${prop}' does not exist`); + } + if (prop === "options") { + continue; + } + const hooksProp = prop; + const hooksFunc = pack.hooks[hooksProp]; + const prevHook = hooks[hooksProp]; + if (_Hooks.passThroughHooks.has(prop)) { + hooks[hooksProp] = (arg) => { + if (this.defaults.async) { + return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => { + return prevHook.call(hooks, ret2); + }); + } + const ret = hooksFunc.call(hooks, arg); + return prevHook.call(hooks, ret); + }; + } else { + hooks[hooksProp] = (...args2) => { + let ret = hooksFunc.apply(hooks, args2); + if (ret === false) { + ret = prevHook.apply(hooks, args2); + } + return ret; + }; + } + } + opts.hooks = hooks; + } + if (pack.walkTokens) { + const walkTokens2 = this.defaults.walkTokens; + const packWalktokens = pack.walkTokens; + opts.walkTokens = function(token2) { + let values2 = []; + values2.push(packWalktokens.call(this, token2)); + if (walkTokens2) { + values2 = values2.concat(walkTokens2.call(this, token2)); + } + return values2; + }; + } + this.defaults = { ...this.defaults, ...opts }; + }); + return this; + } + // TODO: Remove this in next major release + #convertRendererFunction(func, prop, renderer7) { + switch (prop) { + case "heading": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, renderer7.parser.parseInline(token2.tokens), token2.depth, unescape2(renderer7.parser.parseInline(token2.tokens, renderer7.parser.textRenderer))); + }; + case "code": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, token2.text, token2.lang, !!token2.escaped); + }; + case "table": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + let header = ""; + let cell = ""; + for (let j2 = 0; j2 < token2.header.length; j2++) { + cell += this.tablecell({ + text: token2.header[j2].text, + tokens: token2.header[j2].tokens, + header: true, + align: token2.align[j2] + }); + } + header += this.tablerow({ text: cell }); + let body = ""; + for (let j2 = 0; j2 < token2.rows.length; j2++) { + const row = token2.rows[j2]; + cell = ""; + for (let k2 = 0; k2 < row.length; k2++) { + cell += this.tablecell({ + text: row[k2].text, + tokens: row[k2].tokens, + header: false, + align: token2.align[k2] + }); + } + body += this.tablerow({ text: cell }); + } + return func.call(this, header, body); + }; + case "blockquote": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + const body = this.parser.parse(token2.tokens); + return func.call(this, body); + }; + case "list": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + const ordered = token2.ordered; + const start3 = token2.start; + const loose = token2.loose; + let body = ""; + for (let j2 = 0; j2 < token2.items.length; j2++) { + const item = token2.items[j2]; + const checked = item.checked; + const task = item.task; + let itemBody = ""; + if (item.task) { + const checkbox = this.checkbox({ checked: !!checked }); + if (loose) { + if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") { + item.tokens[0].text = checkbox + " " + item.tokens[0].text; + if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") { + item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text; + } + } else { + item.tokens.unshift({ + type: "text", + text: checkbox + " " + }); + } + } else { + itemBody += checkbox + " "; + } + } + itemBody += this.parser.parse(item.tokens, loose); + body += this.listitem({ + type: "list_item", + raw: itemBody, + text: itemBody, + task, + checked: !!checked, + loose, + tokens: item.tokens + }); + } + return func.call(this, body, ordered, start3); + }; + case "html": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, token2.text, token2.block); + }; + case "paragraph": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, this.parser.parseInline(token2.tokens)); + }; + case "escape": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, token2.text); + }; + case "link": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, token2.href, token2.title, this.parser.parseInline(token2.tokens)); + }; + case "image": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, token2.href, token2.title, token2.text); + }; + case "strong": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, this.parser.parseInline(token2.tokens)); + }; + case "em": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, this.parser.parseInline(token2.tokens)); + }; + case "codespan": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, token2.text); + }; + case "del": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, this.parser.parseInline(token2.tokens)); + }; + case "text": + return function(token2) { + if (!token2.type || token2.type !== prop) { + return func.apply(this, arguments); + } + return func.call(this, token2.text); + }; + } + return func; + } + setOptions(opt) { + this.defaults = { ...this.defaults, ...opt }; + return this; + } + lexer(src, options3) { + return _Lexer.lex(src, options3 ?? this.defaults); + } + parser(tokens2, options3) { + return _Parser.parse(tokens2, options3 ?? this.defaults); + } + #parseMarkdown(lexer2, parser21) { + return (src, options3) => { + const origOpt = { ...options3 }; + const opt = { ...this.defaults, ...origOpt }; + if (this.defaults.async === true && origOpt.async === false) { + if (!opt.silent) { + console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."); + } + opt.async = true; + } + const throwError2 = this.#onError(!!opt.silent, !!opt.async); + if (typeof src === "undefined" || src === null) { + return throwError2(new Error("marked(): input parameter is undefined or null")); + } + if (typeof src !== "string") { + return throwError2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected")); + } + if (opt.hooks) { + opt.hooks.options = opt; + } + if (opt.async) { + return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens2) => opt.hooks ? opt.hooks.processAllTokens(tokens2) : tokens2).then((tokens2) => opt.walkTokens ? Promise.all(this.walkTokens(tokens2, opt.walkTokens)).then(() => tokens2) : tokens2).then((tokens2) => parser21(tokens2, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError2); + } + try { + if (opt.hooks) { + src = opt.hooks.preprocess(src); + } + let tokens2 = lexer2(src, opt); + if (opt.hooks) { + tokens2 = opt.hooks.processAllTokens(tokens2); + } + if (opt.walkTokens) { + this.walkTokens(tokens2, opt.walkTokens); + } + let html2 = parser21(tokens2, opt); + if (opt.hooks) { + html2 = opt.hooks.postprocess(html2); + } + return html2; + } catch (e3) { + return throwError2(e3); + } + }; + } + #onError(silent, async) { + return (e3) => { + e3.message += "\nPlease report this to https://github.com/markedjs/marked."; + if (silent) { + const msg = "

    An error occurred:

    " + escape$1(e3.message + "", true) + "
    "; + if (async) { + return Promise.resolve(msg); + } + return msg; + } + if (async) { + return Promise.reject(e3); + } + throw e3; + }; + } + }; + markedInstance = new Marked(); + __name(marked, "marked"); + marked.options = marked.setOptions = function(options3) { + markedInstance.setOptions(options3); + marked.defaults = markedInstance.defaults; + changeDefaults(marked.defaults); + return marked; + }; + marked.getDefaults = _getDefaults; + marked.defaults = _defaults; + marked.use = function(...args) { + markedInstance.use(...args); + marked.defaults = markedInstance.defaults; + changeDefaults(marked.defaults); + return marked; + }; + marked.walkTokens = function(tokens2, callback) { + return markedInstance.walkTokens(tokens2, callback); + }; + marked.parseInline = markedInstance.parseInline; + marked.Parser = _Parser; + marked.parser = _Parser.parse; + marked.Renderer = _Renderer; + marked.TextRenderer = _TextRenderer; + marked.Lexer = _Lexer; + marked.lexer = _Lexer.lex; + marked.Tokenizer = _Tokenizer; + marked.Hooks = _Hooks; + marked.parse = marked; + options = marked.options; + setOptions = marked.setOptions; + use = marked.use; + walkTokens = marked.walkTokens; + parseInline = marked.parseInline; + parser2 = _Parser.parse; + lexer = _Lexer.lex; } - let dots = countChar(".", line2); - if (dots) { - stroke = "dotted"; - length2 = dots; + }); + + // src/rendering-util/handle-markdown-text.ts + function preprocessMarkdown(markdown, { markdownAutoWrap }) { + const withoutBR = markdown.replace(//g, "\n"); + const withoutMultipleNewlines = withoutBR.replace(/\n{2,}/g, "\n"); + const withoutExtraSpaces = dedent(withoutMultipleNewlines); + if (markdownAutoWrap === false) { + return withoutExtraSpaces.replace(/ /g, " "); } - return { type: type2, stroke, length: length2 }; - }; - const destructLink = (_str, _startStr) => { - const info2 = destructEndLink(_str); - let startInfo; - if (_startStr) { - startInfo = destructStartLink(_startStr); - if (startInfo.stroke !== info2.stroke) { - return { type: "INVALID", stroke: "INVALID" }; - } - if (startInfo.type === "arrow_open") { - startInfo.type = info2.type; - } else { - if (startInfo.type !== info2.type) { - return { type: "INVALID", stroke: "INVALID" }; - } - startInfo.type = "double_" + startInfo.type; - } - if (startInfo.type === "double_arrow") { - startInfo.type = "double_arrow_point"; + return withoutExtraSpaces; + } + function markdownToLines(markdown, config6 = {}) { + const preprocessedMarkdown = preprocessMarkdown(markdown, config6); + const nodes6 = marked.lexer(preprocessedMarkdown); + const lines = [[]]; + let currentLine = 0; + function processNode(node2, parentType = "normal") { + if (node2.type === "text") { + const textLines = node2.text.split("\n"); + textLines.forEach((textLine, index) => { + if (index !== 0) { + currentLine++; + lines.push([]); + } + textLine.split(" ").forEach((word) => { + if (word) { + lines[currentLine].push({ content: word, type: parentType }); + } + }); + }); + } else if (node2.type === "strong" || node2.type === "em") { + node2.tokens.forEach((contentNode) => { + processNode(contentNode, node2.type); + }); + } else if (node2.type === "html") { + lines[currentLine].push({ content: node2.text, type: "normal" }); } - startInfo.length = info2.length; - return startInfo; } - return info2; - }; - const exists = (allSgs, _id) => { - let res = false; - allSgs.forEach((sg) => { - const pos = sg.nodes.indexOf(_id); - if (pos >= 0) { - res = true; + __name(processNode, "processNode"); + nodes6.forEach((treeNode) => { + if (treeNode.type === "paragraph") { + treeNode.tokens?.forEach((contentNode) => { + processNode(contentNode); + }); + } else if (treeNode.type === "html") { + lines[currentLine].push({ content: treeNode.text, type: "normal" }); } }); - return res; - }; - const makeUniq = (sg, allSubgraphs) => { - const res = []; - sg.nodes.forEach((_id, pos) => { - if (!exists(allSubgraphs, _id)) { - res.push(sg.nodes[pos]); + return lines; + } + function markdownToHTML(markdown, { markdownAutoWrap } = {}) { + const nodes6 = marked.lexer(markdown); + function output2(node2) { + if (node2.type === "text") { + if (markdownAutoWrap === false) { + return node2.text.replace(/\n */g, "
    ").replace(/ /g, " "); + } + return node2.text.replace(/\n */g, "
    "); + } else if (node2.type === "strong") { + return `${node2.tokens?.map(output2).join("")}`; + } else if (node2.type === "em") { + return `${node2.tokens?.map(output2).join("")}`; + } else if (node2.type === "paragraph") { + return `

    ${node2.tokens?.map(output2).join("")}

    `; + } else if (node2.type === "space") { + return ""; + } else if (node2.type === "html") { + return `${node2.text}`; } - }); - return { nodes: res }; - }; - const lex = { - firstGraph - }; - const flowDb = { - defaultConfig: () => defaultConfig.flowchart, - setAccTitle, - getAccTitle, - getAccDescription, - setAccDescription, - addVertex, - lookUpDomId: lookUpDomId$1, - addLink: addLink$1, - updateLinkInterpolate, - updateLink, - addClass: addClass$1, - setDirection: setDirection$3, - setClass: setClass$1, - setTooltip: setTooltip$1, - getTooltip: getTooltip$1, - setClickEvent: setClickEvent$2, - setLink: setLink$2, - bindFunctions: bindFunctions$2, - getDirection: getDirection$3, - getVertices, - getEdges: getEdges$1, - getClasses: getClasses$8, - clear: clear$l, - setGen, - defaultStyle, - addSubGraph, - getDepthFirstPos, - indexNodes, - getSubGraphs, - destructLink, - lex, - exists, - makeUniq, - setDiagramTitle, - getDiagramTitle - }; - const db$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - addClass: addClass$1, - addLink: addLink$1, - addSingleLink, - addSubGraph, - addVertex, - bindFunctions: bindFunctions$2, - clear: clear$l, - default: flowDb, - defaultStyle, - destructLink, - firstGraph, - getClasses: getClasses$8, - getDepthFirstPos, - getDirection: getDirection$3, - getEdges: getEdges$1, - getSubGraphs, - getTooltip: getTooltip$1, - getVertices, - indexNodes, - lex, - lookUpDomId: lookUpDomId$1, - setClass: setClass$1, - setClickEvent: setClickEvent$2, - setDirection: setDirection$3, - setGen, - setLink: setLink$2, - updateLink, - updateLinkInterpolate - }, Symbol.toStringTag, { value: "Module" })); - var symbolTag$3 = "[object Symbol]"; - function isSymbol(value2) { - return typeof value2 == "symbol" || isObjectLike(value2) && baseGetTag(value2) == symbolTag$3; + return `Unsupported markdown: ${node2.type}`; + } + __name(output2, "output"); + return nodes6.map(output2).join(""); } - function arrayMap(array2, iteratee) { - var index2 = -1, length2 = array2 == null ? 0 : array2.length, result = Array(length2); - while (++index2 < length2) { - result[index2] = iteratee(array2[index2], index2, array2); + var init_handle_markdown_text = __esm({ + "src/rendering-util/handle-markdown-text.ts"() { + "use strict"; + init_marked_esm(); + init_esm(); + __name(preprocessMarkdown, "preprocessMarkdown"); + __name(markdownToLines, "markdownToLines"); + __name(markdownToHTML, "markdownToHTML"); } - return result; + }); + + // src/rendering-util/splitText.ts + function splitTextToChars(text2) { + if (Intl.Segmenter) { + return [...new Intl.Segmenter().segment(text2)].map((s2) => s2.segment); + } + return [...text2]; } - var INFINITY$3 = 1 / 0; - var symbolProto$2 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0; - function baseToString(value2) { - if (typeof value2 == "string") { - return value2; + function splitWordToFitWidth(checkFit, word) { + const characters2 = splitTextToChars(word.content); + return splitWordToFitWidthRecursion(checkFit, [], characters2, word.type); + } + function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type3) { + if (remainingChars.length === 0) { + return [ + { content: usedChars.join(""), type: type3 }, + { content: "", type: type3 } + ]; } - if (isArray$1(value2)) { - return arrayMap(value2, baseToString) + ""; + const [nextChar, ...rest] = remainingChars; + const newWord = [...usedChars, nextChar]; + if (checkFit([{ content: newWord.join(""), type: type3 }])) { + return splitWordToFitWidthRecursion(checkFit, newWord, rest, type3); } - if (isSymbol(value2)) { - return symbolToString ? symbolToString.call(value2) : ""; + if (usedChars.length === 0 && nextChar) { + usedChars.push(nextChar); + remainingChars.shift(); } - var result = value2 + ""; - return result == "0" && 1 / value2 == -INFINITY$3 ? "-0" : result; + return [ + { content: usedChars.join(""), type: type3 }, + { content: remainingChars.join(""), type: type3 } + ]; } - var reWhitespace = /\s/; - function trimmedEndIndex(string2) { - var index2 = string2.length; - while (index2-- && reWhitespace.test(string2.charAt(index2))) { + function splitLineToFitWidth(line2, checkFit) { + if (line2.some(({ content }) => content.includes("\n"))) { + throw new Error("splitLineToFitWidth does not support newlines in the line"); } - return index2; - } - var reTrimStart = /^\s+/; - function baseTrim(string2) { - return string2 ? string2.slice(0, trimmedEndIndex(string2) + 1).replace(reTrimStart, "") : string2; + return splitLineToFitWidthRecursion(line2, checkFit); } - var NAN = 0 / 0; - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - var reIsBinary = /^0b[01]+$/i; - var reIsOctal = /^0o[0-7]+$/i; - var freeParseInt = parseInt; - function toNumber(value2) { - if (typeof value2 == "number") { - return value2; + function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) { + if (words.length === 0) { + if (newLine.length > 0) { + lines.push(newLine); + } + return lines.length > 0 ? lines : []; } - if (isSymbol(value2)) { - return NAN; + let joiner = ""; + if (words[0].content === " ") { + joiner = " "; + words.shift(); } - if (isObject$1(value2)) { - var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2; - value2 = isObject$1(other) ? other + "" : other; + const nextWord = words.shift() ?? { content: " ", type: "normal" }; + const lineWithNextWord = [...newLine]; + if (joiner !== "") { + lineWithNextWord.push({ content: joiner, type: "normal" }); } - if (typeof value2 != "string") { - return value2 === 0 ? value2 : +value2; + lineWithNextWord.push(nextWord); + if (checkFit(lineWithNextWord)) { + return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord); } - value2 = baseTrim(value2); - var isBinary2 = reIsBinary.test(value2); - return isBinary2 || reIsOctal.test(value2) ? freeParseInt(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex.test(value2) ? NAN : +value2; + if (newLine.length > 0) { + lines.push(newLine); + words.unshift(nextWord); + } else if (nextWord.content) { + const [line2, rest] = splitWordToFitWidth(checkFit, nextWord); + lines.push([line2]); + if (rest.content) { + words.unshift(rest); + } + } + return splitLineToFitWidthRecursion(words, checkFit, lines); } - var INFINITY$2 = 1 / 0, MAX_INTEGER = 17976931348623157e292; - function toFinite(value2) { - if (!value2) { - return value2 === 0 ? value2 : 0; + var init_splitText = __esm({ + "src/rendering-util/splitText.ts"() { + "use strict"; + __name(splitTextToChars, "splitTextToChars"); + __name(splitWordToFitWidth, "splitWordToFitWidth"); + __name(splitWordToFitWidthRecursion, "splitWordToFitWidthRecursion"); + __name(splitLineToFitWidth, "splitLineToFitWidth"); + __name(splitLineToFitWidthRecursion, "splitLineToFitWidthRecursion"); } - value2 = toNumber(value2); - if (value2 === INFINITY$2 || value2 === -INFINITY$2) { - var sign2 = value2 < 0 ? -1 : 1; - return sign2 * MAX_INTEGER; + }); + + // src/rendering-util/createText.ts + function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); } - return value2 === value2 ? value2 : 0; } - function toInteger(value2) { - var result = toFinite(value2), remainder = result % 1; - return result === result ? remainder ? result - remainder : result : 0; - } - function noop() { - } - function arrayEach(array2, iteratee) { - var index2 = -1, length2 = array2 == null ? 0 : array2.length; - while (++index2 < length2) { - if (iteratee(array2[index2], index2, array2) === false) { - break; - } + async function addHtmlSpan(element3, node2, width3, classes6, addBackground = false) { + const fo = element3.append("foreignObject"); + const div = fo.append("xhtml:div"); + let label = node2.label; + if (node2.label && hasKatex(node2.label)) { + label = await renderKatex(node2.label.replace(common_default.lineBreakRegex, "\n"), getConfig2()); } - return array2; - } - function baseFindIndex(array2, predicate, fromIndex, fromRight) { - var length2 = array2.length, index2 = fromIndex + (fromRight ? 1 : -1); - while (fromRight ? index2-- : ++index2 < length2) { - if (predicate(array2[index2], index2, array2)) { - return index2; - } + const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel"; + const span = div.append("span"); + span.html(label); + applyStyle(span, node2.labelStyle); + span.attr("class", `${labelClass} ${classes6}`); + applyStyle(div, node2.labelStyle); + div.style("display", "table-cell"); + div.style("white-space", "nowrap"); + div.style("line-height", "1.5"); + div.style("max-width", width3 + "px"); + div.style("text-align", "center"); + div.attr("xmlns", "http://www.w3.org/1999/xhtml"); + if (addBackground) { + div.attr("class", "labelBkg"); } - return -1; - } - function baseIsNaN(value2) { - return value2 !== value2; - } - function strictIndexOf(array2, value2, fromIndex) { - var index2 = fromIndex - 1, length2 = array2.length; - while (++index2 < length2) { - if (array2[index2] === value2) { - return index2; - } + let bbox = div.node().getBoundingClientRect(); + if (bbox.width === width3) { + div.style("display", "table"); + div.style("white-space", "break-spaces"); + div.style("width", width3 + "px"); + bbox = div.node().getBoundingClientRect(); } - return -1; + return fo.node(); } - function baseIndexOf(array2, value2, fromIndex) { - return value2 === value2 ? strictIndexOf(array2, value2, fromIndex) : baseFindIndex(array2, baseIsNaN, fromIndex); + function createTspan(textElement, lineIndex, lineHeight) { + return textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - 0.1 + "em").attr("dy", lineHeight + "em"); } - function arrayIncludes(array2, value2) { - var length2 = array2 == null ? 0 : array2.length; - return !!length2 && baseIndexOf(array2, value2, 0) > -1; + function computeWidthOfText(parentNode, lineHeight, line2) { + const testElement = parentNode.append("text"); + const testSpan = createTspan(testElement, 1, lineHeight); + updateTextContentAndStyles(testSpan, line2); + const textLength = testSpan.node().getComputedTextLength(); + testElement.remove(); + return textLength; } - function keys$1(object2) { - return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2); + function computeDimensionOfText(parentNode, lineHeight, text2) { + const testElement = parentNode.append("text"); + const testSpan = createTspan(testElement, 1, lineHeight); + updateTextContentAndStyles(testSpan, [{ content: text2, type: "normal" }]); + const textDimension = testSpan.node()?.getBoundingClientRect(); + if (textDimension) { + testElement.remove(); + } + return textDimension; } - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; - function isKey(value2, object2) { - if (isArray$1(value2)) { - return false; + function createFormattedText(width3, g2, structuredText, addBackground = false) { + const lineHeight = 1.1; + const labelGroup = g2.append("g"); + const bkg = labelGroup.insert("rect").attr("class", "background").attr("style", "stroke: none"); + const textElement = labelGroup.append("text").attr("y", "-10.1"); + let lineIndex = 0; + for (const line2 of structuredText) { + const checkWidth = /* @__PURE__ */ __name((line3) => computeWidthOfText(labelGroup, lineHeight, line3) <= width3, "checkWidth"); + const linesUnderWidth = checkWidth(line2) ? [line2] : splitLineToFitWidth(line2, checkWidth); + for (const preparedLine of linesUnderWidth) { + const tspan = createTspan(textElement, lineIndex, lineHeight); + updateTextContentAndStyles(tspan, preparedLine); + lineIndex++; + } } - var type2 = typeof value2; - if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value2 == null || isSymbol(value2)) { - return true; + if (addBackground) { + const bbox = textElement.node().getBBox(); + const padding3 = 2; + bkg.attr("x", -padding3).attr("y", -padding3).attr("width", bbox.width + 2 * padding3).attr("height", bbox.height + 2 * padding3); + return labelGroup.node(); + } else { + return textElement.node(); } - return reIsPlainProp.test(value2) || !reIsDeepProp.test(value2) || object2 != null && value2 in Object(object2); } - var MAX_MEMOIZE_SIZE = 500; - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); + function updateTextContentAndStyles(tspan, wrappedLine) { + tspan.text(""); + wrappedLine.forEach((word, index) => { + const innerTspan = tspan.append("tspan").attr("font-style", word.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal"); + if (index === 0) { + innerTspan.text(word.content); + } else { + innerTspan.text(" " + word.content); } - return key; }); - var cache = result.cache; - return result; } - var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = memoizeCapped(function(string2) { - var result = []; - if (string2.charCodeAt(0) === 46) { - result.push(""); + function replaceIconSubstring(text2) { + return text2.replace( + /fa[bklrs]?:fa-[\w-]+/g, + // cspell: disable-line + (s2) => `` + ); + } + var createText; + var init_createText = __esm({ + "src/rendering-util/createText.ts"() { + "use strict"; + init_diagramAPI(); + init_common(); + init_src32(); + init_logger(); + init_handle_markdown_text(); + init_utils2(); + init_splitText(); + __name(applyStyle, "applyStyle"); + __name(addHtmlSpan, "addHtmlSpan"); + __name(createTspan, "createTspan"); + __name(computeWidthOfText, "computeWidthOfText"); + __name(computeDimensionOfText, "computeDimensionOfText"); + __name(createFormattedText, "createFormattedText"); + __name(updateTextContentAndStyles, "updateTextContentAndStyles"); + __name(replaceIconSubstring, "replaceIconSubstring"); + createText = /* @__PURE__ */ __name(async (el, text2 = "", { + style: style3 = "", + isTitle = false, + classes: classes6 = "", + useHtmlLabels = true, + isNode: isNode2 = true, + width: width3 = 200, + addSvgBackground = false + } = {}, config6) => { + log.info( + "XYZ createText", + text2, + style3, + isTitle, + classes6, + useHtmlLabels, + isNode2, + "addSvgBackground: ", + addSvgBackground + ); + if (useHtmlLabels) { + const htmlText = markdownToHTML(text2, config6); + const decodedReplacedText = replaceIconSubstring(decodeEntities(htmlText)); + const inputForKatex = text2.replace(/\\\\/g, "\\"); + const node2 = { + isNode: isNode2, + label: hasKatex(text2) ? inputForKatex : decodedReplacedText, + labelStyle: style3.replace("fill:", "color:") + }; + const vertexNode = await addHtmlSpan(el, node2, width3, classes6, addSvgBackground); + return vertexNode; + } else { + const sanitizeBR = text2.replace(//g, "
    "); + const structuredText = markdownToLines(sanitizeBR.replace("
    ", "
    "), config6); + const svgLabel = createFormattedText( + width3, + el, + structuredText, + text2 ? addSvgBackground : false + ); + if (isNode2) { + if (/stroke:/.exec(style3)) { + style3 = style3.replace("stroke:", "lineColor:"); + } + const nodeLabelTextStyle = style3.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:"); + select_default2(svgLabel).attr("style", nodeLabelTextStyle); + } else { + const edgeLabelRectStyle = style3.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:"); + select_default2(svgLabel).select("rect").attr("style", edgeLabelRectStyle.replace(/background:/g, "fill:")); + const edgeLabelTextStyle = style3.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:"); + select_default2(svgLabel).select("text").attr("style", edgeLabelTextStyle); + } + return svgLabel; + } + }, "createText"); } - string2.replace(rePropName, function(match, number2, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match); - }); - return result; }); - const stringToPath$1 = stringToPath; - function toString$1(value2) { - return value2 == null ? "" : baseToString(value2); - } - function castPath(value2, object2) { - if (isArray$1(value2)) { - return value2; + + // src/dagre-wrapper/createLabel.js + function applyStyle2(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); } - return isKey(value2, object2) ? [value2] : stringToPath$1(toString$1(value2)); } - var INFINITY$1 = 1 / 0; - function toKey(value2) { - if (typeof value2 == "string" || isSymbol(value2)) { - return value2; - } - var result = value2 + ""; - return result == "0" && 1 / value2 == -INFINITY$1 ? "-0" : result; + function addHtmlLabel(node2) { + const fo = select_default2(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")); + const div = fo.append("xhtml:div"); + const label = node2.label; + const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel"; + const span = div.append("span"); + span.html(label); + applyStyle2(span, node2.labelStyle); + span.attr("class", labelClass); + applyStyle2(div, node2.labelStyle); + div.style("display", "inline-block"); + div.style("white-space", "nowrap"); + div.attr("xmlns", "http://www.w3.org/1999/xhtml"); + return fo.node(); } - function baseGet(object2, path2) { - path2 = castPath(path2, object2); - var index2 = 0, length2 = path2.length; - while (object2 != null && index2 < length2) { - object2 = object2[toKey(path2[index2++])]; + var createLabel, createLabel_default; + var init_createLabel = __esm({ + "src/dagre-wrapper/createLabel.js"() { + "use strict"; + init_src32(); + init_logger(); + init_diagramAPI(); + init_common(); + init_utils2(); + init_createText(); + __name(applyStyle2, "applyStyle"); + __name(addHtmlLabel, "addHtmlLabel"); + createLabel = /* @__PURE__ */ __name((_vertexText, style3, isTitle, isNode2) => { + let vertexText = _vertexText || ""; + if (typeof vertexText === "object") { + vertexText = vertexText[0]; + } + if (evaluate(getConfig2().flowchart.htmlLabels)) { + vertexText = vertexText.replace(/\\n|\n/g, "
    "); + log.debug("vertexText" + vertexText); + const node2 = { + isNode: isNode2, + label: replaceIconSubstring(decodeEntities(vertexText)), + labelStyle: style3.replace("fill:", "color:") + }; + let vertexNode = addHtmlLabel(node2); + return vertexNode; + } else { + const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text"); + svgLabel.setAttribute("style", style3.replace("color:", "fill:")); + let rows = []; + if (typeof vertexText === "string") { + rows = vertexText.split(/\\n|\n|/gi); + } else if (Array.isArray(vertexText)) { + rows = vertexText; + } else { + rows = []; + } + for (const row of rows) { + const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); + tspan.setAttribute("dy", "1em"); + tspan.setAttribute("x", "0"); + if (isTitle) { + tspan.setAttribute("class", "title-row"); + } else { + tspan.setAttribute("class", "row"); + } + tspan.textContent = row.trim(); + svgLabel.appendChild(tspan); + } + return svgLabel; + } + }, "createLabel"); + createLabel_default = createLabel; } - return index2 && index2 == length2 ? object2 : void 0; - } - function get$1(object2, path2, defaultValue) { - var result = object2 == null ? void 0 : baseGet(object2, path2); - return result === void 0 ? defaultValue : result; + }); + + // src/dagre-wrapper/intersect/intersect-node.js + function intersectNode(node2, point8) { + return node2.intersect(point8); } - function arrayPush(array2, values2) { - var index2 = -1, length2 = values2.length, offset = array2.length; - while (++index2 < length2) { - array2[offset + index2] = values2[index2]; + var intersect_node_default; + var init_intersect_node = __esm({ + "src/dagre-wrapper/intersect/intersect-node.js"() { + "use strict"; + __name(intersectNode, "intersectNode"); + intersect_node_default = intersectNode; } - return array2; - } - var spreadableSymbol = Symbol$2 ? Symbol$2.isConcatSpreadable : void 0; - function isFlattenable(value2) { - return isArray$1(value2) || isArguments$1(value2) || !!(spreadableSymbol && value2 && value2[spreadableSymbol]); - } - function baseFlatten(array2, depth, predicate, isStrict, result) { - var index2 = -1, length2 = array2.length; - predicate || (predicate = isFlattenable); - result || (result = []); - while (++index2 < length2) { - var value2 = array2[index2]; - if (depth > 0 && predicate(value2)) { - if (depth > 1) { - baseFlatten(value2, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value2); - } - } else if (!isStrict) { - result[result.length] = value2; - } - } - return result; - } - function flatten(array2) { - var length2 = array2 == null ? 0 : array2.length; - return length2 ? baseFlatten(array2, 1) : []; - } - function flatRest(func) { - return setToString$1(overRest(func, void 0, flatten), func + ""); - } - function arrayReduce(array2, iteratee, accumulator, initAccum) { - var index2 = -1, length2 = array2 == null ? 0 : array2.length; - if (initAccum && length2) { - accumulator = array2[++index2]; + }); + + // src/dagre-wrapper/intersect/intersect-ellipse.js + function intersectEllipse(node2, rx, ry, point8) { + var cx = node2.x; + var cy = node2.y; + var px = cx - point8.x; + var py = cy - point8.y; + var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); + var dx = Math.abs(rx * ry * px / det); + if (point8.x < cx) { + dx = -dx; } - while (++index2 < length2) { - accumulator = iteratee(accumulator, array2[index2], index2, array2); + var dy = Math.abs(rx * ry * py / det); + if (point8.y < cy) { + dy = -dy; } - return accumulator; - } - function baseAssign(object2, source) { - return object2 && copyObject(source, keys$1(source), object2); - } - function baseAssignIn(object2, source) { - return object2 && copyObject(source, keysIn(source), object2); + return { x: cx + dx, y: cy + dy }; } - function arrayFilter(array2, predicate) { - var index2 = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = []; - while (++index2 < length2) { - var value2 = array2[index2]; - if (predicate(value2, index2, array2)) { - result[resIndex++] = value2; - } + var intersect_ellipse_default; + var init_intersect_ellipse = __esm({ + "src/dagre-wrapper/intersect/intersect-ellipse.js"() { + "use strict"; + __name(intersectEllipse, "intersectEllipse"); + intersect_ellipse_default = intersectEllipse; } - return result; - } - function stubArray() { - return []; - } - var objectProto$5 = Object.prototype; - var propertyIsEnumerable = objectProto$5.propertyIsEnumerable; - var nativeGetSymbols$1 = Object.getOwnPropertySymbols; - var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object2) { - if (object2 == null) { - return []; + }); + + // src/dagre-wrapper/intersect/intersect-circle.js + function intersectCircle(node2, rx, point8) { + return intersect_ellipse_default(node2, rx, rx, point8); + } + var intersect_circle_default; + var init_intersect_circle = __esm({ + "src/dagre-wrapper/intersect/intersect-circle.js"() { + "use strict"; + init_intersect_ellipse(); + __name(intersectCircle, "intersectCircle"); + intersect_circle_default = intersectCircle; } - object2 = Object(object2); - return arrayFilter(nativeGetSymbols$1(object2), function(symbol) { - return propertyIsEnumerable.call(object2, symbol); - }); - }; - const getSymbols$1 = getSymbols; - function copySymbols(source, object2) { - return copyObject(source, getSymbols$1(source), object2); - } - var nativeGetSymbols = Object.getOwnPropertySymbols; - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object2) { - var result = []; - while (object2) { - arrayPush(result, getSymbols$1(object2)); - object2 = getPrototype$1(object2); + }); + + // src/dagre-wrapper/intersect/intersect-line.js + function intersectLine(p1, p22, q1, q2) { + var a1, a2, b1, b2, c1, c22; + var r1, r2, r3, r4; + var denom, offset, num; + var x5, y5; + a1 = p22.y - p1.y; + b1 = p1.x - p22.x; + c1 = p22.x * p1.y - p1.x * p22.y; + r3 = a1 * q1.x + b1 * q1.y + c1; + r4 = a1 * q2.x + b1 * q2.y + c1; + if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) { + return; } - return result; - }; - const getSymbolsIn$1 = getSymbolsIn; - function copySymbolsIn(source, object2) { - return copyObject(source, getSymbolsIn$1(source), object2); - } - function baseGetAllKeys(object2, keysFunc, symbolsFunc) { - var result = keysFunc(object2); - return isArray$1(object2) ? result : arrayPush(result, symbolsFunc(object2)); - } - function getAllKeys(object2) { - return baseGetAllKeys(object2, keys$1, getSymbols$1); - } - function getAllKeysIn(object2) { - return baseGetAllKeys(object2, keysIn, getSymbolsIn$1); - } - var objectProto$4 = Object.prototype; - var hasOwnProperty$5 = objectProto$4.hasOwnProperty; - function initCloneArray(array2) { - var length2 = array2.length, result = new array2.constructor(length2); - if (length2 && typeof array2[0] == "string" && hasOwnProperty$5.call(array2, "index")) { - result.index = array2.index; - result.input = array2.input; + a2 = q2.y - q1.y; + b2 = q1.x - q2.x; + c22 = q2.x * q1.y - q1.x * q2.y; + r1 = a2 * p1.x + b2 * p1.y + c22; + r2 = a2 * p22.x + b2 * p22.y + c22; + if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) { + return; } - return result; - } - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - var reFlags = /\w*$/; - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0; - function cloneSymbol(symbol) { - return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {}; - } - var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]"; - var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]"; - function initCloneByTag(object2, tag, isDeep) { - var Ctor = object2.constructor; - switch (tag) { - case arrayBufferTag$2: - return cloneArrayBuffer(object2); - case boolTag$2: - case dateTag$2: - return new Ctor(+object2); - case dataViewTag$2: - return cloneDataView(object2, isDeep); - case float32Tag$1: - case float64Tag$1: - case int8Tag$1: - case int16Tag$1: - case int32Tag$1: - case uint8Tag$1: - case uint8ClampedTag$1: - case uint16Tag$1: - case uint32Tag$1: - return cloneTypedArray(object2, isDeep); - case mapTag$3: - return new Ctor(); - case numberTag$2: - case stringTag$2: - return new Ctor(object2); - case regexpTag$2: - return cloneRegExp(object2); - case setTag$3: - return new Ctor(); - case symbolTag$2: - return cloneSymbol(object2); + denom = a1 * b2 - a2 * b1; + if (denom === 0) { + return; } + offset = Math.abs(denom / 2); + num = b1 * c22 - b2 * c1; + x5 = num < 0 ? (num - offset) / denom : (num + offset) / denom; + num = a2 * c1 - a1 * c22; + y5 = num < 0 ? (num - offset) / denom : (num + offset) / denom; + return { x: x5, y: y5 }; } - var mapTag$2 = "[object Map]"; - function baseIsMap(value2) { - return isObjectLike(value2) && getTag$1(value2) == mapTag$2; + function sameSign(r1, r2) { + return r1 * r2 > 0; } - var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap; - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - const isMap$1 = isMap; - var setTag$2 = "[object Set]"; - function baseIsSet(value2) { - return isObjectLike(value2) && getTag$1(value2) == setTag$2; - } - var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet; - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - const isSet$1 = isSet; - var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$2 = 4; - var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]"; - var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; - var cloneableTags = {}; - cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; - function baseClone(value2, bitmask, customizer, key, object2, stack) { - var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$2; - if (customizer) { - result = object2 ? customizer(value2, key, object2, stack) : customizer(value2); - } - if (result !== void 0) { - return result; - } - if (!isObject$1(value2)) { - return value2; + var intersect_line_default; + var init_intersect_line = __esm({ + "src/dagre-wrapper/intersect/intersect-line.js"() { + "use strict"; + __name(intersectLine, "intersectLine"); + __name(sameSign, "sameSign"); + intersect_line_default = intersectLine; } - var isArr = isArray$1(value2); - if (isArr) { - result = initCloneArray(value2); - if (!isDeep) { - return copyArray(value2, result); - } + }); + + // src/dagre-wrapper/intersect/intersect-polygon.js + function intersectPolygon(node2, polyPoints, point8) { + var x1 = node2.x; + var y1 = node2.y; + var intersections = []; + var minX = Number.POSITIVE_INFINITY; + var minY = Number.POSITIVE_INFINITY; + if (typeof polyPoints.forEach === "function") { + polyPoints.forEach(function(entry) { + minX = Math.min(minX, entry.x); + minY = Math.min(minY, entry.y); + }); } else { - var tag = getTag$1(value2), isFunc = tag == funcTag || tag == genTag; - if (isBuffer$1(value2)) { - return cloneBuffer(value2, isDeep); - } - if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object2) { - result = isFlat || isFunc ? {} : initCloneObject(value2); - if (!isDeep) { - return isFlat ? copySymbolsIn(value2, baseAssignIn(result, value2)) : copySymbols(value2, baseAssign(result, value2)); - } - } else { - if (!cloneableTags[tag]) { - return object2 ? value2 : {}; - } - result = initCloneByTag(value2, tag, isDeep); + minX = Math.min(minX, polyPoints.x); + minY = Math.min(minY, polyPoints.y); + } + var left3 = x1 - node2.width / 2 - minX; + var top2 = y1 - node2.height / 2 - minY; + for (var i2 = 0; i2 < polyPoints.length; i2++) { + var p1 = polyPoints[i2]; + var p22 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0]; + var intersect3 = intersect_line_default( + node2, + point8, + { x: left3 + p1.x, y: top2 + p1.y }, + { x: left3 + p22.x, y: top2 + p22.y } + ); + if (intersect3) { + intersections.push(intersect3); } } - stack || (stack = new Stack()); - var stacked = stack.get(value2); - if (stacked) { - return stacked; + if (!intersections.length) { + return node2; } - stack.set(value2, result); - if (isSet$1(value2)) { - value2.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value2, stack)); - }); - } else if (isMap$1(value2)) { - value2.forEach(function(subValue, key2) { - result.set(key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); + if (intersections.length > 1) { + intersections.sort(function(p3, q2) { + var pdx = p3.x - point8.x; + var pdy = p3.y - point8.y; + var distp = Math.sqrt(pdx * pdx + pdy * pdy); + var qdx = q2.x - point8.x; + var qdy = q2.y - point8.y; + var distq = Math.sqrt(qdx * qdx + qdy * qdy); + return distp < distq ? -1 : distp === distq ? 0 : 1; }); } - var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys$1; - var props = isArr ? void 0 : keysFunc(value2); - arrayEach(props || value2, function(subValue, key2) { - if (props) { - key2 = subValue; - subValue = value2[key2]; - } - assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); - }); - return result; - } - var CLONE_SYMBOLS_FLAG$1 = 4; - function clone$1(value2) { - return baseClone(value2, CLONE_SYMBOLS_FLAG$1); - } - var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; - function cloneDeep(value2) { - return baseClone(value2, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - var HASH_UNDEFINED = "__lodash_hash_undefined__"; - function setCacheAdd(value2) { - this.__data__.set(value2, HASH_UNDEFINED); - return this; - } - function setCacheHas(value2) { - return this.__data__.has(value2); - } - function SetCache(values2) { - var index2 = -1, length2 = values2 == null ? 0 : values2.length; - this.__data__ = new MapCache(); - while (++index2 < length2) { - this.add(values2[index2]); - } - } - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - function arraySome(array2, predicate) { - var index2 = -1, length2 = array2 == null ? 0 : array2.length; - while (++index2 < length2) { - if (predicate(array2[index2], index2, array2)) { - return true; - } - } - return false; - } - function cacheHas(cache, key) { - return cache.has(key); + return intersections[0]; } - var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; - function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array2.length, othLength = other.length; - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; + var intersect_polygon_default; + var init_intersect_polygon = __esm({ + "src/dagre-wrapper/intersect/intersect-polygon.js"() { + "use strict"; + init_intersect_line(); + intersect_polygon_default = intersectPolygon; + __name(intersectPolygon, "intersectPolygon"); } - var arrStacked = stack.get(array2); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array2; - } - var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; - stack.set(array2, other); - stack.set(other, array2); - while (++index2 < arrLength) { - var arrValue = array2[index2], othValue = other[index2]; - if (customizer) { - var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack); - } - if (compared !== void 0) { - if (compared) { - continue; - } - result = false; - break; - } - if (seen) { - if (!arraySome(other, function(othValue2, othIndex) { - if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { - return seen.push(othIndex); + }); + + // src/dagre-wrapper/intersect/intersect-rect.js + var intersectRect, intersect_rect_default; + var init_intersect_rect = __esm({ + "src/dagre-wrapper/intersect/intersect-rect.js"() { + "use strict"; + intersectRect = /* @__PURE__ */ __name((node2, point8) => { + var x5 = node2.x; + var y5 = node2.y; + var dx = point8.x - x5; + var dy = point8.y - y5; + var w3 = node2.width / 2; + var h2 = node2.height / 2; + var sx, sy; + if (Math.abs(dy) * w3 > Math.abs(dx) * h2) { + if (dy < 0) { + h2 = -h2; + } + sx = dy === 0 ? 0 : h2 * dx / dy; + sy = h2; + } else { + if (dx < 0) { + w3 = -w3; } - })) { - result = false; - break; + sx = w3; + sy = dx === 0 ? 0 : w3 * dy / dx; } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - result = false; - break; - } + return { x: x5 + sx, y: y5 + sy }; + }, "intersectRect"); + intersect_rect_default = intersectRect; } - stack["delete"](array2); - stack["delete"](other); - return result; - } - function mapToArray(map2) { - var index2 = -1, result = Array(map2.size); - map2.forEach(function(value2, key) { - result[++index2] = [key, value2]; - }); - return result; - } - function setToArray(set2) { - var index2 = -1, result = Array(set2.size); - set2.forEach(function(value2) { - result[++index2] = value2; - }); - return result; - } - var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2; - var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]"; - var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]"; - var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; - function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) { - return false; + }); + + // src/dagre-wrapper/intersect/index.js + var intersect_default; + var init_intersect = __esm({ + "src/dagre-wrapper/intersect/index.js"() { + "use strict"; + init_intersect_node(); + init_intersect_circle(); + init_intersect_ellipse(); + init_intersect_polygon(); + init_intersect_rect(); + intersect_default = { + node: intersect_node_default, + circle: intersect_circle_default, + ellipse: intersect_ellipse_default, + polygon: intersect_polygon_default, + rect: intersect_rect_default + }; + } + }); + + // src/dagre-wrapper/shapes/util.js + function insertPolygonShape(parent4, w3, h2, points) { + return parent4.insert("polygon", ":first-child").attr( + "points", + points.map(function(d2) { + return d2.x + "," + d2.y; + }).join(" ") + ).attr("class", "label-container").attr("transform", "translate(" + -w3 / 2 + "," + h2 / 2 + ")"); + } + var labelHelper, updateNodeBounds; + var init_util = __esm({ + "src/dagre-wrapper/shapes/util.js"() { + "use strict"; + init_createLabel(); + init_createText(); + init_diagramAPI(); + init_src32(); + init_common(); + init_utils2(); + labelHelper = /* @__PURE__ */ __name(async (parent4, node2, _classes, isNode2) => { + const config6 = getConfig2(); + let classes6; + const useHtmlLabels = node2.useHtmlLabels || evaluate(config6.flowchart.htmlLabels); + if (!_classes) { + classes6 = "node default"; + } else { + classes6 = _classes; } - object2 = object2.buffer; - other = other.buffer; - case arrayBufferTag: - if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array$2(object2), new Uint8Array$2(other))) { - return false; + const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id); + const label = shapeSvg.insert("g").attr("class", "label").attr("style", node2.labelStyle); + let labelText; + if (node2.labelText === void 0) { + labelText = ""; + } else { + labelText = typeof node2.labelText === "string" ? node2.labelText : node2.labelText[0]; + } + const textNode = label.node(); + let text2; + if (node2.labelType === "markdown") { + text2 = createText( + label, + sanitizeText(decodeEntities(labelText), config6), + { + useHtmlLabels, + width: node2.width || config6.flowchart.wrappingWidth, + classes: "markdown-node-label" + }, + config6 + ); + } else { + text2 = textNode.appendChild( + createLabel_default(sanitizeText(decodeEntities(labelText), config6), node2.labelStyle, false, isNode2) + ); } - return true; - case boolTag: - case dateTag: - case numberTag: - return eq(+object2, +other); - case errorTag: - return object2.name == other.name && object2.message == other.message; - case regexpTag: - case stringTag: - return object2 == other + ""; - case mapTag: - var convert = mapToArray; - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4; - convert || (convert = setToArray); - if (object2.size != other.size && !isPartial) { - return false; + let bbox = text2.getBBox(); + const halfPadding = node2.padding / 2; + if (evaluate(config6.flowchart.htmlLabels)) { + const div = text2.children[0]; + const dv = select_default2(text2); + const images = div.getElementsByTagName("img"); + if (images) { + const noImgText = labelText.replace(/]*>/g, "").trim() === ""; + await Promise.all( + [...images].map( + (img) => new Promise((res) => { + function setupImage() { + img.style.display = "flex"; + img.style.flexDirection = "column"; + if (noImgText) { + const bodyFontSize = config6.fontSize ? config6.fontSize : window.getComputedStyle(document.body).fontSize; + const enlargingFactor = 5; + const width3 = parseInt(bodyFontSize, 10) * enlargingFactor + "px"; + img.style.minWidth = width3; + img.style.maxWidth = width3; + } else { + img.style.width = "100%"; + } + res(img); + } + __name(setupImage, "setupImage"); + setTimeout(() => { + if (img.complete) { + setupImage(); + } + }); + img.addEventListener("error", setupImage); + img.addEventListener("load", setupImage); + }) + ) + ); + } + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); } - var stacked = stack.get(object2); - if (stacked) { - return stacked == other; + if (useHtmlLabels) { + label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); + } else { + label.attr("transform", "translate(0, " + -bbox.height / 2 + ")"); } - bitmask |= COMPARE_UNORDERED_FLAG$2; - stack.set(object2, other); - var result = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack); - stack["delete"](object2); - return result; - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object2) == symbolValueOf.call(other); + if (node2.centerLabel) { + label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); } + label.insert("rect", ":first-child"); + return { shapeSvg, bbox, halfPadding, label }; + }, "labelHelper"); + updateNodeBounds = /* @__PURE__ */ __name((node2, element3) => { + const bbox = element3.node().getBBox(); + node2.width = bbox.width; + node2.height = bbox.height; + }, "updateNodeBounds"); + __name(insertPolygonShape, "insertPolygonShape"); } - return false; - } - var COMPARE_PARTIAL_FLAG$3 = 1; - var objectProto$3 = Object.prototype; - var hasOwnProperty$4 = objectProto$3.hasOwnProperty; - function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; - if (objLength != othLength && !isPartial) { - return false; - } - var index2 = objLength; - while (index2--) { - var key = objProps[index2]; - if (!(isPartial ? key in other : hasOwnProperty$4.call(other, key))) { - return false; - } - } - var objStacked = stack.get(object2); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object2; + }); + + // src/dagre-wrapper/shapes/note.js + var note, note_default; + var init_note = __esm({ + "src/dagre-wrapper/shapes/note.js"() { + "use strict"; + init_util(); + init_logger(); + init_diagramAPI(); + init_intersect(); + note = /* @__PURE__ */ __name(async (parent4, node2) => { + const useHtmlLabels = node2.useHtmlLabels || getConfig2().flowchart.htmlLabels; + if (!useHtmlLabels) { + node2.centerLabel = true; + } + const { shapeSvg, bbox, halfPadding } = await labelHelper( + parent4, + node2, + "node " + node2.classes, + true + ); + log.info("Classes = ", node2.classes); + const rect4 = shapeSvg.insert("rect", ":first-child"); + rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "note"); + note_default = note; } - var result = true; - stack.set(object2, other); - stack.set(other, object2); - var skipCtor = isPartial; - while (++index2 < objLength) { - key = objProps[index2]; - var objValue = object2[key], othValue = other[key]; - if (customizer) { - var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack); - } - if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { - result = false; - break; - } - skipCtor || (skipCtor = key == "constructor"); + }); + + // src/dagre-wrapper/nodes.js + function applyNodePropertyBorders(rect4, borders, totalWidth, totalHeight) { + const strokeDashArray = []; + const addBorder = /* @__PURE__ */ __name((length2) => { + strokeDashArray.push(length2, 0); + }, "addBorder"); + const skipBorder = /* @__PURE__ */ __name((length2) => { + strokeDashArray.push(0, length2); + }, "skipBorder"); + if (borders.includes("t")) { + log.debug("add top border"); + addBorder(totalWidth); + } else { + skipBorder(totalWidth); } - if (result && !skipCtor) { - var objCtor = object2.constructor, othCtor = other.constructor; - if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { - result = false; - } + if (borders.includes("r")) { + log.debug("add right border"); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); } - stack["delete"](object2); - stack["delete"](other); - return result; - } - var COMPARE_PARTIAL_FLAG$2 = 1; - var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]"; - var objectProto$2 = Object.prototype; - var hasOwnProperty$3 = objectProto$2.hasOwnProperty; - function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray$1(object2), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object2), othTag = othIsArr ? arrayTag : getTag$1(other); - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; - if (isSameTag && isBuffer$1(object2)) { - if (!isBuffer$1(other)) { - return false; - } - objIsArr = true; - objIsObj = false; + if (borders.includes("b")) { + log.debug("add bottom border"); + addBorder(totalWidth); + } else { + skipBorder(totalWidth); } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack()); - return objIsArr || isTypedArray$1(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack); + if (borders.includes("l")) { + log.debug("add left border"); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); } - if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) { - var objIsWrapped = objIsObj && hasOwnProperty$3.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$3.call(other, "__wrapped__"); - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other; - stack || (stack = new Stack()); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } + rect4.attr("stroke-dasharray", strokeDashArray.join(" ")); + } + var formatClass, getClassesFromNode, question, choice, hexagon, block_arrow, rect_left_inv_arrow, lean_right, lean_left, trapezoid, inv_trapezoid, rect_right_inv_arrow, cylinder, rect, composite, labelRect, rectWithTitle, stadium, circle, doublecircle, subroutine, start2, forkJoin, end, class_box, shapes, nodeElems, insertNode, setNodeElem, clear4, positionNode; + var init_nodes2 = __esm({ + "src/dagre-wrapper/nodes.js"() { + "use strict"; + init_src32(); + init_diagramAPI(); + init_common(); + init_logger(); + init_blockArrowHelper(); + init_createLabel(); + init_intersect(); + init_note(); + init_util(); + formatClass = /* @__PURE__ */ __name((str2) => { + if (str2) { + return " " + str2; + } + return ""; + }, "formatClass"); + getClassesFromNode = /* @__PURE__ */ __name((node2, otherClasses) => { + return `${otherClasses ? otherClasses : "node default"}${formatClass(node2.classes)} ${formatClass( + node2.class + )}`; + }, "getClassesFromNode"); + question = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const s2 = w3 + h2; + const points = [ + { x: s2 / 2, y: 0 }, + { x: s2, y: -s2 / 2 }, + { x: s2 / 2, y: -s2 }, + { x: 0, y: -s2 / 2 } + ]; + log.info("Question main (Circle)"); + const questionElem = insertPolygonShape(shapeSvg, s2, s2, points); + questionElem.attr("style", node2.style); + updateNodeBounds(node2, questionElem); + node2.intersect = function(point8) { + log.warn("Intersect called"); + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "question"); + choice = /* @__PURE__ */ __name((parent4, node2) => { + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + const s2 = 28; + const points = [ + { x: 0, y: s2 / 2 }, + { x: s2 / 2, y: 0 }, + { x: 0, y: -s2 / 2 }, + { x: -s2 / 2, y: 0 } + ]; + const choice3 = shapeSvg.insert("polygon", ":first-child").attr( + "points", + points.map(function(d2) { + return d2.x + "," + d2.y; + }).join(" ") + ); + choice3.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28); + node2.width = 28; + node2.height = 28; + node2.intersect = function(point8) { + return intersect_default.circle(node2, 14, point8); + }; + return shapeSvg; + }, "choice"); + hexagon = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const f3 = 4; + const h2 = bbox.height + node2.padding; + const m2 = h2 / f3; + const w3 = bbox.width + 2 * m2 + node2.padding; + const points = [ + { x: m2, y: 0 }, + { x: w3 - m2, y: 0 }, + { x: w3, y: -h2 / 2 }, + { x: w3 - m2, y: -h2 }, + { x: m2, y: -h2 }, + { x: 0, y: -h2 / 2 } + ]; + const hex2 = insertPolygonShape(shapeSvg, w3, h2, points); + hex2.attr("style", node2.style); + updateNodeBounds(node2, hex2); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "hexagon"); + block_arrow = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper(parent4, node2, void 0, true); + const f3 = 2; + const h2 = bbox.height + 2 * node2.padding; + const m2 = h2 / f3; + const w3 = bbox.width + 2 * m2 + node2.padding; + const points = getArrowPoints(node2.directions, bbox, node2); + const blockArrow = insertPolygonShape(shapeSvg, w3, h2, points); + blockArrow.attr("style", node2.style); + updateNodeBounds(node2, blockArrow); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "block_arrow"); + rect_left_inv_arrow = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: -h2 / 2, y: 0 }, + { x: w3, y: 0 }, + { x: w3, y: -h2 }, + { x: -h2 / 2, y: -h2 }, + { x: 0, y: -h2 / 2 } + ]; + const el = insertPolygonShape(shapeSvg, w3, h2, points); + el.attr("style", node2.style); + node2.width = w3 + h2; + node2.height = h2; + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "rect_left_inv_arrow"); + lean_right = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper(parent4, node2, getClassesFromNode(node2), true); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: -2 * h2 / 6, y: 0 }, + { x: w3 - h2 / 6, y: 0 }, + { x: w3 + 2 * h2 / 6, y: -h2 }, + { x: h2 / 6, y: -h2 } + ]; + const el = insertPolygonShape(shapeSvg, w3, h2, points); + el.attr("style", node2.style); + updateNodeBounds(node2, el); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "lean_right"); + lean_left = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: 2 * h2 / 6, y: 0 }, + { x: w3 + h2 / 6, y: 0 }, + { x: w3 - 2 * h2 / 6, y: -h2 }, + { x: -h2 / 6, y: -h2 } + ]; + const el = insertPolygonShape(shapeSvg, w3, h2, points); + el.attr("style", node2.style); + updateNodeBounds(node2, el); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "lean_left"); + trapezoid = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: -2 * h2 / 6, y: 0 }, + { x: w3 + 2 * h2 / 6, y: 0 }, + { x: w3 - h2 / 6, y: -h2 }, + { x: h2 / 6, y: -h2 } + ]; + const el = insertPolygonShape(shapeSvg, w3, h2, points); + el.attr("style", node2.style); + updateNodeBounds(node2, el); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "trapezoid"); + inv_trapezoid = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: h2 / 6, y: 0 }, + { x: w3 - h2 / 6, y: 0 }, + { x: w3 + 2 * h2 / 6, y: -h2 }, + { x: -2 * h2 / 6, y: -h2 } + ]; + const el = insertPolygonShape(shapeSvg, w3, h2, points); + el.attr("style", node2.style); + updateNodeBounds(node2, el); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "inv_trapezoid"); + rect_right_inv_arrow = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: 0, y: 0 }, + { x: w3 + h2 / 2, y: 0 }, + { x: w3, y: -h2 / 2 }, + { x: w3 + h2 / 2, y: -h2 }, + { x: 0, y: -h2 } + ]; + const el = insertPolygonShape(shapeSvg, w3, h2, points); + el.attr("style", node2.style); + updateNodeBounds(node2, el); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "rect_right_inv_arrow"); + cylinder = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const rx = w3 / 2; + const ry = rx / (2.5 + w3 / 50); + const h2 = bbox.height + ry + node2.padding; + const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w3 + " 0 a " + rx + "," + ry + " 0,0,0 " + -w3 + " 0 l 0," + h2 + " a " + rx + "," + ry + " 0,0,0 " + w3 + " 0 l 0," + -h2; + const el = shapeSvg.attr("label-offset-y", ry).insert("path", ":first-child").attr("style", node2.style).attr("d", shape).attr("transform", "translate(" + -w3 / 2 + "," + -(h2 / 2 + ry) + ")"); + updateNodeBounds(node2, el); + node2.intersect = function(point8) { + const pos = intersect_default.rect(node2, point8); + const x5 = pos.x - node2.x; + if (rx != 0 && (Math.abs(x5) < node2.width / 2 || Math.abs(x5) == node2.width / 2 && Math.abs(pos.y - node2.y) > node2.height / 2 - ry)) { + let y5 = ry * ry * (1 - x5 * x5 / (rx * rx)); + if (y5 != 0) { + y5 = Math.sqrt(y5); + } + y5 = ry - y5; + if (point8.y - node2.y > 0) { + y5 = -y5; + } + pos.y += y5; + } + return pos; + }; + return shapeSvg; + }, "cylinder"); + rect = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox, halfPadding } = await labelHelper( + parent4, + node2, + "node " + node2.classes + " " + node2.class, + true + ); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding; + const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding; + const x5 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding; + const y5 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding; + rect4.attr("class", "basic label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight); + if (node2.props) { + const propKeys = new Set(Object.keys(node2.props)); + if (node2.props.borders) { + applyNodePropertyBorders(rect4, node2.props.borders, totalWidth, totalHeight); + propKeys.delete("borders"); + } + propKeys.forEach((propKey) => { + log.warn(`Unknown node property ${propKey}`); + }); + } + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "rect"); + composite = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox, halfPadding } = await labelHelper( + parent4, + node2, + "node " + node2.classes, + true + ); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding; + const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding; + const x5 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding; + const y5 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding; + rect4.attr("class", "basic cluster composite label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight); + if (node2.props) { + const propKeys = new Set(Object.keys(node2.props)); + if (node2.props.borders) { + applyNodePropertyBorders(rect4, node2.props.borders, totalWidth, totalHeight); + propKeys.delete("borders"); + } + propKeys.forEach((propKey) => { + log.warn(`Unknown node property ${propKey}`); + }); + } + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "composite"); + labelRect = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg } = await labelHelper(parent4, node2, "label", true); + log.trace("Classes = ", node2.class); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const totalWidth = 0; + const totalHeight = 0; + rect4.attr("width", totalWidth).attr("height", totalHeight); + shapeSvg.attr("class", "label edgeLabel"); + if (node2.props) { + const propKeys = new Set(Object.keys(node2.props)); + if (node2.props.borders) { + applyNodePropertyBorders(rect4, node2.props.borders, totalWidth, totalHeight); + propKeys.delete("borders"); + } + propKeys.forEach((propKey) => { + log.warn(`Unknown node property ${propKey}`); + }); + } + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "labelRect"); + __name(applyNodePropertyBorders, "applyNodePropertyBorders"); + rectWithTitle = /* @__PURE__ */ __name((parent4, node2) => { + let classes6; + if (!node2.classes) { + classes6 = "node default"; + } else { + classes6 = "node " + node2.classes; + } + const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const innerLine = shapeSvg.insert("line"); + const label = shapeSvg.insert("g").attr("class", "label"); + const text2 = node2.labelText.flat ? node2.labelText.flat() : node2.labelText; + let title2 = ""; + if (typeof text2 === "object") { + title2 = text2[0]; + } else { + title2 = text2; + } + log.info("Label text abc79", title2, text2, typeof text2 === "object"); + const text3 = label.node().appendChild(createLabel_default(title2, node2.labelStyle, true, true)); + let bbox = { width: 0, height: 0 }; + if (evaluate(getConfig2().flowchart.htmlLabels)) { + const div = text3.children[0]; + const dv = select_default2(text3); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + log.info("Text 2", text2); + const textRows = text2.slice(1, text2.length); + let titleBox = text3.getBBox(); + const descr = label.node().appendChild( + createLabel_default(textRows.join ? textRows.join("
    ") : textRows, node2.labelStyle, true, true) + ); + if (evaluate(getConfig2().flowchart.htmlLabels)) { + const div = descr.children[0]; + const dv = select_default2(descr); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + const halfPadding = node2.padding / 2; + select_default2(descr).attr( + "transform", + "translate( " + // (titleBox.width - bbox.width) / 2 + + (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")" + ); + select_default2(text3).attr( + "transform", + "translate( " + // (titleBox.width - bbox.width) / 2 + + (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)" + ); + bbox = label.node().getBBox(); + label.attr( + "transform", + "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")" + ); + rect4.attr("class", "outer title-state").attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); + innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "rectWithTitle"); + stadium = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const h2 = bbox.height + node2.padding; + const w3 = bbox.width + h2 / 4 + node2.padding; + const rect4 = shapeSvg.insert("rect", ":first-child").attr("style", node2.style).attr("rx", h2 / 2).attr("ry", h2 / 2).attr("x", -w3 / 2).attr("y", -h2 / 2).attr("width", w3).attr("height", h2); + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "stadium"); + circle = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox, halfPadding } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const circle6 = shapeSvg.insert("circle", ":first-child"); + circle6.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); + log.info("Circle main"); + updateNodeBounds(node2, circle6); + node2.intersect = function(point8) { + log.info("Circle intersect", node2, bbox.width / 2 + halfPadding, point8); + return intersect_default.circle(node2, bbox.width / 2 + halfPadding, point8); + }; + return shapeSvg; + }, "circle"); + doublecircle = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox, halfPadding } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const gap = 5; + const circleGroup = shapeSvg.insert("g", ":first-child"); + const outerCircle = circleGroup.insert("circle"); + const innerCircle = circleGroup.insert("circle"); + circleGroup.attr("class", node2.class); + outerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding + gap).attr("width", bbox.width + node2.padding + gap * 2).attr("height", bbox.height + node2.padding + gap * 2); + innerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); + log.info("DoubleCircle main"); + updateNodeBounds(node2, outerCircle); + node2.intersect = function(point8) { + log.info("DoubleCircle intersect", node2, bbox.width / 2 + halfPadding + gap, point8); + return intersect_default.circle(node2, bbox.width / 2 + halfPadding + gap, point8); + }; + return shapeSvg; + }, "doublecircle"); + subroutine = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg, bbox } = await labelHelper( + parent4, + node2, + getClassesFromNode(node2, void 0), + true + ); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: 0, y: 0 }, + { x: w3, y: 0 }, + { x: w3, y: -h2 }, + { x: 0, y: -h2 }, + { x: 0, y: 0 }, + { x: -8, y: 0 }, + { x: w3 + 8, y: 0 }, + { x: w3 + 8, y: -h2 }, + { x: -8, y: -h2 }, + { x: -8, y: 0 } + ]; + const el = insertPolygonShape(shapeSvg, w3, h2, points); + el.attr("style", node2.style); + updateNodeBounds(node2, el); + node2.intersect = function(point8) { + return intersect_default.polygon(node2, points, point8); + }; + return shapeSvg; + }, "subroutine"); + start2 = /* @__PURE__ */ __name((parent4, node2) => { + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + const circle6 = shapeSvg.insert("circle", ":first-child"); + circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); + updateNodeBounds(node2, circle6); + node2.intersect = function(point8) { + return intersect_default.circle(node2, 7, point8); + }; + return shapeSvg; + }, "start"); + forkJoin = /* @__PURE__ */ __name((parent4, node2, dir2) => { + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + let width3 = 70; + let height2 = 10; + if (dir2 === "LR") { + width3 = 10; + height2 = 70; + } + const shape = shapeSvg.append("rect").attr("x", -1 * width3 / 2).attr("y", -1 * height2 / 2).attr("width", width3).attr("height", height2).attr("class", "fork-join"); + updateNodeBounds(node2, shape); + node2.height = node2.height + node2.padding / 2; + node2.width = node2.width + node2.padding / 2; + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "forkJoin"); + end = /* @__PURE__ */ __name((parent4, node2) => { + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + const innerCircle = shapeSvg.insert("circle", ":first-child"); + const circle6 = shapeSvg.insert("circle", ":first-child"); + circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); + innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10); + updateNodeBounds(node2, circle6); + node2.intersect = function(point8) { + return intersect_default.circle(node2, 7, point8); + }; + return shapeSvg; + }, "end"); + class_box = /* @__PURE__ */ __name((parent4, node2) => { + const halfPadding = node2.padding / 2; + const rowPadding = 4; + const lineHeight = 8; + let classes6; + if (!node2.classes) { + classes6 = "node default"; + } else { + classes6 = "node " + node2.classes; + } + const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const topLine = shapeSvg.insert("line"); + const bottomLine = shapeSvg.insert("line"); + let maxWidth = 0; + let maxHeight = rowPadding; + const labelContainer = shapeSvg.insert("g").attr("class", "label"); + let verticalPos = 0; + const hasInterface = node2.classData.annotations?.[0]; + const interfaceLabelText = node2.classData.annotations[0] ? "\xAB" + node2.classData.annotations[0] + "\xBB" : ""; + const interfaceLabel = labelContainer.node().appendChild(createLabel_default(interfaceLabelText, node2.labelStyle, true, true)); + let interfaceBBox = interfaceLabel.getBBox(); + if (evaluate(getConfig2().flowchart.htmlLabels)) { + const div = interfaceLabel.children[0]; + const dv = select_default2(interfaceLabel); + interfaceBBox = div.getBoundingClientRect(); + dv.attr("width", interfaceBBox.width); + dv.attr("height", interfaceBBox.height); + } + if (node2.classData.annotations[0]) { + maxHeight += interfaceBBox.height + rowPadding; + maxWidth += interfaceBBox.width; + } + let classTitleString = node2.classData.label; + if (node2.classData.type !== void 0 && node2.classData.type !== "") { + if (getConfig2().flowchart.htmlLabels) { + classTitleString += "<" + node2.classData.type + ">"; + } else { + classTitleString += "<" + node2.classData.type + ">"; + } + } + const classTitleLabel = labelContainer.node().appendChild(createLabel_default(classTitleString, node2.labelStyle, true, true)); + select_default2(classTitleLabel).attr("class", "classTitle"); + let classTitleBBox = classTitleLabel.getBBox(); + if (evaluate(getConfig2().flowchart.htmlLabels)) { + const div = classTitleLabel.children[0]; + const dv = select_default2(classTitleLabel); + classTitleBBox = div.getBoundingClientRect(); + dv.attr("width", classTitleBBox.width); + dv.attr("height", classTitleBBox.height); + } + maxHeight += classTitleBBox.height + rowPadding; + if (classTitleBBox.width > maxWidth) { + maxWidth = classTitleBBox.width; + } + const classAttributes = []; + node2.classData.members.forEach((member) => { + const parsedInfo = member.getDisplayDetails(); + let parsedText = parsedInfo.displayText; + if (getConfig2().flowchart.htmlLabels) { + parsedText = parsedText.replace(//g, ">"); + } + const lbl = labelContainer.node().appendChild( + createLabel_default( + parsedText, + parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle, + true, + true + ) + ); + let bbox = lbl.getBBox(); + if (evaluate(getConfig2().flowchart.htmlLabels)) { + const div = lbl.children[0]; + const dv = select_default2(lbl); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + if (bbox.width > maxWidth) { + maxWidth = bbox.width; + } + maxHeight += bbox.height + rowPadding; + classAttributes.push(lbl); + }); + maxHeight += lineHeight; + const classMethods = []; + node2.classData.methods.forEach((member) => { + const parsedInfo = member.getDisplayDetails(); + let displayText = parsedInfo.displayText; + if (getConfig2().flowchart.htmlLabels) { + displayText = displayText.replace(//g, ">"); + } + const lbl = labelContainer.node().appendChild( + createLabel_default( + displayText, + parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle, + true, + true + ) + ); + let bbox = lbl.getBBox(); + if (evaluate(getConfig2().flowchart.htmlLabels)) { + const div = lbl.children[0]; + const dv = select_default2(lbl); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + if (bbox.width > maxWidth) { + maxWidth = bbox.width; + } + maxHeight += bbox.height + rowPadding; + classMethods.push(lbl); + }); + maxHeight += lineHeight; + if (hasInterface) { + let diffX2 = (maxWidth - interfaceBBox.width) / 2; + select_default2(interfaceLabel).attr( + "transform", + "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")" + ); + verticalPos = interfaceBBox.height + rowPadding; + } + let diffX = (maxWidth - classTitleBBox.width) / 2; + select_default2(classTitleLabel).attr( + "transform", + "translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")" + ); + verticalPos += classTitleBBox.height + rowPadding; + topLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos); + verticalPos += lineHeight; + classAttributes.forEach((lbl) => { + select_default2(lbl).attr( + "transform", + "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")" + ); + const memberBBox = lbl?.getBBox(); + verticalPos += (memberBBox?.height ?? 0) + rowPadding; + }); + verticalPos += lineHeight; + bottomLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos); + verticalPos += lineHeight; + classMethods.forEach((lbl) => { + select_default2(lbl).attr( + "transform", + "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")" + ); + const memberBBox = lbl?.getBBox(); + verticalPos += (memberBBox?.height ?? 0) + rowPadding; + }); + rect4.attr("style", node2.style).attr("class", "outer title-state").attr("x", -maxWidth / 2 - halfPadding).attr("y", -(maxHeight / 2) - halfPadding).attr("width", maxWidth + node2.padding).attr("height", maxHeight + node2.padding); + updateNodeBounds(node2, rect4); + node2.intersect = function(point8) { + return intersect_default.rect(node2, point8); + }; + return shapeSvg; + }, "class_box"); + shapes = { + rhombus: question, + composite, + question, + rect, + labelRect, + rectWithTitle, + choice, + circle, + doublecircle, + stadium, + hexagon, + block_arrow, + rect_left_inv_arrow, + lean_right, + lean_left, + trapezoid, + inv_trapezoid, + rect_right_inv_arrow, + cylinder, + start: start2, + end, + note: note_default, + subroutine, + fork: forkJoin, + join: forkJoin, + class_box + }; + nodeElems = {}; + insertNode = /* @__PURE__ */ __name(async (elem, node2, dir2) => { + let newEl; + let el; + if (node2.link) { + let target; + if (getConfig2().securityLevel === "sandbox") { + target = "_top"; + } else if (node2.linkTarget) { + target = node2.linkTarget || "_blank"; + } + newEl = elem.insert("svg:a").attr("xlink:href", node2.link).attr("target", target); + el = await shapes[node2.shape](newEl, node2, dir2); + } else { + el = await shapes[node2.shape](elem, node2, dir2); + newEl = el; + } + if (node2.tooltip) { + el.attr("title", node2.tooltip); + } + if (node2.class) { + el.attr("class", "node default " + node2.class); + } + nodeElems[node2.id] = newEl; + if (node2.haveCallback) { + nodeElems[node2.id].attr("class", nodeElems[node2.id].attr("class") + " clickable"); + } + return newEl; + }, "insertNode"); + setNodeElem = /* @__PURE__ */ __name((elem, node2) => { + nodeElems[node2.id] = elem; + }, "setNodeElem"); + clear4 = /* @__PURE__ */ __name(() => { + nodeElems = {}; + }, "clear"); + positionNode = /* @__PURE__ */ __name((node2) => { + const el = nodeElems[node2.id]; + log.trace( + "Transforming node", + node2.diff, + node2, + "translate(" + (node2.x - node2.width / 2 - 5) + ", " + node2.width / 2 + ")" + ); + const padding3 = 8; + const diff2 = node2.diff || 0; + if (node2.clusterNode) { + el.attr( + "transform", + "translate(" + (node2.x + diff2 - node2.width / 2) + ", " + (node2.y - node2.height / 2 - padding3) + ")" + ); + } else { + el.attr("transform", "translate(" + node2.x + ", " + node2.y + ")"); + } + return diff2; + }, "positionNode"); } - if (!isSameTag) { - return false; + }); + + // src/rendering-util/insertElementsForSize.js + var getDiagramElement; + var init_insertElementsForSize = __esm({ + "src/rendering-util/insertElementsForSize.js"() { + "use strict"; + init_src32(); + init_nodes2(); + getDiagramElement = /* @__PURE__ */ __name((id26, securityLevel) => { + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id="${id26}"]`); + return svg; + }, "getDiagramElement"); } - stack || (stack = new Stack()); - return equalObjects(object2, other, bitmask, customizer, equalFunc, stack); - } - function baseIsEqual(value2, other, bitmask, customizer, stack) { - if (value2 === other) { - return true; + }); + + // src/utils/subGraphTitleMargins.ts + var getSubGraphTitleMargins; + var init_subGraphTitleMargins = __esm({ + "src/utils/subGraphTitleMargins.ts"() { + "use strict"; + getSubGraphTitleMargins = /* @__PURE__ */ __name(({ + flowchart + }) => { + const subGraphTitleTopMargin = flowchart?.subGraphTitleMargin?.top ?? 0; + const subGraphTitleBottomMargin = flowchart?.subGraphTitleMargin?.bottom ?? 0; + const subGraphTitleTotalMargin = subGraphTitleTopMargin + subGraphTitleBottomMargin; + return { + subGraphTitleTopMargin, + subGraphTitleBottomMargin, + subGraphTitleTotalMargin + }; + }, "getSubGraphTitleMargins"); } - if (value2 == null || other == null || !isObjectLike(value2) && !isObjectLike(other)) { - return value2 !== value2 && other !== other; + }); + + // ../../node_modules/.pnpm/roughjs@4.6.6/node_modules/roughjs/bundled/rough.esm.js + function t(t4, e3, s2) { + if (t4 && t4.length) { + const [n2, o2] = e3, a2 = Math.PI / 180 * s2, h2 = Math.cos(a2), r2 = Math.sin(a2); + for (const e4 of t4) { + const [t5, s3] = e4; + e4[0] = (t5 - n2) * h2 - (s3 - o2) * r2 + n2, e4[1] = (t5 - n2) * r2 + (s3 - o2) * h2 + o2; + } + } + } + function e(t4, e3) { + return t4[0] === e3[0] && t4[1] === e3[1]; + } + function s(s2, n2, o2, a2 = 1) { + const h2 = o2, r2 = Math.max(n2, 0.1), i2 = s2[0] && s2[0][0] && "number" == typeof s2[0][0] ? [s2] : s2, c3 = [0, 0]; + if (h2) for (const e3 of i2) t(e3, c3, h2); + const l2 = function(t4, s3, n3) { + const o3 = []; + for (const s4 of t4) { + const t5 = [...s4]; + e(t5[0], t5[t5.length - 1]) || t5.push([t5[0][0], t5[0][1]]), t5.length > 2 && o3.push(t5); + } + const a3 = []; + s3 = Math.max(s3, 0.1); + const h3 = []; + for (const t5 of o3) for (let e3 = 0; e3 < t5.length - 1; e3++) { + const s4 = t5[e3], n4 = t5[e3 + 1]; + if (s4[1] !== n4[1]) { + const t6 = Math.min(s4[1], n4[1]); + h3.push({ ymin: t6, ymax: Math.max(s4[1], n4[1]), x: t6 === s4[1] ? s4[0] : n4[0], islope: (n4[0] - s4[0]) / (n4[1] - s4[1]) }); + } + } + if (h3.sort((t5, e3) => t5.ymin < e3.ymin ? -1 : t5.ymin > e3.ymin ? 1 : t5.x < e3.x ? -1 : t5.x > e3.x ? 1 : t5.ymax === e3.ymax ? 0 : (t5.ymax - e3.ymax) / Math.abs(t5.ymax - e3.ymax)), !h3.length) return a3; + let r3 = [], i3 = h3[0].ymin, c4 = 0; + for (; r3.length || h3.length; ) { + if (h3.length) { + let t5 = -1; + for (let e3 = 0; e3 < h3.length && !(h3[e3].ymin > i3); e3++) t5 = e3; + h3.splice(0, t5 + 1).forEach((t6) => { + r3.push({ s: i3, edge: t6 }); + }); + } + if (r3 = r3.filter((t5) => !(t5.edge.ymax <= i3)), r3.sort((t5, e3) => t5.edge.x === e3.edge.x ? 0 : (t5.edge.x - e3.edge.x) / Math.abs(t5.edge.x - e3.edge.x)), (1 !== n3 || c4 % s3 == 0) && r3.length > 1) for (let t5 = 0; t5 < r3.length; t5 += 2) { + const e3 = t5 + 1; + if (e3 >= r3.length) break; + const s4 = r3[t5].edge, n4 = r3[e3].edge; + a3.push([[Math.round(s4.x), i3], [Math.round(n4.x), i3]]); + } + i3 += n3, r3.forEach((t5) => { + t5.edge.x = t5.edge.x + n3 * t5.edge.islope; + }), c4++; + } + return a3; + }(i2, r2, a2); + if (h2) { + for (const e3 of i2) t(e3, c3, -h2); + !function(e3, s3, n3) { + const o3 = []; + e3.forEach((t4) => o3.push(...t4)), t(o3, s3, n3); + }(l2, c3, -h2); + } + return l2; + } + function n(t4, e3) { + var n2; + const o2 = e3.hachureAngle + 90; + let a2 = e3.hachureGap; + a2 < 0 && (a2 = 4 * e3.strokeWidth), a2 = Math.round(Math.max(a2, 0.1)); + let h2 = 1; + return e3.roughness >= 1 && ((null === (n2 = e3.randomizer) || void 0 === n2 ? void 0 : n2.next()) || Math.random()) > 0.7 && (h2 = a2), s(t4, a2, o2, h2 || 1); + } + function a(t4) { + const e3 = t4[0], s2 = t4[1]; + return Math.sqrt(Math.pow(e3[0] - s2[0], 2) + Math.pow(e3[1] - s2[1], 2)); + } + function k(t4, e3) { + return t4.type === e3; + } + function b(t4) { + const e3 = [], s2 = function(t5) { + const e4 = new Array(); + for (; "" !== t5; ) if (t5.match(/^([ \t\r\n,]+)/)) t5 = t5.substr(RegExp.$1.length); + else if (t5.match(/^([aAcChHlLmMqQsStTvVzZ])/)) e4[e4.length] = { type: f, text: RegExp.$1 }, t5 = t5.substr(RegExp.$1.length); + else { + if (!t5.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return []; + e4[e4.length] = { type: d, text: `${parseFloat(RegExp.$1)}` }, t5 = t5.substr(RegExp.$1.length); + } + return e4[e4.length] = { type: g, text: "" }, e4; + }(t4); + let n2 = "BOD", o2 = 0, a2 = s2[o2]; + for (; !k(a2, g); ) { + let h2 = 0; + const r2 = []; + if ("BOD" === n2) { + if ("M" !== a2.text && "m" !== a2.text) return b("M0,0" + t4); + o2++, h2 = M[a2.text], n2 = a2.text; + } else k(a2, d) ? h2 = M[n2] : (o2++, h2 = M[a2.text], n2 = a2.text); + if (!(o2 + h2 < s2.length)) throw new Error("Path data ended short"); + for (let t5 = o2; t5 < o2 + h2; t5++) { + const e4 = s2[t5]; + if (!k(e4, d)) throw new Error("Param not a number: " + n2 + "," + e4.text); + r2[r2.length] = +e4.text; + } + if ("number" != typeof M[n2]) throw new Error("Bad segment: " + n2); + { + const t5 = { key: n2, data: r2 }; + e3.push(t5), o2 += h2, a2 = s2[o2], "M" === n2 && (n2 = "L"), "m" === n2 && (n2 = "l"); + } } - return baseIsEqualDeep(value2, other, bitmask, customizer, baseIsEqual, stack); + return e3; } - var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; - function baseIsMatch(object2, source, matchData, customizer) { - var index2 = matchData.length, length2 = index2, noCustomizer = !customizer; - if (object2 == null) { - return !length2; - } - object2 = Object(object2); - while (index2--) { - var data = matchData[index2]; - if (noCustomizer && data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) { - return false; + function y2(t4) { + let e3 = 0, s2 = 0, n2 = 0, o2 = 0; + const a2 = []; + for (const { key: h2, data: r2 } of t4) switch (h2) { + case "M": + a2.push({ key: "M", data: [...r2] }), [e3, s2] = r2, [n2, o2] = r2; + break; + case "m": + e3 += r2[0], s2 += r2[1], a2.push({ key: "M", data: [e3, s2] }), n2 = e3, o2 = s2; + break; + case "L": + a2.push({ key: "L", data: [...r2] }), [e3, s2] = r2; + break; + case "l": + e3 += r2[0], s2 += r2[1], a2.push({ key: "L", data: [e3, s2] }); + break; + case "C": + a2.push({ key: "C", data: [...r2] }), e3 = r2[4], s2 = r2[5]; + break; + case "c": { + const t5 = r2.map((t6, n3) => n3 % 2 ? t6 + s2 : t6 + e3); + a2.push({ key: "C", data: t5 }), e3 = t5[4], s2 = t5[5]; + break; } - } - while (++index2 < length2) { - data = matchData[index2]; - var key = data[0], objValue = object2[key], srcValue = data[1]; - if (noCustomizer && data[2]) { - if (objValue === void 0 && !(key in object2)) { - return false; + case "Q": + a2.push({ key: "Q", data: [...r2] }), e3 = r2[2], s2 = r2[3]; + break; + case "q": { + const t5 = r2.map((t6, n3) => n3 % 2 ? t6 + s2 : t6 + e3); + a2.push({ key: "Q", data: t5 }), e3 = t5[2], s2 = t5[3]; + break; + } + case "A": + a2.push({ key: "A", data: [...r2] }), e3 = r2[5], s2 = r2[6]; + break; + case "a": + e3 += r2[5], s2 += r2[6], a2.push({ key: "A", data: [r2[0], r2[1], r2[2], r2[3], r2[4], e3, s2] }); + break; + case "H": + a2.push({ key: "H", data: [...r2] }), e3 = r2[0]; + break; + case "h": + e3 += r2[0], a2.push({ key: "H", data: [e3] }); + break; + case "V": + a2.push({ key: "V", data: [...r2] }), s2 = r2[0]; + break; + case "v": + s2 += r2[0], a2.push({ key: "V", data: [s2] }); + break; + case "S": + a2.push({ key: "S", data: [...r2] }), e3 = r2[2], s2 = r2[3]; + break; + case "s": { + const t5 = r2.map((t6, n3) => n3 % 2 ? t6 + s2 : t6 + e3); + a2.push({ key: "S", data: t5 }), e3 = t5[2], s2 = t5[3]; + break; + } + case "T": + a2.push({ key: "T", data: [...r2] }), e3 = r2[0], s2 = r2[1]; + break; + case "t": + e3 += r2[0], s2 += r2[1], a2.push({ key: "T", data: [e3, s2] }); + break; + case "Z": + case "z": + a2.push({ key: "Z", data: [] }), e3 = n2, s2 = o2; + } + return a2; + } + function m(t4) { + const e3 = []; + let s2 = "", n2 = 0, o2 = 0, a2 = 0, h2 = 0, r2 = 0, i2 = 0; + for (const { key: c3, data: l2 } of t4) { + switch (c3) { + case "M": + e3.push({ key: "M", data: [...l2] }), [n2, o2] = l2, [a2, h2] = l2; + break; + case "C": + e3.push({ key: "C", data: [...l2] }), n2 = l2[4], o2 = l2[5], r2 = l2[2], i2 = l2[3]; + break; + case "L": + e3.push({ key: "L", data: [...l2] }), [n2, o2] = l2; + break; + case "H": + n2 = l2[0], e3.push({ key: "L", data: [n2, o2] }); + break; + case "V": + o2 = l2[0], e3.push({ key: "L", data: [n2, o2] }); + break; + case "S": { + let t5 = 0, a3 = 0; + "C" === s2 || "S" === s2 ? (t5 = n2 + (n2 - r2), a3 = o2 + (o2 - i2)) : (t5 = n2, a3 = o2), e3.push({ key: "C", data: [t5, a3, ...l2] }), r2 = l2[0], i2 = l2[1], n2 = l2[2], o2 = l2[3]; + break; } - } else { - var stack = new Stack(); - if (customizer) { - var result = customizer(objValue, srcValue, key, object2, source, stack); + case "T": { + const [t5, a3] = l2; + let h3 = 0, c4 = 0; + "Q" === s2 || "T" === s2 ? (h3 = n2 + (n2 - r2), c4 = o2 + (o2 - i2)) : (h3 = n2, c4 = o2); + const u2 = n2 + 2 * (h3 - n2) / 3, p3 = o2 + 2 * (c4 - o2) / 3, f3 = t5 + 2 * (h3 - t5) / 3, d2 = a3 + 2 * (c4 - a3) / 3; + e3.push({ key: "C", data: [u2, p3, f3, d2, t5, a3] }), r2 = h3, i2 = c4, n2 = t5, o2 = a3; + break; } - if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) { - return false; + case "Q": { + const [t5, s3, a3, h3] = l2, c4 = n2 + 2 * (t5 - n2) / 3, u2 = o2 + 2 * (s3 - o2) / 3, p3 = a3 + 2 * (t5 - a3) / 3, f3 = h3 + 2 * (s3 - h3) / 3; + e3.push({ key: "C", data: [c4, u2, p3, f3, a3, h3] }), r2 = t5, i2 = s3, n2 = a3, o2 = h3; + break; + } + case "A": { + const t5 = Math.abs(l2[0]), s3 = Math.abs(l2[1]), a3 = l2[2], h3 = l2[3], r3 = l2[4], i3 = l2[5], c4 = l2[6]; + if (0 === t5 || 0 === s3) e3.push({ key: "C", data: [n2, o2, i3, c4, i3, c4] }), n2 = i3, o2 = c4; + else if (n2 !== i3 || o2 !== c4) { + x2(n2, o2, i3, c4, t5, s3, a3, h3, r3).forEach(function(t6) { + e3.push({ key: "C", data: t6 }); + }), n2 = i3, o2 = c4; + } + break; } + case "Z": + e3.push({ key: "Z", data: [] }), n2 = a2, o2 = h2; } + s2 = c3; } - return true; - } - function isStrictComparable(value2) { - return value2 === value2 && !isObject$1(value2); + return e3; } - function getMatchData(object2) { - var result = keys$1(object2), length2 = result.length; - while (length2--) { - var key = result[length2], value2 = object2[key]; - result[length2] = [key, value2, isStrictComparable(value2)]; - } - return result; + function w(t4, e3, s2) { + return [t4 * Math.cos(s2) - e3 * Math.sin(s2), t4 * Math.sin(s2) + e3 * Math.cos(s2)]; } - function matchesStrictComparable(key, srcValue) { - return function(object2) { - if (object2 == null) { - return false; + function x2(t4, e3, s2, n2, o2, a2, h2, r2, i2, c3) { + const l2 = (u2 = h2, Math.PI * u2 / 180); + var u2; + let p3 = [], f3 = 0, d2 = 0, g2 = 0, M2 = 0; + if (c3) [f3, d2, g2, M2] = c3; + else { + [t4, e3] = w(t4, e3, -l2), [s2, n2] = w(s2, n2, -l2); + const h3 = (t4 - s2) / 2, c4 = (e3 - n2) / 2; + let u3 = h3 * h3 / (o2 * o2) + c4 * c4 / (a2 * a2); + u3 > 1 && (u3 = Math.sqrt(u3), o2 *= u3, a2 *= u3); + const p4 = o2 * o2, k3 = a2 * a2, b3 = p4 * k3 - p4 * c4 * c4 - k3 * h3 * h3, y6 = p4 * c4 * c4 + k3 * h3 * h3, m3 = (r2 === i2 ? -1 : 1) * Math.sqrt(Math.abs(b3 / y6)); + g2 = m3 * o2 * c4 / a2 + (t4 + s2) / 2, M2 = m3 * -a2 * h3 / o2 + (e3 + n2) / 2, f3 = Math.asin(parseFloat(((e3 - M2) / a2).toFixed(9))), d2 = Math.asin(parseFloat(((n2 - M2) / a2).toFixed(9))), t4 < g2 && (f3 = Math.PI - f3), s2 < g2 && (d2 = Math.PI - d2), f3 < 0 && (f3 = 2 * Math.PI + f3), d2 < 0 && (d2 = 2 * Math.PI + d2), i2 && f3 > d2 && (f3 -= 2 * Math.PI), !i2 && d2 > f3 && (d2 -= 2 * Math.PI); + } + let k2 = d2 - f3; + if (Math.abs(k2) > 120 * Math.PI / 180) { + const t5 = d2, e4 = s2, r3 = n2; + d2 = i2 && d2 > f3 ? f3 + 120 * Math.PI / 180 * 1 : f3 + 120 * Math.PI / 180 * -1, p3 = x2(s2 = g2 + o2 * Math.cos(d2), n2 = M2 + a2 * Math.sin(d2), e4, r3, o2, a2, h2, 0, i2, [d2, t5, g2, M2]); + } + k2 = d2 - f3; + const b2 = Math.cos(f3), y5 = Math.sin(f3), m2 = Math.cos(d2), P2 = Math.sin(d2), v3 = Math.tan(k2 / 4), S3 = 4 / 3 * o2 * v3, O2 = 4 / 3 * a2 * v3, L2 = [t4, e3], T3 = [t4 + S3 * y5, e3 - O2 * b2], D3 = [s2 + S3 * P2, n2 - O2 * m2], A2 = [s2, n2]; + if (T3[0] = 2 * L2[0] - T3[0], T3[1] = 2 * L2[1] - T3[1], c3) return [T3, D3, A2].concat(p3); + { + p3 = [T3, D3, A2].concat(p3); + const t5 = []; + for (let e4 = 0; e4 < p3.length; e4 += 3) { + const s3 = w(p3[e4][0], p3[e4][1], l2), n3 = w(p3[e4 + 1][0], p3[e4 + 1][1], l2), o3 = w(p3[e4 + 2][0], p3[e4 + 2][1], l2); + t5.push([s3[0], s3[1], n3[0], n3[1], o3[0], o3[1]]); + } + return t5; + } + } + function v(t4, e3, s2, n2, o2) { + return { type: "path", ops: $(t4, e3, s2, n2, o2) }; + } + function S2(t4, e3, s2) { + const n2 = (t4 || []).length; + if (n2 > 2) { + const o2 = []; + for (let e4 = 0; e4 < n2 - 1; e4++) o2.push(...$(t4[e4][0], t4[e4][1], t4[e4 + 1][0], t4[e4 + 1][1], s2)); + return e3 && o2.push(...$(t4[n2 - 1][0], t4[n2 - 1][1], t4[0][0], t4[0][1], s2)), { type: "path", ops: o2 }; + } + return 2 === n2 ? v(t4[0][0], t4[0][1], t4[1][0], t4[1][1], s2) : { type: "path", ops: [] }; + } + function O(t4, e3, s2, n2, o2) { + return function(t5, e4) { + return S2(t5, true, e4); + }([[t4, e3], [t4 + s2, e3], [t4 + s2, e3 + n2], [t4, e3 + n2]], o2); + } + function L(t4, e3) { + if (t4.length) { + const s2 = "number" == typeof t4[0][0] ? [t4] : t4, n2 = j(s2[0], 1 * (1 + 0.2 * e3.roughness), e3), o2 = e3.disableMultiStroke ? [] : j(s2[0], 1.5 * (1 + 0.22 * e3.roughness), z(e3)); + for (let t5 = 1; t5 < s2.length; t5++) { + const a2 = s2[t5]; + if (a2.length) { + const t6 = j(a2, 1 * (1 + 0.2 * e3.roughness), e3), s3 = e3.disableMultiStroke ? [] : j(a2, 1.5 * (1 + 0.22 * e3.roughness), z(e3)); + for (const e4 of t6) "move" !== e4.op && n2.push(e4); + for (const t7 of s3) "move" !== t7.op && o2.push(t7); + } + } + return { type: "path", ops: n2.concat(o2) }; + } + return { type: "path", ops: [] }; + } + function T2(t4, e3, s2) { + const n2 = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t4 / 2, 2) + Math.pow(e3 / 2, 2)) / 2)), o2 = Math.ceil(Math.max(s2.curveStepCount, s2.curveStepCount / Math.sqrt(200) * n2)), a2 = 2 * Math.PI / o2; + let h2 = Math.abs(t4 / 2), r2 = Math.abs(e3 / 2); + const i2 = 1 - s2.curveFitting; + return h2 += G(h2 * i2, s2), r2 += G(r2 * i2, s2), { increment: a2, rx: h2, ry: r2 }; + } + function D2(t4, e3, s2, n2) { + const [o2, a2] = F(n2.increment, t4, e3, n2.rx, n2.ry, 1, n2.increment * E(0.1, E(0.4, 1, s2), s2), s2); + let h2 = q(o2, null, s2); + if (!s2.disableMultiStroke && 0 !== s2.roughness) { + const [o3] = F(n2.increment, t4, e3, n2.rx, n2.ry, 1.5, 0, s2), a3 = q(o3, null, s2); + h2 = h2.concat(a3); + } + return { estimatedPoints: a2, opset: { type: "path", ops: h2 } }; + } + function A(t4, e3, s2, n2, o2, a2, h2, r2, i2) { + const c3 = t4, l2 = e3; + let u2 = Math.abs(s2 / 2), p3 = Math.abs(n2 / 2); + u2 += G(0.01 * u2, i2), p3 += G(0.01 * p3, i2); + let f3 = o2, d2 = a2; + for (; f3 < 0; ) f3 += 2 * Math.PI, d2 += 2 * Math.PI; + d2 - f3 > 2 * Math.PI && (f3 = 0, d2 = 2 * Math.PI); + const g2 = 2 * Math.PI / i2.curveStepCount, M2 = Math.min(g2 / 2, (d2 - f3) / 2), k2 = V(M2, c3, l2, u2, p3, f3, d2, 1, i2); + if (!i2.disableMultiStroke) { + const t5 = V(M2, c3, l2, u2, p3, f3, d2, 1.5, i2); + k2.push(...t5); + } + return h2 && (r2 ? k2.push(...$(c3, l2, c3 + u2 * Math.cos(f3), l2 + p3 * Math.sin(f3), i2), ...$(c3, l2, c3 + u2 * Math.cos(d2), l2 + p3 * Math.sin(d2), i2)) : k2.push({ op: "lineTo", data: [c3, l2] }, { op: "lineTo", data: [c3 + u2 * Math.cos(f3), l2 + p3 * Math.sin(f3)] })), { type: "path", ops: k2 }; + } + function _(t4, e3) { + const s2 = m(y2(b(t4))), n2 = []; + let o2 = [0, 0], a2 = [0, 0]; + for (const { key: t5, data: h2 } of s2) switch (t5) { + case "M": + a2 = [h2[0], h2[1]], o2 = [h2[0], h2[1]]; + break; + case "L": + n2.push(...$(a2[0], a2[1], h2[0], h2[1], e3)), a2 = [h2[0], h2[1]]; + break; + case "C": { + const [t6, s3, o3, r2, i2, c3] = h2; + n2.push(...Z(t6, s3, o3, r2, i2, c3, a2, e3)), a2 = [i2, c3]; + break; } - return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2)); - }; - } - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); + case "Z": + n2.push(...$(a2[0], a2[1], o2[0], o2[1], e3)), a2 = [o2[0], o2[1]]; } - return function(object2) { - return object2 === source || baseIsMatch(object2, source, matchData); - }; + return { type: "path", ops: n2 }; } - function baseHasIn(object2, key) { - return object2 != null && key in Object(object2); - } - function hasPath(object2, path2, hasFunc) { - path2 = castPath(path2, object2); - var index2 = -1, length2 = path2.length, result = false; - while (++index2 < length2) { - var key = toKey(path2[index2]); - if (!(result = object2 != null && hasFunc(object2, key))) { - break; + function I(t4, e3) { + const s2 = []; + for (const n2 of t4) if (n2.length) { + const t5 = e3.maxRandomnessOffset || 0, o2 = n2.length; + if (o2 > 2) { + s2.push({ op: "move", data: [n2[0][0] + G(t5, e3), n2[0][1] + G(t5, e3)] }); + for (let a2 = 1; a2 < o2; a2++) s2.push({ op: "lineTo", data: [n2[a2][0] + G(t5, e3), n2[a2][1] + G(t5, e3)] }); } - object2 = object2[key]; } - if (result || ++index2 != length2) { - return result; - } - length2 = object2 == null ? 0 : object2.length; - return !!length2 && isLength(length2) && isIndex(key, length2) && (isArray$1(object2) || isArguments$1(object2)); + return { type: "fillPath", ops: s2 }; } - function hasIn(object2, path2) { - return object2 != null && hasPath(object2, path2, baseHasIn); - } - var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; - function baseMatchesProperty(path2, srcValue) { - if (isKey(path2) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path2), srcValue); + function C(t4, e3) { + return function(t5, e4) { + let s2 = t5.fillStyle || "hachure"; + if (!u[s2]) switch (s2) { + case "zigzag": + u[s2] || (u[s2] = new h(e4)); + break; + case "cross-hatch": + u[s2] || (u[s2] = new r(e4)); + break; + case "dots": + u[s2] || (u[s2] = new i(e4)); + break; + case "dashed": + u[s2] || (u[s2] = new c2(e4)); + break; + case "zigzag-line": + u[s2] || (u[s2] = new l(e4)); + break; + default: + s2 = "hachure", u[s2] || (u[s2] = new o(e4)); + } + return u[s2]; + }(e3, P).fillPolygons(t4, e3); + } + function z(t4) { + const e3 = Object.assign({}, t4); + return e3.randomizer = void 0, t4.seed && (e3.seed = t4.seed + 1), e3; + } + function W(t4) { + return t4.randomizer || (t4.randomizer = new p(t4.seed || 0)), t4.randomizer.next(); + } + function E(t4, e3, s2, n2 = 1) { + return s2.roughness * n2 * (W(s2) * (e3 - t4) + t4); + } + function G(t4, e3, s2 = 1) { + return E(-t4, t4, e3, s2); + } + function $(t4, e3, s2, n2, o2, a2 = false) { + const h2 = a2 ? o2.disableMultiStrokeFill : o2.disableMultiStroke, r2 = R(t4, e3, s2, n2, o2, true, false); + if (h2) return r2; + const i2 = R(t4, e3, s2, n2, o2, true, true); + return r2.concat(i2); + } + function R(t4, e3, s2, n2, o2, a2, h2) { + const r2 = Math.pow(t4 - s2, 2) + Math.pow(e3 - n2, 2), i2 = Math.sqrt(r2); + let c3 = 1; + c3 = i2 < 200 ? 1 : i2 > 500 ? 0.4 : -16668e-7 * i2 + 1.233334; + let l2 = o2.maxRandomnessOffset || 0; + l2 * l2 * 100 > r2 && (l2 = i2 / 10); + const u2 = l2 / 2, p3 = 0.2 + 0.2 * W(o2); + let f3 = o2.bowing * o2.maxRandomnessOffset * (n2 - e3) / 200, d2 = o2.bowing * o2.maxRandomnessOffset * (t4 - s2) / 200; + f3 = G(f3, o2, c3), d2 = G(d2, o2, c3); + const g2 = [], M2 = /* @__PURE__ */ __name(() => G(u2, o2, c3), "M"), k2 = /* @__PURE__ */ __name(() => G(l2, o2, c3), "k"), b2 = o2.preserveVertices; + return a2 && (h2 ? g2.push({ op: "move", data: [t4 + (b2 ? 0 : M2()), e3 + (b2 ? 0 : M2())] }) : g2.push({ op: "move", data: [t4 + (b2 ? 0 : G(l2, o2, c3)), e3 + (b2 ? 0 : G(l2, o2, c3))] })), h2 ? g2.push({ op: "bcurveTo", data: [f3 + t4 + (s2 - t4) * p3 + M2(), d2 + e3 + (n2 - e3) * p3 + M2(), f3 + t4 + 2 * (s2 - t4) * p3 + M2(), d2 + e3 + 2 * (n2 - e3) * p3 + M2(), s2 + (b2 ? 0 : M2()), n2 + (b2 ? 0 : M2())] }) : g2.push({ op: "bcurveTo", data: [f3 + t4 + (s2 - t4) * p3 + k2(), d2 + e3 + (n2 - e3) * p3 + k2(), f3 + t4 + 2 * (s2 - t4) * p3 + k2(), d2 + e3 + 2 * (n2 - e3) * p3 + k2(), s2 + (b2 ? 0 : k2()), n2 + (b2 ? 0 : k2())] }), g2; + } + function j(t4, e3, s2) { + if (!t4.length) return []; + const n2 = []; + n2.push([t4[0][0] + G(e3, s2), t4[0][1] + G(e3, s2)]), n2.push([t4[0][0] + G(e3, s2), t4[0][1] + G(e3, s2)]); + for (let o2 = 1; o2 < t4.length; o2++) n2.push([t4[o2][0] + G(e3, s2), t4[o2][1] + G(e3, s2)]), o2 === t4.length - 1 && n2.push([t4[o2][0] + G(e3, s2), t4[o2][1] + G(e3, s2)]); + return q(n2, null, s2); + } + function q(t4, e3, s2) { + const n2 = t4.length, o2 = []; + if (n2 > 3) { + const a2 = [], h2 = 1 - s2.curveTightness; + o2.push({ op: "move", data: [t4[1][0], t4[1][1]] }); + for (let e4 = 1; e4 + 2 < n2; e4++) { + const s3 = t4[e4]; + a2[0] = [s3[0], s3[1]], a2[1] = [s3[0] + (h2 * t4[e4 + 1][0] - h2 * t4[e4 - 1][0]) / 6, s3[1] + (h2 * t4[e4 + 1][1] - h2 * t4[e4 - 1][1]) / 6], a2[2] = [t4[e4 + 1][0] + (h2 * t4[e4][0] - h2 * t4[e4 + 2][0]) / 6, t4[e4 + 1][1] + (h2 * t4[e4][1] - h2 * t4[e4 + 2][1]) / 6], a2[3] = [t4[e4 + 1][0], t4[e4 + 1][1]], o2.push({ op: "bcurveTo", data: [a2[1][0], a2[1][1], a2[2][0], a2[2][1], a2[3][0], a2[3][1]] }); + } + if (e3 && 2 === e3.length) { + const t5 = s2.maxRandomnessOffset; + o2.push({ op: "lineTo", data: [e3[0] + G(t5, s2), e3[1] + G(t5, s2)] }); + } + } else 3 === n2 ? (o2.push({ op: "move", data: [t4[1][0], t4[1][1]] }), o2.push({ op: "bcurveTo", data: [t4[1][0], t4[1][1], t4[2][0], t4[2][1], t4[2][0], t4[2][1]] })) : 2 === n2 && o2.push(...R(t4[0][0], t4[0][1], t4[1][0], t4[1][1], s2, true, true)); + return o2; + } + function F(t4, e3, s2, n2, o2, a2, h2, r2) { + const i2 = [], c3 = []; + if (0 === r2.roughness) { + t4 /= 4, c3.push([e3 + n2 * Math.cos(-t4), s2 + o2 * Math.sin(-t4)]); + for (let a3 = 0; a3 <= 2 * Math.PI; a3 += t4) { + const t5 = [e3 + n2 * Math.cos(a3), s2 + o2 * Math.sin(a3)]; + i2.push(t5), c3.push(t5); + } + c3.push([e3 + n2 * Math.cos(0), s2 + o2 * Math.sin(0)]), c3.push([e3 + n2 * Math.cos(t4), s2 + o2 * Math.sin(t4)]); + } else { + const l2 = G(0.5, r2) - Math.PI / 2; + c3.push([G(a2, r2) + e3 + 0.9 * n2 * Math.cos(l2 - t4), G(a2, r2) + s2 + 0.9 * o2 * Math.sin(l2 - t4)]); + const u2 = 2 * Math.PI + l2 - 0.01; + for (let h3 = l2; h3 < u2; h3 += t4) { + const t5 = [G(a2, r2) + e3 + n2 * Math.cos(h3), G(a2, r2) + s2 + o2 * Math.sin(h3)]; + i2.push(t5), c3.push(t5); + } + c3.push([G(a2, r2) + e3 + n2 * Math.cos(l2 + 2 * Math.PI + 0.5 * h2), G(a2, r2) + s2 + o2 * Math.sin(l2 + 2 * Math.PI + 0.5 * h2)]), c3.push([G(a2, r2) + e3 + 0.98 * n2 * Math.cos(l2 + h2), G(a2, r2) + s2 + 0.98 * o2 * Math.sin(l2 + h2)]), c3.push([G(a2, r2) + e3 + 0.9 * n2 * Math.cos(l2 + 0.5 * h2), G(a2, r2) + s2 + 0.9 * o2 * Math.sin(l2 + 0.5 * h2)]); + } + return [c3, i2]; + } + function V(t4, e3, s2, n2, o2, a2, h2, r2, i2) { + const c3 = a2 + G(0.1, i2), l2 = []; + l2.push([G(r2, i2) + e3 + 0.9 * n2 * Math.cos(c3 - t4), G(r2, i2) + s2 + 0.9 * o2 * Math.sin(c3 - t4)]); + for (let a3 = c3; a3 <= h2; a3 += t4) l2.push([G(r2, i2) + e3 + n2 * Math.cos(a3), G(r2, i2) + s2 + o2 * Math.sin(a3)]); + return l2.push([e3 + n2 * Math.cos(h2), s2 + o2 * Math.sin(h2)]), l2.push([e3 + n2 * Math.cos(h2), s2 + o2 * Math.sin(h2)]), q(l2, null, i2); + } + function Z(t4, e3, s2, n2, o2, a2, h2, r2) { + const i2 = [], c3 = [r2.maxRandomnessOffset || 1, (r2.maxRandomnessOffset || 1) + 0.3]; + let l2 = [0, 0]; + const u2 = r2.disableMultiStroke ? 1 : 2, p3 = r2.preserveVertices; + for (let f3 = 0; f3 < u2; f3++) 0 === f3 ? i2.push({ op: "move", data: [h2[0], h2[1]] }) : i2.push({ op: "move", data: [h2[0] + (p3 ? 0 : G(c3[0], r2)), h2[1] + (p3 ? 0 : G(c3[0], r2))] }), l2 = p3 ? [o2, a2] : [o2 + G(c3[f3], r2), a2 + G(c3[f3], r2)], i2.push({ op: "bcurveTo", data: [t4 + G(c3[f3], r2), e3 + G(c3[f3], r2), s2 + G(c3[f3], r2), n2 + G(c3[f3], r2), l2[0], l2[1]] }); + return i2; + } + function Q(t4) { + return [...t4]; + } + function H(t4, e3 = 0) { + const s2 = t4.length; + if (s2 < 3) throw new Error("A curve must have at least three points."); + const n2 = []; + if (3 === s2) n2.push(Q(t4[0]), Q(t4[1]), Q(t4[2]), Q(t4[2])); + else { + const s3 = []; + s3.push(t4[0], t4[0]); + for (let e4 = 1; e4 < t4.length; e4++) s3.push(t4[e4]), e4 === t4.length - 1 && s3.push(t4[e4]); + const o2 = [], a2 = 1 - e3; + n2.push(Q(s3[0])); + for (let t5 = 1; t5 + 2 < s3.length; t5++) { + const e4 = s3[t5]; + o2[0] = [e4[0], e4[1]], o2[1] = [e4[0] + (a2 * s3[t5 + 1][0] - a2 * s3[t5 - 1][0]) / 6, e4[1] + (a2 * s3[t5 + 1][1] - a2 * s3[t5 - 1][1]) / 6], o2[2] = [s3[t5 + 1][0] + (a2 * s3[t5][0] - a2 * s3[t5 + 2][0]) / 6, s3[t5 + 1][1] + (a2 * s3[t5][1] - a2 * s3[t5 + 2][1]) / 6], o2[3] = [s3[t5 + 1][0], s3[t5 + 1][1]], n2.push(o2[1], o2[2], o2[3]); + } + } + return n2; + } + function N(t4, e3) { + return Math.pow(t4[0] - e3[0], 2) + Math.pow(t4[1] - e3[1], 2); + } + function B(t4, e3, s2) { + const n2 = N(e3, s2); + if (0 === n2) return N(t4, e3); + let o2 = ((t4[0] - e3[0]) * (s2[0] - e3[0]) + (t4[1] - e3[1]) * (s2[1] - e3[1])) / n2; + return o2 = Math.max(0, Math.min(1, o2)), N(t4, J(e3, s2, o2)); + } + function J(t4, e3, s2) { + return [t4[0] + (e3[0] - t4[0]) * s2, t4[1] + (e3[1] - t4[1]) * s2]; + } + function K2(t4, e3, s2, n2) { + const o2 = n2 || []; + if (function(t5, e4) { + const s3 = t5[e4 + 0], n3 = t5[e4 + 1], o3 = t5[e4 + 2], a3 = t5[e4 + 3]; + let h3 = 3 * n3[0] - 2 * s3[0] - a3[0]; + h3 *= h3; + let r2 = 3 * n3[1] - 2 * s3[1] - a3[1]; + r2 *= r2; + let i2 = 3 * o3[0] - 2 * a3[0] - s3[0]; + i2 *= i2; + let c3 = 3 * o3[1] - 2 * a3[1] - s3[1]; + return c3 *= c3, h3 < i2 && (h3 = i2), r2 < c3 && (r2 = c3), h3 + r2; + }(t4, e3) < s2) { + const s3 = t4[e3 + 0]; + if (o2.length) { + (a2 = o2[o2.length - 1], h2 = s3, Math.sqrt(N(a2, h2))) > 1 && o2.push(s3); + } else o2.push(s3); + o2.push(t4[e3 + 3]); + } else { + const n3 = 0.5, a3 = t4[e3 + 0], h3 = t4[e3 + 1], r2 = t4[e3 + 2], i2 = t4[e3 + 3], c3 = J(a3, h3, n3), l2 = J(h3, r2, n3), u2 = J(r2, i2, n3), p3 = J(c3, l2, n3), f3 = J(l2, u2, n3), d2 = J(p3, f3, n3); + K2([a3, c3, p3, d2], 0, s2, o2), K2([d2, f3, u2, i2], 0, s2, o2); } - return function(object2) { - var objValue = get$1(object2, path2); - return objValue === void 0 && objValue === srcValue ? hasIn(object2, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; - } - function baseProperty(key) { - return function(object2) { - return object2 == null ? void 0 : object2[key]; - }; + var a2, h2; + return o2; } - function basePropertyDeep(path2) { - return function(object2) { - return baseGet(object2, path2); - }; - } - function property(path2) { - return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2); + function U(t4, e3) { + return X2(t4, 0, t4.length, e3); } - function baseIteratee(value2) { - if (typeof value2 == "function") { - return value2; - } - if (value2 == null) { - return identity; - } - if (typeof value2 == "object") { - return isArray$1(value2) ? baseMatchesProperty(value2[0], value2[1]) : baseMatches(value2); + function X2(t4, e3, s2, n2, o2) { + const a2 = o2 || [], h2 = t4[e3], r2 = t4[s2 - 1]; + let i2 = 0, c3 = 1; + for (let n3 = e3 + 1; n3 < s2 - 1; ++n3) { + const e4 = B(t4[n3], h2, r2); + e4 > i2 && (i2 = e4, c3 = n3); } - return property(value2); - } - function baseForOwn(object2, iteratee) { - return object2 && baseFor$1(object2, iteratee, keys$1); + return Math.sqrt(i2) > n2 ? (X2(t4, e3, c3 + 1, n2, a2), X2(t4, c3, s2, n2, a2)) : (a2.length || a2.push(h2), a2.push(r2)), a2; } - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length2 = collection.length, index2 = fromRight ? length2 : -1, iterable = Object(collection); - while (fromRight ? index2-- : ++index2 < length2) { - if (iteratee(iterable[index2], index2, iterable) === false) { - break; + function Y2(t4, e3 = 0.15, s2) { + const n2 = [], o2 = (t4.length - 1) / 3; + for (let s3 = 0; s3 < o2; s3++) { + K2(t4, 3 * s3, e3, n2); + } + return s2 && s2 > 0 ? X2(n2, 0, n2.length, s2) : n2; + } + var o, h, r, i, c2, l, u, p, f, d, g, M, P, tt, et, st, nt, ot, at; + var init_rough_esm = __esm({ + "../../node_modules/.pnpm/roughjs@4.6.6/node_modules/roughjs/bundled/rough.esm.js"() { + "use strict"; + __name(t, "t"); + __name(e, "e"); + __name(s, "s"); + __name(n, "n"); + o = class { + static { + __name(this, "o"); } - } - return collection; - }; - } - var baseEach = createBaseEach(baseForOwn); - const baseEach$1 = baseEach; - var now = function() { - return root$1.Date.now(); - }; - const now$1 = now; - var objectProto$1 = Object.prototype; - var hasOwnProperty$2 = objectProto$1.hasOwnProperty; - var defaults = baseRest(function(object2, sources) { - object2 = Object(object2); - var index2 = -1; - var length2 = sources.length; - var guard = length2 > 2 ? sources[2] : void 0; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length2 = 1; - } - while (++index2 < length2) { - var source = sources[index2]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value2 = object2[key]; - if (value2 === void 0 || eq(value2, objectProto$1[key]) && !hasOwnProperty$2.call(object2, key)) { - object2[key] = source[key]; - } - } - } - return object2; - }); - const defaults$1 = defaults; - function arrayIncludesWith(array2, value2, comparator) { - var index2 = -1, length2 = array2 == null ? 0 : array2.length; - while (++index2 < length2) { - if (comparator(value2, array2[index2])) { - return true; - } + constructor(t4) { + this.helper = t4; + } + fillPolygons(t4, e3) { + return this._fillPolygons(t4, e3); + } + _fillPolygons(t4, e3) { + const s2 = n(t4, e3); + return { type: "fillSketch", ops: this.renderLines(s2, e3) }; + } + renderLines(t4, e3) { + const s2 = []; + for (const n2 of t4) s2.push(...this.helper.doubleLineOps(n2[0][0], n2[0][1], n2[1][0], n2[1][1], e3)); + return s2; + } + }; + __name(a, "a"); + h = class extends o { + static { + __name(this, "h"); + } + fillPolygons(t4, e3) { + let s2 = e3.hachureGap; + s2 < 0 && (s2 = 4 * e3.strokeWidth), s2 = Math.max(s2, 0.1); + const o2 = n(t4, Object.assign({}, e3, { hachureGap: s2 })), h2 = Math.PI / 180 * e3.hachureAngle, r2 = [], i2 = 0.5 * s2 * Math.cos(h2), c3 = 0.5 * s2 * Math.sin(h2); + for (const [t5, e4] of o2) a([t5, e4]) && r2.push([[t5[0] - i2, t5[1] + c3], [...e4]], [[t5[0] + i2, t5[1] - c3], [...e4]]); + return { type: "fillSketch", ops: this.renderLines(r2, e3) }; + } + }; + r = class extends o { + static { + __name(this, "r"); + } + fillPolygons(t4, e3) { + const s2 = this._fillPolygons(t4, e3), n2 = Object.assign({}, e3, { hachureAngle: e3.hachureAngle + 90 }), o2 = this._fillPolygons(t4, n2); + return s2.ops = s2.ops.concat(o2.ops), s2; + } + }; + i = class { + static { + __name(this, "i"); + } + constructor(t4) { + this.helper = t4; + } + fillPolygons(t4, e3) { + const s2 = n(t4, e3 = Object.assign({}, e3, { hachureAngle: 0 })); + return this.dotsOnLines(s2, e3); + } + dotsOnLines(t4, e3) { + const s2 = []; + let n2 = e3.hachureGap; + n2 < 0 && (n2 = 4 * e3.strokeWidth), n2 = Math.max(n2, 0.1); + let o2 = e3.fillWeight; + o2 < 0 && (o2 = e3.strokeWidth / 2); + const h2 = n2 / 4; + for (const r2 of t4) { + const t5 = a(r2), i2 = t5 / n2, c3 = Math.ceil(i2) - 1, l2 = t5 - c3 * n2, u2 = (r2[0][0] + r2[1][0]) / 2 - n2 / 4, p3 = Math.min(r2[0][1], r2[1][1]); + for (let t6 = 0; t6 < c3; t6++) { + const a2 = p3 + l2 + t6 * n2, r3 = u2 - h2 + 2 * Math.random() * h2, i3 = a2 - h2 + 2 * Math.random() * h2, c4 = this.helper.ellipse(r3, i3, o2, o2, e3); + s2.push(...c4.ops); + } + } + return { type: "fillSketch", ops: s2 }; + } + }; + c2 = class { + static { + __name(this, "c"); + } + constructor(t4) { + this.helper = t4; + } + fillPolygons(t4, e3) { + const s2 = n(t4, e3); + return { type: "fillSketch", ops: this.dashedLine(s2, e3) }; + } + dashedLine(t4, e3) { + const s2 = e3.dashOffset < 0 ? e3.hachureGap < 0 ? 4 * e3.strokeWidth : e3.hachureGap : e3.dashOffset, n2 = e3.dashGap < 0 ? e3.hachureGap < 0 ? 4 * e3.strokeWidth : e3.hachureGap : e3.dashGap, o2 = []; + return t4.forEach((t5) => { + const h2 = a(t5), r2 = Math.floor(h2 / (s2 + n2)), i2 = (h2 + n2 - r2 * (s2 + n2)) / 2; + let c3 = t5[0], l2 = t5[1]; + c3[0] > l2[0] && (c3 = t5[1], l2 = t5[0]); + const u2 = Math.atan((l2[1] - c3[1]) / (l2[0] - c3[0])); + for (let t6 = 0; t6 < r2; t6++) { + const a2 = t6 * (s2 + n2), h3 = a2 + s2, r3 = [c3[0] + a2 * Math.cos(u2) + i2 * Math.cos(u2), c3[1] + a2 * Math.sin(u2) + i2 * Math.sin(u2)], l3 = [c3[0] + h3 * Math.cos(u2) + i2 * Math.cos(u2), c3[1] + h3 * Math.sin(u2) + i2 * Math.sin(u2)]; + o2.push(...this.helper.doubleLineOps(r3[0], r3[1], l3[0], l3[1], e3)); + } + }), o2; + } + }; + l = class { + static { + __name(this, "l"); + } + constructor(t4) { + this.helper = t4; + } + fillPolygons(t4, e3) { + const s2 = e3.hachureGap < 0 ? 4 * e3.strokeWidth : e3.hachureGap, o2 = e3.zigzagOffset < 0 ? s2 : e3.zigzagOffset, a2 = n(t4, e3 = Object.assign({}, e3, { hachureGap: s2 + o2 })); + return { type: "fillSketch", ops: this.zigzagLines(a2, o2, e3) }; + } + zigzagLines(t4, e3, s2) { + const n2 = []; + return t4.forEach((t5) => { + const o2 = a(t5), h2 = Math.round(o2 / (2 * e3)); + let r2 = t5[0], i2 = t5[1]; + r2[0] > i2[0] && (r2 = t5[1], i2 = t5[0]); + const c3 = Math.atan((i2[1] - r2[1]) / (i2[0] - r2[0])); + for (let t6 = 0; t6 < h2; t6++) { + const o3 = 2 * t6 * e3, a2 = 2 * (t6 + 1) * e3, h3 = Math.sqrt(2 * Math.pow(e3, 2)), i3 = [r2[0] + o3 * Math.cos(c3), r2[1] + o3 * Math.sin(c3)], l2 = [r2[0] + a2 * Math.cos(c3), r2[1] + a2 * Math.sin(c3)], u2 = [i3[0] + h3 * Math.cos(c3 + Math.PI / 4), i3[1] + h3 * Math.sin(c3 + Math.PI / 4)]; + n2.push(...this.helper.doubleLineOps(i3[0], i3[1], u2[0], u2[1], s2), ...this.helper.doubleLineOps(u2[0], u2[1], l2[0], l2[1], s2)); + } + }), n2; + } + }; + u = {}; + p = class { + static { + __name(this, "p"); + } + constructor(t4) { + this.seed = t4; + } + next() { + return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random(); + } + }; + f = 0; + d = 1; + g = 2; + M = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 }; + __name(k, "k"); + __name(b, "b"); + __name(y2, "y"); + __name(m, "m"); + __name(w, "w"); + __name(x2, "x"); + P = { randOffset: /* @__PURE__ */ __name(function(t4, e3) { + return G(t4, e3); + }, "randOffset"), randOffsetWithRange: /* @__PURE__ */ __name(function(t4, e3, s2) { + return E(t4, e3, s2); + }, "randOffsetWithRange"), ellipse: /* @__PURE__ */ __name(function(t4, e3, s2, n2, o2) { + const a2 = T2(s2, n2, o2); + return D2(t4, e3, o2, a2).opset; + }, "ellipse"), doubleLineOps: /* @__PURE__ */ __name(function(t4, e3, s2, n2, o2) { + return $(t4, e3, s2, n2, o2, true); + }, "doubleLineOps") }; + __name(v, "v"); + __name(S2, "S"); + __name(O, "O"); + __name(L, "L"); + __name(T2, "T"); + __name(D2, "D"); + __name(A, "A"); + __name(_, "_"); + __name(I, "I"); + __name(C, "C"); + __name(z, "z"); + __name(W, "W"); + __name(E, "E"); + __name(G, "G"); + __name($, "$"); + __name(R, "R"); + __name(j, "j"); + __name(q, "q"); + __name(F, "F"); + __name(V, "V"); + __name(Z, "Z"); + __name(Q, "Q"); + __name(H, "H"); + __name(N, "N"); + __name(B, "B"); + __name(J, "J"); + __name(K2, "K"); + __name(U, "U"); + __name(X2, "X"); + __name(Y2, "Y"); + tt = "none"; + et = class { + static { + __name(this, "et"); + } + constructor(t4) { + this.defaultOptions = { maxRandomnessOffset: 2, roughness: 1, bowing: 1, stroke: "#000", strokeWidth: 1, curveTightness: 0, curveFitting: 0.95, curveStepCount: 9, fillStyle: "hachure", fillWeight: -1, hachureAngle: -41, hachureGap: -1, dashOffset: -1, dashGap: -1, zigzagOffset: -1, seed: 0, disableMultiStroke: false, disableMultiStrokeFill: false, preserveVertices: false, fillShapeRoughnessGain: 0.8 }, this.config = t4 || {}, this.config.options && (this.defaultOptions = this._o(this.config.options)); + } + static newSeed() { + return Math.floor(Math.random() * 2 ** 31); + } + _o(t4) { + return t4 ? Object.assign({}, this.defaultOptions, t4) : this.defaultOptions; + } + _d(t4, e3, s2) { + return { shape: t4, sets: e3 || [], options: s2 || this.defaultOptions }; + } + line(t4, e3, s2, n2, o2) { + const a2 = this._o(o2); + return this._d("line", [v(t4, e3, s2, n2, a2)], a2); + } + rectangle(t4, e3, s2, n2, o2) { + const a2 = this._o(o2), h2 = [], r2 = O(t4, e3, s2, n2, a2); + if (a2.fill) { + const o3 = [[t4, e3], [t4 + s2, e3], [t4 + s2, e3 + n2], [t4, e3 + n2]]; + "solid" === a2.fillStyle ? h2.push(I([o3], a2)) : h2.push(C([o3], a2)); + } + return a2.stroke !== tt && h2.push(r2), this._d("rectangle", h2, a2); + } + ellipse(t4, e3, s2, n2, o2) { + const a2 = this._o(o2), h2 = [], r2 = T2(s2, n2, a2), i2 = D2(t4, e3, a2, r2); + if (a2.fill) if ("solid" === a2.fillStyle) { + const s3 = D2(t4, e3, a2, r2).opset; + s3.type = "fillPath", h2.push(s3); + } else h2.push(C([i2.estimatedPoints], a2)); + return a2.stroke !== tt && h2.push(i2.opset), this._d("ellipse", h2, a2); + } + circle(t4, e3, s2, n2) { + const o2 = this.ellipse(t4, e3, s2, s2, n2); + return o2.shape = "circle", o2; + } + linearPath(t4, e3) { + const s2 = this._o(e3); + return this._d("linearPath", [S2(t4, false, s2)], s2); + } + arc(t4, e3, s2, n2, o2, a2, h2 = false, r2) { + const i2 = this._o(r2), c3 = [], l2 = A(t4, e3, s2, n2, o2, a2, h2, true, i2); + if (h2 && i2.fill) if ("solid" === i2.fillStyle) { + const h3 = Object.assign({}, i2); + h3.disableMultiStroke = true; + const r3 = A(t4, e3, s2, n2, o2, a2, true, false, h3); + r3.type = "fillPath", c3.push(r3); + } else c3.push(function(t5, e4, s3, n3, o3, a3, h3) { + const r3 = t5, i3 = e4; + let c4 = Math.abs(s3 / 2), l3 = Math.abs(n3 / 2); + c4 += G(0.01 * c4, h3), l3 += G(0.01 * l3, h3); + let u2 = o3, p3 = a3; + for (; u2 < 0; ) u2 += 2 * Math.PI, p3 += 2 * Math.PI; + p3 - u2 > 2 * Math.PI && (u2 = 0, p3 = 2 * Math.PI); + const f3 = (p3 - u2) / h3.curveStepCount, d2 = []; + for (let t6 = u2; t6 <= p3; t6 += f3) d2.push([r3 + c4 * Math.cos(t6), i3 + l3 * Math.sin(t6)]); + return d2.push([r3 + c4 * Math.cos(p3), i3 + l3 * Math.sin(p3)]), d2.push([r3, i3]), C([d2], h3); + }(t4, e3, s2, n2, o2, a2, i2)); + return i2.stroke !== tt && c3.push(l2), this._d("arc", c3, i2); + } + curve(t4, e3) { + const s2 = this._o(e3), n2 = [], o2 = L(t4, s2); + if (s2.fill && s2.fill !== tt) if ("solid" === s2.fillStyle) { + const e4 = L(t4, Object.assign(Object.assign({}, s2), { disableMultiStroke: true, roughness: s2.roughness ? s2.roughness + s2.fillShapeRoughnessGain : 0 })); + n2.push({ type: "fillPath", ops: this._mergedShape(e4.ops) }); + } else { + const e4 = [], o3 = t4; + if (o3.length) { + const t5 = "number" == typeof o3[0][0] ? [o3] : o3; + for (const n3 of t5) n3.length < 3 ? e4.push(...n3) : 3 === n3.length ? e4.push(...Y2(H([n3[0], n3[0], n3[1], n3[2]]), 10, (1 + s2.roughness) / 2)) : e4.push(...Y2(H(n3), 10, (1 + s2.roughness) / 2)); + } + e4.length && n2.push(C([e4], s2)); + } + return s2.stroke !== tt && n2.push(o2), this._d("curve", n2, s2); + } + polygon(t4, e3) { + const s2 = this._o(e3), n2 = [], o2 = S2(t4, true, s2); + return s2.fill && ("solid" === s2.fillStyle ? n2.push(I([t4], s2)) : n2.push(C([t4], s2))), s2.stroke !== tt && n2.push(o2), this._d("polygon", n2, s2); + } + path(t4, e3) { + const s2 = this._o(e3), n2 = []; + if (!t4) return this._d("path", n2, s2); + t4 = (t4 || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " "); + const o2 = s2.fill && "transparent" !== s2.fill && s2.fill !== tt, a2 = s2.stroke !== tt, h2 = !!(s2.simplification && s2.simplification < 1), r2 = function(t5, e4, s3) { + const n3 = m(y2(b(t5))), o3 = []; + let a3 = [], h3 = [0, 0], r3 = []; + const i3 = /* @__PURE__ */ __name(() => { + r3.length >= 4 && a3.push(...Y2(r3, e4)), r3 = []; + }, "i"), c3 = /* @__PURE__ */ __name(() => { + i3(), a3.length && (o3.push(a3), a3 = []); + }, "c"); + for (const { key: t6, data: e6 } of n3) switch (t6) { + case "M": + c3(), h3 = [e6[0], e6[1]], a3.push(h3); + break; + case "L": + i3(), a3.push([e6[0], e6[1]]); + break; + case "C": + if (!r3.length) { + const t7 = a3.length ? a3[a3.length - 1] : h3; + r3.push([t7[0], t7[1]]); + } + r3.push([e6[0], e6[1]]), r3.push([e6[2], e6[3]]), r3.push([e6[4], e6[5]]); + break; + case "Z": + i3(), a3.push([h3[0], h3[1]]); + } + if (c3(), !s3) return o3; + const l2 = []; + for (const t6 of o3) { + const e6 = U(t6, s3); + e6.length && l2.push(e6); + } + return l2; + }(t4, 1, h2 ? 4 - 4 * (s2.simplification || 1) : (1 + s2.roughness) / 2), i2 = _(t4, s2); + if (o2) if ("solid" === s2.fillStyle) if (1 === r2.length) { + const e4 = _(t4, Object.assign(Object.assign({}, s2), { disableMultiStroke: true, roughness: s2.roughness ? s2.roughness + s2.fillShapeRoughnessGain : 0 })); + n2.push({ type: "fillPath", ops: this._mergedShape(e4.ops) }); + } else n2.push(I(r2, s2)); + else n2.push(C(r2, s2)); + return a2 && (h2 ? r2.forEach((t5) => { + n2.push(S2(t5, false, s2)); + }) : n2.push(i2)), this._d("path", n2, s2); + } + opsToPath(t4, e3) { + let s2 = ""; + for (const n2 of t4.ops) { + const t5 = "number" == typeof e3 && e3 >= 0 ? n2.data.map((t6) => +t6.toFixed(e3)) : n2.data; + switch (n2.op) { + case "move": + s2 += `M${t5[0]} ${t5[1]} `; + break; + case "bcurveTo": + s2 += `C${t5[0]} ${t5[1]}, ${t5[2]} ${t5[3]}, ${t5[4]} ${t5[5]} `; + break; + case "lineTo": + s2 += `L${t5[0]} ${t5[1]} `; + } + } + return s2.trim(); + } + toPaths(t4) { + const e3 = t4.sets || [], s2 = t4.options || this.defaultOptions, n2 = []; + for (const t5 of e3) { + let e4 = null; + switch (t5.type) { + case "path": + e4 = { d: this.opsToPath(t5), stroke: s2.stroke, strokeWidth: s2.strokeWidth, fill: tt }; + break; + case "fillPath": + e4 = { d: this.opsToPath(t5), stroke: tt, strokeWidth: 0, fill: s2.fill || tt }; + break; + case "fillSketch": + e4 = this.fillSketch(t5, s2); + } + e4 && n2.push(e4); + } + return n2; + } + fillSketch(t4, e3) { + let s2 = e3.fillWeight; + return s2 < 0 && (s2 = e3.strokeWidth / 2), { d: this.opsToPath(t4), stroke: e3.fill || tt, strokeWidth: s2, fill: tt }; + } + _mergedShape(t4) { + return t4.filter((t5, e3) => 0 === e3 || "move" !== t5.op); + } + }; + st = class { + static { + __name(this, "st"); + } + constructor(t4, e3) { + this.canvas = t4, this.ctx = this.canvas.getContext("2d"), this.gen = new et(e3); + } + draw(t4) { + const e3 = t4.sets || [], s2 = t4.options || this.getDefaultOptions(), n2 = this.ctx, o2 = t4.options.fixedDecimalPlaceDigits; + for (const a2 of e3) switch (a2.type) { + case "path": + n2.save(), n2.strokeStyle = "none" === s2.stroke ? "transparent" : s2.stroke, n2.lineWidth = s2.strokeWidth, s2.strokeLineDash && n2.setLineDash(s2.strokeLineDash), s2.strokeLineDashOffset && (n2.lineDashOffset = s2.strokeLineDashOffset), this._drawToContext(n2, a2, o2), n2.restore(); + break; + case "fillPath": { + n2.save(), n2.fillStyle = s2.fill || ""; + const e4 = "curve" === t4.shape || "polygon" === t4.shape || "path" === t4.shape ? "evenodd" : "nonzero"; + this._drawToContext(n2, a2, o2, e4), n2.restore(); + break; + } + case "fillSketch": + this.fillSketch(n2, a2, s2); + } + } + fillSketch(t4, e3, s2) { + let n2 = s2.fillWeight; + n2 < 0 && (n2 = s2.strokeWidth / 2), t4.save(), s2.fillLineDash && t4.setLineDash(s2.fillLineDash), s2.fillLineDashOffset && (t4.lineDashOffset = s2.fillLineDashOffset), t4.strokeStyle = s2.fill || "", t4.lineWidth = n2, this._drawToContext(t4, e3, s2.fixedDecimalPlaceDigits), t4.restore(); + } + _drawToContext(t4, e3, s2, n2 = "nonzero") { + t4.beginPath(); + for (const n3 of e3.ops) { + const e4 = "number" == typeof s2 && s2 >= 0 ? n3.data.map((t5) => +t5.toFixed(s2)) : n3.data; + switch (n3.op) { + case "move": + t4.moveTo(e4[0], e4[1]); + break; + case "bcurveTo": + t4.bezierCurveTo(e4[0], e4[1], e4[2], e4[3], e4[4], e4[5]); + break; + case "lineTo": + t4.lineTo(e4[0], e4[1]); + } + } + "fillPath" === e3.type ? t4.fill(n2) : t4.stroke(); + } + get generator() { + return this.gen; + } + getDefaultOptions() { + return this.gen.defaultOptions; + } + line(t4, e3, s2, n2, o2) { + const a2 = this.gen.line(t4, e3, s2, n2, o2); + return this.draw(a2), a2; + } + rectangle(t4, e3, s2, n2, o2) { + const a2 = this.gen.rectangle(t4, e3, s2, n2, o2); + return this.draw(a2), a2; + } + ellipse(t4, e3, s2, n2, o2) { + const a2 = this.gen.ellipse(t4, e3, s2, n2, o2); + return this.draw(a2), a2; + } + circle(t4, e3, s2, n2) { + const o2 = this.gen.circle(t4, e3, s2, n2); + return this.draw(o2), o2; + } + linearPath(t4, e3) { + const s2 = this.gen.linearPath(t4, e3); + return this.draw(s2), s2; + } + polygon(t4, e3) { + const s2 = this.gen.polygon(t4, e3); + return this.draw(s2), s2; + } + arc(t4, e3, s2, n2, o2, a2, h2 = false, r2) { + const i2 = this.gen.arc(t4, e3, s2, n2, o2, a2, h2, r2); + return this.draw(i2), i2; + } + curve(t4, e3) { + const s2 = this.gen.curve(t4, e3); + return this.draw(s2), s2; + } + path(t4, e3) { + const s2 = this.gen.path(t4, e3); + return this.draw(s2), s2; + } + }; + nt = "http://www.w3.org/2000/svg"; + ot = class { + static { + __name(this, "ot"); + } + constructor(t4, e3) { + this.svg = t4, this.gen = new et(e3); + } + draw(t4) { + const e3 = t4.sets || [], s2 = t4.options || this.getDefaultOptions(), n2 = this.svg.ownerDocument || window.document, o2 = n2.createElementNS(nt, "g"), a2 = t4.options.fixedDecimalPlaceDigits; + for (const h2 of e3) { + let e4 = null; + switch (h2.type) { + case "path": + e4 = n2.createElementNS(nt, "path"), e4.setAttribute("d", this.opsToPath(h2, a2)), e4.setAttribute("stroke", s2.stroke), e4.setAttribute("stroke-width", s2.strokeWidth + ""), e4.setAttribute("fill", "none"), s2.strokeLineDash && e4.setAttribute("stroke-dasharray", s2.strokeLineDash.join(" ").trim()), s2.strokeLineDashOffset && e4.setAttribute("stroke-dashoffset", `${s2.strokeLineDashOffset}`); + break; + case "fillPath": + e4 = n2.createElementNS(nt, "path"), e4.setAttribute("d", this.opsToPath(h2, a2)), e4.setAttribute("stroke", "none"), e4.setAttribute("stroke-width", "0"), e4.setAttribute("fill", s2.fill || ""), "curve" !== t4.shape && "polygon" !== t4.shape || e4.setAttribute("fill-rule", "evenodd"); + break; + case "fillSketch": + e4 = this.fillSketch(n2, h2, s2); + } + e4 && o2.appendChild(e4); + } + return o2; + } + fillSketch(t4, e3, s2) { + let n2 = s2.fillWeight; + n2 < 0 && (n2 = s2.strokeWidth / 2); + const o2 = t4.createElementNS(nt, "path"); + return o2.setAttribute("d", this.opsToPath(e3, s2.fixedDecimalPlaceDigits)), o2.setAttribute("stroke", s2.fill || ""), o2.setAttribute("stroke-width", n2 + ""), o2.setAttribute("fill", "none"), s2.fillLineDash && o2.setAttribute("stroke-dasharray", s2.fillLineDash.join(" ").trim()), s2.fillLineDashOffset && o2.setAttribute("stroke-dashoffset", `${s2.fillLineDashOffset}`), o2; + } + get generator() { + return this.gen; + } + getDefaultOptions() { + return this.gen.defaultOptions; + } + opsToPath(t4, e3) { + return this.gen.opsToPath(t4, e3); + } + line(t4, e3, s2, n2, o2) { + const a2 = this.gen.line(t4, e3, s2, n2, o2); + return this.draw(a2); + } + rectangle(t4, e3, s2, n2, o2) { + const a2 = this.gen.rectangle(t4, e3, s2, n2, o2); + return this.draw(a2); + } + ellipse(t4, e3, s2, n2, o2) { + const a2 = this.gen.ellipse(t4, e3, s2, n2, o2); + return this.draw(a2); + } + circle(t4, e3, s2, n2) { + const o2 = this.gen.circle(t4, e3, s2, n2); + return this.draw(o2); + } + linearPath(t4, e3) { + const s2 = this.gen.linearPath(t4, e3); + return this.draw(s2); + } + polygon(t4, e3) { + const s2 = this.gen.polygon(t4, e3); + return this.draw(s2); + } + arc(t4, e3, s2, n2, o2, a2, h2 = false, r2) { + const i2 = this.gen.arc(t4, e3, s2, n2, o2, a2, h2, r2); + return this.draw(i2); + } + curve(t4, e3) { + const s2 = this.gen.curve(t4, e3); + return this.draw(s2); + } + path(t4, e3) { + const s2 = this.gen.path(t4, e3); + return this.draw(s2); + } + }; + at = { canvas: /* @__PURE__ */ __name((t4, e3) => new st(t4, e3), "canvas"), svg: /* @__PURE__ */ __name((t4, e3) => new ot(t4, e3), "svg"), generator: /* @__PURE__ */ __name((t4) => new et(t4), "generator"), newSeed: /* @__PURE__ */ __name(() => et.newSeed(), "newSeed") }; } - return false; - } - function last(array2) { - var length2 = array2 == null ? 0 : array2.length; - return length2 ? array2[length2 - 1] : void 0; - } - function castFunction(value2) { - return typeof value2 == "function" ? value2 : identity; - } - function forEach(collection, iteratee) { - var func = isArray$1(collection) ? arrayEach : baseEach$1; - return func(collection, castFunction(iteratee)); - } - function baseFilter(collection, predicate) { - var result = []; - baseEach$1(collection, function(value2, index2, collection2) { - if (predicate(value2, index2, collection2)) { - result.push(value2); - } - }); - return result; - } - function filter(collection, predicate) { - var func = isArray$1(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate)); - } - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = baseIteratee(predicate); - collection = keys$1(collection); - predicate = function(key) { - return iteratee(iterable[key], key, iterable); - }; - } - var index2 = findIndexFunc(collection, predicate, fromIndex); - return index2 > -1 ? iterable[iteratee ? collection[index2] : index2] : void 0; - }; - } - var nativeMax$1 = Math.max; - function findIndex(array2, predicate, fromIndex) { - var length2 = array2 == null ? 0 : array2.length; - if (!length2) { - return -1; + }); + + // src/rendering-util/rendering-elements/intersect/intersect-rect.js + var intersectRect2, intersect_rect_default2; + var init_intersect_rect2 = __esm({ + "src/rendering-util/rendering-elements/intersect/intersect-rect.js"() { + "use strict"; + intersectRect2 = /* @__PURE__ */ __name((node2, point8) => { + var x5 = node2.x; + var y5 = node2.y; + var dx = point8.x - x5; + var dy = point8.y - y5; + var w3 = node2.width / 2; + var h2 = node2.height / 2; + var sx, sy; + if (Math.abs(dy) * w3 > Math.abs(dx) * h2) { + if (dy < 0) { + h2 = -h2; + } + sx = dy === 0 ? 0 : h2 * dx / dy; + sy = h2; + } else { + if (dx < 0) { + w3 = -w3; + } + sx = w3; + sy = dx === 0 ? 0 : w3 * dy / dx; + } + return { x: x5 + sx, y: y5 + sy }; + }, "intersectRect"); + intersect_rect_default2 = intersectRect2; } - var index2 = fromIndex == null ? 0 : toInteger(fromIndex); - if (index2 < 0) { - index2 = nativeMax$1(length2 + index2, 0); + }); + + // src/rendering-util/rendering-elements/createLabel.js + function applyStyle3(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); } - return baseFindIndex(array2, baseIteratee(predicate), index2); - } - var find$1 = createFind(findIndex); - const find$2 = find$1; - function baseMap(collection, iteratee) { - var index2 = -1, result = isArrayLike(collection) ? Array(collection.length) : []; - baseEach$1(collection, function(value2, key, collection2) { - result[++index2] = iteratee(value2, key, collection2); - }); - return result; - } - function map(collection, iteratee) { - var func = isArray$1(collection) ? arrayMap : baseMap; - return func(collection, baseIteratee(iteratee)); - } - function forIn(object2, iteratee) { - return object2 == null ? object2 : baseFor$1(object2, castFunction(iteratee), keysIn); - } - function forOwn(object2, iteratee) { - return object2 && baseForOwn(object2, castFunction(iteratee)); - } - function baseGt(value2, other) { - return value2 > other; - } - var objectProto = Object.prototype; - var hasOwnProperty$1 = objectProto.hasOwnProperty; - function baseHas(object2, key) { - return object2 != null && hasOwnProperty$1.call(object2, key); - } - function has(object2, path2) { - return object2 != null && hasPath(object2, path2, baseHas); - } - function baseValues(object2, props) { - return arrayMap(props, function(key) { - return object2[key]; - }); - } - function values(object2) { - return object2 == null ? [] : baseValues(object2, keys$1(object2)); - } - function isUndefined(value2) { - return value2 === void 0; - } - function baseLt(value2, other) { - return value2 < other; - } - function mapValues(object2, iteratee) { - var result = {}; - iteratee = baseIteratee(iteratee); - baseForOwn(object2, function(value2, key, object3) { - baseAssignValue(result, key, iteratee(value2, key, object3)); - }); - return result; } - function baseExtremum(array2, iteratee, comparator) { - var index2 = -1, length2 = array2.length; - while (++index2 < length2) { - var value2 = array2[index2], current = iteratee(value2); - if (current != null && (computed === void 0 ? current === current && !isSymbol(current) : comparator(current, computed))) { - var computed = current, result = value2; - } + async function addHtmlLabel2(node2) { + const fo = select_default2(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")); + const div = fo.append("xhtml:div"); + let label = node2.label; + if (node2.label && hasKatex(node2.label)) { + label = await renderKatex(node2.label.replace(common_default.lineBreakRegex, "\n"), getConfig2()); } - return result; - } - function max$1(array2) { - return array2 && array2.length ? baseExtremum(array2, identity, baseGt) : void 0; - } - function min$1(array2) { - return array2 && array2.length ? baseExtremum(array2, identity, baseLt) : void 0; - } - function minBy(array2, iteratee) { - return array2 && array2.length ? baseExtremum(array2, baseIteratee(iteratee), baseLt) : void 0; + const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel"; + div.html( + '" + label + "" + ); + applyStyle3(div, node2.labelStyle); + div.style("display", "inline-block"); + div.style("padding-right", "1px"); + div.style("white-space", "nowrap"); + div.attr("xmlns", "http://www.w3.org/1999/xhtml"); + return fo.node(); } - function baseSet(object2, path2, value2, customizer) { - if (!isObject$1(object2)) { - return object2; - } - path2 = castPath(path2, object2); - var index2 = -1, length2 = path2.length, lastIndex = length2 - 1, nested = object2; - while (nested != null && ++index2 < length2) { - var key = toKey(path2[index2]), newValue = value2; - if (key === "__proto__" || key === "constructor" || key === "prototype") { - return object2; - } - if (index2 != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : void 0; - if (newValue === void 0) { - newValue = isObject$1(objValue) ? objValue : isIndex(path2[index2 + 1]) ? [] : {}; + var createLabel2, createLabel_default2; + var init_createLabel2 = __esm({ + "src/rendering-util/rendering-elements/createLabel.js"() { + "use strict"; + init_src32(); + init_logger(); + init_diagramAPI(); + init_common(); + init_utils2(); + __name(applyStyle3, "applyStyle"); + __name(addHtmlLabel2, "addHtmlLabel"); + createLabel2 = /* @__PURE__ */ __name(async (_vertexText, style3, isTitle, isNode2) => { + let vertexText = _vertexText || ""; + if (typeof vertexText === "object") { + vertexText = vertexText[0]; + } + if (evaluate(getConfig2().flowchart.htmlLabels)) { + vertexText = vertexText.replace(/\\n|\n/g, "
    "); + log.info("vertexText" + vertexText); + const node2 = { + isNode: isNode2, + label: decodeEntities(vertexText).replace( + /fa[blrs]?:fa-[\w-]+/g, + (s2) => `` + ), + labelStyle: style3 ? style3.replace("fill:", "color:") : style3 + }; + let vertexNode = await addHtmlLabel2(node2); + return vertexNode; + } else { + const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text"); + svgLabel.setAttribute("style", style3.replace("color:", "fill:")); + let rows = []; + if (typeof vertexText === "string") { + rows = vertexText.split(/\\n|\n|/gi); + } else if (Array.isArray(vertexText)) { + rows = vertexText; + } else { + rows = []; + } + for (const row of rows) { + const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); + tspan.setAttribute("dy", "1em"); + tspan.setAttribute("x", "0"); + if (isTitle) { + tspan.setAttribute("class", "title-row"); + } else { + tspan.setAttribute("class", "row"); + } + tspan.textContent = row.trim(); + svgLabel.appendChild(tspan); + } + return svgLabel; } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object2; - } - function basePickBy(object2, paths, predicate) { - var index2 = -1, length2 = paths.length, result = {}; - while (++index2 < length2) { - var path2 = paths[index2], value2 = baseGet(object2, path2); - if (predicate(value2, path2)) { - baseSet(result, castPath(path2, object2), value2); - } + }, "createLabel"); + createLabel_default2 = createLabel2; } - return result; - } - function baseSortBy(array2, comparer) { - var length2 = array2.length; - array2.sort(comparer); - while (length2--) { - array2[length2] = array2[length2].value; + }); + + // src/rendering-util/rendering-elements/shapes/roundedRectPath.ts + var createRoundedRectPathD; + var init_roundedRectPath = __esm({ + "src/rendering-util/rendering-elements/shapes/roundedRectPath.ts"() { + "use strict"; + createRoundedRectPathD = /* @__PURE__ */ __name((x5, y5, totalWidth, totalHeight, radius2) => [ + "M", + x5 + radius2, + y5, + // Move to the first point + "H", + x5 + totalWidth - radius2, + // Draw horizontal line to the beginning of the right corner + "A", + radius2, + radius2, + 0, + 0, + 1, + x5 + totalWidth, + y5 + radius2, + // Draw arc to the right top corner + "V", + y5 + totalHeight - radius2, + // Draw vertical line down to the beginning of the right bottom corner + "A", + radius2, + radius2, + 0, + 0, + 1, + x5 + totalWidth - radius2, + y5 + totalHeight, + // Draw arc to the right bottom corner + "H", + x5 + radius2, + // Draw horizontal line to the beginning of the left bottom corner + "A", + radius2, + radius2, + 0, + 0, + 1, + x5, + y5 + totalHeight - radius2, + // Draw arc to the left bottom corner + "V", + y5 + radius2, + // Draw vertical line up to the beginning of the left top corner + "A", + radius2, + radius2, + 0, + 0, + 1, + x5 + radius2, + y5, + // Draw arc to the left top corner + "Z" + // Close the path + ].join(" "), "createRoundedRectPathD"); } - return array2; - } - function compareAscending(value2, other) { - if (value2 !== other) { - var valIsDefined = value2 !== void 0, valIsNull = value2 === null, valIsReflexive = value2 === value2, valIsSymbol = isSymbol(value2); - var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); - if (!othIsNull && !othIsSymbol && !valIsSymbol && value2 > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { - return 1; - } - if (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { - return -1; - } + }); + + // src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts + var solidStateFill, compileStyles, styles2Map, styles2String, userNodeOverrides; + var init_handDrawnShapeStyles = __esm({ + "src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts"() { + "use strict"; + init_diagramAPI(); + solidStateFill = /* @__PURE__ */ __name((color2) => { + const { handDrawnSeed } = getConfig2(); + return { + fill: color2, + hachureAngle: 120, + // angle of hachure, + hachureGap: 4, + fillWeight: 2, + roughness: 0.7, + stroke: color2, + seed: handDrawnSeed + }; + }, "solidStateFill"); + compileStyles = /* @__PURE__ */ __name((node2) => { + const stylesMap = styles2Map([...node2.cssCompiledStyles || [], ...node2.cssStyles || []]); + return { stylesMap, stylesArray: [...stylesMap] }; + }, "compileStyles"); + styles2Map = /* @__PURE__ */ __name((styles3) => { + const styleMap2 = /* @__PURE__ */ new Map(); + styles3.forEach((style3) => { + const [key, value2] = style3.split(":"); + styleMap2.set(key.trim(), value2?.trim()); + }); + return styleMap2; + }, "styles2Map"); + styles2String = /* @__PURE__ */ __name((node2) => { + const { stylesArray } = compileStyles(node2); + const labelStyles = []; + const nodeStyles = []; + const borderStyles = []; + const backgroundStyles = []; + stylesArray.forEach((style3) => { + const key = style3[0]; + if (key === "color" || key === "font-size" || key === "font-family" || key === "font-weight" || key === "font-style" || key === "text-decoration" || key === "text-align" || key === "text-transform" || key === "line-height" || key === "letter-spacing" || key === "word-spacing" || key === "text-shadow" || key === "text-overflow" || key === "white-space" || key === "word-wrap" || key === "word-break" || key === "overflow-wrap" || key === "hyphens") { + labelStyles.push(style3.join(":") + " !important"); + } else { + nodeStyles.push(style3.join(":") + " !important"); + if (key.includes("stroke")) { + borderStyles.push(style3.join(":") + " !important"); + } + if (key === "fill") { + backgroundStyles.push(style3.join(":") + " !important"); + } + } + }); + return { + labelStyles: labelStyles.join(";"), + nodeStyles: nodeStyles.join(";"), + stylesArray, + borderStyles, + backgroundStyles + }; + }, "styles2String"); + userNodeOverrides = /* @__PURE__ */ __name((node2, options3) => { + const { themeVariables, handDrawnSeed } = getConfig2(); + const { nodeBorder, mainBkg } = themeVariables; + const { stylesMap } = compileStyles(node2); + const result = Object.assign( + { + roughness: 0.7, + fill: stylesMap.get("fill") || mainBkg, + fillStyle: "hachure", + // solid fill + fillWeight: 4, + stroke: stylesMap.get("stroke") || nodeBorder, + seed: handDrawnSeed, + strokeWidth: 1.3 + }, + options3 + ); + return result; + }, "userNodeOverrides"); } - return 0; - } - function compareMultiple(object2, other, orders) { - var index2 = -1, objCriteria = object2.criteria, othCriteria = other.criteria, length2 = objCriteria.length, ordersLength = orders.length; - while (++index2 < length2) { - var result = compareAscending(objCriteria[index2], othCriteria[index2]); - if (result) { - if (index2 >= ordersLength) { - return result; + }); + + // src/rendering-util/rendering-elements/clusters.js + var rect2, noteGroup, roundedWithTitle, divider, squareRect, shapes2, clusterElems, insertCluster, clear5; + var init_clusters = __esm({ + "src/rendering-util/rendering-elements/clusters.js"() { + "use strict"; + init_diagramAPI(); + init_common(); + init_logger(); + init_subGraphTitleMargins(); + init_src32(); + init_rough_esm(); + init_createText(); + init_intersect_rect2(); + init_createLabel2(); + init_roundedRectPath(); + init_handDrawnShapeStyles(); + rect2 = /* @__PURE__ */ __name(async (parent4, node2) => { + log.info("Creating subgraph rect for ", node2.id, node2); + const siteConfig2 = getConfig2(); + const { themeVariables, handDrawnSeed } = siteConfig2; + const { clusterBkg, clusterBorder } = themeVariables; + const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node2); + const shapeSvg = parent4.insert("g").attr("class", "cluster " + node2.cssClasses).attr("id", node2.id).attr("data-look", node2.look); + const useHtmlLabels = evaluate(siteConfig2.flowchart.htmlLabels); + const labelEl = shapeSvg.insert("g").attr("class", "cluster-label "); + const text2 = await createText(labelEl, node2.label, { + style: node2.labelStyle, + useHtmlLabels, + isNode: true + }); + let bbox = text2.getBBox(); + if (evaluate(siteConfig2.flowchart.htmlLabels)) { + const div = text2.children[0]; + const dv = select_default2(text2); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + const width3 = node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width; + if (node2.width <= bbox.width + node2.padding) { + node2.diff = (width3 - node2.width) / 2 - node2.padding; + } else { + node2.diff = -node2.padding; + } + const height2 = node2.height; + const x5 = node2.x - width3 / 2; + const y5 = node2.y - height2 / 2; + log.trace("Data ", node2, JSON.stringify(node2)); + let rect4; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, { + roughness: 0.7, + fill: clusterBkg, + // fill: 'red', + stroke: clusterBorder, + fillWeight: 3, + seed: handDrawnSeed + }); + const roughNode = rc.path(createRoundedRectPathD(x5, y5, width3, height2, 0), options3); + rect4 = shapeSvg.insert(() => { + log.debug("Rough node insert CXC", roughNode); + return roughNode; + }, ":first-child"); + rect4.select("path:nth-child(2)").attr("style", borderStyles.join(";")); + rect4.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke")); + } else { + rect4 = shapeSvg.insert("rect", ":first-child"); + rect4.attr("style", nodeStyles).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2); } - var order2 = orders[index2]; - return result * (order2 == "desc" ? -1 : 1); - } - } - return object2.index - other.index; - } - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray$1(iteratee)) { - return function(value2) { - return baseGet(value2, iteratee.length === 1 ? iteratee[0] : iteratee); - }; + const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2); + labelEl.attr( + "transform", + // This puts the label on top of the box instead of inside it + `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})` + ); + if (labelStyles) { + const span = labelEl.select("span"); + if (span) { + span.attr("style", labelStyles); + } + } + const rectBox = rect4.node().getBBox(); + node2.offsetX = 0; + node2.width = rectBox.width; + node2.height = rectBox.height; + node2.offsetY = bbox.height - node2.padding / 2; + node2.intersect = function(point8) { + return intersect_rect_default2(node2, point8); + }; + return { cluster: shapeSvg, labelBBox: bbox }; + }, "rect"); + noteGroup = /* @__PURE__ */ __name((parent4, node2) => { + const shapeSvg = parent4.insert("g").attr("class", "note-cluster").attr("id", node2.id); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const padding3 = 0 * node2.padding; + const halfPadding = padding3 / 2; + rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", node2.width + padding3).attr("height", node2.height + padding3).attr("fill", "none"); + const rectBox = rect4.node().getBBox(); + node2.width = rectBox.width; + node2.height = rectBox.height; + node2.intersect = function(point8) { + return intersect_rect_default2(node2, point8); + }; + return { cluster: shapeSvg, labelBBox: { width: 0, height: 0 } }; + }, "noteGroup"); + roundedWithTitle = /* @__PURE__ */ __name(async (parent4, node2) => { + const siteConfig2 = getConfig2(); + const { themeVariables, handDrawnSeed } = siteConfig2; + const { altBackground, compositeBackground, compositeTitleBackground, nodeBorder } = themeVariables; + const shapeSvg = parent4.insert("g").attr("class", node2.cssClasses).attr("id", node2.id).attr("data-id", node2.id).attr("data-look", node2.look); + const outerRectG = shapeSvg.insert("g", ":first-child"); + const label = shapeSvg.insert("g").attr("class", "cluster-label"); + let innerRect = shapeSvg.append("rect"); + const text2 = label.node().appendChild(await createLabel_default2(node2.label, node2.labelStyle, void 0, true)); + let bbox = text2.getBBox(); + if (evaluate(siteConfig2.flowchart.htmlLabels)) { + const div = text2.children[0]; + const dv = select_default2(text2); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + const padding3 = 0 * node2.padding; + const halfPadding = padding3 / 2; + const width3 = (node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width) + padding3; + if (node2.width <= bbox.width + node2.padding) { + node2.diff = (width3 - node2.width) / 2 - node2.padding; + } else { + node2.diff = -node2.padding; + } + const height2 = node2.height + padding3; + const innerHeight = node2.height + padding3 - bbox.height - 6; + const x5 = node2.x - width3 / 2; + const y5 = node2.y - height2 / 2; + node2.width = width3; + const innerY = node2.y - node2.height / 2 - halfPadding + bbox.height + 2; + let rect4; + if (node2.look === "handDrawn") { + const isAlt = node2.cssClasses.includes("statediagram-cluster-alt"); + const rc = at.svg(shapeSvg); + const roughOuterNode = node2.rx || node2.ry ? rc.path(createRoundedRectPathD(x5, y5, width3, height2, 10), { + roughness: 0.7, + fill: compositeTitleBackground, + fillStyle: "solid", + stroke: nodeBorder, + seed: handDrawnSeed + }) : rc.rectangle(x5, y5, width3, height2, { seed: handDrawnSeed }); + rect4 = shapeSvg.insert(() => roughOuterNode, ":first-child"); + const roughInnerNode = rc.rectangle(x5, innerY, width3, innerHeight, { + fill: isAlt ? altBackground : compositeBackground, + fillStyle: isAlt ? "hachure" : "solid", + stroke: nodeBorder, + seed: handDrawnSeed + }); + rect4 = shapeSvg.insert(() => roughOuterNode, ":first-child"); + innerRect = shapeSvg.insert(() => roughInnerNode); + } else { + rect4 = outerRectG.insert("rect", ":first-child"); + const outerRectClass = "outer"; + rect4.attr("class", outerRectClass).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("data-look", node2.look); + innerRect.attr("class", "inner").attr("x", x5).attr("y", innerY).attr("width", width3).attr("height", innerHeight); } - return iteratee; - }); - } else { - iteratees = [identity]; + label.attr( + "transform", + `translate(${node2.x - bbox.width / 2}, ${y5 + 1 - (evaluate(siteConfig2.flowchart.htmlLabels) ? 0 : 3)})` + ); + const rectBox = rect4.node().getBBox(); + node2.height = rectBox.height; + node2.offsetX = 0; + node2.offsetY = bbox.height - node2.padding / 2; + node2.labelBBox = bbox; + node2.intersect = function(point8) { + return intersect_rect_default2(node2, point8); + }; + return { cluster: shapeSvg, labelBBox: bbox }; + }, "roundedWithTitle"); + divider = /* @__PURE__ */ __name((parent4, node2) => { + const siteConfig2 = getConfig2(); + const { themeVariables, handDrawnSeed } = siteConfig2; + const { nodeBorder } = themeVariables; + const shapeSvg = parent4.insert("g").attr("class", node2.cssClasses).attr("id", node2.id).attr("data-look", node2.look); + const outerRectG = shapeSvg.insert("g", ":first-child"); + const padding3 = 0 * node2.padding; + const width3 = node2.width + padding3; + node2.diff = -node2.padding; + const height2 = node2.height + padding3; + const x5 = node2.x - width3 / 2; + const y5 = node2.y - height2 / 2; + node2.width = width3; + let rect4; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const roughOuterNode = rc.rectangle(x5, y5, width3, height2, { + fill: "lightgrey", + roughness: 0.5, + strokeLineDash: [5], + stroke: nodeBorder, + seed: handDrawnSeed + }); + rect4 = shapeSvg.insert(() => roughOuterNode, ":first-child"); + } else { + rect4 = outerRectG.insert("rect", ":first-child"); + const outerRectClass = "divider"; + rect4.attr("class", outerRectClass).attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("data-look", node2.look); + } + const rectBox = rect4.node().getBBox(); + node2.height = rectBox.height; + node2.offsetX = 0; + node2.offsetY = 0; + node2.intersect = function(point8) { + return intersect_rect_default2(node2, point8); + }; + return { cluster: shapeSvg, labelBBox: {} }; + }, "divider"); + squareRect = rect2; + shapes2 = { + rect: rect2, + squareRect, + roundedWithTitle, + noteGroup, + divider + }; + clusterElems = /* @__PURE__ */ new Map(); + insertCluster = /* @__PURE__ */ __name(async (elem, node2) => { + const shape = node2.shape || "rect"; + const cluster = await shapes2[shape](elem, node2); + clusterElems.set(node2.id, cluster); + return cluster; + }, "insertCluster"); + clear5 = /* @__PURE__ */ __name(() => { + clusterElems = /* @__PURE__ */ new Map(); + }, "clear"); } - var index2 = -1; - iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); - var result = baseMap(collection, function(value2, key, collection2) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value2); - }); - return { "criteria": criteria, "index": ++index2, "value": value2 }; - }); - return baseSortBy(result, function(object2, other) { - return compareMultiple(object2, other, orders); - }); - } - function basePick(object2, paths) { - return basePickBy(object2, paths, function(value2, path2) { - return hasIn(object2, path2); - }); - } - var pick = flatRest(function(object2, paths) { - return object2 == null ? {} : basePick(object2, paths); }); - const pick$1 = pick; - var nativeCeil = Math.ceil, nativeMax = Math.max; - function baseRange(start2, end2, step, fromRight) { - var index2 = -1, length2 = nativeMax(nativeCeil((end2 - start2) / (step || 1)), 0), result = Array(length2); - while (length2--) { - result[fromRight ? length2 : ++index2] = start2; - start2 += step; + + // src/utils/lineWithOffset.ts + function calculateDeltaAndAngle(point1, point22) { + if (point1 === void 0 || point22 === void 0) { + return { angle: 0, deltaX: 0, deltaY: 0 }; } - return result; + point1 = pointTransformer(point1); + point22 = pointTransformer(point22); + const [x1, y1] = [point1.x, point1.y]; + const [x22, y22] = [point22.x, point22.y]; + const deltaX = x22 - x1; + const deltaY = y22 - y1; + return { angle: Math.atan(deltaY / deltaX), deltaX, deltaY }; } - function createRange(fromRight) { - return function(start2, end2, step) { - if (step && typeof step != "number" && isIterateeCall(start2, end2, step)) { - end2 = step = void 0; - } - start2 = toFinite(start2); - if (end2 === void 0) { - end2 = start2; - start2 = 0; - } else { - end2 = toFinite(end2); + var markerOffsets, pointTransformer, getLineFunctionsWithOffset; + var init_lineWithOffset = __esm({ + "src/utils/lineWithOffset.ts"() { + "use strict"; + markerOffsets = { + aggregation: 18, + extension: 18, + composition: 18, + dependency: 6, + lollipop: 13.5, + arrow_point: 4 + }; + __name(calculateDeltaAndAngle, "calculateDeltaAndAngle"); + pointTransformer = /* @__PURE__ */ __name((data5) => { + if (Array.isArray(data5)) { + return { x: data5[0], y: data5[1] }; + } + return data5; + }, "pointTransformer"); + getLineFunctionsWithOffset = /* @__PURE__ */ __name((edge) => { + return { + x: /* @__PURE__ */ __name(function(d2, i2, data5) { + let offset = 0; + if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) { + const { angle: angle2, deltaX } = calculateDeltaAndAngle(data5[0], data5[1]); + offset = markerOffsets[edge.arrowTypeStart] * Math.cos(angle2) * (deltaX >= 0 ? 1 : -1); + } else if (i2 === data5.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) { + const { angle: angle2, deltaX } = calculateDeltaAndAngle( + data5[data5.length - 1], + data5[data5.length - 2] + ); + offset = markerOffsets[edge.arrowTypeEnd] * Math.cos(angle2) * (deltaX >= 0 ? 1 : -1); + } + return pointTransformer(d2).x + offset; + }, "x"), + y: /* @__PURE__ */ __name(function(d2, i2, data5) { + let offset = 0; + if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) { + const { angle: angle2, deltaY } = calculateDeltaAndAngle(data5[0], data5[1]); + offset = markerOffsets[edge.arrowTypeStart] * Math.abs(Math.sin(angle2)) * (deltaY >= 0 ? 1 : -1); + } else if (i2 === data5.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) { + const { angle: angle2, deltaY } = calculateDeltaAndAngle( + data5[data5.length - 1], + data5[data5.length - 2] + ); + offset = markerOffsets[edge.arrowTypeEnd] * Math.abs(Math.sin(angle2)) * (deltaY >= 0 ? 1 : -1); + } + return pointTransformer(d2).y + offset; + }, "y") + }; + }, "getLineFunctionsWithOffset"); + if (void 0) { + const { it, expect, describe } = void 0; + describe("calculateDeltaAndAngle", () => { + it("should calculate the angle and deltas between two points", () => { + expect(calculateDeltaAndAngle([0, 0], [0, 1])).toStrictEqual({ + angle: 1.5707963267948966, + deltaX: 0, + deltaY: 1 + }); + expect(calculateDeltaAndAngle([1, 0], [0, -1])).toStrictEqual({ + angle: 0.7853981633974483, + deltaX: -1, + deltaY: -1 + }); + expect(calculateDeltaAndAngle({ x: 1, y: 0 }, [0, -1])).toStrictEqual({ + angle: 0.7853981633974483, + deltaX: -1, + deltaY: -1 + }); + expect(calculateDeltaAndAngle({ x: 1, y: 0 }, { x: 1, y: 0 })).toStrictEqual({ + angle: NaN, + deltaX: 0, + deltaY: 0 + }); + }); + it("should calculate the angle and deltas if one point in undefined", () => { + expect(calculateDeltaAndAngle(void 0, [0, 1])).toStrictEqual({ + angle: 0, + deltaX: 0, + deltaY: 0 + }); + expect(calculateDeltaAndAngle([0, 1], void 0)).toStrictEqual({ + angle: 0, + deltaX: 0, + deltaY: 0 + }); + }); + }); } - step = step === void 0 ? start2 < end2 ? 1 : -1 : toFinite(step); - return baseRange(start2, end2, step, fromRight); - }; - } - var range = createRange(); - const range$1 = range; - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value2, index2, collection2) { - accumulator = initAccum ? (initAccum = false, value2) : iteratee(accumulator, value2, index2, collection2); - }); - return accumulator; - } - function reduce(collection, iteratee, accumulator) { - var func = isArray$1(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; - return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach$1); - } - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; } - var length2 = iteratees.length; - if (length2 > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length2 > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; + }); + + // src/rendering-util/rendering-elements/edgeMarker.ts + var addEdgeMarkers, arrowTypesMap, addEdgeMarker; + var init_edgeMarker = __esm({ + "src/rendering-util/rendering-elements/edgeMarker.ts"() { + "use strict"; + init_logger(); + addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id26, diagramType) => { + if (edge.arrowTypeStart) { + addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id26, diagramType); + } + if (edge.arrowTypeEnd) { + addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id26, diagramType); + } + }, "addEdgeMarkers"); + arrowTypesMap = { + arrow_cross: "cross", + arrow_point: "point", + arrow_barb: "barb", + arrow_circle: "circle", + aggregation: "aggregation", + extension: "extension", + composition: "composition", + dependency: "dependency", + lollipop: "lollipop" + }; + addEdgeMarker = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id26, diagramType) => { + const endMarkerType = arrowTypesMap[arrowType]; + if (!endMarkerType) { + log.warn(`Unknown arrow type: ${arrowType}`); + return; + } + const suffix = position5 === "start" ? "Start" : "End"; + svgPath.attr(`marker-${position5}`, `url(${url}#${id26}_${diagramType}-${endMarkerType}${suffix})`); + }, "addEdgeMarker"); } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); - const sortBy$1 = sortBy; - var INFINITY = 1 / 0; - var createSet = !(Set$2 && 1 / setToArray(new Set$2([, -0]))[1] == INFINITY) ? noop : function(values2) { - return new Set$2(values2); - }; - const createSet$1 = createSet; - var LARGE_ARRAY_SIZE = 200; - function baseUniq(array2, iteratee, comparator) { - var index2 = -1, includes2 = arrayIncludes, length2 = array2.length, isCommon = true, result = [], seen = result; - if (comparator) { - isCommon = false; - includes2 = arrayIncludesWith; - } else if (length2 >= LARGE_ARRAY_SIZE) { - var set2 = iteratee ? null : createSet$1(array2); - if (set2) { - return setToArray(set2); - } - isCommon = false; - includes2 = cacheHas; - seen = new SetCache(); - } else { - seen = iteratee ? [] : result; + + // src/rendering-util/rendering-elements/edges.js + function setTerminalWidth(fo, value2) { + if (getConfig2().flowchart.htmlLabels && fo) { + fo.style.width = value2.length * 9 + "px"; + fo.style.height = "12px"; } - outer: - while (++index2 < length2) { - var value2 = array2[index2], computed = iteratee ? iteratee(value2) : value2; - value2 = comparator || value2 !== 0 ? value2 : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } + } + function extractCornerPoints(points) { + const cornerPoints = []; + const cornerPointPositions = []; + for (let i2 = 1; i2 < points.length - 1; i2++) { + const prev2 = points[i2 - 1]; + const curr = points[i2]; + const next3 = points[i2 + 1]; + if (prev2.x === curr.x && curr.y === next3.y && Math.abs(curr.x - next3.x) > 5 && Math.abs(curr.y - prev2.y) > 5) { + cornerPoints.push(curr); + cornerPointPositions.push(i2); + } else if (prev2.y === curr.y && curr.x === next3.x && Math.abs(curr.x - prev2.x) > 5 && Math.abs(curr.y - next3.y) > 5) { + cornerPoints.push(curr); + cornerPointPositions.push(i2); + } + } + return { cornerPoints, cornerPointPositions }; + } + var edgeLabels, terminalLabels, clear6, getLabelStyles, insertEdgeLabel, positionEdgeLabel, outsideNode, intersection, cutPathAtIntersect, findAdjacentPoint, fixCorners, insertEdge; + var init_edges = __esm({ + "src/rendering-util/rendering-elements/edges.js"() { + "use strict"; + init_diagramAPI(); + init_common(); + init_logger(); + init_createText(); + init_utils2(); + init_lineWithOffset(); + init_subGraphTitleMargins(); + init_src32(); + init_rough_esm(); + init_createLabel2(); + init_edgeMarker(); + edgeLabels = /* @__PURE__ */ new Map(); + terminalLabels = /* @__PURE__ */ new Map(); + clear6 = /* @__PURE__ */ __name(() => { + edgeLabels.clear(); + terminalLabels.clear(); + }, "clear"); + getLabelStyles = /* @__PURE__ */ __name((styleArray) => { + let styles3 = styleArray ? styleArray.reduce((acc, style3) => acc + ";" + style3, "") : ""; + return styles3; + }, "getLabelStyles"); + insertEdgeLabel = /* @__PURE__ */ __name(async (elem, edge) => { + let useHtmlLabels = evaluate(getConfig2().flowchart.htmlLabels); + const labelElement = await createText(elem, edge.label, { + style: getLabelStyles(edge.labelStyle), + useHtmlLabels, + addSvgBackground: true, + isNode: false + }); + log.info("abc82", edge, edge.labelType); + const edgeLabel = elem.insert("g").attr("class", "edgeLabel"); + const label = edgeLabel.insert("g").attr("class", "label"); + label.node().appendChild(labelElement); + let bbox = labelElement.getBBox(); + if (useHtmlLabels) { + const div = labelElement.children[0]; + const dv = select_default2(labelElement); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); + edgeLabels.set(edge.id, edgeLabel); + edge.width = bbox.width; + edge.height = bbox.height; + let fo; + if (edge.startLabelLeft) { + const startLabelElement = await createLabel_default2( + edge.startLabelLeft, + getLabelStyles(edge.labelStyle) + ); + const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = startEdgeLabelLeft.insert("g").attr("class", "inner"); + fo = inner2.node().appendChild(startLabelElement); + const slBox = startLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + if (!terminalLabels.get(edge.id)) { + terminalLabels.set(edge.id, {}); + } + terminalLabels.get(edge.id).startLeft = startEdgeLabelLeft; + setTerminalWidth(fo, edge.startLabelLeft); + } + if (edge.startLabelRight) { + const startLabelElement = await createLabel_default2( + edge.startLabelRight, + getLabelStyles(edge.labelStyle) + ); + const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = startEdgeLabelRight.insert("g").attr("class", "inner"); + fo = startEdgeLabelRight.node().appendChild(startLabelElement); + inner2.node().appendChild(startLabelElement); + const slBox = startLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + if (!terminalLabels.get(edge.id)) { + terminalLabels.set(edge.id, {}); + } + terminalLabels.get(edge.id).startRight = startEdgeLabelRight; + setTerminalWidth(fo, edge.startLabelRight); + } + if (edge.endLabelLeft) { + const endLabelElement = await createLabel_default2(edge.endLabelLeft, getLabelStyles(edge.labelStyle)); + const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = endEdgeLabelLeft.insert("g").attr("class", "inner"); + fo = inner2.node().appendChild(endLabelElement); + const slBox = endLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + endEdgeLabelLeft.node().appendChild(endLabelElement); + if (!terminalLabels.get(edge.id)) { + terminalLabels.set(edge.id, {}); + } + terminalLabels.get(edge.id).endLeft = endEdgeLabelLeft; + setTerminalWidth(fo, edge.endLabelLeft); + } + if (edge.endLabelRight) { + const endLabelElement = await createLabel_default2(edge.endLabelRight, getLabelStyles(edge.labelStyle)); + const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = endEdgeLabelRight.insert("g").attr("class", "inner"); + fo = inner2.node().appendChild(endLabelElement); + const slBox = endLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + endEdgeLabelRight.node().appendChild(endLabelElement); + if (!terminalLabels.get(edge.id)) { + terminalLabels.set(edge.id, {}); + } + terminalLabels.get(edge.id).endRight = endEdgeLabelRight; + setTerminalWidth(fo, edge.endLabelRight); + } + return labelElement; + }, "insertEdgeLabel"); + __name(setTerminalWidth, "setTerminalWidth"); + positionEdgeLabel = /* @__PURE__ */ __name((edge, paths) => { + log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels.get(edge.id), paths); + let path4 = paths.updatedPath ? paths.updatedPath : paths.originalPath; + const siteConfig2 = getConfig2(); + const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2); + if (edge.label) { + const el = edgeLabels.get(edge.id); + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcLabelPosition(path4); + log.debug( + "Moving label " + edge.label + " from (", + x5, + ",", + y5, + ") to (", + pos.x, + ",", + pos.y, + ") abc88" + ); + if (paths.updatedPath) { + x5 = pos.x; + y5 = pos.y; + } + } + el.attr("transform", `translate(${x5}, ${y5 + subGraphTitleTotalMargin / 2})`); + } + if (edge.startLabelLeft) { + const el = terminalLabels.get(edge.id).startLeft; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path4); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + if (edge.startLabelRight) { + const el = terminalLabels.get(edge.id).startRight; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition( + edge.arrowTypeStart ? 10 : 0, + "start_right", + path4 + ); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + if (edge.endLabelLeft) { + const el = terminalLabels.get(edge.id).endLeft; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path4); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + if (edge.endLabelRight) { + const el = terminalLabels.get(edge.id).endRight; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path4); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + }, "positionEdgeLabel"); + outsideNode = /* @__PURE__ */ __name((node2, point8) => { + const x5 = node2.x; + const y5 = node2.y; + const dx = Math.abs(point8.x - x5); + const dy = Math.abs(point8.y - y5); + const w3 = node2.width / 2; + const h2 = node2.height / 2; + return dx >= w3 || dy >= h2; + }, "outsideNode"); + intersection = /* @__PURE__ */ __name((node2, outsidePoint, insidePoint) => { + log.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(outsidePoint)} + insidePoint : ${JSON.stringify(insidePoint)} + node : x:${node2.x} y:${node2.y} w:${node2.width} h:${node2.height}`); + const x5 = node2.x; + const y5 = node2.y; + const dx = Math.abs(x5 - insidePoint.x); + const w3 = node2.width / 2; + let r2 = insidePoint.x < outsidePoint.x ? w3 - dx : w3 + dx; + const h2 = node2.height / 2; + const Q2 = Math.abs(outsidePoint.y - insidePoint.y); + const R2 = Math.abs(outsidePoint.x - insidePoint.x); + if (Math.abs(y5 - outsidePoint.y) * w3 > Math.abs(x5 - outsidePoint.x) * h2) { + let q2 = insidePoint.y < outsidePoint.y ? outsidePoint.y - h2 - y5 : y5 - h2 - outsidePoint.y; + r2 = R2 * q2 / Q2; + const res = { + x: insidePoint.x < outsidePoint.x ? insidePoint.x + r2 : insidePoint.x - R2 + r2, + y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q2 - q2 : insidePoint.y - Q2 + q2 + }; + if (r2 === 0) { + res.x = outsidePoint.x; + res.y = outsidePoint.y; } - if (iteratee) { - seen.push(computed); + if (R2 === 0) { + res.x = outsidePoint.x; } - result.push(value2); - } else if (!includes2(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); + if (Q2 === 0) { + res.y = outsidePoint.y; } - result.push(value2); + log.debug(`abc89 top/bottom calc, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, res); + return res; + } else { + if (insidePoint.x < outsidePoint.x) { + r2 = outsidePoint.x - w3 - x5; + } else { + r2 = x5 - w3 - outsidePoint.x; + } + let q2 = Q2 * r2 / R2; + let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R2 - r2 : insidePoint.x - R2 + r2; + let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q2 : insidePoint.y - q2; + log.debug(`sides calc abc89, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, { _x, _y }); + if (r2 === 0) { + _x = outsidePoint.x; + _y = outsidePoint.y; + } + if (R2 === 0) { + _x = outsidePoint.x; + } + if (Q2 === 0) { + _y = outsidePoint.y; + } + return { x: _x, y: _y }; + } + }, "intersection"); + cutPathAtIntersect = /* @__PURE__ */ __name((_points, boundaryNode) => { + log.warn("abc88 cutPathAtIntersect", _points, boundaryNode); + let points = []; + let lastPointOutside = _points[0]; + let isInside = false; + _points.forEach((point8) => { + log.info("abc88 checking point", point8, boundaryNode); + if (!outsideNode(boundaryNode, point8) && !isInside) { + const inter = intersection(boundaryNode, lastPointOutside, point8); + log.debug("abc88 inside", point8, lastPointOutside, inter); + log.debug("abc88 intersection", inter, boundaryNode); + let pointPresent = false; + points.forEach((p3) => { + pointPresent = pointPresent || p3.x === inter.x && p3.y === inter.y; + }); + if (!points.some((e3) => e3.x === inter.x && e3.y === inter.y)) { + points.push(inter); + } else { + log.warn("abc88 no intersect", inter, points); + } + isInside = true; + } else { + log.warn("abc88 outside", point8, lastPointOutside); + lastPointOutside = point8; + if (!isInside) { + points.push(point8); + } + } + }); + log.debug("returning points", points); + return points; + }, "cutPathAtIntersect"); + __name(extractCornerPoints, "extractCornerPoints"); + findAdjacentPoint = /* @__PURE__ */ __name(function(pointA, pointB, distance2) { + const xDiff = pointB.x - pointA.x; + const yDiff = pointB.y - pointA.y; + const length2 = Math.sqrt(xDiff * xDiff + yDiff * yDiff); + const ratio = distance2 / length2; + return { x: pointB.x - ratio * xDiff, y: pointB.y - ratio * yDiff }; + }, "findAdjacentPoint"); + fixCorners = /* @__PURE__ */ __name(function(lineData) { + const { cornerPointPositions } = extractCornerPoints(lineData); + const newLineData = []; + for (let i2 = 0; i2 < lineData.length; i2++) { + if (cornerPointPositions.includes(i2)) { + const prevPoint = lineData[i2 - 1]; + const nextPoint = lineData[i2 + 1]; + const cornerPoint = lineData[i2]; + const newPrevPoint = findAdjacentPoint(prevPoint, cornerPoint, 5); + const newNextPoint = findAdjacentPoint(nextPoint, cornerPoint, 5); + const xDiff = newNextPoint.x - newPrevPoint.x; + const yDiff = newNextPoint.y - newPrevPoint.y; + newLineData.push(newPrevPoint); + const a2 = Math.sqrt(2) * 2; + let newCornerPoint = { x: cornerPoint.x, y: cornerPoint.y }; + if (Math.abs(nextPoint.x - prevPoint.x) > 10 && Math.abs(nextPoint.y - prevPoint.y) >= 10) { + log.debug( + "Corner point fixing", + Math.abs(nextPoint.x - prevPoint.x), + Math.abs(nextPoint.y - prevPoint.y) + ); + const r2 = 5; + if (cornerPoint.x === newPrevPoint.x) { + newCornerPoint = { + x: xDiff < 0 ? newPrevPoint.x - r2 + a2 : newPrevPoint.x + r2 - a2, + y: yDiff < 0 ? newPrevPoint.y - a2 : newPrevPoint.y + a2 + }; + } else { + newCornerPoint = { + x: xDiff < 0 ? newPrevPoint.x - a2 : newPrevPoint.x + a2, + y: yDiff < 0 ? newPrevPoint.y - r2 + a2 : newPrevPoint.y + r2 - a2 + }; + } + } else { + log.debug( + "Corner point skipping fixing", + Math.abs(nextPoint.x - prevPoint.x), + Math.abs(nextPoint.y - prevPoint.y) + ); + } + newLineData.push(newCornerPoint, newNextPoint); + } else { + newLineData.push(lineData[i2]); + } + } + return newLineData; + }, "fixCorners"); + insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb3, diagramType, startNode, endNode, id26) { + const { handDrawnSeed } = getConfig2(); + let points = edge.points; + let pointsHasChanged = false; + const tail = startNode; + var head2 = endNode; + if (head2.intersect && tail.intersect) { + points = points.slice(1, edge.points.length - 1); + points.unshift(tail.intersect(points[0])); + log.debug( + "Last point APA12", + edge.start, + "-->", + edge.end, + points[points.length - 1], + head2, + head2.intersect(points[points.length - 1]) + ); + points.push(head2.intersect(points[points.length - 1])); + } + if (edge.toCluster) { + log.info("to cluster abc88", clusterDb3.get(edge.toCluster)); + points = cutPathAtIntersect(edge.points, clusterDb3.get(edge.toCluster).node); + pointsHasChanged = true; + } + if (edge.fromCluster) { + log.debug( + "from cluster abc88", + clusterDb3.get(edge.fromCluster), + JSON.stringify(points, null, 2) + ); + points = cutPathAtIntersect(points.reverse(), clusterDb3.get(edge.fromCluster).node).reverse(); + pointsHasChanged = true; + } + let lineData = points.filter((p3) => !Number.isNaN(p3.y)); + lineData = fixCorners(lineData); + let lastPoint2 = lineData[lineData.length - 1]; + if (lineData.length > 1) { + lastPoint2 = lineData[lineData.length - 1]; + const secondLastPoint = lineData[lineData.length - 2]; + const diffX = (lastPoint2.x - secondLastPoint.x) / 2; + const diffY = (lastPoint2.y - secondLastPoint.y) / 2; + const midPoint = { x: secondLastPoint.x + diffX, y: secondLastPoint.y + diffY }; + lineData.splice(-1, 0, midPoint); + } + let curve = basis_default2; + if (edge.curve) { + curve = edge.curve; + } + const { x: x5, y: y5 } = getLineFunctionsWithOffset(edge); + const lineFunction = line_default().x(x5).y(y5).curve(curve); + let strokeClasses; + switch (edge.thickness) { + case "normal": + strokeClasses = "edge-thickness-normal"; + break; + case "thick": + strokeClasses = "edge-thickness-thick"; + break; + case "invisible": + strokeClasses = "edge-thickness-invisible"; + break; + default: + strokeClasses = "edge-thickness-normal"; } - } - return result; - } - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + switch (edge.pattern) { + case "solid": + strokeClasses += " edge-pattern-solid"; + break; + case "dotted": + strokeClasses += " edge-pattern-dotted"; + break; + case "dashed": + strokeClasses += " edge-pattern-dashed"; + break; + default: + strokeClasses += " edge-pattern-solid"; + } + let svgPath; + let linePath = lineFunction(lineData); + const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style]; + if (edge.look === "handDrawn") { + const rc = at.svg(elem); + Object.assign([], lineData); + const svgPathNode = rc.path(linePath, { + roughness: 0.3, + seed: handDrawnSeed + }); + strokeClasses += " transition"; + svgPath = select_default2(svgPathNode).select("path").attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style3) => acc + ";" + style3, "") : ""); + let d2 = svgPath.attr("d"); + svgPath.attr("d", d2); + elem.node().appendChild(svgPath.node()); + } else { + svgPath = elem.append("path").attr("d", linePath).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style3) => acc + ";" + style3, "") : ""); + } + let url = ""; + if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) { + url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, "\\(").replace(/\)/g, "\\)"); + } + log.info("arrowTypeStart", edge.arrowTypeStart); + log.info("arrowTypeEnd", edge.arrowTypeEnd); + addEdgeMarkers(svgPath, edge, url, id26, diagramType); + let paths = {}; + if (pointsHasChanged) { + paths.updatedPath = points; + } + paths.originalPath = edge.points; + return paths; + }, "insertEdge"); + } }); - const union$1 = union; - var idCounter = 0; - function uniqueId(prefix) { - var id2 = ++idCounter; - return toString$1(prefix) + id2; - } - function baseZipObject(props, values2, assignFunc) { - var index2 = -1, length2 = props.length, valsLength = values2.length, result = {}; - while (++index2 < length2) { - var value2 = index2 < valsLength ? values2[index2] : void 0; - assignFunc(result, props[index2], value2); + + // src/rendering-util/rendering-elements/markers.js + var insertMarkers, extension, composition, aggregation, dependency, lollipop, point6, circle2, cross, barb, markers, markers_default; + var init_markers = __esm({ + "src/rendering-util/rendering-elements/markers.js"() { + "use strict"; + init_logger(); + insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type3, id26) => { + markerArray.forEach((markerName) => { + markers[markerName](elem, type3, id26); + }); + }, "insertMarkers"); + extension = /* @__PURE__ */ __name((elem, type3, id26) => { + log.trace("Making markers for ", id26); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); + }, "extension"); + composition = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + }, "composition"); + aggregation = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + }, "aggregation"); + dependency = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + }, "dependency"); + lollipop = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); + }, "lollipop"); + point6 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("marker").attr("id", id26 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id26 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + }, "point"); + circle2 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("marker").attr("id", id26 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id26 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + }, "circle"); + cross = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("marker").attr("id", id26 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id26 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); + }, "cross"); + barb = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); + }, "barb"); + markers = { + extension, + composition, + aggregation, + dependency, + lollipop, + point: point6, + circle: circle2, + cross, + barb + }; + markers_default = insertMarkers; } - return result; + }); + + // src/rendering-util/rendering-elements/shapes/util.js + var labelHelper2, updateNodeBounds2, getNodeClasses; + var init_util2 = __esm({ + "src/rendering-util/rendering-elements/shapes/util.js"() { + "use strict"; + init_createText(); + init_diagramAPI(); + init_src32(); + init_common(); + init_utils2(); + labelHelper2 = /* @__PURE__ */ __name(async (parent4, node2, _classes) => { + let cssClasses; + const useHtmlLabels = node2.useHtmlLabels || evaluate(getConfig2().flowchart.htmlLabels); + if (!_classes) { + cssClasses = "node default"; + } else { + cssClasses = _classes; + } + const shapeSvg = parent4.insert("g").attr("class", cssClasses).attr("id", node2.domId || node2.id); + const labelEl = shapeSvg.insert("g").attr("class", "label").attr("style", node2.labelStyle); + let label; + if (node2.label === void 0) { + label = ""; + } else { + label = typeof node2.label === "string" ? node2.label : node2.label[0]; + } + let text2; + text2 = await createText(labelEl, sanitizeText(decodeEntities(label), getConfig2()), { + useHtmlLabels, + width: node2.width || getConfig2().flowchart.wrappingWidth, + cssClasses: "markdown-node-label", + style: node2.labelStyle + }); + let bbox = text2.getBBox(); + const halfPadding = node2.padding / 2; + if (evaluate(getConfig2().flowchart.htmlLabels)) { + const div = text2.children[0]; + const dv = select_default2(text2); + const images = div.getElementsByTagName("img"); + if (images) { + const noImgText = label.replace(/]*>/g, "").trim() === ""; + await Promise.all( + [...images].map( + (img) => new Promise((res) => { + function setupImage() { + img.style.display = "flex"; + img.style.flexDirection = "column"; + if (noImgText) { + const bodyFontSize = getConfig2().fontSize ? getConfig2().fontSize : window.getComputedStyle(document.body).fontSize; + const enlargingFactor = 5; + const width3 = parseInt(bodyFontSize, 10) * enlargingFactor + "px"; + img.style.minWidth = width3; + img.style.maxWidth = width3; + } else { + img.style.width = "100%"; + } + res(img); + } + __name(setupImage, "setupImage"); + setTimeout(() => { + if (img.complete) { + setupImage(); + } + }); + img.addEventListener("error", setupImage); + img.addEventListener("load", setupImage); + }) + ) + ); + } + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + if (useHtmlLabels) { + labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); + } else { + labelEl.attr("transform", "translate(0, " + -bbox.height / 2 + ")"); + } + if (node2.centerLabel) { + labelEl.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); + } + labelEl.insert("rect", ":first-child"); + return { shapeSvg, bbox, halfPadding, label: labelEl }; + }, "labelHelper"); + updateNodeBounds2 = /* @__PURE__ */ __name((node2, element3) => { + const bbox = element3.node().getBBox(); + node2.width = bbox.width; + node2.height = bbox.height; + }, "updateNodeBounds"); + getNodeClasses = /* @__PURE__ */ __name((node2, extra) => (node2.look === "handDrawn" ? "rough-node" : "node") + " " + node2.cssClasses + " " + (extra || ""), "getNodeClasses"); + } + }); + + // src/rendering-util/rendering-elements/intersect/intersect-node.js + function intersectNode2(node2, point8) { + return node2.intersect(point8); } - function zipObject(props, values2) { - return baseZipObject(props || [], values2 || [], assignValue); - } - var DEFAULT_EDGE_NAME = "\0"; - var GRAPH_NODE = "\0"; - var EDGE_KEY_DELIM = ""; - class Graph { - constructor(opts = {}) { - this._isDirected = has(opts, "directed") ? opts.directed : true; - this._isMultigraph = has(opts, "multigraph") ? opts.multigraph : false; - this._isCompound = has(opts, "compound") ? opts.compound : false; - this._label = void 0; - this._defaultNodeLabelFn = constant$2(void 0); - this._defaultEdgeLabelFn = constant$2(void 0); - this._nodes = {}; - if (this._isCompound) { - this._parent = {}; - this._children = {}; - this._children[GRAPH_NODE] = {}; - } - this._in = {}; - this._preds = {}; - this._out = {}; - this._sucs = {}; - this._edgeObjs = {}; - this._edgeLabels = {}; - } - /* === Graph functions ========= */ - isDirected() { - return this._isDirected; - } - isMultigraph() { - return this._isMultigraph; - } - isCompound() { - return this._isCompound; - } - setGraph(label) { - this._label = label; - return this; + var intersect_node_default2; + var init_intersect_node2 = __esm({ + "src/rendering-util/rendering-elements/intersect/intersect-node.js"() { + "use strict"; + __name(intersectNode2, "intersectNode"); + intersect_node_default2 = intersectNode2; } - graph() { - return this._label; + }); + + // src/rendering-util/rendering-elements/intersect/intersect-ellipse.js + function intersectEllipse2(node2, rx, ry, point8) { + var cx = node2.x; + var cy = node2.y; + var px = cx - point8.x; + var py = cy - point8.y; + var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); + var dx = Math.abs(rx * ry * px / det); + if (point8.x < cx) { + dx = -dx; } - /* === Node functions ========== */ - setDefaultNodeLabel(newDefault) { - if (!isFunction(newDefault)) { - newDefault = constant$2(newDefault); - } - this._defaultNodeLabelFn = newDefault; - return this; + var dy = Math.abs(rx * ry * py / det); + if (point8.y < cy) { + dy = -dy; } - nodeCount() { - return this._nodeCount; + return { x: cx + dx, y: cy + dy }; + } + var intersect_ellipse_default2; + var init_intersect_ellipse2 = __esm({ + "src/rendering-util/rendering-elements/intersect/intersect-ellipse.js"() { + "use strict"; + __name(intersectEllipse2, "intersectEllipse"); + intersect_ellipse_default2 = intersectEllipse2; } - nodes() { - return keys$1(this._nodes); + }); + + // src/rendering-util/rendering-elements/intersect/intersect-circle.js + function intersectCircle2(node2, rx, point8) { + return intersect_ellipse_default2(node2, rx, rx, point8); + } + var intersect_circle_default2; + var init_intersect_circle2 = __esm({ + "src/rendering-util/rendering-elements/intersect/intersect-circle.js"() { + "use strict"; + init_intersect_ellipse2(); + __name(intersectCircle2, "intersectCircle"); + intersect_circle_default2 = intersectCircle2; } - sources() { - var self2 = this; - return filter(this.nodes(), function(v) { - return isEmpty(self2._in[v]); - }); + }); + + // src/rendering-util/rendering-elements/intersect/intersect-line.js + function intersectLine2(p1, p22, q1, q2) { + var a1, a2, b1, b2, c1, c22; + var r1, r2, r3, r4; + var denom, offset, num; + var x5, y5; + a1 = p22.y - p1.y; + b1 = p1.x - p22.x; + c1 = p22.x * p1.y - p1.x * p22.y; + r3 = a1 * q1.x + b1 * q1.y + c1; + r4 = a1 * q2.x + b1 * q2.y + c1; + if (r3 !== 0 && r4 !== 0 && sameSign2(r3, r4)) { + return; } - sinks() { - var self2 = this; - return filter(this.nodes(), function(v) { - return isEmpty(self2._out[v]); - }); + a2 = q2.y - q1.y; + b2 = q1.x - q2.x; + c22 = q2.x * q1.y - q1.x * q2.y; + r1 = a2 * p1.x + b2 * p1.y + c22; + r2 = a2 * p22.x + b2 * p22.y + c22; + if (r1 !== 0 && r2 !== 0 && sameSign2(r1, r2)) { + return; } - setNodes(vs, value2) { - var args = arguments; - var self2 = this; - forEach(vs, function(v) { - if (args.length > 1) { - self2.setNode(v, value2); - } else { - self2.setNode(v); - } + denom = a1 * b2 - a2 * b1; + if (denom === 0) { + return; + } + offset = Math.abs(denom / 2); + num = b1 * c22 - b2 * c1; + x5 = num < 0 ? (num - offset) / denom : (num + offset) / denom; + num = a2 * c1 - a1 * c22; + y5 = num < 0 ? (num - offset) / denom : (num + offset) / denom; + return { x: x5, y: y5 }; + } + function sameSign2(r1, r2) { + return r1 * r2 > 0; + } + var intersect_line_default2; + var init_intersect_line2 = __esm({ + "src/rendering-util/rendering-elements/intersect/intersect-line.js"() { + "use strict"; + __name(intersectLine2, "intersectLine"); + __name(sameSign2, "sameSign"); + intersect_line_default2 = intersectLine2; + } + }); + + // src/rendering-util/rendering-elements/intersect/intersect-polygon.js + function intersectPolygon2(node2, polyPoints, point8) { + let x1 = node2.x; + let y1 = node2.y; + let intersections = []; + let minX = Number.POSITIVE_INFINITY; + let minY = Number.POSITIVE_INFINITY; + if (typeof polyPoints.forEach === "function") { + polyPoints.forEach(function(entry) { + minX = Math.min(minX, entry.x); + minY = Math.min(minY, entry.y); }); - return this; + } else { + minX = Math.min(minX, polyPoints.x); + minY = Math.min(minY, polyPoints.y); } - setNode(v, value2) { - if (has(this._nodes, v)) { - if (arguments.length > 1) { - this._nodes[v] = value2; - } - return this; + let left3 = x1 - node2.width / 2 - minX; + let top2 = y1 - node2.height / 2 - minY; + for (let i2 = 0; i2 < polyPoints.length; i2++) { + let p1 = polyPoints[i2]; + let p22 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0]; + let intersect3 = intersect_line_default2( + node2, + point8, + { x: left3 + p1.x, y: top2 + p1.y }, + { x: left3 + p22.x, y: top2 + p22.y } + ); + if (intersect3) { + intersections.push(intersect3); } - this._nodes[v] = arguments.length > 1 ? value2 : this._defaultNodeLabelFn(v); - if (this._isCompound) { - this._parent[v] = GRAPH_NODE; - this._children[v] = {}; - this._children[GRAPH_NODE][v] = true; - } - this._in[v] = {}; - this._preds[v] = {}; - this._out[v] = {}; - this._sucs[v] = {}; - ++this._nodeCount; - return this; - } - node(v) { - return this._nodes[v]; } - hasNode(v) { - return has(this._nodes, v); + if (!intersections.length) { + return node2; } - removeNode(v) { - var self2 = this; - if (has(this._nodes, v)) { - var removeEdge = function(e) { - self2.removeEdge(self2._edgeObjs[e]); - }; - delete this._nodes[v]; - if (this._isCompound) { - this._removeFromParentsChildList(v); - delete this._parent[v]; - forEach(this.children(v), function(child) { - self2.setParent(child); - }); - delete this._children[v]; - } - forEach(keys$1(this._in[v]), removeEdge); - delete this._in[v]; - delete this._preds[v]; - forEach(keys$1(this._out[v]), removeEdge); - delete this._out[v]; - delete this._sucs[v]; - --this._nodeCount; - } - return this; + if (intersections.length > 1) { + intersections.sort(function(p3, q2) { + let pdx = p3.x - point8.x; + let pdy = p3.y - point8.y; + let distp = Math.sqrt(pdx * pdx + pdy * pdy); + let qdx = q2.x - point8.x; + let qdy = q2.y - point8.y; + let distq = Math.sqrt(qdx * qdx + qdy * qdy); + return distp < distq ? -1 : distp === distq ? 0 : 1; + }); } - setParent(v, parent) { - if (!this._isCompound) { - throw new Error("Cannot set parent in a non-compound graph"); - } - if (isUndefined(parent)) { - parent = GRAPH_NODE; - } else { - parent += ""; - for (var ancestor = parent; !isUndefined(ancestor); ancestor = this.parent(ancestor)) { - if (ancestor === v) { - throw new Error("Setting " + parent + " as parent of " + v + " would create a cycle"); - } - } - this.setNode(parent); - } - this.setNode(v); - this._removeFromParentsChildList(v); - this._parent[v] = parent; - this._children[parent][v] = true; - return this; + return intersections[0]; + } + var intersect_polygon_default2; + var init_intersect_polygon2 = __esm({ + "src/rendering-util/rendering-elements/intersect/intersect-polygon.js"() { + "use strict"; + init_intersect_line2(); + __name(intersectPolygon2, "intersectPolygon"); + intersect_polygon_default2 = intersectPolygon2; } - _removeFromParentsChildList(v) { - delete this._children[this._parent[v]][v]; + }); + + // src/rendering-util/rendering-elements/intersect/index.js + var intersect_default2; + var init_intersect2 = __esm({ + "src/rendering-util/rendering-elements/intersect/index.js"() { + "use strict"; + init_intersect_node2(); + init_intersect_circle2(); + init_intersect_ellipse2(); + init_intersect_polygon2(); + init_intersect_rect2(); + intersect_default2 = { + node: intersect_node_default2, + circle: intersect_circle_default2, + ellipse: intersect_ellipse_default2, + polygon: intersect_polygon_default2, + rect: intersect_rect_default2 + }; } - parent(v) { - if (this._isCompound) { - var parent = this._parent[v]; - if (parent !== GRAPH_NODE) { - return parent; + }); + + // src/rendering-util/rendering-elements/shapes/drawRect.ts + var drawRect3; + var init_drawRect = __esm({ + "src/rendering-util/rendering-elements/shapes/drawRect.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_roundedRectPath(); + init_handDrawnShapeStyles(); + init_rough_esm(); + drawRect3 = /* @__PURE__ */ __name(async (parent4, node2, options3) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const totalWidth = Math.max(bbox.width + options3.labelPaddingX * 2, node2?.width || 0); + const totalHeight = Math.max(bbox.height + options3.labelPaddingY * 2, node2?.height || 0); + const x5 = -totalWidth / 2; + const y5 = -totalHeight / 2; + let rect4; + let { rx, ry } = node2; + const { cssStyles } = node2; + if (options3?.rx && options3.ry) { + rx = options3.rx; + ry = options3.ry; + } + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options4 = userNodeOverrides(node2, {}); + const roughNode = rx || ry ? rc.path(createRoundedRectPathD(x5, y5, totalWidth, totalHeight, rx || 0), options4) : rc.rectangle(x5, y5, totalWidth, totalHeight, options4); + rect4 = shapeSvg.insert(() => roughNode, ":first-child"); + rect4.attr("class", "basic label-container").attr("style", cssStyles); + } else { + rect4 = shapeSvg.insert("rect", ":first-child"); + rect4.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", rx).attr("data-id", "abc").attr("data-et", "node").attr("ry", ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight); } - } + updateNodeBounds2(node2, rect4); + node2.intersect = function(point8) { + return intersect_default2.rect(node2, point8); + }; + return shapeSvg; + }, "drawRect"); } - children(v) { - if (isUndefined(v)) { - v = GRAPH_NODE; - } - if (this._isCompound) { - var children2 = this._children[v]; - if (children2) { - return keys$1(children2); - } - } else if (v === GRAPH_NODE) { - return this.nodes(); - } else if (this.hasNode(v)) { - return []; - } + }); + + // src/rendering-util/rendering-elements/shapes/state.ts + var state; + var init_state = __esm({ + "src/rendering-util/rendering-elements/shapes/state.ts"() { + "use strict"; + init_drawRect(); + state = /* @__PURE__ */ __name(async (parent4, node2) => { + const options3 = { + rx: 5, + ry: 5, + classes: "flowchart-node" + }; + return drawRect3(parent4, node2, options3); + }, "state"); } - predecessors(v) { - var predsV = this._preds[v]; - if (predsV) { - return keys$1(predsV); - } + }); + + // src/rendering-util/rendering-elements/shapes/roundedRect.ts + var roundedRect; + var init_roundedRect = __esm({ + "src/rendering-util/rendering-elements/shapes/roundedRect.ts"() { + "use strict"; + init_drawRect(); + roundedRect = /* @__PURE__ */ __name(async (parent4, node2) => { + const options3 = { + rx: 5, + ry: 5, + classes: "", + labelPaddingX: (node2?.padding || 0) * 1, + labelPaddingY: (node2?.padding || 0) * 1 + }; + return drawRect3(parent4, node2, options3); + }, "roundedRect"); } - successors(v) { - var sucsV = this._sucs[v]; - if (sucsV) { - return keys$1(sucsV); - } + }); + + // src/rendering-util/rendering-elements/shapes/squareRect.ts + var squareRect2; + var init_squareRect = __esm({ + "src/rendering-util/rendering-elements/shapes/squareRect.ts"() { + "use strict"; + init_drawRect(); + squareRect2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const options3 = { + rx: 0, + ry: 0, + classes: "", + labelPaddingX: (node2?.padding || 0) * 2, + labelPaddingY: (node2?.padding || 0) * 1 + }; + return drawRect3(parent4, node2, options3); + }, "squareRect"); } - neighbors(v) { - var preds = this.predecessors(v); - if (preds) { - return union$1(preds, this.successors(v)); - } + }); + + // src/rendering-util/rendering-elements/shapes/stateStart.ts + var stateStart; + var init_stateStart = __esm({ + "src/rendering-util/rendering-elements/shapes/stateStart.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_rough_esm(); + init_handDrawnShapeStyles(); + init_diagramAPI(); + stateStart = /* @__PURE__ */ __name((parent4, node2) => { + const { themeVariables } = getConfig2(); + const { lineColor } = themeVariables; + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + let circle6; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const roughNode = rc.circle(0, 0, 14, solidStateFill(lineColor)); + circle6 = shapeSvg.insert(() => roughNode); + } else { + circle6 = shapeSvg.insert("circle", ":first-child"); + } + circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); + updateNodeBounds2(node2, circle6); + node2.intersect = function(point8) { + return intersect_default2.circle(node2, 7, point8); + }; + return shapeSvg; + }, "stateStart"); } - isLeaf(v) { - var neighbors; - if (this.isDirected()) { - neighbors = this.successors(v); - } else { - neighbors = this.neighbors(v); - } - return neighbors.length === 0; + }); + + // src/rendering-util/rendering-elements/shapes/stateEnd.ts + var stateEnd; + var init_stateEnd = __esm({ + "src/rendering-util/rendering-elements/shapes/stateEnd.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_rough_esm(); + init_handDrawnShapeStyles(); + init_diagramAPI(); + stateEnd = /* @__PURE__ */ __name((parent4, node2) => { + const { themeVariables } = getConfig2(); + const { lineColor } = themeVariables; + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + let circle6; + let innerCircle; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const roughNode = rc.circle(0, 0, 14, { ...solidStateFill(lineColor), roughness: 0.5 }); + const roughInnerNode = rc.circle(0, 0, 5, { ...solidStateFill(lineColor), fillStyle: "solid" }); + circle6 = shapeSvg.insert(() => roughNode); + innerCircle = shapeSvg.insert(() => roughInnerNode); + } else { + innerCircle = shapeSvg.insert("circle", ":first-child"); + circle6 = shapeSvg.insert("circle", ":first-child"); + circle6.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); + innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10); + } + updateNodeBounds2(node2, circle6); + node2.intersect = function(point8) { + return intersect_default2.circle(node2, 7, point8); + }; + return shapeSvg; + }, "stateEnd"); } - filterNodes(filter2) { - var copy2 = new this.constructor({ - directed: this._isDirected, - multigraph: this._isMultigraph, - compound: this._isCompound - }); - copy2.setGraph(this.graph()); - var self2 = this; - forEach(this._nodes, function(value2, v) { - if (filter2(v)) { - copy2.setNode(v, value2); + }); + + // src/rendering-util/rendering-elements/shapes/forkJoin.ts + var forkJoin2; + var init_forkJoin = __esm({ + "src/rendering-util/rendering-elements/shapes/forkJoin.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_rough_esm(); + init_handDrawnShapeStyles(); + init_diagramAPI(); + forkJoin2 = /* @__PURE__ */ __name((parent4, node2, dir2) => { + const { themeVariables } = getConfig2(); + const { lineColor } = themeVariables; + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + let width3 = 70; + let height2 = 10; + if (dir2 === "LR") { + width3 = 10; + height2 = 70; + } + const x5 = -1 * width3 / 2; + const y5 = -1 * height2 / 2; + let shape; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const roughNode = rc.rectangle(x5, y5, width3, height2, solidStateFill(lineColor)); + shape = shapeSvg.insert(() => roughNode); + } else { + shape = shapeSvg.append("rect").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("class", "fork-join"); } - }); - forEach(this._edgeObjs, function(e) { - if (copy2.hasNode(e.v) && copy2.hasNode(e.w)) { - copy2.setEdge(e, self2.edge(e)); + updateNodeBounds2(node2, shape); + let nodeHeight = 0; + let nodeWidth = 0; + let nodePadding = 10; + if (node2.height) { + nodeHeight = node2.height; } - }); - var parents2 = {}; - function findParent(v) { - var parent = self2.parent(v); - if (parent === void 0 || copy2.hasNode(parent)) { - parents2[v] = parent; - return parent; - } else if (parent in parents2) { - return parents2[parent]; - } else { - return findParent(parent); + if (node2.width) { + nodeWidth = node2.width; } - } - if (this._isCompound) { - forEach(copy2.nodes(), function(v) { - copy2.setParent(v, findParent(v)); - }); - } - return copy2; + if (node2.padding) { + nodePadding = node2.padding; + } + node2.height = nodeHeight + nodePadding / 2; + node2.width = nodeWidth + nodePadding / 2; + node2.intersect = function(point8) { + return intersect_default2.rect(node2, point8); + }; + return shapeSvg; + }, "forkJoin"); } - /* === Edge functions ========== */ - setDefaultEdgeLabel(newDefault) { - if (!isFunction(newDefault)) { - newDefault = constant$2(newDefault); - } - this._defaultEdgeLabelFn = newDefault; - return this; + }); + + // src/rendering-util/rendering-elements/shapes/choice.ts + var choice2; + var init_choice = __esm({ + "src/rendering-util/rendering-elements/shapes/choice.ts"() { + "use strict"; + init_intersect2(); + init_rough_esm(); + init_handDrawnShapeStyles(); + init_diagramAPI(); + choice2 = /* @__PURE__ */ __name((parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { themeVariables } = getConfig2(); + const { lineColor } = themeVariables; + const shapeSvg = parent4.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); + const s2 = 28; + const points = [ + { x: 0, y: s2 / 2 }, + { x: s2 / 2, y: 0 }, + { x: 0, y: -s2 / 2 }, + { x: -s2 / 2, y: 0 } + ]; + let choice3; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const pointArr = points.map(function(d2) { + return [d2.x, d2.y]; + }); + const roughNode = rc.polygon(pointArr, solidStateFill(lineColor)); + choice3 = shapeSvg.insert(() => roughNode); + } else { + choice3 = shapeSvg.insert("polygon", ":first-child").attr( + "points", + points.map(function(d2) { + return d2.x + "," + d2.y; + }).join(" ") + ); + } + choice3.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28).attr("style", nodeStyles); + node2.width = 28; + node2.height = 28; + node2.intersect = function(point8) { + return intersect_default2.circle(node2, 14, point8); + }; + return shapeSvg; + }, "choice"); } - edgeCount() { - return this._edgeCount; + }); + + // src/rendering-util/rendering-elements/shapes/note.ts + var note2; + var init_note2 = __esm({ + "src/rendering-util/rendering-elements/shapes/note.ts"() { + "use strict"; + init_logger(); + init_util2(); + init_intersect2(); + init_diagramAPI(); + init_rough_esm(); + note2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { themeVariables, handDrawnSeed } = getConfig2(); + const { noteBorderColor, noteBkgColor } = themeVariables; + const useHtmlLabels = node2.useHtmlLabels; + if (!useHtmlLabels) { + node2.centerLabel = true; + } + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, "node " + node2.cssClasses); + log.info("Classes = ", node2.cssClasses); + const { cssStyles } = node2; + let rect4; + const totalWidth = bbox.width + node2.padding; + const totalHeight = bbox.height + node2.padding; + const x5 = -totalWidth / 2; + const y5 = -totalHeight / 2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const roughNode = rc.rectangle(x5, y5, totalWidth, totalHeight, { + roughness: 0.7, + fill: noteBkgColor, + fillWeight: 3, + seed: handDrawnSeed, + // fillStyle: 'solid', // solid fill' + stroke: noteBorderColor + }); + rect4 = shapeSvg.insert(() => roughNode, ":first-child"); + rect4.attr("class", "basic label-container").attr("style", cssStyles); + } else { + rect4 = shapeSvg.insert("rect", ":first-child"); + rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x5).attr("y", y5).attr("width", totalWidth).attr("height", totalHeight); + } + updateNodeBounds2(node2, rect4); + node2.intersect = function(point8) { + return intersect_default2.rect(node2, point8); + }; + return shapeSvg; + }, "note"); } - edges() { - return values(this._edgeObjs); + }); + + // src/rendering-util/rendering-elements/shapes/stadium.ts + var stadium2; + var init_stadium = __esm({ + "src/rendering-util/rendering-elements/shapes/stadium.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_roundedRectPath(); + stadium2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const h2 = bbox.height + node2.padding; + const w3 = bbox.width + h2 / 4 + node2.padding; + let rect4; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createRoundedRectPathD(-w3 / 2, -h2 / 2, w3, h2, h2 / 2); + const roughNode = rc.path(pathData, options3); + rect4 = shapeSvg.insert(() => roughNode, ":first-child"); + rect4.attr("class", "basic label-container").attr("style", cssStyles); + } else { + rect4 = shapeSvg.insert("rect", ":first-child"); + rect4.attr("class", "basic label-container").attr("style", nodeStyles).attr("rx", h2 / 2).attr("ry", h2 / 2).attr("x", -w3 / 2).attr("y", -h2 / 2).attr("width", w3).attr("height", h2); + } + updateNodeBounds2(node2, rect4); + node2.intersect = function(point8) { + return intersect_default2.rect(node2, point8); + }; + return shapeSvg; + }, "stadium"); } - setPath(vs, value2) { - var self2 = this; - var args = arguments; - reduce(vs, function(v, w2) { - if (args.length > 1) { - self2.setEdge(v, w2, value2); + }); + + // src/rendering-util/rendering-elements/shapes/rectWithTitle.ts + var rectWithTitle2; + var init_rectWithTitle = __esm({ + "src/rendering-util/rendering-elements/shapes/rectWithTitle.ts"() { + "use strict"; + init_src32(); + init_common(); + init_util2(); + init_createLabel2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_diagramAPI(); + init_roundedRectPath(); + init_logger(); + rectWithTitle2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + let classes6; + if (!node2.cssClasses) { + classes6 = "node default"; + } else { + classes6 = "node " + node2.cssClasses; + } + const shapeSvg = parent4.insert("g").attr("class", classes6).attr("id", node2.domId || node2.id); + const g2 = shapeSvg.insert("g"); + const label = shapeSvg.insert("g").attr("class", "label").attr("style", nodeStyles); + const description = node2.description; + const title2 = node2.label; + const text2 = label.node().appendChild(await createLabel_default2(title2, node2.labelStyle, true, true)); + let bbox = { width: 0, height: 0 }; + if (evaluate(getConfig2()?.flowchart?.htmlLabels)) { + const div2 = text2.children[0]; + const dv2 = select_default2(text2); + bbox = div2.getBoundingClientRect(); + dv2.attr("width", bbox.width); + dv2.attr("height", bbox.height); + } + log.info("Text 2", description); + const textRows = description || []; + const titleBox = text2.getBBox(); + const descr = label.node().appendChild( + await createLabel_default2( + textRows.join ? textRows.join("
    ") : textRows, + node2.labelStyle, + true, + true + ) + ); + const div = descr.children[0]; + const dv = select_default2(descr); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + const halfPadding = (node2.padding || 0) / 2; + select_default2(descr).attr( + "transform", + "translate( " + (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")" + ); + select_default2(text2).attr( + "transform", + "translate( " + (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)" + ); + bbox = label.node().getBBox(); + label.attr( + "transform", + "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")" + ); + const totalWidth = bbox.width + (node2.padding || 0); + const totalHeight = bbox.height + (node2.padding || 0); + const x5 = -bbox.width / 2 - halfPadding; + const y5 = -bbox.height / 2 - halfPadding; + let rect4; + let innerLine; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const roughNode = rc.path( + createRoundedRectPathD(x5, y5, totalWidth, totalHeight, node2.rx || 0), + options3 + ); + const roughLine = rc.line( + -bbox.width / 2 - halfPadding, + -bbox.height / 2 - halfPadding + titleBox.height + halfPadding, + bbox.width / 2 + halfPadding, + -bbox.height / 2 - halfPadding + titleBox.height + halfPadding, + options3 + ); + innerLine = shapeSvg.insert(() => { + log.debug("Rough node insert CXC", roughNode); + return roughLine; + }, ":first-child"); + rect4 = shapeSvg.insert(() => { + log.debug("Rough node insert CXC", roughNode); + return roughNode; + }, ":first-child"); } else { - self2.setEdge(v, w2); + rect4 = g2.insert("rect", ":first-child"); + innerLine = g2.insert("line"); + rect4.attr("class", "outer title-state").attr("style", nodeStyles).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + (node2.padding || 0)).attr("height", bbox.height + (node2.padding || 0)); + innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); + } + updateNodeBounds2(node2, rect4); + node2.intersect = function(point8) { + return intersect_default2.rect(node2, point8); + }; + return shapeSvg; + }, "rectWithTitle"); + } + }); + + // src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts + function insertPolygonShape2(parent4, w3, h2, points) { + return parent4.insert("polygon", ":first-child").attr( + "points", + points.map(function(d2) { + return d2.x + "," + d2.y; + }).join(" ") + ).attr("class", "label-container").attr("transform", "translate(" + -w3 / 2 + "," + h2 / 2 + ")"); + } + var init_insertPolygonShape = __esm({ + "src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts"() { + "use strict"; + __name(insertPolygonShape2, "insertPolygonShape"); + } + }); + + // src/rendering-util/rendering-elements/shapes/subroutine.ts + var subroutine2; + var init_subroutine = __esm({ + "src/rendering-util/rendering-elements/shapes/subroutine.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + subroutine2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const halfPadding = (node2?.padding || 0) / 2; + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const x5 = -bbox.width / 2 - halfPadding; + const y5 = -bbox.height / 2 - halfPadding; + const points = [ + { x: 0, y: 0 }, + { x: w3, y: 0 }, + { x: w3, y: -h2 }, + { x: 0, y: -h2 }, + { x: 0, y: 0 }, + { x: -8, y: 0 }, + { x: w3 + 8, y: 0 }, + { x: w3 + 8, y: -h2 }, + { x: -8, y: -h2 }, + { x: -8, y: 0 } + ]; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const roughNode = rc.rectangle(x5 - 8, y5, w3 + 16, h2, options3); + const l1 = rc.line(x5, y5, x5, y5 + h2, options3); + const l2 = rc.line(x5 + w3, y5, x5 + w3, y5 + h2, options3); + shapeSvg.insert(() => l1, ":first-child"); + shapeSvg.insert(() => l2, ":first-child"); + const rect4 = shapeSvg.insert(() => roughNode, ":first-child"); + const { cssStyles } = node2; + rect4.attr("class", "basic label-container").attr("style", cssStyles); + updateNodeBounds2(node2, rect4); + } else { + const el = insertPolygonShape2(shapeSvg, w3, h2, points); + if (nodeStyles) { + el.attr("style", nodeStyles); + } + updateNodeBounds2(node2, el); } - return w2; - }); - return this; + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "subroutine"); } - /* - * setEdge(v, w, [value, [name]]) - * setEdge({ v, w, [name] }, [value]) - */ - setEdge() { - var v, w2, name, value2; - var valueSpecified = false; - var arg0 = arguments[0]; - if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) { - v = arg0.v; - w2 = arg0.w; - name = arg0.name; - if (arguments.length === 2) { - value2 = arguments[1]; - valueSpecified = true; + }); + + // src/rendering-util/rendering-elements/shapes/cylinder.ts + var createCylinderPathD, createOuterCylinderPathD, createInnerCylinderPathD, cylinder2; + var init_cylinder = __esm({ + "src/rendering-util/rendering-elements/shapes/cylinder.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + createCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => { + return [ + `M${x5},${y5 + ry}`, + `a${rx},${ry} 0,0,0 ${width3},0`, + `a${rx},${ry} 0,0,0 ${-width3},0`, + `l0,${height2}`, + `a${rx},${ry} 0,0,0 ${width3},0`, + `l0,${-height2}` + ].join(" "); + }, "createCylinderPathD"); + createOuterCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => { + return [ + `M${x5},${y5 + ry}`, + `M${x5 + width3},${y5 + ry}`, + `a${rx},${ry} 0,0,0 ${-width3},0`, + `l0,${height2}`, + `a${rx},${ry} 0,0,0 ${width3},0`, + `l0,${-height2}` + ].join(" "); + }, "createOuterCylinderPathD"); + createInnerCylinderPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, rx, ry) => { + return [`M${x5 - width3 / 2},${-height2 / 2}`, `a${rx},${ry} 0,0,0 ${width3},0`].join(" "); + }, "createInnerCylinderPathD"); + cylinder2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const w3 = bbox.width + node2.padding; + const rx = w3 / 2; + const ry = rx / (2.5 + w3 / 50); + const h2 = bbox.height + ry + node2.padding; + let cylinder3; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const outerPathData = createOuterCylinderPathD(0, 0, w3, h2, rx, ry); + const innerPathData = createInnerCylinderPathD(0, ry, w3, h2, rx, ry); + const outerNode = rc.path(outerPathData, userNodeOverrides(node2, {})); + const innerLine = rc.path(innerPathData, userNodeOverrides(node2, { fill: "none" })); + cylinder3 = shapeSvg.insert(() => innerLine, ":first-child"); + cylinder3 = shapeSvg.insert(() => outerNode, ":first-child"); + cylinder3.attr("class", "basic label-container"); + if (cssStyles) { + cylinder3.attr("style", cssStyles); + } + } else { + const pathData = createCylinderPathD(0, 0, w3, h2, rx, ry); + cylinder3 = shapeSvg.insert("path", ":first-child").attr("d", pathData).attr("class", "basic label-container").attr("style", cssStyles).attr("style", nodeStyles); + } + cylinder3.attr("label-offset-y", ry); + cylinder3.attr("transform", `translate(${-w3 / 2}, ${-(h2 / 2 + ry)})`); + updateNodeBounds2(node2, cylinder3); + node2.intersect = function(point8) { + const pos = intersect_default2.rect(node2, point8); + const x5 = pos.x - (node2.x ?? 0); + if (rx != 0 && (Math.abs(x5) < (node2.width ?? 0) / 2 || Math.abs(x5) == (node2.width ?? 0) / 2 && Math.abs(pos.y - (node2.y ?? 0)) > (node2.height ?? 0) / 2 - ry)) { + let y5 = ry * ry * (1 - x5 * x5 / (rx * rx)); + if (y5 > 0) { + y5 = Math.sqrt(y5); + } + y5 = ry - y5; + if (point8.y - (node2.y ?? 0) > 0) { + y5 = -y5; + } + pos.y += y5; + } + return pos; + }; + return shapeSvg; + }, "cylinder"); + } + }); + + // src/rendering-util/rendering-elements/shapes/circle.ts + var circle3; + var init_circle = __esm({ + "src/rendering-util/rendering-elements/shapes/circle.ts"() { + "use strict"; + init_logger(); + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + circle3 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox, halfPadding } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const radius2 = bbox.width / 2 + halfPadding; + let circleElem; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const roughNode = rc.circle(0, 0, radius2 * 2, options3); + circleElem = shapeSvg.insert(() => roughNode, ":first-child"); + circleElem.attr("class", "basic label-container").attr("style", cssStyles); + } else { + circleElem = shapeSvg.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", nodeStyles).attr("r", radius2).attr("cx", 0).attr("cy", 0); } - } else { - v = arg0; - w2 = arguments[1]; - name = arguments[3]; - if (arguments.length > 2) { - value2 = arguments[2]; - valueSpecified = true; + updateNodeBounds2(node2, circleElem); + node2.intersect = function(point8) { + log.info("Circle intersect", node2, radius2, point8); + return intersect_default2.circle(node2, radius2, point8); + }; + return shapeSvg; + }, "circle"); + } + }); + + // src/rendering-util/rendering-elements/shapes/doubleCircle.ts + var doublecircle2; + var init_doubleCircle = __esm({ + "src/rendering-util/rendering-elements/shapes/doubleCircle.ts"() { + "use strict"; + init_logger(); + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + doublecircle2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox, halfPadding } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const gap = 5; + const outerRadius = bbox.width / 2 + halfPadding + gap; + const innerRadius = bbox.width / 2 + halfPadding; + let circleGroup; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const outerOptions = userNodeOverrides(node2, { roughness: 0.2, strokeWidth: 2.5 }); + const innerOptions = userNodeOverrides(node2, { roughness: 0.2, strokeWidth: 1.5 }); + const outerRoughNode = rc.circle(0, 0, outerRadius * 2, outerOptions); + const innerRoughNode = rc.circle(0, 0, innerRadius * 2, innerOptions); + circleGroup = shapeSvg.insert("g", ":first-child"); + circleGroup.attr("class", node2.cssClasses).attr("style", cssStyles); + circleGroup.node()?.appendChild(outerRoughNode); + circleGroup.node()?.appendChild(innerRoughNode); + } else { + circleGroup = shapeSvg.insert("g", ":first-child"); + const outerCircle = circleGroup.insert("circle", ":first-child"); + const innerCircle = circleGroup.insert("circle"); + circleGroup.attr("class", "basic label-container").attr("style", nodeStyles); + outerCircle.attr("class", "outer-circle").attr("style", nodeStyles).attr("r", outerRadius).attr("cx", 0).attr("cy", 0); + innerCircle.attr("class", "inner-circle").attr("style", nodeStyles).attr("r", innerRadius).attr("cx", 0).attr("cy", 0); + } + updateNodeBounds2(node2, circleGroup); + node2.intersect = function(point8) { + log.info("DoubleCircle intersect", node2, outerRadius, point8); + return intersect_default2.circle(node2, outerRadius, point8); + }; + return shapeSvg; + }, "doublecircle"); + } + }); + + // src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts + var createPolygonPathD, rect_left_inv_arrow2; + var init_rectLeftInvArrow = __esm({ + "src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + createPolygonPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => { + return [ + `M${x5 - height2 / 2},${y5}`, + `L${x5 + width3},${y5}`, + `L${x5 + width3},${y5 - height2}`, + `L${x5 - height2 / 2},${y5 - height2}`, + `L${x5},${y5 - height2 / 2}`, + "Z" + ].join(" "); + }, "createPolygonPathD"); + rect_left_inv_arrow2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: -h2 / 2, y: 0 }, + { x: w3, y: 0 }, + { x: w3, y: -h2 }, + { x: -h2 / 2, y: -h2 }, + { x: 0, y: -h2 / 2 } + ]; + let polygon2; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createPolygonPathD(0, 0, w3, h2); + const roughNode = rc.path(pathData, options3); + polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`); + if (cssStyles) { + polygon2.attr("style", cssStyles); + } + } else { + polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points); } - } - v = "" + v; - w2 = "" + w2; - if (!isUndefined(name)) { - name = "" + name; - } - var e = edgeArgsToId(this._isDirected, v, w2, name); - if (has(this._edgeLabels, e)) { - if (valueSpecified) { - this._edgeLabels[e] = value2; + if (nodeStyles) { + polygon2.attr("style", nodeStyles); } - return this; - } - if (!isUndefined(name) && !this._isMultigraph) { - throw new Error("Cannot set a named edge when isMultigraph = false"); - } - this.setNode(v); - this.setNode(w2); - this._edgeLabels[e] = valueSpecified ? value2 : this._defaultEdgeLabelFn(v, w2, name); - var edgeObj = edgeArgsToObj(this._isDirected, v, w2, name); - v = edgeObj.v; - w2 = edgeObj.w; - Object.freeze(edgeObj); - this._edgeObjs[e] = edgeObj; - incrementOrInitEntry(this._preds[w2], v); - incrementOrInitEntry(this._sucs[v], w2); - this._in[w2][e] = edgeObj; - this._out[v][e] = edgeObj; - this._edgeCount++; - return this; + node2.width = w3 + h2; + node2.height = h2; + updateNodeBounds2(node2, polygon2); + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "rect_left_inv_arrow"); } - edge(v, w2, name) { - var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w2, name); - return this._edgeLabels[e]; - } - hasEdge(v, w2, name) { - var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w2, name); - return has(this._edgeLabels, e); - } - removeEdge(v, w2, name) { - var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w2, name); - var edge = this._edgeObjs[e]; - if (edge) { - v = edge.v; - w2 = edge.w; - delete this._edgeLabels[e]; - delete this._edgeObjs[e]; - decrementOrRemoveEntry(this._preds[w2], v); - decrementOrRemoveEntry(this._sucs[v], w2); - delete this._in[w2][e]; - delete this._out[v][e]; - this._edgeCount--; - } - return this; + }); + + // src/rendering-util/rendering-elements/shapes/question.ts + var createDecisionBoxPathD, question2; + var init_question = __esm({ + "src/rendering-util/rendering-elements/shapes/question.ts"() { + "use strict"; + init_logger(); + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + createDecisionBoxPathD = /* @__PURE__ */ __name((x5, y5, size5) => { + return [ + `M${x5 + size5 / 2},${y5}`, + `L${x5 + size5},${y5 - size5 / 2}`, + `L${x5 + size5 / 2},${y5 - size5}`, + `L${x5},${y5 - size5 / 2}`, + "Z" + ].join(" "); + }, "createDecisionBoxPathD"); + question2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const s2 = w3 + h2; + const points = [ + { x: s2 / 2, y: 0 }, + { x: s2, y: -s2 / 2 }, + { x: s2 / 2, y: -s2 }, + { x: 0, y: -s2 / 2 } + ]; + let polygon2; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createDecisionBoxPathD(0, 0, s2); + const roughNode = rc.path(pathData, options3); + polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-s2 / 2}, ${s2 / 2})`); + if (cssStyles) { + polygon2.attr("style", cssStyles); + } + } else { + polygon2 = insertPolygonShape2(shapeSvg, s2, s2, points); + } + if (nodeStyles) { + polygon2.attr("style", nodeStyles); + } + updateNodeBounds2(node2, polygon2); + node2.intersect = function(point8) { + log.debug( + "APA12 Intersect called SPLIT\npoint:", + point8, + "\nnode:\n", + node2, + "\nres:", + intersect_default2.polygon(node2, points, point8) + ); + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "question"); } - inEdges(v, u) { - var inV = this._in[v]; - if (inV) { - var edges2 = values(inV); - if (!u) { - return edges2; + }); + + // src/rendering-util/rendering-elements/shapes/hexagon.ts + var createHexagonPathD, hexagon2; + var init_hexagon = __esm({ + "src/rendering-util/rendering-elements/shapes/hexagon.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + createHexagonPathD = /* @__PURE__ */ __name((x5, y5, width3, height2, m2) => { + return [ + `M${x5 + m2},${y5}`, + `L${x5 + width3 - m2},${y5}`, + `L${x5 + width3},${y5 - height2 / 2}`, + `L${x5 + width3 - m2},${y5 - height2}`, + `L${x5 + m2},${y5 - height2}`, + `L${x5},${y5 - height2 / 2}`, + "Z" + ].join(" "); + }, "createHexagonPathD"); + hexagon2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const f3 = 4; + const h2 = bbox.height + node2.padding; + const m2 = h2 / f3; + const w3 = bbox.width + 2 * m2 + node2.padding; + const points = [ + { x: m2, y: 0 }, + { x: w3 - m2, y: 0 }, + { x: w3, y: -h2 / 2 }, + { x: w3 - m2, y: -h2 }, + { x: m2, y: -h2 }, + { x: 0, y: -h2 / 2 } + ]; + let polygon2; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createHexagonPathD(0, 0, w3, h2, m2); + const roughNode = rc.path(pathData, options3); + polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`); + if (cssStyles) { + polygon2.attr("style", cssStyles); + } + } else { + polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points); } - return filter(edges2, function(edge) { - return edge.v === u; - }); - } + if (nodeStyles) { + polygon2.attr("style", nodeStyles); + } + node2.width = w3; + node2.height = h2; + updateNodeBounds2(node2, polygon2); + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "hexagon"); } - outEdges(v, w2) { - var outV = this._out[v]; - if (outV) { - var edges2 = values(outV); - if (!w2) { - return edges2; + }); + + // src/rendering-util/rendering-elements/shapes/leanRight.ts + var createLeanRightPathD, lean_right2; + var init_leanRight = __esm({ + "src/rendering-util/rendering-elements/shapes/leanRight.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + createLeanRightPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => { + return [ + `M${x5 - 2 * height2 / 6},${y5}`, + `L${x5 + width3 - height2 / 6},${y5}`, + `L${x5 + width3 + 2 * height2 / 6},${y5 - height2}`, + `L${x5 + height2 / 6},${y5 - height2}`, + "Z" + ].join(" "); + }, "createLeanRightPathD"); + lean_right2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: -2 * h2 / 6, y: 0 }, + { x: w3 - h2 / 6, y: 0 }, + { x: w3 + 2 * h2 / 6, y: -h2 }, + { x: h2 / 6, y: -h2 } + ]; + let polygon2; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createLeanRightPathD(0, 0, w3, h2); + const roughNode = rc.path(pathData, options3); + polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`); + if (cssStyles) { + polygon2.attr("style", cssStyles); + } + } else { + polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points); } - return filter(edges2, function(edge) { - return edge.w === w2; - }); - } + if (nodeStyles) { + polygon2.attr("style", nodeStyles); + } + node2.width = w3; + node2.height = h2; + updateNodeBounds2(node2, polygon2); + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "lean_right"); } - nodeEdges(v, w2) { - var inEdges = this.inEdges(v, w2); - if (inEdges) { - return inEdges.concat(this.outEdges(v, w2)); - } + }); + + // src/rendering-util/rendering-elements/shapes/leanLeft.ts + var createLeanLeftPathD, lean_left2; + var init_leanLeft = __esm({ + "src/rendering-util/rendering-elements/shapes/leanLeft.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + createLeanLeftPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => { + return [ + `M${x5 + 2 * height2 / 6},${y5}`, + `L${x5 + width3 + height2 / 6},${y5}`, + `L${x5 + width3 - 2 * height2 / 6},${y5 - height2}`, + `L${x5 - height2 / 6},${y5 - height2}`, + "Z" + ].join(" "); + }, "createLeanLeftPathD"); + lean_left2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: 2 * h2 / 6, y: 0 }, + { x: w3 + h2 / 6, y: 0 }, + { x: w3 - 2 * h2 / 6, y: -h2 }, + { x: -h2 / 6, y: -h2 } + ]; + let polygon2; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createLeanLeftPathD(0, 0, w3, h2); + const roughNode = rc.path(pathData, options3); + polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`); + if (cssStyles) { + polygon2.attr("style", cssStyles); + } + } else { + polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points); + } + if (nodeStyles) { + polygon2.attr("style", nodeStyles); + } + node2.width = w3; + node2.height = h2; + updateNodeBounds2(node2, polygon2); + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "lean_left"); + } + }); + + // src/rendering-util/rendering-elements/shapes/trapezoid.ts + var createTrapezoidPathD, trapezoid2; + var init_trapezoid = __esm({ + "src/rendering-util/rendering-elements/shapes/trapezoid.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + createTrapezoidPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => { + return [ + `M${x5 - 2 * height2 / 6},${y5}`, + `L${x5 + width3 + 2 * height2 / 6},${y5}`, + `L${x5 + width3 - height2 / 6},${y5 - height2}`, + `L${x5 + height2 / 6},${y5 - height2}`, + "Z" + ].join(" "); + }, "createTrapezoidPathD"); + trapezoid2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: -2 * h2 / 6, y: 0 }, + { x: w3 + 2 * h2 / 6, y: 0 }, + { x: w3 - h2 / 6, y: -h2 }, + { x: h2 / 6, y: -h2 } + ]; + let polygon2; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createTrapezoidPathD(0, 0, w3, h2); + const roughNode = rc.path(pathData, options3); + polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`); + if (cssStyles) { + polygon2.attr("style", cssStyles); + } + } else { + polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points); + } + if (nodeStyles) { + polygon2.attr("style", nodeStyles); + } + node2.width = w3; + node2.height = h2; + updateNodeBounds2(node2, polygon2); + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "trapezoid"); + } + }); + + // src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts + var createInvertedTrapezoidPathD, inv_trapezoid2; + var init_invertedTrapezoid = __esm({ + "src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts"() { + "use strict"; + init_util2(); + init_intersect2(); + init_handDrawnShapeStyles(); + init_rough_esm(); + init_insertPolygonShape(); + createInvertedTrapezoidPathD = /* @__PURE__ */ __name((x5, y5, width3, height2) => { + return [ + `M${x5 + height2 / 6},${y5}`, + `L${x5 + width3 - height2 / 6},${y5}`, + `L${x5 + width3 + 2 * height2 / 6},${y5 - height2}`, + `L${x5 - 2 * height2 / 6},${y5 - height2}`, + "Z" + ].join(" "); + }, "createInvertedTrapezoidPathD"); + inv_trapezoid2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { labelStyles, nodeStyles } = styles2String(node2); + node2.labelStyle = labelStyles; + const { shapeSvg, bbox } = await labelHelper2(parent4, node2, getNodeClasses(node2)); + const w3 = bbox.width + node2.padding; + const h2 = bbox.height + node2.padding; + const points = [ + { x: h2 / 6, y: 0 }, + { x: w3 - h2 / 6, y: 0 }, + { x: w3 + 2 * h2 / 6, y: -h2 }, + { x: -2 * h2 / 6, y: -h2 } + ]; + let polygon2; + const { cssStyles } = node2; + if (node2.look === "handDrawn") { + const rc = at.svg(shapeSvg); + const options3 = userNodeOverrides(node2, {}); + const pathData = createInvertedTrapezoidPathD(0, 0, w3, h2); + const roughNode = rc.path(pathData, options3); + polygon2 = shapeSvg.insert(() => roughNode, ":first-child").attr("transform", `translate(${-w3 / 2}, ${h2 / 2})`); + if (cssStyles) { + polygon2.attr("style", cssStyles); + } + } else { + polygon2 = insertPolygonShape2(shapeSvg, w3, h2, points); + } + if (nodeStyles) { + polygon2.attr("style", nodeStyles); + } + node2.width = w3; + node2.height = h2; + updateNodeBounds2(node2, polygon2); + node2.intersect = function(point8) { + return intersect_default2.polygon(node2, points, point8); + }; + return shapeSvg; + }, "inv_trapezoid"); + } + }); + + // src/rendering-util/rendering-elements/shapes/labelRect.ts + var labelRect2; + var init_labelRect = __esm({ + "src/rendering-util/rendering-elements/shapes/labelRect.ts"() { + "use strict"; + init_drawRect(); + init_util2(); + init_intersect2(); + labelRect2 = /* @__PURE__ */ __name(async (parent4, node2) => { + const { shapeSvg } = await labelHelper2(parent4, node2, "label"); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const totalWidth = 0.1; + const totalHeight = 0.1; + rect4.attr("width", totalWidth).attr("height", totalHeight); + shapeSvg.attr("class", "label edgeLabel"); + updateNodeBounds2(node2, rect4); + node2.intersect = function(point8) { + return intersect_default2.rect(node2, point8); + }; + return shapeSvg; + }, "labelRect"); + } + }); + + // src/rendering-util/rendering-elements/nodes.js + var shapes3, nodeElems2, insertNode2, setNodeElem2, clear7, positionNode2; + var init_nodes3 = __esm({ + "src/rendering-util/rendering-elements/nodes.js"() { + "use strict"; + init_logger(); + init_state(); + init_roundedRect(); + init_squareRect(); + init_stateStart(); + init_stateEnd(); + init_forkJoin(); + init_choice(); + init_note2(); + init_stadium(); + init_rectWithTitle(); + init_diagramAPI(); + init_subroutine(); + init_cylinder(); + init_circle(); + init_doubleCircle(); + init_rectLeftInvArrow(); + init_question(); + init_hexagon(); + init_leanRight(); + init_leanLeft(); + init_trapezoid(); + init_invertedTrapezoid(); + init_labelRect(); + shapes3 = { + state, + stateStart, + stateEnd, + fork: forkJoin2, + join: forkJoin2, + choice: choice2, + note: note2, + roundedRect, + rectWithTitle: rectWithTitle2, + squareRect: squareRect2, + stadium: stadium2, + subroutine: subroutine2, + cylinder: cylinder2, + circle: circle3, + doublecircle: doublecircle2, + odd: rect_left_inv_arrow2, + diamond: question2, + hexagon: hexagon2, + lean_right: lean_right2, + lean_left: lean_left2, + trapezoid: trapezoid2, + inv_trapezoid: inv_trapezoid2, + labelRect: labelRect2 + }; + nodeElems2 = /* @__PURE__ */ new Map(); + insertNode2 = /* @__PURE__ */ __name(async (elem, node2, dir2) => { + let newEl; + let el; + if (node2.shape === "rect") { + if (node2.rx && node2.ry) { + node2.shape = "roundedRect"; + } else { + node2.shape = "squareRect"; + } + } + if (node2.link) { + let target; + if (getConfig2().securityLevel === "sandbox") { + target = "_top"; + } else if (node2.linkTarget) { + target = node2.linkTarget || "_blank"; + } + newEl = elem.insert("svg:a").attr("xlink:href", node2.link).attr("target", target); + el = await shapes3[node2.shape](newEl, node2, dir2); + } else { + el = await shapes3[node2.shape](elem, node2, dir2); + newEl = el; + } + if (node2.tooltip) { + el.attr("title", node2.tooltip); + } + nodeElems2.set(node2.id, newEl); + if (node2.haveCallback) { + nodeElems2.get(node2.id).attr("class", nodeElems2.get(node2.id).attr("class") + " clickable"); + } + return newEl; + }, "insertNode"); + setNodeElem2 = /* @__PURE__ */ __name((elem, node2) => { + nodeElems2.set(node2.id, elem); + }, "setNodeElem"); + clear7 = /* @__PURE__ */ __name(() => { + nodeElems2.clear(); + }, "clear"); + positionNode2 = /* @__PURE__ */ __name((node2) => { + const el = nodeElems2.get(node2.id); + log.trace( + "Transforming node", + node2.diff, + node2, + "translate(" + (node2.x - node2.width / 2 - 5) + ", " + node2.width / 2 + ")" + ); + const padding3 = 8; + const diff2 = node2.diff || 0; + if (node2.clusterNode) { + el.attr( + "transform", + "translate(" + (node2.x + diff2 - node2.width / 2) + ", " + (node2.y - node2.height / 2 - padding3) + ")" + ); + } else { + el.attr("transform", "translate(" + node2.x + ", " + node2.y + ")"); + } + return diff2; + }, "positionNode"); + } + }); + + // src/internals.ts + var internalHelpers; + var init_internals = __esm({ + "src/internals.ts"() { + "use strict"; + init_config(); + init_common(); + init_logger(); + init_clusters(); + init_edges(); + init_markers(); + init_nodes3(); + init_util2(); + init_utils2(); + internalHelpers = { + common: common_default, + getConfig, + insertCluster, + insertEdge, + insertEdgeLabel, + insertMarkers: markers_default, + insertNode: insertNode2, + interpolateToCurve, + labelHelper: labelHelper2, + log, + positionEdgeLabel + }; } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js + function isSymbol(value2) { + return typeof value2 == "symbol" || isObjectLike_default(value2) && baseGetTag_default(value2) == symbolTag; + } + var symbolTag, isSymbol_default; + var init_isSymbol = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js"() { + "use strict"; + init_baseGetTag(); + init_isObjectLike(); + symbolTag = "[object Symbol]"; + __name(isSymbol, "isSymbol"); + isSymbol_default = isSymbol; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js + function arrayMap(array4, iteratee) { + var index = -1, length2 = array4 == null ? 0 : array4.length, result = Array(length2); + while (++index < length2) { + result[index] = iteratee(array4[index], index, array4); + } + return result; } - Graph.prototype._nodeCount = 0; - Graph.prototype._edgeCount = 0; - function incrementOrInitEntry(map2, k) { - if (map2[k]) { - map2[k]++; - } else { - map2[k] = 1; + var arrayMap_default; + var init_arrayMap = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js"() { + "use strict"; + __name(arrayMap, "arrayMap"); + arrayMap_default = arrayMap; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js + function baseToString(value2) { + if (typeof value2 == "string") { + return value2; + } + if (isArray_default(value2)) { + return arrayMap_default(value2, baseToString) + ""; } + if (isSymbol_default(value2)) { + return symbolToString ? symbolToString.call(value2) : ""; + } + var result = value2 + ""; + return result == "0" && 1 / value2 == -INFINITY ? "-0" : result; + } + var INFINITY, symbolProto, symbolToString, baseToString_default; + var init_baseToString = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js"() { + "use strict"; + init_Symbol(); + init_arrayMap(); + init_isArray(); + init_isSymbol(); + INFINITY = 1 / 0; + symbolProto = Symbol_default ? Symbol_default.prototype : void 0; + symbolToString = symbolProto ? symbolProto.toString : void 0; + __name(baseToString, "baseToString"); + baseToString_default = baseToString; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js + function trimmedEndIndex(string3) { + var index = string3.length; + while (index-- && reWhitespace.test(string3.charAt(index))) { + } + return index; } - function decrementOrRemoveEntry(map2, k) { - if (!--map2[k]) { - delete map2[k]; + var reWhitespace, trimmedEndIndex_default; + var init_trimmedEndIndex = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js"() { + "use strict"; + reWhitespace = /\s/; + __name(trimmedEndIndex, "trimmedEndIndex"); + trimmedEndIndex_default = trimmedEndIndex; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js + function baseTrim(string3) { + return string3 ? string3.slice(0, trimmedEndIndex_default(string3) + 1).replace(reTrimStart, "") : string3; + } + var reTrimStart, baseTrim_default; + var init_baseTrim = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js"() { + "use strict"; + init_trimmedEndIndex(); + reTrimStart = /^\s+/; + __name(baseTrim, "baseTrim"); + baseTrim_default = baseTrim; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js + function toNumber(value2) { + if (typeof value2 == "number") { + return value2; } + if (isSymbol_default(value2)) { + return NAN; + } + if (isObject_default(value2)) { + var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2; + value2 = isObject_default(other) ? other + "" : other; + } + if (typeof value2 != "string") { + return value2 === 0 ? value2 : +value2; + } + value2 = baseTrim_default(value2); + var isBinary2 = reIsBinary.test(value2); + return isBinary2 || reIsOctal.test(value2) ? freeParseInt(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex.test(value2) ? NAN : +value2; } - function edgeArgsToId(isDirected, v_, w_, name) { - var v = "" + v_; - var w2 = "" + w_; - if (!isDirected && v > w2) { - var tmp = v; - v = w2; - w2 = tmp; + var NAN, reIsBadHex, reIsBinary, reIsOctal, freeParseInt, toNumber_default; + var init_toNumber = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js"() { + "use strict"; + init_baseTrim(); + init_isObject(); + init_isSymbol(); + NAN = 0 / 0; + reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + reIsBinary = /^0b[01]+$/i; + reIsOctal = /^0o[0-7]+$/i; + freeParseInt = parseInt; + __name(toNumber, "toNumber"); + toNumber_default = toNumber; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toFinite.js + function toFinite(value2) { + if (!value2) { + return value2 === 0 ? value2 : 0; } - return v + EDGE_KEY_DELIM + w2 + EDGE_KEY_DELIM + (isUndefined(name) ? DEFAULT_EDGE_NAME : name); + value2 = toNumber_default(value2); + if (value2 === INFINITY2 || value2 === -INFINITY2) { + var sign2 = value2 < 0 ? -1 : 1; + return sign2 * MAX_INTEGER; + } + return value2 === value2 ? value2 : 0; } - function edgeArgsToObj(isDirected, v_, w_, name) { - var v = "" + v_; - var w2 = "" + w_; - if (!isDirected && v > w2) { - var tmp = v; - v = w2; - w2 = tmp; - } - var edgeObj = { v, w: w2 }; - if (name) { - edgeObj.name = name; + var INFINITY2, MAX_INTEGER, toFinite_default; + var init_toFinite = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toFinite.js"() { + "use strict"; + init_toNumber(); + INFINITY2 = 1 / 0; + MAX_INTEGER = 17976931348623157e292; + __name(toFinite, "toFinite"); + toFinite_default = toFinite; } - return edgeObj; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toInteger.js + function toInteger(value2) { + var result = toFinite_default(value2), remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; } - function edgeObjToId(isDirected, edgeObj) { - return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); + var toInteger_default; + var init_toInteger = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toInteger.js"() { + "use strict"; + init_toFinite(); + __name(toInteger, "toInteger"); + toInteger_default = toInteger; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js + var WeakMap, WeakMap_default; + var init_WeakMap = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js"() { + "use strict"; + init_getNative(); + init_root(); + WeakMap = getNative_default(root_default, "WeakMap"); + WeakMap_default = WeakMap; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js + function noop2() { } - class List { - constructor() { - var sentinel = {}; - sentinel._next = sentinel._prev = sentinel; - this._sentinel = sentinel; + var noop_default2; + var init_noop2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js"() { + "use strict"; + __name(noop2, "noop"); + noop_default2 = noop2; } - dequeue() { - var sentinel = this._sentinel; - var entry = sentinel._prev; - if (entry !== sentinel) { - unlink(entry); - return entry; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js + function arrayEach(array4, iteratee) { + var index = -1, length2 = array4 == null ? 0 : array4.length; + while (++index < length2) { + if (iteratee(array4[index], index, array4) === false) { + break; } } - enqueue(entry) { - var sentinel = this._sentinel; - if (entry._prev && entry._next) { - unlink(entry); - } - entry._next = sentinel._next; - sentinel._next._prev = entry; - sentinel._next = entry; - entry._prev = sentinel; + return array4; + } + var arrayEach_default; + var init_arrayEach = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js"() { + "use strict"; + __name(arrayEach, "arrayEach"); + arrayEach_default = arrayEach; } - toString() { - var strs = []; - var sentinel = this._sentinel; - var curr = sentinel._prev; - while (curr !== sentinel) { - strs.push(JSON.stringify(curr, filterOutLinks)); - curr = curr._prev; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js + function baseFindIndex(array4, predicate, fromIndex, fromRight) { + var length2 = array4.length, index = fromIndex + (fromRight ? 1 : -1); + while (fromRight ? index-- : ++index < length2) { + if (predicate(array4[index], index, array4)) { + return index; } - return "[" + strs.join(", ") + "]"; } + return -1; } - function unlink(entry) { - entry._prev._next = entry._next; - entry._next._prev = entry._prev; - delete entry._next; - delete entry._prev; - } - function filterOutLinks(k, v) { - if (k !== "_next" && k !== "_prev") { - return v; + var baseFindIndex_default; + var init_baseFindIndex = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js"() { + "use strict"; + __name(baseFindIndex, "baseFindIndex"); + baseFindIndex_default = baseFindIndex; } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js + function baseIsNaN(value2) { + return value2 !== value2; } - var DEFAULT_WEIGHT_FN = constant$2(1); - function greedyFAS(g, weightFn) { - if (g.nodeCount() <= 1) { - return []; + var baseIsNaN_default; + var init_baseIsNaN = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js"() { + "use strict"; + __name(baseIsNaN, "baseIsNaN"); + baseIsNaN_default = baseIsNaN; } - var state2 = buildState(g, weightFn || DEFAULT_WEIGHT_FN); - var results = doGreedyFAS(state2.graph, state2.buckets, state2.zeroIdx); - return flatten( - map(results, function(e) { - return g.outEdges(e.v, e.w); - }) - ); - } - function doGreedyFAS(g, buckets, zeroIdx) { - var results = []; - var sources = buckets[buckets.length - 1]; - var sinks = buckets[0]; - var entry; - while (g.nodeCount()) { - while (entry = sinks.dequeue()) { - removeNode(g, buckets, zeroIdx, entry); - } - while (entry = sources.dequeue()) { - removeNode(g, buckets, zeroIdx, entry); - } - if (g.nodeCount()) { - for (var i2 = buckets.length - 2; i2 > 0; --i2) { - entry = buckets[i2].dequeue(); - if (entry) { - results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); - break; - } - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js + function strictIndexOf(array4, value2, fromIndex) { + var index = fromIndex - 1, length2 = array4.length; + while (++index < length2) { + if (array4[index] === value2) { + return index; } } - return results; + return -1; } - function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { - var results = collectPredecessors ? [] : void 0; - forEach(g.inEdges(entry.v), function(edge) { - var weight = g.edge(edge); - var uEntry = g.node(edge.v); - if (collectPredecessors) { - results.push({ v: edge.v, w: edge.w }); + var strictIndexOf_default; + var init_strictIndexOf = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js"() { + "use strict"; + __name(strictIndexOf, "strictIndexOf"); + strictIndexOf_default = strictIndexOf; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js + function baseIndexOf(array4, value2, fromIndex) { + return value2 === value2 ? strictIndexOf_default(array4, value2, fromIndex) : baseFindIndex_default(array4, baseIsNaN_default, fromIndex); + } + var baseIndexOf_default; + var init_baseIndexOf = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js"() { + "use strict"; + init_baseFindIndex(); + init_baseIsNaN(); + init_strictIndexOf(); + __name(baseIndexOf, "baseIndexOf"); + baseIndexOf_default = baseIndexOf; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js + function arrayIncludes(array4, value2) { + var length2 = array4 == null ? 0 : array4.length; + return !!length2 && baseIndexOf_default(array4, value2, 0) > -1; + } + var arrayIncludes_default; + var init_arrayIncludes = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js"() { + "use strict"; + init_baseIndexOf(); + __name(arrayIncludes, "arrayIncludes"); + arrayIncludes_default = arrayIncludes; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js + var nativeKeys, nativeKeys_default; + var init_nativeKeys = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js"() { + "use strict"; + init_overArg(); + nativeKeys = overArg_default(Object.keys, Object); + nativeKeys_default = nativeKeys; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js + function baseKeys(object3) { + if (!isPrototype_default(object3)) { + return nativeKeys_default(object3); + } + var result = []; + for (var key in Object(object3)) { + if (hasOwnProperty10.call(object3, key) && key != "constructor") { + result.push(key); } - uEntry.out -= weight; - assignBucket(buckets, zeroIdx, uEntry); - }); - forEach(g.outEdges(entry.v), function(edge) { - var weight = g.edge(edge); - var w2 = edge.w; - var wEntry = g.node(w2); - wEntry["in"] -= weight; - assignBucket(buckets, zeroIdx, wEntry); - }); - g.removeNode(entry.v); - return results; - } - function buildState(g, weightFn) { - var fasGraph = new Graph(); - var maxIn = 0; - var maxOut = 0; - forEach(g.nodes(), function(v) { - fasGraph.setNode(v, { v, in: 0, out: 0 }); - }); - forEach(g.edges(), function(e) { - var prevWeight = fasGraph.edge(e.v, e.w) || 0; - var weight = weightFn(e); - var edgeWeight = prevWeight + weight; - fasGraph.setEdge(e.v, e.w, edgeWeight); - maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); - maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); - }); - var buckets = range$1(maxOut + maxIn + 3).map(function() { - return new List(); - }); - var zeroIdx = maxIn + 1; - forEach(fasGraph.nodes(), function(v) { - assignBucket(buckets, zeroIdx, fasGraph.node(v)); - }); - return { graph: fasGraph, buckets, zeroIdx }; - } - function assignBucket(buckets, zeroIdx, entry) { - if (!entry.out) { - buckets[0].enqueue(entry); - } else if (!entry["in"]) { - buckets[buckets.length - 1].enqueue(entry); - } else { - buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); } + return result; } - function run$2(g) { - var fas = g.graph().acyclicer === "greedy" ? greedyFAS(g, weightFn(g)) : dfsFAS(g); - forEach(fas, function(e) { - var label = g.edge(e); - g.removeEdge(e); - label.forwardName = e.name; - label.reversed = true; - g.setEdge(e.w, e.v, label, uniqueId("rev")); - }); - function weightFn(g2) { - return function(e) { - return g2.edge(e).weight; - }; + var objectProto12, hasOwnProperty10, baseKeys_default; + var init_baseKeys = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js"() { + "use strict"; + init_isPrototype(); + init_nativeKeys(); + objectProto12 = Object.prototype; + hasOwnProperty10 = objectProto12.hasOwnProperty; + __name(baseKeys, "baseKeys"); + baseKeys_default = baseKeys; } - } - function dfsFAS(g) { - var fas = []; - var stack = {}; - var visited = {}; - function dfs2(v) { - if (has(visited, v)) { - return; - } - visited[v] = true; - stack[v] = true; - forEach(g.outEdges(v), function(e) { - if (has(stack, e.w)) { - fas.push(e); - } else { - dfs2(e.w); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js + function keys(object3) { + return isArrayLike_default(object3) ? arrayLikeKeys_default(object3) : baseKeys_default(object3); + } + var keys_default; + var init_keys = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js"() { + "use strict"; + init_arrayLikeKeys(); + init_baseKeys(); + init_isArrayLike(); + __name(keys, "keys"); + keys_default = keys; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/assign.js + var objectProto13, hasOwnProperty11, assign, assign_default; + var init_assign = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/assign.js"() { + "use strict"; + init_assignValue(); + init_copyObject(); + init_createAssigner(); + init_isArrayLike(); + init_isPrototype(); + init_keys(); + objectProto13 = Object.prototype; + hasOwnProperty11 = objectProto13.hasOwnProperty; + assign = createAssigner_default(function(object3, source) { + if (isPrototype_default(source) || isArrayLike_default(source)) { + copyObject_default(source, keys_default(source), object3); + return; + } + for (var key in source) { + if (hasOwnProperty11.call(source, key)) { + assignValue_default(object3, key, source[key]); + } } }); - delete stack[v]; + assign_default = assign; } - forEach(g.nodes(), dfs2); - return fas; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js + function isKey(value2, object3) { + if (isArray_default(value2)) { + return false; + } + var type3 = typeof value2; + if (type3 == "number" || type3 == "symbol" || type3 == "boolean" || value2 == null || isSymbol_default(value2)) { + return true; + } + return reIsPlainProp.test(value2) || !reIsDeepProp.test(value2) || object3 != null && value2 in Object(object3); } - function undo$2(g) { - forEach(g.edges(), function(e) { - var label = g.edge(e); - if (label.reversed) { - g.removeEdge(e); - var forwardName = label.forwardName; - delete label.reversed; - delete label.forwardName; - g.setEdge(e.w, e.v, label, forwardName); + var reIsDeepProp, reIsPlainProp, isKey_default; + var init_isKey = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js"() { + "use strict"; + init_isArray(); + init_isSymbol(); + reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + reIsPlainProp = /^\w*$/; + __name(isKey, "isKey"); + isKey_default = isKey; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js + function memoizeCapped(func) { + var result = memoize_default(func, function(key) { + if (cache3.size === MAX_MEMOIZE_SIZE) { + cache3.clear(); } + return key; }); + var cache3 = result.cache; + return result; } - function addDummyNode(g, type2, attrs, name) { - var v; - do { - v = uniqueId(name); - } while (g.hasNode(v)); - attrs.dummy = type2; - g.setNode(v, attrs); - return v; - } - function simplify(g) { - var simplified = new Graph().setGraph(g.graph()); - forEach(g.nodes(), function(v) { - simplified.setNode(v, g.node(v)); - }); - forEach(g.edges(), function(e) { - var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }; - var label = g.edge(e); - simplified.setEdge(e.v, e.w, { - weight: simpleLabel.weight + label.weight, - minlen: Math.max(simpleLabel.minlen, label.minlen) + var MAX_MEMOIZE_SIZE, memoizeCapped_default; + var init_memoizeCapped = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js"() { + "use strict"; + init_memoize(); + MAX_MEMOIZE_SIZE = 500; + __name(memoizeCapped, "memoizeCapped"); + memoizeCapped_default = memoizeCapped; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js + var rePropName, reEscapeChar, stringToPath, stringToPath_default; + var init_stringToPath = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js"() { + "use strict"; + init_memoizeCapped(); + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + reEscapeChar = /\\(\\)?/g; + stringToPath = memoizeCapped_default(function(string3) { + var result = []; + if (string3.charCodeAt(0) === 46) { + result.push(""); + } + string3.replace(rePropName, function(match2, number7, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, "$1") : number7 || match2); + }); + return result; }); - }); - return simplified; - } - function asNonCompoundGraph(g) { - var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); - forEach(g.nodes(), function(v) { - if (!g.children(v).length) { - simplified.setNode(v, g.node(v)); - } - }); - forEach(g.edges(), function(e) { - simplified.setEdge(e, g.edge(e)); - }); - return simplified; - } - function intersectRect$3(rect2, point2) { - var x2 = rect2.x; - var y2 = rect2.y; - var dx = point2.x - x2; - var dy = point2.y - y2; - var w2 = rect2.width / 2; - var h = rect2.height / 2; - if (!dx && !dy) { - throw new Error("Not possible to find intersection inside of the rectangle"); + stringToPath_default = stringToPath; } - var sx, sy; - if (Math.abs(dy) * w2 > Math.abs(dx) * h) { - if (dy < 0) { - h = -h; - } - sx = h * dx / dy; - sy = h; - } else { - if (dx < 0) { - w2 = -w2; - } - sx = w2; - sy = w2 * dy / dx; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js + function toString(value2) { + return value2 == null ? "" : baseToString_default(value2); + } + var toString_default; + var init_toString = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js"() { + "use strict"; + init_baseToString(); + __name(toString, "toString"); + toString_default = toString; } - return { x: x2 + sx, y: y2 + sy }; - } - function buildLayerMatrix(g) { - var layering = map(range$1(maxRank(g) + 1), function() { - return []; - }); - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - var rank2 = node2.rank; - if (!isUndefined(rank2)) { - layering[rank2][node2.order] = v; - } - }); - return layering; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js + function castPath(value2, object3) { + if (isArray_default(value2)) { + return value2; + } + return isKey_default(value2, object3) ? [value2] : stringToPath_default(toString_default(value2)); } - function normalizeRanks(g) { - var min2 = min$1( - map(g.nodes(), function(v) { - return g.node(v).rank; - }) - ); - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - if (has(node2, "rank")) { - node2.rank -= min2; - } - }); + var castPath_default; + var init_castPath = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js"() { + "use strict"; + init_isArray(); + init_isKey(); + init_stringToPath(); + init_toString(); + __name(castPath, "castPath"); + castPath_default = castPath; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js + function toKey(value2) { + if (typeof value2 == "string" || isSymbol_default(value2)) { + return value2; + } + var result = value2 + ""; + return result == "0" && 1 / value2 == -INFINITY3 ? "-0" : result; } - function removeEmptyRanks(g) { - var offset = min$1( - map(g.nodes(), function(v) { - return g.node(v).rank; - }) - ); - var layers = []; - forEach(g.nodes(), function(v) { - var rank2 = g.node(v).rank - offset; - if (!layers[rank2]) { - layers[rank2] = []; - } - layers[rank2].push(v); - }); - var delta = 0; - var nodeRankFactor = g.graph().nodeRankFactor; - forEach(layers, function(vs, i2) { - if (isUndefined(vs) && i2 % nodeRankFactor !== 0) { - --delta; - } else if (delta) { - forEach(vs, function(v) { - g.node(v).rank += delta; - }); - } - }); + var INFINITY3, toKey_default; + var init_toKey = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js"() { + "use strict"; + init_isSymbol(); + INFINITY3 = 1 / 0; + __name(toKey, "toKey"); + toKey_default = toKey; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js + function baseGet(object3, path4) { + path4 = castPath_default(path4, object3); + var index = 0, length2 = path4.length; + while (object3 != null && index < length2) { + object3 = object3[toKey_default(path4[index++])]; + } + return index && index == length2 ? object3 : void 0; + } + var baseGet_default; + var init_baseGet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js"() { + "use strict"; + init_castPath(); + init_toKey(); + __name(baseGet, "baseGet"); + baseGet_default = baseGet; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js + function get3(object3, path4, defaultValue) { + var result = object3 == null ? void 0 : baseGet_default(object3, path4); + return result === void 0 ? defaultValue : result; } - function addBorderNode$1(g, prefix, rank2, order2) { - var node2 = { - width: 0, - height: 0 - }; - if (arguments.length >= 4) { - node2.rank = rank2; - node2.order = order2; + var get_default; + var init_get = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js"() { + "use strict"; + init_baseGet(); + __name(get3, "get"); + get_default = get3; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js + function arrayPush(array4, values2) { + var index = -1, length2 = values2.length, offset = array4.length; + while (++index < length2) { + array4[offset + index] = values2[index]; } - return addDummyNode(g, "border", node2, prefix); + return array4; } - function maxRank(g) { - return max$1( - map(g.nodes(), function(v) { - var rank2 = g.node(v).rank; - if (!isUndefined(rank2)) { - return rank2; + var arrayPush_default; + var init_arrayPush = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js"() { + "use strict"; + __name(arrayPush, "arrayPush"); + arrayPush_default = arrayPush; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js + function isFlattenable(value2) { + return isArray_default(value2) || isArguments_default(value2) || !!(spreadableSymbol && value2 && value2[spreadableSymbol]); + } + var spreadableSymbol, isFlattenable_default; + var init_isFlattenable = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js"() { + "use strict"; + init_Symbol(); + init_isArguments(); + init_isArray(); + spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0; + __name(isFlattenable, "isFlattenable"); + isFlattenable_default = isFlattenable; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js + function baseFlatten(array4, depth, predicate, isStrict, result) { + var index = -1, length2 = array4.length; + predicate || (predicate = isFlattenable_default); + result || (result = []); + while (++index < length2) { + var value2 = array4[index]; + if (depth > 0 && predicate(value2)) { + if (depth > 1) { + baseFlatten(value2, depth - 1, predicate, isStrict, result); + } else { + arrayPush_default(result, value2); } - }) - ); - } - function partition(collection, fn) { - var result = { lhs: [], rhs: [] }; - forEach(collection, function(value2) { - if (fn(value2)) { - result.lhs.push(value2); - } else { - result.rhs.push(value2); + } else if (!isStrict) { + result[result.length] = value2; } - }); + } return result; } - function time(name, fn) { - var start2 = now$1(); - try { - return fn(); - } finally { - console.log(name + " time: " + (now$1() - start2) + "ms"); + var baseFlatten_default; + var init_baseFlatten = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js"() { + "use strict"; + init_arrayPush(); + init_isFlattenable(); + __name(baseFlatten, "baseFlatten"); + baseFlatten_default = baseFlatten; } - } - function notime(name, fn) { - return fn(); - } - function addBorderSegments(g) { - function dfs2(v) { - var children2 = g.children(v); - var node2 = g.node(v); - if (children2.length) { - forEach(children2, dfs2); - } - if (has(node2, "minRank")) { - node2.borderLeft = []; - node2.borderRight = []; - for (var rank2 = node2.minRank, maxRank2 = node2.maxRank + 1; rank2 < maxRank2; ++rank2) { - addBorderNode(g, "borderLeft", "_bl", v, node2, rank2); - addBorderNode(g, "borderRight", "_br", v, node2, rank2); - } - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js + function flatten(array4) { + var length2 = array4 == null ? 0 : array4.length; + return length2 ? baseFlatten_default(array4, 1) : []; + } + var flatten_default; + var init_flatten = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js"() { + "use strict"; + init_baseFlatten(); + __name(flatten, "flatten"); + flatten_default = flatten; } - forEach(g.children(), dfs2); - } - function addBorderNode(g, prop, prefix, sg, sgNode, rank2) { - var label = { width: 0, height: 0, rank: rank2, borderType: prop }; - var prev2 = sgNode[prop][rank2 - 1]; - var curr = addDummyNode(g, "border", label, prefix); - sgNode[prop][rank2] = curr; - g.setParent(curr, sg); - if (prev2) { - g.setEdge(prev2, curr, { weight: 1 }); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js + function flatRest(func) { + return setToString_default(overRest_default(func, void 0, flatten_default), func + ""); + } + var flatRest_default; + var init_flatRest = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js"() { + "use strict"; + init_flatten(); + init_overRest(); + init_setToString(); + __name(flatRest, "flatRest"); + flatRest_default = flatRest; } - } - function adjust(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "lr" || rankDir === "rl") { - swapWidthHeight(g); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js + function baseSlice(array4, start3, end2) { + var index = -1, length2 = array4.length; + if (start3 < 0) { + start3 = -start3 > length2 ? 0 : length2 + start3; + } + end2 = end2 > length2 ? length2 : end2; + if (end2 < 0) { + end2 += length2; + } + length2 = start3 > end2 ? 0 : end2 - start3 >>> 0; + start3 >>>= 0; + var result = Array(length2); + while (++index < length2) { + result[index] = array4[index + start3]; } + return result; } - function undo$1(g) { - var rankDir = g.graph().rankdir.toLowerCase(); - if (rankDir === "bt" || rankDir === "rl") { - reverseY(g); + var baseSlice_default; + var init_baseSlice = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js"() { + "use strict"; + __name(baseSlice, "baseSlice"); + baseSlice_default = baseSlice; } - if (rankDir === "lr" || rankDir === "rl") { - swapXY(g); - swapWidthHeight(g); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js + function hasUnicode(string3) { + return reHasUnicode.test(string3); + } + var rsAstralRange, rsComboMarksRange, reComboHalfMarksRange, rsComboSymbolsRange, rsComboRange, rsVarRange, rsZWJ, reHasUnicode, hasUnicode_default; + var init_hasUnicode = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js"() { + "use strict"; + rsAstralRange = "\\ud800-\\udfff"; + rsComboMarksRange = "\\u0300-\\u036f"; + reComboHalfMarksRange = "\\ufe20-\\ufe2f"; + rsComboSymbolsRange = "\\u20d0-\\u20ff"; + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; + rsVarRange = "\\ufe0e\\ufe0f"; + rsZWJ = "\\u200d"; + reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); + __name(hasUnicode, "hasUnicode"); + hasUnicode_default = hasUnicode; } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js + function arrayReduce(array4, iteratee, accumulator, initAccum) { + var index = -1, length2 = array4 == null ? 0 : array4.length; + if (initAccum && length2) { + accumulator = array4[++index]; + } + while (++index < length2) { + accumulator = iteratee(accumulator, array4[index], index, array4); + } + return accumulator; } - function swapWidthHeight(g) { - forEach(g.nodes(), function(v) { - swapWidthHeightOne(g.node(v)); - }); - forEach(g.edges(), function(e) { - swapWidthHeightOne(g.edge(e)); - }); - } - function swapWidthHeightOne(attrs) { - var w2 = attrs.width; - attrs.width = attrs.height; - attrs.height = w2; - } - function reverseY(g) { - forEach(g.nodes(), function(v) { - reverseYOne(g.node(v)); - }); - forEach(g.edges(), function(e) { - var edge = g.edge(e); - forEach(edge.points, reverseYOne); - if (has(edge, "y")) { - reverseYOne(edge); + var arrayReduce_default; + var init_arrayReduce = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js"() { + "use strict"; + __name(arrayReduce, "arrayReduce"); + arrayReduce_default = arrayReduce; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js + function baseAssign(object3, source) { + return object3 && copyObject_default(source, keys_default(source), object3); + } + var baseAssign_default; + var init_baseAssign = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js"() { + "use strict"; + init_copyObject(); + init_keys(); + __name(baseAssign, "baseAssign"); + baseAssign_default = baseAssign; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js + function baseAssignIn(object3, source) { + return object3 && copyObject_default(source, keysIn_default(source), object3); + } + var baseAssignIn_default; + var init_baseAssignIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js"() { + "use strict"; + init_copyObject(); + init_keysIn(); + __name(baseAssignIn, "baseAssignIn"); + baseAssignIn_default = baseAssignIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js + function arrayFilter(array4, predicate) { + var index = -1, length2 = array4 == null ? 0 : array4.length, resIndex = 0, result = []; + while (++index < length2) { + var value2 = array4[index]; + if (predicate(value2, index, array4)) { + result[resIndex++] = value2; } - }); + } + return result; } - function reverseYOne(attrs) { - attrs.y = -attrs.y; + var arrayFilter_default; + var init_arrayFilter = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js"() { + "use strict"; + __name(arrayFilter, "arrayFilter"); + arrayFilter_default = arrayFilter; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js + function stubArray() { + return []; } - function swapXY(g) { - forEach(g.nodes(), function(v) { - swapXYOne(g.node(v)); - }); - forEach(g.edges(), function(e) { - var edge = g.edge(e); - forEach(edge.points, swapXYOne); - if (has(edge, "x")) { - swapXYOne(edge); + var stubArray_default; + var init_stubArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js"() { + "use strict"; + __name(stubArray, "stubArray"); + stubArray_default = stubArray; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js + var objectProto14, propertyIsEnumerable2, nativeGetSymbols, getSymbols, getSymbols_default; + var init_getSymbols = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js"() { + "use strict"; + init_arrayFilter(); + init_stubArray(); + objectProto14 = Object.prototype; + propertyIsEnumerable2 = objectProto14.propertyIsEnumerable; + nativeGetSymbols = Object.getOwnPropertySymbols; + getSymbols = !nativeGetSymbols ? stubArray_default : function(object3) { + if (object3 == null) { + return []; + } + object3 = Object(object3); + return arrayFilter_default(nativeGetSymbols(object3), function(symbol) { + return propertyIsEnumerable2.call(object3, symbol); + }); + }; + getSymbols_default = getSymbols; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js + function copySymbols(source, object3) { + return copyObject_default(source, getSymbols_default(source), object3); + } + var copySymbols_default; + var init_copySymbols = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js"() { + "use strict"; + init_copyObject(); + init_getSymbols(); + __name(copySymbols, "copySymbols"); + copySymbols_default = copySymbols; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js + var nativeGetSymbols2, getSymbolsIn, getSymbolsIn_default; + var init_getSymbolsIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js"() { + "use strict"; + init_arrayPush(); + init_getPrototype(); + init_getSymbols(); + init_stubArray(); + nativeGetSymbols2 = Object.getOwnPropertySymbols; + getSymbolsIn = !nativeGetSymbols2 ? stubArray_default : function(object3) { + var result = []; + while (object3) { + arrayPush_default(result, getSymbols_default(object3)); + object3 = getPrototype_default(object3); + } + return result; + }; + getSymbolsIn_default = getSymbolsIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js + function copySymbolsIn(source, object3) { + return copyObject_default(source, getSymbolsIn_default(source), object3); + } + var copySymbolsIn_default; + var init_copySymbolsIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js"() { + "use strict"; + init_copyObject(); + init_getSymbolsIn(); + __name(copySymbolsIn, "copySymbolsIn"); + copySymbolsIn_default = copySymbolsIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js + function baseGetAllKeys(object3, keysFunc, symbolsFunc) { + var result = keysFunc(object3); + return isArray_default(object3) ? result : arrayPush_default(result, symbolsFunc(object3)); + } + var baseGetAllKeys_default; + var init_baseGetAllKeys = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js"() { + "use strict"; + init_arrayPush(); + init_isArray(); + __name(baseGetAllKeys, "baseGetAllKeys"); + baseGetAllKeys_default = baseGetAllKeys; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js + function getAllKeys(object3) { + return baseGetAllKeys_default(object3, keys_default, getSymbols_default); + } + var getAllKeys_default; + var init_getAllKeys = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js"() { + "use strict"; + init_baseGetAllKeys(); + init_getSymbols(); + init_keys(); + __name(getAllKeys, "getAllKeys"); + getAllKeys_default = getAllKeys; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js + function getAllKeysIn(object3) { + return baseGetAllKeys_default(object3, keysIn_default, getSymbolsIn_default); + } + var getAllKeysIn_default; + var init_getAllKeysIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js"() { + "use strict"; + init_baseGetAllKeys(); + init_getSymbolsIn(); + init_keysIn(); + __name(getAllKeysIn, "getAllKeysIn"); + getAllKeysIn_default = getAllKeysIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js + var DataView2, DataView_default; + var init_DataView = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js"() { + "use strict"; + init_getNative(); + init_root(); + DataView2 = getNative_default(root_default, "DataView"); + DataView_default = DataView2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js + var Promise2, Promise_default; + var init_Promise = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js"() { + "use strict"; + init_getNative(); + init_root(); + Promise2 = getNative_default(root_default, "Promise"); + Promise_default = Promise2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js + var Set2, Set_default; + var init_Set = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js"() { + "use strict"; + init_getNative(); + init_root(); + Set2 = getNative_default(root_default, "Set"); + Set_default = Set2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js + var mapTag2, objectTag3, promiseTag, setTag2, weakMapTag2, dataViewTag2, dataViewCtorString, mapCtorString, promiseCtorString, setCtorString, weakMapCtorString, getTag, getTag_default; + var init_getTag = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js"() { + "use strict"; + init_DataView(); + init_Map(); + init_Promise(); + init_Set(); + init_WeakMap(); + init_baseGetTag(); + init_toSource(); + mapTag2 = "[object Map]"; + objectTag3 = "[object Object]"; + promiseTag = "[object Promise]"; + setTag2 = "[object Set]"; + weakMapTag2 = "[object WeakMap]"; + dataViewTag2 = "[object DataView]"; + dataViewCtorString = toSource_default(DataView_default); + mapCtorString = toSource_default(Map_default); + promiseCtorString = toSource_default(Promise_default); + setCtorString = toSource_default(Set_default); + weakMapCtorString = toSource_default(WeakMap_default); + getTag = baseGetTag_default; + if (DataView_default && getTag(new DataView_default(new ArrayBuffer(1))) != dataViewTag2 || Map_default && getTag(new Map_default()) != mapTag2 || Promise_default && getTag(Promise_default.resolve()) != promiseTag || Set_default && getTag(new Set_default()) != setTag2 || WeakMap_default && getTag(new WeakMap_default()) != weakMapTag2) { + getTag = /* @__PURE__ */ __name(function(value2) { + var result = baseGetTag_default(value2), Ctor = result == objectTag3 ? value2.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : ""; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag2; + case mapCtorString: + return mapTag2; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag2; + case weakMapCtorString: + return weakMapTag2; + } + } + return result; + }, "getTag"); } - }); + getTag_default = getTag; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js + function initCloneArray(array4) { + var length2 = array4.length, result = new array4.constructor(length2); + if (length2 && typeof array4[0] == "string" && hasOwnProperty12.call(array4, "index")) { + result.index = array4.index; + result.input = array4.input; + } + return result; } - function swapXYOne(attrs) { - var x2 = attrs.x; - attrs.x = attrs.y; - attrs.y = x2; + var objectProto15, hasOwnProperty12, initCloneArray_default; + var init_initCloneArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js"() { + "use strict"; + objectProto15 = Object.prototype; + hasOwnProperty12 = objectProto15.hasOwnProperty; + __name(initCloneArray, "initCloneArray"); + initCloneArray_default = initCloneArray; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer_default(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } - function run$1(g) { - g.graph().dummyChains = []; - forEach(g.edges(), function(edge) { - normalizeEdge(g, edge); - }); + var cloneDataView_default; + var init_cloneDataView = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js"() { + "use strict"; + init_cloneArrayBuffer(); + __name(cloneDataView, "cloneDataView"); + cloneDataView_default = cloneDataView; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; } - function normalizeEdge(g, e) { - var v = e.v; - var vRank = g.node(v).rank; - var w2 = e.w; - var wRank = g.node(w2).rank; - var name = e.name; - var edgeLabel = g.edge(e); - var labelRank = edgeLabel.labelRank; - if (wRank === vRank + 1) - return; - g.removeEdge(e); - var dummy, attrs, i2; - for (i2 = 0, ++vRank; vRank < wRank; ++i2, ++vRank) { - edgeLabel.points = []; - attrs = { - width: 0, - height: 0, - edgeLabel, - edgeObj: e, - rank: vRank - }; - dummy = addDummyNode(g, "edge", attrs, "_d"); - if (vRank === labelRank) { - attrs.width = edgeLabel.width; - attrs.height = edgeLabel.height; - attrs.dummy = "edge-label"; - attrs.labelpos = edgeLabel.labelpos; + var reFlags, cloneRegExp_default; + var init_cloneRegExp = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js"() { + "use strict"; + reFlags = /\w*$/; + __name(cloneRegExp, "cloneRegExp"); + cloneRegExp_default = cloneRegExp; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + var symbolProto2, symbolValueOf, cloneSymbol_default; + var init_cloneSymbol = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js"() { + "use strict"; + init_Symbol(); + symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0; + symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0; + __name(cloneSymbol, "cloneSymbol"); + cloneSymbol_default = cloneSymbol; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js + function initCloneByTag(object3, tag2, isDeep) { + var Ctor = object3.constructor; + switch (tag2) { + case arrayBufferTag2: + return cloneArrayBuffer_default(object3); + case boolTag2: + case dateTag2: + return new Ctor(+object3); + case dataViewTag3: + return cloneDataView_default(object3, isDeep); + case float32Tag2: + case float64Tag2: + case int8Tag2: + case int16Tag2: + case int32Tag2: + case uint8Tag2: + case uint8ClampedTag2: + case uint16Tag2: + case uint32Tag2: + return cloneTypedArray_default(object3, isDeep); + case mapTag3: + return new Ctor(); + case numberTag2: + case stringTag2: + return new Ctor(object3); + case regexpTag2: + return cloneRegExp_default(object3); + case setTag3: + return new Ctor(); + case symbolTag2: + return cloneSymbol_default(object3); + } + } + var boolTag2, dateTag2, mapTag3, numberTag2, regexpTag2, setTag3, stringTag2, symbolTag2, arrayBufferTag2, dataViewTag3, float32Tag2, float64Tag2, int8Tag2, int16Tag2, int32Tag2, uint8Tag2, uint8ClampedTag2, uint16Tag2, uint32Tag2, initCloneByTag_default; + var init_initCloneByTag = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js"() { + "use strict"; + init_cloneArrayBuffer(); + init_cloneDataView(); + init_cloneRegExp(); + init_cloneSymbol(); + init_cloneTypedArray(); + boolTag2 = "[object Boolean]"; + dateTag2 = "[object Date]"; + mapTag3 = "[object Map]"; + numberTag2 = "[object Number]"; + regexpTag2 = "[object RegExp]"; + setTag3 = "[object Set]"; + stringTag2 = "[object String]"; + symbolTag2 = "[object Symbol]"; + arrayBufferTag2 = "[object ArrayBuffer]"; + dataViewTag3 = "[object DataView]"; + float32Tag2 = "[object Float32Array]"; + float64Tag2 = "[object Float64Array]"; + int8Tag2 = "[object Int8Array]"; + int16Tag2 = "[object Int16Array]"; + int32Tag2 = "[object Int32Array]"; + uint8Tag2 = "[object Uint8Array]"; + uint8ClampedTag2 = "[object Uint8ClampedArray]"; + uint16Tag2 = "[object Uint16Array]"; + uint32Tag2 = "[object Uint32Array]"; + __name(initCloneByTag, "initCloneByTag"); + initCloneByTag_default = initCloneByTag; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js + function baseIsMap(value2) { + return isObjectLike_default(value2) && getTag_default(value2) == mapTag4; + } + var mapTag4, baseIsMap_default; + var init_baseIsMap = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js"() { + "use strict"; + init_getTag(); + init_isObjectLike(); + mapTag4 = "[object Map]"; + __name(baseIsMap, "baseIsMap"); + baseIsMap_default = baseIsMap; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js + var nodeIsMap, isMap, isMap_default; + var init_isMap = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js"() { + "use strict"; + init_baseIsMap(); + init_baseUnary(); + init_nodeUtil(); + nodeIsMap = nodeUtil_default && nodeUtil_default.isMap; + isMap = nodeIsMap ? baseUnary_default(nodeIsMap) : baseIsMap_default; + isMap_default = isMap; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js + function baseIsSet(value2) { + return isObjectLike_default(value2) && getTag_default(value2) == setTag4; + } + var setTag4, baseIsSet_default; + var init_baseIsSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js"() { + "use strict"; + init_getTag(); + init_isObjectLike(); + setTag4 = "[object Set]"; + __name(baseIsSet, "baseIsSet"); + baseIsSet_default = baseIsSet; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js + var nodeIsSet, isSet, isSet_default; + var init_isSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js"() { + "use strict"; + init_baseIsSet(); + init_baseUnary(); + init_nodeUtil(); + nodeIsSet = nodeUtil_default && nodeUtil_default.isSet; + isSet = nodeIsSet ? baseUnary_default(nodeIsSet) : baseIsSet_default; + isSet_default = isSet; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js + function baseClone(value2, bitmask, customizer, key, object3, stack) { + var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; + if (customizer) { + result = object3 ? customizer(value2, key, object3, stack) : customizer(value2); + } + if (result !== void 0) { + return result; + } + if (!isObject_default(value2)) { + return value2; + } + var isArr = isArray_default(value2); + if (isArr) { + result = initCloneArray_default(value2); + if (!isDeep) { + return copyArray_default(value2, result); } - g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); - if (i2 === 0) { - g.graph().dummyChains.push(dummy); + } else { + var tag2 = getTag_default(value2), isFunc = tag2 == funcTag3 || tag2 == genTag2; + if (isBuffer_default(value2)) { + return cloneBuffer_default(value2, isDeep); } - v = dummy; - } - g.setEdge(v, w2, { weight: edgeLabel.weight }, name); - } - function undo(g) { - forEach(g.graph().dummyChains, function(v) { - var node2 = g.node(v); - var origLabel = node2.edgeLabel; - var w2; - g.setEdge(node2.edgeObj, origLabel); - while (node2.dummy) { - w2 = g.successors(v)[0]; - g.removeNode(v); - origLabel.points.push({ x: node2.x, y: node2.y }); - if (node2.dummy === "edge-label") { - origLabel.x = node2.x; - origLabel.y = node2.y; - origLabel.width = node2.width; - origLabel.height = node2.height; + if (tag2 == objectTag4 || tag2 == argsTag3 || isFunc && !object3) { + result = isFlat || isFunc ? {} : initCloneObject_default(value2); + if (!isDeep) { + return isFlat ? copySymbolsIn_default(value2, baseAssignIn_default(result, value2)) : copySymbols_default(value2, baseAssign_default(result, value2)); } - v = w2; - node2 = g.node(v); + } else { + if (!cloneableTags[tag2]) { + return object3 ? value2 : {}; + } + result = initCloneByTag_default(value2, tag2, isDeep); + } + } + stack || (stack = new Stack_default()); + var stacked = stack.get(value2); + if (stacked) { + return stacked; + } + stack.set(value2, result); + if (isSet_default(value2)) { + value2.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value2, stack)); + }); + } else if (isMap_default(value2)) { + value2.forEach(function(subValue, key2) { + result.set(key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); + }); + } + var keysFunc = isFull ? isFlat ? getAllKeysIn_default : getAllKeys_default : isFlat ? keysIn_default : keys_default; + var props = isArr ? void 0 : keysFunc(value2); + arrayEach_default(props || value2, function(subValue, key2) { + if (props) { + key2 = subValue; + subValue = value2[key2]; } + assignValue_default(result, key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); }); + return result; } - function longestPath(g) { - var visited = {}; - function dfs2(v) { - var label = g.node(v); - if (has(visited, v)) { - return label.rank; - } - visited[v] = true; - var rank2 = min$1( - map(g.outEdges(v), function(e) { - return dfs2(e.w) - g.edge(e).minlen; - }) - ); - if (rank2 === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3 - rank2 === void 0 || // return value of _.map([]) for Lodash 4 - rank2 === null) { - rank2 = 0; + var CLONE_DEEP_FLAG, CLONE_FLAT_FLAG, CLONE_SYMBOLS_FLAG, argsTag3, arrayTag2, boolTag3, dateTag3, errorTag2, funcTag3, genTag2, mapTag5, numberTag3, objectTag4, regexpTag3, setTag5, stringTag3, symbolTag3, weakMapTag3, arrayBufferTag3, dataViewTag4, float32Tag3, float64Tag3, int8Tag3, int16Tag3, int32Tag3, uint8Tag3, uint8ClampedTag3, uint16Tag3, uint32Tag3, cloneableTags, baseClone_default; + var init_baseClone = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js"() { + "use strict"; + init_Stack(); + init_arrayEach(); + init_assignValue(); + init_baseAssign(); + init_baseAssignIn(); + init_cloneBuffer(); + init_copyArray(); + init_copySymbols(); + init_copySymbolsIn(); + init_getAllKeys(); + init_getAllKeysIn(); + init_getTag(); + init_initCloneArray(); + init_initCloneByTag(); + init_initCloneObject(); + init_isArray(); + init_isBuffer(); + init_isMap(); + init_isObject(); + init_isSet(); + init_keys(); + init_keysIn(); + CLONE_DEEP_FLAG = 1; + CLONE_FLAT_FLAG = 2; + CLONE_SYMBOLS_FLAG = 4; + argsTag3 = "[object Arguments]"; + arrayTag2 = "[object Array]"; + boolTag3 = "[object Boolean]"; + dateTag3 = "[object Date]"; + errorTag2 = "[object Error]"; + funcTag3 = "[object Function]"; + genTag2 = "[object GeneratorFunction]"; + mapTag5 = "[object Map]"; + numberTag3 = "[object Number]"; + objectTag4 = "[object Object]"; + regexpTag3 = "[object RegExp]"; + setTag5 = "[object Set]"; + stringTag3 = "[object String]"; + symbolTag3 = "[object Symbol]"; + weakMapTag3 = "[object WeakMap]"; + arrayBufferTag3 = "[object ArrayBuffer]"; + dataViewTag4 = "[object DataView]"; + float32Tag3 = "[object Float32Array]"; + float64Tag3 = "[object Float64Array]"; + int8Tag3 = "[object Int8Array]"; + int16Tag3 = "[object Int16Array]"; + int32Tag3 = "[object Int32Array]"; + uint8Tag3 = "[object Uint8Array]"; + uint8ClampedTag3 = "[object Uint8ClampedArray]"; + uint16Tag3 = "[object Uint16Array]"; + uint32Tag3 = "[object Uint32Array]"; + cloneableTags = {}; + cloneableTags[argsTag3] = cloneableTags[arrayTag2] = cloneableTags[arrayBufferTag3] = cloneableTags[dataViewTag4] = cloneableTags[boolTag3] = cloneableTags[dateTag3] = cloneableTags[float32Tag3] = cloneableTags[float64Tag3] = cloneableTags[int8Tag3] = cloneableTags[int16Tag3] = cloneableTags[int32Tag3] = cloneableTags[mapTag5] = cloneableTags[numberTag3] = cloneableTags[objectTag4] = cloneableTags[regexpTag3] = cloneableTags[setTag5] = cloneableTags[stringTag3] = cloneableTags[symbolTag3] = cloneableTags[uint8Tag3] = cloneableTags[uint8ClampedTag3] = cloneableTags[uint16Tag3] = cloneableTags[uint32Tag3] = true; + cloneableTags[errorTag2] = cloneableTags[funcTag3] = cloneableTags[weakMapTag3] = false; + __name(baseClone, "baseClone"); + baseClone_default = baseClone; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/clone.js + function clone(value2) { + return baseClone_default(value2, CLONE_SYMBOLS_FLAG2); + } + var CLONE_SYMBOLS_FLAG2, clone_default2; + var init_clone2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/clone.js"() { + "use strict"; + init_baseClone(); + CLONE_SYMBOLS_FLAG2 = 4; + __name(clone, "clone"); + clone_default2 = clone; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js + function cloneDeep(value2) { + return baseClone_default(value2, CLONE_DEEP_FLAG2 | CLONE_SYMBOLS_FLAG3); + } + var CLONE_DEEP_FLAG2, CLONE_SYMBOLS_FLAG3, cloneDeep_default; + var init_cloneDeep = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js"() { + "use strict"; + init_baseClone(); + CLONE_DEEP_FLAG2 = 1; + CLONE_SYMBOLS_FLAG3 = 4; + __name(cloneDeep, "cloneDeep"); + cloneDeep_default = cloneDeep; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/compact.js + function compact(array4) { + var index = -1, length2 = array4 == null ? 0 : array4.length, resIndex = 0, result = []; + while (++index < length2) { + var value2 = array4[index]; + if (value2) { + result[resIndex++] = value2; } - return label.rank = rank2; } - forEach(g.sources(), dfs2); + return result; } - function slack(g, e) { - return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; + var compact_default; + var init_compact = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/compact.js"() { + "use strict"; + __name(compact, "compact"); + compact_default = compact; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js + function setCacheAdd(value2) { + this.__data__.set(value2, HASH_UNDEFINED3); + return this; } - function feasibleTree(g) { - var t = new Graph({ directed: false }); - var start2 = g.nodes()[0]; - var size2 = g.nodeCount(); - t.setNode(start2, {}); - var edge, delta; - while (tightTree(t, g) < size2) { - edge = findMinSlackEdge(t, g); - delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); - shiftRanks(t, g, delta); - } - return t; - } - function tightTree(t, g) { - function dfs2(v) { - forEach(g.nodeEdges(v), function(e) { - var edgeV = e.v, w2 = v === edgeV ? e.w : edgeV; - if (!t.hasNode(w2) && !slack(g, e)) { - t.setNode(w2, {}); - t.setEdge(v, w2, {}); - dfs2(w2); - } - }); + var HASH_UNDEFINED3, setCacheAdd_default; + var init_setCacheAdd = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js"() { + "use strict"; + HASH_UNDEFINED3 = "__lodash_hash_undefined__"; + __name(setCacheAdd, "setCacheAdd"); + setCacheAdd_default = setCacheAdd; } - forEach(t.nodes(), dfs2); - return t.nodeCount(); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js + function setCacheHas(value2) { + return this.__data__.has(value2); } - function findMinSlackEdge(t, g) { - return minBy(g.edges(), function(e) { - if (t.hasNode(e.v) !== t.hasNode(e.w)) { - return slack(g, e); + var setCacheHas_default; + var init_setCacheHas = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js"() { + "use strict"; + __name(setCacheHas, "setCacheHas"); + setCacheHas_default = setCacheHas; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js + function SetCache(values2) { + var index = -1, length2 = values2 == null ? 0 : values2.length; + this.__data__ = new MapCache_default(); + while (++index < length2) { + this.add(values2[index]); + } + } + var SetCache_default; + var init_SetCache = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js"() { + "use strict"; + init_MapCache(); + init_setCacheAdd(); + init_setCacheHas(); + __name(SetCache, "SetCache"); + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd_default; + SetCache.prototype.has = setCacheHas_default; + SetCache_default = SetCache; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js + function arraySome(array4, predicate) { + var index = -1, length2 = array4 == null ? 0 : array4.length; + while (++index < length2) { + if (predicate(array4[index], index, array4)) { + return true; } - }); - } - function shiftRanks(t, g, delta) { - forEach(t.nodes(), function(v) { - g.node(v).rank += delta; - }); + } + return false; } - function CycleException() { + var arraySome_default; + var init_arraySome = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js"() { + "use strict"; + __name(arraySome, "arraySome"); + arraySome_default = arraySome; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js + function cacheHas(cache3, key) { + return cache3.has(key); } - CycleException.prototype = new Error(); - function dfs$1(g, vs, order2) { - if (!isArray$1(vs)) { - vs = [vs]; + var cacheHas_default; + var init_cacheHas = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js"() { + "use strict"; + __name(cacheHas, "cacheHas"); + cacheHas_default = cacheHas; } - var navigation = (g.isDirected() ? g.successors : g.neighbors).bind(g); - var acc = []; - var visited = {}; - forEach(vs, function(v) { - if (!g.hasNode(v)) { - throw new Error("Graph does not have node: " + v); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js + function equalArrays(array4, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array4.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var arrStacked = stack.get(array4); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array4; + } + var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache_default() : void 0; + stack.set(array4, other); + stack.set(other, array4); + while (++index < arrLength) { + var arrValue = array4[index], othValue = other[index]; + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array4, stack) : customizer(arrValue, othValue, index, array4, other, stack); } - doDfs(g, v, order2 === "post", visited, navigation, acc); - }); - return acc; - } - function doDfs(g, v, postorder2, visited, navigation, acc) { - if (!has(visited, v)) { - visited[v] = true; - if (!postorder2) { - acc.push(v); + if (compared !== void 0) { + if (compared) { + continue; + } + result = false; + break; } - forEach(navigation(v), function(w2) { - doDfs(g, w2, postorder2, visited, navigation, acc); - }); - if (postorder2) { - acc.push(v); + if (seen) { + if (!arraySome_default(other, function(othValue2, othIndex) { + if (!cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + result = false; + break; } } + stack["delete"](array4); + stack["delete"](other); + return result; } - function postorder$1(g, vs) { - return dfs$1(g, vs, "post"); - } - function preorder(g, vs) { - return dfs$1(g, vs, "pre"); - } - networkSimplex.initLowLimValues = initLowLimValues; - networkSimplex.initCutValues = initCutValues; - networkSimplex.calcCutValue = calcCutValue; - networkSimplex.leaveEdge = leaveEdge; - networkSimplex.enterEdge = enterEdge; - networkSimplex.exchangeEdges = exchangeEdges; - function networkSimplex(g) { - g = simplify(g); - longestPath(g); - var t = feasibleTree(g); - initLowLimValues(t); - initCutValues(t, g); - var e, f2; - while (e = leaveEdge(t)) { - f2 = enterEdge(t, g, e); - exchangeEdges(t, g, e, f2); + var COMPARE_PARTIAL_FLAG, COMPARE_UNORDERED_FLAG, equalArrays_default; + var init_equalArrays = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js"() { + "use strict"; + init_SetCache(); + init_arraySome(); + init_cacheHas(); + COMPARE_PARTIAL_FLAG = 1; + COMPARE_UNORDERED_FLAG = 2; + __name(equalArrays, "equalArrays"); + equalArrays_default = equalArrays; } - } - function initCutValues(t, g) { - var vs = postorder$1(t, t.nodes()); - vs = vs.slice(0, vs.length - 1); - forEach(vs, function(v) { - assignCutValue(t, g, v); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js + function mapToArray(map5) { + var index = -1, result = Array(map5.size); + map5.forEach(function(value2, key) { + result[++index] = [key, value2]; }); + return result; } - function assignCutValue(t, g, child) { - var childLab = t.node(child); - var parent = childLab.parent; - t.edge(child, parent).cutvalue = calcCutValue(t, g, child); + var mapToArray_default; + var init_mapToArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js"() { + "use strict"; + __name(mapToArray, "mapToArray"); + mapToArray_default = mapToArray; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js + function setToArray(set6) { + var index = -1, result = Array(set6.size); + set6.forEach(function(value2) { + result[++index] = value2; + }); + return result; } - function calcCutValue(t, g, child) { - var childLab = t.node(child); - var parent = childLab.parent; - var childIsTail = true; - var graphEdge = g.edge(child, parent); - var cutValue = 0; - if (!graphEdge) { - childIsTail = false; - graphEdge = g.edge(parent, child); + var setToArray_default; + var init_setToArray = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js"() { + "use strict"; + __name(setToArray, "setToArray"); + setToArray_default = setToArray; } - cutValue = graphEdge.weight; - forEach(g.nodeEdges(child), function(e) { - var isOutEdge = e.v === child, other = isOutEdge ? e.w : e.v; - if (other !== parent) { - var pointsToHead = isOutEdge === childIsTail, otherWeight = g.edge(e).weight; - cutValue += pointsToHead ? otherWeight : -otherWeight; - if (isTreeEdge(t, child, other)) { - var otherCutValue = t.edge(child, other).cutvalue; - cutValue += pointsToHead ? -otherCutValue : otherCutValue; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js + function equalByTag(object3, other, tag2, bitmask, customizer, equalFunc, stack) { + switch (tag2) { + case dataViewTag5: + if (object3.byteLength != other.byteLength || object3.byteOffset != other.byteOffset) { + return false; } + object3 = object3.buffer; + other = other.buffer; + case arrayBufferTag4: + if (object3.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object3), new Uint8Array_default(other))) { + return false; + } + return true; + case boolTag4: + case dateTag4: + case numberTag4: + return eq_default(+object3, +other); + case errorTag3: + return object3.name == other.name && object3.message == other.message; + case regexpTag4: + case stringTag4: + return object3 == other + ""; + case mapTag6: + var convert = mapToArray_default; + case setTag6: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG2; + convert || (convert = setToArray_default); + if (object3.size != other.size && !isPartial) { + return false; + } + var stacked = stack.get(object3); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG2; + stack.set(object3, other); + var result = equalArrays_default(convert(object3), convert(other), bitmask, customizer, equalFunc, stack); + stack["delete"](object3); + return result; + case symbolTag4: + if (symbolValueOf2) { + return symbolValueOf2.call(object3) == symbolValueOf2.call(other); + } + } + return false; + } + var COMPARE_PARTIAL_FLAG2, COMPARE_UNORDERED_FLAG2, boolTag4, dateTag4, errorTag3, mapTag6, numberTag4, regexpTag4, setTag6, stringTag4, symbolTag4, arrayBufferTag4, dataViewTag5, symbolProto3, symbolValueOf2, equalByTag_default; + var init_equalByTag = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js"() { + "use strict"; + init_Symbol(); + init_Uint8Array(); + init_eq(); + init_equalArrays(); + init_mapToArray(); + init_setToArray(); + COMPARE_PARTIAL_FLAG2 = 1; + COMPARE_UNORDERED_FLAG2 = 2; + boolTag4 = "[object Boolean]"; + dateTag4 = "[object Date]"; + errorTag3 = "[object Error]"; + mapTag6 = "[object Map]"; + numberTag4 = "[object Number]"; + regexpTag4 = "[object RegExp]"; + setTag6 = "[object Set]"; + stringTag4 = "[object String]"; + symbolTag4 = "[object Symbol]"; + arrayBufferTag4 = "[object ArrayBuffer]"; + dataViewTag5 = "[object DataView]"; + symbolProto3 = Symbol_default ? Symbol_default.prototype : void 0; + symbolValueOf2 = symbolProto3 ? symbolProto3.valueOf : void 0; + __name(equalByTag, "equalByTag"); + equalByTag_default = equalByTag; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js + function equalObjects(object3, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object3), objLength = objProps.length, othProps = getAllKeys_default(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty13.call(other, key))) { + return false; } - }); - return cutValue; + } + var objStacked = stack.get(object3); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object3; + } + var result = true; + stack.set(object3, other); + stack.set(other, object3); + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object3[key], othValue = other[key]; + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object3, stack) : customizer(objValue, othValue, key, object3, other, stack); + } + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { + result = false; + break; + } + skipCtor || (skipCtor = key == "constructor"); + } + if (result && !skipCtor) { + var objCtor = object3.constructor, othCtor = other.constructor; + if (objCtor != othCtor && ("constructor" in object3 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { + result = false; + } + } + stack["delete"](object3); + stack["delete"](other); + return result; } - function initLowLimValues(tree, root2) { - if (arguments.length < 2) { - root2 = tree.nodes()[0]; + var COMPARE_PARTIAL_FLAG3, objectProto16, hasOwnProperty13, equalObjects_default; + var init_equalObjects = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js"() { + "use strict"; + init_getAllKeys(); + COMPARE_PARTIAL_FLAG3 = 1; + objectProto16 = Object.prototype; + hasOwnProperty13 = objectProto16.hasOwnProperty; + __name(equalObjects, "equalObjects"); + equalObjects_default = equalObjects; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js + function baseIsEqualDeep(object3, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray_default(object3), othIsArr = isArray_default(other), objTag = objIsArr ? arrayTag3 : getTag_default(object3), othTag = othIsArr ? arrayTag3 : getTag_default(other); + objTag = objTag == argsTag4 ? objectTag5 : objTag; + othTag = othTag == argsTag4 ? objectTag5 : othTag; + var objIsObj = objTag == objectTag5, othIsObj = othTag == objectTag5, isSameTag = objTag == othTag; + if (isSameTag && isBuffer_default(object3)) { + if (!isBuffer_default(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack_default()); + return objIsArr || isTypedArray_default(object3) ? equalArrays_default(object3, other, bitmask, customizer, equalFunc, stack) : equalByTag_default(object3, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG4)) { + var objIsWrapped = objIsObj && hasOwnProperty14.call(object3, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty14.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object3.value() : object3, othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack_default()); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack_default()); + return equalObjects_default(object3, other, bitmask, customizer, equalFunc, stack); + } + var COMPARE_PARTIAL_FLAG4, argsTag4, arrayTag3, objectTag5, objectProto17, hasOwnProperty14, baseIsEqualDeep_default; + var init_baseIsEqualDeep = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js"() { + "use strict"; + init_Stack(); + init_equalArrays(); + init_equalByTag(); + init_equalObjects(); + init_getTag(); + init_isArray(); + init_isBuffer(); + init_isTypedArray(); + COMPARE_PARTIAL_FLAG4 = 1; + argsTag4 = "[object Arguments]"; + arrayTag3 = "[object Array]"; + objectTag5 = "[object Object]"; + objectProto17 = Object.prototype; + hasOwnProperty14 = objectProto17.hasOwnProperty; + __name(baseIsEqualDeep, "baseIsEqualDeep"); + baseIsEqualDeep_default = baseIsEqualDeep; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js + function baseIsEqual(value2, other, bitmask, customizer, stack) { + if (value2 === other) { + return true; + } + if (value2 == null || other == null || !isObjectLike_default(value2) && !isObjectLike_default(other)) { + return value2 !== value2 && other !== other; } - dfsAssignLowLim(tree, {}, 1, root2); + return baseIsEqualDeep_default(value2, other, bitmask, customizer, baseIsEqual, stack); } - function dfsAssignLowLim(tree, visited, nextLim, v, parent) { - var low = nextLim; - var label = tree.node(v); - visited[v] = true; - forEach(tree.neighbors(v), function(w2) { - if (!has(visited, w2)) { - nextLim = dfsAssignLowLim(tree, visited, nextLim, w2, v); + var baseIsEqual_default; + var init_baseIsEqual = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js"() { + "use strict"; + init_baseIsEqualDeep(); + init_isObjectLike(); + __name(baseIsEqual, "baseIsEqual"); + baseIsEqual_default = baseIsEqual; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js + function baseIsMatch(object3, source, matchData, customizer) { + var index = matchData.length, length2 = index, noCustomizer = !customizer; + if (object3 == null) { + return !length2; + } + object3 = Object(object3); + while (index--) { + var data5 = matchData[index]; + if (noCustomizer && data5[2] ? data5[1] !== object3[data5[0]] : !(data5[0] in object3)) { + return false; } - }); - label.low = low; - label.lim = nextLim++; - if (parent) { - label.parent = parent; - } else { - delete label.parent; } - return nextLim; + while (++index < length2) { + data5 = matchData[index]; + var key = data5[0], objValue = object3[key], srcValue = data5[1]; + if (noCustomizer && data5[2]) { + if (objValue === void 0 && !(key in object3)) { + return false; + } + } else { + var stack = new Stack_default(); + if (customizer) { + var result = customizer(objValue, srcValue, key, object3, source, stack); + } + if (!(result === void 0 ? baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG5 | COMPARE_UNORDERED_FLAG3, customizer, stack) : result)) { + return false; + } + } + } + return true; } - function leaveEdge(tree) { - return find$2(tree.edges(), function(e) { - return tree.edge(e).cutvalue < 0; - }); + var COMPARE_PARTIAL_FLAG5, COMPARE_UNORDERED_FLAG3, baseIsMatch_default; + var init_baseIsMatch = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js"() { + "use strict"; + init_Stack(); + init_baseIsEqual(); + COMPARE_PARTIAL_FLAG5 = 1; + COMPARE_UNORDERED_FLAG3 = 2; + __name(baseIsMatch, "baseIsMatch"); + baseIsMatch_default = baseIsMatch; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js + function isStrictComparable(value2) { + return value2 === value2 && !isObject_default(value2); } - function enterEdge(t, g, edge) { - var v = edge.v; - var w2 = edge.w; - if (!g.hasEdge(v, w2)) { - v = edge.w; - w2 = edge.v; + var isStrictComparable_default; + var init_isStrictComparable = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js"() { + "use strict"; + init_isObject(); + __name(isStrictComparable, "isStrictComparable"); + isStrictComparable_default = isStrictComparable; } - var vLabel = t.node(v); - var wLabel = t.node(w2); - var tailLabel = vLabel; - var flip = false; - if (vLabel.lim > wLabel.lim) { - tailLabel = wLabel; - flip = true; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js + function getMatchData(object3) { + var result = keys_default(object3), length2 = result.length; + while (length2--) { + var key = result[length2], value2 = object3[key]; + result[length2] = [key, value2, isStrictComparable_default(value2)]; } - var candidates = filter(g.edges(), function(edge2) { - return flip === isDescendant$1(t, t.node(edge2.v), tailLabel) && flip !== isDescendant$1(t, t.node(edge2.w), tailLabel); - }); - return minBy(candidates, function(edge2) { - return slack(g, edge2); - }); + return result; } - function exchangeEdges(t, g, e, f2) { - var v = e.v; - var w2 = e.w; - t.removeEdge(v, w2); - t.setEdge(f2.v, f2.w, {}); - initLowLimValues(t); - initCutValues(t, g); - updateRanks(t, g); - } - function updateRanks(t, g) { - var root2 = find$2(t.nodes(), function(v) { - return !g.node(v).parent; - }); - var vs = preorder(t, root2); - vs = vs.slice(1); - forEach(vs, function(v) { - var parent = t.node(v).parent, edge = g.edge(v, parent), flipped = false; - if (!edge) { - edge = g.edge(parent, v); - flipped = true; + var getMatchData_default; + var init_getMatchData = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js"() { + "use strict"; + init_isStrictComparable(); + init_keys(); + __name(getMatchData, "getMatchData"); + getMatchData_default = getMatchData; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js + function matchesStrictComparable(key, srcValue) { + return function(object3) { + if (object3 == null) { + return false; } - g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); - }); + return object3[key] === srcValue && (srcValue !== void 0 || key in Object(object3)); + }; } - function isTreeEdge(tree, u, v) { - return tree.hasEdge(u, v); + var matchesStrictComparable_default; + var init_matchesStrictComparable = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js"() { + "use strict"; + __name(matchesStrictComparable, "matchesStrictComparable"); + matchesStrictComparable_default = matchesStrictComparable; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js + function baseMatches(source) { + var matchData = getMatchData_default(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable_default(matchData[0][0], matchData[0][1]); + } + return function(object3) { + return object3 === source || baseIsMatch_default(object3, source, matchData); + }; } - function isDescendant$1(tree, vLabel, rootLabel) { - return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; + var baseMatches_default; + var init_baseMatches = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js"() { + "use strict"; + init_baseIsMatch(); + init_getMatchData(); + init_matchesStrictComparable(); + __name(baseMatches, "baseMatches"); + baseMatches_default = baseMatches; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js + function baseHasIn(object3, key) { + return object3 != null && key in Object(object3); } - function rank(g) { - switch (g.graph().ranker) { - case "network-simplex": - networkSimplexRanker(g); - break; - case "tight-tree": - tightTreeRanker(g); - break; - case "longest-path": - longestPathRanker(g); + var baseHasIn_default; + var init_baseHasIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js"() { + "use strict"; + __name(baseHasIn, "baseHasIn"); + baseHasIn_default = baseHasIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js + function hasPath(object3, path4, hasFunc) { + path4 = castPath_default(path4, object3); + var index = -1, length2 = path4.length, result = false; + while (++index < length2) { + var key = toKey_default(path4[index]); + if (!(result = object3 != null && hasFunc(object3, key))) { break; - default: - networkSimplexRanker(g); + } + object3 = object3[key]; } + if (result || ++index != length2) { + return result; + } + length2 = object3 == null ? 0 : object3.length; + return !!length2 && isLength_default(length2) && isIndex_default(key, length2) && (isArray_default(object3) || isArguments_default(object3)); + } + var hasPath_default; + var init_hasPath = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js"() { + "use strict"; + init_castPath(); + init_isArguments(); + init_isArray(); + init_isIndex(); + init_isLength(); + init_toKey(); + __name(hasPath, "hasPath"); + hasPath_default = hasPath; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js + function hasIn(object3, path4) { + return object3 != null && hasPath_default(object3, path4, baseHasIn_default); + } + var hasIn_default; + var init_hasIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js"() { + "use strict"; + init_baseHasIn(); + init_hasPath(); + __name(hasIn, "hasIn"); + hasIn_default = hasIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js + function baseMatchesProperty(path4, srcValue) { + if (isKey_default(path4) && isStrictComparable_default(srcValue)) { + return matchesStrictComparable_default(toKey_default(path4), srcValue); + } + return function(object3) { + var objValue = get_default(object3, path4); + return objValue === void 0 && objValue === srcValue ? hasIn_default(object3, path4) : baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG6 | COMPARE_UNORDERED_FLAG4); + }; } - var longestPathRanker = longestPath; - function tightTreeRanker(g) { - longestPath(g); - feasibleTree(g); - } - function networkSimplexRanker(g) { - networkSimplex(g); + var COMPARE_PARTIAL_FLAG6, COMPARE_UNORDERED_FLAG4, baseMatchesProperty_default; + var init_baseMatchesProperty = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js"() { + "use strict"; + init_baseIsEqual(); + init_get(); + init_hasIn(); + init_isKey(); + init_isStrictComparable(); + init_matchesStrictComparable(); + init_toKey(); + COMPARE_PARTIAL_FLAG6 = 1; + COMPARE_UNORDERED_FLAG4 = 2; + __name(baseMatchesProperty, "baseMatchesProperty"); + baseMatchesProperty_default = baseMatchesProperty; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js + function baseProperty(key) { + return function(object3) { + return object3 == null ? void 0 : object3[key]; + }; } - function run(g) { - var root2 = addDummyNode(g, "root", {}, "_root"); - var depths = treeDepths(g); - var height = max$1(values(depths)) - 1; - var nodeSep = 2 * height + 1; - g.graph().nestingRoot = root2; - forEach(g.edges(), function(e) { - g.edge(e).minlen *= nodeSep; - }); - var weight = sumWeights(g) + 1; - forEach(g.children(), function(child) { - dfs(g, root2, nodeSep, weight, height, depths, child); - }); - g.graph().nodeRankFactor = nodeSep; + var baseProperty_default; + var init_baseProperty = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js"() { + "use strict"; + __name(baseProperty, "baseProperty"); + baseProperty_default = baseProperty; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js + function basePropertyDeep(path4) { + return function(object3) { + return baseGet_default(object3, path4); + }; } - function dfs(g, root2, nodeSep, weight, height, depths, v) { - var children2 = g.children(v); - if (!children2.length) { - if (v !== root2) { - g.setEdge(root2, v, { weight: 0, minlen: nodeSep }); - } - return; + var basePropertyDeep_default; + var init_basePropertyDeep = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js"() { + "use strict"; + init_baseGet(); + __name(basePropertyDeep, "basePropertyDeep"); + basePropertyDeep_default = basePropertyDeep; } - var top2 = addBorderNode$1(g, "_bt"); - var bottom2 = addBorderNode$1(g, "_bb"); - var label = g.node(v); - g.setParent(top2, v); - label.borderTop = top2; - g.setParent(bottom2, v); - label.borderBottom = bottom2; - forEach(children2, function(child) { - dfs(g, root2, nodeSep, weight, height, depths, child); - var childNode = g.node(child); - var childTop = childNode.borderTop ? childNode.borderTop : child; - var childBottom = childNode.borderBottom ? childNode.borderBottom : child; - var thisWeight = childNode.borderTop ? weight : 2 * weight; - var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; - g.setEdge(top2, childTop, { - weight: thisWeight, - minlen, - nestingEdge: true - }); - g.setEdge(childBottom, bottom2, { - weight: thisWeight, - minlen, - nestingEdge: true - }); - }); - if (!g.parent(v)) { - g.setEdge(root2, top2, { weight: 0, minlen: height + depths[v] }); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js + function property(path4) { + return isKey_default(path4) ? baseProperty_default(toKey_default(path4)) : basePropertyDeep_default(path4); + } + var property_default2; + var init_property2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js"() { + "use strict"; + init_baseProperty(); + init_basePropertyDeep(); + init_isKey(); + init_toKey(); + __name(property, "property"); + property_default2 = property; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js + function baseIteratee(value2) { + if (typeof value2 == "function") { + return value2; + } + if (value2 == null) { + return identity_default4; + } + if (typeof value2 == "object") { + return isArray_default(value2) ? baseMatchesProperty_default(value2[0], value2[1]) : baseMatches_default(value2); + } + return property_default2(value2); + } + var baseIteratee_default; + var init_baseIteratee = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js"() { + "use strict"; + init_baseMatches(); + init_baseMatchesProperty(); + init_identity4(); + init_isArray(); + init_property2(); + __name(baseIteratee, "baseIteratee"); + baseIteratee_default = baseIteratee; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayAggregator.js + function arrayAggregator(array4, setter, iteratee, accumulator) { + var index = -1, length2 = array4 == null ? 0 : array4.length; + while (++index < length2) { + var value2 = array4[index]; + setter(accumulator, value2, iteratee(value2), array4); } + return accumulator; } - function treeDepths(g) { - var depths = {}; - function dfs2(v, depth) { - var children2 = g.children(v); - if (children2 && children2.length) { - forEach(children2, function(child) { - dfs2(child, depth + 1); - }); + var arrayAggregator_default; + var init_arrayAggregator = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayAggregator.js"() { + "use strict"; + __name(arrayAggregator, "arrayAggregator"); + arrayAggregator_default = arrayAggregator; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js + function baseForOwn(object3, iteratee) { + return object3 && baseFor_default(object3, iteratee, keys_default); + } + var baseForOwn_default; + var init_baseForOwn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js"() { + "use strict"; + init_baseFor(); + init_keys(); + __name(baseForOwn, "baseForOwn"); + baseForOwn_default = baseForOwn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js + function createBaseEach(eachFunc, fromRight) { + return function(collection4, iteratee) { + if (collection4 == null) { + return collection4; + } + if (!isArrayLike_default(collection4)) { + return eachFunc(collection4, iteratee); + } + var length2 = collection4.length, index = fromRight ? length2 : -1, iterable = Object(collection4); + while (fromRight ? index-- : ++index < length2) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } } - depths[v] = depth; + return collection4; + }; + } + var createBaseEach_default; + var init_createBaseEach = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js"() { + "use strict"; + init_isArrayLike(); + __name(createBaseEach, "createBaseEach"); + createBaseEach_default = createBaseEach; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js + var baseEach, baseEach_default; + var init_baseEach = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js"() { + "use strict"; + init_baseForOwn(); + init_createBaseEach(); + baseEach = createBaseEach_default(baseForOwn_default); + baseEach_default = baseEach; } - forEach(g.children(), function(v) { - dfs2(v, 1); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAggregator.js + function baseAggregator(collection4, setter, iteratee, accumulator) { + baseEach_default(collection4, function(value2, key, collection5) { + setter(accumulator, value2, iteratee(value2), collection5); }); - return depths; + return accumulator; } - function sumWeights(g) { - return reduce( - g.edges(), - function(acc, e) { - return acc + g.edge(e).weight; - }, - 0 - ); + var baseAggregator_default; + var init_baseAggregator = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAggregator.js"() { + "use strict"; + init_baseEach(); + __name(baseAggregator, "baseAggregator"); + baseAggregator_default = baseAggregator; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAggregator.js + function createAggregator(setter, initializer) { + return function(collection4, iteratee) { + var func = isArray_default(collection4) ? arrayAggregator_default : baseAggregator_default, accumulator = initializer ? initializer() : {}; + return func(collection4, setter, baseIteratee_default(iteratee, 2), accumulator); + }; } - function cleanup(g) { - var graphLabel = g.graph(); - g.removeNode(graphLabel.nestingRoot); - delete graphLabel.nestingRoot; - forEach(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.nestingEdge) { - g.removeEdge(e); - } - }); - } - function addSubgraphConstraints(g, cg, vs) { - var prev2 = {}, rootPrev; - forEach(vs, function(v) { - var child = g.parent(v), parent, prevChild; - while (child) { - parent = g.parent(child); - if (parent) { - prevChild = prev2[parent]; - prev2[parent] = child; - } else { - prevChild = rootPrev; - rootPrev = child; - } - if (prevChild && prevChild !== child) { - cg.setEdge(prevChild, child); - return; + var createAggregator_default; + var init_createAggregator = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAggregator.js"() { + "use strict"; + init_arrayAggregator(); + init_baseAggregator(); + init_baseIteratee(); + init_isArray(); + __name(createAggregator, "createAggregator"); + createAggregator_default = createAggregator; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js + var now2, now_default; + var init_now = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js"() { + "use strict"; + init_root(); + now2 = /* @__PURE__ */ __name(function() { + return root_default.Date.now(); + }, "now"); + now_default = now2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/defaults.js + var objectProto18, hasOwnProperty15, defaults, defaults_default; + var init_defaults = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/defaults.js"() { + "use strict"; + init_baseRest(); + init_eq(); + init_isIterateeCall(); + init_keysIn(); + objectProto18 = Object.prototype; + hasOwnProperty15 = objectProto18.hasOwnProperty; + defaults = baseRest_default(function(object3, sources) { + object3 = Object(object3); + var index = -1; + var length2 = sources.length; + var guard = length2 > 2 ? sources[2] : void 0; + if (guard && isIterateeCall_default(sources[0], sources[1], guard)) { + length2 = 1; + } + while (++index < length2) { + var source = sources[index]; + var props = keysIn_default(source); + var propsIndex = -1; + var propsLength = props.length; + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value2 = object3[key]; + if (value2 === void 0 || eq_default(value2, objectProto18[key]) && !hasOwnProperty15.call(object3, key)) { + object3[key] = source[key]; + } + } } - child = parent; + return object3; + }); + defaults_default = defaults; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js + function arrayIncludesWith(array4, value2, comparator) { + var index = -1, length2 = array4 == null ? 0 : array4.length; + while (++index < length2) { + if (comparator(value2, array4[index])) { + return true; } - }); + } + return false; } - function buildLayerGraph(g, rank2, relationship) { - var root2 = createRootNode(g), result = new Graph({ compound: true }).setGraph({ root: root2 }).setDefaultNodeLabel(function(v) { - return g.node(v); - }); - forEach(g.nodes(), function(v) { - var node2 = g.node(v), parent = g.parent(v); - if (node2.rank === rank2 || node2.minRank <= rank2 && rank2 <= node2.maxRank) { - result.setNode(v); - result.setParent(v, parent || root2); - forEach(g[relationship](v), function(e) { - var u = e.v === v ? e.w : e.v, edge = result.edge(u, v), weight = !isUndefined(edge) ? edge.weight : 0; - result.setEdge(u, v, { weight: g.edge(e).weight + weight }); - }); - if (has(node2, "minRank")) { - result.setNode(v, { - borderLeft: node2.borderLeft[rank2], - borderRight: node2.borderRight[rank2] - }); + var arrayIncludesWith_default; + var init_arrayIncludesWith = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js"() { + "use strict"; + __name(arrayIncludesWith, "arrayIncludesWith"); + arrayIncludesWith_default = arrayIncludesWith; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseDifference.js + function baseDifference(array4, values2, iteratee, comparator) { + var index = -1, includes3 = arrayIncludes_default, isCommon2 = true, length2 = array4.length, result = [], valuesLength = values2.length; + if (!length2) { + return result; + } + if (iteratee) { + values2 = arrayMap_default(values2, baseUnary_default(iteratee)); + } + if (comparator) { + includes3 = arrayIncludesWith_default; + isCommon2 = false; + } else if (values2.length >= LARGE_ARRAY_SIZE2) { + includes3 = cacheHas_default; + isCommon2 = false; + values2 = new SetCache_default(values2); + } + outer: + while (++index < length2) { + var value2 = array4[index], computed = iteratee == null ? value2 : iteratee(value2); + value2 = comparator || value2 !== 0 ? value2 : 0; + if (isCommon2 && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values2[valuesIndex] === computed) { + continue outer; + } + } + result.push(value2); + } else if (!includes3(values2, computed, comparator)) { + result.push(value2); } } - }); return result; } - function createRootNode(g) { - var v; - while (g.hasNode(v = uniqueId("_root"))) - ; - return v; - } - function crossCount(g, layering) { - var cc = 0; - for (var i2 = 1; i2 < layering.length; ++i2) { - cc += twoLayerCrossCount(g, layering[i2 - 1], layering[i2]); + var LARGE_ARRAY_SIZE2, baseDifference_default; + var init_baseDifference = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseDifference.js"() { + "use strict"; + init_SetCache(); + init_arrayIncludes(); + init_arrayIncludesWith(); + init_arrayMap(); + init_baseUnary(); + init_cacheHas(); + LARGE_ARRAY_SIZE2 = 200; + __name(baseDifference, "baseDifference"); + baseDifference_default = baseDifference; } - return cc; - } - function twoLayerCrossCount(g, northLayer, southLayer) { - var southPos = zipObject( - southLayer, - map(southLayer, function(v, i2) { - return i2; - }) - ); - var southEntries = flatten( - map(northLayer, function(v) { - return sortBy$1( - map(g.outEdges(v), function(e) { - return { pos: southPos[e.w], weight: g.edge(e).weight }; - }), - "pos" - ); - }) - ); - var firstIndex = 1; - while (firstIndex < southLayer.length) - firstIndex <<= 1; - var treeSize = 2 * firstIndex - 1; - firstIndex -= 1; - var tree = map(new Array(treeSize), function() { - return 0; - }); - var cc = 0; - forEach( - // @ts-expect-error - southEntries.forEach(function(entry) { - var index2 = entry.pos + firstIndex; - tree[index2] += entry.weight; - var weightSum = 0; - while (index2 > 0) { - if (index2 % 2) { - weightSum += tree[index2 + 1]; - } - index2 = index2 - 1 >> 1; - tree[index2] += entry.weight; - } - cc += entry.weight * weightSum; - }) - ); - return cc; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/difference.js + var difference, difference_default; + var init_difference = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/difference.js"() { + "use strict"; + init_baseDifference(); + init_baseFlatten(); + init_baseRest(); + init_isArrayLikeObject(); + difference = baseRest_default(function(array4, values2) { + return isArrayLikeObject_default(array4) ? baseDifference_default(array4, baseFlatten_default(values2, 1, isArrayLikeObject_default, true)) : []; + }); + difference_default = difference; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js + function last(array4) { + var length2 = array4 == null ? 0 : array4.length; + return length2 ? array4[length2 - 1] : void 0; + } + var last_default; + var init_last = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js"() { + "use strict"; + __name(last, "last"); + last_default = last; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/drop.js + function drop(array4, n2, guard) { + var length2 = array4 == null ? 0 : array4.length; + if (!length2) { + return []; + } + n2 = guard || n2 === void 0 ? 1 : toInteger_default(n2); + return baseSlice_default(array4, n2 < 0 ? 0 : n2, length2); } - function initOrder(g) { - var visited = {}; - var simpleNodes = filter(g.nodes(), function(v) { - return !g.children(v).length; - }); - var maxRank2 = max$1( - map(simpleNodes, function(v) { - return g.node(v).rank; - }) - ); - var layers = map(range$1(maxRank2 + 1), function() { + var drop_default; + var init_drop = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/drop.js"() { + "use strict"; + init_baseSlice(); + init_toInteger(); + __name(drop, "drop"); + drop_default = drop; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/dropRight.js + function dropRight(array4, n2, guard) { + var length2 = array4 == null ? 0 : array4.length; + if (!length2) { return []; - }); - function dfs2(v) { - if (has(visited, v)) - return; - visited[v] = true; - var node2 = g.node(v); - layers[node2.rank].push(v); - forEach(g.successors(v), dfs2); } - var orderedVs = sortBy$1(simpleNodes, function(v) { - return g.node(v).rank; - }); - forEach(orderedVs, dfs2); - return layers; + n2 = guard || n2 === void 0 ? 1 : toInteger_default(n2); + n2 = length2 - n2; + return baseSlice_default(array4, 0, n2 < 0 ? 0 : n2); } - function barycenter(g, movable) { - return map(movable, function(v) { - var inV = g.inEdges(v); - if (!inV.length) { - return { v }; - } else { - var result = reduce( - inV, - function(acc, e) { - var edge = g.edge(e), nodeU = g.node(e.v); - return { - sum: acc.sum + edge.weight * nodeU.order, - weight: acc.weight + edge.weight - }; - }, - { sum: 0, weight: 0 } - ); - return { - v, - barycenter: result.sum / result.weight, - weight: result.weight - }; + var dropRight_default; + var init_dropRight = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/dropRight.js"() { + "use strict"; + init_baseSlice(); + init_toInteger(); + __name(dropRight, "dropRight"); + dropRight_default = dropRight; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castFunction.js + function castFunction(value2) { + return typeof value2 == "function" ? value2 : identity_default4; + } + var castFunction_default; + var init_castFunction = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castFunction.js"() { + "use strict"; + init_identity4(); + __name(castFunction, "castFunction"); + castFunction_default = castFunction; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forEach.js + function forEach(collection4, iteratee) { + var func = isArray_default(collection4) ? arrayEach_default : baseEach_default; + return func(collection4, castFunction_default(iteratee)); + } + var forEach_default; + var init_forEach = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forEach.js"() { + "use strict"; + init_arrayEach(); + init_baseEach(); + init_castFunction(); + init_isArray(); + __name(forEach, "forEach"); + forEach_default = forEach; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/each.js + var init_each2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/each.js"() { + "use strict"; + init_forEach(); + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEvery.js + function arrayEvery(array4, predicate) { + var index = -1, length2 = array4 == null ? 0 : array4.length; + while (++index < length2) { + if (!predicate(array4[index], index, array4)) { + return false; } + } + return true; + } + var arrayEvery_default; + var init_arrayEvery = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEvery.js"() { + "use strict"; + __name(arrayEvery, "arrayEvery"); + arrayEvery_default = arrayEvery; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEvery.js + function baseEvery(collection4, predicate) { + var result = true; + baseEach_default(collection4, function(value2, index, collection5) { + result = !!predicate(value2, index, collection5); + return result; }); + return result; } - function resolveConflicts(entries2, cg) { - var mappedEntries = {}; - forEach(entries2, function(entry, i2) { - var tmp = mappedEntries[entry.v] = { - indegree: 0, - in: [], - out: [], - vs: [entry.v], - i: i2 - }; - if (!isUndefined(entry.barycenter)) { - tmp.barycenter = entry.barycenter; - tmp.weight = entry.weight; + var baseEvery_default; + var init_baseEvery = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEvery.js"() { + "use strict"; + init_baseEach(); + __name(baseEvery, "baseEvery"); + baseEvery_default = baseEvery; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/every.js + function every(collection4, predicate, guard) { + var func = isArray_default(collection4) ? arrayEvery_default : baseEvery_default; + if (guard && isIterateeCall_default(collection4, predicate, guard)) { + predicate = void 0; + } + return func(collection4, baseIteratee_default(predicate, 3)); + } + var every_default; + var init_every = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/every.js"() { + "use strict"; + init_arrayEvery(); + init_baseEvery(); + init_baseIteratee(); + init_isArray(); + init_isIterateeCall(); + __name(every, "every"); + every_default = every; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFilter.js + function baseFilter(collection4, predicate) { + var result = []; + baseEach_default(collection4, function(value2, index, collection5) { + if (predicate(value2, index, collection5)) { + result.push(value2); } }); - forEach(cg.edges(), function(e) { - var entryV = mappedEntries[e.v]; - var entryW = mappedEntries[e.w]; - if (!isUndefined(entryV) && !isUndefined(entryW)) { - entryW.indegree++; - entryV.out.push(mappedEntries[e.w]); + return result; + } + var baseFilter_default; + var init_baseFilter = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFilter.js"() { + "use strict"; + init_baseEach(); + __name(baseFilter, "baseFilter"); + baseFilter_default = baseFilter; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/filter.js + function filter2(collection4, predicate) { + var func = isArray_default(collection4) ? arrayFilter_default : baseFilter_default; + return func(collection4, baseIteratee_default(predicate, 3)); + } + var filter_default3; + var init_filter3 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/filter.js"() { + "use strict"; + init_arrayFilter(); + init_baseFilter(); + init_baseIteratee(); + init_isArray(); + __name(filter2, "filter"); + filter_default3 = filter2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createFind.js + function createFind(findIndexFunc) { + return function(collection4, predicate, fromIndex) { + var iterable = Object(collection4); + if (!isArrayLike_default(collection4)) { + var iteratee = baseIteratee_default(predicate, 3); + collection4 = keys_default(collection4); + predicate = /* @__PURE__ */ __name(function(key) { + return iteratee(iterable[key], key, iterable); + }, "predicate"); } + var index = findIndexFunc(collection4, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection4[index] : index] : void 0; + }; + } + var createFind_default; + var init_createFind = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createFind.js"() { + "use strict"; + init_baseIteratee(); + init_isArrayLike(); + init_keys(); + __name(createFind, "createFind"); + createFind_default = createFind; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/findIndex.js + function findIndex(array4, predicate, fromIndex) { + var length2 = array4 == null ? 0 : array4.length; + if (!length2) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger_default(fromIndex); + if (index < 0) { + index = nativeMax2(length2 + index, 0); + } + return baseFindIndex_default(array4, baseIteratee_default(predicate, 3), index); + } + var nativeMax2, findIndex_default; + var init_findIndex = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/findIndex.js"() { + "use strict"; + init_baseFindIndex(); + init_baseIteratee(); + init_toInteger(); + nativeMax2 = Math.max; + __name(findIndex, "findIndex"); + findIndex_default = findIndex; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/find.js + var find2, find_default; + var init_find = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/find.js"() { + "use strict"; + init_createFind(); + init_findIndex(); + find2 = createFind_default(findIndex_default); + find_default = find2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/head.js + function head(array4) { + return array4 && array4.length ? array4[0] : void 0; + } + var head_default; + var init_head = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/head.js"() { + "use strict"; + __name(head, "head"); + head_default = head; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/first.js + var init_first = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/first.js"() { + "use strict"; + init_head(); + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMap.js + function baseMap(collection4, iteratee) { + var index = -1, result = isArrayLike_default(collection4) ? Array(collection4.length) : []; + baseEach_default(collection4, function(value2, key, collection5) { + result[++index] = iteratee(value2, key, collection5); }); - var sourceSet = filter(mappedEntries, function(entry) { - return !entry.indegree; - }); - return doResolveConflicts(sourceSet); + return result; } - function doResolveConflicts(sourceSet) { - var entries2 = []; - function handleIn(vEntry) { - return function(uEntry) { - if (uEntry.merged) { - return; - } - if (isUndefined(uEntry.barycenter) || isUndefined(vEntry.barycenter) || uEntry.barycenter >= vEntry.barycenter) { - mergeEntries(vEntry, uEntry); - } - }; + var baseMap_default; + var init_baseMap = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMap.js"() { + "use strict"; + init_baseEach(); + init_isArrayLike(); + __name(baseMap, "baseMap"); + baseMap_default = baseMap; } - function handleOut(vEntry) { - return function(wEntry) { - wEntry["in"].push(vEntry); - if (--wEntry.indegree === 0) { - sourceSet.push(wEntry); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/map.js + function map2(collection4, iteratee) { + var func = isArray_default(collection4) ? arrayMap_default : baseMap_default; + return func(collection4, baseIteratee_default(iteratee, 3)); + } + var map_default; + var init_map = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/map.js"() { + "use strict"; + init_arrayMap(); + init_baseIteratee(); + init_baseMap(); + init_isArray(); + __name(map2, "map"); + map_default = map2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatMap.js + function flatMap(collection4, iteratee) { + return baseFlatten_default(map_default(collection4, iteratee), 1); + } + var flatMap_default; + var init_flatMap = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatMap.js"() { + "use strict"; + init_baseFlatten(); + init_map(); + __name(flatMap, "flatMap"); + flatMap_default = flatMap; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forIn.js + function forIn(object3, iteratee) { + return object3 == null ? object3 : baseFor_default(object3, castFunction_default(iteratee), keysIn_default); + } + var forIn_default; + var init_forIn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forIn.js"() { + "use strict"; + init_baseFor(); + init_castFunction(); + init_keysIn(); + __name(forIn, "forIn"); + forIn_default = forIn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forOwn.js + function forOwn(object3, iteratee) { + return object3 && baseForOwn_default(object3, castFunction_default(iteratee)); + } + var forOwn_default; + var init_forOwn = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forOwn.js"() { + "use strict"; + init_baseForOwn(); + init_castFunction(); + __name(forOwn, "forOwn"); + forOwn_default = forOwn; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/groupBy.js + var objectProto19, hasOwnProperty16, groupBy, groupBy_default; + var init_groupBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/groupBy.js"() { + "use strict"; + init_baseAssignValue(); + init_createAggregator(); + objectProto19 = Object.prototype; + hasOwnProperty16 = objectProto19.hasOwnProperty; + groupBy = createAggregator_default(function(result, value2, key) { + if (hasOwnProperty16.call(result, key)) { + result[key].push(value2); + } else { + baseAssignValue_default(result, key, [value2]); } - }; + }); + groupBy_default = groupBy; } - while (sourceSet.length) { - var entry = sourceSet.pop(); - entries2.push(entry); - forEach(entry["in"].reverse(), handleIn(entry)); - forEach(entry.out, handleOut(entry)); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGt.js + function baseGt(value2, other) { + return value2 > other; + } + var baseGt_default; + var init_baseGt = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGt.js"() { + "use strict"; + __name(baseGt, "baseGt"); + baseGt_default = baseGt; } - return map( - filter(entries2, function(entry2) { - return !entry2.merged; - }), - function(entry2) { - return pick$1(entry2, ["vs", "i", "barycenter", "weight"]); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHas.js + function baseHas(object3, key) { + return object3 != null && hasOwnProperty17.call(object3, key); + } + var objectProto20, hasOwnProperty17, baseHas_default; + var init_baseHas = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHas.js"() { + "use strict"; + objectProto20 = Object.prototype; + hasOwnProperty17 = objectProto20.hasOwnProperty; + __name(baseHas, "baseHas"); + baseHas_default = baseHas; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/has.js + function has(object3, path4) { + return object3 != null && hasPath_default(object3, path4, baseHas_default); + } + var has_default; + var init_has = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/has.js"() { + "use strict"; + init_baseHas(); + init_hasPath(); + __name(has, "has"); + has_default = has; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js + function isString(value2) { + return typeof value2 == "string" || !isArray_default(value2) && isObjectLike_default(value2) && baseGetTag_default(value2) == stringTag5; + } + var stringTag5, isString_default; + var init_isString = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js"() { + "use strict"; + init_baseGetTag(); + init_isArray(); + init_isObjectLike(); + stringTag5 = "[object String]"; + __name(isString, "isString"); + isString_default = isString; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseValues.js + function baseValues(object3, props) { + return arrayMap_default(props, function(key) { + return object3[key]; + }); + } + var baseValues_default; + var init_baseValues = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseValues.js"() { + "use strict"; + init_arrayMap(); + __name(baseValues, "baseValues"); + baseValues_default = baseValues; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/values.js + function values(object3) { + return object3 == null ? [] : baseValues_default(object3, keys_default(object3)); + } + var values_default; + var init_values = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/values.js"() { + "use strict"; + init_baseValues(); + init_keys(); + __name(values, "values"); + values_default = values; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/includes.js + function includes(collection4, value2, fromIndex, guard) { + collection4 = isArrayLike_default(collection4) ? collection4 : values_default(collection4); + fromIndex = fromIndex && !guard ? toInteger_default(fromIndex) : 0; + var length2 = collection4.length; + if (fromIndex < 0) { + fromIndex = nativeMax3(length2 + fromIndex, 0); + } + return isString_default(collection4) ? fromIndex <= length2 && collection4.indexOf(value2, fromIndex) > -1 : !!length2 && baseIndexOf_default(collection4, value2, fromIndex) > -1; + } + var nativeMax3, includes_default; + var init_includes = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/includes.js"() { + "use strict"; + init_baseIndexOf(); + init_isArrayLike(); + init_isString(); + init_toInteger(); + init_values(); + nativeMax3 = Math.max; + __name(includes, "includes"); + includes_default = includes; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/indexOf.js + function indexOf(array4, value2, fromIndex) { + var length2 = array4 == null ? 0 : array4.length; + if (!length2) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger_default(fromIndex); + if (index < 0) { + index = nativeMax4(length2 + index, 0); + } + return baseIndexOf_default(array4, value2, index); + } + var nativeMax4, indexOf_default; + var init_indexOf = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/indexOf.js"() { + "use strict"; + init_baseIndexOf(); + init_toInteger(); + nativeMax4 = Math.max; + __name(indexOf, "indexOf"); + indexOf_default = indexOf; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEmpty.js + function isEmpty(value2) { + if (value2 == null) { + return true; + } + if (isArrayLike_default(value2) && (isArray_default(value2) || typeof value2 == "string" || typeof value2.splice == "function" || isBuffer_default(value2) || isTypedArray_default(value2) || isArguments_default(value2))) { + return !value2.length; + } + var tag2 = getTag_default(value2); + if (tag2 == mapTag7 || tag2 == setTag7) { + return !value2.size; + } + if (isPrototype_default(value2)) { + return !baseKeys_default(value2).length; + } + for (var key in value2) { + if (hasOwnProperty18.call(value2, key)) { + return false; } - ); + } + return true; } - function mergeEntries(target, source) { - var sum2 = 0; - var weight = 0; - if (target.weight) { - sum2 += target.barycenter * target.weight; - weight += target.weight; + var mapTag7, setTag7, objectProto21, hasOwnProperty18, isEmpty_default; + var init_isEmpty = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEmpty.js"() { + "use strict"; + init_baseKeys(); + init_getTag(); + init_isArguments(); + init_isArray(); + init_isArrayLike(); + init_isBuffer(); + init_isPrototype(); + init_isTypedArray(); + mapTag7 = "[object Map]"; + setTag7 = "[object Set]"; + objectProto21 = Object.prototype; + hasOwnProperty18 = objectProto21.hasOwnProperty; + __name(isEmpty, "isEmpty"); + isEmpty_default = isEmpty; } - if (source.weight) { - sum2 += source.barycenter * source.weight; - weight += source.weight; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsRegExp.js + function baseIsRegExp(value2) { + return isObjectLike_default(value2) && baseGetTag_default(value2) == regexpTag5; + } + var regexpTag5, baseIsRegExp_default; + var init_baseIsRegExp = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsRegExp.js"() { + "use strict"; + init_baseGetTag(); + init_isObjectLike(); + regexpTag5 = "[object RegExp]"; + __name(baseIsRegExp, "baseIsRegExp"); + baseIsRegExp_default = baseIsRegExp; } - target.vs = source.vs.concat(target.vs); - target.barycenter = sum2 / weight; - target.weight = weight; - target.i = Math.min(source.i, target.i); - source.merged = true; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isRegExp.js + var nodeIsRegExp, isRegExp, isRegExp_default; + var init_isRegExp = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isRegExp.js"() { + "use strict"; + init_baseIsRegExp(); + init_baseUnary(); + init_nodeUtil(); + nodeIsRegExp = nodeUtil_default && nodeUtil_default.isRegExp; + isRegExp = nodeIsRegExp ? baseUnary_default(nodeIsRegExp) : baseIsRegExp_default; + isRegExp_default = isRegExp; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isUndefined.js + function isUndefined(value2) { + return value2 === void 0; } - function sort(entries2, biasRight) { - var parts = partition(entries2, function(entry) { - return has(entry, "barycenter"); - }); - var sortable = parts.lhs, unsortable = sortBy$1(parts.rhs, function(entry) { - return -entry.i; - }), vs = [], sum2 = 0, weight = 0, vsIndex = 0; - sortable.sort(compareWithBias(!!biasRight)); - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - forEach(sortable, function(entry) { - vsIndex += entry.vs.length; - vs.push(entry.vs); - sum2 += entry.barycenter * entry.weight; - weight += entry.weight; - vsIndex = consumeUnsortable(vs, unsortable, vsIndex); - }); - var result = { vs: flatten(vs) }; - if (weight) { - result.barycenter = sum2 / weight; - result.weight = weight; + var isUndefined_default; + var init_isUndefined = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isUndefined.js"() { + "use strict"; + __name(isUndefined, "isUndefined"); + isUndefined_default = isUndefined; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseLt.js + function baseLt(value2, other) { + return value2 < other; + } + var baseLt_default; + var init_baseLt = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseLt.js"() { + "use strict"; + __name(baseLt, "baseLt"); + baseLt_default = baseLt; } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mapValues.js + function mapValues(object3, iteratee) { + var result = {}; + iteratee = baseIteratee_default(iteratee, 3); + baseForOwn_default(object3, function(value2, key, object4) { + baseAssignValue_default(result, key, iteratee(value2, key, object4)); + }); return result; } - function consumeUnsortable(vs, unsortable, index2) { - var last$1; - while (unsortable.length && (last$1 = last(unsortable)).i <= index2) { - unsortable.pop(); - vs.push(last$1.vs); - index2++; + var mapValues_default; + var init_mapValues = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mapValues.js"() { + "use strict"; + init_baseAssignValue(); + init_baseForOwn(); + init_baseIteratee(); + __name(mapValues, "mapValues"); + mapValues_default = mapValues; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseExtremum.js + function baseExtremum(array4, iteratee, comparator) { + var index = -1, length2 = array4.length; + while (++index < length2) { + var value2 = array4[index], current = iteratee(value2); + if (current != null && (computed === void 0 ? current === current && !isSymbol_default(current) : comparator(current, computed))) { + var computed = current, result = value2; + } } - return index2; + return result; } - function compareWithBias(bias) { - return function(entryV, entryW) { - if (entryV.barycenter < entryW.barycenter) { - return -1; - } else if (entryV.barycenter > entryW.barycenter) { - return 1; + var baseExtremum_default; + var init_baseExtremum = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseExtremum.js"() { + "use strict"; + init_isSymbol(); + __name(baseExtremum, "baseExtremum"); + baseExtremum_default = baseExtremum; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/max.js + function max4(array4) { + return array4 && array4.length ? baseExtremum_default(array4, identity_default4, baseGt_default) : void 0; + } + var max_default; + var init_max2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/max.js"() { + "use strict"; + init_baseExtremum(); + init_baseGt(); + init_identity4(); + __name(max4, "max"); + max_default = max4; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/min.js + function min4(array4) { + return array4 && array4.length ? baseExtremum_default(array4, identity_default4, baseLt_default) : void 0; + } + var min_default; + var init_min2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/min.js"() { + "use strict"; + init_baseExtremum(); + init_baseLt(); + init_identity4(); + __name(min4, "min"); + min_default = min4; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/minBy.js + function minBy(array4, iteratee) { + return array4 && array4.length ? baseExtremum_default(array4, baseIteratee_default(iteratee, 2), baseLt_default) : void 0; + } + var minBy_default; + var init_minBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/minBy.js"() { + "use strict"; + init_baseExtremum(); + init_baseIteratee(); + init_baseLt(); + __name(minBy, "minBy"); + minBy_default = minBy; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/negate.js + function negate(predicate) { + if (typeof predicate != "function") { + throw new TypeError(FUNC_ERROR_TEXT2); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: + return !predicate.call(this); + case 1: + return !predicate.call(this, args[0]); + case 2: + return !predicate.call(this, args[0], args[1]); + case 3: + return !predicate.call(this, args[0], args[1], args[2]); } - return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + return !predicate.apply(this, args); }; } - function sortSubgraph(g, v, cg, biasRight) { - var movable = g.children(v); - var node2 = g.node(v); - var bl = node2 ? node2.borderLeft : void 0; - var br = node2 ? node2.borderRight : void 0; - var subgraphs = {}; - if (bl) { - movable = filter(movable, function(w2) { - return w2 !== bl && w2 !== br; - }); + var FUNC_ERROR_TEXT2, negate_default; + var init_negate = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/negate.js"() { + "use strict"; + FUNC_ERROR_TEXT2 = "Expected a function"; + __name(negate, "negate"); + negate_default = negate; } - var barycenters = barycenter(g, movable); - forEach(barycenters, function(entry) { - if (g.children(entry.v).length) { - var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); - subgraphs[entry.v] = subgraphResult; - if (has(subgraphResult, "barycenter")) { - mergeBarycenters(entry, subgraphResult); - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSet.js + function baseSet(object3, path4, value2, customizer) { + if (!isObject_default(object3)) { + return object3; + } + path4 = castPath_default(path4, object3); + var index = -1, length2 = path4.length, lastIndex = length2 - 1, nested = object3; + while (nested != null && ++index < length2) { + var key = toKey_default(path4[index]), newValue = value2; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return object3; } - }); - var entries2 = resolveConflicts(barycenters, cg); - expandSubgraphs(entries2, subgraphs); - var result = sort(entries2, biasRight); - if (bl) { - result.vs = flatten([bl, result.vs, br]); - if (g.predecessors(bl).length) { - var blPred = g.node(g.predecessors(bl)[0]), brPred = g.node(g.predecessors(br)[0]); - if (!has(result, "barycenter")) { - result.barycenter = 0; - result.weight = 0; + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : void 0; + if (newValue === void 0) { + newValue = isObject_default(objValue) ? objValue : isIndex_default(path4[index + 1]) ? [] : {}; } - result.barycenter = (result.barycenter * result.weight + blPred.order + brPred.order) / (result.weight + 2); - result.weight += 2; } + assignValue_default(nested, key, newValue); + nested = nested[key]; } - return result; - } - function expandSubgraphs(entries2, subgraphs) { - forEach(entries2, function(entry) { - entry.vs = flatten( - entry.vs.map(function(v) { - if (subgraphs[v]) { - return subgraphs[v].vs; - } - return v; - }) - ); - }); + return object3; } - function mergeBarycenters(target, other) { - if (!isUndefined(target.barycenter)) { - target.barycenter = (target.barycenter * target.weight + other.barycenter * other.weight) / (target.weight + other.weight); - target.weight += other.weight; - } else { - target.barycenter = other.barycenter; - target.weight = other.weight; + var baseSet_default; + var init_baseSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSet.js"() { + "use strict"; + init_assignValue(); + init_castPath(); + init_isIndex(); + init_isObject(); + init_toKey(); + __name(baseSet, "baseSet"); + baseSet_default = baseSet; } - } - function order(g) { - var maxRank$1 = maxRank(g), downLayerGraphs = buildLayerGraphs(g, range$1(1, maxRank$1 + 1), "inEdges"), upLayerGraphs = buildLayerGraphs(g, range$1(maxRank$1 - 1, -1, -1), "outEdges"); - var layering = initOrder(g); - assignOrder(g, layering); - var bestCC = Number.POSITIVE_INFINITY, best; - for (var i2 = 0, lastBest = 0; lastBest < 4; ++i2, ++lastBest) { - sweepLayerGraphs(i2 % 2 ? downLayerGraphs : upLayerGraphs, i2 % 4 >= 2); - layering = buildLayerMatrix(g); - var cc = crossCount(g, layering); - if (cc < bestCC) { - lastBest = 0; - best = cloneDeep(layering); - bestCC = cc; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePickBy.js + function basePickBy(object3, paths, predicate) { + var index = -1, length2 = paths.length, result = {}; + while (++index < length2) { + var path4 = paths[index], value2 = baseGet_default(object3, path4); + if (predicate(value2, path4)) { + baseSet_default(result, castPath_default(path4, object3), value2); } } - assignOrder(g, best); + return result; } - function buildLayerGraphs(g, ranks, relationship) { - return map(ranks, function(rank2) { - return buildLayerGraph(g, rank2, relationship); + var basePickBy_default; + var init_basePickBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePickBy.js"() { + "use strict"; + init_baseGet(); + init_baseSet(); + init_castPath(); + __name(basePickBy, "basePickBy"); + basePickBy_default = basePickBy; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pickBy.js + function pickBy(object3, predicate) { + if (object3 == null) { + return {}; + } + var props = arrayMap_default(getAllKeysIn_default(object3), function(prop) { + return [prop]; }); - } - function sweepLayerGraphs(layerGraphs, biasRight) { - var cg = new Graph(); - forEach(layerGraphs, function(lg) { - var root2 = lg.graph().root; - var sorted = sortSubgraph(lg, root2, cg, biasRight); - forEach(sorted.vs, function(v, i2) { - lg.node(v).order = i2; - }); - addSubgraphConstraints(lg, cg, sorted.vs); + predicate = baseIteratee_default(predicate); + return basePickBy_default(object3, props, function(value2, path4) { + return predicate(value2, path4[0]); }); } - function assignOrder(g, layering) { - forEach(layering, function(layer) { - forEach(layer, function(v, i2) { - g.node(v).order = i2; - }); - }); + var pickBy_default; + var init_pickBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pickBy.js"() { + "use strict"; + init_arrayMap(); + init_baseIteratee(); + init_basePickBy(); + init_getAllKeysIn(); + __name(pickBy, "pickBy"); + pickBy_default = pickBy; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSortBy.js + function baseSortBy(array4, comparer) { + var length2 = array4.length; + array4.sort(comparer); + while (length2--) { + array4[length2] = array4[length2].value; + } + return array4; } - function parentDummyChains(g) { - var postorderNums = postorder(g); - forEach(g.graph().dummyChains, function(v) { - var node2 = g.node(v); - var edgeObj = node2.edgeObj; - var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w); - var path2 = pathData.path; - var lca = pathData.lca; - var pathIdx = 0; - var pathV = path2[pathIdx]; - var ascending2 = true; - while (v !== edgeObj.w) { - node2 = g.node(v); - if (ascending2) { - while ((pathV = path2[pathIdx]) !== lca && g.node(pathV).maxRank < node2.rank) { - pathIdx++; - } - if (pathV === lca) { - ascending2 = false; - } - } - if (!ascending2) { - while (pathIdx < path2.length - 1 && g.node(pathV = path2[pathIdx + 1]).minRank <= node2.rank) { - pathIdx++; - } - pathV = path2[pathIdx]; - } - g.setParent(v, pathV); - v = g.successors(v)[0]; + var baseSortBy_default; + var init_baseSortBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSortBy.js"() { + "use strict"; + __name(baseSortBy, "baseSortBy"); + baseSortBy_default = baseSortBy; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareAscending.js + function compareAscending(value2, other) { + if (value2 !== other) { + var valIsDefined = value2 !== void 0, valIsNull = value2 === null, valIsReflexive = value2 === value2, valIsSymbol = isSymbol_default(value2); + var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol_default(other); + if (!othIsNull && !othIsSymbol && !valIsSymbol && value2 > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { + return 1; + } + if (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { + return -1; } - }); - } - function findPath(g, postorderNums, v, w2) { - var vPath = []; - var wPath = []; - var low = Math.min(postorderNums[v].low, postorderNums[w2].low); - var lim = Math.max(postorderNums[v].lim, postorderNums[w2].lim); - var parent; - var lca; - parent = v; - do { - parent = g.parent(parent); - vPath.push(parent); - } while (parent && (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); - lca = parent; - parent = w2; - while ((parent = g.parent(parent)) !== lca) { - wPath.push(parent); } - return { path: vPath.concat(wPath.reverse()), lca }; + return 0; } - function postorder(g) { - var result = {}; - var lim = 0; - function dfs2(v) { - var low = lim; - forEach(g.children(v), dfs2); - result[v] = { low, lim: lim++ }; + var compareAscending_default; + var init_compareAscending = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareAscending.js"() { + "use strict"; + init_isSymbol(); + __name(compareAscending, "compareAscending"); + compareAscending_default = compareAscending; } - forEach(g.children(), dfs2); - return result; - } - function findType1Conflicts(g, layering) { - var conflicts = {}; - function visitLayer(prevLayer, layer) { - var k0 = 0, scanPos = 0, prevLayerLength = prevLayer.length, lastNode = last(layer); - forEach(layer, function(v, i2) { - var w2 = findOtherInnerSegmentNode(g, v), k1 = w2 ? g.node(w2).order : prevLayerLength; - if (w2 || v === lastNode) { - forEach(layer.slice(scanPos, i2 + 1), function(scanNode) { - forEach(g.predecessors(scanNode), function(u) { - var uLabel = g.node(u), uPos = uLabel.order; - if ((uPos < k0 || k1 < uPos) && !(uLabel.dummy && g.node(scanNode).dummy)) { - addConflict(conflicts, u, scanNode); - } - }); - }); - scanPos = i2 + 1; - k0 = k1; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareMultiple.js + function compareMultiple(object3, other, orders) { + var index = -1, objCriteria = object3.criteria, othCriteria = other.criteria, length2 = objCriteria.length, ordersLength = orders.length; + while (++index < length2) { + var result = compareAscending_default(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; } - }); - return layer; + var order2 = orders[index]; + return result * (order2 == "desc" ? -1 : 1); + } } - reduce(layering, visitLayer); - return conflicts; + return object3.index - other.index; } - function findType2Conflicts(g, layering) { - var conflicts = {}; - function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { - var v; - forEach(range$1(southPos, southEnd), function(i2) { - v = south[i2]; - if (g.node(v).dummy) { - forEach(g.predecessors(v), function(u) { - var uNode = g.node(u); - if (uNode.dummy && (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { - addConflict(conflicts, u, v); - } - }); - } - }); + var compareMultiple_default; + var init_compareMultiple = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareMultiple.js"() { + "use strict"; + init_compareAscending(); + __name(compareMultiple, "compareMultiple"); + compareMultiple_default = compareMultiple; } - function visitLayer(north, south) { - var prevNorthPos = -1, nextNorthPos, southPos = 0; - forEach(south, function(v, southLookahead) { - if (g.node(v).dummy === "border") { - var predecessors = g.predecessors(v); - if (predecessors.length) { - nextNorthPos = g.node(predecessors[0]).order; - scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); - southPos = southLookahead; - prevNorthPos = nextNorthPos; - } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseOrderBy.js + function baseOrderBy(collection4, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap_default(iteratees, function(iteratee) { + if (isArray_default(iteratee)) { + return function(value2) { + return baseGet_default(value2, iteratee.length === 1 ? iteratee[0] : iteratee); + }; } - scan(south, southPos, south.length, nextNorthPos, north.length); + return iteratee; }); - return south; + } else { + iteratees = [identity_default4]; } - reduce(layering, visitLayer); - return conflicts; - } - function findOtherInnerSegmentNode(g, v) { - if (g.node(v).dummy) { - return find$2(g.predecessors(v), function(u) { - return g.node(u).dummy; + var index = -1; + iteratees = arrayMap_default(iteratees, baseUnary_default(baseIteratee_default)); + var result = baseMap_default(collection4, function(value2, key, collection5) { + var criteria = arrayMap_default(iteratees, function(iteratee) { + return iteratee(value2); }); - } + return { "criteria": criteria, "index": ++index, "value": value2 }; + }); + return baseSortBy_default(result, function(object3, other) { + return compareMultiple_default(object3, other, orders); + }); } - function addConflict(conflicts, v, w2) { - if (v > w2) { - var tmp = v; - v = w2; - w2 = tmp; + var baseOrderBy_default; + var init_baseOrderBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseOrderBy.js"() { + "use strict"; + init_arrayMap(); + init_baseGet(); + init_baseIteratee(); + init_baseMap(); + init_baseSortBy(); + init_baseUnary(); + init_compareMultiple(); + init_identity4(); + init_isArray(); + __name(baseOrderBy, "baseOrderBy"); + baseOrderBy_default = baseOrderBy; } - var conflictsV = conflicts[v]; - if (!conflictsV) { - conflicts[v] = conflictsV = {}; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiSize.js + var asciiSize, asciiSize_default; + var init_asciiSize = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiSize.js"() { + "use strict"; + init_baseProperty(); + asciiSize = baseProperty_default("length"); + asciiSize_default = asciiSize; } - conflictsV[w2] = true; - } - function hasConflict(conflicts, v, w2) { - if (v > w2) { - var tmp = v; - v = w2; - w2 = tmp; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeSize.js + function unicodeSize(string3) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string3)) { + ++result; } - return has(conflicts[v], w2); + return result; } - function verticalAlignment(g, layering, conflicts, neighborFn) { - var root2 = {}, align = {}, pos = {}; - forEach(layering, function(layer) { - forEach(layer, function(v, order2) { - root2[v] = v; - align[v] = v; - pos[v] = order2; - }); - }); - forEach(layering, function(layer) { - var prevIdx = -1; - forEach(layer, function(v) { - var ws = neighborFn(v); - if (ws.length) { - ws = sortBy$1(ws, function(w3) { - return pos[w3]; - }); - var mp = (ws.length - 1) / 2; - for (var i2 = Math.floor(mp), il = Math.ceil(mp); i2 <= il; ++i2) { - var w2 = ws[i2]; - if (align[v] === v && prevIdx < pos[w2] && !hasConflict(conflicts, v, w2)) { - align[w2] = v; - align[v] = root2[v] = root2[w2]; - prevIdx = pos[w2]; - } - } - } - }); + var rsAstralRange2, rsComboMarksRange2, reComboHalfMarksRange2, rsComboSymbolsRange2, rsComboRange2, rsVarRange2, rsAstral, rsCombo, rsFitz, rsModifier, rsNonAstral, rsRegional, rsSurrPair, rsZWJ2, reOptMod, rsOptVar, rsOptJoin, rsSeq, rsSymbol, reUnicode, unicodeSize_default; + var init_unicodeSize = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeSize.js"() { + "use strict"; + rsAstralRange2 = "\\ud800-\\udfff"; + rsComboMarksRange2 = "\\u0300-\\u036f"; + reComboHalfMarksRange2 = "\\ufe20-\\ufe2f"; + rsComboSymbolsRange2 = "\\u20d0-\\u20ff"; + rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2; + rsVarRange2 = "\\ufe0e\\ufe0f"; + rsAstral = "[" + rsAstralRange2 + "]"; + rsCombo = "[" + rsComboRange2 + "]"; + rsFitz = "\\ud83c[\\udffb-\\udfff]"; + rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")"; + rsNonAstral = "[^" + rsAstralRange2 + "]"; + rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + rsZWJ2 = "\\u200d"; + reOptMod = rsModifier + "?"; + rsOptVar = "[" + rsVarRange2 + "]?"; + rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*"; + rsSeq = rsOptVar + reOptMod + rsOptJoin; + rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; + reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); + __name(unicodeSize, "unicodeSize"); + unicodeSize_default = unicodeSize; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringSize.js + function stringSize(string3) { + return hasUnicode_default(string3) ? unicodeSize_default(string3) : asciiSize_default(string3); + } + var stringSize_default; + var init_stringSize = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringSize.js"() { + "use strict"; + init_asciiSize(); + init_hasUnicode(); + init_unicodeSize(); + __name(stringSize, "stringSize"); + stringSize_default = stringSize; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePick.js + function basePick(object3, paths) { + return basePickBy_default(object3, paths, function(value2, path4) { + return hasIn_default(object3, path4); }); - return { root: root2, align }; } - function horizontalCompaction(g, layering, root2, align, reverseSep) { - var xs = {}, blockG = buildBlockGraph(g, layering, root2, reverseSep), borderType = reverseSep ? "borderLeft" : "borderRight"; - function iterate(setXsFunc, nextNodesFunc) { - var stack = blockG.nodes(); - var elem = stack.pop(); - var visited = {}; - while (elem) { - if (visited[elem]) { - setXsFunc(elem); - } else { - visited[elem] = true; - stack.push(elem); - stack = stack.concat(nextNodesFunc(elem)); - } - elem = stack.pop(); - } + var basePick_default; + var init_basePick = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePick.js"() { + "use strict"; + init_basePickBy(); + init_hasIn(); + __name(basePick, "basePick"); + basePick_default = basePick; } - function pass1(elem) { - xs[elem] = blockG.inEdges(elem).reduce(function(acc, e) { - return Math.max(acc, xs[e.v] + blockG.edge(e)); - }, 0); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pick.js + var pick, pick_default; + var init_pick = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pick.js"() { + "use strict"; + init_basePick(); + init_flatRest(); + pick = flatRest_default(function(object3, paths) { + return object3 == null ? {} : basePick_default(object3, paths); + }); + pick_default = pick; } - function pass2(elem) { - var min2 = blockG.outEdges(elem).reduce(function(acc, e) { - return Math.min(acc, xs[e.w] - blockG.edge(e)); - }, Number.POSITIVE_INFINITY); - var node2 = g.node(elem); - if (min2 !== Number.POSITIVE_INFINITY && node2.borderType !== borderType) { - xs[elem] = Math.max(xs[elem], min2); + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRange.js + function baseRange(start3, end2, step3, fromRight) { + var index = -1, length2 = nativeMax5(nativeCeil((end2 - start3) / (step3 || 1)), 0), result = Array(length2); + while (length2--) { + result[fromRight ? length2 : ++index] = start3; + start3 += step3; + } + return result; + } + var nativeCeil, nativeMax5, baseRange_default; + var init_baseRange = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRange.js"() { + "use strict"; + nativeCeil = Math.ceil; + nativeMax5 = Math.max; + __name(baseRange, "baseRange"); + baseRange_default = baseRange; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createRange.js + function createRange(fromRight) { + return function(start3, end2, step3) { + if (step3 && typeof step3 != "number" && isIterateeCall_default(start3, end2, step3)) { + end2 = step3 = void 0; + } + start3 = toFinite_default(start3); + if (end2 === void 0) { + end2 = start3; + start3 = 0; + } else { + end2 = toFinite_default(end2); } + step3 = step3 === void 0 ? start3 < end2 ? 1 : -1 : toFinite_default(step3); + return baseRange_default(start3, end2, step3, fromRight); + }; + } + var createRange_default; + var init_createRange = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createRange.js"() { + "use strict"; + init_baseRange(); + init_isIterateeCall(); + init_toFinite(); + __name(createRange, "createRange"); + createRange_default = createRange; } - iterate(pass1, blockG.predecessors.bind(blockG)); - iterate(pass2, blockG.successors.bind(blockG)); - forEach(align, function(v) { - xs[v] = xs[root2[v]]; + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/range.js + var range2, range_default; + var init_range2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/range.js"() { + "use strict"; + init_createRange(); + range2 = createRange_default(); + range_default = range2; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseReduce.js + function baseReduce(collection4, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection4, function(value2, index, collection5) { + accumulator = initAccum ? (initAccum = false, value2) : iteratee(accumulator, value2, index, collection5); }); - return xs; + return accumulator; } - function buildBlockGraph(g, layering, root2, reverseSep) { - var blockGraph = new Graph(), graphLabel = g.graph(), sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); - forEach(layering, function(layer) { - var u; - forEach(layer, function(v) { - var vRoot = root2[v]; - blockGraph.setNode(vRoot); - if (u) { - var uRoot = root2[u], prevMax = blockGraph.edge(uRoot, vRoot); - blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); - } - u = v; - }); + var baseReduce_default; + var init_baseReduce = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseReduce.js"() { + "use strict"; + __name(baseReduce, "baseReduce"); + baseReduce_default = baseReduce; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reduce.js + function reduce(collection4, iteratee, accumulator) { + var func = isArray_default(collection4) ? arrayReduce_default : baseReduce_default, initAccum = arguments.length < 3; + return func(collection4, baseIteratee_default(iteratee, 4), accumulator, initAccum, baseEach_default); + } + var reduce_default; + var init_reduce = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reduce.js"() { + "use strict"; + init_arrayReduce(); + init_baseEach(); + init_baseIteratee(); + init_baseReduce(); + init_isArray(); + __name(reduce, "reduce"); + reduce_default = reduce; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reject.js + function reject(collection4, predicate) { + var func = isArray_default(collection4) ? arrayFilter_default : baseFilter_default; + return func(collection4, negate_default(baseIteratee_default(predicate, 3))); + } + var reject_default; + var init_reject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reject.js"() { + "use strict"; + init_arrayFilter(); + init_baseFilter(); + init_baseIteratee(); + init_isArray(); + init_negate(); + __name(reject, "reject"); + reject_default = reject; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/size.js + function size(collection4) { + if (collection4 == null) { + return 0; + } + if (isArrayLike_default(collection4)) { + return isString_default(collection4) ? stringSize_default(collection4) : collection4.length; + } + var tag2 = getTag_default(collection4); + if (tag2 == mapTag8 || tag2 == setTag8) { + return collection4.size; + } + return baseKeys_default(collection4).length; + } + var mapTag8, setTag8, size_default2; + var init_size2 = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/size.js"() { + "use strict"; + init_baseKeys(); + init_getTag(); + init_isArrayLike(); + init_isString(); + init_stringSize(); + mapTag8 = "[object Map]"; + setTag8 = "[object Set]"; + __name(size, "size"); + size_default2 = size; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSome.js + function baseSome(collection4, predicate) { + var result; + baseEach_default(collection4, function(value2, index, collection5) { + result = predicate(value2, index, collection5); + return !result; }); - return blockGraph; + return !!result; } - function findSmallestWidthAlignment(g, xss) { - return minBy(values(xss), function(xs) { - var max2 = Number.NEGATIVE_INFINITY; - var min2 = Number.POSITIVE_INFINITY; - forIn(xs, function(x2, v) { - var halfWidth = width(g, v) / 2; - max2 = Math.max(x2 + halfWidth, max2); - min2 = Math.min(x2 - halfWidth, min2); + var baseSome_default; + var init_baseSome = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSome.js"() { + "use strict"; + init_baseEach(); + __name(baseSome, "baseSome"); + baseSome_default = baseSome; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/some.js + function some(collection4, predicate, guard) { + var func = isArray_default(collection4) ? arraySome_default : baseSome_default; + if (guard && isIterateeCall_default(collection4, predicate, guard)) { + predicate = void 0; + } + return func(collection4, baseIteratee_default(predicate, 3)); + } + var some_default; + var init_some = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/some.js"() { + "use strict"; + init_arraySome(); + init_baseIteratee(); + init_baseSome(); + init_isArray(); + init_isIterateeCall(); + __name(some, "some"); + some_default = some; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/sortBy.js + var sortBy, sortBy_default; + var init_sortBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/sortBy.js"() { + "use strict"; + init_baseFlatten(); + init_baseOrderBy(); + init_baseRest(); + init_isIterateeCall(); + sortBy = baseRest_default(function(collection4, iteratees) { + if (collection4 == null) { + return []; + } + var length2 = iteratees.length; + if (length2 > 1 && isIterateeCall_default(collection4, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length2 > 2 && isIterateeCall_default(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy_default(collection4, baseFlatten_default(iteratees, 1), []); }); - return max2 - min2; - }); - } - function alignCoordinates(xss, alignTo) { - var alignToVals = values(alignTo), alignToMin = min$1(alignToVals), alignToMax = max$1(alignToVals); - forEach(["u", "d"], function(vert) { - forEach(["l", "r"], function(horiz) { - var alignment = vert + horiz, xs = xss[alignment], delta; - if (xs === alignTo) - return; - var xsVals = values(xs); - delta = horiz === "l" ? alignToMin - min$1(xsVals) : alignToMax - max$1(xsVals); - if (delta) { - xss[alignment] = mapValues(xs, function(x2) { - return x2 + delta; - }); + sortBy_default = sortBy; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js + var INFINITY4, createSet, createSet_default; + var init_createSet = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js"() { + "use strict"; + init_Set(); + init_noop2(); + init_setToArray(); + INFINITY4 = 1 / 0; + createSet = !(Set_default && 1 / setToArray_default(new Set_default([, -0]))[1] == INFINITY4) ? noop_default2 : function(values2) { + return new Set_default(values2); + }; + createSet_default = createSet; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js + function baseUniq(array4, iteratee, comparator) { + var index = -1, includes3 = arrayIncludes_default, length2 = array4.length, isCommon2 = true, result = [], seen = result; + if (comparator) { + isCommon2 = false; + includes3 = arrayIncludesWith_default; + } else if (length2 >= LARGE_ARRAY_SIZE3) { + var set6 = iteratee ? null : createSet_default(array4); + if (set6) { + return setToArray_default(set6); + } + isCommon2 = false; + includes3 = cacheHas_default; + seen = new SetCache_default(); + } else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length2) { + var value2 = array4[index], computed = iteratee ? iteratee(value2) : value2; + value2 = comparator || value2 !== 0 ? value2 : 0; + if (isCommon2 && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value2); + } else if (!includes3(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value2); } + } + return result; + } + var LARGE_ARRAY_SIZE3, baseUniq_default; + var init_baseUniq = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js"() { + "use strict"; + init_SetCache(); + init_arrayIncludes(); + init_arrayIncludesWith(); + init_cacheHas(); + init_createSet(); + init_setToArray(); + LARGE_ARRAY_SIZE3 = 200; + __name(baseUniq, "baseUniq"); + baseUniq_default = baseUniq; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/union.js + var union, union_default; + var init_union = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/union.js"() { + "use strict"; + init_baseFlatten(); + init_baseRest(); + init_baseUniq(); + init_isArrayLikeObject(); + union = baseRest_default(function(arrays) { + return baseUniq_default(baseFlatten_default(arrays, 1, isArrayLikeObject_default, true)); }); - }); + union_default = union; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniq.js + function uniq(array4) { + return array4 && array4.length ? baseUniq_default(array4) : []; + } + var uniq_default; + var init_uniq = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniq.js"() { + "use strict"; + init_baseUniq(); + __name(uniq, "uniq"); + uniq_default = uniq; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqBy.js + function uniqBy(array4, iteratee) { + return array4 && array4.length ? baseUniq_default(array4, baseIteratee_default(iteratee, 2)) : []; + } + var uniqBy_default; + var init_uniqBy = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqBy.js"() { + "use strict"; + init_baseIteratee(); + init_baseUniq(); + __name(uniqBy, "uniqBy"); + uniqBy_default = uniqBy; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqueId.js + function uniqueId(prefix) { + var id26 = ++idCounter; + return toString_default(prefix) + id26; + } + var idCounter, uniqueId_default; + var init_uniqueId = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqueId.js"() { + "use strict"; + init_toString(); + idCounter = 0; + __name(uniqueId, "uniqueId"); + uniqueId_default = uniqueId; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseZipObject.js + function baseZipObject(props, values2, assignFunc) { + var index = -1, length2 = props.length, valsLength = values2.length, result = {}; + while (++index < length2) { + var value2 = index < valsLength ? values2[index] : void 0; + assignFunc(result, props[index], value2); + } + return result; } - function balance(xss, align) { - return mapValues(xss.ul, function(ignore, v) { - if (align) { - return xss[align.toLowerCase()][v]; - } else { - var xs = sortBy$1(map(xss, v)); - return (xs[1] + xs[2]) / 2; - } - }); + var baseZipObject_default; + var init_baseZipObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseZipObject.js"() { + "use strict"; + __name(baseZipObject, "baseZipObject"); + baseZipObject_default = baseZipObject; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/zipObject.js + function zipObject(props, values2) { + return baseZipObject_default(props || [], values2 || [], assignValue_default); } - function positionX(g) { - var layering = buildLayerMatrix(g); - var conflicts = merge$3(findType1Conflicts(g, layering), findType2Conflicts(g, layering)); - var xss = {}; - var adjustedLayering; - forEach(["u", "d"], function(vert) { - adjustedLayering = vert === "u" ? layering : values(layering).reverse(); - forEach(["l", "r"], function(horiz) { - if (horiz === "r") { - adjustedLayering = map(adjustedLayering, function(inner2) { - return values(inner2).reverse(); + var zipObject_default; + var init_zipObject = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/zipObject.js"() { + "use strict"; + init_assignValue(); + init_baseZipObject(); + __name(zipObject, "zipObject"); + zipObject_default = zipObject; + } + }); + + // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/lodash.js + var init_lodash = __esm({ + "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/lodash.js"() { + "use strict"; + init_assign(); + init_clone2(); + init_cloneDeep(); + init_compact(); + init_constant7(); + init_defaults(); + init_difference(); + init_drop(); + init_dropRight(); + init_each2(); + init_every(); + init_filter3(); + init_find(); + init_first(); + init_flatMap(); + init_flatten(); + init_forEach(); + init_forIn(); + init_forOwn(); + init_groupBy(); + init_has(); + init_identity4(); + init_includes(); + init_indexOf(); + init_isArray(); + init_isEmpty(); + init_isFunction(); + init_isObject(); + init_isRegExp(); + init_isString(); + init_isUndefined(); + init_keys(); + init_last(); + init_map(); + init_mapValues(); + init_max2(); + init_merge3(); + init_min2(); + init_minBy(); + init_noop2(); + init_now(); + init_pick(); + init_pickBy(); + init_range2(); + init_reduce(); + init_reject(); + init_size2(); + init_some(); + init_sortBy(); + init_union(); + init_uniq(); + init_uniqueId(); + init_values(); + init_zipObject(); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/graph.js + function incrementOrInitEntry(map5, k2) { + if (map5[k2]) { + map5[k2]++; + } else { + map5[k2] = 1; + } + } + function decrementOrRemoveEntry(map5, k2) { + if (!--map5[k2]) { + delete map5[k2]; + } + } + function edgeArgsToId(isDirected, v_, w_, name) { + var v3 = "" + v_; + var w3 = "" + w_; + if (!isDirected && v3 > w3) { + var tmp = v3; + v3 = w3; + w3 = tmp; + } + return v3 + EDGE_KEY_DELIM + w3 + EDGE_KEY_DELIM + (isUndefined_default(name) ? DEFAULT_EDGE_NAME : name); + } + function edgeArgsToObj(isDirected, v_, w_, name) { + var v3 = "" + v_; + var w3 = "" + w_; + if (!isDirected && v3 > w3) { + var tmp = v3; + v3 = w3; + w3 = tmp; + } + var edgeObj = { v: v3, w: w3 }; + if (name) { + edgeObj.name = name; + } + return edgeObj; + } + function edgeObjToId(isDirected, edgeObj) { + return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); + } + var DEFAULT_EDGE_NAME, GRAPH_NODE, EDGE_KEY_DELIM, Graph; + var init_graph = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/graph.js"() { + "use strict"; + init_lodash(); + DEFAULT_EDGE_NAME = "\0"; + GRAPH_NODE = "\0"; + EDGE_KEY_DELIM = ""; + Graph = class { + static { + __name(this, "Graph"); + } + constructor(opts = {}) { + this._isDirected = has_default(opts, "directed") ? opts.directed : true; + this._isMultigraph = has_default(opts, "multigraph") ? opts.multigraph : false; + this._isCompound = has_default(opts, "compound") ? opts.compound : false; + this._label = void 0; + this._defaultNodeLabelFn = constant_default6(void 0); + this._defaultEdgeLabelFn = constant_default6(void 0); + this._nodes = {}; + if (this._isCompound) { + this._parent = {}; + this._children = {}; + this._children[GRAPH_NODE] = {}; + } + this._in = {}; + this._preds = {}; + this._out = {}; + this._sucs = {}; + this._edgeObjs = {}; + this._edgeLabels = {}; + } + /* === Graph functions ========= */ + isDirected() { + return this._isDirected; + } + isMultigraph() { + return this._isMultigraph; + } + isCompound() { + return this._isCompound; + } + setGraph(label) { + this._label = label; + return this; + } + graph() { + return this._label; + } + /* === Node functions ========== */ + setDefaultNodeLabel(newDefault) { + if (!isFunction_default(newDefault)) { + newDefault = constant_default6(newDefault); + } + this._defaultNodeLabelFn = newDefault; + return this; + } + nodeCount() { + return this._nodeCount; + } + nodes() { + return keys_default(this._nodes); + } + sources() { + var self2 = this; + return filter_default3(this.nodes(), function(v3) { + return isEmpty_default(self2._in[v3]); }); } - var neighborFn = (vert === "u" ? g.predecessors : g.successors).bind(g); - var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); - var xs = horizontalCompaction(g, adjustedLayering, align.root, align.align, horiz === "r"); - if (horiz === "r") { - xs = mapValues(xs, function(x2) { - return -x2; + sinks() { + var self2 = this; + return filter_default3(this.nodes(), function(v3) { + return isEmpty_default(self2._out[v3]); }); } - xss[vert + horiz] = xs; - }); - }); - var smallestWidth = findSmallestWidthAlignment(g, xss); - alignCoordinates(xss, smallestWidth); - return balance(xss, g.graph().align); + setNodes(vs, value2) { + var args = arguments; + var self2 = this; + forEach_default(vs, function(v3) { + if (args.length > 1) { + self2.setNode(v3, value2); + } else { + self2.setNode(v3); + } + }); + return this; + } + setNode(v3, value2) { + if (has_default(this._nodes, v3)) { + if (arguments.length > 1) { + this._nodes[v3] = value2; + } + return this; + } + this._nodes[v3] = arguments.length > 1 ? value2 : this._defaultNodeLabelFn(v3); + if (this._isCompound) { + this._parent[v3] = GRAPH_NODE; + this._children[v3] = {}; + this._children[GRAPH_NODE][v3] = true; + } + this._in[v3] = {}; + this._preds[v3] = {}; + this._out[v3] = {}; + this._sucs[v3] = {}; + ++this._nodeCount; + return this; + } + node(v3) { + return this._nodes[v3]; + } + hasNode(v3) { + return has_default(this._nodes, v3); + } + removeNode(v3) { + var self2 = this; + if (has_default(this._nodes, v3)) { + var removeEdge = /* @__PURE__ */ __name(function(e3) { + self2.removeEdge(self2._edgeObjs[e3]); + }, "removeEdge"); + delete this._nodes[v3]; + if (this._isCompound) { + this._removeFromParentsChildList(v3); + delete this._parent[v3]; + forEach_default(this.children(v3), function(child) { + self2.setParent(child); + }); + delete this._children[v3]; + } + forEach_default(keys_default(this._in[v3]), removeEdge); + delete this._in[v3]; + delete this._preds[v3]; + forEach_default(keys_default(this._out[v3]), removeEdge); + delete this._out[v3]; + delete this._sucs[v3]; + --this._nodeCount; + } + return this; + } + setParent(v3, parent4) { + if (!this._isCompound) { + throw new Error("Cannot set parent in a non-compound graph"); + } + if (isUndefined_default(parent4)) { + parent4 = GRAPH_NODE; + } else { + parent4 += ""; + for (var ancestor = parent4; !isUndefined_default(ancestor); ancestor = this.parent(ancestor)) { + if (ancestor === v3) { + throw new Error("Setting " + parent4 + " as parent of " + v3 + " would create a cycle"); + } + } + this.setNode(parent4); + } + this.setNode(v3); + this._removeFromParentsChildList(v3); + this._parent[v3] = parent4; + this._children[parent4][v3] = true; + return this; + } + _removeFromParentsChildList(v3) { + delete this._children[this._parent[v3]][v3]; + } + parent(v3) { + if (this._isCompound) { + var parent4 = this._parent[v3]; + if (parent4 !== GRAPH_NODE) { + return parent4; + } + } + } + children(v3) { + if (isUndefined_default(v3)) { + v3 = GRAPH_NODE; + } + if (this._isCompound) { + var children2 = this._children[v3]; + if (children2) { + return keys_default(children2); + } + } else if (v3 === GRAPH_NODE) { + return this.nodes(); + } else if (this.hasNode(v3)) { + return []; + } + } + predecessors(v3) { + var predsV = this._preds[v3]; + if (predsV) { + return keys_default(predsV); + } + } + successors(v3) { + var sucsV = this._sucs[v3]; + if (sucsV) { + return keys_default(sucsV); + } + } + neighbors(v3) { + var preds = this.predecessors(v3); + if (preds) { + return union_default(preds, this.successors(v3)); + } + } + isLeaf(v3) { + var neighbors; + if (this.isDirected()) { + neighbors = this.successors(v3); + } else { + neighbors = this.neighbors(v3); + } + return neighbors.length === 0; + } + filterNodes(filter6) { + var copy6 = new this.constructor({ + directed: this._isDirected, + multigraph: this._isMultigraph, + compound: this._isCompound + }); + copy6.setGraph(this.graph()); + var self2 = this; + forEach_default(this._nodes, function(value2, v3) { + if (filter6(v3)) { + copy6.setNode(v3, value2); + } + }); + forEach_default(this._edgeObjs, function(e3) { + if (copy6.hasNode(e3.v) && copy6.hasNode(e3.w)) { + copy6.setEdge(e3, self2.edge(e3)); + } + }); + var parents4 = {}; + function findParent(v3) { + var parent4 = self2.parent(v3); + if (parent4 === void 0 || copy6.hasNode(parent4)) { + parents4[v3] = parent4; + return parent4; + } else if (parent4 in parents4) { + return parents4[parent4]; + } else { + return findParent(parent4); + } + } + __name(findParent, "findParent"); + if (this._isCompound) { + forEach_default(copy6.nodes(), function(v3) { + copy6.setParent(v3, findParent(v3)); + }); + } + return copy6; + } + /* === Edge functions ========== */ + setDefaultEdgeLabel(newDefault) { + if (!isFunction_default(newDefault)) { + newDefault = constant_default6(newDefault); + } + this._defaultEdgeLabelFn = newDefault; + return this; + } + edgeCount() { + return this._edgeCount; + } + edges() { + return values_default(this._edgeObjs); + } + setPath(vs, value2) { + var self2 = this; + var args = arguments; + reduce_default(vs, function(v3, w3) { + if (args.length > 1) { + self2.setEdge(v3, w3, value2); + } else { + self2.setEdge(v3, w3); + } + return w3; + }); + return this; + } + /* + * setEdge(v, w, [value, [name]]) + * setEdge({ v, w, [name] }, [value]) + */ + setEdge() { + var v3, w3, name, value2; + var valueSpecified = false; + var arg0 = arguments[0]; + if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) { + v3 = arg0.v; + w3 = arg0.w; + name = arg0.name; + if (arguments.length === 2) { + value2 = arguments[1]; + valueSpecified = true; + } + } else { + v3 = arg0; + w3 = arguments[1]; + name = arguments[3]; + if (arguments.length > 2) { + value2 = arguments[2]; + valueSpecified = true; + } + } + v3 = "" + v3; + w3 = "" + w3; + if (!isUndefined_default(name)) { + name = "" + name; + } + var e3 = edgeArgsToId(this._isDirected, v3, w3, name); + if (has_default(this._edgeLabels, e3)) { + if (valueSpecified) { + this._edgeLabels[e3] = value2; + } + return this; + } + if (!isUndefined_default(name) && !this._isMultigraph) { + throw new Error("Cannot set a named edge when isMultigraph = false"); + } + this.setNode(v3); + this.setNode(w3); + this._edgeLabels[e3] = valueSpecified ? value2 : this._defaultEdgeLabelFn(v3, w3, name); + var edgeObj = edgeArgsToObj(this._isDirected, v3, w3, name); + v3 = edgeObj.v; + w3 = edgeObj.w; + Object.freeze(edgeObj); + this._edgeObjs[e3] = edgeObj; + incrementOrInitEntry(this._preds[w3], v3); + incrementOrInitEntry(this._sucs[v3], w3); + this._in[w3][e3] = edgeObj; + this._out[v3][e3] = edgeObj; + this._edgeCount++; + return this; + } + edge(v3, w3, name) { + var e3 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v3, w3, name); + return this._edgeLabels[e3]; + } + hasEdge(v3, w3, name) { + var e3 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v3, w3, name); + return has_default(this._edgeLabels, e3); + } + removeEdge(v3, w3, name) { + var e3 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v3, w3, name); + var edge = this._edgeObjs[e3]; + if (edge) { + v3 = edge.v; + w3 = edge.w; + delete this._edgeLabels[e3]; + delete this._edgeObjs[e3]; + decrementOrRemoveEntry(this._preds[w3], v3); + decrementOrRemoveEntry(this._sucs[v3], w3); + delete this._in[w3][e3]; + delete this._out[v3][e3]; + this._edgeCount--; + } + return this; + } + inEdges(v3, u2) { + var inV = this._in[v3]; + if (inV) { + var edges5 = values_default(inV); + if (!u2) { + return edges5; + } + return filter_default3(edges5, function(edge) { + return edge.v === u2; + }); + } + } + outEdges(v3, w3) { + var outV = this._out[v3]; + if (outV) { + var edges5 = values_default(outV); + if (!w3) { + return edges5; + } + return filter_default3(edges5, function(edge) { + return edge.w === w3; + }); + } + } + nodeEdges(v3, w3) { + var inEdges = this.inEdges(v3, w3); + if (inEdges) { + return inEdges.concat(this.outEdges(v3, w3)); + } + } + }; + Graph.prototype._nodeCount = 0; + Graph.prototype._edgeCount = 0; + __name(incrementOrInitEntry, "incrementOrInitEntry"); + __name(decrementOrRemoveEntry, "decrementOrRemoveEntry"); + __name(edgeArgsToId, "edgeArgsToId"); + __name(edgeArgsToObj, "edgeArgsToObj"); + __name(edgeObjToId, "edgeObjToId"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/index.js + var init_graphlib = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/index.js"() { + "use strict"; + init_graph(); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/data/list.js + function unlink(entry) { + entry._prev._next = entry._next; + entry._next._prev = entry._prev; + delete entry._next; + delete entry._prev; } - function sep(nodeSep, edgeSep, reverseSep) { - return function(g, v, w2) { - var vLabel = g.node(v); - var wLabel = g.node(w2); - var sum2 = 0; - var delta; - sum2 += vLabel.width / 2; - if (has(vLabel, "labelpos")) { - switch (vLabel.labelpos.toLowerCase()) { - case "l": - delta = -vLabel.width / 2; - break; - case "r": - delta = vLabel.width / 2; - break; + function filterOutLinks(k2, v3) { + if (k2 !== "_next" && k2 !== "_prev") { + return v3; + } + } + var List; + var init_list = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/data/list.js"() { + "use strict"; + List = class { + static { + __name(this, "List"); + } + constructor() { + var sentinel = {}; + sentinel._next = sentinel._prev = sentinel; + this._sentinel = sentinel; + } + dequeue() { + var sentinel = this._sentinel; + var entry = sentinel._prev; + if (entry !== sentinel) { + unlink(entry); + return entry; + } } + enqueue(entry) { + var sentinel = this._sentinel; + if (entry._prev && entry._next) { + unlink(entry); + } + entry._next = sentinel._next; + sentinel._next._prev = entry; + sentinel._next = entry; + entry._prev = sentinel; + } + toString() { + var strs = []; + var sentinel = this._sentinel; + var curr = sentinel._prev; + while (curr !== sentinel) { + strs.push(JSON.stringify(curr, filterOutLinks)); + curr = curr._prev; + } + return "[" + strs.join(", ") + "]"; + } + }; + __name(unlink, "unlink"); + __name(filterOutLinks, "filterOutLinks"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/greedy-fas.js + function greedyFAS(g2, weightFn) { + if (g2.nodeCount() <= 1) { + return []; + } + var state4 = buildState(g2, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state4.graph, state4.buckets, state4.zeroIdx); + return flatten_default( + map_default(results, function(e3) { + return g2.outEdges(e3.v, e3.w); + }) + ); + } + function doGreedyFAS(g2, buckets, zeroIdx) { + var results = []; + var sources = buckets[buckets.length - 1]; + var sinks = buckets[0]; + var entry; + while (g2.nodeCount()) { + while (entry = sinks.dequeue()) { + removeNode(g2, buckets, zeroIdx, entry); } - if (delta) { - sum2 += reverseSep ? delta : -delta; + while (entry = sources.dequeue()) { + removeNode(g2, buckets, zeroIdx, entry); } - delta = 0; - sum2 += (vLabel.dummy ? edgeSep : nodeSep) / 2; - sum2 += (wLabel.dummy ? edgeSep : nodeSep) / 2; - sum2 += wLabel.width / 2; - if (has(wLabel, "labelpos")) { - switch (wLabel.labelpos.toLowerCase()) { - case "l": - delta = wLabel.width / 2; - break; - case "r": - delta = -wLabel.width / 2; + if (g2.nodeCount()) { + for (var i2 = buckets.length - 2; i2 > 0; --i2) { + entry = buckets[i2].dequeue(); + if (entry) { + results = results.concat(removeNode(g2, buckets, zeroIdx, entry, true)); break; + } } } - if (delta) { - sum2 += reverseSep ? delta : -delta; - } - delta = 0; - return sum2; - }; - } - function width(g, v) { - return g.node(v).width; - } - function position$1(g) { - g = asNonCompoundGraph(g); - positionY(g); - forOwn(positionX(g), function(x2, v) { - g.node(v).x = x2; - }); + } + return results; } - function positionY(g) { - var layering = buildLayerMatrix(g); - var rankSep = g.graph().ranksep; - var prevY = 0; - forEach(layering, function(layer) { - var maxHeight = max$1( - map(layer, function(v) { - return g.node(v).height; - }) - ); - forEach(layer, function(v) { - g.node(v).y = prevY + maxHeight / 2; - }); - prevY += maxHeight + rankSep; + function removeNode(g2, buckets, zeroIdx, entry, collectPredecessors) { + var results = collectPredecessors ? [] : void 0; + forEach_default(g2.inEdges(entry.v), function(edge) { + var weight8 = g2.edge(edge); + var uEntry = g2.node(edge.v); + if (collectPredecessors) { + results.push({ v: edge.v, w: edge.w }); + } + uEntry.out -= weight8; + assignBucket(buckets, zeroIdx, uEntry); }); - } - function layout$1(g, opts) { - var time$12 = opts && opts.debugTiming ? time : notime; - time$12("layout", function() { - var layoutGraph = time$12(" buildLayoutGraph", function() { - return buildLayoutGraph(g); - }); - time$12(" runLayout", function() { - runLayout(layoutGraph, time$12); - }); - time$12(" updateInputGraph", function() { - updateInputGraph(g, layoutGraph); - }); + forEach_default(g2.outEdges(entry.v), function(edge) { + var weight8 = g2.edge(edge); + var w3 = edge.w; + var wEntry = g2.node(w3); + wEntry["in"] -= weight8; + assignBucket(buckets, zeroIdx, wEntry); }); + g2.removeNode(entry.v); + return results; } - function runLayout(g, time2) { - time2(" makeSpaceForEdgeLabels", function() { - makeSpaceForEdgeLabels(g); - }); - time2(" removeSelfEdges", function() { - removeSelfEdges(g); - }); - time2(" acyclic", function() { - run$2(g); - }); - time2(" nestingGraph.run", function() { - run(g); - }); - time2(" rank", function() { - rank(asNonCompoundGraph(g)); - }); - time2(" injectEdgeLabelProxies", function() { - injectEdgeLabelProxies(g); - }); - time2(" removeEmptyRanks", function() { - removeEmptyRanks(g); - }); - time2(" nestingGraph.cleanup", function() { - cleanup(g); - }); - time2(" normalizeRanks", function() { - normalizeRanks(g); - }); - time2(" assignRankMinMax", function() { - assignRankMinMax(g); - }); - time2(" removeEdgeLabelProxies", function() { - removeEdgeLabelProxies(g); - }); - time2(" normalize.run", function() { - run$1(g); - }); - time2(" parentDummyChains", function() { - parentDummyChains(g); - }); - time2(" addBorderSegments", function() { - addBorderSegments(g); - }); - time2(" order", function() { - order(g); - }); - time2(" insertSelfEdges", function() { - insertSelfEdges(g); - }); - time2(" adjustCoordinateSystem", function() { - adjust(g); - }); - time2(" position", function() { - position$1(g); - }); - time2(" positionSelfEdges", function() { - positionSelfEdges(g); - }); - time2(" removeBorderNodes", function() { - removeBorderNodes(g); - }); - time2(" normalize.undo", function() { - undo(g); - }); - time2(" fixupEdgeLabelCoords", function() { - fixupEdgeLabelCoords(g); - }); - time2(" undoCoordinateSystem", function() { - undo$1(g); - }); - time2(" translateGraph", function() { - translateGraph(g); + function buildState(g2, weightFn) { + var fasGraph = new Graph(); + var maxIn = 0; + var maxOut = 0; + forEach_default(g2.nodes(), function(v3) { + fasGraph.setNode(v3, { v: v3, in: 0, out: 0 }); }); - time2(" assignNodeIntersects", function() { - assignNodeIntersects(g); + forEach_default(g2.edges(), function(e3) { + var prevWeight = fasGraph.edge(e3.v, e3.w) || 0; + var weight8 = weightFn(e3); + var edgeWeight = prevWeight + weight8; + fasGraph.setEdge(e3.v, e3.w, edgeWeight); + maxOut = Math.max(maxOut, fasGraph.node(e3.v).out += weight8); + maxIn = Math.max(maxIn, fasGraph.node(e3.w)["in"] += weight8); }); - time2(" reversePoints", function() { - reversePointsForReversedEdges(g); + var buckets = range_default(maxOut + maxIn + 3).map(function() { + return new List(); }); - time2(" acyclic.undo", function() { - undo$2(g); + var zeroIdx = maxIn + 1; + forEach_default(fasGraph.nodes(), function(v3) { + assignBucket(buckets, zeroIdx, fasGraph.node(v3)); }); + return { graph: fasGraph, buckets, zeroIdx }; } - function updateInputGraph(inputGraph, layoutGraph) { - forEach(inputGraph.nodes(), function(v) { - var inputLabel = inputGraph.node(v); - var layoutLabel = layoutGraph.node(v); - if (inputLabel) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - if (layoutGraph.children(v).length) { - inputLabel.width = layoutLabel.width; - inputLabel.height = layoutLabel.height; - } - } - }); - forEach(inputGraph.edges(), function(e) { - var inputLabel = inputGraph.edge(e); - var layoutLabel = layoutGraph.edge(e); - inputLabel.points = layoutLabel.points; - if (has(layoutLabel, "x")) { - inputLabel.x = layoutLabel.x; - inputLabel.y = layoutLabel.y; - } - }); - inputGraph.graph().width = layoutGraph.graph().width; - inputGraph.graph().height = layoutGraph.graph().height; + function assignBucket(buckets, zeroIdx, entry) { + if (!entry.out) { + buckets[0].enqueue(entry); + } else if (!entry["in"]) { + buckets[buckets.length - 1].enqueue(entry); + } else { + buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); + } } - var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"]; - var graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }; - var graphAttrs = ["acyclicer", "ranker", "rankdir", "align"]; - var nodeNumAttrs = ["width", "height"]; - var nodeDefaults = { width: 0, height: 0 }; - var edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"]; - var edgeDefaults = { - minlen: 1, - weight: 1, - width: 0, - height: 0, - labeloffset: 10, - labelpos: "r" - }; - var edgeAttrs = ["labelpos"]; - function buildLayoutGraph(inputGraph) { - var g = new Graph({ multigraph: true, compound: true }); - var graph = canonicalize(inputGraph.graph()); - g.setGraph( - merge$3({}, graphDefaults, selectNumberAttrs(graph, graphNumAttrs), pick$1(graph, graphAttrs)) - ); - forEach(inputGraph.nodes(), function(v) { - var node2 = canonicalize(inputGraph.node(v)); - g.setNode(v, defaults$1(selectNumberAttrs(node2, nodeNumAttrs), nodeDefaults)); - g.setParent(v, inputGraph.parent(v)); - }); - forEach(inputGraph.edges(), function(e) { - var edge = canonicalize(inputGraph.edge(e)); - g.setEdge( - e, - merge$3({}, edgeDefaults, selectNumberAttrs(edge, edgeNumAttrs), pick$1(edge, edgeAttrs)) - ); + var DEFAULT_WEIGHT_FN; + var init_greedy_fas = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/greedy-fas.js"() { + "use strict"; + init_lodash(); + init_graphlib(); + init_list(); + DEFAULT_WEIGHT_FN = constant_default6(1); + __name(greedyFAS, "greedyFAS"); + __name(doGreedyFAS, "doGreedyFAS"); + __name(removeNode, "removeNode"); + __name(buildState, "buildState"); + __name(assignBucket, "assignBucket"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/acyclic.js + function run(g2) { + var fas = g2.graph().acyclicer === "greedy" ? greedyFAS(g2, weightFn(g2)) : dfsFAS(g2); + forEach_default(fas, function(e3) { + var label = g2.edge(e3); + g2.removeEdge(e3); + label.forwardName = e3.name; + label.reversed = true; + g2.setEdge(e3.w, e3.v, label, uniqueId_default("rev")); }); - return g; + function weightFn(g3) { + return function(e3) { + return g3.edge(e3).weight; + }; + } + __name(weightFn, "weightFn"); } - function makeSpaceForEdgeLabels(g) { - var graph = g.graph(); - graph.ranksep /= 2; - forEach(g.edges(), function(e) { - var edge = g.edge(e); - edge.minlen *= 2; - if (edge.labelpos.toLowerCase() !== "c") { - if (graph.rankdir === "TB" || graph.rankdir === "BT") { - edge.width += edge.labeloffset; + function dfsFAS(g2) { + var fas = []; + var stack = {}; + var visited = {}; + function dfs3(v3) { + if (has_default(visited, v3)) { + return; + } + visited[v3] = true; + stack[v3] = true; + forEach_default(g2.outEdges(v3), function(e3) { + if (has_default(stack, e3.w)) { + fas.push(e3); } else { - edge.height += edge.labeloffset; + dfs3(e3.w); } - } - }); + }); + delete stack[v3]; + } + __name(dfs3, "dfs"); + forEach_default(g2.nodes(), dfs3); + return fas; } - function injectEdgeLabelProxies(g) { - forEach(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.width && edge.height) { - var v = g.node(e.v); - var w2 = g.node(e.w); - var label = { rank: (w2.rank - v.rank) / 2 + v.rank, e }; - addDummyNode(g, "edge-proxy", label, "_ep"); + function undo(g2) { + forEach_default(g2.edges(), function(e3) { + var label = g2.edge(e3); + if (label.reversed) { + g2.removeEdge(e3); + var forwardName = label.forwardName; + delete label.reversed; + delete label.forwardName; + g2.setEdge(e3.w, e3.v, label, forwardName); } }); } - function assignRankMinMax(g) { - var maxRank2 = 0; - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - if (node2.borderTop) { - node2.minRank = g.node(node2.borderTop).rank; - node2.maxRank = g.node(node2.borderBottom).rank; - maxRank2 = max$1(maxRank2, node2.maxRank); - } + var init_acyclic = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/acyclic.js"() { + "use strict"; + init_lodash(); + init_greedy_fas(); + __name(run, "run"); + __name(dfsFAS, "dfsFAS"); + __name(undo, "undo"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/util.js + function addDummyNode(g2, type3, attrs, name) { + var v3; + do { + v3 = uniqueId_default(name); + } while (g2.hasNode(v3)); + attrs.dummy = type3; + g2.setNode(v3, attrs); + return v3; + } + function simplify(g2) { + var simplified = new Graph().setGraph(g2.graph()); + forEach_default(g2.nodes(), function(v3) { + simplified.setNode(v3, g2.node(v3)); }); - g.graph().maxRank = maxRank2; - } - function removeEdgeLabelProxies(g) { - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - if (node2.dummy === "edge-proxy") { - g.edge(node2.e).labelRank = node2.rank; - g.removeNode(v); - } + forEach_default(g2.edges(), function(e3) { + var simpleLabel = simplified.edge(e3.v, e3.w) || { weight: 0, minlen: 1 }; + var label = g2.edge(e3); + simplified.setEdge(e3.v, e3.w, { + weight: simpleLabel.weight + label.weight, + minlen: Math.max(simpleLabel.minlen, label.minlen) + }); }); + return simplified; } - function translateGraph(g) { - var minX = Number.POSITIVE_INFINITY; - var maxX = 0; - var minY = Number.POSITIVE_INFINITY; - var maxY = 0; - var graphLabel = g.graph(); - var marginX = graphLabel.marginx || 0; - var marginY = graphLabel.marginy || 0; - function getExtremes(attrs) { - var x2 = attrs.x; - var y2 = attrs.y; - var w2 = attrs.width; - var h = attrs.height; - minX = Math.min(minX, x2 - w2 / 2); - maxX = Math.max(maxX, x2 + w2 / 2); - minY = Math.min(minY, y2 - h / 2); - maxY = Math.max(maxY, y2 + h / 2); - } - forEach(g.nodes(), function(v) { - getExtremes(g.node(v)); - }); - forEach(g.edges(), function(e) { - var edge = g.edge(e); - if (has(edge, "x")) { - getExtremes(edge); + function asNonCompoundGraph(g2) { + var simplified = new Graph({ multigraph: g2.isMultigraph() }).setGraph(g2.graph()); + forEach_default(g2.nodes(), function(v3) { + if (!g2.children(v3).length) { + simplified.setNode(v3, g2.node(v3)); } }); - minX -= marginX; - minY -= marginY; - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - node2.x -= minX; - node2.y -= minY; + forEach_default(g2.edges(), function(e3) { + simplified.setEdge(e3, g2.edge(e3)); }); - forEach(g.edges(), function(e) { - var edge = g.edge(e); - forEach(edge.points, function(p) { - p.x -= minX; - p.y -= minY; - }); - if (has(edge, "x")) { - edge.x -= minX; + return simplified; + } + function intersectRect3(rect4, point8) { + var x5 = rect4.x; + var y5 = rect4.y; + var dx = point8.x - x5; + var dy = point8.y - y5; + var w3 = rect4.width / 2; + var h2 = rect4.height / 2; + if (!dx && !dy) { + throw new Error("Not possible to find intersection inside of the rectangle"); + } + var sx, sy; + if (Math.abs(dy) * w3 > Math.abs(dx) * h2) { + if (dy < 0) { + h2 = -h2; } - if (has(edge, "y")) { - edge.y -= minY; + sx = h2 * dx / dy; + sy = h2; + } else { + if (dx < 0) { + w3 = -w3; } - }); - graphLabel.width = maxX - minX + marginX; - graphLabel.height = maxY - minY + marginY; + sx = w3; + sy = w3 * dy / dx; + } + return { x: x5 + sx, y: y5 + sy }; } - function assignNodeIntersects(g) { - forEach(g.edges(), function(e) { - var edge = g.edge(e); - var nodeV = g.node(e.v); - var nodeW = g.node(e.w); - var p1, p2; - if (!edge.points) { - edge.points = []; - p1 = nodeW; - p2 = nodeV; - } else { - p1 = edge.points[0]; - p2 = edge.points[edge.points.length - 1]; - } - edge.points.unshift(intersectRect$3(nodeV, p1)); - edge.points.push(intersectRect$3(nodeW, p2)); + function buildLayerMatrix(g2) { + var layering = map_default(range_default(maxRank(g2) + 1), function() { + return []; }); - } - function fixupEdgeLabelCoords(g) { - forEach(g.edges(), function(e) { - var edge = g.edge(e); - if (has(edge, "x")) { - if (edge.labelpos === "l" || edge.labelpos === "r") { - edge.width -= edge.labeloffset; - } - switch (edge.labelpos) { - case "l": - edge.x -= edge.width / 2 + edge.labeloffset; - break; - case "r": - edge.x += edge.width / 2 + edge.labeloffset; - break; - } + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3); + var rank2 = node2.rank; + if (!isUndefined_default(rank2)) { + layering[rank2][node2.order] = v3; } }); + return layering; } - function reversePointsForReversedEdges(g) { - forEach(g.edges(), function(e) { - var edge = g.edge(e); - if (edge.reversed) { - edge.points.reverse(); + function normalizeRanks(g2) { + var min9 = min_default( + map_default(g2.nodes(), function(v3) { + return g2.node(v3).rank; + }) + ); + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3); + if (has_default(node2, "rank")) { + node2.rank -= min9; } }); } - function removeBorderNodes(g) { - forEach(g.nodes(), function(v) { - if (g.children(v).length) { - var node2 = g.node(v); - var t = g.node(node2.borderTop); - var b = g.node(node2.borderBottom); - var l = g.node(last(node2.borderLeft)); - var r = g.node(last(node2.borderRight)); - node2.width = Math.abs(r.x - l.x); - node2.height = Math.abs(b.y - t.y); - node2.x = l.x + node2.width / 2; - node2.y = t.y + node2.height / 2; + function removeEmptyRanks(g2) { + var offset = min_default( + map_default(g2.nodes(), function(v3) { + return g2.node(v3).rank; + }) + ); + var layers = []; + forEach_default(g2.nodes(), function(v3) { + var rank2 = g2.node(v3).rank - offset; + if (!layers[rank2]) { + layers[rank2] = []; } + layers[rank2].push(v3); }); - forEach(g.nodes(), function(v) { - if (g.node(v).dummy === "border") { - g.removeNode(v); + var delta = 0; + var nodeRankFactor = g2.graph().nodeRankFactor; + forEach_default(layers, function(vs, i2) { + if (isUndefined_default(vs) && i2 % nodeRankFactor !== 0) { + --delta; + } else if (delta) { + forEach_default(vs, function(v3) { + g2.node(v3).rank += delta; + }); } }); } - function removeSelfEdges(g) { - forEach(g.edges(), function(e) { - if (e.v === e.w) { - var node2 = g.node(e.v); - if (!node2.selfEdges) { - node2.selfEdges = []; + function addBorderNode(g2, prefix, rank2, order2) { + var node2 = { + width: 0, + height: 0 + }; + if (arguments.length >= 4) { + node2.rank = rank2; + node2.order = order2; + } + return addDummyNode(g2, "border", node2, prefix); + } + function maxRank(g2) { + return max_default( + map_default(g2.nodes(), function(v3) { + var rank2 = g2.node(v3).rank; + if (!isUndefined_default(rank2)) { + return rank2; } - node2.selfEdges.push({ e, label: g.edge(e) }); - g.removeEdge(e); + }) + ); + } + function partition(collection4, fn3) { + var result = { lhs: [], rhs: [] }; + forEach_default(collection4, function(value2) { + if (fn3(value2)) { + result.lhs.push(value2); + } else { + result.rhs.push(value2); } }); + return result; } - function insertSelfEdges(g) { - var layers = buildLayerMatrix(g); - forEach(layers, function(layer) { - var orderShift = 0; - forEach(layer, function(v, i2) { - var node2 = g.node(v); - node2.order = i2 + orderShift; - forEach(node2.selfEdges, function(selfEdge) { - addDummyNode( - g, - "selfedge", - { - width: selfEdge.label.width, - height: selfEdge.label.height, - rank: node2.rank, - order: i2 + ++orderShift, - e: selfEdge.e, - label: selfEdge.label - }, - "_se" - ); - }); - delete node2.selfEdges; - }); + function time2(name, fn3) { + var start3 = now_default(); + try { + return fn3(); + } finally { + console.log(name + " time: " + (now_default() - start3) + "ms"); + } + } + function notime(name, fn3) { + return fn3(); + } + var init_util3 = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/util.js"() { + "use strict"; + init_lodash(); + init_graphlib(); + __name(addDummyNode, "addDummyNode"); + __name(simplify, "simplify"); + __name(asNonCompoundGraph, "asNonCompoundGraph"); + __name(intersectRect3, "intersectRect"); + __name(buildLayerMatrix, "buildLayerMatrix"); + __name(normalizeRanks, "normalizeRanks"); + __name(removeEmptyRanks, "removeEmptyRanks"); + __name(addBorderNode, "addBorderNode"); + __name(maxRank, "maxRank"); + __name(partition, "partition"); + __name(time2, "time"); + __name(notime, "notime"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/add-border-segments.js + function addBorderSegments(g2) { + function dfs3(v3) { + var children2 = g2.children(v3); + var node2 = g2.node(v3); + if (children2.length) { + forEach_default(children2, dfs3); + } + if (has_default(node2, "minRank")) { + node2.borderLeft = []; + node2.borderRight = []; + for (var rank2 = node2.minRank, maxRank2 = node2.maxRank + 1; rank2 < maxRank2; ++rank2) { + addBorderNode2(g2, "borderLeft", "_bl", v3, node2, rank2); + addBorderNode2(g2, "borderRight", "_br", v3, node2, rank2); + } + } + } + __name(dfs3, "dfs"); + forEach_default(g2.children(), dfs3); + } + function addBorderNode2(g2, prop, prefix, sg, sgNode, rank2) { + var label = { width: 0, height: 0, rank: rank2, borderType: prop }; + var prev2 = sgNode[prop][rank2 - 1]; + var curr = addDummyNode(g2, "border", label, prefix); + sgNode[prop][rank2] = curr; + g2.setParent(curr, sg); + if (prev2) { + g2.setEdge(prev2, curr, { weight: 1 }); + } + } + var init_add_border_segments = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/add-border-segments.js"() { + "use strict"; + init_lodash(); + init_util3(); + __name(addBorderSegments, "addBorderSegments"); + __name(addBorderNode2, "addBorderNode"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/coordinate-system.js + function adjust2(g2) { + var rankDir = g2.graph().rankdir.toLowerCase(); + if (rankDir === "lr" || rankDir === "rl") { + swapWidthHeight(g2); + } + } + function undo2(g2) { + var rankDir = g2.graph().rankdir.toLowerCase(); + if (rankDir === "bt" || rankDir === "rl") { + reverseY(g2); + } + if (rankDir === "lr" || rankDir === "rl") { + swapXY(g2); + swapWidthHeight(g2); + } + } + function swapWidthHeight(g2) { + forEach_default(g2.nodes(), function(v3) { + swapWidthHeightOne(g2.node(v3)); + }); + forEach_default(g2.edges(), function(e3) { + swapWidthHeightOne(g2.edge(e3)); }); } - function positionSelfEdges(g) { - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - if (node2.dummy === "selfedge") { - var selfNode = g.node(node2.e.v); - var x2 = selfNode.x + selfNode.width / 2; - var y2 = selfNode.y; - var dx = node2.x - x2; - var dy = selfNode.height / 2; - g.setEdge(node2.e, node2.label); - g.removeNode(v); - node2.label.points = [ - { x: x2 + 2 * dx / 3, y: y2 - dy }, - { x: x2 + 5 * dx / 6, y: y2 - dy }, - { x: x2 + dx, y: y2 }, - { x: x2 + 5 * dx / 6, y: y2 + dy }, - { x: x2 + 2 * dx / 3, y: y2 + dy } - ]; - node2.label.x = node2.x; - node2.label.y = node2.y; + function swapWidthHeightOne(attrs) { + var w3 = attrs.width; + attrs.width = attrs.height; + attrs.height = w3; + } + function reverseY(g2) { + forEach_default(g2.nodes(), function(v3) { + reverseYOne(g2.node(v3)); + }); + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + forEach_default(edge.points, reverseYOne); + if (has_default(edge, "y")) { + reverseYOne(edge); } }); } - function selectNumberAttrs(obj, attrs) { - return mapValues(pick$1(obj, attrs), Number); + function reverseYOne(attrs) { + attrs.y = -attrs.y; } - function canonicalize(attrs) { - var newAttrs = {}; - forEach(attrs, function(v, k) { - newAttrs[k.toLowerCase()] = v; + function swapXY(g2) { + forEach_default(g2.nodes(), function(v3) { + swapXYOne(g2.node(v3)); + }); + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + forEach_default(edge.points, swapXYOne); + if (has_default(edge, "x")) { + swapXYOne(edge); + } }); - return newAttrs; } - function isSubgraph(g, v) { - return !!g.children(v).length; + function swapXYOne(attrs) { + var x5 = attrs.x; + attrs.x = attrs.y; + attrs.y = x5; + } + var init_coordinate_system = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/coordinate-system.js"() { + "use strict"; + init_lodash(); + __name(adjust2, "adjust"); + __name(undo2, "undo"); + __name(swapWidthHeight, "swapWidthHeight"); + __name(swapWidthHeightOne, "swapWidthHeightOne"); + __name(reverseY, "reverseY"); + __name(reverseYOne, "reverseYOne"); + __name(swapXY, "swapXY"); + __name(swapXYOne, "swapXYOne"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/normalize.js + function run2(g2) { + g2.graph().dummyChains = []; + forEach_default(g2.edges(), function(edge) { + normalizeEdge(g2, edge); + }); } - function edgeToId(e) { - return escapeId(e.v) + ":" + escapeId(e.w) + ":" + escapeId(e.name); + function normalizeEdge(g2, e3) { + var v3 = e3.v; + var vRank = g2.node(v3).rank; + var w3 = e3.w; + var wRank = g2.node(w3).rank; + var name = e3.name; + var edgeLabel = g2.edge(e3); + var labelRank = edgeLabel.labelRank; + if (wRank === vRank + 1) return; + g2.removeEdge(e3); + var dummy, attrs, i2; + for (i2 = 0, ++vRank; vRank < wRank; ++i2, ++vRank) { + edgeLabel.points = []; + attrs = { + width: 0, + height: 0, + edgeLabel, + edgeObj: e3, + rank: vRank + }; + dummy = addDummyNode(g2, "edge", attrs, "_d"); + if (vRank === labelRank) { + attrs.width = edgeLabel.width; + attrs.height = edgeLabel.height; + attrs.dummy = "edge-label"; + attrs.labelpos = edgeLabel.labelpos; + } + g2.setEdge(v3, dummy, { weight: edgeLabel.weight }, name); + if (i2 === 0) { + g2.graph().dummyChains.push(dummy); + } + v3 = dummy; + } + g2.setEdge(v3, w3, { weight: edgeLabel.weight }, name); } - var ID_DELIM = /:/g; - function escapeId(str2) { - return str2 ? String(str2).replace(ID_DELIM, "\\:") : ""; + function undo3(g2) { + forEach_default(g2.graph().dummyChains, function(v3) { + var node2 = g2.node(v3); + var origLabel = node2.edgeLabel; + var w3; + g2.setEdge(node2.edgeObj, origLabel); + while (node2.dummy) { + w3 = g2.successors(v3)[0]; + g2.removeNode(v3); + origLabel.points.push({ x: node2.x, y: node2.y }); + if (node2.dummy === "edge-label") { + origLabel.x = node2.x; + origLabel.y = node2.y; + origLabel.width = node2.width; + origLabel.height = node2.height; + } + v3 = w3; + node2 = g2.node(v3); + } + }); } - function applyStyle$2(dom, styleFn) { - if (styleFn) { - dom.attr("style", styleFn); + var init_normalize = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/normalize.js"() { + "use strict"; + init_lodash(); + init_util3(); + __name(run2, "run"); + __name(normalizeEdge, "normalizeEdge"); + __name(undo3, "undo"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/util.js + function longestPath(g2) { + var visited = {}; + function dfs3(v3) { + var label = g2.node(v3); + if (has_default(visited, v3)) { + return label.rank; + } + visited[v3] = true; + var rank2 = min_default( + map_default(g2.outEdges(v3), function(e3) { + return dfs3(e3.w) - g2.edge(e3).minlen; + }) + ); + if (rank2 === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3 + rank2 === void 0 || // return value of _.map([]) for Lodash 4 + rank2 === null) { + rank2 = 0; + } + return label.rank = rank2; } + __name(dfs3, "dfs"); + forEach_default(g2.sources(), dfs3); } - function applyClass(dom, classFn, otherClasses) { - if (classFn) { - dom.attr("class", classFn).attr("class", otherClasses + " " + dom.attr("class")); + function slack(g2, e3) { + return g2.node(e3.w).rank - g2.node(e3.v).rank - g2.edge(e3).minlen; + } + var init_util4 = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/util.js"() { + "use strict"; + init_lodash(); + __name(longestPath, "longestPath"); + __name(slack, "slack"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js + function feasibleTree(g2) { + var t4 = new Graph({ directed: false }); + var start3 = g2.nodes()[0]; + var size5 = g2.nodeCount(); + t4.setNode(start3, {}); + var edge, delta; + while (tightTree(t4, g2) < size5) { + edge = findMinSlackEdge(t4, g2); + delta = t4.hasNode(edge.v) ? slack(g2, edge) : -slack(g2, edge); + shiftRanks(t4, g2, delta); + } + return t4; + } + function tightTree(t4, g2) { + function dfs3(v3) { + forEach_default(g2.nodeEdges(v3), function(e3) { + var edgeV = e3.v, w3 = v3 === edgeV ? e3.w : edgeV; + if (!t4.hasNode(w3) && !slack(g2, e3)) { + t4.setNode(w3, {}); + t4.setEdge(v3, w3, {}); + dfs3(w3); + } + }); } + __name(dfs3, "dfs"); + forEach_default(t4.nodes(), dfs3); + return t4.nodeCount(); } - function applyTransition(selection2, g) { - var graph = g.graph(); - if (isPlainObject(graph)) { - var transition = graph.transition; - if (isFunction(transition)) { - return transition(selection2); + function findMinSlackEdge(t4, g2) { + return minBy_default(g2.edges(), function(e3) { + if (t4.hasNode(e3.v) !== t4.hasNode(e3.w)) { + return slack(g2, e3); } - } - return selection2; + }); } - var arrows = { - normal, - vee, - undirected - }; - function setArrows(value2) { - arrows = value2; + function shiftRanks(t4, g2, delta) { + forEach_default(t4.nodes(), function(v3) { + g2.node(v3).rank += delta; + }); } - function normal(parent, id2, edge, type2) { - var marker = parent.append("marker").attr("id", id2).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"); - var path2 = marker.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - applyStyle$2(path2, edge[type2 + "Style"]); - if (edge[type2 + "Class"]) { - path2.attr("class", edge[type2 + "Class"]); + var init_feasible_tree = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js"() { + "use strict"; + init_lodash(); + init_graphlib(); + init_util4(); + __name(feasibleTree, "feasibleTree"); + __name(tightTree, "tightTree"); + __name(findMinSlackEdge, "findMinSlackEdge"); + __name(shiftRanks, "shiftRanks"); } - } - function vee(parent, id2, edge, type2) { - var marker = parent.append("marker").attr("id", id2).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"); - var path2 = marker.append("path").attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - applyStyle$2(path2, edge[type2 + "Style"]); - if (edge[type2 + "Class"]) { - path2.attr("class", edge[type2 + "Class"]); + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/components.js + var init_components = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/components.js"() { + "use strict"; } - } - function undirected(parent, id2, edge, type2) { - var marker = parent.append("marker").attr("id", id2).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"); - var path2 = marker.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - applyStyle$2(path2, edge[type2 + "Style"]); - if (edge[type2 + "Class"]) { - path2.attr("class", edge[type2 + "Class"]); + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js + var init_priority_queue = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js"() { + "use strict"; } - } - function addHtmlLabel$1(root2, node2) { - var fo = root2.append("foreignObject").attr("width", "100000"); - var div = fo.append("xhtml:div"); - div.attr("xmlns", "http://www.w3.org/1999/xhtml"); - var label = node2.label; - switch (typeof label) { - case "function": - div.insert(label); - break; - case "object": - div.insert(function() { - return label; - }); - break; - default: - div.html(label); + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js + var DEFAULT_WEIGHT_FUNC; + var init_dijkstra = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js"() { + "use strict"; + init_lodash(); + init_priority_queue(); + DEFAULT_WEIGHT_FUNC = constant_default6(1); } - applyStyle$2(div, node2.labelStyle); - div.style("display", "inline-block"); - div.style("white-space", "nowrap"); - var client = div.node().getBoundingClientRect(); - fo.attr("width", client.width).attr("height", client.height); - return fo; - } - function addSVGLabel(root2, node2) { - var domNode = root2; - domNode.node().appendChild(node2.label); - applyStyle$2(domNode, node2.labelStyle); - return domNode; - } - function addTextLabel(root2, node2) { - var domNode = root2.append("text"); - var lines = processEscapeSequences(node2.label).split("\n"); - for (var i2 = 0; i2 < lines.length; i2++) { - domNode.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(lines[i2]); - } - applyStyle$2(domNode, node2.labelStyle); - return domNode; - } - function processEscapeSequences(text2) { - var newText = ""; - var escaped = false; - var ch2; - for (var i2 = 0; i2 < text2.length; ++i2) { - ch2 = text2[i2]; - if (escaped) { - switch (ch2) { - case "n": - newText += "\n"; - break; - default: - newText += ch2; - } - escaped = false; - } else if (ch2 === "\\") { - escaped = true; - } else { - newText += ch2; + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js + var init_dijkstra_all = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js"() { + "use strict"; + init_dijkstra(); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js + var init_tarjan = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js"() { + "use strict"; + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js + var init_find_cycles = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js"() { + "use strict"; + init_tarjan(); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js + var DEFAULT_WEIGHT_FUNC2; + var init_floyd_warshall = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js"() { + "use strict"; + init_lodash(); + DEFAULT_WEIGHT_FUNC2 = constant_default6(1); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js + function topsort(g2) { + var visited = {}; + var stack = {}; + var results = []; + function visit(node2) { + if (has_default(stack, node2)) { + throw new CycleException(); + } + if (!has_default(visited, node2)) { + stack[node2] = true; + visited[node2] = true; + forEach_default(g2.predecessors(node2), visit); + delete stack[node2]; + results.push(node2); } } - return newText; + __name(visit, "visit"); + forEach_default(g2.sinks(), visit); + if (size_default2(visited) !== g2.nodeCount()) { + throw new CycleException(); + } + return results; } - function addLabel(root2, node2, location2) { - var label = node2.label; - var labelSvg = root2.append("g"); - if (node2.labelType === "svg") { - addSVGLabel(labelSvg, node2); - } else if (typeof label !== "string" || node2.labelType === "html") { - addHtmlLabel$1(labelSvg, node2); - } else { - addTextLabel(labelSvg, node2); + function CycleException() { + } + var init_topsort = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js"() { + "use strict"; + init_lodash(); + topsort.CycleException = CycleException; + __name(topsort, "topsort"); + __name(CycleException, "CycleException"); + CycleException.prototype = new Error(); } - var labelBBox = labelSvg.node().getBBox(); - var y2; - switch (location2) { - case "top": - y2 = -node2.height / 2; - break; - case "bottom": - y2 = node2.height / 2 - labelBBox.height; - break; - default: - y2 = -labelBBox.height / 2; + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js + var init_is_acyclic = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js"() { + "use strict"; + init_topsort(); } - labelSvg.attr("transform", "translate(" + -labelBBox.width / 2 + "," + y2 + ")"); - return labelSvg; - } - var createClusters = function(selection2, g) { - var clusters = g.nodes().filter(function(v) { - return isSubgraph(g, v); - }); - var svgClusters = selection2.selectAll("g.cluster").data(clusters, function(v) { - return v; - }); - applyTransition(svgClusters.exit(), g).style("opacity", 0).remove(); - var enterSelection = svgClusters.enter().append("g").attr("class", "cluster").attr("id", function(v) { - var node2 = g.node(v); - return node2.id; - }).style("opacity", 0).each(function(v) { - var node2 = g.node(v); - var thisGroup = d3select(this); - d3select(this).append("rect"); - var labelGroup = thisGroup.append("g").attr("class", "label"); - addLabel(labelGroup, node2, node2.clusterLabelPos); - }); - svgClusters = svgClusters.merge(enterSelection); - svgClusters = applyTransition(svgClusters, g).style("opacity", 1); - svgClusters.selectAll("rect").each(function(c2) { - var node2 = g.node(c2); - var domCluster = d3select(this); - applyStyle$2(domCluster, node2.style); + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js + function dfs(g2, vs, order2) { + if (!isArray_default(vs)) { + vs = [vs]; + } + var navigation = (g2.isDirected() ? g2.successors : g2.neighbors).bind(g2); + var acc = []; + var visited = {}; + forEach_default(vs, function(v3) { + if (!g2.hasNode(v3)) { + throw new Error("Graph does not have node: " + v3); + } + doDfs(g2, v3, order2 === "post", visited, navigation, acc); }); - return svgClusters; - }; - function setCreateClusters(value2) { - createClusters = value2; - } - let createEdgeLabels = function(selection2, g) { - var svgEdgeLabels = selection2.selectAll("g.edgeLabel").data(g.edges(), function(e) { - return edgeToId(e); - }).classed("update", true); - svgEdgeLabels.exit().remove(); - svgEdgeLabels.enter().append("g").classed("edgeLabel", true).style("opacity", 0); - svgEdgeLabels = selection2.selectAll("g.edgeLabel"); - svgEdgeLabels.each(function(e) { - var root2 = d3select(this); - root2.select(".label").remove(); - var edge = g.edge(e); - var label = addLabel(root2, g.edge(e), 0).classed("label", true); - var bbox = label.node().getBBox(); - if (edge.labelId) { - label.attr("id", edge.labelId); - } - if (!has(edge, "width")) { - edge.width = bbox.width; + return acc; + } + function doDfs(g2, v3, postorder3, visited, navigation, acc) { + if (!has_default(visited, v3)) { + visited[v3] = true; + if (!postorder3) { + acc.push(v3); } - if (!has(edge, "height")) { - edge.height = bbox.height; + forEach_default(navigation(v3), function(w3) { + doDfs(g2, w3, postorder3, visited, navigation, acc); + }); + if (postorder3) { + acc.push(v3); } - }); - var exitSelection; - if (svgEdgeLabels.exit) { - exitSelection = svgEdgeLabels.exit(); - } else { - exitSelection = svgEdgeLabels.selectAll(null); } - applyTransition(exitSelection, g).style("opacity", 0).remove(); - return svgEdgeLabels; - }; - function setCreateEdgeLabels(value2) { - createEdgeLabels = value2; - } - function intersectNode$1(node2, point2) { - return node2.intersect(point2); - } - var createEdgePaths = function(selection2, g, arrows2) { - var previousPaths = selection2.selectAll("g.edgePath").data(g.edges(), function(e) { - return edgeToId(e); - }).classed("update", true); - var newPaths = enter(previousPaths, g); - exit$1(previousPaths, g); - var svgPaths = previousPaths.merge !== void 0 ? previousPaths.merge(newPaths) : previousPaths; - applyTransition(svgPaths, g).style("opacity", 1); - svgPaths.each(function(e) { - var domEdge = d3select(this); - var edge = g.edge(e); - edge.elem = this; - if (edge.id) { - domEdge.attr("id", edge.id); - } - applyClass( - domEdge, - edge["class"], - (domEdge.classed("update") ? "update " : "") + "edgePath" - ); - }); - svgPaths.selectAll("path.path").each(function(e) { - var edge = g.edge(e); - edge.arrowheadId = uniqueId("arrowhead"); - var domEdge = d3select(this).attr("marker-end", function() { - return "url(" + makeFragmentRef(location.href, edge.arrowheadId) + ")"; - }).style("fill", "none"); - applyTransition(domEdge, g).attr("d", function(e3) { - return calcPoints(g, e3); - }); - applyStyle$2(domEdge, edge.style); - }); - svgPaths.selectAll("defs *").remove(); - svgPaths.selectAll("defs").each(function(e) { - var edge = g.edge(e); - var arrowhead = arrows2[edge.arrowhead]; - arrowhead(d3select(this), edge.arrowheadId, edge, "arrowhead"); - }); - return svgPaths; - }; - function setCreateEdgePaths(value2) { - createEdgePaths = value2; - } - function makeFragmentRef(url, fragmentId) { - var baseUrl = url.split("#")[0]; - return baseUrl + "#" + fragmentId; - } - function calcPoints(g, e) { - var edge = g.edge(e); - var tail = g.node(e.v); - var head2 = g.node(e.w); - var points = edge.points.slice(1, edge.points.length - 1); - points.unshift(intersectNode$1(tail, points[0])); - points.push(intersectNode$1(head2, points[points.length - 1])); - return createLine(edge, points); - } - function createLine(edge, points) { - var line2 = (line$1 || svg$2.line)().x(function(d) { - return d.x; - }).y(function(d) { - return d.y; - }); - (line2.curve || line2.interpolate)(edge.curve); - return line2(points); - } - function getCoords(elem) { - var bbox = elem.getBBox(); - var matrix = elem.ownerSVGElement.getScreenCTM().inverse().multiply(elem.getScreenCTM()).translate(bbox.width / 2, bbox.height / 2); - return { x: matrix.e, y: matrix.f }; - } - function enter(svgPaths, g) { - var svgPathsEnter = svgPaths.enter().append("g").attr("class", "edgePath").style("opacity", 0); - svgPathsEnter.append("path").attr("class", "path").attr("d", function(e) { - var edge = g.edge(e); - var sourceElem = g.node(e.v).elem; - var points = range$1(edge.points.length).map(function() { - return getCoords(sourceElem); - }); - return createLine(edge, points); - }); - svgPathsEnter.append("defs"); - return svgPathsEnter; } - function exit$1(svgPaths, g) { - var svgPathExit = svgPaths.exit(); - applyTransition(svgPathExit, g).style("opacity", 0).remove(); + var init_dfs = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js"() { + "use strict"; + init_lodash(); + __name(dfs, "dfs"); + __name(doDfs, "doDfs"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js + function postorder(g2, vs) { + return dfs(g2, vs, "post"); } - var createNodes = function(selection2, g, shapes2) { - var simpleNodes = g.nodes().filter(function(v) { - return !isSubgraph(g, v); - }); - var svgNodes = selection2.selectAll("g.node").data(simpleNodes, function(v) { - return v; - }).classed("update", true); - svgNodes.exit().remove(); - svgNodes.enter().append("g").attr("class", "node").style("opacity", 0); - svgNodes = selection2.selectAll("g.node"); - svgNodes.each(function(v) { - var node2 = g.node(v); - var thisGroup = d3select(this); - applyClass( - thisGroup, - node2["class"], - (thisGroup.classed("update") ? "update " : "") + "node" - ); - thisGroup.select("g.label").remove(); - var labelGroup = thisGroup.append("g").attr("class", "label"); - var labelDom = addLabel(labelGroup, node2); - var shape = shapes2[node2.shape]; - var bbox = pick$1(labelDom.node().getBBox(), "width", "height"); - node2.elem = this; - if (node2.id) { - thisGroup.attr("id", node2.id); - } - if (node2.labelId) { - labelGroup.attr("id", node2.labelId); - } - if (has(node2, "width")) { - bbox.width = node2.width; - } - if (has(node2, "height")) { - bbox.height = node2.height; - } - bbox.width += node2.paddingLeft + node2.paddingRight; - bbox.height += node2.paddingTop + node2.paddingBottom; - labelGroup.attr( - "transform", - "translate(" + (node2.paddingLeft - node2.paddingRight) / 2 + "," + (node2.paddingTop - node2.paddingBottom) / 2 + ")" - ); - var root2 = d3select(this); - root2.select(".label-container").remove(); - var shapeSvg = shape(root2, bbox, node2).classed("label-container", true); - applyStyle$2(shapeSvg, node2.style); - var shapeBBox = shapeSvg.node().getBBox(); - node2.width = shapeBBox.width; - node2.height = shapeBBox.height; - }); - var exitSelection; - if (svgNodes.exit) { - exitSelection = svgNodes.exit(); - } else { - exitSelection = svgNodes.selectAll(null); + var init_postorder = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js"() { + "use strict"; + init_dfs(); + __name(postorder, "postorder"); } - applyTransition(exitSelection, g).style("opacity", 0).remove(); - return svgNodes; - }; - function setCreateNodes(value2) { - createNodes = value2; + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js + function preorder(g2, vs) { + return dfs(g2, vs, "pre"); } - function positionClusters(selection2, g) { - var created = selection2.filter(function() { - return !d3select(this).classed("update"); - }); - function translate(v) { - var node2 = g.node(v); - return "translate(" + node2.x + "," + node2.y + ")"; - } - created.attr("transform", translate); - applyTransition(selection2, g).style("opacity", 1).attr("transform", translate); - applyTransition(created.selectAll("rect"), g).attr("width", function(v) { - return g.node(v).width; - }).attr("height", function(v) { - return g.node(v).height; - }).attr("x", function(v) { - var node2 = g.node(v); - return -node2.width / 2; - }).attr("y", function(v) { - var node2 = g.node(v); - return -node2.height / 2; + var init_preorder = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js"() { + "use strict"; + init_dfs(); + __name(preorder, "preorder"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/prim.js + var init_prim = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/prim.js"() { + "use strict"; + init_priority_queue(); + init_graph(); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/index.js + var init_alg = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/alg/index.js"() { + "use strict"; + init_components(); + init_dijkstra(); + init_dijkstra_all(); + init_find_cycles(); + init_floyd_warshall(); + init_is_acyclic(); + init_postorder(); + init_preorder(); + init_prim(); + init_tarjan(); + init_topsort(); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js + function networkSimplex(g2) { + g2 = simplify(g2); + longestPath(g2); + var t4 = feasibleTree(g2); + initLowLimValues(t4); + initCutValues(t4, g2); + var e3, f3; + while (e3 = leaveEdge(t4)) { + f3 = enterEdge(t4, g2, e3); + exchangeEdges(t4, g2, e3, f3); + } + } + function initCutValues(t4, g2) { + var vs = postorder(t4, t4.nodes()); + vs = vs.slice(0, vs.length - 1); + forEach_default(vs, function(v3) { + assignCutValue(t4, g2, v3); }); } - function positionEdgeLabels(selection2, g) { - var created = selection2.filter(function() { - return !d3select(this).classed("update"); + function assignCutValue(t4, g2, child) { + var childLab = t4.node(child); + var parent4 = childLab.parent; + t4.edge(child, parent4).cutvalue = calcCutValue(t4, g2, child); + } + function calcCutValue(t4, g2, child) { + var childLab = t4.node(child); + var parent4 = childLab.parent; + var childIsTail = true; + var graphEdge = g2.edge(child, parent4); + var cutValue = 0; + if (!graphEdge) { + childIsTail = false; + graphEdge = g2.edge(parent4, child); + } + cutValue = graphEdge.weight; + forEach_default(g2.nodeEdges(child), function(e3) { + var isOutEdge = e3.v === child, other = isOutEdge ? e3.w : e3.v; + if (other !== parent4) { + var pointsToHead = isOutEdge === childIsTail, otherWeight = g2.edge(e3).weight; + cutValue += pointsToHead ? otherWeight : -otherWeight; + if (isTreeEdge(t4, child, other)) { + var otherCutValue = t4.edge(child, other).cutvalue; + cutValue += pointsToHead ? -otherCutValue : otherCutValue; + } + } }); - function translate(e) { - var edge = g.edge(e); - return has(edge, "x") ? "translate(" + edge.x + "," + edge.y + ")" : ""; + return cutValue; + } + function initLowLimValues(tree, root4) { + if (arguments.length < 2) { + root4 = tree.nodes()[0]; } - created.attr("transform", translate); - applyTransition(selection2, g).style("opacity", 1).attr("transform", translate); + dfsAssignLowLim(tree, {}, 1, root4); } - function positionNodes$1(selection2, g) { - var created = selection2.filter(function() { - return !d3select(this).classed("update"); + function dfsAssignLowLim(tree, visited, nextLim, v3, parent4) { + var low = nextLim; + var label = tree.node(v3); + visited[v3] = true; + forEach_default(tree.neighbors(v3), function(w3) { + if (!has_default(visited, w3)) { + nextLim = dfsAssignLowLim(tree, visited, nextLim, w3, v3); + } }); - function translate(v) { - var node2 = g.node(v); - return "translate(" + node2.x + "," + node2.y + ")"; + label.low = low; + label.lim = nextLim++; + if (parent4) { + label.parent = parent4; + } else { + delete label.parent; } - created.attr("transform", translate); - applyTransition(selection2, g).style("opacity", 1).attr("transform", translate); + return nextLim; } - function intersectEllipse$1(node2, rx, ry, point2) { - var cx = node2.x; - var cy = node2.y; - var px = cx - point2.x; - var py = cy - point2.y; - var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); - var dx = Math.abs(rx * ry * px / det); - if (point2.x < cx) { - dx = -dx; + function leaveEdge(tree) { + return find_default(tree.edges(), function(e3) { + return tree.edge(e3).cutvalue < 0; + }); + } + function enterEdge(t4, g2, edge) { + var v3 = edge.v; + var w3 = edge.w; + if (!g2.hasEdge(v3, w3)) { + v3 = edge.w; + w3 = edge.v; } - var dy = Math.abs(rx * ry * py / det); - if (point2.y < cy) { - dy = -dy; + var vLabel = t4.node(v3); + var wLabel = t4.node(w3); + var tailLabel = vLabel; + var flip = false; + if (vLabel.lim > wLabel.lim) { + tailLabel = wLabel; + flip = true; } - return { x: cx + dx, y: cy + dy }; + var candidates = filter_default3(g2.edges(), function(edge2) { + return flip === isDescendant(t4, t4.node(edge2.v), tailLabel) && flip !== isDescendant(t4, t4.node(edge2.w), tailLabel); + }); + return minBy_default(candidates, function(edge2) { + return slack(g2, edge2); + }); + } + function exchangeEdges(t4, g2, e3, f3) { + var v3 = e3.v; + var w3 = e3.w; + t4.removeEdge(v3, w3); + t4.setEdge(f3.v, f3.w, {}); + initLowLimValues(t4); + initCutValues(t4, g2); + updateRanks(t4, g2); + } + function updateRanks(t4, g2) { + var root4 = find_default(t4.nodes(), function(v3) { + return !g2.node(v3).parent; + }); + var vs = preorder(t4, root4); + vs = vs.slice(1); + forEach_default(vs, function(v3) { + var parent4 = t4.node(v3).parent, edge = g2.edge(v3, parent4), flipped = false; + if (!edge) { + edge = g2.edge(parent4, v3); + flipped = true; + } + g2.node(v3).rank = g2.node(parent4).rank + (flipped ? edge.minlen : -edge.minlen); + }); } - function intersectCircle$1(node2, rx, point2) { - return intersectEllipse$1(node2, rx, rx, point2); + function isTreeEdge(tree, u2, v3) { + return tree.hasEdge(u2, v3); } - function intersectLine$1(p1, p2, q1, q2) { - var a1, a2, b1, b2, c1, c2; - var r1, r2, r3, r4; - var denom, offset, num; - var x2, y2; - a1 = p2.y - p1.y; - b1 = p1.x - p2.x; - c1 = p2.x * p1.y - p1.x * p2.y; - r3 = a1 * q1.x + b1 * q1.y + c1; - r4 = a1 * q2.x + b1 * q2.y + c1; - if (r3 !== 0 && r4 !== 0 && sameSign$1(r3, r4)) { - return; - } - a2 = q2.y - q1.y; - b2 = q1.x - q2.x; - c2 = q2.x * q1.y - q1.x * q2.y; - r1 = a2 * p1.x + b2 * p1.y + c2; - r2 = a2 * p2.x + b2 * p2.y + c2; - if (r1 !== 0 && r2 !== 0 && sameSign$1(r1, r2)) { - return; + function isDescendant(tree, vLabel, rootLabel) { + return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; + } + var init_network_simplex = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js"() { + "use strict"; + init_lodash(); + init_alg(); + init_util3(); + init_feasible_tree(); + init_util4(); + networkSimplex.initLowLimValues = initLowLimValues; + networkSimplex.initCutValues = initCutValues; + networkSimplex.calcCutValue = calcCutValue; + networkSimplex.leaveEdge = leaveEdge; + networkSimplex.enterEdge = enterEdge; + networkSimplex.exchangeEdges = exchangeEdges; + __name(networkSimplex, "networkSimplex"); + __name(initCutValues, "initCutValues"); + __name(assignCutValue, "assignCutValue"); + __name(calcCutValue, "calcCutValue"); + __name(initLowLimValues, "initLowLimValues"); + __name(dfsAssignLowLim, "dfsAssignLowLim"); + __name(leaveEdge, "leaveEdge"); + __name(enterEdge, "enterEdge"); + __name(exchangeEdges, "exchangeEdges"); + __name(updateRanks, "updateRanks"); + __name(isTreeEdge, "isTreeEdge"); + __name(isDescendant, "isDescendant"); } - denom = a1 * b2 - a2 * b1; - if (denom === 0) { - return; + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/index.js + function rank(g2) { + switch (g2.graph().ranker) { + case "network-simplex": + networkSimplexRanker(g2); + break; + case "tight-tree": + tightTreeRanker(g2); + break; + case "longest-path": + longestPathRanker(g2); + break; + default: + networkSimplexRanker(g2); } - offset = Math.abs(denom / 2); - num = b1 * c2 - b2 * c1; - x2 = num < 0 ? (num - offset) / denom : (num + offset) / denom; - num = a2 * c1 - a1 * c2; - y2 = num < 0 ? (num - offset) / denom : (num + offset) / denom; - return { x: x2, y: y2 }; } - function sameSign$1(r1, r2) { - return r1 * r2 > 0; + function tightTreeRanker(g2) { + longestPath(g2); + feasibleTree(g2); } - function intersectPolygon$1(node2, polyPoints, point2) { - var x1 = node2.x; - var y1 = node2.y; - var intersections = []; - var minX = Number.POSITIVE_INFINITY; - var minY = Number.POSITIVE_INFINITY; - polyPoints.forEach(function(entry) { - minX = Math.min(minX, entry.x); - minY = Math.min(minY, entry.y); + function networkSimplexRanker(g2) { + networkSimplex(g2); + } + var longestPathRanker; + var init_rank = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/rank/index.js"() { + "use strict"; + init_feasible_tree(); + init_network_simplex(); + init_util4(); + __name(rank, "rank"); + longestPathRanker = longestPath; + __name(tightTreeRanker, "tightTreeRanker"); + __name(networkSimplexRanker, "networkSimplexRanker"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/nesting-graph.js + function run3(g2) { + var root4 = addDummyNode(g2, "root", {}, "_root"); + var depths = treeDepths(g2); + var height2 = max_default(values_default(depths)) - 1; + var nodeSep = 2 * height2 + 1; + g2.graph().nestingRoot = root4; + forEach_default(g2.edges(), function(e3) { + g2.edge(e3).minlen *= nodeSep; }); - var left2 = x1 - node2.width / 2 - minX; - var top2 = y1 - node2.height / 2 - minY; - for (var i2 = 0; i2 < polyPoints.length; i2++) { - var p1 = polyPoints[i2]; - var p2 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0]; - var intersect2 = intersectLine$1( - node2, - point2, - { x: left2 + p1.x, y: top2 + p1.y }, - { x: left2 + p2.x, y: top2 + p2.y } - ); - if (intersect2) { - intersections.push(intersect2); + var weight8 = sumWeights(g2) + 1; + forEach_default(g2.children(), function(child) { + dfs2(g2, root4, nodeSep, weight8, height2, depths, child); + }); + g2.graph().nodeRankFactor = nodeSep; + } + function dfs2(g2, root4, nodeSep, weight8, height2, depths, v3) { + var children2 = g2.children(v3); + if (!children2.length) { + if (v3 !== root4) { + g2.setEdge(root4, v3, { weight: 0, minlen: nodeSep }); } + return; } - if (!intersections.length) { - console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", node2); - return node2; - } - if (intersections.length > 1) { - intersections.sort(function(p, q) { - var pdx = p.x - point2.x; - var pdy = p.y - point2.y; - var distp = Math.sqrt(pdx * pdx + pdy * pdy); - var qdx = q.x - point2.x; - var qdy = q.y - point2.y; - var distq = Math.sqrt(qdx * qdx + qdy * qdy); - return distp < distq ? -1 : distp === distq ? 0 : 1; + var top2 = addBorderNode(g2, "_bt"); + var bottom2 = addBorderNode(g2, "_bb"); + var label = g2.node(v3); + g2.setParent(top2, v3); + label.borderTop = top2; + g2.setParent(bottom2, v3); + label.borderBottom = bottom2; + forEach_default(children2, function(child) { + dfs2(g2, root4, nodeSep, weight8, height2, depths, child); + var childNode = g2.node(child); + var childTop = childNode.borderTop ? childNode.borderTop : child; + var childBottom = childNode.borderBottom ? childNode.borderBottom : child; + var thisWeight = childNode.borderTop ? weight8 : 2 * weight8; + var minlen = childTop !== childBottom ? 1 : height2 - depths[v3] + 1; + g2.setEdge(top2, childTop, { + weight: thisWeight, + minlen, + nestingEdge: true + }); + g2.setEdge(childBottom, bottom2, { + weight: thisWeight, + minlen, + nestingEdge: true }); + }); + if (!g2.parent(v3)) { + g2.setEdge(root4, top2, { weight: 0, minlen: height2 + depths[v3] }); } - return intersections[0]; } - function intersectRect$2(node2, point2) { - var x2 = node2.x; - var y2 = node2.y; - var dx = point2.x - x2; - var dy = point2.y - y2; - var w2 = node2.width / 2; - var h = node2.height / 2; - var sx, sy; - if (Math.abs(dy) * w2 > Math.abs(dx) * h) { - if (dy < 0) { - h = -h; - } - sx = dy === 0 ? 0 : h * dx / dy; - sy = h; - } else { - if (dx < 0) { - w2 = -w2; + function treeDepths(g2) { + var depths = {}; + function dfs3(v3, depth) { + var children2 = g2.children(v3); + if (children2 && children2.length) { + forEach_default(children2, function(child) { + dfs3(child, depth + 1); + }); } - sx = w2; - sy = dx === 0 ? 0 : w2 * dy / dx; + depths[v3] = depth; } - return { x: x2 + sx, y: y2 + sy }; - } - var shapes$2 = { - rect: rect$2, - ellipse, - circle: circle$2, - diamond - }; - function setShapes(value2) { - shapes$2 = value2; - } - function rect$2(parent, bbox, node2) { - var shapeSvg = parent.insert("rect", ":first-child").attr("rx", node2.rx).attr("ry", node2.ry).attr("x", -bbox.width / 2).attr("y", -bbox.height / 2).attr("width", bbox.width).attr("height", bbox.height); - node2.intersect = function(point2) { - return intersectRect$2(node2, point2); - }; - return shapeSvg; - } - function ellipse(parent, bbox, node2) { - var rx = bbox.width / 2; - var ry = bbox.height / 2; - var shapeSvg = parent.insert("ellipse", ":first-child").attr("x", -bbox.width / 2).attr("y", -bbox.height / 2).attr("rx", rx).attr("ry", ry); - node2.intersect = function(point2) { - return intersectEllipse$1(node2, rx, ry, point2); - }; - return shapeSvg; + __name(dfs3, "dfs"); + forEach_default(g2.children(), function(v3) { + dfs3(v3, 1); + }); + return depths; } - function circle$2(parent, bbox, node2) { - var r = Math.max(bbox.width, bbox.height) / 2; - var shapeSvg = parent.insert("circle", ":first-child").attr("x", -bbox.width / 2).attr("y", -bbox.height / 2).attr("r", r); - node2.intersect = function(point2) { - return intersectCircle$1(node2, r, point2); - }; - return shapeSvg; - } - function diamond(parent, bbox, node2) { - var w2 = bbox.width * Math.SQRT2 / 2; - var h = bbox.height * Math.SQRT2 / 2; - var points = [ - { x: 0, y: -h }, - { x: -w2, y: 0 }, - { x: 0, y: h }, - { x: w2, y: 0 } - ]; - var shapeSvg = parent.insert("polygon", ":first-child").attr( - "points", - points.map(function(p) { - return p.x + "," + p.y; - }).join(" ") + function sumWeights(g2) { + return reduce_default( + g2.edges(), + function(acc, e3) { + return acc + g2.edge(e3).weight; + }, + 0 ); - node2.intersect = function(p) { - return intersectPolygon$1(node2, points, p); - }; - return shapeSvg; - } - function render$1() { - var fn = function(svg2, g) { - preProcessGraph(g); - var outputGroup = createOrSelectGroup(svg2, "output"); - var clustersGroup = createOrSelectGroup(outputGroup, "clusters"); - var edgePathsGroup = createOrSelectGroup(outputGroup, "edgePaths"); - var edgeLabels2 = createEdgeLabels(createOrSelectGroup(outputGroup, "edgeLabels"), g); - var nodes2 = createNodes(createOrSelectGroup(outputGroup, "nodes"), g, shapes$2); - layout$1(g); - positionNodes$1(nodes2, g); - positionEdgeLabels(edgeLabels2, g); - createEdgePaths(edgePathsGroup, g, arrows); - var clusters = createClusters(clustersGroup, g); - positionClusters(clusters, g); - postProcessGraph(g); - }; - fn.createNodes = function(value2) { - if (!arguments.length) - return createNodes; - setCreateNodes(value2); - return fn; - }; - fn.createClusters = function(value2) { - if (!arguments.length) - return createClusters; - setCreateClusters(value2); - return fn; - }; - fn.createEdgeLabels = function(value2) { - if (!arguments.length) - return createEdgeLabels; - setCreateEdgeLabels(value2); - return fn; - }; - fn.createEdgePaths = function(value2) { - if (!arguments.length) - return createEdgePaths; - setCreateEdgePaths(value2); - return fn; - }; - fn.shapes = function(value2) { - if (!arguments.length) - return shapes$2; - setShapes(value2); - return fn; - }; - fn.arrows = function(value2) { - if (!arguments.length) - return arrows; - setArrows(value2); - return fn; - }; - return fn; - } - var NODE_DEFAULT_ATTRS = { - paddingLeft: 10, - paddingRight: 10, - paddingTop: 10, - paddingBottom: 10, - rx: 0, - ry: 0, - shape: "rect" - }; - var EDGE_DEFAULT_ATTRS = { - arrowhead: "normal", - curve: curveLinear - }; - function preProcessGraph(g) { - g.nodes().forEach(function(v) { - var node2 = g.node(v); - if (!has(node2, "label") && !g.children(v).length) { - node2.label = v; - } - if (has(node2, "paddingX")) { - defaults$1(node2, { - paddingLeft: node2.paddingX, - paddingRight: node2.paddingX - }); - } - if (has(node2, "paddingY")) { - defaults$1(node2, { - paddingTop: node2.paddingY, - paddingBottom: node2.paddingY - }); - } - if (has(node2, "padding")) { - defaults$1(node2, { - paddingLeft: node2.padding, - paddingRight: node2.padding, - paddingTop: node2.padding, - paddingBottom: node2.padding - }); - } - defaults$1(node2, NODE_DEFAULT_ATTRS); - forEach(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(k) { - node2[k] = Number(node2[k]); - }); - if (has(node2, "width")) { - node2._prevWidth = node2.width; - } - if (has(node2, "height")) { - node2._prevHeight = node2.height; + } + function cleanup(g2) { + var graphLabel = g2.graph(); + g2.removeNode(graphLabel.nestingRoot); + delete graphLabel.nestingRoot; + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + if (edge.nestingEdge) { + g2.removeEdge(e3); } }); - g.edges().forEach(function(e) { - var edge = g.edge(e); - if (!has(edge, "label")) { - edge.label = ""; + } + var init_nesting_graph = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/nesting-graph.js"() { + "use strict"; + init_lodash(); + init_util3(); + __name(run3, "run"); + __name(dfs2, "dfs"); + __name(treeDepths, "treeDepths"); + __name(sumWeights, "sumWeights"); + __name(cleanup, "cleanup"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js + function addSubgraphConstraints(g2, cg, vs) { + var prev2 = {}, rootPrev; + forEach_default(vs, function(v3) { + var child = g2.parent(v3), parent4, prevChild; + while (child) { + parent4 = g2.parent(child); + if (parent4) { + prevChild = prev2[parent4]; + prev2[parent4] = child; + } else { + prevChild = rootPrev; + rootPrev = child; + } + if (prevChild && prevChild !== child) { + cg.setEdge(prevChild, child); + return; + } + child = parent4; } - defaults$1(edge, EDGE_DEFAULT_ATTRS); }); } - function postProcessGraph(g) { - forEach(g.nodes(), function(v) { - var node2 = g.node(v); - if (has(node2, "_prevWidth")) { - node2.width = node2._prevWidth; - } else { - delete node2.width; - } - if (has(node2, "_prevHeight")) { - node2.height = node2._prevHeight; - } else { - delete node2.height; + var init_add_subgraph_constraints = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js"() { + "use strict"; + init_lodash(); + __name(addSubgraphConstraints, "addSubgraphConstraints"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js + function buildLayerGraph(g2, rank2, relationship) { + var root4 = createRootNode(g2), result = new Graph({ compound: true }).setGraph({ root: root4 }).setDefaultNodeLabel(function(v3) { + return g2.node(v3); + }); + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3), parent4 = g2.parent(v3); + if (node2.rank === rank2 || node2.minRank <= rank2 && rank2 <= node2.maxRank) { + result.setNode(v3); + result.setParent(v3, parent4 || root4); + forEach_default(g2[relationship](v3), function(e3) { + var u2 = e3.v === v3 ? e3.w : e3.v, edge = result.edge(u2, v3), weight8 = !isUndefined_default(edge) ? edge.weight : 0; + result.setEdge(u2, v3, { weight: g2.edge(e3).weight + weight8 }); + }); + if (has_default(node2, "minRank")) { + result.setNode(v3, { + borderLeft: node2.borderLeft[rank2], + borderRight: node2.borderRight[rank2] + }); + } } - delete node2._prevWidth; - delete node2._prevHeight; }); + return result; } - function createOrSelectGroup(root2, name) { - var selection2 = root2.select("g." + name); - if (selection2.empty()) { - selection2 = root2.append("g").attr("class", name); - } - return selection2; - } - function question$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const s = (w2 + h) * 0.9; - const points = [ - { x: s / 2, y: 0 }, - { x: s, y: -s / 2 }, - { x: s / 2, y: -s }, - { x: 0, y: -s / 2 } - ]; - const shapeSvg = insertPolygonShape$2(parent, s, s, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function hexagon$1(parent, bbox, node2) { - const f2 = 4; - const h = bbox.height; - const m = h / f2; - const w2 = bbox.width + 2 * m; - const points = [ - { x: m, y: 0 }, - { x: w2 - m, y: 0 }, - { x: w2, y: -h / 2 }, - { x: w2 - m, y: -h }, - { x: m, y: -h }, - { x: 0, y: -h / 2 } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function rect_left_inv_arrow$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const points = [ - { x: -h / 2, y: 0 }, - { x: w2, y: 0 }, - { x: w2, y: -h }, - { x: -h / 2, y: -h }, - { x: 0, y: -h / 2 } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function lean_right$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const points = [ - { x: -2 * h / 6, y: 0 }, - { x: w2 - h / 6, y: 0 }, - { x: w2 + 2 * h / 6, y: -h }, - { x: h / 6, y: -h } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function lean_left$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const points = [ - { x: 2 * h / 6, y: 0 }, - { x: w2 + h / 6, y: 0 }, - { x: w2 - 2 * h / 6, y: -h }, - { x: -h / 6, y: -h } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function trapezoid$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const points = [ - { x: -2 * h / 6, y: 0 }, - { x: w2 + 2 * h / 6, y: 0 }, - { x: w2 - h / 6, y: -h }, - { x: h / 6, y: -h } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function inv_trapezoid$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const points = [ - { x: h / 6, y: 0 }, - { x: w2 - h / 6, y: 0 }, - { x: w2 + 2 * h / 6, y: -h }, - { x: -2 * h / 6, y: -h } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function rect_right_inv_arrow$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const points = [ - { x: 0, y: 0 }, - { x: w2 + h / 2, y: 0 }, - { x: w2, y: -h / 2 }, - { x: w2 + h / 2, y: -h }, - { x: 0, y: -h } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function stadium$1(parent, bbox, node2) { - const h = bbox.height; - const w2 = bbox.width + h / 4; - const shapeSvg = parent.insert("rect", ":first-child").attr("rx", h / 2).attr("ry", h / 2).attr("x", -w2 / 2).attr("y", -h / 2).attr("width", w2).attr("height", h); - node2.intersect = function(point2) { - return intersectRect$2(node2, point2); - }; - return shapeSvg; - } - function subroutine$1(parent, bbox, node2) { - const w2 = bbox.width; - const h = bbox.height; - const points = [ - { x: 0, y: 0 }, - { x: w2, y: 0 }, - { x: w2, y: -h }, - { x: 0, y: -h }, - { x: 0, y: 0 }, - { x: -8, y: 0 }, - { x: w2 + 8, y: 0 }, - { x: w2 + 8, y: -h }, - { x: -8, y: -h }, - { x: -8, y: 0 } - ]; - const shapeSvg = insertPolygonShape$2(parent, w2, h, points); - node2.intersect = function(point2) { - return intersectPolygon$1(node2, points, point2); - }; - return shapeSvg; - } - function cylinder$1(parent, bbox, node2) { - const w2 = bbox.width; - const rx = w2 / 2; - const ry = rx / (2.5 + w2 / 50); - const h = bbox.height + ry; - const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 a " + rx + "," + ry + " 0,0,0 " + -w2 + " 0 l 0," + h + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 l 0," + -h; - const shapeSvg = parent.attr("label-offset-y", ry).insert("path", ":first-child").attr("d", shape).attr("transform", "translate(" + -w2 / 2 + "," + -(h / 2 + ry) + ")"); - node2.intersect = function(point2) { - const pos = intersectRect$2(node2, point2); - const x2 = pos.x - node2.x; - if (rx != 0 && (Math.abs(x2) < node2.width / 2 || Math.abs(x2) == node2.width / 2 && Math.abs(pos.y - node2.y) > node2.height / 2 - ry)) { - let y2 = ry * ry * (1 - x2 * x2 / (rx * rx)); - if (y2 != 0) { - y2 = Math.sqrt(y2); - } - y2 = ry - y2; - if (point2.y - node2.y > 0) { - y2 = -y2; - } - pos.y += y2; - } - return pos; - }; - return shapeSvg; - } - function addToRender(render2) { - render2.shapes().question = question$1; - render2.shapes().hexagon = hexagon$1; - render2.shapes().stadium = stadium$1; - render2.shapes().subroutine = subroutine$1; - render2.shapes().cylinder = cylinder$1; - render2.shapes().rect_left_inv_arrow = rect_left_inv_arrow$1; - render2.shapes().lean_right = lean_right$1; - render2.shapes().lean_left = lean_left$1; - render2.shapes().trapezoid = trapezoid$1; - render2.shapes().inv_trapezoid = inv_trapezoid$1; - render2.shapes().rect_right_inv_arrow = rect_right_inv_arrow$1; - } - function addToRenderV2(addShape) { - addShape({ question: question$1 }); - addShape({ hexagon: hexagon$1 }); - addShape({ stadium: stadium$1 }); - addShape({ subroutine: subroutine$1 }); - addShape({ cylinder: cylinder$1 }); - addShape({ rect_left_inv_arrow: rect_left_inv_arrow$1 }); - addShape({ lean_right: lean_right$1 }); - addShape({ lean_left: lean_left$1 }); - addShape({ trapezoid: trapezoid$1 }); - addShape({ inv_trapezoid: inv_trapezoid$1 }); - addShape({ rect_right_inv_arrow: rect_right_inv_arrow$1 }); - } - function insertPolygonShape$2(parent, w2, h, points) { - return parent.insert("polygon", ":first-child").attr( - "points", - points.map(function(d) { - return d.x + "," + d.y; - }).join(" ") - ).attr("transform", "translate(" + -w2 / 2 + "," + h / 2 + ")"); + function createRootNode(g2) { + var v3; + while (g2.hasNode(v3 = uniqueId_default("_root"))) ; + return v3; } - const flowChartShapes = { - addToRender, - addToRenderV2 - }; - const conf$8 = {}; - const setConf$8 = function(cnf) { - const keys2 = Object.keys(cnf); - for (const key of keys2) { - conf$8[key] = cnf[key]; + var init_build_layer_graph = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js"() { + "use strict"; + init_lodash(); + init_graphlib(); + __name(buildLayerGraph, "buildLayerGraph"); + __name(createRootNode, "createRootNode"); } - }; - const addVertices$2 = async function(vert, g, svgId, root2, _doc, diagObj) { - const svg2 = !root2 ? d3select(`[id="${svgId}"]`) : root2.select(`[id="${svgId}"]`); - const doc = !_doc ? document : _doc; - const keys2 = Object.keys(vert); - for (const id2 of keys2) { - const vertex = vert[id2]; - let classStr = "default"; - if (vertex.classes.length > 0) { - classStr = vertex.classes.join(" "); - } - const styles2 = getStylesFromArray(vertex.styles); - let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id; - let vertexNode; - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const node2 = { - label: await renderKatex( - vertexText.replace( - /fa[blrs]?:fa-[\w-]+/g, - // cspell:disable-line - (s) => `` - ), - getConfig$1() - ) - }; - vertexNode = addHtmlLabel$1(svg2, node2).node(); - vertexNode.parentNode.removeChild(vertexNode); - } else { - const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text"); - svgLabel.setAttribute("style", styles2.labelStyle.replace("color:", "fill:")); - const rows = vertexText.split(common$1.lineBreakRegex); - for (const row of rows) { - const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan"); - tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); - tspan.setAttribute("dy", "1em"); - tspan.setAttribute("x", "1"); - tspan.textContent = row; - svgLabel.appendChild(tspan); - } - vertexNode = svgLabel; - } - let radius = 0; - let _shape = ""; - switch (vertex.type) { - case "round": - radius = 5; - _shape = "rect"; - break; - case "square": - _shape = "rect"; - break; - case "diamond": - _shape = "question"; - break; - case "hexagon": - _shape = "hexagon"; - break; - case "odd": - _shape = "rect_left_inv_arrow"; - break; - case "lean_right": - _shape = "lean_right"; - break; - case "lean_left": - _shape = "lean_left"; - break; - case "trapezoid": - _shape = "trapezoid"; - break; - case "inv_trapezoid": - _shape = "inv_trapezoid"; - break; - case "odd_right": - _shape = "rect_left_inv_arrow"; - break; - case "circle": - _shape = "circle"; - break; - case "ellipse": - _shape = "ellipse"; - break; - case "stadium": - _shape = "stadium"; - break; - case "subroutine": - _shape = "subroutine"; - break; - case "cylinder": - _shape = "cylinder"; - break; - case "group": - _shape = "rect"; - break; - default: - _shape = "rect"; - } - log$1.warn("Adding node", vertex.id, vertex.domId); - g.setNode(diagObj.db.lookUpDomId(vertex.id), { - labelType: "svg", - labelStyle: styles2.labelStyle, - shape: _shape, - label: vertexNode, - rx: radius, - ry: radius, - class: classStr, - style: styles2.style, - id: diagObj.db.lookUpDomId(vertex.id) - }); + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/cross-count.js + function crossCount(g2, layering) { + var cc2 = 0; + for (var i2 = 1; i2 < layering.length; ++i2) { + cc2 += twoLayerCrossCount(g2, layering[i2 - 1], layering[i2]); } - }; - const addEdges$2 = async function(edges2, g, diagObj) { - let cnt2 = 0; - let defaultStyle2; - let defaultLabelStyle; - if (edges2.defaultStyle !== void 0) { - const defaultStyles = getStylesFromArray(edges2.defaultStyle); - defaultStyle2 = defaultStyles.style; - defaultLabelStyle = defaultStyles.labelStyle; - } - for (const edge of edges2) { - cnt2++; - const linkId = "L-" + edge.start + "-" + edge.end; - const linkNameStart = "LS-" + edge.start; - const linkNameEnd = "LE-" + edge.end; - const edgeData = {}; - if (edge.type === "arrow_open") { - edgeData.arrowhead = "none"; - } else { - edgeData.arrowhead = "normal"; - } - let style = ""; - let labelStyle = ""; - if (edge.style !== void 0) { - const styles2 = getStylesFromArray(edge.style); - style = styles2.style; - labelStyle = styles2.labelStyle; - } else { - switch (edge.stroke) { - case "normal": - style = "fill:none"; - if (defaultStyle2 !== void 0) { - style = defaultStyle2; - } - if (defaultLabelStyle !== void 0) { - labelStyle = defaultLabelStyle; - } - break; - case "dotted": - style = "fill:none;stroke-width:2px;stroke-dasharray:3;"; - break; - case "thick": - style = " stroke-width: 3.5px;fill:none"; - break; - } - } - edgeData.style = style; - edgeData.labelStyle = labelStyle; - if (edge.interpolate !== void 0) { - edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear); - } else if (edges2.defaultInterpolate !== void 0) { - edgeData.curve = interpolateToCurve(edges2.defaultInterpolate, curveLinear); - } else { - edgeData.curve = interpolateToCurve(conf$8.curve, curveLinear); - } - if (edge.text === void 0) { - if (edge.style !== void 0) { - edgeData.arrowheadStyle = "fill: #333"; - } - } else { - edgeData.arrowheadStyle = "fill: #333"; - edgeData.labelpos = "c"; - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - edgeData.labelType = "html"; - edgeData.label = `${await renderKatex( - edge.text.replace( - /fa[blrs]?:fa-[\w-]+/g, - // cspell:disable-line - (s) => `` - ), - getConfig$1() - )}`; - } else { - edgeData.labelType = "text"; - edgeData.label = edge.text.replace(common$1.lineBreakRegex, "\n"); - if (edge.style === void 0) { - edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none"; + return cc2; + } + function twoLayerCrossCount(g2, northLayer, southLayer) { + var southPos = zipObject_default( + southLayer, + map_default(southLayer, function(v3, i2) { + return i2; + }) + ); + var southEntries = flatten_default( + map_default(northLayer, function(v3) { + return sortBy_default( + map_default(g2.outEdges(v3), function(e3) { + return { pos: southPos[e3.w], weight: g2.edge(e3).weight }; + }), + "pos" + ); + }) + ); + var firstIndex = 1; + while (firstIndex < southLayer.length) firstIndex <<= 1; + var treeSize = 2 * firstIndex - 1; + firstIndex -= 1; + var tree = map_default(new Array(treeSize), function() { + return 0; + }); + var cc2 = 0; + forEach_default( + // @ts-expect-error + southEntries.forEach(function(entry) { + var index = entry.pos + firstIndex; + tree[index] += entry.weight; + var weightSum = 0; + while (index > 0) { + if (index % 2) { + weightSum += tree[index + 1]; } - edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); + index = index - 1 >> 1; + tree[index] += entry.weight; } - } - edgeData.id = linkId; - edgeData.class = linkNameStart + " " + linkNameEnd; - edgeData.minlen = edge.length || 1; - g.setEdge(diagObj.db.lookUpDomId(edge.start), diagObj.db.lookUpDomId(edge.end), edgeData, cnt2); + cc2 += entry.weight * weightSum; + }) + ); + return cc2; + } + var init_cross_count = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/cross-count.js"() { + "use strict"; + init_lodash(); + __name(crossCount, "crossCount"); + __name(twoLayerCrossCount, "twoLayerCrossCount"); } - }; - const getClasses$7 = function(text2, diagObj) { - log$1.info("Extracting classes"); - return diagObj.db.getClasses(); - }; - const draw$k = async function(text2, id2, _version, diagObj) { - log$1.info("Drawing flowchart"); - const { securityLevel, flowchart: conf2 } = getConfig$1(); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - let dir2 = diagObj.db.getDirection(); - if (dir2 === void 0) { - dir2 = "TD"; - } - const nodeSpacing = conf2.nodeSpacing || 50; - const rankSpacing = conf2.rankSpacing || 50; - const g = new Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: dir2, - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 8, - marginy: 8 - }).setDefaultEdgeLabel(function() { - return {}; + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/init-order.js + function initOrder(g2) { + var visited = {}; + var simpleNodes = filter_default3(g2.nodes(), function(v3) { + return !g2.children(v3).length; }); - let subG; - const subGraphs2 = diagObj.db.getSubGraphs(); - for (let i3 = subGraphs2.length - 1; i3 >= 0; i3--) { - subG = subGraphs2[i3]; - diagObj.db.addVertex(subG.id, subG.title, "group", void 0, subG.classes); - } - const vert = diagObj.db.getVertices(); - log$1.warn("Get vertices", vert); - const edges2 = diagObj.db.getEdges(); - let i2 = 0; - for (i2 = subGraphs2.length - 1; i2 >= 0; i2--) { - subG = subGraphs2[i2]; - selectAll("cluster").append("text"); - for (let j = 0; j < subG.nodes.length; j++) { - log$1.warn( - "Setting subgraph", - subG.nodes[j], - diagObj.db.lookUpDomId(subG.nodes[j]), - diagObj.db.lookUpDomId(subG.id) - ); - g.setParent(diagObj.db.lookUpDomId(subG.nodes[j]), diagObj.db.lookUpDomId(subG.id)); - } - } - await addVertices$2(vert, g, id2, root2, doc, diagObj); - await addEdges$2(edges2, g, diagObj); - const render2 = new render$1(); - flowChartShapes.addToRender(render2); - render2.arrows().none = function normal2(parent, id3, edge, type2) { - const marker = parent.append("marker").attr("id", id3).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"); - const path2 = marker.append("path").attr("d", "M 0 0 L 0 0 L 0 0 z"); - applyStyle$2(path2, edge[type2 + "Style"]); - }; - render2.arrows().normal = function normal2(parent, id3) { - const marker = parent.append("marker").attr("id", id3).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"); - marker.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - }; - const svg2 = root2.select(`[id="${id2}"]`); - const element2 = root2.select("#" + id2 + " g"); - render2(element2, g); - element2.selectAll("g.node").attr("title", function() { - return diagObj.db.getTooltip(this.id); + var maxRank2 = max_default( + map_default(simpleNodes, function(v3) { + return g2.node(v3).rank; + }) + ); + var layers = map_default(range_default(maxRank2 + 1), function() { + return []; }); - diagObj.db.indexNodes("subGraph" + i2); - for (i2 = 0; i2 < subGraphs2.length; i2++) { - subG = subGraphs2[i2]; - if (subG.title !== "undefined") { - const clusterRects = doc.querySelectorAll( - "#" + id2 + ' [id="' + diagObj.db.lookUpDomId(subG.id) + '"] rect' - ); - const clusterEl = doc.querySelectorAll( - "#" + id2 + ' [id="' + diagObj.db.lookUpDomId(subG.id) + '"]' - ); - const xPos = clusterRects[0].x.baseVal.value; - const yPos = clusterRects[0].y.baseVal.value; - const _width = clusterRects[0].width.baseVal.value; - const cluster = d3select(clusterEl[0]); - const te = cluster.select(".label"); - te.attr("transform", `translate(${xPos + _width / 2}, ${yPos + 14})`); - te.attr("id", id2 + "Text"); - for (let j = 0; j < subG.classes.length; j++) { - clusterEl[0].classList.add(subG.classes[j]); - } - } - } - if (!conf2.htmlLabels) { - const labels = doc.querySelectorAll('[id="' + id2 + '"] .edgeLabel .label'); - for (const label of labels) { - const dim = label.getBBox(); - const rect2 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); - rect2.setAttribute("rx", 0); - rect2.setAttribute("ry", 0); - rect2.setAttribute("width", dim.width); - rect2.setAttribute("height", dim.height); - label.insertBefore(rect2, label.firstChild); - } - } - setupGraphViewbox$1(g, svg2, conf2.diagramPadding, conf2.useMaxWidth); - const keys2 = Object.keys(vert); - keys2.forEach(function(key) { - const vertex = vert[key]; - if (vertex.link) { - const node2 = root2.select("#" + id2 + ' [id="' + diagObj.db.lookUpDomId(key) + '"]'); - if (node2) { - const link2 = doc.createElementNS("http://www.w3.org/2000/svg", "a"); - link2.setAttributeNS("http://www.w3.org/2000/svg", "class", vertex.classes.join(" ")); - link2.setAttributeNS("http://www.w3.org/2000/svg", "href", vertex.link); - link2.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"); - if (securityLevel === "sandbox") { - link2.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top"); - } else if (vertex.linkTarget) { - link2.setAttributeNS("http://www.w3.org/2000/svg", "target", vertex.linkTarget); - } - const linkNode = node2.insert(function() { - return link2; - }, ":first-child"); - const shape = node2.select(".label-container"); - if (shape) { - linkNode.append(function() { - return shape.node(); - }); - } - const label = node2.select(".label"); - if (label) { - linkNode.append(function() { - return label.node(); - }); - } - } - } + function dfs3(v3) { + if (has_default(visited, v3)) return; + visited[v3] = true; + var node2 = g2.node(v3); + layers[node2.rank].push(v3); + forEach_default(g2.successors(v3), dfs3); + } + __name(dfs3, "dfs"); + var orderedVs = sortBy_default(simpleNodes, function(v3) { + return g2.node(v3).rank; }); - }; - const flowRenderer = { - setConf: setConf$8, - addVertices: addVertices$2, - addEdges: addEdges$2, - getClasses: getClasses$7, - draw: draw$k - }; - function write(g) { - var json2 = { - options: { - directed: g.isDirected(), - multigraph: g.isMultigraph(), - compound: g.isCompound() - }, - nodes: writeNodes(g), - edges: writeEdges(g) - }; - if (!isUndefined(g.graph())) { - json2.value = clone$1(g.graph()); - } - return json2; + forEach_default(orderedVs, dfs3); + return layers; } - function writeNodes(g) { - return map(g.nodes(), function(v) { - var nodeValue = g.node(v); - var parent = g.parent(v); - var node2 = { v }; - if (!isUndefined(nodeValue)) { - node2.value = nodeValue; - } - if (!isUndefined(parent)) { - node2.parent = parent; + var init_init_order = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/init-order.js"() { + "use strict"; + init_lodash(); + __name(initOrder, "initOrder"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/barycenter.js + function barycenter(g2, movable) { + return map_default(movable, function(v3) { + var inV = g2.inEdges(v3); + if (!inV.length) { + return { v: v3 }; + } else { + var result = reduce_default( + inV, + function(acc, e3) { + var edge = g2.edge(e3), nodeU = g2.node(e3.v); + return { + sum: acc.sum + edge.weight * nodeU.order, + weight: acc.weight + edge.weight + }; + }, + { sum: 0, weight: 0 } + ); + return { + v: v3, + barycenter: result.sum / result.weight, + weight: result.weight + }; } - return node2; }); } - function writeEdges(g) { - return map(g.edges(), function(e) { - var edgeValue = g.edge(e); - var edge = { v: e.v, w: e.w }; - if (!isUndefined(e.name)) { - edge.name = e.name; + var init_barycenter = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/barycenter.js"() { + "use strict"; + init_lodash(); + __name(barycenter, "barycenter"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js + function resolveConflicts(entries, cg) { + var mappedEntries = {}; + forEach_default(entries, function(entry, i2) { + var tmp = mappedEntries[entry.v] = { + indegree: 0, + in: [], + out: [], + vs: [entry.v], + i: i2 + }; + if (!isUndefined_default(entry.barycenter)) { + tmp.barycenter = entry.barycenter; + tmp.weight = entry.weight; } - if (!isUndefined(edgeValue)) { - edge.value = edgeValue; + }); + forEach_default(cg.edges(), function(e3) { + var entryV = mappedEntries[e3.v]; + var entryW = mappedEntries[e3.w]; + if (!isUndefined_default(entryV) && !isUndefined_default(entryW)) { + entryW.indegree++; + entryV.out.push(mappedEntries[e3.w]); } - return edge; }); - } - const insertMarkers$3 = (elem, markerArray, type2, id2) => { - markerArray.forEach((markerName) => { - markers$1[markerName](elem, type2, id2); + var sourceSet = filter_default3(mappedEntries, function(entry) { + return !entry.indegree; }); - }; - const extension$1 = (elem, type2, id2) => { - log$1.trace("Making markers for ", id2); - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-extensionStart").attr("class", "marker extension " + type2).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-extensionEnd").attr("class", "marker extension " + type2).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); - }; - const composition = (elem, type2, id2) => { - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-compositionStart").attr("class", "marker composition " + type2).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-compositionEnd").attr("class", "marker composition " + type2).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - }; - const aggregation = (elem, type2, id2) => { - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-aggregationStart").attr("class", "marker aggregation " + type2).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-aggregationEnd").attr("class", "marker aggregation " + type2).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - }; - const dependency = (elem, type2, id2) => { - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-dependencyStart").attr("class", "marker dependency " + type2).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-dependencyEnd").attr("class", "marker dependency " + type2).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); - }; - const lollipop = (elem, type2, id2) => { - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-lollipopStart").attr("class", "marker lollipop " + type2).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-lollipopEnd").attr("class", "marker lollipop " + type2).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); - }; - const point$2 = (elem, type2, id2) => { - elem.append("marker").attr("id", id2 + "_" + type2 + "-pointEnd").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - elem.append("marker").attr("id", id2 + "_" + type2 + "-pointStart").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - }; - const circle$1 = (elem, type2, id2) => { - elem.append("marker").attr("id", id2 + "_" + type2 + "-circleEnd").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - elem.append("marker").attr("id", id2 + "_" + type2 + "-circleStart").attr("class", "marker " + type2).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); - }; - const cross = (elem, type2, id2) => { - elem.append("marker").attr("id", id2 + "_" + type2 + "-crossEnd").attr("class", "marker cross " + type2).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); - elem.append("marker").attr("id", id2 + "_" + type2 + "-crossStart").attr("class", "marker cross " + type2).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); - }; - const barb = (elem, type2, id2) => { - elem.append("defs").append("marker").attr("id", id2 + "_" + type2 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); - }; - const markers$1 = { - extension: extension$1, - composition, - aggregation, - dependency, - lollipop, - point: point$2, - circle: circle$1, - cross, - barb - }; - const insertMarkers$4 = insertMarkers$3; - function applyStyle$1(dom, styleFn) { - if (styleFn) { - dom.attr("style", styleFn); - } - } - function addHtmlLabel(node2) { - const fo = d3select(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")); - const div = fo.append("xhtml:div"); - const label = node2.label; - const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel"; - div.html( - '" + label + "" - ); - applyStyle$1(div, node2.labelStyle); - div.style("display", "inline-block"); - div.style("white-space", "nowrap"); - div.attr("xmlns", "http://www.w3.org/1999/xhtml"); - return fo.node(); + return doResolveConflicts(sourceSet); } - const createLabel = (_vertexText, style, isTitle, isNode) => { - let vertexText = _vertexText || ""; - if (typeof vertexText === "object") { - vertexText = vertexText[0]; - } - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - vertexText = vertexText.replace(/\\n|\n/g, "
    "); - log$1.debug("vertexText" + vertexText); - const node2 = { - isNode, - label: decodeEntities(vertexText).replace( - /fa[blrs]?:fa-[\w-]+/g, - // cspell: disable-line - (s) => `` - ), - labelStyle: style.replace("fill:", "color:") - }; - let vertexNode = addHtmlLabel(node2); - return vertexNode; - } else { - const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text"); - svgLabel.setAttribute("style", style.replace("color:", "fill:")); - let rows = []; - if (typeof vertexText === "string") { - rows = vertexText.split(/\\n|\n|/gi); - } else if (Array.isArray(vertexText)) { - rows = vertexText; - } else { - rows = []; - } - for (const row of rows) { - const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); - tspan.setAttribute("dy", "1em"); - tspan.setAttribute("x", "0"); - if (isTitle) { - tspan.setAttribute("class", "title-row"); - } else { - tspan.setAttribute("class", "row"); + function doResolveConflicts(sourceSet) { + var entries = []; + function handleIn(vEntry) { + return function(uEntry) { + if (uEntry.merged) { + return; } - tspan.textContent = row.trim(); - svgLabel.appendChild(tspan); - } - return svgLabel; - } - }; - const createLabel$1 = createLabel; - const emptyOptions = {}; - function toString(value2, options2) { - const settings = options2 || emptyOptions; - const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true; - const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true; - return one(value2, includeImageAlt, includeHtml); - } - function one(value2, includeImageAlt, includeHtml) { - if (node(value2)) { - if ("value" in value2) { - return value2.type === "html" && !includeHtml ? "" : value2.value; - } - if (includeImageAlt && "alt" in value2 && value2.alt) { - return value2.alt; - } - if ("children" in value2) { - return all(value2.children, includeImageAlt, includeHtml); - } + if (isUndefined_default(uEntry.barycenter) || isUndefined_default(vEntry.barycenter) || uEntry.barycenter >= vEntry.barycenter) { + mergeEntries(vEntry, uEntry); + } + }; } - if (Array.isArray(value2)) { - return all(value2, includeImageAlt, includeHtml); + __name(handleIn, "handleIn"); + function handleOut(vEntry) { + return function(wEntry) { + wEntry["in"].push(vEntry); + if (--wEntry.indegree === 0) { + sourceSet.push(wEntry); + } + }; } - return ""; - } - function all(values2, includeImageAlt, includeHtml) { - const result = []; - let index2 = -1; - while (++index2 < values2.length) { - result[index2] = one(values2[index2], includeImageAlt, includeHtml); + __name(handleOut, "handleOut"); + while (sourceSet.length) { + var entry = sourceSet.pop(); + entries.push(entry); + forEach_default(entry["in"].reverse(), handleIn(entry)); + forEach_default(entry.out, handleOut(entry)); } - return result.join(""); - } - function node(value2) { - return Boolean(value2 && typeof value2 === "object"); + return map_default( + filter_default3(entries, function(entry2) { + return !entry2.merged; + }), + function(entry2) { + return pick_default(entry2, ["vs", "i", "barycenter", "weight"]); + } + ); } - function splice(list2, start2, remove2, items) { - const end2 = list2.length; - let chunkStart = 0; - let parameters; - if (start2 < 0) { - start2 = -start2 > end2 ? 0 : end2 + start2; - } else { - start2 = start2 > end2 ? end2 : start2; + function mergeEntries(target, source) { + var sum2 = 0; + var weight8 = 0; + if (target.weight) { + sum2 += target.barycenter * target.weight; + weight8 += target.weight; } - remove2 = remove2 > 0 ? remove2 : 0; - if (items.length < 1e4) { - parameters = Array.from(items); - parameters.unshift(start2, remove2); - list2.splice(...parameters); - } else { - if (remove2) - list2.splice(start2, remove2); - while (chunkStart < items.length) { - parameters = items.slice(chunkStart, chunkStart + 1e4); - parameters.unshift(start2, 0); - list2.splice(...parameters); - chunkStart += 1e4; - start2 += 1e4; - } - } - } - function push(list2, items) { - if (list2.length > 0) { - splice(list2, list2.length, 0, items); - return list2; - } - return items; - } - const hasOwnProperty = {}.hasOwnProperty; - function combineExtensions(extensions) { - const all2 = {}; - let index2 = -1; - while (++index2 < extensions.length) { - syntaxExtension(all2, extensions[index2]); - } - return all2; - } - function syntaxExtension(all2, extension2) { - let hook; - for (hook in extension2) { - const maybe = hasOwnProperty.call(all2, hook) ? all2[hook] : void 0; - const left2 = maybe || (all2[hook] = {}); - const right2 = extension2[hook]; - let code; - if (right2) { - for (code in right2) { - if (!hasOwnProperty.call(left2, code)) - left2[code] = []; - const value2 = right2[code]; - constructs( - // @ts-expect-error Looks like a list. - left2[code], - Array.isArray(value2) ? value2 : value2 ? [value2] : [] - ); - } - } + if (source.weight) { + sum2 += source.barycenter * source.weight; + weight8 += source.weight; } + target.vs = source.vs.concat(target.vs); + target.barycenter = sum2 / weight8; + target.weight = weight8; + target.i = Math.min(source.i, target.i); + source.merged = true; } - function constructs(existing, list2) { - let index2 = -1; - const before = []; - while (++index2 < list2.length) { - (list2[index2].add === "after" ? existing : before).push(list2[index2]); + var init_resolve_conflicts = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js"() { + "use strict"; + init_lodash(); + __name(resolveConflicts, "resolveConflicts"); + __name(doResolveConflicts, "doResolveConflicts"); + __name(mergeEntries, "mergeEntries"); } - splice(existing, 0, 0, before); - } - const unicodePunctuationRegex = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; - const asciiAlpha = regexCheck(/[A-Za-z]/); - const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); - const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); - function asciiControl(code) { - return ( - // Special whitespace codes (which have negative values), C0 and Control - // character DEL - code !== null && (code < 32 || code === 127) - ); - } - const asciiDigit = regexCheck(/\d/); - const asciiHexDigit = regexCheck(/[\dA-Fa-f]/); - const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); - function markdownLineEnding(code) { - return code !== null && code < -2; - } - function markdownLineEndingOrSpace(code) { - return code !== null && (code < 0 || code === 32); - } - function markdownSpace(code) { - return code === -2 || code === -1 || code === 32; - } - const unicodePunctuation = regexCheck(unicodePunctuationRegex); - const unicodeWhitespace = regexCheck(/\s/); - function regexCheck(regex) { - return check; - function check(code) { - return code !== null && regex.test(String.fromCharCode(code)); + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort.js + function sort(entries, biasRight) { + var parts = partition(entries, function(entry) { + return has_default(entry, "barycenter"); + }); + var sortable = parts.lhs, unsortable = sortBy_default(parts.rhs, function(entry) { + return -entry.i; + }), vs = [], sum2 = 0, weight8 = 0, vsIndex = 0; + sortable.sort(compareWithBias(!!biasRight)); + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + forEach_default(sortable, function(entry) { + vsIndex += entry.vs.length; + vs.push(entry.vs); + sum2 += entry.barycenter * entry.weight; + weight8 += entry.weight; + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + }); + var result = { vs: flatten_default(vs) }; + if (weight8) { + result.barycenter = sum2 / weight8; + result.weight = weight8; } + return result; } - function factorySpace(effects, ok, type2, max2) { - const limit = max2 ? max2 - 1 : Number.POSITIVE_INFINITY; - let size2 = 0; - return start2; - function start2(code) { - if (markdownSpace(code)) { - effects.enter(type2); - return prefix(code); - } - return ok(code); - } - function prefix(code) { - if (markdownSpace(code) && size2++ < limit) { - effects.consume(code); - return prefix; - } - effects.exit(type2); - return ok(code); + function consumeUnsortable(vs, unsortable, index) { + var last3; + while (unsortable.length && (last3 = last_default(unsortable)).i <= index) { + unsortable.pop(); + vs.push(last3.vs); + index++; } + return index; } - const content$1 = { - tokenize: initializeContent - }; - function initializeContent(effects) { - const contentStart = effects.attempt( - this.parser.constructs.contentInitial, - afterContentStartConstruct, - paragraphInitial - ); - let previous2; - return contentStart; - function afterContentStartConstruct(code) { - if (code === null) { - effects.consume(code); - return; + function compareWithBias(bias) { + return function(entryV, entryW) { + if (entryV.barycenter < entryW.barycenter) { + return -1; + } else if (entryV.barycenter > entryW.barycenter) { + return 1; } - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, contentStart, "linePrefix"); - } - function paragraphInitial(code) { - effects.enter("paragraph"); - return lineStart(code); + return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + }; + } + var init_sort2 = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort.js"() { + "use strict"; + init_lodash(); + init_util3(); + __name(sort, "sort"); + __name(consumeUnsortable, "consumeUnsortable"); + __name(compareWithBias, "compareWithBias"); } - function lineStart(code) { - const token2 = effects.enter("chunkText", { - contentType: "text", - previous: previous2 + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js + function sortSubgraph(g2, v3, cg, biasRight) { + var movable = g2.children(v3); + var node2 = g2.node(v3); + var bl = node2 ? node2.borderLeft : void 0; + var br2 = node2 ? node2.borderRight : void 0; + var subgraphs = {}; + if (bl) { + movable = filter_default3(movable, function(w3) { + return w3 !== bl && w3 !== br2; }); - if (previous2) { - previous2.next = token2; - } - previous2 = token2; - return data(code); - } - function data(code) { - if (code === null) { - effects.exit("chunkText"); - effects.exit("paragraph"); - effects.consume(code); - return; - } - if (markdownLineEnding(code)) { - effects.consume(code); - effects.exit("chunkText"); - return lineStart; - } - effects.consume(code); - return data; } - } - const document$2 = { - tokenize: initializeDocument - }; - const containerConstruct = { - tokenize: tokenizeContainer - }; - function initializeDocument(effects) { - const self2 = this; - const stack = []; - let continued = 0; - let childFlow; - let childToken; - let lineStartOffset; - return start2; - function start2(code) { - if (continued < stack.length) { - const item = stack[continued]; - self2.containerState = item[1]; - return effects.attempt( - item[0].continuation, - documentContinue, - checkNewContainers - )(code); - } - return checkNewContainers(code); - } - function documentContinue(code) { - continued++; - if (self2.containerState._closeFlow) { - self2.containerState._closeFlow = void 0; - if (childFlow) { - closeFlow(); - } - const indexBeforeExits = self2.events.length; - let indexBeforeFlow = indexBeforeExits; - let point2; - while (indexBeforeFlow--) { - if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") { - point2 = self2.events[indexBeforeFlow][1].end; - break; - } - } - exitContainers(continued); - let index2 = indexBeforeExits; - while (index2 < self2.events.length) { - self2.events[index2][1].end = Object.assign({}, point2); - index2++; + var barycenters = barycenter(g2, movable); + forEach_default(barycenters, function(entry) { + if (g2.children(entry.v).length) { + var subgraphResult = sortSubgraph(g2, entry.v, cg, biasRight); + subgraphs[entry.v] = subgraphResult; + if (has_default(subgraphResult, "barycenter")) { + mergeBarycenters(entry, subgraphResult); } - splice( - self2.events, - indexBeforeFlow + 1, - 0, - self2.events.slice(indexBeforeExits) - ); - self2.events.length = index2; - return checkNewContainers(code); } - return start2(code); - } - function checkNewContainers(code) { - if (continued === stack.length) { - if (!childFlow) { - return documentContinued(code); - } - if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { - return flowStart(code); + }); + var entries = resolveConflicts(barycenters, cg); + expandSubgraphs(entries, subgraphs); + var result = sort(entries, biasRight); + if (bl) { + result.vs = flatten_default([bl, result.vs, br2]); + if (g2.predecessors(bl).length) { + var blPred = g2.node(g2.predecessors(bl)[0]), brPred = g2.node(g2.predecessors(br2)[0]); + if (!has_default(result, "barycenter")) { + result.barycenter = 0; + result.weight = 0; } - self2.interrupt = Boolean( - childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack - ); - } - self2.containerState = {}; - return effects.check( - containerConstruct, - thereIsANewContainer, - thereIsNoNewContainer - )(code); - } - function thereIsANewContainer(code) { - if (childFlow) - closeFlow(); - exitContainers(continued); - return documentContinued(code); - } - function thereIsNoNewContainer(code) { - self2.parser.lazy[self2.now().line] = continued !== stack.length; - lineStartOffset = self2.now().offset; - return flowStart(code); - } - function documentContinued(code) { - self2.containerState = {}; - return effects.attempt( - containerConstruct, - containerContinue, - flowStart - )(code); - } - function containerContinue(code) { - continued++; - stack.push([self2.currentConstruct, self2.containerState]); - return documentContinued(code); - } - function flowStart(code) { - if (code === null) { - if (childFlow) - closeFlow(); - exitContainers(0); - effects.consume(code); - return; + result.barycenter = (result.barycenter * result.weight + blPred.order + brPred.order) / (result.weight + 2); + result.weight += 2; } - childFlow = childFlow || self2.parser.flow(self2.now()); - effects.enter("chunkFlow", { - contentType: "flow", - previous: childToken, - _tokenizer: childFlow - }); - return flowContinue(code); } - function flowContinue(code) { - if (code === null) { - writeToChild(effects.exit("chunkFlow"), true); - exitContainers(0); - effects.consume(code); - return; - } - if (markdownLineEnding(code)) { - effects.consume(code); - writeToChild(effects.exit("chunkFlow")); - continued = 0; - self2.interrupt = void 0; - return start2; - } - effects.consume(code); - return flowContinue; - } - function writeToChild(token2, eof) { - const stream = self2.sliceStream(token2); - if (eof) - stream.push(null); - token2.previous = childToken; - if (childToken) - childToken.next = token2; - childToken = token2; - childFlow.defineSkip(token2.start); - childFlow.write(stream); - if (self2.parser.lazy[token2.start.line]) { - let index2 = childFlow.events.length; - while (index2--) { - if ( - // The token starts before the line ending… - childFlow.events[index2][1].start.offset < lineStartOffset && // …and either is not ended yet… - (!childFlow.events[index2][1].end || // …or ends after it. - childFlow.events[index2][1].end.offset > lineStartOffset) - ) { - return; - } - } - const indexBeforeExits = self2.events.length; - let indexBeforeFlow = indexBeforeExits; - let seen; - let point2; - while (indexBeforeFlow--) { - if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") { - if (seen) { - point2 = self2.events[indexBeforeFlow][1].end; - break; - } - seen = true; + return result; + } + function expandSubgraphs(entries, subgraphs) { + forEach_default(entries, function(entry) { + entry.vs = flatten_default( + entry.vs.map(function(v3) { + if (subgraphs[v3]) { + return subgraphs[v3].vs; } - } - exitContainers(continued); - index2 = indexBeforeExits; - while (index2 < self2.events.length) { - self2.events[index2][1].end = Object.assign({}, point2); - index2++; - } - splice( - self2.events, - indexBeforeFlow + 1, - 0, - self2.events.slice(indexBeforeExits) - ); - self2.events.length = index2; - } + return v3; + }) + ); + }); + } + function mergeBarycenters(target, other) { + if (!isUndefined_default(target.barycenter)) { + target.barycenter = (target.barycenter * target.weight + other.barycenter * other.weight) / (target.weight + other.weight); + target.weight += other.weight; + } else { + target.barycenter = other.barycenter; + target.weight = other.weight; } - function exitContainers(size2) { - let index2 = stack.length; - while (index2-- > size2) { - const entry = stack[index2]; - self2.containerState = entry[1]; - entry[0].exit.call(self2, effects); - } - stack.length = size2; + } + var init_sort_subgraph = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js"() { + "use strict"; + init_lodash(); + init_barycenter(); + init_resolve_conflicts(); + init_sort2(); + __name(sortSubgraph, "sortSubgraph"); + __name(expandSubgraphs, "expandSubgraphs"); + __name(mergeBarycenters, "mergeBarycenters"); } - function closeFlow() { - childFlow.write([null]); - childToken = void 0; - childFlow = void 0; - self2.containerState._closeFlow = void 0; + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/index.js + function order(g2) { + var maxRank2 = maxRank(g2), downLayerGraphs = buildLayerGraphs(g2, range_default(1, maxRank2 + 1), "inEdges"), upLayerGraphs = buildLayerGraphs(g2, range_default(maxRank2 - 1, -1, -1), "outEdges"); + var layering = initOrder(g2); + assignOrder(g2, layering); + var bestCC = Number.POSITIVE_INFINITY, best; + for (var i2 = 0, lastBest = 0; lastBest < 4; ++i2, ++lastBest) { + sweepLayerGraphs(i2 % 2 ? downLayerGraphs : upLayerGraphs, i2 % 4 >= 2); + layering = buildLayerMatrix(g2); + var cc2 = crossCount(g2, layering); + if (cc2 < bestCC) { + lastBest = 0; + best = cloneDeep_default(layering); + bestCC = cc2; + } } + assignOrder(g2, best); } - function tokenizeContainer(effects, ok, nok) { - return factorySpace( - effects, - effects.attempt(this.parser.constructs.document, ok, nok), - "linePrefix", - this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 - ); + function buildLayerGraphs(g2, ranks, relationship) { + return map_default(ranks, function(rank2) { + return buildLayerGraph(g2, rank2, relationship); + }); } - function classifyCharacter(code) { - if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) { - return 1; - } - if (unicodePunctuation(code)) { - return 2; - } + function sweepLayerGraphs(layerGraphs, biasRight) { + var cg = new Graph(); + forEach_default(layerGraphs, function(lg) { + var root4 = lg.graph().root; + var sorted = sortSubgraph(lg, root4, cg, biasRight); + forEach_default(sorted.vs, function(v3, i2) { + lg.node(v3).order = i2; + }); + addSubgraphConstraints(lg, cg, sorted.vs); + }); } - function resolveAll(constructs2, events, context) { - const called = []; - let index2 = -1; - while (++index2 < constructs2.length) { - const resolve = constructs2[index2].resolveAll; - if (resolve && !called.includes(resolve)) { - events = resolve(events, context); - called.push(resolve); - } - } - return events; + function assignOrder(g2, layering) { + forEach_default(layering, function(layer) { + forEach_default(layer, function(v3, i2) { + g2.node(v3).order = i2; + }); + }); } - const attention = { - name: "attention", - tokenize: tokenizeAttention, - resolveAll: resolveAllAttention - }; - function resolveAllAttention(events, context) { - let index2 = -1; - let open2; - let group; - let text2; - let openingSequence; - let closingSequence; - let use; - let nextEvents; - let offset; - while (++index2 < events.length) { - if (events[index2][0] === "enter" && events[index2][1].type === "attentionSequence" && events[index2][1]._close) { - open2 = index2; - while (open2--) { - if (events[open2][0] === "exit" && events[open2][1].type === "attentionSequence" && events[open2][1]._open && // If the markers are the same: - context.sliceSerialize(events[open2][1]).charCodeAt(0) === context.sliceSerialize(events[index2][1]).charCodeAt(0)) { - if ((events[open2][1]._close || events[index2][1]._open) && (events[index2][1].end.offset - events[index2][1].start.offset) % 3 && !((events[open2][1].end.offset - events[open2][1].start.offset + events[index2][1].end.offset - events[index2][1].start.offset) % 3)) { - continue; - } - use = events[open2][1].end.offset - events[open2][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1; - const start2 = Object.assign({}, events[open2][1].end); - const end2 = Object.assign({}, events[index2][1].start); - movePoint(start2, -use); - movePoint(end2, use); - openingSequence = { - type: use > 1 ? "strongSequence" : "emphasisSequence", - start: start2, - end: Object.assign({}, events[open2][1].end) - }; - closingSequence = { - type: use > 1 ? "strongSequence" : "emphasisSequence", - start: Object.assign({}, events[index2][1].start), - end: end2 - }; - text2 = { - type: use > 1 ? "strongText" : "emphasisText", - start: Object.assign({}, events[open2][1].end), - end: Object.assign({}, events[index2][1].start) - }; - group = { - type: use > 1 ? "strong" : "emphasis", - start: Object.assign({}, openingSequence.start), - end: Object.assign({}, closingSequence.end) - }; - events[open2][1].end = Object.assign({}, openingSequence.start); - events[index2][1].start = Object.assign({}, closingSequence.end); - nextEvents = []; - if (events[open2][1].end.offset - events[open2][1].start.offset) { - nextEvents = push(nextEvents, [ - ["enter", events[open2][1], context], - ["exit", events[open2][1], context] - ]); - } - nextEvents = push(nextEvents, [ - ["enter", group, context], - ["enter", openingSequence, context], - ["exit", openingSequence, context], - ["enter", text2, context] - ]); - nextEvents = push( - nextEvents, - resolveAll( - context.parser.constructs.insideSpan.null, - events.slice(open2 + 1, index2), - context - ) - ); - nextEvents = push(nextEvents, [ - ["exit", text2, context], - ["enter", closingSequence, context], - ["exit", closingSequence, context], - ["exit", group, context] - ]); - if (events[index2][1].end.offset - events[index2][1].start.offset) { - offset = 2; - nextEvents = push(nextEvents, [ - ["enter", events[index2][1], context], - ["exit", events[index2][1], context] - ]); - } else { - offset = 0; - } - splice(events, open2 - 1, index2 - open2 + 3, nextEvents); - index2 = open2 + nextEvents.length - offset - 2; - break; + var init_order2 = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/order/index.js"() { + "use strict"; + init_lodash(); + init_graphlib(); + init_util3(); + init_add_subgraph_constraints(); + init_build_layer_graph(); + init_cross_count(); + init_init_order(); + init_sort_subgraph(); + __name(order, "order"); + __name(buildLayerGraphs, "buildLayerGraphs"); + __name(sweepLayerGraphs, "sweepLayerGraphs"); + __name(assignOrder, "assignOrder"); + } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js + function parentDummyChains(g2) { + var postorderNums = postorder2(g2); + forEach_default(g2.graph().dummyChains, function(v3) { + var node2 = g2.node(v3); + var edgeObj = node2.edgeObj; + var pathData = findPath(g2, postorderNums, edgeObj.v, edgeObj.w); + var path4 = pathData.path; + var lca = pathData.lca; + var pathIdx = 0; + var pathV = path4[pathIdx]; + var ascending5 = true; + while (v3 !== edgeObj.w) { + node2 = g2.node(v3); + if (ascending5) { + while ((pathV = path4[pathIdx]) !== lca && g2.node(pathV).maxRank < node2.rank) { + pathIdx++; + } + if (pathV === lca) { + ascending5 = false; } } - } - } - index2 = -1; - while (++index2 < events.length) { - if (events[index2][1].type === "attentionSequence") { - events[index2][1].type = "data"; - } - } - return events; - } - function tokenizeAttention(effects, ok) { - const attentionMarkers2 = this.parser.constructs.attentionMarkers.null; - const previous2 = this.previous; - const before = classifyCharacter(previous2); - let marker; - return start2; - function start2(code) { - marker = code; - effects.enter("attentionSequence"); - return inside(code); - } - function inside(code) { - if (code === marker) { - effects.consume(code); - return inside; - } - const token2 = effects.exit("attentionSequence"); - const after = classifyCharacter(code); - const open2 = !after || after === 2 && before || attentionMarkers2.includes(code); - const close2 = !before || before === 2 && after || attentionMarkers2.includes(previous2); - token2._open = Boolean(marker === 42 ? open2 : open2 && (before || !close2)); - token2._close = Boolean(marker === 42 ? close2 : close2 && (after || !open2)); - return ok(code); - } - } - function movePoint(point2, offset) { - point2.column += offset; - point2.offset += offset; - point2._bufferIndex += offset; - } - const autolink = { - name: "autolink", - tokenize: tokenizeAutolink - }; - function tokenizeAutolink(effects, ok, nok) { - let size2 = 0; - return start2; - function start2(code) { - effects.enter("autolink"); - effects.enter("autolinkMarker"); - effects.consume(code); - effects.exit("autolinkMarker"); - effects.enter("autolinkProtocol"); - return open2; - } - function open2(code) { - if (asciiAlpha(code)) { - effects.consume(code); - return schemeOrEmailAtext; - } - return emailAtext(code); - } - function schemeOrEmailAtext(code) { - if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) { - size2 = 1; - return schemeInsideOrEmailAtext(code); - } - return emailAtext(code); - } - function schemeInsideOrEmailAtext(code) { - if (code === 58) { - effects.consume(code); - size2 = 0; - return urlInside; - } - if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size2++ < 32) { - effects.consume(code); - return schemeInsideOrEmailAtext; - } - size2 = 0; - return emailAtext(code); - } - function urlInside(code) { - if (code === 62) { - effects.exit("autolinkProtocol"); - effects.enter("autolinkMarker"); - effects.consume(code); - effects.exit("autolinkMarker"); - effects.exit("autolink"); - return ok; - } - if (code === null || code === 32 || code === 60 || asciiControl(code)) { - return nok(code); - } - effects.consume(code); - return urlInside; - } - function emailAtext(code) { - if (code === 64) { - effects.consume(code); - return emailAtSignOrDot; - } - if (asciiAtext(code)) { - effects.consume(code); - return emailAtext; - } - return nok(code); - } - function emailAtSignOrDot(code) { - return asciiAlphanumeric(code) ? emailLabel(code) : nok(code); - } - function emailLabel(code) { - if (code === 46) { - effects.consume(code); - size2 = 0; - return emailAtSignOrDot; - } - if (code === 62) { - effects.exit("autolinkProtocol").type = "autolinkEmail"; - effects.enter("autolinkMarker"); - effects.consume(code); - effects.exit("autolinkMarker"); - effects.exit("autolink"); - return ok; - } - return emailValue(code); - } - function emailValue(code) { - if ((code === 45 || asciiAlphanumeric(code)) && size2++ < 63) { - const next2 = code === 45 ? emailValue : emailLabel; - effects.consume(code); - return next2; - } - return nok(code); - } - } - const blankLine = { - tokenize: tokenizeBlankLine, - partial: true - }; - function tokenizeBlankLine(effects, ok, nok) { - return start2; - function start2(code) { - return markdownSpace(code) ? factorySpace(effects, after, "linePrefix")(code) : after(code); - } - function after(code) { - return code === null || markdownLineEnding(code) ? ok(code) : nok(code); - } - } - const blockQuote = { - name: "blockQuote", - tokenize: tokenizeBlockQuoteStart, - continuation: { - tokenize: tokenizeBlockQuoteContinuation - }, - exit - }; - function tokenizeBlockQuoteStart(effects, ok, nok) { - const self2 = this; - return start2; - function start2(code) { - if (code === 62) { - const state2 = self2.containerState; - if (!state2.open) { - effects.enter("blockQuote", { - _container: true - }); - state2.open = true; + if (!ascending5) { + while (pathIdx < path4.length - 1 && g2.node(pathV = path4[pathIdx + 1]).minRank <= node2.rank) { + pathIdx++; + } + pathV = path4[pathIdx]; } - effects.enter("blockQuotePrefix"); - effects.enter("blockQuoteMarker"); - effects.consume(code); - effects.exit("blockQuoteMarker"); - return after; + g2.setParent(v3, pathV); + v3 = g2.successors(v3)[0]; } - return nok(code); - } - function after(code) { - if (markdownSpace(code)) { - effects.enter("blockQuotePrefixWhitespace"); - effects.consume(code); - effects.exit("blockQuotePrefixWhitespace"); - effects.exit("blockQuotePrefix"); - return ok; - } - effects.exit("blockQuotePrefix"); - return ok(code); - } + }); } - function tokenizeBlockQuoteContinuation(effects, ok, nok) { - const self2 = this; - return contStart; - function contStart(code) { - if (markdownSpace(code)) { - return factorySpace( - effects, - contBefore, - "linePrefix", - self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 - )(code); - } - return contBefore(code); - } - function contBefore(code) { - return effects.attempt(blockQuote, ok, nok)(code); + function findPath(g2, postorderNums, v3, w3) { + var vPath = []; + var wPath = []; + var low = Math.min(postorderNums[v3].low, postorderNums[w3].low); + var lim = Math.max(postorderNums[v3].lim, postorderNums[w3].lim); + var parent4; + var lca; + parent4 = v3; + do { + parent4 = g2.parent(parent4); + vPath.push(parent4); + } while (parent4 && (postorderNums[parent4].low > low || lim > postorderNums[parent4].lim)); + lca = parent4; + parent4 = w3; + while ((parent4 = g2.parent(parent4)) !== lca) { + wPath.push(parent4); } + return { path: vPath.concat(wPath.reverse()), lca }; } - function exit(effects) { - effects.exit("blockQuote"); - } - const characterEscape = { - name: "characterEscape", - tokenize: tokenizeCharacterEscape - }; - function tokenizeCharacterEscape(effects, ok, nok) { - return start2; - function start2(code) { - effects.enter("characterEscape"); - effects.enter("escapeMarker"); - effects.consume(code); - effects.exit("escapeMarker"); - return inside; - } - function inside(code) { - if (asciiPunctuation(code)) { - effects.enter("characterEscapeValue"); - effects.consume(code); - effects.exit("characterEscapeValue"); - effects.exit("characterEscape"); - return ok; - } - return nok(code); - } - } - const element = document.createElement("i"); - function decodeNamedCharacterReference(value2) { - const characterReference2 = "&" + value2 + ";"; - element.innerHTML = characterReference2; - const char2 = element.textContent; - if (char2.charCodeAt(char2.length - 1) === 59 && value2 !== "semi") { - return false; + function postorder2(g2) { + var result = {}; + var lim = 0; + function dfs3(v3) { + var low = lim; + forEach_default(g2.children(v3), dfs3); + result[v3] = { low, lim: lim++ }; } - return char2 === characterReference2 ? false : char2; + __name(dfs3, "dfs"); + forEach_default(g2.children(), dfs3); + return result; } - const characterReference = { - name: "characterReference", - tokenize: tokenizeCharacterReference - }; - function tokenizeCharacterReference(effects, ok, nok) { - const self2 = this; - let size2 = 0; - let max2; - let test; - return start2; - function start2(code) { - effects.enter("characterReference"); - effects.enter("characterReferenceMarker"); - effects.consume(code); - effects.exit("characterReferenceMarker"); - return open2; - } - function open2(code) { - if (code === 35) { - effects.enter("characterReferenceMarkerNumeric"); - effects.consume(code); - effects.exit("characterReferenceMarkerNumeric"); - return numeric; - } - effects.enter("characterReferenceValue"); - max2 = 31; - test = asciiAlphanumeric; - return value2(code); - } - function numeric(code) { - if (code === 88 || code === 120) { - effects.enter("characterReferenceMarkerHexadecimal"); - effects.consume(code); - effects.exit("characterReferenceMarkerHexadecimal"); - effects.enter("characterReferenceValue"); - max2 = 6; - test = asciiHexDigit; - return value2; - } - effects.enter("characterReferenceValue"); - max2 = 7; - test = asciiDigit; - return value2(code); - } - function value2(code) { - if (code === 59 && size2) { - const token2 = effects.exit("characterReferenceValue"); - if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self2.sliceSerialize(token2))) { - return nok(code); - } - effects.enter("characterReferenceMarker"); - effects.consume(code); - effects.exit("characterReferenceMarker"); - effects.exit("characterReference"); - return ok; - } - if (test(code) && size2++ < max2) { - effects.consume(code); - return value2; - } - return nok(code); + var init_parent_dummy_chains = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js"() { + "use strict"; + init_lodash(); + __name(parentDummyChains, "parentDummyChains"); + __name(findPath, "findPath"); + __name(postorder2, "postorder"); } - } - const nonLazyContinuation = { - tokenize: tokenizeNonLazyContinuation, - partial: true - }; - const codeFenced = { - name: "codeFenced", - tokenize: tokenizeCodeFenced, - concrete: true - }; - function tokenizeCodeFenced(effects, ok, nok) { - const self2 = this; - const closeStart = { - tokenize: tokenizeCloseStart, - partial: true - }; - let initialPrefix = 0; - let sizeOpen = 0; - let marker; - return start2; - function start2(code) { - return beforeSequenceOpen(code); - } - function beforeSequenceOpen(code) { - const tail = self2.events[self2.events.length - 1]; - initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; - marker = code; - effects.enter("codeFenced"); - effects.enter("codeFencedFence"); - effects.enter("codeFencedFenceSequence"); - return sequenceOpen(code); - } - function sequenceOpen(code) { - if (code === marker) { - sizeOpen++; - effects.consume(code); - return sequenceOpen; - } - if (sizeOpen < 3) { - return nok(code); - } - effects.exit("codeFencedFenceSequence"); - return markdownSpace(code) ? factorySpace(effects, infoBefore, "whitespace")(code) : infoBefore(code); - } - function infoBefore(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("codeFencedFence"); - return self2.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code); - } - effects.enter("codeFencedFenceInfo"); - effects.enter("chunkString", { - contentType: "string" + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/bk.js + function findType1Conflicts(g2, layering) { + var conflicts = {}; + function visitLayer(prevLayer, layer) { + var k0 = 0, scanPos = 0, prevLayerLength = prevLayer.length, lastNode = last_default(layer); + forEach_default(layer, function(v3, i2) { + var w3 = findOtherInnerSegmentNode(g2, v3), k1 = w3 ? g2.node(w3).order : prevLayerLength; + if (w3 || v3 === lastNode) { + forEach_default(layer.slice(scanPos, i2 + 1), function(scanNode) { + forEach_default(g2.predecessors(scanNode), function(u2) { + var uLabel = g2.node(u2), uPos = uLabel.order; + if ((uPos < k0 || k1 < uPos) && !(uLabel.dummy && g2.node(scanNode).dummy)) { + addConflict(conflicts, u2, scanNode); + } + }); + }); + scanPos = i2 + 1; + k0 = k1; + } }); - return info2(code); - } - function info2(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("chunkString"); - effects.exit("codeFencedFenceInfo"); - return infoBefore(code); - } - if (markdownSpace(code)) { - effects.exit("chunkString"); - effects.exit("codeFencedFenceInfo"); - return factorySpace(effects, metaBefore, "whitespace")(code); - } - if (code === 96 && code === marker) { - return nok(code); - } - effects.consume(code); - return info2; + return layer; } - function metaBefore(code) { - if (code === null || markdownLineEnding(code)) { - return infoBefore(code); - } - effects.enter("codeFencedFenceMeta"); - effects.enter("chunkString", { - contentType: "string" + __name(visitLayer, "visitLayer"); + reduce_default(layering, visitLayer); + return conflicts; + } + function findType2Conflicts(g2, layering) { + var conflicts = {}; + function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { + var v3; + forEach_default(range_default(southPos, southEnd), function(i2) { + v3 = south[i2]; + if (g2.node(v3).dummy) { + forEach_default(g2.predecessors(v3), function(u2) { + var uNode = g2.node(u2); + if (uNode.dummy && (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { + addConflict(conflicts, u2, v3); + } + }); + } }); - return meta(code); - } - function meta(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("chunkString"); - effects.exit("codeFencedFenceMeta"); - return infoBefore(code); - } - if (code === 96 && code === marker) { - return nok(code); - } - effects.consume(code); - return meta; - } - function atNonLazyBreak(code) { - return effects.attempt(closeStart, after, contentBefore)(code); - } - function contentBefore(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return contentStart; - } - function contentStart(code) { - return initialPrefix > 0 && markdownSpace(code) ? factorySpace( - effects, - beforeContentChunk, - "linePrefix", - initialPrefix + 1 - )(code) : beforeContentChunk(code); - } - function beforeContentChunk(code) { - if (code === null || markdownLineEnding(code)) { - return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code); - } - effects.enter("codeFlowValue"); - return contentChunk(code); - } - function contentChunk(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("codeFlowValue"); - return beforeContentChunk(code); - } - effects.consume(code); - return contentChunk; - } - function after(code) { - effects.exit("codeFenced"); - return ok(code); - } - function tokenizeCloseStart(effects2, ok2, nok2) { - let size2 = 0; - return startBefore; - function startBefore(code) { - effects2.enter("lineEnding"); - effects2.consume(code); - effects2.exit("lineEnding"); - return start3; - } - function start3(code) { - effects2.enter("codeFencedFence"); - return markdownSpace(code) ? factorySpace( - effects2, - beforeSequenceClose, - "linePrefix", - self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 - )(code) : beforeSequenceClose(code); - } - function beforeSequenceClose(code) { - if (code === marker) { - effects2.enter("codeFencedFenceSequence"); - return sequenceClose(code); - } - return nok2(code); - } - function sequenceClose(code) { - if (code === marker) { - size2++; - effects2.consume(code); - return sequenceClose; - } - if (size2 >= sizeOpen) { - effects2.exit("codeFencedFenceSequence"); - return markdownSpace(code) ? factorySpace(effects2, sequenceCloseAfter, "whitespace")(code) : sequenceCloseAfter(code); - } - return nok2(code); - } - function sequenceCloseAfter(code) { - if (code === null || markdownLineEnding(code)) { - effects2.exit("codeFencedFence"); - return ok2(code); - } - return nok2(code); - } - } - } - function tokenizeNonLazyContinuation(effects, ok, nok) { - const self2 = this; - return start2; - function start2(code) { - if (code === null) { - return nok(code); - } - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return lineStart; - } - function lineStart(code) { - return self2.parser.lazy[self2.now().line] ? nok(code) : ok(code); - } - } - const codeIndented = { - name: "codeIndented", - tokenize: tokenizeCodeIndented - }; - const furtherStart = { - tokenize: tokenizeFurtherStart, - partial: true - }; - function tokenizeCodeIndented(effects, ok, nok) { - const self2 = this; - return start2; - function start2(code) { - effects.enter("codeIndented"); - return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code); - } - function afterPrefix(code) { - const tail = self2.events[self2.events.length - 1]; - return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code) : nok(code); - } - function atBreak(code) { - if (code === null) { - return after(code); - } - if (markdownLineEnding(code)) { - return effects.attempt(furtherStart, atBreak, after)(code); - } - effects.enter("codeFlowValue"); - return inside(code); } - function inside(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("codeFlowValue"); - return atBreak(code); - } - effects.consume(code); - return inside; + __name(scan, "scan"); + function visitLayer(north, south) { + var prevNorthPos = -1, nextNorthPos, southPos = 0; + forEach_default(south, function(v3, southLookahead) { + if (g2.node(v3).dummy === "border") { + var predecessors = g2.predecessors(v3); + if (predecessors.length) { + nextNorthPos = g2.node(predecessors[0]).order; + scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); + southPos = southLookahead; + prevNorthPos = nextNorthPos; + } + } + scan(south, southPos, south.length, nextNorthPos, north.length); + }); + return south; } - function after(code) { - effects.exit("codeIndented"); - return ok(code); + __name(visitLayer, "visitLayer"); + reduce_default(layering, visitLayer); + return conflicts; + } + function findOtherInnerSegmentNode(g2, v3) { + if (g2.node(v3).dummy) { + return find_default(g2.predecessors(v3), function(u2) { + return g2.node(u2).dummy; + }); } } - function tokenizeFurtherStart(effects, ok, nok) { - const self2 = this; - return furtherStart2; - function furtherStart2(code) { - if (self2.parser.lazy[self2.now().line]) { - return nok(code); - } - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return furtherStart2; - } - return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code); + function addConflict(conflicts, v3, w3) { + if (v3 > w3) { + var tmp = v3; + v3 = w3; + w3 = tmp; } - function afterPrefix(code) { - const tail = self2.events[self2.events.length - 1]; - return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? furtherStart2(code) : nok(code); + var conflictsV = conflicts[v3]; + if (!conflictsV) { + conflicts[v3] = conflictsV = {}; } + conflictsV[w3] = true; } - const codeText = { - name: "codeText", - tokenize: tokenizeCodeText, - resolve: resolveCodeText, - previous - }; - function resolveCodeText(events) { - let tailExitIndex = events.length - 4; - let headEnterIndex = 3; - let index2; - let enter2; - if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) { - index2 = headEnterIndex; - while (++index2 < tailExitIndex) { - if (events[index2][1].type === "codeTextData") { - events[headEnterIndex][1].type = "codeTextPadding"; - events[tailExitIndex][1].type = "codeTextPadding"; - headEnterIndex += 2; - tailExitIndex -= 2; - break; - } - } + function hasConflict(conflicts, v3, w3) { + if (v3 > w3) { + var tmp = v3; + v3 = w3; + w3 = tmp; } - index2 = headEnterIndex - 1; - tailExitIndex++; - while (++index2 <= tailExitIndex) { - if (enter2 === void 0) { - if (index2 !== tailExitIndex && events[index2][1].type !== "lineEnding") { - enter2 = index2; - } - } else if (index2 === tailExitIndex || events[index2][1].type === "lineEnding") { - events[enter2][1].type = "codeTextData"; - if (index2 !== enter2 + 2) { - events[enter2][1].end = events[index2 - 1][1].end; - events.splice(enter2 + 2, index2 - enter2 - 2); - tailExitIndex -= index2 - enter2 - 2; - index2 = enter2 + 2; - } - enter2 = void 0; - } - } - return events; - } - function previous(code) { - return code !== 96 || this.events[this.events.length - 1][1].type === "characterEscape"; - } - function tokenizeCodeText(effects, ok, nok) { - let sizeOpen = 0; - let size2; - let token2; - return start2; - function start2(code) { - effects.enter("codeText"); - effects.enter("codeTextSequence"); - return sequenceOpen(code); - } - function sequenceOpen(code) { - if (code === 96) { - effects.consume(code); - sizeOpen++; - return sequenceOpen; - } - effects.exit("codeTextSequence"); - return between(code); - } - function between(code) { - if (code === null) { - return nok(code); - } - if (code === 32) { - effects.enter("space"); - effects.consume(code); - effects.exit("space"); - return between; - } - if (code === 96) { - token2 = effects.enter("codeTextSequence"); - size2 = 0; - return sequenceClose(code); - } - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return between; - } - effects.enter("codeTextData"); - return data(code); - } - function data(code) { - if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) { - effects.exit("codeTextData"); - return between(code); - } - effects.consume(code); - return data; - } - function sequenceClose(code) { - if (code === 96) { - effects.consume(code); - size2++; - return sequenceClose; - } - if (size2 === sizeOpen) { - effects.exit("codeTextSequence"); - effects.exit("codeText"); - return ok(code); - } - token2.type = "codeTextData"; - return data(code); - } - } - function subtokenize(events) { - const jumps = {}; - let index2 = -1; - let event; - let lineIndex; - let otherIndex; - let otherEvent; - let parameters; - let subevents; - let more; - while (++index2 < events.length) { - while (index2 in jumps) { - index2 = jumps[index2]; - } - event = events[index2]; - if (index2 && event[1].type === "chunkFlow" && events[index2 - 1][1].type === "listItemPrefix") { - subevents = event[1]._tokenizer.events; - otherIndex = 0; - if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") { - otherIndex += 2; - } - if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") { - while (++otherIndex < subevents.length) { - if (subevents[otherIndex][1].type === "content") { - break; - } - if (subevents[otherIndex][1].type === "chunkText") { - subevents[otherIndex][1]._isInFirstContentOfListItem = true; - otherIndex++; + return has_default(conflicts[v3], w3); + } + function verticalAlignment(g2, layering, conflicts, neighborFn) { + var root4 = {}, align = {}, pos = {}; + forEach_default(layering, function(layer) { + forEach_default(layer, function(v3, order2) { + root4[v3] = v3; + align[v3] = v3; + pos[v3] = order2; + }); + }); + forEach_default(layering, function(layer) { + var prevIdx = -1; + forEach_default(layer, function(v3) { + var ws = neighborFn(v3); + if (ws.length) { + ws = sortBy_default(ws, function(w4) { + return pos[w4]; + }); + var mp = (ws.length - 1) / 2; + for (var i2 = Math.floor(mp), il = Math.ceil(mp); i2 <= il; ++i2) { + var w3 = ws[i2]; + if (align[v3] === v3 && prevIdx < pos[w3] && !hasConflict(conflicts, v3, w3)) { + align[w3] = v3; + align[v3] = root4[v3] = root4[w3]; + prevIdx = pos[w3]; } } } - } - if (event[0] === "enter") { - if (event[1].contentType) { - Object.assign(jumps, subcontent(events, index2)); - index2 = jumps[index2]; - more = true; - } - } else if (event[1]._container) { - otherIndex = index2; - lineIndex = void 0; - while (otherIndex--) { - otherEvent = events[otherIndex]; - if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") { - if (otherEvent[0] === "enter") { - if (lineIndex) { - events[lineIndex][1].type = "lineEndingBlank"; - } - otherEvent[1].type = "lineEnding"; - lineIndex = otherIndex; - } - } else { - break; - } + }); + }); + return { root: root4, align }; + } + function horizontalCompaction(g2, layering, root4, align, reverseSep) { + var xs = {}, blockG = buildBlockGraph(g2, layering, root4, reverseSep), borderType = reverseSep ? "borderLeft" : "borderRight"; + function iterate(setXsFunc, nextNodesFunc) { + var stack = blockG.nodes(); + var elem = stack.pop(); + var visited = {}; + while (elem) { + if (visited[elem]) { + setXsFunc(elem); + } else { + visited[elem] = true; + stack.push(elem); + stack = stack.concat(nextNodesFunc(elem)); } - if (lineIndex) { - event[1].end = Object.assign({}, events[lineIndex][1].start); - parameters = events.slice(lineIndex, index2); - parameters.unshift(event); - splice(events, lineIndex, index2 - lineIndex + 1, parameters); - } - } - } - return !more; - } - function subcontent(events, eventIndex) { - const token2 = events[eventIndex][1]; - const context = events[eventIndex][2]; - let startPosition = eventIndex - 1; - const startPositions = []; - const tokenizer = token2._tokenizer || context.parser[token2.contentType](token2.start); - const childEvents = tokenizer.events; - const jumps = []; - const gaps = {}; - let stream; - let previous2; - let index2 = -1; - let current = token2; - let adjust2 = 0; - let start2 = 0; - const breaks = [start2]; - while (current) { - while (events[++startPosition][1] !== current) { - } - startPositions.push(startPosition); - if (!current._tokenizer) { - stream = context.sliceStream(current); - if (!current.next) { - stream.push(null); - } - if (previous2) { - tokenizer.defineSkip(current.start); - } - if (current._isInFirstContentOfListItem) { - tokenizer._gfmTasklistFirstContentOfListItem = true; - } - tokenizer.write(stream); - if (current._isInFirstContentOfListItem) { - tokenizer._gfmTasklistFirstContentOfListItem = void 0; - } - } - previous2 = current; - current = current.next; - } - current = token2; - while (++index2 < childEvents.length) { - if ( - // Find a void token that includes a break. - childEvents[index2][0] === "exit" && childEvents[index2 - 1][0] === "enter" && childEvents[index2][1].type === childEvents[index2 - 1][1].type && childEvents[index2][1].start.line !== childEvents[index2][1].end.line - ) { - start2 = index2 + 1; - breaks.push(start2); - current._tokenizer = void 0; - current.previous = void 0; - current = current.next; - } - } - tokenizer.events = []; - if (current) { - current._tokenizer = void 0; - current.previous = void 0; - } else { - breaks.pop(); + elem = stack.pop(); + } } - index2 = breaks.length; - while (index2--) { - const slice2 = childEvents.slice(breaks[index2], breaks[index2 + 1]); - const start3 = startPositions.pop(); - jumps.unshift([start3, start3 + slice2.length - 1]); - splice(events, start3, 2, slice2); + __name(iterate, "iterate"); + function pass1(elem) { + xs[elem] = blockG.inEdges(elem).reduce(function(acc, e3) { + return Math.max(acc, xs[e3.v] + blockG.edge(e3)); + }, 0); } - index2 = -1; - while (++index2 < jumps.length) { - gaps[adjust2 + jumps[index2][0]] = adjust2 + jumps[index2][1]; - adjust2 += jumps[index2][1] - jumps[index2][0] - 1; + __name(pass1, "pass1"); + function pass2(elem) { + var min9 = blockG.outEdges(elem).reduce(function(acc, e3) { + return Math.min(acc, xs[e3.w] - blockG.edge(e3)); + }, Number.POSITIVE_INFINITY); + var node2 = g2.node(elem); + if (min9 !== Number.POSITIVE_INFINITY && node2.borderType !== borderType) { + xs[elem] = Math.max(xs[elem], min9); + } } - return gaps; + __name(pass2, "pass2"); + iterate(pass1, blockG.predecessors.bind(blockG)); + iterate(pass2, blockG.successors.bind(blockG)); + forEach_default(align, function(v3) { + xs[v3] = xs[root4[v3]]; + }); + return xs; } - const content = { - tokenize: tokenizeContent, - resolve: resolveContent - }; - const continuationConstruct = { - tokenize: tokenizeContinuation, - partial: true - }; - function resolveContent(events) { - subtokenize(events); - return events; - } - function tokenizeContent(effects, ok) { - let previous2; - return chunkStart; - function chunkStart(code) { - effects.enter("content"); - previous2 = effects.enter("chunkContent", { - contentType: "content" - }); - return chunkInside(code); - } - function chunkInside(code) { - if (code === null) { - return contentEnd(code); - } - if (markdownLineEnding(code)) { - return effects.check( - continuationConstruct, - contentContinue, - contentEnd - )(code); - } - effects.consume(code); - return chunkInside; - } - function contentEnd(code) { - effects.exit("chunkContent"); - effects.exit("content"); - return ok(code); - } - function contentContinue(code) { - effects.consume(code); - effects.exit("chunkContent"); - previous2.next = effects.enter("chunkContent", { - contentType: "content", - previous: previous2 - }); - previous2 = previous2.next; - return chunkInside; - } - } - function tokenizeContinuation(effects, ok, nok) { - const self2 = this; - return startLookahead; - function startLookahead(code) { - effects.exit("chunkContent"); - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, prefixed, "linePrefix"); - } - function prefixed(code) { - if (code === null || markdownLineEnding(code)) { - return nok(code); - } - const tail = self2.events[self2.events.length - 1]; - if (!self2.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) { - return ok(code); - } - return effects.interrupt(self2.parser.constructs.flow, nok, ok)(code); - } - } - function factoryDestination(effects, ok, nok, type2, literalType, literalMarkerType, rawType, stringType, max2) { - const limit = max2 || Number.POSITIVE_INFINITY; - let balance2 = 0; - return start2; - function start2(code) { - if (code === 60) { - effects.enter(type2); - effects.enter(literalType); - effects.enter(literalMarkerType); - effects.consume(code); - effects.exit(literalMarkerType); - return enclosedBefore; - } - if (code === null || code === 32 || code === 41 || asciiControl(code)) { - return nok(code); - } - effects.enter(type2); - effects.enter(rawType); - effects.enter(stringType); - effects.enter("chunkString", { - contentType: "string" - }); - return raw(code); - } - function enclosedBefore(code) { - if (code === 62) { - effects.enter(literalMarkerType); - effects.consume(code); - effects.exit(literalMarkerType); - effects.exit(literalType); - effects.exit(type2); - return ok; - } - effects.enter(stringType); - effects.enter("chunkString", { - contentType: "string" + function buildBlockGraph(g2, layering, root4, reverseSep) { + var blockGraph = new Graph(), graphLabel = g2.graph(), sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); + forEach_default(layering, function(layer) { + var u2; + forEach_default(layer, function(v3) { + var vRoot = root4[v3]; + blockGraph.setNode(vRoot); + if (u2) { + var uRoot = root4[u2], prevMax = blockGraph.edge(uRoot, vRoot); + blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g2, v3, u2), prevMax || 0)); + } + u2 = v3; }); - return enclosed(code); - } - function enclosed(code) { - if (code === 62) { - effects.exit("chunkString"); - effects.exit(stringType); - return enclosedBefore(code); - } - if (code === null || code === 60 || markdownLineEnding(code)) { - return nok(code); - } - effects.consume(code); - return code === 92 ? enclosedEscape : enclosed; - } - function enclosedEscape(code) { - if (code === 60 || code === 62 || code === 92) { - effects.consume(code); - return enclosed; - } - return enclosed(code); - } - function raw(code) { - if (!balance2 && (code === null || code === 41 || markdownLineEndingOrSpace(code))) { - effects.exit("chunkString"); - effects.exit(stringType); - effects.exit(rawType); - effects.exit(type2); - return ok(code); - } - if (balance2 < limit && code === 40) { - effects.consume(code); - balance2++; - return raw; - } - if (code === 41) { - effects.consume(code); - balance2--; - return raw; - } - if (code === null || code === 32 || code === 40 || asciiControl(code)) { - return nok(code); - } - effects.consume(code); - return code === 92 ? rawEscape : raw; - } - function rawEscape(code) { - if (code === 40 || code === 41 || code === 92) { - effects.consume(code); - return raw; - } - return raw(code); - } - } - function factoryLabel(effects, ok, nok, type2, markerType, stringType) { - const self2 = this; - let size2 = 0; - let seen; - return start2; - function start2(code) { - effects.enter(type2); - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - effects.enter(stringType); - return atBreak; - } - function atBreak(code) { - if (size2 > 999 || code === null || code === 91 || code === 93 && !seen || // To do: remove in the future once we’ve switched from - // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, - // which doesn’t need this. - // Hidden footnotes hook. - /* c8 ignore next 3 */ - code === 94 && !size2 && "_hiddenFootnoteSupport" in self2.parser.constructs) { - return nok(code); - } - if (code === 93) { - effects.exit(stringType); - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - effects.exit(type2); - return ok; - } - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return atBreak; - } - effects.enter("chunkString", { - contentType: "string" + }); + return blockGraph; + } + function findSmallestWidthAlignment(g2, xss) { + return minBy_default(values_default(xss), function(xs) { + var max10 = Number.NEGATIVE_INFINITY; + var min9 = Number.POSITIVE_INFINITY; + forIn_default(xs, function(x5, v3) { + var halfWidth = width(g2, v3) / 2; + max10 = Math.max(x5 + halfWidth, max10); + min9 = Math.min(x5 - halfWidth, min9); }); - return labelInside(code); - } - function labelInside(code) { - if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size2++ > 999) { - effects.exit("chunkString"); - return atBreak(code); - } - effects.consume(code); - if (!seen) - seen = !markdownSpace(code); - return code === 92 ? labelEscape : labelInside; - } - function labelEscape(code) { - if (code === 91 || code === 92 || code === 93) { - effects.consume(code); - size2++; - return labelInside; - } - return labelInside(code); - } + return max10 - min9; + }); } - function factoryTitle(effects, ok, nok, type2, markerType, stringType) { - let marker; - return start2; - function start2(code) { - if (code === 34 || code === 39 || code === 40) { - effects.enter(type2); - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - marker = code === 40 ? 41 : code; - return begin; - } - return nok(code); - } - function begin(code) { - if (code === marker) { - effects.enter(markerType); - effects.consume(code); - effects.exit(markerType); - effects.exit(type2); - return ok; - } - effects.enter(stringType); - return atBreak(code); - } - function atBreak(code) { - if (code === marker) { - effects.exit(stringType); - return begin(marker); - } - if (code === null) { - return nok(code); - } - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, atBreak, "linePrefix"); - } - effects.enter("chunkString", { - contentType: "string" + function alignCoordinates(xss, alignTo) { + var alignToVals = values_default(alignTo), alignToMin = min_default(alignToVals), alignToMax = max_default(alignToVals); + forEach_default(["u", "d"], function(vert) { + forEach_default(["l", "r"], function(horiz) { + var alignment = vert + horiz, xs = xss[alignment], delta; + if (xs === alignTo) return; + var xsVals = values_default(xs); + delta = horiz === "l" ? alignToMin - min_default(xsVals) : alignToMax - max_default(xsVals); + if (delta) { + xss[alignment] = mapValues_default(xs, function(x5) { + return x5 + delta; + }); + } }); - return inside(code); - } - function inside(code) { - if (code === marker || code === null || markdownLineEnding(code)) { - effects.exit("chunkString"); - return atBreak(code); - } - effects.consume(code); - return code === 92 ? escape2 : inside; - } - function escape2(code) { - if (code === marker || code === 92) { - effects.consume(code); - return inside; - } - return inside(code); - } + }); } - function factoryWhitespace(effects, ok) { - let seen; - return start2; - function start2(code) { - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - seen = true; - return start2; - } - if (markdownSpace(code)) { - return factorySpace( - effects, - start2, - seen ? "linePrefix" : "lineSuffix" - )(code); + function balance(xss, align) { + return mapValues_default(xss.ul, function(ignore, v3) { + if (align) { + return xss[align.toLowerCase()][v3]; + } else { + var xs = sortBy_default(map_default(xss, v3)); + return (xs[1] + xs[2]) / 2; } - return ok(code); - } - } - function normalizeIdentifier(value2) { - return value2.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); + }); } - const definition = { - name: "definition", - tokenize: tokenizeDefinition - }; - const titleBefore = { - tokenize: tokenizeTitleBefore, - partial: true - }; - function tokenizeDefinition(effects, ok, nok) { - const self2 = this; - let identifier2; - return start2; - function start2(code) { - effects.enter("definition"); - return before(code); - } - function before(code) { - return factoryLabel.call( - self2, - effects, - labelAfter, - // Note: we don’t need to reset the way `markdown-rs` does. - nok, - "definitionLabel", - "definitionLabelMarker", - "definitionLabelString" - )(code); - } - function labelAfter(code) { - identifier2 = normalizeIdentifier( - self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1) - ); - if (code === 58) { - effects.enter("definitionMarker"); - effects.consume(code); - effects.exit("definitionMarker"); - return markerAfter; - } - return nok(code); - } - function markerAfter(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code); - } - function destinationBefore(code) { - return factoryDestination( - effects, - destinationAfter, - // Note: we don’t need to reset the way `markdown-rs` does. - nok, - "definitionDestination", - "definitionDestinationLiteral", - "definitionDestinationLiteralMarker", - "definitionDestinationRaw", - "definitionDestinationString" - )(code); - } - function destinationAfter(code) { - return effects.attempt(titleBefore, after, after)(code); - } - function after(code) { - return markdownSpace(code) ? factorySpace(effects, afterWhitespace, "whitespace")(code) : afterWhitespace(code); - } - function afterWhitespace(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("definition"); - self2.parser.defined.push(identifier2); - return ok(code); - } - return nok(code); - } - } - function tokenizeTitleBefore(effects, ok, nok) { - return titleBefore2; - function titleBefore2(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code); - } - function beforeMarker(code) { - return factoryTitle( - effects, - titleAfter, - nok, - "definitionTitle", - "definitionTitleMarker", - "definitionTitleString" - )(code); - } - function titleAfter(code) { - return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, "whitespace")(code) : titleAfterOptionalWhitespace(code); - } - function titleAfterOptionalWhitespace(code) { - return code === null || markdownLineEnding(code) ? ok(code) : nok(code); - } - } - const hardBreakEscape = { - name: "hardBreakEscape", - tokenize: tokenizeHardBreakEscape - }; - function tokenizeHardBreakEscape(effects, ok, nok) { - return start2; - function start2(code) { - effects.enter("hardBreakEscape"); - effects.consume(code); - return after; - } - function after(code) { - if (markdownLineEnding(code)) { - effects.exit("hardBreakEscape"); - return ok(code); - } - return nok(code); - } - } - const headingAtx = { - name: "headingAtx", - tokenize: tokenizeHeadingAtx, - resolve: resolveHeadingAtx - }; - function resolveHeadingAtx(events, context) { - let contentEnd = events.length - 2; - let contentStart = 3; - let content2; - let text2; - if (events[contentStart][1].type === "whitespace") { - contentStart += 2; - } - if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") { - contentEnd -= 2; - } - if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) { - contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; - } - if (contentEnd > contentStart) { - content2 = { - type: "atxHeadingText", - start: events[contentStart][1].start, - end: events[contentEnd][1].end - }; - text2 = { - type: "chunkText", - start: events[contentStart][1].start, - end: events[contentEnd][1].end, - contentType: "text" - }; - splice(events, contentStart, contentEnd - contentStart + 1, [ - ["enter", content2, context], - ["enter", text2, context], - ["exit", text2, context], - ["exit", content2, context] - ]); - } - return events; - } - function tokenizeHeadingAtx(effects, ok, nok) { - let size2 = 0; - return start2; - function start2(code) { - effects.enter("atxHeading"); - return before(code); - } - function before(code) { - effects.enter("atxHeadingSequence"); - return sequenceOpen(code); - } - function sequenceOpen(code) { - if (code === 35 && size2++ < 6) { - effects.consume(code); - return sequenceOpen; - } - if (code === null || markdownLineEndingOrSpace(code)) { - effects.exit("atxHeadingSequence"); - return atBreak(code); - } - return nok(code); - } - function atBreak(code) { - if (code === 35) { - effects.enter("atxHeadingSequence"); - return sequenceFurther(code); - } - if (code === null || markdownLineEnding(code)) { - effects.exit("atxHeading"); - return ok(code); - } - if (markdownSpace(code)) { - return factorySpace(effects, atBreak, "whitespace")(code); - } - effects.enter("atxHeadingText"); - return data(code); - } - function sequenceFurther(code) { - if (code === 35) { - effects.consume(code); - return sequenceFurther; - } - effects.exit("atxHeadingSequence"); - return atBreak(code); - } - function data(code) { - if (code === null || code === 35 || markdownLineEndingOrSpace(code)) { - effects.exit("atxHeadingText"); - return atBreak(code); - } - effects.consume(code); - return data; - } - } - const htmlBlockNames = [ - "address", - "article", - "aside", - "base", - "basefont", - "blockquote", - "body", - "caption", - "center", - "col", - "colgroup", - "dd", - "details", - "dialog", - "dir", - "div", - "dl", - "dt", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "frame", - "frameset", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hr", - "html", - "iframe", - "legend", - "li", - "link", - "main", - "menu", - "menuitem", - "nav", - "noframes", - "ol", - "optgroup", - "option", - "p", - "param", - "search", - "section", - "summary", - "table", - "tbody", - "td", - "tfoot", - "th", - "thead", - "title", - "tr", - "track", - "ul" - ]; - const htmlRawNames = ["pre", "script", "style", "textarea"]; - const htmlFlow = { - name: "htmlFlow", - tokenize: tokenizeHtmlFlow, - resolveTo: resolveToHtmlFlow, - concrete: true - }; - const blankLineBefore = { - tokenize: tokenizeBlankLineBefore, - partial: true - }; - const nonLazyContinuationStart = { - tokenize: tokenizeNonLazyContinuationStart, - partial: true - }; - function resolveToHtmlFlow(events) { - let index2 = events.length; - while (index2--) { - if (events[index2][0] === "enter" && events[index2][1].type === "htmlFlow") { - break; - } - } - if (index2 > 1 && events[index2 - 2][1].type === "linePrefix") { - events[index2][1].start = events[index2 - 2][1].start; - events[index2 + 1][1].start = events[index2 - 2][1].start; - events.splice(index2 - 2, 2); - } - return events; + function positionX(g2) { + var layering = buildLayerMatrix(g2); + var conflicts = merge_default3(findType1Conflicts(g2, layering), findType2Conflicts(g2, layering)); + var xss = {}; + var adjustedLayering; + forEach_default(["u", "d"], function(vert) { + adjustedLayering = vert === "u" ? layering : values_default(layering).reverse(); + forEach_default(["l", "r"], function(horiz) { + if (horiz === "r") { + adjustedLayering = map_default(adjustedLayering, function(inner2) { + return values_default(inner2).reverse(); + }); + } + var neighborFn = (vert === "u" ? g2.predecessors : g2.successors).bind(g2); + var align = verticalAlignment(g2, adjustedLayering, conflicts, neighborFn); + var xs = horizontalCompaction(g2, adjustedLayering, align.root, align.align, horiz === "r"); + if (horiz === "r") { + xs = mapValues_default(xs, function(x5) { + return -x5; + }); + } + xss[vert + horiz] = xs; + }); + }); + var smallestWidth = findSmallestWidthAlignment(g2, xss); + alignCoordinates(xss, smallestWidth); + return balance(xss, g2.graph().align); } - function tokenizeHtmlFlow(effects, ok, nok) { - const self2 = this; - let marker; - let closingTag; - let buffer; - let index2; - let markerB; - return start2; - function start2(code) { - return before(code); - } - function before(code) { - effects.enter("htmlFlow"); - effects.enter("htmlFlowData"); - effects.consume(code); - return open2; - } - function open2(code) { - if (code === 33) { - effects.consume(code); - return declarationOpen; - } - if (code === 47) { - effects.consume(code); - closingTag = true; - return tagCloseStart; - } - if (code === 63) { - effects.consume(code); - marker = 3; - return self2.interrupt ? ok : continuationDeclarationInside; - } - if (asciiAlpha(code)) { - effects.consume(code); - buffer = String.fromCharCode(code); - return tagName; - } - return nok(code); - } - function declarationOpen(code) { - if (code === 45) { - effects.consume(code); - marker = 2; - return commentOpenInside; - } - if (code === 91) { - effects.consume(code); - marker = 5; - index2 = 0; - return cdataOpenInside; - } - if (asciiAlpha(code)) { - effects.consume(code); - marker = 4; - return self2.interrupt ? ok : continuationDeclarationInside; - } - return nok(code); - } - function commentOpenInside(code) { - if (code === 45) { - effects.consume(code); - return self2.interrupt ? ok : continuationDeclarationInside; - } - return nok(code); - } - function cdataOpenInside(code) { - const value2 = "CDATA["; - if (code === value2.charCodeAt(index2++)) { - effects.consume(code); - if (index2 === value2.length) { - return self2.interrupt ? ok : continuation; - } - return cdataOpenInside; - } - return nok(code); - } - function tagCloseStart(code) { - if (asciiAlpha(code)) { - effects.consume(code); - buffer = String.fromCharCode(code); - return tagName; - } - return nok(code); - } - function tagName(code) { - if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { - const slash = code === 47; - const name = buffer.toLowerCase(); - if (!slash && !closingTag && htmlRawNames.includes(name)) { - marker = 1; - return self2.interrupt ? ok(code) : continuation(code); - } - if (htmlBlockNames.includes(buffer.toLowerCase())) { - marker = 6; - if (slash) { - effects.consume(code); - return basicSelfClosing; - } - return self2.interrupt ? ok(code) : continuation(code); - } - marker = 7; - return self2.interrupt && !self2.parser.lazy[self2.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code); - } - if (code === 45 || asciiAlphanumeric(code)) { - effects.consume(code); - buffer += String.fromCharCode(code); - return tagName; - } - return nok(code); - } - function basicSelfClosing(code) { - if (code === 62) { - effects.consume(code); - return self2.interrupt ? ok : continuation; - } - return nok(code); - } - function completeClosingTagAfter(code) { - if (markdownSpace(code)) { - effects.consume(code); - return completeClosingTagAfter; - } - return completeEnd(code); - } - function completeAttributeNameBefore(code) { - if (code === 47) { - effects.consume(code); - return completeEnd; - } - if (code === 58 || code === 95 || asciiAlpha(code)) { - effects.consume(code); - return completeAttributeName; - } - if (markdownSpace(code)) { - effects.consume(code); - return completeAttributeNameBefore; - } - return completeEnd(code); - } - function completeAttributeName(code) { - if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) { - effects.consume(code); - return completeAttributeName; - } - return completeAttributeNameAfter(code); - } - function completeAttributeNameAfter(code) { - if (code === 61) { - effects.consume(code); - return completeAttributeValueBefore; - } - if (markdownSpace(code)) { - effects.consume(code); - return completeAttributeNameAfter; - } - return completeAttributeNameBefore(code); - } - function completeAttributeValueBefore(code) { - if (code === null || code === 60 || code === 61 || code === 62 || code === 96) { - return nok(code); - } - if (code === 34 || code === 39) { - effects.consume(code); - markerB = code; - return completeAttributeValueQuoted; - } - if (markdownSpace(code)) { - effects.consume(code); - return completeAttributeValueBefore; - } - return completeAttributeValueUnquoted(code); - } - function completeAttributeValueQuoted(code) { - if (code === markerB) { - effects.consume(code); - markerB = null; - return completeAttributeValueQuotedAfter; - } - if (code === null || markdownLineEnding(code)) { - return nok(code); - } - effects.consume(code); - return completeAttributeValueQuoted; - } - function completeAttributeValueUnquoted(code) { - if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) { - return completeAttributeNameAfter(code); - } - effects.consume(code); - return completeAttributeValueUnquoted; - } - function completeAttributeValueQuotedAfter(code) { - if (code === 47 || code === 62 || markdownSpace(code)) { - return completeAttributeNameBefore(code); - } - return nok(code); - } - function completeEnd(code) { - if (code === 62) { - effects.consume(code); - return completeAfter; - } - return nok(code); - } - function completeAfter(code) { - if (code === null || markdownLineEnding(code)) { - return continuation(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return completeAfter; - } - return nok(code); - } - function continuation(code) { - if (code === 45 && marker === 2) { - effects.consume(code); - return continuationCommentInside; - } - if (code === 60 && marker === 1) { - effects.consume(code); - return continuationRawTagOpen; - } - if (code === 62 && marker === 4) { - effects.consume(code); - return continuationClose; - } - if (code === 63 && marker === 3) { - effects.consume(code); - return continuationDeclarationInside; - } - if (code === 93 && marker === 5) { - effects.consume(code); - return continuationCdataInside; - } - if (markdownLineEnding(code) && (marker === 6 || marker === 7)) { - effects.exit("htmlFlowData"); - return effects.check( - blankLineBefore, - continuationAfter, - continuationStart - )(code); - } - if (code === null || markdownLineEnding(code)) { - effects.exit("htmlFlowData"); - return continuationStart(code); - } - effects.consume(code); - return continuation; - } - function continuationStart(code) { - return effects.check( - nonLazyContinuationStart, - continuationStartNonLazy, - continuationAfter - )(code); - } - function continuationStartNonLazy(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return continuationBefore; - } - function continuationBefore(code) { - if (code === null || markdownLineEnding(code)) { - return continuationStart(code); - } - effects.enter("htmlFlowData"); - return continuation(code); - } - function continuationCommentInside(code) { - if (code === 45) { - effects.consume(code); - return continuationDeclarationInside; - } - return continuation(code); - } - function continuationRawTagOpen(code) { - if (code === 47) { - effects.consume(code); - buffer = ""; - return continuationRawEndTag; - } - return continuation(code); - } - function continuationRawEndTag(code) { - if (code === 62) { - const name = buffer.toLowerCase(); - if (htmlRawNames.includes(name)) { - effects.consume(code); - return continuationClose; + function sep(nodeSep, edgeSep, reverseSep) { + return function(g2, v3, w3) { + var vLabel = g2.node(v3); + var wLabel = g2.node(w3); + var sum2 = 0; + var delta; + sum2 += vLabel.width / 2; + if (has_default(vLabel, "labelpos")) { + switch (vLabel.labelpos.toLowerCase()) { + case "l": + delta = -vLabel.width / 2; + break; + case "r": + delta = vLabel.width / 2; + break; } - return continuation(code); } - if (asciiAlpha(code) && buffer.length < 8) { - effects.consume(code); - buffer += String.fromCharCode(code); - return continuationRawEndTag; + if (delta) { + sum2 += reverseSep ? delta : -delta; } - return continuation(code); - } - function continuationCdataInside(code) { - if (code === 93) { - effects.consume(code); - return continuationDeclarationInside; + delta = 0; + sum2 += (vLabel.dummy ? edgeSep : nodeSep) / 2; + sum2 += (wLabel.dummy ? edgeSep : nodeSep) / 2; + sum2 += wLabel.width / 2; + if (has_default(wLabel, "labelpos")) { + switch (wLabel.labelpos.toLowerCase()) { + case "l": + delta = wLabel.width / 2; + break; + case "r": + delta = -wLabel.width / 2; + break; + } } - return continuation(code); - } - function continuationDeclarationInside(code) { - if (code === 62) { - effects.consume(code); - return continuationClose; - } - if (code === 45 && marker === 2) { - effects.consume(code); - return continuationDeclarationInside; - } - return continuation(code); - } - function continuationClose(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("htmlFlowData"); - return continuationAfter(code); - } - effects.consume(code); - return continuationClose; - } - function continuationAfter(code) { - effects.exit("htmlFlow"); - return ok(code); - } - } - function tokenizeNonLazyContinuationStart(effects, ok, nok) { - const self2 = this; - return start2; - function start2(code) { - if (markdownLineEnding(code)) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return after; + if (delta) { + sum2 += reverseSep ? delta : -delta; } - return nok(code); - } - function after(code) { - return self2.parser.lazy[self2.now().line] ? nok(code) : ok(code); - } + delta = 0; + return sum2; + }; } - function tokenizeBlankLineBefore(effects, ok, nok) { - return start2; - function start2(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return effects.attempt(blankLine, ok, nok); + function width(g2, v3) { + return g2.node(v3).width; + } + var init_bk = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/bk.js"() { + "use strict"; + init_lodash(); + init_graphlib(); + init_util3(); + __name(findType1Conflicts, "findType1Conflicts"); + __name(findType2Conflicts, "findType2Conflicts"); + __name(findOtherInnerSegmentNode, "findOtherInnerSegmentNode"); + __name(addConflict, "addConflict"); + __name(hasConflict, "hasConflict"); + __name(verticalAlignment, "verticalAlignment"); + __name(horizontalCompaction, "horizontalCompaction"); + __name(buildBlockGraph, "buildBlockGraph"); + __name(findSmallestWidthAlignment, "findSmallestWidthAlignment"); + __name(alignCoordinates, "alignCoordinates"); + __name(balance, "balance"); + __name(positionX, "positionX"); + __name(sep, "sep"); + __name(width, "width"); } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/index.js + function position(g2) { + g2 = asNonCompoundGraph(g2); + positionY(g2); + forOwn_default(positionX(g2), function(x5, v3) { + g2.node(v3).x = x5; + }); } - const htmlText = { - name: "htmlText", - tokenize: tokenizeHtmlText - }; - function tokenizeHtmlText(effects, ok, nok) { - const self2 = this; - let marker; - let index2; - let returnState; - return start2; - function start2(code) { - effects.enter("htmlText"); - effects.enter("htmlTextData"); - effects.consume(code); - return open2; - } - function open2(code) { - if (code === 33) { - effects.consume(code); - return declarationOpen; - } - if (code === 47) { - effects.consume(code); - return tagCloseStart; - } - if (code === 63) { - effects.consume(code); - return instruction; - } - if (asciiAlpha(code)) { - effects.consume(code); - return tagOpen; - } - return nok(code); - } - function declarationOpen(code) { - if (code === 45) { - effects.consume(code); - return commentOpenInside; - } - if (code === 91) { - effects.consume(code); - index2 = 0; - return cdataOpenInside; - } - if (asciiAlpha(code)) { - effects.consume(code); - return declaration2; - } - return nok(code); - } - function commentOpenInside(code) { - if (code === 45) { - effects.consume(code); - return commentEnd; - } - return nok(code); - } - function comment2(code) { - if (code === null) { - return nok(code); - } - if (code === 45) { - effects.consume(code); - return commentClose; - } - if (markdownLineEnding(code)) { - returnState = comment2; - return lineEndingBefore(code); - } - effects.consume(code); - return comment2; - } - function commentClose(code) { - if (code === 45) { - effects.consume(code); - return commentEnd; - } - return comment2(code); - } - function commentEnd(code) { - return code === 62 ? end2(code) : code === 45 ? commentClose(code) : comment2(code); - } - function cdataOpenInside(code) { - const value2 = "CDATA["; - if (code === value2.charCodeAt(index2++)) { - effects.consume(code); - return index2 === value2.length ? cdata : cdataOpenInside; - } - return nok(code); - } - function cdata(code) { - if (code === null) { - return nok(code); - } - if (code === 93) { - effects.consume(code); - return cdataClose; - } - if (markdownLineEnding(code)) { - returnState = cdata; - return lineEndingBefore(code); - } - effects.consume(code); - return cdata; - } - function cdataClose(code) { - if (code === 93) { - effects.consume(code); - return cdataEnd; - } - return cdata(code); - } - function cdataEnd(code) { - if (code === 62) { - return end2(code); - } - if (code === 93) { - effects.consume(code); - return cdataEnd; - } - return cdata(code); - } - function declaration2(code) { - if (code === null || code === 62) { - return end2(code); - } - if (markdownLineEnding(code)) { - returnState = declaration2; - return lineEndingBefore(code); - } - effects.consume(code); - return declaration2; - } - function instruction(code) { - if (code === null) { - return nok(code); - } - if (code === 63) { - effects.consume(code); - return instructionClose; - } - if (markdownLineEnding(code)) { - returnState = instruction; - return lineEndingBefore(code); - } - effects.consume(code); - return instruction; - } - function instructionClose(code) { - return code === 62 ? end2(code) : instruction(code); - } - function tagCloseStart(code) { - if (asciiAlpha(code)) { - effects.consume(code); - return tagClose; - } - return nok(code); - } - function tagClose(code) { - if (code === 45 || asciiAlphanumeric(code)) { - effects.consume(code); - return tagClose; - } - return tagCloseBetween(code); - } - function tagCloseBetween(code) { - if (markdownLineEnding(code)) { - returnState = tagCloseBetween; - return lineEndingBefore(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return tagCloseBetween; - } - return end2(code); - } - function tagOpen(code) { - if (code === 45 || asciiAlphanumeric(code)) { - effects.consume(code); - return tagOpen; - } - if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { - return tagOpenBetween(code); - } - return nok(code); - } - function tagOpenBetween(code) { - if (code === 47) { - effects.consume(code); - return end2; - } - if (code === 58 || code === 95 || asciiAlpha(code)) { - effects.consume(code); - return tagOpenAttributeName; - } - if (markdownLineEnding(code)) { - returnState = tagOpenBetween; - return lineEndingBefore(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return tagOpenBetween; - } - return end2(code); - } - function tagOpenAttributeName(code) { - if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) { - effects.consume(code); - return tagOpenAttributeName; - } - return tagOpenAttributeNameAfter(code); - } - function tagOpenAttributeNameAfter(code) { - if (code === 61) { - effects.consume(code); - return tagOpenAttributeValueBefore; - } - if (markdownLineEnding(code)) { - returnState = tagOpenAttributeNameAfter; - return lineEndingBefore(code); - } - if (markdownSpace(code)) { - effects.consume(code); - return tagOpenAttributeNameAfter; - } - return tagOpenBetween(code); + function positionY(g2) { + var layering = buildLayerMatrix(g2); + var rankSep = g2.graph().ranksep; + var prevY = 0; + forEach_default(layering, function(layer) { + var maxHeight = max_default( + map_default(layer, function(v3) { + return g2.node(v3).height; + }) + ); + forEach_default(layer, function(v3) { + g2.node(v3).y = prevY + maxHeight / 2; + }); + prevY += maxHeight + rankSep; + }); + } + var init_position = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/position/index.js"() { + "use strict"; + init_lodash(); + init_util3(); + init_bk(); + __name(position, "position"); + __name(positionY, "positionY"); } - function tagOpenAttributeValueBefore(code) { - if (code === null || code === 60 || code === 61 || code === 62 || code === 96) { - return nok(code); - } - if (code === 34 || code === 39) { - effects.consume(code); - marker = code; - return tagOpenAttributeValueQuoted; + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/layout.js + function layout(g2, opts) { + var time4 = opts && opts.debugTiming ? time2 : notime; + time4("layout", function() { + var layoutGraph = time4(" buildLayoutGraph", function() { + return buildLayoutGraph(g2); + }); + time4(" runLayout", function() { + runLayout(layoutGraph, time4); + }); + time4(" updateInputGraph", function() { + updateInputGraph(g2, layoutGraph); + }); + }); + } + function runLayout(g2, time4) { + time4(" makeSpaceForEdgeLabels", function() { + makeSpaceForEdgeLabels(g2); + }); + time4(" removeSelfEdges", function() { + removeSelfEdges(g2); + }); + time4(" acyclic", function() { + run(g2); + }); + time4(" nestingGraph.run", function() { + run3(g2); + }); + time4(" rank", function() { + rank(asNonCompoundGraph(g2)); + }); + time4(" injectEdgeLabelProxies", function() { + injectEdgeLabelProxies(g2); + }); + time4(" removeEmptyRanks", function() { + removeEmptyRanks(g2); + }); + time4(" nestingGraph.cleanup", function() { + cleanup(g2); + }); + time4(" normalizeRanks", function() { + normalizeRanks(g2); + }); + time4(" assignRankMinMax", function() { + assignRankMinMax(g2); + }); + time4(" removeEdgeLabelProxies", function() { + removeEdgeLabelProxies(g2); + }); + time4(" normalize.run", function() { + run2(g2); + }); + time4(" parentDummyChains", function() { + parentDummyChains(g2); + }); + time4(" addBorderSegments", function() { + addBorderSegments(g2); + }); + time4(" order", function() { + order(g2); + }); + time4(" insertSelfEdges", function() { + insertSelfEdges(g2); + }); + time4(" adjustCoordinateSystem", function() { + adjust2(g2); + }); + time4(" position", function() { + position(g2); + }); + time4(" positionSelfEdges", function() { + positionSelfEdges(g2); + }); + time4(" removeBorderNodes", function() { + removeBorderNodes(g2); + }); + time4(" normalize.undo", function() { + undo3(g2); + }); + time4(" fixupEdgeLabelCoords", function() { + fixupEdgeLabelCoords(g2); + }); + time4(" undoCoordinateSystem", function() { + undo2(g2); + }); + time4(" translateGraph", function() { + translateGraph(g2); + }); + time4(" assignNodeIntersects", function() { + assignNodeIntersects(g2); + }); + time4(" reversePoints", function() { + reversePointsForReversedEdges(g2); + }); + time4(" acyclic.undo", function() { + undo(g2); + }); + } + function updateInputGraph(inputGraph, layoutGraph) { + forEach_default(inputGraph.nodes(), function(v3) { + var inputLabel = inputGraph.node(v3); + var layoutLabel = layoutGraph.node(v3); + if (inputLabel) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + if (layoutGraph.children(v3).length) { + inputLabel.width = layoutLabel.width; + inputLabel.height = layoutLabel.height; + } } - if (markdownLineEnding(code)) { - returnState = tagOpenAttributeValueBefore; - return lineEndingBefore(code); + }); + forEach_default(inputGraph.edges(), function(e3) { + var inputLabel = inputGraph.edge(e3); + var layoutLabel = layoutGraph.edge(e3); + inputLabel.points = layoutLabel.points; + if (has_default(layoutLabel, "x")) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; } - if (markdownSpace(code)) { - effects.consume(code); - return tagOpenAttributeValueBefore; + }); + inputGraph.graph().width = layoutGraph.graph().width; + inputGraph.graph().height = layoutGraph.graph().height; + } + function buildLayoutGraph(inputGraph) { + var g2 = new Graph({ multigraph: true, compound: true }); + var graph = canonicalize(inputGraph.graph()); + g2.setGraph( + merge_default3({}, graphDefaults, selectNumberAttrs(graph, graphNumAttrs), pick_default(graph, graphAttrs)) + ); + forEach_default(inputGraph.nodes(), function(v3) { + var node2 = canonicalize(inputGraph.node(v3)); + g2.setNode(v3, defaults_default(selectNumberAttrs(node2, nodeNumAttrs), nodeDefaults)); + g2.setParent(v3, inputGraph.parent(v3)); + }); + forEach_default(inputGraph.edges(), function(e3) { + var edge = canonicalize(inputGraph.edge(e3)); + g2.setEdge( + e3, + merge_default3({}, edgeDefaults, selectNumberAttrs(edge, edgeNumAttrs), pick_default(edge, edgeAttrs)) + ); + }); + return g2; + } + function makeSpaceForEdgeLabels(g2) { + var graph = g2.graph(); + graph.ranksep /= 2; + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + edge.minlen *= 2; + if (edge.labelpos.toLowerCase() !== "c") { + if (graph.rankdir === "TB" || graph.rankdir === "BT") { + edge.width += edge.labeloffset; + } else { + edge.height += edge.labeloffset; + } } - effects.consume(code); - return tagOpenAttributeValueUnquoted; - } - function tagOpenAttributeValueQuoted(code) { - if (code === marker) { - effects.consume(code); - marker = void 0; - return tagOpenAttributeValueQuotedAfter; + }); + } + function injectEdgeLabelProxies(g2) { + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + if (edge.width && edge.height) { + var v3 = g2.node(e3.v); + var w3 = g2.node(e3.w); + var label = { rank: (w3.rank - v3.rank) / 2 + v3.rank, e: e3 }; + addDummyNode(g2, "edge-proxy", label, "_ep"); } - if (code === null) { - return nok(code); + }); + } + function assignRankMinMax(g2) { + var maxRank2 = 0; + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3); + if (node2.borderTop) { + node2.minRank = g2.node(node2.borderTop).rank; + node2.maxRank = g2.node(node2.borderBottom).rank; + maxRank2 = max_default(maxRank2, node2.maxRank); } - if (markdownLineEnding(code)) { - returnState = tagOpenAttributeValueQuoted; - return lineEndingBefore(code); + }); + g2.graph().maxRank = maxRank2; + } + function removeEdgeLabelProxies(g2) { + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3); + if (node2.dummy === "edge-proxy") { + g2.edge(node2.e).labelRank = node2.rank; + g2.removeNode(v3); } - effects.consume(code); - return tagOpenAttributeValueQuoted; - } - function tagOpenAttributeValueUnquoted(code) { - if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) { - return nok(code); + }); + } + function translateGraph(g2) { + var minX = Number.POSITIVE_INFINITY; + var maxX = 0; + var minY = Number.POSITIVE_INFINITY; + var maxY = 0; + var graphLabel = g2.graph(); + var marginX = graphLabel.marginx || 0; + var marginY = graphLabel.marginy || 0; + function getExtremes(attrs) { + var x5 = attrs.x; + var y5 = attrs.y; + var w3 = attrs.width; + var h2 = attrs.height; + minX = Math.min(minX, x5 - w3 / 2); + maxX = Math.max(maxX, x5 + w3 / 2); + minY = Math.min(minY, y5 - h2 / 2); + maxY = Math.max(maxY, y5 + h2 / 2); + } + __name(getExtremes, "getExtremes"); + forEach_default(g2.nodes(), function(v3) { + getExtremes(g2.node(v3)); + }); + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + if (has_default(edge, "x")) { + getExtremes(edge); } - if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { - return tagOpenBetween(code); + }); + minX -= marginX; + minY -= marginY; + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3); + node2.x -= minX; + node2.y -= minY; + }); + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + forEach_default(edge.points, function(p3) { + p3.x -= minX; + p3.y -= minY; + }); + if (has_default(edge, "x")) { + edge.x -= minX; } - effects.consume(code); - return tagOpenAttributeValueUnquoted; - } - function tagOpenAttributeValueQuotedAfter(code) { - if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { - return tagOpenBetween(code); + if (has_default(edge, "y")) { + edge.y -= minY; } - return nok(code); - } - function end2(code) { - if (code === 62) { - effects.consume(code); - effects.exit("htmlTextData"); - effects.exit("htmlText"); - return ok; + }); + graphLabel.width = maxX - minX + marginX; + graphLabel.height = maxY - minY + marginY; + } + function assignNodeIntersects(g2) { + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + var nodeV = g2.node(e3.v); + var nodeW = g2.node(e3.w); + var p1, p22; + if (!edge.points) { + edge.points = []; + p1 = nodeW; + p22 = nodeV; + } else { + p1 = edge.points[0]; + p22 = edge.points[edge.points.length - 1]; } - return nok(code); - } - function lineEndingBefore(code) { - effects.exit("htmlTextData"); - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return lineEndingAfter; - } - function lineEndingAfter(code) { - return markdownSpace(code) ? factorySpace( - effects, - lineEndingAfterPrefix, - "linePrefix", - self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 - )(code) : lineEndingAfterPrefix(code); - } - function lineEndingAfterPrefix(code) { - effects.enter("htmlTextData"); - return returnState(code); - } + edge.points.unshift(intersectRect3(nodeV, p1)); + edge.points.push(intersectRect3(nodeW, p22)); + }); } - const labelEnd = { - name: "labelEnd", - tokenize: tokenizeLabelEnd, - resolveTo: resolveToLabelEnd, - resolveAll: resolveAllLabelEnd - }; - const resourceConstruct = { - tokenize: tokenizeResource - }; - const referenceFullConstruct = { - tokenize: tokenizeReferenceFull - }; - const referenceCollapsedConstruct = { - tokenize: tokenizeReferenceCollapsed - }; - function resolveAllLabelEnd(events) { - let index2 = -1; - while (++index2 < events.length) { - const token2 = events[index2][1]; - if (token2.type === "labelImage" || token2.type === "labelLink" || token2.type === "labelEnd") { - events.splice(index2 + 1, token2.type === "labelImage" ? 4 : 2); - token2.type = "data"; - index2++; - } - } - return events; - } - function resolveToLabelEnd(events, context) { - let index2 = events.length; - let offset = 0; - let token2; - let open2; - let close2; - let media; - while (index2--) { - token2 = events[index2][1]; - if (open2) { - if (token2.type === "link" || token2.type === "labelLink" && token2._inactive) { - break; - } - if (events[index2][0] === "enter" && token2.type === "labelLink") { - token2._inactive = true; + function fixupEdgeLabelCoords(g2) { + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + if (has_default(edge, "x")) { + if (edge.labelpos === "l" || edge.labelpos === "r") { + edge.width -= edge.labeloffset; } - } else if (close2) { - if (events[index2][0] === "enter" && (token2.type === "labelImage" || token2.type === "labelLink") && !token2._balanced) { - open2 = index2; - if (token2.type !== "labelLink") { - offset = 2; + switch (edge.labelpos) { + case "l": + edge.x -= edge.width / 2 + edge.labeloffset; + break; + case "r": + edge.x += edge.width / 2 + edge.labeloffset; break; - } } - } else if (token2.type === "labelEnd") { - close2 = index2; } - } - const group = { - type: events[open2][1].type === "labelLink" ? "link" : "image", - start: Object.assign({}, events[open2][1].start), - end: Object.assign({}, events[events.length - 1][1].end) - }; - const label = { - type: "label", - start: Object.assign({}, events[open2][1].start), - end: Object.assign({}, events[close2][1].end) - }; - const text2 = { - type: "labelText", - start: Object.assign({}, events[open2 + offset + 2][1].end), - end: Object.assign({}, events[close2 - 2][1].start) - }; - media = [ - ["enter", group, context], - ["enter", label, context] - ]; - media = push(media, events.slice(open2 + 1, open2 + offset + 3)); - media = push(media, [["enter", text2, context]]); - media = push( - media, - resolveAll( - context.parser.constructs.insideSpan.null, - events.slice(open2 + offset + 4, close2 - 3), - context - ) - ); - media = push(media, [ - ["exit", text2, context], - events[close2 - 2], - events[close2 - 1], - ["exit", label, context] - ]); - media = push(media, events.slice(close2 + 1)); - media = push(media, [["exit", group, context]]); - splice(events, open2, events.length, media); - return events; - } - function tokenizeLabelEnd(effects, ok, nok) { - const self2 = this; - let index2 = self2.events.length; - let labelStart; - let defined; - while (index2--) { - if ((self2.events[index2][1].type === "labelImage" || self2.events[index2][1].type === "labelLink") && !self2.events[index2][1]._balanced) { - labelStart = self2.events[index2][1]; - break; + }); + } + function reversePointsForReversedEdges(g2) { + forEach_default(g2.edges(), function(e3) { + var edge = g2.edge(e3); + if (edge.reversed) { + edge.points.reverse(); } - } - return start2; - function start2(code) { - if (!labelStart) { - return nok(code); + }); + } + function removeBorderNodes(g2) { + forEach_default(g2.nodes(), function(v3) { + if (g2.children(v3).length) { + var node2 = g2.node(v3); + var t4 = g2.node(node2.borderTop); + var b2 = g2.node(node2.borderBottom); + var l2 = g2.node(last_default(node2.borderLeft)); + var r2 = g2.node(last_default(node2.borderRight)); + node2.width = Math.abs(r2.x - l2.x); + node2.height = Math.abs(b2.y - t4.y); + node2.x = l2.x + node2.width / 2; + node2.y = t4.y + node2.height / 2; } - if (labelStart._inactive) { - return labelEndNok(code); + }); + forEach_default(g2.nodes(), function(v3) { + if (g2.node(v3).dummy === "border") { + g2.removeNode(v3); } - defined = self2.parser.defined.includes( - normalizeIdentifier( - self2.sliceSerialize({ - start: labelStart.end, - end: self2.now() - }) - ) - ); - effects.enter("labelEnd"); - effects.enter("labelMarker"); - effects.consume(code); - effects.exit("labelMarker"); - effects.exit("labelEnd"); - return after; - } - function after(code) { - if (code === 40) { - return effects.attempt( - resourceConstruct, - labelEndOk, - defined ? labelEndOk : labelEndNok - )(code); - } - if (code === 91) { - return effects.attempt( - referenceFullConstruct, - labelEndOk, - defined ? referenceNotFull : labelEndNok - )(code); - } - return defined ? labelEndOk(code) : labelEndNok(code); - } - function referenceNotFull(code) { - return effects.attempt( - referenceCollapsedConstruct, - labelEndOk, - labelEndNok - )(code); - } - function labelEndOk(code) { - return ok(code); - } - function labelEndNok(code) { - labelStart._balanced = true; - return nok(code); - } - } - function tokenizeResource(effects, ok, nok) { - return resourceStart; - function resourceStart(code) { - effects.enter("resource"); - effects.enter("resourceMarker"); - effects.consume(code); - effects.exit("resourceMarker"); - return resourceBefore; - } - function resourceBefore(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code); - } - function resourceOpen(code) { - if (code === 41) { - return resourceEnd(code); - } - return factoryDestination( - effects, - resourceDestinationAfter, - resourceDestinationMissing, - "resourceDestination", - "resourceDestinationLiteral", - "resourceDestinationLiteralMarker", - "resourceDestinationRaw", - "resourceDestinationString", - 32 - )(code); - } - function resourceDestinationAfter(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code); - } - function resourceDestinationMissing(code) { - return nok(code); - } - function resourceBetween(code) { - if (code === 34 || code === 39 || code === 40) { - return factoryTitle( - effects, - resourceTitleAfter, - nok, - "resourceTitle", - "resourceTitleMarker", - "resourceTitleString" - )(code); - } - return resourceEnd(code); - } - function resourceTitleAfter(code) { - return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code); - } - function resourceEnd(code) { - if (code === 41) { - effects.enter("resourceMarker"); - effects.consume(code); - effects.exit("resourceMarker"); - effects.exit("resource"); - return ok; - } - return nok(code); - } - } - function tokenizeReferenceFull(effects, ok, nok) { - const self2 = this; - return referenceFull; - function referenceFull(code) { - return factoryLabel.call( - self2, - effects, - referenceFullAfter, - referenceFullMissing, - "reference", - "referenceMarker", - "referenceString" - )(code); - } - function referenceFullAfter(code) { - return self2.parser.defined.includes( - normalizeIdentifier( - self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1) - ) - ) ? ok(code) : nok(code); - } - function referenceFullMissing(code) { - return nok(code); - } + }); } - function tokenizeReferenceCollapsed(effects, ok, nok) { - return referenceCollapsedStart; - function referenceCollapsedStart(code) { - effects.enter("reference"); - effects.enter("referenceMarker"); - effects.consume(code); - effects.exit("referenceMarker"); - return referenceCollapsedOpen; - } - function referenceCollapsedOpen(code) { - if (code === 93) { - effects.enter("referenceMarker"); - effects.consume(code); - effects.exit("referenceMarker"); - effects.exit("reference"); - return ok; + function removeSelfEdges(g2) { + forEach_default(g2.edges(), function(e3) { + if (e3.v === e3.w) { + var node2 = g2.node(e3.v); + if (!node2.selfEdges) { + node2.selfEdges = []; + } + node2.selfEdges.push({ e: e3, label: g2.edge(e3) }); + g2.removeEdge(e3); } - return nok(code); - } + }); } - const labelStartImage = { - name: "labelStartImage", - tokenize: tokenizeLabelStartImage, - resolveAll: labelEnd.resolveAll - }; - function tokenizeLabelStartImage(effects, ok, nok) { - const self2 = this; - return start2; - function start2(code) { - effects.enter("labelImage"); - effects.enter("labelImageMarker"); - effects.consume(code); - effects.exit("labelImageMarker"); - return open2; - } - function open2(code) { - if (code === 91) { - effects.enter("labelMarker"); - effects.consume(code); - effects.exit("labelMarker"); - effects.exit("labelImage"); - return after; - } - return nok(code); - } - function after(code) { - return code === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code) : ok(code); - } - } - const labelStartLink = { - name: "labelStartLink", - tokenize: tokenizeLabelStartLink, - resolveAll: labelEnd.resolveAll - }; - function tokenizeLabelStartLink(effects, ok, nok) { - const self2 = this; - return start2; - function start2(code) { - effects.enter("labelLink"); - effects.enter("labelMarker"); - effects.consume(code); - effects.exit("labelMarker"); - effects.exit("labelLink"); - return after; - } - function after(code) { - return code === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code) : ok(code); - } - } - const lineEnding = { - name: "lineEnding", - tokenize: tokenizeLineEnding - }; - function tokenizeLineEnding(effects, ok) { - return start2; - function start2(code) { - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - return factorySpace(effects, ok, "linePrefix"); - } - } - const thematicBreak = { - name: "thematicBreak", - tokenize: tokenizeThematicBreak - }; - function tokenizeThematicBreak(effects, ok, nok) { - let size2 = 0; - let marker; - return start2; - function start2(code) { - effects.enter("thematicBreak"); - return before(code); - } - function before(code) { - marker = code; - return atBreak(code); - } - function atBreak(code) { - if (code === marker) { - effects.enter("thematicBreakSequence"); - return sequence2(code); - } - if (size2 >= 3 && (code === null || markdownLineEnding(code))) { - effects.exit("thematicBreak"); - return ok(code); - } - return nok(code); - } - function sequence2(code) { - if (code === marker) { - effects.consume(code); - size2++; - return sequence2; + function insertSelfEdges(g2) { + var layers = buildLayerMatrix(g2); + forEach_default(layers, function(layer) { + var orderShift = 0; + forEach_default(layer, function(v3, i2) { + var node2 = g2.node(v3); + node2.order = i2 + orderShift; + forEach_default(node2.selfEdges, function(selfEdge) { + addDummyNode( + g2, + "selfedge", + { + width: selfEdge.label.width, + height: selfEdge.label.height, + rank: node2.rank, + order: i2 + ++orderShift, + e: selfEdge.e, + label: selfEdge.label + }, + "_se" + ); + }); + delete node2.selfEdges; + }); + }); + } + function positionSelfEdges(g2) { + forEach_default(g2.nodes(), function(v3) { + var node2 = g2.node(v3); + if (node2.dummy === "selfedge") { + var selfNode = g2.node(node2.e.v); + var x5 = selfNode.x + selfNode.width / 2; + var y5 = selfNode.y; + var dx = node2.x - x5; + var dy = selfNode.height / 2; + g2.setEdge(node2.e, node2.label); + g2.removeNode(v3); + node2.label.points = [ + { x: x5 + 2 * dx / 3, y: y5 - dy }, + { x: x5 + 5 * dx / 6, y: y5 - dy }, + { x: x5 + dx, y: y5 }, + { x: x5 + 5 * dx / 6, y: y5 + dy }, + { x: x5 + 2 * dx / 3, y: y5 + dy } + ]; + node2.label.x = node2.x; + node2.label.y = node2.y; } - effects.exit("thematicBreakSequence"); - return markdownSpace(code) ? factorySpace(effects, atBreak, "whitespace")(code) : atBreak(code); - } + }); } - const list = { - name: "list", - tokenize: tokenizeListStart, - continuation: { - tokenize: tokenizeListContinuation - }, - exit: tokenizeListEnd - }; - const listItemPrefixWhitespaceConstruct = { - tokenize: tokenizeListItemPrefixWhitespace, - partial: true - }; - const indentConstruct = { - tokenize: tokenizeIndent, - partial: true - }; - function tokenizeListStart(effects, ok, nok) { - const self2 = this; - const tail = self2.events[self2.events.length - 1]; - let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; - let size2 = 0; - return start2; - function start2(code) { - const kind = self2.containerState.type || (code === 42 || code === 43 || code === 45 ? "listUnordered" : "listOrdered"); - if (kind === "listUnordered" ? !self2.containerState.marker || code === self2.containerState.marker : asciiDigit(code)) { - if (!self2.containerState.type) { - self2.containerState.type = kind; - effects.enter(kind, { - _container: true - }); - } - if (kind === "listUnordered") { - effects.enter("listItemPrefix"); - return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code); - } - if (!self2.interrupt || code === 49) { - effects.enter("listItemPrefix"); - effects.enter("listItemValue"); - return inside(code); - } - } - return nok(code); - } - function inside(code) { - if (asciiDigit(code) && ++size2 < 10) { - effects.consume(code); - return inside; - } - if ((!self2.interrupt || size2 < 2) && (self2.containerState.marker ? code === self2.containerState.marker : code === 41 || code === 46)) { - effects.exit("listItemValue"); - return atMarker(code); - } - return nok(code); - } - function atMarker(code) { - effects.enter("listItemMarker"); - effects.consume(code); - effects.exit("listItemMarker"); - self2.containerState.marker = self2.containerState.marker || code; - return effects.check( - blankLine, - // Can’t be empty when interrupting. - self2.interrupt ? nok : onBlank, - effects.attempt( - listItemPrefixWhitespaceConstruct, - endOfPrefix, - otherPrefix - ) - ); - } - function onBlank(code) { - self2.containerState.initialBlankLine = true; - initialSize++; - return endOfPrefix(code); - } - function otherPrefix(code) { - if (markdownSpace(code)) { - effects.enter("listItemPrefixWhitespace"); - effects.consume(code); - effects.exit("listItemPrefixWhitespace"); - return endOfPrefix; - } - return nok(code); - } - function endOfPrefix(code) { - self2.containerState.size = initialSize + self2.sliceSerialize(effects.exit("listItemPrefix"), true).length; - return ok(code); - } - } - function tokenizeListContinuation(effects, ok, nok) { - const self2 = this; - self2.containerState._closeFlow = void 0; - return effects.check(blankLine, onBlank, notBlank); - function onBlank(code) { - self2.containerState.furtherBlankLines = self2.containerState.furtherBlankLines || self2.containerState.initialBlankLine; - return factorySpace( - effects, - ok, - "listItemIndent", - self2.containerState.size + 1 - )(code); - } - function notBlank(code) { - if (self2.containerState.furtherBlankLines || !markdownSpace(code)) { - self2.containerState.furtherBlankLines = void 0; - self2.containerState.initialBlankLine = void 0; - return notInCurrentItem(code); - } - self2.containerState.furtherBlankLines = void 0; - self2.containerState.initialBlankLine = void 0; - return effects.attempt(indentConstruct, ok, notInCurrentItem)(code); - } - function notInCurrentItem(code) { - self2.containerState._closeFlow = true; - self2.interrupt = void 0; - return factorySpace( - effects, - effects.attempt(list, ok, nok), - "linePrefix", - self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 - )(code); - } - } - function tokenizeIndent(effects, ok, nok) { - const self2 = this; - return factorySpace( - effects, - afterPrefix, - "listItemIndent", - self2.containerState.size + 1 - ); - function afterPrefix(code) { - const tail = self2.events[self2.events.length - 1]; - return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self2.containerState.size ? ok(code) : nok(code); - } + function selectNumberAttrs(obj, attrs) { + return mapValues_default(pick_default(obj, attrs), Number); } - function tokenizeListEnd(effects) { - effects.exit(this.containerState.type); + function canonicalize(attrs) { + var newAttrs = {}; + forEach_default(attrs, function(v3, k2) { + newAttrs[k2.toLowerCase()] = v3; + }); + return newAttrs; } - function tokenizeListItemPrefixWhitespace(effects, ok, nok) { - const self2 = this; - return factorySpace( - effects, - afterPrefix, - "listItemPrefixWhitespace", - self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1 - ); - function afterPrefix(code) { - const tail = self2.events[self2.events.length - 1]; - return !markdownSpace(code) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok(code) : nok(code); + var graphNumAttrs, graphDefaults, graphAttrs, nodeNumAttrs, nodeDefaults, edgeNumAttrs, edgeDefaults, edgeAttrs; + var init_layout = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/layout.js"() { + "use strict"; + init_lodash(); + init_graphlib(); + init_add_border_segments(); + init_coordinate_system(); + init_acyclic(); + init_normalize(); + init_rank(); + init_nesting_graph(); + init_order2(); + init_parent_dummy_chains(); + init_position(); + init_util3(); + __name(layout, "layout"); + __name(runLayout, "runLayout"); + __name(updateInputGraph, "updateInputGraph"); + graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"]; + graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }; + graphAttrs = ["acyclicer", "ranker", "rankdir", "align"]; + nodeNumAttrs = ["width", "height"]; + nodeDefaults = { width: 0, height: 0 }; + edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"]; + edgeDefaults = { + minlen: 1, + weight: 1, + width: 0, + height: 0, + labeloffset: 10, + labelpos: "r" + }; + edgeAttrs = ["labelpos"]; + __name(buildLayoutGraph, "buildLayoutGraph"); + __name(makeSpaceForEdgeLabels, "makeSpaceForEdgeLabels"); + __name(injectEdgeLabelProxies, "injectEdgeLabelProxies"); + __name(assignRankMinMax, "assignRankMinMax"); + __name(removeEdgeLabelProxies, "removeEdgeLabelProxies"); + __name(translateGraph, "translateGraph"); + __name(assignNodeIntersects, "assignNodeIntersects"); + __name(fixupEdgeLabelCoords, "fixupEdgeLabelCoords"); + __name(reversePointsForReversedEdges, "reversePointsForReversedEdges"); + __name(removeBorderNodes, "removeBorderNodes"); + __name(removeSelfEdges, "removeSelfEdges"); + __name(insertSelfEdges, "insertSelfEdges"); + __name(positionSelfEdges, "positionSelfEdges"); + __name(selectNumberAttrs, "selectNumberAttrs"); + __name(canonicalize, "canonicalize"); } - } - const setextUnderline = { - name: "setextUnderline", - tokenize: tokenizeSetextUnderline, - resolveTo: resolveToSetextUnderline - }; - function resolveToSetextUnderline(events, context) { - let index2 = events.length; - let content2; - let text2; - let definition2; - while (index2--) { - if (events[index2][0] === "enter") { - if (events[index2][1].type === "content") { - content2 = index2; - break; - } - if (events[index2][1].type === "paragraph") { - text2 = index2; - } - } else { - if (events[index2][1].type === "content") { - events.splice(index2, 1); - } - if (!definition2 && events[index2][1].type === "definition") { - definition2 = index2; - } - } + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/index.js + var init_dagre = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/dagre/index.js"() { + "use strict"; + init_acyclic(); + init_layout(); + init_normalize(); + init_rank(); } - const heading = { - type: "setextHeading", - start: Object.assign({}, events[text2][1].start), - end: Object.assign({}, events[events.length - 1][1].end) + }); + + // ../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/json.js + function write(g2) { + var json3 = { + options: { + directed: g2.isDirected(), + multigraph: g2.isMultigraph(), + compound: g2.isCompound() + }, + nodes: writeNodes(g2), + edges: writeEdges(g2) }; - events[text2][1].type = "setextHeadingText"; - if (definition2) { - events.splice(text2, 0, ["enter", heading, context]); - events.splice(definition2 + 1, 0, ["exit", events[content2][1], context]); - events[content2][1].end = Object.assign({}, events[definition2][1].end); - } else { - events[content2][1] = heading; + if (!isUndefined_default(g2.graph())) { + json3.value = clone_default2(g2.graph()); } - events.push(["exit", heading, context]); - return events; + return json3; } - function tokenizeSetextUnderline(effects, ok, nok) { - const self2 = this; - let marker; - return start2; - function start2(code) { - let index2 = self2.events.length; - let paragraph; - while (index2--) { - if (self2.events[index2][1].type !== "lineEnding" && self2.events[index2][1].type !== "linePrefix" && self2.events[index2][1].type !== "content") { - paragraph = self2.events[index2][1].type === "paragraph"; - break; - } - } - if (!self2.parser.lazy[self2.now().line] && (self2.interrupt || paragraph)) { - effects.enter("setextHeadingLine"); - marker = code; - return before(code); - } - return nok(code); - } - function before(code) { - effects.enter("setextHeadingLineSequence"); - return inside(code); - } - function inside(code) { - if (code === marker) { - effects.consume(code); - return inside; + function writeNodes(g2) { + return map_default(g2.nodes(), function(v3) { + var nodeValue = g2.node(v3); + var parent4 = g2.parent(v3); + var node2 = { v: v3 }; + if (!isUndefined_default(nodeValue)) { + node2.value = nodeValue; } - effects.exit("setextHeadingLineSequence"); - return markdownSpace(code) ? factorySpace(effects, after, "lineSuffix")(code) : after(code); - } - function after(code) { - if (code === null || markdownLineEnding(code)) { - effects.exit("setextHeadingLine"); - return ok(code); + if (!isUndefined_default(parent4)) { + node2.parent = parent4; } - return nok(code); - } + return node2; + }); } - const flow$1 = { - tokenize: initializeFlow - }; - function initializeFlow(effects) { - const self2 = this; - const initial = effects.attempt( - // Try to parse a blank line. - blankLine, - atBlankEnding, - // Try to parse initial flow (essentially, only code). - effects.attempt( - this.parser.constructs.flowInitial, - afterConstruct, - factorySpace( - effects, - effects.attempt( - this.parser.constructs.flow, - afterConstruct, - effects.attempt(content, afterConstruct) - ), - "linePrefix" - ) - ) - ); - return initial; - function atBlankEnding(code) { - if (code === null) { - effects.consume(code); - return; + function writeEdges(g2) { + return map_default(g2.edges(), function(e3) { + var edgeValue = g2.edge(e3); + var edge = { v: e3.v, w: e3.w }; + if (!isUndefined_default(e3.name)) { + edge.name = e3.name; } - effects.enter("lineEndingBlank"); - effects.consume(code); - effects.exit("lineEndingBlank"); - self2.currentConstruct = void 0; - return initial; - } - function afterConstruct(code) { - if (code === null) { - effects.consume(code); - return; + if (!isUndefined_default(edgeValue)) { + edge.value = edgeValue; } - effects.enter("lineEnding"); - effects.consume(code); - effects.exit("lineEnding"); - self2.currentConstruct = void 0; - return initial; - } + return edge; + }); } - const resolver = { - resolveAll: createResolver() - }; - const string$1 = initializeFactory("string"); - const text$1 = initializeFactory("text"); - function initializeFactory(field) { - return { - tokenize: initializeText, - resolveAll: createResolver( - field === "text" ? resolveAllLineSuffixes : void 0 - ) - }; - function initializeText(effects) { - const self2 = this; - const constructs2 = this.parser.constructs[field]; - const text2 = effects.attempt(constructs2, start2, notText); - return start2; - function start2(code) { - return atBreak(code) ? text2(code) : notText(code); - } - function notText(code) { - if (code === null) { - effects.consume(code); - return; + var init_json = __esm({ + "../../node_modules/.pnpm/dagre-d3-es@7.0.10/node_modules/dagre-d3-es/src/graphlib/json.js"() { + "use strict"; + init_lodash(); + init_graph(); + __name(write, "write"); + __name(writeNodes, "writeNodes"); + __name(writeEdges, "writeEdges"); + } + }); + + // src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js + var clusterDb, descendants, parents, clear8, isDescendant2, edgeInCluster, copy2, extractDescendants, findCommonEdges, findNonClusterChild, getAnchorId, adjustClustersAndEdges, extractor, sorter, sortNodesByHierarchy; + var init_mermaid_graphlib = __esm({ + "src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js"() { + "use strict"; + init_logger(); + init_graphlib(); + init_json(); + clusterDb = /* @__PURE__ */ new Map(); + descendants = /* @__PURE__ */ new Map(); + parents = /* @__PURE__ */ new Map(); + clear8 = /* @__PURE__ */ __name(() => { + descendants.clear(); + parents.clear(); + clusterDb.clear(); + }, "clear"); + isDescendant2 = /* @__PURE__ */ __name((id26, ancestorId) => { + const ancestorDescendants = descendants.get(ancestorId) || []; + log.trace("In isDescendant", ancestorId, " ", id26, " = ", ancestorDescendants.includes(id26)); + return ancestorDescendants.includes(id26); + }, "isDescendant"); + edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => { + const clusterDescendants = descendants.get(clusterId) || []; + log.info("Descendants of ", clusterId, " is ", clusterDescendants); + log.info("Edge is ", edge); + if (edge.v === clusterId || edge.w === clusterId) { + return false; } - effects.enter("data"); - effects.consume(code); - return data; - } - function data(code) { - if (atBreak(code)) { - effects.exit("data"); - return text2(code); + if (!clusterDescendants) { + log.debug("Tilt, ", clusterId, ",not in descendants"); + return false; } - effects.consume(code); - return data; - } - function atBreak(code) { - if (code === null) { - return true; + return clusterDescendants.includes(edge.v) || isDescendant2(edge.v, clusterId) || isDescendant2(edge.w, clusterId) || clusterDescendants.includes(edge.w); + }, "edgeInCluster"); + copy2 = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => { + log.warn( + "Copying children of ", + clusterId, + "root", + rootId, + "data", + graph.node(clusterId), + rootId + ); + const nodes6 = graph.children(clusterId) || []; + if (clusterId !== rootId) { + nodes6.push(clusterId); + } + log.warn("Copying (nodes) clusterId", clusterId, "nodes", nodes6); + nodes6.forEach((node2) => { + if (graph.children(node2).length > 0) { + copy2(node2, graph, newGraph, rootId); + } else { + const data5 = graph.node(node2); + log.info("cp ", node2, " to ", rootId, " with parent ", clusterId); + newGraph.setNode(node2, data5); + if (rootId !== graph.parent(node2)) { + log.warn("Setting parent", node2, graph.parent(node2)); + newGraph.setParent(node2, graph.parent(node2)); + } + if (clusterId !== rootId && node2 !== clusterId) { + log.debug("Setting parent", node2, clusterId); + newGraph.setParent(node2, clusterId); + } else { + log.info("In copy ", clusterId, "root", rootId, "data", graph.node(clusterId), rootId); + log.debug( + "Not Setting parent for node=", + node2, + "cluster!==rootId", + clusterId !== rootId, + "node!==clusterId", + node2 !== clusterId + ); + } + const edges5 = graph.edges(node2); + log.debug("Copying Edges", edges5); + edges5.forEach((edge) => { + log.info("Edge", edge); + const data6 = graph.edge(edge.v, edge.w, edge.name); + log.info("Edge data", data6, rootId); + try { + if (edgeInCluster(edge, rootId)) { + log.info("Copying as ", edge.v, edge.w, data6, edge.name); + newGraph.setEdge(edge.v, edge.w, data6, edge.name); + log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0])); + } else { + log.info( + "Skipping copy of edge ", + edge.v, + "-->", + edge.w, + " rootId: ", + rootId, + " clusterId:", + clusterId + ); + } + } catch (e3) { + log.error(e3); + } + }); + } + log.debug("Removing node", node2); + graph.removeNode(node2); + }); + }, "copy"); + extractDescendants = /* @__PURE__ */ __name((id26, graph) => { + const children2 = graph.children(id26); + let res = [...children2]; + for (const child of children2) { + parents.set(child, id26); + res = [...res, ...extractDescendants(child, graph)]; } - const list2 = constructs2[code]; - let index2 = -1; - if (list2) { - while (++index2 < list2.length) { - const item = list2[index2]; - if (!item.previous || item.previous.call(self2, self2.previous)) { - return true; + return res; + }, "extractDescendants"); + findCommonEdges = /* @__PURE__ */ __name((graph, id1, id26) => { + const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1); + const edges22 = graph.edges().filter((edge) => edge.v === id26 || edge.w === id26); + const edges1Prim = edges1.map((edge) => { + return { v: edge.v === id1 ? id26 : edge.v, w: edge.w === id1 ? id1 : edge.w }; + }); + const edges2Prim = edges22.map((edge) => { + return { v: edge.v, w: edge.w }; + }); + const result = edges1Prim.filter((edgeIn1) => { + return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w); + }); + return result; + }, "findCommonEdges"); + findNonClusterChild = /* @__PURE__ */ __name((id26, graph, clusterId) => { + const children2 = graph.children(id26); + log.trace("Searching children of id ", id26, children2); + if (children2.length < 1) { + return id26; + } + let reserve; + for (const child of children2) { + const _id = findNonClusterChild(child, graph, clusterId); + const commonEdges = findCommonEdges(graph, clusterId, _id); + if (_id) { + if (commonEdges.length > 0) { + reserve = _id; + } else { + return _id; } } } - return false; - } - } - } - function createResolver(extraResolver) { - return resolveAllText; - function resolveAllText(events, context) { - let index2 = -1; - let enter2; - while (++index2 <= events.length) { - if (enter2 === void 0) { - if (events[index2] && events[index2][1].type === "data") { - enter2 = index2; - index2++; - } - } else if (!events[index2] || events[index2][1].type !== "data") { - if (index2 !== enter2 + 2) { - events[enter2][1].end = events[index2 - 1][1].end; - events.splice(enter2 + 2, index2 - enter2 - 2); - index2 = enter2 + 2; - } - enter2 = void 0; - } - } - return extraResolver ? extraResolver(events, context) : events; - } - } - function resolveAllLineSuffixes(events, context) { - let eventIndex = 0; - while (++eventIndex <= events.length) { - if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") { - const data = events[eventIndex - 1][1]; - const chunks = context.sliceStream(data); - let index2 = chunks.length; - let bufferIndex = -1; - let size2 = 0; - let tabs; - while (index2--) { - const chunk = chunks[index2]; - if (typeof chunk === "string") { - bufferIndex = chunk.length; - while (chunk.charCodeAt(bufferIndex - 1) === 32) { - size2++; - bufferIndex--; - } - if (bufferIndex) - break; - bufferIndex = -1; - } else if (chunk === -2) { - tabs = true; - size2++; - } else if (chunk === -1) - ; - else { - index2++; - break; + return reserve; + }, "findNonClusterChild"); + getAnchorId = /* @__PURE__ */ __name((id26) => { + if (!clusterDb.has(id26)) { + return id26; + } + if (!clusterDb.get(id26).externalConnections) { + return id26; + } + if (clusterDb.has(id26)) { + return clusterDb.get(id26).id; + } + return id26; + }, "getAnchorId"); + adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => { + if (!graph || depth > 10) { + log.debug("Opting out, no graph "); + return; + } else { + log.debug("Opting in, graph "); + } + graph.nodes().forEach(function(id26) { + const children2 = graph.children(id26); + if (children2.length > 0) { + log.warn( + "Cluster identified", + id26, + " Replacement id in edges: ", + findNonClusterChild(id26, graph, id26) + ); + descendants.set(id26, extractDescendants(id26, graph)); + clusterDb.set(id26, { id: findNonClusterChild(id26, graph, id26), clusterData: graph.node(id26) }); } + }); + graph.nodes().forEach(function(id26) { + const children2 = graph.children(id26); + const edges5 = graph.edges(); + if (children2.length > 0) { + log.debug("Cluster identified", id26, descendants); + edges5.forEach((edge) => { + const d1 = isDescendant2(edge.v, id26); + const d2 = isDescendant2(edge.w, id26); + if (d1 ^ d2) { + log.warn("Edge: ", edge, " leaves cluster ", id26); + log.warn("Descendants of XXX ", id26, ": ", descendants.get(id26)); + clusterDb.get(id26).externalConnections = true; + } + }); + } else { + log.debug("Not a cluster ", id26, descendants); + } + }); + for (let id26 of clusterDb.keys()) { + const nonClusterChild = clusterDb.get(id26).id; + const parent4 = graph.parent(nonClusterChild); + if (parent4 !== id26 && clusterDb.has(parent4) && !clusterDb.get(parent4).externalConnections) { + clusterDb.get(id26).id = parent4; + } + } + graph.edges().forEach(function(e3) { + const edge = graph.edge(e3); + log.warn("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3)); + log.warn("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(graph.edge(e3))); + let v3 = e3.v; + let w3 = e3.w; + log.warn( + "Fix XXX", + clusterDb, + "ids:", + e3.v, + e3.w, + "Translating: ", + clusterDb.get(e3.v), + " --- ", + clusterDb.get(e3.w) + ); + if (clusterDb.get(e3.v) && clusterDb.get(e3.w) && clusterDb.get(e3.v) === clusterDb.get(e3.w)) { + log.warn("Fixing and trying link to self - removing XXX", e3.v, e3.w, e3.name); + log.warn("Fixing and trying - removing XXX", e3.v, e3.w, e3.name); + v3 = getAnchorId(e3.v); + w3 = getAnchorId(e3.w); + graph.removeEdge(e3.v, e3.w, e3.name); + const specialId1 = e3.w + "---" + e3.v + "---1"; + const specialId2 = e3.w + "---" + e3.v + "---2"; + graph.setNode(specialId1, { + domId: specialId1, + id: specialId1, + labelStyle: "", + label: "", + padding: 0, + shape: "labelRect", + style: "", + width: 10, + height: 10 + }); + graph.setNode(specialId2, { + domId: specialId2, + id: specialId2, + labelStyle: "", + padding: 0, + shape: "labelRect", + style: "", + width: 10, + height: 10 + }); + const edge1 = structuredClone(edge); + const edgeMid = structuredClone(edge); + const edge2 = structuredClone(edge); + edge1.label = ""; + edge1.arrowTypeEnd = "none"; + edge1.id = e3.name + "-cyclic-special-1"; + edgeMid.arrowTypeEnd = "none"; + edgeMid.id = e3.name + "-cyclic-special-mid"; + edge2.label = ""; + edge1.fromCluster = e3.v; + edge2.toCluster = e3.v; + edge2.id = e3.name + "-cyclic-special-2"; + graph.setEdge(v3, specialId1, edge1, e3.name + "-cyclic-special-0"); + graph.setEdge(specialId1, specialId2, edgeMid, e3.name + "-cyclic-special-1"); + graph.setEdge(specialId2, w3, edge2, e3.name + "-cyclic-special-2"); + } else if (clusterDb.get(e3.v) || clusterDb.get(e3.w)) { + log.warn("Fixing and trying - removing XXX", e3.v, e3.w, e3.name); + v3 = getAnchorId(e3.v); + w3 = getAnchorId(e3.w); + graph.removeEdge(e3.v, e3.w, e3.name); + if (v3 !== e3.v) { + const parent4 = graph.parent(v3); + clusterDb.get(parent4).externalConnections = true; + edge.fromCluster = e3.v; + } + if (w3 !== e3.w) { + const parent4 = graph.parent(w3); + clusterDb.get(parent4).externalConnections = true; + edge.toCluster = e3.w; + } + log.warn("Fix Replacing with XXX", v3, w3, e3.name); + graph.setEdge(v3, w3, edge, e3.name); + } + }); + log.warn("Adjusted Graph", write(graph)); + extractor(graph, 0); + log.trace(clusterDb); + }, "adjustClustersAndEdges"); + extractor = /* @__PURE__ */ __name((graph, depth) => { + log.warn("extractor - ", depth, write(graph), graph.children("D")); + if (depth > 10) { + log.error("Bailing out"); + return; } - if (size2) { - const token2 = { - type: eventIndex === events.length || tabs || size2 < 2 ? "lineSuffix" : "hardBreakTrailing", - start: { - line: data.end.line, - column: data.end.column - size2, - offset: data.end.offset - size2, - _index: data.start._index + index2, - _bufferIndex: index2 ? bufferIndex : data.start._bufferIndex + bufferIndex - }, - end: Object.assign({}, data.end) - }; - data.end = Object.assign({}, token2.start); - if (data.start.offset === data.end.offset) { - Object.assign(data, token2); + let nodes6 = graph.nodes(); + let hasChildren = false; + for (const node2 of nodes6) { + const children2 = graph.children(node2); + hasChildren = hasChildren || children2.length > 0; + } + if (!hasChildren) { + log.debug("Done, no node has children", graph.nodes()); + return; + } + log.debug("Nodes = ", nodes6, depth); + for (const node2 of nodes6) { + log.debug( + "Extracting node", + node2, + clusterDb, + clusterDb.has(node2) && !clusterDb.get(node2).externalConnections, + !graph.parent(node2), + graph.node(node2), + graph.children("D"), + " Depth ", + depth + ); + if (!clusterDb.has(node2)) { + log.debug("Not a cluster", node2, depth); + } else if (!clusterDb.get(node2).externalConnections && graph.children(node2) && graph.children(node2).length > 0) { + log.warn( + "Cluster without external connections, without a parent and with children", + node2, + depth + ); + const graphSettings = graph.graph(); + let dir2 = graphSettings.rankdir === "TB" ? "LR" : "TB"; + if (clusterDb.get(node2)?.clusterData?.dir) { + dir2 = clusterDb.get(node2).clusterData.dir; + log.warn("Fixing dir", clusterDb.get(node2).clusterData.dir, dir2); + } + const clusterGraph = new Graph({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: dir2, + nodesep: 50, + ranksep: 50, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function() { + return {}; + }); + log.warn("Old graph before copy", write(graph)); + copy2(node2, graph, clusterGraph, node2); + graph.setNode(node2, { + clusterNode: true, + id: node2, + clusterData: clusterDb.get(node2).clusterData, + label: clusterDb.get(node2).label, + graph: clusterGraph + }); + log.warn("New graph after copy node: (", node2, ")", write(clusterGraph)); + log.debug("Old graph after copy", write(graph)); } else { - events.splice( - eventIndex, - 0, - ["enter", token2, context], - ["exit", token2, context] + log.warn( + "Cluster ** ", + node2, + " **not meeting the criteria !externalConnections:", + !clusterDb.get(node2).externalConnections, + " no parent: ", + !graph.parent(node2), + " children ", + graph.children(node2) && graph.children(node2).length > 0, + graph.children("D"), + depth ); - eventIndex += 2; + log.debug(clusterDb); } } - eventIndex++; - } - } - return events; - } - function createTokenizer(parser2, initialize2, from2) { - let point2 = Object.assign( - from2 ? Object.assign({}, from2) : { - line: 1, - column: 1, - offset: 0 - }, - { - _index: 0, - _bufferIndex: -1 - } - ); - const columnStart = {}; - const resolveAllConstructs = []; - let chunks = []; - let stack = []; - const effects = { - consume, - enter: enter2, - exit: exit2, - attempt: constructFactory(onsuccessfulconstruct), - check: constructFactory(onsuccessfulcheck), - interrupt: constructFactory(onsuccessfulcheck, { - interrupt: true - }) - }; - const context = { - previous: null, - code: null, - containerState: {}, - events: [], - parser: parser2, - sliceStream, - sliceSerialize, - now: now2, - defineSkip, - write: write2 - }; - let state2 = initialize2.tokenize.call(context, effects); - if (initialize2.resolveAll) { - resolveAllConstructs.push(initialize2); - } - return context; - function write2(slice2) { - chunks = push(chunks, slice2); - main2(); - if (chunks[chunks.length - 1] !== null) { - return []; - } - addResult(initialize2, 0); - context.events = resolveAll(resolveAllConstructs, context.events, context); - return context.events; - } - function sliceSerialize(token2, expandTabs) { - return serializeChunks(sliceStream(token2), expandTabs); - } - function sliceStream(token2) { - return sliceChunks(chunks, token2); - } - function now2() { - const { line: line2, column: column2, offset, _index, _bufferIndex } = point2; - return { - line: line2, - column: column2, - offset, - _index, - _bufferIndex - }; - } - function defineSkip(value2) { - columnStart[value2.line] = value2.column; - accountForPotentialSkip(); - } - function main2() { - let chunkIndex; - while (point2._index < chunks.length) { - const chunk = chunks[point2._index]; - if (typeof chunk === "string") { - chunkIndex = point2._index; - if (point2._bufferIndex < 0) { - point2._bufferIndex = 0; + nodes6 = graph.nodes(); + log.warn("New list of nodes", nodes6); + for (const node2 of nodes6) { + const data5 = graph.node(node2); + log.warn(" Now next level", node2, data5); + if (data5.clusterNode) { + extractor(data5.graph, depth + 1); } - while (point2._index === chunkIndex && point2._bufferIndex < chunk.length) { - go(chunk.charCodeAt(point2._bufferIndex)); - } - } else { - go(chunk); } - } - } - function go(code) { - state2 = state2(code); - } - function consume(code) { - if (markdownLineEnding(code)) { - point2.line++; - point2.column = 1; - point2.offset += code === -3 ? 2 : 1; - accountForPotentialSkip(); - } else if (code !== -1) { - point2.column++; - point2.offset++; - } - if (point2._bufferIndex < 0) { - point2._index++; - } else { - point2._bufferIndex++; - if (point2._bufferIndex === chunks[point2._index].length) { - point2._bufferIndex = -1; - point2._index++; + }, "extractor"); + sorter = /* @__PURE__ */ __name((graph, nodes6) => { + if (nodes6.length === 0) { + return []; } - } - context.previous = code; - } - function enter2(type2, fields) { - const token2 = fields || {}; - token2.type = type2; - token2.start = now2(); - context.events.push(["enter", token2, context]); - stack.push(token2); - return token2; - } - function exit2(type2) { - const token2 = stack.pop(); - token2.end = now2(); - context.events.push(["exit", token2, context]); - return token2; + let result = Object.assign([], nodes6); + nodes6.forEach((node2) => { + const children2 = graph.children(node2); + const sorted = sorter(graph, children2); + result = [...result, ...sorted]; + }); + return result; + }, "sorter"); + sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), "sortNodesByHierarchy"); } - function onsuccessfulconstruct(construct2, info2) { - addResult(construct2, info2.from); - } - function onsuccessfulcheck(_2, info2) { - info2.restore(); - } - function constructFactory(onreturn, fields) { - return hook; - function hook(constructs2, returnState, bogusState) { - let listOfConstructs; - let constructIndex; - let currentConstruct; - let info2; - return Array.isArray(constructs2) ? handleListOfConstructs(constructs2) : "tokenize" in constructs2 ? ( - // @ts-expect-error Looks like a construct. - handleListOfConstructs([constructs2]) - ) : handleMapOfConstructs(constructs2); - function handleMapOfConstructs(map2) { - return start2; - function start2(code) { - const def = code !== null && map2[code]; - const all2 = code !== null && map2.null; - const list2 = [ - // To do: add more extension tests. - /* c8 ignore next 2 */ - ...Array.isArray(def) ? def : def ? [def] : [], - ...Array.isArray(all2) ? all2 : all2 ? [all2] : [] - ]; - return handleListOfConstructs(list2)(code); - } + }); + + // src/rendering-util/layout-algorithms/dagre/index.js + var dagre_exports = {}; + __export(dagre_exports, { + render: () => render3 + }); + var recursiveRender, render3; + var init_dagre2 = __esm({ + "src/rendering-util/layout-algorithms/dagre/index.js"() { + "use strict"; + init_dagre(); + init_json(); + init_graphlib(); + init_markers(); + init_util2(); + init_mermaid_graphlib(); + init_nodes3(); + init_clusters(); + init_edges(); + init_logger(); + init_subGraphTitleMargins(); + init_diagramAPI(); + recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id26, parentCluster, siteConfig2) => { + log.info("Graph in recursive render: XXX", write(graph), parentCluster); + const dir2 = graph.graph().rankdir; + log.trace("Dir in recursive render - dir:", dir2); + const elem = _elem.insert("g").attr("class", "root"); + if (!graph.nodes()) { + log.info("No nodes found for", graph); + } else { + log.info("Recursive render XXX", graph.nodes()); } - function handleListOfConstructs(list2) { - listOfConstructs = list2; - constructIndex = 0; - if (list2.length === 0) { - return bogusState; - } - return handleConstruct(list2[constructIndex]); + if (graph.edges().length > 0) { + log.info("Recursive edges", graph.edge(graph.edges()[0])); } - function handleConstruct(construct2) { - return start2; - function start2(code) { - info2 = store(); - currentConstruct = construct2; - if (!construct2.partial) { - context.currentConstruct = construct2; + const clusters = elem.insert("g").attr("class", "clusters"); + const edgePaths = elem.insert("g").attr("class", "edgePaths"); + const edgeLabels3 = elem.insert("g").attr("class", "edgeLabels"); + const nodes6 = elem.insert("g").attr("class", "nodes"); + await Promise.all( + graph.nodes().map(async function(v3) { + const node2 = graph.node(v3); + if (parentCluster !== void 0) { + const data5 = JSON.parse(JSON.stringify(parentCluster.clusterData)); + log.trace( + "Setting data for parent cluster XXX\n Node.id = ", + v3, + "\n data=", + data5.height, + "\nParent cluster", + parentCluster.height + ); + graph.setNode(parentCluster.id, data5); + if (!graph.parent(v3)) { + log.trace("Setting parent", v3, parentCluster.id); + graph.setParent(v3, parentCluster.id, data5); + } + } + log.info("(Insert) Node XXX" + v3 + ": " + JSON.stringify(graph.node(v3))); + if (node2?.clusterNode) { + log.info("Cluster identified XBX", v3, node2.width, graph.node(v3)); + const { ranksep, nodesep } = graph.graph(); + node2.graph.setGraph({ + ...node2.graph.graph(), + ranksep: ranksep + 25, + nodesep + }); + const o2 = await recursiveRender( + nodes6, + node2.graph, + diagramType, + id26, + graph.node(v3), + siteConfig2 + ); + const newEl = o2.elem; + updateNodeBounds2(node2, newEl); + node2.diff = o2.diff || 0; + log.info( + "New compound node after recursive render XAX", + v3, + "width", + // node, + node2.width, + "height", + node2.height + // node.x, + // node.y + ); + setNodeElem2(newEl, node2); + } else { + if (graph.children(v3).length > 0) { + log.info( + "Cluster - the non recursive path XBX", + v3, + node2.id, + node2, + node2.width, + "Graph:", + graph + ); + log.info(findNonClusterChild(node2.id, graph)); + clusterDb.set(node2.id, { id: findNonClusterChild(node2.id, graph), node: node2 }); + } else { + log.trace("Node - the non recursive path XAX", v3, node2.id, node2); + await insertNode2(nodes6, graph.node(v3), dir2); + } } - if (construct2.name && context.parser.constructs.disable.null.includes(construct2.name)) { - return nok(); + }) + ); + const processEdges = /* @__PURE__ */ __name(async () => { + const edgePromises = graph.edges().map(async function(e3) { + const edge = graph.edge(e3.v, e3.w, e3.name); + log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3)); + log.info("Edge " + e3.v + " -> " + e3.w + ": ", e3, " ", JSON.stringify(graph.edge(e3))); + log.info( + "Fix", + clusterDb, + "ids:", + e3.v, + e3.w, + "Translating: ", + clusterDb.get(e3.v), + clusterDb.get(e3.w) + ); + await insertEdgeLabel(edgeLabels3, edge); + }); + await Promise.all(edgePromises); + }, "processEdges"); + await processEdges(); + log.info("Graph before layout:", JSON.stringify(write(graph))); + log.info("############################################# XXX"); + log.info("### Layout ### XXX"); + log.info("############################################# XXX"); + layout(graph); + log.info("Graph after layout:", JSON.stringify(write(graph))); + let diff2 = 0; + let { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2); + await Promise.all( + sortNodesByHierarchy(graph).map(async function(v3) { + const node2 = graph.node(v3); + log.info( + "Position XBX => " + v3 + ": (" + node2.x, + "," + node2.y, + ") width: ", + node2.width, + " height: ", + node2.height + ); + if (node2?.clusterNode) { + node2.y += subGraphTitleTotalMargin; + log.info( + "A tainted cluster node XBX1", + v3, + node2.id, + node2.width, + node2.height, + node2.x, + node2.y, + graph.parent(v3) + ); + clusterDb.get(node2.id).node = node2; + positionNode2(node2); + } else { + if (graph.children(v3).length > 0) { + log.info( + "A pure cluster node XBX1", + v3, + node2.id, + node2.x, + node2.y, + node2.width, + node2.height, + graph.parent(v3) + ); + node2.height += subGraphTitleTotalMargin; + graph.node(node2.parentId); + const halfPadding = node2?.padding / 2 || 0; + const labelHeight = node2?.labelBBox?.height || 0; + const offsetY = labelHeight - halfPadding || 0; + log.debug("OffsetY", offsetY, "labelHeight", labelHeight, "halfPadding", halfPadding); + await insertCluster(clusters, node2); + clusterDb.get(node2.id).node = node2; + } else { + const parent4 = graph.node(node2.parentId); + node2.y += subGraphTitleTotalMargin / 2; + log.info( + "A regular node XBX1 - using the padding", + node2.id, + "parent", + node2.parentId, + node2.width, + node2.height, + node2.x, + node2.y, + "offsetY", + node2.offsetY, + "parent", + parent4, + parent4?.offsetY, + node2 + ); + positionNode2(node2); + } } - return construct2.tokenize.call( - // If we do have fields, create an object w/ `context` as its - // prototype. - // This allows a “live binding”, which is needed for `interrupt`. - fields ? Object.assign(Object.create(context), fields) : context, - effects, - ok, - nok - )(code); + }) + ); + graph.edges().forEach(function(e3) { + const edge = graph.edge(e3); + log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(edge), edge); + edge.points.forEach((point8) => point8.y += subGraphTitleTotalMargin / 2); + const startNode = graph.node(e3.v); + var endNode = graph.node(e3.w); + const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id26); + positionEdgeLabel(edge, paths); + }); + graph.nodes().forEach(function(v3) { + const n2 = graph.node(v3); + log.info(v3, n2.type, n2.diff); + if (n2.isGroup) { + diff2 = n2.diff; } - } - function ok(code) { - onreturn(currentConstruct, info2); - return returnState; - } - function nok(code) { - info2.restore(); - if (++constructIndex < listOfConstructs.length) { - return handleConstruct(listOfConstructs[constructIndex]); + }); + log.warn("Returning from recursive render XAX", elem, diff2); + return { elem, diff: diff2 }; + }, "recursiveRender"); + render3 = /* @__PURE__ */ __name(async (data4Layout, svg) => { + const graph = new Graph({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: data4Layout.direction, + nodesep: data4Layout.config?.nodeSpacing || data4Layout.config?.flowchart?.nodeSpacing || data4Layout.nodeSpacing, + ranksep: data4Layout.config?.rankSpacing || data4Layout.config?.flowchart?.rankSpacing || data4Layout.rankSpacing, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function() { + return {}; + }); + const element3 = svg.select("g"); + markers_default(element3, data4Layout.markers, data4Layout.type, data4Layout.diagramId); + clear7(); + clear6(); + clear5(); + clear8(); + data4Layout.nodes.forEach((node2) => { + graph.setNode(node2.id, { ...node2 }); + if (node2.parentId) { + graph.setParent(node2.id, node2.parentId); } - return bogusState; - } - } - } - function addResult(construct2, from3) { - if (construct2.resolveAll && !resolveAllConstructs.includes(construct2)) { - resolveAllConstructs.push(construct2); - } - if (construct2.resolve) { - splice( - context.events, - from3, - context.events.length - from3, - construct2.resolve(context.events.slice(from3), context) + }); + log.debug("Edges:", data4Layout.edges); + data4Layout.edges.forEach((edge) => { + graph.setEdge(edge.start, edge.end, { ...edge }, edge.id); + }); + log.warn("Graph at first:", JSON.stringify(write(graph))); + adjustClustersAndEdges(graph); + log.warn("Graph after:", JSON.stringify(write(graph))); + const siteConfig2 = getConfig2(); + await recursiveRender( + element3, + graph, + data4Layout.type, + data4Layout.diagramId, + void 0, + siteConfig2 ); - } - if (construct2.resolveTo) { - context.events = construct2.resolveTo(context.events, context); - } - } - function store() { - const startPoint = now2(); - const startPrevious = context.previous; - const startCurrentConstruct = context.currentConstruct; - const startEventsIndex = context.events.length; - const startStack = Array.from(stack); - return { - restore, - from: startEventsIndex - }; - function restore() { - point2 = startPoint; - context.previous = startPrevious; - context.currentConstruct = startCurrentConstruct; - context.events.length = startEventsIndex; - stack = startStack; - accountForPotentialSkip(); - } + }, "render"); } - function accountForPotentialSkip() { - if (point2.line in columnStart && point2.column < 2) { - point2.column = columnStart[point2.line]; - point2.offset += columnStart[point2.line] - 1; - } - } - } - function sliceChunks(chunks, token2) { - const startIndex = token2.start._index; - const startBufferIndex = token2.start._bufferIndex; - const endIndex = token2.end._index; - const endBufferIndex = token2.end._bufferIndex; - let view; - if (startIndex === endIndex) { - view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; - } else { - view = chunks.slice(startIndex, endIndex); - if (startBufferIndex > -1) { - const head2 = view[0]; - if (typeof head2 === "string") { - view[0] = head2.slice(startBufferIndex); - } else { - view.shift(); - } - } - if (endBufferIndex > 0) { - view.push(chunks[endIndex].slice(0, endBufferIndex)); - } - } - return view; - } - function serializeChunks(chunks, expandTabs) { - let index2 = -1; - const result = []; - let atTab; - while (++index2 < chunks.length) { - const chunk = chunks[index2]; - let value2; - if (typeof chunk === "string") { - value2 = chunk; - } else - switch (chunk) { - case -5: { - value2 = "\r"; - break; - } - case -4: { - value2 = "\n"; - break; - } - case -3: { - value2 = "\r\n"; - break; - } - case -2: { - value2 = expandTabs ? " " : " "; - break; - } - case -1: { - if (!expandTabs && atTab) - continue; - value2 = " "; - break; - } - default: { - value2 = String.fromCharCode(chunk); - } - } - atTab = chunk === -2; - result.push(value2); - } - return result.join(""); - } - const document$1 = { - [42]: list, - [43]: list, - [45]: list, - [48]: list, - [49]: list, - [50]: list, - [51]: list, - [52]: list, - [53]: list, - [54]: list, - [55]: list, - [56]: list, - [57]: list, - [62]: blockQuote - }; - const contentInitial = { - [91]: definition - }; - const flowInitial = { - [-2]: codeIndented, - [-1]: codeIndented, - [32]: codeIndented - }; - const flow = { - [35]: headingAtx, - [42]: thematicBreak, - [45]: [setextUnderline, thematicBreak], - [60]: htmlFlow, - [61]: setextUnderline, - [95]: thematicBreak, - [96]: codeFenced, - [126]: codeFenced - }; - const string = { - [38]: characterReference, - [92]: characterEscape - }; - const text = { - [-5]: lineEnding, - [-4]: lineEnding, - [-3]: lineEnding, - [33]: labelStartImage, - [38]: characterReference, - [42]: attention, - [60]: [autolink, htmlText], - [91]: labelStartLink, - [92]: [hardBreakEscape, characterEscape], - [93]: labelEnd, - [95]: attention, - [96]: codeText - }; - const insideSpan = { - null: [attention, resolver] - }; - const attentionMarkers = { - null: [42, 95] - }; - const disable = { - null: [] - }; - const defaultConstructs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - attentionMarkers, - contentInitial, - disable, - document: document$1, - flow, - flowInitial, - insideSpan, - string, - text - }, Symbol.toStringTag, { value: "Module" })); - function parse$1(options2) { - const settings = options2 || {}; - const constructs2 = ( - /** @type {FullNormalizedExtension} */ - combineExtensions([defaultConstructs, ...settings.extensions || []]) - ); - const parser2 = { - defined: [], - lazy: {}, - constructs: constructs2, - content: create2(content$1), - document: create2(document$2), - flow: create2(flow$1), - string: create2(string$1), - text: create2(text$1) - }; - return parser2; - function create2(initial) { - return creator2; - function creator2(from2) { - return createTokenizer(parser2, initial, from2); - } - } - } - const search = /[\0\t\n\r]/g; - function preprocess() { - let column2 = 1; - let buffer = ""; - let start2 = true; - let atCarriageReturn; - return preprocessor; - function preprocessor(value2, encoding, end2) { - const chunks = []; - let match; - let next2; - let startPosition; - let endPosition; - let code; - value2 = buffer + value2.toString(encoding); - startPosition = 0; - buffer = ""; - if (start2) { - if (value2.charCodeAt(0) === 65279) { - startPosition++; - } - start2 = void 0; - } - while (startPosition < value2.length) { - search.lastIndex = startPosition; - match = search.exec(value2); - endPosition = match && match.index !== void 0 ? match.index : value2.length; - code = value2.charCodeAt(endPosition); - if (!match) { - buffer = value2.slice(startPosition); - break; + }); + + // src/rendering-util/render.ts + var layoutAlgorithms, registerLayoutLoaders, registerDefaultLayoutLoaders, render4, getRegisteredLayoutAlgorithm; + var init_render = __esm({ + "src/rendering-util/render.ts"() { + "use strict"; + init_internals(); + init_logger(); + layoutAlgorithms = {}; + registerLayoutLoaders = /* @__PURE__ */ __name((loaders) => { + for (const loader25 of loaders) { + layoutAlgorithms[loader25.name] = loader25; + } + }, "registerLayoutLoaders"); + registerDefaultLayoutLoaders = /* @__PURE__ */ __name(() => { + registerLayoutLoaders([ + { + name: "dagre", + loader: /* @__PURE__ */ __name(async () => await Promise.resolve().then(() => (init_dagre2(), dagre_exports)), "loader") + } + ]); + }, "registerDefaultLayoutLoaders"); + registerDefaultLayoutLoaders(); + render4 = /* @__PURE__ */ __name(async (data4Layout, svg) => { + if (!(data4Layout.layoutAlgorithm in layoutAlgorithms)) { + throw new Error(`Unknown layout algorithm: ${data4Layout.layoutAlgorithm}`); + } + const layoutDefinition = layoutAlgorithms[data4Layout.layoutAlgorithm]; + const layoutRenderer = await layoutDefinition.loader(); + return layoutRenderer.render(data4Layout, svg, internalHelpers, { + algorithm: layoutDefinition.algorithm + }); + }, "render"); + getRegisteredLayoutAlgorithm = /* @__PURE__ */ __name((algorithm = "", { fallback = "dagre" } = {}) => { + if (algorithm in layoutAlgorithms) { + return algorithm; } - if (code === 10 && startPosition === endPosition && atCarriageReturn) { - chunks.push(-3); - atCarriageReturn = void 0; - } else { - if (atCarriageReturn) { - chunks.push(-5); - atCarriageReturn = void 0; - } - if (startPosition < endPosition) { - chunks.push(value2.slice(startPosition, endPosition)); - column2 += endPosition - startPosition; - } - switch (code) { - case 0: { - chunks.push(65533); - column2++; - break; - } - case 9: { - next2 = Math.ceil(column2 / 4) * 4; - chunks.push(-2); - while (column2++ < next2) - chunks.push(-1); - break; - } - case 10: { - chunks.push(-4); - column2 = 1; - break; - } - default: { - atCarriageReturn = true; - column2 = 1; - } - } + if (fallback in layoutAlgorithms) { + log.warn(`Layout algorithm ${algorithm} is not registered. Using ${fallback} as fallback.`); + return fallback; } - startPosition = endPosition + 1; - } - if (end2) { - if (atCarriageReturn) - chunks.push(-5); - if (buffer) - chunks.push(buffer); - chunks.push(null); - } - return chunks; - } - } - function postprocess(events) { - while (!subtokenize(events)) { - } - return events; - } - function decodeNumericCharacterReference(value2, base) { - const code = Number.parseInt(value2, base); - if ( - // C0 except for HT, LF, FF, CR, space. - code < 9 || code === 11 || code > 13 && code < 32 || // Control character (DEL) of C0, and C1 controls. - code > 126 && code < 160 || // Lone high surrogates and low surrogates. - code > 55295 && code < 57344 || // Noncharacters. - code > 64975 && code < 65008 || (code & 65535) === 65535 || (code & 65535) === 65534 || // Out of range - code > 1114111 - ) { - return "�"; - } - return String.fromCharCode(code); - } - const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; - function decodeString(value2) { - return value2.replace(characterEscapeOrReference, decode); - } - function decode($0, $1, $2) { - if ($1) { - return $1; - } - const head2 = $2.charCodeAt(0); - if (head2 === 35) { - const head3 = $2.charCodeAt(1); - const hex2 = head3 === 120 || head3 === 88; - return decodeNumericCharacterReference($2.slice(hex2 ? 2 : 1), hex2 ? 16 : 10); - } - return decodeNamedCharacterReference($2) || $0; - } - function stringifyPosition(value2) { - if (!value2 || typeof value2 !== "object") { - return ""; - } - if ("position" in value2 || "type" in value2) { - return position(value2.position); - } - if ("start" in value2 || "end" in value2) { - return position(value2); + throw new Error(`Both layout algorithms ${algorithm} and ${fallback} are not registered.`); + }, "getRegisteredLayoutAlgorithm"); } - if ("line" in value2 || "column" in value2) { - return point$1(value2); - } - return ""; - } - function point$1(point2) { - return index(point2 && point2.line) + ":" + index(point2 && point2.column); - } - function position(pos) { - return point$1(pos && pos.start) + "-" + point$1(pos && pos.end); - } - function index(value2) { - return value2 && typeof value2 === "number" ? value2 : 1; - } - const own = {}.hasOwnProperty; - const fromMarkdown = ( - /** - * @type {( - * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) & - * ((value: Value, options?: Options | null | undefined) => Root) - * )} - */ - /** - * @param {Value} value - * @param {Encoding | Options | null | undefined} [encoding] - * @param {Options | null | undefined} [options] - * @returns {Root} - */ - function(value2, encoding, options2) { - if (typeof encoding !== "string") { - options2 = encoding; - encoding = void 0; - } - return compiler(options2)( - postprocess( - parse$1(options2).document().write(preprocess()(value2, encoding, true)) - ) - ); + }); + + // src/rendering-util/setupViewPortForSVG.ts + var setupViewPortForSVG, calculateDimensionsWithPadding, createViewBox; + var init_setupViewPortForSVG = __esm({ + "src/rendering-util/setupViewPortForSVG.ts"() { + "use strict"; + init_setupGraphViewbox(); + init_logger(); + setupViewPortForSVG = /* @__PURE__ */ __name((svg, padding3, cssDiagram, useMaxWidth) => { + svg.attr("class", cssDiagram); + const { width: width3, height: height2, x: x5, y: y5 } = calculateDimensionsWithPadding(svg, padding3); + configureSvgSize(svg, height2, width3, useMaxWidth); + const viewBox = createViewBox(x5, y5, width3, height2, padding3); + svg.attr("viewBox", viewBox); + log.debug(`viewBox configured: ${viewBox} with padding: ${padding3}`); + }, "setupViewPortForSVG"); + calculateDimensionsWithPadding = /* @__PURE__ */ __name((svg, padding3) => { + const bounds4 = svg.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 }; + return { + width: bounds4.width + padding3 * 2, + height: bounds4.height + padding3 * 2, + x: bounds4.x, + y: bounds4.y + }; + }, "calculateDimensionsWithPadding"); + createViewBox = /* @__PURE__ */ __name((x5, y5, width3, height2, padding3) => { + return `${x5 - padding3} ${y5 - padding3} ${width3} ${height2}`; + }, "createViewBox"); } - ); - function compiler(options2) { - const config2 = { - transforms: [], - canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"], - enter: { - autolink: opener(link2), - autolinkProtocol: onenterdata, - autolinkEmail: onenterdata, - atxHeading: opener(heading), - blockQuote: opener(blockQuote2), - characterEscape: onenterdata, - characterReference: onenterdata, - codeFenced: opener(codeFlow), - codeFencedFenceInfo: buffer, - codeFencedFenceMeta: buffer, - codeIndented: opener(codeFlow, buffer), - codeText: opener(codeText2, buffer), - codeTextData: onenterdata, - data: onenterdata, - codeFlowValue: onenterdata, - definition: opener(definition2), - definitionDestinationString: buffer, - definitionLabelString: buffer, - definitionTitleString: buffer, - emphasis: opener(emphasis), - hardBreakEscape: opener(hardBreak), - hardBreakTrailing: opener(hardBreak), - htmlFlow: opener(html2, buffer), - htmlFlowData: onenterdata, - htmlText: opener(html2, buffer), - htmlTextData: onenterdata, - image: opener(image), - label: buffer, - link: opener(link2), - listItem: opener(listItem), - listItemValue: onenterlistitemvalue, - listOrdered: opener(list2, onenterlistordered), - listUnordered: opener(list2), - paragraph: opener(paragraph), - reference: onenterreference, - referenceString: buffer, - resourceDestinationString: buffer, - resourceTitleString: buffer, - setextHeading: opener(heading), - strong: opener(strong), - thematicBreak: opener(thematicBreak2) - }, - exit: { - atxHeading: closer(), - atxHeadingSequence: onexitatxheadingsequence, - autolink: closer(), - autolinkEmail: onexitautolinkemail, - autolinkProtocol: onexitautolinkprotocol, - blockQuote: closer(), - characterEscapeValue: onexitdata, - characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, - characterReferenceMarkerNumeric: onexitcharacterreferencemarker, - characterReferenceValue: onexitcharacterreferencevalue, - codeFenced: closer(onexitcodefenced), - codeFencedFence: onexitcodefencedfence, - codeFencedFenceInfo: onexitcodefencedfenceinfo, - codeFencedFenceMeta: onexitcodefencedfencemeta, - codeFlowValue: onexitdata, - codeIndented: closer(onexitcodeindented), - codeText: closer(onexitcodetext), - codeTextData: onexitdata, - data: onexitdata, - definition: closer(), - definitionDestinationString: onexitdefinitiondestinationstring, - definitionLabelString: onexitdefinitionlabelstring, - definitionTitleString: onexitdefinitiontitlestring, - emphasis: closer(), - hardBreakEscape: closer(onexithardbreak), - hardBreakTrailing: closer(onexithardbreak), - htmlFlow: closer(onexithtmlflow), - htmlFlowData: onexitdata, - htmlText: closer(onexithtmltext), - htmlTextData: onexitdata, - image: closer(onexitimage), - label: onexitlabel, - labelText: onexitlabeltext, - lineEnding: onexitlineending, - link: closer(onexitlink), - listItem: closer(), - listOrdered: closer(), - listUnordered: closer(), - paragraph: closer(), - referenceString: onexitreferencestring, - resourceDestinationString: onexitresourcedestinationstring, - resourceTitleString: onexitresourcetitlestring, - resource: onexitresource, - setextHeading: closer(onexitsetextheading), - setextHeadingLineSequence: onexitsetextheadinglinesequence, - setextHeadingText: onexitsetextheadingtext, - strong: closer(), - thematicBreak: closer() - } - }; - configure(config2, (options2 || {}).mdastExtensions || []); - const data = {}; - return compile2; - function compile2(events) { - let tree = { - type: "root", - children: [] - }; - const context = { - stack: [tree], - tokenStack: [], - config: config2, - enter: enter2, - exit: exit2, - buffer, - resume, - setData, - getData - }; - const listStack = []; - let index2 = -1; - while (++index2 < events.length) { - if (events[index2][1].type === "listOrdered" || events[index2][1].type === "listUnordered") { - if (events[index2][0] === "enter") { - listStack.push(index2); - } else { - const tail = listStack.pop(); - index2 = prepareList(events, tail, index2); - } - } - } - index2 = -1; - while (++index2 < events.length) { - const handler = config2[events[index2][0]]; - if (own.call(handler, events[index2][1].type)) { - handler[events[index2][1].type].call( - Object.assign( - { - sliceSerialize: events[index2][2].sliceSerialize - }, - context - ), - events[index2][1] + }); + + // src/diagrams/flowchart/flowRenderer-v3-unified.ts + var getClasses2, draw2, flowRenderer_v3_unified_default; + var init_flowRenderer_v3_unified = __esm({ + "src/diagrams/flowchart/flowRenderer-v3-unified.ts"() { + "use strict"; + init_src32(); + init_diagramAPI(); + init_logger(); + init_insertElementsForSize(); + init_render(); + init_setupViewPortForSVG(); + init_utils2(); + init_flowDb(); + getClasses2 = /* @__PURE__ */ __name(function(text2, diagramObj) { + return diagramObj.db.getClasses(); + }, "getClasses"); + draw2 = /* @__PURE__ */ __name(async function(text2, id26, _version, diag) { + log.info("REF0:"); + log.info("Drawing state diagram (v2)", id26); + const { securityLevel, flowchart: conf8, layout: layout6 } = getConfig2(); + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; + log.debug("Before getData: "); + const data4Layout = diag.db.getData(); + log.debug("Data: ", data4Layout); + const svg = getDiagramElement(id26, securityLevel); + const direction4 = getDirection(); + data4Layout.type = diag.type; + data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout6); + if (data4Layout.layoutAlgorithm === "dagre" && layout6 === "elk") { + log.warn( + "flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback." ); } - } - if (context.tokenStack.length > 0) { - const tail = context.tokenStack[context.tokenStack.length - 1]; - const handler = tail[1] || defaultOnError; - handler.call(context, void 0, tail[0]); - } - tree.position = { - start: point( - events.length > 0 ? events[0][1].start : { - line: 1, - column: 1, - offset: 0 + data4Layout.direction = direction4; + data4Layout.nodeSpacing = conf8?.nodeSpacing || 50; + data4Layout.rankSpacing = conf8?.rankSpacing || 50; + data4Layout.markers = ["point", "circle", "cross"]; + data4Layout.diagramId = id26; + log.debug("REF1:", data4Layout); + await render4(data4Layout, svg); + const padding3 = data4Layout.config.flowchart?.diagramPadding ?? 8; + utils_default2.insertTitle( + svg, + "flowchartTitleText", + conf8?.titleTopMargin || 0, + diag.db.getDiagramTitle() + ); + setupViewPortForSVG(svg, padding3, "flowchart", conf8?.useMaxWidth || false); + for (const vertex of data4Layout.nodes) { + const node2 = select_default2(`#${id26} [id="${vertex.id}"]`); + if (!node2 || !vertex.link) { + continue; } - ), - end: point( - events.length > 0 ? events[events.length - 2][1].end : { - line: 1, - column: 1, - offset: 0 + const link3 = doc.createElementNS("http://www.w3.org/2000/svg", "a"); + link3.setAttributeNS("http://www.w3.org/2000/svg", "class", vertex.cssClasses); + link3.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"); + if (securityLevel === "sandbox") { + link3.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top"); + } else if (vertex.linkTarget) { + link3.setAttributeNS("http://www.w3.org/2000/svg", "target", vertex.linkTarget); } - ) - }; - index2 = -1; - while (++index2 < config2.transforms.length) { - tree = config2.transforms[index2](tree) || tree; - } - return tree; - } - function prepareList(events, start2, length2) { - let index2 = start2 - 1; - let containerBalance = -1; - let listSpread = false; - let listItem2; - let lineIndex; - let firstBlankLineIndex; - let atMarker; - while (++index2 <= length2) { - const event = events[index2]; - if (event[1].type === "listUnordered" || event[1].type === "listOrdered" || event[1].type === "blockQuote") { - if (event[0] === "enter") { - containerBalance++; - } else { - containerBalance--; + const linkNode = node2.insert(function() { + return link3; + }, ":first-child"); + const shape = node2.select(".label-container"); + if (shape) { + linkNode.append(function() { + return shape.node(); + }); } - atMarker = void 0; - } else if (event[1].type === "lineEndingBlank") { - if (event[0] === "enter") { - if (listItem2 && !atMarker && !containerBalance && !firstBlankLineIndex) { - firstBlankLineIndex = index2; - } - atMarker = void 0; + const label = node2.select(".label"); + if (label) { + linkNode.append(function() { + return label.node(); + }); } - } else if (event[1].type === "linePrefix" || event[1].type === "listItemValue" || event[1].type === "listItemMarker" || event[1].type === "listItemPrefix" || event[1].type === "listItemPrefixWhitespace") - ; - else { - atMarker = void 0; - } - if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) { - if (listItem2) { - let tailIndex = index2; - lineIndex = void 0; - while (tailIndex--) { - const tailEvent = events[tailIndex]; - if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") { - if (tailEvent[0] === "exit") - continue; - if (lineIndex) { - events[lineIndex][1].type = "lineEndingBlank"; - listSpread = true; - } - tailEvent[1].type = "lineEnding"; - lineIndex = tailIndex; - } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") - ; - else { + } + }, "draw"); + flowRenderer_v3_unified_default = { + getClasses: getClasses2, + draw: draw2 + }; + } + }); + + // src/diagrams/flowchart/parser/flow.jison + var parser3, flow_default; + var init_flow = __esm({ + "src/diagrams/flowchart/parser/flow.jison"() { + "use strict"; + parser3 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 4], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 8, 9, 10, 11, 27, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $V4 = [2, 2], $V5 = [1, 13], $V6 = [1, 14], $V7 = [1, 15], $V8 = [1, 16], $V9 = [1, 23], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 49], $Ve = [1, 48], $Vf = [1, 29], $Vg = [1, 30], $Vh = [1, 31], $Vi = [1, 32], $Vj = [1, 33], $Vk = [1, 44], $Vl = [1, 46], $Vm = [1, 42], $Vn = [1, 47], $Vo = [1, 43], $Vp = [1, 50], $Vq = [1, 45], $Vr = [1, 51], $Vs = [1, 52], $Vt = [1, 34], $Vu = [1, 35], $Vv = [1, 36], $Vw = [1, 37], $Vx = [1, 57], $Vy = [1, 8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $Vz = [1, 61], $VA = [1, 60], $VB = [1, 62], $VC = [8, 9, 11, 73, 75], $VD = [1, 88], $VE = [1, 93], $VF = [1, 92], $VG = [1, 89], $VH = [1, 85], $VI = [1, 91], $VJ = [1, 87], $VK = [1, 94], $VL = [1, 90], $VM = [1, 95], $VN = [1, 86], $VO = [8, 9, 10, 11, 73, 75], $VP = [8, 9, 10, 11, 44, 73, 75], $VQ = [8, 9, 10, 11, 29, 42, 44, 46, 48, 50, 52, 54, 56, 58, 61, 63, 65, 66, 68, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VR = [8, 9, 11, 42, 58, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VS = [42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VT = [1, 121], $VU = [1, 120], $VV = [1, 128], $VW = [1, 142], $VX = [1, 143], $VY = [1, 144], $VZ = [1, 145], $V_ = [1, 130], $V$ = [1, 132], $V01 = [1, 136], $V11 = [1, 137], $V21 = [1, 138], $V31 = [1, 139], $V41 = [1, 140], $V51 = [1, 141], $V61 = [1, 146], $V71 = [1, 147], $V81 = [1, 126], $V91 = [1, 127], $Va1 = [1, 134], $Vb1 = [1, 129], $Vc1 = [1, 133], $Vd1 = [1, 131], $Ve1 = [8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], $Vf1 = [1, 149], $Vg1 = [8, 9, 11], $Vh1 = [8, 9, 10, 11, 14, 42, 58, 86, 102, 103, 106, 108, 111, 112, 113], $Vi1 = [1, 169], $Vj1 = [1, 165], $Vk1 = [1, 166], $Vl1 = [1, 170], $Vm1 = [1, 167], $Vn1 = [1, 168], $Vo1 = [75, 113, 116], $Vp1 = [8, 9, 10, 11, 12, 14, 27, 29, 32, 42, 58, 73, 81, 82, 83, 84, 85, 86, 87, 102, 106, 108, 111, 112, 113], $Vq1 = [10, 103], $Vr1 = [31, 47, 49, 51, 53, 55, 60, 62, 64, 65, 67, 69, 113, 114, 115], $Vs1 = [1, 235], $Vt1 = [1, 233], $Vu1 = [1, 237], $Vv1 = [1, 231], $Vw1 = [1, 232], $Vx1 = [1, 234], $Vy1 = [1, 236], $Vz1 = [1, 238], $VA1 = [1, 255], $VB1 = [8, 9, 11, 103], $VC1 = [8, 9, 10, 11, 58, 81, 102, 103, 106, 107, 108, 109]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "graphConfig": 4, "document": 5, "line": 6, "statement": 7, "SEMI": 8, "NEWLINE": 9, "SPACE": 10, "EOF": 11, "GRAPH": 12, "NODIR": 13, "DIR": 14, "FirstStmtSeparator": 15, "ending": 16, "endToken": 17, "spaceList": 18, "spaceListNewline": 19, "vertexStatement": 20, "separator": 21, "styleStatement": 22, "linkStyleStatement": 23, "classDefStatement": 24, "classStatement": 25, "clickStatement": 26, "subgraph": 27, "textNoTags": 28, "SQS": 29, "text": 30, "SQE": 31, "end": 32, "direction": 33, "acc_title": 34, "acc_title_value": 35, "acc_descr": 36, "acc_descr_value": 37, "acc_descr_multiline_value": 38, "link": 39, "node": 40, "styledVertex": 41, "AMP": 42, "vertex": 43, "STYLE_SEPARATOR": 44, "idString": 45, "DOUBLECIRCLESTART": 46, "DOUBLECIRCLEEND": 47, "PS": 48, "PE": 49, "(-": 50, "-)": 51, "STADIUMSTART": 52, "STADIUMEND": 53, "SUBROUTINESTART": 54, "SUBROUTINEEND": 55, "VERTEX_WITH_PROPS_START": 56, "NODE_STRING[field]": 57, "COLON": 58, "NODE_STRING[value]": 59, "PIPE": 60, "CYLINDERSTART": 61, "CYLINDEREND": 62, "DIAMOND_START": 63, "DIAMOND_STOP": 64, "TAGEND": 65, "TRAPSTART": 66, "TRAPEND": 67, "INVTRAPSTART": 68, "INVTRAPEND": 69, "linkStatement": 70, "arrowText": 71, "TESTSTR": 72, "START_LINK": 73, "edgeText": 74, "LINK": 75, "edgeTextToken": 76, "STR": 77, "MD_STR": 78, "textToken": 79, "keywords": 80, "STYLE": 81, "LINKSTYLE": 82, "CLASSDEF": 83, "CLASS": 84, "CLICK": 85, "DOWN": 86, "UP": 87, "textNoTagsToken": 88, "stylesOpt": 89, "idString[vertex]": 90, "idString[class]": 91, "CALLBACKNAME": 92, "CALLBACKARGS": 93, "HREF": 94, "LINK_TARGET": 95, "STR[link]": 96, "STR[tooltip]": 97, "alphaNum": 98, "DEFAULT": 99, "numList": 100, "INTERPOLATE": 101, "NUM": 102, "COMMA": 103, "style": 104, "styleComponent": 105, "NODE_STRING": 106, "UNIT": 107, "BRKT": 108, "PCT": 109, "idStringToken": 110, "MINUS": 111, "MULT": 112, "UNICODE_TEXT": 113, "TEXT": 114, "TAGSTART": 115, "EDGE_TEXT": 116, "alphaNumToken": 117, "direction_tb": 118, "direction_bt": 119, "direction_rl": 120, "direction_lr": 121, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "NODIR", 14: "DIR", 27: "subgraph", 29: "SQS", 31: "SQE", 32: "end", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 42: "AMP", 44: "STYLE_SEPARATOR", 46: "DOUBLECIRCLESTART", 47: "DOUBLECIRCLEEND", 48: "PS", 49: "PE", 50: "(-", 51: "-)", 52: "STADIUMSTART", 53: "STADIUMEND", 54: "SUBROUTINESTART", 55: "SUBROUTINEEND", 56: "VERTEX_WITH_PROPS_START", 57: "NODE_STRING[field]", 58: "COLON", 59: "NODE_STRING[value]", 60: "PIPE", 61: "CYLINDERSTART", 62: "CYLINDEREND", 63: "DIAMOND_START", 64: "DIAMOND_STOP", 65: "TAGEND", 66: "TRAPSTART", 67: "TRAPEND", 68: "INVTRAPSTART", 69: "INVTRAPEND", 72: "TESTSTR", 73: "START_LINK", 75: "LINK", 77: "STR", 78: "MD_STR", 81: "STYLE", 82: "LINKSTYLE", 83: "CLASSDEF", 84: "CLASS", 85: "CLICK", 86: "DOWN", 87: "UP", 90: "idString[vertex]", 91: "idString[class]", 92: "CALLBACKNAME", 93: "CALLBACKARGS", 94: "HREF", 95: "LINK_TARGET", 96: "STR[link]", 97: "STR[tooltip]", 99: "DEFAULT", 101: "INTERPOLATE", 102: "NUM", 103: "COMMA", 106: "NODE_STRING", 107: "UNIT", 108: "BRKT", 109: "PCT", 111: "MINUS", 112: "MULT", 113: "UNICODE_TEXT", 114: "TEXT", 115: "TAGSTART", 116: "EDGE_TEXT", 118: "direction_tb", 119: "direction_bt", 120: "direction_rl", 121: "direction_lr" }, + productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 3], [16, 2], [16, 1], [17, 1], [17, 1], [17, 1], [15, 1], [15, 1], [15, 2], [19, 2], [19, 2], [19, 1], [19, 1], [18, 2], [18, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 6], [7, 4], [7, 1], [7, 2], [7, 2], [7, 1], [21, 1], [21, 1], [21, 1], [20, 3], [20, 4], [20, 2], [20, 1], [40, 1], [40, 5], [41, 1], [41, 3], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 8], [43, 4], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 4], [43, 4], [43, 1], [39, 2], [39, 3], [39, 3], [39, 1], [39, 3], [74, 1], [74, 2], [74, 1], [74, 1], [70, 1], [71, 3], [30, 1], [30, 2], [30, 1], [30, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [28, 1], [28, 2], [28, 1], [28, 1], [24, 5], [25, 5], [26, 2], [26, 4], [26, 3], [26, 5], [26, 3], [26, 5], [26, 5], [26, 7], [26, 2], [26, 4], [26, 2], [26, 4], [26, 4], [26, 6], [22, 5], [23, 5], [23, 5], [23, 9], [23, 9], [23, 7], [23, 7], [100, 1], [100, 3], [89, 1], [89, 3], [104, 1], [104, 2], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [79, 1], [79, 1], [79, 1], [79, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [76, 1], [76, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [45, 1], [45, 2], [98, 1], [98, 2], [33, 1], [33, 1], [33, 1], [33, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 2: + this.$ = []; + break; + case 3: + if (!Array.isArray($$[$0]) || $$[$0].length > 0) { + $$[$0 - 1].push($$[$0]); + } + this.$ = $$[$0 - 1]; + break; + case 4: + case 176: + this.$ = $$[$0]; + break; + case 11: + yy.setDirection("TB"); + this.$ = "TB"; + break; + case 12: + yy.setDirection($$[$0 - 1]); + this.$ = $$[$0 - 1]; + break; + case 27: + this.$ = $$[$0 - 1].nodes; + break; + case 28: + case 29: + case 30: + case 31: + case 32: + this.$ = []; + break; + case 33: + this.$ = yy.addSubGraph($$[$0 - 6], $$[$0 - 1], $$[$0 - 4]); + break; + case 34: + this.$ = yy.addSubGraph($$[$0 - 3], $$[$0 - 1], $$[$0 - 3]); + break; + case 35: + this.$ = yy.addSubGraph(void 0, $$[$0 - 1], void 0); + break; + case 37: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 38: + case 39: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 43: + yy.addLink($$[$0 - 2].stmt, $$[$0], $$[$0 - 1]); + this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0 - 2].nodes) }; + break; + case 44: + yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]); + this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) }; + break; + case 45: + this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1] }; + break; + case 46: + this.$ = { stmt: $$[$0], nodes: $$[$0] }; + break; + case 47: + this.$ = [$$[$0]]; + break; + case 48: + this.$ = $$[$0 - 4].concat($$[$0]); + break; + case 49: + this.$ = $$[$0]; + break; + case 50: + this.$ = $$[$0 - 2]; + yy.setClass($$[$0 - 2], $$[$0]); + break; + case 51: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "square"); + break; + case 52: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "doublecircle"); + break; + case 53: + this.$ = $$[$0 - 5]; + yy.addVertex($$[$0 - 5], $$[$0 - 2], "circle"); + break; + case 54: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "ellipse"); + break; + case 55: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "stadium"); + break; + case 56: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "subroutine"); + break; + case 57: + this.$ = $$[$0 - 7]; + yy.addVertex($$[$0 - 7], $$[$0 - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[$$[$0 - 5], $$[$0 - 3]]])); + break; + case 58: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "cylinder"); + break; + case 59: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "round"); + break; + case 60: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "diamond"); + break; + case 61: + this.$ = $$[$0 - 5]; + yy.addVertex($$[$0 - 5], $$[$0 - 2], "hexagon"); + break; + case 62: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "odd"); + break; + case 63: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "trapezoid"); + break; + case 64: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "inv_trapezoid"); + break; + case 65: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_right"); + break; + case 66: + this.$ = $$[$0 - 3]; + yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_left"); + break; + case 67: + this.$ = $$[$0]; + yy.addVertex($$[$0]); + break; + case 68: + $$[$0 - 1].text = $$[$0]; + this.$ = $$[$0 - 1]; + break; + case 69: + case 70: + $$[$0 - 2].text = $$[$0 - 1]; + this.$ = $$[$0 - 2]; + break; + case 71: + this.$ = $$[$0]; + break; + case 72: + var inf = yy.destructLink($$[$0], $$[$0 - 2]); + this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length, "text": $$[$0 - 1] }; + break; + case 73: + this.$ = { text: $$[$0], type: "text" }; + break; + case 74: + this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; + break; + case 75: + this.$ = { text: $$[$0], type: "string" }; + break; + case 76: + this.$ = { text: $$[$0], type: "markdown" }; + break; + case 77: + var inf = yy.destructLink($$[$0]); + this.$ = { "type": inf.type, "stroke": inf.stroke, "length": inf.length }; + break; + case 78: + this.$ = $$[$0 - 1]; + break; + case 79: + this.$ = { text: $$[$0], type: "text" }; + break; + case 80: + this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; + break; + case 81: + this.$ = { text: $$[$0], type: "string" }; + break; + case 82: + case 97: + this.$ = { text: $$[$0], type: "markdown" }; + break; + case 94: + this.$ = { text: $$[$0], type: "text" }; + break; + case 95: + this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; + break; + case 96: + this.$ = { text: $$[$0], type: "text" }; + break; + case 98: + this.$ = $$[$0 - 4]; + yy.addClass($$[$0 - 2], $$[$0]); + break; + case 99: + this.$ = $$[$0 - 4]; + yy.setClass($$[$0 - 2], $$[$0]); break; + case 100: + case 108: + this.$ = $$[$0 - 1]; + yy.setClickEvent($$[$0 - 1], $$[$0]); + break; + case 101: + case 109: + this.$ = $$[$0 - 3]; + yy.setClickEvent($$[$0 - 3], $$[$0 - 2]); + yy.setTooltip($$[$0 - 3], $$[$0]); + break; + case 102: + this.$ = $$[$0 - 2]; + yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); + break; + case 103: + this.$ = $$[$0 - 4]; + yy.setClickEvent($$[$0 - 4], $$[$0 - 3], $$[$0 - 2]); + yy.setTooltip($$[$0 - 4], $$[$0]); + break; + case 104: + this.$ = $$[$0 - 2]; + yy.setLink($$[$0 - 2], $$[$0]); + break; + case 105: + this.$ = $$[$0 - 4]; + yy.setLink($$[$0 - 4], $$[$0 - 2]); + yy.setTooltip($$[$0 - 4], $$[$0]); + break; + case 106: + this.$ = $$[$0 - 4]; + yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]); + break; + case 107: + this.$ = $$[$0 - 6]; + yy.setLink($$[$0 - 6], $$[$0 - 4], $$[$0]); + yy.setTooltip($$[$0 - 6], $$[$0 - 2]); + break; + case 110: + this.$ = $$[$0 - 1]; + yy.setLink($$[$0 - 1], $$[$0]); + break; + case 111: + this.$ = $$[$0 - 3]; + yy.setLink($$[$0 - 3], $$[$0 - 2]); + yy.setTooltip($$[$0 - 3], $$[$0]); + break; + case 112: + this.$ = $$[$0 - 3]; + yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); + break; + case 113: + this.$ = $$[$0 - 5]; + yy.setLink($$[$0 - 5], $$[$0 - 4], $$[$0]); + yy.setTooltip($$[$0 - 5], $$[$0 - 2]); + break; + case 114: + this.$ = $$[$0 - 4]; + yy.addVertex($$[$0 - 2], void 0, void 0, $$[$0]); + break; + case 115: + this.$ = $$[$0 - 4]; + yy.updateLink([$$[$0 - 2]], $$[$0]); + break; + case 116: + this.$ = $$[$0 - 4]; + yy.updateLink($$[$0 - 2], $$[$0]); + break; + case 117: + this.$ = $$[$0 - 8]; + yy.updateLinkInterpolate([$$[$0 - 6]], $$[$0 - 2]); + yy.updateLink([$$[$0 - 6]], $$[$0]); + break; + case 118: + this.$ = $$[$0 - 8]; + yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]); + yy.updateLink($$[$0 - 6], $$[$0]); + break; + case 119: + this.$ = $$[$0 - 6]; + yy.updateLinkInterpolate([$$[$0 - 4]], $$[$0]); + break; + case 120: + this.$ = $$[$0 - 6]; + yy.updateLinkInterpolate($$[$0 - 4], $$[$0]); + break; + case 121: + case 123: + this.$ = [$$[$0]]; + break; + case 122: + case 124: + $$[$0 - 2].push($$[$0]); + this.$ = $$[$0 - 2]; + break; + case 126: + this.$ = $$[$0 - 1] + $$[$0]; + break; + case 174: + this.$ = $$[$0]; + break; + case 175: + this.$ = $$[$0 - 1] + "" + $$[$0]; + break; + case 177: + this.$ = $$[$0 - 1] + "" + $$[$0]; + break; + case 178: + this.$ = { stmt: "dir", value: "TB" }; + break; + case 179: + this.$ = { stmt: "dir", value: "BT" }; + break; + case 180: + this.$ = { stmt: "dir", value: "RL" }; + break; + case 181: + this.$ = { stmt: "dir", value: "LR" }; + break; + } + }, "anonymous"), + table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o2($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 13: [1, 9], 14: [1, 10] }, { 1: [2, 1], 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, o2($V3, [2, 9]), o2($V3, [2, 10]), o2($V3, [2, 11]), { 8: [1, 54], 9: [1, 55], 10: $Vx, 15: 53, 18: 56 }, o2($Vy, [2, 3]), o2($Vy, [2, 4]), o2($Vy, [2, 5]), o2($Vy, [2, 6]), o2($Vy, [2, 7]), o2($Vy, [2, 8]), { 8: $Vz, 9: $VA, 11: $VB, 21: 58, 39: 59, 70: 63, 73: [1, 64], 75: [1, 65] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 66 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 67 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 68 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 69 }, { 8: $Vz, 9: $VA, 11: $VB, 21: 70 }, { 8: $Vz, 9: $VA, 10: [1, 71], 11: $VB, 21: 72 }, o2($Vy, [2, 36]), { 35: [1, 73] }, { 37: [1, 74] }, o2($Vy, [2, 39]), o2($VC, [2, 46], { 18: 75, 10: $Vx }), { 10: [1, 76] }, { 10: [1, 77] }, { 10: [1, 78] }, { 10: [1, 79] }, { 14: $VD, 42: $VE, 58: $VF, 77: [1, 83], 86: $VG, 92: [1, 80], 94: [1, 81], 98: 82, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, o2($Vy, [2, 178]), o2($Vy, [2, 179]), o2($Vy, [2, 180]), o2($Vy, [2, 181]), o2($VO, [2, 47]), o2($VO, [2, 49], { 44: [1, 96] }), o2($VP, [2, 67], { 110: 109, 29: [1, 97], 42: $Vd, 46: [1, 98], 48: [1, 99], 50: [1, 100], 52: [1, 101], 54: [1, 102], 56: [1, 103], 58: $Ve, 61: [1, 104], 63: [1, 105], 65: [1, 106], 66: [1, 107], 68: [1, 108], 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), o2($VQ, [2, 174]), o2($VQ, [2, 135]), o2($VQ, [2, 136]), o2($VQ, [2, 137]), o2($VQ, [2, 138]), o2($VQ, [2, 139]), o2($VQ, [2, 140]), o2($VQ, [2, 141]), o2($VQ, [2, 142]), o2($VQ, [2, 143]), o2($VQ, [2, 144]), o2($VQ, [2, 145]), o2($V3, [2, 12]), o2($V3, [2, 18]), o2($V3, [2, 19]), { 9: [1, 110] }, o2($VR, [2, 26], { 18: 111, 10: $Vx }), o2($Vy, [2, 27]), { 40: 112, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o2($Vy, [2, 40]), o2($Vy, [2, 41]), o2($Vy, [2, 42]), o2($VS, [2, 71], { 71: 113, 60: [1, 115], 72: [1, 114] }), { 74: 116, 76: 117, 77: [1, 118], 78: [1, 119], 113: $VT, 116: $VU }, o2([42, 58, 60, 72, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 77]), o2($Vy, [2, 28]), o2($Vy, [2, 29]), o2($Vy, [2, 30]), o2($Vy, [2, 31]), o2($Vy, [2, 32]), { 10: $VV, 12: $VW, 14: $VX, 27: $VY, 28: 122, 32: $VZ, 42: $V_, 58: $V$, 73: $V01, 77: [1, 124], 78: [1, 125], 80: 135, 81: $V11, 82: $V21, 83: $V31, 84: $V41, 85: $V51, 86: $V61, 87: $V71, 88: 123, 102: $V81, 106: $V91, 108: $Va1, 111: $Vb1, 112: $Vc1, 113: $Vd1 }, o2($Ve1, $V4, { 5: 148 }), o2($Vy, [2, 37]), o2($Vy, [2, 38]), o2($VC, [2, 45], { 42: $Vf1 }), { 42: $Vd, 45: 150, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 99: [1, 151], 100: 152, 102: [1, 153] }, { 42: $Vd, 45: 154, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 42: $Vd, 45: 155, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o2($Vg1, [2, 100], { 10: [1, 156], 93: [1, 157] }), { 77: [1, 158] }, o2($Vg1, [2, 108], { 117: 160, 10: [1, 159], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o2($Vg1, [2, 110], { 10: [1, 161] }), o2($Vh1, [2, 176]), o2($Vh1, [2, 163]), o2($Vh1, [2, 164]), o2($Vh1, [2, 165]), o2($Vh1, [2, 166]), o2($Vh1, [2, 167]), o2($Vh1, [2, 168]), o2($Vh1, [2, 169]), o2($Vh1, [2, 170]), o2($Vh1, [2, 171]), o2($Vh1, [2, 172]), o2($Vh1, [2, 173]), { 42: $Vd, 45: 162, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 30: 163, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 171, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 173, 48: [1, 172], 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 174, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 175, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 176, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 106: [1, 177] }, { 30: 178, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 179, 63: [1, 180], 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 181, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 182, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 183, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VQ, [2, 175]), o2($V3, [2, 20]), o2($VR, [2, 25]), o2($VC, [2, 43], { 18: 184, 10: $Vx }), o2($VS, [2, 68], { 10: [1, 185] }), { 10: [1, 186] }, { 30: 187, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 75: [1, 188], 76: 189, 113: $VT, 116: $VU }, o2($Vo1, [2, 73]), o2($Vo1, [2, 75]), o2($Vo1, [2, 76]), o2($Vo1, [2, 161]), o2($Vo1, [2, 162]), { 8: $Vz, 9: $VA, 10: $VV, 11: $VB, 12: $VW, 14: $VX, 21: 191, 27: $VY, 29: [1, 190], 32: $VZ, 42: $V_, 58: $V$, 73: $V01, 80: 135, 81: $V11, 82: $V21, 83: $V31, 84: $V41, 85: $V51, 86: $V61, 87: $V71, 88: 192, 102: $V81, 106: $V91, 108: $Va1, 111: $Vb1, 112: $Vc1, 113: $Vd1 }, o2($Vp1, [2, 94]), o2($Vp1, [2, 96]), o2($Vp1, [2, 97]), o2($Vp1, [2, 150]), o2($Vp1, [2, 151]), o2($Vp1, [2, 152]), o2($Vp1, [2, 153]), o2($Vp1, [2, 154]), o2($Vp1, [2, 155]), o2($Vp1, [2, 156]), o2($Vp1, [2, 157]), o2($Vp1, [2, 158]), o2($Vp1, [2, 159]), o2($Vp1, [2, 160]), o2($Vp1, [2, 83]), o2($Vp1, [2, 84]), o2($Vp1, [2, 85]), o2($Vp1, [2, 86]), o2($Vp1, [2, 87]), o2($Vp1, [2, 88]), o2($Vp1, [2, 89]), o2($Vp1, [2, 90]), o2($Vp1, [2, 91]), o2($Vp1, [2, 92]), o2($Vp1, [2, 93]), { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 193], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, { 10: $Vx, 18: 194 }, { 10: [1, 195], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: [1, 196] }, { 10: [1, 197], 103: [1, 198] }, o2($Vq1, [2, 121]), { 10: [1, 199], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: [1, 200], 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 109, 111: $Vq, 112: $Vr, 113: $Vs }, { 77: [1, 201] }, o2($Vg1, [2, 102], { 10: [1, 202] }), o2($Vg1, [2, 104], { 10: [1, 203] }), { 77: [1, 204] }, o2($Vh1, [2, 177]), { 77: [1, 205], 95: [1, 206] }, o2($VO, [2, 50], { 110: 109, 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), { 31: [1, 207], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($Vr1, [2, 79]), o2($Vr1, [2, 81]), o2($Vr1, [2, 82]), o2($Vr1, [2, 146]), o2($Vr1, [2, 147]), o2($Vr1, [2, 148]), o2($Vr1, [2, 149]), { 47: [1, 209], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 210, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 49: [1, 211], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 51: [1, 212], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 53: [1, 213], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 55: [1, 214], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 58: [1, 215] }, { 62: [1, 216], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 64: [1, 217], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 30: 218, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 31: [1, 219], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 65: $Vi1, 67: [1, 220], 69: [1, 221], 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 65: $Vi1, 67: [1, 223], 69: [1, 222], 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VC, [2, 44], { 42: $Vf1 }), o2($VS, [2, 70]), o2($VS, [2, 69]), { 60: [1, 224], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VS, [2, 72]), o2($Vo1, [2, 74]), { 30: 225, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($Ve1, $V4, { 5: 226 }), o2($Vp1, [2, 95]), o2($Vy, [2, 35]), { 41: 227, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 228, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 239, 101: [1, 240], 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 241, 101: [1, 242], 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 102: [1, 243] }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 244, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 42: $Vd, 45: 245, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs }, o2($Vg1, [2, 101]), { 77: [1, 246] }, { 77: [1, 247], 95: [1, 248] }, o2($Vg1, [2, 109]), o2($Vg1, [2, 111], { 10: [1, 249] }), o2($Vg1, [2, 112]), o2($VP, [2, 51]), o2($Vr1, [2, 80]), o2($VP, [2, 52]), { 49: [1, 250], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VP, [2, 59]), o2($VP, [2, 54]), o2($VP, [2, 55]), o2($VP, [2, 56]), { 106: [1, 251] }, o2($VP, [2, 58]), o2($VP, [2, 60]), { 64: [1, 252], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VP, [2, 62]), o2($VP, [2, 63]), o2($VP, [2, 65]), o2($VP, [2, 64]), o2($VP, [2, 66]), o2([10, 42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 78]), { 31: [1, 253], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 254], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, o2($VO, [2, 48]), o2($Vg1, [2, 114], { 103: $VA1 }), o2($VB1, [2, 123], { 105: 256, 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }), o2($VC1, [2, 125]), o2($VC1, [2, 127]), o2($VC1, [2, 128]), o2($VC1, [2, 129]), o2($VC1, [2, 130]), o2($VC1, [2, 131]), o2($VC1, [2, 132]), o2($VC1, [2, 133]), o2($VC1, [2, 134]), o2($Vg1, [2, 115], { 103: $VA1 }), { 10: [1, 257] }, o2($Vg1, [2, 116], { 103: $VA1 }), { 10: [1, 258] }, o2($Vq1, [2, 122]), o2($Vg1, [2, 98], { 103: $VA1 }), o2($Vg1, [2, 99], { 110: 109, 42: $Vd, 58: $Ve, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 111: $Vq, 112: $Vr, 113: $Vs }), o2($Vg1, [2, 103]), o2($Vg1, [2, 105], { 10: [1, 259] }), o2($Vg1, [2, 106]), { 95: [1, 260] }, { 49: [1, 261] }, { 60: [1, 262] }, { 64: [1, 263] }, { 8: $Vz, 9: $VA, 11: $VB, 21: 264 }, o2($Vy, [2, 34]), { 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 104: 265, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, o2($VC1, [2, 126]), { 14: $VD, 42: $VE, 58: $VF, 86: $VG, 98: 266, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, { 14: $VD, 42: $VE, 58: $VF, 86: $VG, 98: 267, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN, 117: 84 }, { 95: [1, 268] }, o2($Vg1, [2, 113]), o2($VP, [2, 53]), { 30: 269, 65: $Vi1, 77: $Vj1, 78: $Vk1, 79: 164, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, o2($VP, [2, 61]), o2($Ve1, $V4, { 5: 270 }), o2($VB1, [2, 124], { 105: 256, 10: $Vs1, 58: $Vt1, 81: $Vu1, 102: $Vv1, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }), o2($Vg1, [2, 119], { 117: 160, 10: [1, 271], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o2($Vg1, [2, 120], { 117: 160, 10: [1, 272], 14: $VD, 42: $VE, 58: $VF, 86: $VG, 102: $VH, 103: $VI, 106: $VJ, 108: $VK, 111: $VL, 112: $VM, 113: $VN }), o2($Vg1, [2, 107]), { 31: [1, 273], 65: $Vi1, 79: 208, 113: $Vl1, 114: $Vm1, 115: $Vn1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 274], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 40: 28, 41: 38, 42: $Vd, 43: 39, 45: 40, 58: $Ve, 81: $Vf, 82: $Vg, 83: $Vh, 84: $Vi, 85: $Vj, 86: $Vk, 99: $Vl, 102: $Vm, 103: $Vn, 106: $Vo, 108: $Vp, 110: 41, 111: $Vq, 112: $Vr, 113: $Vs, 118: $Vt, 119: $Vu, 120: $Vv, 121: $Vw }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 275, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, { 10: $Vs1, 58: $Vt1, 81: $Vu1, 89: 276, 102: $Vv1, 104: 229, 105: 230, 106: $Vw1, 107: $Vx1, 108: $Vy1, 109: $Vz1 }, o2($VP, [2, 57]), o2($Vy, [2, 33]), o2($Vg1, [2, 117], { 103: $VA1 }), o2($Vg1, [2, 118], { 103: $VA1 })], + defaultActions: {}, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; + } + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; } + return token2; } - if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) { - listItem2._spread = true; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - listItem2.end = Object.assign( - {}, - lineIndex ? events[lineIndex][1].start : event[1].end - ); - events.splice(lineIndex || index2, 0, ["exit", listItem2, event[2]]); - index2++; - length2++; - } - if (event[1].type === "listItemPrefix") { - listItem2 = { - type: "listItem", - _spread: false, - start: Object.assign({}, event[1].start), - // @ts-expect-error: we’ll add `end` in a second. - end: void 0 - }; - events.splice(index2, 0, ["enter", listItem2, event[2]]); - index2++; - length2++; - firstBlankLineIndex = void 0; - atMarker = true; - } - } - } - events[start2][1]._spread = listSpread; - return length2; - } - function setData(key, value2) { - data[key] = value2; - } - function getData(key) { - return data[key]; - } - function opener(create2, and) { - return open2; - function open2(token2) { - enter2.call(this, create2(token2), token2); - if (and) - and.call(this, token2); - } - } - function buffer() { - this.stack.push({ - type: "fragment", - children: [] - }); - } - function enter2(node2, token2, errorHandler) { - const parent = this.stack[this.stack.length - 1]; - parent.children.push(node2); - this.stack.push(node2); - this.tokenStack.push([token2, errorHandler]); - node2.position = { - start: point(token2.start) - }; - return node2; - } - function closer(and) { - return close2; - function close2(token2) { - if (and) - and.call(this, token2); - exit2.call(this, token2); - } - } - function exit2(token2, onExitError) { - const node2 = this.stack.pop(); - const open2 = this.tokenStack.pop(); - if (!open2) { - throw new Error( - "Cannot close `" + token2.type + "` (" + stringifyPosition({ - start: token2.start, - end: token2.end - }) + "): it’s not open" - ); - } else if (open2[0].type !== token2.type) { - if (onExitError) { - onExitError.call(this, token2, open2[0]); - } else { - const handler = open2[1] || defaultOnError; - handler.call(this, token2, open2[0]); - } - } - node2.position.end = point(token2.end); - return node2; - } - function resume() { - return toString(this.stack.pop()); - } - function onenterlistordered() { - setData("expectingFirstListItemValue", true); - } - function onenterlistitemvalue(token2) { - if (getData("expectingFirstListItemValue")) { - const ancestor = this.stack[this.stack.length - 2]; - ancestor.start = Number.parseInt(this.sliceSerialize(token2), 10); - setData("expectingFirstListItemValue"); - } - } - function onexitcodefencedfenceinfo() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.lang = data2; - } - function onexitcodefencedfencemeta() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.meta = data2; - } - function onexitcodefencedfence() { - if (getData("flowCodeInside")) - return; - this.buffer(); - setData("flowCodeInside", true); - } - function onexitcodefenced() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.value = data2.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""); - setData("flowCodeInside"); - } - function onexitcodeindented() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.value = data2.replace(/(\r?\n|\r)$/g, ""); - } - function onexitdefinitionlabelstring(token2) { - const label = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.label = label; - node2.identifier = normalizeIdentifier( - this.sliceSerialize(token2) - ).toLowerCase(); - } - function onexitdefinitiontitlestring() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.title = data2; - } - function onexitdefinitiondestinationstring() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.url = data2; - } - function onexitatxheadingsequence(token2) { - const node2 = this.stack[this.stack.length - 1]; - if (!node2.depth) { - const depth = this.sliceSerialize(token2).length; - node2.depth = depth; - } - } - function onexitsetextheadingtext() { - setData("setextHeadingSlurpLineEnding", true); - } - function onexitsetextheadinglinesequence(token2) { - const node2 = this.stack[this.stack.length - 1]; - node2.depth = this.sliceSerialize(token2).charCodeAt(0) === 61 ? 1 : 2; - } - function onexitsetextheading() { - setData("setextHeadingSlurpLineEnding"); - } - function onenterdata(token2) { - const node2 = this.stack[this.stack.length - 1]; - let tail = node2.children[node2.children.length - 1]; - if (!tail || tail.type !== "text") { - tail = text2(); - tail.position = { - start: point(token2.start) + return true; + }, "parse") }; - node2.children.push(tail); - } - this.stack.push(tail); - } - function onexitdata(token2) { - const tail = this.stack.pop(); - tail.value += this.sliceSerialize(token2); - tail.position.end = point(token2.end); - } - function onexitlineending(token2) { - const context = this.stack[this.stack.length - 1]; - if (getData("atHardBreak")) { - const tail = context.children[context.children.length - 1]; - tail.position.end = point(token2.end); - setData("atHardBreak"); - return; - } - if (!getData("setextHeadingSlurpLineEnding") && config2.canContainEols.includes(context.type)) { - onenterdata.call(this, token2); - onexitdata.call(this, token2); - } - } - function onexithardbreak() { - setData("atHardBreak", true); - } - function onexithtmlflow() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.value = data2; - } - function onexithtmltext() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.value = data2; - } - function onexitcodetext() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.value = data2; - } - function onexitlink() { - const node2 = this.stack[this.stack.length - 1]; - if (getData("inReference")) { - const referenceType = getData("referenceType") || "shortcut"; - node2.type += "Reference"; - node2.referenceType = referenceType; - delete node2.url; - delete node2.title; - } else { - delete node2.identifier; - delete node2.label; - } - setData("referenceType"); - } - function onexitimage() { - const node2 = this.stack[this.stack.length - 1]; - if (getData("inReference")) { - const referenceType = getData("referenceType") || "shortcut"; - node2.type += "Reference"; - node2.referenceType = referenceType; - delete node2.url; - delete node2.title; - } else { - delete node2.identifier; - delete node2.label; - } - setData("referenceType"); - } - function onexitlabeltext(token2) { - const string2 = this.sliceSerialize(token2); - const ancestor = this.stack[this.stack.length - 2]; - ancestor.label = decodeString(string2); - ancestor.identifier = normalizeIdentifier(string2).toLowerCase(); - } - function onexitlabel() { - const fragment = this.stack[this.stack.length - 1]; - const value2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - setData("inReference", true); - if (node2.type === "link") { - const children2 = fragment.children; - node2.children = children2; - } else { - node2.alt = value2; - } - } - function onexitresourcedestinationstring() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.url = data2; - } - function onexitresourcetitlestring() { - const data2 = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.title = data2; - } - function onexitresource() { - setData("inReference"); - } - function onenterreference() { - setData("referenceType", "collapsed"); - } - function onexitreferencestring(token2) { - const label = this.resume(); - const node2 = this.stack[this.stack.length - 1]; - node2.label = label; - node2.identifier = normalizeIdentifier( - this.sliceSerialize(token2) - ).toLowerCase(); - setData("referenceType", "full"); - } - function onexitcharacterreferencemarker(token2) { - setData("characterReferenceType", token2.type); - } - function onexitcharacterreferencevalue(token2) { - const data2 = this.sliceSerialize(token2); - const type2 = getData("characterReferenceType"); - let value2; - if (type2) { - value2 = decodeNumericCharacterReference( - data2, - type2 === "characterReferenceMarkerNumeric" ? 10 : 16 - ); - setData("characterReferenceType"); - } else { - const result = decodeNamedCharacterReference(data2); - value2 = result; - } - const tail = this.stack.pop(); - tail.value += value2; - tail.position.end = point(token2.end); - } - function onexitautolinkprotocol(token2) { - onexitdata.call(this, token2); - const node2 = this.stack[this.stack.length - 1]; - node2.url = this.sliceSerialize(token2); - } - function onexitautolinkemail(token2) { - onexitdata.call(this, token2); - const node2 = this.stack[this.stack.length - 1]; - node2.url = "mailto:" + this.sliceSerialize(token2); - } - function blockQuote2() { - return { - type: "blockquote", - children: [] - }; - } - function codeFlow() { - return { - type: "code", - lang: null, - meta: null, - value: "" - }; - } - function codeText2() { - return { - type: "inlineCode", - value: "" - }; - } - function definition2() { - return { - type: "definition", - identifier: "", - label: null, - title: null, - url: "" - }; - } - function emphasis() { - return { - type: "emphasis", - children: [] - }; - } - function heading() { - return { - type: "heading", - depth: void 0, - children: [] - }; - } - function hardBreak() { - return { - type: "break" - }; - } - function html2() { - return { - type: "html", - value: "" - }; - } - function image() { - return { - type: "image", - title: null, - url: "", - alt: null - }; - } - function link2() { - return { - type: "link", - title: null, - url: "", - children: [] - }; - } - function list2(token2) { - return { - type: "list", - ordered: token2.type === "listOrdered", - start: null, - spread: token2._spread, - children: [] - }; - } - function listItem(token2) { - return { - type: "listItem", - spread: token2._spread, - checked: null, - children: [] - }; - } - function paragraph() { - return { - type: "paragraph", - children: [] - }; - } - function strong() { - return { - type: "strong", - children: [] - }; - } - function text2() { - return { - type: "text", - value: "" - }; - } - function thematicBreak2() { - return { - type: "thematicBreak" - }; - } - } - function point(d) { - return { - line: d.line, - column: d.column, - offset: d.offset - }; - } - function configure(combined, extensions) { - let index2 = -1; - while (++index2 < extensions.length) { - const value2 = extensions[index2]; - if (Array.isArray(value2)) { - configure(combined, value2); - } else { - extension(combined, value2); - } - } - } - function extension(combined, extension2) { - let key; - for (key in extension2) { - if (own.call(extension2, key)) { - if (key === "canContainEols") { - const right2 = extension2[key]; - if (right2) { - combined[key].push(...right2); - } - } else if (key === "transforms") { - const right2 = extension2[key]; - if (right2) { - combined[key].push(...right2); - } - } else if (key === "enter" || key === "exit") { - const right2 = extension2[key]; - if (right2) { - Object.assign(combined[key], right2); - } - } - } - } - } - function defaultOnError(left2, right2) { - if (left2) { - throw new Error( - "Cannot close `" + left2.type + "` (" + stringifyPosition({ - start: left2.start, - end: left2.end - }) + "): a different token (`" + right2.type + "`, " + stringifyPosition({ - start: right2.start, - end: right2.end - }) + ") is open" - ); - } else { - throw new Error( - "Cannot close document, a token (`" + right2.type + "`, " + stringifyPosition({ - start: right2.start, - end: right2.end - }) + ") is still open" - ); - } - } - function preprocessMarkdown(markdown) { - const withoutMultipleNewlines = markdown.replace(/\n{2,}/g, "\n"); - const withoutExtraSpaces = dedent(withoutMultipleNewlines); - return withoutExtraSpaces; - } - function markdownToLines(markdown) { - const preprocessedMarkdown = preprocessMarkdown(markdown); - const { children: children2 } = fromMarkdown(preprocessedMarkdown); - const lines = [[]]; - let currentLine = 0; - function processNode(node2, parentType = "normal") { - if (node2.type === "text") { - const textLines = node2.value.split("\n"); - textLines.forEach((textLine, index2) => { - if (index2 !== 0) { - currentLine++; - lines.push([]); - } - textLine.split(" ").forEach((word) => { - if (word) { - lines[currentLine].push({ content: word, type: parentType }); - } - }); - }); - } else if (node2.type === "strong" || node2.type === "emphasis") { - node2.children.forEach((contentNode) => { - processNode(contentNode, node2.type); - }); - } - } - children2.forEach((treeNode) => { - if (treeNode.type === "paragraph") { - treeNode.children.forEach((contentNode) => { - processNode(contentNode); - }); - } - }); - return lines; - } - function markdownToHTML(markdown) { - const { children: children2 } = fromMarkdown(markdown); - function output(node2) { - if (node2.type === "text") { - return node2.value.replace(/\n/g, "
    "); - } else if (node2.type === "strong") { - return `${node2.children.map(output).join("")}`; - } else if (node2.type === "emphasis") { - return `${node2.children.map(output).join("")}`; - } else if (node2.type === "paragraph") { - return `

    ${node2.children.map(output).join("")}

    `; - } - return `Unsupported markdown: ${node2.type}`; - } - return children2.map(output).join(""); - } - function splitTextToChars(text2) { - if (Intl.Segmenter) { - return [...new Intl.Segmenter().segment(text2)].map((s) => s.segment); - } - return [...text2]; - } - function splitWordToFitWidth(checkFit, word) { - const characters2 = splitTextToChars(word.content); - return splitWordToFitWidthRecursion(checkFit, [], characters2, word.type); - } - function splitWordToFitWidthRecursion(checkFit, usedChars, remainingChars, type2) { - if (remainingChars.length === 0) { - return [ - { content: usedChars.join(""), type: type2 }, - { content: "", type: type2 } - ]; - } - const [nextChar, ...rest] = remainingChars; - const newWord = [...usedChars, nextChar]; - if (checkFit([{ content: newWord.join(""), type: type2 }])) { - return splitWordToFitWidthRecursion(checkFit, newWord, rest, type2); - } - if (usedChars.length === 0 && nextChar) { - usedChars.push(nextChar); - remainingChars.shift(); - } - return [ - { content: usedChars.join(""), type: type2 }, - { content: remainingChars.join(""), type: type2 } - ]; - } - function splitLineToFitWidth(line2, checkFit) { - if (line2.some(({ content: content2 }) => content2.includes("\n"))) { - throw new Error("splitLineToFitWidth does not support newlines in the line"); - } - return splitLineToFitWidthRecursion(line2, checkFit); - } - function splitLineToFitWidthRecursion(words, checkFit, lines = [], newLine = []) { - if (words.length === 0) { - if (newLine.length > 0) { - lines.push(newLine); - } - return lines.length > 0 ? lines : []; - } - let joiner = ""; - if (words[0].content === " ") { - joiner = " "; - words.shift(); - } - const nextWord = words.shift() ?? { content: " ", type: "normal" }; - const lineWithNextWord = [...newLine]; - if (joiner !== "") { - lineWithNextWord.push({ content: joiner, type: "normal" }); - } - lineWithNextWord.push(nextWord); - if (checkFit(lineWithNextWord)) { - return splitLineToFitWidthRecursion(words, checkFit, lines, lineWithNextWord); - } - if (newLine.length > 0) { - lines.push(newLine); - words.unshift(nextWord); - } else if (nextWord.content) { - const [line2, rest] = splitWordToFitWidth(checkFit, nextWord); - lines.push([line2]); - if (rest.content) { - words.unshift(rest); - } + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: {}, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + this.begin("acc_title"); + return 34; + break; + case 1: + this.popState(); + return "acc_title_value"; + break; + case 2: + this.begin("acc_descr"); + return 36; + break; + case 3: + this.popState(); + return "acc_descr_value"; + break; + case 4: + this.begin("acc_descr_multiline"); + break; + case 5: + this.popState(); + break; + case 6: + return "acc_descr_multiline_value"; + break; + case 7: + this.begin("callbackname"); + break; + case 8: + this.popState(); + break; + case 9: + this.popState(); + this.begin("callbackargs"); + break; + case 10: + return 92; + break; + case 11: + this.popState(); + break; + case 12: + return 93; + break; + case 13: + return "MD_STR"; + break; + case 14: + this.popState(); + break; + case 15: + this.begin("md_string"); + break; + case 16: + return "STR"; + break; + case 17: + this.popState(); + break; + case 18: + this.pushState("string"); + break; + case 19: + return 81; + break; + case 20: + return 99; + break; + case 21: + return 82; + break; + case 22: + return 101; + break; + case 23: + return 83; + break; + case 24: + return 84; + break; + case 25: + return 94; + break; + case 26: + this.begin("click"); + break; + case 27: + this.popState(); + break; + case 28: + return 85; + break; + case 29: + if (yy.lex.firstGraph()) { + this.begin("dir"); + } + return 12; + break; + case 30: + if (yy.lex.firstGraph()) { + this.begin("dir"); + } + return 12; + break; + case 31: + if (yy.lex.firstGraph()) { + this.begin("dir"); + } + return 12; + break; + case 32: + return 27; + break; + case 33: + return 32; + break; + case 34: + return 95; + break; + case 35: + return 95; + break; + case 36: + return 95; + break; + case 37: + return 95; + break; + case 38: + this.popState(); + return 13; + break; + case 39: + this.popState(); + return 14; + break; + case 40: + this.popState(); + return 14; + break; + case 41: + this.popState(); + return 14; + break; + case 42: + this.popState(); + return 14; + break; + case 43: + this.popState(); + return 14; + break; + case 44: + this.popState(); + return 14; + break; + case 45: + this.popState(); + return 14; + break; + case 46: + this.popState(); + return 14; + break; + case 47: + this.popState(); + return 14; + break; + case 48: + this.popState(); + return 14; + break; + case 49: + return 118; + break; + case 50: + return 119; + break; + case 51: + return 120; + break; + case 52: + return 121; + break; + case 53: + return 102; + break; + case 54: + return 108; + break; + case 55: + return 44; + break; + case 56: + return 58; + break; + case 57: + return 42; + break; + case 58: + return 8; + break; + case 59: + return 103; + break; + case 60: + return 112; + break; + case 61: + this.popState(); + return 75; + break; + case 62: + this.pushState("edgeText"); + return 73; + break; + case 63: + return 116; + break; + case 64: + this.popState(); + return 75; + break; + case 65: + this.pushState("thickEdgeText"); + return 73; + break; + case 66: + return 116; + break; + case 67: + this.popState(); + return 75; + break; + case 68: + this.pushState("dottedEdgeText"); + return 73; + break; + case 69: + return 116; + break; + case 70: + return 75; + break; + case 71: + this.popState(); + return 51; + break; + case 72: + return "TEXT"; + break; + case 73: + this.pushState("ellipseText"); + return 50; + break; + case 74: + this.popState(); + return 53; + break; + case 75: + this.pushState("text"); + return 52; + break; + case 76: + this.popState(); + return 55; + break; + case 77: + this.pushState("text"); + return 54; + break; + case 78: + return 56; + break; + case 79: + this.pushState("text"); + return 65; + break; + case 80: + this.popState(); + return 62; + break; + case 81: + this.pushState("text"); + return 61; + break; + case 82: + this.popState(); + return 47; + break; + case 83: + this.pushState("text"); + return 46; + break; + case 84: + this.popState(); + return 67; + break; + case 85: + this.popState(); + return 69; + break; + case 86: + return 114; + break; + case 87: + this.pushState("trapText"); + return 66; + break; + case 88: + this.pushState("trapText"); + return 68; + break; + case 89: + return 115; + break; + case 90: + return 65; + break; + case 91: + return 87; + break; + case 92: + return "SEP"; + break; + case 93: + return 86; + break; + case 94: + return 112; + break; + case 95: + return 108; + break; + case 96: + return 42; + break; + case 97: + return 106; + break; + case 98: + return 111; + break; + case 99: + return 113; + break; + case 100: + this.popState(); + return 60; + break; + case 101: + this.pushState("text"); + return 60; + break; + case 102: + this.popState(); + return 49; + break; + case 103: + this.pushState("text"); + return 48; + break; + case 104: + this.popState(); + return 31; + break; + case 105: + this.pushState("text"); + return 29; + break; + case 106: + this.popState(); + return 64; + break; + case 107: + this.pushState("text"); + return 63; + break; + case 108: + return "TEXT"; + break; + case 109: + return "QUOTE"; + break; + case 110: + return 9; + break; + case 111: + return 10; + break; + case 112: + return 11; + break; + } + }, "anonymous"), + rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:flowchart-elk\b)/, /^(?:graph\b)/, /^(?:flowchart\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:[^=]|=(?!))/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:[^\.]|\.(?!))/, /^(?:\s*~~[\~]+\s*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:[^\[\]\(\)\{\}\|\"]+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/], + conditions: { "callbackargs": { "rules": [11, 12, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "callbackname": { "rules": [8, 9, 10, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "href": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "click": { "rules": [15, 18, 27, 28, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "dottedEdgeText": { "rules": [15, 18, 67, 69, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "thickEdgeText": { "rules": [15, 18, 64, 66, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "edgeText": { "rules": [15, 18, 61, 63, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "trapText": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 84, 85, 86, 87, 88, 101, 103, 105, 107], "inclusive": false }, "ellipseText": { "rules": [15, 18, 70, 71, 72, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "text": { "rules": [15, 18, 70, 73, 74, 75, 76, 77, 80, 81, 82, 83, 87, 88, 100, 101, 102, 103, 104, 105, 106, 107, 108], "inclusive": false }, "vertex": { "rules": [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "dir": { "rules": [15, 18, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_descr_multiline": { "rules": [5, 6, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_descr": { "rules": [3, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "acc_title": { "rules": [1, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "md_string": { "rules": [13, 14, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "string": { "rules": [15, 16, 17, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 67, 68, 70, 73, 75, 77, 78, 79, 81, 83, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 103, 105, 107, 109, 110, 111, 112], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser3.parser = parser3; + flow_default = parser3; } - return splitLineToFitWidthRecursion(words, checkFit, lines); + }); + + // src/diagrams/flowchart/styles.ts + var fade, getStyles3, styles_default3; + var init_styles3 = __esm({ + "src/diagrams/flowchart/styles.ts"() { + "use strict"; + init_dist(); + fade = /* @__PURE__ */ __name((color2, opacity) => { + const channel2 = channel_default2; + const r2 = channel2(color2, "r"); + const g2 = channel2(color2, "g"); + const b2 = channel2(color2, "b"); + return rgba_default(r2, g2, b2, opacity); + }, "fade"); + getStyles3 = /* @__PURE__ */ __name((options3) => `.label { + font-family: ${options3.fontFamily}; + color: ${options3.nodeTextColor || options3.textColor}; } - function applyStyle(dom, styleFn) { - if (styleFn) { - dom.attr("style", styleFn); - } + .cluster-label text { + fill: ${options3.titleColor}; } - function addHtmlSpan(element2, node2, width2, classes2, addBackground = false) { - const fo = element2.append("foreignObject"); - const div = fo.append("xhtml:div"); - const label = node2.label; - const labelClass = node2.isNode ? "nodeLabel" : "edgeLabel"; - div.html( - ` - " + label + "" - ); - applyStyle(div, node2.labelStyle); - div.style("display", "table-cell"); - div.style("white-space", "nowrap"); - div.style("max-width", width2 + "px"); - div.attr("xmlns", "http://www.w3.org/1999/xhtml"); - if (addBackground) { - div.attr("class", "labelBkg"); - } - let bbox = div.node().getBoundingClientRect(); - if (bbox.width === width2) { - div.style("display", "table"); - div.style("white-space", "break-spaces"); - div.style("width", width2 + "px"); - bbox = div.node().getBoundingClientRect(); - } - fo.style("width", bbox.width); - fo.style("height", bbox.height); - return fo.node(); + .cluster-label span { + color: ${options3.titleColor}; } - function createTspan(textElement, lineIndex, lineHeight) { - return textElement.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", lineIndex * lineHeight - 0.1 + "em").attr("dy", lineHeight + "em"); + .cluster-label span p { + background-color: transparent; } - function computeWidthOfText(parentNode, lineHeight, line2) { - const testElement = parentNode.append("text"); - const testSpan = createTspan(testElement, 1, lineHeight); - updateTextContentAndStyles(testSpan, line2); - const textLength = testSpan.node().getComputedTextLength(); - testElement.remove(); - return textLength; + + .label text,span { + fill: ${options3.nodeTextColor || options3.textColor}; + color: ${options3.nodeTextColor || options3.textColor}; } - function computeDimensionOfText(parentNode, lineHeight, text2) { - var _a2; - const testElement = parentNode.append("text"); - const testSpan = createTspan(testElement, 1, lineHeight); - updateTextContentAndStyles(testSpan, [{ content: text2, type: "normal" }]); - const textDimension = (_a2 = testSpan.node()) == null ? void 0 : _a2.getBoundingClientRect(); - if (textDimension) { - testElement.remove(); - } - return textDimension; + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${options3.mainBkg}; + stroke: ${options3.nodeBorder}; + stroke-width: 1px; } - function createFormattedText(width2, g, structuredText, addBackground = false) { - const lineHeight = 1.1; - const labelGroup = g.append("g"); - const bkg = labelGroup.insert("rect").attr("class", "background"); - const textElement = labelGroup.append("text").attr("y", "-10.1"); - let lineIndex = 0; - for (const line2 of structuredText) { - const checkWidth = (line22) => computeWidthOfText(labelGroup, lineHeight, line22) <= width2; - const linesUnderWidth = checkWidth(line2) ? [line2] : splitLineToFitWidth(line2, checkWidth); - for (const preparedLine of linesUnderWidth) { - const tspan = createTspan(textElement, lineIndex, lineHeight); - updateTextContentAndStyles(tspan, preparedLine); - lineIndex++; - } + .rough-node .label text , .node .label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${options3.arrowheadColor}; + } + + .edgePath .path { + stroke: ${options3.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${options3.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${options3.edgeLabelBackground}; + p { + background-color: ${options3.edgeLabelBackground}; } - if (addBackground) { - const bbox = textElement.node().getBBox(); - const padding2 = 2; - bkg.attr("x", -padding2).attr("y", -padding2).attr("width", bbox.width + 2 * padding2).attr("height", bbox.height + 2 * padding2); - return labelGroup.node(); - } else { - return textElement.node(); + rect { + opacity: 0.5; + background-color: ${options3.edgeLabelBackground}; + fill: ${options3.edgeLabelBackground}; } + text-align: center; } - function updateTextContentAndStyles(tspan, wrappedLine) { - tspan.text(""); - wrappedLine.forEach((word, index2) => { - const innerTspan = tspan.append("tspan").attr("font-style", word.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", word.type === "strong" ? "bold" : "normal"); - if (index2 === 0) { - innerTspan.text(word.content); - } else { - innerTspan.text(" " + word.content); - } - }); + + /* For html labels only */ + .labelBkg { + background-color: ${fade(options3.edgeLabelBackground, 0.5)}; + // background-color: } - const createText = (el, text2 = "", { - style = "", - isTitle = false, - classes: classes2 = "", - useHtmlLabels = true, - isNode = true, - width: width2 = 200, - addSvgBackground = false - } = {}) => { - log$1.info("createText", text2, style, isTitle, classes2, useHtmlLabels, isNode, addSvgBackground); - if (useHtmlLabels) { - const htmlText2 = markdownToHTML(text2); - const node2 = { - isNode, - label: decodeEntities(htmlText2).replace( - /fa[blrs]?:fa-[\w-]+/g, - // cspell: disable-line - (s) => `` - ), - labelStyle: style.replace("fill:", "color:") - }; - const vertexNode = addHtmlSpan(el, node2, width2, classes2, addSvgBackground); - return vertexNode; - } else { - const structuredText = markdownToLines(text2); - const svgLabel = createFormattedText(width2, el, structuredText, addSvgBackground); - return svgLabel; - } - }; - const labelHelper = async (parent, node2, _classes, isNode) => { - let classes2; - const useHtmlLabels = node2.useHtmlLabels || evaluate(getConfig$1().flowchart.htmlLabels); - if (!_classes) { - classes2 = "node default"; - } else { - classes2 = _classes; + + .cluster rect { + fill: ${options3.clusterBkg}; + stroke: ${options3.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${options3.titleColor}; + } + + .cluster span { + color: ${options3.titleColor}; + } + /* .cluster div { + color: ${options3.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${options3.fontFamily}; + font-size: 12px; + background: ${options3.tertiaryColor}; + border: 1px solid ${options3.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; + } +`, "getStyles"); + styles_default3 = getStyles3; } - const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node2.domId || node2.id); - const label = shapeSvg.insert("g").attr("class", "label").attr("style", node2.labelStyle); - let labelText; - if (node2.labelText === void 0) { - labelText = ""; - } else { - labelText = typeof node2.labelText === "string" ? node2.labelText : node2.labelText[0]; - } - const textNode = label.node(); - let text2; - if (node2.labelType === "markdown") { - text2 = createText(label, sanitizeText$6(decodeEntities(labelText), getConfig$1()), { - useHtmlLabels, - width: node2.width || getConfig$1().flowchart.wrappingWidth, - classes: "markdown-node-label" - }); - } else { - text2 = textNode.appendChild( - createLabel$1( - sanitizeText$6(decodeEntities(labelText), getConfig$1()), - node2.labelStyle, - false, - isNode - ) - ); + }); + + // src/diagrams/flowchart/flowDiagram.ts + var flowDiagram_exports = {}; + __export(flowDiagram_exports, { + diagram: () => diagram2 + }); + var diagram2; + var init_flowDiagram = __esm({ + "src/diagrams/flowchart/flowDiagram.ts"() { + "use strict"; + init_diagramAPI(); + init_flowDb(); + init_flowRenderer_v3_unified(); + init_flow(); + init_styles3(); + diagram2 = { + parser: flow_default, + db: flowDb_default, + renderer: flowRenderer_v3_unified_default, + styles: styles_default3, + init: /* @__PURE__ */ __name((cnf) => { + if (!cnf.flowchart) { + cnf.flowchart = {}; + } + if (cnf.layout) { + setConfig2({ layout: cnf.layout }); + } + cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + setConfig2({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } }); + flowDb_default.clear(); + flowDb_default.setGen("gen-2"); + }, "init") + }; } - let bbox = text2.getBBox(); - const halfPadding = node2.padding / 2; - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = text2.children[0]; - const dv = d3select(text2); - const images = div.getElementsByTagName("img"); - if (images) { - const noImgText = labelText.replace(/]*>/g, "").trim() === ""; - await Promise.all( - [...images].map( - (img) => new Promise((res) => { - function setupImage() { - img.style.display = "flex"; - img.style.flexDirection = "column"; - if (noImgText) { - const bodyFontSize = getConfig$1().fontSize ? getConfig$1().fontSize : window.getComputedStyle(document.body).fontSize; - const enlargingFactor = 5; - const width2 = parseInt(bodyFontSize, 10) * enlargingFactor + "px"; - img.style.minWidth = width2; - img.style.maxWidth = width2; - } else { - img.style.width = "100%"; + }); + + // src/diagrams/er/parser/erDiagram.jison + var parser4, erDiagram_default; + var init_erDiagram = __esm({ + "src/diagrams/er/parser/erDiagram.jison"() { + "use strict"; + parser4 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [6, 8, 10, 20, 22, 24, 26, 27, 28], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 14], $V6 = [1, 15], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 25], $Vc = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], $Vd = [1, 34], $Ve = [27, 28, 46, 47], $Vf = [41, 42, 43, 44, 45], $Vg = [17, 34], $Vh = [1, 54], $Vi = [1, 53], $Vj = [17, 34, 36, 38]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "ER_DIAGRAM": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "entityName": 11, "relSpec": 12, ":": 13, "role": 14, "BLOCK_START": 15, "attributes": 16, "BLOCK_STOP": 17, "SQS": 18, "SQE": 19, "title": 20, "title_value": 21, "acc_title": 22, "acc_title_value": 23, "acc_descr": 24, "acc_descr_value": 25, "acc_descr_multiline_value": 26, "ALPHANUM": 27, "ENTITY_NAME": 28, "attribute": 29, "attributeType": 30, "attributeName": 31, "attributeKeyTypeList": 32, "attributeComment": 33, "ATTRIBUTE_WORD": 34, "attributeKeyType": 35, "COMMA": 36, "ATTRIBUTE_KEY": 37, "COMMENT": 38, "cardinality": 39, "relType": 40, "ZERO_OR_ONE": 41, "ZERO_OR_MORE": 42, "ONE_OR_MORE": 43, "ONLY_ONE": 44, "MD_PARENT": 45, "NON_IDENTIFYING": 46, "IDENTIFYING": 47, "WORD": 48, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: ":", 15: "BLOCK_START", 17: "BLOCK_STOP", 18: "SQS", 19: "SQE", 20: "title", 21: "title_value", 22: "acc_title", 23: "acc_title_value", 24: "acc_descr", 25: "acc_descr_value", 26: "acc_descr_multiline_value", 27: "ALPHANUM", 28: "ENTITY_NAME", 34: "ATTRIBUTE_WORD", 36: "COMMA", 37: "ATTRIBUTE_KEY", 38: "COMMENT", 41: "ZERO_OR_ONE", 42: "ZERO_OR_MORE", 43: "ONE_OR_MORE", 44: "ONLY_ONE", 45: "MD_PARENT", 46: "NON_IDENTIFYING", 47: "IDENTIFYING", 48: "WORD" }, + productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 4], [9, 3], [9, 1], [9, 7], [9, 6], [9, 4], [9, 2], [9, 2], [9, 2], [9, 1], [11, 1], [11, 1], [16, 1], [16, 2], [29, 2], [29, 3], [29, 3], [29, 4], [30, 1], [31, 1], [32, 1], [32, 3], [35, 1], [33, 1], [12, 3], [39, 1], [39, 1], [39, 1], [39, 1], [39, 1], [40, 1], [40, 1], [14, 1], [14, 1], [14, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 1: + break; + case 2: + this.$ = []; + break; + case 3: + $$[$0 - 1].push($$[$0]); + this.$ = $$[$0 - 1]; + break; + case 4: + case 5: + this.$ = $$[$0]; + break; + case 6: + case 7: + this.$ = []; + break; + case 8: + yy.addEntity($$[$0 - 4]); + yy.addEntity($$[$0 - 2]); + yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]); + break; + case 9: + yy.addEntity($$[$0 - 3]); + yy.addAttributes($$[$0 - 3], $$[$0 - 1]); + break; + case 10: + yy.addEntity($$[$0 - 2]); + break; + case 11: + yy.addEntity($$[$0]); + break; + case 12: + yy.addEntity($$[$0 - 6], $$[$0 - 4]); + yy.addAttributes($$[$0 - 6], $$[$0 - 1]); + break; + case 13: + yy.addEntity($$[$0 - 5], $$[$0 - 3]); + break; + case 14: + yy.addEntity($$[$0 - 3], $$[$0 - 1]); + break; + case 15: + case 16: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 17: + case 18: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 19: + case 43: + this.$ = $$[$0]; + break; + case 20: + case 41: + case 42: + this.$ = $$[$0].replace(/"/g, ""); + break; + case 21: + case 29: + this.$ = [$$[$0]]; + break; + case 22: + $$[$0].push($$[$0 - 1]); + this.$ = $$[$0]; + break; + case 23: + this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] }; + break; + case 24: + this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] }; + break; + case 25: + this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] }; + break; + case 26: + this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] }; + break; + case 27: + case 28: + case 31: + this.$ = $$[$0]; + break; + case 30: + $$[$0 - 2].push($$[$0]); + this.$ = $$[$0 - 2]; + break; + case 32: + this.$ = $$[$0].replace(/"/g, ""); + break; + case 33: + this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] }; + break; + case 34: + this.$ = yy.Cardinality.ZERO_OR_ONE; + break; + case 35: + this.$ = yy.Cardinality.ZERO_OR_MORE; + break; + case 36: + this.$ = yy.Cardinality.ONE_OR_MORE; + break; + case 37: + this.$ = yy.Cardinality.ONLY_ONE; + break; + case 38: + this.$ = yy.Cardinality.MD_PARENT; + break; + case 39: + this.$ = yy.Identification.NON_IDENTIFYING; + break; + case 40: + this.$ = yy.Identification.IDENTIFYING; + break; + } + }, "anonymous"), + table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o2($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o2($V0, [2, 7], { 1: [2, 1] }), o2($V0, [2, 3]), { 9: 16, 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o2($V0, [2, 5]), o2($V0, [2, 6]), o2($V0, [2, 11], { 12: 17, 39: 20, 15: [1, 18], 18: [1, 19], 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }), { 21: [1, 26] }, { 23: [1, 27] }, { 25: [1, 28] }, o2($V0, [2, 18]), o2($Vc, [2, 19]), o2($Vc, [2, 20]), o2($V0, [2, 4]), { 11: 29, 27: $V5, 28: $V6 }, { 16: 30, 17: [1, 31], 29: 32, 30: 33, 34: $Vd }, { 11: 35, 27: $V5, 28: $V6 }, { 40: 36, 46: [1, 37], 47: [1, 38] }, o2($Ve, [2, 34]), o2($Ve, [2, 35]), o2($Ve, [2, 36]), o2($Ve, [2, 37]), o2($Ve, [2, 38]), o2($V0, [2, 15]), o2($V0, [2, 16]), o2($V0, [2, 17]), { 13: [1, 39] }, { 17: [1, 40] }, o2($V0, [2, 10]), { 16: 41, 17: [2, 21], 29: 32, 30: 33, 34: $Vd }, { 31: 42, 34: [1, 43] }, { 34: [2, 27] }, { 19: [1, 44] }, { 39: 45, 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }, o2($Vf, [2, 39]), o2($Vf, [2, 40]), { 14: 46, 27: [1, 49], 28: [1, 48], 48: [1, 47] }, o2($V0, [2, 9]), { 17: [2, 22] }, o2($Vg, [2, 23], { 32: 50, 33: 51, 35: 52, 37: $Vh, 38: $Vi }), o2([17, 34, 37, 38], [2, 28]), o2($V0, [2, 14], { 15: [1, 55] }), o2([27, 28], [2, 33]), o2($V0, [2, 8]), o2($V0, [2, 41]), o2($V0, [2, 42]), o2($V0, [2, 43]), o2($Vg, [2, 24], { 33: 56, 36: [1, 57], 38: $Vi }), o2($Vg, [2, 25]), o2($Vj, [2, 29]), o2($Vg, [2, 32]), o2($Vj, [2, 31]), { 16: 58, 17: [1, 59], 29: 32, 30: 33, 34: $Vd }, o2($Vg, [2, 26]), { 35: 60, 37: $Vh }, { 17: [1, 61] }, o2($V0, [2, 13]), o2($Vj, [2, 30]), o2($V0, [2, 12])], + defaultActions: { 34: [2, 27], 41: [2, 22] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; + } + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); } - res(img); + token2 = self2.symbols_[token2] || token2; } - setTimeout(() => { - if (img.complete) { - setupImage(); - } - }); - img.addEventListener("error", setupImage); - img.addEventListener("load", setupImage); - }) - ) - ); - } - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - if (useHtmlLabels) { - label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); - } else { - label.attr("transform", "translate(0, " + -bbox.height / 2 + ")"); - } - if (node2.centerLabel) { - label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); - } - label.insert("rect", ":first-child"); - return { shapeSvg, bbox, halfPadding, label }; - }; - const updateNodeBounds = (node2, element2) => { - const bbox = element2.node().getBBox(); - node2.width = bbox.width; - node2.height = bbox.height; - }; - function insertPolygonShape$1(parent, w2, h, points) { - return parent.insert("polygon", ":first-child").attr( - "points", - points.map(function(d) { - return d.x + "," + d.y; - }).join(" ") - ).attr("class", "label-container").attr("transform", "translate(" + -w2 / 2 + "," + h / 2 + ")"); - } - let clusterDb = {}; - let descendants = {}; - let parents = {}; - const clear$k = () => { - descendants = {}; - parents = {}; - clusterDb = {}; - }; - const isDescendant = (id2, ancestorId) => { - log$1.trace("In isDescendant", ancestorId, " ", id2, " = ", descendants[ancestorId].includes(id2)); - if (descendants[ancestorId].includes(id2)) { - return true; - } - return false; - }; - const edgeInCluster = (edge, clusterId) => { - log$1.info("Descendants of ", clusterId, " is ", descendants[clusterId]); - log$1.info("Edge is ", edge); - if (edge.v === clusterId) { - return false; - } - if (edge.w === clusterId) { - return false; - } - if (!descendants[clusterId]) { - log$1.debug("Tilt, ", clusterId, ",not in descendants"); - return false; - } - return descendants[clusterId].includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || descendants[clusterId].includes(edge.w); - }; - const copy = (clusterId, graph, newGraph, rootId) => { - log$1.warn( - "Copying children of ", - clusterId, - "root", - rootId, - "data", - graph.node(clusterId), - rootId - ); - const nodes2 = graph.children(clusterId) || []; - if (clusterId !== rootId) { - nodes2.push(clusterId); - } - log$1.warn("Copying (nodes) clusterId", clusterId, "nodes", nodes2); - nodes2.forEach((node2) => { - if (graph.children(node2).length > 0) { - copy(node2, graph, newGraph, rootId); - } else { - const data = graph.node(node2); - log$1.info("cp ", node2, " to ", rootId, " with parent ", clusterId); - newGraph.setNode(node2, data); - if (rootId !== graph.parent(node2)) { - log$1.warn("Setting parent", node2, graph.parent(node2)); - newGraph.setParent(node2, graph.parent(node2)); - } - if (clusterId !== rootId && node2 !== clusterId) { - log$1.debug("Setting parent", node2, clusterId); - newGraph.setParent(node2, clusterId); - } else { - log$1.info("In copy ", clusterId, "root", rootId, "data", graph.node(clusterId), rootId); - log$1.debug( - "Not Setting parent for node=", - node2, - "cluster!==rootId", - clusterId !== rootId, - "node!==clusterId", - node2 !== clusterId - ); - } - const edges2 = graph.edges(node2); - log$1.debug("Copying Edges", edges2); - edges2.forEach((edge) => { - log$1.info("Edge", edge); - const data2 = graph.edge(edge.v, edge.w, edge.name); - log$1.info("Edge data", data2, rootId); - try { - if (edgeInCluster(edge, rootId)) { - log$1.info("Copying as ", edge.v, edge.w, data2, edge.name); - newGraph.setEdge(edge.v, edge.w, data2, edge.name); - log$1.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0])); - } else { - log$1.info( - "Skipping copy of edge ", - edge.v, - "-->", - edge.w, - " rootId: ", - rootId, - " clusterId:", - clusterId - ); + return token2; } - } catch (e) { - log$1.error(e); - } - }); - } - log$1.debug("Removing node", node2); - graph.removeNode(node2); - }); - }; - const extractDescendants = (id2, graph) => { - const children2 = graph.children(id2); - let res = [...children2]; - for (const child of children2) { - parents[child] = id2; - res = [...res, ...extractDescendants(child, graph)]; - } - return res; - }; - const findNonClusterChild = (id2, graph) => { - log$1.trace("Searching", id2); - const children2 = graph.children(id2); - log$1.trace("Searching children of id ", id2, children2); - if (children2.length < 1) { - log$1.trace("This is a valid node", id2); - return id2; - } - for (const child of children2) { - const _id = findNonClusterChild(child, graph); - if (_id) { - log$1.trace("Found replacement for", id2, " => ", _id); - return _id; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } + } + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + this.begin("acc_title"); + return 22; + break; + case 1: + this.popState(); + return "acc_title_value"; + break; + case 2: + this.begin("acc_descr"); + return 24; + break; + case 3: + this.popState(); + return "acc_descr_value"; + break; + case 4: + this.begin("acc_descr_multiline"); + break; + case 5: + this.popState(); + break; + case 6: + return "acc_descr_multiline_value"; + break; + case 7: + return 10; + break; + case 8: + break; + case 9: + return 8; + break; + case 10: + return 28; + break; + case 11: + return 48; + break; + case 12: + return 4; + break; + case 13: + this.begin("block"); + return 15; + break; + case 14: + return 36; + break; + case 15: + break; + case 16: + return 37; + break; + case 17: + return 34; + break; + case 18: + return 34; + break; + case 19: + return 38; + break; + case 20: + break; + case 21: + this.popState(); + return 17; + break; + case 22: + return yy_.yytext[0]; + break; + case 23: + return 18; + break; + case 24: + return 19; + break; + case 25: + return 41; + break; + case 26: + return 43; + break; + case 27: + return 43; + break; + case 28: + return 43; + break; + case 29: + return 41; + break; + case 30: + return 41; + break; + case 31: + return 42; + break; + case 32: + return 42; + break; + case 33: + return 42; + break; + case 34: + return 42; + break; + case 35: + return 42; + break; + case 36: + return 43; + break; + case 37: + return 42; + break; + case 38: + return 43; + break; + case 39: + return 44; + break; + case 40: + return 44; + break; + case 41: + return 44; + break; + case 42: + return 44; + break; + case 43: + return 41; + break; + case 44: + return 42; + break; + case 45: + return 43; + break; + case 46: + return 45; + break; + case 47: + return 46; + break; + case 48: + return 47; + break; + case 49: + return 47; + break; + case 50: + return 46; + break; + case 51: + return 46; + break; + case 52: + return 46; + break; + case 53: + return 27; + break; + case 54: + return yy_.yytext[0]; + break; + case 55: + return 6; + break; + } + }, "anonymous"), + rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:,)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i, /^(?:.)/i, /^(?:$)/i], + conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "block": { "rules": [14, 15, 16, 17, 18, 19, 20, 21, 22], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser4.parser = parser4; + erDiagram_default = parser4; + } + }); + + // src/diagrams/er/erDb.js + var entities, relationships, Cardinality, Identification, addEntity, getEntities, addAttributes, addRelationship, getRelationships, clear9, erDb_default; + var init_erDb = __esm({ + "src/diagrams/er/erDb.js"() { + "use strict"; + init_logger(); + init_diagramAPI(); + init_commonDb(); + entities = /* @__PURE__ */ new Map(); + relationships = []; + Cardinality = { + ZERO_OR_ONE: "ZERO_OR_ONE", + ZERO_OR_MORE: "ZERO_OR_MORE", + ONE_OR_MORE: "ONE_OR_MORE", + ONLY_ONE: "ONLY_ONE", + MD_PARENT: "MD_PARENT" + }; + Identification = { + NON_IDENTIFYING: "NON_IDENTIFYING", + IDENTIFYING: "IDENTIFYING" + }; + addEntity = /* @__PURE__ */ __name(function(name, alias = void 0) { + if (!entities.has(name)) { + entities.set(name, { attributes: [], alias }); + log.info("Added new entity :", name); + } else if (!entities.get(name).alias && alias) { + entities.get(name).alias = alias; + log.info(`Add alias '${alias}' to entity '${name}'`); + } + return entities.get(name); + }, "addEntity"); + getEntities = /* @__PURE__ */ __name(() => entities, "getEntities"); + addAttributes = /* @__PURE__ */ __name(function(entityName, attribs) { + let entity = addEntity(entityName); + let i2; + for (i2 = attribs.length - 1; i2 >= 0; i2--) { + entity.attributes.push(attribs[i2]); + log.debug("Added attribute ", attribs[i2].attributeName); + } + }, "addAttributes"); + addRelationship = /* @__PURE__ */ __name(function(entA, rolA, entB, rSpec) { + let rel2 = { + entityA: entA, + roleA: rolA, + entityB: entB, + relSpec: rSpec + }; + relationships.push(rel2); + log.debug("Added new relationship :", rel2); + }, "addRelationship"); + getRelationships = /* @__PURE__ */ __name(() => relationships, "getRelationships"); + clear9 = /* @__PURE__ */ __name(function() { + entities = /* @__PURE__ */ new Map(); + relationships = []; + clear(); + }, "clear"); + erDb_default = { + Cardinality, + Identification, + getConfig: /* @__PURE__ */ __name(() => getConfig2().er, "getConfig"), + addEntity, + addAttributes, + getEntities, + addRelationship, + getRelationships, + clear: clear9, + setAccTitle, + getAccTitle, + setAccDescription, + getAccDescription, + setDiagramTitle, + getDiagramTitle + }; + } + }); + + // src/diagrams/er/erMarkers.js + var ERMarkers, insertMarkers2, erMarkers_default; + var init_erMarkers = __esm({ + "src/diagrams/er/erMarkers.js"() { + "use strict"; + ERMarkers = { + ONLY_ONE_START: "ONLY_ONE_START", + ONLY_ONE_END: "ONLY_ONE_END", + ZERO_OR_ONE_START: "ZERO_OR_ONE_START", + ZERO_OR_ONE_END: "ZERO_OR_ONE_END", + ONE_OR_MORE_START: "ONE_OR_MORE_START", + ONE_OR_MORE_END: "ONE_OR_MORE_END", + ZERO_OR_MORE_START: "ZERO_OR_MORE_START", + ZERO_OR_MORE_END: "ZERO_OR_MORE_END", + MD_PARENT_END: "MD_PARENT_END", + MD_PARENT_START: "MD_PARENT_START" + }; + insertMarkers2 = /* @__PURE__ */ __name(function(elem, conf8) { + let marker; + elem.append("defs").append("marker").attr("id", ERMarkers.MD_PARENT_START).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", ERMarkers.MD_PARENT_END).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18"); + elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18"); + marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"); + marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6); + marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M9,0 L9,18"); + marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"); + marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6); + marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M21,0 L21,18"); + elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"); + elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"); + marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"); + marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6); + marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18"); + marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"); + marker.append("circle").attr("stroke", conf8.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6); + marker.append("path").attr("stroke", conf8.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18"); + return; + }, "insertMarkers"); + erMarkers_default = { + ERMarkers, + insertMarkers: insertMarkers2 + }; + } + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js + var regex_default; + var init_regex = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js"() { + "use strict"; + regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; + } + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js + function validate(uuid3) { + return typeof uuid3 === "string" && regex_default.test(uuid3); + } + var validate_default; + var init_validate = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js"() { + "use strict"; + init_regex(); + __name(validate, "validate"); + validate_default = validate; + } + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js + function unsafeStringify(arr, offset = 0) { + return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; + } + var byteToHex; + var init_stringify = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js"() { + "use strict"; + byteToHex = []; + for (let i2 = 0; i2 < 256; ++i2) { + byteToHex.push((i2 + 256).toString(16).slice(1)); } + __name(unsafeStringify, "unsafeStringify"); } - }; - const getAnchorId = (id2) => { - if (!clusterDb[id2]) { - return id2; + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/parse.js + function parse(uuid3) { + if (!validate_default(uuid3)) { + throw TypeError("Invalid UUID"); } - if (!clusterDb[id2].externalConnections) { - return id2; + let v3; + const arr = new Uint8Array(16); + arr[0] = (v3 = parseInt(uuid3.slice(0, 8), 16)) >>> 24; + arr[1] = v3 >>> 16 & 255; + arr[2] = v3 >>> 8 & 255; + arr[3] = v3 & 255; + arr[4] = (v3 = parseInt(uuid3.slice(9, 13), 16)) >>> 8; + arr[5] = v3 & 255; + arr[6] = (v3 = parseInt(uuid3.slice(14, 18), 16)) >>> 8; + arr[7] = v3 & 255; + arr[8] = (v3 = parseInt(uuid3.slice(19, 23), 16)) >>> 8; + arr[9] = v3 & 255; + arr[10] = (v3 = parseInt(uuid3.slice(24, 36), 16)) / 1099511627776 & 255; + arr[11] = v3 / 4294967296 & 255; + arr[12] = v3 >>> 24 & 255; + arr[13] = v3 >>> 16 & 255; + arr[14] = v3 >>> 8 & 255; + arr[15] = v3 & 255; + return arr; + } + var parse_default; + var init_parse2 = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/parse.js"() { + "use strict"; + init_validate(); + __name(parse, "parse"); + parse_default = parse; } - if (clusterDb[id2]) { - return clusterDb[id2].id; + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v35.js + function stringToBytes(str2) { + str2 = unescape(encodeURIComponent(str2)); + const bytes = []; + for (let i2 = 0; i2 < str2.length; ++i2) { + bytes.push(str2.charCodeAt(i2)); } - return id2; - }; - const adjustClustersAndEdges = (graph, depth) => { - if (!graph || depth > 10) { - log$1.debug("Opting out, no graph "); - return; - } else { - log$1.debug("Opting in, graph "); - } - graph.nodes().forEach(function(id2) { - const children2 = graph.children(id2); - if (children2.length > 0) { - log$1.warn( - "Cluster identified", - id2, - " Replacement id in edges: ", - findNonClusterChild(id2, graph) - ); - descendants[id2] = extractDescendants(id2, graph); - clusterDb[id2] = { id: findNonClusterChild(id2, graph), clusterData: graph.node(id2) }; + return bytes; + } + function v35(name, version4, hashfunc) { + function generateUUID(value2, namespace, buf, offset) { + var _namespace; + if (typeof value2 === "string") { + value2 = stringToBytes(value2); } - }); - graph.nodes().forEach(function(id2) { - const children2 = graph.children(id2); - const edges2 = graph.edges(); - if (children2.length > 0) { - log$1.debug("Cluster identified", id2, descendants); - edges2.forEach((edge) => { - if (edge.v !== id2 && edge.w !== id2) { - const d1 = isDescendant(edge.v, id2); - const d2 = isDescendant(edge.w, id2); - if (d1 ^ d2) { - log$1.warn("Edge: ", edge, " leaves cluster ", id2); - log$1.warn("Descendants of XXX ", id2, ": ", descendants[id2]); - clusterDb[id2].externalConnections = true; - } - } - }); - } else { - log$1.debug("Not a cluster ", id2, descendants); + if (typeof namespace === "string") { + namespace = parse_default(namespace); } - }); - for (let id2 of Object.keys(clusterDb)) { - const nonClusterChild = clusterDb[id2].id; - const parent = graph.parent(nonClusterChild); - if (parent !== id2 && clusterDb[parent] && !clusterDb[parent].externalConnections) { - clusterDb[id2].id = parent; - } - } - graph.edges().forEach(function(e) { - const edge = graph.edge(e); - log$1.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)); - log$1.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph.edge(e))); - let v = e.v; - let w2 = e.w; - log$1.warn( - "Fix XXX", - clusterDb, - "ids:", - e.v, - e.w, - "Translating: ", - clusterDb[e.v], - " --- ", - clusterDb[e.w] - ); - if (clusterDb[e.v] && clusterDb[e.w] && clusterDb[e.v] === clusterDb[e.w]) { - log$1.warn("Fixing and trixing link to self - removing XXX", e.v, e.w, e.name); - log$1.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name); - v = getAnchorId(e.v); - w2 = getAnchorId(e.w); - graph.removeEdge(e.v, e.w, e.name); - const specialId = e.w + "---" + e.v; - graph.setNode(specialId, { - domId: specialId, - id: specialId, - labelStyle: "", - labelText: edge.label, - padding: 0, - shape: "labelRect", - style: "" - }); - const edge1 = structuredClone(edge); - const edge2 = structuredClone(edge); - edge1.label = ""; - edge1.arrowTypeEnd = "none"; - edge2.label = ""; - edge1.fromCluster = e.v; - edge2.toCluster = e.v; - graph.setEdge(v, specialId, edge1, e.name + "-cyclic-special"); - graph.setEdge(specialId, w2, edge2, e.name + "-cyclic-special"); - } else if (clusterDb[e.v] || clusterDb[e.w]) { - log$1.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name); - v = getAnchorId(e.v); - w2 = getAnchorId(e.w); - graph.removeEdge(e.v, e.w, e.name); - if (v !== e.v) { - const parent = graph.parent(v); - clusterDb[parent].externalConnections = true; - edge.fromCluster = e.v; - } - if (w2 !== e.w) { - const parent = graph.parent(w2); - clusterDb[parent].externalConnections = true; - edge.toCluster = e.w; - } - log$1.warn("Fix Replacing with XXX", v, w2, e.name); - graph.setEdge(v, w2, edge, e.name); + if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { + throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); } - }); - log$1.warn("Adjusted Graph", write(graph)); - extractor(graph, 0); - log$1.trace(clusterDb); - }; - const extractor = (graph, depth) => { - log$1.warn("extractor - ", depth, write(graph), graph.children("D")); - if (depth > 10) { - log$1.error("Bailing out"); - return; + let bytes = new Uint8Array(16 + value2.length); + bytes.set(namespace); + bytes.set(value2, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 15 | version4; + bytes[8] = bytes[8] & 63 | 128; + if (buf) { + offset = offset || 0; + for (let i2 = 0; i2 < 16; ++i2) { + buf[offset + i2] = bytes[i2]; + } + return buf; + } + return unsafeStringify(bytes); } - let nodes2 = graph.nodes(); - let hasChildren = false; - for (const node2 of nodes2) { - const children2 = graph.children(node2); - hasChildren = hasChildren || children2.length > 0; + __name(generateUUID, "generateUUID"); + try { + generateUUID.name = name; + } catch (err) { } - if (!hasChildren) { - log$1.debug("Done, no node has children", graph.nodes()); - return; + generateUUID.DNS = DNS; + generateUUID.URL = URL2; + return generateUUID; + } + var DNS, URL2; + var init_v35 = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v35.js"() { + "use strict"; + init_stringify(); + init_parse2(); + __name(stringToBytes, "stringToBytes"); + DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; + URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; + __name(v35, "v35"); } - log$1.debug("Nodes = ", nodes2, depth); - for (const node2 of nodes2) { - log$1.debug( - "Extracting node", - node2, - clusterDb, - clusterDb[node2] && !clusterDb[node2].externalConnections, - !graph.parent(node2), - graph.node(node2), - graph.children("D"), - " Depth ", - depth - ); - if (!clusterDb[node2]) { - log$1.debug("Not a cluster", node2, depth); - } else if (!clusterDb[node2].externalConnections && // !graph.parent(node) && - graph.children(node2) && graph.children(node2).length > 0) { - log$1.warn( - "Cluster without external connections, without a parent and with children", - node2, - depth - ); - const graphSettings = graph.graph(); - let dir2 = graphSettings.rankdir === "TB" ? "LR" : "TB"; - if (clusterDb[node2] && clusterDb[node2].clusterData && clusterDb[node2].clusterData.dir) { - dir2 = clusterDb[node2].clusterData.dir; - log$1.warn("Fixing dir", clusterDb[node2].clusterData.dir, dir2); + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/sha1.js + function f2(s2, x5, y5, z2) { + switch (s2) { + case 0: + return x5 & y5 ^ ~x5 & z2; + case 1: + return x5 ^ y5 ^ z2; + case 2: + return x5 & y5 ^ x5 & z2 ^ y5 & z2; + case 3: + return x5 ^ y5 ^ z2; + } + } + function ROTL(x5, n2) { + return x5 << n2 | x5 >>> 32 - n2; + } + function sha1(bytes) { + const K4 = [1518500249, 1859775393, 2400959708, 3395469782]; + const H2 = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + if (typeof bytes === "string") { + const msg = unescape(encodeURIComponent(bytes)); + bytes = []; + for (let i2 = 0; i2 < msg.length; ++i2) { + bytes.push(msg.charCodeAt(i2)); + } + } else if (!Array.isArray(bytes)) { + bytes = Array.prototype.slice.call(bytes); + } + bytes.push(128); + const l2 = bytes.length / 4 + 2; + const N2 = Math.ceil(l2 / 16); + const M2 = new Array(N2); + for (let i2 = 0; i2 < N2; ++i2) { + const arr = new Uint32Array(16); + for (let j2 = 0; j2 < 16; ++j2) { + arr[j2] = bytes[i2 * 64 + j2 * 4] << 24 | bytes[i2 * 64 + j2 * 4 + 1] << 16 | bytes[i2 * 64 + j2 * 4 + 2] << 8 | bytes[i2 * 64 + j2 * 4 + 3]; + } + M2[i2] = arr; + } + M2[N2 - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M2[N2 - 1][14] = Math.floor(M2[N2 - 1][14]); + M2[N2 - 1][15] = (bytes.length - 1) * 8 & 4294967295; + for (let i2 = 0; i2 < N2; ++i2) { + const W2 = new Uint32Array(80); + for (let t4 = 0; t4 < 16; ++t4) { + W2[t4] = M2[i2][t4]; + } + for (let t4 = 16; t4 < 80; ++t4) { + W2[t4] = ROTL(W2[t4 - 3] ^ W2[t4 - 8] ^ W2[t4 - 14] ^ W2[t4 - 16], 1); + } + let a2 = H2[0]; + let b2 = H2[1]; + let c3 = H2[2]; + let d2 = H2[3]; + let e3 = H2[4]; + for (let t4 = 0; t4 < 80; ++t4) { + const s2 = Math.floor(t4 / 20); + const T3 = ROTL(a2, 5) + f2(s2, b2, c3, d2) + e3 + K4[s2] + W2[t4] >>> 0; + e3 = d2; + d2 = c3; + c3 = ROTL(b2, 30) >>> 0; + b2 = a2; + a2 = T3; + } + H2[0] = H2[0] + a2 >>> 0; + H2[1] = H2[1] + b2 >>> 0; + H2[2] = H2[2] + c3 >>> 0; + H2[3] = H2[3] + d2 >>> 0; + H2[4] = H2[4] + e3 >>> 0; + } + return [H2[0] >> 24 & 255, H2[0] >> 16 & 255, H2[0] >> 8 & 255, H2[0] & 255, H2[1] >> 24 & 255, H2[1] >> 16 & 255, H2[1] >> 8 & 255, H2[1] & 255, H2[2] >> 24 & 255, H2[2] >> 16 & 255, H2[2] >> 8 & 255, H2[2] & 255, H2[3] >> 24 & 255, H2[3] >> 16 & 255, H2[3] >> 8 & 255, H2[3] & 255, H2[4] >> 24 & 255, H2[4] >> 16 & 255, H2[4] >> 8 & 255, H2[4] & 255]; + } + var sha1_default; + var init_sha1 = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/sha1.js"() { + "use strict"; + __name(f2, "f"); + __name(ROTL, "ROTL"); + __name(sha1, "sha1"); + sha1_default = sha1; + } + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v5.js + var v5, v5_default; + var init_v5 = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v5.js"() { + "use strict"; + init_v35(); + init_sha1(); + v5 = v35("v5", 80, sha1_default); + v5_default = v5; + } + }); + + // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/index.js + var init_esm_browser = __esm({ + "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/index.js"() { + "use strict"; + init_v5(); + } + }); + + // src/diagrams/er/erRenderer.js + function generateId2(str2 = "", prefix = "") { + const simplifiedStr = str2.replace(BAD_ID_CHARS_REGEXP, ""); + return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${v5_default( + str2, + MERMAID_ERDIAGRAM_UUID + )}`; + } + function strWithHyphen(str2 = "") { + return str2.length > 0 ? `${str2}-` : ""; + } + var BAD_ID_CHARS_REGEXP, conf2, entityNameIds, setConf2, drawAttributes, drawEntities, adjustEntities, getEdgeName, addRelationships, relCnt, drawRelationshipFromLayout, draw3, MERMAID_ERDIAGRAM_UUID, erRenderer_default; + var init_erRenderer = __esm({ + "src/diagrams/er/erRenderer.js"() { + "use strict"; + init_graphlib(); + init_src32(); + init_dagre(); + init_diagramAPI(); + init_logger(); + init_utils2(); + init_erMarkers(); + init_setupGraphViewbox(); + init_common(); + init_esm_browser(); + BAD_ID_CHARS_REGEXP = /[^\dA-Za-z](\W)*/g; + conf2 = {}; + entityNameIds = /* @__PURE__ */ new Map(); + setConf2 = /* @__PURE__ */ __name(function(cnf) { + const keys3 = Object.keys(cnf); + for (const key of keys3) { + conf2[key] = cnf[key]; + } + }, "setConf"); + drawAttributes = /* @__PURE__ */ __name((groupNode, entityTextNode, attributes) => { + const heightPadding = conf2.entityPadding / 3; + const widthPadding = conf2.entityPadding / 3; + const attrFontSize = conf2.fontSize * 0.85; + const labelBBox = entityTextNode.node().getBBox(); + const attributeNodes = []; + let hasKeyType = false; + let hasComment = false; + let maxTypeWidth = 0; + let maxNameWidth = 0; + let maxKeyWidth = 0; + let maxCommentWidth = 0; + let cumulativeHeight = labelBBox.height + heightPadding * 2; + let attrNum = 1; + attributes.forEach((item) => { + if (item.attributeKeyTypeList !== void 0 && item.attributeKeyTypeList.length > 0) { + hasKeyType = true; + } + if (item.attributeComment !== void 0) { + hasComment = true; + } + }); + attributes.forEach((item) => { + const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`; + let nodeHeight = 0; + const attributeType = parseGenericTypes(item.attributeType); + const typeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-type`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(attributeType); + const nameNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-name`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeName); + const attributeNode = {}; + attributeNode.tn = typeNode; + attributeNode.nn = nameNode; + const typeBBox = typeNode.node().getBBox(); + const nameBBox = nameNode.node().getBBox(); + maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width); + maxNameWidth = Math.max(maxNameWidth, nameBBox.width); + nodeHeight = Math.max(typeBBox.height, nameBBox.height); + if (hasKeyType) { + const keyTypeNodeText = item.attributeKeyTypeList !== void 0 ? item.attributeKeyTypeList.join(",") : ""; + const keyTypeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-key`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(keyTypeNodeText); + attributeNode.kn = keyTypeNode; + const keyTypeBBox = keyTypeNode.node().getBBox(); + maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width); + nodeHeight = Math.max(nodeHeight, keyTypeBBox.height); + } + if (hasComment) { + const commentNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-comment`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig2().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeComment || ""); + attributeNode.cn = commentNode; + const commentNodeBBox = commentNode.node().getBBox(); + maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width); + nodeHeight = Math.max(nodeHeight, commentNodeBBox.height); + } + attributeNode.height = nodeHeight; + attributeNodes.push(attributeNode); + cumulativeHeight += nodeHeight + heightPadding * 2; + attrNum += 1; + }); + let widthPaddingFactor = 4; + if (hasKeyType) { + widthPaddingFactor += 2; } - const clusterGraph = new Graph({ + if (hasComment) { + widthPaddingFactor += 2; + } + const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth; + const bBox = { + width: Math.max( + conf2.minEntityWidth, + Math.max( + labelBBox.width + conf2.entityPadding * 2, + maxWidth + widthPadding * widthPaddingFactor + ) + ), + height: attributes.length > 0 ? cumulativeHeight : Math.max(conf2.minEntityHeight, labelBBox.height + conf2.entityPadding * 2) + }; + if (attributes.length > 0) { + const spareColumnWidth = Math.max( + 0, + (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2) + ); + entityTextNode.attr( + "transform", + "translate(" + bBox.width / 2 + "," + (heightPadding + labelBBox.height / 2) + ")" + ); + let heightOffset = labelBBox.height + heightPadding * 2; + let attribStyle = "attributeBoxOdd"; + attributeNodes.forEach((attributeNode) => { + const alignY = heightOffset + heightPadding + attributeNode.height / 2; + attributeNode.tn.attr("transform", "translate(" + widthPadding + "," + alignY + ")"); + const typeRect = groupNode.insert("rect", "#" + attributeNode.tn.node().id).classed(`er ${attribStyle}`, true).attr("x", 0).attr("y", heightOffset).attr("width", maxTypeWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); + const nameXOffset = parseFloat(typeRect.attr("x")) + parseFloat(typeRect.attr("width")); + attributeNode.nn.attr( + "transform", + "translate(" + (nameXOffset + widthPadding) + "," + alignY + ")" + ); + const nameRect = groupNode.insert("rect", "#" + attributeNode.nn.node().id).classed(`er ${attribStyle}`, true).attr("x", nameXOffset).attr("y", heightOffset).attr("width", maxNameWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); + let keyTypeAndCommentXOffset = parseFloat(nameRect.attr("x")) + parseFloat(nameRect.attr("width")); + if (hasKeyType) { + attributeNode.kn.attr( + "transform", + "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")" + ); + const keyTypeRect = groupNode.insert("rect", "#" + attributeNode.kn.node().id).classed(`er ${attribStyle}`, true).attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxKeyWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); + keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr("x")) + parseFloat(keyTypeRect.attr("width")); + } + if (hasComment) { + attributeNode.cn.attr( + "transform", + "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")" + ); + groupNode.insert("rect", "#" + attributeNode.cn.node().id).classed(`er ${attribStyle}`, "true").attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxCommentWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); + } + heightOffset += attributeNode.height + heightPadding * 2; + attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd"; + }); + } else { + bBox.height = Math.max(conf2.minEntityHeight, cumulativeHeight); + entityTextNode.attr("transform", "translate(" + bBox.width / 2 + "," + bBox.height / 2 + ")"); + } + return bBox; + }, "drawAttributes"); + drawEntities = /* @__PURE__ */ __name(function(svgNode2, entities2, graph) { + const keys3 = [...entities2.keys()]; + let firstOne; + keys3.forEach(function(entityName) { + const entityId = generateId2(entityName, "entity"); + entityNameIds.set(entityName, entityId); + const groupNode = svgNode2.append("g").attr("id", entityId); + firstOne = firstOne === void 0 ? entityId : firstOne; + const textId = "text-" + entityId; + const textNode = groupNode.append("text").classed("er entityLabel", true).attr("id", textId).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "middle").style("font-family", getConfig2().fontFamily).style("font-size", conf2.fontSize + "px").text(entities2.get(entityName).alias ?? entityName); + const { width: entityWidth, height: entityHeight } = drawAttributes( + groupNode, + textNode, + entities2.get(entityName).attributes + ); + const rectNode = groupNode.insert("rect", "#" + textId).classed("er entityBox", true).attr("x", 0).attr("y", 0).attr("width", entityWidth).attr("height", entityHeight); + const rectBBox = rectNode.node().getBBox(); + graph.setNode(entityId, { + width: rectBBox.width, + height: rectBBox.height, + shape: "rect", + id: entityId + }); + }); + return firstOne; + }, "drawEntities"); + adjustEntities = /* @__PURE__ */ __name(function(svgNode2, graph) { + graph.nodes().forEach(function(v3) { + if (v3 !== void 0 && graph.node(v3) !== void 0) { + svgNode2.select("#" + v3).attr( + "transform", + "translate(" + (graph.node(v3).x - graph.node(v3).width / 2) + "," + (graph.node(v3).y - graph.node(v3).height / 2) + " )" + ); + } + }); + }, "adjustEntities"); + getEdgeName = /* @__PURE__ */ __name(function(rel2) { + return (rel2.entityA + rel2.roleA + rel2.entityB).replace(/\s/g, ""); + }, "getEdgeName"); + addRelationships = /* @__PURE__ */ __name(function(relationships2, g2) { + relationships2.forEach(function(r2) { + g2.setEdge( + entityNameIds.get(r2.entityA), + entityNameIds.get(r2.entityB), + { relationship: r2 }, + getEdgeName(r2) + ); + }); + return relationships2; + }, "addRelationships"); + relCnt = 0; + drawRelationshipFromLayout = /* @__PURE__ */ __name(function(svg, rel2, g2, insert, diagObj) { + relCnt++; + const edge = g2.edge( + entityNameIds.get(rel2.entityA), + entityNameIds.get(rel2.entityB), + getEdgeName(rel2) + ); + const lineFunction = line_default().x(function(d2) { + return d2.x; + }).y(function(d2) { + return d2.y; + }).curve(basis_default2); + const svgPath = svg.insert("path", "#" + insert).classed("er relationshipLine", true).attr("d", lineFunction(edge.points)).style("stroke", conf2.stroke).style("fill", "none"); + if (rel2.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) { + svgPath.attr("stroke-dasharray", "8,8"); + } + let url = ""; + if (conf2.arrowMarkerAbsolute) { + url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, "\\("); + url = url.replace(/\)/g, "\\)"); + } + switch (rel2.relSpec.cardA) { + case diagObj.db.Cardinality.ZERO_OR_ONE: + svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_ONE_END + ")"); + break; + case diagObj.db.Cardinality.ZERO_OR_MORE: + svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_MORE_END + ")"); + break; + case diagObj.db.Cardinality.ONE_OR_MORE: + svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ONE_OR_MORE_END + ")"); + break; + case diagObj.db.Cardinality.ONLY_ONE: + svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ONLY_ONE_END + ")"); + break; + case diagObj.db.Cardinality.MD_PARENT: + svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.MD_PARENT_END + ")"); + break; + } + switch (rel2.relSpec.cardB) { + case diagObj.db.Cardinality.ZERO_OR_ONE: + svgPath.attr( + "marker-start", + "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_ONE_START + ")" + ); + break; + case diagObj.db.Cardinality.ZERO_OR_MORE: + svgPath.attr( + "marker-start", + "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_MORE_START + ")" + ); + break; + case diagObj.db.Cardinality.ONE_OR_MORE: + svgPath.attr( + "marker-start", + "url(" + url + "#" + erMarkers_default.ERMarkers.ONE_OR_MORE_START + ")" + ); + break; + case diagObj.db.Cardinality.ONLY_ONE: + svgPath.attr("marker-start", "url(" + url + "#" + erMarkers_default.ERMarkers.ONLY_ONE_START + ")"); + break; + case diagObj.db.Cardinality.MD_PARENT: + svgPath.attr("marker-start", "url(" + url + "#" + erMarkers_default.ERMarkers.MD_PARENT_START + ")"); + break; + } + const len = svgPath.node().getTotalLength(); + const labelPoint = svgPath.node().getPointAtLength(len * 0.5); + const labelId = "rel" + relCnt; + const labelNode = svg.append("text").classed("er relationshipLabel", true).attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", getConfig2().fontFamily).style("font-size", conf2.fontSize + "px").text(rel2.roleA); + const labelBBox = labelNode.node().getBBox(); + svg.insert("rect", "#" + labelId).classed("er relationshipLabelBox", true).attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height); + }, "drawRelationshipFromLayout"); + draw3 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + conf2 = getConfig2().er; + log.info("Drawing ER diagram"); + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id='${id26}']`); + erMarkers_default.insertMarkers(svg, conf2); + let g2; + g2 = new Graph({ multigraph: true, - compound: true + directed: true, + compound: false }).setGraph({ - rankdir: dir2, - // Todo: set proper spacing - nodesep: 50, - ranksep: 50, - marginx: 8, - marginy: 8 + rankdir: conf2.layoutDirection, + marginx: 20, + marginy: 20, + nodesep: 100, + edgesep: 100, + ranksep: 100 }).setDefaultEdgeLabel(function() { return {}; }); - log$1.warn("Old graph before copy", write(graph)); - copy(node2, graph, clusterGraph, node2); - graph.setNode(node2, { - clusterNode: true, - id: node2, - clusterData: clusterDb[node2].clusterData, - labelText: clusterDb[node2].labelText, - graph: clusterGraph + const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g2); + const relationships2 = addRelationships(diagObj.db.getRelationships(), g2); + layout(g2); + adjustEntities(svg, g2); + relationships2.forEach(function(rel2) { + drawRelationshipFromLayout(svg, rel2, g2, firstEntity, diagObj); }); - log$1.warn("New graph after copy node: (", node2, ")", write(clusterGraph)); - log$1.debug("Old graph after copy", write(graph)); - } else { - log$1.warn( - "Cluster ** ", - node2, - " **not meeting the criteria !externalConnections:", - !clusterDb[node2].externalConnections, - " no parent: ", - !graph.parent(node2), - " children ", - graph.children(node2) && graph.children(node2).length > 0, - graph.children("D"), - depth - ); - log$1.debug(clusterDb); - } + const padding3 = conf2.diagramPadding; + utils_default2.insertTitle(svg, "entityTitleText", conf2.titleTopMargin, diagObj.db.getDiagramTitle()); + const svgBounds = svg.node().getBBox(); + const width3 = svgBounds.width + padding3 * 2; + const height2 = svgBounds.height + padding3 * 2; + configureSvgSize(svg, height2, width3, conf2.useMaxWidth); + svg.attr("viewBox", `${svgBounds.x - padding3} ${svgBounds.y - padding3} ${width3} ${height2}`); + }, "draw"); + MERMAID_ERDIAGRAM_UUID = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c"; + __name(generateId2, "generateId"); + __name(strWithHyphen, "strWithHyphen"); + erRenderer_default = { + setConf: setConf2, + draw: draw3 + }; } - nodes2 = graph.nodes(); - log$1.warn("New list of nodes", nodes2); - for (const node2 of nodes2) { - const data = graph.node(node2); - log$1.warn(" Now next level", node2, data); - if (data.clusterNode) { - extractor(data.graph, depth + 1); + }); + + // src/diagrams/er/styles.js + var getStyles4, styles_default4; + var init_styles4 = __esm({ + "src/diagrams/er/styles.js"() { + "use strict"; + getStyles4 = /* @__PURE__ */ __name((options3) => ` + .entityBox { + fill: ${options3.mainBkg}; + stroke: ${options3.nodeBorder}; + } + + .attributeBoxOdd { + fill: ${options3.attributeBackgroundColorOdd}; + stroke: ${options3.nodeBorder}; + } + + .attributeBoxEven { + fill: ${options3.attributeBackgroundColorEven}; + stroke: ${options3.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${options3.tertiaryColor}; + opacity: 0.7; + background-color: ${options3.tertiaryColor}; + rect { + opacity: 0.5; } - } - }; - const sorter = (graph, nodes2) => { - if (nodes2.length === 0) { - return []; - } - let result = Object.assign(nodes2); - nodes2.forEach((node2) => { - const children2 = graph.children(node2); - const sorted = sorter(graph, children2); - result = [...result, ...sorted]; - }); - return result; - }; - const sortNodesByHierarchy = (graph) => sorter(graph, graph.children()); - function intersectNode(node2, point2) { - return node2.intersect(point2); } - function intersectEllipse(node2, rx, ry, point2) { - var cx = node2.x; - var cy = node2.y; - var px = cx - point2.x; - var py = cy - point2.y; - var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); - var dx = Math.abs(rx * ry * px / det); - if (point2.x < cx) { - dx = -dx; - } - var dy = Math.abs(rx * ry * py / det); - if (point2.y < cy) { - dy = -dy; + + .relationshipLine { + stroke: ${options3.lineColor}; } - return { x: cx + dx, y: cy + dy }; + + .entityTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; + } + #MD_PARENT_START { + fill: #f5f5f5 !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; } - function intersectCircle(node2, rx, point2) { - return intersectEllipse(node2, rx, rx, point2); + #MD_PARENT_END { + fill: #f5f5f5 !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; } - function intersectLine(p1, p2, q1, q2) { - var a1, a2, b1, b2, c1, c2; - var r1, r2, r3, r4; - var denom, offset, num; - var x2, y2; - a1 = p2.y - p1.y; - b1 = p1.x - p2.x; - c1 = p2.x * p1.y - p1.x * p2.y; - r3 = a1 * q1.x + b1 * q1.y + c1; - r4 = a1 * q2.x + b1 * q2.y + c1; - if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) { - return; - } - a2 = q2.y - q1.y; - b2 = q1.x - q2.x; - c2 = q2.x * q1.y - q1.x * q2.y; - r1 = a2 * p1.x + b2 * p1.y + c2; - r2 = a2 * p2.x + b2 * p2.y + c2; - if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) { - return; + +`, "getStyles"); + styles_default4 = getStyles4; } - denom = a1 * b2 - a2 * b1; - if (denom === 0) { - return; + }); + + // src/diagrams/er/erDiagram.ts + var erDiagram_exports = {}; + __export(erDiagram_exports, { + diagram: () => diagram3 + }); + var diagram3; + var init_erDiagram2 = __esm({ + "src/diagrams/er/erDiagram.ts"() { + "use strict"; + init_erDiagram(); + init_erDb(); + init_erRenderer(); + init_styles4(); + diagram3 = { + parser: erDiagram_default, + db: erDb_default, + renderer: erRenderer_default, + styles: styles_default4 + }; } - offset = Math.abs(denom / 2); - num = b1 * c2 - b2 * c1; - x2 = num < 0 ? (num - offset) / denom : (num + offset) / denom; - num = a2 * c1 - a1 * c2; - y2 = num < 0 ? (num - offset) / denom : (num + offset) / denom; - return { x: x2, y: y2 }; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/syntax-tree.js + function isAstNode(obj) { + return typeof obj === "object" && obj !== null && typeof obj.$type === "string"; } - function sameSign(r1, r2) { - return r1 * r2 > 0; + function isReference(obj) { + return typeof obj === "object" && obj !== null && typeof obj.$refText === "string"; } - function intersectPolygon(node2, polyPoints, point2) { - var x1 = node2.x; - var y1 = node2.y; - var intersections = []; - var minX = Number.POSITIVE_INFINITY; - var minY = Number.POSITIVE_INFINITY; - if (typeof polyPoints.forEach === "function") { - polyPoints.forEach(function(entry) { - minX = Math.min(minX, entry.x); - minY = Math.min(minY, entry.y); - }); - } else { - minX = Math.min(minX, polyPoints.x); - minY = Math.min(minY, polyPoints.y); + function isAstNodeDescription(obj) { + return typeof obj === "object" && obj !== null && typeof obj.name === "string" && typeof obj.type === "string" && typeof obj.path === "string"; + } + function isLinkingError(obj) { + return typeof obj === "object" && obj !== null && isAstNode(obj.container) && isReference(obj.reference) && typeof obj.message === "string"; + } + function isCompositeCstNode(node2) { + return typeof node2 === "object" && node2 !== null && Array.isArray(node2.content); + } + function isLeafCstNode(node2) { + return typeof node2 === "object" && node2 !== null && typeof node2.tokenType === "object"; + } + function isRootCstNode(node2) { + return isCompositeCstNode(node2) && typeof node2.fullText === "string"; + } + var AbstractAstReflection; + var init_syntax_tree = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/syntax-tree.js"() { + "use strict"; + __name(isAstNode, "isAstNode"); + __name(isReference, "isReference"); + __name(isAstNodeDescription, "isAstNodeDescription"); + __name(isLinkingError, "isLinkingError"); + AbstractAstReflection = class { + static { + __name(this, "AbstractAstReflection"); + } + constructor() { + this.subtypes = {}; + this.allSubtypes = {}; + } + isInstance(node2, type3) { + return isAstNode(node2) && this.isSubtype(node2.$type, type3); + } + isSubtype(subtype, supertype) { + if (subtype === supertype) { + return true; + } + let nested = this.subtypes[subtype]; + if (!nested) { + nested = this.subtypes[subtype] = {}; + } + const existing = nested[supertype]; + if (existing !== void 0) { + return existing; + } else { + const result = this.computeIsSubtype(subtype, supertype); + nested[supertype] = result; + return result; + } + } + getAllSubTypes(type3) { + const existing = this.allSubtypes[type3]; + if (existing) { + return existing; + } else { + const allTypes = this.getAllTypes(); + const types = []; + for (const possibleSubType of allTypes) { + if (this.isSubtype(possibleSubType, type3)) { + types.push(possibleSubType); + } + } + this.allSubtypes[type3] = types; + return types; + } + } + }; + __name(isCompositeCstNode, "isCompositeCstNode"); + __name(isLeafCstNode, "isLeafCstNode"); + __name(isRootCstNode, "isRootCstNode"); } - var left2 = x1 - node2.width / 2 - minX; - var top2 = y1 - node2.height / 2 - minY; - for (var i2 = 0; i2 < polyPoints.length; i2++) { - var p1 = polyPoints[i2]; - var p2 = polyPoints[i2 < polyPoints.length - 1 ? i2 + 1 : 0]; - var intersect2 = intersectLine( - node2, - point2, - { x: left2 + p1.x, y: top2 + p1.y }, - { x: left2 + p2.x, y: top2 + p2.y } - ); - if (intersect2) { - intersections.push(intersect2); - } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/stream.js + function toString2(item) { + if (typeof item === "string") { + return item; } - if (!intersections.length) { - return node2; + if (typeof item === "undefined") { + return "undefined"; } - if (intersections.length > 1) { - intersections.sort(function(p, q) { - var pdx = p.x - point2.x; - var pdy = p.y - point2.y; - var distp = Math.sqrt(pdx * pdx + pdy * pdy); - var qdx = q.x - point2.x; - var qdy = q.y - point2.y; - var distq = Math.sqrt(qdx * qdx + qdy * qdy); - return distp < distq ? -1 : distp === distq ? 0 : 1; - }); + if (typeof item.toString === "function") { + return item.toString(); } - return intersections[0]; + return Object.prototype.toString.call(item); } - const intersectRect = (node2, point2) => { - var x2 = node2.x; - var y2 = node2.y; - var dx = point2.x - x2; - var dy = point2.y - y2; - var w2 = node2.width / 2; - var h = node2.height / 2; - var sx, sy; - if (Math.abs(dy) * w2 > Math.abs(dx) * h) { - if (dy < 0) { - h = -h; + function isIterable(obj) { + return !!obj && typeof obj[Symbol.iterator] === "function"; + } + function stream(...collections) { + if (collections.length === 1) { + const collection4 = collections[0]; + if (collection4 instanceof StreamImpl) { + return collection4; } - sx = dy === 0 ? 0 : h * dx / dy; - sy = h; - } else { - if (dx < 0) { - w2 = -w2; + if (isIterable(collection4)) { + return new StreamImpl(() => collection4[Symbol.iterator](), (iterator) => iterator.next()); } - sx = w2; - sy = dx === 0 ? 0 : w2 * dy / dx; - } - return { x: x2 + sx, y: y2 + sy }; - }; - const intersectRect$1 = intersectRect; - const intersect = { - node: intersectNode, - circle: intersectCircle, - ellipse: intersectEllipse, - polygon: intersectPolygon, - rect: intersectRect$1 - }; - const note = async (parent, node2) => { - const useHtmlLabels = node2.useHtmlLabels || getConfig$1().flowchart.htmlLabels; - if (!useHtmlLabels) { - node2.centerLabel = true; - } - const { shapeSvg, bbox, halfPadding } = await labelHelper( - parent, - node2, - "node " + node2.classes, - true - ); - log$1.info("Classes = ", node2.classes); - const rect2 = shapeSvg.insert("rect", ":first-child"); - rect2.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); - updateNodeBounds(node2, rect2); - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - const note$1 = note; - const expandAndDeduplicateDirections = (directions) => { - const uniqueDirections = /* @__PURE__ */ new Set(); - for (const direction2 of directions) { - switch (direction2) { - case "x": - uniqueDirections.add("right"); - uniqueDirections.add("left"); - break; - case "y": - uniqueDirections.add("up"); - uniqueDirections.add("down"); - break; - default: - uniqueDirections.add(direction2); - break; + if (typeof collection4.length === "number") { + return new StreamImpl(() => ({ index: 0 }), (state4) => { + if (state4.index < collection4.length) { + return { done: false, value: collection4[state4.index++] }; + } else { + return DONE_RESULT; + } + }); } } - return uniqueDirections; - }; - const getArrowPoints = (duplicatedDirections, bbox, node2) => { - const directions = expandAndDeduplicateDirections(duplicatedDirections); - const f2 = 2; - const height = bbox.height + 2 * node2.padding; - const midpoint = height / f2; - const width2 = bbox.width + 2 * midpoint + node2.padding; - const padding2 = node2.padding / 2; - if (directions.has("right") && directions.has("left") && directions.has("up") && directions.has("down")) { - return [ - // Bottom - { x: 0, y: 0 }, - { x: midpoint, y: 0 }, - { x: width2 / 2, y: 2 * padding2 }, - { x: width2 - midpoint, y: 0 }, - { x: width2, y: 0 }, - // Right - { x: width2, y: -height / 3 }, - { x: width2 + 2 * padding2, y: -height / 2 }, - { x: width2, y: -2 * height / 3 }, - { x: width2, y: -height }, - // Top - { x: width2 - midpoint, y: -height }, - { x: width2 / 2, y: -height - 2 * padding2 }, - { x: midpoint, y: -height }, - // Left - { x: 0, y: -height }, - { x: 0, y: -2 * height / 3 }, - { x: -2 * padding2, y: -height / 2 }, - { x: 0, y: -height / 3 } - ]; - } - if (directions.has("right") && directions.has("left") && directions.has("up")) { - return [ - { x: midpoint, y: 0 }, - { x: width2 - midpoint, y: 0 }, - { x: width2, y: -height / 2 }, - { x: width2 - midpoint, y: -height }, - { x: midpoint, y: -height }, - { x: 0, y: -height / 2 } - ]; - } - if (directions.has("right") && directions.has("left") && directions.has("down")) { - return [ - { x: 0, y: 0 }, - { x: midpoint, y: -height }, - { x: width2 - midpoint, y: -height }, - { x: width2, y: 0 } - ]; - } - if (directions.has("right") && directions.has("up") && directions.has("down")) { - return [ - { x: 0, y: 0 }, - { x: width2, y: -midpoint }, - { x: width2, y: -height + midpoint }, - { x: 0, y: -height } - ]; - } - if (directions.has("left") && directions.has("up") && directions.has("down")) { - return [ - { x: width2, y: 0 }, - { x: 0, y: -midpoint }, - { x: 0, y: -height + midpoint }, - { x: width2, y: -height } - ]; + if (collections.length > 1) { + return new StreamImpl(() => ({ collIndex: 0, arrIndex: 0 }), (state4) => { + do { + if (state4.iterator) { + const next3 = state4.iterator.next(); + if (!next3.done) { + return next3; + } + state4.iterator = void 0; + } + if (state4.array) { + if (state4.arrIndex < state4.array.length) { + return { done: false, value: state4.array[state4.arrIndex++] }; + } + state4.array = void 0; + state4.arrIndex = 0; + } + if (state4.collIndex < collections.length) { + const collection4 = collections[state4.collIndex++]; + if (isIterable(collection4)) { + state4.iterator = collection4[Symbol.iterator](); + } else if (collection4 && typeof collection4.length === "number") { + state4.array = collection4; + } + } + } while (state4.iterator || state4.array || state4.collIndex < collections.length); + return DONE_RESULT; + }); } - if (directions.has("right") && directions.has("left")) { - return [ - { x: midpoint, y: 0 }, - { x: midpoint, y: -padding2 }, - { x: width2 - midpoint, y: -padding2 }, - { x: width2 - midpoint, y: 0 }, - { x: width2, y: -height / 2 }, - { x: width2 - midpoint, y: -height }, - { x: width2 - midpoint, y: -height + padding2 }, - { x: midpoint, y: -height + padding2 }, - { x: midpoint, y: -height }, - { x: 0, y: -height / 2 } - ]; - } - if (directions.has("up") && directions.has("down")) { - return [ - // Bottom center - { x: width2 / 2, y: 0 }, - // Left pont of bottom arrow - { x: 0, y: -padding2 }, - { x: midpoint, y: -padding2 }, - // Left top over vertical section - { x: midpoint, y: -height + padding2 }, - { x: 0, y: -height + padding2 }, - // Top of arrow - { x: width2 / 2, y: -height }, - { x: width2, y: -height + padding2 }, - // Top of right vertical bar - { x: width2 - midpoint, y: -height + padding2 }, - { x: width2 - midpoint, y: -padding2 }, - { x: width2, y: -padding2 } - ]; - } - if (directions.has("right") && directions.has("up")) { - return [ - { x: 0, y: 0 }, - { x: width2, y: -midpoint }, - { x: 0, y: -height } - ]; - } - if (directions.has("right") && directions.has("down")) { - return [ - { x: 0, y: 0 }, - { x: width2, y: 0 }, - { x: 0, y: -height } - ]; - } - if (directions.has("left") && directions.has("up")) { - return [ - { x: width2, y: 0 }, - { x: 0, y: -midpoint }, - { x: width2, y: -height } - ]; - } - if (directions.has("left") && directions.has("down")) { - return [ - { x: width2, y: 0 }, - { x: 0, y: 0 }, - { x: width2, y: -height } - ]; - } - if (directions.has("right")) { - return [ - { x: midpoint, y: -padding2 }, - { x: midpoint, y: -padding2 }, - { x: width2 - midpoint, y: -padding2 }, - { x: width2 - midpoint, y: 0 }, - { x: width2, y: -height / 2 }, - { x: width2 - midpoint, y: -height }, - { x: width2 - midpoint, y: -height + padding2 }, - // top left corner of arrow - { x: midpoint, y: -height + padding2 }, - { x: midpoint, y: -height + padding2 } - ]; - } - if (directions.has("left")) { - return [ - { x: midpoint, y: 0 }, - { x: midpoint, y: -padding2 }, - // Two points, the right corners - { x: width2 - midpoint, y: -padding2 }, - { x: width2 - midpoint, y: -height + padding2 }, - { x: midpoint, y: -height + padding2 }, - { x: midpoint, y: -height }, - { x: 0, y: -height / 2 } - ]; - } - if (directions.has("up")) { - return [ - // Bottom center - { x: midpoint, y: -padding2 }, - // Left top over vertical section - { x: midpoint, y: -height + padding2 }, - { x: 0, y: -height + padding2 }, - // Top of arrow - { x: width2 / 2, y: -height }, - { x: width2, y: -height + padding2 }, - // Top of right vertical bar - { x: width2 - midpoint, y: -height + padding2 }, - { x: width2 - midpoint, y: -padding2 } - ]; - } - if (directions.has("down")) { - return [ - // Bottom center - { x: width2 / 2, y: 0 }, - // Left pont of bottom arrow - { x: 0, y: -padding2 }, - { x: midpoint, y: -padding2 }, - // Left top over vertical section - { x: midpoint, y: -height + padding2 }, - { x: width2 - midpoint, y: -height + padding2 }, - { x: width2 - midpoint, y: -padding2 }, - { x: width2, y: -padding2 } - ]; - } - return [{ x: 0, y: 0 }]; - }; - const formatClass = (str2) => { - if (str2) { - return " " + str2; - } - return ""; - }; - const getClassesFromNode = (node2, otherClasses) => { - return `${otherClasses ? otherClasses : "node default"}${formatClass(node2.classes)} ${formatClass( - node2.class - )}`; - }; - const question = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const s = w2 + h; - const points = [ - { x: s / 2, y: 0 }, - { x: s, y: -s / 2 }, - { x: s / 2, y: -s }, - { x: 0, y: -s / 2 } - ]; - log$1.info("Question main (Circle)"); - const questionElem = insertPolygonShape$1(shapeSvg, s, s, points); - questionElem.attr("style", node2.style); - updateNodeBounds(node2, questionElem); - node2.intersect = function(point2) { - log$1.warn("Intersect called"); - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const choice = (parent, node2) => { - const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); - const s = 28; - const points = [ - { x: 0, y: s / 2 }, - { x: s / 2, y: 0 }, - { x: 0, y: -s / 2 }, - { x: -s / 2, y: 0 } - ]; - const choice2 = shapeSvg.insert("polygon", ":first-child").attr( - "points", - points.map(function(d) { - return d.x + "," + d.y; - }).join(" ") - ); - choice2.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28); - node2.width = 28; - node2.height = 28; - node2.intersect = function(point2) { - return intersect.circle(node2, 14, point2); - }; - return shapeSvg; - }; - const hexagon = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const f2 = 4; - const h = bbox.height + node2.padding; - const m = h / f2; - const w2 = bbox.width + 2 * m + node2.padding; - const points = [ - { x: m, y: 0 }, - { x: w2 - m, y: 0 }, - { x: w2, y: -h / 2 }, - { x: w2 - m, y: -h }, - { x: m, y: -h }, - { x: 0, y: -h / 2 } - ]; - const hex2 = insertPolygonShape$1(shapeSvg, w2, h, points); - hex2.attr("style", node2.style); - updateNodeBounds(node2, hex2); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const block_arrow = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper(parent, node2, void 0, true); - const f2 = 2; - const h = bbox.height + 2 * node2.padding; - const m = h / f2; - const w2 = bbox.width + 2 * m + node2.padding; - const points = getArrowPoints(node2.directions, bbox, node2); - const blockArrow = insertPolygonShape$1(shapeSvg, w2, h, points); - blockArrow.attr("style", node2.style); - updateNodeBounds(node2, blockArrow); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const rect_left_inv_arrow = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const points = [ - { x: -h / 2, y: 0 }, - { x: w2, y: 0 }, - { x: w2, y: -h }, - { x: -h / 2, y: -h }, - { x: 0, y: -h / 2 } - ]; - const el = insertPolygonShape$1(shapeSvg, w2, h, points); - el.attr("style", node2.style); - node2.width = w2 + h; - node2.height = h; - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const lean_right = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper(parent, node2, getClassesFromNode(node2), true); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const points = [ - { x: -2 * h / 6, y: 0 }, - { x: w2 - h / 6, y: 0 }, - { x: w2 + 2 * h / 6, y: -h }, - { x: h / 6, y: -h } - ]; - const el = insertPolygonShape$1(shapeSvg, w2, h, points); - el.attr("style", node2.style); - updateNodeBounds(node2, el); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const lean_left = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const points = [ - { x: 2 * h / 6, y: 0 }, - { x: w2 + h / 6, y: 0 }, - { x: w2 - 2 * h / 6, y: -h }, - { x: -h / 6, y: -h } - ]; - const el = insertPolygonShape$1(shapeSvg, w2, h, points); - el.attr("style", node2.style); - updateNodeBounds(node2, el); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const trapezoid = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const points = [ - { x: -2 * h / 6, y: 0 }, - { x: w2 + 2 * h / 6, y: 0 }, - { x: w2 - h / 6, y: -h }, - { x: h / 6, y: -h } - ]; - const el = insertPolygonShape$1(shapeSvg, w2, h, points); - el.attr("style", node2.style); - updateNodeBounds(node2, el); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const inv_trapezoid = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const points = [ - { x: h / 6, y: 0 }, - { x: w2 - h / 6, y: 0 }, - { x: w2 + 2 * h / 6, y: -h }, - { x: -2 * h / 6, y: -h } - ]; - const el = insertPolygonShape$1(shapeSvg, w2, h, points); - el.attr("style", node2.style); - updateNodeBounds(node2, el); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const rect_right_inv_arrow = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const points = [ - { x: 0, y: 0 }, - { x: w2 + h / 2, y: 0 }, - { x: w2, y: -h / 2 }, - { x: w2 + h / 2, y: -h }, - { x: 0, y: -h } - ]; - const el = insertPolygonShape$1(shapeSvg, w2, h, points); - el.attr("style", node2.style); - updateNodeBounds(node2, el); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const cylinder = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const rx = w2 / 2; - const ry = rx / (2.5 + w2 / 50); - const h = bbox.height + ry + node2.padding; - const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 a " + rx + "," + ry + " 0,0,0 " + -w2 + " 0 l 0," + h + " a " + rx + "," + ry + " 0,0,0 " + w2 + " 0 l 0," + -h; - const el = shapeSvg.attr("label-offset-y", ry).insert("path", ":first-child").attr("style", node2.style).attr("d", shape).attr("transform", "translate(" + -w2 / 2 + "," + -(h / 2 + ry) + ")"); - updateNodeBounds(node2, el); - node2.intersect = function(point2) { - const pos = intersect.rect(node2, point2); - const x2 = pos.x - node2.x; - if (rx != 0 && (Math.abs(x2) < node2.width / 2 || Math.abs(x2) == node2.width / 2 && Math.abs(pos.y - node2.y) > node2.height / 2 - ry)) { - let y2 = ry * ry * (1 - x2 * x2 / (rx * rx)); - if (y2 != 0) { - y2 = Math.sqrt(y2); - } - y2 = ry - y2; - if (point2.y - node2.y > 0) { - y2 = -y2; - } - pos.y += y2; - } - return pos; - }; - return shapeSvg; - }; - const rect$1 = async (parent, node2) => { - const { shapeSvg, bbox, halfPadding } = await labelHelper( - parent, - node2, - "node " + node2.classes + " " + node2.class, - true - ); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding; - const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding; - const x2 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding; - const y2 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding; - rect2.attr("class", "basic label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x2).attr("y", y2).attr("width", totalWidth).attr("height", totalHeight); - if (node2.props) { - const propKeys = new Set(Object.keys(node2.props)); - if (node2.props.borders) { - applyNodePropertyBorders(rect2, node2.props.borders, totalWidth, totalHeight); - propKeys.delete("borders"); - } - propKeys.forEach((propKey) => { - log$1.warn(`Unknown node property ${propKey}`); - }); - } - updateNodeBounds(node2, rect2); - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - const composite = async (parent, node2) => { - const { shapeSvg, bbox, halfPadding } = await labelHelper( - parent, - node2, - "node " + node2.classes, - true - ); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const totalWidth = node2.positioned ? node2.width : bbox.width + node2.padding; - const totalHeight = node2.positioned ? node2.height : bbox.height + node2.padding; - const x2 = node2.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding; - const y2 = node2.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding; - rect2.attr("class", "basic cluster composite label-container").attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", x2).attr("y", y2).attr("width", totalWidth).attr("height", totalHeight); - if (node2.props) { - const propKeys = new Set(Object.keys(node2.props)); - if (node2.props.borders) { - applyNodePropertyBorders(rect2, node2.props.borders, totalWidth, totalHeight); - propKeys.delete("borders"); - } - propKeys.forEach((propKey) => { - log$1.warn(`Unknown node property ${propKey}`); - }); - } - updateNodeBounds(node2, rect2); - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - const labelRect = async (parent, node2) => { - const { shapeSvg } = await labelHelper(parent, node2, "label", true); - log$1.trace("Classes = ", node2.class); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const totalWidth = 0; - const totalHeight = 0; - rect2.attr("width", totalWidth).attr("height", totalHeight); - shapeSvg.attr("class", "label edgeLabel"); - if (node2.props) { - const propKeys = new Set(Object.keys(node2.props)); - if (node2.props.borders) { - applyNodePropertyBorders(rect2, node2.props.borders, totalWidth, totalHeight); - propKeys.delete("borders"); - } - propKeys.forEach((propKey) => { - log$1.warn(`Unknown node property ${propKey}`); - }); - } - updateNodeBounds(node2, rect2); - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - function applyNodePropertyBorders(rect2, borders, totalWidth, totalHeight) { - const strokeDashArray = []; - const addBorder = (length2) => { - strokeDashArray.push(length2, 0); - }; - const skipBorder = (length2) => { - strokeDashArray.push(0, length2); - }; - if (borders.includes("t")) { - log$1.debug("add top border"); - addBorder(totalWidth); - } else { - skipBorder(totalWidth); - } - if (borders.includes("r")) { - log$1.debug("add right border"); - addBorder(totalHeight); - } else { - skipBorder(totalHeight); - } - if (borders.includes("b")) { - log$1.debug("add bottom border"); - addBorder(totalWidth); - } else { - skipBorder(totalWidth); - } - if (borders.includes("l")) { - log$1.debug("add left border"); - addBorder(totalHeight); - } else { - skipBorder(totalHeight); - } - rect2.attr("stroke-dasharray", strokeDashArray.join(" ")); - } - const rectWithTitle = (parent, node2) => { - let classes2; - if (!node2.classes) { - classes2 = "node default"; - } else { - classes2 = "node " + node2.classes; - } - const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node2.domId || node2.id); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const innerLine = shapeSvg.insert("line"); - const label = shapeSvg.insert("g").attr("class", "label"); - const text2 = node2.labelText.flat ? node2.labelText.flat() : node2.labelText; - let title2 = ""; - if (typeof text2 === "object") { - title2 = text2[0]; - } else { - title2 = text2; - } - log$1.info("Label text abc79", title2, text2, typeof text2 === "object"); - const text3 = label.node().appendChild(createLabel$1(title2, node2.labelStyle, true, true)); - let bbox = { width: 0, height: 0 }; - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = text3.children[0]; - const dv = d3select(text3); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - log$1.info("Text 2", text2); - const textRows = text2.slice(1, text2.length); - let titleBox = text3.getBBox(); - const descr = label.node().appendChild( - createLabel$1(textRows.join ? textRows.join("
    ") : textRows, node2.labelStyle, true, true) - ); - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = descr.children[0]; - const dv = d3select(descr); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - const halfPadding = node2.padding / 2; - d3select(descr).attr( - "transform", - "translate( " + // (titleBox.width - bbox.width) / 2 + - (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")" - ); - d3select(text3).attr( - "transform", - "translate( " + // (titleBox.width - bbox.width) / 2 + - (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)" - ); - bbox = label.node().getBBox(); - label.attr( - "transform", - "translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")" - ); - rect2.attr("class", "outer title-state").attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); - innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); - updateNodeBounds(node2, rect2); - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - const stadium = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const h = bbox.height + node2.padding; - const w2 = bbox.width + h / 4 + node2.padding; - const rect2 = shapeSvg.insert("rect", ":first-child").attr("style", node2.style).attr("rx", h / 2).attr("ry", h / 2).attr("x", -w2 / 2).attr("y", -h / 2).attr("width", w2).attr("height", h); - updateNodeBounds(node2, rect2); - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - const circle = async (parent, node2) => { - const { shapeSvg, bbox, halfPadding } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const circle2 = shapeSvg.insert("circle", ":first-child"); - circle2.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); - log$1.info("Circle main"); - updateNodeBounds(node2, circle2); - node2.intersect = function(point2) { - log$1.info("Circle intersect", node2, bbox.width / 2 + halfPadding, point2); - return intersect.circle(node2, bbox.width / 2 + halfPadding, point2); - }; - return shapeSvg; - }; - const doublecircle = async (parent, node2) => { - const { shapeSvg, bbox, halfPadding } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const gap = 5; - const circleGroup = shapeSvg.insert("g", ":first-child"); - const outerCircle = circleGroup.insert("circle"); - const innerCircle = circleGroup.insert("circle"); - circleGroup.attr("class", node2.class); - outerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding + gap).attr("width", bbox.width + node2.padding + gap * 2).attr("height", bbox.height + node2.padding + gap * 2); - innerCircle.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node2.padding).attr("height", bbox.height + node2.padding); - log$1.info("DoubleCircle main"); - updateNodeBounds(node2, outerCircle); - node2.intersect = function(point2) { - log$1.info("DoubleCircle intersect", node2, bbox.width / 2 + halfPadding + gap, point2); - return intersect.circle(node2, bbox.width / 2 + halfPadding + gap, point2); - }; - return shapeSvg; - }; - const subroutine = async (parent, node2) => { - const { shapeSvg, bbox } = await labelHelper( - parent, - node2, - getClassesFromNode(node2, void 0), - true - ); - const w2 = bbox.width + node2.padding; - const h = bbox.height + node2.padding; - const points = [ - { x: 0, y: 0 }, - { x: w2, y: 0 }, - { x: w2, y: -h }, - { x: 0, y: -h }, - { x: 0, y: 0 }, - { x: -8, y: 0 }, - { x: w2 + 8, y: 0 }, - { x: w2 + 8, y: -h }, - { x: -8, y: -h }, - { x: -8, y: 0 } - ]; - const el = insertPolygonShape$1(shapeSvg, w2, h, points); - el.attr("style", node2.style); - updateNodeBounds(node2, el); - node2.intersect = function(point2) { - return intersect.polygon(node2, points, point2); - }; - return shapeSvg; - }; - const start = (parent, node2) => { - const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); - const circle2 = shapeSvg.insert("circle", ":first-child"); - circle2.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); - updateNodeBounds(node2, circle2); - node2.intersect = function(point2) { - return intersect.circle(node2, 7, point2); - }; - return shapeSvg; - }; - const forkJoin = (parent, node2, dir2) => { - const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); - let width2 = 70; - let height = 10; - if (dir2 === "LR") { - width2 = 10; - height = 70; - } - const shape = shapeSvg.append("rect").attr("x", -1 * width2 / 2).attr("y", -1 * height / 2).attr("width", width2).attr("height", height).attr("class", "fork-join"); - updateNodeBounds(node2, shape); - node2.height = node2.height + node2.padding / 2; - node2.width = node2.width + node2.padding / 2; - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - const end = (parent, node2) => { - const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node2.domId || node2.id); - const innerCircle = shapeSvg.insert("circle", ":first-child"); - const circle2 = shapeSvg.insert("circle", ":first-child"); - circle2.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14); - innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10); - updateNodeBounds(node2, circle2); - node2.intersect = function(point2) { - return intersect.circle(node2, 7, point2); - }; - return shapeSvg; - }; - const class_box = (parent, node2) => { - const halfPadding = node2.padding / 2; - const rowPadding = 4; - const lineHeight = 8; - let classes2; - if (!node2.classes) { - classes2 = "node default"; - } else { - classes2 = "node " + node2.classes; + return EMPTY_STREAM; + } + var StreamImpl, EMPTY_STREAM, DONE_RESULT, TreeStreamImpl, Reduction; + var init_stream = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/stream.js"() { + "use strict"; + StreamImpl = class _StreamImpl { + static { + __name(this, "StreamImpl"); + } + constructor(startFn, nextFn) { + this.startFn = startFn; + this.nextFn = nextFn; + } + iterator() { + const iterator = { + state: this.startFn(), + next: /* @__PURE__ */ __name(() => this.nextFn(iterator.state), "next"), + [Symbol.iterator]: () => iterator + }; + return iterator; + } + [Symbol.iterator]() { + return this.iterator(); + } + isEmpty() { + const iterator = this.iterator(); + return Boolean(iterator.next().done); + } + count() { + const iterator = this.iterator(); + let count = 0; + let next3 = iterator.next(); + while (!next3.done) { + count++; + next3 = iterator.next(); + } + return count; + } + toArray() { + const result = []; + const iterator = this.iterator(); + let next3; + do { + next3 = iterator.next(); + if (next3.value !== void 0) { + result.push(next3.value); + } + } while (!next3.done); + return result; + } + toSet() { + return new Set(this); + } + toMap(keyFn, valueFn) { + const entryStream = this.map((element3) => [ + keyFn ? keyFn(element3) : element3, + valueFn ? valueFn(element3) : element3 + ]); + return new Map(entryStream); + } + toString() { + return this.join(); + } + concat(other) { + const iterator = other[Symbol.iterator](); + return new _StreamImpl(() => ({ first: this.startFn(), firstDone: false }), (state4) => { + let result; + if (!state4.firstDone) { + do { + result = this.nextFn(state4.first); + if (!result.done) { + return result; + } + } while (!result.done); + state4.firstDone = true; + } + do { + result = iterator.next(); + if (!result.done) { + return result; + } + } while (!result.done); + return DONE_RESULT; + }); + } + join(separator = ",") { + const iterator = this.iterator(); + let value2 = ""; + let result; + let addSeparator = false; + do { + result = iterator.next(); + if (!result.done) { + if (addSeparator) { + value2 += separator; + } + value2 += toString2(result.value); + } + addSeparator = true; + } while (!result.done); + return value2; + } + indexOf(searchElement, fromIndex = 0) { + const iterator = this.iterator(); + let index = 0; + let next3 = iterator.next(); + while (!next3.done) { + if (index >= fromIndex && next3.value === searchElement) { + return index; + } + next3 = iterator.next(); + index++; + } + return -1; + } + every(predicate) { + const iterator = this.iterator(); + let next3 = iterator.next(); + while (!next3.done) { + if (!predicate(next3.value)) { + return false; + } + next3 = iterator.next(); + } + return true; + } + some(predicate) { + const iterator = this.iterator(); + let next3 = iterator.next(); + while (!next3.done) { + if (predicate(next3.value)) { + return true; + } + next3 = iterator.next(); + } + return false; + } + forEach(callbackfn) { + const iterator = this.iterator(); + let index = 0; + let next3 = iterator.next(); + while (!next3.done) { + callbackfn(next3.value, index); + next3 = iterator.next(); + index++; + } + } + map(callbackfn) { + return new _StreamImpl(this.startFn, (state4) => { + const { done, value: value2 } = this.nextFn(state4); + if (done) { + return DONE_RESULT; + } else { + return { done: false, value: callbackfn(value2) }; + } + }); + } + filter(predicate) { + return new _StreamImpl(this.startFn, (state4) => { + let result; + do { + result = this.nextFn(state4); + if (!result.done && predicate(result.value)) { + return result; + } + } while (!result.done); + return DONE_RESULT; + }); + } + nonNullable() { + return this.filter((e3) => e3 !== void 0 && e3 !== null); + } + reduce(callbackfn, initialValue) { + const iterator = this.iterator(); + let previousValue = initialValue; + let next3 = iterator.next(); + while (!next3.done) { + if (previousValue === void 0) { + previousValue = next3.value; + } else { + previousValue = callbackfn(previousValue, next3.value); + } + next3 = iterator.next(); + } + return previousValue; + } + reduceRight(callbackfn, initialValue) { + return this.recursiveReduce(this.iterator(), callbackfn, initialValue); + } + recursiveReduce(iterator, callbackfn, initialValue) { + const next3 = iterator.next(); + if (next3.done) { + return initialValue; + } + const previousValue = this.recursiveReduce(iterator, callbackfn, initialValue); + if (previousValue === void 0) { + return next3.value; + } + return callbackfn(previousValue, next3.value); + } + find(predicate) { + const iterator = this.iterator(); + let next3 = iterator.next(); + while (!next3.done) { + if (predicate(next3.value)) { + return next3.value; + } + next3 = iterator.next(); + } + return void 0; + } + findIndex(predicate) { + const iterator = this.iterator(); + let index = 0; + let next3 = iterator.next(); + while (!next3.done) { + if (predicate(next3.value)) { + return index; + } + next3 = iterator.next(); + index++; + } + return -1; + } + includes(searchElement) { + const iterator = this.iterator(); + let next3 = iterator.next(); + while (!next3.done) { + if (next3.value === searchElement) { + return true; + } + next3 = iterator.next(); + } + return false; + } + flatMap(callbackfn) { + return new _StreamImpl(() => ({ this: this.startFn() }), (state4) => { + do { + if (state4.iterator) { + const next3 = state4.iterator.next(); + if (next3.done) { + state4.iterator = void 0; + } else { + return next3; + } + } + const { done, value: value2 } = this.nextFn(state4.this); + if (!done) { + const mapped = callbackfn(value2); + if (isIterable(mapped)) { + state4.iterator = mapped[Symbol.iterator](); + } else { + return { done: false, value: mapped }; + } + } + } while (state4.iterator); + return DONE_RESULT; + }); + } + flat(depth) { + if (depth === void 0) { + depth = 1; + } + if (depth <= 0) { + return this; + } + const stream2 = depth > 1 ? this.flat(depth - 1) : this; + return new _StreamImpl(() => ({ this: stream2.startFn() }), (state4) => { + do { + if (state4.iterator) { + const next3 = state4.iterator.next(); + if (next3.done) { + state4.iterator = void 0; + } else { + return next3; + } + } + const { done, value: value2 } = stream2.nextFn(state4.this); + if (!done) { + if (isIterable(value2)) { + state4.iterator = value2[Symbol.iterator](); + } else { + return { done: false, value: value2 }; + } + } + } while (state4.iterator); + return DONE_RESULT; + }); + } + head() { + const iterator = this.iterator(); + const result = iterator.next(); + if (result.done) { + return void 0; + } + return result.value; + } + tail(skipCount = 1) { + return new _StreamImpl(() => { + const state4 = this.startFn(); + for (let i2 = 0; i2 < skipCount; i2++) { + const next3 = this.nextFn(state4); + if (next3.done) { + return state4; + } + } + return state4; + }, this.nextFn); + } + limit(maxSize) { + return new _StreamImpl(() => ({ size: 0, state: this.startFn() }), (state4) => { + state4.size++; + if (state4.size > maxSize) { + return DONE_RESULT; + } + return this.nextFn(state4.state); + }); + } + distinct(by) { + const set6 = /* @__PURE__ */ new Set(); + return this.filter((e3) => { + const value2 = by ? by(e3) : e3; + if (set6.has(value2)) { + return false; + } else { + set6.add(value2); + return true; + } + }); + } + exclude(other, key) { + const otherKeySet = /* @__PURE__ */ new Set(); + for (const item of other) { + const value2 = key ? key(item) : item; + otherKeySet.add(value2); + } + return this.filter((e3) => { + const ownKey = key ? key(e3) : e3; + return !otherKeySet.has(ownKey); + }); + } + }; + __name(toString2, "toString"); + __name(isIterable, "isIterable"); + EMPTY_STREAM = new StreamImpl(() => void 0, () => DONE_RESULT); + DONE_RESULT = Object.freeze({ done: true, value: void 0 }); + __name(stream, "stream"); + TreeStreamImpl = class extends StreamImpl { + static { + __name(this, "TreeStreamImpl"); + } + constructor(root4, children2, options3) { + super(() => ({ + iterators: (options3 === null || options3 === void 0 ? void 0 : options3.includeRoot) ? [[root4][Symbol.iterator]()] : [children2(root4)[Symbol.iterator]()], + pruned: false + }), (state4) => { + if (state4.pruned) { + state4.iterators.pop(); + state4.pruned = false; + } + while (state4.iterators.length > 0) { + const iterator = state4.iterators[state4.iterators.length - 1]; + const next3 = iterator.next(); + if (next3.done) { + state4.iterators.pop(); + } else { + state4.iterators.push(children2(next3.value)[Symbol.iterator]()); + return next3; + } + } + return DONE_RESULT; + }); + } + iterator() { + const iterator = { + state: this.startFn(), + next: /* @__PURE__ */ __name(() => this.nextFn(iterator.state), "next"), + prune: /* @__PURE__ */ __name(() => { + iterator.state.pruned = true; + }, "prune"), + [Symbol.iterator]: () => iterator + }; + return iterator; + } + }; + (function(Reduction2) { + function sum2(stream2) { + return stream2.reduce((a2, b2) => a2 + b2, 0); + } + __name(sum2, "sum"); + Reduction2.sum = sum2; + function product(stream2) { + return stream2.reduce((a2, b2) => a2 * b2, 0); + } + __name(product, "product"); + Reduction2.product = product; + function min9(stream2) { + return stream2.reduce((a2, b2) => Math.min(a2, b2)); + } + __name(min9, "min"); + Reduction2.min = min9; + function max10(stream2) { + return stream2.reduce((a2, b2) => Math.max(a2, b2)); + } + __name(max10, "max"); + Reduction2.max = max10; + })(Reduction || (Reduction = {})); } - const shapeSvg = parent.insert("g").attr("class", classes2).attr("id", node2.domId || node2.id); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const topLine = shapeSvg.insert("line"); - const bottomLine = shapeSvg.insert("line"); - let maxWidth = 0; - let maxHeight = rowPadding; - const labelContainer = shapeSvg.insert("g").attr("class", "label"); - let verticalPos = 0; - const hasInterface = node2.classData.annotations && node2.classData.annotations[0]; - const interfaceLabelText = node2.classData.annotations[0] ? "«" + node2.classData.annotations[0] + "»" : ""; - const interfaceLabel = labelContainer.node().appendChild(createLabel$1(interfaceLabelText, node2.labelStyle, true, true)); - let interfaceBBox = interfaceLabel.getBBox(); - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = interfaceLabel.children[0]; - const dv = d3select(interfaceLabel); - interfaceBBox = div.getBoundingClientRect(); - dv.attr("width", interfaceBBox.width); - dv.attr("height", interfaceBBox.height); - } - if (node2.classData.annotations[0]) { - maxHeight += interfaceBBox.height + rowPadding; - maxWidth += interfaceBBox.width; - } - let classTitleString = node2.classData.label; - if (node2.classData.type !== void 0 && node2.classData.type !== "") { - if (getConfig$1().flowchart.htmlLabels) { - classTitleString += "<" + node2.classData.type + ">"; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cst-utils.js + var cst_utils_exports = {}; + __export(cst_utils_exports, { + DefaultNameRegexp: () => DefaultNameRegexp, + RangeComparison: () => RangeComparison, + compareRange: () => compareRange, + findCommentNode: () => findCommentNode, + findDeclarationNodeAtOffset: () => findDeclarationNodeAtOffset, + findLeafNodeAtOffset: () => findLeafNodeAtOffset, + findLeafNodeBeforeOffset: () => findLeafNodeBeforeOffset, + flattenCst: () => flattenCst, + getInteriorNodes: () => getInteriorNodes, + getNextNode: () => getNextNode, + getPreviousNode: () => getPreviousNode, + getStartlineNode: () => getStartlineNode, + inRange: () => inRange, + isChildNode: () => isChildNode, + isCommentNode: () => isCommentNode, + streamCst: () => streamCst, + toDocumentSegment: () => toDocumentSegment, + tokenToRange: () => tokenToRange + }); + function streamCst(node2) { + return new TreeStreamImpl(node2, (element3) => { + if (isCompositeCstNode(element3)) { + return element3.content; } else { - classTitleString += "<" + node2.classData.type + ">"; - } - } - const classTitleLabel = labelContainer.node().appendChild(createLabel$1(classTitleString, node2.labelStyle, true, true)); - d3select(classTitleLabel).attr("class", "classTitle"); - let classTitleBBox = classTitleLabel.getBBox(); - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = classTitleLabel.children[0]; - const dv = d3select(classTitleLabel); - classTitleBBox = div.getBoundingClientRect(); - dv.attr("width", classTitleBBox.width); - dv.attr("height", classTitleBBox.height); - } - maxHeight += classTitleBBox.height + rowPadding; - if (classTitleBBox.width > maxWidth) { - maxWidth = classTitleBBox.width; - } - const classAttributes = []; - node2.classData.members.forEach((member) => { - const parsedInfo = member.getDisplayDetails(); - let parsedText = parsedInfo.displayText; - if (getConfig$1().flowchart.htmlLabels) { - parsedText = parsedText.replace(//g, ">"); - } - const lbl = labelContainer.node().appendChild( - createLabel$1( - parsedText, - parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle, - true, - true - ) - ); - let bbox = lbl.getBBox(); - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = lbl.children[0]; - const dv = d3select(lbl); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - if (bbox.width > maxWidth) { - maxWidth = bbox.width; - } - maxHeight += bbox.height + rowPadding; - classAttributes.push(lbl); - }); - maxHeight += lineHeight; - const classMethods = []; - node2.classData.methods.forEach((member) => { - const parsedInfo = member.getDisplayDetails(); - let displayText = parsedInfo.displayText; - if (getConfig$1().flowchart.htmlLabels) { - displayText = displayText.replace(//g, ">"); - } - const lbl = labelContainer.node().appendChild( - createLabel$1( - displayText, - parsedInfo.cssStyle ? parsedInfo.cssStyle : node2.labelStyle, - true, - true - ) - ); - let bbox = lbl.getBBox(); - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const div = lbl.children[0]; - const dv = d3select(lbl); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); + return []; } - if (bbox.width > maxWidth) { - maxWidth = bbox.width; + }, { includeRoot: true }); + } + function flattenCst(node2) { + return streamCst(node2).filter(isLeafCstNode); + } + function isChildNode(child, parent4) { + while (child.container) { + child = child.container; + if (child === parent4) { + return true; } - maxHeight += bbox.height + rowPadding; - classMethods.push(lbl); - }); - maxHeight += lineHeight; - if (hasInterface) { - let diffX2 = (maxWidth - interfaceBBox.width) / 2; - d3select(interfaceLabel).attr( - "transform", - "translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")" - ); - verticalPos = interfaceBBox.height + rowPadding; - } - let diffX = (maxWidth - classTitleBBox.width) / 2; - d3select(classTitleLabel).attr( - "transform", - "translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")" - ); - verticalPos += classTitleBBox.height + rowPadding; - topLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos); - verticalPos += lineHeight; - classAttributes.forEach((lbl) => { - d3select(lbl).attr( - "transform", - "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")" - ); - const memberBBox = lbl == null ? void 0 : lbl.getBBox(); - verticalPos += ((memberBBox == null ? void 0 : memberBBox.height) ?? 0) + rowPadding; - }); - verticalPos += lineHeight; - bottomLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos); - verticalPos += lineHeight; - classMethods.forEach((lbl) => { - d3select(lbl).attr( - "transform", - "translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")" - ); - const memberBBox = lbl == null ? void 0 : lbl.getBBox(); - verticalPos += ((memberBBox == null ? void 0 : memberBBox.height) ?? 0) + rowPadding; - }); - rect2.attr("style", node2.style).attr("class", "outer title-state").attr("x", -maxWidth / 2 - halfPadding).attr("y", -(maxHeight / 2) - halfPadding).attr("width", maxWidth + node2.padding).attr("height", maxHeight + node2.padding); - updateNodeBounds(node2, rect2); - node2.intersect = function(point2) { - return intersect.rect(node2, point2); - }; - return shapeSvg; - }; - const shapes$1 = { - rhombus: question, - composite, - question, - rect: rect$1, - labelRect, - rectWithTitle, - choice, - circle, - doublecircle, - stadium, - hexagon, - block_arrow, - rect_left_inv_arrow, - lean_right, - lean_left, - trapezoid, - inv_trapezoid, - rect_right_inv_arrow, - cylinder, - start, - end, - note: note$1, - subroutine, - fork: forkJoin, - join: forkJoin, - class_box - }; - let nodeElems = {}; - const insertNode = async (elem, node2, dir2) => { - let newEl; - let el; - if (node2.link) { - let target; - if (getConfig$1().securityLevel === "sandbox") { - target = "_top"; - } else if (node2.linkTarget) { - target = node2.linkTarget || "_blank"; - } - newEl = elem.insert("svg:a").attr("xlink:href", node2.link).attr("target", target); - el = await shapes$1[node2.shape](newEl, node2, dir2); - } else { - el = await shapes$1[node2.shape](elem, node2, dir2); - newEl = el; - } - if (node2.tooltip) { - el.attr("title", node2.tooltip); - } - if (node2.class) { - el.attr("class", "node default " + node2.class); - } - newEl.attr("data-node", "true"); - newEl.attr("data-id", node2.id); - nodeElems[node2.id] = newEl; - if (node2.haveCallback) { - nodeElems[node2.id].attr("class", nodeElems[node2.id].attr("class") + " clickable"); } - return newEl; - }; - const setNodeElem = (elem, node2) => { - nodeElems[node2.id] = elem; - }; - const clear$j = () => { - nodeElems = {}; - }; - const positionNode$1 = (node2) => { - const el = nodeElems[node2.id]; - log$1.trace( - "Transforming node", - node2.diff, - node2, - "translate(" + (node2.x - node2.width / 2 - 5) + ", " + node2.width / 2 + ")" - ); - const padding2 = 8; - const diff = node2.diff || 0; - if (node2.clusterNode) { - el.attr( - "transform", - "translate(" + (node2.x + diff - node2.width / 2) + ", " + (node2.y - node2.height / 2 - padding2) + ")" - ); - } else { - el.attr("transform", "translate(" + node2.x + ", " + node2.y + ")"); - } - return diff; - }; - const getSubGraphTitleMargins = ({ - flowchart: flowchart2 - }) => { - var _a2, _b2; - const subGraphTitleTopMargin = ((_a2 = flowchart2 == null ? void 0 : flowchart2.subGraphTitleMargin) == null ? void 0 : _a2.top) ?? 0; - const subGraphTitleBottomMargin = ((_b2 = flowchart2 == null ? void 0 : flowchart2.subGraphTitleMargin) == null ? void 0 : _b2.bottom) ?? 0; - const subGraphTitleTotalMargin = subGraphTitleTopMargin + subGraphTitleBottomMargin; + return false; + } + function tokenToRange(token2) { return { - subGraphTitleTopMargin, - subGraphTitleBottomMargin, - subGraphTitleTotalMargin + start: { + character: token2.startColumn - 1, + line: token2.startLine - 1 + }, + end: { + character: token2.endColumn, + line: token2.endLine - 1 + } }; - }; - const rect = (parent, node2) => { - log$1.info("Creating subgraph rect for ", node2.id, node2); - const siteConfig2 = getConfig$1(); - const shapeSvg = parent.insert("g").attr("class", "cluster" + (node2.class ? " " + node2.class : "")).attr("id", node2.id); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const useHtmlLabels = evaluate(siteConfig2.flowchart.htmlLabels); - const label = shapeSvg.insert("g").attr("class", "cluster-label"); - const text2 = node2.labelType === "markdown" ? createText(label, node2.labelText, { style: node2.labelStyle, useHtmlLabels }) : label.node().appendChild(createLabel$1(node2.labelText, node2.labelStyle, void 0, true)); - let bbox = text2.getBBox(); - if (evaluate(siteConfig2.flowchart.htmlLabels)) { - const div = text2.children[0]; - const dv = d3select(text2); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - const padding2 = 0 * node2.padding; - const halfPadding = padding2 / 2; - const width2 = node2.width <= bbox.width + padding2 ? bbox.width + padding2 : node2.width; - if (node2.width <= bbox.width + padding2) { - node2.diff = (bbox.width - node2.width) / 2 - node2.padding / 2; - } else { - node2.diff = -node2.padding / 2; - } - log$1.trace("Data ", node2, JSON.stringify(node2)); - rect2.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - width2 / 2).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", width2).attr("height", node2.height + padding2); - const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2); - if (useHtmlLabels) { - label.attr( - "transform", - // This puts the label on top of the box instead of inside it - `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})` - ); - } else { - label.attr( - "transform", - // This puts the label on top of the box instead of inside it - `translate(${node2.x}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})` - ); + } + function toDocumentSegment(node2) { + if (!node2) { + return void 0; } - const rectBox = rect2.node().getBBox(); - node2.width = rectBox.width; - node2.height = rectBox.height; - node2.intersect = function(point2) { - return intersectRect$1(node2, point2); - }; - return shapeSvg; - }; - const noteGroup = (parent, node2) => { - const shapeSvg = parent.insert("g").attr("class", "note-cluster").attr("id", node2.id); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const padding2 = 0 * node2.padding; - const halfPadding = padding2 / 2; - rect2.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", node2.width + padding2).attr("height", node2.height + padding2).attr("fill", "none"); - const rectBox = rect2.node().getBBox(); - node2.width = rectBox.width; - node2.height = rectBox.height; - node2.intersect = function(point2) { - return intersectRect$1(node2, point2); + const { offset, end: end2, range: range3 } = node2; + return { + range: range3, + offset, + end: end2, + length: end2 - offset }; - return shapeSvg; - }; - const roundedWithTitle = (parent, node2) => { - const siteConfig2 = getConfig$1(); - const shapeSvg = parent.insert("g").attr("class", node2.classes).attr("id", node2.id); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const label = shapeSvg.insert("g").attr("class", "cluster-label"); - const innerRect = shapeSvg.append("rect"); - const text2 = label.node().appendChild(createLabel$1(node2.labelText, node2.labelStyle, void 0, true)); - let bbox = text2.getBBox(); - if (evaluate(siteConfig2.flowchart.htmlLabels)) { - const div = text2.children[0]; - const dv = d3select(text2); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - bbox = text2.getBBox(); - const padding2 = 0 * node2.padding; - const halfPadding = padding2 / 2; - const width2 = node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width; - if (node2.width <= bbox.width + node2.padding) { - node2.diff = (bbox.width + node2.padding * 0 - node2.width) / 2; + } + function compareRange(range3, to) { + if (range3.end.line < to.start.line || range3.end.line === to.start.line && range3.end.character < range3.start.character) { + return RangeComparison.Before; + } else if (range3.start.line > to.end.line || range3.start.line === to.end.line && range3.start.character > to.end.character) { + return RangeComparison.After; + } + const startInside = range3.start.line > to.start.line || range3.start.line === to.start.line && range3.start.character >= to.start.character; + const endInside = range3.end.line < to.end.line || range3.end.line === to.end.line && range3.end.character <= to.end.character; + if (startInside && endInside) { + return RangeComparison.Inside; + } else if (startInside) { + return RangeComparison.OverlapBack; } else { - node2.diff = -node2.padding / 2; - } - rect2.attr("class", "outer").attr("x", node2.x - width2 / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", width2 + padding2).attr("height", node2.height + padding2); - innerRect.attr("class", "inner").attr("x", node2.x - width2 / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding + bbox.height - 1).attr("width", width2 + padding2).attr("height", node2.height + padding2 - bbox.height - 3); - const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2); - label.attr( - "transform", - `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 - node2.padding / 3 + (evaluate(siteConfig2.flowchart.htmlLabels) ? 5 : 3) + subGraphTitleTopMargin})` - ); - const rectBox = rect2.node().getBBox(); - node2.height = rectBox.height; - node2.intersect = function(point2) { - return intersectRect$1(node2, point2); - }; - return shapeSvg; - }; - const divider = (parent, node2) => { - const shapeSvg = parent.insert("g").attr("class", node2.classes).attr("id", node2.id); - const rect2 = shapeSvg.insert("rect", ":first-child"); - const padding2 = 0 * node2.padding; - const halfPadding = padding2 / 2; - rect2.attr("class", "divider").attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2).attr("width", node2.width + padding2).attr("height", node2.height + padding2); - const rectBox = rect2.node().getBBox(); - node2.width = rectBox.width; - node2.height = rectBox.height; - node2.diff = -node2.padding / 2; - node2.intersect = function(point2) { - return intersectRect$1(node2, point2); - }; - return shapeSvg; - }; - const shapes = { rect, roundedWithTitle, noteGroup, divider }; - let clusterElems = {}; - const insertCluster = (elem, node2) => { - log$1.trace("Inserting cluster"); - const shape = node2.shape || "rect"; - clusterElems[node2.id] = shapes[shape](elem, node2); - }; - const clear$i = () => { - clusterElems = {}; - }; - const markerOffsets = { - aggregation: 18, - extension: 18, - composition: 18, - dependency: 6, - lollipop: 13.5, - arrow_point: 5.3 - }; - function calculateDeltaAndAngle(point1, point2) { - if (point1 === void 0 || point2 === void 0) { - return { angle: 0, deltaX: 0, deltaY: 0 }; + return RangeComparison.OverlapFront; } - point1 = pointTransformer(point1); - point2 = pointTransformer(point2); - const [x1, y1] = [point1.x, point1.y]; - const [x2, y2] = [point2.x, point2.y]; - const deltaX = x2 - x1; - const deltaY = y2 - y1; - return { angle: Math.atan(deltaY / deltaX), deltaX, deltaY }; } - const pointTransformer = (data) => { - if (Array.isArray(data)) { - return { x: data[0], y: data[1] }; - } - return data; - }; - const getLineFunctionsWithOffset = (edge) => { - return { - x: function(d, i2, data) { - let offset = 0; - if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) { - const { angle, deltaX } = calculateDeltaAndAngle(data[0], data[1]); - offset = markerOffsets[edge.arrowTypeStart] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1); - } else if (i2 === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) { - const { angle, deltaX } = calculateDeltaAndAngle( - data[data.length - 1], - data[data.length - 2] - ); - offset = markerOffsets[edge.arrowTypeEnd] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1); - } - return pointTransformer(d).x + offset; - }, - y: function(d, i2, data) { - let offset = 0; - if (i2 === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) { - const { angle, deltaY } = calculateDeltaAndAngle(data[0], data[1]); - offset = markerOffsets[edge.arrowTypeStart] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1); - } else if (i2 === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) { - const { angle, deltaY } = calculateDeltaAndAngle( - data[data.length - 1], - data[data.length - 2] - ); - offset = markerOffsets[edge.arrowTypeEnd] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1); + function inRange(range3, to) { + const comparison = compareRange(range3, to); + return comparison > RangeComparison.After; + } + function findDeclarationNodeAtOffset(cstNode, offset, nameRegexp = DefaultNameRegexp) { + if (cstNode) { + if (offset > 0) { + const localOffset = offset - cstNode.offset; + const textAtOffset = cstNode.text.charAt(localOffset); + if (!nameRegexp.test(textAtOffset)) { + offset--; } - return pointTransformer(d).y + offset; } - }; - }; - const addEdgeMarkers = (svgPath, edge, url, id2, diagramType) => { - if (edge.arrowTypeStart) { - addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id2, diagramType); - } - if (edge.arrowTypeEnd) { - addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id2, diagramType); - } - }; - const arrowTypesMap = { - arrow_cross: "cross", - arrow_point: "point", - arrow_barb: "barb", - arrow_circle: "circle", - aggregation: "aggregation", - extension: "extension", - composition: "composition", - dependency: "dependency", - lollipop: "lollipop" - }; - const addEdgeMarker = (svgPath, position2, arrowType, url, id2, diagramType) => { - const endMarkerType = arrowTypesMap[arrowType]; - if (!endMarkerType) { - log$1.warn(`Unknown arrow type: ${arrowType}`); - return; - } - const suffix = position2 === "start" ? "Start" : "End"; - svgPath.attr(`marker-${position2}`, `url(${url}#${id2}_${diagramType}-${endMarkerType}${suffix})`); - }; - let edgeLabels = {}; - let terminalLabels = {}; - const clear$h = () => { - edgeLabels = {}; - terminalLabels = {}; - }; - const insertEdgeLabel = (elem, edge) => { - const useHtmlLabels = evaluate(getConfig$1().flowchart.htmlLabels); - const labelElement = edge.labelType === "markdown" ? createText(elem, edge.label, { - style: edge.labelStyle, - useHtmlLabels, - addSvgBackground: true - }) : createLabel$1(edge.label, edge.labelStyle); - const edgeLabel = elem.insert("g").attr("class", "edgeLabel"); - const label = edgeLabel.insert("g").attr("class", "label"); - label.node().appendChild(labelElement); - let bbox = labelElement.getBBox(); - if (useHtmlLabels) { - const div = labelElement.children[0]; - const dv = d3select(labelElement); - bbox = div.getBoundingClientRect(); - dv.attr("width", bbox.width); - dv.attr("height", bbox.height); - } - label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); - edgeLabels[edge.id] = edgeLabel; - edge.width = bbox.width; - edge.height = bbox.height; - let fo; - if (edge.startLabelLeft) { - const startLabelElement = createLabel$1(edge.startLabelLeft, edge.labelStyle); - const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); - const inner2 = startEdgeLabelLeft.insert("g").attr("class", "inner"); - fo = inner2.node().appendChild(startLabelElement); - const slBox = startLabelElement.getBBox(); - inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); - if (!terminalLabels[edge.id]) { - terminalLabels[edge.id] = {}; - } - terminalLabels[edge.id].startLeft = startEdgeLabelLeft; - setTerminalWidth(fo, edge.startLabelLeft); - } - if (edge.startLabelRight) { - const startLabelElement = createLabel$1(edge.startLabelRight, edge.labelStyle); - const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); - const inner2 = startEdgeLabelRight.insert("g").attr("class", "inner"); - fo = startEdgeLabelRight.node().appendChild(startLabelElement); - inner2.node().appendChild(startLabelElement); - const slBox = startLabelElement.getBBox(); - inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); - if (!terminalLabels[edge.id]) { - terminalLabels[edge.id] = {}; - } - terminalLabels[edge.id].startRight = startEdgeLabelRight; - setTerminalWidth(fo, edge.startLabelRight); - } - if (edge.endLabelLeft) { - const endLabelElement = createLabel$1(edge.endLabelLeft, edge.labelStyle); - const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); - const inner2 = endEdgeLabelLeft.insert("g").attr("class", "inner"); - fo = inner2.node().appendChild(endLabelElement); - const slBox = endLabelElement.getBBox(); - inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); - endEdgeLabelLeft.node().appendChild(endLabelElement); - if (!terminalLabels[edge.id]) { - terminalLabels[edge.id] = {}; - } - terminalLabels[edge.id].endLeft = endEdgeLabelLeft; - setTerminalWidth(fo, edge.endLabelLeft); - } - if (edge.endLabelRight) { - const endLabelElement = createLabel$1(edge.endLabelRight, edge.labelStyle); - const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); - const inner2 = endEdgeLabelRight.insert("g").attr("class", "inner"); - fo = inner2.node().appendChild(endLabelElement); - const slBox = endLabelElement.getBBox(); - inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); - endEdgeLabelRight.node().appendChild(endLabelElement); - if (!terminalLabels[edge.id]) { - terminalLabels[edge.id] = {}; - } - terminalLabels[edge.id].endRight = endEdgeLabelRight; - setTerminalWidth(fo, edge.endLabelRight); - } - return labelElement; - }; - function setTerminalWidth(fo, value2) { - if (getConfig$1().flowchart.htmlLabels && fo) { - fo.style.width = value2.length * 9 + "px"; - fo.style.height = "12px"; + return findLeafNodeAtOffset(cstNode, offset); } + return void 0; } - const positionEdgeLabel = (edge, paths) => { - log$1.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels[edge.id], paths); - let path2 = paths.updatedPath ? paths.updatedPath : paths.originalPath; - const siteConfig2 = getConfig$1(); - const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2); - if (edge.label) { - const el = edgeLabels[edge.id]; - let x2 = edge.x; - let y2 = edge.y; - if (path2) { - const pos = utils$1.calcLabelPosition(path2); - log$1.debug( - "Moving label " + edge.label + " from (", - x2, - ",", - y2, - ") to (", - pos.x, - ",", - pos.y, - ") abc88" - ); - if (paths.updatedPath) { - x2 = pos.x; - y2 = pos.y; - } - } - el.attr("transform", `translate(${x2}, ${y2 + subGraphTitleTotalMargin / 2})`); - } - if (edge.startLabelLeft) { - const el = terminalLabels[edge.id].startLeft; - let x2 = edge.x; - let y2 = edge.y; - if (path2) { - const pos = utils$1.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path2); - x2 = pos.x; - y2 = pos.y; - } - el.attr("transform", `translate(${x2}, ${y2})`); - } - if (edge.startLabelRight) { - const el = terminalLabels[edge.id].startRight; - let x2 = edge.x; - let y2 = edge.y; - if (path2) { - const pos = utils$1.calcTerminalLabelPosition( - edge.arrowTypeStart ? 10 : 0, - "start_right", - path2 - ); - x2 = pos.x; - y2 = pos.y; + function findCommentNode(cstNode, commentNames) { + if (cstNode) { + const previous = getPreviousNode(cstNode, true); + if (previous && isCommentNode(previous, commentNames)) { + return previous; + } + if (isRootCstNode(cstNode)) { + const endIndex = cstNode.content.findIndex((e3) => !e3.hidden); + for (let i2 = endIndex - 1; i2 >= 0; i2--) { + const child = cstNode.content[i2]; + if (isCommentNode(child, commentNames)) { + return child; + } + } } - el.attr("transform", `translate(${x2}, ${y2})`); } - if (edge.endLabelLeft) { - const el = terminalLabels[edge.id].endLeft; - let x2 = edge.x; - let y2 = edge.y; - if (path2) { - const pos = utils$1.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path2); - x2 = pos.x; - y2 = pos.y; + return void 0; + } + function isCommentNode(cstNode, commentNames) { + return isLeafCstNode(cstNode) && commentNames.includes(cstNode.tokenType.name); + } + function findLeafNodeAtOffset(node2, offset) { + if (isLeafCstNode(node2)) { + return node2; + } else if (isCompositeCstNode(node2)) { + const searchResult = binarySearch(node2, offset, false); + if (searchResult) { + return findLeafNodeAtOffset(searchResult, offset); } - el.attr("transform", `translate(${x2}, ${y2})`); } - if (edge.endLabelRight) { - const el = terminalLabels[edge.id].endRight; - let x2 = edge.x; - let y2 = edge.y; - if (path2) { - const pos = utils$1.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path2); - x2 = pos.x; - y2 = pos.y; + return void 0; + } + function findLeafNodeBeforeOffset(node2, offset) { + if (isLeafCstNode(node2)) { + return node2; + } else if (isCompositeCstNode(node2)) { + const searchResult = binarySearch(node2, offset, true); + if (searchResult) { + return findLeafNodeBeforeOffset(searchResult, offset); } - el.attr("transform", `translate(${x2}, ${y2})`); - } - }; - const outsideNode = (node2, point2) => { - const x2 = node2.x; - const y2 = node2.y; - const dx = Math.abs(point2.x - x2); - const dy = Math.abs(point2.y - y2); - const w2 = node2.width / 2; - const h = node2.height / 2; - if (dx >= w2 || dy >= h) { - return true; } - return false; - }; - const intersection = (node2, outsidePoint, insidePoint) => { - log$1.debug(`intersection calc abc89: - outsidePoint: ${JSON.stringify(outsidePoint)} - insidePoint : ${JSON.stringify(insidePoint)} - node : x:${node2.x} y:${node2.y} w:${node2.width} h:${node2.height}`); - const x2 = node2.x; - const y2 = node2.y; - const dx = Math.abs(x2 - insidePoint.x); - const w2 = node2.width / 2; - let r = insidePoint.x < outsidePoint.x ? w2 - dx : w2 + dx; - const h = node2.height / 2; - const Q = Math.abs(outsidePoint.y - insidePoint.y); - const R = Math.abs(outsidePoint.x - insidePoint.x); - if (Math.abs(y2 - outsidePoint.y) * w2 > Math.abs(x2 - outsidePoint.x) * h) { - let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y2 : y2 - h - outsidePoint.y; - r = R * q / Q; - const res = { - x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r, - y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q - }; - if (r === 0) { - res.x = outsidePoint.x; - res.y = outsidePoint.y; - } - if (R === 0) { - res.x = outsidePoint.x; - } - if (Q === 0) { - res.y = outsidePoint.y; - } - log$1.debug(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res); - return res; - } else { - if (insidePoint.x < outsidePoint.x) { - r = outsidePoint.x - w2 - x2; + return void 0; + } + function binarySearch(node2, offset, closest) { + let left3 = 0; + let right3 = node2.content.length - 1; + let closestNode = void 0; + while (left3 <= right3) { + const middle = Math.floor((left3 + right3) / 2); + const middleNode = node2.content[middle]; + if (middleNode.offset <= offset && middleNode.end > offset) { + return middleNode; + } + if (middleNode.end <= offset) { + closestNode = closest ? middleNode : void 0; + left3 = middle + 1; } else { - r = x2 - w2 - outsidePoint.x; - } - let q = Q * r / R; - let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r; - let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q; - log$1.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y }); - if (r === 0) { - _x = outsidePoint.x; - _y = outsidePoint.y; - } - if (R === 0) { - _x = outsidePoint.x; + right3 = middle - 1; } - if (Q === 0) { - _y = outsidePoint.y; - } - return { x: _x, y: _y }; } - }; - const cutPathAtIntersect = (_points, boundaryNode) => { - log$1.debug("abc88 cutPathAtIntersect", _points, boundaryNode); - let points = []; - let lastPointOutside = _points[0]; - let isInside = false; - _points.forEach((point2) => { - if (!outsideNode(boundaryNode, point2) && !isInside) { - const inter = intersection(boundaryNode, lastPointOutside, point2); - let pointPresent = false; - points.forEach((p) => { - pointPresent = pointPresent || p.x === inter.x && p.y === inter.y; - }); - if (!points.some((e) => e.x === inter.x && e.y === inter.y)) { - points.push(inter); - } - isInside = true; - } else { - lastPointOutside = point2; - if (!isInside) { - points.push(point2); + return closestNode; + } + function getPreviousNode(node2, hidden = true) { + while (node2.container) { + const parent4 = node2.container; + let index = parent4.content.indexOf(node2); + while (index > 0) { + index--; + const previous = parent4.content[index]; + if (hidden || !previous.hidden) { + return previous; } } - }); - return points; - }; - const insertEdge$1 = function(elem, e, edge, clusterDb2, diagramType, graph, id2) { - let points = edge.points; - log$1.debug("abc88 InsertEdge: edge=", edge, "e=", e); - let pointsHasChanged = false; - const tail = graph.node(e.v); - var head2 = graph.node(e.w); - if ((head2 == null ? void 0 : head2.intersect) && (tail == null ? void 0 : tail.intersect)) { - points = points.slice(1, edge.points.length - 1); - points.unshift(tail.intersect(points[0])); - points.push(head2.intersect(points[points.length - 1])); - } - if (edge.toCluster) { - log$1.debug("to cluster abc88", clusterDb2[edge.toCluster]); - points = cutPathAtIntersect(edge.points, clusterDb2[edge.toCluster].node); - pointsHasChanged = true; - } - if (edge.fromCluster) { - log$1.debug("from cluster abc88", clusterDb2[edge.fromCluster]); - points = cutPathAtIntersect(points.reverse(), clusterDb2[edge.fromCluster].node).reverse(); - pointsHasChanged = true; - } - const lineData = points.filter((p) => !Number.isNaN(p.y)); - let curve = curveBasis; - if (edge.curve && (diagramType === "graph" || diagramType === "flowchart")) { - curve = edge.curve; - } - const { x: x2, y: y2 } = getLineFunctionsWithOffset(edge); - const lineFunction = line$1().x(x2).y(y2).curve(curve); - let strokeClasses; - switch (edge.thickness) { - case "normal": - strokeClasses = "edge-thickness-normal"; - break; - case "thick": - strokeClasses = "edge-thickness-thick"; - break; - case "invisible": - strokeClasses = "edge-thickness-thick"; - break; - default: - strokeClasses = ""; + node2 = parent4; } - switch (edge.pattern) { - case "solid": - strokeClasses += " edge-pattern-solid"; - break; - case "dotted": - strokeClasses += " edge-pattern-dotted"; - break; - case "dashed": - strokeClasses += " edge-pattern-dashed"; - break; - } - const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style); - let url = ""; - if (getConfig$1().flowchart.arrowMarkerAbsolute || getConfig$1().state.arrowMarkerAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, "\\("); - url = url.replace(/\)/g, "\\)"); + return void 0; + } + function getNextNode(node2, hidden = true) { + while (node2.container) { + const parent4 = node2.container; + let index = parent4.content.indexOf(node2); + const last3 = parent4.content.length - 1; + while (index < last3) { + index++; + const next3 = parent4.content[index]; + if (hidden || !next3.hidden) { + return next3; + } + } + node2 = parent4; } - addEdgeMarkers(svgPath, edge, url, id2, diagramType); - let paths = {}; - if (pointsHasChanged) { - paths.updatedPath = points; + return void 0; + } + function getStartlineNode(node2) { + if (node2.range.start.character === 0) { + return node2; } - paths.originalPath = edge.points; - return paths; - }; - const recursiveRender = async (_elem, graph, diagramType, id2, parentCluster, siteConfig2) => { - log$1.info("Graph in recursive render: XXX", write(graph), parentCluster); - const dir2 = graph.graph().rankdir; - log$1.trace("Dir in recursive render - dir:", dir2); - const elem = _elem.insert("g").attr("class", "root"); - if (!graph.nodes()) { - log$1.info("No nodes found for", graph); - } else { - log$1.info("Recursive render XXX", graph.nodes()); - } - if (graph.edges().length > 0) { - log$1.trace("Recursive edges", graph.edge(graph.edges()[0])); - } - const clusters = elem.insert("g").attr("class", "clusters"); - const edgePaths = elem.insert("g").attr("class", "edgePaths"); - const edgeLabels2 = elem.insert("g").attr("class", "edgeLabels"); - const nodes2 = elem.insert("g").attr("class", "nodes"); - await Promise.all( - graph.nodes().map(async function(v) { - const node2 = graph.node(v); - if (parentCluster !== void 0) { - const data = JSON.parse(JSON.stringify(parentCluster.clusterData)); - log$1.info("Setting data for cluster XXX (", v, ") ", data, parentCluster); - graph.setNode(parentCluster.id, data); - if (!graph.parent(v)) { - log$1.trace("Setting parent", v, parentCluster.id); - graph.setParent(v, parentCluster.id, data); - } - } - log$1.info("(Insert) Node XXX" + v + ": " + JSON.stringify(graph.node(v))); - if (node2 && node2.clusterNode) { - log$1.info("Cluster identified", v, node2.width, graph.node(v)); - const o = await recursiveRender( - nodes2, - node2.graph, - diagramType, - id2, - graph.node(v), - siteConfig2 - ); - const newEl = o.elem; - updateNodeBounds(node2, newEl); - node2.diff = o.diff || 0; - log$1.info("Node bounds (abc123)", v, node2, node2.width, node2.x, node2.y); - setNodeElem(newEl, node2); - log$1.warn("Recursive render complete ", newEl, node2); - } else { - if (graph.children(v).length > 0) { - log$1.info("Cluster - the non recursive path XXX", v, node2.id, node2, graph); - log$1.info(findNonClusterChild(node2.id, graph)); - clusterDb[node2.id] = { id: findNonClusterChild(node2.id, graph), node: node2 }; - } else { - log$1.info("Node - the non recursive path", v, node2.id, node2); - await insertNode(nodes2, graph.node(v), dir2); - } - } - }) - ); - graph.edges().forEach(function(e) { - const edge = graph.edge(e.v, e.w, e.name); - log$1.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)); - log$1.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(graph.edge(e))); - log$1.info("Fix", clusterDb, "ids:", e.v, e.w, "Translating: ", clusterDb[e.v], clusterDb[e.w]); - insertEdgeLabel(edgeLabels2, edge); - }); - graph.edges().forEach(function(e) { - log$1.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)); - }); - log$1.info("#############################################"); - log$1.info("### Layout ###"); - log$1.info("#############################################"); - log$1.info(graph); - layout$1(graph); - log$1.info("Graph after layout:", write(graph)); - let diff = 0; - const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2); - sortNodesByHierarchy(graph).forEach(function(v) { - const node2 = graph.node(v); - log$1.info("Position " + v + ": " + JSON.stringify(graph.node(v))); - log$1.info( - "Position " + v + ": (" + node2.x, - "," + node2.y, - ") width: ", - node2.width, - " height: ", - node2.height - ); - if (node2 && node2.clusterNode) { - node2.y += subGraphTitleTotalMargin; - positionNode$1(node2); + const line2 = node2.range.start.line; + let last3 = node2; + let index; + while (node2.container) { + const parent4 = node2.container; + const selfIndex = index !== null && index !== void 0 ? index : parent4.content.indexOf(node2); + if (selfIndex === 0) { + node2 = parent4; + index = void 0; } else { - if (graph.children(v).length > 0) { - node2.height += subGraphTitleTotalMargin; - insertCluster(clusters, node2); - clusterDb[node2.id].node = node2; - } else { - node2.y += subGraphTitleTotalMargin / 2; - positionNode$1(node2); - } + index = selfIndex - 1; + node2 = parent4.content[index]; } - }); - graph.edges().forEach(function(e) { - const edge = graph.edge(e); - log$1.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(edge), edge); - edge.points.forEach((point2) => point2.y += subGraphTitleTotalMargin / 2); - const paths = insertEdge$1(edgePaths, e, edge, clusterDb, diagramType, graph, id2); - positionEdgeLabel(edge, paths); - }); - graph.nodes().forEach(function(v) { - const n = graph.node(v); - log$1.info(v, n.type, n.diff); - if (n.type === "group") { - diff = n.diff; + if (node2.range.start.line !== line2) { + break; } - }); - return { elem, diff }; - }; - const render = async (elem, graph, markers2, diagramType, id2) => { - insertMarkers$4(elem, markers2, diagramType, id2); - clear$j(); - clear$h(); - clear$i(); - clear$k(); - log$1.warn("Graph at first:", JSON.stringify(write(graph))); - adjustClustersAndEdges(graph); - log$1.warn("Graph after:", JSON.stringify(write(graph))); - const siteConfig2 = getConfig$1(); - await recursiveRender(elem, graph, diagramType, id2, void 0, siteConfig2); - }; - const conf$7 = {}; - const setConf$7 = function(cnf) { - const keys2 = Object.keys(cnf); - for (const key of keys2) { - conf$7[key] = cnf[key]; + last3 = node2; } - }; - const addVertices$1 = async function(vert, g, svgId, root2, doc, diagObj) { - const svg2 = root2.select(`[id="${svgId}"]`); - const keys2 = Object.keys(vert); - for (const id2 of keys2) { - const vertex = vert[id2]; - let classStr = "default"; - if (vertex.classes.length > 0) { - classStr = vertex.classes.join(" "); - } - classStr = classStr + " flowchart-label"; - const styles2 = getStylesFromArray(vertex.styles); - let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id; - let vertexNode; - log$1.info("vertex", vertex, vertex.labelType); - if (vertex.labelType === "markdown") { - log$1.info("vertex", vertex, vertex.labelType); + return last3; + } + function getInteriorNodes(start3, end2) { + const commonParent = getCommonParent(start3, end2); + if (!commonParent) { + return []; + } + return commonParent.parent.content.slice(commonParent.a + 1, commonParent.b); + } + function getCommonParent(a2, b2) { + const aParents = getParentChain(a2); + const bParents = getParentChain(b2); + let current; + for (let i2 = 0; i2 < aParents.length && i2 < bParents.length; i2++) { + const aParent = aParents[i2]; + const bParent = bParents[i2]; + if (aParent.parent === bParent.parent) { + current = { + parent: aParent.parent, + a: aParent.index, + b: bParent.index + }; } else { - if (evaluate(getConfig$1().flowchart.htmlLabels)) { - const node2 = { - label: vertexText - }; - vertexNode = addHtmlLabel$1(svg2, node2).node(); - vertexNode.parentNode.removeChild(vertexNode); - } else { - const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text"); - svgLabel.setAttribute("style", styles2.labelStyle.replace("color:", "fill:")); - const rows = vertexText.split(common$1.lineBreakRegex); - for (const row of rows) { - const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan"); - tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); - tspan.setAttribute("dy", "1em"); - tspan.setAttribute("x", "1"); - tspan.textContent = row; - svgLabel.appendChild(tspan); - } - vertexNode = svgLabel; - } + break; } - let radius = 0; - let _shape = ""; - switch (vertex.type) { - case "round": - radius = 5; - _shape = "rect"; - break; - case "square": - _shape = "rect"; - break; - case "diamond": - _shape = "question"; - break; - case "hexagon": - _shape = "hexagon"; - break; - case "odd": - _shape = "rect_left_inv_arrow"; - break; - case "lean_right": - _shape = "lean_right"; - break; - case "lean_left": - _shape = "lean_left"; - break; - case "trapezoid": - _shape = "trapezoid"; - break; - case "inv_trapezoid": - _shape = "inv_trapezoid"; - break; - case "odd_right": - _shape = "rect_left_inv_arrow"; - break; - case "circle": - _shape = "circle"; - break; - case "ellipse": - _shape = "ellipse"; - break; - case "stadium": - _shape = "stadium"; - break; - case "subroutine": - _shape = "subroutine"; - break; - case "cylinder": - _shape = "cylinder"; - break; - case "group": - _shape = "rect"; - break; - case "doublecircle": - _shape = "doublecircle"; - break; - default: - _shape = "rect"; - } - const labelText = await renderKatex(vertexText, getConfig$1()); - g.setNode(vertex.id, { - labelStyle: styles2.labelStyle, - shape: _shape, - labelText, - labelType: vertex.labelType, - rx: radius, - ry: radius, - class: classStr, - style: styles2.style, - id: vertex.id, - link: vertex.link, - linkTarget: vertex.linkTarget, - tooltip: diagObj.db.getTooltip(vertex.id) || "", - domId: diagObj.db.lookUpDomId(vertex.id), - haveCallback: vertex.haveCallback, - width: vertex.type === "group" ? 500 : void 0, - dir: vertex.dir, - type: vertex.type, - props: vertex.props, - padding: getConfig$1().flowchart.padding - }); - log$1.info("setNode", { - labelStyle: styles2.labelStyle, - labelType: vertex.labelType, - shape: _shape, - labelText, - rx: radius, - ry: radius, - class: classStr, - style: styles2.style, - id: vertex.id, - domId: diagObj.db.lookUpDomId(vertex.id), - width: vertex.type === "group" ? 500 : void 0, - type: vertex.type, - dir: vertex.dir, - props: vertex.props, - padding: getConfig$1().flowchart.padding + } + return current; + } + function getParentChain(node2) { + const chain = []; + while (node2.container) { + const parent4 = node2.container; + const index = parent4.content.indexOf(node2); + chain.push({ + parent: parent4, + index }); + node2 = parent4; + } + return chain.reverse(); + } + var RangeComparison, DefaultNameRegexp; + var init_cst_utils = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cst-utils.js"() { + "use strict"; + init_syntax_tree(); + init_stream(); + __name(streamCst, "streamCst"); + __name(flattenCst, "flattenCst"); + __name(isChildNode, "isChildNode"); + __name(tokenToRange, "tokenToRange"); + __name(toDocumentSegment, "toDocumentSegment"); + (function(RangeComparison2) { + RangeComparison2[RangeComparison2["Before"] = 0] = "Before"; + RangeComparison2[RangeComparison2["After"] = 1] = "After"; + RangeComparison2[RangeComparison2["OverlapFront"] = 2] = "OverlapFront"; + RangeComparison2[RangeComparison2["OverlapBack"] = 3] = "OverlapBack"; + RangeComparison2[RangeComparison2["Inside"] = 4] = "Inside"; + })(RangeComparison || (RangeComparison = {})); + __name(compareRange, "compareRange"); + __name(inRange, "inRange"); + DefaultNameRegexp = /^[\w\p{L}]$/u; + __name(findDeclarationNodeAtOffset, "findDeclarationNodeAtOffset"); + __name(findCommentNode, "findCommentNode"); + __name(isCommentNode, "isCommentNode"); + __name(findLeafNodeAtOffset, "findLeafNodeAtOffset"); + __name(findLeafNodeBeforeOffset, "findLeafNodeBeforeOffset"); + __name(binarySearch, "binarySearch"); + __name(getPreviousNode, "getPreviousNode"); + __name(getNextNode, "getNextNode"); + __name(getStartlineNode, "getStartlineNode"); + __name(getInteriorNodes, "getInteriorNodes"); + __name(getCommonParent, "getCommonParent"); + __name(getParentChain, "getParentChain"); } - }; - const addEdges$1 = async function(edges2, g, diagObj) { - log$1.info("abc78 edges = ", edges2); - let cnt2 = 0; - let linkIdCnt = {}; - let defaultStyle2; - let defaultLabelStyle; - if (edges2.defaultStyle !== void 0) { - const defaultStyles = getStylesFromArray(edges2.defaultStyle); - defaultStyle2 = defaultStyles.style; - defaultLabelStyle = defaultStyles.labelStyle; - } - for (const edge of edges2) { - cnt2++; - const linkIdBase = "L-" + edge.start + "-" + edge.end; - if (linkIdCnt[linkIdBase] === void 0) { - linkIdCnt[linkIdBase] = 0; - log$1.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]); - } else { - linkIdCnt[linkIdBase]++; - log$1.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]); - } - let linkId = linkIdBase + "-" + linkIdCnt[linkIdBase]; - log$1.info("abc78 new link id to be used is", linkIdBase, linkId, linkIdCnt[linkIdBase]); - const linkNameStart = "LS-" + edge.start; - const linkNameEnd = "LE-" + edge.end; - const edgeData = { style: "", labelStyle: "" }; - edgeData.minlen = edge.length || 1; - if (edge.type === "arrow_open") { - edgeData.arrowhead = "none"; - } else { - edgeData.arrowhead = "normal"; - } - edgeData.arrowTypeStart = "arrow_open"; - edgeData.arrowTypeEnd = "arrow_open"; - switch (edge.type) { - case "double_arrow_cross": - edgeData.arrowTypeStart = "arrow_cross"; - case "arrow_cross": - edgeData.arrowTypeEnd = "arrow_cross"; - break; - case "double_arrow_point": - edgeData.arrowTypeStart = "arrow_point"; - case "arrow_point": - edgeData.arrowTypeEnd = "arrow_point"; - break; - case "double_arrow_circle": - edgeData.arrowTypeStart = "arrow_circle"; - case "arrow_circle": - edgeData.arrowTypeEnd = "arrow_circle"; - break; - } - let style = ""; - let labelStyle = ""; - switch (edge.stroke) { - case "normal": - style = "fill:none;"; - if (defaultStyle2 !== void 0) { - style = defaultStyle2; - } - if (defaultLabelStyle !== void 0) { - labelStyle = defaultLabelStyle; - } - edgeData.thickness = "normal"; - edgeData.pattern = "solid"; - break; - case "dotted": - edgeData.thickness = "normal"; - edgeData.pattern = "dotted"; - edgeData.style = "fill:none;stroke-width:2px;stroke-dasharray:3;"; - break; - case "thick": - edgeData.thickness = "thick"; - edgeData.pattern = "solid"; - edgeData.style = "stroke-width: 3.5px;fill:none;"; - break; - case "invisible": - edgeData.thickness = "invisible"; - edgeData.pattern = "solid"; - edgeData.style = "stroke-width: 0;fill:none;"; - break; - } - if (edge.style !== void 0) { - const styles2 = getStylesFromArray(edge.style); - style = styles2.style; - labelStyle = styles2.labelStyle; - } - edgeData.style = edgeData.style += style; - edgeData.labelStyle = edgeData.labelStyle += labelStyle; - if (edge.interpolate !== void 0) { - edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear); - } else if (edges2.defaultInterpolate !== void 0) { - edgeData.curve = interpolateToCurve(edges2.defaultInterpolate, curveLinear); - } else { - edgeData.curve = interpolateToCurve(conf$7.curve, curveLinear); - } - if (edge.text === void 0) { - if (edge.style !== void 0) { - edgeData.arrowheadStyle = "fill: #333"; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/errors.js + function assertUnreachable(_2) { + throw new Error("Error! The input value was not handled."); + } + var ErrorWithLocation; + var init_errors2 = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/errors.js"() { + "use strict"; + ErrorWithLocation = class extends Error { + static { + __name(this, "ErrorWithLocation"); } - } else { - edgeData.arrowheadStyle = "fill: #333"; - edgeData.labelpos = "c"; - } - edgeData.labelType = edge.labelType; - edgeData.label = await renderKatex(edge.text.replace(common$1.lineBreakRegex, "\n"), getConfig$1()); - if (edge.style === void 0) { - edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none;"; - } - edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); - edgeData.id = linkId; - edgeData.classes = "flowchart-link " + linkNameStart + " " + linkNameEnd; - g.setEdge(edge.start, edge.end, edgeData, cnt2); - } - }; - const getClasses$6 = function(text2, diagObj) { - return diagObj.db.getClasses(); - }; - const draw$j = async function(text2, id2, _version, diagObj) { - log$1.info("Drawing flowchart"); - let dir2 = diagObj.db.getDirection(); - if (dir2 === void 0) { - dir2 = "TD"; - } - const { securityLevel, flowchart: conf2 } = getConfig$1(); - const nodeSpacing = conf2.nodeSpacing || 50; - const rankSpacing = conf2.rankSpacing || 50; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - const g = new Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: dir2, - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 0, - marginy: 0 - }).setDefaultEdgeLabel(function() { - return {}; - }); - let subG; - const subGraphs2 = diagObj.db.getSubGraphs(); - log$1.info("Subgraphs - ", subGraphs2); - for (let i3 = subGraphs2.length - 1; i3 >= 0; i3--) { - subG = subGraphs2[i3]; - log$1.info("Subgraph - ", subG); - diagObj.db.addVertex( - subG.id, - { text: subG.title, type: subG.labelType }, - "group", - void 0, - subG.classes, - subG.dir - ); + constructor(node2, message) { + super(node2 ? `${message} at ${node2.range.start.line}:${node2.range.start.character}` : message); + } + }; + __name(assertUnreachable, "assertUnreachable"); } - const vert = diagObj.db.getVertices(); - const edges2 = diagObj.db.getEdges(); - log$1.info("Edges", edges2); - let i2 = 0; - for (i2 = subGraphs2.length - 1; i2 >= 0; i2--) { - subG = subGraphs2[i2]; - selectAll("cluster").append("text"); - for (let j = 0; j < subG.nodes.length; j++) { - log$1.info("Setting up subgraphs", subG.nodes[j], subG.id); - g.setParent(subG.nodes[j], subG.id); - } - } - await addVertices$1(vert, g, id2, root2, doc, diagObj); - await addEdges$1(edges2, g); - const svg2 = root2.select(`[id="${id2}"]`); - const element2 = root2.select("#" + id2 + " g"); - await render(element2, g, ["point", "circle", "cross"], "flowchart", id2); - utils$1.insertTitle(svg2, "flowchartTitleText", conf2.titleTopMargin, diagObj.db.getDiagramTitle()); - setupGraphViewbox$1(g, svg2, conf2.diagramPadding, conf2.useMaxWidth); - diagObj.db.indexNodes("subGraph" + i2); - if (!conf2.htmlLabels) { - const labels = doc.querySelectorAll('[id="' + id2 + '"] .edgeLabel .label'); - for (const label of labels) { - const dim = label.getBBox(); - const rect2 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); - rect2.setAttribute("rx", 0); - rect2.setAttribute("ry", 0); - rect2.setAttribute("width", dim.width); - rect2.setAttribute("height", dim.height); - label.insertBefore(rect2, label.firstChild); - } - } - const keys2 = Object.keys(vert); - keys2.forEach(function(key) { - const vertex = vert[key]; - if (vertex.link) { - const node2 = d3select("#" + id2 + ' [id="' + key + '"]'); - if (node2) { - const link2 = doc.createElementNS("http://www.w3.org/2000/svg", "a"); - link2.setAttributeNS("http://www.w3.org/2000/svg", "class", vertex.classes.join(" ")); - link2.setAttributeNS("http://www.w3.org/2000/svg", "href", vertex.link); - link2.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"); - if (securityLevel === "sandbox") { - link2.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top"); - } else if (vertex.linkTarget) { - link2.setAttributeNS("http://www.w3.org/2000/svg", "target", vertex.linkTarget); - } - const linkNode = node2.insert(function() { - return link2; - }, ":first-child"); - const shape = node2.select(".label-container"); - if (shape) { - linkNode.append(function() { - return shape.node(); - }); - } - const label = node2.select(".label"); - if (label) { - linkNode.append(function() { - return label.node(); - }); - } - } - } - }); - }; - const flowRendererV2 = { - setConf: setConf$7, - addVertices: addVertices$1, - addEdges: addEdges$1, - getClasses: getClasses$6, - draw: draw$j - }; - const fade$1 = (color2, opacity) => { - const channel2 = channel$1; - const r = channel2(color2, "r"); - const g = channel2(color2, "g"); - const b = channel2(color2, "b"); - return rgba$1(r, g, b, opacity); - }; - const getStyles$d = (options2) => `.label { - font-family: ${options2.fontFamily}; - color: ${options2.nodeTextColor || options2.textColor}; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/generated/ast.js + var ast_exports = {}; + __export(ast_exports, { + AbstractElement: () => AbstractElement, + AbstractRule: () => AbstractRule, + AbstractType: () => AbstractType, + Action: () => Action, + Alternatives: () => Alternatives, + ArrayLiteral: () => ArrayLiteral, + ArrayType: () => ArrayType, + Assignment: () => Assignment, + BooleanLiteral: () => BooleanLiteral, + CharacterRange: () => CharacterRange, + Condition: () => Condition, + Conjunction: () => Conjunction, + CrossReference: () => CrossReference, + Disjunction: () => Disjunction, + EndOfFile: () => EndOfFile, + Grammar: () => Grammar, + GrammarImport: () => GrammarImport, + Group: () => Group, + InferredType: () => InferredType, + Interface: () => Interface, + Keyword: () => Keyword2, + LangiumGrammarAstReflection: () => LangiumGrammarAstReflection, + LangiumGrammarTerminals: () => LangiumGrammarTerminals, + NamedArgument: () => NamedArgument, + NegatedToken: () => NegatedToken, + Negation: () => Negation, + NumberLiteral: () => NumberLiteral, + Parameter: () => Parameter, + ParameterReference: () => ParameterReference, + ParserRule: () => ParserRule, + ReferenceType: () => ReferenceType, + RegexToken: () => RegexToken, + ReturnType: () => ReturnType, + RuleCall: () => RuleCall, + SimpleType: () => SimpleType, + StringLiteral: () => StringLiteral, + TerminalAlternatives: () => TerminalAlternatives, + TerminalGroup: () => TerminalGroup, + TerminalRule: () => TerminalRule, + TerminalRuleCall: () => TerminalRuleCall, + Type: () => Type2, + TypeAttribute: () => TypeAttribute, + TypeDefinition: () => TypeDefinition, + UnionType: () => UnionType, + UnorderedGroup: () => UnorderedGroup, + UntilToken: () => UntilToken, + ValueLiteral: () => ValueLiteral, + Wildcard: () => Wildcard, + isAbstractElement: () => isAbstractElement, + isAbstractRule: () => isAbstractRule, + isAbstractType: () => isAbstractType, + isAction: () => isAction, + isAlternatives: () => isAlternatives, + isArrayLiteral: () => isArrayLiteral, + isArrayType: () => isArrayType, + isAssignment: () => isAssignment, + isBooleanLiteral: () => isBooleanLiteral, + isCharacterRange: () => isCharacterRange, + isCondition: () => isCondition, + isConjunction: () => isConjunction, + isCrossReference: () => isCrossReference, + isDisjunction: () => isDisjunction, + isEndOfFile: () => isEndOfFile, + isFeatureName: () => isFeatureName, + isGrammar: () => isGrammar, + isGrammarImport: () => isGrammarImport, + isGroup: () => isGroup, + isInferredType: () => isInferredType, + isInterface: () => isInterface, + isKeyword: () => isKeyword, + isNamedArgument: () => isNamedArgument, + isNegatedToken: () => isNegatedToken, + isNegation: () => isNegation, + isNumberLiteral: () => isNumberLiteral, + isParameter: () => isParameter, + isParameterReference: () => isParameterReference, + isParserRule: () => isParserRule, + isPrimitiveType: () => isPrimitiveType, + isReferenceType: () => isReferenceType, + isRegexToken: () => isRegexToken, + isReturnType: () => isReturnType, + isRuleCall: () => isRuleCall, + isSimpleType: () => isSimpleType, + isStringLiteral: () => isStringLiteral, + isTerminalAlternatives: () => isTerminalAlternatives, + isTerminalGroup: () => isTerminalGroup, + isTerminalRule: () => isTerminalRule, + isTerminalRuleCall: () => isTerminalRuleCall, + isType: () => isType, + isTypeAttribute: () => isTypeAttribute, + isTypeDefinition: () => isTypeDefinition, + isUnionType: () => isUnionType, + isUnorderedGroup: () => isUnorderedGroup, + isUntilToken: () => isUntilToken, + isValueLiteral: () => isValueLiteral, + isWildcard: () => isWildcard, + reflection: () => reflection + }); + function isAbstractRule(item) { + return reflection.isInstance(item, AbstractRule); } - .cluster-label text { - fill: ${options2.titleColor}; + function isAbstractType(item) { + return reflection.isInstance(item, AbstractType); } - .cluster-label span,p { - color: ${options2.titleColor}; + function isCondition(item) { + return reflection.isInstance(item, Condition); } - - .label text,span,p { - fill: ${options2.nodeTextColor || options2.textColor}; - color: ${options2.nodeTextColor || options2.textColor}; + function isFeatureName(item) { + return isPrimitiveType(item) || item === "current" || item === "entry" || item === "extends" || item === "false" || item === "fragment" || item === "grammar" || item === "hidden" || item === "import" || item === "interface" || item === "returns" || item === "terminal" || item === "true" || item === "type" || item === "infer" || item === "infers" || item === "with" || typeof item === "string" && /\^?[_a-zA-Z][\w_]*/.test(item); } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; - stroke-width: 1px; + function isPrimitiveType(item) { + return item === "string" || item === "number" || item === "boolean" || item === "Date" || item === "bigint"; } - .flowchart-label text { - text-anchor: middle; + function isTypeDefinition(item) { + return reflection.isInstance(item, TypeDefinition); } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .katex path { - fill: #000; - stroke: #000; - stroke-width: 1px; + function isValueLiteral(item) { + return reflection.isInstance(item, ValueLiteral); } - - .node .label { - text-align: center; + function isAbstractElement(item) { + return reflection.isInstance(item, AbstractElement); } - .node.clickable { - cursor: pointer; + function isArrayLiteral(item) { + return reflection.isInstance(item, ArrayLiteral); } - - .arrowheadPath { - fill: ${options2.arrowheadColor}; + function isArrayType(item) { + return reflection.isInstance(item, ArrayType); } - - .edgePath .path { - stroke: ${options2.lineColor}; - stroke-width: 2.0px; + function isBooleanLiteral(item) { + return reflection.isInstance(item, BooleanLiteral); } - - .flowchart-link { - stroke: ${options2.lineColor}; - fill: none; + function isConjunction(item) { + return reflection.isInstance(item, Conjunction); } - - .edgeLabel { - background-color: ${options2.edgeLabelBackground}; - rect { - opacity: 0.5; - background-color: ${options2.edgeLabelBackground}; - fill: ${options2.edgeLabelBackground}; - } - text-align: center; + function isDisjunction(item) { + return reflection.isInstance(item, Disjunction); } - - /* For html labels only */ - .labelBkg { - background-color: ${fade$1(options2.edgeLabelBackground, 0.5)}; - // background-color: + function isGrammar(item) { + return reflection.isInstance(item, Grammar); } - - .cluster rect { - fill: ${options2.clusterBkg}; - stroke: ${options2.clusterBorder}; - stroke-width: 1px; + function isGrammarImport(item) { + return reflection.isInstance(item, GrammarImport); } - - .cluster text { - fill: ${options2.titleColor}; + function isInferredType(item) { + return reflection.isInstance(item, InferredType); } - - .cluster span,p { - color: ${options2.titleColor}; + function isInterface(item) { + return reflection.isInstance(item, Interface); } - /* .cluster div { - color: ${options2.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${options2.fontFamily}; - font-size: 12px; - background: ${options2.tertiaryColor}; - border: 1px solid ${options2.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; + function isNamedArgument(item) { + return reflection.isInstance(item, NamedArgument); } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; + function isNegation(item) { + return reflection.isInstance(item, Negation); } -`; - const flowStyles$1 = getStyles$d; - const diagram$k = { - parser: parser$u, - db: flowDb, - renderer: flowRendererV2, - styles: flowStyles$1, - init: (cnf) => { - if (!cnf.flowchart) { - cnf.flowchart = {}; - } - cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - flowRenderer.setConf(cnf.flowchart); - flowDb.clear(); - flowDb.setGen("gen-1"); - } - }; - const flowDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$k - }, Symbol.toStringTag, { value: "Module" })); - const diagram$j = { - parser: parser$u, - db: flowDb, - renderer: flowRendererV2, - styles: flowStyles$1, - init: (cnf) => { - if (!cnf.flowchart) { - cnf.flowchart = {}; - } - cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - setConfig({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } }); - flowRendererV2.setConf(cnf.flowchart); - flowDb.clear(); - flowDb.setGen("gen-2"); - } - }; - const flowDiagramV2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$j - }, Symbol.toStringTag, { value: "Module" })); - var parser$s = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [6, 8, 10, 20, 22, 24, 26, 27, 28], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 14], $V6 = [1, 15], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 25], $Vc = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], $Vd = [1, 34], $Ve = [27, 28, 46, 47], $Vf = [41, 42, 43, 44, 45], $Vg = [17, 34], $Vh = [1, 54], $Vi = [1, 53], $Vj = [17, 34, 36, 38]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "ER_DIAGRAM": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "entityName": 11, "relSpec": 12, ":": 13, "role": 14, "BLOCK_START": 15, "attributes": 16, "BLOCK_STOP": 17, "SQS": 18, "SQE": 19, "title": 20, "title_value": 21, "acc_title": 22, "acc_title_value": 23, "acc_descr": 24, "acc_descr_value": 25, "acc_descr_multiline_value": 26, "ALPHANUM": 27, "ENTITY_NAME": 28, "attribute": 29, "attributeType": 30, "attributeName": 31, "attributeKeyTypeList": 32, "attributeComment": 33, "ATTRIBUTE_WORD": 34, "attributeKeyType": 35, "COMMA": 36, "ATTRIBUTE_KEY": 37, "COMMENT": 38, "cardinality": 39, "relType": 40, "ZERO_OR_ONE": 41, "ZERO_OR_MORE": 42, "ONE_OR_MORE": 43, "ONLY_ONE": 44, "MD_PARENT": 45, "NON_IDENTIFYING": 46, "IDENTIFYING": 47, "WORD": 48, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: ":", 15: "BLOCK_START", 17: "BLOCK_STOP", 18: "SQS", 19: "SQE", 20: "title", 21: "title_value", 22: "acc_title", 23: "acc_title_value", 24: "acc_descr", 25: "acc_descr_value", 26: "acc_descr_multiline_value", 27: "ALPHANUM", 28: "ENTITY_NAME", 34: "ATTRIBUTE_WORD", 36: "COMMA", 37: "ATTRIBUTE_KEY", 38: "COMMENT", 41: "ZERO_OR_ONE", 42: "ZERO_OR_MORE", 43: "ONE_OR_MORE", 44: "ONLY_ONE", 45: "MD_PARENT", 46: "NON_IDENTIFYING", 47: "IDENTIFYING", 48: "WORD" }, - productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 4], [9, 3], [9, 1], [9, 7], [9, 6], [9, 4], [9, 2], [9, 2], [9, 2], [9, 1], [11, 1], [11, 1], [16, 1], [16, 2], [29, 2], [29, 3], [29, 3], [29, 4], [30, 1], [31, 1], [32, 1], [32, 3], [35, 1], [33, 1], [12, 3], [39, 1], [39, 1], [39, 1], [39, 1], [39, 1], [40, 1], [40, 1], [14, 1], [14, 1], [14, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 1: - break; - case 2: - this.$ = []; - break; - case 3: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 4: - case 5: - this.$ = $$[$0]; - break; - case 6: - case 7: - this.$ = []; - break; - case 8: - yy.addEntity($$[$0 - 4]); - yy.addEntity($$[$0 - 2]); - yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]); - break; - case 9: - yy.addEntity($$[$0 - 3]); - yy.addAttributes($$[$0 - 3], $$[$0 - 1]); - break; - case 10: - yy.addEntity($$[$0 - 2]); - break; - case 11: - yy.addEntity($$[$0]); - break; - case 12: - yy.addEntity($$[$0 - 6], $$[$0 - 4]); - yy.addAttributes($$[$0 - 6], $$[$0 - 1]); - break; - case 13: - yy.addEntity($$[$0 - 5], $$[$0 - 3]); - break; - case 14: - yy.addEntity($$[$0 - 3], $$[$0 - 1]); - break; - case 15: - case 16: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 17: - case 18: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 19: - case 43: - this.$ = $$[$0]; - break; - case 20: - case 41: - case 42: - this.$ = $$[$0].replace(/"/g, ""); - break; - case 21: - case 29: - this.$ = [$$[$0]]; - break; - case 22: - $$[$0].push($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 23: - this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] }; - break; - case 24: - this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] }; - break; - case 25: - this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] }; - break; - case 26: - this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] }; - break; - case 27: - case 28: - case 31: - this.$ = $$[$0]; - break; - case 30: - $$[$0 - 2].push($$[$0]); - this.$ = $$[$0 - 2]; - break; - case 32: - this.$ = $$[$0].replace(/"/g, ""); - break; - case 33: - this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] }; - break; - case 34: - this.$ = yy.Cardinality.ZERO_OR_ONE; - break; - case 35: - this.$ = yy.Cardinality.ZERO_OR_MORE; - break; - case 36: - this.$ = yy.Cardinality.ONE_OR_MORE; - break; - case 37: - this.$ = yy.Cardinality.ONLY_ONE; - break; - case 38: - this.$ = yy.Cardinality.MD_PARENT; - break; - case 39: - this.$ = yy.Identification.NON_IDENTIFYING; - break; - case 40: - this.$ = yy.Identification.IDENTIFYING; - break; - } - }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 16, 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 11], { 12: 17, 39: 20, 15: [1, 18], 18: [1, 19], 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }), { 21: [1, 26] }, { 23: [1, 27] }, { 25: [1, 28] }, o($V0, [2, 18]), o($Vc, [2, 19]), o($Vc, [2, 20]), o($V0, [2, 4]), { 11: 29, 27: $V5, 28: $V6 }, { 16: 30, 17: [1, 31], 29: 32, 30: 33, 34: $Vd }, { 11: 35, 27: $V5, 28: $V6 }, { 40: 36, 46: [1, 37], 47: [1, 38] }, o($Ve, [2, 34]), o($Ve, [2, 35]), o($Ve, [2, 36]), o($Ve, [2, 37]), o($Ve, [2, 38]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), { 13: [1, 39] }, { 17: [1, 40] }, o($V0, [2, 10]), { 16: 41, 17: [2, 21], 29: 32, 30: 33, 34: $Vd }, { 31: 42, 34: [1, 43] }, { 34: [2, 27] }, { 19: [1, 44] }, { 39: 45, 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }, o($Vf, [2, 39]), o($Vf, [2, 40]), { 14: 46, 27: [1, 49], 28: [1, 48], 48: [1, 47] }, o($V0, [2, 9]), { 17: [2, 22] }, o($Vg, [2, 23], { 32: 50, 33: 51, 35: 52, 37: $Vh, 38: $Vi }), o([17, 34, 37, 38], [2, 28]), o($V0, [2, 14], { 15: [1, 55] }), o([27, 28], [2, 33]), o($V0, [2, 8]), o($V0, [2, 41]), o($V0, [2, 42]), o($V0, [2, 43]), o($Vg, [2, 24], { 33: 56, 36: [1, 57], 38: $Vi }), o($Vg, [2, 25]), o($Vj, [2, 29]), o($Vg, [2, 32]), o($Vj, [2, 31]), { 16: 58, 17: [1, 59], 29: 32, 30: 33, 34: $Vd }, o($Vg, [2, 26]), { 35: 60, 37: $Vh }, { 17: [1, 61] }, o($V0, [2, 13]), o($Vj, [2, 30]), o($V0, [2, 12])], - defaultActions: { 34: [2, 27], 41: [2, 22] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + function isNumberLiteral(item) { + return reflection.isInstance(item, NumberLiteral); + } + function isParameter(item) { + return reflection.isInstance(item, Parameter); + } + function isParameterReference(item) { + return reflection.isInstance(item, ParameterReference); + } + function isParserRule(item) { + return reflection.isInstance(item, ParserRule); + } + function isReferenceType(item) { + return reflection.isInstance(item, ReferenceType); + } + function isReturnType(item) { + return reflection.isInstance(item, ReturnType); + } + function isSimpleType(item) { + return reflection.isInstance(item, SimpleType); + } + function isStringLiteral(item) { + return reflection.isInstance(item, StringLiteral); + } + function isTerminalRule(item) { + return reflection.isInstance(item, TerminalRule); + } + function isType(item) { + return reflection.isInstance(item, Type2); + } + function isTypeAttribute(item) { + return reflection.isInstance(item, TypeAttribute); + } + function isUnionType(item) { + return reflection.isInstance(item, UnionType); + } + function isAction(item) { + return reflection.isInstance(item, Action); + } + function isAlternatives(item) { + return reflection.isInstance(item, Alternatives); + } + function isAssignment(item) { + return reflection.isInstance(item, Assignment); + } + function isCharacterRange(item) { + return reflection.isInstance(item, CharacterRange); + } + function isCrossReference(item) { + return reflection.isInstance(item, CrossReference); + } + function isEndOfFile(item) { + return reflection.isInstance(item, EndOfFile); + } + function isGroup(item) { + return reflection.isInstance(item, Group); + } + function isKeyword(item) { + return reflection.isInstance(item, Keyword2); + } + function isNegatedToken(item) { + return reflection.isInstance(item, NegatedToken); + } + function isRegexToken(item) { + return reflection.isInstance(item, RegexToken); + } + function isRuleCall(item) { + return reflection.isInstance(item, RuleCall); + } + function isTerminalAlternatives(item) { + return reflection.isInstance(item, TerminalAlternatives); + } + function isTerminalGroup(item) { + return reflection.isInstance(item, TerminalGroup); + } + function isTerminalRuleCall(item) { + return reflection.isInstance(item, TerminalRuleCall); + } + function isUnorderedGroup(item) { + return reflection.isInstance(item, UnorderedGroup); + } + function isUntilToken(item) { + return reflection.isInstance(item, UntilToken); + } + function isWildcard(item) { + return reflection.isInstance(item, Wildcard); + } + var LangiumGrammarTerminals, AbstractRule, AbstractType, Condition, TypeDefinition, ValueLiteral, AbstractElement, ArrayLiteral, ArrayType, BooleanLiteral, Conjunction, Disjunction, Grammar, GrammarImport, InferredType, Interface, NamedArgument, Negation, NumberLiteral, Parameter, ParameterReference, ParserRule, ReferenceType, ReturnType, SimpleType, StringLiteral, TerminalRule, Type2, TypeAttribute, UnionType, Action, Alternatives, Assignment, CharacterRange, CrossReference, EndOfFile, Group, Keyword2, NegatedToken, RegexToken, RuleCall, TerminalAlternatives, TerminalGroup, TerminalRuleCall, UnorderedGroup, UntilToken, Wildcard, LangiumGrammarAstReflection, reflection; + var init_ast = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/generated/ast.js"() { + "use strict"; + init_syntax_tree(); + LangiumGrammarTerminals = { + ID: /\^?[_a-zA-Z][\w_]*/, + STRING: /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/, + NUMBER: /NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/, + RegexLiteral: /\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/, + WS: /\s+/, + ML_COMMENT: /\/\*[\s\S]*?\*\//, + SL_COMMENT: /\/\/[^\n\r]*/ + }; + AbstractRule = "AbstractRule"; + __name(isAbstractRule, "isAbstractRule"); + AbstractType = "AbstractType"; + __name(isAbstractType, "isAbstractType"); + Condition = "Condition"; + __name(isCondition, "isCondition"); + __name(isFeatureName, "isFeatureName"); + __name(isPrimitiveType, "isPrimitiveType"); + TypeDefinition = "TypeDefinition"; + __name(isTypeDefinition, "isTypeDefinition"); + ValueLiteral = "ValueLiteral"; + __name(isValueLiteral, "isValueLiteral"); + AbstractElement = "AbstractElement"; + __name(isAbstractElement, "isAbstractElement"); + ArrayLiteral = "ArrayLiteral"; + __name(isArrayLiteral, "isArrayLiteral"); + ArrayType = "ArrayType"; + __name(isArrayType, "isArrayType"); + BooleanLiteral = "BooleanLiteral"; + __name(isBooleanLiteral, "isBooleanLiteral"); + Conjunction = "Conjunction"; + __name(isConjunction, "isConjunction"); + Disjunction = "Disjunction"; + __name(isDisjunction, "isDisjunction"); + Grammar = "Grammar"; + __name(isGrammar, "isGrammar"); + GrammarImport = "GrammarImport"; + __name(isGrammarImport, "isGrammarImport"); + InferredType = "InferredType"; + __name(isInferredType, "isInferredType"); + Interface = "Interface"; + __name(isInterface, "isInterface"); + NamedArgument = "NamedArgument"; + __name(isNamedArgument, "isNamedArgument"); + Negation = "Negation"; + __name(isNegation, "isNegation"); + NumberLiteral = "NumberLiteral"; + __name(isNumberLiteral, "isNumberLiteral"); + Parameter = "Parameter"; + __name(isParameter, "isParameter"); + ParameterReference = "ParameterReference"; + __name(isParameterReference, "isParameterReference"); + ParserRule = "ParserRule"; + __name(isParserRule, "isParserRule"); + ReferenceType = "ReferenceType"; + __name(isReferenceType, "isReferenceType"); + ReturnType = "ReturnType"; + __name(isReturnType, "isReturnType"); + SimpleType = "SimpleType"; + __name(isSimpleType, "isSimpleType"); + StringLiteral = "StringLiteral"; + __name(isStringLiteral, "isStringLiteral"); + TerminalRule = "TerminalRule"; + __name(isTerminalRule, "isTerminalRule"); + Type2 = "Type"; + __name(isType, "isType"); + TypeAttribute = "TypeAttribute"; + __name(isTypeAttribute, "isTypeAttribute"); + UnionType = "UnionType"; + __name(isUnionType, "isUnionType"); + Action = "Action"; + __name(isAction, "isAction"); + Alternatives = "Alternatives"; + __name(isAlternatives, "isAlternatives"); + Assignment = "Assignment"; + __name(isAssignment, "isAssignment"); + CharacterRange = "CharacterRange"; + __name(isCharacterRange, "isCharacterRange"); + CrossReference = "CrossReference"; + __name(isCrossReference, "isCrossReference"); + EndOfFile = "EndOfFile"; + __name(isEndOfFile, "isEndOfFile"); + Group = "Group"; + __name(isGroup, "isGroup"); + Keyword2 = "Keyword"; + __name(isKeyword, "isKeyword"); + NegatedToken = "NegatedToken"; + __name(isNegatedToken, "isNegatedToken"); + RegexToken = "RegexToken"; + __name(isRegexToken, "isRegexToken"); + RuleCall = "RuleCall"; + __name(isRuleCall, "isRuleCall"); + TerminalAlternatives = "TerminalAlternatives"; + __name(isTerminalAlternatives, "isTerminalAlternatives"); + TerminalGroup = "TerminalGroup"; + __name(isTerminalGroup, "isTerminalGroup"); + TerminalRuleCall = "TerminalRuleCall"; + __name(isTerminalRuleCall, "isTerminalRuleCall"); + UnorderedGroup = "UnorderedGroup"; + __name(isUnorderedGroup, "isUnorderedGroup"); + UntilToken = "UntilToken"; + __name(isUntilToken, "isUntilToken"); + Wildcard = "Wildcard"; + __name(isWildcard, "isWildcard"); + LangiumGrammarAstReflection = class extends AbstractAstReflection { + static { + __name(this, "LangiumGrammarAstReflection"); + } + getAllTypes() { + return ["AbstractElement", "AbstractRule", "AbstractType", "Action", "Alternatives", "ArrayLiteral", "ArrayType", "Assignment", "BooleanLiteral", "CharacterRange", "Condition", "Conjunction", "CrossReference", "Disjunction", "EndOfFile", "Grammar", "GrammarImport", "Group", "InferredType", "Interface", "Keyword", "NamedArgument", "NegatedToken", "Negation", "NumberLiteral", "Parameter", "ParameterReference", "ParserRule", "ReferenceType", "RegexToken", "ReturnType", "RuleCall", "SimpleType", "StringLiteral", "TerminalAlternatives", "TerminalGroup", "TerminalRule", "TerminalRuleCall", "Type", "TypeAttribute", "TypeDefinition", "UnionType", "UnorderedGroup", "UntilToken", "ValueLiteral", "Wildcard"]; + } + computeIsSubtype(subtype, supertype) { + switch (subtype) { + case Action: + case Alternatives: + case Assignment: + case CharacterRange: + case CrossReference: + case EndOfFile: + case Group: + case Keyword2: + case NegatedToken: + case RegexToken: + case RuleCall: + case TerminalAlternatives: + case TerminalGroup: + case TerminalRuleCall: + case UnorderedGroup: + case UntilToken: + case Wildcard: { + return this.isSubtype(AbstractElement, supertype); + } + case ArrayLiteral: + case NumberLiteral: + case StringLiteral: { + return this.isSubtype(ValueLiteral, supertype); + } + case ArrayType: + case ReferenceType: + case SimpleType: + case UnionType: { + return this.isSubtype(TypeDefinition, supertype); + } + case BooleanLiteral: { + return this.isSubtype(Condition, supertype) || this.isSubtype(ValueLiteral, supertype); + } + case Conjunction: + case Disjunction: + case Negation: + case ParameterReference: { + return this.isSubtype(Condition, supertype); + } + case InferredType: + case Interface: + case Type2: { + return this.isSubtype(AbstractType, supertype); + } + case ParserRule: { + return this.isSubtype(AbstractRule, supertype) || this.isSubtype(AbstractType, supertype); + } + case TerminalRule: { + return this.isSubtype(AbstractRule, supertype); + } + default: { + return false; } - token2 = self2.symbols_[token2] || token2; } - return token2; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + getReferenceType(refInfo) { + const referenceId = `${refInfo.container.$type}:${refInfo.property}`; + switch (referenceId) { + case "Action:type": + case "CrossReference:type": + case "Interface:superTypes": + case "ParserRule:returnType": + case "SimpleType:typeRef": { + return AbstractType; } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } + case "Grammar:hiddenTokens": + case "ParserRule:hiddenTokens": + case "RuleCall:rule": { + return AbstractRule; + } + case "Grammar:usedGrammars": { + return Grammar; + } + case "NamedArgument:parameter": + case "ParameterReference:parameter": { + return Parameter; + } + case "TerminalRuleCall:rule": { + return TerminalRule; + } + default: { + throw new Error(`${referenceId} is not a valid reference id.`); } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; } } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; - } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + getTypeMetaData(type3) { + switch (type3) { + case "AbstractElement": { + return { + name: "AbstractElement", + properties: [ + { name: "cardinality" }, + { name: "lookahead" } + ] + }; } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; + case "ArrayLiteral": { + return { + name: "ArrayLiteral", + properties: [ + { name: "elements", defaultValue: [] } + ] + }; } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } + case "ArrayType": { + return { + name: "ArrayType", + properties: [ + { name: "elementType" } + ] + }; } - } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + case "BooleanLiteral": { + return { + name: "BooleanLiteral", + properties: [ + { name: "true", defaultValue: false } + ] + }; + } + case "Conjunction": { + return { + name: "Conjunction", + properties: [ + { name: "left" }, + { name: "right" } + ] + }; + } + case "Disjunction": { + return { + name: "Disjunction", + properties: [ + { name: "left" }, + { name: "right" } + ] + }; + } + case "Grammar": { + return { + name: "Grammar", + properties: [ + { name: "definesHiddenTokens", defaultValue: false }, + { name: "hiddenTokens", defaultValue: [] }, + { name: "imports", defaultValue: [] }, + { name: "interfaces", defaultValue: [] }, + { name: "isDeclared", defaultValue: false }, + { name: "name" }, + { name: "rules", defaultValue: [] }, + { name: "types", defaultValue: [] }, + { name: "usedGrammars", defaultValue: [] } + ] + }; + } + case "GrammarImport": { + return { + name: "GrammarImport", + properties: [ + { name: "path" } + ] + }; + } + case "InferredType": { + return { + name: "InferredType", + properties: [ + { name: "name" } + ] + }; + } + case "Interface": { + return { + name: "Interface", + properties: [ + { name: "attributes", defaultValue: [] }, + { name: "name" }, + { name: "superTypes", defaultValue: [] } + ] + }; + } + case "NamedArgument": { + return { + name: "NamedArgument", + properties: [ + { name: "calledByName", defaultValue: false }, + { name: "parameter" }, + { name: "value" } + ] + }; + } + case "Negation": { + return { + name: "Negation", + properties: [ + { name: "value" } + ] + }; + } + case "NumberLiteral": { + return { + name: "NumberLiteral", + properties: [ + { name: "value" } + ] + }; + } + case "Parameter": { + return { + name: "Parameter", + properties: [ + { name: "name" } + ] + }; + } + case "ParameterReference": { + return { + name: "ParameterReference", + properties: [ + { name: "parameter" } + ] + }; + } + case "ParserRule": { + return { + name: "ParserRule", + properties: [ + { name: "dataType" }, + { name: "definesHiddenTokens", defaultValue: false }, + { name: "definition" }, + { name: "entry", defaultValue: false }, + { name: "fragment", defaultValue: false }, + { name: "hiddenTokens", defaultValue: [] }, + { name: "inferredType" }, + { name: "name" }, + { name: "parameters", defaultValue: [] }, + { name: "returnType" }, + { name: "wildcard", defaultValue: false } + ] + }; + } + case "ReferenceType": { + return { + name: "ReferenceType", + properties: [ + { name: "referenceType" } + ] + }; + } + case "ReturnType": { + return { + name: "ReturnType", + properties: [ + { name: "name" } + ] + }; + } + case "SimpleType": { + return { + name: "SimpleType", + properties: [ + { name: "primitiveType" }, + { name: "stringType" }, + { name: "typeRef" } + ] + }; + } + case "StringLiteral": { + return { + name: "StringLiteral", + properties: [ + { name: "value" } + ] + }; + } + case "TerminalRule": { + return { + name: "TerminalRule", + properties: [ + { name: "definition" }, + { name: "fragment", defaultValue: false }, + { name: "hidden", defaultValue: false }, + { name: "name" }, + { name: "type" } + ] + }; + } + case "Type": { + return { + name: "Type", + properties: [ + { name: "name" }, + { name: "type" } + ] + }; + } + case "TypeAttribute": { + return { + name: "TypeAttribute", + properties: [ + { name: "defaultValue" }, + { name: "isOptional", defaultValue: false }, + { name: "name" }, + { name: "type" } + ] + }; + } + case "UnionType": { + return { + name: "UnionType", + properties: [ + { name: "types", defaultValue: [] } + ] + }; + } + case "Action": { + return { + name: "Action", + properties: [ + { name: "cardinality" }, + { name: "feature" }, + { name: "inferredType" }, + { name: "lookahead" }, + { name: "operator" }, + { name: "type" } + ] + }; + } + case "Alternatives": { + return { + name: "Alternatives", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; + } + case "Assignment": { + return { + name: "Assignment", + properties: [ + { name: "cardinality" }, + { name: "feature" }, + { name: "lookahead" }, + { name: "operator" }, + { name: "terminal" } + ] + }; + } + case "CharacterRange": { + return { + name: "CharacterRange", + properties: [ + { name: "cardinality" }, + { name: "left" }, + { name: "lookahead" }, + { name: "right" } + ] + }; + } + case "CrossReference": { + return { + name: "CrossReference", + properties: [ + { name: "cardinality" }, + { name: "deprecatedSyntax", defaultValue: false }, + { name: "lookahead" }, + { name: "terminal" }, + { name: "type" } + ] + }; + } + case "EndOfFile": { + return { + name: "EndOfFile", + properties: [ + { name: "cardinality" }, + { name: "lookahead" } + ] + }; + } + case "Group": { + return { + name: "Group", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "guardCondition" }, + { name: "lookahead" } + ] + }; + } + case "Keyword": { + return { + name: "Keyword", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "value" } + ] + }; + } + case "NegatedToken": { + return { + name: "NegatedToken", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "terminal" } + ] + }; + } + case "RegexToken": { + return { + name: "RegexToken", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "regex" } + ] + }; + } + case "RuleCall": { + return { + name: "RuleCall", + properties: [ + { name: "arguments", defaultValue: [] }, + { name: "cardinality" }, + { name: "lookahead" }, + { name: "rule" } + ] + }; + } + case "TerminalAlternatives": { + return { + name: "TerminalAlternatives", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; + } + case "TerminalGroup": { + return { + name: "TerminalGroup", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; + } + case "TerminalRuleCall": { + return { + name: "TerminalRuleCall", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "rule" } + ] + }; + } + case "UnorderedGroup": { + return { + name: "UnorderedGroup", + properties: [ + { name: "cardinality" }, + { name: "elements", defaultValue: [] }, + { name: "lookahead" } + ] + }; + } + case "UntilToken": { + return { + name: "UntilToken", + properties: [ + { name: "cardinality" }, + { name: "lookahead" }, + { name: "terminal" } + ] + }; + } + case "Wildcard": { + return { + name: "Wildcard", + properties: [ + { name: "cardinality" }, + { name: "lookahead" } + ] + }; + } + default: { + return { + name: type3, + properties: [] + }; } - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - this.begin("acc_title"); - return 22; - case 1: - this.popState(); - return "acc_title_value"; - case 2: - this.begin("acc_descr"); - return 24; - case 3: - this.popState(); - return "acc_descr_value"; - case 4: - this.begin("acc_descr_multiline"); - break; - case 5: - this.popState(); - break; - case 6: - return "acc_descr_multiline_value"; - case 7: - return 10; - case 8: - break; - case 9: - return 8; - case 10: - return 28; - case 11: - return 48; - case 12: - return 4; - case 13: - this.begin("block"); - return 15; - case 14: - return 36; - case 15: - break; - case 16: - return 37; - case 17: - return 34; - case 18: - return 34; - case 19: - return 38; - case 20: - break; - case 21: - this.popState(); - return 17; - case 22: - return yy_.yytext[0]; - case 23: - return 18; - case 24: - return 19; - case 25: - return 41; - case 26: - return 43; - case 27: - return 43; - case 28: - return 43; - case 29: - return 41; - case 30: - return 41; - case 31: - return 42; - case 32: - return 42; - case 33: - return 42; - case 34: - return 42; - case 35: - return 42; - case 36: - return 43; - case 37: - return 42; - case 38: - return 43; - case 39: - return 44; - case 40: - return 44; - case 41: - return 44; - case 42: - return 44; - case 43: - return 41; - case 44: - return 42; - case 45: - return 43; - case 46: - return 45; - case 47: - return 46; - case 48: - return 47; - case 49: - return 47; - case 50: - return 46; - case 51: - return 46; - case 52: - return 46; - case 53: - return 27; - case 54: - return yy_.yytext[0]; - case 55: - return 6; } - }, - rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:,)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i, /^(?:.)/i, /^(?:$)/i], - conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "block": { "rules": [14, 15, 16, 17, 18, 19, 20, 21, 22], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55], "inclusive": true } } + } }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$s.parser = parser$s; - const erParser = parser$s; - let entities = {}; - let relationships = []; - const Cardinality = { - ZERO_OR_ONE: "ZERO_OR_ONE", - ZERO_OR_MORE: "ZERO_OR_MORE", - ONE_OR_MORE: "ONE_OR_MORE", - ONLY_ONE: "ONLY_ONE", - MD_PARENT: "MD_PARENT" - }; - const Identification = { - NON_IDENTIFYING: "NON_IDENTIFYING", - IDENTIFYING: "IDENTIFYING" - }; - const addEntity = function(name, alias = void 0) { - if (entities[name] === void 0) { - entities[name] = { attributes: [], alias }; - log$1.info("Added new entity :", name); - } else if (entities[name] && !entities[name].alias && alias) { - entities[name].alias = alias; - log$1.info(`Add alias '${alias}' to entity '${name}'`); - } - return entities[name]; - }; - const getEntities = () => entities; - const addAttributes = function(entityName, attribs) { - let entity = addEntity(entityName); - let i2; - for (i2 = attribs.length - 1; i2 >= 0; i2--) { - entity.attributes.push(attribs[i2]); - log$1.debug("Added attribute ", attribs[i2].attributeName); + reflection = new LangiumGrammarAstReflection(); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/ast-utils.js + var ast_utils_exports = {}; + __export(ast_utils_exports, { + assignMandatoryProperties: () => assignMandatoryProperties, + copyAstNode: () => copyAstNode, + findLocalReferences: () => findLocalReferences, + findRootNode: () => findRootNode, + getContainerOfType: () => getContainerOfType, + getDocument: () => getDocument, + hasContainerOfType: () => hasContainerOfType, + linkContentToContainer: () => linkContentToContainer, + streamAllContents: () => streamAllContents, + streamAst: () => streamAst, + streamContents: () => streamContents, + streamReferences: () => streamReferences + }); + function linkContentToContainer(node2) { + for (const [name, value2] of Object.entries(node2)) { + if (!name.startsWith("$")) { + if (Array.isArray(value2)) { + value2.forEach((item, index) => { + if (isAstNode(item)) { + item.$container = node2; + item.$containerProperty = name; + item.$containerIndex = index; + } + }); + } else if (isAstNode(value2)) { + value2.$container = node2; + value2.$containerProperty = name; + } + } } - }; - const addRelationship$1 = function(entA, rolA, entB, rSpec) { - let rel2 = { - entityA: entA, - roleA: rolA, - entityB: entB, - relSpec: rSpec - }; - relationships.push(rel2); - log$1.debug("Added new relationship :", rel2); - }; - const getRelationships$1 = () => relationships; - const clear$g = function() { - entities = {}; - relationships = []; - clear$n(); - }; - const erDb = { - Cardinality, - Identification, - getConfig: () => getConfig$1().er, - addEntity, - addAttributes, - getEntities, - addRelationship: addRelationship$1, - getRelationships: getRelationships$1, - clear: clear$g, - setAccTitle, - getAccTitle, - setAccDescription, - getAccDescription, - setDiagramTitle, - getDiagramTitle - }; - const ERMarkers = { - ONLY_ONE_START: "ONLY_ONE_START", - ONLY_ONE_END: "ONLY_ONE_END", - ZERO_OR_ONE_START: "ZERO_OR_ONE_START", - ZERO_OR_ONE_END: "ZERO_OR_ONE_END", - ONE_OR_MORE_START: "ONE_OR_MORE_START", - ONE_OR_MORE_END: "ONE_OR_MORE_END", - ZERO_OR_MORE_START: "ZERO_OR_MORE_START", - ZERO_OR_MORE_END: "ZERO_OR_MORE_END", - MD_PARENT_END: "MD_PARENT_END", - MD_PARENT_START: "MD_PARENT_START" - }; - const insertMarkers$2 = function(elem, conf2) { - let marker; - elem.append("defs").append("marker").attr("id", ERMarkers.MD_PARENT_START).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", ERMarkers.MD_PARENT_END).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18"); - elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18"); - marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"); - marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6); - marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18"); - marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"); - marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6); - marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,0 L21,18"); - elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"); - elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"); - marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"); - marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6); - marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18"); - marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"); - marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6); - marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18"); - return; - }; - const erMarkers = { - ERMarkers, - insertMarkers: insertMarkers$2 - }; - const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; - function validate(uuid) { - return typeof uuid === "string" && REGEX.test(uuid); } - const byteToHex = []; - for (let i2 = 0; i2 < 256; ++i2) { - byteToHex.push((i2 + 256).toString(16).slice(1)); + function getContainerOfType(node2, typePredicate) { + let item = node2; + while (item) { + if (typePredicate(item)) { + return item; + } + item = item.$container; + } + return void 0; } - function unsafeStringify(arr, offset = 0) { - return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; + function hasContainerOfType(node2, predicate) { + let item = node2; + while (item) { + if (predicate(item)) { + return true; + } + item = item.$container; + } + return false; } - function parse(uuid) { - if (!validate(uuid)) { - throw TypeError("Invalid UUID"); + function getDocument(node2) { + const rootNode = findRootNode(node2); + const result = rootNode.$document; + if (!result) { + throw new Error("AST node has no document."); } - let v; - const arr = new Uint8Array(16); - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 255; - arr[2] = v >>> 8 & 255; - arr[3] = v & 255; - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 255; - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 255; - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 255; - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255; - arr[11] = v / 4294967296 & 255; - arr[12] = v >>> 24 & 255; - arr[13] = v >>> 16 & 255; - arr[14] = v >>> 8 & 255; - arr[15] = v & 255; - return arr; + return result; } - function stringToBytes(str2) { - str2 = unescape(encodeURIComponent(str2)); - const bytes = []; - for (let i2 = 0; i2 < str2.length; ++i2) { - bytes.push(str2.charCodeAt(i2)); + function findRootNode(node2) { + while (node2.$container) { + node2 = node2.$container; } - return bytes; + return node2; } - const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - function v35(name, version2, hashfunc) { - function generateUUID(value2, namespace2, buf, offset) { - var _namespace; - if (typeof value2 === "string") { - value2 = stringToBytes(value2); - } - if (typeof namespace2 === "string") { - namespace2 = parse(namespace2); - } - if (((_namespace = namespace2) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { - throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); - } - let bytes = new Uint8Array(16 + value2.length); - bytes.set(namespace2); - bytes.set(value2, namespace2.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version2; - bytes[8] = bytes[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i2 = 0; i2 < 16; ++i2) { - buf[offset + i2] = bytes[i2]; + function streamContents(node2, options3) { + if (!node2) { + throw new Error("Node must be an AstNode."); + } + const range3 = options3 === null || options3 === void 0 ? void 0 : options3.range; + return new StreamImpl(() => ({ + keys: Object.keys(node2), + keyIndex: 0, + arrayIndex: 0 + }), (state4) => { + while (state4.keyIndex < state4.keys.length) { + const property2 = state4.keys[state4.keyIndex]; + if (!property2.startsWith("$")) { + const value2 = node2[property2]; + if (isAstNode(value2)) { + state4.keyIndex++; + if (isAstNodeInRange(value2, range3)) { + return { done: false, value: value2 }; + } + } else if (Array.isArray(value2)) { + while (state4.arrayIndex < value2.length) { + const index = state4.arrayIndex++; + const element3 = value2[index]; + if (isAstNode(element3) && isAstNodeInRange(element3, range3)) { + return { done: false, value: element3 }; + } + } + state4.arrayIndex = 0; + } } - return buf; + state4.keyIndex++; } - return unsafeStringify(bytes); - } - try { - generateUUID.name = name; - } catch (err) { - } - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; + return DONE_RESULT; + }); } - function f(s, x2, y2, z) { - switch (s) { - case 0: - return x2 & y2 ^ ~x2 & z; - case 1: - return x2 ^ y2 ^ z; - case 2: - return x2 & y2 ^ x2 & z ^ y2 & z; - case 3: - return x2 ^ y2 ^ z; + function streamAllContents(root4, options3) { + if (!root4) { + throw new Error("Root node must be an AstNode."); } + return new TreeStreamImpl(root4, (node2) => streamContents(node2, options3)); } - function ROTL(x2, n) { - return x2 << n | x2 >>> 32 - n; + function streamAst(root4, options3) { + if (!root4) { + throw new Error("Root node must be an AstNode."); + } else if ((options3 === null || options3 === void 0 ? void 0 : options3.range) && !isAstNodeInRange(root4, options3.range)) { + return new TreeStreamImpl(root4, () => []); + } + return new TreeStreamImpl(root4, (node2) => streamContents(node2, options3), { includeRoot: true }); } - function sha1(bytes) { - const K2 = [1518500249, 1859775393, 2400959708, 3395469782]; - const H = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; - if (typeof bytes === "string") { - const msg = unescape(encodeURIComponent(bytes)); - bytes = []; - for (let i2 = 0; i2 < msg.length; ++i2) { - bytes.push(msg.charCodeAt(i2)); - } - } else if (!Array.isArray(bytes)) { - bytes = Array.prototype.slice.call(bytes); + function isAstNodeInRange(astNode, range3) { + var _a; + if (!range3) { + return true; } - bytes.push(128); - const l = bytes.length / 4 + 2; - const N = Math.ceil(l / 16); - const M = new Array(N); - for (let i2 = 0; i2 < N; ++i2) { - const arr = new Uint32Array(16); - for (let j = 0; j < 16; ++j) { - arr[j] = bytes[i2 * 64 + j * 4] << 24 | bytes[i2 * 64 + j * 4 + 1] << 16 | bytes[i2 * 64 + j * 4 + 2] << 8 | bytes[i2 * 64 + j * 4 + 3]; - } - M[i2] = arr; - } - M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); - M[N - 1][14] = Math.floor(M[N - 1][14]); - M[N - 1][15] = (bytes.length - 1) * 8 & 4294967295; - for (let i2 = 0; i2 < N; ++i2) { - const W = new Uint32Array(80); - for (let t = 0; t < 16; ++t) { - W[t] = M[i2][t]; - } - for (let t = 16; t < 80; ++t) { - W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); - } - let a = H[0]; - let b = H[1]; - let c2 = H[2]; - let d = H[3]; - let e = H[4]; - for (let t = 0; t < 80; ++t) { - const s = Math.floor(t / 20); - const T2 = ROTL(a, 5) + f(s, b, c2, d) + e + K2[s] + W[t] >>> 0; - e = d; - d = c2; - c2 = ROTL(b, 30) >>> 0; - b = a; - a = T2; - } - H[0] = H[0] + a >>> 0; - H[1] = H[1] + b >>> 0; - H[2] = H[2] + c2 >>> 0; - H[3] = H[3] + d >>> 0; - H[4] = H[4] + e >>> 0; - } - return [H[0] >> 24 & 255, H[0] >> 16 & 255, H[0] >> 8 & 255, H[0] & 255, H[1] >> 24 & 255, H[1] >> 16 & 255, H[1] >> 8 & 255, H[1] & 255, H[2] >> 24 & 255, H[2] >> 16 & 255, H[2] >> 8 & 255, H[2] & 255, H[3] >> 24 & 255, H[3] >> 16 & 255, H[3] >> 8 & 255, H[3] & 255, H[4] >> 24 & 255, H[4] >> 16 & 255, H[4] >> 8 & 255, H[4] & 255]; - } - const v5 = v35("v5", 80, sha1); - const uuid5 = v5; - const BAD_ID_CHARS_REGEXP = /[^\dA-Za-z](\W)*/g; - let conf$6 = {}; - let entityNameIds = /* @__PURE__ */ new Map(); - const setConf$6 = function(cnf) { - const keys2 = Object.keys(cnf); - for (const key of keys2) { - conf$6[key] = cnf[key]; + const nodeRange = (_a = astNode.$cstNode) === null || _a === void 0 ? void 0 : _a.range; + if (!nodeRange) { + return false; } - }; - const drawAttributes = (groupNode, entityTextNode, attributes) => { - const heightPadding = conf$6.entityPadding / 3; - const widthPadding = conf$6.entityPadding / 3; - const attrFontSize = conf$6.fontSize * 0.85; - const labelBBox = entityTextNode.node().getBBox(); - const attributeNodes = []; - let hasKeyType = false; - let hasComment = false; - let maxTypeWidth = 0; - let maxNameWidth = 0; - let maxKeyWidth = 0; - let maxCommentWidth = 0; - let cumulativeHeight = labelBBox.height + heightPadding * 2; - let attrNum = 1; - attributes.forEach((item) => { - if (item.attributeKeyTypeList !== void 0 && item.attributeKeyTypeList.length > 0) { - hasKeyType = true; - } - if (item.attributeComment !== void 0) { - hasComment = true; + return inRange(nodeRange, range3); + } + function streamReferences(node2) { + return new StreamImpl(() => ({ + keys: Object.keys(node2), + keyIndex: 0, + arrayIndex: 0 + }), (state4) => { + while (state4.keyIndex < state4.keys.length) { + const property2 = state4.keys[state4.keyIndex]; + if (!property2.startsWith("$")) { + const value2 = node2[property2]; + if (isReference(value2)) { + state4.keyIndex++; + return { done: false, value: { reference: value2, container: node2, property: property2 } }; + } else if (Array.isArray(value2)) { + while (state4.arrayIndex < value2.length) { + const index = state4.arrayIndex++; + const element3 = value2[index]; + if (isReference(element3)) { + return { done: false, value: { reference: element3, container: node2, property: property2, index } }; + } + } + state4.arrayIndex = 0; + } + } + state4.keyIndex++; } + return DONE_RESULT; }); - attributes.forEach((item) => { - const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`; - let nodeHeight = 0; - const attributeType = parseGenericTypes(item.attributeType); - const typeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-type`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig$1().fontFamily).style("font-size", attrFontSize + "px").text(attributeType); - const nameNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-name`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig$1().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeName); - const attributeNode = {}; - attributeNode.tn = typeNode; - attributeNode.nn = nameNode; - const typeBBox = typeNode.node().getBBox(); - const nameBBox = nameNode.node().getBBox(); - maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width); - maxNameWidth = Math.max(maxNameWidth, nameBBox.width); - nodeHeight = Math.max(typeBBox.height, nameBBox.height); - if (hasKeyType) { - const keyTypeNodeText = item.attributeKeyTypeList !== void 0 ? item.attributeKeyTypeList.join(",") : ""; - const keyTypeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-key`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig$1().fontFamily).style("font-size", attrFontSize + "px").text(keyTypeNodeText); - attributeNode.kn = keyTypeNode; - const keyTypeBBox = keyTypeNode.node().getBBox(); - maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width); - nodeHeight = Math.max(nodeHeight, keyTypeBBox.height); - } - if (hasComment) { - const commentNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-comment`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", getConfig$1().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeComment || ""); - attributeNode.cn = commentNode; - const commentNodeBBox = commentNode.node().getBBox(); - maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width); - nodeHeight = Math.max(nodeHeight, commentNodeBBox.height); - } - attributeNode.height = nodeHeight; - attributeNodes.push(attributeNode); - cumulativeHeight += nodeHeight + heightPadding * 2; - attrNum += 1; - }); - let widthPaddingFactor = 4; - if (hasKeyType) { - widthPaddingFactor += 2; - } - if (hasComment) { - widthPaddingFactor += 2; - } - const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth; - const bBox = { - width: Math.max( - conf$6.minEntityWidth, - Math.max( - labelBBox.width + conf$6.entityPadding * 2, - maxWidth + widthPadding * widthPaddingFactor - ) - ), - height: attributes.length > 0 ? cumulativeHeight : Math.max(conf$6.minEntityHeight, labelBBox.height + conf$6.entityPadding * 2) - }; - if (attributes.length > 0) { - const spareColumnWidth = Math.max( - 0, - (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2) - ); - entityTextNode.attr( - "transform", - "translate(" + bBox.width / 2 + "," + (heightPadding + labelBBox.height / 2) + ")" - ); - let heightOffset = labelBBox.height + heightPadding * 2; - let attribStyle = "attributeBoxOdd"; - attributeNodes.forEach((attributeNode) => { - const alignY = heightOffset + heightPadding + attributeNode.height / 2; - attributeNode.tn.attr("transform", "translate(" + widthPadding + "," + alignY + ")"); - const typeRect = groupNode.insert("rect", "#" + attributeNode.tn.node().id).classed(`er ${attribStyle}`, true).attr("x", 0).attr("y", heightOffset).attr("width", maxTypeWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); - const nameXOffset = parseFloat(typeRect.attr("x")) + parseFloat(typeRect.attr("width")); - attributeNode.nn.attr( - "transform", - "translate(" + (nameXOffset + widthPadding) + "," + alignY + ")" - ); - const nameRect = groupNode.insert("rect", "#" + attributeNode.nn.node().id).classed(`er ${attribStyle}`, true).attr("x", nameXOffset).attr("y", heightOffset).attr("width", maxNameWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); - let keyTypeAndCommentXOffset = parseFloat(nameRect.attr("x")) + parseFloat(nameRect.attr("width")); - if (hasKeyType) { - attributeNode.kn.attr( - "transform", - "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")" - ); - const keyTypeRect = groupNode.insert("rect", "#" + attributeNode.kn.node().id).classed(`er ${attribStyle}`, true).attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxKeyWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); - keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr("x")) + parseFloat(keyTypeRect.attr("width")); - } - if (hasComment) { - attributeNode.cn.attr( - "transform", - "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")" - ); - groupNode.insert("rect", "#" + attributeNode.cn.node().id).classed(`er ${attribStyle}`, "true").attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxCommentWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2); + } + function findLocalReferences(targetNode, lookup2 = getDocument(targetNode).parseResult.value) { + const refs = []; + streamAst(lookup2).forEach((node2) => { + streamReferences(node2).forEach((refInfo) => { + if (refInfo.reference.ref === targetNode) { + refs.push(refInfo.reference); } - heightOffset += attributeNode.height + heightPadding * 2; - attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd"; - }); - } else { - bBox.height = Math.max(conf$6.minEntityHeight, cumulativeHeight); - entityTextNode.attr("transform", "translate(" + bBox.width / 2 + "," + bBox.height / 2 + ")"); - } - return bBox; - }; - const drawEntities = function(svgNode2, entities2, graph) { - const keys2 = Object.keys(entities2); - let firstOne; - keys2.forEach(function(entityName) { - const entityId = generateId$1(entityName, "entity"); - entityNameIds.set(entityName, entityId); - const groupNode = svgNode2.append("g").attr("id", entityId); - firstOne = firstOne === void 0 ? entityId : firstOne; - const textId = "text-" + entityId; - const textNode = groupNode.append("text").classed("er entityLabel", true).attr("id", textId).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "middle").style("font-family", getConfig$1().fontFamily).style("font-size", conf$6.fontSize + "px").text(entities2[entityName].alias ?? entityName); - const { width: entityWidth, height: entityHeight } = drawAttributes( - groupNode, - textNode, - entities2[entityName].attributes - ); - const rectNode = groupNode.insert("rect", "#" + textId).classed("er entityBox", true).attr("x", 0).attr("y", 0).attr("width", entityWidth).attr("height", entityHeight); - const rectBBox = rectNode.node().getBBox(); - graph.setNode(entityId, { - width: rectBBox.width, - height: rectBBox.height, - shape: "rect", - id: entityId }); }); - return firstOne; - }; - const adjustEntities$1 = function(svgNode2, graph) { - graph.nodes().forEach(function(v) { - if (v !== void 0 && graph.node(v) !== void 0) { - svgNode2.select("#" + v).attr( - "transform", - "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y - graph.node(v).height / 2) + " )" - ); + return stream(refs); + } + function assignMandatoryProperties(reflection3, node2) { + const typeMetaData = reflection3.getTypeMetaData(node2.$type); + const genericNode = node2; + for (const property2 of typeMetaData.properties) { + if (property2.defaultValue !== void 0 && genericNode[property2.name] === void 0) { + genericNode[property2.name] = copyDefaultValue(property2.defaultValue); } - }); - }; - const getEdgeName = function(rel2) { - return (rel2.entityA + rel2.roleA + rel2.entityB).replace(/\s/g, ""); - }; - const addRelationships$1 = function(relationships2, g) { - relationships2.forEach(function(r) { - g.setEdge( - entityNameIds.get(r.entityA), - entityNameIds.get(r.entityB), - { relationship: r }, - getEdgeName(r) - ); - }); - return relationships2; - }; - let relCnt$1 = 0; - const drawRelationshipFromLayout$1 = function(svg2, rel2, g, insert, diagObj) { - relCnt$1++; - const edge = g.edge( - entityNameIds.get(rel2.entityA), - entityNameIds.get(rel2.entityB), - getEdgeName(rel2) - ); - const lineFunction = line$1().x(function(d) { - return d.x; - }).y(function(d) { - return d.y; - }).curve(curveBasis); - const svgPath = svg2.insert("path", "#" + insert).classed("er relationshipLine", true).attr("d", lineFunction(edge.points)).style("stroke", conf$6.stroke).style("fill", "none"); - if (rel2.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) { - svgPath.attr("stroke-dasharray", "8,8"); - } - let url = ""; - if (conf$6.arrowMarkerAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, "\\("); - url = url.replace(/\)/g, "\\)"); - } - switch (rel2.relSpec.cardA) { - case diagObj.db.Cardinality.ZERO_OR_ONE: - svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_END + ")"); - break; - case diagObj.db.Cardinality.ZERO_OR_MORE: - svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_END + ")"); - break; - case diagObj.db.Cardinality.ONE_OR_MORE: - svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_END + ")"); - break; - case diagObj.db.Cardinality.ONLY_ONE: - svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_END + ")"); - break; - case diagObj.db.Cardinality.MD_PARENT: - svgPath.attr("marker-end", "url(" + url + "#" + erMarkers.ERMarkers.MD_PARENT_END + ")"); - break; - } - switch (rel2.relSpec.cardB) { - case diagObj.db.Cardinality.ZERO_OR_ONE: - svgPath.attr( - "marker-start", - "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_ONE_START + ")" - ); - break; - case diagObj.db.Cardinality.ZERO_OR_MORE: - svgPath.attr( - "marker-start", - "url(" + url + "#" + erMarkers.ERMarkers.ZERO_OR_MORE_START + ")" - ); - break; - case diagObj.db.Cardinality.ONE_OR_MORE: - svgPath.attr( - "marker-start", - "url(" + url + "#" + erMarkers.ERMarkers.ONE_OR_MORE_START + ")" - ); - break; - case diagObj.db.Cardinality.ONLY_ONE: - svgPath.attr("marker-start", "url(" + url + "#" + erMarkers.ERMarkers.ONLY_ONE_START + ")"); - break; - case diagObj.db.Cardinality.MD_PARENT: - svgPath.attr("marker-start", "url(" + url + "#" + erMarkers.ERMarkers.MD_PARENT_START + ")"); - break; } - const len = svgPath.node().getTotalLength(); - const labelPoint = svgPath.node().getPointAtLength(len * 0.5); - const labelId = "rel" + relCnt$1; - const labelNode = svg2.append("text").classed("er relationshipLabel", true).attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", getConfig$1().fontFamily).style("font-size", conf$6.fontSize + "px").text(rel2.roleA); - const labelBBox = labelNode.node().getBBox(); - svg2.insert("rect", "#" + labelId).classed("er relationshipLabelBox", true).attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height); - }; - const draw$i = function(text2, id2, _version, diagObj) { - conf$6 = getConfig$1().er; - log$1.info("Drawing ER diagram"); - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = root2.select(`[id='${id2}']`); - erMarkers.insertMarkers(svg2, conf$6); - let g; - g = new Graph({ - multigraph: true, - directed: true, - compound: false - }).setGraph({ - rankdir: conf$6.layoutDirection, - marginx: 20, - marginy: 20, - nodesep: 100, - edgesep: 100, - ranksep: 100 - }).setDefaultEdgeLabel(function() { - return {}; - }); - const firstEntity = drawEntities(svg2, diagObj.db.getEntities(), g); - const relationships2 = addRelationships$1(diagObj.db.getRelationships(), g); - layout$1(g); - adjustEntities$1(svg2, g); - relationships2.forEach(function(rel2) { - drawRelationshipFromLayout$1(svg2, rel2, g, firstEntity, diagObj); - }); - const padding2 = conf$6.diagramPadding; - utils$1.insertTitle(svg2, "entityTitleText", conf$6.titleTopMargin, diagObj.db.getDiagramTitle()); - const svgBounds = svg2.node().getBBox(); - const width2 = svgBounds.width + padding2 * 2; - const height = svgBounds.height + padding2 * 2; - configureSvgSize(svg2, height, width2, conf$6.useMaxWidth); - svg2.attr("viewBox", `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height}`); - }; - const MERMAID_ERDIAGRAM_UUID = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c"; - function generateId$1(str2 = "", prefix = "") { - const simplifiedStr = str2.replace(BAD_ID_CHARS_REGEXP, ""); - return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${uuid5( - str2, - MERMAID_ERDIAGRAM_UUID - )}`; } - function strWithHyphen(str2 = "") { - return str2.length > 0 ? `${str2}-` : ""; + function copyDefaultValue(propertyType) { + if (Array.isArray(propertyType)) { + return [...propertyType.map(copyDefaultValue)]; + } else { + return propertyType; + } + } + function copyAstNode(node2, buildReference) { + const copy6 = { $type: node2.$type }; + for (const [name, value2] of Object.entries(node2)) { + if (!name.startsWith("$")) { + if (isAstNode(value2)) { + copy6[name] = copyAstNode(value2, buildReference); + } else if (isReference(value2)) { + copy6[name] = buildReference(copy6, name, value2.$refNode, value2.$refText); + } else if (Array.isArray(value2)) { + const copiedArray = []; + for (const element3 of value2) { + if (isAstNode(element3)) { + copiedArray.push(copyAstNode(element3, buildReference)); + } else if (isReference(element3)) { + copiedArray.push(buildReference(copy6, name, element3.$refNode, element3.$refText)); + } else { + copiedArray.push(element3); + } + } + copy6[name] = copiedArray; + } else { + copy6[name] = value2; + } + } + } + linkContentToContainer(copy6); + return copy6; + } + var init_ast_utils = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/ast-utils.js"() { + "use strict"; + init_syntax_tree(); + init_stream(); + init_cst_utils(); + __name(linkContentToContainer, "linkContentToContainer"); + __name(getContainerOfType, "getContainerOfType"); + __name(hasContainerOfType, "hasContainerOfType"); + __name(getDocument, "getDocument"); + __name(findRootNode, "findRootNode"); + __name(streamContents, "streamContents"); + __name(streamAllContents, "streamAllContents"); + __name(streamAst, "streamAst"); + __name(isAstNodeInRange, "isAstNodeInRange"); + __name(streamReferences, "streamReferences"); + __name(findLocalReferences, "findLocalReferences"); + __name(assignMandatoryProperties, "assignMandatoryProperties"); + __name(copyDefaultValue, "copyDefaultValue"); + __name(copyAstNode, "copyAstNode"); + } + }); + + // ../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/utils.js + function cc(char2) { + return char2.charCodeAt(0); + } + function insertToSet(item, set6) { + if (Array.isArray(item)) { + item.forEach(function(subItem) { + set6.push(subItem); + }); + } else { + set6.push(item); + } } - const erRenderer = { - setConf: setConf$6, - draw: draw$i - }; - const getStyles$c = (options2) => ` - .entityBox { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; + function addFlag(flagObj, flagKey) { + if (flagObj[flagKey] === true) { + throw "duplicate flag " + flagKey; + } + const x5 = flagObj[flagKey]; + flagObj[flagKey] = true; } - - .attributeBoxOdd { - fill: ${options2.attributeBackgroundColorOdd}; - stroke: ${options2.nodeBorder}; + function ASSERT_EXISTS(obj) { + if (obj === void 0) { + throw Error("Internal Error - Should never get here!"); + } + return true; } - - .attributeBoxEven { - fill: ${options2.attributeBackgroundColorEven}; - stroke: ${options2.nodeBorder}; + function ASSERT_NEVER_REACH_HERE() { + throw Error("Internal Error - Should never get here!"); } - - .relationshipLabelBox { - fill: ${options2.tertiaryColor}; - opacity: 0.7; - background-color: ${options2.tertiaryColor}; - rect { - opacity: 0.5; - } + function isCharacter(obj) { + return obj["type"] === "Character"; } + var init_utils3 = __esm({ + "../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/utils.js"() { + "use strict"; + __name(cc, "cc"); + __name(insertToSet, "insertToSet"); + __name(addFlag, "addFlag"); + __name(ASSERT_EXISTS, "ASSERT_EXISTS"); + __name(ASSERT_NEVER_REACH_HERE, "ASSERT_NEVER_REACH_HERE"); + __name(isCharacter, "isCharacter"); + } + }); - .relationshipLine { - stroke: ${options2.lineColor}; + // ../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/character-classes.js + var digitsCharCodes, wordCharCodes, whitespaceCodes; + var init_character_classes = __esm({ + "../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/character-classes.js"() { + "use strict"; + init_utils3(); + digitsCharCodes = []; + for (let i2 = cc("0"); i2 <= cc("9"); i2++) { + digitsCharCodes.push(i2); + } + wordCharCodes = [cc("_")].concat(digitsCharCodes); + for (let i2 = cc("a"); i2 <= cc("z"); i2++) { + wordCharCodes.push(i2); + } + for (let i2 = cc("A"); i2 <= cc("Z"); i2++) { + wordCharCodes.push(i2); + } + whitespaceCodes = [ + cc(" "), + cc("\f"), + cc("\n"), + cc("\r"), + cc(" "), + cc("\v"), + cc(" "), + cc("\xA0"), + cc("\u1680"), + cc("\u2000"), + cc("\u2001"), + cc("\u2002"), + cc("\u2003"), + cc("\u2004"), + cc("\u2005"), + cc("\u2006"), + cc("\u2007"), + cc("\u2008"), + cc("\u2009"), + cc("\u200A"), + cc("\u2028"), + cc("\u2029"), + cc("\u202F"), + cc("\u205F"), + cc("\u3000"), + cc("\uFEFF") + ]; } + }); - .entityTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; - } - #MD_PARENT_START { - fill: #f5f5f5 !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; - } - #MD_PARENT_END { - fill: #f5f5f5 !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; - } - -`; - const erStyles = getStyles$c; - const diagram$i = { - parser: erParser, - db: erDb, - renderer: erRenderer, - styles: erStyles - }; - const erDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$i - }, Symbol.toStringTag, { value: "Module" })); - var parser$r = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 3], $V1 = [1, 6], $V2 = [1, 4], $V3 = [1, 5], $V4 = [2, 5], $V5 = [1, 12], $V6 = [5, 7, 13, 19, 21, 23, 24, 26, 28, 31, 37, 40, 47], $V7 = [7, 13, 19, 21, 23, 24, 26, 28, 31, 37, 40], $V8 = [7, 12, 13, 19, 21, 23, 24, 26, 28, 31, 37, 40], $V9 = [7, 13, 47], $Va = [1, 42], $Vb = [1, 41], $Vc = [7, 13, 29, 32, 35, 38, 47], $Vd = [1, 55], $Ve = [1, 56], $Vf = [1, 57], $Vg = [7, 13, 32, 35, 42, 47]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "eol": 4, "GG": 5, "document": 6, "EOF": 7, ":": 8, "DIR": 9, "options": 10, "body": 11, "OPT": 12, "NL": 13, "line": 14, "statement": 15, "commitStatement": 16, "mergeStatement": 17, "cherryPickStatement": 18, "acc_title": 19, "acc_title_value": 20, "acc_descr": 21, "acc_descr_value": 22, "acc_descr_multiline_value": 23, "section": 24, "branchStatement": 25, "CHECKOUT": 26, "ref": 27, "BRANCH": 28, "ORDER": 29, "NUM": 30, "CHERRY_PICK": 31, "COMMIT_ID": 32, "STR": 33, "PARENT_COMMIT": 34, "COMMIT_TAG": 35, "EMPTYSTR": 36, "MERGE": 37, "COMMIT_TYPE": 38, "commitType": 39, "COMMIT": 40, "commit_arg": 41, "COMMIT_MSG": 42, "NORMAL": 43, "REVERSE": 44, "HIGHLIGHT": 45, "ID": 46, ";": 47, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 5: "GG", 7: "EOF", 8: ":", 9: "DIR", 12: "OPT", 13: "NL", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "section", 26: "CHECKOUT", 28: "BRANCH", 29: "ORDER", 30: "NUM", 31: "CHERRY_PICK", 32: "COMMIT_ID", 33: "STR", 34: "PARENT_COMMIT", 35: "COMMIT_TAG", 36: "EMPTYSTR", 37: "MERGE", 38: "COMMIT_TYPE", 40: "COMMIT", 42: "COMMIT_MSG", 43: "NORMAL", 44: "REVERSE", 45: "HIGHLIGHT", 46: "ID", 47: ";" }, - productions_: [0, [3, 2], [3, 3], [3, 4], [3, 5], [6, 0], [6, 2], [10, 2], [10, 1], [11, 0], [11, 2], [14, 2], [14, 1], [15, 1], [15, 1], [15, 1], [15, 2], [15, 2], [15, 1], [15, 1], [15, 1], [15, 2], [25, 2], [25, 4], [18, 3], [18, 5], [18, 5], [18, 7], [18, 7], [18, 5], [18, 5], [18, 5], [18, 7], [18, 7], [18, 7], [18, 7], [17, 2], [17, 4], [17, 4], [17, 4], [17, 6], [17, 6], [17, 6], [17, 6], [17, 6], [17, 6], [17, 8], [17, 8], [17, 8], [17, 8], [17, 8], [17, 8], [16, 2], [16, 3], [16, 3], [16, 5], [16, 5], [16, 3], [16, 5], [16, 5], [16, 5], [16, 5], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 3], [16, 5], [16, 5], [16, 5], [16, 5], [16, 5], [16, 5], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 7], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [16, 9], [41, 0], [41, 1], [39, 1], [39, 1], [39, 1], [27, 1], [27, 1], [4, 1], [4, 1], [4, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 2: - return $$[$0]; - case 3: - return $$[$0 - 1]; - case 4: - yy.setDirection($$[$0 - 3]); - return $$[$0 - 1]; - case 6: - yy.setOptions($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 7: - $$[$0 - 1] += $$[$0]; - this.$ = $$[$0 - 1]; - break; - case 9: - this.$ = []; - break; - case 10: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 11: - this.$ = $$[$0 - 1]; - break; - case 16: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 17: - case 18: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 19: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 21: - yy.checkout($$[$0]); - break; - case 22: - yy.branch($$[$0]); - break; - case 23: - yy.branch($$[$0 - 2], $$[$0]); - break; - case 24: - yy.cherryPick($$[$0], "", void 0); - break; - case 25: - yy.cherryPick($$[$0 - 2], "", void 0, $$[$0]); - break; - case 26: - yy.cherryPick($$[$0 - 2], "", $$[$0]); - break; - case 27: - yy.cherryPick($$[$0 - 4], "", $$[$0], $$[$0 - 2]); - break; - case 28: - yy.cherryPick($$[$0 - 4], "", $$[$0 - 2], $$[$0]); - break; - case 29: - yy.cherryPick($$[$0], "", $$[$0 - 2]); - break; - case 30: - yy.cherryPick($$[$0], "", ""); - break; - case 31: - yy.cherryPick($$[$0 - 2], "", ""); - break; - case 32: - yy.cherryPick($$[$0 - 4], "", "", $$[$0 - 2]); - break; - case 33: - yy.cherryPick($$[$0 - 4], "", "", $$[$0]); - break; - case 34: - yy.cherryPick($$[$0 - 2], "", $$[$0 - 4], $$[$0]); - break; - case 35: - yy.cherryPick($$[$0 - 2], "", "", $$[$0]); - break; - case 36: - yy.merge($$[$0], "", "", ""); - break; - case 37: - yy.merge($$[$0 - 2], $$[$0], "", ""); - break; - case 38: - yy.merge($$[$0 - 2], "", $$[$0], ""); - break; - case 39: - yy.merge($$[$0 - 2], "", "", $$[$0]); - break; - case 40: - yy.merge($$[$0 - 4], $$[$0], "", $$[$0 - 2]); - break; - case 41: - yy.merge($$[$0 - 4], "", $$[$0], $$[$0 - 2]); - break; - case 42: - yy.merge($$[$0 - 4], "", $$[$0 - 2], $$[$0]); - break; - case 43: - yy.merge($$[$0 - 4], $$[$0 - 2], $$[$0], ""); - break; - case 44: - yy.merge($$[$0 - 4], $$[$0 - 2], "", $$[$0]); - break; - case 45: - yy.merge($$[$0 - 4], $$[$0], $$[$0 - 2], ""); - break; - case 46: - yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]); - break; - case 47: - yy.merge($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]); - break; - case 48: - yy.merge($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]); - break; - case 49: - yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 50: - yy.merge($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]); - break; - case 51: - yy.merge($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 52: - yy.commit($$[$0]); - break; - case 53: - yy.commit("", "", yy.commitType.NORMAL, $$[$0]); - break; - case 54: - yy.commit("", "", $$[$0], ""); - break; - case 55: - yy.commit("", "", $$[$0], $$[$0 - 2]); - break; - case 56: - yy.commit("", "", $$[$0 - 2], $$[$0]); - break; - case 57: - yy.commit("", $$[$0], yy.commitType.NORMAL, ""); - break; - case 58: - yy.commit("", $$[$0 - 2], yy.commitType.NORMAL, $$[$0]); - break; - case 59: - yy.commit("", $$[$0], yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 60: - yy.commit("", $$[$0 - 2], $$[$0], ""); - break; - case 61: - yy.commit("", $$[$0], $$[$0 - 2], ""); - break; - case 62: - yy.commit("", $$[$0 - 4], $$[$0 - 2], $$[$0]); - break; - case 63: - yy.commit("", $$[$0 - 4], $$[$0], $$[$0 - 2]); - break; - case 64: - yy.commit("", $$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 65: - yy.commit("", $$[$0], $$[$0 - 4], $$[$0 - 2]); - break; - case 66: - yy.commit("", $$[$0], $$[$0 - 2], $$[$0 - 4]); - break; - case 67: - yy.commit("", $$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 68: - yy.commit($$[$0], "", yy.commitType.NORMAL, ""); - break; - case 69: - yy.commit($$[$0], "", yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 70: - yy.commit($$[$0 - 2], "", yy.commitType.NORMAL, $$[$0]); - break; - case 71: - yy.commit($$[$0 - 2], "", $$[$0], ""); - break; - case 72: - yy.commit($$[$0], "", $$[$0 - 2], ""); - break; - case 73: - yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, ""); - break; - case 74: - yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, ""); - break; - case 75: - yy.commit($$[$0 - 4], "", $$[$0 - 2], $$[$0]); - break; - case 76: - yy.commit($$[$0 - 4], "", $$[$0], $$[$0 - 2]); - break; - case 77: - yy.commit($$[$0 - 2], "", $$[$0 - 4], $$[$0]); - break; - case 78: - yy.commit($$[$0], "", $$[$0 - 4], $$[$0 - 2]); - break; - case 79: - yy.commit($$[$0], "", $$[$0 - 2], $$[$0 - 4]); - break; - case 80: - yy.commit($$[$0 - 2], "", $$[$0], $$[$0 - 4]); - break; - case 81: - yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], ""); - break; - case 82: - yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], ""); - break; - case 83: - yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], ""); - break; - case 84: - yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], ""); - break; - case 85: - yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], ""); - break; - case 86: - yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], ""); - break; - case 87: - yy.commit($$[$0 - 4], $$[$0], yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 88: - yy.commit($$[$0 - 4], $$[$0 - 2], yy.commitType.NORMAL, $$[$0]); - break; - case 89: - yy.commit($$[$0 - 2], $$[$0], yy.commitType.NORMAL, $$[$0 - 4]); - break; - case 90: - yy.commit($$[$0], $$[$0 - 2], yy.commitType.NORMAL, $$[$0 - 4]); - break; - case 91: - yy.commit($$[$0], $$[$0 - 4], yy.commitType.NORMAL, $$[$0 - 2]); - break; - case 92: - yy.commit($$[$0 - 2], $$[$0 - 4], yy.commitType.NORMAL, $$[$0]); - break; - case 93: - yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0 - 2], $$[$0]); - break; - case 94: - yy.commit($$[$0 - 6], $$[$0 - 4], $$[$0], $$[$0 - 2]); - break; - case 95: - yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 96: - yy.commit($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 2]); - break; - case 97: - yy.commit($$[$0 - 6], $$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 98: - yy.commit($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 4]); - break; - case 99: - yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0 - 2], $$[$0]); - break; - case 100: - yy.commit($$[$0 - 4], $$[$0 - 6], $$[$0], $$[$0 - 2]); - break; - case 101: - yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0 - 4], $$[$0]); - break; - case 102: - yy.commit($$[$0], $$[$0 - 6], $$[$0 - 4], $$[$0 - 2]); - break; - case 103: - yy.commit($$[$0 - 2], $$[$0 - 6], $$[$0], $$[$0 - 4]); - break; - case 104: - yy.commit($$[$0], $$[$0 - 6], $$[$0 - 2], $$[$0 - 4]); - break; - case 105: - yy.commit($$[$0], $$[$0 - 4], $$[$0 - 2], $$[$0 - 6]); - break; - case 106: - yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0], $$[$0 - 6]); - break; - case 107: - yy.commit($$[$0], $$[$0 - 2], $$[$0 - 4], $$[$0 - 6]); - break; - case 108: - yy.commit($$[$0 - 2], $$[$0], $$[$0 - 4], $$[$0 - 6]); - break; - case 109: - yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0], $$[$0 - 6]); - break; - case 110: - yy.commit($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 6]); - break; - case 111: - yy.commit($$[$0 - 2], $$[$0 - 4], $$[$0 - 6], $$[$0]); - break; - case 112: - yy.commit($$[$0], $$[$0 - 4], $$[$0 - 6], $$[$0 - 2]); - break; - case 113: - yy.commit($$[$0 - 2], $$[$0], $$[$0 - 6], $$[$0 - 4]); - break; - case 114: - yy.commit($$[$0], $$[$0 - 2], $$[$0 - 6], $$[$0 - 4]); - break; - case 115: - yy.commit($$[$0 - 4], $$[$0 - 2], $$[$0 - 6], $$[$0]); - break; - case 116: - yy.commit($$[$0 - 4], $$[$0], $$[$0 - 6], $$[$0 - 2]); - break; - case 117: - this.$ = ""; - break; - case 118: - this.$ = $$[$0]; - break; - case 119: - this.$ = yy.commitType.NORMAL; - break; - case 120: - this.$ = yy.commitType.REVERSE; - break; - case 121: - this.$ = yy.commitType.HIGHLIGHT; - break; + // ../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/regexp-parser.js + var hexDigitPattern, decimalPattern, decimalPatternNoZero, RegExpParser; + var init_regexp_parser = __esm({ + "../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/regexp-parser.js"() { + "use strict"; + init_utils3(); + init_character_classes(); + hexDigitPattern = /[0-9a-fA-F]/; + decimalPattern = /[0-9]/; + decimalPatternNoZero = /[1-9]/; + RegExpParser = class { + static { + __name(this, "RegExpParser"); + } + constructor() { + this.idx = 0; + this.input = ""; + this.groupIdx = 0; + } + saveState() { + return { + idx: this.idx, + input: this.input, + groupIdx: this.groupIdx + }; } - }, - table: [{ 3: 1, 4: 2, 5: $V0, 7: $V1, 13: $V2, 47: $V3 }, { 1: [3] }, { 3: 7, 4: 2, 5: $V0, 7: $V1, 13: $V2, 47: $V3 }, { 6: 8, 7: $V4, 8: [1, 9], 9: [1, 10], 10: 11, 13: $V5 }, o($V6, [2, 124]), o($V6, [2, 125]), o($V6, [2, 126]), { 1: [2, 1] }, { 7: [1, 13] }, { 6: 14, 7: $V4, 10: 11, 13: $V5 }, { 8: [1, 15] }, o($V7, [2, 9], { 11: 16, 12: [1, 17] }), o($V8, [2, 8]), { 1: [2, 2] }, { 7: [1, 18] }, { 6: 19, 7: $V4, 10: 11, 13: $V5 }, { 7: [2, 6], 13: [1, 22], 14: 20, 15: 21, 16: 23, 17: 24, 18: 25, 19: [1, 26], 21: [1, 27], 23: [1, 28], 24: [1, 29], 25: 30, 26: [1, 31], 28: [1, 35], 31: [1, 34], 37: [1, 33], 40: [1, 32] }, o($V8, [2, 7]), { 1: [2, 3] }, { 7: [1, 36] }, o($V7, [2, 10]), { 4: 37, 7: $V1, 13: $V2, 47: $V3 }, o($V7, [2, 12]), o($V9, [2, 13]), o($V9, [2, 14]), o($V9, [2, 15]), { 20: [1, 38] }, { 22: [1, 39] }, o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), { 27: 40, 33: $Va, 46: $Vb }, o($V9, [2, 117], { 41: 43, 32: [1, 46], 33: [1, 48], 35: [1, 44], 38: [1, 45], 42: [1, 47] }), { 27: 49, 33: $Va, 46: $Vb }, { 32: [1, 50], 35: [1, 51] }, { 27: 52, 33: $Va, 46: $Vb }, { 1: [2, 4] }, o($V7, [2, 11]), o($V9, [2, 16]), o($V9, [2, 17]), o($V9, [2, 21]), o($Vc, [2, 122]), o($Vc, [2, 123]), o($V9, [2, 52]), { 33: [1, 53] }, { 39: 54, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 58] }, { 33: [1, 59] }, o($V9, [2, 118]), o($V9, [2, 36], { 32: [1, 60], 35: [1, 62], 38: [1, 61] }), { 33: [1, 63] }, { 33: [1, 64], 36: [1, 65] }, o($V9, [2, 22], { 29: [1, 66] }), o($V9, [2, 53], { 32: [1, 68], 38: [1, 67], 42: [1, 69] }), o($V9, [2, 54], { 32: [1, 71], 35: [1, 70], 42: [1, 72] }), o($Vg, [2, 119]), o($Vg, [2, 120]), o($Vg, [2, 121]), o($V9, [2, 57], { 35: [1, 73], 38: [1, 74], 42: [1, 75] }), o($V9, [2, 68], { 32: [1, 78], 35: [1, 76], 38: [1, 77] }), { 33: [1, 79] }, { 39: 80, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 81] }, o($V9, [2, 24], { 34: [1, 82], 35: [1, 83] }), { 32: [1, 84] }, { 32: [1, 85] }, { 30: [1, 86] }, { 39: 87, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 88] }, { 33: [1, 89] }, { 33: [1, 90] }, { 33: [1, 91] }, { 33: [1, 92] }, { 33: [1, 93] }, { 39: 94, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 95] }, { 33: [1, 96] }, { 39: 97, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 98] }, o($V9, [2, 37], { 35: [1, 100], 38: [1, 99] }), o($V9, [2, 38], { 32: [1, 102], 35: [1, 101] }), o($V9, [2, 39], { 32: [1, 103], 38: [1, 104] }), { 33: [1, 105] }, { 33: [1, 106], 36: [1, 107] }, { 33: [1, 108] }, { 33: [1, 109] }, o($V9, [2, 23]), o($V9, [2, 55], { 32: [1, 110], 42: [1, 111] }), o($V9, [2, 59], { 38: [1, 112], 42: [1, 113] }), o($V9, [2, 69], { 32: [1, 115], 38: [1, 114] }), o($V9, [2, 56], { 32: [1, 116], 42: [1, 117] }), o($V9, [2, 61], { 35: [1, 118], 42: [1, 119] }), o($V9, [2, 72], { 32: [1, 121], 35: [1, 120] }), o($V9, [2, 58], { 38: [1, 122], 42: [1, 123] }), o($V9, [2, 60], { 35: [1, 124], 42: [1, 125] }), o($V9, [2, 73], { 35: [1, 127], 38: [1, 126] }), o($V9, [2, 70], { 32: [1, 129], 38: [1, 128] }), o($V9, [2, 71], { 32: [1, 131], 35: [1, 130] }), o($V9, [2, 74], { 35: [1, 133], 38: [1, 132] }), { 39: 134, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 135] }, { 33: [1, 136] }, { 33: [1, 137] }, { 33: [1, 138] }, { 39: 139, 43: $Vd, 44: $Ve, 45: $Vf }, o($V9, [2, 25], { 35: [1, 140] }), o($V9, [2, 26], { 34: [1, 141] }), o($V9, [2, 31], { 34: [1, 142] }), o($V9, [2, 29], { 34: [1, 143] }), o($V9, [2, 30], { 34: [1, 144] }), { 33: [1, 145] }, { 33: [1, 146] }, { 39: 147, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 148] }, { 39: 149, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 150] }, { 33: [1, 151] }, { 33: [1, 152] }, { 33: [1, 153] }, { 33: [1, 154] }, { 33: [1, 155] }, { 33: [1, 156] }, { 39: 157, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 158] }, { 33: [1, 159] }, { 33: [1, 160] }, { 39: 161, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 162] }, { 39: 163, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 164] }, { 33: [1, 165] }, { 33: [1, 166] }, { 39: 167, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 168] }, o($V9, [2, 43], { 35: [1, 169] }), o($V9, [2, 44], { 38: [1, 170] }), o($V9, [2, 42], { 32: [1, 171] }), o($V9, [2, 45], { 35: [1, 172] }), o($V9, [2, 40], { 38: [1, 173] }), o($V9, [2, 41], { 32: [1, 174] }), { 33: [1, 175], 36: [1, 176] }, { 33: [1, 177] }, { 33: [1, 178] }, { 33: [1, 179] }, { 33: [1, 180] }, o($V9, [2, 66], { 42: [1, 181] }), o($V9, [2, 79], { 32: [1, 182] }), o($V9, [2, 67], { 42: [1, 183] }), o($V9, [2, 90], { 38: [1, 184] }), o($V9, [2, 80], { 32: [1, 185] }), o($V9, [2, 89], { 38: [1, 186] }), o($V9, [2, 65], { 42: [1, 187] }), o($V9, [2, 78], { 32: [1, 188] }), o($V9, [2, 64], { 42: [1, 189] }), o($V9, [2, 84], { 35: [1, 190] }), o($V9, [2, 77], { 32: [1, 191] }), o($V9, [2, 83], { 35: [1, 192] }), o($V9, [2, 63], { 42: [1, 193] }), o($V9, [2, 91], { 38: [1, 194] }), o($V9, [2, 62], { 42: [1, 195] }), o($V9, [2, 85], { 35: [1, 196] }), o($V9, [2, 86], { 35: [1, 197] }), o($V9, [2, 92], { 38: [1, 198] }), o($V9, [2, 76], { 32: [1, 199] }), o($V9, [2, 87], { 38: [1, 200] }), o($V9, [2, 75], { 32: [1, 201] }), o($V9, [2, 81], { 35: [1, 202] }), o($V9, [2, 82], { 35: [1, 203] }), o($V9, [2, 88], { 38: [1, 204] }), { 33: [1, 205] }, { 39: 206, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 207] }, { 33: [1, 208] }, { 39: 209, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 210] }, o($V9, [2, 27]), o($V9, [2, 32]), o($V9, [2, 28]), o($V9, [2, 33]), o($V9, [2, 34]), o($V9, [2, 35]), { 33: [1, 211] }, { 33: [1, 212] }, { 33: [1, 213] }, { 39: 214, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 215] }, { 39: 216, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 217] }, { 33: [1, 218] }, { 33: [1, 219] }, { 33: [1, 220] }, { 33: [1, 221] }, { 33: [1, 222] }, { 33: [1, 223] }, { 39: 224, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 225] }, { 33: [1, 226] }, { 33: [1, 227] }, { 39: 228, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 229] }, { 39: 230, 43: $Vd, 44: $Ve, 45: $Vf }, { 33: [1, 231] }, { 33: [1, 232] }, { 33: [1, 233] }, { 39: 234, 43: $Vd, 44: $Ve, 45: $Vf }, o($V9, [2, 46]), o($V9, [2, 48]), o($V9, [2, 47]), o($V9, [2, 49]), o($V9, [2, 51]), o($V9, [2, 50]), o($V9, [2, 107]), o($V9, [2, 108]), o($V9, [2, 105]), o($V9, [2, 106]), o($V9, [2, 110]), o($V9, [2, 109]), o($V9, [2, 114]), o($V9, [2, 113]), o($V9, [2, 112]), o($V9, [2, 111]), o($V9, [2, 116]), o($V9, [2, 115]), o($V9, [2, 104]), o($V9, [2, 103]), o($V9, [2, 102]), o($V9, [2, 101]), o($V9, [2, 99]), o($V9, [2, 100]), o($V9, [2, 98]), o($V9, [2, 97]), o($V9, [2, 96]), o($V9, [2, 95]), o($V9, [2, 93]), o($V9, [2, 94])], - defaultActions: { 7: [2, 1], 13: [2, 2], 18: [2, 3], 36: [2, 4] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + restoreState(newState2) { + this.idx = newState2.idx; + this.input = newState2.input; + this.groupIdx = newState2.groupIdx; + } + pattern(input) { + this.idx = 0; + this.input = input; + this.groupIdx = 0; + this.consumeChar("/"); + const value2 = this.disjunction(); + this.consumeChar("/"); + const flags = { + type: "Flags", + loc: { begin: this.idx, end: input.length }, + global: false, + ignoreCase: false, + multiLine: false, + unicode: false, + sticky: false + }; + while (this.isRegExpFlag()) { + switch (this.popChar()) { + case "g": + addFlag(flags, "global"); + break; + case "i": + addFlag(flags, "ignoreCase"); + break; + case "m": + addFlag(flags, "multiLine"); + break; + case "u": + addFlag(flags, "unicode"); + break; + case "y": + addFlag(flags, "sticky"); + break; + } + } + if (this.idx !== this.input.length) { + throw Error("Redundant input: " + this.input.substring(this.idx)); + } + return { + type: "Pattern", + flags, + value: value2, + loc: this.loc(0) + }; } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + disjunction() { + const alts = []; + const begin = this.idx; + alts.push(this.alternative()); + while (this.peekChar() === "|") { + this.consumeChar("|"); + alts.push(this.alternative()); + } + return { type: "Disjunction", value: alts, loc: this.loc(begin) }; } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; + alternative() { + const terms = []; + const begin = this.idx; + while (this.isTerm()) { + terms.push(this.term()); } - return token2; + return { type: "Alternative", value: terms, loc: this.loc(begin) }; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; + term() { + if (this.isAssertion()) { + return this.assertion(); } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; + return this.atom(); } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); + } + assertion() { + const begin = this.idx; + switch (this.popChar()) { + case "^": + return { + type: "StartAnchor", + loc: this.loc(begin) + }; + case "$": + return { type: "EndAnchor", loc: this.loc(begin) }; + case "\\": + switch (this.popChar()) { + case "b": + return { + type: "WordBoundary", + loc: this.loc(begin) + }; + case "B": + return { + type: "NonWordBoundary", + loc: this.loc(begin) + }; } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; + throw Error("Invalid Assertion Escape"); + case "(": + this.consumeChar("?"); + let type3; + switch (this.popChar()) { + case "=": + type3 = "Lookahead"; + break; + case "!": + type3 = "NegativeLookahead"; + break; } + ASSERT_EXISTS(type3); + const disjunction = this.disjunction(); + this.consumeChar(")"); + return { + type: type3, + value: disjunction, + loc: this.loc(begin) + }; + } + return ASSERT_NEVER_REACH_HERE(); + } + quantifier(isBacktracking = false) { + let range3 = void 0; + const begin = this.idx; + switch (this.popChar()) { + case "*": + range3 = { + atLeast: 0, + atMost: Infinity + }; break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column + case "+": + range3 = { + atLeast: 1, + atMost: Infinity }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; + break; + case "?": + range3 = { + atLeast: 0, + atMost: 1 + }; + break; + case "{": + const atLeast = this.integerIncludingZero(); + switch (this.popChar()) { + case "}": + range3 = { + atLeast, + atMost: atLeast + }; + break; + case ",": + let atMost; + if (this.isDigit()) { + atMost = this.integerIncludingZero(); + range3 = { + atLeast, + atMost + }; + } else { + range3 = { + atLeast, + atMost: Infinity + }; + } + this.consumeChar("}"); + break; + } + if (isBacktracking === true && range3 === void 0) { + return void 0; } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); + ASSERT_EXISTS(range3); break; - case 3: - return true; } - } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + if (isBacktracking === true && range3 === void 0) { + return void 0; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + if (ASSERT_EXISTS(range3)) { + if (this.peekChar(0) === "?") { + this.consumeChar("?"); + range3.greedy = false; + } else { + range3.greedy = true; + } + range3.type = "Quantifier"; + range3.loc = this.loc(begin); + return range3; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; + } + atom() { + let atom2; + const begin = this.idx; + switch (this.peekChar()) { + case ".": + atom2 = this.dotAll(); + break; + case "\\": + atom2 = this.atomEscape(); + break; + case "[": + atom2 = this.characterClass(); + break; + case "(": + atom2 = this.group(); + break; } - if (this.options.ranges) { - this.yylloc.range[1]++; + if (atom2 === void 0 && this.isPatternCharacter()) { + atom2 = this.patternCharacter(); } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + if (ASSERT_EXISTS(atom2)) { + atom2.loc = this.loc(begin); + if (this.isQuantifier()) { + atom2.quantifier = this.quantifier(); + } + return atom2; + } + return ASSERT_NEVER_REACH_HERE(); + } + dotAll() { + this.consumeChar("."); + return { + type: "Set", + complement: true, + value: [cc("\n"), cc("\r"), cc("\u2028"), cc("\u2029")] }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + atomEscape() { + this.consumeChar("\\"); + switch (this.peekChar()) { + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + return this.decimalEscapeAtom(); + case "d": + case "D": + case "s": + case "S": + case "w": + case "W": + return this.characterClassEscape(); + case "f": + case "n": + case "r": + case "t": + case "v": + return this.controlEscapeAtom(); + case "c": + return this.controlLetterEscapeAtom(); + case "0": + return this.nulCharacterAtom(); + case "x": + return this.hexEscapeSequenceAtom(); + case "u": + return this.regExpUnicodeEscapeSequenceAtom(); + default: + return this.identityEscapeAtom(); } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + } + decimalEscapeAtom() { + const value2 = this.positiveInteger(); + return { type: "GroupBackReference", value: value2 }; + } + characterClassEscape() { + let set6; + let complement = false; + switch (this.popChar()) { + case "d": + set6 = digitsCharCodes; + break; + case "D": + set6 = digitsCharCodes; + complement = true; + break; + case "s": + set6 = whitespaceCodes; + break; + case "S": + set6 = whitespaceCodes; + complement = true; + break; + case "w": + set6 = wordCharCodes; + break; + case "W": + set6 = wordCharCodes; + complement = true; + break; } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + if (ASSERT_EXISTS(set6)) { + return { type: "Set", value: set6, complement }; } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } + return ASSERT_NEVER_REACH_HERE(); + } + controlEscapeAtom() { + let escapeCode; + switch (this.popChar()) { + case "f": + escapeCode = cc("\f"); + break; + case "n": + escapeCode = cc("\n"); + break; + case "r": + escapeCode = cc("\r"); + break; + case "t": + escapeCode = cc(" "); + break; + case "v": + escapeCode = cc("\v"); + break; + } + if (ASSERT_EXISTS(escapeCode)) { + return { type: "Character", value: escapeCode }; + } + return ASSERT_NEVER_REACH_HERE(); + } + controlLetterEscapeAtom() { + this.consumeChar("c"); + const letter = this.popChar(); + if (/[a-zA-Z]/.test(letter) === false) { + throw Error("Invalid "); + } + const letterCode = letter.toUpperCase().charCodeAt(0) - 64; + return { type: "Character", value: letterCode }; + } + nulCharacterAtom() { + this.consumeChar("0"); + return { type: "Character", value: cc("\0") }; + } + hexEscapeSequenceAtom() { + this.consumeChar("x"); + return this.parseHexDigits(2); + } + regExpUnicodeEscapeSequenceAtom() { + this.consumeChar("u"); + return this.parseHexDigits(4); + } + identityEscapeAtom() { + const escapedChar = this.popChar(); + return { type: "Character", value: cc(escapedChar) }; + } + classPatternCharacterAtom() { + switch (this.peekChar()) { + case "\n": + case "\r": + case "\u2028": + case "\u2029": + case "\\": + case "]": + throw Error("TBD"); + default: + const nextChar = this.popChar(); + return { type: "Character", value: cc(nextChar) }; + } + } + characterClass() { + const set6 = []; + let complement = false; + this.consumeChar("["); + if (this.peekChar(0) === "^") { + this.consumeChar("^"); + complement = true; + } + while (this.isClassAtom()) { + const from2 = this.classAtom(); + const isFromSingleChar = from2.type === "Character"; + if (isCharacter(from2) && this.isRangeDash()) { + this.consumeChar("-"); + const to = this.classAtom(); + const isToSingleChar = to.type === "Character"; + if (isCharacter(to)) { + if (to.value < from2.value) { + throw Error("Range out of order in character class"); + } + set6.push({ from: from2.value, to: to.value }); + } else { + insertToSet(from2.value, set6); + set6.push(cc("-")); + insertToSet(to.value, set6); + } + } else { + insertToSet(from2.value, set6); + } + } + this.consumeChar("]"); + return { type: "Set", complement, value: set6 }; + } + classAtom() { + switch (this.peekChar()) { + case "]": + case "\n": + case "\r": + case "\u2028": + case "\u2029": + throw Error("TBD"); + case "\\": + return this.classEscape(); + default: + return this.classPatternCharacterAtom(); + } + } + classEscape() { + this.consumeChar("\\"); + switch (this.peekChar()) { + case "b": + this.consumeChar("b"); + return { type: "Character", value: cc("\b") }; + case "d": + case "D": + case "s": + case "S": + case "w": + case "W": + return this.characterClassEscape(); + case "f": + case "n": + case "r": + case "t": + case "v": + return this.controlEscapeAtom(); + case "c": + return this.controlLetterEscapeAtom(); + case "0": + return this.nulCharacterAtom(); + case "x": + return this.hexEscapeSequenceAtom(); + case "u": + return this.regExpUnicodeEscapeSequenceAtom(); + default: + return this.identityEscapeAtom(); } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + } + group() { + let capturing = true; + this.consumeChar("("); + switch (this.peekChar(0)) { + case "?": + this.consumeChar("?"); + this.consumeChar(":"); + capturing = false; + break; + default: + this.groupIdx++; + break; } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length + const value2 = this.disjunction(); + this.consumeChar(")"); + const groupAst = { + type: "Group", + capturing, + value: value2 }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; + if (capturing) { + groupAst["idx"] = this.groupIdx; + } + return groupAst; + } + positiveInteger() { + let number7 = this.popChar(); + if (decimalPatternNoZero.test(number7) === false) { + throw Error("Expecting a positive integer"); + } + while (decimalPattern.test(this.peekChar(0))) { + number7 += this.popChar(); + } + return parseInt(number7, 10); + } + integerIncludingZero() { + let number7 = this.popChar(); + if (decimalPattern.test(number7) === false) { + throw Error("Expecting an integer"); + } + while (decimalPattern.test(this.peekChar(0))) { + number7 += this.popChar(); + } + return parseInt(number7, 10); + } + patternCharacter() { + const nextChar = this.popChar(); + switch (nextChar) { + case "\n": + case "\r": + case "\u2028": + case "\u2029": + case "^": + case "$": + case "\\": + case ".": + case "*": + case "+": + case "?": + case "(": + case ")": + case "[": + case "|": + throw Error("TBD"); + default: + return { type: "Character", value: cc(nextChar) }; } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { + } + isRegExpFlag() { + switch (this.peekChar(0)) { + case "g": + case "i": + case "m": + case "u": + case "y": + return true; + default: + return false; + } + } + isRangeDash() { + return this.peekChar() === "-" && this.isClassAtom(1); + } + isDigit() { + return decimalPattern.test(this.peekChar(0)); + } + isClassAtom(howMuch = 0) { + switch (this.peekChar(howMuch)) { + case "]": + case "\n": + case "\r": + case "\u2028": + case "\u2029": + return false; + default: + return true; + } + } + isTerm() { + return this.isAtom() || this.isAssertion(); + } + isAtom() { + if (this.isPatternCharacter()) { + return true; + } + switch (this.peekChar(0)) { + case ".": + case "\\": + case "[": + case "(": + return true; + default: + return false; + } + } + isAssertion() { + switch (this.peekChar(0)) { + case "^": + case "$": + return true; + case "\\": + switch (this.peekChar(1)) { + case "b": + case "B": + return true; + default: return false; - } - } else if (!this.options.flex) { - break; } - } + case "(": + return this.peekChar(1) === "?" && (this.peekChar(2) === "=" || this.peekChar(2) === "!"); + default: + return false; } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; - } + } + isQuantifier() { + const prevState = this.saveState(); + try { + return this.quantifier(true) !== void 0; + } catch (e3) { return false; + } finally { + this.restoreState(prevState); + } + } + isPatternCharacter() { + switch (this.peekChar()) { + case "^": + case "$": + case "\\": + case ".": + case "*": + case "+": + case "?": + case "(": + case ")": + case "[": + case "|": + case "/": + case "\n": + case "\r": + case "\u2028": + case "\u2029": + return false; + default: + return true; } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + } + parseHexDigits(howMany) { + let hexString = ""; + for (let i2 = 0; i2 < howMany; i2++) { + const hexChar = this.popChar(); + if (hexDigitPattern.test(hexChar) === false) { + throw Error("Expecting a HexDecimal digits"); + } + hexString += hexChar; } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + const charCode = parseInt(hexString, 16); + return { type: "Character", value: charCode }; + } + peekChar(howMuch = 0) { + return this.input[this.idx + howMuch]; + } + popChar() { + const nextChar = this.peekChar(0); + this.consumeChar(void 0); + return nextChar; + } + consumeChar(char2) { + if (char2 !== void 0 && this.input[this.idx] !== char2) { + throw Error("Expected: '" + char2 + "' but found: '" + this.input[this.idx] + "' at offset: " + this.idx); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; + if (this.idx >= this.input.length) { + throw Error("Unexpected end of input"); } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - this.begin("acc_title"); - return 19; - case 1: - this.popState(); - return "acc_title_value"; - case 2: - this.begin("acc_descr"); - return 21; - case 3: - this.popState(); - return "acc_descr_value"; - case 4: - this.begin("acc_descr_multiline"); + this.idx++; + } + loc(begin) { + return { begin, end: this.idx }; + } + }; + } + }); + + // ../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js + var BaseRegExpVisitor; + var init_base_regexp_visitor = __esm({ + "../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js"() { + "use strict"; + BaseRegExpVisitor = class { + static { + __name(this, "BaseRegExpVisitor"); + } + visitChildren(node2) { + for (const key in node2) { + const child = node2[key]; + if (node2.hasOwnProperty(key)) { + if (child.type !== void 0) { + this.visit(child); + } else if (Array.isArray(child)) { + child.forEach((subChild) => { + this.visit(subChild); + }, this); + } + } + } + } + visit(node2) { + switch (node2.type) { + case "Pattern": + this.visitPattern(node2); break; - case 5: - this.popState(); + case "Flags": + this.visitFlags(node2); break; - case 6: - return "acc_descr_multiline_value"; - case 7: - return 13; - case 8: + case "Disjunction": + this.visitDisjunction(node2); break; - case 9: + case "Alternative": + this.visitAlternative(node2); break; - case 10: - return 5; - case 11: - return 40; - case 12: - return 32; - case 13: - return 38; - case 14: - return 42; - case 15: - return 43; - case 16: - return 44; - case 17: - return 45; - case 18: - return 35; - case 19: - return 28; - case 20: - return 29; - case 21: - return 37; - case 22: - return 31; - case 23: - return 34; - case 24: - return 26; - case 25: - return 9; - case 26: - return 9; - case 27: - return 8; - case 28: - return "CARET"; - case 29: - this.begin("options"); + case "StartAnchor": + this.visitStartAnchor(node2); break; - case 30: - this.popState(); + case "EndAnchor": + this.visitEndAnchor(node2); break; - case 31: - return 12; - case 32: - return 36; - case 33: - this.begin("string"); + case "WordBoundary": + this.visitWordBoundary(node2); break; - case 34: - this.popState(); + case "NonWordBoundary": + this.visitNonWordBoundary(node2); + break; + case "Lookahead": + this.visitLookahead(node2); + break; + case "NegativeLookahead": + this.visitNegativeLookahead(node2); + break; + case "Character": + this.visitCharacter(node2); + break; + case "Set": + this.visitSet(node2); + break; + case "Group": + this.visitGroup(node2); + break; + case "GroupBackReference": + this.visitGroupBackReference(node2); + break; + case "Quantifier": + this.visitQuantifier(node2); break; - case 35: - return 33; - case 36: - return 30; - case 37: - return 46; - case 38: - return 7; } - }, - rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:gitGraph\b)/i, /^(?:commit(?=\s|$))/i, /^(?:id:)/i, /^(?:type:)/i, /^(?:msg:)/i, /^(?:NORMAL\b)/i, /^(?:REVERSE\b)/i, /^(?:HIGHLIGHT\b)/i, /^(?:tag:)/i, /^(?:branch(?=\s|$))/i, /^(?:order:)/i, /^(?:merge(?=\s|$))/i, /^(?:cherry-pick(?=\s|$))/i, /^(?:parent:)/i, /^(?:checkout(?=\s|$))/i, /^(?:LR\b)/i, /^(?:TB\b)/i, /^(?::)/i, /^(?:\^)/i, /^(?:options\r?\n)/i, /^(?:[ \r\n\t]+end\b)/i, /^(?:[\s\S]+(?=[ \r\n\t]+end))/i, /^(?:["]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[0-9]+(?=\s|$))/i, /^(?:\w([-\./\w]*[-\w])?)/i, /^(?:$)/i, /^(?:\s+)/i], - conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "options": { "rules": [30, 31], "inclusive": false }, "string": { "rules": [34, 35], "inclusive": false }, "INITIAL": { "rules": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 36, 37, 38, 39], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$r.parser = parser$r; - const gitGraphParser = parser$r; - let mainBranchName = getConfig$1().gitGraph.mainBranchName; - let mainBranchOrder = getConfig$1().gitGraph.mainBranchOrder; - let commits = {}; - let head = null; - let branchesConfig = {}; - branchesConfig[mainBranchName] = { name: mainBranchName, order: mainBranchOrder }; - let branches = {}; - branches[mainBranchName] = head; - let curBranch = mainBranchName; - let direction$2 = "LR"; - let seq = 0; - function getId() { - return random({ length: 7 }); - } - function uniqBy(list2, fn) { - const recordMap = /* @__PURE__ */ Object.create(null); - return list2.reduce((out, item) => { - const key = fn(item); - if (!recordMap[key]) { - recordMap[key] = true; - out.push(item); - } - return out; - }, []); - } - const setDirection$2 = function(dir2) { - direction$2 = dir2; - }; - let options = {}; - const setOptions = function(rawOptString) { - log$1.debug("options str", rawOptString); - rawOptString = rawOptString && rawOptString.trim(); - rawOptString = rawOptString || "{}"; - try { - options = JSON.parse(rawOptString); - } catch (e) { - log$1.error("error while parsing gitGraph options", e.message); - } - }; - const getOptions = function() { - return options; - }; - const commit = function(msg, id2, type2, tag) { - log$1.debug("Entering commit:", msg, id2, type2, tag); - id2 = common$1.sanitizeText(id2, getConfig$1()); - msg = common$1.sanitizeText(msg, getConfig$1()); - tag = common$1.sanitizeText(tag, getConfig$1()); - const commit2 = { - id: id2 ? id2 : seq + "-" + getId(), - message: msg, - seq: seq++, - type: type2 ? type2 : commitType$1.NORMAL, - tag: tag ? tag : "", - parents: head == null ? [] : [head.id], - branch: curBranch - }; - head = commit2; - commits[commit2.id] = commit2; - branches[curBranch] = commit2.id; - log$1.debug("in pushCommit " + commit2.id); - }; - const branch = function(name, order2) { - name = common$1.sanitizeText(name, getConfig$1()); - if (branches[name] === void 0) { - branches[name] = head != null ? head.id : null; - branchesConfig[name] = { name, order: order2 ? parseInt(order2, 10) : null }; - checkout(name); - log$1.debug("in createBranch"); - } else { - let error = new Error( - 'Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + name + '")' - ); - error.hash = { - text: "branch " + name, - token: "branch " + name, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ['"checkout ' + name + '"'] - }; - throw error; - } - }; - const merge = function(otherBranch, custom_id, override_type, custom_tag) { - otherBranch = common$1.sanitizeText(otherBranch, getConfig$1()); - custom_id = common$1.sanitizeText(custom_id, getConfig$1()); - const currentCommit = commits[branches[curBranch]]; - const otherCommit = commits[branches[otherBranch]]; - if (curBranch === otherBranch) { - let error = new Error('Incorrect usage of "merge". Cannot merge a branch to itself'); - error.hash = { - text: "merge " + otherBranch, - token: "merge " + otherBranch, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["branch abc"] - }; - throw error; - } else if (currentCommit === void 0 || !currentCommit) { - let error = new Error( - 'Incorrect usage of "merge". Current branch (' + curBranch + ")has no commits" - ); - error.hash = { - text: "merge " + otherBranch, - token: "merge " + otherBranch, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["commit"] - }; - throw error; - } else if (branches[otherBranch] === void 0) { - let error = new Error( - 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") does not exist" - ); - error.hash = { - text: "merge " + otherBranch, - token: "merge " + otherBranch, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["branch " + otherBranch] - }; - throw error; - } else if (otherCommit === void 0 || !otherCommit) { - let error = new Error( - 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") has no commits" - ); - error.hash = { - text: "merge " + otherBranch, - token: "merge " + otherBranch, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ['"commit"'] - }; - throw error; - } else if (currentCommit === otherCommit) { - let error = new Error('Incorrect usage of "merge". Both branches have same head'); - error.hash = { - text: "merge " + otherBranch, - token: "merge " + otherBranch, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["branch abc"] - }; - throw error; - } else if (custom_id && commits[custom_id] !== void 0) { - let error = new Error( - 'Incorrect usage of "merge". Commit with id:' + custom_id + " already exists, use different custom Id" - ); - error.hash = { - text: "merge " + otherBranch + custom_id + override_type + custom_tag, - token: "merge " + otherBranch + custom_id + override_type + custom_tag, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: [ - "merge " + otherBranch + " " + custom_id + "_UNIQUE " + override_type + " " + custom_tag - ] + this.visitChildren(node2); + } + visitPattern(node2) { + } + visitFlags(node2) { + } + visitDisjunction(node2) { + } + visitAlternative(node2) { + } + // Assertion + visitStartAnchor(node2) { + } + visitEndAnchor(node2) { + } + visitWordBoundary(node2) { + } + visitNonWordBoundary(node2) { + } + visitLookahead(node2) { + } + visitNegativeLookahead(node2) { + } + // atoms + visitCharacter(node2) { + } + visitSet(node2) { + } + visitGroup(node2) { + } + visitGroupBackReference(node2) { + } + visitQuantifier(node2) { + } }; - throw error; - } - const commit2 = { - id: custom_id ? custom_id : seq + "-" + getId(), - message: "merged branch " + otherBranch + " into " + curBranch, - seq: seq++, - parents: [head == null ? null : head.id, branches[otherBranch]], - branch: curBranch, - type: commitType$1.MERGE, - customType: override_type, - customId: custom_id ? true : false, - tag: custom_tag ? custom_tag : "" - }; - head = commit2; - commits[commit2.id] = commit2; - branches[curBranch] = commit2.id; - log$1.debug(branches); - log$1.debug("in mergeBranch"); - }; - const cherryPick = function(sourceId, targetId, tag, parentCommitId) { - log$1.debug("Entering cherryPick:", sourceId, targetId, tag); - sourceId = common$1.sanitizeText(sourceId, getConfig$1()); - targetId = common$1.sanitizeText(targetId, getConfig$1()); - tag = common$1.sanitizeText(tag, getConfig$1()); - parentCommitId = common$1.sanitizeText(parentCommitId, getConfig$1()); - if (!sourceId || commits[sourceId] === void 0) { - let error = new Error( - 'Incorrect usage of "cherryPick". Source commit id should exist and provided' - ); - error.hash = { - text: "cherryPick " + sourceId + " " + targetId, - token: "cherryPick " + sourceId + " " + targetId, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["cherry-pick abc"] - }; - throw error; - } - let sourceCommit = commits[sourceId]; - let sourceCommitBranch = sourceCommit.branch; - if (parentCommitId && !(Array.isArray(sourceCommit.parents) && sourceCommit.parents.includes(parentCommitId))) { - let error = new Error( - "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit." - ); - throw error; } - if (sourceCommit.type === commitType$1.MERGE && !parentCommitId) { - let error = new Error( - "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified." - ); - throw error; + }); + + // ../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/api.js + var init_api = __esm({ + "../../node_modules/.pnpm/@chevrotain+regexp-to-ast@11.0.3/node_modules/@chevrotain/regexp-to-ast/lib/src/api.js"() { + "use strict"; + init_regexp_parser(); + init_base_regexp_visitor(); } - if (!targetId || commits[targetId] === void 0) { - if (sourceCommitBranch === curBranch) { - let error = new Error( - 'Incorrect usage of "cherryPick". Source commit is already on current branch' - ); - error.hash = { - text: "cherryPick " + sourceId + " " + targetId, - token: "cherryPick " + sourceId + " " + targetId, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["cherry-pick abc"] - }; - throw error; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/regexp-utils.js + var regexp_utils_exports = {}; + __export(regexp_utils_exports, { + NEWLINE_REGEXP: () => NEWLINE_REGEXP, + escapeRegExp: () => escapeRegExp, + getCaseInsensitivePattern: () => getCaseInsensitivePattern, + getTerminalParts: () => getTerminalParts, + isMultilineComment: () => isMultilineComment, + isWhitespace: () => isWhitespace, + partialMatches: () => partialMatches, + partialRegExp: () => partialRegExp + }); + function getTerminalParts(regexp) { + try { + if (typeof regexp !== "string") { + regexp = regexp.source; + } + regexp = `/${regexp}/`; + const pattern = regexpParser.pattern(regexp); + const parts = []; + for (const alternative of pattern.value.value) { + visitor.reset(regexp); + visitor.visit(alternative); + parts.push({ + start: visitor.startRegexp, + end: visitor.endRegex + }); } - const currentCommit = commits[branches[curBranch]]; - if (currentCommit === void 0 || !currentCommit) { - let error = new Error( - 'Incorrect usage of "cherry-pick". Current branch (' + curBranch + ")has no commits" - ); - error.hash = { - text: "cherryPick " + sourceId + " " + targetId, - token: "cherryPick " + sourceId + " " + targetId, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["cherry-pick abc"] - }; - throw error; - } - const commit2 = { - id: seq + "-" + getId(), - message: "cherry-picked " + sourceCommit + " into " + curBranch, - seq: seq++, - parents: [head == null ? null : head.id, sourceCommit.id], - branch: curBranch, - type: commitType$1.CHERRY_PICK, - tag: tag ?? `cherry-pick:${sourceCommit.id}${sourceCommit.type === commitType$1.MERGE ? `|parent:${parentCommitId}` : ""}` - }; - head = commit2; - commits[commit2.id] = commit2; - branches[curBranch] = commit2.id; - log$1.debug(branches); - log$1.debug("in cherryPick"); - } - }; - const checkout = function(branch2) { - branch2 = common$1.sanitizeText(branch2, getConfig$1()); - if (branches[branch2] === void 0) { - let error = new Error( - 'Trying to checkout branch which is not yet created. (Help try using "branch ' + branch2 + '")' - ); - error.hash = { - text: "checkout " + branch2, - token: "checkout " + branch2, - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ['"branch ' + branch2 + '"'] - }; - throw error; - } else { - curBranch = branch2; - const id2 = branches[curBranch]; - head = commits[id2]; - } - }; - function upsert(arr, key, newVal) { - const index2 = arr.indexOf(key); - if (index2 === -1) { - arr.push(newVal); - } else { - arr.splice(index2, 1, newVal); + return parts; + } catch (_a) { + return []; } } - function prettyPrintCommitHistory(commitArr) { - const commit2 = commitArr.reduce((out, commit3) => { - if (out.seq > commit3.seq) { - return out; - } - return commit3; - }, commitArr[0]); - let line2 = ""; - commitArr.forEach(function(c2) { - if (c2 === commit2) { - line2 += " *"; - } else { - line2 += " |"; - } - }); - const label = [line2, commit2.id, commit2.seq]; - for (let branch2 in branches) { - if (branches[branch2] === commit2.id) { - label.push(branch2); - } + function isMultilineComment(regexp) { + try { + if (typeof regexp === "string") { + regexp = new RegExp(regexp); + } + regexp = regexp.toString(); + visitor.reset(regexp); + visitor.visit(regexpParser.pattern(regexp)); + return visitor.multiline; + } catch (_a) { + return false; } - log$1.debug(label.join(" ")); - if (commit2.parents && commit2.parents.length == 2) { - const newCommit = commits[commit2.parents[0]]; - upsert(commitArr, commit2, newCommit); - commitArr.push(commits[commit2.parents[1]]); - } else if (commit2.parents.length == 0) { - return; - } else { - const nextCommit = commits[commit2.parents]; - upsert(commitArr, commit2, nextCommit); - } - commitArr = uniqBy(commitArr, (c2) => c2.id); - prettyPrintCommitHistory(commitArr); } - const prettyPrint = function() { - log$1.debug(commits); - const node2 = getCommitsArray()[0]; - prettyPrintCommitHistory([node2]); - }; - const clear$f = function() { - commits = {}; - head = null; - let mainBranch = getConfig$1().gitGraph.mainBranchName; - let mainBranchOrder2 = getConfig$1().gitGraph.mainBranchOrder; - branches = {}; - branches[mainBranch] = null; - branchesConfig = {}; - branchesConfig[mainBranch] = { name: mainBranch, order: mainBranchOrder2 }; - curBranch = mainBranch; - seq = 0; - clear$n(); - }; - const getBranchesAsObjArray = function() { - const branchesArray = Object.values(branchesConfig).map((branchConfig, i2) => { - if (branchConfig.order !== null) { - return branchConfig; - } - return { - ...branchConfig, - order: parseFloat(`0.${i2}`, 10) - }; - }).sort((a, b) => a.order - b.order).map(({ name }) => ({ name })); - return branchesArray; - }; - const getBranches = function() { - return branches; - }; - const getCommits = function() { - return commits; - }; - const getCommitsArray = function() { - const commitArr = Object.keys(commits).map(function(key) { - return commits[key]; - }); - commitArr.forEach(function(o) { - log$1.debug(o.id); - }); - commitArr.sort((a, b) => a.seq - b.seq); - return commitArr; - }; - const getCurrentBranch = function() { - return curBranch; - }; - const getDirection$2 = function() { - return direction$2; - }; - const getHead = function() { - return head; - }; - const commitType$1 = { - NORMAL: 0, - REVERSE: 1, - HIGHLIGHT: 2, - MERGE: 3, - CHERRY_PICK: 4 - }; - const gitGraphDb = { - getConfig: () => getConfig$1().gitGraph, - setDirection: setDirection$2, - setOptions, - getOptions, - commit, - branch, - merge, - cherryPick, - checkout, - //reset, - prettyPrint, - clear: clear$f, - getBranchesAsObjArray, - getBranches, - getCommits, - getCommitsArray, - getCurrentBranch, - getDirection: getDirection$2, - getHead, - setAccTitle, - getAccTitle, - getAccDescription, - setAccDescription, - setDiagramTitle, - getDiagramTitle, - commitType: commitType$1 - }; - let allCommitsDict = {}; - const commitType = { - NORMAL: 0, - REVERSE: 1, - HIGHLIGHT: 2, - MERGE: 3, - CHERRY_PICK: 4 - }; - const THEME_COLOR_LIMIT = 8; - let branchPos = {}; - let commitPos = {}; - let lanes = []; - let maxPos = 0; - let dir = "LR"; - const clear$e = () => { - branchPos = {}; - commitPos = {}; - allCommitsDict = {}; - maxPos = 0; - lanes = []; - dir = "LR"; - }; - const drawText$3 = (txt) => { - const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text"); - let rows = []; - if (typeof txt === "string") { - rows = txt.split(/\\n|\n|/gi); - } else if (Array.isArray(txt)) { - rows = txt; - } else { - rows = []; - } - for (const row of rows) { - const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); - tspan.setAttribute("dy", "1em"); - tspan.setAttribute("x", "0"); - tspan.setAttribute("class", "row"); - tspan.textContent = row.trim(); - svgLabel.appendChild(tspan); - } - return svgLabel; - }; - const findClosestParent = (parents2) => { - let closestParent = ""; - let maxPosition = 0; - parents2.forEach((parent) => { - const parentPosition = dir === "TB" ? commitPos[parent].y : commitPos[parent].x; - if (parentPosition >= maxPosition) { - closestParent = parent; - maxPosition = parentPosition; - } - }); - return closestParent || void 0; - }; - const drawCommits = (svg2, commits2, modifyGraph) => { - const gitGraphConfig = getConfig$1().gitGraph; - const gBullets = svg2.append("g").attr("class", "commit-bullets"); - const gLabels = svg2.append("g").attr("class", "commit-labels"); - let pos = 0; - if (dir === "TB") { - pos = 30; - } - const keys2 = Object.keys(commits2); - const sortedKeys = keys2.sort((a, b) => { - return commits2[a].seq - commits2[b].seq; - }); - const isParallelCommits = gitGraphConfig.parallelCommits; - const layoutOffset = 10; - const commitStep = 40; - sortedKeys.forEach((key) => { - const commit2 = commits2[key]; - if (isParallelCommits) { - if (commit2.parents.length) { - const closestParent = findClosestParent(commit2.parents); - pos = dir === "TB" ? commitPos[closestParent].y + commitStep : commitPos[closestParent].x + commitStep; - } else { - pos = 0; - if (dir === "TB") { - pos = 30; - } - } - } - const posWithOffset = pos + layoutOffset; - const y2 = dir === "TB" ? posWithOffset : branchPos[commit2.branch].pos; - const x2 = dir === "TB" ? branchPos[commit2.branch].pos : posWithOffset; - if (modifyGraph) { - let typeClass; - let commitSymbolType = commit2.customType !== void 0 && commit2.customType !== "" ? commit2.customType : commit2.type; - switch (commitSymbolType) { - case commitType.NORMAL: - typeClass = "commit-normal"; - break; - case commitType.REVERSE: - typeClass = "commit-reverse"; + function isWhitespace(value2) { + const regexp = typeof value2 === "string" ? new RegExp(value2) : value2; + return regexp.test(" "); + } + function escapeRegExp(value2) { + return value2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + } + function getCaseInsensitivePattern(keyword) { + return Array.prototype.map.call(keyword, (letter) => /\w/.test(letter) ? `[${letter.toLowerCase()}${letter.toUpperCase()}]` : escapeRegExp(letter)).join(""); + } + function partialMatches(regex, input) { + const partial = partialRegExp(regex); + const match2 = input.match(partial); + return !!match2 && match2[0].length > 0; + } + function partialRegExp(regex) { + if (typeof regex === "string") { + regex = new RegExp(regex); + } + const re2 = regex, source = regex.source; + let i2 = 0; + function process2() { + let result = "", tmp; + function appendRaw(nbChars) { + result += source.substr(i2, nbChars); + i2 += nbChars; + } + __name(appendRaw, "appendRaw"); + function appendOptional(nbChars) { + result += "(?:" + source.substr(i2, nbChars) + "|$)"; + i2 += nbChars; + } + __name(appendOptional, "appendOptional"); + while (i2 < source.length) { + switch (source[i2]) { + case "\\": + switch (source[i2 + 1]) { + case "c": + appendOptional(3); + break; + case "x": + appendOptional(4); + break; + case "u": + if (re2.unicode) { + if (source[i2 + 2] === "{") { + appendOptional(source.indexOf("}", i2) - i2 + 1); + } else { + appendOptional(6); + } + } else { + appendOptional(2); + } + break; + case "p": + case "P": + if (re2.unicode) { + appendOptional(source.indexOf("}", i2) - i2 + 1); + } else { + appendOptional(2); + } + break; + case "k": + appendOptional(source.indexOf(">", i2) - i2 + 1); + break; + default: + appendOptional(2); + break; + } break; - case commitType.HIGHLIGHT: - typeClass = "commit-highlight"; + case "[": + tmp = /\[(?:\\.|.)*?\]/g; + tmp.lastIndex = i2; + tmp = tmp.exec(source) || []; + appendOptional(tmp[0].length); break; - case commitType.MERGE: - typeClass = "commit-merge"; + case "|": + case "^": + case "$": + case "*": + case "+": + case "?": + appendRaw(1); + break; + case "{": + tmp = /\{\d+,?\d*\}/g; + tmp.lastIndex = i2; + tmp = tmp.exec(source); + if (tmp) { + appendRaw(tmp[0].length); + } else { + appendOptional(1); + } break; - case commitType.CHERRY_PICK: - typeClass = "commit-cherry-pick"; + case "(": + if (source[i2 + 1] === "?") { + switch (source[i2 + 2]) { + case ":": + result += "(?:"; + i2 += 3; + result += process2() + "|$)"; + break; + case "=": + result += "(?="; + i2 += 3; + result += process2() + ")"; + break; + case "!": + tmp = i2; + i2 += 3; + process2(); + result += source.substr(tmp, i2 - tmp); + break; + case "<": + switch (source[i2 + 3]) { + case "=": + case "!": + tmp = i2; + i2 += 4; + process2(); + result += source.substr(tmp, i2 - tmp); + break; + default: + appendRaw(source.indexOf(">", i2) - i2 + 1); + result += process2() + "|$)"; + break; + } + break; + } + } else { + appendRaw(1); + result += process2() + "|$)"; + } break; + case ")": + ++i2; + return result; default: - typeClass = "commit-normal"; - } - if (commitSymbolType === commitType.HIGHLIGHT) { - const circle2 = gBullets.append("rect"); - circle2.attr("x", x2 - 10); - circle2.attr("y", y2 - 10); - circle2.attr("height", 20); - circle2.attr("width", 20); - circle2.attr( - "class", - `commit ${commit2.id} commit-highlight${branchPos[commit2.branch].index % THEME_COLOR_LIMIT} ${typeClass}-outer` - ); - gBullets.append("rect").attr("x", x2 - 6).attr("y", y2 - 6).attr("height", 12).attr("width", 12).attr( - "class", - `commit ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT} ${typeClass}-inner` - ); - } else if (commitSymbolType === commitType.CHERRY_PICK) { - gBullets.append("circle").attr("cx", x2).attr("cy", y2).attr("r", 10).attr("class", `commit ${commit2.id} ${typeClass}`); - gBullets.append("circle").attr("cx", x2 - 3).attr("cy", y2 + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); - gBullets.append("circle").attr("cx", x2 + 3).attr("cy", y2 + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); - gBullets.append("line").attr("x1", x2 + 3).attr("y1", y2 + 1).attr("x2", x2).attr("y2", y2 - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); - gBullets.append("line").attr("x1", x2 - 3).attr("y1", y2 + 1).attr("x2", x2).attr("y2", y2 - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); - } else { - const circle2 = gBullets.append("circle"); - circle2.attr("cx", x2); - circle2.attr("cy", y2); - circle2.attr("r", commit2.type === commitType.MERGE ? 9 : 10); - circle2.attr( - "class", - `commit ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}` - ); - if (commitSymbolType === commitType.MERGE) { - const circle22 = gBullets.append("circle"); - circle22.attr("cx", x2); - circle22.attr("cy", y2); - circle22.attr("r", 6); - circle22.attr( - "class", - `commit ${typeClass} ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}` - ); - } - if (commitSymbolType === commitType.REVERSE) { - const cross2 = gBullets.append("path"); - cross2.attr("d", `M ${x2 - 5},${y2 - 5}L${x2 + 5},${y2 + 5}M${x2 - 5},${y2 + 5}L${x2 + 5},${y2 - 5}`).attr( - "class", - `commit ${typeClass} ${commit2.id} commit${branchPos[commit2.branch].index % THEME_COLOR_LIMIT}` - ); - } + appendOptional(1); + break; } } - if (dir === "TB") { - commitPos[commit2.id] = { x: x2, y: posWithOffset }; - } else { - commitPos[commit2.id] = { x: posWithOffset, y: y2 }; - } - if (modifyGraph) { - const px = 4; - const py = 2; - if (commit2.type !== commitType.CHERRY_PICK && (commit2.customId && commit2.type === commitType.MERGE || commit2.type !== commitType.MERGE) && gitGraphConfig.showCommitLabel) { - const wrapper = gLabels.append("g"); - const labelBkg = wrapper.insert("rect").attr("class", "commit-label-bkg"); - const text2 = wrapper.append("text").attr("x", pos).attr("y", y2 + 25).attr("class", "commit-label").text(commit2.id); - let bbox = text2.node().getBBox(); - labelBkg.attr("x", posWithOffset - bbox.width / 2 - py).attr("y", y2 + 13.5).attr("width", bbox.width + 2 * py).attr("height", bbox.height + 2 * py); - if (dir === "TB") { - labelBkg.attr("x", x2 - (bbox.width + 4 * px + 5)).attr("y", y2 - 12); - text2.attr("x", x2 - (bbox.width + 4 * px)).attr("y", y2 + bbox.height - 12); + return result; + } + __name(process2, "process"); + return new RegExp(process2(), regex.flags); + } + var NEWLINE_REGEXP, regexpParser, TerminalRegExpVisitor, visitor; + var init_regexp_utils = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/regexp-utils.js"() { + "use strict"; + init_api(); + NEWLINE_REGEXP = /\r?\n/gm; + regexpParser = new RegExpParser(); + TerminalRegExpVisitor = class extends BaseRegExpVisitor { + static { + __name(this, "TerminalRegExpVisitor"); + } + constructor() { + super(...arguments); + this.isStarting = true; + this.endRegexpStack = []; + this.multiline = false; + } + get endRegex() { + return this.endRegexpStack.join(""); + } + reset(regex) { + this.multiline = false; + this.regex = regex; + this.startRegexp = ""; + this.isStarting = true; + this.endRegexpStack = []; + } + visitGroup(node2) { + if (node2.quantifier) { + this.isStarting = false; + this.endRegexpStack = []; + } + } + visitCharacter(node2) { + const char2 = String.fromCharCode(node2.value); + if (!this.multiline && char2 === "\n") { + this.multiline = true; + } + if (node2.quantifier) { + this.isStarting = false; + this.endRegexpStack = []; + } else { + const escapedChar = escapeRegExp(char2); + this.endRegexpStack.push(escapedChar); + if (this.isStarting) { + this.startRegexp += escapedChar; + } } - if (dir !== "TB") { - text2.attr("x", posWithOffset - bbox.width / 2); + } + visitSet(node2) { + if (!this.multiline) { + const set6 = this.regex.substring(node2.loc.begin, node2.loc.end); + const regex = new RegExp(set6); + this.multiline = Boolean("\n".match(regex)); } - if (gitGraphConfig.rotateCommitLabel) { - if (dir === "TB") { - text2.attr("transform", "rotate(-45, " + x2 + ", " + y2 + ")"); - labelBkg.attr("transform", "rotate(-45, " + x2 + ", " + y2 + ")"); - } else { - let r_x = -7.5 - (bbox.width + 10) / 25 * 9.5; - let r_y = 10 + bbox.width / 25 * 8.5; - wrapper.attr( - "transform", - "translate(" + r_x + ", " + r_y + ") rotate(-45, " + pos + ", " + y2 + ")" - ); + if (node2.quantifier) { + this.isStarting = false; + this.endRegexpStack = []; + } else { + const set6 = this.regex.substring(node2.loc.begin, node2.loc.end); + this.endRegexpStack.push(set6); + if (this.isStarting) { + this.startRegexp += set6; } } } - if (commit2.tag) { - const rect2 = gLabels.insert("polygon"); - const hole = gLabels.append("circle"); - const tag = gLabels.append("text").attr("y", y2 - 16).attr("class", "tag-label").text(commit2.tag); - let tagBbox = tag.node().getBBox(); - tag.attr("x", posWithOffset - tagBbox.width / 2); - const h2 = tagBbox.height / 2; - const ly = y2 - 19.2; - rect2.attr("class", "tag-label-bkg").attr( - "points", - ` - ${pos - tagBbox.width / 2 - px / 2},${ly + py} - ${pos - tagBbox.width / 2 - px / 2},${ly - py} - ${posWithOffset - tagBbox.width / 2 - px},${ly - h2 - py} - ${posWithOffset + tagBbox.width / 2 + px},${ly - h2 - py} - ${posWithOffset + tagBbox.width / 2 + px},${ly + h2 + py} - ${posWithOffset - tagBbox.width / 2 - px},${ly + h2 + py}` - ); - hole.attr("cx", pos - tagBbox.width / 2 + px / 2).attr("cy", ly).attr("r", 1.5).attr("class", "tag-hole"); - if (dir === "TB") { - rect2.attr("class", "tag-label-bkg").attr( - "points", - ` - ${x2},${pos + py} - ${x2},${pos - py} - ${x2 + layoutOffset},${pos - h2 - py} - ${x2 + layoutOffset + tagBbox.width + px},${pos - h2 - py} - ${x2 + layoutOffset + tagBbox.width + px},${pos + h2 + py} - ${x2 + layoutOffset},${pos + h2 + py}` - ).attr("transform", "translate(12,12) rotate(45, " + x2 + "," + pos + ")"); - hole.attr("cx", x2 + px / 2).attr("cy", pos).attr("transform", "translate(12,12) rotate(45, " + x2 + "," + pos + ")"); - tag.attr("x", x2 + 5).attr("y", pos + 3).attr("transform", "translate(14,14) rotate(45, " + x2 + "," + pos + ")"); + visitChildren(node2) { + if (node2.type === "Group") { + const group2 = node2; + if (group2.quantifier) { + return; + } } + super.visitChildren(node2); } + }; + visitor = new TerminalRegExpVisitor(); + __name(getTerminalParts, "getTerminalParts"); + __name(isMultilineComment, "isMultilineComment"); + __name(isWhitespace, "isWhitespace"); + __name(escapeRegExp, "escapeRegExp"); + __name(getCaseInsensitivePattern, "getCaseInsensitivePattern"); + __name(partialMatches, "partialMatches"); + __name(partialRegExp, "partialRegExp"); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-utils.js + var grammar_utils_exports = {}; + __export(grammar_utils_exports, { + findAssignment: () => findAssignment, + findNameAssignment: () => findNameAssignment, + findNodeForKeyword: () => findNodeForKeyword, + findNodeForProperty: () => findNodeForProperty, + findNodesForKeyword: () => findNodesForKeyword, + findNodesForKeywordInternal: () => findNodesForKeywordInternal, + findNodesForProperty: () => findNodesForProperty, + getActionAtElement: () => getActionAtElement, + getActionType: () => getActionType, + getAllReachableRules: () => getAllReachableRules, + getCrossReferenceTerminal: () => getCrossReferenceTerminal, + getEntryRule: () => getEntryRule, + getExplicitRuleType: () => getExplicitRuleType, + getHiddenRules: () => getHiddenRules, + getRuleType: () => getRuleType, + getTypeName: () => getTypeName, + isArrayCardinality: () => isArrayCardinality, + isArrayOperator: () => isArrayOperator, + isCommentTerminal: () => isCommentTerminal, + isDataType: () => isDataType, + isDataTypeRule: () => isDataTypeRule, + isOptionalCardinality: () => isOptionalCardinality, + terminalRegex: () => terminalRegex + }); + function getEntryRule(grammar) { + return grammar.rules.find((e3) => isParserRule(e3) && e3.entry); + } + function getHiddenRules(grammar) { + return grammar.rules.filter((e3) => isTerminalRule(e3) && e3.hidden); + } + function getAllReachableRules(grammar, allTerminals) { + const ruleNames = /* @__PURE__ */ new Set(); + const entryRule = getEntryRule(grammar); + if (!entryRule) { + return new Set(grammar.rules); + } + const topMostRules = [entryRule].concat(getHiddenRules(grammar)); + for (const rule of topMostRules) { + ruleDfs(rule, ruleNames, allTerminals); + } + const rules = /* @__PURE__ */ new Set(); + for (const rule of grammar.rules) { + if (ruleNames.has(rule.name) || isTerminalRule(rule) && rule.hidden) { + rules.add(rule); } - pos += commitStep + layoutOffset; - if (pos > maxPos) { - maxPos = pos; + } + return rules; + } + function ruleDfs(rule, visitedSet, allTerminals) { + visitedSet.add(rule.name); + streamAllContents(rule).forEach((node2) => { + if (isRuleCall(node2) || allTerminals && isTerminalRuleCall(node2)) { + const refRule = node2.rule.ref; + if (refRule && !visitedSet.has(refRule.name)) { + ruleDfs(refRule, visitedSet, allTerminals); + } } }); - }; - const shouldRerouteArrow = (commitA, commitB, p1, p2, allCommits) => { - const commitBIsFurthest = dir === "TB" ? p1.x < p2.x : p1.y < p2.y; - const branchToGetCurve = commitBIsFurthest ? commitB.branch : commitA.branch; - const isOnBranchToGetCurve = (x2) => x2.branch === branchToGetCurve; - const isBetweenCommits = (x2) => x2.seq > commitA.seq && x2.seq < commitB.seq; - return Object.values(allCommits).some((commitX) => { - return isBetweenCommits(commitX) && isOnBranchToGetCurve(commitX); - }); - }; - const findLane = (y1, y2, depth = 0) => { - const candidate = y1 + Math.abs(y1 - y2) / 2; - if (depth > 5) { - return candidate; - } - let ok = lanes.every((lane) => Math.abs(lane - candidate) >= 10); - if (ok) { - lanes.push(candidate); - return candidate; - } - const diff = Math.abs(y1 - y2); - return findLane(y1, y2 - diff / 5, depth + 1); - }; - const drawArrow = (svg2, commitA, commitB, allCommits) => { - const p1 = commitPos[commitA.id]; - const p2 = commitPos[commitB.id]; - const arrowNeedsRerouting = shouldRerouteArrow(commitA, commitB, p1, p2, allCommits); - let arc = ""; - let arc2 = ""; - let radius = 0; - let offset = 0; - let colorClassNum = branchPos[commitB.branch].index; - if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { - colorClassNum = branchPos[commitA.branch].index; - } - let lineDef; - if (arrowNeedsRerouting) { - arc = "A 10 10, 0, 0, 0,"; - arc2 = "A 10 10, 0, 0, 1,"; - radius = 10; - offset = 10; - const lineY = p1.y < p2.y ? findLane(p1.y, p2.y) : findLane(p2.y, p1.y); - const lineX = p1.x < p2.x ? findLane(p1.x, p2.x) : findLane(p2.x, p1.x); - if (dir === "TB") { - if (p1.x < p2.x) { - lineDef = `M ${p1.x} ${p1.y} L ${lineX - radius} ${p1.y} ${arc2} ${lineX} ${p1.y + offset} L ${lineX} ${p2.y - radius} ${arc} ${lineX + offset} ${p2.y} L ${p2.x} ${p2.y}`; + } + function getCrossReferenceTerminal(crossRef) { + if (crossRef.terminal) { + return crossRef.terminal; + } else if (crossRef.type.ref) { + const nameAssigment = findNameAssignment(crossRef.type.ref); + return nameAssigment === null || nameAssigment === void 0 ? void 0 : nameAssigment.terminal; + } + return void 0; + } + function isCommentTerminal(terminalRule) { + return terminalRule.hidden && !terminalRegex(terminalRule).test(" "); + } + function findNodesForProperty(node2, property2) { + if (!node2 || !property2) { + return []; + } + return findNodesForPropertyInternal(node2, property2, node2.astNode, true); + } + function findNodeForProperty(node2, property2, index) { + if (!node2 || !property2) { + return void 0; + } + const nodes6 = findNodesForPropertyInternal(node2, property2, node2.astNode, true); + if (nodes6.length === 0) { + return void 0; + } + if (index !== void 0) { + index = Math.max(0, Math.min(index, nodes6.length - 1)); + } else { + index = 0; + } + return nodes6[index]; + } + function findNodesForPropertyInternal(node2, property2, element3, first3) { + if (!first3) { + const nodeFeature = getContainerOfType(node2.grammarSource, isAssignment); + if (nodeFeature && nodeFeature.feature === property2) { + return [node2]; + } + } + if (isCompositeCstNode(node2) && node2.astNode === element3) { + return node2.content.flatMap((e3) => findNodesForPropertyInternal(e3, property2, element3, false)); + } + return []; + } + function findNodesForKeyword(node2, keyword) { + if (!node2) { + return []; + } + return findNodesForKeywordInternal(node2, keyword, node2 === null || node2 === void 0 ? void 0 : node2.astNode); + } + function findNodeForKeyword(node2, keyword, index) { + if (!node2) { + return void 0; + } + const nodes6 = findNodesForKeywordInternal(node2, keyword, node2 === null || node2 === void 0 ? void 0 : node2.astNode); + if (nodes6.length === 0) { + return void 0; + } + if (index !== void 0) { + index = Math.max(0, Math.min(index, nodes6.length - 1)); + } else { + index = 0; + } + return nodes6[index]; + } + function findNodesForKeywordInternal(node2, keyword, element3) { + if (node2.astNode !== element3) { + return []; + } + if (isKeyword(node2.grammarSource) && node2.grammarSource.value === keyword) { + return [node2]; + } + const treeIterator = streamCst(node2).iterator(); + let result; + const keywordNodes = []; + do { + result = treeIterator.next(); + if (!result.done) { + const childNode = result.value; + if (childNode.astNode === element3) { + if (isKeyword(childNode.grammarSource) && childNode.grammarSource.value === keyword) { + keywordNodes.push(childNode); + } } else { - colorClassNum = branchPos[commitA.branch].index; - lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius} ${p1.y} ${arc} ${lineX} ${p1.y + offset} L ${lineX} ${p2.y - radius} ${arc2} ${lineX - offset} ${p2.y} L ${p2.x} ${p2.y}`; + treeIterator.prune(); } + } + } while (!result.done); + return keywordNodes; + } + function findAssignment(cstNode) { + var _a; + const astNode = cstNode.astNode; + while (astNode === ((_a = cstNode.container) === null || _a === void 0 ? void 0 : _a.astNode)) { + const assignment = getContainerOfType(cstNode.grammarSource, isAssignment); + if (assignment) { + return assignment; + } + cstNode = cstNode.container; + } + return void 0; + } + function findNameAssignment(type3) { + let startNode = type3; + if (isInferredType(startNode)) { + if (isAction(startNode.$container)) { + startNode = startNode.$container.$container; + } else if (isParserRule(startNode.$container)) { + startNode = startNode.$container; } else { - if (p1.y < p2.y) { - lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY - radius} ${arc} ${p1.x + offset} ${lineY} L ${p2.x - radius} ${lineY} ${arc2} ${p2.x} ${lineY + offset} L ${p2.x} ${p2.y}`; + assertUnreachable(startNode.$container); + } + } + return findNameAssignmentInternal(type3, startNode, /* @__PURE__ */ new Map()); + } + function findNameAssignmentInternal(type3, startNode, cache3) { + var _a; + function go(node2, refType) { + let childAssignment = void 0; + const parentAssignment = getContainerOfType(node2, isAssignment); + if (!parentAssignment) { + childAssignment = findNameAssignmentInternal(refType, refType, cache3); + } + cache3.set(type3, childAssignment); + return childAssignment; + } + __name(go, "go"); + if (cache3.has(type3)) { + return cache3.get(type3); + } + cache3.set(type3, void 0); + for (const node2 of streamAllContents(startNode)) { + if (isAssignment(node2) && node2.feature.toLowerCase() === "name") { + cache3.set(type3, node2); + return node2; + } else if (isRuleCall(node2) && isParserRule(node2.rule.ref)) { + return go(node2, node2.rule.ref); + } else if (isSimpleType(node2) && ((_a = node2.typeRef) === null || _a === void 0 ? void 0 : _a.ref)) { + return go(node2, node2.typeRef.ref); + } + } + return void 0; + } + function getActionAtElement(element3) { + const parent4 = element3.$container; + if (isGroup(parent4)) { + const elements3 = parent4.elements; + const index = elements3.indexOf(element3); + for (let i2 = index - 1; i2 >= 0; i2--) { + const item = elements3[i2]; + if (isAction(item)) { + return item; } else { - colorClassNum = branchPos[commitA.branch].index; - lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY + radius} ${arc2} ${p1.x + offset} ${lineY} L ${p2.x - radius} ${lineY} ${arc} ${p2.x} ${lineY - offset} L ${p2.x} ${p2.y}`; + const action = streamAllContents(elements3[i2]).find(isAction); + if (action) { + return action; + } } } + } + if (isAbstractElement(parent4)) { + return getActionAtElement(parent4); } else { - arc = "A 20 20, 0, 0, 0,"; - arc2 = "A 20 20, 0, 0, 1,"; - radius = 20; - offset = 20; - if (dir === "TB") { - if (p1.x < p2.x) { - if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { - lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`; - } else { - lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc2} ${p2.x} ${p1.y + offset} L ${p2.x} ${p2.y}`; - } + return void 0; + } + } + function isOptionalCardinality(cardinality, element3) { + return cardinality === "?" || cardinality === "*" || isGroup(element3) && Boolean(element3.guardCondition); + } + function isArrayCardinality(cardinality) { + return cardinality === "*" || cardinality === "+"; + } + function isArrayOperator(operator) { + return operator === "+="; + } + function isDataTypeRule(rule) { + return isDataTypeRuleInternal(rule, /* @__PURE__ */ new Set()); + } + function isDataTypeRuleInternal(rule, visited) { + if (visited.has(rule)) { + return true; + } else { + visited.add(rule); + } + for (const node2 of streamAllContents(rule)) { + if (isRuleCall(node2)) { + if (!node2.rule.ref) { + return false; } - if (p1.x > p2.x) { - arc = "A 20 20, 0, 0, 0,"; - arc2 = "A 20 20, 0, 0, 1,"; - radius = 20; - offset = 20; - if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { - lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc2} ${p1.x - offset} ${p2.y} L ${p2.x} ${p2.y}`; - } else { - lineDef = `M ${p1.x} ${p1.y} L ${p2.x + radius} ${p1.y} ${arc} ${p2.x} ${p1.y + offset} L ${p2.x} ${p2.y}`; - } + if (isParserRule(node2.rule.ref) && !isDataTypeRuleInternal(node2.rule.ref, visited)) { + return false; } - if (p1.x === p2.x) { - lineDef = `M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`; + } else if (isAssignment(node2)) { + return false; + } else if (isAction(node2)) { + return false; + } + } + return Boolean(rule.definition); + } + function isDataType(type3) { + return isDataTypeInternal(type3.type, /* @__PURE__ */ new Set()); + } + function isDataTypeInternal(type3, visited) { + if (visited.has(type3)) { + return true; + } else { + visited.add(type3); + } + if (isArrayType(type3)) { + return false; + } else if (isReferenceType(type3)) { + return false; + } else if (isUnionType(type3)) { + return type3.types.every((e3) => isDataTypeInternal(e3, visited)); + } else if (isSimpleType(type3)) { + if (type3.primitiveType !== void 0) { + return true; + } else if (type3.stringType !== void 0) { + return true; + } else if (type3.typeRef !== void 0) { + const ref = type3.typeRef.ref; + if (isType(ref)) { + return isDataTypeInternal(ref.type, visited); + } else { + return false; } } else { - if (p1.y < p2.y) { - if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { - lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc2} ${p2.x} ${p1.y + offset} L ${p2.x} ${p2.y}`; - } else { - lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y - radius} ${arc} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`; - } - } - if (p1.y > p2.y) { - if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { - lineDef = `M ${p1.x} ${p1.y} L ${p2.x - radius} ${p1.y} ${arc} ${p2.x} ${p1.y - offset} L ${p2.x} ${p2.y}`; - } else { - lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p2.y + radius} ${arc2} ${p1.x + offset} ${p2.y} L ${p2.x} ${p2.y}`; - } - } - if (p1.y === p2.y) { - lineDef = `M ${p1.x} ${p1.y} L ${p2.x} ${p2.y}`; - } + return false; } + } else { + return false; } - svg2.append("path").attr("d", lineDef).attr("class", "arrow arrow" + colorClassNum % THEME_COLOR_LIMIT); - }; - const drawArrows = (svg2, commits2) => { - const gArrows = svg2.append("g").attr("class", "commit-arrows"); - Object.keys(commits2).forEach((key) => { - const commit2 = commits2[key]; - if (commit2.parents && commit2.parents.length > 0) { - commit2.parents.forEach((parent) => { - drawArrow(gArrows, commits2[parent], commit2, commits2); - }); + } + function getExplicitRuleType(rule) { + if (rule.inferredType) { + return rule.inferredType.name; + } else if (rule.dataType) { + return rule.dataType; + } else if (rule.returnType) { + const refType = rule.returnType.ref; + if (refType) { + if (isParserRule(refType)) { + return refType.name; + } else if (isInterface(refType) || isType(refType)) { + return refType.name; + } } + } + return void 0; + } + function getTypeName(type3) { + var _a; + if (isParserRule(type3)) { + return isDataTypeRule(type3) ? type3.name : (_a = getExplicitRuleType(type3)) !== null && _a !== void 0 ? _a : type3.name; + } else if (isInterface(type3) || isType(type3) || isReturnType(type3)) { + return type3.name; + } else if (isAction(type3)) { + const actionType = getActionType(type3); + if (actionType) { + return actionType; + } + } else if (isInferredType(type3)) { + return type3.name; + } + throw new Error("Cannot get name of Unknown Type"); + } + function getActionType(action) { + var _a; + if (action.inferredType) { + return action.inferredType.name; + } else if ((_a = action.type) === null || _a === void 0 ? void 0 : _a.ref) { + return getTypeName(action.type.ref); + } + return void 0; + } + function getRuleType(rule) { + var _a, _b, _c; + if (isTerminalRule(rule)) { + return (_b = (_a = rule.type) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "string"; + } else { + return isDataTypeRule(rule) ? rule.name : (_c = getExplicitRuleType(rule)) !== null && _c !== void 0 ? _c : rule.name; + } + } + function terminalRegex(terminalRule) { + const flags = { + s: false, + i: false, + u: false + }; + const source = abstractElementToRegex(terminalRule.definition, flags); + const flagText = Object.entries(flags).filter(([, value2]) => value2).map(([name]) => name).join(""); + return new RegExp(source, flagText); + } + function abstractElementToRegex(element3, flags) { + if (isTerminalAlternatives(element3)) { + return terminalAlternativesToRegex(element3); + } else if (isTerminalGroup(element3)) { + return terminalGroupToRegex(element3); + } else if (isCharacterRange(element3)) { + return characterRangeToRegex(element3); + } else if (isTerminalRuleCall(element3)) { + const rule = element3.rule.ref; + if (!rule) { + throw new Error("Missing rule reference."); + } + return withCardinality(abstractElementToRegex(rule.definition), { + cardinality: element3.cardinality, + lookahead: element3.lookahead + }); + } else if (isNegatedToken(element3)) { + return negateTokenToRegex(element3); + } else if (isUntilToken(element3)) { + return untilTokenToRegex(element3); + } else if (isRegexToken(element3)) { + const lastSlash = element3.regex.lastIndexOf("/"); + const source = element3.regex.substring(1, lastSlash); + const regexFlags = element3.regex.substring(lastSlash + 1); + if (flags) { + flags.i = regexFlags.includes("i"); + flags.s = regexFlags.includes("s"); + flags.u = regexFlags.includes("u"); + } + return withCardinality(source, { + cardinality: element3.cardinality, + lookahead: element3.lookahead, + wrap: false + }); + } else if (isWildcard(element3)) { + return withCardinality(WILDCARD, { + cardinality: element3.cardinality, + lookahead: element3.lookahead + }); + } else { + throw new Error(`Invalid terminal element: ${element3 === null || element3 === void 0 ? void 0 : element3.$type}`); + } + } + function terminalAlternativesToRegex(alternatives) { + return withCardinality(alternatives.elements.map((e3) => abstractElementToRegex(e3)).join("|"), { + cardinality: alternatives.cardinality, + lookahead: alternatives.lookahead }); - }; - const drawBranches = (svg2, branches2) => { - const gitGraphConfig = getConfig$1().gitGraph; - const g = svg2.append("g"); - branches2.forEach((branch2, index2) => { - const adjustIndexForTheme = index2 % THEME_COLOR_LIMIT; - const pos = branchPos[branch2.name].pos; - const line2 = g.append("line"); - line2.attr("x1", 0); - line2.attr("y1", pos); - line2.attr("x2", maxPos); - line2.attr("y2", pos); - line2.attr("class", "branch branch" + adjustIndexForTheme); - if (dir === "TB") { - line2.attr("y1", 30); - line2.attr("x1", pos); - line2.attr("y2", maxPos); - line2.attr("x2", pos); - } - lanes.push(pos); - let name = branch2.name; - const labelElement = drawText$3(name); - const bkg = g.insert("rect"); - const branchLabel = g.insert("g").attr("class", "branchLabel"); - const label = branchLabel.insert("g").attr("class", "label branch-label" + adjustIndexForTheme); - label.node().appendChild(labelElement); - let bbox = labelElement.getBBox(); - bkg.attr("class", "branchLabelBkg label" + adjustIndexForTheme).attr("rx", 4).attr("ry", 4).attr("x", -bbox.width - 4 - (gitGraphConfig.rotateCommitLabel === true ? 30 : 0)).attr("y", -bbox.height / 2 + 8).attr("width", bbox.width + 18).attr("height", bbox.height + 4); - label.attr( - "transform", - "translate(" + (-bbox.width - 14 - (gitGraphConfig.rotateCommitLabel === true ? 30 : 0)) + ", " + (pos - bbox.height / 2 - 1) + ")" - ); - if (dir === "TB") { - bkg.attr("x", pos - bbox.width / 2 - 10).attr("y", 0); - label.attr("transform", "translate(" + (pos - bbox.width / 2 - 5) + ", 0)"); - } - if (dir !== "TB") { - bkg.attr("transform", "translate(-19, " + (pos - bbox.height / 2) + ")"); - } + } + function terminalGroupToRegex(group2) { + return withCardinality(group2.elements.map((e3) => abstractElementToRegex(e3)).join(""), { + cardinality: group2.cardinality, + lookahead: group2.lookahead }); - }; - const draw$h = function(txt, id2, ver, diagObj) { - clear$e(); - const conf2 = getConfig$1(); - const gitGraphConfig = conf2.gitGraph; - log$1.debug("in gitgraph renderer", txt + "\n", "id:", id2, ver); - allCommitsDict = diagObj.db.getCommits(); - const branches2 = diagObj.db.getBranchesAsObjArray(); - dir = diagObj.db.getDirection(); - const diagram2 = d3select(`[id="${id2}"]`); - let pos = 0; - branches2.forEach((branch2, index2) => { - const labelElement = drawText$3(branch2.name); - const g = diagram2.append("g"); - const branchLabel = g.insert("g").attr("class", "branchLabel"); - const label = branchLabel.insert("g").attr("class", "label branch-label"); - label.node().appendChild(labelElement); - let bbox = labelElement.getBBox(); - branchPos[branch2.name] = { pos, index: index2 }; - pos += 50 + (gitGraphConfig.rotateCommitLabel ? 40 : 0) + (dir === "TB" ? bbox.width / 2 : 0); - label.remove(); - branchLabel.remove(); - g.remove(); + } + function untilTokenToRegex(until) { + return withCardinality(`${WILDCARD}*?${abstractElementToRegex(until.terminal)}`, { + cardinality: until.cardinality, + lookahead: until.lookahead }); - drawCommits(diagram2, allCommitsDict, false); - if (gitGraphConfig.showBranches) { - drawBranches(diagram2, branches2); - } - drawArrows(diagram2, allCommitsDict); - drawCommits(diagram2, allCommitsDict, true); - utils$1.insertTitle( - diagram2, - "gitTitleText", - gitGraphConfig.titleTopMargin, - diagObj.db.getDiagramTitle() - ); - setupGraphViewbox( - void 0, - diagram2, - gitGraphConfig.diagramPadding, - gitGraphConfig.useMaxWidth ?? conf2.useMaxWidth - ); - }; - const gitGraphRenderer = { - draw: draw$h - }; - const getStyles$b = (options2) => ` - .commit-id, - .commit-msg, - .branch-label { - fill: lightgrey; - color: lightgrey; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); } - ${[0, 1, 2, 3, 4, 5, 6, 7].map( - (i2) => ` - .branch-label${i2} { fill: ${options2["gitBranchLabel" + i2]}; } - .commit${i2} { stroke: ${options2["git" + i2]}; fill: ${options2["git" + i2]}; } - .commit-highlight${i2} { stroke: ${options2["gitInv" + i2]}; fill: ${options2["gitInv" + i2]}; } - .label${i2} { fill: ${options2["git" + i2]}; } - .arrow${i2} { stroke: ${options2["git" + i2]}; } - ` - ).join("\n")} + function negateTokenToRegex(negate2) { + return withCardinality(`(?!${abstractElementToRegex(negate2.terminal)})${WILDCARD}*?`, { + cardinality: negate2.cardinality, + lookahead: negate2.lookahead + }); + } + function characterRangeToRegex(range3) { + if (range3.right) { + return withCardinality(`[${keywordToRegex(range3.left)}-${keywordToRegex(range3.right)}]`, { + cardinality: range3.cardinality, + lookahead: range3.lookahead, + wrap: false + }); + } + return withCardinality(keywordToRegex(range3.left), { + cardinality: range3.cardinality, + lookahead: range3.lookahead, + wrap: false + }); + } + function keywordToRegex(keyword) { + return escapeRegExp(keyword.value); + } + function withCardinality(regex, options3) { + var _a; + if (options3.wrap !== false || options3.lookahead) { + regex = `(${(_a = options3.lookahead) !== null && _a !== void 0 ? _a : ""}${regex})`; + } + if (options3.cardinality) { + return `${regex}${options3.cardinality}`; + } + return regex; + } + var WILDCARD; + var init_grammar_utils = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-utils.js"() { + "use strict"; + init_errors2(); + init_ast(); + init_syntax_tree(); + init_ast_utils(); + init_cst_utils(); + init_regexp_utils(); + __name(getEntryRule, "getEntryRule"); + __name(getHiddenRules, "getHiddenRules"); + __name(getAllReachableRules, "getAllReachableRules"); + __name(ruleDfs, "ruleDfs"); + __name(getCrossReferenceTerminal, "getCrossReferenceTerminal"); + __name(isCommentTerminal, "isCommentTerminal"); + __name(findNodesForProperty, "findNodesForProperty"); + __name(findNodeForProperty, "findNodeForProperty"); + __name(findNodesForPropertyInternal, "findNodesForPropertyInternal"); + __name(findNodesForKeyword, "findNodesForKeyword"); + __name(findNodeForKeyword, "findNodeForKeyword"); + __name(findNodesForKeywordInternal, "findNodesForKeywordInternal"); + __name(findAssignment, "findAssignment"); + __name(findNameAssignment, "findNameAssignment"); + __name(findNameAssignmentInternal, "findNameAssignmentInternal"); + __name(getActionAtElement, "getActionAtElement"); + __name(isOptionalCardinality, "isOptionalCardinality"); + __name(isArrayCardinality, "isArrayCardinality"); + __name(isArrayOperator, "isArrayOperator"); + __name(isDataTypeRule, "isDataTypeRule"); + __name(isDataTypeRuleInternal, "isDataTypeRuleInternal"); + __name(isDataType, "isDataType"); + __name(isDataTypeInternal, "isDataTypeInternal"); + __name(getExplicitRuleType, "getExplicitRuleType"); + __name(getTypeName, "getTypeName"); + __name(getActionType, "getActionType"); + __name(getRuleType, "getRuleType"); + __name(terminalRegex, "terminalRegex"); + WILDCARD = /[\s\S]/.source; + __name(abstractElementToRegex, "abstractElementToRegex"); + __name(terminalAlternativesToRegex, "terminalAlternativesToRegex"); + __name(terminalGroupToRegex, "terminalGroupToRegex"); + __name(untilTokenToRegex, "untilTokenToRegex"); + __name(negateTokenToRegex, "negateTokenToRegex"); + __name(characterRangeToRegex, "characterRangeToRegex"); + __name(keywordToRegex, "keywordToRegex"); + __name(withCardinality, "withCardinality"); + } + }); - .branch { - stroke-width: 1; - stroke: ${options2.lineColor}; - stroke-dasharray: 2; + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/grammar-config.js + function createGrammarConfig(services) { + const rules = []; + const grammar = services.Grammar; + for (const rule of grammar.rules) { + if (isTerminalRule(rule) && isCommentTerminal(rule) && isMultilineComment(terminalRegex(rule))) { + rules.push(rule.name); + } + } + return { + multilineCommentRules: rules, + nameRegexp: DefaultNameRegexp + }; } - .commit-label { font-size: ${options2.commitLabelFontSize}; fill: ${options2.commitLabelColor};} - .commit-label-bkg { font-size: ${options2.commitLabelFontSize}; fill: ${options2.commitLabelBackground}; opacity: 0.5; } - .tag-label { font-size: ${options2.tagLabelFontSize}; fill: ${options2.tagLabelColor};} - .tag-label-bkg { fill: ${options2.tagLabelBackground}; stroke: ${options2.tagLabelBorder}; } - .tag-hole { fill: ${options2.textColor}; } + var init_grammar_config = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/grammar-config.js"() { + "use strict"; + init_cst_utils(); + init_grammar_utils(); + init_regexp_utils(); + init_ast(); + __name(createGrammarConfig, "createGrammarConfig"); + } + }); - .commit-merge { - stroke: ${options2.primaryColor}; - fill: ${options2.primaryColor}; + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/version.js + var init_version = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/version.js"() { + "use strict"; + } + }); + + // ../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/print.js + function PRINT_ERROR(msg) { + if (console && console.error) { + console.error(`Error: ${msg}`); + } } - .commit-reverse { - stroke: ${options2.primaryColor}; - fill: ${options2.primaryColor}; - stroke-width: 3; + function PRINT_WARNING(msg) { + if (console && console.warn) { + console.warn(`Warning: ${msg}`); + } } - .commit-highlight-outer { + var init_print = __esm({ + "../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/print.js"() { + "use strict"; + __name(PRINT_ERROR, "PRINT_ERROR"); + __name(PRINT_WARNING, "PRINT_WARNING"); + } + }); + + // ../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/timer.js + function timer2(func) { + const start3 = (/* @__PURE__ */ new Date()).getTime(); + const val = func(); + const end2 = (/* @__PURE__ */ new Date()).getTime(); + const total = end2 - start3; + return { time: total, value: val }; + } + var init_timer2 = __esm({ + "../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/timer.js"() { + "use strict"; + __name(timer2, "timer"); + } + }); + + // ../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/to-fast-properties.js + function toFastProperties(toBecomeFast) { + function FakeConstructor() { + } + __name(FakeConstructor, "FakeConstructor"); + FakeConstructor.prototype = toBecomeFast; + const fakeInstance = new FakeConstructor(); + function fakeAccess() { + return typeof fakeInstance.bar; + } + __name(fakeAccess, "fakeAccess"); + fakeAccess(); + fakeAccess(); + if (1) + return toBecomeFast; + (0, eval)(toBecomeFast); + } + var init_to_fast_properties = __esm({ + "../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/to-fast-properties.js"() { + "use strict"; + __name(toFastProperties, "toFastProperties"); + } + }); + + // ../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/api.js + var init_api2 = __esm({ + "../../node_modules/.pnpm/@chevrotain+utils@11.0.3/node_modules/@chevrotain/utils/lib/src/api.js"() { + "use strict"; + init_print(); + init_timer2(); + init_to_fast_properties(); + } + }); + + // ../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/model.js + function tokenLabel(tokType) { + if (hasTokenLabel(tokType)) { + return tokType.LABEL; + } else { + return tokType.name; + } } - .commit-highlight-inner { - stroke: ${options2.primaryColor}; - fill: ${options2.primaryColor}; + function hasTokenLabel(obj) { + return isString_default(obj.LABEL) && obj.LABEL !== ""; } - - .arrow { stroke-width: 8; stroke-linecap: round; fill: none} - .gitTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; + function serializeGrammar(topRules) { + return map_default(topRules, serializeProduction); } -`; - const gitGraphStyles = getStyles$b; - const diagram$h = { - parser: gitGraphParser, - db: gitGraphDb, - renderer: gitGraphRenderer, - styles: gitGraphStyles - }; - const gitGraphDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$h - }, Symbol.toStringTag, { value: "Module" })); - var parser$q = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 32, 33, 35, 37], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 29], $V6 = [1, 30], $V7 = [1, 31], $V8 = [1, 9], $V9 = [1, 10], $Va = [1, 11], $Vb = [1, 12], $Vc = [1, 13], $Vd = [1, 14], $Ve = [1, 15], $Vf = [1, 16], $Vg = [1, 18], $Vh = [1, 19], $Vi = [1, 20], $Vj = [1, 21], $Vk = [1, 22], $Vl = [1, 24], $Vm = [1, 32]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "gantt": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NL": 10, "weekday": 11, "weekday_monday": 12, "weekday_tuesday": 13, "weekday_wednesday": 14, "weekday_thursday": 15, "weekday_friday": 16, "weekday_saturday": 17, "weekday_sunday": 18, "dateFormat": 19, "inclusiveEndDates": 20, "topAxis": 21, "axisFormat": 22, "tickInterval": 23, "excludes": 24, "includes": 25, "todayMarker": 26, "title": 27, "acc_title": 28, "acc_title_value": 29, "acc_descr": 30, "acc_descr_value": 31, "acc_descr_multiline_value": 32, "section": 33, "clickStatement": 34, "taskTxt": 35, "taskData": 36, "click": 37, "callbackname": 38, "callbackargs": 39, "href": 40, "clickStatementDebug": 41, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 12: "weekday_monday", 13: "weekday_tuesday", 14: "weekday_wednesday", 15: "weekday_thursday", 16: "weekday_friday", 17: "weekday_saturday", 18: "weekday_sunday", 19: "dateFormat", 20: "inclusiveEndDates", 21: "topAxis", 22: "axisFormat", 23: "tickInterval", 24: "excludes", 25: "includes", 26: "todayMarker", 27: "title", 28: "acc_title", 29: "acc_title_value", 30: "acc_descr", 31: "acc_descr_value", 32: "acc_descr_multiline_value", 33: "section", 35: "taskTxt", 36: "taskData", 37: "click", 38: "callbackname", 39: "callbackargs", 40: "href" }, - productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 2], [34, 2], [34, 3], [34, 3], [34, 4], [34, 3], [34, 4], [34, 2], [41, 2], [41, 3], [41, 3], [41, 4], [41, 3], [41, 4], [41, 2]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 1: - return $$[$0 - 1]; - case 2: - this.$ = []; - break; - case 3: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 4: - case 5: - this.$ = $$[$0]; - break; - case 6: - case 7: - this.$ = []; - break; - case 8: - yy.setWeekday("monday"); - break; - case 9: - yy.setWeekday("tuesday"); - break; - case 10: - yy.setWeekday("wednesday"); - break; - case 11: - yy.setWeekday("thursday"); - break; - case 12: - yy.setWeekday("friday"); - break; - case 13: - yy.setWeekday("saturday"); - break; - case 14: - yy.setWeekday("sunday"); - break; - case 15: - yy.setDateFormat($$[$0].substr(11)); - this.$ = $$[$0].substr(11); - break; - case 16: - yy.enableInclusiveEndDates(); - this.$ = $$[$0].substr(18); - break; - case 17: - yy.TopAxis(); - this.$ = $$[$0].substr(8); - break; - case 18: - yy.setAxisFormat($$[$0].substr(11)); - this.$ = $$[$0].substr(11); - break; - case 19: - yy.setTickInterval($$[$0].substr(13)); - this.$ = $$[$0].substr(13); - break; - case 20: - yy.setExcludes($$[$0].substr(9)); - this.$ = $$[$0].substr(9); - break; - case 21: - yy.setIncludes($$[$0].substr(9)); - this.$ = $$[$0].substr(9); - break; - case 22: - yy.setTodayMarker($$[$0].substr(12)); - this.$ = $$[$0].substr(12); - break; - case 24: - yy.setDiagramTitle($$[$0].substr(6)); - this.$ = $$[$0].substr(6); - break; - case 25: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 26: - case 27: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 28: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 30: - yy.addTask($$[$0 - 1], $$[$0]); - this.$ = "task"; - break; - case 31: - this.$ = $$[$0 - 1]; - yy.setClickEvent($$[$0 - 1], $$[$0], null); - break; - case 32: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 33: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], null); - yy.setLink($$[$0 - 2], $$[$0]); - break; - case 34: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); - yy.setLink($$[$0 - 3], $$[$0]); - break; - case 35: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 2], $$[$0], null); - yy.setLink($$[$0 - 2], $$[$0 - 1]); - break; - case 36: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 1], $$[$0]); - yy.setLink($$[$0 - 3], $$[$0 - 2]); - break; - case 37: - this.$ = $$[$0 - 1]; - yy.setLink($$[$0 - 1], $$[$0]); - break; - case 38: - case 44: - this.$ = $$[$0 - 1] + " " + $$[$0]; - break; - case 39: - case 40: - case 42: - this.$ = $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; - break; - case 41: - case 43: - this.$ = $$[$0 - 3] + " " + $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; - break; + function serializeProduction(node2) { + function convertDefinition(definition) { + return map_default(definition, serializeProduction); + } + __name(convertDefinition, "convertDefinition"); + if (node2 instanceof NonTerminal) { + const serializedNonTerminal = { + type: "NonTerminal", + name: node2.nonTerminalName, + idx: node2.idx + }; + if (isString_default(node2.label)) { + serializedNonTerminal.label = node2.label; + } + return serializedNonTerminal; + } else if (node2 instanceof Alternative) { + return { + type: "Alternative", + definition: convertDefinition(node2.definition) + }; + } else if (node2 instanceof Option2) { + return { + type: "Option", + idx: node2.idx, + definition: convertDefinition(node2.definition) + }; + } else if (node2 instanceof RepetitionMandatory) { + return { + type: "RepetitionMandatory", + idx: node2.idx, + definition: convertDefinition(node2.definition) + }; + } else if (node2 instanceof RepetitionMandatoryWithSeparator) { + return { + type: "RepetitionMandatoryWithSeparator", + idx: node2.idx, + separator: serializeProduction(new Terminal({ terminalType: node2.separator })), + definition: convertDefinition(node2.definition) + }; + } else if (node2 instanceof RepetitionWithSeparator) { + return { + type: "RepetitionWithSeparator", + idx: node2.idx, + separator: serializeProduction(new Terminal({ terminalType: node2.separator })), + definition: convertDefinition(node2.definition) + }; + } else if (node2 instanceof Repetition) { + return { + type: "Repetition", + idx: node2.idx, + definition: convertDefinition(node2.definition) + }; + } else if (node2 instanceof Alternation) { + return { + type: "Alternation", + idx: node2.idx, + definition: convertDefinition(node2.definition) + }; + } else if (node2 instanceof Terminal) { + const serializedTerminal = { + type: "Terminal", + name: node2.terminalType.name, + label: tokenLabel(node2.terminalType), + idx: node2.idx + }; + if (isString_default(node2.label)) { + serializedTerminal.terminalLabel = node2.label; + } + const pattern = node2.terminalType.PATTERN; + if (node2.terminalType.PATTERN) { + serializedTerminal.pattern = isRegExp_default(pattern) ? pattern.source : pattern; + } + return serializedTerminal; + } else if (node2 instanceof Rule) { + return { + type: "Rule", + name: node2.name, + orgText: node2.orgText, + definition: convertDefinition(node2.definition) + }; + } else { + throw Error("non exhaustive match"); + } + } + var AbstractProduction, NonTerminal, Rule, Alternative, Option2, RepetitionMandatory, RepetitionMandatoryWithSeparator, Repetition, RepetitionWithSeparator, Alternation, Terminal; + var init_model = __esm({ + "../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/model.js"() { + "use strict"; + init_lodash(); + __name(tokenLabel, "tokenLabel"); + __name(hasTokenLabel, "hasTokenLabel"); + AbstractProduction = class { + static { + __name(this, "AbstractProduction"); } - }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 17, 12: $V1, 13: $V2, 14: $V3, 15: $V4, 16: $V5, 17: $V6, 18: $V7, 19: $V8, 20: $V9, 21: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 28: $Vh, 30: $Vi, 32: $Vj, 33: $Vk, 34: 23, 35: $Vl, 37: $Vm }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 33, 11: 17, 12: $V1, 13: $V2, 14: $V3, 15: $V4, 16: $V5, 17: $V6, 18: $V7, 19: $V8, 20: $V9, 21: $Va, 22: $Vb, 23: $Vc, 24: $Vd, 25: $Ve, 26: $Vf, 27: $Vg, 28: $Vh, 30: $Vi, 32: $Vj, 33: $Vk, 34: 23, 35: $Vl, 37: $Vm }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), o($V0, [2, 18]), o($V0, [2, 19]), o($V0, [2, 20]), o($V0, [2, 21]), o($V0, [2, 22]), o($V0, [2, 23]), o($V0, [2, 24]), { 29: [1, 34] }, { 31: [1, 35] }, o($V0, [2, 27]), o($V0, [2, 28]), o($V0, [2, 29]), { 36: [1, 36] }, o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 10]), o($V0, [2, 11]), o($V0, [2, 12]), o($V0, [2, 13]), o($V0, [2, 14]), { 38: [1, 37], 40: [1, 38] }, o($V0, [2, 4]), o($V0, [2, 25]), o($V0, [2, 26]), o($V0, [2, 30]), o($V0, [2, 31], { 39: [1, 39], 40: [1, 40] }), o($V0, [2, 37], { 38: [1, 41] }), o($V0, [2, 32], { 40: [1, 42] }), o($V0, [2, 33]), o($V0, [2, 35], { 39: [1, 43] }), o($V0, [2, 34]), o($V0, [2, 36])], - defaultActions: {}, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + get definition() { + return this._definition; } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + set definition(value2) { + this._definition = value2; } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; - } - return token2; + constructor(_definition) { + this._definition = _definition; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + accept(visitor2) { + visitor2.visit(this); + forEach_default(this.definition, (prod) => { + prod.accept(visitor2); + }); + } + }; + NonTerminal = class extends AbstractProduction { + static { + __name(this, "NonTerminal"); + } + constructor(options3) { + super([]); + this.idx = 1; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + set definition(definition) { + } + get definition() { + if (this.referencedRule !== void 0) { + return this.referencedRule.definition; } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + return []; + } + accept(visitor2) { + visitor2.visit(this); + } + }; + Rule = class extends AbstractProduction { + static { + __name(this, "Rule"); + } + constructor(options3) { + super(options3.definition); + this.orgText = ""; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + Alternative = class extends AbstractProduction { + static { + __name(this, "Alternative"); + } + constructor(options3) { + super(options3.definition); + this.ignoreAmbiguities = false; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + Option2 = class extends AbstractProduction { + static { + __name(this, "Option"); + } + constructor(options3) { + super(options3.definition); + this.idx = 1; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + RepetitionMandatory = class extends AbstractProduction { + static { + __name(this, "RepetitionMandatory"); + } + constructor(options3) { + super(options3.definition); + this.idx = 1; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + RepetitionMandatoryWithSeparator = class extends AbstractProduction { + static { + __name(this, "RepetitionMandatoryWithSeparator"); + } + constructor(options3) { + super(options3.definition); + this.idx = 1; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + Repetition = class extends AbstractProduction { + static { + __name(this, "Repetition"); + } + constructor(options3) { + super(options3.definition); + this.idx = 1; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + RepetitionWithSeparator = class extends AbstractProduction { + static { + __name(this, "RepetitionWithSeparator"); + } + constructor(options3) { + super(options3.definition); + this.idx = 1; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + Alternation = class extends AbstractProduction { + static { + __name(this, "Alternation"); + } + get definition() { + return this._definition; + } + set definition(value2) { + this._definition = value2; + } + constructor(options3) { + super(options3.definition); + this.idx = 1; + this.ignoreAmbiguities = false; + this.hasPredicates = false; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + }; + Terminal = class { + static { + __name(this, "Terminal"); + } + constructor(options3) { + this.idx = 1; + assign_default(this, pickBy_default(options3, (v3) => v3 !== void 0)); + } + accept(visitor2) { + visitor2.visit(this); + } + }; + __name(serializeGrammar, "serializeGrammar"); + __name(serializeProduction, "serializeProduction"); + } + }); + + // ../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/visitor.js + var GAstVisitor; + var init_visitor = __esm({ + "../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/visitor.js"() { + "use strict"; + init_model(); + GAstVisitor = class { + static { + __name(this, "GAstVisitor"); + } + visit(node2) { + const nodeAny = node2; + switch (nodeAny.constructor) { + case NonTerminal: + return this.visitNonTerminal(nodeAny); + case Alternative: + return this.visitAlternative(nodeAny); + case Option2: + return this.visitOption(nodeAny); + case RepetitionMandatory: + return this.visitRepetitionMandatory(nodeAny); + case RepetitionMandatoryWithSeparator: + return this.visitRepetitionMandatoryWithSeparator(nodeAny); + case RepetitionWithSeparator: + return this.visitRepetitionWithSeparator(nodeAny); + case Repetition: + return this.visitRepetition(nodeAny); + case Alternation: + return this.visitAlternation(nodeAny); + case Terminal: + return this.visitTerminal(nodeAny); + case Rule: + return this.visitRule(nodeAny); + default: + throw Error("non exhaustive match"); } } - return true; + /* c8 ignore next */ + visitNonTerminal(node2) { + } + /* c8 ignore next */ + visitAlternative(node2) { + } + /* c8 ignore next */ + visitOption(node2) { + } + /* c8 ignore next */ + visitRepetition(node2) { + } + /* c8 ignore next */ + visitRepetitionMandatory(node2) { + } + /* c8 ignore next 3 */ + visitRepetitionMandatoryWithSeparator(node2) { + } + /* c8 ignore next */ + visitRepetitionWithSeparator(node2) { + } + /* c8 ignore next */ + visitAlternation(node2) { + } + /* c8 ignore next */ + visitTerminal(node2) { + } + /* c8 ignore next */ + visitRule(node2) { + } + }; + } + }); + + // ../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/helpers.js + function isSequenceProd(prod) { + return prod instanceof Alternative || prod instanceof Option2 || prod instanceof Repetition || prod instanceof RepetitionMandatory || prod instanceof RepetitionMandatoryWithSeparator || prod instanceof RepetitionWithSeparator || prod instanceof Terminal || prod instanceof Rule; + } + function isOptionalProd(prod, alreadyVisited = []) { + const isDirectlyOptional = prod instanceof Option2 || prod instanceof Repetition || prod instanceof RepetitionWithSeparator; + if (isDirectlyOptional) { + return true; + } + if (prod instanceof Alternation) { + return some_default(prod.definition, (subProd) => { + return isOptionalProd(subProd, alreadyVisited); + }); + } else if (prod instanceof NonTerminal && includes_default(alreadyVisited, prod)) { + return false; + } else if (prod instanceof AbstractProduction) { + if (prod instanceof NonTerminal) { + alreadyVisited.push(prod); } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; - } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; - } - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - this.begin("open_directive"); - return "open_directive"; - case 1: - this.begin("acc_title"); - return 28; - case 2: - this.popState(); - return "acc_title_value"; - case 3: - this.begin("acc_descr"); - return 30; - case 4: - this.popState(); - return "acc_descr_value"; - case 5: - this.begin("acc_descr_multiline"); - break; - case 6: - this.popState(); - break; - case 7: - return "acc_descr_multiline_value"; - case 8: - break; - case 9: - break; - case 10: - break; - case 11: - return 10; - case 12: - break; - case 13: - break; - case 14: - this.begin("href"); - break; - case 15: - this.popState(); - break; - case 16: - return 40; - case 17: - this.begin("callbackname"); - break; - case 18: - this.popState(); - break; - case 19: - this.popState(); - this.begin("callbackargs"); - break; - case 20: - return 38; - case 21: - this.popState(); - break; - case 22: - return 39; - case 23: - this.begin("click"); - break; - case 24: - this.popState(); - break; - case 25: - return 37; - case 26: - return 4; - case 27: - return 19; - case 28: - return 20; - case 29: - return 21; - case 30: - return 22; - case 31: - return 23; - case 32: - return 25; - case 33: - return 24; - case 34: - return 26; - case 35: - return 12; - case 36: - return 13; - case 37: - return 14; - case 38: - return 15; - case 39: - return 16; - case 40: - return 17; - case 41: - return 18; - case 42: - return "date"; - case 43: - return 27; - case 44: - return "accDescription"; - case 45: - return 33; - case 46: - return 35; - case 47: - return 36; - case 48: - return ":"; - case 49: - return 6; - case 50: - return "INVALID"; - } - }, - rules: [/^(?:%%\{)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%(?!\{)*[^\n]*)/i, /^(?:[^\}]%%*[^\n]*)/i, /^(?:%%*[^\n]*[\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:%[^\n]*)/i, /^(?:href[\s]+["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:call[\s]+)/i, /^(?:\([\s]*\))/i, /^(?:\()/i, /^(?:[^(]*)/i, /^(?:\))/i, /^(?:[^)]*)/i, /^(?:click[\s]+)/i, /^(?:[\s\n])/i, /^(?:[^\s\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:inclusiveEndDates\b)/i, /^(?:topAxis\b)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:tickInterval\s[^#\n;]+)/i, /^(?:includes\s[^#\n;]+)/i, /^(?:excludes\s[^#\n;]+)/i, /^(?:todayMarker\s[^\n;]+)/i, /^(?:weekday\s+monday\b)/i, /^(?:weekday\s+tuesday\b)/i, /^(?:weekday\s+wednesday\b)/i, /^(?:weekday\s+thursday\b)/i, /^(?:weekday\s+friday\b)/i, /^(?:weekday\s+saturday\b)/i, /^(?:weekday\s+sunday\b)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accDescription\s[^#\n;]+)/i, /^(?:section\s[^\n]+)/i, /^(?:[^:\n]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "acc_descr_multiline": { "rules": [6, 7], "inclusive": false }, "acc_descr": { "rules": [4], "inclusive": false }, "acc_title": { "rules": [2], "inclusive": false }, "callbackargs": { "rules": [21, 22], "inclusive": false }, "callbackname": { "rules": [18, 19, 20], "inclusive": false }, "href": { "rules": [15, 16], "inclusive": false }, "click": { "rules": [24, 25], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 17, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$q.parser = parser$q; - const ganttParser = parser$q; - var isoWeek = { exports: {} }; - (function(module2, exports2) { - !function(e, t) { - module2.exports = t(); - }(commonjsGlobal, function() { - var e = "day"; - return function(t, i2, s) { - var a = function(t4) { - return t4.add(4 - t4.isoWeekday(), e); - }, d = i2.prototype; - d.isoWeekYear = function() { - return a(this).year(); - }, d.isoWeek = function(t4) { - if (!this.$utils().u(t4)) - return this.add(7 * (t4 - this.isoWeek()), e); - var i3, d2, n2, o, r = a(this), u = (i3 = this.isoWeekYear(), d2 = this.$u, n2 = (d2 ? s.utc : s)().year(i3).startOf("year"), o = 4 - n2.isoWeekday(), n2.isoWeekday() > 4 && (o += 7), n2.add(o, e)); - return r.diff(u, "week") + 1; - }, d.isoWeekday = function(e3) { - return this.$utils().u(e3) ? this.day() || 7 : this.day(this.day() % 7 ? e3 : e3 - 7); - }; - var n = d.startOf; - d.startOf = function(e3, t4) { - var i3 = this.$utils(), s2 = !!i3.u(t4) || t4; - return "isoweek" === i3.p(e3) ? s2 ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : n.bind(this)(e3, t4); - }; - }; - }); - })(isoWeek); - var isoWeekExports = isoWeek.exports; - const dayjsIsoWeek = /* @__PURE__ */ getDefaultExportFromCjs(isoWeekExports); - var customParseFormat = { exports: {} }; - (function(module2, exports2) { - !function(e, t) { - module2.exports = t(); - }(commonjsGlobal, function() { - var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d\d/, r = /\d\d?/, i2 = /\d*[^-_:/,()\s\d]+/, o = {}, s = function(e3) { - return (e3 = +e3) + (e3 > 68 ? 1900 : 2e3); - }; - var a = function(e3) { - return function(t4) { - this[e3] = +t4; - }; - }, f2 = [/[+-]\d\d:?(\d\d)?|Z/, function(e3) { - (this.zone || (this.zone = {})).offset = function(e4) { - if (!e4) - return 0; - if ("Z" === e4) - return 0; - var t4 = e4.match(/([+-]|\d\d)/g), n2 = 60 * t4[1] + (+t4[2] || 0); - return 0 === n2 ? 0 : "+" === t4[0] ? -n2 : n2; - }(e3); - }], h = function(e3) { - var t4 = o[e3]; - return t4 && (t4.indexOf ? t4 : t4.s.concat(t4.f)); - }, u = function(e3, t4) { - var n2, r2 = o.meridiem; - if (r2) { - for (var i3 = 1; i3 <= 24; i3 += 1) - if (e3.indexOf(r2(i3, 0, t4)) > -1) { - n2 = i3 > 12; - break; - } - } else - n2 = e3 === (t4 ? "pm" : "PM"); - return n2; - }, d = { A: [i2, function(e3) { - this.afternoon = u(e3, false); - }], a: [i2, function(e3) { - this.afternoon = u(e3, true); - }], S: [/\d/, function(e3) { - this.milliseconds = 100 * +e3; - }], SS: [n, function(e3) { - this.milliseconds = 10 * +e3; - }], SSS: [/\d{3}/, function(e3) { - this.milliseconds = +e3; - }], s: [r, a("seconds")], ss: [r, a("seconds")], m: [r, a("minutes")], mm: [r, a("minutes")], H: [r, a("hours")], h: [r, a("hours")], HH: [r, a("hours")], hh: [r, a("hours")], D: [r, a("day")], DD: [n, a("day")], Do: [i2, function(e3) { - var t4 = o.ordinal, n2 = e3.match(/\d+/); - if (this.day = n2[0], t4) - for (var r2 = 1; r2 <= 31; r2 += 1) - t4(r2).replace(/\[|\]/g, "") === e3 && (this.day = r2); - }], M: [r, a("month")], MM: [n, a("month")], MMM: [i2, function(e3) { - var t4 = h("months"), n2 = (h("monthsShort") || t4.map(function(e4) { - return e4.slice(0, 3); - })).indexOf(e3) + 1; - if (n2 < 1) - throw new Error(); - this.month = n2 % 12 || n2; - }], MMMM: [i2, function(e3) { - var t4 = h("months").indexOf(e3) + 1; - if (t4 < 1) - throw new Error(); - this.month = t4 % 12 || t4; - }], Y: [/[+-]?\d+/, a("year")], YY: [n, function(e3) { - this.year = s(e3); - }], YYYY: [/\d{4}/, a("year")], Z: f2, ZZ: f2 }; - function c2(n2) { - var r2, i3; - r2 = n2, i3 = o && o.formats; - for (var s2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t4, n3, r3) { - var o2 = r3 && r3.toUpperCase(); - return n3 || i3[r3] || e[r3] || i3[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e3, t5, n4) { - return t5 || n4.slice(1); - }); - })).match(t), a2 = s2.length, f3 = 0; f3 < a2; f3 += 1) { - var h2 = s2[f3], u2 = d[h2], c3 = u2 && u2[0], l = u2 && u2[1]; - s2[f3] = l ? { regex: c3, parser: l } : h2.replace(/^\[|\]$/g, ""); - } - return function(e3) { - for (var t4 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) { - var i4 = s2[n3]; - if ("string" == typeof i4) - r3 += i4.length; - else { - var o2 = i4.regex, f4 = i4.parser, h3 = e3.slice(r3), u3 = o2.exec(h3)[0]; - f4.call(t4, u3), e3 = e3.replace(u3, ""); - } - } - return function(e4) { - var t5 = e4.afternoon; - if (void 0 !== t5) { - var n4 = e4.hours; - t5 ? n4 < 12 && (e4.hours += 12) : 12 === n4 && (e4.hours = 0), delete e4.afternoon; - } - }(t4), t4; - }; - } - return function(e3, t4, n2) { - n2.p.customParseFormat = true, e3 && e3.parseTwoDigitYear && (s = e3.parseTwoDigitYear); - var r2 = t4.prototype, i3 = r2.parse; - r2.parse = function(e4) { - var t5 = e4.date, r3 = e4.utc, s2 = e4.args; - this.$u = r3; - var a2 = s2[1]; - if ("string" == typeof a2) { - var f3 = true === s2[2], h2 = true === s2[3], u2 = f3 || h2, d2 = s2[2]; - h2 && (d2 = s2[2]), o = this.$locale(), !f3 && d2 && (o = n2.Ls[d2]), this.$d = function(e6, t6, n3) { - try { - if (["x", "X"].indexOf(t6) > -1) - return new Date(("X" === t6 ? 1e3 : 1) * e6); - var r4 = c2(t6)(e6), i4 = r4.year, o2 = r4.month, s3 = r4.day, a3 = r4.hours, f4 = r4.minutes, h3 = r4.seconds, u3 = r4.milliseconds, d3 = r4.zone, l2 = /* @__PURE__ */ new Date(), m2 = s3 || (i4 || o2 ? 1 : l2.getDate()), M2 = i4 || l2.getFullYear(), Y = 0; - i4 && !o2 || (Y = o2 > 0 ? o2 - 1 : l2.getMonth()); - var p = a3 || 0, v = f4 || 0, D2 = h3 || 0, g = u3 || 0; - return d3 ? new Date(Date.UTC(M2, Y, m2, p, v, D2, g + 60 * d3.offset * 1e3)) : n3 ? new Date(Date.UTC(M2, Y, m2, p, v, D2, g)) : new Date(M2, Y, m2, p, v, D2, g); - } catch (e7) { - return /* @__PURE__ */ new Date(""); - } - }(t5, a2, r3), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t5 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), o = {}; - } else if (a2 instanceof Array) - for (var l = a2.length, m = 1; m <= l; m += 1) { - s2[1] = a2[m - 1]; - var M = n2.apply(this, s2); - if (M.isValid()) { - this.$d = M.$d, this.$L = M.$L, this.init(); - break; - } - m === l && (this.$d = /* @__PURE__ */ new Date("")); - } - else - i3.call(this, e4); - }; - }; - }); - })(customParseFormat); - var customParseFormatExports = customParseFormat.exports; - const dayjsCustomParseFormat = /* @__PURE__ */ getDefaultExportFromCjs(customParseFormatExports); - var advancedFormat = { exports: {} }; - (function(module2, exports2) { - !function(e, t) { - module2.exports = t(); - }(commonjsGlobal, function() { - return function(e, t) { - var r = t.prototype, n = r.format; - r.format = function(e3) { - var t4 = this, r2 = this.$locale(); - if (!this.isValid()) - return n.bind(this)(e3); - var s = this.$utils(), a = (e3 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(e4) { - switch (e4) { - case "Q": - return Math.ceil((t4.$M + 1) / 3); - case "Do": - return r2.ordinal(t4.$D); - case "gggg": - return t4.weekYear(); - case "GGGG": - return t4.isoWeekYear(); - case "wo": - return r2.ordinal(t4.week(), "W"); - case "w": - case "ww": - return s.s(t4.week(), "w" === e4 ? 1 : 2, "0"); - case "W": - case "WW": - return s.s(t4.isoWeek(), "W" === e4 ? 1 : 2, "0"); - case "k": - case "kk": - return s.s(String(0 === t4.$H ? 24 : t4.$H), "k" === e4 ? 1 : 2, "0"); - case "X": - return Math.floor(t4.$d.getTime() / 1e3); - case "x": - return t4.$d.getTime(); - case "z": - return "[" + t4.offsetName() + "]"; - case "zzz": - return "[" + t4.offsetName("long") + "]"; - default: - return e4; - } - }); - return n.bind(this)(a); - }; - }; - }); - })(advancedFormat); - var advancedFormatExports = advancedFormat.exports; - const dayjsAdvancedFormat = /* @__PURE__ */ getDefaultExportFromCjs(advancedFormatExports); - dayjs.extend(dayjsIsoWeek); - dayjs.extend(dayjsCustomParseFormat); - dayjs.extend(dayjsAdvancedFormat); - let dateFormat = ""; - let axisFormat = ""; - let tickInterval = void 0; - let todayMarker = ""; - let includes = []; - let excludes = []; - let links$1 = {}; - let sections$3 = []; - let tasks$2 = []; - let currentSection$2 = ""; - let displayMode = ""; - const tags = ["active", "done", "crit", "milestone"]; - let funs = []; - let inclusiveEndDates = false; - let topAxis = false; - let weekday = "sunday"; - let lastOrder = 0; - const clear$d = function() { - sections$3 = []; - tasks$2 = []; - currentSection$2 = ""; - funs = []; - taskCnt = 0; - lastTask = void 0; - lastTaskID = void 0; - rawTasks$2 = []; - dateFormat = ""; - axisFormat = ""; - displayMode = ""; - tickInterval = void 0; - todayMarker = ""; - includes = []; - excludes = []; - inclusiveEndDates = false; - topAxis = false; - lastOrder = 0; - links$1 = {}; - clear$n(); - weekday = "sunday"; - }; - const setAxisFormat = function(txt) { - axisFormat = txt; - }; - const getAxisFormat = function() { - return axisFormat; - }; - const setTickInterval = function(txt) { - tickInterval = txt; - }; - const getTickInterval = function() { - return tickInterval; - }; - const setTodayMarker = function(txt) { - todayMarker = txt; - }; - const getTodayMarker = function() { - return todayMarker; - }; - const setDateFormat = function(txt) { - dateFormat = txt; - }; - const enableInclusiveEndDates = function() { - inclusiveEndDates = true; - }; - const endDatesAreInclusive = function() { - return inclusiveEndDates; - }; - const enableTopAxis = function() { - topAxis = true; - }; - const topAxisEnabled = function() { - return topAxis; - }; - const setDisplayMode = function(txt) { - displayMode = txt; - }; - const getDisplayMode = function() { - return displayMode; - }; - const getDateFormat = function() { - return dateFormat; - }; - const setIncludes = function(txt) { - includes = txt.toLowerCase().split(/[\s,]+/); - }; - const getIncludes = function() { - return includes; - }; - const setExcludes = function(txt) { - excludes = txt.toLowerCase().split(/[\s,]+/); - }; - const getExcludes = function() { - return excludes; - }; - const getLinks$1 = function() { - return links$1; - }; - const addSection$3 = function(txt) { - currentSection$2 = txt; - sections$3.push(txt); - }; - const getSections$3 = function() { - return sections$3; - }; - const getTasks$2 = function() { - let allItemsProcessed = compileTasks$2(); - const maxDepth = 10; - let iterationCount = 0; - while (!allItemsProcessed && iterationCount < maxDepth) { - allItemsProcessed = compileTasks$2(); - iterationCount++; - } - tasks$2 = rawTasks$2; - return tasks$2; - }; - const isInvalidDate = function(date2, dateFormat2, excludes2, includes2) { - if (includes2.includes(date2.format(dateFormat2.trim()))) { - return false; - } - if (date2.isoWeekday() >= 6 && excludes2.includes("weekends")) { - return true; - } - if (excludes2.includes(date2.format("dddd").toLowerCase())) { - return true; - } - return excludes2.includes(date2.format(dateFormat2.trim())); - }; - const setWeekday = function(txt) { - weekday = txt; - }; - const getWeekday = function() { - return weekday; - }; - const checkTaskDates = function(task, dateFormat2, excludes2, includes2) { - if (!excludes2.length || task.manualEndTime) { - return; - } - let startTime; - if (task.startTime instanceof Date) { - startTime = dayjs(task.startTime); + return every_default(prod.definition, (subProd) => { + return isOptionalProd(subProd, alreadyVisited); + }); } else { - startTime = dayjs(task.startTime, dateFormat2, true); + return false; } - startTime = startTime.add(1, "d"); - let originalEndTime; - if (task.endTime instanceof Date) { - originalEndTime = dayjs(task.endTime); + } + function isBranchingProd(prod) { + return prod instanceof Alternation; + } + function getProductionDslName(prod) { + if (prod instanceof NonTerminal) { + return "SUBRULE"; + } else if (prod instanceof Option2) { + return "OPTION"; + } else if (prod instanceof Alternation) { + return "OR"; + } else if (prod instanceof RepetitionMandatory) { + return "AT_LEAST_ONE"; + } else if (prod instanceof RepetitionMandatoryWithSeparator) { + return "AT_LEAST_ONE_SEP"; + } else if (prod instanceof RepetitionWithSeparator) { + return "MANY_SEP"; + } else if (prod instanceof Repetition) { + return "MANY"; + } else if (prod instanceof Terminal) { + return "CONSUME"; } else { - originalEndTime = dayjs(task.endTime, dateFormat2, true); - } - const [fixedEndTime, renderEndTime] = fixTaskDates( - startTime, - originalEndTime, - dateFormat2, - excludes2, - includes2 - ); - task.endTime = fixedEndTime.toDate(); - task.renderEndTime = renderEndTime; - }; - const fixTaskDates = function(startTime, endTime, dateFormat2, excludes2, includes2) { - let invalid = false; - let renderEndTime = null; - while (startTime <= endTime) { - if (!invalid) { - renderEndTime = endTime.toDate(); - } - invalid = isInvalidDate(startTime, dateFormat2, excludes2, includes2); - if (invalid) { - endTime = endTime.add(1, "d"); - } - startTime = startTime.add(1, "d"); + throw Error("non exhaustive match"); } - return [endTime, renderEndTime]; - }; - const getStartDate = function(prevTime, dateFormat2, str2) { - str2 = str2.trim(); - const afterRePattern = /^after\s+(?[\d\w- ]+)/; - const afterStatement = afterRePattern.exec(str2); - if (afterStatement !== null) { - let latestTask = null; - for (const id2 of afterStatement.groups.ids.split(" ")) { - let task = findTaskById(id2); - if (task !== void 0 && (!latestTask || task.endTime > latestTask.endTime)) { - latestTask = task; - } - } - if (latestTask) { - return latestTask.endTime; - } - const today = /* @__PURE__ */ new Date(); - today.setHours(0, 0, 0, 0); - return today; - } - let mDate = dayjs(str2, dateFormat2.trim(), true); - if (mDate.isValid()) { - return mDate.toDate(); - } else { - log$1.debug("Invalid date:" + str2); - log$1.debug("With date format:" + dateFormat2.trim()); - const d = new Date(str2); - if (d === void 0 || isNaN(d.getTime()) || // WebKit browsers can mis-parse invalid dates to be ridiculously - // huge numbers, e.g. new Date('202304') gets parsed as January 1, 202304. - // This can cause virtually infinite loops while rendering, so for the - // purposes of Gantt charts we'll just treat any date beyond 10,000 AD/BC as - // invalid. - d.getFullYear() < -1e4 || d.getFullYear() > 1e4) { - throw new Error("Invalid date:" + str2); - } - return d; + } + var init_helpers = __esm({ + "../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/helpers.js"() { + "use strict"; + init_lodash(); + init_model(); + __name(isSequenceProd, "isSequenceProd"); + __name(isOptionalProd, "isOptionalProd"); + __name(isBranchingProd, "isBranchingProd"); + __name(getProductionDslName, "getProductionDslName"); } - }; - const parseDuration = function(str2) { - const statement = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(str2.trim()); - if (statement !== null) { - return [Number.parseFloat(statement[1]), statement[2]]; + }); + + // ../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/api.js + var init_api3 = __esm({ + "../../node_modules/.pnpm/@chevrotain+gast@11.0.3/node_modules/@chevrotain/gast/lib/src/api.js"() { + "use strict"; + init_model(); + init_visitor(); + init_helpers(); } - return [NaN, "ms"]; - }; - const getEndDate = function(prevTime, dateFormat2, str2, inclusive = false) { - str2 = str2.trim(); - const untilRePattern = /^until\s+(?[\d\w- ]+)/; - const untilStatement = untilRePattern.exec(str2); - if (untilStatement !== null) { - let earliestTask = null; - for (const id2 of untilStatement.groups.ids.split(" ")) { - let task = findTaskById(id2); - if (task !== void 0 && (!earliestTask || task.startTime < earliestTask.startTime)) { - earliestTask = task; + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/rest.js + function restForRepetitionWithSeparator(repSepProd, currRest, prevRest) { + const repSepRest = [ + new Option2({ + definition: [ + new Terminal({ terminalType: repSepProd.separator }) + ].concat(repSepProd.definition) + }) + ]; + const fullRepSepRest = repSepRest.concat(currRest, prevRest); + return fullRepSepRest; + } + var RestWalker; + var init_rest = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/rest.js"() { + "use strict"; + init_lodash(); + init_api3(); + RestWalker = class { + static { + __name(this, "RestWalker"); + } + walk(prod, prevRest = []) { + forEach_default(prod.definition, (subProd, index) => { + const currRest = drop_default(prod.definition, index + 1); + if (subProd instanceof NonTerminal) { + this.walkProdRef(subProd, currRest, prevRest); + } else if (subProd instanceof Terminal) { + this.walkTerminal(subProd, currRest, prevRest); + } else if (subProd instanceof Alternative) { + this.walkFlat(subProd, currRest, prevRest); + } else if (subProd instanceof Option2) { + this.walkOption(subProd, currRest, prevRest); + } else if (subProd instanceof RepetitionMandatory) { + this.walkAtLeastOne(subProd, currRest, prevRest); + } else if (subProd instanceof RepetitionMandatoryWithSeparator) { + this.walkAtLeastOneSep(subProd, currRest, prevRest); + } else if (subProd instanceof RepetitionWithSeparator) { + this.walkManySep(subProd, currRest, prevRest); + } else if (subProd instanceof Repetition) { + this.walkMany(subProd, currRest, prevRest); + } else if (subProd instanceof Alternation) { + this.walkOr(subProd, currRest, prevRest); + } else { + throw Error("non exhaustive match"); + } + }); } - } - if (earliestTask) { - return earliestTask.startTime; - } - const today = /* @__PURE__ */ new Date(); - today.setHours(0, 0, 0, 0); - return today; - } - let parsedDate = dayjs(str2, dateFormat2.trim(), true); - if (parsedDate.isValid()) { - if (inclusive) { - parsedDate = parsedDate.add(1, "d"); - } - return parsedDate.toDate(); - } - let endTime = dayjs(prevTime); - const [durationValue, durationUnit] = parseDuration(str2); - if (!Number.isNaN(durationValue)) { - const newEndTime = endTime.add(durationValue, durationUnit); - if (newEndTime.isValid()) { - endTime = newEndTime; - } - } - return endTime.toDate(); - }; - let taskCnt = 0; - const parseId = function(idStr) { - if (idStr === void 0) { - taskCnt = taskCnt + 1; - return "task" + taskCnt; - } - return idStr; - }; - const compileData = function(prevTask, dataStr) { - let ds; - if (dataStr.substr(0, 1) === ":") { - ds = dataStr.substr(1, dataStr.length); - } else { - ds = dataStr; - } - const data = ds.split(","); - const task = {}; - getTaskTags(data, task, tags); - for (let i2 = 0; i2 < data.length; i2++) { - data[i2] = data[i2].trim(); - } - let endTimeData = ""; - switch (data.length) { - case 1: - task.id = parseId(); - task.startTime = prevTask.endTime; - endTimeData = data[0]; - break; - case 2: - task.id = parseId(); - task.startTime = getStartDate(void 0, dateFormat, data[0]); - endTimeData = data[1]; - break; - case 3: - task.id = parseId(data[0]); - task.startTime = getStartDate(void 0, dateFormat, data[1]); - endTimeData = data[2]; - break; - } - if (endTimeData) { - task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates); - task.manualEndTime = dayjs(endTimeData, "YYYY-MM-DD", true).isValid(); - checkTaskDates(task, dateFormat, excludes, includes); - } - return task; - }; - const parseData = function(prevTaskId, dataStr) { - let ds; - if (dataStr.substr(0, 1) === ":") { - ds = dataStr.substr(1, dataStr.length); - } else { - ds = dataStr; - } - const data = ds.split(","); - const task = {}; - getTaskTags(data, task, tags); - for (let i2 = 0; i2 < data.length; i2++) { - data[i2] = data[i2].trim(); - } - switch (data.length) { - case 1: - task.id = parseId(); - task.startTime = { - type: "prevTaskEnd", - id: prevTaskId - }; - task.endTime = { - data: data[0] - }; - break; - case 2: - task.id = parseId(); - task.startTime = { - type: "getStartDate", - startData: data[0] - }; - task.endTime = { - data: data[1] - }; - break; - case 3: - task.id = parseId(data[0]); - task.startTime = { - type: "getStartDate", - startData: data[1] - }; - task.endTime = { - data: data[2] - }; - break; - } - return task; - }; - let lastTask; - let lastTaskID; - let rawTasks$2 = []; - const taskDb = {}; - const addTask$2 = function(descr, data) { - const rawTask = { - section: currentSection$2, - type: currentSection$2, - processed: false, - manualEndTime: false, - renderEndTime: null, - raw: { data }, - task: descr, - classes: [] - }; - const taskInfo = parseData(lastTaskID, data); - rawTask.raw.startTime = taskInfo.startTime; - rawTask.raw.endTime = taskInfo.endTime; - rawTask.id = taskInfo.id; - rawTask.prevTaskId = lastTaskID; - rawTask.active = taskInfo.active; - rawTask.done = taskInfo.done; - rawTask.crit = taskInfo.crit; - rawTask.milestone = taskInfo.milestone; - rawTask.order = lastOrder; - lastOrder++; - const pos = rawTasks$2.push(rawTask); - lastTaskID = rawTask.id; - taskDb[rawTask.id] = pos - 1; - }; - const findTaskById = function(id2) { - const pos = taskDb[id2]; - return rawTasks$2[pos]; - }; - const addTaskOrg$2 = function(descr, data) { - const newTask = { - section: currentSection$2, - type: currentSection$2, - description: descr, - task: descr, - classes: [] - }; - const taskInfo = compileData(lastTask, data); - newTask.startTime = taskInfo.startTime; - newTask.endTime = taskInfo.endTime; - newTask.id = taskInfo.id; - newTask.active = taskInfo.active; - newTask.done = taskInfo.done; - newTask.crit = taskInfo.crit; - newTask.milestone = taskInfo.milestone; - lastTask = newTask; - tasks$2.push(newTask); - }; - const compileTasks$2 = function() { - const compileTask = function(pos) { - const task = rawTasks$2[pos]; - let startTime = ""; - switch (rawTasks$2[pos].raw.startTime.type) { - case "prevTaskEnd": { - const prevTask = findTaskById(task.prevTaskId); - task.startTime = prevTask.endTime; - break; + walkTerminal(terminal, currRest, prevRest) { } - case "getStartDate": - startTime = getStartDate(void 0, dateFormat, rawTasks$2[pos].raw.startTime.startData); - if (startTime) { - rawTasks$2[pos].startTime = startTime; - } - break; - } - if (rawTasks$2[pos].startTime) { - rawTasks$2[pos].endTime = getEndDate( - rawTasks$2[pos].startTime, - dateFormat, - rawTasks$2[pos].raw.endTime.data, - inclusiveEndDates - ); - if (rawTasks$2[pos].endTime) { - rawTasks$2[pos].processed = true; - rawTasks$2[pos].manualEndTime = dayjs( - rawTasks$2[pos].raw.endTime.data, - "YYYY-MM-DD", - true - ).isValid(); - checkTaskDates(rawTasks$2[pos], dateFormat, excludes, includes); + walkProdRef(refProd, currRest, prevRest) { } - } - return rawTasks$2[pos].processed; - }; - let allProcessed = true; - for (const [i2, rawTask] of rawTasks$2.entries()) { - compileTask(i2); - allProcessed = allProcessed && rawTask.processed; + walkFlat(flatProd, currRest, prevRest) { + const fullOrRest = currRest.concat(prevRest); + this.walk(flatProd, fullOrRest); + } + walkOption(optionProd, currRest, prevRest) { + const fullOrRest = currRest.concat(prevRest); + this.walk(optionProd, fullOrRest); + } + walkAtLeastOne(atLeastOneProd, currRest, prevRest) { + const fullAtLeastOneRest = [ + new Option2({ definition: atLeastOneProd.definition }) + ].concat(currRest, prevRest); + this.walk(atLeastOneProd, fullAtLeastOneRest); + } + walkAtLeastOneSep(atLeastOneSepProd, currRest, prevRest) { + const fullAtLeastOneSepRest = restForRepetitionWithSeparator(atLeastOneSepProd, currRest, prevRest); + this.walk(atLeastOneSepProd, fullAtLeastOneSepRest); + } + walkMany(manyProd, currRest, prevRest) { + const fullManyRest = [ + new Option2({ definition: manyProd.definition }) + ].concat(currRest, prevRest); + this.walk(manyProd, fullManyRest); + } + walkManySep(manySepProd, currRest, prevRest) { + const fullManySepRest = restForRepetitionWithSeparator(manySepProd, currRest, prevRest); + this.walk(manySepProd, fullManySepRest); + } + walkOr(orProd, currRest, prevRest) { + const fullOrRest = currRest.concat(prevRest); + forEach_default(orProd.definition, (alt) => { + const prodWrapper = new Alternative({ definition: [alt] }); + this.walk(prodWrapper, fullOrRest); + }); + } + }; + __name(restForRepetitionWithSeparator, "restForRepetitionWithSeparator"); } - return allProcessed; - }; - const setLink$1 = function(ids, _linkStr) { - let linkStr = _linkStr; - if (getConfig$1().securityLevel !== "loose") { - linkStr = dist.sanitizeUrl(_linkStr); - } - ids.split(",").forEach(function(id2) { - let rawTask = findTaskById(id2); - if (rawTask !== void 0) { - pushFun(id2, () => { - window.open(linkStr, "_self"); - }); - links$1[id2] = linkStr; - } - }); - setClass(ids, "clickable"); - }; - const setClass = function(ids, className) { - ids.split(",").forEach(function(id2) { - let rawTask = findTaskById(id2); - if (rawTask !== void 0) { - rawTask.classes.push(className); - } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/first.js + function first(prod) { + if (prod instanceof NonTerminal) { + return first(prod.referencedRule); + } else if (prod instanceof Terminal) { + return firstForTerminal(prod); + } else if (isSequenceProd(prod)) { + return firstForSequence(prod); + } else if (isBranchingProd(prod)) { + return firstForBranching(prod); + } else { + throw Error("non exhaustive match"); + } + } + function firstForSequence(prod) { + let firstSet = []; + const seq2 = prod.definition; + let nextSubProdIdx = 0; + let hasInnerProdsRemaining = seq2.length > nextSubProdIdx; + let currSubProd; + let isLastInnerProdOptional = true; + while (hasInnerProdsRemaining && isLastInnerProdOptional) { + currSubProd = seq2[nextSubProdIdx]; + isLastInnerProdOptional = isOptionalProd(currSubProd); + firstSet = firstSet.concat(first(currSubProd)); + nextSubProdIdx = nextSubProdIdx + 1; + hasInnerProdsRemaining = seq2.length > nextSubProdIdx; + } + return uniq_default(firstSet); + } + function firstForBranching(prod) { + const allAlternativesFirsts = map_default(prod.definition, (innerProd) => { + return first(innerProd); }); - }; - const setClickFun = function(id2, functionName, functionArgs) { - if (getConfig$1().securityLevel !== "loose") { - return; + return uniq_default(flatten_default(allAlternativesFirsts)); + } + function firstForTerminal(terminal) { + return [terminal.terminalType]; + } + var init_first2 = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/first.js"() { + "use strict"; + init_lodash(); + init_api3(); + __name(first, "first"); + __name(firstForSequence, "firstForSequence"); + __name(firstForBranching, "firstForBranching"); + __name(firstForTerminal, "firstForTerminal"); } - if (functionName === void 0) { - return; + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/constants.js + var IN; + var init_constants2 = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/constants.js"() { + "use strict"; + IN = "_~IN~_"; } - let argList = []; - if (typeof functionArgs === "string") { - argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); - for (let i2 = 0; i2 < argList.length; i2++) { - let item = argList[i2].trim(); - if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { - item = item.substr(1, item.length - 2); - } - argList[i2] = item; - } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/follow.js + function computeAllProdsFollows(topProductions) { + const reSyncFollows = {}; + forEach_default(topProductions, (topProd) => { + const currRefsFollow = new ResyncFollowsWalker(topProd).startWalking(); + assign_default(reSyncFollows, currRefsFollow); + }); + return reSyncFollows; + } + function buildBetweenProdsFollowPrefix(inner2, occurenceInParent) { + return inner2.name + occurenceInParent + IN; + } + var ResyncFollowsWalker; + var init_follow = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/follow.js"() { + "use strict"; + init_rest(); + init_first2(); + init_lodash(); + init_constants2(); + init_api3(); + ResyncFollowsWalker = class extends RestWalker { + static { + __name(this, "ResyncFollowsWalker"); + } + constructor(topProd) { + super(); + this.topProd = topProd; + this.follows = {}; + } + startWalking() { + this.walk(this.topProd); + return this.follows; + } + walkTerminal(terminal, currRest, prevRest) { + } + walkProdRef(refProd, currRest, prevRest) { + const followName = buildBetweenProdsFollowPrefix(refProd.referencedRule, refProd.idx) + this.topProd.name; + const fullRest = currRest.concat(prevRest); + const restProd = new Alternative({ definition: fullRest }); + const t_in_topProd_follows = first(restProd); + this.follows[followName] = t_in_topProd_follows; + } + }; + __name(computeAllProdsFollows, "computeAllProdsFollows"); + __name(buildBetweenProdsFollowPrefix, "buildBetweenProdsFollowPrefix"); } - if (argList.length === 0) { - argList.push(id2); + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js + function getRegExpAst(regExp) { + const regExpStr = regExp.toString(); + if (regExpAstCache.hasOwnProperty(regExpStr)) { + return regExpAstCache[regExpStr]; + } else { + const regExpAst = regExpParser.pattern(regExpStr); + regExpAstCache[regExpStr] = regExpAst; + return regExpAst; } - let rawTask = findTaskById(id2); - if (rawTask !== void 0) { - pushFun(id2, () => { - utils$1.runFunc(functionName, ...argList); - }); + } + function clearRegExpParserCache() { + regExpAstCache = {}; + } + var regExpAstCache, regExpParser; + var init_reg_exp_parser = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js"() { + "use strict"; + init_api(); + regExpAstCache = {}; + regExpParser = new RegExpParser(); + __name(getRegExpAst, "getRegExpAst"); + __name(clearRegExpParserCache, "clearRegExpParserCache"); } - }; - const pushFun = function(id2, callbackFunction) { - funs.push( - function() { - const elem = document.querySelector(`[id="${id2}"]`); - if (elem !== null) { - elem.addEventListener("click", function() { - callbackFunction(); - }); + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/reg_exp.js + function getOptimizedStartCodesIndices(regExp, ensureOptimizations = false) { + try { + const ast = getRegExpAst(regExp); + const firstChars = firstCharOptimizedIndices(ast.value, {}, ast.flags.ignoreCase); + return firstChars; + } catch (e3) { + if (e3.message === complementErrorMessage) { + if (ensureOptimizations) { + PRINT_WARNING(`${failedOptimizationPrefixMsg} Unable to optimize: < ${regExp.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`); } - }, - function() { - const elem = document.querySelector(`[id="${id2}-text"]`); - if (elem !== null) { - elem.addEventListener("click", function() { - callbackFunction(); - }); + } else { + let msgSuffix = ""; + if (ensureOptimizations) { + msgSuffix = "\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."; } + PRINT_ERROR(`${failedOptimizationPrefixMsg} + Failed parsing: < ${regExp.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues` + msgSuffix); } - ); - }; - const setClickEvent$1 = function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id2) { - setClickFun(id2, functionName, functionArgs); - }); - setClass(ids, "clickable"); - }; - const bindFunctions$1 = function(element2) { - funs.forEach(function(fun) { - fun(element2); - }); - }; - const ganttDb = { - getConfig: () => getConfig$1().gantt, - clear: clear$d, - setDateFormat, - getDateFormat, - enableInclusiveEndDates, - endDatesAreInclusive, - enableTopAxis, - topAxisEnabled, - setAxisFormat, - getAxisFormat, - setTickInterval, - getTickInterval, - setTodayMarker, - getTodayMarker, - setAccTitle, - getAccTitle, - setDiagramTitle, - getDiagramTitle, - setDisplayMode, - getDisplayMode, - setAccDescription, - getAccDescription, - addSection: addSection$3, - getSections: getSections$3, - getTasks: getTasks$2, - addTask: addTask$2, - findTaskById, - addTaskOrg: addTaskOrg$2, - setIncludes, - getIncludes, - setExcludes, - getExcludes, - setClickEvent: setClickEvent$1, - setLink: setLink$1, - getLinks: getLinks$1, - bindFunctions: bindFunctions$1, - parseDuration, - isInvalidDate, - setWeekday, - getWeekday - }; - function getTaskTags(data, task, tags2) { - let matchFound = true; - while (matchFound) { - matchFound = false; - tags2.forEach(function(t) { - const pattern = "^\\s*" + t + "\\s*$"; - const regex = new RegExp(pattern); - if (data[0].match(regex)) { - task[t] = true; - data.shift(1); - matchFound = true; - } - }); } + return []; } - const setConf$5 = function() { - log$1.debug("Something is calling, setConf, remove the call"); - }; - const mapWeekdayToTimeFunction = { - monday: timeMonday, - tuesday: timeTuesday, - wednesday: timeWednesday, - thursday: timeThursday, - friday: timeFriday, - saturday: timeSaturday, - sunday: timeSunday - }; - const getMaxIntersections = (tasks2, orderOffset) => { - let timeline2 = [...tasks2].map(() => -Infinity); - let sorted = [...tasks2].sort((a, b) => a.startTime - b.startTime || a.order - b.order); - let maxIntersections = 0; - for (const element2 of sorted) { - for (let j = 0; j < timeline2.length; j++) { - if (element2.startTime >= timeline2[j]) { - timeline2[j] = element2.endTime; - element2.order = j + orderOffset; - if (j > maxIntersections) { - maxIntersections = j; + function firstCharOptimizedIndices(ast, result, ignoreCase) { + switch (ast.type) { + case "Disjunction": + for (let i2 = 0; i2 < ast.value.length; i2++) { + firstCharOptimizedIndices(ast.value[i2], result, ignoreCase); + } + break; + case "Alternative": + const terms = ast.value; + for (let i2 = 0; i2 < terms.length; i2++) { + const term = terms[i2]; + switch (term.type) { + case "EndAnchor": + case "GroupBackReference": + case "Lookahead": + case "NegativeLookahead": + case "StartAnchor": + case "WordBoundary": + case "NonWordBoundary": + continue; + } + const atom2 = term; + switch (atom2.type) { + case "Character": + addOptimizedIdxToResult(atom2.value, result, ignoreCase); + break; + case "Set": + if (atom2.complement === true) { + throw Error(complementErrorMessage); + } + forEach_default(atom2.value, (code) => { + if (typeof code === "number") { + addOptimizedIdxToResult(code, result, ignoreCase); + } else { + const range3 = code; + if (ignoreCase === true) { + for (let rangeCode = range3.from; rangeCode <= range3.to; rangeCode++) { + addOptimizedIdxToResult(rangeCode, result, ignoreCase); + } + } else { + for (let rangeCode = range3.from; rangeCode <= range3.to && rangeCode < minOptimizationVal; rangeCode++) { + addOptimizedIdxToResult(rangeCode, result, ignoreCase); + } + if (range3.to >= minOptimizationVal) { + const minUnOptVal = range3.from >= minOptimizationVal ? range3.from : minOptimizationVal; + const maxUnOptVal = range3.to; + const minOptIdx = charCodeToOptimizedIndex(minUnOptVal); + const maxOptIdx = charCodeToOptimizedIndex(maxUnOptVal); + for (let currOptIdx = minOptIdx; currOptIdx <= maxOptIdx; currOptIdx++) { + result[currOptIdx] = currOptIdx; + } + } + } + } + }); + break; + case "Group": + firstCharOptimizedIndices(atom2.value, result, ignoreCase); + break; + default: + throw Error("Non Exhaustive Match"); + } + const isOptionalQuantifier = atom2.quantifier !== void 0 && atom2.quantifier.atLeast === 0; + if ( + // A group may be optional due to empty contents /(?:)/ + // or if everything inside it is optional /((a)?)/ + atom2.type === "Group" && isWholeOptional(atom2) === false || // If this term is not a group it may only be optional if it has an optional quantifier + atom2.type !== "Group" && isOptionalQuantifier === false + ) { + break; } - break; } - } + break; + default: + throw Error("non exhaustive match!"); } - return maxIntersections; - }; - let w; - const draw$g = function(text2, id2, version2, diagObj) { - const conf2 = getConfig$1().gantt; - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - const elem = doc.getElementById(id2); - w = elem.parentElement.offsetWidth; - if (w === void 0) { - w = 1200; - } - if (conf2.useWidth !== void 0) { - w = conf2.useWidth; - } - const taskArray = diagObj.db.getTasks(); - let categories = []; - for (const element2 of taskArray) { - categories.push(element2.type); - } - categories = checkUnique(categories); - const categoryHeights = {}; - let h = 2 * conf2.topPadding; - if (diagObj.db.getDisplayMode() === "compact" || conf2.displayMode === "compact") { - const categoryElements = {}; - for (const element2 of taskArray) { - if (categoryElements[element2.section] === void 0) { - categoryElements[element2.section] = [element2]; - } else { - categoryElements[element2.section].push(element2); - } - } - let intersections = 0; - for (const category of Object.keys(categoryElements)) { - const categoryHeight = getMaxIntersections(categoryElements[category], intersections) + 1; - intersections += categoryHeight; - h += categoryHeight * (conf2.barHeight + conf2.barGap); - categoryHeights[category] = categoryHeight; - } + return values_default(result); + } + function addOptimizedIdxToResult(code, result, ignoreCase) { + const optimizedCharIdx = charCodeToOptimizedIndex(code); + result[optimizedCharIdx] = optimizedCharIdx; + if (ignoreCase === true) { + handleIgnoreCase(code, result); + } + } + function handleIgnoreCase(code, result) { + const char2 = String.fromCharCode(code); + const upperChar = char2.toUpperCase(); + if (upperChar !== char2) { + const optimizedCharIdx = charCodeToOptimizedIndex(upperChar.charCodeAt(0)); + result[optimizedCharIdx] = optimizedCharIdx; } else { - h += taskArray.length * (conf2.barHeight + conf2.barGap); - for (const category of categories) { - categoryHeights[category] = taskArray.filter((task) => task.type === category).length; + const lowerChar = char2.toLowerCase(); + if (lowerChar !== char2) { + const optimizedCharIdx = charCodeToOptimizedIndex(lowerChar.charCodeAt(0)); + result[optimizedCharIdx] = optimizedCharIdx; } } - elem.setAttribute("viewBox", "0 0 " + w + " " + h); - const svg2 = root2.select(`[id="${id2}"]`); - const timeScale = time$1().domain([ - min$3(taskArray, function(d) { - return d.startTime; - }), - max$3(taskArray, function(d) { - return d.endTime; - }) - ]).rangeRound([0, w - conf2.leftPadding - conf2.rightPadding]); - function taskCompare(a, b) { - const taskA = a.startTime; - const taskB = b.startTime; - let result = 0; - if (taskA > taskB) { - result = 1; - } else if (taskA < taskB) { - result = -1; + } + function findCode(setNode, targetCharCodes) { + return find_default(setNode.value, (codeOrRange) => { + if (typeof codeOrRange === "number") { + return includes_default(targetCharCodes, codeOrRange); + } else { + const range3 = codeOrRange; + return find_default(targetCharCodes, (targetCode) => range3.from <= targetCode && targetCode <= range3.to) !== void 0; } - return result; + }); + } + function isWholeOptional(ast) { + const quantifier = ast.quantifier; + if (quantifier && quantifier.atLeast === 0) { + return true; } - taskArray.sort(taskCompare); - makeGantt(taskArray, w, h); - configureSvgSize(svg2, h, w, conf2.useMaxWidth); - svg2.append("text").text(diagObj.db.getDiagramTitle()).attr("x", w / 2).attr("y", conf2.titleTopMargin).attr("class", "titleText"); - function makeGantt(tasks2, pageWidth, pageHeight) { - const barHeight = conf2.barHeight; - const gap = barHeight + conf2.barGap; - const topPadding = conf2.topPadding; - const leftPadding = conf2.leftPadding; - const colorScale = linear().domain([0, categories.length]).range(["#00B9FA", "#F95002"]).interpolate(interpolateHcl); - drawExcludeDays( - gap, - topPadding, - leftPadding, - pageWidth, - pageHeight, - tasks2, - diagObj.db.getExcludes(), - diagObj.db.getIncludes() - ); - makeGrid(leftPadding, topPadding, pageWidth, pageHeight); - drawRects(tasks2, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth); - vertLabels(gap, topPadding); - drawToday(leftPadding, topPadding, pageWidth, pageHeight); - } - function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w2) { - const uniqueTaskOrderIds = [...new Set(theArray.map((item) => item.order))]; - const uniqueTasks = uniqueTaskOrderIds.map((id3) => theArray.find((item) => item.order === id3)); - svg2.append("g").selectAll("rect").data(uniqueTasks).enter().append("rect").attr("x", 0).attr("y", function(d, i2) { - i2 = d.order; - return i2 * theGap + theTopPad - 2; - }).attr("width", function() { - return w2 - conf2.rightPadding / 2; - }).attr("height", theGap).attr("class", function(d) { - for (const [i2, category] of categories.entries()) { - if (d.type === category) { - return "section section" + i2 % conf2.numberSectionStyles; - } - } - return "section section0"; - }); - const rectangles = svg2.append("g").selectAll("rect").data(theArray).enter(); - const links2 = diagObj.db.getLinks(); - rectangles.append("rect").attr("id", function(d) { - return d.id; - }).attr("rx", 3).attr("ry", 3).attr("x", function(d) { - if (d.milestone) { - return timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight; - } - return timeScale(d.startTime) + theSidePad; - }).attr("y", function(d, i2) { - i2 = d.order; - return i2 * theGap + theTopPad; - }).attr("width", function(d) { - if (d.milestone) { - return theBarHeight; - } - return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime); - }).attr("height", theBarHeight).attr("transform-origin", function(d, i2) { - i2 = d.order; - return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + "px " + (i2 * theGap + theTopPad + 0.5 * theBarHeight).toString() + "px"; - }).attr("class", function(d) { - const res = "task"; - let classStr = ""; - if (d.classes.length > 0) { - classStr = d.classes.join(" "); - } - let secNum = 0; - for (const [i2, category] of categories.entries()) { - if (d.type === category) { - secNum = i2 % conf2.numberSectionStyles; - } - } - let taskClass = ""; - if (d.active) { - if (d.crit) { - taskClass += " activeCrit"; - } else { - taskClass = " active"; - } - } else if (d.done) { - if (d.crit) { - taskClass = " doneCrit"; - } else { - taskClass = " done"; + if (!ast.value) { + return false; + } + return isArray_default(ast.value) ? every_default(ast.value, isWholeOptional) : isWholeOptional(ast.value); + } + function canMatchCharCode(charCodes, pattern) { + if (pattern instanceof RegExp) { + const ast = getRegExpAst(pattern); + const charCodeFinder = new CharCodeFinder(charCodes); + charCodeFinder.visit(ast); + return charCodeFinder.found; + } else { + return find_default(pattern, (char2) => { + return includes_default(charCodes, char2.charCodeAt(0)); + }) !== void 0; + } + } + var complementErrorMessage, failedOptimizationPrefixMsg, CharCodeFinder; + var init_reg_exp = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/reg_exp.js"() { + "use strict"; + init_api(); + init_lodash(); + init_api2(); + init_reg_exp_parser(); + init_lexer(); + complementErrorMessage = "Complement Sets are not supported for first char optimization"; + failedOptimizationPrefixMsg = 'Unable to use "first char" lexer optimizations:\n'; + __name(getOptimizedStartCodesIndices, "getOptimizedStartCodesIndices"); + __name(firstCharOptimizedIndices, "firstCharOptimizedIndices"); + __name(addOptimizedIdxToResult, "addOptimizedIdxToResult"); + __name(handleIgnoreCase, "handleIgnoreCase"); + __name(findCode, "findCode"); + __name(isWholeOptional, "isWholeOptional"); + CharCodeFinder = class extends BaseRegExpVisitor { + static { + __name(this, "CharCodeFinder"); + } + constructor(targetCharCodes) { + super(); + this.targetCharCodes = targetCharCodes; + this.found = false; + } + visitChildren(node2) { + if (this.found === true) { + return; } - } else { - if (d.crit) { - taskClass += " crit"; + switch (node2.type) { + case "Lookahead": + this.visitLookahead(node2); + return; + case "NegativeLookahead": + this.visitNegativeLookahead(node2); + return; } + super.visitChildren(node2); } - if (taskClass.length === 0) { - taskClass = " task"; - } - if (d.milestone) { - taskClass = " milestone " + taskClass; - } - taskClass += secNum; - taskClass += " " + classStr; - return res + taskClass; - }); - rectangles.append("text").attr("id", function(d) { - return d.id + "-text"; - }).text(function(d) { - return d.task; - }).attr("font-size", conf2.fontSize).attr("x", function(d) { - let startX = timeScale(d.startTime); - let endX = timeScale(d.renderEndTime || d.endTime); - if (d.milestone) { - startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight; - } - if (d.milestone) { - endX = startX + theBarHeight; - } - const textWidth = this.getBBox().width; - if (textWidth > endX - startX) { - if (endX + textWidth + 1.5 * conf2.leftPadding > w2) { - return startX + theSidePad - 5; - } else { - return endX + theSidePad + 5; - } - } else { - return (endX - startX) / 2 + startX + theSidePad; - } - }).attr("y", function(d, i2) { - i2 = d.order; - return i2 * theGap + conf2.barHeight / 2 + (conf2.fontSize / 2 - 2) + theTopPad; - }).attr("text-height", theBarHeight).attr("class", function(d) { - const startX = timeScale(d.startTime); - let endX = timeScale(d.endTime); - if (d.milestone) { - endX = startX + theBarHeight; - } - const textWidth = this.getBBox().width; - let classStr = ""; - if (d.classes.length > 0) { - classStr = d.classes.join(" "); - } - let secNum = 0; - for (const [i2, category] of categories.entries()) { - if (d.type === category) { - secNum = i2 % conf2.numberSectionStyles; - } - } - let taskType = ""; - if (d.active) { - if (d.crit) { - taskType = "activeCritText" + secNum; - } else { - taskType = "activeText" + secNum; + visitCharacter(node2) { + if (includes_default(this.targetCharCodes, node2.value)) { + this.found = true; } } - if (d.done) { - if (d.crit) { - taskType = taskType + " doneCritText" + secNum; + visitSet(node2) { + if (node2.complement) { + if (findCode(node2, this.targetCharCodes) === void 0) { + this.found = true; + } } else { - taskType = taskType + " doneText" + secNum; - } - } else { - if (d.crit) { - taskType = taskType + " critText" + secNum; + if (findCode(node2, this.targetCharCodes) !== void 0) { + this.found = true; + } } } - if (d.milestone) { - taskType += " milestoneText"; - } - if (textWidth > endX - startX) { - if (endX + textWidth + 1.5 * conf2.leftPadding > w2) { - return classStr + " taskTextOutsideLeft taskTextOutside" + secNum + " " + taskType; + }; + __name(canMatchCharCode, "canMatchCharCode"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/lexer.js + function analyzeTokenTypes(tokenTypes, options3) { + options3 = defaults_default(options3, { + useSticky: SUPPORT_STICKY, + debug: false, + safeMode: false, + positionTracking: "full", + lineTerminatorCharacters: ["\r", "\n"], + tracer: /* @__PURE__ */ __name((msg, action) => action(), "tracer") + }); + const tracer = options3.tracer; + tracer("initCharCodeToOptimizedIndexMap", () => { + initCharCodeToOptimizedIndexMap(); + }); + let onlyRelevantTypes; + tracer("Reject Lexer.NA", () => { + onlyRelevantTypes = reject_default(tokenTypes, (currType) => { + return currType[PATTERN] === Lexer2.NA; + }); + }); + let hasCustom = false; + let allTransformedPatterns; + tracer("Transform Patterns", () => { + hasCustom = false; + allTransformedPatterns = map_default(onlyRelevantTypes, (currType) => { + const currPattern = currType[PATTERN]; + if (isRegExp_default(currPattern)) { + const regExpSource = currPattern.source; + if (regExpSource.length === 1 && // only these regExp meta characters which can appear in a length one regExp + regExpSource !== "^" && regExpSource !== "$" && regExpSource !== "." && !currPattern.ignoreCase) { + return regExpSource; + } else if (regExpSource.length === 2 && regExpSource[0] === "\\" && // not a meta character + !includes_default([ + "d", + "D", + "s", + "S", + "t", + "r", + "n", + "t", + "0", + "c", + "b", + "B", + "f", + "v", + "w", + "W" + ], regExpSource[1])) { + return regExpSource[1]; + } else { + return options3.useSticky ? addStickyFlag(currPattern) : addStartOfInput(currPattern); + } + } else if (isFunction_default(currPattern)) { + hasCustom = true; + return { exec: currPattern }; + } else if (typeof currPattern === "object") { + hasCustom = true; + return currPattern; + } else if (typeof currPattern === "string") { + if (currPattern.length === 1) { + return currPattern; } else { - return classStr + " taskTextOutsideRight taskTextOutside" + secNum + " " + taskType + " width-" + textWidth; + const escapedRegExpString = currPattern.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&"); + const wrappedRegExp = new RegExp(escapedRegExpString); + return options3.useSticky ? addStickyFlag(wrappedRegExp) : addStartOfInput(wrappedRegExp); } } else { - return classStr + " taskText taskText" + secNum + " " + taskType + " width-" + textWidth; + throw Error("non exhaustive match"); } }); - const securityLevel2 = getConfig$1().securityLevel; - if (securityLevel2 === "sandbox") { - let sandboxElement2; - sandboxElement2 = d3select("#i" + id2); - const doc2 = sandboxElement2.nodes()[0].contentDocument; - rectangles.filter(function(d) { - return links2[d.id] !== void 0; - }).each(function(o) { - var taskRect = doc2.querySelector("#" + o.id); - var taskText = doc2.querySelector("#" + o.id + "-text"); - const oldParent = taskRect.parentNode; - var Link = doc2.createElement("a"); - Link.setAttribute("xlink:href", links2[o.id]); - Link.setAttribute("target", "_top"); - oldParent.appendChild(Link); - Link.appendChild(taskRect); - Link.appendChild(taskText); - }); - } - } - function drawExcludeDays(theGap, theTopPad, theSidePad, w2, h2, tasks2, excludes2, includes2) { - if (excludes2.length === 0 && includes2.length === 0) { - return; - } - let minTime; - let maxTime; - for (const { startTime, endTime } of tasks2) { - if (minTime === void 0 || startTime < minTime) { - minTime = startTime; + }); + let patternIdxToType; + let patternIdxToGroup; + let patternIdxToLongerAltIdxArr; + let patternIdxToPushMode; + let patternIdxToPopMode; + tracer("misc mapping", () => { + patternIdxToType = map_default(onlyRelevantTypes, (currType) => currType.tokenTypeIdx); + patternIdxToGroup = map_default(onlyRelevantTypes, (clazz) => { + const groupName = clazz.GROUP; + if (groupName === Lexer2.SKIPPED) { + return void 0; + } else if (isString_default(groupName)) { + return groupName; + } else if (isUndefined_default(groupName)) { + return false; + } else { + throw Error("non exhaustive match"); } - if (maxTime === void 0 || endTime > maxTime) { - maxTime = endTime; + }); + patternIdxToLongerAltIdxArr = map_default(onlyRelevantTypes, (clazz) => { + const longerAltType = clazz.LONGER_ALT; + if (longerAltType) { + const longerAltIdxArr = isArray_default(longerAltType) ? map_default(longerAltType, (type3) => indexOf_default(onlyRelevantTypes, type3)) : [indexOf_default(onlyRelevantTypes, longerAltType)]; + return longerAltIdxArr; } - } - if (!minTime || !maxTime) { - return; - } - if (dayjs(maxTime).diff(dayjs(minTime), "year") > 5) { - log$1.warn( - "The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days." - ); - return; - } - const dateFormat2 = diagObj.db.getDateFormat(); - const excludeRanges = []; - let range2 = null; - let d = dayjs(minTime); - while (d.valueOf() <= maxTime) { - if (diagObj.db.isInvalidDate(d, dateFormat2, excludes2, includes2)) { - if (!range2) { - range2 = { - start: d, - end: d - }; + }); + patternIdxToPushMode = map_default(onlyRelevantTypes, (clazz) => clazz.PUSH_MODE); + patternIdxToPopMode = map_default(onlyRelevantTypes, (clazz) => has_default(clazz, "POP_MODE")); + }); + let patternIdxToCanLineTerminator; + tracer("Line Terminator Handling", () => { + const lineTerminatorCharCodes = getCharCodes(options3.lineTerminatorCharacters); + patternIdxToCanLineTerminator = map_default(onlyRelevantTypes, (tokType) => false); + if (options3.positionTracking !== "onlyOffset") { + patternIdxToCanLineTerminator = map_default(onlyRelevantTypes, (tokType) => { + if (has_default(tokType, "LINE_BREAKS")) { + return !!tokType.LINE_BREAKS; } else { - range2.end = d; - } - } else { - if (range2) { - excludeRanges.push(range2); - range2 = null; - } - } - d = d.add(1, "d"); - } - const rectangles = svg2.append("g").selectAll("rect").data(excludeRanges).enter(); - rectangles.append("rect").attr("id", function(d2) { - return "exclude-" + d2.start.format("YYYY-MM-DD"); - }).attr("x", function(d2) { - return timeScale(d2.start) + theSidePad; - }).attr("y", conf2.gridLineStartPadding).attr("width", function(d2) { - const renderEnd = d2.end.add(1, "day"); - return timeScale(renderEnd) - timeScale(d2.start); - }).attr("height", h2 - theTopPad - conf2.gridLineStartPadding).attr("transform-origin", function(d2, i2) { - return (timeScale(d2.start) + theSidePad + 0.5 * (timeScale(d2.end) - timeScale(d2.start))).toString() + "px " + (i2 * theGap + 0.5 * h2).toString() + "px"; - }).attr("class", "exclude-range"); - } - function makeGrid(theSidePad, theTopPad, w2, h2) { - let bottomXAxis = axisBottom(timeScale).tickSize(-h2 + theTopPad + conf2.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf2.axisFormat || "%Y-%m-%d")); - const reTickInterval = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/; - const resultTickInterval = reTickInterval.exec( - diagObj.db.getTickInterval() || conf2.tickInterval - ); - if (resultTickInterval !== null) { - const every = resultTickInterval[1]; - const interval2 = resultTickInterval[2]; - const weekday2 = diagObj.db.getWeekday() || conf2.weekday; - switch (interval2) { - case "millisecond": - bottomXAxis.ticks(millisecond.every(every)); - break; - case "second": - bottomXAxis.ticks(second.every(every)); - break; - case "minute": - bottomXAxis.ticks(timeMinute.every(every)); - break; - case "hour": - bottomXAxis.ticks(timeHour.every(every)); - break; - case "day": - bottomXAxis.ticks(timeDay.every(every)); - break; - case "week": - bottomXAxis.ticks(mapWeekdayToTimeFunction[weekday2].every(every)); - break; - case "month": - bottomXAxis.ticks(timeMonth.every(every)); - break; - } - } - svg2.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + (h2 - 50) + ")").call(bottomXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"); - if (diagObj.db.topAxisEnabled() || conf2.topAxis) { - let topXAxis = axisTop(timeScale).tickSize(-h2 + theTopPad + conf2.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf2.axisFormat || "%Y-%m-%d")); - if (resultTickInterval !== null) { - const every = resultTickInterval[1]; - const interval2 = resultTickInterval[2]; - const weekday2 = diagObj.db.getWeekday() || conf2.weekday; - switch (interval2) { - case "millisecond": - topXAxis.ticks(millisecond.every(every)); - break; - case "second": - topXAxis.ticks(second.every(every)); - break; - case "minute": - topXAxis.ticks(timeMinute.every(every)); - break; - case "hour": - topXAxis.ticks(timeHour.every(every)); - break; - case "day": - topXAxis.ticks(timeDay.every(every)); - break; - case "week": - topXAxis.ticks(mapWeekdayToTimeFunction[weekday2].every(every)); - break; - case "month": - topXAxis.ticks(timeMonth.every(every)); - break; + return checkLineBreaksIssues(tokType, lineTerminatorCharCodes) === false && canMatchCharCode(lineTerminatorCharCodes, tokType.PATTERN); } - } - svg2.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + theTopPad + ")").call(topXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10); + }); } - } - function vertLabels(theGap, theTopPad) { - let prevGap = 0; - const numOccurrences = Object.keys(categoryHeights).map((d) => [d, categoryHeights[d]]); - svg2.append("g").selectAll("text").data(numOccurrences).enter().append(function(d) { - const rows = d[0].split(common$1.lineBreakRegex); - const dy = -(rows.length - 1) / 2; - const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text"); - svgLabel.setAttribute("dy", dy + "em"); - for (const [j, row] of rows.entries()) { - const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan"); - tspan.setAttribute("alignment-baseline", "central"); - tspan.setAttribute("x", "10"); - if (j > 0) { - tspan.setAttribute("dy", "1em"); - } - tspan.textContent = row; - svgLabel.appendChild(tspan); - } - return svgLabel; - }).attr("x", 10).attr("y", function(d, i2) { - if (i2 > 0) { - for (let j = 0; j < i2; j++) { - prevGap += numOccurrences[i2 - 1][1]; - return d[1] * theGap / 2 + prevGap * theGap + theTopPad; - } - } else { - return d[1] * theGap / 2 + theTopPad; + }); + let patternIdxToIsCustom; + let patternIdxToShort; + let emptyGroups; + let patternIdxToConfig; + tracer("Misc Mapping #2", () => { + patternIdxToIsCustom = map_default(onlyRelevantTypes, isCustomPattern); + patternIdxToShort = map_default(allTransformedPatterns, isShortPattern); + emptyGroups = reduce_default(onlyRelevantTypes, (acc, clazz) => { + const groupName = clazz.GROUP; + if (isString_default(groupName) && !(groupName === Lexer2.SKIPPED)) { + acc[groupName] = []; } - }).attr("font-size", conf2.sectionFontSize).attr("class", function(d) { - for (const [i2, category] of categories.entries()) { - if (d[0] === category) { - return "sectionTitle sectionTitle" + i2 % conf2.numberSectionStyles; + return acc; + }, {}); + patternIdxToConfig = map_default(allTransformedPatterns, (x5, idx) => { + return { + pattern: allTransformedPatterns[idx], + longerAlt: patternIdxToLongerAltIdxArr[idx], + canLineTerminator: patternIdxToCanLineTerminator[idx], + isCustom: patternIdxToIsCustom[idx], + short: patternIdxToShort[idx], + group: patternIdxToGroup[idx], + push: patternIdxToPushMode[idx], + pop: patternIdxToPopMode[idx], + tokenTypeIdx: patternIdxToType[idx], + tokenType: onlyRelevantTypes[idx] + }; + }); + }); + let canBeOptimized = true; + let charCodeToPatternIdxToConfig = []; + if (!options3.safeMode) { + tracer("First Char Optimization", () => { + charCodeToPatternIdxToConfig = reduce_default(onlyRelevantTypes, (result, currTokType, idx) => { + if (typeof currTokType.PATTERN === "string") { + const charCode = currTokType.PATTERN.charCodeAt(0); + const optimizedIdx = charCodeToOptimizedIndex(charCode); + addToMapOfArrays(result, optimizedIdx, patternIdxToConfig[idx]); + } else if (isArray_default(currTokType.START_CHARS_HINT)) { + let lastOptimizedIdx; + forEach_default(currTokType.START_CHARS_HINT, (charOrInt) => { + const charCode = typeof charOrInt === "string" ? charOrInt.charCodeAt(0) : charOrInt; + const currOptimizedIdx = charCodeToOptimizedIndex(charCode); + if (lastOptimizedIdx !== currOptimizedIdx) { + lastOptimizedIdx = currOptimizedIdx; + addToMapOfArrays(result, currOptimizedIdx, patternIdxToConfig[idx]); + } + }); + } else if (isRegExp_default(currTokType.PATTERN)) { + if (currTokType.PATTERN.unicode) { + canBeOptimized = false; + if (options3.ensureOptimizations) { + PRINT_ERROR(`${failedOptimizationPrefixMsg} Unable to analyze < ${currTokType.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`); + } + } else { + const optimizedCodes = getOptimizedStartCodesIndices(currTokType.PATTERN, options3.ensureOptimizations); + if (isEmpty_default(optimizedCodes)) { + canBeOptimized = false; + } + forEach_default(optimizedCodes, (code) => { + addToMapOfArrays(result, code, patternIdxToConfig[idx]); + }); + } + } else { + if (options3.ensureOptimizations) { + PRINT_ERROR(`${failedOptimizationPrefixMsg} TokenType: <${currTokType.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`); + } + canBeOptimized = false; } - } - return "sectionTitle"; + return result; + }, []); }); } - function drawToday(theSidePad, theTopPad, w2, h2) { - const todayMarker2 = diagObj.db.getTodayMarker(); - if (todayMarker2 === "off") { - return; + return { + emptyGroups, + patternIdxToConfig, + charCodeToPatternIdxToConfig, + hasCustom, + canBeOptimized + }; + } + function validatePatterns(tokenTypes, validModesNames) { + let errors = []; + const missingResult = findMissingPatterns(tokenTypes); + errors = errors.concat(missingResult.errors); + const invalidResult = findInvalidPatterns(missingResult.valid); + const validTokenTypes = invalidResult.valid; + errors = errors.concat(invalidResult.errors); + errors = errors.concat(validateRegExpPattern(validTokenTypes)); + errors = errors.concat(findInvalidGroupType(validTokenTypes)); + errors = errors.concat(findModesThatDoNotExist(validTokenTypes, validModesNames)); + errors = errors.concat(findUnreachablePatterns(validTokenTypes)); + return errors; + } + function validateRegExpPattern(tokenTypes) { + let errors = []; + const withRegExpPatterns = filter_default3(tokenTypes, (currTokType) => isRegExp_default(currTokType[PATTERN])); + errors = errors.concat(findEndOfInputAnchor(withRegExpPatterns)); + errors = errors.concat(findStartOfInputAnchor(withRegExpPatterns)); + errors = errors.concat(findUnsupportedFlags(withRegExpPatterns)); + errors = errors.concat(findDuplicatePatterns(withRegExpPatterns)); + errors = errors.concat(findEmptyMatchRegExps(withRegExpPatterns)); + return errors; + } + function findMissingPatterns(tokenTypes) { + const tokenTypesWithMissingPattern = filter_default3(tokenTypes, (currType) => { + return !has_default(currType, PATTERN); + }); + const errors = map_default(tokenTypesWithMissingPattern, (currType) => { + return { + message: "Token Type: ->" + currType.name + "<- missing static 'PATTERN' property", + type: LexerDefinitionErrorType.MISSING_PATTERN, + tokenTypes: [currType] + }; + }); + const valid2 = difference_default(tokenTypes, tokenTypesWithMissingPattern); + return { errors, valid: valid2 }; + } + function findInvalidPatterns(tokenTypes) { + const tokenTypesWithInvalidPattern = filter_default3(tokenTypes, (currType) => { + const pattern = currType[PATTERN]; + return !isRegExp_default(pattern) && !isFunction_default(pattern) && !has_default(pattern, "exec") && !isString_default(pattern); + }); + const errors = map_default(tokenTypesWithInvalidPattern, (currType) => { + return { + message: "Token Type: ->" + currType.name + "<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.", + type: LexerDefinitionErrorType.INVALID_PATTERN, + tokenTypes: [currType] + }; + }); + const valid2 = difference_default(tokenTypes, tokenTypesWithInvalidPattern); + return { errors, valid: valid2 }; + } + function findEndOfInputAnchor(tokenTypes) { + class EndAnchorFinder extends BaseRegExpVisitor { + static { + __name(this, "EndAnchorFinder"); } - const todayG = svg2.append("g").attr("class", "today"); - const today = /* @__PURE__ */ new Date(); - const todayLine = todayG.append("line"); - todayLine.attr("x1", timeScale(today) + theSidePad).attr("x2", timeScale(today) + theSidePad).attr("y1", conf2.titleTopMargin).attr("y2", h2 - conf2.titleTopMargin).attr("class", "today"); - if (todayMarker2 !== "") { - todayLine.attr("style", todayMarker2.replace(/,/g, ";")); + constructor() { + super(...arguments); + this.found = false; } - } - function checkUnique(arr) { - const hash = {}; - const result = []; - for (let i2 = 0, l = arr.length; i2 < l; ++i2) { - if (!Object.prototype.hasOwnProperty.call(hash, arr[i2])) { - hash[arr[i2]] = true; - result.push(arr[i2]); - } + visitEndAnchor(node2) { + this.found = true; } - return result; } - }; - const ganttRenderer = { - setConf: setConf$5, - draw: draw$g - }; - const getStyles$a = (options2) => ` - .mermaid-main-font { - font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); + const invalidRegex = filter_default3(tokenTypes, (currType) => { + const pattern = currType.PATTERN; + try { + const regexpAst = getRegExpAst(pattern); + const endAnchorVisitor = new EndAnchorFinder(); + endAnchorVisitor.visit(regexpAst); + return endAnchorVisitor.found; + } catch (e3) { + return end_of_input.test(pattern.source); + } + }); + const errors = map_default(invalidRegex, (currType) => { + return { + message: "Unexpected RegExp Anchor Error:\n Token Type: ->" + currType.name + "<- static 'PATTERN' cannot contain end of input anchor '$'\n See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.", + type: LexerDefinitionErrorType.EOI_ANCHOR_FOUND, + tokenTypes: [currType] + }; + }); + return errors; } - - .exclude-range { - fill: ${options2.excludeBkgColor}; + function findEmptyMatchRegExps(tokenTypes) { + const matchesEmptyString = filter_default3(tokenTypes, (currType) => { + const pattern = currType.PATTERN; + return pattern.test(""); + }); + const errors = map_default(matchesEmptyString, (currType) => { + return { + message: "Token Type: ->" + currType.name + "<- static 'PATTERN' must not match an empty string", + type: LexerDefinitionErrorType.EMPTY_MATCH_PATTERN, + tokenTypes: [currType] + }; + }); + return errors; } - - .section { - stroke: none; - opacity: 0.2; + function findStartOfInputAnchor(tokenTypes) { + class StartAnchorFinder extends BaseRegExpVisitor { + static { + __name(this, "StartAnchorFinder"); + } + constructor() { + super(...arguments); + this.found = false; + } + visitStartAnchor(node2) { + this.found = true; + } + } + const invalidRegex = filter_default3(tokenTypes, (currType) => { + const pattern = currType.PATTERN; + try { + const regexpAst = getRegExpAst(pattern); + const startAnchorVisitor = new StartAnchorFinder(); + startAnchorVisitor.visit(regexpAst); + return startAnchorVisitor.found; + } catch (e3) { + return start_of_input.test(pattern.source); + } + }); + const errors = map_default(invalidRegex, (currType) => { + return { + message: "Unexpected RegExp Anchor Error:\n Token Type: ->" + currType.name + "<- static 'PATTERN' cannot contain start of input anchor '^'\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.", + type: LexerDefinitionErrorType.SOI_ANCHOR_FOUND, + tokenTypes: [currType] + }; + }); + return errors; } - - .section0 { - fill: ${options2.sectionBkgColor}; + function findUnsupportedFlags(tokenTypes) { + const invalidFlags = filter_default3(tokenTypes, (currType) => { + const pattern = currType[PATTERN]; + return pattern instanceof RegExp && (pattern.multiline || pattern.global); + }); + const errors = map_default(invalidFlags, (currType) => { + return { + message: "Token Type: ->" + currType.name + "<- static 'PATTERN' may NOT contain global('g') or multiline('m')", + type: LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND, + tokenTypes: [currType] + }; + }); + return errors; + } + function findDuplicatePatterns(tokenTypes) { + const found = []; + let identicalPatterns = map_default(tokenTypes, (outerType) => { + return reduce_default(tokenTypes, (result, innerType) => { + if (outerType.PATTERN.source === innerType.PATTERN.source && !includes_default(found, innerType) && innerType.PATTERN !== Lexer2.NA) { + found.push(innerType); + result.push(innerType); + return result; + } + return result; + }, []); + }); + identicalPatterns = compact_default(identicalPatterns); + const duplicatePatterns = filter_default3(identicalPatterns, (currIdenticalSet) => { + return currIdenticalSet.length > 1; + }); + const errors = map_default(duplicatePatterns, (setOfIdentical) => { + const tokenTypeNames = map_default(setOfIdentical, (currType) => { + return currType.name; + }); + const dupPatternSrc = head_default(setOfIdentical).PATTERN; + return { + message: `The same RegExp pattern ->${dupPatternSrc}<-has been used in all of the following Token Types: ${tokenTypeNames.join(", ")} <-`, + type: LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND, + tokenTypes: setOfIdentical + }; + }); + return errors; } - - .section2 { - fill: ${options2.sectionBkgColor2}; + function findInvalidGroupType(tokenTypes) { + const invalidTypes = filter_default3(tokenTypes, (clazz) => { + if (!has_default(clazz, "GROUP")) { + return false; + } + const group2 = clazz.GROUP; + return group2 !== Lexer2.SKIPPED && group2 !== Lexer2.NA && !isString_default(group2); + }); + const errors = map_default(invalidTypes, (currType) => { + return { + message: "Token Type: ->" + currType.name + "<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String", + type: LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND, + tokenTypes: [currType] + }; + }); + return errors; } - - .section1, - .section3 { - fill: ${options2.altSectionBkgColor}; - opacity: 0.2; + function findModesThatDoNotExist(tokenTypes, validModes) { + const invalidModes = filter_default3(tokenTypes, (clazz) => { + return clazz.PUSH_MODE !== void 0 && !includes_default(validModes, clazz.PUSH_MODE); + }); + const errors = map_default(invalidModes, (tokType) => { + const msg = `Token Type: ->${tokType.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${tokType.PUSH_MODE}<-which does not exist`; + return { + message: msg, + type: LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST, + tokenTypes: [tokType] + }; + }); + return errors; } - - .sectionTitle0 { - fill: ${options2.titleColor}; + function findUnreachablePatterns(tokenTypes) { + const errors = []; + const canBeTested = reduce_default(tokenTypes, (result, tokType, idx) => { + const pattern = tokType.PATTERN; + if (pattern === Lexer2.NA) { + return result; + } + if (isString_default(pattern)) { + result.push({ str: pattern, idx, tokenType: tokType }); + } else if (isRegExp_default(pattern) && noMetaChar(pattern)) { + result.push({ str: pattern.source, idx, tokenType: tokType }); + } + return result; + }, []); + forEach_default(tokenTypes, (tokType, testIdx) => { + forEach_default(canBeTested, ({ str: str2, idx, tokenType }) => { + if (testIdx < idx && testTokenType(str2, tokType.PATTERN)) { + const msg = `Token: ->${tokenType.name}<- can never be matched. +Because it appears AFTER the Token Type ->${tokType.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`; + errors.push({ + message: msg, + type: LexerDefinitionErrorType.UNREACHABLE_PATTERN, + tokenTypes: [tokType, tokenType] + }); + } + }); + }); + return errors; + } + function testTokenType(str2, pattern) { + if (isRegExp_default(pattern)) { + const regExpArray = pattern.exec(str2); + return regExpArray !== null && regExpArray.index === 0; + } else if (isFunction_default(pattern)) { + return pattern(str2, 0, [], {}); + } else if (has_default(pattern, "exec")) { + return pattern.exec(str2, 0, [], {}); + } else if (typeof pattern === "string") { + return pattern === str2; + } else { + throw Error("non exhaustive match"); + } + } + function noMetaChar(regExp) { + const metaChars = [ + ".", + "\\", + "[", + "]", + "|", + "^", + "$", + "(", + ")", + "?", + "*", + "+", + "{" + ]; + return find_default(metaChars, (char2) => regExp.source.indexOf(char2) !== -1) === void 0; } - - .sectionTitle1 { - fill: ${options2.titleColor}; + function addStartOfInput(pattern) { + const flags = pattern.ignoreCase ? "i" : ""; + return new RegExp(`^(?:${pattern.source})`, flags); } - - .sectionTitle2 { - fill: ${options2.titleColor}; + function addStickyFlag(pattern) { + const flags = pattern.ignoreCase ? "iy" : "y"; + return new RegExp(`${pattern.source}`, flags); } - - .sectionTitle3 { - fill: ${options2.titleColor}; - } - - .sectionTitle { - text-anchor: start; - font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); - } - - - /* Grid and axis */ - - .grid .tick { - stroke: ${options2.gridColor}; - opacity: 0.8; - shape-rendering: crispEdges; - } - - .grid .tick text { - font-family: ${options2.fontFamily}; - fill: ${options2.textColor}; - } - - .grid path { - stroke-width: 0; - } - - - /* Today line */ - - .today { - fill: none; - stroke: ${options2.todayLineColor}; - stroke-width: 2px; - } - - - /* Task styling */ - - /* Default task */ - - .task { - stroke-width: 2; - } - - .taskText { - text-anchor: middle; - font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); - } - - .taskTextOutsideRight { - fill: ${options2.taskTextDarkColor}; - text-anchor: start; - font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); - } - - .taskTextOutsideLeft { - fill: ${options2.taskTextDarkColor}; - text-anchor: end; - } - - - /* Special case clickable */ - - .task.clickable { - cursor: pointer; - } - - .taskText.clickable { - cursor: pointer; - fill: ${options2.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideLeft.clickable { - cursor: pointer; - fill: ${options2.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideRight.clickable { - cursor: pointer; - fill: ${options2.taskTextClickableColor} !important; - font-weight: bold; - } - - - /* Specific task settings for the sections*/ - - .taskText0, - .taskText1, - .taskText2, - .taskText3 { - fill: ${options2.taskTextColor}; + function performRuntimeChecks(lexerDefinition, trackLines, lineTerminatorCharacters) { + const errors = []; + if (!has_default(lexerDefinition, DEFAULT_MODE)) { + errors.push({ + message: "A MultiMode Lexer cannot be initialized without a <" + DEFAULT_MODE + "> property in its definition\n", + type: LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE + }); + } + if (!has_default(lexerDefinition, MODES)) { + errors.push({ + message: "A MultiMode Lexer cannot be initialized without a <" + MODES + "> property in its definition\n", + type: LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY + }); + } + if (has_default(lexerDefinition, MODES) && has_default(lexerDefinition, DEFAULT_MODE) && !has_default(lexerDefinition.modes, lexerDefinition.defaultMode)) { + errors.push({ + message: `A MultiMode Lexer cannot be initialized with a ${DEFAULT_MODE}: <${lexerDefinition.defaultMode}>which does not exist +`, + type: LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST + }); + } + if (has_default(lexerDefinition, MODES)) { + forEach_default(lexerDefinition.modes, (currModeValue, currModeName) => { + forEach_default(currModeValue, (currTokType, currIdx) => { + if (isUndefined_default(currTokType)) { + errors.push({ + message: `A Lexer cannot be initialized using an undefined Token Type. Mode:<${currModeName}> at index: <${currIdx}> +`, + type: LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED + }); + } else if (has_default(currTokType, "LONGER_ALT")) { + const longerAlt = isArray_default(currTokType.LONGER_ALT) ? currTokType.LONGER_ALT : [currTokType.LONGER_ALT]; + forEach_default(longerAlt, (currLongerAlt) => { + if (!isUndefined_default(currLongerAlt) && !includes_default(currModeValue, currLongerAlt)) { + errors.push({ + message: `A MultiMode Lexer cannot be initialized with a longer_alt <${currLongerAlt.name}> on token <${currTokType.name}> outside of mode <${currModeName}> +`, + type: LexerDefinitionErrorType.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE + }); + } + }); + } + }); + }); + } + return errors; + } + function performWarningRuntimeChecks(lexerDefinition, trackLines, lineTerminatorCharacters) { + const warnings3 = []; + let hasAnyLineBreak = false; + const allTokenTypes = compact_default(flatten_default(values_default(lexerDefinition.modes))); + const concreteTokenTypes = reject_default(allTokenTypes, (currType) => currType[PATTERN] === Lexer2.NA); + const terminatorCharCodes = getCharCodes(lineTerminatorCharacters); + if (trackLines) { + forEach_default(concreteTokenTypes, (tokType) => { + const currIssue = checkLineBreaksIssues(tokType, terminatorCharCodes); + if (currIssue !== false) { + const message = buildLineBreakIssueMessage(tokType, currIssue); + const warningDescriptor = { + message, + type: currIssue.issue, + tokenType: tokType + }; + warnings3.push(warningDescriptor); + } else { + if (has_default(tokType, "LINE_BREAKS")) { + if (tokType.LINE_BREAKS === true) { + hasAnyLineBreak = true; + } + } else { + if (canMatchCharCode(terminatorCharCodes, tokType.PATTERN)) { + hasAnyLineBreak = true; + } + } + } + }); + } + if (trackLines && !hasAnyLineBreak) { + warnings3.push({ + message: "Warning: No LINE_BREAKS Found.\n This Lexer has been defined to track line and column information,\n But none of the Token Types can be identified as matching a line terminator.\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n for details.", + type: LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS + }); + } + return warnings3; } - - .task0, - .task1, - .task2, - .task3 { - fill: ${options2.taskBkgColor}; - stroke: ${options2.taskBorderColor}; + function cloneEmptyGroups(emptyGroups) { + const clonedResult = {}; + const groupKeys = keys_default(emptyGroups); + forEach_default(groupKeys, (currKey) => { + const currGroupValue = emptyGroups[currKey]; + if (isArray_default(currGroupValue)) { + clonedResult[currKey] = []; + } else { + throw Error("non exhaustive match"); + } + }); + return clonedResult; } - - .taskTextOutside0, - .taskTextOutside2 - { - fill: ${options2.taskTextOutsideColor}; + function isCustomPattern(tokenType) { + const pattern = tokenType.PATTERN; + if (isRegExp_default(pattern)) { + return false; + } else if (isFunction_default(pattern)) { + return true; + } else if (has_default(pattern, "exec")) { + return true; + } else if (isString_default(pattern)) { + return false; + } else { + throw Error("non exhaustive match"); + } } - - .taskTextOutside1, - .taskTextOutside3 { - fill: ${options2.taskTextOutsideColor}; + function isShortPattern(pattern) { + if (isString_default(pattern) && pattern.length === 1) { + return pattern.charCodeAt(0); + } else { + return false; + } } - - - /* Active task */ - - .active0, - .active1, - .active2, - .active3 { - fill: ${options2.activeTaskBkgColor}; - stroke: ${options2.activeTaskBorderColor}; + function checkLineBreaksIssues(tokType, lineTerminatorCharCodes) { + if (has_default(tokType, "LINE_BREAKS")) { + return false; + } else { + if (isRegExp_default(tokType.PATTERN)) { + try { + canMatchCharCode(lineTerminatorCharCodes, tokType.PATTERN); + } catch (e3) { + return { + issue: LexerDefinitionErrorType.IDENTIFY_TERMINATOR, + errMsg: e3.message + }; + } + return false; + } else if (isString_default(tokType.PATTERN)) { + return false; + } else if (isCustomPattern(tokType)) { + return { issue: LexerDefinitionErrorType.CUSTOM_LINE_BREAK }; + } else { + throw Error("non exhaustive match"); + } + } } - - .activeText0, - .activeText1, - .activeText2, - .activeText3 { - fill: ${options2.taskTextDarkColor} !important; + function buildLineBreakIssueMessage(tokType, details) { + if (details.issue === LexerDefinitionErrorType.IDENTIFY_TERMINATOR) { + return `Warning: unable to identify line terminator usage in pattern. + The problem is in the <${tokType.name}> Token Type + Root cause: ${details.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`; + } else if (details.issue === LexerDefinitionErrorType.CUSTOM_LINE_BREAK) { + return `Warning: A Custom Token Pattern should specify the option. + The problem is in the <${tokType.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`; + } else { + throw Error("non exhaustive match"); + } } - - - /* Completed task */ - - .done0, - .done1, - .done2, - .done3 { - stroke: ${options2.doneTaskBorderColor}; - fill: ${options2.doneTaskBkgColor}; - stroke-width: 2; + function getCharCodes(charsOrCodes) { + const charCodes = map_default(charsOrCodes, (numOrString) => { + if (isString_default(numOrString)) { + return numOrString.charCodeAt(0); + } else { + return numOrString; + } + }); + return charCodes; } + function addToMapOfArrays(map5, key, value2) { + if (map5[key] === void 0) { + map5[key] = [value2]; + } else { + map5[key].push(value2); + } + } + function charCodeToOptimizedIndex(charCode) { + return charCode < minOptimizationVal ? charCode : charCodeToOptimizedIdxMap[charCode]; + } + function initCharCodeToOptimizedIndexMap() { + if (isEmpty_default(charCodeToOptimizedIdxMap)) { + charCodeToOptimizedIdxMap = new Array(65536); + for (let i2 = 0; i2 < 65536; i2++) { + charCodeToOptimizedIdxMap[i2] = i2 > 255 ? 255 + ~~(i2 / 255) : i2; + } + } + } + var PATTERN, DEFAULT_MODE, MODES, SUPPORT_STICKY, end_of_input, start_of_input, LineTerminatorOptimizedTester, minOptimizationVal, charCodeToOptimizedIdxMap; + var init_lexer = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/lexer.js"() { + "use strict"; + init_api(); + init_lexer_public(); + init_lodash(); + init_api2(); + init_reg_exp(); + init_reg_exp_parser(); + PATTERN = "PATTERN"; + DEFAULT_MODE = "defaultMode"; + MODES = "modes"; + SUPPORT_STICKY = typeof new RegExp("(?:)").sticky === "boolean"; + __name(analyzeTokenTypes, "analyzeTokenTypes"); + __name(validatePatterns, "validatePatterns"); + __name(validateRegExpPattern, "validateRegExpPattern"); + __name(findMissingPatterns, "findMissingPatterns"); + __name(findInvalidPatterns, "findInvalidPatterns"); + end_of_input = /[^\\][$]/; + __name(findEndOfInputAnchor, "findEndOfInputAnchor"); + __name(findEmptyMatchRegExps, "findEmptyMatchRegExps"); + start_of_input = /[^\\[][\^]|^\^/; + __name(findStartOfInputAnchor, "findStartOfInputAnchor"); + __name(findUnsupportedFlags, "findUnsupportedFlags"); + __name(findDuplicatePatterns, "findDuplicatePatterns"); + __name(findInvalidGroupType, "findInvalidGroupType"); + __name(findModesThatDoNotExist, "findModesThatDoNotExist"); + __name(findUnreachablePatterns, "findUnreachablePatterns"); + __name(testTokenType, "testTokenType"); + __name(noMetaChar, "noMetaChar"); + __name(addStartOfInput, "addStartOfInput"); + __name(addStickyFlag, "addStickyFlag"); + __name(performRuntimeChecks, "performRuntimeChecks"); + __name(performWarningRuntimeChecks, "performWarningRuntimeChecks"); + __name(cloneEmptyGroups, "cloneEmptyGroups"); + __name(isCustomPattern, "isCustomPattern"); + __name(isShortPattern, "isShortPattern"); + LineTerminatorOptimizedTester = { + // implements /\n|\r\n?/g.test + test: /* @__PURE__ */ __name(function(text2) { + const len = text2.length; + for (let i2 = this.lastIndex; i2 < len; i2++) { + const c3 = text2.charCodeAt(i2); + if (c3 === 10) { + this.lastIndex = i2 + 1; + return true; + } else if (c3 === 13) { + if (text2.charCodeAt(i2 + 1) === 10) { + this.lastIndex = i2 + 2; + } else { + this.lastIndex = i2 + 1; + } + return true; + } + } + return false; + }, "test"), + lastIndex: 0 + }; + __name(checkLineBreaksIssues, "checkLineBreaksIssues"); + __name(buildLineBreakIssueMessage, "buildLineBreakIssueMessage"); + __name(getCharCodes, "getCharCodes"); + __name(addToMapOfArrays, "addToMapOfArrays"); + minOptimizationVal = 256; + charCodeToOptimizedIdxMap = []; + __name(charCodeToOptimizedIndex, "charCodeToOptimizedIndex"); + __name(initCharCodeToOptimizedIndexMap, "initCharCodeToOptimizedIndexMap"); + } + }); - .doneText0, - .doneText1, - .doneText2, - .doneText3 { - fill: ${options2.taskTextDarkColor} !important; + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/tokens.js + function tokenStructuredMatcher(tokInstance, tokConstructor) { + const instanceType = tokInstance.tokenTypeIdx; + if (instanceType === tokConstructor.tokenTypeIdx) { + return true; + } else { + return tokConstructor.isParent === true && tokConstructor.categoryMatchesMap[instanceType] === true; + } } - - - /* Tasks on the critical line */ - - .crit0, - .crit1, - .crit2, - .crit3 { - stroke: ${options2.critBorderColor}; - fill: ${options2.critBkgColor}; - stroke-width: 2; + function tokenStructuredMatcherNoCategories(token2, tokType) { + return token2.tokenTypeIdx === tokType.tokenTypeIdx; } - - .activeCrit0, - .activeCrit1, - .activeCrit2, - .activeCrit3 { - stroke: ${options2.critBorderColor}; - fill: ${options2.activeTaskBkgColor}; - stroke-width: 2; + function augmentTokenTypes(tokenTypes) { + const tokenTypesAndParents = expandCategories(tokenTypes); + assignTokenDefaultProps(tokenTypesAndParents); + assignCategoriesMapProp(tokenTypesAndParents); + assignCategoriesTokensProp(tokenTypesAndParents); + forEach_default(tokenTypesAndParents, (tokType) => { + tokType.isParent = tokType.categoryMatches.length > 0; + }); } - - .doneCrit0, - .doneCrit1, - .doneCrit2, - .doneCrit3 { - stroke: ${options2.critBorderColor}; - fill: ${options2.doneTaskBkgColor}; - stroke-width: 2; - cursor: pointer; - shape-rendering: crispEdges; + function expandCategories(tokenTypes) { + let result = clone_default2(tokenTypes); + let categories = tokenTypes; + let searching = true; + while (searching) { + categories = compact_default(flatten_default(map_default(categories, (currTokType) => currTokType.CATEGORIES))); + const newCategories = difference_default(categories, result); + result = result.concat(newCategories); + if (isEmpty_default(newCategories)) { + searching = false; + } else { + categories = newCategories; + } + } + return result; } - - .milestone { - transform: rotate(45deg) scale(0.8,0.8); + function assignTokenDefaultProps(tokenTypes) { + forEach_default(tokenTypes, (currTokType) => { + if (!hasShortKeyProperty(currTokType)) { + tokenIdxToClass[tokenShortNameIdx] = currTokType; + currTokType.tokenTypeIdx = tokenShortNameIdx++; + } + if (hasCategoriesProperty(currTokType) && !isArray_default(currTokType.CATEGORIES)) { + currTokType.CATEGORIES = [currTokType.CATEGORIES]; + } + if (!hasCategoriesProperty(currTokType)) { + currTokType.CATEGORIES = []; + } + if (!hasExtendingTokensTypesProperty(currTokType)) { + currTokType.categoryMatches = []; + } + if (!hasExtendingTokensTypesMapProperty(currTokType)) { + currTokType.categoryMatchesMap = {}; + } + }); } - - .milestoneText { - font-style: italic; + function assignCategoriesTokensProp(tokenTypes) { + forEach_default(tokenTypes, (currTokType) => { + currTokType.categoryMatches = []; + forEach_default(currTokType.categoryMatchesMap, (val, key) => { + currTokType.categoryMatches.push(tokenIdxToClass[key].tokenTypeIdx); + }); + }); } - .doneCritText0, - .doneCritText1, - .doneCritText2, - .doneCritText3 { - fill: ${options2.taskTextDarkColor} !important; + function assignCategoriesMapProp(tokenTypes) { + forEach_default(tokenTypes, (currTokType) => { + singleAssignCategoriesToksMap([], currTokType); + }); } - - .activeCritText0, - .activeCritText1, - .activeCritText2, - .activeCritText3 { - fill: ${options2.taskTextDarkColor} !important; + function singleAssignCategoriesToksMap(path4, nextNode) { + forEach_default(path4, (pathNode) => { + nextNode.categoryMatchesMap[pathNode.tokenTypeIdx] = true; + }); + forEach_default(nextNode.CATEGORIES, (nextCategory) => { + const newPath = path4.concat(nextNode); + if (!includes_default(newPath, nextCategory)) { + singleAssignCategoriesToksMap(newPath, nextCategory); + } + }); } + function hasShortKeyProperty(tokType) { + return has_default(tokType, "tokenTypeIdx"); + } + function hasCategoriesProperty(tokType) { + return has_default(tokType, "CATEGORIES"); + } + function hasExtendingTokensTypesProperty(tokType) { + return has_default(tokType, "categoryMatches"); + } + function hasExtendingTokensTypesMapProperty(tokType) { + return has_default(tokType, "categoryMatchesMap"); + } + function isTokenType(tokType) { + return has_default(tokType, "tokenTypeIdx"); + } + var tokenShortNameIdx, tokenIdxToClass; + var init_tokens = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/tokens.js"() { + "use strict"; + init_lodash(); + __name(tokenStructuredMatcher, "tokenStructuredMatcher"); + __name(tokenStructuredMatcherNoCategories, "tokenStructuredMatcherNoCategories"); + tokenShortNameIdx = 1; + tokenIdxToClass = {}; + __name(augmentTokenTypes, "augmentTokenTypes"); + __name(expandCategories, "expandCategories"); + __name(assignTokenDefaultProps, "assignTokenDefaultProps"); + __name(assignCategoriesTokensProp, "assignCategoriesTokensProp"); + __name(assignCategoriesMapProp, "assignCategoriesMapProp"); + __name(singleAssignCategoriesToksMap, "singleAssignCategoriesToksMap"); + __name(hasShortKeyProperty, "hasShortKeyProperty"); + __name(hasCategoriesProperty, "hasCategoriesProperty"); + __name(hasExtendingTokensTypesProperty, "hasExtendingTokensTypesProperty"); + __name(hasExtendingTokensTypesMapProperty, "hasExtendingTokensTypesMapProperty"); + __name(isTokenType, "isTokenType"); + } + }); - .titleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.titleColor || options2.textColor}; - font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); - } -`; - const ganttStyles = getStyles$a; - const diagram$g = { - parser: ganttParser, - db: ganttDb, - renderer: ganttRenderer, - styles: ganttStyles - }; - const ganttDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$g - }, Symbol.toStringTag, { value: "Module" })); - var parser$o = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [6, 9, 10]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "info": 4, "document": 5, "EOF": 6, "line": 7, "statement": 8, "NL": 9, "showInfo": 10, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "info", 6: "EOF", 9: "NL", 10: "showInfo" }, - productions_: [0, [3, 3], [5, 0], [5, 2], [7, 1], [7, 1], [8, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - $$.length - 1; - switch (yystate) { - case 1: - return yy; - case 4: - break; - case 6: - yy.setInfo(true); - break; - } - }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: 6, 9: [1, 7], 10: [1, 8] }, { 1: [2, 1] }, o($V0, [2, 3]), o($V0, [2, 4]), o($V0, [2, 5]), o($V0, [2, 6])], - defaultActions: { 4: [2, 1] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; - } - return token2; + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js + var defaultLexerErrorProvider; + var init_lexer_errors_public = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js"() { + "use strict"; + defaultLexerErrorProvider = { + buildUnableToPopLexerModeMessage(token2) { + return `Unable to pop Lexer Mode after encountering Token ->${token2.image}<- The Mode Stack is empty`; + }, + buildUnexpectedCharactersMessage(fullText, startOffset, length2, line2, column2) { + return `unexpected character: ->${fullText.charAt(startOffset)}<- at offset: ${startOffset}, skipped ${length2} characters.`; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/lexer_public.js + var LexerDefinitionErrorType, DEFAULT_LEXER_CONFIG, Lexer2; + var init_lexer_public = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/lexer_public.js"() { + "use strict"; + init_lexer(); + init_lodash(); + init_api2(); + init_tokens(); + init_lexer_errors_public(); + init_reg_exp_parser(); + (function(LexerDefinitionErrorType2) { + LexerDefinitionErrorType2[LexerDefinitionErrorType2["MISSING_PATTERN"] = 0] = "MISSING_PATTERN"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["INVALID_PATTERN"] = 1] = "INVALID_PATTERN"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["EOI_ANCHOR_FOUND"] = 2] = "EOI_ANCHOR_FOUND"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["UNSUPPORTED_FLAGS_FOUND"] = 3] = "UNSUPPORTED_FLAGS_FOUND"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["DUPLICATE_PATTERNS_FOUND"] = 4] = "DUPLICATE_PATTERNS_FOUND"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["INVALID_GROUP_TYPE_FOUND"] = 5] = "INVALID_GROUP_TYPE_FOUND"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["PUSH_MODE_DOES_NOT_EXIST"] = 6] = "PUSH_MODE_DOES_NOT_EXIST"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE"] = 7] = "MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY"] = 8] = "MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST"] = 9] = "MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED"] = 10] = "LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["SOI_ANCHOR_FOUND"] = 11] = "SOI_ANCHOR_FOUND"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["EMPTY_MATCH_PATTERN"] = 12] = "EMPTY_MATCH_PATTERN"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["NO_LINE_BREAKS_FLAGS"] = 13] = "NO_LINE_BREAKS_FLAGS"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["UNREACHABLE_PATTERN"] = 14] = "UNREACHABLE_PATTERN"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["IDENTIFY_TERMINATOR"] = 15] = "IDENTIFY_TERMINATOR"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["CUSTOM_LINE_BREAK"] = 16] = "CUSTOM_LINE_BREAK"; + LexerDefinitionErrorType2[LexerDefinitionErrorType2["MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"] = 17] = "MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"; + })(LexerDefinitionErrorType || (LexerDefinitionErrorType = {})); + DEFAULT_LEXER_CONFIG = { + deferDefinitionErrorsHandling: false, + positionTracking: "full", + lineTerminatorsPattern: /\n|\r\n?/g, + lineTerminatorCharacters: ["\n", "\r"], + ensureOptimizations: false, + safeMode: false, + errorMessageProvider: defaultLexerErrorProvider, + traceInitPerf: false, + skipValidations: false, + recoveryEnabled: true + }; + Object.freeze(DEFAULT_LEXER_CONFIG); + Lexer2 = class { + static { + __name(this, "Lexer"); + } + constructor(lexerDefinition, config6 = DEFAULT_LEXER_CONFIG) { + this.lexerDefinition = lexerDefinition; + this.lexerDefinitionErrors = []; + this.lexerDefinitionWarning = []; + this.patternIdxToConfig = {}; + this.charCodeToPatternIdxToConfig = {}; + this.modes = []; + this.emptyGroups = {}; + this.trackStartLines = true; + this.trackEndLines = true; + this.hasCustom = false; + this.canModeBeOptimized = {}; + this.TRACE_INIT = (phaseDesc, phaseImpl) => { + if (this.traceInitPerf === true) { + this.traceInitIndent++; + const indent = new Array(this.traceInitIndent + 1).join(" "); + if (this.traceInitIndent < this.traceInitMaxIdent) { + console.log(`${indent}--> <${phaseDesc}>`); + } + const { time: time4, value: value2 } = timer2(phaseImpl); + const traceMethod = time4 > 10 ? console.warn : console.log; + if (this.traceInitIndent < this.traceInitMaxIdent) { + traceMethod(`${indent}<-- <${phaseDesc}> time: ${time4}ms`); + } + this.traceInitIndent--; + return value2; + } else { + return phaseImpl(); } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); + }; + if (typeof config6 === "boolean") { + throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported"); + } + this.config = assign_default({}, DEFAULT_LEXER_CONFIG, config6); + const traceInitVal = this.config.traceInitPerf; + if (traceInitVal === true) { + this.traceInitMaxIdent = Infinity; + this.traceInitPerf = true; + } else if (typeof traceInitVal === "number") { + this.traceInitMaxIdent = traceInitVal; + this.traceInitPerf = true; + } + this.traceInitIndent = -1; + this.TRACE_INIT("Lexer Constructor", () => { + let actualDefinition; + let hasOnlySingleMode = true; + this.TRACE_INIT("Lexer Config handling", () => { + if (this.config.lineTerminatorsPattern === DEFAULT_LEXER_CONFIG.lineTerminatorsPattern) { + this.config.lineTerminatorsPattern = LineTerminatorOptimizedTester; + } else { + if (this.config.lineTerminatorCharacters === DEFAULT_LEXER_CONFIG.lineTerminatorCharacters) { + throw Error("Error: Missing property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS"); + } + } + if (config6.safeMode && config6.ensureOptimizations) { + throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.'); + } + this.trackStartLines = /full|onlyStart/i.test(this.config.positionTracking); + this.trackEndLines = /full/i.test(this.config.positionTracking); + if (isArray_default(lexerDefinition)) { + actualDefinition = { + modes: { defaultMode: clone_default2(lexerDefinition) }, + defaultMode: DEFAULT_MODE + }; + } else { + hasOnlySingleMode = false; + actualDefinition = clone_default2(lexerDefinition); } + }); + if (this.config.skipValidations === false) { + this.TRACE_INIT("performRuntimeChecks", () => { + this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(performRuntimeChecks(actualDefinition, this.trackStartLines, this.config.lineTerminatorCharacters)); + }); + this.TRACE_INIT("performWarningRuntimeChecks", () => { + this.lexerDefinitionWarning = this.lexerDefinitionWarning.concat(performWarningRuntimeChecks(actualDefinition, this.trackStartLines, this.config.lineTerminatorCharacters)); + }); } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected + actualDefinition.modes = actualDefinition.modes ? actualDefinition.modes : {}; + forEach_default(actualDefinition.modes, (currModeValue, currModeName) => { + actualDefinition.modes[currModeName] = reject_default(currModeValue, (currTokType) => isUndefined_default(currTokType)); }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; + const allModeNames = keys_default(actualDefinition.modes); + forEach_default(actualDefinition.modes, (currModDef, currModName) => { + this.TRACE_INIT(`Mode: <${currModName}> processing`, () => { + this.modes.push(currModName); + if (this.config.skipValidations === false) { + this.TRACE_INIT(`validatePatterns`, () => { + this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(validatePatterns(currModDef, allModeNames)); + }); + } + if (isEmpty_default(this.lexerDefinitionErrors)) { + augmentTokenTypes(currModDef); + let currAnalyzeResult; + this.TRACE_INIT(`analyzeTokenTypes`, () => { + currAnalyzeResult = analyzeTokenTypes(currModDef, { + lineTerminatorCharacters: this.config.lineTerminatorCharacters, + positionTracking: config6.positionTracking, + ensureOptimizations: config6.ensureOptimizations, + safeMode: config6.safeMode, + tracer: this.TRACE_INIT + }); + }); + this.patternIdxToConfig[currModName] = currAnalyzeResult.patternIdxToConfig; + this.charCodeToPatternIdxToConfig[currModName] = currAnalyzeResult.charCodeToPatternIdxToConfig; + this.emptyGroups = assign_default({}, this.emptyGroups, currAnalyzeResult.emptyGroups); + this.hasCustom = currAnalyzeResult.hasCustom || this.hasCustom; + this.canModeBeOptimized[currModName] = currAnalyzeResult.canBeOptimized; + } + }); + }); + this.defaultMode = actualDefinition.defaultMode; + if (!isEmpty_default(this.lexerDefinitionErrors) && !this.config.deferDefinitionErrorsHandling) { + const allErrMessages = map_default(this.lexerDefinitionErrors, (error3) => { + return error3.message; + }); + const allErrMessagesString = allErrMessages.join("-----------------------\n"); + throw new Error("Errors detected in definition of Lexer:\n" + allErrMessagesString); + } + forEach_default(this.lexerDefinitionWarning, (warningDescriptor) => { + PRINT_WARNING(warningDescriptor.message); + }); + this.TRACE_INIT("Choosing sub-methods implementations", () => { + if (SUPPORT_STICKY) { + this.chopInput = identity_default4; + this.match = this.matchWithTest; + } else { + this.updateLastIndex = noop_default2; + this.match = this.matchWithExec; } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; + if (hasOnlySingleMode) { + this.handleModes = noop_default2; } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } + if (this.trackStartLines === false) { + this.computeNewColumn = identity_default4; + } + if (this.trackEndLines === false) { + this.updateTokenEndLineColumnLocation = noop_default2; + } + if (/full/i.test(this.config.positionTracking)) { + this.createTokenInstance = this.createFullToken; + } else if (/onlyStart/i.test(this.config.positionTracking)) { + this.createTokenInstance = this.createStartOnlyToken; + } else if (/onlyOffset/i.test(this.config.positionTracking)) { + this.createTokenInstance = this.createOffsetOnlyToken; + } else { + throw Error(`Invalid config option: "${this.config.positionTracking}"`); + } + if (this.hasCustom) { + this.addToken = this.addTokenUsingPush; + this.handlePayload = this.handlePayloadWithCustom; + } else { + this.addToken = this.addTokenUsingMemberAccess; + this.handlePayload = this.handlePayloadNoCustom; + } + }); + this.TRACE_INIT("Failed Optimization Warnings", () => { + const unOptimizedModes = reduce_default(this.canModeBeOptimized, (cannotBeOptimized, canBeOptimized, modeName) => { + if (canBeOptimized === false) { + cannotBeOptimized.push(modeName); + } + return cannotBeOptimized; + }, []); + if (config6.ensureOptimizations && !isEmpty_default(unOptimizedModes)) { + throw Error(`Lexer Modes: < ${unOptimizedModes.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`); + } + }); + this.TRACE_INIT("clearRegExpParserCache", () => { + clearRegExpParserCache(); + }); + this.TRACE_INIT("toFastProperties", () => { + toFastProperties(this); + }); + }); } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; - } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno + tokenize(text2, initialMode = this.defaultMode) { + if (!isEmpty_default(this.lexerDefinitionErrors)) { + const allErrMessages = map_default(this.lexerDefinitionErrors, (error3) => { + return error3.message; }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; + const allErrMessagesString = allErrMessages.join("-----------------------\n"); + throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n" + allErrMessagesString); + } + return this.tokenizeInternal(text2, initialMode); + } + // There is quite a bit of duplication between this and "tokenizeInternalLazy" + // This is intentional due to performance considerations. + // this method also used quite a bit of `!` none null assertions because it is too optimized + // for `tsc` to always understand it is "safe" + tokenizeInternal(text2, initialMode) { + let i2, j2, k2, matchAltImage, longerAlt, matchedImage, payload, altPayload, imageLength, group2, tokType, newToken, errLength, droppedChar, msg, match2; + const orgText = text2; + const orgLength = orgText.length; + let offset = 0; + let matchedTokensIndex = 0; + const guessedNumberOfTokens = this.hasCustom ? 0 : Math.floor(text2.length / 10); + const matchedTokens = new Array(guessedNumberOfTokens); + const errors = []; + let line2 = this.trackStartLines ? 1 : void 0; + let column2 = this.trackStartLines ? 1 : void 0; + const groups = cloneEmptyGroups(this.emptyGroups); + const trackLines = this.trackStartLines; + const lineTerminatorPattern = this.config.lineTerminatorsPattern; + let currModePatternsLength = 0; + let patternIdxToConfig = []; + let currCharCodeToPatternIdxToConfig = []; + const modeStack = []; + const emptyArray = []; + Object.freeze(emptyArray); + let getPossiblePatterns; + function getPossiblePatternsSlow() { + return patternIdxToConfig; + } + __name(getPossiblePatternsSlow, "getPossiblePatternsSlow"); + function getPossiblePatternsOptimized(charCode) { + const optimizedCharIdx = charCodeToOptimizedIndex(charCode); + const possiblePatterns = currCharCodeToPatternIdxToConfig[optimizedCharIdx]; + if (possiblePatterns === void 0) { + return emptyArray; + } else { + return possiblePatterns; + } + } + __name(getPossiblePatternsOptimized, "getPossiblePatternsOptimized"); + const pop_mode = /* @__PURE__ */ __name((popToken) => { + if (modeStack.length === 1 && // if we have both a POP_MODE and a PUSH_MODE this is in-fact a "transition" + // So no error should occur. + popToken.tokenType.PUSH_MODE === void 0) { + const msg2 = this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(popToken); + errors.push({ + offset: popToken.startOffset, + line: popToken.startLine, + column: popToken.startColumn, + length: popToken.image.length, + message: msg2 + }); + } else { + modeStack.pop(); + const newMode = last_default(modeStack); + patternIdxToConfig = this.patternIdxToConfig[newMode]; + currCharCodeToPatternIdxToConfig = this.charCodeToPatternIdxToConfig[newMode]; + currModePatternsLength = patternIdxToConfig.length; + const modeCanBeOptimized = this.canModeBeOptimized[newMode] && this.config.safeMode === false; + if (currCharCodeToPatternIdxToConfig && modeCanBeOptimized) { + getPossiblePatterns = getPossiblePatternsOptimized; + } else { + getPossiblePatterns = getPossiblePatternsSlow; + } + } + }, "pop_mode"); + function push_mode(newMode) { + modeStack.push(newMode); + currCharCodeToPatternIdxToConfig = this.charCodeToPatternIdxToConfig[newMode]; + patternIdxToConfig = this.patternIdxToConfig[newMode]; + currModePatternsLength = patternIdxToConfig.length; + currModePatternsLength = patternIdxToConfig.length; + const modeCanBeOptimized = this.canModeBeOptimized[newMode] && this.config.safeMode === false; + if (currCharCodeToPatternIdxToConfig && modeCanBeOptimized) { + getPossiblePatterns = getPossiblePatternsOptimized; + } else { + getPossiblePatterns = getPossiblePatternsSlow; + } + } + __name(push_mode, "push_mode"); + push_mode.call(this, initialMode); + let currConfig; + const recoveryEnabled = this.config.recoveryEnabled; + while (offset < orgLength) { + matchedImage = null; + const nextCharCode = orgText.charCodeAt(offset); + const chosenPatternIdxToConfig = getPossiblePatterns(nextCharCode); + const chosenPatternsLength = chosenPatternIdxToConfig.length; + for (i2 = 0; i2 < chosenPatternsLength; i2++) { + currConfig = chosenPatternIdxToConfig[i2]; + const currPattern = currConfig.pattern; + payload = null; + const singleCharCode = currConfig.short; + if (singleCharCode !== false) { + if (nextCharCode === singleCharCode) { + matchedImage = currPattern; + } + } else if (currConfig.isCustom === true) { + match2 = currPattern.exec(orgText, offset, matchedTokens, groups); + if (match2 !== null) { + matchedImage = match2[0]; + if (match2.payload !== void 0) { + payload = match2.payload; + } + } else { + matchedImage = null; + } + } else { + this.updateLastIndex(currPattern, offset); + matchedImage = this.match(currPattern, text2, offset); + } + if (matchedImage !== null) { + longerAlt = currConfig.longerAlt; + if (longerAlt !== void 0) { + const longerAltLength = longerAlt.length; + for (k2 = 0; k2 < longerAltLength; k2++) { + const longerAltConfig = patternIdxToConfig[longerAlt[k2]]; + const longerAltPattern = longerAltConfig.pattern; + altPayload = null; + if (longerAltConfig.isCustom === true) { + match2 = longerAltPattern.exec(orgText, offset, matchedTokens, groups); + if (match2 !== null) { + matchAltImage = match2[0]; + if (match2.payload !== void 0) { + altPayload = match2.payload; + } + } else { + matchAltImage = null; + } + } else { + this.updateLastIndex(longerAltPattern, offset); + matchAltImage = this.match(longerAltPattern, text2, offset); + } + if (matchAltImage && matchAltImage.length > matchedImage.length) { + matchedImage = matchAltImage; + payload = altPayload; + currConfig = longerAltConfig; + break; + } + } + } + break; + } } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; + if (matchedImage !== null) { + imageLength = matchedImage.length; + group2 = currConfig.group; + if (group2 !== void 0) { + tokType = currConfig.tokenTypeIdx; + newToken = this.createTokenInstance(matchedImage, offset, tokType, currConfig.tokenType, line2, column2, imageLength); + this.handlePayload(newToken, payload); + if (group2 === false) { + matchedTokensIndex = this.addToken(matchedTokens, matchedTokensIndex, newToken); } else { - return false; + groups[group2].push(newToken); + } + } + text2 = this.chopInput(text2, imageLength); + offset = offset + imageLength; + column2 = this.computeNewColumn(column2, imageLength); + if (trackLines === true && currConfig.canLineTerminator === true) { + let numOfLTsInMatch = 0; + let foundTerminator; + let lastLTEndOffset; + lineTerminatorPattern.lastIndex = 0; + do { + foundTerminator = lineTerminatorPattern.test(matchedImage); + if (foundTerminator === true) { + lastLTEndOffset = lineTerminatorPattern.lastIndex - 1; + numOfLTsInMatch++; + } + } while (foundTerminator === true); + if (numOfLTsInMatch !== 0) { + line2 = line2 + numOfLTsInMatch; + column2 = imageLength - lastLTEndOffset; + this.updateTokenEndLineColumnLocation(newToken, group2, lastLTEndOffset, numOfLTsInMatch, line2, column2, imageLength); + } + } + this.handleModes(currConfig, pop_mode, push_mode, newToken); + } else { + const errorStartOffset = offset; + const errorLine = line2; + const errorColumn = column2; + let foundResyncPoint = recoveryEnabled === false; + while (foundResyncPoint === false && offset < orgLength) { + text2 = this.chopInput(text2, 1); + offset++; + for (j2 = 0; j2 < currModePatternsLength; j2++) { + const currConfig2 = patternIdxToConfig[j2]; + const currPattern = currConfig2.pattern; + const singleCharCode = currConfig2.short; + if (singleCharCode !== false) { + if (orgText.charCodeAt(offset) === singleCharCode) { + foundResyncPoint = true; + } + } else if (currConfig2.isCustom === true) { + foundResyncPoint = currPattern.exec(orgText, offset, matchedTokens, groups) !== null; + } else { + this.updateLastIndex(currPattern, offset); + foundResyncPoint = currPattern.exec(text2) !== null; + } + if (foundResyncPoint === true) { + break; + } } - } else if (!this.options.flex) { + } + errLength = offset - errorStartOffset; + column2 = this.computeNewColumn(column2, errLength); + msg = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(orgText, errorStartOffset, errLength, errorLine, errorColumn); + errors.push({ + offset: errorStartOffset, + line: errorLine, + column: errorColumn, + length: errLength, + message: msg + }); + if (recoveryEnabled === false) { break; } } } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + if (!this.hasCustom) { + matchedTokens.length = matchedTokensIndex; + } + return { + tokens: matchedTokens, + groups, + errors + }; + } + handleModes(config6, pop_mode, push_mode, newToken) { + if (config6.pop === true) { + const pushMode = config6.push; + pop_mode(newToken); + if (pushMode !== void 0) { + push_mode.call(this, pushMode); } - return false; + } else if (config6.push !== void 0) { + push_mode.call(this, config6.push); } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + } + chopInput(text2, length2) { + return text2.substring(length2); + } + updateLastIndex(regExp, newLastIndex) { + regExp.lastIndex = newLastIndex; + } + // TODO: decrease this under 600 characters? inspect stripping comments option in TSC compiler + updateTokenEndLineColumnLocation(newToken, group2, lastLTIdx, numOfLTsInMatch, line2, column2, imageLength) { + let lastCharIsLT, fixForEndingInLT; + if (group2 !== void 0) { + lastCharIsLT = lastLTIdx === imageLength - 1; + fixForEndingInLT = lastCharIsLT ? -1 : 0; + if (!(numOfLTsInMatch === 1 && lastCharIsLT === true)) { + newToken.endLine = line2 + fixForEndingInLT; + newToken.endColumn = column2 - 1 + -fixForEndingInLT; + } } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + } + computeNewColumn(oldColumn, imageLength) { + return oldColumn + imageLength; + } + createOffsetOnlyToken(image, startOffset, tokenTypeIdx, tokenType) { + return { + image, + startOffset, + tokenTypeIdx, + tokenType + }; + } + createStartOnlyToken(image, startOffset, tokenTypeIdx, tokenType, startLine, startColumn) { + return { + image, + startOffset, + startLine, + startColumn, + tokenTypeIdx, + tokenType + }; + } + createFullToken(image, startOffset, tokenTypeIdx, tokenType, startLine, startColumn, imageLength) { + return { + image, + startOffset, + endOffset: startOffset + imageLength - 1, + startLine, + endLine: startLine, + startColumn, + endColumn: startColumn + imageLength - 1, + tokenTypeIdx, + tokenType + }; + } + addTokenUsingPush(tokenVector, index, tokenToAdd) { + tokenVector.push(tokenToAdd); + return index; + } + addTokenUsingMemberAccess(tokenVector, index, tokenToAdd) { + tokenVector[index] = tokenToAdd; + index++; + return index; + } + handlePayloadNoCustom(token2, payload) { + } + handlePayloadWithCustom(token2, payload) { + if (payload !== null) { + token2.payload = payload; } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + } + matchWithTest(pattern, text2, offset) { + const found = pattern.test(text2); + if (found === true) { + return text2.substring(offset, pattern.lastIndex); } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + return null; + } + matchWithExec(pattern, text2) { + const regExpArray = pattern.exec(text2); + return regExpArray !== null ? regExpArray[0] : null; + } + }; + Lexer2.SKIPPED = "This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace."; + Lexer2.NA = /NOT_APPLICABLE/; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/tokens_public.js + function tokenLabel2(tokType) { + if (hasTokenLabel2(tokType)) { + return tokType.LABEL; + } else { + return tokType.name; + } + } + function hasTokenLabel2(obj) { + return isString_default(obj.LABEL) && obj.LABEL !== ""; + } + function createToken(config6) { + return createTokenInternal(config6); + } + function createTokenInternal(config6) { + const pattern = config6.pattern; + const tokenType = {}; + tokenType.name = config6.name; + if (!isUndefined_default(pattern)) { + tokenType.PATTERN = pattern; + } + if (has_default(config6, PARENT)) { + throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details."; + } + if (has_default(config6, CATEGORIES)) { + tokenType.CATEGORIES = config6[CATEGORIES]; + } + augmentTokenTypes([tokenType]); + if (has_default(config6, LABEL)) { + tokenType.LABEL = config6[LABEL]; + } + if (has_default(config6, GROUP)) { + tokenType.GROUP = config6[GROUP]; + } + if (has_default(config6, POP_MODE)) { + tokenType.POP_MODE = config6[POP_MODE]; + } + if (has_default(config6, PUSH_MODE)) { + tokenType.PUSH_MODE = config6[PUSH_MODE]; + } + if (has_default(config6, LONGER_ALT)) { + tokenType.LONGER_ALT = config6[LONGER_ALT]; + } + if (has_default(config6, LINE_BREAKS)) { + tokenType.LINE_BREAKS = config6[LINE_BREAKS]; + } + if (has_default(config6, START_CHARS_HINT)) { + tokenType.START_CHARS_HINT = config6[START_CHARS_HINT]; + } + return tokenType; + } + function createTokenInstance(tokType, image, startOffset, endOffset, startLine, endLine, startColumn, endColumn) { + return { + image, + startOffset, + endOffset, + startLine, + endLine, + startColumn, + endColumn, + tokenTypeIdx: tokType.tokenTypeIdx, + tokenType: tokType + }; + } + function tokenMatcher(token2, tokType) { + return tokenStructuredMatcher(token2, tokType); + } + var PARENT, CATEGORIES, LABEL, GROUP, PUSH_MODE, POP_MODE, LONGER_ALT, LINE_BREAKS, START_CHARS_HINT, EOF; + var init_tokens_public = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/scan/tokens_public.js"() { + "use strict"; + init_lodash(); + init_lexer_public(); + init_tokens(); + __name(tokenLabel2, "tokenLabel"); + __name(hasTokenLabel2, "hasTokenLabel"); + PARENT = "parent"; + CATEGORIES = "categories"; + LABEL = "label"; + GROUP = "group"; + PUSH_MODE = "push_mode"; + POP_MODE = "pop_mode"; + LONGER_ALT = "longer_alt"; + LINE_BREAKS = "line_breaks"; + START_CHARS_HINT = "start_chars_hint"; + __name(createToken, "createToken"); + __name(createTokenInternal, "createTokenInternal"); + EOF = createToken({ name: "EOF", pattern: Lexer2.NA }); + augmentTokenTypes([EOF]); + __name(createTokenInstance, "createTokenInstance"); + __name(tokenMatcher, "tokenMatcher"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/errors_public.js + var defaultParserErrorProvider, defaultGrammarResolverErrorProvider, defaultGrammarValidatorErrorProvider; + var init_errors_public = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/errors_public.js"() { + "use strict"; + init_tokens_public(); + init_lodash(); + init_api3(); + defaultParserErrorProvider = { + buildMismatchTokenMessage({ expected, actual, previous, ruleName }) { + const hasLabel = hasTokenLabel2(expected); + const expectedMsg = hasLabel ? `--> ${tokenLabel2(expected)} <--` : `token of type --> ${expected.name} <--`; + const msg = `Expecting ${expectedMsg} but found --> '${actual.image}' <--`; + return msg; + }, + buildNotAllInputParsedMessage({ firstRedundant, ruleName }) { + return "Redundant input, expecting EOF but found: " + firstRedundant.image; + }, + buildNoViableAltMessage({ expectedPathsPerAlt, actual, previous, customUserDescription, ruleName }) { + const errPrefix = "Expecting: "; + const actualText = head_default(actual).image; + const errSuffix = "\nbut found: '" + actualText + "'"; + if (customUserDescription) { + return errPrefix + customUserDescription + errSuffix; } else { - return this.conditions["INITIAL"].rules; - } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; + const allLookAheadPaths = reduce_default(expectedPathsPerAlt, (result, currAltPaths) => result.concat(currAltPaths), []); + const nextValidTokenSequences = map_default(allLookAheadPaths, (currPath) => `[${map_default(currPath, (currTokenType) => tokenLabel2(currTokenType)).join(", ")}]`); + const nextValidSequenceItems = map_default(nextValidTokenSequences, (itemMsg, idx) => ` ${idx + 1}. ${itemMsg}`); + const calculatedDescription = `one of these possible Token sequences: +${nextValidSequenceItems.join("\n")}`; + return errPrefix + calculatedDescription + errSuffix; + } + }, + buildEarlyExitMessage({ expectedIterationPaths, actual, customUserDescription, ruleName }) { + const errPrefix = "Expecting: "; + const actualText = head_default(actual).image; + const errSuffix = "\nbut found: '" + actualText + "'"; + if (customUserDescription) { + return errPrefix + customUserDescription + errSuffix; } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - return 4; - case 1: - return 9; - case 2: - return "space"; - case 3: - return 10; - case 4: - return 6; - case 5: - return "TXT"; + const nextValidTokenSequences = map_default(expectedIterationPaths, (currPath) => `[${map_default(currPath, (currTokenType) => tokenLabel2(currTokenType)).join(",")}]`); + const calculatedDescription = `expecting at least one iteration which starts with one of these possible Token sequences:: + <${nextValidTokenSequences.join(" ,")}>`; + return errPrefix + calculatedDescription + errSuffix; } - }, - rules: [/^(?:info\b)/i, /^(?:[\s\n\r]+)/i, /^(?:[\s]+)/i, /^(?:showInfo\b)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$o.parser = parser$o; - const parser$p = parser$o; - const DEFAULT_INFO_DB = { - info: false - }; - let info = DEFAULT_INFO_DB.info; - const setInfo = (toggle) => { - info = toggle; - }; - const getInfo = () => info; - const clear$c = () => { - info = DEFAULT_INFO_DB.info; - }; - const db$e = { - clear: clear$c, - setInfo, - getInfo - }; - const draw$f = (text2, id2, version2) => { - log$1.debug("rendering info diagram\n" + text2); - const svg2 = selectSvgElement(id2); - configureSvgSize(svg2, 100, 400, true); - const group = svg2.append("g"); - group.append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${version2}`); - }; - const renderer$f = { draw: draw$f }; - const diagram$f = { - parser: parser$p, - db: db$e, - renderer: renderer$f - }; - const infoDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$f - }, Symbol.toStringTag, { value: "Module" })); - var parser$m = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [1, 10, 12, 14, 16, 18, 19, 20, 21, 22], $V5 = [2, 4], $V6 = [1, 5, 10, 12, 14, 16, 18, 19, 20, 21, 22], $V7 = [20, 21, 22], $V8 = [2, 7], $V9 = [1, 12], $Va = [1, 13], $Vb = [1, 14], $Vc = [1, 15], $Vd = [1, 16], $Ve = [1, 17]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "eol": 4, "PIE": 5, "document": 6, "showData": 7, "line": 8, "statement": 9, "txt": 10, "value": 11, "title": 12, "title_value": 13, "acc_title": 14, "acc_title_value": 15, "acc_descr": 16, "acc_descr_value": 17, "acc_descr_multiline_value": 18, "section": 19, "NEWLINE": 20, ";": 21, "EOF": 22, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 5: "PIE", 7: "showData", 10: "txt", 11: "value", 12: "title", 13: "title_value", 14: "acc_title", 15: "acc_title_value", 16: "acc_descr", 17: "acc_descr_value", 18: "acc_descr_multiline_value", 19: "section", 20: "NEWLINE", 21: ";", 22: "EOF" }, - productions_: [0, [3, 2], [3, 2], [3, 3], [6, 0], [6, 2], [8, 2], [9, 0], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [4, 1], [4, 1], [4, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 3: - yy.setShowData(true); - break; - case 6: - this.$ = $$[$0 - 1]; - break; - case 8: - yy.addSection($$[$0 - 1], yy.cleanupValue($$[$0])); - break; - case 9: - this.$ = $$[$0].trim(); - yy.setDiagramTitle(this.$); - break; - case 10: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 11: - case 12: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 13: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - } - }, - table: [{ 3: 1, 4: 2, 5: $V0, 20: $V1, 21: $V2, 22: $V3 }, { 1: [3] }, { 3: 7, 4: 2, 5: $V0, 20: $V1, 21: $V2, 22: $V3 }, o($V4, $V5, { 6: 8, 7: [1, 9] }), o($V6, [2, 14]), o($V6, [2, 15]), o($V6, [2, 16]), { 1: [2, 1] }, o($V7, $V8, { 8: 10, 9: 11, 1: [2, 2], 10: $V9, 12: $Va, 14: $Vb, 16: $Vc, 18: $Vd, 19: $Ve }), o($V4, $V5, { 6: 18 }), o($V4, [2, 5]), { 4: 19, 20: $V1, 21: $V2, 22: $V3 }, { 11: [1, 20] }, { 13: [1, 21] }, { 15: [1, 22] }, { 17: [1, 23] }, o($V7, [2, 12]), o($V7, [2, 13]), o($V7, $V8, { 8: 10, 9: 11, 1: [2, 3], 10: $V9, 12: $Va, 14: $Vb, 16: $Vc, 18: $Vd, 19: $Ve }), o($V4, [2, 6]), o($V7, [2, 8]), o($V7, [2, 9]), o($V7, [2, 10]), o($V7, [2, 11])], - defaultActions: { 7: [2, 1] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + }; + Object.freeze(defaultParserErrorProvider); + defaultGrammarResolverErrorProvider = { + buildRuleNotFoundError(topLevelRule, undefinedRule) { + const msg = "Invalid grammar, reference to a rule which is not defined: ->" + undefinedRule.nonTerminalName + "<-\ninside top level rule: ->" + topLevelRule.name + "<-"; + return msg; } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + }; + defaultGrammarValidatorErrorProvider = { + buildDuplicateFoundError(topLevelRule, duplicateProds) { + function getExtraProductionArgument2(prod) { + if (prod instanceof Terminal) { + return prod.terminalType.name; + } else if (prod instanceof NonTerminal) { + return prod.nonTerminalName; + } else { + return ""; } - token2 = self2.symbols_[token2] || token2; } - return token2; - } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; + __name(getExtraProductionArgument2, "getExtraProductionArgument"); + const topLevelName = topLevelRule.name; + const duplicateProd = head_default(duplicateProds); + const index = duplicateProd.idx; + const dslName = getProductionDslName(duplicateProd); + const extraArgument = getExtraProductionArgument2(duplicateProd); + const hasExplicitIndex = index > 0; + let msg = `->${dslName}${hasExplicitIndex ? index : ""}<- ${extraArgument ? `with argument: ->${extraArgument}<-` : ""} + appears more than once (${duplicateProds.length} times) in the top level rule: ->${topLevelName}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `; + msg = msg.replace(/[ \t]+/g, " "); + msg = msg.replace(/\s\s+/g, "\n"); + return msg; + }, + buildNamespaceConflictError(rule) { + const errMsg = `Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${rule.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`; + return errMsg; + }, + buildAlternationPrefixAmbiguityError(options3) { + const pathMsg = map_default(options3.prefixPath, (currTok) => tokenLabel2(currTok)).join(", "); + const occurrence = options3.alternation.idx === 0 ? "" : options3.alternation.idx; + const errMsg = `Ambiguous alternatives: <${options3.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${options3.topLevelRule.name}> Rule, +<${pathMsg}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`; + return errMsg; + }, + buildAlternationAmbiguityError(options3) { + const pathMsg = map_default(options3.prefixPath, (currtok) => tokenLabel2(currtok)).join(", "); + const occurrence = options3.alternation.idx === 0 ? "" : options3.alternation.idx; + let currMessage = `Ambiguous Alternatives Detected: <${options3.ambiguityIndices.join(" ,")}> in inside <${options3.topLevelRule.name}> Rule, +<${pathMsg}> may appears as a prefix path in all these alternatives. +`; + currMessage = currMessage + `See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`; + return currMessage; + }, + buildEmptyRepetitionError(options3) { + let dslName = getProductionDslName(options3.repetition); + if (options3.repetition.idx !== 0) { + dslName += options3.repetition.idx; + } + const errMsg = `The repetition <${dslName}> within Rule <${options3.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`; + return errMsg; + }, + // TODO: remove - `errors_public` from nyc.config.js exclude + // once this method is fully removed from this file + buildTokenNameError(options3) { + return "deprecated"; + }, + buildEmptyAlternationError(options3) { + const errMsg = `Ambiguous empty alternative: <${options3.emptyChoiceIdx + 1}> in inside <${options3.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`; + return errMsg; + }, + buildTooManyAlternativesError(options3) { + const errMsg = `An Alternation cannot have more than 256 alternatives: + inside <${options3.topLevelRule.name}> Rule. + has ${options3.alternation.definition.length + 1} alternatives.`; + return errMsg; + }, + buildLeftRecursionError(options3) { + const ruleName = options3.topLevelRule.name; + const pathNames = map_default(options3.leftRecursionPath, (currRule) => currRule.name); + const leftRecursivePath = `${ruleName} --> ${pathNames.concat([ruleName]).join(" --> ")}`; + const errMsg = `Left Recursion found in grammar. +rule: <${ruleName}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${leftRecursivePath} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`; + return errMsg; + }, + // TODO: remove - `errors_public` from nyc.config.js exclude + // once this method is fully removed from this file + buildInvalidRuleNameError(options3) { + return "deprecated"; + }, + buildDuplicateRuleNameError(options3) { + let ruleName; + if (options3.topLevelRule instanceof Rule) { + ruleName = options3.topLevelRule.name; } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; + ruleName = options3.topLevelRule; } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected + const errMsg = `Duplicate definition, rule: ->${ruleName}<- is already defined in the grammar: ->${options3.grammarName}<-`; + return errMsg; + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/resolver.js + function resolveGrammar(topLevels, errMsgProvider) { + const refResolver = new GastRefResolverVisitor(topLevels, errMsgProvider); + refResolver.resolveRefs(); + return refResolver.errors; + } + var GastRefResolverVisitor; + var init_resolver = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/resolver.js"() { + "use strict"; + init_parser(); + init_lodash(); + init_api3(); + __name(resolveGrammar, "resolveGrammar"); + GastRefResolverVisitor = class extends GAstVisitor { + static { + __name(this, "GastRefResolverVisitor"); + } + constructor(nameToTopRule, errMsgProvider) { + super(); + this.nameToTopRule = nameToTopRule; + this.errMsgProvider = errMsgProvider; + this.errors = []; + } + resolveRefs() { + forEach_default(values_default(this.nameToTopRule), (prod) => { + this.currTopLevel = prod; + prod.accept(this); + }); + } + visitNonTerminal(node2) { + const ref = this.nameToTopRule[node2.nonTerminalName]; + if (!ref) { + const msg = this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel, node2); + this.errors.push({ + message: msg, + type: ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF, + ruleName: this.currTopLevel.name, + unresolvedRefName: node2.nonTerminalName }); + } else { + node2.referencedRule = ref; } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js + function possiblePathsFrom(targetDef, maxLength, currPath = []) { + currPath = clone_default2(currPath); + let result = []; + let i2 = 0; + function remainingPathWith(nextDef) { + return nextDef.concat(drop_default(targetDef, i2 + 1)); + } + __name(remainingPathWith, "remainingPathWith"); + function getAlternativesForProd(definition) { + const alternatives = possiblePathsFrom(remainingPathWith(definition), maxLength, currPath); + return result.concat(alternatives); + } + __name(getAlternativesForProd, "getAlternativesForProd"); + while (currPath.length < maxLength && i2 < targetDef.length) { + const prod = targetDef[i2]; + if (prod instanceof Alternative) { + return getAlternativesForProd(prod.definition); + } else if (prod instanceof NonTerminal) { + return getAlternativesForProd(prod.definition); + } else if (prod instanceof Option2) { + result = getAlternativesForProd(prod.definition); + } else if (prod instanceof RepetitionMandatory) { + const newDef = prod.definition.concat([ + new Repetition({ + definition: prod.definition + }) + ]); + return getAlternativesForProd(newDef); + } else if (prod instanceof RepetitionMandatoryWithSeparator) { + const newDef = [ + new Alternative({ definition: prod.definition }), + new Repetition({ + definition: [new Terminal({ terminalType: prod.separator })].concat(prod.definition) + }) + ]; + return getAlternativesForProd(newDef); + } else if (prod instanceof RepetitionWithSeparator) { + const newDef = prod.definition.concat([ + new Repetition({ + definition: [new Terminal({ terminalType: prod.separator })].concat(prod.definition) + }) + ]); + result = getAlternativesForProd(newDef); + } else if (prod instanceof Repetition) { + const newDef = prod.definition.concat([ + new Repetition({ + definition: prod.definition + }) + ]); + result = getAlternativesForProd(newDef); + } else if (prod instanceof Alternation) { + forEach_default(prod.definition, (currAlt) => { + if (isEmpty_default(currAlt.definition) === false) { + result = getAlternativesForProd(currAlt.definition); } + }); + return result; + } else if (prod instanceof Terminal) { + currPath.push(prod.terminalType); + } else { + throw Error("non exhaustive match"); + } + i2++; + } + result.push({ + partialPath: currPath, + suffixDef: drop_default(targetDef, i2) + }); + return result; + } + function nextPossibleTokensAfter(initialDef, tokenVector, tokMatcher, maxLookAhead) { + const EXIT_NON_TERMINAL = "EXIT_NONE_TERMINAL"; + const EXIT_NON_TERMINAL_ARR = [EXIT_NON_TERMINAL]; + const EXIT_ALTERNATIVE = "EXIT_ALTERNATIVE"; + let foundCompletePath = false; + const tokenVectorLength = tokenVector.length; + const minimalAlternativesIndex = tokenVectorLength - maxLookAhead - 1; + const result = []; + const possiblePaths = []; + possiblePaths.push({ + idx: -1, + def: initialDef, + ruleStack: [], + occurrenceStack: [] + }); + while (!isEmpty_default(possiblePaths)) { + const currPath = possiblePaths.pop(); + if (currPath === EXIT_ALTERNATIVE) { + if (foundCompletePath && last_default(possiblePaths).idx <= minimalAlternativesIndex) { + possiblePaths.pop(); } - return true; + continue; + } + const currDef = currPath.def; + const currIdx = currPath.idx; + const currRuleStack = currPath.ruleStack; + const currOccurrenceStack = currPath.occurrenceStack; + if (isEmpty_default(currDef)) { + continue; + } + const prod = currDef[0]; + if (prod === EXIT_NON_TERMINAL) { + const nextPath = { + idx: currIdx, + def: drop_default(currDef), + ruleStack: dropRight_default(currRuleStack), + occurrenceStack: dropRight_default(currOccurrenceStack) + }; + possiblePaths.push(nextPath); + } else if (prod instanceof Terminal) { + if (currIdx < tokenVectorLength - 1) { + const nextIdx = currIdx + 1; + const actualToken = tokenVector[nextIdx]; + if (tokMatcher(actualToken, prod.terminalType)) { + const nextPath = { + idx: nextIdx, + def: drop_default(currDef), + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPath); + } + } else if (currIdx === tokenVectorLength - 1) { + result.push({ + nextTokenType: prod.terminalType, + nextTokenOccurrence: prod.idx, + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }); + foundCompletePath = true; + } else { + throw Error("non exhaustive match"); + } + } else if (prod instanceof NonTerminal) { + const newRuleStack = clone_default2(currRuleStack); + newRuleStack.push(prod.nonTerminalName); + const newOccurrenceStack = clone_default2(currOccurrenceStack); + newOccurrenceStack.push(prod.idx); + const nextPath = { + idx: currIdx, + def: prod.definition.concat(EXIT_NON_TERMINAL_ARR, drop_default(currDef)), + ruleStack: newRuleStack, + occurrenceStack: newOccurrenceStack + }; + possiblePaths.push(nextPath); + } else if (prod instanceof Option2) { + const nextPathWithout = { + idx: currIdx, + def: drop_default(currDef), + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPathWithout); + possiblePaths.push(EXIT_ALTERNATIVE); + const nextPathWith = { + idx: currIdx, + def: prod.definition.concat(drop_default(currDef)), + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPathWith); + } else if (prod instanceof RepetitionMandatory) { + const secondIteration = new Repetition({ + definition: prod.definition, + idx: prod.idx + }); + const nextDef = prod.definition.concat([secondIteration], drop_default(currDef)); + const nextPath = { + idx: currIdx, + def: nextDef, + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPath); + } else if (prod instanceof RepetitionMandatoryWithSeparator) { + const separatorGast = new Terminal({ + terminalType: prod.separator + }); + const secondIteration = new Repetition({ + definition: [separatorGast].concat(prod.definition), + idx: prod.idx + }); + const nextDef = prod.definition.concat([secondIteration], drop_default(currDef)); + const nextPath = { + idx: currIdx, + def: nextDef, + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPath); + } else if (prod instanceof RepetitionWithSeparator) { + const nextPathWithout = { + idx: currIdx, + def: drop_default(currDef), + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPathWithout); + possiblePaths.push(EXIT_ALTERNATIVE); + const separatorGast = new Terminal({ + terminalType: prod.separator + }); + const nthRepetition = new Repetition({ + definition: [separatorGast].concat(prod.definition), + idx: prod.idx + }); + const nextDef = prod.definition.concat([nthRepetition], drop_default(currDef)); + const nextPathWith = { + idx: currIdx, + def: nextDef, + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPathWith); + } else if (prod instanceof Repetition) { + const nextPathWithout = { + idx: currIdx, + def: drop_default(currDef), + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPathWithout); + possiblePaths.push(EXIT_ALTERNATIVE); + const nthRepetition = new Repetition({ + definition: prod.definition, + idx: prod.idx + }); + const nextDef = prod.definition.concat([nthRepetition], drop_default(currDef)); + const nextPathWith = { + idx: currIdx, + def: nextDef, + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(nextPathWith); + } else if (prod instanceof Alternation) { + for (let i2 = prod.definition.length - 1; i2 >= 0; i2--) { + const currAlt = prod.definition[i2]; + const currAltPath = { + idx: currIdx, + def: currAlt.definition.concat(drop_default(currDef)), + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }; + possiblePaths.push(currAltPath); + possiblePaths.push(EXIT_ALTERNATIVE); + } + } else if (prod instanceof Alternative) { + possiblePaths.push({ + idx: currIdx, + def: prod.definition.concat(drop_default(currDef)), + ruleStack: currRuleStack, + occurrenceStack: currOccurrenceStack + }); + } else if (prod instanceof Rule) { + possiblePaths.push(expandTopLevelRule(prod, currIdx, currRuleStack, currOccurrenceStack)); + } else { + throw Error("non exhaustive match"); } + } + return result; + } + function expandTopLevelRule(topRule, currIdx, currRuleStack, currOccurrenceStack) { + const newRuleStack = clone_default2(currRuleStack); + newRuleStack.push(topRule.name); + const newCurrOccurrenceStack = clone_default2(currOccurrenceStack); + newCurrOccurrenceStack.push(1); + return { + idx: currIdx, + def: topRule.definition, + ruleStack: newRuleStack, + occurrenceStack: newCurrOccurrenceStack }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); + } + var AbstractNextPossibleTokensWalker, NextAfterTokenWalker, AbstractNextTerminalAfterProductionWalker, NextTerminalAfterManyWalker, NextTerminalAfterManySepWalker, NextTerminalAfterAtLeastOneWalker, NextTerminalAfterAtLeastOneSepWalker; + var init_interpreter = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js"() { + "use strict"; + init_lodash(); + init_first2(); + init_rest(); + init_api3(); + AbstractNextPossibleTokensWalker = class extends RestWalker { + static { + __name(this, "AbstractNextPossibleTokensWalker"); + } + constructor(topProd, path4) { + super(); + this.topProd = topProd; + this.path = path4; + this.possibleTokTypes = []; + this.nextProductionName = ""; + this.nextProductionOccurrence = 0; + this.found = false; + this.isAtEndOfPath = false; + } + startWalking() { + this.found = false; + if (this.path.ruleStack[0] !== this.topProd.name) { + throw Error("The path does not start with the walker's top Rule!"); + } + this.ruleStack = clone_default2(this.path.ruleStack).reverse(); + this.occurrenceStack = clone_default2(this.path.occurrenceStack).reverse(); + this.ruleStack.pop(); + this.occurrenceStack.pop(); + this.updateExpectedNext(); + this.walk(this.topProd); + return this.possibleTokTypes; + } + walk(prod, prevRest = []) { + if (!this.found) { + super.walk(prod, prevRest); + } + } + walkProdRef(refProd, currRest, prevRest) { + if (refProd.referencedRule.name === this.nextProductionName && refProd.idx === this.nextProductionOccurrence) { + const fullRest = currRest.concat(prevRest); + this.updateExpectedNext(); + this.walk(refProd.referencedRule, fullRest); + } + } + updateExpectedNext() { + if (isEmpty_default(this.ruleStack)) { + this.nextProductionName = ""; + this.nextProductionOccurrence = 0; + this.isAtEndOfPath = true; } else { - throw new Error(str2); + this.nextProductionName = this.ruleStack.pop(); + this.nextProductionOccurrence = this.occurrenceStack.pop(); } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + } + }; + NextAfterTokenWalker = class extends AbstractNextPossibleTokensWalker { + static { + __name(this, "NextAfterTokenWalker"); + } + constructor(topProd, path4) { + super(topProd, path4); + this.path = path4; + this.nextTerminalName = ""; + this.nextTerminalOccurrence = 0; + this.nextTerminalName = this.path.lastTok.name; + this.nextTerminalOccurrence = this.path.lastTokOccurrence; + } + walkTerminal(terminal, currRest, prevRest) { + if (this.isAtEndOfPath && terminal.terminalType.name === this.nextTerminalName && terminal.idx === this.nextTerminalOccurrence && !this.found) { + const fullRest = currRest.concat(prevRest); + const restProd = new Alternative({ definition: fullRest }); + this.possibleTokTypes = first(restProd); + this.found = true; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; + } + }; + AbstractNextTerminalAfterProductionWalker = class extends RestWalker { + static { + __name(this, "AbstractNextTerminalAfterProductionWalker"); + } + constructor(topRule, occurrence) { + super(); + this.topRule = topRule; + this.occurrence = occurrence; + this.result = { + token: void 0, + occurrence: void 0, + isEndOfRule: void 0 + }; + } + startWalking() { + this.walk(this.topRule); + return this.result; + } + }; + NextTerminalAfterManyWalker = class extends AbstractNextTerminalAfterProductionWalker { + static { + __name(this, "NextTerminalAfterManyWalker"); + } + walkMany(manyProd, currRest, prevRest) { + if (manyProd.idx === this.occurrence) { + const firstAfterMany = head_default(currRest.concat(prevRest)); + this.result.isEndOfRule = firstAfterMany === void 0; + if (firstAfterMany instanceof Terminal) { + this.result.token = firstAfterMany.terminalType; + this.result.occurrence = firstAfterMany.idx; + } } else { - this.yylloc.last_column++; + super.walkMany(manyProd, currRest, prevRest); } - if (this.options.ranges) { - this.yylloc.range[1]++; + } + }; + NextTerminalAfterManySepWalker = class extends AbstractNextTerminalAfterProductionWalker { + static { + __name(this, "NextTerminalAfterManySepWalker"); + } + walkManySep(manySepProd, currRest, prevRest) { + if (manySepProd.idx === this.occurrence) { + const firstAfterManySep = head_default(currRest.concat(prevRest)); + this.result.isEndOfRule = firstAfterManySep === void 0; + if (firstAfterManySep instanceof Terminal) { + this.result.token = firstAfterManySep.terminalType; + this.result.occurrence = firstAfterManySep.idx; + } + } else { + super.walkManySep(manySepProd, currRest, prevRest); } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + }; + NextTerminalAfterAtLeastOneWalker = class extends AbstractNextTerminalAfterProductionWalker { + static { + __name(this, "NextTerminalAfterAtLeastOneWalker"); + } + walkAtLeastOne(atLeastOneProd, currRest, prevRest) { + if (atLeastOneProd.idx === this.occurrence) { + const firstAfterAtLeastOne = head_default(currRest.concat(prevRest)); + this.result.isEndOfRule = firstAfterAtLeastOne === void 0; + if (firstAfterAtLeastOne instanceof Terminal) { + this.result.token = firstAfterAtLeastOne.terminalType; + this.result.occurrence = firstAfterAtLeastOne.idx; + } + } else { + super.walkAtLeastOne(atLeastOneProd, currRest, prevRest); } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; + } + }; + NextTerminalAfterAtLeastOneSepWalker = class extends AbstractNextTerminalAfterProductionWalker { + static { + __name(this, "NextTerminalAfterAtLeastOneSepWalker"); + } + walkAtLeastOneSep(atleastOneSepProd, currRest, prevRest) { + if (atleastOneSepProd.idx === this.occurrence) { + const firstAfterfirstAfterAtLeastOneSep = head_default(currRest.concat(prevRest)); + this.result.isEndOfRule = firstAfterfirstAfterAtLeastOneSep === void 0; + if (firstAfterfirstAfterAtLeastOneSep instanceof Terminal) { + this.result.token = firstAfterfirstAfterAtLeastOneSep.terminalType; + this.result.occurrence = firstAfterfirstAfterAtLeastOneSep.idx; + } } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + super.walkAtLeastOneSep(atleastOneSepProd, currRest, prevRest); } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + } + }; + __name(possiblePathsFrom, "possiblePathsFrom"); + __name(nextPossibleTokensAfter, "nextPossibleTokensAfter"); + __name(expandTopLevelRule, "expandTopLevelRule"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js + function getProdType(prod) { + if (prod instanceof Option2 || prod === "Option") { + return PROD_TYPE.OPTION; + } else if (prod instanceof Repetition || prod === "Repetition") { + return PROD_TYPE.REPETITION; + } else if (prod instanceof RepetitionMandatory || prod === "RepetitionMandatory") { + return PROD_TYPE.REPETITION_MANDATORY; + } else if (prod instanceof RepetitionMandatoryWithSeparator || prod === "RepetitionMandatoryWithSeparator") { + return PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR; + } else if (prod instanceof RepetitionWithSeparator || prod === "RepetitionWithSeparator") { + return PROD_TYPE.REPETITION_WITH_SEPARATOR; + } else if (prod instanceof Alternation || prod === "Alternation") { + return PROD_TYPE.ALTERNATION; + } else { + throw Error("non exhaustive match"); + } + } + function getLookaheadPaths(options3) { + const { occurrence, rule, prodType, maxLookahead } = options3; + const type3 = getProdType(prodType); + if (type3 === PROD_TYPE.ALTERNATION) { + return getLookaheadPathsForOr(occurrence, rule, maxLookahead); + } else { + return getLookaheadPathsForOptionalProd(occurrence, rule, type3, maxLookahead); + } + } + function buildLookaheadFuncForOr(occurrence, ruleGrammar, maxLookahead, hasPredicates, dynamicTokensEnabled, laFuncBuilder) { + const lookAheadPaths = getLookaheadPathsForOr(occurrence, ruleGrammar, maxLookahead); + const tokenMatcher2 = areTokenCategoriesNotUsed(lookAheadPaths) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher; + return laFuncBuilder(lookAheadPaths, hasPredicates, tokenMatcher2, dynamicTokensEnabled); + } + function buildLookaheadFuncForOptionalProd(occurrence, ruleGrammar, k2, dynamicTokensEnabled, prodType, lookaheadBuilder) { + const lookAheadPaths = getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, k2); + const tokenMatcher2 = areTokenCategoriesNotUsed(lookAheadPaths) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher; + return lookaheadBuilder(lookAheadPaths[0], tokenMatcher2, dynamicTokensEnabled); + } + function buildAlternativesLookAheadFunc(alts, hasPredicates, tokenMatcher2, dynamicTokensEnabled) { + const numOfAlts = alts.length; + const areAllOneTokenLookahead = every_default(alts, (currAlt) => { + return every_default(currAlt, (currPath) => { + return currPath.length === 1; + }); + }); + if (hasPredicates) { + return function(orAlts) { + const predicates = map_default(orAlts, (currAlt) => currAlt.GATE); + for (let t4 = 0; t4 < numOfAlts; t4++) { + const currAlt = alts[t4]; + const currNumOfPaths = currAlt.length; + const currPredicate = predicates[t4]; + if (currPredicate !== void 0 && currPredicate.call(this) === false) { + continue; } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + nextPath: for (let j2 = 0; j2 < currNumOfPaths; j2++) { + const currPath = currAlt[j2]; + const currPathLength = currPath.length; + for (let i2 = 0; i2 < currPathLength; i2++) { + const nextToken = this.LA(i2 + 1); + if (tokenMatcher2(nextToken, currPath[i2]) === false) { + continue nextPath; + } } + return t4; } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + } + return void 0; + }; + } else if (areAllOneTokenLookahead && !dynamicTokensEnabled) { + const singleTokenAlts = map_default(alts, (currAlt) => { + return flatten_default(currAlt); + }); + const choiceToAlt = reduce_default(singleTokenAlts, (result, currAlt, idx) => { + forEach_default(currAlt, (currTokType) => { + if (!has_default(result, currTokType.tokenTypeIdx)) { + result[currTokType.tokenTypeIdx] = idx; } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; + forEach_default(currTokType.categoryMatches, (currExtendingType) => { + if (!has_default(result, currExtendingType)) { + result[currExtendingType] = idx; } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; + }); + }); + return result; + }, {}); + return function() { + const nextToken = this.LA(1); + return choiceToAlt[nextToken.tokenTypeIdx]; + }; + } else { + return function() { + for (let t4 = 0; t4 < numOfAlts; t4++) { + const currAlt = alts[t4]; + const currNumOfPaths = currAlt.length; + nextPath: for (let j2 = 0; j2 < currNumOfPaths; j2++) { + const currPath = currAlt[j2]; + const currPathLength = currPath.length; + for (let i2 = 0; i2 < currPathLength; i2++) { + const nextToken = this.LA(i2 + 1); + if (tokenMatcher2(nextToken, currPath[i2]) === false) { + continue nextPath; } } + return t4; } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + } + return void 0; + }; + } + } + function buildSingleAlternativeLookaheadFunction(alt, tokenMatcher2, dynamicTokensEnabled) { + const areAllOneTokenLookahead = every_default(alt, (currPath) => { + return currPath.length === 1; + }); + const numOfPaths = alt.length; + if (areAllOneTokenLookahead && !dynamicTokensEnabled) { + const singleTokensTypes = flatten_default(alt); + if (singleTokensTypes.length === 1 && isEmpty_default(singleTokensTypes[0].categoryMatches)) { + const expectedTokenType = singleTokensTypes[0]; + const expectedTokenUniqueKey = expectedTokenType.tokenTypeIdx; + return function() { + return this.LA(1).tokenTypeIdx === expectedTokenUniqueKey; + }; + } else { + const choiceToAlt = reduce_default(singleTokensTypes, (result, currTokType, idx) => { + result[currTokType.tokenTypeIdx] = true; + forEach_default(currTokType.categoryMatches, (currExtendingType) => { + result[currExtendingType] = true; + }); + return result; + }, []); + return function() { + const nextToken = this.LA(1); + return choiceToAlt[nextToken.tokenTypeIdx] === true; + }; + } + } else { + return function() { + nextPath: for (let j2 = 0; j2 < numOfPaths; j2++) { + const currPath = alt[j2]; + const currPathLength = currPath.length; + for (let i2 = 0; i2 < currPathLength; i2++) { + const nextToken = this.LA(i2 + 1); + if (tokenMatcher2(nextToken, currPath[i2]) === false) { + continue nextPath; } - return false; } - if (this._input === "") { - return this.EOF; + return true; + } + return false; + }; + } + } + function initializeArrayOfArrays(size5) { + const result = new Array(size5); + for (let i2 = 0; i2 < size5; i2++) { + result[i2] = []; + } + return result; + } + function pathToHashKeys(path4) { + let keys3 = [""]; + for (let i2 = 0; i2 < path4.length; i2++) { + const tokType = path4[i2]; + const longerKeys = []; + for (let j2 = 0; j2 < keys3.length; j2++) { + const currShorterKey = keys3[j2]; + longerKeys.push(currShorterKey + "_" + tokType.tokenTypeIdx); + for (let t4 = 0; t4 < tokType.categoryMatches.length; t4++) { + const categoriesKeySuffix = "_" + tokType.categoryMatches[t4]; + longerKeys.push(currShorterKey + categoriesKeySuffix); + } + } + keys3 = longerKeys; + } + return keys3; + } + function isUniquePrefixHash(altKnownPathsKeys, searchPathKeys, idx) { + for (let currAltIdx = 0; currAltIdx < altKnownPathsKeys.length; currAltIdx++) { + if (currAltIdx === idx) { + continue; + } + const otherAltKnownPathsKeys = altKnownPathsKeys[currAltIdx]; + for (let searchIdx = 0; searchIdx < searchPathKeys.length; searchIdx++) { + const searchKey = searchPathKeys[searchIdx]; + if (otherAltKnownPathsKeys[searchKey] === true) { + return false; + } + } + } + return true; + } + function lookAheadSequenceFromAlternatives(altsDefs, k2) { + const partialAlts = map_default(altsDefs, (currAlt) => possiblePathsFrom([currAlt], 1)); + const finalResult = initializeArrayOfArrays(partialAlts.length); + const altsHashes = map_default(partialAlts, (currAltPaths) => { + const dict = {}; + forEach_default(currAltPaths, (item) => { + const keys3 = pathToHashKeys(item.partialPath); + forEach_default(keys3, (currKey) => { + dict[currKey] = true; + }); + }); + return dict; + }); + let newData = partialAlts; + for (let pathLength = 1; pathLength <= k2; pathLength++) { + const currDataset = newData; + newData = initializeArrayOfArrays(currDataset.length); + for (let altIdx = 0; altIdx < currDataset.length; altIdx++) { + const currAltPathsAndSuffixes = currDataset[altIdx]; + for (let currPathIdx = 0; currPathIdx < currAltPathsAndSuffixes.length; currPathIdx++) { + const currPathPrefix = currAltPathsAndSuffixes[currPathIdx].partialPath; + const suffixDef = currAltPathsAndSuffixes[currPathIdx].suffixDef; + const prefixKeys = pathToHashKeys(currPathPrefix); + const isUnique = isUniquePrefixHash(altsHashes, prefixKeys, altIdx); + if (isUnique || isEmpty_default(suffixDef) || currPathPrefix.length === k2) { + const currAltResult = finalResult[altIdx]; + if (containsPath(currAltResult, currPathPrefix) === false) { + currAltResult.push(currPathPrefix); + for (let j2 = 0; j2 < prefixKeys.length; j2++) { + const currKey = prefixKeys[j2]; + altsHashes[altIdx][currKey] = true; + } + } } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno + const newPartialPathsAndSuffixes = possiblePathsFrom(suffixDef, pathLength + 1, currPathPrefix); + newData[altIdx] = newData[altIdx].concat(newPartialPathsAndSuffixes); + forEach_default(newPartialPathsAndSuffixes, (item) => { + const prefixKeys2 = pathToHashKeys(item.partialPath); + forEach_default(prefixKeys2, (key) => { + altsHashes[altIdx][key] = true; + }); }); } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + } + } + } + return finalResult; + } + function getLookaheadPathsForOr(occurrence, ruleGrammar, k2, orProd) { + const visitor2 = new InsideDefinitionFinderVisitor(occurrence, PROD_TYPE.ALTERNATION, orProd); + ruleGrammar.accept(visitor2); + return lookAheadSequenceFromAlternatives(visitor2.result, k2); + } + function getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, k2) { + const insideDefVisitor = new InsideDefinitionFinderVisitor(occurrence, prodType); + ruleGrammar.accept(insideDefVisitor); + const insideDef = insideDefVisitor.result; + const afterDefWalker = new RestDefinitionFinderWalker(ruleGrammar, occurrence, prodType); + const afterDef = afterDefWalker.startWalking(); + const insideFlat = new Alternative({ definition: insideDef }); + const afterFlat = new Alternative({ definition: afterDef }); + return lookAheadSequenceFromAlternatives([insideFlat, afterFlat], k2); + } + function containsPath(alternative, searchPath) { + compareOtherPath: for (let i2 = 0; i2 < alternative.length; i2++) { + const otherPath = alternative[i2]; + if (otherPath.length !== searchPath.length) { + continue; + } + for (let j2 = 0; j2 < otherPath.length; j2++) { + const searchTok = searchPath[j2]; + const otherTok = otherPath[j2]; + const matchingTokens = searchTok === otherTok || otherTok.categoryMatchesMap[searchTok.tokenTypeIdx] !== void 0; + if (matchingTokens === false) { + continue compareOtherPath; + } + } + return true; + } + return false; + } + function isStrictPrefixOfPath(prefix, other) { + return prefix.length < other.length && every_default(prefix, (tokType, idx) => { + const otherTokType = other[idx]; + return tokType === otherTokType || otherTokType.categoryMatchesMap[tokType.tokenTypeIdx]; + }); + } + function areTokenCategoriesNotUsed(lookAheadPaths) { + return every_default(lookAheadPaths, (singleAltPaths) => every_default(singleAltPaths, (singlePath) => every_default(singlePath, (token2) => isEmpty_default(token2.categoryMatches)))); + } + var PROD_TYPE, RestDefinitionFinderWalker, InsideDefinitionFinderVisitor; + var init_lookahead = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js"() { + "use strict"; + init_lodash(); + init_interpreter(); + init_rest(); + init_tokens(); + init_api3(); + (function(PROD_TYPE2) { + PROD_TYPE2[PROD_TYPE2["OPTION"] = 0] = "OPTION"; + PROD_TYPE2[PROD_TYPE2["REPETITION"] = 1] = "REPETITION"; + PROD_TYPE2[PROD_TYPE2["REPETITION_MANDATORY"] = 2] = "REPETITION_MANDATORY"; + PROD_TYPE2[PROD_TYPE2["REPETITION_MANDATORY_WITH_SEPARATOR"] = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR"; + PROD_TYPE2[PROD_TYPE2["REPETITION_WITH_SEPARATOR"] = 4] = "REPETITION_WITH_SEPARATOR"; + PROD_TYPE2[PROD_TYPE2["ALTERNATION"] = 5] = "ALTERNATION"; + })(PROD_TYPE || (PROD_TYPE = {})); + __name(getProdType, "getProdType"); + __name(getLookaheadPaths, "getLookaheadPaths"); + __name(buildLookaheadFuncForOr, "buildLookaheadFuncForOr"); + __name(buildLookaheadFuncForOptionalProd, "buildLookaheadFuncForOptionalProd"); + __name(buildAlternativesLookAheadFunc, "buildAlternativesLookAheadFunc"); + __name(buildSingleAlternativeLookaheadFunction, "buildSingleAlternativeLookaheadFunction"); + RestDefinitionFinderWalker = class extends RestWalker { + static { + __name(this, "RestDefinitionFinderWalker"); + } + constructor(topProd, targetOccurrence, targetProdType) { + super(); + this.topProd = topProd; + this.targetOccurrence = targetOccurrence; + this.targetProdType = targetProdType; + } + startWalking() { + this.walk(this.topProd); + return this.restDef; + } + checkIsTarget(node2, expectedProdType, currRest, prevRest) { + if (node2.idx === this.targetOccurrence && this.targetProdType === expectedProdType) { + this.restDef = currRest.concat(prevRest); + return true; } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + return false; + } + walkOption(optionProd, currRest, prevRest) { + if (!this.checkIsTarget(optionProd, PROD_TYPE.OPTION, currRest, prevRest)) { + super.walkOption(optionProd, currRest, prevRest); } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + } + walkAtLeastOne(atLeastOneProd, currRest, prevRest) { + if (!this.checkIsTarget(atLeastOneProd, PROD_TYPE.REPETITION_MANDATORY, currRest, prevRest)) { + super.walkOption(atLeastOneProd, currRest, prevRest); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; + } + walkAtLeastOneSep(atLeastOneSepProd, currRest, prevRest) { + if (!this.checkIsTarget(atLeastOneSepProd, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, currRest, prevRest)) { + super.walkOption(atLeastOneSepProd, currRest, prevRest); } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - break; - case 1: - break; - case 2: - return 20; - case 3: - break; - case 4: - break; - case 5: - this.begin("title"); - return 12; - case 6: - this.popState(); - return "title_value"; - case 7: - this.begin("acc_title"); - return 14; - case 8: - this.popState(); - return "acc_title_value"; - case 9: - this.begin("acc_descr"); - return 16; - case 10: - this.popState(); - return "acc_descr_value"; - case 11: - this.begin("acc_descr_multiline"); - break; - case 12: - this.popState(); - break; - case 13: - return "acc_descr_multiline_value"; - case 14: - this.begin("string"); - break; - case 15: - this.popState(); - break; - case 16: - return "txt"; - case 17: - return 5; - case 18: - return 7; - case 19: - return "value"; - case 20: - return 22; + } + walkMany(manyProd, currRest, prevRest) { + if (!this.checkIsTarget(manyProd, PROD_TYPE.REPETITION, currRest, prevRest)) { + super.walkOption(manyProd, currRest, prevRest); } - }, - rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:[\s]+)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:pie\b)/i, /^(?:showData\b)/i, /^(?::[\s]*[\d]+(?:\.[\d]+)?)/i, /^(?:$)/i], - conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "title": { "rules": [6], "inclusive": false }, "string": { "rules": [15, 16], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 7, 9, 11, 14, 17, 18, 19, 20], "inclusive": true } } + } + walkManySep(manySepProd, currRest, prevRest) { + if (!this.checkIsTarget(manySepProd, PROD_TYPE.REPETITION_WITH_SEPARATOR, currRest, prevRest)) { + super.walkOption(manySepProd, currRest, prevRest); + } + } }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$m.parser = parser$m; - const parser$n = parser$m; - const DEFAULT_PIE_CONFIG = defaultConfig$2.pie; - const DEFAULT_PIE_DB = { - sections: {}, - showData: false, - config: DEFAULT_PIE_CONFIG - }; - let sections$2 = DEFAULT_PIE_DB.sections; - let showData = DEFAULT_PIE_DB.showData; - const config$2 = structuredClone(DEFAULT_PIE_CONFIG); - const getConfig = () => structuredClone(config$2); - const clear$b = () => { - sections$2 = structuredClone(DEFAULT_PIE_DB.sections); - showData = DEFAULT_PIE_DB.showData; - clear$n(); - }; - const addSection$2 = (label, value2) => { - label = sanitizeText$6(label, getConfig$1()); - if (sections$2[label] === void 0) { - sections$2[label] = value2; - log$1.debug(`added new section: ${label}, with value: ${value2}`); + InsideDefinitionFinderVisitor = class extends GAstVisitor { + static { + __name(this, "InsideDefinitionFinderVisitor"); + } + constructor(targetOccurrence, targetProdType, targetRef) { + super(); + this.targetOccurrence = targetOccurrence; + this.targetProdType = targetProdType; + this.targetRef = targetRef; + this.result = []; + } + checkIsTarget(node2, expectedProdName) { + if (node2.idx === this.targetOccurrence && this.targetProdType === expectedProdName && (this.targetRef === void 0 || node2 === this.targetRef)) { + this.result = node2.definition; + } + } + visitOption(node2) { + this.checkIsTarget(node2, PROD_TYPE.OPTION); + } + visitRepetition(node2) { + this.checkIsTarget(node2, PROD_TYPE.REPETITION); + } + visitRepetitionMandatory(node2) { + this.checkIsTarget(node2, PROD_TYPE.REPETITION_MANDATORY); + } + visitRepetitionMandatoryWithSeparator(node2) { + this.checkIsTarget(node2, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR); + } + visitRepetitionWithSeparator(node2) { + this.checkIsTarget(node2, PROD_TYPE.REPETITION_WITH_SEPARATOR); + } + visitAlternation(node2) { + this.checkIsTarget(node2, PROD_TYPE.ALTERNATION); + } + }; + __name(initializeArrayOfArrays, "initializeArrayOfArrays"); + __name(pathToHashKeys, "pathToHashKeys"); + __name(isUniquePrefixHash, "isUniquePrefixHash"); + __name(lookAheadSequenceFromAlternatives, "lookAheadSequenceFromAlternatives"); + __name(getLookaheadPathsForOr, "getLookaheadPathsForOr"); + __name(getLookaheadPathsForOptionalProd, "getLookaheadPathsForOptionalProd"); + __name(containsPath, "containsPath"); + __name(isStrictPrefixOfPath, "isStrictPrefixOfPath"); + __name(areTokenCategoriesNotUsed, "areTokenCategoriesNotUsed"); } - }; - const getSections$2 = () => sections$2; - const cleanupValue = (value2) => { - if (value2.substring(0, 1) === ":") { - value2 = value2.substring(1).trim(); + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/checks.js + function validateLookahead(options3) { + const lookaheadValidationErrorMessages = options3.lookaheadStrategy.validate({ + rules: options3.rules, + tokenTypes: options3.tokenTypes, + grammarName: options3.grammarName + }); + return map_default(lookaheadValidationErrorMessages, (errorMessage) => Object.assign({ type: ParserDefinitionErrorType.CUSTOM_LOOKAHEAD_VALIDATION }, errorMessage)); + } + function validateGrammar(topLevels, tokenTypes, errMsgProvider, grammarName) { + const duplicateErrors = flatMap_default(topLevels, (currTopLevel) => validateDuplicateProductions(currTopLevel, errMsgProvider)); + const termsNamespaceConflictErrors = checkTerminalAndNoneTerminalsNameSpace(topLevels, tokenTypes, errMsgProvider); + const tooManyAltsErrors = flatMap_default(topLevels, (curRule) => validateTooManyAlts(curRule, errMsgProvider)); + const duplicateRulesError = flatMap_default(topLevels, (curRule) => validateRuleDoesNotAlreadyExist(curRule, topLevels, grammarName, errMsgProvider)); + return duplicateErrors.concat(termsNamespaceConflictErrors, tooManyAltsErrors, duplicateRulesError); + } + function validateDuplicateProductions(topLevelRule, errMsgProvider) { + const collectorVisitor2 = new OccurrenceValidationCollector(); + topLevelRule.accept(collectorVisitor2); + const allRuleProductions = collectorVisitor2.allProductions; + const productionGroups = groupBy_default(allRuleProductions, identifyProductionForDuplicates); + const duplicates = pickBy_default(productionGroups, (currGroup) => { + return currGroup.length > 1; + }); + const errors = map_default(values_default(duplicates), (currDuplicates) => { + const firstProd = head_default(currDuplicates); + const msg = errMsgProvider.buildDuplicateFoundError(topLevelRule, currDuplicates); + const dslName = getProductionDslName(firstProd); + const defError = { + message: msg, + type: ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS, + ruleName: topLevelRule.name, + dslName, + occurrence: firstProd.idx + }; + const param = getExtraProductionArgument(firstProd); + if (param) { + defError.parameter = param; + } + return defError; + }); + return errors; + } + function identifyProductionForDuplicates(prod) { + return `${getProductionDslName(prod)}_#_${prod.idx}_#_${getExtraProductionArgument(prod)}`; + } + function getExtraProductionArgument(prod) { + if (prod instanceof Terminal) { + return prod.terminalType.name; + } else if (prod instanceof NonTerminal) { + return prod.nonTerminalName; + } else { + return ""; } - return Number(value2.trim()); - }; - const setShowData = (toggle) => { - showData = toggle; - }; - const getShowData = () => showData; - const db$d = { - getConfig, - clear: clear$b, - setDiagramTitle, - getDiagramTitle, - setAccTitle, - getAccTitle, - setAccDescription, - getAccDescription, - addSection: addSection$2, - getSections: getSections$2, - cleanupValue, - setShowData, - getShowData - }; - const getStyles$9 = (options2) => ` - .pieCircle{ - stroke: ${options2.pieStrokeColor}; - stroke-width : ${options2.pieStrokeWidth}; - opacity : ${options2.pieOpacity}; } - .pieOuterCircle{ - stroke: ${options2.pieOuterStrokeColor}; - stroke-width: ${options2.pieOuterStrokeWidth}; - fill: none; + function validateRuleDoesNotAlreadyExist(rule, allRules, className, errMsgProvider) { + const errors = []; + const occurrences = reduce_default(allRules, (result, curRule) => { + if (curRule.name === rule.name) { + return result + 1; + } + return result; + }, 0); + if (occurrences > 1) { + const errMsg = errMsgProvider.buildDuplicateRuleNameError({ + topLevelRule: rule, + grammarName: className + }); + errors.push({ + message: errMsg, + type: ParserDefinitionErrorType.DUPLICATE_RULE_NAME, + ruleName: rule.name + }); + } + return errors; } - .pieTitleText { - text-anchor: middle; - font-size: ${options2.pieTitleTextSize}; - fill: ${options2.pieTitleTextColor}; - font-family: ${options2.fontFamily}; + function validateRuleIsOverridden(ruleName, definedRulesNames, className) { + const errors = []; + let errMsg; + if (!includes_default(definedRulesNames, ruleName)) { + errMsg = `Invalid rule override, rule: ->${ruleName}<- cannot be overridden in the grammar: ->${className}<-as it is not defined in any of the super grammars `; + errors.push({ + message: errMsg, + type: ParserDefinitionErrorType.INVALID_RULE_OVERRIDE, + ruleName + }); + } + return errors; } - .slice { - font-family: ${options2.fontFamily}; - fill: ${options2.pieSectionTextColor}; - font-size:${options2.pieSectionTextSize}; - // fill: white; + function validateNoLeftRecursion(topRule, currRule, errMsgProvider, path4 = []) { + const errors = []; + const nextNonTerminals = getFirstNoneTerminal(currRule.definition); + if (isEmpty_default(nextNonTerminals)) { + return []; + } else { + const ruleName = topRule.name; + const foundLeftRecursion = includes_default(nextNonTerminals, topRule); + if (foundLeftRecursion) { + errors.push({ + message: errMsgProvider.buildLeftRecursionError({ + topLevelRule: topRule, + leftRecursionPath: path4 + }), + type: ParserDefinitionErrorType.LEFT_RECURSION, + ruleName + }); + } + const validNextSteps = difference_default(nextNonTerminals, path4.concat([topRule])); + const errorsFromNextSteps = flatMap_default(validNextSteps, (currRefRule) => { + const newPath = clone_default2(path4); + newPath.push(currRefRule); + return validateNoLeftRecursion(topRule, currRefRule, errMsgProvider, newPath); + }); + return errors.concat(errorsFromNextSteps); + } } - .legend text { - fill: ${options2.pieLegendTextColor}; - font-family: ${options2.fontFamily}; - font-size: ${options2.pieLegendTextSize}; + function getFirstNoneTerminal(definition) { + let result = []; + if (isEmpty_default(definition)) { + return result; + } + const firstProd = head_default(definition); + if (firstProd instanceof NonTerminal) { + result.push(firstProd.referencedRule); + } else if (firstProd instanceof Alternative || firstProd instanceof Option2 || firstProd instanceof RepetitionMandatory || firstProd instanceof RepetitionMandatoryWithSeparator || firstProd instanceof RepetitionWithSeparator || firstProd instanceof Repetition) { + result = result.concat(getFirstNoneTerminal(firstProd.definition)); + } else if (firstProd instanceof Alternation) { + result = flatten_default(map_default(firstProd.definition, (currSubDef) => getFirstNoneTerminal(currSubDef.definition))); + } else if (firstProd instanceof Terminal) { + } else { + throw Error("non exhaustive match"); + } + const isFirstOptional = isOptionalProd(firstProd); + const hasMore = definition.length > 1; + if (isFirstOptional && hasMore) { + const rest = drop_default(definition); + return result.concat(getFirstNoneTerminal(rest)); + } else { + return result; + } } -`; - const styles$8 = getStyles$9; - const createPieArcs = (sections2) => { - const pieData = Object.entries(sections2).map((element2) => { + function validateEmptyOrAlternative(topLevelRule, errMsgProvider) { + const orCollector = new OrCollector(); + topLevelRule.accept(orCollector); + const ors = orCollector.alternations; + const errors = flatMap_default(ors, (currOr) => { + const exceptLast = dropRight_default(currOr.definition); + return flatMap_default(exceptLast, (currAlternative, currAltIdx) => { + const possibleFirstInAlt = nextPossibleTokensAfter([currAlternative], [], tokenStructuredMatcher, 1); + if (isEmpty_default(possibleFirstInAlt)) { + return [ + { + message: errMsgProvider.buildEmptyAlternationError({ + topLevelRule, + alternation: currOr, + emptyChoiceIdx: currAltIdx + }), + type: ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT, + ruleName: topLevelRule.name, + occurrence: currOr.idx, + alternative: currAltIdx + 1 + } + ]; + } else { + return []; + } + }); + }); + return errors; + } + function validateAmbiguousAlternationAlternatives(topLevelRule, globalMaxLookahead, errMsgProvider) { + const orCollector = new OrCollector(); + topLevelRule.accept(orCollector); + let ors = orCollector.alternations; + ors = reject_default(ors, (currOr) => currOr.ignoreAmbiguities === true); + const errors = flatMap_default(ors, (currOr) => { + const currOccurrence = currOr.idx; + const actualMaxLookahead = currOr.maxLookahead || globalMaxLookahead; + const alternatives = getLookaheadPathsForOr(currOccurrence, topLevelRule, actualMaxLookahead, currOr); + const altsAmbiguityErrors = checkAlternativesAmbiguities(alternatives, currOr, topLevelRule, errMsgProvider); + const altsPrefixAmbiguityErrors = checkPrefixAlternativesAmbiguities(alternatives, currOr, topLevelRule, errMsgProvider); + return altsAmbiguityErrors.concat(altsPrefixAmbiguityErrors); + }); + return errors; + } + function validateTooManyAlts(topLevelRule, errMsgProvider) { + const orCollector = new OrCollector(); + topLevelRule.accept(orCollector); + const ors = orCollector.alternations; + const errors = flatMap_default(ors, (currOr) => { + if (currOr.definition.length > 255) { + return [ + { + message: errMsgProvider.buildTooManyAlternativesError({ + topLevelRule, + alternation: currOr + }), + type: ParserDefinitionErrorType.TOO_MANY_ALTS, + ruleName: topLevelRule.name, + occurrence: currOr.idx + } + ]; + } else { + return []; + } + }); + return errors; + } + function validateSomeNonEmptyLookaheadPath(topLevelRules, maxLookahead, errMsgProvider) { + const errors = []; + forEach_default(topLevelRules, (currTopRule) => { + const collectorVisitor2 = new RepetitionCollector(); + currTopRule.accept(collectorVisitor2); + const allRuleProductions = collectorVisitor2.allProductions; + forEach_default(allRuleProductions, (currProd) => { + const prodType = getProdType(currProd); + const actualMaxLookahead = currProd.maxLookahead || maxLookahead; + const currOccurrence = currProd.idx; + const paths = getLookaheadPathsForOptionalProd(currOccurrence, currTopRule, prodType, actualMaxLookahead); + const pathsInsideProduction = paths[0]; + if (isEmpty_default(flatten_default(pathsInsideProduction))) { + const errMsg = errMsgProvider.buildEmptyRepetitionError({ + topLevelRule: currTopRule, + repetition: currProd + }); + errors.push({ + message: errMsg, + type: ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD, + ruleName: currTopRule.name + }); + } + }); + }); + return errors; + } + function checkAlternativesAmbiguities(alternatives, alternation2, rule, errMsgProvider) { + const foundAmbiguousPaths = []; + const identicalAmbiguities = reduce_default(alternatives, (result, currAlt, currAltIdx) => { + if (alternation2.definition[currAltIdx].ignoreAmbiguities === true) { + return result; + } + forEach_default(currAlt, (currPath) => { + const altsCurrPathAppearsIn = [currAltIdx]; + forEach_default(alternatives, (currOtherAlt, currOtherAltIdx) => { + if (currAltIdx !== currOtherAltIdx && containsPath(currOtherAlt, currPath) && // ignore (skip) ambiguities with this "other" alternative + alternation2.definition[currOtherAltIdx].ignoreAmbiguities !== true) { + altsCurrPathAppearsIn.push(currOtherAltIdx); + } + }); + if (altsCurrPathAppearsIn.length > 1 && !containsPath(foundAmbiguousPaths, currPath)) { + foundAmbiguousPaths.push(currPath); + result.push({ + alts: altsCurrPathAppearsIn, + path: currPath + }); + } + }); + return result; + }, []); + const currErrors = map_default(identicalAmbiguities, (currAmbDescriptor) => { + const ambgIndices = map_default(currAmbDescriptor.alts, (currAltIdx) => currAltIdx + 1); + const currMessage = errMsgProvider.buildAlternationAmbiguityError({ + topLevelRule: rule, + alternation: alternation2, + ambiguityIndices: ambgIndices, + prefixPath: currAmbDescriptor.path + }); return { - label: element2[0], - value: element2[1] + message: currMessage, + type: ParserDefinitionErrorType.AMBIGUOUS_ALTS, + ruleName: rule.name, + occurrence: alternation2.idx, + alternatives: currAmbDescriptor.alts }; - }).sort((a, b) => { - return b.value - a.value; }); - const pie2 = d3pie().value( - (d3Section) => d3Section.value - ); - return pie2(pieData); - }; - const draw$e = (text2, id2, _version, diagObj) => { - log$1.debug("rendering pie chart\n" + text2); - const db2 = diagObj.db; - const globalConfig = getConfig$1(); - const pieConfig = cleanAndMerge(db2.getConfig(), globalConfig.pie); - const MARGIN = 40; - const LEGEND_RECT_SIZE = 18; - const LEGEND_SPACING = 4; - const height = 450; - const pieWidth = height; - const svg2 = selectSvgElement(id2); - const group = svg2.append("g"); - const sections2 = db2.getSections(); - group.attr("transform", "translate(" + pieWidth / 2 + "," + height / 2 + ")"); - const { themeVariables } = globalConfig; - let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth); - outerStrokeWidth ?? (outerStrokeWidth = 2); - const textPosition = pieConfig.textPosition; - const radius = Math.min(pieWidth, height) / 2 - MARGIN; - const arcGenerator = d3arc().innerRadius(0).outerRadius(radius); - const labelArcGenerator = d3arc().innerRadius(radius * textPosition).outerRadius(radius * textPosition); - group.append("circle").attr("cx", 0).attr("cy", 0).attr("r", radius + outerStrokeWidth / 2).attr("class", "pieOuterCircle"); - const arcs = createPieArcs(sections2); - const myGeneratedColors = [ - themeVariables.pie1, - themeVariables.pie2, - themeVariables.pie3, - themeVariables.pie4, - themeVariables.pie5, - themeVariables.pie6, - themeVariables.pie7, - themeVariables.pie8, - themeVariables.pie9, - themeVariables.pie10, - themeVariables.pie11, - themeVariables.pie12 - ]; - const color2 = ordinal(myGeneratedColors); - group.selectAll("mySlices").data(arcs).enter().append("path").attr("d", arcGenerator).attr("fill", (datum2) => { - return color2(datum2.data.label); - }).attr("class", "pieCircle"); - let sum2 = 0; - Object.keys(sections2).forEach((key) => { - sum2 += sections2[key]; + return currErrors; + } + function checkPrefixAlternativesAmbiguities(alternatives, alternation2, rule, errMsgProvider) { + const pathsAndIndices = reduce_default(alternatives, (result, currAlt, idx) => { + const currPathsAndIdx = map_default(currAlt, (currPath) => { + return { idx, path: currPath }; + }); + return result.concat(currPathsAndIdx); + }, []); + const errors = compact_default(flatMap_default(pathsAndIndices, (currPathAndIdx) => { + const alternativeGast = alternation2.definition[currPathAndIdx.idx]; + if (alternativeGast.ignoreAmbiguities === true) { + return []; + } + const targetIdx = currPathAndIdx.idx; + const targetPath = currPathAndIdx.path; + const prefixAmbiguitiesPathsAndIndices = filter_default3(pathsAndIndices, (searchPathAndIdx) => { + return ( + // ignore (skip) ambiguities with this "other" alternative + alternation2.definition[searchPathAndIdx.idx].ignoreAmbiguities !== true && searchPathAndIdx.idx < targetIdx && // checking for strict prefix because identical lookaheads + // will be be detected using a different validation. + isStrictPrefixOfPath(searchPathAndIdx.path, targetPath) + ); + }); + const currPathPrefixErrors = map_default(prefixAmbiguitiesPathsAndIndices, (currAmbPathAndIdx) => { + const ambgIndices = [currAmbPathAndIdx.idx + 1, targetIdx + 1]; + const occurrence = alternation2.idx === 0 ? "" : alternation2.idx; + const message = errMsgProvider.buildAlternationPrefixAmbiguityError({ + topLevelRule: rule, + alternation: alternation2, + ambiguityIndices: ambgIndices, + prefixPath: currAmbPathAndIdx.path + }); + return { + message, + type: ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS, + ruleName: rule.name, + occurrence, + alternatives: ambgIndices + }; + }); + return currPathPrefixErrors; + })); + return errors; + } + function checkTerminalAndNoneTerminalsNameSpace(topLevels, tokenTypes, errMsgProvider) { + const errors = []; + const tokenNames = map_default(tokenTypes, (currToken) => currToken.name); + forEach_default(topLevels, (currRule) => { + const currRuleName = currRule.name; + if (includes_default(tokenNames, currRuleName)) { + const errMsg = errMsgProvider.buildNamespaceConflictError(currRule); + errors.push({ + message: errMsg, + type: ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE, + ruleName: currRuleName + }); + } }); - group.selectAll("mySlices").data(arcs).enter().append("text").text((datum2) => { - return (datum2.data.value / sum2 * 100).toFixed(0) + "%"; - }).attr("transform", (datum2) => { - return "translate(" + labelArcGenerator.centroid(datum2) + ")"; - }).style("text-anchor", "middle").attr("class", "slice"); - group.append("text").text(db2.getDiagramTitle()).attr("x", 0).attr("y", -(height - 50) / 2).attr("class", "pieTitleText"); - const legend = group.selectAll(".legend").data(color2.domain()).enter().append("g").attr("class", "legend").attr("transform", (_datum, index2) => { - const height2 = LEGEND_RECT_SIZE + LEGEND_SPACING; - const offset = height2 * color2.domain().length / 2; - const horizontal = 12 * LEGEND_RECT_SIZE; - const vertical = index2 * height2 - offset; - return "translate(" + horizontal + "," + vertical + ")"; + return errors; + } + var OccurrenceValidationCollector, OrCollector, RepetitionCollector; + var init_checks = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/checks.js"() { + "use strict"; + init_lodash(); + init_parser(); + init_api3(); + init_lookahead(); + init_interpreter(); + init_tokens(); + __name(validateLookahead, "validateLookahead"); + __name(validateGrammar, "validateGrammar"); + __name(validateDuplicateProductions, "validateDuplicateProductions"); + __name(identifyProductionForDuplicates, "identifyProductionForDuplicates"); + __name(getExtraProductionArgument, "getExtraProductionArgument"); + OccurrenceValidationCollector = class extends GAstVisitor { + static { + __name(this, "OccurrenceValidationCollector"); + } + constructor() { + super(...arguments); + this.allProductions = []; + } + visitNonTerminal(subrule) { + this.allProductions.push(subrule); + } + visitOption(option2) { + this.allProductions.push(option2); + } + visitRepetitionWithSeparator(manySep) { + this.allProductions.push(manySep); + } + visitRepetitionMandatory(atLeastOne) { + this.allProductions.push(atLeastOne); + } + visitRepetitionMandatoryWithSeparator(atLeastOneSep) { + this.allProductions.push(atLeastOneSep); + } + visitRepetition(many) { + this.allProductions.push(many); + } + visitAlternation(or) { + this.allProductions.push(or); + } + visitTerminal(terminal) { + this.allProductions.push(terminal); + } + }; + __name(validateRuleDoesNotAlreadyExist, "validateRuleDoesNotAlreadyExist"); + __name(validateRuleIsOverridden, "validateRuleIsOverridden"); + __name(validateNoLeftRecursion, "validateNoLeftRecursion"); + __name(getFirstNoneTerminal, "getFirstNoneTerminal"); + OrCollector = class extends GAstVisitor { + static { + __name(this, "OrCollector"); + } + constructor() { + super(...arguments); + this.alternations = []; + } + visitAlternation(node2) { + this.alternations.push(node2); + } + }; + __name(validateEmptyOrAlternative, "validateEmptyOrAlternative"); + __name(validateAmbiguousAlternationAlternatives, "validateAmbiguousAlternationAlternatives"); + RepetitionCollector = class extends GAstVisitor { + static { + __name(this, "RepetitionCollector"); + } + constructor() { + super(...arguments); + this.allProductions = []; + } + visitRepetitionWithSeparator(manySep) { + this.allProductions.push(manySep); + } + visitRepetitionMandatory(atLeastOne) { + this.allProductions.push(atLeastOne); + } + visitRepetitionMandatoryWithSeparator(atLeastOneSep) { + this.allProductions.push(atLeastOneSep); + } + visitRepetition(many) { + this.allProductions.push(many); + } + }; + __name(validateTooManyAlts, "validateTooManyAlts"); + __name(validateSomeNonEmptyLookaheadPath, "validateSomeNonEmptyLookaheadPath"); + __name(checkAlternativesAmbiguities, "checkAlternativesAmbiguities"); + __name(checkPrefixAlternativesAmbiguities, "checkPrefixAlternativesAmbiguities"); + __name(checkTerminalAndNoneTerminalsNameSpace, "checkTerminalAndNoneTerminalsNameSpace"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js + function resolveGrammar2(options3) { + const actualOptions = defaults_default(options3, { + errMsgProvider: defaultGrammarResolverErrorProvider }); - legend.append("rect").attr("width", LEGEND_RECT_SIZE).attr("height", LEGEND_RECT_SIZE).style("fill", color2).style("stroke", color2); - legend.data(arcs).append("text").attr("x", LEGEND_RECT_SIZE + LEGEND_SPACING).attr("y", LEGEND_RECT_SIZE - LEGEND_SPACING).text((datum2) => { - const { label, value: value2 } = datum2.data; - if (db2.getShowData()) { - return `${label} [${value2}]`; - } - return label; + const topRulesTable = {}; + forEach_default(options3.rules, (rule) => { + topRulesTable[rule.name] = rule; }); - const longestTextWidth = Math.max( - ...legend.selectAll("text").nodes().map((node2) => (node2 == null ? void 0 : node2.getBoundingClientRect().width) ?? 0) - ); - const totalWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth; - svg2.attr("viewBox", `0 0 ${totalWidth} ${height}`); - configureSvgSize(svg2, height, totalWidth, pieConfig.useMaxWidth); - }; - const renderer$e = { draw: draw$e }; - const diagram$e = { - parser: parser$n, - db: db$d, - renderer: renderer$e, - styles: styles$8 - }; - const pieDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$e - }, Symbol.toStringTag, { value: "Module" })); - var parser$k = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [1, 7], $V5 = [1, 5, 13, 15, 17, 19, 20, 25, 27, 28, 29, 30, 31, 32, 33, 34, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], $V6 = [1, 5, 6, 13, 15, 17, 19, 20, 25, 27, 28, 29, 30, 31, 32, 33, 34, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], $V7 = [32, 33, 34], $V8 = [2, 7], $V9 = [1, 13], $Va = [1, 17], $Vb = [1, 18], $Vc = [1, 19], $Vd = [1, 20], $Ve = [1, 21], $Vf = [1, 22], $Vg = [1, 23], $Vh = [1, 24], $Vi = [1, 25], $Vj = [1, 26], $Vk = [1, 27], $Vl = [1, 30], $Vm = [1, 31], $Vn = [1, 32], $Vo = [1, 33], $Vp = [1, 34], $Vq = [1, 35], $Vr = [1, 36], $Vs = [1, 37], $Vt = [1, 38], $Vu = [1, 39], $Vv = [1, 40], $Vw = [1, 41], $Vx = [1, 42], $Vy = [1, 57], $Vz = [1, 58], $VA = [5, 22, 26, 32, 33, 34, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "eol": 4, "SPACE": 5, "QUADRANT": 6, "document": 7, "line": 8, "statement": 9, "axisDetails": 10, "quadrantDetails": 11, "points": 12, "title": 13, "title_value": 14, "acc_title": 15, "acc_title_value": 16, "acc_descr": 17, "acc_descr_value": 18, "acc_descr_multiline_value": 19, "section": 20, "text": 21, "point_start": 22, "point_x": 23, "point_y": 24, "X-AXIS": 25, "AXIS-TEXT-DELIMITER": 26, "Y-AXIS": 27, "QUADRANT_1": 28, "QUADRANT_2": 29, "QUADRANT_3": 30, "QUADRANT_4": 31, "NEWLINE": 32, "SEMI": 33, "EOF": 34, "alphaNumToken": 35, "textNoTagsToken": 36, "STR": 37, "MD_STR": 38, "alphaNum": 39, "PUNCTUATION": 40, "AMP": 41, "NUM": 42, "ALPHA": 43, "COMMA": 44, "PLUS": 45, "EQUALS": 46, "MULT": 47, "DOT": 48, "BRKT": 49, "UNDERSCORE": 50, "MINUS": 51, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 5: "SPACE", 6: "QUADRANT", 13: "title", 14: "title_value", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 22: "point_start", 23: "point_x", 24: "point_y", 25: "X-AXIS", 26: "AXIS-TEXT-DELIMITER", 27: "Y-AXIS", 28: "QUADRANT_1", 29: "QUADRANT_2", 30: "QUADRANT_3", 31: "QUADRANT_4", 32: "NEWLINE", 33: "SEMI", 34: "EOF", 37: "STR", 38: "MD_STR", 40: "PUNCTUATION", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "COMMA", 45: "PLUS", 46: "EQUALS", 47: "MULT", 48: "DOT", 49: "BRKT", 50: "UNDERSCORE", 51: "MINUS" }, - productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [9, 0], [9, 2], [9, 1], [9, 1], [9, 1], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [12, 4], [10, 4], [10, 3], [10, 2], [10, 4], [10, 3], [10, 2], [11, 2], [11, 2], [11, 2], [11, 2], [4, 1], [4, 1], [4, 1], [21, 1], [21, 2], [21, 1], [21, 1], [39, 1], [39, 2], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [36, 1], [36, 1], [36, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 12: - this.$ = $$[$0].trim(); - yy.setDiagramTitle(this.$); - break; - case 13: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 14: - case 15: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 16: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 17: - yy.addPoint($$[$0 - 3], $$[$0 - 1], $$[$0]); - break; - case 18: - yy.setXAxisLeftText($$[$0 - 2]); - yy.setXAxisRightText($$[$0]); - break; - case 19: - $$[$0 - 1].text += " ⟶ "; - yy.setXAxisLeftText($$[$0 - 1]); - break; - case 20: - yy.setXAxisLeftText($$[$0]); - break; - case 21: - yy.setYAxisBottomText($$[$0 - 2]); - yy.setYAxisTopText($$[$0]); - break; - case 22: - $$[$0 - 1].text += " ⟶ "; - yy.setYAxisBottomText($$[$0 - 1]); - break; - case 23: - yy.setYAxisBottomText($$[$0]); - break; - case 24: - yy.setQuadrant1Text($$[$0]); - break; - case 25: - yy.setQuadrant2Text($$[$0]); - break; - case 26: - yy.setQuadrant3Text($$[$0]); - break; - case 27: - yy.setQuadrant4Text($$[$0]); - break; - case 31: - this.$ = { text: $$[$0], type: "text" }; - break; - case 32: - this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; - break; - case 33: - this.$ = { text: $$[$0], type: "text" }; - break; - case 34: - this.$ = { text: $$[$0], type: "markdown" }; - break; - case 35: - this.$ = $$[$0]; - break; - case 36: - this.$ = $$[$0 - 1] + "" + $$[$0]; - break; + return resolveGrammar(topRulesTable, actualOptions.errMsgProvider); + } + function validateGrammar2(options3) { + options3 = defaults_default(options3, { + errMsgProvider: defaultGrammarValidatorErrorProvider + }); + return validateGrammar(options3.rules, options3.tokenTypes, options3.errMsgProvider, options3.grammarName); + } + var init_gast_resolver_public = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js"() { + "use strict"; + init_lodash(); + init_resolver(); + init_checks(); + init_errors_public(); + __name(resolveGrammar2, "resolveGrammar"); + __name(validateGrammar2, "validateGrammar"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/exceptions_public.js + function isRecognitionException(error3) { + return includes_default(RECOGNITION_EXCEPTION_NAMES, error3.name); + } + var MISMATCHED_TOKEN_EXCEPTION, NO_VIABLE_ALT_EXCEPTION, EARLY_EXIT_EXCEPTION, NOT_ALL_INPUT_PARSED_EXCEPTION, RECOGNITION_EXCEPTION_NAMES, RecognitionException, MismatchedTokenException, NoViableAltException, NotAllInputParsedException, EarlyExitException; + var init_exceptions_public = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/exceptions_public.js"() { + "use strict"; + init_lodash(); + MISMATCHED_TOKEN_EXCEPTION = "MismatchedTokenException"; + NO_VIABLE_ALT_EXCEPTION = "NoViableAltException"; + EARLY_EXIT_EXCEPTION = "EarlyExitException"; + NOT_ALL_INPUT_PARSED_EXCEPTION = "NotAllInputParsedException"; + RECOGNITION_EXCEPTION_NAMES = [ + MISMATCHED_TOKEN_EXCEPTION, + NO_VIABLE_ALT_EXCEPTION, + EARLY_EXIT_EXCEPTION, + NOT_ALL_INPUT_PARSED_EXCEPTION + ]; + Object.freeze(RECOGNITION_EXCEPTION_NAMES); + __name(isRecognitionException, "isRecognitionException"); + RecognitionException = class extends Error { + static { + __name(this, "RecognitionException"); } - }, - table: [{ 3: 1, 4: 2, 5: $V0, 6: $V1, 32: $V2, 33: $V3, 34: $V4 }, { 1: [3] }, { 3: 8, 4: 2, 5: $V0, 6: $V1, 32: $V2, 33: $V3, 34: $V4 }, { 3: 9, 4: 2, 5: $V0, 6: $V1, 32: $V2, 33: $V3, 34: $V4 }, o($V5, [2, 4], { 7: 10 }), o($V6, [2, 28]), o($V6, [2, 29]), o($V6, [2, 30]), { 1: [2, 1] }, { 1: [2, 2] }, o($V7, $V8, { 8: 11, 9: 12, 10: 14, 11: 15, 12: 16, 21: 28, 35: 29, 1: [2, 3], 5: $V9, 13: $Va, 15: $Vb, 17: $Vc, 19: $Vd, 20: $Ve, 25: $Vf, 27: $Vg, 28: $Vh, 29: $Vi, 30: $Vj, 31: $Vk, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }), o($V5, [2, 5]), { 4: 43, 32: $V2, 33: $V3, 34: $V4 }, o($V7, $V8, { 10: 14, 11: 15, 12: 16, 21: 28, 35: 29, 9: 44, 5: $V9, 13: $Va, 15: $Vb, 17: $Vc, 19: $Vd, 20: $Ve, 25: $Vf, 27: $Vg, 28: $Vh, 29: $Vi, 30: $Vj, 31: $Vk, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }), o($V7, [2, 9]), o($V7, [2, 10]), o($V7, [2, 11]), { 14: [1, 45] }, { 16: [1, 46] }, { 18: [1, 47] }, o($V7, [2, 15]), o($V7, [2, 16]), { 21: 48, 35: 29, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }, { 21: 49, 35: 29, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }, { 21: 50, 35: 29, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }, { 21: 51, 35: 29, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }, { 21: 52, 35: 29, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }, { 21: 53, 35: 29, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }, { 5: $Vy, 22: [1, 54], 35: 56, 36: 55, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }, o($VA, [2, 31]), o($VA, [2, 33]), o($VA, [2, 34]), o($VA, [2, 37]), o($VA, [2, 38]), o($VA, [2, 39]), o($VA, [2, 40]), o($VA, [2, 41]), o($VA, [2, 42]), o($VA, [2, 43]), o($VA, [2, 44]), o($VA, [2, 45]), o($VA, [2, 46]), o($VA, [2, 47]), o($V5, [2, 6]), o($V7, [2, 8]), o($V7, [2, 12]), o($V7, [2, 13]), o($V7, [2, 14]), o($V7, [2, 20], { 36: 55, 35: 56, 5: $Vy, 26: [1, 59], 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), o($V7, [2, 23], { 36: 55, 35: 56, 5: $Vy, 26: [1, 60], 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), o($V7, [2, 24], { 36: 55, 35: 56, 5: $Vy, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), o($V7, [2, 25], { 36: 55, 35: 56, 5: $Vy, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), o($V7, [2, 26], { 36: 55, 35: 56, 5: $Vy, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), o($V7, [2, 27], { 36: 55, 35: 56, 5: $Vy, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), { 23: [1, 61] }, o($VA, [2, 32]), o($VA, [2, 48]), o($VA, [2, 49]), o($VA, [2, 50]), o($V7, [2, 19], { 35: 29, 21: 62, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }), o($V7, [2, 22], { 35: 29, 21: 63, 37: $Vl, 38: $Vm, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx }), { 24: [1, 64] }, o($V7, [2, 18], { 36: 55, 35: 56, 5: $Vy, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), o($V7, [2, 21], { 36: 55, 35: 56, 5: $Vy, 40: $Vn, 41: $Vo, 42: $Vp, 43: $Vq, 44: $Vr, 45: $Vs, 46: $Vt, 47: $Vu, 48: $Vv, 49: $Vw, 50: $Vx, 51: $Vz }), o($V7, [2, 17])], - defaultActions: { 8: [2, 1], 9: [2, 2] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + constructor(message, token2) { + super(message); + this.token = token2; + this.resyncedTokens = []; + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + }; + MismatchedTokenException = class extends RecognitionException { + static { + __name(this, "MismatchedTokenException"); } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; + constructor(message, token2, previousToken) { + super(message, token2); + this.previousToken = previousToken; + this.name = MISMATCHED_TOKEN_EXCEPTION; + } + }; + NoViableAltException = class extends RecognitionException { + static { + __name(this, "NoViableAltException"); + } + constructor(message, token2, previousToken) { + super(message, token2); + this.previousToken = previousToken; + this.name = NO_VIABLE_ALT_EXCEPTION; + } + }; + NotAllInputParsedException = class extends RecognitionException { + static { + __name(this, "NotAllInputParsedException"); + } + constructor(message, token2) { + super(message, token2); + this.name = NOT_ALL_INPUT_PARSED_EXCEPTION; + } + }; + EarlyExitException = class extends RecognitionException { + static { + __name(this, "EarlyExitException"); + } + constructor(message, token2, previousToken) { + super(message, token2); + this.previousToken = previousToken; + this.name = EARLY_EXIT_EXCEPTION; + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js + function attemptInRepetitionRecovery(prodFunc, args, lookaheadFunc, dslMethodIdx, prodOccurrence, nextToksWalker, notStuck) { + const key = this.getKeyForAutomaticLookahead(dslMethodIdx, prodOccurrence); + let firstAfterRepInfo = this.firstAfterRepMap[key]; + if (firstAfterRepInfo === void 0) { + const currRuleName = this.getCurrRuleFullName(); + const ruleGrammar = this.getGAstProductions()[currRuleName]; + const walker = new nextToksWalker(ruleGrammar, prodOccurrence); + firstAfterRepInfo = walker.startWalking(); + this.firstAfterRepMap[key] = firstAfterRepInfo; + } + let expectTokAfterLastMatch = firstAfterRepInfo.token; + let nextTokIdx = firstAfterRepInfo.occurrence; + const isEndOfRule = firstAfterRepInfo.isEndOfRule; + if (this.RULE_STACK.length === 1 && isEndOfRule && expectTokAfterLastMatch === void 0) { + expectTokAfterLastMatch = EOF; + nextTokIdx = 1; + } + if (expectTokAfterLastMatch === void 0 || nextTokIdx === void 0) { + return; + } + if (this.shouldInRepetitionRecoveryBeTried(expectTokAfterLastMatch, nextTokIdx, notStuck)) { + this.tryInRepetitionRecovery(prodFunc, args, lookaheadFunc, expectTokAfterLastMatch); + } + } + var EOF_FOLLOW_KEY, IN_RULE_RECOVERY_EXCEPTION, InRuleRecoveryException, Recoverable; + var init_recoverable = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js"() { + "use strict"; + init_tokens_public(); + init_lodash(); + init_exceptions_public(); + init_constants2(); + init_parser(); + EOF_FOLLOW_KEY = {}; + IN_RULE_RECOVERY_EXCEPTION = "InRuleRecoveryException"; + InRuleRecoveryException = class extends Error { + static { + __name(this, "InRuleRecoveryException"); + } + constructor(message) { + super(message); + this.name = IN_RULE_RECOVERY_EXCEPTION; + } + }; + Recoverable = class { + static { + __name(this, "Recoverable"); + } + initRecoverable(config6) { + this.firstAfterRepMap = {}; + this.resyncFollows = {}; + this.recoveryEnabled = has_default(config6, "recoveryEnabled") ? config6.recoveryEnabled : DEFAULT_PARSER_CONFIG.recoveryEnabled; + if (this.recoveryEnabled) { + this.attemptInRepetitionRecovery = attemptInRepetitionRecovery; } - return token2; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + getTokenToInsert(tokType) { + const tokToInsert = createTokenInstance(tokType, "", NaN, NaN, NaN, NaN, NaN, NaN); + tokToInsert.isInsertedInRecovery = true; + return tokToInsert; + } + canTokenTypeBeInsertedInRecovery(tokType) { + return true; + } + canTokenTypeBeDeletedInRecovery(tokType) { + return true; + } + tryInRepetitionRecovery(grammarRule, grammarRuleArgs, lookAheadFunc, expectedTokType) { + const reSyncTokType = this.findReSyncTokenType(); + const savedLexerState = this.exportLexerState(); + const resyncedTokens = []; + let passedResyncPoint = false; + const nextTokenWithoutResync = this.LA(1); + let currToken = this.LA(1); + const generateErrorMessage = /* @__PURE__ */ __name(() => { + const previousToken = this.LA(0); + const msg = this.errorMessageProvider.buildMismatchTokenMessage({ + expected: expectedTokType, + actual: nextTokenWithoutResync, + previous: previousToken, + ruleName: this.getCurrRuleFullName() + }); + const error3 = new MismatchedTokenException(msg, nextTokenWithoutResync, this.LA(0)); + error3.resyncedTokens = dropRight_default(resyncedTokens); + this.SAVE_ERROR(error3); + }, "generateErrorMessage"); + while (!passedResyncPoint) { + if (this.tokenMatcher(currToken, expectedTokType)) { + generateErrorMessage(); + return; + } else if (lookAheadFunc.call(this)) { + generateErrorMessage(); + grammarRule.apply(this, grammarRuleArgs); + return; + } else if (this.tokenMatcher(currToken, reSyncTokType)) { + passedResyncPoint = true; + } else { + currToken = this.SKIP_TOKEN(); + this.addToResyncTokens(currToken, resyncedTokens); } - action = table[state2] && table[state2][symbol]; } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); + this.importLexerState(savedLexerState); + } + shouldInRepetitionRecoveryBeTried(expectTokAfterLastMatch, nextTokIdx, notStuck) { + if (notStuck === false) { + return false; } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + if (this.tokenMatcher(this.LA(1), expectTokAfterLastMatch)) { + return false; } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + if (this.isBackTracking()) { + return false; } + if (this.canPerformInRuleRecovery(expectTokAfterLastMatch, this.getFollowsForInRuleRecovery(expectTokAfterLastMatch, nextTokIdx))) { + return false; + } + return true; } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + // Error Recovery functionality + getFollowsForInRuleRecovery(tokType, tokIdxInRule) { + const grammarPath = this.getCurrentGrammarPath(tokType, tokIdxInRule); + const follows = this.getNextPossibleTokenTypes(grammarPath); + return follows; + } + tryInRuleRecovery(expectedTokType, follows) { + if (this.canRecoverWithSingleTokenInsertion(expectedTokType, follows)) { + const tokToInsert = this.getTokenToInsert(expectedTokType); + return tokToInsert; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + if (this.canRecoverWithSingleTokenDeletion(expectedTokType)) { + const nextTok = this.SKIP_TOKEN(); + this.consumeToken(); + return nextTok; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; + throw new InRuleRecoveryException("sad sad panda"); + } + canPerformInRuleRecovery(expectedToken, follows) { + return this.canRecoverWithSingleTokenInsertion(expectedToken, follows) || this.canRecoverWithSingleTokenDeletion(expectedToken); + } + canRecoverWithSingleTokenInsertion(expectedTokType, follows) { + if (!this.canTokenTypeBeInsertedInRecovery(expectedTokType)) { + return false; } - if (this.options.ranges) { - this.yylloc.range[1]++; + if (isEmpty_default(follows)) { + return false; } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + const mismatchedTok = this.LA(1); + const isMisMatchedTokInFollows = find_default(follows, (possibleFollowsTokType) => { + return this.tokenMatcher(mismatchedTok, possibleFollowsTokType); + }) !== void 0; + return isMisMatchedTokInFollows; + } + canRecoverWithSingleTokenDeletion(expectedTokType) { + if (!this.canTokenTypeBeDeletedInRecovery(expectedTokType)) { + return false; } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno + const isNextTokenWhatIsExpected = this.tokenMatcher(this.LA(2), expectedTokType); + return isNextTokenWhatIsExpected; + } + isInCurrentRuleReSyncSet(tokenTypeIdx) { + const followKey = this.getCurrFollowKey(); + const currentRuleReSyncSet = this.getFollowSetFromFollowKey(followKey); + return includes_default(currentRuleReSyncSet, tokenTypeIdx); + } + findReSyncTokenType() { + const allPossibleReSyncTokTypes = this.flattenFollowSet(); + let nextToken = this.LA(1); + let k2 = 2; + while (true) { + const foundMatch = find_default(allPossibleReSyncTokTypes, (resyncTokType) => { + const canMatch = tokenMatcher(nextToken, resyncTokType); + return canMatch; }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + if (foundMatch !== void 0) { + return foundMatch; } + nextToken = this.LA(k2); + k2++; } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + } + getCurrFollowKey() { + if (this.RULE_STACK.length === 1) { + return EOF_FOLLOW_KEY; } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length + const currRuleShortName = this.getLastExplicitRuleShortName(); + const currRuleIdx = this.getLastExplicitRuleOccurrenceIndex(); + const prevRuleShortName = this.getPreviousExplicitRuleShortName(); + return { + ruleName: this.shortRuleNameToFullName(currRuleShortName), + idxInCallingRule: currRuleIdx, + inRule: this.shortRuleNameToFullName(prevRuleShortName) }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + } + buildFullFollowKeyStack() { + const explicitRuleStack = this.RULE_STACK; + const explicitOccurrenceStack = this.RULE_OCCURRENCE_STACK; + return map_default(explicitRuleStack, (ruleName, idx) => { + if (idx === 0) { + return EOF_FOLLOW_KEY; } - return false; + return { + ruleName: this.shortRuleNameToFullName(ruleName), + idxInCallingRule: explicitOccurrenceStack[idx], + inRule: this.shortRuleNameToFullName(explicitRuleStack[idx - 1]) + }; + }); + } + flattenFollowSet() { + const followStack = map_default(this.buildFullFollowKeyStack(), (currKey) => { + return this.getFollowSetFromFollowKey(currKey); + }); + return flatten_default(followStack); + } + getFollowSetFromFollowKey(followKey) { + if (followKey === EOF_FOLLOW_KEY) { + return [EOF]; + } + const followName = followKey.ruleName + followKey.idxInCallingRule + IN + followKey.inRule; + return this.resyncFollows[followName]; + } + // It does not make any sense to include a virtual EOF token in the list of resynced tokens + // as EOF does not really exist and thus does not contain any useful information (line/column numbers) + addToResyncTokens(token2, resyncTokens) { + if (!this.tokenMatcher(token2, EOF)) { + resyncTokens.push(token2); + } + return resyncTokens; + } + reSyncTo(tokType) { + const resyncedTokens = []; + let nextTok = this.LA(1); + while (this.tokenMatcher(nextTok, tokType) === false) { + nextTok = this.SKIP_TOKEN(); + this.addToResyncTokens(nextTok, resyncedTokens); + } + return dropRight_default(resyncedTokens); + } + attemptInRepetitionRecovery(prodFunc, args, lookaheadFunc, dslMethodIdx, prodOccurrence, nextToksWalker, notStuck) { + } + getCurrentGrammarPath(tokType, tokIdxInRule) { + const pathRuleStack = this.getHumanReadableRuleStack(); + const pathOccurrenceStack = clone_default2(this.RULE_OCCURRENCE_STACK); + const grammarPath = { + ruleStack: pathRuleStack, + occurrenceStack: pathOccurrenceStack, + lastTok: tokType, + lastTokOccurrence: tokIdxInRule + }; + return grammarPath; + } + getHumanReadableRuleStack() { + return map_default(this.RULE_STACK, (currShortName) => this.shortRuleNameToFullName(currShortName)); + } + }; + __name(attemptInRepetitionRecovery, "attemptInRepetitionRecovery"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/keys.js + function getKeyForAutomaticLookahead(ruleIdx, dslMethodIdx, occurrence) { + return occurrence | dslMethodIdx | ruleIdx; + } + var BITS_FOR_METHOD_TYPE, BITS_FOR_OCCURRENCE_IDX, BITS_FOR_ALT_IDX, OR_IDX, OPTION_IDX, MANY_IDX, AT_LEAST_ONE_IDX, MANY_SEP_IDX, AT_LEAST_ONE_SEP_IDX, BITS_START_FOR_ALT_IDX; + var init_keys2 = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/keys.js"() { + "use strict"; + BITS_FOR_METHOD_TYPE = 4; + BITS_FOR_OCCURRENCE_IDX = 8; + BITS_FOR_ALT_IDX = 8; + OR_IDX = 1 << BITS_FOR_OCCURRENCE_IDX; + OPTION_IDX = 2 << BITS_FOR_OCCURRENCE_IDX; + MANY_IDX = 3 << BITS_FOR_OCCURRENCE_IDX; + AT_LEAST_ONE_IDX = 4 << BITS_FOR_OCCURRENCE_IDX; + MANY_SEP_IDX = 5 << BITS_FOR_OCCURRENCE_IDX; + AT_LEAST_ONE_SEP_IDX = 6 << BITS_FOR_OCCURRENCE_IDX; + __name(getKeyForAutomaticLookahead, "getKeyForAutomaticLookahead"); + BITS_START_FOR_ALT_IDX = 32 - BITS_FOR_ALT_IDX; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js + var LLkLookaheadStrategy; + var init_llk_lookahead = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js"() { + "use strict"; + init_lodash(); + init_errors_public(); + init_parser(); + init_checks(); + init_lookahead(); + LLkLookaheadStrategy = class { + static { + __name(this, "LLkLookaheadStrategy"); + } + constructor(options3) { + var _a; + this.maxLookahead = (_a = options3 === null || options3 === void 0 ? void 0 : options3.maxLookahead) !== null && _a !== void 0 ? _a : DEFAULT_PARSER_CONFIG.maxLookahead; + } + validate(options3) { + const leftRecursionErrors = this.validateNoLeftRecursion(options3.rules); + if (isEmpty_default(leftRecursionErrors)) { + const emptyAltErrors = this.validateEmptyOrAlternatives(options3.rules); + const ambiguousAltsErrors = this.validateAmbiguousAlternationAlternatives(options3.rules, this.maxLookahead); + const emptyRepetitionErrors = this.validateSomeNonEmptyLookaheadPath(options3.rules, this.maxLookahead); + const allErrors = [ + ...leftRecursionErrors, + ...emptyAltErrors, + ...ambiguousAltsErrors, + ...emptyRepetitionErrors + ]; + return allErrors; } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno + return leftRecursionErrors; + } + validateNoLeftRecursion(rules) { + return flatMap_default(rules, (currTopRule) => validateNoLeftRecursion(currTopRule, currTopRule, defaultGrammarValidatorErrorProvider)); + } + validateEmptyOrAlternatives(rules) { + return flatMap_default(rules, (currTopRule) => validateEmptyOrAlternative(currTopRule, defaultGrammarValidatorErrorProvider)); + } + validateAmbiguousAlternationAlternatives(rules, maxLookahead) { + return flatMap_default(rules, (currTopRule) => validateAmbiguousAlternationAlternatives(currTopRule, maxLookahead, defaultGrammarValidatorErrorProvider)); + } + validateSomeNonEmptyLookaheadPath(rules, maxLookahead) { + return validateSomeNonEmptyLookaheadPath(rules, maxLookahead, defaultGrammarValidatorErrorProvider); + } + buildLookaheadForAlternation(options3) { + return buildLookaheadFuncForOr(options3.prodOccurrence, options3.rule, options3.maxLookahead, options3.hasPredicates, options3.dynamicTokensEnabled, buildAlternativesLookAheadFunc); + } + buildLookaheadForOptional(options3) { + return buildLookaheadFuncForOptionalProd(options3.prodOccurrence, options3.rule, options3.maxLookahead, options3.dynamicTokensEnabled, getProdType(options3.prodType), buildSingleAlternativeLookaheadFunction); + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js + function collectMethods(rule) { + collectorVisitor.reset(); + rule.accept(collectorVisitor); + const dslMethods = collectorVisitor.dslMethods; + collectorVisitor.reset(); + return dslMethods; + } + var LooksAhead, DslMethodsCollectorVisitor, collectorVisitor; + var init_looksahead = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js"() { + "use strict"; + init_lodash(); + init_parser(); + init_keys2(); + init_api3(); + init_llk_lookahead(); + LooksAhead = class { + static { + __name(this, "LooksAhead"); + } + initLooksAhead(config6) { + this.dynamicTokensEnabled = has_default(config6, "dynamicTokensEnabled") ? config6.dynamicTokensEnabled : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled; + this.maxLookahead = has_default(config6, "maxLookahead") ? config6.maxLookahead : DEFAULT_PARSER_CONFIG.maxLookahead; + this.lookaheadStrategy = has_default(config6, "lookaheadStrategy") ? config6.lookaheadStrategy : new LLkLookaheadStrategy({ maxLookahead: this.maxLookahead }); + this.lookAheadFuncsCache = /* @__PURE__ */ new Map(); + } + preComputeLookaheadFunctions(rules) { + forEach_default(rules, (currRule) => { + this.TRACE_INIT(`${currRule.name} Rule Lookahead`, () => { + const { alternation: alternation2, repetition: repetition2, option: option2, repetitionMandatory: repetitionMandatory2, repetitionMandatoryWithSeparator, repetitionWithSeparator } = collectMethods(currRule); + forEach_default(alternation2, (currProd) => { + const prodIdx = currProd.idx === 0 ? "" : currProd.idx; + this.TRACE_INIT(`${getProductionDslName(currProd)}${prodIdx}`, () => { + const laFunc = this.lookaheadStrategy.buildLookaheadForAlternation({ + prodOccurrence: currProd.idx, + rule: currRule, + maxLookahead: currProd.maxLookahead || this.maxLookahead, + hasPredicates: currProd.hasPredicates, + dynamicTokensEnabled: this.dynamicTokensEnabled + }); + const key = getKeyForAutomaticLookahead(this.fullRuleNameToShort[currRule.name], OR_IDX, currProd.idx); + this.setLaFuncCache(key, laFunc); + }); + }); + forEach_default(repetition2, (currProd) => { + this.computeLookaheadFunc(currRule, currProd.idx, MANY_IDX, "Repetition", currProd.maxLookahead, getProductionDslName(currProd)); + }); + forEach_default(option2, (currProd) => { + this.computeLookaheadFunc(currRule, currProd.idx, OPTION_IDX, "Option", currProd.maxLookahead, getProductionDslName(currProd)); + }); + forEach_default(repetitionMandatory2, (currProd) => { + this.computeLookaheadFunc(currRule, currProd.idx, AT_LEAST_ONE_IDX, "RepetitionMandatory", currProd.maxLookahead, getProductionDslName(currProd)); + }); + forEach_default(repetitionMandatoryWithSeparator, (currProd) => { + this.computeLookaheadFunc(currRule, currProd.idx, AT_LEAST_ONE_SEP_IDX, "RepetitionMandatoryWithSeparator", currProd.maxLookahead, getProductionDslName(currProd)); + }); + forEach_default(repetitionWithSeparator, (currProd) => { + this.computeLookaheadFunc(currRule, currProd.idx, MANY_SEP_IDX, "RepetitionWithSeparator", currProd.maxLookahead, getProductionDslName(currProd)); + }); }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; + }); + } + computeLookaheadFunc(rule, prodOccurrence, prodKey, prodType, prodMaxLookahead, dslMethodName) { + this.TRACE_INIT(`${dslMethodName}${prodOccurrence === 0 ? "" : prodOccurrence}`, () => { + const laFunc = this.lookaheadStrategy.buildLookaheadForOptional({ + prodOccurrence, + rule, + maxLookahead: prodMaxLookahead || this.maxLookahead, + dynamicTokensEnabled: this.dynamicTokensEnabled, + prodType + }); + const key = getKeyForAutomaticLookahead(this.fullRuleNameToShort[rule.name], prodKey, prodOccurrence); + this.setLaFuncCache(key, laFunc); + }); + } + // this actually returns a number, but it is always used as a string (object prop key) + getKeyForAutomaticLookahead(dslMethodIdx, occurrence) { + const currRuleShortName = this.getLastExplicitRuleShortName(); + return getKeyForAutomaticLookahead(currRuleShortName, dslMethodIdx, occurrence); + } + getLaFuncFromCache(key) { + return this.lookAheadFuncsCache.get(key); + } + /* istanbul ignore next */ + setLaFuncCache(key, value2) { + this.lookAheadFuncsCache.set(key, value2); + } + }; + DslMethodsCollectorVisitor = class extends GAstVisitor { + static { + __name(this, "DslMethodsCollectorVisitor"); + } + constructor() { + super(...arguments); + this.dslMethods = { + option: [], + alternation: [], + repetition: [], + repetitionWithSeparator: [], + repetitionMandatory: [], + repetitionMandatoryWithSeparator: [] + }; + } + reset() { + this.dslMethods = { + option: [], + alternation: [], + repetition: [], + repetitionWithSeparator: [], + repetitionMandatory: [], + repetitionMandatoryWithSeparator: [] + }; + } + visitOption(option2) { + this.dslMethods.option.push(option2); + } + visitRepetitionWithSeparator(manySep) { + this.dslMethods.repetitionWithSeparator.push(manySep); + } + visitRepetitionMandatory(atLeastOne) { + this.dslMethods.repetitionMandatory.push(atLeastOne); + } + visitRepetitionMandatoryWithSeparator(atLeastOneSep) { + this.dslMethods.repetitionMandatoryWithSeparator.push(atLeastOneSep); + } + visitRepetition(many) { + this.dslMethods.repetition.push(many); + } + visitAlternation(or) { + this.dslMethods.alternation.push(or); + } + }; + collectorVisitor = new DslMethodsCollectorVisitor(); + __name(collectMethods, "collectMethods"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/cst/cst.js + function setNodeLocationOnlyOffset(currNodeLocation, newLocationInfo) { + if (isNaN(currNodeLocation.startOffset) === true) { + currNodeLocation.startOffset = newLocationInfo.startOffset; + currNodeLocation.endOffset = newLocationInfo.endOffset; + } else if (currNodeLocation.endOffset < newLocationInfo.endOffset === true) { + currNodeLocation.endOffset = newLocationInfo.endOffset; + } + } + function setNodeLocationFull(currNodeLocation, newLocationInfo) { + if (isNaN(currNodeLocation.startOffset) === true) { + currNodeLocation.startOffset = newLocationInfo.startOffset; + currNodeLocation.startColumn = newLocationInfo.startColumn; + currNodeLocation.startLine = newLocationInfo.startLine; + currNodeLocation.endOffset = newLocationInfo.endOffset; + currNodeLocation.endColumn = newLocationInfo.endColumn; + currNodeLocation.endLine = newLocationInfo.endLine; + } else if (currNodeLocation.endOffset < newLocationInfo.endOffset === true) { + currNodeLocation.endOffset = newLocationInfo.endOffset; + currNodeLocation.endColumn = newLocationInfo.endColumn; + currNodeLocation.endLine = newLocationInfo.endLine; + } + } + function addTerminalToCst(node2, token2, tokenTypeName) { + if (node2.children[tokenTypeName] === void 0) { + node2.children[tokenTypeName] = [token2]; + } else { + node2.children[tokenTypeName].push(token2); + } + } + function addNoneTerminalToCst(node2, ruleName, ruleResult) { + if (node2.children[ruleName] === void 0) { + node2.children[ruleName] = [ruleResult]; + } else { + node2.children[ruleName].push(ruleResult); + } + } + var init_cst = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/cst/cst.js"() { + "use strict"; + __name(setNodeLocationOnlyOffset, "setNodeLocationOnlyOffset"); + __name(setNodeLocationFull, "setNodeLocationFull"); + __name(addTerminalToCst, "addTerminalToCst"); + __name(addNoneTerminalToCst, "addNoneTerminalToCst"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/lang/lang_extensions.js + function defineNameProp(obj, nameValue) { + Object.defineProperty(obj, NAME, { + enumerable: false, + configurable: true, + writable: false, + value: nameValue + }); + } + var NAME; + var init_lang_extensions = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/lang/lang_extensions.js"() { + "use strict"; + NAME = "name"; + __name(defineNameProp, "defineNameProp"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js + function defaultVisit(ctx, param) { + const childrenNames = keys_default(ctx); + const childrenNamesLength = childrenNames.length; + for (let i2 = 0; i2 < childrenNamesLength; i2++) { + const currChildName = childrenNames[i2]; + const currChildArray = ctx[currChildName]; + const currChildArrayLength = currChildArray.length; + for (let j2 = 0; j2 < currChildArrayLength; j2++) { + const currChild = currChildArray[j2]; + if (currChild.tokenTypeIdx === void 0) { + this[currChild.name](currChild.children, param); + } + } + } + } + function createBaseSemanticVisitorConstructor(grammarName, ruleNames) { + const derivedConstructor = /* @__PURE__ */ __name(function() { + }, "derivedConstructor"); + defineNameProp(derivedConstructor, grammarName + "BaseSemantics"); + const semanticProto = { + visit: /* @__PURE__ */ __name(function(cstNode, param) { + if (isArray_default(cstNode)) { + cstNode = cstNode[0]; + } + if (isUndefined_default(cstNode)) { + return void 0; + } + return this[cstNode.name](cstNode.children, param); + }, "visit"), + validateVisitor: /* @__PURE__ */ __name(function() { + const semanticDefinitionErrors = validateVisitor(this, ruleNames); + if (!isEmpty_default(semanticDefinitionErrors)) { + const errorMessages = map_default(semanticDefinitionErrors, (currDefError) => currDefError.msg); + throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${errorMessages.join("\n\n").replace(/\n/g, "\n ")}`); + } + }, "validateVisitor") + }; + derivedConstructor.prototype = semanticProto; + derivedConstructor.prototype.constructor = derivedConstructor; + derivedConstructor._RULE_NAMES = ruleNames; + return derivedConstructor; + } + function createBaseVisitorConstructorWithDefaults(grammarName, ruleNames, baseConstructor) { + const derivedConstructor = /* @__PURE__ */ __name(function() { + }, "derivedConstructor"); + defineNameProp(derivedConstructor, grammarName + "BaseSemanticsWithDefaults"); + const withDefaultsProto = Object.create(baseConstructor.prototype); + forEach_default(ruleNames, (ruleName) => { + withDefaultsProto[ruleName] = defaultVisit; + }); + derivedConstructor.prototype = withDefaultsProto; + derivedConstructor.prototype.constructor = derivedConstructor; + return derivedConstructor; + } + function validateVisitor(visitorInstance, ruleNames) { + const missingErrors = validateMissingCstMethods(visitorInstance, ruleNames); + return missingErrors; + } + function validateMissingCstMethods(visitorInstance, ruleNames) { + const missingRuleNames = filter_default3(ruleNames, (currRuleName) => { + return isFunction_default(visitorInstance[currRuleName]) === false; + }); + const errors = map_default(missingRuleNames, (currRuleName) => { + return { + msg: `Missing visitor method: <${currRuleName}> on ${visitorInstance.constructor.name} CST Visitor.`, + type: CstVisitorDefinitionError.MISSING_METHOD, + methodName: currRuleName + }; + }); + return compact_default(errors); + } + var CstVisitorDefinitionError; + var init_cst_visitor = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js"() { + "use strict"; + init_lodash(); + init_lang_extensions(); + __name(defaultVisit, "defaultVisit"); + __name(createBaseSemanticVisitorConstructor, "createBaseSemanticVisitorConstructor"); + __name(createBaseVisitorConstructorWithDefaults, "createBaseVisitorConstructorWithDefaults"); + (function(CstVisitorDefinitionError2) { + CstVisitorDefinitionError2[CstVisitorDefinitionError2["REDUNDANT_METHOD"] = 0] = "REDUNDANT_METHOD"; + CstVisitorDefinitionError2[CstVisitorDefinitionError2["MISSING_METHOD"] = 1] = "MISSING_METHOD"; + })(CstVisitorDefinitionError || (CstVisitorDefinitionError = {})); + __name(validateVisitor, "validateVisitor"); + __name(validateMissingCstMethods, "validateMissingCstMethods"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js + var TreeBuilder; + var init_tree_builder = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js"() { + "use strict"; + init_cst(); + init_lodash(); + init_cst_visitor(); + init_parser(); + TreeBuilder = class { + static { + __name(this, "TreeBuilder"); + } + initTreeBuilder(config6) { + this.CST_STACK = []; + this.outputCst = config6.outputCst; + this.nodeLocationTracking = has_default(config6, "nodeLocationTracking") ? config6.nodeLocationTracking : DEFAULT_PARSER_CONFIG.nodeLocationTracking; + if (!this.outputCst) { + this.cstInvocationStateUpdate = noop_default2; + this.cstFinallyStateUpdate = noop_default2; + this.cstPostTerminal = noop_default2; + this.cstPostNonTerminal = noop_default2; + this.cstPostRule = noop_default2; } else { - return this.lex(); + if (/full/i.test(this.nodeLocationTracking)) { + if (this.recoveryEnabled) { + this.setNodeLocationFromToken = setNodeLocationFull; + this.setNodeLocationFromNode = setNodeLocationFull; + this.cstPostRule = noop_default2; + this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery; + } else { + this.setNodeLocationFromToken = noop_default2; + this.setNodeLocationFromNode = noop_default2; + this.cstPostRule = this.cstPostRuleFull; + this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular; + } + } else if (/onlyOffset/i.test(this.nodeLocationTracking)) { + if (this.recoveryEnabled) { + this.setNodeLocationFromToken = setNodeLocationOnlyOffset; + this.setNodeLocationFromNode = setNodeLocationOnlyOffset; + this.cstPostRule = noop_default2; + this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery; + } else { + this.setNodeLocationFromToken = noop_default2; + this.setNodeLocationFromNode = noop_default2; + this.cstPostRule = this.cstPostRuleOnlyOffset; + this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular; + } + } else if (/none/i.test(this.nodeLocationTracking)) { + this.setNodeLocationFromToken = noop_default2; + this.setNodeLocationFromNode = noop_default2; + this.cstPostRule = noop_default2; + this.setInitialNodeLocation = noop_default2; + } else { + throw Error(`Invalid config option: "${config6.nodeLocationTracking}"`); + } } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); + } + setInitialNodeLocationOnlyOffsetRecovery(cstNode) { + cstNode.location = { + startOffset: NaN, + endOffset: NaN + }; + } + setInitialNodeLocationOnlyOffsetRegular(cstNode) { + cstNode.location = { + // without error recovery the starting Location of a new CstNode is guaranteed + // To be the next Token's startOffset (for valid inputs). + // For invalid inputs there won't be any CSTOutput so this potential + // inaccuracy does not matter + startOffset: this.LA(1).startOffset, + endOffset: NaN + }; + } + setInitialNodeLocationFullRecovery(cstNode) { + cstNode.location = { + startOffset: NaN, + startLine: NaN, + startColumn: NaN, + endOffset: NaN, + endLine: NaN, + endColumn: NaN + }; + } + /** + * @see setInitialNodeLocationOnlyOffsetRegular for explanation why this work + + * @param cstNode + */ + setInitialNodeLocationFullRegular(cstNode) { + const nextToken = this.LA(1); + cstNode.location = { + startOffset: nextToken.startOffset, + startLine: nextToken.startLine, + startColumn: nextToken.startColumn, + endOffset: NaN, + endLine: NaN, + endColumn: NaN + }; + } + cstInvocationStateUpdate(fullRuleName) { + const cstNode = { + name: fullRuleName, + children: /* @__PURE__ */ Object.create(null) + }; + this.setInitialNodeLocation(cstNode); + this.CST_STACK.push(cstNode); + } + cstFinallyStateUpdate() { + this.CST_STACK.pop(); + } + cstPostRuleFull(ruleCstNode) { + const prevToken = this.LA(0); + const loc = ruleCstNode.location; + if (loc.startOffset <= prevToken.startOffset === true) { + loc.endOffset = prevToken.endOffset; + loc.endLine = prevToken.endLine; + loc.endColumn = prevToken.endColumn; } else { - return this.conditionStack[0]; + loc.startOffset = NaN; + loc.startLine = NaN; + loc.startColumn = NaN; } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } + cstPostRuleOnlyOffset(ruleCstNode) { + const prevToken = this.LA(0); + const loc = ruleCstNode.location; + if (loc.startOffset <= prevToken.startOffset === true) { + loc.endOffset = prevToken.endOffset; } else { - return this.conditions["INITIAL"].rules; + loc.startOffset = NaN; } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; + } + cstPostTerminal(key, consumedToken) { + const rootCst = this.CST_STACK[this.CST_STACK.length - 1]; + addTerminalToCst(rootCst, consumedToken, key); + this.setNodeLocationFromToken(rootCst.location, consumedToken); + } + cstPostNonTerminal(ruleCstResult, ruleName) { + const preCstNode = this.CST_STACK[this.CST_STACK.length - 1]; + addNoneTerminalToCst(preCstNode, ruleName, ruleCstResult); + this.setNodeLocationFromNode(preCstNode.location, ruleCstResult.location); + } + getBaseCstVisitorConstructor() { + if (isUndefined_default(this.baseCstVisitorConstructor)) { + const newBaseCstVisitorConstructor = createBaseSemanticVisitorConstructor(this.className, keys_default(this.gastProductionsCache)); + this.baseCstVisitorConstructor = newBaseCstVisitorConstructor; + return newBaseCstVisitorConstructor; } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - break; - case 1: - break; - case 2: - return 32; - case 3: - break; - case 4: - this.begin("title"); - return 13; - case 5: - this.popState(); - return "title_value"; - case 6: - this.begin("acc_title"); - return 15; - case 7: - this.popState(); - return "acc_title_value"; - case 8: - this.begin("acc_descr"); - return 17; - case 9: - this.popState(); - return "acc_descr_value"; - case 10: - this.begin("acc_descr_multiline"); - break; - case 11: - this.popState(); - break; - case 12: - return "acc_descr_multiline_value"; - case 13: - return 25; - case 14: - return 27; - case 15: - return 26; - case 16: - return 28; - case 17: - return 29; - case 18: - return 30; - case 19: - return 31; - case 20: - this.begin("md_string"); - break; - case 21: - return "MD_STR"; - case 22: - this.popState(); - break; - case 23: - this.begin("string"); - break; - case 24: - this.popState(); - break; - case 25: - return "STR"; - case 26: - this.begin("point_start"); - return 22; - case 27: - this.begin("point_x"); - return 23; - case 28: - this.popState(); - break; - case 29: - this.popState(); - this.begin("point_y"); - break; - case 30: - this.popState(); - return 24; - case 31: - return 6; - case 32: - return 43; - case 33: - return "COLON"; - case 34: - return 45; - case 35: - return 44; - case 36: - return 46; - case 37: - return 46; - case 38: - return 47; - case 39: - return 49; - case 40: - return 50; - case 41: - return 48; - case 42: - return 41; - case 43: - return 51; - case 44: - return 42; - case 45: - return 5; - case 46: - return 33; - case 47: - return 40; - case 48: - return 34; + return this.baseCstVisitorConstructor; + } + getBaseCstVisitorConstructorWithDefaults() { + if (isUndefined_default(this.baseCstVisitorWithDefaultsConstructor)) { + const newConstructor = createBaseVisitorConstructorWithDefaults(this.className, keys_default(this.gastProductionsCache), this.getBaseCstVisitorConstructor()); + this.baseCstVisitorWithDefaultsConstructor = newConstructor; + return newConstructor; } - }, - rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?: *x-axis *)/i, /^(?: *y-axis *)/i, /^(?: *--+> *)/i, /^(?: *quadrant-1 *)/i, /^(?: *quadrant-2 *)/i, /^(?: *quadrant-3 *)/i, /^(?: *quadrant-4 *)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\s*:\s*\[\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?:\s*\] *)/i, /^(?:\s*,\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?: *quadrantChart *)/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s)/i, /^(?:;)/i, /^(?:[!"#$%&'*+,-.`?\\_/])/i, /^(?:$)/i], - conditions: { "point_y": { "rules": [30], "inclusive": false }, "point_x": { "rules": [29], "inclusive": false }, "point_start": { "rules": [27, 28], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "title": { "rules": [5], "inclusive": false }, "md_string": { "rules": [21, 22], "inclusive": false }, "string": { "rules": [24, 25], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 23, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$k.parser = parser$k; - const parser$l = parser$k; - const defaultThemeVariables = getThemeVariables$2(); - class QuadrantBuilder { - constructor() { - this.config = this.getDefaultConfig(); - this.themeConfig = this.getDefaultThemeConfig(); - this.data = this.getDefaultData(); - } - getDefaultData() { - return { - titleText: "", - quadrant1Text: "", - quadrant2Text: "", - quadrant3Text: "", - quadrant4Text: "", - xAxisLeftText: "", - xAxisRightText: "", - yAxisBottomText: "", - yAxisTopText: "", - points: [] - }; - } - getDefaultConfig() { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k, _l, _m, _n, _o, _p, _q, _r; - return { - showXAxis: true, - showYAxis: true, - showTitle: true, - chartHeight: ((_a2 = defaultConfig$2.quadrantChart) == null ? void 0 : _a2.chartWidth) || 500, - chartWidth: ((_b2 = defaultConfig$2.quadrantChart) == null ? void 0 : _b2.chartHeight) || 500, - titlePadding: ((_c = defaultConfig$2.quadrantChart) == null ? void 0 : _c.titlePadding) || 10, - titleFontSize: ((_d = defaultConfig$2.quadrantChart) == null ? void 0 : _d.titleFontSize) || 20, - quadrantPadding: ((_e = defaultConfig$2.quadrantChart) == null ? void 0 : _e.quadrantPadding) || 5, - xAxisLabelPadding: ((_f = defaultConfig$2.quadrantChart) == null ? void 0 : _f.xAxisLabelPadding) || 5, - yAxisLabelPadding: ((_g = defaultConfig$2.quadrantChart) == null ? void 0 : _g.yAxisLabelPadding) || 5, - xAxisLabelFontSize: ((_h = defaultConfig$2.quadrantChart) == null ? void 0 : _h.xAxisLabelFontSize) || 16, - yAxisLabelFontSize: ((_i6 = defaultConfig$2.quadrantChart) == null ? void 0 : _i6.yAxisLabelFontSize) || 16, - quadrantLabelFontSize: ((_j = defaultConfig$2.quadrantChart) == null ? void 0 : _j.quadrantLabelFontSize) || 16, - quadrantTextTopPadding: ((_k = defaultConfig$2.quadrantChart) == null ? void 0 : _k.quadrantTextTopPadding) || 5, - pointTextPadding: ((_l = defaultConfig$2.quadrantChart) == null ? void 0 : _l.pointTextPadding) || 5, - pointLabelFontSize: ((_m = defaultConfig$2.quadrantChart) == null ? void 0 : _m.pointLabelFontSize) || 12, - pointRadius: ((_n = defaultConfig$2.quadrantChart) == null ? void 0 : _n.pointRadius) || 5, - xAxisPosition: ((_o = defaultConfig$2.quadrantChart) == null ? void 0 : _o.xAxisPosition) || "top", - yAxisPosition: ((_p = defaultConfig$2.quadrantChart) == null ? void 0 : _p.yAxisPosition) || "left", - quadrantInternalBorderStrokeWidth: ((_q = defaultConfig$2.quadrantChart) == null ? void 0 : _q.quadrantInternalBorderStrokeWidth) || 1, - quadrantExternalBorderStrokeWidth: ((_r = defaultConfig$2.quadrantChart) == null ? void 0 : _r.quadrantExternalBorderStrokeWidth) || 2 - }; - } - getDefaultThemeConfig() { - return { - quadrant1Fill: defaultThemeVariables.quadrant1Fill, - quadrant2Fill: defaultThemeVariables.quadrant2Fill, - quadrant3Fill: defaultThemeVariables.quadrant3Fill, - quadrant4Fill: defaultThemeVariables.quadrant4Fill, - quadrant1TextFill: defaultThemeVariables.quadrant1TextFill, - quadrant2TextFill: defaultThemeVariables.quadrant2TextFill, - quadrant3TextFill: defaultThemeVariables.quadrant3TextFill, - quadrant4TextFill: defaultThemeVariables.quadrant4TextFill, - quadrantPointFill: defaultThemeVariables.quadrantPointFill, - quadrantPointTextFill: defaultThemeVariables.quadrantPointTextFill, - quadrantXAxisTextFill: defaultThemeVariables.quadrantXAxisTextFill, - quadrantYAxisTextFill: defaultThemeVariables.quadrantYAxisTextFill, - quadrantTitleFill: defaultThemeVariables.quadrantTitleFill, - quadrantInternalBorderStrokeFill: defaultThemeVariables.quadrantInternalBorderStrokeFill, - quadrantExternalBorderStrokeFill: defaultThemeVariables.quadrantExternalBorderStrokeFill - }; - } - clear() { - this.config = this.getDefaultConfig(); - this.themeConfig = this.getDefaultThemeConfig(); - this.data = this.getDefaultData(); - log$1.info("clear called"); - } - setData(data) { - this.data = { ...this.data, ...data }; - } - addPoints(points) { - this.data.points = [...points, ...this.data.points]; - } - setConfig(config2) { - log$1.trace("setConfig called with: ", config2); - this.config = { ...this.config, ...config2 }; - } - setThemeConfig(themeConfig) { - log$1.trace("setThemeConfig called with: ", themeConfig); - this.themeConfig = { ...this.themeConfig, ...themeConfig }; - } - calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle) { - const xAxisSpaceCalculation = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize; - const xAxisSpace = { - top: xAxisPosition === "top" && showXAxis ? xAxisSpaceCalculation : 0, - bottom: xAxisPosition === "bottom" && showXAxis ? xAxisSpaceCalculation : 0 - }; - const yAxisSpaceCalculation = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize; - const yAxisSpace = { - left: this.config.yAxisPosition === "left" && showYAxis ? yAxisSpaceCalculation : 0, - right: this.config.yAxisPosition === "right" && showYAxis ? yAxisSpaceCalculation : 0 - }; - const titleSpaceCalculation = this.config.titleFontSize + this.config.titlePadding * 2; - const titleSpace = { - top: showTitle ? titleSpaceCalculation : 0 - }; - const quadrantLeft = this.config.quadrantPadding + yAxisSpace.left; - const quadrantTop = this.config.quadrantPadding + xAxisSpace.top + titleSpace.top; - const quadrantWidth = this.config.chartWidth - this.config.quadrantPadding * 2 - yAxisSpace.left - yAxisSpace.right; - const quadrantHeight = this.config.chartHeight - this.config.quadrantPadding * 2 - xAxisSpace.top - xAxisSpace.bottom - titleSpace.top; - const quadrantHalfWidth = quadrantWidth / 2; - const quadrantHalfHeight = quadrantHeight / 2; - const quadrantSpace = { - quadrantLeft, - quadrantTop, - quadrantWidth, - quadrantHalfWidth, - quadrantHeight, - quadrantHalfHeight + return this.baseCstVisitorWithDefaultsConstructor; + } + getLastExplicitRuleShortName() { + const ruleStack = this.RULE_STACK; + return ruleStack[ruleStack.length - 1]; + } + getPreviousExplicitRuleShortName() { + const ruleStack = this.RULE_STACK; + return ruleStack[ruleStack.length - 2]; + } + getLastExplicitRuleOccurrenceIndex() { + const occurrenceStack = this.RULE_OCCURRENCE_STACK; + return occurrenceStack[occurrenceStack.length - 1]; + } }; - return { - xAxisSpace, - yAxisSpace, - titleSpace, - quadrantSpace - }; - } - getAxisLabels(xAxisPosition, showXAxis, showYAxis, spaceData) { - const { quadrantSpace, titleSpace } = spaceData; - const { - quadrantHalfHeight, - quadrantHeight, - quadrantLeft, - quadrantHalfWidth, - quadrantTop, - quadrantWidth - } = quadrantSpace; - const drawXAxisLabelsInMiddle = Boolean(this.data.xAxisRightText); - const drawYAxisLabelsInMiddle = Boolean(this.data.yAxisTopText); - const axisLabels = []; - if (this.data.xAxisLeftText && showXAxis) { - axisLabels.push({ - text: this.data.xAxisLeftText, - fill: this.themeConfig.quadrantXAxisTextFill, - x: quadrantLeft + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0), - y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding, - fontSize: this.config.xAxisLabelFontSize, - verticalPos: drawXAxisLabelsInMiddle ? "center" : "left", - horizontalPos: "top", - rotation: 0 - }); - } - if (this.data.xAxisRightText && showXAxis) { - axisLabels.push({ - text: this.data.xAxisRightText, - fill: this.themeConfig.quadrantXAxisTextFill, - x: quadrantLeft + quadrantHalfWidth + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0), - y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding, - fontSize: this.config.xAxisLabelFontSize, - verticalPos: drawXAxisLabelsInMiddle ? "center" : "left", - horizontalPos: "top", - rotation: 0 - }); - } - if (this.data.yAxisBottomText && showYAxis) { - axisLabels.push({ - text: this.data.yAxisBottomText, - fill: this.themeConfig.quadrantYAxisTextFill, - x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding, - y: quadrantTop + quadrantHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0), - fontSize: this.config.yAxisLabelFontSize, - verticalPos: drawYAxisLabelsInMiddle ? "center" : "left", - horizontalPos: "top", - rotation: -90 - }); - } - if (this.data.yAxisTopText && showYAxis) { - axisLabels.push({ - text: this.data.yAxisTopText, - fill: this.themeConfig.quadrantYAxisTextFill, - x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding, - y: quadrantTop + quadrantHalfHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0), - fontSize: this.config.yAxisLabelFontSize, - verticalPos: drawYAxisLabelsInMiddle ? "center" : "left", - horizontalPos: "top", - rotation: -90 - }); - } - return axisLabels; } - getQuadrants(spaceData) { - const { quadrantSpace } = spaceData; - const { quadrantHalfHeight, quadrantLeft, quadrantHalfWidth, quadrantTop } = quadrantSpace; - const quadrants = [ - { - text: { - text: this.data.quadrant1Text, - fill: this.themeConfig.quadrant1TextFill, - x: 0, - y: 0, - fontSize: this.config.quadrantLabelFontSize, - verticalPos: "center", - horizontalPos: "middle", - rotation: 0 - }, - x: quadrantLeft + quadrantHalfWidth, - y: quadrantTop, - width: quadrantHalfWidth, - height: quadrantHalfHeight, - fill: this.themeConfig.quadrant1Fill - }, - { - text: { - text: this.data.quadrant2Text, - fill: this.themeConfig.quadrant2TextFill, - x: 0, - y: 0, - fontSize: this.config.quadrantLabelFontSize, - verticalPos: "center", - horizontalPos: "middle", - rotation: 0 - }, - x: quadrantLeft, - y: quadrantTop, - width: quadrantHalfWidth, - height: quadrantHalfHeight, - fill: this.themeConfig.quadrant2Fill - }, - { - text: { - text: this.data.quadrant3Text, - fill: this.themeConfig.quadrant3TextFill, - x: 0, - y: 0, - fontSize: this.config.quadrantLabelFontSize, - verticalPos: "center", - horizontalPos: "middle", - rotation: 0 - }, - x: quadrantLeft, - y: quadrantTop + quadrantHalfHeight, - width: quadrantHalfWidth, - height: quadrantHalfHeight, - fill: this.themeConfig.quadrant3Fill - }, - { - text: { - text: this.data.quadrant4Text, - fill: this.themeConfig.quadrant4TextFill, - x: 0, - y: 0, - fontSize: this.config.quadrantLabelFontSize, - verticalPos: "center", - horizontalPos: "middle", - rotation: 0 - }, - x: quadrantLeft + quadrantHalfWidth, - y: quadrantTop + quadrantHalfHeight, - width: quadrantHalfWidth, - height: quadrantHalfHeight, - fill: this.themeConfig.quadrant4Fill + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js + var LexerAdapter; + var init_lexer_adapter = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js"() { + "use strict"; + init_parser(); + LexerAdapter = class { + static { + __name(this, "LexerAdapter"); + } + initLexerAdapter() { + this.tokVector = []; + this.tokVectorLength = 0; + this.currIdx = -1; + } + set input(newInput) { + if (this.selfAnalysisDone !== true) { + throw Error(`Missing invocation at the end of the Parser's constructor.`); + } + this.reset(); + this.tokVector = newInput; + this.tokVectorLength = newInput.length; + } + get input() { + return this.tokVector; + } + // skips a token and returns the next token + SKIP_TOKEN() { + if (this.currIdx <= this.tokVector.length - 2) { + this.consumeToken(); + return this.LA(1); + } else { + return END_OF_FILE; + } } - ]; - for (const quadrant of quadrants) { - quadrant.text.x = quadrant.x + quadrant.width / 2; - if (this.data.points.length === 0) { - quadrant.text.y = quadrant.y + quadrant.height / 2; - quadrant.text.horizontalPos = "middle"; - } else { - quadrant.text.y = quadrant.y + this.config.quadrantTextTopPadding; - quadrant.text.horizontalPos = "top"; - } - } - return quadrants; - } - getQuadrantPoints(spaceData) { - const { quadrantSpace } = spaceData; - const { quadrantHeight, quadrantLeft, quadrantTop, quadrantWidth } = quadrantSpace; - const xAxis = linear().domain([0, 1]).range([quadrantLeft, quadrantWidth + quadrantLeft]); - const yAxis = linear().domain([0, 1]).range([quadrantHeight + quadrantTop, quadrantTop]); - const points = this.data.points.map((point2) => { - const props = { - x: xAxis(point2.x), - y: yAxis(point2.y), - fill: this.themeConfig.quadrantPointFill, - radius: this.config.pointRadius, - text: { - text: point2.text, - fill: this.themeConfig.quadrantPointTextFill, - x: xAxis(point2.x), - y: yAxis(point2.y) + this.config.pointTextPadding, - verticalPos: "center", - horizontalPos: "top", - fontSize: this.config.pointLabelFontSize, - rotation: 0 + // Lexer (accessing Token vector) related methods which can be overridden to implement lazy lexers + // or lexers dependent on parser context. + LA(howMuch) { + const soughtIdx = this.currIdx + howMuch; + if (soughtIdx < 0 || this.tokVectorLength <= soughtIdx) { + return END_OF_FILE; + } else { + return this.tokVector[soughtIdx]; } - }; - return props; - }); - return points; - } - getBorders(spaceData) { - const halfExternalBorderWidth = this.config.quadrantExternalBorderStrokeWidth / 2; - const { quadrantSpace } = spaceData; - const { - quadrantHalfHeight, - quadrantHeight, - quadrantLeft, - quadrantHalfWidth, - quadrantTop, - quadrantWidth - } = quadrantSpace; - const borderLines = [ - // top border - { - strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, - strokeWidth: this.config.quadrantExternalBorderStrokeWidth, - x1: quadrantLeft - halfExternalBorderWidth, - y1: quadrantTop, - x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth, - y2: quadrantTop - }, - // right border - { - strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, - strokeWidth: this.config.quadrantExternalBorderStrokeWidth, - x1: quadrantLeft + quadrantWidth, - y1: quadrantTop + halfExternalBorderWidth, - x2: quadrantLeft + quadrantWidth, - y2: quadrantTop + quadrantHeight - halfExternalBorderWidth - }, - // bottom border - { - strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, - strokeWidth: this.config.quadrantExternalBorderStrokeWidth, - x1: quadrantLeft - halfExternalBorderWidth, - y1: quadrantTop + quadrantHeight, - x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth, - y2: quadrantTop + quadrantHeight - }, - // left border - { - strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, - strokeWidth: this.config.quadrantExternalBorderStrokeWidth, - x1: quadrantLeft, - y1: quadrantTop + halfExternalBorderWidth, - x2: quadrantLeft, - y2: quadrantTop + quadrantHeight - halfExternalBorderWidth - }, - // vertical inner border - { - strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, - strokeWidth: this.config.quadrantInternalBorderStrokeWidth, - x1: quadrantLeft + quadrantHalfWidth, - y1: quadrantTop + halfExternalBorderWidth, - x2: quadrantLeft + quadrantHalfWidth, - y2: quadrantTop + quadrantHeight - halfExternalBorderWidth - }, - // horizontal inner border - { - strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, - strokeWidth: this.config.quadrantInternalBorderStrokeWidth, - x1: quadrantLeft + halfExternalBorderWidth, - y1: quadrantTop + quadrantHalfHeight, - x2: quadrantLeft + quadrantWidth - halfExternalBorderWidth, - y2: quadrantTop + quadrantHalfHeight } - ]; - return borderLines; - } - getTitle(showTitle) { - if (showTitle) { - return { - text: this.data.titleText, - fill: this.themeConfig.quadrantTitleFill, - fontSize: this.config.titleFontSize, - horizontalPos: "top", - verticalPos: "center", - rotation: 0, - y: this.config.titlePadding, - x: this.config.chartWidth / 2 - }; - } - return; - } - build() { - const showXAxis = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText); - const showYAxis = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText); - const showTitle = this.config.showTitle && !!this.data.titleText; - const xAxisPosition = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition; - const calculatedSpace = this.calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle); - return { - points: this.getQuadrantPoints(calculatedSpace), - quadrants: this.getQuadrants(calculatedSpace), - axisLabels: this.getAxisLabels(xAxisPosition, showXAxis, showYAxis, calculatedSpace), - borderLines: this.getBorders(calculatedSpace), - title: this.getTitle(showTitle) + consumeToken() { + this.currIdx++; + } + exportLexerState() { + return this.currIdx; + } + importLexerState(newState2) { + this.currIdx = newState2; + } + resetLexerState() { + this.currIdx = -1; + } + moveToTerminatedState() { + this.currIdx = this.tokVector.length - 1; + } + getLexerPosition() { + return this.exportLexerState(); + } }; } - } - const config$1 = getConfig$1(); - function textSanitizer$1(text2) { - return sanitizeText$6(text2.trim(), config$1); - } - const quadrantBuilder = new QuadrantBuilder(); - function setQuadrant1Text(textObj) { - quadrantBuilder.setData({ quadrant1Text: textSanitizer$1(textObj.text) }); - } - function setQuadrant2Text(textObj) { - quadrantBuilder.setData({ quadrant2Text: textSanitizer$1(textObj.text) }); - } - function setQuadrant3Text(textObj) { - quadrantBuilder.setData({ quadrant3Text: textSanitizer$1(textObj.text) }); - } - function setQuadrant4Text(textObj) { - quadrantBuilder.setData({ quadrant4Text: textSanitizer$1(textObj.text) }); - } - function setXAxisLeftText(textObj) { - quadrantBuilder.setData({ xAxisLeftText: textSanitizer$1(textObj.text) }); - } - function setXAxisRightText(textObj) { - quadrantBuilder.setData({ xAxisRightText: textSanitizer$1(textObj.text) }); - } - function setYAxisTopText(textObj) { - quadrantBuilder.setData({ yAxisTopText: textSanitizer$1(textObj.text) }); - } - function setYAxisBottomText(textObj) { - quadrantBuilder.setData({ yAxisBottomText: textSanitizer$1(textObj.text) }); - } - function addPoint(textObj, x2, y2) { - quadrantBuilder.addPoints([{ x: x2, y: y2, text: textSanitizer$1(textObj.text) }]); - } - function setWidth(width2) { - quadrantBuilder.setConfig({ chartWidth: width2 }); - } - function setHeight(height) { - quadrantBuilder.setConfig({ chartHeight: height }); - } - function getQuadrantData() { - const config2 = getConfig$1(); - const { themeVariables, quadrantChart: quadrantChartConfig } = config2; - if (quadrantChartConfig) { - quadrantBuilder.setConfig(quadrantChartConfig); - } - quadrantBuilder.setThemeConfig({ - quadrant1Fill: themeVariables.quadrant1Fill, - quadrant2Fill: themeVariables.quadrant2Fill, - quadrant3Fill: themeVariables.quadrant3Fill, - quadrant4Fill: themeVariables.quadrant4Fill, - quadrant1TextFill: themeVariables.quadrant1TextFill, - quadrant2TextFill: themeVariables.quadrant2TextFill, - quadrant3TextFill: themeVariables.quadrant3TextFill, - quadrant4TextFill: themeVariables.quadrant4TextFill, - quadrantPointFill: themeVariables.quadrantPointFill, - quadrantPointTextFill: themeVariables.quadrantPointTextFill, - quadrantXAxisTextFill: themeVariables.quadrantXAxisTextFill, - quadrantYAxisTextFill: themeVariables.quadrantYAxisTextFill, - quadrantExternalBorderStrokeFill: themeVariables.quadrantExternalBorderStrokeFill, - quadrantInternalBorderStrokeFill: themeVariables.quadrantInternalBorderStrokeFill, - quadrantTitleFill: themeVariables.quadrantTitleFill - }); - quadrantBuilder.setData({ titleText: getDiagramTitle() }); - return quadrantBuilder.build(); - } - const clear$a = function() { - quadrantBuilder.clear(); - clear$n(); - }; - const db$c = { - setWidth, - setHeight, - setQuadrant1Text, - setQuadrant2Text, - setQuadrant3Text, - setQuadrant4Text, - setXAxisLeftText, - setXAxisRightText, - setYAxisTopText, - setYAxisBottomText, - addPoint, - getQuadrantData, - clear: clear$a, - setAccTitle, - getAccTitle, - setDiagramTitle, - getDiagramTitle, - getAccDescription, - setAccDescription - }; - const draw$d = (txt, id2, _version, diagObj) => { - var _a2, _b2, _c; - function getDominantBaseLine(horizontalPos) { - return horizontalPos === "top" ? "hanging" : "middle"; - } - function getTextAnchor(verticalPos) { - return verticalPos === "left" ? "start" : "middle"; - } - function getTransformation(data) { - return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`; - } - const conf2 = getConfig$1(); - log$1.debug("Rendering quadrant chart\n" + txt); - const securityLevel = conf2.securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = root2.select(`[id="${id2}"]`); - const group = svg2.append("g").attr("class", "main"); - const width2 = ((_a2 = conf2.quadrantChart) == null ? void 0 : _a2.chartWidth) || 500; - const height = ((_b2 = conf2.quadrantChart) == null ? void 0 : _b2.chartHeight) || 500; - configureSvgSize(svg2, height, width2, ((_c = conf2.quadrantChart) == null ? void 0 : _c.useMaxWidth) || true); - svg2.attr("viewBox", "0 0 " + width2 + " " + height); - diagObj.db.setHeight(height); - diagObj.db.setWidth(width2); - const quadrantData = diagObj.db.getQuadrantData(); - const quadrantsGroup = group.append("g").attr("class", "quadrants"); - const borderGroup = group.append("g").attr("class", "border"); - const dataPointGroup = group.append("g").attr("class", "data-points"); - const labelGroup = group.append("g").attr("class", "labels"); - const titleGroup = group.append("g").attr("class", "title"); - if (quadrantData.title) { - titleGroup.append("text").attr("x", 0).attr("y", 0).attr("fill", quadrantData.title.fill).attr("font-size", quadrantData.title.fontSize).attr("dominant-baseline", getDominantBaseLine(quadrantData.title.horizontalPos)).attr("text-anchor", getTextAnchor(quadrantData.title.verticalPos)).attr("transform", getTransformation(quadrantData.title)).text(quadrantData.title.text); - } - if (quadrantData.borderLines) { - borderGroup.selectAll("line").data(quadrantData.borderLines).enter().append("line").attr("x1", (data) => data.x1).attr("y1", (data) => data.y1).attr("x2", (data) => data.x2).attr("y2", (data) => data.y2).style("stroke", (data) => data.strokeFill).style("stroke-width", (data) => data.strokeWidth); - } - const quadrants = quadrantsGroup.selectAll("g.quadrant").data(quadrantData.quadrants).enter().append("g").attr("class", "quadrant"); - quadrants.append("rect").attr("x", (data) => data.x).attr("y", (data) => data.y).attr("width", (data) => data.width).attr("height", (data) => data.height).attr("fill", (data) => data.fill); - quadrants.append("text").attr("x", 0).attr("y", 0).attr("fill", (data) => data.text.fill).attr("font-size", (data) => data.text.fontSize).attr( - "dominant-baseline", - (data) => getDominantBaseLine(data.text.horizontalPos) - ).attr("text-anchor", (data) => getTextAnchor(data.text.verticalPos)).attr("transform", (data) => getTransformation(data.text)).text((data) => data.text.text); - const labels = labelGroup.selectAll("g.label").data(quadrantData.axisLabels).enter().append("g").attr("class", "label"); - labels.append("text").attr("x", 0).attr("y", 0).text((data) => data.text).attr("fill", (data) => data.fill).attr("font-size", (data) => data.fontSize).attr("dominant-baseline", (data) => getDominantBaseLine(data.horizontalPos)).attr("text-anchor", (data) => getTextAnchor(data.verticalPos)).attr("transform", (data) => getTransformation(data)); - const dataPoints = dataPointGroup.selectAll("g.data-point").data(quadrantData.points).enter().append("g").attr("class", "data-point"); - dataPoints.append("circle").attr("cx", (data) => data.x).attr("cy", (data) => data.y).attr("r", (data) => data.radius).attr("fill", (data) => data.fill); - dataPoints.append("text").attr("x", 0).attr("y", 0).text((data) => data.text.text).attr("fill", (data) => data.text.fill).attr("font-size", (data) => data.text.fontSize).attr( - "dominant-baseline", - (data) => getDominantBaseLine(data.text.horizontalPos) - ).attr("text-anchor", (data) => getTextAnchor(data.text.verticalPos)).attr("transform", (data) => getTransformation(data.text)); - }; - const renderer$d = { - draw: draw$d - }; - const diagram$d = { - parser: parser$l, - db: db$c, - renderer: renderer$d, - styles: () => "" - }; - const quadrantDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$d - }, Symbol.toStringTag, { value: "Module" })); - var parser$i = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 10, 12, 14, 16, 18, 19, 21, 23], $V1 = [2, 6], $V2 = [1, 3], $V3 = [1, 5], $V4 = [1, 6], $V5 = [1, 7], $V6 = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $V7 = [1, 25], $V8 = [1, 26], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 30], $Vc = [1, 31], $Vd = [1, 32], $Ve = [1, 33], $Vf = [1, 34], $Vg = [1, 35], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 43], $Vk = [1, 42], $Vl = [1, 47], $Vm = [1, 50], $Vn = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $Vo = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], $Vp = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], $Vq = [1, 64]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "eol": 4, "XYCHART": 5, "chartConfig": 6, "document": 7, "CHART_ORIENTATION": 8, "statement": 9, "title": 10, "text": 11, "X_AXIS": 12, "parseXAxis": 13, "Y_AXIS": 14, "parseYAxis": 15, "LINE": 16, "plotData": 17, "BAR": 18, "acc_title": 19, "acc_title_value": 20, "acc_descr": 21, "acc_descr_value": 22, "acc_descr_multiline_value": 23, "SQUARE_BRACES_START": 24, "commaSeparatedNumbers": 25, "SQUARE_BRACES_END": 26, "NUMBER_WITH_DECIMAL": 27, "COMMA": 28, "xAxisData": 29, "bandData": 30, "ARROW_DELIMITER": 31, "commaSeparatedTexts": 32, "yAxisData": 33, "NEWLINE": 34, "SEMI": 35, "EOF": 36, "alphaNum": 37, "STR": 38, "MD_STR": 39, "alphaNumToken": 40, "AMP": 41, "NUM": 42, "ALPHA": 43, "PLUS": 44, "EQUALS": 45, "MULT": 46, "DOT": 47, "BRKT": 48, "MINUS": 49, "UNDERSCORE": 50, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" }, - productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 5: - yy.setOrientation($$[$0]); - break; - case 9: - yy.setDiagramTitle($$[$0].text.trim()); - break; - case 12: - yy.setLineData({ text: "", type: "text" }, $$[$0]); - break; - case 13: - yy.setLineData($$[$0 - 1], $$[$0]); - break; - case 14: - yy.setBarData({ text: "", type: "text" }, $$[$0]); - break; - case 15: - yy.setBarData($$[$0 - 1], $$[$0]); - break; - case 16: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 17: - case 18: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 19: - this.$ = $$[$0 - 1]; - break; - case 20: - this.$ = [Number($$[$0 - 2]), ...$$[$0]]; - break; - case 21: - this.$ = [Number($$[$0])]; - break; - case 22: - yy.setXAxisTitle($$[$0]); - break; - case 23: - yy.setXAxisTitle($$[$0 - 1]); - break; - case 24: - yy.setXAxisTitle({ type: "text", text: "" }); - break; - case 25: - yy.setXAxisBand($$[$0]); - break; - case 26: - yy.setXAxisRangeData(Number($$[$0 - 2]), Number($$[$0])); - break; - case 27: - this.$ = $$[$0 - 1]; - break; - case 28: - this.$ = [$$[$0 - 2], ...$$[$0]]; - break; - case 29: - this.$ = [$$[$0]]; - break; - case 30: - yy.setYAxisTitle($$[$0]); - break; - case 31: - yy.setYAxisTitle($$[$0 - 1]); - break; - case 32: - yy.setYAxisTitle({ type: "text", text: "" }); - break; - case 33: - yy.setYAxisRangeData(Number($$[$0 - 2]), Number($$[$0])); - break; - case 37: - this.$ = { text: $$[$0], type: "text" }; - break; - case 38: - this.$ = { text: $$[$0], type: "text" }; - break; - case 39: - this.$ = { text: $$[$0], type: "markdown" }; - break; - case 40: - this.$ = $$[$0]; - break; - case 41: - this.$ = $$[$0 - 1] + "" + $$[$0]; - break; + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js + var RecognizerApi; + var init_recognizer_api = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js"() { + "use strict"; + init_lodash(); + init_exceptions_public(); + init_parser(); + init_errors_public(); + init_checks(); + init_api3(); + RecognizerApi = class { + static { + __name(this, "RecognizerApi"); } - }, - table: [o($V0, $V1, { 3: 1, 4: 2, 7: 4, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), { 1: [3] }, o($V0, $V1, { 4: 2, 7: 4, 3: 8, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), o($V0, $V1, { 4: 2, 7: 4, 6: 9, 3: 10, 5: $V2, 8: [1, 11], 34: $V3, 35: $V4, 36: $V5 }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, o($V6, [2, 34]), o($V6, [2, 35]), o($V6, [2, 36]), { 1: [2, 1] }, o($V0, $V1, { 4: 2, 7: 4, 3: 21, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), { 1: [2, 3] }, o($V6, [2, 5]), o($V0, [2, 7], { 4: 22, 34: $V3, 35: $V4, 36: $V5 }), { 11: 23, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 39, 13: 38, 24: $Vj, 27: $Vk, 29: 40, 30: 41, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 45, 15: 44, 27: $Vl, 33: 46, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 49, 17: 48, 24: $Vm, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 52, 17: 51, 24: $Vm, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 20: [1, 53] }, { 22: [1, 54] }, o($Vn, [2, 18]), { 1: [2, 2] }, o($Vn, [2, 8]), o($Vn, [2, 9]), o($Vo, [2, 37], { 40: 55, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }), o($Vo, [2, 38]), o($Vo, [2, 39]), o($Vp, [2, 40]), o($Vp, [2, 42]), o($Vp, [2, 43]), o($Vp, [2, 44]), o($Vp, [2, 45]), o($Vp, [2, 46]), o($Vp, [2, 47]), o($Vp, [2, 48]), o($Vp, [2, 49]), o($Vp, [2, 50]), o($Vp, [2, 51]), o($Vn, [2, 10]), o($Vn, [2, 22], { 30: 41, 29: 56, 24: $Vj, 27: $Vk }), o($Vn, [2, 24]), o($Vn, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, o($Vn, [2, 11]), o($Vn, [2, 30], { 33: 60, 27: $Vl }), o($Vn, [2, 32]), { 31: [1, 61] }, o($Vn, [2, 12]), { 17: 62, 24: $Vm }, { 25: 63, 27: $Vq }, o($Vn, [2, 14]), { 17: 65, 24: $Vm }, o($Vn, [2, 16]), o($Vn, [2, 17]), o($Vp, [2, 41]), o($Vn, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, o($Vn, [2, 31]), { 27: [1, 69] }, o($Vn, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, o($Vn, [2, 15]), o($Vn, [2, 26]), o($Vn, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, o($Vn, [2, 33]), o($Vn, [2, 19]), { 25: 73, 27: $Vq }, { 26: [2, 28] }, { 26: [2, 20] }], - defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + ACTION(impl2) { + return impl2.call(this); } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + consume(idx, tokType, options3) { + return this.consumeInternal(tokType, idx, options3); + } + subrule(idx, ruleToCall, options3) { + return this.subruleInternal(ruleToCall, idx, options3); + } + option(idx, actionORMethodDef) { + return this.optionInternal(actionORMethodDef, idx); + } + or(idx, altsOrOpts) { + return this.orInternal(altsOrOpts, idx); + } + many(idx, actionORMethodDef) { + return this.manyInternal(idx, actionORMethodDef); + } + atLeastOne(idx, actionORMethodDef) { + return this.atLeastOneInternal(idx, actionORMethodDef); + } + CONSUME(tokType, options3) { + return this.consumeInternal(tokType, 0, options3); + } + CONSUME1(tokType, options3) { + return this.consumeInternal(tokType, 1, options3); + } + CONSUME2(tokType, options3) { + return this.consumeInternal(tokType, 2, options3); + } + CONSUME3(tokType, options3) { + return this.consumeInternal(tokType, 3, options3); + } + CONSUME4(tokType, options3) { + return this.consumeInternal(tokType, 4, options3); + } + CONSUME5(tokType, options3) { + return this.consumeInternal(tokType, 5, options3); + } + CONSUME6(tokType, options3) { + return this.consumeInternal(tokType, 6, options3); + } + CONSUME7(tokType, options3) { + return this.consumeInternal(tokType, 7, options3); + } + CONSUME8(tokType, options3) { + return this.consumeInternal(tokType, 8, options3); + } + CONSUME9(tokType, options3) { + return this.consumeInternal(tokType, 9, options3); + } + SUBRULE(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 0, options3); + } + SUBRULE1(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 1, options3); + } + SUBRULE2(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 2, options3); + } + SUBRULE3(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 3, options3); + } + SUBRULE4(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 4, options3); + } + SUBRULE5(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 5, options3); + } + SUBRULE6(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 6, options3); + } + SUBRULE7(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 7, options3); + } + SUBRULE8(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 8, options3); + } + SUBRULE9(ruleToCall, options3) { + return this.subruleInternal(ruleToCall, 9, options3); + } + OPTION(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 0); + } + OPTION1(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 1); + } + OPTION2(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 2); + } + OPTION3(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 3); } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + OPTION4(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 4); + } + OPTION5(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 5); + } + OPTION6(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 6); + } + OPTION7(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 7); + } + OPTION8(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 8); + } + OPTION9(actionORMethodDef) { + return this.optionInternal(actionORMethodDef, 9); + } + OR(altsOrOpts) { + return this.orInternal(altsOrOpts, 0); + } + OR1(altsOrOpts) { + return this.orInternal(altsOrOpts, 1); + } + OR2(altsOrOpts) { + return this.orInternal(altsOrOpts, 2); + } + OR3(altsOrOpts) { + return this.orInternal(altsOrOpts, 3); + } + OR4(altsOrOpts) { + return this.orInternal(altsOrOpts, 4); + } + OR5(altsOrOpts) { + return this.orInternal(altsOrOpts, 5); + } + OR6(altsOrOpts) { + return this.orInternal(altsOrOpts, 6); + } + OR7(altsOrOpts) { + return this.orInternal(altsOrOpts, 7); + } + OR8(altsOrOpts) { + return this.orInternal(altsOrOpts, 8); + } + OR9(altsOrOpts) { + return this.orInternal(altsOrOpts, 9); + } + MANY(actionORMethodDef) { + this.manyInternal(0, actionORMethodDef); + } + MANY1(actionORMethodDef) { + this.manyInternal(1, actionORMethodDef); + } + MANY2(actionORMethodDef) { + this.manyInternal(2, actionORMethodDef); + } + MANY3(actionORMethodDef) { + this.manyInternal(3, actionORMethodDef); + } + MANY4(actionORMethodDef) { + this.manyInternal(4, actionORMethodDef); + } + MANY5(actionORMethodDef) { + this.manyInternal(5, actionORMethodDef); + } + MANY6(actionORMethodDef) { + this.manyInternal(6, actionORMethodDef); + } + MANY7(actionORMethodDef) { + this.manyInternal(7, actionORMethodDef); + } + MANY8(actionORMethodDef) { + this.manyInternal(8, actionORMethodDef); + } + MANY9(actionORMethodDef) { + this.manyInternal(9, actionORMethodDef); + } + MANY_SEP(options3) { + this.manySepFirstInternal(0, options3); + } + MANY_SEP1(options3) { + this.manySepFirstInternal(1, options3); + } + MANY_SEP2(options3) { + this.manySepFirstInternal(2, options3); + } + MANY_SEP3(options3) { + this.manySepFirstInternal(3, options3); + } + MANY_SEP4(options3) { + this.manySepFirstInternal(4, options3); + } + MANY_SEP5(options3) { + this.manySepFirstInternal(5, options3); + } + MANY_SEP6(options3) { + this.manySepFirstInternal(6, options3); + } + MANY_SEP7(options3) { + this.manySepFirstInternal(7, options3); + } + MANY_SEP8(options3) { + this.manySepFirstInternal(8, options3); + } + MANY_SEP9(options3) { + this.manySepFirstInternal(9, options3); + } + AT_LEAST_ONE(actionORMethodDef) { + this.atLeastOneInternal(0, actionORMethodDef); + } + AT_LEAST_ONE1(actionORMethodDef) { + return this.atLeastOneInternal(1, actionORMethodDef); + } + AT_LEAST_ONE2(actionORMethodDef) { + this.atLeastOneInternal(2, actionORMethodDef); + } + AT_LEAST_ONE3(actionORMethodDef) { + this.atLeastOneInternal(3, actionORMethodDef); + } + AT_LEAST_ONE4(actionORMethodDef) { + this.atLeastOneInternal(4, actionORMethodDef); + } + AT_LEAST_ONE5(actionORMethodDef) { + this.atLeastOneInternal(5, actionORMethodDef); + } + AT_LEAST_ONE6(actionORMethodDef) { + this.atLeastOneInternal(6, actionORMethodDef); + } + AT_LEAST_ONE7(actionORMethodDef) { + this.atLeastOneInternal(7, actionORMethodDef); + } + AT_LEAST_ONE8(actionORMethodDef) { + this.atLeastOneInternal(8, actionORMethodDef); + } + AT_LEAST_ONE9(actionORMethodDef) { + this.atLeastOneInternal(9, actionORMethodDef); + } + AT_LEAST_ONE_SEP(options3) { + this.atLeastOneSepFirstInternal(0, options3); + } + AT_LEAST_ONE_SEP1(options3) { + this.atLeastOneSepFirstInternal(1, options3); + } + AT_LEAST_ONE_SEP2(options3) { + this.atLeastOneSepFirstInternal(2, options3); + } + AT_LEAST_ONE_SEP3(options3) { + this.atLeastOneSepFirstInternal(3, options3); + } + AT_LEAST_ONE_SEP4(options3) { + this.atLeastOneSepFirstInternal(4, options3); + } + AT_LEAST_ONE_SEP5(options3) { + this.atLeastOneSepFirstInternal(5, options3); + } + AT_LEAST_ONE_SEP6(options3) { + this.atLeastOneSepFirstInternal(6, options3); + } + AT_LEAST_ONE_SEP7(options3) { + this.atLeastOneSepFirstInternal(7, options3); + } + AT_LEAST_ONE_SEP8(options3) { + this.atLeastOneSepFirstInternal(8, options3); + } + AT_LEAST_ONE_SEP9(options3) { + this.atLeastOneSepFirstInternal(9, options3); + } + RULE(name, implementation, config6 = DEFAULT_RULE_CONFIG) { + if (includes_default(this.definedRulesNames, name)) { + const errMsg = defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({ + topLevelRule: name, + grammarName: this.className + }); + const error3 = { + message: errMsg, + type: ParserDefinitionErrorType.DUPLICATE_RULE_NAME, + ruleName: name + }; + this.definitionErrors.push(error3); + } + this.definedRulesNames.push(name); + const ruleImplementation = this.defineRule(name, implementation, config6); + this[name] = ruleImplementation; + return ruleImplementation; + } + OVERRIDE_RULE(name, impl2, config6 = DEFAULT_RULE_CONFIG) { + const ruleErrors = validateRuleIsOverridden(name, this.definedRulesNames, this.className); + this.definitionErrors = this.definitionErrors.concat(ruleErrors); + const ruleImplementation = this.defineRule(name, impl2, config6); + this[name] = ruleImplementation; + return ruleImplementation; + } + BACKTRACK(grammarRule, args) { + return function() { + this.isBackTrackingStack.push(1); + const orgState = this.saveRecogState(); + try { + grammarRule.apply(this, args); + return true; + } catch (e3) { + if (isRecognitionException(e3)) { + return false; + } else { + throw e3; + } + } finally { + this.reloadRecogState(orgState); + this.isBackTrackingStack.pop(); } - token2 = self2.symbols_[token2] || token2; - } - return token2; + }; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; + // GAST export APIs + getGAstProductions() { + return this.gastProductionsCache; + } + getSerializedGastProductions() { + return serializeGrammar(values_default(this.gastProductionsCache)); + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js + var RecognizerEngine; + var init_recognizer_engine = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js"() { + "use strict"; + init_lodash(); + init_keys2(); + init_exceptions_public(); + init_lookahead(); + init_interpreter(); + init_parser(); + init_recoverable(); + init_tokens_public(); + init_tokens(); + RecognizerEngine = class { + static { + __name(this, "RecognizerEngine"); + } + initRecognizerEngine(tokenVocabulary, config6) { + this.className = this.constructor.name; + this.shortRuleNameToFull = {}; + this.fullRuleNameToShort = {}; + this.ruleShortNameIdx = 256; + this.tokenMatcher = tokenStructuredMatcherNoCategories; + this.subruleIdx = 0; + this.definedRulesNames = []; + this.tokensMap = {}; + this.isBackTrackingStack = []; + this.RULE_STACK = []; + this.RULE_OCCURRENCE_STACK = []; + this.gastProductionsCache = {}; + if (has_default(config6, "serializedGrammar")) { + throw Error("The Parser's configuration can no longer contain a property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details."); + } + if (isArray_default(tokenVocabulary)) { + if (isEmpty_default(tokenVocabulary)) { + throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0)."); + } + if (typeof tokenVocabulary[0].startOffset === "number") { + throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details."); + } + } + if (isArray_default(tokenVocabulary)) { + this.tokensMap = reduce_default(tokenVocabulary, (acc, tokType) => { + acc[tokType.name] = tokType; + return acc; + }, {}); + } else if (has_default(tokenVocabulary, "modes") && every_default(flatten_default(values_default(tokenVocabulary.modes)), isTokenType)) { + const allTokenTypes2 = flatten_default(values_default(tokenVocabulary.modes)); + const uniqueTokens = uniq_default(allTokenTypes2); + this.tokensMap = reduce_default(uniqueTokens, (acc, tokType) => { + acc[tokType.name] = tokType; + return acc; + }, {}); + } else if (isObject_default(tokenVocabulary)) { + this.tokensMap = clone_default2(tokenVocabulary); } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); + throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition"); + } + this.tokensMap["EOF"] = EOF; + const allTokenTypes = has_default(tokenVocabulary, "modes") ? flatten_default(values_default(tokenVocabulary.modes)) : values_default(tokenVocabulary); + const noTokenCategoriesUsed = every_default(allTokenTypes, (tokenConstructor) => isEmpty_default(tokenConstructor.categoryMatches)); + this.tokenMatcher = noTokenCategoriesUsed ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher; + augmentTokenTypes(values_default(this.tokensMap)); + } + defineRule(ruleName, impl2, config6) { + if (this.selfAnalysisDone) { + throw Error(`Grammar rule <${ruleName}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`); + } + const resyncEnabled = has_default(config6, "resyncEnabled") ? config6.resyncEnabled : DEFAULT_RULE_CONFIG.resyncEnabled; + const recoveryValueFunc = has_default(config6, "recoveryValueFunc") ? config6.recoveryValueFunc : DEFAULT_RULE_CONFIG.recoveryValueFunc; + const shortName = this.ruleShortNameIdx << BITS_FOR_METHOD_TYPE + BITS_FOR_OCCURRENCE_IDX; + this.ruleShortNameIdx++; + this.shortRuleNameToFull[shortName] = ruleName; + this.fullRuleNameToShort[ruleName] = shortName; + let invokeRuleWithTry; + if (this.outputCst === true) { + invokeRuleWithTry = /* @__PURE__ */ __name(function invokeRuleWithTry2(...args) { + try { + this.ruleInvocationStateUpdate(shortName, ruleName, this.subruleIdx); + impl2.apply(this, args); + const cst = this.CST_STACK[this.CST_STACK.length - 1]; + this.cstPostRule(cst); + return cst; + } catch (e3) { + return this.invokeRuleCatch(e3, resyncEnabled, recoveryValueFunc); + } finally { + this.ruleFinallyStateUpdate(); } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + }, "invokeRuleWithTry"); + } else { + invokeRuleWithTry = /* @__PURE__ */ __name(function invokeRuleWithTryCst(...args) { + try { + this.ruleInvocationStateUpdate(shortName, ruleName, this.subruleIdx); + return impl2.apply(this, args); + } catch (e3) { + return this.invokeRuleCatch(e3, resyncEnabled, recoveryValueFunc); + } finally { + this.ruleFinallyStateUpdate(); + } + }, "invokeRuleWithTryCst"); + } + const wrappedGrammarRule = Object.assign(invokeRuleWithTry, { ruleName, originalGrammarAction: impl2 }); + return wrappedGrammarRule; + } + invokeRuleCatch(e3, resyncEnabledConfig, recoveryValueFunc) { + const isFirstInvokedRule = this.RULE_STACK.length === 1; + const reSyncEnabled = resyncEnabledConfig && !this.isBackTracking() && this.recoveryEnabled; + if (isRecognitionException(e3)) { + const recogError = e3; + if (reSyncEnabled) { + const reSyncTokType = this.findReSyncTokenType(); + if (this.isInCurrentRuleReSyncSet(reSyncTokType)) { + recogError.resyncedTokens = this.reSyncTo(reSyncTokType); + if (this.outputCst) { + const partialCstResult = this.CST_STACK[this.CST_STACK.length - 1]; + partialCstResult.recoveredNode = true; + return partialCstResult; + } else { + return recoveryValueFunc(e3); + } + } else { + if (this.outputCst) { + const partialCstResult = this.CST_STACK[this.CST_STACK.length - 1]; + partialCstResult.recoveredNode = true; + recogError.partialCstResult = partialCstResult; + } + throw recogError; + } + } else if (isFirstInvokedRule) { + this.moveToTerminatedState(); + return recoveryValueFunc(e3); } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + throw recogError; + } + } else { + throw e3; + } + } + // Implementation of parsing DSL + optionInternal(actionORMethodDef, occurrence) { + const key = this.getKeyForAutomaticLookahead(OPTION_IDX, occurrence); + return this.optionInternalLogic(actionORMethodDef, occurrence, key); + } + optionInternalLogic(actionORMethodDef, occurrence, key) { + let lookAheadFunc = this.getLaFuncFromCache(key); + let action; + if (typeof actionORMethodDef !== "function") { + action = actionORMethodDef.DEF; + const predicate = actionORMethodDef.GATE; + if (predicate !== void 0) { + const orgLookaheadFunction = lookAheadFunc; + lookAheadFunc = /* @__PURE__ */ __name(() => { + return predicate.call(this) && orgLookaheadFunction.call(this); + }, "lookAheadFunc"); + } + } else { + action = actionORMethodDef; } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + if (lookAheadFunc.call(this) === true) { + return action.call(this); } + return void 0; } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); + atLeastOneInternal(prodOccurrence, actionORMethodDef) { + const laKey = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_IDX, prodOccurrence); + return this.atLeastOneInternalLogic(prodOccurrence, actionORMethodDef, laKey); + } + atLeastOneInternalLogic(prodOccurrence, actionORMethodDef, key) { + let lookAheadFunc = this.getLaFuncFromCache(key); + let action; + if (typeof actionORMethodDef !== "function") { + action = actionORMethodDef.DEF; + const predicate = actionORMethodDef.GATE; + if (predicate !== void 0) { + const orgLookaheadFunction = lookAheadFunc; + lookAheadFunc = /* @__PURE__ */ __name(() => { + return predicate.call(this) && orgLookaheadFunction.call(this); + }, "lookAheadFunc"); + } } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + action = actionORMethodDef; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; + if (lookAheadFunc.call(this) === true) { + let notStuck = this.doSingleRepetition(action); + while (lookAheadFunc.call(this) === true && notStuck === true) { + notStuck = this.doSingleRepetition(action); + } } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + throw this.raiseEarlyExitException(prodOccurrence, PROD_TYPE.REPETITION_MANDATORY, actionORMethodDef.ERR_MSG); + } + this.attemptInRepetitionRecovery(this.atLeastOneInternal, [prodOccurrence, actionORMethodDef], lookAheadFunc, AT_LEAST_ONE_IDX, prodOccurrence, NextTerminalAfterAtLeastOneWalker); + } + atLeastOneSepFirstInternal(prodOccurrence, options3) { + const laKey = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_SEP_IDX, prodOccurrence); + this.atLeastOneSepFirstInternalLogic(prodOccurrence, options3, laKey); + } + atLeastOneSepFirstInternalLogic(prodOccurrence, options3, key) { + const action = options3.DEF; + const separator = options3.SEP; + const firstIterationLookaheadFunc = this.getLaFuncFromCache(key); + if (firstIterationLookaheadFunc.call(this) === true) { + action.call(this); + const separatorLookAheadFunc = /* @__PURE__ */ __name(() => { + return this.tokenMatcher(this.LA(1), separator); + }, "separatorLookAheadFunc"); + while (this.tokenMatcher(this.LA(1), separator) === true) { + this.CONSUME(separator); + action.call(this); + } + this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [ + prodOccurrence, + separator, + separatorLookAheadFunc, + action, + NextTerminalAfterAtLeastOneSepWalker + ], separatorLookAheadFunc, AT_LEAST_ONE_SEP_IDX, prodOccurrence, NextTerminalAfterAtLeastOneSepWalker); + } else { + throw this.raiseEarlyExitException(prodOccurrence, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, options3.ERR_MSG); } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; + } + manyInternal(prodOccurrence, actionORMethodDef) { + const laKey = this.getKeyForAutomaticLookahead(MANY_IDX, prodOccurrence); + return this.manyInternalLogic(prodOccurrence, actionORMethodDef, laKey); + } + manyInternalLogic(prodOccurrence, actionORMethodDef, key) { + let lookaheadFunction = this.getLaFuncFromCache(key); + let action; + if (typeof actionORMethodDef !== "function") { + action = actionORMethodDef.DEF; + const predicate = actionORMethodDef.GATE; + if (predicate !== void 0) { + const orgLookaheadFunction = lookaheadFunction; + lookaheadFunction = /* @__PURE__ */ __name(() => { + return predicate.call(this) && orgLookaheadFunction.call(this); + }, "lookaheadFunction"); + } } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno + action = actionORMethodDef; + } + let notStuck = true; + while (lookaheadFunction.call(this) === true && notStuck === true) { + notStuck = this.doSingleRepetition(action); + } + this.attemptInRepetitionRecovery( + this.manyInternal, + [prodOccurrence, actionORMethodDef], + lookaheadFunction, + MANY_IDX, + prodOccurrence, + NextTerminalAfterManyWalker, + // The notStuck parameter is only relevant when "attemptInRepetitionRecovery" + // is invoked from manyInternal, in the MANY_SEP case and AT_LEAST_ONE[_SEP] + // An infinite loop cannot occur as: + // - Either the lookahead is guaranteed to consume something (Single Token Separator) + // - AT_LEAST_ONE by definition is guaranteed to consume something (or error out). + notStuck + ); + } + manySepFirstInternal(prodOccurrence, options3) { + const laKey = this.getKeyForAutomaticLookahead(MANY_SEP_IDX, prodOccurrence); + this.manySepFirstInternalLogic(prodOccurrence, options3, laKey); + } + manySepFirstInternalLogic(prodOccurrence, options3, key) { + const action = options3.DEF; + const separator = options3.SEP; + const firstIterationLaFunc = this.getLaFuncFromCache(key); + if (firstIterationLaFunc.call(this) === true) { + action.call(this); + const separatorLookAheadFunc = /* @__PURE__ */ __name(() => { + return this.tokenMatcher(this.LA(1), separator); + }, "separatorLookAheadFunc"); + while (this.tokenMatcher(this.LA(1), separator) === true) { + this.CONSUME(separator); + action.call(this); + } + this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [ + prodOccurrence, + separator, + separatorLookAheadFunc, + action, + NextTerminalAfterManySepWalker + ], separatorLookAheadFunc, MANY_SEP_IDX, prodOccurrence, NextTerminalAfterManySepWalker); + } + } + repetitionSepSecondInternal(prodOccurrence, separator, separatorLookAheadFunc, action, nextTerminalAfterWalker) { + while (separatorLookAheadFunc()) { + this.CONSUME(separator); + action.call(this); + } + this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [ + prodOccurrence, + separator, + separatorLookAheadFunc, + action, + nextTerminalAfterWalker + ], separatorLookAheadFunc, AT_LEAST_ONE_SEP_IDX, prodOccurrence, nextTerminalAfterWalker); + } + doSingleRepetition(action) { + const beforeIteration = this.getLexerPosition(); + action.call(this); + const afterIteration = this.getLexerPosition(); + return afterIteration > beforeIteration; + } + orInternal(altsOrOpts, occurrence) { + const laKey = this.getKeyForAutomaticLookahead(OR_IDX, occurrence); + const alts = isArray_default(altsOrOpts) ? altsOrOpts : altsOrOpts.DEF; + const laFunc = this.getLaFuncFromCache(laKey); + const altIdxToTake = laFunc.call(this, alts); + if (altIdxToTake !== void 0) { + const chosenAlternative = alts[altIdxToTake]; + return chosenAlternative.ALT.call(this); + } + this.raiseNoAltException(occurrence, altsOrOpts.ERR_MSG); + } + ruleFinallyStateUpdate() { + this.RULE_STACK.pop(); + this.RULE_OCCURRENCE_STACK.pop(); + this.cstFinallyStateUpdate(); + if (this.RULE_STACK.length === 0 && this.isAtEndOfInput() === false) { + const firstRedundantTok = this.LA(1); + const errMsg = this.errorMessageProvider.buildNotAllInputParsedMessage({ + firstRedundant: firstRedundantTok, + ruleName: this.getCurrRuleFullName() }); + this.SAVE_ERROR(new NotAllInputParsedException(errMsg, firstRedundantTok)); } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; + } + subruleInternal(ruleToCall, idx, options3) { + let ruleResult; + try { + const args = options3 !== void 0 ? options3.ARGS : void 0; + this.subruleIdx = idx; + ruleResult = ruleToCall.apply(this, args); + this.cstPostNonTerminal(ruleResult, options3 !== void 0 && options3.LABEL !== void 0 ? options3.LABEL : ruleToCall.ruleName); + return ruleResult; + } catch (e3) { + throw this.subruleInternalError(e3, options3, ruleToCall.ruleName); } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } + } + subruleInternalError(e3, options3, ruleName) { + if (isRecognitionException(e3) && e3.partialCstResult !== void 0) { + this.cstPostNonTerminal(e3.partialCstResult, options3 !== void 0 && options3.LABEL !== void 0 ? options3.LABEL : ruleName); + delete e3.partialCstResult; } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + throw e3; + } + consumeInternal(tokType, idx, options3) { + let consumedToken; + try { + const nextToken = this.LA(1); + if (this.tokenMatcher(nextToken, tokType) === true) { + this.consumeToken(); + consumedToken = nextToken; + } else { + this.consumeInternalError(tokType, nextToken, options3); } - return false; + } catch (eFromConsumption) { + consumedToken = this.consumeInternalRecovery(tokType, idx, eFromConsumption); } - if (this._input === "") { - return this.EOF; + this.cstPostTerminal(options3 !== void 0 && options3.LABEL !== void 0 ? options3.LABEL : tokType.name, consumedToken); + return consumedToken; + } + consumeInternalError(tokType, nextToken, options3) { + let msg; + const previousToken = this.LA(0); + if (options3 !== void 0 && options3.ERR_MSG) { + msg = options3.ERR_MSG; } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno + msg = this.errorMessageProvider.buildMismatchTokenMessage({ + expected: tokType, + actual: nextToken, + previous: previousToken, + ruleName: this.getCurrRuleFullName() }); } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; + throw this.SAVE_ERROR(new MismatchedTokenException(msg, nextToken, previousToken)); + } + consumeInternalRecovery(tokType, idx, eFromConsumption) { + if (this.recoveryEnabled && // TODO: more robust checking of the exception type. Perhaps Typescript extending expressions? + eFromConsumption.name === "MismatchedTokenException" && !this.isBackTracking()) { + const follows = this.getFollowsForInRuleRecovery(tokType, idx); + try { + return this.tryInRuleRecovery(tokType, follows); + } catch (eFromInRuleRecovery) { + if (eFromInRuleRecovery.name === IN_RULE_RECOVERY_EXCEPTION) { + throw eFromConsumption; + } else { + throw eFromInRuleRecovery; + } + } } else { - return this.lex(); + throw eFromConsumption; } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); + } + saveRecogState() { + const savedErrors = this.errors; + const savedRuleStack = clone_default2(this.RULE_STACK); + return { + errors: savedErrors, + lexerState: this.exportLexerState(), + RULE_STACK: savedRuleStack, + CST_STACK: this.CST_STACK + }; + } + reloadRecogState(newState2) { + this.errors = newState2.errors; + this.importLexerState(newState2.lexerState); + this.RULE_STACK = newState2.RULE_STACK; + } + ruleInvocationStateUpdate(shortName, fullName, idxInCallingRule) { + this.RULE_OCCURRENCE_STACK.push(idxInCallingRule); + this.RULE_STACK.push(shortName); + this.cstInvocationStateUpdate(fullName); + } + isBackTracking() { + return this.isBackTrackingStack.length !== 0; + } + getCurrRuleFullName() { + const shortName = this.getLastExplicitRuleShortName(); + return this.shortRuleNameToFull[shortName]; + } + shortRuleNameToFullName(shortName) { + return this.shortRuleNameToFull[shortName]; + } + isAtEndOfInput() { + return this.tokenMatcher(this.LA(1), EOF); + } + reset() { + this.resetLexerState(); + this.subruleIdx = 0; + this.isBackTrackingStack = []; + this.errors = []; + this.RULE_STACK = []; + this.CST_STACK = []; + this.RULE_OCCURRENCE_STACK = []; + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js + var ErrorHandler; + var init_error_handler = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js"() { + "use strict"; + init_exceptions_public(); + init_lodash(); + init_lookahead(); + init_parser(); + ErrorHandler = class { + static { + __name(this, "ErrorHandler"); + } + initErrorHandler(config6) { + this._errors = []; + this.errorMessageProvider = has_default(config6, "errorMessageProvider") ? config6.errorMessageProvider : DEFAULT_PARSER_CONFIG.errorMessageProvider; + } + SAVE_ERROR(error3) { + if (isRecognitionException(error3)) { + error3.context = { + ruleStack: this.getHumanReadableRuleStack(), + ruleOccurrenceStack: clone_default2(this.RULE_OCCURRENCE_STACK) + }; + this._errors.push(error3); + return error3; } else { - return this.conditionStack[0]; + throw Error("Trying to save an Error which is not a RecognitionException"); + } + } + get errors() { + return clone_default2(this._errors); + } + set errors(newErrors) { + this._errors = newErrors; + } + // TODO: consider caching the error message computed information + raiseEarlyExitException(occurrence, prodType, userDefinedErrMsg) { + const ruleName = this.getCurrRuleFullName(); + const ruleGrammar = this.getGAstProductions()[ruleName]; + const lookAheadPathsPerAlternative = getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, this.maxLookahead); + const insideProdPaths = lookAheadPathsPerAlternative[0]; + const actualTokens = []; + for (let i2 = 1; i2 <= this.maxLookahead; i2++) { + actualTokens.push(this.LA(i2)); + } + const msg = this.errorMessageProvider.buildEarlyExitMessage({ + expectedIterationPaths: insideProdPaths, + actual: actualTokens, + previous: this.LA(0), + customUserDescription: userDefinedErrMsg, + ruleName + }); + throw this.SAVE_ERROR(new EarlyExitException(msg, this.LA(1), this.LA(0))); + } + // TODO: consider caching the error message computed information + raiseNoAltException(occurrence, errMsgTypes) { + const ruleName = this.getCurrRuleFullName(); + const ruleGrammar = this.getGAstProductions()[ruleName]; + const lookAheadPathsPerAlternative = getLookaheadPathsForOr(occurrence, ruleGrammar, this.maxLookahead); + const actualTokens = []; + for (let i2 = 1; i2 <= this.maxLookahead; i2++) { + actualTokens.push(this.LA(i2)); + } + const previousToken = this.LA(0); + const errMsg = this.errorMessageProvider.buildNoViableAltMessage({ + expectedPathsPerAlt: lookAheadPathsPerAlternative, + actual: actualTokens, + previous: previousToken, + customUserDescription: errMsgTypes, + ruleName: this.getCurrRuleFullName() + }); + throw this.SAVE_ERROR(new NoViableAltException(errMsg, this.LA(1), previousToken)); + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js + var ContentAssist; + var init_context_assist = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js"() { + "use strict"; + init_interpreter(); + init_lodash(); + ContentAssist = class { + static { + __name(this, "ContentAssist"); + } + initContentAssist() { + } + computeContentAssist(startRuleName, precedingInput) { + const startRuleGast = this.gastProductionsCache[startRuleName]; + if (isUndefined_default(startRuleGast)) { + throw Error(`Rule ->${startRuleName}<- does not exist in this grammar.`); } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + return nextPossibleTokensAfter([startRuleGast], precedingInput, this.tokenMatcher, this.maxLookahead); + } + // TODO: should this be a member method or a utility? it does not have any state or usage of 'this'... + // TODO: should this be more explicitly part of the public API? + getNextPossibleTokenTypes(grammarPath) { + const topRuleName = head_default(grammarPath.ruleStack); + const gastProductions = this.getGAstProductions(); + const topProduction = gastProductions[topRuleName]; + const nextPossibleTokenTypes = new NextAfterTokenWalker(topProduction, grammarPath).startWalking(); + return nextPossibleTokenTypes; + } + }; + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js + function recordProd(prodConstructor, mainProdArg, occurrence, handleSep = false) { + assertMethodIdxIsValid(occurrence); + const prevProd = last_default(this.recordingProdStack); + const grammarAction = isFunction_default(mainProdArg) ? mainProdArg : mainProdArg.DEF; + const newProd = new prodConstructor({ definition: [], idx: occurrence }); + if (handleSep) { + newProd.separator = mainProdArg.SEP; + } + if (has_default(mainProdArg, "MAX_LOOKAHEAD")) { + newProd.maxLookahead = mainProdArg.MAX_LOOKAHEAD; + } + this.recordingProdStack.push(newProd); + grammarAction.call(this); + prevProd.definition.push(newProd); + this.recordingProdStack.pop(); + return RECORDING_NULL_OBJECT; + } + function recordOrProd(mainProdArg, occurrence) { + assertMethodIdxIsValid(occurrence); + const prevProd = last_default(this.recordingProdStack); + const hasOptions = isArray_default(mainProdArg) === false; + const alts = hasOptions === false ? mainProdArg : mainProdArg.DEF; + const newOrProd = new Alternation({ + definition: [], + idx: occurrence, + ignoreAmbiguities: hasOptions && mainProdArg.IGNORE_AMBIGUITIES === true + }); + if (has_default(mainProdArg, "MAX_LOOKAHEAD")) { + newOrProd.maxLookahead = mainProdArg.MAX_LOOKAHEAD; + } + const hasPredicates = some_default(alts, (currAlt) => isFunction_default(currAlt.GATE)); + newOrProd.hasPredicates = hasPredicates; + prevProd.definition.push(newOrProd); + forEach_default(alts, (currAlt) => { + const currAltFlat = new Alternative({ definition: [] }); + newOrProd.definition.push(currAltFlat); + if (has_default(currAlt, "IGNORE_AMBIGUITIES")) { + currAltFlat.ignoreAmbiguities = currAlt.IGNORE_AMBIGUITIES; + } else if (has_default(currAlt, "GATE")) { + currAltFlat.ignoreAmbiguities = true; + } + this.recordingProdStack.push(currAltFlat); + currAlt.ALT.call(this); + this.recordingProdStack.pop(); + }); + return RECORDING_NULL_OBJECT; + } + function getIdxSuffix(idx) { + return idx === 0 ? "" : `${idx}`; + } + function assertMethodIdxIsValid(idx) { + if (idx < 0 || idx > MAX_METHOD_IDX) { + const error3 = new Error( + // The stack trace will contain all the needed details + `Invalid DSL Method idx value: <${idx}> + Idx value must be a none negative value smaller than ${MAX_METHOD_IDX + 1}` + ); + error3.KNOWN_RECORDER_ERROR = true; + throw error3; + } + } + var RECORDING_NULL_OBJECT, HANDLE_SEPARATOR, MAX_METHOD_IDX, RFT, RECORDING_PHASE_TOKEN, RECORDING_PHASE_CSTNODE, GastRecorder; + var init_gast_recorder = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js"() { + "use strict"; + init_lodash(); + init_api3(); + init_lexer_public(); + init_tokens(); + init_tokens_public(); + init_parser(); + init_keys2(); + RECORDING_NULL_OBJECT = { + description: "This Object indicates the Parser is during Recording Phase" + }; + Object.freeze(RECORDING_NULL_OBJECT); + HANDLE_SEPARATOR = true; + MAX_METHOD_IDX = Math.pow(2, BITS_FOR_OCCURRENCE_IDX) - 1; + RFT = createToken({ name: "RECORDING_PHASE_TOKEN", pattern: Lexer2.NA }); + augmentTokenTypes([RFT]); + RECORDING_PHASE_TOKEN = createTokenInstance( + RFT, + "This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details", + // Using "-1" instead of NaN (as in EOF) because an actual number is less likely to + // cause errors if the output of LA or CONSUME would be (incorrectly) used during the recording phase. + -1, + -1, + -1, + -1, + -1, + -1 + ); + Object.freeze(RECORDING_PHASE_TOKEN); + RECORDING_PHASE_CSTNODE = { + name: "This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details", + children: {} + }; + GastRecorder = class { + static { + __name(this, "GastRecorder"); + } + initGastRecorder(config6) { + this.recordingProdStack = []; + this.RECORDING_PHASE = false; + } + enableRecording() { + this.RECORDING_PHASE = true; + this.TRACE_INIT("Enable Recording", () => { + for (let i2 = 0; i2 < 10; i2++) { + const idx = i2 > 0 ? i2 : ""; + this[`CONSUME${idx}`] = function(arg1, arg2) { + return this.consumeInternalRecord(arg1, i2, arg2); + }; + this[`SUBRULE${idx}`] = function(arg1, arg2) { + return this.subruleInternalRecord(arg1, i2, arg2); + }; + this[`OPTION${idx}`] = function(arg1) { + return this.optionInternalRecord(arg1, i2); + }; + this[`OR${idx}`] = function(arg1) { + return this.orInternalRecord(arg1, i2); + }; + this[`MANY${idx}`] = function(arg1) { + this.manyInternalRecord(i2, arg1); + }; + this[`MANY_SEP${idx}`] = function(arg1) { + this.manySepFirstInternalRecord(i2, arg1); + }; + this[`AT_LEAST_ONE${idx}`] = function(arg1) { + this.atLeastOneInternalRecord(i2, arg1); + }; + this[`AT_LEAST_ONE_SEP${idx}`] = function(arg1) { + this.atLeastOneSepFirstInternalRecord(i2, arg1); + }; + } + this[`consume`] = function(idx, arg1, arg2) { + return this.consumeInternalRecord(arg1, idx, arg2); + }; + this[`subrule`] = function(idx, arg1, arg2) { + return this.subruleInternalRecord(arg1, idx, arg2); + }; + this[`option`] = function(idx, arg1) { + return this.optionInternalRecord(arg1, idx); + }; + this[`or`] = function(idx, arg1) { + return this.orInternalRecord(arg1, idx); + }; + this[`many`] = function(idx, arg1) { + this.manyInternalRecord(idx, arg1); + }; + this[`atLeastOne`] = function(idx, arg1) { + this.atLeastOneInternalRecord(idx, arg1); + }; + this.ACTION = this.ACTION_RECORD; + this.BACKTRACK = this.BACKTRACK_RECORD; + this.LA = this.LA_RECORD; + }); + } + disableRecording() { + this.RECORDING_PHASE = false; + this.TRACE_INIT("Deleting Recording methods", () => { + const that = this; + for (let i2 = 0; i2 < 10; i2++) { + const idx = i2 > 0 ? i2 : ""; + delete that[`CONSUME${idx}`]; + delete that[`SUBRULE${idx}`]; + delete that[`OPTION${idx}`]; + delete that[`OR${idx}`]; + delete that[`MANY${idx}`]; + delete that[`MANY_SEP${idx}`]; + delete that[`AT_LEAST_ONE${idx}`]; + delete that[`AT_LEAST_ONE_SEP${idx}`]; + } + delete that[`consume`]; + delete that[`subrule`]; + delete that[`option`]; + delete that[`or`]; + delete that[`many`]; + delete that[`atLeastOne`]; + delete that.ACTION; + delete that.BACKTRACK; + delete that.LA; + }); + } + // Parser methods are called inside an ACTION? + // Maybe try/catch/finally on ACTIONS while disabling the recorders state changes? + // @ts-expect-error -- noop place holder + ACTION_RECORD(impl2) { + } + // Executing backtracking logic will break our recording logic assumptions + BACKTRACK_RECORD(grammarRule, args) { + return () => true; + } + // LA is part of the official API and may be used for custom lookahead logic + // by end users who may forget to wrap it in ACTION or inside a GATE + LA_RECORD(howMuch) { + return END_OF_FILE; + } + topLevelRuleRecord(name, def2) { + try { + const newTopLevelRule = new Rule({ definition: [], name }); + newTopLevelRule.name = name; + this.recordingProdStack.push(newTopLevelRule); + def2.call(this); + this.recordingProdStack.pop(); + return newTopLevelRule; + } catch (originalError) { + if (originalError.KNOWN_RECORDER_ERROR !== true) { + try { + originalError.message = originalError.message + '\n This error was thrown during the "grammar recording phase" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording'; + } catch (mutabilityError) { + throw originalError; + } + } + throw originalError; } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; + } + // Implementation of parsing DSL + optionInternalRecord(actionORMethodDef, occurrence) { + return recordProd.call(this, Option2, actionORMethodDef, occurrence); + } + atLeastOneInternalRecord(occurrence, actionORMethodDef) { + recordProd.call(this, RepetitionMandatory, actionORMethodDef, occurrence); + } + atLeastOneSepFirstInternalRecord(occurrence, options3) { + recordProd.call(this, RepetitionMandatoryWithSeparator, options3, occurrence, HANDLE_SEPARATOR); + } + manyInternalRecord(occurrence, actionORMethodDef) { + recordProd.call(this, Repetition, actionORMethodDef, occurrence); + } + manySepFirstInternalRecord(occurrence, options3) { + recordProd.call(this, RepetitionWithSeparator, options3, occurrence, HANDLE_SEPARATOR); + } + orInternalRecord(altsOrOpts, occurrence) { + return recordOrProd.call(this, altsOrOpts, occurrence); + } + subruleInternalRecord(ruleToCall, occurrence, options3) { + assertMethodIdxIsValid(occurrence); + if (!ruleToCall || has_default(ruleToCall, "ruleName") === false) { + const error3 = new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(ruleToCall)}> + inside top level rule: <${this.recordingProdStack[0].name}>`); + error3.KNOWN_RECORDER_ERROR = true; + throw error3; + } + const prevProd = last_default(this.recordingProdStack); + const ruleName = ruleToCall.ruleName; + const newNoneTerminal = new NonTerminal({ + idx: occurrence, + nonTerminalName: ruleName, + label: options3 === null || options3 === void 0 ? void 0 : options3.LABEL, + // The resolving of the `referencedRule` property will be done once all the Rule's GASTs have been created + referencedRule: void 0 + }); + prevProd.definition.push(newNoneTerminal); + return this.outputCst ? RECORDING_PHASE_CSTNODE : RECORDING_NULL_OBJECT; + } + consumeInternalRecord(tokType, occurrence, options3) { + assertMethodIdxIsValid(occurrence); + if (!hasShortKeyProperty(tokType)) { + const error3 = new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(tokType)}> + inside top level rule: <${this.recordingProdStack[0].name}>`); + error3.KNOWN_RECORDER_ERROR = true; + throw error3; + } + const prevProd = last_default(this.recordingProdStack); + const newNoneTerminal = new Terminal({ + idx: occurrence, + terminalType: tokType, + label: options3 === null || options3 === void 0 ? void 0 : options3.LABEL + }); + prevProd.definition.push(newNoneTerminal); + return RECORDING_PHASE_TOKEN; + } + }; + __name(recordProd, "recordProd"); + __name(recordOrProd, "recordOrProd"); + __name(getIdxSuffix, "getIdxSuffix"); + __name(assertMethodIdxIsValid, "assertMethodIdxIsValid"); + } + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js + var PerformanceTracer; + var init_perf_tracer = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js"() { + "use strict"; + init_lodash(); + init_api2(); + init_parser(); + PerformanceTracer = class { + static { + __name(this, "PerformanceTracer"); + } + initPerformanceTracer(config6) { + if (has_default(config6, "traceInitPerf")) { + const userTraceInitPerf = config6.traceInitPerf; + const traceIsNumber = typeof userTraceInitPerf === "number"; + this.traceInitMaxIdent = traceIsNumber ? userTraceInitPerf : Infinity; + this.traceInitPerf = traceIsNumber ? userTraceInitPerf > 0 : userTraceInitPerf; } else { - return "INITIAL"; + this.traceInitMaxIdent = 0; + this.traceInitPerf = DEFAULT_PARSER_CONFIG.traceInitPerf; } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - break; - case 1: - break; - case 2: - this.popState(); - return 34; - case 3: - this.popState(); - return 34; - case 4: - return 34; - case 5: - break; - case 6: - return 10; - case 7: - this.pushState("acc_title"); - return 19; - case 8: - this.popState(); - return "acc_title_value"; - case 9: - this.pushState("acc_descr"); - return 21; - case 10: - this.popState(); - return "acc_descr_value"; - case 11: - this.pushState("acc_descr_multiline"); - break; - case 12: - this.popState(); - break; - case 13: - return "acc_descr_multiline_value"; - case 14: - return 5; - case 15: - return 8; - case 16: - this.pushState("axis_data"); - return "X_AXIS"; - case 17: - this.pushState("axis_data"); - return "Y_AXIS"; - case 18: - this.pushState("axis_band_data"); - return 24; - case 19: - return 31; - case 20: - this.pushState("data"); - return 16; - case 21: - this.pushState("data"); - return 18; - case 22: - this.pushState("data_inner"); - return 24; - case 23: - return 27; - case 24: - this.popState(); - return 26; - case 25: - this.popState(); - break; - case 26: - this.pushState("string"); - break; - case 27: - this.popState(); - break; - case 28: - return "STR"; - case 29: - return 24; - case 30: - return 26; - case 31: - return 43; - case 32: - return "COLON"; - case 33: - return 44; - case 34: - return 28; - case 35: - return 45; - case 36: - return 46; - case 37: - return 48; - case 38: - return 50; - case 39: - return 47; - case 40: - return 41; - case 41: - return 49; - case 42: - return 42; - case 43: - break; - case 44: - return 35; - case 45: - return 36; + this.traceInitIndent = -1; + } + TRACE_INIT(phaseDesc, phaseImpl) { + if (this.traceInitPerf === true) { + this.traceInitIndent++; + const indent = new Array(this.traceInitIndent + 1).join(" "); + if (this.traceInitIndent < this.traceInitMaxIdent) { + console.log(`${indent}--> <${phaseDesc}>`); + } + const { time: time4, value: value2 } = timer2(phaseImpl); + const traceMethod = time4 > 10 ? console.warn : console.log; + if (this.traceInitIndent < this.traceInitMaxIdent) { + traceMethod(`${indent}<-- <${phaseDesc}> time: ${time4}ms`); + } + this.traceInitIndent--; + return value2; + } else { + return phaseImpl(); } - }, - rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i], - conditions: { "data_inner": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "data": { "rules": [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_band_data": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_data": { "rules": [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "title": { "rules": [], "inclusive": false }, "md_string": { "rules": [], "inclusive": false }, "string": { "rules": [27, 28], "inclusive": false }, "INITIAL": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true } } + } }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$i.parser = parser$i; - const parser$j = parser$i; - function isBarPlot(data) { - return data.type === "bar"; - } - function isBandAxisData(data) { - return data.type === "band"; - } - function isLinearAxisData(data) { - return data.type === "linear"; - } - class TextDimensionCalculatorWithFont { - constructor(parentGroup) { - this.parentGroup = parentGroup; - } - getMaxDimension(texts, fontSize) { - if (!this.parentGroup) { - return { - width: texts.reduce((acc, cur) => Math.max(cur.length, acc), 0) * fontSize, - height: fontSize - }; - } - const dimension = { - width: 0, - height: 0 - }; - const elem = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", fontSize); - for (const t of texts) { - const bbox = computeDimensionOfText(elem, 1, t); - const width2 = bbox ? bbox.width : t.length * fontSize; - const height = bbox ? bbox.height : fontSize; - dimension.width = Math.max(dimension.width, width2); - dimension.height = Math.max(dimension.height, height); - } - elem.remove(); - return dimension; - } - } - const BAR_WIDTH_TO_TICK_WIDTH_RATIO = 0.7; - const MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL = 0.2; - class BaseAxis { - constructor(axisConfig, title2, textDimensionCalculator, axisThemeConfig) { - this.axisConfig = axisConfig; - this.title = title2; - this.textDimensionCalculator = textDimensionCalculator; - this.axisThemeConfig = axisThemeConfig; - this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }; - this.axisPosition = "left"; - this.showTitle = false; - this.showLabel = false; - this.showTick = false; - this.showAxisLine = false; - this.outerPadding = 0; - this.titleTextHeight = 0; - this.labelTextHeight = 0; - this.range = [0, 10]; - this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }; - this.axisPosition = "left"; - } - setRange(range2) { - this.range = range2; - if (this.axisPosition === "left" || this.axisPosition === "right") { - this.boundingRect.height = range2[1] - range2[0]; - } else { - this.boundingRect.width = range2[1] - range2[0]; - } - this.recalculateScale(); - } - getRange() { - return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding]; - } - setAxisPosition(axisPosition) { - this.axisPosition = axisPosition; - this.setRange(this.range); - } - getTickDistance() { - const range2 = this.getRange(); - return Math.abs(range2[0] - range2[1]) / this.getTickValues().length; - } - getAxisOuterPadding() { - return this.outerPadding; - } - getLabelDimension() { - return this.textDimensionCalculator.getMaxDimension( - this.getTickValues().map((tick) => tick.toString()), - this.axisConfig.labelFontSize - ); } - recalculateOuterPaddingToDrawBar() { - if (BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() > this.outerPadding * 2) { - this.outerPadding = Math.floor(BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() / 2); - } - this.recalculateScale(); - } - calculateSpaceIfDrawnHorizontally(availableSpace) { - let availableHeight = availableSpace.height; - if (this.axisConfig.showAxisLine && availableHeight > this.axisConfig.axisLineWidth) { - availableHeight -= this.axisConfig.axisLineWidth; - this.showAxisLine = true; - } - if (this.axisConfig.showLabel) { - const spaceRequired = this.getLabelDimension(); - const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.width; - this.outerPadding = Math.min(spaceRequired.width / 2, maxPadding); - const heightRequired = spaceRequired.height + this.axisConfig.labelPadding * 2; - this.labelTextHeight = spaceRequired.height; - if (heightRequired <= availableHeight) { - availableHeight -= heightRequired; - this.showLabel = true; - } - } - if (this.axisConfig.showTick && availableHeight >= this.axisConfig.tickLength) { - this.showTick = true; - availableHeight -= this.axisConfig.tickLength; - } - if (this.axisConfig.showTitle && this.title) { - const spaceRequired = this.textDimensionCalculator.getMaxDimension( - [this.title], - this.axisConfig.titleFontSize - ); - const heightRequired = spaceRequired.height + this.axisConfig.titlePadding * 2; - this.titleTextHeight = spaceRequired.height; - if (heightRequired <= availableHeight) { - availableHeight -= heightRequired; - this.showTitle = true; - } - } - this.boundingRect.width = availableSpace.width; - this.boundingRect.height = availableSpace.height - availableHeight; - } - calculateSpaceIfDrawnVertical(availableSpace) { - let availableWidth = availableSpace.width; - if (this.axisConfig.showAxisLine && availableWidth > this.axisConfig.axisLineWidth) { - availableWidth -= this.axisConfig.axisLineWidth; - this.showAxisLine = true; - } - if (this.axisConfig.showLabel) { - const spaceRequired = this.getLabelDimension(); - const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.height; - this.outerPadding = Math.min(spaceRequired.height / 2, maxPadding); - const widthRequired = spaceRequired.width + this.axisConfig.labelPadding * 2; - if (widthRequired <= availableWidth) { - availableWidth -= widthRequired; - this.showLabel = true; - } - } - if (this.axisConfig.showTick && availableWidth >= this.axisConfig.tickLength) { - this.showTick = true; - availableWidth -= this.axisConfig.tickLength; - } - if (this.axisConfig.showTitle && this.title) { - const spaceRequired = this.textDimensionCalculator.getMaxDimension( - [this.title], - this.axisConfig.titleFontSize - ); - const widthRequired = spaceRequired.height + this.axisConfig.titlePadding * 2; - this.titleTextHeight = spaceRequired.height; - if (widthRequired <= availableWidth) { - availableWidth -= widthRequired; - this.showTitle = true; + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/utils/apply_mixins.js + function applyMixins(derivedCtor, baseCtors) { + baseCtors.forEach((baseCtor) => { + const baseProto = baseCtor.prototype; + Object.getOwnPropertyNames(baseProto).forEach((propName) => { + if (propName === "constructor") { + return; } - } - this.boundingRect.width = availableSpace.width - availableWidth; - this.boundingRect.height = availableSpace.height; + const basePropDescriptor = Object.getOwnPropertyDescriptor(baseProto, propName); + if (basePropDescriptor && (basePropDescriptor.get || basePropDescriptor.set)) { + Object.defineProperty(derivedCtor.prototype, propName, basePropDescriptor); + } else { + derivedCtor.prototype[propName] = baseCtor.prototype[propName]; + } + }); + }); + } + var init_apply_mixins = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/utils/apply_mixins.js"() { + "use strict"; + __name(applyMixins, "applyMixins"); } - calculateSpace(availableSpace) { - if (this.axisPosition === "left" || this.axisPosition === "right") { - this.calculateSpaceIfDrawnVertical(availableSpace); - } else { - this.calculateSpaceIfDrawnHorizontally(availableSpace); - } - this.recalculateScale(); - return { - width: this.boundingRect.width, - height: this.boundingRect.height - }; - } - setBoundingBoxXY(point2) { - this.boundingRect.x = point2.x; - this.boundingRect.y = point2.y; - } - getDrawableElementsForLeftAxis() { - const drawableElement = []; - if (this.showAxisLine) { - const x2 = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2; - drawableElement.push({ - type: "path", - groupTexts: ["left-axis", "axisl-line"], - data: [ - { - path: `M ${x2},${this.boundingRect.y} L ${x2},${this.boundingRect.y + this.boundingRect.height} `, - strokeFill: this.axisThemeConfig.axisLineColor, - strokeWidth: this.axisConfig.axisLineWidth + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/parser.js + function EMPTY_ALT(value2 = void 0) { + return function() { + return value2; + }; + } + var END_OF_FILE, DEFAULT_PARSER_CONFIG, DEFAULT_RULE_CONFIG, ParserDefinitionErrorType, Parser2, EmbeddedActionsParser; + var init_parser = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/parser/parser.js"() { + "use strict"; + init_lodash(); + init_api2(); + init_follow(); + init_tokens_public(); + init_errors_public(); + init_gast_resolver_public(); + init_recoverable(); + init_looksahead(); + init_tree_builder(); + init_lexer_adapter(); + init_recognizer_api(); + init_recognizer_engine(); + init_error_handler(); + init_context_assist(); + init_gast_recorder(); + init_perf_tracer(); + init_apply_mixins(); + init_checks(); + END_OF_FILE = createTokenInstance(EOF, "", NaN, NaN, NaN, NaN, NaN, NaN); + Object.freeze(END_OF_FILE); + DEFAULT_PARSER_CONFIG = Object.freeze({ + recoveryEnabled: false, + maxLookahead: 3, + dynamicTokensEnabled: false, + outputCst: true, + errorMessageProvider: defaultParserErrorProvider, + nodeLocationTracking: "none", + traceInitPerf: false, + skipValidations: false + }); + DEFAULT_RULE_CONFIG = Object.freeze({ + recoveryValueFunc: /* @__PURE__ */ __name(() => void 0, "recoveryValueFunc"), + resyncEnabled: true + }); + (function(ParserDefinitionErrorType2) { + ParserDefinitionErrorType2[ParserDefinitionErrorType2["INVALID_RULE_NAME"] = 0] = "INVALID_RULE_NAME"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["DUPLICATE_RULE_NAME"] = 1] = "DUPLICATE_RULE_NAME"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["INVALID_RULE_OVERRIDE"] = 2] = "INVALID_RULE_OVERRIDE"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["DUPLICATE_PRODUCTIONS"] = 3] = "DUPLICATE_PRODUCTIONS"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["UNRESOLVED_SUBRULE_REF"] = 4] = "UNRESOLVED_SUBRULE_REF"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["LEFT_RECURSION"] = 5] = "LEFT_RECURSION"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["NONE_LAST_EMPTY_ALT"] = 6] = "NONE_LAST_EMPTY_ALT"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["AMBIGUOUS_ALTS"] = 7] = "AMBIGUOUS_ALTS"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["CONFLICT_TOKENS_RULES_NAMESPACE"] = 8] = "CONFLICT_TOKENS_RULES_NAMESPACE"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["INVALID_TOKEN_NAME"] = 9] = "INVALID_TOKEN_NAME"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["NO_NON_EMPTY_LOOKAHEAD"] = 10] = "NO_NON_EMPTY_LOOKAHEAD"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["AMBIGUOUS_PREFIX_ALTS"] = 11] = "AMBIGUOUS_PREFIX_ALTS"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["TOO_MANY_ALTS"] = 12] = "TOO_MANY_ALTS"; + ParserDefinitionErrorType2[ParserDefinitionErrorType2["CUSTOM_LOOKAHEAD_VALIDATION"] = 13] = "CUSTOM_LOOKAHEAD_VALIDATION"; + })(ParserDefinitionErrorType || (ParserDefinitionErrorType = {})); + __name(EMPTY_ALT, "EMPTY_ALT"); + Parser2 = class _Parser2 { + static { + __name(this, "Parser"); + } + /** + * @deprecated use the **instance** method with the same name instead + */ + static performSelfAnalysis(parserInstance) { + throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead."); + } + performSelfAnalysis() { + this.TRACE_INIT("performSelfAnalysis", () => { + let defErrorsMsgs; + this.selfAnalysisDone = true; + const className = this.className; + this.TRACE_INIT("toFastProps", () => { + toFastProperties(this); + }); + this.TRACE_INIT("Grammar Recording", () => { + try { + this.enableRecording(); + forEach_default(this.definedRulesNames, (currRuleName) => { + const wrappedRule = this[currRuleName]; + const originalGrammarAction = wrappedRule["originalGrammarAction"]; + let recordedRuleGast; + this.TRACE_INIT(`${currRuleName} Rule`, () => { + recordedRuleGast = this.topLevelRuleRecord(currRuleName, originalGrammarAction); + }); + this.gastProductionsCache[currRuleName] = recordedRuleGast; + }); + } finally { + this.disableRecording(); + } + }); + let resolverErrors = []; + this.TRACE_INIT("Grammar Resolving", () => { + resolverErrors = resolveGrammar2({ + rules: values_default(this.gastProductionsCache) + }); + this.definitionErrors = this.definitionErrors.concat(resolverErrors); + }); + this.TRACE_INIT("Grammar Validations", () => { + if (isEmpty_default(resolverErrors) && this.skipValidations === false) { + const validationErrors = validateGrammar2({ + rules: values_default(this.gastProductionsCache), + tokenTypes: values_default(this.tokensMap), + errMsgProvider: defaultGrammarValidatorErrorProvider, + grammarName: className + }); + const lookaheadValidationErrors = validateLookahead({ + lookaheadStrategy: this.lookaheadStrategy, + rules: values_default(this.gastProductionsCache), + tokenTypes: values_default(this.tokensMap), + grammarName: className + }); + this.definitionErrors = this.definitionErrors.concat(validationErrors, lookaheadValidationErrors); + } + }); + if (isEmpty_default(this.definitionErrors)) { + if (this.recoveryEnabled) { + this.TRACE_INIT("computeAllProdsFollows", () => { + const allFollows = computeAllProdsFollows(values_default(this.gastProductionsCache)); + this.resyncFollows = allFollows; + }); + } + this.TRACE_INIT("ComputeLookaheadFunctions", () => { + var _a, _b; + (_b = (_a = this.lookaheadStrategy).initialize) === null || _b === void 0 ? void 0 : _b.call(_a, { + rules: values_default(this.gastProductionsCache) + }); + this.preComputeLookaheadFunctions(values_default(this.gastProductionsCache)); + }); } - ] - }); - } - if (this.showLabel) { - drawableElement.push({ - type: "text", - groupTexts: ["left-axis", "label"], - data: this.getTickValues().map((tick) => ({ - text: tick.toString(), - x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0), - y: this.getScaleValue(tick), - fill: this.axisThemeConfig.labelColor, - fontSize: this.axisConfig.labelFontSize, - rotation: 0, - verticalPos: "middle", - horizontalPos: "right" - })) - }); - } - if (this.showTick) { - const x2 = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); - drawableElement.push({ - type: "path", - groupTexts: ["left-axis", "ticks"], - data: this.getTickValues().map((tick) => ({ - path: `M ${x2},${this.getScaleValue(tick)} L ${x2 - this.axisConfig.tickLength},${this.getScaleValue(tick)}`, - strokeFill: this.axisThemeConfig.tickColor, - strokeWidth: this.axisConfig.tickWidth - })) - }); - } - if (this.showTitle) { - drawableElement.push({ - type: "text", - groupTexts: ["left-axis", "title"], - data: [ - { - text: this.title, - x: this.boundingRect.x + this.axisConfig.titlePadding, - y: this.boundingRect.y + this.boundingRect.height / 2, - fill: this.axisThemeConfig.titleColor, - fontSize: this.axisConfig.titleFontSize, - rotation: 270, - verticalPos: "top", - horizontalPos: "center" + if (!_Parser2.DEFER_DEFINITION_ERRORS_HANDLING && !isEmpty_default(this.definitionErrors)) { + defErrorsMsgs = map_default(this.definitionErrors, (defError) => defError.message); + throw new Error(`Parser Definition Errors detected: + ${defErrorsMsgs.join("\n-------------------------------\n")}`); } - ] - }); - } - return drawableElement; + }); + } + constructor(tokenVocabulary, config6) { + this.definitionErrors = []; + this.selfAnalysisDone = false; + const that = this; + that.initErrorHandler(config6); + that.initLexerAdapter(); + that.initLooksAhead(config6); + that.initRecognizerEngine(tokenVocabulary, config6); + that.initRecoverable(config6); + that.initTreeBuilder(config6); + that.initContentAssist(); + that.initGastRecorder(config6); + that.initPerformanceTracer(config6); + if (has_default(config6, "ignoredIssues")) { + throw new Error("The IParserConfig property has been deprecated.\n Please use the flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details."); + } + this.skipValidations = has_default(config6, "skipValidations") ? config6.skipValidations : DEFAULT_PARSER_CONFIG.skipValidations; + } + }; + Parser2.DEFER_DEFINITION_ERRORS_HANDLING = false; + applyMixins(Parser2, [ + Recoverable, + LooksAhead, + TreeBuilder, + LexerAdapter, + RecognizerEngine, + RecognizerApi, + ErrorHandler, + ContentAssist, + GastRecorder, + PerformanceTracer + ]); + EmbeddedActionsParser = class extends Parser2 { + static { + __name(this, "EmbeddedActionsParser"); + } + constructor(tokenVocabulary, config6 = DEFAULT_PARSER_CONFIG) { + const configClone = clone_default2(config6); + configClone.outputCst = false; + super(tokenVocabulary, configClone); + } + }; } - getDrawableElementsForBottomAxis() { - const drawableElement = []; - if (this.showAxisLine) { - const y2 = this.boundingRect.y + this.axisConfig.axisLineWidth / 2; - drawableElement.push({ - type: "path", - groupTexts: ["bottom-axis", "axis-line"], - data: [ - { - path: `M ${this.boundingRect.x},${y2} L ${this.boundingRect.x + this.boundingRect.width},${y2}`, - strokeFill: this.axisThemeConfig.axisLineColor, - strokeWidth: this.axisConfig.axisLineWidth - } - ] - }); - } - if (this.showLabel) { - drawableElement.push({ - type: "text", - groupTexts: ["bottom-axis", "label"], - data: this.getTickValues().map((tick) => ({ - text: tick.toString(), - x: this.getScaleValue(tick), - y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0), - fill: this.axisThemeConfig.labelColor, - fontSize: this.axisConfig.labelFontSize, - rotation: 0, - verticalPos: "top", - horizontalPos: "center" - })) - }); - } - if (this.showTick) { - const y2 = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); - drawableElement.push({ - type: "path", - groupTexts: ["bottom-axis", "ticks"], - data: this.getTickValues().map((tick) => ({ - path: `M ${this.getScaleValue(tick)},${y2} L ${this.getScaleValue(tick)},${y2 + this.axisConfig.tickLength}`, - strokeFill: this.axisThemeConfig.tickColor, - strokeWidth: this.axisConfig.tickWidth - })) - }); - } - if (this.showTitle) { - drawableElement.push({ - type: "text", - groupTexts: ["bottom-axis", "title"], - data: [ - { - text: this.title, - x: this.range[0] + (this.range[1] - this.range[0]) / 2, - y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight, - fill: this.axisThemeConfig.titleColor, - fontSize: this.axisConfig.titleFontSize, - rotation: 0, - verticalPos: "top", - horizontalPos: "center" - } - ] - }); - } - return drawableElement; + }); + + // ../../node_modules/.pnpm/@chevrotain+cst-dts-gen@11.0.3/node_modules/@chevrotain/cst-dts-gen/lib/src/model.js + var init_model2 = __esm({ + "../../node_modules/.pnpm/@chevrotain+cst-dts-gen@11.0.3/node_modules/@chevrotain/cst-dts-gen/lib/src/model.js"() { + "use strict"; + init_api3(); } - getDrawableElementsForTopAxis() { - const drawableElement = []; - if (this.showAxisLine) { - const y2 = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2; - drawableElement.push({ - type: "path", - groupTexts: ["top-axis", "axis-line"], - data: [ - { - path: `M ${this.boundingRect.x},${y2} L ${this.boundingRect.x + this.boundingRect.width},${y2}`, - strokeFill: this.axisThemeConfig.axisLineColor, - strokeWidth: this.axisConfig.axisLineWidth - } - ] - }); - } - if (this.showLabel) { - drawableElement.push({ - type: "text", - groupTexts: ["top-axis", "label"], - data: this.getTickValues().map((tick) => ({ - text: tick.toString(), - x: this.getScaleValue(tick), - y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding, - fill: this.axisThemeConfig.labelColor, - fontSize: this.axisConfig.labelFontSize, - rotation: 0, - verticalPos: "top", - horizontalPos: "center" - })) - }); - } - if (this.showTick) { - const y2 = this.boundingRect.y; - drawableElement.push({ - type: "path", - groupTexts: ["top-axis", "ticks"], - data: this.getTickValues().map((tick) => ({ - path: `M ${this.getScaleValue(tick)},${y2 + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(tick)},${y2 + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`, - strokeFill: this.axisThemeConfig.tickColor, - strokeWidth: this.axisConfig.tickWidth - })) - }); - } - if (this.showTitle) { - drawableElement.push({ - type: "text", - groupTexts: ["top-axis", "title"], - data: [ - { - text: this.title, - x: this.boundingRect.x + this.boundingRect.width / 2, - y: this.boundingRect.y + this.axisConfig.titlePadding, - fill: this.axisThemeConfig.titleColor, - fontSize: this.axisConfig.titleFontSize, - rotation: 0, - verticalPos: "top", - horizontalPos: "center" - } - ] - }); - } - return drawableElement; + }); + + // ../../node_modules/.pnpm/@chevrotain+cst-dts-gen@11.0.3/node_modules/@chevrotain/cst-dts-gen/lib/src/generate.js + var init_generate = __esm({ + "../../node_modules/.pnpm/@chevrotain+cst-dts-gen@11.0.3/node_modules/@chevrotain/cst-dts-gen/lib/src/generate.js"() { + "use strict"; } - getDrawableElements() { - if (this.axisPosition === "left") { - return this.getDrawableElementsForLeftAxis(); - } - if (this.axisPosition === "right") { - throw Error("Drawing of right axis is not implemented"); - } - if (this.axisPosition === "bottom") { - return this.getDrawableElementsForBottomAxis(); - } - if (this.axisPosition === "top") { - return this.getDrawableElementsForTopAxis(); - } - return []; + }); + + // ../../node_modules/.pnpm/@chevrotain+cst-dts-gen@11.0.3/node_modules/@chevrotain/cst-dts-gen/lib/src/api.js + var init_api4 = __esm({ + "../../node_modules/.pnpm/@chevrotain+cst-dts-gen@11.0.3/node_modules/@chevrotain/cst-dts-gen/lib/src/api.js"() { + "use strict"; + init_model2(); + init_generate(); } - } - class BandAxis extends BaseAxis { - constructor(axisConfig, axisThemeConfig, categories, title2, textDimensionCalculator) { - super(axisConfig, title2, textDimensionCalculator, axisThemeConfig); - this.categories = categories; - this.scale = band().domain(this.categories).range(this.getRange()); + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/diagrams/render_public.js + var init_render_public = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/diagrams/render_public.js"() { + "use strict"; + init_version(); } - setRange(range2) { - super.setRange(range2); + }); + + // ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/api.js + var init_api5 = __esm({ + "../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/api.js"() { + "use strict"; + init_version(); + init_parser(); + init_lexer_public(); + init_tokens_public(); + init_lookahead(); + init_llk_lookahead(); + init_errors_public(); + init_exceptions_public(); + init_lexer_errors_public(); + init_api3(); + init_api3(); + init_api4(); + init_render_public(); } - recalculateScale() { - this.scale = band().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5); - log$1.trace("BandAxis axis final categories, range: ", this.categories, this.getRange()); + }); + + // ../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/atn.js + function buildATNKey(rule, type3, occurrence) { + return `${rule.name}_${type3}_${occurrence}`; + } + function createATN(rules) { + const atn = { + decisionMap: {}, + decisionStates: [], + ruleToStartState: /* @__PURE__ */ new Map(), + ruleToStopState: /* @__PURE__ */ new Map(), + states: [] + }; + createRuleStartAndStopATNStates(atn, rules); + const ruleLength = rules.length; + for (let i2 = 0; i2 < ruleLength; i2++) { + const rule = rules[i2]; + const ruleBlock = block2(atn, rule, rule); + if (ruleBlock === void 0) { + continue; + } + buildRuleHandle(atn, rule, ruleBlock); } - getTickValues() { - return this.categories; + return atn; + } + function createRuleStartAndStopATNStates(atn, rules) { + const ruleLength = rules.length; + for (let i2 = 0; i2 < ruleLength; i2++) { + const rule = rules[i2]; + const start3 = newState(atn, rule, void 0, { + type: ATN_RULE_START + }); + const stop5 = newState(atn, rule, void 0, { + type: ATN_RULE_STOP + }); + start3.stop = stop5; + atn.ruleToStartState.set(rule, start3); + atn.ruleToStopState.set(rule, stop5); + } + } + function atom(atn, rule, production) { + if (production instanceof Terminal) { + return tokenRef(atn, rule, production.terminalType, production); + } else if (production instanceof NonTerminal) { + return ruleRef(atn, rule, production); + } else if (production instanceof Alternation) { + return alternation(atn, rule, production); + } else if (production instanceof Option2) { + return option(atn, rule, production); + } else if (production instanceof Repetition) { + return repetition(atn, rule, production); + } else if (production instanceof RepetitionWithSeparator) { + return repetitionSep(atn, rule, production); + } else if (production instanceof RepetitionMandatory) { + return repetitionMandatory(atn, rule, production); + } else if (production instanceof RepetitionMandatoryWithSeparator) { + return repetitionMandatorySep(atn, rule, production); + } else { + return block2(atn, rule, production); } - getScaleValue(value2) { - return this.scale(value2) || this.getRange()[0]; + } + function repetition(atn, rule, repetition2) { + const starState = newState(atn, rule, repetition2, { + type: ATN_STAR_BLOCK_START + }); + defineDecisionState(atn, starState); + const handle = makeAlts(atn, rule, starState, repetition2, block2(atn, rule, repetition2)); + return star(atn, rule, repetition2, handle); + } + function repetitionSep(atn, rule, repetition2) { + const starState = newState(atn, rule, repetition2, { + type: ATN_STAR_BLOCK_START + }); + defineDecisionState(atn, starState); + const handle = makeAlts(atn, rule, starState, repetition2, block2(atn, rule, repetition2)); + const sep2 = tokenRef(atn, rule, repetition2.separator, repetition2); + return star(atn, rule, repetition2, handle, sep2); + } + function repetitionMandatory(atn, rule, repetition2) { + const plusState = newState(atn, rule, repetition2, { + type: ATN_PLUS_BLOCK_START + }); + defineDecisionState(atn, plusState); + const handle = makeAlts(atn, rule, plusState, repetition2, block2(atn, rule, repetition2)); + return plus(atn, rule, repetition2, handle); + } + function repetitionMandatorySep(atn, rule, repetition2) { + const plusState = newState(atn, rule, repetition2, { + type: ATN_PLUS_BLOCK_START + }); + defineDecisionState(atn, plusState); + const handle = makeAlts(atn, rule, plusState, repetition2, block2(atn, rule, repetition2)); + const sep2 = tokenRef(atn, rule, repetition2.separator, repetition2); + return plus(atn, rule, repetition2, handle, sep2); + } + function alternation(atn, rule, alternation2) { + const start3 = newState(atn, rule, alternation2, { + type: ATN_BASIC + }); + defineDecisionState(atn, start3); + const alts = map_default(alternation2.definition, (e3) => atom(atn, rule, e3)); + const handle = makeAlts(atn, rule, start3, alternation2, ...alts); + return handle; + } + function option(atn, rule, option2) { + const start3 = newState(atn, rule, option2, { + type: ATN_BASIC + }); + defineDecisionState(atn, start3); + const handle = makeAlts(atn, rule, start3, option2, block2(atn, rule, option2)); + return optional(atn, rule, option2, handle); + } + function block2(atn, rule, block3) { + const handles = filter_default3(map_default(block3.definition, (e3) => atom(atn, rule, e3)), (e3) => e3 !== void 0); + if (handles.length === 1) { + return handles[0]; + } else if (handles.length === 0) { + return void 0; + } else { + return makeBlock(atn, handles); } } - class LinearAxis extends BaseAxis { - constructor(axisConfig, axisThemeConfig, domain, title2, textDimensionCalculator) { - super(axisConfig, title2, textDimensionCalculator, axisThemeConfig); - this.domain = domain; - this.scale = linear().domain(this.domain).range(this.getRange()); + function plus(atn, rule, plus2, handle, sep2) { + const blkStart = handle.left; + const blkEnd = handle.right; + const loop = newState(atn, rule, plus2, { + type: ATN_PLUS_LOOP_BACK + }); + defineDecisionState(atn, loop); + const end2 = newState(atn, rule, plus2, { + type: ATN_LOOP_END + }); + blkStart.loopback = loop; + end2.loopback = loop; + atn.decisionMap[buildATNKey(rule, sep2 ? "RepetitionMandatoryWithSeparator" : "RepetitionMandatory", plus2.idx)] = loop; + epsilon4(blkEnd, loop); + if (sep2 === void 0) { + epsilon4(loop, blkStart); + epsilon4(loop, end2); + } else { + epsilon4(loop, end2); + epsilon4(loop, sep2.left); + epsilon4(sep2.right, blkStart); } - getTickValues() { - return this.scale.ticks(); + return { + left: blkStart, + right: end2 + }; + } + function star(atn, rule, star2, handle, sep2) { + const start3 = handle.left; + const end2 = handle.right; + const entry = newState(atn, rule, star2, { + type: ATN_STAR_LOOP_ENTRY + }); + defineDecisionState(atn, entry); + const loopEnd = newState(atn, rule, star2, { + type: ATN_LOOP_END + }); + const loop = newState(atn, rule, star2, { + type: ATN_STAR_LOOP_BACK + }); + entry.loopback = loop; + loopEnd.loopback = loop; + epsilon4(entry, start3); + epsilon4(entry, loopEnd); + epsilon4(end2, loop); + if (sep2 !== void 0) { + epsilon4(loop, loopEnd); + epsilon4(loop, sep2.left); + epsilon4(sep2.right, start3); + } else { + epsilon4(loop, entry); } - recalculateScale() { - const domain = [...this.domain]; - if (this.axisPosition === "left") { - domain.reverse(); + atn.decisionMap[buildATNKey(rule, sep2 ? "RepetitionWithSeparator" : "Repetition", star2.idx)] = entry; + return { + left: entry, + right: loopEnd + }; + } + function optional(atn, rule, optional2, handle) { + const start3 = handle.left; + const end2 = handle.right; + epsilon4(start3, end2); + atn.decisionMap[buildATNKey(rule, "Option", optional2.idx)] = start3; + return handle; + } + function defineDecisionState(atn, state4) { + atn.decisionStates.push(state4); + state4.decision = atn.decisionStates.length - 1; + return state4.decision; + } + function makeAlts(atn, rule, start3, production, ...alts) { + const end2 = newState(atn, rule, production, { + type: ATN_BLOCK_END, + start: start3 + }); + start3.end = end2; + for (const alt of alts) { + if (alt !== void 0) { + epsilon4(start3, alt.left); + epsilon4(alt.right, end2); + } else { + epsilon4(start3, end2); } - this.scale = linear().domain(domain).range(this.getRange()); } - getScaleValue(value2) { - return this.scale(value2); + const handle = { + left: start3, + right: end2 + }; + atn.decisionMap[buildATNKey(rule, getProdType2(production), production.idx)] = start3; + return handle; + } + function getProdType2(production) { + if (production instanceof Alternation) { + return "Alternation"; + } else if (production instanceof Option2) { + return "Option"; + } else if (production instanceof Repetition) { + return "Repetition"; + } else if (production instanceof RepetitionWithSeparator) { + return "RepetitionWithSeparator"; + } else if (production instanceof RepetitionMandatory) { + return "RepetitionMandatory"; + } else if (production instanceof RepetitionMandatoryWithSeparator) { + return "RepetitionMandatoryWithSeparator"; + } else { + throw new Error("Invalid production type encountered"); + } + } + function makeBlock(atn, alts) { + const altsLength = alts.length; + for (let i2 = 0; i2 < altsLength - 1; i2++) { + const handle = alts[i2]; + let transition2; + if (handle.left.transitions.length === 1) { + transition2 = handle.left.transitions[0]; + } + const isRuleTransition = transition2 instanceof RuleTransition; + const ruleTransition = transition2; + const next3 = alts[i2 + 1].left; + if (handle.left.type === ATN_BASIC && handle.right.type === ATN_BASIC && transition2 !== void 0 && (isRuleTransition && ruleTransition.followState === handle.right || transition2.target === handle.right)) { + if (isRuleTransition) { + ruleTransition.followState = next3; + } else { + transition2.target = next3; + } + removeState(atn, handle.right); + } else { + epsilon4(handle.right, next3); + } } + const first3 = alts[0]; + const last3 = alts[altsLength - 1]; + return { + left: first3.left, + right: last3.right + }; } - function getAxis(data, axisConfig, axisThemeConfig, tmpSVGGroup2) { - const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2); - if (isBandAxisData(data)) { - return new BandAxis( - axisConfig, - axisThemeConfig, - data.categories, - data.title, - textDimensionCalculator - ); - } - return new LinearAxis( - axisConfig, - axisThemeConfig, - [data.min, data.max], - data.title, - textDimensionCalculator - ); + function tokenRef(atn, rule, tokenType, production) { + const left3 = newState(atn, rule, production, { + type: ATN_BASIC + }); + const right3 = newState(atn, rule, production, { + type: ATN_BASIC + }); + addTransition(left3, new AtomTransition(right3, tokenType)); + return { + left: left3, + right: right3 + }; } - class ChartTitle { - constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) { - this.textDimensionCalculator = textDimensionCalculator; - this.chartConfig = chartConfig; - this.chartData = chartData; - this.chartThemeConfig = chartThemeConfig; - this.boundingRect = { - x: 0, - y: 0, - width: 0, - height: 0 + function ruleRef(atn, currentRule, nonTerminal) { + const rule = nonTerminal.referencedRule; + const start3 = atn.ruleToStartState.get(rule); + const left3 = newState(atn, currentRule, nonTerminal, { + type: ATN_BASIC + }); + const right3 = newState(atn, currentRule, nonTerminal, { + type: ATN_BASIC + }); + const call = new RuleTransition(start3, rule, right3); + addTransition(left3, call); + return { + left: left3, + right: right3 + }; + } + function buildRuleHandle(atn, rule, block3) { + const start3 = atn.ruleToStartState.get(rule); + epsilon4(start3, block3.left); + const stop5 = atn.ruleToStopState.get(rule); + epsilon4(block3.right, stop5); + const handle = { + left: start3, + right: stop5 + }; + return handle; + } + function epsilon4(a2, b2) { + const transition2 = new EpsilonTransition(b2); + addTransition(a2, transition2); + } + function newState(atn, rule, production, partial) { + const t4 = Object.assign({ + atn, + production, + epsilonOnlyTransitions: false, + rule, + transitions: [], + nextTokenWithinRule: [], + stateNumber: atn.states.length + }, partial); + atn.states.push(t4); + return t4; + } + function addTransition(state4, transition2) { + if (state4.transitions.length === 0) { + state4.epsilonOnlyTransitions = transition2.isEpsilon(); + } + state4.transitions.push(transition2); + } + function removeState(atn, state4) { + atn.states.splice(atn.states.indexOf(state4), 1); + } + var ATN_BASIC, ATN_RULE_START, ATN_PLUS_BLOCK_START, ATN_STAR_BLOCK_START, ATN_RULE_STOP, ATN_BLOCK_END, ATN_STAR_LOOP_BACK, ATN_STAR_LOOP_ENTRY, ATN_PLUS_LOOP_BACK, ATN_LOOP_END, AbstractTransition, AtomTransition, EpsilonTransition, RuleTransition; + var init_atn = __esm({ + "../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/atn.js"() { + "use strict"; + init_map(); + init_filter3(); + init_api5(); + __name(buildATNKey, "buildATNKey"); + ATN_BASIC = 1; + ATN_RULE_START = 2; + ATN_PLUS_BLOCK_START = 4; + ATN_STAR_BLOCK_START = 5; + ATN_RULE_STOP = 7; + ATN_BLOCK_END = 8; + ATN_STAR_LOOP_BACK = 9; + ATN_STAR_LOOP_ENTRY = 10; + ATN_PLUS_LOOP_BACK = 11; + ATN_LOOP_END = 12; + AbstractTransition = class { + static { + __name(this, "AbstractTransition"); + } + constructor(target) { + this.target = target; + } + isEpsilon() { + return false; + } }; - this.showChartTitle = false; - } - setBoundingBoxXY(point2) { - this.boundingRect.x = point2.x; - this.boundingRect.y = point2.y; + AtomTransition = class extends AbstractTransition { + static { + __name(this, "AtomTransition"); + } + constructor(target, tokenType) { + super(target); + this.tokenType = tokenType; + } + }; + EpsilonTransition = class extends AbstractTransition { + static { + __name(this, "EpsilonTransition"); + } + constructor(target) { + super(target); + } + isEpsilon() { + return true; + } + }; + RuleTransition = class extends AbstractTransition { + static { + __name(this, "RuleTransition"); + } + constructor(ruleStart, rule, followState) { + super(ruleStart); + this.rule = rule; + this.followState = followState; + } + isEpsilon() { + return true; + } + }; + __name(createATN, "createATN"); + __name(createRuleStartAndStopATNStates, "createRuleStartAndStopATNStates"); + __name(atom, "atom"); + __name(repetition, "repetition"); + __name(repetitionSep, "repetitionSep"); + __name(repetitionMandatory, "repetitionMandatory"); + __name(repetitionMandatorySep, "repetitionMandatorySep"); + __name(alternation, "alternation"); + __name(option, "option"); + __name(block2, "block"); + __name(plus, "plus"); + __name(star, "star"); + __name(optional, "optional"); + __name(defineDecisionState, "defineDecisionState"); + __name(makeAlts, "makeAlts"); + __name(getProdType2, "getProdType"); + __name(makeBlock, "makeBlock"); + __name(tokenRef, "tokenRef"); + __name(ruleRef, "ruleRef"); + __name(buildRuleHandle, "buildRuleHandle"); + __name(epsilon4, "epsilon"); + __name(newState, "newState"); + __name(addTransition, "addTransition"); + __name(removeState, "removeState"); } - calculateSpace(availableSpace) { - const titleDimension = this.textDimensionCalculator.getMaxDimension( - [this.chartData.title], - this.chartConfig.titleFontSize - ); - const widthRequired = Math.max(titleDimension.width, availableSpace.width); - const heightRequired = titleDimension.height + 2 * this.chartConfig.titlePadding; - if (titleDimension.width <= widthRequired && titleDimension.height <= heightRequired && this.chartConfig.showTitle && this.chartData.title) { - this.boundingRect.width = widthRequired; - this.boundingRect.height = heightRequired; - this.showChartTitle = true; - } - return { - width: this.boundingRect.width, - height: this.boundingRect.height + }); + + // ../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/dfa.js + function getATNConfigKey(config6, alt = true) { + return `${alt ? `a${config6.alt}` : ""}s${config6.state.stateNumber}:${config6.stack.map((e3) => e3.stateNumber.toString()).join("_")}`; + } + var DFA_ERROR, ATNConfigSet; + var init_dfa = __esm({ + "../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/dfa.js"() { + "use strict"; + init_map(); + DFA_ERROR = {}; + ATNConfigSet = class { + static { + __name(this, "ATNConfigSet"); + } + constructor() { + this.map = {}; + this.configs = []; + } + get size() { + return this.configs.length; + } + finalize() { + this.map = {}; + } + add(config6) { + const key = getATNConfigKey(config6); + if (!(key in this.map)) { + this.map[key] = this.configs.length; + this.configs.push(config6); + } + } + get elements() { + return this.configs; + } + get alts() { + return map_default(this.configs, (e3) => e3.alt); + } + get key() { + let value2 = ""; + for (const k2 in this.map) { + value2 += k2 + ":"; + } + return value2; + } }; + __name(getATNConfigKey, "getATNConfigKey"); } - getDrawableElements() { - const drawableElem = []; - if (this.showChartTitle) { - drawableElem.push({ - groupTexts: ["chart-title"], - type: "text", - data: [ - { - fontSize: this.chartConfig.titleFontSize, - text: this.chartData.title, - verticalPos: "middle", - horizontalPos: "center", - x: this.boundingRect.x + this.boundingRect.width / 2, - y: this.boundingRect.y + this.boundingRect.height / 2, - fill: this.chartThemeConfig.titleColor, - rotation: 0 + }); + + // ../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/all-star-lookahead.js + function createDFACache(startState, decision) { + const map5 = {}; + return (predicateSet) => { + const key = predicateSet.toString(); + let existing = map5[key]; + if (existing !== void 0) { + return existing; + } else { + existing = { + atnStartState: startState, + decision, + states: {} + }; + map5[key] = existing; + return existing; + } + }; + } + function isLL1Sequence(sequences, allowEmpty = true) { + const fullSet = /* @__PURE__ */ new Set(); + for (const alt of sequences) { + const altSet = /* @__PURE__ */ new Set(); + for (const tokType of alt) { + if (tokType === void 0) { + if (allowEmpty) { + break; + } else { + return false; + } + } + const indices = [tokType.tokenTypeIdx].concat(tokType.categoryMatches); + for (const index of indices) { + if (fullSet.has(index)) { + if (!altSet.has(index)) { + return false; } - ] - }); + } else { + fullSet.add(index); + altSet.add(index); + } + } } - return drawableElem; + } + return true; + } + function initATNSimulator(atn) { + const decisionLength = atn.decisionStates.length; + const decisionToDFA = Array(decisionLength); + for (let i2 = 0; i2 < decisionLength; i2++) { + decisionToDFA[i2] = createDFACache(atn.decisionStates[i2], i2); + } + return decisionToDFA; + } + function adaptivePredict(dfaCaches, decision, predicateSet, logging) { + const dfa = dfaCaches[decision](predicateSet); + let start3 = dfa.start; + if (start3 === void 0) { + const closure2 = computeStartState(dfa.atnStartState); + start3 = addDFAState(dfa, newDFAState(closure2)); + dfa.start = start3; + } + const alt = performLookahead.apply(this, [dfa, start3, predicateSet, logging]); + return alt; + } + function performLookahead(dfa, s0, predicateSet, logging) { + let previousD = s0; + let i2 = 1; + const path4 = []; + let t4 = this.LA(i2++); + while (true) { + let d2 = getExistingTargetState(previousD, t4); + if (d2 === void 0) { + d2 = computeLookaheadTarget.apply(this, [dfa, previousD, t4, i2, predicateSet, logging]); + } + if (d2 === DFA_ERROR) { + return buildAdaptivePredictError(path4, previousD, t4); + } + if (d2.isAcceptState === true) { + return d2.prediction; + } + previousD = d2; + path4.push(t4); + t4 = this.LA(i2++); + } + } + function computeLookaheadTarget(dfa, previousD, token2, lookahead, predicateSet, logging) { + const reach = computeReachSet(previousD.configs, token2, predicateSet); + if (reach.size === 0) { + addDFAEdge(dfa, previousD, token2, DFA_ERROR); + return DFA_ERROR; + } + let newState2 = newDFAState(reach); + const predictedAlt = getUniqueAlt(reach, predicateSet); + if (predictedAlt !== void 0) { + newState2.isAcceptState = true; + newState2.prediction = predictedAlt; + newState2.configs.uniqueAlt = predictedAlt; + } else if (hasConflictTerminatingPrediction(reach)) { + const prediction = min_default(reach.alts); + newState2.isAcceptState = true; + newState2.prediction = prediction; + newState2.configs.uniqueAlt = prediction; + reportLookaheadAmbiguity.apply(this, [dfa, lookahead, reach.alts, logging]); + } + newState2 = addDFAEdge(dfa, previousD, token2, newState2); + return newState2; + } + function reportLookaheadAmbiguity(dfa, lookahead, ambiguityIndices, logging) { + const prefixPath = []; + for (let i2 = 1; i2 <= lookahead; i2++) { + prefixPath.push(this.LA(i2).tokenType); + } + const atnState = dfa.atnStartState; + const topLevelRule = atnState.rule; + const production = atnState.production; + const message = buildAmbiguityError({ + topLevelRule, + ambiguityIndices, + production, + prefixPath + }); + logging(message); + } + function buildAmbiguityError(options3) { + const pathMsg = map_default(options3.prefixPath, (currtok) => tokenLabel2(currtok)).join(", "); + const occurrence = options3.production.idx === 0 ? "" : options3.production.idx; + let currMessage = `Ambiguous Alternatives Detected: <${options3.ambiguityIndices.join(", ")}> in <${getProductionDslName2(options3.production)}${occurrence}> inside <${options3.topLevelRule.name}> Rule, +<${pathMsg}> may appears as a prefix path in all these alternatives. +`; + currMessage = currMessage + `See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`; + return currMessage; + } + function getProductionDslName2(prod) { + if (prod instanceof NonTerminal) { + return "SUBRULE"; + } else if (prod instanceof Option2) { + return "OPTION"; + } else if (prod instanceof Alternation) { + return "OR"; + } else if (prod instanceof RepetitionMandatory) { + return "AT_LEAST_ONE"; + } else if (prod instanceof RepetitionMandatoryWithSeparator) { + return "AT_LEAST_ONE_SEP"; + } else if (prod instanceof RepetitionWithSeparator) { + return "MANY_SEP"; + } else if (prod instanceof Repetition) { + return "MANY"; + } else if (prod instanceof Terminal) { + return "CONSUME"; + } else { + throw Error("non exhaustive match"); } } - function getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) { - const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2); - return new ChartTitle(textDimensionCalculator, chartConfig, chartData, chartThemeConfig); + function buildAdaptivePredictError(path4, previous, current) { + const nextTransitions = flatMap_default(previous.configs.elements, (e3) => e3.state.transitions); + const nextTokenTypes = uniqBy_default(nextTransitions.filter((e3) => e3 instanceof AtomTransition).map((e3) => e3.tokenType), (e3) => e3.tokenTypeIdx); + return { + actualToken: current, + possibleTokenTypes: nextTokenTypes, + tokenPath: path4 + }; } - class LinePlot { - constructor(plotData, xAxis, yAxis, orientation, plotIndex2) { - this.plotData = plotData; - this.xAxis = xAxis; - this.yAxis = yAxis; - this.orientation = orientation; - this.plotIndex = plotIndex2; - } - getDrawableElement() { - const finalData = this.plotData.data.map((d) => [ - this.xAxis.getScaleValue(d[0]), - this.yAxis.getScaleValue(d[1]) - ]); - let path2; - if (this.orientation === "horizontal") { - path2 = line$1().y((d) => d[0]).x((d) => d[1])(finalData); - } else { - path2 = line$1().x((d) => d[0]).y((d) => d[1])(finalData); + function getExistingTargetState(state4, token2) { + return state4.edges[token2.tokenTypeIdx]; + } + function computeReachSet(configs, token2, predicateSet) { + const intermediate = new ATNConfigSet(); + const skippedStopStates = []; + for (const c3 of configs.elements) { + if (predicateSet.is(c3.alt) === false) { + continue; } - if (!path2) { - return []; + if (c3.state.type === ATN_RULE_STOP) { + skippedStopStates.push(c3); + continue; } - return [ - { - groupTexts: ["plot", `line-plot-${this.plotIndex}`], - type: "path", - data: [ - { - path: path2, - strokeFill: this.plotData.strokeFill, - strokeWidth: this.plotData.strokeWidth - } - ] + const transitionLength = c3.state.transitions.length; + for (let i2 = 0; i2 < transitionLength; i2++) { + const transition2 = c3.state.transitions[i2]; + const target = getReachableTarget(transition2, token2); + if (target !== void 0) { + intermediate.add({ + state: target, + alt: c3.alt, + stack: c3.stack + }); } - ]; + } } - } - class BarPlot { - constructor(barData, boundingRect, xAxis, yAxis, orientation, plotIndex2) { - this.barData = barData; - this.boundingRect = boundingRect; - this.xAxis = xAxis; - this.yAxis = yAxis; - this.orientation = orientation; - this.plotIndex = plotIndex2; + let reach; + if (skippedStopStates.length === 0 && intermediate.size === 1) { + reach = intermediate; } - getDrawableElement() { - const finalData = this.barData.data.map((d) => [ - this.xAxis.getScaleValue(d[0]), - this.yAxis.getScaleValue(d[1]) - ]); - const barPaddingPercent = 0.05; - const barWidth = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - barPaddingPercent); - const barWidthHalf = barWidth / 2; - if (this.orientation === "horizontal") { - return [ - { - groupTexts: ["plot", `bar-plot-${this.plotIndex}`], - type: "rect", - data: finalData.map((data) => ({ - x: this.boundingRect.x, - y: data[0] - barWidthHalf, - height: barWidth, - width: data[1] - this.boundingRect.x, - fill: this.barData.fill, - strokeWidth: 0, - strokeFill: this.barData.fill - })) - } - ]; + if (reach === void 0) { + reach = new ATNConfigSet(); + for (const c3 of intermediate.elements) { + closure(c3, reach); } - return [ - { - groupTexts: ["plot", `bar-plot-${this.plotIndex}`], - type: "rect", - data: finalData.map((data) => ({ - x: data[0] - barWidthHalf, - y: data[1], - width: barWidth, - height: this.boundingRect.y + this.boundingRect.height - data[1], - fill: this.barData.fill, - strokeWidth: 0, - strokeFill: this.barData.fill - })) + } + if (skippedStopStates.length > 0 && !hasConfigInRuleStopState(reach)) { + for (const c3 of skippedStopStates) { + reach.add(c3); + } + } + return reach; + } + function getReachableTarget(transition2, token2) { + if (transition2 instanceof AtomTransition && tokenMatcher(token2, transition2.tokenType)) { + return transition2.target; + } + return void 0; + } + function getUniqueAlt(configs, predicateSet) { + let alt; + for (const c3 of configs.elements) { + if (predicateSet.is(c3.alt) === true) { + if (alt === void 0) { + alt = c3.alt; + } else if (alt !== c3.alt) { + return void 0; } - ]; + } } + return alt; } - class BasePlot { - constructor(chartConfig, chartData, chartThemeConfig) { - this.chartConfig = chartConfig; - this.chartData = chartData; - this.chartThemeConfig = chartThemeConfig; - this.boundingRect = { - x: 0, - y: 0, - width: 0, - height: 0 - }; + function newDFAState(closure2) { + return { + configs: closure2, + edges: {}, + isAcceptState: false, + prediction: -1 + }; + } + function addDFAEdge(dfa, from2, token2, to) { + to = addDFAState(dfa, to); + from2.edges[token2.tokenTypeIdx] = to; + return to; + } + function addDFAState(dfa, state4) { + if (state4 === DFA_ERROR) { + return state4; + } + const mapKey = state4.configs.key; + const existing = dfa.states[mapKey]; + if (existing !== void 0) { + return existing; + } + state4.configs.finalize(); + dfa.states[mapKey] = state4; + return state4; + } + function computeStartState(atnState) { + const configs = new ATNConfigSet(); + const numberOfTransitions = atnState.transitions.length; + for (let i2 = 0; i2 < numberOfTransitions; i2++) { + const target = atnState.transitions[i2].target; + const config6 = { + state: target, + alt: i2, + stack: [] + }; + closure(config6, configs); + } + return configs; + } + function closure(config6, configs) { + const p3 = config6.state; + if (p3.type === ATN_RULE_STOP) { + if (config6.stack.length > 0) { + const atnStack = [...config6.stack]; + const followState = atnStack.pop(); + const followConfig = { + state: followState, + alt: config6.alt, + stack: atnStack + }; + closure(followConfig, configs); + } else { + configs.add(config6); + } + return; } - setAxes(xAxis, yAxis) { - this.xAxis = xAxis; - this.yAxis = yAxis; + if (!p3.epsilonOnlyTransitions) { + configs.add(config6); } - setBoundingBoxXY(point2) { - this.boundingRect.x = point2.x; - this.boundingRect.y = point2.y; + const transitionLength = p3.transitions.length; + for (let i2 = 0; i2 < transitionLength; i2++) { + const transition2 = p3.transitions[i2]; + const c3 = getEpsilonTarget(config6, transition2); + if (c3 !== void 0) { + closure(c3, configs); + } } - calculateSpace(availableSpace) { - this.boundingRect.width = availableSpace.width; - this.boundingRect.height = availableSpace.height; + } + function getEpsilonTarget(config6, transition2) { + if (transition2 instanceof EpsilonTransition) { return { - width: this.boundingRect.width, - height: this.boundingRect.height + state: transition2.target, + alt: config6.alt, + stack: config6.stack + }; + } else if (transition2 instanceof RuleTransition) { + const stack = [...config6.stack, transition2.followState]; + return { + state: transition2.target, + alt: config6.alt, + stack }; } - getDrawableElements() { - if (!(this.xAxis && this.yAxis)) { - throw Error("Axes must be passed to render Plots"); - } - const drawableElem = []; - for (const [i2, plot] of this.chartData.plots.entries()) { - switch (plot.type) { - case "line": - { - const linePlot = new LinePlot( - plot, - this.xAxis, - this.yAxis, - this.chartConfig.chartOrientation, - i2 - ); - drawableElem.push(...linePlot.getDrawableElement()); - } - break; - case "bar": - { - const barPlot = new BarPlot( - plot, - this.boundingRect, - this.xAxis, - this.yAxis, - this.chartConfig.chartOrientation, - i2 - ); - drawableElem.push(...barPlot.getDrawableElement()); - } - break; - } + return void 0; + } + function hasConfigInRuleStopState(configs) { + for (const c3 of configs.elements) { + if (c3.state.type === ATN_RULE_STOP) { + return true; } - return drawableElem; } + return false; } - function getPlotComponent(chartConfig, chartData, chartThemeConfig) { - return new BasePlot(chartConfig, chartData, chartThemeConfig); + function allConfigsInRuleStopStates(configs) { + for (const c3 of configs.elements) { + if (c3.state.type !== ATN_RULE_STOP) { + return false; + } + } + return true; } - class Orchestrator { - constructor(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) { - this.chartConfig = chartConfig; - this.chartData = chartData; - this.componentStore = { - title: getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2), - plot: getPlotComponent(chartConfig, chartData, chartThemeConfig), - xAxis: getAxis( - chartData.xAxis, - chartConfig.xAxis, - { - titleColor: chartThemeConfig.xAxisTitleColor, - labelColor: chartThemeConfig.xAxisLabelColor, - tickColor: chartThemeConfig.xAxisTickColor, - axisLineColor: chartThemeConfig.xAxisLineColor - }, - tmpSVGGroup2 - ), - yAxis: getAxis( - chartData.yAxis, - chartConfig.yAxis, - { - titleColor: chartThemeConfig.yAxisTitleColor, - labelColor: chartThemeConfig.yAxisLabelColor, - tickColor: chartThemeConfig.yAxisTickColor, - axisLineColor: chartThemeConfig.yAxisLineColor - }, - tmpSVGGroup2 - ) - }; + function hasConflictTerminatingPrediction(configs) { + if (allConfigsInRuleStopStates(configs)) { + return true; } - calculateVerticalSpace() { - let availableWidth = this.chartConfig.width; - let availableHeight = this.chartConfig.height; - let plotX = 0; - let plotY = 0; - let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100); - let chartHeight = Math.floor( - availableHeight * this.chartConfig.plotReservedSpacePercent / 100 - ); - let spaceUsed = this.componentStore.plot.calculateSpace({ - width: chartWidth, - height: chartHeight - }); - availableWidth -= spaceUsed.width; - availableHeight -= spaceUsed.height; - spaceUsed = this.componentStore.title.calculateSpace({ - width: this.chartConfig.width, - height: availableHeight - }); - plotY = spaceUsed.height; - availableHeight -= spaceUsed.height; - this.componentStore.xAxis.setAxisPosition("bottom"); - spaceUsed = this.componentStore.xAxis.calculateSpace({ - width: availableWidth, - height: availableHeight - }); - availableHeight -= spaceUsed.height; - this.componentStore.yAxis.setAxisPosition("left"); - spaceUsed = this.componentStore.yAxis.calculateSpace({ - width: availableWidth, - height: availableHeight - }); - plotX = spaceUsed.width; - availableWidth -= spaceUsed.width; - if (availableWidth > 0) { - chartWidth += availableWidth; - availableWidth = 0; - } - if (availableHeight > 0) { - chartHeight += availableHeight; - availableHeight = 0; - } - this.componentStore.plot.calculateSpace({ - width: chartWidth, - height: chartHeight - }); - this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY }); - this.componentStore.xAxis.setRange([plotX, plotX + chartWidth]); - this.componentStore.xAxis.setBoundingBoxXY({ x: plotX, y: plotY + chartHeight }); - this.componentStore.yAxis.setRange([plotY, plotY + chartHeight]); - this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: plotY }); - if (this.chartData.plots.some((p) => isBarPlot(p))) { - this.componentStore.xAxis.recalculateOuterPaddingToDrawBar(); - } - } - calculateHorizontalSpace() { - let availableWidth = this.chartConfig.width; - let availableHeight = this.chartConfig.height; - let titleYEnd = 0; - let plotX = 0; - let plotY = 0; - let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100); - let chartHeight = Math.floor( - availableHeight * this.chartConfig.plotReservedSpacePercent / 100 - ); - let spaceUsed = this.componentStore.plot.calculateSpace({ - width: chartWidth, - height: chartHeight - }); - availableWidth -= spaceUsed.width; - availableHeight -= spaceUsed.height; - spaceUsed = this.componentStore.title.calculateSpace({ - width: this.chartConfig.width, - height: availableHeight - }); - titleYEnd = spaceUsed.height; - availableHeight -= spaceUsed.height; - this.componentStore.xAxis.setAxisPosition("left"); - spaceUsed = this.componentStore.xAxis.calculateSpace({ - width: availableWidth, - height: availableHeight - }); - availableWidth -= spaceUsed.width; - plotX = spaceUsed.width; - this.componentStore.yAxis.setAxisPosition("top"); - spaceUsed = this.componentStore.yAxis.calculateSpace({ - width: availableWidth, - height: availableHeight - }); - availableHeight -= spaceUsed.height; - plotY = titleYEnd + spaceUsed.height; - if (availableWidth > 0) { - chartWidth += availableWidth; - availableWidth = 0; - } - if (availableHeight > 0) { - chartHeight += availableHeight; - availableHeight = 0; - } - this.componentStore.plot.calculateSpace({ - width: chartWidth, - height: chartHeight - }); - this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY }); - this.componentStore.yAxis.setRange([plotX, plotX + chartWidth]); - this.componentStore.yAxis.setBoundingBoxXY({ x: plotX, y: titleYEnd }); - this.componentStore.xAxis.setRange([plotY, plotY + chartHeight]); - this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: plotY }); - if (this.chartData.plots.some((p) => isBarPlot(p))) { - this.componentStore.xAxis.recalculateOuterPaddingToDrawBar(); - } - } - calculateSpace() { - if (this.chartConfig.chartOrientation === "horizontal") { - this.calculateHorizontalSpace(); - } else { - this.calculateVerticalSpace(); + const altSets = getConflictingAltSets(configs.elements); + const heuristic2 = hasConflictingAltSet(altSets) && !hasStateAssociatedWithOneAlt(altSets); + return heuristic2; + } + function getConflictingAltSets(configs) { + const configToAlts = /* @__PURE__ */ new Map(); + for (const c3 of configs) { + const key = getATNConfigKey(c3, false); + let alts = configToAlts.get(key); + if (alts === void 0) { + alts = {}; + configToAlts.set(key, alts); } + alts[c3.alt] = true; } - getDrawableElement() { - this.calculateSpace(); - const drawableElem = []; - this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis); - for (const component of Object.values(this.componentStore)) { - drawableElem.push(...component.getDrawableElements()); + return configToAlts; + } + function hasConflictingAltSet(altSets) { + for (const value2 of Array.from(altSets.values())) { + if (Object.keys(value2).length > 1) { + return true; } - return drawableElem; } + return false; } - class XYChartBuilder { - static build(config2, chartData, chartThemeConfig, tmpSVGGroup2) { - const orchestrator = new Orchestrator(config2, chartData, chartThemeConfig, tmpSVGGroup2); - return orchestrator.getDrawableElement(); + function hasStateAssociatedWithOneAlt(altSets) { + for (const value2 of Array.from(altSets.values())) { + if (Object.keys(value2).length === 1) { + return true; + } } + return false; } - let plotIndex = 0; - let tmpSVGGroup; - let xyChartConfig = getChartDefaultConfig(); - let xyChartThemeConfig = getChartDefaultThemeConfig(); - let xyChartData = getChartDefaultData(); - let plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color2) => color2.trim()); - let hasSetXAxis = false; - let hasSetYAxis = false; - function getChartDefaultThemeConfig() { - const defaultThemeVariables2 = getThemeVariables$2(); - const config2 = getConfig$2(); - return cleanAndMerge(defaultThemeVariables2.xyChart, config2.themeVariables.xyChart); - } - function getChartDefaultConfig() { - const config2 = getConfig$2(); - return cleanAndMerge( - defaultConfig$2.xyChart, - config2.xyChart - ); - } - function getChartDefaultData() { - return { - yAxis: { - type: "linear", - title: "", - min: Infinity, - max: -Infinity - }, - xAxis: { - type: "band", - title: "", - categories: [] - }, - title: "", - plots: [] - }; - } - function textSanitizer(text2) { - const config2 = getConfig$2(); - return sanitizeText$6(text2.trim(), config2); - } - function setTmpSVGG(SVGG) { - tmpSVGGroup = SVGG; - } - function setOrientation(orientation) { - if (orientation === "horizontal") { - xyChartConfig.chartOrientation = "horizontal"; - } else { - xyChartConfig.chartOrientation = "vertical"; - } - } - function setXAxisTitle(title2) { - xyChartData.xAxis.title = textSanitizer(title2.text); - } - function setXAxisRangeData(min2, max2) { - xyChartData.xAxis = { type: "linear", title: xyChartData.xAxis.title, min: min2, max: max2 }; - hasSetXAxis = true; - } - function setXAxisBand(categories) { - xyChartData.xAxis = { - type: "band", - title: xyChartData.xAxis.title, - categories: categories.map((c2) => textSanitizer(c2.text)) - }; - hasSetXAxis = true; - } - function setYAxisTitle(title2) { - xyChartData.yAxis.title = textSanitizer(title2.text); - } - function setYAxisRangeData(min2, max2) { - xyChartData.yAxis = { type: "linear", title: xyChartData.yAxis.title, min: min2, max: max2 }; - hasSetYAxis = true; - } - function setYAxisRangeFromPlotData(data) { - const minValue = Math.min(...data); - const maxValue = Math.max(...data); - const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity; - const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity; - xyChartData.yAxis = { - type: "linear", - title: xyChartData.yAxis.title, - min: Math.min(prevMinValue, minValue), - max: Math.max(prevMaxValue, maxValue) - }; - } - function transformDataWithoutCategory(data) { - let retData = []; - if (data.length === 0) { - return retData; - } - if (!hasSetXAxis) { - const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity; - const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity; - setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data.length)); - } - if (!hasSetYAxis) { - setYAxisRangeFromPlotData(data); - } - if (isBandAxisData(xyChartData.xAxis)) { - retData = xyChartData.xAxis.categories.map((c2, i2) => [c2, data[i2]]); - } - if (isLinearAxisData(xyChartData.xAxis)) { - const min2 = xyChartData.xAxis.min; - const max2 = xyChartData.xAxis.max; - const step = (max2 - min2 + 1) / data.length; - const categories = []; - for (let i2 = min2; i2 <= max2; i2 += step) { - categories.push(`${i2}`); - } - retData = categories.map((c2, i2) => [c2, data[i2]]); - } - return retData; - } - function getPlotColorFromPalette(plotIndex2) { - return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length]; - } - function setLineData(title2, data) { - const plotData = transformDataWithoutCategory(data); - xyChartData.plots.push({ - type: "line", - strokeFill: getPlotColorFromPalette(plotIndex), - strokeWidth: 2, - data: plotData - }); - plotIndex++; - } - function setBarData(title2, data) { - const plotData = transformDataWithoutCategory(data); - xyChartData.plots.push({ - type: "bar", - fill: getPlotColorFromPalette(plotIndex), - data: plotData - }); - plotIndex++; - } - function getDrawableElem() { - if (xyChartData.plots.length === 0) { - throw Error("No Plot to render, please provide a plot with some data"); - } - xyChartData.title = getDiagramTitle(); - return XYChartBuilder.build(xyChartConfig, xyChartData, xyChartThemeConfig, tmpSVGGroup); - } - function getChartThemeConfig() { - return xyChartThemeConfig; - } - function getChartConfig() { - return xyChartConfig; - } - const clear$9 = function() { - clear$n(); - plotIndex = 0; - xyChartConfig = getChartDefaultConfig(); - xyChartData = getChartDefaultData(); - xyChartThemeConfig = getChartDefaultThemeConfig(); - plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color2) => color2.trim()); - hasSetXAxis = false; - hasSetYAxis = false; - }; - const db$b = { - getDrawableElem, - clear: clear$9, - setAccTitle, - getAccTitle, - setDiagramTitle, - getDiagramTitle, - getAccDescription, - setAccDescription, - setOrientation, - setXAxisTitle, - setXAxisRangeData, - setXAxisBand, - setYAxisTitle, - setYAxisRangeData, - setLineData, - setBarData, - setTmpSVGG, - getChartThemeConfig, - getChartConfig - }; - const draw$c = (txt, id2, _version, diagObj) => { - const db2 = diagObj.db; - const themeConfig = db2.getChartThemeConfig(); - const chartConfig = db2.getChartConfig(); - function getDominantBaseLine(horizontalPos) { - return horizontalPos === "top" ? "text-before-edge" : "middle"; - } - function getTextAnchor(verticalPos) { - return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle"; - } - function getTextTransformation(data) { - return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`; - } - log$1.debug("Rendering xychart chart\n" + txt); - const svg2 = selectSvgElement(id2); - const group = svg2.append("g").attr("class", "main"); - const background = group.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background"); - configureSvgSize(svg2, chartConfig.height, chartConfig.width, true); - svg2.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`); - background.attr("fill", themeConfig.backgroundColor); - db2.setTmpSVGG(svg2.append("g").attr("class", "mermaid-tmp-group")); - const shapes2 = db2.getDrawableElem(); - const groups = {}; - function getGroup(gList) { - let elem = group; - let prefix = ""; - for (const [i2] of gList.entries()) { - let parent = group; - if (i2 > 0 && groups[prefix]) { - parent = groups[prefix]; - } - prefix += gList[i2]; - elem = groups[prefix]; - if (!elem) { - elem = groups[prefix] = parent.append("g").attr("class", gList[i2]); - } - } - return elem; - } - for (const shape of shapes2) { - if (shape.data.length === 0) { - continue; - } - const shapeGroup = getGroup(shape.groupTexts); - switch (shape.type) { - case "rect": - shapeGroup.selectAll("rect").data(shape.data).enter().append("rect").attr("x", (data) => data.x).attr("y", (data) => data.y).attr("width", (data) => data.width).attr("height", (data) => data.height).attr("fill", (data) => data.fill).attr("stroke", (data) => data.strokeFill).attr("stroke-width", (data) => data.strokeWidth); - break; - case "text": - shapeGroup.selectAll("text").data(shape.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (data) => data.fill).attr("font-size", (data) => data.fontSize).attr("dominant-baseline", (data) => getDominantBaseLine(data.verticalPos)).attr("text-anchor", (data) => getTextAnchor(data.horizontalPos)).attr("transform", (data) => getTextTransformation(data)).text((data) => data.text); - break; - case "path": - shapeGroup.selectAll("path").data(shape.data).enter().append("path").attr("d", (data) => data.path).attr("fill", (data) => data.fill ? data.fill : "none").attr("stroke", (data) => data.strokeFill).attr("stroke-width", (data) => data.strokeWidth); - break; - } - } - }; - const renderer$c = { - draw: draw$c - }; - const diagram$c = { - parser: parser$j, - db: db$b, - renderer: renderer$c - }; - const xychartDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$c - }, Symbol.toStringTag, { value: "Module" })); - var parser$g = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [5, 6, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], $V5 = [1, 18], $V6 = [2, 7], $V7 = [1, 22], $V8 = [1, 23], $V9 = [1, 24], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 20], $Ve = [1, 28], $Vf = [1, 29], $Vg = [62, 63], $Vh = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 51, 53, 62, 63], $Vi = [1, 47], $Vj = [1, 48], $Vk = [1, 49], $Vl = [1, 50], $Vm = [1, 51], $Vn = [1, 52], $Vo = [1, 53], $Vp = [53, 54], $Vq = [1, 64], $Vr = [1, 60], $Vs = [1, 61], $Vt = [1, 62], $Vu = [1, 63], $Vv = [1, 65], $Vw = [1, 69], $Vx = [1, 70], $Vy = [1, 67], $Vz = [1, 68], $VA = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "acc_title": 9, "acc_title_value": 10, "acc_descr": 11, "acc_descr_value": 12, "acc_descr_multiline_value": 13, "requirementDef": 14, "elementDef": 15, "relationshipDef": 16, "requirementType": 17, "requirementName": 18, "STRUCT_START": 19, "requirementBody": 20, "ID": 21, "COLONSEP": 22, "id": 23, "TEXT": 24, "text": 25, "RISK": 26, "riskLevel": 27, "VERIFYMTHD": 28, "verifyType": 29, "STRUCT_STOP": 30, "REQUIREMENT": 31, "FUNCTIONAL_REQUIREMENT": 32, "INTERFACE_REQUIREMENT": 33, "PERFORMANCE_REQUIREMENT": 34, "PHYSICAL_REQUIREMENT": 35, "DESIGN_CONSTRAINT": 36, "LOW_RISK": 37, "MED_RISK": 38, "HIGH_RISK": 39, "VERIFY_ANALYSIS": 40, "VERIFY_DEMONSTRATION": 41, "VERIFY_INSPECTION": 42, "VERIFY_TEST": 43, "ELEMENT": 44, "elementName": 45, "elementBody": 46, "TYPE": 47, "type": 48, "DOCREF": 49, "ref": 50, "END_ARROW_L": 51, "relationship": 52, "LINE": 53, "END_ARROW_R": 54, "CONTAINS": 55, "COPIES": 56, "DERIVES": 57, "SATISFIES": 58, "VERIFIES": 59, "REFINES": 60, "TRACES": 61, "unqString": 62, "qString": 63, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 19: "STRUCT_START", 21: "ID", 22: "COLONSEP", 24: "TEXT", 26: "RISK", 28: "VERIFYMTHD", 30: "STRUCT_STOP", 31: "REQUIREMENT", 32: "FUNCTIONAL_REQUIREMENT", 33: "INTERFACE_REQUIREMENT", 34: "PERFORMANCE_REQUIREMENT", 35: "PHYSICAL_REQUIREMENT", 36: "DESIGN_CONSTRAINT", 37: "LOW_RISK", 38: "MED_RISK", 39: "HIGH_RISK", 40: "VERIFY_ANALYSIS", 41: "VERIFY_DEMONSTRATION", 42: "VERIFY_INSPECTION", 43: "VERIFY_TEST", 44: "ELEMENT", 47: "TYPE", 49: "DOCREF", 51: "END_ARROW_L", 53: "LINE", 54: "END_ARROW_R", 55: "CONTAINS", 56: "COPIES", 57: "DERIVES", 58: "SATISFIES", 59: "VERIFIES", 60: "REFINES", 61: "TRACES", 62: "unqString", 63: "qString" }, - productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [14, 5], [20, 5], [20, 5], [20, 5], [20, 5], [20, 2], [20, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [27, 1], [27, 1], [27, 1], [29, 1], [29, 1], [29, 1], [29, 1], [15, 5], [46, 5], [46, 5], [46, 2], [46, 1], [16, 5], [16, 5], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [18, 1], [18, 1], [23, 1], [23, 1], [25, 1], [25, 1], [45, 1], [45, 1], [48, 1], [48, 1], [50, 1], [50, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 4: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 5: - case 6: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 7: - this.$ = []; - break; - case 13: - yy.addRequirement($$[$0 - 3], $$[$0 - 4]); - break; - case 14: - yy.setNewReqId($$[$0 - 2]); - break; - case 15: - yy.setNewReqText($$[$0 - 2]); - break; - case 16: - yy.setNewReqRisk($$[$0 - 2]); - break; - case 17: - yy.setNewReqVerifyMethod($$[$0 - 2]); - break; - case 20: - this.$ = yy.RequirementType.REQUIREMENT; - break; - case 21: - this.$ = yy.RequirementType.FUNCTIONAL_REQUIREMENT; - break; - case 22: - this.$ = yy.RequirementType.INTERFACE_REQUIREMENT; - break; - case 23: - this.$ = yy.RequirementType.PERFORMANCE_REQUIREMENT; - break; - case 24: - this.$ = yy.RequirementType.PHYSICAL_REQUIREMENT; - break; - case 25: - this.$ = yy.RequirementType.DESIGN_CONSTRAINT; - break; - case 26: - this.$ = yy.RiskLevel.LOW_RISK; - break; - case 27: - this.$ = yy.RiskLevel.MED_RISK; - break; - case 28: - this.$ = yy.RiskLevel.HIGH_RISK; - break; - case 29: - this.$ = yy.VerifyType.VERIFY_ANALYSIS; - break; - case 30: - this.$ = yy.VerifyType.VERIFY_DEMONSTRATION; - break; - case 31: - this.$ = yy.VerifyType.VERIFY_INSPECTION; - break; - case 32: - this.$ = yy.VerifyType.VERIFY_TEST; - break; - case 33: - yy.addElement($$[$0 - 3]); - break; - case 34: - yy.setNewElementType($$[$0 - 2]); - break; - case 35: - yy.setNewElementDocRef($$[$0 - 2]); - break; - case 38: - yy.addRelationship($$[$0 - 2], $$[$0], $$[$0 - 4]); - break; - case 39: - yy.addRelationship($$[$0 - 2], $$[$0 - 4], $$[$0]); - break; - case 40: - this.$ = yy.Relationships.CONTAINS; - break; - case 41: - this.$ = yy.Relationships.COPIES; - break; - case 42: - this.$ = yy.Relationships.DERIVES; - break; - case 43: - this.$ = yy.Relationships.SATISFIES; - break; - case 44: - this.$ = yy.Relationships.VERIFIES; - break; - case 45: - this.$ = yy.Relationships.REFINES; - break; - case 46: - this.$ = yy.Relationships.TRACES; - break; + var PredicateSet, EMPTY_PREDICATES, LLStarLookaheadStrategy; + var init_all_star_lookahead = __esm({ + "../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/all-star-lookahead.js"() { + "use strict"; + init_api5(); + init_atn(); + init_dfa(); + init_min2(); + init_flatMap(); + init_uniqBy(); + init_map(); + init_flatten(); + init_forEach(); + init_isEmpty(); + init_reduce(); + __name(createDFACache, "createDFACache"); + PredicateSet = class { + static { + __name(this, "PredicateSet"); + } + constructor() { + this.predicates = []; + } + is(index) { + return index >= this.predicates.length || this.predicates[index]; + } + set(index, value2) { + this.predicates[index] = value2; + } + toString() { + let value2 = ""; + const size5 = this.predicates.length; + for (let i2 = 0; i2 < size5; i2++) { + value2 += this.predicates[i2] === true ? "1" : "0"; + } + return value2; } - }, - table: [{ 3: 1, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, o($V4, [2, 6]), { 3: 12, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [2, 2] }, { 4: 17, 5: $V5, 7: 13, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, o($V4, [2, 4]), o($V4, [2, 5]), { 1: [2, 1] }, { 8: [1, 30] }, { 4: 17, 5: $V5, 7: 31, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 32, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 33, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 34, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 35, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 18: 36, 62: [1, 37], 63: [1, 38] }, { 45: 39, 62: [1, 40], 63: [1, 41] }, { 51: [1, 42], 53: [1, 43] }, o($Vg, [2, 20]), o($Vg, [2, 21]), o($Vg, [2, 22]), o($Vg, [2, 23]), o($Vg, [2, 24]), o($Vg, [2, 25]), o($Vh, [2, 49]), o($Vh, [2, 50]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 19: [1, 44] }, { 19: [2, 47] }, { 19: [2, 48] }, { 19: [1, 45] }, { 19: [2, 53] }, { 19: [2, 54] }, { 52: 46, 55: $Vi, 56: $Vj, 57: $Vk, 58: $Vl, 59: $Vm, 60: $Vn, 61: $Vo }, { 52: 54, 55: $Vi, 56: $Vj, 57: $Vk, 58: $Vl, 59: $Vm, 60: $Vn, 61: $Vo }, { 5: [1, 55] }, { 5: [1, 56] }, { 53: [1, 57] }, o($Vp, [2, 40]), o($Vp, [2, 41]), o($Vp, [2, 42]), o($Vp, [2, 43]), o($Vp, [2, 44]), o($Vp, [2, 45]), o($Vp, [2, 46]), { 54: [1, 58] }, { 5: $Vq, 20: 59, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vw, 30: $Vx, 46: 66, 47: $Vy, 49: $Vz }, { 23: 71, 62: $Ve, 63: $Vf }, { 23: 72, 62: $Ve, 63: $Vf }, o($VA, [2, 13]), { 22: [1, 73] }, { 22: [1, 74] }, { 22: [1, 75] }, { 22: [1, 76] }, { 5: $Vq, 20: 77, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, o($VA, [2, 19]), o($VA, [2, 33]), { 22: [1, 78] }, { 22: [1, 79] }, { 5: $Vw, 30: $Vx, 46: 80, 47: $Vy, 49: $Vz }, o($VA, [2, 37]), o($VA, [2, 38]), o($VA, [2, 39]), { 23: 81, 62: $Ve, 63: $Vf }, { 25: 82, 62: [1, 83], 63: [1, 84] }, { 27: 85, 37: [1, 86], 38: [1, 87], 39: [1, 88] }, { 29: 89, 40: [1, 90], 41: [1, 91], 42: [1, 92], 43: [1, 93] }, o($VA, [2, 18]), { 48: 94, 62: [1, 95], 63: [1, 96] }, { 50: 97, 62: [1, 98], 63: [1, 99] }, o($VA, [2, 36]), { 5: [1, 100] }, { 5: [1, 101] }, { 5: [2, 51] }, { 5: [2, 52] }, { 5: [1, 102] }, { 5: [2, 26] }, { 5: [2, 27] }, { 5: [2, 28] }, { 5: [1, 103] }, { 5: [2, 29] }, { 5: [2, 30] }, { 5: [2, 31] }, { 5: [2, 32] }, { 5: [1, 104] }, { 5: [2, 55] }, { 5: [2, 56] }, { 5: [1, 105] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: $Vq, 20: 106, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 107, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 108, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 109, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vw, 30: $Vx, 46: 110, 47: $Vy, 49: $Vz }, { 5: $Vw, 30: $Vx, 46: 111, 47: $Vy, 49: $Vz }, o($VA, [2, 14]), o($VA, [2, 15]), o($VA, [2, 16]), o($VA, [2, 17]), o($VA, [2, 34]), o($VA, [2, 35])], - defaultActions: { 8: [2, 2], 12: [2, 1], 30: [2, 3], 31: [2, 8], 32: [2, 9], 33: [2, 10], 34: [2, 11], 35: [2, 12], 37: [2, 47], 38: [2, 48], 40: [2, 53], 41: [2, 54], 83: [2, 51], 84: [2, 52], 86: [2, 26], 87: [2, 27], 88: [2, 28], 90: [2, 29], 91: [2, 30], 92: [2, 31], 93: [2, 32], 95: [2, 55], 96: [2, 56], 98: [2, 57], 99: [2, 58] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + }; + EMPTY_PREDICATES = new PredicateSet(); + LLStarLookaheadStrategy = class extends LLkLookaheadStrategy { + static { + __name(this, "LLStarLookaheadStrategy"); } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + constructor(options3) { + var _a; + super(); + this.logging = (_a = options3 === null || options3 === void 0 ? void 0 : options3.logging) !== null && _a !== void 0 ? _a : (message) => console.log(message); + } + initialize(options3) { + this.atn = createATN(options3.rules); + this.dfas = initATNSimulator(this.atn); + } + validateAmbiguousAlternationAlternatives() { + return []; + } + validateEmptyOrAlternatives() { + return []; } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + buildLookaheadForAlternation(options3) { + const { prodOccurrence, rule, hasPredicates, dynamicTokensEnabled } = options3; + const dfas = this.dfas; + const logging = this.logging; + const key = buildATNKey(rule, "Alternation", prodOccurrence); + const decisionState = this.atn.decisionMap[key]; + const decisionIndex = decisionState.decision; + const partialAlts = map_default(getLookaheadPaths({ + maxLookahead: 1, + occurrence: prodOccurrence, + prodType: "Alternation", + rule + }), (currAlt) => map_default(currAlt, (path4) => path4[0])); + if (isLL1Sequence(partialAlts, false) && !dynamicTokensEnabled) { + const choiceToAlt = reduce_default(partialAlts, (result, currAlt, idx) => { + forEach_default(currAlt, (currTokType) => { + if (currTokType) { + result[currTokType.tokenTypeIdx] = idx; + forEach_default(currTokType.categoryMatches, (currExtendingType) => { + result[currExtendingType] = idx; + }); + } + }); + return result; + }, {}); + if (hasPredicates) { + return function(orAlts) { + var _a; + const nextToken = this.LA(1); + const prediction = choiceToAlt[nextToken.tokenTypeIdx]; + if (orAlts !== void 0 && prediction !== void 0) { + const gate = (_a = orAlts[prediction]) === null || _a === void 0 ? void 0 : _a.GATE; + if (gate !== void 0 && gate.call(this) === false) { + return void 0; + } + } + return prediction; + }; + } else { + return function() { + const nextToken = this.LA(1); + return choiceToAlt[nextToken.tokenTypeIdx]; + }; + } + } else if (hasPredicates) { + return function(orAlts) { + const predicates = new PredicateSet(); + const length2 = orAlts === void 0 ? 0 : orAlts.length; + for (let i2 = 0; i2 < length2; i2++) { + const gate = orAlts === null || orAlts === void 0 ? void 0 : orAlts[i2].GATE; + predicates.set(i2, gate === void 0 || gate.call(this)); + } + const result = adaptivePredict.call(this, dfas, decisionIndex, predicates, logging); + return typeof result === "number" ? result : void 0; + }; + } else { + return function() { + const result = adaptivePredict.call(this, dfas, decisionIndex, EMPTY_PREDICATES, logging); + return typeof result === "number" ? result : void 0; + }; + } + } + buildLookaheadForOptional(options3) { + const { prodOccurrence, rule, prodType, dynamicTokensEnabled } = options3; + const dfas = this.dfas; + const logging = this.logging; + const key = buildATNKey(rule, prodType, prodOccurrence); + const decisionState = this.atn.decisionMap[key]; + const decisionIndex = decisionState.decision; + const alts = map_default(getLookaheadPaths({ + maxLookahead: 1, + occurrence: prodOccurrence, + prodType, + rule + }), (e3) => { + return map_default(e3, (g2) => g2[0]); + }); + if (isLL1Sequence(alts) && alts[0][0] && !dynamicTokensEnabled) { + const alt = alts[0]; + const singleTokensTypes = flatten_default(alt); + if (singleTokensTypes.length === 1 && isEmpty_default(singleTokensTypes[0].categoryMatches)) { + const expectedTokenType = singleTokensTypes[0]; + const expectedTokenUniqueKey = expectedTokenType.tokenTypeIdx; + return function() { + return this.LA(1).tokenTypeIdx === expectedTokenUniqueKey; + }; + } else { + const choiceToAlt = reduce_default(singleTokensTypes, (result, currTokType) => { + if (currTokType !== void 0) { + result[currTokType.tokenTypeIdx] = true; + forEach_default(currTokType.categoryMatches, (currExtendingType) => { + result[currExtendingType] = true; + }); + } + return result; + }, {}); + return function() { + const nextToken = this.LA(1); + return choiceToAlt[nextToken.tokenTypeIdx] === true; + }; } - token2 = self2.symbols_[token2] || token2; } - return token2; + return function() { + const result = adaptivePredict.call(this, dfas, decisionIndex, EMPTY_PREDICATES, logging); + return typeof result === "object" ? false : result === 0; + }; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; + }; + __name(isLL1Sequence, "isLL1Sequence"); + __name(initATNSimulator, "initATNSimulator"); + __name(adaptivePredict, "adaptivePredict"); + __name(performLookahead, "performLookahead"); + __name(computeLookaheadTarget, "computeLookaheadTarget"); + __name(reportLookaheadAmbiguity, "reportLookaheadAmbiguity"); + __name(buildAmbiguityError, "buildAmbiguityError"); + __name(getProductionDslName2, "getProductionDslName"); + __name(buildAdaptivePredictError, "buildAdaptivePredictError"); + __name(getExistingTargetState, "getExistingTargetState"); + __name(computeReachSet, "computeReachSet"); + __name(getReachableTarget, "getReachableTarget"); + __name(getUniqueAlt, "getUniqueAlt"); + __name(newDFAState, "newDFAState"); + __name(addDFAEdge, "addDFAEdge"); + __name(addDFAState, "addDFAState"); + __name(computeStartState, "computeStartState"); + __name(closure, "closure"); + __name(getEpsilonTarget, "getEpsilonTarget"); + __name(hasConfigInRuleStopState, "hasConfigInRuleStopState"); + __name(allConfigsInRuleStopStates, "allConfigsInRuleStopStates"); + __name(hasConflictTerminatingPrediction, "hasConflictTerminatingPrediction"); + __name(getConflictingAltSets, "getConflictingAltSets"); + __name(hasConflictingAltSet, "hasConflictingAltSet"); + __name(hasStateAssociatedWithOneAlt, "hasStateAssociatedWithOneAlt"); + } + }); + + // ../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/index.js + var init_lib = __esm({ + "../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/index.js"() { + "use strict"; + init_all_star_lookahead(); + } + }); + + // ../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js + var DocumentUri, URI, integer, uinteger, Position, Range, Location, LocationLink, Color3, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, CodeDescription, Diagnostic, Command, TextEdit, ChangeAnnotation, ChangeAnnotationIdentifier, AnnotatedTextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, TextDocumentIdentifier, VersionedTextDocumentIdentifier, OptionalVersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItemTag, InsertReplaceEdit, InsertTextMode, CompletionItemLabelDetails, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolTag, SymbolInformation, WorkspaceSymbol, DocumentSymbol, CodeActionKind, CodeActionTriggerKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, SelectionRange, SemanticTokenTypes, SemanticTokenModifiers, SemanticTokens, InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression, InlineValueContext, InlayHintKind, InlayHintLabelPart, InlayHint, StringValue, InlineCompletionItem, InlineCompletionList, InlineCompletionTriggerKind, SelectedCompletionInfo, InlineCompletionContext, WorkspaceFolder, TextDocument, FullTextDocument, Is; + var init_main = __esm({ + "../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"() { + "use strict"; + (function(DocumentUri2) { + function is2(value2) { + return typeof value2 === "string"; + } + __name(is2, "is"); + DocumentUri2.is = is2; + })(DocumentUri || (DocumentUri = {})); + (function(URI3) { + function is2(value2) { + return typeof value2 === "string"; + } + __name(is2, "is"); + URI3.is = is2; + })(URI || (URI = {})); + (function(integer4) { + integer4.MIN_VALUE = -2147483648; + integer4.MAX_VALUE = 2147483647; + function is2(value2) { + return typeof value2 === "number" && integer4.MIN_VALUE <= value2 && value2 <= integer4.MAX_VALUE; + } + __name(is2, "is"); + integer4.is = is2; + })(integer || (integer = {})); + (function(uinteger2) { + uinteger2.MIN_VALUE = 0; + uinteger2.MAX_VALUE = 2147483647; + function is2(value2) { + return typeof value2 === "number" && uinteger2.MIN_VALUE <= value2 && value2 <= uinteger2.MAX_VALUE; + } + __name(is2, "is"); + uinteger2.is = is2; + })(uinteger || (uinteger = {})); + (function(Position2) { + function create2(line2, character2) { + if (line2 === Number.MAX_VALUE) { + line2 = uinteger.MAX_VALUE; + } + if (character2 === Number.MAX_VALUE) { + character2 = uinteger.MAX_VALUE; + } + return { line: line2, character: character2 }; + } + __name(create2, "create"); + Position2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); + } + __name(is2, "is"); + Position2.is = is2; + })(Position || (Position = {})); + (function(Range2) { + function create2(one4, two, three, four) { + if (Is.uinteger(one4) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { + return { start: Position.create(one4, two), end: Position.create(three, four) }; + } else if (Position.is(one4) && Position.is(two)) { + return { start: one4, end: two }; } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; + throw new Error(`Range#create called with invalid arguments[${one4}, ${two}, ${three}, ${four}]`); + } + } + __name(create2, "create"); + Range2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + __name(is2, "is"); + Range2.is = is2; + })(Range || (Range = {})); + (function(Location2) { + function create2(uri, range3) { + return { uri, range: range3 }; + } + __name(create2, "create"); + Location2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + __name(is2, "is"); + Location2.is = is2; + })(Location || (Location = {})); + (function(LocationLink2) { + function create2(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { targetUri, targetRange, targetSelectionRange, originSelectionRange }; + } + __name(create2, "create"); + LocationLink2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + __name(is2, "is"); + LocationLink2.is = is2; + })(LocationLink || (LocationLink = {})); + (function(Color4) { + function create2(red, green, blue, alpha) { + return { + red, + green, + blue, + alpha + }; + } + __name(create2, "create"); + Color4.create = create2; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); + } + __name(is2, "is"); + Color4.is = is2; + })(Color3 || (Color3 = {})); + (function(ColorInformation2) { + function create2(range3, color2) { + return { + range: range3, + color: color2 + }; + } + __name(create2, "create"); + ColorInformation2.create = create2; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color3.is(candidate.color); + } + __name(is2, "is"); + ColorInformation2.is = is2; + })(ColorInformation || (ColorInformation = {})); + (function(ColorPresentation2) { + function create2(label, textEdit, additionalTextEdits) { + return { + label, + textEdit, + additionalTextEdits + }; + } + __name(create2, "create"); + ColorPresentation2.create = create2; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + __name(is2, "is"); + ColorPresentation2.is = is2; + })(ColorPresentation || (ColorPresentation = {})); + (function(FoldingRangeKind2) { + FoldingRangeKind2.Comment = "comment"; + FoldingRangeKind2.Imports = "imports"; + FoldingRangeKind2.Region = "region"; + })(FoldingRangeKind || (FoldingRangeKind = {})); + (function(FoldingRange2) { + function create2(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) { + const result = { + startLine, + endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + if (Is.defined(kind)) { + result.kind = kind; } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + if (Is.defined(collapsedText)) { + result.collapsedText = collapsedText; } + return result; } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + __name(create2, "create"); + FoldingRange2.create = create2; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + __name(is2, "is"); + FoldingRange2.is = is2; + })(FoldingRange || (FoldingRange = {})); + (function(DiagnosticRelatedInformation2) { + function create2(location, message) { + return { + location, + message + }; + } + __name(create2, "create"); + DiagnosticRelatedInformation2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + __name(is2, "is"); + DiagnosticRelatedInformation2.is = is2; + })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); + (function(DiagnosticSeverity2) { + DiagnosticSeverity2.Error = 1; + DiagnosticSeverity2.Warning = 2; + DiagnosticSeverity2.Information = 3; + DiagnosticSeverity2.Hint = 4; + })(DiagnosticSeverity || (DiagnosticSeverity = {})); + (function(DiagnosticTag2) { + DiagnosticTag2.Unnecessary = 1; + DiagnosticTag2.Deprecated = 2; + })(DiagnosticTag || (DiagnosticTag = {})); + (function(CodeDescription2) { + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Is.string(candidate.href); + } + __name(is2, "is"); + CodeDescription2.is = is2; + })(CodeDescription || (CodeDescription = {})); + (function(Diagnostic2) { + function create2(range3, message, severity, code, source, relatedInformation) { + let result = { range: range3, message }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 + return result; + } + __name(create2, "create"); + Diagnostic2.create = create2; + function is2(value2) { + var _a; + let candidate = value2; + return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + __name(is2, "is"); + Diagnostic2.is = is2; + })(Diagnostic || (Diagnostic = {})); + (function(Command2) { + function create2(title2, command, ...args) { + let result = { title: title2, command }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + __name(create2, "create"); + Command2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + __name(is2, "is"); + Command2.is = is2; + })(Command || (Command = {})); + (function(TextEdit2) { + function replace2(range3, newText) { + return { range: range3, newText }; + } + __name(replace2, "replace"); + TextEdit2.replace = replace2; + function insert(position5, newText) { + return { range: { start: position5, end: position5 }, newText }; + } + __name(insert, "insert"); + TextEdit2.insert = insert; + function del(range3) { + return { range: range3, newText: "" }; + } + __name(del, "del"); + TextEdit2.del = del; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range); + } + __name(is2, "is"); + TextEdit2.is = is2; + })(TextEdit || (TextEdit = {})); + (function(ChangeAnnotation2) { + function create2(label, needsConfirmation, description) { + const result = { label }; + if (needsConfirmation !== void 0) { + result.needsConfirmation = needsConfirmation; + } + if (description !== void 0) { + result.description = description; + } + return result; + } + __name(create2, "create"); + ChangeAnnotation2.create = create2; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0); + } + __name(is2, "is"); + ChangeAnnotation2.is = is2; + })(ChangeAnnotation || (ChangeAnnotation = {})); + (function(ChangeAnnotationIdentifier2) { + function is2(value2) { + const candidate = value2; + return Is.string(candidate); + } + __name(is2, "is"); + ChangeAnnotationIdentifier2.is = is2; + })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {})); + (function(AnnotatedTextEdit2) { + function replace2(range3, newText, annotation) { + return { range: range3, newText, annotationId: annotation }; + } + __name(replace2, "replace"); + AnnotatedTextEdit2.replace = replace2; + function insert(position5, newText, annotation) { + return { range: { start: position5, end: position5 }, newText, annotationId: annotation }; + } + __name(insert, "insert"); + AnnotatedTextEdit2.insert = insert; + function del(range3, annotation) { + return { range: range3, newText: "", annotationId: annotation }; + } + __name(del, "del"); + AnnotatedTextEdit2.del = del; + function is2(value2) { + const candidate = value2; + return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + __name(is2, "is"); + AnnotatedTextEdit2.is = is2; + })(AnnotatedTextEdit || (AnnotatedTextEdit = {})); + (function(TextDocumentEdit2) { + function create2(textDocument, edits) { + return { textDocument, edits }; + } + __name(create2, "create"); + TextDocumentEdit2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); + } + __name(is2, "is"); + TextDocumentEdit2.is = is2; + })(TextDocumentEdit || (TextDocumentEdit = {})); + (function(CreateFile2) { + function create2(uri, options3, annotation) { + let result = { + kind: "create", + uri }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + if (options3 !== void 0 && (options3.overwrite !== void 0 || options3.ignoreIfExists !== void 0)) { + result.options = options3; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + __name(create2, "create"); + CreateFile2.create = create2; + function is2(value2) { + let candidate = value2; + return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + __name(is2, "is"); + CreateFile2.is = is2; + })(CreateFile || (CreateFile = {})); + (function(RenameFile2) { + function create2(oldUri, newUri, options3, annotation) { + let result = { + kind: "rename", + oldUri, + newUri + }; + if (options3 !== void 0 && (options3.overwrite !== void 0 || options3.ignoreIfExists !== void 0)) { + result.options = options3; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + __name(create2, "create"); + RenameFile2.create = create2; + function is2(value2) { + let candidate = value2; + return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + __name(is2, "is"); + RenameFile2.is = is2; + })(RenameFile || (RenameFile = {})); + (function(DeleteFile2) { + function create2(uri, options3, annotation) { + let result = { + kind: "delete", + uri + }; + if (options3 !== void 0 && (options3.recursive !== void 0 || options3.ignoreIfNotExists !== void 0)) { + result.options = options3; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + __name(create2, "create"); + DeleteFile2.create = create2; + function is2(value2) { + let candidate = value2; + return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + __name(is2, "is"); + DeleteFile2.is = is2; + })(DeleteFile || (DeleteFile = {})); + (function(WorkspaceEdit2) { + function is2(value2) { + let candidate = value2; + return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change2) => { + if (Is.string(change2.kind)) { + return CreateFile.is(change2) || RenameFile.is(change2) || DeleteFile.is(change2); + } else { + return TextDocumentEdit.is(change2); + } + })); + } + __name(is2, "is"); + WorkspaceEdit2.is = is2; + })(WorkspaceEdit || (WorkspaceEdit = {})); + (function(TextDocumentIdentifier2) { + function create2(uri) { + return { uri }; + } + __name(create2, "create"); + TextDocumentIdentifier2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.string(candidate.uri); + } + __name(is2, "is"); + TextDocumentIdentifier2.is = is2; + })(TextDocumentIdentifier || (TextDocumentIdentifier = {})); + (function(VersionedTextDocumentIdentifier2) { + function create2(uri, version4) { + return { uri, version: version4 }; + } + __name(create2, "create"); + VersionedTextDocumentIdentifier2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); + } + __name(is2, "is"); + VersionedTextDocumentIdentifier2.is = is2; + })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); + (function(OptionalVersionedTextDocumentIdentifier2) { + function create2(uri, version4) { + return { uri, version: version4 }; + } + __name(create2, "create"); + OptionalVersionedTextDocumentIdentifier2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); + } + __name(is2, "is"); + OptionalVersionedTextDocumentIdentifier2.is = is2; + })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {})); + (function(TextDocumentItem2) { + function create2(uri, languageId, version4, text2) { + return { uri, languageId, version: version4, text: text2 }; + } + __name(create2, "create"); + TextDocumentItem2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); + } + __name(is2, "is"); + TextDocumentItem2.is = is2; + })(TextDocumentItem || (TextDocumentItem = {})); + (function(MarkupKind2) { + MarkupKind2.PlainText = "plaintext"; + MarkupKind2.Markdown = "markdown"; + function is2(value2) { + const candidate = value2; + return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown; + } + __name(is2, "is"); + MarkupKind2.is = is2; + })(MarkupKind || (MarkupKind = {})); + (function(MarkupContent2) { + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(value2) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + __name(is2, "is"); + MarkupContent2.is = is2; + })(MarkupContent || (MarkupContent = {})); + (function(CompletionItemKind2) { + CompletionItemKind2.Text = 1; + CompletionItemKind2.Method = 2; + CompletionItemKind2.Function = 3; + CompletionItemKind2.Constructor = 4; + CompletionItemKind2.Field = 5; + CompletionItemKind2.Variable = 6; + CompletionItemKind2.Class = 7; + CompletionItemKind2.Interface = 8; + CompletionItemKind2.Module = 9; + CompletionItemKind2.Property = 10; + CompletionItemKind2.Unit = 11; + CompletionItemKind2.Value = 12; + CompletionItemKind2.Enum = 13; + CompletionItemKind2.Keyword = 14; + CompletionItemKind2.Snippet = 15; + CompletionItemKind2.Color = 16; + CompletionItemKind2.File = 17; + CompletionItemKind2.Reference = 18; + CompletionItemKind2.Folder = 19; + CompletionItemKind2.EnumMember = 20; + CompletionItemKind2.Constant = 21; + CompletionItemKind2.Struct = 22; + CompletionItemKind2.Event = 23; + CompletionItemKind2.Operator = 24; + CompletionItemKind2.TypeParameter = 25; + })(CompletionItemKind || (CompletionItemKind = {})); + (function(InsertTextFormat2) { + InsertTextFormat2.PlainText = 1; + InsertTextFormat2.Snippet = 2; + })(InsertTextFormat || (InsertTextFormat = {})); + (function(CompletionItemTag2) { + CompletionItemTag2.Deprecated = 1; + })(CompletionItemTag || (CompletionItemTag = {})); + (function(InsertReplaceEdit2) { + function create2(newText, insert, replace2) { + return { newText, insert, replace: replace2 }; + } + __name(create2, "create"); + InsertReplaceEdit2.create = create2; + function is2(value2) { + const candidate = value2; + return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); + } + __name(is2, "is"); + InsertReplaceEdit2.is = is2; + })(InsertReplaceEdit || (InsertReplaceEdit = {})); + (function(InsertTextMode2) { + InsertTextMode2.asIs = 1; + InsertTextMode2.adjustIndentation = 2; + })(InsertTextMode || (InsertTextMode = {})); + (function(CompletionItemLabelDetails2) { + function is2(value2) { + const candidate = value2; + return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0); + } + __name(is2, "is"); + CompletionItemLabelDetails2.is = is2; + })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {})); + (function(CompletionItem2) { + function create2(label) { + return { label }; + } + __name(create2, "create"); + CompletionItem2.create = create2; + })(CompletionItem || (CompletionItem = {})); + (function(CompletionList2) { + function create2(items, isIncomplete) { + return { items: items ? items : [], isIncomplete: !!isIncomplete }; + } + __name(create2, "create"); + CompletionList2.create = create2; + })(CompletionList || (CompletionList = {})); + (function(MarkedString2) { + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); + } + __name(fromPlainText, "fromPlainText"); + MarkedString2.fromPlainText = fromPlainText; + function is2(value2) { + const candidate = value2; + return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); + } + __name(is2, "is"); + MarkedString2.is = is2; + })(MarkedString || (MarkedString = {})); + (function(Hover2) { + function is2(value2) { + let candidate = value2; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value2.range === void 0 || Range.is(value2.range)); + } + __name(is2, "is"); + Hover2.is = is2; + })(Hover || (Hover = {})); + (function(ParameterInformation2) { + function create2(label, documentation) { + return documentation ? { label, documentation } : { label }; + } + __name(create2, "create"); + ParameterInformation2.create = create2; + })(ParameterInformation || (ParameterInformation = {})); + (function(SignatureInformation2) { + function create2(label, documentation, ...parameters) { + let result = { label }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; } else { - this.yylloc.last_column++; + result.parameters = []; } - if (this.options.ranges) { - this.yylloc.range[1]++; + return result; + } + __name(create2, "create"); + SignatureInformation2.create = create2; + })(SignatureInformation || (SignatureInformation = {})); + (function(DocumentHighlightKind2) { + DocumentHighlightKind2.Text = 1; + DocumentHighlightKind2.Read = 2; + DocumentHighlightKind2.Write = 3; + })(DocumentHighlightKind || (DocumentHighlightKind = {})); + (function(DocumentHighlight2) { + function create2(range3, kind) { + let result = { range: range3 }; + if (Is.number(kind)) { + result.kind = kind; } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + return result; + } + __name(create2, "create"); + DocumentHighlight2.create = create2; + })(DocumentHighlight || (DocumentHighlight = {})); + (function(SymbolKind2) { + SymbolKind2.File = 1; + SymbolKind2.Module = 2; + SymbolKind2.Namespace = 3; + SymbolKind2.Package = 4; + SymbolKind2.Class = 5; + SymbolKind2.Method = 6; + SymbolKind2.Property = 7; + SymbolKind2.Field = 8; + SymbolKind2.Constructor = 9; + SymbolKind2.Enum = 10; + SymbolKind2.Interface = 11; + SymbolKind2.Function = 12; + SymbolKind2.Variable = 13; + SymbolKind2.Constant = 14; + SymbolKind2.String = 15; + SymbolKind2.Number = 16; + SymbolKind2.Boolean = 17; + SymbolKind2.Array = 18; + SymbolKind2.Object = 19; + SymbolKind2.Key = 20; + SymbolKind2.Null = 21; + SymbolKind2.EnumMember = 22; + SymbolKind2.Struct = 23; + SymbolKind2.Event = 24; + SymbolKind2.Operator = 25; + SymbolKind2.TypeParameter = 26; + })(SymbolKind || (SymbolKind = {})); + (function(SymbolTag2) { + SymbolTag2.Deprecated = 1; + })(SymbolTag || (SymbolTag = {})); + (function(SymbolInformation2) { + function create2(name, kind, range3, uri, containerName) { + let result = { + name, + kind, + location: { uri, range: range3 } }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + if (containerName) { + result.containerName = containerName; } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; + return result; + } + __name(create2, "create"); + SymbolInformation2.create = create2; + })(SymbolInformation || (SymbolInformation = {})); + (function(WorkspaceSymbol2) { + function create2(name, kind, uri, range3) { + return range3 !== void 0 ? { name, kind, location: { uri, range: range3 } } : { name, kind, location: { uri } }; + } + __name(create2, "create"); + WorkspaceSymbol2.create = create2; + })(WorkspaceSymbol || (WorkspaceSymbol = {})); + (function(DocumentSymbol2) { + function create2(name, detail, kind, range3, selectionRange, children2) { + let result = { + name, + detail, + kind, + range: range3, + selectionRange + }; + if (children2 !== void 0) { + result.children = children2; + } + return result; + } + __name(create2, "create"); + DocumentSymbol2.create = create2; + function is2(value2) { + let candidate = value2; + return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags)); + } + __name(is2, "is"); + DocumentSymbol2.is = is2; + })(DocumentSymbol || (DocumentSymbol = {})); + (function(CodeActionKind2) { + CodeActionKind2.Empty = ""; + CodeActionKind2.QuickFix = "quickfix"; + CodeActionKind2.Refactor = "refactor"; + CodeActionKind2.RefactorExtract = "refactor.extract"; + CodeActionKind2.RefactorInline = "refactor.inline"; + CodeActionKind2.RefactorRewrite = "refactor.rewrite"; + CodeActionKind2.Source = "source"; + CodeActionKind2.SourceOrganizeImports = "source.organizeImports"; + CodeActionKind2.SourceFixAll = "source.fixAll"; + })(CodeActionKind || (CodeActionKind = {})); + (function(CodeActionTriggerKind2) { + CodeActionTriggerKind2.Invoked = 1; + CodeActionTriggerKind2.Automatic = 2; + })(CodeActionTriggerKind || (CodeActionTriggerKind = {})); + (function(CodeActionContext2) { + function create2(diagnostics, only, triggerKind) { + let result = { diagnostics }; + if (only !== void 0 && only !== null) { + result.only = only; + } + if (triggerKind !== void 0 && triggerKind !== null) { + result.triggerKind = triggerKind; + } + return result; + } + __name(create2, "create"); + CodeActionContext2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic); + } + __name(is2, "is"); + CodeActionContext2.is = is2; + })(CodeActionContext || (CodeActionContext = {})); + (function(CodeAction2) { + function create2(title2, kindOrCommandOrEdit, kind) { + let result = { title: title2 }; + let checkKind = true; + if (typeof kindOrCommandOrEdit === "string") { + checkKind = false; + result.kind = kindOrCommandOrEdit; + } else if (Command.is(kindOrCommandOrEdit)) { + result.command = kindOrCommandOrEdit; } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + result.edit = kindOrCommandOrEdit; } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + if (checkKind && kind !== void 0) { + result.kind = kind; } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } + return result; + } + __name(create2, "create"); + CodeAction2.create = create2; + function is2(value2) { + let candidate = value2; + return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); + } + __name(is2, "is"); + CodeAction2.is = is2; + })(CodeAction || (CodeAction = {})); + (function(CodeLens2) { + function create2(range3, data5) { + let result = { range: range3 }; + if (Is.defined(data5)) { + result.data = data5; } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + return result; + } + __name(create2, "create"); + CodeLens2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + __name(is2, "is"); + CodeLens2.is = is2; + })(CodeLens || (CodeLens = {})); + (function(FormattingOptions2) { + function create2(tabSize, insertSpaces) { + return { tabSize, insertSpaces }; + } + __name(create2, "create"); + FormattingOptions2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + __name(is2, "is"); + FormattingOptions2.is = is2; + })(FormattingOptions || (FormattingOptions = {})); + (function(DocumentLink2) { + function create2(range3, target, data5) { + return { range: range3, target, data: data5 }; + } + __name(create2, "create"); + DocumentLink2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + __name(is2, "is"); + DocumentLink2.is = is2; + })(DocumentLink || (DocumentLink = {})); + (function(SelectionRange2) { + function create2(range3, parent4) { + return { range: range3, parent: parent4 }; + } + __name(create2, "create"); + SelectionRange2.create = create2; + function is2(value2) { + let candidate = value2; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent)); + } + __name(is2, "is"); + SelectionRange2.is = is2; + })(SelectionRange || (SelectionRange = {})); + (function(SemanticTokenTypes2) { + SemanticTokenTypes2["namespace"] = "namespace"; + SemanticTokenTypes2["type"] = "type"; + SemanticTokenTypes2["class"] = "class"; + SemanticTokenTypes2["enum"] = "enum"; + SemanticTokenTypes2["interface"] = "interface"; + SemanticTokenTypes2["struct"] = "struct"; + SemanticTokenTypes2["typeParameter"] = "typeParameter"; + SemanticTokenTypes2["parameter"] = "parameter"; + SemanticTokenTypes2["variable"] = "variable"; + SemanticTokenTypes2["property"] = "property"; + SemanticTokenTypes2["enumMember"] = "enumMember"; + SemanticTokenTypes2["event"] = "event"; + SemanticTokenTypes2["function"] = "function"; + SemanticTokenTypes2["method"] = "method"; + SemanticTokenTypes2["macro"] = "macro"; + SemanticTokenTypes2["keyword"] = "keyword"; + SemanticTokenTypes2["modifier"] = "modifier"; + SemanticTokenTypes2["comment"] = "comment"; + SemanticTokenTypes2["string"] = "string"; + SemanticTokenTypes2["number"] = "number"; + SemanticTokenTypes2["regexp"] = "regexp"; + SemanticTokenTypes2["operator"] = "operator"; + SemanticTokenTypes2["decorator"] = "decorator"; + })(SemanticTokenTypes || (SemanticTokenTypes = {})); + (function(SemanticTokenModifiers2) { + SemanticTokenModifiers2["declaration"] = "declaration"; + SemanticTokenModifiers2["definition"] = "definition"; + SemanticTokenModifiers2["readonly"] = "readonly"; + SemanticTokenModifiers2["static"] = "static"; + SemanticTokenModifiers2["deprecated"] = "deprecated"; + SemanticTokenModifiers2["abstract"] = "abstract"; + SemanticTokenModifiers2["async"] = "async"; + SemanticTokenModifiers2["modification"] = "modification"; + SemanticTokenModifiers2["documentation"] = "documentation"; + SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary"; + })(SemanticTokenModifiers || (SemanticTokenModifiers = {})); + (function(SemanticTokens2) { + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number"); + } + __name(is2, "is"); + SemanticTokens2.is = is2; + })(SemanticTokens || (SemanticTokens = {})); + (function(InlineValueText2) { + function create2(range3, text2) { + return { range: range3, text: text2 }; + } + __name(create2, "create"); + InlineValueText2.create = create2; + function is2(value2) { + const candidate = value2; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text); + } + __name(is2, "is"); + InlineValueText2.is = is2; + })(InlineValueText || (InlineValueText = {})); + (function(InlineValueVariableLookup2) { + function create2(range3, variableName, caseSensitiveLookup) { + return { range: range3, variableName, caseSensitiveLookup }; + } + __name(create2, "create"); + InlineValueVariableLookup2.create = create2; + function is2(value2) { + const candidate = value2; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0); + } + __name(is2, "is"); + InlineValueVariableLookup2.is = is2; + })(InlineValueVariableLookup || (InlineValueVariableLookup = {})); + (function(InlineValueEvaluatableExpression2) { + function create2(range3, expression) { + return { range: range3, expression }; + } + __name(create2, "create"); + InlineValueEvaluatableExpression2.create = create2; + function is2(value2) { + const candidate = value2; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0); + } + __name(is2, "is"); + InlineValueEvaluatableExpression2.is = is2; + })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {})); + (function(InlineValueContext2) { + function create2(frameId, stoppedLocation) { + return { frameId, stoppedLocation }; + } + __name(create2, "create"); + InlineValueContext2.create = create2; + function is2(value2) { + const candidate = value2; + return Is.defined(candidate) && Range.is(value2.stoppedLocation); + } + __name(is2, "is"); + InlineValueContext2.is = is2; + })(InlineValueContext || (InlineValueContext = {})); + (function(InlayHintKind2) { + InlayHintKind2.Type = 1; + InlayHintKind2.Parameter = 2; + function is2(value2) { + return value2 === 1 || value2 === 2; + } + __name(is2, "is"); + InlayHintKind2.is = is2; + })(InlayHintKind || (InlayHintKind = {})); + (function(InlayHintLabelPart2) { + function create2(value2) { + return { value: value2 }; + } + __name(create2, "create"); + InlayHintLabelPart2.create = create2; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command)); + } + __name(is2, "is"); + InlayHintLabelPart2.is = is2; + })(InlayHintLabelPart || (InlayHintLabelPart = {})); + (function(InlayHint2) { + function create2(position5, label, kind) { + const result = { position: position5, label }; + if (kind !== void 0) { + result.kind = kind; } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; + return result; + } + __name(create2, "create"); + InlayHint2.create = create2; + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight)); + } + __name(is2, "is"); + InlayHint2.is = is2; + })(InlayHint || (InlayHint = {})); + (function(StringValue2) { + function createSnippet(value2) { + return { kind: "snippet", value: value2 }; + } + __name(createSnippet, "createSnippet"); + StringValue2.createSnippet = createSnippet; + })(StringValue || (StringValue = {})); + (function(InlineCompletionItem2) { + function create2(insertText, filterText, range3, command) { + return { insertText, filterText, range: range3, command }; + } + __name(create2, "create"); + InlineCompletionItem2.create = create2; + })(InlineCompletionItem || (InlineCompletionItem = {})); + (function(InlineCompletionList2) { + function create2(items) { + return { items }; + } + __name(create2, "create"); + InlineCompletionList2.create = create2; + })(InlineCompletionList || (InlineCompletionList = {})); + (function(InlineCompletionTriggerKind2) { + InlineCompletionTriggerKind2.Invoked = 0; + InlineCompletionTriggerKind2.Automatic = 1; + })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {})); + (function(SelectedCompletionInfo2) { + function create2(range3, text2) { + return { range: range3, text: text2 }; + } + __name(create2, "create"); + SelectedCompletionInfo2.create = create2; + })(SelectedCompletionInfo || (SelectedCompletionInfo = {})); + (function(InlineCompletionContext2) { + function create2(triggerKind, selectedCompletionInfo) { + return { triggerKind, selectedCompletionInfo }; + } + __name(create2, "create"); + InlineCompletionContext2.create = create2; + })(InlineCompletionContext || (InlineCompletionContext = {})); + (function(WorkspaceFolder2) { + function is2(value2) { + const candidate = value2; + return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name); + } + __name(is2, "is"); + WorkspaceFolder2.is = is2; + })(WorkspaceFolder || (WorkspaceFolder = {})); + (function(TextDocument3) { + function create2(uri, languageId, version4, content) { + return new FullTextDocument(uri, languageId, version4, content); + } + __name(create2, "create"); + TextDocument3.create = create2; + function is2(value2) { + let candidate = value2; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + __name(is2, "is"); + TextDocument3.is = is2; + function applyEdits(document2, edits) { + let text2 = document2.getText(); + let sortedEdits = mergeSort2(edits, (a2, b2) => { + let diff2 = a2.range.start.line - b2.range.start.line; + if (diff2 === 0) { + return a2.range.start.character - b2.range.start.character; + } + return diff2; + }); + let lastModifiedOffset = text2.length; + for (let i2 = sortedEdits.length - 1; i2 >= 0; i2--) { + let e3 = sortedEdits[i2]; + let startOffset = document2.offsetAt(e3.range.start); + let endOffset = document2.offsetAt(e3.range.end); + if (endOffset <= lastModifiedOffset) { + text2 = text2.substring(0, startOffset) + e3.newText + text2.substring(endOffset, text2.length); + } else { + throw new Error("Overlapping edit"); + } + lastModifiedOffset = startOffset; + } + return text2; + } + __name(applyEdits, "applyEdits"); + TextDocument3.applyEdits = applyEdits; + function mergeSort2(data5, compare) { + if (data5.length <= 1) { + return data5; + } + const p3 = data5.length / 2 | 0; + const left3 = data5.slice(0, p3); + const right3 = data5.slice(p3); + mergeSort2(left3, compare); + mergeSort2(right3, compare); + let leftIdx = 0; + let rightIdx = 0; + let i2 = 0; + while (leftIdx < left3.length && rightIdx < right3.length) { + let ret = compare(left3[leftIdx], right3[rightIdx]); + if (ret <= 0) { + data5[i2++] = left3[leftIdx++]; + } else { + data5[i2++] = right3[rightIdx++]; } - return false; } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; + while (leftIdx < left3.length) { + data5[i2++] = left3[leftIdx++]; + } + while (rightIdx < right3.length) { + data5[i2++] = right3[rightIdx++]; + } + return data5; + } + __name(mergeSort2, "mergeSort"); + })(TextDocument || (TextDocument = {})); + FullTextDocument = class { + static { + __name(this, "FullTextDocument"); + } + constructor(uri, languageId, version4, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version4; + this._content = content; + this._lineOffsets = void 0; + } + get uri() { + return this._uri; + } + get languageId() { + return this._languageId; + } + get version() { + return this._version; + } + getText(range3) { + if (range3) { + let start3 = this.offsetAt(range3.start); + let end2 = this.offsetAt(range3.end); + return this._content.substring(start3, end2); + } + return this._content; + } + update(event3, version4) { + this._content = event3.text; + this._version = version4; + this._lineOffsets = void 0; + } + getLineOffsets() { + if (this._lineOffsets === void 0) { + let lineOffsets = []; + let text2 = this._content; + let isLineStart = true; + for (let i2 = 0; i2 < text2.length; i2++) { + if (isLineStart) { + lineOffsets.push(i2); + isLineStart = false; + } + let ch = text2.charAt(i2); + isLineStart = ch === "\r" || ch === "\n"; + if (ch === "\r" && i2 + 1 < text2.length && text2.charAt(i2 + 1) === "\n") { + i2++; } } + if (isLineStart && text2.length > 0) { + lineOffsets.push(text2.length); + } + this._lineOffsets = lineOffsets; } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + return this._lineOffsets; + } + positionAt(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + let lineOffsets = this.getLineOffsets(); + let low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + let mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; } - return false; } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + let line2 = low - 1; + return Position.create(line2, offset - lineOffsets[line2]); + } + offsetAt(position5) { + let lineOffsets = this.getLineOffsets(); + if (position5.line >= lineOffsets.length) { + return this._content.length; + } else if (position5.line < 0) { + return 0; } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + let lineOffset = lineOffsets[position5.line]; + let nextLineOffset = position5.line + 1 < lineOffsets.length ? lineOffsets[position5.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position5.character, nextLineOffset), lineOffset); + } + get lineCount() { + return this.getLineOffsets().length; + } + }; + (function(Is2) { + const toString6 = Object.prototype.toString; + function defined(value2) { + return typeof value2 !== "undefined"; + } + __name(defined, "defined"); + Is2.defined = defined; + function undefined2(value2) { + return typeof value2 === "undefined"; + } + __name(undefined2, "undefined"); + Is2.undefined = undefined2; + function boolean(value2) { + return value2 === true || value2 === false; + } + __name(boolean, "boolean"); + Is2.boolean = boolean; + function string3(value2) { + return toString6.call(value2) === "[object String]"; + } + __name(string3, "string"); + Is2.string = string3; + function number7(value2) { + return toString6.call(value2) === "[object Number]"; + } + __name(number7, "number"); + Is2.number = number7; + function numberRange(value2, min9, max10) { + return toString6.call(value2) === "[object Number]" && min9 <= value2 && value2 <= max10; + } + __name(numberRange, "numberRange"); + Is2.numberRange = numberRange; + function integer4(value2) { + return toString6.call(value2) === "[object Number]" && -2147483648 <= value2 && value2 <= 2147483647; + } + __name(integer4, "integer"); + Is2.integer = integer4; + function uinteger2(value2) { + return toString6.call(value2) === "[object Number]" && 0 <= value2 && value2 <= 2147483647; + } + __name(uinteger2, "uinteger"); + Is2.uinteger = uinteger2; + function func(value2) { + return toString6.call(value2) === "[object Function]"; + } + __name(func, "func"); + Is2.func = func; + function objectLiteral(value2) { + return value2 !== null && typeof value2 === "object"; + } + __name(objectLiteral, "objectLiteral"); + Is2.objectLiteral = objectLiteral; + function typedArray(value2, check) { + return Array.isArray(value2) && value2.every(check); + } + __name(typedArray, "typedArray"); + Is2.typedArray = typedArray; + })(Is || (Is = {})); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/cst-node-builder.js + var CstNodeBuilder, AbstractCstNode, LeafCstNodeImpl, CompositeCstNodeImpl, CstNodeContainer, RootCstNodeImpl; + var init_cst_node_builder = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/cst-node-builder.js"() { + "use strict"; + init_main(); + init_syntax_tree(); + init_cst_utils(); + CstNodeBuilder = class { + static { + __name(this, "CstNodeBuilder"); + } + constructor() { + this.nodeStack = []; + } + get current() { + return this.nodeStack[this.nodeStack.length - 1]; + } + buildRootNode(input) { + this.rootNode = new RootCstNodeImpl(input); + this.rootNode.root = this.rootNode; + this.nodeStack = [this.rootNode]; + return this.rootNode; + } + buildCompositeNode(feature) { + const compositeNode = new CompositeCstNodeImpl(); + compositeNode.grammarSource = feature; + compositeNode.root = this.rootNode; + this.current.content.push(compositeNode); + this.nodeStack.push(compositeNode); + return compositeNode; + } + buildLeafNode(token2, feature) { + const leafNode = new LeafCstNodeImpl(token2.startOffset, token2.image.length, tokenToRange(token2), token2.tokenType, false); + leafNode.grammarSource = feature; + leafNode.root = this.rootNode; + this.current.content.push(leafNode); + return leafNode; + } + removeNode(node2) { + const parent4 = node2.container; + if (parent4) { + const index = parent4.content.indexOf(node2); + if (index >= 0) { + parent4.content.splice(index, 1); + } + } + } + construct(item) { + const current = this.current; + if (typeof item.$type === "string") { + this.current.astNode = item; + } + item.$cstNode = current; + const node2 = this.nodeStack.pop(); + if ((node2 === null || node2 === void 0 ? void 0 : node2.content.length) === 0) { + this.removeNode(node2); + } + } + addHiddenTokens(hiddenTokens) { + for (const token2 of hiddenTokens) { + const hiddenNode = new LeafCstNodeImpl(token2.startOffset, token2.image.length, tokenToRange(token2), token2.tokenType, true); + hiddenNode.root = this.rootNode; + this.addHiddenToken(this.rootNode, hiddenNode); + } + } + addHiddenToken(node2, token2) { + const { offset: tokenStart, end: tokenEnd } = token2; + for (let i2 = 0; i2 < node2.content.length; i2++) { + const child = node2.content[i2]; + const { offset: childStart, end: childEnd } = child; + if (isCompositeCstNode(child) && tokenStart > childStart && tokenEnd < childEnd) { + this.addHiddenToken(child, token2); + return; + } else if (tokenEnd <= childStart) { + node2.content.splice(i2, 0, token2); + return; + } } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); + node2.content.push(token2); + } + }; + AbstractCstNode = class { + static { + __name(this, "AbstractCstNode"); + } + /** @deprecated use `container` instead. */ + get parent() { + return this.container; + } + /** @deprecated use `grammarSource` instead. */ + get feature() { + return this.grammarSource; + } + get hidden() { + return false; + } + get astNode() { + var _a, _b; + const node2 = typeof ((_a = this._astNode) === null || _a === void 0 ? void 0 : _a.$type) === "string" ? this._astNode : (_b = this.container) === null || _b === void 0 ? void 0 : _b.astNode; + if (!node2) { + throw new Error("This node has no associated AST element"); + } + return node2; + } + set astNode(value2) { + this._astNode = value2; + } + /** @deprecated use `astNode` instead. */ + get element() { + return this.astNode; + } + get text() { + return this.root.fullText.substring(this.offset, this.end); + } + }; + LeafCstNodeImpl = class extends AbstractCstNode { + static { + __name(this, "LeafCstNodeImpl"); + } + get offset() { + return this._offset; + } + get length() { + return this._length; + } + get end() { + return this._offset + this._length; + } + get hidden() { + return this._hidden; + } + get tokenType() { + return this._tokenType; + } + get range() { + return this._range; + } + constructor(offset, length2, range3, tokenType, hidden = false) { + super(); + this._hidden = hidden; + this._offset = offset; + this._tokenType = tokenType; + this._length = length2; + this._range = range3; + } + }; + CompositeCstNodeImpl = class extends AbstractCstNode { + static { + __name(this, "CompositeCstNodeImpl"); + } + constructor() { + super(...arguments); + this.content = new CstNodeContainer(this); + } + /** @deprecated use `content` instead. */ + get children() { + return this.content; + } + get offset() { + var _a, _b; + return (_b = (_a = this.firstNonHiddenNode) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0; + } + get length() { + return this.end - this.offset; + } + get end() { + var _a, _b; + return (_b = (_a = this.lastNonHiddenNode) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : 0; + } + get range() { + const firstNode = this.firstNonHiddenNode; + const lastNode = this.lastNonHiddenNode; + if (firstNode && lastNode) { + if (this._rangeCache === void 0) { + const { range: firstRange } = firstNode; + const { range: lastRange } = lastNode; + this._rangeCache = { start: firstRange.start, end: lastRange.end.line < firstRange.start.line ? firstRange.start : lastRange.end }; + } + return this._rangeCache; } else { - return this.conditionStack[0]; + return { start: Position.create(0, 0), end: Position.create(0, 0) }; } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } + get firstNonHiddenNode() { + for (const child of this.content) { + if (!child.hidden) { + return child; + } + } + return this.content[0]; + } + get lastNonHiddenNode() { + for (let i2 = this.content.length - 1; i2 >= 0; i2--) { + const child = this.content[i2]; + if (!child.hidden) { + return child; + } + } + return this.content[this.content.length - 1]; + } + }; + CstNodeContainer = class _CstNodeContainer extends Array { + static { + __name(this, "CstNodeContainer"); + } + constructor(parent4) { + super(); + this.parent = parent4; + Object.setPrototypeOf(this, _CstNodeContainer.prototype); + } + push(...items) { + this.addParents(items); + return super.push(...items); + } + unshift(...items) { + this.addParents(items); + return super.unshift(...items); + } + splice(start3, count, ...items) { + this.addParents(items); + return super.splice(start3, count, ...items); + } + addParents(items) { + for (const item of items) { + item.container = this.parent; + } + } + }; + RootCstNodeImpl = class extends CompositeCstNodeImpl { + static { + __name(this, "RootCstNodeImpl"); + } + get text() { + return this._text.substring(this.offset, this.end); + } + get fullText() { + return this._text; + } + constructor(input) { + super(); + this._text = ""; + this._text = input !== null && input !== void 0 ? input : ""; + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser.js + function isDataTypeNode(node2) { + return node2.$type === DatatypeSymbol; + } + var DatatypeSymbol, ruleSuffix, withRuleSuffix, AbstractLangiumParser, LangiumParser, AbstractParserErrorMessageProvider, LangiumParserErrorMessageProvider, LangiumCompletionParser, defaultConfig3, ChevrotainWrapper; + var init_langium_parser = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser.js"() { + "use strict"; + init_api5(); + init_lib(); + init_ast(); + init_grammar_utils(); + init_ast_utils(); + init_cst_node_builder(); + DatatypeSymbol = Symbol("Datatype"); + __name(isDataTypeNode, "isDataTypeNode"); + ruleSuffix = "\u200B"; + withRuleSuffix = /* @__PURE__ */ __name((name) => name.endsWith(ruleSuffix) ? name : name + ruleSuffix, "withRuleSuffix"); + AbstractLangiumParser = class { + static { + __name(this, "AbstractLangiumParser"); + } + constructor(services) { + this._unorderedGroups = /* @__PURE__ */ new Map(); + this.lexer = services.parser.Lexer; + const tokens2 = this.lexer.definition; + this.wrapper = new ChevrotainWrapper(tokens2, Object.assign(Object.assign({}, services.parser.ParserConfig), { errorMessageProvider: services.parser.ParserErrorMessageProvider })); + } + alternatives(idx, choices) { + this.wrapper.wrapOr(idx, choices); + } + optional(idx, callback) { + this.wrapper.wrapOption(idx, callback); + } + many(idx, callback) { + this.wrapper.wrapMany(idx, callback); + } + atLeastOne(idx, callback) { + this.wrapper.wrapAtLeastOne(idx, callback); + } + isRecording() { + return this.wrapper.IS_RECORDING; + } + get unorderedGroups() { + return this._unorderedGroups; + } + getRuleStack() { + return this.wrapper.RULE_STACK; + } + finalize() { + this.wrapper.wrapSelfAnalysis(); + } + }; + LangiumParser = class extends AbstractLangiumParser { + static { + __name(this, "LangiumParser"); + } + get current() { + return this.stack[this.stack.length - 1]; + } + constructor(services) { + super(services); + this.nodeBuilder = new CstNodeBuilder(); + this.stack = []; + this.assignmentMap = /* @__PURE__ */ new Map(); + this.linker = services.references.Linker; + this.converter = services.parser.ValueConverter; + this.astReflection = services.shared.AstReflection; + } + rule(rule, impl2) { + const type3 = rule.fragment ? void 0 : isDataTypeRule(rule) ? DatatypeSymbol : getTypeName(rule); + const ruleMethod = this.wrapper.DEFINE_RULE(withRuleSuffix(rule.name), this.startImplementation(type3, impl2).bind(this)); + if (rule.entry) { + this.mainRule = ruleMethod; + } + return ruleMethod; + } + parse(input) { + this.nodeBuilder.buildRootNode(input); + const lexerResult = this.lexer.tokenize(input); + this.wrapper.input = lexerResult.tokens; + const result = this.mainRule.call(this.wrapper, {}); + this.nodeBuilder.addHiddenTokens(lexerResult.hidden); + this.unorderedGroups.clear(); + return { + value: result, + lexerErrors: lexerResult.errors, + parserErrors: this.wrapper.errors + }; + } + startImplementation($type, implementation) { + return (args) => { + if (!this.isRecording()) { + const node2 = { $type }; + this.stack.push(node2); + if ($type === DatatypeSymbol) { + node2.value = ""; + } + } + let result; + try { + result = implementation(args); + } catch (err) { + result = void 0; + } + if (!this.isRecording() && result === void 0) { + result = this.construct(); + } + return result; + }; + } + consume(idx, tokenType, feature) { + const token2 = this.wrapper.wrapConsume(idx, tokenType); + if (!this.isRecording() && this.isValidToken(token2)) { + const leafNode = this.nodeBuilder.buildLeafNode(token2, feature); + const { assignment, isCrossRef } = this.getAssignment(feature); + const current = this.current; + if (assignment) { + const convertedValue = isKeyword(feature) ? token2.image : this.converter.convert(token2.image, leafNode); + this.assign(assignment.operator, assignment.feature, convertedValue, leafNode, isCrossRef); + } else if (isDataTypeNode(current)) { + let text2 = token2.image; + if (!isKeyword(feature)) { + text2 = this.converter.convert(text2, leafNode).toString(); + } + current.value += text2; + } + } + } + /** + * Most consumed parser tokens are valid. However there are two cases in which they are not valid: + * + * 1. They were inserted during error recovery by the parser. These tokens don't really exist and should not be further processed + * 2. They contain invalid token ranges. This might include the special EOF token, or other tokens produced by invalid token builders. + */ + isValidToken(token2) { + return !token2.isInsertedInRecovery && !isNaN(token2.startOffset) && typeof token2.endOffset === "number" && !isNaN(token2.endOffset); + } + subrule(idx, rule, feature, args) { + let cstNode; + if (!this.isRecording()) { + cstNode = this.nodeBuilder.buildCompositeNode(feature); + } + const subruleResult = this.wrapper.wrapSubrule(idx, rule, args); + if (!this.isRecording() && cstNode && cstNode.length > 0) { + this.performSubruleAssignment(subruleResult, feature, cstNode); + } + } + performSubruleAssignment(result, feature, cstNode) { + const { assignment, isCrossRef } = this.getAssignment(feature); + if (assignment) { + this.assign(assignment.operator, assignment.feature, result, cstNode, isCrossRef); + } else if (!assignment) { + const current = this.current; + if (isDataTypeNode(current)) { + current.value += result.toString(); + } else if (typeof result === "object" && result) { + const resultKind = result.$type; + const object3 = this.assignWithoutOverride(result, current); + if (resultKind) { + object3.$type = resultKind; + } + const newItem = object3; + this.stack.pop(); + this.stack.push(newItem); + } + } + } + action($type, action) { + if (!this.isRecording()) { + let last3 = this.current; + if (!last3.$cstNode && action.feature && action.operator) { + last3 = this.construct(false); + const feature = last3.$cstNode.feature; + this.nodeBuilder.buildCompositeNode(feature); + } + const newItem = { $type }; + this.stack.pop(); + this.stack.push(newItem); + if (action.feature && action.operator) { + this.assign(action.operator, action.feature, last3, last3.$cstNode, false); + } + } + } + construct(pop = true) { + if (this.isRecording()) { + return void 0; + } + const obj = this.current; + linkContentToContainer(obj); + this.nodeBuilder.construct(obj); + if (pop) { + this.stack.pop(); + } + if (isDataTypeNode(obj)) { + return this.converter.convert(obj.value, obj.$cstNode); } else { - return this.conditions["INITIAL"].rules; + assignMandatoryProperties(this.astReflection, obj); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; + return obj; + } + getAssignment(feature) { + if (!this.assignmentMap.has(feature)) { + const assignment = getContainerOfType(feature, isAssignment); + this.assignmentMap.set(feature, { + assignment, + isCrossRef: assignment ? isCrossReference(assignment.terminal) : false + }); + } + return this.assignmentMap.get(feature); + } + assign(operator, feature, value2, cstNode, isCrossRef) { + const obj = this.current; + let item; + if (isCrossRef && typeof value2 === "string") { + item = this.linker.buildReference(obj, feature, cstNode, value2); } else { - return "INITIAL"; + item = value2; } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - return "title"; - case 1: - this.begin("acc_title"); - return 9; - case 2: - this.popState(); - return "acc_title_value"; - case 3: - this.begin("acc_descr"); - return 11; - case 4: - this.popState(); - return "acc_descr_value"; - case 5: - this.begin("acc_descr_multiline"); - break; - case 6: - this.popState(); - break; - case 7: - return "acc_descr_multiline_value"; - case 8: - return 5; - case 9: - break; - case 10: - break; - case 11: - break; - case 12: - return 8; - case 13: - return 6; - case 14: - return 19; - case 15: - return 30; - case 16: - return 22; - case 17: - return 21; - case 18: - return 24; - case 19: - return 26; - case 20: - return 28; - case 21: - return 31; - case 22: - return 32; - case 23: - return 33; - case 24: - return 34; - case 25: - return 35; - case 26: - return 36; - case 27: - return 37; - case 28: - return 38; - case 29: - return 39; - case 30: - return 40; - case 31: - return 41; - case 32: - return 42; - case 33: - return 43; - case 34: - return 44; - case 35: - return 55; - case 36: - return 56; - case 37: - return 57; - case 38: - return 58; - case 39: - return 59; - case 40: - return 60; - case 41: - return 61; - case 42: - return 47; - case 43: - return 49; - case 44: - return 51; - case 45: - return 54; - case 46: - return 53; - case 47: - this.begin("string"); + switch (operator) { + case "=": { + obj[feature] = item; break; - case 48: - this.popState(); + } + case "?=": { + obj[feature] = true; break; - case 49: - return "qString"; - case 50: - yy_.yytext = yy_.yytext.trim(); - return 62; + } + case "+=": { + if (!Array.isArray(obj[feature])) { + obj[feature] = []; + } + obj[feature].push(item); + } } - }, - rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^\r\n\{\<\>\-\=]*)/i], - conditions: { "acc_descr_multiline": { "rules": [6, 7], "inclusive": false }, "acc_descr": { "rules": [4], "inclusive": false }, "acc_title": { "rules": [2], "inclusive": false }, "unqString": { "rules": [], "inclusive": false }, "token": { "rules": [], "inclusive": false }, "string": { "rules": [48, 49], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50], "inclusive": true } } + } + assignWithoutOverride(target, source) { + for (const [name, existingValue] of Object.entries(source)) { + const newValue = target[name]; + if (newValue === void 0) { + target[name] = existingValue; + } else if (Array.isArray(newValue) && Array.isArray(existingValue)) { + existingValue.push(...newValue); + target[name] = existingValue; + } + } + return target; + } + get definitionErrors() { + return this.wrapper.definitionErrors; + } }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$g.parser = parser$g; - const parser$h = parser$g; - let relations$1 = []; - let latestRequirement = {}; - let requirements = {}; - let latestElement = {}; - let elements$1 = {}; - const RequirementType = { - REQUIREMENT: "Requirement", - FUNCTIONAL_REQUIREMENT: "Functional Requirement", - INTERFACE_REQUIREMENT: "Interface Requirement", - PERFORMANCE_REQUIREMENT: "Performance Requirement", - PHYSICAL_REQUIREMENT: "Physical Requirement", - DESIGN_CONSTRAINT: "Design Constraint" - }; - const RiskLevel = { - LOW_RISK: "Low", - MED_RISK: "Medium", - HIGH_RISK: "High" - }; - const VerifyType = { - VERIFY_ANALYSIS: "Analysis", - VERIFY_DEMONSTRATION: "Demonstration", - VERIFY_INSPECTION: "Inspection", - VERIFY_TEST: "Test" - }; - const Relationships = { - CONTAINS: "contains", - COPIES: "copies", - DERIVES: "derives", - SATISFIES: "satisfies", - VERIFIES: "verifies", - REFINES: "refines", - TRACES: "traces" - }; - const addRequirement = (name, type2) => { - if (requirements[name] === void 0) { - requirements[name] = { - name, - type: type2, - id: latestRequirement.id, - text: latestRequirement.text, - risk: latestRequirement.risk, - verifyMethod: latestRequirement.verifyMethod - }; - } - latestRequirement = {}; - return requirements[name]; - }; - const getRequirements = () => requirements; - const setNewReqId = (id2) => { - if (latestRequirement !== void 0) { - latestRequirement.id = id2; - } - }; - const setNewReqText = (text2) => { - if (latestRequirement !== void 0) { - latestRequirement.text = text2; - } - }; - const setNewReqRisk = (risk) => { - if (latestRequirement !== void 0) { - latestRequirement.risk = risk; - } - }; - const setNewReqVerifyMethod = (verifyMethod) => { - if (latestRequirement !== void 0) { - latestRequirement.verifyMethod = verifyMethod; - } - }; - const addElement = (name) => { - if (elements$1[name] === void 0) { - elements$1[name] = { - name, - type: latestElement.type, - docRef: latestElement.docRef + AbstractParserErrorMessageProvider = class { + static { + __name(this, "AbstractParserErrorMessageProvider"); + } + buildMismatchTokenMessage(options3) { + return defaultParserErrorProvider.buildMismatchTokenMessage(options3); + } + buildNotAllInputParsedMessage(options3) { + return defaultParserErrorProvider.buildNotAllInputParsedMessage(options3); + } + buildNoViableAltMessage(options3) { + return defaultParserErrorProvider.buildNoViableAltMessage(options3); + } + buildEarlyExitMessage(options3) { + return defaultParserErrorProvider.buildEarlyExitMessage(options3); + } + }; + LangiumParserErrorMessageProvider = class extends AbstractParserErrorMessageProvider { + static { + __name(this, "LangiumParserErrorMessageProvider"); + } + buildMismatchTokenMessage({ expected, actual }) { + const expectedMsg = expected.LABEL ? "`" + expected.LABEL + "`" : expected.name.endsWith(":KW") ? `keyword '${expected.name.substring(0, expected.name.length - 3)}'` : `token of type '${expected.name}'`; + return `Expecting ${expectedMsg} but found \`${actual.image}\`.`; + } + buildNotAllInputParsedMessage({ firstRedundant }) { + return `Expecting end of file but found \`${firstRedundant.image}\`.`; + } + }; + LangiumCompletionParser = class extends AbstractLangiumParser { + static { + __name(this, "LangiumCompletionParser"); + } + constructor() { + super(...arguments); + this.tokens = []; + this.elementStack = []; + this.lastElementStack = []; + this.nextTokenIndex = 0; + this.stackSize = 0; + } + action() { + } + construct() { + return void 0; + } + parse(input) { + this.resetState(); + const tokens2 = this.lexer.tokenize(input); + this.tokens = tokens2.tokens; + this.wrapper.input = [...this.tokens]; + this.mainRule.call(this.wrapper, {}); + this.unorderedGroups.clear(); + return { + tokens: this.tokens, + elementStack: [...this.lastElementStack], + tokenIndex: this.nextTokenIndex + }; + } + rule(rule, impl2) { + const ruleMethod = this.wrapper.DEFINE_RULE(withRuleSuffix(rule.name), this.startImplementation(impl2).bind(this)); + if (rule.entry) { + this.mainRule = ruleMethod; + } + return ruleMethod; + } + resetState() { + this.elementStack = []; + this.lastElementStack = []; + this.nextTokenIndex = 0; + this.stackSize = 0; + } + startImplementation(implementation) { + return (args) => { + const size5 = this.keepStackSize(); + try { + implementation(args); + } finally { + this.resetStackSize(size5); + } + }; + } + removeUnexpectedElements() { + this.elementStack.splice(this.stackSize); + } + keepStackSize() { + const size5 = this.elementStack.length; + this.stackSize = size5; + return size5; + } + resetStackSize(size5) { + this.removeUnexpectedElements(); + this.stackSize = size5; + } + consume(idx, tokenType, feature) { + this.wrapper.wrapConsume(idx, tokenType); + if (!this.isRecording()) { + this.lastElementStack = [...this.elementStack, feature]; + this.nextTokenIndex = this.currIdx + 1; + } + } + subrule(idx, rule, feature, args) { + this.before(feature); + this.wrapper.wrapSubrule(idx, rule, args); + this.after(feature); + } + before(element3) { + if (!this.isRecording()) { + this.elementStack.push(element3); + } + } + after(element3) { + if (!this.isRecording()) { + const index = this.elementStack.lastIndexOf(element3); + if (index >= 0) { + this.elementStack.splice(index); + } + } + } + get currIdx() { + return this.wrapper.currIdx; + } + }; + defaultConfig3 = { + recoveryEnabled: true, + nodeLocationTracking: "full", + skipValidations: true, + errorMessageProvider: new LangiumParserErrorMessageProvider() + }; + ChevrotainWrapper = class extends EmbeddedActionsParser { + static { + __name(this, "ChevrotainWrapper"); + } + constructor(tokens2, config6) { + const useDefaultLookahead = config6 && "maxLookahead" in config6; + super(tokens2, Object.assign(Object.assign(Object.assign({}, defaultConfig3), { lookaheadStrategy: useDefaultLookahead ? new LLkLookaheadStrategy({ maxLookahead: config6.maxLookahead }) : new LLStarLookaheadStrategy() }), config6)); + } + get IS_RECORDING() { + return this.RECORDING_PHASE; + } + DEFINE_RULE(name, impl2) { + return this.RULE(name, impl2); + } + wrapSelfAnalysis() { + this.performSelfAnalysis(); + } + wrapConsume(idx, tokenType) { + return this.consume(idx, tokenType); + } + wrapSubrule(idx, rule, args) { + return this.subrule(idx, rule, { + ARGS: [args] + }); + } + wrapOr(idx, choices) { + this.or(idx, choices); + } + wrapOption(idx, callback) { + this.option(idx, callback); + } + wrapMany(idx, callback) { + this.many(idx, callback); + } + wrapAtLeastOne(idx, callback) { + this.atLeastOne(idx, callback); + } }; - log$1.info("Added new requirement: ", name); - } - latestElement = {}; - return elements$1[name]; - }; - const getElements = () => elements$1; - const setNewElementType = (type2) => { - if (latestElement !== void 0) { - latestElement.type = type2; } - }; - const setNewElementDocRef = (docRef) => { - if (latestElement !== void 0) { - latestElement.docRef = docRef; - } - }; - const addRelationship = (type2, src, dst) => { - relations$1.push({ - type: type2, - src, - dst - }); - }; - const getRelationships = () => relations$1; - const clear$8 = () => { - relations$1 = []; - latestRequirement = {}; - requirements = {}; - latestElement = {}; - elements$1 = {}; - clear$n(); - }; - const db$a = { - RequirementType, - RiskLevel, - VerifyType, - Relationships, - getConfig: () => getConfig$1().req, - addRequirement, - getRequirements, - setNewReqId, - setNewReqText, - setNewReqRisk, - setNewReqVerifyMethod, - setAccTitle, - getAccTitle, - setAccDescription, - getAccDescription, - addElement, - getElements, - setNewElementType, - setNewElementDocRef, - addRelationship, - getRelationships, - clear: clear$8 - }; - const getStyles$8 = (options2) => ` - - marker { - fill: ${options2.relationColor}; - stroke: ${options2.relationColor}; - } + }); - marker.cross { - stroke: ${options2.lineColor}; + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-builder-base.js + function createParser(grammar, parser21, tokens2) { + const rules = /* @__PURE__ */ new Map(); + const parserContext = { + parser: parser21, + tokens: tokens2, + rules, + ruleNames: /* @__PURE__ */ new Map() + }; + buildRules(parserContext, grammar); + return parser21; + } + function buildRules(parserContext, grammar) { + const reachable = getAllReachableRules(grammar, false); + const parserRules = stream(grammar.rules).filter(isParserRule).filter((rule) => reachable.has(rule)); + for (const rule of parserRules) { + const ctx = Object.assign(Object.assign({}, parserContext), { consume: 1, optional: 1, subrule: 1, many: 1, or: 1 }); + ctx.rules.set(rule.name, parserContext.parser.rule(rule, buildElement(ctx, rule.definition))); + } + } + function buildElement(ctx, element3, ignoreGuard = false) { + let method; + if (isKeyword(element3)) { + method = buildKeyword(ctx, element3); + } else if (isAction(element3)) { + method = buildAction(ctx, element3); + } else if (isAssignment(element3)) { + method = buildElement(ctx, element3.terminal); + } else if (isCrossReference(element3)) { + method = buildCrossReference(ctx, element3); + } else if (isRuleCall(element3)) { + method = buildRuleCall(ctx, element3); + } else if (isAlternatives(element3)) { + method = buildAlternatives(ctx, element3); + } else if (isUnorderedGroup(element3)) { + method = buildUnorderedGroup(ctx, element3); + } else if (isGroup(element3)) { + method = buildGroup4(ctx, element3); + } else if (isEndOfFile(element3)) { + const idx = ctx.consume++; + method = /* @__PURE__ */ __name(() => ctx.parser.consume(idx, EOF, element3), "method"); + } else { + throw new ErrorWithLocation(element3.$cstNode, `Unexpected element type: ${element3.$type}`); + } + return wrap(ctx, ignoreGuard ? void 0 : getGuardCondition(element3), method, element3.cardinality); + } + function buildAction(ctx, action) { + const actionType = getTypeName(action); + return () => ctx.parser.action(actionType, action); + } + function buildRuleCall(ctx, ruleCall) { + const rule = ruleCall.rule.ref; + if (isParserRule(rule)) { + const idx = ctx.subrule++; + const predicate = ruleCall.arguments.length > 0 ? buildRuleCallPredicate(rule, ruleCall.arguments) : () => ({}); + return (args) => ctx.parser.subrule(idx, getRule(ctx, rule), ruleCall, predicate(args)); + } else if (isTerminalRule(rule)) { + const idx = ctx.consume++; + const method = getToken(ctx, rule.name); + return () => ctx.parser.consume(idx, method, ruleCall); + } else if (!rule) { + throw new ErrorWithLocation(ruleCall.$cstNode, `Undefined rule type: ${ruleCall.$type}`); + } else { + assertUnreachable(rule); + } } - - svg { - font-family: ${options2.fontFamily}; - font-size: ${options2.fontSize}; + function buildRuleCallPredicate(rule, namedArgs) { + const predicates = namedArgs.map((e3) => buildPredicate(e3.value)); + return (args) => { + const ruleArgs = {}; + for (let i2 = 0; i2 < predicates.length; i2++) { + const ruleTarget = rule.parameters[i2]; + const predicate = predicates[i2]; + ruleArgs[ruleTarget.name] = predicate(args); + } + return ruleArgs; + }; } - - .reqBox { - fill: ${options2.requirementBackground}; - fill-opacity: 1.0; - stroke: ${options2.requirementBorderColor}; - stroke-width: ${options2.requirementBorderSize}; + function buildPredicate(condition) { + if (isDisjunction(condition)) { + const left3 = buildPredicate(condition.left); + const right3 = buildPredicate(condition.right); + return (args) => left3(args) || right3(args); + } else if (isConjunction(condition)) { + const left3 = buildPredicate(condition.left); + const right3 = buildPredicate(condition.right); + return (args) => left3(args) && right3(args); + } else if (isNegation(condition)) { + const value2 = buildPredicate(condition.value); + return (args) => !value2(args); + } else if (isParameterReference(condition)) { + const name = condition.parameter.ref.name; + return (args) => args !== void 0 && args[name] === true; + } else if (isBooleanLiteral(condition)) { + const value2 = Boolean(condition.true); + return () => value2; + } + assertUnreachable(condition); + } + function buildAlternatives(ctx, alternatives) { + if (alternatives.elements.length === 1) { + return buildElement(ctx, alternatives.elements[0]); + } else { + const methods = []; + for (const element3 of alternatives.elements) { + const predicatedMethod = { + // Since we handle the guard condition in the alternative already + // We can ignore the group guard condition inside + ALT: buildElement(ctx, element3, true) + }; + const guard = getGuardCondition(element3); + if (guard) { + predicatedMethod.GATE = buildPredicate(guard); + } + methods.push(predicatedMethod); + } + const idx = ctx.or++; + return (args) => ctx.parser.alternatives(idx, methods.map((method) => { + const alt = { + ALT: /* @__PURE__ */ __name(() => method.ALT(args), "ALT") + }; + const gate = method.GATE; + if (gate) { + alt.GATE = () => gate(args); + } + return alt; + })); + } } - - .reqTitle, .reqLabel{ - fill: ${options2.requirementTextColor}; + function buildUnorderedGroup(ctx, group2) { + if (group2.elements.length === 1) { + return buildElement(ctx, group2.elements[0]); + } + const methods = []; + for (const element3 of group2.elements) { + const predicatedMethod = { + // Since we handle the guard condition in the alternative already + // We can ignore the group guard condition inside + ALT: buildElement(ctx, element3, true) + }; + const guard = getGuardCondition(element3); + if (guard) { + predicatedMethod.GATE = buildPredicate(guard); + } + methods.push(predicatedMethod); + } + const orIdx = ctx.or++; + const idFunc = /* @__PURE__ */ __name((groupIdx, lParser) => { + const stackId = lParser.getRuleStack().join("-"); + return `uGroup_${groupIdx}_${stackId}`; + }, "idFunc"); + const alternatives = /* @__PURE__ */ __name((args) => ctx.parser.alternatives(orIdx, methods.map((method, idx) => { + const alt = { ALT: /* @__PURE__ */ __name(() => true, "ALT") }; + const parser21 = ctx.parser; + alt.ALT = () => { + method.ALT(args); + if (!parser21.isRecording()) { + const key = idFunc(orIdx, parser21); + if (!parser21.unorderedGroups.get(key)) { + parser21.unorderedGroups.set(key, []); + } + const groupState = parser21.unorderedGroups.get(key); + if (typeof (groupState === null || groupState === void 0 ? void 0 : groupState[idx]) === "undefined") { + groupState[idx] = true; + } + } + }; + const gate = method.GATE; + if (gate) { + alt.GATE = () => gate(args); + } else { + alt.GATE = () => { + const trackedAlternatives = parser21.unorderedGroups.get(idFunc(orIdx, parser21)); + const allow = !(trackedAlternatives === null || trackedAlternatives === void 0 ? void 0 : trackedAlternatives[idx]); + return allow; + }; + } + return alt; + })), "alternatives"); + const wrapped = wrap(ctx, getGuardCondition(group2), alternatives, "*"); + return (args) => { + wrapped(args); + if (!ctx.parser.isRecording()) { + ctx.parser.unorderedGroups.delete(idFunc(orIdx, ctx.parser)); + } + }; } - .reqLabelBox { - fill: ${options2.relationLabelBackground}; - fill-opacity: 1.0; + function buildGroup4(ctx, group2) { + const methods = group2.elements.map((e3) => buildElement(ctx, e3)); + return (args) => methods.forEach((method) => method(args)); } - - .req-title-line { - stroke: ${options2.requirementBorderColor}; - stroke-width: ${options2.requirementBorderSize}; + function getGuardCondition(element3) { + if (isGroup(element3)) { + return element3.guardCondition; + } + return void 0; } - .relationshipLine { - stroke: ${options2.relationColor}; - stroke-width: 1; + function buildCrossReference(ctx, crossRef, terminal = crossRef.terminal) { + if (!terminal) { + if (!crossRef.type.ref) { + throw new Error("Could not resolve reference to type: " + crossRef.type.$refText); + } + const assignment = findNameAssignment(crossRef.type.ref); + const assignTerminal = assignment === null || assignment === void 0 ? void 0 : assignment.terminal; + if (!assignTerminal) { + throw new Error("Could not find name assignment for type: " + getTypeName(crossRef.type.ref)); + } + return buildCrossReference(ctx, crossRef, assignTerminal); + } else if (isRuleCall(terminal) && isParserRule(terminal.rule.ref)) { + const idx = ctx.subrule++; + return (args) => ctx.parser.subrule(idx, getRule(ctx, terminal.rule.ref), crossRef, args); + } else if (isRuleCall(terminal) && isTerminalRule(terminal.rule.ref)) { + const idx = ctx.consume++; + const terminalRule = getToken(ctx, terminal.rule.ref.name); + return () => ctx.parser.consume(idx, terminalRule, crossRef); + } else if (isKeyword(terminal)) { + const idx = ctx.consume++; + const keyword = getToken(ctx, terminal.value); + return () => ctx.parser.consume(idx, keyword, crossRef); + } else { + throw new Error("Could not build cross reference parser"); + } } - .relationshipLabel { - fill: ${options2.relationLabelColor}; + function buildKeyword(ctx, keyword) { + const idx = ctx.consume++; + const token2 = ctx.tokens[keyword.value]; + if (!token2) { + throw new Error("Could not find token for keyword: " + keyword.value); + } + return () => ctx.parser.consume(idx, token2, keyword); } - -`; - const styles$7 = getStyles$8; - const ReqMarkers = { - CONTAINS: "contains", - ARROW: "arrow" - }; - const insertLineEndings = (parentNode, conf2) => { - let containsNode = parentNode.append("defs").append("marker").attr("id", ReqMarkers.CONTAINS + "_line_ending").attr("refX", 0).attr("refY", conf2.line_height / 2).attr("markerWidth", conf2.line_height).attr("markerHeight", conf2.line_height).attr("orient", "auto").append("g"); - containsNode.append("circle").attr("cx", conf2.line_height / 2).attr("cy", conf2.line_height / 2).attr("r", conf2.line_height / 2).attr("fill", "none"); - containsNode.append("line").attr("x1", 0).attr("x2", conf2.line_height).attr("y1", conf2.line_height / 2).attr("y2", conf2.line_height / 2).attr("stroke-width", 1); - containsNode.append("line").attr("y1", 0).attr("y2", conf2.line_height).attr("x1", conf2.line_height / 2).attr("x2", conf2.line_height / 2).attr("stroke-width", 1); - parentNode.append("defs").append("marker").attr("id", ReqMarkers.ARROW + "_line_ending").attr("refX", conf2.line_height).attr("refY", 0.5 * conf2.line_height).attr("markerWidth", conf2.line_height).attr("markerHeight", conf2.line_height).attr("orient", "auto").append("path").attr( - "d", - `M0,0 - L${conf2.line_height},${conf2.line_height / 2} - M${conf2.line_height},${conf2.line_height / 2} - L0,${conf2.line_height}` - ).attr("stroke-width", 1); - }; - const markers = { - ReqMarkers, - insertLineEndings - }; - let conf$5 = {}; - let relCnt = 0; - const newRectNode = (parentNode, id2) => { - return parentNode.insert("rect", "#" + id2).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", conf$5.rect_min_width + "px").attr("height", conf$5.rect_min_height + "px"); - }; - const newTitleNode = (parentNode, id2, txts) => { - let x2 = conf$5.rect_min_width / 2; - let title2 = parentNode.append("text").attr("class", "req reqLabel reqTitle").attr("id", id2).attr("x", x2).attr("y", conf$5.rect_padding).attr("dominant-baseline", "hanging"); - let i2 = 0; - txts.forEach((textStr) => { - if (i2 == 0) { - title2.append("tspan").attr("text-anchor", "middle").attr("x", conf$5.rect_min_width / 2).attr("dy", 0).text(textStr); + function wrap(ctx, guard, method, cardinality) { + const gate = guard && buildPredicate(guard); + if (!cardinality) { + if (gate) { + const idx = ctx.or++; + return (args) => ctx.parser.alternatives(idx, [ + { + ALT: /* @__PURE__ */ __name(() => method(args), "ALT"), + GATE: /* @__PURE__ */ __name(() => gate(args), "GATE") + }, + { + ALT: EMPTY_ALT(), + GATE: /* @__PURE__ */ __name(() => !gate(args), "GATE") + } + ]); } else { - title2.append("tspan").attr("text-anchor", "middle").attr("x", conf$5.rect_min_width / 2).attr("dy", conf$5.line_height * 0.75).text(textStr); + return method; } - i2++; - }); - let yPadding = 1.5 * conf$5.rect_padding; - let linePadding = i2 * conf$5.line_height * 0.75; - let totalY = yPadding + linePadding; - parentNode.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", conf$5.rect_min_width).attr("y1", totalY).attr("y2", totalY); - return { - titleNode: title2, - y: totalY - }; - }; - const newBodyNode = (parentNode, id2, txts, yStart) => { - let body = parentNode.append("text").attr("class", "req reqLabel").attr("id", id2).attr("x", conf$5.rect_padding).attr("y", yStart).attr("dominant-baseline", "hanging"); - let currentRow = 0; - const charLimit = 30; - let wrappedTxts = []; - txts.forEach((textStr) => { - let currentTextLen = textStr.length; - while (currentTextLen > charLimit && currentRow < 3) { - let firstPart = textStr.substring(0, charLimit); - textStr = textStr.substring(charLimit, textStr.length); - currentTextLen = textStr.length; - wrappedTxts[wrappedTxts.length] = firstPart; - currentRow++; - } - if (currentRow == 3) { - let lastStr = wrappedTxts[wrappedTxts.length - 1]; - wrappedTxts[wrappedTxts.length - 1] = lastStr.substring(0, lastStr.length - 4) + "..."; + } + if (cardinality === "*") { + const idx = ctx.many++; + return (args) => ctx.parser.many(idx, { + DEF: /* @__PURE__ */ __name(() => method(args), "DEF"), + GATE: gate ? () => gate(args) : void 0 + }); + } else if (cardinality === "+") { + const idx = ctx.many++; + if (gate) { + const orIdx = ctx.or++; + return (args) => ctx.parser.alternatives(orIdx, [ + { + ALT: /* @__PURE__ */ __name(() => ctx.parser.atLeastOne(idx, { + DEF: /* @__PURE__ */ __name(() => method(args), "DEF") + }), "ALT"), + GATE: /* @__PURE__ */ __name(() => gate(args), "GATE") + }, + { + ALT: EMPTY_ALT(), + GATE: /* @__PURE__ */ __name(() => !gate(args), "GATE") + } + ]); } else { - wrappedTxts[wrappedTxts.length] = textStr; + return (args) => ctx.parser.atLeastOne(idx, { + DEF: /* @__PURE__ */ __name(() => method(args), "DEF") + }); } - currentRow = 0; - }); - wrappedTxts.forEach((textStr) => { - body.append("tspan").attr("x", conf$5.rect_padding).attr("dy", conf$5.line_height).text(textStr); - }); - return body; - }; - const addEdgeLabel = (parentNode, svgPath, conf2, txt) => { - const len = svgPath.node().getTotalLength(); - const labelPoint = svgPath.node().getPointAtLength(len * 0.5); - const labelId = "rel" + relCnt; - relCnt++; - const labelNode = parentNode.append("text").attr("class", "req relationshipLabel").attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(txt); - const labelBBox = labelNode.node().getBBox(); - parentNode.insert("rect", "#" + labelId).attr("class", "req reqLabelBox").attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height).attr("fill", "white").attr("fill-opacity", "85%"); - }; - const drawRelationshipFromLayout = function(svg2, rel2, g, insert, diagObj) { - const edge = g.edge(elementString(rel2.src), elementString(rel2.dst)); - const lineFunction = line$1().x(function(d) { - return d.x; - }).y(function(d) { - return d.y; - }); - const svgPath = svg2.insert("path", "#" + insert).attr("class", "er relationshipLine").attr("d", lineFunction(edge.points)).attr("fill", "none"); - if (rel2.type == diagObj.db.Relationships.CONTAINS) { - svgPath.attr( - "marker-start", - "url(" + common$1.getUrl(conf$5.arrowMarkerAbsolute) + "#" + rel2.type + "_line_ending)" - ); + } else if (cardinality === "?") { + const idx = ctx.optional++; + return (args) => ctx.parser.optional(idx, { + DEF: /* @__PURE__ */ __name(() => method(args), "DEF"), + GATE: gate ? () => gate(args) : void 0 + }); } else { - svgPath.attr("stroke-dasharray", "10,7"); - svgPath.attr( - "marker-end", - "url(" + common$1.getUrl(conf$5.arrowMarkerAbsolute) + "#" + markers.ReqMarkers.ARROW + "_line_ending)" - ); + assertUnreachable(cardinality); } - addEdgeLabel(svg2, svgPath, conf$5, `<<${rel2.type}>>`); - return; - }; - const drawReqs = (reqs, graph, svgNode2) => { - Object.keys(reqs).forEach((reqName) => { - let req = reqs[reqName]; - reqName = elementString(reqName); - log$1.info("Added new requirement: ", reqName); - const groupNode = svgNode2.append("g").attr("id", reqName); - const textId = "req-" + reqName; - const rectNode = newRectNode(groupNode, textId); - let titleNodeInfo = newTitleNode(groupNode, reqName + "_title", [ - `<<${req.type}>>`, - `${req.name}` - ]); - newBodyNode( - groupNode, - reqName + "_body", - [ - `Id: ${req.id}`, - `Text: ${req.text}`, - `Risk: ${req.risk}`, - `Verification: ${req.verifyMethod}` - ], - titleNodeInfo.y - ); - const rectBBox = rectNode.node().getBBox(); - graph.setNode(reqName, { - width: rectBBox.width, - height: rectBBox.height, - shape: "rect", - id: reqName - }); - }); - }; - const drawElements = (els, graph, svgNode2) => { - Object.keys(els).forEach((elName) => { - let el = els[elName]; - const id2 = elementString(elName); - const groupNode = svgNode2.append("g").attr("id", id2); - const textId = "element-" + id2; - const rectNode = newRectNode(groupNode, textId); - let titleNodeInfo = newTitleNode(groupNode, textId + "_title", [`<>`, `${elName}`]); - newBodyNode( - groupNode, - textId + "_body", - [`Type: ${el.type || "Not Specified"}`, `Doc Ref: ${el.docRef || "None"}`], - titleNodeInfo.y - ); - const rectBBox = rectNode.node().getBBox(); - graph.setNode(id2, { - width: rectBBox.width, - height: rectBBox.height, - shape: "rect", - id: id2 - }); - }); - }; - const addRelationships = (relationships2, g) => { - relationships2.forEach(function(r) { - let src = elementString(r.src); - let dst = elementString(r.dst); - g.setEdge(src, dst, { relationship: r }); - }); - return relationships2; - }; - const adjustEntities = function(svgNode2, graph) { - graph.nodes().forEach(function(v) { - if (v !== void 0 && graph.node(v) !== void 0) { - svgNode2.select("#" + v); - svgNode2.select("#" + v).attr( - "transform", - "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y - graph.node(v).height / 2) + " )" - ); - } - }); - return; - }; - const elementString = (str2) => { - return str2.replace(/\s/g, "").replace(/\./g, "_"); - }; - const draw$b = (text2, id2, _version, diagObj) => { - conf$5 = getConfig$1().requirement; - const securityLevel = conf$5.securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = root2.select(`[id='${id2}']`); - markers.insertLineEndings(svg2, conf$5); - const g = new Graph({ - multigraph: false, - compound: false, - directed: true - }).setGraph({ - rankdir: conf$5.layoutDirection, - marginx: 20, - marginy: 20, - nodesep: 100, - edgesep: 100, - ranksep: 100 - }).setDefaultEdgeLabel(function() { - return {}; - }); - let requirements2 = diagObj.db.getRequirements(); - let elements2 = diagObj.db.getElements(); - let relationships2 = diagObj.db.getRelationships(); - drawReqs(requirements2, g, svg2); - drawElements(elements2, g, svg2); - addRelationships(relationships2, g); - layout$1(g); - adjustEntities(svg2, g); - relationships2.forEach(function(rel2) { - drawRelationshipFromLayout(svg2, rel2, g, id2, diagObj); - }); - const padding2 = conf$5.rect_padding; - const svgBounds = svg2.node().getBBox(); - const width2 = svgBounds.width + padding2 * 2; - const height = svgBounds.height + padding2 * 2; - configureSvgSize(svg2, height, width2, conf$5.useMaxWidth); - svg2.attr("viewBox", `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height}`); - }; - const renderer$b = { - draw: draw$b - }; - const diagram$b = { - parser: parser$h, - db: db$a, - renderer: renderer$b, - styles: styles$7 - }; - const requirementDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$b - }, Symbol.toStringTag, { value: "Module" })); - var parser$e = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 13], $V7 = [1, 14], $V8 = [1, 16], $V9 = [1, 17], $Va = [1, 18], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 33], $Vl = [1, 34], $Vm = [1, 35], $Vn = [1, 36], $Vo = [1, 37], $Vp = [1, 38], $Vq = [1, 39], $Vr = [1, 41], $Vs = [1, 42], $Vt = [1, 43], $Vu = [1, 44], $Vv = [1, 45], $Vw = [1, 46], $Vx = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $Vy = [4, 5, 16, 50, 52, 53], $Vz = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VA = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VB = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VC = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VD = [68, 69, 70], $VE = [1, 120]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "SPACE": 4, "NEWLINE": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "box_section": 10, "box_line": 11, "participant_statement": 12, "create": 13, "box": 14, "restOfLine": 15, "end": 16, "signal": 17, "autonumber": 18, "NUM": 19, "off": 20, "activate": 21, "actor": 22, "deactivate": 23, "note_statement": 24, "links_statement": 25, "link_statement": 26, "properties_statement": 27, "details_statement": 28, "title": 29, "legacy_title": 30, "acc_title": 31, "acc_title_value": 32, "acc_descr": 33, "acc_descr_value": 34, "acc_descr_multiline_value": 35, "loop": 36, "rect": 37, "opt": 38, "alt": 39, "else_sections": 40, "par": 41, "par_sections": 42, "par_over": 43, "critical": 44, "option_sections": 45, "break": 46, "option": 47, "and": 48, "else": 49, "participant": 50, "AS": 51, "participant_actor": 52, "destroy": 53, "note": 54, "placement": 55, "text2": 56, "over": 57, "actor_pair": 58, "links": 59, "link": 60, "properties": 61, "details": 62, "spaceList": 63, ",": 64, "left_of": 65, "right_of": 66, "signaltype": 67, "+": 68, "-": 69, "ACTOR": 70, "SOLID_OPEN_ARROW": 71, "DOTTED_OPEN_ARROW": 72, "SOLID_ARROW": 73, "DOTTED_ARROW": 74, "SOLID_CROSS": 75, "DOTTED_CROSS": 76, "SOLID_POINT": 77, "DOTTED_POINT": 78, "TXT": 79, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "DOTTED_ARROW", 75: "SOLID_CROSS", 76: "DOTTED_CROSS", 77: "SOLID_POINT", 78: "DOTTED_POINT", 79: "TXT" }, - productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 3: - yy.apply($$[$0]); - return $$[$0]; - case 4: - case 9: - this.$ = []; - break; - case 5: - case 10: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 6: - case 7: - case 11: - case 12: - this.$ = $$[$0]; - break; - case 8: - case 13: - this.$ = []; - break; - case 15: - $$[$0].type = "createParticipant"; - this.$ = $$[$0]; - break; - case 16: - $$[$0 - 1].unshift({ type: "boxStart", boxData: yy.parseBoxData($$[$0 - 2]) }); - $$[$0 - 1].push({ type: "boxEnd", boxText: $$[$0 - 2] }); - this.$ = $$[$0 - 1]; - break; - case 18: - this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 2]), sequenceIndexStep: Number($$[$0 - 1]), sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 19: - this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 20: - this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 21: - this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; - break; - case 22: - this.$ = { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; - break; - case 23: - this.$ = { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; - break; - case 29: - yy.setDiagramTitle($$[$0].substring(6)); - this.$ = $$[$0].substring(6); - break; - case 30: - yy.setDiagramTitle($$[$0].substring(7)); - this.$ = $$[$0].substring(7); - break; - case 31: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 32: - case 33: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 34: - $$[$0 - 1].unshift({ type: "loopStart", loopText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.LOOP_START }); - $$[$0 - 1].push({ type: "loopEnd", loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); - this.$ = $$[$0 - 1]; - break; - case 35: - $$[$0 - 1].unshift({ type: "rectStart", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_START }); - $$[$0 - 1].push({ type: "rectEnd", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_END }); - this.$ = $$[$0 - 1]; - break; - case 36: - $$[$0 - 1].unshift({ type: "optStart", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_START }); - $$[$0 - 1].push({ type: "optEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_END }); - this.$ = $$[$0 - 1]; - break; - case 37: - $$[$0 - 1].unshift({ type: "altStart", altText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.ALT_START }); - $$[$0 - 1].push({ type: "altEnd", signalType: yy.LINETYPE.ALT_END }); - this.$ = $$[$0 - 1]; - break; - case 38: - $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_START }); - $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END }); - this.$ = $$[$0 - 1]; - break; - case 39: - $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_OVER_START }); - $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END }); - this.$ = $$[$0 - 1]; - break; - case 40: - $$[$0 - 1].unshift({ type: "criticalStart", criticalText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.CRITICAL_START }); - $$[$0 - 1].push({ type: "criticalEnd", signalType: yy.LINETYPE.CRITICAL_END }); - this.$ = $$[$0 - 1]; - break; - case 41: - $$[$0 - 1].unshift({ type: "breakStart", breakText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_START }); - $$[$0 - 1].push({ type: "breakEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_END }); - this.$ = $$[$0 - 1]; - break; - case 43: - this.$ = $$[$0 - 3].concat([{ type: "option", optionText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.CRITICAL_OPTION }, $$[$0]]); - break; - case 45: - this.$ = $$[$0 - 3].concat([{ type: "and", parText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.PAR_AND }, $$[$0]]); - break; - case 47: - this.$ = $$[$0 - 3].concat([{ type: "else", altText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]); - break; - case 48: - $$[$0 - 3].draw = "participant"; - $$[$0 - 3].type = "addParticipant"; - $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); - this.$ = $$[$0 - 3]; - break; - case 49: - $$[$0 - 1].draw = "participant"; - $$[$0 - 1].type = "addParticipant"; - this.$ = $$[$0 - 1]; - break; - case 50: - $$[$0 - 3].draw = "actor"; - $$[$0 - 3].type = "addParticipant"; - $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); - this.$ = $$[$0 - 3]; - break; - case 51: - $$[$0 - 1].draw = "actor"; - $$[$0 - 1].type = "addParticipant"; - this.$ = $$[$0 - 1]; - break; - case 52: - $$[$0 - 1].type = "destroyParticipant"; - this.$ = $$[$0 - 1]; - break; - case 53: - this.$ = [$$[$0 - 1], { type: "addNote", placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 54: - $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); - $$[$0 - 2][0] = $$[$0 - 2][0].actor; - $$[$0 - 2][1] = $$[$0 - 2][1].actor; - this.$ = [$$[$0 - 1], { type: "addNote", placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; - break; - case 55: - this.$ = [$$[$0 - 1], { type: "addLinks", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 56: - this.$ = [$$[$0 - 1], { type: "addALink", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 57: - this.$ = [$$[$0 - 1], { type: "addProperties", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 58: - this.$ = [$$[$0 - 1], { type: "addDetails", actor: $$[$0 - 1].actor, text: $$[$0] }]; - break; - case 61: - this.$ = [$$[$0 - 2], $$[$0]]; - break; - case 62: - this.$ = $$[$0]; - break; - case 63: - this.$ = yy.PLACEMENT.LEFTOF; - break; - case 64: - this.$ = yy.PLACEMENT.RIGHTOF; - break; - case 65: - this.$ = [ - $$[$0 - 4], - $$[$0 - 1], - { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0], activate: true }, - { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] } - ]; - break; - case 66: - this.$ = [ - $$[$0 - 4], - $$[$0 - 1], - { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, - { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] } - ]; - break; - case 67: - this.$ = [$$[$0 - 3], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; - break; - case 68: - this.$ = { type: "addParticipant", actor: $$[$0] }; - break; - case 69: - this.$ = yy.LINETYPE.SOLID_OPEN; - break; - case 70: - this.$ = yy.LINETYPE.DOTTED_OPEN; - break; - case 71: - this.$ = yy.LINETYPE.SOLID; - break; - case 72: - this.$ = yy.LINETYPE.DOTTED; - break; - case 73: - this.$ = yy.LINETYPE.SOLID_CROSS; - break; - case 74: - this.$ = yy.LINETYPE.DOTTED_CROSS; - break; - case 75: - this.$ = yy.LINETYPE.SOLID_POINT; - break; - case 76: - this.$ = yy.LINETYPE.DOTTED_POINT; - break; - case 77: - this.$ = yy.parseMessage($$[$0].trim().substring(1)); - break; - } - }, - table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o($Vx, [2, 5]), { 9: 47, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o($Vx, [2, 7]), o($Vx, [2, 8]), o($Vx, [2, 14]), { 12: 48, 50: $Vo, 52: $Vp, 53: $Vq }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: $Vw }, { 22: 55, 70: $Vw }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, o($Vx, [2, 29]), o($Vx, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, o($Vx, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 70: $Vw }, { 22: 72, 70: $Vw }, { 22: 73, 70: $Vw }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82] }, { 55: 83, 57: [1, 84], 65: [1, 85], 66: [1, 86] }, { 22: 87, 70: $Vw }, { 22: 88, 70: $Vw }, { 22: 89, 70: $Vw }, { 22: 90, 70: $Vw }, o([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79], [2, 68]), o($Vx, [2, 6]), o($Vx, [2, 15]), o($Vy, [2, 9], { 10: 91 }), o($Vx, [2, 17]), { 5: [1, 93], 19: [1, 92] }, { 5: [1, 94] }, o($Vx, [2, 21]), { 5: [1, 95] }, { 5: [1, 96] }, o($Vx, [2, 24]), o($Vx, [2, 25]), o($Vx, [2, 26]), o($Vx, [2, 27]), o($Vx, [2, 28]), o($Vx, [2, 31]), o($Vx, [2, 32]), o($Vz, $V3, { 7: 97 }), o($Vz, $V3, { 7: 98 }), o($Vz, $V3, { 7: 99 }), o($VA, $V3, { 40: 100, 7: 101 }), o($VB, $V3, { 42: 102, 7: 103 }), o($VB, $V3, { 7: 103, 42: 104 }), o($VC, $V3, { 45: 105, 7: 106 }), o($Vz, $V3, { 7: 107 }), { 5: [1, 109], 51: [1, 108] }, { 5: [1, 111], 51: [1, 110] }, { 5: [1, 112] }, { 22: 115, 68: [1, 113], 69: [1, 114], 70: $Vw }, o($VD, [2, 69]), o($VD, [2, 70]), o($VD, [2, 71]), o($VD, [2, 72]), o($VD, [2, 73]), o($VD, [2, 74]), o($VD, [2, 75]), o($VD, [2, 76]), { 22: 116, 70: $Vw }, { 22: 118, 58: 117, 70: $Vw }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 119, 79: $VE }, { 56: 121, 79: $VE }, { 56: 122, 79: $VE }, { 56: 123, 79: $VE }, { 4: [1, 126], 5: [1, 128], 11: 125, 12: 127, 16: [1, 124], 50: $Vo, 52: $Vp, 53: $Vq }, { 5: [1, 129] }, o($Vx, [2, 19]), o($Vx, [2, 20]), o($Vx, [2, 22]), o($Vx, [2, 23]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 130], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 131], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 132], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 133] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 46], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 49: [1, 134], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 135] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 44], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 48: [1, 136], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 137] }, { 16: [1, 138] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 42], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 47: [1, 139], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 140], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 15: [1, 141] }, o($Vx, [2, 49]), { 15: [1, 142] }, o($Vx, [2, 51]), o($Vx, [2, 52]), { 22: 143, 70: $Vw }, { 22: 144, 70: $Vw }, { 56: 145, 79: $VE }, { 56: 146, 79: $VE }, { 56: 147, 79: $VE }, { 64: [1, 148], 79: [2, 62] }, { 5: [2, 55] }, { 5: [2, 77] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, o($Vx, [2, 16]), o($Vy, [2, 10]), { 12: 149, 50: $Vo, 52: $Vp, 53: $Vq }, o($Vy, [2, 12]), o($Vy, [2, 13]), o($Vx, [2, 18]), o($Vx, [2, 34]), o($Vx, [2, 35]), o($Vx, [2, 36]), o($Vx, [2, 37]), { 15: [1, 150] }, o($Vx, [2, 38]), { 15: [1, 151] }, o($Vx, [2, 39]), o($Vx, [2, 40]), { 15: [1, 152] }, o($Vx, [2, 41]), { 5: [1, 153] }, { 5: [1, 154] }, { 56: 155, 79: $VE }, { 56: 156, 79: $VE }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 157, 70: $Vw }, o($Vy, [2, 11]), o($VA, $V3, { 7: 101, 40: 158 }), o($VB, $V3, { 7: 103, 42: 159 }), o($VC, $V3, { 7: 106, 45: 160 }), o($Vx, [2, 48]), o($Vx, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 79: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }], - defaultActions: { 5: [2, 1], 6: [2, 2], 85: [2, 63], 86: [2, 64], 119: [2, 55], 120: [2, 77], 121: [2, 56], 122: [2, 57], 123: [2, 58], 145: [2, 67], 146: [2, 53], 147: [2, 54], 155: [2, 65], 156: [2, 66], 157: [2, 61], 158: [2, 47], 159: [2, 45], 160: [2, 43] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + } + function getRule(ctx, element3) { + const name = getRuleName(ctx, element3); + const rule = ctx.rules.get(name); + if (!rule) + throw new Error(`Rule "${name}" not found."`); + return rule; + } + function getRuleName(ctx, element3) { + if (isParserRule(element3)) { + return element3.name; + } else if (ctx.ruleNames.has(element3)) { + return ctx.ruleNames.get(element3); + } else { + let item = element3; + let parent4 = item.$container; + let ruleName = element3.$type; + while (!isParserRule(parent4)) { + if (isGroup(parent4) || isAlternatives(parent4) || isUnorderedGroup(parent4)) { + const index = parent4.elements.indexOf(item); + ruleName = index.toString() + ":" + ruleName; + } + item = parent4; + parent4 = parent4.$container; + } + const rule = parent4; + ruleName = rule.name + ":" + ruleName; + ctx.ruleNames.set(element3, ruleName); + return ruleName; + } + } + function getToken(ctx, name) { + const token2 = ctx.tokens[name]; + if (!token2) + throw new Error(`Token "${name}" not found."`); + return token2; + } + var init_parser_builder_base = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-builder-base.js"() { + "use strict"; + init_api5(); + init_ast(); + init_errors2(); + init_stream(); + init_grammar_utils(); + __name(createParser, "createParser"); + __name(buildRules, "buildRules"); + __name(buildElement, "buildElement"); + __name(buildAction, "buildAction"); + __name(buildRuleCall, "buildRuleCall"); + __name(buildRuleCallPredicate, "buildRuleCallPredicate"); + __name(buildPredicate, "buildPredicate"); + __name(buildAlternatives, "buildAlternatives"); + __name(buildUnorderedGroup, "buildUnorderedGroup"); + __name(buildGroup4, "buildGroup"); + __name(getGuardCondition, "getGuardCondition"); + __name(buildCrossReference, "buildCrossReference"); + __name(buildKeyword, "buildKeyword"); + __name(wrap, "wrap"); + __name(getRule, "getRule"); + __name(getRuleName, "getRuleName"); + __name(getToken, "getToken"); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/completion-parser-builder.js + function createCompletionParser(services) { + const grammar = services.Grammar; + const lexer2 = services.parser.Lexer; + const parser21 = new LangiumCompletionParser(services); + createParser(grammar, parser21, lexer2.definition); + parser21.finalize(); + return parser21; + } + var init_completion_parser_builder = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/completion-parser-builder.js"() { + "use strict"; + init_langium_parser(); + init_parser_builder_base(); + __name(createCompletionParser, "createCompletionParser"); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser-builder.js + function createLangiumParser(services) { + const parser21 = prepareLangiumParser(services); + parser21.finalize(); + return parser21; + } + function prepareLangiumParser(services) { + const grammar = services.Grammar; + const lexer2 = services.parser.Lexer; + const parser21 = new LangiumParser(services); + return createParser(grammar, parser21, lexer2.definition); + } + var init_langium_parser_builder = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser-builder.js"() { + "use strict"; + init_langium_parser(); + init_parser_builder_base(); + __name(createLangiumParser, "createLangiumParser"); + __name(prepareLangiumParser, "prepareLangiumParser"); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/token-builder.js + var DefaultTokenBuilder; + var init_token_builder = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/token-builder.js"() { + "use strict"; + init_api5(); + init_ast(); + init_ast_utils(); + init_grammar_utils(); + init_regexp_utils(); + init_stream(); + DefaultTokenBuilder = class { + static { + __name(this, "DefaultTokenBuilder"); + } + buildTokens(grammar, options3) { + const reachableRules = stream(getAllReachableRules(grammar, false)); + const terminalTokens = this.buildTerminalTokens(reachableRules); + const tokens2 = this.buildKeywordTokens(reachableRules, terminalTokens, options3); + terminalTokens.forEach((terminalToken) => { + const pattern = terminalToken.PATTERN; + if (typeof pattern === "object" && pattern && "test" in pattern && isWhitespace(pattern)) { + tokens2.unshift(terminalToken); + } else { + tokens2.push(terminalToken); } - token2 = self2.symbols_[token2] || token2; + }); + return tokens2; + } + buildTerminalTokens(rules) { + return rules.filter(isTerminalRule).filter((e3) => !e3.fragment).map((terminal) => this.buildTerminalToken(terminal)).toArray(); + } + buildTerminalToken(terminal) { + const regex = terminalRegex(terminal); + const pattern = this.requiresCustomPattern(regex) ? this.regexPatternFunction(regex) : regex; + const tokenType = { + name: terminal.name, + PATTERN: pattern, + LINE_BREAKS: true + }; + if (terminal.hidden) { + tokenType.GROUP = isWhitespace(regex) ? Lexer2.SKIPPED : "hidden"; } - return token2; + return tokenType; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; + requiresCustomPattern(regex) { + if (regex.flags.includes("u")) { + return true; + } else if (regex.source.includes("?<=") || regex.source.includes("? TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } + } + regexPatternFunction(regex) { + const stickyRegex = new RegExp(regex, regex.flags + "y"); + return (text2, offset) => { + stickyRegex.lastIndex = offset; + const execResult = stickyRegex.exec(text2); + return execResult; + }; + } + buildKeywordTokens(rules, terminalTokens, options3) { + return rules.filter(isParserRule).flatMap((rule) => streamAllContents(rule).filter(isKeyword)).distinct((e3) => e3.value).toArray().sort((a2, b2) => b2.value.length - a2.value.length).map((keyword) => this.buildKeywordToken(keyword, terminalTokens, Boolean(options3 === null || options3 === void 0 ? void 0 : options3.caseInsensitive))); + } + buildKeywordToken(keyword, terminalTokens, caseInsensitive) { + return { + name: keyword.value, + PATTERN: this.buildKeywordPattern(keyword, caseInsensitive), + LONGER_ALT: this.findLongerAlt(keyword, terminalTokens) + }; + } + buildKeywordPattern(keyword, caseInsensitive) { + return caseInsensitive ? new RegExp(getCaseInsensitivePattern(keyword.value)) : keyword.value; + } + findLongerAlt(keyword, terminalTokens) { + return terminalTokens.reduce((longerAlts, token2) => { + const pattern = token2 === null || token2 === void 0 ? void 0 : token2.PATTERN; + if ((pattern === null || pattern === void 0 ? void 0 : pattern.source) && partialMatches("^" + pattern.source + "$", keyword.value)) { + longerAlts.push(token2); } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); + return longerAlts; + }, []); + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/value-converter.js + var DefaultValueConverter, ValueConverter; + var init_value_converter = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/value-converter.js"() { + "use strict"; + init_ast(); + init_grammar_utils(); + DefaultValueConverter = class { + static { + __name(this, "DefaultValueConverter"); + } + convert(input, cstNode) { + let feature = cstNode.grammarSource; + if (isCrossReference(feature)) { + feature = getCrossReferenceTerminal(feature); + } + if (isRuleCall(feature)) { + const rule = feature.rule.ref; + if (!rule) { + throw new Error("This cst node was not parsed by a rule."); + } + return this.runConverter(rule, input, cstNode); + } + return input; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + runConverter(rule, input, cstNode) { + var _a; + switch (rule.name.toUpperCase()) { + case "INT": + return ValueConverter.convertInt(input); + case "STRING": + return ValueConverter.convertString(input); + case "ID": + return ValueConverter.convertID(input); + } + switch ((_a = getRuleType(rule)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) { + case "number": + return ValueConverter.convertNumber(input); + case "boolean": + return ValueConverter.convertBoolean(input); + case "bigint": + return ValueConverter.convertBigint(input); + case "date": + return ValueConverter.convertDate(input); + default: + return input; } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + } + }; + (function(ValueConverter2) { + function convertString(input) { + let result = ""; + for (let i2 = 1; i2 < input.length - 1; i2++) { + const c3 = input.charAt(i2); + if (c3 === "\\") { + const c1 = input.charAt(++i2); + result += convertEscapeCharacter(c1); + } else { + result += c3; + } } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + return result; + } + __name(convertString, "convertString"); + ValueConverter2.convertString = convertString; + function convertEscapeCharacter(char2) { + switch (char2) { + case "b": + return "\b"; + case "f": + return "\f"; + case "n": + return "\n"; + case "r": + return "\r"; + case "t": + return " "; + case "v": + return "\v"; + case "0": + return "\0"; + default: + return char2; } } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); + __name(convertEscapeCharacter, "convertEscapeCharacter"); + function convertID(input) { + if (input.charAt(0) === "^") { + return input.substring(1); } else { - throw new Error(str2); + return input; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + } + __name(convertID, "convertID"); + ValueConverter2.convertID = convertID; + function convertInt(input) { + return parseInt(input); + } + __name(convertInt, "convertInt"); + ValueConverter2.convertInt = convertInt; + function convertBigint(input) { + return BigInt(input); + } + __name(convertBigint, "convertBigint"); + ValueConverter2.convertBigint = convertBigint; + function convertDate(input) { + return new Date(input); + } + __name(convertDate, "convertDate"); + ValueConverter2.convertDate = convertDate; + function convertNumber(input) { + return Number(input); + } + __name(convertNumber, "convertNumber"); + ValueConverter2.convertNumber = convertNumber; + function convertBoolean(input) { + return input.toLowerCase() === "true"; + } + __name(convertBoolean, "convertBoolean"); + ValueConverter2.convertBoolean = convertBoolean; + })(ValueConverter || (ValueConverter = {})); + } + }); + + // ../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js + var require_ral = __commonJS({ + "../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var _ral; + function RAL() { + if (_ral === void 0) { + throw new Error(`No runtime abstraction layer installed`); + } + return _ral; + } + __name(RAL, "RAL"); + (function(RAL2) { + function install(ral) { + if (ral === void 0) { + throw new Error(`No runtime abstraction layer provided`); + } + _ral = ral; + } + __name(install, "install"); + RAL2.install = install; + })(RAL || (RAL = {})); + exports2.default = RAL; + } + }); + + // ../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js + var require_is = __commonJS({ + "../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0; + function boolean(value2) { + return value2 === true || value2 === false; + } + __name(boolean, "boolean"); + exports2.boolean = boolean; + function string3(value2) { + return typeof value2 === "string" || value2 instanceof String; + } + __name(string3, "string"); + exports2.string = string3; + function number7(value2) { + return typeof value2 === "number" || value2 instanceof Number; + } + __name(number7, "number"); + exports2.number = number7; + function error3(value2) { + return value2 instanceof Error; + } + __name(error3, "error"); + exports2.error = error3; + function func(value2) { + return typeof value2 === "function"; + } + __name(func, "func"); + exports2.func = func; + function array4(value2) { + return Array.isArray(value2); + } + __name(array4, "array"); + exports2.array = array4; + function stringArray(value2) { + return array4(value2) && value2.every((elem) => string3(elem)); + } + __name(stringArray, "stringArray"); + exports2.stringArray = stringArray; + } + }); + + // ../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js + var require_events = __commonJS({ + "../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Emitter = exports2.Event = void 0; + var ral_1 = require_ral(); + var Event3; + (function(Event4) { + const _disposable = { dispose() { + } }; + Event4.None = function() { + return _disposable; + }; + })(Event3 || (exports2.Event = Event3 = {})); + var CallbackList = class { + static { + __name(this, "CallbackList"); + } + add(callback, context = null, bucket) { + if (!this._callbacks) { + this._callbacks = []; + this._contexts = []; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; + this._callbacks.push(callback); + this._contexts.push(context); + if (Array.isArray(bucket)) { + bucket.push({ dispose: /* @__PURE__ */ __name(() => this.remove(callback, context), "dispose") }); } - if (this.options.ranges) { - this.yylloc.range[1]++; + } + remove(callback, context = null) { + if (!this._callbacks) { + return; } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + let foundCallbackWithDifferentContext = false; + for (let i2 = 0, len = this._callbacks.length; i2 < len; i2++) { + if (this._callbacks[i2] === callback) { + if (this._contexts[i2] === context) { + this._callbacks.splice(i2, 1); + this._contexts.splice(i2, 1); + return; + } else { + foundCallbackWithDifferentContext = true; + } + } } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + if (foundCallbackWithDifferentContext) { + throw new Error("When adding a listener with a context, you should remove it with the same context"); } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + } + invoke(...args) { + if (!this._callbacks) { + return []; } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); + for (let i2 = 0, len = callbacks.length; i2 < len; i2++) { + try { + ret.push(callbacks[i2].apply(contexts[i2], args)); + } catch (e3) { + (0, ral_1.default)().console.error(e3); } } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + return ret; + } + isEmpty() { + return !this._callbacks || this._callbacks.length === 0; + } + dispose() { + this._callbacks = void 0; + this._contexts = void 0; + } + }; + var Emitter3 = class _Emitter { + static { + __name(this, "Emitter"); + } + constructor(_options) { + this._options = _options; + } + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get event() { + if (!this._event) { + this._event = (listener, thisArgs, disposables) => { + if (!this._callbacks) { + this._callbacks = new CallbackList(); + } + if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) { + this._options.onFirstListenerAdd(this); + } + this._callbacks.add(listener, thisArgs); + const result = { + dispose: /* @__PURE__ */ __name(() => { + if (!this._callbacks) { + return; + } + this._callbacks.remove(listener, thisArgs); + result.dispose = _Emitter._noop; + if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) { + this._options.onLastListenerRemove(this); + } + }, "dispose") + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; + return this._event; + } + /** + * To be kept private to fire an event to + * subscribers + */ + fire(event3) { + if (this._callbacks) { + this._callbacks.invoke.call(this._callbacks, event3); } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } + } + dispose() { + if (this._callbacks) { + this._callbacks.dispose(); + this._callbacks = void 0; } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + } + }; + exports2.Emitter = Emitter3; + Emitter3._noop = function() { + }; + } + }); + + // ../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js + var require_cancellation = __commonJS({ + "../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CancellationTokenSource = exports2.CancellationToken = void 0; + var ral_1 = require_ral(); + var Is2 = require_is(); + var events_1 = require_events(); + var CancellationToken11; + (function(CancellationToken12) { + CancellationToken12.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: events_1.Event.None + }); + CancellationToken12.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: events_1.Event.None + }); + function is2(value2) { + const candidate = value2; + return candidate && (candidate === CancellationToken12.None || candidate === CancellationToken12.Cancelled || Is2.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested); + } + __name(is2, "is"); + CancellationToken12.is = is2; + })(CancellationToken11 || (exports2.CancellationToken = CancellationToken11 = {})); + var shortcutEvent = Object.freeze(function(callback, context) { + const handle = (0, ral_1.default)().timer.setTimeout(callback.bind(context), 0); + return { dispose() { + handle.dispose(); + } }; + }); + var MutableToken = class { + static { + __name(this, "MutableToken"); + } + constructor() { + this._isCancelled = false; + } + cancel() { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(void 0); + this.dispose(); } - return false; } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + } + get isCancellationRequested() { + return this._isCancelled; + } + get onCancellationRequested() { + if (this._isCancelled) { + return shortcutEvent; } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + if (!this._emitter) { + this._emitter = new events_1.Emitter(); } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + return this._emitter.event; + } + dispose() { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = void 0; } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + } + }; + var CancellationTokenSource3 = class { + static { + __name(this, "CancellationTokenSource"); + } + get token() { + if (!this._token) { + this._token = new MutableToken(); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; + return this._token; + } + cancel() { + if (!this._token) { + this._token = CancellationToken11.Cancelled; } else { - return "INITIAL"; + this._token.cancel(); } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - return 5; - case 1: - break; - case 2: - break; - case 3: - break; - case 4: - break; - case 5: - break; - case 6: - return 19; - case 7: - this.begin("LINE"); - return 14; - case 8: - this.begin("ID"); - return 50; - case 9: - this.begin("ID"); - return 52; - case 10: - return 13; - case 11: - this.begin("ID"); - return 53; - case 12: - yy_.yytext = yy_.yytext.trim(); - this.begin("ALIAS"); - return 70; - case 13: - this.popState(); - this.popState(); - this.begin("LINE"); - return 51; - case 14: - this.popState(); - this.popState(); - return 5; - case 15: - this.begin("LINE"); - return 36; - case 16: - this.begin("LINE"); - return 37; - case 17: - this.begin("LINE"); - return 38; - case 18: - this.begin("LINE"); - return 39; - case 19: - this.begin("LINE"); - return 49; - case 20: - this.begin("LINE"); - return 41; - case 21: - this.begin("LINE"); - return 43; - case 22: - this.begin("LINE"); - return 48; - case 23: - this.begin("LINE"); - return 44; - case 24: - this.begin("LINE"); - return 47; - case 25: - this.begin("LINE"); - return 46; - case 26: - this.popState(); - return 15; - case 27: - return 16; - case 28: - return 65; - case 29: - return 66; - case 30: - return 59; - case 31: - return 60; - case 32: - return 61; - case 33: - return 62; - case 34: - return 57; - case 35: - return 54; - case 36: - this.begin("ID"); - return 21; - case 37: - this.begin("ID"); - return 23; - case 38: - return 29; - case 39: - return 30; - case 40: - this.begin("acc_title"); - return 31; - case 41: - this.popState(); - return "acc_title_value"; - case 42: - this.begin("acc_descr"); - return 33; - case 43: - this.popState(); - return "acc_descr_value"; - case 44: - this.begin("acc_descr_multiline"); - break; - case 45: - this.popState(); - break; - case 46: - return "acc_descr_multiline_value"; - case 47: - return 6; - case 48: - return 18; - case 49: - return 20; - case 50: - return 64; - case 51: - return 5; - case 52: - yy_.yytext = yy_.yytext.trim(); - return 70; - case 53: - return 73; - case 54: - return 74; - case 55: - return 71; - case 56: - return 72; - case 57: - return 75; - case 58: - return 76; - case 59: - return 77; - case 60: - return 78; - case 61: - return 79; - case 62: - return 68; - case 63: - return 69; - case 64: - return 5; - case 65: - return "INVALID"; + } + dispose() { + if (!this._token) { + this._token = CancellationToken11.None; + } else if (this._token instanceof MutableToken) { + this._token.dispose(); } - }, - rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "acc_descr_multiline": { "rules": [45, 46], "inclusive": false }, "acc_descr": { "rules": [43], "inclusive": false }, "acc_title": { "rules": [41], "inclusive": false }, "ID": { "rules": [2, 3, 12], "inclusive": false }, "ALIAS": { "rules": [2, 3, 13, 14], "inclusive": false }, "LINE": { "rules": [2, 3, 26], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65], "inclusive": true } } + } }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$e.parser = parser$e; - const parser$f = parser$e; - class ImperativeState { - /** - * @param init - Function that creates the default state. - */ - constructor(init2) { - this.init = init2; - this.records = this.init(); - } - reset() { - this.records = this.init(); - } - } - const state = new ImperativeState(() => ({ - prevActor: void 0, - actors: {}, - createdActors: {}, - destroyedActors: {}, - boxes: [], - messages: [], - notes: [], - sequenceNumbersEnabled: false, - wrapEnabled: void 0, - currentBox: void 0, - lastCreated: void 0, - lastDestroyed: void 0 - })); - const addBox = function(data) { - state.records.boxes.push({ - name: data.text, - wrap: data.wrap === void 0 && autoWrap() || !!data.wrap, - fill: data.color, - actorKeys: [] - }); - state.records.currentBox = state.records.boxes.slice(-1)[0]; - }; - const addActor = function(id2, name, description, type2) { - let assignedBox = state.records.currentBox; - const old = state.records.actors[id2]; - if (old) { - if (state.records.currentBox && old.box && state.records.currentBox !== old.box) { - throw new Error( - "A same participant should only be defined in one Box: " + old.name + " can't be in '" + old.box.name + "' and in '" + state.records.currentBox.name + "' at the same time." - ); - } - assignedBox = old.box ? old.box : state.records.currentBox; - old.box = assignedBox; - if (old && name === old.name && description == null) { - return; - } - } - if (description == null || description.text == null) { - description = { text: name, wrap: null, type: type2 }; - } - if (type2 == null || description.text == null) { - description = { text: name, wrap: null, type: type2 }; - } - state.records.actors[id2] = { - box: assignedBox, - name, - description: description.text, - wrap: description.wrap === void 0 && autoWrap() || !!description.wrap, - prevActor: state.records.prevActor, - links: {}, - properties: {}, - actorCnt: null, - rectData: null, - type: type2 || "participant" - }; - if (state.records.prevActor && state.records.actors[state.records.prevActor]) { - state.records.actors[state.records.prevActor].nextActor = id2; + exports2.CancellationTokenSource = CancellationTokenSource3; } - if (state.records.currentBox) { - state.records.currentBox.actorKeys.push(id2); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cancellation.js + var cancellation_exports = {}; + var init_cancellation = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/cancellation.js"() { + "use strict"; + __reExport(cancellation_exports, __toESM(require_cancellation(), 1)); } - state.records.prevActor = id2; - }; - const activationCount = (part) => { - let i2; - let count = 0; - for (i2 = 0; i2 < state.records.messages.length; i2++) { - if (state.records.messages[i2].type === LINETYPE.ACTIVE_START && state.records.messages[i2].from.actor === part) { - count++; - } - if (state.records.messages[i2].type === LINETYPE.ACTIVE_END && state.records.messages[i2].from.actor === part) { - count--; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/promise-utils.js + function delayNextTick() { + return new Promise((resolve3) => { + if (typeof setImmediate === "undefined") { + setTimeout(resolve3, 0); + } else { + setImmediate(resolve3); } - } - return count; - }; - const addMessage = function(idFrom, idTo, message, answer) { - state.records.messages.push({ - from: idFrom, - to: idTo, - message: message.text, - wrap: message.wrap === void 0 && autoWrap() || !!message.wrap, - answer }); - }; - const addSignal = function(idFrom, idTo, message = { text: void 0, wrap: void 0 }, messageType, activate = false) { - if (messageType === LINETYPE.ACTIVE_END) { - const cnt2 = activationCount(idFrom.actor); - if (cnt2 < 1) { - let error = new Error("Trying to inactivate an inactive participant (" + idFrom.actor + ")"); - error.hash = { - text: "->>-", - token: "->>-", - line: "1", - loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, - expected: ["'ACTIVE_PARTICIPANT'"] - }; - throw error; - } + } + function startCancelableOperation() { + lastTick = Date.now(); + return new cancellation_exports.CancellationTokenSource(); + } + function setInterruptionPeriod(period) { + globalInterruptionPeriod = period; + } + function isOperationCancelled(err) { + return err === OperationCancelled; + } + async function interruptAndCheck(token2) { + if (token2 === cancellation_exports.CancellationToken.None) { + return; } - state.records.messages.push({ - from: idFrom, - to: idTo, - message: message.text, - wrap: message.wrap === void 0 && autoWrap() || !!message.wrap, - type: messageType, - activate - }); - return true; - }; - const hasAtLeastOneBox = function() { - return state.records.boxes.length > 0; - }; - const hasAtLeastOneBoxWithTitle = function() { - return state.records.boxes.some((b) => b.name); - }; - const getMessages = function() { - return state.records.messages; - }; - const getBoxes = function() { - return state.records.boxes; - }; - const getActors$1 = function() { - return state.records.actors; - }; - const getCreatedActors = function() { - return state.records.createdActors; - }; - const getDestroyedActors = function() { - return state.records.destroyedActors; - }; - const getActor = function(id2) { - return state.records.actors[id2]; - }; - const getActorKeys = function() { - return Object.keys(state.records.actors); - }; - const enableSequenceNumbers = function() { - state.records.sequenceNumbersEnabled = true; - }; - const disableSequenceNumbers = function() { - state.records.sequenceNumbersEnabled = false; - }; - const showSequenceNumbers = () => state.records.sequenceNumbersEnabled; - const setWrap = function(wrapSetting) { - state.records.wrapEnabled = wrapSetting; - }; - const autoWrap = () => { - if (state.records.wrapEnabled !== void 0) { - return state.records.wrapEnabled; + const current = Date.now(); + if (current - lastTick >= globalInterruptionPeriod) { + lastTick = current; + await delayNextTick(); + } + if (token2.isCancellationRequested) { + throw OperationCancelled; + } + } + var lastTick, globalInterruptionPeriod, OperationCancelled, Deferred; + var init_promise_utils = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/promise-utils.js"() { + "use strict"; + init_cancellation(); + __name(delayNextTick, "delayNextTick"); + lastTick = 0; + globalInterruptionPeriod = 10; + __name(startCancelableOperation, "startCancelableOperation"); + __name(setInterruptionPeriod, "setInterruptionPeriod"); + OperationCancelled = Symbol("OperationCancelled"); + __name(isOperationCancelled, "isOperationCancelled"); + __name(interruptAndCheck, "interruptAndCheck"); + Deferred = class { + static { + __name(this, "Deferred"); + } + constructor() { + this.promise = new Promise((resolve3, reject3) => { + this.resolve = (arg) => { + resolve3(arg); + return this; + }; + this.reject = (err) => { + reject3(err); + return this; + }; + }); + } + }; } - return getConfig$1().sequence.wrap; - }; - const clear$7 = function() { - state.reset(); - clear$n(); - }; - const parseMessage = function(str2) { - const _str = str2.trim(); - const message = { - text: _str.replace(/^:?(?:no)?wrap:/, "").trim(), - wrap: _str.match(/^:?wrap:/) !== null ? true : _str.match(/^:?nowrap:/) !== null ? false : void 0 - }; - log$1.debug("parseMessage:", message); - return message; - }; - const parseBoxData = function(str2) { - const match = str2.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/); - let color2 = match != null && match[1] ? match[1].trim() : "transparent"; - let title2 = match != null && match[2] ? match[2].trim() : void 0; - if (window && window.CSS) { - if (!window.CSS.supports("color", color2)) { - color2 = "transparent"; - title2 = str2.trim(); - } - } else { - const style = new Option().style; - style.color = color2; - if (style.color !== color2) { - color2 = "transparent"; - title2 = str2.trim(); + }); + + // ../../node_modules/.pnpm/vscode-languageserver-textdocument@1.0.12/node_modules/vscode-languageserver-textdocument/lib/esm/main.js + function mergeSort(data5, compare) { + if (data5.length <= 1) { + return data5; + } + const p3 = data5.length / 2 | 0; + const left3 = data5.slice(0, p3); + const right3 = data5.slice(p3); + mergeSort(left3, compare); + mergeSort(right3, compare); + let leftIdx = 0; + let rightIdx = 0; + let i2 = 0; + while (leftIdx < left3.length && rightIdx < right3.length) { + const ret = compare(left3[leftIdx], right3[rightIdx]); + if (ret <= 0) { + data5[i2++] = left3[leftIdx++]; + } else { + data5[i2++] = right3[rightIdx++]; } } - return { - color: color2, - text: title2 !== void 0 ? sanitizeText$6(title2.replace(/^:?(?:no)?wrap:/, ""), getConfig$1()) : void 0, - wrap: title2 !== void 0 ? title2.match(/^:?wrap:/) !== null ? true : title2.match(/^:?nowrap:/) !== null ? false : void 0 : void 0 - }; - }; - const LINETYPE = { - SOLID: 0, - DOTTED: 1, - NOTE: 2, - SOLID_CROSS: 3, - DOTTED_CROSS: 4, - SOLID_OPEN: 5, - DOTTED_OPEN: 6, - LOOP_START: 10, - LOOP_END: 11, - ALT_START: 12, - ALT_ELSE: 13, - ALT_END: 14, - OPT_START: 15, - OPT_END: 16, - ACTIVE_START: 17, - ACTIVE_END: 18, - PAR_START: 19, - PAR_AND: 20, - PAR_END: 21, - RECT_START: 22, - RECT_END: 23, - SOLID_POINT: 24, - DOTTED_POINT: 25, - AUTONUMBER: 26, - CRITICAL_START: 27, - CRITICAL_OPTION: 28, - CRITICAL_END: 29, - BREAK_START: 30, - BREAK_END: 31, - PAR_OVER_START: 32 - }; - const ARROWTYPE = { - FILLED: 0, - OPEN: 1 - }; - const PLACEMENT = { - LEFTOF: 0, - RIGHTOF: 1, - OVER: 2 - }; - const addNote$1 = function(actor, placement, message) { - const note2 = { - actor, - placement, - message: message.text, - wrap: message.wrap === void 0 && autoWrap() || !!message.wrap - }; - const actors2 = [].concat(actor, actor); - state.records.notes.push(note2); - state.records.messages.push({ - from: actors2[0], - to: actors2[1], - message: message.text, - wrap: message.wrap === void 0 && autoWrap() || !!message.wrap, - type: LINETYPE.NOTE, - placement - }); - }; - const addLinks = function(actorId, text2) { - const actor = getActor(actorId); - try { - let sanitizedText = sanitizeText$6(text2.text, getConfig$1()); - sanitizedText = sanitizedText.replace(/&/g, "&"); - sanitizedText = sanitizedText.replace(/=/g, "="); - const links2 = JSON.parse(sanitizedText); - insertLinks(actor, links2); - } catch (e) { - log$1.error("error while parsing actor link text", e); - } - }; - const addALink = function(actorId, text2) { - const actor = getActor(actorId); - try { - const links2 = {}; - let sanitizedText = sanitizeText$6(text2.text, getConfig$1()); - var sep2 = sanitizedText.indexOf("@"); - sanitizedText = sanitizedText.replace(/&/g, "&"); - sanitizedText = sanitizedText.replace(/=/g, "="); - var label = sanitizedText.slice(0, sep2 - 1).trim(); - var link2 = sanitizedText.slice(sep2 + 1).trim(); - links2[label] = link2; - insertLinks(actor, links2); - } catch (e) { - log$1.error("error while parsing actor link text", e); + while (leftIdx < left3.length) { + data5[i2++] = left3[leftIdx++]; } - }; - function insertLinks(actor, links2) { - if (actor.links == null) { - actor.links = links2; - } else { - for (let key in links2) { - actor.links[key] = links2[key]; - } + while (rightIdx < right3.length) { + data5[i2++] = right3[rightIdx++]; } + return data5; } - const addProperties = function(actorId, text2) { - const actor = getActor(actorId); - try { - let sanitizedText = sanitizeText$6(text2.text, getConfig$1()); - const properties = JSON.parse(sanitizedText); - insertProperties(actor, properties); - } catch (e) { - log$1.error("error while parsing actor properties text", e); - } - }; - function insertProperties(actor, properties) { - if (actor.properties == null) { - actor.properties = properties; - } else { - for (let key in properties) { - actor.properties[key] = properties[key]; + function computeLineOffsets(text2, isAtLineStart, textOffset = 0) { + const result = isAtLineStart ? [textOffset] : []; + for (let i2 = 0; i2 < text2.length; i2++) { + const ch = text2.charCodeAt(i2); + if (isEOL(ch)) { + if (ch === 13 && i2 + 1 < text2.length && text2.charCodeAt(i2 + 1) === 10) { + i2++; + } + result.push(textOffset + i2 + 1); } } + return result; } - function boxEnd() { - state.records.currentBox = void 0; - } - const addDetails = function(actorId, text2) { - const actor = getActor(actorId); - const elem = document.getElementById(text2.text); - try { - const text3 = elem.innerHTML; - const details = JSON.parse(text3); - if (details["properties"]) { - insertProperties(actor, details["properties"]); - } - if (details["links"]) { - insertLinks(actor, details["links"]); - } - } catch (e) { - log$1.error("error while parsing actor details text", e); - } - }; - const getActorProperty = function(actor, key) { - if (actor !== void 0 && actor.properties !== void 0) { - return actor.properties[key]; - } - return void 0; - }; - const apply = function(param) { - if (Array.isArray(param)) { - param.forEach(function(item) { - apply(item); - }); - } else { - switch (param.type) { - case "sequenceIndex": - state.records.messages.push({ - from: void 0, - to: void 0, - message: { - start: param.sequenceIndex, - step: param.sequenceIndexStep, - visible: param.sequenceVisible - }, - wrap: false, - type: param.signalType - }); - break; - case "addParticipant": - addActor(param.actor, param.actor, param.description, param.draw); - break; - case "createParticipant": - if (state.records.actors[param.actor]) { - throw new Error( - "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior" - ); - } - state.records.lastCreated = param.actor; - addActor(param.actor, param.actor, param.description, param.draw); - state.records.createdActors[param.actor] = state.records.messages.length; - break; - case "destroyParticipant": - state.records.lastDestroyed = param.actor; - state.records.destroyedActors[param.actor] = state.records.messages.length; - break; - case "activeStart": - addSignal(param.actor, void 0, void 0, param.signalType); - break; - case "activeEnd": - addSignal(param.actor, void 0, void 0, param.signalType); - break; - case "addNote": - addNote$1(param.actor, param.placement, param.text); - break; - case "addLinks": - addLinks(param.actor, param.text); - break; - case "addALink": - addALink(param.actor, param.text); - break; - case "addProperties": - addProperties(param.actor, param.text); - break; - case "addDetails": - addDetails(param.actor, param.text); - break; - case "addMessage": - if (state.records.lastCreated) { - if (param.to !== state.records.lastCreated) { - throw new Error( - "The created participant " + state.records.lastCreated + " does not have an associated creating message after its declaration. Please check the sequence diagram." - ); - } else { - state.records.lastCreated = void 0; - } - } else if (state.records.lastDestroyed) { - if (param.to !== state.records.lastDestroyed && param.from !== state.records.lastDestroyed) { - throw new Error( - "The destroyed participant " + state.records.lastDestroyed + " does not have an associated destroying message after its declaration. Please check the sequence diagram." - ); + function isEOL(char2) { + return char2 === 13 || char2 === 10; + } + function getWellformedRange(range3) { + const start3 = range3.start; + const end2 = range3.end; + if (start3.line > end2.line || start3.line === end2.line && start3.character > end2.character) { + return { start: end2, end: start3 }; + } + return range3; + } + function getWellformedEdit(textEdit) { + const range3 = getWellformedRange(textEdit.range); + if (range3 !== textEdit.range) { + return { newText: textEdit.newText, range: range3 }; + } + return textEdit; + } + var FullTextDocument2, TextDocument2; + var init_main2 = __esm({ + "../../node_modules/.pnpm/vscode-languageserver-textdocument@1.0.12/node_modules/vscode-languageserver-textdocument/lib/esm/main.js"() { + "use strict"; + FullTextDocument2 = class _FullTextDocument { + static { + __name(this, "FullTextDocument"); + } + constructor(uri, languageId, version4, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version4; + this._content = content; + this._lineOffsets = void 0; + } + get uri() { + return this._uri; + } + get languageId() { + return this._languageId; + } + get version() { + return this._version; + } + getText(range3) { + if (range3) { + const start3 = this.offsetAt(range3.start); + const end2 = this.offsetAt(range3.end); + return this._content.substring(start3, end2); + } + return this._content; + } + update(changes, version4) { + for (const change2 of changes) { + if (_FullTextDocument.isIncremental(change2)) { + const range3 = getWellformedRange(change2.range); + const startOffset = this.offsetAt(range3.start); + const endOffset = this.offsetAt(range3.end); + this._content = this._content.substring(0, startOffset) + change2.text + this._content.substring(endOffset, this._content.length); + const startLine = Math.max(range3.start.line, 0); + const endLine = Math.max(range3.end.line, 0); + let lineOffsets = this._lineOffsets; + const addedLineOffsets = computeLineOffsets(change2.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (let i2 = 0, len = addedLineOffsets.length; i2 < len; i2++) { + lineOffsets[i2 + startLine + 1] = addedLineOffsets[i2]; + } + } else { + if (addedLineOffsets.length < 1e4) { + lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets); + } else { + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + const diff2 = change2.text.length - (endOffset - startOffset); + if (diff2 !== 0) { + for (let i2 = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i2 < len; i2++) { + lineOffsets[i2] = lineOffsets[i2] + diff2; + } + } + } else if (_FullTextDocument.isFull(change2)) { + this._content = change2.text; + this._lineOffsets = void 0; } else { - state.records.lastDestroyed = void 0; + throw new Error("Unknown change event received"); } } - addSignal(param.from, param.to, param.msg, param.signalType, param.activate); - break; - case "boxStart": - addBox(param.boxData); - break; - case "boxEnd": - boxEnd(); - break; - case "loopStart": - addSignal(void 0, void 0, param.loopText, param.signalType); - break; - case "loopEnd": - addSignal(void 0, void 0, void 0, param.signalType); - break; - case "rectStart": - addSignal(void 0, void 0, param.color, param.signalType); - break; - case "rectEnd": - addSignal(void 0, void 0, void 0, param.signalType); - break; - case "optStart": - addSignal(void 0, void 0, param.optText, param.signalType); - break; - case "optEnd": - addSignal(void 0, void 0, void 0, param.signalType); - break; - case "altStart": - addSignal(void 0, void 0, param.altText, param.signalType); - break; - case "else": - addSignal(void 0, void 0, param.altText, param.signalType); - break; - case "altEnd": - addSignal(void 0, void 0, void 0, param.signalType); - break; - case "setAccTitle": - setAccTitle(param.text); - break; - case "parStart": - addSignal(void 0, void 0, param.parText, param.signalType); - break; - case "and": - addSignal(void 0, void 0, param.parText, param.signalType); - break; - case "parEnd": - addSignal(void 0, void 0, void 0, param.signalType); - break; - case "criticalStart": - addSignal(void 0, void 0, param.criticalText, param.signalType); - break; - case "option": - addSignal(void 0, void 0, param.optionText, param.signalType); - break; - case "criticalEnd": - addSignal(void 0, void 0, void 0, param.signalType); - break; - case "breakStart": - addSignal(void 0, void 0, param.breakText, param.signalType); - break; - case "breakEnd": - addSignal(void 0, void 0, void 0, param.signalType); - break; - } + this._version = version4; + } + getLineOffsets() { + if (this._lineOffsets === void 0) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + } + positionAt(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + const lineOffsets = this.getLineOffsets(); + let low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + const mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + const line2 = low - 1; + offset = this.ensureBeforeEOL(offset, lineOffsets[line2]); + return { line: line2, character: offset - lineOffsets[line2] }; + } + offsetAt(position5) { + const lineOffsets = this.getLineOffsets(); + if (position5.line >= lineOffsets.length) { + return this._content.length; + } else if (position5.line < 0) { + return 0; + } + const lineOffset = lineOffsets[position5.line]; + if (position5.character <= 0) { + return lineOffset; + } + const nextLineOffset = position5.line + 1 < lineOffsets.length ? lineOffsets[position5.line + 1] : this._content.length; + const offset = Math.min(lineOffset + position5.character, nextLineOffset); + return this.ensureBeforeEOL(offset, lineOffset); + } + ensureBeforeEOL(offset, lineOffset) { + while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) { + offset--; + } + return offset; + } + get lineCount() { + return this.getLineOffsets().length; + } + static isIncremental(event3) { + const candidate = event3; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); + } + static isFull(event3) { + const candidate = event3; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; + } + }; + (function(TextDocument3) { + function create2(uri, languageId, version4, content) { + return new FullTextDocument2(uri, languageId, version4, content); + } + __name(create2, "create"); + TextDocument3.create = create2; + function update2(document2, changes, version4) { + if (document2 instanceof FullTextDocument2) { + document2.update(changes, version4); + return document2; + } else { + throw new Error("TextDocument.update: document must be created by TextDocument.create"); + } + } + __name(update2, "update"); + TextDocument3.update = update2; + function applyEdits(document2, edits) { + const text2 = document2.getText(); + const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a2, b2) => { + const diff2 = a2.range.start.line - b2.range.start.line; + if (diff2 === 0) { + return a2.range.start.character - b2.range.start.character; + } + return diff2; + }); + let lastModifiedOffset = 0; + const spans = []; + for (const e3 of sortedEdits) { + const startOffset = document2.offsetAt(e3.range.start); + if (startOffset < lastModifiedOffset) { + throw new Error("Overlapping edit"); + } else if (startOffset > lastModifiedOffset) { + spans.push(text2.substring(lastModifiedOffset, startOffset)); + } + if (e3.newText.length) { + spans.push(e3.newText); + } + lastModifiedOffset = document2.offsetAt(e3.range.end); + } + spans.push(text2.substr(lastModifiedOffset)); + return spans.join(""); + } + __name(applyEdits, "applyEdits"); + TextDocument3.applyEdits = applyEdits; + })(TextDocument2 || (TextDocument2 = {})); + __name(mergeSort, "mergeSort"); + __name(computeLineOffsets, "computeLineOffsets"); + __name(isEOL, "isEOL"); + __name(getWellformedRange, "getWellformedRange"); + __name(getWellformedEdit, "getWellformedEdit"); } - }; - const db$9 = { - addActor, - addMessage, - addSignal, - addLinks, - addDetails, - addProperties, - autoWrap, - setWrap, - enableSequenceNumbers, - disableSequenceNumbers, - showSequenceNumbers, - getMessages, - getActors: getActors$1, - getCreatedActors, - getDestroyedActors, - getActor, - getActorKeys, - getActorProperty, - getAccTitle, - getBoxes, - getDiagramTitle, - setDiagramTitle, - getConfig: () => getConfig$1().sequence, - clear: clear$7, - parseMessage, - parseBoxData, - LINETYPE, - ARROWTYPE, - PLACEMENT, - addNote: addNote$1, - setAccTitle, - apply, - setAccDescription, - getAccDescription, - hasAtLeastOneBox, - hasAtLeastOneBoxWithTitle - }; - const getStyles$7 = (options2) => `.actor { - stroke: ${options2.actorBorder}; - fill: ${options2.actorBkg}; - } - - text.actor > tspan { - fill: ${options2.actorTextColor}; - stroke: none; - } - - .actor-line { - stroke: ${options2.actorLineColor}; - } - - .messageLine0 { - stroke-width: 1.5; - stroke-dasharray: none; - stroke: ${options2.signalColor}; - } - - .messageLine1 { - stroke-width: 1.5; - stroke-dasharray: 2, 2; - stroke: ${options2.signalColor}; - } - - #arrowhead path { - fill: ${options2.signalColor}; - stroke: ${options2.signalColor}; - } - - .sequenceNumber { - fill: ${options2.sequenceNumberColor}; - } - - #sequencenumber { - fill: ${options2.signalColor}; - } - - #crosshead path { - fill: ${options2.signalColor}; - stroke: ${options2.signalColor}; - } - - .messageText { - fill: ${options2.signalTextColor}; - stroke: none; - } - - .labelBox { - stroke: ${options2.labelBoxBorderColor}; - fill: ${options2.labelBoxBkgColor}; - } - - .labelText, .labelText > tspan { - fill: ${options2.labelTextColor}; - stroke: none; - } - - .loopText, .loopText > tspan { - fill: ${options2.loopTextColor}; - stroke: none; - } - - .loopLine { - stroke-width: 2px; - stroke-dasharray: 2, 2; - stroke: ${options2.labelBoxBorderColor}; - fill: ${options2.labelBoxBorderColor}; - } - - .note { - //stroke: #decc93; - stroke: ${options2.noteBorderColor}; - fill: ${options2.noteBkgColor}; - } - - .noteText, .noteText > tspan { - fill: ${options2.noteTextColor}; - stroke: none; - } - - .activation0 { - fill: ${options2.activationBkgColor}; - stroke: ${options2.activationBorderColor}; - } - - .activation1 { - fill: ${options2.activationBkgColor}; - stroke: ${options2.activationBorderColor}; - } - - .activation2 { - fill: ${options2.activationBkgColor}; - stroke: ${options2.activationBorderColor}; - } - - .actorPopupMenu { - position: absolute; - } + }); - .actorPopupMenuPanel { - position: absolute; - fill: ${options2.actorBkg}; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); -} - .actor-man line { - stroke: ${options2.actorBorder}; - fill: ${options2.actorBkg}; - } - .actor-man circle, line { - stroke: ${options2.actorBorder}; - fill: ${options2.actorBkg}; - stroke-width: 2px; - } -`; - const styles$6 = getStyles$7; - const ACTOR_TYPE_WIDTH = 18 * 2; - const TOP_ACTOR_CLASS = "actor-top"; - const BOTTOM_ACTOR_CLASS = "actor-bottom"; - const drawRect$2 = function(elem, rectData) { - return drawRect$4(elem, rectData); - }; - const drawPopup = function(elem, actor, minMenuWidth, textAttrs, forceMenus) { - if (actor.links === void 0 || actor.links === null || Object.keys(actor.links).length === 0) { - return { height: 0, width: 0 }; - } - const links2 = actor.links; - const actorCnt2 = actor.actorCnt; - const rectData = actor.rectData; - var displayValue = "none"; - if (forceMenus) { - displayValue = "block !important"; - } - const g = elem.append("g"); - g.attr("id", "actor" + actorCnt2 + "_popup"); - g.attr("class", "actorPopupMenu"); - g.attr("display", displayValue); - var actorClass = ""; - if (rectData.class !== void 0) { - actorClass = " " + rectData.class; - } - let menuWidth = rectData.width > minMenuWidth ? rectData.width : minMenuWidth; - const rectElem = g.append("rect"); - rectElem.attr("class", "actorPopupMenuPanel" + actorClass); - rectElem.attr("x", rectData.x); - rectElem.attr("y", rectData.height); - rectElem.attr("fill", rectData.fill); - rectElem.attr("stroke", rectData.stroke); - rectElem.attr("width", menuWidth); - rectElem.attr("height", rectData.height); - rectElem.attr("rx", rectData.rx); - rectElem.attr("ry", rectData.ry); - if (links2 != null) { - var linkY = 20; - for (let key in links2) { - var linkElem = g.append("a"); - var sanitizedLink = dist.sanitizeUrl(links2[key]); - linkElem.attr("xlink:href", sanitizedLink); - linkElem.attr("target", "_blank"); - _drawMenuItemTextCandidateFunc(textAttrs)( - key, - linkElem, - rectData.x + 10, - rectData.height + linkY, - menuWidth, - 20, - { class: "actor" }, - textAttrs - ); - linkY += 30; - } - } - rectElem.attr("height", linkY); - return { height: rectData.height + linkY, width: menuWidth }; - }; - const popupMenuToggle = function(popId) { - return "var pu = document.getElementById('" + popId + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"; - }; - const drawKatex = async function(elem, textData, msgModel = null) { - let textElem = elem.append("foreignObject"); - const lines = await renderKatex(textData.text, getConfig$2()); - const divElem = textElem.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(lines); - const dim = divElem.node().getBoundingClientRect(); - textElem.attr("height", Math.round(dim.height)).attr("width", Math.round(dim.width)); - if (textData.class === "noteText") { - const rectElem = elem.node().firstChild; - rectElem.setAttribute("height", dim.height + 2 * textData.textMargin); - const rectDim = rectElem.getBBox(); - textElem.attr("x", Math.round(rectDim.x + rectDim.width / 2 - dim.width / 2)).attr("y", Math.round(rectDim.y + rectDim.height / 2 - dim.height / 2)); - } else if (msgModel) { - let { startx, stopx, starty } = msgModel; - if (startx > stopx) { - const temp = startx; - startx = stopx; - stopx = temp; - } - textElem.attr("x", Math.round(startx + Math.abs(startx - stopx) / 2 - dim.width / 2)); - if (textData.class === "loopText") { - textElem.attr("y", Math.round(starty)); - } else { - textElem.attr("y", Math.round(starty - dim.height)); - } - } - return [textElem]; - }; - const drawText$2 = function(elem, textData) { - let prevTextHeight = 0; - let textHeight = 0; - const lines = textData.text.split(common$1.lineBreakRegex); - const [_textFontSize, _textFontSizePx] = parseFontSize(textData.fontSize); - let textElems = []; - let dy = 0; - let yfunc = () => textData.y; - if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) { - switch (textData.valign) { - case "top": - case "start": - yfunc = () => Math.round(textData.y + textData.textMargin); - break; - case "middle": - case "center": - yfunc = () => Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2); - break; - case "bottom": - case "end": - yfunc = () => Math.round( - textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin - ); - break; - } - } - if (textData.anchor !== void 0 && textData.textMargin !== void 0 && textData.width !== void 0) { - switch (textData.anchor) { - case "left": - case "start": - textData.x = Math.round(textData.x + textData.textMargin); - textData.anchor = "start"; - textData.dominantBaseline = "middle"; - textData.alignmentBaseline = "middle"; - break; - case "middle": - case "center": - textData.x = Math.round(textData.x + textData.width / 2); - textData.anchor = "middle"; - textData.dominantBaseline = "middle"; - textData.alignmentBaseline = "middle"; - break; - case "right": - case "end": - textData.x = Math.round(textData.x + textData.width - textData.textMargin); - textData.anchor = "end"; - textData.dominantBaseline = "middle"; - textData.alignmentBaseline = "middle"; - break; - } + // ../../node_modules/.pnpm/vscode-uri@3.0.8/node_modules/vscode-uri/lib/esm/index.mjs + var LIB, URI2, Utils2; + var init_esm2 = __esm({ + "../../node_modules/.pnpm/vscode-uri@3.0.8/node_modules/vscode-uri/lib/esm/index.mjs"() { + "use strict"; + (() => { + "use strict"; + var t4 = { 470: (t5) => { + function e4(t6) { + if ("string" != typeof t6) throw new TypeError("Path must be a string. Received " + JSON.stringify(t6)); + } + __name(e4, "e"); + function r3(t6, e6) { + for (var r4, n4 = "", i2 = 0, o2 = -1, s2 = 0, h2 = 0; h2 <= t6.length; ++h2) { + if (h2 < t6.length) r4 = t6.charCodeAt(h2); + else { + if (47 === r4) break; + r4 = 47; + } + if (47 === r4) { + if (o2 === h2 - 1 || 1 === s2) ; + else if (o2 !== h2 - 1 && 2 === s2) { + if (n4.length < 2 || 2 !== i2 || 46 !== n4.charCodeAt(n4.length - 1) || 46 !== n4.charCodeAt(n4.length - 2)) { + if (n4.length > 2) { + var a2 = n4.lastIndexOf("/"); + if (a2 !== n4.length - 1) { + -1 === a2 ? (n4 = "", i2 = 0) : i2 = (n4 = n4.slice(0, a2)).length - 1 - n4.lastIndexOf("/"), o2 = h2, s2 = 0; + continue; + } + } else if (2 === n4.length || 1 === n4.length) { + n4 = "", i2 = 0, o2 = h2, s2 = 0; + continue; + } + } + e6 && (n4.length > 0 ? n4 += "/.." : n4 = "..", i2 = 2); + } else n4.length > 0 ? n4 += "/" + t6.slice(o2 + 1, h2) : n4 = t6.slice(o2 + 1, h2), i2 = h2 - o2 - 1; + o2 = h2, s2 = 0; + } else 46 === r4 && -1 !== s2 ? ++s2 : s2 = -1; + } + return n4; + } + __name(r3, "r"); + var n3 = { resolve: /* @__PURE__ */ __name(function() { + for (var t6, n4 = "", i2 = false, o2 = arguments.length - 1; o2 >= -1 && !i2; o2--) { + var s2; + o2 >= 0 ? s2 = arguments[o2] : (void 0 === t6 && (t6 = process.cwd()), s2 = t6), e4(s2), 0 !== s2.length && (n4 = s2 + "/" + n4, i2 = 47 === s2.charCodeAt(0)); + } + return n4 = r3(n4, !i2), i2 ? n4.length > 0 ? "/" + n4 : "/" : n4.length > 0 ? n4 : "."; + }, "resolve"), normalize: /* @__PURE__ */ __name(function(t6) { + if (e4(t6), 0 === t6.length) return "."; + var n4 = 47 === t6.charCodeAt(0), i2 = 47 === t6.charCodeAt(t6.length - 1); + return 0 !== (t6 = r3(t6, !n4)).length || n4 || (t6 = "."), t6.length > 0 && i2 && (t6 += "/"), n4 ? "/" + t6 : t6; + }, "normalize"), isAbsolute: /* @__PURE__ */ __name(function(t6) { + return e4(t6), t6.length > 0 && 47 === t6.charCodeAt(0); + }, "isAbsolute"), join: /* @__PURE__ */ __name(function() { + if (0 === arguments.length) return "."; + for (var t6, r4 = 0; r4 < arguments.length; ++r4) { + var i2 = arguments[r4]; + e4(i2), i2.length > 0 && (void 0 === t6 ? t6 = i2 : t6 += "/" + i2); + } + return void 0 === t6 ? "." : n3.normalize(t6); + }, "join"), relative: /* @__PURE__ */ __name(function(t6, r4) { + if (e4(t6), e4(r4), t6 === r4) return ""; + if ((t6 = n3.resolve(t6)) === (r4 = n3.resolve(r4))) return ""; + for (var i2 = 1; i2 < t6.length && 47 === t6.charCodeAt(i2); ++i2) ; + for (var o2 = t6.length, s2 = o2 - i2, h2 = 1; h2 < r4.length && 47 === r4.charCodeAt(h2); ++h2) ; + for (var a2 = r4.length - h2, c3 = s2 < a2 ? s2 : a2, f3 = -1, u2 = 0; u2 <= c3; ++u2) { + if (u2 === c3) { + if (a2 > c3) { + if (47 === r4.charCodeAt(h2 + u2)) return r4.slice(h2 + u2 + 1); + if (0 === u2) return r4.slice(h2 + u2); + } else s2 > c3 && (47 === t6.charCodeAt(i2 + u2) ? f3 = u2 : 0 === u2 && (f3 = 0)); + break; + } + var l2 = t6.charCodeAt(i2 + u2); + if (l2 !== r4.charCodeAt(h2 + u2)) break; + 47 === l2 && (f3 = u2); + } + var g2 = ""; + for (u2 = i2 + f3 + 1; u2 <= o2; ++u2) u2 !== o2 && 47 !== t6.charCodeAt(u2) || (0 === g2.length ? g2 += ".." : g2 += "/.."); + return g2.length > 0 ? g2 + r4.slice(h2 + f3) : (h2 += f3, 47 === r4.charCodeAt(h2) && ++h2, r4.slice(h2)); + }, "relative"), _makeLong: /* @__PURE__ */ __name(function(t6) { + return t6; + }, "_makeLong"), dirname: /* @__PURE__ */ __name(function(t6) { + if (e4(t6), 0 === t6.length) return "."; + for (var r4 = t6.charCodeAt(0), n4 = 47 === r4, i2 = -1, o2 = true, s2 = t6.length - 1; s2 >= 1; --s2) if (47 === (r4 = t6.charCodeAt(s2))) { + if (!o2) { + i2 = s2; + break; + } + } else o2 = false; + return -1 === i2 ? n4 ? "/" : "." : n4 && 1 === i2 ? "//" : t6.slice(0, i2); + }, "dirname"), basename: /* @__PURE__ */ __name(function(t6, r4) { + if (void 0 !== r4 && "string" != typeof r4) throw new TypeError('"ext" argument must be a string'); + e4(t6); + var n4, i2 = 0, o2 = -1, s2 = true; + if (void 0 !== r4 && r4.length > 0 && r4.length <= t6.length) { + if (r4.length === t6.length && r4 === t6) return ""; + var h2 = r4.length - 1, a2 = -1; + for (n4 = t6.length - 1; n4 >= 0; --n4) { + var c3 = t6.charCodeAt(n4); + if (47 === c3) { + if (!s2) { + i2 = n4 + 1; + break; + } + } else -1 === a2 && (s2 = false, a2 = n4 + 1), h2 >= 0 && (c3 === r4.charCodeAt(h2) ? -1 == --h2 && (o2 = n4) : (h2 = -1, o2 = a2)); + } + return i2 === o2 ? o2 = a2 : -1 === o2 && (o2 = t6.length), t6.slice(i2, o2); + } + for (n4 = t6.length - 1; n4 >= 0; --n4) if (47 === t6.charCodeAt(n4)) { + if (!s2) { + i2 = n4 + 1; + break; + } + } else -1 === o2 && (s2 = false, o2 = n4 + 1); + return -1 === o2 ? "" : t6.slice(i2, o2); + }, "basename"), extname: /* @__PURE__ */ __name(function(t6) { + e4(t6); + for (var r4 = -1, n4 = 0, i2 = -1, o2 = true, s2 = 0, h2 = t6.length - 1; h2 >= 0; --h2) { + var a2 = t6.charCodeAt(h2); + if (47 !== a2) -1 === i2 && (o2 = false, i2 = h2 + 1), 46 === a2 ? -1 === r4 ? r4 = h2 : 1 !== s2 && (s2 = 1) : -1 !== r4 && (s2 = -1); + else if (!o2) { + n4 = h2 + 1; + break; + } + } + return -1 === r4 || -1 === i2 || 0 === s2 || 1 === s2 && r4 === i2 - 1 && r4 === n4 + 1 ? "" : t6.slice(r4, i2); + }, "extname"), format: /* @__PURE__ */ __name(function(t6) { + if (null === t6 || "object" != typeof t6) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t6); + return function(t7, e6) { + var r4 = e6.dir || e6.root, n4 = e6.base || (e6.name || "") + (e6.ext || ""); + return r4 ? r4 === e6.root ? r4 + n4 : r4 + "/" + n4 : n4; + }(0, t6); + }, "format"), parse: /* @__PURE__ */ __name(function(t6) { + e4(t6); + var r4 = { root: "", dir: "", base: "", ext: "", name: "" }; + if (0 === t6.length) return r4; + var n4, i2 = t6.charCodeAt(0), o2 = 47 === i2; + o2 ? (r4.root = "/", n4 = 1) : n4 = 0; + for (var s2 = -1, h2 = 0, a2 = -1, c3 = true, f3 = t6.length - 1, u2 = 0; f3 >= n4; --f3) if (47 !== (i2 = t6.charCodeAt(f3))) -1 === a2 && (c3 = false, a2 = f3 + 1), 46 === i2 ? -1 === s2 ? s2 = f3 : 1 !== u2 && (u2 = 1) : -1 !== s2 && (u2 = -1); + else if (!c3) { + h2 = f3 + 1; + break; + } + return -1 === s2 || -1 === a2 || 0 === u2 || 1 === u2 && s2 === a2 - 1 && s2 === h2 + 1 ? -1 !== a2 && (r4.base = r4.name = 0 === h2 && o2 ? t6.slice(1, a2) : t6.slice(h2, a2)) : (0 === h2 && o2 ? (r4.name = t6.slice(1, s2), r4.base = t6.slice(1, a2)) : (r4.name = t6.slice(h2, s2), r4.base = t6.slice(h2, a2)), r4.ext = t6.slice(s2, a2)), h2 > 0 ? r4.dir = t6.slice(0, h2 - 1) : o2 && (r4.dir = "/"), r4; + }, "parse"), sep: "/", delimiter: ":", win32: null, posix: null }; + n3.posix = n3, t5.exports = n3; + } }, e3 = {}; + function r2(n3) { + var i2 = e3[n3]; + if (void 0 !== i2) return i2.exports; + var o2 = e3[n3] = { exports: {} }; + return t4[n3](o2, o2.exports, r2), o2.exports; + } + __name(r2, "r"); + r2.d = (t5, e4) => { + for (var n3 in e4) r2.o(e4, n3) && !r2.o(t5, n3) && Object.defineProperty(t5, n3, { enumerable: true, get: e4[n3] }); + }, r2.o = (t5, e4) => Object.prototype.hasOwnProperty.call(t5, e4), r2.r = (t5) => { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t5, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t5, "__esModule", { value: true }); + }; + var n2 = {}; + (() => { + let t5; + if (r2.r(n2), r2.d(n2, { URI: /* @__PURE__ */ __name(() => f3, "URI"), Utils: /* @__PURE__ */ __name(() => P2, "Utils") }), "object" == typeof process) t5 = "win32" === process.platform; + else if ("object" == typeof navigator) { + let e6 = navigator.userAgent; + t5 = e6.indexOf("Windows") >= 0; + } + const e4 = /^\w[\w\d+.-]*$/, i2 = /^\//, o2 = /^\/\//; + function s2(t6, r3) { + if (!t6.scheme && r3) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t6.authority}", path: "${t6.path}", query: "${t6.query}", fragment: "${t6.fragment}"}`); + if (t6.scheme && !e4.test(t6.scheme)) throw new Error("[UriError]: Scheme contains illegal characters."); + if (t6.path) { + if (t6.authority) { + if (!i2.test(t6.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } else if (o2.test(t6.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + __name(s2, "s"); + const h2 = "", a2 = "/", c3 = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; + class f3 { + static { + __name(this, "f"); + } + static isUri(t6) { + return t6 instanceof f3 || !!t6 && "string" == typeof t6.authority && "string" == typeof t6.fragment && "string" == typeof t6.path && "string" == typeof t6.query && "string" == typeof t6.scheme && "string" == typeof t6.fsPath && "function" == typeof t6.with && "function" == typeof t6.toString; + } + scheme; + authority; + path; + query; + fragment; + constructor(t6, e6, r3, n3, i3, o3 = false) { + "object" == typeof t6 ? (this.scheme = t6.scheme || h2, this.authority = t6.authority || h2, this.path = t6.path || h2, this.query = t6.query || h2, this.fragment = t6.fragment || h2) : (this.scheme = /* @__PURE__ */ function(t7, e7) { + return t7 || e7 ? t7 : "file"; + }(t6, o3), this.authority = e6 || h2, this.path = function(t7, e7) { + switch (t7) { + case "https": + case "http": + case "file": + e7 ? e7[0] !== a2 && (e7 = a2 + e7) : e7 = a2; + } + return e7; + }(this.scheme, r3 || h2), this.query = n3 || h2, this.fragment = i3 || h2, s2(this, o3)); + } + get fsPath() { + return m2(this, false); + } + with(t6) { + if (!t6) return this; + let { scheme: e6, authority: r3, path: n3, query: i3, fragment: o3 } = t6; + return void 0 === e6 ? e6 = this.scheme : null === e6 && (e6 = h2), void 0 === r3 ? r3 = this.authority : null === r3 && (r3 = h2), void 0 === n3 ? n3 = this.path : null === n3 && (n3 = h2), void 0 === i3 ? i3 = this.query : null === i3 && (i3 = h2), void 0 === o3 ? o3 = this.fragment : null === o3 && (o3 = h2), e6 === this.scheme && r3 === this.authority && n3 === this.path && i3 === this.query && o3 === this.fragment ? this : new l2(e6, r3, n3, i3, o3); + } + static parse(t6, e6 = false) { + const r3 = c3.exec(t6); + return r3 ? new l2(r3[2] || h2, C2(r3[4] || h2), C2(r3[5] || h2), C2(r3[7] || h2), C2(r3[9] || h2), e6) : new l2(h2, h2, h2, h2, h2); + } + static file(e6) { + let r3 = h2; + if (t5 && (e6 = e6.replace(/\\/g, a2)), e6[0] === a2 && e6[1] === a2) { + const t6 = e6.indexOf(a2, 2); + -1 === t6 ? (r3 = e6.substring(2), e6 = a2) : (r3 = e6.substring(2, t6), e6 = e6.substring(t6) || a2); + } + return new l2("file", r3, e6, h2, h2); + } + static from(t6) { + const e6 = new l2(t6.scheme, t6.authority, t6.path, t6.query, t6.fragment); + return s2(e6, true), e6; + } + toString(t6 = false) { + return y5(this, t6); + } + toJSON() { + return this; + } + static revive(t6) { + if (t6) { + if (t6 instanceof f3) return t6; + { + const e6 = new l2(t6); + return e6._formatted = t6.external, e6._fsPath = t6._sep === u2 ? t6.fsPath : null, e6; + } + } + return t6; + } + } + const u2 = t5 ? 1 : void 0; + class l2 extends f3 { + static { + __name(this, "l"); + } + _formatted = null; + _fsPath = null; + get fsPath() { + return this._fsPath || (this._fsPath = m2(this, false)), this._fsPath; + } + toString(t6 = false) { + return t6 ? y5(this, true) : (this._formatted || (this._formatted = y5(this, false)), this._formatted); + } + toJSON() { + const t6 = { $mid: 1 }; + return this._fsPath && (t6.fsPath = this._fsPath, t6._sep = u2), this._formatted && (t6.external = this._formatted), this.path && (t6.path = this.path), this.scheme && (t6.scheme = this.scheme), this.authority && (t6.authority = this.authority), this.query && (t6.query = this.query), this.fragment && (t6.fragment = this.fragment), t6; + } + } + const g2 = { 58: "%3A", 47: "%2F", 63: "%3F", 35: "%23", 91: "%5B", 93: "%5D", 64: "%40", 33: "%21", 36: "%24", 38: "%26", 39: "%27", 40: "%28", 41: "%29", 42: "%2A", 43: "%2B", 44: "%2C", 59: "%3B", 61: "%3D", 32: "%20" }; + function d2(t6, e6, r3) { + let n3, i3 = -1; + for (let o3 = 0; o3 < t6.length; o3++) { + const s3 = t6.charCodeAt(o3); + if (s3 >= 97 && s3 <= 122 || s3 >= 65 && s3 <= 90 || s3 >= 48 && s3 <= 57 || 45 === s3 || 46 === s3 || 95 === s3 || 126 === s3 || e6 && 47 === s3 || r3 && 91 === s3 || r3 && 93 === s3 || r3 && 58 === s3) -1 !== i3 && (n3 += encodeURIComponent(t6.substring(i3, o3)), i3 = -1), void 0 !== n3 && (n3 += t6.charAt(o3)); + else { + void 0 === n3 && (n3 = t6.substr(0, o3)); + const e7 = g2[s3]; + void 0 !== e7 ? (-1 !== i3 && (n3 += encodeURIComponent(t6.substring(i3, o3)), i3 = -1), n3 += e7) : -1 === i3 && (i3 = o3); + } + } + return -1 !== i3 && (n3 += encodeURIComponent(t6.substring(i3))), void 0 !== n3 ? n3 : t6; + } + __name(d2, "d"); + function p3(t6) { + let e6; + for (let r3 = 0; r3 < t6.length; r3++) { + const n3 = t6.charCodeAt(r3); + 35 === n3 || 63 === n3 ? (void 0 === e6 && (e6 = t6.substr(0, r3)), e6 += g2[n3]) : void 0 !== e6 && (e6 += t6[r3]); + } + return void 0 !== e6 ? e6 : t6; + } + __name(p3, "p"); + function m2(e6, r3) { + let n3; + return n3 = e6.authority && e6.path.length > 1 && "file" === e6.scheme ? `//${e6.authority}${e6.path}` : 47 === e6.path.charCodeAt(0) && (e6.path.charCodeAt(1) >= 65 && e6.path.charCodeAt(1) <= 90 || e6.path.charCodeAt(1) >= 97 && e6.path.charCodeAt(1) <= 122) && 58 === e6.path.charCodeAt(2) ? r3 ? e6.path.substr(1) : e6.path[1].toLowerCase() + e6.path.substr(2) : e6.path, t5 && (n3 = n3.replace(/\//g, "\\")), n3; + } + __name(m2, "m"); + function y5(t6, e6) { + const r3 = e6 ? p3 : d2; + let n3 = "", { scheme: i3, authority: o3, path: s3, query: h3, fragment: c4 } = t6; + if (i3 && (n3 += i3, n3 += ":"), (o3 || "file" === i3) && (n3 += a2, n3 += a2), o3) { + let t7 = o3.indexOf("@"); + if (-1 !== t7) { + const e7 = o3.substr(0, t7); + o3 = o3.substr(t7 + 1), t7 = e7.lastIndexOf(":"), -1 === t7 ? n3 += r3(e7, false, false) : (n3 += r3(e7.substr(0, t7), false, false), n3 += ":", n3 += r3(e7.substr(t7 + 1), false, true)), n3 += "@"; + } + o3 = o3.toLowerCase(), t7 = o3.lastIndexOf(":"), -1 === t7 ? n3 += r3(o3, false, true) : (n3 += r3(o3.substr(0, t7), false, true), n3 += o3.substr(t7)); + } + if (s3) { + if (s3.length >= 3 && 47 === s3.charCodeAt(0) && 58 === s3.charCodeAt(2)) { + const t7 = s3.charCodeAt(1); + t7 >= 65 && t7 <= 90 && (s3 = `/${String.fromCharCode(t7 + 32)}:${s3.substr(3)}`); + } else if (s3.length >= 2 && 58 === s3.charCodeAt(1)) { + const t7 = s3.charCodeAt(0); + t7 >= 65 && t7 <= 90 && (s3 = `${String.fromCharCode(t7 + 32)}:${s3.substr(2)}`); + } + n3 += r3(s3, true, false); + } + return h3 && (n3 += "?", n3 += r3(h3, false, false)), c4 && (n3 += "#", n3 += e6 ? c4 : d2(c4, false, false)), n3; + } + __name(y5, "y"); + function v3(t6) { + try { + return decodeURIComponent(t6); + } catch { + return t6.length > 3 ? t6.substr(0, 3) + v3(t6.substr(3)) : t6; + } + } + __name(v3, "v"); + const b2 = /(%[0-9A-Za-z][0-9A-Za-z])+/g; + function C2(t6) { + return t6.match(b2) ? t6.replace(b2, (t7) => v3(t7)) : t6; + } + __name(C2, "C"); + var A2 = r2(470); + const w3 = A2.posix || A2, x5 = "/"; + var P2; + !function(t6) { + t6.joinPath = function(t7, ...e6) { + return t7.with({ path: w3.join(t7.path, ...e6) }); + }, t6.resolvePath = function(t7, ...e6) { + let r3 = t7.path, n3 = false; + r3[0] !== x5 && (r3 = x5 + r3, n3 = true); + let i3 = w3.resolve(r3, ...e6); + return n3 && i3[0] === x5 && !t7.authority && (i3 = i3.substring(1)), t7.with({ path: i3 }); + }, t6.dirname = function(t7) { + if (0 === t7.path.length || t7.path === x5) return t7; + let e6 = w3.dirname(t7.path); + return 1 === e6.length && 46 === e6.charCodeAt(0) && (e6 = ""), t7.with({ path: e6 }); + }, t6.basename = function(t7) { + return w3.basename(t7.path); + }, t6.extname = function(t7) { + return w3.extname(t7.path); + }; + }(P2 || (P2 = {})); + })(), LIB = n2; + })(); + ({ URI: URI2, Utils: Utils2 } = LIB); } - for (let [i2, line2] of lines.entries()) { - if (textData.textMargin !== void 0 && textData.textMargin === 0 && _textFontSize !== void 0) { - dy = i2 * _textFontSize; - } - const textElem = elem.append("text"); - textElem.attr("x", textData.x); - textElem.attr("y", yfunc()); - if (textData.anchor !== void 0) { - textElem.attr("text-anchor", textData.anchor).attr("dominant-baseline", textData.dominantBaseline).attr("alignment-baseline", textData.alignmentBaseline); - } - if (textData.fontFamily !== void 0) { - textElem.style("font-family", textData.fontFamily); - } - if (_textFontSizePx !== void 0) { - textElem.style("font-size", _textFontSizePx); - } - if (textData.fontWeight !== void 0) { - textElem.style("font-weight", textData.fontWeight); - } - if (textData.fill !== void 0) { - textElem.attr("fill", textData.fill); - } - if (textData.class !== void 0) { - textElem.attr("class", textData.class); - } - if (textData.dy !== void 0) { - textElem.attr("dy", textData.dy); - } else if (dy !== 0) { - textElem.attr("dy", dy); - } - const text2 = line2 || ZERO_WIDTH_SPACE; - if (textData.tspan) { - const span = textElem.append("tspan"); - span.attr("x", textData.x); - if (textData.fill !== void 0) { - span.attr("fill", textData.fill); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/uri-utils.js + var UriUtils; + var init_uri_utils = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/uri-utils.js"() { + "use strict"; + init_esm2(); + (function(UriUtils2) { + UriUtils2.basename = Utils2.basename; + UriUtils2.dirname = Utils2.dirname; + UriUtils2.extname = Utils2.extname; + UriUtils2.joinPath = Utils2.joinPath; + UriUtils2.resolvePath = Utils2.resolvePath; + function equals(a2, b2) { + return (a2 === null || a2 === void 0 ? void 0 : a2.toString()) === (b2 === null || b2 === void 0 ? void 0 : b2.toString()); + } + __name(equals, "equals"); + UriUtils2.equals = equals; + function relative(from2, to) { + const fromPath = typeof from2 === "string" ? from2 : from2.path; + const toPath2 = typeof to === "string" ? to : to.path; + const fromParts = fromPath.split("/").filter((e3) => e3.length > 0); + const toParts = toPath2.split("/").filter((e3) => e3.length > 0); + let i2 = 0; + for (; i2 < fromParts.length; i2++) { + if (fromParts[i2] !== toParts[i2]) { + break; + } + } + const backPart = "../".repeat(fromParts.length - i2); + const toPart = toParts.slice(i2).join("/"); + return backPart + toPart; } - span.text(text2); - } else { - textElem.text(text2); - } - if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) { - textHeight += (textElem._groups || textElem)[0][0].getBBox().height; - prevTextHeight = textHeight; - } - textElems.push(textElem); - } - return textElems; - }; - const drawLabel$2 = function(elem, txtObject) { - function genPoints(x2, y2, width2, height, cut) { - return x2 + "," + y2 + " " + (x2 + width2) + "," + y2 + " " + (x2 + width2) + "," + (y2 + height - cut) + " " + (x2 + width2 - cut * 1.2) + "," + (y2 + height) + " " + x2 + "," + (y2 + height); - } - const polygon = elem.append("polygon"); - polygon.attr("points", genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7)); - polygon.attr("class", "labelBox"); - txtObject.y = txtObject.y + txtObject.height / 2; - drawText$2(elem, txtObject); - return polygon; - }; - let actorCnt = -1; - const fixLifeLineHeights = (diagram2, actors2, actorKeys, conf2) => { - if (!diagram2.select) { - return; - } - actorKeys.forEach((actorKey) => { - const actor = actors2[actorKey]; - const actorDOM = diagram2.select("#actor" + actor.actorCnt); - if (!conf2.mirrorActors && actor.stopy) { - actorDOM.attr("y2", actor.stopy + actor.height / 2); - } else if (conf2.mirrorActors) { - actorDOM.attr("y2", actor.stopy); - } - }); - }; - const drawActorTypeParticipant = async function(elem, actor, conf2, isFooter) { - const actorY = isFooter ? actor.stopy : actor.starty; - const center2 = actor.x + actor.width / 2; - const centerY = actorY + 5; - const boxplusLineGroup = elem.append("g").lower(); - var g = boxplusLineGroup; - if (!isFooter) { - actorCnt++; - if (Object.keys(actor.links || {}).length && !conf2.forceMenus) { - g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"); - } - g.append("line").attr("id", "actor" + actorCnt).attr("x1", center2).attr("y1", centerY).attr("x2", center2).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"); - g = boxplusLineGroup.append("g"); - actor.actorCnt = actorCnt; - if (actor.links != null) { - g.attr("id", "root-" + actorCnt); - } - } - const rect2 = getNoteRect$2(); - var cssclass = "actor"; - if (actor.properties != null && actor.properties["class"]) { - cssclass = actor.properties["class"]; - } else { - rect2.fill = "#eaeaea"; - } - if (isFooter) { - cssclass += ` ${BOTTOM_ACTOR_CLASS}`; - } else { - cssclass += ` ${TOP_ACTOR_CLASS}`; - } - rect2.x = actor.x; - rect2.y = actorY; - rect2.width = actor.width; - rect2.height = actor.height; - rect2.class = cssclass; - rect2.rx = 3; - rect2.ry = 3; - rect2.name = actor.name; - const rectElem = drawRect$2(g, rect2); - actor.rectData = rect2; - if (actor.properties != null && actor.properties["icon"]) { - const iconSrc = actor.properties["icon"].trim(); - if (iconSrc.charAt(0) === "@") { - drawEmbeddedImage(g, rect2.x + rect2.width - 20, rect2.y + 10, iconSrc.substr(1)); - } else { - drawImage$1(g, rect2.x + rect2.width - 20, rect2.y + 10, iconSrc); - } - } - await _drawTextCandidateFunc$2(conf2, hasKatex(actor.description))( - actor.description, - g, - rect2.x, - rect2.y, - rect2.width, - rect2.height, - { class: "actor" }, - conf2 - ); - let height = actor.height; - if (rectElem.node) { - const bounds2 = rectElem.node().getBBox(); - actor.height = bounds2.height; - height = bounds2.height; - } - return height; - }; - const drawActorTypeActor = async function(elem, actor, conf2, isFooter) { - const actorY = isFooter ? actor.stopy : actor.starty; - const center2 = actor.x + actor.width / 2; - const centerY = actorY + 80; - elem.lower(); - if (!isFooter) { - actorCnt++; - elem.append("line").attr("id", "actor" + actorCnt).attr("x1", center2).attr("y1", centerY).attr("x2", center2).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"); - actor.actorCnt = actorCnt; - } - const actElem = elem.append("g"); - let cssClass = "actor-man"; - if (isFooter) { - cssClass += ` ${BOTTOM_ACTOR_CLASS}`; - } else { - cssClass += ` ${TOP_ACTOR_CLASS}`; - } - actElem.attr("class", cssClass); - actElem.attr("name", actor.name); - const rect2 = getNoteRect$2(); - rect2.x = actor.x; - rect2.y = actorY; - rect2.fill = "#eaeaea"; - rect2.width = actor.width; - rect2.height = actor.height; - rect2.class = "actor"; - rect2.rx = 3; - rect2.ry = 3; - actElem.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", center2).attr("y1", actorY + 25).attr("x2", center2).attr("y2", actorY + 45); - actElem.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", center2 - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 33).attr("x2", center2 + ACTOR_TYPE_WIDTH / 2).attr("y2", actorY + 33); - actElem.append("line").attr("x1", center2 - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 60).attr("x2", center2).attr("y2", actorY + 45); - actElem.append("line").attr("x1", center2).attr("y1", actorY + 45).attr("x2", center2 + ACTOR_TYPE_WIDTH / 2 - 2).attr("y2", actorY + 60); - const circle2 = actElem.append("circle"); - circle2.attr("cx", actor.x + actor.width / 2); - circle2.attr("cy", actorY + 10); - circle2.attr("r", 15); - circle2.attr("width", actor.width); - circle2.attr("height", actor.height); - const bounds2 = actElem.node().getBBox(); - actor.height = bounds2.height; - await _drawTextCandidateFunc$2(conf2, hasKatex(actor.description))( - actor.description, - actElem, - rect2.x, - rect2.y + 35, - rect2.width, - rect2.height, - { class: "actor" }, - conf2 - ); - return actor.height; - }; - const drawActor = async function(elem, actor, conf2, isFooter) { - switch (actor.type) { - case "actor": - return await drawActorTypeActor(elem, actor, conf2, isFooter); - case "participant": - return await drawActorTypeParticipant(elem, actor, conf2, isFooter); - } - }; - const drawBox = async function(elem, box, conf2) { - const boxplusTextGroup = elem.append("g"); - const g = boxplusTextGroup; - drawBackgroundRect$2(g, box); - if (box.name) { - await _drawTextCandidateFunc$2(conf2)( - box.name, - g, - box.x, - box.y + (box.textMaxHeight || 0) / 2, - box.width, - 0, - { class: "text" }, - conf2 - ); + __name(relative, "relative"); + UriUtils2.relative = relative; + })(UriUtils || (UriUtils = {})); } - g.lower(); - }; - const anchorElement = function(elem) { - return elem.append("g"); - }; - const drawActivation = function(elem, bounds2, verticalPos, conf2, actorActivations2) { - const rect2 = getNoteRect$2(); - const g = bounds2.anchored; - rect2.x = bounds2.startx; - rect2.y = bounds2.starty; - rect2.class = "activation" + actorActivations2 % 3; - rect2.width = bounds2.stopx - bounds2.startx; - rect2.height = verticalPos - bounds2.starty; - drawRect$2(g, rect2); - }; - const drawLoop = async function(elem, loopModel, labelText, conf2) { - const { - boxMargin, - boxTextMargin, - labelBoxHeight, - labelBoxWidth, - messageFontFamily: fontFamily, - messageFontSize: fontSize, - messageFontWeight: fontWeight - } = conf2; - const g = elem.append("g"); - const drawLoopLine = function(startx, starty, stopx, stopy) { - return g.append("line").attr("x1", startx).attr("y1", starty).attr("x2", stopx).attr("y2", stopy).attr("class", "loopLine"); - }; - drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty); - drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy); - drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy); - drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy); - if (loopModel.sections !== void 0) { - loopModel.sections.forEach(function(item) { - drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style( - "stroke-dasharray", - "3, 3" - ); - }); - } - let txt = getTextObj$2(); - txt.text = labelText; - txt.x = loopModel.startx; - txt.y = loopModel.starty; - txt.fontFamily = fontFamily; - txt.fontSize = fontSize; - txt.fontWeight = fontWeight; - txt.anchor = "middle"; - txt.valign = "middle"; - txt.tspan = false; - txt.width = labelBoxWidth || 50; - txt.height = labelBoxHeight || 20; - txt.textMargin = boxTextMargin; - txt.class = "labelText"; - drawLabel$2(g, txt); - txt = getTextObj$1(); - txt.text = loopModel.title; - txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2; - txt.y = loopModel.starty + boxMargin + boxTextMargin; - txt.anchor = "middle"; - txt.valign = "middle"; - txt.textMargin = boxTextMargin; - txt.class = "loopText"; - txt.fontFamily = fontFamily; - txt.fontSize = fontSize; - txt.fontWeight = fontWeight; - txt.wrap = true; - let textElem = hasKatex(txt.text) ? await drawKatex(g, txt, loopModel) : drawText$2(g, txt); - if (loopModel.sectionTitles !== void 0) { - for (const [idx, item] of Object.entries(loopModel.sectionTitles)) { - if (item.message) { - txt.text = item.message; - txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2; - txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin; - txt.class = "loopText"; - txt.anchor = "middle"; - txt.valign = "middle"; - txt.tspan = false; - txt.fontFamily = fontFamily; - txt.fontSize = fontSize; - txt.fontWeight = fontWeight; - txt.wrap = loopModel.wrap; - if (hasKatex(txt.text)) { - loopModel.starty = loopModel.sections[idx].y; - await drawKatex(g, txt, loopModel); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/documents.js + var DocumentState, DefaultLangiumDocumentFactory, DefaultLangiumDocuments; + var init_documents = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/documents.js"() { + "use strict"; + init_main2(); + init_documents(); + init_cancellation(); + init_stream(); + init_uri_utils(); + (function(DocumentState2) { + DocumentState2[DocumentState2["Changed"] = 0] = "Changed"; + DocumentState2[DocumentState2["Parsed"] = 1] = "Parsed"; + DocumentState2[DocumentState2["IndexedContent"] = 2] = "IndexedContent"; + DocumentState2[DocumentState2["ComputedScopes"] = 3] = "ComputedScopes"; + DocumentState2[DocumentState2["Linked"] = 4] = "Linked"; + DocumentState2[DocumentState2["IndexedReferences"] = 5] = "IndexedReferences"; + DocumentState2[DocumentState2["Validated"] = 6] = "Validated"; + })(DocumentState || (DocumentState = {})); + DefaultLangiumDocumentFactory = class { + static { + __name(this, "DefaultLangiumDocumentFactory"); + } + constructor(services) { + this.serviceRegistry = services.ServiceRegistry; + this.textDocuments = services.workspace.TextDocuments; + this.fileSystemProvider = services.workspace.FileSystemProvider; + } + async fromUri(uri, cancellationToken = cancellation_exports.CancellationToken.None) { + const content = await this.fileSystemProvider.readFile(uri); + return this.createAsync(uri, content, cancellationToken); + } + fromTextDocument(textDocument, uri, cancellationToken) { + uri = uri !== null && uri !== void 0 ? uri : URI2.parse(textDocument.uri); + if (cancellationToken) { + return this.createAsync(uri, textDocument, cancellationToken); } else { - drawText$2(g, txt); + return this.create(uri, textDocument); } - let sectionHeight = Math.round( - textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr) - ); - loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin); } - } - } - loopModel.height = Math.round(loopModel.stopy - loopModel.starty); - return g; - }; - const drawBackgroundRect$2 = function(elem, bounds2) { - drawBackgroundRect$3(elem, bounds2); - }; - const insertDatabaseIcon = function(elem) { - elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr( - "d", - "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z" - ); - }; - const insertComputerIcon = function(elem) { - elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( - "d", - "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z" - ); - }; - const insertClockIcon = function(elem) { - elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( - "d", - "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z" - ); - }; - const insertArrowHead = function(elem) { - elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z"); - }; - const insertArrowFilledHead = function(elem) { - elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); - }; - const insertSequenceNumber = function(elem) { - elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6); - }; - const insertArrowCrossHead = function(elem) { - const defs = elem.append("defs"); - const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5); - marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7"); - }; - const getTextObj$1 = function() { - return { - x: 0, - y: 0, - fill: void 0, - anchor: void 0, - style: "#666", - width: void 0, - height: void 0, - textMargin: 0, - rx: 0, - ry: 0, - tspan: true, - valign: void 0 - }; - }; - const getNoteRect$1 = function() { - return { - x: 0, - y: 0, - fill: "#EDF2AE", - stroke: "#666", - width: 100, - anchor: "start", - height: 100, - rx: 0, - ry: 0 - }; - }; - const _drawTextCandidateFunc$2 = function() { - function byText(content2, g, x2, y2, width2, height, textAttrs) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height / 2 + 5).style("text-anchor", "middle").text(content2); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const { actorFontSize, actorFontFamily, actorFontWeight } = conf2; - const [_actorFontSize, _actorFontSizePx] = parseFontSize(actorFontSize); - const lines = content2.split(common$1.lineBreakRegex); - for (let i2 = 0; i2 < lines.length; i2++) { - const dy = i2 * _actorFontSize - _actorFontSize * (lines.length - 1) / 2; - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2).style("text-anchor", "middle").style("font-size", _actorFontSizePx).style("font-weight", actorFontWeight).style("font-family", actorFontFamily); - text2.append("tspan").attr("x", x2 + width2 / 2).attr("dy", dy).text(lines[i2]); - text2.attr("y", y2 + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const s = g.append("switch"); - const f2 = s.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height); - const text2 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); - text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content2); - byTspan(content2, s, x2, y2, width2, height, textAttrs, conf2); - _setTextAttrs(text2, textAttrs); - } - async function byKatex(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const dim = await calculateMathMLDimensions(content2, getConfig$2()); - const s = g.append("switch"); - const f2 = s.append("foreignObject").attr("x", x2 + width2 / 2 - dim.width / 2).attr("y", y2 + height / 2 - dim.height / 2).attr("width", dim.width).attr("height", dim.height); - const text2 = f2.append("xhtml:div").style("height", "100%").style("width", "100%"); - text2.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatex(content2, getConfig$2())); - byTspan(content2, s, x2, y2, width2, height, textAttrs, conf2); - _setTextAttrs(text2, textAttrs); - } - function _setTextAttrs(toText, fromTextAttrsDict) { - for (const key in fromTextAttrsDict) { - if (fromTextAttrsDict.hasOwnProperty(key)) { - toText.attr(key, fromTextAttrsDict[key]); - } - } - } - return function(conf2, hasKatex2 = false) { - if (hasKatex2) { - return byKatex; - } - return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; - }; - }(); - const _drawMenuItemTextCandidateFunc = function() { - function byText(content2, g, x2, y2, width2, height, textAttrs) { - const text2 = g.append("text").attr("x", x2).attr("y", y2).style("text-anchor", "start").text(content2); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const { actorFontSize, actorFontFamily, actorFontWeight } = conf2; - const lines = content2.split(common$1.lineBreakRegex); - for (let i2 = 0; i2 < lines.length; i2++) { - const dy = i2 * actorFontSize - actorFontSize * (lines.length - 1) / 2; - const text2 = g.append("text").attr("x", x2).attr("y", y2).style("text-anchor", "start").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily); - text2.append("tspan").attr("x", x2).attr("dy", dy).text(lines[i2]); - text2.attr("y", y2 + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const s = g.append("switch"); - const f2 = s.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height); - const text2 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); - text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content2); - byTspan(content2, s, x2, y2, width2, height, textAttrs, conf2); - _setTextAttrs(text2, textAttrs); - } - function _setTextAttrs(toText, fromTextAttrsDict) { - for (const key in fromTextAttrsDict) { - if (fromTextAttrsDict.hasOwnProperty(key)) { - toText.attr(key, fromTextAttrsDict[key]); - } - } - } - return function(conf2) { - return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; - }; - }(); - const svgDraw$3 = { - drawRect: drawRect$2, - drawText: drawText$2, - drawLabel: drawLabel$2, - drawActor, - drawBox, - drawPopup, - anchorElement, - drawActivation, - drawLoop, - drawBackgroundRect: drawBackgroundRect$2, - insertArrowHead, - insertArrowFilledHead, - insertSequenceNumber, - insertArrowCrossHead, - insertDatabaseIcon, - insertComputerIcon, - insertClockIcon, - getTextObj: getTextObj$1, - getNoteRect: getNoteRect$1, - fixLifeLineHeights, - sanitizeUrl: dist.sanitizeUrl - }; - let conf$4 = {}; - const bounds$1 = { - data: { - startx: void 0, - stopx: void 0, - starty: void 0, - stopy: void 0 - }, - verticalPos: 0, - sequenceItems: [], - activations: [], - models: { - getHeight: function() { - return Math.max.apply( - null, - this.actors.length === 0 ? [0] : this.actors.map((actor) => actor.height || 0) - ) + (this.loops.length === 0 ? 0 : this.loops.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.messages.length === 0 ? 0 : this.messages.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.notes.length === 0 ? 0 : this.notes.map((it) => it.height || 0).reduce((acc, h) => acc + h)); - }, - clear: function() { - this.actors = []; - this.boxes = []; - this.loops = []; - this.messages = []; - this.notes = []; - }, - addBox: function(boxModel) { - this.boxes.push(boxModel); - }, - addActor: function(actorModel) { - this.actors.push(actorModel); - }, - addLoop: function(loopModel) { - this.loops.push(loopModel); - }, - addMessage: function(msgModel) { - this.messages.push(msgModel); - }, - addNote: function(noteModel) { - this.notes.push(noteModel); - }, - lastActor: function() { - return this.actors[this.actors.length - 1]; - }, - lastLoop: function() { - return this.loops[this.loops.length - 1]; - }, - lastMessage: function() { - return this.messages[this.messages.length - 1]; - }, - lastNote: function() { - return this.notes[this.notes.length - 1]; - }, - actors: [], - boxes: [], - loops: [], - messages: [], - notes: [] - }, - init: function() { - this.sequenceItems = []; - this.activations = []; - this.models.clear(); - this.data = { - startx: void 0, - stopx: void 0, - starty: void 0, - stopy: void 0 - }; - this.verticalPos = 0; - setConf$4(getConfig$1()); - }, - updateVal: function(obj, key, val, fun) { - if (obj[key] === void 0) { - obj[key] = val; - } else { - obj[key] = fun(val, obj[key]); - } - }, - updateBounds: function(startx, starty, stopx, stopy) { - const _self = this; - let cnt2 = 0; - function updateFn(type2) { - return function updateItemBounds(item) { - cnt2++; - const n = _self.sequenceItems.length - cnt2 + 1; - _self.updateVal(item, "starty", starty - n * conf$4.boxMargin, Math.min); - _self.updateVal(item, "stopy", stopy + n * conf$4.boxMargin, Math.max); - _self.updateVal(bounds$1.data, "startx", startx - n * conf$4.boxMargin, Math.min); - _self.updateVal(bounds$1.data, "stopx", stopx + n * conf$4.boxMargin, Math.max); - if (!(type2 === "activation")) { - _self.updateVal(item, "startx", startx - n * conf$4.boxMargin, Math.min); - _self.updateVal(item, "stopx", stopx + n * conf$4.boxMargin, Math.max); - _self.updateVal(bounds$1.data, "starty", starty - n * conf$4.boxMargin, Math.min); - _self.updateVal(bounds$1.data, "stopy", stopy + n * conf$4.boxMargin, Math.max); + fromString(text2, uri, cancellationToken) { + if (cancellationToken) { + return this.createAsync(uri, text2, cancellationToken); + } else { + return this.create(uri, text2); } - }; - } - this.sequenceItems.forEach(updateFn()); - this.activations.forEach(updateFn("activation")); - }, - insert: function(startx, starty, stopx, stopy) { - const _startx = common$1.getMin(startx, stopx); - const _stopx = common$1.getMax(startx, stopx); - const _starty = common$1.getMin(starty, stopy); - const _stopy = common$1.getMax(starty, stopy); - this.updateVal(bounds$1.data, "startx", _startx, Math.min); - this.updateVal(bounds$1.data, "starty", _starty, Math.min); - this.updateVal(bounds$1.data, "stopx", _stopx, Math.max); - this.updateVal(bounds$1.data, "stopy", _stopy, Math.max); - this.updateBounds(_startx, _starty, _stopx, _stopy); - }, - newActivation: function(message, diagram2, actors2) { - const actorRect = actors2[message.from.actor]; - const stackedSize = actorActivations(message.from.actor).length || 0; - const x2 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf$4.activationWidth / 2; - this.activations.push({ - startx: x2, - starty: this.verticalPos + 2, - stopx: x2 + conf$4.activationWidth, - stopy: void 0, - actor: message.from.actor, - anchored: svgDraw$3.anchorElement(diagram2) - }); - }, - endActivation: function(message) { - const lastActorActivationIdx = this.activations.map(function(activation) { - return activation.actor; - }).lastIndexOf(message.from.actor); - return this.activations.splice(lastActorActivationIdx, 1)[0]; - }, - createLoop: function(title2 = { message: void 0, wrap: false, width: void 0 }, fill) { - return { - startx: void 0, - starty: this.verticalPos, - stopx: void 0, - stopy: void 0, - title: title2.message, - wrap: title2.wrap, - width: title2.width, - height: 0, - fill + } + fromModel(model, uri) { + return this.create(uri, { $model: model }); + } + create(uri, content) { + if (typeof content === "string") { + const parseResult = this.parse(uri, content); + return this.createLangiumDocument(parseResult, uri, void 0, content); + } else if ("$model" in content) { + const parseResult = { value: content.$model, parserErrors: [], lexerErrors: [] }; + return this.createLangiumDocument(parseResult, uri); + } else { + const parseResult = this.parse(uri, content.getText()); + return this.createLangiumDocument(parseResult, uri, content); + } + } + async createAsync(uri, content, cancelToken) { + if (typeof content === "string") { + const parseResult = await this.parseAsync(uri, content, cancelToken); + return this.createLangiumDocument(parseResult, uri, void 0, content); + } else { + const parseResult = await this.parseAsync(uri, content.getText(), cancelToken); + return this.createLangiumDocument(parseResult, uri, content); + } + } + /** + * Create a LangiumDocument from a given parse result. + * + * A TextDocument is created on demand if it is not provided as argument here. Usually this + * should not be necessary because the main purpose of the TextDocument is to convert between + * text ranges and offsets, which is done solely in LSP request handling. + * + * With the introduction of {@link update} below this method is supposed to be mainly called + * during workspace initialization and on addition/recognition of new files, while changes in + * existing documents are processed via {@link update}. + */ + createLangiumDocument(parseResult, uri, textDocument, text2) { + let document2; + if (textDocument) { + document2 = { + parseResult, + uri, + state: DocumentState.Parsed, + references: [], + textDocument + }; + } else { + const textDocumentGetter = this.createTextDocumentGetter(uri, text2); + document2 = { + parseResult, + uri, + state: DocumentState.Parsed, + references: [], + get textDocument() { + return textDocumentGetter(); + } + }; + } + parseResult.value.$document = document2; + return document2; + } + async update(document2, cancellationToken) { + var _a, _b; + const oldText = (_a = document2.parseResult.value.$cstNode) === null || _a === void 0 ? void 0 : _a.root.fullText; + const textDocument = (_b = this.textDocuments) === null || _b === void 0 ? void 0 : _b.get(document2.uri.toString()); + const text2 = textDocument ? textDocument.getText() : await this.fileSystemProvider.readFile(document2.uri); + if (textDocument) { + Object.defineProperty(document2, "textDocument", { + value: textDocument + }); + } else { + const textDocumentGetter = this.createTextDocumentGetter(document2.uri, text2); + Object.defineProperty(document2, "textDocument", { + get: textDocumentGetter + }); + } + if (oldText !== text2) { + document2.parseResult = await this.parseAsync(document2.uri, text2, cancellationToken); + document2.parseResult.value.$document = document2; + } + document2.state = DocumentState.Parsed; + return document2; + } + parse(uri, text2) { + const services = this.serviceRegistry.getServices(uri); + return services.parser.LangiumParser.parse(text2); + } + parseAsync(uri, text2, cancellationToken) { + const services = this.serviceRegistry.getServices(uri); + return services.parser.AsyncParser.parse(text2, cancellationToken); + } + createTextDocumentGetter(uri, text2) { + const serviceRegistry = this.serviceRegistry; + let textDoc = void 0; + return () => { + return textDoc !== null && textDoc !== void 0 ? textDoc : textDoc = TextDocument2.create(uri.toString(), serviceRegistry.getServices(uri).LanguageMetaData.languageId, 0, text2 !== null && text2 !== void 0 ? text2 : ""); + }; + } + }; + DefaultLangiumDocuments = class { + static { + __name(this, "DefaultLangiumDocuments"); + } + constructor(services) { + this.documentMap = /* @__PURE__ */ new Map(); + this.langiumDocumentFactory = services.workspace.LangiumDocumentFactory; + } + get all() { + return stream(this.documentMap.values()); + } + addDocument(document2) { + const uriString = document2.uri.toString(); + if (this.documentMap.has(uriString)) { + throw new Error(`A document with the URI '${uriString}' is already present.`); + } + this.documentMap.set(uriString, document2); + } + getDocument(uri) { + const uriString = uri.toString(); + return this.documentMap.get(uriString); + } + async getOrCreateDocument(uri, cancellationToken) { + let document2 = this.getDocument(uri); + if (document2) { + return document2; + } + document2 = await this.langiumDocumentFactory.fromUri(uri, cancellationToken); + this.addDocument(document2); + return document2; + } + createDocument(uri, text2, cancellationToken) { + if (cancellationToken) { + return this.langiumDocumentFactory.fromString(text2, uri, cancellationToken).then((document2) => { + this.addDocument(document2); + return document2; + }); + } else { + const document2 = this.langiumDocumentFactory.fromString(text2, uri); + this.addDocument(document2); + return document2; + } + } + hasDocument(uri) { + return this.documentMap.has(uri.toString()); + } + invalidateDocument(uri) { + const uriString = uri.toString(); + const langiumDoc = this.documentMap.get(uriString); + if (langiumDoc) { + langiumDoc.state = DocumentState.Changed; + langiumDoc.precomputedScopes = void 0; + langiumDoc.references = []; + langiumDoc.diagnostics = void 0; + } + return langiumDoc; + } + deleteDocument(uri) { + const uriString = uri.toString(); + const langiumDoc = this.documentMap.get(uriString); + if (langiumDoc) { + langiumDoc.state = DocumentState.Changed; + this.documentMap.delete(uriString); + } + return langiumDoc; + } }; - }, - newLoop: function(title2 = { message: void 0, wrap: false, width: void 0 }, fill) { - this.sequenceItems.push(this.createLoop(title2, fill)); - }, - endLoop: function() { - return this.sequenceItems.pop(); - }, - isLoopOverlap: function() { - return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : false; - }, - addSectionToLoop: function(message) { - const loop = this.sequenceItems.pop(); - loop.sections = loop.sections || []; - loop.sectionTitles = loop.sectionTitles || []; - loop.sections.push({ y: bounds$1.getVerticalPos(), height: 0 }); - loop.sectionTitles.push(message); - this.sequenceItems.push(loop); - }, - saveVerticalPos: function() { - if (this.isLoopOverlap()) { - this.savedVerticalPos = this.verticalPos; - } - }, - resetVerticalPos: function() { - if (this.isLoopOverlap()) { - this.verticalPos = this.savedVerticalPos; - } - }, - bumpVerticalPos: function(bump) { - this.verticalPos = this.verticalPos + bump; - this.data.stopy = common$1.getMax(this.data.stopy, this.verticalPos); - }, - getVerticalPos: function() { - return this.verticalPos; - }, - getBounds: function() { - return { bounds: this.data, models: this.models }; - } - }; - const drawNote$2 = async function(elem, noteModel) { - bounds$1.bumpVerticalPos(conf$4.boxMargin); - noteModel.height = conf$4.boxMargin; - noteModel.starty = bounds$1.getVerticalPos(); - const rect2 = getNoteRect$2(); - rect2.x = noteModel.startx; - rect2.y = noteModel.starty; - rect2.width = noteModel.width || conf$4.width; - rect2.class = "note"; - const g = elem.append("g"); - const rectElem = svgDraw$3.drawRect(g, rect2); - const textObj = getTextObj$2(); - textObj.x = noteModel.startx; - textObj.y = noteModel.starty; - textObj.width = rect2.width; - textObj.dy = "1em"; - textObj.text = noteModel.message; - textObj.class = "noteText"; - textObj.fontFamily = conf$4.noteFontFamily; - textObj.fontSize = conf$4.noteFontSize; - textObj.fontWeight = conf$4.noteFontWeight; - textObj.anchor = conf$4.noteAlign; - textObj.textMargin = conf$4.noteMargin; - textObj.valign = "center"; - const textElem = hasKatex(textObj.text) ? await drawKatex(g, textObj) : drawText$2(g, textObj); - const textHeight = Math.round( - textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr) - ); - rectElem.attr("height", textHeight + 2 * conf$4.noteMargin); - noteModel.height += textHeight + 2 * conf$4.noteMargin; - bounds$1.bumpVerticalPos(textHeight + 2 * conf$4.noteMargin); - noteModel.stopy = noteModel.starty + textHeight + 2 * conf$4.noteMargin; - noteModel.stopx = noteModel.startx + rect2.width; - bounds$1.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy); - bounds$1.models.addNote(noteModel); - }; - const messageFont = (cnf) => { - return { - fontFamily: cnf.messageFontFamily, - fontSize: cnf.messageFontSize, - fontWeight: cnf.messageFontWeight - }; - }; - const noteFont = (cnf) => { - return { - fontFamily: cnf.noteFontFamily, - fontSize: cnf.noteFontSize, - fontWeight: cnf.noteFontWeight - }; - }; - const actorFont = (cnf) => { - return { - fontFamily: cnf.actorFontFamily, - fontSize: cnf.actorFontSize, - fontWeight: cnf.actorFontWeight - }; - }; - async function boundMessage(_diagram, msgModel) { - bounds$1.bumpVerticalPos(10); - const { startx, stopx, message } = msgModel; - const lines = common$1.splitBreaks(message).length; - const isKatexMsg = hasKatex(message); - const textDims = isKatexMsg ? await calculateMathMLDimensions(message, getConfig$1()) : utils$1.calculateTextDimensions(message, messageFont(conf$4)); - if (!isKatexMsg) { - const lineHeight = textDims.height / lines; - msgModel.height += lineHeight; - bounds$1.bumpVerticalPos(lineHeight); - } - let lineStartY; - let totalOffset = textDims.height - 10; - const textWidth = textDims.width; - if (startx === stopx) { - lineStartY = bounds$1.getVerticalPos() + totalOffset; - if (!conf$4.rightAngles) { - totalOffset += conf$4.boxMargin; - lineStartY = bounds$1.getVerticalPos() + totalOffset; - } - totalOffset += 30; - const dx = common$1.getMax(textWidth / 2, conf$4.width / 2); - bounds$1.insert( - startx - dx, - bounds$1.getVerticalPos() - 10 + totalOffset, - stopx + dx, - bounds$1.getVerticalPos() + 30 + totalOffset - ); - } else { - totalOffset += conf$4.boxMargin; - lineStartY = bounds$1.getVerticalPos() + totalOffset; - bounds$1.insert(startx, lineStartY - 10, stopx, lineStartY); - } - bounds$1.bumpVerticalPos(totalOffset); - msgModel.height += totalOffset; - msgModel.stopy = msgModel.starty + msgModel.height; - bounds$1.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy); - return lineStartY; - } - const drawMessage = async function(diagram2, msgModel, lineStartY, diagObj) { - const { startx, stopx, starty, message, type: type2, sequenceIndex, sequenceVisible } = msgModel; - const textDims = utils$1.calculateTextDimensions(message, messageFont(conf$4)); - const textObj = getTextObj$2(); - textObj.x = startx; - textObj.y = starty + 10; - textObj.width = stopx - startx; - textObj.class = "messageText"; - textObj.dy = "1em"; - textObj.text = message; - textObj.fontFamily = conf$4.messageFontFamily; - textObj.fontSize = conf$4.messageFontSize; - textObj.fontWeight = conf$4.messageFontWeight; - textObj.anchor = conf$4.messageAlign; - textObj.valign = "center"; - textObj.textMargin = conf$4.wrapPadding; - textObj.tspan = false; - hasKatex(textObj.text) ? await drawKatex(diagram2, textObj, { startx, stopx, starty: lineStartY }) : drawText$2(diagram2, textObj); - const textWidth = textDims.width; - let line2; - if (startx === stopx) { - if (conf$4.rightAngles) { - line2 = diagram2.append("path").attr( - "d", - `M ${startx},${lineStartY} H ${startx + common$1.getMax(conf$4.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}` - ); - } else { - line2 = diagram2.append("path").attr( - "d", - "M " + startx + "," + lineStartY + " C " + (startx + 60) + "," + (lineStartY - 10) + " " + (startx + 60) + "," + (lineStartY + 30) + " " + startx + "," + (lineStartY + 20) - ); - } - } else { - line2 = diagram2.append("line"); - line2.attr("x1", startx); - line2.attr("y1", lineStartY); - line2.attr("x2", stopx); - line2.attr("y2", lineStartY); - } - if (type2 === diagObj.db.LINETYPE.DOTTED || type2 === diagObj.db.LINETYPE.DOTTED_CROSS || type2 === diagObj.db.LINETYPE.DOTTED_POINT || type2 === diagObj.db.LINETYPE.DOTTED_OPEN) { - line2.style("stroke-dasharray", "3, 3"); - line2.attr("class", "messageLine1"); - } else { - line2.attr("class", "messageLine0"); - } - let url = ""; - if (conf$4.arrowMarkerAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, "\\("); - url = url.replace(/\)/g, "\\)"); - } - line2.attr("stroke-width", 2); - line2.attr("stroke", "none"); - line2.style("fill", "none"); - if (type2 === diagObj.db.LINETYPE.SOLID || type2 === diagObj.db.LINETYPE.DOTTED) { - line2.attr("marker-end", "url(" + url + "#arrowhead)"); - } - if (type2 === diagObj.db.LINETYPE.SOLID_POINT || type2 === diagObj.db.LINETYPE.DOTTED_POINT) { - line2.attr("marker-end", "url(" + url + "#filled-head)"); - } - if (type2 === diagObj.db.LINETYPE.SOLID_CROSS || type2 === diagObj.db.LINETYPE.DOTTED_CROSS) { - line2.attr("marker-end", "url(" + url + "#crosshead)"); } - if (sequenceVisible || conf$4.showSequenceNumbers) { - line2.attr("marker-start", "url(" + url + "#sequencenumber)"); - diagram2.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/linker.js + var DefaultLinker; + var init_linker = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/linker.js"() { + "use strict"; + init_cancellation(); + init_syntax_tree(); + init_ast_utils(); + init_promise_utils(); + init_documents(); + DefaultLinker = class { + static { + __name(this, "DefaultLinker"); + } + constructor(services) { + this.reflection = services.shared.AstReflection; + this.langiumDocuments = () => services.shared.workspace.LangiumDocuments; + this.scopeProvider = services.references.ScopeProvider; + this.astNodeLocator = services.workspace.AstNodeLocator; + } + async link(document2, cancelToken = cancellation_exports.CancellationToken.None) { + for (const node2 of streamAst(document2.parseResult.value)) { + await interruptAndCheck(cancelToken); + streamReferences(node2).forEach((ref) => this.doLink(ref, document2)); + } + } + doLink(refInfo, document2) { + const ref = refInfo.reference; + if (ref._ref === void 0) { + try { + const description = this.getCandidate(refInfo); + if (isLinkingError(description)) { + ref._ref = description; + } else { + ref._nodeDescription = description; + if (this.langiumDocuments().hasDocument(description.documentUri)) { + const linkedNode = this.loadAstNode(description); + ref._ref = linkedNode !== null && linkedNode !== void 0 ? linkedNode : this.createLinkingError(refInfo, description); + } + } + } catch (err) { + ref._ref = Object.assign(Object.assign({}, refInfo), { message: `An error occurred while resolving reference to '${ref.$refText}': ${err}` }); + } + } + document2.references.push(ref); + } + unlink(document2) { + for (const ref of document2.references) { + delete ref._ref; + delete ref._nodeDescription; + } + document2.references = []; + } + getCandidate(refInfo) { + const scope = this.scopeProvider.getScope(refInfo); + const description = scope.getElement(refInfo.reference.$refText); + return description !== null && description !== void 0 ? description : this.createLinkingError(refInfo); + } + buildReference(node2, property2, refNode, refText) { + const linker = this; + const reference = { + $refNode: refNode, + $refText: refText, + get ref() { + var _a; + if (isAstNode(this._ref)) { + return this._ref; + } else if (isAstNodeDescription(this._nodeDescription)) { + const linkedNode = linker.loadAstNode(this._nodeDescription); + this._ref = linkedNode !== null && linkedNode !== void 0 ? linkedNode : linker.createLinkingError({ reference, container: node2, property: property2 }, this._nodeDescription); + } else if (this._ref === void 0) { + const refData = linker.getLinkedNode({ reference, container: node2, property: property2 }); + if (refData.error && getDocument(node2).state < DocumentState.ComputedScopes) { + return void 0; + } + this._ref = (_a = refData.node) !== null && _a !== void 0 ? _a : refData.error; + this._nodeDescription = refData.descr; + } + return isAstNode(this._ref) ? this._ref : void 0; + }, + get $nodeDescription() { + return this._nodeDescription; + }, + get error() { + return isLinkingError(this._ref) ? this._ref : void 0; + } + }; + return reference; + } + getLinkedNode(refInfo) { + try { + const description = this.getCandidate(refInfo); + if (isLinkingError(description)) { + return { error: description }; + } + const linkedNode = this.loadAstNode(description); + if (linkedNode) { + return { node: linkedNode, descr: description }; + } else { + return { + descr: description, + error: this.createLinkingError(refInfo, description) + }; + } + } catch (err) { + return { + error: Object.assign(Object.assign({}, refInfo), { message: `An error occurred while resolving reference to '${refInfo.reference.$refText}': ${err}` }) + }; + } + } + loadAstNode(nodeDescription) { + if (nodeDescription.node) { + return nodeDescription.node; + } + const doc = this.langiumDocuments().getDocument(nodeDescription.documentUri); + if (!doc) { + return void 0; + } + return this.astNodeLocator.getAstNode(doc.parseResult.value, nodeDescription.path); + } + createLinkingError(refInfo, targetDescription) { + const document2 = getDocument(refInfo.container); + if (document2.state < DocumentState.ComputedScopes) { + console.warn(`Attempted reference resolution before document reached ComputedScopes state (${document2.uri}).`); + } + const referenceType = this.reflection.getReferenceType(refInfo); + return Object.assign(Object.assign({}, refInfo), { message: `Could not resolve reference to ${referenceType} named '${refInfo.reference.$refText}'.`, targetDescription }); + } + }; } - }; - const addActorRenderingData = async function(diagram2, actors2, createdActors, actorKeys, verticalPos, messages, isFooter) { - let prevWidth = 0; - let prevMargin = 0; - let prevBox = void 0; - let maxHeight = 0; - for (const actorKey of actorKeys) { - const actor = actors2[actorKey]; - const box = actor.box; - if (prevBox && prevBox != box) { - if (!isFooter) { - bounds$1.models.addBox(prevBox); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/name-provider.js + function isNamed(node2) { + return typeof node2.name === "string"; + } + var DefaultNameProvider; + var init_name_provider = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/name-provider.js"() { + "use strict"; + init_grammar_utils(); + __name(isNamed, "isNamed"); + DefaultNameProvider = class { + static { + __name(this, "DefaultNameProvider"); + } + getName(node2) { + if (isNamed(node2)) { + return node2.name; + } + return void 0; } - prevMargin += conf$4.boxMargin + prevBox.margin; - } - if (box && box != prevBox) { - if (!isFooter) { - box.x = prevWidth + prevMargin; - box.y = verticalPos; + getNameNode(node2) { + return findNodeForProperty(node2.$cstNode, "name"); } - prevMargin += box.margin; - } - actor.width = actor.width || conf$4.width; - actor.height = common$1.getMax(actor.height || conf$4.height, conf$4.height); - actor.margin = actor.margin || conf$4.actorMargin; - maxHeight = common$1.getMax(maxHeight, actor.height); - if (createdActors[actor.name]) { - prevMargin += actor.width / 2; - } - actor.x = prevWidth + prevMargin; - actor.starty = bounds$1.getVerticalPos(); - bounds$1.insert(actor.x, verticalPos, actor.x + actor.width, actor.height); - prevWidth += actor.width + prevMargin; - if (actor.box) { - actor.box.width = prevWidth + box.margin - actor.box.x; - } - prevMargin = actor.margin; - prevBox = actor.box; - bounds$1.models.addActor(actor); + }; } - if (prevBox && !isFooter) { - bounds$1.models.addBox(prevBox); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/references.js + var DefaultReferences; + var init_references = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/references.js"() { + "use strict"; + init_grammar_utils(); + init_syntax_tree(); + init_ast_utils(); + init_cst_utils(); + init_stream(); + init_uri_utils(); + DefaultReferences = class { + static { + __name(this, "DefaultReferences"); + } + constructor(services) { + this.nameProvider = services.references.NameProvider; + this.index = services.shared.workspace.IndexManager; + this.nodeLocator = services.workspace.AstNodeLocator; + } + findDeclaration(sourceCstNode) { + if (sourceCstNode) { + const assignment = findAssignment(sourceCstNode); + const nodeElem = sourceCstNode.astNode; + if (assignment && nodeElem) { + const reference = nodeElem[assignment.feature]; + if (isReference(reference)) { + return reference.ref; + } else if (Array.isArray(reference)) { + for (const ref of reference) { + if (isReference(ref) && ref.$refNode && ref.$refNode.offset <= sourceCstNode.offset && ref.$refNode.end >= sourceCstNode.end) { + return ref.ref; + } + } + } + } + if (nodeElem) { + const nameNode = this.nameProvider.getNameNode(nodeElem); + if (nameNode && (nameNode === sourceCstNode || isChildNode(sourceCstNode, nameNode))) { + return nodeElem; + } + } + } + return void 0; + } + findDeclarationNode(sourceCstNode) { + const astNode = this.findDeclaration(sourceCstNode); + if (astNode === null || astNode === void 0 ? void 0 : astNode.$cstNode) { + const targetNode = this.nameProvider.getNameNode(astNode); + return targetNode !== null && targetNode !== void 0 ? targetNode : astNode.$cstNode; + } + return void 0; + } + findReferences(targetNode, options3) { + const refs = []; + if (options3.includeDeclaration) { + const ref = this.getReferenceToSelf(targetNode); + if (ref) { + refs.push(ref); + } + } + let indexReferences = this.index.findAllReferences(targetNode, this.nodeLocator.getAstNodePath(targetNode)); + if (options3.documentUri) { + indexReferences = indexReferences.filter((ref) => UriUtils.equals(ref.sourceUri, options3.documentUri)); + } + refs.push(...indexReferences); + return stream(refs); + } + getReferenceToSelf(targetNode) { + const nameNode = this.nameProvider.getNameNode(targetNode); + if (nameNode) { + const doc = getDocument(targetNode); + const path4 = this.nodeLocator.getAstNodePath(targetNode); + return { + sourceUri: doc.uri, + sourcePath: path4, + targetUri: doc.uri, + targetPath: path4, + segment: toDocumentSegment(nameNode), + local: true + }; + } + return void 0; + } + }; } - bounds$1.bumpVerticalPos(maxHeight); - }; - const drawActors = async function(diagram2, actors2, actorKeys, isFooter) { - if (!isFooter) { - for (const actorKey of actorKeys) { - const actor = actors2[actorKey]; - await svgDraw$3.drawActor(diagram2, actor, conf$4, false); - } - } else { - let maxHeight = 0; - bounds$1.bumpVerticalPos(conf$4.boxMargin * 2); - for (const actorKey of actorKeys) { - const actor = actors2[actorKey]; - if (!actor.stopy) { - actor.stopy = bounds$1.getVerticalPos(); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/collections.js + var MultiMap, BiMap; + var init_collections = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/collections.js"() { + "use strict"; + init_stream(); + MultiMap = class { + static { + __name(this, "MultiMap"); + } + constructor(elements3) { + this.map = /* @__PURE__ */ new Map(); + if (elements3) { + for (const [key, value2] of elements3) { + this.add(key, value2); + } + } + } + /** + * The total number of values in the multimap. + */ + get size() { + return Reduction.sum(stream(this.map.values()).map((a2) => a2.length)); + } + /** + * Clear all entries in the multimap. + */ + clear() { + this.map.clear(); + } + /** + * Operates differently depending on whether a `value` is given: + * * With a value, this method deletes the specific key / value pair from the multimap. + * * Without a value, all values associated with the given key are deleted. + * + * @returns `true` if a value existed and has been removed, or `false` if the specified + * key / value does not exist. + */ + delete(key, value2) { + if (value2 === void 0) { + return this.map.delete(key); + } else { + const values2 = this.map.get(key); + if (values2) { + const index = values2.indexOf(value2); + if (index >= 0) { + if (values2.length === 1) { + this.map.delete(key); + } else { + values2.splice(index, 1); + } + return true; + } + } + return false; + } } - const height = await svgDraw$3.drawActor(diagram2, actor, conf$4, true); - maxHeight = common$1.getMax(maxHeight, height); - } - bounds$1.bumpVerticalPos(maxHeight + conf$4.boxMargin); + /** + * Returns an array of all values associated with the given key. If no value exists, + * an empty array is returned. + * + * _Note:_ The returned array is assumed not to be modified. Use the `set` method to add a + * value and `delete` to remove a value from the multimap. + */ + get(key) { + var _a; + return (_a = this.map.get(key)) !== null && _a !== void 0 ? _a : []; + } + /** + * Operates differently depending on whether a `value` is given: + * * With a value, this method returns `true` if the specific key / value pair is present in the multimap. + * * Without a value, this method returns `true` if the given key is present in the multimap. + */ + has(key, value2) { + if (value2 === void 0) { + return this.map.has(key); + } else { + const values2 = this.map.get(key); + if (values2) { + return values2.indexOf(value2) >= 0; + } + return false; + } + } + /** + * Add the given key / value pair to the multimap. + */ + add(key, value2) { + if (this.map.has(key)) { + this.map.get(key).push(value2); + } else { + this.map.set(key, [value2]); + } + return this; + } + /** + * Add the given set of key / value pairs to the multimap. + */ + addAll(key, values2) { + if (this.map.has(key)) { + this.map.get(key).push(...values2); + } else { + this.map.set(key, Array.from(values2)); + } + return this; + } + /** + * Invokes the given callback function for every key / value pair in the multimap. + */ + forEach(callbackfn) { + this.map.forEach((array4, key) => array4.forEach((value2) => callbackfn(value2, key, this))); + } + /** + * Returns an iterator of key, value pairs for every entry in the map. + */ + [Symbol.iterator]() { + return this.entries().iterator(); + } + /** + * Returns a stream of key, value pairs for every entry in the map. + */ + entries() { + return stream(this.map.entries()).flatMap(([key, array4]) => array4.map((value2) => [key, value2])); + } + /** + * Returns a stream of keys in the map. + */ + keys() { + return stream(this.map.keys()); + } + /** + * Returns a stream of values in the map. + */ + values() { + return stream(this.map.values()).flat(); + } + /** + * Returns a stream of key, value set pairs for every key in the map. + */ + entriesGroupedByKey() { + return stream(this.map.entries()); + } + }; + BiMap = class { + static { + __name(this, "BiMap"); + } + get size() { + return this.map.size; + } + constructor(elements3) { + this.map = /* @__PURE__ */ new Map(); + this.inverse = /* @__PURE__ */ new Map(); + if (elements3) { + for (const [key, value2] of elements3) { + this.set(key, value2); + } + } + } + clear() { + this.map.clear(); + this.inverse.clear(); + } + set(key, value2) { + this.map.set(key, value2); + this.inverse.set(value2, key); + return this; + } + get(key) { + return this.map.get(key); + } + getKey(value2) { + return this.inverse.get(value2); + } + delete(key) { + const value2 = this.map.get(key); + if (value2 !== void 0) { + this.map.delete(key); + this.inverse.delete(value2); + return true; + } + return false; + } + }; } - }; - const drawActorsPopup = function(diagram2, actors2, actorKeys, doc) { - let maxHeight = 0; - let maxWidth = 0; - for (const actorKey of actorKeys) { - const actor = actors2[actorKey]; - const minMenuWidth = getRequiredPopupWidth(actor); - const menuDimensions = svgDraw$3.drawPopup( - diagram2, - actor, - minMenuWidth, - conf$4, - conf$4.forceMenus, - doc - ); - if (menuDimensions.height > maxHeight) { - maxHeight = menuDimensions.height; - } - if (menuDimensions.width + actor.x > maxWidth) { - maxWidth = menuDimensions.width + actor.x; - } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-computation.js + var DefaultScopeComputation; + var init_scope_computation = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-computation.js"() { + "use strict"; + init_cancellation(); + init_ast_utils(); + init_collections(); + init_promise_utils(); + DefaultScopeComputation = class { + static { + __name(this, "DefaultScopeComputation"); + } + constructor(services) { + this.nameProvider = services.references.NameProvider; + this.descriptions = services.workspace.AstNodeDescriptionProvider; + } + async computeExports(document2, cancelToken = cancellation_exports.CancellationToken.None) { + return this.computeExportsForNode(document2.parseResult.value, document2, void 0, cancelToken); + } + /** + * Creates {@link AstNodeDescription AstNodeDescriptions} for the given {@link AstNode parentNode} and its children. + * The list of children to be considered is determined by the function parameter {@link children}. + * By default only the direct children of {@link parentNode} are visited, nested nodes are not exported. + * + * @param parentNode AST node to be exported, i.e., of which an {@link AstNodeDescription} shall be added to the returned list. + * @param document The document containing the AST node to be exported. + * @param children A function called with {@link parentNode} as single argument and returning an {@link Iterable} supplying the children to be visited, which must be directly or transitively contained in {@link parentNode}. + * @param cancelToken Indicates when to cancel the current operation. + * @throws `OperationCanceled` if a user action occurs during execution. + * @returns A list of {@link AstNodeDescription AstNodeDescriptions} to be published to index. + */ + async computeExportsForNode(parentNode, document2, children2 = streamContents, cancelToken = cancellation_exports.CancellationToken.None) { + const exports2 = []; + this.exportNode(parentNode, exports2, document2); + for (const node2 of children2(parentNode)) { + await interruptAndCheck(cancelToken); + this.exportNode(node2, exports2, document2); + } + return exports2; + } + /** + * Add a single node to the list of exports if it has a name. Override this method to change how + * symbols are exported, e.g. by modifying their exported name. + */ + exportNode(node2, exports2, document2) { + const name = this.nameProvider.getName(node2); + if (name) { + exports2.push(this.descriptions.createDescription(node2, name, document2)); + } + } + async computeLocalScopes(document2, cancelToken = cancellation_exports.CancellationToken.None) { + const rootNode = document2.parseResult.value; + const scopes = new MultiMap(); + for (const node2 of streamAllContents(rootNode)) { + await interruptAndCheck(cancelToken); + this.processNode(node2, document2, scopes); + } + return scopes; + } + /** + * Process a single node during scopes computation. The default implementation makes the node visible + * in the subtree of its container (if the node has a name). Override this method to change this, + * e.g. by increasing the visibility to a higher level in the AST. + */ + processNode(node2, document2, scopes) { + const container2 = node2.$container; + if (container2) { + const name = this.nameProvider.getName(node2); + if (name) { + scopes.add(container2, this.descriptions.createDescription(node2, name, document2)); + } + } + } + }; } - return { maxHeight, maxWidth }; - }; - const setConf$4 = function(cnf) { - assignWithDepth$1(conf$4, cnf); - if (cnf.fontFamily) { - conf$4.actorFontFamily = conf$4.noteFontFamily = conf$4.messageFontFamily = cnf.fontFamily; - } - if (cnf.fontSize) { - conf$4.actorFontSize = conf$4.noteFontSize = conf$4.messageFontSize = cnf.fontSize; - } - if (cnf.fontWeight) { - conf$4.actorFontWeight = conf$4.noteFontWeight = conf$4.messageFontWeight = cnf.fontWeight; - } - }; - const actorActivations = function(actor) { - return bounds$1.activations.filter(function(activation) { - return activation.actor === actor; - }); - }; - const activationBounds = function(actor, actors2) { - const actorObj = actors2[actor]; - const activations = actorActivations(actor); - const left2 = activations.reduce(function(acc, activation) { - return common$1.getMin(acc, activation.startx); - }, actorObj.x + actorObj.width / 2 - 1); - const right2 = activations.reduce(function(acc, activation) { - return common$1.getMax(acc, activation.stopx); - }, actorObj.x + actorObj.width / 2 + 1); - return [left2, right2]; - }; - function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) { - bounds$1.bumpVerticalPos(preMargin); - let heightAdjust = postMargin; - if (msg.id && msg.message && loopWidths[msg.id]) { - const loopWidth = loopWidths[msg.id].width; - const textConf = messageFont(conf$4); - msg.message = utils$1.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf$4.wrapPadding, textConf); - msg.width = loopWidth; - msg.wrap = true; - const textDims = utils$1.calculateTextDimensions(msg.message, textConf); - const totalOffset = common$1.getMax(textDims.height, conf$4.labelBoxHeight); - heightAdjust = postMargin + totalOffset; - log$1.debug(`${totalOffset} - ${msg.message}`); - } - addLoopFn(msg); - bounds$1.bumpVerticalPos(heightAdjust); - } - function adjustCreatedDestroyedData(msg, msgModel, lineStartY, index2, actors2, createdActors, destroyedActors) { - function receiverAdjustment(actor, adjustment) { - if (actor.x < actors2[msg.from].x) { - bounds$1.insert( - msgModel.stopx - adjustment, - msgModel.starty, - msgModel.startx, - msgModel.stopy + actor.height / 2 + conf$4.noteMargin - ); - msgModel.stopx = msgModel.stopx + adjustment; - } else { - bounds$1.insert( - msgModel.startx, - msgModel.starty, - msgModel.stopx + adjustment, - msgModel.stopy + actor.height / 2 + conf$4.noteMargin - ); - msgModel.stopx = msgModel.stopx - adjustment; - } - } - function senderAdjustment(actor, adjustment) { - if (actor.x < actors2[msg.to].x) { - bounds$1.insert( - msgModel.startx - adjustment, - msgModel.starty, - msgModel.stopx, - msgModel.stopy + actor.height / 2 + conf$4.noteMargin - ); - msgModel.startx = msgModel.startx + adjustment; - } else { - bounds$1.insert( - msgModel.stopx, - msgModel.starty, - msgModel.startx + adjustment, - msgModel.stopy + actor.height / 2 + conf$4.noteMargin - ); - msgModel.startx = msgModel.startx - adjustment; - } - } - if (createdActors[msg.to] == index2) { - const actor = actors2[msg.to]; - const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3; - receiverAdjustment(actor, adjustment); - actor.starty = lineStartY - actor.height / 2; - bounds$1.bumpVerticalPos(actor.height / 2); - } else if (destroyedActors[msg.from] == index2) { - const actor = actors2[msg.from]; - if (conf$4.mirrorActors) { - const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 : actor.width / 2; - senderAdjustment(actor, adjustment); - } - actor.stopy = lineStartY - actor.height / 2; - bounds$1.bumpVerticalPos(actor.height / 2); - } else if (destroyedActors[msg.to] == index2) { - const actor = actors2[msg.to]; - if (conf$4.mirrorActors) { - const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3; - receiverAdjustment(actor, adjustment); - } - actor.stopy = lineStartY - actor.height / 2; - bounds$1.bumpVerticalPos(actor.height / 2); - } - } - const draw$a = async function(_text, id2, _version, diagObj) { - const { securityLevel, sequence: sequence2 } = getConfig$1(); - conf$4 = sequence2; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - bounds$1.init(); - log$1.debug(diagObj.db); - const diagram2 = securityLevel === "sandbox" ? root2.select(`[id="${id2}"]`) : d3select(`[id="${id2}"]`); - const actors2 = diagObj.db.getActors(); - const createdActors = diagObj.db.getCreatedActors(); - const destroyedActors = diagObj.db.getDestroyedActors(); - const boxes = diagObj.db.getBoxes(); - let actorKeys = diagObj.db.getActorKeys(); - const messages = diagObj.db.getMessages(); - const title2 = diagObj.db.getDiagramTitle(); - const hasBoxes = diagObj.db.hasAtLeastOneBox(); - const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle(); - const maxMessageWidthPerActor = await getMaxMessageWidthPerActor(actors2, messages, diagObj); - conf$4.height = await calculateActorMargins(actors2, maxMessageWidthPerActor, boxes); - svgDraw$3.insertComputerIcon(diagram2); - svgDraw$3.insertDatabaseIcon(diagram2); - svgDraw$3.insertClockIcon(diagram2); - if (hasBoxes) { - bounds$1.bumpVerticalPos(conf$4.boxMargin); - if (hasBoxTitles) { - bounds$1.bumpVerticalPos(boxes[0].textMaxHeight); - } - } - if (conf$4.hideUnusedParticipants === true) { - const newActors = /* @__PURE__ */ new Set(); - messages.forEach((message) => { - newActors.add(message.from); - newActors.add(message.to); - }); - actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey)); - } - await addActorRenderingData(diagram2, actors2, createdActors, actorKeys, 0, messages, false); - const loopWidths = await calculateLoopBounds(messages, actors2, maxMessageWidthPerActor, diagObj); - svgDraw$3.insertArrowHead(diagram2); - svgDraw$3.insertArrowCrossHead(diagram2); - svgDraw$3.insertArrowFilledHead(diagram2); - svgDraw$3.insertSequenceNumber(diagram2); - function activeEnd(msg, verticalPos) { - const activationData = bounds$1.endActivation(msg); - if (activationData.starty + 18 > verticalPos) { - activationData.starty = verticalPos - 6; - verticalPos += 12; - } - svgDraw$3.drawActivation( - diagram2, - activationData, - verticalPos, - conf$4, - actorActivations(msg.from.actor).length - ); - bounds$1.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); - } - let sequenceIndex = 1; - let sequenceIndexStep = 1; - const messagesToDraw = []; - const backgrounds = []; - let index2 = 0; - for (const msg of messages) { - let loopModel, noteModel, msgModel; - switch (msg.type) { - case diagObj.db.LINETYPE.NOTE: - bounds$1.resetVerticalPos(); - noteModel = msg.noteModel; - await drawNote$2(diagram2, noteModel); - break; - case diagObj.db.LINETYPE.ACTIVE_START: - bounds$1.newActivation(msg, diagram2, actors2); - break; - case diagObj.db.LINETYPE.ACTIVE_END: - activeEnd(msg, bounds$1.getVerticalPos()); - break; - case diagObj.db.LINETYPE.LOOP_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message) => bounds$1.newLoop(message) - ); - break; - case diagObj.db.LINETYPE.LOOP_END: - loopModel = bounds$1.endLoop(); - await svgDraw$3.drawLoop(diagram2, loopModel, "loop", conf$4); - bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); - bounds$1.models.addLoop(loopModel); - break; - case diagObj.db.LINETYPE.RECT_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin, - (message) => bounds$1.newLoop(void 0, message.message) - ); - break; - case diagObj.db.LINETYPE.RECT_END: - loopModel = bounds$1.endLoop(); - backgrounds.push(loopModel); - bounds$1.models.addLoop(loopModel); - bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); - break; - case diagObj.db.LINETYPE.OPT_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message) => bounds$1.newLoop(message) - ); - break; - case diagObj.db.LINETYPE.OPT_END: - loopModel = bounds$1.endLoop(); - await svgDraw$3.drawLoop(diagram2, loopModel, "opt", conf$4); - bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); - bounds$1.models.addLoop(loopModel); - break; - case diagObj.db.LINETYPE.ALT_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message) => bounds$1.newLoop(message) - ); - break; - case diagObj.db.LINETYPE.ALT_ELSE: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin + conf$4.boxTextMargin, - conf$4.boxMargin, - (message) => bounds$1.addSectionToLoop(message) - ); - break; - case diagObj.db.LINETYPE.ALT_END: - loopModel = bounds$1.endLoop(); - await svgDraw$3.drawLoop(diagram2, loopModel, "alt", conf$4); - bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); - bounds$1.models.addLoop(loopModel); - break; - case diagObj.db.LINETYPE.PAR_START: - case diagObj.db.LINETYPE.PAR_OVER_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message) => bounds$1.newLoop(message) - ); - bounds$1.saveVerticalPos(); - break; - case diagObj.db.LINETYPE.PAR_AND: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin + conf$4.boxTextMargin, - conf$4.boxMargin, - (message) => bounds$1.addSectionToLoop(message) - ); - break; - case diagObj.db.LINETYPE.PAR_END: - loopModel = bounds$1.endLoop(); - await svgDraw$3.drawLoop(diagram2, loopModel, "par", conf$4); - bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); - bounds$1.models.addLoop(loopModel); - break; - case diagObj.db.LINETYPE.AUTONUMBER: - sequenceIndex = msg.message.start || sequenceIndex; - sequenceIndexStep = msg.message.step || sequenceIndexStep; - if (msg.message.visible) { - diagObj.db.enableSequenceNumbers(); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope.js + var StreamScope, MapScope, EMPTY_SCOPE; + var init_scope = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope.js"() { + "use strict"; + init_stream(); + StreamScope = class { + static { + __name(this, "StreamScope"); + } + constructor(elements3, outerScope, options3) { + var _a; + this.elements = elements3; + this.outerScope = outerScope; + this.caseInsensitive = (_a = options3 === null || options3 === void 0 ? void 0 : options3.caseInsensitive) !== null && _a !== void 0 ? _a : false; + } + getAllElements() { + if (this.outerScope) { + return this.elements.concat(this.outerScope.getAllElements()); } else { - diagObj.db.disableSequenceNumbers(); + return this.elements; } - break; - case diagObj.db.LINETYPE.CRITICAL_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message) => bounds$1.newLoop(message) - ); - break; - case diagObj.db.LINETYPE.CRITICAL_OPTION: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin + conf$4.boxTextMargin, - conf$4.boxMargin, - (message) => bounds$1.addSectionToLoop(message) - ); - break; - case diagObj.db.LINETYPE.CRITICAL_END: - loopModel = bounds$1.endLoop(); - await svgDraw$3.drawLoop(diagram2, loopModel, "critical", conf$4); - bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); - bounds$1.models.addLoop(loopModel); - break; - case diagObj.db.LINETYPE.BREAK_START: - adjustLoopHeightForWrap( - loopWidths, - msg, - conf$4.boxMargin, - conf$4.boxMargin + conf$4.boxTextMargin, - (message) => bounds$1.newLoop(message) - ); - break; - case diagObj.db.LINETYPE.BREAK_END: - loopModel = bounds$1.endLoop(); - await svgDraw$3.drawLoop(diagram2, loopModel, "break", conf$4); - bounds$1.bumpVerticalPos(loopModel.stopy - bounds$1.getVerticalPos()); - bounds$1.models.addLoop(loopModel); - break; - default: - try { - msgModel = msg.msgModel; - msgModel.starty = bounds$1.getVerticalPos(); - msgModel.sequenceIndex = sequenceIndex; - msgModel.sequenceVisible = diagObj.db.showSequenceNumbers(); - const lineStartY = await boundMessage(diagram2, msgModel); - adjustCreatedDestroyedData( - msg, - msgModel, - lineStartY, - index2, - actors2, - createdActors, - destroyedActors - ); - messagesToDraw.push({ messageModel: msgModel, lineStartY }); - bounds$1.models.addMessage(msgModel); - } catch (e) { - log$1.error("error while drawing message", e); - } - } - if ([ - diagObj.db.LINETYPE.SOLID_OPEN, - diagObj.db.LINETYPE.DOTTED_OPEN, - diagObj.db.LINETYPE.SOLID, - diagObj.db.LINETYPE.DOTTED, - diagObj.db.LINETYPE.SOLID_CROSS, - diagObj.db.LINETYPE.DOTTED_CROSS, - diagObj.db.LINETYPE.SOLID_POINT, - diagObj.db.LINETYPE.DOTTED_POINT - ].includes(msg.type)) { - sequenceIndex = sequenceIndex + sequenceIndexStep; - } - index2++; - } - log$1.debug("createdActors", createdActors); - log$1.debug("destroyedActors", destroyedActors); - await drawActors(diagram2, actors2, actorKeys, false); - for (const e of messagesToDraw) { - await drawMessage(diagram2, e.messageModel, e.lineStartY, diagObj); - } - if (conf$4.mirrorActors) { - await drawActors(diagram2, actors2, actorKeys, true); - } - backgrounds.forEach((e) => svgDraw$3.drawBackgroundRect(diagram2, e)); - fixLifeLineHeights(diagram2, actors2, actorKeys, conf$4); - for (const box2 of bounds$1.models.boxes) { - box2.height = bounds$1.getVerticalPos() - box2.y; - bounds$1.insert(box2.x, box2.y, box2.x + box2.width, box2.height); - box2.startx = box2.x; - box2.starty = box2.y; - box2.stopx = box2.startx + box2.width; - box2.stopy = box2.starty + box2.height; - box2.stroke = "rgb(0,0,0, 0.5)"; - await svgDraw$3.drawBox(diagram2, box2, conf$4); - } - if (hasBoxes) { - bounds$1.bumpVerticalPos(conf$4.boxMargin); - } - const requiredBoxSize = drawActorsPopup(diagram2, actors2, actorKeys, doc); - const { bounds: box } = bounds$1.getBounds(); - let boxHeight = box.stopy - box.starty; - if (boxHeight < requiredBoxSize.maxHeight) { - boxHeight = requiredBoxSize.maxHeight; - } - let height = boxHeight + 2 * conf$4.diagramMarginY; - if (conf$4.mirrorActors) { - height = height - conf$4.boxMargin + conf$4.bottomMarginAdj; - } - let boxWidth = box.stopx - box.startx; - if (boxWidth < requiredBoxSize.maxWidth) { - boxWidth = requiredBoxSize.maxWidth; - } - const width2 = boxWidth + 2 * conf$4.diagramMarginX; - if (title2) { - diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf$4.diagramMarginX).attr("y", -25); - } - configureSvgSize(diagram2, height, width2, conf$4.useMaxWidth); - const extraVertForTitle = title2 ? 40 : 0; - diagram2.attr( - "viewBox", - box.startx - conf$4.diagramMarginX + " -" + (conf$4.diagramMarginY + extraVertForTitle) + " " + width2 + " " + (height + extraVertForTitle) - ); - log$1.debug(`models:`, bounds$1.models); - }; - async function getMaxMessageWidthPerActor(actors2, messages, diagObj) { - const maxMessageWidthPerActor = {}; - for (const msg of messages) { - if (actors2[msg.to] && actors2[msg.from]) { - const actor = actors2[msg.to]; - if (msg.placement === diagObj.db.PLACEMENT.LEFTOF && !actor.prevActor) { - continue; } - if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF && !actor.nextActor) { - continue; + getElement(name) { + const local = this.caseInsensitive ? this.elements.find((e3) => e3.name.toLowerCase() === name.toLowerCase()) : this.elements.find((e3) => e3.name === name); + if (local) { + return local; + } + if (this.outerScope) { + return this.outerScope.getElement(name); + } + return void 0; } - const isNote = msg.placement !== void 0; - const isMessage = !isNote; - const textFont = isNote ? noteFont(conf$4) : messageFont(conf$4); - const wrappedMessage = msg.wrap ? utils$1.wrapLabel(msg.message, conf$4.width - 2 * conf$4.wrapPadding, textFont) : msg.message; - const messageDimensions = hasKatex(wrappedMessage) ? await calculateMathMLDimensions(msg.message, getConfig$1()) : utils$1.calculateTextDimensions(wrappedMessage, textFont); - const messageWidth = messageDimensions.width + 2 * conf$4.wrapPadding; - if (isMessage && msg.from === actor.nextActor) { - maxMessageWidthPerActor[msg.to] = common$1.getMax( - maxMessageWidthPerActor[msg.to] || 0, - messageWidth - ); - } else if (isMessage && msg.from === actor.prevActor) { - maxMessageWidthPerActor[msg.from] = common$1.getMax( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth - ); - } else if (isMessage && msg.from === msg.to) { - maxMessageWidthPerActor[msg.from] = common$1.getMax( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth / 2 - ); - maxMessageWidthPerActor[msg.to] = common$1.getMax( - maxMessageWidthPerActor[msg.to] || 0, - messageWidth / 2 - ); - } else if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) { - maxMessageWidthPerActor[msg.from] = common$1.getMax( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth - ); - } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) { - maxMessageWidthPerActor[actor.prevActor] = common$1.getMax( - maxMessageWidthPerActor[actor.prevActor] || 0, - messageWidth - ); - } else if (msg.placement === diagObj.db.PLACEMENT.OVER) { - if (actor.prevActor) { - maxMessageWidthPerActor[actor.prevActor] = common$1.getMax( - maxMessageWidthPerActor[actor.prevActor] || 0, - messageWidth / 2 - ); + }; + MapScope = class { + static { + __name(this, "MapScope"); + } + constructor(elements3, outerScope, options3) { + var _a; + this.elements = /* @__PURE__ */ new Map(); + this.caseInsensitive = (_a = options3 === null || options3 === void 0 ? void 0 : options3.caseInsensitive) !== null && _a !== void 0 ? _a : false; + for (const element3 of elements3) { + const name = this.caseInsensitive ? element3.name.toLowerCase() : element3.name; + this.elements.set(name, element3); } - if (actor.nextActor) { - maxMessageWidthPerActor[msg.from] = common$1.getMax( - maxMessageWidthPerActor[msg.from] || 0, - messageWidth / 2 - ); + this.outerScope = outerScope; + } + getElement(name) { + const localName = this.caseInsensitive ? name.toLowerCase() : name; + const local = this.elements.get(localName); + if (local) { + return local; + } + if (this.outerScope) { + return this.outerScope.getElement(name); } + return void 0; } - } - } - log$1.debug("maxMessageWidthPerActor:", maxMessageWidthPerActor); - return maxMessageWidthPerActor; - } - const getRequiredPopupWidth = function(actor) { - let requiredPopupWidth = 0; - const textFont = actorFont(conf$4); - for (const key in actor.links) { - const labelDimensions = utils$1.calculateTextDimensions(key, textFont); - const labelWidth = labelDimensions.width + 2 * conf$4.wrapPadding + 2 * conf$4.boxMargin; - if (requiredPopupWidth < labelWidth) { - requiredPopupWidth = labelWidth; - } - } - return requiredPopupWidth; - }; - async function calculateActorMargins(actors2, actorToMessageWidth, boxes) { - let maxHeight = 0; - for (const prop of Object.keys(actors2)) { - const actor = actors2[prop]; - if (actor.wrap) { - actor.description = utils$1.wrapLabel( - actor.description, - conf$4.width - 2 * conf$4.wrapPadding, - actorFont(conf$4) - ); - } - const actDims = hasKatex(actor.description) ? await calculateMathMLDimensions(actor.description, getConfig$1()) : utils$1.calculateTextDimensions(actor.description, actorFont(conf$4)); - actor.width = actor.wrap ? conf$4.width : common$1.getMax(conf$4.width, actDims.width + 2 * conf$4.wrapPadding); - actor.height = actor.wrap ? common$1.getMax(actDims.height, conf$4.height) : conf$4.height; - maxHeight = common$1.getMax(maxHeight, actor.height); - } - for (const actorKey in actorToMessageWidth) { - const actor = actors2[actorKey]; - if (!actor) { - continue; - } - const nextActor = actors2[actor.nextActor]; - if (!nextActor) { - const messageWidth2 = actorToMessageWidth[actorKey]; - const actorWidth2 = messageWidth2 + conf$4.actorMargin - actor.width / 2; - actor.margin = common$1.getMax(actorWidth2, conf$4.actorMargin); - continue; - } - const messageWidth = actorToMessageWidth[actorKey]; - const actorWidth = messageWidth + conf$4.actorMargin - actor.width / 2 - nextActor.width / 2; - actor.margin = common$1.getMax(actorWidth, conf$4.actorMargin); - } - let maxBoxHeight = 0; - boxes.forEach((box) => { - const textFont = messageFont(conf$4); - let totalWidth = box.actorKeys.reduce((total, aKey) => { - return total += actors2[aKey].width + (actors2[aKey].margin || 0); - }, 0); - totalWidth -= 2 * conf$4.boxTextMargin; - if (box.wrap) { - box.name = utils$1.wrapLabel(box.name, totalWidth - 2 * conf$4.wrapPadding, textFont); - } - const boxMsgDimensions = utils$1.calculateTextDimensions(box.name, textFont); - maxBoxHeight = common$1.getMax(boxMsgDimensions.height, maxBoxHeight); - const minWidth = common$1.getMax(totalWidth, boxMsgDimensions.width + 2 * conf$4.wrapPadding); - box.margin = conf$4.boxTextMargin; - if (totalWidth < minWidth) { - const missing = (minWidth - totalWidth) / 2; - box.margin += missing; - } - }); - boxes.forEach((box) => box.textMaxHeight = maxBoxHeight); - return common$1.getMax(maxHeight, conf$4.height); - } - const buildNoteModel = async function(msg, actors2, diagObj) { - const startx = actors2[msg.from].x; - const stopx = actors2[msg.to].x; - const shouldWrap = msg.wrap && msg.message; - let textDimensions = hasKatex(msg.message) ? await calculateMathMLDimensions(msg.message, getConfig$1()) : utils$1.calculateTextDimensions( - shouldWrap ? utils$1.wrapLabel(msg.message, conf$4.width, noteFont(conf$4)) : msg.message, - noteFont(conf$4) - ); - const noteModel = { - width: shouldWrap ? conf$4.width : common$1.getMax(conf$4.width, textDimensions.width + 2 * conf$4.noteMargin), - height: 0, - startx: actors2[msg.from].x, - stopx: 0, - starty: 0, - stopy: 0, - message: msg.message - }; - if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) { - noteModel.width = shouldWrap ? common$1.getMax(conf$4.width, textDimensions.width) : common$1.getMax( - actors2[msg.from].width / 2 + actors2[msg.to].width / 2, - textDimensions.width + 2 * conf$4.noteMargin - ); - noteModel.startx = startx + (actors2[msg.from].width + conf$4.actorMargin) / 2; - } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) { - noteModel.width = shouldWrap ? common$1.getMax(conf$4.width, textDimensions.width + 2 * conf$4.noteMargin) : common$1.getMax( - actors2[msg.from].width / 2 + actors2[msg.to].width / 2, - textDimensions.width + 2 * conf$4.noteMargin - ); - noteModel.startx = startx - noteModel.width + (actors2[msg.from].width - conf$4.actorMargin) / 2; - } else if (msg.to === msg.from) { - textDimensions = utils$1.calculateTextDimensions( - shouldWrap ? utils$1.wrapLabel( - msg.message, - common$1.getMax(conf$4.width, actors2[msg.from].width), - noteFont(conf$4) - ) : msg.message, - noteFont(conf$4) - ); - noteModel.width = shouldWrap ? common$1.getMax(conf$4.width, actors2[msg.from].width) : common$1.getMax( - actors2[msg.from].width, - conf$4.width, - textDimensions.width + 2 * conf$4.noteMargin - ); - noteModel.startx = startx + (actors2[msg.from].width - noteModel.width) / 2; - } else { - noteModel.width = Math.abs(startx + actors2[msg.from].width / 2 - (stopx + actors2[msg.to].width / 2)) + conf$4.actorMargin; - noteModel.startx = startx < stopx ? startx + actors2[msg.from].width / 2 - conf$4.actorMargin / 2 : stopx + actors2[msg.to].width / 2 - conf$4.actorMargin / 2; - } - if (shouldWrap) { - noteModel.message = utils$1.wrapLabel( - msg.message, - noteModel.width - 2 * conf$4.wrapPadding, - noteFont(conf$4) - ); - } - log$1.debug( - `NM:[${noteModel.startx},${noteModel.stopx},${noteModel.starty},${noteModel.stopy}:${noteModel.width},${noteModel.height}=${msg.message}]` - ); - return noteModel; - }; - const buildMessageModel = function(msg, actors2, diagObj) { - if (![ - diagObj.db.LINETYPE.SOLID_OPEN, - diagObj.db.LINETYPE.DOTTED_OPEN, - diagObj.db.LINETYPE.SOLID, - diagObj.db.LINETYPE.DOTTED, - diagObj.db.LINETYPE.SOLID_CROSS, - diagObj.db.LINETYPE.DOTTED_CROSS, - diagObj.db.LINETYPE.SOLID_POINT, - diagObj.db.LINETYPE.DOTTED_POINT - ].includes(msg.type)) { - return {}; - } - const [fromLeft, fromRight] = activationBounds(msg.from, actors2); - const [toLeft, toRight] = activationBounds(msg.to, actors2); - const isArrowToRight = fromLeft <= toLeft; - const startx = isArrowToRight ? fromRight : fromLeft; - let stopx = isArrowToRight ? toLeft : toRight; - const isArrowToActivation = Math.abs(toLeft - toRight) > 2; - const adjustValue = (value2) => { - return isArrowToRight ? -value2 : value2; - }; - if (msg.from === msg.to) { - stopx = startx; - } else { - if (msg.activate && !isArrowToActivation) { - stopx += adjustValue(conf$4.activationWidth / 2 - 1); - } - if (![diagObj.db.LINETYPE.SOLID_OPEN, diagObj.db.LINETYPE.DOTTED_OPEN].includes(msg.type)) { - stopx += adjustValue(3); - } - } - const allBounds = [fromLeft, fromRight, toLeft, toRight]; - const boundedWidth = Math.abs(startx - stopx); - if (msg.wrap && msg.message) { - msg.message = utils$1.wrapLabel( - msg.message, - common$1.getMax(boundedWidth + 2 * conf$4.wrapPadding, conf$4.width), - messageFont(conf$4) - ); + getAllElements() { + let elementStream = stream(this.elements.values()); + if (this.outerScope) { + elementStream = elementStream.concat(this.outerScope.getAllElements()); + } + return elementStream; + } + }; + EMPTY_SCOPE = { + getElement() { + return void 0; + }, + getAllElements() { + return EMPTY_STREAM; + } + }; } - const msgDims = utils$1.calculateTextDimensions(msg.message, messageFont(conf$4)); - return { - width: common$1.getMax( - msg.wrap ? 0 : msgDims.width + 2 * conf$4.wrapPadding, - boundedWidth + 2 * conf$4.wrapPadding, - conf$4.width - ), - height: 0, - startx, - stopx, - starty: 0, - stopy: 0, - message: msg.message, - type: msg.type, - wrap: msg.wrap, - fromBounds: Math.min.apply(null, allBounds), - toBounds: Math.max.apply(null, allBounds) - }; - }; - const calculateLoopBounds = async function(messages, actors2, _maxWidthPerActor, diagObj) { - const loops = {}; - const stack = []; - let current, noteModel, msgModel; - for (const msg of messages) { - msg.id = utils$1.random({ length: 10 }); - switch (msg.type) { - case diagObj.db.LINETYPE.LOOP_START: - case diagObj.db.LINETYPE.ALT_START: - case diagObj.db.LINETYPE.OPT_START: - case diagObj.db.LINETYPE.PAR_START: - case diagObj.db.LINETYPE.PAR_OVER_START: - case diagObj.db.LINETYPE.CRITICAL_START: - case diagObj.db.LINETYPE.BREAK_START: - stack.push({ - id: msg.id, - msg: msg.message, - from: Number.MAX_SAFE_INTEGER, - to: Number.MIN_SAFE_INTEGER, - width: 0 - }); - break; - case diagObj.db.LINETYPE.ALT_ELSE: - case diagObj.db.LINETYPE.PAR_AND: - case diagObj.db.LINETYPE.CRITICAL_OPTION: - if (msg.message) { - current = stack.pop(); - loops[current.id] = current; - loops[msg.id] = current; - stack.push(current); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/caching.js + var DisposableCache, SimpleCache, ContextCache, DocumentCache, WorkspaceCache; + var init_caching = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/caching.js"() { + "use strict"; + DisposableCache = class { + static { + __name(this, "DisposableCache"); + } + constructor() { + this.toDispose = []; + this.isDisposed = false; + } + onDispose(disposable) { + this.toDispose.push(disposable); + } + dispose() { + this.throwIfDisposed(); + this.clear(); + this.isDisposed = true; + this.toDispose.forEach((disposable) => disposable.dispose()); + } + throwIfDisposed() { + if (this.isDisposed) { + throw new Error("This cache has already been disposed"); + } + } + }; + SimpleCache = class extends DisposableCache { + static { + __name(this, "SimpleCache"); + } + constructor() { + super(...arguments); + this.cache = /* @__PURE__ */ new Map(); + } + has(key) { + this.throwIfDisposed(); + return this.cache.has(key); + } + set(key, value2) { + this.throwIfDisposed(); + this.cache.set(key, value2); + } + get(key, provider) { + this.throwIfDisposed(); + if (this.cache.has(key)) { + return this.cache.get(key); + } else if (provider) { + const value2 = provider(); + this.cache.set(key, value2); + return value2; + } else { + return void 0; } - break; - case diagObj.db.LINETYPE.LOOP_END: - case diagObj.db.LINETYPE.ALT_END: - case diagObj.db.LINETYPE.OPT_END: - case diagObj.db.LINETYPE.PAR_END: - case diagObj.db.LINETYPE.CRITICAL_END: - case diagObj.db.LINETYPE.BREAK_END: - current = stack.pop(); - loops[current.id] = current; - break; - case diagObj.db.LINETYPE.ACTIVE_START: - { - const actorRect = actors2[msg.from ? msg.from.actor : msg.to.actor]; - const stackedSize = actorActivations(msg.from ? msg.from.actor : msg.to.actor).length; - const x2 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf$4.activationWidth / 2; - const toAdd = { - startx: x2, - stopx: x2 + conf$4.activationWidth, - actor: msg.from.actor, - enabled: true - }; - bounds$1.activations.push(toAdd); + } + delete(key) { + this.throwIfDisposed(); + return this.cache.delete(key); + } + clear() { + this.throwIfDisposed(); + this.cache.clear(); + } + }; + ContextCache = class extends DisposableCache { + static { + __name(this, "ContextCache"); + } + constructor(converter) { + super(); + this.cache = /* @__PURE__ */ new Map(); + this.converter = converter !== null && converter !== void 0 ? converter : (value2) => value2; + } + has(contextKey, key) { + this.throwIfDisposed(); + return this.cacheForContext(contextKey).has(key); + } + set(contextKey, key, value2) { + this.throwIfDisposed(); + this.cacheForContext(contextKey).set(key, value2); + } + get(contextKey, key, provider) { + this.throwIfDisposed(); + const contextCache = this.cacheForContext(contextKey); + if (contextCache.has(key)) { + return contextCache.get(key); + } else if (provider) { + const value2 = provider(); + contextCache.set(key, value2); + return value2; + } else { + return void 0; } - break; - case diagObj.db.LINETYPE.ACTIVE_END: - { - const lastActorActivationIdx = bounds$1.activations.map((a) => a.actor).lastIndexOf(msg.from.actor); - delete bounds$1.activations.splice(lastActorActivationIdx, 1)[0]; + } + delete(contextKey, key) { + this.throwIfDisposed(); + return this.cacheForContext(contextKey).delete(key); + } + clear(contextKey) { + this.throwIfDisposed(); + if (contextKey) { + const mapKey = this.converter(contextKey); + this.cache.delete(mapKey); + } else { + this.cache.clear(); } - break; - } - const isNote = msg.placement !== void 0; - if (isNote) { - noteModel = await buildNoteModel(msg, actors2, diagObj); - msg.noteModel = noteModel; - stack.forEach((stk) => { - current = stk; - current.from = common$1.getMin(current.from, noteModel.startx); - current.to = common$1.getMax(current.to, noteModel.startx + noteModel.width); - current.width = common$1.getMax(current.width, Math.abs(current.from - current.to)) - conf$4.labelBoxWidth; - }); - } else { - msgModel = buildMessageModel(msg, actors2, diagObj); - msg.msgModel = msgModel; - if (msgModel.startx && msgModel.stopx && stack.length > 0) { - stack.forEach((stk) => { - current = stk; - if (msgModel.startx === msgModel.stopx) { - const from2 = actors2[msg.from]; - const to = actors2[msg.to]; - current.from = common$1.getMin( - from2.x - msgModel.width / 2, - from2.x - from2.width / 2, - current.from - ); - current.to = common$1.getMax( - to.x + msgModel.width / 2, - to.x + from2.width / 2, - current.to - ); - current.width = common$1.getMax(current.width, Math.abs(current.to - current.from)) - conf$4.labelBoxWidth; - } else { - current.from = common$1.getMin(msgModel.startx, current.from); - current.to = common$1.getMax(msgModel.stopx, current.to); - current.width = common$1.getMax(current.width, msgModel.width) - conf$4.labelBoxWidth; + } + cacheForContext(contextKey) { + const mapKey = this.converter(contextKey); + let documentCache = this.cache.get(mapKey); + if (!documentCache) { + documentCache = /* @__PURE__ */ new Map(); + this.cache.set(mapKey, documentCache); + } + return documentCache; + } + }; + DocumentCache = class extends ContextCache { + static { + __name(this, "DocumentCache"); + } + constructor(sharedServices) { + super((uri) => uri.toString()); + this.onDispose(sharedServices.workspace.DocumentBuilder.onUpdate((changed, deleted) => { + const allUris = changed.concat(deleted); + for (const uri of allUris) { + this.clear(uri); } - }); + })); } - } - } - bounds$1.activations = []; - log$1.debug("Loop type widths:", loops); - return loops; - }; - const renderer$a = { - bounds: bounds$1, - drawActors, - drawActorsPopup, - setConf: setConf$4, - draw: draw$a - }; - const diagram$a = { - parser: parser$f, - db: db$9, - renderer: renderer$a, - styles: styles$6, - init: ({ wrap: wrap2 }) => { - db$9.setWrap(wrap2); - } - }; - const sequenceDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$a - }, Symbol.toStringTag, { value: "Module" })); - var parser$c = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 17], $V1 = [1, 18], $V2 = [1, 19], $V3 = [1, 39], $V4 = [1, 40], $V5 = [1, 25], $V6 = [1, 23], $V7 = [1, 24], $V8 = [1, 31], $V9 = [1, 32], $Va = [1, 33], $Vb = [1, 34], $Vc = [1, 35], $Vd = [1, 36], $Ve = [1, 26], $Vf = [1, 27], $Vg = [1, 28], $Vh = [1, 29], $Vi = [1, 43], $Vj = [1, 30], $Vk = [1, 42], $Vl = [1, 44], $Vm = [1, 41], $Vn = [1, 45], $Vo = [1, 9], $Vp = [1, 8, 9], $Vq = [1, 56], $Vr = [1, 57], $Vs = [1, 58], $Vt = [1, 59], $Vu = [1, 60], $Vv = [1, 61], $Vw = [1, 62], $Vx = [1, 8, 9, 39], $Vy = [1, 74], $Vz = [1, 8, 9, 12, 13, 21, 37, 39, 42, 59, 60, 61, 62, 63, 64, 65, 70, 72], $VA = [1, 8, 9, 12, 13, 19, 21, 37, 39, 42, 46, 59, 60, 61, 62, 63, 64, 65, 70, 72, 74, 80, 95, 97, 98], $VB = [13, 74, 80, 95, 97, 98], $VC = [13, 64, 65, 74, 80, 95, 97, 98], $VD = [13, 59, 60, 61, 62, 63, 74, 80, 95, 97, 98], $VE = [1, 93], $VF = [1, 110], $VG = [1, 108], $VH = [1, 102], $VI = [1, 103], $VJ = [1, 104], $VK = [1, 105], $VL = [1, 106], $VM = [1, 107], $VN = [1, 109], $VO = [1, 8, 9, 37, 39, 42], $VP = [1, 8, 9, 21], $VQ = [1, 8, 9, 78], $VR = [1, 8, 9, 21, 73, 74, 78, 80, 81, 82, 83, 84, 85]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "statements": 5, "graphConfig": 6, "CLASS_DIAGRAM": 7, "NEWLINE": 8, "EOF": 9, "statement": 10, "classLabel": 11, "SQS": 12, "STR": 13, "SQE": 14, "namespaceName": 15, "alphaNumToken": 16, "className": 17, "classLiteralName": 18, "GENERICTYPE": 19, "relationStatement": 20, "LABEL": 21, "namespaceStatement": 22, "classStatement": 23, "memberStatement": 24, "annotationStatement": 25, "clickStatement": 26, "styleStatement": 27, "cssClassStatement": 28, "noteStatement": 29, "direction": 30, "acc_title": 31, "acc_title_value": 32, "acc_descr": 33, "acc_descr_value": 34, "acc_descr_multiline_value": 35, "namespaceIdentifier": 36, "STRUCT_START": 37, "classStatements": 38, "STRUCT_STOP": 39, "NAMESPACE": 40, "classIdentifier": 41, "STYLE_SEPARATOR": 42, "members": 43, "CLASS": 44, "ANNOTATION_START": 45, "ANNOTATION_END": 46, "MEMBER": 47, "SEPARATOR": 48, "relation": 49, "NOTE_FOR": 50, "noteText": 51, "NOTE": 52, "direction_tb": 53, "direction_bt": 54, "direction_rl": 55, "direction_lr": 56, "relationType": 57, "lineType": 58, "AGGREGATION": 59, "EXTENSION": 60, "COMPOSITION": 61, "DEPENDENCY": 62, "LOLLIPOP": 63, "LINE": 64, "DOTTED_LINE": 65, "CALLBACK": 66, "LINK": 67, "LINK_TARGET": 68, "CLICK": 69, "CALLBACK_NAME": 70, "CALLBACK_ARGS": 71, "HREF": 72, "STYLE": 73, "ALPHA": 74, "stylesOpt": 75, "CSSCLASS": 76, "style": 77, "COMMA": 78, "styleComponent": 79, "NUM": 80, "COLON": 81, "UNIT": 82, "SPACE": 83, "BRKT": 84, "PCT": 85, "commentToken": 86, "textToken": 87, "graphCodeTokens": 88, "textNoTagsToken": 89, "TAGSTART": 90, "TAGEND": 91, "==": 92, "--": 93, "DEFAULT": 94, "MINUS": 95, "keywords": 96, "UNICODE_TEXT": 97, "BQUOTE_STR": 98, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 7: "CLASS_DIAGRAM", 8: "NEWLINE", 9: "EOF", 12: "SQS", 13: "STR", 14: "SQE", 19: "GENERICTYPE", 21: "LABEL", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 37: "STRUCT_START", 39: "STRUCT_STOP", 40: "NAMESPACE", 42: "STYLE_SEPARATOR", 44: "CLASS", 45: "ANNOTATION_START", 46: "ANNOTATION_END", 47: "MEMBER", 48: "SEPARATOR", 50: "NOTE_FOR", 52: "NOTE", 53: "direction_tb", 54: "direction_bt", 55: "direction_rl", 56: "direction_lr", 59: "AGGREGATION", 60: "EXTENSION", 61: "COMPOSITION", 62: "DEPENDENCY", 63: "LOLLIPOP", 64: "LINE", 65: "DOTTED_LINE", 66: "CALLBACK", 67: "LINK", 68: "LINK_TARGET", 69: "CLICK", 70: "CALLBACK_NAME", 71: "CALLBACK_ARGS", 72: "HREF", 73: "STYLE", 74: "ALPHA", 76: "CSSCLASS", 78: "COMMA", 80: "NUM", 81: "COLON", 82: "UNIT", 83: "SPACE", 84: "BRKT", 85: "PCT", 88: "graphCodeTokens", 90: "TAGSTART", 91: "TAGEND", 92: "==", 93: "--", 94: "DEFAULT", 95: "MINUS", 96: "keywords", 97: "UNICODE_TEXT", 98: "BQUOTE_STR" }, - productions_: [0, [3, 1], [3, 1], [4, 1], [6, 4], [5, 1], [5, 2], [5, 3], [11, 3], [15, 1], [15, 2], [17, 1], [17, 1], [17, 2], [17, 2], [17, 2], [10, 1], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [22, 4], [22, 5], [36, 2], [38, 1], [38, 2], [38, 3], [23, 1], [23, 3], [23, 4], [23, 6], [41, 2], [41, 3], [25, 4], [43, 1], [43, 2], [24, 1], [24, 2], [24, 1], [24, 1], [20, 3], [20, 4], [20, 4], [20, 5], [29, 3], [29, 2], [30, 1], [30, 1], [30, 1], [30, 1], [49, 3], [49, 2], [49, 2], [49, 1], [57, 1], [57, 1], [57, 1], [57, 1], [57, 1], [58, 1], [58, 1], [26, 3], [26, 4], [26, 3], [26, 4], [26, 4], [26, 5], [26, 3], [26, 4], [26, 4], [26, 5], [26, 4], [26, 5], [26, 5], [26, 6], [27, 3], [28, 3], [75, 1], [75, 3], [77, 1], [77, 2], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [86, 1], [86, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [89, 1], [89, 1], [89, 1], [89, 1], [16, 1], [16, 1], [16, 1], [16, 1], [18, 1], [51, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 8: - this.$ = $$[$0 - 1]; - break; - case 9: - case 11: - case 12: - this.$ = $$[$0]; - break; - case 10: - case 13: - this.$ = $$[$0 - 1] + $$[$0]; - break; - case 14: - case 15: - this.$ = $$[$0 - 1] + "~" + $$[$0] + "~"; - break; - case 16: - yy.addRelation($$[$0]); - break; - case 17: - $$[$0 - 1].title = yy.cleanupLabel($$[$0]); - yy.addRelation($$[$0 - 1]); - break; - case 27: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 28: - case 29: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 30: - yy.addClassesToNamespace($$[$0 - 3], $$[$0 - 1]); - break; - case 31: - yy.addClassesToNamespace($$[$0 - 4], $$[$0 - 1]); - break; - case 32: - this.$ = $$[$0]; - yy.addNamespace($$[$0]); - break; - case 33: - this.$ = [$$[$0]]; - break; - case 34: - this.$ = [$$[$0 - 1]]; - break; - case 35: - $$[$0].unshift($$[$0 - 2]); - this.$ = $$[$0]; - break; - case 37: - yy.setCssClass($$[$0 - 2], $$[$0]); - break; - case 38: - yy.addMembers($$[$0 - 3], $$[$0 - 1]); - break; - case 39: - yy.setCssClass($$[$0 - 5], $$[$0 - 3]); - yy.addMembers($$[$0 - 5], $$[$0 - 1]); - break; - case 40: - this.$ = $$[$0]; - yy.addClass($$[$0]); - break; - case 41: - this.$ = $$[$0 - 1]; - yy.addClass($$[$0 - 1]); - yy.setClassLabel($$[$0 - 1], $$[$0]); - break; - case 42: - yy.addAnnotation($$[$0], $$[$0 - 2]); - break; - case 43: - this.$ = [$$[$0]]; - break; - case 44: - $$[$0].push($$[$0 - 1]); - this.$ = $$[$0]; - break; - case 45: - break; - case 46: - yy.addMember($$[$0 - 1], yy.cleanupLabel($$[$0])); - break; - case 47: - break; - case 48: - break; - case 49: - this.$ = { "id1": $$[$0 - 2], "id2": $$[$0], relation: $$[$0 - 1], relationTitle1: "none", relationTitle2: "none" }; - break; - case 50: - this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: "none" }; - break; - case 51: - this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: "none", relationTitle2: $$[$0 - 1] }; - break; - case 52: - this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] }; - break; - case 53: - yy.addNote($$[$0], $$[$0 - 1]); - break; - case 54: - yy.addNote($$[$0]); - break; - case 55: - yy.setDirection("TB"); - break; - case 56: - yy.setDirection("BT"); - break; - case 57: - yy.setDirection("RL"); - break; - case 58: - yy.setDirection("LR"); - break; - case 59: - this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] }; - break; - case 60: - this.$ = { type1: "none", type2: $$[$0], lineType: $$[$0 - 1] }; - break; - case 61: - this.$ = { type1: $$[$0 - 1], type2: "none", lineType: $$[$0] }; - break; - case 62: - this.$ = { type1: "none", type2: "none", lineType: $$[$0] }; - break; - case 63: - this.$ = yy.relationType.AGGREGATION; - break; - case 64: - this.$ = yy.relationType.EXTENSION; - break; - case 65: - this.$ = yy.relationType.COMPOSITION; - break; - case 66: - this.$ = yy.relationType.DEPENDENCY; - break; - case 67: - this.$ = yy.relationType.LOLLIPOP; - break; - case 68: - this.$ = yy.lineType.LINE; - break; - case 69: - this.$ = yy.lineType.DOTTED_LINE; - break; - case 70: - case 76: - this.$ = $$[$0 - 2]; - yy.setClickEvent($$[$0 - 1], $$[$0]); - break; - case 71: - case 77: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1]); - yy.setTooltip($$[$0 - 2], $$[$0]); - break; - case 72: - this.$ = $$[$0 - 2]; - yy.setLink($$[$0 - 1], $$[$0]); - break; - case 73: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 74: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 2], $$[$0 - 1]); - yy.setTooltip($$[$0 - 2], $$[$0]); - break; - case 75: - this.$ = $$[$0 - 4]; - yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); - yy.setTooltip($$[$0 - 3], $$[$0 - 1]); - break; - case 78: - this.$ = $$[$0 - 3]; - yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); - break; - case 79: - this.$ = $$[$0 - 4]; - yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); - yy.setTooltip($$[$0 - 3], $$[$0]); - break; - case 80: - this.$ = $$[$0 - 3]; - yy.setLink($$[$0 - 2], $$[$0]); - break; - case 81: - this.$ = $$[$0 - 4]; - yy.setLink($$[$0 - 3], $$[$0 - 1], $$[$0]); - break; - case 82: - this.$ = $$[$0 - 4]; - yy.setLink($$[$0 - 3], $$[$0 - 1]); - yy.setTooltip($$[$0 - 3], $$[$0]); - break; - case 83: - this.$ = $$[$0 - 5]; - yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]); - yy.setTooltip($$[$0 - 4], $$[$0 - 1]); - break; - case 84: - this.$ = $$[$0 - 2]; - yy.setCssStyle($$[$0 - 1], $$[$0]); - break; - case 85: - yy.setCssClass($$[$0 - 1], $$[$0]); - break; - case 86: - this.$ = [$$[$0]]; - break; - case 87: - $$[$0 - 2].push($$[$0]); - this.$ = $$[$0 - 2]; - break; - case 89: - this.$ = $$[$0 - 1] + $$[$0]; - break; + }; + WorkspaceCache = class extends SimpleCache { + static { + __name(this, "WorkspaceCache"); } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: [1, 6], 10: 5, 16: 37, 17: 20, 18: 38, 20: 7, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 27: 13, 28: 14, 29: 15, 30: 16, 31: $V0, 33: $V1, 35: $V2, 36: 21, 40: $V3, 41: 22, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, o($Vo, [2, 5], { 8: [1, 46] }), { 8: [1, 47] }, o($Vp, [2, 16], { 21: [1, 48] }), o($Vp, [2, 18]), o($Vp, [2, 19]), o($Vp, [2, 20]), o($Vp, [2, 21]), o($Vp, [2, 22]), o($Vp, [2, 23]), o($Vp, [2, 24]), o($Vp, [2, 25]), o($Vp, [2, 26]), { 32: [1, 49] }, { 34: [1, 50] }, o($Vp, [2, 29]), o($Vp, [2, 45], { 49: 51, 57: 54, 58: 55, 13: [1, 52], 21: [1, 53], 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu, 64: $Vv, 65: $Vw }), { 37: [1, 63] }, o($Vx, [2, 36], { 37: [1, 65], 42: [1, 64] }), o($Vp, [2, 47]), o($Vp, [2, 48]), { 16: 66, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 16: 37, 17: 67, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 16: 37, 17: 68, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 16: 37, 17: 69, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 74: [1, 70] }, { 13: [1, 71] }, { 16: 37, 17: 72, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 13: $Vy, 51: 73 }, o($Vp, [2, 55]), o($Vp, [2, 56]), o($Vp, [2, 57]), o($Vp, [2, 58]), o($Vz, [2, 11], { 16: 37, 18: 38, 17: 75, 19: [1, 76], 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }), o($Vz, [2, 12], { 19: [1, 77] }), { 15: 78, 16: 79, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 16: 37, 17: 80, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o($VA, [2, 112]), o($VA, [2, 113]), o($VA, [2, 114]), o($VA, [2, 115]), o([1, 8, 9, 12, 13, 19, 21, 37, 39, 42, 59, 60, 61, 62, 63, 64, 65, 70, 72], [2, 116]), o($Vo, [2, 6], { 10: 5, 20: 7, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 27: 13, 28: 14, 29: 15, 30: 16, 17: 20, 36: 21, 41: 22, 16: 37, 18: 38, 5: 81, 31: $V0, 33: $V1, 35: $V2, 40: $V3, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }), { 5: 82, 10: 5, 16: 37, 17: 20, 18: 38, 20: 7, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 27: 13, 28: 14, 29: 15, 30: 16, 31: $V0, 33: $V1, 35: $V2, 36: 21, 40: $V3, 41: 22, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o($Vp, [2, 17]), o($Vp, [2, 27]), o($Vp, [2, 28]), { 13: [1, 84], 16: 37, 17: 83, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 49: 85, 57: 54, 58: 55, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu, 64: $Vv, 65: $Vw }, o($Vp, [2, 46]), { 58: 86, 64: $Vv, 65: $Vw }, o($VB, [2, 62], { 57: 87, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu }), o($VC, [2, 63]), o($VC, [2, 64]), o($VC, [2, 65]), o($VC, [2, 66]), o($VC, [2, 67]), o($VD, [2, 68]), o($VD, [2, 69]), { 8: [1, 89], 23: 90, 38: 88, 41: 22, 44: $V4 }, { 16: 91, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 43: 92, 47: $VE }, { 46: [1, 94] }, { 13: [1, 95] }, { 13: [1, 96] }, { 70: [1, 97], 72: [1, 98] }, { 21: $VF, 73: $VG, 74: $VH, 75: 99, 77: 100, 79: 101, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }, { 74: [1, 111] }, { 13: $Vy, 51: 112 }, o($Vp, [2, 54]), o($Vp, [2, 117]), o($Vz, [2, 13]), o($Vz, [2, 14]), o($Vz, [2, 15]), { 37: [2, 32] }, { 15: 113, 16: 79, 37: [2, 9], 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, o($VO, [2, 40], { 11: 114, 12: [1, 115] }), o($Vo, [2, 7]), { 9: [1, 116] }, o($VP, [2, 49]), { 16: 37, 17: 117, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 13: [1, 119], 16: 37, 17: 118, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o($VB, [2, 61], { 57: 120, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu }), o($VB, [2, 60]), { 39: [1, 121] }, { 23: 90, 38: 122, 41: 22, 44: $V4 }, { 8: [1, 123], 39: [2, 33] }, o($Vx, [2, 37], { 37: [1, 124] }), { 39: [1, 125] }, { 39: [2, 43], 43: 126, 47: $VE }, { 16: 37, 17: 127, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o($Vp, [2, 70], { 13: [1, 128] }), o($Vp, [2, 72], { 13: [1, 130], 68: [1, 129] }), o($Vp, [2, 76], { 13: [1, 131], 71: [1, 132] }), { 13: [1, 133] }, o($Vp, [2, 84], { 78: [1, 134] }), o($VQ, [2, 86], { 79: 135, 21: $VF, 73: $VG, 74: $VH, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }), o($VR, [2, 88]), o($VR, [2, 90]), o($VR, [2, 91]), o($VR, [2, 92]), o($VR, [2, 93]), o($VR, [2, 94]), o($VR, [2, 95]), o($VR, [2, 96]), o($VR, [2, 97]), o($VR, [2, 98]), o($Vp, [2, 85]), o($Vp, [2, 53]), { 37: [2, 10] }, o($VO, [2, 41]), { 13: [1, 136] }, { 1: [2, 4] }, o($VP, [2, 51]), o($VP, [2, 50]), { 16: 37, 17: 137, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o($VB, [2, 59]), o($Vp, [2, 30]), { 39: [1, 138] }, { 23: 90, 38: 139, 39: [2, 34], 41: 22, 44: $V4 }, { 43: 140, 47: $VE }, o($Vx, [2, 38]), { 39: [2, 44] }, o($Vp, [2, 42]), o($Vp, [2, 71]), o($Vp, [2, 73]), o($Vp, [2, 74], { 68: [1, 141] }), o($Vp, [2, 77]), o($Vp, [2, 78], { 13: [1, 142] }), o($Vp, [2, 80], { 13: [1, 144], 68: [1, 143] }), { 21: $VF, 73: $VG, 74: $VH, 77: 145, 79: 101, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }, o($VR, [2, 89]), { 14: [1, 146] }, o($VP, [2, 52]), o($Vp, [2, 31]), { 39: [2, 35] }, { 39: [1, 147] }, o($Vp, [2, 75]), o($Vp, [2, 79]), o($Vp, [2, 81]), o($Vp, [2, 82], { 68: [1, 148] }), o($VQ, [2, 87], { 79: 135, 21: $VF, 73: $VG, 74: $VH, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }), o($VO, [2, 8]), o($Vx, [2, 39]), o($Vp, [2, 83])], - defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 78: [2, 32], 113: [2, 10], 116: [2, 4], 126: [2, 44], 139: [2, 35] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + constructor(sharedServices) { + super(); + this.onDispose(sharedServices.workspace.DocumentBuilder.onUpdate(() => { + this.clear(); + })); } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-provider.js + var DefaultScopeProvider; + var init_scope_provider = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/scope-provider.js"() { + "use strict"; + init_scope(); + init_ast_utils(); + init_stream(); + init_caching(); + DefaultScopeProvider = class { + static { + __name(this, "DefaultScopeProvider"); + } + constructor(services) { + this.reflection = services.shared.AstReflection; + this.nameProvider = services.references.NameProvider; + this.descriptions = services.workspace.AstNodeDescriptionProvider; + this.indexManager = services.shared.workspace.IndexManager; + this.globalScopeCache = new WorkspaceCache(services.shared); + } + getScope(context) { + const scopes = []; + const referenceType = this.reflection.getReferenceType(context); + const precomputed = getDocument(context.container).precomputedScopes; + if (precomputed) { + let currentNode = context.container; + do { + const allDescriptions = precomputed.get(currentNode); + if (allDescriptions.length > 0) { + scopes.push(stream(allDescriptions).filter((desc) => this.reflection.isSubtype(desc.type, referenceType))); + } + currentNode = currentNode.$container; + } while (currentNode); + } + let result = this.getGlobalScope(referenceType, context); + for (let i2 = scopes.length - 1; i2 >= 0; i2--) { + result = this.createScope(scopes[i2], result); + } + return result; } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + /** + * Create a scope for the given collection of AST node descriptions. + */ + createScope(elements3, outerScope, options3) { + return new StreamScope(stream(elements3), outerScope, options3); + } + /** + * Create a scope for the given collection of AST nodes, which need to be transformed into respective + * descriptions first. This is done using the `NameProvider` and `AstNodeDescriptionProvider` services. + */ + createScopeForNodes(elements3, outerScope, options3) { + const s2 = stream(elements3).map((e3) => { + const name = this.nameProvider.getName(e3); + if (name) { + return this.descriptions.createDescription(e3, name); } - token2 = self2.symbols_[token2] || token2; + return void 0; + }).nonNullable(); + return new StreamScope(s2, outerScope, options3); + } + /** + * Create a global scope filtered for the given reference type. + */ + getGlobalScope(referenceType, _context) { + return this.globalScopeCache.get(referenceType, () => new MapScope(this.indexManager.allElements(referenceType))); + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/json-serializer.js + function isAstNodeWithComment(node2) { + return typeof node2.$comment === "string"; + } + function isIntermediateReference(obj) { + return typeof obj === "object" && !!obj && ("$ref" in obj || "$error" in obj); + } + var DefaultJsonSerializer; + var init_json_serializer = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/json-serializer.js"() { + "use strict"; + init_esm2(); + init_syntax_tree(); + init_ast_utils(); + init_grammar_utils(); + __name(isAstNodeWithComment, "isAstNodeWithComment"); + __name(isIntermediateReference, "isIntermediateReference"); + DefaultJsonSerializer = class { + static { + __name(this, "DefaultJsonSerializer"); + } + constructor(services) { + this.ignoreProperties = /* @__PURE__ */ new Set(["$container", "$containerProperty", "$containerIndex", "$document", "$cstNode"]); + this.langiumDocuments = services.shared.workspace.LangiumDocuments; + this.astNodeLocator = services.workspace.AstNodeLocator; + this.nameProvider = services.references.NameProvider; + this.commentProvider = services.documentation.CommentProvider; + } + serialize(node2, options3 = {}) { + const specificReplacer = options3 === null || options3 === void 0 ? void 0 : options3.replacer; + const defaultReplacer = /* @__PURE__ */ __name((key, value2) => this.replacer(key, value2, options3), "defaultReplacer"); + const replacer = specificReplacer ? (key, value2) => specificReplacer(key, value2, defaultReplacer) : defaultReplacer; + try { + this.currentDocument = getDocument(node2); + return JSON.stringify(node2, replacer, options3 === null || options3 === void 0 ? void 0 : options3.space); + } finally { + this.currentDocument = void 0; } - return token2; } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + deserialize(content, options3 = {}) { + const root4 = JSON.parse(content); + this.linkNode(root4, root4, options3); + return root4; + } + replacer(key, value2, { refText, sourceText, textRegions, comments, uriConverter }) { + var _a, _b, _c, _d; + if (this.ignoreProperties.has(key)) { + return void 0; + } else if (isReference(value2)) { + const refValue = value2.ref; + const $refText = refText ? value2.$refText : void 0; + if (refValue) { + const targetDocument = getDocument(refValue); + let targetUri = ""; + if (this.currentDocument && this.currentDocument !== targetDocument) { + if (uriConverter) { + targetUri = uriConverter(targetDocument.uri, value2); + } else { + targetUri = targetDocument.uri.toString(); + } + } + const targetPath = this.astNodeLocator.getAstNodePath(refValue); + return { + $ref: `${targetUri}#${targetPath}`, + $refText + }; + } else { + return { + $error: (_b = (_a = value2.error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : "Could not resolve reference", + $refText + }; } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); + } else if (isAstNode(value2)) { + let astNode = void 0; + if (textRegions) { + astNode = this.addAstNodeRegionWithAssignmentsTo(Object.assign({}, value2)); + if ((!key || value2.$document) && (astNode === null || astNode === void 0 ? void 0 : astNode.$textRegion)) { + astNode.$textRegion.documentURI = (_c = this.currentDocument) === null || _c === void 0 ? void 0 : _c.uri.toString(); } } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); + if (sourceText && !key) { + astNode !== null && astNode !== void 0 ? astNode : astNode = Object.assign({}, value2); + astNode.$sourceText = (_d = value2.$cstNode) === null || _d === void 0 ? void 0 : _d.text; + } + if (comments) { + astNode !== null && astNode !== void 0 ? astNode : astNode = Object.assign({}, value2); + const comment2 = this.commentProvider.getComment(value2); + if (comment2) { + astNode.$comment = comment2.replace(/\r/g, ""); + } + } + return astNode !== null && astNode !== void 0 ? astNode : value2; + } else { + return value2; } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + } + addAstNodeRegionWithAssignmentsTo(node2) { + const createDocumentSegment = /* @__PURE__ */ __name((cstNode) => ({ + offset: cstNode.offset, + end: cstNode.end, + length: cstNode.length, + range: cstNode.range + }), "createDocumentSegment"); + if (node2.$cstNode) { + const textRegion = node2.$textRegion = createDocumentSegment(node2.$cstNode); + const assignments = textRegion.assignments = {}; + Object.keys(node2).filter((key) => !key.startsWith("$")).forEach((key) => { + const propertyAssignments = findNodesForProperty(node2.$cstNode, key).map(createDocumentSegment); + if (propertyAssignments.length !== 0) { + assignments[key] = propertyAssignments; + } + }); + return node2; } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; + return void 0; + } + linkNode(node2, root4, options3, container2, containerProperty, containerIndex) { + for (const [propertyName, item] of Object.entries(node2)) { + if (Array.isArray(item)) { + for (let index = 0; index < item.length; index++) { + const element3 = item[index]; + if (isIntermediateReference(element3)) { + item[index] = this.reviveReference(node2, propertyName, root4, element3, options3); + } else if (isAstNode(element3)) { + this.linkNode(element3, root4, options3, node2, propertyName, index); + } + } + } else if (isIntermediateReference(item)) { + node2[propertyName] = this.reviveReference(node2, propertyName, root4, item, options3); + } else if (isAstNode(item)) { + this.linkNode(item, root4, options3, node2, propertyName); + } + } + const mutable = node2; + mutable.$container = container2; + mutable.$containerProperty = containerProperty; + mutable.$containerIndex = containerIndex; + } + reviveReference(container2, property2, root4, reference, options3) { + let refText = reference.$refText; + let error3 = reference.$error; + if (reference.$ref) { + const ref = this.getRefNode(root4, reference.$ref, options3.uriConverter); + if (isAstNode(ref)) { + if (!refText) { + refText = this.nameProvider.getName(ref); } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column + return { + $refText: refText !== null && refText !== void 0 ? refText : "", + ref }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + } else { + error3 = ref; + } } - } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); + if (error3) { + const ref = { + $refText: refText !== null && refText !== void 0 ? refText : "" + }; + ref.error = { + container: container2, + property: property2, + message: error3, + reference: ref + }; + return ref; } else { - throw new Error(str2); + return void 0; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + } + getRefNode(root4, uri, uriConverter) { + try { + const fragmentIndex = uri.indexOf("#"); + if (fragmentIndex === 0) { + const node3 = this.astNodeLocator.getAstNode(root4, uri.substring(1)); + if (!node3) { + return "Could not resolve path: " + uri; + } + return node3; + } + if (fragmentIndex < 0) { + const documentUri2 = uriConverter ? uriConverter(uri) : URI2.parse(uri); + const document3 = this.langiumDocuments.getDocument(documentUri2); + if (!document3) { + return "Could not find document for URI: " + uri; + } + return document3.parseResult.value; + } + const documentUri = uriConverter ? uriConverter(uri.substring(0, fragmentIndex)) : URI2.parse(uri.substring(0, fragmentIndex)); + const document2 = this.langiumDocuments.getDocument(documentUri); + if (!document2) { + return "Could not find document for URI: " + uri; + } + if (fragmentIndex === uri.length - 1) { + return document2.parseResult.value; + } + const node2 = this.astNodeLocator.getAstNode(document2.parseResult.value, uri.substring(fragmentIndex + 1)); + if (!node2) { + return "Could not resolve URI: " + uri; + } + return node2; + } catch (err) { + return String(err); } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/service-registry.js + var DefaultServiceRegistry; + var init_service_registry = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/service-registry.js"() { + "use strict"; + init_uri_utils(); + DefaultServiceRegistry = class { + static { + __name(this, "DefaultServiceRegistry"); + } + register(language) { + if (!this.singleton && !this.map) { + this.singleton = language; + return; } - if (this.options.ranges) { - this.yylloc.range[1]++; + if (!this.map) { + this.map = {}; + if (this.singleton) { + for (const ext of this.singleton.LanguageMetaData.fileExtensions) { + this.map[ext] = this.singleton; + } + this.singleton = void 0; + } } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + for (const ext of language.LanguageMetaData.fileExtensions) { + if (this.map[ext] !== void 0 && this.map[ext] !== language) { + console.warn(`The file extension ${ext} is used by multiple languages. It is now assigned to '${language.LanguageMetaData.languageId}'.`); + } + this.map[ext] = language; } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + } + getServices(uri) { + if (this.singleton !== void 0) { + return this.singleton; } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + if (this.map === void 0) { + throw new Error("The service registry is empty. Use `register` to register the services of a language."); } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } + const ext = UriUtils.extname(uri); + const services = this.map[ext]; + if (!services) { + throw new Error(`The service registry contains no services for the extension '${ext}'.`); } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + return services; + } + get all() { + if (this.singleton !== void 0) { + return [this.singleton]; } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; + if (this.map !== void 0) { + return Object.values(this.map); } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; + return []; + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/validation-registry.js + function diagnosticData(code) { + return { code }; + } + var ValidationCategory, ValidationRegistry; + var init_validation_registry = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/validation-registry.js"() { + "use strict"; + init_collections(); + init_promise_utils(); + init_stream(); + __name(diagnosticData, "diagnosticData"); + (function(ValidationCategory2) { + ValidationCategory2.all = ["fast", "slow", "built-in"]; + })(ValidationCategory || (ValidationCategory = {})); + ValidationRegistry = class { + static { + __name(this, "ValidationRegistry"); + } + constructor(services) { + this.entries = new MultiMap(); + this.reflection = services.shared.AstReflection; + } + /** + * Register a set of validation checks. Each value in the record can be either a single validation check (i.e. a function) + * or an array of validation checks. + * + * @param checksRecord Set of validation checks to register. + * @param category Optional category for the validation checks (defaults to `'fast'`). + * @param thisObj Optional object to be used as `this` when calling the validation check functions. + */ + register(checksRecord, thisObj = this, category = "fast") { + if (category === "built-in") { + throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors."); + } + for (const [type3, ch] of Object.entries(checksRecord)) { + const callbacks = ch; + if (Array.isArray(callbacks)) { + for (const check of callbacks) { + const entry = { + check: this.wrapValidationException(check, thisObj), + category + }; + this.addEntry(type3, entry); } + } else if (typeof callbacks === "function") { + const entry = { + check: this.wrapValidationException(callbacks, thisObj), + category + }; + this.addEntry(type3, entry); } } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + } + wrapValidationException(check, thisObj) { + return async (node2, accept, cancelToken) => { + try { + await check.call(thisObj, node2, accept, cancelToken); + } catch (err) { + if (isOperationCancelled(err)) { + throw err; + } + console.error("An error occurred during validation:", err); + const message = err instanceof Error ? err.message : String(err); + if (err instanceof Error && err.stack) { + console.error(err.stack); + } + accept("error", "An error occurred during validation: " + message, { node: node2 }); } - return false; + }; + } + addEntry(type3, entry) { + if (type3 === "AstNode") { + this.entries.add("AstNode", entry); + return; } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + for (const subtype of this.reflection.getAllSubTypes(type3)) { + this.entries.add(subtype, entry); } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + } + getChecks(type3, categories) { + let checks = stream(this.entries.get(type3)).concat(this.entries.get("AstNode")); + if (categories) { + checks = checks.filter((entry) => categories.includes(entry.category)); } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + return checks.map((entry) => entry.check); + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/document-validator.js + function getDiagnosticRange(info2) { + if (info2.range) { + return info2.range; + } + let cstNode; + if (typeof info2.property === "string") { + cstNode = findNodeForProperty(info2.node.$cstNode, info2.property, info2.index); + } else if (typeof info2.keyword === "string") { + cstNode = findNodeForKeyword(info2.node.$cstNode, info2.keyword, info2.index); + } + cstNode !== null && cstNode !== void 0 ? cstNode : cstNode = info2.node.$cstNode; + if (!cstNode) { + return { + start: { line: 0, character: 0 }, + end: { line: 0, character: 0 } + }; + } + return cstNode.range; + } + function toDiagnosticSeverity(severity) { + switch (severity) { + case "error": + return 1; + case "warning": + return 2; + case "info": + return 3; + case "hint": + return 4; + default: + throw new Error("Invalid diagnostic severity: " + severity); + } + } + var DefaultDocumentValidator, DocumentValidator; + var init_document_validator = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/document-validator.js"() { + "use strict"; + init_cancellation(); + init_grammar_utils(); + init_ast_utils(); + init_cst_utils(); + init_promise_utils(); + init_validation_registry(); + DefaultDocumentValidator = class { + static { + __name(this, "DefaultDocumentValidator"); + } + constructor(services) { + this.validationRegistry = services.validation.ValidationRegistry; + this.metadata = services.LanguageMetaData; + } + async validateDocument(document2, options3 = {}, cancelToken = cancellation_exports.CancellationToken.None) { + const parseResult = document2.parseResult; + const diagnostics = []; + await interruptAndCheck(cancelToken); + if (!options3.categories || options3.categories.includes("built-in")) { + this.processLexingErrors(parseResult, diagnostics, options3); + if (options3.stopAfterLexingErrors && diagnostics.some((d2) => { + var _a; + return ((_a = d2.data) === null || _a === void 0 ? void 0 : _a.code) === DocumentValidator.LexingError; + })) { + return diagnostics; + } + this.processParsingErrors(parseResult, diagnostics, options3); + if (options3.stopAfterParsingErrors && diagnostics.some((d2) => { + var _a; + return ((_a = d2.data) === null || _a === void 0 ? void 0 : _a.code) === DocumentValidator.ParsingError; + })) { + return diagnostics; + } + this.processLinkingErrors(document2, diagnostics, options3); + if (options3.stopAfterLinkingErrors && diagnostics.some((d2) => { + var _a; + return ((_a = d2.data) === null || _a === void 0 ? void 0 : _a.code) === DocumentValidator.LinkingError; + })) { + return diagnostics; + } } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + try { + diagnostics.push(...await this.validateAst(parseResult.value, options3, cancelToken)); + } catch (err) { + if (isOperationCancelled(err)) { + throw err; + } + console.error("An error occurred during validation:", err); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; + await interruptAndCheck(cancelToken); + return diagnostics; + } + processLexingErrors(parseResult, diagnostics, _options) { + for (const lexerError of parseResult.lexerErrors) { + const diagnostic = { + severity: toDiagnosticSeverity("error"), + range: { + start: { + line: lexerError.line - 1, + character: lexerError.column - 1 + }, + end: { + line: lexerError.line - 1, + character: lexerError.column + lexerError.length - 1 + } + }, + message: lexerError.message, + data: diagnosticData(DocumentValidator.LexingError), + source: this.getSource() + }; + diagnostics.push(diagnostic); + } + } + processParsingErrors(parseResult, diagnostics, _options) { + for (const parserError of parseResult.parserErrors) { + let range3 = void 0; + if (isNaN(parserError.token.startOffset)) { + if ("previousToken" in parserError) { + const token2 = parserError.previousToken; + if (!isNaN(token2.startOffset)) { + const position5 = { line: token2.endLine - 1, character: token2.endColumn }; + range3 = { start: position5, end: position5 }; + } else { + const position5 = { line: 0, character: 0 }; + range3 = { start: position5, end: position5 }; + } + } + } else { + range3 = tokenToRange(parserError.token); + } + if (range3) { + const diagnostic = { + severity: toDiagnosticSeverity("error"), + range: range3, + message: parserError.message, + data: diagnosticData(DocumentValidator.ParsingError), + source: this.getSource() + }; + diagnostics.push(diagnostic); + } } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: {}, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - return 53; - case 1: - return 54; - case 2: - return 55; - case 3: - return 56; - case 4: - break; - case 5: - break; - case 6: - this.begin("acc_title"); - return 31; - case 7: - this.popState(); - return "acc_title_value"; - case 8: - this.begin("acc_descr"); - return 33; - case 9: - this.popState(); - return "acc_descr_value"; - case 10: - this.begin("acc_descr_multiline"); - break; - case 11: - this.popState(); - break; - case 12: - return "acc_descr_multiline_value"; - case 13: - return 8; - case 14: - break; - case 15: - return 7; - case 16: - return 7; - case 17: - return "EDGE_STATE"; - case 18: - this.begin("callback_name"); - break; - case 19: - this.popState(); - break; - case 20: - this.popState(); - this.begin("callback_args"); - break; - case 21: - return 70; - case 22: - this.popState(); - break; - case 23: - return 71; - case 24: - this.popState(); - break; - case 25: - return "STR"; - case 26: - this.begin("string"); - break; - case 27: - return 73; - case 28: - this.begin("namespace"); - return 40; - case 29: - this.popState(); - return 8; - case 30: - break; - case 31: - this.begin("namespace-body"); - return 37; - case 32: - this.popState(); - return 39; - case 33: - return "EOF_IN_STRUCT"; - case 34: - return 8; - case 35: - break; - case 36: - return "EDGE_STATE"; - case 37: - this.begin("class"); - return 44; - case 38: - this.popState(); - return 8; - case 39: - break; - case 40: - this.popState(); - this.popState(); - return 39; - case 41: - this.begin("class-body"); - return 37; - case 42: - this.popState(); - return 39; - case 43: - return "EOF_IN_STRUCT"; - case 44: - return "EDGE_STATE"; - case 45: - return "OPEN_IN_STRUCT"; - case 46: - break; - case 47: - return "MEMBER"; - case 48: - return 76; - case 49: - return 66; - case 50: - return 67; - case 51: - return 69; - case 52: - return 50; - case 53: - return 52; - case 54: - return 45; - case 55: - return 46; - case 56: - return 72; - case 57: - this.popState(); - break; - case 58: - return "GENERICTYPE"; - case 59: - this.begin("generic"); - break; - case 60: - this.popState(); - break; - case 61: - return "BQUOTE_STR"; - case 62: - this.begin("bqstring"); - break; - case 63: - return 68; - case 64: - return 68; - case 65: - return 68; - case 66: - return 68; - case 67: - return 60; - case 68: - return 60; - case 69: - return 62; - case 70: - return 62; - case 71: - return 61; - case 72: - return 59; - case 73: - return 63; - case 74: - return 64; - case 75: - return 65; - case 76: - return 21; - case 77: - return 42; - case 78: - return 95; - case 79: - return "DOT"; - case 80: - return "PLUS"; - case 81: - return 81; - case 82: - return 78; - case 83: - return 84; - case 84: - return 84; - case 85: - return 85; - case 86: - return "EQUALS"; - case 87: - return "EQUALS"; - case 88: - return 74; - case 89: - return 12; - case 90: - return 14; - case 91: - return "PUNCTUATION"; - case 92: - return 80; - case 93: - return 97; - case 94: - return 83; - case 95: - return 83; - case 96: - return 9; + } + processLinkingErrors(document2, diagnostics, _options) { + for (const reference of document2.references) { + const linkingError = reference.error; + if (linkingError) { + const info2 = { + node: linkingError.container, + property: linkingError.property, + index: linkingError.index, + data: { + code: DocumentValidator.LinkingError, + containerType: linkingError.container.$type, + property: linkingError.property, + refText: linkingError.reference.$refText + } + }; + diagnostics.push(this.toDiagnostic("error", linkingError.message, info2)); + } } - }, - rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:\[\*\])/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:["])/, /^(?:[^"]*)/, /^(?:["])/, /^(?:style\b)/, /^(?:namespace\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:\[\*\])/, /^(?:class\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[}])/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\[\*\])/, /^(?:[{])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:href\b)/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:~)/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:[`])/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?::)/, /^(?:,)/, /^(?:#)/, /^(?:#)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:\[)/, /^(?:\])/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:\s)/, /^(?:$)/], - conditions: { "namespace-body": { "rules": [26, 32, 33, 34, 35, 36, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "namespace": { "rules": [26, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "class-body": { "rules": [26, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "class": { "rules": [26, 38, 39, 40, 41, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_descr": { "rules": [9, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_title": { "rules": [7, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "callback_args": { "rules": [22, 23, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "callback_name": { "rules": [19, 20, 21, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "href": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "struct": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "generic": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "bqstring": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "string": { "rules": [24, 25, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 26, 27, 28, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$c.parser = parser$c; - const parser$d = parser$c; - const visibilityValues = ["#", "+", "~", "-", ""]; - class ClassMember { - constructor(input, memberType) { - this.memberType = memberType; - this.visibility = ""; - this.classifier = ""; - const sanitizedInput = sanitizeText$6(input, getConfig$1()); - this.parseMember(sanitizedInput); - } - getDisplayDetails() { - let displayText = this.visibility + parseGenericTypes(this.id); - if (this.memberType === "method") { - displayText += `(${parseGenericTypes(this.parameters.trim())})`; - if (this.returnType) { - displayText += " : " + parseGenericTypes(this.returnType); - } - } - displayText = displayText.trim(); - const cssStyle = this.parseClassifier(); - return { - displayText, - cssStyle - }; - } - parseMember(input) { - let potentialClassifier = ""; - if (this.memberType === "method") { - const methodRegEx = /([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/; - const match = input.match(methodRegEx); - if (match) { - const detectedVisibility = match[1] ? match[1].trim() : ""; - if (visibilityValues.includes(detectedVisibility)) { - this.visibility = detectedVisibility; - } - this.id = match[2].trim(); - this.parameters = match[3] ? match[3].trim() : ""; - potentialClassifier = match[4] ? match[4].trim() : ""; - this.returnType = match[5] ? match[5].trim() : ""; - if (potentialClassifier === "") { - const lastChar = this.returnType.substring(this.returnType.length - 1); - if (lastChar.match(/[$*]/)) { - potentialClassifier = lastChar; - this.returnType = this.returnType.substring(0, this.returnType.length - 1); + } + async validateAst(rootNode, options3, cancelToken = cancellation_exports.CancellationToken.None) { + const validationItems = []; + const acceptor = /* @__PURE__ */ __name((severity, message, info2) => { + validationItems.push(this.toDiagnostic(severity, message, info2)); + }, "acceptor"); + await Promise.all(streamAst(rootNode).map(async (node2) => { + await interruptAndCheck(cancelToken); + const checks = this.validationRegistry.getChecks(node2.$type, options3.categories); + for (const check of checks) { + await check(node2, acceptor, cancelToken); } + })); + return validationItems; + } + toDiagnostic(severity, message, info2) { + return { + message, + range: getDiagnosticRange(info2), + severity: toDiagnosticSeverity(severity), + code: info2.code, + codeDescription: info2.codeDescription, + tags: info2.tags, + relatedInformation: info2.relatedInformation, + data: info2.data, + source: this.getSource() + }; + } + getSource() { + return this.metadata.languageId; + } + }; + __name(getDiagnosticRange, "getDiagnosticRange"); + __name(toDiagnosticSeverity, "toDiagnosticSeverity"); + (function(DocumentValidator2) { + DocumentValidator2.LexingError = "lexing-error"; + DocumentValidator2.ParsingError = "parsing-error"; + DocumentValidator2.LinkingError = "linking-error"; + })(DocumentValidator || (DocumentValidator = {})); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-descriptions.js + var DefaultAstNodeDescriptionProvider, DefaultReferenceDescriptionProvider; + var init_ast_descriptions = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-descriptions.js"() { + "use strict"; + init_cancellation(); + init_syntax_tree(); + init_ast_utils(); + init_cst_utils(); + init_promise_utils(); + init_uri_utils(); + DefaultAstNodeDescriptionProvider = class { + static { + __name(this, "DefaultAstNodeDescriptionProvider"); + } + constructor(services) { + this.astNodeLocator = services.workspace.AstNodeLocator; + this.nameProvider = services.references.NameProvider; + } + createDescription(node2, name, document2 = getDocument(node2)) { + name !== null && name !== void 0 ? name : name = this.nameProvider.getName(node2); + const path4 = this.astNodeLocator.getAstNodePath(node2); + if (!name) { + throw new Error(`Node at path ${path4} has no name.`); + } + let nameNodeSegment; + const nameSegmentGetter = /* @__PURE__ */ __name(() => { + var _a; + return nameNodeSegment !== null && nameNodeSegment !== void 0 ? nameNodeSegment : nameNodeSegment = toDocumentSegment((_a = this.nameProvider.getNameNode(node2)) !== null && _a !== void 0 ? _a : node2.$cstNode); + }, "nameSegmentGetter"); + return { + node: node2, + name, + get nameSegment() { + return nameSegmentGetter(); + }, + selectionSegment: toDocumentSegment(node2.$cstNode), + type: node2.$type, + documentUri: document2.uri, + path: path4 + }; + } + }; + DefaultReferenceDescriptionProvider = class { + static { + __name(this, "DefaultReferenceDescriptionProvider"); + } + constructor(services) { + this.nodeLocator = services.workspace.AstNodeLocator; + } + async createDescriptions(document2, cancelToken = cancellation_exports.CancellationToken.None) { + const descr = []; + const rootNode = document2.parseResult.value; + for (const astNode of streamAst(rootNode)) { + await interruptAndCheck(cancelToken); + streamReferences(astNode).filter((refInfo) => !isLinkingError(refInfo)).forEach((refInfo) => { + const description = this.createDescription(refInfo); + if (description) { + descr.push(description); + } + }); } + return descr; } - } else { - const length2 = input.length; - const firstChar = input.substring(0, 1); - const lastChar = input.substring(length2 - 1); - if (visibilityValues.includes(firstChar)) { - this.visibility = firstChar; - } - if (lastChar.match(/[$*]/)) { - potentialClassifier = lastChar; - } - this.id = input.substring( - this.visibility === "" ? 0 : 1, - potentialClassifier === "" ? length2 : length2 - 1 - ); - } - this.classifier = potentialClassifier; + createDescription(refInfo) { + const targetNodeDescr = refInfo.reference.$nodeDescription; + const refCstNode = refInfo.reference.$refNode; + if (!targetNodeDescr || !refCstNode) { + return void 0; + } + const docUri = getDocument(refInfo.container).uri; + return { + sourceUri: docUri, + sourcePath: this.nodeLocator.getAstNodePath(refInfo.container), + targetUri: targetNodeDescr.documentUri, + targetPath: targetNodeDescr.path, + segment: toDocumentSegment(refCstNode), + local: UriUtils.equals(targetNodeDescr.documentUri, docUri) + }; + } + }; } - parseClassifier() { - switch (this.classifier) { - case "*": - return "font-style:italic;"; - case "$": - return "text-decoration:underline;"; - default: + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-node-locator.js + var DefaultAstNodeLocator; + var init_ast_node_locator = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/ast-node-locator.js"() { + "use strict"; + DefaultAstNodeLocator = class { + static { + __name(this, "DefaultAstNodeLocator"); + } + constructor() { + this.segmentSeparator = "/"; + this.indexSeparator = "@"; + } + getAstNodePath(node2) { + if (node2.$container) { + const containerPath = this.getAstNodePath(node2.$container); + const newSegment = this.getPathSegment(node2); + const nodePath = containerPath + this.segmentSeparator + newSegment; + return nodePath; + } return ""; - } + } + getPathSegment({ $containerProperty, $containerIndex }) { + if (!$containerProperty) { + throw new Error("Missing '$containerProperty' in AST node."); + } + if ($containerIndex !== void 0) { + return $containerProperty + this.indexSeparator + $containerIndex; + } + return $containerProperty; + } + getAstNode(node2, path4) { + const segments = path4.split(this.segmentSeparator); + return segments.reduce((previousValue, currentValue) => { + if (!previousValue || currentValue.length === 0) { + return previousValue; + } + const propertyIndex = currentValue.indexOf(this.indexSeparator); + if (propertyIndex > 0) { + const property2 = currentValue.substring(0, propertyIndex); + const arrayIndex = parseInt(currentValue.substring(propertyIndex + 1)); + const array4 = previousValue[property2]; + return array4 === null || array4 === void 0 ? void 0 : array4[arrayIndex]; + } + return previousValue[currentValue]; + }, node2); + } + }; } - } - const MERMAID_DOM_ID_PREFIX = "classId-"; - let relations = []; - let classes$2 = {}; - let notes = []; - let classCounter = 0; - let namespaces = {}; - let namespaceCounter = 0; - let functions = []; - const sanitizeText$2 = (txt) => common$1.sanitizeText(txt, getConfig$1()); - const splitClassNameAndType = function(_id) { - const id2 = common$1.sanitizeText(_id, getConfig$1()); - let genericType = ""; - let className = id2; - if (id2.indexOf("~") > 0) { - const split = id2.split("~"); - className = sanitizeText$2(split[0]); - genericType = sanitizeText$2(split[1]); - } - return { className, type: genericType }; - }; - const setClassLabel = function(_id, label) { - const id2 = common$1.sanitizeText(_id, getConfig$1()); - if (label) { - label = sanitizeText$2(label); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/configuration.js + var DefaultConfigurationProvider; + var init_configuration = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/configuration.js"() { + "use strict"; + init_promise_utils(); + DefaultConfigurationProvider = class { + static { + __name(this, "DefaultConfigurationProvider"); + } + constructor(services) { + this._ready = new Deferred(); + this.settings = {}; + this.workspaceConfig = false; + this.serviceRegistry = services.ServiceRegistry; + } + get ready() { + return this._ready.promise; + } + initialize(params) { + var _a, _b; + this.workspaceConfig = (_b = (_a = params.capabilities.workspace) === null || _a === void 0 ? void 0 : _a.configuration) !== null && _b !== void 0 ? _b : false; + } + async initialized(params) { + if (this.workspaceConfig) { + if (params.register) { + const languages = this.serviceRegistry.all; + params.register({ + // Listen to configuration changes for all languages + section: languages.map((lang) => this.toSectionName(lang.LanguageMetaData.languageId)) + }); + } + if (params.fetchConfiguration) { + const configToUpdate = this.serviceRegistry.all.map((lang) => ({ + // Fetch the configuration changes for all languages + section: this.toSectionName(lang.LanguageMetaData.languageId) + })); + const configs = await params.fetchConfiguration(configToUpdate); + configToUpdate.forEach((conf8, idx) => { + this.updateSectionConfiguration(conf8.section, configs[idx]); + }); + } + } + this._ready.resolve(); + } + /** + * Updates the cached configurations using the `change` notification parameters. + * + * @param change The parameters of a change configuration notification. + * `settings` property of the change object could be expressed as `Record>` + */ + updateConfiguration(change2) { + if (!change2.settings) { + return; + } + Object.keys(change2.settings).forEach((section) => { + this.updateSectionConfiguration(section, change2.settings[section]); + }); + } + updateSectionConfiguration(section, configuration) { + this.settings[section] = configuration; + } + /** + * Returns a configuration value stored for the given language. + * + * @param language The language id + * @param configuration Configuration name + */ + async getConfiguration(language, configuration) { + await this.ready; + const sectionName = this.toSectionName(language); + if (this.settings[sectionName]) { + return this.settings[sectionName][configuration]; + } + } + toSectionName(languageId) { + return `${languageId}`; + } + }; } - const { className } = splitClassNameAndType(id2); - classes$2[className].label = label; - }; - const addClass = function(_id) { - const id2 = common$1.sanitizeText(_id, getConfig$1()); - const { className, type: type2 } = splitClassNameAndType(id2); - if (Object.hasOwn(classes$2, className)) { - return; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/disposable.js + var Disposable; + var init_disposable = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/disposable.js"() { + "use strict"; + (function(Disposable2) { + function create2(callback) { + return { + dispose: /* @__PURE__ */ __name(async () => await callback(), "dispose") + }; + } + __name(create2, "create"); + Disposable2.create = create2; + })(Disposable || (Disposable = {})); } - const name = common$1.sanitizeText(className, getConfig$1()); - classes$2[name] = { - id: name, - type: type2, - label: name, - cssClasses: [], - methods: [], - members: [], - annotations: [], - styles: [], - domId: MERMAID_DOM_ID_PREFIX + name + "-" + classCounter - }; - classCounter++; - }; - const lookUpDomId = function(_id) { - const id2 = common$1.sanitizeText(_id, getConfig$1()); - if (id2 in classes$2) { - return classes$2[id2].domId; + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/document-builder.js + var DefaultDocumentBuilder; + var init_document_builder = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/document-builder.js"() { + "use strict"; + init_cancellation(); + init_disposable(); + init_collections(); + init_promise_utils(); + init_stream(); + init_validation_registry(); + init_documents(); + DefaultDocumentBuilder = class { + static { + __name(this, "DefaultDocumentBuilder"); + } + constructor(services) { + this.updateBuildOptions = { + // Default: run only the built-in validation checks and those in the _fast_ category (includes those without category) + validation: { + categories: ["built-in", "fast"] + } + }; + this.updateListeners = []; + this.buildPhaseListeners = new MultiMap(); + this.buildState = /* @__PURE__ */ new Map(); + this.documentBuildWaiters = /* @__PURE__ */ new Map(); + this.currentState = DocumentState.Changed; + this.langiumDocuments = services.workspace.LangiumDocuments; + this.langiumDocumentFactory = services.workspace.LangiumDocumentFactory; + this.indexManager = services.workspace.IndexManager; + this.serviceRegistry = services.ServiceRegistry; + } + async build(documents2, options3 = {}, cancelToken = cancellation_exports.CancellationToken.None) { + var _a, _b; + for (const document2 of documents2) { + const key = document2.uri.toString(); + if (document2.state === DocumentState.Validated) { + if (typeof options3.validation === "boolean" && options3.validation) { + document2.state = DocumentState.IndexedReferences; + document2.diagnostics = void 0; + this.buildState.delete(key); + } else if (typeof options3.validation === "object") { + const buildState2 = this.buildState.get(key); + const previousCategories = (_a = buildState2 === null || buildState2 === void 0 ? void 0 : buildState2.result) === null || _a === void 0 ? void 0 : _a.validationChecks; + if (previousCategories) { + const newCategories = (_b = options3.validation.categories) !== null && _b !== void 0 ? _b : ValidationCategory.all; + const categories = newCategories.filter((c3) => !previousCategories.includes(c3)); + if (categories.length > 0) { + this.buildState.set(key, { + completed: false, + options: { + validation: Object.assign(Object.assign({}, options3.validation), { categories }) + }, + result: buildState2.result + }); + document2.state = DocumentState.IndexedReferences; + } + } + } + } else { + this.buildState.delete(key); + } + } + this.currentState = DocumentState.Changed; + await this.emitUpdate(documents2.map((e3) => e3.uri), []); + await this.buildDocuments(documents2, options3, cancelToken); + } + async update(changed, deleted, cancelToken = cancellation_exports.CancellationToken.None) { + this.currentState = DocumentState.Changed; + for (const deletedUri of deleted) { + this.langiumDocuments.deleteDocument(deletedUri); + this.buildState.delete(deletedUri.toString()); + this.indexManager.remove(deletedUri); + } + for (const changedUri of changed) { + const invalidated = this.langiumDocuments.invalidateDocument(changedUri); + if (!invalidated) { + const newDocument = this.langiumDocumentFactory.fromModel({ $type: "INVALID" }, changedUri); + newDocument.state = DocumentState.Changed; + this.langiumDocuments.addDocument(newDocument); + } + this.buildState.delete(changedUri.toString()); + } + const allChangedUris = stream(changed).concat(deleted).map((uri) => uri.toString()).toSet(); + this.langiumDocuments.all.filter((doc) => !allChangedUris.has(doc.uri.toString()) && this.shouldRelink(doc, allChangedUris)).forEach((doc) => { + const linker = this.serviceRegistry.getServices(doc.uri).references.Linker; + linker.unlink(doc); + doc.state = Math.min(doc.state, DocumentState.ComputedScopes); + doc.diagnostics = void 0; + }); + await this.emitUpdate(changed, deleted); + await interruptAndCheck(cancelToken); + const rebuildDocuments = this.langiumDocuments.all.filter((doc) => { + var _a; + return doc.state < DocumentState.Linked || !((_a = this.buildState.get(doc.uri.toString())) === null || _a === void 0 ? void 0 : _a.completed); + }).toArray(); + await this.buildDocuments(rebuildDocuments, this.updateBuildOptions, cancelToken); + } + async emitUpdate(changed, deleted) { + await Promise.all(this.updateListeners.map((listener) => listener(changed, deleted))); + } + /** + * Check whether the given document should be relinked after changes were found in the given URIs. + */ + shouldRelink(document2, changedUris) { + if (document2.references.some((ref) => ref.error !== void 0)) { + return true; + } + return this.indexManager.isAffected(document2, changedUris); + } + onUpdate(callback) { + this.updateListeners.push(callback); + return Disposable.create(() => { + const index = this.updateListeners.indexOf(callback); + if (index >= 0) { + this.updateListeners.splice(index, 1); + } + }); + } + /** + * Build the given documents by stepping through all build phases. If a document's state indicates + * that a certain build phase is already done, the phase is skipped for that document. + */ + async buildDocuments(documents2, options3, cancelToken) { + this.prepareBuild(documents2, options3); + await this.runCancelable(documents2, DocumentState.Parsed, cancelToken, (doc) => this.langiumDocumentFactory.update(doc, cancelToken)); + await this.runCancelable(documents2, DocumentState.IndexedContent, cancelToken, (doc) => this.indexManager.updateContent(doc, cancelToken)); + await this.runCancelable(documents2, DocumentState.ComputedScopes, cancelToken, async (doc) => { + const scopeComputation = this.serviceRegistry.getServices(doc.uri).references.ScopeComputation; + doc.precomputedScopes = await scopeComputation.computeLocalScopes(doc, cancelToken); + }); + await this.runCancelable(documents2, DocumentState.Linked, cancelToken, (doc) => { + const linker = this.serviceRegistry.getServices(doc.uri).references.Linker; + return linker.link(doc, cancelToken); + }); + await this.runCancelable(documents2, DocumentState.IndexedReferences, cancelToken, (doc) => this.indexManager.updateReferences(doc, cancelToken)); + const toBeValidated = documents2.filter((doc) => this.shouldValidate(doc)); + await this.runCancelable(toBeValidated, DocumentState.Validated, cancelToken, (doc) => this.validate(doc, cancelToken)); + for (const doc of documents2) { + const state4 = this.buildState.get(doc.uri.toString()); + if (state4) { + state4.completed = true; + } + } + } + prepareBuild(documents2, options3) { + for (const doc of documents2) { + const key = doc.uri.toString(); + const state4 = this.buildState.get(key); + if (!state4 || state4.completed) { + this.buildState.set(key, { + completed: false, + options: options3, + result: state4 === null || state4 === void 0 ? void 0 : state4.result + }); + } + } + } + async runCancelable(documents2, targetState, cancelToken, callback) { + const filtered = documents2.filter((e3) => e3.state < targetState); + for (const document2 of filtered) { + await interruptAndCheck(cancelToken); + await callback(document2); + document2.state = targetState; + } + await this.notifyBuildPhase(filtered, targetState, cancelToken); + this.currentState = targetState; + } + onBuildPhase(targetState, callback) { + this.buildPhaseListeners.add(targetState, callback); + return Disposable.create(() => { + this.buildPhaseListeners.delete(targetState, callback); + }); + } + waitUntil(state4, uriOrToken, cancelToken) { + let uri = void 0; + if (uriOrToken && "path" in uriOrToken) { + uri = uriOrToken; + } else { + cancelToken = uriOrToken; + } + cancelToken !== null && cancelToken !== void 0 ? cancelToken : cancelToken = cancellation_exports.CancellationToken.None; + if (uri) { + const document2 = this.langiumDocuments.getDocument(uri); + if (document2 && document2.state > state4) { + return Promise.resolve(uri); + } + } + if (this.currentState >= state4) { + return Promise.resolve(void 0); + } else if (cancelToken.isCancellationRequested) { + return Promise.reject(OperationCancelled); + } + return new Promise((resolve3, reject3) => { + const buildDisposable = this.onBuildPhase(state4, () => { + buildDisposable.dispose(); + cancelDisposable.dispose(); + if (uri) { + const document2 = this.langiumDocuments.getDocument(uri); + resolve3(document2 === null || document2 === void 0 ? void 0 : document2.uri); + } else { + resolve3(void 0); + } + }); + const cancelDisposable = cancelToken.onCancellationRequested(() => { + buildDisposable.dispose(); + cancelDisposable.dispose(); + reject3(OperationCancelled); + }); + }); + } + async notifyBuildPhase(documents2, state4, cancelToken) { + if (documents2.length === 0) { + return; + } + const listeners = this.buildPhaseListeners.get(state4); + for (const listener of listeners) { + await interruptAndCheck(cancelToken); + await listener(documents2, cancelToken); + } + } + /** + * Determine whether the given document should be validated during a build. The default + * implementation checks the `validation` property of the build options. If it's set to `true` + * or a `ValidationOptions` object, the document is included in the validation phase. + */ + shouldValidate(document2) { + return Boolean(this.getBuildOptions(document2).validation); + } + /** + * Run validation checks on the given document and store the resulting diagnostics in the document. + * If the document already contains diagnostics, the new ones are added to the list. + */ + async validate(document2, cancelToken) { + var _a, _b; + const validator = this.serviceRegistry.getServices(document2.uri).validation.DocumentValidator; + const validationSetting = this.getBuildOptions(document2).validation; + const options3 = typeof validationSetting === "object" ? validationSetting : void 0; + const diagnostics = await validator.validateDocument(document2, options3, cancelToken); + if (document2.diagnostics) { + document2.diagnostics.push(...diagnostics); + } else { + document2.diagnostics = diagnostics; + } + const state4 = this.buildState.get(document2.uri.toString()); + if (state4) { + (_a = state4.result) !== null && _a !== void 0 ? _a : state4.result = {}; + const newCategories = (_b = options3 === null || options3 === void 0 ? void 0 : options3.categories) !== null && _b !== void 0 ? _b : ValidationCategory.all; + if (state4.result.validationChecks) { + state4.result.validationChecks.push(...newCategories); + } else { + state4.result.validationChecks = [...newCategories]; + } + } + } + getBuildOptions(document2) { + var _a, _b; + return (_b = (_a = this.buildState.get(document2.uri.toString())) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : {}; + } + }; } - throw new Error("Class not found: " + id2); - }; - const clear$6 = function() { - relations = []; - classes$2 = {}; - notes = []; - functions = []; - functions.push(setupToolTips); - namespaces = {}; - namespaceCounter = 0; - clear$n(); - }; - const getClass = function(id2) { - return classes$2[id2]; - }; - const getClasses$5 = function() { - return classes$2; - }; - const getRelations$1 = function() { - return relations; - }; - const getNotes = function() { - return notes; - }; - const addRelation$1 = function(relation) { - log$1.debug("Adding relation: " + JSON.stringify(relation)); - addClass(relation.id1); - addClass(relation.id2); - relation.id1 = splitClassNameAndType(relation.id1).className; - relation.id2 = splitClassNameAndType(relation.id2).className; - relation.relationTitle1 = common$1.sanitizeText(relation.relationTitle1.trim(), getConfig$1()); - relation.relationTitle2 = common$1.sanitizeText(relation.relationTitle2.trim(), getConfig$1()); - relations.push(relation); - }; - const addAnnotation = function(className, annotation) { - const validatedClassName = splitClassNameAndType(className).className; - classes$2[validatedClassName].annotations.push(annotation); - }; - const addMember = function(className, member) { - addClass(className); - const validatedClassName = splitClassNameAndType(className).className; - const theClass = classes$2[validatedClassName]; - if (typeof member === "string") { - const memberString = member.trim(); - if (memberString.startsWith("<<") && memberString.endsWith(">>")) { - theClass.annotations.push(sanitizeText$2(memberString.substring(2, memberString.length - 2))); - } else if (memberString.indexOf(")") > 0) { - theClass.methods.push(new ClassMember(memberString, "method")); - } else if (memberString) { - theClass.members.push(new ClassMember(memberString, "attribute")); - } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index-manager.js + var DefaultIndexManager; + var init_index_manager = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index-manager.js"() { + "use strict"; + init_ast_utils(); + init_caching(); + init_cancellation(); + init_stream(); + init_uri_utils(); + DefaultIndexManager = class { + static { + __name(this, "DefaultIndexManager"); + } + constructor(services) { + this.symbolIndex = /* @__PURE__ */ new Map(); + this.symbolByTypeIndex = new ContextCache(); + this.referenceIndex = /* @__PURE__ */ new Map(); + this.documents = services.workspace.LangiumDocuments; + this.serviceRegistry = services.ServiceRegistry; + this.astReflection = services.AstReflection; + } + findAllReferences(targetNode, astNodePath) { + const targetDocUri = getDocument(targetNode).uri; + const result = []; + this.referenceIndex.forEach((docRefs) => { + docRefs.forEach((refDescr) => { + if (UriUtils.equals(refDescr.targetUri, targetDocUri) && refDescr.targetPath === astNodePath) { + result.push(refDescr); + } + }); + }); + return stream(result); + } + allElements(nodeType2, uris) { + let documentUris = stream(this.symbolIndex.keys()); + if (uris) { + documentUris = documentUris.filter((uri) => !uris || uris.has(uri)); + } + return documentUris.map((uri) => this.getFileDescriptions(uri, nodeType2)).flat(); + } + getFileDescriptions(uri, nodeType2) { + var _a; + if (!nodeType2) { + return (_a = this.symbolIndex.get(uri)) !== null && _a !== void 0 ? _a : []; + } + const descriptions = this.symbolByTypeIndex.get(uri, nodeType2, () => { + var _a2; + const allFileDescriptions = (_a2 = this.symbolIndex.get(uri)) !== null && _a2 !== void 0 ? _a2 : []; + return allFileDescriptions.filter((e3) => this.astReflection.isSubtype(e3.type, nodeType2)); + }); + return descriptions; + } + remove(uri) { + const uriString = uri.toString(); + this.symbolIndex.delete(uriString); + this.symbolByTypeIndex.clear(uriString); + this.referenceIndex.delete(uriString); + } + async updateContent(document2, cancelToken = cancellation_exports.CancellationToken.None) { + const services = this.serviceRegistry.getServices(document2.uri); + const exports2 = await services.references.ScopeComputation.computeExports(document2, cancelToken); + const uri = document2.uri.toString(); + this.symbolIndex.set(uri, exports2); + this.symbolByTypeIndex.clear(uri); + } + async updateReferences(document2, cancelToken = cancellation_exports.CancellationToken.None) { + const services = this.serviceRegistry.getServices(document2.uri); + const indexData = await services.workspace.ReferenceDescriptionProvider.createDescriptions(document2, cancelToken); + this.referenceIndex.set(document2.uri.toString(), indexData); + } + isAffected(document2, changedUris) { + const references = this.referenceIndex.get(document2.uri.toString()); + if (!references) { + return false; + } + return references.some((ref) => !ref.local && changedUris.has(ref.targetUri.toString())); + } + }; } - }; - const addMembers = function(className, members) { - if (Array.isArray(members)) { - members.reverse(); - members.forEach((member) => addMember(className, member)); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-manager.js + var DefaultWorkspaceManager; + var init_workspace_manager = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-manager.js"() { + "use strict"; + init_cancellation(); + init_promise_utils(); + init_uri_utils(); + DefaultWorkspaceManager = class { + static { + __name(this, "DefaultWorkspaceManager"); + } + constructor(services) { + this.initialBuildOptions = {}; + this._ready = new Deferred(); + this.serviceRegistry = services.ServiceRegistry; + this.langiumDocuments = services.workspace.LangiumDocuments; + this.documentBuilder = services.workspace.DocumentBuilder; + this.fileSystemProvider = services.workspace.FileSystemProvider; + this.mutex = services.workspace.WorkspaceLock; + } + get ready() { + return this._ready.promise; + } + initialize(params) { + var _a; + this.folders = (_a = params.workspaceFolders) !== null && _a !== void 0 ? _a : void 0; + } + initialized(_params) { + return this.mutex.write((token2) => { + var _a; + return this.initializeWorkspace((_a = this.folders) !== null && _a !== void 0 ? _a : [], token2); + }); + } + async initializeWorkspace(folders, cancelToken = cancellation_exports.CancellationToken.None) { + const documents2 = await this.performStartup(folders); + await interruptAndCheck(cancelToken); + await this.documentBuilder.build(documents2, this.initialBuildOptions, cancelToken); + } + /** + * Performs the uninterruptable startup sequence of the workspace manager. + * This methods loads all documents in the workspace and other documents and returns them. + */ + async performStartup(folders) { + const fileExtensions = this.serviceRegistry.all.flatMap((e3) => e3.LanguageMetaData.fileExtensions); + const documents2 = []; + const collector = /* @__PURE__ */ __name((document2) => { + documents2.push(document2); + if (!this.langiumDocuments.hasDocument(document2.uri)) { + this.langiumDocuments.addDocument(document2); + } + }, "collector"); + await this.loadAdditionalDocuments(folders, collector); + await Promise.all(folders.map((wf) => [wf, this.getRootFolder(wf)]).map(async (entry) => this.traverseFolder(...entry, fileExtensions, collector))); + this._ready.resolve(); + return documents2; + } + /** + * Load all additional documents that shall be visible in the context of the given workspace + * folders and add them to the collector. This can be used to include built-in libraries of + * your language, which can be either loaded from provided files or constructed in memory. + */ + loadAdditionalDocuments(_folders, _collector) { + return Promise.resolve(); + } + /** + * Determine the root folder of the source documents in the given workspace folder. + * The default implementation returns the URI of the workspace folder, but you can override + * this to return a subfolder like `src` instead. + */ + getRootFolder(workspaceFolder) { + return URI2.parse(workspaceFolder.uri); + } + /** + * Traverse the file system folder identified by the given URI and its subfolders. All + * contained files that match the file extensions are added to the collector. + */ + async traverseFolder(workspaceFolder, folderPath, fileExtensions, collector) { + const content = await this.fileSystemProvider.readDirectory(folderPath); + await Promise.all(content.map(async (entry) => { + if (this.includeEntry(workspaceFolder, entry, fileExtensions)) { + if (entry.isDirectory) { + await this.traverseFolder(workspaceFolder, entry.uri, fileExtensions, collector); + } else if (entry.isFile) { + const document2 = await this.langiumDocuments.getOrCreateDocument(entry.uri); + collector(document2); + } + } + })); + } + /** + * Determine whether the given folder entry shall be included while indexing the workspace. + */ + includeEntry(_workspaceFolder, entry, fileExtensions) { + const name = UriUtils.basename(entry.uri); + if (name.startsWith(".")) { + return false; + } + if (entry.isDirectory) { + return name !== "node_modules" && name !== "out"; + } else if (entry.isFile) { + const extname = UriUtils.extname(entry.uri); + return fileExtensions.includes(extname); + } + return false; + } + }; } - }; - const addNote = function(text2, className) { - const note2 = { - id: `note${notes.length}`, - class: className, - text: text2 - }; - notes.push(note2); - }; - const cleanupLabel$1 = function(label) { - if (label.startsWith(":")) { - label = label.substring(1); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/lexer.js + function isTokenTypeArray(tokenVocabulary) { + return Array.isArray(tokenVocabulary) && (tokenVocabulary.length === 0 || "name" in tokenVocabulary[0]); + } + function isIMultiModeLexerDefinition(tokenVocabulary) { + return tokenVocabulary && "modes" in tokenVocabulary && "defaultMode" in tokenVocabulary; + } + function isTokenTypeDictionary(tokenVocabulary) { + return !isTokenTypeArray(tokenVocabulary) && !isIMultiModeLexerDefinition(tokenVocabulary); + } + var DefaultLexer; + var init_lexer2 = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/lexer.js"() { + "use strict"; + init_api5(); + DefaultLexer = class { + static { + __name(this, "DefaultLexer"); + } + constructor(services) { + const tokens2 = services.parser.TokenBuilder.buildTokens(services.Grammar, { + caseInsensitive: services.LanguageMetaData.caseInsensitive + }); + this.tokenTypes = this.toTokenTypeDictionary(tokens2); + const lexerTokens = isTokenTypeDictionary(tokens2) ? Object.values(tokens2) : tokens2; + this.chevrotainLexer = new Lexer2(lexerTokens, { + positionTracking: "full" + }); + } + get definition() { + return this.tokenTypes; + } + tokenize(text2) { + var _a; + const chevrotainResult = this.chevrotainLexer.tokenize(text2); + return { + tokens: chevrotainResult.tokens, + errors: chevrotainResult.errors, + hidden: (_a = chevrotainResult.groups.hidden) !== null && _a !== void 0 ? _a : [] + }; + } + toTokenTypeDictionary(buildTokens) { + if (isTokenTypeDictionary(buildTokens)) + return buildTokens; + const tokens2 = isIMultiModeLexerDefinition(buildTokens) ? Object.values(buildTokens.modes).flat() : buildTokens; + const res = {}; + tokens2.forEach((token2) => res[token2.name] = token2); + return res; + } + }; + __name(isTokenTypeArray, "isTokenTypeArray"); + __name(isIMultiModeLexerDefinition, "isIMultiModeLexerDefinition"); + __name(isTokenTypeDictionary, "isTokenTypeDictionary"); } - return sanitizeText$2(label.trim()); - }; - const setCssClass$2 = function(ids, className) { - ids.split(",").forEach(function(_id) { - let id2 = _id; - if (_id[0].match(/\d/)) { - id2 = MERMAID_DOM_ID_PREFIX + id2; - } - if (classes$2[id2] !== void 0) { - classes$2[id2].cssClasses.push(className); - } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/jsdoc.js + function parseJSDoc(node2, start3, options3) { + let opts; + let position5; + if (typeof node2 === "string") { + position5 = start3; + opts = options3; + } else { + position5 = node2.range.start; + opts = start3; + } + if (!position5) { + position5 = Position.create(0, 0); + } + const lines = getLines(node2); + const normalizedOptions = normalizeOptions(opts); + const tokens2 = tokenize({ + lines, + position: position5, + options: normalizedOptions }); - }; - const setTooltip = function(ids, tooltip) { - ids.split(",").forEach(function(id2) { - if (tooltip !== void 0) { - classes$2[id2].tooltip = sanitizeText$2(tooltip); - } + return parseJSDocComment({ + index: 0, + tokens: tokens2, + position: position5 }); - }; - const getTooltip = function(id2, namespace2) { - if (namespace2) { - return namespaces[namespace2].classes[id2].tooltip; + } + function isJSDoc(node2, options3) { + const normalizedOptions = normalizeOptions(options3); + const lines = getLines(node2); + if (lines.length === 0) { + return false; } - return classes$2[id2].tooltip; - }; - const setLink = function(ids, linkStr, target) { - const config2 = getConfig$1(); - ids.split(",").forEach(function(_id) { - let id2 = _id; - if (_id[0].match(/\d/)) { - id2 = MERMAID_DOM_ID_PREFIX + id2; - } - if (classes$2[id2] !== void 0) { - classes$2[id2].link = utils$1.formatUrl(linkStr, config2); - if (config2.securityLevel === "sandbox") { - classes$2[id2].linkTarget = "_top"; - } else if (typeof target === "string") { - classes$2[id2].linkTarget = sanitizeText$2(target); - } else { - classes$2[id2].linkTarget = "_blank"; + const first3 = lines[0]; + const last3 = lines[lines.length - 1]; + const firstRegex = normalizedOptions.start; + const lastRegex = normalizedOptions.end; + return Boolean(firstRegex === null || firstRegex === void 0 ? void 0 : firstRegex.exec(first3)) && Boolean(lastRegex === null || lastRegex === void 0 ? void 0 : lastRegex.exec(last3)); + } + function getLines(node2) { + let content = ""; + if (typeof node2 === "string") { + content = node2; + } else { + content = node2.text; + } + const lines = content.split(NEWLINE_REGEXP); + return lines; + } + function tokenize(context) { + var _a, _b, _c; + const tokens2 = []; + let currentLine = context.position.line; + let currentCharacter = context.position.character; + for (let i2 = 0; i2 < context.lines.length; i2++) { + const first3 = i2 === 0; + const last3 = i2 === context.lines.length - 1; + let line2 = context.lines[i2]; + let index = 0; + if (first3 && context.options.start) { + const match2 = (_a = context.options.start) === null || _a === void 0 ? void 0 : _a.exec(line2); + if (match2) { + index = match2.index + match2[0].length; + } + } else { + const match2 = (_b = context.options.line) === null || _b === void 0 ? void 0 : _b.exec(line2); + if (match2) { + index = match2.index + match2[0].length; } } - }); - setCssClass$2(ids, "clickable"); - }; - const setClickEvent = function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id2) { - setClickFunc(id2, functionName, functionArgs); - classes$2[id2].haveCallback = true; - }); - setCssClass$2(ids, "clickable"); - }; - const setClickFunc = function(_domId, functionName, functionArgs) { - const domId = common$1.sanitizeText(_domId, getConfig$1()); - const config2 = getConfig$1(); - if (config2.securityLevel !== "loose") { - return; + if (last3) { + const match2 = (_c = context.options.end) === null || _c === void 0 ? void 0 : _c.exec(line2); + if (match2) { + line2 = line2.substring(0, match2.index); + } + } + line2 = line2.substring(0, lastCharacter(line2)); + const whitespaceEnd = skipWhitespace(line2, index); + if (whitespaceEnd >= line2.length) { + if (tokens2.length > 0) { + const position5 = Position.create(currentLine, currentCharacter); + tokens2.push({ + type: "break", + content: "", + range: Range.create(position5, position5) + }); + } + } else { + tagRegex.lastIndex = index; + const tagMatch = tagRegex.exec(line2); + if (tagMatch) { + const fullMatch = tagMatch[0]; + const value2 = tagMatch[1]; + const start3 = Position.create(currentLine, currentCharacter + index); + const end2 = Position.create(currentLine, currentCharacter + index + fullMatch.length); + tokens2.push({ + type: "tag", + content: value2, + range: Range.create(start3, end2) + }); + index += fullMatch.length; + index = skipWhitespace(line2, index); + } + if (index < line2.length) { + const rest = line2.substring(index); + const inlineTagMatches = Array.from(rest.matchAll(inlineTagRegex)); + tokens2.push(...buildInlineTokens(inlineTagMatches, rest, currentLine, currentCharacter + index)); + } + } + currentLine++; + currentCharacter = 0; } - if (functionName === void 0) { - return; + if (tokens2.length > 0 && tokens2[tokens2.length - 1].type === "break") { + return tokens2.slice(0, -1); } - const id2 = domId; - if (classes$2[id2] !== void 0) { - const elemId = lookUpDomId(id2); - let argList = []; - if (typeof functionArgs === "string") { - argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); - for (let i2 = 0; i2 < argList.length; i2++) { - let item = argList[i2].trim(); - if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { - item = item.substr(1, item.length - 2); - } - argList[i2] = item; - } - } - if (argList.length === 0) { - argList.push(elemId); - } - functions.push(function() { - const elem = document.querySelector(`[id="${elemId}"]`); - if (elem !== null) { - elem.addEventListener( - "click", - function() { - utils$1.runFunc(functionName, ...argList); - }, - false - ); - } + return tokens2; + } + function buildInlineTokens(tags2, line2, lineIndex, characterIndex) { + const tokens2 = []; + if (tags2.length === 0) { + const start3 = Position.create(lineIndex, characterIndex); + const end2 = Position.create(lineIndex, characterIndex + line2.length); + tokens2.push({ + type: "text", + content: line2, + range: Range.create(start3, end2) }); - } - }; - const bindFunctions = function(element2) { - functions.forEach(function(fun) { - fun(element2); - }); - }; - const lineType$1 = { - LINE: 0, - DOTTED_LINE: 1 - }; - const relationType$1 = { - AGGREGATION: 0, - EXTENSION: 1, - COMPOSITION: 2, - DEPENDENCY: 3, - LOLLIPOP: 4 - }; - const setupToolTips = function(element2) { - let tooltipElem = d3select(".mermaidTooltip"); - if ((tooltipElem._groups || tooltipElem)[0][0] === null) { - tooltipElem = d3select("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); - } - const svg2 = d3select(element2).select("svg"); - const nodes2 = svg2.selectAll("g.node"); - nodes2.on("mouseover", function() { - const el = d3select(this); - const title2 = el.attr("title"); - if (title2 === null) { - return; + } else { + let lastIndex = 0; + for (const match2 of tags2) { + const matchIndex = match2.index; + const startContent = line2.substring(lastIndex, matchIndex); + if (startContent.length > 0) { + tokens2.push({ + type: "text", + content: line2.substring(lastIndex, matchIndex), + range: Range.create(Position.create(lineIndex, lastIndex + characterIndex), Position.create(lineIndex, matchIndex + characterIndex)) + }); + } + let offset = startContent.length + 1; + const tagName = match2[1]; + tokens2.push({ + type: "inline-tag", + content: tagName, + range: Range.create(Position.create(lineIndex, lastIndex + offset + characterIndex), Position.create(lineIndex, lastIndex + offset + tagName.length + characterIndex)) + }); + offset += tagName.length; + if (match2.length === 4) { + offset += match2[2].length; + const value2 = match2[3]; + tokens2.push({ + type: "text", + content: value2, + range: Range.create(Position.create(lineIndex, lastIndex + offset + characterIndex), Position.create(lineIndex, lastIndex + offset + value2.length + characterIndex)) + }); + } else { + tokens2.push({ + type: "text", + content: "", + range: Range.create(Position.create(lineIndex, lastIndex + offset + characterIndex), Position.create(lineIndex, lastIndex + offset + characterIndex)) + }); + } + lastIndex = matchIndex + match2[0].length; + } + const endContent = line2.substring(lastIndex); + if (endContent.length > 0) { + tokens2.push({ + type: "text", + content: endContent, + range: Range.create(Position.create(lineIndex, lastIndex + characterIndex), Position.create(lineIndex, lastIndex + characterIndex + endContent.length)) + }); } - const rect2 = this.getBoundingClientRect(); - tooltipElem.transition().duration(200).style("opacity", ".9"); - tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect2.left + (rect2.right - rect2.left) / 2 + "px").style("top", window.scrollY + rect2.top - 14 + document.body.scrollTop + "px"); - tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, "
    ")); - el.classed("hover", true); - }).on("mouseout", function() { - tooltipElem.transition().duration(500).style("opacity", 0); - const el = d3select(this); - el.classed("hover", false); - }); - }; - functions.push(setupToolTips); - let direction$1 = "TB"; - const getDirection$1 = () => direction$1; - const setDirection$1 = (dir2) => { - direction$1 = dir2; - }; - const addNamespace = function(id2) { - if (namespaces[id2] !== void 0) { - return; } - namespaces[id2] = { - id: id2, - classes: {}, - children: {}, - domId: MERMAID_DOM_ID_PREFIX + id2 + "-" + namespaceCounter - }; - namespaceCounter++; - }; - const getNamespace = function(name) { - return namespaces[name]; - }; - const getNamespaces = function() { - return namespaces; - }; - const addClassesToNamespace = function(id2, classNames) { - if (namespaces[id2] === void 0) { - return; + return tokens2; + } + function skipWhitespace(line2, index) { + const match2 = line2.substring(index).match(nonWhitespaceRegex); + if (match2) { + return index + match2.index; + } else { + return line2.length; } - for (const name of classNames) { - const { className } = splitClassNameAndType(name); - classes$2[className].parent = id2; - namespaces[id2].classes[className] = classes$2[className]; + } + function lastCharacter(line2) { + const match2 = line2.match(whitespaceEndRegex); + if (match2 && typeof match2.index === "number") { + return match2.index; } - }; - const setCssStyle = function(id2, styles2) { - const thisClass = classes$2[id2]; - if (!styles2 || !thisClass) { - return; + return void 0; + } + function parseJSDocComment(context) { + var _a, _b, _c, _d; + const startPosition = Position.create(context.position.line, context.position.character); + if (context.tokens.length === 0) { + return new JSDocCommentImpl([], Range.create(startPosition, startPosition)); + } + const elements3 = []; + while (context.index < context.tokens.length) { + const element3 = parseJSDocElement(context, elements3[elements3.length - 1]); + if (element3) { + elements3.push(element3); + } + } + const start3 = (_b = (_a = elements3[0]) === null || _a === void 0 ? void 0 : _a.range.start) !== null && _b !== void 0 ? _b : startPosition; + const end2 = (_d = (_c = elements3[elements3.length - 1]) === null || _c === void 0 ? void 0 : _c.range.end) !== null && _d !== void 0 ? _d : startPosition; + return new JSDocCommentImpl(elements3, Range.create(start3, end2)); + } + function parseJSDocElement(context, last3) { + const next3 = context.tokens[context.index]; + if (next3.type === "tag") { + return parseJSDocTag(context, false); + } else if (next3.type === "text" || next3.type === "inline-tag") { + return parseJSDocText(context); + } else { + appendEmptyLine(next3, last3); + context.index++; + return void 0; } - for (const s of styles2) { - if (s.includes(",")) { - thisClass.styles.push(...s.split(",")); + } + function appendEmptyLine(token2, element3) { + if (element3) { + const line2 = new JSDocLineImpl("", token2.range); + if ("inlines" in element3) { + element3.inlines.push(line2); } else { - thisClass.styles.push(s); + element3.content.inlines.push(line2); } } - }; - const db$8 = { - setAccTitle, - getAccTitle, - getAccDescription, - setAccDescription, - getConfig: () => getConfig$1().class, - addClass, - bindFunctions, - clear: clear$6, - getClass, - getClasses: getClasses$5, - getNotes, - addAnnotation, - addNote, - getRelations: getRelations$1, - addRelation: addRelation$1, - getDirection: getDirection$1, - setDirection: setDirection$1, - addMember, - addMembers, - cleanupLabel: cleanupLabel$1, - lineType: lineType$1, - relationType: relationType$1, - setClickEvent, - setCssClass: setCssClass$2, - setLink, - getTooltip, - setTooltip, - lookUpDomId, - setDiagramTitle, - getDiagramTitle, - setClassLabel, - addNamespace, - addClassesToNamespace, - getNamespace, - getNamespaces, - setCssStyle - }; - const getStyles$6 = (options2) => `g.classGroup text { - fill: ${options2.nodeBorder || options2.classText}; - stroke: none; - font-family: ${options2.fontFamily}; - font-size: 10px; - - .title { - font-weight: bolder; - } - -} - -.nodeLabel, .edgeLabel { - color: ${options2.classText}; -} -.edgeLabel .label rect { - fill: ${options2.mainBkg}; -} -.label text { - fill: ${options2.classText}; -} -.edgeLabel .label span { - background: ${options2.mainBkg}; -} - -.classTitle { - font-weight: bolder; -} -.node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; - stroke-width: 1px; } - - -.divider { - stroke: ${options2.nodeBorder}; - stroke-width: 1; -} - -g.clickable { - cursor: pointer; -} - -g.classGroup rect { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; -} - -g.classGroup line { - stroke: ${options2.nodeBorder}; - stroke-width: 1; -} - -.classLabel .box { - stroke: none; - stroke-width: 0; - fill: ${options2.mainBkg}; - opacity: 0.5; -} - -.classLabel .label { - fill: ${options2.nodeBorder}; - font-size: 10px; -} - -.relation { - stroke: ${options2.lineColor}; - stroke-width: 1; - fill: none; -} - -.dashed-line{ - stroke-dasharray: 3; -} - -.dotted-line{ - stroke-dasharray: 1 2; -} - -#compositionStart, .composition { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#compositionEnd, .composition { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#dependencyStart, .dependency { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#dependencyStart, .dependency { - fill: ${options2.lineColor} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#extensionStart, .extension { - fill: transparent !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#extensionEnd, .extension { - fill: transparent !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#aggregationStart, .aggregation { - fill: transparent !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#aggregationEnd, .aggregation { - fill: transparent !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#lollipopStart, .lollipop { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -#lollipopEnd, .lollipop { - fill: ${options2.mainBkg} !important; - stroke: ${options2.lineColor} !important; - stroke-width: 1; -} - -.edgeTerminals { - font-size: 11px; - line-height: initial; -} - -.classTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; -} -`; - const styles$5 = getStyles$6; - let edgeCount$2 = 0; - const drawEdge$1 = function(elem, path2, relation, conf2, diagObj) { - const getRelationType = function(type2) { - switch (type2) { - case diagObj.db.relationType.AGGREGATION: - return "aggregation"; - case diagObj.db.relationType.EXTENSION: - return "extension"; - case diagObj.db.relationType.COMPOSITION: - return "composition"; - case diagObj.db.relationType.DEPENDENCY: - return "dependency"; - case diagObj.db.relationType.LOLLIPOP: - return "lollipop"; - } - }; - path2.points = path2.points.filter((p) => !Number.isNaN(p.y)); - const lineData = path2.points; - const lineFunction = line$1().x(function(d) { - return d.x; - }).y(function(d) { - return d.y; - }).curve(curveBasis); - const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount$2).attr("class", "relation"); - let url = ""; - if (conf2.arrowMarkerAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, "\\("); - url = url.replace(/\)/g, "\\)"); - } - if (relation.relation.lineType == 1) { - svgPath.attr("class", "relation dashed-line"); - } - if (relation.relation.lineType == 10) { - svgPath.attr("class", "relation dotted-line"); - } - if (relation.relation.type1 !== "none") { - svgPath.attr( - "marker-start", - "url(" + url + "#" + getRelationType(relation.relation.type1) + "Start)" - ); - } - if (relation.relation.type2 !== "none") { - svgPath.attr( - "marker-end", - "url(" + url + "#" + getRelationType(relation.relation.type2) + "End)" - ); + function parseJSDocText(context) { + let token2 = context.tokens[context.index]; + const firstToken = token2; + let lastToken = token2; + const lines = []; + while (token2 && token2.type !== "break" && token2.type !== "tag") { + lines.push(parseJSDocInline(context)); + lastToken = token2; + token2 = context.tokens[context.index]; } - let x2, y2; - const l = path2.points.length; - let labelPosition = utils$1.calcLabelPosition(path2.points); - x2 = labelPosition.x; - y2 = labelPosition.y; - let p1_card_x, p1_card_y; - let p2_card_x, p2_card_y; - if (l % 2 !== 0 && l > 1) { - let cardinality_1_point = utils$1.calcCardinalityPosition( - relation.relation.type1 !== "none", - path2.points, - path2.points[0] - ); - let cardinality_2_point = utils$1.calcCardinalityPosition( - relation.relation.type2 !== "none", - path2.points, - path2.points[l - 1] - ); - log$1.debug("cardinality_1_point " + JSON.stringify(cardinality_1_point)); - log$1.debug("cardinality_2_point " + JSON.stringify(cardinality_2_point)); - p1_card_x = cardinality_1_point.x; - p1_card_y = cardinality_1_point.y; - p2_card_x = cardinality_2_point.x; - p2_card_y = cardinality_2_point.y; - } - if (relation.title !== void 0) { - const g = elem.append("g").attr("class", "classLabel"); - const label = g.append("text").attr("class", "label").attr("x", x2).attr("y", y2).attr("fill", "red").attr("text-anchor", "middle").text(relation.title); - window.label = label; - const bounds2 = label.node().getBBox(); - g.insert("rect", ":first-child").attr("class", "box").attr("x", bounds2.x - conf2.padding / 2).attr("y", bounds2.y - conf2.padding / 2).attr("width", bounds2.width + conf2.padding).attr("height", bounds2.height + conf2.padding); - } - log$1.info("Rendering relation " + JSON.stringify(relation)); - if (relation.relationTitle1 !== void 0 && relation.relationTitle1 !== "none") { - const g = elem.append("g").attr("class", "cardinality"); - g.append("text").attr("class", "type1").attr("x", p1_card_x).attr("y", p1_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle1); - } - if (relation.relationTitle2 !== void 0 && relation.relationTitle2 !== "none") { - const g = elem.append("g").attr("class", "cardinality"); - g.append("text").attr("class", "type2").attr("x", p2_card_x).attr("y", p2_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle2); - } - edgeCount$2++; - }; - const drawClass = function(elem, classDef, conf2, diagObj) { - log$1.debug("Rendering class ", classDef, conf2); - const id2 = classDef.id; - const classInfo = { - id: id2, - label: classDef.id, - width: 0, - height: 0 - }; - const g = elem.append("g").attr("id", diagObj.db.lookUpDomId(id2)).attr("class", "classGroup"); - let title2; - if (classDef.link) { - title2 = g.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf2.textHeight + conf2.padding).attr("x", 0); + return new JSDocTextImpl(lines, Range.create(firstToken.range.start, lastToken.range.end)); + } + function parseJSDocInline(context) { + const token2 = context.tokens[context.index]; + if (token2.type === "inline-tag") { + return parseJSDocTag(context, true); } else { - title2 = g.append("text").attr("y", conf2.textHeight + conf2.padding).attr("x", 0); + return parseJSDocLine(context); } - let isFirst = true; - classDef.annotations.forEach(function(member) { - const titleText2 = title2.append("tspan").text("«" + member + "»"); - if (!isFirst) { - titleText2.attr("dy", conf2.textHeight); + } + function parseJSDocTag(context, inline2) { + const tagToken = context.tokens[context.index++]; + const name = tagToken.content.substring(1); + const nextToken = context.tokens[context.index]; + if ((nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) === "text") { + if (inline2) { + const docLine = parseJSDocLine(context); + return new JSDocTagImpl(name, new JSDocTextImpl([docLine], docLine.range), inline2, Range.create(tagToken.range.start, docLine.range.end)); + } else { + const textDoc = parseJSDocText(context); + return new JSDocTagImpl(name, textDoc, inline2, Range.create(tagToken.range.start, textDoc.range.end)); } - isFirst = false; - }); - let classTitleString = getClassTitleString(classDef); - const classTitle = title2.append("tspan").text(classTitleString).attr("class", "title"); - if (!isFirst) { - classTitle.attr("dy", conf2.textHeight); - } - const titleHeight = title2.node().getBBox().height; - let membersLine; - let membersBox; - let methodsLine; - if (classDef.members.length > 0) { - membersLine = g.append("line").attr("x1", 0).attr("y1", conf2.padding + titleHeight + conf2.dividerMargin / 2).attr("y2", conf2.padding + titleHeight + conf2.dividerMargin / 2); - const members = g.append("text").attr("x", conf2.padding).attr("y", titleHeight + conf2.dividerMargin + conf2.textHeight).attr("fill", "white").attr("class", "classText"); - isFirst = true; - classDef.members.forEach(function(member) { - addTspan(members, member, isFirst, conf2); - isFirst = false; - }); - membersBox = members.node().getBBox(); - } - if (classDef.methods.length > 0) { - methodsLine = g.append("line").attr("x1", 0).attr("y1", conf2.padding + titleHeight + conf2.dividerMargin + membersBox.height).attr("y2", conf2.padding + titleHeight + conf2.dividerMargin + membersBox.height); - const methods = g.append("text").attr("x", conf2.padding).attr("y", titleHeight + 2 * conf2.dividerMargin + membersBox.height + conf2.textHeight).attr("fill", "white").attr("class", "classText"); - isFirst = true; - classDef.methods.forEach(function(method) { - addTspan(methods, method, isFirst, conf2); - isFirst = false; - }); - } - const classBox = g.node().getBBox(); - var cssClassStr = " "; - if (classDef.cssClasses.length > 0) { - cssClassStr = cssClassStr + classDef.cssClasses.join(" "); - } - const rect2 = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf2.padding).attr("height", classBox.height + conf2.padding + 0.5 * conf2.dividerMargin).attr("class", cssClassStr); - const rectWidth = rect2.node().getBBox().width; - title2.node().childNodes.forEach(function(x2) { - x2.setAttribute("x", (rectWidth - x2.getBBox().width) / 2); - }); - if (classDef.tooltip) { - title2.insert("title").text(classDef.tooltip); - } - if (membersLine) { - membersLine.attr("x2", rectWidth); - } - if (methodsLine) { - methodsLine.attr("x2", rectWidth); + } else { + const range3 = tagToken.range; + return new JSDocTagImpl(name, new JSDocTextImpl([], range3), inline2, range3); } - classInfo.width = rectWidth; - classInfo.height = classBox.height + conf2.padding + 0.5 * conf2.dividerMargin; - return classInfo; - }; - const getClassTitleString = function(classDef) { - let classTitleString = classDef.id; - if (classDef.type) { - classTitleString += "<" + parseGenericTypes(classDef.type) + ">"; + } + function parseJSDocLine(context) { + const token2 = context.tokens[context.index++]; + return new JSDocLineImpl(token2.content, token2.range); + } + function normalizeOptions(options3) { + if (!options3) { + return normalizeOptions({ + start: "/**", + end: "*/", + line: "*" + }); } - return classTitleString; - }; - const drawNote$1 = function(elem, note2, conf2, diagObj) { - log$1.debug("Rendering note ", note2, conf2); - const id2 = note2.id; - const noteInfo = { - id: id2, - text: note2.text, - width: 0, - height: 0 + const { start: start3, end: end2, line: line2 } = options3; + return { + start: normalizeOption(start3, true), + end: normalizeOption(end2, false), + line: normalizeOption(line2, true) }; - const g = elem.append("g").attr("id", id2).attr("class", "classGroup"); - let text2 = g.append("text").attr("y", conf2.textHeight + conf2.padding).attr("x", 0); - const lines = JSON.parse(`"${note2.text}"`).split("\n"); - lines.forEach(function(line2) { - log$1.debug(`Adding line: ${line2}`); - text2.append("tspan").text(line2).attr("class", "title").attr("dy", conf2.textHeight); - }); - const noteBox = g.node().getBBox(); - const rect2 = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", noteBox.width + 2 * conf2.padding).attr( - "height", - noteBox.height + lines.length * conf2.textHeight + conf2.padding + 0.5 * conf2.dividerMargin - ); - const rectWidth = rect2.node().getBBox().width; - text2.node().childNodes.forEach(function(x2) { - x2.setAttribute("x", (rectWidth - x2.getBBox().width) / 2); - }); - noteInfo.width = rectWidth; - noteInfo.height = noteBox.height + lines.length * conf2.textHeight + conf2.padding + 0.5 * conf2.dividerMargin; - return noteInfo; - }; - const addTspan = function(textEl, member, isFirst, conf2) { - const { displayText, cssStyle } = member.getDisplayDetails(); - const tSpan = textEl.append("tspan").attr("x", conf2.padding).text(displayText); - if (cssStyle !== "") { - tSpan.attr("style", member.cssStyle); - } - if (!isFirst) { - tSpan.attr("dy", conf2.textHeight); - } - }; - const svgDraw$2 = { - getClassTitleString, - drawClass, - drawEdge: drawEdge$1, - drawNote: drawNote$1 - }; - let idCache$2 = {}; - const padding$1 = 20; - const getGraphId = function(label) { - const foundEntry = Object.entries(idCache$2).find((entry) => entry[1].label === label); - if (foundEntry) { - return foundEntry[0]; - } - }; - const insertMarkers$1 = function(elem) { - elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); - elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); - elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); - elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); - }; - const draw$9 = function(text2, id2, _version, diagObj) { - const conf2 = getConfig$1().class; - idCache$2 = {}; - log$1.info("Rendering diagram " + text2); - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const diagram2 = root2.select(`[id='${id2}']`); - insertMarkers$1(diagram2); - const g = new Graph({ - multigraph: true - }); - g.setGraph({ - isMultiGraph: true - }); - g.setDefaultEdgeLabel(function() { - return {}; - }); - const classes2 = diagObj.db.getClasses(); - const keys2 = Object.keys(classes2); - for (const key of keys2) { - const classDef = classes2[key]; - const node2 = svgDraw$2.drawClass(diagram2, classDef, conf2, diagObj); - idCache$2[node2.id] = node2; - g.setNode(node2.id, node2); - log$1.info("Org height: " + node2.height); - } - const relations2 = diagObj.db.getRelations(); - relations2.forEach(function(relation) { - log$1.info( - // cspell:ignore tjoho - "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation) - ); - g.setEdge( - getGraphId(relation.id1), - getGraphId(relation.id2), - { - relation - }, - relation.title || "DEFAULT" - ); - }); - const notes2 = diagObj.db.getNotes(); - notes2.forEach(function(note2) { - log$1.debug(`Adding note: ${JSON.stringify(note2)}`); - const node2 = svgDraw$2.drawNote(diagram2, note2, conf2, diagObj); - idCache$2[node2.id] = node2; - g.setNode(node2.id, node2); - if (note2.class && note2.class in classes2) { - g.setEdge( - note2.id, - getGraphId(note2.class), - { - relation: { - id1: note2.id, - id2: note2.class, - relation: { - type1: "none", - type2: "none", - lineType: 10 - } - } - }, - "DEFAULT" - ); + } + function normalizeOption(option2, start3) { + if (typeof option2 === "string" || typeof option2 === "object") { + const escaped = typeof option2 === "string" ? escapeRegExp(option2) : option2.source; + if (start3) { + return new RegExp(`^\\s*${escaped}`); + } else { + return new RegExp(`\\s*${escaped}\\s*$`); } - }); - layout$1(g); - g.nodes().forEach(function(v) { - if (v !== void 0 && g.node(v) !== void 0) { - log$1.debug("Node " + v + ": " + JSON.stringify(g.node(v))); - root2.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr( - "transform", - "translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )" - ); + } else { + return option2; + } + } + function renderInlineTag(tag2, content, options3) { + var _a, _b; + if (tag2 === "linkplain" || tag2 === "linkcode" || tag2 === "link") { + const index = content.indexOf(" "); + let display = content; + if (index > 0) { + const displayStart = skipWhitespace(content, index); + display = content.substring(displayStart); + content = content.substring(0, index); } - }); - g.edges().forEach(function(e) { - if (e !== void 0 && g.edge(e) !== void 0) { - log$1.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e))); - svgDraw$2.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf2, diagObj); + if (tag2 === "linkcode" || tag2 === "link" && options3.link === "code") { + display = `\`${display}\``; } - }); - const svgBounds = diagram2.node().getBBox(); - const width2 = svgBounds.width + padding$1 * 2; - const height = svgBounds.height + padding$1 * 2; - configureSvgSize(diagram2, height, width2, conf2.useMaxWidth); - const vBox = `${svgBounds.x - padding$1} ${svgBounds.y - padding$1} ${width2} ${height}`; - log$1.debug(`viewBox ${vBox}`); - diagram2.attr("viewBox", vBox); - }; - const renderer$9 = { - draw: draw$9 - }; - const diagram$9 = { - parser: parser$d, - db: db$8, - renderer: renderer$9, - styles: styles$5, - init: (cnf) => { - if (!cnf.class) { - cnf.class = {}; - } - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$8.clear(); + const renderedLink = (_b = (_a = options3.renderLink) === null || _a === void 0 ? void 0 : _a.call(options3, content, display)) !== null && _b !== void 0 ? _b : renderLinkDefault(content, display); + return renderedLink; } - }; - const classDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$9 - }, Symbol.toStringTag, { value: "Module" })); - const sanitizeText$1 = (txt) => common$1.sanitizeText(txt, getConfig$1()); - let conf$3 = { - dividerMargin: 10, - padding: 5, - textHeight: 10, - curve: void 0 - }; - const addNamespaces = function(namespaces2, g, _id, diagObj) { - const keys2 = Object.keys(namespaces2); - log$1.info("keys:", keys2); - log$1.info(namespaces2); - keys2.forEach(function(id2) { - var _a2, _b2; - const vertex = namespaces2[id2]; - const shape = "rect"; - const node2 = { - shape, - id: vertex.id, - domId: vertex.domId, - labelText: sanitizeText$1(vertex.id), - labelStyle: "", - style: "fill: none; stroke: black", - // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release - padding: ((_a2 = getConfig$1().flowchart) == null ? void 0 : _a2.padding) ?? ((_b2 = getConfig$1().class) == null ? void 0 : _b2.padding) - }; - g.setNode(vertex.id, node2); - addClasses(vertex.classes, g, _id, diagObj, vertex.id); - log$1.info("setNode", node2); - }); - }; - const addClasses = function(classes2, g, _id, diagObj, parent) { - const keys2 = Object.keys(classes2); - log$1.info("keys:", keys2); - log$1.info(classes2); - keys2.filter((id2) => classes2[id2].parent == parent).forEach(function(id2) { - var _a2, _b2; - const vertex = classes2[id2]; - const cssClassStr = vertex.cssClasses.join(" "); - const styles2 = getStylesFromArray(vertex.styles); - const vertexText = vertex.label ?? vertex.id; - const radius = 0; - const shape = "class_box"; - const node2 = { - labelStyle: styles2.labelStyle, - shape, - labelText: sanitizeText$1(vertexText), - classData: vertex, - rx: radius, - ry: radius, - class: cssClassStr, - style: styles2.style, - id: vertex.id, - domId: vertex.domId, - tooltip: diagObj.db.getTooltip(vertex.id, parent) || "", - haveCallback: vertex.haveCallback, - link: vertex.link, - width: vertex.type === "group" ? 500 : void 0, - type: vertex.type, - // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release - padding: ((_a2 = getConfig$1().flowchart) == null ? void 0 : _a2.padding) ?? ((_b2 = getConfig$1().class) == null ? void 0 : _b2.padding) - }; - g.setNode(vertex.id, node2); - if (parent) { - g.setParent(vertex.id, parent); - } - log$1.info("setNode", node2); - }); - }; - const addNotes = function(notes2, g, startEdgeId, classes2) { - log$1.info(notes2); - notes2.forEach(function(note2, i2) { - var _a2, _b2; - const vertex = note2; - const cssNoteStr = ""; - const styles2 = { labelStyle: "", style: "" }; - const vertexText = vertex.text; - const radius = 0; - const shape = "note"; - const node2 = { - labelStyle: styles2.labelStyle, - shape, - labelText: sanitizeText$1(vertexText), - noteData: vertex, - rx: radius, - ry: radius, - class: cssNoteStr, - style: styles2.style, - id: vertex.id, - domId: vertex.id, - tooltip: "", - type: "note", - // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release - padding: ((_a2 = getConfig$1().flowchart) == null ? void 0 : _a2.padding) ?? ((_b2 = getConfig$1().class) == null ? void 0 : _b2.padding) - }; - g.setNode(vertex.id, node2); - log$1.info("setNode", node2); - if (!vertex.class || !(vertex.class in classes2)) { - return; - } - const edgeId = startEdgeId + i2; - const edgeData = { - id: `edgeNote${edgeId}`, - //Set relationship style and line type - classes: "relation", - pattern: "dotted", - // Set link type for rendering - arrowhead: "none", - //Set edge extra labels - startLabelRight: "", - endLabelLeft: "", - //Set relation arrow types - arrowTypeStart: "none", - arrowTypeEnd: "none", - style: "fill:none", - labelStyle: "", - curve: interpolateToCurve(conf$3.curve, curveLinear) - }; - g.setEdge(vertex.id, vertex.class, edgeData, edgeId); - }); - }; - const addRelations = function(relations2, g) { - const conf2 = getConfig$1().flowchart; - let cnt2 = 0; - relations2.forEach(function(edge) { - var _a2; - cnt2++; - const edgeData = { - //Set relationship style and line type - classes: "relation", - pattern: edge.relation.lineType == 1 ? "dashed" : "solid", - id: `id_${edge.id1}_${edge.id2}_${cnt2}`, - // Set link type for rendering - arrowhead: edge.type === "arrow_open" ? "none" : "normal", - //Set edge extra labels - startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1, - endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2, - //Set relation arrow types - arrowTypeStart: getArrowMarker(edge.relation.type1), - arrowTypeEnd: getArrowMarker(edge.relation.type2), - style: "fill:none", - labelStyle: "", - curve: interpolateToCurve(conf2 == null ? void 0 : conf2.curve, curveLinear) - }; - log$1.info(edgeData, edge); - if (edge.style !== void 0) { - const styles2 = getStylesFromArray(edge.style); - edgeData.style = styles2.style; - edgeData.labelStyle = styles2.labelStyle; - } - edge.text = edge.title; - if (edge.text === void 0) { - if (edge.style !== void 0) { - edgeData.arrowheadStyle = "fill: #333"; + return void 0; + } + function renderLinkDefault(content, display) { + try { + URI2.parse(content, true); + return `[${display}](${content})`; + } catch (_a) { + return content; + } + } + function fillNewlines(text2) { + if (text2.endsWith("\n")) { + return "\n"; + } else { + return "\n\n"; + } + } + var tagRegex, inlineTagRegex, nonWhitespaceRegex, whitespaceEndRegex, JSDocCommentImpl, JSDocTagImpl, JSDocTextImpl, JSDocLineImpl; + var init_jsdoc = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/jsdoc.js"() { + "use strict"; + init_main(); + init_regexp_utils(); + init_uri_utils(); + __name(parseJSDoc, "parseJSDoc"); + __name(isJSDoc, "isJSDoc"); + __name(getLines, "getLines"); + tagRegex = /\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy; + inlineTagRegex = /\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu; + __name(tokenize, "tokenize"); + __name(buildInlineTokens, "buildInlineTokens"); + nonWhitespaceRegex = /\S/; + whitespaceEndRegex = /\s*$/; + __name(skipWhitespace, "skipWhitespace"); + __name(lastCharacter, "lastCharacter"); + __name(parseJSDocComment, "parseJSDocComment"); + __name(parseJSDocElement, "parseJSDocElement"); + __name(appendEmptyLine, "appendEmptyLine"); + __name(parseJSDocText, "parseJSDocText"); + __name(parseJSDocInline, "parseJSDocInline"); + __name(parseJSDocTag, "parseJSDocTag"); + __name(parseJSDocLine, "parseJSDocLine"); + __name(normalizeOptions, "normalizeOptions"); + __name(normalizeOption, "normalizeOption"); + JSDocCommentImpl = class { + static { + __name(this, "JSDocCommentImpl"); + } + constructor(elements3, range3) { + this.elements = elements3; + this.range = range3; + } + getTag(name) { + return this.getAllTags().find((e3) => e3.name === name); + } + getTags(name) { + return this.getAllTags().filter((e3) => e3.name === name); + } + getAllTags() { + return this.elements.filter((e3) => "name" in e3); + } + toString() { + let value2 = ""; + for (const element3 of this.elements) { + if (value2.length === 0) { + value2 = element3.toString(); + } else { + const text2 = element3.toString(); + value2 += fillNewlines(value2) + text2; + } + } + return value2.trim(); } - } else { - edgeData.arrowheadStyle = "fill: #333"; - edgeData.labelpos = "c"; - if (((_a2 = getConfig$1().flowchart) == null ? void 0 : _a2.htmlLabels) ?? getConfig$1().htmlLabels) { - edgeData.labelType = "html"; - edgeData.label = '' + edge.text + ""; - } else { - edgeData.labelType = "text"; - edgeData.label = edge.text.replace(common$1.lineBreakRegex, "\n"); - if (edge.style === void 0) { - edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none"; + toMarkdown(options3) { + let value2 = ""; + for (const element3 of this.elements) { + if (value2.length === 0) { + value2 = element3.toMarkdown(options3); + } else { + const text2 = element3.toMarkdown(options3); + value2 += fillNewlines(value2) + text2; + } } - edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); + return value2.trim(); } - } - g.setEdge(edge.id1, edge.id2, edgeData, cnt2); - }); - }; - const setConf$3 = function(cnf) { - conf$3 = { - ...conf$3, - ...cnf - }; - }; - const draw$8 = async function(text2, id2, _version, diagObj) { - log$1.info("Drawing class - ", id2); - const conf2 = getConfig$1().flowchart ?? getConfig$1().class; - const securityLevel = getConfig$1().securityLevel; - log$1.info("config:", conf2); - const nodeSpacing = (conf2 == null ? void 0 : conf2.nodeSpacing) ?? 50; - const rankSpacing = (conf2 == null ? void 0 : conf2.rankSpacing) ?? 50; - const g = new Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: diagObj.db.getDirection(), - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 8, - marginy: 8 - }).setDefaultEdgeLabel(function() { - return {}; - }); - const namespaces2 = diagObj.db.getNamespaces(); - const classes2 = diagObj.db.getClasses(); - const relations2 = diagObj.db.getRelations(); - const notes2 = diagObj.db.getNotes(); - log$1.info(relations2); - addNamespaces(namespaces2, g, id2, diagObj); - addClasses(classes2, g, id2, diagObj); - addRelations(relations2, g); - addNotes(notes2, g, relations2.length + 1, classes2); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = root2.select(`[id="${id2}"]`); - const element2 = root2.select("#" + id2 + " g"); - await render( - element2, - g, - ["aggregation", "extension", "composition", "dependency", "lollipop"], - "classDiagram", - id2 - ); - utils$1.insertTitle(svg2, "classTitleText", (conf2 == null ? void 0 : conf2.titleTopMargin) ?? 5, diagObj.db.getDiagramTitle()); - setupGraphViewbox$1(g, svg2, conf2 == null ? void 0 : conf2.diagramPadding, conf2 == null ? void 0 : conf2.useMaxWidth); - if (!(conf2 == null ? void 0 : conf2.htmlLabels)) { - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - const labels = doc.querySelectorAll('[id="' + id2 + '"] .edgeLabel .label'); - for (const label of labels) { - const dim = label.getBBox(); - const rect2 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); - rect2.setAttribute("rx", 0); - rect2.setAttribute("ry", 0); - rect2.setAttribute("width", dim.width); - rect2.setAttribute("height", dim.height); - label.insertBefore(rect2, label.firstChild); - } - } - }; - function getArrowMarker(type2) { - let marker; - switch (type2) { - case 0: - marker = "aggregation"; - break; - case 1: - marker = "extension"; - break; - case 2: - marker = "composition"; - break; - case 3: - marker = "dependency"; - break; - case 4: - marker = "lollipop"; - break; - default: - marker = "none"; - } - return marker; - } - const renderer$8 = { - setConf: setConf$3, - draw: draw$8 - }; - const diagram$8 = { - parser: parser$d, - db: db$8, - renderer: renderer$8, - styles: styles$5, - init: (cnf) => { - if (!cnf.class) { - cnf.class = {}; - } - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$8.clear(); - } - }; - const classDiagramV2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$8 - }, Symbol.toStringTag, { value: "Module" })); - var parser$a = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 15], $V7 = [1, 16], $V8 = [1, 17], $V9 = [1, 18], $Va = [1, 30], $Vb = [1, 19], $Vc = [1, 20], $Vd = [1, 21], $Ve = [1, 22], $Vf = [1, 23], $Vg = [1, 25], $Vh = [1, 26], $Vi = [1, 27], $Vj = [1, 28], $Vk = [1, 29], $Vl = [1, 32], $Vm = [1, 33], $Vn = [1, 34], $Vo = [1, 35], $Vp = [1, 31], $Vq = [1, 4, 5, 15, 16, 18, 20, 21, 23, 24, 25, 26, 27, 28, 32, 34, 36, 37, 41, 44, 45, 46, 47, 50], $Vr = [1, 4, 5, 13, 14, 15, 16, 18, 20, 21, 23, 24, 25, 26, 27, 28, 32, 34, 36, 37, 41, 44, 45, 46, 47, 50], $Vs = [4, 5, 15, 16, 18, 20, 21, 23, 24, 25, 26, 27, 28, 32, 34, 36, 37, 41, 44, 45, 46, 47, 50]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "classDefStatement": 10, "cssClassStatement": 11, "idStatement": 12, "DESCR": 13, "-->": 14, "HIDE_EMPTY": 15, "scale": 16, "WIDTH": 17, "COMPOSIT_STATE": 18, "STRUCT_START": 19, "STRUCT_STOP": 20, "STATE_DESCR": 21, "AS": 22, "ID": 23, "FORK": 24, "JOIN": 25, "CHOICE": 26, "CONCURRENT": 27, "note": 28, "notePosition": 29, "NOTE_TEXT": 30, "direction": 31, "acc_title": 32, "acc_title_value": 33, "acc_descr": 34, "acc_descr_value": 35, "acc_descr_multiline_value": 36, "classDef": 37, "CLASSDEF_ID": 38, "CLASSDEF_STYLEOPTS": 39, "DEFAULT": 40, "class": 41, "CLASSENTITY_IDS": 42, "STYLECLASS": 43, "direction_tb": 44, "direction_bt": 45, "direction_rl": 46, "direction_lr": 47, "eol": 48, ";": 49, "EDGE_STATE": 50, "STYLE_SEPARATOR": 51, "left_of": 52, "right_of": 53, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 13: "DESCR", 14: "-->", 15: "HIDE_EMPTY", 16: "scale", 17: "WIDTH", 18: "COMPOSIT_STATE", 19: "STRUCT_START", 20: "STRUCT_STOP", 21: "STATE_DESCR", 22: "AS", 23: "ID", 24: "FORK", 25: "JOIN", 26: "CHOICE", 27: "CONCURRENT", 28: "note", 30: "NOTE_TEXT", 32: "acc_title", 33: "acc_title_value", 34: "acc_descr", 35: "acc_descr_value", 36: "acc_descr_multiline_value", 37: "classDef", 38: "CLASSDEF_ID", 39: "CLASSDEF_STYLEOPTS", 40: "DEFAULT", 41: "class", 42: "CLASSENTITY_IDS", 43: "STYLECLASS", 44: "direction_tb", 45: "direction_bt", 46: "direction_rl", 47: "direction_lr", 49: ";", 50: "EDGE_STATE", 51: "STYLE_SEPARATOR", 52: "left_of", 53: "right_of" }, - productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [10, 3], [10, 3], [11, 3], [31, 1], [31, 1], [31, 1], [31, 1], [48, 1], [48, 1], [12, 1], [12, 1], [12, 3], [12, 3], [29, 1], [29, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 3: - yy.setRootDoc($$[$0]); - return $$[$0]; - case 4: - this.$ = []; - break; - case 5: - if ($$[$0] != "nl") { - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - } - break; - case 6: - case 7: - this.$ = $$[$0]; - break; - case 8: - this.$ = "nl"; - break; - case 11: - this.$ = $$[$0]; - break; - case 12: - const stateStmt = $$[$0 - 1]; - stateStmt.description = yy.trimColon($$[$0]); - this.$ = stateStmt; - break; - case 13: - this.$ = { stmt: "relation", state1: $$[$0 - 2], state2: $$[$0] }; - break; - case 14: - const relDescription = yy.trimColon($$[$0]); - this.$ = { stmt: "relation", state1: $$[$0 - 3], state2: $$[$0 - 1], description: relDescription }; - break; - case 18: - this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: "", doc: $$[$0 - 1] }; - break; - case 19: - var id2 = $$[$0]; - var description = $$[$0 - 2].trim(); - if ($$[$0].match(":")) { - var parts = $$[$0].split(":"); - id2 = parts[0]; - description = [description, parts[1]]; - } - this.$ = { stmt: "state", id: id2, type: "default", description }; - break; - case 20: - this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: $$[$0 - 5], doc: $$[$0 - 1] }; - break; - case 21: - this.$ = { stmt: "state", id: $$[$0], type: "fork" }; - break; - case 22: - this.$ = { stmt: "state", id: $$[$0], type: "join" }; - break; - case 23: - this.$ = { stmt: "state", id: $$[$0], type: "choice" }; - break; - case 24: - this.$ = { stmt: "state", id: yy.getDividerId(), type: "divider" }; - break; - case 25: - this.$ = { stmt: "state", id: $$[$0 - 1].trim(), note: { position: $$[$0 - 2].trim(), text: $$[$0].trim() } }; - break; - case 28: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 29: - case 30: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 31: - case 32: - this.$ = { stmt: "classDef", id: $$[$0 - 1].trim(), classes: $$[$0].trim() }; - break; - case 33: - this.$ = { stmt: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() }; - break; - case 34: - yy.setDirection("TB"); - this.$ = { stmt: "dir", value: "TB" }; - break; - case 35: - yy.setDirection("BT"); - this.$ = { stmt: "dir", value: "BT" }; - break; - case 36: - yy.setDirection("RL"); - this.$ = { stmt: "dir", value: "RL" }; - break; - case 37: - yy.setDirection("LR"); - this.$ = { stmt: "dir", value: "LR" }; - break; - case 40: - case 41: - this.$ = { stmt: "state", id: $$[$0].trim(), type: "default", description: "" }; - break; - case 42: - this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" }; - break; - case 43: - this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" }; - break; + }; + JSDocTagImpl = class { + static { + __name(this, "JSDocTagImpl"); } - }, - table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([1, 4, 5, 15, 16, 18, 21, 23, 24, 25, 26, 27, 28, 32, 34, 36, 37, 41, 44, 45, 46, 47, 50], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 15: $V6, 16: $V7, 18: $V8, 21: $V9, 23: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 31: 24, 32: $Vg, 34: $Vh, 36: $Vi, 37: $Vj, 41: $Vk, 44: $Vl, 45: $Vm, 46: $Vn, 47: $Vo, 50: $Vp }, o($Vq, [2, 5]), { 9: 36, 10: 12, 11: 13, 12: 14, 15: $V6, 16: $V7, 18: $V8, 21: $V9, 23: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 31: 24, 32: $Vg, 34: $Vh, 36: $Vi, 37: $Vj, 41: $Vk, 44: $Vl, 45: $Vm, 46: $Vn, 47: $Vo, 50: $Vp }, o($Vq, [2, 7]), o($Vq, [2, 8]), o($Vq, [2, 9]), o($Vq, [2, 10]), o($Vq, [2, 11], { 13: [1, 37], 14: [1, 38] }), o($Vq, [2, 15]), { 17: [1, 39] }, o($Vq, [2, 17], { 19: [1, 40] }), { 22: [1, 41] }, o($Vq, [2, 21]), o($Vq, [2, 22]), o($Vq, [2, 23]), o($Vq, [2, 24]), { 29: 42, 30: [1, 43], 52: [1, 44], 53: [1, 45] }, o($Vq, [2, 27]), { 33: [1, 46] }, { 35: [1, 47] }, o($Vq, [2, 30]), { 38: [1, 48], 40: [1, 49] }, { 42: [1, 50] }, o($Vr, [2, 40], { 51: [1, 51] }), o($Vr, [2, 41], { 51: [1, 52] }), o($Vq, [2, 34]), o($Vq, [2, 35]), o($Vq, [2, 36]), o($Vq, [2, 37]), o($Vq, [2, 6]), o($Vq, [2, 12]), { 12: 53, 23: $Va, 50: $Vp }, o($Vq, [2, 16]), o($Vs, $V3, { 7: 54 }), { 23: [1, 55] }, { 23: [1, 56] }, { 22: [1, 57] }, { 23: [2, 44] }, { 23: [2, 45] }, o($Vq, [2, 28]), o($Vq, [2, 29]), { 39: [1, 58] }, { 39: [1, 59] }, { 43: [1, 60] }, { 23: [1, 61] }, { 23: [1, 62] }, o($Vq, [2, 13], { 13: [1, 63] }), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 15: $V6, 16: $V7, 18: $V8, 20: [1, 64], 21: $V9, 23: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 31: 24, 32: $Vg, 34: $Vh, 36: $Vi, 37: $Vj, 41: $Vk, 44: $Vl, 45: $Vm, 46: $Vn, 47: $Vo, 50: $Vp }, o($Vq, [2, 19], { 19: [1, 65] }), { 30: [1, 66] }, { 23: [1, 67] }, o($Vq, [2, 31]), o($Vq, [2, 32]), o($Vq, [2, 33]), o($Vr, [2, 42]), o($Vr, [2, 43]), o($Vq, [2, 14]), o($Vq, [2, 18]), o($Vs, $V3, { 7: 68 }), o($Vq, [2, 25]), o($Vq, [2, 26]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 15: $V6, 16: $V7, 18: $V8, 20: [1, 69], 21: $V9, 23: $Va, 24: $Vb, 25: $Vc, 26: $Vd, 27: $Ve, 28: $Vf, 31: 24, 32: $Vg, 34: $Vh, 36: $Vi, 37: $Vj, 41: $Vk, 44: $Vl, 45: $Vm, 46: $Vn, 47: $Vo, 50: $Vp }, o($Vq, [2, 20])], - defaultActions: { 5: [2, 1], 6: [2, 2], 44: [2, 44], 45: [2, 45] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + constructor(name, content, inline2, range3) { + this.name = name; + this.content = content; + this.inline = inline2; + this.range = range3; } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + toString() { + let text2 = `@${this.name}`; + const content = this.content.toString(); + if (this.content.inlines.length === 1) { + text2 = `${text2} ${content}`; + } else if (this.content.inlines.length > 1) { + text2 = `${text2} +${content}`; + } + if (this.inline) { + return `{${text2}}`; + } else { + return text2; + } } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); + toMarkdown(options3) { + var _a, _b; + return (_b = (_a = options3 === null || options3 === void 0 ? void 0 : options3.renderTag) === null || _a === void 0 ? void 0 : _a.call(options3, this)) !== null && _b !== void 0 ? _b : this.toMarkdownDefault(options3); + } + toMarkdownDefault(options3) { + const content = this.content.toMarkdown(options3); + if (this.inline) { + const rendered = renderInlineTag(this.name, content, options3 !== null && options3 !== void 0 ? options3 : {}); + if (typeof rendered === "string") { + return rendered; } - token2 = self2.symbols_[token2] || token2; } - return token2; - } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; + let marker = ""; + if ((options3 === null || options3 === void 0 ? void 0 : options3.tag) === "italic" || (options3 === null || options3 === void 0 ? void 0 : options3.tag) === void 0) { + marker = "*"; + } else if ((options3 === null || options3 === void 0 ? void 0 : options3.tag) === "bold") { + marker = "**"; + } else if ((options3 === null || options3 === void 0 ? void 0 : options3.tag) === "bold-italic") { + marker = "***"; + } + let text2 = `${marker}@${this.name}${marker}`; + if (this.content.inlines.length === 1) { + text2 = `${text2} \u2014 ${content}`; + } else if (this.content.inlines.length > 1) { + text2 = `${text2} +${content}`; + } + if (this.inline) { + return `{${text2}}`; } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); + return text2; + } + } + }; + __name(renderInlineTag, "renderInlineTag"); + __name(renderLinkDefault, "renderLinkDefault"); + JSDocTextImpl = class { + static { + __name(this, "JSDocTextImpl"); + } + constructor(lines, range3) { + this.inlines = lines; + this.range = range3; + } + toString() { + let text2 = ""; + for (let i2 = 0; i2 < this.inlines.length; i2++) { + const inline2 = this.inlines[i2]; + const next3 = this.inlines[i2 + 1]; + text2 += inline2.toString(); + if (next3 && next3.range.start.line > inline2.range.start.line) { + text2 += "\n"; } - action = table[state2] && table[state2][symbol]; } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } + return text2; + } + toMarkdown(options3) { + let text2 = ""; + for (let i2 = 0; i2 < this.inlines.length; i2++) { + const inline2 = this.inlines[i2]; + const next3 = this.inlines[i2 + 1]; + text2 += inline2.toMarkdown(options3); + if (next3 && next3.range.start.line > inline2.range.start.line) { + text2 += "\n"; } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected + } + return text2; + } + }; + JSDocLineImpl = class { + static { + __name(this, "JSDocLineImpl"); + } + constructor(text2, range3) { + this.text = text2; + this.range = range3; + } + toString() { + return this.text; + } + toMarkdown() { + return this.text; + } + }; + __name(fillNewlines, "fillNewlines"); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/documentation-provider.js + var JSDocDocumentationProvider; + var init_documentation_provider = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/documentation-provider.js"() { + "use strict"; + init_ast_utils(); + init_jsdoc(); + JSDocDocumentationProvider = class { + static { + __name(this, "JSDocDocumentationProvider"); + } + constructor(services) { + this.indexManager = services.shared.workspace.IndexManager; + this.commentProvider = services.documentation.CommentProvider; + } + getDocumentation(node2) { + const comment2 = this.commentProvider.getComment(node2); + if (comment2 && isJSDoc(comment2)) { + const parsedJSDoc = parseJSDoc(comment2); + return parsedJSDoc.toMarkdown({ + renderLink: /* @__PURE__ */ __name((link3, display) => { + return this.documentationLinkRenderer(node2, link3, display); + }, "renderLink"), + renderTag: /* @__PURE__ */ __name((tag2) => { + return this.documentationTagRenderer(node2, tag2); + }, "renderTag") }); } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); + return void 0; + } + documentationLinkRenderer(node2, name, display) { + var _a; + const description = (_a = this.findNameInPrecomputedScopes(node2, name)) !== null && _a !== void 0 ? _a : this.findNameInGlobalScope(node2, name); + if (description && description.nameSegment) { + const line2 = description.nameSegment.range.start.line + 1; + const character2 = description.nameSegment.range.start.character + 1; + const uri = description.documentUri.with({ fragment: `L${line2},${character2}` }); + return `[${display}](${uri.toString()})`; + } else { + return void 0; } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + } + documentationTagRenderer(_node, _tag2) { + return void 0; + } + findNameInPrecomputedScopes(node2, name) { + const document2 = getDocument(node2); + const precomputed = document2.precomputedScopes; + if (!precomputed) { + return void 0; } + let currentNode = node2; + do { + const allDescriptions = precomputed.get(currentNode); + const description = allDescriptions.find((e3) => e3.name === name); + if (description) { + return description; + } + currentNode = currentNode.$container; + } while (currentNode); + return void 0; } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + findNameInGlobalScope(node2, name) { + const description = this.indexManager.allElements().find((e3) => e3.name === name); + return description; + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/comment-provider.js + var DefaultCommentProvider; + var init_comment_provider = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/comment-provider.js"() { + "use strict"; + init_json_serializer(); + init_cst_utils(); + DefaultCommentProvider = class { + static { + __name(this, "DefaultCommentProvider"); + } + constructor(services) { + this.grammarConfig = () => services.parser.GrammarConfig; + } + getComment(node2) { + var _a; + if (isAstNodeWithComment(node2)) { + return node2.$comment; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + return (_a = findCommentNode(node2.$cstNode, this.grammarConfig().multilineCommentRules)) === null || _a === void 0 ? void 0 : _a.text; + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/event.js + var event_exports = {}; + var init_event3 = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/event.js"() { + "use strict"; + __reExport(event_exports, __toESM(require_events(), 1)); + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/async-parser.js + var DefaultAsyncParser, AbstractThreadedAsyncParser, ParserWorker; + var init_async_parser = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/async-parser.js"() { + "use strict"; + init_promise_utils(); + init_event3(); + DefaultAsyncParser = class { + static { + __name(this, "DefaultAsyncParser"); + } + constructor(services) { + this.syncParser = services.parser.LangiumParser; + } + parse(text2) { + return Promise.resolve(this.syncParser.parse(text2)); + } + }; + AbstractThreadedAsyncParser = class { + static { + __name(this, "AbstractThreadedAsyncParser"); + } + constructor(services) { + this.threadCount = 8; + this.terminationDelay = 200; + this.workerPool = []; + this.queue = []; + this.hydrator = services.serializer.Hydrator; + } + initializeWorkers() { + while (this.workerPool.length < this.threadCount) { + const worker = this.createWorker(); + worker.onReady(() => { + if (this.queue.length > 0) { + const deferred = this.queue.shift(); + if (deferred) { + worker.lock(); + deferred.resolve(worker); + } + } + }); + this.workerPool.push(worker); } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; + } + async parse(text2, cancelToken) { + const worker = await this.acquireParserWorker(cancelToken); + const deferred = new Deferred(); + let timeout2; + const cancellation = cancelToken.onCancellationRequested(() => { + timeout2 = setTimeout(() => { + this.terminateWorker(worker); + }, this.terminationDelay); + }); + worker.parse(text2).then((result) => { + const hydrated = this.hydrator.hydrate(result); + deferred.resolve(hydrated); + }).catch((err) => { + deferred.reject(err); + }).finally(() => { + cancellation.dispose(); + clearTimeout(timeout2); + }); + return deferred.promise; + } + terminateWorker(worker) { + worker.terminate(); + const index = this.workerPool.indexOf(worker); + if (index >= 0) { + this.workerPool.splice(index, 1); } - if (this.options.ranges) { - this.yylloc.range[1]++; + } + async acquireParserWorker(cancelToken) { + this.initializeWorkers(); + for (const worker of this.workerPool) { + if (worker.ready) { + worker.lock(); + return worker; + } } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + const deferred = new Deferred(); + cancelToken.onCancellationRequested(() => { + const index = this.queue.indexOf(deferred); + if (index >= 0) { + this.queue.splice(index, 1); + } + deferred.reject(OperationCancelled); + }); + this.queue.push(deferred); + return deferred.promise; + } + }; + ParserWorker = class { + static { + __name(this, "ParserWorker"); + } + get ready() { + return this._ready; + } + get onReady() { + return this.onReadyEmitter.event; + } + constructor(sendMessage, onMessage, onError, terminate) { + this.onReadyEmitter = new event_exports.Emitter(); + this.deferred = new Deferred(); + this._ready = true; + this._parsing = false; + this.sendMessage = sendMessage; + this._terminate = terminate; + onMessage((result) => { + const parseResult = result; + this.deferred.resolve(parseResult); + this.unlock(); + }); + onError((error3) => { + this.deferred.reject(error3); + this.unlock(); + }); + } + terminate() { + this.deferred.reject(OperationCancelled); + this._terminate(); + } + lock() { + this._ready = false; + } + unlock() { + this._parsing = false; + this._ready = true; + this.onReadyEmitter.fire(); + } + parse(text2) { + if (this._parsing) { + throw new Error("Parser worker is busy"); + } + this._parsing = true; + this.deferred = new Deferred(); + this.sendMessage(text2); + return this.deferred.promise; + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-lock.js + var DefaultWorkspaceLock; + var init_workspace_lock = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/workspace-lock.js"() { + "use strict"; + init_cancellation(); + init_promise_utils(); + DefaultWorkspaceLock = class { + static { + __name(this, "DefaultWorkspaceLock"); + } + constructor() { + this.previousTokenSource = new cancellation_exports.CancellationTokenSource(); + this.writeQueue = []; + this.readQueue = []; + this.done = true; + } + write(action) { + this.cancelWrite(); + const tokenSource = new cancellation_exports.CancellationTokenSource(); + this.previousTokenSource = tokenSource; + return this.enqueue(this.writeQueue, action, tokenSource.token); + } + read(action) { + return this.enqueue(this.readQueue, action); + } + enqueue(queue, action, cancellationToken) { + const deferred = new Deferred(); + const entry = { + action, + deferred, + cancellationToken: cancellationToken !== null && cancellationToken !== void 0 ? cancellationToken : cancellation_exports.CancellationToken.None }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + queue.push(entry); + this.performNextOperation(); + return deferred.promise; + } + async performNextOperation() { + if (!this.done) { + return; } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; + const entries = []; + if (this.writeQueue.length > 0) { + entries.push(this.writeQueue.shift()); + } else if (this.readQueue.length > 0) { + entries.push(...this.readQueue.splice(0, this.readQueue.length)); } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + return; } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + this.done = false; + await Promise.all(entries.map(async ({ action, deferred, cancellationToken }) => { + try { + const result = await Promise.resolve().then(() => action(cancellationToken)); + deferred.resolve(result); + } catch (err) { + if (isOperationCancelled(err)) { + deferred.resolve(void 0); + } else { + deferred.reject(err); + } } + })); + this.done = true; + this.performNextOperation(); + } + cancelWrite() { + this.previousTokenSource.cancel(); + } + }; + } + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/hydrator.js + var DefaultHydrator; + var init_hydrator = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/hydrator.js"() { + "use strict"; + init_cst_node_builder(); + init_ast(); + init_syntax_tree(); + init_ast_utils(); + init_collections(); + init_cst_utils(); + DefaultHydrator = class { + static { + __name(this, "DefaultHydrator"); + } + constructor(services) { + this.grammarElementIdMap = new BiMap(); + this.tokenTypeIdMap = new BiMap(); + this.grammar = services.Grammar; + this.lexer = services.parser.Lexer; + this.linker = services.references.Linker; + } + dehydrate(result) { + return { + // We need to create shallow copies of the errors + // The original errors inherit from the `Error` class, which is not transferable across worker threads + lexerErrors: result.lexerErrors.map((e3) => Object.assign({}, e3)), + parserErrors: result.parserErrors.map((e3) => Object.assign({}, e3)), + value: this.dehydrateAstNode(result.value, this.createDehyrationContext(result.value)) + }; + } + createDehyrationContext(node2) { + const astNodes = /* @__PURE__ */ new Map(); + const cstNodes = /* @__PURE__ */ new Map(); + for (const astNode of streamAst(node2)) { + astNodes.set(astNode, {}); } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + if (node2.$cstNode) { + for (const cstNode of streamCst(node2.$cstNode)) { + cstNodes.set(cstNode, {}); + } } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length + return { + astNodes, + cstNodes }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; + } + dehydrateAstNode(node2, context) { + const obj = context.astNodes.get(node2); + obj.$type = node2.$type; + obj.$containerIndex = node2.$containerIndex; + obj.$containerProperty = node2.$containerProperty; + if (node2.$cstNode !== void 0) { + obj.$cstNode = this.dehydrateCstNode(node2.$cstNode, context); } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; + for (const [name, value2] of Object.entries(node2)) { + if (name.startsWith("$")) { + continue; + } + if (Array.isArray(value2)) { + const arr = []; + obj[name] = arr; + for (const item of value2) { + if (isAstNode(item)) { + arr.push(this.dehydrateAstNode(item, context)); + } else if (isReference(item)) { + arr.push(this.dehydrateReference(item, context)); } else { - return false; + arr.push(item); } - } else if (!this.options.flex) { - break; } + } else if (isAstNode(value2)) { + obj[name] = this.dehydrateAstNode(value2, context); + } else if (isReference(value2)) { + obj[name] = this.dehydrateReference(value2, context); + } else if (value2 !== void 0) { + obj[name] = value2; } } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; - } - return false; + return obj; + } + dehydrateReference(reference, context) { + const obj = {}; + obj.$refText = reference.$refText; + if (reference.$refNode) { + obj.$refNode = context.cstNodes.get(reference.$refNode); } - if (this._input === "") { - return this.EOF; + return obj; + } + dehydrateCstNode(node2, context) { + const cstNode = context.cstNodes.get(node2); + if (isRootCstNode(node2)) { + cstNode.fullText = node2.fullText; } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + cstNode.grammarSource = this.getGrammarElementId(node2.grammarSource); + } + cstNode.hidden = node2.hidden; + cstNode.astNode = context.astNodes.get(node2.astNode); + if (isCompositeCstNode(node2)) { + cstNode.content = node2.content.map((child) => this.dehydrateCstNode(child, context)); + } else if (isLeafCstNode(node2)) { + cstNode.tokenType = node2.tokenType.name; + cstNode.offset = node2.offset; + cstNode.length = node2.length; + cstNode.startLine = node2.range.start.line; + cstNode.startColumn = node2.range.start.character; + cstNode.endLine = node2.range.end.line; + cstNode.endColumn = node2.range.end.character; + } + return cstNode; + } + hydrate(result) { + const node2 = result.value; + const context = this.createHydrationContext(node2); + if ("$cstNode" in node2) { + this.hydrateCstNode(node2.$cstNode, context); } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); + return { + lexerErrors: result.lexerErrors, + parserErrors: result.parserErrors, + value: this.hydrateAstNode(node2, context) + }; + } + createHydrationContext(node2) { + const astNodes = /* @__PURE__ */ new Map(); + const cstNodes = /* @__PURE__ */ new Map(); + for (const astNode of streamAst(node2)) { + astNodes.set(astNode, {}); } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; + let root4; + if (node2.$cstNode) { + for (const cstNode of streamCst(node2.$cstNode)) { + let cst; + if ("fullText" in cstNode) { + cst = new RootCstNodeImpl(cstNode.fullText); + root4 = cst; + } else if ("content" in cstNode) { + cst = new CompositeCstNodeImpl(); + } else if ("tokenType" in cstNode) { + cst = this.hydrateCstLeafNode(cstNode); + } + if (cst) { + cstNodes.set(cstNode, cst); + cst.root = root4; + } + } } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + return { + astNodes, + cstNodes + }; + } + hydrateAstNode(node2, context) { + const astNode = context.astNodes.get(node2); + astNode.$type = node2.$type; + astNode.$containerIndex = node2.$containerIndex; + astNode.$containerProperty = node2.$containerProperty; + if (node2.$cstNode) { + astNode.$cstNode = context.cstNodes.get(node2.$cstNode); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; + for (const [name, value2] of Object.entries(node2)) { + if (name.startsWith("$")) { + continue; + } + if (Array.isArray(value2)) { + const arr = []; + astNode[name] = arr; + for (const item of value2) { + if (isAstNode(item)) { + arr.push(this.setParent(this.hydrateAstNode(item, context), astNode)); + } else if (isReference(item)) { + arr.push(this.hydrateReference(item, astNode, name, context)); + } else { + arr.push(item); + } + } + } else if (isAstNode(value2)) { + astNode[name] = this.setParent(this.hydrateAstNode(value2, context), astNode); + } else if (isReference(value2)) { + astNode[name] = this.hydrateReference(value2, astNode, name, context); + } else if (value2 !== void 0) { + astNode[name] = value2; + } } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - return 40; - case 1: - return 44; - case 2: - return 45; - case 3: - return 46; - case 4: - return 47; - case 5: - break; - case 6: - break; - case 7: - return 5; - case 8: - break; - case 9: - break; - case 10: - break; - case 11: - break; - case 12: - this.pushState("SCALE"); - return 16; - case 13: - return 17; - case 14: - this.popState(); - break; - case 15: - this.begin("acc_title"); - return 32; - case 16: - this.popState(); - return "acc_title_value"; - case 17: - this.begin("acc_descr"); - return 34; - case 18: - this.popState(); - return "acc_descr_value"; - case 19: - this.begin("acc_descr_multiline"); - break; - case 20: - this.popState(); - break; - case 21: - return "acc_descr_multiline_value"; - case 22: - this.pushState("CLASSDEF"); - return 37; - case 23: - this.popState(); - this.pushState("CLASSDEFID"); - return "DEFAULT_CLASSDEF_ID"; - case 24: - this.popState(); - this.pushState("CLASSDEFID"); - return 38; - case 25: - this.popState(); - return 39; - case 26: - this.pushState("CLASS"); - return 41; - case 27: - this.popState(); - this.pushState("CLASS_STYLE"); - return 42; - case 28: - this.popState(); - return 43; - case 29: - this.pushState("SCALE"); - return 16; - case 30: - return 17; - case 31: - this.popState(); - break; - case 32: - this.pushState("STATE"); - break; - case 33: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 24; - case 34: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 25; - case 35: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -10).trim(); - return 26; - case 36: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 24; - case 37: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 25; - case 38: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -10).trim(); - return 26; - case 39: - return 44; - case 40: - return 45; - case 41: - return 46; - case 42: - return 47; - case 43: - this.pushState("STATE_STRING"); - break; - case 44: - this.pushState("STATE_ID"); - return "AS"; - case 45: - this.popState(); - return "ID"; - case 46: - this.popState(); - break; - case 47: - return "STATE_DESCR"; - case 48: - return 18; - case 49: - this.popState(); - break; - case 50: - this.popState(); - this.pushState("struct"); - return 19; - case 51: - break; - case 52: - this.popState(); - return 20; - case 53: - break; - case 54: - this.begin("NOTE"); - return 28; - case 55: - this.popState(); - this.pushState("NOTE_ID"); - return 52; - case 56: - this.popState(); - this.pushState("NOTE_ID"); - return 53; - case 57: - this.popState(); - this.pushState("FLOATING_NOTE"); - break; - case 58: - this.popState(); - this.pushState("FLOATING_NOTE_ID"); - return "AS"; - case 59: - break; - case 60: - return "NOTE_TEXT"; - case 61: - this.popState(); - return "ID"; - case 62: - this.popState(); - this.pushState("NOTE_TEXT"); - return 23; - case 63: - this.popState(); - yy_.yytext = yy_.yytext.substr(2).trim(); - return 30; - case 64: - this.popState(); - yy_.yytext = yy_.yytext.slice(0, -8).trim(); - return 30; - case 65: - return 6; - case 66: - return 6; - case 67: - return 15; - case 68: - return 50; - case 69: - return 23; - case 70: - yy_.yytext = yy_.yytext.trim(); - return 13; - case 71: - return 14; - case 72: - return 27; - case 73: - return 51; - case 74: - return 5; - case 75: - return "INVALID"; + return astNode; + } + setParent(node2, parent4) { + node2.$container = parent4; + return node2; + } + hydrateReference(reference, node2, name, context) { + return this.linker.buildReference(node2, name, context.cstNodes.get(reference.$refNode), reference.$refText); + } + hydrateCstNode(cstNode, context, num = 0) { + const cstNodeObj = context.cstNodes.get(cstNode); + if (typeof cstNode.grammarSource === "number") { + cstNodeObj.grammarSource = this.getGrammarElement(cstNode.grammarSource); + } + cstNodeObj.astNode = context.astNodes.get(cstNode.astNode); + if (isCompositeCstNode(cstNodeObj)) { + for (const child of cstNode.content) { + const hydrated = this.hydrateCstNode(child, context, num++); + cstNodeObj.content.push(hydrated); + } + } + return cstNodeObj; + } + hydrateCstLeafNode(cstNode) { + const tokenType = this.getTokenType(cstNode.tokenType); + const offset = cstNode.offset; + const length2 = cstNode.length; + const startLine = cstNode.startLine; + const startColumn = cstNode.startColumn; + const endLine = cstNode.endLine; + const endColumn = cstNode.endColumn; + const hidden = cstNode.hidden; + const node2 = new LeafCstNodeImpl(offset, length2, { + start: { + line: startLine, + character: startColumn + }, + end: { + line: endLine, + character: endColumn + } + }, tokenType, hidden); + return node2; + } + getTokenType(name) { + return this.lexer.definition[name]; + } + getGrammarElementId(node2) { + if (this.grammarElementIdMap.size === 0) { + this.createGrammarElementIdMap(); } - }, - rules: [/^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<>)/i, /^(?:.*<>)/i, /^(?:.*<>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "LINE": { "rules": [9, 10], "inclusive": false }, "struct": { "rules": [9, 10, 22, 26, 32, 39, 40, 41, 42, 51, 52, 53, 54, 68, 69, 70, 71, 72], "inclusive": false }, "FLOATING_NOTE_ID": { "rules": [61], "inclusive": false }, "FLOATING_NOTE": { "rules": [58, 59, 60], "inclusive": false }, "NOTE_TEXT": { "rules": [63, 64], "inclusive": false }, "NOTE_ID": { "rules": [62], "inclusive": false }, "NOTE": { "rules": [55, 56, 57], "inclusive": false }, "CLASS_STYLE": { "rules": [28], "inclusive": false }, "CLASS": { "rules": [27], "inclusive": false }, "CLASSDEFID": { "rules": [25], "inclusive": false }, "CLASSDEF": { "rules": [23, 24], "inclusive": false }, "acc_descr_multiline": { "rules": [20, 21], "inclusive": false }, "acc_descr": { "rules": [18], "inclusive": false }, "acc_title": { "rules": [16], "inclusive": false }, "SCALE": { "rules": [13, 14, 30, 31], "inclusive": false }, "ALIAS": { "rules": [], "inclusive": false }, "STATE_ID": { "rules": [45], "inclusive": false }, "STATE_STRING": { "rules": [46, 47], "inclusive": false }, "FORK_STATE": { "rules": [], "inclusive": false }, "STATE": { "rules": [9, 10, 33, 34, 35, 36, 37, 38, 43, 44, 48, 49, 50], "inclusive": false }, "ID": { "rules": [9, 10], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 15, 17, 19, 22, 26, 29, 32, 50, 54, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$a.parser = parser$a; - const parser$b = parser$a; - const DEFAULT_DIAGRAM_DIRECTION = "LR"; - const DEFAULT_NESTED_DOC_DIR = "TB"; - const STMT_STATE = "state"; - const STMT_RELATION = "relation"; - const STMT_CLASSDEF = "classDef"; - const STMT_APPLYCLASS = "applyClass"; - const DEFAULT_STATE_TYPE = "default"; - const DIVIDER_TYPE = "divider"; - const START_NODE = "[*]"; - const START_TYPE = "start"; - const END_NODE = START_NODE; - const END_TYPE = "end"; - const COLOR_KEYWORD$1 = "color"; - const FILL_KEYWORD$1 = "fill"; - const BG_FILL$1 = "bgFill"; - const STYLECLASS_SEP$1 = ","; - function newClassesList() { - return {}; - } - let direction = DEFAULT_DIAGRAM_DIRECTION; - let rootDoc = []; - let classes$1 = newClassesList(); - const newDoc = () => { - return { - relations: [], - states: {}, - documents: {} - }; - }; - let documents = { - root: newDoc() - }; - let currentDocument = documents.root; - let startEndCount = 0; - let dividerCnt = 0; - const lineType = { - LINE: 0, - DOTTED_LINE: 1 - }; - const relationType = { - AGGREGATION: 0, - EXTENSION: 1, - COMPOSITION: 2, - DEPENDENCY: 3 - }; - const clone = (o) => JSON.parse(JSON.stringify(o)); - const setRootDoc = (o) => { - log$1.info("Setting root doc", o); - rootDoc = o; - }; - const getRootDoc = () => rootDoc; - const docTranslator = (parent, node2, first) => { - if (node2.stmt === STMT_RELATION) { - docTranslator(parent, node2.state1, true); - docTranslator(parent, node2.state2, false); - } else { - if (node2.stmt === STMT_STATE) { - if (node2.id === "[*]") { - node2.id = first ? parent.id + "_start" : parent.id + "_end"; - node2.start = first; - } else { - node2.id = node2.id.trim(); + return this.grammarElementIdMap.get(node2); } - } - if (node2.doc) { - const doc = []; - let currentDoc = []; - let i2; - for (i2 = 0; i2 < node2.doc.length; i2++) { - if (node2.doc[i2].type === DIVIDER_TYPE) { - const newNode = clone(node2.doc[i2]); - newNode.doc = clone(currentDoc); - doc.push(newNode); - currentDoc = []; + getGrammarElement(id26) { + if (this.grammarElementIdMap.size === 0) { + this.createGrammarElementIdMap(); + } + const element3 = this.grammarElementIdMap.getKey(id26); + if (element3) { + return element3; } else { - currentDoc.push(node2.doc[i2]); + throw new Error("Invalid grammar element id: " + id26); } } - if (doc.length > 0 && currentDoc.length > 0) { - const newNode = { - stmt: STMT_STATE, - id: generateId$2(), - type: "divider", - doc: clone(currentDoc) - }; - doc.push(clone(newNode)); - node2.doc = doc; + createGrammarElementIdMap() { + let id26 = 0; + for (const element3 of streamAst(this.grammar)) { + if (isAbstractElement(element3)) { + this.grammarElementIdMap.set(element3, id26++); + } + } } - node2.doc.forEach((docNode) => docTranslator(node2, docNode, true)); - } - } - }; - const getRootDocV2 = () => { - docTranslator({ id: "root" }, { id: "root", doc: rootDoc }, true); - return { id: "root", doc: rootDoc }; - }; - const extract = (_doc) => { - let doc; - if (_doc.doc) { - doc = _doc.doc; - } else { - doc = _doc; - } - log$1.info(doc); - clear$5(true); - log$1.info("Extract", doc); - doc.forEach((item) => { - switch (item.stmt) { - case STMT_STATE: - addState( - item.id.trim(), - item.type, - item.doc, - item.description, - item.note, - item.classes, - item.styles, - item.textStyles - ); - break; - case STMT_RELATION: - addRelation(item.state1, item.state2, item.description); - break; - case STMT_CLASSDEF: - addStyleClass$1(item.id.trim(), item.classes); - break; - case STMT_APPLYCLASS: - setCssClass$1(item.id.trim(), item.styleClass); - break; - } - }); - }; - const addState = function(id2, type2 = DEFAULT_STATE_TYPE, doc = null, descr = null, note2 = null, classes2 = null, styles2 = null, textStyles = null) { - const trimmedId = id2 == null ? void 0 : id2.trim(); - if (currentDocument.states[trimmedId] === void 0) { - log$1.info("Adding state ", trimmedId, descr); - currentDocument.states[trimmedId] = { - id: trimmedId, - descriptions: [], - type: type2, - doc, - note: note2, - classes: [], - styles: [], - textStyles: [] }; - } else { - if (!currentDocument.states[trimmedId].doc) { - currentDocument.states[trimmedId].doc = doc; - } - if (!currentDocument.states[trimmedId].type) { - currentDocument.states[trimmedId].type = type2; - } - } - if (descr) { - log$1.info("Setting state description", trimmedId, descr); - if (typeof descr === "string") { - addDescription(trimmedId, descr.trim()); - } - if (typeof descr === "object") { - descr.forEach((des) => addDescription(trimmedId, des.trim())); - } - } - if (note2) { - currentDocument.states[trimmedId].note = note2; - currentDocument.states[trimmedId].note.text = common$1.sanitizeText( - currentDocument.states[trimmedId].note.text, - getConfig$1() - ); - } - if (classes2) { - log$1.info("Setting state classes", trimmedId, classes2); - const classesList = typeof classes2 === "string" ? [classes2] : classes2; - classesList.forEach((cssClass) => setCssClass$1(trimmedId, cssClass.trim())); } - if (styles2) { - log$1.info("Setting state styles", trimmedId, styles2); - const stylesList = typeof styles2 === "string" ? [styles2] : styles2; - stylesList.forEach((style) => setStyle(trimmedId, style.trim())); - } - if (textStyles) { - log$1.info("Setting state styles", trimmedId, styles2); - const textStylesList = typeof textStyles === "string" ? [textStyles] : textStyles; - textStylesList.forEach((textStyle) => setTextStyle(trimmedId, textStyle.trim())); - } - }; - const clear$5 = function(saveCommon) { - documents = { - root: newDoc() + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/default-module.js + function createDefaultCoreModule(context) { + return { + documentation: { + CommentProvider: /* @__PURE__ */ __name((services) => new DefaultCommentProvider(services), "CommentProvider"), + DocumentationProvider: /* @__PURE__ */ __name((services) => new JSDocDocumentationProvider(services), "DocumentationProvider") + }, + parser: { + AsyncParser: /* @__PURE__ */ __name((services) => new DefaultAsyncParser(services), "AsyncParser"), + GrammarConfig: /* @__PURE__ */ __name((services) => createGrammarConfig(services), "GrammarConfig"), + LangiumParser: /* @__PURE__ */ __name((services) => createLangiumParser(services), "LangiumParser"), + CompletionParser: /* @__PURE__ */ __name((services) => createCompletionParser(services), "CompletionParser"), + ValueConverter: /* @__PURE__ */ __name(() => new DefaultValueConverter(), "ValueConverter"), + TokenBuilder: /* @__PURE__ */ __name(() => new DefaultTokenBuilder(), "TokenBuilder"), + Lexer: /* @__PURE__ */ __name((services) => new DefaultLexer(services), "Lexer"), + ParserErrorMessageProvider: /* @__PURE__ */ __name(() => new LangiumParserErrorMessageProvider(), "ParserErrorMessageProvider") + }, + workspace: { + AstNodeLocator: /* @__PURE__ */ __name(() => new DefaultAstNodeLocator(), "AstNodeLocator"), + AstNodeDescriptionProvider: /* @__PURE__ */ __name((services) => new DefaultAstNodeDescriptionProvider(services), "AstNodeDescriptionProvider"), + ReferenceDescriptionProvider: /* @__PURE__ */ __name((services) => new DefaultReferenceDescriptionProvider(services), "ReferenceDescriptionProvider") + }, + references: { + Linker: /* @__PURE__ */ __name((services) => new DefaultLinker(services), "Linker"), + NameProvider: /* @__PURE__ */ __name(() => new DefaultNameProvider(), "NameProvider"), + ScopeProvider: /* @__PURE__ */ __name((services) => new DefaultScopeProvider(services), "ScopeProvider"), + ScopeComputation: /* @__PURE__ */ __name((services) => new DefaultScopeComputation(services), "ScopeComputation"), + References: /* @__PURE__ */ __name((services) => new DefaultReferences(services), "References") + }, + serializer: { + Hydrator: /* @__PURE__ */ __name((services) => new DefaultHydrator(services), "Hydrator"), + JsonSerializer: /* @__PURE__ */ __name((services) => new DefaultJsonSerializer(services), "JsonSerializer") + }, + validation: { + DocumentValidator: /* @__PURE__ */ __name((services) => new DefaultDocumentValidator(services), "DocumentValidator"), + ValidationRegistry: /* @__PURE__ */ __name((services) => new ValidationRegistry(services), "ValidationRegistry") + }, + shared: /* @__PURE__ */ __name(() => context.shared, "shared") }; - currentDocument = documents.root; - startEndCount = 0; - classes$1 = newClassesList(); - if (!saveCommon) { - clear$n(); - } - }; - const getState = function(id2) { - return currentDocument.states[id2]; - }; - const getStates = function() { - return currentDocument.states; - }; - const logDocuments = function() { - log$1.info("Documents = ", documents); - }; - const getRelations = function() { - return currentDocument.relations; - }; - function startIdIfNeeded(id2 = "") { - let fixedId = id2; - if (id2 === START_NODE) { - startEndCount++; - fixedId = `${START_TYPE}${startEndCount}`; - } - return fixedId; } - function startTypeIfNeeded(id2 = "", type2 = DEFAULT_STATE_TYPE) { - return id2 === START_NODE ? START_TYPE : type2; + function createDefaultSharedCoreModule(context) { + return { + ServiceRegistry: /* @__PURE__ */ __name(() => new DefaultServiceRegistry(), "ServiceRegistry"), + workspace: { + LangiumDocuments: /* @__PURE__ */ __name((services) => new DefaultLangiumDocuments(services), "LangiumDocuments"), + LangiumDocumentFactory: /* @__PURE__ */ __name((services) => new DefaultLangiumDocumentFactory(services), "LangiumDocumentFactory"), + DocumentBuilder: /* @__PURE__ */ __name((services) => new DefaultDocumentBuilder(services), "DocumentBuilder"), + IndexManager: /* @__PURE__ */ __name((services) => new DefaultIndexManager(services), "IndexManager"), + WorkspaceManager: /* @__PURE__ */ __name((services) => new DefaultWorkspaceManager(services), "WorkspaceManager"), + FileSystemProvider: /* @__PURE__ */ __name((services) => context.fileSystemProvider(services), "FileSystemProvider"), + WorkspaceLock: /* @__PURE__ */ __name(() => new DefaultWorkspaceLock(), "WorkspaceLock"), + ConfigurationProvider: /* @__PURE__ */ __name((services) => new DefaultConfigurationProvider(services), "ConfigurationProvider") + } + }; } - function endIdIfNeeded(id2 = "") { - let fixedId = id2; - if (id2 === END_NODE) { - startEndCount++; - fixedId = `${END_TYPE}${startEndCount}`; + var init_default_module = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/default-module.js"() { + "use strict"; + init_grammar_config(); + init_completion_parser_builder(); + init_langium_parser_builder(); + init_token_builder(); + init_value_converter(); + init_linker(); + init_name_provider(); + init_references(); + init_scope_computation(); + init_scope_provider(); + init_json_serializer(); + init_service_registry(); + init_document_validator(); + init_validation_registry(); + init_ast_descriptions(); + init_ast_node_locator(); + init_configuration(); + init_document_builder(); + init_documents(); + init_index_manager(); + init_workspace_manager(); + init_lexer2(); + init_documentation_provider(); + init_comment_provider(); + init_langium_parser(); + init_async_parser(); + init_workspace_lock(); + init_hydrator(); + __name(createDefaultCoreModule, "createDefaultCoreModule"); + __name(createDefaultSharedCoreModule, "createDefaultSharedCoreModule"); } - return fixedId; - } - function endTypeIfNeeded(id2 = "", type2 = DEFAULT_STATE_TYPE) { - return id2 === END_NODE ? END_TYPE : type2; - } - function addRelationObjs(item1, item2, relationTitle) { - let id1 = startIdIfNeeded(item1.id.trim()); - let type1 = startTypeIfNeeded(item1.id.trim(), item1.type); - let id2 = startIdIfNeeded(item2.id.trim()); - let type2 = startTypeIfNeeded(item2.id.trim(), item2.type); - addState( - id1, - type1, - item1.doc, - item1.description, - item1.note, - item1.classes, - item1.styles, - item1.textStyles - ); - addState( - id2, - type2, - item2.doc, - item2.description, - item2.note, - item2.classes, - item2.styles, - item2.textStyles - ); - currentDocument.relations.push({ - id1, - id2, - relationTitle: common$1.sanitizeText(relationTitle, getConfig$1()) + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/dependency-injection.js + function inject(module1, module2, module3, module4, module5, module6, module7, module8, module9) { + const module10 = [module1, module2, module3, module4, module5, module6, module7, module8, module9].reduce(_merge, {}); + return _inject(module10); + } + function eagerLoad(item) { + if (item && item[isProxy]) { + for (const value2 of Object.values(item)) { + eagerLoad(value2); + } + } + return item; + } + function _inject(module2, injector) { + const proxy = new Proxy({}, { + deleteProperty: /* @__PURE__ */ __name(() => false, "deleteProperty"), + get: /* @__PURE__ */ __name((obj, prop) => _resolve(obj, prop, module2, injector || proxy), "get"), + getOwnPropertyDescriptor: /* @__PURE__ */ __name((obj, prop) => (_resolve(obj, prop, module2, injector || proxy), Object.getOwnPropertyDescriptor(obj, prop)), "getOwnPropertyDescriptor"), + has: /* @__PURE__ */ __name((_2, prop) => prop in module2, "has"), + ownKeys: /* @__PURE__ */ __name(() => [...Reflect.ownKeys(module2), isProxy], "ownKeys") + // used by for..in }); + proxy[isProxy] = true; + return proxy; } - const addRelation = function(item1, item2, title2) { - if (typeof item1 === "object") { - addRelationObjs(item1, item2, title2); - } else { - const id1 = startIdIfNeeded(item1.trim()); - const type1 = startTypeIfNeeded(item1); - const id2 = endIdIfNeeded(item2.trim()); - const type2 = endTypeIfNeeded(item2); - addState(id1, type1); - addState(id2, type2); - currentDocument.relations.push({ - id1, - id2, - title: common$1.sanitizeText(title2, getConfig$1()) - }); - } - }; - const addDescription = function(id2, descr) { - const theState = currentDocument.states[id2]; - const _descr = descr.startsWith(":") ? descr.replace(":", "").trim() : descr; - theState.descriptions.push(common$1.sanitizeText(_descr, getConfig$1())); - }; - const cleanupLabel = function(label) { - if (label.substring(0, 1) === ":") { - return label.substr(2).trim(); + function _resolve(obj, prop, module2, injector) { + if (prop in obj) { + if (obj[prop] instanceof Error) { + throw new Error("Construction failure. Please make sure that your dependencies are constructable.", { cause: obj[prop] }); + } + if (obj[prop] === __requested__) { + throw new Error('Cycle detected. Please make "' + String(prop) + '" lazy. See https://langium.org/docs/configuration-services/#resolving-cyclic-dependencies'); + } + return obj[prop]; + } else if (prop in module2) { + const value2 = module2[prop]; + obj[prop] = __requested__; + try { + obj[prop] = typeof value2 === "function" ? value2(injector) : _inject(value2, injector); + } catch (error3) { + obj[prop] = error3 instanceof Error ? error3 : void 0; + throw error3; + } + return obj[prop]; } else { - return label.trim(); + return void 0; } - }; - const getDividerId = () => { - dividerCnt++; - return "divider-id-" + dividerCnt; - }; - const addStyleClass$1 = function(id2, styleAttributes = "") { - if (classes$1[id2] === void 0) { - classes$1[id2] = { id: id2, styles: [], textStyles: [] }; - } - const foundClass = classes$1[id2]; - if (styleAttributes !== void 0 && styleAttributes !== null) { - styleAttributes.split(STYLECLASS_SEP$1).forEach((attrib) => { - const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim(); - if (attrib.match(COLOR_KEYWORD$1)) { - const newStyle1 = fixedAttrib.replace(FILL_KEYWORD$1, BG_FILL$1); - const newStyle2 = newStyle1.replace(COLOR_KEYWORD$1, FILL_KEYWORD$1); - foundClass.textStyles.push(newStyle2); - } - foundClass.styles.push(fixedAttrib); - }); + } + function _merge(target, source) { + if (source) { + for (const [key, value2] of Object.entries(source)) { + if (value2 !== void 0) { + const value1 = target[key]; + if (value1 !== null && value2 !== null && typeof value1 === "object" && typeof value2 === "object") { + target[key] = _merge(value1, value2); + } else { + target[key] = value2; + } + } + } } - }; - const getClasses$4 = function() { - return classes$1; - }; - const setCssClass$1 = function(itemIds, cssClassName) { - itemIds.split(",").forEach(function(id2) { - let foundState = getState(id2); - if (foundState === void 0) { - const trimmedId = id2.trim(); - addState(trimmedId); - foundState = getState(trimmedId); - } - foundState.classes.push(cssClassName); - }); - }; - const setStyle = function(itemId, styleText) { - const item = getState(itemId); - if (item !== void 0) { - item.textStyles.push(styleText); + return target; + } + var Module, isProxy, __requested__; + var init_dependency_injection = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/dependency-injection.js"() { + "use strict"; + (function(Module2) { + Module2.merge = (m1, m2) => _merge(_merge({}, m1), m2); + })(Module || (Module = {})); + __name(inject, "inject"); + isProxy = Symbol("isProxy"); + __name(eagerLoad, "eagerLoad"); + __name(_inject, "_inject"); + __requested__ = Symbol(); + __name(_resolve, "_resolve"); + __name(_merge, "_merge"); } - }; - const setTextStyle = function(itemId, cssClassName) { - const item = getState(itemId); - if (item !== void 0) { - item.textStyles.push(cssClassName); + }); + + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/services.js + var init_services = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/services.js"() { + "use strict"; } - }; - const getDirection = () => direction; - const setDirection = (dir2) => { - direction = dir2; - }; - const trimColon = (str2) => str2 && str2[0] === ":" ? str2.substr(1).trim() : str2.trim(); - const db$7 = { - getConfig: () => getConfig$1().state, - addState, - clear: clear$5, - getState, - getStates, - getRelations, - getClasses: getClasses$4, - getDirection, - addRelation, - getDividerId, - setDirection, - cleanupLabel, - lineType, - relationType, - logDocuments, - getRootDoc, - setRootDoc, - getRootDocV2, - extract, - trimColon, - getAccTitle, - setAccTitle, - getAccDescription, - setAccDescription, - addStyleClass: addStyleClass$1, - setCssClass: setCssClass$1, - addDescription, - setDiagramTitle, - getDiagramTitle - }; - const getStyles$5 = (options2) => ` -defs #statediagram-barbEnd { - fill: ${options2.transitionColor}; - stroke: ${options2.transitionColor}; - } -g.stateGroup text { - fill: ${options2.nodeBorder}; - stroke: none; - font-size: 10px; -} -g.stateGroup text { - fill: ${options2.textColor}; - stroke: none; - font-size: 10px; + }); -} -g.stateGroup .state-title { - font-weight: bolder; - fill: ${options2.stateLabelColor}; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/index.js + var init_documentation = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/documentation/index.js"() { + "use strict"; + init_comment_provider(); + init_documentation_provider(); + init_jsdoc(); + } + }); -g.stateGroup rect { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/language-meta-data.js + var init_language_meta_data = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/language-meta-data.js"() { + "use strict"; + } + }); -g.stateGroup line { - stroke: ${options2.lineColor}; - stroke-width: 1; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/index.js + var init_languages = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/languages/index.js"() { + "use strict"; + init_grammar_config(); + init_language_meta_data(); + } + }); -.transition { - stroke: ${options2.transitionColor}; - stroke-width: 1; - fill: none; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-config.js + var init_parser_config = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-config.js"() { + "use strict"; + } + }); -.stateGroup .composit { - fill: ${options2.background}; - border-bottom: 1px -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/index.js + var init_parser2 = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/index.js"() { + "use strict"; + init_async_parser(); + init_completion_parser_builder(); + init_cst_node_builder(); + init_langium_parser_builder(); + init_langium_parser(); + init_lexer2(); + init_parser_config(); + init_token_builder(); + init_value_converter(); + } + }); -.stateGroup .alt-composit { - fill: #e0e0e0; - border-bottom: 1px -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/index.js + var init_references2 = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/references/index.js"() { + "use strict"; + init_linker(); + init_name_provider(); + init_references(); + init_scope(); + init_scope_computation(); + init_scope_provider(); + } + }); -.state-note { - stroke: ${options2.noteBorderColor}; - fill: ${options2.noteBkgColor}; + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/index.js + var init_serializer = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/serializer/index.js"() { + "use strict"; + init_hydrator(); + init_json_serializer(); + } + }); - text { - fill: ${options2.noteTextColor}; - stroke: none; - font-size: 10px; - } -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/file-system-provider.js + var EmptyFileSystemProvider, EmptyFileSystem; + var init_file_system_provider = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/file-system-provider.js"() { + "use strict"; + EmptyFileSystemProvider = class { + static { + __name(this, "EmptyFileSystemProvider"); + } + readFile() { + throw new Error("No file system is available."); + } + async readDirectory() { + return []; + } + }; + EmptyFileSystem = { + fileSystemProvider: /* @__PURE__ */ __name(() => new EmptyFileSystemProvider(), "fileSystemProvider") + }; + } + }); -.stateLabel .box { - stroke: none; - stroke-width: 0; - fill: ${options2.mainBkg}; - opacity: 0.5; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-loader.js + function createMinimalGrammarServices() { + const shared = inject(createDefaultSharedCoreModule(EmptyFileSystem), minimalSharedGrammarModule); + const grammar = inject(createDefaultCoreModule({ shared }), minimalGrammarModule); + shared.ServiceRegistry.register(grammar); + return grammar; + } + function loadGrammarFromJson(json3) { + var _a; + const services = createMinimalGrammarServices(); + const astNode = services.serializer.JsonSerializer.deserialize(json3); + services.shared.workspace.LangiumDocumentFactory.fromModel(astNode, URI2.parse(`memory://${(_a = astNode.name) !== null && _a !== void 0 ? _a : "grammar"}.langium`)); + return astNode; + } + var minimalGrammarModule, minimalSharedGrammarModule; + var init_grammar_loader = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/grammar-loader.js"() { + "use strict"; + init_default_module(); + init_dependency_injection(); + init_ast(); + init_file_system_provider(); + init_uri_utils(); + minimalGrammarModule = { + Grammar: /* @__PURE__ */ __name(() => void 0, "Grammar"), + LanguageMetaData: /* @__PURE__ */ __name(() => ({ + caseInsensitive: false, + fileExtensions: [".langium"], + languageId: "langium" + }), "LanguageMetaData") + }; + minimalSharedGrammarModule = { + AstReflection: /* @__PURE__ */ __name(() => new LangiumGrammarAstReflection(), "AstReflection") + }; + __name(createMinimalGrammarServices, "createMinimalGrammarServices"); + __name(loadGrammarFromJson, "loadGrammarFromJson"); + } + }); -.edgeLabel .label rect { - fill: ${options2.labelBackgroundColor}; - opacity: 0.5; -} -.edgeLabel .label text { - fill: ${options2.transitionLabelColor || options2.tertiaryTextColor}; -} -.label div .edgeLabel { - color: ${options2.transitionLabelColor || options2.tertiaryTextColor}; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/index.js + var utils_exports = {}; + __export(utils_exports, { + AstUtils: () => ast_utils_exports, + BiMap: () => BiMap, + Cancellation: () => cancellation_exports, + ContextCache: () => ContextCache, + CstUtils: () => cst_utils_exports, + DONE_RESULT: () => DONE_RESULT, + Deferred: () => Deferred, + Disposable: () => Disposable, + DisposableCache: () => DisposableCache, + DocumentCache: () => DocumentCache, + EMPTY_STREAM: () => EMPTY_STREAM, + ErrorWithLocation: () => ErrorWithLocation, + GrammarUtils: () => grammar_utils_exports, + MultiMap: () => MultiMap, + OperationCancelled: () => OperationCancelled, + Reduction: () => Reduction, + RegExpUtils: () => regexp_utils_exports, + SimpleCache: () => SimpleCache, + StreamImpl: () => StreamImpl, + TreeStreamImpl: () => TreeStreamImpl, + URI: () => URI2, + UriUtils: () => UriUtils, + WorkspaceCache: () => WorkspaceCache, + assertUnreachable: () => assertUnreachable, + delayNextTick: () => delayNextTick, + interruptAndCheck: () => interruptAndCheck, + isOperationCancelled: () => isOperationCancelled, + loadGrammarFromJson: () => loadGrammarFromJson, + setInterruptionPeriod: () => setInterruptionPeriod, + startCancelableOperation: () => startCancelableOperation, + stream: () => stream + }); + var init_utils4 = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/utils/index.js"() { + "use strict"; + init_caching(); + init_event3(); + __reExport(utils_exports, event_exports); + init_collections(); + init_disposable(); + init_errors2(); + init_grammar_loader(); + init_promise_utils(); + init_stream(); + init_uri_utils(); + init_ast_utils(); + init_cancellation(); + init_cst_utils(); + init_grammar_utils(); + init_regexp_utils(); + } + }); -.stateLabel text { - fill: ${options2.stateLabelColor}; - font-size: 10px; - font-weight: bold; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/index.js + var init_validation = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/validation/index.js"() { + "use strict"; + init_document_validator(); + init_validation_registry(); + } + }); -.node circle.state-start { - fill: ${options2.specialStateColor}; - stroke: ${options2.specialStateColor}; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index.js + var init_workspace = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/workspace/index.js"() { + "use strict"; + init_ast_descriptions(); + init_ast_node_locator(); + init_configuration(); + init_document_builder(); + init_documents(); + init_file_system_provider(); + init_index_manager(); + init_workspace_lock(); + init_workspace_manager(); + } + }); -.node .fork-join { - fill: ${options2.specialStateColor}; - stroke: ${options2.specialStateColor}; -} + // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/index.js + var lib_exports = {}; + __export(lib_exports, { + AbstractAstReflection: () => AbstractAstReflection, + AbstractCstNode: () => AbstractCstNode, + AbstractLangiumParser: () => AbstractLangiumParser, + AbstractParserErrorMessageProvider: () => AbstractParserErrorMessageProvider, + AbstractThreadedAsyncParser: () => AbstractThreadedAsyncParser, + AstUtils: () => ast_utils_exports, + BiMap: () => BiMap, + Cancellation: () => cancellation_exports, + CompositeCstNodeImpl: () => CompositeCstNodeImpl, + ContextCache: () => ContextCache, + CstNodeBuilder: () => CstNodeBuilder, + CstUtils: () => cst_utils_exports, + DONE_RESULT: () => DONE_RESULT, + DatatypeSymbol: () => DatatypeSymbol, + DefaultAstNodeDescriptionProvider: () => DefaultAstNodeDescriptionProvider, + DefaultAstNodeLocator: () => DefaultAstNodeLocator, + DefaultAsyncParser: () => DefaultAsyncParser, + DefaultCommentProvider: () => DefaultCommentProvider, + DefaultConfigurationProvider: () => DefaultConfigurationProvider, + DefaultDocumentBuilder: () => DefaultDocumentBuilder, + DefaultDocumentValidator: () => DefaultDocumentValidator, + DefaultHydrator: () => DefaultHydrator, + DefaultIndexManager: () => DefaultIndexManager, + DefaultJsonSerializer: () => DefaultJsonSerializer, + DefaultLangiumDocumentFactory: () => DefaultLangiumDocumentFactory, + DefaultLangiumDocuments: () => DefaultLangiumDocuments, + DefaultLexer: () => DefaultLexer, + DefaultLinker: () => DefaultLinker, + DefaultNameProvider: () => DefaultNameProvider, + DefaultReferenceDescriptionProvider: () => DefaultReferenceDescriptionProvider, + DefaultReferences: () => DefaultReferences, + DefaultScopeComputation: () => DefaultScopeComputation, + DefaultScopeProvider: () => DefaultScopeProvider, + DefaultServiceRegistry: () => DefaultServiceRegistry, + DefaultTokenBuilder: () => DefaultTokenBuilder, + DefaultValueConverter: () => DefaultValueConverter, + DefaultWorkspaceLock: () => DefaultWorkspaceLock, + DefaultWorkspaceManager: () => DefaultWorkspaceManager, + Deferred: () => Deferred, + Disposable: () => Disposable, + DisposableCache: () => DisposableCache, + DocumentCache: () => DocumentCache, + DocumentState: () => DocumentState, + DocumentValidator: () => DocumentValidator, + EMPTY_SCOPE: () => EMPTY_SCOPE, + EMPTY_STREAM: () => EMPTY_STREAM, + EmptyFileSystem: () => EmptyFileSystem, + EmptyFileSystemProvider: () => EmptyFileSystemProvider, + ErrorWithLocation: () => ErrorWithLocation, + GrammarAST: () => ast_exports, + GrammarUtils: () => grammar_utils_exports, + JSDocDocumentationProvider: () => JSDocDocumentationProvider, + LangiumCompletionParser: () => LangiumCompletionParser, + LangiumParser: () => LangiumParser, + LangiumParserErrorMessageProvider: () => LangiumParserErrorMessageProvider, + LeafCstNodeImpl: () => LeafCstNodeImpl, + MapScope: () => MapScope, + Module: () => Module, + MultiMap: () => MultiMap, + OperationCancelled: () => OperationCancelled, + ParserWorker: () => ParserWorker, + Reduction: () => Reduction, + RegExpUtils: () => regexp_utils_exports, + RootCstNodeImpl: () => RootCstNodeImpl, + SimpleCache: () => SimpleCache, + StreamImpl: () => StreamImpl, + StreamScope: () => StreamScope, + TextDocument: () => TextDocument2, + TreeStreamImpl: () => TreeStreamImpl, + URI: () => URI2, + UriUtils: () => UriUtils, + ValidationCategory: () => ValidationCategory, + ValidationRegistry: () => ValidationRegistry, + ValueConverter: () => ValueConverter, + WorkspaceCache: () => WorkspaceCache, + assertUnreachable: () => assertUnreachable, + createCompletionParser: () => createCompletionParser, + createDefaultCoreModule: () => createDefaultCoreModule, + createDefaultSharedCoreModule: () => createDefaultSharedCoreModule, + createGrammarConfig: () => createGrammarConfig, + createLangiumParser: () => createLangiumParser, + delayNextTick: () => delayNextTick, + diagnosticData: () => diagnosticData, + eagerLoad: () => eagerLoad, + getDiagnosticRange: () => getDiagnosticRange, + inject: () => inject, + interruptAndCheck: () => interruptAndCheck, + isAstNode: () => isAstNode, + isAstNodeDescription: () => isAstNodeDescription, + isAstNodeWithComment: () => isAstNodeWithComment, + isCompositeCstNode: () => isCompositeCstNode, + isIMultiModeLexerDefinition: () => isIMultiModeLexerDefinition, + isJSDoc: () => isJSDoc, + isLeafCstNode: () => isLeafCstNode, + isLinkingError: () => isLinkingError, + isNamed: () => isNamed, + isOperationCancelled: () => isOperationCancelled, + isReference: () => isReference, + isRootCstNode: () => isRootCstNode, + isTokenTypeArray: () => isTokenTypeArray, + isTokenTypeDictionary: () => isTokenTypeDictionary, + loadGrammarFromJson: () => loadGrammarFromJson, + parseJSDoc: () => parseJSDoc, + prepareLangiumParser: () => prepareLangiumParser, + setInterruptionPeriod: () => setInterruptionPeriod, + startCancelableOperation: () => startCancelableOperation, + stream: () => stream, + toDiagnosticSeverity: () => toDiagnosticSeverity + }); + var init_lib2 = __esm({ + "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/index.js"() { + "use strict"; + init_default_module(); + init_dependency_injection(); + init_service_registry(); + init_services(); + init_syntax_tree(); + init_documentation(); + init_languages(); + init_parser2(); + init_references2(); + init_serializer(); + init_utils4(); + __reExport(lib_exports, utils_exports); + init_validation(); + init_workspace(); + init_ast(); + } + }); -.node circle.state-end { - fill: ${options2.innerEndBackground}; - stroke: ${options2.background}; - stroke-width: 1.5 -} -.end-state-inner { - fill: ${options2.compositeBackground || options2.background}; - // stroke: ${options2.background}; - stroke-width: 1.5 -} - -.node rect { - fill: ${options2.stateBkg || options2.mainBkg}; - stroke: ${options2.stateBorder || options2.nodeBorder}; - stroke-width: 1px; -} -.node polygon { - fill: ${options2.mainBkg}; - stroke: ${options2.stateBorder || options2.nodeBorder};; - stroke-width: 1px; -} -#statediagram-barbEnd { - fill: ${options2.lineColor}; -} - -.statediagram-cluster rect { - fill: ${options2.compositeTitleBackground}; - stroke: ${options2.stateBorder || options2.nodeBorder}; - stroke-width: 1px; -} - -.cluster-label, .nodeLabel { - color: ${options2.stateLabelColor}; -} - -.statediagram-cluster rect.outer { - rx: 5px; - ry: 5px; -} -.statediagram-state .divider { - stroke: ${options2.stateBorder || options2.nodeBorder}; -} + // ../parser/dist/chunks/mermaid-parser.core/chunk-U3TRWOCV.mjs + function isBranch(item) { + return reflection2.isInstance(item, Branch); + } + function isCommit(item) { + return reflection2.isInstance(item, Commit); + } + function isCommon(item) { + return reflection2.isInstance(item, Common); + } + function isGitGraph(item) { + return reflection2.isInstance(item, GitGraph); + } + function isInfo(item) { + return reflection2.isInstance(item, Info); + } + function isMerge(item) { + return reflection2.isInstance(item, Merge); + } + function isPacket(item) { + return reflection2.isInstance(item, Packet); + } + function isPacketBlock(item) { + return reflection2.isInstance(item, PacketBlock); + } + function isPie(item) { + return reflection2.isInstance(item, Pie); + } + function isPieSection(item) { + return reflection2.isInstance(item, PieSection); + } + var __defProp2, __name2, Statement, Branch, Checkout, CherryPicking, Commit, Common, GitGraph, Info, Merge, Packet, PacketBlock, Pie, PieSection, Direction, MermaidAstReflection, reflection2, loadedInfoGrammar, InfoGrammar, loadedPacketGrammar, PacketGrammar, loadedPieGrammar, PieGrammar, loadedGitGraphGrammar, GitGraphGrammar, InfoLanguageMetaData, PacketLanguageMetaData, PieLanguageMetaData, GitGraphLanguageMetaData, MermaidGeneratedSharedModule, InfoGeneratedModule, PacketGeneratedModule, PieGeneratedModule, GitGraphGeneratedModule, accessibilityDescrRegex, accessibilityTitleRegex, titleRegex, rulesRegexes, AbstractMermaidValueConverter, CommonValueConverter, AbstractMermaidTokenBuilder, CommonTokenBuilder; + var init_chunk_U3TRWOCV = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-U3TRWOCV.mjs"() { + "use strict"; + init_lib2(); + init_lib2(); + init_lib2(); + init_lib2(); + __defProp2 = Object.defineProperty; + __name2 = /* @__PURE__ */ __name((target, value2) => __defProp2(target, "name", { value: value2, configurable: true }), "__name"); + Statement = "Statement"; + Branch = "Branch"; + __name(isBranch, "isBranch"); + __name2(isBranch, "isBranch"); + Checkout = "Checkout"; + CherryPicking = "CherryPicking"; + Commit = "Commit"; + __name(isCommit, "isCommit"); + __name2(isCommit, "isCommit"); + Common = "Common"; + __name(isCommon, "isCommon"); + __name2(isCommon, "isCommon"); + GitGraph = "GitGraph"; + __name(isGitGraph, "isGitGraph"); + __name2(isGitGraph, "isGitGraph"); + Info = "Info"; + __name(isInfo, "isInfo"); + __name2(isInfo, "isInfo"); + Merge = "Merge"; + __name(isMerge, "isMerge"); + __name2(isMerge, "isMerge"); + Packet = "Packet"; + __name(isPacket, "isPacket"); + __name2(isPacket, "isPacket"); + PacketBlock = "PacketBlock"; + __name(isPacketBlock, "isPacketBlock"); + __name2(isPacketBlock, "isPacketBlock"); + Pie = "Pie"; + __name(isPie, "isPie"); + __name2(isPie, "isPie"); + PieSection = "PieSection"; + __name(isPieSection, "isPieSection"); + __name2(isPieSection, "isPieSection"); + Direction = "Direction"; + MermaidAstReflection = class extends AbstractAstReflection { + static { + __name(this, "MermaidAstReflection"); + } + static { + __name2(this, "MermaidAstReflection"); + } + getAllTypes() { + return ["Branch", "Checkout", "CherryPicking", "Commit", "Common", "Direction", "GitGraph", "Info", "Merge", "Packet", "PacketBlock", "Pie", "PieSection", "Statement"]; + } + computeIsSubtype(subtype, supertype) { + switch (subtype) { + case Branch: + case Checkout: + case CherryPicking: + case Commit: + case Merge: { + return this.isSubtype(Statement, supertype); + } + case Direction: { + return this.isSubtype(GitGraph, supertype); + } + default: { + return false; + } + } + } + getReferenceType(refInfo) { + const referenceId = `${refInfo.container.$type}:${refInfo.property}`; + switch (referenceId) { + default: { + throw new Error(`${referenceId} is not a valid reference id.`); + } + } + } + getTypeMetaData(type3) { + switch (type3) { + case "Branch": { + return { + name: "Branch", + properties: [ + { name: "name" }, + { name: "order" } + ] + }; + } + case "Checkout": { + return { + name: "Checkout", + properties: [ + { name: "branch" } + ] + }; + } + case "CherryPicking": { + return { + name: "CherryPicking", + properties: [ + { name: "id" }, + { name: "parent" }, + { name: "tags", defaultValue: [] } + ] + }; + } + case "Commit": { + return { + name: "Commit", + properties: [ + { name: "id" }, + { name: "message" }, + { name: "tags", defaultValue: [] }, + { name: "type" } + ] + }; + } + case "Common": { + return { + name: "Common", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "title" } + ] + }; + } + case "GitGraph": { + return { + name: "GitGraph", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "statements", defaultValue: [] }, + { name: "title" } + ] + }; + } + case "Info": { + return { + name: "Info", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "title" } + ] + }; + } + case "Merge": { + return { + name: "Merge", + properties: [ + { name: "branch" }, + { name: "id" }, + { name: "tags", defaultValue: [] }, + { name: "type" } + ] + }; + } + case "Packet": { + return { + name: "Packet", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "blocks", defaultValue: [] }, + { name: "title" } + ] + }; + } + case "PacketBlock": { + return { + name: "PacketBlock", + properties: [ + { name: "end" }, + { name: "label" }, + { name: "start" } + ] + }; + } + case "Pie": { + return { + name: "Pie", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "sections", defaultValue: [] }, + { name: "showData", defaultValue: false }, + { name: "title" } + ] + }; + } + case "PieSection": { + return { + name: "PieSection", + properties: [ + { name: "label" }, + { name: "value" } + ] + }; + } + case "Direction": { + return { + name: "Direction", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "dir" }, + { name: "statements", defaultValue: [] }, + { name: "title" } + ] + }; + } + default: { + return { + name: type3, + properties: [] + }; + } + } + } + }; + reflection2 = new MermaidAstReflection(); + InfoGrammar = /* @__PURE__ */ __name2(() => loadedInfoGrammar ?? (loadedInfoGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "InfoGrammar"); + PacketGrammar = /* @__PURE__ */ __name2(() => loadedPacketGrammar ?? (loadedPacketGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}`)), "PacketGrammar"); + PieGrammar = /* @__PURE__ */ __name2(() => loadedPieGrammar ?? (loadedPieGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "PieGrammar"); + GitGraphGrammar = /* @__PURE__ */ __name2(() => loadedGitGraphGrammar ?? (loadedGitGraphGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)), "GitGraphGrammar"); + InfoLanguageMetaData = { + languageId: "info", + fileExtensions: [".mmd", ".mermaid"], + caseInsensitive: false + }; + PacketLanguageMetaData = { + languageId: "packet", + fileExtensions: [".mmd", ".mermaid"], + caseInsensitive: false + }; + PieLanguageMetaData = { + languageId: "pie", + fileExtensions: [".mmd", ".mermaid"], + caseInsensitive: false + }; + GitGraphLanguageMetaData = { + languageId: "gitGraph", + fileExtensions: [".mmd", ".mermaid"], + caseInsensitive: false + }; + MermaidGeneratedSharedModule = { + AstReflection: /* @__PURE__ */ __name2(() => new MermaidAstReflection(), "AstReflection") + }; + InfoGeneratedModule = { + Grammar: /* @__PURE__ */ __name2(() => InfoGrammar(), "Grammar"), + LanguageMetaData: /* @__PURE__ */ __name2(() => InfoLanguageMetaData, "LanguageMetaData"), + parser: {} + }; + PacketGeneratedModule = { + Grammar: /* @__PURE__ */ __name2(() => PacketGrammar(), "Grammar"), + LanguageMetaData: /* @__PURE__ */ __name2(() => PacketLanguageMetaData, "LanguageMetaData"), + parser: {} + }; + PieGeneratedModule = { + Grammar: /* @__PURE__ */ __name2(() => PieGrammar(), "Grammar"), + LanguageMetaData: /* @__PURE__ */ __name2(() => PieLanguageMetaData, "LanguageMetaData"), + parser: {} + }; + GitGraphGeneratedModule = { + Grammar: /* @__PURE__ */ __name2(() => GitGraphGrammar(), "Grammar"), + LanguageMetaData: /* @__PURE__ */ __name2(() => GitGraphLanguageMetaData, "LanguageMetaData"), + parser: {} + }; + accessibilityDescrRegex = /accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/; + accessibilityTitleRegex = /accTitle[\t ]*:([^\n\r]*)/; + titleRegex = /title([\t ][^\n\r]*|)/; + rulesRegexes = { + ACC_DESCR: accessibilityDescrRegex, + ACC_TITLE: accessibilityTitleRegex, + TITLE: titleRegex + }; + AbstractMermaidValueConverter = class extends DefaultValueConverter { + static { + __name(this, "AbstractMermaidValueConverter"); + } + static { + __name2(this, "AbstractMermaidValueConverter"); + } + runConverter(rule, input, cstNode) { + let value2 = this.runCommonConverter(rule, input, cstNode); + if (value2 === void 0) { + value2 = this.runCustomConverter(rule, input, cstNode); + } + if (value2 === void 0) { + return super.runConverter(rule, input, cstNode); + } + return value2; + } + runCommonConverter(rule, input, _cstNode) { + const regex = rulesRegexes[rule.name]; + if (regex === void 0) { + return void 0; + } + const match2 = regex.exec(input); + if (match2 === null) { + return void 0; + } + if (match2[1] !== void 0) { + return match2[1].trim().replace(/[\t ]{2,}/gm, " "); + } + if (match2[2] !== void 0) { + return match2[2].replace(/^\s*/gm, "").replace(/\s+$/gm, "").replace(/[\t ]{2,}/gm, " ").replace(/[\n\r]{2,}/gm, "\n"); + } + return void 0; + } + }; + CommonValueConverter = class extends AbstractMermaidValueConverter { + static { + __name(this, "CommonValueConverter"); + } + static { + __name2(this, "CommonValueConverter"); + } + runCustomConverter(_rule, _input, _cstNode) { + return void 0; + } + }; + AbstractMermaidTokenBuilder = class extends DefaultTokenBuilder { + static { + __name(this, "AbstractMermaidTokenBuilder"); + } + static { + __name2(this, "AbstractMermaidTokenBuilder"); + } + constructor(keywords) { + super(); + this.keywords = new Set(keywords); + } + buildKeywordTokens(rules, terminalTokens, options3) { + const tokenTypes = super.buildKeywordTokens(rules, terminalTokens, options3); + tokenTypes.forEach((tokenType) => { + if (this.keywords.has(tokenType.name) && tokenType.PATTERN !== void 0) { + tokenType.PATTERN = new RegExp(tokenType.PATTERN.toString() + "(?:(?=%%)|(?!\\S))"); + } + }); + return tokenTypes; + } + }; + CommonTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "CommonTokenBuilder"); + } + static { + __name2(this, "CommonTokenBuilder"); + } + }; + } + }); -.statediagram-state .title-state { - rx: 5px; - ry: 5px; -} -.statediagram-cluster.statediagram-cluster .inner { - fill: ${options2.compositeBackground || options2.background}; -} -.statediagram-cluster.statediagram-cluster-alt .inner { - fill: ${options2.altBackground ? options2.altBackground : "#efefef"}; -} + // ../parser/dist/chunks/mermaid-parser.core/chunk-QE2ZKFLT.mjs + function createGitGraphServices(context = EmptyFileSystem) { + const shared = inject( + createDefaultSharedCoreModule(context), + MermaidGeneratedSharedModule + ); + const GitGraph2 = inject( + createDefaultCoreModule({ shared }), + GitGraphGeneratedModule, + GitGraphModule + ); + shared.ServiceRegistry.register(GitGraph2); + return { shared, GitGraph: GitGraph2 }; + } + var GitGraphTokenBuilder, GitGraphModule; + var init_chunk_QE2ZKFLT = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-QE2ZKFLT.mjs"() { + "use strict"; + init_chunk_U3TRWOCV(); + init_lib2(); + GitGraphTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "GitGraphTokenBuilder"); + } + static { + __name2(this, "GitGraphTokenBuilder"); + } + constructor() { + super(["gitGraph"]); + } + }; + GitGraphModule = { + parser: { + TokenBuilder: /* @__PURE__ */ __name2(() => new GitGraphTokenBuilder(), "TokenBuilder"), + ValueConverter: /* @__PURE__ */ __name2(() => new CommonValueConverter(), "ValueConverter") + } + }; + __name(createGitGraphServices, "createGitGraphServices"); + __name2(createGitGraphServices, "createGitGraphServices"); + } + }); -.statediagram-cluster .inner { - rx:0; - ry:0; -} + // ../parser/dist/chunks/mermaid-parser.core/chunk-O2VHLUZY.mjs + function createInfoServices(context = EmptyFileSystem) { + const shared = inject( + createDefaultSharedCoreModule(context), + MermaidGeneratedSharedModule + ); + const Info2 = inject( + createDefaultCoreModule({ shared }), + InfoGeneratedModule, + InfoModule + ); + shared.ServiceRegistry.register(Info2); + return { shared, Info: Info2 }; + } + var InfoTokenBuilder, InfoModule; + var init_chunk_O2VHLUZY = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-O2VHLUZY.mjs"() { + "use strict"; + init_chunk_U3TRWOCV(); + init_lib2(); + InfoTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "InfoTokenBuilder"); + } + static { + __name2(this, "InfoTokenBuilder"); + } + constructor() { + super(["info", "showInfo"]); + } + }; + InfoModule = { + parser: { + TokenBuilder: /* @__PURE__ */ __name2(() => new InfoTokenBuilder(), "TokenBuilder"), + ValueConverter: /* @__PURE__ */ __name2(() => new CommonValueConverter(), "ValueConverter") + } + }; + __name(createInfoServices, "createInfoServices"); + __name2(createInfoServices, "createInfoServices"); + } + }); -.statediagram-state rect.basic { - rx: 5px; - ry: 5px; -} -.statediagram-state rect.divider { - stroke-dasharray: 10,10; - fill: ${options2.altBackground ? options2.altBackground : "#efefef"}; -} + // ../parser/dist/chunks/mermaid-parser.core/chunk-HTBTGXD4.mjs + function createPacketServices(context = EmptyFileSystem) { + const shared = inject( + createDefaultSharedCoreModule(context), + MermaidGeneratedSharedModule + ); + const Packet2 = inject( + createDefaultCoreModule({ shared }), + PacketGeneratedModule, + PacketModule + ); + shared.ServiceRegistry.register(Packet2); + return { shared, Packet: Packet2 }; + } + var PacketTokenBuilder, PacketModule; + var init_chunk_HTBTGXD4 = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-HTBTGXD4.mjs"() { + "use strict"; + init_chunk_U3TRWOCV(); + init_lib2(); + PacketTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "PacketTokenBuilder"); + } + static { + __name2(this, "PacketTokenBuilder"); + } + constructor() { + super(["packet-beta"]); + } + }; + PacketModule = { + parser: { + TokenBuilder: /* @__PURE__ */ __name2(() => new PacketTokenBuilder(), "TokenBuilder"), + ValueConverter: /* @__PURE__ */ __name2(() => new CommonValueConverter(), "ValueConverter") + } + }; + __name(createPacketServices, "createPacketServices"); + __name2(createPacketServices, "createPacketServices"); + } + }); -.note-edge { - stroke-dasharray: 5; -} + // ../parser/dist/chunks/mermaid-parser.core/chunk-NM56GJBF.mjs + function createPieServices(context = EmptyFileSystem) { + const shared = inject( + createDefaultSharedCoreModule(context), + MermaidGeneratedSharedModule + ); + const Pie2 = inject( + createDefaultCoreModule({ shared }), + PieGeneratedModule, + PieModule + ); + shared.ServiceRegistry.register(Pie2); + return { shared, Pie: Pie2 }; + } + var PieTokenBuilder, PieValueConverter, PieModule; + var init_chunk_NM56GJBF = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-NM56GJBF.mjs"() { + "use strict"; + init_chunk_U3TRWOCV(); + init_lib2(); + PieTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "PieTokenBuilder"); + } + static { + __name2(this, "PieTokenBuilder"); + } + constructor() { + super(["pie", "showData"]); + } + }; + PieValueConverter = class extends AbstractMermaidValueConverter { + static { + __name(this, "PieValueConverter"); + } + static { + __name2(this, "PieValueConverter"); + } + runCustomConverter(rule, input, _cstNode) { + if (rule.name !== "PIE_SECTION_LABEL") { + return void 0; + } + return input.replace(/"/g, "").trim(); + } + }; + PieModule = { + parser: { + TokenBuilder: /* @__PURE__ */ __name2(() => new PieTokenBuilder(), "TokenBuilder"), + ValueConverter: /* @__PURE__ */ __name2(() => new PieValueConverter(), "ValueConverter") + } + }; + __name(createPieServices, "createPieServices"); + __name2(createPieServices, "createPieServices"); + } + }); -.statediagram-note rect { - fill: ${options2.noteBkgColor}; - stroke: ${options2.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} -.statediagram-note rect { - fill: ${options2.noteBkgColor}; - stroke: ${options2.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} + // ../parser/dist/chunks/mermaid-parser.core/info-PWGDJKR5.mjs + var info_PWGDJKR5_exports = {}; + __export(info_PWGDJKR5_exports, { + InfoModule: () => InfoModule, + createInfoServices: () => createInfoServices + }); + var init_info_PWGDJKR5 = __esm({ + "../parser/dist/chunks/mermaid-parser.core/info-PWGDJKR5.mjs"() { + "use strict"; + init_chunk_O2VHLUZY(); + init_chunk_U3TRWOCV(); + } + }); -.statediagram-note text { - fill: ${options2.noteTextColor}; -} + // ../parser/dist/chunks/mermaid-parser.core/packet-7PPW3X5M.mjs + var packet_7PPW3X5M_exports = {}; + __export(packet_7PPW3X5M_exports, { + PacketModule: () => PacketModule, + createPacketServices: () => createPacketServices + }); + var init_packet_7PPW3X5M = __esm({ + "../parser/dist/chunks/mermaid-parser.core/packet-7PPW3X5M.mjs"() { + "use strict"; + init_chunk_HTBTGXD4(); + init_chunk_U3TRWOCV(); + } + }); -.statediagram-note .nodeLabel { - color: ${options2.noteTextColor}; -} -.statediagram .edgeLabel { - color: red; // ${options2.noteTextColor}; -} + // ../parser/dist/chunks/mermaid-parser.core/pie-RF5LNP4B.mjs + var pie_RF5LNP4B_exports = {}; + __export(pie_RF5LNP4B_exports, { + PieModule: () => PieModule, + createPieServices: () => createPieServices + }); + var init_pie_RF5LNP4B = __esm({ + "../parser/dist/chunks/mermaid-parser.core/pie-RF5LNP4B.mjs"() { + "use strict"; + init_chunk_NM56GJBF(); + init_chunk_U3TRWOCV(); + } + }); -#dependencyStart, #dependencyEnd { - fill: ${options2.lineColor}; - stroke: ${options2.lineColor}; - stroke-width: 1; -} + // ../parser/dist/chunks/mermaid-parser.core/gitGraph-F2EDSAW4.mjs + var gitGraph_F2EDSAW4_exports = {}; + __export(gitGraph_F2EDSAW4_exports, { + GitGraphModule: () => GitGraphModule, + createGitGraphServices: () => createGitGraphServices + }); + var init_gitGraph_F2EDSAW4 = __esm({ + "../parser/dist/chunks/mermaid-parser.core/gitGraph-F2EDSAW4.mjs"() { + "use strict"; + init_chunk_QE2ZKFLT(); + init_chunk_U3TRWOCV(); + } + }); -.statediagramTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; -} -`; - const styles$4 = getStyles$5; - const idCache = {}; - const set = (key, val) => { - idCache[key] = val; - }; - const get = (k) => idCache[k]; - const keys = () => Object.keys(idCache); - const size = () => keys().length; - const idCache$1 = { - get, - set, - keys, - size - }; - const drawStartState = (g) => g.append("circle").attr("class", "start-state").attr("r", getConfig$1().state.sizeUnit).attr("cx", getConfig$1().state.padding + getConfig$1().state.sizeUnit).attr("cy", getConfig$1().state.padding + getConfig$1().state.sizeUnit); - const drawDivider = (g) => g.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", getConfig$1().state.textHeight).attr("class", "divider").attr("x2", getConfig$1().state.textHeight * 2).attr("y1", 0).attr("y2", 0); - const drawSimpleState = (g, stateDef) => { - const state2 = g.append("text").attr("x", 2 * getConfig$1().state.padding).attr("y", getConfig$1().state.textHeight + 2 * getConfig$1().state.padding).attr("font-size", getConfig$1().state.fontSize).attr("class", "state-title").text(stateDef.id); - const classBox = state2.node().getBBox(); - g.insert("rect", ":first-child").attr("x", getConfig$1().state.padding).attr("y", getConfig$1().state.padding).attr("width", classBox.width + 2 * getConfig$1().state.padding).attr("height", classBox.height + 2 * getConfig$1().state.padding).attr("rx", getConfig$1().state.radius); - return state2; - }; - const drawDescrState = (g, stateDef) => { - const addTspan2 = function(textEl, txt, isFirst2) { - const tSpan = textEl.append("tspan").attr("x", 2 * getConfig$1().state.padding).text(txt); - if (!isFirst2) { - tSpan.attr("dy", getConfig$1().state.textHeight); - } - }; - const title2 = g.append("text").attr("x", 2 * getConfig$1().state.padding).attr("y", getConfig$1().state.textHeight + 1.3 * getConfig$1().state.padding).attr("font-size", getConfig$1().state.fontSize).attr("class", "state-title").text(stateDef.descriptions[0]); - const titleBox = title2.node().getBBox(); - const titleHeight = titleBox.height; - const description = g.append("text").attr("x", getConfig$1().state.padding).attr( - "y", - titleHeight + getConfig$1().state.padding * 0.4 + getConfig$1().state.dividerMargin + getConfig$1().state.textHeight - ).attr("class", "state-description"); - let isFirst = true; - let isSecond = true; - stateDef.descriptions.forEach(function(descr) { - if (!isFirst) { - addTspan2(description, descr, isSecond); - isSecond = false; - } - isFirst = false; - }); - const descrLine = g.append("line").attr("x1", getConfig$1().state.padding).attr("y1", getConfig$1().state.padding + titleHeight + getConfig$1().state.dividerMargin / 2).attr("y2", getConfig$1().state.padding + titleHeight + getConfig$1().state.dividerMargin / 2).attr("class", "descr-divider"); - const descrBox = description.node().getBBox(); - const width2 = Math.max(descrBox.width, titleBox.width); - descrLine.attr("x2", width2 + 3 * getConfig$1().state.padding); - g.insert("rect", ":first-child").attr("x", getConfig$1().state.padding).attr("y", getConfig$1().state.padding).attr("width", width2 + 2 * getConfig$1().state.padding).attr("height", descrBox.height + titleHeight + 2 * getConfig$1().state.padding).attr("rx", getConfig$1().state.radius); - return g; - }; - const addTitleAndBox = (g, stateDef, altBkg) => { - const pad2 = getConfig$1().state.padding; - const dblPad = 2 * getConfig$1().state.padding; - const orgBox = g.node().getBBox(); - const orgWidth = orgBox.width; - const orgX = orgBox.x; - const title2 = g.append("text").attr("x", 0).attr("y", getConfig$1().state.titleShift).attr("font-size", getConfig$1().state.fontSize).attr("class", "state-title").text(stateDef.id); - const titleBox = title2.node().getBBox(); - const titleWidth = titleBox.width + dblPad; - let width2 = Math.max(titleWidth, orgWidth); - if (width2 === orgWidth) { - width2 = width2 + dblPad; - } - let startX; - const graphBox = g.node().getBBox(); - if (stateDef.doc) - ; - startX = orgX - pad2; - if (titleWidth > orgWidth) { - startX = (orgWidth - width2) / 2 + pad2; - } - if (Math.abs(orgX - graphBox.x) < pad2 && titleWidth > orgWidth) { - startX = orgX - (titleWidth - orgWidth) / 2; - } - const lineY = 1 - getConfig$1().state.textHeight; - g.insert("rect", ":first-child").attr("x", startX).attr("y", lineY).attr("class", altBkg ? "alt-composit" : "composit").attr("width", width2).attr( - "height", - graphBox.height + getConfig$1().state.textHeight + getConfig$1().state.titleShift + 1 - ).attr("rx", "0"); - title2.attr("x", startX + pad2); - if (titleWidth <= orgWidth) { - title2.attr("x", orgX + (width2 - dblPad) / 2 - titleWidth / 2 + pad2); - } - g.insert("rect", ":first-child").attr("x", startX).attr( - "y", - getConfig$1().state.titleShift - getConfig$1().state.textHeight - getConfig$1().state.padding - ).attr("width", width2).attr("height", getConfig$1().state.textHeight * 3).attr("rx", getConfig$1().state.radius); - g.insert("rect", ":first-child").attr("x", startX).attr( - "y", - getConfig$1().state.titleShift - getConfig$1().state.textHeight - getConfig$1().state.padding - ).attr("width", width2).attr("height", graphBox.height + 3 + 2 * getConfig$1().state.textHeight).attr("rx", getConfig$1().state.radius); - return g; - }; - const drawEndState = (g) => { - g.append("circle").attr("class", "end-state-outer").attr("r", getConfig$1().state.sizeUnit + getConfig$1().state.miniPadding).attr( - "cx", - getConfig$1().state.padding + getConfig$1().state.sizeUnit + getConfig$1().state.miniPadding - ).attr( - "cy", - getConfig$1().state.padding + getConfig$1().state.sizeUnit + getConfig$1().state.miniPadding - ); - return g.append("circle").attr("class", "end-state-inner").attr("r", getConfig$1().state.sizeUnit).attr("cx", getConfig$1().state.padding + getConfig$1().state.sizeUnit + 2).attr("cy", getConfig$1().state.padding + getConfig$1().state.sizeUnit + 2); - }; - const drawForkJoinState = (g, stateDef) => { - let width2 = getConfig$1().state.forkWidth; - let height = getConfig$1().state.forkHeight; - if (stateDef.parentId) { - let tmp = width2; - width2 = height; - height = tmp; - } - return g.append("rect").style("stroke", "black").style("fill", "black").attr("width", width2).attr("height", height).attr("x", getConfig$1().state.padding).attr("y", getConfig$1().state.padding); - }; - const _drawLongText = (_text, x2, y2, g) => { - let textHeight = 0; - const textElem = g.append("text"); - textElem.style("text-anchor", "start"); - textElem.attr("class", "noteText"); - let text2 = _text.replace(/\r\n/g, "
    "); - text2 = text2.replace(/\n/g, "
    "); - const lines = text2.split(common$1.lineBreakRegex); - let tHeight = 1.25 * getConfig$1().state.noteMargin; - for (const line2 of lines) { - const txt = line2.trim(); - if (txt.length > 0) { - const span = textElem.append("tspan"); - span.text(txt); - if (tHeight === 0) { - const textBounds = span.node().getBBox(); - tHeight += textBounds.height; + // ../parser/dist/mermaid-parser.core.mjs + async function parse2(diagramType, text2) { + const initializer = initializers[diagramType]; + if (!initializer) { + throw new Error(`Unknown diagram type: ${diagramType}`); + } + if (!parsers[diagramType]) { + await initializer(); + } + const parser21 = parsers[diagramType]; + const result = parser21.parse(text2); + if (result.lexerErrors.length > 0 || result.parserErrors.length > 0) { + throw new MermaidParseError(result); + } + return result.value; + } + var parsers, initializers, MermaidParseError; + var init_mermaid_parser_core = __esm({ + "../parser/dist/mermaid-parser.core.mjs"() { + "use strict"; + init_chunk_QE2ZKFLT(); + init_chunk_O2VHLUZY(); + init_chunk_HTBTGXD4(); + init_chunk_NM56GJBF(); + init_chunk_U3TRWOCV(); + parsers = {}; + initializers = { + info: /* @__PURE__ */ __name2(async () => { + const { createInfoServices: createInfoServices2 } = await Promise.resolve().then(() => (init_info_PWGDJKR5(), info_PWGDJKR5_exports)); + const parser21 = createInfoServices2().Info.parser.LangiumParser; + parsers.info = parser21; + }, "info"), + packet: /* @__PURE__ */ __name2(async () => { + const { createPacketServices: createPacketServices2 } = await Promise.resolve().then(() => (init_packet_7PPW3X5M(), packet_7PPW3X5M_exports)); + const parser21 = createPacketServices2().Packet.parser.LangiumParser; + parsers.packet = parser21; + }, "packet"), + pie: /* @__PURE__ */ __name2(async () => { + const { createPieServices: createPieServices2 } = await Promise.resolve().then(() => (init_pie_RF5LNP4B(), pie_RF5LNP4B_exports)); + const parser21 = createPieServices2().Pie.parser.LangiumParser; + parsers.pie = parser21; + }, "pie"), + gitGraph: /* @__PURE__ */ __name2(async () => { + const { createGitGraphServices: createGitGraphServices2 } = await Promise.resolve().then(() => (init_gitGraph_F2EDSAW4(), gitGraph_F2EDSAW4_exports)); + const parser21 = createGitGraphServices2().GitGraph.parser.LangiumParser; + parsers.gitGraph = parser21; + }, "gitGraph") + }; + __name(parse2, "parse"); + __name2(parse2, "parse"); + MermaidParseError = class extends Error { + static { + __name(this, "MermaidParseError"); + } + constructor(result) { + const lexerErrors = result.lexerErrors.map((err) => err.message).join("\n"); + const parserErrors = result.parserErrors.map((err) => err.message).join("\n"); + super(`Parsing failed: ${lexerErrors} ${parserErrors}`); + this.result = result; + } + static { + __name2(this, "MermaidParseError"); } - textHeight += tHeight; - span.attr("x", x2 + getConfig$1().state.noteMargin); - span.attr("y", y2 + textHeight + 1.25 * getConfig$1().state.noteMargin); - } - } - return { textWidth: textElem.node().getBBox().width, textHeight }; - }; - const drawNote = (text2, g) => { - g.attr("class", "state-note"); - const note2 = g.append("rect").attr("x", 0).attr("y", getConfig$1().state.padding); - const rectElem = g.append("g"); - const { textWidth, textHeight } = _drawLongText(text2, 0, 0, rectElem); - note2.attr("height", textHeight + 2 * getConfig$1().state.noteMargin); - note2.attr("width", textWidth + getConfig$1().state.noteMargin * 2); - return note2; - }; - const drawState = function(elem, stateDef) { - const id2 = stateDef.id; - const stateInfo = { - id: id2, - label: stateDef.id, - width: 0, - height: 0 - }; - const g = elem.append("g").attr("id", id2).attr("class", "stateGroup"); - if (stateDef.type === "start") { - drawStartState(g); + }; } - if (stateDef.type === "end") { - drawEndState(g); + }); + + // src/diagrams/common/populateCommonDb.ts + function populateCommonDb(ast, db7) { + if (ast.accDescr) { + db7.setAccDescription?.(ast.accDescr); } - if (stateDef.type === "fork" || stateDef.type === "join") { - drawForkJoinState(g, stateDef); + if (ast.accTitle) { + db7.setAccTitle?.(ast.accTitle); } - if (stateDef.type === "note") { - drawNote(stateDef.note.text, g); + if (ast.title) { + db7.setDiagramTitle?.(ast.title); } - if (stateDef.type === "divider") { - drawDivider(g); + } + var init_populateCommonDb = __esm({ + "src/diagrams/common/populateCommonDb.ts"() { + "use strict"; + __name(populateCommonDb, "populateCommonDb"); } - if (stateDef.type === "default" && stateDef.descriptions.length === 0) { - drawSimpleState(g, stateDef); + }); + + // src/diagrams/git/gitGraphTypes.ts + var commitType; + var init_gitGraphTypes = __esm({ + "src/diagrams/git/gitGraphTypes.ts"() { + "use strict"; + commitType = { + NORMAL: 0, + REVERSE: 1, + HIGHLIGHT: 2, + MERGE: 3, + CHERRY_PICK: 4 + }; } - if (stateDef.type === "default" && stateDef.descriptions.length > 0) { - drawDescrState(g, stateDef); + }); + + // src/utils/imperativeState.ts + var ImperativeState; + var init_imperativeState = __esm({ + "src/utils/imperativeState.ts"() { + "use strict"; + ImperativeState = class { + /** + * @param init - Function that creates the default state. + */ + constructor(init3) { + this.init = init3; + this.records = this.init(); + } + static { + __name(this, "ImperativeState"); + } + reset() { + this.records = this.init(); + } + }; } - const stateBox = g.node().getBBox(); - stateInfo.width = stateBox.width + 2 * getConfig$1().state.padding; - stateInfo.height = stateBox.height + 2 * getConfig$1().state.padding; - idCache$1.set(id2, stateInfo); - return stateInfo; - }; - let edgeCount$1 = 0; - const drawEdge = function(elem, path2, relation) { - const getRelationType = function(type2) { - switch (type2) { - case db$7.relationType.AGGREGATION: - return "aggregation"; - case db$7.relationType.EXTENSION: - return "extension"; - case db$7.relationType.COMPOSITION: - return "composition"; - case db$7.relationType.DEPENDENCY: - return "dependency"; - } - }; - path2.points = path2.points.filter((p) => !Number.isNaN(p.y)); - const lineData = path2.points; - const lineFunction = line$1().x(function(d) { - return d.x; - }).y(function(d) { - return d.y; - }).curve(curveBasis); - const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount$1).attr("class", "transition"); - let url = ""; - if (getConfig$1().state.arrowMarkerAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, "\\("); - url = url.replace(/\)/g, "\\)"); - } - svgPath.attr( - "marker-end", - "url(" + url + "#" + getRelationType(db$7.relationType.DEPENDENCY) + "End)" - ); - if (relation.title !== void 0) { - const label = elem.append("g").attr("class", "stateLabel"); - const { x: x2, y: y2 } = utils$1.calcLabelPosition(path2.points); - const rows = common$1.getRows(relation.title); - let titleHeight = 0; - const titleRows = []; - let maxWidth = 0; - let minX = 0; - for (let i2 = 0; i2 <= rows.length; i2++) { - const title2 = label.append("text").attr("text-anchor", "middle").text(rows[i2]).attr("x", x2).attr("y", y2 + titleHeight); - const boundsTmp = title2.node().getBBox(); - maxWidth = Math.max(maxWidth, boundsTmp.width); - minX = Math.min(minX, boundsTmp.x); - log$1.info(boundsTmp.x, x2, y2 + titleHeight); - if (titleHeight === 0) { - const titleBox = title2.node().getBBox(); - titleHeight = titleBox.height; - log$1.info("Title height", titleHeight, y2); - } - titleRows.push(title2); - } - let boxHeight = titleHeight * rows.length; - if (rows.length > 1) { - const heightAdj = (rows.length - 1) * titleHeight * 0.5; - titleRows.forEach((title2, i2) => title2.attr("y", y2 + i2 * titleHeight - heightAdj)); - boxHeight = titleHeight * rows.length; - } - const bounds2 = label.node().getBBox(); - label.insert("rect", ":first-child").attr("class", "box").attr("x", x2 - maxWidth / 2 - getConfig$1().state.padding / 2).attr("y", y2 - boxHeight / 2 - getConfig$1().state.padding / 2 - 3.5).attr("width", maxWidth + getConfig$1().state.padding).attr("height", boxHeight + getConfig$1().state.padding); - log$1.info(bounds2); - } - edgeCount$1++; - }; - let conf$2; - const transformationLog = {}; - const setConf$2 = function() { - }; - const insertMarkers = function(elem) { - elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); - }; - const draw$7 = function(text2, id2, _version, diagObj) { - conf$2 = getConfig$1().state; - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - log$1.debug("Rendering diagram " + text2); - const diagram2 = root2.select(`[id='${id2}']`); - insertMarkers(diagram2); - const rootDoc2 = diagObj.db.getRootDoc(); - renderDoc(rootDoc2, diagram2, void 0, false, root2, doc, diagObj); - const padding2 = conf$2.padding; - const bounds2 = diagram2.node().getBBox(); - const width2 = bounds2.width + padding2 * 2; - const height = bounds2.height + padding2 * 2; - const svgWidth = width2 * 1.75; - configureSvgSize(diagram2, height, svgWidth, conf$2.useMaxWidth); - diagram2.attr( - "viewBox", - `${bounds2.x - conf$2.padding} ${bounds2.y - conf$2.padding} ` + width2 + " " + height - ); - }; - const getLabelWidth = (text2) => { - return text2 ? text2.length * conf$2.fontSizeFactor : 1; - }; - const renderDoc = (doc, diagram2, parentId, altBkg, root2, domDocument, diagObj) => { - const graph = new Graph({ - compound: true, - multigraph: true - }); - let i2; - let edgeFreeDoc = true; - for (i2 = 0; i2 < doc.length; i2++) { - if (doc[i2].stmt === "relation") { - edgeFreeDoc = false; - break; + }); + + // src/diagrams/git/gitGraphAst.ts + function getID() { + return random({ length: 7 }); + } + function uniqBy2(list2, fn3) { + const recordMap = /* @__PURE__ */ Object.create(null); + return list2.reduce((out, item) => { + const key = fn3(item); + if (!recordMap[key]) { + recordMap[key] = true; + out.push(item); } - } - if (parentId) { - graph.setGraph({ - rankdir: "LR", - multigraph: true, - compound: true, - // acyclicer: 'greedy', - ranker: "tight-tree", - ranksep: edgeFreeDoc ? 1 : conf$2.edgeLengthFactor, - nodeSep: edgeFreeDoc ? 1 : 50, - isMultiGraph: true - // ranksep: 5, - // nodesep: 1 - }); + return out; + }, []); + } + function upsert(arr, key, newVal) { + const index = arr.indexOf(key); + if (index === -1) { + arr.push(newVal); } else { - graph.setGraph({ - rankdir: "TB", - multigraph: true, - compound: true, - // isCompound: true, - // acyclicer: 'greedy', - // ranker: 'longest-path' - ranksep: edgeFreeDoc ? 1 : conf$2.edgeLengthFactor, - nodeSep: edgeFreeDoc ? 1 : 50, - ranker: "tight-tree", - // ranker: 'network-simplex' - isMultiGraph: true - }); + arr.splice(index, 1, newVal); } - graph.setDefaultEdgeLabel(function() { - return {}; - }); - diagObj.db.extract(doc); - const states = diagObj.db.getStates(); - const relations2 = diagObj.db.getRelations(); - const keys2 = Object.keys(states); - for (const key of keys2) { - const stateDef = states[key]; - if (parentId) { - stateDef.parentId = parentId; - } - let node2; - if (stateDef.doc) { - let sub2 = diagram2.append("g").attr("id", stateDef.id).attr("class", "stateGroup"); - node2 = renderDoc(stateDef.doc, sub2, stateDef.id, !altBkg, root2, domDocument, diagObj); - { - sub2 = addTitleAndBox(sub2, stateDef, altBkg); - let boxBounds = sub2.node().getBBox(); - node2.width = boxBounds.width; - node2.height = boxBounds.height + conf$2.padding / 2; - transformationLog[stateDef.id] = { y: conf$2.compositTitleSize }; - } - } else { - node2 = drawState(diagram2, stateDef); - } - if (stateDef.note) { - const noteDef = { - descriptions: [], - id: stateDef.id + "-note", - note: stateDef.note, - type: "note" - }; - const note2 = drawState(diagram2, noteDef); - if (stateDef.note.position === "left of") { - graph.setNode(node2.id + "-note", note2); - graph.setNode(node2.id, node2); - } else { - graph.setNode(node2.id, node2); - graph.setNode(node2.id + "-note", note2); - } - graph.setParent(node2.id, node2.id + "-group"); - graph.setParent(node2.id + "-note", node2.id + "-group"); - } else { - graph.setNode(node2.id, node2); + } + function prettyPrintCommitHistory(commitArr) { + const commit2 = commitArr.reduce((out, commit3) => { + if (out.seq > commit3.seq) { + return out; } - } - log$1.debug("Count=", graph.nodeCount(), graph); - let cnt2 = 0; - relations2.forEach(function(relation) { - cnt2++; - log$1.debug("Setting edge", relation); - graph.setEdge( - relation.id1, - relation.id2, - { - relation, - width: getLabelWidth(relation.title), - height: conf$2.labelHeight * common$1.getRows(relation.title).length, - labelpos: "c" - }, - "id" + cnt2 - ); - }); - layout$1(graph); - log$1.debug("Graph after layout", graph.nodes()); - const svgElem = diagram2.node(); - graph.nodes().forEach(function(v) { - if (v !== void 0 && graph.node(v) !== void 0) { - log$1.warn("Node " + v + ": " + JSON.stringify(graph.node(v))); - root2.select("#" + svgElem.id + " #" + v).attr( - "transform", - "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + " )" - ); - root2.select("#" + svgElem.id + " #" + v).attr("data-x-shift", graph.node(v).x - graph.node(v).width / 2); - const dividers = domDocument.querySelectorAll("#" + svgElem.id + " #" + v + " .divider"); - dividers.forEach((divider2) => { - const parent = divider2.parentElement; - let pWidth = 0; - let pShift = 0; - if (parent) { - if (parent.parentElement) { - pWidth = parent.parentElement.getBBox().width; - } - pShift = parseInt(parent.getAttribute("data-x-shift"), 10); - if (Number.isNaN(pShift)) { - pShift = 0; - } - } - divider2.setAttribute("x1", 0 - pShift + 8); - divider2.setAttribute("x2", pWidth - pShift - 8); - }); + return commit3; + }, commitArr[0]); + let line2 = ""; + commitArr.forEach(function(c3) { + if (c3 === commit2) { + line2 += " *"; } else { - log$1.debug("No Node " + v + ": " + JSON.stringify(graph.node(v))); + line2 += " |"; } }); - let stateBox = svgElem.getBBox(); - graph.edges().forEach(function(e) { - if (e !== void 0 && graph.edge(e) !== void 0) { - log$1.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph.edge(e))); - drawEdge(diagram2, graph.edge(e), graph.edge(e).relation); + const label = [line2, commit2.id, commit2.seq]; + for (const branch2 in state2.records.branches) { + if (state2.records.branches.get(branch2) === commit2.id) { + label.push(branch2); } - }); - stateBox = svgElem.getBBox(); - const stateInfo = { - id: parentId ? parentId : "root", - label: parentId ? parentId : "root", - width: 0, - height: 0 - }; - stateInfo.width = stateBox.width + 2 * conf$2.padding; - stateInfo.height = stateBox.height + 2 * conf$2.padding; - log$1.debug("Doc rendered", stateInfo, graph); - return stateInfo; - }; - const renderer$7 = { - setConf: setConf$2, - draw: draw$7 - }; - const diagram$7 = { - parser: parser$b, - db: db$7, - renderer: renderer$7, - styles: styles$4, - init: (cnf) => { - if (!cnf.state) { - cnf.state = {}; - } - cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$7.clear(); - } - }; - const stateDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$7 - }, Symbol.toStringTag, { value: "Module" })); - const SHAPE_STATE = "rect"; - const SHAPE_STATE_WITH_DESC = "rectWithTitle"; - const SHAPE_START = "start"; - const SHAPE_END = "end"; - const SHAPE_DIVIDER = "divider"; - const SHAPE_GROUP = "roundedWithTitle"; - const SHAPE_NOTE = "note"; - const SHAPE_NOTEGROUP = "noteGroup"; - const CSS_DIAGRAM = "statediagram"; - const CSS_STATE = "state"; - const CSS_DIAGRAM_STATE = `${CSS_DIAGRAM}-${CSS_STATE}`; - const CSS_EDGE = "transition"; - const CSS_NOTE = "note"; - const CSS_NOTE_EDGE = "note-edge"; - const CSS_EDGE_NOTE_EDGE = `${CSS_EDGE} ${CSS_NOTE_EDGE}`; - const CSS_DIAGRAM_NOTE = `${CSS_DIAGRAM}-${CSS_NOTE}`; - const CSS_CLUSTER = "cluster"; - const CSS_DIAGRAM_CLUSTER = `${CSS_DIAGRAM}-${CSS_CLUSTER}`; - const CSS_CLUSTER_ALT = "cluster-alt"; - const CSS_DIAGRAM_CLUSTER_ALT = `${CSS_DIAGRAM}-${CSS_CLUSTER_ALT}`; - const PARENT = "parent"; - const NOTE = "note"; - const DOMID_STATE = "state"; - const DOMID_TYPE_SPACER = "----"; - const NOTE_ID = `${DOMID_TYPE_SPACER}${NOTE}`; - const PARENT_ID = `${DOMID_TYPE_SPACER}${PARENT}`; - const G_EDGE_STYLE = "fill:none"; - const G_EDGE_ARROWHEADSTYLE = "fill: #333"; - const G_EDGE_LABELPOS = "c"; - const G_EDGE_LABELTYPE = "text"; - const G_EDGE_THICKNESS = "normal"; - let nodeDb$1 = {}; - let graphItemCount = 0; - const setConf$1 = function(cnf) { - const keys2 = Object.keys(cnf); - for (const key of keys2) { - cnf[key]; } - }; - const getClasses$3 = function(text2, diagramObj) { - diagramObj.db.extract(diagramObj.db.getRootDocV2()); - return diagramObj.db.getClasses(); - }; - function getClassesFromDbInfo(dbInfoItem) { - if (dbInfoItem === void 0 || dbInfoItem === null) { - return ""; + log.debug(label.join(" ")); + if (commit2.parents && commit2.parents.length == 2 && commit2.parents[0] && commit2.parents[1]) { + const newCommit = state2.records.commits.get(commit2.parents[0]); + upsert(commitArr, commit2, newCommit); + if (commit2.parents[1]) { + commitArr.push(state2.records.commits.get(commit2.parents[1])); + } + } else if (commit2.parents.length == 0) { + return; } else { - if (dbInfoItem.classes) { - return dbInfoItem.classes.join(" "); - } else { - return ""; + if (commit2.parents[0]) { + const newCommit = state2.records.commits.get(commit2.parents[0]); + upsert(commitArr, commit2, newCommit); } } + commitArr = uniqBy2(commitArr, (c3) => c3.id); + prettyPrintCommitHistory(commitArr); } - function stateDomId(itemId = "", counter = 0, type2 = "", typeSpacer = DOMID_TYPE_SPACER) { - const typeStr = type2 !== null && type2.length > 0 ? `${typeSpacer}${type2}` : ""; - return `${DOMID_STATE}-${itemId}${typeStr}-${counter}`; - } - const setupNode = (g, parent, parsedItem, diagramStates, diagramDb, altFlag) => { - const itemId = parsedItem.id; - const classStr = getClassesFromDbInfo(diagramStates[itemId]); - if (itemId !== "root") { - let shape = SHAPE_STATE; - if (parsedItem.start === true) { - shape = SHAPE_START; - } - if (parsedItem.start === false) { - shape = SHAPE_END; - } - if (parsedItem.type !== DEFAULT_STATE_TYPE) { - shape = parsedItem.type; - } - if (!nodeDb$1[itemId]) { - nodeDb$1[itemId] = { - id: itemId, - shape, - description: common$1.sanitizeText(itemId, getConfig$1()), - classes: `${classStr} ${CSS_DIAGRAM_STATE}` + var DEFAULT_GITGRAPH_CONFIG, getConfig3, state2, setDirection2, setOptions2, getOptions, commit, branch, merge2, cherryPick, checkout, prettyPrint, clear10, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection2, getHead, db; + var init_gitGraphAst = __esm({ + "src/diagrams/git/gitGraphAst.ts"() { + "use strict"; + init_logger(); + init_utils2(); + init_config(); + init_common(); + init_commonDb(); + init_gitGraphTypes(); + init_imperativeState(); + init_defaultConfig(); + DEFAULT_GITGRAPH_CONFIG = defaultConfig_default.gitGraph; + getConfig3 = /* @__PURE__ */ __name(() => { + const config6 = cleanAndMerge({ + ...DEFAULT_GITGRAPH_CONFIG, + ...getConfig().gitGraph + }); + return config6; + }, "getConfig"); + state2 = new ImperativeState(() => { + const config6 = getConfig3(); + const mainBranchName = config6.mainBranchName; + const mainBranchOrder = config6.mainBranchOrder; + return { + mainBranchName, + commits: /* @__PURE__ */ new Map(), + head: null, + branchConfig: /* @__PURE__ */ new Map([[mainBranchName, { name: mainBranchName, order: mainBranchOrder }]]), + branches: /* @__PURE__ */ new Map([[mainBranchName, null]]), + currBranch: mainBranchName, + direction: "LR", + seq: 0, + options: {} }; - } - const newNode = nodeDb$1[itemId]; - if (parsedItem.description) { - if (Array.isArray(newNode.description)) { - newNode.shape = SHAPE_STATE_WITH_DESC; - newNode.description.push(parsedItem.description); - } else { - if (newNode.description.length > 0) { - newNode.shape = SHAPE_STATE_WITH_DESC; - if (newNode.description === itemId) { - newNode.description = [parsedItem.description]; - } else { - newNode.description = [newNode.description, parsedItem.description]; - } - } else { - newNode.shape = SHAPE_STATE; - newNode.description = parsedItem.description; - } - } - newNode.description = common$1.sanitizeTextOrArray(newNode.description, getConfig$1()); - } - if (newNode.description.length === 1 && newNode.shape === SHAPE_STATE_WITH_DESC) { - newNode.shape = SHAPE_STATE; - } - if (!newNode.type && parsedItem.doc) { - log$1.info("Setting cluster for ", itemId, getDir(parsedItem)); - newNode.type = "group"; - newNode.dir = getDir(parsedItem); - newNode.shape = parsedItem.type === DIVIDER_TYPE ? SHAPE_DIVIDER : SHAPE_GROUP; - newNode.classes = newNode.classes + " " + CSS_DIAGRAM_CLUSTER + " " + (altFlag ? CSS_DIAGRAM_CLUSTER_ALT : ""); - } - const nodeData = { - labelStyle: "", - shape: newNode.shape, - labelText: newNode.description, - // typeof newNode.description === 'object' - // ? newNode.description[0] - // : newNode.description, - classes: newNode.classes, - style: "", - //styles.style, - id: itemId, - dir: newNode.dir, - domId: stateDomId(itemId, graphItemCount), - type: newNode.type, - padding: 15 - //getConfig().flowchart.padding - }; - nodeData.centerLabel = true; - if (parsedItem.note) { - const noteData = { - labelStyle: "", - shape: SHAPE_NOTE, - labelText: parsedItem.note.text, - classes: CSS_DIAGRAM_NOTE, - // useHtmlLabels: false, - style: "", - // styles.style, - id: itemId + NOTE_ID + "-" + graphItemCount, - domId: stateDomId(itemId, graphItemCount, NOTE), - type: newNode.type, - padding: 15 - //getConfig().flowchart.padding + }); + __name(getID, "getID"); + __name(uniqBy2, "uniqBy"); + setDirection2 = /* @__PURE__ */ __name(function(dir2) { + state2.records.direction = dir2; + }, "setDirection"); + setOptions2 = /* @__PURE__ */ __name(function(rawOptString) { + log.debug("options str", rawOptString); + rawOptString = rawOptString?.trim(); + rawOptString = rawOptString || "{}"; + try { + state2.records.options = JSON.parse(rawOptString); + } catch (e3) { + log.error("error while parsing gitGraph options", e3.message); + } + }, "setOptions"); + getOptions = /* @__PURE__ */ __name(function() { + return state2.records.options; + }, "getOptions"); + commit = /* @__PURE__ */ __name(function(commitDB) { + let msg = commitDB.msg; + let id26 = commitDB.id; + const type3 = commitDB.type; + let tags2 = commitDB.tags; + log.info("commit", msg, id26, type3, tags2); + log.debug("Entering commit:", msg, id26, type3, tags2); + const config6 = getConfig3(); + id26 = common_default.sanitizeText(id26, config6); + msg = common_default.sanitizeText(msg, config6); + tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config6)); + const newCommit = { + id: id26 ? id26 : state2.records.seq + "-" + getID(), + message: msg, + seq: state2.records.seq++, + type: type3 ?? commitType.NORMAL, + tags: tags2 ?? [], + parents: state2.records.head == null ? [] : [state2.records.head.id], + branch: state2.records.currBranch }; - const groupData = { - labelStyle: "", - shape: SHAPE_NOTEGROUP, - labelText: parsedItem.note.text, - classes: newNode.classes, - style: "", - // styles.style, - id: itemId + PARENT_ID, - domId: stateDomId(itemId, graphItemCount, PARENT), - type: "group", - padding: 0 - //getConfig().flowchart.padding + state2.records.head = newCommit; + log.info("main branch", config6.mainBranchName); + state2.records.commits.set(newCommit.id, newCommit); + state2.records.branches.set(state2.records.currBranch, newCommit.id); + log.debug("in pushCommit " + newCommit.id); + }, "commit"); + branch = /* @__PURE__ */ __name(function(branchDB) { + let name = branchDB.name; + const order2 = branchDB.order; + name = common_default.sanitizeText(name, getConfig3()); + if (state2.records.branches.has(name)) { + throw new Error( + `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${name}")` + ); + } + state2.records.branches.set(name, state2.records.head != null ? state2.records.head.id : null); + state2.records.branchConfig.set(name, { name, order: order2 }); + checkout(name); + log.debug("in createBranch"); + }, "branch"); + merge2 = /* @__PURE__ */ __name((mergeDB) => { + let otherBranch = mergeDB.branch; + let customId = mergeDB.id; + const overrideType = mergeDB.type; + const customTags = mergeDB.tags; + const config6 = getConfig3(); + otherBranch = common_default.sanitizeText(otherBranch, config6); + if (customId) { + customId = common_default.sanitizeText(customId, config6); + } + const currentBranchCheck = state2.records.branches.get(state2.records.currBranch); + const otherBranchCheck = state2.records.branches.get(otherBranch); + const currentCommit = currentBranchCheck ? state2.records.commits.get(currentBranchCheck) : void 0; + const otherCommit = otherBranchCheck ? state2.records.commits.get(otherBranchCheck) : void 0; + if (currentCommit && otherCommit && currentCommit.branch === otherBranch) { + throw new Error(`Cannot merge branch '${otherBranch}' into itself.`); + } + if (state2.records.currBranch === otherBranch) { + const error3 = new Error('Incorrect usage of "merge". Cannot merge a branch to itself'); + error3.hash = { + text: `merge ${otherBranch}`, + token: `merge ${otherBranch}`, + expected: ["branch abc"] + }; + throw error3; + } + if (currentCommit === void 0 || !currentCommit) { + const error3 = new Error( + `Incorrect usage of "merge". Current branch (${state2.records.currBranch})has no commits` + ); + error3.hash = { + text: `merge ${otherBranch}`, + token: `merge ${otherBranch}`, + expected: ["commit"] + }; + throw error3; + } + if (!state2.records.branches.has(otherBranch)) { + const error3 = new Error( + 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") does not exist" + ); + error3.hash = { + text: `merge ${otherBranch}`, + token: `merge ${otherBranch}`, + expected: [`branch ${otherBranch}`] + }; + throw error3; + } + if (otherCommit === void 0 || !otherCommit) { + const error3 = new Error( + 'Incorrect usage of "merge". Branch to be merged (' + otherBranch + ") has no commits" + ); + error3.hash = { + text: `merge ${otherBranch}`, + token: `merge ${otherBranch}`, + expected: ['"commit"'] + }; + throw error3; + } + if (currentCommit === otherCommit) { + const error3 = new Error('Incorrect usage of "merge". Both branches have same head'); + error3.hash = { + text: `merge ${otherBranch}`, + token: `merge ${otherBranch}`, + expected: ["branch abc"] + }; + throw error3; + } + if (customId && state2.records.commits.has(customId)) { + const error3 = new Error( + 'Incorrect usage of "merge". Commit with id:' + customId + " already exists, use different custom Id" + ); + error3.hash = { + text: `merge ${otherBranch} ${customId} ${overrideType} ${customTags?.join(" ")}`, + token: `merge ${otherBranch} ${customId} ${overrideType} ${customTags?.join(" ")}`, + expected: [ + `merge ${otherBranch} ${customId}_UNIQUE ${overrideType} ${customTags?.join(" ")}` + ] + }; + throw error3; + } + const verifiedBranch = otherBranchCheck ? otherBranchCheck : ""; + const commit2 = { + id: customId || `${state2.records.seq}-${getID()}`, + message: `merged branch ${otherBranch} into ${state2.records.currBranch}`, + seq: state2.records.seq++, + parents: state2.records.head == null ? [] : [state2.records.head.id, verifiedBranch], + branch: state2.records.currBranch, + type: commitType.MERGE, + customType: overrideType, + customId: customId ? true : false, + tags: customTags ?? [] }; - graphItemCount++; - const parentNodeId = itemId + PARENT_ID; - g.setNode(parentNodeId, groupData); - g.setNode(noteData.id, noteData); - g.setNode(itemId, nodeData); - g.setParent(itemId, parentNodeId); - g.setParent(noteData.id, parentNodeId); - let from2 = itemId; - let to = noteData.id; - if (parsedItem.note.position === "left of") { - from2 = noteData.id; - to = itemId; - } - g.setEdge(from2, to, { - arrowhead: "none", - arrowType: "", - style: G_EDGE_STYLE, - labelStyle: "", - classes: CSS_EDGE_NOTE_EDGE, - arrowheadStyle: G_EDGE_ARROWHEADSTYLE, - labelpos: G_EDGE_LABELPOS, - labelType: G_EDGE_LABELTYPE, - thickness: G_EDGE_THICKNESS - }); - } else { - g.setNode(itemId, nodeData); - } - } - if (parent && parent.id !== "root") { - log$1.trace("Setting node ", itemId, " to be child of its parent ", parent.id); - g.setParent(itemId, parent.id); - } - if (parsedItem.doc) { - log$1.trace("Adding nodes children "); - setupDoc(g, parsedItem, parsedItem.doc, diagramStates, diagramDb, !altFlag); - } - }; - const setupDoc = (g, parentParsedItem, doc, diagramStates, diagramDb, altFlag) => { - log$1.trace("items", doc); - doc.forEach((item) => { - switch (item.stmt) { - case STMT_STATE: - setupNode(g, parentParsedItem, item, diagramStates, diagramDb, altFlag); - break; - case DEFAULT_STATE_TYPE: - setupNode(g, parentParsedItem, item, diagramStates, diagramDb, altFlag); - break; - case STMT_RELATION: - { - setupNode(g, parentParsedItem, item.state1, diagramStates, diagramDb, altFlag); - setupNode(g, parentParsedItem, item.state2, diagramStates, diagramDb, altFlag); - const edgeData = { - id: "edge" + graphItemCount, - arrowhead: "normal", - arrowTypeEnd: "arrow_barb", - style: G_EDGE_STYLE, - labelStyle: "", - label: common$1.sanitizeText(item.description, getConfig$1()), - arrowheadStyle: G_EDGE_ARROWHEADSTYLE, - labelpos: G_EDGE_LABELPOS, - labelType: G_EDGE_LABELTYPE, - thickness: G_EDGE_THICKNESS, - classes: CSS_EDGE - }; - g.setEdge(item.state1.id, item.state2.id, edgeData, graphItemCount); - graphItemCount++; - } - break; - } - }); - }; - const getDir = (parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => { - let dir2 = defaultDir; - if (parsedItem.doc) { - for (let i2 = 0; i2 < parsedItem.doc.length; i2++) { - const parsedItemDoc = parsedItem.doc[i2]; - if (parsedItemDoc.stmt === "dir") { - dir2 = parsedItemDoc.value; + state2.records.head = commit2; + state2.records.commits.set(commit2.id, commit2); + state2.records.branches.set(state2.records.currBranch, commit2.id); + log.debug(state2.records.branches); + log.debug("in mergeBranch"); + }, "merge"); + cherryPick = /* @__PURE__ */ __name(function(cherryPickDB) { + let sourceId = cherryPickDB.id; + let targetId = cherryPickDB.targetId; + let tags2 = cherryPickDB.tags; + let parentCommitId = cherryPickDB.parent; + log.debug("Entering cherryPick:", sourceId, targetId, tags2); + const config6 = getConfig3(); + sourceId = common_default.sanitizeText(sourceId, config6); + targetId = common_default.sanitizeText(targetId, config6); + tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config6)); + parentCommitId = common_default.sanitizeText(parentCommitId, config6); + if (!sourceId || !state2.records.commits.has(sourceId)) { + const error3 = new Error( + 'Incorrect usage of "cherryPick". Source commit id should exist and provided' + ); + error3.hash = { + text: `cherryPick ${sourceId} ${targetId}`, + token: `cherryPick ${sourceId} ${targetId}`, + expected: ["cherry-pick abc"] + }; + throw error3; } - } - } - return dir2; - }; - const draw$6 = async function(text2, id2, _version, diag) { - log$1.info("Drawing state diagram (v2)", id2); - nodeDb$1 = {}; - diag.db.getDirection(); - const { securityLevel, state: conf2 } = getConfig$1(); - const nodeSpacing = conf2.nodeSpacing || 50; - const rankSpacing = conf2.rankSpacing || 50; - log$1.info(diag.db.getRootDocV2()); - diag.db.extract(diag.db.getRootDocV2()); - log$1.info(diag.db.getRootDocV2()); - const diagramStates = diag.db.getStates(); - const g = new Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: getDir(diag.db.getRootDocV2()), - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 8, - marginy: 8 - }).setDefaultEdgeLabel(function() { - return {}; - }); - setupNode(g, void 0, diag.db.getRootDocV2(), diagramStates, diag.db, true); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = root2.select(`[id="${id2}"]`); - const element2 = root2.select("#" + id2 + " g"); - await render(element2, g, ["barb"], CSS_DIAGRAM, id2); - const padding2 = 8; - utils$1.insertTitle(svg2, "statediagramTitleText", conf2.titleTopMargin, diag.db.getDiagramTitle()); - const bounds2 = svg2.node().getBBox(); - const width2 = bounds2.width + padding2 * 2; - const height = bounds2.height + padding2 * 2; - svg2.attr("class", CSS_DIAGRAM); - const svgBounds = svg2.node().getBBox(); - configureSvgSize(svg2, height, width2, conf2.useMaxWidth); - const vBox = `${svgBounds.x - padding2} ${svgBounds.y - padding2} ${width2} ${height}`; - log$1.debug(`viewBox ${vBox}`); - svg2.attr("viewBox", vBox); - const labels = document.querySelectorAll('[id="' + id2 + '"] .edgeLabel .label'); - for (const label of labels) { - const dim = label.getBBox(); - const rect2 = document.createElementNS("http://www.w3.org/2000/svg", SHAPE_STATE); - rect2.setAttribute("rx", 0); - rect2.setAttribute("ry", 0); - rect2.setAttribute("width", dim.width); - rect2.setAttribute("height", dim.height); - label.insertBefore(rect2, label.firstChild); - } - }; - const renderer$6 = { - setConf: setConf$1, - getClasses: getClasses$3, - draw: draw$6 - }; - const diagram$6 = { - parser: parser$b, - db: db$7, - renderer: renderer$6, - styles: styles$4, - init: (cnf) => { - if (!cnf.state) { - cnf.state = {}; - } - cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - db$7.clear(); - } - }; - const stateDiagramV2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$6 - }, Symbol.toStringTag, { value: "Module" })); - var parser$8 = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 18], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 14]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "journey": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "title": 11, "acc_title": 12, "acc_title_value": 13, "acc_descr": 14, "acc_descr_value": 15, "acc_descr_multiline_value": 16, "section": 17, "taskName": 18, "taskData": 19, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "journey", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 18: "taskName", 19: "taskData" }, - productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 1: - return $$[$0 - 1]; - case 2: - this.$ = []; - break; - case 3: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 4: - case 5: - this.$ = $$[$0]; - break; - case 6: - case 7: - this.$ = []; - break; - case 8: - yy.setDiagramTitle($$[$0].substr(6)); - this.$ = $$[$0].substr(6); - break; - case 9: - this.$ = $$[$0].trim(); - yy.setAccTitle(this.$); - break; - case 10: - case 11: - this.$ = $$[$0].trim(); - yy.setAccDescription(this.$); - break; - case 12: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 13: - yy.addTask($$[$0 - 1], $$[$0]); - this.$ = "task"; - break; + const sourceCommit = state2.records.commits.get(sourceId); + if (sourceCommit === void 0 || !sourceCommit) { + throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided'); } - }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: $V6 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 15, 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: $V6 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), { 13: [1, 16] }, { 15: [1, 17] }, o($V0, [2, 11]), o($V0, [2, 12]), { 19: [1, 18] }, o($V0, [2, 4]), o($V0, [2, 9]), o($V0, [2, 10]), o($V0, [2, 13])], - defaultActions: {}, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; + if (parentCommitId && !(Array.isArray(sourceCommit.parents) && sourceCommit.parents.includes(parentCommitId))) { + const error3 = new Error( + "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit." + ); + throw error3; } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; + const sourceCommitBranch = sourceCommit.branch; + if (sourceCommit.type === commitType.MERGE && !parentCommitId) { + const error3 = new Error( + "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified." + ); + throw error3; } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; + if (!targetId || !state2.records.commits.has(targetId)) { + if (sourceCommitBranch === state2.records.currBranch) { + const error3 = new Error( + 'Incorrect usage of "cherryPick". Source commit is already on current branch' + ); + error3.hash = { + text: `cherryPick ${sourceId} ${targetId}`, + token: `cherryPick ${sourceId} ${targetId}`, + expected: ["cherry-pick abc"] + }; + throw error3; } - return token2; - } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; + const currentCommitId = state2.records.branches.get(state2.records.currBranch); + if (currentCommitId === void 0 || !currentCommitId) { + const error3 = new Error( + `Incorrect usage of "cherry-pick". Current branch (${state2.records.currBranch})has no commits` + ); + error3.hash = { + text: `cherryPick ${sourceId} ${targetId}`, + token: `cherryPick ${sourceId} ${targetId}`, + expected: ["cherry-pick abc"] + }; + throw error3; + } + const currentCommit = state2.records.commits.get(currentCommitId); + if (currentCommit === void 0 || !currentCommit) { + const error3 = new Error( + `Incorrect usage of "cherry-pick". Current branch (${state2.records.currBranch})has no commits` + ); + error3.hash = { + text: `cherryPick ${sourceId} ${targetId}`, + token: `cherryPick ${sourceId} ${targetId}`, + expected: ["cherry-pick abc"] + }; + throw error3; + } + const commit2 = { + id: state2.records.seq + "-" + getID(), + message: `cherry-picked ${sourceCommit?.message} into ${state2.records.currBranch}`, + seq: state2.records.seq++, + parents: state2.records.head == null ? [] : [state2.records.head.id, sourceCommit.id], + branch: state2.records.currBranch, + type: commitType.CHERRY_PICK, + tags: tags2 ? tags2.filter(Boolean) : [ + `cherry-pick:${sourceCommit.id}${sourceCommit.type === commitType.MERGE ? `|parent:${parentCommitId}` : ""}` + ] + }; + state2.records.head = commit2; + state2.records.commits.set(commit2.id, commit2); + state2.records.branches.set(state2.records.currBranch, commit2.id); + log.debug(state2.records.branches); + log.debug("in cherryPick"); + } + }, "cherryPick"); + checkout = /* @__PURE__ */ __name(function(branch2) { + branch2 = common_default.sanitizeText(branch2, getConfig3()); + if (!state2.records.branches.has(branch2)) { + const error3 = new Error( + `Trying to checkout branch which is not yet created. (Help try using "branch ${branch2}")` + ); + error3.hash = { + text: `checkout ${branch2}`, + token: `checkout ${branch2}`, + expected: [`branch ${branch2}`] + }; + throw error3; + } else { + state2.records.currBranch = branch2; + const id26 = state2.records.branches.get(state2.records.currBranch); + if (id26 === void 0 || !id26) { + state2.records.head = null; } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; + state2.records.head = state2.records.commits.get(id26) ?? null; + } + } + }, "checkout"); + __name(upsert, "upsert"); + __name(prettyPrintCommitHistory, "prettyPrintCommitHistory"); + prettyPrint = /* @__PURE__ */ __name(function() { + log.debug(state2.records.commits); + const node2 = getCommitsArray()[0]; + prettyPrintCommitHistory([node2]); + }, "prettyPrint"); + clear10 = /* @__PURE__ */ __name(function() { + state2.reset(); + clear(); + }, "clear"); + getBranchesAsObjArray = /* @__PURE__ */ __name(function() { + const branchesArray = [...state2.records.branchConfig.values()].map((branchConfig, i2) => { + if (branchConfig.order !== null && branchConfig.order !== void 0) { + return branchConfig; } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected + return { + ...branchConfig, + order: parseFloat(`0.${i2}`) + }; + }).sort((a2, b2) => (a2.order ?? 0) - (b2.order ?? 0)).map(({ name }) => ({ name })); + return branchesArray; + }, "getBranchesAsObjArray"); + getBranches = /* @__PURE__ */ __name(function() { + return state2.records.branches; + }, "getBranches"); + getCommits = /* @__PURE__ */ __name(function() { + return state2.records.commits; + }, "getCommits"); + getCommitsArray = /* @__PURE__ */ __name(function() { + const commitArr = [...state2.records.commits.values()]; + commitArr.forEach(function(o2) { + log.debug(o2.id); + }); + commitArr.sort((a2, b2) => a2.seq - b2.seq); + return commitArr; + }, "getCommitsArray"); + getCurrentBranch = /* @__PURE__ */ __name(function() { + return state2.records.currBranch; + }, "getCurrentBranch"); + getDirection2 = /* @__PURE__ */ __name(function() { + return state2.records.direction; + }, "getDirection"); + getHead = /* @__PURE__ */ __name(function() { + return state2.records.head; + }, "getHead"); + db = { + commitType, + getConfig: getConfig3, + setDirection: setDirection2, + setOptions: setOptions2, + getOptions, + commit, + branch, + merge: merge2, + cherryPick, + checkout, + //reset, + prettyPrint, + clear: clear10, + getBranchesAsObjArray, + getBranches, + getCommits, + getCommitsArray, + getCurrentBranch, + getDirection: getDirection2, + getHead, + setAccTitle, + getAccTitle, + getAccDescription, + setAccDescription, + setDiagramTitle, + getDiagramTitle + }; + } + }); + + // src/diagrams/git/gitGraphParser.ts + var populate, parseStatement, parseCommit, parseBranch, parseMerge, parseCheckout, parseCherryPicking, parser5; + var init_gitGraphParser = __esm({ + "src/diagrams/git/gitGraphParser.ts"() { + "use strict"; + init_mermaid_parser_core(); + init_logger(); + init_populateCommonDb(); + init_gitGraphAst(); + init_gitGraphTypes(); + populate = /* @__PURE__ */ __name((ast, db7) => { + populateCommonDb(ast, db7); + if (ast.dir) { + db7.setDirection(ast.dir); + } + for (const statement of ast.statements) { + parseStatement(statement, db7); + } + }, "populate"); + parseStatement = /* @__PURE__ */ __name((statement, db7) => { + const parsers2 = { + Commit: /* @__PURE__ */ __name((stmt) => db7.commit(parseCommit(stmt)), "Commit"), + Branch: /* @__PURE__ */ __name((stmt) => db7.branch(parseBranch(stmt)), "Branch"), + Merge: /* @__PURE__ */ __name((stmt) => db7.merge(parseMerge(stmt)), "Merge"), + Checkout: /* @__PURE__ */ __name((stmt) => db7.checkout(parseCheckout(stmt)), "Checkout"), + CherryPicking: /* @__PURE__ */ __name((stmt) => db7.cherryPick(parseCherryPicking(stmt)), "CherryPicking") + }; + const parser21 = parsers2[statement.$type]; + if (parser21) { + parser21(statement); + } else { + log.error(`Unknown statement type: ${statement.$type}`); + } + }, "parseStatement"); + parseCommit = /* @__PURE__ */ __name((commit2) => { + const commitDB = { + id: commit2.id, + msg: commit2.message ?? "", + type: commit2.type !== void 0 ? commitType[commit2.type] : commitType.NORMAL, + tags: commit2.tags ?? void 0 + }; + return commitDB; + }, "parseCommit"); + parseBranch = /* @__PURE__ */ __name((branch2) => { + const branchDB = { + name: branch2.name, + order: branch2.order ?? 0 + }; + return branchDB; + }, "parseBranch"); + parseMerge = /* @__PURE__ */ __name((merge5) => { + const mergeDB = { + branch: merge5.branch, + id: merge5.id ?? "", + type: merge5.type !== void 0 ? commitType[merge5.type] : void 0, + tags: merge5.tags ?? void 0 + }; + return mergeDB; + }, "parseMerge"); + parseCheckout = /* @__PURE__ */ __name((checkout2) => { + const branch2 = checkout2.branch; + return branch2; + }, "parseCheckout"); + parseCherryPicking = /* @__PURE__ */ __name((cherryPicking) => { + const cherryPickDB = { + id: cherryPicking.id, + targetId: "", + tags: cherryPicking.tags?.length === 0 ? void 0 : cherryPicking.tags, + parent: cherryPicking.parent + }; + return cherryPickDB; + }, "parseCherryPicking"); + parser5 = { + parse: /* @__PURE__ */ __name(async (input) => { + const ast = await parse2("gitGraph", input); + log.debug(ast); + populate(ast, db); + }, "parse") + }; + if (void 0) { + const { it, expect, describe } = void 0; + const mockDB = { + commitType, + setDirection: vi.fn(), + commit: vi.fn(), + branch: vi.fn(), + merge: vi.fn(), + cherryPick: vi.fn(), + checkout: vi.fn() + }; + describe("GitGraph Parser", () => { + it("should parse a commit statement", () => { + const commit2 = { + $type: "Commit", + id: "1", + message: "test", + tags: ["tag1", "tag2"], + type: "NORMAL" + }; + parseStatement(commit2, mockDB); + expect(mockDB.commit).toHaveBeenCalledWith({ + id: "1", + msg: "test", + tags: ["tag1", "tag2"], + type: 0 }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; + }); + it("should parse a branch statement", () => { + const branch2 = { + $type: "Branch", + name: "newBranch", + order: 1 + }; + parseStatement(branch2, mockDB); + expect(mockDB.branch).toHaveBeenCalledWith({ name: "newBranch", order: 1 }); + }); + it("should parse a checkout statement", () => { + const checkout2 = { + $type: "Checkout", + branch: "newBranch" + }; + parseStatement(checkout2, mockDB); + expect(mockDB.checkout).toHaveBeenCalledWith("newBranch"); + }); + it("should parse a merge statement", () => { + const merge5 = { + $type: "Merge", + branch: "newBranch", + id: "1", + tags: ["tag1", "tag2"], + type: "NORMAL" + }; + parseStatement(merge5, mockDB); + expect(mockDB.merge).toHaveBeenCalledWith({ + branch: "newBranch", + id: "1", + tags: ["tag1", "tag2"], + type: 0 + }); + }); + it("should parse a cherry picking statement", () => { + const cherryPick2 = { + $type: "CherryPicking", + id: "1", + tags: ["tag1", "tag2"], + parent: "2" + }; + parseStatement(cherryPick2, mockDB); + expect(mockDB.cherryPick).toHaveBeenCalledWith({ + id: "1", + targetId: "", + parent: "2", + tags: ["tag1", "tag2"] + }); + }); + it("should parse a langium generated gitGraph ast", () => { + const dummy = { + $type: "GitGraph", + statements: [] + }; + const gitGraphAst = { + $type: "GitGraph", + statements: [ + { + $container: dummy, + $type: "Commit", + id: "1", + message: "test", + tags: ["tag1", "tag2"], + type: "NORMAL" + }, + { + $container: dummy, + $type: "Branch", + name: "newBranch", + order: 1 + }, + { + $container: dummy, + $type: "Merge", + branch: "newBranch", + id: "1", + tags: ["tag1", "tag2"], + type: "NORMAL" + }, + { + $container: dummy, + $type: "Checkout", + branch: "newBranch" + }, + { + $container: dummy, + $type: "CherryPicking", + id: "1", + tags: ["tag1", "tag2"], + parent: "2" + } + ] + }; + populate(gitGraphAst, mockDB); + expect(mockDB.commit).toHaveBeenCalledWith({ + id: "1", + msg: "test", + tags: ["tag1", "tag2"], + type: 0 + }); + expect(mockDB.branch).toHaveBeenCalledWith({ name: "newBranch", order: 1 }); + expect(mockDB.merge).toHaveBeenCalledWith({ + branch: "newBranch", + id: "1", + tags: ["tag1", "tag2"], + type: 0 + }); + expect(mockDB.checkout).toHaveBeenCalledWith("newBranch"); + }); + }); } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); + } + }); + + // src/diagrams/git/gitGraphRenderer.ts + var DEFAULT_CONFIG, DEFAULT_GITGRAPH_CONFIG2, LAYOUT_OFFSET, COMMIT_STEP, PX, PY, THEME_COLOR_LIMIT, branchPos, commitPos, defaultPos, allCommitsDict, lanes, maxPos, dir, clear11, drawText2, findClosestParent, findClosestParentBT, setParallelBTPos, findClosestParentPos, calculateCommitPosition, setCommitPosition, setRootPosition, drawCommitBullet, drawCommitLabel, drawCommitTags, getCommitClassType, calculatePosition, getCommitPosition, drawCommits, shouldRerouteArrow, findLane, drawArrow, drawArrows, drawBranches, setBranchPosition, draw4, gitGraphRenderer_default; + var init_gitGraphRenderer = __esm({ + "src/diagrams/git/gitGraphRenderer.ts"() { + "use strict"; + init_src32(); + init_diagramAPI(); + init_logger(); + init_utils2(); + init_gitGraphTypes(); + DEFAULT_CONFIG = getConfig2(); + DEFAULT_GITGRAPH_CONFIG2 = DEFAULT_CONFIG?.gitGraph; + LAYOUT_OFFSET = 10; + COMMIT_STEP = 40; + PX = 4; + PY = 2; + THEME_COLOR_LIMIT = 8; + branchPos = /* @__PURE__ */ new Map(); + commitPos = /* @__PURE__ */ new Map(); + defaultPos = 30; + allCommitsDict = /* @__PURE__ */ new Map(); + lanes = []; + maxPos = 0; + dir = "LR"; + clear11 = /* @__PURE__ */ __name(() => { + branchPos.clear(); + commitPos.clear(); + allCommitsDict.clear(); + maxPos = 0; + lanes = []; + dir = "LR"; + }, "clear"); + drawText2 = /* @__PURE__ */ __name((txt) => { + const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text"); + const rows = typeof txt === "string" ? txt.split(/\\n|\n|/gi) : txt; + rows.forEach((row) => { + const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"); + tspan.setAttribute("dy", "1em"); + tspan.setAttribute("x", "0"); + tspan.setAttribute("class", "row"); + tspan.textContent = row.trim(); + svgLabel.appendChild(tspan); + }); + return svgLabel; + }, "drawText"); + findClosestParent = /* @__PURE__ */ __name((parents4) => { + let closestParent; + let comparisonFunc; + let targetPosition; + if (dir === "BT") { + comparisonFunc = /* @__PURE__ */ __name((a2, b2) => a2 <= b2, "comparisonFunc"); + targetPosition = Infinity; + } else { + comparisonFunc = /* @__PURE__ */ __name((a2, b2) => a2 >= b2, "comparisonFunc"); + targetPosition = 0; + } + parents4.forEach((parent4) => { + const parentPosition = dir === "TB" || dir == "BT" ? commitPos.get(parent4)?.y : commitPos.get(parent4)?.x; + if (parentPosition !== void 0 && comparisonFunc(parentPosition, targetPosition)) { + closestParent = parent4; + targetPosition = parentPosition; } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; + }); + return closestParent; + }, "findClosestParent"); + findClosestParentBT = /* @__PURE__ */ __name((parents4) => { + let closestParent = ""; + let maxPosition = Infinity; + parents4.forEach((parent4) => { + const parentPosition = commitPos.get(parent4).y; + if (parentPosition <= maxPosition) { + closestParent = parent4; + maxPosition = parentPosition; } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; + }); + return closestParent || void 0; + }, "findClosestParentBT"); + setParallelBTPos = /* @__PURE__ */ __name((sortedKeys, commits, defaultPos2) => { + let curPos = defaultPos2; + let maxPosition = defaultPos2; + const roots = []; + sortedKeys.forEach((key) => { + const commit2 = commits.get(key); + if (!commit2) { + throw new Error(`Commit not found for key ${key}`); + } + if (commit2.parents.length) { + curPos = calculateCommitPosition(commit2); + maxPosition = Math.max(curPos, maxPosition); } else { - this.yylloc.last_column++; + roots.push(commit2); } - if (this.options.ranges) { - this.yylloc.range[1]++; + setCommitPosition(commit2, curPos); + }); + curPos = maxPosition; + roots.forEach((commit2) => { + setRootPosition(commit2, curPos, defaultPos2); + }); + sortedKeys.forEach((key) => { + const commit2 = commits.get(key); + if (commit2?.parents.length) { + const closestParent = findClosestParentBT(commit2.parents); + curPos = commitPos.get(closestParent).y - COMMIT_STEP; + if (curPos <= maxPosition) { + maxPosition = curPos; + } + const x5 = branchPos.get(commit2.branch).pos; + const y5 = curPos - LAYOUT_OFFSET; + commitPos.set(commit2.id, { x: x5, y: y5 }); } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + }); + }, "setParallelBTPos"); + findClosestParentPos = /* @__PURE__ */ __name((commit2) => { + const closestParent = findClosestParent(commit2.parents.filter((p3) => p3 !== null)); + if (!closestParent) { + throw new Error(`Closest parent not found for commit ${commit2.id}`); + } + const closestParentPos = commitPos.get(closestParent)?.y; + if (closestParentPos === void 0) { + throw new Error(`Closest parent position not found for commit ${commit2.id}`); + } + return closestParentPos; + }, "findClosestParentPos"); + calculateCommitPosition = /* @__PURE__ */ __name((commit2) => { + const closestParentPos = findClosestParentPos(commit2); + return closestParentPos + COMMIT_STEP; + }, "calculateCommitPosition"); + setCommitPosition = /* @__PURE__ */ __name((commit2, curPos) => { + const branch2 = branchPos.get(commit2.branch); + if (!branch2) { + throw new Error(`Branch not found for commit ${commit2.id}`); + } + const x5 = branch2.pos; + const y5 = curPos + LAYOUT_OFFSET; + commitPos.set(commit2.id, { x: x5, y: y5 }); + return { x: x5, y: y5 }; + }, "setCommitPosition"); + setRootPosition = /* @__PURE__ */ __name((commit2, curPos, defaultPos2) => { + const branch2 = branchPos.get(commit2.branch); + if (!branch2) { + throw new Error(`Branch not found for commit ${commit2.id}`); + } + const y5 = curPos + defaultPos2; + const x5 = branch2.pos; + commitPos.set(commit2.id, { x: x5, y: y5 }); + }, "setRootPosition"); + drawCommitBullet = /* @__PURE__ */ __name((gBullets, commit2, commitPosition, typeClass, branchIndex, commitSymbolType) => { + if (commitSymbolType === commitType.HIGHLIGHT) { + gBullets.append("rect").attr("x", commitPosition.x - 10).attr("y", commitPosition.y - 10).attr("width", 20).attr("height", 20).attr( + "class", + `commit ${commit2.id} commit-highlight${branchIndex % THEME_COLOR_LIMIT} ${typeClass}-outer` + ); + gBullets.append("rect").attr("x", commitPosition.x - 6).attr("y", commitPosition.y - 6).attr("width", 12).attr("height", 12).attr( + "class", + `commit ${commit2.id} commit${branchIndex % THEME_COLOR_LIMIT} ${typeClass}-inner` + ); + } else if (commitSymbolType === commitType.CHERRY_PICK) { + gBullets.append("circle").attr("cx", commitPosition.x).attr("cy", commitPosition.y).attr("r", 10).attr("class", `commit ${commit2.id} ${typeClass}`); + gBullets.append("circle").attr("cx", commitPosition.x - 3).attr("cy", commitPosition.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); + gBullets.append("circle").attr("cx", commitPosition.x + 3).attr("cy", commitPosition.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); + gBullets.append("line").attr("x1", commitPosition.x + 3).attr("y1", commitPosition.y + 1).attr("x2", commitPosition.x).attr("y2", commitPosition.y - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); + gBullets.append("line").attr("x1", commitPosition.x - 3).attr("y1", commitPosition.y + 1).attr("x2", commitPosition.x).attr("y2", commitPosition.y - 5).attr("stroke", "#fff").attr("class", `commit ${commit2.id} ${typeClass}`); + } else { + const circle6 = gBullets.append("circle"); + circle6.attr("cx", commitPosition.x); + circle6.attr("cy", commitPosition.y); + circle6.attr("r", commit2.type === commitType.MERGE ? 9 : 10); + circle6.attr("class", `commit ${commit2.id} commit${branchIndex % THEME_COLOR_LIMIT}`); + if (commitSymbolType === commitType.MERGE) { + const circle22 = gBullets.append("circle"); + circle22.attr("cx", commitPosition.x); + circle22.attr("cy", commitPosition.y); + circle22.attr("r", 6); + circle22.attr( + "class", + `commit ${typeClass} ${commit2.id} commit${branchIndex % THEME_COLOR_LIMIT}` + ); } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); + if (commitSymbolType === commitType.REVERSE) { + const cross3 = gBullets.append("path"); + cross3.attr( + "d", + `M ${commitPosition.x - 5},${commitPosition.y - 5}L${commitPosition.x + 5},${commitPosition.y + 5}M${commitPosition.x - 5},${commitPosition.y + 5}L${commitPosition.x + 5},${commitPosition.y - 5}` + ).attr("class", `commit ${typeClass} ${commit2.id} commit${branchIndex % THEME_COLOR_LIMIT}`); } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); + } + }, "drawCommitBullet"); + drawCommitLabel = /* @__PURE__ */ __name((gLabels, commit2, commitPosition, pos) => { + if (commit2.type !== commitType.CHERRY_PICK && (commit2.customId && commit2.type === commitType.MERGE || commit2.type !== commitType.MERGE) && DEFAULT_GITGRAPH_CONFIG2?.showCommitLabel) { + const wrapper = gLabels.append("g"); + const labelBkg = wrapper.insert("rect").attr("class", "commit-label-bkg"); + const text2 = wrapper.append("text").attr("x", pos).attr("y", commitPosition.y + 25).attr("class", "commit-label").text(commit2.id); + const bbox = text2.node()?.getBBox(); + if (bbox) { + labelBkg.attr("x", commitPosition.posWithOffset - bbox.width / 2 - PY).attr("y", commitPosition.y + 13.5).attr("width", bbox.width + 2 * PY).attr("height", bbox.height + 2 * PY); + if (dir === "TB" || dir === "BT") { + labelBkg.attr("x", commitPosition.x - (bbox.width + 4 * PX + 5)).attr("y", commitPosition.y - 12); + text2.attr("x", commitPosition.x - (bbox.width + 4 * PX)).attr("y", commitPosition.y + bbox.height - 12); + } else { + text2.attr("x", commitPosition.posWithOffset - bbox.width / 2); + } + if (DEFAULT_GITGRAPH_CONFIG2.rotateCommitLabel) { + if (dir === "TB" || dir === "BT") { + text2.attr( + "transform", + "rotate(-45, " + commitPosition.x + ", " + commitPosition.y + ")" + ); + labelBkg.attr( + "transform", + "rotate(-45, " + commitPosition.x + ", " + commitPosition.y + ")" + ); + } else { + const r_x = -7.5 - (bbox.width + 10) / 25 * 9.5; + const r_y = 10 + bbox.width / 25 * 8.5; + wrapper.attr( + "transform", + "translate(" + r_x + ", " + r_y + ") rotate(-45, " + pos + ", " + commitPosition.y + ")" + ); + } + } + } + } + }, "drawCommitLabel"); + drawCommitTags = /* @__PURE__ */ __name((gLabels, commit2, commitPosition, pos) => { + if (commit2.tags.length > 0) { + let yOffset = 0; + let maxTagBboxWidth = 0; + let maxTagBboxHeight = 0; + const tagElements = []; + for (const tagValue of commit2.tags.reverse()) { + const rect4 = gLabels.insert("polygon"); + const hole = gLabels.append("circle"); + const tag2 = gLabels.append("text").attr("y", commitPosition.y - 16 - yOffset).attr("class", "tag-label").text(tagValue); + const tagBbox = tag2.node()?.getBBox(); + if (!tagBbox) { + throw new Error("Tag bbox not found"); + } + maxTagBboxWidth = Math.max(maxTagBboxWidth, tagBbox.width); + maxTagBboxHeight = Math.max(maxTagBboxHeight, tagBbox.height); + tag2.attr("x", commitPosition.posWithOffset - tagBbox.width / 2); + tagElements.push({ + tag: tag2, + hole, + rect: rect4, + yOffset + }); + yOffset += 20; } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); + for (const { tag: tag2, hole, rect: rect4, yOffset: yOffset2 } of tagElements) { + const h2 = maxTagBboxHeight / 2; + const ly = commitPosition.y - 19.2 - yOffset2; + rect4.attr("class", "tag-label-bkg").attr( + "points", + ` + ${pos - maxTagBboxWidth / 2 - PX / 2},${ly + PY} + ${pos - maxTagBboxWidth / 2 - PX / 2},${ly - PY} + ${commitPosition.posWithOffset - maxTagBboxWidth / 2 - PX},${ly - h2 - PY} + ${commitPosition.posWithOffset + maxTagBboxWidth / 2 + PX},${ly - h2 - PY} + ${commitPosition.posWithOffset + maxTagBboxWidth / 2 + PX},${ly + h2 + PY} + ${commitPosition.posWithOffset - maxTagBboxWidth / 2 - PX},${ly + h2 + PY}` + ); + hole.attr("cy", ly).attr("cx", pos - maxTagBboxWidth / 2 + PX / 2).attr("r", 1.5).attr("class", "tag-hole"); + if (dir === "TB" || dir === "BT") { + const yOrigin = pos + yOffset2; + rect4.attr("class", "tag-label-bkg").attr( + "points", + ` + ${commitPosition.x},${yOrigin + 2} + ${commitPosition.x},${yOrigin - 2} + ${commitPosition.x + LAYOUT_OFFSET},${yOrigin - h2 - 2} + ${commitPosition.x + LAYOUT_OFFSET + maxTagBboxWidth + 4},${yOrigin - h2 - 2} + ${commitPosition.x + LAYOUT_OFFSET + maxTagBboxWidth + 4},${yOrigin + h2 + 2} + ${commitPosition.x + LAYOUT_OFFSET},${yOrigin + h2 + 2}` + ).attr("transform", "translate(12,12) rotate(45, " + commitPosition.x + "," + pos + ")"); + hole.attr("cx", commitPosition.x + PX / 2).attr("cy", yOrigin).attr("transform", "translate(12,12) rotate(45, " + commitPosition.x + "," + pos + ")"); + tag2.attr("x", commitPosition.x + 5).attr("y", yOrigin + 3).attr("transform", "translate(14,14) rotate(45, " + commitPosition.x + "," + pos + ")"); + } + } + } + }, "drawCommitTags"); + getCommitClassType = /* @__PURE__ */ __name((commit2) => { + const commitSymbolType = commit2.customType ?? commit2.type; + switch (commitSymbolType) { + case commitType.NORMAL: + return "commit-normal"; + case commitType.REVERSE: + return "commit-reverse"; + case commitType.HIGHLIGHT: + return "commit-highlight"; + case commitType.MERGE: + return "commit-merge"; + case commitType.CHERRY_PICK: + return "commit-cherry-pick"; + default: + return "commit-normal"; + } + }, "getCommitClassType"); + calculatePosition = /* @__PURE__ */ __name((commit2, dir2, pos, commitPos2) => { + const defaultCommitPosition = { x: 0, y: 0 }; + if (commit2.parents.length > 0) { + const closestParent = findClosestParent(commit2.parents); + if (closestParent) { + const parentPosition = commitPos2.get(closestParent) ?? defaultCommitPosition; + if (dir2 === "TB") { + return parentPosition.y + COMMIT_STEP; + } else if (dir2 === "BT") { + const currentPosition = commitPos2.get(commit2.id) ?? defaultCommitPosition; + return currentPosition.y - COMMIT_STEP; + } else { + return parentPosition.x + COMMIT_STEP; } } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; + } else { + if (dir2 === "TB") { + return defaultPos; + } else if (dir2 === "BT") { + const currentPosition = commitPos2.get(commit2.id) ?? defaultCommitPosition; + return currentPosition.y - COMMIT_STEP; + } else { + return 0; } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; + } + return 0; + }, "calculatePosition"); + getCommitPosition = /* @__PURE__ */ __name((commit2, pos, isParallelCommits) => { + const posWithOffset = dir === "BT" && isParallelCommits ? pos : pos + LAYOUT_OFFSET; + const y5 = dir === "TB" || dir === "BT" ? posWithOffset : branchPos.get(commit2.branch)?.pos; + const x5 = dir === "TB" || dir === "BT" ? branchPos.get(commit2.branch)?.pos : posWithOffset; + if (x5 === void 0 || y5 === void 0) { + throw new Error(`Position were undefined for commit ${commit2.id}`); + } + return { x: x5, y: y5, posWithOffset }; + }, "getCommitPosition"); + drawCommits = /* @__PURE__ */ __name((svg, commits, modifyGraph) => { + if (!DEFAULT_GITGRAPH_CONFIG2) { + throw new Error("GitGraph config not found"); + } + const gBullets = svg.append("g").attr("class", "commit-bullets"); + const gLabels = svg.append("g").attr("class", "commit-labels"); + let pos = dir === "TB" || dir === "BT" ? defaultPos : 0; + const keys3 = [...commits.keys()]; + const isParallelCommits = DEFAULT_GITGRAPH_CONFIG2?.parallelCommits ?? false; + const sortKeys = /* @__PURE__ */ __name((a2, b2) => { + const seqA = commits.get(a2)?.seq; + const seqB = commits.get(b2)?.seq; + return seqA !== void 0 && seqB !== void 0 ? seqA - seqB : 0; + }, "sortKeys"); + let sortedKeys = keys3.sort(sortKeys); + if (dir === "BT") { + if (isParallelCommits) { + setParallelBTPos(sortedKeys, commits, pos); + } + sortedKeys = sortedKeys.reverse(); + } + sortedKeys.forEach((key) => { + const commit2 = commits.get(key); + if (!commit2) { + throw new Error(`Commit not found for key ${key}`); + } + if (isParallelCommits) { + pos = calculatePosition(commit2, dir, pos, commitPos); + } + const commitPosition = getCommitPosition(commit2, pos, isParallelCommits); + if (modifyGraph) { + const typeClass = getCommitClassType(commit2); + const commitSymbolType = commit2.customType ?? commit2.type; + const branchIndex = branchPos.get(commit2.branch)?.index ?? 0; + drawCommitBullet(gBullets, commit2, commitPosition, typeClass, branchIndex, commitSymbolType); + drawCommitLabel(gLabels, commit2, commitPosition, pos); + drawCommitTags(gLabels, commit2, commitPosition, pos); + } + if (dir === "TB" || dir === "BT") { + commitPos.set(commit2.id, { x: commitPosition.x, y: commitPosition.posWithOffset }); + } else { + commitPos.set(commit2.id, { x: commitPosition.posWithOffset, y: commitPosition.y }); } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } + pos = dir === "BT" && isParallelCommits ? pos + COMMIT_STEP : pos + COMMIT_STEP + LAYOUT_OFFSET; + if (pos > maxPos) { + maxPos = pos; } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; + }); + }, "drawCommits"); + shouldRerouteArrow = /* @__PURE__ */ __name((commitA, commitB, p1, p22, allCommits) => { + const commitBIsFurthest = dir === "TB" || dir === "BT" ? p1.x < p22.x : p1.y < p22.y; + const branchToGetCurve = commitBIsFurthest ? commitB.branch : commitA.branch; + const isOnBranchToGetCurve = /* @__PURE__ */ __name((x5) => x5.branch === branchToGetCurve, "isOnBranchToGetCurve"); + const isBetweenCommits = /* @__PURE__ */ __name((x5) => x5.seq > commitA.seq && x5.seq < commitB.seq, "isBetweenCommits"); + return [...allCommits.values()].some((commitX) => { + return isBetweenCommits(commitX) && isOnBranchToGetCurve(commitX); + }); + }, "shouldRerouteArrow"); + findLane = /* @__PURE__ */ __name((y1, y22, depth = 0) => { + const candidate = y1 + Math.abs(y1 - y22) / 2; + if (depth > 5) { + return candidate; + } + const ok = lanes.every((lane) => Math.abs(lane - candidate) >= 10); + if (ok) { + lanes.push(candidate); + return candidate; + } + const diff2 = Math.abs(y1 - y22); + return findLane(y1, y22 - diff2 / 5, depth + 1); + }, "findLane"); + drawArrow = /* @__PURE__ */ __name((svg, commitA, commitB, allCommits) => { + const p1 = commitPos.get(commitA.id); + const p22 = commitPos.get(commitB.id); + if (p1 === void 0 || p22 === void 0) { + throw new Error(`Commit positions not found for commits ${commitA.id} and ${commitB.id}`); + } + const arrowNeedsRerouting = shouldRerouteArrow(commitA, commitB, p1, p22, allCommits); + let arc = ""; + let arc2 = ""; + let radius2 = 0; + let offset = 0; + let colorClassNum = branchPos.get(commitB.branch)?.index; + if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { + colorClassNum = branchPos.get(commitA.branch)?.index; + } + let lineDef; + if (arrowNeedsRerouting) { + arc = "A 10 10, 0, 0, 0,"; + arc2 = "A 10 10, 0, 0, 1,"; + radius2 = 10; + offset = 10; + const lineY = p1.y < p22.y ? findLane(p1.y, p22.y) : findLane(p22.y, p1.y); + const lineX = p1.x < p22.x ? findLane(p1.x, p22.x) : findLane(p22.x, p1.x); + if (dir === "TB") { + if (p1.x < p22.x) { + lineDef = `M ${p1.x} ${p1.y} L ${lineX - radius2} ${p1.y} ${arc2} ${lineX} ${p1.y + offset} L ${lineX} ${p22.y - radius2} ${arc} ${lineX + offset} ${p22.y} L ${p22.x} ${p22.y}`; + } else { + colorClassNum = branchPos.get(commitA.branch)?.index; + lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius2} ${p1.y} ${arc} ${lineX} ${p1.y + offset} L ${lineX} ${p22.y - radius2} ${arc2} ${lineX - offset} ${p22.y} L ${p22.x} ${p22.y}`; + } + } else if (dir === "BT") { + if (p1.x < p22.x) { + lineDef = `M ${p1.x} ${p1.y} L ${lineX - radius2} ${p1.y} ${arc} ${lineX} ${p1.y - offset} L ${lineX} ${p22.y + radius2} ${arc2} ${lineX + offset} ${p22.y} L ${p22.x} ${p22.y}`; + } else { + colorClassNum = branchPos.get(commitA.branch)?.index; + lineDef = `M ${p1.x} ${p1.y} L ${lineX + radius2} ${p1.y} ${arc2} ${lineX} ${p1.y - offset} L ${lineX} ${p22.y + radius2} ${arc} ${lineX - offset} ${p22.y} L ${p22.x} ${p22.y}`; } - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; } else { - return this.lex(); + if (p1.y < p22.y) { + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY - radius2} ${arc} ${p1.x + offset} ${lineY} L ${p22.x - radius2} ${lineY} ${arc2} ${p22.x} ${lineY + offset} L ${p22.x} ${p22.y}`; + } else { + colorClassNum = branchPos.get(commitA.branch)?.index; + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${lineY + radius2} ${arc2} ${p1.x + offset} ${lineY} L ${p22.x - radius2} ${lineY} ${arc} ${p22.x} ${lineY - offset} L ${p22.x} ${p22.y}`; + } } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); + } else { + arc = "A 20 20, 0, 0, 0,"; + arc2 = "A 20 20, 0, 0, 1,"; + radius2 = 20; + offset = 20; + if (dir === "TB") { + if (p1.x < p22.x) { + if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p22.y - radius2} ${arc} ${p1.x + offset} ${p22.y} L ${p22.x} ${p22.y}`; + } else { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x - radius2} ${p1.y} ${arc2} ${p22.x} ${p1.y + offset} L ${p22.x} ${p22.y}`; + } + } + if (p1.x > p22.x) { + arc = "A 20 20, 0, 0, 0,"; + arc2 = "A 20 20, 0, 0, 1,"; + radius2 = 20; + offset = 20; + if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p22.y - radius2} ${arc2} ${p1.x - offset} ${p22.y} L ${p22.x} ${p22.y}`; + } else { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x + radius2} ${p1.y} ${arc} ${p22.x} ${p1.y + offset} L ${p22.x} ${p22.y}`; + } + } + if (p1.x === p22.x) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x} ${p22.y}`; + } + } else if (dir === "BT") { + if (p1.x < p22.x) { + if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p22.y + radius2} ${arc2} ${p1.x + offset} ${p22.y} L ${p22.x} ${p22.y}`; + } else { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x - radius2} ${p1.y} ${arc} ${p22.x} ${p1.y - offset} L ${p22.x} ${p22.y}`; + } + } + if (p1.x > p22.x) { + arc = "A 20 20, 0, 0, 0,"; + arc2 = "A 20 20, 0, 0, 1,"; + radius2 = 20; + offset = 20; + if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p22.y + radius2} ${arc} ${p1.x - offset} ${p22.y} L ${p22.x} ${p22.y}`; + } else { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x - radius2} ${p1.y} ${arc} ${p22.x} ${p1.y - offset} L ${p22.x} ${p22.y}`; + } + } + if (p1.x === p22.x) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x} ${p22.y}`; + } } else { - return this.conditionStack[0]; + if (p1.y < p22.y) { + if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x - radius2} ${p1.y} ${arc2} ${p22.x} ${p1.y + offset} L ${p22.x} ${p22.y}`; + } else { + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p22.y - radius2} ${arc} ${p1.x + offset} ${p22.y} L ${p22.x} ${p22.y}`; + } + } + if (p1.y > p22.y) { + if (commitB.type === commitType.MERGE && commitA.id !== commitB.parents[0]) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x - radius2} ${p1.y} ${arc} ${p22.x} ${p1.y - offset} L ${p22.x} ${p22.y}`; + } else { + lineDef = `M ${p1.x} ${p1.y} L ${p1.x} ${p22.y + radius2} ${arc2} ${p1.x + offset} ${p22.y} L ${p22.x} ${p22.y}`; + } + } + if (p1.y === p22.y) { + lineDef = `M ${p1.x} ${p1.y} L ${p22.x} ${p22.y}`; + } } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; + } + if (lineDef === void 0) { + throw new Error("Line definition not found"); + } + svg.append("path").attr("d", lineDef).attr("class", "arrow arrow" + colorClassNum % THEME_COLOR_LIMIT); + }, "drawArrow"); + drawArrows = /* @__PURE__ */ __name((svg, commits) => { + const gArrows = svg.append("g").attr("class", "commit-arrows"); + [...commits.keys()].forEach((key) => { + const commit2 = commits.get(key); + if (commit2.parents && commit2.parents.length > 0) { + commit2.parents.forEach((parent4) => { + drawArrow(gArrows, commits.get(parent4), commit2, commits); + }); } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; + }); + }, "drawArrows"); + drawBranches = /* @__PURE__ */ __name((svg, branches) => { + const g2 = svg.append("g"); + branches.forEach((branch2, index) => { + const adjustIndexForTheme = index % THEME_COLOR_LIMIT; + const pos = branchPos.get(branch2.name)?.pos; + if (pos === void 0) { + throw new Error(`Position not found for branch ${branch2.name}`); + } + const line2 = g2.append("line"); + line2.attr("x1", 0); + line2.attr("y1", pos); + line2.attr("x2", maxPos); + line2.attr("y2", pos); + line2.attr("class", "branch branch" + adjustIndexForTheme); + if (dir === "TB") { + line2.attr("y1", defaultPos); + line2.attr("x1", pos); + line2.attr("y2", maxPos); + line2.attr("x2", pos); + } else if (dir === "BT") { + line2.attr("y1", maxPos); + line2.attr("x1", pos); + line2.attr("y2", defaultPos); + line2.attr("x2", pos); + } + lanes.push(pos); + const name = branch2.name; + const labelElement = drawText2(name); + const bkg = g2.insert("rect"); + const branchLabel = g2.insert("g").attr("class", "branchLabel"); + const label = branchLabel.insert("g").attr("class", "label branch-label" + adjustIndexForTheme); + label.node().appendChild(labelElement); + const bbox = labelElement.getBBox(); + bkg.attr("class", "branchLabelBkg label" + adjustIndexForTheme).attr("rx", 4).attr("ry", 4).attr("x", -bbox.width - 4 - (DEFAULT_GITGRAPH_CONFIG2?.rotateCommitLabel === true ? 30 : 0)).attr("y", -bbox.height / 2 + 8).attr("width", bbox.width + 18).attr("height", bbox.height + 4); + label.attr( + "transform", + "translate(" + (-bbox.width - 14 - (DEFAULT_GITGRAPH_CONFIG2?.rotateCommitLabel === true ? 30 : 0)) + ", " + (pos - bbox.height / 2 - 1) + ")" + ); + if (dir === "TB") { + bkg.attr("x", pos - bbox.width / 2 - 10).attr("y", 0); + label.attr("transform", "translate(" + (pos - bbox.width / 2 - 5) + ", 0)"); + } else if (dir === "BT") { + bkg.attr("x", pos - bbox.width / 2 - 10).attr("y", maxPos); + label.attr("transform", "translate(" + (pos - bbox.width / 2 - 5) + ", " + maxPos + ")"); } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - break; - case 1: - break; - case 2: - return 10; - case 3: - break; - case 4: - break; - case 5: - return 4; - case 6: - return 11; - case 7: - this.begin("acc_title"); - return 12; - case 8: - this.popState(); - return "acc_title_value"; - case 9: - this.begin("acc_descr"); - return 14; - case 10: - this.popState(); - return "acc_descr_value"; - case 11: - this.begin("acc_descr_multiline"); - break; - case 12: - this.popState(); - break; - case 13: - return "acc_descr_multiline_value"; - case 14: - return 17; - case 15: - return 18; - case 16: - return 19; - case 17: - return ":"; - case 18: - return 6; - case 19: - return "INVALID"; + bkg.attr("transform", "translate(-19, " + (pos - bbox.height / 2) + ")"); } - }, - rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$8.parser = parser$8; - const parser$9 = parser$8; - let currentSection$1 = ""; - const sections$1 = []; - const tasks$1 = []; - const rawTasks$1 = []; - const clear$4 = function() { - sections$1.length = 0; - tasks$1.length = 0; - currentSection$1 = ""; - rawTasks$1.length = 0; - clear$n(); - }; - const addSection$1 = function(txt) { - currentSection$1 = txt; - sections$1.push(txt); - }; - const getSections$1 = function() { - return sections$1; - }; - const getTasks$1 = function() { - let allItemsProcessed = compileTasks$1(); - const maxDepth = 100; - let iterationCount = 0; - while (!allItemsProcessed && iterationCount < maxDepth) { - allItemsProcessed = compileTasks$1(); - iterationCount++; - } - tasks$1.push(...rawTasks$1); - return tasks$1; - }; - const updateActors = function() { - const tempActors = []; - tasks$1.forEach((task) => { - if (task.people) { - tempActors.push(...task.people); + }); + }, "drawBranches"); + setBranchPosition = /* @__PURE__ */ __name(function(name, pos, index, bbox, rotateCommitLabel) { + branchPos.set(name, { pos, index }); + pos += 50 + (rotateCommitLabel ? 40 : 0) + (dir === "TB" || dir === "BT" ? bbox.width / 2 : 0); + return pos; + }, "setBranchPosition"); + draw4 = /* @__PURE__ */ __name(function(txt, id26, ver, diagObj) { + clear11(); + log.debug("in gitgraph renderer", txt + "\n", "id:", id26, ver); + if (!DEFAULT_GITGRAPH_CONFIG2) { + throw new Error("GitGraph config not found"); + } + const rotateCommitLabel = DEFAULT_GITGRAPH_CONFIG2.rotateCommitLabel ?? false; + const db7 = diagObj.db; + allCommitsDict = db7.getCommits(); + const branches = db7.getBranchesAsObjArray(); + dir = db7.getDirection(); + const diagram23 = select_default2(`[id="${id26}"]`); + let pos = 0; + branches.forEach((branch2, index) => { + const labelElement = drawText2(branch2.name); + const g2 = diagram23.append("g"); + const branchLabel = g2.insert("g").attr("class", "branchLabel"); + const label = branchLabel.insert("g").attr("class", "label branch-label"); + label.node()?.appendChild(labelElement); + const bbox = labelElement.getBBox(); + pos = setBranchPosition(branch2.name, pos, index, bbox, rotateCommitLabel); + label.remove(); + branchLabel.remove(); + g2.remove(); + }); + drawCommits(diagram23, allCommitsDict, false); + if (DEFAULT_GITGRAPH_CONFIG2.showBranches) { + drawBranches(diagram23, branches); + } + drawArrows(diagram23, allCommitsDict); + drawCommits(diagram23, allCommitsDict, true); + utils_default2.insertTitle( + diagram23, + "gitTitleText", + DEFAULT_GITGRAPH_CONFIG2.titleTopMargin ?? 0, + db7.getDiagramTitle() + ); + setupGraphViewbox2( + void 0, + diagram23, + DEFAULT_GITGRAPH_CONFIG2.diagramPadding, + DEFAULT_GITGRAPH_CONFIG2.useMaxWidth + ); + }, "draw"); + gitGraphRenderer_default = { + draw: draw4 + }; + if (void 0) { + const { it, expect, describe } = void 0; + describe("drawText", () => { + it("should drawText", () => { + const svgLabel = drawText2("main"); + expect(svgLabel).toBeDefined(); + expect(svgLabel.children[0].innerHTML).toBe("main"); + }); + }); + describe("branchPosition", () => { + const bbox = { + x: 0, + y: 0, + width: 10, + height: 10, + top: 0, + right: 0, + bottom: 0, + left: 0, + toJSON: /* @__PURE__ */ __name(() => "", "toJSON") + }; + it("should setBranchPositions LR with two branches", () => { + dir = "LR"; + const pos = setBranchPosition("main", 0, 0, bbox, true); + expect(pos).toBe(90); + expect(branchPos.get("main")).toEqual({ pos: 0, index: 0 }); + const posNext = setBranchPosition("develop", pos, 1, bbox, true); + expect(posNext).toBe(180); + expect(branchPos.get("develop")).toEqual({ pos, index: 1 }); + }); + it("should setBranchPositions TB with two branches", () => { + dir = "TB"; + bbox.width = 34.9921875; + const pos = setBranchPosition("main", 0, 0, bbox, true); + expect(pos).toBe(107.49609375); + expect(branchPos.get("main")).toEqual({ pos: 0, index: 0 }); + bbox.width = 56.421875; + const posNext = setBranchPosition("develop", pos, 1, bbox, true); + expect(posNext).toBe(225.70703125); + expect(branchPos.get("develop")).toEqual({ pos, index: 1 }); + }); + }); + describe("commitPosition", () => { + const commits = /* @__PURE__ */ new Map([ + [ + "commitZero", + { + id: "ZERO", + message: "", + seq: 0, + type: commitType.NORMAL, + tags: [], + parents: [], + branch: "main" + } + ], + [ + "commitA", + { + id: "A", + message: "", + seq: 1, + type: commitType.NORMAL, + tags: [], + parents: ["ZERO"], + branch: "feature" + } + ], + [ + "commitB", + { + id: "B", + message: "", + seq: 2, + type: commitType.NORMAL, + tags: [], + parents: ["A"], + branch: "feature" + } + ], + [ + "commitM", + { + id: "M", + message: "merged branch feature into main", + seq: 3, + type: commitType.MERGE, + tags: [], + parents: ["ZERO", "B"], + branch: "main", + customId: true + } + ], + [ + "commitC", + { + id: "C", + message: "", + seq: 4, + type: commitType.NORMAL, + tags: [], + parents: ["ZERO"], + branch: "release" + } + ], + [ + "commit5_8928ea0", + { + id: "5-8928ea0", + message: "cherry-picked [object Object] into release", + seq: 5, + type: commitType.CHERRY_PICK, + tags: [], + parents: ["C", "M"], + branch: "release" + } + ], + [ + "commitD", + { + id: "D", + message: "", + seq: 6, + type: commitType.NORMAL, + tags: [], + parents: ["5-8928ea0"], + branch: "release" + } + ], + [ + "commit7_ed848ba", + { + id: "7-ed848ba", + message: "cherry-picked [object Object] into release", + seq: 7, + type: commitType.CHERRY_PICK, + tags: [], + parents: ["D", "M"], + branch: "release" + } + ] + ]); + let pos = 0; + branchPos.set("main", { pos: 0, index: 0 }); + branchPos.set("feature", { pos: 107.49609375, index: 1 }); + branchPos.set("release", { pos: 224.03515625, index: 2 }); + describe("TB", () => { + pos = 30; + dir = "TB"; + const expectedCommitPositionTB = /* @__PURE__ */ new Map([ + ["commitZero", { x: 0, y: 40, posWithOffset: 40 }], + ["commitA", { x: 107.49609375, y: 90, posWithOffset: 90 }], + ["commitB", { x: 107.49609375, y: 140, posWithOffset: 140 }], + ["commitM", { x: 0, y: 190, posWithOffset: 190 }], + ["commitC", { x: 224.03515625, y: 240, posWithOffset: 240 }], + ["commit5_8928ea0", { x: 224.03515625, y: 290, posWithOffset: 290 }], + ["commitD", { x: 224.03515625, y: 340, posWithOffset: 340 }], + ["commit7_ed848ba", { x: 224.03515625, y: 390, posWithOffset: 390 }] + ]); + commits.forEach((commit2, key) => { + it(`should give the correct position for commit ${key}`, () => { + const position5 = getCommitPosition(commit2, pos, false); + expect(position5).toEqual(expectedCommitPositionTB.get(key)); + pos += 50; + }); + }); + }); + describe("LR", () => { + let pos2 = 30; + dir = "LR"; + const expectedCommitPositionLR = /* @__PURE__ */ new Map([ + ["commitZero", { x: 0, y: 40, posWithOffset: 40 }], + ["commitA", { x: 107.49609375, y: 90, posWithOffset: 90 }], + ["commitB", { x: 107.49609375, y: 140, posWithOffset: 140 }], + ["commitM", { x: 0, y: 190, posWithOffset: 190 }], + ["commitC", { x: 224.03515625, y: 240, posWithOffset: 240 }], + ["commit5_8928ea0", { x: 224.03515625, y: 290, posWithOffset: 290 }], + ["commitD", { x: 224.03515625, y: 340, posWithOffset: 340 }], + ["commit7_ed848ba", { x: 224.03515625, y: 390, posWithOffset: 390 }] + ]); + commits.forEach((commit2, key) => { + it(`should give the correct position for commit ${key}`, () => { + const position5 = getCommitPosition(commit2, pos2, false); + expect(position5).toEqual(expectedCommitPositionLR.get(key)); + pos2 += 50; + }); + }); + }); + describe("getCommitClassType", () => { + const expectedCommitClassType = /* @__PURE__ */ new Map([ + ["commitZero", "commit-normal"], + ["commitA", "commit-normal"], + ["commitB", "commit-normal"], + ["commitM", "commit-merge"], + ["commitC", "commit-normal"], + ["commit5_8928ea0", "commit-cherry-pick"], + ["commitD", "commit-normal"], + ["commit7_ed848ba", "commit-cherry-pick"] + ]); + commits.forEach((commit2, key) => { + it(`should give the correct class type for commit ${key}`, () => { + const classType = getCommitClassType(commit2); + expect(classType).toBe(expectedCommitClassType.get(key)); + }); + }); + }); + }); + describe("building BT parallel commit diagram", () => { + const commits = /* @__PURE__ */ new Map([ + [ + "1-abcdefg", + { + id: "1-abcdefg", + message: "", + seq: 0, + type: 0, + tags: [], + parents: [], + branch: "main" + } + ], + [ + "2-abcdefg", + { + id: "2-abcdefg", + message: "", + seq: 1, + type: 0, + tags: [], + parents: ["1-abcdefg"], + branch: "main" + } + ], + [ + "3-abcdefg", + { + id: "3-abcdefg", + message: "", + seq: 2, + type: 0, + tags: [], + parents: ["2-abcdefg"], + branch: "develop" + } + ], + [ + "4-abcdefg", + { + id: "4-abcdefg", + message: "", + seq: 3, + type: 0, + tags: [], + parents: ["3-abcdefg"], + branch: "develop" + } + ], + [ + "5-abcdefg", + { + id: "5-abcdefg", + message: "", + seq: 4, + type: 0, + tags: [], + parents: ["2-abcdefg"], + branch: "feature" + } + ], + [ + "6-abcdefg", + { + id: "6-abcdefg", + message: "", + seq: 5, + type: 0, + tags: [], + parents: ["5-abcdefg"], + branch: "feature" + } + ], + [ + "7-abcdefg", + { + id: "7-abcdefg", + message: "", + seq: 6, + type: 0, + tags: [], + parents: ["2-abcdefg"], + branch: "main" + } + ], + [ + "8-abcdefg", + { + id: "8-abcdefg", + message: "", + seq: 7, + type: 0, + tags: [], + parents: ["7-abcdefg"], + branch: "main" + } + ] + ]); + const expectedCommitPosition = /* @__PURE__ */ new Map([ + ["1-abcdefg", { x: 0, y: 40 }], + ["2-abcdefg", { x: 0, y: 90 }], + ["3-abcdefg", { x: 107.49609375, y: 140 }], + ["4-abcdefg", { x: 107.49609375, y: 190 }], + ["5-abcdefg", { x: 225.70703125, y: 140 }], + ["6-abcdefg", { x: 225.70703125, y: 190 }], + ["7-abcdefg", { x: 0, y: 140 }], + ["8-abcdefg", { x: 0, y: 190 }] + ]); + const expectedCommitPositionAfterParallel = /* @__PURE__ */ new Map([ + ["1-abcdefg", { x: 0, y: 210 }], + ["2-abcdefg", { x: 0, y: 160 }], + ["3-abcdefg", { x: 107.49609375, y: 110 }], + ["4-abcdefg", { x: 107.49609375, y: 60 }], + ["5-abcdefg", { x: 225.70703125, y: 110 }], + ["6-abcdefg", { x: 225.70703125, y: 60 }], + ["7-abcdefg", { x: 0, y: 110 }], + ["8-abcdefg", { x: 0, y: 60 }] + ]); + const expectedCommitCurrentPosition = /* @__PURE__ */ new Map([ + ["1-abcdefg", 30], + ["2-abcdefg", 80], + ["3-abcdefg", 130], + ["4-abcdefg", 180], + ["5-abcdefg", 130], + ["6-abcdefg", 180], + ["7-abcdefg", 130], + ["8-abcdefg", 180] + ]); + const sortedKeys = [...expectedCommitPosition.keys()]; + it("should get the correct commit position and current position", () => { + dir = "BT"; + let curPos = 30; + commitPos.clear(); + branchPos.clear(); + branchPos.set("main", { pos: 0, index: 0 }); + branchPos.set("develop", { pos: 107.49609375, index: 1 }); + branchPos.set("feature", { pos: 225.70703125, index: 2 }); + DEFAULT_GITGRAPH_CONFIG2.parallelCommits = true; + commits.forEach((commit2, key) => { + if (commit2.parents.length > 0) { + curPos = calculateCommitPosition(commit2); + } + const position5 = setCommitPosition(commit2, curPos); + expect(position5).toEqual(expectedCommitPosition.get(key)); + expect(curPos).toEqual(expectedCommitCurrentPosition.get(key)); + }); + }); + it("should get the correct commit position after parallel commits", () => { + commitPos.clear(); + branchPos.clear(); + dir = "BT"; + const curPos = 30; + commitPos.clear(); + branchPos.clear(); + branchPos.set("main", { pos: 0, index: 0 }); + branchPos.set("develop", { pos: 107.49609375, index: 1 }); + branchPos.set("feature", { pos: 225.70703125, index: 2 }); + setParallelBTPos(sortedKeys, commits, curPos); + sortedKeys.forEach((commit2) => { + const position5 = commitPos.get(commit2); + expect(position5).toEqual(expectedCommitPositionAfterParallel.get(commit2)); + }); + }); + }); + DEFAULT_GITGRAPH_CONFIG2.parallelCommits = false; + it("add", () => { + commitPos.set("parent1", { x: 1, y: 1 }); + commitPos.set("parent2", { x: 2, y: 2 }); + commitPos.set("parent3", { x: 3, y: 3 }); + dir = "LR"; + const parents4 = ["parent1", "parent2", "parent3"]; + const closestParent = findClosestParent(parents4); + expect(closestParent).toBe("parent3"); + commitPos.clear(); + }); } - }); - const unique = new Set(tempActors); - return [...unique].sort(); - }; - const addTask$1 = function(descr, taskData) { - const pieces = taskData.substr(1).split(":"); - let score = 0; - let peeps = []; - if (pieces.length === 1) { - score = Number(pieces[0]); - peeps = []; - } else { - score = Number(pieces[0]); - peeps = pieces[1].split(","); - } - const peopleList = peeps.map((s) => s.trim()); - const rawTask = { - section: currentSection$1, - type: currentSection$1, - people: peopleList, - task: descr, - score - }; - rawTasks$1.push(rawTask); - }; - const addTaskOrg$1 = function(descr) { - const newTask = { - section: currentSection$1, - type: currentSection$1, - description: descr, - task: descr, - classes: [] - }; - tasks$1.push(newTask); - }; - const compileTasks$1 = function() { - const compileTask = function(pos) { - return rawTasks$1[pos].processed; - }; - let allProcessed = true; - for (const [i2, rawTask] of rawTasks$1.entries()) { - compileTask(i2); - allProcessed = allProcessed && rawTask.processed; } - return allProcessed; - }; - const getActors = function() { - return updateActors(); - }; - const db$6 = { - getConfig: () => getConfig$1().journey, - clear: clear$4, - setDiagramTitle, - getDiagramTitle, - setAccTitle, - getAccTitle, - setAccDescription, - getAccDescription, - addSection: addSection$1, - getSections: getSections$1, - getTasks: getTasks$1, - addTask: addTask$1, - addTaskOrg: addTaskOrg$1, - getActors - }; - const getStyles$4 = (options2) => `.label { + }); + + // src/diagrams/git/styles.js + var getStyles5, styles_default5; + var init_styles5 = __esm({ + "src/diagrams/git/styles.js"() { + "use strict"; + getStyles5 = /* @__PURE__ */ __name((options3) => ` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); - color: ${options2.textColor}; - } - .mouth { - stroke: #666; - } - - line { - stroke: ${options2.textColor} - } - - .legend { - fill: ${options2.textColor}; - } - - .label text { - fill: #333; - } - .label { - color: ${options2.textColor} - } - - .face { - ${options2.faceColor ? `fill: ${options2.faceColor}` : "fill: #FFF8DC"}; - stroke: #999; } + ${[0, 1, 2, 3, 4, 5, 6, 7].map( + (i2) => ` + .branch-label${i2} { fill: ${options3["gitBranchLabel" + i2]}; } + .commit${i2} { stroke: ${options3["git" + i2]}; fill: ${options3["git" + i2]}; } + .commit-highlight${i2} { stroke: ${options3["gitInv" + i2]}; fill: ${options3["gitInv" + i2]}; } + .label${i2} { fill: ${options3["git" + i2]}; } + .arrow${i2} { stroke: ${options3["git" + i2]}; } + ` + ).join("\n")} - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; - stroke-width: 1px; + .branch { + stroke-width: 1; + stroke: ${options3.lineColor}; + stroke-dasharray: 2; } + .commit-label { font-size: ${options3.commitLabelFontSize}; fill: ${options3.commitLabelColor};} + .commit-label-bkg { font-size: ${options3.commitLabelFontSize}; fill: ${options3.commitLabelBackground}; opacity: 0.5; } + .tag-label { font-size: ${options3.tagLabelFontSize}; fill: ${options3.tagLabelColor};} + .tag-label-bkg { fill: ${options3.tagLabelBackground}; stroke: ${options3.tagLabelBorder}; } + .tag-hole { fill: ${options3.textColor}; } - .node .label { - text-align: center; + .commit-merge { + stroke: ${options3.primaryColor}; + fill: ${options3.primaryColor}; } - .node.clickable { - cursor: pointer; + .commit-reverse { + stroke: ${options3.primaryColor}; + fill: ${options3.primaryColor}; + stroke-width: 3; } - - .arrowheadPath { - fill: ${options2.arrowheadColor}; + .commit-highlight-outer { } - - .edgePath .path { - stroke: ${options2.lineColor}; - stroke-width: 1.5px; + .commit-highlight-inner { + stroke: ${options3.primaryColor}; + fill: ${options3.primaryColor}; } - .flowchart-link { - stroke: ${options2.lineColor}; - fill: none; + .arrow { stroke-width: 8; stroke-linecap: round; fill: none} + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; } - - .edgeLabel { - background-color: ${options2.edgeLabelBackground}; - rect { - opacity: 0.5; +`, "getStyles"); + styles_default5 = getStyles5; } - text-align: center; - } - - .cluster rect { - } - - .cluster text { - fill: ${options2.titleColor}; - } - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - font-size: 12px; - background: ${options2.tertiaryColor}; - border: 1px solid ${options2.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .task-type-0, .section-type-0 { - ${options2.fillType0 ? `fill: ${options2.fillType0}` : ""}; - } - .task-type-1, .section-type-1 { - ${options2.fillType0 ? `fill: ${options2.fillType1}` : ""}; - } - .task-type-2, .section-type-2 { - ${options2.fillType0 ? `fill: ${options2.fillType2}` : ""}; - } - .task-type-3, .section-type-3 { - ${options2.fillType0 ? `fill: ${options2.fillType3}` : ""}; - } - .task-type-4, .section-type-4 { - ${options2.fillType0 ? `fill: ${options2.fillType4}` : ""}; - } - .task-type-5, .section-type-5 { - ${options2.fillType0 ? `fill: ${options2.fillType5}` : ""}; - } - .task-type-6, .section-type-6 { - ${options2.fillType0 ? `fill: ${options2.fillType6}` : ""}; - } - .task-type-7, .section-type-7 { - ${options2.fillType0 ? `fill: ${options2.fillType7}` : ""}; - } + }); - .actor-0 { - ${options2.actor0 ? `fill: ${options2.actor0}` : ""}; - } - .actor-1 { - ${options2.actor1 ? `fill: ${options2.actor1}` : ""}; - } - .actor-2 { - ${options2.actor2 ? `fill: ${options2.actor2}` : ""}; - } - .actor-3 { - ${options2.actor3 ? `fill: ${options2.actor3}` : ""}; - } - .actor-4 { - ${options2.actor4 ? `fill: ${options2.actor4}` : ""}; - } - .actor-5 { - ${options2.actor5 ? `fill: ${options2.actor5}` : ""}; - } -`; - const styles$3 = getStyles$4; - const drawRect$1 = function(elem, rectData) { - return drawRect$4(elem, rectData); - }; - const drawFace$1 = function(element2, faceData) { - const radius = 15; - const circleElement = element2.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible"); - const face = element2.append("g"); - face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); - face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); - function smile(face2) { - const arc = d3arc().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); - face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")"); - } - function sad(face2) { - const arc = d3arc().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); - face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")"); - } - function ambivalent(face2) { - face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666"); - } - if (faceData.score > 3) { - smile(face); - } else if (faceData.score < 3) { - sad(face); - } else { - ambivalent(face); - } - return circleElement; - }; - const drawCircle$1 = function(element2, circleData) { - const circleElement = element2.append("circle"); - circleElement.attr("cx", circleData.cx); - circleElement.attr("cy", circleData.cy); - circleElement.attr("class", "actor-" + circleData.pos); - circleElement.attr("fill", circleData.fill); - circleElement.attr("stroke", circleData.stroke); - circleElement.attr("r", circleData.r); - if (circleElement.class !== void 0) { - circleElement.attr("class", circleElement.class); - } - if (circleData.title !== void 0) { - circleElement.append("title").text(circleData.title); - } - return circleElement; - }; - const drawText$1 = function(elem, textData) { - return drawText$4(elem, textData); - }; - const drawLabel$1 = function(elem, txtObject) { - function genPoints(x2, y2, width2, height, cut) { - return x2 + "," + y2 + " " + (x2 + width2) + "," + y2 + " " + (x2 + width2) + "," + (y2 + height - cut) + " " + (x2 + width2 - cut * 1.2) + "," + (y2 + height) + " " + x2 + "," + (y2 + height); - } - const polygon = elem.append("polygon"); - polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7)); - polygon.attr("class", "labelBox"); - txtObject.y = txtObject.y + txtObject.labelMargin; - txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin; - drawText$1(elem, txtObject); - }; - const drawSection$1 = function(elem, section, conf2) { - const g = elem.append("g"); - const rect2 = getNoteRect$2(); - rect2.x = section.x; - rect2.y = section.y; - rect2.fill = section.fill; - rect2.width = conf2.width * section.taskCount + // width of the tasks - conf2.diagramMarginX * (section.taskCount - 1); - rect2.height = conf2.height; - rect2.class = "journey-section section-type-" + section.num; - rect2.rx = 3; - rect2.ry = 3; - drawRect$1(g, rect2); - _drawTextCandidateFunc$1(conf2)( - section.text, - g, - rect2.x, - rect2.y, - rect2.width, - rect2.height, - { class: "journey-section section-type-" + section.num }, - conf2, - section.colour - ); - }; - let taskCount$1 = -1; - const drawTask$1 = function(elem, task, conf2) { - const center2 = task.x + conf2.width / 2; - const g = elem.append("g"); - taskCount$1++; - const maxHeight = 300 + 5 * 30; - g.append("line").attr("id", "task" + taskCount$1).attr("x1", center2).attr("y1", task.y).attr("x2", center2).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"); - drawFace$1(g, { - cx: center2, - cy: 300 + (5 - task.score) * 30, - score: task.score - }); - const rect2 = getNoteRect$2(); - rect2.x = task.x; - rect2.y = task.y; - rect2.fill = task.fill; - rect2.width = conf2.width; - rect2.height = conf2.height; - rect2.class = "task task-type-" + task.num; - rect2.rx = 3; - rect2.ry = 3; - drawRect$1(g, rect2); - let xPos = task.x + 14; - task.people.forEach((person) => { - const colour = task.actors[person].color; - const circle2 = { - cx: xPos, - cy: task.y, - r: 7, - fill: colour, - stroke: "#000", - title: person, - pos: task.actors[person].position - }; - drawCircle$1(g, circle2); - xPos += 10; - }); - _drawTextCandidateFunc$1(conf2)( - task.task, - g, - rect2.x, - rect2.y, - rect2.width, - rect2.height, - { class: "task" }, - conf2, - task.colour - ); - }; - const drawBackgroundRect$1 = function(elem, bounds2) { - drawBackgroundRect$3(elem, bounds2); - }; - const _drawTextCandidateFunc$1 = function() { - function byText(content2, g, x2, y2, width2, height, textAttrs, colour) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content2); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content2, g, x2, y2, width2, height, textAttrs, conf2, colour) { - const { taskFontSize, taskFontFamily } = conf2; - const lines = content2.split(//gi); - for (let i2 = 0; i2 < lines.length; i2++) { - const dy = i2 * taskFontSize - taskFontSize * (lines.length - 1) / 2; - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily); - text2.append("tspan").attr("x", x2 + width2 / 2).attr("dy", dy).text(lines[i2]); - text2.attr("y", y2 + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const body = g.append("switch"); - const f2 = body.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height).attr("position", "fixed"); - const text2 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); - text2.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content2); - byTspan(content2, body, x2, y2, width2, height, textAttrs, conf2); - _setTextAttrs(text2, textAttrs); - } - function _setTextAttrs(toText, fromTextAttrsDict) { - for (const key in fromTextAttrsDict) { - if (key in fromTextAttrsDict) { - toText.attr(key, fromTextAttrsDict[key]); - } - } - } - return function(conf2) { - return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; - }; - }(); - const initGraphics$1 = function(graphics) { - graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z"); - }; - const svgDraw$1 = { - drawRect: drawRect$1, - drawCircle: drawCircle$1, - drawSection: drawSection$1, - drawText: drawText$1, - drawLabel: drawLabel$1, - drawTask: drawTask$1, - drawBackgroundRect: drawBackgroundRect$1, - initGraphics: initGraphics$1 - }; - const setConf = function(cnf) { - const keys2 = Object.keys(cnf); - keys2.forEach(function(key) { - conf$1[key] = cnf[key]; - }); - }; - const actors = {}; - function drawActorLegend(diagram2) { - const conf2 = getConfig$1().journey; - let yPos = 60; - Object.keys(actors).forEach((person) => { - const colour = actors[person].color; - const circleData = { - cx: 20, - cy: yPos, - r: 7, - fill: colour, - stroke: "#000", - pos: actors[person].position - }; - svgDraw$1.drawCircle(diagram2, circleData); - const labelData = { - x: 40, - y: yPos + 7, - fill: "#666", - text: person, - textMargin: conf2.boxTextMargin | 5 + // src/diagrams/git/gitGraphDiagram.ts + var gitGraphDiagram_exports = {}; + __export(gitGraphDiagram_exports, { + diagram: () => diagram4 + }); + var diagram4; + var init_gitGraphDiagram = __esm({ + "src/diagrams/git/gitGraphDiagram.ts"() { + "use strict"; + init_gitGraphParser(); + init_gitGraphAst(); + init_gitGraphRenderer(); + init_styles5(); + diagram4 = { + parser: parser5, + db, + renderer: gitGraphRenderer_default, + styles: styles_default5 }; - svgDraw$1.drawText(diagram2, labelData); - yPos += 20; - }); - } - const conf$1 = getConfig$1().journey; - const LEFT_MARGIN = conf$1.leftMargin; - const draw$5 = function(text2, id2, version2, diagObj) { - const conf2 = getConfig$1().journey; - const securityLevel = getConfig$1().securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - bounds.init(); - const diagram2 = root2.select("#" + id2); - svgDraw$1.initGraphics(diagram2); - const tasks2 = diagObj.db.getTasks(); - const title2 = diagObj.db.getDiagramTitle(); - const actorNames = diagObj.db.getActors(); - for (const member in actors) { - delete actors[member]; - } - let actorPos = 0; - actorNames.forEach((actorName) => { - actors[actorName] = { - color: conf2.actorColours[actorPos % conf2.actorColours.length], - position: actorPos - }; - actorPos++; - }); - drawActorLegend(diagram2); - bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50); - drawTasks$1(diagram2, tasks2, 0); - const box = bounds.getBounds(); - if (title2) { - diagram2.append("text").text(title2).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25); - } - const height = box.stopy - box.starty + 2 * conf2.diagramMarginY; - const width2 = LEFT_MARGIN + box.stopx + 2 * conf2.diagramMarginX; - configureSvgSize(diagram2, height, width2, conf2.useMaxWidth); - diagram2.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf2.height * 4).attr("x2", width2 - LEFT_MARGIN - 4).attr("y2", conf2.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); - const extraVertForTitle = title2 ? 70 : 0; - diagram2.attr("viewBox", `${box.startx} -25 ${width2} ${height + extraVertForTitle}`); - diagram2.attr("preserveAspectRatio", "xMinYMin meet"); - diagram2.attr("height", height + extraVertForTitle + 25); - }; - const bounds = { - data: { - startx: void 0, - stopx: void 0, - starty: void 0, - stopy: void 0 - }, - verticalPos: 0, - sequenceItems: [], - init: function() { - this.sequenceItems = []; - this.data = { - startx: void 0, - stopx: void 0, - starty: void 0, - stopy: void 0 - }; - this.verticalPos = 0; - }, - updateVal: function(obj, key, val, fun) { - if (obj[key] === void 0) { - obj[key] = val; - } else { - obj[key] = fun(val, obj[key]); - } - }, - updateBounds: function(startx, starty, stopx, stopy) { - const conf2 = getConfig$1().journey; - const _self = this; - let cnt2 = 0; - function updateFn(type2) { - return function updateItemBounds(item) { - cnt2++; - const n = _self.sequenceItems.length - cnt2 + 1; - _self.updateVal(item, "starty", starty - n * conf2.boxMargin, Math.min); - _self.updateVal(item, "stopy", stopy + n * conf2.boxMargin, Math.max); - _self.updateVal(bounds.data, "startx", startx - n * conf2.boxMargin, Math.min); - _self.updateVal(bounds.data, "stopx", stopx + n * conf2.boxMargin, Math.max); - if (!(type2 === "activation")) { - _self.updateVal(item, "startx", startx - n * conf2.boxMargin, Math.min); - _self.updateVal(item, "stopx", stopx + n * conf2.boxMargin, Math.max); - _self.updateVal(bounds.data, "starty", starty - n * conf2.boxMargin, Math.min); - _self.updateVal(bounds.data, "stopy", stopy + n * conf2.boxMargin, Math.max); - } - }; - } - this.sequenceItems.forEach(updateFn()); - }, - insert: function(startx, starty, stopx, stopy) { - const _startx = Math.min(startx, stopx); - const _stopx = Math.max(startx, stopx); - const _starty = Math.min(starty, stopy); - const _stopy = Math.max(starty, stopy); - this.updateVal(bounds.data, "startx", _startx, Math.min); - this.updateVal(bounds.data, "starty", _starty, Math.min); - this.updateVal(bounds.data, "stopx", _stopx, Math.max); - this.updateVal(bounds.data, "stopy", _stopy, Math.max); - this.updateBounds(_startx, _starty, _stopx, _stopy); - }, - bumpVerticalPos: function(bump) { - this.verticalPos = this.verticalPos + bump; - this.data.stopy = this.verticalPos; - }, - getVerticalPos: function() { - return this.verticalPos; - }, - getBounds: function() { - return this.data; - } - }; - const fills = conf$1.sectionFills; - const textColours = conf$1.sectionColours; - const drawTasks$1 = function(diagram2, tasks2, verticalPos) { - const conf2 = getConfig$1().journey; - let lastSection = ""; - const sectionVHeight = conf2.height * 2 + conf2.diagramMarginY; - const taskPos = verticalPos + sectionVHeight; - let sectionNumber = 0; - let fill = "#CCC"; - let colour = "black"; - let num = 0; - for (const [i2, task] of tasks2.entries()) { - if (lastSection !== task.section) { - fill = fills[sectionNumber % fills.length]; - num = sectionNumber % fills.length; - colour = textColours[sectionNumber % textColours.length]; - let taskInSectionCount = 0; - const currentSection2 = task.section; - for (let taskIndex = i2; taskIndex < tasks2.length; taskIndex++) { - if (tasks2[taskIndex].section == currentSection2) { - taskInSectionCount = taskInSectionCount + 1; - } else { - break; - } - } - const section = { - x: i2 * conf2.taskMargin + i2 * conf2.width + LEFT_MARGIN, - y: 50, - text: task.section, - fill, - num, - colour, - taskCount: taskInSectionCount - }; - svgDraw$1.drawSection(diagram2, section, conf2); - lastSection = task.section; - sectionNumber++; - } - const taskActors = task.people.reduce((acc, actorName) => { - if (actors[actorName]) { - acc[actorName] = actors[actorName]; - } - return acc; - }, {}); - task.x = i2 * conf2.taskMargin + i2 * conf2.width + LEFT_MARGIN; - task.y = taskPos; - task.width = conf2.diagramMarginX; - task.height = conf2.diagramMarginY; - task.colour = colour; - task.fill = fill; - task.num = num; - task.actors = taskActors; - svgDraw$1.drawTask(diagram2, task, conf2); - bounds.insert(task.x, task.y, task.x + task.width + conf2.taskMargin, 300 + 5 * 30); } - }; - const renderer$5 = { - setConf, - draw: draw$5 - }; - const diagram$5 = { - parser: parser$9, - db: db$6, - renderer: renderer$5, - styles: styles$3, - init: (cnf) => { - renderer$5.setConf(cnf.journey); - db$6.clear(); - } - }; - const journeyDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$5 - }, Symbol.toStringTag, { value: "Module" })); - const findCommonAncestor = (id1, id2, treeData) => { - const { parentById } = treeData; - const visited = /* @__PURE__ */ new Set(); - let currentId = id1; - while (currentId) { - visited.add(currentId); - if (currentId === id2) { - return currentId; - } - currentId = parentById[currentId]; - } - currentId = id2; - while (currentId) { - if (visited.has(currentId)) { - return currentId; - } - currentId = parentById[currentId]; - } - return "root"; - }; - function commonjsRequire(path2) { - throw new Error('Could not dynamically require "' + path2 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); - } - var elk_bundled = { exports: {} }; - (function(module2, exports2) { - (function(f2) { - { - module2.exports = f2(); - } - })(function() { - return function() { - function r(e, n, t) { - function o(i3, f2) { - if (!n[i3]) { - if (!e[i3]) { - var c2 = "function" == typeof commonjsRequire && commonjsRequire; - if (!f2 && c2) - return c2(i3, true); - if (u) - return u(i3, true); - var a = new Error("Cannot find module '" + i3 + "'"); - throw a.code = "MODULE_NOT_FOUND", a; - } - var p = n[i3] = { exports: {} }; - e[i3][0].call(p.exports, function(r2) { - var n2 = e[i3][1][r2]; - return o(n2 || r2); - }, p, p.exports, r, e, n, t); - } - return n[i3].exports; - } - for (var u = "function" == typeof commonjsRequire && commonjsRequire, i2 = 0; i2 < t.length; i2++) - o(t[i2]); - return o; - } - return r; - }()({ 1: [function(require, module3, exports3) { - Object.defineProperty(exports3, "__esModule", { - value: true - }); - var _createClass = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - function _classCallCheck(instance2, Constructor) { - if (!(instance2 instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - var ELK2 = function() { - function ELK3() { - var _this = this; - var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref$defaultLayoutOpt = _ref.defaultLayoutOptions, defaultLayoutOptions = _ref$defaultLayoutOpt === void 0 ? {} : _ref$defaultLayoutOpt, _ref$algorithms = _ref.algorithms, algorithms = _ref$algorithms === void 0 ? ["layered", "stress", "mrtree", "radial", "force", "disco", "sporeOverlap", "sporeCompaction", "rectpacking"] : _ref$algorithms, workerFactory = _ref.workerFactory, workerUrl = _ref.workerUrl; - _classCallCheck(this, ELK3); - this.defaultLayoutOptions = defaultLayoutOptions; - this.initialized = false; - if (typeof workerUrl === "undefined" && typeof workerFactory === "undefined") { - throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'."); - } - var factory = workerFactory; - if (typeof workerUrl !== "undefined" && typeof workerFactory === "undefined") { - factory = function factory2(url) { - return new Worker(url); - }; - } - var worker = factory(workerUrl); - if (typeof worker.postMessage !== "function") { - throw new TypeError("Created worker does not provide the required 'postMessage' function."); - } - this.worker = new PromisedWorker(worker); - this.worker.postMessage({ - cmd: "register", - algorithms - }).then(function(r) { - return _this.initialized = true; - }).catch(console.err); - } - _createClass(ELK3, [{ - key: "layout", - value: function layout2(graph) { - var _ref2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref2$layoutOptions = _ref2.layoutOptions, layoutOptions = _ref2$layoutOptions === void 0 ? this.defaultLayoutOptions : _ref2$layoutOptions, _ref2$logging = _ref2.logging, logging = _ref2$logging === void 0 ? false : _ref2$logging, _ref2$measureExecutio = _ref2.measureExecutionTime, measureExecutionTime = _ref2$measureExecutio === void 0 ? false : _ref2$measureExecutio; - if (!graph) { - return Promise.reject(new Error("Missing mandatory parameter 'graph'.")); - } - return this.worker.postMessage({ - cmd: "layout", - graph, - layoutOptions, - options: { - logging, - measureExecutionTime - } - }); - } - }, { - key: "knownLayoutAlgorithms", - value: function knownLayoutAlgorithms() { - return this.worker.postMessage({ cmd: "algorithms" }); + }); + + // src/diagrams/gantt/parser/gantt.jison + var parser6, gantt_default; + var init_gantt = __esm({ + "src/diagrams/gantt/parser/gantt.jison"() { + "use strict"; + parser6 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 38, 40], $V1 = [1, 26], $V2 = [1, 27], $V3 = [1, 28], $V4 = [1, 29], $V5 = [1, 30], $V6 = [1, 31], $V7 = [1, 32], $V8 = [1, 33], $V9 = [1, 34], $Va = [1, 9], $Vb = [1, 10], $Vc = [1, 11], $Vd = [1, 12], $Ve = [1, 13], $Vf = [1, 14], $Vg = [1, 15], $Vh = [1, 16], $Vi = [1, 19], $Vj = [1, 20], $Vk = [1, 21], $Vl = [1, 22], $Vm = [1, 23], $Vn = [1, 25], $Vo = [1, 35]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "gantt": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NL": 10, "weekday": 11, "weekday_monday": 12, "weekday_tuesday": 13, "weekday_wednesday": 14, "weekday_thursday": 15, "weekday_friday": 16, "weekday_saturday": 17, "weekday_sunday": 18, "weekend": 19, "weekend_friday": 20, "weekend_saturday": 21, "dateFormat": 22, "inclusiveEndDates": 23, "topAxis": 24, "axisFormat": 25, "tickInterval": 26, "excludes": 27, "includes": 28, "todayMarker": 29, "title": 30, "acc_title": 31, "acc_title_value": 32, "acc_descr": 33, "acc_descr_value": 34, "acc_descr_multiline_value": 35, "section": 36, "clickStatement": 37, "taskTxt": 38, "taskData": 39, "click": 40, "callbackname": 41, "callbackargs": 42, "href": 43, "clickStatementDebug": 44, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 12: "weekday_monday", 13: "weekday_tuesday", 14: "weekday_wednesday", 15: "weekday_thursday", 16: "weekday_friday", 17: "weekday_saturday", 18: "weekday_sunday", 20: "weekend_friday", 21: "weekend_saturday", 22: "dateFormat", 23: "inclusiveEndDates", 24: "topAxis", 25: "axisFormat", 26: "tickInterval", 27: "excludes", 28: "includes", 29: "todayMarker", 30: "title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "section", 38: "taskTxt", 39: "taskData", 40: "click", 41: "callbackname", 42: "callbackargs", 43: "href" }, + productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [19, 1], [19, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 2], [37, 2], [37, 3], [37, 3], [37, 4], [37, 3], [37, 4], [37, 2], [44, 2], [44, 3], [44, 3], [44, 4], [44, 3], [44, 4], [44, 2]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 1: + return $$[$0 - 1]; + break; + case 2: + this.$ = []; + break; + case 3: + $$[$0 - 1].push($$[$0]); + this.$ = $$[$0 - 1]; + break; + case 4: + case 5: + this.$ = $$[$0]; + break; + case 6: + case 7: + this.$ = []; + break; + case 8: + yy.setWeekday("monday"); + break; + case 9: + yy.setWeekday("tuesday"); + break; + case 10: + yy.setWeekday("wednesday"); + break; + case 11: + yy.setWeekday("thursday"); + break; + case 12: + yy.setWeekday("friday"); + break; + case 13: + yy.setWeekday("saturday"); + break; + case 14: + yy.setWeekday("sunday"); + break; + case 15: + yy.setWeekend("friday"); + break; + case 16: + yy.setWeekend("saturday"); + break; + case 17: + yy.setDateFormat($$[$0].substr(11)); + this.$ = $$[$0].substr(11); + break; + case 18: + yy.enableInclusiveEndDates(); + this.$ = $$[$0].substr(18); + break; + case 19: + yy.TopAxis(); + this.$ = $$[$0].substr(8); + break; + case 20: + yy.setAxisFormat($$[$0].substr(11)); + this.$ = $$[$0].substr(11); + break; + case 21: + yy.setTickInterval($$[$0].substr(13)); + this.$ = $$[$0].substr(13); + break; + case 22: + yy.setExcludes($$[$0].substr(9)); + this.$ = $$[$0].substr(9); + break; + case 23: + yy.setIncludes($$[$0].substr(9)); + this.$ = $$[$0].substr(9); + break; + case 24: + yy.setTodayMarker($$[$0].substr(12)); + this.$ = $$[$0].substr(12); + break; + case 27: + yy.setDiagramTitle($$[$0].substr(6)); + this.$ = $$[$0].substr(6); + break; + case 28: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 29: + case 30: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 31: + yy.addSection($$[$0].substr(8)); + this.$ = $$[$0].substr(8); + break; + case 33: + yy.addTask($$[$0 - 1], $$[$0]); + this.$ = "task"; + break; + case 34: + this.$ = $$[$0 - 1]; + yy.setClickEvent($$[$0 - 1], $$[$0], null); + break; + case 35: + this.$ = $$[$0 - 2]; + yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); + break; + case 36: + this.$ = $$[$0 - 2]; + yy.setClickEvent($$[$0 - 2], $$[$0 - 1], null); + yy.setLink($$[$0 - 2], $$[$0]); + break; + case 37: + this.$ = $$[$0 - 3]; + yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); + yy.setLink($$[$0 - 3], $$[$0]); + break; + case 38: + this.$ = $$[$0 - 2]; + yy.setClickEvent($$[$0 - 2], $$[$0], null); + yy.setLink($$[$0 - 2], $$[$0 - 1]); + break; + case 39: + this.$ = $$[$0 - 3]; + yy.setClickEvent($$[$0 - 3], $$[$0 - 1], $$[$0]); + yy.setLink($$[$0 - 3], $$[$0 - 2]); + break; + case 40: + this.$ = $$[$0 - 1]; + yy.setLink($$[$0 - 1], $$[$0]); + break; + case 41: + case 47: + this.$ = $$[$0 - 1] + " " + $$[$0]; + break; + case 42: + case 43: + case 45: + this.$ = $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; + break; + case 44: + case 46: + this.$ = $$[$0 - 3] + " " + $$[$0 - 2] + " " + $$[$0 - 1] + " " + $$[$0]; + break; } - }, { - key: "knownLayoutOptions", - value: function knownLayoutOptions() { - return this.worker.postMessage({ cmd: "options" }); + }, "anonymous"), + table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o2($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 17, 12: $V1, 13: $V2, 14: $V3, 15: $V4, 16: $V5, 17: $V6, 18: $V7, 19: 18, 20: $V8, 21: $V9, 22: $Va, 23: $Vb, 24: $Vc, 25: $Vd, 26: $Ve, 27: $Vf, 28: $Vg, 29: $Vh, 30: $Vi, 31: $Vj, 33: $Vk, 35: $Vl, 36: $Vm, 37: 24, 38: $Vn, 40: $Vo }, o2($V0, [2, 7], { 1: [2, 1] }), o2($V0, [2, 3]), { 9: 36, 11: 17, 12: $V1, 13: $V2, 14: $V3, 15: $V4, 16: $V5, 17: $V6, 18: $V7, 19: 18, 20: $V8, 21: $V9, 22: $Va, 23: $Vb, 24: $Vc, 25: $Vd, 26: $Ve, 27: $Vf, 28: $Vg, 29: $Vh, 30: $Vi, 31: $Vj, 33: $Vk, 35: $Vl, 36: $Vm, 37: 24, 38: $Vn, 40: $Vo }, o2($V0, [2, 5]), o2($V0, [2, 6]), o2($V0, [2, 17]), o2($V0, [2, 18]), o2($V0, [2, 19]), o2($V0, [2, 20]), o2($V0, [2, 21]), o2($V0, [2, 22]), o2($V0, [2, 23]), o2($V0, [2, 24]), o2($V0, [2, 25]), o2($V0, [2, 26]), o2($V0, [2, 27]), { 32: [1, 37] }, { 34: [1, 38] }, o2($V0, [2, 30]), o2($V0, [2, 31]), o2($V0, [2, 32]), { 39: [1, 39] }, o2($V0, [2, 8]), o2($V0, [2, 9]), o2($V0, [2, 10]), o2($V0, [2, 11]), o2($V0, [2, 12]), o2($V0, [2, 13]), o2($V0, [2, 14]), o2($V0, [2, 15]), o2($V0, [2, 16]), { 41: [1, 40], 43: [1, 41] }, o2($V0, [2, 4]), o2($V0, [2, 28]), o2($V0, [2, 29]), o2($V0, [2, 33]), o2($V0, [2, 34], { 42: [1, 42], 43: [1, 43] }), o2($V0, [2, 40], { 41: [1, 44] }), o2($V0, [2, 35], { 43: [1, 45] }), o2($V0, [2, 36]), o2($V0, [2, 38], { 42: [1, 46] }), o2($V0, [2, 37]), o2($V0, [2, 39])], + defaultActions: {}, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - }, { - key: "knownLayoutCategories", - value: function knownLayoutCategories() { - return this.worker.postMessage({ cmd: "categories" }); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - }, { - key: "terminateWorker", - value: function terminateWorker() { - this.worker.terminate(); + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - }]); - return ELK3; - }(); - exports3.default = ELK2; - var PromisedWorker = function() { - function PromisedWorker2(worker) { - var _this2 = this; - _classCallCheck(this, PromisedWorker2); - if (worker === void 0) { - throw new Error("Missing mandatory parameter 'worker'."); - } - this.resolvers = {}; - this.worker = worker; - this.worker.onmessage = function(answer) { - setTimeout(function() { - _this2.receive(_this2, answer); - }, 0); - }; - } - _createClass(PromisedWorker2, [{ - key: "postMessage", - value: function postMessage(msg) { - var id2 = this.id || 0; - this.id = id2 + 1; - msg.id = id2; - var self2 = this; - return new Promise(function(resolve, reject) { - self2.resolvers[id2] = function(err, res) { - if (err) { - self2.convertGwtStyleError(err); - reject(err); - } else { - resolve(res); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); } - }; - self2.worker.postMessage(msg); - }); - } - }, { - key: "receive", - value: function receive(self2, answer) { - var json2 = answer.data; - var resolver2 = self2.resolvers[json2.id]; - if (resolver2) { - delete self2.resolvers[json2.id]; - if (json2.error) { - resolver2(json2.error); - } else { - resolver2(null, json2.data); } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); } - } - }, { - key: "terminate", - value: function terminate() { - if (this.worker.terminate) { - this.worker.terminate(); + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; } } - }, { - key: "convertGwtStyleError", - value: function convertGwtStyleError(err) { - if (!err) { - return; + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; } - var javaException = err["__java$exception"]; - if (javaException) { - if (javaException.cause && javaException.cause.backingJsObject) { - err.cause = javaException.cause.backingJsObject; - this.convertGwtStyleError(err.cause); - } - delete err["__java$exception"]; + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + this.begin("open_directive"); + return "open_directive"; + break; + case 1: + this.begin("acc_title"); + return 31; + break; + case 2: + this.popState(); + return "acc_title_value"; + break; + case 3: + this.begin("acc_descr"); + return 33; + break; + case 4: + this.popState(); + return "acc_descr_value"; + break; + case 5: + this.begin("acc_descr_multiline"); + break; + case 6: + this.popState(); + break; + case 7: + return "acc_descr_multiline_value"; + break; + case 8: + break; + case 9: + break; + case 10: + break; + case 11: + return 10; + break; + case 12: + break; + case 13: + break; + case 14: + this.begin("href"); + break; + case 15: + this.popState(); + break; + case 16: + return 43; + break; + case 17: + this.begin("callbackname"); + break; + case 18: + this.popState(); + break; + case 19: + this.popState(); + this.begin("callbackargs"); + break; + case 20: + return 41; + break; + case 21: + this.popState(); + break; + case 22: + return 42; + break; + case 23: + this.begin("click"); + break; + case 24: + this.popState(); + break; + case 25: + return 40; + break; + case 26: + return 4; + break; + case 27: + return 22; + break; + case 28: + return 23; + break; + case 29: + return 24; + break; + case 30: + return 25; + break; + case 31: + return 26; + break; + case 32: + return 28; + break; + case 33: + return 27; + break; + case 34: + return 29; + break; + case 35: + return 12; + break; + case 36: + return 13; + break; + case 37: + return 14; + break; + case 38: + return 15; + break; + case 39: + return 16; + break; + case 40: + return 17; + break; + case 41: + return 18; + break; + case 42: + return 20; + break; + case 43: + return 21; + break; + case 44: + return "date"; + break; + case 45: + return 30; + break; + case 46: + return "accDescription"; + break; + case 47: + return 36; + break; + case 48: + return 38; + break; + case 49: + return 39; + break; + case 50: + return ":"; + break; + case 51: + return 6; + break; + case 52: + return "INVALID"; + break; + } + }, "anonymous"), + rules: [/^(?:%%\{)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%(?!\{)*[^\n]*)/i, /^(?:[^\}]%%*[^\n]*)/i, /^(?:%%*[^\n]*[\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:%[^\n]*)/i, /^(?:href[\s]+["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:call[\s]+)/i, /^(?:\([\s]*\))/i, /^(?:\()/i, /^(?:[^(]*)/i, /^(?:\))/i, /^(?:[^)]*)/i, /^(?:click[\s]+)/i, /^(?:[\s\n])/i, /^(?:[^\s\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:inclusiveEndDates\b)/i, /^(?:topAxis\b)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:tickInterval\s[^#\n;]+)/i, /^(?:includes\s[^#\n;]+)/i, /^(?:excludes\s[^#\n;]+)/i, /^(?:todayMarker\s[^\n;]+)/i, /^(?:weekday\s+monday\b)/i, /^(?:weekday\s+tuesday\b)/i, /^(?:weekday\s+wednesday\b)/i, /^(?:weekday\s+thursday\b)/i, /^(?:weekday\s+friday\b)/i, /^(?:weekday\s+saturday\b)/i, /^(?:weekday\s+sunday\b)/i, /^(?:weekend\s+friday\b)/i, /^(?:weekend\s+saturday\b)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accDescription\s[^#\n;]+)/i, /^(?:section\s[^\n]+)/i, /^(?:[^:\n]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], + conditions: { "acc_descr_multiline": { "rules": [6, 7], "inclusive": false }, "acc_descr": { "rules": [4], "inclusive": false }, "acc_title": { "rules": [2], "inclusive": false }, "callbackargs": { "rules": [21, 22], "inclusive": false }, "callbackname": { "rules": [18, 19, 20], "inclusive": false }, "href": { "rules": [15, 16], "inclusive": false }, "click": { "rules": [24, 25], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 17, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser6.parser = parser6; + gantt_default = parser6; + } + }); + + // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/isoWeek.js + var require_isoWeek = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/isoWeek.js"(exports2, module2) { + "use strict"; + !function(e3, t4) { + "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t4() : "function" == typeof define && define.amd ? define(t4) : (e3 = "undefined" != typeof globalThis ? globalThis : e3 || self).dayjs_plugin_isoWeek = t4(); + }(exports2, function() { + "use strict"; + var e3 = "day"; + return function(t4, i2, s2) { + var a2 = /* @__PURE__ */ __name(function(t5) { + return t5.add(4 - t5.isoWeekday(), e3); + }, "a"), d2 = i2.prototype; + d2.isoWeekYear = function() { + return a2(this).year(); + }, d2.isoWeek = function(t5) { + if (!this.$utils().u(t5)) return this.add(7 * (t5 - this.isoWeek()), e3); + var i3, d3, n3, o2, r2 = a2(this), u2 = (i3 = this.isoWeekYear(), d3 = this.$u, n3 = (d3 ? s2.utc : s2)().year(i3).startOf("year"), o2 = 4 - n3.isoWeekday(), n3.isoWeekday() > 4 && (o2 += 7), n3.add(o2, e3)); + return r2.diff(u2, "week") + 1; + }, d2.isoWeekday = function(e4) { + return this.$utils().u(e4) ? this.day() || 7 : this.day(this.day() % 7 ? e4 : e4 - 7); + }; + var n2 = d2.startOf; + d2.startOf = function(e4, t5) { + var i3 = this.$utils(), s3 = !!i3.u(t5) || t5; + return "isoweek" === i3.p(e4) ? s3 ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : n2.bind(this)(e4, t5); + }; + }; + }); + } + }); + + // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/customParseFormat.js + var require_customParseFormat = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/customParseFormat.js"(exports2, module2) { + "use strict"; + !function(e3, t4) { + "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t4() : "function" == typeof define && define.amd ? define(t4) : (e3 = "undefined" != typeof globalThis ? globalThis : e3 || self).dayjs_plugin_customParseFormat = t4(); + }(exports2, function() { + "use strict"; + var e3 = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t4 = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n2 = /\d\d/, r2 = /\d\d?/, i2 = /\d*[^-_:/,()\s\d]+/, o2 = {}, s2 = /* @__PURE__ */ __name(function(e4) { + return (e4 = +e4) + (e4 > 68 ? 1900 : 2e3); + }, "s"); + var a2 = /* @__PURE__ */ __name(function(e4) { + return function(t5) { + this[e4] = +t5; + }; + }, "a"), f3 = [/[+-]\d\d:?(\d\d)?|Z/, function(e4) { + (this.zone || (this.zone = {})).offset = function(e6) { + if (!e6) return 0; + if ("Z" === e6) return 0; + var t5 = e6.match(/([+-]|\d\d)/g), n3 = 60 * t5[1] + (+t5[2] || 0); + return 0 === n3 ? 0 : "+" === t5[0] ? -n3 : n3; + }(e4); + }], h2 = /* @__PURE__ */ __name(function(e4) { + var t5 = o2[e4]; + return t5 && (t5.indexOf ? t5 : t5.s.concat(t5.f)); + }, "h"), u2 = /* @__PURE__ */ __name(function(e4, t5) { + var n3, r3 = o2.meridiem; + if (r3) { + for (var i3 = 1; i3 <= 24; i3 += 1) if (e4.indexOf(r3(i3, 0, t5)) > -1) { + n3 = i3 > 12; + break; } - }]); - return PromisedWorker2; - }(); - }, {}], 2: [function(require, module3, exports3) { - (function(global2) { - (function() { - var $wnd; - if (typeof window !== "undefined") - $wnd = window; - else if (typeof global2 !== "undefined") - $wnd = global2; - else if (typeof self !== "undefined") - $wnd = self; - var o; - function nb() { - } - function xb() { - } - function Fd() { - } - function hh() { - } - function lq() { - } - function Nq() { - } - function ir() { - } - function Ws() { - } - function Zw() { - } - function jx() { - } - function rx() { - } - function sx() { - } - function My() { - } - function bA() { - } - function mA() { - } - function tA() { - } - function aB() { - } - function dB() { - } - function jB() { - } - function dC() { - } - function keb() { - } - function geb() { - } - function oeb() { - } - function iob() { - } - function Job() { - } - function Rob() { - } - function apb() { - } - function ipb() { - } - function nrb() { - } - function wrb() { - } - function Brb() { - } - function Prb() { - } - function ltb() { - } - function svb() { - } - function xvb() { - } - function zvb() { - } - function $xb() { - } - function Gzb() { - } - function NAb() { - } - function VAb() { - } - function rBb() { - } - function RBb() { - } - function TBb() { - } - function XBb() { - } - function ZBb() { - } - function _Bb() { - } - function bCb() { - } - function dCb() { - } - function fCb() { - } - function jCb() { - } - function rCb() { - } - function uCb() { - } - function wCb() { - } - function yCb() { - } - function ACb() { - } - function ECb() { - } - function FEb() { - } - function IEb() { - } - function KEb() { - } - function MEb() { - } - function gFb() { - } - function FFb() { - } - function JFb() { - } - function xGb() { - } - function AGb() { - } - function YGb() { - } - function oHb() { - } - function tHb() { - } - function xHb() { - } - function pIb() { - } - function BJb() { - } - function kLb() { - } - function mLb() { - } - function oLb() { - } - function qLb() { - } - function FLb() { - } - function JLb() { - } - function KMb() { - } - function MMb() { - } - function OMb() { - } - function YMb() { - } - function MNb() { - } - function ONb() { - } - function aOb() { - } - function eOb() { - } - function xOb() { - } - function BOb() { - } - function DOb() { - } - function FOb() { - } - function IOb() { - } - function MOb() { - } - function POb() { - } - function UOb() { - } - function ZOb() { - } - function cPb() { - } - function gPb() { - } - function nPb() { - } - function qPb() { - } - function tPb() { - } - function wPb() { - } - function CPb() { - } - function qQb() { - } - function GQb() { - } - function bRb() { - } - function gRb() { - } - function kRb() { - } - function pRb() { - } - function wRb() { - } - function xSb() { - } - function TSb() { - } - function VSb() { - } - function XSb() { - } - function ZSb() { - } - function _Sb() { - } - function tTb() { - } - function DTb() { - } - function FTb() { - } - function FXb() { - } - function hXb() { - } - function hWb() { - } - function mWb() { - } - function CVb() { - } - function XXb() { - } - function $Xb() { - } - function bYb() { - } - function lYb() { - } - function FYb() { - } - function XYb() { - } - function aZb() { - } - function SZb() { - } - function ZZb() { - } - function Z_b() { - } - function j_b() { - } - function j$b() { - } - function b$b() { - } - function f$b() { - } - function n$b() { - } - function K_b() { - } - function V_b() { - } - function b0b() { - } - function l0b() { - } - function X1b() { - } - function _1b() { - } - function x3b() { - } - function r4b() { - } - function w4b() { - } - function A4b() { - } - function E4b() { - } - function I4b() { - } - function M4b() { - } - function o5b() { - } - function q5b() { - } - function w5b() { - } - function A5b() { - } - function E5b() { - } - function h6b() { - } - function j6b() { - } - function l6b() { - } - function q6b() { - } - function v6b() { - } - function y6b() { - } - function G6b() { - } - function K6b() { - } - function N6b() { - } - function P6b() { - } - function R6b() { + } else n3 = e4 === (t5 ? "pm" : "PM"); + return n3; + }, "u"), d2 = { A: [i2, function(e4) { + this.afternoon = u2(e4, false); + }], a: [i2, function(e4) { + this.afternoon = u2(e4, true); + }], S: [/\d/, function(e4) { + this.milliseconds = 100 * +e4; + }], SS: [n2, function(e4) { + this.milliseconds = 10 * +e4; + }], SSS: [/\d{3}/, function(e4) { + this.milliseconds = +e4; + }], s: [r2, a2("seconds")], ss: [r2, a2("seconds")], m: [r2, a2("minutes")], mm: [r2, a2("minutes")], H: [r2, a2("hours")], h: [r2, a2("hours")], HH: [r2, a2("hours")], hh: [r2, a2("hours")], D: [r2, a2("day")], DD: [n2, a2("day")], Do: [i2, function(e4) { + var t5 = o2.ordinal, n3 = e4.match(/\d+/); + if (this.day = n3[0], t5) for (var r3 = 1; r3 <= 31; r3 += 1) t5(r3).replace(/\[|\]/g, "") === e4 && (this.day = r3); + }], M: [r2, a2("month")], MM: [n2, a2("month")], MMM: [i2, function(e4) { + var t5 = h2("months"), n3 = (h2("monthsShort") || t5.map(function(e6) { + return e6.slice(0, 3); + })).indexOf(e4) + 1; + if (n3 < 1) throw new Error(); + this.month = n3 % 12 || n3; + }], MMMM: [i2, function(e4) { + var t5 = h2("months").indexOf(e4) + 1; + if (t5 < 1) throw new Error(); + this.month = t5 % 12 || t5; + }], Y: [/[+-]?\d+/, a2("year")], YY: [n2, function(e4) { + this.year = s2(e4); + }], YYYY: [/\d{4}/, a2("year")], Z: f3, ZZ: f3 }; + function c3(n3) { + var r3, i3; + r3 = n3, i3 = o2 && o2.formats; + for (var s3 = (n3 = r3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t5, n4, r4) { + var o3 = r4 && r4.toUpperCase(); + return n4 || i3[r4] || e3[r4] || i3[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e4, t6, n5) { + return t6 || n5.slice(1); + }); + })).match(t4), a3 = s3.length, f4 = 0; f4 < a3; f4 += 1) { + var h3 = s3[f4], u3 = d2[h3], c4 = u3 && u3[0], l2 = u3 && u3[1]; + s3[f4] = l2 ? { regex: c4, parser: l2 } : h3.replace(/^\[|\]$/g, ""); + } + return function(e4) { + for (var t5 = {}, n4 = 0, r4 = 0; n4 < a3; n4 += 1) { + var i4 = s3[n4]; + if ("string" == typeof i4) r4 += i4.length; + else { + var o3 = i4.regex, f5 = i4.parser, h4 = e4.slice(r4), u4 = o3.exec(h4)[0]; + f5.call(t5, u4), e4 = e4.replace(u4, ""); + } } - function b7b() { + return function(e6) { + var t6 = e6.afternoon; + if (void 0 !== t6) { + var n5 = e6.hours; + t6 ? n5 < 12 && (e6.hours += 12) : 12 === n5 && (e6.hours = 0), delete e6.afternoon; + } + }(t5), t5; + }; + } + __name(c3, "c"); + return function(e4, t5, n3) { + n3.p.customParseFormat = true, e4 && e4.parseTwoDigitYear && (s2 = e4.parseTwoDigitYear); + var r3 = t5.prototype, i3 = r3.parse; + r3.parse = function(e6) { + var t6 = e6.date, r4 = e6.utc, s3 = e6.args; + this.$u = r4; + var a3 = s3[1]; + if ("string" == typeof a3) { + var f4 = true === s3[2], h3 = true === s3[3], u3 = f4 || h3, d3 = s3[2]; + h3 && (d3 = s3[2]), o2 = this.$locale(), !f4 && d3 && (o2 = n3.Ls[d3]), this.$d = function(e7, t7, n4) { + try { + if (["x", "X"].indexOf(t7) > -1) return new Date(("X" === t7 ? 1e3 : 1) * e7); + var r5 = c3(t7)(e7), i4 = r5.year, o3 = r5.month, s4 = r5.day, a4 = r5.hours, f5 = r5.minutes, h4 = r5.seconds, u4 = r5.milliseconds, d4 = r5.zone, l3 = /* @__PURE__ */ new Date(), m3 = s4 || (i4 || o3 ? 1 : l3.getDate()), M3 = i4 || l3.getFullYear(), Y3 = 0; + i4 && !o3 || (Y3 = o3 > 0 ? o3 - 1 : l3.getMonth()); + var p3 = a4 || 0, v3 = f5 || 0, D3 = h4 || 0, g2 = u4 || 0; + return d4 ? new Date(Date.UTC(M3, Y3, m3, p3, v3, D3, g2 + 60 * d4.offset * 1e3)) : n4 ? new Date(Date.UTC(M3, Y3, m3, p3, v3, D3, g2)) : new Date(M3, Y3, m3, p3, v3, D3, g2); + } catch (e8) { + return /* @__PURE__ */ new Date(""); + } + }(t6, a3, r4), this.init(), d3 && true !== d3 && (this.$L = this.locale(d3).$L), u3 && t6 != this.format(a3) && (this.$d = /* @__PURE__ */ new Date("")), o2 = {}; + } else if (a3 instanceof Array) for (var l2 = a3.length, m2 = 1; m2 <= l2; m2 += 1) { + s3[1] = a3[m2 - 1]; + var M2 = n3.apply(this, s3); + if (M2.isValid()) { + this.$d = M2.$d, this.$L = M2.$L, this.init(); + break; + } + m2 === l2 && (this.$d = /* @__PURE__ */ new Date("")); } - function f7b() { + else i3.call(this, e6); + }; + }; + }); + } + }); + + // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/advancedFormat.js + var require_advancedFormat = __commonJS({ + "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/advancedFormat.js"(exports2, module2) { + "use strict"; + !function(e3, t4) { + "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t4() : "function" == typeof define && define.amd ? define(t4) : (e3 = "undefined" != typeof globalThis ? globalThis : e3 || self).dayjs_plugin_advancedFormat = t4(); + }(exports2, function() { + "use strict"; + return function(e3, t4) { + var r2 = t4.prototype, n2 = r2.format; + r2.format = function(e4) { + var t5 = this, r3 = this.$locale(); + if (!this.isValid()) return n2.bind(this)(e4); + var s2 = this.$utils(), a2 = (e4 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(e6) { + switch (e6) { + case "Q": + return Math.ceil((t5.$M + 1) / 3); + case "Do": + return r3.ordinal(t5.$D); + case "gggg": + return t5.weekYear(); + case "GGGG": + return t5.isoWeekYear(); + case "wo": + return r3.ordinal(t5.week(), "W"); + case "w": + case "ww": + return s2.s(t5.week(), "w" === e6 ? 1 : 2, "0"); + case "W": + case "WW": + return s2.s(t5.isoWeek(), "W" === e6 ? 1 : 2, "0"); + case "k": + case "kk": + return s2.s(String(0 === t5.$H ? 24 : t5.$H), "k" === e6 ? 1 : 2, "0"); + case "X": + return Math.floor(t5.$d.getTime() / 1e3); + case "x": + return t5.$d.getTime(); + case "z": + return "[" + t5.offsetName() + "]"; + case "zzz": + return "[" + t5.offsetName("long") + "]"; + default: + return e6; + } + }); + return n2.bind(this)(a2); + }; + }; + }); + } + }); + + // src/diagrams/gantt/ganttDb.js + function getTaskTags(data5, task, tags2) { + let matchFound = true; + while (matchFound) { + matchFound = false; + tags2.forEach(function(t4) { + const pattern = "^\\s*" + t4 + "\\s*$"; + const regex = new RegExp(pattern); + if (data5[0].match(regex)) { + task[t4] = true; + data5.shift(1); + matchFound = true; + } + }); + } + } + var import_sanitize_url4, import_dayjs2, import_isoWeek, import_customParseFormat, import_advancedFormat, WEEKEND_START_DAY, dateFormat, axisFormat, tickInterval, todayMarker, includes2, excludes, links, sections, tasks, currentSection, displayMode, tags, funs2, inclusiveEndDates, topAxis, weekday, weekend, lastOrder, clear12, setAxisFormat, getAxisFormat, setTickInterval, getTickInterval, setTodayMarker, getTodayMarker, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, enableTopAxis, topAxisEnabled, setDisplayMode, getDisplayMode, getDateFormat, setIncludes, getIncludes, setExcludes, getExcludes, getLinks, addSection, getSections, getTasks, isInvalidDate, setWeekday, getWeekday, setWeekend, checkTaskDates, fixTaskDates, getStartDate, parseDuration, getEndDate, taskCnt, parseId, compileData, parseData, lastTask, lastTaskID, rawTasks, taskDb, addTask, findTaskById, addTaskOrg, compileTasks, setLink2, setClass2, setClickFun2, pushFun, setClickEvent2, bindFunctions2, ganttDb_default; + var init_ganttDb = __esm({ + "src/diagrams/gantt/ganttDb.js"() { + "use strict"; + import_sanitize_url4 = __toESM(require_dist(), 1); + import_dayjs2 = __toESM(require_dayjs_min(), 1); + import_isoWeek = __toESM(require_isoWeek(), 1); + import_customParseFormat = __toESM(require_customParseFormat(), 1); + import_advancedFormat = __toESM(require_advancedFormat(), 1); + init_logger(); + init_diagramAPI(); + init_utils2(); + init_commonDb(); + import_dayjs2.default.extend(import_isoWeek.default); + import_dayjs2.default.extend(import_customParseFormat.default); + import_dayjs2.default.extend(import_advancedFormat.default); + WEEKEND_START_DAY = { friday: 5, saturday: 6 }; + dateFormat = ""; + axisFormat = ""; + tickInterval = void 0; + todayMarker = ""; + includes2 = []; + excludes = []; + links = /* @__PURE__ */ new Map(); + sections = []; + tasks = []; + currentSection = ""; + displayMode = ""; + tags = ["active", "done", "crit", "milestone"]; + funs2 = []; + inclusiveEndDates = false; + topAxis = false; + weekday = "sunday"; + weekend = "saturday"; + lastOrder = 0; + clear12 = /* @__PURE__ */ __name(function() { + sections = []; + tasks = []; + currentSection = ""; + funs2 = []; + taskCnt = 0; + lastTask = void 0; + lastTaskID = void 0; + rawTasks = []; + dateFormat = ""; + axisFormat = ""; + displayMode = ""; + tickInterval = void 0; + todayMarker = ""; + includes2 = []; + excludes = []; + inclusiveEndDates = false; + topAxis = false; + lastOrder = 0; + links = /* @__PURE__ */ new Map(); + clear(); + weekday = "sunday"; + weekend = "saturday"; + }, "clear"); + setAxisFormat = /* @__PURE__ */ __name(function(txt) { + axisFormat = txt; + }, "setAxisFormat"); + getAxisFormat = /* @__PURE__ */ __name(function() { + return axisFormat; + }, "getAxisFormat"); + setTickInterval = /* @__PURE__ */ __name(function(txt) { + tickInterval = txt; + }, "setTickInterval"); + getTickInterval = /* @__PURE__ */ __name(function() { + return tickInterval; + }, "getTickInterval"); + setTodayMarker = /* @__PURE__ */ __name(function(txt) { + todayMarker = txt; + }, "setTodayMarker"); + getTodayMarker = /* @__PURE__ */ __name(function() { + return todayMarker; + }, "getTodayMarker"); + setDateFormat = /* @__PURE__ */ __name(function(txt) { + dateFormat = txt; + }, "setDateFormat"); + enableInclusiveEndDates = /* @__PURE__ */ __name(function() { + inclusiveEndDates = true; + }, "enableInclusiveEndDates"); + endDatesAreInclusive = /* @__PURE__ */ __name(function() { + return inclusiveEndDates; + }, "endDatesAreInclusive"); + enableTopAxis = /* @__PURE__ */ __name(function() { + topAxis = true; + }, "enableTopAxis"); + topAxisEnabled = /* @__PURE__ */ __name(function() { + return topAxis; + }, "topAxisEnabled"); + setDisplayMode = /* @__PURE__ */ __name(function(txt) { + displayMode = txt; + }, "setDisplayMode"); + getDisplayMode = /* @__PURE__ */ __name(function() { + return displayMode; + }, "getDisplayMode"); + getDateFormat = /* @__PURE__ */ __name(function() { + return dateFormat; + }, "getDateFormat"); + setIncludes = /* @__PURE__ */ __name(function(txt) { + includes2 = txt.toLowerCase().split(/[\s,]+/); + }, "setIncludes"); + getIncludes = /* @__PURE__ */ __name(function() { + return includes2; + }, "getIncludes"); + setExcludes = /* @__PURE__ */ __name(function(txt) { + excludes = txt.toLowerCase().split(/[\s,]+/); + }, "setExcludes"); + getExcludes = /* @__PURE__ */ __name(function() { + return excludes; + }, "getExcludes"); + getLinks = /* @__PURE__ */ __name(function() { + return links; + }, "getLinks"); + addSection = /* @__PURE__ */ __name(function(txt) { + currentSection = txt; + sections.push(txt); + }, "addSection"); + getSections = /* @__PURE__ */ __name(function() { + return sections; + }, "getSections"); + getTasks = /* @__PURE__ */ __name(function() { + let allItemsProcessed = compileTasks(); + const maxDepth = 10; + let iterationCount = 0; + while (!allItemsProcessed && iterationCount < maxDepth) { + allItemsProcessed = compileTasks(); + iterationCount++; + } + tasks = rawTasks; + return tasks; + }, "getTasks"); + isInvalidDate = /* @__PURE__ */ __name(function(date2, dateFormat2, excludes2, includes3) { + if (includes3.includes(date2.format(dateFormat2.trim()))) { + return false; + } + if (excludes2.includes("weekends") && (date2.isoWeekday() === WEEKEND_START_DAY[weekend] || date2.isoWeekday() === WEEKEND_START_DAY[weekend] + 1)) { + return true; + } + if (excludes2.includes(date2.format("dddd").toLowerCase())) { + return true; + } + return excludes2.includes(date2.format(dateFormat2.trim())); + }, "isInvalidDate"); + setWeekday = /* @__PURE__ */ __name(function(txt) { + weekday = txt; + }, "setWeekday"); + getWeekday = /* @__PURE__ */ __name(function() { + return weekday; + }, "getWeekday"); + setWeekend = /* @__PURE__ */ __name(function(startDay) { + weekend = startDay; + }, "setWeekend"); + checkTaskDates = /* @__PURE__ */ __name(function(task, dateFormat2, excludes2, includes3) { + if (!excludes2.length || task.manualEndTime) { + return; + } + let startTime; + if (task.startTime instanceof Date) { + startTime = (0, import_dayjs2.default)(task.startTime); + } else { + startTime = (0, import_dayjs2.default)(task.startTime, dateFormat2, true); + } + startTime = startTime.add(1, "d"); + let originalEndTime; + if (task.endTime instanceof Date) { + originalEndTime = (0, import_dayjs2.default)(task.endTime); + } else { + originalEndTime = (0, import_dayjs2.default)(task.endTime, dateFormat2, true); + } + const [fixedEndTime, renderEndTime] = fixTaskDates( + startTime, + originalEndTime, + dateFormat2, + excludes2, + includes3 + ); + task.endTime = fixedEndTime.toDate(); + task.renderEndTime = renderEndTime; + }, "checkTaskDates"); + fixTaskDates = /* @__PURE__ */ __name(function(startTime, endTime, dateFormat2, excludes2, includes3) { + let invalid = false; + let renderEndTime = null; + while (startTime <= endTime) { + if (!invalid) { + renderEndTime = endTime.toDate(); + } + invalid = isInvalidDate(startTime, dateFormat2, excludes2, includes3); + if (invalid) { + endTime = endTime.add(1, "d"); + } + startTime = startTime.add(1, "d"); + } + return [endTime, renderEndTime]; + }, "fixTaskDates"); + getStartDate = /* @__PURE__ */ __name(function(prevTime, dateFormat2, str2) { + str2 = str2.trim(); + const afterRePattern = /^after\s+(?[\d\w- ]+)/; + const afterStatement = afterRePattern.exec(str2); + if (afterStatement !== null) { + let latestTask = null; + for (const id26 of afterStatement.groups.ids.split(" ")) { + let task = findTaskById(id26); + if (task !== void 0 && (!latestTask || task.endTime > latestTask.endTime)) { + latestTask = task; + } + } + if (latestTask) { + return latestTask.endTime; + } + const today = /* @__PURE__ */ new Date(); + today.setHours(0, 0, 0, 0); + return today; + } + let mDate = (0, import_dayjs2.default)(str2, dateFormat2.trim(), true); + if (mDate.isValid()) { + return mDate.toDate(); + } else { + log.debug("Invalid date:" + str2); + log.debug("With date format:" + dateFormat2.trim()); + const d2 = new Date(str2); + if (d2 === void 0 || isNaN(d2.getTime()) || // WebKit browsers can mis-parse invalid dates to be ridiculously + // huge numbers, e.g. new Date('202304') gets parsed as January 1, 202304. + // This can cause virtually infinite loops while rendering, so for the + // purposes of Gantt charts we'll just treat any date beyond 10,000 AD/BC as + // invalid. + d2.getFullYear() < -1e4 || d2.getFullYear() > 1e4) { + throw new Error("Invalid date:" + str2); + } + return d2; + } + }, "getStartDate"); + parseDuration = /* @__PURE__ */ __name(function(str2) { + const statement = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(str2.trim()); + if (statement !== null) { + return [Number.parseFloat(statement[1]), statement[2]]; + } + return [NaN, "ms"]; + }, "parseDuration"); + getEndDate = /* @__PURE__ */ __name(function(prevTime, dateFormat2, str2, inclusive = false) { + str2 = str2.trim(); + const untilRePattern = /^until\s+(?[\d\w- ]+)/; + const untilStatement = untilRePattern.exec(str2); + if (untilStatement !== null) { + let earliestTask = null; + for (const id26 of untilStatement.groups.ids.split(" ")) { + let task = findTaskById(id26); + if (task !== void 0 && (!earliestTask || task.startTime < earliestTask.startTime)) { + earliestTask = task; + } + } + if (earliestTask) { + return earliestTask.startTime; + } + const today = /* @__PURE__ */ new Date(); + today.setHours(0, 0, 0, 0); + return today; + } + let parsedDate = (0, import_dayjs2.default)(str2, dateFormat2.trim(), true); + if (parsedDate.isValid()) { + if (inclusive) { + parsedDate = parsedDate.add(1, "d"); + } + return parsedDate.toDate(); + } + let endTime = (0, import_dayjs2.default)(prevTime); + const [durationValue, durationUnit] = parseDuration(str2); + if (!Number.isNaN(durationValue)) { + const newEndTime = endTime.add(durationValue, durationUnit); + if (newEndTime.isValid()) { + endTime = newEndTime; + } + } + return endTime.toDate(); + }, "getEndDate"); + taskCnt = 0; + parseId = /* @__PURE__ */ __name(function(idStr) { + if (idStr === void 0) { + taskCnt = taskCnt + 1; + return "task" + taskCnt; + } + return idStr; + }, "parseId"); + compileData = /* @__PURE__ */ __name(function(prevTask, dataStr) { + let ds; + if (dataStr.substr(0, 1) === ":") { + ds = dataStr.substr(1, dataStr.length); + } else { + ds = dataStr; + } + const data5 = ds.split(","); + const task = {}; + getTaskTags(data5, task, tags); + for (let i2 = 0; i2 < data5.length; i2++) { + data5[i2] = data5[i2].trim(); + } + let endTimeData = ""; + switch (data5.length) { + case 1: + task.id = parseId(); + task.startTime = prevTask.endTime; + endTimeData = data5[0]; + break; + case 2: + task.id = parseId(); + task.startTime = getStartDate(void 0, dateFormat, data5[0]); + endTimeData = data5[1]; + break; + case 3: + task.id = parseId(data5[0]); + task.startTime = getStartDate(void 0, dateFormat, data5[1]); + endTimeData = data5[2]; + break; + default: + } + if (endTimeData) { + task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates); + task.manualEndTime = (0, import_dayjs2.default)(endTimeData, "YYYY-MM-DD", true).isValid(); + checkTaskDates(task, dateFormat, excludes, includes2); + } + return task; + }, "compileData"); + parseData = /* @__PURE__ */ __name(function(prevTaskId, dataStr) { + let ds; + if (dataStr.substr(0, 1) === ":") { + ds = dataStr.substr(1, dataStr.length); + } else { + ds = dataStr; + } + const data5 = ds.split(","); + const task = {}; + getTaskTags(data5, task, tags); + for (let i2 = 0; i2 < data5.length; i2++) { + data5[i2] = data5[i2].trim(); + } + switch (data5.length) { + case 1: + task.id = parseId(); + task.startTime = { + type: "prevTaskEnd", + id: prevTaskId + }; + task.endTime = { + data: data5[0] + }; + break; + case 2: + task.id = parseId(); + task.startTime = { + type: "getStartDate", + startData: data5[0] + }; + task.endTime = { + data: data5[1] + }; + break; + case 3: + task.id = parseId(data5[0]); + task.startTime = { + type: "getStartDate", + startData: data5[1] + }; + task.endTime = { + data: data5[2] + }; + break; + default: + } + return task; + }, "parseData"); + rawTasks = []; + taskDb = {}; + addTask = /* @__PURE__ */ __name(function(descr, data5) { + const rawTask = { + section: currentSection, + type: currentSection, + processed: false, + manualEndTime: false, + renderEndTime: null, + raw: { data: data5 }, + task: descr, + classes: [] + }; + const taskInfo = parseData(lastTaskID, data5); + rawTask.raw.startTime = taskInfo.startTime; + rawTask.raw.endTime = taskInfo.endTime; + rawTask.id = taskInfo.id; + rawTask.prevTaskId = lastTaskID; + rawTask.active = taskInfo.active; + rawTask.done = taskInfo.done; + rawTask.crit = taskInfo.crit; + rawTask.milestone = taskInfo.milestone; + rawTask.order = lastOrder; + lastOrder++; + const pos = rawTasks.push(rawTask); + lastTaskID = rawTask.id; + taskDb[rawTask.id] = pos - 1; + }, "addTask"); + findTaskById = /* @__PURE__ */ __name(function(id26) { + const pos = taskDb[id26]; + return rawTasks[pos]; + }, "findTaskById"); + addTaskOrg = /* @__PURE__ */ __name(function(descr, data5) { + const newTask = { + section: currentSection, + type: currentSection, + description: descr, + task: descr, + classes: [] + }; + const taskInfo = compileData(lastTask, data5); + newTask.startTime = taskInfo.startTime; + newTask.endTime = taskInfo.endTime; + newTask.id = taskInfo.id; + newTask.active = taskInfo.active; + newTask.done = taskInfo.done; + newTask.crit = taskInfo.crit; + newTask.milestone = taskInfo.milestone; + lastTask = newTask; + tasks.push(newTask); + }, "addTaskOrg"); + compileTasks = /* @__PURE__ */ __name(function() { + const compileTask = /* @__PURE__ */ __name(function(pos) { + const task = rawTasks[pos]; + let startTime = ""; + switch (rawTasks[pos].raw.startTime.type) { + case "prevTaskEnd": { + const prevTask = findTaskById(task.prevTaskId); + task.startTime = prevTask.endTime; + break; } - function j7b() { + case "getStartDate": + startTime = getStartDate(void 0, dateFormat, rawTasks[pos].raw.startTime.startData); + if (startTime) { + rawTasks[pos].startTime = startTime; + } + break; + } + if (rawTasks[pos].startTime) { + rawTasks[pos].endTime = getEndDate( + rawTasks[pos].startTime, + dateFormat, + rawTasks[pos].raw.endTime.data, + inclusiveEndDates + ); + if (rawTasks[pos].endTime) { + rawTasks[pos].processed = true; + rawTasks[pos].manualEndTime = (0, import_dayjs2.default)( + rawTasks[pos].raw.endTime.data, + "YYYY-MM-DD", + true + ).isValid(); + checkTaskDates(rawTasks[pos], dateFormat, excludes, includes2); + } + } + return rawTasks[pos].processed; + }, "compileTask"); + let allProcessed = true; + for (const [i2, rawTask] of rawTasks.entries()) { + compileTask(i2); + allProcessed = allProcessed && rawTask.processed; + } + return allProcessed; + }, "compileTasks"); + setLink2 = /* @__PURE__ */ __name(function(ids, _linkStr) { + let linkStr = _linkStr; + if (getConfig2().securityLevel !== "loose") { + linkStr = (0, import_sanitize_url4.sanitizeUrl)(_linkStr); + } + ids.split(",").forEach(function(id26) { + let rawTask = findTaskById(id26); + if (rawTask !== void 0) { + pushFun(id26, () => { + window.open(linkStr, "_self"); + }); + links.set(id26, linkStr); + } + }); + setClass2(ids, "clickable"); + }, "setLink"); + setClass2 = /* @__PURE__ */ __name(function(ids, className) { + ids.split(",").forEach(function(id26) { + let rawTask = findTaskById(id26); + if (rawTask !== void 0) { + rawTask.classes.push(className); + } + }); + }, "setClass"); + setClickFun2 = /* @__PURE__ */ __name(function(id26, functionName, functionArgs) { + if (getConfig2().securityLevel !== "loose") { + return; + } + if (functionName === void 0) { + return; + } + let argList = []; + if (typeof functionArgs === "string") { + argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + for (let i2 = 0; i2 < argList.length; i2++) { + let item = argList[i2].trim(); + if (item.startsWith('"') && item.endsWith('"')) { + item = item.substr(1, item.length - 2); } - function n7b() { + argList[i2] = item; + } + } + if (argList.length === 0) { + argList.push(id26); + } + let rawTask = findTaskById(id26); + if (rawTask !== void 0) { + pushFun(id26, () => { + utils_default2.runFunc(functionName, ...argList); + }); + } + }, "setClickFun"); + pushFun = /* @__PURE__ */ __name(function(id26, callbackFunction) { + funs2.push( + function() { + const elem = document.querySelector(`[id="${id26}"]`); + if (elem !== null) { + elem.addEventListener("click", function() { + callbackFunction(); + }); } - function C7b() { + }, + function() { + const elem = document.querySelector(`[id="${id26}-text"]`); + if (elem !== null) { + elem.addEventListener("click", function() { + callbackFunction(); + }); } - function H7b() { + } + ); + }, "pushFun"); + setClickEvent2 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { + ids.split(",").forEach(function(id26) { + setClickFun2(id26, functionName, functionArgs); + }); + setClass2(ids, "clickable"); + }, "setClickEvent"); + bindFunctions2 = /* @__PURE__ */ __name(function(element3) { + funs2.forEach(function(fun) { + fun(element3); + }); + }, "bindFunctions"); + ganttDb_default = { + getConfig: /* @__PURE__ */ __name(() => getConfig2().gantt, "getConfig"), + clear: clear12, + setDateFormat, + getDateFormat, + enableInclusiveEndDates, + endDatesAreInclusive, + enableTopAxis, + topAxisEnabled, + setAxisFormat, + getAxisFormat, + setTickInterval, + getTickInterval, + setTodayMarker, + getTodayMarker, + setAccTitle, + getAccTitle, + setDiagramTitle, + getDiagramTitle, + setDisplayMode, + getDisplayMode, + setAccDescription, + getAccDescription, + addSection, + getSections, + getTasks, + addTask, + findTaskById, + addTaskOrg, + setIncludes, + getIncludes, + setExcludes, + getExcludes, + setClickEvent: setClickEvent2, + setLink: setLink2, + getLinks, + bindFunctions: bindFunctions2, + parseDuration, + isInvalidDate, + setWeekday, + getWeekday, + setWeekend + }; + __name(getTaskTags, "getTaskTags"); + } + }); + + // src/diagrams/gantt/ganttRenderer.js + var import_dayjs3, setConf3, mapWeekdayToTimeFunction, getMaxIntersections, w2, draw5, ganttRenderer_default; + var init_ganttRenderer = __esm({ + "src/diagrams/gantt/ganttRenderer.js"() { + "use strict"; + import_dayjs3 = __toESM(require_dayjs_min(), 1); + init_logger(); + init_src32(); + init_common(); + init_diagramAPI(); + init_setupGraphViewbox(); + setConf3 = /* @__PURE__ */ __name(function() { + log.debug("Something is calling, setConf, remove the call"); + }, "setConf"); + mapWeekdayToTimeFunction = { + monday: timeMonday, + tuesday: timeTuesday, + wednesday: timeWednesday, + thursday: timeThursday, + friday: timeFriday, + saturday: timeSaturday, + sunday: timeSunday + }; + getMaxIntersections = /* @__PURE__ */ __name((tasks4, orderOffset) => { + let timeline = [...tasks4].map(() => -Infinity); + let sorted = [...tasks4].sort((a2, b2) => a2.startTime - b2.startTime || a2.order - b2.order); + let maxIntersections = 0; + for (const element3 of sorted) { + for (let j2 = 0; j2 < timeline.length; j2++) { + if (element3.startTime >= timeline[j2]) { + timeline[j2] = element3.endTime; + element3.order = j2 + orderOffset; + if (j2 > maxIntersections) { + maxIntersections = j2; + } + break; } - function J7b() { + } + } + return maxIntersections; + }, "getMaxIntersections"); + draw5 = /* @__PURE__ */ __name(function(text2, id26, version4, diagObj) { + const conf8 = getConfig2().gantt; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; + const elem = doc.getElementById(id26); + w2 = elem.parentElement.offsetWidth; + if (w2 === void 0) { + w2 = 1200; + } + if (conf8.useWidth !== void 0) { + w2 = conf8.useWidth; + } + const taskArray = diagObj.db.getTasks(); + let categories = []; + for (const element3 of taskArray) { + categories.push(element3.type); + } + categories = checkUnique(categories); + const categoryHeights = {}; + let h2 = 2 * conf8.topPadding; + if (diagObj.db.getDisplayMode() === "compact" || conf8.displayMode === "compact") { + const categoryElements = {}; + for (const element3 of taskArray) { + if (categoryElements[element3.section] === void 0) { + categoryElements[element3.section] = [element3]; + } else { + categoryElements[element3.section].push(element3); } - function L7b() { + } + let intersections = 0; + for (const category of Object.keys(categoryElements)) { + const categoryHeight = getMaxIntersections(categoryElements[category], intersections) + 1; + intersections += categoryHeight; + h2 += categoryHeight * (conf8.barHeight + conf8.barGap); + categoryHeights[category] = categoryHeight; + } + } else { + h2 += taskArray.length * (conf8.barHeight + conf8.barGap); + for (const category of categories) { + categoryHeights[category] = taskArray.filter((task) => task.type === category).length; + } + } + elem.setAttribute("viewBox", "0 0 " + w2 + " " + h2); + const svg = root4.select(`[id="${id26}"]`); + const timeScale = time().domain([ + min(taskArray, function(d2) { + return d2.startTime; + }), + max(taskArray, function(d2) { + return d2.endTime; + }) + ]).rangeRound([0, w2 - conf8.leftPadding - conf8.rightPadding]); + function taskCompare(a2, b2) { + const taskA = a2.startTime; + const taskB = b2.startTime; + let result = 0; + if (taskA > taskB) { + result = 1; + } else if (taskA < taskB) { + result = -1; + } + return result; + } + __name(taskCompare, "taskCompare"); + taskArray.sort(taskCompare); + makeGantt(taskArray, w2, h2); + configureSvgSize(svg, h2, w2, conf8.useMaxWidth); + svg.append("text").text(diagObj.db.getDiagramTitle()).attr("x", w2 / 2).attr("y", conf8.titleTopMargin).attr("class", "titleText"); + function makeGantt(tasks4, pageWidth, pageHeight) { + const barHeight = conf8.barHeight; + const gap = barHeight + conf8.barGap; + const topPadding = conf8.topPadding; + const leftPadding = conf8.leftPadding; + const colorScale = linear2().domain([0, categories.length]).range(["#00B9FA", "#F95002"]).interpolate(hcl_default); + drawExcludeDays( + gap, + topPadding, + leftPadding, + pageWidth, + pageHeight, + tasks4, + diagObj.db.getExcludes(), + diagObj.db.getIncludes() + ); + makeGrid(leftPadding, topPadding, pageWidth, pageHeight); + drawRects(tasks4, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight); + vertLabels(gap, topPadding, leftPadding, barHeight, colorScale); + drawToday(leftPadding, topPadding, pageWidth, pageHeight); + } + __name(makeGantt, "makeGantt"); + function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w3) { + const uniqueTaskOrderIds = [...new Set(theArray.map((item) => item.order))]; + const uniqueTasks = uniqueTaskOrderIds.map((id27) => theArray.find((item) => item.order === id27)); + svg.append("g").selectAll("rect").data(uniqueTasks).enter().append("rect").attr("x", 0).attr("y", function(d2, i2) { + i2 = d2.order; + return i2 * theGap + theTopPad - 2; + }).attr("width", function() { + return w3 - conf8.rightPadding / 2; + }).attr("height", theGap).attr("class", function(d2) { + for (const [i2, category] of categories.entries()) { + if (d2.type === category) { + return "section section" + i2 % conf8.numberSectionStyles; + } + } + return "section section0"; + }); + const rectangles = svg.append("g").selectAll("rect").data(theArray).enter(); + const links3 = diagObj.db.getLinks(); + rectangles.append("rect").attr("id", function(d2) { + return d2.id; + }).attr("rx", 3).attr("ry", 3).attr("x", function(d2) { + if (d2.milestone) { + return timeScale(d2.startTime) + theSidePad + 0.5 * (timeScale(d2.endTime) - timeScale(d2.startTime)) - 0.5 * theBarHeight; + } + return timeScale(d2.startTime) + theSidePad; + }).attr("y", function(d2, i2) { + i2 = d2.order; + return i2 * theGap + theTopPad; + }).attr("width", function(d2) { + if (d2.milestone) { + return theBarHeight; + } + return timeScale(d2.renderEndTime || d2.endTime) - timeScale(d2.startTime); + }).attr("height", theBarHeight).attr("transform-origin", function(d2, i2) { + i2 = d2.order; + return (timeScale(d2.startTime) + theSidePad + 0.5 * (timeScale(d2.endTime) - timeScale(d2.startTime))).toString() + "px " + (i2 * theGap + theTopPad + 0.5 * theBarHeight).toString() + "px"; + }).attr("class", function(d2) { + const res = "task"; + let classStr = ""; + if (d2.classes.length > 0) { + classStr = d2.classes.join(" "); + } + let secNum = 0; + for (const [i2, category] of categories.entries()) { + if (d2.type === category) { + secNum = i2 % conf8.numberSectionStyles; + } + } + let taskClass = ""; + if (d2.active) { + if (d2.crit) { + taskClass += " activeCrit"; + } else { + taskClass = " active"; + } + } else if (d2.done) { + if (d2.crit) { + taskClass = " doneCrit"; + } else { + taskClass = " done"; + } + } else { + if (d2.crit) { + taskClass += " crit"; + } } - function N7b() { + if (taskClass.length === 0) { + taskClass = " task"; } - function P7b() { + if (d2.milestone) { + taskClass = " milestone " + taskClass; } - function a8b() { + taskClass += secNum; + taskClass += " " + classStr; + return res + taskClass; + }); + rectangles.append("text").attr("id", function(d2) { + return d2.id + "-text"; + }).text(function(d2) { + return d2.task; + }).attr("font-size", conf8.fontSize).attr("x", function(d2) { + let startX2 = timeScale(d2.startTime); + let endX = timeScale(d2.renderEndTime || d2.endTime); + if (d2.milestone) { + startX2 += 0.5 * (timeScale(d2.endTime) - timeScale(d2.startTime)) - 0.5 * theBarHeight; + } + if (d2.milestone) { + endX = startX2 + theBarHeight; + } + const textWidth = this.getBBox().width; + if (textWidth > endX - startX2) { + if (endX + textWidth + 1.5 * conf8.leftPadding > w3) { + return startX2 + theSidePad - 5; + } else { + return endX + theSidePad + 5; + } + } else { + return (endX - startX2) / 2 + startX2 + theSidePad; + } + }).attr("y", function(d2, i2) { + i2 = d2.order; + return i2 * theGap + conf8.barHeight / 2 + (conf8.fontSize / 2 - 2) + theTopPad; + }).attr("text-height", theBarHeight).attr("class", function(d2) { + const startX2 = timeScale(d2.startTime); + let endX = timeScale(d2.endTime); + if (d2.milestone) { + endX = startX2 + theBarHeight; + } + const textWidth = this.getBBox().width; + let classStr = ""; + if (d2.classes.length > 0) { + classStr = d2.classes.join(" "); + } + let secNum = 0; + for (const [i2, category] of categories.entries()) { + if (d2.type === category) { + secNum = i2 % conf8.numberSectionStyles; + } + } + let taskType = ""; + if (d2.active) { + if (d2.crit) { + taskType = "activeCritText" + secNum; + } else { + taskType = "activeText" + secNum; + } } - function c8b() { + if (d2.done) { + if (d2.crit) { + taskType = taskType + " doneCritText" + secNum; + } else { + taskType = taskType + " doneText" + secNum; + } + } else { + if (d2.crit) { + taskType = taskType + " critText" + secNum; + } } - function e8b() { + if (d2.milestone) { + taskType += " milestoneText"; } - function g8b() { + if (textWidth > endX - startX2) { + if (endX + textWidth + 1.5 * conf8.leftPadding > w3) { + return classStr + " taskTextOutsideLeft taskTextOutside" + secNum + " " + taskType; + } else { + return classStr + " taskTextOutsideRight taskTextOutside" + secNum + " " + taskType + " width-" + textWidth; + } + } else { + return classStr + " taskText taskText" + secNum + " " + taskType + " width-" + textWidth; } - function i8b() { + }); + const securityLevel2 = getConfig2().securityLevel; + if (securityLevel2 === "sandbox") { + let sandboxElement2; + sandboxElement2 = select_default2("#i" + id26); + const doc2 = sandboxElement2.nodes()[0].contentDocument; + rectangles.filter(function(d2) { + return links3.has(d2.id); + }).each(function(o2) { + var taskRect = doc2.querySelector("#" + o2.id); + var taskText = doc2.querySelector("#" + o2.id + "-text"); + const oldParent = taskRect.parentNode; + var Link = doc2.createElement("a"); + Link.setAttribute("xlink:href", links3.get(o2.id)); + Link.setAttribute("target", "_top"); + oldParent.appendChild(Link); + Link.appendChild(taskRect); + Link.appendChild(taskText); + }); + } + } + __name(drawRects, "drawRects"); + function drawExcludeDays(theGap, theTopPad, theSidePad, w3, h3, tasks4, excludes2, includes3) { + if (excludes2.length === 0 && includes3.length === 0) { + return; + } + let minTime; + let maxTime; + for (const { startTime, endTime } of tasks4) { + if (minTime === void 0 || startTime < minTime) { + minTime = startTime; } - function m8b() { + if (maxTime === void 0 || endTime > maxTime) { + maxTime = endTime; } - function Z8b() { + } + if (!minTime || !maxTime) { + return; + } + if ((0, import_dayjs3.default)(maxTime).diff((0, import_dayjs3.default)(minTime), "year") > 5) { + log.warn( + "The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days." + ); + return; + } + const dateFormat2 = diagObj.db.getDateFormat(); + const excludeRanges = []; + let range3 = null; + let d2 = (0, import_dayjs3.default)(minTime); + while (d2.valueOf() <= maxTime) { + if (diagObj.db.isInvalidDate(d2, dateFormat2, excludes2, includes3)) { + if (!range3) { + range3 = { + start: d2, + end: d2 + }; + } else { + range3.end = d2; + } + } else { + if (range3) { + excludeRanges.push(range3); + range3 = null; + } + } + d2 = d2.add(1, "d"); + } + const rectangles = svg.append("g").selectAll("rect").data(excludeRanges).enter(); + rectangles.append("rect").attr("id", function(d3) { + return "exclude-" + d3.start.format("YYYY-MM-DD"); + }).attr("x", function(d3) { + return timeScale(d3.start) + theSidePad; + }).attr("y", conf8.gridLineStartPadding).attr("width", function(d3) { + const renderEnd = d3.end.add(1, "day"); + return timeScale(renderEnd) - timeScale(d3.start); + }).attr("height", h3 - theTopPad - conf8.gridLineStartPadding).attr("transform-origin", function(d3, i2) { + return (timeScale(d3.start) + theSidePad + 0.5 * (timeScale(d3.end) - timeScale(d3.start))).toString() + "px " + (i2 * theGap + 0.5 * h3).toString() + "px"; + }).attr("class", "exclude-range"); + } + __name(drawExcludeDays, "drawExcludeDays"); + function makeGrid(theSidePad, theTopPad, w3, h3) { + let bottomXAxis = axisBottom(timeScale).tickSize(-h3 + theTopPad + conf8.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf8.axisFormat || "%Y-%m-%d")); + const reTickInterval = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/; + const resultTickInterval = reTickInterval.exec( + diagObj.db.getTickInterval() || conf8.tickInterval + ); + if (resultTickInterval !== null) { + const every3 = resultTickInterval[1]; + const interval2 = resultTickInterval[2]; + const weekday2 = diagObj.db.getWeekday() || conf8.weekday; + switch (interval2) { + case "millisecond": + bottomXAxis.ticks(millisecond.every(every3)); + break; + case "second": + bottomXAxis.ticks(second.every(every3)); + break; + case "minute": + bottomXAxis.ticks(timeMinute.every(every3)); + break; + case "hour": + bottomXAxis.ticks(timeHour.every(every3)); + break; + case "day": + bottomXAxis.ticks(timeDay.every(every3)); + break; + case "week": + bottomXAxis.ticks(mapWeekdayToTimeFunction[weekday2].every(every3)); + break; + case "month": + bottomXAxis.ticks(timeMonth.every(every3)); + break; } - function f9b() { + } + svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + (h3 - 50) + ")").call(bottomXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"); + if (diagObj.db.topAxisEnabled() || conf8.topAxis) { + let topXAxis = axisTop(timeScale).tickSize(-h3 + theTopPad + conf8.gridLineStartPadding).tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf8.axisFormat || "%Y-%m-%d")); + if (resultTickInterval !== null) { + const every3 = resultTickInterval[1]; + const interval2 = resultTickInterval[2]; + const weekday2 = diagObj.db.getWeekday() || conf8.weekday; + switch (interval2) { + case "millisecond": + topXAxis.ticks(millisecond.every(every3)); + break; + case "second": + topXAxis.ticks(second.every(every3)); + break; + case "minute": + topXAxis.ticks(timeMinute.every(every3)); + break; + case "hour": + topXAxis.ticks(timeHour.every(every3)); + break; + case "day": + topXAxis.ticks(timeDay.every(every3)); + break; + case "week": + topXAxis.ticks(mapWeekdayToTimeFunction[weekday2].every(every3)); + break; + case "month": + topXAxis.ticks(timeMonth.every(every3)); + break; + } } - function i9b() { + svg.append("g").attr("class", "grid").attr("transform", "translate(" + theSidePad + ", " + theTopPad + ")").call(topXAxis).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10); + } + } + __name(makeGrid, "makeGrid"); + function vertLabels(theGap, theTopPad) { + let prevGap = 0; + const numOccurrences = Object.keys(categoryHeights).map((d2) => [d2, categoryHeights[d2]]); + svg.append("g").selectAll("text").data(numOccurrences).enter().append(function(d2) { + const rows = d2[0].split(common_default.lineBreakRegex); + const dy = -(rows.length - 1) / 2; + const svgLabel = doc.createElementNS("http://www.w3.org/2000/svg", "text"); + svgLabel.setAttribute("dy", dy + "em"); + for (const [j2, row] of rows.entries()) { + const tspan = doc.createElementNS("http://www.w3.org/2000/svg", "tspan"); + tspan.setAttribute("alignment-baseline", "central"); + tspan.setAttribute("x", "10"); + if (j2 > 0) { + tspan.setAttribute("dy", "1em"); + } + tspan.textContent = row; + svgLabel.appendChild(tspan); } - function o9b() { + return svgLabel; + }).attr("x", 10).attr("y", function(d2, i2) { + if (i2 > 0) { + for (let j2 = 0; j2 < i2; j2++) { + prevGap += numOccurrences[i2 - 1][1]; + return d2[1] * theGap / 2 + prevGap * theGap + theTopPad; + } + } else { + return d2[1] * theGap / 2 + theTopPad; } - function C9b() { + }).attr("font-size", conf8.sectionFontSize).attr("class", function(d2) { + for (const [i2, category] of categories.entries()) { + if (d2[0] === category) { + return "sectionTitle sectionTitle" + i2 % conf8.numberSectionStyles; + } } - function F9b() { + return "sectionTitle"; + }); + } + __name(vertLabels, "vertLabels"); + function drawToday(theSidePad, theTopPad, w3, h3) { + const todayMarker2 = diagObj.db.getTodayMarker(); + if (todayMarker2 === "off") { + return; + } + const todayG = svg.append("g").attr("class", "today"); + const today = /* @__PURE__ */ new Date(); + const todayLine = todayG.append("line"); + todayLine.attr("x1", timeScale(today) + theSidePad).attr("x2", timeScale(today) + theSidePad).attr("y1", conf8.titleTopMargin).attr("y2", h3 - conf8.titleTopMargin).attr("class", "today"); + if (todayMarker2 !== "") { + todayLine.attr("style", todayMarker2.replace(/,/g, ";")); + } + } + __name(drawToday, "drawToday"); + function checkUnique(arr) { + const hash = {}; + const result = []; + for (let i2 = 0, l2 = arr.length; i2 < l2; ++i2) { + if (!Object.prototype.hasOwnProperty.call(hash, arr[i2])) { + hash[arr[i2]] = true; + result.push(arr[i2]); } - function K9b() { - } - function Q9b() { - } - function aac() { - } - function bac() { - } - function eac() { - } - function mac() { - } - function pac() { - } - function rac() { - } - function tac() { - } - function xac() { - } - function Aac() { - } - function Dac() { - } - function Iac() { - } - function Oac() { - } - function Uac() { - } - function Ucc() { - } - function scc() { - } - function ycc() { - } - function Acc() { - } - function Ccc() { - } - function Ncc() { - } - function Wcc() { - } - function ydc() { - } - function Adc() { - } - function Gdc() { - } - function Ldc() { - } - function Zdc() { - } - function fec() { - } - function Dec() { - } - function Gec() { - } - function Kec() { - } - function efc() { - } - function jfc() { - } - function nfc() { - } - function Bfc() { - } - function Ifc() { - } - function Lfc() { - } - function Rfc() { - } - function Ufc() { - } - function Zfc() { - } - function cgc() { - } - function egc() { - } - function ggc() { - } - function igc() { - } - function kgc() { - } - function Dgc() { - } - function Hgc() { - } - function Lgc() { - } - function Ngc() { - } - function Pgc() { - } - function Vgc() { - } - function Ygc() { - } - function chc() { - } - function ehc() { - } - function ghc() { - } - function ihc() { - } - function mhc() { - } - function rhc() { - } - function uhc() { - } - function whc() { - } - function yhc() { - } - function Ahc() { - } - function Chc() { - } - function Ghc() { - } - function Nhc() { - } - function Phc() { - } - function Rhc() { - } - function Thc() { - } - function $hc() { - } - function aic() { - } - function cic() { - } - function eic() { - } - function jic() { - } - function nic() { - } - function pic() { - } - function ric() { - } - function vic() { - } - function yic() { - } - function Dic() { - } - function Ric() { - } - function Zic() { - } - function bjc() { - } - function djc() { - } - function jjc() { - } - function njc() { - } - function rjc() { - } - function tjc() { - } - function zjc() { - } - function Djc() { - } - function Fjc() { - } - function Ljc() { - } - function Pjc() { - } - function Rjc() { - } - function fkc() { - } - function Kkc() { - } - function Mkc() { - } - function Okc() { - } - function Qkc() { - } - function Skc() { - } - function Ukc() { - } - function Wkc() { - } - function clc() { - } - function elc() { - } - function klc() { - } - function mlc() { - } - function olc() { - } - function qlc() { - } - function wlc() { - } - function ylc() { - } - function Alc() { - } - function Jlc() { - } - function Joc() { - } - function poc() { - } - function roc() { - } - function toc() { - } - function voc() { - } - function Boc() { - } - function Foc() { - } - function Hoc() { - } - function Loc() { - } - function Noc() { - } - function Poc() { - } - function qnc() { - } - function unc() { - } - function upc() { - } - function kpc() { - } - function mpc() { - } - function opc() { - } - function qpc() { - } - function ypc() { - } - function Cpc() { - } - function Mpc() { - } - function Qpc() { - } - function dqc() { - } - function jqc() { - } - function Aqc() { - } - function Eqc() { - } - function Gqc() { - } - function Sqc() { - } - function arc() { - } - function lrc() { - } - function zrc() { - } - function Hrc() { - } - function bsc() { - } - function dsc() { - } - function fsc() { - } - function ksc() { - } - function msc() { - } - function Asc() { - } - function Csc() { - } - function Esc() { - } - function Ksc() { - } - function Nsc() { - } - function Ssc() { - } - function CCc() { - } - function tGc() { - } - function aHc() { - } - function gHc() { - } - function nIc() { - } - function PJc() { - } - function XKc() { - } - function fLc() { - } - function hLc() { - } - function lLc() { + } + return result; + } + __name(checkUnique, "checkUnique"); + }, "draw"); + ganttRenderer_default = { + setConf: setConf3, + draw: draw5 + }; + } + }); + + // src/diagrams/gantt/styles.js + var getStyles6, styles_default6; + var init_styles6 = __esm({ + "src/diagrams/gantt/styles.js"() { + "use strict"; + getStyles6 = /* @__PURE__ */ __name((options3) => ` + .mermaid-main-font { + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); + } + + .exclude-range { + fill: ${options3.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${options3.sectionBkgColor}; + } + + .section2 { + fill: ${options3.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${options3.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${options3.titleColor}; + } + + .sectionTitle1 { + fill: ${options3.titleColor}; + } + + .sectionTitle2 { + fill: ${options3.titleColor}; + } + + .sectionTitle3 { + fill: ${options3.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${options3.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${options3.fontFamily}; + fill: ${options3.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${options3.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); + } + + .taskTextOutsideRight { + fill: ${options3.taskTextDarkColor}; + text-anchor: start; + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); + } + + .taskTextOutsideLeft { + fill: ${options3.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${options3.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${options3.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${options3.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${options3.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${options3.taskBkgColor}; + stroke: ${options3.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${options3.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${options3.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${options3.activeTaskBkgColor}; + stroke: ${options3.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${options3.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${options3.doneTaskBorderColor}; + fill: ${options3.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${options3.taskTextDarkColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${options3.critBorderColor}; + fill: ${options3.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${options3.critBorderColor}; + fill: ${options3.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${options3.critBorderColor}; + fill: ${options3.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${options3.taskTextDarkColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${options3.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.titleColor || options3.textColor}; + font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); + } +`, "getStyles"); + styles_default6 = getStyles6; + } + }); + + // src/diagrams/gantt/ganttDiagram.ts + var ganttDiagram_exports = {}; + __export(ganttDiagram_exports, { + diagram: () => diagram5 + }); + var diagram5; + var init_ganttDiagram = __esm({ + "src/diagrams/gantt/ganttDiagram.ts"() { + "use strict"; + init_gantt(); + init_ganttDb(); + init_ganttRenderer(); + init_styles6(); + diagram5 = { + parser: gantt_default, + db: ganttDb_default, + renderer: ganttRenderer_default, + styles: styles_default6 + }; + } + }); + + // src/diagrams/info/infoParser.ts + var parser7; + var init_infoParser = __esm({ + "src/diagrams/info/infoParser.ts"() { + "use strict"; + init_mermaid_parser_core(); + init_logger(); + parser7 = { + parse: /* @__PURE__ */ __name(async (input) => { + const ast = await parse2("info", input); + log.debug(ast); + }, "parse") + }; + } + }); + + // package.json + var version2; + var init_package = __esm({ + "package.json"() { + version2 = "11.0.2"; + } + }); + + // src/diagrams/info/infoDb.ts + var DEFAULT_INFO_DB, getVersion, db2; + var init_infoDb = __esm({ + "src/diagrams/info/infoDb.ts"() { + "use strict"; + init_package(); + DEFAULT_INFO_DB = { version: version2 }; + getVersion = /* @__PURE__ */ __name(() => DEFAULT_INFO_DB.version, "getVersion"); + db2 = { + getVersion + }; + } + }); + + // src/rendering-util/selectSvgElement.ts + var selectSvgElement; + var init_selectSvgElement = __esm({ + "src/rendering-util/selectSvgElement.ts"() { + "use strict"; + init_src32(); + init_diagramAPI(); + selectSvgElement = /* @__PURE__ */ __name((id26) => { + const { securityLevel } = getConfig2(); + let root4 = select_default2("body"); + if (securityLevel === "sandbox") { + const sandboxElement = select_default2(`#i${id26}`); + const doc = sandboxElement.node()?.contentDocument ?? document; + root4 = select_default2(doc.body); + } + const svg = root4.select(`#${id26}`); + return svg; + }, "selectSvgElement"); + } + }); + + // src/diagrams/info/infoRenderer.ts + var draw6, renderer; + var init_infoRenderer = __esm({ + "src/diagrams/info/infoRenderer.ts"() { + "use strict"; + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + draw6 = /* @__PURE__ */ __name((text2, id26, version4) => { + log.debug("rendering info diagram\n" + text2); + const svg = selectSvgElement(id26); + configureSvgSize(svg, 100, 400, true); + const group2 = svg.append("g"); + group2.append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${version4}`); + }, "draw"); + renderer = { draw: draw6 }; + } + }); + + // src/diagrams/info/infoDiagram.ts + var infoDiagram_exports = {}; + __export(infoDiagram_exports, { + diagram: () => diagram6 + }); + var diagram6; + var init_infoDiagram = __esm({ + "src/diagrams/info/infoDiagram.ts"() { + "use strict"; + init_infoParser(); + init_infoDb(); + init_infoRenderer(); + diagram6 = { + parser: parser7, + db: db2, + renderer + }; + } + }); + + // src/diagrams/pie/pieDb.ts + var DEFAULT_PIE_CONFIG, DEFAULT_PIE_DB, sections2, showData, config3, getConfig4, clear13, addSection2, getSections2, setShowData, getShowData, db3; + var init_pieDb = __esm({ + "src/diagrams/pie/pieDb.ts"() { + "use strict"; + init_logger(); + init_commonDb(); + init_defaultConfig(); + DEFAULT_PIE_CONFIG = defaultConfig_default.pie; + DEFAULT_PIE_DB = { + sections: /* @__PURE__ */ new Map(), + showData: false, + config: DEFAULT_PIE_CONFIG + }; + sections2 = DEFAULT_PIE_DB.sections; + showData = DEFAULT_PIE_DB.showData; + config3 = structuredClone(DEFAULT_PIE_CONFIG); + getConfig4 = /* @__PURE__ */ __name(() => structuredClone(config3), "getConfig"); + clear13 = /* @__PURE__ */ __name(() => { + sections2 = /* @__PURE__ */ new Map(); + showData = DEFAULT_PIE_DB.showData; + clear(); + }, "clear"); + addSection2 = /* @__PURE__ */ __name(({ label, value: value2 }) => { + if (!sections2.has(label)) { + sections2.set(label, value2); + log.debug(`added new section: ${label}, with value: ${value2}`); + } + }, "addSection"); + getSections2 = /* @__PURE__ */ __name(() => sections2, "getSections"); + setShowData = /* @__PURE__ */ __name((toggle) => { + showData = toggle; + }, "setShowData"); + getShowData = /* @__PURE__ */ __name(() => showData, "getShowData"); + db3 = { + getConfig: getConfig4, + clear: clear13, + setDiagramTitle, + getDiagramTitle, + setAccTitle, + getAccTitle, + setAccDescription, + getAccDescription, + addSection: addSection2, + getSections: getSections2, + setShowData, + getShowData + }; + } + }); + + // src/diagrams/pie/pieParser.ts + var populateDb, parser8; + var init_pieParser = __esm({ + "src/diagrams/pie/pieParser.ts"() { + "use strict"; + init_mermaid_parser_core(); + init_logger(); + init_populateCommonDb(); + init_pieDb(); + populateDb = /* @__PURE__ */ __name((ast, db7) => { + populateCommonDb(ast, db7); + db7.setShowData(ast.showData); + ast.sections.map(db7.addSection); + }, "populateDb"); + parser8 = { + parse: /* @__PURE__ */ __name(async (input) => { + const ast = await parse2("pie", input); + log.debug(ast); + populateDb(ast, db3); + }, "parse") + }; + } + }); + + // src/diagrams/pie/pieStyles.ts + var getStyles7, pieStyles_default; + var init_pieStyles = __esm({ + "src/diagrams/pie/pieStyles.ts"() { + "use strict"; + getStyles7 = /* @__PURE__ */ __name((options3) => ` + .pieCircle{ + stroke: ${options3.pieStrokeColor}; + stroke-width : ${options3.pieStrokeWidth}; + opacity : ${options3.pieOpacity}; + } + .pieOuterCircle{ + stroke: ${options3.pieOuterStrokeColor}; + stroke-width: ${options3.pieOuterStrokeWidth}; + fill: none; + } + .pieTitleText { + text-anchor: middle; + font-size: ${options3.pieTitleTextSize}; + fill: ${options3.pieTitleTextColor}; + font-family: ${options3.fontFamily}; + } + .slice { + font-family: ${options3.fontFamily}; + fill: ${options3.pieSectionTextColor}; + font-size:${options3.pieSectionTextSize}; + // fill: white; + } + .legend text { + fill: ${options3.pieLegendTextColor}; + font-family: ${options3.fontFamily}; + font-size: ${options3.pieLegendTextSize}; + } +`, "getStyles"); + pieStyles_default = getStyles7; + } + }); + + // src/diagrams/pie/pieRenderer.ts + var createPieArcs, draw7, renderer2; + var init_pieRenderer = __esm({ + "src/diagrams/pie/pieRenderer.ts"() { + "use strict"; + init_src32(); + init_diagramAPI(); + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + init_utils2(); + createPieArcs = /* @__PURE__ */ __name((sections5) => { + const pieData = [...sections5.entries()].map((element3) => { + return { + label: element3[0], + value: element3[1] + }; + }).sort((a2, b2) => { + return b2.value - a2.value; + }); + const pie2 = pie_default().value( + (d3Section) => d3Section.value + ); + return pie2(pieData); + }, "createPieArcs"); + draw7 = /* @__PURE__ */ __name((text2, id26, _version, diagObj) => { + log.debug("rendering pie chart\n" + text2); + const db7 = diagObj.db; + const globalConfig = getConfig2(); + const pieConfig = cleanAndMerge(db7.getConfig(), globalConfig.pie); + const MARGIN = 40; + const LEGEND_RECT_SIZE = 18; + const LEGEND_SPACING = 4; + const height2 = 450; + const pieWidth = height2; + const svg = selectSvgElement(id26); + const group2 = svg.append("g"); + group2.attr("transform", "translate(" + pieWidth / 2 + "," + height2 / 2 + ")"); + const { themeVariables } = globalConfig; + let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth); + outerStrokeWidth ??= 2; + const textPosition = pieConfig.textPosition; + const radius2 = Math.min(pieWidth, height2) / 2 - MARGIN; + const arcGenerator = arc_default().innerRadius(0).outerRadius(radius2); + const labelArcGenerator = arc_default().innerRadius(radius2 * textPosition).outerRadius(radius2 * textPosition); + group2.append("circle").attr("cx", 0).attr("cy", 0).attr("r", radius2 + outerStrokeWidth / 2).attr("class", "pieOuterCircle"); + const sections5 = db7.getSections(); + const arcs = createPieArcs(sections5); + const myGeneratedColors = [ + themeVariables.pie1, + themeVariables.pie2, + themeVariables.pie3, + themeVariables.pie4, + themeVariables.pie5, + themeVariables.pie6, + themeVariables.pie7, + themeVariables.pie8, + themeVariables.pie9, + themeVariables.pie10, + themeVariables.pie11, + themeVariables.pie12 + ]; + const color2 = ordinal(myGeneratedColors); + group2.selectAll("mySlices").data(arcs).enter().append("path").attr("d", arcGenerator).attr("fill", (datum2) => { + return color2(datum2.data.label); + }).attr("class", "pieCircle"); + let sum2 = 0; + sections5.forEach((section) => { + sum2 += section; + }); + group2.selectAll("mySlices").data(arcs).enter().append("text").text((datum2) => { + return (datum2.data.value / sum2 * 100).toFixed(0) + "%"; + }).attr("transform", (datum2) => { + return "translate(" + labelArcGenerator.centroid(datum2) + ")"; + }).style("text-anchor", "middle").attr("class", "slice"); + group2.append("text").text(db7.getDiagramTitle()).attr("x", 0).attr("y", -(height2 - 50) / 2).attr("class", "pieTitleText"); + const legend = group2.selectAll(".legend").data(color2.domain()).enter().append("g").attr("class", "legend").attr("transform", (_datum, index) => { + const height3 = LEGEND_RECT_SIZE + LEGEND_SPACING; + const offset = height3 * color2.domain().length / 2; + const horizontal = 12 * LEGEND_RECT_SIZE; + const vertical = index * height3 - offset; + return "translate(" + horizontal + "," + vertical + ")"; + }); + legend.append("rect").attr("width", LEGEND_RECT_SIZE).attr("height", LEGEND_RECT_SIZE).style("fill", color2).style("stroke", color2); + legend.data(arcs).append("text").attr("x", LEGEND_RECT_SIZE + LEGEND_SPACING).attr("y", LEGEND_RECT_SIZE - LEGEND_SPACING).text((datum2) => { + const { label, value: value2 } = datum2.data; + if (db7.getShowData()) { + return `${label} [${value2}]`; + } + return label; + }); + const longestTextWidth = Math.max( + ...legend.selectAll("text").nodes().map((node2) => node2?.getBoundingClientRect().width ?? 0) + ); + const totalWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth; + svg.attr("viewBox", `0 0 ${totalWidth} ${height2}`); + configureSvgSize(svg, height2, totalWidth, pieConfig.useMaxWidth); + }, "draw"); + renderer2 = { draw: draw7 }; + } + }); + + // src/diagrams/pie/pieDiagram.ts + var pieDiagram_exports = {}; + __export(pieDiagram_exports, { + diagram: () => diagram7 + }); + var diagram7; + var init_pieDiagram = __esm({ + "src/diagrams/pie/pieDiagram.ts"() { + "use strict"; + init_pieParser(); + init_pieDb(); + init_pieStyles(); + init_pieRenderer(); + diagram7 = { + parser: parser8, + db: db3, + renderer: renderer2, + styles: pieStyles_default + }; + } + }); + + // src/diagrams/quadrant-chart/parser/quadrant.jison + var parser9, quadrant_default; + var init_quadrant = __esm({ + "src/diagrams/quadrant-chart/parser/quadrant.jison"() { + "use strict"; + parser9 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [1, 7], $V5 = [1, 4, 5, 10, 12, 13, 14, 18, 25, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V6 = [1, 4, 5, 10, 12, 13, 14, 18, 25, 28, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V7 = [55, 56, 57], $V8 = [2, 36], $V9 = [1, 37], $Va = [1, 36], $Vb = [1, 38], $Vc = [1, 35], $Vd = [1, 43], $Ve = [1, 41], $Vf = [1, 14], $Vg = [1, 23], $Vh = [1, 18], $Vi = [1, 19], $Vj = [1, 20], $Vk = [1, 21], $Vl = [1, 22], $Vm = [1, 24], $Vn = [1, 25], $Vo = [1, 26], $Vp = [1, 27], $Vq = [1, 28], $Vr = [1, 29], $Vs = [1, 32], $Vt = [1, 33], $Vu = [1, 34], $Vv = [1, 39], $Vw = [1, 40], $Vx = [1, 42], $Vy = [1, 44], $Vz = [1, 62], $VA = [1, 61], $VB = [4, 5, 8, 10, 12, 13, 14, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], $VC = [1, 65], $VD = [1, 66], $VE = [1, 67], $VF = [1, 68], $VG = [1, 69], $VH = [1, 70], $VI = [1, 71], $VJ = [1, 72], $VK = [1, 73], $VL = [1, 74], $VM = [1, 75], $VN = [1, 76], $VO = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], $VP = [1, 90], $VQ = [1, 91], $VR = [1, 92], $VS = [1, 99], $VT = [1, 93], $VU = [1, 96], $VV = [1, 94], $VW = [1, 95], $VX = [1, 97], $VY = [1, 98], $VZ = [1, 102], $V_ = [10, 55, 56, 57], $V$ = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "idStringToken": 3, "ALPHA": 4, "NUM": 5, "NODE_STRING": 6, "DOWN": 7, "MINUS": 8, "DEFAULT": 9, "COMMA": 10, "COLON": 11, "AMP": 12, "BRKT": 13, "MULT": 14, "UNICODE_TEXT": 15, "styleComponent": 16, "UNIT": 17, "SPACE": 18, "STYLE": 19, "PCT": 20, "idString": 21, "style": 22, "stylesOpt": 23, "classDefStatement": 24, "CLASSDEF": 25, "start": 26, "eol": 27, "QUADRANT": 28, "document": 29, "line": 30, "statement": 31, "axisDetails": 32, "quadrantDetails": 33, "points": 34, "title": 35, "title_value": 36, "acc_title": 37, "acc_title_value": 38, "acc_descr": 39, "acc_descr_value": 40, "acc_descr_multiline_value": 41, "section": 42, "text": 43, "point_start": 44, "point_x": 45, "point_y": 46, "class_name": 47, "X-AXIS": 48, "AXIS-TEXT-DELIMITER": 49, "Y-AXIS": 50, "QUADRANT_1": 51, "QUADRANT_2": 52, "QUADRANT_3": 53, "QUADRANT_4": 54, "NEWLINE": 55, "SEMI": 56, "EOF": 57, "alphaNumToken": 58, "textNoTagsToken": 59, "STR": 60, "MD_STR": 61, "alphaNum": 62, "PUNCTUATION": 63, "PLUS": 64, "EQUALS": 65, "DOT": 66, "UNDERSCORE": 67, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "ALPHA", 5: "NUM", 6: "NODE_STRING", 7: "DOWN", 8: "MINUS", 9: "DEFAULT", 10: "COMMA", 11: "COLON", 12: "AMP", 13: "BRKT", 14: "MULT", 15: "UNICODE_TEXT", 17: "UNIT", 18: "SPACE", 19: "STYLE", 20: "PCT", 25: "CLASSDEF", 28: "QUADRANT", 35: "title", 36: "title_value", 37: "acc_title", 38: "acc_title_value", 39: "acc_descr", 40: "acc_descr_value", 41: "acc_descr_multiline_value", 42: "section", 44: "point_start", 45: "point_x", 46: "point_y", 47: "class_name", 48: "X-AXIS", 49: "AXIS-TEXT-DELIMITER", 50: "Y-AXIS", 51: "QUADRANT_1", 52: "QUADRANT_2", 53: "QUADRANT_3", 54: "QUADRANT_4", 55: "NEWLINE", 56: "SEMI", 57: "EOF", 60: "STR", 61: "MD_STR", 63: "PUNCTUATION", 64: "PLUS", 65: "EQUALS", 66: "DOT", 67: "UNDERSCORE" }, + productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [21, 1], [21, 2], [22, 1], [22, 2], [23, 1], [23, 3], [24, 5], [26, 2], [26, 2], [26, 2], [29, 0], [29, 2], [30, 2], [31, 0], [31, 1], [31, 2], [31, 1], [31, 1], [31, 1], [31, 2], [31, 2], [31, 2], [31, 1], [31, 1], [34, 4], [34, 5], [34, 5], [34, 6], [32, 4], [32, 3], [32, 2], [32, 4], [32, 3], [32, 2], [33, 2], [33, 2], [33, 2], [33, 2], [27, 1], [27, 1], [27, 1], [43, 1], [43, 2], [43, 1], [43, 1], [62, 1], [62, 2], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [59, 1], [59, 1], [59, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 23: + this.$ = $$[$0]; + break; + case 24: + this.$ = $$[$0 - 1] + "" + $$[$0]; + break; + case 26: + this.$ = $$[$0 - 1] + $$[$0]; + break; + case 27: + this.$ = [$$[$0].trim()]; + break; + case 28: + $$[$0 - 2].push($$[$0].trim()); + this.$ = $$[$0 - 2]; + break; + case 29: + this.$ = $$[$0 - 4]; + yy.addClass($$[$0 - 2], $$[$0]); + break; + case 37: + this.$ = []; + break; + case 42: + this.$ = $$[$0].trim(); + yy.setDiagramTitle(this.$); + break; + case 43: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 44: + case 45: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 46: + yy.addSection($$[$0].substr(8)); + this.$ = $$[$0].substr(8); + break; + case 47: + yy.addPoint($$[$0 - 3], "", $$[$0 - 1], $$[$0], []); + break; + case 48: + yy.addPoint($$[$0 - 4], $$[$0 - 3], $$[$0 - 1], $$[$0], []); + break; + case 49: + yy.addPoint($$[$0 - 4], "", $$[$0 - 2], $$[$0 - 1], $$[$0]); + break; + case 50: + yy.addPoint($$[$0 - 5], $$[$0 - 4], $$[$0 - 2], $$[$0 - 1], $$[$0]); + break; + case 51: + yy.setXAxisLeftText($$[$0 - 2]); + yy.setXAxisRightText($$[$0]); + break; + case 52: + $$[$0 - 1].text += " \u27F6 "; + yy.setXAxisLeftText($$[$0 - 1]); + break; + case 53: + yy.setXAxisLeftText($$[$0]); + break; + case 54: + yy.setYAxisBottomText($$[$0 - 2]); + yy.setYAxisTopText($$[$0]); + break; + case 55: + $$[$0 - 1].text += " \u27F6 "; + yy.setYAxisBottomText($$[$0 - 1]); + break; + case 56: + yy.setYAxisBottomText($$[$0]); + break; + case 57: + yy.setQuadrant1Text($$[$0]); + break; + case 58: + yy.setQuadrant2Text($$[$0]); + break; + case 59: + yy.setQuadrant3Text($$[$0]); + break; + case 60: + yy.setQuadrant4Text($$[$0]); + break; + case 64: + this.$ = { text: $$[$0], type: "text" }; + break; + case 65: + this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type }; + break; + case 66: + this.$ = { text: $$[$0], type: "text" }; + break; + case 67: + this.$ = { text: $$[$0], type: "markdown" }; + break; + case 68: + this.$ = $$[$0]; + break; + case 69: + this.$ = $$[$0 - 1] + "" + $$[$0]; + break; } - function eNc() { + }, "anonymous"), + table: [{ 18: $V0, 26: 1, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, { 1: [3] }, { 18: $V0, 26: 8, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, { 18: $V0, 26: 9, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, o2($V5, [2, 33], { 29: 10 }), o2($V6, [2, 61]), o2($V6, [2, 62]), o2($V6, [2, 63]), { 1: [2, 30] }, { 1: [2, 31] }, o2($V7, $V8, { 30: 11, 31: 12, 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 1: [2, 32], 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $Vf, 25: $Vg, 35: $Vh, 37: $Vi, 39: $Vj, 41: $Vk, 42: $Vl, 48: $Vm, 50: $Vn, 51: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V5, [2, 34]), { 27: 45, 55: $V2, 56: $V3, 57: $V4 }, o2($V7, [2, 37]), o2($V7, $V8, { 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 31: 46, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $Vf, 25: $Vg, 35: $Vh, 37: $Vi, 39: $Vj, 41: $Vk, 42: $Vl, 48: $Vm, 50: $Vn, 51: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 39]), o2($V7, [2, 40]), o2($V7, [2, 41]), { 36: [1, 47] }, { 38: [1, 48] }, { 40: [1, 49] }, o2($V7, [2, 45]), o2($V7, [2, 46]), { 18: [1, 50] }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 51, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 52, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 53, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 54, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 55, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 56, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 44: [1, 57], 47: [1, 58], 58: 60, 59: 59, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, o2($VB, [2, 64]), o2($VB, [2, 66]), o2($VB, [2, 67]), o2($VB, [2, 70]), o2($VB, [2, 71]), o2($VB, [2, 72]), o2($VB, [2, 73]), o2($VB, [2, 74]), o2($VB, [2, 75]), o2($VB, [2, 76]), o2($VB, [2, 77]), o2($VB, [2, 78]), o2($VB, [2, 79]), o2($VB, [2, 80]), o2($V5, [2, 35]), o2($V7, [2, 38]), o2($V7, [2, 42]), o2($V7, [2, 43]), o2($V7, [2, 44]), { 3: 64, 4: $VC, 5: $VD, 6: $VE, 7: $VF, 8: $VG, 9: $VH, 10: $VI, 11: $VJ, 12: $VK, 13: $VL, 14: $VM, 15: $VN, 21: 63 }, o2($V7, [2, 53], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 49: [1, 77], 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 56], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 49: [1, 78], 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 57], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 58], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 59], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 60], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), { 45: [1, 79] }, { 44: [1, 80] }, o2($VB, [2, 65]), o2($VB, [2, 81]), o2($VB, [2, 82]), o2($VB, [2, 83]), { 3: 82, 4: $VC, 5: $VD, 6: $VE, 7: $VF, 8: $VG, 9: $VH, 10: $VI, 11: $VJ, 12: $VK, 13: $VL, 14: $VM, 15: $VN, 18: [1, 81] }, o2($VO, [2, 23]), o2($VO, [2, 1]), o2($VO, [2, 2]), o2($VO, [2, 3]), o2($VO, [2, 4]), o2($VO, [2, 5]), o2($VO, [2, 6]), o2($VO, [2, 7]), o2($VO, [2, 8]), o2($VO, [2, 9]), o2($VO, [2, 10]), o2($VO, [2, 11]), o2($VO, [2, 12]), o2($V7, [2, 52], { 58: 31, 43: 83, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 55], { 58: 31, 43: 84, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), { 46: [1, 85] }, { 45: [1, 86] }, { 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 16: 89, 17: $VV, 18: $VW, 19: $VX, 20: $VY, 22: 88, 23: 87 }, o2($VO, [2, 24]), o2($V7, [2, 51], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 54], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o2($V7, [2, 47], { 22: 88, 16: 89, 23: 100, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY }), { 46: [1, 101] }, o2($V7, [2, 29], { 10: $VZ }), o2($V_, [2, 27], { 16: 103, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY }), o2($V$, [2, 25]), o2($V$, [2, 13]), o2($V$, [2, 14]), o2($V$, [2, 15]), o2($V$, [2, 16]), o2($V$, [2, 17]), o2($V$, [2, 18]), o2($V$, [2, 19]), o2($V$, [2, 20]), o2($V$, [2, 21]), o2($V$, [2, 22]), o2($V7, [2, 49], { 10: $VZ }), o2($V7, [2, 48], { 22: 88, 16: 89, 23: 104, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY }), { 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 16: 89, 17: $VV, 18: $VW, 19: $VX, 20: $VY, 22: 105 }, o2($V$, [2, 26]), o2($V7, [2, 50], { 10: $VZ }), o2($V_, [2, 28], { 16: 103, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY })], + defaultActions: { 8: [2, 30], 9: [2, 31] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function IOc() { + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function MOc() { + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function WOc() { + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function YOc() { - } - function $Oc() { - } - function cPc() { - } - function iPc() { - } - function mPc() { - } - function oPc() { - } - function qPc() { - } - function sPc() { - } - function wPc() { - } - function APc() { - } - function FPc() { - } - function HPc() { - } - function NPc() { - } - function PPc() { - } - function TPc() { - } - function VPc() { - } - function ZPc() { - } - function _Pc() { - } - function bQc() { - } - function dQc() { - } - function SQc() { - } - function hRc() { - } - function HRc() { - } - function HSc() { - } - function pSc() { - } - function xSc() { - } - function zSc() { - } - function BSc() { - } - function DSc() { - } - function FSc() { - } - function CTc() { - } - function ITc() { - } - function KTc() { - } - function MTc() { - } - function XTc() { - } - function ZTc() { - } - function jVc() { - } - function lVc() { - } - function zVc() { - } - function IVc() { - } - function KVc() { - } - function KWc() { - } - function uWc() { - } - function xWc() { - } - function AWc() { - } - function QWc() { - } - function UWc() { - } - function qXc() { - } - function KXc() { - } - function OXc() { - } - function SXc() { - } - function $Xc() { - } - function mYc() { - } - function rYc() { - } - function zYc() { - } - function DYc() { - } - function FYc() { - } - function HYc() { - } - function JYc() { - } - function cZc() { - } - function gZc() { - } - function iZc() { - } - function pZc() { - } - function tZc() { - } - function vZc() { - } - function AZc() { - } - function GZc() { - } - function l_c() { - } - function l1c() { - } - function b1c() { - } - function d1c() { - } - function h1c() { - } - function n1c() { - } - function r1c() { - } - function v1c() { - } - function x1c() { - } - function D1c() { - } - function H1c() { - } - function L1c() { - } - function R1c() { - } - function V1c() { - } - function Z1c() { - } - function Z0c() { - } - function a0c() { - } - function c0c() { - } - function e0c() { - } - function k0c() { - } - function o0c() { - } - function b2c() { - } - function l2c() { - } - function p2c() { - } - function Y2c() { - } - function _2c() { - } - function A3c() { - } - function F3c() { - } - function I3c() { - } - function K3c() { - } - function M3c() { - } - function Q3c() { - } - function U3c() { - } - function c5c() { - } - function D5c() { - } - function G5c() { - } - function J5c() { - } - function N5c() { - } - function V5c() { - } - function p6c() { - } - function s6c() { - } - function H6c() { - } - function K6c() { - } - function _7c() { - } - function h8c() { - } - function j8c() { - } - function o8c() { - } - function r8c() { - } - function u8c() { - } - function R8c() { - } - function X8c() { - } - function o9c() { - } - function s9c() { - } - function x9c() { - } - function Qad() { - } - function rcd() { - } - function Xcd() { - } - function vdd() { - } - function Tdd() { - } - function _dd() { - } - function qed() { - } - function sed() { - } - function ved() { - } - function Hed() { - } - function Zed() { - } - function bfd() { - } - function ifd() { - } - function Gfd() { - } - function Ifd() { - } - function Igd() { - } - function agd() { - } - function dgd() { - } - function pgd() { - } - function Hgd() { - } - function Kgd() { - } - function Mgd() { - } - function Ogd() { + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + break; + case 1: + break; + case 2: + return 55; + break; + case 3: + break; + case 4: + this.begin("title"); + return 35; + break; + case 5: + this.popState(); + return "title_value"; + break; + case 6: + this.begin("acc_title"); + return 37; + break; + case 7: + this.popState(); + return "acc_title_value"; + break; + case 8: + this.begin("acc_descr"); + return 39; + break; + case 9: + this.popState(); + return "acc_descr_value"; + break; + case 10: + this.begin("acc_descr_multiline"); + break; + case 11: + this.popState(); + break; + case 12: + return "acc_descr_multiline_value"; + break; + case 13: + return 48; + break; + case 14: + return 50; + break; + case 15: + return 49; + break; + case 16: + return 51; + break; + case 17: + return 52; + break; + case 18: + return 53; + break; + case 19: + return 54; + break; + case 20: + return 25; + break; + case 21: + this.begin("md_string"); + break; + case 22: + return "MD_STR"; + break; + case 23: + this.popState(); + break; + case 24: + this.begin("string"); + break; + case 25: + this.popState(); + break; + case 26: + return "STR"; + break; + case 27: + this.begin("class_name"); + break; + case 28: + this.popState(); + return 47; + break; + case 29: + this.begin("point_start"); + return 44; + break; + case 30: + this.begin("point_x"); + return 45; + break; + case 31: + this.popState(); + break; + case 32: + this.popState(); + this.begin("point_y"); + break; + case 33: + this.popState(); + return 46; + break; + case 34: + return 28; + break; + case 35: + return 4; + break; + case 36: + return 11; + break; + case 37: + return 64; + break; + case 38: + return 10; + break; + case 39: + return 65; + break; + case 40: + return 65; + break; + case 41: + return 14; + break; + case 42: + return 13; + break; + case 43: + return 67; + break; + case 44: + return 66; + break; + case 45: + return 12; + break; + case 46: + return 8; + break; + case 47: + return 5; + break; + case 48: + return 18; + break; + case 49: + return 56; + break; + case 50: + return 63; + break; + case 51: + return 57; + break; + } + }, "anonymous"), + rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?: *x-axis *)/i, /^(?: *y-axis *)/i, /^(?: *--+> *)/i, /^(?: *quadrant-1 *)/i, /^(?: *quadrant-2 *)/i, /^(?: *quadrant-3 *)/i, /^(?: *quadrant-4 *)/i, /^(?:classDef\b)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?::::)/i, /^(?:^\w+)/i, /^(?:\s*:\s*\[\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?:\s*\] *)/i, /^(?:\s*,\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?: *quadrantChart *)/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s)/i, /^(?:;)/i, /^(?:[!"#$%&'*+,-.`?\\_/])/i, /^(?:$)/i], + conditions: { "class_name": { "rules": [28], "inclusive": false }, "point_y": { "rules": [33], "inclusive": false }, "point_x": { "rules": [32], "inclusive": false }, "point_start": { "rules": [30, 31], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "title": { "rules": [5], "inclusive": false }, "md_string": { "rules": [22, 23], "inclusive": false }, "string": { "rules": [25, 26], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 29, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser9.parser = parser9; + quadrant_default = parser9; + } + }); + + // src/diagrams/quadrant-chart/quadrantBuilder.ts + var defaultThemeVariables, QuadrantBuilder; + var init_quadrantBuilder = __esm({ + "src/diagrams/quadrant-chart/quadrantBuilder.ts"() { + "use strict"; + init_src32(); + init_defaultConfig(); + init_logger(); + init_theme_default(); + defaultThemeVariables = getThemeVariables3(); + QuadrantBuilder = class { + constructor() { + this.classes = /* @__PURE__ */ new Map(); + this.config = this.getDefaultConfig(); + this.themeConfig = this.getDefaultThemeConfig(); + this.data = this.getDefaultData(); + } + static { + __name(this, "QuadrantBuilder"); + } + getDefaultData() { + return { + titleText: "", + quadrant1Text: "", + quadrant2Text: "", + quadrant3Text: "", + quadrant4Text: "", + xAxisLeftText: "", + xAxisRightText: "", + yAxisBottomText: "", + yAxisTopText: "", + points: [] + }; + } + getDefaultConfig() { + return { + showXAxis: true, + showYAxis: true, + showTitle: true, + chartHeight: defaultConfig_default.quadrantChart?.chartWidth || 500, + chartWidth: defaultConfig_default.quadrantChart?.chartHeight || 500, + titlePadding: defaultConfig_default.quadrantChart?.titlePadding || 10, + titleFontSize: defaultConfig_default.quadrantChart?.titleFontSize || 20, + quadrantPadding: defaultConfig_default.quadrantChart?.quadrantPadding || 5, + xAxisLabelPadding: defaultConfig_default.quadrantChart?.xAxisLabelPadding || 5, + yAxisLabelPadding: defaultConfig_default.quadrantChart?.yAxisLabelPadding || 5, + xAxisLabelFontSize: defaultConfig_default.quadrantChart?.xAxisLabelFontSize || 16, + yAxisLabelFontSize: defaultConfig_default.quadrantChart?.yAxisLabelFontSize || 16, + quadrantLabelFontSize: defaultConfig_default.quadrantChart?.quadrantLabelFontSize || 16, + quadrantTextTopPadding: defaultConfig_default.quadrantChart?.quadrantTextTopPadding || 5, + pointTextPadding: defaultConfig_default.quadrantChart?.pointTextPadding || 5, + pointLabelFontSize: defaultConfig_default.quadrantChart?.pointLabelFontSize || 12, + pointRadius: defaultConfig_default.quadrantChart?.pointRadius || 5, + xAxisPosition: defaultConfig_default.quadrantChart?.xAxisPosition || "top", + yAxisPosition: defaultConfig_default.quadrantChart?.yAxisPosition || "left", + quadrantInternalBorderStrokeWidth: defaultConfig_default.quadrantChart?.quadrantInternalBorderStrokeWidth || 1, + quadrantExternalBorderStrokeWidth: defaultConfig_default.quadrantChart?.quadrantExternalBorderStrokeWidth || 2 + }; + } + getDefaultThemeConfig() { + return { + quadrant1Fill: defaultThemeVariables.quadrant1Fill, + quadrant2Fill: defaultThemeVariables.quadrant2Fill, + quadrant3Fill: defaultThemeVariables.quadrant3Fill, + quadrant4Fill: defaultThemeVariables.quadrant4Fill, + quadrant1TextFill: defaultThemeVariables.quadrant1TextFill, + quadrant2TextFill: defaultThemeVariables.quadrant2TextFill, + quadrant3TextFill: defaultThemeVariables.quadrant3TextFill, + quadrant4TextFill: defaultThemeVariables.quadrant4TextFill, + quadrantPointFill: defaultThemeVariables.quadrantPointFill, + quadrantPointTextFill: defaultThemeVariables.quadrantPointTextFill, + quadrantXAxisTextFill: defaultThemeVariables.quadrantXAxisTextFill, + quadrantYAxisTextFill: defaultThemeVariables.quadrantYAxisTextFill, + quadrantTitleFill: defaultThemeVariables.quadrantTitleFill, + quadrantInternalBorderStrokeFill: defaultThemeVariables.quadrantInternalBorderStrokeFill, + quadrantExternalBorderStrokeFill: defaultThemeVariables.quadrantExternalBorderStrokeFill + }; + } + clear() { + this.config = this.getDefaultConfig(); + this.themeConfig = this.getDefaultThemeConfig(); + this.data = this.getDefaultData(); + this.classes = /* @__PURE__ */ new Map(); + log.info("clear called"); + } + setData(data5) { + this.data = { ...this.data, ...data5 }; + } + addPoints(points) { + this.data.points = [...points, ...this.data.points]; + } + addClass(className, styles3) { + this.classes.set(className, styles3); + } + setConfig(config6) { + log.trace("setConfig called with: ", config6); + this.config = { ...this.config, ...config6 }; + } + setThemeConfig(themeConfig) { + log.trace("setThemeConfig called with: ", themeConfig); + this.themeConfig = { ...this.themeConfig, ...themeConfig }; + } + calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle) { + const xAxisSpaceCalculation = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize; + const xAxisSpace = { + top: xAxisPosition === "top" && showXAxis ? xAxisSpaceCalculation : 0, + bottom: xAxisPosition === "bottom" && showXAxis ? xAxisSpaceCalculation : 0 + }; + const yAxisSpaceCalculation = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize; + const yAxisSpace = { + left: this.config.yAxisPosition === "left" && showYAxis ? yAxisSpaceCalculation : 0, + right: this.config.yAxisPosition === "right" && showYAxis ? yAxisSpaceCalculation : 0 + }; + const titleSpaceCalculation = this.config.titleFontSize + this.config.titlePadding * 2; + const titleSpace = { + top: showTitle ? titleSpaceCalculation : 0 + }; + const quadrantLeft = this.config.quadrantPadding + yAxisSpace.left; + const quadrantTop = this.config.quadrantPadding + xAxisSpace.top + titleSpace.top; + const quadrantWidth = this.config.chartWidth - this.config.quadrantPadding * 2 - yAxisSpace.left - yAxisSpace.right; + const quadrantHeight = this.config.chartHeight - this.config.quadrantPadding * 2 - xAxisSpace.top - xAxisSpace.bottom - titleSpace.top; + const quadrantHalfWidth = quadrantWidth / 2; + const quadrantHalfHeight = quadrantHeight / 2; + const quadrantSpace = { + quadrantLeft, + quadrantTop, + quadrantWidth, + quadrantHalfWidth, + quadrantHeight, + quadrantHalfHeight + }; + return { + xAxisSpace, + yAxisSpace, + titleSpace, + quadrantSpace + }; + } + getAxisLabels(xAxisPosition, showXAxis, showYAxis, spaceData) { + const { quadrantSpace, titleSpace } = spaceData; + const { + quadrantHalfHeight, + quadrantHeight, + quadrantLeft, + quadrantHalfWidth, + quadrantTop, + quadrantWidth + } = quadrantSpace; + const drawXAxisLabelsInMiddle = Boolean(this.data.xAxisRightText); + const drawYAxisLabelsInMiddle = Boolean(this.data.yAxisTopText); + const axisLabels = []; + if (this.data.xAxisLeftText && showXAxis) { + axisLabels.push({ + text: this.data.xAxisLeftText, + fill: this.themeConfig.quadrantXAxisTextFill, + x: quadrantLeft + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0), + y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding, + fontSize: this.config.xAxisLabelFontSize, + verticalPos: drawXAxisLabelsInMiddle ? "center" : "left", + horizontalPos: "top", + rotation: 0 + }); + } + if (this.data.xAxisRightText && showXAxis) { + axisLabels.push({ + text: this.data.xAxisRightText, + fill: this.themeConfig.quadrantXAxisTextFill, + x: quadrantLeft + quadrantHalfWidth + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0), + y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding, + fontSize: this.config.xAxisLabelFontSize, + verticalPos: drawXAxisLabelsInMiddle ? "center" : "left", + horizontalPos: "top", + rotation: 0 + }); + } + if (this.data.yAxisBottomText && showYAxis) { + axisLabels.push({ + text: this.data.yAxisBottomText, + fill: this.themeConfig.quadrantYAxisTextFill, + x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding, + y: quadrantTop + quadrantHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0), + fontSize: this.config.yAxisLabelFontSize, + verticalPos: drawYAxisLabelsInMiddle ? "center" : "left", + horizontalPos: "top", + rotation: -90 + }); + } + if (this.data.yAxisTopText && showYAxis) { + axisLabels.push({ + text: this.data.yAxisTopText, + fill: this.themeConfig.quadrantYAxisTextFill, + x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding, + y: quadrantTop + quadrantHalfHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0), + fontSize: this.config.yAxisLabelFontSize, + verticalPos: drawYAxisLabelsInMiddle ? "center" : "left", + horizontalPos: "top", + rotation: -90 + }); + } + return axisLabels; + } + getQuadrants(spaceData) { + const { quadrantSpace } = spaceData; + const { quadrantHalfHeight, quadrantLeft, quadrantHalfWidth, quadrantTop } = quadrantSpace; + const quadrants = [ + { + text: { + text: this.data.quadrant1Text, + fill: this.themeConfig.quadrant1TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0 + }, + x: quadrantLeft + quadrantHalfWidth, + y: quadrantTop, + width: quadrantHalfWidth, + height: quadrantHalfHeight, + fill: this.themeConfig.quadrant1Fill + }, + { + text: { + text: this.data.quadrant2Text, + fill: this.themeConfig.quadrant2TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0 + }, + x: quadrantLeft, + y: quadrantTop, + width: quadrantHalfWidth, + height: quadrantHalfHeight, + fill: this.themeConfig.quadrant2Fill + }, + { + text: { + text: this.data.quadrant3Text, + fill: this.themeConfig.quadrant3TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0 + }, + x: quadrantLeft, + y: quadrantTop + quadrantHalfHeight, + width: quadrantHalfWidth, + height: quadrantHalfHeight, + fill: this.themeConfig.quadrant3Fill + }, + { + text: { + text: this.data.quadrant4Text, + fill: this.themeConfig.quadrant4TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0 + }, + x: quadrantLeft + quadrantHalfWidth, + y: quadrantTop + quadrantHalfHeight, + width: quadrantHalfWidth, + height: quadrantHalfHeight, + fill: this.themeConfig.quadrant4Fill } - function Qgd() { + ]; + for (const quadrant of quadrants) { + quadrant.text.x = quadrant.x + quadrant.width / 2; + if (this.data.points.length === 0) { + quadrant.text.y = quadrant.y + quadrant.height / 2; + quadrant.text.horizontalPos = "middle"; + } else { + quadrant.text.y = quadrant.y + this.config.quadrantTextTopPadding; + quadrant.text.horizontalPos = "top"; + } + } + return quadrants; + } + getQuadrantPoints(spaceData) { + const { quadrantSpace } = spaceData; + const { quadrantHeight, quadrantLeft, quadrantTop, quadrantWidth } = quadrantSpace; + const xAxis = linear2().domain([0, 1]).range([quadrantLeft, quadrantWidth + quadrantLeft]); + const yAxis = linear2().domain([0, 1]).range([quadrantHeight + quadrantTop, quadrantTop]); + const points = this.data.points.map((point8) => { + const classStyles = this.classes.get(point8.className); + if (classStyles) { + point8 = { ...classStyles, ...point8 }; + } + const props = { + x: xAxis(point8.x), + y: yAxis(point8.y), + fill: point8.color ?? this.themeConfig.quadrantPointFill, + radius: point8.radius ?? this.config.pointRadius, + text: { + text: point8.text, + fill: this.themeConfig.quadrantPointTextFill, + x: xAxis(point8.x), + y: yAxis(point8.y) + this.config.pointTextPadding, + verticalPos: "center", + horizontalPos: "top", + fontSize: this.config.pointLabelFontSize, + rotation: 0 + }, + strokeColor: point8.strokeColor ?? this.themeConfig.quadrantPointFill, + strokeWidth: point8.strokeWidth ?? "0px" + }; + return props; + }); + return points; + } + getBorders(spaceData) { + const halfExternalBorderWidth = this.config.quadrantExternalBorderStrokeWidth / 2; + const { quadrantSpace } = spaceData; + const { + quadrantHalfHeight, + quadrantHeight, + quadrantLeft, + quadrantHalfWidth, + quadrantTop, + quadrantWidth + } = quadrantSpace; + const borderLines = [ + // top border + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: quadrantLeft - halfExternalBorderWidth, + y1: quadrantTop, + x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth, + y2: quadrantTop + }, + // right border + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: quadrantLeft + quadrantWidth, + y1: quadrantTop + halfExternalBorderWidth, + x2: quadrantLeft + quadrantWidth, + y2: quadrantTop + quadrantHeight - halfExternalBorderWidth + }, + // bottom border + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: quadrantLeft - halfExternalBorderWidth, + y1: quadrantTop + quadrantHeight, + x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth, + y2: quadrantTop + quadrantHeight + }, + // left border + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: quadrantLeft, + y1: quadrantTop + halfExternalBorderWidth, + x2: quadrantLeft, + y2: quadrantTop + quadrantHeight - halfExternalBorderWidth + }, + // vertical inner border + { + strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, + strokeWidth: this.config.quadrantInternalBorderStrokeWidth, + x1: quadrantLeft + quadrantHalfWidth, + y1: quadrantTop + halfExternalBorderWidth, + x2: quadrantLeft + quadrantHalfWidth, + y2: quadrantTop + quadrantHeight - halfExternalBorderWidth + }, + // horizontal inner border + { + strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, + strokeWidth: this.config.quadrantInternalBorderStrokeWidth, + x1: quadrantLeft + halfExternalBorderWidth, + y1: quadrantTop + quadrantHalfHeight, + x2: quadrantLeft + quadrantWidth - halfExternalBorderWidth, + y2: quadrantTop + quadrantHalfHeight } - function Sgd() { + ]; + return borderLines; + } + getTitle(showTitle) { + if (showTitle) { + return { + text: this.data.titleText, + fill: this.themeConfig.quadrantTitleFill, + fontSize: this.config.titleFontSize, + horizontalPos: "top", + verticalPos: "center", + rotation: 0, + y: this.config.titlePadding, + x: this.config.chartWidth / 2 + }; + } + return; + } + build() { + const showXAxis = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText); + const showYAxis = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText); + const showTitle = this.config.showTitle && !!this.data.titleText; + const xAxisPosition = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition; + const calculatedSpace = this.calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle); + return { + points: this.getQuadrantPoints(calculatedSpace), + quadrants: this.getQuadrants(calculatedSpace), + axisLabels: this.getAxisLabels(xAxisPosition, showXAxis, showYAxis, calculatedSpace), + borderLines: this.getBorders(calculatedSpace), + title: this.getTitle(showTitle) + }; + } + }; + } + }); + + // src/diagrams/quadrant-chart/utils.ts + function validateHexCode(value2) { + return !/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(value2); + } + function validateNumber(value2) { + return !/^\d+$/.test(value2); + } + function validateSizeInPixels(value2) { + return !/^\d+px$/.test(value2); + } + var InvalidStyleError; + var init_utils5 = __esm({ + "src/diagrams/quadrant-chart/utils.ts"() { + "use strict"; + InvalidStyleError = class extends Error { + static { + __name(this, "InvalidStyleError"); + } + constructor(style3, value2, type3) { + super(`value for ${style3} ${value2} is invalid, please use a valid ${type3}`); + this.name = "InvalidStyleError"; + } + }; + __name(validateHexCode, "validateHexCode"); + __name(validateNumber, "validateNumber"); + __name(validateSizeInPixels, "validateSizeInPixels"); + } + }); + + // src/diagrams/quadrant-chart/quadrantDb.ts + function textSanitizer(text2) { + return sanitizeText(text2.trim(), config4); + } + function setQuadrant1Text(textObj) { + quadrantBuilder.setData({ quadrant1Text: textSanitizer(textObj.text) }); + } + function setQuadrant2Text(textObj) { + quadrantBuilder.setData({ quadrant2Text: textSanitizer(textObj.text) }); + } + function setQuadrant3Text(textObj) { + quadrantBuilder.setData({ quadrant3Text: textSanitizer(textObj.text) }); + } + function setQuadrant4Text(textObj) { + quadrantBuilder.setData({ quadrant4Text: textSanitizer(textObj.text) }); + } + function setXAxisLeftText(textObj) { + quadrantBuilder.setData({ xAxisLeftText: textSanitizer(textObj.text) }); + } + function setXAxisRightText(textObj) { + quadrantBuilder.setData({ xAxisRightText: textSanitizer(textObj.text) }); + } + function setYAxisTopText(textObj) { + quadrantBuilder.setData({ yAxisTopText: textSanitizer(textObj.text) }); + } + function setYAxisBottomText(textObj) { + quadrantBuilder.setData({ yAxisBottomText: textSanitizer(textObj.text) }); + } + function parseStyles(styles3) { + const stylesObject = {}; + for (const style3 of styles3) { + const [key, value2] = style3.trim().split(/\s*:\s*/); + if (key === "radius") { + if (validateNumber(value2)) { + throw new InvalidStyleError(key, value2, "number"); + } + stylesObject.radius = parseInt(value2); + } else if (key === "color") { + if (validateHexCode(value2)) { + throw new InvalidStyleError(key, value2, "hex code"); + } + stylesObject.color = value2; + } else if (key === "stroke-color") { + if (validateHexCode(value2)) { + throw new InvalidStyleError(key, value2, "hex code"); + } + stylesObject.strokeColor = value2; + } else if (key === "stroke-width") { + if (validateSizeInPixels(value2)) { + throw new InvalidStyleError(key, value2, "number of pixels (eg. 10px)"); + } + stylesObject.strokeWidth = value2; + } else { + throw new Error(`style named ${key} is not supported.`); + } + } + return stylesObject; + } + function addPoint(textObj, className, x5, y5, styles3) { + const stylesObject = parseStyles(styles3); + quadrantBuilder.addPoints([ + { + x: x5, + y: y5, + text: textSanitizer(textObj.text), + className, + ...stylesObject + } + ]); + } + function addClass2(className, styles3) { + quadrantBuilder.addClass(className, parseStyles(styles3)); + } + function setWidth(width3) { + quadrantBuilder.setConfig({ chartWidth: width3 }); + } + function setHeight(height2) { + quadrantBuilder.setConfig({ chartHeight: height2 }); + } + function getQuadrantData() { + const config6 = getConfig2(); + const { themeVariables, quadrantChart: quadrantChartConfig } = config6; + if (quadrantChartConfig) { + quadrantBuilder.setConfig(quadrantChartConfig); + } + quadrantBuilder.setThemeConfig({ + quadrant1Fill: themeVariables.quadrant1Fill, + quadrant2Fill: themeVariables.quadrant2Fill, + quadrant3Fill: themeVariables.quadrant3Fill, + quadrant4Fill: themeVariables.quadrant4Fill, + quadrant1TextFill: themeVariables.quadrant1TextFill, + quadrant2TextFill: themeVariables.quadrant2TextFill, + quadrant3TextFill: themeVariables.quadrant3TextFill, + quadrant4TextFill: themeVariables.quadrant4TextFill, + quadrantPointFill: themeVariables.quadrantPointFill, + quadrantPointTextFill: themeVariables.quadrantPointTextFill, + quadrantXAxisTextFill: themeVariables.quadrantXAxisTextFill, + quadrantYAxisTextFill: themeVariables.quadrantYAxisTextFill, + quadrantExternalBorderStrokeFill: themeVariables.quadrantExternalBorderStrokeFill, + quadrantInternalBorderStrokeFill: themeVariables.quadrantInternalBorderStrokeFill, + quadrantTitleFill: themeVariables.quadrantTitleFill + }); + quadrantBuilder.setData({ titleText: getDiagramTitle() }); + return quadrantBuilder.build(); + } + var config4, quadrantBuilder, clear14, quadrantDb_default; + var init_quadrantDb = __esm({ + "src/diagrams/quadrant-chart/quadrantDb.ts"() { + "use strict"; + init_diagramAPI(); + init_common(); + init_commonDb(); + init_quadrantBuilder(); + init_utils5(); + config4 = getConfig2(); + __name(textSanitizer, "textSanitizer"); + quadrantBuilder = new QuadrantBuilder(); + __name(setQuadrant1Text, "setQuadrant1Text"); + __name(setQuadrant2Text, "setQuadrant2Text"); + __name(setQuadrant3Text, "setQuadrant3Text"); + __name(setQuadrant4Text, "setQuadrant4Text"); + __name(setXAxisLeftText, "setXAxisLeftText"); + __name(setXAxisRightText, "setXAxisRightText"); + __name(setYAxisTopText, "setYAxisTopText"); + __name(setYAxisBottomText, "setYAxisBottomText"); + __name(parseStyles, "parseStyles"); + __name(addPoint, "addPoint"); + __name(addClass2, "addClass"); + __name(setWidth, "setWidth"); + __name(setHeight, "setHeight"); + __name(getQuadrantData, "getQuadrantData"); + clear14 = /* @__PURE__ */ __name(function() { + quadrantBuilder.clear(); + clear(); + }, "clear"); + quadrantDb_default = { + setWidth, + setHeight, + setQuadrant1Text, + setQuadrant2Text, + setQuadrant3Text, + setQuadrant4Text, + setXAxisLeftText, + setXAxisRightText, + setYAxisTopText, + setYAxisBottomText, + parseStyles, + addPoint, + addClass: addClass2, + getQuadrantData, + clear: clear14, + setAccTitle, + getAccTitle, + setDiagramTitle, + getDiagramTitle, + getAccDescription, + setAccDescription + }; + } + }); + + // src/diagrams/quadrant-chart/quadrantRenderer.ts + var draw8, quadrantRenderer_default; + var init_quadrantRenderer = __esm({ + "src/diagrams/quadrant-chart/quadrantRenderer.ts"() { + "use strict"; + init_src32(); + init_diagramAPI(); + init_logger(); + init_setupGraphViewbox(); + draw8 = /* @__PURE__ */ __name((txt, id26, _version, diagObj) => { + function getDominantBaseLine(horizontalPos) { + return horizontalPos === "top" ? "hanging" : "middle"; + } + __name(getDominantBaseLine, "getDominantBaseLine"); + function getTextAnchor(verticalPos) { + return verticalPos === "left" ? "start" : "middle"; + } + __name(getTextAnchor, "getTextAnchor"); + function getTransformation(data5) { + return `translate(${data5.x}, ${data5.y}) rotate(${data5.rotation || 0})`; + } + __name(getTransformation, "getTransformation"); + const conf8 = getConfig2(); + log.debug("Rendering quadrant chart\n" + txt); + const securityLevel = conf8.securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id="${id26}"]`); + const group2 = svg.append("g").attr("class", "main"); + const width3 = conf8.quadrantChart?.chartWidth ?? 500; + const height2 = conf8.quadrantChart?.chartHeight ?? 500; + configureSvgSize(svg, height2, width3, conf8.quadrantChart?.useMaxWidth ?? true); + svg.attr("viewBox", "0 0 " + width3 + " " + height2); + diagObj.db.setHeight(height2); + diagObj.db.setWidth(width3); + const quadrantData = diagObj.db.getQuadrantData(); + const quadrantsGroup = group2.append("g").attr("class", "quadrants"); + const borderGroup = group2.append("g").attr("class", "border"); + const dataPointGroup = group2.append("g").attr("class", "data-points"); + const labelGroup = group2.append("g").attr("class", "labels"); + const titleGroup = group2.append("g").attr("class", "title"); + if (quadrantData.title) { + titleGroup.append("text").attr("x", 0).attr("y", 0).attr("fill", quadrantData.title.fill).attr("font-size", quadrantData.title.fontSize).attr("dominant-baseline", getDominantBaseLine(quadrantData.title.horizontalPos)).attr("text-anchor", getTextAnchor(quadrantData.title.verticalPos)).attr("transform", getTransformation(quadrantData.title)).text(quadrantData.title.text); + } + if (quadrantData.borderLines) { + borderGroup.selectAll("line").data(quadrantData.borderLines).enter().append("line").attr("x1", (data5) => data5.x1).attr("y1", (data5) => data5.y1).attr("x2", (data5) => data5.x2).attr("y2", (data5) => data5.y2).style("stroke", (data5) => data5.strokeFill).style("stroke-width", (data5) => data5.strokeWidth); + } + const quadrants = quadrantsGroup.selectAll("g.quadrant").data(quadrantData.quadrants).enter().append("g").attr("class", "quadrant"); + quadrants.append("rect").attr("x", (data5) => data5.x).attr("y", (data5) => data5.y).attr("width", (data5) => data5.width).attr("height", (data5) => data5.height).attr("fill", (data5) => data5.fill); + quadrants.append("text").attr("x", 0).attr("y", 0).attr("fill", (data5) => data5.text.fill).attr("font-size", (data5) => data5.text.fontSize).attr( + "dominant-baseline", + (data5) => getDominantBaseLine(data5.text.horizontalPos) + ).attr("text-anchor", (data5) => getTextAnchor(data5.text.verticalPos)).attr("transform", (data5) => getTransformation(data5.text)).text((data5) => data5.text.text); + const labels = labelGroup.selectAll("g.label").data(quadrantData.axisLabels).enter().append("g").attr("class", "label"); + labels.append("text").attr("x", 0).attr("y", 0).text((data5) => data5.text).attr("fill", (data5) => data5.fill).attr("font-size", (data5) => data5.fontSize).attr("dominant-baseline", (data5) => getDominantBaseLine(data5.horizontalPos)).attr("text-anchor", (data5) => getTextAnchor(data5.verticalPos)).attr("transform", (data5) => getTransformation(data5)); + const dataPoints = dataPointGroup.selectAll("g.data-point").data(quadrantData.points).enter().append("g").attr("class", "data-point"); + dataPoints.append("circle").attr("cx", (data5) => data5.x).attr("cy", (data5) => data5.y).attr("r", (data5) => data5.radius).attr("fill", (data5) => data5.fill).attr("stroke", (data5) => data5.strokeColor).attr("stroke-width", (data5) => data5.strokeWidth); + dataPoints.append("text").attr("x", 0).attr("y", 0).text((data5) => data5.text.text).attr("fill", (data5) => data5.text.fill).attr("font-size", (data5) => data5.text.fontSize).attr( + "dominant-baseline", + (data5) => getDominantBaseLine(data5.text.horizontalPos) + ).attr("text-anchor", (data5) => getTextAnchor(data5.text.verticalPos)).attr("transform", (data5) => getTransformation(data5.text)); + }, "draw"); + quadrantRenderer_default = { + draw: draw8 + }; + } + }); + + // src/diagrams/quadrant-chart/quadrantDiagram.ts + var quadrantDiagram_exports = {}; + __export(quadrantDiagram_exports, { + diagram: () => diagram8 + }); + var diagram8; + var init_quadrantDiagram = __esm({ + "src/diagrams/quadrant-chart/quadrantDiagram.ts"() { + "use strict"; + init_quadrant(); + init_quadrantDb(); + init_quadrantRenderer(); + diagram8 = { + parser: quadrant_default, + db: quadrantDb_default, + renderer: quadrantRenderer_default, + styles: /* @__PURE__ */ __name(() => "", "styles") + }; + } + }); + + // src/diagrams/xychart/parser/xychart.jison + var parser10, xychart_default; + var init_xychart = __esm({ + "src/diagrams/xychart/parser/xychart.jison"() { + "use strict"; + parser10 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 10, 12, 14, 16, 18, 19, 21, 23], $V1 = [2, 6], $V2 = [1, 3], $V3 = [1, 5], $V4 = [1, 6], $V5 = [1, 7], $V6 = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $V7 = [1, 25], $V8 = [1, 26], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 30], $Vc = [1, 31], $Vd = [1, 32], $Ve = [1, 33], $Vf = [1, 34], $Vg = [1, 35], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 43], $Vk = [1, 42], $Vl = [1, 47], $Vm = [1, 50], $Vn = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $Vo = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], $Vp = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], $Vq = [1, 64]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "eol": 4, "XYCHART": 5, "chartConfig": 6, "document": 7, "CHART_ORIENTATION": 8, "statement": 9, "title": 10, "text": 11, "X_AXIS": 12, "parseXAxis": 13, "Y_AXIS": 14, "parseYAxis": 15, "LINE": 16, "plotData": 17, "BAR": 18, "acc_title": 19, "acc_title_value": 20, "acc_descr": 21, "acc_descr_value": 22, "acc_descr_multiline_value": 23, "SQUARE_BRACES_START": 24, "commaSeparatedNumbers": 25, "SQUARE_BRACES_END": 26, "NUMBER_WITH_DECIMAL": 27, "COMMA": 28, "xAxisData": 29, "bandData": 30, "ARROW_DELIMITER": 31, "commaSeparatedTexts": 32, "yAxisData": 33, "NEWLINE": 34, "SEMI": 35, "EOF": 36, "alphaNum": 37, "STR": 38, "MD_STR": 39, "alphaNumToken": 40, "AMP": 41, "NUM": 42, "ALPHA": 43, "PLUS": 44, "EQUALS": 45, "MULT": 46, "DOT": 47, "BRKT": 48, "MINUS": 49, "UNDERSCORE": 50, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" }, + productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 5: + yy.setOrientation($$[$0]); + break; + case 9: + yy.setDiagramTitle($$[$0].text.trim()); + break; + case 12: + yy.setLineData({ text: "", type: "text" }, $$[$0]); + break; + case 13: + yy.setLineData($$[$0 - 1], $$[$0]); + break; + case 14: + yy.setBarData({ text: "", type: "text" }, $$[$0]); + break; + case 15: + yy.setBarData($$[$0 - 1], $$[$0]); + break; + case 16: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 17: + case 18: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 19: + this.$ = $$[$0 - 1]; + break; + case 20: + this.$ = [Number($$[$0 - 2]), ...$$[$0]]; + break; + case 21: + this.$ = [Number($$[$0])]; + break; + case 22: + yy.setXAxisTitle($$[$0]); + break; + case 23: + yy.setXAxisTitle($$[$0 - 1]); + break; + case 24: + yy.setXAxisTitle({ type: "text", text: "" }); + break; + case 25: + yy.setXAxisBand($$[$0]); + break; + case 26: + yy.setXAxisRangeData(Number($$[$0 - 2]), Number($$[$0])); + break; + case 27: + this.$ = $$[$0 - 1]; + break; + case 28: + this.$ = [$$[$0 - 2], ...$$[$0]]; + break; + case 29: + this.$ = [$$[$0]]; + break; + case 30: + yy.setYAxisTitle($$[$0]); + break; + case 31: + yy.setYAxisTitle($$[$0 - 1]); + break; + case 32: + yy.setYAxisTitle({ type: "text", text: "" }); + break; + case 33: + yy.setYAxisRangeData(Number($$[$0 - 2]), Number($$[$0])); + break; + case 37: + this.$ = { text: $$[$0], type: "text" }; + break; + case 38: + this.$ = { text: $$[$0], type: "text" }; + break; + case 39: + this.$ = { text: $$[$0], type: "markdown" }; + break; + case 40: + this.$ = $$[$0]; + break; + case 41: + this.$ = $$[$0 - 1] + "" + $$[$0]; + break; } - function Ugd() { + }, "anonymous"), + table: [o2($V0, $V1, { 3: 1, 4: 2, 7: 4, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), { 1: [3] }, o2($V0, $V1, { 4: 2, 7: 4, 3: 8, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), o2($V0, $V1, { 4: 2, 7: 4, 6: 9, 3: 10, 5: $V2, 8: [1, 11], 34: $V3, 35: $V4, 36: $V5 }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, o2($V6, [2, 34]), o2($V6, [2, 35]), o2($V6, [2, 36]), { 1: [2, 1] }, o2($V0, $V1, { 4: 2, 7: 4, 3: 21, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), { 1: [2, 3] }, o2($V6, [2, 5]), o2($V0, [2, 7], { 4: 22, 34: $V3, 35: $V4, 36: $V5 }), { 11: 23, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 39, 13: 38, 24: $Vj, 27: $Vk, 29: 40, 30: 41, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 45, 15: 44, 27: $Vl, 33: 46, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 49, 17: 48, 24: $Vm, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 52, 17: 51, 24: $Vm, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 20: [1, 53] }, { 22: [1, 54] }, o2($Vn, [2, 18]), { 1: [2, 2] }, o2($Vn, [2, 8]), o2($Vn, [2, 9]), o2($Vo, [2, 37], { 40: 55, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }), o2($Vo, [2, 38]), o2($Vo, [2, 39]), o2($Vp, [2, 40]), o2($Vp, [2, 42]), o2($Vp, [2, 43]), o2($Vp, [2, 44]), o2($Vp, [2, 45]), o2($Vp, [2, 46]), o2($Vp, [2, 47]), o2($Vp, [2, 48]), o2($Vp, [2, 49]), o2($Vp, [2, 50]), o2($Vp, [2, 51]), o2($Vn, [2, 10]), o2($Vn, [2, 22], { 30: 41, 29: 56, 24: $Vj, 27: $Vk }), o2($Vn, [2, 24]), o2($Vn, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, o2($Vn, [2, 11]), o2($Vn, [2, 30], { 33: 60, 27: $Vl }), o2($Vn, [2, 32]), { 31: [1, 61] }, o2($Vn, [2, 12]), { 17: 62, 24: $Vm }, { 25: 63, 27: $Vq }, o2($Vn, [2, 14]), { 17: 65, 24: $Vm }, o2($Vn, [2, 16]), o2($Vn, [2, 17]), o2($Vp, [2, 41]), o2($Vn, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, o2($Vn, [2, 31]), { 27: [1, 69] }, o2($Vn, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, o2($Vn, [2, 15]), o2($Vn, [2, 26]), o2($Vn, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, o2($Vn, [2, 33]), o2($Vn, [2, 19]), { 25: 73, 27: $Vq }, { 26: [2, 28] }, { 26: [2, 20] }], + defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function Wgd() { + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function Ygd() { + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function $gd() { + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function ahd() { - } - function chd() { - } - function ehd() { - } - function ghd() { - } - function ihd() { - } - function khd() { - } - function mhd() { - } - function ohd() { - } - function qhd() { - } - function shd() { - } - function Shd() { - } - function lkd() { - } - function znd() { - } - function Jpd() { - } - function jrd() { - } - function Mrd() { - } - function Qrd() { - } - function Urd() { - } - function Yrd() { - } - function Yud() { - } - function eud() { - } - function asd() { - } - function Lsd() { - } - function btd() { - } - function dtd() { - } - function jtd() { - } - function otd() { - } - function ztd() { - } - function Xxd() { - } - function $yd() { - } - function rzd() { - } - function Rzd() { - } - function KAd() { - } - function hCd() { - } - function _Cd() { - } - function _Sd() { - } - function OSd() { - } - function BDd() { - } - function BId() { - } - function JId() { - } - function YHd() { - } - function fLd() { - } - function cPd() { - } - function hQd() { - } - function AQd() { - } - function kUd() { - } - function VUd() { - } - function pVd() { - } - function W$d() { - } - function Z$d() { - } - function a_d() { - } - function i_d() { - } - function v_d() { - } - function y_d() { - } - function f1d() { - } - function L5d() { - } - function v6d() { - } - function b8d() { - } - function e8d() { - } - function h8d() { - } - function k8d() { - } - function n8d() { - } - function q8d() { - } - function t8d() { - } - function w8d() { - } - function z8d() { - } - function X9d() { - } - function _9d() { - } - function Mae() { - } - function cbe() { - } - function ebe() { - } - function hbe() { - } - function kbe() { - } - function nbe() { - } - function qbe() { - } - function tbe() { - } - function wbe() { - } - function zbe() { - } - function Cbe() { - } - function Fbe() { - } - function Ibe() { - } - function Lbe() { - } - function Obe() { - } - function Rbe() { - } - function Ube() { - } - function Xbe() { - } - function $be() { - } - function bce() { - } - function ece() { - } - function hce() { - } - function kce() { - } - function nce() { - } - function qce() { - } - function tce() { - } - function wce() { - } - function zce() { - } - function Cce() { - } - function Fce() { - } - function Ice() { - } - function Lce() { - } - function Oce() { - } - function Rce() { - } - function Uce() { - } - function Xce() { - } - function $ce() { - } - function bde() { - } - function ede() { - } - function hde() { - } - function kde() { - } - function nde() { - } - function qde() { - } - function tde() { - } - function wde() { - } - function Hie() { - } - function rke() { - } - function rne() { - } - function Ene() { - } - function Gne() { - } - function Jne() { - } - function Mne() { - } - function Pne() { - } - function Sne() { - } - function Vne() { - } - function Yne() { - } - function _ne() { - } - function yme() { - } - function coe() { - } - function foe() { - } - function ioe() { - } - function loe() { - } - function ooe() { - } - function roe() { - } - function uoe() { - } - function xoe() { - } - function Aoe() { - } - function Doe() { - } - function Goe() { - } - function Joe() { - } - function Moe() { - } - function Poe() { - } - function Soe() { - } - function Voe() { - } - function Yoe() { - } - function _oe() { - } - function cpe() { - } - function fpe() { - } - function ipe() { - } - function lpe() { - } - function ope() { - } - function rpe() { - } - function upe() { - } - function xpe() { - } - function Ape() { - } - function Dpe() { - } - function Gpe() { - } - function Jpe() { - } - function Mpe() { - } - function Ppe() { - } - function Spe() { - } - function Vpe() { - } - function Ype() { - } - function _pe() { - } - function cqe() { - } - function fqe() { - } - function iqe() { - } - function lqe() { - } - function oqe() { - } - function rqe() { - } - function uqe() { - } - function Tqe() { - } - function sue() { - } - function Cue() { - } - function zl() { - wb(); - } - function z7b() { - s7b(); - } - function ZHb() { - YHb(); - } - function fSb() { - eSb(); - } - function vSb() { - tSb(); - } - function PUb() { - OUb(); - } - function AVb() { - yVb(); - } - function RVb() { - QVb(); - } - function fWb() { - dWb(); - } - function N5b() { - H5b(); - } - function $9b() { - U9b(); - } - function Lcc() { - Hcc(); - } - function pdc() { - Zcc(); - } - function pec() { - iec(); - } - function pGc() { - nGc(); - } - function jGc() { - gGc(); - } - function YGc() { - SGc(); - } - function cGc() { - _Fc(); - } - function NFc() { - KFc(); - } - function xgc() { - sgc(); - } - function xHc() { - tHc(); - } - function pHc() { - lHc(); - } - function IHc() { - CHc(); - } - function XHc() { - RHc(); + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + break; + case 1: + break; + case 2: + this.popState(); + return 34; + break; + case 3: + this.popState(); + return 34; + break; + case 4: + return 34; + break; + case 5: + break; + case 6: + return 10; + break; + case 7: + this.pushState("acc_title"); + return 19; + break; + case 8: + this.popState(); + return "acc_title_value"; + break; + case 9: + this.pushState("acc_descr"); + return 21; + break; + case 10: + this.popState(); + return "acc_descr_value"; + break; + case 11: + this.pushState("acc_descr_multiline"); + break; + case 12: + this.popState(); + break; + case 13: + return "acc_descr_multiline_value"; + break; + case 14: + return 5; + break; + case 15: + return 8; + break; + case 16: + this.pushState("axis_data"); + return "X_AXIS"; + break; + case 17: + this.pushState("axis_data"); + return "Y_AXIS"; + break; + case 18: + this.pushState("axis_band_data"); + return 24; + break; + case 19: + return 31; + break; + case 20: + this.pushState("data"); + return 16; + break; + case 21: + this.pushState("data"); + return 18; + break; + case 22: + this.pushState("data_inner"); + return 24; + break; + case 23: + return 27; + break; + case 24: + this.popState(); + return 26; + break; + case 25: + this.popState(); + break; + case 26: + this.pushState("string"); + break; + case 27: + this.popState(); + break; + case 28: + return "STR"; + break; + case 29: + return 24; + break; + case 30: + return 26; + break; + case 31: + return 43; + break; + case 32: + return "COLON"; + break; + case 33: + return 44; + break; + case 34: + return 28; + break; + case 35: + return 45; + break; + case 36: + return 46; + break; + case 37: + return 48; + break; + case 38: + return 50; + break; + case 39: + return 47; + break; + case 40: + return 41; + break; + case 41: + return 49; + break; + case 42: + return 42; + break; + case 43: + break; + case 44: + return 35; + break; + case 45: + return 36; + break; + } + }, "anonymous"), + rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i], + conditions: { "data_inner": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "data": { "rules": [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_band_data": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_data": { "rules": [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "title": { "rules": [], "inclusive": false }, "md_string": { "rules": [], "inclusive": false }, "string": { "rules": [27, 28], "inclusive": false }, "INITIAL": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser10.parser = parser10; + xychart_default = parser10; + } + }); + + // src/diagrams/xychart/chartBuilder/interfaces.ts + function isBarPlot(data5) { + return data5.type === "bar"; + } + function isBandAxisData(data5) { + return data5.type === "band"; + } + function isLinearAxisData(data5) { + return data5.type === "linear"; + } + var init_interfaces = __esm({ + "src/diagrams/xychart/chartBuilder/interfaces.ts"() { + "use strict"; + __name(isBarPlot, "isBarPlot"); + __name(isBandAxisData, "isBandAxisData"); + __name(isLinearAxisData, "isLinearAxisData"); + } + }); + + // src/diagrams/xychart/chartBuilder/textDimensionCalculator.ts + var TextDimensionCalculatorWithFont; + var init_textDimensionCalculator = __esm({ + "src/diagrams/xychart/chartBuilder/textDimensionCalculator.ts"() { + "use strict"; + init_createText(); + TextDimensionCalculatorWithFont = class { + constructor(parentGroup) { + this.parentGroup = parentGroup; + } + static { + __name(this, "TextDimensionCalculatorWithFont"); + } + getMaxDimension(texts, fontSize) { + if (!this.parentGroup) { + return { + width: texts.reduce((acc, cur) => Math.max(cur.length, acc), 0) * fontSize, + height: fontSize + }; + } + const dimension = { + width: 0, + height: 0 + }; + const elem = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", fontSize); + for (const t4 of texts) { + const bbox = computeDimensionOfText(elem, 1, t4); + const width3 = bbox ? bbox.width : t4.length * fontSize; + const height2 = bbox ? bbox.height : fontSize; + dimension.width = Math.max(dimension.width, width3); + dimension.height = Math.max(dimension.height, height2); + } + elem.remove(); + return dimension; + } + }; + } + }); + + // src/diagrams/xychart/chartBuilder/components/axis/baseAxis.ts + var BAR_WIDTH_TO_TICK_WIDTH_RATIO, MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL, BaseAxis; + var init_baseAxis = __esm({ + "src/diagrams/xychart/chartBuilder/components/axis/baseAxis.ts"() { + "use strict"; + BAR_WIDTH_TO_TICK_WIDTH_RATIO = 0.7; + MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL = 0.2; + BaseAxis = class { + constructor(axisConfig, title2, textDimensionCalculator, axisThemeConfig) { + this.axisConfig = axisConfig; + this.title = title2; + this.textDimensionCalculator = textDimensionCalculator; + this.axisThemeConfig = axisThemeConfig; + this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }; + this.axisPosition = "left"; + this.showTitle = false; + this.showLabel = false; + this.showTick = false; + this.showAxisLine = false; + this.outerPadding = 0; + this.titleTextHeight = 0; + this.labelTextHeight = 0; + this.range = [0, 10]; + this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }; + this.axisPosition = "left"; + } + static { + __name(this, "BaseAxis"); + } + setRange(range3) { + this.range = range3; + if (this.axisPosition === "left" || this.axisPosition === "right") { + this.boundingRect.height = range3[1] - range3[0]; + } else { + this.boundingRect.width = range3[1] - range3[0]; + } + this.recalculateScale(); + } + getRange() { + return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding]; + } + setAxisPosition(axisPosition) { + this.axisPosition = axisPosition; + this.setRange(this.range); + } + getTickDistance() { + const range3 = this.getRange(); + return Math.abs(range3[0] - range3[1]) / this.getTickValues().length; + } + getAxisOuterPadding() { + return this.outerPadding; + } + getLabelDimension() { + return this.textDimensionCalculator.getMaxDimension( + this.getTickValues().map((tick) => tick.toString()), + this.axisConfig.labelFontSize + ); + } + recalculateOuterPaddingToDrawBar() { + if (BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() > this.outerPadding * 2) { + this.outerPadding = Math.floor(BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() / 2); + } + this.recalculateScale(); + } + calculateSpaceIfDrawnHorizontally(availableSpace) { + let availableHeight = availableSpace.height; + if (this.axisConfig.showAxisLine && availableHeight > this.axisConfig.axisLineWidth) { + availableHeight -= this.axisConfig.axisLineWidth; + this.showAxisLine = true; + } + if (this.axisConfig.showLabel) { + const spaceRequired = this.getLabelDimension(); + const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.width; + this.outerPadding = Math.min(spaceRequired.width / 2, maxPadding); + const heightRequired = spaceRequired.height + this.axisConfig.labelPadding * 2; + this.labelTextHeight = spaceRequired.height; + if (heightRequired <= availableHeight) { + availableHeight -= heightRequired; + this.showLabel = true; + } + } + if (this.axisConfig.showTick && availableHeight >= this.axisConfig.tickLength) { + this.showTick = true; + availableHeight -= this.axisConfig.tickLength; + } + if (this.axisConfig.showTitle && this.title) { + const spaceRequired = this.textDimensionCalculator.getMaxDimension( + [this.title], + this.axisConfig.titleFontSize + ); + const heightRequired = spaceRequired.height + this.axisConfig.titlePadding * 2; + this.titleTextHeight = spaceRequired.height; + if (heightRequired <= availableHeight) { + availableHeight -= heightRequired; + this.showTitle = true; + } + } + this.boundingRect.width = availableSpace.width; + this.boundingRect.height = availableSpace.height - availableHeight; + } + calculateSpaceIfDrawnVertical(availableSpace) { + let availableWidth = availableSpace.width; + if (this.axisConfig.showAxisLine && availableWidth > this.axisConfig.axisLineWidth) { + availableWidth -= this.axisConfig.axisLineWidth; + this.showAxisLine = true; + } + if (this.axisConfig.showLabel) { + const spaceRequired = this.getLabelDimension(); + const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.height; + this.outerPadding = Math.min(spaceRequired.height / 2, maxPadding); + const widthRequired = spaceRequired.width + this.axisConfig.labelPadding * 2; + if (widthRequired <= availableWidth) { + availableWidth -= widthRequired; + this.showLabel = true; + } + } + if (this.axisConfig.showTick && availableWidth >= this.axisConfig.tickLength) { + this.showTick = true; + availableWidth -= this.axisConfig.tickLength; + } + if (this.axisConfig.showTitle && this.title) { + const spaceRequired = this.textDimensionCalculator.getMaxDimension( + [this.title], + this.axisConfig.titleFontSize + ); + const widthRequired = spaceRequired.height + this.axisConfig.titlePadding * 2; + this.titleTextHeight = spaceRequired.height; + if (widthRequired <= availableWidth) { + availableWidth -= widthRequired; + this.showTitle = true; } - function boc() { - Mnc(); + } + this.boundingRect.width = availableSpace.width - availableWidth; + this.boundingRect.height = availableSpace.height; + } + calculateSpace(availableSpace) { + if (this.axisPosition === "left" || this.axisPosition === "right") { + this.calculateSpaceIfDrawnVertical(availableSpace); + } else { + this.calculateSpaceIfDrawnHorizontally(availableSpace); + } + this.recalculateScale(); + return { + width: this.boundingRect.width, + height: this.boundingRect.height + }; + } + setBoundingBoxXY(point8) { + this.boundingRect.x = point8.x; + this.boundingRect.y = point8.y; + } + getDrawableElementsForLeftAxis() { + const drawableElement = []; + if (this.showAxisLine) { + const x5 = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2; + drawableElement.push({ + type: "path", + groupTexts: ["left-axis", "axisl-line"], + data: [ + { + path: `M ${x5},${this.boundingRect.y} L ${x5},${this.boundingRect.y + this.boundingRect.height} `, + strokeFill: this.axisThemeConfig.axisLineColor, + strokeWidth: this.axisConfig.axisLineWidth + } + ] + }); + } + if (this.showLabel) { + drawableElement.push({ + type: "text", + groupTexts: ["left-axis", "label"], + data: this.getTickValues().map((tick) => ({ + text: tick.toString(), + x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0), + y: this.getScaleValue(tick), + fill: this.axisThemeConfig.labelColor, + fontSize: this.axisConfig.labelFontSize, + rotation: 0, + verticalPos: "middle", + horizontalPos: "right" + })) + }); + } + if (this.showTick) { + const x5 = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); + drawableElement.push({ + type: "path", + groupTexts: ["left-axis", "ticks"], + data: this.getTickValues().map((tick) => ({ + path: `M ${x5},${this.getScaleValue(tick)} L ${x5 - this.axisConfig.tickLength},${this.getScaleValue(tick)}`, + strokeFill: this.axisThemeConfig.tickColor, + strokeWidth: this.axisConfig.tickWidth + })) + }); + } + if (this.showTitle) { + drawableElement.push({ + type: "text", + groupTexts: ["left-axis", "title"], + data: [ + { + text: this.title, + x: this.boundingRect.x + this.axisConfig.titlePadding, + y: this.boundingRect.y + this.boundingRect.height / 2, + fill: this.axisThemeConfig.titleColor, + fontSize: this.axisConfig.titleFontSize, + rotation: 270, + verticalPos: "top", + horizontalPos: "center" + } + ] + }); + } + return drawableElement; + } + getDrawableElementsForBottomAxis() { + const drawableElement = []; + if (this.showAxisLine) { + const y5 = this.boundingRect.y + this.axisConfig.axisLineWidth / 2; + drawableElement.push({ + type: "path", + groupTexts: ["bottom-axis", "axis-line"], + data: [ + { + path: `M ${this.boundingRect.x},${y5} L ${this.boundingRect.x + this.boundingRect.width},${y5}`, + strokeFill: this.axisThemeConfig.axisLineColor, + strokeWidth: this.axisConfig.axisLineWidth + } + ] + }); + } + if (this.showLabel) { + drawableElement.push({ + type: "text", + groupTexts: ["bottom-axis", "label"], + data: this.getTickValues().map((tick) => ({ + text: tick.toString(), + x: this.getScaleValue(tick), + y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0), + fill: this.axisThemeConfig.labelColor, + fontSize: this.axisConfig.labelFontSize, + rotation: 0, + verticalPos: "top", + horizontalPos: "center" + })) + }); + } + if (this.showTick) { + const y5 = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); + drawableElement.push({ + type: "path", + groupTexts: ["bottom-axis", "ticks"], + data: this.getTickValues().map((tick) => ({ + path: `M ${this.getScaleValue(tick)},${y5} L ${this.getScaleValue(tick)},${y5 + this.axisConfig.tickLength}`, + strokeFill: this.axisThemeConfig.tickColor, + strokeWidth: this.axisConfig.tickWidth + })) + }); + } + if (this.showTitle) { + drawableElement.push({ + type: "text", + groupTexts: ["bottom-axis", "title"], + data: [ + { + text: this.title, + x: this.range[0] + (this.range[1] - this.range[0]) / 2, + y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight, + fill: this.axisThemeConfig.titleColor, + fontSize: this.axisConfig.titleFontSize, + rotation: 0, + verticalPos: "top", + horizontalPos: "center" + } + ] + }); + } + return drawableElement; + } + getDrawableElementsForTopAxis() { + const drawableElement = []; + if (this.showAxisLine) { + const y5 = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2; + drawableElement.push({ + type: "path", + groupTexts: ["top-axis", "axis-line"], + data: [ + { + path: `M ${this.boundingRect.x},${y5} L ${this.boundingRect.x + this.boundingRect.width},${y5}`, + strokeFill: this.axisThemeConfig.axisLineColor, + strokeWidth: this.axisConfig.axisLineWidth + } + ] + }); + } + if (this.showLabel) { + drawableElement.push({ + type: "text", + groupTexts: ["top-axis", "label"], + data: this.getTickValues().map((tick) => ({ + text: tick.toString(), + x: this.getScaleValue(tick), + y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding, + fill: this.axisThemeConfig.labelColor, + fontSize: this.axisConfig.labelFontSize, + rotation: 0, + verticalPos: "top", + horizontalPos: "center" + })) + }); + } + if (this.showTick) { + const y5 = this.boundingRect.y; + drawableElement.push({ + type: "path", + groupTexts: ["top-axis", "ticks"], + data: this.getTickValues().map((tick) => ({ + path: `M ${this.getScaleValue(tick)},${y5 + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(tick)},${y5 + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`, + strokeFill: this.axisThemeConfig.tickColor, + strokeWidth: this.axisConfig.tickWidth + })) + }); + } + if (this.showTitle) { + drawableElement.push({ + type: "text", + groupTexts: ["top-axis", "title"], + data: [ + { + text: this.title, + x: this.boundingRect.x + this.boundingRect.width / 2, + y: this.boundingRect.y + this.axisConfig.titlePadding, + fill: this.axisThemeConfig.titleColor, + fontSize: this.axisConfig.titleFontSize, + rotation: 0, + verticalPos: "top", + horizontalPos: "center" + } + ] + }); + } + return drawableElement; + } + getDrawableElements() { + if (this.axisPosition === "left") { + return this.getDrawableElementsForLeftAxis(); + } + if (this.axisPosition === "right") { + throw Error("Drawing of right axis is not implemented"); + } + if (this.axisPosition === "bottom") { + return this.getDrawableElementsForBottomAxis(); + } + if (this.axisPosition === "top") { + return this.getDrawableElementsForTopAxis(); + } + return []; + } + }; + } + }); + + // src/diagrams/xychart/chartBuilder/components/axis/bandAxis.ts + var BandAxis; + var init_bandAxis = __esm({ + "src/diagrams/xychart/chartBuilder/components/axis/bandAxis.ts"() { + "use strict"; + init_src32(); + init_logger(); + init_baseAxis(); + BandAxis = class extends BaseAxis { + static { + __name(this, "BandAxis"); + } + constructor(axisConfig, axisThemeConfig, categories, title2, textDimensionCalculator) { + super(axisConfig, title2, textDimensionCalculator, axisThemeConfig); + this.categories = categories; + this.scale = band().domain(this.categories).range(this.getRange()); + } + setRange(range3) { + super.setRange(range3); + } + recalculateScale() { + this.scale = band().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5); + log.trace("BandAxis axis final categories, range: ", this.categories, this.getRange()); + } + getTickValues() { + return this.categories; + } + getScaleValue(value2) { + return this.scale(value2) ?? this.getRange()[0]; + } + }; + } + }); + + // src/diagrams/xychart/chartBuilder/components/axis/linearAxis.ts + var LinearAxis; + var init_linearAxis = __esm({ + "src/diagrams/xychart/chartBuilder/components/axis/linearAxis.ts"() { + "use strict"; + init_src32(); + init_baseAxis(); + LinearAxis = class extends BaseAxis { + static { + __name(this, "LinearAxis"); + } + constructor(axisConfig, axisThemeConfig, domain, title2, textDimensionCalculator) { + super(axisConfig, title2, textDimensionCalculator, axisThemeConfig); + this.domain = domain; + this.scale = linear2().domain(this.domain).range(this.getRange()); + } + getTickValues() { + return this.scale.ticks(); + } + recalculateScale() { + const domain = [...this.domain]; + if (this.axisPosition === "left") { + domain.reverse(); + } + this.scale = linear2().domain(domain).range(this.getRange()); + } + getScaleValue(value2) { + return this.scale(value2); + } + }; + } + }); + + // src/diagrams/xychart/chartBuilder/components/axis/index.ts + function getAxis(data5, axisConfig, axisThemeConfig, tmpSVGGroup2) { + const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2); + if (isBandAxisData(data5)) { + return new BandAxis( + axisConfig, + axisThemeConfig, + data5.categories, + data5.title, + textDimensionCalculator + ); + } + return new LinearAxis( + axisConfig, + axisThemeConfig, + [data5.min, data5.max], + data5.title, + textDimensionCalculator + ); + } + var init_axis2 = __esm({ + "src/diagrams/xychart/chartBuilder/components/axis/index.ts"() { + "use strict"; + init_interfaces(); + init_textDimensionCalculator(); + init_bandAxis(); + init_linearAxis(); + __name(getAxis, "getAxis"); + } + }); + + // src/diagrams/xychart/chartBuilder/components/chartTitle.ts + function getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) { + const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2); + return new ChartTitle(textDimensionCalculator, chartConfig, chartData, chartThemeConfig); + } + var ChartTitle; + var init_chartTitle = __esm({ + "src/diagrams/xychart/chartBuilder/components/chartTitle.ts"() { + "use strict"; + init_textDimensionCalculator(); + ChartTitle = class { + constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) { + this.textDimensionCalculator = textDimensionCalculator; + this.chartConfig = chartConfig; + this.chartData = chartData; + this.chartThemeConfig = chartThemeConfig; + this.boundingRect = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + this.showChartTitle = false; + } + static { + __name(this, "ChartTitle"); + } + setBoundingBoxXY(point8) { + this.boundingRect.x = point8.x; + this.boundingRect.y = point8.y; + } + calculateSpace(availableSpace) { + const titleDimension = this.textDimensionCalculator.getMaxDimension( + [this.chartData.title], + this.chartConfig.titleFontSize + ); + const widthRequired = Math.max(titleDimension.width, availableSpace.width); + const heightRequired = titleDimension.height + 2 * this.chartConfig.titlePadding; + if (titleDimension.width <= widthRequired && titleDimension.height <= heightRequired && this.chartConfig.showTitle && this.chartData.title) { + this.boundingRect.width = widthRequired; + this.boundingRect.height = heightRequired; + this.showChartTitle = true; + } + return { + width: this.boundingRect.width, + height: this.boundingRect.height + }; + } + getDrawableElements() { + const drawableElem = []; + if (this.showChartTitle) { + drawableElem.push({ + groupTexts: ["chart-title"], + type: "text", + data: [ + { + fontSize: this.chartConfig.titleFontSize, + text: this.chartData.title, + verticalPos: "middle", + horizontalPos: "center", + x: this.boundingRect.x + this.boundingRect.width / 2, + y: this.boundingRect.y + this.boundingRect.height / 2, + fill: this.chartThemeConfig.titleColor, + rotation: 0 + } + ] + }); + } + return drawableElem; + } + }; + __name(getChartTitleComponent, "getChartTitleComponent"); + } + }); + + // src/diagrams/xychart/chartBuilder/components/plot/linePlot.ts + var LinePlot; + var init_linePlot = __esm({ + "src/diagrams/xychart/chartBuilder/components/plot/linePlot.ts"() { + "use strict"; + init_src32(); + LinePlot = class { + constructor(plotData, xAxis, yAxis, orientation, plotIndex2) { + this.plotData = plotData; + this.xAxis = xAxis; + this.yAxis = yAxis; + this.orientation = orientation; + this.plotIndex = plotIndex2; + } + static { + __name(this, "LinePlot"); + } + getDrawableElement() { + const finalData = this.plotData.data.map((d2) => [ + this.xAxis.getScaleValue(d2[0]), + this.yAxis.getScaleValue(d2[1]) + ]); + let path4; + if (this.orientation === "horizontal") { + path4 = line_default().y((d2) => d2[0]).x((d2) => d2[1])(finalData); + } else { + path4 = line_default().x((d2) => d2[0]).y((d2) => d2[1])(finalData); + } + if (!path4) { + return []; + } + return [ + { + groupTexts: ["plot", `line-plot-${this.plotIndex}`], + type: "path", + data: [ + { + path: path4, + strokeFill: this.plotData.strokeFill, + strokeWidth: this.plotData.strokeWidth + } + ] } - function yqc() { - mqc(); + ]; + } + }; + } + }); + + // src/diagrams/xychart/chartBuilder/components/plot/barPlot.ts + var BarPlot; + var init_barPlot = __esm({ + "src/diagrams/xychart/chartBuilder/components/plot/barPlot.ts"() { + "use strict"; + BarPlot = class { + constructor(barData, boundingRect, xAxis, yAxis, orientation, plotIndex2) { + this.barData = barData; + this.boundingRect = boundingRect; + this.xAxis = xAxis; + this.yAxis = yAxis; + this.orientation = orientation; + this.plotIndex = plotIndex2; + } + static { + __name(this, "BarPlot"); + } + getDrawableElement() { + const finalData = this.barData.data.map((d2) => [ + this.xAxis.getScaleValue(d2[0]), + this.yAxis.getScaleValue(d2[1]) + ]); + const barPaddingPercent = 0.05; + const barWidth = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - barPaddingPercent); + const barWidthHalf = barWidth / 2; + if (this.orientation === "horizontal") { + return [ + { + groupTexts: ["plot", `bar-plot-${this.plotIndex}`], + type: "rect", + data: finalData.map((data5) => ({ + x: this.boundingRect.x, + y: data5[0] - barWidthHalf, + height: barWidth, + width: data5[1] - this.boundingRect.x, + fill: this.barData.fill, + strokeWidth: 0, + strokeFill: this.barData.fill + })) + } + ]; + } + return [ + { + groupTexts: ["plot", `bar-plot-${this.plotIndex}`], + type: "rect", + data: finalData.map((data5) => ({ + x: data5[0] - barWidthHalf, + y: data5[1], + width: barWidth, + height: this.boundingRect.y + this.boundingRect.height - data5[1], + fill: this.barData.fill, + strokeWidth: 0, + strokeFill: this.barData.fill + })) } - function Pzc() { - Ozc(); + ]; + } + }; + } + }); + + // src/diagrams/xychart/chartBuilder/components/plot/index.ts + function getPlotComponent(chartConfig, chartData, chartThemeConfig) { + return new BasePlot(chartConfig, chartData, chartThemeConfig); + } + var BasePlot; + var init_plot = __esm({ + "src/diagrams/xychart/chartBuilder/components/plot/index.ts"() { + "use strict"; + init_linePlot(); + init_barPlot(); + BasePlot = class { + constructor(chartConfig, chartData, chartThemeConfig) { + this.chartConfig = chartConfig; + this.chartData = chartData; + this.chartThemeConfig = chartThemeConfig; + this.boundingRect = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + static { + __name(this, "BasePlot"); + } + setAxes(xAxis, yAxis) { + this.xAxis = xAxis; + this.yAxis = yAxis; + } + setBoundingBoxXY(point8) { + this.boundingRect.x = point8.x; + this.boundingRect.y = point8.y; + } + calculateSpace(availableSpace) { + this.boundingRect.width = availableSpace.width; + this.boundingRect.height = availableSpace.height; + return { + width: this.boundingRect.width, + height: this.boundingRect.height + }; + } + getDrawableElements() { + if (!(this.xAxis && this.yAxis)) { + throw Error("Axes must be passed to render Plots"); + } + const drawableElem = []; + for (const [i2, plot] of this.chartData.plots.entries()) { + switch (plot.type) { + case "line": + { + const linePlot = new LinePlot( + plot, + this.xAxis, + this.yAxis, + this.chartConfig.chartOrientation, + i2 + ); + drawableElem.push(...linePlot.getDrawableElement()); + } + break; + case "bar": + { + const barPlot = new BarPlot( + plot, + this.boundingRect, + this.xAxis, + this.yAxis, + this.chartConfig.chartOrientation, + i2 + ); + drawableElem.push(...barPlot.getDrawableElement()); + } + break; } - function ACc() { - yCc(); - } - function aKc() { - YJc(); - } - function FLc() { - DLc(); - } - function DNc() { - ANc(); - } - function TNc() { - JNc(); - } - function iQc() { - gQc(); - } - function WRc() { - TRc(); - } - function C$c() { - B$c(); - } - function J0c() { - B0c(); - } - function x0c() { - r0c(); - } - function j_c() { - h_c(); - } - function N_c() { - H_c(); - } - function V_c() { - R_c(); - } - function E4c() { - D4c(); - } - function a5c() { - $4c(); - } - function v7c() { - u7c(); - } - function Z7c() { - X7c(); - } - function pcd() { - ncd(); - } - function Lcd() { - Kcd(); - } - function Vcd() { - Tcd(); - } - function fUd() { - TTd(); - } - function Bfd() { - Afd(); - } - function jkd() { - hkd(); - } - function vmd() { - umd(); - } - function xnd() { - vnd(); - } - function Hpd() { - Fpd(); - } - function HYd() { - lYd(); - } - function yAd() { - qAd(); - } - function gke() { - rue(); - } - function Yxb(a) { - uFb(a); - } - function Yb(a) { - this.a = a; - } - function cc(a) { - this.a = a; - } - function df(a) { - this.a = a; - } - function kf(a) { - this.a = a; - } - function kj(a) { - this.a = a; - } - function qj(a) { - this.a = a; - } - function Lj(a) { - this.a = a; - } - function jh(a) { - this.a = a; - } - function th(a) { - this.a = a; - } - function Bh(a) { - this.a = a; - } - function Xh(a) { - this.a = a; - } - function Xn2(a) { - this.a = a; - } - function Di(a) { - this.a = a; - } - function Ki(a) { - this.a = a; - } - function Ik(a) { - this.a = a; - } - function Qk(a) { - this.a = a; - } - function mp(a) { - this.a = a; - } - function Lp(a) { - this.a = a; - } - function iq(a) { - this.a = a; - } - function Eq(a) { - this.a = a; - } - function Vq(a) { - this.a = a; - } - function Or(a) { - this.a = a; - } - function $r(a) { - this.b = a; - } - function Aj(a) { - this.c = a; - } - function vu(a) { - this.a = a; - } - function vw(a) { - this.a = a; - } - function gw(a) { - this.a = a; - } - function lw(a) { - this.a = a; - } - function Iw(a) { - this.a = a; - } - function Nw(a) { - this.a = a; - } - function Sw(a) { - this.a = a; - } - function ex(a) { - this.a = a; - } - function fx(a) { - this.a = a; - } - function lx(a) { - this.a = a; - } - function my(a) { - this.a = a; - } - function qy(a) { - this.a = a; - } - function Oy(a) { - this.a = a; - } - function NB(a) { - this.a = a; - } - function XB(a) { - this.a = a; - } - function hC(a) { - this.a = a; - } - function vC(a) { - this.a = a; - } - function MB() { - this.a = []; - } - function HEb(a, b) { - a.a = b; - } - function E2b(a, b) { - a.a = b; - } - function F2b(a, b) { - a.b = b; - } - function PRb(a, b) { - a.b = b; - } - function RRb(a, b) { - a.b = b; - } - function QJb(a, b) { - a.j = b; - } - function hQb(a, b) { - a.g = b; - } - function iQb(a, b) { - a.i = b; - } - function _Tb(a, b) { - a.c = b; - } - function G2b(a, b) { - a.c = b; - } - function H2b(a, b) { - a.d = b; - } - function aUb(a, b) { - a.d = b; - } - function h3b(a, b) { - a.k = b; - } - function O3b(a, b) { - a.c = b; - } - function Tmc(a, b) { - a.c = b; - } - function Smc(a, b) { - a.a = b; - } - function DJc(a, b) { - a.a = b; - } - function EJc(a, b) { - a.f = b; - } - function NSc(a, b) { - a.a = b; - } - function OSc(a, b) { - a.b = b; - } - function PSc(a, b) { - a.d = b; - } - function QSc(a, b) { - a.i = b; - } - function RSc(a, b) { - a.o = b; - } - function SSc2(a, b) { - a.r = b; - } - function yUc(a, b) { - a.a = b; - } - function zUc(a, b) { - a.b = b; - } - function q3c(a, b) { - a.e = b; - } - function r3c(a, b) { - a.f = b; - } - function s3c(a, b) { - a.g = b; - } - function Y9c(a, b) { - a.e = b; - } - function Z9c(a, b) { - a.f = b; - } - function kad(a, b) { - a.f = b; - } - function Ntd(a, b) { - a.a = b; - } - function Otd(a, b) { - a.b = b; - } - function BWd(a, b) { - a.n = b; - } - function $ee(a, b) { - a.a = b; - } - function _ee(a, b) { - a.c = b; - } - function ife(a, b) { - a.c = b; - } - function Efe(a, b) { - a.c = b; - } - function hfe(a, b) { - a.a = b; - } - function Dfe(a, b) { - a.a = b; - } - function jfe(a, b) { - a.d = b; - } - function Ffe(a, b) { - a.d = b; - } - function kfe(a, b) { - a.e = b; - } - function Gfe(a, b) { - a.e = b; - } - function lfe(a, b) { - a.g = b; - } - function Hfe(a, b) { - a.f = b; - } - function Ife(a, b) { - a.j = b; - } - function wme(a, b) { - a.a = b; - } - function Fme(a, b) { - a.a = b; - } - function xme(a, b) { - a.b = b; - } - function gmc(a) { - a.b = a.a; - } - function Lg(a) { - a.c = a.d.d; - } - function fgb(a) { - this.a = a; - } - function zgb(a) { - this.a = a; - } - function Xgb(a) { - this.a = a; - } - function Xkb(a) { - this.a = a; - } - function mkb(a) { - this.a = a; - } - function reb(a) { - this.a = a; - } - function Seb(a) { - this.a = a; - } - function bfb(a) { - this.a = a; - } - function Tfb(a) { - this.a = a; - } - function blb(a) { - this.a = a; - } - function glb(a) { - this.a = a; - } - function llb(a) { - this.a = a; - } - function Ulb(a) { - this.a = a; - } - function _lb(a) { - this.a = a; - } - function Plb(a) { - this.b = a; - } - function Ppb(a) { - this.b = a; - } - function xpb(a) { - this.b = a; - } - function mpb(a) { - this.a = a; - } - function Yqb(a) { - this.a = a; - } - function uqb(a) { - this.c = a; - } - function Anb(a) { - this.c = a; - } - function zwb(a) { - this.c = a; - } - function Dkb(a) { - this.d = a; - } - function brb(a) { - this.a = a; - } - function Frb(a) { - this.a = a; - } - function hsb(a) { - this.a = a; - } - function ctb(a) { - this.a = a; - } - function cxb(a) { - this.a = a; - } - function axb(a) { - this.a = a; - } - function exb(a) { - this.a = a; - } - function gxb(a) { - this.a = a; - } - function wub(a) { - this.a = a; - } - function zAb(a) { - this.a = a; - } - function JAb(a) { - this.a = a; - } - function LAb(a) { - this.a = a; - } - function PAb(a) { - this.a = a; - } - function VBb(a) { - this.a = a; - } - function lCb(a) { - this.a = a; - } - function nCb(a) { - this.a = a; - } - function pCb(a) { - this.a = a; - } - function CCb(a) { - this.a = a; - } - function GCb(a) { - this.a = a; - } - function bDb(a) { - this.a = a; - } - function dDb(a) { - this.a = a; - } - function fDb(a) { - this.a = a; - } - function uDb(a) { - this.a = a; - } - function $Db(a) { - this.a = a; - } - function aEb(a) { - this.a = a; - } - function eEb(a) { - this.a = a; - } - function OEb(a) { - this.a = a; - } - function SEb(a) { - this.a = a; - } - function SFb(a) { - this.a = a; - } - function HFb(a) { - this.a = a; - } - function NFb(a) { - this.a = a; - } - function WGb(a) { - this.a = a; - } - function HJb(a) { - this.a = a; - } - function PJb(a) { - this.a = a; - } - function kNb(a) { - this.a = a; - } - function tOb(a) { - this.a = a; - } - function APb(a) { - this.a = a; - } - function IQb(a) { - this.a = a; - } - function bTb(a) { - this.a = a; - } - function dTb(a) { - this.a = a; - } - function wTb(a) { - this.a = a; - } - function GWb(a) { - this.a = a; - } - function UWb(a) { - this.a = a; - } - function WWb(a) { - this.a = a; - } - function fXb(a) { - this.a = a; - } - function jXb(a) { - this.a = a; - } - function M0b(a) { - this.a = a; - } - function r1b(a) { - this.a = a; - } - function D1b(a) { - this.e = a; - } - function T3b(a) { - this.a = a; - } - function W3b(a) { - this.a = a; - } - function _3b(a) { - this.a = a; - } - function c4b(a) { - this.a = a; - } - function s5b(a) { - this.a = a; - } - function u5b(a) { - this.a = a; - } - function y5b(a) { - this.a = a; - } - function C5b(a) { - this.a = a; - } - function Q5b(a) { - this.a = a; - } - function S5b(a) { - this.a = a; - } - function U5b(a) { - this.a = a; - } - function W5b(a) { - this.a = a; - } - function l7b(a) { - this.a = a; - } - function p7b(a) { - this.a = a; - } - function k8b(a) { - this.a = a; - } - function L8b(a) { - this.a = a; - } - function Rac(a) { - this.a = a; - } - function Xac(a) { - this.a = a; - } - function $ac(a) { - this.a = a; - } - function bbc(a) { - this.a = a; - } - function Cdc(a) { - this.a = a; - } - function Edc(a) { - this.a = a; - } - function Ehc(a) { - this.a = a; - } - function khc(a) { - this.a = a; - } - function Ihc(a) { - this.a = a; - } - function qfc(a) { - this.a = a; - } - function tfc(a) { - this.a = a; - } - function Wfc(a) { - this.a = a; - } - function Fic(a) { - this.a = a; - } - function Vic(a) { - this.a = a; - } - function fjc(a) { - this.a = a; - } - function pjc(a) { - this.a = a; - } - function ckc(a) { - this.a = a; - } - function hkc(a) { - this.a = a; - } - function Ykc(a) { - this.a = a; - } - function $kc(a) { - this.a = a; - } - function alc(a) { - this.a = a; - } - function glc(a) { - this.a = a; - } - function ilc(a) { - this.a = a; - } - function slc(a) { - this.a = a; - } - function Clc(a) { - this.a = a; - } - function xoc(a) { - this.a = a; - } - function zoc(a) { - this.a = a; - } - function spc(a) { - this.a = a; - } - function Vqc(a) { - this.a = a; - } - function Xqc(a) { - this.a = a; - } - function Gsc(a) { - this.a = a; - } - function Isc(a) { - this.a = a; - } - function JGc(a) { - this.a = a; - } - function NGc(a) { - this.a = a; - } - function MHc(a) { - this.a = a; - } - function JIc(a) { - this.a = a; - } - function fJc(a) { - this.a = a; - } - function BJc(a) { - this.a = a; - } - function dJc(a) { - this.c = a; - } - function Trc(a) { - this.b = a; - } - function eKc(a) { - this.a = a; - } - function IKc(a) { - this.a = a; - } - function KKc(a) { - this.a = a; - } - function MKc(a) { - this.a = a; - } - function yLc(a) { - this.a = a; - } - function HMc(a) { - this.a = a; - } - function LMc(a) { - this.a = a; - } - function PMc(a) { - this.a = a; - } - function TMc(a) { - this.a = a; - } - function XMc(a) { - this.a = a; - } - function ZMc(a) { - this.a = a; - } - function aNc(a) { - this.a = a; - } - function jNc(a) { - this.a = a; - } - function aPc(a) { - this.a = a; - } - function gPc(a) { - this.a = a; - } - function kPc(a) { - this.a = a; - } - function yPc(a) { - this.a = a; - } - function CPc(a) { - this.a = a; - } - function JPc(a) { - this.a = a; - } - function RPc(a) { - this.a = a; - } - function XPc(a) { - this.a = a; - } - function mRc(a) { - this.a = a; - } - function xTc(a) { - this.a = a; - } - function CWc(a) { - this.a = a; - } - function EWc(a) { - this.a = a; - } - function IWc(a) { - this.a = a; - } - function OWc(a) { - this.a = a; - } - function dXc(a) { - this.a = a; - } - function gXc(a) { - this.a = a; - } - function EXc(a) { - this.a = a; - } - function WXc(a) { - this.a = a; - } - function YXc(a) { - this.a = a; - } - function aYc(a) { - this.a = a; - } - function cYc(a) { - this.a = a; - } - function eYc(a) { - this.a = a; + } + return drawableElem; + } + }; + __name(getPlotComponent, "getPlotComponent"); + } + }); + + // src/diagrams/xychart/chartBuilder/orchestrator.ts + var Orchestrator; + var init_orchestrator = __esm({ + "src/diagrams/xychart/chartBuilder/orchestrator.ts"() { + "use strict"; + init_axis2(); + init_chartTitle(); + init_plot(); + init_interfaces(); + Orchestrator = class { + constructor(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) { + this.chartConfig = chartConfig; + this.chartData = chartData; + this.componentStore = { + title: getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2), + plot: getPlotComponent(chartConfig, chartData, chartThemeConfig), + xAxis: getAxis( + chartData.xAxis, + chartConfig.xAxis, + { + titleColor: chartThemeConfig.xAxisTitleColor, + labelColor: chartThemeConfig.xAxisLabelColor, + tickColor: chartThemeConfig.xAxisTickColor, + axisLineColor: chartThemeConfig.xAxisLineColor + }, + tmpSVGGroup2 + ), + yAxis: getAxis( + chartData.yAxis, + chartConfig.yAxis, + { + titleColor: chartThemeConfig.yAxisTitleColor, + labelColor: chartThemeConfig.yAxisLabelColor, + tickColor: chartThemeConfig.yAxisTickColor, + axisLineColor: chartThemeConfig.yAxisLineColor + }, + tmpSVGGroup2 + ) + }; + } + static { + __name(this, "Orchestrator"); + } + calculateVerticalSpace() { + let availableWidth = this.chartConfig.width; + let availableHeight = this.chartConfig.height; + let plotX = 0; + let plotY = 0; + let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100); + let chartHeight = Math.floor( + availableHeight * this.chartConfig.plotReservedSpacePercent / 100 + ); + let spaceUsed = this.componentStore.plot.calculateSpace({ + width: chartWidth, + height: chartHeight + }); + availableWidth -= spaceUsed.width; + availableHeight -= spaceUsed.height; + spaceUsed = this.componentStore.title.calculateSpace({ + width: this.chartConfig.width, + height: availableHeight + }); + plotY = spaceUsed.height; + availableHeight -= spaceUsed.height; + this.componentStore.xAxis.setAxisPosition("bottom"); + spaceUsed = this.componentStore.xAxis.calculateSpace({ + width: availableWidth, + height: availableHeight + }); + availableHeight -= spaceUsed.height; + this.componentStore.yAxis.setAxisPosition("left"); + spaceUsed = this.componentStore.yAxis.calculateSpace({ + width: availableWidth, + height: availableHeight + }); + plotX = spaceUsed.width; + availableWidth -= spaceUsed.width; + if (availableWidth > 0) { + chartWidth += availableWidth; + availableWidth = 0; + } + if (availableHeight > 0) { + chartHeight += availableHeight; + availableHeight = 0; + } + this.componentStore.plot.calculateSpace({ + width: chartWidth, + height: chartHeight + }); + this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY }); + this.componentStore.xAxis.setRange([plotX, plotX + chartWidth]); + this.componentStore.xAxis.setBoundingBoxXY({ x: plotX, y: plotY + chartHeight }); + this.componentStore.yAxis.setRange([plotY, plotY + chartHeight]); + this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: plotY }); + if (this.chartData.plots.some((p3) => isBarPlot(p3))) { + this.componentStore.xAxis.recalculateOuterPaddingToDrawBar(); + } + } + calculateHorizontalSpace() { + let availableWidth = this.chartConfig.width; + let availableHeight = this.chartConfig.height; + let titleYEnd = 0; + let plotX = 0; + let plotY = 0; + let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100); + let chartHeight = Math.floor( + availableHeight * this.chartConfig.plotReservedSpacePercent / 100 + ); + let spaceUsed = this.componentStore.plot.calculateSpace({ + width: chartWidth, + height: chartHeight + }); + availableWidth -= spaceUsed.width; + availableHeight -= spaceUsed.height; + spaceUsed = this.componentStore.title.calculateSpace({ + width: this.chartConfig.width, + height: availableHeight + }); + titleYEnd = spaceUsed.height; + availableHeight -= spaceUsed.height; + this.componentStore.xAxis.setAxisPosition("left"); + spaceUsed = this.componentStore.xAxis.calculateSpace({ + width: availableWidth, + height: availableHeight + }); + availableWidth -= spaceUsed.width; + plotX = spaceUsed.width; + this.componentStore.yAxis.setAxisPosition("top"); + spaceUsed = this.componentStore.yAxis.calculateSpace({ + width: availableWidth, + height: availableHeight + }); + availableHeight -= spaceUsed.height; + plotY = titleYEnd + spaceUsed.height; + if (availableWidth > 0) { + chartWidth += availableWidth; + availableWidth = 0; + } + if (availableHeight > 0) { + chartHeight += availableHeight; + availableHeight = 0; + } + this.componentStore.plot.calculateSpace({ + width: chartWidth, + height: chartHeight + }); + this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY }); + this.componentStore.yAxis.setRange([plotX, plotX + chartWidth]); + this.componentStore.yAxis.setBoundingBoxXY({ x: plotX, y: titleYEnd }); + this.componentStore.xAxis.setRange([plotY, plotY + chartHeight]); + this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: plotY }); + if (this.chartData.plots.some((p3) => isBarPlot(p3))) { + this.componentStore.xAxis.recalculateOuterPaddingToDrawBar(); + } + } + calculateSpace() { + if (this.chartConfig.chartOrientation === "horizontal") { + this.calculateHorizontalSpace(); + } else { + this.calculateVerticalSpace(); + } + } + getDrawableElement() { + this.calculateSpace(); + const drawableElem = []; + this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis); + for (const component2 of Object.values(this.componentStore)) { + drawableElem.push(...component2.getDrawableElements()); + } + return drawableElem; + } + }; + } + }); + + // src/diagrams/xychart/chartBuilder/index.ts + var XYChartBuilder; + var init_chartBuilder = __esm({ + "src/diagrams/xychart/chartBuilder/index.ts"() { + "use strict"; + init_orchestrator(); + XYChartBuilder = class { + static { + __name(this, "XYChartBuilder"); + } + static build(config6, chartData, chartThemeConfig, tmpSVGGroup2) { + const orchestrator = new Orchestrator(config6, chartData, chartThemeConfig, tmpSVGGroup2); + return orchestrator.getDrawableElement(); + } + }; + } + }); + + // src/diagrams/xychart/xychartDb.ts + function getChartDefaultThemeConfig() { + const defaultThemeVariables2 = getThemeVariables3(); + const config6 = getConfig(); + return cleanAndMerge(defaultThemeVariables2.xyChart, config6.themeVariables.xyChart); + } + function getChartDefaultConfig() { + const config6 = getConfig(); + return cleanAndMerge( + defaultConfig_default.xyChart, + config6.xyChart + ); + } + function getChartDefaultData() { + return { + yAxis: { + type: "linear", + title: "", + min: Infinity, + max: -Infinity + }, + xAxis: { + type: "band", + title: "", + categories: [] + }, + title: "", + plots: [] + }; + } + function textSanitizer2(text2) { + const config6 = getConfig(); + return sanitizeText(text2.trim(), config6); + } + function setTmpSVGG(SVGG) { + tmpSVGGroup = SVGG; + } + function setOrientation(orientation) { + if (orientation === "horizontal") { + xyChartConfig.chartOrientation = "horizontal"; + } else { + xyChartConfig.chartOrientation = "vertical"; + } + } + function setXAxisTitle(title2) { + xyChartData.xAxis.title = textSanitizer2(title2.text); + } + function setXAxisRangeData(min9, max10) { + xyChartData.xAxis = { type: "linear", title: xyChartData.xAxis.title, min: min9, max: max10 }; + hasSetXAxis = true; + } + function setXAxisBand(categories) { + xyChartData.xAxis = { + type: "band", + title: xyChartData.xAxis.title, + categories: categories.map((c3) => textSanitizer2(c3.text)) + }; + hasSetXAxis = true; + } + function setYAxisTitle(title2) { + xyChartData.yAxis.title = textSanitizer2(title2.text); + } + function setYAxisRangeData(min9, max10) { + xyChartData.yAxis = { type: "linear", title: xyChartData.yAxis.title, min: min9, max: max10 }; + hasSetYAxis = true; + } + function setYAxisRangeFromPlotData(data5) { + const minValue = Math.min(...data5); + const maxValue = Math.max(...data5); + const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity; + const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity; + xyChartData.yAxis = { + type: "linear", + title: xyChartData.yAxis.title, + min: Math.min(prevMinValue, minValue), + max: Math.max(prevMaxValue, maxValue) + }; + } + function transformDataWithoutCategory(data5) { + let retData = []; + if (data5.length === 0) { + return retData; + } + if (!hasSetXAxis) { + const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity; + const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity; + setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data5.length)); + } + if (!hasSetYAxis) { + setYAxisRangeFromPlotData(data5); + } + if (isBandAxisData(xyChartData.xAxis)) { + retData = xyChartData.xAxis.categories.map((c3, i2) => [c3, data5[i2]]); + } + if (isLinearAxisData(xyChartData.xAxis)) { + const min9 = xyChartData.xAxis.min; + const max10 = xyChartData.xAxis.max; + const step3 = (max10 - min9) / (data5.length - 1); + const categories = []; + for (let i2 = min9; i2 <= max10; i2 += step3) { + categories.push(`${i2}`); + } + retData = categories.map((c3, i2) => [c3, data5[i2]]); + } + return retData; + } + function getPlotColorFromPalette(plotIndex2) { + return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length]; + } + function setLineData(title2, data5) { + const plotData = transformDataWithoutCategory(data5); + xyChartData.plots.push({ + type: "line", + strokeFill: getPlotColorFromPalette(plotIndex), + strokeWidth: 2, + data: plotData + }); + plotIndex++; + } + function setBarData(title2, data5) { + const plotData = transformDataWithoutCategory(data5); + xyChartData.plots.push({ + type: "bar", + fill: getPlotColorFromPalette(plotIndex), + data: plotData + }); + plotIndex++; + } + function getDrawableElem() { + if (xyChartData.plots.length === 0) { + throw Error("No Plot to render, please provide a plot with some data"); + } + xyChartData.title = getDiagramTitle(); + return XYChartBuilder.build(xyChartConfig, xyChartData, xyChartThemeConfig, tmpSVGGroup); + } + function getChartThemeConfig() { + return xyChartThemeConfig; + } + function getChartConfig() { + return xyChartConfig; + } + var plotIndex, tmpSVGGroup, xyChartConfig, xyChartThemeConfig, xyChartData, plotColorPalette, hasSetXAxis, hasSetYAxis, clear15, xychartDb_default; + var init_xychartDb = __esm({ + "src/diagrams/xychart/xychartDb.ts"() { + "use strict"; + init_config(); + init_defaultConfig(); + init_theme_default(); + init_utils2(); + init_common(); + init_commonDb(); + init_chartBuilder(); + init_interfaces(); + plotIndex = 0; + xyChartConfig = getChartDefaultConfig(); + xyChartThemeConfig = getChartDefaultThemeConfig(); + xyChartData = getChartDefaultData(); + plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color2) => color2.trim()); + hasSetXAxis = false; + hasSetYAxis = false; + __name(getChartDefaultThemeConfig, "getChartDefaultThemeConfig"); + __name(getChartDefaultConfig, "getChartDefaultConfig"); + __name(getChartDefaultData, "getChartDefaultData"); + __name(textSanitizer2, "textSanitizer"); + __name(setTmpSVGG, "setTmpSVGG"); + __name(setOrientation, "setOrientation"); + __name(setXAxisTitle, "setXAxisTitle"); + __name(setXAxisRangeData, "setXAxisRangeData"); + __name(setXAxisBand, "setXAxisBand"); + __name(setYAxisTitle, "setYAxisTitle"); + __name(setYAxisRangeData, "setYAxisRangeData"); + __name(setYAxisRangeFromPlotData, "setYAxisRangeFromPlotData"); + __name(transformDataWithoutCategory, "transformDataWithoutCategory"); + __name(getPlotColorFromPalette, "getPlotColorFromPalette"); + __name(setLineData, "setLineData"); + __name(setBarData, "setBarData"); + __name(getDrawableElem, "getDrawableElem"); + __name(getChartThemeConfig, "getChartThemeConfig"); + __name(getChartConfig, "getChartConfig"); + clear15 = /* @__PURE__ */ __name(function() { + clear(); + plotIndex = 0; + xyChartConfig = getChartDefaultConfig(); + xyChartData = getChartDefaultData(); + xyChartThemeConfig = getChartDefaultThemeConfig(); + plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color2) => color2.trim()); + hasSetXAxis = false; + hasSetYAxis = false; + }, "clear"); + xychartDb_default = { + getDrawableElem, + clear: clear15, + setAccTitle, + getAccTitle, + setDiagramTitle, + getDiagramTitle, + getAccDescription, + setAccDescription, + setOrientation, + setXAxisTitle, + setXAxisRangeData, + setXAxisBand, + setYAxisTitle, + setYAxisRangeData, + setLineData, + setBarData, + setTmpSVGG, + getChartThemeConfig, + getChartConfig + }; + } + }); + + // src/diagrams/xychart/xychartRenderer.ts + var draw9, xychartRenderer_default; + var init_xychartRenderer = __esm({ + "src/diagrams/xychart/xychartRenderer.ts"() { + "use strict"; + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + draw9 = /* @__PURE__ */ __name((txt, id26, _version, diagObj) => { + const db7 = diagObj.db; + const themeConfig = db7.getChartThemeConfig(); + const chartConfig = db7.getChartConfig(); + function getDominantBaseLine(horizontalPos) { + return horizontalPos === "top" ? "text-before-edge" : "middle"; + } + __name(getDominantBaseLine, "getDominantBaseLine"); + function getTextAnchor(verticalPos) { + return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle"; + } + __name(getTextAnchor, "getTextAnchor"); + function getTextTransformation(data5) { + return `translate(${data5.x}, ${data5.y}) rotate(${data5.rotation || 0})`; + } + __name(getTextTransformation, "getTextTransformation"); + log.debug("Rendering xychart chart\n" + txt); + const svg = selectSvgElement(id26); + const group2 = svg.append("g").attr("class", "main"); + const background = group2.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background"); + configureSvgSize(svg, chartConfig.height, chartConfig.width, true); + svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`); + background.attr("fill", themeConfig.backgroundColor); + db7.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group")); + const shapes5 = db7.getDrawableElem(); + const groups = {}; + function getGroup(gList) { + let elem = group2; + let prefix = ""; + for (const [i2] of gList.entries()) { + let parent4 = group2; + if (i2 > 0 && groups[prefix]) { + parent4 = groups[prefix]; + } + prefix += gList[i2]; + elem = groups[prefix]; + if (!elem) { + elem = groups[prefix] = parent4.append("g").attr("class", gList[i2]); + } + } + return elem; + } + __name(getGroup, "getGroup"); + for (const shape of shapes5) { + if (shape.data.length === 0) { + continue; + } + const shapeGroup = getGroup(shape.groupTexts); + switch (shape.type) { + case "rect": + shapeGroup.selectAll("rect").data(shape.data).enter().append("rect").attr("x", (data5) => data5.x).attr("y", (data5) => data5.y).attr("width", (data5) => data5.width).attr("height", (data5) => data5.height).attr("fill", (data5) => data5.fill).attr("stroke", (data5) => data5.strokeFill).attr("stroke-width", (data5) => data5.strokeWidth); + break; + case "text": + shapeGroup.selectAll("text").data(shape.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (data5) => data5.fill).attr("font-size", (data5) => data5.fontSize).attr("dominant-baseline", (data5) => getDominantBaseLine(data5.verticalPos)).attr("text-anchor", (data5) => getTextAnchor(data5.horizontalPos)).attr("transform", (data5) => getTextTransformation(data5)).text((data5) => data5.text); + break; + case "path": + shapeGroup.selectAll("path").data(shape.data).enter().append("path").attr("d", (data5) => data5.path).attr("fill", (data5) => data5.fill ? data5.fill : "none").attr("stroke", (data5) => data5.strokeFill).attr("stroke-width", (data5) => data5.strokeWidth); + break; + } + } + }, "draw"); + xychartRenderer_default = { + draw: draw9 + }; + } + }); + + // src/diagrams/xychart/xychartDiagram.ts + var xychartDiagram_exports = {}; + __export(xychartDiagram_exports, { + diagram: () => diagram9 + }); + var diagram9; + var init_xychartDiagram = __esm({ + "src/diagrams/xychart/xychartDiagram.ts"() { + "use strict"; + init_xychart(); + init_xychartDb(); + init_xychartRenderer(); + diagram9 = { + parser: xychart_default, + db: xychartDb_default, + renderer: xychartRenderer_default + }; + } + }); + + // src/diagrams/requirement/parser/requirementDiagram.jison + var parser11, requirementDiagram_default; + var init_requirementDiagram = __esm({ + "src/diagrams/requirement/parser/requirementDiagram.jison"() { + "use strict"; + parser11 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [5, 6, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], $V5 = [1, 18], $V6 = [2, 7], $V7 = [1, 22], $V8 = [1, 23], $V9 = [1, 24], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 20], $Ve = [1, 28], $Vf = [1, 29], $Vg = [62, 63], $Vh = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 51, 53, 62, 63], $Vi = [1, 47], $Vj = [1, 48], $Vk = [1, 49], $Vl = [1, 50], $Vm = [1, 51], $Vn = [1, 52], $Vo = [1, 53], $Vp = [53, 54], $Vq = [1, 64], $Vr = [1, 60], $Vs = [1, 61], $Vt = [1, 62], $Vu = [1, 63], $Vv = [1, 65], $Vw = [1, 69], $Vx = [1, 70], $Vy = [1, 67], $Vz = [1, 68], $VA = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "acc_title": 9, "acc_title_value": 10, "acc_descr": 11, "acc_descr_value": 12, "acc_descr_multiline_value": 13, "requirementDef": 14, "elementDef": 15, "relationshipDef": 16, "requirementType": 17, "requirementName": 18, "STRUCT_START": 19, "requirementBody": 20, "ID": 21, "COLONSEP": 22, "id": 23, "TEXT": 24, "text": 25, "RISK": 26, "riskLevel": 27, "VERIFYMTHD": 28, "verifyType": 29, "STRUCT_STOP": 30, "REQUIREMENT": 31, "FUNCTIONAL_REQUIREMENT": 32, "INTERFACE_REQUIREMENT": 33, "PERFORMANCE_REQUIREMENT": 34, "PHYSICAL_REQUIREMENT": 35, "DESIGN_CONSTRAINT": 36, "LOW_RISK": 37, "MED_RISK": 38, "HIGH_RISK": 39, "VERIFY_ANALYSIS": 40, "VERIFY_DEMONSTRATION": 41, "VERIFY_INSPECTION": 42, "VERIFY_TEST": 43, "ELEMENT": 44, "elementName": 45, "elementBody": 46, "TYPE": 47, "type": 48, "DOCREF": 49, "ref": 50, "END_ARROW_L": 51, "relationship": 52, "LINE": 53, "END_ARROW_R": 54, "CONTAINS": 55, "COPIES": 56, "DERIVES": 57, "SATISFIES": 58, "VERIFIES": 59, "REFINES": 60, "TRACES": 61, "unqString": 62, "qString": 63, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 19: "STRUCT_START", 21: "ID", 22: "COLONSEP", 24: "TEXT", 26: "RISK", 28: "VERIFYMTHD", 30: "STRUCT_STOP", 31: "REQUIREMENT", 32: "FUNCTIONAL_REQUIREMENT", 33: "INTERFACE_REQUIREMENT", 34: "PERFORMANCE_REQUIREMENT", 35: "PHYSICAL_REQUIREMENT", 36: "DESIGN_CONSTRAINT", 37: "LOW_RISK", 38: "MED_RISK", 39: "HIGH_RISK", 40: "VERIFY_ANALYSIS", 41: "VERIFY_DEMONSTRATION", 42: "VERIFY_INSPECTION", 43: "VERIFY_TEST", 44: "ELEMENT", 47: "TYPE", 49: "DOCREF", 51: "END_ARROW_L", 53: "LINE", 54: "END_ARROW_R", 55: "CONTAINS", 56: "COPIES", 57: "DERIVES", 58: "SATISFIES", 59: "VERIFIES", 60: "REFINES", 61: "TRACES", 62: "unqString", 63: "qString" }, + productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [14, 5], [20, 5], [20, 5], [20, 5], [20, 5], [20, 2], [20, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [27, 1], [27, 1], [27, 1], [29, 1], [29, 1], [29, 1], [29, 1], [15, 5], [46, 5], [46, 5], [46, 2], [46, 1], [16, 5], [16, 5], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [18, 1], [18, 1], [23, 1], [23, 1], [25, 1], [25, 1], [45, 1], [45, 1], [48, 1], [48, 1], [50, 1], [50, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 4: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 5: + case 6: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 7: + this.$ = []; + break; + case 13: + yy.addRequirement($$[$0 - 3], $$[$0 - 4]); + break; + case 14: + yy.setNewReqId($$[$0 - 2]); + break; + case 15: + yy.setNewReqText($$[$0 - 2]); + break; + case 16: + yy.setNewReqRisk($$[$0 - 2]); + break; + case 17: + yy.setNewReqVerifyMethod($$[$0 - 2]); + break; + case 20: + this.$ = yy.RequirementType.REQUIREMENT; + break; + case 21: + this.$ = yy.RequirementType.FUNCTIONAL_REQUIREMENT; + break; + case 22: + this.$ = yy.RequirementType.INTERFACE_REQUIREMENT; + break; + case 23: + this.$ = yy.RequirementType.PERFORMANCE_REQUIREMENT; + break; + case 24: + this.$ = yy.RequirementType.PHYSICAL_REQUIREMENT; + break; + case 25: + this.$ = yy.RequirementType.DESIGN_CONSTRAINT; + break; + case 26: + this.$ = yy.RiskLevel.LOW_RISK; + break; + case 27: + this.$ = yy.RiskLevel.MED_RISK; + break; + case 28: + this.$ = yy.RiskLevel.HIGH_RISK; + break; + case 29: + this.$ = yy.VerifyType.VERIFY_ANALYSIS; + break; + case 30: + this.$ = yy.VerifyType.VERIFY_DEMONSTRATION; + break; + case 31: + this.$ = yy.VerifyType.VERIFY_INSPECTION; + break; + case 32: + this.$ = yy.VerifyType.VERIFY_TEST; + break; + case 33: + yy.addElement($$[$0 - 3]); + break; + case 34: + yy.setNewElementType($$[$0 - 2]); + break; + case 35: + yy.setNewElementDocRef($$[$0 - 2]); + break; + case 38: + yy.addRelationship($$[$0 - 2], $$[$0], $$[$0 - 4]); + break; + case 39: + yy.addRelationship($$[$0 - 2], $$[$0 - 4], $$[$0]); + break; + case 40: + this.$ = yy.Relationships.CONTAINS; + break; + case 41: + this.$ = yy.Relationships.COPIES; + break; + case 42: + this.$ = yy.Relationships.DERIVES; + break; + case 43: + this.$ = yy.Relationships.SATISFIES; + break; + case 44: + this.$ = yy.Relationships.VERIFIES; + break; + case 45: + this.$ = yy.Relationships.REFINES; + break; + case 46: + this.$ = yy.Relationships.TRACES; + break; } - function iYc(a) { - this.a = a; + }, "anonymous"), + table: [{ 3: 1, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, o2($V4, [2, 6]), { 3: 12, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [2, 2] }, { 4: 17, 5: $V5, 7: 13, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, o2($V4, [2, 4]), o2($V4, [2, 5]), { 1: [2, 1] }, { 8: [1, 30] }, { 4: 17, 5: $V5, 7: 31, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 32, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 33, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 34, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 4: 17, 5: $V5, 7: 35, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: $V7, 32: $V8, 33: $V9, 34: $Va, 35: $Vb, 36: $Vc, 44: $Vd, 62: $Ve, 63: $Vf }, { 18: 36, 62: [1, 37], 63: [1, 38] }, { 45: 39, 62: [1, 40], 63: [1, 41] }, { 51: [1, 42], 53: [1, 43] }, o2($Vg, [2, 20]), o2($Vg, [2, 21]), o2($Vg, [2, 22]), o2($Vg, [2, 23]), o2($Vg, [2, 24]), o2($Vg, [2, 25]), o2($Vh, [2, 49]), o2($Vh, [2, 50]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 19: [1, 44] }, { 19: [2, 47] }, { 19: [2, 48] }, { 19: [1, 45] }, { 19: [2, 53] }, { 19: [2, 54] }, { 52: 46, 55: $Vi, 56: $Vj, 57: $Vk, 58: $Vl, 59: $Vm, 60: $Vn, 61: $Vo }, { 52: 54, 55: $Vi, 56: $Vj, 57: $Vk, 58: $Vl, 59: $Vm, 60: $Vn, 61: $Vo }, { 5: [1, 55] }, { 5: [1, 56] }, { 53: [1, 57] }, o2($Vp, [2, 40]), o2($Vp, [2, 41]), o2($Vp, [2, 42]), o2($Vp, [2, 43]), o2($Vp, [2, 44]), o2($Vp, [2, 45]), o2($Vp, [2, 46]), { 54: [1, 58] }, { 5: $Vq, 20: 59, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vw, 30: $Vx, 46: 66, 47: $Vy, 49: $Vz }, { 23: 71, 62: $Ve, 63: $Vf }, { 23: 72, 62: $Ve, 63: $Vf }, o2($VA, [2, 13]), { 22: [1, 73] }, { 22: [1, 74] }, { 22: [1, 75] }, { 22: [1, 76] }, { 5: $Vq, 20: 77, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, o2($VA, [2, 19]), o2($VA, [2, 33]), { 22: [1, 78] }, { 22: [1, 79] }, { 5: $Vw, 30: $Vx, 46: 80, 47: $Vy, 49: $Vz }, o2($VA, [2, 37]), o2($VA, [2, 38]), o2($VA, [2, 39]), { 23: 81, 62: $Ve, 63: $Vf }, { 25: 82, 62: [1, 83], 63: [1, 84] }, { 27: 85, 37: [1, 86], 38: [1, 87], 39: [1, 88] }, { 29: 89, 40: [1, 90], 41: [1, 91], 42: [1, 92], 43: [1, 93] }, o2($VA, [2, 18]), { 48: 94, 62: [1, 95], 63: [1, 96] }, { 50: 97, 62: [1, 98], 63: [1, 99] }, o2($VA, [2, 36]), { 5: [1, 100] }, { 5: [1, 101] }, { 5: [2, 51] }, { 5: [2, 52] }, { 5: [1, 102] }, { 5: [2, 26] }, { 5: [2, 27] }, { 5: [2, 28] }, { 5: [1, 103] }, { 5: [2, 29] }, { 5: [2, 30] }, { 5: [2, 31] }, { 5: [2, 32] }, { 5: [1, 104] }, { 5: [2, 55] }, { 5: [2, 56] }, { 5: [1, 105] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: $Vq, 20: 106, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 107, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 108, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vq, 20: 109, 21: $Vr, 24: $Vs, 26: $Vt, 28: $Vu, 30: $Vv }, { 5: $Vw, 30: $Vx, 46: 110, 47: $Vy, 49: $Vz }, { 5: $Vw, 30: $Vx, 46: 111, 47: $Vy, 49: $Vz }, o2($VA, [2, 14]), o2($VA, [2, 15]), o2($VA, [2, 16]), o2($VA, [2, 17]), o2($VA, [2, 34]), o2($VA, [2, 35])], + defaultActions: { 8: [2, 2], 12: [2, 1], 30: [2, 3], 31: [2, 8], 32: [2, 9], 33: [2, 10], 34: [2, 11], 35: [2, 12], 37: [2, 47], 38: [2, 48], 40: [2, 53], 41: [2, 54], 83: [2, 51], 84: [2, 52], 86: [2, 26], 87: [2, 27], 88: [2, 28], 90: [2, 29], 91: [2, 30], 92: [2, 31], 93: [2, 32], 95: [2, 55], 96: [2, 56], 98: [2, 57], 99: [2, 58] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function i0c(a) { - this.a = a; + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function g0c(a) { - this.a = a; + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function P1c(a) { - this.a = a; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function Sad(a) { - this.a = a; - } - function Uad(a) { - this.a = a; - } - function Wad(a) { - this.a = a; - } - function Yad(a) { - this.a = a; - } - function cbd(a) { - this.a = a; - } - function ydd(a) { - this.a = a; - } - function Kdd(a) { - this.a = a; - } - function Mdd(a) { - this.a = a; - } - function _ed(a) { - this.a = a; - } - function dfd(a) { - this.a = a; - } - function Kfd(a) { - this.a = a; - } - function prd(a) { - this.a = a; - } - function $rd(a) { - this.a = a; - } - function csd(a) { - this.a = a; - } - function Usd(a) { - this.a = a; - } - function Vtd(a) { - this.a = a; - } - function wud(a) { - this.a = a; - } - function Rud(a) { - this.f = a; - } - function LEd(a) { - this.a = a; - } - function UEd(a) { - this.a = a; - } - function VEd(a) { - this.a = a; - } - function WEd(a) { - this.a = a; - } - function XEd(a) { - this.a = a; - } - function YEd(a) { - this.a = a; - } - function ZEd(a) { - this.a = a; - } - function $Ed(a) { - this.a = a; - } - function _Ed(a) { - this.a = a; - } - function aFd(a) { - this.a = a; - } - function gFd(a) { - this.a = a; - } - function iFd(a) { - this.a = a; - } - function jFd(a) { - this.a = a; - } - function kFd(a) { - this.a = a; - } - function lFd(a) { - this.a = a; - } - function nFd(a) { - this.a = a; - } - function qFd(a) { - this.a = a; - } - function wFd(a) { - this.a = a; - } - function xFd(a) { - this.a = a; - } - function zFd(a) { - this.a = a; - } - function AFd(a) { - this.a = a; - } - function BFd(a) { - this.a = a; - } - function CFd(a) { - this.a = a; - } - function DFd(a) { - this.a = a; - } - function MFd(a) { - this.a = a; - } - function OFd(a) { - this.a = a; - } - function QFd(a) { - this.a = a; - } - function SFd(a) { - this.a = a; - } - function uGd(a) { - this.a = a; - } - function QGd(a) { - this.a = a; - } - function jGd(a) { - this.b = a; - } - function YOd(a) { - this.a = a; - } - function ePd(a) { - this.a = a; - } - function kPd(a) { - this.a = a; - } - function qPd(a) { - this.a = a; - } - function IPd(a) { - this.a = a; - } - function w$d(a) { - this.a = a; - } - function e_d(a) { - this.a = a; - } - function Q_d(a) { - this.b = a; - } - function c1d(a) { - this.a = a; - } - function c2d(a) { - this.a = a; - } - function l5d(a) { - this.a = a; - } - function I9d(a) { - this.a = a; - } - function L6d(a) { - this.c = a; - } - function t7d(a) { - this.e = a; - } - function pae(a) { - this.a = a; - } - function xae(a) { - this.a = a; - } - function Zde(a) { - this.a = a; - } - function Sde(a) { - this.d = a; - } - function mee(a) { - this.a = a; - } - function uje(a) { - this.a = a; - } - function Bte(a) { - this.a = a; - } - function Wse(a) { - this.e = a; - } - function Xsd() { - this.a = 0; - } - function Tsb() { - akb(this); - } - function bnb() { - Pmb(this); - } - function cHb() { - bHb(this); - } - function I2b() { - } - function s2d() { - this.c = d2d; - } - function Prc(a, b) { - a.b += b; - } - function Uje(a, b) { - b.Wb(a); - } - function UC(a) { - return a.a; - } - function nC(a) { - return a.a; - } - function BC(a) { - return a.a; - } - function TB(a) { - return a.a; - } - function _B(a) { - return a.a; - } - function Adb(a) { - return a.e; - } - function gC() { - return null; - } - function MC() { - return null; - } - function leb() { - MId(); - OId(); - } - function qMb(a) { - a.b.Of(a.e); - } - function A$b(a) { - a.b = new Ri(); - } - function A8b(a, b) { - a.b = b - a.b; - } - function x8b(a, b) { - a.a = b - a.a; - } - function ZEb(a, b) { - a.push(b); - } - function bFb(a, b) { - a.sort(b); - } - function Q5c(a, b) { - b.jd(a.a); - } - function Voc(a, b) { - Q3b(b, a); - } - function tp(a, b, c2) { - a.Yd(c2, b); - } - function Ss(a, b) { - a.e = b; - b.b = a; - } - function im(a) { - _l(); - this.a = a; - } - function xq(a) { - _l(); - this.a = a; - } - function Gq(a) { - _l(); - this.a = a; - } - function Xq(a) { - tm(); - this.a = a; - } - function gA(a) { - fA(); - eA.le(a); - } - function vA() { - vA = geb; - new Tsb(); - } - function xz() { - mz.call(this); - } - function Ceb() { - mz.call(this); - } - function ueb() { - xz.call(this); - } - function yeb() { - xz.call(this); - } - function Hfb() { - xz.call(this); - } - function _fb() { - xz.call(this); - } - function cgb() { - xz.call(this); - } - function Ngb() { - xz.call(this); - } - function jib() { - xz.call(this); - } - function Jrb() { - xz.call(this); - } - function Srb() { - xz.call(this); - } - function Dvb() { - xz.call(this); - } - function Ied() { - xz.call(this); - } - function R1d() { - this.a = this; - } - function k1d() { - this.Bb |= 256; - } - function vWb() { - this.b = new Et(); - } - function aFb(a, b) { - a.length = b; - } - function dyb(a, b) { - Rmb(a.a, b); - } - function jNb(a, b) { - LKb(a.c, b); - } - function qRc(a, b) { - Ysb(a.b, b); - } - function VOd(a, b) { - UNd(a.a, b); - } - function WOd(a, b) { - VNd(a.a, b); - } - function eZd(a, b) { - qvd(a.e, b); - } - function Cke(a) { - bge(a.c, a.b); - } - function uj(a, b) { - a.kc().Nb(b); - } - function Ufb(a) { - this.a = Zfb(a); - } - function _sb() { - this.a = new Tsb(); - } - function $Ab() { - this.a = new Tsb(); - } - function xAb() { - this.a = new dzb(); - } - function gyb() { - this.a = new bnb(); - } - function BIb() { - this.a = new bnb(); - } - function GIb() { - this.a = new bnb(); - } - function wIb() { - this.a = new pIb(); - } - function gJb() { - this.a = new DIb(); - } - function TTb() { - this.a = new DTb(); - } - function jGb() { - this.a = new fGb(); - } - function qGb() { - this.a = new kGb(); - } - function q_b() { - this.a = new bnb(); - } - function E_b() { - this.a = new bnb(); - } - function EZb() { - this.a = new bnb(); - } - function J$b() { - this.a = new bnb(); - } - function YNb() { - this.d = new bnb(); - } - function lXb() { - this.a = new RWb(); - } - function y_b() { - this.a = new _sb(); - } - function k5b() { - this.a = new Tsb(); - } - function E0b() { - this.b = new Tsb(); - } - function jHc() { - this.b = new bnb(); - } - function ZNc() { - this.e = new bnb(); - } - function ahc() { - this.a = new boc(); - } - function UQc() { - this.d = new bnb(); - } - function uRc() { - tRc.call(this); - } - function BRc() { - tRc.call(this); - } - function VOc() { - bnb.call(this); - } - function web() { - ueb.call(this); - } - function Fyb() { - gyb.call(this); - } - function fKb() { - RJb.call(this); - } - function N$b() { - J$b.call(this); - } - function P2b() { - I2b.call(this); - } - function T2b() { - P2b.call(this); - } - function z3b() { - I2b.call(this); - } - function C3b() { - z3b.call(this); - } - function cUc() { - aUc.call(this); - } - function hUc() { - aUc.call(this); - } - function mUc() { - aUc.call(this); - } - function Hdd() { - Ddd.call(this); - } - function ACd() { - $yd.call(this); - } - function PCd() { - $yd.call(this); - } - function Ejd() { - Yub.call(this); - } - function LQd() { - wQd.call(this); - } - function lRd() { - wQd.call(this); - } - function MSd() { - Tsb.call(this); - } - function VSd() { - Tsb.call(this); - } - function eTd() { - Tsb.call(this); - } - function mXd() { - HWd.call(this); + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + return "title"; + break; + case 1: + this.begin("acc_title"); + return 9; + break; + case 2: + this.popState(); + return "acc_title_value"; + break; + case 3: + this.begin("acc_descr"); + return 11; + break; + case 4: + this.popState(); + return "acc_descr_value"; + break; + case 5: + this.begin("acc_descr_multiline"); + break; + case 6: + this.popState(); + break; + case 7: + return "acc_descr_multiline_value"; + break; + case 8: + return 5; + break; + case 9: + break; + case 10: + break; + case 11: + break; + case 12: + return 8; + break; + case 13: + return 6; + break; + case 14: + return 19; + break; + case 15: + return 30; + break; + case 16: + return 22; + break; + case 17: + return 21; + break; + case 18: + return 24; + break; + case 19: + return 26; + break; + case 20: + return 28; + break; + case 21: + return 31; + break; + case 22: + return 32; + break; + case 23: + return 33; + break; + case 24: + return 34; + break; + case 25: + return 35; + break; + case 26: + return 36; + break; + case 27: + return 37; + break; + case 28: + return 38; + break; + case 29: + return 39; + break; + case 30: + return 40; + break; + case 31: + return 41; + break; + case 32: + return 42; + break; + case 33: + return 43; + break; + case 34: + return 44; + break; + case 35: + return 55; + break; + case 36: + return 56; + break; + case 37: + return 57; + break; + case 38: + return 58; + break; + case 39: + return 59; + break; + case 40: + return 60; + break; + case 41: + return 61; + break; + case 42: + return 47; + break; + case 43: + return 49; + break; + case 44: + return 51; + break; + case 45: + return 54; + break; + case 46: + return 53; + break; + case 47: + this.begin("string"); + break; + case 48: + this.popState(); + break; + case 49: + return "qString"; + break; + case 50: + yy_.yytext = yy_.yytext.trim(); + return 62; + break; + } + }, "anonymous"), + rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^\r\n\{\<\>\-\=]*)/i], + conditions: { "acc_descr_multiline": { "rules": [6, 7], "inclusive": false }, "acc_descr": { "rules": [4], "inclusive": false }, "acc_title": { "rules": [2], "inclusive": false }, "unqString": { "rules": [], "inclusive": false }, "token": { "rules": [], "inclusive": false }, "string": { "rules": [48, 49], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser11.parser = parser11; + requirementDiagram_default = parser11; + } + }); + + // src/diagrams/requirement/requirementDb.js + var relations, latestRequirement, requirements, latestElement, elements, RequirementType, RiskLevel, VerifyType, Relationships, addRequirement, getRequirements, setNewReqId, setNewReqText, setNewReqRisk, setNewReqVerifyMethod, addElement, getElements, setNewElementType, setNewElementDocRef, addRelationship2, getRelationships2, clear16, requirementDb_default; + var init_requirementDb = __esm({ + "src/diagrams/requirement/requirementDb.js"() { + "use strict"; + init_diagramAPI(); + init_logger(); + init_commonDb(); + relations = []; + latestRequirement = {}; + requirements = /* @__PURE__ */ new Map(); + latestElement = {}; + elements = /* @__PURE__ */ new Map(); + RequirementType = { + REQUIREMENT: "Requirement", + FUNCTIONAL_REQUIREMENT: "Functional Requirement", + INTERFACE_REQUIREMENT: "Interface Requirement", + PERFORMANCE_REQUIREMENT: "Performance Requirement", + PHYSICAL_REQUIREMENT: "Physical Requirement", + DESIGN_CONSTRAINT: "Design Constraint" + }; + RiskLevel = { + LOW_RISK: "Low", + MED_RISK: "Medium", + HIGH_RISK: "High" + }; + VerifyType = { + VERIFY_ANALYSIS: "Analysis", + VERIFY_DEMONSTRATION: "Demonstration", + VERIFY_INSPECTION: "Inspection", + VERIFY_TEST: "Test" + }; + Relationships = { + CONTAINS: "contains", + COPIES: "copies", + DERIVES: "derives", + SATISFIES: "satisfies", + VERIFIES: "verifies", + REFINES: "refines", + TRACES: "traces" + }; + addRequirement = /* @__PURE__ */ __name((name, type3) => { + if (!requirements.has(name)) { + requirements.set(name, { + name, + type: type3, + id: latestRequirement.id, + text: latestRequirement.text, + risk: latestRequirement.risk, + verifyMethod: latestRequirement.verifyMethod + }); + } + latestRequirement = {}; + return requirements.get(name); + }, "addRequirement"); + getRequirements = /* @__PURE__ */ __name(() => requirements, "getRequirements"); + setNewReqId = /* @__PURE__ */ __name((id26) => { + if (latestRequirement !== void 0) { + latestRequirement.id = id26; + } + }, "setNewReqId"); + setNewReqText = /* @__PURE__ */ __name((text2) => { + if (latestRequirement !== void 0) { + latestRequirement.text = text2; + } + }, "setNewReqText"); + setNewReqRisk = /* @__PURE__ */ __name((risk) => { + if (latestRequirement !== void 0) { + latestRequirement.risk = risk; + } + }, "setNewReqRisk"); + setNewReqVerifyMethod = /* @__PURE__ */ __name((verifyMethod) => { + if (latestRequirement !== void 0) { + latestRequirement.verifyMethod = verifyMethod; + } + }, "setNewReqVerifyMethod"); + addElement = /* @__PURE__ */ __name((name) => { + if (!elements.has(name)) { + elements.set(name, { + name, + type: latestElement.type, + docRef: latestElement.docRef + }); + log.info("Added new requirement: ", name); + } + latestElement = {}; + return elements.get(name); + }, "addElement"); + getElements = /* @__PURE__ */ __name(() => elements, "getElements"); + setNewElementType = /* @__PURE__ */ __name((type3) => { + if (latestElement !== void 0) { + latestElement.type = type3; + } + }, "setNewElementType"); + setNewElementDocRef = /* @__PURE__ */ __name((docRef) => { + if (latestElement !== void 0) { + latestElement.docRef = docRef; + } + }, "setNewElementDocRef"); + addRelationship2 = /* @__PURE__ */ __name((type3, src, dst) => { + relations.push({ + type: type3, + src, + dst + }); + }, "addRelationship"); + getRelationships2 = /* @__PURE__ */ __name(() => relations, "getRelationships"); + clear16 = /* @__PURE__ */ __name(() => { + relations = []; + latestRequirement = {}; + requirements = /* @__PURE__ */ new Map(); + latestElement = {}; + elements = /* @__PURE__ */ new Map(); + clear(); + }, "clear"); + requirementDb_default = { + RequirementType, + RiskLevel, + VerifyType, + Relationships, + getConfig: /* @__PURE__ */ __name(() => getConfig2().req, "getConfig"), + addRequirement, + getRequirements, + setNewReqId, + setNewReqText, + setNewReqRisk, + setNewReqVerifyMethod, + setAccTitle, + getAccTitle, + setAccDescription, + getAccDescription, + addElement, + getElements, + setNewElementType, + setNewElementDocRef, + addRelationship: addRelationship2, + getRelationships: getRelationships2, + clear: clear16 + }; + } + }); + + // src/diagrams/requirement/styles.js + var getStyles8, styles_default7; + var init_styles7 = __esm({ + "src/diagrams/requirement/styles.js"() { + "use strict"; + getStyles8 = /* @__PURE__ */ __name((options3) => ` + + marker { + fill: ${options3.relationColor}; + stroke: ${options3.relationColor}; + } + + marker.cross { + stroke: ${options3.lineColor}; + } + + svg { + font-family: ${options3.fontFamily}; + font-size: ${options3.fontSize}; + } + + .reqBox { + fill: ${options3.requirementBackground}; + fill-opacity: 1.0; + stroke: ${options3.requirementBorderColor}; + stroke-width: ${options3.requirementBorderSize}; + } + + .reqTitle, .reqLabel{ + fill: ${options3.requirementTextColor}; + } + .reqLabelBox { + fill: ${options3.relationLabelBackground}; + fill-opacity: 1.0; + } + + .req-title-line { + stroke: ${options3.requirementBorderColor}; + stroke-width: ${options3.requirementBorderSize}; + } + .relationshipLine { + stroke: ${options3.relationColor}; + stroke-width: 1; + } + .relationshipLabel { + fill: ${options3.relationLabelColor}; + } + +`, "getStyles"); + styles_default7 = getStyles8; + } + }); + + // src/diagrams/requirement/requirementMarkers.js + var ReqMarkers, insertLineEndings, requirementMarkers_default; + var init_requirementMarkers = __esm({ + "src/diagrams/requirement/requirementMarkers.js"() { + "use strict"; + ReqMarkers = { + CONTAINS: "contains", + ARROW: "arrow" + }; + insertLineEndings = /* @__PURE__ */ __name((parentNode, conf8) => { + let containsNode = parentNode.append("defs").append("marker").attr("id", ReqMarkers.CONTAINS + "_line_ending").attr("refX", 0).attr("refY", conf8.line_height / 2).attr("markerWidth", conf8.line_height).attr("markerHeight", conf8.line_height).attr("orient", "auto").append("g"); + containsNode.append("circle").attr("cx", conf8.line_height / 2).attr("cy", conf8.line_height / 2).attr("r", conf8.line_height / 2).attr("fill", "none"); + containsNode.append("line").attr("x1", 0).attr("x2", conf8.line_height).attr("y1", conf8.line_height / 2).attr("y2", conf8.line_height / 2).attr("stroke-width", 1); + containsNode.append("line").attr("y1", 0).attr("y2", conf8.line_height).attr("x1", conf8.line_height / 2).attr("x2", conf8.line_height / 2).attr("stroke-width", 1); + parentNode.append("defs").append("marker").attr("id", ReqMarkers.ARROW + "_line_ending").attr("refX", conf8.line_height).attr("refY", 0.5 * conf8.line_height).attr("markerWidth", conf8.line_height).attr("markerHeight", conf8.line_height).attr("orient", "auto").append("path").attr( + "d", + `M0,0 + L${conf8.line_height},${conf8.line_height / 2} + M${conf8.line_height},${conf8.line_height / 2} + L0,${conf8.line_height}` + ).attr("stroke-width", 1); + }, "insertLineEndings"); + requirementMarkers_default = { + ReqMarkers, + insertLineEndings + }; + } + }); + + // src/diagrams/requirement/requirementRenderer.js + var conf3, relCnt2, newRectNode, newTitleNode, newBodyNode, addEdgeLabel, drawRelationshipFromLayout2, drawReqs, drawElements, addRelationships2, adjustEntities2, elementString, draw10, requirementRenderer_default; + var init_requirementRenderer = __esm({ + "src/diagrams/requirement/requirementRenderer.js"() { + "use strict"; + init_src32(); + init_dagre(); + init_graphlib(); + init_diagramAPI(); + init_logger(); + init_setupGraphViewbox(); + init_common(); + init_requirementMarkers(); + conf3 = {}; + relCnt2 = 0; + newRectNode = /* @__PURE__ */ __name((parentNode, id26) => { + return parentNode.insert("rect", "#" + id26).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", conf3.rect_min_width + "px").attr("height", conf3.rect_min_height + "px"); + }, "newRectNode"); + newTitleNode = /* @__PURE__ */ __name((parentNode, id26, txts) => { + let x5 = conf3.rect_min_width / 2; + let title2 = parentNode.append("text").attr("class", "req reqLabel reqTitle").attr("id", id26).attr("x", x5).attr("y", conf3.rect_padding).attr("dominant-baseline", "hanging"); + let i2 = 0; + txts.forEach((textStr) => { + if (i2 == 0) { + title2.append("tspan").attr("text-anchor", "middle").attr("x", conf3.rect_min_width / 2).attr("dy", 0).text(textStr); + } else { + title2.append("tspan").attr("text-anchor", "middle").attr("x", conf3.rect_min_width / 2).attr("dy", conf3.line_height * 0.75).text(textStr); + } + i2++; + }); + let yPadding = 1.5 * conf3.rect_padding; + let linePadding = i2 * conf3.line_height * 0.75; + let totalY = yPadding + linePadding; + parentNode.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", conf3.rect_min_width).attr("y1", totalY).attr("y2", totalY); + return { + titleNode: title2, + y: totalY + }; + }, "newTitleNode"); + newBodyNode = /* @__PURE__ */ __name((parentNode, id26, txts, yStart) => { + let body = parentNode.append("text").attr("class", "req reqLabel").attr("id", id26).attr("x", conf3.rect_padding).attr("y", yStart).attr("dominant-baseline", "hanging"); + let currentRow = 0; + const charLimit = 30; + let wrappedTxts = []; + txts.forEach((textStr) => { + let currentTextLen = textStr.length; + while (currentTextLen > charLimit && currentRow < 3) { + let firstPart = textStr.substring(0, charLimit); + textStr = textStr.substring(charLimit, textStr.length); + currentTextLen = textStr.length; + wrappedTxts[wrappedTxts.length] = firstPart; + currentRow++; + } + if (currentRow == 3) { + let lastStr = wrappedTxts[wrappedTxts.length - 1]; + wrappedTxts[wrappedTxts.length - 1] = lastStr.substring(0, lastStr.length - 4) + "..."; + } else { + wrappedTxts[wrappedTxts.length] = textStr; + } + currentRow = 0; + }); + wrappedTxts.forEach((textStr) => { + body.append("tspan").attr("x", conf3.rect_padding).attr("dy", conf3.line_height).text(textStr); + }); + return body; + }, "newBodyNode"); + addEdgeLabel = /* @__PURE__ */ __name((parentNode, svgPath, conf8, txt) => { + const len = svgPath.node().getTotalLength(); + const labelPoint = svgPath.node().getPointAtLength(len * 0.5); + const labelId = "rel" + relCnt2; + relCnt2++; + const labelNode = parentNode.append("text").attr("class", "req relationshipLabel").attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(txt); + const labelBBox = labelNode.node().getBBox(); + parentNode.insert("rect", "#" + labelId).attr("class", "req reqLabelBox").attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height).attr("fill", "white").attr("fill-opacity", "85%"); + }, "addEdgeLabel"); + drawRelationshipFromLayout2 = /* @__PURE__ */ __name(function(svg, rel2, g2, insert, diagObj) { + const edge = g2.edge(elementString(rel2.src), elementString(rel2.dst)); + const lineFunction = line_default().x(function(d2) { + return d2.x; + }).y(function(d2) { + return d2.y; + }); + const svgPath = svg.insert("path", "#" + insert).attr("class", "er relationshipLine").attr("d", lineFunction(edge.points)).attr("fill", "none"); + if (rel2.type == diagObj.db.Relationships.CONTAINS) { + svgPath.attr( + "marker-start", + "url(" + common_default.getUrl(conf3.arrowMarkerAbsolute) + "#" + rel2.type + "_line_ending)" + ); + } else { + svgPath.attr("stroke-dasharray", "10,7"); + svgPath.attr( + "marker-end", + "url(" + common_default.getUrl(conf3.arrowMarkerAbsolute) + "#" + requirementMarkers_default.ReqMarkers.ARROW + "_line_ending)" + ); + } + addEdgeLabel(svg, svgPath, conf3, `<<${rel2.type}>>`); + return; + }, "drawRelationshipFromLayout"); + drawReqs = /* @__PURE__ */ __name((reqs, graph, svgNode2) => { + reqs.forEach((req, reqName) => { + reqName = elementString(reqName); + log.info("Added new requirement: ", reqName); + const groupNode = svgNode2.append("g").attr("id", reqName); + const textId = "req-" + reqName; + const rectNode = newRectNode(groupNode, textId); + let nodes6 = []; + let titleNodeInfo = newTitleNode(groupNode, reqName + "_title", [ + `<<${req.type}>>`, + `${req.name}` + ]); + nodes6.push(titleNodeInfo.titleNode); + let bodyNode = newBodyNode( + groupNode, + reqName + "_body", + [ + `Id: ${req.id}`, + `Text: ${req.text}`, + `Risk: ${req.risk}`, + `Verification: ${req.verifyMethod}` + ], + titleNodeInfo.y + ); + nodes6.push(bodyNode); + const rectBBox = rectNode.node().getBBox(); + graph.setNode(reqName, { + width: rectBBox.width, + height: rectBBox.height, + shape: "rect", + id: reqName + }); + }); + }, "drawReqs"); + drawElements = /* @__PURE__ */ __name((els, graph, svgNode2) => { + els.forEach((el, elName) => { + const id26 = elementString(elName); + const groupNode = svgNode2.append("g").attr("id", id26); + const textId = "element-" + id26; + const rectNode = newRectNode(groupNode, textId); + let nodes6 = []; + let titleNodeInfo = newTitleNode(groupNode, textId + "_title", [`<>`, `${elName}`]); + nodes6.push(titleNodeInfo.titleNode); + let bodyNode = newBodyNode( + groupNode, + textId + "_body", + [`Type: ${el.type || "Not Specified"}`, `Doc Ref: ${el.docRef || "None"}`], + titleNodeInfo.y + ); + nodes6.push(bodyNode); + const rectBBox = rectNode.node().getBBox(); + graph.setNode(id26, { + width: rectBBox.width, + height: rectBBox.height, + shape: "rect", + id: id26 + }); + }); + }, "drawElements"); + addRelationships2 = /* @__PURE__ */ __name((relationships2, g2) => { + relationships2.forEach(function(r2) { + let src = elementString(r2.src); + let dst = elementString(r2.dst); + g2.setEdge(src, dst, { relationship: r2 }); + }); + return relationships2; + }, "addRelationships"); + adjustEntities2 = /* @__PURE__ */ __name(function(svgNode2, graph) { + graph.nodes().forEach(function(v3) { + if (v3 !== void 0 && graph.node(v3) !== void 0) { + svgNode2.select("#" + v3); + svgNode2.select("#" + v3).attr( + "transform", + "translate(" + (graph.node(v3).x - graph.node(v3).width / 2) + "," + (graph.node(v3).y - graph.node(v3).height / 2) + " )" + ); + } + }); + return; + }, "adjustEntities"); + elementString = /* @__PURE__ */ __name((str2) => { + return str2.replace(/\s/g, "").replace(/\./g, "_"); + }, "elementString"); + draw10 = /* @__PURE__ */ __name((text2, id26, _version, diagObj) => { + conf3 = getConfig2().requirement; + const securityLevel = conf3.securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id='${id26}']`); + requirementMarkers_default.insertLineEndings(svg, conf3); + const g2 = new Graph({ + multigraph: false, + compound: false, + directed: true + }).setGraph({ + rankdir: conf3.layoutDirection, + marginx: 20, + marginy: 20, + nodesep: 100, + edgesep: 100, + ranksep: 100 + }).setDefaultEdgeLabel(function() { + return {}; + }); + let requirements2 = diagObj.db.getRequirements(); + let elements3 = diagObj.db.getElements(); + let relationships2 = diagObj.db.getRelationships(); + drawReqs(requirements2, g2, svg); + drawElements(elements3, g2, svg); + addRelationships2(relationships2, g2); + layout(g2); + adjustEntities2(svg, g2); + relationships2.forEach(function(rel2) { + drawRelationshipFromLayout2(svg, rel2, g2, id26, diagObj); + }); + const padding3 = conf3.rect_padding; + const svgBounds = svg.node().getBBox(); + const width3 = svgBounds.width + padding3 * 2; + const height2 = svgBounds.height + padding3 * 2; + configureSvgSize(svg, height2, width3, conf3.useMaxWidth); + svg.attr("viewBox", `${svgBounds.x - padding3} ${svgBounds.y - padding3} ${width3} ${height2}`); + }, "draw"); + requirementRenderer_default = { + draw: draw10 + }; + } + }); + + // src/diagrams/requirement/requirementDiagram.ts + var requirementDiagram_exports = {}; + __export(requirementDiagram_exports, { + diagram: () => diagram10 + }); + var diagram10; + var init_requirementDiagram2 = __esm({ + "src/diagrams/requirement/requirementDiagram.ts"() { + "use strict"; + init_requirementDiagram(); + init_requirementDb(); + init_styles7(); + init_requirementRenderer(); + diagram10 = { + parser: requirementDiagram_default, + db: requirementDb_default, + renderer: requirementRenderer_default, + styles: styles_default7 + }; + } + }); + + // src/diagrams/sequence/parser/sequenceDiagram.jison + var parser12, sequenceDiagram_default; + var init_sequenceDiagram = __esm({ + "src/diagrams/sequence/parser/sequenceDiagram.jison"() { + "use strict"; + parser12 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 13], $V7 = [1, 14], $V8 = [1, 16], $V9 = [1, 17], $Va = [1, 18], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 33], $Vl = [1, 34], $Vm = [1, 35], $Vn = [1, 36], $Vo = [1, 37], $Vp = [1, 38], $Vq = [1, 39], $Vr = [1, 41], $Vs = [1, 42], $Vt = [1, 43], $Vu = [1, 44], $Vv = [1, 45], $Vw = [1, 46], $Vx = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $Vy = [4, 5, 16, 50, 52, 53], $Vz = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VA = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VB = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VC = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VD = [68, 69, 70], $VE = [1, 122]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "SPACE": 4, "NEWLINE": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "box_section": 10, "box_line": 11, "participant_statement": 12, "create": 13, "box": 14, "restOfLine": 15, "end": 16, "signal": 17, "autonumber": 18, "NUM": 19, "off": 20, "activate": 21, "actor": 22, "deactivate": 23, "note_statement": 24, "links_statement": 25, "link_statement": 26, "properties_statement": 27, "details_statement": 28, "title": 29, "legacy_title": 30, "acc_title": 31, "acc_title_value": 32, "acc_descr": 33, "acc_descr_value": 34, "acc_descr_multiline_value": 35, "loop": 36, "rect": 37, "opt": 38, "alt": 39, "else_sections": 40, "par": 41, "par_sections": 42, "par_over": 43, "critical": 44, "option_sections": 45, "break": 46, "option": 47, "and": 48, "else": 49, "participant": 50, "AS": 51, "participant_actor": 52, "destroy": 53, "note": 54, "placement": 55, "text2": 56, "over": 57, "actor_pair": 58, "links": 59, "link": 60, "properties": 61, "details": 62, "spaceList": 63, ",": 64, "left_of": 65, "right_of": 66, "signaltype": 67, "+": 68, "-": 69, "ACTOR": 70, "SOLID_OPEN_ARROW": 71, "DOTTED_OPEN_ARROW": 72, "SOLID_ARROW": 73, "BIDIRECTIONAL_SOLID_ARROW": 74, "DOTTED_ARROW": 75, "BIDIRECTIONAL_DOTTED_ARROW": 76, "SOLID_CROSS": 77, "DOTTED_CROSS": 78, "SOLID_POINT": 79, "DOTTED_POINT": 80, "TXT": 81, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "BIDIRECTIONAL_SOLID_ARROW", 75: "DOTTED_ARROW", 76: "BIDIRECTIONAL_DOTTED_ARROW", 77: "SOLID_CROSS", 78: "DOTTED_CROSS", 79: "SOLID_POINT", 80: "DOTTED_POINT", 81: "TXT" }, + productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 3: + yy.apply($$[$0]); + return $$[$0]; + break; + case 4: + case 9: + this.$ = []; + break; + case 5: + case 10: + $$[$0 - 1].push($$[$0]); + this.$ = $$[$0 - 1]; + break; + case 6: + case 7: + case 11: + case 12: + this.$ = $$[$0]; + break; + case 8: + case 13: + this.$ = []; + break; + case 15: + $$[$0].type = "createParticipant"; + this.$ = $$[$0]; + break; + case 16: + $$[$0 - 1].unshift({ type: "boxStart", boxData: yy.parseBoxData($$[$0 - 2]) }); + $$[$0 - 1].push({ type: "boxEnd", boxText: $$[$0 - 2] }); + this.$ = $$[$0 - 1]; + break; + case 18: + this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 2]), sequenceIndexStep: Number($$[$0 - 1]), sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; + break; + case 19: + this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; + break; + case 20: + this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: yy.LINETYPE.AUTONUMBER }; + break; + case 21: + this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; + break; + case 22: + this.$ = { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1].actor }; + break; + case 23: + this.$ = { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1].actor }; + break; + case 29: + yy.setDiagramTitle($$[$0].substring(6)); + this.$ = $$[$0].substring(6); + break; + case 30: + yy.setDiagramTitle($$[$0].substring(7)); + this.$ = $$[$0].substring(7); + break; + case 31: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 32: + case 33: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 34: + $$[$0 - 1].unshift({ type: "loopStart", loopText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.LOOP_START }); + $$[$0 - 1].push({ type: "loopEnd", loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); + this.$ = $$[$0 - 1]; + break; + case 35: + $$[$0 - 1].unshift({ type: "rectStart", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_START }); + $$[$0 - 1].push({ type: "rectEnd", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_END }); + this.$ = $$[$0 - 1]; + break; + case 36: + $$[$0 - 1].unshift({ type: "optStart", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_START }); + $$[$0 - 1].push({ type: "optEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_END }); + this.$ = $$[$0 - 1]; + break; + case 37: + $$[$0 - 1].unshift({ type: "altStart", altText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.ALT_START }); + $$[$0 - 1].push({ type: "altEnd", signalType: yy.LINETYPE.ALT_END }); + this.$ = $$[$0 - 1]; + break; + case 38: + $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_START }); + $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END }); + this.$ = $$[$0 - 1]; + break; + case 39: + $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_OVER_START }); + $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END }); + this.$ = $$[$0 - 1]; + break; + case 40: + $$[$0 - 1].unshift({ type: "criticalStart", criticalText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.CRITICAL_START }); + $$[$0 - 1].push({ type: "criticalEnd", signalType: yy.LINETYPE.CRITICAL_END }); + this.$ = $$[$0 - 1]; + break; + case 41: + $$[$0 - 1].unshift({ type: "breakStart", breakText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_START }); + $$[$0 - 1].push({ type: "breakEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_END }); + this.$ = $$[$0 - 1]; + break; + case 43: + this.$ = $$[$0 - 3].concat([{ type: "option", optionText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.CRITICAL_OPTION }, $$[$0]]); + break; + case 45: + this.$ = $$[$0 - 3].concat([{ type: "and", parText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.PAR_AND }, $$[$0]]); + break; + case 47: + this.$ = $$[$0 - 3].concat([{ type: "else", altText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]); + break; + case 48: + $$[$0 - 3].draw = "participant"; + $$[$0 - 3].type = "addParticipant"; + $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); + this.$ = $$[$0 - 3]; + break; + case 49: + $$[$0 - 1].draw = "participant"; + $$[$0 - 1].type = "addParticipant"; + this.$ = $$[$0 - 1]; + break; + case 50: + $$[$0 - 3].draw = "actor"; + $$[$0 - 3].type = "addParticipant"; + $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); + this.$ = $$[$0 - 3]; + break; + case 51: + $$[$0 - 1].draw = "actor"; + $$[$0 - 1].type = "addParticipant"; + this.$ = $$[$0 - 1]; + break; + case 52: + $$[$0 - 1].type = "destroyParticipant"; + this.$ = $$[$0 - 1]; + break; + case 53: + this.$ = [$$[$0 - 1], { type: "addNote", placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; + break; + case 54: + $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); + $$[$0 - 2][0] = $$[$0 - 2][0].actor; + $$[$0 - 2][1] = $$[$0 - 2][1].actor; + this.$ = [$$[$0 - 1], { type: "addNote", placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; + break; + case 55: + this.$ = [$$[$0 - 1], { type: "addLinks", actor: $$[$0 - 1].actor, text: $$[$0] }]; + break; + case 56: + this.$ = [$$[$0 - 1], { type: "addALink", actor: $$[$0 - 1].actor, text: $$[$0] }]; + break; + case 57: + this.$ = [$$[$0 - 1], { type: "addProperties", actor: $$[$0 - 1].actor, text: $$[$0] }]; + break; + case 58: + this.$ = [$$[$0 - 1], { type: "addDetails", actor: $$[$0 - 1].actor, text: $$[$0] }]; + break; + case 61: + this.$ = [$$[$0 - 2], $$[$0]]; + break; + case 62: + this.$ = $$[$0]; + break; + case 63: + this.$ = yy.PLACEMENT.LEFTOF; + break; + case 64: + this.$ = yy.PLACEMENT.RIGHTOF; + break; + case 65: + this.$ = [ + $$[$0 - 4], + $$[$0 - 1], + { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0], activate: true }, + { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1].actor } + ]; + break; + case 66: + this.$ = [ + $$[$0 - 4], + $$[$0 - 1], + { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, + { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4].actor } + ]; + break; + case 67: + this.$ = [$$[$0 - 3], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; + break; + case 68: + this.$ = { type: "addParticipant", actor: $$[$0] }; + break; + case 69: + this.$ = yy.LINETYPE.SOLID_OPEN; + break; + case 70: + this.$ = yy.LINETYPE.DOTTED_OPEN; + break; + case 71: + this.$ = yy.LINETYPE.SOLID; + break; + case 72: + this.$ = yy.LINETYPE.BIDIRECTIONAL_SOLID; + break; + case 73: + this.$ = yy.LINETYPE.DOTTED; + break; + case 74: + this.$ = yy.LINETYPE.BIDIRECTIONAL_DOTTED; + break; + case 75: + this.$ = yy.LINETYPE.SOLID_CROSS; + break; + case 76: + this.$ = yy.LINETYPE.DOTTED_CROSS; + break; + case 77: + this.$ = yy.LINETYPE.SOLID_POINT; + break; + case 78: + this.$ = yy.LINETYPE.DOTTED_POINT; + break; + case 79: + this.$ = yy.parseMessage($$[$0].trim().substring(1)); + break; } - function i1d() { - _sb.call(this); + }, "anonymous"), + table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o2([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o2($Vx, [2, 5]), { 9: 47, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o2($Vx, [2, 7]), o2($Vx, [2, 8]), o2($Vx, [2, 14]), { 12: 48, 50: $Vo, 52: $Vp, 53: $Vq }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: $Vw }, { 22: 55, 70: $Vw }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, o2($Vx, [2, 29]), o2($Vx, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, o2($Vx, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 70: $Vw }, { 22: 72, 70: $Vw }, { 22: 73, 70: $Vw }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82], 79: [1, 83], 80: [1, 84] }, { 55: 85, 57: [1, 86], 65: [1, 87], 66: [1, 88] }, { 22: 89, 70: $Vw }, { 22: 90, 70: $Vw }, { 22: 91, 70: $Vw }, { 22: 92, 70: $Vw }, o2([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], [2, 68]), o2($Vx, [2, 6]), o2($Vx, [2, 15]), o2($Vy, [2, 9], { 10: 93 }), o2($Vx, [2, 17]), { 5: [1, 95], 19: [1, 94] }, { 5: [1, 96] }, o2($Vx, [2, 21]), { 5: [1, 97] }, { 5: [1, 98] }, o2($Vx, [2, 24]), o2($Vx, [2, 25]), o2($Vx, [2, 26]), o2($Vx, [2, 27]), o2($Vx, [2, 28]), o2($Vx, [2, 31]), o2($Vx, [2, 32]), o2($Vz, $V3, { 7: 99 }), o2($Vz, $V3, { 7: 100 }), o2($Vz, $V3, { 7: 101 }), o2($VA, $V3, { 40: 102, 7: 103 }), o2($VB, $V3, { 42: 104, 7: 105 }), o2($VB, $V3, { 7: 105, 42: 106 }), o2($VC, $V3, { 45: 107, 7: 108 }), o2($Vz, $V3, { 7: 109 }), { 5: [1, 111], 51: [1, 110] }, { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, { 22: 117, 68: [1, 115], 69: [1, 116], 70: $Vw }, o2($VD, [2, 69]), o2($VD, [2, 70]), o2($VD, [2, 71]), o2($VD, [2, 72]), o2($VD, [2, 73]), o2($VD, [2, 74]), o2($VD, [2, 75]), o2($VD, [2, 76]), o2($VD, [2, 77]), o2($VD, [2, 78]), { 22: 118, 70: $Vw }, { 22: 120, 58: 119, 70: $Vw }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 121, 81: $VE }, { 56: 123, 81: $VE }, { 56: 124, 81: $VE }, { 56: 125, 81: $VE }, { 4: [1, 128], 5: [1, 130], 11: 127, 12: 129, 16: [1, 126], 50: $Vo, 52: $Vp, 53: $Vq }, { 5: [1, 131] }, o2($Vx, [2, 19]), o2($Vx, [2, 20]), o2($Vx, [2, 22]), o2($Vx, [2, 23]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 132], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 133], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 134], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 135] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 46], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 49: [1, 136], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 137] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 44], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 48: [1, 138], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 139] }, { 16: [1, 140] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 42], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 47: [1, 141], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 142], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 15: [1, 143] }, o2($Vx, [2, 49]), { 15: [1, 144] }, o2($Vx, [2, 51]), o2($Vx, [2, 52]), { 22: 145, 70: $Vw }, { 22: 146, 70: $Vw }, { 56: 147, 81: $VE }, { 56: 148, 81: $VE }, { 56: 149, 81: $VE }, { 64: [1, 150], 81: [2, 62] }, { 5: [2, 55] }, { 5: [2, 79] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, o2($Vx, [2, 16]), o2($Vy, [2, 10]), { 12: 151, 50: $Vo, 52: $Vp, 53: $Vq }, o2($Vy, [2, 12]), o2($Vy, [2, 13]), o2($Vx, [2, 18]), o2($Vx, [2, 34]), o2($Vx, [2, 35]), o2($Vx, [2, 36]), o2($Vx, [2, 37]), { 15: [1, 152] }, o2($Vx, [2, 38]), { 15: [1, 153] }, o2($Vx, [2, 39]), o2($Vx, [2, 40]), { 15: [1, 154] }, o2($Vx, [2, 41]), { 5: [1, 155] }, { 5: [1, 156] }, { 56: 157, 81: $VE }, { 56: 158, 81: $VE }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 159, 70: $Vw }, o2($Vy, [2, 11]), o2($VA, $V3, { 7: 103, 40: 160 }), o2($VB, $V3, { 7: 105, 42: 161 }), o2($VC, $V3, { 7: 108, 45: 162 }), o2($Vx, [2, 48]), o2($Vx, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 81: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }], + defaultActions: { 5: [2, 1], 6: [2, 2], 87: [2, 63], 88: [2, 64], 121: [2, 55], 122: [2, 79], 123: [2, 56], 124: [2, 57], 125: [2, 58], 147: [2, 67], 148: [2, 53], 149: [2, 54], 157: [2, 65], 158: [2, 66], 159: [2, 61], 160: [2, 47], 161: [2, 45], 162: [2, 43] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function A1d() { - k1d.call(this); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function q4d() { - dWd.call(this); + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function O5d() { - Tsb.call(this); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function R5d() { - dWd.call(this); - } - function lae() { - Tsb.call(this); - } - function Cae() { - Tsb.call(this); - } - function ome() { - kUd.call(this); - } - function Hme() { - ome.call(this); - } - function Nme() { - kUd.call(this); - } - function Gre() { - Tqe.call(this); - } - function aUc() { - this.a = new _sb(); - } - function nZc() { - this.a = new Tsb(); - } - function DZc() { - this.a = new bnb(); - } - function Ddd() { - this.a = new Tsb(); - } - function Oqd() { - this.a = new Yub(); - } - function Oed() { - this.j = new bnb(); - } - function obd() { - this.a = new nbd(); - } - function wQd() { - this.a = new AQd(); - } - function R5c() { - this.a = new V5c(); - } - function wb() { - wb = geb; - vb = new xb(); - } - function Wk() { - Wk = geb; - Vk = new Xk(); - } - function kl() { - kl = geb; - jl = new ll(); - } - function ll() { - Qk.call(this, ""); - } - function Xk() { - Qk.call(this, ""); - } - function Dd(a) { - yd.call(this, a); - } - function Hd(a) { - yd.call(this, a); - } - function xh(a) { - th.call(this, a); - } - function $h(a) { - Wc.call(this, a); - } - function Qi(a) { - Wc.call(this, a); - } - function wi(a) { - $h.call(this, a); - } - function Sp(a) { - $h.call(this, a); - } - function Js(a) { - $h.call(this, a); - } - function Jp(a) { - Xo.call(this, a); - } - function Qp(a) { - Xo.call(this, a); - } - function dq(a) { - ho.call(this, a); - } - function Fv(a) { - uv.call(this, a); - } - function aw(a) { - Tr.call(this, a); - } - function cw(a) { - Tr.call(this, a); - } - function _w(a) { - Tr.call(this, a); - } - function Mx(a) { - Gn.call(this, a); - } - function Nx(a) { - Mx.call(this, a); - } - function yz(a) { - nz.call(this, a); - } - function aC(a) { - yz.call(this, a); - } - function uC() { - vC.call(this, {}); - } - function cC() { - cC = geb; - bC = new dC(); - } - function zs() { - zs = geb; - ys = new As(); - } - function Az() { - Az = geb; - zz = new nb(); - } - function $z() { - $z = geb; - Zz = new bA(); - } - function $A() { - $A = geb; - ZA = new aB(); - } - function Ovb(a) { - Kvb(); - this.a = a; - } - function FKc(a) { - jKc(); - this.a = a; - } - function zud(a) { - nud(); - this.f = a; - } - function Bud(a) { - nud(); - this.f = a; - } - function Cde(a) { - KMd(); - this.a = a; - } - function Lyb(a) { - a.b = null; - a.c = 0; - } - function kz(a, b) { - a.e = b; - hz(a, b); - } - function NYb(a, b) { - a.a = b; - PYb(a); - } - function cLb(a, b, c2) { - a.a[b.g] = c2; - } - function zsd(a, b, c2) { - Hsd(c2, a, b); - } - function shc(a, b) { - Xmc(b.i, a.n); - } - function HCc(a, b) { - ICc(a).Cd(b); - } - function yw(a, b) { - a.a.ec().Mc(b); - } - function ns(a, b) { - return a.g - b.g; - } - function AUb(a, b) { - return a * a / b; - } - function Heb(a) { - return uFb(a), a; - } - function Kfb(a) { - return uFb(a), a; - } - function Mfb(a) { - return uFb(a), a; - } - function JC(a) { - return new hC(a); - } - function LC(a) { - return new OC(a); - } - function shb(a) { - return uFb(a), a; - } - function Chb(a) { - return uFb(a), a; - } - function teb(a) { - yz.call(this, a); - } - function veb(a) { - yz.call(this, a); - } - function zeb(a) { - yz.call(this, a); - } - function Aeb(a) { - nz.call(this, a); - } - function Ifb(a) { - yz.call(this, a); - } - function agb(a) { - yz.call(this, a); - } - function dgb(a) { - yz.call(this, a); - } - function Mgb(a) { - yz.call(this, a); - } - function Ogb(a) { - yz.call(this, a); + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + return 5; + break; + case 1: + break; + case 2: + break; + case 3: + break; + case 4: + break; + case 5: + break; + case 6: + return 19; + break; + case 7: + this.begin("LINE"); + return 14; + break; + case 8: + this.begin("ID"); + return 50; + break; + case 9: + this.begin("ID"); + return 52; + break; + case 10: + return 13; + break; + case 11: + this.begin("ID"); + return 53; + break; + case 12: + yy_.yytext = yy_.yytext.trim(); + this.begin("ALIAS"); + return 70; + break; + case 13: + this.popState(); + this.popState(); + this.begin("LINE"); + return 51; + break; + case 14: + this.popState(); + this.popState(); + return 5; + break; + case 15: + this.begin("LINE"); + return 36; + break; + case 16: + this.begin("LINE"); + return 37; + break; + case 17: + this.begin("LINE"); + return 38; + break; + case 18: + this.begin("LINE"); + return 39; + break; + case 19: + this.begin("LINE"); + return 49; + break; + case 20: + this.begin("LINE"); + return 41; + break; + case 21: + this.begin("LINE"); + return 43; + break; + case 22: + this.begin("LINE"); + return 48; + break; + case 23: + this.begin("LINE"); + return 44; + break; + case 24: + this.begin("LINE"); + return 47; + break; + case 25: + this.begin("LINE"); + return 46; + break; + case 26: + this.popState(); + return 15; + break; + case 27: + return 16; + break; + case 28: + return 65; + break; + case 29: + return 66; + break; + case 30: + return 59; + break; + case 31: + return 60; + break; + case 32: + return 61; + break; + case 33: + return 62; + break; + case 34: + return 57; + break; + case 35: + return 54; + break; + case 36: + this.begin("ID"); + return 21; + break; + case 37: + this.begin("ID"); + return 23; + break; + case 38: + return 29; + break; + case 39: + return 30; + break; + case 40: + this.begin("acc_title"); + return 31; + break; + case 41: + this.popState(); + return "acc_title_value"; + break; + case 42: + this.begin("acc_descr"); + return 33; + break; + case 43: + this.popState(); + return "acc_descr_value"; + break; + case 44: + this.begin("acc_descr_multiline"); + break; + case 45: + this.popState(); + break; + case 46: + return "acc_descr_multiline_value"; + break; + case 47: + return 6; + break; + case 48: + return 18; + break; + case 49: + return 20; + break; + case 50: + return 64; + break; + case 51: + return 5; + break; + case 52: + yy_.yytext = yy_.yytext.trim(); + return 70; + break; + case 53: + return 73; + break; + case 54: + return 74; + break; + case 55: + return 75; + break; + case 56: + return 76; + break; + case 57: + return 71; + break; + case 58: + return 72; + break; + case 59: + return 77; + break; + case 60: + return 78; + break; + case 61: + return 79; + break; + case 62: + return 80; + break; + case 63: + return 81; + break; + case 64: + return 68; + break; + case 65: + return 69; + break; + case 66: + return 5; + break; + case 67: + return "INVALID"; + break; + } + }, "anonymous"), + rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i], + conditions: { "acc_descr_multiline": { "rules": [45, 46], "inclusive": false }, "acc_descr": { "rules": [43], "inclusive": false }, "acc_title": { "rules": [41], "inclusive": false }, "ID": { "rules": [2, 3, 12], "inclusive": false }, "ALIAS": { "rules": [2, 3, 13, 14], "inclusive": false }, "LINE": { "rules": [2, 3, 26], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser12.parser = parser12; + sequenceDiagram_default = parser12; + } + }); + + // src/diagrams/sequence/sequenceDb.ts + function insertLinks(actor, links3) { + if (actor.links == null) { + actor.links = links3; + } else { + for (const key in links3) { + actor.links[key] = links3[key]; + } + } + } + function insertProperties(actor, properties) { + if (actor.properties == null) { + actor.properties = properties; + } else { + for (const key in properties) { + actor.properties[key] = properties[key]; + } + } + } + function boxEnd() { + state3.records.currentBox = void 0; + } + var state3, addBox, addActor, activationCount, addMessage, addSignal, hasAtLeastOneBox, hasAtLeastOneBoxWithTitle, getMessages, getBoxes, getActors, getCreatedActors, getDestroyedActors, getActor, getActorKeys, enableSequenceNumbers, disableSequenceNumbers, showSequenceNumbers, setWrap2, extractWrap, autoWrap2, clear17, parseMessage, parseBoxData, LINETYPE2, ARROWTYPE2, PLACEMENT2, addNote, addLinks, addALink, addProperties, addDetails, getActorProperty, apply2, sequenceDb_default; + var init_sequenceDb = __esm({ + "src/diagrams/sequence/sequenceDb.ts"() { + "use strict"; + init_diagramAPI(); + init_logger(); + init_imperativeState(); + init_common(); + init_commonDb(); + state3 = new ImperativeState(() => ({ + prevActor: void 0, + actors: /* @__PURE__ */ new Map(), + createdActors: /* @__PURE__ */ new Map(), + destroyedActors: /* @__PURE__ */ new Map(), + boxes: [], + messages: [], + notes: [], + sequenceNumbersEnabled: false, + wrapEnabled: void 0, + currentBox: void 0, + lastCreated: void 0, + lastDestroyed: void 0 + })); + addBox = /* @__PURE__ */ __name(function(data5) { + state3.records.boxes.push({ + name: data5.text, + wrap: data5.wrap ?? autoWrap2(), + fill: data5.color, + actorKeys: [] + }); + state3.records.currentBox = state3.records.boxes.slice(-1)[0]; + }, "addBox"); + addActor = /* @__PURE__ */ __name(function(id26, name, description, type3) { + let assignedBox = state3.records.currentBox; + const old = state3.records.actors.get(id26); + if (old) { + if (state3.records.currentBox && old.box && state3.records.currentBox !== old.box) { + throw new Error( + `A same participant should only be defined in one Box: ${old.name} can't be in '${old.box.name}' and in '${state3.records.currentBox.name}' at the same time.` + ); + } + assignedBox = old.box ? old.box : state3.records.currentBox; + old.box = assignedBox; + if (old && name === old.name && description == null) { + return; + } + } + if (description?.text == null) { + description = { text: name, type: type3 }; + } + if (type3 == null || description.text == null) { + description = { text: name, type: type3 }; + } + state3.records.actors.set(id26, { + box: assignedBox, + name, + description: description.text, + wrap: description.wrap ?? autoWrap2(), + prevActor: state3.records.prevActor, + links: {}, + properties: {}, + actorCnt: null, + rectData: null, + type: type3 ?? "participant" + }); + if (state3.records.prevActor) { + const prevActorInRecords = state3.records.actors.get(state3.records.prevActor); + if (prevActorInRecords) { + prevActorInRecords.nextActor = id26; + } + } + if (state3.records.currentBox) { + state3.records.currentBox.actorKeys.push(id26); + } + state3.records.prevActor = id26; + }, "addActor"); + activationCount = /* @__PURE__ */ __name((part) => { + let i2; + let count = 0; + if (!part) { + return 0; + } + for (i2 = 0; i2 < state3.records.messages.length; i2++) { + if (state3.records.messages[i2].type === LINETYPE2.ACTIVE_START && state3.records.messages[i2].from === part) { + count++; + } + if (state3.records.messages[i2].type === LINETYPE2.ACTIVE_END && state3.records.messages[i2].from === part) { + count--; + } + } + return count; + }, "activationCount"); + addMessage = /* @__PURE__ */ __name(function(idFrom, idTo, message, answer) { + state3.records.messages.push({ + from: idFrom, + to: idTo, + message: message.text, + wrap: message.wrap ?? autoWrap2(), + answer + }); + }, "addMessage"); + addSignal = /* @__PURE__ */ __name(function(idFrom, idTo, message, messageType, activate = false) { + if (messageType === LINETYPE2.ACTIVE_END) { + const cnt4 = activationCount(idFrom ?? ""); + if (cnt4 < 1) { + const error3 = new Error("Trying to inactivate an inactive participant (" + idFrom + ")"); + error3.hash = { + text: "->>-", + token: "->>-", + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["'ACTIVE_PARTICIPANT'"] + }; + throw error3; + } + } + state3.records.messages.push({ + from: idFrom, + to: idTo, + message: message?.text ?? "", + wrap: message?.wrap ?? autoWrap2(), + type: messageType, + activate + }); + return true; + }, "addSignal"); + hasAtLeastOneBox = /* @__PURE__ */ __name(function() { + return state3.records.boxes.length > 0; + }, "hasAtLeastOneBox"); + hasAtLeastOneBoxWithTitle = /* @__PURE__ */ __name(function() { + return state3.records.boxes.some((b2) => b2.name); + }, "hasAtLeastOneBoxWithTitle"); + getMessages = /* @__PURE__ */ __name(function() { + return state3.records.messages; + }, "getMessages"); + getBoxes = /* @__PURE__ */ __name(function() { + return state3.records.boxes; + }, "getBoxes"); + getActors = /* @__PURE__ */ __name(function() { + return state3.records.actors; + }, "getActors"); + getCreatedActors = /* @__PURE__ */ __name(function() { + return state3.records.createdActors; + }, "getCreatedActors"); + getDestroyedActors = /* @__PURE__ */ __name(function() { + return state3.records.destroyedActors; + }, "getDestroyedActors"); + getActor = /* @__PURE__ */ __name(function(id26) { + return state3.records.actors.get(id26); + }, "getActor"); + getActorKeys = /* @__PURE__ */ __name(function() { + return [...state3.records.actors.keys()]; + }, "getActorKeys"); + enableSequenceNumbers = /* @__PURE__ */ __name(function() { + state3.records.sequenceNumbersEnabled = true; + }, "enableSequenceNumbers"); + disableSequenceNumbers = /* @__PURE__ */ __name(function() { + state3.records.sequenceNumbersEnabled = false; + }, "disableSequenceNumbers"); + showSequenceNumbers = /* @__PURE__ */ __name(() => state3.records.sequenceNumbersEnabled, "showSequenceNumbers"); + setWrap2 = /* @__PURE__ */ __name(function(wrapSetting) { + state3.records.wrapEnabled = wrapSetting; + }, "setWrap"); + extractWrap = /* @__PURE__ */ __name((text2) => { + if (text2 === void 0) { + return {}; + } + text2 = text2.trim(); + const wrap3 = /^:?wrap:/.exec(text2) !== null ? true : /^:?nowrap:/.exec(text2) !== null ? false : void 0; + const cleanedText = (wrap3 === void 0 ? text2 : text2.replace(/^:?(?:no)?wrap:/, "")).trim(); + return { cleanedText, wrap: wrap3 }; + }, "extractWrap"); + autoWrap2 = /* @__PURE__ */ __name(() => { + if (state3.records.wrapEnabled !== void 0) { + return state3.records.wrapEnabled; + } + return getConfig2().sequence?.wrap ?? false; + }, "autoWrap"); + clear17 = /* @__PURE__ */ __name(function() { + state3.reset(); + clear(); + }, "clear"); + parseMessage = /* @__PURE__ */ __name(function(str2) { + const trimmedStr = str2.trim(); + const { wrap: wrap3, cleanedText } = extractWrap(trimmedStr); + const message = { + text: cleanedText, + wrap: wrap3 + }; + log.debug(`parseMessage: ${JSON.stringify(message)}`); + return message; + }, "parseMessage"); + parseBoxData = /* @__PURE__ */ __name(function(str2) { + const match2 = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(str2); + let color2 = match2?.[1] ? match2[1].trim() : "transparent"; + let title2 = match2?.[2] ? match2[2].trim() : void 0; + if (window?.CSS) { + if (!window.CSS.supports("color", color2)) { + color2 = "transparent"; + title2 = str2.trim(); + } + } else { + const style3 = new Option().style; + style3.color = color2; + if (style3.color !== color2) { + color2 = "transparent"; + title2 = str2.trim(); + } + } + const { wrap: wrap3, cleanedText } = extractWrap(title2); + return { + text: cleanedText ? sanitizeText(cleanedText, getConfig2()) : void 0, + color: color2, + wrap: wrap3 + }; + }, "parseBoxData"); + LINETYPE2 = { + SOLID: 0, + DOTTED: 1, + NOTE: 2, + SOLID_CROSS: 3, + DOTTED_CROSS: 4, + SOLID_OPEN: 5, + DOTTED_OPEN: 6, + LOOP_START: 10, + LOOP_END: 11, + ALT_START: 12, + ALT_ELSE: 13, + ALT_END: 14, + OPT_START: 15, + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18, + PAR_START: 19, + PAR_AND: 20, + PAR_END: 21, + RECT_START: 22, + RECT_END: 23, + SOLID_POINT: 24, + DOTTED_POINT: 25, + AUTONUMBER: 26, + CRITICAL_START: 27, + CRITICAL_OPTION: 28, + CRITICAL_END: 29, + BREAK_START: 30, + BREAK_END: 31, + PAR_OVER_START: 32, + BIDIRECTIONAL_SOLID: 33, + BIDIRECTIONAL_DOTTED: 34 + }; + ARROWTYPE2 = { + FILLED: 0, + OPEN: 1 + }; + PLACEMENT2 = { + LEFTOF: 0, + RIGHTOF: 1, + OVER: 2 + }; + addNote = /* @__PURE__ */ __name(function(actor, placement, message) { + const note3 = { + actor, + placement, + message: message.text, + wrap: message.wrap ?? autoWrap2() + }; + const actors2 = [].concat(actor, actor); + state3.records.notes.push(note3); + state3.records.messages.push({ + from: actors2[0], + to: actors2[1], + message: message.text, + wrap: message.wrap ?? autoWrap2(), + type: LINETYPE2.NOTE, + placement + }); + }, "addNote"); + addLinks = /* @__PURE__ */ __name(function(actorId, text2) { + const actor = getActor(actorId); + try { + let sanitizedText = sanitizeText(text2.text, getConfig2()); + sanitizedText = sanitizedText.replace(/&/g, "&"); + sanitizedText = sanitizedText.replace(/=/g, "="); + const links3 = JSON.parse(sanitizedText); + insertLinks(actor, links3); + } catch (e3) { + log.error("error while parsing actor link text", e3); + } + }, "addLinks"); + addALink = /* @__PURE__ */ __name(function(actorId, text2) { + const actor = getActor(actorId); + try { + const links3 = {}; + let sanitizedText = sanitizeText(text2.text, getConfig2()); + const sep2 = sanitizedText.indexOf("@"); + sanitizedText = sanitizedText.replace(/&/g, "&"); + sanitizedText = sanitizedText.replace(/=/g, "="); + const label = sanitizedText.slice(0, sep2 - 1).trim(); + const link3 = sanitizedText.slice(sep2 + 1).trim(); + links3[label] = link3; + insertLinks(actor, links3); + } catch (e3) { + log.error("error while parsing actor link text", e3); + } + }, "addALink"); + __name(insertLinks, "insertLinks"); + addProperties = /* @__PURE__ */ __name(function(actorId, text2) { + const actor = getActor(actorId); + try { + const sanitizedText = sanitizeText(text2.text, getConfig2()); + const properties = JSON.parse(sanitizedText); + insertProperties(actor, properties); + } catch (e3) { + log.error("error while parsing actor properties text", e3); + } + }, "addProperties"); + __name(insertProperties, "insertProperties"); + __name(boxEnd, "boxEnd"); + addDetails = /* @__PURE__ */ __name(function(actorId, text2) { + const actor = getActor(actorId); + const elem = document.getElementById(text2.text); + try { + const text3 = elem.innerHTML; + const details = JSON.parse(text3); + if (details.properties) { + insertProperties(actor, details.properties); + } + if (details.links) { + insertLinks(actor, details.links); + } + } catch (e3) { + log.error("error while parsing actor details text", e3); + } + }, "addDetails"); + getActorProperty = /* @__PURE__ */ __name(function(actor, key) { + if (actor?.properties !== void 0) { + return actor.properties[key]; + } + return void 0; + }, "getActorProperty"); + apply2 = /* @__PURE__ */ __name(function(param) { + if (Array.isArray(param)) { + param.forEach(function(item) { + apply2(item); + }); + } else { + switch (param.type) { + case "sequenceIndex": + state3.records.messages.push({ + from: void 0, + to: void 0, + message: { + start: param.sequenceIndex, + step: param.sequenceIndexStep, + visible: param.sequenceVisible + }, + wrap: false, + type: param.signalType + }); + break; + case "addParticipant": + addActor(param.actor, param.actor, param.description, param.draw); + break; + case "createParticipant": + if (state3.records.actors.has(param.actor)) { + throw new Error( + "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior" + ); + } + state3.records.lastCreated = param.actor; + addActor(param.actor, param.actor, param.description, param.draw); + state3.records.createdActors.set(param.actor, state3.records.messages.length); + break; + case "destroyParticipant": + state3.records.lastDestroyed = param.actor; + state3.records.destroyedActors.set(param.actor, state3.records.messages.length); + break; + case "activeStart": + addSignal(param.actor, void 0, void 0, param.signalType); + break; + case "activeEnd": + addSignal(param.actor, void 0, void 0, param.signalType); + break; + case "addNote": + addNote(param.actor, param.placement, param.text); + break; + case "addLinks": + addLinks(param.actor, param.text); + break; + case "addALink": + addALink(param.actor, param.text); + break; + case "addProperties": + addProperties(param.actor, param.text); + break; + case "addDetails": + addDetails(param.actor, param.text); + break; + case "addMessage": + if (state3.records.lastCreated) { + if (param.to !== state3.records.lastCreated) { + throw new Error( + "The created participant " + state3.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram." + ); + } else { + state3.records.lastCreated = void 0; + } + } else if (state3.records.lastDestroyed) { + if (param.to !== state3.records.lastDestroyed && param.from !== state3.records.lastDestroyed) { + throw new Error( + "The destroyed participant " + state3.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram." + ); + } else { + state3.records.lastDestroyed = void 0; + } + } + addSignal(param.from, param.to, param.msg, param.signalType, param.activate); + break; + case "boxStart": + addBox(param.boxData); + break; + case "boxEnd": + boxEnd(); + break; + case "loopStart": + addSignal(void 0, void 0, param.loopText, param.signalType); + break; + case "loopEnd": + addSignal(void 0, void 0, void 0, param.signalType); + break; + case "rectStart": + addSignal(void 0, void 0, param.color, param.signalType); + break; + case "rectEnd": + addSignal(void 0, void 0, void 0, param.signalType); + break; + case "optStart": + addSignal(void 0, void 0, param.optText, param.signalType); + break; + case "optEnd": + addSignal(void 0, void 0, void 0, param.signalType); + break; + case "altStart": + addSignal(void 0, void 0, param.altText, param.signalType); + break; + case "else": + addSignal(void 0, void 0, param.altText, param.signalType); + break; + case "altEnd": + addSignal(void 0, void 0, void 0, param.signalType); + break; + case "setAccTitle": + setAccTitle(param.text); + break; + case "parStart": + addSignal(void 0, void 0, param.parText, param.signalType); + break; + case "and": + addSignal(void 0, void 0, param.parText, param.signalType); + break; + case "parEnd": + addSignal(void 0, void 0, void 0, param.signalType); + break; + case "criticalStart": + addSignal(void 0, void 0, param.criticalText, param.signalType); + break; + case "option": + addSignal(void 0, void 0, param.optionText, param.signalType); + break; + case "criticalEnd": + addSignal(void 0, void 0, void 0, param.signalType); + break; + case "breakStart": + addSignal(void 0, void 0, param.breakText, param.signalType); + break; + case "breakEnd": + addSignal(void 0, void 0, void 0, param.signalType); + break; + } + } + }, "apply"); + sequenceDb_default = { + addActor, + addMessage, + addSignal, + addLinks, + addDetails, + addProperties, + autoWrap: autoWrap2, + setWrap: setWrap2, + enableSequenceNumbers, + disableSequenceNumbers, + showSequenceNumbers, + getMessages, + getActors, + getCreatedActors, + getDestroyedActors, + getActor, + getActorKeys, + getActorProperty, + getAccTitle, + getBoxes, + getDiagramTitle, + setDiagramTitle, + getConfig: /* @__PURE__ */ __name(() => getConfig2().sequence, "getConfig"), + clear: clear17, + parseMessage, + parseBoxData, + LINETYPE: LINETYPE2, + ARROWTYPE: ARROWTYPE2, + PLACEMENT: PLACEMENT2, + addNote, + setAccTitle, + apply: apply2, + setAccDescription, + getAccDescription, + hasAtLeastOneBox, + hasAtLeastOneBoxWithTitle + }; + } + }); + + // src/diagrams/sequence/styles.js + var getStyles9, styles_default8; + var init_styles8 = __esm({ + "src/diagrams/sequence/styles.js"() { + "use strict"; + getStyles9 = /* @__PURE__ */ __name((options3) => `.actor { + stroke: ${options3.actorBorder}; + fill: ${options3.actorBkg}; + } + + text.actor > tspan { + fill: ${options3.actorTextColor}; + stroke: none; + } + + .actor-line { + stroke: ${options3.actorLineColor}; + } + + .messageLine0 { + stroke-width: 1.5; + stroke-dasharray: none; + stroke: ${options3.signalColor}; + } + + .messageLine1 { + stroke-width: 1.5; + stroke-dasharray: 2, 2; + stroke: ${options3.signalColor}; + } + + #arrowhead path { + fill: ${options3.signalColor}; + stroke: ${options3.signalColor}; + } + + .sequenceNumber { + fill: ${options3.sequenceNumberColor}; + } + + #sequencenumber { + fill: ${options3.signalColor}; + } + + #crosshead path { + fill: ${options3.signalColor}; + stroke: ${options3.signalColor}; + } + + .messageText { + fill: ${options3.signalTextColor}; + stroke: none; + } + + .labelBox { + stroke: ${options3.labelBoxBorderColor}; + fill: ${options3.labelBoxBkgColor}; + } + + .labelText, .labelText > tspan { + fill: ${options3.labelTextColor}; + stroke: none; + } + + .loopText, .loopText > tspan { + fill: ${options3.loopTextColor}; + stroke: none; + } + + .loopLine { + stroke-width: 2px; + stroke-dasharray: 2, 2; + stroke: ${options3.labelBoxBorderColor}; + fill: ${options3.labelBoxBorderColor}; + } + + .note { + //stroke: #decc93; + stroke: ${options3.noteBorderColor}; + fill: ${options3.noteBkgColor}; + } + + .noteText, .noteText > tspan { + fill: ${options3.noteTextColor}; + stroke: none; + } + + .activation0 { + fill: ${options3.activationBkgColor}; + stroke: ${options3.activationBorderColor}; + } + + .activation1 { + fill: ${options3.activationBkgColor}; + stroke: ${options3.activationBorderColor}; + } + + .activation2 { + fill: ${options3.activationBkgColor}; + stroke: ${options3.activationBorderColor}; + } + + .actorPopupMenu { + position: absolute; + } + + .actorPopupMenuPanel { + position: absolute; + fill: ${options3.actorBkg}; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); +} + .actor-man line { + stroke: ${options3.actorBorder}; + fill: ${options3.actorBkg}; + } + .actor-man circle, line { + stroke: ${options3.actorBorder}; + fill: ${options3.actorBkg}; + stroke-width: 2px; + } +`, "getStyles"); + styles_default8 = getStyles9; + } + }); + + // src/diagrams/sequence/svgDraw.js + var import_sanitize_url5, ACTOR_TYPE_WIDTH, TOP_ACTOR_CLASS, BOTTOM_ACTOR_CLASS, ACTOR_BOX_CLASS, ACTOR_MAN_FIGURE_CLASS, drawRect4, drawPopup, popupMenuToggle, drawKatex, drawText3, drawLabel, actorCnt, fixLifeLineHeights, drawActorTypeParticipant, drawActorTypeActor, drawActor, drawBox, anchorElement, drawActivation, drawLoop, drawBackgroundRect2, insertDatabaseIcon2, insertComputerIcon2, insertClockIcon2, insertArrowHead2, insertArrowFilledHead2, insertSequenceNumber, insertArrowCrossHead2, getTextObj3, getNoteRect2, _drawTextCandidateFunc2, _drawMenuItemTextCandidateFunc, svgDraw_default2; + var init_svgDraw2 = __esm({ + "src/diagrams/sequence/svgDraw.js"() { + "use strict"; + init_common(); + init_svgDrawCommon(); + init_utils2(); + import_sanitize_url5 = __toESM(require_dist(), 1); + init_config(); + ACTOR_TYPE_WIDTH = 18 * 2; + TOP_ACTOR_CLASS = "actor-top"; + BOTTOM_ACTOR_CLASS = "actor-bottom"; + ACTOR_BOX_CLASS = "actor-box"; + ACTOR_MAN_FIGURE_CLASS = "actor-man"; + drawRect4 = /* @__PURE__ */ __name(function(elem, rectData) { + return drawRect(elem, rectData); + }, "drawRect"); + drawPopup = /* @__PURE__ */ __name(function(elem, actor, minMenuWidth, textAttrs, forceMenus) { + if (actor.links === void 0 || actor.links === null || Object.keys(actor.links).length === 0) { + return { height: 0, width: 0 }; + } + const links3 = actor.links; + const actorCnt2 = actor.actorCnt; + const rectData = actor.rectData; + var displayValue = "none"; + if (forceMenus) { + displayValue = "block !important"; + } + const g2 = elem.append("g"); + g2.attr("id", "actor" + actorCnt2 + "_popup"); + g2.attr("class", "actorPopupMenu"); + g2.attr("display", displayValue); + var actorClass = ""; + if (rectData.class !== void 0) { + actorClass = " " + rectData.class; + } + let menuWidth = rectData.width > minMenuWidth ? rectData.width : minMenuWidth; + const rectElem = g2.append("rect"); + rectElem.attr("class", "actorPopupMenuPanel" + actorClass); + rectElem.attr("x", rectData.x); + rectElem.attr("y", rectData.height); + rectElem.attr("fill", rectData.fill); + rectElem.attr("stroke", rectData.stroke); + rectElem.attr("width", menuWidth); + rectElem.attr("height", rectData.height); + rectElem.attr("rx", rectData.rx); + rectElem.attr("ry", rectData.ry); + if (links3 != null) { + var linkY = 20; + for (let key in links3) { + var linkElem = g2.append("a"); + var sanitizedLink = (0, import_sanitize_url5.sanitizeUrl)(links3[key]); + linkElem.attr("xlink:href", sanitizedLink); + linkElem.attr("target", "_blank"); + _drawMenuItemTextCandidateFunc(textAttrs)( + key, + linkElem, + rectData.x + 10, + rectData.height + linkY, + menuWidth, + 20, + { class: "actor" }, + textAttrs + ); + linkY += 30; + } + } + rectElem.attr("height", linkY); + return { height: rectData.height + linkY, width: menuWidth }; + }, "drawPopup"); + popupMenuToggle = /* @__PURE__ */ __name(function(popId) { + return "var pu = document.getElementById('" + popId + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"; + }, "popupMenuToggle"); + drawKatex = /* @__PURE__ */ __name(async function(elem, textData, msgModel = null) { + let textElem = elem.append("foreignObject"); + const lines = await renderKatex(textData.text, getConfig()); + const divElem = textElem.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(lines); + const dim = divElem.node().getBoundingClientRect(); + textElem.attr("height", Math.round(dim.height)).attr("width", Math.round(dim.width)); + if (textData.class === "noteText") { + const rectElem = elem.node().firstChild; + rectElem.setAttribute("height", dim.height + 2 * textData.textMargin); + const rectDim = rectElem.getBBox(); + textElem.attr("x", Math.round(rectDim.x + rectDim.width / 2 - dim.width / 2)).attr("y", Math.round(rectDim.y + rectDim.height / 2 - dim.height / 2)); + } else if (msgModel) { + let { startx, stopx, starty } = msgModel; + if (startx > stopx) { + const temp = startx; + startx = stopx; + stopx = temp; + } + textElem.attr("x", Math.round(startx + Math.abs(startx - stopx) / 2 - dim.width / 2)); + if (textData.class === "loopText") { + textElem.attr("y", Math.round(starty)); + } else { + textElem.attr("y", Math.round(starty - dim.height)); + } + } + return [textElem]; + }, "drawKatex"); + drawText3 = /* @__PURE__ */ __name(function(elem, textData) { + let prevTextHeight = 0; + let textHeight = 0; + const lines = textData.text.split(common_default.lineBreakRegex); + const [_textFontSize, _textFontSizePx] = parseFontSize(textData.fontSize); + let textElems = []; + let dy = 0; + let yfunc = /* @__PURE__ */ __name(() => textData.y, "yfunc"); + if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) { + switch (textData.valign) { + case "top": + case "start": + yfunc = /* @__PURE__ */ __name(() => Math.round(textData.y + textData.textMargin), "yfunc"); + break; + case "middle": + case "center": + yfunc = /* @__PURE__ */ __name(() => Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2), "yfunc"); + break; + case "bottom": + case "end": + yfunc = /* @__PURE__ */ __name(() => Math.round( + textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin + ), "yfunc"); + break; + } + } + if (textData.anchor !== void 0 && textData.textMargin !== void 0 && textData.width !== void 0) { + switch (textData.anchor) { + case "left": + case "start": + textData.x = Math.round(textData.x + textData.textMargin); + textData.anchor = "start"; + textData.dominantBaseline = "middle"; + textData.alignmentBaseline = "middle"; + break; + case "middle": + case "center": + textData.x = Math.round(textData.x + textData.width / 2); + textData.anchor = "middle"; + textData.dominantBaseline = "middle"; + textData.alignmentBaseline = "middle"; + break; + case "right": + case "end": + textData.x = Math.round(textData.x + textData.width - textData.textMargin); + textData.anchor = "end"; + textData.dominantBaseline = "middle"; + textData.alignmentBaseline = "middle"; + break; + } + } + for (let [i2, line2] of lines.entries()) { + if (textData.textMargin !== void 0 && textData.textMargin === 0 && _textFontSize !== void 0) { + dy = i2 * _textFontSize; + } + const textElem = elem.append("text"); + textElem.attr("x", textData.x); + textElem.attr("y", yfunc()); + if (textData.anchor !== void 0) { + textElem.attr("text-anchor", textData.anchor).attr("dominant-baseline", textData.dominantBaseline).attr("alignment-baseline", textData.alignmentBaseline); + } + if (textData.fontFamily !== void 0) { + textElem.style("font-family", textData.fontFamily); + } + if (_textFontSizePx !== void 0) { + textElem.style("font-size", _textFontSizePx); + } + if (textData.fontWeight !== void 0) { + textElem.style("font-weight", textData.fontWeight); + } + if (textData.fill !== void 0) { + textElem.attr("fill", textData.fill); + } + if (textData.class !== void 0) { + textElem.attr("class", textData.class); + } + if (textData.dy !== void 0) { + textElem.attr("dy", textData.dy); + } else if (dy !== 0) { + textElem.attr("dy", dy); + } + const text2 = line2 || ZERO_WIDTH_SPACE; + if (textData.tspan) { + const span = textElem.append("tspan"); + span.attr("x", textData.x); + if (textData.fill !== void 0) { + span.attr("fill", textData.fill); } - function kib(a) { - yz.call(this, a); + span.text(text2); + } else { + textElem.text(text2); + } + if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) { + textHeight += (textElem._groups || textElem)[0][0].getBBox().height; + prevTextHeight = textHeight; + } + textElems.push(textElem); + } + return textElems; + }, "drawText"); + drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) { + function genPoints(x5, y5, width3, height2, cut) { + return x5 + "," + y5 + " " + (x5 + width3) + "," + y5 + " " + (x5 + width3) + "," + (y5 + height2 - cut) + " " + (x5 + width3 - cut * 1.2) + "," + (y5 + height2) + " " + x5 + "," + (y5 + height2); + } + __name(genPoints, "genPoints"); + const polygon2 = elem.append("polygon"); + polygon2.attr("points", genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7)); + polygon2.attr("class", "labelBox"); + txtObject.y = txtObject.y + txtObject.height / 2; + drawText3(elem, txtObject); + return polygon2; + }, "drawLabel"); + actorCnt = -1; + fixLifeLineHeights = /* @__PURE__ */ __name((diagram23, actors2, actorKeys, conf8) => { + if (!diagram23.select) { + return; + } + actorKeys.forEach((actorKey) => { + const actor = actors2.get(actorKey); + const actorDOM = diagram23.select("#actor" + actor.actorCnt); + if (!conf8.mirrorActors && actor.stopy) { + actorDOM.attr("y2", actor.stopy + actor.height / 2); + } else if (conf8.mirrorActors) { + actorDOM.attr("y2", actor.stopy); + } + }); + }, "fixLifeLineHeights"); + drawActorTypeParticipant = /* @__PURE__ */ __name(function(elem, actor, conf8, isFooter) { + const actorY = isFooter ? actor.stopy : actor.starty; + const center4 = actor.x + actor.width / 2; + const centerY = actorY + 5; + const boxplusLineGroup = elem.append("g").lower(); + var g2 = boxplusLineGroup; + if (!isFooter) { + actorCnt++; + if (Object.keys(actor.links || {}).length && !conf8.forceMenus) { + g2.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"); + } + g2.append("line").attr("id", "actor" + actorCnt).attr("x1", center4).attr("y1", centerY).attr("x2", center4).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", actor.name); + g2 = boxplusLineGroup.append("g"); + actor.actorCnt = actorCnt; + if (actor.links != null) { + g2.attr("id", "root-" + actorCnt); + } + } + const rect4 = getNoteRect(); + var cssclass = "actor"; + if (actor.properties?.class) { + cssclass = actor.properties.class; + } else { + rect4.fill = "#eaeaea"; + } + if (isFooter) { + cssclass += ` ${BOTTOM_ACTOR_CLASS}`; + } else { + cssclass += ` ${TOP_ACTOR_CLASS}`; + } + rect4.x = actor.x; + rect4.y = actorY; + rect4.width = actor.width; + rect4.height = actor.height; + rect4.class = cssclass; + rect4.rx = 3; + rect4.ry = 3; + rect4.name = actor.name; + const rectElem = drawRect4(g2, rect4); + actor.rectData = rect4; + if (actor.properties?.icon) { + const iconSrc = actor.properties.icon.trim(); + if (iconSrc.charAt(0) === "@") { + drawEmbeddedImage(g2, rect4.x + rect4.width - 20, rect4.y + 10, iconSrc.substr(1)); + } else { + drawImage(g2, rect4.x + rect4.width - 20, rect4.y + 10, iconSrc); + } + } + _drawTextCandidateFunc2(conf8, hasKatex(actor.description))( + actor.description, + g2, + rect4.x, + rect4.y, + rect4.width, + rect4.height, + { class: `actor ${ACTOR_BOX_CLASS}` }, + conf8 + ); + let height2 = actor.height; + if (rectElem.node) { + const bounds4 = rectElem.node().getBBox(); + actor.height = bounds4.height; + height2 = bounds4.height; + } + return height2; + }, "drawActorTypeParticipant"); + drawActorTypeActor = /* @__PURE__ */ __name(function(elem, actor, conf8, isFooter) { + const actorY = isFooter ? actor.stopy : actor.starty; + const center4 = actor.x + actor.width / 2; + const centerY = actorY + 80; + const line2 = elem.append("g").lower(); + if (!isFooter) { + actorCnt++; + line2.append("line").attr("id", "actor" + actorCnt).attr("x1", center4).attr("y1", centerY).attr("x2", center4).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", actor.name); + actor.actorCnt = actorCnt; + } + const actElem = elem.append("g"); + let cssClass = ACTOR_MAN_FIGURE_CLASS; + if (isFooter) { + cssClass += ` ${BOTTOM_ACTOR_CLASS}`; + } else { + cssClass += ` ${TOP_ACTOR_CLASS}`; + } + actElem.attr("class", cssClass); + actElem.attr("name", actor.name); + const rect4 = getNoteRect(); + rect4.x = actor.x; + rect4.y = actorY; + rect4.fill = "#eaeaea"; + rect4.width = actor.width; + rect4.height = actor.height; + rect4.class = "actor"; + rect4.rx = 3; + rect4.ry = 3; + actElem.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", center4).attr("y1", actorY + 25).attr("x2", center4).attr("y2", actorY + 45); + actElem.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", center4 - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 33).attr("x2", center4 + ACTOR_TYPE_WIDTH / 2).attr("y2", actorY + 33); + actElem.append("line").attr("x1", center4 - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 60).attr("x2", center4).attr("y2", actorY + 45); + actElem.append("line").attr("x1", center4).attr("y1", actorY + 45).attr("x2", center4 + ACTOR_TYPE_WIDTH / 2 - 2).attr("y2", actorY + 60); + const circle6 = actElem.append("circle"); + circle6.attr("cx", actor.x + actor.width / 2); + circle6.attr("cy", actorY + 10); + circle6.attr("r", 15); + circle6.attr("width", actor.width); + circle6.attr("height", actor.height); + const bounds4 = actElem.node().getBBox(); + actor.height = bounds4.height; + _drawTextCandidateFunc2(conf8, hasKatex(actor.description))( + actor.description, + actElem, + rect4.x, + rect4.y + 35, + rect4.width, + rect4.height, + { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, + conf8 + ); + return actor.height; + }, "drawActorTypeActor"); + drawActor = /* @__PURE__ */ __name(async function(elem, actor, conf8, isFooter) { + switch (actor.type) { + case "actor": + return await drawActorTypeActor(elem, actor, conf8, isFooter); + case "participant": + return await drawActorTypeParticipant(elem, actor, conf8, isFooter); + } + }, "drawActor"); + drawBox = /* @__PURE__ */ __name(function(elem, box, conf8) { + const boxplusTextGroup = elem.append("g"); + const g2 = boxplusTextGroup; + drawBackgroundRect2(g2, box); + if (box.name) { + _drawTextCandidateFunc2(conf8)( + box.name, + g2, + box.x, + box.y + (box.textMaxHeight || 0) / 2, + box.width, + 0, + { class: "text" }, + conf8 + ); + } + g2.lower(); + }, "drawBox"); + anchorElement = /* @__PURE__ */ __name(function(elem) { + return elem.append("g"); + }, "anchorElement"); + drawActivation = /* @__PURE__ */ __name(function(elem, bounds4, verticalPos, conf8, actorActivations2) { + const rect4 = getNoteRect(); + const g2 = bounds4.anchored; + rect4.x = bounds4.startx; + rect4.y = bounds4.starty; + rect4.class = "activation" + actorActivations2 % 3; + rect4.width = bounds4.stopx - bounds4.startx; + rect4.height = verticalPos - bounds4.starty; + drawRect4(g2, rect4); + }, "drawActivation"); + drawLoop = /* @__PURE__ */ __name(async function(elem, loopModel, labelText, conf8) { + const { + boxMargin, + boxTextMargin, + labelBoxHeight, + labelBoxWidth, + messageFontFamily: fontFamily, + messageFontSize: fontSize, + messageFontWeight: fontWeight + } = conf8; + const g2 = elem.append("g"); + const drawLoopLine = /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) { + return g2.append("line").attr("x1", startx).attr("y1", starty).attr("x2", stopx).attr("y2", stopy).attr("class", "loopLine"); + }, "drawLoopLine"); + drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty); + drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy); + drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy); + drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy); + if (loopModel.sections !== void 0) { + loopModel.sections.forEach(function(item) { + drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style( + "stroke-dasharray", + "3, 3" + ); + }); + } + let txt = getTextObj(); + txt.text = labelText; + txt.x = loopModel.startx; + txt.y = loopModel.starty; + txt.fontFamily = fontFamily; + txt.fontSize = fontSize; + txt.fontWeight = fontWeight; + txt.anchor = "middle"; + txt.valign = "middle"; + txt.tspan = false; + txt.width = labelBoxWidth || 50; + txt.height = labelBoxHeight || 20; + txt.textMargin = boxTextMargin; + txt.class = "labelText"; + drawLabel(g2, txt); + txt = getTextObj3(); + txt.text = loopModel.title; + txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2; + txt.y = loopModel.starty + boxMargin + boxTextMargin; + txt.anchor = "middle"; + txt.valign = "middle"; + txt.textMargin = boxTextMargin; + txt.class = "loopText"; + txt.fontFamily = fontFamily; + txt.fontSize = fontSize; + txt.fontWeight = fontWeight; + txt.wrap = true; + let textElem = hasKatex(txt.text) ? await drawKatex(g2, txt, loopModel) : drawText3(g2, txt); + if (loopModel.sectionTitles !== void 0) { + for (const [idx, item] of Object.entries(loopModel.sectionTitles)) { + if (item.message) { + txt.text = item.message; + txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2; + txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin; + txt.class = "loopText"; + txt.anchor = "middle"; + txt.valign = "middle"; + txt.tspan = false; + txt.fontFamily = fontFamily; + txt.fontSize = fontSize; + txt.fontWeight = fontWeight; + txt.wrap = loopModel.wrap; + if (hasKatex(txt.text)) { + loopModel.starty = loopModel.sections[idx].y; + await drawKatex(g2, txt, loopModel); + } else { + drawText3(g2, txt); + } + let sectionHeight = Math.round( + textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr) + ); + loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin); } - function Jed(a) { - yz.call(this, a); - } - function Ked(a) { - yz.call(this, a); - } - function CDd(a) { - yz.call(this, a); - } - function Mle(a) { - yz.call(this, a); - } - function Lqe(a) { - yz.call(this, a); - } - function mob(a) { - uFb(a); - this.a = a; - } - function yYb(a) { - sYb(a); - return a; - } - function Nnb(a) { - Snb(a, a.length); - } - function nmb(a) { - return a.b == a.c; - } - function Vyb(a) { - return !!a && a.b; - } - function gLb(a) { - return !!a && a.k; - } - function hLb(a) { - return !!a && a.j; - } - function F_b(a, b, c2) { - a.c.Ef(b, c2); - } - function Ts(a, b) { - a.be(b); - b.ae(a); - } - function Fy(a) { - _l(); - this.a = Qb(a); - } - function Gb() { - this.a = WD(Qb(pve)); - } - function jc() { - throw Adb(new jib()); - } - function jn() { - throw Adb(new jib()); - } - function Hh() { - throw Adb(new jib()); - } - function Xi() { - throw Adb(new jib()); - } - function Xj() { - throw Adb(new jib()); - } - function Yj() { - throw Adb(new jib()); - } - function Qz() { - Qz = geb; - !!(fA(), eA); - } - function Qhb() { - reb.call(this, ""); - } - function Rhb() { - reb.call(this, ""); - } - function bib() { - reb.call(this, ""); - } - function cib() { - reb.call(this, ""); - } - function eib(a) { - veb.call(this, a); - } - function xeb(a) { - veb.call(this, a); - } - function Vgb(a) { - agb.call(this, a); - } - function Lqb(a) { - xpb.call(this, a); - } - function Sqb(a) { - Lqb.call(this, a); - } - function irb(a) { - Upb.call(this, a); - } - function pc(a) { - qc.call(this, a, 0); - } - function Ri() { - Si.call(this, 12, 3); - } - function WC(a, b) { - return xfb(a, b); - } - function cFb(a, b) { - return dD(a, b); - } - function Reb(a, b) { - return a.a - b.a; - } - function afb(a, b) { - return a.a - b.a; - } - function Wgb(a, b) { - return a.a - b.a; - } - function pC(b, a) { - return a in b.a; - } - function Vvb(a) { - return a.a ? a.b : 0; - } - function cwb(a) { - return a.a ? a.b : 0; - } - function Fxb(a, b, c2) { - b.Cd(a.a[c2]); - } - function Kxb(a, b, c2) { - b.Pe(a.a[c2]); - } - function uKb(a, b) { - a.b = new sjd(b); - } - function QGb(a, b) { - a.b = b; - return a; - } - function RGb(a, b) { - a.c = b; - return a; - } - function SGb(a, b) { - a.f = b; - return a; - } - function TGb(a, b) { - a.g = b; - return a; - } - function yJb(a, b) { - a.a = b; - return a; - } - function zJb(a, b) { - a.f = b; - return a; - } - function AJb(a, b) { - a.k = b; - return a; - } - function WNb(a, b) { - a.a = b; - return a; - } - function XNb(a, b) { - a.e = b; - return a; - } - function BYb(a, b) { - a.e = b; - return a; - } - function CYb(a, b) { - a.f = b; - return a; - } - function BRb(a, b) { - a.b = true; - a.d = b; - } - function WNc(a, b) { - return a.b - b.b; - } - function KSc(a, b) { - return a.g - b.g; - } - function pmc(a, b) { - return a ? 0 : b - 1; - } - function qKc(a, b) { - return a ? 0 : b - 1; - } - function pKc(a, b) { - return a ? b - 1 : 0; - } - function uVc(a, b) { - return a.s - b.s; - } - function Xed(a, b) { - return b.rg(a); - } - function Xfd(a, b) { - a.b = b; - return a; - } - function Wfd(a, b) { - a.a = b; - return a; - } - function Yfd(a, b) { - a.c = b; - return a; - } - function Zfd(a, b) { - a.d = b; - return a; - } - function $fd(a, b) { - a.e = b; - return a; - } - function _fd(a, b) { - a.f = b; - return a; - } - function mgd(a, b) { - a.a = b; - return a; - } - function ngd(a, b) { - a.b = b; - return a; - } - function ogd(a, b) { - a.c = b; - return a; - } - function Khd(a, b) { - a.c = b; - return a; - } - function Jhd(a, b) { - a.b = b; - return a; - } - function Lhd(a, b) { - a.d = b; - return a; - } - function Mhd(a, b) { - a.e = b; - return a; - } - function Nhd(a, b) { - a.f = b; - return a; - } - function Ohd(a, b) { - a.g = b; - return a; - } - function Phd(a, b) { - a.a = b; - return a; - } - function Qhd(a, b) { - a.i = b; - return a; - } - function Rhd(a, b) { - a.j = b; - return a; - } - function coc(a, b) { - Mnc(); - P3b(b, a); - } - function bbd(a, b, c2) { - _ad(a.a, b, c2); - } - function Fjd(a) { - Zub.call(this, a); - } - function TRb(a) { - SRb.call(this, a); - } - function pLc(a) { - CIc.call(this, a); - } - function ILc(a) { - CIc.call(this, a); - } - function gLd(a) { - ZHd.call(this, a); - } - function DPd(a) { - xPd.call(this, a); - } - function FPd(a) { - xPd.call(this, a); - } - function x2b() { - y2b.call(this, ""); - } - function pjd() { - this.a = 0; - this.b = 0; - } - function ATc() { - this.b = 0; - this.a = 0; - } - function lXd(a, b) { - a.b = 0; - bWd(a, b); - } - function Kqd(a, b) { - a.k = b; - return a; - } - function Lqd(a, b) { - a.j = b; - return a; - } - function vfe(a, b) { - a.c = b; - a.b = true; - } - function Etb() { - Etb = geb; - Dtb = Gtb(); - } - function bvd() { - bvd = geb; - avd = OAd(); - } - function dvd() { - dvd = geb; - cvd = aCd(); - } - function MId() { - MId = geb; - LId = ygd(); - } - function jTd() { - jTd = geb; - iTd = Qae(); - } - function Ole() { - Ole = geb; - Nle = vne(); - } - function Qle() { - Qle = geb; - Ple = Cne(); - } - function mfb(a) { - return a.e && a.e(); - } - function FD(a) { - return a.l | a.m << 22; - } - function Oc(a, b) { - return a.c._b(b); - } - function En(a, b) { - return Wv(a.b, b); - } - function Vd(a) { - return !a ? null : a.d; - } - function Vv(a) { - return !a ? null : a.g; - } - function $v(a) { - return !a ? null : a.i; - } - function nfb(a) { - lfb(a); - return a.o; - } - function Khb(a, b) { - a.a += b; - return a; - } - function Lhb(a, b) { - a.a += b; - return a; - } - function Ohb(a, b) { - a.a += b; - return a; - } - function Uhb(a, b) { - a.a += b; - return a; - } - function _wb(a, b) { - while (a.Bd(b)) - ; - } - function atb(a) { - this.a = new Usb(a); - } - function $tb() { - throw Adb(new jib()); - } - function qpb() { - throw Adb(new jib()); + } + } + loopModel.height = Math.round(loopModel.stopy - loopModel.starty); + return g2; + }, "drawLoop"); + drawBackgroundRect2 = /* @__PURE__ */ __name(function(elem, bounds4) { + drawBackgroundRect(elem, bounds4); + }, "drawBackgroundRect"); + insertDatabaseIcon2 = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr( + "d", + "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z" + ); + }, "insertDatabaseIcon"); + insertComputerIcon2 = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( + "d", + "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z" + ); + }, "insertComputerIcon"); + insertClockIcon2 = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( + "d", + "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z" + ); + }, "insertClockIcon"); + insertArrowHead2 = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z"); + }, "insertArrowHead"); + insertArrowFilledHead2 = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + }, "insertArrowFilledHead"); + insertSequenceNumber = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6); + }, "insertSequenceNumber"); + insertArrowCrossHead2 = /* @__PURE__ */ __name(function(elem) { + const defs2 = elem.append("defs"); + const marker = defs2.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5); + marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7"); + }, "insertArrowCrossHead"); + getTextObj3 = /* @__PURE__ */ __name(function() { + return { + x: 0, + y: 0, + fill: void 0, + anchor: void 0, + style: "#666", + width: void 0, + height: void 0, + textMargin: 0, + rx: 0, + ry: 0, + tspan: true, + valign: void 0 + }; + }, "getTextObj"); + getNoteRect2 = /* @__PURE__ */ __name(function() { + return { + x: 0, + y: 0, + fill: "#EDF2AE", + stroke: "#666", + width: 100, + anchor: "start", + height: 100, + rx: 0, + ry: 0 + }; + }, "getNoteRect"); + _drawTextCandidateFunc2 = /* @__PURE__ */ function() { + function byText(content, g2, x5, y5, width3, height2, textAttrs) { + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("text-anchor", "middle").text(content); + _setTextAttrs(text2, textAttrs); + } + __name(byText, "byText"); + function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const { actorFontSize, actorFontFamily, actorFontWeight } = conf8; + const [_actorFontSize, _actorFontSizePx] = parseFontSize(actorFontSize); + const lines = content.split(common_default.lineBreakRegex); + for (let i2 = 0; i2 < lines.length; i2++) { + const dy = i2 * _actorFontSize - _actorFontSize * (lines.length - 1) / 2; + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).style("text-anchor", "middle").style("font-size", _actorFontSizePx).style("font-weight", actorFontWeight).style("font-family", actorFontFamily); + text2.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]); + text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); + _setTextAttrs(text2, textAttrs); + } + } + __name(byTspan, "byTspan"); + function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const s2 = g2.append("switch"); + const f3 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2); + const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); + text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); + byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8); + _setTextAttrs(text2, textAttrs); + } + __name(byFo, "byFo"); + async function byKatex(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const dim = await calculateMathMLDimensions(content, getConfig()); + const s2 = g2.append("switch"); + const f3 = s2.append("foreignObject").attr("x", x5 + width3 / 2 - dim.width / 2).attr("y", y5 + height2 / 2 - dim.height / 2).attr("width", dim.width).attr("height", dim.height); + const text2 = f3.append("xhtml:div").style("height", "100%").style("width", "100%"); + text2.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatex(content, getConfig())); + byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8); + _setTextAttrs(text2, textAttrs); + } + __name(byKatex, "byKatex"); + function _setTextAttrs(toText, fromTextAttrsDict) { + for (const key in fromTextAttrsDict) { + if (fromTextAttrsDict.hasOwnProperty(key)) { + toText.attr(key, fromTextAttrsDict[key]); + } + } + } + __name(_setTextAttrs, "_setTextAttrs"); + return function(conf8, hasKatex2 = false) { + if (hasKatex2) { + return byKatex; + } + return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan; + }; + }(); + _drawMenuItemTextCandidateFunc = /* @__PURE__ */ function() { + function byText(content, g2, x5, y5, width3, height2, textAttrs) { + const text2 = g2.append("text").attr("x", x5).attr("y", y5).style("text-anchor", "start").text(content); + _setTextAttrs(text2, textAttrs); + } + __name(byText, "byText"); + function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const { actorFontSize, actorFontFamily, actorFontWeight } = conf8; + const lines = content.split(common_default.lineBreakRegex); + for (let i2 = 0; i2 < lines.length; i2++) { + const dy = i2 * actorFontSize - actorFontSize * (lines.length - 1) / 2; + const text2 = g2.append("text").attr("x", x5).attr("y", y5).style("text-anchor", "start").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily); + text2.append("tspan").attr("x", x5).attr("dy", dy).text(lines[i2]); + text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); + _setTextAttrs(text2, textAttrs); + } + } + __name(byTspan, "byTspan"); + function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const s2 = g2.append("switch"); + const f3 = s2.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2); + const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); + text2.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); + byTspan(content, s2, x5, y5, width3, height2, textAttrs, conf8); + _setTextAttrs(text2, textAttrs); + } + __name(byFo, "byFo"); + function _setTextAttrs(toText, fromTextAttrsDict) { + for (const key in fromTextAttrsDict) { + if (fromTextAttrsDict.hasOwnProperty(key)) { + toText.attr(key, fromTextAttrsDict[key]); + } + } + } + __name(_setTextAttrs, "_setTextAttrs"); + return function(conf8) { + return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan; + }; + }(); + svgDraw_default2 = { + drawRect: drawRect4, + drawText: drawText3, + drawLabel, + drawActor, + drawBox, + drawPopup, + anchorElement, + drawActivation, + drawLoop, + drawBackgroundRect: drawBackgroundRect2, + insertArrowHead: insertArrowHead2, + insertArrowFilledHead: insertArrowFilledHead2, + insertSequenceNumber, + insertArrowCrossHead: insertArrowCrossHead2, + insertDatabaseIcon: insertDatabaseIcon2, + insertComputerIcon: insertComputerIcon2, + insertClockIcon: insertClockIcon2, + getTextObj: getTextObj3, + getNoteRect: getNoteRect2, + fixLifeLineHeights, + sanitizeUrl: import_sanitize_url5.sanitizeUrl + }; + } + }); + + // src/diagrams/sequence/sequenceRenderer.ts + async function boundMessage(_diagram, msgModel) { + bounds.bumpVerticalPos(10); + const { startx, stopx, message } = msgModel; + const lines = common_default.splitBreaks(message).length; + const isKatexMsg = hasKatex(message); + const textDims = isKatexMsg ? await calculateMathMLDimensions(message, getConfig2()) : utils_default2.calculateTextDimensions(message, messageFont2(conf4)); + if (!isKatexMsg) { + const lineHeight = textDims.height / lines; + msgModel.height += lineHeight; + bounds.bumpVerticalPos(lineHeight); + } + let lineStartY; + let totalOffset = textDims.height - 10; + const textWidth = textDims.width; + if (startx === stopx) { + lineStartY = bounds.getVerticalPos() + totalOffset; + if (!conf4.rightAngles) { + totalOffset += conf4.boxMargin; + lineStartY = bounds.getVerticalPos() + totalOffset; + } + totalOffset += 30; + const dx = common_default.getMax(textWidth / 2, conf4.width / 2); + bounds.insert( + startx - dx, + bounds.getVerticalPos() - 10 + totalOffset, + stopx + dx, + bounds.getVerticalPos() + 30 + totalOffset + ); + } else { + totalOffset += conf4.boxMargin; + lineStartY = bounds.getVerticalPos() + totalOffset; + bounds.insert(startx, lineStartY - 10, stopx, lineStartY); + } + bounds.bumpVerticalPos(totalOffset); + msgModel.height += totalOffset; + msgModel.stopy = msgModel.starty + msgModel.height; + bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy); + return lineStartY; + } + function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) { + bounds.bumpVerticalPos(preMargin); + let heightAdjust = postMargin; + if (msg.id && msg.message && loopWidths[msg.id]) { + const loopWidth = loopWidths[msg.id].width; + const textConf = messageFont2(conf4); + msg.message = utils_default2.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf4.wrapPadding, textConf); + msg.width = loopWidth; + msg.wrap = true; + const textDims = utils_default2.calculateTextDimensions(msg.message, textConf); + const totalOffset = common_default.getMax(textDims.height, conf4.labelBoxHeight); + heightAdjust = postMargin + totalOffset; + log.debug(`${totalOffset} - ${msg.message}`); + } + addLoopFn(msg); + bounds.bumpVerticalPos(heightAdjust); + } + function adjustCreatedDestroyedData(msg, msgModel, lineStartY, index, actors2, createdActors, destroyedActors) { + function receiverAdjustment(actor, adjustment) { + if (actor.x < actors2.get(msg.from).x) { + bounds.insert( + msgModel.stopx - adjustment, + msgModel.starty, + msgModel.startx, + msgModel.stopy + actor.height / 2 + conf4.noteMargin + ); + msgModel.stopx = msgModel.stopx + adjustment; + } else { + bounds.insert( + msgModel.startx, + msgModel.starty, + msgModel.stopx + adjustment, + msgModel.stopy + actor.height / 2 + conf4.noteMargin + ); + msgModel.stopx = msgModel.stopx - adjustment; + } + } + __name(receiverAdjustment, "receiverAdjustment"); + function senderAdjustment(actor, adjustment) { + if (actor.x < actors2.get(msg.to).x) { + bounds.insert( + msgModel.startx - adjustment, + msgModel.starty, + msgModel.stopx, + msgModel.stopy + actor.height / 2 + conf4.noteMargin + ); + msgModel.startx = msgModel.startx + adjustment; + } else { + bounds.insert( + msgModel.stopx, + msgModel.starty, + msgModel.startx + adjustment, + msgModel.stopy + actor.height / 2 + conf4.noteMargin + ); + msgModel.startx = msgModel.startx - adjustment; + } + } + __name(senderAdjustment, "senderAdjustment"); + if (createdActors.get(msg.to) == index) { + const actor = actors2.get(msg.to); + const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3; + receiverAdjustment(actor, adjustment); + actor.starty = lineStartY - actor.height / 2; + bounds.bumpVerticalPos(actor.height / 2); + } else if (destroyedActors.get(msg.from) == index) { + const actor = actors2.get(msg.from); + if (conf4.mirrorActors) { + const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 : actor.width / 2; + senderAdjustment(actor, adjustment); + } + actor.stopy = lineStartY - actor.height / 2; + bounds.bumpVerticalPos(actor.height / 2); + } else if (destroyedActors.get(msg.to) == index) { + const actor = actors2.get(msg.to); + if (conf4.mirrorActors) { + const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3; + receiverAdjustment(actor, adjustment); + } + actor.stopy = lineStartY - actor.height / 2; + bounds.bumpVerticalPos(actor.height / 2); + } + } + async function getMaxMessageWidthPerActor(actors2, messages, diagObj) { + const maxMessageWidthPerActor = {}; + for (const msg of messages) { + if (actors2.get(msg.to) && actors2.get(msg.from)) { + const actor = actors2.get(msg.to); + if (msg.placement === diagObj.db.PLACEMENT.LEFTOF && !actor.prevActor) { + continue; + } + if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF && !actor.nextActor) { + continue; + } + const isNote = msg.placement !== void 0; + const isMessage = !isNote; + const textFont = isNote ? noteFont(conf4) : messageFont2(conf4); + const wrappedMessage = msg.wrap ? utils_default2.wrapLabel(msg.message, conf4.width - 2 * conf4.wrapPadding, textFont) : msg.message; + const messageDimensions = hasKatex(wrappedMessage) ? await calculateMathMLDimensions(msg.message, getConfig2()) : utils_default2.calculateTextDimensions(wrappedMessage, textFont); + const messageWidth = messageDimensions.width + 2 * conf4.wrapPadding; + if (isMessage && msg.from === actor.nextActor) { + maxMessageWidthPerActor[msg.to] = common_default.getMax( + maxMessageWidthPerActor[msg.to] || 0, + messageWidth + ); + } else if (isMessage && msg.from === actor.prevActor) { + maxMessageWidthPerActor[msg.from] = common_default.getMax( + maxMessageWidthPerActor[msg.from] || 0, + messageWidth + ); + } else if (isMessage && msg.from === msg.to) { + maxMessageWidthPerActor[msg.from] = common_default.getMax( + maxMessageWidthPerActor[msg.from] || 0, + messageWidth / 2 + ); + maxMessageWidthPerActor[msg.to] = common_default.getMax( + maxMessageWidthPerActor[msg.to] || 0, + messageWidth / 2 + ); + } else if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) { + maxMessageWidthPerActor[msg.from] = common_default.getMax( + maxMessageWidthPerActor[msg.from] || 0, + messageWidth + ); + } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) { + maxMessageWidthPerActor[actor.prevActor] = common_default.getMax( + maxMessageWidthPerActor[actor.prevActor] || 0, + messageWidth + ); + } else if (msg.placement === diagObj.db.PLACEMENT.OVER) { + if (actor.prevActor) { + maxMessageWidthPerActor[actor.prevActor] = common_default.getMax( + maxMessageWidthPerActor[actor.prevActor] || 0, + messageWidth / 2 + ); + } + if (actor.nextActor) { + maxMessageWidthPerActor[msg.from] = common_default.getMax( + maxMessageWidthPerActor[msg.from] || 0, + messageWidth / 2 + ); + } + } + } + } + log.debug("maxMessageWidthPerActor:", maxMessageWidthPerActor); + return maxMessageWidthPerActor; + } + async function calculateActorMargins(actors2, actorToMessageWidth, boxes) { + let maxHeight = 0; + for (const prop of actors2.keys()) { + const actor = actors2.get(prop); + if (actor.wrap) { + actor.description = utils_default2.wrapLabel( + actor.description, + conf4.width - 2 * conf4.wrapPadding, + actorFont(conf4) + ); + } + const actDims = hasKatex(actor.description) ? await calculateMathMLDimensions(actor.description, getConfig2()) : utils_default2.calculateTextDimensions(actor.description, actorFont(conf4)); + actor.width = actor.wrap ? conf4.width : common_default.getMax(conf4.width, actDims.width + 2 * conf4.wrapPadding); + actor.height = actor.wrap ? common_default.getMax(actDims.height, conf4.height) : conf4.height; + maxHeight = common_default.getMax(maxHeight, actor.height); + } + for (const actorKey in actorToMessageWidth) { + const actor = actors2.get(actorKey); + if (!actor) { + continue; + } + const nextActor = actors2.get(actor.nextActor); + if (!nextActor) { + const messageWidth2 = actorToMessageWidth[actorKey]; + const actorWidth2 = messageWidth2 + conf4.actorMargin - actor.width / 2; + actor.margin = common_default.getMax(actorWidth2, conf4.actorMargin); + continue; + } + const messageWidth = actorToMessageWidth[actorKey]; + const actorWidth = messageWidth + conf4.actorMargin - actor.width / 2 - nextActor.width / 2; + actor.margin = common_default.getMax(actorWidth, conf4.actorMargin); + } + let maxBoxHeight = 0; + boxes.forEach((box) => { + const textFont = messageFont2(conf4); + let totalWidth = box.actorKeys.reduce((total, aKey) => { + return total += actors2.get(aKey).width + (actors2.get(aKey).margin || 0); + }, 0); + totalWidth -= 2 * conf4.boxTextMargin; + if (box.wrap) { + box.name = utils_default2.wrapLabel(box.name, totalWidth - 2 * conf4.wrapPadding, textFont); + } + const boxMsgDimensions = utils_default2.calculateTextDimensions(box.name, textFont); + maxBoxHeight = common_default.getMax(boxMsgDimensions.height, maxBoxHeight); + const minWidth = common_default.getMax(totalWidth, boxMsgDimensions.width + 2 * conf4.wrapPadding); + box.margin = conf4.boxTextMargin; + if (totalWidth < minWidth) { + const missing = (minWidth - totalWidth) / 2; + box.margin += missing; + } + }); + boxes.forEach((box) => box.textMaxHeight = maxBoxHeight); + return common_default.getMax(maxHeight, conf4.height); + } + var conf4, bounds, drawNote, messageFont2, noteFont, actorFont, drawMessage, addActorRenderingData, drawActors, drawActorsPopup, setConf4, actorActivations, activationBounds, draw11, getRequiredPopupWidth, buildNoteModel, buildMessageModel, calculateLoopBounds, sequenceRenderer_default; + var init_sequenceRenderer = __esm({ + "src/diagrams/sequence/sequenceRenderer.ts"() { + "use strict"; + init_src32(); + init_svgDraw2(); + init_logger(); + init_common(); + init_svgDrawCommon(); + init_diagramAPI(); + init_assignWithDepth(); + init_utils2(); + init_setupGraphViewbox(); + conf4 = {}; + bounds = { + data: { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0 + }, + verticalPos: 0, + sequenceItems: [], + activations: [], + models: { + getHeight: /* @__PURE__ */ __name(function() { + return Math.max.apply( + null, + this.actors.length === 0 ? [0] : this.actors.map((actor) => actor.height || 0) + ) + (this.loops.length === 0 ? 0 : this.loops.map((it) => it.height || 0).reduce((acc, h2) => acc + h2)) + (this.messages.length === 0 ? 0 : this.messages.map((it) => it.height || 0).reduce((acc, h2) => acc + h2)) + (this.notes.length === 0 ? 0 : this.notes.map((it) => it.height || 0).reduce((acc, h2) => acc + h2)); + }, "getHeight"), + clear: /* @__PURE__ */ __name(function() { + this.actors = []; + this.boxes = []; + this.loops = []; + this.messages = []; + this.notes = []; + }, "clear"), + addBox: /* @__PURE__ */ __name(function(boxModel) { + this.boxes.push(boxModel); + }, "addBox"), + addActor: /* @__PURE__ */ __name(function(actorModel) { + this.actors.push(actorModel); + }, "addActor"), + addLoop: /* @__PURE__ */ __name(function(loopModel) { + this.loops.push(loopModel); + }, "addLoop"), + addMessage: /* @__PURE__ */ __name(function(msgModel) { + this.messages.push(msgModel); + }, "addMessage"), + addNote: /* @__PURE__ */ __name(function(noteModel) { + this.notes.push(noteModel); + }, "addNote"), + lastActor: /* @__PURE__ */ __name(function() { + return this.actors[this.actors.length - 1]; + }, "lastActor"), + lastLoop: /* @__PURE__ */ __name(function() { + return this.loops[this.loops.length - 1]; + }, "lastLoop"), + lastMessage: /* @__PURE__ */ __name(function() { + return this.messages[this.messages.length - 1]; + }, "lastMessage"), + lastNote: /* @__PURE__ */ __name(function() { + return this.notes[this.notes.length - 1]; + }, "lastNote"), + actors: [], + boxes: [], + loops: [], + messages: [], + notes: [] + }, + init: /* @__PURE__ */ __name(function() { + this.sequenceItems = []; + this.activations = []; + this.models.clear(); + this.data = { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0 + }; + this.verticalPos = 0; + setConf4(getConfig2()); + }, "init"), + updateVal: /* @__PURE__ */ __name(function(obj, key, val, fun) { + if (obj[key] === void 0) { + obj[key] = val; + } else { + obj[key] = fun(val, obj[key]); + } + }, "updateVal"), + updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) { + const _self = this; + let cnt4 = 0; + function updateFn(type3) { + return /* @__PURE__ */ __name(function updateItemBounds(item) { + cnt4++; + const n2 = _self.sequenceItems.length - cnt4 + 1; + _self.updateVal(item, "starty", starty - n2 * conf4.boxMargin, Math.min); + _self.updateVal(item, "stopy", stopy + n2 * conf4.boxMargin, Math.max); + _self.updateVal(bounds.data, "startx", startx - n2 * conf4.boxMargin, Math.min); + _self.updateVal(bounds.data, "stopx", stopx + n2 * conf4.boxMargin, Math.max); + if (!(type3 === "activation")) { + _self.updateVal(item, "startx", startx - n2 * conf4.boxMargin, Math.min); + _self.updateVal(item, "stopx", stopx + n2 * conf4.boxMargin, Math.max); + _self.updateVal(bounds.data, "starty", starty - n2 * conf4.boxMargin, Math.min); + _self.updateVal(bounds.data, "stopy", stopy + n2 * conf4.boxMargin, Math.max); + } + }, "updateItemBounds"); + } + __name(updateFn, "updateFn"); + this.sequenceItems.forEach(updateFn()); + this.activations.forEach(updateFn("activation")); + }, "updateBounds"), + insert: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) { + const _startx = common_default.getMin(startx, stopx); + const _stopx = common_default.getMax(startx, stopx); + const _starty = common_default.getMin(starty, stopy); + const _stopy = common_default.getMax(starty, stopy); + this.updateVal(bounds.data, "startx", _startx, Math.min); + this.updateVal(bounds.data, "starty", _starty, Math.min); + this.updateVal(bounds.data, "stopx", _stopx, Math.max); + this.updateVal(bounds.data, "stopy", _stopy, Math.max); + this.updateBounds(_startx, _starty, _stopx, _stopy); + }, "insert"), + newActivation: /* @__PURE__ */ __name(function(message, diagram23, actors2) { + const actorRect = actors2.get(message.from); + const stackedSize = actorActivations(message.from).length || 0; + const x5 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf4.activationWidth / 2; + this.activations.push({ + startx: x5, + starty: this.verticalPos + 2, + stopx: x5 + conf4.activationWidth, + stopy: void 0, + actor: message.from, + anchored: svgDraw_default2.anchorElement(diagram23) + }); + }, "newActivation"), + endActivation: /* @__PURE__ */ __name(function(message) { + const lastActorActivationIdx = this.activations.map(function(activation) { + return activation.actor; + }).lastIndexOf(message.from); + return this.activations.splice(lastActorActivationIdx, 1)[0]; + }, "endActivation"), + createLoop: /* @__PURE__ */ __name(function(title2 = { message: void 0, wrap: false, width: void 0 }, fill) { + return { + startx: void 0, + starty: this.verticalPos, + stopx: void 0, + stopy: void 0, + title: title2.message, + wrap: title2.wrap, + width: title2.width, + height: 0, + fill + }; + }, "createLoop"), + newLoop: /* @__PURE__ */ __name(function(title2 = { message: void 0, wrap: false, width: void 0 }, fill) { + this.sequenceItems.push(this.createLoop(title2, fill)); + }, "newLoop"), + endLoop: /* @__PURE__ */ __name(function() { + return this.sequenceItems.pop(); + }, "endLoop"), + isLoopOverlap: /* @__PURE__ */ __name(function() { + return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : false; + }, "isLoopOverlap"), + addSectionToLoop: /* @__PURE__ */ __name(function(message) { + const loop = this.sequenceItems.pop(); + loop.sections = loop.sections || []; + loop.sectionTitles = loop.sectionTitles || []; + loop.sections.push({ y: bounds.getVerticalPos(), height: 0 }); + loop.sectionTitles.push(message); + this.sequenceItems.push(loop); + }, "addSectionToLoop"), + saveVerticalPos: /* @__PURE__ */ __name(function() { + if (this.isLoopOverlap()) { + this.savedVerticalPos = this.verticalPos; + } + }, "saveVerticalPos"), + resetVerticalPos: /* @__PURE__ */ __name(function() { + if (this.isLoopOverlap()) { + this.verticalPos = this.savedVerticalPos; + } + }, "resetVerticalPos"), + bumpVerticalPos: /* @__PURE__ */ __name(function(bump) { + this.verticalPos = this.verticalPos + bump; + this.data.stopy = common_default.getMax(this.data.stopy, this.verticalPos); + }, "bumpVerticalPos"), + getVerticalPos: /* @__PURE__ */ __name(function() { + return this.verticalPos; + }, "getVerticalPos"), + getBounds: /* @__PURE__ */ __name(function() { + return { bounds: this.data, models: this.models }; + }, "getBounds") + }; + drawNote = /* @__PURE__ */ __name(async function(elem, noteModel) { + bounds.bumpVerticalPos(conf4.boxMargin); + noteModel.height = conf4.boxMargin; + noteModel.starty = bounds.getVerticalPos(); + const rect4 = getNoteRect(); + rect4.x = noteModel.startx; + rect4.y = noteModel.starty; + rect4.width = noteModel.width || conf4.width; + rect4.class = "note"; + const g2 = elem.append("g"); + const rectElem = svgDraw_default2.drawRect(g2, rect4); + const textObj = getTextObj(); + textObj.x = noteModel.startx; + textObj.y = noteModel.starty; + textObj.width = rect4.width; + textObj.dy = "1em"; + textObj.text = noteModel.message; + textObj.class = "noteText"; + textObj.fontFamily = conf4.noteFontFamily; + textObj.fontSize = conf4.noteFontSize; + textObj.fontWeight = conf4.noteFontWeight; + textObj.anchor = conf4.noteAlign; + textObj.textMargin = conf4.noteMargin; + textObj.valign = "center"; + const textElem = hasKatex(textObj.text) ? await drawKatex(g2, textObj) : drawText3(g2, textObj); + const textHeight = Math.round( + textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr) + ); + rectElem.attr("height", textHeight + 2 * conf4.noteMargin); + noteModel.height += textHeight + 2 * conf4.noteMargin; + bounds.bumpVerticalPos(textHeight + 2 * conf4.noteMargin); + noteModel.stopy = noteModel.starty + textHeight + 2 * conf4.noteMargin; + noteModel.stopx = noteModel.startx + rect4.width; + bounds.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy); + bounds.models.addNote(noteModel); + }, "drawNote"); + messageFont2 = /* @__PURE__ */ __name((cnf) => { + return { + fontFamily: cnf.messageFontFamily, + fontSize: cnf.messageFontSize, + fontWeight: cnf.messageFontWeight + }; + }, "messageFont"); + noteFont = /* @__PURE__ */ __name((cnf) => { + return { + fontFamily: cnf.noteFontFamily, + fontSize: cnf.noteFontSize, + fontWeight: cnf.noteFontWeight + }; + }, "noteFont"); + actorFont = /* @__PURE__ */ __name((cnf) => { + return { + fontFamily: cnf.actorFontFamily, + fontSize: cnf.actorFontSize, + fontWeight: cnf.actorFontWeight + }; + }, "actorFont"); + __name(boundMessage, "boundMessage"); + drawMessage = /* @__PURE__ */ __name(async function(diagram23, msgModel, lineStartY, diagObj) { + const { startx, stopx, starty, message, type: type3, sequenceIndex, sequenceVisible } = msgModel; + const textDims = utils_default2.calculateTextDimensions(message, messageFont2(conf4)); + const textObj = getTextObj(); + textObj.x = startx; + textObj.y = starty + 10; + textObj.width = stopx - startx; + textObj.class = "messageText"; + textObj.dy = "1em"; + textObj.text = message; + textObj.fontFamily = conf4.messageFontFamily; + textObj.fontSize = conf4.messageFontSize; + textObj.fontWeight = conf4.messageFontWeight; + textObj.anchor = conf4.messageAlign; + textObj.valign = "center"; + textObj.textMargin = conf4.wrapPadding; + textObj.tspan = false; + if (hasKatex(textObj.text)) { + await drawKatex(diagram23, textObj, { startx, stopx, starty: lineStartY }); + } else { + drawText3(diagram23, textObj); + } + const textWidth = textDims.width; + let line2; + if (startx === stopx) { + if (conf4.rightAngles) { + line2 = diagram23.append("path").attr( + "d", + `M ${startx},${lineStartY} H ${startx + common_default.getMax(conf4.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}` + ); + } else { + line2 = diagram23.append("path").attr( + "d", + "M " + startx + "," + lineStartY + " C " + (startx + 60) + "," + (lineStartY - 10) + " " + (startx + 60) + "," + (lineStartY + 30) + " " + startx + "," + (lineStartY + 20) + ); + } + } else { + line2 = diagram23.append("line"); + line2.attr("x1", startx); + line2.attr("y1", lineStartY); + line2.attr("x2", stopx); + line2.attr("y2", lineStartY); + } + if (type3 === diagObj.db.LINETYPE.DOTTED || type3 === diagObj.db.LINETYPE.DOTTED_CROSS || type3 === diagObj.db.LINETYPE.DOTTED_POINT || type3 === diagObj.db.LINETYPE.DOTTED_OPEN || type3 === diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED) { + line2.style("stroke-dasharray", "3, 3"); + line2.attr("class", "messageLine1"); + } else { + line2.attr("class", "messageLine0"); + } + let url = ""; + if (conf4.arrowMarkerAbsolute) { + url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, "\\("); + url = url.replace(/\)/g, "\\)"); + } + line2.attr("stroke-width", 2); + line2.attr("stroke", "none"); + line2.style("fill", "none"); + if (type3 === diagObj.db.LINETYPE.SOLID || type3 === diagObj.db.LINETYPE.DOTTED) { + line2.attr("marker-end", "url(" + url + "#arrowhead)"); + } + if (type3 === diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID || type3 === diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED) { + line2.attr("marker-start", "url(" + url + "#arrowhead)"); + line2.attr("marker-end", "url(" + url + "#arrowhead)"); + } + if (type3 === diagObj.db.LINETYPE.SOLID_POINT || type3 === diagObj.db.LINETYPE.DOTTED_POINT) { + line2.attr("marker-end", "url(" + url + "#filled-head)"); + } + if (type3 === diagObj.db.LINETYPE.SOLID_CROSS || type3 === diagObj.db.LINETYPE.DOTTED_CROSS) { + line2.attr("marker-end", "url(" + url + "#crosshead)"); + } + if (sequenceVisible || conf4.showSequenceNumbers) { + line2.attr("marker-start", "url(" + url + "#sequencenumber)"); + diagram23.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex); + } + }, "drawMessage"); + addActorRenderingData = /* @__PURE__ */ __name(function(diagram23, actors2, createdActors, actorKeys, verticalPos, messages, isFooter) { + let prevWidth = 0; + let prevMargin = 0; + let prevBox = void 0; + let maxHeight = 0; + for (const actorKey of actorKeys) { + const actor = actors2.get(actorKey); + const box = actor.box; + if (prevBox && prevBox != box) { + if (!isFooter) { + bounds.models.addBox(prevBox); + } + prevMargin += conf4.boxMargin + prevBox.margin; + } + if (box && box != prevBox) { + if (!isFooter) { + box.x = prevWidth + prevMargin; + box.y = verticalPos; + } + prevMargin += box.margin; + } + actor.width = actor.width || conf4.width; + actor.height = common_default.getMax(actor.height || conf4.height, conf4.height); + actor.margin = actor.margin || conf4.actorMargin; + maxHeight = common_default.getMax(maxHeight, actor.height); + if (createdActors.get(actor.name)) { + prevMargin += actor.width / 2; + } + actor.x = prevWidth + prevMargin; + actor.starty = bounds.getVerticalPos(); + bounds.insert(actor.x, verticalPos, actor.x + actor.width, actor.height); + prevWidth += actor.width + prevMargin; + if (actor.box) { + actor.box.width = prevWidth + box.margin - actor.box.x; + } + prevMargin = actor.margin; + prevBox = actor.box; + bounds.models.addActor(actor); + } + if (prevBox && !isFooter) { + bounds.models.addBox(prevBox); + } + bounds.bumpVerticalPos(maxHeight); + }, "addActorRenderingData"); + drawActors = /* @__PURE__ */ __name(async function(diagram23, actors2, actorKeys, isFooter) { + if (!isFooter) { + for (const actorKey of actorKeys) { + const actor = actors2.get(actorKey); + await svgDraw_default2.drawActor(diagram23, actor, conf4, false); + } + } else { + let maxHeight = 0; + bounds.bumpVerticalPos(conf4.boxMargin * 2); + for (const actorKey of actorKeys) { + const actor = actors2.get(actorKey); + if (!actor.stopy) { + actor.stopy = bounds.getVerticalPos(); + } + const height2 = await svgDraw_default2.drawActor(diagram23, actor, conf4, true); + maxHeight = common_default.getMax(maxHeight, height2); + } + bounds.bumpVerticalPos(maxHeight + conf4.boxMargin); + } + }, "drawActors"); + drawActorsPopup = /* @__PURE__ */ __name(function(diagram23, actors2, actorKeys, doc) { + let maxHeight = 0; + let maxWidth = 0; + for (const actorKey of actorKeys) { + const actor = actors2.get(actorKey); + const minMenuWidth = getRequiredPopupWidth(actor); + const menuDimensions = svgDraw_default2.drawPopup( + diagram23, + actor, + minMenuWidth, + conf4, + conf4.forceMenus, + doc + ); + if (menuDimensions.height > maxHeight) { + maxHeight = menuDimensions.height; + } + if (menuDimensions.width + actor.x > maxWidth) { + maxWidth = menuDimensions.width + actor.x; + } + } + return { maxHeight, maxWidth }; + }, "drawActorsPopup"); + setConf4 = /* @__PURE__ */ __name(function(cnf) { + assignWithDepth_default(conf4, cnf); + if (cnf.fontFamily) { + conf4.actorFontFamily = conf4.noteFontFamily = conf4.messageFontFamily = cnf.fontFamily; + } + if (cnf.fontSize) { + conf4.actorFontSize = conf4.noteFontSize = conf4.messageFontSize = cnf.fontSize; + } + if (cnf.fontWeight) { + conf4.actorFontWeight = conf4.noteFontWeight = conf4.messageFontWeight = cnf.fontWeight; + } + }, "setConf"); + actorActivations = /* @__PURE__ */ __name(function(actor) { + return bounds.activations.filter(function(activation) { + return activation.actor === actor; + }); + }, "actorActivations"); + activationBounds = /* @__PURE__ */ __name(function(actor, actors2) { + const actorObj = actors2.get(actor); + const activations = actorActivations(actor); + const left3 = activations.reduce( + function(acc, activation) { + return common_default.getMin(acc, activation.startx); + }, + actorObj.x + actorObj.width / 2 - 1 + ); + const right3 = activations.reduce( + function(acc, activation) { + return common_default.getMax(acc, activation.stopx); + }, + actorObj.x + actorObj.width / 2 + 1 + ); + return [left3, right3]; + }, "activationBounds"); + __name(adjustLoopHeightForWrap, "adjustLoopHeightForWrap"); + __name(adjustCreatedDestroyedData, "adjustCreatedDestroyedData"); + draw11 = /* @__PURE__ */ __name(async function(_text, id26, _version, diagObj) { + const { securityLevel, sequence } = getConfig2(); + conf4 = sequence; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; + bounds.init(); + log.debug(diagObj.db); + const diagram23 = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); + const actors2 = diagObj.db.getActors(); + const createdActors = diagObj.db.getCreatedActors(); + const destroyedActors = diagObj.db.getDestroyedActors(); + const boxes = diagObj.db.getBoxes(); + let actorKeys = diagObj.db.getActorKeys(); + const messages = diagObj.db.getMessages(); + const title2 = diagObj.db.getDiagramTitle(); + const hasBoxes = diagObj.db.hasAtLeastOneBox(); + const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle(); + const maxMessageWidthPerActor = await getMaxMessageWidthPerActor(actors2, messages, diagObj); + conf4.height = await calculateActorMargins(actors2, maxMessageWidthPerActor, boxes); + svgDraw_default2.insertComputerIcon(diagram23); + svgDraw_default2.insertDatabaseIcon(diagram23); + svgDraw_default2.insertClockIcon(diagram23); + if (hasBoxes) { + bounds.bumpVerticalPos(conf4.boxMargin); + if (hasBoxTitles) { + bounds.bumpVerticalPos(boxes[0].textMaxHeight); + } + } + if (conf4.hideUnusedParticipants === true) { + const newActors = /* @__PURE__ */ new Set(); + messages.forEach((message) => { + newActors.add(message.from); + newActors.add(message.to); + }); + actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey)); + } + addActorRenderingData(diagram23, actors2, createdActors, actorKeys, 0, messages, false); + const loopWidths = await calculateLoopBounds(messages, actors2, maxMessageWidthPerActor, diagObj); + svgDraw_default2.insertArrowHead(diagram23); + svgDraw_default2.insertArrowCrossHead(diagram23); + svgDraw_default2.insertArrowFilledHead(diagram23); + svgDraw_default2.insertSequenceNumber(diagram23); + function activeEnd(msg, verticalPos) { + const activationData = bounds.endActivation(msg); + if (activationData.starty + 18 > verticalPos) { + activationData.starty = verticalPos - 6; + verticalPos += 12; + } + svgDraw_default2.drawActivation( + diagram23, + activationData, + verticalPos, + conf4, + actorActivations(msg.from).length + ); + bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); + } + __name(activeEnd, "activeEnd"); + let sequenceIndex = 1; + let sequenceIndexStep = 1; + const messagesToDraw = []; + const backgrounds = []; + let index = 0; + for (const msg of messages) { + let loopModel, noteModel, msgModel; + switch (msg.type) { + case diagObj.db.LINETYPE.NOTE: + bounds.resetVerticalPos(); + noteModel = msg.noteModel; + await drawNote(diagram23, noteModel); + break; + case diagObj.db.LINETYPE.ACTIVE_START: + bounds.newActivation(msg, diagram23, actors2); + break; + case diagObj.db.LINETYPE.ACTIVE_END: + activeEnd(msg, bounds.getVerticalPos()); + break; + case diagObj.db.LINETYPE.LOOP_START: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin, + conf4.boxMargin + conf4.boxTextMargin, + (message) => bounds.newLoop(message) + ); + break; + case diagObj.db.LINETYPE.LOOP_END: + loopModel = bounds.endLoop(); + await svgDraw_default2.drawLoop(diagram23, loopModel, "loop", conf4); + bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); + bounds.models.addLoop(loopModel); + break; + case diagObj.db.LINETYPE.RECT_START: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin, + conf4.boxMargin, + (message) => bounds.newLoop(void 0, message.message) + ); + break; + case diagObj.db.LINETYPE.RECT_END: + loopModel = bounds.endLoop(); + backgrounds.push(loopModel); + bounds.models.addLoop(loopModel); + bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); + break; + case diagObj.db.LINETYPE.OPT_START: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin, + conf4.boxMargin + conf4.boxTextMargin, + (message) => bounds.newLoop(message) + ); + break; + case diagObj.db.LINETYPE.OPT_END: + loopModel = bounds.endLoop(); + await svgDraw_default2.drawLoop(diagram23, loopModel, "opt", conf4); + bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); + bounds.models.addLoop(loopModel); + break; + case diagObj.db.LINETYPE.ALT_START: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin, + conf4.boxMargin + conf4.boxTextMargin, + (message) => bounds.newLoop(message) + ); + break; + case diagObj.db.LINETYPE.ALT_ELSE: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin + conf4.boxTextMargin, + conf4.boxMargin, + (message) => bounds.addSectionToLoop(message) + ); + break; + case diagObj.db.LINETYPE.ALT_END: + loopModel = bounds.endLoop(); + await svgDraw_default2.drawLoop(diagram23, loopModel, "alt", conf4); + bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); + bounds.models.addLoop(loopModel); + break; + case diagObj.db.LINETYPE.PAR_START: + case diagObj.db.LINETYPE.PAR_OVER_START: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin, + conf4.boxMargin + conf4.boxTextMargin, + (message) => bounds.newLoop(message) + ); + bounds.saveVerticalPos(); + break; + case diagObj.db.LINETYPE.PAR_AND: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin + conf4.boxTextMargin, + conf4.boxMargin, + (message) => bounds.addSectionToLoop(message) + ); + break; + case diagObj.db.LINETYPE.PAR_END: + loopModel = bounds.endLoop(); + await svgDraw_default2.drawLoop(diagram23, loopModel, "par", conf4); + bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); + bounds.models.addLoop(loopModel); + break; + case diagObj.db.LINETYPE.AUTONUMBER: + sequenceIndex = msg.message.start || sequenceIndex; + sequenceIndexStep = msg.message.step || sequenceIndexStep; + if (msg.message.visible) { + diagObj.db.enableSequenceNumbers(); + } else { + diagObj.db.disableSequenceNumbers(); + } + break; + case diagObj.db.LINETYPE.CRITICAL_START: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin, + conf4.boxMargin + conf4.boxTextMargin, + (message) => bounds.newLoop(message) + ); + break; + case diagObj.db.LINETYPE.CRITICAL_OPTION: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin + conf4.boxTextMargin, + conf4.boxMargin, + (message) => bounds.addSectionToLoop(message) + ); + break; + case diagObj.db.LINETYPE.CRITICAL_END: + loopModel = bounds.endLoop(); + await svgDraw_default2.drawLoop(diagram23, loopModel, "critical", conf4); + bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); + bounds.models.addLoop(loopModel); + break; + case diagObj.db.LINETYPE.BREAK_START: + adjustLoopHeightForWrap( + loopWidths, + msg, + conf4.boxMargin, + conf4.boxMargin + conf4.boxTextMargin, + (message) => bounds.newLoop(message) + ); + break; + case diagObj.db.LINETYPE.BREAK_END: + loopModel = bounds.endLoop(); + await svgDraw_default2.drawLoop(diagram23, loopModel, "break", conf4); + bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); + bounds.models.addLoop(loopModel); + break; + default: + try { + msgModel = msg.msgModel; + msgModel.starty = bounds.getVerticalPos(); + msgModel.sequenceIndex = sequenceIndex; + msgModel.sequenceVisible = diagObj.db.showSequenceNumbers(); + const lineStartY = await boundMessage(diagram23, msgModel); + adjustCreatedDestroyedData( + msg, + msgModel, + lineStartY, + index, + actors2, + createdActors, + destroyedActors + ); + messagesToDraw.push({ messageModel: msgModel, lineStartY }); + bounds.models.addMessage(msgModel); + } catch (e3) { + log.error("error while drawing message", e3); + } + } + if ([ + diagObj.db.LINETYPE.SOLID_OPEN, + diagObj.db.LINETYPE.DOTTED_OPEN, + diagObj.db.LINETYPE.SOLID, + diagObj.db.LINETYPE.DOTTED, + diagObj.db.LINETYPE.SOLID_CROSS, + diagObj.db.LINETYPE.DOTTED_CROSS, + diagObj.db.LINETYPE.SOLID_POINT, + diagObj.db.LINETYPE.DOTTED_POINT, + diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID, + diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED + ].includes(msg.type)) { + sequenceIndex = sequenceIndex + sequenceIndexStep; + } + index++; + } + log.debug("createdActors", createdActors); + log.debug("destroyedActors", destroyedActors); + await drawActors(diagram23, actors2, actorKeys, false); + for (const e3 of messagesToDraw) { + await drawMessage(diagram23, e3.messageModel, e3.lineStartY, diagObj); + } + if (conf4.mirrorActors) { + await drawActors(diagram23, actors2, actorKeys, true); + } + backgrounds.forEach((e3) => svgDraw_default2.drawBackgroundRect(diagram23, e3)); + fixLifeLineHeights(diagram23, actors2, actorKeys, conf4); + for (const box2 of bounds.models.boxes) { + box2.height = bounds.getVerticalPos() - box2.y; + bounds.insert(box2.x, box2.y, box2.x + box2.width, box2.height); + box2.startx = box2.x; + box2.starty = box2.y; + box2.stopx = box2.startx + box2.width; + box2.stopy = box2.starty + box2.height; + box2.stroke = "rgb(0,0,0, 0.5)"; + svgDraw_default2.drawBox(diagram23, box2, conf4); + } + if (hasBoxes) { + bounds.bumpVerticalPos(conf4.boxMargin); + } + const requiredBoxSize = drawActorsPopup(diagram23, actors2, actorKeys, doc); + const { bounds: box } = bounds.getBounds(); + if (box.startx === void 0) { + box.startx = 0; + } + if (box.starty === void 0) { + box.starty = 0; + } + if (box.stopx === void 0) { + box.stopx = 0; + } + if (box.stopy === void 0) { + box.stopy = 0; + } + let boxHeight = box.stopy - box.starty; + if (boxHeight < requiredBoxSize.maxHeight) { + boxHeight = requiredBoxSize.maxHeight; + } + let height2 = boxHeight + 2 * conf4.diagramMarginY; + if (conf4.mirrorActors) { + height2 = height2 - conf4.boxMargin + conf4.bottomMarginAdj; + } + let boxWidth = box.stopx - box.startx; + if (boxWidth < requiredBoxSize.maxWidth) { + boxWidth = requiredBoxSize.maxWidth; + } + const width3 = boxWidth + 2 * conf4.diagramMarginX; + if (title2) { + diagram23.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf4.diagramMarginX).attr("y", -25); + } + configureSvgSize(diagram23, height2, width3, conf4.useMaxWidth); + const extraVertForTitle = title2 ? 40 : 0; + diagram23.attr( + "viewBox", + box.startx - conf4.diagramMarginX + " -" + (conf4.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle) + ); + log.debug(`models:`, bounds.models); + }, "draw"); + __name(getMaxMessageWidthPerActor, "getMaxMessageWidthPerActor"); + getRequiredPopupWidth = /* @__PURE__ */ __name(function(actor) { + let requiredPopupWidth = 0; + const textFont = actorFont(conf4); + for (const key in actor.links) { + const labelDimensions = utils_default2.calculateTextDimensions(key, textFont); + const labelWidth = labelDimensions.width + 2 * conf4.wrapPadding + 2 * conf4.boxMargin; + if (requiredPopupWidth < labelWidth) { + requiredPopupWidth = labelWidth; + } + } + return requiredPopupWidth; + }, "getRequiredPopupWidth"); + __name(calculateActorMargins, "calculateActorMargins"); + buildNoteModel = /* @__PURE__ */ __name(async function(msg, actors2, diagObj) { + const fromActor = actors2.get(msg.from); + const toActor = actors2.get(msg.to); + const startx = fromActor.x; + const stopx = toActor.x; + const shouldWrap = msg.wrap && msg.message; + let textDimensions = hasKatex(msg.message) ? await calculateMathMLDimensions(msg.message, getConfig2()) : utils_default2.calculateTextDimensions( + shouldWrap ? utils_default2.wrapLabel(msg.message, conf4.width, noteFont(conf4)) : msg.message, + noteFont(conf4) + ); + const noteModel = { + width: shouldWrap ? conf4.width : common_default.getMax(conf4.width, textDimensions.width + 2 * conf4.noteMargin), + height: 0, + startx: fromActor.x, + stopx: 0, + starty: 0, + stopy: 0, + message: msg.message + }; + if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) { + noteModel.width = shouldWrap ? common_default.getMax(conf4.width, textDimensions.width) : common_default.getMax( + fromActor.width / 2 + toActor.width / 2, + textDimensions.width + 2 * conf4.noteMargin + ); + noteModel.startx = startx + (fromActor.width + conf4.actorMargin) / 2; + } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) { + noteModel.width = shouldWrap ? common_default.getMax(conf4.width, textDimensions.width + 2 * conf4.noteMargin) : common_default.getMax( + fromActor.width / 2 + toActor.width / 2, + textDimensions.width + 2 * conf4.noteMargin + ); + noteModel.startx = startx - noteModel.width + (fromActor.width - conf4.actorMargin) / 2; + } else if (msg.to === msg.from) { + textDimensions = utils_default2.calculateTextDimensions( + shouldWrap ? utils_default2.wrapLabel(msg.message, common_default.getMax(conf4.width, fromActor.width), noteFont(conf4)) : msg.message, + noteFont(conf4) + ); + noteModel.width = shouldWrap ? common_default.getMax(conf4.width, fromActor.width) : common_default.getMax(fromActor.width, conf4.width, textDimensions.width + 2 * conf4.noteMargin); + noteModel.startx = startx + (fromActor.width - noteModel.width) / 2; + } else { + noteModel.width = Math.abs(startx + fromActor.width / 2 - (stopx + toActor.width / 2)) + conf4.actorMargin; + noteModel.startx = startx < stopx ? startx + fromActor.width / 2 - conf4.actorMargin / 2 : stopx + toActor.width / 2 - conf4.actorMargin / 2; + } + if (shouldWrap) { + noteModel.message = utils_default2.wrapLabel( + msg.message, + noteModel.width - 2 * conf4.wrapPadding, + noteFont(conf4) + ); + } + log.debug( + `NM:[${noteModel.startx},${noteModel.stopx},${noteModel.starty},${noteModel.stopy}:${noteModel.width},${noteModel.height}=${msg.message}]` + ); + return noteModel; + }, "buildNoteModel"); + buildMessageModel = /* @__PURE__ */ __name(function(msg, actors2, diagObj) { + if (![ + diagObj.db.LINETYPE.SOLID_OPEN, + diagObj.db.LINETYPE.DOTTED_OPEN, + diagObj.db.LINETYPE.SOLID, + diagObj.db.LINETYPE.DOTTED, + diagObj.db.LINETYPE.SOLID_CROSS, + diagObj.db.LINETYPE.DOTTED_CROSS, + diagObj.db.LINETYPE.SOLID_POINT, + diagObj.db.LINETYPE.DOTTED_POINT, + diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID, + diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED + ].includes(msg.type)) { + return {}; + } + const [fromLeft, fromRight] = activationBounds(msg.from, actors2); + const [toLeft, toRight] = activationBounds(msg.to, actors2); + const isArrowToRight = fromLeft <= toLeft; + let startx = isArrowToRight ? fromRight : fromLeft; + let stopx = isArrowToRight ? toLeft : toRight; + const isArrowToActivation = Math.abs(toLeft - toRight) > 2; + const adjustValue = /* @__PURE__ */ __name((value2) => { + return isArrowToRight ? -value2 : value2; + }, "adjustValue"); + if (msg.from === msg.to) { + stopx = startx; + } else { + if (msg.activate && !isArrowToActivation) { + stopx += adjustValue(conf4.activationWidth / 2 - 1); + } + if (![diagObj.db.LINETYPE.SOLID_OPEN, diagObj.db.LINETYPE.DOTTED_OPEN].includes(msg.type)) { + stopx += adjustValue(3); + } + if ([diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID, diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes( + msg.type + )) { + startx -= adjustValue(3); + } + } + const allBounds = [fromLeft, fromRight, toLeft, toRight]; + const boundedWidth = Math.abs(startx - stopx); + if (msg.wrap && msg.message) { + msg.message = utils_default2.wrapLabel( + msg.message, + common_default.getMax(boundedWidth + 2 * conf4.wrapPadding, conf4.width), + messageFont2(conf4) + ); + } + const msgDims = utils_default2.calculateTextDimensions(msg.message, messageFont2(conf4)); + return { + width: common_default.getMax( + msg.wrap ? 0 : msgDims.width + 2 * conf4.wrapPadding, + boundedWidth + 2 * conf4.wrapPadding, + conf4.width + ), + height: 0, + startx, + stopx, + starty: 0, + stopy: 0, + message: msg.message, + type: msg.type, + wrap: msg.wrap, + fromBounds: Math.min.apply(null, allBounds), + toBounds: Math.max.apply(null, allBounds) + }; + }, "buildMessageModel"); + calculateLoopBounds = /* @__PURE__ */ __name(async function(messages, actors2, _maxWidthPerActor, diagObj) { + const loops = {}; + const stack = []; + let current, noteModel, msgModel; + for (const msg of messages) { + msg.id = utils_default2.random({ length: 10 }); + switch (msg.type) { + case diagObj.db.LINETYPE.LOOP_START: + case diagObj.db.LINETYPE.ALT_START: + case diagObj.db.LINETYPE.OPT_START: + case diagObj.db.LINETYPE.PAR_START: + case diagObj.db.LINETYPE.PAR_OVER_START: + case diagObj.db.LINETYPE.CRITICAL_START: + case diagObj.db.LINETYPE.BREAK_START: + stack.push({ + id: msg.id, + msg: msg.message, + from: Number.MAX_SAFE_INTEGER, + to: Number.MIN_SAFE_INTEGER, + width: 0 + }); + break; + case diagObj.db.LINETYPE.ALT_ELSE: + case diagObj.db.LINETYPE.PAR_AND: + case diagObj.db.LINETYPE.CRITICAL_OPTION: + if (msg.message) { + current = stack.pop(); + loops[current.id] = current; + loops[msg.id] = current; + stack.push(current); + } + break; + case diagObj.db.LINETYPE.LOOP_END: + case diagObj.db.LINETYPE.ALT_END: + case diagObj.db.LINETYPE.OPT_END: + case diagObj.db.LINETYPE.PAR_END: + case diagObj.db.LINETYPE.CRITICAL_END: + case diagObj.db.LINETYPE.BREAK_END: + current = stack.pop(); + loops[current.id] = current; + break; + case diagObj.db.LINETYPE.ACTIVE_START: + { + const actorRect = actors2.get(msg.from ? msg.from : msg.to.actor); + const stackedSize = actorActivations(msg.from ? msg.from : msg.to.actor).length; + const x5 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf4.activationWidth / 2; + const toAdd = { + startx: x5, + stopx: x5 + conf4.activationWidth, + actor: msg.from, + enabled: true + }; + bounds.activations.push(toAdd); + } + break; + case diagObj.db.LINETYPE.ACTIVE_END: + { + const lastActorActivationIdx = bounds.activations.map((a2) => a2.actor).lastIndexOf(msg.from); + bounds.activations.splice(lastActorActivationIdx, 1).splice(0, 1); + } + break; + } + const isNote = msg.placement !== void 0; + if (isNote) { + noteModel = await buildNoteModel(msg, actors2, diagObj); + msg.noteModel = noteModel; + stack.forEach((stk) => { + current = stk; + current.from = common_default.getMin(current.from, noteModel.startx); + current.to = common_default.getMax(current.to, noteModel.startx + noteModel.width); + current.width = common_default.getMax(current.width, Math.abs(current.from - current.to)) - conf4.labelBoxWidth; + }); + } else { + msgModel = buildMessageModel(msg, actors2, diagObj); + msg.msgModel = msgModel; + if (msgModel.startx && msgModel.stopx && stack.length > 0) { + stack.forEach((stk) => { + current = stk; + if (msgModel.startx === msgModel.stopx) { + const from2 = actors2.get(msg.from); + const to = actors2.get(msg.to); + current.from = common_default.getMin( + from2.x - msgModel.width / 2, + from2.x - from2.width / 2, + current.from + ); + current.to = common_default.getMax( + to.x + msgModel.width / 2, + to.x + from2.width / 2, + current.to + ); + current.width = common_default.getMax(current.width, Math.abs(current.to - current.from)) - conf4.labelBoxWidth; + } else { + current.from = common_default.getMin(msgModel.startx, current.from); + current.to = common_default.getMax(msgModel.stopx, current.to); + current.width = common_default.getMax(current.width, msgModel.width) - conf4.labelBoxWidth; + } + }); } - function rpb() { - throw Adb(new jib()); + } + } + bounds.activations = []; + log.debug("Loop type widths:", loops); + return loops; + }, "calculateLoopBounds"); + sequenceRenderer_default = { + bounds, + drawActors, + drawActorsPopup, + setConf: setConf4, + draw: draw11 + }; + } + }); + + // src/diagrams/sequence/sequenceDiagram.ts + var sequenceDiagram_exports = {}; + __export(sequenceDiagram_exports, { + diagram: () => diagram11 + }); + var diagram11; + var init_sequenceDiagram2 = __esm({ + "src/diagrams/sequence/sequenceDiagram.ts"() { + "use strict"; + init_sequenceDiagram(); + init_sequenceDb(); + init_styles8(); + init_sequenceRenderer(); + diagram11 = { + parser: sequenceDiagram_default, + db: sequenceDb_default, + renderer: sequenceRenderer_default, + styles: styles_default8, + init: /* @__PURE__ */ __name(({ wrap: wrap3 }) => { + sequenceDb_default.setWrap(wrap3); + }, "init") + }; + } + }); + + // src/diagrams/class/parser/classDiagram.jison + var parser13, classDiagram_default; + var init_classDiagram = __esm({ + "src/diagrams/class/parser/classDiagram.jison"() { + "use strict"; + parser13 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 17], $V1 = [1, 18], $V2 = [1, 19], $V3 = [1, 39], $V4 = [1, 40], $V5 = [1, 25], $V6 = [1, 23], $V7 = [1, 24], $V8 = [1, 31], $V9 = [1, 32], $Va = [1, 33], $Vb = [1, 34], $Vc = [1, 35], $Vd = [1, 36], $Ve = [1, 26], $Vf = [1, 27], $Vg = [1, 28], $Vh = [1, 29], $Vi = [1, 43], $Vj = [1, 30], $Vk = [1, 42], $Vl = [1, 44], $Vm = [1, 41], $Vn = [1, 45], $Vo = [1, 9], $Vp = [1, 8, 9], $Vq = [1, 56], $Vr = [1, 57], $Vs = [1, 58], $Vt = [1, 59], $Vu = [1, 60], $Vv = [1, 61], $Vw = [1, 62], $Vx = [1, 8, 9, 39], $Vy = [1, 74], $Vz = [1, 8, 9, 12, 13, 21, 37, 39, 42, 59, 60, 61, 62, 63, 64, 65, 70, 72], $VA = [1, 8, 9, 12, 13, 19, 21, 37, 39, 42, 46, 59, 60, 61, 62, 63, 64, 65, 70, 72, 74, 80, 95, 97, 98], $VB = [13, 74, 80, 95, 97, 98], $VC = [13, 64, 65, 74, 80, 95, 97, 98], $VD = [13, 59, 60, 61, 62, 63, 74, 80, 95, 97, 98], $VE = [1, 93], $VF = [1, 110], $VG = [1, 108], $VH = [1, 102], $VI = [1, 103], $VJ = [1, 104], $VK = [1, 105], $VL = [1, 106], $VM = [1, 107], $VN = [1, 109], $VO = [1, 8, 9, 37, 39, 42], $VP = [1, 8, 9, 21], $VQ = [1, 8, 9, 78], $VR = [1, 8, 9, 21, 73, 74, 78, 80, 81, 82, 83, 84, 85]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "statements": 5, "graphConfig": 6, "CLASS_DIAGRAM": 7, "NEWLINE": 8, "EOF": 9, "statement": 10, "classLabel": 11, "SQS": 12, "STR": 13, "SQE": 14, "namespaceName": 15, "alphaNumToken": 16, "className": 17, "classLiteralName": 18, "GENERICTYPE": 19, "relationStatement": 20, "LABEL": 21, "namespaceStatement": 22, "classStatement": 23, "memberStatement": 24, "annotationStatement": 25, "clickStatement": 26, "styleStatement": 27, "cssClassStatement": 28, "noteStatement": 29, "direction": 30, "acc_title": 31, "acc_title_value": 32, "acc_descr": 33, "acc_descr_value": 34, "acc_descr_multiline_value": 35, "namespaceIdentifier": 36, "STRUCT_START": 37, "classStatements": 38, "STRUCT_STOP": 39, "NAMESPACE": 40, "classIdentifier": 41, "STYLE_SEPARATOR": 42, "members": 43, "CLASS": 44, "ANNOTATION_START": 45, "ANNOTATION_END": 46, "MEMBER": 47, "SEPARATOR": 48, "relation": 49, "NOTE_FOR": 50, "noteText": 51, "NOTE": 52, "direction_tb": 53, "direction_bt": 54, "direction_rl": 55, "direction_lr": 56, "relationType": 57, "lineType": 58, "AGGREGATION": 59, "EXTENSION": 60, "COMPOSITION": 61, "DEPENDENCY": 62, "LOLLIPOP": 63, "LINE": 64, "DOTTED_LINE": 65, "CALLBACK": 66, "LINK": 67, "LINK_TARGET": 68, "CLICK": 69, "CALLBACK_NAME": 70, "CALLBACK_ARGS": 71, "HREF": 72, "STYLE": 73, "ALPHA": 74, "stylesOpt": 75, "CSSCLASS": 76, "style": 77, "COMMA": 78, "styleComponent": 79, "NUM": 80, "COLON": 81, "UNIT": 82, "SPACE": 83, "BRKT": 84, "PCT": 85, "commentToken": 86, "textToken": 87, "graphCodeTokens": 88, "textNoTagsToken": 89, "TAGSTART": 90, "TAGEND": 91, "==": 92, "--": 93, "DEFAULT": 94, "MINUS": 95, "keywords": 96, "UNICODE_TEXT": 97, "BQUOTE_STR": 98, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 7: "CLASS_DIAGRAM", 8: "NEWLINE", 9: "EOF", 12: "SQS", 13: "STR", 14: "SQE", 19: "GENERICTYPE", 21: "LABEL", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 37: "STRUCT_START", 39: "STRUCT_STOP", 40: "NAMESPACE", 42: "STYLE_SEPARATOR", 44: "CLASS", 45: "ANNOTATION_START", 46: "ANNOTATION_END", 47: "MEMBER", 48: "SEPARATOR", 50: "NOTE_FOR", 52: "NOTE", 53: "direction_tb", 54: "direction_bt", 55: "direction_rl", 56: "direction_lr", 59: "AGGREGATION", 60: "EXTENSION", 61: "COMPOSITION", 62: "DEPENDENCY", 63: "LOLLIPOP", 64: "LINE", 65: "DOTTED_LINE", 66: "CALLBACK", 67: "LINK", 68: "LINK_TARGET", 69: "CLICK", 70: "CALLBACK_NAME", 71: "CALLBACK_ARGS", 72: "HREF", 73: "STYLE", 74: "ALPHA", 76: "CSSCLASS", 78: "COMMA", 80: "NUM", 81: "COLON", 82: "UNIT", 83: "SPACE", 84: "BRKT", 85: "PCT", 88: "graphCodeTokens", 90: "TAGSTART", 91: "TAGEND", 92: "==", 93: "--", 94: "DEFAULT", 95: "MINUS", 96: "keywords", 97: "UNICODE_TEXT", 98: "BQUOTE_STR" }, + productions_: [0, [3, 1], [3, 1], [4, 1], [6, 4], [5, 1], [5, 2], [5, 3], [11, 3], [15, 1], [15, 2], [17, 1], [17, 1], [17, 2], [17, 2], [17, 2], [10, 1], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [22, 4], [22, 5], [36, 2], [38, 1], [38, 2], [38, 3], [23, 1], [23, 3], [23, 4], [23, 6], [41, 2], [41, 3], [25, 4], [43, 1], [43, 2], [24, 1], [24, 2], [24, 1], [24, 1], [20, 3], [20, 4], [20, 4], [20, 5], [29, 3], [29, 2], [30, 1], [30, 1], [30, 1], [30, 1], [49, 3], [49, 2], [49, 2], [49, 1], [57, 1], [57, 1], [57, 1], [57, 1], [57, 1], [58, 1], [58, 1], [26, 3], [26, 4], [26, 3], [26, 4], [26, 4], [26, 5], [26, 3], [26, 4], [26, 4], [26, 5], [26, 4], [26, 5], [26, 5], [26, 6], [27, 3], [28, 3], [75, 1], [75, 3], [77, 1], [77, 2], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [86, 1], [86, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [87, 1], [89, 1], [89, 1], [89, 1], [89, 1], [16, 1], [16, 1], [16, 1], [16, 1], [18, 1], [51, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 8: + this.$ = $$[$0 - 1]; + break; + case 9: + case 11: + case 12: + this.$ = $$[$0]; + break; + case 10: + case 13: + this.$ = $$[$0 - 1] + $$[$0]; + break; + case 14: + case 15: + this.$ = $$[$0 - 1] + "~" + $$[$0] + "~"; + break; + case 16: + yy.addRelation($$[$0]); + break; + case 17: + $$[$0 - 1].title = yy.cleanupLabel($$[$0]); + yy.addRelation($$[$0 - 1]); + break; + case 27: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 28: + case 29: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 30: + yy.addClassesToNamespace($$[$0 - 3], $$[$0 - 1]); + break; + case 31: + yy.addClassesToNamespace($$[$0 - 4], $$[$0 - 1]); + break; + case 32: + this.$ = $$[$0]; + yy.addNamespace($$[$0]); + break; + case 33: + this.$ = [$$[$0]]; + break; + case 34: + this.$ = [$$[$0 - 1]]; + break; + case 35: + $$[$0].unshift($$[$0 - 2]); + this.$ = $$[$0]; + break; + case 37: + yy.setCssClass($$[$0 - 2], $$[$0]); + break; + case 38: + yy.addMembers($$[$0 - 3], $$[$0 - 1]); + break; + case 39: + yy.setCssClass($$[$0 - 5], $$[$0 - 3]); + yy.addMembers($$[$0 - 5], $$[$0 - 1]); + break; + case 40: + this.$ = $$[$0]; + yy.addClass($$[$0]); + break; + case 41: + this.$ = $$[$0 - 1]; + yy.addClass($$[$0 - 1]); + yy.setClassLabel($$[$0 - 1], $$[$0]); + break; + case 42: + yy.addAnnotation($$[$0], $$[$0 - 2]); + break; + case 43: + this.$ = [$$[$0]]; + break; + case 44: + $$[$0].push($$[$0 - 1]); + this.$ = $$[$0]; + break; + case 45: + break; + case 46: + yy.addMember($$[$0 - 1], yy.cleanupLabel($$[$0])); + break; + case 47: + break; + case 48: + break; + case 49: + this.$ = { "id1": $$[$0 - 2], "id2": $$[$0], relation: $$[$0 - 1], relationTitle1: "none", relationTitle2: "none" }; + break; + case 50: + this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: "none" }; + break; + case 51: + this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: "none", relationTitle2: $$[$0 - 1] }; + break; + case 52: + this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] }; + break; + case 53: + yy.addNote($$[$0], $$[$0 - 1]); + break; + case 54: + yy.addNote($$[$0]); + break; + case 55: + yy.setDirection("TB"); + break; + case 56: + yy.setDirection("BT"); + break; + case 57: + yy.setDirection("RL"); + break; + case 58: + yy.setDirection("LR"); + break; + case 59: + this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] }; + break; + case 60: + this.$ = { type1: "none", type2: $$[$0], lineType: $$[$0 - 1] }; + break; + case 61: + this.$ = { type1: $$[$0 - 1], type2: "none", lineType: $$[$0] }; + break; + case 62: + this.$ = { type1: "none", type2: "none", lineType: $$[$0] }; + break; + case 63: + this.$ = yy.relationType.AGGREGATION; + break; + case 64: + this.$ = yy.relationType.EXTENSION; + break; + case 65: + this.$ = yy.relationType.COMPOSITION; + break; + case 66: + this.$ = yy.relationType.DEPENDENCY; + break; + case 67: + this.$ = yy.relationType.LOLLIPOP; + break; + case 68: + this.$ = yy.lineType.LINE; + break; + case 69: + this.$ = yy.lineType.DOTTED_LINE; + break; + case 70: + case 76: + this.$ = $$[$0 - 2]; + yy.setClickEvent($$[$0 - 1], $$[$0]); + break; + case 71: + case 77: + this.$ = $$[$0 - 3]; + yy.setClickEvent($$[$0 - 2], $$[$0 - 1]); + yy.setTooltip($$[$0 - 2], $$[$0]); + break; + case 72: + this.$ = $$[$0 - 2]; + yy.setLink($$[$0 - 1], $$[$0]); + break; + case 73: + this.$ = $$[$0 - 3]; + yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]); + break; + case 74: + this.$ = $$[$0 - 3]; + yy.setLink($$[$0 - 2], $$[$0 - 1]); + yy.setTooltip($$[$0 - 2], $$[$0]); + break; + case 75: + this.$ = $$[$0 - 4]; + yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]); + yy.setTooltip($$[$0 - 3], $$[$0 - 1]); + break; + case 78: + this.$ = $$[$0 - 3]; + yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]); + break; + case 79: + this.$ = $$[$0 - 4]; + yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]); + yy.setTooltip($$[$0 - 3], $$[$0]); + break; + case 80: + this.$ = $$[$0 - 3]; + yy.setLink($$[$0 - 2], $$[$0]); + break; + case 81: + this.$ = $$[$0 - 4]; + yy.setLink($$[$0 - 3], $$[$0 - 1], $$[$0]); + break; + case 82: + this.$ = $$[$0 - 4]; + yy.setLink($$[$0 - 3], $$[$0 - 1]); + yy.setTooltip($$[$0 - 3], $$[$0]); + break; + case 83: + this.$ = $$[$0 - 5]; + yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]); + yy.setTooltip($$[$0 - 4], $$[$0 - 1]); + break; + case 84: + this.$ = $$[$0 - 2]; + yy.setCssStyle($$[$0 - 1], $$[$0]); + break; + case 85: + yy.setCssClass($$[$0 - 1], $$[$0]); + break; + case 86: + this.$ = [$$[$0]]; + break; + case 87: + $$[$0 - 2].push($$[$0]); + this.$ = $$[$0 - 2]; + break; + case 89: + this.$ = $$[$0 - 1] + $$[$0]; + break; } - function spb() { - throw Adb(new jib()); + }, "anonymous"), + table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: [1, 6], 10: 5, 16: 37, 17: 20, 18: 38, 20: 7, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 27: 13, 28: 14, 29: 15, 30: 16, 31: $V0, 33: $V1, 35: $V2, 36: 21, 40: $V3, 41: 22, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, o2($Vo, [2, 5], { 8: [1, 46] }), { 8: [1, 47] }, o2($Vp, [2, 16], { 21: [1, 48] }), o2($Vp, [2, 18]), o2($Vp, [2, 19]), o2($Vp, [2, 20]), o2($Vp, [2, 21]), o2($Vp, [2, 22]), o2($Vp, [2, 23]), o2($Vp, [2, 24]), o2($Vp, [2, 25]), o2($Vp, [2, 26]), { 32: [1, 49] }, { 34: [1, 50] }, o2($Vp, [2, 29]), o2($Vp, [2, 45], { 49: 51, 57: 54, 58: 55, 13: [1, 52], 21: [1, 53], 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu, 64: $Vv, 65: $Vw }), { 37: [1, 63] }, o2($Vx, [2, 36], { 37: [1, 65], 42: [1, 64] }), o2($Vp, [2, 47]), o2($Vp, [2, 48]), { 16: 66, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 16: 37, 17: 67, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 16: 37, 17: 68, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 16: 37, 17: 69, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 74: [1, 70] }, { 13: [1, 71] }, { 16: 37, 17: 72, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 13: $Vy, 51: 73 }, o2($Vp, [2, 55]), o2($Vp, [2, 56]), o2($Vp, [2, 57]), o2($Vp, [2, 58]), o2($Vz, [2, 11], { 16: 37, 18: 38, 17: 75, 19: [1, 76], 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }), o2($Vz, [2, 12], { 19: [1, 77] }), { 15: 78, 16: 79, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 16: 37, 17: 80, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($VA, [2, 112]), o2($VA, [2, 113]), o2($VA, [2, 114]), o2($VA, [2, 115]), o2([1, 8, 9, 12, 13, 19, 21, 37, 39, 42, 59, 60, 61, 62, 63, 64, 65, 70, 72], [2, 116]), o2($Vo, [2, 6], { 10: 5, 20: 7, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 27: 13, 28: 14, 29: 15, 30: 16, 17: 20, 36: 21, 41: 22, 16: 37, 18: 38, 5: 81, 31: $V0, 33: $V1, 35: $V2, 40: $V3, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }), { 5: 82, 10: 5, 16: 37, 17: 20, 18: 38, 20: 7, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 27: 13, 28: 14, 29: 15, 30: 16, 31: $V0, 33: $V1, 35: $V2, 36: 21, 40: $V3, 41: 22, 44: $V4, 45: $V5, 47: $V6, 48: $V7, 50: $V8, 52: $V9, 53: $Va, 54: $Vb, 55: $Vc, 56: $Vd, 66: $Ve, 67: $Vf, 69: $Vg, 73: $Vh, 74: $Vi, 76: $Vj, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($Vp, [2, 17]), o2($Vp, [2, 27]), o2($Vp, [2, 28]), { 13: [1, 84], 16: 37, 17: 83, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 49: 85, 57: 54, 58: 55, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu, 64: $Vv, 65: $Vw }, o2($Vp, [2, 46]), { 58: 86, 64: $Vv, 65: $Vw }, o2($VB, [2, 62], { 57: 87, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu }), o2($VC, [2, 63]), o2($VC, [2, 64]), o2($VC, [2, 65]), o2($VC, [2, 66]), o2($VC, [2, 67]), o2($VD, [2, 68]), o2($VD, [2, 69]), { 8: [1, 89], 23: 90, 38: 88, 41: 22, 44: $V4 }, { 16: 91, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, { 43: 92, 47: $VE }, { 46: [1, 94] }, { 13: [1, 95] }, { 13: [1, 96] }, { 70: [1, 97], 72: [1, 98] }, { 21: $VF, 73: $VG, 74: $VH, 75: 99, 77: 100, 79: 101, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }, { 74: [1, 111] }, { 13: $Vy, 51: 112 }, o2($Vp, [2, 54]), o2($Vp, [2, 117]), o2($Vz, [2, 13]), o2($Vz, [2, 14]), o2($Vz, [2, 15]), { 37: [2, 32] }, { 15: 113, 16: 79, 37: [2, 9], 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm }, o2($VO, [2, 40], { 11: 114, 12: [1, 115] }), o2($Vo, [2, 7]), { 9: [1, 116] }, o2($VP, [2, 49]), { 16: 37, 17: 117, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, { 13: [1, 119], 16: 37, 17: 118, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($VB, [2, 61], { 57: 120, 59: $Vq, 60: $Vr, 61: $Vs, 62: $Vt, 63: $Vu }), o2($VB, [2, 60]), { 39: [1, 121] }, { 23: 90, 38: 122, 41: 22, 44: $V4 }, { 8: [1, 123], 39: [2, 33] }, o2($Vx, [2, 37], { 37: [1, 124] }), { 39: [1, 125] }, { 39: [2, 43], 43: 126, 47: $VE }, { 16: 37, 17: 127, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($Vp, [2, 70], { 13: [1, 128] }), o2($Vp, [2, 72], { 13: [1, 130], 68: [1, 129] }), o2($Vp, [2, 76], { 13: [1, 131], 71: [1, 132] }), { 13: [1, 133] }, o2($Vp, [2, 84], { 78: [1, 134] }), o2($VQ, [2, 86], { 79: 135, 21: $VF, 73: $VG, 74: $VH, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }), o2($VR, [2, 88]), o2($VR, [2, 90]), o2($VR, [2, 91]), o2($VR, [2, 92]), o2($VR, [2, 93]), o2($VR, [2, 94]), o2($VR, [2, 95]), o2($VR, [2, 96]), o2($VR, [2, 97]), o2($VR, [2, 98]), o2($Vp, [2, 85]), o2($Vp, [2, 53]), { 37: [2, 10] }, o2($VO, [2, 41]), { 13: [1, 136] }, { 1: [2, 4] }, o2($VP, [2, 51]), o2($VP, [2, 50]), { 16: 37, 17: 137, 18: 38, 74: $Vi, 80: $Vk, 95: $Vl, 97: $Vm, 98: $Vn }, o2($VB, [2, 59]), o2($Vp, [2, 30]), { 39: [1, 138] }, { 23: 90, 38: 139, 39: [2, 34], 41: 22, 44: $V4 }, { 43: 140, 47: $VE }, o2($Vx, [2, 38]), { 39: [2, 44] }, o2($Vp, [2, 42]), o2($Vp, [2, 71]), o2($Vp, [2, 73]), o2($Vp, [2, 74], { 68: [1, 141] }), o2($Vp, [2, 77]), o2($Vp, [2, 78], { 13: [1, 142] }), o2($Vp, [2, 80], { 13: [1, 144], 68: [1, 143] }), { 21: $VF, 73: $VG, 74: $VH, 77: 145, 79: 101, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }, o2($VR, [2, 89]), { 14: [1, 146] }, o2($VP, [2, 52]), o2($Vp, [2, 31]), { 39: [2, 35] }, { 39: [1, 147] }, o2($Vp, [2, 75]), o2($Vp, [2, 79]), o2($Vp, [2, 81]), o2($Vp, [2, 82], { 68: [1, 148] }), o2($VQ, [2, 87], { 79: 135, 21: $VF, 73: $VG, 74: $VH, 80: $VI, 81: $VJ, 82: $VK, 83: $VL, 84: $VM, 85: $VN }), o2($VO, [2, 8]), o2($Vx, [2, 39]), o2($Vp, [2, 83])], + defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 78: [2, 32], 113: [2, 10], 116: [2, 4], 126: [2, 44], 139: [2, 35] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function vpb() { - throw Adb(new jib()); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function Opb() { - throw Adb(new jib()); + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function yAb(a) { - this.a = new ezb(a); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function H2c() { - this.a = new Wed(s0); - } - function TVc() { - this.b = new Wed(H$); - } - function l6c() { - this.a = new Wed(V0); - } - function $ad() { - this.b = new Wed(I1); - } - function nbd() { - this.b = new Wed(I1); - } - function T2c(a) { - this.a = 0; - this.b = a; - } - function Bib(a) { - tib(); - vib(this, a); - } - function QDb(a) { - LCb(a); - return a.a; - } - function dvb(a) { - return a.b != a.d.c; - } - function AMc(a, b) { - return a.d[b.p]; - } - function ued(a, b) { - return ned(a, b); - } - function $Eb(a, b, c2) { - a.splice(b, c2); - } - function ixb(a, b) { - while (a.Re(b)) - ; - } - function NKb(a) { - a.c ? MKb(a) : OKb(a); - } - function mQd() { - throw Adb(new jib()); - } - function nQd() { - throw Adb(new jib()); - } - function oQd() { - throw Adb(new jib()); - } - function pQd() { - throw Adb(new jib()); - } - function qQd() { - throw Adb(new jib()); - } - function rQd() { - throw Adb(new jib()); - } - function sQd() { - throw Adb(new jib()); + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: {}, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + return 53; + break; + case 1: + return 54; + break; + case 2: + return 55; + break; + case 3: + return 56; + break; + case 4: + break; + case 5: + break; + case 6: + this.begin("acc_title"); + return 31; + break; + case 7: + this.popState(); + return "acc_title_value"; + break; + case 8: + this.begin("acc_descr"); + return 33; + break; + case 9: + this.popState(); + return "acc_descr_value"; + break; + case 10: + this.begin("acc_descr_multiline"); + break; + case 11: + this.popState(); + break; + case 12: + return "acc_descr_multiline_value"; + break; + case 13: + return 8; + break; + case 14: + break; + case 15: + return 7; + break; + case 16: + return 7; + break; + case 17: + return "EDGE_STATE"; + break; + case 18: + this.begin("callback_name"); + break; + case 19: + this.popState(); + break; + case 20: + this.popState(); + this.begin("callback_args"); + break; + case 21: + return 70; + break; + case 22: + this.popState(); + break; + case 23: + return 71; + break; + case 24: + this.popState(); + break; + case 25: + return "STR"; + break; + case 26: + this.begin("string"); + break; + case 27: + return 73; + break; + case 28: + this.begin("namespace"); + return 40; + break; + case 29: + this.popState(); + return 8; + break; + case 30: + break; + case 31: + this.begin("namespace-body"); + return 37; + break; + case 32: + this.popState(); + return 39; + break; + case 33: + return "EOF_IN_STRUCT"; + break; + case 34: + return 8; + break; + case 35: + break; + case 36: + return "EDGE_STATE"; + break; + case 37: + this.begin("class"); + return 44; + break; + case 38: + this.popState(); + return 8; + break; + case 39: + break; + case 40: + this.popState(); + this.popState(); + return 39; + break; + case 41: + this.begin("class-body"); + return 37; + break; + case 42: + this.popState(); + return 39; + break; + case 43: + return "EOF_IN_STRUCT"; + break; + case 44: + return "EDGE_STATE"; + break; + case 45: + return "OPEN_IN_STRUCT"; + break; + case 46: + break; + case 47: + return "MEMBER"; + break; + case 48: + return 76; + break; + case 49: + return 66; + break; + case 50: + return 67; + break; + case 51: + return 69; + break; + case 52: + return 50; + break; + case 53: + return 52; + break; + case 54: + return 45; + break; + case 55: + return 46; + break; + case 56: + return 72; + break; + case 57: + this.popState(); + break; + case 58: + return "GENERICTYPE"; + break; + case 59: + this.begin("generic"); + break; + case 60: + this.popState(); + break; + case 61: + return "BQUOTE_STR"; + break; + case 62: + this.begin("bqstring"); + break; + case 63: + return 68; + break; + case 64: + return 68; + break; + case 65: + return 68; + break; + case 66: + return 68; + break; + case 67: + return 60; + break; + case 68: + return 60; + break; + case 69: + return 62; + break; + case 70: + return 62; + break; + case 71: + return 61; + break; + case 72: + return 59; + break; + case 73: + return 63; + break; + case 74: + return 64; + break; + case 75: + return 65; + break; + case 76: + return 21; + break; + case 77: + return 42; + break; + case 78: + return 95; + break; + case 79: + return "DOT"; + break; + case 80: + return "PLUS"; + break; + case 81: + return 81; + break; + case 82: + return 78; + break; + case 83: + return 84; + break; + case 84: + return 84; + break; + case 85: + return 85; + break; + case 86: + return "EQUALS"; + break; + case 87: + return "EQUALS"; + break; + case 88: + return 74; + break; + case 89: + return 12; + break; + case 90: + return 14; + break; + case 91: + return "PUNCTUATION"; + break; + case 92: + return 80; + break; + case 93: + return 97; + break; + case 94: + return 83; + break; + case 95: + return 83; + break; + case 96: + return 9; + break; + } + }, "anonymous"), + rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:\[\*\])/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:["])/, /^(?:[^"]*)/, /^(?:["])/, /^(?:style\b)/, /^(?:namespace\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:\[\*\])/, /^(?:class\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[}])/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\[\*\])/, /^(?:[{])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:href\b)/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:~)/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:[`])/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?::)/, /^(?:,)/, /^(?:#)/, /^(?:#)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:\[)/, /^(?:\])/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:\s)/, /^(?:$)/], + conditions: { "namespace-body": { "rules": [26, 32, 33, 34, 35, 36, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "namespace": { "rules": [26, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "class-body": { "rules": [26, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "class": { "rules": [26, 38, 39, 40, 41, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_descr": { "rules": [9, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "acc_title": { "rules": [7, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "callback_args": { "rules": [22, 23, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "callback_name": { "rules": [19, 20, 21, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "href": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "struct": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "generic": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "bqstring": { "rules": [26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "string": { "rules": [24, 25, 26, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 26, 27, 28, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser13.parser = parser13; + classDiagram_default = parser13; + } + }); + + // src/diagrams/class/classTypes.ts + var visibilityValues, ClassMember; + var init_classTypes = __esm({ + "src/diagrams/class/classTypes.ts"() { + "use strict"; + init_diagramAPI(); + init_common(); + visibilityValues = ["#", "+", "~", "-", ""]; + ClassMember = class { + static { + __name(this, "ClassMember"); + } + constructor(input, memberType) { + this.memberType = memberType; + this.visibility = ""; + this.classifier = ""; + const sanitizedInput = sanitizeText(input, getConfig2()); + this.parseMember(sanitizedInput); + } + getDisplayDetails() { + let displayText = this.visibility + parseGenericTypes(this.id); + if (this.memberType === "method") { + displayText += `(${parseGenericTypes(this.parameters.trim())})`; + if (this.returnType) { + displayText += " : " + parseGenericTypes(this.returnType); + } + } + displayText = displayText.trim(); + const cssStyle = this.parseClassifier(); + return { + displayText, + cssStyle + }; + } + parseMember(input) { + let potentialClassifier = ""; + if (this.memberType === "method") { + const methodRegEx = /([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/; + const match2 = methodRegEx.exec(input); + if (match2) { + const detectedVisibility = match2[1] ? match2[1].trim() : ""; + if (visibilityValues.includes(detectedVisibility)) { + this.visibility = detectedVisibility; + } + this.id = match2[2].trim(); + this.parameters = match2[3] ? match2[3].trim() : ""; + potentialClassifier = match2[4] ? match2[4].trim() : ""; + this.returnType = match2[5] ? match2[5].trim() : ""; + if (potentialClassifier === "") { + const lastChar = this.returnType.substring(this.returnType.length - 1); + if (/[$*]/.exec(lastChar)) { + potentialClassifier = lastChar; + this.returnType = this.returnType.substring(0, this.returnType.length - 1); + } + } } - function tQd() { - throw Adb(new jib()); + } else { + const length2 = input.length; + const firstChar = input.substring(0, 1); + const lastChar = input.substring(length2 - 1); + if (visibilityValues.includes(firstChar)) { + this.visibility = firstChar; } - function uQd() { - throw Adb(new jib()); + if (/[$*]/.exec(lastChar)) { + potentialClassifier = lastChar; } - function vQd() { - throw Adb(new jib()); + this.id = input.substring( + this.visibility === "" ? 0 : 1, + potentialClassifier === "" ? length2 : length2 - 1 + ); + } + this.classifier = potentialClassifier; + } + parseClassifier() { + switch (this.classifier) { + case "*": + return "font-style:italic;"; + case "$": + return "text-decoration:underline;"; + default: + return ""; + } + } + }; + } + }); + + // src/diagrams/class/classDb.ts + var MERMAID_DOM_ID_PREFIX2, relations2, classes2, notes, classCounter, namespaces, namespaceCounter, functions2, sanitizeText5, splitClassNameAndType, setClassLabel, addClass3, lookUpDomId2, clear18, getClass, getClasses3, getRelations, getNotes, addRelation, addAnnotation, addMember, addMembers, addNote2, cleanupLabel, setCssClass, setTooltip2, getTooltip2, setLink3, setClickEvent3, setClickFunc, bindFunctions3, lineType, relationType, setupToolTips2, direction2, getDirection3, setDirection3, addNamespace, getNamespace, getNamespaces, addClassesToNamespace, setCssStyle, classDb_default; + var init_classDb = __esm({ + "src/diagrams/class/classDb.ts"() { + "use strict"; + init_src32(); + init_logger(); + init_diagramAPI(); + init_common(); + init_utils2(); + init_commonDb(); + init_classTypes(); + MERMAID_DOM_ID_PREFIX2 = "classId-"; + relations2 = []; + classes2 = /* @__PURE__ */ new Map(); + notes = []; + classCounter = 0; + namespaces = /* @__PURE__ */ new Map(); + namespaceCounter = 0; + functions2 = []; + sanitizeText5 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText"); + splitClassNameAndType = /* @__PURE__ */ __name(function(_id) { + const id26 = common_default.sanitizeText(_id, getConfig2()); + let genericType = ""; + let className = id26; + if (id26.indexOf("~") > 0) { + const split = id26.split("~"); + className = sanitizeText5(split[0]); + genericType = sanitizeText5(split[1]); + } + return { className, type: genericType }; + }, "splitClassNameAndType"); + setClassLabel = /* @__PURE__ */ __name(function(_id, label) { + const id26 = common_default.sanitizeText(_id, getConfig2()); + if (label) { + label = sanitizeText5(label); + } + const { className } = splitClassNameAndType(id26); + classes2.get(className).label = label; + }, "setClassLabel"); + addClass3 = /* @__PURE__ */ __name(function(_id) { + const id26 = common_default.sanitizeText(_id, getConfig2()); + const { className, type: type3 } = splitClassNameAndType(id26); + if (classes2.has(className)) { + return; + } + const name = common_default.sanitizeText(className, getConfig2()); + classes2.set(name, { + id: name, + type: type3, + label: name, + cssClasses: [], + methods: [], + members: [], + annotations: [], + styles: [], + domId: MERMAID_DOM_ID_PREFIX2 + name + "-" + classCounter + }); + classCounter++; + }, "addClass"); + lookUpDomId2 = /* @__PURE__ */ __name(function(_id) { + const id26 = common_default.sanitizeText(_id, getConfig2()); + if (classes2.has(id26)) { + return classes2.get(id26).domId; + } + throw new Error("Class not found: " + id26); + }, "lookUpDomId"); + clear18 = /* @__PURE__ */ __name(function() { + relations2 = []; + classes2 = /* @__PURE__ */ new Map(); + notes = []; + functions2 = []; + functions2.push(setupToolTips2); + namespaces = /* @__PURE__ */ new Map(); + namespaceCounter = 0; + direction2 = "TB"; + clear(); + }, "clear"); + getClass = /* @__PURE__ */ __name(function(id26) { + return classes2.get(id26); + }, "getClass"); + getClasses3 = /* @__PURE__ */ __name(function() { + return classes2; + }, "getClasses"); + getRelations = /* @__PURE__ */ __name(function() { + return relations2; + }, "getRelations"); + getNotes = /* @__PURE__ */ __name(function() { + return notes; + }, "getNotes"); + addRelation = /* @__PURE__ */ __name(function(relation) { + log.debug("Adding relation: " + JSON.stringify(relation)); + addClass3(relation.id1); + addClass3(relation.id2); + relation.id1 = splitClassNameAndType(relation.id1).className; + relation.id2 = splitClassNameAndType(relation.id2).className; + relation.relationTitle1 = common_default.sanitizeText(relation.relationTitle1.trim(), getConfig2()); + relation.relationTitle2 = common_default.sanitizeText(relation.relationTitle2.trim(), getConfig2()); + relations2.push(relation); + }, "addRelation"); + addAnnotation = /* @__PURE__ */ __name(function(className, annotation) { + const validatedClassName = splitClassNameAndType(className).className; + classes2.get(validatedClassName).annotations.push(annotation); + }, "addAnnotation"); + addMember = /* @__PURE__ */ __name(function(className, member) { + addClass3(className); + const validatedClassName = splitClassNameAndType(className).className; + const theClass = classes2.get(validatedClassName); + if (typeof member === "string") { + const memberString = member.trim(); + if (memberString.startsWith("<<") && memberString.endsWith(">>")) { + theClass.annotations.push(sanitizeText5(memberString.substring(2, memberString.length - 2))); + } else if (memberString.indexOf(")") > 0) { + theClass.methods.push(new ClassMember(memberString, "method")); + } else if (memberString) { + theClass.members.push(new ClassMember(memberString, "attribute")); + } + } + }, "addMember"); + addMembers = /* @__PURE__ */ __name(function(className, members) { + if (Array.isArray(members)) { + members.reverse(); + members.forEach((member) => addMember(className, member)); + } + }, "addMembers"); + addNote2 = /* @__PURE__ */ __name(function(text2, className) { + const note3 = { + id: `note${notes.length}`, + class: className, + text: text2 + }; + notes.push(note3); + }, "addNote"); + cleanupLabel = /* @__PURE__ */ __name(function(label) { + if (label.startsWith(":")) { + label = label.substring(1); + } + return sanitizeText5(label.trim()); + }, "cleanupLabel"); + setCssClass = /* @__PURE__ */ __name(function(ids, className) { + ids.split(",").forEach(function(_id) { + let id26 = _id; + if (/\d/.exec(_id[0])) { + id26 = MERMAID_DOM_ID_PREFIX2 + id26; + } + const classNode = classes2.get(id26); + if (classNode) { + classNode.cssClasses.push(className); + } + }); + }, "setCssClass"); + setTooltip2 = /* @__PURE__ */ __name(function(ids, tooltip) { + ids.split(",").forEach(function(id26) { + if (tooltip !== void 0) { + classes2.get(id26).tooltip = sanitizeText5(tooltip); + } + }); + }, "setTooltip"); + getTooltip2 = /* @__PURE__ */ __name(function(id26, namespace) { + if (namespace && namespaces.has(namespace)) { + return namespaces.get(namespace).classes.get(id26).tooltip; + } + return classes2.get(id26).tooltip; + }, "getTooltip"); + setLink3 = /* @__PURE__ */ __name(function(ids, linkStr, target) { + const config6 = getConfig2(); + ids.split(",").forEach(function(_id) { + let id26 = _id; + if (/\d/.exec(_id[0])) { + id26 = MERMAID_DOM_ID_PREFIX2 + id26; + } + const theClass = classes2.get(id26); + if (theClass) { + theClass.link = utils_default2.formatUrl(linkStr, config6); + if (config6.securityLevel === "sandbox") { + theClass.linkTarget = "_top"; + } else if (typeof target === "string") { + theClass.linkTarget = sanitizeText5(target); + } else { + theClass.linkTarget = "_blank"; } - function zue() { - throw Adb(new Dvb()); + } + }); + setCssClass(ids, "clickable"); + }, "setLink"); + setClickEvent3 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { + ids.split(",").forEach(function(id26) { + setClickFunc(id26, functionName, functionArgs); + classes2.get(id26).haveCallback = true; + }); + setCssClass(ids, "clickable"); + }, "setClickEvent"); + setClickFunc = /* @__PURE__ */ __name(function(_domId, functionName, functionArgs) { + const domId = common_default.sanitizeText(_domId, getConfig2()); + const config6 = getConfig2(); + if (config6.securityLevel !== "loose") { + return; + } + if (functionName === void 0) { + return; + } + const id26 = domId; + if (classes2.has(id26)) { + const elemId = lookUpDomId2(id26); + let argList = []; + if (typeof functionArgs === "string") { + argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + for (let i2 = 0; i2 < argList.length; i2++) { + let item = argList[i2].trim(); + if (item.startsWith('"') && item.endsWith('"')) { + item = item.substr(1, item.length - 2); + } + argList[i2] = item; + } + } + if (argList.length === 0) { + argList.push(elemId); + } + functions2.push(function() { + const elem = document.querySelector(`[id="${elemId}"]`); + if (elem !== null) { + elem.addEventListener( + "click", + function() { + utils_default2.runFunc(functionName, ...argList); + }, + false + ); } - function Aue() { - throw Adb(new Dvb()); + }); + } + }, "setClickFunc"); + bindFunctions3 = /* @__PURE__ */ __name(function(element3) { + functions2.forEach(function(fun) { + fun(element3); + }); + }, "bindFunctions"); + lineType = { + LINE: 0, + DOTTED_LINE: 1 + }; + relationType = { + AGGREGATION: 0, + EXTENSION: 1, + COMPOSITION: 2, + DEPENDENCY: 3, + LOLLIPOP: 4 + }; + setupToolTips2 = /* @__PURE__ */ __name(function(element3) { + let tooltipElem = select_default2(".mermaidTooltip"); + if ((tooltipElem._groups || tooltipElem)[0][0] === null) { + tooltipElem = select_default2("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0); + } + const svg = select_default2(element3).select("svg"); + const nodes6 = svg.selectAll("g.node"); + nodes6.on("mouseover", function() { + const el = select_default2(this); + const title2 = el.attr("title"); + if (title2 === null) { + return; + } + const rect4 = this.getBoundingClientRect(); + tooltipElem.transition().duration(200).style("opacity", ".9"); + tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect4.left + (rect4.right - rect4.left) / 2 + "px").style("top", window.scrollY + rect4.top - 14 + document.body.scrollTop + "px"); + tooltipElem.html(tooltipElem.html().replace(/<br\/>/g, "
    ")); + el.classed("hover", true); + }).on("mouseout", function() { + tooltipElem.transition().duration(500).style("opacity", 0); + const el = select_default2(this); + el.classed("hover", false); + }); + }, "setupToolTips"); + functions2.push(setupToolTips2); + direction2 = "TB"; + getDirection3 = /* @__PURE__ */ __name(() => direction2, "getDirection"); + setDirection3 = /* @__PURE__ */ __name((dir2) => { + direction2 = dir2; + }, "setDirection"); + addNamespace = /* @__PURE__ */ __name(function(id26) { + if (namespaces.has(id26)) { + return; + } + namespaces.set(id26, { + id: id26, + classes: /* @__PURE__ */ new Map(), + children: {}, + domId: MERMAID_DOM_ID_PREFIX2 + id26 + "-" + namespaceCounter + }); + namespaceCounter++; + }, "addNamespace"); + getNamespace = /* @__PURE__ */ __name(function(name) { + return namespaces.get(name); + }, "getNamespace"); + getNamespaces = /* @__PURE__ */ __name(function() { + return namespaces; + }, "getNamespaces"); + addClassesToNamespace = /* @__PURE__ */ __name(function(id26, classNames) { + if (!namespaces.has(id26)) { + return; + } + for (const name of classNames) { + const { className } = splitClassNameAndType(name); + classes2.get(className).parent = id26; + namespaces.get(id26).classes.set(className, classes2.get(className)); + } + }, "addClassesToNamespace"); + setCssStyle = /* @__PURE__ */ __name(function(id26, styles3) { + const thisClass = classes2.get(id26); + if (!styles3 || !thisClass) { + return; + } + for (const s2 of styles3) { + if (s2.includes(",")) { + thisClass.styles.push(...s2.split(",")); + } else { + thisClass.styles.push(s2); + } + } + }, "setCssStyle"); + classDb_default = { + setAccTitle, + getAccTitle, + getAccDescription, + setAccDescription, + getConfig: /* @__PURE__ */ __name(() => getConfig2().class, "getConfig"), + addClass: addClass3, + bindFunctions: bindFunctions3, + clear: clear18, + getClass, + getClasses: getClasses3, + getNotes, + addAnnotation, + addNote: addNote2, + getRelations, + addRelation, + getDirection: getDirection3, + setDirection: setDirection3, + addMember, + addMembers, + cleanupLabel, + lineType, + relationType, + setClickEvent: setClickEvent3, + setCssClass, + setLink: setLink3, + getTooltip: getTooltip2, + setTooltip: setTooltip2, + lookUpDomId: lookUpDomId2, + setDiagramTitle, + getDiagramTitle, + setClassLabel, + addNamespace, + addClassesToNamespace, + getNamespace, + getNamespaces, + setCssStyle + }; + } + }); + + // src/diagrams/class/styles.js + var getStyles10, styles_default9; + var init_styles9 = __esm({ + "src/diagrams/class/styles.js"() { + "use strict"; + getStyles10 = /* @__PURE__ */ __name((options3) => `g.classGroup text { + fill: ${options3.nodeBorder || options3.classText}; + stroke: none; + font-family: ${options3.fontFamily}; + font-size: 10px; + + .title { + font-weight: bolder; + } + +} + +.nodeLabel, .edgeLabel { + color: ${options3.classText}; +} +.edgeLabel .label rect { + fill: ${options3.mainBkg}; +} +.label text { + fill: ${options3.classText}; +} +.edgeLabel .label span { + background: ${options3.mainBkg}; +} + +.classTitle { + font-weight: bolder; +} +.node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${options3.mainBkg}; + stroke: ${options3.nodeBorder}; + stroke-width: 1px; + } + + +.divider { + stroke: ${options3.nodeBorder}; + stroke-width: 1; +} + +g.clickable { + cursor: pointer; +} + +g.classGroup rect { + fill: ${options3.mainBkg}; + stroke: ${options3.nodeBorder}; +} + +g.classGroup line { + stroke: ${options3.nodeBorder}; + stroke-width: 1; +} + +.classLabel .box { + stroke: none; + stroke-width: 0; + fill: ${options3.mainBkg}; + opacity: 0.5; +} + +.classLabel .label { + fill: ${options3.nodeBorder}; + font-size: 10px; +} + +.relation { + stroke: ${options3.lineColor}; + stroke-width: 1; + fill: none; +} + +.dashed-line{ + stroke-dasharray: 3; +} + +.dotted-line{ + stroke-dasharray: 1 2; +} + +#compositionStart, .composition { + fill: ${options3.lineColor} !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#compositionEnd, .composition { + fill: ${options3.lineColor} !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#dependencyStart, .dependency { + fill: ${options3.lineColor} !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#dependencyStart, .dependency { + fill: ${options3.lineColor} !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#extensionStart, .extension { + fill: transparent !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#extensionEnd, .extension { + fill: transparent !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#aggregationStart, .aggregation { + fill: transparent !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#aggregationEnd, .aggregation { + fill: transparent !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#lollipopStart, .lollipop { + fill: ${options3.mainBkg} !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +#lollipopEnd, .lollipop { + fill: ${options3.mainBkg} !important; + stroke: ${options3.lineColor} !important; + stroke-width: 1; +} + +.edgeTerminals { + font-size: 11px; + line-height: initial; +} + +.classTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; +} +`, "getStyles"); + styles_default9 = getStyles10; + } + }); + + // src/diagrams/class/svgDraw.js + var edgeCount, drawEdge, drawClass, getClassTitleString, drawNote2, addTspan, svgDraw_default3; + var init_svgDraw3 = __esm({ + "src/diagrams/class/svgDraw.js"() { + "use strict"; + init_src32(); + init_utils2(); + init_logger(); + init_common(); + edgeCount = 0; + drawEdge = /* @__PURE__ */ __name(function(elem, path4, relation, conf8, diagObj) { + const getRelationType = /* @__PURE__ */ __name(function(type3) { + switch (type3) { + case diagObj.db.relationType.AGGREGATION: + return "aggregation"; + case diagObj.db.relationType.EXTENSION: + return "extension"; + case diagObj.db.relationType.COMPOSITION: + return "composition"; + case diagObj.db.relationType.DEPENDENCY: + return "dependency"; + case diagObj.db.relationType.LOLLIPOP: + return "lollipop"; + } + }, "getRelationType"); + path4.points = path4.points.filter((p3) => !Number.isNaN(p3.y)); + const lineData = path4.points; + const lineFunction = line_default().x(function(d2) { + return d2.x; + }).y(function(d2) { + return d2.y; + }).curve(basis_default2); + const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "relation"); + let url = ""; + if (conf8.arrowMarkerAbsolute) { + url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, "\\("); + url = url.replace(/\)/g, "\\)"); + } + if (relation.relation.lineType == 1) { + svgPath.attr("class", "relation dashed-line"); + } + if (relation.relation.lineType == 10) { + svgPath.attr("class", "relation dotted-line"); + } + if (relation.relation.type1 !== "none") { + svgPath.attr( + "marker-start", + "url(" + url + "#" + getRelationType(relation.relation.type1) + "Start)" + ); + } + if (relation.relation.type2 !== "none") { + svgPath.attr( + "marker-end", + "url(" + url + "#" + getRelationType(relation.relation.type2) + "End)" + ); + } + let x5, y5; + const l2 = path4.points.length; + let labelPosition = utils_default2.calcLabelPosition(path4.points); + x5 = labelPosition.x; + y5 = labelPosition.y; + let p1_card_x, p1_card_y; + let p2_card_x, p2_card_y; + if (l2 % 2 !== 0 && l2 > 1) { + let cardinality_1_point = utils_default2.calcCardinalityPosition( + relation.relation.type1 !== "none", + path4.points, + path4.points[0] + ); + let cardinality_2_point = utils_default2.calcCardinalityPosition( + relation.relation.type2 !== "none", + path4.points, + path4.points[l2 - 1] + ); + log.debug("cardinality_1_point " + JSON.stringify(cardinality_1_point)); + log.debug("cardinality_2_point " + JSON.stringify(cardinality_2_point)); + p1_card_x = cardinality_1_point.x; + p1_card_y = cardinality_1_point.y; + p2_card_x = cardinality_2_point.x; + p2_card_y = cardinality_2_point.y; + } + if (relation.title !== void 0) { + const g2 = elem.append("g").attr("class", "classLabel"); + const label = g2.append("text").attr("class", "label").attr("x", x5).attr("y", y5).attr("fill", "red").attr("text-anchor", "middle").text(relation.title); + window.label = label; + const bounds4 = label.node().getBBox(); + g2.insert("rect", ":first-child").attr("class", "box").attr("x", bounds4.x - conf8.padding / 2).attr("y", bounds4.y - conf8.padding / 2).attr("width", bounds4.width + conf8.padding).attr("height", bounds4.height + conf8.padding); + } + log.info("Rendering relation " + JSON.stringify(relation)); + if (relation.relationTitle1 !== void 0 && relation.relationTitle1 !== "none") { + const g2 = elem.append("g").attr("class", "cardinality"); + g2.append("text").attr("class", "type1").attr("x", p1_card_x).attr("y", p1_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle1); + } + if (relation.relationTitle2 !== void 0 && relation.relationTitle2 !== "none") { + const g2 = elem.append("g").attr("class", "cardinality"); + g2.append("text").attr("class", "type2").attr("x", p2_card_x).attr("y", p2_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle2); + } + edgeCount++; + }, "drawEdge"); + drawClass = /* @__PURE__ */ __name(function(elem, classDef, conf8, diagObj) { + log.debug("Rendering class ", classDef, conf8); + const id26 = classDef.id; + const classInfo = { + id: id26, + label: classDef.id, + width: 0, + height: 0 + }; + const g2 = elem.append("g").attr("id", diagObj.db.lookUpDomId(id26)).attr("class", "classGroup"); + let title2; + if (classDef.link) { + title2 = g2.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0); + } else { + title2 = g2.append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0); + } + let isFirst = true; + classDef.annotations.forEach(function(member) { + const titleText2 = title2.append("tspan").text("\xAB" + member + "\xBB"); + if (!isFirst) { + titleText2.attr("dy", conf8.textHeight); + } + isFirst = false; + }); + let classTitleString = getClassTitleString(classDef); + const classTitle = title2.append("tspan").text(classTitleString).attr("class", "title"); + if (!isFirst) { + classTitle.attr("dy", conf8.textHeight); + } + const titleHeight = title2.node().getBBox().height; + let membersLine; + let membersBox; + let methodsLine; + if (classDef.members.length > 0) { + membersLine = g2.append("line").attr("x1", 0).attr("y1", conf8.padding + titleHeight + conf8.dividerMargin / 2).attr("y2", conf8.padding + titleHeight + conf8.dividerMargin / 2); + const members = g2.append("text").attr("x", conf8.padding).attr("y", titleHeight + conf8.dividerMargin + conf8.textHeight).attr("fill", "white").attr("class", "classText"); + isFirst = true; + classDef.members.forEach(function(member) { + addTspan(members, member, isFirst, conf8); + isFirst = false; + }); + membersBox = members.node().getBBox(); + } + if (classDef.methods.length > 0) { + methodsLine = g2.append("line").attr("x1", 0).attr("y1", conf8.padding + titleHeight + conf8.dividerMargin + membersBox.height).attr("y2", conf8.padding + titleHeight + conf8.dividerMargin + membersBox.height); + const methods = g2.append("text").attr("x", conf8.padding).attr("y", titleHeight + 2 * conf8.dividerMargin + membersBox.height + conf8.textHeight).attr("fill", "white").attr("class", "classText"); + isFirst = true; + classDef.methods.forEach(function(method) { + addTspan(methods, method, isFirst, conf8); + isFirst = false; + }); + } + const classBox = g2.node().getBBox(); + var cssClassStr = " "; + if (classDef.cssClasses.length > 0) { + cssClassStr = cssClassStr + classDef.cssClasses.join(" "); + } + const rect4 = g2.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf8.padding).attr("height", classBox.height + conf8.padding + 0.5 * conf8.dividerMargin).attr("class", cssClassStr); + const rectWidth = rect4.node().getBBox().width; + title2.node().childNodes.forEach(function(x5) { + x5.setAttribute("x", (rectWidth - x5.getBBox().width) / 2); + }); + if (classDef.tooltip) { + title2.insert("title").text(classDef.tooltip); + } + if (membersLine) { + membersLine.attr("x2", rectWidth); + } + if (methodsLine) { + methodsLine.attr("x2", rectWidth); + } + classInfo.width = rectWidth; + classInfo.height = classBox.height + conf8.padding + 0.5 * conf8.dividerMargin; + return classInfo; + }, "drawClass"); + getClassTitleString = /* @__PURE__ */ __name(function(classDef) { + let classTitleString = classDef.id; + if (classDef.type) { + classTitleString += "<" + parseGenericTypes(classDef.type) + ">"; + } + return classTitleString; + }, "getClassTitleString"); + drawNote2 = /* @__PURE__ */ __name(function(elem, note3, conf8, _diagObj) { + log.debug("Rendering note ", note3, conf8); + const id26 = note3.id; + const noteInfo = { + id: id26, + text: note3.text, + width: 0, + height: 0 + }; + const g2 = elem.append("g").attr("id", id26).attr("class", "classGroup"); + let text2 = g2.append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0); + const lines = JSON.parse(`"${note3.text}"`).split("\n"); + lines.forEach(function(line2) { + log.debug(`Adding line: ${line2}`); + text2.append("tspan").text(line2).attr("class", "title").attr("dy", conf8.textHeight); + }); + const noteBox = g2.node().getBBox(); + const rect4 = g2.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", noteBox.width + 2 * conf8.padding).attr( + "height", + noteBox.height + lines.length * conf8.textHeight + conf8.padding + 0.5 * conf8.dividerMargin + ); + const rectWidth = rect4.node().getBBox().width; + text2.node().childNodes.forEach(function(x5) { + x5.setAttribute("x", (rectWidth - x5.getBBox().width) / 2); + }); + noteInfo.width = rectWidth; + noteInfo.height = noteBox.height + lines.length * conf8.textHeight + conf8.padding + 0.5 * conf8.dividerMargin; + return noteInfo; + }, "drawNote"); + addTspan = /* @__PURE__ */ __name(function(textEl, member, isFirst, conf8) { + const { displayText, cssStyle } = member.getDisplayDetails(); + const tSpan = textEl.append("tspan").attr("x", conf8.padding).text(displayText); + if (cssStyle !== "") { + tSpan.attr("style", member.cssStyle); + } + if (!isFirst) { + tSpan.attr("dy", conf8.textHeight); + } + }, "addTspan"); + svgDraw_default3 = { + getClassTitleString, + drawClass, + drawEdge, + drawNote: drawNote2 + }; + } + }); + + // src/diagrams/class/classRenderer.js + var idCache, padding, getGraphId, insertMarkers3, draw12, classRenderer_default; + var init_classRenderer = __esm({ + "src/diagrams/class/classRenderer.js"() { + "use strict"; + init_src32(); + init_dagre(); + init_graphlib(); + init_logger(); + init_svgDraw3(); + init_setupGraphViewbox(); + init_diagramAPI(); + idCache = {}; + padding = 20; + getGraphId = /* @__PURE__ */ __name(function(label) { + const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label); + if (foundEntry) { + return foundEntry[0]; + } + }, "getGraphId"); + insertMarkers3 = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); + elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); + elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + }, "insertMarkers"); + draw12 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + const conf8 = getConfig2().class; + idCache = {}; + log.info("Rendering diagram " + text2); + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const diagram23 = root4.select(`[id='${id26}']`); + insertMarkers3(diagram23); + const g2 = new Graph({ + multigraph: true + }); + g2.setGraph({ + isMultiGraph: true + }); + g2.setDefaultEdgeLabel(function() { + return {}; + }); + const classes6 = diagObj.db.getClasses(); + const keys3 = [...classes6.keys()]; + for (const key of keys3) { + const classDef = classes6.get(key); + const node2 = svgDraw_default3.drawClass(diagram23, classDef, conf8, diagObj); + idCache[node2.id] = node2; + g2.setNode(node2.id, node2); + log.info("Org height: " + node2.height); + } + const relations3 = diagObj.db.getRelations(); + relations3.forEach(function(relation) { + log.info( + // cspell:ignore tjoho + "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation) + ); + g2.setEdge( + getGraphId(relation.id1), + getGraphId(relation.id2), + { + relation + }, + relation.title || "DEFAULT" + ); + }); + const notes2 = diagObj.db.getNotes(); + notes2.forEach(function(note3) { + log.debug(`Adding note: ${JSON.stringify(note3)}`); + const node2 = svgDraw_default3.drawNote(diagram23, note3, conf8, diagObj); + idCache[node2.id] = node2; + g2.setNode(node2.id, node2); + if (note3.class && classes6.has(note3.class)) { + g2.setEdge( + note3.id, + getGraphId(note3.class), + { + relation: { + id1: note3.id, + id2: note3.class, + relation: { + type1: "none", + type2: "none", + lineType: 10 + } + } + }, + "DEFAULT" + ); + } + }); + layout(g2); + g2.nodes().forEach(function(v3) { + if (v3 !== void 0 && g2.node(v3) !== void 0) { + log.debug("Node " + v3 + ": " + JSON.stringify(g2.node(v3))); + root4.select("#" + (diagObj.db.lookUpDomId(v3) || v3)).attr( + "transform", + "translate(" + (g2.node(v3).x - g2.node(v3).width / 2) + "," + (g2.node(v3).y - g2.node(v3).height / 2) + " )" + ); + } + }); + g2.edges().forEach(function(e3) { + if (e3 !== void 0 && g2.edge(e3) !== void 0) { + log.debug("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(g2.edge(e3))); + svgDraw_default3.drawEdge(diagram23, g2.edge(e3), g2.edge(e3).relation, conf8, diagObj); + } + }); + const svgBounds = diagram23.node().getBBox(); + const width3 = svgBounds.width + padding * 2; + const height2 = svgBounds.height + padding * 2; + configureSvgSize(diagram23, height2, width3, conf8.useMaxWidth); + const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width3} ${height2}`; + log.debug(`viewBox ${vBox}`); + diagram23.attr("viewBox", vBox); + }, "draw"); + classRenderer_default = { + draw: draw12 + }; + } + }); + + // src/diagrams/class/classDiagram.ts + var classDiagram_exports = {}; + __export(classDiagram_exports, { + diagram: () => diagram12 + }); + var diagram12; + var init_classDiagram2 = __esm({ + "src/diagrams/class/classDiagram.ts"() { + "use strict"; + init_classDiagram(); + init_classDb(); + init_styles9(); + init_classRenderer(); + diagram12 = { + parser: classDiagram_default, + db: classDb_default, + renderer: classRenderer_default, + styles: styles_default9, + init: /* @__PURE__ */ __name((cnf) => { + if (!cnf.class) { + cnf.class = {}; + } + cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + classDb_default.clear(); + }, "init") + }; + } + }); + + // src/dagre-wrapper/markers.js + var insertMarkers4, extension2, composition2, aggregation2, dependency2, lollipop2, point7, circle4, cross2, barb2, markers2, markers_default2; + var init_markers2 = __esm({ + "src/dagre-wrapper/markers.js"() { + "use strict"; + init_logger(); + insertMarkers4 = /* @__PURE__ */ __name((elem, markerArray, type3, id26) => { + markerArray.forEach((markerName) => { + markers2[markerName](elem, type3, id26); + }); + }, "insertMarkers"); + extension2 = /* @__PURE__ */ __name((elem, type3, id26) => { + log.trace("Making markers for ", id26); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); + }, "extension"); + composition2 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + }, "composition"); + aggregation2 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + }, "aggregation"); + dependency2 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + }, "dependency"); + lollipop2 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); + }, "lollipop"); + point7 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("marker").attr("id", id26 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id26 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + }, "point"); + circle4 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("marker").attr("id", id26 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id26 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); + }, "circle"); + cross2 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("marker").attr("id", id26 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); + elem.append("marker").attr("id", id26 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); + }, "cross"); + barb2 = /* @__PURE__ */ __name((elem, type3, id26) => { + elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); + }, "barb"); + markers2 = { + extension: extension2, + composition: composition2, + aggregation: aggregation2, + dependency: dependency2, + lollipop: lollipop2, + point: point7, + circle: circle4, + cross: cross2, + barb: barb2 + }; + markers_default2 = insertMarkers4; + } + }); + + // src/dagre-wrapper/mermaid-graphlib.js + var clusterDb2, descendants2, parents2, clear19, isDescendant3, edgeInCluster2, copy3, extractDescendants2, findNonClusterChild2, getAnchorId2, adjustClustersAndEdges2, extractor2, sorter2, sortNodesByHierarchy2; + var init_mermaid_graphlib2 = __esm({ + "src/dagre-wrapper/mermaid-graphlib.js"() { + "use strict"; + init_logger(); + init_json(); + init_graphlib(); + clusterDb2 = {}; + descendants2 = {}; + parents2 = {}; + clear19 = /* @__PURE__ */ __name(() => { + descendants2 = {}; + parents2 = {}; + clusterDb2 = {}; + }, "clear"); + isDescendant3 = /* @__PURE__ */ __name((id26, ancestorId) => { + log.trace("In isDescendant", ancestorId, " ", id26, " = ", descendants2[ancestorId].includes(id26)); + if (descendants2[ancestorId].includes(id26)) { + return true; + } + return false; + }, "isDescendant"); + edgeInCluster2 = /* @__PURE__ */ __name((edge, clusterId) => { + log.info("Descendants of ", clusterId, " is ", descendants2[clusterId]); + log.info("Edge is ", edge); + if (edge.v === clusterId) { + return false; + } + if (edge.w === clusterId) { + return false; + } + if (!descendants2[clusterId]) { + log.debug("Tilt, ", clusterId, ",not in descendants"); + return false; + } + return descendants2[clusterId].includes(edge.v) || isDescendant3(edge.v, clusterId) || isDescendant3(edge.w, clusterId) || descendants2[clusterId].includes(edge.w); + }, "edgeInCluster"); + copy3 = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => { + log.warn( + "Copying children of ", + clusterId, + "root", + rootId, + "data", + graph.node(clusterId), + rootId + ); + const nodes6 = graph.children(clusterId) || []; + if (clusterId !== rootId) { + nodes6.push(clusterId); + } + log.warn("Copying (nodes) clusterId", clusterId, "nodes", nodes6); + nodes6.forEach((node2) => { + if (graph.children(node2).length > 0) { + copy3(node2, graph, newGraph, rootId); + } else { + const data5 = graph.node(node2); + log.info("cp ", node2, " to ", rootId, " with parent ", clusterId); + newGraph.setNode(node2, data5); + if (rootId !== graph.parent(node2)) { + log.warn("Setting parent", node2, graph.parent(node2)); + newGraph.setParent(node2, graph.parent(node2)); + } + if (clusterId !== rootId && node2 !== clusterId) { + log.debug("Setting parent", node2, clusterId); + newGraph.setParent(node2, clusterId); + } else { + log.info("In copy ", clusterId, "root", rootId, "data", graph.node(clusterId), rootId); + log.debug( + "Not Setting parent for node=", + node2, + "cluster!==rootId", + clusterId !== rootId, + "node!==clusterId", + node2 !== clusterId + ); } - function oue(a) { - this.a = new Dte(a); - } - function Dte(a) { - Cte(this, a, sse()); - } - function cve(a) { - return !a || bve(a); - } - function Cqe(a) { - return xqe[a] != -1; - } - function Yz() { - Nz != 0 && (Nz = 0); - Pz = -1; - } - function beb() { - _db == null && (_db = []); - } - function eg(a, b) { - zf.call(this, a, b); - } - function gg(a, b) { - eg.call(this, a, b); - } - function Nj(a, b) { - this.a = a; - this.b = b; + const edges5 = graph.edges(node2); + log.debug("Copying Edges", edges5); + edges5.forEach((edge) => { + log.info("Edge", edge); + const data6 = graph.edge(edge.v, edge.w, edge.name); + log.info("Edge data", data6, rootId); + try { + if (edgeInCluster2(edge, rootId)) { + log.info("Copying as ", edge.v, edge.w, data6, edge.name); + newGraph.setEdge(edge.v, edge.w, data6, edge.name); + log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0])); + } else { + log.info( + "Skipping copy of edge ", + edge.v, + "-->", + edge.w, + " rootId: ", + rootId, + " clusterId:", + clusterId + ); + } + } catch (e3) { + log.error(e3); + } + }); + } + log.debug("Removing node", node2); + graph.removeNode(node2); + }); + }, "copy"); + extractDescendants2 = /* @__PURE__ */ __name((id26, graph) => { + const children2 = graph.children(id26); + let res = [...children2]; + for (const child of children2) { + parents2[child] = id26; + res = [...res, ...extractDescendants2(child, graph)]; + } + return res; + }, "extractDescendants"); + findNonClusterChild2 = /* @__PURE__ */ __name((id26, graph) => { + log.trace("Searching", id26); + const children2 = graph.children(id26); + log.trace("Searching children of id ", id26, children2); + if (children2.length < 1) { + log.trace("This is a valid node", id26); + return id26; + } + for (const child of children2) { + const _id = findNonClusterChild2(child, graph); + if (_id) { + log.trace("Found replacement for", id26, " => ", _id); + return _id; + } + } + }, "findNonClusterChild"); + getAnchorId2 = /* @__PURE__ */ __name((id26) => { + if (!clusterDb2[id26]) { + return id26; + } + if (!clusterDb2[id26].externalConnections) { + return id26; + } + if (clusterDb2[id26]) { + return clusterDb2[id26].id; + } + return id26; + }, "getAnchorId"); + adjustClustersAndEdges2 = /* @__PURE__ */ __name((graph, depth) => { + if (!graph || depth > 10) { + log.debug("Opting out, no graph "); + return; + } else { + log.debug("Opting in, graph "); + } + graph.nodes().forEach(function(id26) { + const children2 = graph.children(id26); + if (children2.length > 0) { + log.warn( + "Cluster identified", + id26, + " Replacement id in edges: ", + findNonClusterChild2(id26, graph) + ); + descendants2[id26] = extractDescendants2(id26, graph); + clusterDb2[id26] = { id: findNonClusterChild2(id26, graph), clusterData: graph.node(id26) }; + } + }); + graph.nodes().forEach(function(id26) { + const children2 = graph.children(id26); + const edges5 = graph.edges(); + if (children2.length > 0) { + log.debug("Cluster identified", id26, descendants2); + edges5.forEach((edge) => { + if (edge.v !== id26 && edge.w !== id26) { + const d1 = isDescendant3(edge.v, id26); + const d2 = isDescendant3(edge.w, id26); + if (d1 ^ d2) { + log.warn("Edge: ", edge, " leaves cluster ", id26); + log.warn("Descendants of XXX ", id26, ": ", descendants2[id26]); + clusterDb2[id26].externalConnections = true; + } + } + }); + } else { + log.debug("Not a cluster ", id26, descendants2); + } + }); + for (let id26 of Object.keys(clusterDb2)) { + const nonClusterChild = clusterDb2[id26].id; + const parent4 = graph.parent(nonClusterChild); + if (parent4 !== id26 && clusterDb2[parent4] && !clusterDb2[parent4].externalConnections) { + clusterDb2[id26].id = parent4; + } + } + graph.edges().forEach(function(e3) { + const edge = graph.edge(e3); + log.warn("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3)); + log.warn("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(graph.edge(e3))); + let v3 = e3.v; + let w3 = e3.w; + log.warn( + "Fix XXX", + clusterDb2, + "ids:", + e3.v, + e3.w, + "Translating: ", + clusterDb2[e3.v], + " --- ", + clusterDb2[e3.w] + ); + if (clusterDb2[e3.v] && clusterDb2[e3.w] && clusterDb2[e3.v] === clusterDb2[e3.w]) { + log.warn("Fixing and trixing link to self - removing XXX", e3.v, e3.w, e3.name); + log.warn("Fixing and trixing - removing XXX", e3.v, e3.w, e3.name); + v3 = getAnchorId2(e3.v); + w3 = getAnchorId2(e3.w); + graph.removeEdge(e3.v, e3.w, e3.name); + const specialId = e3.w + "---" + e3.v; + graph.setNode(specialId, { + domId: specialId, + id: specialId, + labelStyle: "", + labelText: edge.label, + padding: 0, + shape: "labelRect", + style: "" + }); + const edge1 = structuredClone(edge); + const edge2 = structuredClone(edge); + edge1.label = ""; + edge1.arrowTypeEnd = "none"; + edge2.label = ""; + edge1.fromCluster = e3.v; + edge2.toCluster = e3.v; + graph.setEdge(v3, specialId, edge1, e3.name + "-cyclic-special"); + graph.setEdge(specialId, w3, edge2, e3.name + "-cyclic-special"); + } else if (clusterDb2[e3.v] || clusterDb2[e3.w]) { + log.warn("Fixing and trixing - removing XXX", e3.v, e3.w, e3.name); + v3 = getAnchorId2(e3.v); + w3 = getAnchorId2(e3.w); + graph.removeEdge(e3.v, e3.w, e3.name); + if (v3 !== e3.v) { + const parent4 = graph.parent(v3); + clusterDb2[parent4].externalConnections = true; + edge.fromCluster = e3.v; + } + if (w3 !== e3.w) { + const parent4 = graph.parent(w3); + clusterDb2[parent4].externalConnections = true; + edge.toCluster = e3.w; + } + log.warn("Fix Replacing with XXX", v3, w3, e3.name); + graph.setEdge(v3, w3, edge, e3.name); + } + }); + log.warn("Adjusted Graph", write(graph)); + extractor2(graph, 0); + log.trace(clusterDb2); + }, "adjustClustersAndEdges"); + extractor2 = /* @__PURE__ */ __name((graph, depth) => { + log.warn("extractor - ", depth, write(graph), graph.children("D")); + if (depth > 10) { + log.error("Bailing out"); + return; + } + let nodes6 = graph.nodes(); + let hasChildren = false; + for (const node2 of nodes6) { + const children2 = graph.children(node2); + hasChildren = hasChildren || children2.length > 0; + } + if (!hasChildren) { + log.debug("Done, no node has children", graph.nodes()); + return; + } + log.debug("Nodes = ", nodes6, depth); + for (const node2 of nodes6) { + log.debug( + "Extracting node", + node2, + clusterDb2, + clusterDb2[node2] && !clusterDb2[node2].externalConnections, + !graph.parent(node2), + graph.node(node2), + graph.children("D"), + " Depth ", + depth + ); + if (!clusterDb2[node2]) { + log.debug("Not a cluster", node2, depth); + } else if (!clusterDb2[node2].externalConnections && // !graph.parent(node) && + graph.children(node2) && graph.children(node2).length > 0) { + log.warn( + "Cluster without external connections, without a parent and with children", + node2, + depth + ); + const graphSettings = graph.graph(); + let dir2 = graphSettings.rankdir === "TB" ? "LR" : "TB"; + if (clusterDb2[node2]?.clusterData?.dir) { + dir2 = clusterDb2[node2].clusterData.dir; + log.warn("Fixing dir", clusterDb2[node2].clusterData.dir, dir2); + } + const clusterGraph = new Graph({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: dir2, + // Todo: set proper spacing + nodesep: 50, + ranksep: 50, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function() { + return {}; + }); + log.warn("Old graph before copy", write(graph)); + copy3(node2, graph, clusterGraph, node2); + graph.setNode(node2, { + clusterNode: true, + id: node2, + clusterData: clusterDb2[node2].clusterData, + labelText: clusterDb2[node2].labelText, + graph: clusterGraph + }); + log.warn("New graph after copy node: (", node2, ")", write(clusterGraph)); + log.debug("Old graph after copy", write(graph)); + } else { + log.warn( + "Cluster ** ", + node2, + " **not meeting the criteria !externalConnections:", + !clusterDb2[node2].externalConnections, + " no parent: ", + !graph.parent(node2), + " children ", + graph.children(node2) && graph.children(node2).length > 0, + graph.children("D"), + depth + ); + log.debug(clusterDb2); + } + } + nodes6 = graph.nodes(); + log.warn("New list of nodes", nodes6); + for (const node2 of nodes6) { + const data5 = graph.node(node2); + log.warn(" Now next level", node2, data5); + if (data5.clusterNode) { + extractor2(data5.graph, depth + 1); + } + } + }, "extractor"); + sorter2 = /* @__PURE__ */ __name((graph, nodes6) => { + if (nodes6.length === 0) { + return []; + } + let result = Object.assign(nodes6); + nodes6.forEach((node2) => { + const children2 = graph.children(node2); + const sorted = sorter2(graph, children2); + result = [...result, ...sorted]; + }); + return result; + }, "sorter"); + sortNodesByHierarchy2 = /* @__PURE__ */ __name((graph) => sorter2(graph, graph.children()), "sortNodesByHierarchy"); + } + }); + + // src/dagre-wrapper/clusters.js + var rect3, noteGroup2, roundedWithTitle2, divider2, shapes4, clusterElems2, insertCluster2, clear20; + var init_clusters2 = __esm({ + "src/dagre-wrapper/clusters.js"() { + "use strict"; + init_intersect_rect(); + init_logger(); + init_createLabel(); + init_createText(); + init_src32(); + init_diagramAPI(); + init_common(); + init_subGraphTitleMargins(); + rect3 = /* @__PURE__ */ __name((parent4, node2) => { + log.info("Creating subgraph rect for ", node2.id, node2); + const siteConfig2 = getConfig2(); + const shapeSvg = parent4.insert("g").attr("class", "cluster" + (node2.class ? " " + node2.class : "")).attr("id", node2.id); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const useHtmlLabels = evaluate(siteConfig2.flowchart.htmlLabels); + const label = shapeSvg.insert("g").attr("class", "cluster-label"); + const text2 = node2.labelType === "markdown" ? createText(label, node2.labelText, { style: node2.labelStyle, useHtmlLabels }, siteConfig2) : label.node().appendChild(createLabel_default(node2.labelText, node2.labelStyle, void 0, true)); + let bbox = text2.getBBox(); + if (evaluate(siteConfig2.flowchart.htmlLabels)) { + const div = text2.children[0]; + const dv = select_default2(text2); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + const padding3 = 0 * node2.padding; + const halfPadding = padding3 / 2; + const width3 = node2.width <= bbox.width + padding3 ? bbox.width + padding3 : node2.width; + if (node2.width <= bbox.width + padding3) { + node2.diff = (bbox.width - node2.width) / 2 - node2.padding / 2; + } else { + node2.diff = -node2.padding / 2; + } + log.trace("Data ", node2, JSON.stringify(node2)); + rect4.attr("style", node2.style).attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - width3 / 2).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", width3).attr("height", node2.height + padding3); + const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2); + if (useHtmlLabels) { + label.attr( + "transform", + // This puts the label on top of the box instead of inside it + `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})` + ); + } else { + label.attr( + "transform", + // This puts the label on top of the box instead of inside it + `translate(${node2.x}, ${node2.y - node2.height / 2 + subGraphTitleTopMargin})` + ); + } + const rectBox = rect4.node().getBBox(); + node2.width = rectBox.width; + node2.height = rectBox.height; + node2.intersect = function(point8) { + return intersect_rect_default(node2, point8); + }; + return shapeSvg; + }, "rect"); + noteGroup2 = /* @__PURE__ */ __name((parent4, node2) => { + const shapeSvg = parent4.insert("g").attr("class", "note-cluster").attr("id", node2.id); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const padding3 = 0 * node2.padding; + const halfPadding = padding3 / 2; + rect4.attr("rx", node2.rx).attr("ry", node2.ry).attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", node2.width + padding3).attr("height", node2.height + padding3).attr("fill", "none"); + const rectBox = rect4.node().getBBox(); + node2.width = rectBox.width; + node2.height = rectBox.height; + node2.intersect = function(point8) { + return intersect_rect_default(node2, point8); + }; + return shapeSvg; + }, "noteGroup"); + roundedWithTitle2 = /* @__PURE__ */ __name((parent4, node2) => { + const siteConfig2 = getConfig2(); + const shapeSvg = parent4.insert("g").attr("class", node2.classes).attr("id", node2.id); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const label = shapeSvg.insert("g").attr("class", "cluster-label"); + const innerRect = shapeSvg.append("rect"); + const text2 = label.node().appendChild(createLabel_default(node2.labelText, node2.labelStyle, void 0, true)); + let bbox = text2.getBBox(); + if (evaluate(siteConfig2.flowchart.htmlLabels)) { + const div = text2.children[0]; + const dv = select_default2(text2); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + bbox = text2.getBBox(); + const padding3 = 0 * node2.padding; + const halfPadding = padding3 / 2; + const width3 = node2.width <= bbox.width + node2.padding ? bbox.width + node2.padding : node2.width; + if (node2.width <= bbox.width + node2.padding) { + node2.diff = (bbox.width + node2.padding * 0 - node2.width) / 2; + } else { + node2.diff = -node2.padding / 2; + } + rect4.attr("class", "outer").attr("x", node2.x - width3 / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding).attr("width", width3 + padding3).attr("height", node2.height + padding3); + innerRect.attr("class", "inner").attr("x", node2.x - width3 / 2 - halfPadding).attr("y", node2.y - node2.height / 2 - halfPadding + bbox.height - 1).attr("width", width3 + padding3).attr("height", node2.height + padding3 - bbox.height - 3); + const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig2); + label.attr( + "transform", + `translate(${node2.x - bbox.width / 2}, ${node2.y - node2.height / 2 - node2.padding / 3 + (evaluate(siteConfig2.flowchart.htmlLabels) ? 5 : 3) + subGraphTitleTopMargin})` + ); + const rectBox = rect4.node().getBBox(); + node2.height = rectBox.height; + node2.intersect = function(point8) { + return intersect_rect_default(node2, point8); + }; + return shapeSvg; + }, "roundedWithTitle"); + divider2 = /* @__PURE__ */ __name((parent4, node2) => { + const shapeSvg = parent4.insert("g").attr("class", node2.classes).attr("id", node2.id); + const rect4 = shapeSvg.insert("rect", ":first-child"); + const padding3 = 0 * node2.padding; + const halfPadding = padding3 / 2; + rect4.attr("class", "divider").attr("x", node2.x - node2.width / 2 - halfPadding).attr("y", node2.y - node2.height / 2).attr("width", node2.width + padding3).attr("height", node2.height + padding3); + const rectBox = rect4.node().getBBox(); + node2.width = rectBox.width; + node2.height = rectBox.height; + node2.diff = -node2.padding / 2; + node2.intersect = function(point8) { + return intersect_rect_default(node2, point8); + }; + return shapeSvg; + }, "divider"); + shapes4 = { rect: rect3, roundedWithTitle: roundedWithTitle2, noteGroup: noteGroup2, divider: divider2 }; + clusterElems2 = {}; + insertCluster2 = /* @__PURE__ */ __name((elem, node2) => { + log.trace("Inserting cluster"); + const shape = node2.shape || "rect"; + clusterElems2[node2.id] = shapes4[shape](elem, node2); + }, "insertCluster"); + clear20 = /* @__PURE__ */ __name(() => { + clusterElems2 = {}; + }, "clear"); + } + }); + + // src/dagre-wrapper/edgeMarker.ts + var addEdgeMarkers2, arrowTypesMap2, addEdgeMarker2; + var init_edgeMarker2 = __esm({ + "src/dagre-wrapper/edgeMarker.ts"() { + "use strict"; + init_logger(); + addEdgeMarkers2 = /* @__PURE__ */ __name((svgPath, edge, url, id26, diagramType) => { + if (edge.arrowTypeStart) { + addEdgeMarker2(svgPath, "start", edge.arrowTypeStart, url, id26, diagramType); + } + if (edge.arrowTypeEnd) { + addEdgeMarker2(svgPath, "end", edge.arrowTypeEnd, url, id26, diagramType); + } + }, "addEdgeMarkers"); + arrowTypesMap2 = { + arrow_cross: "cross", + arrow_point: "point", + arrow_barb: "barb", + arrow_circle: "circle", + aggregation: "aggregation", + extension: "extension", + composition: "composition", + dependency: "dependency", + lollipop: "lollipop" + }; + addEdgeMarker2 = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id26, diagramType) => { + const endMarkerType = arrowTypesMap2[arrowType]; + if (!endMarkerType) { + log.warn(`Unknown arrow type: ${arrowType}`); + return; + } + const suffix = position5 === "start" ? "Start" : "End"; + svgPath.attr(`marker-${position5}`, `url(${url}#${id26}_${diagramType}-${endMarkerType}${suffix})`); + }, "addEdgeMarker"); + } + }); + + // src/dagre-wrapper/edges.js + function setTerminalWidth2(fo, value2) { + if (getConfig2().flowchart.htmlLabels && fo) { + fo.style.width = value2.length * 9 + "px"; + fo.style.height = "12px"; + } + } + var edgeLabels2, terminalLabels2, clear21, insertEdgeLabel2, positionEdgeLabel2, outsideNode2, intersection2, cutPathAtIntersect2, insertEdge2; + var init_edges2 = __esm({ + "src/dagre-wrapper/edges.js"() { + "use strict"; + init_logger(); + init_createLabel(); + init_createText(); + init_src32(); + init_diagramAPI(); + init_utils2(); + init_common(); + init_lineWithOffset(); + init_subGraphTitleMargins(); + init_edgeMarker2(); + edgeLabels2 = {}; + terminalLabels2 = {}; + clear21 = /* @__PURE__ */ __name(() => { + edgeLabels2 = {}; + terminalLabels2 = {}; + }, "clear"); + insertEdgeLabel2 = /* @__PURE__ */ __name((elem, edge) => { + const config6 = getConfig2(); + const useHtmlLabels = evaluate(config6.flowchart.htmlLabels); + const labelElement = edge.labelType === "markdown" ? createText( + elem, + edge.label, + { + style: edge.labelStyle, + useHtmlLabels, + addSvgBackground: true + }, + config6 + ) : createLabel_default(edge.label, edge.labelStyle); + const edgeLabel = elem.insert("g").attr("class", "edgeLabel"); + const label = edgeLabel.insert("g").attr("class", "label"); + label.node().appendChild(labelElement); + let bbox = labelElement.getBBox(); + if (useHtmlLabels) { + const div = labelElement.children[0]; + const dv = select_default2(labelElement); + bbox = div.getBoundingClientRect(); + dv.attr("width", bbox.width); + dv.attr("height", bbox.height); + } + label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")"); + edgeLabels2[edge.id] = edgeLabel; + edge.width = bbox.width; + edge.height = bbox.height; + let fo; + if (edge.startLabelLeft) { + const startLabelElement = createLabel_default(edge.startLabelLeft, edge.labelStyle); + const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = startEdgeLabelLeft.insert("g").attr("class", "inner"); + fo = inner2.node().appendChild(startLabelElement); + const slBox = startLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + if (!terminalLabels2[edge.id]) { + terminalLabels2[edge.id] = {}; + } + terminalLabels2[edge.id].startLeft = startEdgeLabelLeft; + setTerminalWidth2(fo, edge.startLabelLeft); + } + if (edge.startLabelRight) { + const startLabelElement = createLabel_default(edge.startLabelRight, edge.labelStyle); + const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = startEdgeLabelRight.insert("g").attr("class", "inner"); + fo = startEdgeLabelRight.node().appendChild(startLabelElement); + inner2.node().appendChild(startLabelElement); + const slBox = startLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + if (!terminalLabels2[edge.id]) { + terminalLabels2[edge.id] = {}; + } + terminalLabels2[edge.id].startRight = startEdgeLabelRight; + setTerminalWidth2(fo, edge.startLabelRight); + } + if (edge.endLabelLeft) { + const endLabelElement = createLabel_default(edge.endLabelLeft, edge.labelStyle); + const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = endEdgeLabelLeft.insert("g").attr("class", "inner"); + fo = inner2.node().appendChild(endLabelElement); + const slBox = endLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + endEdgeLabelLeft.node().appendChild(endLabelElement); + if (!terminalLabels2[edge.id]) { + terminalLabels2[edge.id] = {}; + } + terminalLabels2[edge.id].endLeft = endEdgeLabelLeft; + setTerminalWidth2(fo, edge.endLabelLeft); + } + if (edge.endLabelRight) { + const endLabelElement = createLabel_default(edge.endLabelRight, edge.labelStyle); + const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals"); + const inner2 = endEdgeLabelRight.insert("g").attr("class", "inner"); + fo = inner2.node().appendChild(endLabelElement); + const slBox = endLabelElement.getBBox(); + inner2.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")"); + endEdgeLabelRight.node().appendChild(endLabelElement); + if (!terminalLabels2[edge.id]) { + terminalLabels2[edge.id] = {}; + } + terminalLabels2[edge.id].endRight = endEdgeLabelRight; + setTerminalWidth2(fo, edge.endLabelRight); + } + return labelElement; + }, "insertEdgeLabel"); + __name(setTerminalWidth2, "setTerminalWidth"); + positionEdgeLabel2 = /* @__PURE__ */ __name((edge, paths) => { + log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels2[edge.id], paths); + let path4 = paths.updatedPath ? paths.updatedPath : paths.originalPath; + const siteConfig2 = getConfig2(); + const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2); + if (edge.label) { + const el = edgeLabels2[edge.id]; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcLabelPosition(path4); + log.debug( + "Moving label " + edge.label + " from (", + x5, + ",", + y5, + ") to (", + pos.x, + ",", + pos.y, + ") abc88" + ); + if (paths.updatedPath) { + x5 = pos.x; + y5 = pos.y; + } + } + el.attr("transform", `translate(${x5}, ${y5 + subGraphTitleTotalMargin / 2})`); + } + if (edge.startLabelLeft) { + const el = terminalLabels2[edge.id].startLeft; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path4); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + if (edge.startLabelRight) { + const el = terminalLabels2[edge.id].startRight; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition( + edge.arrowTypeStart ? 10 : 0, + "start_right", + path4 + ); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + if (edge.endLabelLeft) { + const el = terminalLabels2[edge.id].endLeft; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path4); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + if (edge.endLabelRight) { + const el = terminalLabels2[edge.id].endRight; + let x5 = edge.x; + let y5 = edge.y; + if (path4) { + const pos = utils_default2.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path4); + x5 = pos.x; + y5 = pos.y; + } + el.attr("transform", `translate(${x5}, ${y5})`); + } + }, "positionEdgeLabel"); + outsideNode2 = /* @__PURE__ */ __name((node2, point8) => { + const x5 = node2.x; + const y5 = node2.y; + const dx = Math.abs(point8.x - x5); + const dy = Math.abs(point8.y - y5); + const w3 = node2.width / 2; + const h2 = node2.height / 2; + if (dx >= w3 || dy >= h2) { + return true; + } + return false; + }, "outsideNode"); + intersection2 = /* @__PURE__ */ __name((node2, outsidePoint, insidePoint) => { + log.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(outsidePoint)} + insidePoint : ${JSON.stringify(insidePoint)} + node : x:${node2.x} y:${node2.y} w:${node2.width} h:${node2.height}`); + const x5 = node2.x; + const y5 = node2.y; + const dx = Math.abs(x5 - insidePoint.x); + const w3 = node2.width / 2; + let r2 = insidePoint.x < outsidePoint.x ? w3 - dx : w3 + dx; + const h2 = node2.height / 2; + const Q2 = Math.abs(outsidePoint.y - insidePoint.y); + const R2 = Math.abs(outsidePoint.x - insidePoint.x); + if (Math.abs(y5 - outsidePoint.y) * w3 > Math.abs(x5 - outsidePoint.x) * h2) { + let q2 = insidePoint.y < outsidePoint.y ? outsidePoint.y - h2 - y5 : y5 - h2 - outsidePoint.y; + r2 = R2 * q2 / Q2; + const res = { + x: insidePoint.x < outsidePoint.x ? insidePoint.x + r2 : insidePoint.x - R2 + r2, + y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q2 - q2 : insidePoint.y - Q2 + q2 + }; + if (r2 === 0) { + res.x = outsidePoint.x; + res.y = outsidePoint.y; + } + if (R2 === 0) { + res.x = outsidePoint.x; + } + if (Q2 === 0) { + res.y = outsidePoint.y; + } + log.debug(`abc89 topp/bott calc, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, res); + return res; + } else { + if (insidePoint.x < outsidePoint.x) { + r2 = outsidePoint.x - w3 - x5; + } else { + r2 = x5 - w3 - outsidePoint.x; + } + let q2 = Q2 * r2 / R2; + let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R2 - r2 : insidePoint.x - R2 + r2; + let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q2 : insidePoint.y - q2; + log.debug(`sides calc abc89, Q ${Q2}, q ${q2}, R ${R2}, r ${r2}`, { _x, _y }); + if (r2 === 0) { + _x = outsidePoint.x; + _y = outsidePoint.y; + } + if (R2 === 0) { + _x = outsidePoint.x; + } + if (Q2 === 0) { + _y = outsidePoint.y; + } + return { x: _x, y: _y }; + } + }, "intersection"); + cutPathAtIntersect2 = /* @__PURE__ */ __name((_points, boundaryNode) => { + log.debug("abc88 cutPathAtIntersect", _points, boundaryNode); + let points = []; + let lastPointOutside = _points[0]; + let isInside = false; + _points.forEach((point8) => { + if (!outsideNode2(boundaryNode, point8) && !isInside) { + const inter = intersection2(boundaryNode, lastPointOutside, point8); + let pointPresent = false; + points.forEach((p3) => { + pointPresent = pointPresent || p3.x === inter.x && p3.y === inter.y; + }); + if (!points.some((e3) => e3.x === inter.x && e3.y === inter.y)) { + points.push(inter); } - function hk(a, b) { - this.a = a; - this.b = b; + isInside = true; + } else { + lastPointOutside = point8; + if (!isInside) { + points.push(point8); } - function nk(a, b) { - this.a = a; - this.b = b; + } + }); + return points; + }, "cutPathAtIntersect"); + insertEdge2 = /* @__PURE__ */ __name(function(elem, e3, edge, clusterDb3, diagramType, graph, id26) { + let points = edge.points; + log.debug("abc88 InsertEdge: edge=", edge, "e=", e3); + let pointsHasChanged = false; + const tail = graph.node(e3.v); + var head2 = graph.node(e3.w); + if (head2?.intersect && tail?.intersect) { + points = points.slice(1, edge.points.length - 1); + points.unshift(tail.intersect(points[0])); + points.push(head2.intersect(points[points.length - 1])); + } + if (edge.toCluster) { + log.debug("to cluster abc88", clusterDb3[edge.toCluster]); + points = cutPathAtIntersect2(edge.points, clusterDb3[edge.toCluster].node); + pointsHasChanged = true; + } + if (edge.fromCluster) { + log.debug("from cluster abc88", clusterDb3[edge.fromCluster]); + points = cutPathAtIntersect2(points.reverse(), clusterDb3[edge.fromCluster].node).reverse(); + pointsHasChanged = true; + } + const lineData = points.filter((p3) => !Number.isNaN(p3.y)); + let curve = basis_default2; + if (edge.curve && (diagramType === "graph" || diagramType === "flowchart")) { + curve = edge.curve; + } + const { x: x5, y: y5 } = getLineFunctionsWithOffset(edge); + const lineFunction = line_default().x(x5).y(y5).curve(curve); + let strokeClasses; + switch (edge.thickness) { + case "normal": + strokeClasses = "edge-thickness-normal"; + break; + case "thick": + strokeClasses = "edge-thickness-thick"; + break; + case "invisible": + strokeClasses = "edge-thickness-thick"; + break; + default: + strokeClasses = ""; + } + switch (edge.pattern) { + case "solid": + strokeClasses += " edge-pattern-solid"; + break; + case "dotted": + strokeClasses += " edge-pattern-dotted"; + break; + case "dashed": + strokeClasses += " edge-pattern-dashed"; + break; + } + const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style); + let url = ""; + if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) { + url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, "\\("); + url = url.replace(/\)/g, "\\)"); + } + addEdgeMarkers2(svgPath, edge, url, id26, diagramType); + let paths = {}; + if (pointsHasChanged) { + paths.updatedPath = points; + } + paths.originalPath = edge.points; + return paths; + }, "insertEdge"); + } + }); + + // src/dagre-wrapper/index.js + var recursiveRender2, render5; + var init_dagre_wrapper = __esm({ + "src/dagre-wrapper/index.js"() { + "use strict"; + init_dagre(); + init_json(); + init_markers2(); + init_util(); + init_mermaid_graphlib2(); + init_nodes2(); + init_clusters2(); + init_edges2(); + init_logger(); + init_subGraphTitleMargins(); + init_diagramAPI(); + recursiveRender2 = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id26, parentCluster, siteConfig2) => { + log.info("Graph in recursive render: XXX", write(graph), parentCluster); + const dir2 = graph.graph().rankdir; + log.trace("Dir in recursive render - dir:", dir2); + const elem = _elem.insert("g").attr("class", "root"); + if (!graph.nodes()) { + log.info("No nodes found for", graph); + } else { + log.info("Recursive render XXX", graph.nodes()); + } + if (graph.edges().length > 0) { + log.trace("Recursive edges", graph.edge(graph.edges()[0])); + } + const clusters = elem.insert("g").attr("class", "clusters"); + const edgePaths = elem.insert("g").attr("class", "edgePaths"); + const edgeLabels3 = elem.insert("g").attr("class", "edgeLabels"); + const nodes6 = elem.insert("g").attr("class", "nodes"); + await Promise.all( + graph.nodes().map(async function(v3) { + const node2 = graph.node(v3); + if (parentCluster !== void 0) { + const data5 = JSON.parse(JSON.stringify(parentCluster.clusterData)); + log.info("Setting data for cluster XXX (", v3, ") ", data5, parentCluster); + graph.setNode(parentCluster.id, data5); + if (!graph.parent(v3)) { + log.trace("Setting parent", v3, parentCluster.id); + graph.setParent(v3, parentCluster.id, data5); + } + } + log.info("(Insert) Node XXX" + v3 + ": " + JSON.stringify(graph.node(v3))); + if (node2?.clusterNode) { + log.info("Cluster identified", v3, node2.width, graph.node(v3)); + const { ranksep, nodesep } = graph.graph(); + node2.graph.setGraph({ + ...node2.graph.graph(), + ranksep, + nodesep + }); + const o2 = await recursiveRender2( + nodes6, + node2.graph, + diagramType, + id26, + graph.node(v3), + siteConfig2 + ); + const newEl = o2.elem; + updateNodeBounds(node2, newEl); + node2.diff = o2.diff || 0; + log.info("Node bounds (abc123)", v3, node2, node2.width, node2.x, node2.y); + setNodeElem(newEl, node2); + log.warn("Recursive render complete ", newEl, node2); + } else { + if (graph.children(v3).length > 0) { + log.info("Cluster - the non recursive path XXX", v3, node2.id, node2, graph); + log.info(findNonClusterChild2(node2.id, graph)); + clusterDb2[node2.id] = { id: findNonClusterChild2(node2.id, graph), node: node2 }; + } else { + log.info("Node - the non recursive path", v3, node2.id, node2); + await insertNode(nodes6, graph.node(v3), dir2); + } } - function pk(a, b) { - this.a = a; - this.b = b; + }) + ); + graph.edges().forEach(async function(e3) { + const edge = graph.edge(e3.v, e3.w, e3.name); + log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3)); + log.info("Edge " + e3.v + " -> " + e3.w + ": ", e3, " ", JSON.stringify(graph.edge(e3))); + log.info("Fix", clusterDb2, "ids:", e3.v, e3.w, "Translating: ", clusterDb2[e3.v], clusterDb2[e3.w]); + await insertEdgeLabel2(edgeLabels3, edge); + }); + graph.edges().forEach(function(e3) { + log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(e3)); + }); + log.info("Graph before layout:", JSON.stringify(write(graph))); + log.info("#############################################"); + log.info("### Layout ###"); + log.info("#############################################"); + log.info(graph); + layout(graph); + log.info("Graph after layout:", JSON.stringify(write(graph))); + let diff2 = 0; + const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig2); + sortNodesByHierarchy2(graph).forEach(function(v3) { + const node2 = graph.node(v3); + log.info("Position " + v3 + ": " + JSON.stringify(graph.node(v3))); + log.info( + "Position " + v3 + ": (" + node2.x, + "," + node2.y, + ") width: ", + node2.width, + " height: ", + node2.height + ); + if (node2?.clusterNode) { + node2.y += subGraphTitleTotalMargin; + positionNode(node2); + } else { + if (graph.children(v3).length > 0) { + node2.height += subGraphTitleTotalMargin; + insertCluster2(clusters, node2); + clusterDb2[node2.id].node = node2; + } else { + node2.y += subGraphTitleTotalMargin / 2; + positionNode(node2); } - function xk(a, b) { - this.a = a; - this.b = b; + } + }); + graph.edges().forEach(function(e3) { + const edge = graph.edge(e3); + log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(edge), edge); + edge.points.forEach((point8) => point8.y += subGraphTitleTotalMargin / 2); + const paths = insertEdge2(edgePaths, e3, edge, clusterDb2, diagramType, graph, id26); + positionEdgeLabel2(edge, paths); + }); + graph.nodes().forEach(function(v3) { + const n2 = graph.node(v3); + log.info(v3, n2.type, n2.diff); + if (n2.type === "group") { + diff2 = n2.diff; + } + }); + return { elem, diff: diff2 }; + }, "recursiveRender"); + render5 = /* @__PURE__ */ __name(async (elem, graph, markers3, diagramType, id26) => { + markers_default2(elem, markers3, diagramType, id26); + clear4(); + clear21(); + clear20(); + clear19(); + log.warn("Graph at first:", JSON.stringify(write(graph))); + adjustClustersAndEdges2(graph); + log.warn("Graph after:", JSON.stringify(write(graph))); + const siteConfig2 = getConfig2(); + await recursiveRender2(elem, graph, diagramType, id26, void 0, siteConfig2); + }, "render"); + } + }); + + // src/diagrams/class/classRenderer-v2.ts + function getArrowMarker(type3) { + let marker; + switch (type3) { + case 0: + marker = "aggregation"; + break; + case 1: + marker = "extension"; + break; + case 2: + marker = "composition"; + break; + case 3: + marker = "dependency"; + break; + case 4: + marker = "lollipop"; + break; + default: + marker = "none"; + } + return marker; + } + var sanitizeText6, conf5, addNamespaces, addClasses, addNotes, addRelations, setConf5, draw13, classRenderer_v2_default; + var init_classRenderer_v2 = __esm({ + "src/diagrams/class/classRenderer-v2.ts"() { + "use strict"; + init_src32(); + init_graphlib(); + init_logger(); + init_diagramAPI(); + init_dagre_wrapper(); + init_utils2(); + init_utils2(); + init_setupGraphViewbox(); + init_common(); + sanitizeText6 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText"); + conf5 = { + dividerMargin: 10, + padding: 5, + textHeight: 10, + curve: void 0 + }; + addNamespaces = /* @__PURE__ */ __name(function(namespaces2, g2, _id, diagObj) { + log.info("keys:", [...namespaces2.keys()]); + log.info(namespaces2); + namespaces2.forEach(function(vertex) { + const shape = "rect"; + const node2 = { + shape, + id: vertex.id, + domId: vertex.domId, + labelText: sanitizeText6(vertex.id), + labelStyle: "", + style: "fill: none; stroke: black", + // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release + padding: getConfig2().flowchart?.padding ?? getConfig2().class?.padding + }; + g2.setNode(vertex.id, node2); + addClasses(vertex.classes, g2, _id, diagObj, vertex.id); + log.info("setNode", node2); + }); + }, "addNamespaces"); + addClasses = /* @__PURE__ */ __name(function(classes6, g2, _id, diagObj, parent4) { + log.info("keys:", [...classes6.keys()]); + log.info(classes6); + [...classes6.values()].filter((vertex) => vertex.parent === parent4).forEach(function(vertex) { + const cssClassStr = vertex.cssClasses.join(" "); + const styles3 = getStylesFromArray(vertex.styles); + const vertexText = vertex.label ?? vertex.id; + const radius2 = 0; + const shape = "class_box"; + const node2 = { + labelStyle: styles3.labelStyle, + shape, + labelText: sanitizeText6(vertexText), + classData: vertex, + rx: radius2, + ry: radius2, + class: cssClassStr, + style: styles3.style, + id: vertex.id, + domId: vertex.domId, + tooltip: diagObj.db.getTooltip(vertex.id, parent4) || "", + haveCallback: vertex.haveCallback, + link: vertex.link, + width: vertex.type === "group" ? 500 : void 0, + type: vertex.type, + // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release + padding: getConfig2().flowchart?.padding ?? getConfig2().class?.padding + }; + g2.setNode(vertex.id, node2); + if (parent4) { + g2.setParent(vertex.id, parent4); + } + log.info("setNode", node2); + }); + }, "addClasses"); + addNotes = /* @__PURE__ */ __name(function(notes2, g2, startEdgeId, classes6) { + log.info(notes2); + notes2.forEach(function(note3, i2) { + const vertex = note3; + const cssNoteStr = ""; + const styles3 = { labelStyle: "", style: "" }; + const vertexText = vertex.text; + const radius2 = 0; + const shape = "note"; + const node2 = { + labelStyle: styles3.labelStyle, + shape, + labelText: sanitizeText6(vertexText), + noteData: vertex, + rx: radius2, + ry: radius2, + class: cssNoteStr, + style: styles3.style, + id: vertex.id, + domId: vertex.id, + tooltip: "", + type: "note", + // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release + padding: getConfig2().flowchart?.padding ?? getConfig2().class?.padding + }; + g2.setNode(vertex.id, node2); + log.info("setNode", node2); + if (!vertex.class || !classes6.has(vertex.class)) { + return; + } + const edgeId = startEdgeId + i2; + const edgeData = { + id: `edgeNote${edgeId}`, + //Set relationship style and line type + classes: "relation", + pattern: "dotted", + // Set link type for rendering + arrowhead: "none", + //Set edge extra labels + startLabelRight: "", + endLabelLeft: "", + //Set relation arrow types + arrowTypeStart: "none", + arrowTypeEnd: "none", + style: "fill:none", + labelStyle: "", + curve: interpolateToCurve(conf5.curve, linear_default) + }; + g2.setEdge(vertex.id, vertex.class, edgeData, edgeId); + }); + }, "addNotes"); + addRelations = /* @__PURE__ */ __name(function(relations3, g2) { + const conf8 = getConfig2().flowchart; + let cnt4 = 0; + relations3.forEach(function(edge) { + cnt4++; + const edgeData = { + //Set relationship style and line type + classes: "relation", + pattern: edge.relation.lineType == 1 ? "dashed" : "solid", + id: getEdgeId(edge.id1, edge.id2, { + prefix: "id", + counter: cnt4 + }), + // Set link type for rendering + arrowhead: edge.type === "arrow_open" ? "none" : "normal", + //Set edge extra labels + startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1, + endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2, + //Set relation arrow types + arrowTypeStart: getArrowMarker(edge.relation.type1), + arrowTypeEnd: getArrowMarker(edge.relation.type2), + style: "fill:none", + labelStyle: "", + curve: interpolateToCurve(conf8?.curve, linear_default) + }; + log.info(edgeData, edge); + if (edge.style !== void 0) { + const styles3 = getStylesFromArray(edge.style); + edgeData.style = styles3.style; + edgeData.labelStyle = styles3.labelStyle; + } + edge.text = edge.title; + if (edge.text === void 0) { + if (edge.style !== void 0) { + edgeData.arrowheadStyle = "fill: #333"; } - function zk(a, b) { - this.a = a; - this.b = b; + } else { + edgeData.arrowheadStyle = "fill: #333"; + edgeData.labelpos = "c"; + if (getConfig2().flowchart?.htmlLabels ?? getConfig2().htmlLabels) { + edgeData.labelType = "html"; + edgeData.label = '' + edge.text + ""; + } else { + edgeData.labelType = "text"; + edgeData.label = edge.text.replace(common_default.lineBreakRegex, "\n"); + if (edge.style === void 0) { + edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none"; + } + edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); } - function Kk(a, b) { - this.a = a; - this.b = b; + } + g2.setEdge(edge.id1, edge.id2, edgeData, cnt4); + }); + }, "addRelations"); + setConf5 = /* @__PURE__ */ __name(function(cnf) { + conf5 = { + ...conf5, + ...cnf + }; + }, "setConf"); + draw13 = /* @__PURE__ */ __name(async function(text2, id26, _version, diagObj) { + log.info("Drawing class - ", id26); + const conf8 = getConfig2().flowchart ?? getConfig2().class; + const securityLevel = getConfig2().securityLevel; + log.info("config:", conf8); + const nodeSpacing = conf8?.nodeSpacing ?? 50; + const rankSpacing = conf8?.rankSpacing ?? 50; + const g2 = new Graph({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: diagObj.db.getDirection(), + nodesep: nodeSpacing, + ranksep: rankSpacing, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function() { + return {}; + }); + const namespaces2 = diagObj.db.getNamespaces(); + const classes6 = diagObj.db.getClasses(); + const relations3 = diagObj.db.getRelations(); + const notes2 = diagObj.db.getNotes(); + log.info(relations3); + addNamespaces(namespaces2, g2, id26, diagObj); + addClasses(classes6, g2, id26, diagObj); + addRelations(relations3, g2); + addNotes(notes2, g2, relations3.length + 1, classes6); + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select(`[id="${id26}"]`); + const element3 = root4.select("#" + id26 + " g"); + await render5( + element3, + g2, + ["aggregation", "extension", "composition", "dependency", "lollipop"], + "classDiagram", + id26 + ); + utils_default2.insertTitle(svg, "classTitleText", conf8?.titleTopMargin ?? 5, diagObj.db.getDiagramTitle()); + setupGraphViewbox(g2, svg, conf8?.diagramPadding, conf8?.useMaxWidth); + if (!conf8?.htmlLabels) { + const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; + const labels = doc.querySelectorAll('[id="' + id26 + '"] .edgeLabel .label'); + for (const label of labels) { + const dim = label.getBBox(); + const rect4 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); + rect4.setAttribute("rx", 0); + rect4.setAttribute("ry", 0); + rect4.setAttribute("width", dim.width); + rect4.setAttribute("height", dim.height); + label.insertBefore(rect4, label.firstChild); + } + } + }, "draw"); + __name(getArrowMarker, "getArrowMarker"); + classRenderer_v2_default = { + setConf: setConf5, + draw: draw13 + }; + } + }); + + // src/diagrams/class/classDiagram-v2.ts + var classDiagram_v2_exports = {}; + __export(classDiagram_v2_exports, { + diagram: () => diagram13 + }); + var diagram13; + var init_classDiagram_v2 = __esm({ + "src/diagrams/class/classDiagram-v2.ts"() { + "use strict"; + init_classDiagram(); + init_classDb(); + init_styles9(); + init_classRenderer_v2(); + diagram13 = { + parser: classDiagram_default, + db: classDb_default, + renderer: classRenderer_v2_default, + styles: styles_default9, + init: /* @__PURE__ */ __name((cnf) => { + if (!cnf.class) { + cnf.class = {}; + } + cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + classDb_default.clear(); + }, "init") + }; + } + }); + + // src/diagrams/state/parser/stateDiagram.jison + var parser14, stateDiagram_default; + var init_stateDiagram = __esm({ + "src/diagrams/state/parser/stateDiagram.jison"() { + "use strict"; + parser14 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 16], $V7 = [1, 17], $V8 = [1, 18], $V9 = [1, 19], $Va = [1, 32], $Vb = [1, 20], $Vc = [1, 21], $Vd = [1, 22], $Ve = [1, 23], $Vf = [1, 24], $Vg = [1, 26], $Vh = [1, 27], $Vi = [1, 28], $Vj = [1, 29], $Vk = [1, 30], $Vl = [1, 31], $Vm = [1, 34], $Vn = [1, 35], $Vo = [1, 36], $Vp = [1, 37], $Vq = [1, 33], $Vr = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vs = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "SPACE": 4, "NL": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "classDefStatement": 10, "styleStatement": 11, "cssClassStatement": 12, "idStatement": 13, "DESCR": 14, "-->": 15, "HIDE_EMPTY": 16, "scale": 17, "WIDTH": 18, "COMPOSIT_STATE": 19, "STRUCT_START": 20, "STRUCT_STOP": 21, "STATE_DESCR": 22, "AS": 23, "ID": 24, "FORK": 25, "JOIN": 26, "CHOICE": 27, "CONCURRENT": 28, "note": 29, "notePosition": 30, "NOTE_TEXT": 31, "direction": 32, "acc_title": 33, "acc_title_value": 34, "acc_descr": 35, "acc_descr_value": 36, "acc_descr_multiline_value": 37, "classDef": 38, "CLASSDEF_ID": 39, "CLASSDEF_STYLEOPTS": 40, "DEFAULT": 41, "style": 42, "STYLE_IDS": 43, "STYLEDEF_STYLEOPTS": 44, "class": 45, "CLASSENTITY_IDS": 46, "STYLECLASS": 47, "direction_tb": 48, "direction_bt": 49, "direction_rl": 50, "direction_lr": 51, "eol": 52, ";": 53, "EDGE_STATE": 54, "STYLE_SEPARATOR": 55, "left_of": 56, "right_of": 57, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "classDef", 39: "CLASSDEF_ID", 40: "CLASSDEF_STYLEOPTS", 41: "DEFAULT", 42: "style", 43: "STYLE_IDS", 44: "STYLEDEF_STYLEOPTS", 45: "class", 46: "CLASSENTITY_IDS", 47: "STYLECLASS", 48: "direction_tb", 49: "direction_bt", 50: "direction_rl", 51: "direction_lr", 53: ";", 54: "EDGE_STATE", 55: "STYLE_SEPARATOR", 56: "left_of", 57: "right_of" }, + productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [52, 1], [52, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 3: + yy.setRootDoc($$[$0]); + return $$[$0]; + break; + case 4: + this.$ = []; + break; + case 5: + if ($$[$0] != "nl") { + $$[$0 - 1].push($$[$0]); + this.$ = $$[$0 - 1]; + } + break; + case 6: + case 7: + this.$ = $$[$0]; + break; + case 8: + this.$ = "nl"; + break; + case 12: + this.$ = $$[$0]; + break; + case 13: + const stateStmt = $$[$0 - 1]; + stateStmt.description = yy.trimColon($$[$0]); + this.$ = stateStmt; + break; + case 14: + this.$ = { stmt: "relation", state1: $$[$0 - 2], state2: $$[$0] }; + break; + case 15: + const relDescription = yy.trimColon($$[$0]); + this.$ = { stmt: "relation", state1: $$[$0 - 3], state2: $$[$0 - 1], description: relDescription }; + break; + case 19: + this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: "", doc: $$[$0 - 1] }; + break; + case 20: + var id26 = $$[$0]; + var description = $$[$0 - 2].trim(); + if ($$[$0].match(":")) { + var parts = $$[$0].split(":"); + id26 = parts[0]; + description = [description, parts[1]]; + } + this.$ = { stmt: "state", id: id26, type: "default", description }; + break; + case 21: + this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: $$[$0 - 5], doc: $$[$0 - 1] }; + break; + case 22: + this.$ = { stmt: "state", id: $$[$0], type: "fork" }; + break; + case 23: + this.$ = { stmt: "state", id: $$[$0], type: "join" }; + break; + case 24: + this.$ = { stmt: "state", id: $$[$0], type: "choice" }; + break; + case 25: + this.$ = { stmt: "state", id: yy.getDividerId(), type: "divider" }; + break; + case 26: + this.$ = { stmt: "state", id: $$[$0 - 1].trim(), note: { position: $$[$0 - 2].trim(), text: $$[$0].trim() } }; + break; + case 29: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 30: + case 31: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 32: + case 33: + this.$ = { stmt: "classDef", id: $$[$0 - 1].trim(), classes: $$[$0].trim() }; + break; + case 34: + this.$ = { stmt: "style", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() }; + break; + case 35: + this.$ = { stmt: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() }; + break; + case 36: + yy.setDirection("TB"); + this.$ = { stmt: "dir", value: "TB" }; + break; + case 37: + yy.setDirection("BT"); + this.$ = { stmt: "dir", value: "BT" }; + break; + case 38: + yy.setDirection("RL"); + this.$ = { stmt: "dir", value: "RL" }; + break; + case 39: + yy.setDirection("LR"); + this.$ = { stmt: "dir", value: "LR" }; + break; + case 42: + case 43: + this.$ = { stmt: "state", id: $$[$0].trim(), type: "default", description: "" }; + break; + case 44: + this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" }; + break; + case 45: + this.$ = { stmt: "state", id: $$[$0 - 2].trim(), classes: [$$[$0].trim()], type: "default", description: "" }; + break; } - function ne(a, b) { - this.e = a; - this.d = b; + }, "anonymous"), + table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o2([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 5]), { 9: 38, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 7]), o2($Vr, [2, 8]), o2($Vr, [2, 9]), o2($Vr, [2, 10]), o2($Vr, [2, 11]), o2($Vr, [2, 12], { 14: [1, 39], 15: [1, 40] }), o2($Vr, [2, 16]), { 18: [1, 41] }, o2($Vr, [2, 18], { 20: [1, 42] }), { 23: [1, 43] }, o2($Vr, [2, 22]), o2($Vr, [2, 23]), o2($Vr, [2, 24]), o2($Vr, [2, 25]), { 30: 44, 31: [1, 45], 56: [1, 46], 57: [1, 47] }, o2($Vr, [2, 28]), { 34: [1, 48] }, { 36: [1, 49] }, o2($Vr, [2, 31]), { 39: [1, 50], 41: [1, 51] }, { 43: [1, 52] }, { 46: [1, 53] }, o2($Vs, [2, 42], { 55: [1, 54] }), o2($Vs, [2, 43], { 55: [1, 55] }), o2($Vr, [2, 36]), o2($Vr, [2, 37]), o2($Vr, [2, 38]), o2($Vr, [2, 39]), o2($Vr, [2, 6]), o2($Vr, [2, 13]), { 13: 56, 24: $Va, 54: $Vq }, o2($Vr, [2, 17]), o2($Vt, $V3, { 7: 57 }), { 24: [1, 58] }, { 24: [1, 59] }, { 23: [1, 60] }, { 24: [2, 46] }, { 24: [2, 47] }, o2($Vr, [2, 29]), o2($Vr, [2, 30]), { 40: [1, 61] }, { 40: [1, 62] }, { 44: [1, 63] }, { 47: [1, 64] }, { 24: [1, 65] }, { 24: [1, 66] }, o2($Vr, [2, 14], { 14: [1, 67] }), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 68], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 20], { 20: [1, 69] }), { 31: [1, 70] }, { 24: [1, 71] }, o2($Vr, [2, 32]), o2($Vr, [2, 33]), o2($Vr, [2, 34]), o2($Vr, [2, 35]), o2($Vs, [2, 44]), o2($Vs, [2, 45]), o2($Vr, [2, 15]), o2($Vr, [2, 19]), o2($Vt, $V3, { 7: 72 }), o2($Vr, [2, 26]), o2($Vr, [2, 27]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: $V6, 17: $V7, 19: $V8, 21: [1, 73], 22: $V9, 24: $Va, 25: $Vb, 26: $Vc, 27: $Vd, 28: $Ve, 29: $Vf, 32: 25, 33: $Vg, 35: $Vh, 37: $Vi, 38: $Vj, 42: $Vk, 45: $Vl, 48: $Vm, 49: $Vn, 50: $Vo, 51: $Vp, 54: $Vq }, o2($Vr, [2, 21])], + defaultActions: { 5: [2, 1], 6: [2, 2], 46: [2, 46], 47: [2, 47] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function Hf(a, b) { - this.b = a; - this.c = b; + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function cp(a, b) { - this.b = a; - this.a = b; + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function Cp(a, b) { - this.b = a; - this.a = b; + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function qr(a, b) { - this.b = a; - this.a = b; + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + return 41; + break; + case 1: + return 48; + break; + case 2: + return 49; + break; + case 3: + return 50; + break; + case 4: + return 51; + break; + case 5: + break; + case 6: + { + } + break; + case 7: + return 5; + break; + case 8: + break; + case 9: + break; + case 10: + break; + case 11: + break; + case 12: + this.pushState("SCALE"); + return 17; + break; + case 13: + return 18; + break; + case 14: + this.popState(); + break; + case 15: + this.begin("acc_title"); + return 33; + break; + case 16: + this.popState(); + return "acc_title_value"; + break; + case 17: + this.begin("acc_descr"); + return 35; + break; + case 18: + this.popState(); + return "acc_descr_value"; + break; + case 19: + this.begin("acc_descr_multiline"); + break; + case 20: + this.popState(); + break; + case 21: + return "acc_descr_multiline_value"; + break; + case 22: + this.pushState("CLASSDEF"); + return 38; + break; + case 23: + this.popState(); + this.pushState("CLASSDEFID"); + return "DEFAULT_CLASSDEF_ID"; + break; + case 24: + this.popState(); + this.pushState("CLASSDEFID"); + return 39; + break; + case 25: + this.popState(); + return 40; + break; + case 26: + this.pushState("CLASS"); + return 45; + break; + case 27: + this.popState(); + this.pushState("CLASS_STYLE"); + return 46; + break; + case 28: + this.popState(); + return 47; + break; + case 29: + this.pushState("STYLE"); + return 42; + break; + case 30: + this.popState(); + this.pushState("STYLEDEF_STYLES"); + return 43; + break; + case 31: + this.popState(); + return 44; + break; + case 32: + this.pushState("SCALE"); + return 17; + break; + case 33: + return 18; + break; + case 34: + this.popState(); + break; + case 35: + this.pushState("STATE"); + break; + case 36: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -8).trim(); + return 25; + break; + case 37: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -8).trim(); + return 26; + break; + case 38: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -10).trim(); + return 27; + break; + case 39: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -8).trim(); + return 25; + break; + case 40: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -8).trim(); + return 26; + break; + case 41: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -10).trim(); + return 27; + break; + case 42: + return 48; + break; + case 43: + return 49; + break; + case 44: + return 50; + break; + case 45: + return 51; + break; + case 46: + this.pushState("STATE_STRING"); + break; + case 47: + this.pushState("STATE_ID"); + return "AS"; + break; + case 48: + this.popState(); + return "ID"; + break; + case 49: + this.popState(); + break; + case 50: + return "STATE_DESCR"; + break; + case 51: + return 19; + break; + case 52: + this.popState(); + break; + case 53: + this.popState(); + this.pushState("struct"); + return 20; + break; + case 54: + break; + case 55: + this.popState(); + return 21; + break; + case 56: + break; + case 57: + this.begin("NOTE"); + return 29; + break; + case 58: + this.popState(); + this.pushState("NOTE_ID"); + return 56; + break; + case 59: + this.popState(); + this.pushState("NOTE_ID"); + return 57; + break; + case 60: + this.popState(); + this.pushState("FLOATING_NOTE"); + break; + case 61: + this.popState(); + this.pushState("FLOATING_NOTE_ID"); + return "AS"; + break; + case 62: + break; + case 63: + return "NOTE_TEXT"; + break; + case 64: + this.popState(); + return "ID"; + break; + case 65: + this.popState(); + this.pushState("NOTE_TEXT"); + return 24; + break; + case 66: + this.popState(); + yy_.yytext = yy_.yytext.substr(2).trim(); + return 31; + break; + case 67: + this.popState(); + yy_.yytext = yy_.yytext.slice(0, -8).trim(); + return 31; + break; + case 68: + return 6; + break; + case 69: + return 6; + break; + case 70: + return 16; + break; + case 71: + return 54; + break; + case 72: + return 24; + break; + case 73: + yy_.yytext = yy_.yytext.trim(); + return 14; + break; + case 74: + return 15; + break; + case 75: + return 28; + break; + case 76: + return 55; + break; + case 77: + return 5; + break; + case 78: + return "INVALID"; + break; + } + }, "anonymous"), + rules: [/^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:style\s+)/i, /^(?:[\w,]+\s+)/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<>)/i, /^(?:.*<>)/i, /^(?:.*<>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i], + conditions: { "LINE": { "rules": [9, 10], "inclusive": false }, "struct": { "rules": [9, 10, 22, 26, 29, 35, 42, 43, 44, 45, 54, 55, 56, 57, 71, 72, 73, 74, 75], "inclusive": false }, "FLOATING_NOTE_ID": { "rules": [64], "inclusive": false }, "FLOATING_NOTE": { "rules": [61, 62, 63], "inclusive": false }, "NOTE_TEXT": { "rules": [66, 67], "inclusive": false }, "NOTE_ID": { "rules": [65], "inclusive": false }, "NOTE": { "rules": [58, 59, 60], "inclusive": false }, "STYLEDEF_STYLEOPTS": { "rules": [], "inclusive": false }, "STYLEDEF_STYLES": { "rules": [31], "inclusive": false }, "STYLE_IDS": { "rules": [], "inclusive": false }, "STYLE": { "rules": [30], "inclusive": false }, "CLASS_STYLE": { "rules": [28], "inclusive": false }, "CLASS": { "rules": [27], "inclusive": false }, "CLASSDEFID": { "rules": [25], "inclusive": false }, "CLASSDEF": { "rules": [23, 24], "inclusive": false }, "acc_descr_multiline": { "rules": [20, 21], "inclusive": false }, "acc_descr": { "rules": [18], "inclusive": false }, "acc_title": { "rules": [16], "inclusive": false }, "SCALE": { "rules": [13, 14, 33, 34], "inclusive": false }, "ALIAS": { "rules": [], "inclusive": false }, "STATE_ID": { "rules": [48], "inclusive": false }, "STATE_STRING": { "rules": [49, 50], "inclusive": false }, "FORK_STATE": { "rules": [], "inclusive": false }, "STATE": { "rules": [9, 10, 36, 37, 38, 39, 40, 41, 46, 47, 51, 52, 53], "inclusive": false }, "ID": { "rules": [9, 10], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 15, 17, 19, 22, 26, 29, 32, 35, 53, 57, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser14.parser = parser14; + stateDiagram_default = parser14; + } + }); + + // src/diagrams/state/stateCommon.ts + var DEFAULT_DIAGRAM_DIRECTION, DEFAULT_NESTED_DOC_DIR, STMT_STATE, STMT_RELATION, STMT_CLASSDEF, STMT_STYLEDEF, STMT_APPLYCLASS, DEFAULT_STATE_TYPE, DIVIDER_TYPE, G_EDGE_STYLE, G_EDGE_ARROWHEADSTYLE, G_EDGE_LABELPOS, G_EDGE_LABELTYPE, G_EDGE_THICKNESS, SHAPE_STATE, SHAPE_STATE_WITH_DESC, SHAPE_START, SHAPE_END, SHAPE_DIVIDER, SHAPE_GROUP, SHAPE_NOTE, SHAPE_NOTEGROUP, CSS_DIAGRAM, CSS_STATE, CSS_DIAGRAM_STATE, CSS_EDGE, CSS_NOTE, CSS_NOTE_EDGE, CSS_EDGE_NOTE_EDGE, CSS_DIAGRAM_NOTE, CSS_CLUSTER, CSS_DIAGRAM_CLUSTER, CSS_CLUSTER_ALT, CSS_DIAGRAM_CLUSTER_ALT, PARENT2, NOTE, DOMID_STATE, DOMID_TYPE_SPACER, NOTE_ID, PARENT_ID; + var init_stateCommon = __esm({ + "src/diagrams/state/stateCommon.ts"() { + "use strict"; + DEFAULT_DIAGRAM_DIRECTION = "LR"; + DEFAULT_NESTED_DOC_DIR = "TB"; + STMT_STATE = "state"; + STMT_RELATION = "relation"; + STMT_CLASSDEF = "classDef"; + STMT_STYLEDEF = "style"; + STMT_APPLYCLASS = "applyClass"; + DEFAULT_STATE_TYPE = "default"; + DIVIDER_TYPE = "divider"; + G_EDGE_STYLE = "fill:none"; + G_EDGE_ARROWHEADSTYLE = "fill: #333"; + G_EDGE_LABELPOS = "c"; + G_EDGE_LABELTYPE = "text"; + G_EDGE_THICKNESS = "normal"; + SHAPE_STATE = "rect"; + SHAPE_STATE_WITH_DESC = "rectWithTitle"; + SHAPE_START = "stateStart"; + SHAPE_END = "stateEnd"; + SHAPE_DIVIDER = "divider"; + SHAPE_GROUP = "roundedWithTitle"; + SHAPE_NOTE = "note"; + SHAPE_NOTEGROUP = "noteGroup"; + CSS_DIAGRAM = "statediagram"; + CSS_STATE = "state"; + CSS_DIAGRAM_STATE = `${CSS_DIAGRAM}-${CSS_STATE}`; + CSS_EDGE = "transition"; + CSS_NOTE = "note"; + CSS_NOTE_EDGE = "note-edge"; + CSS_EDGE_NOTE_EDGE = `${CSS_EDGE} ${CSS_NOTE_EDGE}`; + CSS_DIAGRAM_NOTE = `${CSS_DIAGRAM}-${CSS_NOTE}`; + CSS_CLUSTER = "cluster"; + CSS_DIAGRAM_CLUSTER = `${CSS_DIAGRAM}-${CSS_CLUSTER}`; + CSS_CLUSTER_ALT = "cluster-alt"; + CSS_DIAGRAM_CLUSTER_ALT = `${CSS_DIAGRAM}-${CSS_CLUSTER_ALT}`; + PARENT2 = "parent"; + NOTE = "note"; + DOMID_STATE = "state"; + DOMID_TYPE_SPACER = "----"; + NOTE_ID = `${DOMID_TYPE_SPACER}${NOTE}`; + PARENT_ID = `${DOMID_TYPE_SPACER}${PARENT2}`; + } + }); + + // src/diagrams/state/dataFetcher.js + function stateDomId(itemId = "", counter = 0, type3 = "", typeSpacer = DOMID_TYPE_SPACER) { + const typeStr = type3 !== null && type3.length > 0 ? `${typeSpacer}${type3}` : ""; + return `${DOMID_STATE}-${itemId}${typeStr}-${counter}`; + } + function insertOrUpdateNode(nodes6, nodeData, classes6) { + if (!nodeData.id || nodeData.id === "" || nodeData.id === "
    ") { + return; + } + if (nodeData.cssClasses) { + if (!Array.isArray(nodeData.cssCompiledStyles)) { + nodeData.cssCompiledStyles = []; + } + nodeData.cssClasses.split(" ").forEach((cssClass) => { + if (classes6.get(cssClass)) { + const classDef = classes6.get(cssClass); + nodeData.cssCompiledStyles = [...nodeData.cssCompiledStyles, ...classDef.styles]; + } + }); + } + const existingNodeData = nodes6.find((node2) => node2.id === nodeData.id); + if (existingNodeData) { + Object.assign(existingNodeData, nodeData); + } else { + nodes6.push(nodeData); + } + } + function getClassesFromDbInfo(dbInfoItem) { + return dbInfoItem?.classes?.join(" ") ?? ""; + } + function getStylesFromDbInfo(dbInfoItem) { + return dbInfoItem?.styles ?? []; + } + var nodeDb, graphItemCount, setupDoc, getDir, dataFetcher, reset2; + var init_dataFetcher = __esm({ + "src/diagrams/state/dataFetcher.js"() { + "use strict"; + init_diagramAPI(); + init_logger(); + init_common(); + init_stateCommon(); + nodeDb = /* @__PURE__ */ new Map(); + graphItemCount = 0; + __name(stateDomId, "stateDomId"); + setupDoc = /* @__PURE__ */ __name((parentParsedItem, doc, diagramStates, nodes6, edges5, altFlag, look, classes6) => { + log.trace("items", doc); + doc.forEach((item) => { + switch (item.stmt) { + case STMT_STATE: + dataFetcher(parentParsedItem, item, diagramStates, nodes6, edges5, altFlag, look, classes6); + break; + case DEFAULT_STATE_TYPE: + dataFetcher(parentParsedItem, item, diagramStates, nodes6, edges5, altFlag, look, classes6); + break; + case STMT_RELATION: + { + dataFetcher( + parentParsedItem, + item.state1, + diagramStates, + nodes6, + edges5, + altFlag, + look, + classes6 + ); + dataFetcher( + parentParsedItem, + item.state2, + diagramStates, + nodes6, + edges5, + altFlag, + look, + classes6 + ); + const edgeData = { + id: "edge" + graphItemCount, + start: item.state1.id, + end: item.state2.id, + arrowhead: "normal", + arrowTypeEnd: "arrow_barb", + style: G_EDGE_STYLE, + labelStyle: "", + label: common_default.sanitizeText(item.description, getConfig2()), + arrowheadStyle: G_EDGE_ARROWHEADSTYLE, + labelpos: G_EDGE_LABELPOS, + labelType: G_EDGE_LABELTYPE, + thickness: G_EDGE_THICKNESS, + classes: CSS_EDGE, + look + }; + edges5.push(edgeData); + graphItemCount++; + } + break; + } + }); + }, "setupDoc"); + getDir = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => { + let dir2 = defaultDir; + if (parsedItem.doc) { + for (const parsedItemDoc of parsedItem.doc) { + if (parsedItemDoc.stmt === "dir") { + dir2 = parsedItemDoc.value; + } + } + } + return dir2; + }, "getDir"); + __name(insertOrUpdateNode, "insertOrUpdateNode"); + __name(getClassesFromDbInfo, "getClassesFromDbInfo"); + __name(getStylesFromDbInfo, "getStylesFromDbInfo"); + dataFetcher = /* @__PURE__ */ __name((parent4, parsedItem, diagramStates, nodes6, edges5, altFlag, look, classes6) => { + const itemId = parsedItem.id; + const dbState = diagramStates.get(itemId); + const classStr = getClassesFromDbInfo(dbState); + const style3 = getStylesFromDbInfo(dbState); + log.info("dataFetcher parsedItem", parsedItem, dbState, style3); + if (itemId !== "root") { + let shape = SHAPE_STATE; + if (parsedItem.start === true) { + shape = SHAPE_START; + } else if (parsedItem.start === false) { + shape = SHAPE_END; + } + if (parsedItem.type !== DEFAULT_STATE_TYPE) { + shape = parsedItem.type; + } + if (!nodeDb.get(itemId)) { + nodeDb.set(itemId, { + id: itemId, + shape, + description: common_default.sanitizeText(itemId, getConfig2()), + cssClasses: `${classStr} ${CSS_DIAGRAM_STATE}`, + cssStyles: style3 + }); + } + const newNode = nodeDb.get(itemId); + if (parsedItem.description) { + if (Array.isArray(newNode.description)) { + newNode.shape = SHAPE_STATE_WITH_DESC; + newNode.description.push(parsedItem.description); + } else { + if (newNode.description?.length > 0) { + newNode.shape = SHAPE_STATE_WITH_DESC; + if (newNode.description === itemId) { + newNode.description = [parsedItem.description]; + } else { + newNode.description = [newNode.description, parsedItem.description]; + } + } else { + newNode.shape = SHAPE_STATE; + newNode.description = parsedItem.description; + } } - function Rr(a, b) { - this.b = a; - this.a = b; - } - function vr(a, b) { - this.a = a; - this.b = b; - } - function su(a, b) { - this.a = a; - this.b = b; - } - function Hu(a, b) { - this.a = a; - this.f = b; - } - function gp(a, b) { - this.g = a; - this.i = b; - } - function qs(a, b) { - this.f = a; - this.g = b; - } - function Gv(a, b) { - this.b = a; - this.c = b; - } - function Wc(a) { - Lb(a.dc()); - this.c = a; - } - function Ex(a, b) { - this.a = a; - this.b = b; - } - function ey(a, b) { - this.a = a; - this.b = b; - } - function pv(a) { - this.a = RD(Qb(a), 15); - } - function uv(a) { - this.a = RD(Qb(a), 15); - } - function nw(a) { - this.a = RD(Qb(a), 85); - } - function rf(a) { - this.b = RD(Qb(a), 85); - } - function Tr(a) { - this.b = RD(Qb(a), 51); - } - function uB() { - this.q = new $wnd.Date(); - } - function CC(a, b) { - this.a = a; - this.b = b; - } - function Bt(a, b) { - return Ujb(a.b, b); - } - function tpb(a, b) { - return a.b.Hc(b); - } - function upb(a, b) { - return a.b.Ic(b); - } - function wpb(a, b) { - return a.b.Qc(b); - } - function Pqb(a, b) { - return a.b.Hc(b); - } - function pqb(a, b) { - return a.c.uc(b); - } - function rqb(a, b) { - return pb(a.c, b); - } - function Zsb(a, b) { - return a.a._b(b); - } - function Xp(a, b) { - return a > b && b < hwe; - } - function bkb(a) { - return a.f.c + a.i.c; - } - function IC(a) { - return WB(), a ? VB : UB; - } - function Usb(a) { - ckb.call(this, a, 0); - } - function dzb() { - ezb.call(this, null); - } - function Osb(a) { - this.c = a; - Lsb(this); - } - function Yub() { - Lub(this); - Xub(this); - } - function gib() { - gib = geb; - fib = new oeb(); - } - function Qob() { - Qob = geb; - Pob = new Rob(); - } - function Tvb() { - Tvb = geb; - Svb = new Xvb(); - } - function bwb() { - bwb = geb; - awb = new dwb(); - } - function SAb() { - SAb = geb; - RAb = new VAb(); - } - function rDb() { - NCb.call(this, null); - } - function xDb() { - xDb = geb; - wDb = new KEb(); - } - function FDb(a, b) { - LCb(a); - a.a.Nb(b); - } - function sAb(a, b) { - return a.a.Xc(b); - } - function tAb(a, b) { - return a.a.Yc(b); - } - function uAb(a, b) { - return a.a.$c(b); - } - function vAb(a, b) { - return a.a._c(b); - } - function JBb(a, b) { - return a.Gc(b), a; - } - function KBb(a, b) { - return ye(a, b), a; - } - function m_d(a, b) { - pLd(xYd(a.a), b); - } - function r_d(a, b) { - pLd(xYd(a.a), b); - } - function EBb(a, b) { - a.Gc(b); - return a; - } - function hGb(a, b) { - a.a.f = b; - return a; - } - function nGb(a, b) { - a.a.d = b; - return a; - } - function oGb(a, b) { - a.a.g = b; - return a; - } - function pGb(a, b) { - a.a.j = b; - return a; - } - function sIb(a, b) { - a.a.a = b; - return a; - } - function tIb(a, b) { - a.a.d = b; - return a; - } - function uIb(a, b) { - a.a.e = b; - return a; - } - function vIb(a, b) { - a.a.g = b; - return a; - } - function fJb(a, b) { - a.a.f = b; - return a; - } - function KJb(a) { - a.b = false; - return a; - } - function wGb() { - wGb = geb; - vGb = new xGb(); - } - function VRb() { - VRb = geb; - URb = new WRb(); - } - function zXb() { - zXb = geb; - yXb = new FXb(); - } - function kYb() { - kYb = geb; - jYb = new lYb(); - } - function pYb() { - pYb = geb; - oYb = new QYb(); - } - function NZb() { - NZb = geb; - MZb = new SZb(); - } - function g0b() { - g0b = geb; - f0b = new l0b(); - } - function i1b() { - i1b = geb; - h1b = new X1b(); - } - function s7b() { - s7b = geb; - r7b = new C7b(); - } - function H5b() { - H5b = geb; - G5b = new pjd(); - } - function Hcc() { - Hcc = geb; - Gcc = new Ncc(); - } - function Wjc() { - Wjc = geb; - Vjc = new Jlc(); - } - function mqc() { - mqc = geb; - lqc = new Aqc(); - } - function GCc() { - GCc = geb; - FCc = new Yrd(); - } - function sbd() { - sbd = geb; - rbd = new ubd(); - } - function Cbd() { - Cbd = geb; - Bbd = new Dbd(); - } - function _cd() { - _cd = geb; - $cd = new cdd(); - } - function GGc() { - yGc(); - this.c = new Ri(); - } - function ubd() { - qs.call(this, DBe, 0); - } - function Mfd(a, b, c2) { - $jb(a.d, b.f, c2); - } - function bNb(a, b, c2, d) { - aNb(a, d, b, c2); - } - function V6b(a, b, c2, d) { - $6b(d, a, b, c2); - } - function vcc(a, b, c2, d) { - wcc(d, a, b, c2); - } - function Dgd(a, b) { - dub(a.c.c, b.b, b); - } - function Cgd(a, b) { - dub(a.c.b, b.c, b); - } - function BYc(a) { - return a.e.b + a.f.b; - } - function AYc(a) { - return a.e.a + a.f.a; - } - function N1d(a) { - return a.b ? a.b : a.a; - } - function yTc(a) { - return (a.c + a.a) / 2; - } - function b2d(a, b) { - return GA(a.a, b); - } - function rfd(a, b) { - a.a = b.g; - return a; - } - function hTd() { - hTd = geb; - gTd = new Cae(); - } - function cTd() { - cTd = geb; - bTd = new eTd(); - } - function lud() { - lud = geb; - kud = new Yud(); - } - function $Sd() { - $Sd = geb; - ZSd = new _Sd(); - } - function TSd() { - TSd = geb; - SSd = new VSd(); - } - function YSd() { - YSd = geb; - XSd = new O5d(); - } - function PRd() { - PRd = geb; - ORd = new Tsb(); - } - function N2d() { - N2d = geb; - M2d = new Uhe(); - } - function j3d() { - j3d = geb; - i3d = new Yhe(); - } - function Gie() { - Gie = geb; - Fie = new Hie(); - } - function nke() { - nke = geb; - mke = new rke(); - } - function uue() { - uue = geb; - tue = new Cue(); - } - function Tae() { - Tae = geb; - Rae = new bnb(); - } - function _v(a) { - return RD(a, 44).ld(); - } - function Akb(a) { - return a.b < a.d.gc(); - } - function meb(b, a) { - return a.split(b); - } - function Idb(a, b) { - return Ddb(a, b) > 0; - } - function Ldb(a, b) { - return Ddb(a, b) < 0; - } - function Urb(a, b) { - return Bsb(a.a, b); - } - function Beb(a, b) { - oz.call(this, a, b); - } - function Qx(a) { - Px(); - ho.call(this, a); - } - function Lnb(a, b) { - Pnb(a, a.length, b); - } - function Mnb(a, b) { - Rnb(a, a.length, b); - } - function Ktb(a, b) { - return a.a.get(b); - } - function bub(a, b) { - return Ujb(a.e, b); - } - function Zxb(a) { - return uFb(a), false; - } - function zw(a) { - this.a = RD(Qb(a), 229); - } - function $wb(a) { - Swb.call(this, a, 21); - } - function dAb(a, b) { - qs.call(this, a, b); - } - function yBb(a, b) { - qs.call(this, a, b); - } - function ssb(a, b) { - this.b = a; - this.a = b; - } - function xlb(a, b) { - this.d = a; - this.e = b; - } - function jEb(a, b) { - this.a = a; - this.b = b; - } - function pEb(a, b) { - this.a = a; - this.b = b; - } - function vEb(a, b) { - this.a = a; - this.b = b; - } - function BEb(a, b) { - this.a = a; - this.b = b; - } - function TFb(a, b) { - this.a = a; - this.b = b; - } - function QEb(a, b) { - this.b = a; - this.a = b; - } - function sHb(a, b) { - this.b = a; - this.a = b; - } - function EHb(a, b) { - qs.call(this, a, b); - } - function MHb(a, b) { - qs.call(this, a, b); - } - function jIb(a, b) { - qs.call(this, a, b); - } - function $Jb(a, b) { - qs.call(this, a, b); - } - function FKb(a, b) { - qs.call(this, a, b); - } - function wLb(a, b) { - qs.call(this, a, b); - } - function nOb(a, b) { - qs.call(this, a, b); - } - function kPb(a, b) { - this.b = a; - this.a = b; - } - function JPb(a, b) { - qs.call(this, a, b); - } - function fRb(a, b) { - this.b = a; - this.a = b; - } - function JRb(a, b) { - qs.call(this, a, b); - } - function OTb(a, b) { - this.b = a; - this.a = b; - } - function UUb(a, b) { - qs.call(this, a, b); - } - function BWb(a, b) { - qs.call(this, a, b); - } - function tXb(a, b) { - qs.call(this, a, b); - } - function XEb(a, b, c2) { - a.splice(b, 0, c2); - } - function pr(a, b, c2) { - a.Mb(c2) && b.Cd(c2); - } - function lEb(a, b, c2) { - b.Pe(a.a.Ye(c2)); - } - function rEb(a, b, c2) { - b.Dd(a.a.Ze(c2)); + newNode.description = common_default.sanitizeTextOrArray(newNode.description, getConfig2()); + } + if (newNode.description?.length === 1 && newNode.shape === SHAPE_STATE_WITH_DESC) { + if (newNode.type === "group") { + newNode.shape = SHAPE_GROUP; + } else { + newNode.shape = SHAPE_STATE; + } + } + if (!newNode.type && parsedItem.doc) { + log.info("Setting cluster for XCX", itemId, getDir(parsedItem)); + newNode.type = "group"; + newNode.isGroup = true; + newNode.dir = getDir(parsedItem); + newNode.shape = parsedItem.type === DIVIDER_TYPE ? SHAPE_DIVIDER : SHAPE_GROUP; + newNode.cssClasses = `${newNode.cssClasses} ${CSS_DIAGRAM_CLUSTER} ${altFlag ? CSS_DIAGRAM_CLUSTER_ALT : ""}`; + } + const nodeData = { + labelStyle: "", + shape: newNode.shape, + label: newNode.description, + cssClasses: newNode.cssClasses, + cssCompiledStyles: [], + cssStyles: newNode.cssStyles, + id: itemId, + dir: newNode.dir, + domId: stateDomId(itemId, graphItemCount), + type: newNode.type, + isGroup: newNode.type === "group", + padding: 8, + rx: 10, + ry: 10, + look + }; + if (nodeData.shape === SHAPE_DIVIDER) { + nodeData.label = ""; + } + if (parent4 && parent4.id !== "root") { + log.trace("Setting node ", itemId, " to be child of its parent ", parent4.id); + nodeData.parentId = parent4.id; + } + nodeData.centerLabel = true; + if (parsedItem.note) { + const noteData = { + labelStyle: "", + shape: SHAPE_NOTE, + label: parsedItem.note.text, + cssClasses: CSS_DIAGRAM_NOTE, + // useHtmlLabels: false, + cssStyles: [], + cssCompilesStyles: [], + id: itemId + NOTE_ID + "-" + graphItemCount, + domId: stateDomId(itemId, graphItemCount, NOTE), + type: newNode.type, + isGroup: newNode.type === "group", + padding: getConfig2().flowchart.padding, + look, + position: parsedItem.note.position + }; + const parentNodeId = itemId + PARENT_ID; + const groupData = { + labelStyle: "", + shape: SHAPE_NOTEGROUP, + label: parsedItem.note.text, + cssClasses: newNode.cssClasses, + cssStyles: [], + id: itemId + PARENT_ID, + domId: stateDomId(itemId, graphItemCount, PARENT2), + type: "group", + isGroup: true, + padding: 16, + //getConfig().flowchart.padding + look, + position: parsedItem.note.position + }; + graphItemCount++; + groupData.id = parentNodeId; + noteData.parentId = parentNodeId; + insertOrUpdateNode(nodes6, groupData, classes6); + insertOrUpdateNode(nodes6, noteData, classes6); + insertOrUpdateNode(nodes6, nodeData, classes6); + let from2 = itemId; + let to = noteData.id; + if (parsedItem.note.position === "left of") { + from2 = noteData.id; + to = itemId; + } + edges5.push({ + id: from2 + "-" + to, + start: from2, + end: to, + arrowhead: "none", + arrowTypeEnd: "", + style: G_EDGE_STYLE, + labelStyle: "", + classes: CSS_EDGE_NOTE_EDGE, + arrowheadStyle: G_EDGE_ARROWHEADSTYLE, + labelpos: G_EDGE_LABELPOS, + labelType: G_EDGE_LABELTYPE, + thickness: G_EDGE_THICKNESS, + look + }); + } else { + insertOrUpdateNode(nodes6, nodeData, classes6); + } + } + if (parsedItem.doc) { + log.trace("Adding nodes children "); + setupDoc(parsedItem, parsedItem.doc, diagramStates, nodes6, edges5, !altFlag, look, classes6); + } + }, "dataFetcher"); + reset2 = /* @__PURE__ */ __name(() => { + nodeDb.clear(); + graphItemCount = 0; + }, "reset"); + } + }); + + // src/diagrams/state/stateRenderer-v3-unified.ts + var getDir2, getClasses4, draw14, stateRenderer_v3_unified_default; + var init_stateRenderer_v3_unified = __esm({ + "src/diagrams/state/stateRenderer-v3-unified.ts"() { + "use strict"; + init_diagramAPI(); + init_logger(); + init_insertElementsForSize(); + init_render(); + init_setupViewPortForSVG(); + init_utils2(); + init_stateCommon(); + getDir2 = /* @__PURE__ */ __name((parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => { + if (!parsedItem.doc) { + return defaultDir; + } + let dir2 = defaultDir; + for (const parsedItemDoc of parsedItem.doc) { + if (parsedItemDoc.stmt === "dir") { + dir2 = parsedItemDoc.value; + } + } + return dir2; + }, "getDir"); + getClasses4 = /* @__PURE__ */ __name(function(text2, diagramObj) { + diagramObj.db.extract(diagramObj.db.getRootDocV2()); + return diagramObj.db.getClasses(); + }, "getClasses"); + draw14 = /* @__PURE__ */ __name(async function(text2, id26, _version, diag) { + log.info("REF0:"); + log.info("Drawing state diagram (v2)", id26); + const { securityLevel, state: conf8, layout: layout6 } = getConfig2(); + diag.db.extract(diag.db.getRootDocV2()); + const data4Layout = diag.db.getData(); + const svg = getDiagramElement(id26, securityLevel); + data4Layout.type = diag.type; + data4Layout.layoutAlgorithm = layout6; + data4Layout.nodeSpacing = conf8?.nodeSpacing || 50; + data4Layout.rankSpacing = conf8?.rankSpacing || 50; + data4Layout.markers = ["barb"]; + data4Layout.diagramId = id26; + await render4(data4Layout, svg); + const padding3 = 8; + utils_default2.insertTitle( + svg, + "statediagramTitleText", + conf8?.titleTopMargin ?? 25, + diag.db.getDiagramTitle() + ); + setupViewPortForSVG(svg, padding3, CSS_DIAGRAM, conf8?.useMaxWidth ?? true); + }, "draw"); + stateRenderer_v3_unified_default = { + getClasses: getClasses4, + draw: draw14, + getDir: getDir2 + }; + } + }); + + // src/diagrams/state/stateDb.js + function newClassesList() { + return /* @__PURE__ */ new Map(); + } + function startIdIfNeeded(id26 = "") { + let fixedId = id26; + if (id26 === START_NODE) { + startEndCount++; + fixedId = `${START_TYPE}${startEndCount}`; + } + return fixedId; + } + function startTypeIfNeeded(id26 = "", type3 = DEFAULT_STATE_TYPE) { + return id26 === START_NODE ? START_TYPE : type3; + } + function endIdIfNeeded(id26 = "") { + let fixedId = id26; + if (id26 === END_NODE) { + startEndCount++; + fixedId = `${END_TYPE}${startEndCount}`; + } + return fixedId; + } + function endTypeIfNeeded(id26 = "", type3 = DEFAULT_STATE_TYPE) { + return id26 === END_NODE ? END_TYPE : type3; + } + function addRelationObjs(item1, item2, relationTitle) { + let id1 = startIdIfNeeded(item1.id.trim()); + let type1 = startTypeIfNeeded(item1.id.trim(), item1.type); + let id26 = startIdIfNeeded(item2.id.trim()); + let type22 = startTypeIfNeeded(item2.id.trim(), item2.type); + addState( + id1, + type1, + item1.doc, + item1.description, + item1.note, + item1.classes, + item1.styles, + item1.textStyles + ); + addState( + id26, + type22, + item2.doc, + item2.description, + item2.note, + item2.classes, + item2.styles, + item2.textStyles + ); + currentDocument.relations.push({ + id1, + id2: id26, + relationTitle: common_default.sanitizeText(relationTitle, getConfig2()) + }); + } + var START_NODE, START_TYPE, END_NODE, END_TYPE, COLOR_KEYWORD, FILL_KEYWORD, BG_FILL, STYLECLASS_SEP, nodes, edges2, direction3, rootDoc, classes3, newDoc, documents, currentDocument, startEndCount, dividerCnt, lineType2, relationType2, clone2, setRootDoc, getRootDoc, docTranslator, getRootDocV2, extract, addState, clear22, getState, getStates, logDocuments, getRelations2, addRelation2, addDescription, cleanupLabel2, getDividerId, addStyleClass, getClasses5, setCssClass2, setStyle, setTextStyle, getDirection4, setDirection4, trimColon, getData2, stateDb_default; + var init_stateDb = __esm({ + "src/diagrams/state/stateDb.js"() { + "use strict"; + init_logger(); + init_utils2(); + init_common(); + init_diagramAPI(); + init_commonDb(); + init_dataFetcher(); + init_stateRenderer_v3_unified(); + init_stateCommon(); + START_NODE = "[*]"; + START_TYPE = "start"; + END_NODE = START_NODE; + END_TYPE = "end"; + COLOR_KEYWORD = "color"; + FILL_KEYWORD = "fill"; + BG_FILL = "bgFill"; + STYLECLASS_SEP = ","; + __name(newClassesList, "newClassesList"); + nodes = []; + edges2 = []; + direction3 = DEFAULT_DIAGRAM_DIRECTION; + rootDoc = []; + classes3 = newClassesList(); + newDoc = /* @__PURE__ */ __name(() => { + return { + /** @type {{ id1: string, id2: string, relationTitle: string }[]} */ + relations: [], + states: /* @__PURE__ */ new Map(), + documents: {} + }; + }, "newDoc"); + documents = { + root: newDoc() + }; + currentDocument = documents.root; + startEndCount = 0; + dividerCnt = 0; + lineType2 = { + LINE: 0, + DOTTED_LINE: 1 + }; + relationType2 = { + AGGREGATION: 0, + EXTENSION: 1, + COMPOSITION: 2, + DEPENDENCY: 3 + }; + clone2 = /* @__PURE__ */ __name((o2) => JSON.parse(JSON.stringify(o2)), "clone"); + setRootDoc = /* @__PURE__ */ __name((o2) => { + log.info("Setting root doc", o2); + rootDoc = o2; + }, "setRootDoc"); + getRootDoc = /* @__PURE__ */ __name(() => rootDoc, "getRootDoc"); + docTranslator = /* @__PURE__ */ __name((parent4, node2, first3) => { + if (node2.stmt === STMT_RELATION) { + docTranslator(parent4, node2.state1, true); + docTranslator(parent4, node2.state2, false); + } else { + if (node2.stmt === STMT_STATE) { + if (node2.id === "[*]") { + node2.id = first3 ? parent4.id + "_start" : parent4.id + "_end"; + node2.start = first3; + } else { + node2.id = node2.id.trim(); + } + } + if (node2.doc) { + const doc = []; + let currentDoc = []; + let i2; + for (i2 = 0; i2 < node2.doc.length; i2++) { + if (node2.doc[i2].type === DIVIDER_TYPE) { + const newNode = clone2(node2.doc[i2]); + newNode.doc = clone2(currentDoc); + doc.push(newNode); + currentDoc = []; + } else { + currentDoc.push(node2.doc[i2]); + } } - function xEb(a, b, c2) { - b.Cd(a.a.Kb(c2)); + if (doc.length > 0 && currentDoc.length > 0) { + const newNode = { + stmt: STMT_STATE, + id: generateId(), + type: "divider", + doc: clone2(currentDoc) + }; + doc.push(clone2(newNode)); + node2.doc = doc; } - function eYb(a, b) { - return Csb(a.c, b); + node2.doc.forEach((docNode) => docTranslator(node2, docNode, true)); + } + } + }, "docTranslator"); + getRootDocV2 = /* @__PURE__ */ __name(() => { + docTranslator({ id: "root" }, { id: "root", doc: rootDoc }, true); + return { id: "root", doc: rootDoc }; + }, "getRootDocV2"); + extract = /* @__PURE__ */ __name((_doc) => { + let doc; + if (_doc.doc) { + doc = _doc.doc; + } else { + doc = _doc; + } + log.info(doc); + clear22(true); + log.info("Extract initial document:", doc); + doc.forEach((item) => { + log.warn("Statement", item.stmt); + switch (item.stmt) { + case STMT_STATE: + addState( + item.id.trim(), + item.type, + item.doc, + item.description, + item.note, + item.classes, + item.styles, + item.textStyles + ); + break; + case STMT_RELATION: + addRelation2(item.state1, item.state2, item.description); + break; + case STMT_CLASSDEF: + addStyleClass(item.id.trim(), item.classes); + break; + case STMT_STYLEDEF: + { + const ids = item.id.trim().split(","); + const styles3 = item.styleClass.split(","); + ids.forEach((id26) => { + let foundState = getState(id26); + if (foundState === void 0) { + const trimmedId = id26.trim(); + addState(trimmedId); + foundState = getState(trimmedId); + } + foundState.styles = styles3.map((s2) => s2.replace(/;/g, "")?.trim()); + }); + } + break; + case STMT_APPLYCLASS: + setCssClass2(item.id.trim(), item.styleClass); + break; + } + }); + const diagramStates = getStates(); + const config6 = getConfig2(); + const look = config6.look; + reset2(); + dataFetcher(void 0, getRootDocV2(), diagramStates, nodes, edges2, true, look, classes3); + nodes.forEach((node2) => { + if (Array.isArray(node2.label)) { + node2.description = node2.label.slice(1); + if (node2.isGroup && node2.description.length > 0) { + throw new Error( + "Group nodes can only have label. Remove the additional description for node [" + node2.id + "]" + ); } - function cGb(a, b) { - return Csb(a.e, b); + node2.label = node2.label[0]; + } + }); + }, "extract"); + addState = /* @__PURE__ */ __name(function(id26, type3 = DEFAULT_STATE_TYPE, doc = null, descr = null, note3 = null, classes6 = null, styles3 = null, textStyles = null) { + const trimmedId = id26?.trim(); + if (!currentDocument.states.has(trimmedId)) { + log.info("Adding state ", trimmedId, descr); + currentDocument.states.set(trimmedId, { + id: trimmedId, + descriptions: [], + type: type3, + doc, + note: note3, + classes: [], + styles: [], + textStyles: [] + }); + } else { + if (!currentDocument.states.get(trimmedId).doc) { + currentDocument.states.get(trimmedId).doc = doc; + } + if (!currentDocument.states.get(trimmedId).type) { + currentDocument.states.get(trimmedId).type = type3; + } + } + if (descr) { + log.info("Setting state description", trimmedId, descr); + if (typeof descr === "string") { + addDescription(trimmedId, descr.trim()); + } + if (typeof descr === "object") { + descr.forEach((des) => addDescription(trimmedId, des.trim())); + } + } + if (note3) { + const doc2 = currentDocument.states.get(trimmedId); + doc2.note = note3; + doc2.note.text = common_default.sanitizeText(doc2.note.text, getConfig2()); + } + if (classes6) { + log.info("Setting state classes", trimmedId, classes6); + const classesList = typeof classes6 === "string" ? [classes6] : classes6; + classesList.forEach((cssClass) => setCssClass2(trimmedId, cssClass.trim())); + } + if (styles3) { + log.info("Setting state styles", trimmedId, styles3); + const stylesList = typeof styles3 === "string" ? [styles3] : styles3; + stylesList.forEach((style3) => setStyle(trimmedId, style3.trim())); + } + if (textStyles) { + log.info("Setting state styles", trimmedId, styles3); + const textStylesList = typeof textStyles === "string" ? [textStyles] : textStyles; + textStylesList.forEach((textStyle) => setTextStyle(trimmedId, textStyle.trim())); + } + }, "addState"); + clear22 = /* @__PURE__ */ __name(function(saveCommon) { + nodes = []; + edges2 = []; + documents = { + root: newDoc() + }; + currentDocument = documents.root; + startEndCount = 0; + classes3 = newClassesList(); + if (!saveCommon) { + clear(); + } + }, "clear"); + getState = /* @__PURE__ */ __name(function(id26) { + return currentDocument.states.get(id26); + }, "getState"); + getStates = /* @__PURE__ */ __name(function() { + return currentDocument.states; + }, "getStates"); + logDocuments = /* @__PURE__ */ __name(function() { + log.info("Documents = ", documents); + }, "logDocuments"); + getRelations2 = /* @__PURE__ */ __name(function() { + return currentDocument.relations; + }, "getRelations"); + __name(startIdIfNeeded, "startIdIfNeeded"); + __name(startTypeIfNeeded, "startTypeIfNeeded"); + __name(endIdIfNeeded, "endIdIfNeeded"); + __name(endTypeIfNeeded, "endTypeIfNeeded"); + __name(addRelationObjs, "addRelationObjs"); + addRelation2 = /* @__PURE__ */ __name(function(item1, item2, title2) { + if (typeof item1 === "object") { + addRelationObjs(item1, item2, title2); + } else { + const id1 = startIdIfNeeded(item1.trim()); + const type1 = startTypeIfNeeded(item1); + const id26 = endIdIfNeeded(item2.trim()); + const type22 = endTypeIfNeeded(item2); + addState(id1, type1); + addState(id26, type22); + currentDocument.relations.push({ + id1, + id2: id26, + title: common_default.sanitizeText(title2, getConfig2()) + }); + } + }, "addRelation"); + addDescription = /* @__PURE__ */ __name(function(id26, descr) { + const theState = currentDocument.states.get(id26); + const _descr = descr.startsWith(":") ? descr.replace(":", "").trim() : descr; + theState.descriptions.push(common_default.sanitizeText(_descr, getConfig2())); + }, "addDescription"); + cleanupLabel2 = /* @__PURE__ */ __name(function(label) { + if (label.substring(0, 1) === ":") { + return label.substr(2).trim(); + } else { + return label.trim(); + } + }, "cleanupLabel"); + getDividerId = /* @__PURE__ */ __name(() => { + dividerCnt++; + return "divider-id-" + dividerCnt; + }, "getDividerId"); + addStyleClass = /* @__PURE__ */ __name(function(id26, styleAttributes = "") { + if (!classes3.has(id26)) { + classes3.set(id26, { id: id26, styles: [], textStyles: [] }); + } + const foundClass = classes3.get(id26); + if (styleAttributes !== void 0 && styleAttributes !== null) { + styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => { + const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim(); + if (RegExp(COLOR_KEYWORD).exec(attrib)) { + const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL); + const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD); + foundClass.textStyles.push(newStyle2); + } + foundClass.styles.push(fixedAttrib); + }); + } + }, "addStyleClass"); + getClasses5 = /* @__PURE__ */ __name(function() { + return classes3; + }, "getClasses"); + setCssClass2 = /* @__PURE__ */ __name(function(itemIds, cssClassName) { + itemIds.split(",").forEach(function(id26) { + let foundState = getState(id26); + if (foundState === void 0) { + const trimmedId = id26.trim(); + addState(trimmedId); + foundState = getState(trimmedId); + } + foundState.classes.push(cssClassName); + }); + }, "setCssClass"); + setStyle = /* @__PURE__ */ __name(function(itemId, styleText) { + const item = getState(itemId); + if (item !== void 0) { + item.styles.push(styleText); + } + }, "setStyle"); + setTextStyle = /* @__PURE__ */ __name(function(itemId, cssClassName) { + const item = getState(itemId); + if (item !== void 0) { + item.textStyles.push(cssClassName); + } + }, "setTextStyle"); + getDirection4 = /* @__PURE__ */ __name(() => direction3, "getDirection"); + setDirection4 = /* @__PURE__ */ __name((dir2) => { + direction3 = dir2; + }, "setDirection"); + trimColon = /* @__PURE__ */ __name((str2) => str2 && str2[0] === ":" ? str2.substr(1).trim() : str2.trim(), "trimColon"); + getData2 = /* @__PURE__ */ __name(() => { + const config6 = getConfig2(); + return { nodes, edges: edges2, other: {}, config: config6, direction: getDir2(getRootDocV2()) }; + }, "getData"); + stateDb_default = { + getConfig: /* @__PURE__ */ __name(() => getConfig2().state, "getConfig"), + getData: getData2, + addState, + clear: clear22, + getState, + getStates, + getRelations: getRelations2, + getClasses: getClasses5, + getDirection: getDirection4, + addRelation: addRelation2, + getDividerId, + setDirection: setDirection4, + cleanupLabel: cleanupLabel2, + lineType: lineType2, + relationType: relationType2, + logDocuments, + getRootDoc, + setRootDoc, + getRootDocV2, + extract, + trimColon, + getAccTitle, + setAccTitle, + getAccDescription, + setAccDescription, + addStyleClass, + setCssClass: setCssClass2, + addDescription, + setDiagramTitle, + getDiagramTitle + }; + } + }); + + // src/diagrams/state/styles.js + var getStyles11, styles_default10; + var init_styles10 = __esm({ + "src/diagrams/state/styles.js"() { + "use strict"; + getStyles11 = /* @__PURE__ */ __name((options3) => ` +defs #statediagram-barbEnd { + fill: ${options3.transitionColor}; + stroke: ${options3.transitionColor}; + } +g.stateGroup text { + fill: ${options3.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${options3.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${options3.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${options3.mainBkg}; + stroke: ${options3.nodeBorder}; +} + +g.stateGroup line { + stroke: ${options3.lineColor}; + stroke-width: 1; +} + +.transition { + stroke: ${options3.transitionColor}; + stroke-width: 1; + fill: none; +} + +.stateGroup .composit { + fill: ${options3.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${options3.noteBorderColor}; + fill: ${options3.noteBkgColor}; + + text { + fill: ${options3.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${options3.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${options3.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${options3.edgeLabelBackground}; + p { + background-color: ${options3.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${options3.edgeLabelBackground}; + fill: ${options3.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${options3.transitionLabelColor || options3.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${options3.transitionLabelColor || options3.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${options3.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${options3.specialStateColor}; + stroke: ${options3.specialStateColor}; +} + +.node .fork-join { + fill: ${options3.specialStateColor}; + stroke: ${options3.specialStateColor}; +} + +.node circle.state-end { + fill: ${options3.innerEndBackground}; + stroke: ${options3.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${options3.compositeBackground || options3.background}; + // stroke: ${options3.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${options3.stateBkg || options3.mainBkg}; + stroke: ${options3.stateBorder || options3.nodeBorder}; + stroke-width: 1px; +} +.node polygon { + fill: ${options3.mainBkg}; + stroke: ${options3.stateBorder || options3.nodeBorder};; + stroke-width: 1px; +} +#statediagram-barbEnd { + fill: ${options3.lineColor}; +} + +.statediagram-cluster rect { + fill: ${options3.compositeTitleBackground}; + stroke: ${options3.stateBorder || options3.nodeBorder}; + stroke-width: 1px; +} + +.cluster-label, .nodeLabel { + color: ${options3.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${options3.stateBorder || options3.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${options3.compositeBackground || options3.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${options3.altBackground ? options3.altBackground : "#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${options3.altBackground ? options3.altBackground : "#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${options3.noteBkgColor}; + stroke: ${options3.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${options3.noteBkgColor}; + stroke: ${options3.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${options3.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${options3.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${options3.noteTextColor}; +} + +#dependencyStart, #dependencyEnd { + fill: ${options3.lineColor}; + stroke: ${options3.lineColor}; + stroke-width: 1; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; +} +`, "getStyles"); + styles_default10 = getStyles11; + } + }); + + // src/diagrams/state/id-cache.js + var idCache2, set3, get4, keys2, size2, id_cache_default; + var init_id_cache = __esm({ + "src/diagrams/state/id-cache.js"() { + "use strict"; + idCache2 = {}; + set3 = /* @__PURE__ */ __name((key, val) => { + idCache2[key] = val; + }, "set"); + get4 = /* @__PURE__ */ __name((k2) => idCache2[k2], "get"); + keys2 = /* @__PURE__ */ __name(() => Object.keys(idCache2), "keys"); + size2 = /* @__PURE__ */ __name(() => keys2().length, "size"); + id_cache_default = { + get: get4, + set: set3, + keys: keys2, + size: size2 + }; + } + }); + + // src/diagrams/state/shapes.js + var drawStartState, drawDivider, drawSimpleState, drawDescrState, addTitleAndBox, drawEndState, drawForkJoinState, _drawLongText, drawNote3, drawState, edgeCount2, drawEdge2; + var init_shapes = __esm({ + "src/diagrams/state/shapes.js"() { + "use strict"; + init_src32(); + init_id_cache(); + init_stateDb(); + init_utils2(); + init_common(); + init_diagramAPI(); + init_logger(); + drawStartState = /* @__PURE__ */ __name((g2) => g2.append("circle").attr("class", "start-state").attr("r", getConfig2().state.sizeUnit).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit), "drawStartState"); + drawDivider = /* @__PURE__ */ __name((g2) => g2.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", getConfig2().state.textHeight).attr("class", "divider").attr("x2", getConfig2().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"); + drawSimpleState = /* @__PURE__ */ __name((g2, stateDef) => { + const state4 = g2.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 2 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id); + const classBox = state4.node().getBBox(); + g2.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", classBox.width + 2 * getConfig2().state.padding).attr("height", classBox.height + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius); + return state4; + }, "drawSimpleState"); + drawDescrState = /* @__PURE__ */ __name((g2, stateDef) => { + const addTspan2 = /* @__PURE__ */ __name(function(textEl, txt, isFirst2) { + const tSpan = textEl.append("tspan").attr("x", 2 * getConfig2().state.padding).text(txt); + if (!isFirst2) { + tSpan.attr("dy", getConfig2().state.textHeight); + } + }, "addTspan"); + const title2 = g2.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 1.3 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.descriptions[0]); + const titleBox = title2.node().getBBox(); + const titleHeight = titleBox.height; + const description = g2.append("text").attr("x", getConfig2().state.padding).attr( + "y", + titleHeight + getConfig2().state.padding * 0.4 + getConfig2().state.dividerMargin + getConfig2().state.textHeight + ).attr("class", "state-description"); + let isFirst = true; + let isSecond = true; + stateDef.descriptions.forEach(function(descr) { + if (!isFirst) { + addTspan2(description, descr, isSecond); + isSecond = false; + } + isFirst = false; + }); + const descrLine = g2.append("line").attr("x1", getConfig2().state.padding).attr("y1", getConfig2().state.padding + titleHeight + getConfig2().state.dividerMargin / 2).attr("y2", getConfig2().state.padding + titleHeight + getConfig2().state.dividerMargin / 2).attr("class", "descr-divider"); + const descrBox = description.node().getBBox(); + const width3 = Math.max(descrBox.width, titleBox.width); + descrLine.attr("x2", width3 + 3 * getConfig2().state.padding); + g2.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", width3 + 2 * getConfig2().state.padding).attr("height", descrBox.height + titleHeight + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius); + return g2; + }, "drawDescrState"); + addTitleAndBox = /* @__PURE__ */ __name((g2, stateDef, altBkg) => { + const pad3 = getConfig2().state.padding; + const dblPad = 2 * getConfig2().state.padding; + const orgBox = g2.node().getBBox(); + const orgWidth = orgBox.width; + const orgX = orgBox.x; + const title2 = g2.append("text").attr("x", 0).attr("y", getConfig2().state.titleShift).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id); + const titleBox = title2.node().getBBox(); + const titleWidth = titleBox.width + dblPad; + let width3 = Math.max(titleWidth, orgWidth); + if (width3 === orgWidth) { + width3 = width3 + dblPad; + } + let startX2; + const graphBox = g2.node().getBBox(); + if (stateDef.doc) { + } + startX2 = orgX - pad3; + if (titleWidth > orgWidth) { + startX2 = (orgWidth - width3) / 2 + pad3; + } + if (Math.abs(orgX - graphBox.x) < pad3 && titleWidth > orgWidth) { + startX2 = orgX - (titleWidth - orgWidth) / 2; + } + const lineY = 1 - getConfig2().state.textHeight; + g2.insert("rect", ":first-child").attr("x", startX2).attr("y", lineY).attr("class", altBkg ? "alt-composit" : "composit").attr("width", width3).attr( + "height", + graphBox.height + getConfig2().state.textHeight + getConfig2().state.titleShift + 1 + ).attr("rx", "0"); + title2.attr("x", startX2 + pad3); + if (titleWidth <= orgWidth) { + title2.attr("x", orgX + (width3 - dblPad) / 2 - titleWidth / 2 + pad3); + } + g2.insert("rect", ":first-child").attr("x", startX2).attr( + "y", + getConfig2().state.titleShift - getConfig2().state.textHeight - getConfig2().state.padding + ).attr("width", width3).attr("height", getConfig2().state.textHeight * 3).attr("rx", getConfig2().state.radius); + g2.insert("rect", ":first-child").attr("x", startX2).attr( + "y", + getConfig2().state.titleShift - getConfig2().state.textHeight - getConfig2().state.padding + ).attr("width", width3).attr("height", graphBox.height + 3 + 2 * getConfig2().state.textHeight).attr("rx", getConfig2().state.radius); + return g2; + }, "addTitleAndBox"); + drawEndState = /* @__PURE__ */ __name((g2) => { + g2.append("circle").attr("class", "end-state-outer").attr("r", getConfig2().state.sizeUnit + getConfig2().state.miniPadding).attr( + "cx", + getConfig2().state.padding + getConfig2().state.sizeUnit + getConfig2().state.miniPadding + ).attr( + "cy", + getConfig2().state.padding + getConfig2().state.sizeUnit + getConfig2().state.miniPadding + ); + return g2.append("circle").attr("class", "end-state-inner").attr("r", getConfig2().state.sizeUnit).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit + 2).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit + 2); + }, "drawEndState"); + drawForkJoinState = /* @__PURE__ */ __name((g2, stateDef) => { + let width3 = getConfig2().state.forkWidth; + let height2 = getConfig2().state.forkHeight; + if (stateDef.parentId) { + let tmp = width3; + width3 = height2; + height2 = tmp; + } + return g2.append("rect").style("stroke", "black").style("fill", "black").attr("width", width3).attr("height", height2).attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding); + }, "drawForkJoinState"); + _drawLongText = /* @__PURE__ */ __name((_text, x5, y5, g2) => { + let textHeight = 0; + const textElem = g2.append("text"); + textElem.style("text-anchor", "start"); + textElem.attr("class", "noteText"); + let text2 = _text.replace(/\r\n/g, "
    "); + text2 = text2.replace(/\n/g, "
    "); + const lines = text2.split(common_default.lineBreakRegex); + let tHeight = 1.25 * getConfig2().state.noteMargin; + for (const line2 of lines) { + const txt = line2.trim(); + if (txt.length > 0) { + const span = textElem.append("tspan"); + span.text(txt); + if (tHeight === 0) { + const textBounds = span.node().getBBox(); + tHeight += textBounds.height; + } + textHeight += tHeight; + span.attr("x", x5 + getConfig2().state.noteMargin); + span.attr("y", y5 + textHeight + 1.25 * getConfig2().state.noteMargin); + } + } + return { textWidth: textElem.node().getBBox().width, textHeight }; + }, "_drawLongText"); + drawNote3 = /* @__PURE__ */ __name((text2, g2) => { + g2.attr("class", "state-note"); + const note3 = g2.append("rect").attr("x", 0).attr("y", getConfig2().state.padding); + const rectElem = g2.append("g"); + const { textWidth, textHeight } = _drawLongText(text2, 0, 0, rectElem); + note3.attr("height", textHeight + 2 * getConfig2().state.noteMargin); + note3.attr("width", textWidth + getConfig2().state.noteMargin * 2); + return note3; + }, "drawNote"); + drawState = /* @__PURE__ */ __name(function(elem, stateDef) { + const id26 = stateDef.id; + const stateInfo = { + id: id26, + label: stateDef.id, + width: 0, + height: 0 + }; + const g2 = elem.append("g").attr("id", id26).attr("class", "stateGroup"); + if (stateDef.type === "start") { + drawStartState(g2); + } + if (stateDef.type === "end") { + drawEndState(g2); + } + if (stateDef.type === "fork" || stateDef.type === "join") { + drawForkJoinState(g2, stateDef); + } + if (stateDef.type === "note") { + drawNote3(stateDef.note.text, g2); + } + if (stateDef.type === "divider") { + drawDivider(g2); + } + if (stateDef.type === "default" && stateDef.descriptions.length === 0) { + drawSimpleState(g2, stateDef); + } + if (stateDef.type === "default" && stateDef.descriptions.length > 0) { + drawDescrState(g2, stateDef); + } + const stateBox = g2.node().getBBox(); + stateInfo.width = stateBox.width + 2 * getConfig2().state.padding; + stateInfo.height = stateBox.height + 2 * getConfig2().state.padding; + id_cache_default.set(id26, stateInfo); + return stateInfo; + }, "drawState"); + edgeCount2 = 0; + drawEdge2 = /* @__PURE__ */ __name(function(elem, path4, relation) { + const getRelationType = /* @__PURE__ */ __name(function(type3) { + switch (type3) { + case stateDb_default.relationType.AGGREGATION: + return "aggregation"; + case stateDb_default.relationType.EXTENSION: + return "extension"; + case stateDb_default.relationType.COMPOSITION: + return "composition"; + case stateDb_default.relationType.DEPENDENCY: + return "dependency"; + } + }, "getRelationType"); + path4.points = path4.points.filter((p3) => !Number.isNaN(p3.y)); + const lineData = path4.points; + const lineFunction = line_default().x(function(d2) { + return d2.x; + }).y(function(d2) { + return d2.y; + }).curve(basis_default2); + const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount2).attr("class", "transition"); + let url = ""; + if (getConfig2().state.arrowMarkerAbsolute) { + url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, "\\("); + url = url.replace(/\)/g, "\\)"); + } + svgPath.attr( + "marker-end", + "url(" + url + "#" + getRelationType(stateDb_default.relationType.DEPENDENCY) + "End)" + ); + if (relation.title !== void 0) { + const label = elem.append("g").attr("class", "stateLabel"); + const { x: x5, y: y5 } = utils_default2.calcLabelPosition(path4.points); + const rows = common_default.getRows(relation.title); + let titleHeight = 0; + const titleRows = []; + let maxWidth = 0; + let minX = 0; + for (let i2 = 0; i2 <= rows.length; i2++) { + const title2 = label.append("text").attr("text-anchor", "middle").text(rows[i2]).attr("x", x5).attr("y", y5 + titleHeight); + const boundsTmp = title2.node().getBBox(); + maxWidth = Math.max(maxWidth, boundsTmp.width); + minX = Math.min(minX, boundsTmp.x); + log.info(boundsTmp.x, x5, y5 + titleHeight); + if (titleHeight === 0) { + const titleBox = title2.node().getBBox(); + titleHeight = titleBox.height; + log.info("Title height", titleHeight, y5); + } + titleRows.push(title2); + } + let boxHeight = titleHeight * rows.length; + if (rows.length > 1) { + const heightAdj = (rows.length - 1) * titleHeight * 0.5; + titleRows.forEach((title2, i2) => title2.attr("y", y5 + i2 * titleHeight - heightAdj)); + boxHeight = titleHeight * rows.length; + } + const bounds4 = label.node().getBBox(); + label.insert("rect", ":first-child").attr("class", "box").attr("x", x5 - maxWidth / 2 - getConfig2().state.padding / 2).attr("y", y5 - boxHeight / 2 - getConfig2().state.padding / 2 - 3.5).attr("width", maxWidth + getConfig2().state.padding).attr("height", boxHeight + getConfig2().state.padding); + log.info(bounds4); + } + edgeCount2++; + }, "drawEdge"); + } + }); + + // src/diagrams/state/stateRenderer.js + var conf6, transformationLog, setConf6, insertMarkers5, draw15, getLabelWidth, renderDoc, stateRenderer_default; + var init_stateRenderer = __esm({ + "src/diagrams/state/stateRenderer.js"() { + "use strict"; + init_src32(); + init_dagre(); + init_graphlib(); + init_logger(); + init_common(); + init_shapes(); + init_diagramAPI(); + init_setupGraphViewbox(); + transformationLog = {}; + setConf6 = /* @__PURE__ */ __name(function() { + }, "setConf"); + insertMarkers5 = /* @__PURE__ */ __name(function(elem) { + elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); + }, "insertMarkers"); + draw15 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + conf6 = getConfig2().state; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; + log.debug("Rendering diagram " + text2); + const diagram23 = root4.select(`[id='${id26}']`); + insertMarkers5(diagram23); + const rootDoc2 = diagObj.db.getRootDoc(); + renderDoc(rootDoc2, diagram23, void 0, false, root4, doc, diagObj); + const padding3 = conf6.padding; + const bounds4 = diagram23.node().getBBox(); + const width3 = bounds4.width + padding3 * 2; + const height2 = bounds4.height + padding3 * 2; + const svgWidth = width3 * 1.75; + configureSvgSize(diagram23, height2, svgWidth, conf6.useMaxWidth); + diagram23.attr( + "viewBox", + `${bounds4.x - conf6.padding} ${bounds4.y - conf6.padding} ` + width3 + " " + height2 + ); + }, "draw"); + getLabelWidth = /* @__PURE__ */ __name((text2) => { + return text2 ? text2.length * conf6.fontSizeFactor : 1; + }, "getLabelWidth"); + renderDoc = /* @__PURE__ */ __name((doc, diagram23, parentId, altBkg, root4, domDocument, diagObj) => { + const graph = new Graph({ + compound: true, + multigraph: true + }); + let i2; + let edgeFreeDoc = true; + for (i2 = 0; i2 < doc.length; i2++) { + if (doc[i2].stmt === "relation") { + edgeFreeDoc = false; + break; + } + } + if (parentId) { + graph.setGraph({ + rankdir: "LR", + multigraph: true, + compound: true, + // acyclicer: 'greedy', + ranker: "tight-tree", + ranksep: edgeFreeDoc ? 1 : conf6.edgeLengthFactor, + nodeSep: edgeFreeDoc ? 1 : 50, + isMultiGraph: true + // ranksep: 5, + // nodesep: 1 + }); + } else { + graph.setGraph({ + rankdir: "TB", + multigraph: true, + compound: true, + // isCompound: true, + // acyclicer: 'greedy', + // ranker: 'longest-path' + ranksep: edgeFreeDoc ? 1 : conf6.edgeLengthFactor, + nodeSep: edgeFreeDoc ? 1 : 50, + ranker: "tight-tree", + // ranker: 'network-simplex' + isMultiGraph: true + }); + } + graph.setDefaultEdgeLabel(function() { + return {}; + }); + diagObj.db.extract(doc); + const states = diagObj.db.getStates(); + const relations3 = diagObj.db.getRelations(); + const keys3 = Object.keys(states); + let first3 = true; + for (const key of keys3) { + const stateDef = states[key]; + if (parentId) { + stateDef.parentId = parentId; + } + let node2; + if (stateDef.doc) { + let sub2 = diagram23.append("g").attr("id", stateDef.id).attr("class", "stateGroup"); + node2 = renderDoc(stateDef.doc, sub2, stateDef.id, !altBkg, root4, domDocument, diagObj); + if (first3) { + sub2 = addTitleAndBox(sub2, stateDef, altBkg); + let boxBounds = sub2.node().getBBox(); + node2.width = boxBounds.width; + node2.height = boxBounds.height + conf6.padding / 2; + transformationLog[stateDef.id] = { y: conf6.compositTitleSize }; + } else { + let boxBounds = sub2.node().getBBox(); + node2.width = boxBounds.width; + node2.height = boxBounds.height; } - function qZb(a, b) { - qs.call(this, a, b); + } else { + node2 = drawState(diagram23, stateDef, graph); + } + if (stateDef.note) { + const noteDef = { + descriptions: [], + id: stateDef.id + "-note", + note: stateDef.note, + type: "note" + }; + const note3 = drawState(diagram23, noteDef, graph); + if (stateDef.note.position === "left of") { + graph.setNode(node2.id + "-note", note3); + graph.setNode(node2.id, node2); + } else { + graph.setNode(node2.id, node2); + graph.setNode(node2.id + "-note", note3); } - function V$b(a, b) { - qs.call(this, a, b); + graph.setParent(node2.id, node2.id + "-group"); + graph.setParent(node2.id + "-note", node2.id + "-group"); + } else { + graph.setNode(node2.id, node2); + } + } + log.debug("Count=", graph.nodeCount(), graph); + let cnt4 = 0; + relations3.forEach(function(relation) { + cnt4++; + log.debug("Setting edge", relation); + graph.setEdge( + relation.id1, + relation.id2, + { + relation, + width: getLabelWidth(relation.title), + height: conf6.labelHeight * common_default.getRows(relation.title).length, + labelpos: "c" + }, + "id" + cnt4 + ); + }); + layout(graph); + log.debug("Graph after layout", graph.nodes()); + const svgElem = diagram23.node(); + graph.nodes().forEach(function(v3) { + if (v3 !== void 0 && graph.node(v3) !== void 0) { + log.warn("Node " + v3 + ": " + JSON.stringify(graph.node(v3))); + root4.select("#" + svgElem.id + " #" + v3).attr( + "transform", + "translate(" + (graph.node(v3).x - graph.node(v3).width / 2) + "," + (graph.node(v3).y + (transformationLog[v3] ? transformationLog[v3].y : 0) - graph.node(v3).height / 2) + " )" + ); + root4.select("#" + svgElem.id + " #" + v3).attr("data-x-shift", graph.node(v3).x - graph.node(v3).width / 2); + const dividers = domDocument.querySelectorAll("#" + svgElem.id + " #" + v3 + " .divider"); + dividers.forEach((divider3) => { + const parent4 = divider3.parentElement; + let pWidth = 0; + let pShift = 0; + if (parent4) { + if (parent4.parentElement) { + pWidth = parent4.parentElement.getBBox().width; + } + pShift = parseInt(parent4.getAttribute("data-x-shift"), 10); + if (Number.isNaN(pShift)) { + pShift = 0; + } + } + divider3.setAttribute("x1", 0 - pShift + 8); + divider3.setAttribute("x2", pWidth - pShift - 8); + }); + } else { + log.debug("No Node " + v3 + ": " + JSON.stringify(graph.node(v3))); + } + }); + let stateBox = svgElem.getBBox(); + graph.edges().forEach(function(e3) { + if (e3 !== void 0 && graph.edge(e3) !== void 0) { + log.debug("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(graph.edge(e3))); + drawEdge2(diagram23, graph.edge(e3), graph.edge(e3).relation); + } + }); + stateBox = svgElem.getBBox(); + const stateInfo = { + id: parentId ? parentId : "root", + label: parentId ? parentId : "root", + width: 0, + height: 0 + }; + stateInfo.width = stateBox.width + 2 * conf6.padding; + stateInfo.height = stateBox.height + 2 * conf6.padding; + log.debug("Doc rendered", stateInfo, graph); + return stateInfo; + }, "renderDoc"); + stateRenderer_default = { + setConf: setConf6, + draw: draw15 + }; + } + }); + + // src/diagrams/state/stateDiagram.ts + var stateDiagram_exports = {}; + __export(stateDiagram_exports, { + diagram: () => diagram14 + }); + var diagram14; + var init_stateDiagram2 = __esm({ + "src/diagrams/state/stateDiagram.ts"() { + "use strict"; + init_stateDiagram(); + init_stateDb(); + init_styles10(); + init_stateRenderer(); + diagram14 = { + parser: stateDiagram_default, + db: stateDb_default, + renderer: stateRenderer_default, + styles: styles_default10, + init: /* @__PURE__ */ __name((cnf) => { + if (!cnf.state) { + cnf.state = {}; + } + cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + stateDb_default.clear(); + }, "init") + }; + } + }); + + // src/diagrams/state/stateDiagram-v2.ts + var stateDiagram_v2_exports = {}; + __export(stateDiagram_v2_exports, { + diagram: () => diagram15 + }); + var diagram15; + var init_stateDiagram_v2 = __esm({ + "src/diagrams/state/stateDiagram-v2.ts"() { + "use strict"; + init_stateDiagram(); + init_stateDb(); + init_styles10(); + init_stateRenderer_v3_unified(); + diagram15 = { + parser: stateDiagram_default, + db: stateDb_default, + renderer: stateRenderer_v3_unified_default, + styles: styles_default10, + init: /* @__PURE__ */ __name((cnf) => { + if (!cnf.state) { + cnf.state = {}; + } + cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + stateDb_default.clear(); + }, "init") + }; + } + }); + + // src/diagrams/user-journey/parser/journey.jison + var parser15, journey_default; + var init_journey = __esm({ + "src/diagrams/user-journey/parser/journey.jison"() { + "use strict"; + parser15 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 18], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 14]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "journey": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "title": 11, "acc_title": 12, "acc_title_value": 13, "acc_descr": 14, "acc_descr_value": 15, "acc_descr_multiline_value": 16, "section": 17, "taskName": 18, "taskData": 19, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "journey", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 18: "taskName", 19: "taskData" }, + productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 1: + return $$[$0 - 1]; + break; + case 2: + this.$ = []; + break; + case 3: + $$[$0 - 1].push($$[$0]); + this.$ = $$[$0 - 1]; + break; + case 4: + case 5: + this.$ = $$[$0]; + break; + case 6: + case 7: + this.$ = []; + break; + case 8: + yy.setDiagramTitle($$[$0].substr(6)); + this.$ = $$[$0].substr(6); + break; + case 9: + this.$ = $$[$0].trim(); + yy.setAccTitle(this.$); + break; + case 10: + case 11: + this.$ = $$[$0].trim(); + yy.setAccDescription(this.$); + break; + case 12: + yy.addSection($$[$0].substr(8)); + this.$ = $$[$0].substr(8); + break; + case 13: + yy.addTask($$[$0 - 1], $$[$0]); + this.$ = "task"; + break; } - function s3b(a, b) { - qs.call(this, a, b); + }, "anonymous"), + table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o2($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: $V6 }, o2($V0, [2, 7], { 1: [2, 1] }), o2($V0, [2, 3]), { 9: 15, 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: $V6 }, o2($V0, [2, 5]), o2($V0, [2, 6]), o2($V0, [2, 8]), { 13: [1, 16] }, { 15: [1, 17] }, o2($V0, [2, 11]), o2($V0, [2, 12]), { 19: [1, 18] }, o2($V0, [2, 4]), o2($V0, [2, 9]), o2($V0, [2, 10]), o2($V0, [2, 13])], + defaultActions: {}, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function Q8b(a, b) { - qs.call(this, a, b); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function icc(a, b) { - qs.call(this, a, b); + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function xec(a, b) { - qs.call(this, a, b); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function gic(a, b) { - this.a = a; - this.b = b; - } - function Xic(a, b) { - this.a = a; - this.b = b; - } - function h4b(a, b) { - this.a = a; - this.b = b; - } - function vjc(a, b) { - this.a = a; - this.b = b; - } - function xjc(a, b) { - this.a = a; - this.b = b; - } - function Hjc(a, b) { - this.a = a; - this.b = b; - } - function hjc(a, b) { - this.b = a; - this.a = b; - } - function Jjc(a, b) { - this.b = a; - this.a = b; - } - function _Yb(a, b) { - this.b = a; - this.a = b; - } - function eZb(a, b) { - this.c = a; - this.d = b; - } - function Q1b(a, b) { - this.e = a; - this.d = b; - } - function Tjc(a, b) { - this.a = a; - this.b = b; - } - function ulc(a, b) { - this.a = a; - this.b = b; - } - function Elc(a, b) { - this.a = a; - this.b = b; - } - function fqc(a, b) { - this.b = a; - this.a = b; - } - function smc(a, b) { - this.b = b; - this.c = a; - } - function fnc(a, b) { - qs.call(this, a, b); - } - function Cnc(a, b) { - qs.call(this, a, b); - } - function koc(a, b) { - qs.call(this, a, b); - } - function ktc(a, b) { - qs.call(this, a, b); - } - function ctc(a, b) { - qs.call(this, a, b); - } - function utc(a, b) { - qs.call(this, a, b); - } - function Ftc(a, b) { - qs.call(this, a, b); - } - function Rtc(a, b) { - qs.call(this, a, b); - } - function _tc(a, b) { - qs.call(this, a, b); - } - function iuc(a, b) { - qs.call(this, a, b); - } - function vuc(a, b) { - qs.call(this, a, b); - } - function Duc(a, b) { - qs.call(this, a, b); - } - function Puc(a, b) { - qs.call(this, a, b); - } - function _uc(a, b) { - qs.call(this, a, b); - } - function pvc(a, b) { - qs.call(this, a, b); - } - function yvc(a, b) { - qs.call(this, a, b); - } - function Hvc(a, b) { - qs.call(this, a, b); - } - function Pvc(a, b) { - qs.call(this, a, b); - } - function dxc(a, b) { - qs.call(this, a, b); - } - function bDc(a, b) { - qs.call(this, a, b); - } - function nDc(a, b) { - qs.call(this, a, b); - } - function yDc(a, b) { - qs.call(this, a, b); - } - function LDc(a, b) { - qs.call(this, a, b); - } - function bEc(a, b) { - qs.call(this, a, b); - } - function lEc(a, b) { - qs.call(this, a, b); - } - function tEc(a, b) { - qs.call(this, a, b); - } - function CEc(a, b) { - qs.call(this, a, b); - } - function LEc(a, b) { - qs.call(this, a, b); - } - function UEc(a, b) { - qs.call(this, a, b); - } - function mFc(a, b) { - qs.call(this, a, b); - } - function vFc(a, b) { - qs.call(this, a, b); - } - function EFc(a, b) { - qs.call(this, a, b); - } - function SKc(a, b) { - qs.call(this, a, b); - } - function cNc(a, b) { - this.b = a; - this.a = b; - } - function tNc(a, b) { - qs.call(this, a, b); - } - function QOc(a, b) { - this.a = a; - this.b = b; - } - function ePc(a, b) { - this.a = a; - this.b = b; - } - function LPc(a, b) { - this.a = a; - this.b = b; - } - function xQc(a, b) { - qs.call(this, a, b); - } - function FQc(a, b) { - qs.call(this, a, b); - } - function MQc(a, b) { - this.a = a; - this.b = b; - } - function FMc(a, b) { - dMc(); - return b != a; - } - function Uvb(a) { - sFb(a.a); - return a.b; - } - function qYb(a) { - rYb(a, a.c); - return a; - } - function Itb() { - Etb(); - return new Dtb(); - } - function _ec() { - Rec(); - this.a = new e6b(); - } - function lSc() { - dSc(); - this.a = new _sb(); - } - function aRc() { - WQc(); - this.b = new _sb(); - } - function xRc(a, b) { - this.b = a; - this.d = b; - } - function nVc(a, b) { - this.a = a; - this.b = b; - } - function pVc(a, b) { - this.a = a; - this.b = b; - } - function GWc(a, b) { - this.a = a; - this.b = b; - } - function IXc(a, b) { - this.b = a; - this.a = b; - } - function gTc(a, b) { - qs.call(this, a, b); + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + break; + case 1: + break; + case 2: + return 10; + break; + case 3: + break; + case 4: + break; + case 5: + return 4; + break; + case 6: + return 11; + break; + case 7: + this.begin("acc_title"); + return 12; + break; + case 8: + this.popState(); + return "acc_title_value"; + break; + case 9: + this.begin("acc_descr"); + return 14; + break; + case 10: + this.popState(); + return "acc_descr_value"; + break; + case 11: + this.begin("acc_descr_multiline"); + break; + case 12: + this.popState(); + break; + case 13: + return "acc_descr_multiline_value"; + break; + case 14: + return 17; + break; + case 15: + return 18; + break; + case 16: + return 19; + break; + case 17: + return ":"; + break; + case 18: + return 6; + break; + case 19: + return "INVALID"; + break; + } + }, "anonymous"), + rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], + conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser15.parser = parser15; + journey_default = parser15; + } + }); + + // src/diagrams/user-journey/journeyDb.js + var currentSection2, sections3, tasks2, rawTasks2, clear23, addSection3, getSections3, getTasks2, updateActors, addTask2, addTaskOrg2, compileTasks2, getActors2, journeyDb_default; + var init_journeyDb = __esm({ + "src/diagrams/user-journey/journeyDb.js"() { + "use strict"; + init_diagramAPI(); + init_commonDb(); + currentSection2 = ""; + sections3 = []; + tasks2 = []; + rawTasks2 = []; + clear23 = /* @__PURE__ */ __name(function() { + sections3.length = 0; + tasks2.length = 0; + currentSection2 = ""; + rawTasks2.length = 0; + clear(); + }, "clear"); + addSection3 = /* @__PURE__ */ __name(function(txt) { + currentSection2 = txt; + sections3.push(txt); + }, "addSection"); + getSections3 = /* @__PURE__ */ __name(function() { + return sections3; + }, "getSections"); + getTasks2 = /* @__PURE__ */ __name(function() { + let allItemsProcessed = compileTasks2(); + const maxDepth = 100; + let iterationCount = 0; + while (!allItemsProcessed && iterationCount < maxDepth) { + allItemsProcessed = compileTasks2(); + iterationCount++; + } + tasks2.push(...rawTasks2); + return tasks2; + }, "getTasks"); + updateActors = /* @__PURE__ */ __name(function() { + const tempActors = []; + tasks2.forEach((task) => { + if (task.people) { + tempActors.push(...task.people); + } + }); + const unique = new Set(tempActors); + return [...unique].sort(); + }, "updateActors"); + addTask2 = /* @__PURE__ */ __name(function(descr, taskData) { + const pieces = taskData.substr(1).split(":"); + let score = 0; + let peeps = []; + if (pieces.length === 1) { + score = Number(pieces[0]); + peeps = []; + } else { + score = Number(pieces[0]); + peeps = pieces[1].split(","); + } + const peopleList = peeps.map((s2) => s2.trim()); + const rawTask = { + section: currentSection2, + type: currentSection2, + people: peopleList, + task: descr, + score + }; + rawTasks2.push(rawTask); + }, "addTask"); + addTaskOrg2 = /* @__PURE__ */ __name(function(descr) { + const newTask = { + section: currentSection2, + type: currentSection2, + description: descr, + task: descr, + classes: [] + }; + tasks2.push(newTask); + }, "addTaskOrg"); + compileTasks2 = /* @__PURE__ */ __name(function() { + const compileTask = /* @__PURE__ */ __name(function(pos) { + return rawTasks2[pos].processed; + }, "compileTask"); + let allProcessed = true; + for (const [i2, rawTask] of rawTasks2.entries()) { + compileTask(i2); + allProcessed = allProcessed && rawTask.processed; + } + return allProcessed; + }, "compileTasks"); + getActors2 = /* @__PURE__ */ __name(function() { + return updateActors(); + }, "getActors"); + journeyDb_default = { + getConfig: /* @__PURE__ */ __name(() => getConfig2().journey, "getConfig"), + clear: clear23, + setDiagramTitle, + getDiagramTitle, + setAccTitle, + getAccTitle, + setAccDescription, + getAccDescription, + addSection: addSection3, + getSections: getSections3, + getTasks: getTasks2, + addTask: addTask2, + addTaskOrg: addTaskOrg2, + getActors: getActors2 + }; + } + }); + + // src/diagrams/user-journey/styles.js + var getStyles12, styles_default11; + var init_styles11 = __esm({ + "src/diagrams/user-journey/styles.js"() { + "use strict"; + getStyles12 = /* @__PURE__ */ __name((options3) => `.label { + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + color: ${options3.textColor}; + } + .mouth { + stroke: #666; + } + + line { + stroke: ${options3.textColor} + } + + .legend { + fill: ${options3.textColor}; + } + + .label text { + fill: #333; + } + .label { + color: ${options3.textColor} + } + + .face { + ${options3.faceColor ? `fill: ${options3.faceColor}` : "fill: #FFF8DC"}; + stroke: #999; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${options3.mainBkg}; + stroke: ${options3.nodeBorder}; + stroke-width: 1px; + } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${options3.arrowheadColor}; + } + + .edgePath .path { + stroke: ${options3.lineColor}; + stroke-width: 1.5px; + } + + .flowchart-link { + stroke: ${options3.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${options3.edgeLabelBackground}; + rect { + opacity: 0.5; + } + text-align: center; + } + + .cluster rect { + } + + .cluster text { + fill: ${options3.titleColor}; + } + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + font-size: 12px; + background: ${options3.tertiaryColor}; + border: 1px solid ${options3.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .task-type-0, .section-type-0 { + ${options3.fillType0 ? `fill: ${options3.fillType0}` : ""}; + } + .task-type-1, .section-type-1 { + ${options3.fillType0 ? `fill: ${options3.fillType1}` : ""}; + } + .task-type-2, .section-type-2 { + ${options3.fillType0 ? `fill: ${options3.fillType2}` : ""}; + } + .task-type-3, .section-type-3 { + ${options3.fillType0 ? `fill: ${options3.fillType3}` : ""}; + } + .task-type-4, .section-type-4 { + ${options3.fillType0 ? `fill: ${options3.fillType4}` : ""}; + } + .task-type-5, .section-type-5 { + ${options3.fillType0 ? `fill: ${options3.fillType5}` : ""}; + } + .task-type-6, .section-type-6 { + ${options3.fillType0 ? `fill: ${options3.fillType6}` : ""}; + } + .task-type-7, .section-type-7 { + ${options3.fillType0 ? `fill: ${options3.fillType7}` : ""}; + } + + .actor-0 { + ${options3.actor0 ? `fill: ${options3.actor0}` : ""}; + } + .actor-1 { + ${options3.actor1 ? `fill: ${options3.actor1}` : ""}; + } + .actor-2 { + ${options3.actor2 ? `fill: ${options3.actor2}` : ""}; + } + .actor-3 { + ${options3.actor3 ? `fill: ${options3.actor3}` : ""}; + } + .actor-4 { + ${options3.actor4 ? `fill: ${options3.actor4}` : ""}; + } + .actor-5 { + ${options3.actor5 ? `fill: ${options3.actor5}` : ""}; + } +`, "getStyles"); + styles_default11 = getStyles12; + } + }); + + // src/diagrams/user-journey/svgDraw.js + var drawRect5, drawFace, drawCircle, drawText4, drawLabel2, drawSection, taskCount, drawTask, drawBackgroundRect3, _drawTextCandidateFunc3, initGraphics, svgDraw_default4; + var init_svgDraw4 = __esm({ + "src/diagrams/user-journey/svgDraw.js"() { + "use strict"; + init_src32(); + init_svgDrawCommon(); + drawRect5 = /* @__PURE__ */ __name(function(elem, rectData) { + return drawRect(elem, rectData); + }, "drawRect"); + drawFace = /* @__PURE__ */ __name(function(element3, faceData) { + const radius2 = 15; + const circleElement = element3.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius2).attr("stroke-width", 2).attr("overflow", "visible"); + const face = element3.append("g"); + face.append("circle").attr("cx", faceData.cx - radius2 / 3).attr("cy", faceData.cy - radius2 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); + face.append("circle").attr("cx", faceData.cx + radius2 / 3).attr("cy", faceData.cy - radius2 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); + function smile(face2) { + const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius2 / 2).outerRadius(radius2 / 2.2); + face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")"); + } + __name(smile, "smile"); + function sad(face2) { + const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius2 / 2).outerRadius(radius2 / 2.2); + face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")"); + } + __name(sad, "sad"); + function ambivalent(face2) { + face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666"); + } + __name(ambivalent, "ambivalent"); + if (faceData.score > 3) { + smile(face); + } else if (faceData.score < 3) { + sad(face); + } else { + ambivalent(face); + } + return circleElement; + }, "drawFace"); + drawCircle = /* @__PURE__ */ __name(function(element3, circleData) { + const circleElement = element3.append("circle"); + circleElement.attr("cx", circleData.cx); + circleElement.attr("cy", circleData.cy); + circleElement.attr("class", "actor-" + circleData.pos); + circleElement.attr("fill", circleData.fill); + circleElement.attr("stroke", circleData.stroke); + circleElement.attr("r", circleData.r); + if (circleElement.class !== void 0) { + circleElement.attr("class", circleElement.class); + } + if (circleData.title !== void 0) { + circleElement.append("title").text(circleData.title); + } + return circleElement; + }, "drawCircle"); + drawText4 = /* @__PURE__ */ __name(function(elem, textData) { + return drawText(elem, textData); + }, "drawText"); + drawLabel2 = /* @__PURE__ */ __name(function(elem, txtObject) { + function genPoints(x5, y5, width3, height2, cut) { + return x5 + "," + y5 + " " + (x5 + width3) + "," + y5 + " " + (x5 + width3) + "," + (y5 + height2 - cut) + " " + (x5 + width3 - cut * 1.2) + "," + (y5 + height2) + " " + x5 + "," + (y5 + height2); + } + __name(genPoints, "genPoints"); + const polygon2 = elem.append("polygon"); + polygon2.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7)); + polygon2.attr("class", "labelBox"); + txtObject.y = txtObject.y + txtObject.labelMargin; + txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin; + drawText4(elem, txtObject); + }, "drawLabel"); + drawSection = /* @__PURE__ */ __name(function(elem, section, conf8) { + const g2 = elem.append("g"); + const rect4 = getNoteRect(); + rect4.x = section.x; + rect4.y = section.y; + rect4.fill = section.fill; + rect4.width = conf8.width * section.taskCount + // width of the tasks + conf8.diagramMarginX * (section.taskCount - 1); + rect4.height = conf8.height; + rect4.class = "journey-section section-type-" + section.num; + rect4.rx = 3; + rect4.ry = 3; + drawRect5(g2, rect4); + _drawTextCandidateFunc3(conf8)( + section.text, + g2, + rect4.x, + rect4.y, + rect4.width, + rect4.height, + { class: "journey-section section-type-" + section.num }, + conf8, + section.colour + ); + }, "drawSection"); + taskCount = -1; + drawTask = /* @__PURE__ */ __name(function(elem, task, conf8) { + const center4 = task.x + conf8.width / 2; + const g2 = elem.append("g"); + taskCount++; + const maxHeight = 300 + 5 * 30; + g2.append("line").attr("id", "task" + taskCount).attr("x1", center4).attr("y1", task.y).attr("x2", center4).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"); + drawFace(g2, { + cx: center4, + cy: 300 + (5 - task.score) * 30, + score: task.score + }); + const rect4 = getNoteRect(); + rect4.x = task.x; + rect4.y = task.y; + rect4.fill = task.fill; + rect4.width = conf8.width; + rect4.height = conf8.height; + rect4.class = "task task-type-" + task.num; + rect4.rx = 3; + rect4.ry = 3; + drawRect5(g2, rect4); + let xPos = task.x + 14; + task.people.forEach((person) => { + const colour = task.actors[person].color; + const circle6 = { + cx: xPos, + cy: task.y, + r: 7, + fill: colour, + stroke: "#000", + title: person, + pos: task.actors[person].position + }; + drawCircle(g2, circle6); + xPos += 10; + }); + _drawTextCandidateFunc3(conf8)( + task.task, + g2, + rect4.x, + rect4.y, + rect4.width, + rect4.height, + { class: "task" }, + conf8, + task.colour + ); + }, "drawTask"); + drawBackgroundRect3 = /* @__PURE__ */ __name(function(elem, bounds4) { + drawBackgroundRect(elem, bounds4); + }, "drawBackgroundRect"); + _drawTextCandidateFunc3 = /* @__PURE__ */ function() { + function byText(content, g2, x5, y5, width3, height2, textAttrs, colour) { + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content); + _setTextAttrs(text2, textAttrs); + } + __name(byText, "byText"); + function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8, colour) { + const { taskFontSize, taskFontFamily } = conf8; + const lines = content.split(//gi); + for (let i2 = 0; i2 < lines.length; i2++) { + const dy = i2 * taskFontSize - taskFontSize * (lines.length - 1) / 2; + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily); + text2.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]); + text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); + _setTextAttrs(text2, textAttrs); + } + } + __name(byTspan, "byTspan"); + function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const body = g2.append("switch"); + const f3 = body.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("position", "fixed"); + const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); + text2.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); + byTspan(content, body, x5, y5, width3, height2, textAttrs, conf8); + _setTextAttrs(text2, textAttrs); + } + __name(byFo, "byFo"); + function _setTextAttrs(toText, fromTextAttrsDict) { + for (const key in fromTextAttrsDict) { + if (key in fromTextAttrsDict) { + toText.attr(key, fromTextAttrsDict[key]); + } + } + } + __name(_setTextAttrs, "_setTextAttrs"); + return function(conf8) { + return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan; + }; + }(); + initGraphics = /* @__PURE__ */ __name(function(graphics) { + graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z"); + }, "initGraphics"); + svgDraw_default4 = { + drawRect: drawRect5, + drawCircle, + drawSection, + drawText: drawText4, + drawLabel: drawLabel2, + drawTask, + drawBackgroundRect: drawBackgroundRect3, + initGraphics + }; + } + }); + + // src/diagrams/user-journey/journeyRenderer.ts + function drawActorLegend(diagram23) { + const conf8 = getConfig2().journey; + let yPos = 60; + Object.keys(actors).forEach((person) => { + const colour = actors[person].color; + const circleData = { + cx: 20, + cy: yPos, + r: 7, + fill: colour, + stroke: "#000", + pos: actors[person].position + }; + svgDraw_default4.drawCircle(diagram23, circleData); + const labelData = { + x: 40, + y: yPos + 7, + fill: "#666", + text: person, + textMargin: conf8.boxTextMargin | 5 + }; + svgDraw_default4.drawText(diagram23, labelData); + yPos += 20; + }); + } + var setConf7, actors, conf7, LEFT_MARGIN, draw16, bounds2, fills, textColours, drawTasks, journeyRenderer_default; + var init_journeyRenderer = __esm({ + "src/diagrams/user-journey/journeyRenderer.ts"() { + "use strict"; + init_src32(); + init_svgDraw4(); + init_diagramAPI(); + init_setupGraphViewbox(); + setConf7 = /* @__PURE__ */ __name(function(cnf) { + const keys3 = Object.keys(cnf); + keys3.forEach(function(key) { + conf7[key] = cnf[key]; + }); + }, "setConf"); + actors = {}; + __name(drawActorLegend, "drawActorLegend"); + conf7 = getConfig2().journey; + LEFT_MARGIN = conf7.leftMargin; + draw16 = /* @__PURE__ */ __name(function(text2, id26, version4, diagObj) { + const conf8 = getConfig2().journey; + const securityLevel = getConfig2().securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + bounds2.init(); + const diagram23 = root4.select("#" + id26); + svgDraw_default4.initGraphics(diagram23); + const tasks4 = diagObj.db.getTasks(); + const title2 = diagObj.db.getDiagramTitle(); + const actorNames = diagObj.db.getActors(); + for (const member in actors) { + delete actors[member]; + } + let actorPos = 0; + actorNames.forEach((actorName) => { + actors[actorName] = { + color: conf8.actorColours[actorPos % conf8.actorColours.length], + position: actorPos + }; + actorPos++; + }); + drawActorLegend(diagram23); + bounds2.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50); + drawTasks(diagram23, tasks4, 0); + const box = bounds2.getBounds(); + if (title2) { + diagram23.append("text").text(title2).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25); + } + const height2 = box.stopy - box.starty + 2 * conf8.diagramMarginY; + const width3 = LEFT_MARGIN + box.stopx + 2 * conf8.diagramMarginX; + configureSvgSize(diagram23, height2, width3, conf8.useMaxWidth); + diagram23.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf8.height * 4).attr("x2", width3 - LEFT_MARGIN - 4).attr("y2", conf8.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); + const extraVertForTitle = title2 ? 70 : 0; + diagram23.attr("viewBox", `${box.startx} -25 ${width3} ${height2 + extraVertForTitle}`); + diagram23.attr("preserveAspectRatio", "xMinYMin meet"); + diagram23.attr("height", height2 + extraVertForTitle + 25); + }, "draw"); + bounds2 = { + data: { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0 + }, + verticalPos: 0, + sequenceItems: [], + init: /* @__PURE__ */ __name(function() { + this.sequenceItems = []; + this.data = { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0 + }; + this.verticalPos = 0; + }, "init"), + updateVal: /* @__PURE__ */ __name(function(obj, key, val, fun) { + if (obj[key] === void 0) { + obj[key] = val; + } else { + obj[key] = fun(val, obj[key]); + } + }, "updateVal"), + updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) { + const conf8 = getConfig2().journey; + const _self = this; + let cnt4 = 0; + function updateFn(type3) { + return /* @__PURE__ */ __name(function updateItemBounds(item) { + cnt4++; + const n2 = _self.sequenceItems.length - cnt4 + 1; + _self.updateVal(item, "starty", starty - n2 * conf8.boxMargin, Math.min); + _self.updateVal(item, "stopy", stopy + n2 * conf8.boxMargin, Math.max); + _self.updateVal(bounds2.data, "startx", startx - n2 * conf8.boxMargin, Math.min); + _self.updateVal(bounds2.data, "stopx", stopx + n2 * conf8.boxMargin, Math.max); + if (!(type3 === "activation")) { + _self.updateVal(item, "startx", startx - n2 * conf8.boxMargin, Math.min); + _self.updateVal(item, "stopx", stopx + n2 * conf8.boxMargin, Math.max); + _self.updateVal(bounds2.data, "starty", starty - n2 * conf8.boxMargin, Math.min); + _self.updateVal(bounds2.data, "stopy", stopy + n2 * conf8.boxMargin, Math.max); + } + }, "updateItemBounds"); + } + __name(updateFn, "updateFn"); + this.sequenceItems.forEach(updateFn()); + }, "updateBounds"), + insert: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) { + const _startx = Math.min(startx, stopx); + const _stopx = Math.max(startx, stopx); + const _starty = Math.min(starty, stopy); + const _stopy = Math.max(starty, stopy); + this.updateVal(bounds2.data, "startx", _startx, Math.min); + this.updateVal(bounds2.data, "starty", _starty, Math.min); + this.updateVal(bounds2.data, "stopx", _stopx, Math.max); + this.updateVal(bounds2.data, "stopy", _stopy, Math.max); + this.updateBounds(_startx, _starty, _stopx, _stopy); + }, "insert"), + bumpVerticalPos: /* @__PURE__ */ __name(function(bump) { + this.verticalPos = this.verticalPos + bump; + this.data.stopy = this.verticalPos; + }, "bumpVerticalPos"), + getVerticalPos: /* @__PURE__ */ __name(function() { + return this.verticalPos; + }, "getVerticalPos"), + getBounds: /* @__PURE__ */ __name(function() { + return this.data; + }, "getBounds") + }; + fills = conf7.sectionFills; + textColours = conf7.sectionColours; + drawTasks = /* @__PURE__ */ __name(function(diagram23, tasks4, verticalPos) { + const conf8 = getConfig2().journey; + let lastSection = ""; + const sectionVHeight = conf8.height * 2 + conf8.diagramMarginY; + const taskPos = verticalPos + sectionVHeight; + let sectionNumber = 0; + let fill = "#CCC"; + let colour = "black"; + let num = 0; + for (const [i2, task] of tasks4.entries()) { + if (lastSection !== task.section) { + fill = fills[sectionNumber % fills.length]; + num = sectionNumber % fills.length; + colour = textColours[sectionNumber % textColours.length]; + let taskInSectionCount = 0; + const currentSection4 = task.section; + for (let taskIndex = i2; taskIndex < tasks4.length; taskIndex++) { + if (tasks4[taskIndex].section == currentSection4) { + taskInSectionCount = taskInSectionCount + 1; + } else { + break; + } } - function eVc(a, b) { - qs.call(this, a, b); + const section = { + x: i2 * conf8.taskMargin + i2 * conf8.width + LEFT_MARGIN, + y: 50, + text: task.section, + fill, + num, + colour, + taskCount: taskInSectionCount + }; + svgDraw_default4.drawSection(diagram23, section, conf8); + lastSection = task.section; + sectionNumber++; + } + const taskActors = task.people.reduce((acc, actorName) => { + if (actors[actorName]) { + acc[actorName] = actors[actorName]; + } + return acc; + }, {}); + task.x = i2 * conf8.taskMargin + i2 * conf8.width + LEFT_MARGIN; + task.y = taskPos; + task.width = conf8.diagramMarginX; + task.height = conf8.diagramMarginY; + task.colour = colour; + task.fill = fill; + task.num = num; + task.actors = taskActors; + svgDraw_default4.drawTask(diagram23, task, conf8); + bounds2.insert(task.x, task.y, task.x + task.width + conf8.taskMargin, 300 + 5 * 30); + } + }, "drawTasks"); + journeyRenderer_default = { + setConf: setConf7, + draw: draw16 + }; + } + }); + + // src/diagrams/user-journey/journeyDiagram.ts + var journeyDiagram_exports = {}; + __export(journeyDiagram_exports, { + diagram: () => diagram16 + }); + var diagram16; + var init_journeyDiagram = __esm({ + "src/diagrams/user-journey/journeyDiagram.ts"() { + "use strict"; + init_journey(); + init_journeyDb(); + init_styles11(); + init_journeyRenderer(); + diagram16 = { + parser: journey_default, + db: journeyDb_default, + renderer: journeyRenderer_default, + styles: styles_default11, + init: /* @__PURE__ */ __name((cnf) => { + journeyRenderer_default.setConf(cnf.journey); + journeyDb_default.clear(); + }, "init") + }; + } + }); + + // src/diagrams/timeline/parser/timeline.jison + var parser16, timeline_default; + var init_timeline = __esm({ + "src/diagrams/timeline/parser/timeline.jison"() { + "use strict"; + parser16 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 16], $V7 = [1, 17]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "timeline": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "title": 11, "acc_title": 12, "acc_title_value": 13, "acc_descr": 14, "acc_descr_value": 15, "acc_descr_multiline_value": 16, "section": 17, "period_statement": 18, "event_statement": 19, "period": 20, "event": 21, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "timeline", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 20: "period", 21: "event" }, + productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [18, 1], [19, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 1: + return $$[$0 - 1]; + break; + case 2: + this.$ = []; + break; + case 3: + $$[$0 - 1].push($$[$0]); + this.$ = $$[$0 - 1]; + break; + case 4: + case 5: + this.$ = $$[$0]; + break; + case 6: + case 7: + this.$ = []; + break; + case 8: + yy.getCommonDb().setDiagramTitle($$[$0].substr(6)); + this.$ = $$[$0].substr(6); + break; + case 9: + this.$ = $$[$0].trim(); + yy.getCommonDb().setAccTitle(this.$); + break; + case 10: + case 11: + this.$ = $$[$0].trim(); + yy.getCommonDb().setAccDescription(this.$); + break; + case 12: + yy.addSection($$[$0].substr(8)); + this.$ = $$[$0].substr(8); + break; + case 15: + yy.addTask($$[$0], 0, ""); + this.$ = $$[$0]; + break; + case 16: + yy.addEvent($$[$0].substr(2)); + this.$ = $$[$0]; + break; } - function $Vc(a, b) { - qs.call(this, a, b); + }, "anonymous"), + table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o2($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o2($V0, [2, 7], { 1: [2, 1] }), o2($V0, [2, 3]), { 9: 18, 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o2($V0, [2, 5]), o2($V0, [2, 6]), o2($V0, [2, 8]), { 13: [1, 19] }, { 15: [1, 20] }, o2($V0, [2, 11]), o2($V0, [2, 12]), o2($V0, [2, 13]), o2($V0, [2, 14]), o2($V0, [2, 15]), o2($V0, [2, 16]), o2($V0, [2, 4]), o2($V0, [2, 9]), o2($V0, [2, 10])], + defaultActions: {}, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function XYc(a, b) { - qs.call(this, a, b); + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function MZc(a, b) { - qs.call(this, a, b); + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; } - function t_c(a, b) { - qs.call(this, a, b); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } } - function B_c(a, b) { - qs.call(this, a, b); + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + break; + case 1: + break; + case 2: + return 10; + break; + case 3: + break; + case 4: + break; + case 5: + return 4; + break; + case 6: + return 11; + break; + case 7: + this.begin("acc_title"); + return 12; + break; + case 8: + this.popState(); + return "acc_title_value"; + break; + case 9: + this.begin("acc_descr"); + return 14; + break; + case 10: + this.popState(); + return "acc_descr_value"; + break; + case 11: + this.begin("acc_descr_multiline"); + break; + case 12: + this.popState(); + break; + case 13: + return "acc_descr_multiline_value"; + break; + case 14: + return 17; + break; + case 15: + return 21; + break; + case 16: + return 20; + break; + case 17: + return 6; + break; + case 18: + return "INVALID"; + break; + } + }, "anonymous"), + rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s[^:\n]+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i], + conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser16.parser = parser16; + timeline_default = parser16; + } + }); + + // src/diagrams/timeline/timelineDb.js + var timelineDb_exports = {}; + __export(timelineDb_exports, { + addEvent: () => addEvent, + addSection: () => addSection4, + addTask: () => addTask3, + addTaskOrg: () => addTaskOrg3, + clear: () => clear24, + default: () => timelineDb_default, + getCommonDb: () => getCommonDb2, + getSections: () => getSections4, + getTasks: () => getTasks3 + }); + var currentSection3, currentTaskId, sections4, tasks3, rawTasks3, getCommonDb2, clear24, addSection4, getSections4, getTasks3, addTask3, addEvent, addTaskOrg3, compileTasks3, timelineDb_default; + var init_timelineDb = __esm({ + "src/diagrams/timeline/timelineDb.js"() { + "use strict"; + init_commonDb(); + currentSection3 = ""; + currentTaskId = 0; + sections4 = []; + tasks3 = []; + rawTasks3 = []; + getCommonDb2 = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb"); + clear24 = /* @__PURE__ */ __name(function() { + sections4.length = 0; + tasks3.length = 0; + currentSection3 = ""; + rawTasks3.length = 0; + clear(); + }, "clear"); + addSection4 = /* @__PURE__ */ __name(function(txt) { + currentSection3 = txt; + sections4.push(txt); + }, "addSection"); + getSections4 = /* @__PURE__ */ __name(function() { + return sections4; + }, "getSections"); + getTasks3 = /* @__PURE__ */ __name(function() { + let allItemsProcessed = compileTasks3(); + const maxDepth = 100; + let iterationCount = 0; + while (!allItemsProcessed && iterationCount < maxDepth) { + allItemsProcessed = compileTasks3(); + iterationCount++; + } + tasks3.push(...rawTasks3); + return tasks3; + }, "getTasks"); + addTask3 = /* @__PURE__ */ __name(function(period, length2, event3) { + const rawTask = { + id: currentTaskId++, + section: currentSection3, + type: currentSection3, + task: period, + score: length2 ? length2 : 0, + //if event is defined, then add it the events array + events: event3 ? [event3] : [] + }; + rawTasks3.push(rawTask); + }, "addTask"); + addEvent = /* @__PURE__ */ __name(function(event3) { + const currentTask = rawTasks3.find((task) => task.id === currentTaskId - 1); + currentTask.events.push(event3); + }, "addEvent"); + addTaskOrg3 = /* @__PURE__ */ __name(function(descr) { + const newTask = { + section: currentSection3, + type: currentSection3, + description: descr, + task: descr, + classes: [] + }; + tasks3.push(newTask); + }, "addTaskOrg"); + compileTasks3 = /* @__PURE__ */ __name(function() { + const compileTask = /* @__PURE__ */ __name(function(pos) { + return rawTasks3[pos].processed; + }, "compileTask"); + let allProcessed = true; + for (const [i2, rawTask] of rawTasks3.entries()) { + compileTask(i2); + allProcessed = allProcessed && rawTask.processed; + } + return allProcessed; + }, "compileTasks"); + timelineDb_default = { + clear: clear24, + getCommonDb: getCommonDb2, + addSection: addSection4, + getSections: getSections4, + getTasks: getTasks3, + addTask: addTask3, + addTaskOrg: addTaskOrg3, + addEvent + }; + } + }); + + // src/diagrams/timeline/svgDraw.js + function wrap2(text2, width3) { + text2.each(function() { + var text3 = select_default2(this), words = text3.text().split(/(\s+|
    )/).reverse(), word, line2 = [], lineHeight = 1.1, y5 = text3.attr("y"), dy = parseFloat(text3.attr("dy")), tspan = text3.text(null).append("tspan").attr("x", 0).attr("y", y5).attr("dy", dy + "em"); + for (let j2 = 0; j2 < words.length; j2++) { + word = words[words.length - 1 - j2]; + line2.push(word); + tspan.text(line2.join(" ").trim()); + if (tspan.node().getComputedTextLength() > width3 || word === "
    ") { + line2.pop(); + tspan.text(line2.join(" ").trim()); + if (word === "
    ") { + line2 = [""]; + } else { + line2 = [word]; + } + tspan = text3.append("tspan").attr("x", 0).attr("y", y5).attr("dy", lineHeight + "em").text(word); + } + } + }); + } + var MAX_SECTIONS, drawRect6, drawFace2, drawCircle2, drawText5, drawLabel3, drawSection2, taskCount2, drawTask2, drawBackgroundRect4, getTextObj4, getNoteRect3, _drawTextCandidateFunc4, initGraphics2, drawNode, getVirtualNodeHeight, defaultBkg, svgDraw_default5; + var init_svgDraw5 = __esm({ + "src/diagrams/timeline/svgDraw.js"() { + "use strict"; + init_src32(); + MAX_SECTIONS = 12; + drawRect6 = /* @__PURE__ */ __name(function(elem, rectData) { + const rectElem = elem.append("rect"); + rectElem.attr("x", rectData.x); + rectElem.attr("y", rectData.y); + rectElem.attr("fill", rectData.fill); + rectElem.attr("stroke", rectData.stroke); + rectElem.attr("width", rectData.width); + rectElem.attr("height", rectData.height); + rectElem.attr("rx", rectData.rx); + rectElem.attr("ry", rectData.ry); + if (rectData.class !== void 0) { + rectElem.attr("class", rectData.class); + } + return rectElem; + }, "drawRect"); + drawFace2 = /* @__PURE__ */ __name(function(element3, faceData) { + const radius2 = 15; + const circleElement = element3.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius2).attr("stroke-width", 2).attr("overflow", "visible"); + const face = element3.append("g"); + face.append("circle").attr("cx", faceData.cx - radius2 / 3).attr("cy", faceData.cy - radius2 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); + face.append("circle").attr("cx", faceData.cx + radius2 / 3).attr("cy", faceData.cy - radius2 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); + function smile(face2) { + const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius2 / 2).outerRadius(radius2 / 2.2); + face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")"); + } + __name(smile, "smile"); + function sad(face2) { + const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius2 / 2).outerRadius(radius2 / 2.2); + face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")"); + } + __name(sad, "sad"); + function ambivalent(face2) { + face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666"); + } + __name(ambivalent, "ambivalent"); + if (faceData.score > 3) { + smile(face); + } else if (faceData.score < 3) { + sad(face); + } else { + ambivalent(face); + } + return circleElement; + }, "drawFace"); + drawCircle2 = /* @__PURE__ */ __name(function(element3, circleData) { + const circleElement = element3.append("circle"); + circleElement.attr("cx", circleData.cx); + circleElement.attr("cy", circleData.cy); + circleElement.attr("class", "actor-" + circleData.pos); + circleElement.attr("fill", circleData.fill); + circleElement.attr("stroke", circleData.stroke); + circleElement.attr("r", circleData.r); + if (circleElement.class !== void 0) { + circleElement.attr("class", circleElement.class); + } + if (circleData.title !== void 0) { + circleElement.append("title").text(circleData.title); + } + return circleElement; + }, "drawCircle"); + drawText5 = /* @__PURE__ */ __name(function(elem, textData) { + const nText = textData.text.replace(//gi, " "); + const textElem = elem.append("text"); + textElem.attr("x", textData.x); + textElem.attr("y", textData.y); + textElem.attr("class", "legend"); + textElem.style("text-anchor", textData.anchor); + if (textData.class !== void 0) { + textElem.attr("class", textData.class); + } + const span = textElem.append("tspan"); + span.attr("x", textData.x + textData.textMargin * 2); + span.text(nText); + return textElem; + }, "drawText"); + drawLabel3 = /* @__PURE__ */ __name(function(elem, txtObject) { + function genPoints(x5, y5, width3, height2, cut) { + return x5 + "," + y5 + " " + (x5 + width3) + "," + y5 + " " + (x5 + width3) + "," + (y5 + height2 - cut) + " " + (x5 + width3 - cut * 1.2) + "," + (y5 + height2) + " " + x5 + "," + (y5 + height2); + } + __name(genPoints, "genPoints"); + const polygon2 = elem.append("polygon"); + polygon2.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7)); + polygon2.attr("class", "labelBox"); + txtObject.y = txtObject.y + txtObject.labelMargin; + txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin; + drawText5(elem, txtObject); + }, "drawLabel"); + drawSection2 = /* @__PURE__ */ __name(function(elem, section, conf8) { + const g2 = elem.append("g"); + const rect4 = getNoteRect3(); + rect4.x = section.x; + rect4.y = section.y; + rect4.fill = section.fill; + rect4.width = conf8.width; + rect4.height = conf8.height; + rect4.class = "journey-section section-type-" + section.num; + rect4.rx = 3; + rect4.ry = 3; + drawRect6(g2, rect4); + _drawTextCandidateFunc4(conf8)( + section.text, + g2, + rect4.x, + rect4.y, + rect4.width, + rect4.height, + { class: "journey-section section-type-" + section.num }, + conf8, + section.colour + ); + }, "drawSection"); + taskCount2 = -1; + drawTask2 = /* @__PURE__ */ __name(function(elem, task, conf8) { + const center4 = task.x + conf8.width / 2; + const g2 = elem.append("g"); + taskCount2++; + const maxHeight = 300 + 5 * 30; + g2.append("line").attr("id", "task" + taskCount2).attr("x1", center4).attr("y1", task.y).attr("x2", center4).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"); + drawFace2(g2, { + cx: center4, + cy: 300 + (5 - task.score) * 30, + score: task.score + }); + const rect4 = getNoteRect3(); + rect4.x = task.x; + rect4.y = task.y; + rect4.fill = task.fill; + rect4.width = conf8.width; + rect4.height = conf8.height; + rect4.class = "task task-type-" + task.num; + rect4.rx = 3; + rect4.ry = 3; + drawRect6(g2, rect4); + _drawTextCandidateFunc4(conf8)( + task.task, + g2, + rect4.x, + rect4.y, + rect4.width, + rect4.height, + { class: "task" }, + conf8, + task.colour + ); + }, "drawTask"); + drawBackgroundRect4 = /* @__PURE__ */ __name(function(elem, bounds4) { + const rectElem = drawRect6(elem, { + x: bounds4.startx, + y: bounds4.starty, + width: bounds4.stopx - bounds4.startx, + height: bounds4.stopy - bounds4.starty, + fill: bounds4.fill, + class: "rect" + }); + rectElem.lower(); + }, "drawBackgroundRect"); + getTextObj4 = /* @__PURE__ */ __name(function() { + return { + x: 0, + y: 0, + fill: void 0, + "text-anchor": "start", + width: 100, + height: 100, + textMargin: 0, + rx: 0, + ry: 0 + }; + }, "getTextObj"); + getNoteRect3 = /* @__PURE__ */ __name(function() { + return { + x: 0, + y: 0, + width: 100, + anchor: "start", + height: 100, + rx: 0, + ry: 0 + }; + }, "getNoteRect"); + _drawTextCandidateFunc4 = /* @__PURE__ */ function() { + function byText(content, g2, x5, y5, width3, height2, textAttrs, colour) { + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5 + height2 / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content); + _setTextAttrs(text2, textAttrs); + } + __name(byText, "byText"); + function byTspan(content, g2, x5, y5, width3, height2, textAttrs, conf8, colour) { + const { taskFontSize, taskFontFamily } = conf8; + const lines = content.split(//gi); + for (let i2 = 0; i2 < lines.length; i2++) { + const dy = i2 * taskFontSize - taskFontSize * (lines.length - 1) / 2; + const text2 = g2.append("text").attr("x", x5 + width3 / 2).attr("y", y5).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily); + text2.append("tspan").attr("x", x5 + width3 / 2).attr("dy", dy).text(lines[i2]); + text2.attr("y", y5 + height2 / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); + _setTextAttrs(text2, textAttrs); + } + } + __name(byTspan, "byTspan"); + function byFo(content, g2, x5, y5, width3, height2, textAttrs, conf8) { + const body = g2.append("switch"); + const f3 = body.append("foreignObject").attr("x", x5).attr("y", y5).attr("width", width3).attr("height", height2).attr("position", "fixed"); + const text2 = f3.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); + text2.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content); + byTspan(content, body, x5, y5, width3, height2, textAttrs, conf8); + _setTextAttrs(text2, textAttrs); + } + __name(byFo, "byFo"); + function _setTextAttrs(toText, fromTextAttrsDict) { + for (const key in fromTextAttrsDict) { + if (key in fromTextAttrsDict) { + toText.attr(key, fromTextAttrsDict[key]); + } + } + } + __name(_setTextAttrs, "_setTextAttrs"); + return function(conf8) { + return conf8.textPlacement === "fo" ? byFo : conf8.textPlacement === "old" ? byText : byTspan; + }; + }(); + initGraphics2 = /* @__PURE__ */ __name(function(graphics) { + graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z"); + }, "initGraphics"); + __name(wrap2, "wrap"); + drawNode = /* @__PURE__ */ __name(function(elem, node2, fullSection, conf8) { + const section = fullSection % MAX_SECTIONS - 1; + const nodeElem = elem.append("g"); + node2.section = section; + nodeElem.attr( + "class", + (node2.class ? node2.class + " " : "") + "timeline-node " + ("section-" + section) + ); + const bkgElem = nodeElem.append("g"); + const textElem = nodeElem.append("g"); + const txt = textElem.append("text").text(node2.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap2, node2.width); + const bbox = txt.node().getBBox(); + const fontSize = conf8.fontSize?.replace ? conf8.fontSize.replace("px", "") : conf8.fontSize; + node2.height = bbox.height + fontSize * 1.1 * 0.5 + node2.padding; + node2.height = Math.max(node2.height, node2.maxHeight); + node2.width = node2.width + 2 * node2.padding; + textElem.attr("transform", "translate(" + node2.width / 2 + ", " + node2.padding / 2 + ")"); + defaultBkg(bkgElem, node2, section, conf8); + return node2; + }, "drawNode"); + getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node2, conf8) { + const textElem = elem.append("g"); + const txt = textElem.append("text").text(node2.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap2, node2.width); + const bbox = txt.node().getBBox(); + const fontSize = conf8.fontSize?.replace ? conf8.fontSize.replace("px", "") : conf8.fontSize; + textElem.remove(); + return bbox.height + fontSize * 1.1 * 0.5 + node2.padding; + }, "getVirtualNodeHeight"); + defaultBkg = /* @__PURE__ */ __name(function(elem, node2, section) { + const rd = 5; + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + node2.type).attr( + "d", + `M0 ${node2.height - rd} v${-node2.height + 2 * rd} q0,-5 5,-5 h${node2.width - 2 * rd} q5,0 5,5 v${node2.height - rd} H0 Z` + ); + elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node2.height).attr("x2", node2.width).attr("y2", node2.height); + }, "defaultBkg"); + svgDraw_default5 = { + drawRect: drawRect6, + drawCircle: drawCircle2, + drawSection: drawSection2, + drawText: drawText5, + drawLabel: drawLabel3, + drawTask: drawTask2, + drawBackgroundRect: drawBackgroundRect4, + getTextObj: getTextObj4, + getNoteRect: getNoteRect3, + initGraphics: initGraphics2, + drawNode, + getVirtualNodeHeight + }; + } + }); + + // src/diagrams/timeline/timelineRenderer.ts + var draw18, drawTasks2, drawEvents, timelineRenderer_default; + var init_timelineRenderer = __esm({ + "src/diagrams/timeline/timelineRenderer.ts"() { + "use strict"; + init_src32(); + init_svgDraw5(); + init_logger(); + init_diagramAPI(); + init_setupGraphViewbox(); + draw18 = /* @__PURE__ */ __name(function(text2, id26, version4, diagObj) { + const conf8 = getConfig2(); + const LEFT_MARGIN2 = conf8.leftMargin ?? 50; + log.debug("timeline", diagObj.db); + const securityLevel = conf8.securityLevel; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = root4.select("#" + id26); + svg.append("g"); + const tasks4 = diagObj.db.getTasks(); + const title2 = diagObj.db.getCommonDb().getDiagramTitle(); + log.debug("task", tasks4); + svgDraw_default5.initGraphics(svg); + const sections5 = diagObj.db.getSections(); + log.debug("sections", sections5); + let maxSectionHeight = 0; + let maxTaskHeight = 0; + let depthY = 0; + let sectionBeginY = 0; + let masterX = 50 + LEFT_MARGIN2; + let masterY = 50; + sectionBeginY = 50; + let sectionNumber = 0; + let hasSections = true; + sections5.forEach(function(section) { + const sectionNode = { + number: sectionNumber, + descr: section, + section: sectionNumber, + width: 150, + padding: 20, + maxHeight: maxSectionHeight + }; + const sectionHeight = svgDraw_default5.getVirtualNodeHeight(svg, sectionNode, conf8); + log.debug("sectionHeight before draw", sectionHeight); + maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20); + }); + let maxEventCount = 0; + let maxEventLineLength = 0; + log.debug("tasks.length", tasks4.length); + for (const [i2, task] of tasks4.entries()) { + const taskNode = { + number: i2, + descr: task, + section: task.section, + width: 150, + padding: 20, + maxHeight: maxTaskHeight + }; + const taskHeight = svgDraw_default5.getVirtualNodeHeight(svg, taskNode, conf8); + log.debug("taskHeight before draw", taskHeight); + maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20); + maxEventCount = Math.max(maxEventCount, task.events.length); + let maxEventLineLengthTemp = 0; + for (const event3 of task.events) { + const eventNode = { + descr: event3, + section: task.section, + number: task.section, + width: 150, + padding: 20, + maxHeight: 50 + }; + maxEventLineLengthTemp += svgDraw_default5.getVirtualNodeHeight(svg, eventNode, conf8); + } + maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp); + } + log.debug("maxSectionHeight before draw", maxSectionHeight); + log.debug("maxTaskHeight before draw", maxTaskHeight); + if (sections5 && sections5.length > 0) { + sections5.forEach((section) => { + const tasksForSection = tasks4.filter((task) => task.section === section); + const sectionNode = { + number: sectionNumber, + descr: section, + section: sectionNumber, + width: 200 * Math.max(tasksForSection.length, 1) - 50, + padding: 20, + maxHeight: maxSectionHeight + }; + log.debug("sectionNode", sectionNode); + const sectionNodeWrapper = svg.append("g"); + const node2 = svgDraw_default5.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf8); + log.debug("sectionNode output", node2); + sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`); + masterY += maxSectionHeight + 50; + if (tasksForSection.length > 0) { + drawTasks2( + svg, + tasksForSection, + sectionNumber, + masterX, + masterY, + maxTaskHeight, + conf8, + maxEventCount, + maxEventLineLength, + maxSectionHeight, + false + ); } - function z2c(a, b) { - qs.call(this, a, b); - } - function h3c(a, b) { - qs.call(this, a, b); - } - function $3c(a, b) { - qs.call(this, a, b); - } - function i4c(a, b) { - qs.call(this, a, b); - } - function l5c(a, b) { - qs.call(this, a, b); - } - function v5c(a, b) { - qs.call(this, a, b); - } - function g6c(a, b) { - qs.call(this, a, b); - } - function A6c(a, b) { - qs.call(this, a, b); - } - function a7c(a, b) { - qs.call(this, a, b); - } - function B8c(a, b) { - qs.call(this, a, b); - } - function d9c(a, b) { - qs.call(this, a, b); - } - function D9c(a, b) { - qs.call(this, a, b); - } - function tad(a, b) { - qs.call(this, a, b); - } - function hbd(a, b) { - qs.call(this, a, b); - } - function Nbd(a, b) { - qs.call(this, a, b); - } - function Ybd(a, b) { - qs.call(this, a, b); - } - function ndd(a, b) { - qs.call(this, a, b); - } - function z1c(a, b) { - this.b = a; - this.a = b; - } - function B1c(a, b) { - this.b = a; - this.a = b; - } - function d2c(a, b) { - this.b = a; - this.a = b; - } - function f2c(a, b) { - this.b = a; - this.a = b; - } - function m9c(a, b) { - this.a = a; - this.b = b; - } - function xed(a, b) { - this.a = a; - this.b = b; - } - function ffd(a, b) { - this.a = a; - this.b = b; - } - function rjd(a, b) { - this.a = a; - this.b = b; - } - function Sjd(a, b) { - qs.call(this, a, b); - } - function Zhd(a, b) { - qs.call(this, a, b); - } - function lid(a, b) { - qs.call(this, a, b); - } - function vkd(a, b) { - qs.call(this, a, b); - } - function Gmd(a, b) { - qs.call(this, a, b); - } - function Pmd(a, b) { - qs.call(this, a, b); - } - function Zmd(a, b) { - qs.call(this, a, b); - } - function jnd(a, b) { - qs.call(this, a, b); - } - function Gnd(a, b) { - qs.call(this, a, b); - } - function Rnd(a, b) { - qs.call(this, a, b); - } - function eod(a, b) { - qs.call(this, a, b); - } - function qod(a, b) { - qs.call(this, a, b); - } - function Eod(a, b) { - qs.call(this, a, b); - } - function Qod(a, b) { - qs.call(this, a, b); - } - function upd(a, b) { - qs.call(this, a, b); - } - function Rpd(a, b) { - qs.call(this, a, b); - } - function eqd(a, b) { - qs.call(this, a, b); - } - function nqd(a, b) { - qs.call(this, a, b); - } - function vqd(a, b) { - qs.call(this, a, b); - } - function Hrd(a, b) { - qs.call(this, a, b); - } - function esd(a, b) { - this.a = a; - this.b = b; - } - function gsd(a, b) { - this.a = a; - this.b = b; - } - function isd(a, b) { - this.a = a; - this.b = b; - } - function Osd(a, b) { - this.a = a; - this.b = b; - } - function Qsd(a, b) { - this.a = a; - this.b = b; - } - function Ssd(a, b) { - this.a = a; - this.b = b; - } - function Ptd(a, b) { - this.a = a; - this.b = b; - } - function JEd(a, b) { - this.a = a; - this.b = b; - } - function KEd(a, b) { - this.a = a; - this.b = b; - } - function MEd(a, b) { - this.a = a; - this.b = b; - } - function NEd(a, b) { - this.a = a; - this.b = b; - } - function QEd(a, b) { - this.a = a; - this.b = b; - } - function REd(a, b) { - this.a = a; - this.b = b; - } - function SEd(a, b) { - this.b = a; - this.a = b; - } - function TEd(a, b) { - this.b = a; - this.a = b; - } - function bFd(a, b) { - this.b = a; - this.a = b; - } - function dFd(a, b) { - this.b = a; - this.a = b; - } - function fFd(a, b) { - this.a = a; - this.b = b; - } - function hFd(a, b) { - this.a = a; - this.b = b; - } - function utd(a, b) { - qs.call(this, a, b); - } - function sFd(a, b) { - this.a = a; - this.b = b; - } - function uFd(a, b) { - this.a = a; - this.b = b; - } - function bGd(a, b) { - qs.call(this, a, b); - } - function uId(a, b) { - this.f = a; - this.c = b; - } - function Ofd(a, b) { - return Csb(a.g, b); - } - function Tqc(a, b) { - return Csb(b.b, a); - } - function HPd(a, b) { - return QNd(a.a, b); - } - function Idd(a, b) { - return -a.b.af(b); - } - function IId(a, b) { - !!a && Zjb(CId, a, b); - } - function yWd(a, b) { - a.i = null; - zWd(a, b); - } - function kEd(a, b, c2) { - pDd(b, KDd(a, c2)); - } - function lEd(a, b, c2) { - pDd(b, KDd(a, c2)); - } - function mFd(a, b) { - vEd(a.a, RD(b, 58)); - } - function _Mc(a, b) { - GMc(a.a, RD(b, 12)); - } - function KTd(a, b) { - this.a = a; - this.b = b; - } - function NTd(a, b) { - this.a = a; - this.b = b; - } - function B5d(a, b) { - this.a = a; - this.b = b; - } - function Z6d(a, b) { - this.a = a; - this.b = b; - } - function Ble(a, b) { - this.a = a; - this.b = b; - } - function afe(a, b) { - this.d = a; - this.b = b; - } - function wfe(a, b) { - this.e = a; - this.a = b; - } - function Eke(a, b) { - this.b = a; - this.c = b; - } - function zNd(a, b) { - this.i = a; - this.g = b; - } - function kZd(a, b) { - this.d = a; - this.e = b; - } - function ave(a, b) { - eve(new dMd(a), b); - } - function Dke(a) { - return pge(a.c, a.b); - } - function Wd(a) { - return !a ? null : a.md(); - } - function dE(a) { - return a == null ? null : a; - } - function bE(a) { - return typeof a === jve; - } - function $D(a) { - return typeof a === hve; - } - function _D(a) { - return typeof a === ive; - } - function Gdb(a, b) { - return Ddb(a, b) == 0; - } - function Jdb(a, b) { - return Ddb(a, b) >= 0; - } - function Pdb(a, b) { - return Ddb(a, b) != 0; - } - function ar(a, b) { - return zr(a.Kc(), b); - } - function Qm(a, b) { - return a.Rd().Xb(b); - } - function kg(a) { - ig(a); - return a.d.gc(); - } - function fE(a) { - CFb(a == null); - return a; - } - function Mhb(a, b) { - a.a += "" + b; - return a; - } - function Nhb(a, b) { - a.a += "" + b; - return a; - } - function Whb(a, b) { - a.a += "" + b; - return a; - } - function Yhb(a, b) { - a.a += "" + b; - return a; - } - function Zhb(a, b) { - a.a += "" + b; - return a; - } - function Vhb(a, b) { - return a.a += "" + b, a; - } - function Pfb(a) { - return "" + (uFb(a), a); - } - function Vsb(a) { - akb(this); - Ld(this, a); - } - function YFc() { - RFc(); - UFc.call(this); - } - function pxb(a, b) { - kxb.call(this, a, b); - } - function txb(a, b) { - kxb.call(this, a, b); - } - function xxb(a, b) { - kxb.call(this, a, b); - } - function Oub(a, b) { - Pub(a, b, a.c.b, a.c); - } - function Nub(a, b) { - Pub(a, b, a.a, a.a.a); - } - function Iob(a) { - tFb(a, 0); - return null; - } - function Xvb() { - this.b = 0; - this.a = false; - } - function dwb() { - this.b = 0; - this.a = false; - } - function Et() { - this.b = new Usb(Sv(12)); - } - function pMb() { - pMb = geb; - oMb = ss(nMb()); - } - function ncc() { - ncc = geb; - mcc = ss(lcc()); - } - function aZc() { - aZc = geb; - _Yc = ss($Yc()); - } - function WA() { - WA = geb; - vA(); - VA = new Tsb(); - } - function hjd(a) { - a.a = 0; - a.b = 0; - return a; - } - function qfd(a, b) { - a.a = b.g + 1; - return a; - } - function yNd(a, b) { - aMd.call(this, a, b); - } - function lGd(a, b) { - kGd.call(this, a, b); - } - function N$d(a, b) { - zNd.call(this, a, b); - } - function Whe(a, b) { - Q2d.call(this, a, b); - } - function She(a, b) { - Phe.call(this, a, b); - } - function RRd(a, b) { - PRd(); - Zjb(ORd, a, b); - } - function sB(a, b) { - a.q.setTime(Xdb(b)); - } - function Xz(a) { - $wnd.clearTimeout(a); - } - function cr(a) { - return Qb(a), new Dl(a); - } - function mb(a, b) { - return dE(a) === dE(b); - } - function Mw(a, b) { - return a.a.a.a.cc(b); - } - function qeb(a, b) { - return zhb(a.a, 0, b); - } - function SSb(a) { - return MSb(RD(a, 74)); - } - function Nfb(a) { - return eE((uFb(a), a)); - } - function Ofb(a) { - return eE((uFb(a), a)); - } - function gD(a) { - return hD(a.l, a.m, a.h); - } - function egb(a, b) { - return hgb(a.a, b.a); - } - function ygb(a, b) { - return Agb(a.a, b.a); - } - function Sfb(a, b) { - return Qfb(a.a, b.a); - } - function qhb(a, b) { - return a.indexOf(b); - } - function nOc(a, b) { - return a.j[b.p] == 2; - } - function cz(a, b) { - return a == b ? 0 : a ? 1 : -1; - } - function AB(a) { - return a < 10 ? "0" + a : "" + a; - } - function Kdb(a) { - return typeof a === ive; - } - function oZb(a) { - return a == jZb || a == mZb; - } - function pZb(a) { - return a == jZb || a == kZb; - } - function ELb(a, b) { - return hgb(a.g, b.g); - } - function Q4b(a) { - return Wmb(a.b.b, a, 0); - } - function Q2b() { - J2b.call(this, 0, 0, 0, 0); - } - function Iub() { - ctb.call(this, new gub()); - } - function Znb(a, b) { - Wnb(a, 0, a.length, b); - } - function Eyb(a, b) { - Rmb(a.a, b); - return b; - } - function Fkc(a, b) { - lkc(); - return b.a += a; - } - function Hkc(a, b) { - lkc(); - return b.a += a; - } - function Gkc(a, b) { - lkc(); - return b.c += a; - } - function ied(a, b) { - Rmb(a.c, b); - return a; - } - function Ped(a, b) { - ofd(a.a, b); - return a; - } - function ttb(a) { - this.a = Itb(); - this.b = a; - } - function Ntb(a) { - this.a = Itb(); - this.b = a; - } - function sjd(a) { - this.a = a.a; - this.b = a.b; - } - function Dl(a) { - this.a = a; - zl.call(this); - } - function Gl(a) { - this.a = a; - zl.call(this); - } - function Tid() { - Uid2.call(this, 0, 0, 0, 0); - } - function vfd(a) { - return ofd(new ufd(), a); - } - function Ksd(a) { - return iyd(RD(a, 123)); - } - function Mvd(a) { - return a.vh() && a.wh(); - } - function Dod(a) { - return a != zod && a != Aod; - } - function Dmd(a) { - return a == ymd || a == zmd; - } - function Emd(a) { - return a == Bmd || a == xmd; - } - function xDc(a) { - return a == tDc || a == sDc; - } - function yrc(a, b) { - return hgb(a.g, b.g); - } - function Yfe(a, b) { - return new Phe(b, a); - } - function Zfe(a, b) { - return new Phe(b, a); - } - function lr(a) { - return Dr(a.b.Kc(), a.a); - } - function IXd(a, b) { - yXd(a, b); - zXd(a, a.D); - } - function Uxd(a, b, c2) { - Vxd(a, b); - Wxd(a, c2); - } - function zyd(a, b, c2) { - Cyd(a, b); - Ayd(a, c2); - } - function Byd(a, b, c2) { - Dyd(a, b); - Eyd(a, c2); - } - function Gzd(a, b, c2) { - Hzd(a, b); - Izd(a, c2); - } - function Nzd(a, b, c2) { - Ozd(a, b); - Pzd(a, c2); - } - function eh(a, b, c2) { - bh.call(this, a, b, c2); - } - function zId(a) { - uId.call(this, a, true); - } - function nAb() { - dAb.call(this, "Tail", 3); - } - function iAb() { - dAb.call(this, "Head", 1); - } - function ejb(a) { - Pib(); - fjb.call(this, a); - } - function A3b(a) { - J2b.call(this, a, a, a, a); - } - function Pmb(a) { - a.c = $C(jJ, rve, 1, 0, 5, 1); + masterX += 200 * Math.max(tasksForSection.length, 1); + masterY = sectionBeginY; + sectionNumber++; + }); + } else { + hasSections = false; + drawTasks2( + svg, + tasks4, + sectionNumber, + masterX, + masterY, + maxTaskHeight, + conf8, + maxEventCount, + maxEventLineLength, + maxSectionHeight, + true + ); + } + const box = svg.node().getBBox(); + log.debug("bounds", box); + if (title2) { + svg.append("text").text(title2).attr("x", box.width / 2 - LEFT_MARGIN2).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20); + } + depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100; + const lineWrapper = svg.append("g").attr("class", "lineWrapper"); + lineWrapper.append("line").attr("x1", LEFT_MARGIN2).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN2).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); + setupGraphViewbox( + void 0, + svg, + conf8.timeline?.padding ?? 50, + conf8.timeline?.useMaxWidth ?? false + ); + }, "draw"); + drawTasks2 = /* @__PURE__ */ __name(function(diagram23, tasks4, sectionColor, masterX, masterY, maxTaskHeight, conf8, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) { + for (const task of tasks4) { + const taskNode = { + descr: task.task, + section: sectionColor, + number: sectionColor, + width: 150, + padding: 20, + maxHeight: maxTaskHeight + }; + log.debug("taskNode", taskNode); + const taskWrapper = diagram23.append("g").attr("class", "taskWrapper"); + const node2 = svgDraw_default5.drawNode(taskWrapper, taskNode, sectionColor, conf8); + const taskHeight = node2.height; + log.debug("taskHeight after draw", taskHeight); + taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`); + maxTaskHeight = Math.max(maxTaskHeight, taskHeight); + if (task.events) { + const lineWrapper = diagram23.append("g").attr("class", "lineWrapper"); + let lineLength = maxTaskHeight; + masterY += 100; + lineLength = lineLength + drawEvents(diagram23, task.events, sectionColor, masterX, masterY, conf8); + masterY -= 100; + lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr( + "y2", + masterY + maxTaskHeight + (isWithoutSections ? maxTaskHeight : maxSectionHeight) + maxEventLineLength + 120 + ).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5"); + } + masterX = masterX + 200; + if (isWithoutSections && !conf8.timeline?.disableMulticolor) { + sectionColor++; + } + } + masterY = masterY - 10; + }, "drawTasks"); + drawEvents = /* @__PURE__ */ __name(function(diagram23, events, sectionColor, masterX, masterY, conf8) { + let maxEventHeight = 0; + const eventBeginY = masterY; + masterY = masterY + 100; + for (const event3 of events) { + const eventNode = { + descr: event3, + section: sectionColor, + number: sectionColor, + width: 150, + padding: 20, + maxHeight: 50 + }; + log.debug("eventNode", eventNode); + const eventWrapper = diagram23.append("g").attr("class", "eventWrapper"); + const node2 = svgDraw_default5.drawNode(eventWrapper, eventNode, sectionColor, conf8); + const eventHeight = node2.height; + maxEventHeight = maxEventHeight + eventHeight; + eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`); + masterY = masterY + 10 + eventHeight; + } + masterY = eventBeginY; + return maxEventHeight; + }, "drawEvents"); + timelineRenderer_default = { + setConf: /* @__PURE__ */ __name(() => { + }, "setConf"), + draw: draw18 + }; + } + }); + + // src/diagrams/timeline/styles.js + var genSections, getStyles13, styles_default12; + var init_styles12 = __esm({ + "src/diagrams/timeline/styles.js"() { + "use strict"; + init_dist(); + genSections = /* @__PURE__ */ __name((options3) => { + let sections5 = ""; + for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) { + options3["lineColor" + i2] = options3["lineColor" + i2] || options3["cScaleInv" + i2]; + if (is_dark_default(options3["lineColor" + i2])) { + options3["lineColor" + i2] = lighten_default(options3["lineColor" + i2], 20); + } else { + options3["lineColor" + i2] = darken_default(options3["lineColor" + i2], 20); + } + } + for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) { + const sw = "" + (17 - 3 * i2); + sections5 += ` + .section-${i2 - 1} rect, .section-${i2 - 1} path, .section-${i2 - 1} circle, .section-${i2 - 1} path { + fill: ${options3["cScale" + i2]}; + } + .section-${i2 - 1} text { + fill: ${options3["cScaleLabel" + i2]}; + } + .node-icon-${i2 - 1} { + font-size: 40px; + color: ${options3["cScaleLabel" + i2]}; + } + .section-edge-${i2 - 1}{ + stroke: ${options3["cScale" + i2]}; + } + .edge-depth-${i2 - 1}{ + stroke-width: ${sw}; + } + .section-${i2 - 1} line { + stroke: ${options3["cScaleInv" + i2]} ; + stroke-width: 3; + } + + .lineWrapper line{ + stroke: ${options3["cScaleLabel" + i2]} ; + } + + .disabled, .disabled circle, .disabled text { + fill: lightgray; + } + .disabled text { + fill: #efefef; + } + `; + } + return sections5; + }, "genSections"); + getStyles13 = /* @__PURE__ */ __name((options3) => ` + .edge { + stroke-width: 3; + } + ${genSections(options3)} + .section-root rect, .section-root path, .section-root circle { + fill: ${options3.git0}; + } + .section-root text { + fill: ${options3.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .eventWrapper { + filter: brightness(120%); + } +`, "getStyles"); + styles_default12 = getStyles13; + } + }); + + // src/diagrams/timeline/timeline-definition.ts + var timeline_definition_exports = {}; + __export(timeline_definition_exports, { + diagram: () => diagram18 + }); + var diagram18; + var init_timeline_definition = __esm({ + "src/diagrams/timeline/timeline-definition.ts"() { + "use strict"; + init_timeline(); + init_timelineDb(); + init_timelineRenderer(); + init_styles12(); + diagram18 = { + db: timelineDb_exports, + renderer: timelineRenderer_default, + parser: timeline_default, + styles: styles_default12 + }; + } + }); + + // src/diagrams/mindmap/parser/mindmap.jison + var parser17, mindmap_default; + var init_mindmap = __esm({ + "src/diagrams/mindmap/parser/mindmap.jison"() { + "use strict"; + parser17 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 6, 13, 15, 16, 19, 22], $Vd = [1, 33], $Ve = [1, 34], $Vf = [1, 6, 7, 11, 13, 15, 16, 19, 22]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "mindMap": 4, "spaceLines": 5, "SPACELINE": 6, "NL": 7, "MINDMAP": 8, "document": 9, "stop": 10, "EOF": 11, "statement": 12, "SPACELIST": 13, "node": 14, "ICON": 15, "CLASS": 16, "nodeWithId": 17, "nodeWithoutId": 18, "NODE_DSTART": 19, "NODE_DESCR": 20, "NODE_DEND": 21, "NODE_ID": 22, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" }, + productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 6: + case 7: + return yy; + break; + case 8: + yy.getLogger().trace("Stop NL "); + break; + case 9: + yy.getLogger().trace("Stop EOF "); + break; + case 11: + yy.getLogger().trace("Stop NL2 "); + break; + case 12: + yy.getLogger().trace("Stop EOF2 "); + break; + case 15: + yy.getLogger().info("Node: ", $$[$0].id); + yy.addNode($$[$0 - 1].length, $$[$0].id, $$[$0].descr, $$[$0].type); + break; + case 16: + yy.getLogger().trace("Icon: ", $$[$0]); + yy.decorateNode({ icon: $$[$0] }); + break; + case 17: + case 21: + yy.decorateNode({ class: $$[$0] }); + break; + case 18: + yy.getLogger().trace("SPACELIST"); + break; + case 19: + yy.getLogger().trace("Node: ", $$[$0].id); + yy.addNode(0, $$[$0].id, $$[$0].descr, $$[$0].type); + break; + case 20: + yy.decorateNode({ icon: $$[$0] }); + break; + case 25: + yy.getLogger().trace("node found ..", $$[$0 - 2]); + this.$ = { id: $$[$0 - 1], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) }; + break; + case 26: + this.$ = { id: $$[$0], descr: $$[$0], type: yy.nodeType.DEFAULT }; + break; + case 27: + yy.getLogger().trace("node found ..", $$[$0 - 3]); + this.$ = { id: $$[$0 - 3], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) }; + break; } - function yRb(a) { - a.b && CRb(a); - return a.a; + }, "anonymous"), + table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: $V0 }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: $V0 }, { 6: $V1, 7: [1, 10], 9: 9, 12: 11, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, o2($V7, [2, 3]), { 1: [2, 2] }, o2($V7, [2, 4]), o2($V7, [2, 5]), { 1: [2, 6], 6: $V1, 12: 21, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, { 6: $V1, 9: 22, 12: 11, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, { 6: $V8, 7: $V9, 10: 23, 11: $Va }, o2($Vb, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: $V5, 22: $V6 }), o2($Vb, [2, 18]), o2($Vb, [2, 19]), o2($Vb, [2, 20]), o2($Vb, [2, 21]), o2($Vb, [2, 23]), o2($Vb, [2, 24]), o2($Vb, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: $V8, 7: $V9, 10: 32, 11: $Va }, { 1: [2, 7], 6: $V1, 12: 21, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, o2($Vc, [2, 14], { 7: $Vd, 11: $Ve }), o2($Vf, [2, 8]), o2($Vf, [2, 9]), o2($Vf, [2, 10]), o2($Vb, [2, 15]), o2($Vb, [2, 16]), o2($Vb, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, o2($Vc, [2, 13], { 7: $Vd, 11: $Ve }), o2($Vf, [2, 11]), o2($Vf, [2, 12]), { 21: [1, 37] }, o2($Vb, [2, 25]), o2($Vb, [2, 27])], + defaultActions: { 2: [2, 1], 6: [2, 2] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; } - function zRb(a) { - a.b && CRb(a); - return a.c; + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; } - function mBb(a, b) { - if (dBb) { - return; + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; } - a.b = b; - } - function YCb(a, b) { - return a[a.length] = b; - } - function _Cb(a, b) { - return a[a.length] = b; - } - function l5b(a, b) { - return NGd(b, MCd(a)); - } - function m5b(a, b) { - return NGd(b, MCd(a)); - } - function DDd(a, b) { - return lp(Co(a.d), b); - } - function EDd(a, b) { - return lp(Co(a.g), b); - } - function FDd(a, b) { - return lp(Co(a.j), b); - } - function mGd(a, b) { - kGd.call(this, a.b, b); - } - function s0d(a, b) { - WGd(tYd(a.a), v0d(b)); - } - function B4d(a, b) { - WGd(o4d(a.a), E4d(b)); - } - function Asd(a, b, c2) { - Byd(c2, c2.i + a, c2.j + b); - } - function eFc(a, b, c2) { - bD(a.c[b.g], b.g, c2); - } - function zVd(a, b, c2) { - RD(a.c, 71).Gi(b, c2); - } - function LMd(a, b, c2) { - bD(a, b, c2); - return c2; - } - function DJb(a) { - Umb(a.Sf(), new HJb(a)); - } - function Gvb(a) { - return a != null ? tb(a) : 0; - } - function aOd(a) { - return a == null ? 0 : tb(a); - } - function iue(a) { - Vse(); - Wse.call(this, a); - } - function Ug(a) { - this.a = a; - Og.call(this, a); - } - function Zy() { - Zy = geb; - $wnd.Math.log(2); - } - function s7d() { - s7d = geb; - r7d = ($Sd(), ZSd); - } - function FRc() { - FRc = geb; - ERc = new Zrb(u3); - } - function Hde() { - Hde = geb; - new Ide(); - new bnb(); - } - function Ide() { - new Tsb(); - new Tsb(); - new Tsb(); - } - function yue() { - throw Adb(new kib(bMe)); - } - function Nue() { - throw Adb(new kib(bMe)); - } - function Bue() { - throw Adb(new kib(cMe)); - } - function Que() { - throw Adb(new kib(cMe)); - } - function Gp(a) { - this.a = a; - rf.call(this, a); - } - function Np(a) { - this.a = a; - rf.call(this, a); - } - function Sq(a, b) { - tm(); - this.a = a; - this.b = b; - } - function Jh(a, b) { - Qb(b); - Ih(a).Jc(new jx()); - } - function _mb(a, b) { - Ynb(a.c, a.c.length, b); - } - function xnb(a) { - return a.a < a.c.c.length; - } - function Msb(a) { - return a.a < a.c.a.length; - } - function Wvb(a, b) { - return a.a ? a.b : b.We(); - } - function hgb(a, b) { - return a < b ? -1 : a > b ? 1 : 0; - } - function Kgb(a, b) { - return Ddb(a, b) > 0 ? a : b; - } - function hD(a, b, c2) { - return { l: a, m: b, h: c2 }; - } - function Mvb(a, b) { - a.a != null && _Mc(b, a.a); - } - function Lhc(a) { - Y0b(a, null); - Z0b(a, null); - } - function xkc(a, b, c2) { - return Zjb(a.g, c2, b); - } - function bFc(a, b, c2) { - return _Ec(b, c2, a.c); - } - function jOc(a, b, c2) { - return Zjb(a.k, c2, b); - } - function pOc(a, b, c2) { - qOc(a, b, c2); - return c2; - } - function FOc(a, b) { - dOc(); - return b.n.b += a; - } - function lUb(a) { - VTb.call(this); - this.b = a; - } - function y2b(a) { - v2b.call(this); - this.a = a; - } - function kAb() { - dAb.call(this, "Range", 2); - } - function $Fb(a) { - this.b = a; - this.a = new bnb(); - } - function WQb(a) { - this.b = new gRb(); - this.a = a; - } - function Lub(a) { - a.a = new svb(); - a.c = new svb(); - } - function nrc(a) { - a.a = new Tsb(); - a.d = new Tsb(); - } - function $Sc(a) { - _Sc(a, null); - aTc(a, null); - } - function a2d(a, b) { - return xA(a.a, b, null); - } - function Cdd(a, b) { - return Zjb(a.a, b.a, b); - } - function ajd(a) { - return new rjd(a.a, a.b); - } - function Pid(a) { - return new rjd(a.c, a.d); - } - function Qid(a) { - return new rjd(a.c, a.d); - } - function Ake(a, b) { - return Tfe(a.c, a.b, b); - } - function ZD(a, b) { - return a != null && QD(a, b); - } - function br(a, b) { - return Jr(a.Kc(), b) != -1; - } - function Hr(a) { - return a.Ob() ? a.Pb() : null; - } - function _p(a) { - this.b = (yob(), new uqb(a)); - } - function zke(a) { - this.a = a; - Tsb.call(this); - } - function Uhe() { - Q2d.call(this, null, null); - } - function Yhe() { - p3d.call(this, null, null); - } - function As() { - qs.call(this, "INSTANCE", 0); - } - function dXb() { - _Wb(); - this.a = new Wed(UP); - } - function Hhb(a) { - return Ihb(a, 0, a.length); - } - function Rv(a, b) { - return new ew(a.Kc(), b); - } - function $sb(a, b) { - return a.a.Bc(b) != null; - } - function hZd(a, b) { - sLd(a); - a.Gc(RD(b, 15)); - } - function ONd(a, b, c2) { - a.c.bd(b, RD(c2, 136)); - } - function eOd(a, b, c2) { - a.c.Ui(b, RD(c2, 136)); + return token2; } - function eub(a, b) { - if (a.c) { - rub(b); - qub(b); + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; } - } - function oB(a, b) { - a.q.setHours(b); - mB(a, b); - } - function vTb(a, b) { - Zid(b, a.a.a.a, a.a.a.b); - } - function tKb(a, b, c2, d) { - bD(a.a[b.g], c2.g, d); - } - function oKb(a, b, c2) { - return a.a[b.g][c2.g]; - } - function AIc(a, b) { - return a.e[b.c.p][b.p]; - } - function TIc(a, b) { - return a.c[b.c.p][b.p]; - } - function pJc(a, b) { - return a.a[b.c.p][b.p]; - } - function mOc(a, b) { - return a.j[b.p] = AOc(b); - } - function wAb(a, b) { - return a.a.Bc(b) != null; - } - function wXc(a, b) { - return Kfb(UD(b.a)) <= a; - } - function xXc(a, b) { - return Kfb(UD(b.a)) >= a; - } - function vhd(a, b) { - return jhb(a.f, b.Pg()); - } - function cjd(a, b) { - return a.a * b.a + a.b * b.b; - } - function Wsd(a, b) { - return a.a < Qeb(b) ? -1 : 1; - } - function gGd(a, b) { - return jhb(a.b, b.Pg()); - } - function xIc(a, b, c2) { - return c2 ? b != 0 : b != a - 1; - } - function Mwb(a, b, c2) { - a.a = b ^ 1502; - a.b = c2 ^ Mxe; - } - function ljd(a, b, c2) { - a.a = b; - a.b = c2; - return a; - } - function ijd(a, b) { - a.a *= b; - a.b *= b; - return a; - } - function Rmb(a, b) { - ZEb(a.c, b); - return true; - } - function MHd(a, b, c2) { - bD(a.g, b, c2); - return c2; - } - function XZd(a, b, c2) { - PZd.call(this, a, b, c2); - } - function _Zd(a, b, c2) { - XZd.call(this, a, b, c2); - } - function aie(a, b, c2) { - Kfe.call(this, a, b, c2); - } - function eie(a, b, c2) { - Kfe.call(this, a, b, c2); - } - function gie(a, b, c2) { - aie.call(this, a, b, c2); - } - function iie(a, b, c2) { - XZd.call(this, a, b, c2); - } - function lie(a, b, c2) { - _Zd.call(this, a, b, c2); - } - function vie(a, b, c2) { - PZd.call(this, a, b, c2); - } - function zie(a, b, c2) { - PZd.call(this, a, b, c2); - } - function Cie(a, b, c2) { - vie.call(this, a, b, c2); - } - function ez(a) { - a.j = $C(mJ, Nve, 319, 0, 0, 1); - } - function wmb() { - this.a = $C(jJ, rve, 1, 8, 5, 1); - } - function dWd() { - this.Bb |= 256; - this.Bb |= 512; - } - function dMd(a) { - this.i = a; - this.f = this.i.j; - } - function Rue(a) { - this.c = a; - this.a = this.c.a; - } - function zf(a, b) { - this.a = a; - rf.call(this, b); - } - function Eb(a, b) { - return Db(a, new bib(), b).a; - } - function Lb(a) { - if (!a) { - throw Adb(new _fb()); + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); + } + } + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); } - } - function Ub(a) { - if (!a) { - throw Adb(new cgb()); + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; } } - function Txb() { - Txb = geb; - Txb(); - Sxb = new $xb(); - } - function fke() { - fke = geb; - Gie(); - eke = new gke(); - } - function Kvb() { - Kvb = geb; - Jvb = new Ovb(null); - } - function OGd(a) { - Ivb(a, IIe); - pzd(a, GGd(a)); - } - function mNd(a) { - a.a = RD(Ywd(a.b.a, 4), 129); - } - function uNd(a) { - a.a = RD(Ywd(a.b.a, 4), 129); - } - function Mg(a) { - a.b.Qb(); - --a.d.f.d; - jg(a.d); - } - function Zj(a) { - this.a = a; - Aj.call(this, a.d); - } - function ij(a, b) { - this.a = a; - pc.call(this, b); - } - function sj(a, b) { - this.a = a; - pc.call(this, b); - } - function Rj(a, b) { - this.a = a; - pc.call(this, b); - } - function Il(a, b) { - this.a = b; - pc.call(this, a); - } - function ap(a, b) { - this.a = b; - Xo.call(this, a); - } - function Ap(a, b) { - this.a = a; - Xo.call(this, b); - } - function Yr(a, b) { - this.a = b; - Tr.call(this, a); - } - function ew(a, b) { - this.a = b; - Tr.call(this, a); - } - function Mr(a, b) { - Qb(b); - return new Yr(a, b); - } - function ru(a, b) { - return new Ou(a.a, a.b, b); - } - function rhb(a, b, c2) { - return a.indexOf(b, c2); - } - function thb(a, b) { - return a.lastIndexOf(b); - } - function Ghb(a) { - return a == null ? vve : jeb(a); - } - function Ez(a) { - return a == null ? null : a.name; - } - function qD(a) { - return a.l + a.m * gxe + a.h * hxe; - } - function Gr(a) { - return dvb(a.a) ? Fr(a) : null; - } - function Shb(a) { - reb.call(this, (uFb(a), a)); - } - function dib(a) { - reb.call(this, (uFb(a), a)); - } - function dl(a) { - Qk.call(this, RD(Qb(a), 34)); - } - function tl(a) { - Qk.call(this, RD(Qb(a), 34)); - } - function Jub(a) { - ctb.call(this, new hub(a)); - } - function Upb(a) { - xpb.call(this, a); - this.a = a; - } - function hqb(a) { - Ppb.call(this, a); - this.a = a; - } - function jrb(a) { - Lqb.call(this, a); - this.a = a; - } - function mz() { - ez(this); - gz(this); - this.je(); - } - function Dzb(a) { - this.a = a; - Plb.call(this, a); - } - function Lvb(a) { - sFb(a.a != null); - return a.a; - } - function gGb(a, b) { - Rmb(b.a, a.a); - return a.a; - } - function mGb(a, b) { - Rmb(b.b, a.a); - return a.a; - } - function eJb(a, b) { - Rmb(b.a, a.a); - return a.a; - } - function aib(a, b, c2) { - peb(a, b, b, c2); - return a; - } - function EIb(a, b) { - ++a.b; - return Rmb(a.a, b); - } - function FIb(a, b) { - ++a.b; - return Ymb(a.a, b); - } - function NNb(a, b) { - return Qfb(a.c.d, b.c.d); - } - function ZNb(a, b) { - return Qfb(a.c.c, b.c.c); - } - function E9b(a, b) { - return Qfb(a.n.a, b.n.a); - } - function B$b(a, b) { - return RD(Qc(a.b, b), 15); - } - function Jac(a, b) { - return a.n.b = (uFb(b), b); - } - function Kac(a, b) { - return a.n.b = (uFb(b), b); - } - function Csb(a, b) { - return !!b && a.b[b.g] == b; - } - function k4b(a) { - return xnb(a.a) || xnb(a.b); - } - function kFb(a) { - return a.$H || (a.$H = ++iFb); - } - function Nvb(a) { - return a.a != null ? a.a : null; - } - function uXc(a, b) { - return Qfb(a.e.b, b.e.b); - } - function CXc(a, b) { - return Qfb(a.e.a, b.e.a); - } - function ZEc(a, b, c2) { - return $Ec(a, b, c2, a.b); - } - function aFc(a, b, c2) { - return $Ec(a, b, c2, a.c); - } - function Ikc(a) { - lkc(); - return !!a && !a.dc(); - } - function Yjc() { - Wjc(); - this.b = new ckc(this); - } - function tNb() { - tNb = geb; - sNb = new kGd(Xye, 0); - } - function Geb() { - Geb = geb; - Eeb = false; - Feb = true; - } - function E8b(a) { - var b; - b = a.a; - a.a = a.b; - a.b = b; - } - function Q2d(a, b) { - N2d(); - this.a = a; - this.b = b; - } - function p3d(a, b) { - j3d(); - this.b = a; - this.c = b; - } - function Fud(a, b) { - nud(); - this.f = b; - this.d = a; - } - function qc(a, b) { - Sb(b, a); - this.d = a; - this.c = b; - } - function IXb(a, b) { - JXb.call(this, a, b, null); - } - function Kg(a, b, c2, d) { - yg.call(this, a, b, c2, d); - } - function mMd(a) { - this.d = a; - dMd.call(this, a); - } - function yMd(a) { - this.c = a; - dMd.call(this, a); - } - function BMd(a) { - this.c = a; - mMd.call(this, a); - } - function Zse(a) { - return new Kte(3, a); - } - function ev(a) { - dk(a, iwe); - return new cnb(a); - } - function jA(a) { - fA(); - return parseInt(a) || -1; - } - function Fs(a) { - zs(); - return ws((Is(), Hs), a); - } - function phb(a, b, c2) { - return rhb(a, Fhb(b), c2); - } - function um(a, b) { - return new fq(a, a.gc(), b); - } - function zj(a, b) { - return hn(a.c).Md().Xb(b); - } - function hu(a, b, c2) { - var d; - d = a.fd(b); - d.Rb(c2); - } - function tfd(a, b, c2) { - RD(Med(a, b), 21).Fc(c2); - } - function XOd(a, b, c2) { - VNd(a.a, c2); - UNd(a.a, b); - } - function aAd(a) { - ZD(a, 158) && RD(a, 158).pi(); - } - function tub(a) { - uub.call(this, a, null, null); - } - function Yvb(a) { - Tvb(); - this.b = a; - this.a = true; - } - function ewb(a) { - bwb(); - this.b = a; - this.a = true; - } - function Qub(a) { - sFb(a.b != 0); - return a.a.a.c; - } - function Rub(a) { - sFb(a.b != 0); - return a.c.b.c; - } - function Phb(a, b) { - peb(a, b, b + 1, ""); - return a; - } - function nQb(a, b) { - return !!a.q && Ujb(a.q, b); - } - function vzb(a) { - return a.b = RD(Bkb(a.a), 44); - } - function os(a) { - return a.f != null ? a.f : "" + a.g; - } - function ps(a) { - return a.f != null ? a.f : "" + a.g; - } - function yUb(a, b) { - return a > 0 ? b / (a * a) : b * 100; - } - function FUb(a, b) { - return a > 0 ? b * b / a : b * b * 100; - } - function $5b(a, b) { - return RD(cub(a.a, b), 34); - } - function doc(a, b) { - Mnc(); - return Rc(a, b.e, b); - } - function NCc(a, b, c2) { - GCc(); - return c2.Mg(a, b); - } - function L0c(a) { - B0c(); - return a.e.a + a.f.a / 2; - } - function N0c(a, b, c2) { - B0c(); - return c2.e.a - a * b; - } - function V0c(a) { - B0c(); - return a.e.b + a.f.b / 2; - } - function X0c(a, b, c2) { - B0c(); - return c2.e.b - a * b; - } - function _tb(a) { - a.d = new tub(a); - a.e = new Tsb(); - } - function x3c() { - this.a = new Tp(); - this.b = new Tp(); - } - function hmc(a) { - this.c = a; - this.a = 1; - this.b = 1; - } - function C$b(a) { - z$b(); - A$b(this); - this.Ff(a); - } - function Efd(a, b, c2) { - Afd(); - a.pf(b) && c2.Cd(a); - } - function Red(a, b, c2) { - return Rmb(b, Ted(a, c2)); - } - function Zid(a, b, c2) { - a.a += b; - a.b += c2; - return a; - } - function jjd(a, b, c2) { - a.a *= b; - a.b *= c2; - return a; - } - function mjd(a, b) { - a.a = b.a; - a.b = b.b; - return a; - } - function fjd(a) { - a.a = -a.a; - a.b = -a.b; - return a; - } - function njd(a, b, c2) { - a.a -= b; - a.b -= c2; - return a; - } - function Gjd(a) { - Yub.call(this); - zjd(this, a); - } - function Dbd() { - qs.call(this, "GROW_TREE", 0); - } - function WRb() { - qs.call(this, "POLYOMINO", 0); - } - function SVd(a, b, c2) { - DVd.call(this, a, b, c2, 2); - } - function r0d(a, b, c2) { - VGd(tYd(a.a), b, v0d(c2)); - } - function e3d(a, b) { - N2d(); - Q2d.call(this, a, b); - } - function D3d(a, b) { - j3d(); - p3d.call(this, a, b); - } - function F3d(a, b) { - j3d(); - D3d.call(this, a, b); - } - function H3d(a, b) { - j3d(); - p3d.call(this, a, b); - } - function PNd(a, b) { - return a.c.Fc(RD(b, 136)); - } - function A4d(a, b, c2) { - VGd(o4d(a.a), b, E4d(c2)); - } - function Ard(a) { - this.c = a; - Dyd(a, 0); - Eyd(a, 0); - } - function Z8d(a, b) { - s7d(); - N8d.call(this, a, b); - } - function _8d(a, b) { - s7d(); - Z8d.call(this, a, b); - } - function b9d(a, b) { - s7d(); - Z8d.call(this, a, b); - } - function n9d(a, b) { - s7d(); - N8d.call(this, a, b); - } - function d9d(a, b) { - s7d(); - b9d.call(this, a, b); - } - function p9d(a, b) { - s7d(); - n9d.call(this, a, b); - } - function v9d(a, b) { - s7d(); - N8d.call(this, a, b); - } - function lge(a, b, c2) { - return b.zl(a.e, a.c, c2); - } - function nge(a, b, c2) { - return b.Al(a.e, a.c, c2); - } - function Wee(a, b, c2) { - return tfe(Pee(a, b), c2); - } - function Age(a, b) { - return Vvd(a.e, RD(b, 54)); - } - function _me(a) { - return a == null ? null : Bqe(a); - } - function dne(a) { - return a == null ? null : Iqe(a); - } - function gne(a) { - return a == null ? null : jeb(a); - } - function hne(a) { - return a == null ? null : jeb(a); - } - function TD(a) { - CFb(a == null || $D(a)); - return a; - } - function UD(a) { - CFb(a == null || _D(a)); - return a; - } - function WD(a) { - CFb(a == null || bE(a)); - return a; - } - function lfb(a) { - if (a.o != null) { - return; - } - Bfb(a); - } - function lFb(a) { - if (!a) { - throw Adb(new _fb()); - } - } - function pFb(a) { - if (!a) { - throw Adb(new yeb()); - } - } - function sFb(a) { - if (!a) { - throw Adb(new Dvb()); - } - } - function yFb(a) { - if (!a) { - throw Adb(new cgb()); - } - } - function zmb(a) { - if (!a) { - throw Adb(new Jrb()); - } - } - function jQd() { - jQd = geb; - iQd = new LQd(); - new lRd(); - } - function u2c() { - u2c = geb; - t2c = new jGd("root"); - } - function d6d() { - HWd.call(this); - this.Bb |= txe; - } - function Pg(a, b) { - this.d = a; - Lg(this); - this.b = b; - } - function WCb(a, b) { - NCb.call(this, a); - this.a = b; - } - function oDb(a, b) { - NCb.call(this, a); - this.a = b; - } - function bh(a, b, c2) { - lg.call(this, a, b, c2, null); - } - function fh(a, b, c2) { - lg.call(this, a, b, c2, null); - } - function Mf(a, b) { - this.c = a; - ne.call(this, a, b); - } - function Uf(a, b) { - this.a = a; - Mf.call(this, a, b); - } - function wB(a) { - this.q = new $wnd.Date(Xdb(a)); - } - function OPb(a) { - if (a > 8) { - return 0; - } - return a + 1; - } - function iBb(a, b) { - if (dBb) { - return; - } - Rmb(a.a, b); - } - function P5b(a, b) { - H5b(); - return n2b(b.d.i, a); - } - function qdc(a, b) { - Zcc(); - return new xdc(b, a); - } - function HAb(a, b, c2) { - return a.Ne(b, c2) <= 0 ? c2 : b; - } - function IAb(a, b, c2) { - return a.Ne(b, c2) <= 0 ? b : c2; - } - function rgd(a, b) { - return RD(cub(a.b, b), 143); - } - function tgd(a, b) { - return RD(cub(a.c, b), 233); - } - function amc(a) { - return RD(Vmb(a.a, a.b), 294); - } - function Mid(a) { - return new rjd(a.c, a.d + a.a); - } - function Jeb(a) { - return (uFb(a), a) ? 1231 : 1237; - } - function EPc(a) { - return dOc(), xDc(RD(a, 203)); - } - function RMb() { - RMb = geb; - QMb = xsb((Qpd(), Ppd)); - } - function YQb(a, b) { - b.a ? ZQb(a, b) : wAb(a.a, b.b); - } - function aJd(a, b, c2) { - ++a.j; - a.tj(); - $Gd(a, b, c2); - } - function $Id(a, b, c2) { - ++a.j; - a.qj(b, a.Zi(b, c2)); - } - function B2d(a, b, c2) { - var d; - d = a.fd(b); - d.Rb(c2); - } - function Bzd(a, b, c2) { - c2 = xvd(a, b, 6, c2); - return c2; - } - function izd(a, b, c2) { - c2 = xvd(a, b, 3, c2); - return c2; - } - function KCd(a, b, c2) { - c2 = xvd(a, b, 9, c2); - return c2; - } - function SKb(a, b) { - Ivb(b, Pye); - a.f = b; - return a; - } - function bOd(a, b) { - return (b & lve) % a.d.length; - } - function Bke(a, b, c2) { - return age(a.c, a.b, b, c2); - } - function ZLd(a, b) { - this.c = a; - ZHd.call(this, b); - } - function w0d(a, b) { - this.a = a; - Q_d.call(this, b); - } - function F4d(a, b) { - this.a = a; - Q_d.call(this, b); - } - function kGd(a, b) { - jGd.call(this, a); - this.a = b; - } - function U6d(a, b) { - L6d.call(this, a); - this.a = b; - } - function S9d(a, b) { - L6d.call(this, a); - this.a = b; - } - function jQb(a) { - gQb.call(this, 0, 0); - this.f = a; - } - function _hb(a, b, c2) { - a.a += Ihb(b, 0, c2); - return a; - } - function _A(a) { - !a.a && (a.a = new jB()); - return a.a; - } - function qlb(a, b) { - var c2; - c2 = a.e; - a.e = b; - return c2; - } - function Clb(a, b) { - var c2; - c2 = b; - return !!a.Fe(c2); - } - function Keb(a, b) { - Geb(); - return a == b ? 0 : a ? 1 : -1; - } - function Ikb(a, b) { - a.a.bd(a.b, b); - ++a.b; - a.c = -1; - } - function hg(a) { - a.b ? hg(a.b) : a.f.c.zc(a.e, a.d); - } - function aub(a) { - akb(a.e); - a.d.b = a.d; - a.d.a = a.d; - } - function VDb(a, b, c2) { - xDb(); - HEb(a, b.Ve(a.a, c2)); - } - function Xrb(a, b, c2) { - return Wrb(a, RD(b, 22), c2); - } - function WEb(a, b) { - return cFb(new Array(b), a); - } - function Fgb(a) { - return Ydb(Udb(a, 32)) ^ Ydb(a); - } - function XD(a) { - return String.fromCharCode(a); - } - function Dz(a) { - return a == null ? null : a.message; - } - function Rz(a, b, c2) { - return a.apply(b, c2); - } - function Btb(a, b) { - var c2; - c2 = a[Jxe]; - c2.call(a, b); - } - function Ctb(a, b) { - var c2; - c2 = a[Jxe]; - c2.call(a, b); - } - function O5b(a, b) { - H5b(); - return !n2b(b.d.i, a); - } - function R2b(a, b, c2, d) { - J2b.call(this, a, b, c2, d); - } - function TJb() { - RJb.call(this); - this.a = new pjd(); - } - function v2b() { - this.n = new pjd(); - this.o = new pjd(); - } - function kGb() { - this.b = new pjd(); - this.c = new bnb(); - } - function cUb() { - this.a = new bnb(); - this.b = new bnb(); - } - function kWb() { - this.a = new DTb(); - this.b = new vWb(); - } - function e6b() { - this.b = new gub(); - this.a = new gub(); - } - function jIc() { - this.b = new _sb(); - this.a = new _sb(); - } - function vYc() { - this.b = new Tsb(); - this.a = new Tsb(); - } - function fWc() { - this.b = new TVc(); - this.a = new IVc(); - } - function Yhc() { - this.a = new yqc(); - this.b = new Sqc(); - } - function lNc() { - this.a = new bnb(); - this.d = new bnb(); - } - function RJb() { - this.n = new z3b(); - this.i = new Tid(); - } - function hq(a) { - this.a = (dk(a, iwe), new cnb(a)); - } - function oq(a) { - this.a = (dk(a, iwe), new cnb(a)); - } - function tLd(a) { - return a < 100 ? null : new gLd(a); - } - function Lac(a, b) { - return a.n.a = (uFb(b), b) + 10; - } - function Mac(a, b) { - return a.n.a = (uFb(b), b) + 10; - } - function DYd(a, b) { - return b == a || PHd(sYd(b), a); - } - function nae(a, b) { - return Zjb(a.a, b, "") == null; - } - function Hee(a, b) { - var c2; - c2 = b.qi(a.a); - return c2; - } - function $id(a, b) { - a.a += b.a; - a.b += b.b; - return a; - } - function ojd(a, b) { - a.a -= b.a; - a.b -= b.b; - return a; - } - function sfd(a) { - aFb(a.j.c, 0); - a.a = -1; - return a; - } - function rCd(a, b, c2) { - c2 = xvd(a, b, 11, c2); - return c2; - } - function SDd(a, b, c2) { - c2 != null && Kzd(b, uEd(a, c2)); - } - function TDd(a, b, c2) { - c2 != null && Lzd(b, uEd(a, c2)); - } - function G5d(a, b, c2, d) { - C5d.call(this, a, b, c2, d); - } - function oie(a, b, c2, d) { - C5d.call(this, a, b, c2, d); - } - function sie(a, b, c2, d) { - oie.call(this, a, b, c2, d); - } - function Nie(a, b, c2, d) { - Iie.call(this, a, b, c2, d); - } - function Pie(a, b, c2, d) { - Iie.call(this, a, b, c2, d); - } - function Vie(a, b, c2, d) { - Iie.call(this, a, b, c2, d); - } - function Tie(a, b, c2, d) { - Pie.call(this, a, b, c2, d); - } - function $ie(a, b, c2, d) { - Pie.call(this, a, b, c2, d); - } - function Yie(a, b, c2, d) { - Vie.call(this, a, b, c2, d); - } - function bje(a, b, c2, d) { - $ie.call(this, a, b, c2, d); - } - function Dje(a, b, c2, d) { - wje.call(this, a, b, c2, d); - } - function aMd(a, b) { - veb.call(this, HJe + a + NIe + b); - } - function Hje(a, b) { - return a.jk().wi().ri(a, b); - } - function Ije(a, b) { - return a.jk().wi().ti(a, b); - } - function Lfb(a, b) { - return uFb(a), dE(a) === dE(b); - } - function lhb(a, b) { - return uFb(a), dE(a) === dE(b); - } - function mEb(a, b) { - return a.b.Bd(new pEb(a, b)); - } - function sEb(a, b) { - return a.b.Bd(new vEb(a, b)); - } - function yEb(a, b) { - return a.b.Bd(new BEb(a, b)); - } - function Bk(a, b) { - return a.e = RD(a.d.Kb(b), 159); - } - function uhb(a, b, c2) { - return a.lastIndexOf(b, c2); - } - function wWb(a, b, c2) { - return Qfb(a[b.a], a[c2.a]); - } - function TWb(a, b) { - return pQb(b, (yCc(), gAc), a); - } - function Lpc(a, b) { - return hgb(b.a.d.p, a.a.d.p); - } - function Kpc(a, b) { - return hgb(a.a.d.p, b.a.d.p); - } - function zTc(a, b) { - return Qfb(a.c - a.s, b.c - b.s); - } - function qWc(a, b) { - return Qfb(a.b.e.a, b.b.e.a); - } - function sWc(a, b) { - return Qfb(a.c.e.a, b.c.e.a); - } - function $2b(a) { - return !a.c ? -1 : Wmb(a.c.a, a, 0); - } - function Cod(a) { - return a == vod || a == xod || a == wod; - } - function CMd(a, b) { - this.c = a; - nMd.call(this, a, b); - } - function fq(a, b, c2) { - this.a = a; - qc.call(this, b, c2); - } - function YDb(a) { - this.c = a; - xxb.call(this, Sve, 0); - } - function rk(a, b, c2) { - this.c = b; - this.b = c2; - this.a = a; - } - function DMc(a) { - dMc(); - this.d = a; - this.a = new wmb(); - } - function ho(a) { - _l(); - this.a = (yob(), new Lqb(a)); - } - function Xmc(a, b) { - Dmd(a.f) ? Ymc(a, b) : Zmc(a, b); - } - function Lxb(a, b) { - Mxb.call(this, a, a.length, b); - } - function nBb(a, b) { - if (dBb) { - return; - } - !!b && (a.d = b); - } - function ZNd(a, b) { - return ZD(b, 15) && _Gd(a.c, b); - } - function AVd(a, b, c2) { - return RD(a.c, 71).Wk(b, c2); - } - function BVd(a, b, c2) { - return RD(a.c, 71).Xk(b, c2); - } - function mge(a, b, c2) { - return lge(a, RD(b, 343), c2); - } - function oge(a, b, c2) { - return nge(a, RD(b, 343), c2); - } - function Ige(a, b, c2) { - return Hge(a, RD(b, 343), c2); - } - function Kge(a, b, c2) { - return Jge(a, RD(b, 343), c2); - } - function Fn(a, b) { - return b == null ? null : Xv(a.b, b); - } - function Qeb(a) { - return _D(a) ? (uFb(a), a) : a.ue(); - } - function Rfb(a) { - return !isNaN(a) && !isFinite(a); - } - function Zub(a) { - Lub(this); - Xub(this); - ye(this, a); - } - function dnb(a) { - Pmb(this); - YEb(this.c, 0, a.Pc()); - } - function Fsb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function Vtb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function hvb(a, b, c2) { - this.d = a; - this.b = c2; - this.a = b; - } - function aBb(a) { - this.a = a; - gib(); - Hdb(Date.now()); - } - function wzb(a) { - Ckb(a.a); - Yyb(a.c, a.b); - a.b = null; - } - function wvb() { - wvb = geb; - uvb = new xvb(); - vvb = new zvb(); - } - function KMd() { - KMd = geb; - JMd = $C(jJ, rve, 1, 0, 5, 1); - } - function TTd() { - TTd = geb; - STd = $C(jJ, rve, 1, 0, 5, 1); - } - function yUd() { - yUd = geb; - xUd = $C(jJ, rve, 1, 0, 5, 1); - } - function _l() { - _l = geb; - new im((yob(), yob(), vob)); - } - function gAb(a) { - cAb(); - return ws((qAb(), pAb), a); - } - function zBb(a) { - xBb(); - return ws((CBb(), BBb), a); - } - function FHb(a) { - DHb(); - return ws((IHb(), HHb), a); - } - function NHb(a) { - LHb(); - return ws((QHb(), PHb), a); - } - function kIb(a) { - iIb(); - return ws((nIb(), mIb), a); - } - function _Jb(a) { - ZJb(); - return ws((cKb(), bKb), a); - } - function GKb(a) { - EKb(); - return ws((JKb(), IKb), a); - } - function xLb(a) { - vLb(); - return ws((ALb(), zLb), a); - } - function mMb(a) { - hMb(); - return ws((pMb(), oMb), a); - } - function oOb(a) { - mOb(); - return ws((rOb(), qOb), a); - } - function KPb(a) { - IPb(); - return ws((NPb(), MPb), a); - } - function KRb(a) { - IRb(); - return ws((NRb(), MRb), a); - } - function XRb(a) { - VRb(); - return ws(($Rb(), ZRb), a); - } - function VUb(a) { - TUb(); - return ws((YUb(), XUb), a); - } - function CWb(a) { - AWb(); - return ws((FWb(), EWb), a); - } - function uXb(a) { - sXb(); - return ws((xXb(), wXb), a); - } - function tZb(a) { - nZb(); - return ws((wZb(), vZb), a); - } - function W$b(a) { - U$b(); - return ws((Z$b(), Y$b), a); - } - function Mb(a, b) { - if (!a) { - throw Adb(new agb(b)); - } - } - function Vb(a) { - if (!a) { - throw Adb(new dgb(tve)); - } - } - function rFb(a, b) { - if (a != b) { - throw Adb(new Jrb()); - } - } - function KQb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function lRb(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function h7b(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function J0b(a, b, c2) { - this.b = a; - this.a = b; - this.c = c2; - } - function dNb(a, b, c2) { - this.b = a; - this.c = b; - this.a = c2; - } - function oac(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function F1b(a, b, c2) { - this.e = b; - this.b = a; - this.d = c2; - } - function Ecc(a, b, c2) { - this.b = a; - this.a = b; - this.c = c2; - } - function UDb(a, b, c2) { - xDb(); - a.a.Yd(b, c2); - return b; - } - function CJb(a) { - var b; - b = new BJb(); - b.e = a; - return b; - } - function _Nb(a) { - var b; - b = new YNb(); - b.b = a; - return b; - } - function U9b() { - U9b = geb; - S9b = new bac(); - T9b = new eac(); - } - function Rec() { - Rec = geb; - Qec = new efc(); - Pec = new jfc(); - } - function lkc() { - lkc = geb; - jkc = new Mkc(); - kkc = new Okc(); - } - function loc(a) { - joc(); - return ws((ooc(), noc), a); - } - function kcc(a) { - hcc(); - return ws((ncc(), mcc), a); - } - function yec(a) { - vec(); - return ws((Bec(), Aec), a); - } - function gnc(a) { - enc(); - return ws((jnc(), inc), a); - } - function Enc(a) { - Bnc(); - return ws((Hnc(), Gnc), a); - } - function gpc(a) { - epc(); - return ws((jpc(), ipc), a); - } - function dtc(a) { - btc(); - return ws((gtc(), ftc), a); - } - function ltc(a) { - jtc(); - return ws((otc(), ntc), a); - } - function xtc(a) { - stc(); - return ws((Atc(), ztc), a); - } - function Gtc(a) { - Etc(); - return ws((Jtc(), Itc), a); - } - function Utc(a) { - Ptc(); - return ws((Xtc(), Wtc), a); - } - function auc(a) { - $tc(); - return ws((duc(), cuc), a); - } - function avc(a) { - $uc(); - return ws((dvc(), cvc), a); - } - function qvc(a) { - ovc(); - return ws((tvc(), svc), a); - } - function zvc(a) { - xvc(); - return ws((Cvc(), Bvc), a); - } - function Ivc(a) { - Gvc(); - return ws((Lvc(), Kvc), a); - } - function Qvc(a) { - Ovc(); - return ws((Tvc(), Svc), a); - } - function Quc(a) { - Ouc(); - return ws((Tuc(), Suc), a); - } - function juc(a) { - huc(); - return ws((muc(), luc), a); - } - function wuc(a) { - tuc(); - return ws((zuc(), yuc), a); - } - function Euc(a) { - Cuc(); - return ws((Huc(), Guc), a); - } - function exc(a) { - cxc(); - return ws((hxc(), gxc), a); - } - function eDc(a) { - _Cc(); - return ws((hDc(), gDc), a); - } - function oDc(a) { - lDc(); - return ws((rDc(), qDc), a); - } - function ADc(a) { - wDc(); - return ws((DDc(), CDc), a); - } - function ODc(a) { - JDc(); - return ws((RDc(), QDc), a); - } - function cEc(a) { - aEc(); - return ws((fEc(), eEc), a); - } - function mEc(a) { - kEc(); - return ws((pEc(), oEc), a); - } - function uEc(a) { - sEc(); - return ws((xEc(), wEc), a); - } - function DEc(a) { - BEc(); - return ws((GEc(), FEc), a); - } - function MEc(a) { - KEc(); - return ws((PEc(), OEc), a); - } - function VEc(a) { - TEc(); - return ws((YEc(), XEc), a); - } - function nFc(a) { - lFc(); - return ws((qFc(), pFc), a); - } - function wFc(a) { - uFc(); - return ws((zFc(), yFc), a); - } - function FFc(a) { - DFc(); - return ws((IFc(), HFc), a); - } - function TKc(a) { - RKc(); - return ws((WKc(), VKc), a); - } - function uNc(a) { - sNc(); - return ws((xNc(), wNc), a); - } - function yQc(a) { - wQc(); - return ws((BQc(), AQc), a); - } - function GQc(a) { - EQc(); - return ws((JQc(), IQc), a); - } - function hTc(a) { - fTc(); - return ws((kTc(), jTc), a); - } - function fVc(a) { - dVc(); - return ws((iVc(), hVc), a); - } - function bWc(a) { - YVc(); - return ws((eWc(), dWc), a); - } - function ZYc(a) { - WYc(); - return ws((aZc(), _Yc), a); - } - function NZc(a) { - LZc(); - return ws((QZc(), PZc), a); - } - function u_c(a) { - s_c(); - return ws((x_c(), w_c), a); - } - function C_c(a) { - A_c(); - return ws((F_c(), E_c), a); - } - function C2c(a) { - x2c(); - return ws((F2c(), E2c), a); - } - function j3c(a) { - g3c(); - return ws((m3c(), l3c), a); - } - function j4c(a) { - g4c(); - return ws((m4c(), l4c), a); - } - function _3c(a) { - Y3c(); - return ws((c4c(), b4c), a); - } - function m5c(a) { - j5c(); - return ws((p5c(), o5c), a); - } - function w5c(a) { - t5c(); - return ws((z5c(), y5c), a); - } - function h6c(a) { - f6c(); - return ws((k6c(), j6c), a); - } - function C6c(a) { - z6c(); - return ws((F6c(), E6c), a); - } - function b7c(a) { - _6c(); - return ws((e7c(), d7c), a); - } - function E8c(a) { - z8c(); - return ws((H8c(), G8c), a); - } - function R8b(a) { - P8b(); - return ws((U8b(), T8b), a); - } - function t3b(a) { - r3b(); - return ws((w3b(), v3b), a); - } - function g9c(a) { - b9c(); - return ws((j9c(), i9c), a); - } - function G9c(a) { - B9c(); - return ws((J9c(), I9c), a); - } - function uad(a) { - sad(); - return ws((xad(), wad), a); - } - function xbd(a) { - sbd(); - return ws((Abd(), zbd), a); - } - function ibd(a) { - gbd(); - return ws((lbd(), kbd), a); - } - function Gbd(a) { - Cbd(); - return ws((Jbd(), Ibd), a); - } - function Obd(a) { - Mbd(); - return ws((Rbd(), Qbd), a); - } - function Zbd(a) { - Xbd(); - return ws((acd(), _bd), a); - } - function fdd(a) { - _cd(); - return ws((idd(), hdd), a); - } - function qdd(a) { - ldd(); - return ws((tdd(), sdd), a); - } - function $hd(a) { - Yhd(); - return ws((bid(), aid), a); - } - function mid(a) { - kid(); - return ws((pid(), oid), a); - } - function Tjd(a) { - Rjd(); - return ws((Wjd(), Vjd), a); - } - function wkd(a) { - ukd(); - return ws((zkd(), ykd), a); - } - function Hmd(a) { - Cmd(); - return ws((Kmd(), Jmd), a); - } - function Qmd(a) { - Omd(); - return ws((Tmd(), Smd), a); - } - function $md(a) { - Ymd(); - return ws((bnd(), and), a); - } - function knd(a) { - ind(); - return ws((nnd(), mnd), a); - } - function Hnd(a) { - Fnd(); - return ws((Knd(), Jnd), a); - } - function Snd(a) { - Pnd(); - return ws((Vnd(), Und), a); - } - function god(a) { - dod(); - return ws((jod(), iod), a); - } - function rod(a) { - pod(); - return ws((uod(), tod), a); - } - function Fod(a) { - Bod(); - return ws((Iod(), Hod), a); - } - function Tod(a) { - Pod(); - return ws((Wod(), Vod), a); - } - function wpd(a) { - qpd(); - return ws((zpd(), ypd), a); - } - function Spd(a) { - Qpd(); - return ws((Vpd(), Upd), a); - } - function fqd(a) { - dqd(); - return ws((iqd(), hqd), a); - } - function oqd(a) { - mqd(); - return ws((rqd(), qqd), a); - } - function zsc(a, b) { - return (uFb(a), a) + (uFb(b), b); - } - function wqd(a) { - uqd(); - return ws((Eqd(), Dqd), a); - } - function Ird(a) { - Grd(); - return ws((Lrd(), Krd), a); - } - function vtd(a) { - ttd(); - return ws((ytd(), xtd), a); - } - function dMc() { - dMc = geb; - bMc = (qpd(), ppd); - cMc = Xod; - } - function uqd() { - uqd = geb; - sqd = new zqd(); - tqd = new Bqd(); - } - function wJc(a) { - !a.e && (a.e = new bnb()); - return a.e; - } - function BTc(a, b) { - this.c = a; - this.a = b; - this.b = b - a; - } - function g8c(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function gud(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function Wdd(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function ced(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function pFd(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function ZPd(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - } - function g7d(a, b, c2) { - this.e = a; - this.a = b; - this.c = c2; - } - function K7d(a, b, c2) { - s7d(); - C7d.call(this, a, b, c2); - } - function f9d(a, b, c2) { - s7d(); - O8d.call(this, a, b, c2); - } - function r9d(a, b, c2) { - s7d(); - O8d.call(this, a, b, c2); - } - function x9d(a, b, c2) { - s7d(); - O8d.call(this, a, b, c2); - } - function h9d(a, b, c2) { - s7d(); - f9d.call(this, a, b, c2); - } - function j9d(a, b, c2) { - s7d(); - f9d.call(this, a, b, c2); - } - function l9d(a, b, c2) { - s7d(); - j9d.call(this, a, b, c2); - } - function t9d(a, b, c2) { - s7d(); - r9d.call(this, a, b, c2); - } - function z9d(a, b, c2) { - s7d(); - x9d.call(this, a, b, c2); - } - function S2b(a) { - J2b.call(this, a.d, a.c, a.a, a.b); - } - function B3b(a) { - J2b.call(this, a.d, a.c, a.a, a.b); - } - function Og(a) { - this.d = a; - Lg(this); - this.b = ed(a.d); - } - function cGd(a) { - aGd(); - return ws((fGd(), eGd), a); - } - function gk(a, b) { - Qb(a); - Qb(b); - return new hk(a, b); - } - function dr(a, b) { - Qb(a); - Qb(b); - return new mr(a, b); - } - function hr(a, b) { - Qb(a); - Qb(b); - return new sr(a, b); - } - function Dr(a, b) { - Qb(a); - Qb(b); - return new Rr(a, b); - } - function Uub(a) { - sFb(a.b != 0); - return Wub(a, a.a.a); - } - function Vub(a) { - sFb(a.b != 0); - return Wub(a, a.c.b); - } - function q$d(a) { - !a.c && (a.c = new X9d()); - return a.c; - } - function cv(a) { - var b; - b = new bnb(); - xr(b, a); - return b; - } - function Vx(a) { - var b; - b = new _sb(); - xr(b, a); - return b; - } - function Yx(a) { - var b; - b = new xAb(); - _q(b, a); - return b; - } - function gv(a) { - var b; - b = new Yub(); - _q(b, a); - return b; - } - function RD(a, b) { - CFb(a == null || QD(a, b)); - return a; - } - function Mxb(a, b, c2) { - Axb.call(this, b, c2); - this.a = a; - } - function kB(a, b) { - this.c = a; - this.b = b; - this.a = false; - } - function hCb() { - this.a = ";,;"; - this.b = ""; - this.c = ""; - } - function $Cb(a, b, c2) { - this.b = a; - pxb.call(this, b, c2); - } - function uub(a, b, c2) { - this.c = a; - xlb.call(this, b, c2); - } - function fZb(a, b, c2) { - eZb.call(this, a, b); - this.b = c2; - } - function YEb(a, b, c2) { - VEb(c2, 0, a, b, c2.length, false); - } - function JYb(a, b, c2, d, e) { - a.b = b; - a.c = c2; - a.d = d; - a.a = e; - } - function D2b(a, b, c2, d, e) { - a.d = b; - a.c = c2; - a.a = d; - a.b = e; - } - function XDb(a, b) { - if (b) { - a.b = b; - a.a = (LCb(b), b.a); - } - } - function mFb(a, b) { - if (!a) { - throw Adb(new agb(b)); - } - } - function zFb(a, b) { - if (!a) { - throw Adb(new dgb(b)); - } - } - function qFb(a, b) { - if (!a) { - throw Adb(new zeb(b)); - } - } - function zqc(a, b) { - mqc(); - return hgb(a.d.p, b.d.p); - } - function T0c(a, b) { - B0c(); - return Qfb(a.e.b, b.e.b); - } - function U0c(a, b) { - B0c(); - return Qfb(a.e.a, b.e.a); - } - function Xoc(a, b) { - return hgb(N3b(a.d), N3b(b.d)); - } - function Izb(a, b) { - return !!b && Jzb(a, b.d) ? b : null; - } - function $lc(a, b) { - return b == (qpd(), ppd) ? a.c : a.d; - } - function Qdb(a) { - return Edb(yD(Kdb(a) ? Wdb(a) : a)); - } - function Nid(a) { - return new rjd(a.c + a.b, a.d + a.a); - } - function GSd(a) { - return a != null && !mSd(a, aSd, bSd); - } - function DSd(a, b) { - return (JSd(a) << 4 | JSd(b)) & Bwe; - } - function Rid(a, b, c2, d, e) { - a.c = b; - a.d = c2; - a.b = d; - a.a = e; - } - function y8b(a) { - var b, c2; - b = a.b; - c2 = a.c; - a.b = c2; - a.c = b; - } - function B8b(a) { - var b, c2; - c2 = a.d; - b = a.a; - a.d = b; - a.a = c2; - } - function u6d(a, b) { - var c2; - c2 = a.c; - t6d(a, b); - return c2; - } - function Nqd(a, b) { - b < 0 ? a.g = -1 : a.g = b; - return a; - } - function kjd(a, b) { - gjd(a); - a.a *= b; - a.b *= b; - return a; - } - function hrc(a, b, c2) { - grc.call(this, b, c2); - this.d = a; - } - function PZd(a, b, c2) { - kZd.call(this, a, b); - this.c = c2; - } - function Kfe(a, b, c2) { - kZd.call(this, a, b); - this.c = c2; - } - function zUd(a) { - yUd(); - kUd.call(this); - this.ci(a); - } - function Yee() { - ree(); - Zee.call(this, (YSd(), XSd)); - } - function Yse(a) { - Vse(); - return new Hte(0, a); - } - function uke() { - uke = geb; - tke = (yob(), new mpb(eLe)); - } - function ux() { - ux = geb; - new wx((kl(), jl), (Wk(), Vk)); - } - function ugb() { - ugb = geb; - tgb = $C(bJ, Nve, 17, 256, 0, 1); - } - function zUb() { - this.b = Kfb(UD(iGd((yVb(), sVb)))); - } - function Pq(a) { - this.b = a; - this.a = gn(this.b.a).Od(); - } - function mr(a, b) { - this.b = a; - this.a = b; - zl.call(this); - } - function sr(a, b) { - this.a = a; - this.b = b; - zl.call(this); - } - function s_d(a, b, c2) { - this.a = a; - N$d.call(this, b, c2); - } - function n_d(a, b, c2) { - this.a = a; - N$d.call(this, b, c2); - } - function sDd(a, b, c2) { - var d; - d = new OC(c2); - sC(a, b, d); - } - function _Eb(a, b, c2) { - var d; - d = a[b]; - a[b] = c2; - return d; - } - function UEb(a) { - var b; - b = a.slice(); - return dD(b, a); - } - function SJb(a) { - var b; - b = a.n; - return a.a.b + b.d + b.a; - } - function PKb(a) { - var b; - b = a.n; - return a.e.b + b.d + b.a; - } - function QKb(a) { - var b; - b = a.n; - return a.e.a + b.b + b.c; - } - function rub(a) { - a.a.b = a.b; - a.b.a = a.a; - a.a = a.b = null; - } - function Mub(a, b) { - Pub(a, b, a.c.b, a.c); - return true; - } - function w2b(a) { - if (a.a) { - return a.a; + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; } - return R0b(a); - } - function NSb(a) { - HSb(); - return JGd(a) == vCd(LGd(a)); - } - function OSb(a) { - HSb(); - return LGd(a) == vCd(JGd(a)); - } - function l_b(a, b) { - return k_b(a, new eZb(b.a, b.b)); - } - function xn(a, b) { - return fn(), ck(a, b), new zy(a, b); - } - function fmc(a, b) { - return a.c < b.c ? -1 : a.c == b.c ? 0 : 1; - } - function snc(a) { - return a.b.c.length - a.e.c.length; - } - function N3b(a) { - return a.e.c.length - a.g.c.length; - } - function L3b(a) { - return a.e.c.length + a.g.c.length; - } - function Lgb(a) { - return a == 0 || isNaN(a) ? a : a < 0 ? -1 : 1; - } - function V0b(a) { - return !W0b(a) && a.c.i.c == a.d.i.c; - } - function DOc(a) { - dOc(); - return (qpd(), apd).Hc(a.j); - } - function M0c(a, b, c2) { - B0c(); - return c2.e.a + c2.f.a + a * b; - } - function W0c(a, b, c2) { - B0c(); - return c2.e.b + c2.f.b + a * b; - } - function SUc(a, b, c2) { - return Zjb(a.b, RD(c2.b, 18), b); - } - function TUc(a, b, c2) { - return Zjb(a.b, RD(c2.b, 18), b); - } - function oFd(a, b, c2) { - iEd(a.a, a.b, a.c, RD(b, 166), c2); - } - function lad(a, b, c2, d) { - mad.call(this, a, b, c2, d, 0, 0); - } - function LUd(a) { - yUd(); - zUd.call(this, a); - this.a = -1; - } - function Gxb(a, b) { - Axb.call(this, b, 1040); - this.a = a; - } - function zqd() { - vqd.call(this, "COUNT_CHILDREN", 0); - } - function ole(a, b) { - Eke.call(this, a, b); - this.a = this; - } - function ufb(a, b) { - var c2; - c2 = rfb(a, b); - c2.i = 2; - return c2; - } - function cJd(a, b) { - var c2; - ++a.j; - c2 = a.Cj(b); - return c2; - } - function pfd(a, b, c2) { - a.a = -1; - tfd(a, b.g, c2); - return a; - } - function Bsd(a, b) { - return Rmb(a, new rjd(b.a, b.b)); - } - function __c(a) { - return R_c(), $C(Z$, NEe, 40, a, 0, 1); - } - function dj(a) { - return a.e.Rd().gc() * a.c.Rd().gc(); - } - function fk(a, b, c2) { - return new rk(hDb(a)._e(), c2, b); - } - function mVd(a, b) { - nVd(a, b == null ? null : (uFb(b), b)); - } - function q6d(a, b) { - s6d(a, b == null ? null : (uFb(b), b)); - } - function r6d(a, b) { - s6d(a, b == null ? null : (uFb(b), b)); - } - function CFb(a) { - if (!a) { - throw Adb(new Ifb(null)); + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len + }; + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; } - } - function tt(a) { - if (a.c.e != a.a) { - throw Adb(new Jrb()); + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); } - } - function Au(a) { - if (a.e.c != a.b) { - throw Adb(new Jrb()); + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } } - } - function Ar(a) { - Qb(a); - while (a.Ob()) { - a.Pb(); - a.Qb(); + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; } - } - function Dy(a) { - tm(); - this.a = (yob(), new mpb(Qb(a))); - } - function mf(a) { - this.c = a; - this.b = this.c.d.vc().Kc(); - } - function hx(a) { - a.a.ld(); - RD(a.a.md(), 16).gc(); - Hh(); - } - function $hb(a, b) { - a.a += Ihb(b, 0, b.length); - return a; - } - function Vmb(a, b) { - tFb(b, a.c.length); - return a.c[b]; - } - function kob(a, b) { - tFb(b, a.a.length); - return a.a[b]; - } - function Arb(a, b) { - return uFb(b), Leb(b, (uFb(a), a)); - } - function vrb(a, b) { - return uFb(a), Leb(a, (uFb(b), b)); - } - function YC(a, b, c2, d, e, f2) { - return ZC(a, b, c2, d, e, 0, f2); - } - function GBb(a, b) { - return bD(b, 0, tCb(b[0], Hgb(1))); - } - function IBb(a, b) { - return Hgb(Bdb(Hgb(a.a).a, b.a)); - } - function tCb(a, b) { - return IBb(RD(a, 168), RD(b, 168)); - } - function Jgb() { - Jgb = geb; - Igb = $C(eJ, Nve, 168, 256, 0, 1); - } - function dhb() { - dhb = geb; - chb = $C(lJ, Nve, 191, 256, 0, 1); - } - function Zeb() { - Zeb = geb; - Yeb = $C(RI, Nve, 222, 256, 0, 1); - } - function jfb() { - jfb = geb; - ifb = $C(SI, Nve, 180, 128, 0, 1); - } - function KYb() { - JYb(this, false, false, false, false); - } - function Kub(a) { - ctb.call(this, new gub()); - ye(this, a); - } - function btb(a) { - this.a = new Usb(a.gc()); - ye(this, a); - } - function nsb(a) { - this.c = a; - this.a = new Osb(this.c.a); - } - function Kmc(a) { - this.a = a; - this.c = new Tsb(); - Emc(this); - } - function DRb() { - this.d = new rjd(0, 0); - this.e = new _sb(); - } - function SDb(a, b) { - xDb(); - NCb.call(this, a); - this.a = b; - } - function J2b(a, b, c2, d) { - D2b(this, a, b, c2, d); - } - function Uqc(a, b, c2) { - return hgb(b.d[a.g], c2.d[a.g]); - } - function wMc(a, b, c2) { - return hgb(a.d[b.p], a.d[c2.p]); - } - function xMc(a, b, c2) { - return hgb(a.d[b.p], a.d[c2.p]); - } - function yMc(a, b, c2) { - return hgb(a.d[b.p], a.d[c2.p]); - } - function zMc(a, b, c2) { - return hgb(a.d[b.p], a.d[c2.p]); - } - function Aad(a, b, c2) { - return $wnd.Math.min(c2 / a, 1 / b); - } - function SIc(a, b) { - return a ? 0 : $wnd.Math.max(0, b - 1); - } - function qSd(a, b) { - return a == null ? b == null : lhb(a, b); - } - function rSd(a, b) { - return a == null ? b == null : mhb(a, b); - } - function lQb(a) { - return !a.q ? (yob(), yob(), wob) : a.q; - } - function _lc(a) { - return a.c - RD(Vmb(a.a, a.b), 294).b; - } - function trd(a) { - if (a.c) { - return a.c.f; + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length + }; + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; } - return a.e.b; - } - function urd(a) { - if (a.c) { - return a.c.g; + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; + } + } } - return a.e.a; - } - function wsc(a, b) { - a.a == null && usc(a); - return a.a[b]; - } - function L2c(a) { - var b; - b = R2c(a); - return !b ? a : L2c(b); - } - function $se(a, b) { - Vse(); - return new Qte(a, b); - } - function Hte(a, b) { - Vse(); - Wse.call(this, a); - this.a = b; - } - function N8d(a, b) { - s7d(); - t7d.call(this, b); - this.a = a; - } - function iae(a, b, c2) { - this.a = a; - XZd.call(this, b, c2, 2); - } - function ntd(a) { - this.b = new Yub(); - this.a = a; - this.c = -1; - } - function ds(a) { - qc.call(this, 0, 0); - this.a = a; - this.b = 0; - } - function PSd(a) { - ZHd.call(this, a.gc()); - YGd(this, a); - } - function jg(a) { - a.b ? jg(a.b) : a.d.dc() && a.f.c.Bc(a.e); - } - function aD(a) { - return Array.isArray(a) && a.Tm === keb; - } - function Bsb(a, b) { - return ZD(b, 22) && Csb(a, RD(b, 22)); - } - function Dsb(a, b) { - return ZD(b, 22) && Esb(a, RD(b, 22)); - } - function qtb(a, b) { - return otb(a, b, ptb(a, a.b.Ce(b))); - } - function Jtb(a, b) { - return !(a.a.get(b) === void 0); - } - function Iwb(a) { - return Kwb(a, 26) * Kxe + Kwb(a, 27) * Lxe; - } - function OBb(a, b) { - return FBb(new jCb(), new VBb(a), b); - } - function Ynb(a, b, c2) { - nFb(0, b, a.length); - Wnb(a, 0, b, c2); - } - function Qmb(a, b, c2) { - wFb(b, a.c.length); - XEb(a.c, b, c2); - } - function dKb(a, b, c2) { - var d; - if (a) { - d = a.i; - d.c = b; - d.b = c2; + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; } - } - function eKb(a, b, c2) { - var d; - if (a) { - d = a.i; - d.d = b; - d.a = c2; + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); } - } - function Pnb(a, b, c2) { - var d; - for (d = 0; d < b; ++d) { - a[d] = c2; + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; } - } - function Qnb(a, b) { - var c2; - for (c2 = 0; c2 < b; ++c2) { - a[c2] = -1; + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + yy.getLogger().trace("Found comment", yy_.yytext); + return 6; + break; + case 1: + return 8; + break; + case 2: + this.begin("CLASS"); + break; + case 3: + this.popState(); + return 16; + break; + case 4: + this.popState(); + break; + case 5: + yy.getLogger().trace("Begin icon"); + this.begin("ICON"); + break; + case 6: + yy.getLogger().trace("SPACELINE"); + return 6; + break; + case 7: + return 7; + break; + case 8: + return 15; + break; + case 9: + yy.getLogger().trace("end icon"); + this.popState(); + break; + case 10: + yy.getLogger().trace("Exploding node"); + this.begin("NODE"); + return 19; + break; + case 11: + yy.getLogger().trace("Cloud"); + this.begin("NODE"); + return 19; + break; + case 12: + yy.getLogger().trace("Explosion Bang"); + this.begin("NODE"); + return 19; + break; + case 13: + yy.getLogger().trace("Cloud Bang"); + this.begin("NODE"); + return 19; + break; + case 14: + this.begin("NODE"); + return 19; + break; + case 15: + this.begin("NODE"); + return 19; + break; + case 16: + this.begin("NODE"); + return 19; + break; + case 17: + this.begin("NODE"); + return 19; + break; + case 18: + return 13; + break; + case 19: + return 22; + break; + case 20: + return 11; + break; + case 21: + this.begin("NSTR2"); + break; + case 22: + return "NODE_DESCR"; + break; + case 23: + this.popState(); + break; + case 24: + yy.getLogger().trace("Starting NSTR"); + this.begin("NSTR"); + break; + case 25: + yy.getLogger().trace("description:", yy_.yytext); + return "NODE_DESCR"; + break; + case 26: + this.popState(); + break; + case 27: + this.popState(); + yy.getLogger().trace("node end ))"); + return "NODE_DEND"; + break; + case 28: + this.popState(); + yy.getLogger().trace("node end )"); + return "NODE_DEND"; + break; + case 29: + this.popState(); + yy.getLogger().trace("node end ...", yy_.yytext); + return "NODE_DEND"; + break; + case 30: + this.popState(); + yy.getLogger().trace("node end (("); + return "NODE_DEND"; + break; + case 31: + this.popState(); + yy.getLogger().trace("node end (-"); + return "NODE_DEND"; + break; + case 32: + this.popState(); + yy.getLogger().trace("node end (-"); + return "NODE_DEND"; + break; + case 33: + this.popState(); + yy.getLogger().trace("node end (("); + return "NODE_DEND"; + break; + case 34: + this.popState(); + yy.getLogger().trace("node end (("); + return "NODE_DEND"; + break; + case 35: + yy.getLogger().trace("Long description:", yy_.yytext); + return 20; + break; + case 36: + yy.getLogger().trace("Long description:", yy_.yytext); + return 20; + break; } - } - function ysb(a, b) { - var c2; - c2 = xsb(a); - zob(c2, b); - return c2; - } - function cA(a, b) { - !a && (a = []); - a[a.length] = b; - return a; - } - function RQb(a, b) { - $id(a.c, b); - a.b.c += b.a; - a.b.d += b.b; - } - function QQb(a, b) { - RQb(a, ojd(new rjd(b.a, b.b), a.c)); - } - function sOb(a, b) { - this.b = new Yub(); - this.a = a; - this.c = b; - } - function QYb() { - this.b = new aZb(); - this.c = new UYb(this); - } - function fHb() { - this.d = new tHb(); - this.e = new lHb(this); - } - function UFc() { - RFc(); - this.f = new Yub(); - this.e = new Yub(); - } - function yOc() { - dOc(); - this.k = new Tsb(); - this.d = new _sb(); - } - function nud() { - nud = geb; - mud = new mGd((umd(), Gld), 0); - } - function cs() { - cs = geb; - bs = new ds($C(jJ, rve, 1, 0, 5, 1)); - } - function _ad(a, b, c2) { - return Ysb(a, new TFb(b.a, c2.a)); - } - function DGc(a, b, c2) { - return -hgb(a.f[b.p], a.f[c2.p]); - } - function Mic(a, b, c2) { - Hic(c2, a, 1); - Rmb(b, new xjc(c2, a)); - } - function Nic(a, b, c2) { - Iic(c2, a, 1); - Rmb(b, new Jjc(c2, a)); - } - function h$d(a, b, c2) { - this.a = a; - _Zd.call(this, b, c2, 22); - } - function s5d(a, b, c2) { - this.a = a; - _Zd.call(this, b, c2, 14); - } - function E8d(a, b, c2, d) { - s7d(); - N7d.call(this, a, b, c2, d); - } - function L8d(a, b, c2, d) { - s7d(); - N7d.call(this, a, b, c2, d); - } - function nfd(a, b, c2) { - a.a = -1; - tfd(a, b.g + 1, c2); - return a; - } - function bCd(a, b, c2) { - c2 = xvd(a, RD(b, 54), 7, c2); - return c2; - } - function hVd(a, b, c2) { - c2 = xvd(a, RD(b, 54), 3, c2); - return c2; - } - function Ydb(a) { - if (Kdb(a)) { - return a | 0; - } - return FD(a); - } - function cte(a) { - Vse(); - return new eue(10, a, 0); - } - function fe(a) { - var b; - b = a.f; - return !b ? a.f = a.Dc() : b; - } - function Ec(a) { - var b; - b = a.i; - return !b ? a.i = a.bc() : b; - } - function Ahe(a) { - if (a.e.j != a.d) { - throw Adb(new Jrb()); - } - } - function gn(a) { - if (a.c) { - return a.c; - } - return a.c = a.Sd(); - } - function hn(a) { - if (a.d) { - return a.d; + }, "anonymous"), + rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i], + conditions: { "CLASS": { "rules": [3, 4], "inclusive": false }, "ICON": { "rules": [8, 9], "inclusive": false }, "NSTR2": { "rules": [22, 23], "inclusive": false }, "NSTR": { "rules": [25, 26], "inclusive": false }, "NODE": { "rules": [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser17.parser = parser17; + mindmap_default = parser17; + } + }); + + // src/diagrams/mindmap/mindmapDb.ts + var nodes2, cnt2, elements2, clear25, getParent, getMindmap, addNode, nodeType, getType, setElementForId, decorateNode, type2Str, getLogger, getElementById, db4, mindmapDb_default; + var init_mindmapDb = __esm({ + "src/diagrams/mindmap/mindmapDb.ts"() { + "use strict"; + init_diagramAPI(); + init_common(); + init_logger(); + init_defaultConfig(); + nodes2 = []; + cnt2 = 0; + elements2 = {}; + clear25 = /* @__PURE__ */ __name(() => { + nodes2 = []; + cnt2 = 0; + elements2 = {}; + }, "clear"); + getParent = /* @__PURE__ */ __name(function(level) { + for (let i2 = nodes2.length - 1; i2 >= 0; i2--) { + if (nodes2[i2].level < level) { + return nodes2[i2]; + } + } + return null; + }, "getParent"); + getMindmap = /* @__PURE__ */ __name(() => { + return nodes2.length > 0 ? nodes2[0] : null; + }, "getMindmap"); + addNode = /* @__PURE__ */ __name((level, id26, descr, type3) => { + log.info("addNode", level, id26, descr, type3); + const conf8 = getConfig2(); + let padding3 = conf8.mindmap?.padding ?? defaultConfig_default.mindmap.padding; + switch (type3) { + case nodeType.ROUNDED_RECT: + case nodeType.RECT: + case nodeType.HEXAGON: + padding3 *= 2; + } + const node2 = { + id: cnt2++, + nodeId: sanitizeText(id26, conf8), + level, + descr: sanitizeText(descr, conf8), + type: type3, + children: [], + width: conf8.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth, + padding: padding3 + }; + const parent4 = getParent(level); + if (parent4) { + parent4.children.push(node2); + nodes2.push(node2); + } else { + if (nodes2.length === 0) { + nodes2.push(node2); + } else { + throw new Error( + 'There can be only one root. No parent could be found for ("' + node2.descr + '")' + ); + } + } + }, "addNode"); + nodeType = { + DEFAULT: 0, + NO_BORDER: 0, + ROUNDED_RECT: 1, + RECT: 2, + CIRCLE: 3, + CLOUD: 4, + BANG: 5, + HEXAGON: 6 + }; + getType = /* @__PURE__ */ __name((startStr, endStr) => { + log.debug("In get type", startStr, endStr); + switch (startStr) { + case "[": + return nodeType.RECT; + case "(": + return endStr === ")" ? nodeType.ROUNDED_RECT : nodeType.CLOUD; + case "((": + return nodeType.CIRCLE; + case ")": + return nodeType.CLOUD; + case "))": + return nodeType.BANG; + case "{{": + return nodeType.HEXAGON; + default: + return nodeType.DEFAULT; + } + }, "getType"); + setElementForId = /* @__PURE__ */ __name((id26, element3) => { + elements2[id26] = element3; + }, "setElementForId"); + decorateNode = /* @__PURE__ */ __name((decoration) => { + if (!decoration) { + return; + } + const config6 = getConfig2(); + const node2 = nodes2[nodes2.length - 1]; + if (decoration.icon) { + node2.icon = sanitizeText(decoration.icon, config6); + } + if (decoration.class) { + node2.class = sanitizeText(decoration.class, config6); + } + }, "decorateNode"); + type2Str = /* @__PURE__ */ __name((type3) => { + switch (type3) { + case nodeType.DEFAULT: + return "no-border"; + case nodeType.RECT: + return "rect"; + case nodeType.ROUNDED_RECT: + return "rounded-rect"; + case nodeType.CIRCLE: + return "circle"; + case nodeType.CLOUD: + return "cloud"; + case nodeType.BANG: + return "bang"; + case nodeType.HEXAGON: + return "hexgon"; + default: + return "no-border"; + } + }, "type2Str"); + getLogger = /* @__PURE__ */ __name(() => log, "getLogger"); + getElementById = /* @__PURE__ */ __name((id26) => elements2[id26], "getElementById"); + db4 = { + clear: clear25, + addNode, + getMindmap, + nodeType, + getType, + setElementForId, + decorateNode, + type2Str, + getLogger, + getElementById + }; + mindmapDb_default = db4; + } + }); + + // ../../node_modules/.pnpm/cytoscape@3.30.1/node_modules/cytoscape/dist/cytoscape.esm.mjs + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + function _classCallCheck(instance2, Constructor) { + if (!(instance2 instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i2 = 0; i2 < props.length; i2++) { + var descriptor = props[i2]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _defineProperty$1(obj, key, value2) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + function _slicedToArray(arr, i2) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _iterableToArrayLimit(arr, i2) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i2 && _arr.length === i2) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _unsupportedIterableToArray(o2, minLen) { + if (!o2) return; + if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen); + var n2 = Object.prototype.toString.call(o2).slice(8, -1); + if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; + if (n2 === "Map" || n2 === "Set") return Array.from(o2); + if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray(o2, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2]; + return arr2; + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _createForOfIteratorHelper(o2, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"]; + if (!it) { + if (Array.isArray(o2) || (it = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") { + if (it) o2 = it; + var i2 = 0; + var F2 = /* @__PURE__ */ __name(function() { + }, "F"); + return { + s: F2, + n: /* @__PURE__ */ __name(function() { + if (i2 >= o2.length) return { + done: true + }; + return { + done: false, + value: o2[i2++] + }; + }, "n"), + e: /* @__PURE__ */ __name(function(e3) { + throw e3; + }, "e"), + f: F2 + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, didErr = false, err; + return { + s: /* @__PURE__ */ __name(function() { + it = it.call(o2); + }, "s"), + n: /* @__PURE__ */ __name(function() { + var step3 = it.next(); + normalCompletion = step3.done; + return step3; + }, "n"), + e: /* @__PURE__ */ __name(function(e3) { + didErr = true; + err = e3; + }, "e"), + f: /* @__PURE__ */ __name(function() { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + }, "f") + }; + } + function isObject2(value2) { + var type3 = typeof value2; + return value2 != null && (type3 == "object" || type3 == "function"); + } + function createCommonjsModule(fn3, module2) { + return module2 = { exports: {} }, fn3(module2, module2.exports), module2.exports; + } + function trimmedEndIndex2(string3) { + var index = string3.length; + while (index-- && reWhitespace2.test(string3.charAt(index))) { + } + return index; + } + function baseTrim2(string3) { + return string3 ? string3.slice(0, _trimmedEndIndex(string3) + 1).replace(reTrimStart2, "") : string3; + } + function getRawTag2(value2) { + var isOwn = hasOwnProperty$4.call(value2, symToStringTag$1), tag2 = value2[symToStringTag$1]; + try { + value2[symToStringTag$1] = void 0; + var unmasked = true; + } catch (e3) { + } + var result = nativeObjectToString$1.call(value2); + if (unmasked) { + if (isOwn) { + value2[symToStringTag$1] = tag2; + } else { + delete value2[symToStringTag$1]; + } + } + return result; + } + function objectToString2(value2) { + return nativeObjectToString3.call(value2); + } + function baseGetTag2(value2) { + if (value2 == null) { + return value2 === void 0 ? undefinedTag2 : nullTag2; + } + return symToStringTag3 && symToStringTag3 in Object(value2) ? _getRawTag(value2) : _objectToString(value2); + } + function isObjectLike2(value2) { + return value2 != null && typeof value2 == "object"; + } + function isSymbol2(value2) { + return typeof value2 == "symbol" || isObjectLike_1(value2) && _baseGetTag(value2) == symbolTag5; + } + function toNumber2(value2) { + if (typeof value2 == "number") { + return value2; + } + if (isSymbol_1(value2)) { + return NAN2; + } + if (isObject_1(value2)) { + var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2; + value2 = isObject_1(other) ? other + "" : other; + } + if (typeof value2 != "string") { + return value2 === 0 ? value2 : +value2; + } + value2 = _baseTrim(value2); + var isBinary2 = reIsBinary2.test(value2); + return isBinary2 || reIsOctal2.test(value2) ? freeParseInt2(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex2.test(value2) ? NAN2 : +value2; + } + function debounce(func, wait, options3) { + var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT$1); + } + wait = toNumber_1(wait) || 0; + if (isObject_1(options3)) { + leading = !!options3.leading; + maxing = "maxWait" in options3; + maxWait = maxing ? nativeMax6(toNumber_1(options3.maxWait) || 0, wait) : maxWait; + trailing = "trailing" in options3 ? !!options3.trailing : trailing; + } + function invokeFunc(time4) { + var args = lastArgs, thisArg = lastThis; + lastArgs = lastThis = void 0; + lastInvokeTime = time4; + result = func.apply(thisArg, args); + return result; + } + __name(invokeFunc, "invokeFunc"); + function leadingEdge(time4) { + lastInvokeTime = time4; + timerId = setTimeout(timerExpired, wait); + return leading ? invokeFunc(time4) : result; + } + __name(leadingEdge, "leadingEdge"); + function remainingWait(time4) { + var timeSinceLastCall = time4 - lastCallTime, timeSinceLastInvoke = time4 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; + return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; + } + __name(remainingWait, "remainingWait"); + function shouldInvoke(time4) { + var timeSinceLastCall = time4 - lastCallTime, timeSinceLastInvoke = time4 - lastInvokeTime; + return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; + } + __name(shouldInvoke, "shouldInvoke"); + function timerExpired() { + var time4 = now_1(); + if (shouldInvoke(time4)) { + return trailingEdge(time4); + } + timerId = setTimeout(timerExpired, remainingWait(time4)); + } + __name(timerExpired, "timerExpired"); + function trailingEdge(time4) { + timerId = void 0; + if (trailing && lastArgs) { + return invokeFunc(time4); + } + lastArgs = lastThis = void 0; + return result; + } + __name(trailingEdge, "trailingEdge"); + function cancel() { + if (timerId !== void 0) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = void 0; + } + __name(cancel, "cancel"); + function flush() { + return timerId === void 0 ? result : trailingEdge(now_1()); + } + __name(flush, "flush"); + function debounced() { + var time4 = now_1(), isInvoking = shouldInvoke(time4); + lastArgs = arguments; + lastThis = this; + lastCallTime = time4; + if (isInvoking) { + if (timerId === void 0) { + return leadingEdge(lastCallTime); + } + if (maxing) { + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === void 0) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + __name(debounced, "debounced"); + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + function clusteringDistance(method, length2, getP, getQ, nodeP, nodeQ) { + var impl2; + if (fn$6(method)) { + impl2 = method; + } else { + impl2 = distances[method] || distances.euclidean; + } + if (length2 === 0 && fn$6(method)) { + return impl2(nodeP, nodeQ); + } else { + return impl2(length2, getP, getQ, nodeP, nodeQ); + } + } + function isKey2(value2, object3) { + if (isArray_1(value2)) { + return false; + } + var type3 = typeof value2; + if (type3 == "number" || type3 == "symbol" || type3 == "boolean" || value2 == null || isSymbol_1(value2)) { + return true; + } + return reIsPlainProp2.test(value2) || !reIsDeepProp2.test(value2) || object3 != null && value2 in Object(object3); + } + function isFunction2(value2) { + if (!isObject_1(value2)) { + return false; + } + var tag2 = _baseGetTag(value2); + return tag2 == funcTag4 || tag2 == genTag3 || tag2 == asyncTag2 || tag2 == proxyTag2; + } + function isMasked2(func) { + return !!maskSrcKey2 && maskSrcKey2 in func; + } + function toSource2(func) { + if (func != null) { + try { + return funcToString$1.call(func); + } catch (e3) { + } + try { + return func + ""; + } catch (e3) { + } + } + return ""; + } + function baseIsNative2(value2) { + if (!isObject_1(value2) || _isMasked(value2)) { + return false; + } + var pattern = isFunction_1(value2) ? reIsNative2 : reIsHostCtor2; + return pattern.test(_toSource(value2)); + } + function getValue$1(object3, key) { + return object3 == null ? void 0 : object3[key]; + } + function getNative2(object3, key) { + var value2 = _getValue(object3, key); + return _baseIsNative(value2) ? value2 : void 0; + } + function hashClear2() { + this.__data__ = _nativeCreate ? _nativeCreate(null) : {}; + this.size = 0; + } + function hashDelete2(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + function hashGet2(key) { + var data5 = this.__data__; + if (_nativeCreate) { + var result = data5[key]; + return result === HASH_UNDEFINED$1 ? void 0 : result; + } + return hasOwnProperty$2.call(data5, key) ? data5[key] : void 0; + } + function hashHas2(key) { + var data5 = this.__data__; + return _nativeCreate ? data5[key] !== void 0 : hasOwnProperty$1.call(data5, key); + } + function hashSet2(key, value2) { + var data5 = this.__data__; + this.size += this.has(key) ? 0 : 1; + data5[key] = _nativeCreate && value2 === void 0 ? HASH_UNDEFINED4 : value2; + return this; + } + function Hash2(entries) { + var index = -1, length2 = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length2) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function listCacheClear2() { + this.__data__ = []; + this.size = 0; + } + function eq2(value2, other) { + return value2 === other || value2 !== value2 && other !== other; + } + function assocIndexOf2(array4, key) { + var length2 = array4.length; + while (length2--) { + if (eq_1(array4[length2][0], key)) { + return length2; + } + } + return -1; + } + function listCacheDelete2(key) { + var data5 = this.__data__, index = _assocIndexOf(data5, key); + if (index < 0) { + return false; + } + var lastIndex = data5.length - 1; + if (index == lastIndex) { + data5.pop(); + } else { + splice2.call(data5, index, 1); + } + --this.size; + return true; + } + function listCacheGet2(key) { + var data5 = this.__data__, index = _assocIndexOf(data5, key); + return index < 0 ? void 0 : data5[index][1]; + } + function listCacheHas2(key) { + return _assocIndexOf(this.__data__, key) > -1; + } + function listCacheSet2(key, value2) { + var data5 = this.__data__, index = _assocIndexOf(data5, key); + if (index < 0) { + ++this.size; + data5.push([key, value2]); + } else { + data5[index][1] = value2; + } + return this; + } + function ListCache2(entries) { + var index = -1, length2 = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length2) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function mapCacheClear2() { + this.size = 0; + this.__data__ = { + "hash": new _Hash(), + "map": new (_Map || _ListCache)(), + "string": new _Hash() + }; + } + function isKeyable2(value2) { + var type3 = typeof value2; + return type3 == "string" || type3 == "number" || type3 == "symbol" || type3 == "boolean" ? value2 !== "__proto__" : value2 === null; + } + function getMapData2(map5, key) { + var data5 = map5.__data__; + return _isKeyable(key) ? data5[typeof key == "string" ? "string" : "hash"] : data5.map; + } + function mapCacheDelete2(key) { + var result = _getMapData(this, key)["delete"](key); + this.size -= result ? 1 : 0; + return result; + } + function mapCacheGet2(key) { + return _getMapData(this, key).get(key); + } + function mapCacheHas2(key) { + return _getMapData(this, key).has(key); + } + function mapCacheSet2(key, value2) { + var data5 = _getMapData(this, key), size5 = data5.size; + data5.set(key, value2); + this.size += data5.size == size5 ? 0 : 1; + return this; + } + function MapCache2(entries) { + var index = -1, length2 = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length2) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function memoize3(func, resolver3) { + if (typeof func != "function" || resolver3 != null && typeof resolver3 != "function") { + throw new TypeError(FUNC_ERROR_TEXT3); + } + var memoized = /* @__PURE__ */ __name(function() { + var args = arguments, key = resolver3 ? resolver3.apply(this, args) : args[0], cache3 = memoized.cache; + if (cache3.has(key)) { + return cache3.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache3.set(key, result) || cache3; + return result; + }, "memoized"); + memoized.cache = new (memoize3.Cache || _MapCache)(); + return memoized; + } + function memoizeCapped2(func) { + var result = memoize_1(func, function(key) { + if (cache3.size === MAX_MEMOIZE_SIZE2) { + cache3.clear(); + } + return key; + }); + var cache3 = result.cache; + return result; + } + function arrayMap2(array4, iteratee) { + var index = -1, length2 = array4 == null ? 0 : array4.length, result = Array(length2); + while (++index < length2) { + result[index] = iteratee(array4[index], index, array4); + } + return result; + } + function baseToString2(value2) { + if (typeof value2 == "string") { + return value2; + } + if (isArray_1(value2)) { + return _arrayMap(value2, baseToString2) + ""; + } + if (isSymbol_1(value2)) { + return symbolToString2 ? symbolToString2.call(value2) : ""; + } + var result = value2 + ""; + return result == "0" && 1 / value2 == -INFINITY$1 ? "-0" : result; + } + function toString$1(value2) { + return value2 == null ? "" : _baseToString(value2); + } + function castPath2(value2, object3) { + if (isArray_1(value2)) { + return value2; + } + return _isKey(value2, object3) ? [value2] : _stringToPath(toString_1(value2)); + } + function toKey2(value2) { + if (typeof value2 == "string" || isSymbol_1(value2)) { + return value2; + } + var result = value2 + ""; + return result == "0" && 1 / value2 == -INFINITY5 ? "-0" : result; + } + function baseGet2(object3, path4) { + path4 = _castPath(path4, object3); + var index = 0, length2 = path4.length; + while (object3 != null && index < length2) { + object3 = object3[_toKey(path4[index++])]; + } + return index && index == length2 ? object3 : void 0; + } + function get5(object3, path4, defaultValue) { + var result = object3 == null ? void 0 : _baseGet(object3, path4); + return result === void 0 ? defaultValue : result; + } + function baseAssignValue2(object3, key, value2) { + if (key == "__proto__" && _defineProperty) { + _defineProperty(object3, key, { + "configurable": true, + "enumerable": true, + "value": value2, + "writable": true + }); + } else { + object3[key] = value2; + } + } + function assignValue2(object3, key, value2) { + var objValue = object3[key]; + if (!(hasOwnProperty19.call(object3, key) && eq_1(objValue, value2)) || value2 === void 0 && !(key in object3)) { + _baseAssignValue(object3, key, value2); + } + } + function isIndex2(value2, length2) { + var type3 = typeof value2; + length2 = length2 == null ? MAX_SAFE_INTEGER3 : length2; + return !!length2 && (type3 == "number" || type3 != "symbol" && reIsUint2.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2); + } + function baseSet2(object3, path4, value2, customizer) { + if (!isObject_1(object3)) { + return object3; + } + path4 = _castPath(path4, object3); + var index = -1, length2 = path4.length, lastIndex = length2 - 1, nested = object3; + while (nested != null && ++index < length2) { + var key = _toKey(path4[index]), newValue = value2; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return object3; + } + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : void 0; + if (newValue === void 0) { + newValue = isObject_1(objValue) ? objValue : _isIndex(path4[index + 1]) ? [] : {}; + } + } + _assignValue(nested, key, newValue); + nested = nested[key]; + } + return object3; + } + function set4(object3, path4, value2) { + return object3 == null ? object3 : _baseSet(object3, path4, value2); + } + function copyArray3(source, array4) { + var index = -1, length2 = source.length; + array4 || (array4 = Array(length2)); + while (++index < length2) { + array4[index] = source[index]; + } + return array4; + } + function toPath(value2) { + if (isArray_1(value2)) { + return _arrayMap(value2, _toKey); + } + return isSymbol_1(value2) ? [value2] : _copyArray(_stringToPath(toString_1(value2))); + } + function forEachCompound(eles, fn3, includeSelf, recursiveStep) { + var q2 = []; + var did = new Set$1(); + var cy = eles.cy(); + var hasCompounds = cy.hasCompoundNodes(); + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + if (includeSelf) { + q2.push(ele); + } else if (hasCompounds) { + recursiveStep(q2, did, ele); + } + } + while (q2.length > 0) { + var _ele = q2.shift(); + fn3(_ele); + did.add(_ele.id()); + if (hasCompounds) { + recursiveStep(q2, did, _ele); + } + } + return eles; + } + function addChildren(q2, did, ele) { + if (ele.isParent()) { + var children2 = ele._private.children; + for (var i2 = 0; i2 < children2.length; i2++) { + var child = children2[i2]; + if (!did.has(child.id())) { + q2.push(child); + } + } + } + } + function addParent(q2, did, ele) { + if (ele.isChild()) { + var parent4 = ele._private.parent; + if (!did.has(parent4.id())) { + q2.push(parent4); + } + } + } + function addParentAndChildren(q2, did, ele) { + addParent(q2, did, ele); + addChildren(q2, did, ele); + } + function defineDegreeFunction(callback) { + return function(includeLoops) { + var self2 = this; + if (includeLoops === void 0) { + includeLoops = true; + } + if (self2.length === 0) { + return; + } + if (self2.isNode() && !self2.removed()) { + var degree = 0; + var node2 = self2[0]; + var connectedEdges = node2._private.edges; + for (var i2 = 0; i2 < connectedEdges.length; i2++) { + var edge = connectedEdges[i2]; + if (!includeLoops && edge.isLoop()) { + continue; + } + degree += callback(node2, edge); + } + return degree; + } else { + return; + } + }; + } + function defineDegreeBoundsFunction(degreeFn, callback) { + return function(includeLoops) { + var ret; + var nodes6 = this.nodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + var ele = nodes6[i2]; + var degree = ele[degreeFn](includeLoops); + if (degree !== void 0 && (ret === void 0 || callback(degree, ret))) { + ret = degree; + } + } + return ret; + }; + } + function returnFalse() { + return false; + } + function returnTrue() { + return true; + } + function Emitter2() { + var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyOpts; + var context = arguments.length > 1 ? arguments[1] : void 0; + for (var i2 = 0; i2 < defaultsKeys.length; i2++) { + var key = defaultsKeys[i2]; + this[key] = opts[key] || defaults$8[key]; + } + this.context = context || this.context; + this.listeners = []; + this.emitting = 0; + } + function styleCache(key, fn3, ele) { + var _p = ele._private; + var cache3 = _p.styleCache = _p.styleCache || []; + var val; + if ((val = cache3[key]) != null) { + return val; + } else { + val = cache3[key] = fn3(ele); + return val; + } + } + function cacheStyleFunction(key, fn3) { + key = hashString(key); + return /* @__PURE__ */ __name(function cachedStyleFunction(ele) { + return styleCache(key, fn3, ele); + }, "cachedStyleFunction"); + } + function cachePrototypeStyleFunction(key, fn3) { + key = hashString(key); + var selfFn = /* @__PURE__ */ __name(function selfFn2(ele) { + return fn3.call(ele); + }, "selfFn"); + return /* @__PURE__ */ __name(function cachedPrototypeStyleFunction() { + var ele = this[0]; + if (ele) { + return styleCache(key, selfFn, ele); + } + }, "cachedPrototypeStyleFunction"); + } + function checkCompound(ele, parentOk) { + var _p = ele._private; + var parents4 = _p.data.parent ? ele.parents() : null; + if (parents4) { + for (var i2 = 0; i2 < parents4.length; i2++) { + var parent4 = parents4[i2]; + if (!parentOk(parent4)) { + return false; + } + } + } + return true; + } + function defineDerivedStateFunction(specs) { + var ok = specs.ok; + var edgeOkViaNode = specs.edgeOkViaNode || specs.ok; + var parentOk = specs.parentOk || specs.ok; + return function() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return true; + } + var ele = this[0]; + var hasCompoundNodes2 = cy.hasCompoundNodes(); + if (ele) { + var _p = ele._private; + if (!ok(ele)) { + return false; + } + if (ele.isNode()) { + return !hasCompoundNodes2 || checkCompound(ele, parentOk); + } else { + var src = _p.source; + var tgt = _p.target; + return edgeOkViaNode(src) && (!hasCompoundNodes2 || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes2 || checkCompound(tgt, edgeOkViaNode))); + } + } + }; + } + function defineSwitchFunction(params) { + return function() { + var args = arguments; + var changedEles = []; + if (args.length === 2) { + var data5 = args[0]; + var handler = args[1]; + this.on(params.event, data5, handler); + } else if (args.length === 1 && fn$6(args[0])) { + var _handler = args[0]; + this.on(params.event, _handler); + } else if (args.length === 0 || args.length === 1 && array2(args[0])) { + var addlEvents = args.length === 1 ? args[0] : null; + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var able = !params.ableField || ele._private[params.ableField]; + var changed = ele._private[params.field] != params.value; + if (params.overrideAble) { + var overrideAble2 = params.overrideAble(ele); + if (overrideAble2 !== void 0) { + able = overrideAble2; + if (!overrideAble2) { + return this; } - return a.d = a.Td(); - } - function Uee(a, b) { - return ufe(Pee(a, b)) ? b.zi() : null; - } - function ed(a) { - return ZD(a, 15) ? RD(a, 15).ed() : a.Kc(); - } - function De(a) { - return a.Qc($C(jJ, rve, 1, a.gc(), 5, 1)); - } - function aE(a) { - return a != null && cE(a) && !(a.Tm === keb); - } - function YD(a) { - return !Array.isArray(a) && a.Tm === keb; - } - function vx(a, b) { - return Qb(b), a.a.Jd(b) && !a.b.Jd(b); - } - function tD(a, b) { - return hD(a.l & b.l, a.m & b.m, a.h & b.h); - } - function zD(a, b) { - return hD(a.l | b.l, a.m | b.m, a.h | b.h); - } - function HD(a, b) { - return hD(a.l ^ b.l, a.m ^ b.m, a.h ^ b.h); - } - function Sdb(a, b) { - return Edb(AD(Kdb(a) ? Wdb(a) : a, b)); - } - function Tdb(a, b) { - return Edb(BD(Kdb(a) ? Wdb(a) : a, b)); - } - function Udb(a, b) { - return Edb(CD(Kdb(a) ? Wdb(a) : a, b)); } - function Ieb(a, b) { - return Keb((uFb(a), a), (uFb(b), b)); - } - function Jfb(a, b) { - return Qfb((uFb(a), a), (uFb(b), b)); - } - function pwb(a) { - this.b = new cnb(11); - this.a = (urb(), a); - } - function is(a) { - this.a = (cs(), bs); - this.d = RD(Qb(a), 51); - } - function Axb(a, b) { - this.c = 0; - this.d = a; - this.b = b | 64 | Ove; - } - function kxb(a, b) { - this.e = a; - this.d = (b & 64) != 0 ? b | Ove : b; - } - function ezb(a) { - this.b = null; - this.a = (urb(), !a ? rrb : a); - } - function nz(a) { - ez(this); - this.g = a; - gz(this); - this.je(); + } + if (able) { + ele._private[params.field] = params.value; + if (changed) { + changedEles.push(ele); } - function vue(a) { - uue(); - this.a = 0; - this.b = a - 1; - this.c = 1; + } + } + var changedColl = this.spawn(changedEles); + changedColl.updateStyle(); + changedColl.emit(params.event); + if (addlEvents) { + changedColl.emit(addlEvents); + } + } + return this; + }; + } + function defineSwitchSet(params) { + elesfn$3[params.field] = function() { + var ele = this[0]; + if (ele) { + if (params.overrideField) { + var val = params.overrideField(ele); + if (val !== void 0) { + return val; + } + } + return ele._private[params.field]; + } + }; + elesfn$3[params.on] = defineSwitchFunction({ + event: params.on, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: true + }); + elesfn$3[params.off] = defineSwitchFunction({ + event: params.off, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: false + }); + } + function defineSourceFunction(params) { + return /* @__PURE__ */ __name(function sourceImpl2(selector) { + var sources = []; + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var src = ele._private[params.attr]; + if (src) { + sources.push(src); + } + } + return this.spawn(sources, true).filter(selector); + }, "sourceImpl"); + } + function defineEdgesWithFunction(params) { + return /* @__PURE__ */ __name(function edgesWithImpl(otherNodes) { + var elements3 = []; + var cy = this._private.cy; + var p3 = params || {}; + if (string(otherNodes)) { + otherNodes = cy.$(otherNodes); + } + for (var h2 = 0; h2 < otherNodes.length; h2++) { + var edges5 = otherNodes[h2]._private.edges; + for (var i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; + var edgeData = edge._private.data; + var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target); + var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target); + var edgeConnectsThisAndOther = thisToOther || otherToThis; + if (!edgeConnectsThisAndOther) { + continue; + } + if (p3.thisIsSrc || p3.thisIsTgt) { + if (p3.thisIsSrc && !thisToOther) { + continue; } - function yg(a, b, c2, d) { - this.a = a; - lg.call(this, a, b, c2, d); + if (p3.thisIsTgt && !otherToThis) { + continue; } - function gEb(a, b, c2) { - if (a.a.Mb(c2)) { - a.b = true; - b.Cd(c2); + } + elements3.push(edge); + } + } + return this.spawn(elements3, true); + }, "edgesWithImpl"); + } + function defineParallelEdgesFunction(params) { + var defaults4 = { + codirected: false + }; + params = extend2({}, defaults4, params); + return /* @__PURE__ */ __name(function parallelEdgesImpl(selector) { + var elements3 = []; + var edges5 = this.edges(); + var p3 = params; + for (var i2 = 0; i2 < edges5.length; i2++) { + var edge1 = edges5[i2]; + var edge1_p = edge1._private; + var src1 = edge1_p.source; + var srcid1 = src1._private.data.id; + var tgtid1 = edge1_p.data.target; + var srcEdges1 = src1._private.edges; + for (var j2 = 0; j2 < srcEdges1.length; j2++) { + var edge2 = srcEdges1[j2]; + var edge2data = edge2._private.data; + var tgtid2 = edge2data.target; + var srcid2 = edge2data.source; + var codirected = tgtid2 === tgtid1 && srcid2 === srcid1; + var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; + if (p3.codirected && codirected || !p3.codirected && (codirected || oppdirected)) { + elements3.push(edge2); + } + } + } + return this.spawn(elements3, true).filter(selector); + }, "parallelEdgesImpl"); + } + function generateCubicBezier(mX1, mY1, mX2, mY2) { + var NEWTON_ITERATIONS = 4, NEWTON_MIN_SLOPE = 1e-3, SUBDIVISION_PRECISION = 1e-7, SUBDIVISION_MAX_ITERATIONS = 10, kSplineTableSize = 11, kSampleStepSize = 1 / (kSplineTableSize - 1), float32ArraySupported = typeof Float32Array !== "undefined"; + if (arguments.length !== 4) { + return false; + } + for (var i2 = 0; i2 < 4; ++i2) { + if (typeof arguments[i2] !== "number" || isNaN(arguments[i2]) || !isFinite(arguments[i2])) { + return false; + } + } + mX1 = Math.min(mX1, 1); + mX2 = Math.min(mX2, 1); + mX1 = Math.max(mX1, 0); + mX2 = Math.max(mX2, 0); + var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + function A2(aA1, aA2) { + return 1 - 3 * aA2 + 3 * aA1; + } + __name(A2, "A"); + function B2(aA1, aA2) { + return 3 * aA2 - 6 * aA1; + } + __name(B2, "B"); + function C2(aA1) { + return 3 * aA1; + } + __name(C2, "C"); + function calcBezier(aT, aA1, aA2) { + return ((A2(aA1, aA2) * aT + B2(aA1, aA2)) * aT + C2(aA1)) * aT; + } + __name(calcBezier, "calcBezier"); + function getSlope(aT, aA1, aA2) { + return 3 * A2(aA1, aA2) * aT * aT + 2 * B2(aA1, aA2) * aT + C2(aA1); + } + __name(getSlope, "getSlope"); + function newtonRaphsonIterate(aX, aGuessT) { + for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + if (currentSlope === 0) { + return aGuessT; + } + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + return aGuessT; + } + __name(newtonRaphsonIterate, "newtonRaphsonIterate"); + function calcSampleValues() { + for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) { + mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2); + } + } + __name(calcSampleValues, "calcSampleValues"); + function binarySubdivide(aX, aA, aB) { + var currentX, currentT, i3 = 0; + do { + currentT = aA + (aB - aA) / 2; + currentX = calcBezier(currentT, mX1, mX2) - aX; + if (currentX > 0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i3 < SUBDIVISION_MAX_ITERATIONS); + return currentT; + } + __name(binarySubdivide, "binarySubdivide"); + function getTForX(aX) { + var intervalStart = 0, currentSample = 1, lastSample = kSplineTableSize - 1; + for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + --currentSample; + var dist3 = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), guessForT = intervalStart + dist3 * kSampleStepSize, initialSlope = getSlope(guessForT, mX1, mX2); + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT); + } else if (initialSlope === 0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); + } + } + __name(getTForX, "getTForX"); + var _precomputed = false; + function precompute() { + _precomputed = true; + if (mX1 !== mY1 || mX2 !== mY2) { + calcSampleValues(); + } + } + __name(precompute, "precompute"); + var f3 = /* @__PURE__ */ __name(function f4(aX) { + if (!_precomputed) { + precompute(); + } + if (mX1 === mY1 && mX2 === mY2) { + return aX; + } + if (aX === 0) { + return 0; + } + if (aX === 1) { + return 1; + } + return calcBezier(getTForX(aX), mY1, mY2); + }, "f"); + f3.getControlPoints = function() { + return [{ + x: mX1, + y: mY1 + }, { + x: mX2, + y: mY2 + }]; + }; + var str2 = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; + f3.toString = function() { + return str2; + }; + return f3; + } + function getEasedValue(type3, start3, end2, percent, easingFn) { + if (percent === 1) { + return end2; + } + if (start3 === end2) { + return end2; + } + var val = easingFn(start3, end2, percent); + if (type3 == null) { + return val; + } + if (type3.roundValue || type3.color) { + val = Math.round(val); + } + if (type3.min !== void 0) { + val = Math.max(val, type3.min); + } + if (type3.max !== void 0) { + val = Math.min(val, type3.max); + } + return val; + } + function getValue2(prop, spec) { + if (prop.pfValue != null || prop.value != null) { + if (prop.pfValue != null && (spec == null || spec.type.units !== "%")) { + return prop.pfValue; + } else { + return prop.value; + } + } else { + return prop; + } + } + function ease(startProp, endProp, percent, easingFn, propSpec) { + var type3 = propSpec != null ? propSpec.type : null; + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + var start3 = getValue2(startProp, propSpec); + var end2 = getValue2(endProp, propSpec); + if (number$1(start3) && number$1(end2)) { + return getEasedValue(type3, start3, end2, percent, easingFn); + } else if (array2(start3) && array2(end2)) { + var easedArr = []; + for (var i2 = 0; i2 < end2.length; i2++) { + var si = start3[i2]; + var ei = end2[i2]; + if (si != null && ei != null) { + var val = getEasedValue(type3, si, ei, percent, easingFn); + easedArr.push(val); + } else { + easedArr.push(ei); + } + } + return easedArr; + } + return void 0; + } + function step$1(self2, ani, now4, isCore) { + var isEles = !isCore; + var _p = self2._private; + var ani_p = ani._private; + var pEasing = ani_p.easing; + var startTime = ani_p.startTime; + var cy = isCore ? self2 : self2.cy(); + var style3 = cy.style(); + if (!ani_p.easingImpl) { + if (pEasing == null) { + ani_p.easingImpl = easings["linear"]; + } else { + var easingVals; + if (string(pEasing)) { + var easingProp = style3.parse("transition-timing-function", pEasing); + easingVals = easingProp.value; + } else { + easingVals = pEasing; + } + var name, args; + if (string(easingVals)) { + name = easingVals; + args = []; + } else { + name = easingVals[1]; + args = easingVals.slice(2).map(function(n2) { + return +n2; + }); + } + if (args.length > 0) { + if (name === "spring") { + args.push(ani_p.duration); + } + ani_p.easingImpl = easings[name].apply(null, args); + } else { + ani_p.easingImpl = easings[name]; + } + } + } + var easing = ani_p.easingImpl; + var percent; + if (ani_p.duration === 0) { + percent = 1; + } else { + percent = (now4 - startTime) / ani_p.duration; + } + if (ani_p.applying) { + percent = ani_p.progress; + } + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + if (ani_p.delay == null) { + var startPos = ani_p.startPosition; + var endPos = ani_p.position; + if (endPos && isEles && !self2.locked()) { + var newPos = {}; + if (valid(startPos.x, endPos.x)) { + newPos.x = ease(startPos.x, endPos.x, percent, easing); + } + if (valid(startPos.y, endPos.y)) { + newPos.y = ease(startPos.y, endPos.y, percent, easing); + } + self2.position(newPos); + } + var startPan = ani_p.startPan; + var endPan = ani_p.pan; + var pan2 = _p.pan; + var animatingPan = endPan != null && isCore; + if (animatingPan) { + if (valid(startPan.x, endPan.x)) { + pan2.x = ease(startPan.x, endPan.x, percent, easing); + } + if (valid(startPan.y, endPan.y)) { + pan2.y = ease(startPan.y, endPan.y, percent, easing); + } + self2.emit("pan"); + } + var startZoom = ani_p.startZoom; + var endZoom = ani_p.zoom; + var animatingZoom = endZoom != null && isCore; + if (animatingZoom) { + if (valid(startZoom, endZoom)) { + _p.zoom = bound(_p.minZoom, ease(startZoom, endZoom, percent, easing), _p.maxZoom); + } + self2.emit("zoom"); + } + if (animatingPan || animatingZoom) { + self2.emit("viewport"); + } + var props = ani_p.style; + if (props && props.length > 0 && isEles) { + for (var i2 = 0; i2 < props.length; i2++) { + var prop = props[i2]; + var _name = prop.name; + var end2 = prop; + var start3 = ani_p.startStyle[_name]; + var propSpec = style3.properties[start3.name]; + var easedVal = ease(start3, end2, percent, easing, propSpec); + style3.overrideBypass(self2, _name, easedVal); + } + self2.emit("style"); + } + } + ani_p.progress = percent; + return percent; + } + function valid(start3, end2) { + if (start3 == null || end2 == null) { + return false; + } + if (number$1(start3) && number$1(end2)) { + return true; + } else if (start3 && end2) { + return true; + } + return false; + } + function startAnimation(self2, ani, now4, isCore) { + var ani_p = ani._private; + ani_p.started = true; + ani_p.startTime = now4 - ani_p.progress * ani_p.duration; + } + function stepAll(now4, cy) { + var eles = cy._private.aniEles; + var doneEles = []; + function stepOne(ele2, isCore) { + var _p = ele2._private; + var current = _p.animation.current; + var queue = _p.animation.queue; + var ranAnis = false; + if (current.length === 0) { + var next3 = queue.shift(); + if (next3) { + current.push(next3); + } + } + var callbacks = /* @__PURE__ */ __name(function callbacks2(_callbacks) { + for (var j2 = _callbacks.length - 1; j2 >= 0; j2--) { + var cb = _callbacks[j2]; + cb(); + } + _callbacks.splice(0, _callbacks.length); + }, "callbacks"); + for (var i2 = current.length - 1; i2 >= 0; i2--) { + var ani = current[i2]; + var ani_p = ani._private; + if (ani_p.stopped) { + current.splice(i2, 1); + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + callbacks(ani_p.frames); + continue; + } + if (!ani_p.playing && !ani_p.applying) { + continue; + } + if (ani_p.playing && ani_p.applying) { + ani_p.applying = false; + } + if (!ani_p.started) { + startAnimation(ele2, ani, now4); + } + step$1(ele2, ani, now4, isCore); + if (ani_p.applying) { + ani_p.applying = false; + } + callbacks(ani_p.frames); + if (ani_p.step != null) { + ani_p.step(now4); + } + if (ani.completed()) { + current.splice(i2, 1); + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + callbacks(ani_p.completes); + } + ranAnis = true; + } + if (!isCore && current.length === 0 && queue.length === 0) { + doneEles.push(ele2); + } + return ranAnis; + } + __name(stepOne, "stepOne"); + var ranEleAni = false; + for (var e3 = 0; e3 < eles.length; e3++) { + var ele = eles[e3]; + var handledThisEle = stepOne(ele); + ranEleAni = ranEleAni || handledThisEle; + } + var ranCoreAni = stepOne(cy, true); + if (ranEleAni || ranCoreAni) { + if (eles.length > 0) { + cy.notify("draw", eles); + } else { + cy.notify("draw"); + } + } + eles.unmerge(doneEles); + cy.emit("step"); + } + function BreadthFirstLayout(options3) { + this.options = extend2({}, defaults$7, deprecatedOptionDefaults, options3); + } + function CircleLayout(options3) { + this.options = extend2({}, defaults$6, options3); + } + function ConcentricLayout(options3) { + this.options = extend2({}, defaults$5, options3); + } + function CoseLayout(options3) { + this.options = extend2({}, defaults$4, options3); + this.options.layout = this; + var nodes6 = this.options.eles.nodes(); + var edges5 = this.options.eles.edges(); + var notEdges = edges5.filter(function(e3) { + var sourceId = e3.source().data("id"); + var targetId = e3.target().data("id"); + var hasSource = nodes6.some(function(n2) { + return n2.data("id") === sourceId; + }); + var hasTarget = nodes6.some(function(n2) { + return n2.data("id") === targetId; + }); + return !hasSource || !hasTarget; + }); + this.options.eles = this.options.eles.not(notEdges); + } + function GridLayout(options3) { + this.options = extend2({}, defaults$3, options3); + } + function NullLayout(options3) { + this.options = extend2({}, defaults$2, options3); + } + function PresetLayout(options3) { + this.options = extend2({}, defaults$1, options3); + } + function RandomLayout(options3) { + this.options = extend2({}, defaults3, options3); + } + function NullRenderer(options3) { + this.options = options3; + this.notifications = 0; + } + function drawPreparedRoundCorner(ctx, roundCorner) { + if (roundCorner.radius === 0) ctx.lineTo(roundCorner.cx, roundCorner.cy); + else ctx.arc(roundCorner.cx, roundCorner.cy, roundCorner.radius, roundCorner.startAngle, roundCorner.endAngle, roundCorner.counterClockwise); + } + function getRoundCorner(previousPoint, currentPoint, nextPoint, radiusMax) { + var isArcRadius = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; + if (radiusMax === 0 || currentPoint.radius === 0) return { + cx: currentPoint.x, + cy: currentPoint.y, + radius: 0, + startX: currentPoint.x, + startY: currentPoint.y, + stopX: currentPoint.x, + stopY: currentPoint.y, + startAngle: void 0, + endAngle: void 0, + counterClockwise: void 0 + }; + calcCornerArc(previousPoint, currentPoint, nextPoint, radiusMax, isArcRadius); + return { + cx: x3, + cy: y3, + radius: cRadius, + startX, + startY, + stopX, + stopY, + startAngle: v1.ang + Math.PI / 2 * radDirection, + endAngle: v2.ang - Math.PI / 2 * radDirection, + counterClockwise: drawDirection + }; + } + function getPts(pts2) { + var retPts = []; + if (pts2 == null) { + return; + } + for (var i2 = 0; i2 < pts2.length; i2 += 2) { + var x5 = pts2[i2]; + var y5 = pts2[i2 + 1]; + retPts.push({ + x: x5, + y: y5 + }); + } + return retPts; + } + function pushBezierPts(r2, edge, pts2) { + var qbezierAt$1 = /* @__PURE__ */ __name(function qbezierAt$12(p1, p22, p32, t4) { + return qbezierAt(p1, p22, p32, t4); + }, "qbezierAt$1"); + var _p = edge._private; + var bpts = _p.rstyle.bezierPts; + for (var i2 = 0; i2 < r2.bezierProjPcts.length; i2++) { + var p3 = r2.bezierProjPcts[i2]; + bpts.push({ + x: qbezierAt$1(pts2[0], pts2[2], pts2[4], p3), + y: qbezierAt$1(pts2[1], pts2[3], pts2[5], p3) + }); + } + } + function polygon(context, points) { + for (var i2 = 0; i2 < points.length; i2++) { + var pt = points[i2]; + context.lineTo(pt.x, pt.y); + } + } + function triangleBackcurve(context, points, controlPoint) { + var firstPt; + for (var i2 = 0; i2 < points.length; i2++) { + var pt = points[i2]; + if (i2 === 0) { + firstPt = pt; + } + context.lineTo(pt.x, pt.y); + } + context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y); + } + function triangleTee(context, trianglePoints, teePoints) { + if (context.beginPath) { + context.beginPath(); + } + var triPts = trianglePoints; + for (var i2 = 0; i2 < triPts.length; i2++) { + var pt = triPts[i2]; + context.lineTo(pt.x, pt.y); + } + var teePts = teePoints; + var firstTeePt = teePoints[0]; + context.moveTo(firstTeePt.x, firstTeePt.y); + for (var i2 = 1; i2 < teePts.length; i2++) { + var pt = teePts[i2]; + context.lineTo(pt.x, pt.y); + } + if (context.closePath) { + context.closePath(); + } + } + function circleTriangle(context, trianglePoints, rx, ry, r2) { + if (context.beginPath) { + context.beginPath(); + } + context.arc(rx, ry, r2, 0, Math.PI * 2, false); + var triPts = trianglePoints; + var firstTrPt = triPts[0]; + context.moveTo(firstTrPt.x, firstTrPt.y); + for (var i2 = 0; i2 < triPts.length; i2++) { + var pt = triPts[i2]; + context.lineTo(pt.x, pt.y); + } + if (context.closePath) { + context.closePath(); + } + } + function circle5(context, rx, ry, r2) { + context.arc(rx, ry, r2, 0, Math.PI * 2, false); + } + function roundRect(ctx, x5, y5, width3, height2) { + var radius2 = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5; + var stroke = arguments.length > 6 ? arguments[6] : void 0; + ctx.beginPath(); + ctx.moveTo(x5 + radius2, y5); + ctx.lineTo(x5 + width3 - radius2, y5); + ctx.quadraticCurveTo(x5 + width3, y5, x5 + width3, y5 + radius2); + ctx.lineTo(x5 + width3, y5 + height2 - radius2); + ctx.quadraticCurveTo(x5 + width3, y5 + height2, x5 + width3 - radius2, y5 + height2); + ctx.lineTo(x5 + radius2, y5 + height2); + ctx.quadraticCurveTo(x5, y5 + height2, x5, y5 + height2 - radius2); + ctx.lineTo(x5, y5 + radius2); + ctx.quadraticCurveTo(x5, y5, x5 + radius2, y5); + ctx.closePath(); + if (stroke) ctx.stroke(); + else ctx.fill(); + } + function b64ToBlob(b64, mimeType) { + var bytes = atob(b64); + var buff = new ArrayBuffer(bytes.length); + var buffUint8 = new Uint8Array(buff); + for (var i2 = 0; i2 < bytes.length; i2++) { + buffUint8[i2] = bytes.charCodeAt(i2); + } + return new Blob([buff], { + type: mimeType + }); + } + function b64UriToB64(b64uri) { + var i2 = b64uri.indexOf(","); + return b64uri.substr(i2 + 1); + } + function output(options3, canvas, mimeType) { + var getB64Uri = /* @__PURE__ */ __name(function getB64Uri2() { + return canvas.toDataURL(mimeType, options3.quality); + }, "getB64Uri"); + switch (options3.output) { + case "blob-promise": + return new Promise$1(function(resolve3, reject3) { + try { + canvas.toBlob(function(blob) { + if (blob != null) { + resolve3(blob); + } else { + reject3(new Error("`canvas.toBlob()` sent a null value in its callback")); } + }, mimeType, options3.quality); + } catch (err) { + reject3(err); + } + }); + case "blob": + return b64ToBlob(b64UriToB64(getB64Uri()), mimeType); + case "base64": + return b64UriToB64(getB64Uri()); + case "base64uri": + default: + return getB64Uri(); + } + } + function CanvasRenderer(options3) { + var r2 = this; + var containerWindow = r2.cy.window(); + var document2 = containerWindow.document; + r2.data = { + canvases: new Array(CRp.CANVAS_LAYERS), + contexts: new Array(CRp.CANVAS_LAYERS), + canvasNeedsRedraw: new Array(CRp.CANVAS_LAYERS), + bufferCanvases: new Array(CRp.BUFFER_COUNT), + bufferContexts: new Array(CRp.CANVAS_LAYERS) + }; + var tapHlOffAttr = "-webkit-tap-highlight-color"; + var tapHlOffStyle = "rgba(0,0,0,0)"; + r2.data.canvasContainer = document2.createElement("div"); + var containerStyle = r2.data.canvasContainer.style; + r2.data.canvasContainer.style[tapHlOffAttr] = tapHlOffStyle; + containerStyle.position = "relative"; + containerStyle.zIndex = "0"; + containerStyle.overflow = "hidden"; + var container2 = options3.cy.container(); + container2.appendChild(r2.data.canvasContainer); + container2.style[tapHlOffAttr] = tapHlOffStyle; + var styleMap2 = { + "-webkit-user-select": "none", + "-moz-user-select": "-moz-none", + "user-select": "none", + "-webkit-tap-highlight-color": "rgba(0,0,0,0)", + "outline-style": "none" + }; + if (ms()) { + styleMap2["-ms-touch-action"] = "none"; + styleMap2["touch-action"] = "none"; + } + for (var i2 = 0; i2 < CRp.CANVAS_LAYERS; i2++) { + var canvas = r2.data.canvases[i2] = document2.createElement("canvas"); + r2.data.contexts[i2] = canvas.getContext("2d"); + Object.keys(styleMap2).forEach(function(k2) { + canvas.style[k2] = styleMap2[k2]; + }); + canvas.style.position = "absolute"; + canvas.setAttribute("data-id", "layer" + i2); + canvas.style.zIndex = String(CRp.CANVAS_LAYERS - i2); + r2.data.canvasContainer.appendChild(canvas); + r2.data.canvasNeedsRedraw[i2] = false; + } + r2.data.topCanvas = r2.data.canvases[0]; + r2.data.canvases[CRp.NODE].setAttribute("data-id", "layer" + CRp.NODE + "-node"); + r2.data.canvases[CRp.SELECT_BOX].setAttribute("data-id", "layer" + CRp.SELECT_BOX + "-selectbox"); + r2.data.canvases[CRp.DRAG].setAttribute("data-id", "layer" + CRp.DRAG + "-drag"); + for (var i2 = 0; i2 < CRp.BUFFER_COUNT; i2++) { + r2.data.bufferCanvases[i2] = document2.createElement("canvas"); + r2.data.bufferContexts[i2] = r2.data.bufferCanvases[i2].getContext("2d"); + r2.data.bufferCanvases[i2].style.position = "absolute"; + r2.data.bufferCanvases[i2].setAttribute("data-id", "buffer" + i2); + r2.data.bufferCanvases[i2].style.zIndex = String(-i2 - 1); + r2.data.bufferCanvases[i2].style.visibility = "hidden"; + } + r2.pathsEnabled = true; + var emptyBb = makeBoundingBox(); + var getBoxCenter = /* @__PURE__ */ __name(function getBoxCenter2(bb) { + return { + x: (bb.x1 + bb.x2) / 2, + y: (bb.y1 + bb.y2) / 2 + }; + }, "getBoxCenter"); + var getCenterOffset = /* @__PURE__ */ __name(function getCenterOffset2(bb) { + return { + x: -bb.w / 2, + y: -bb.h / 2 + }; + }, "getCenterOffset"); + var backgroundTimestampHasChanged = /* @__PURE__ */ __name(function backgroundTimestampHasChanged2(ele) { + var _p = ele[0]._private; + var same2 = _p.oldBackgroundTimestamp === _p.backgroundTimestamp; + return !same2; + }, "backgroundTimestampHasChanged"); + var getStyleKey = /* @__PURE__ */ __name(function getStyleKey2(ele) { + return ele[0]._private.nodeKey; + }, "getStyleKey"); + var getLabelKey = /* @__PURE__ */ __name(function getLabelKey2(ele) { + return ele[0]._private.labelStyleKey; + }, "getLabelKey"); + var getSourceLabelKey = /* @__PURE__ */ __name(function getSourceLabelKey2(ele) { + return ele[0]._private.sourceLabelStyleKey; + }, "getSourceLabelKey"); + var getTargetLabelKey = /* @__PURE__ */ __name(function getTargetLabelKey2(ele) { + return ele[0]._private.targetLabelStyleKey; + }, "getTargetLabelKey"); + var drawElement = /* @__PURE__ */ __name(function drawElement2(context, ele, bb, scaledLabelShown, useEleOpacity) { + return r2.drawElement(context, ele, bb, false, false, useEleOpacity); + }, "drawElement"); + var drawLabel4 = /* @__PURE__ */ __name(function drawLabel5(context, ele, bb, scaledLabelShown, useEleOpacity) { + return r2.drawElementText(context, ele, bb, scaledLabelShown, "main", useEleOpacity); + }, "drawLabel"); + var drawSourceLabel = /* @__PURE__ */ __name(function drawSourceLabel2(context, ele, bb, scaledLabelShown, useEleOpacity) { + return r2.drawElementText(context, ele, bb, scaledLabelShown, "source", useEleOpacity); + }, "drawSourceLabel"); + var drawTargetLabel = /* @__PURE__ */ __name(function drawTargetLabel2(context, ele, bb, scaledLabelShown, useEleOpacity) { + return r2.drawElementText(context, ele, bb, scaledLabelShown, "target", useEleOpacity); + }, "drawTargetLabel"); + var getElementBox = /* @__PURE__ */ __name(function getElementBox2(ele) { + ele.boundingBox(); + return ele[0]._private.bodyBounds; + }, "getElementBox"); + var getLabelBox = /* @__PURE__ */ __name(function getLabelBox2(ele) { + ele.boundingBox(); + return ele[0]._private.labelBounds.main || emptyBb; + }, "getLabelBox"); + var getSourceLabelBox = /* @__PURE__ */ __name(function getSourceLabelBox2(ele) { + ele.boundingBox(); + return ele[0]._private.labelBounds.source || emptyBb; + }, "getSourceLabelBox"); + var getTargetLabelBox = /* @__PURE__ */ __name(function getTargetLabelBox2(ele) { + ele.boundingBox(); + return ele[0]._private.labelBounds.target || emptyBb; + }, "getTargetLabelBox"); + var isLabelVisibleAtScale = /* @__PURE__ */ __name(function isLabelVisibleAtScale2(ele, scaledLabelShown) { + return scaledLabelShown; + }, "isLabelVisibleAtScale"); + var getElementRotationPoint = /* @__PURE__ */ __name(function getElementRotationPoint2(ele) { + return getBoxCenter(getElementBox(ele)); + }, "getElementRotationPoint"); + var addTextMargin = /* @__PURE__ */ __name(function addTextMargin2(prefix, pt, ele) { + var pre = prefix ? prefix + "-" : ""; + return { + x: pt.x + ele.pstyle(pre + "text-margin-x").pfValue, + y: pt.y + ele.pstyle(pre + "text-margin-y").pfValue + }; + }, "addTextMargin"); + var getRsPt = /* @__PURE__ */ __name(function getRsPt2(ele, x5, y5) { + var rs = ele[0]._private.rscratch; + return { + x: rs[x5], + y: rs[y5] + }; + }, "getRsPt"); + var getLabelRotationPoint = /* @__PURE__ */ __name(function getLabelRotationPoint2(ele) { + return addTextMargin("", getRsPt(ele, "labelX", "labelY"), ele); + }, "getLabelRotationPoint"); + var getSourceLabelRotationPoint = /* @__PURE__ */ __name(function getSourceLabelRotationPoint2(ele) { + return addTextMargin("source", getRsPt(ele, "sourceLabelX", "sourceLabelY"), ele); + }, "getSourceLabelRotationPoint"); + var getTargetLabelRotationPoint = /* @__PURE__ */ __name(function getTargetLabelRotationPoint2(ele) { + return addTextMargin("target", getRsPt(ele, "targetLabelX", "targetLabelY"), ele); + }, "getTargetLabelRotationPoint"); + var getElementRotationOffset = /* @__PURE__ */ __name(function getElementRotationOffset2(ele) { + return getCenterOffset(getElementBox(ele)); + }, "getElementRotationOffset"); + var getSourceLabelRotationOffset = /* @__PURE__ */ __name(function getSourceLabelRotationOffset2(ele) { + return getCenterOffset(getSourceLabelBox(ele)); + }, "getSourceLabelRotationOffset"); + var getTargetLabelRotationOffset = /* @__PURE__ */ __name(function getTargetLabelRotationOffset2(ele) { + return getCenterOffset(getTargetLabelBox(ele)); + }, "getTargetLabelRotationOffset"); + var getLabelRotationOffset = /* @__PURE__ */ __name(function getLabelRotationOffset2(ele) { + var bb = getLabelBox(ele); + var p3 = getCenterOffset(getLabelBox(ele)); + if (ele.isNode()) { + switch (ele.pstyle("text-halign").value) { + case "left": + p3.x = -bb.w; + break; + case "right": + p3.x = 0; + break; + } + switch (ele.pstyle("text-valign").value) { + case "top": + p3.y = -bb.h; + break; + case "bottom": + p3.y = 0; + break; + } + } + return p3; + }, "getLabelRotationOffset"); + var eleTxrCache = r2.data.eleTxrCache = new ElementTextureCache(r2, { + getKey: getStyleKey, + doesEleInvalidateKey: backgroundTimestampHasChanged, + drawElement, + getBoundingBox: getElementBox, + getRotationPoint: getElementRotationPoint, + getRotationOffset: getElementRotationOffset, + allowEdgeTxrCaching: false, + allowParentTxrCaching: false + }); + var lblTxrCache = r2.data.lblTxrCache = new ElementTextureCache(r2, { + getKey: getLabelKey, + drawElement: drawLabel4, + getBoundingBox: getLabelBox, + getRotationPoint: getLabelRotationPoint, + getRotationOffset: getLabelRotationOffset, + isVisible: isLabelVisibleAtScale + }); + var slbTxrCache = r2.data.slbTxrCache = new ElementTextureCache(r2, { + getKey: getSourceLabelKey, + drawElement: drawSourceLabel, + getBoundingBox: getSourceLabelBox, + getRotationPoint: getSourceLabelRotationPoint, + getRotationOffset: getSourceLabelRotationOffset, + isVisible: isLabelVisibleAtScale + }); + var tlbTxrCache = r2.data.tlbTxrCache = new ElementTextureCache(r2, { + getKey: getTargetLabelKey, + drawElement: drawTargetLabel, + getBoundingBox: getTargetLabelBox, + getRotationPoint: getTargetLabelRotationPoint, + getRotationOffset: getTargetLabelRotationOffset, + isVisible: isLabelVisibleAtScale + }); + var lyrTxrCache = r2.data.lyrTxrCache = new LayeredTextureCache(r2); + r2.onUpdateEleCalcs(/* @__PURE__ */ __name(function invalidateTextureCaches(willDraw, eles) { + eleTxrCache.invalidateElements(eles); + lblTxrCache.invalidateElements(eles); + slbTxrCache.invalidateElements(eles); + tlbTxrCache.invalidateElements(eles); + lyrTxrCache.invalidateElements(eles); + for (var _i = 0; _i < eles.length; _i++) { + var _p = eles[_i]._private; + _p.oldBackgroundTimestamp = _p.backgroundTimestamp; + } + }, "invalidateTextureCaches")); + var refineInLayers = /* @__PURE__ */ __name(function refineInLayers2(reqs) { + for (var i3 = 0; i3 < reqs.length; i3++) { + lyrTxrCache.enqueueElementRefinement(reqs[i3].ele); + } + }, "refineInLayers"); + eleTxrCache.onDequeue(refineInLayers); + lblTxrCache.onDequeue(refineInLayers); + slbTxrCache.onDequeue(refineInLayers); + tlbTxrCache.onDequeue(refineInLayers); + } + function setExtension(type3, name, registrant) { + var ext = registrant; + var overrideErr = /* @__PURE__ */ __name(function overrideErr2(field) { + warn("Can not register `" + name + "` for `" + type3 + "` since `" + field + "` already exists in the prototype and can not be overridden"); + }, "overrideErr"); + if (type3 === "core") { + if (Core.prototype[name]) { + return overrideErr(name); + } else { + Core.prototype[name] = registrant; + } + } else if (type3 === "collection") { + if (Collection.prototype[name]) { + return overrideErr(name); + } else { + Collection.prototype[name] = registrant; + } + } else if (type3 === "layout") { + var Layout2 = /* @__PURE__ */ __name(function Layout3(options3) { + this.options = options3; + registrant.call(this, options3); + if (!plainObject(this._private)) { + this._private = {}; + } + this._private.cy = options3.cy; + this._private.listeners = []; + this.createEmitter(); + }, "Layout"); + var layoutProto = Layout2.prototype = Object.create(registrant.prototype); + var optLayoutFns = []; + for (var i2 = 0; i2 < optLayoutFns.length; i2++) { + var fnName = optLayoutFns[i2]; + layoutProto[fnName] = layoutProto[fnName] || function() { + return this; + }; + } + if (layoutProto.start && !layoutProto.run) { + layoutProto.run = function() { + this.start(); + return this; + }; + } else if (!layoutProto.start && layoutProto.run) { + layoutProto.start = function() { + this.run(); + return this; + }; + } + var regStop = registrant.prototype.stop; + layoutProto.stop = function() { + var opts = this.options; + if (opts && opts.animate) { + var anis = this.animations; + if (anis) { + for (var _i = 0; _i < anis.length; _i++) { + anis[_i].stop(); } - function Qwb(a) { - if (!a.d) { - a.d = a.b.Kc(); - a.c = a.b.gc(); - } - } - function lyb(a, b) { - if (a < 0 || a >= b) { - throw Adb(new web()); - } - } - function JDb(a, b) { - return MDb(a, (uFb(b), new JAb(b))); - } - function KDb(a, b) { - return MDb(a, (uFb(b), new LAb(b))); - } - function prc(a, b, c2) { - return qrc(a, RD(b, 12), RD(c2, 12)); - } - function q4b(a) { - return J3b(), RD(a, 12).g.c.length != 0; - } - function v4b(a) { - return J3b(), RD(a, 12).e.c.length != 0; - } - function sdc(a, b) { - Zcc(); - return Qfb(b.a.o.a, a.a.o.a); - } - function d_d(a, b) { - (b.Bb & QHe) != 0 && !a.a.o && (a.a.o = b); - } - function T3c(a, b) { - b.Ug("General 'Rotator", 1); - S3c(a); - } - function MCc(a, b, c2) { - b.qf(c2, Kfb(UD(Wjb(a.b, c2))) * a.a); - } - function yid(a, b, c2) { - tid(); - return xid(a, b) && xid(a, c2); - } - function Rod(a) { - Pod(); - return !a.Hc(Lod) && !a.Hc(Nod); - } - function Nrc(a) { - if (a.e) { - return Src(a.e); - } - return null; - } - function Zdb(a) { - if (Kdb(a)) { - return "" + a; - } - return GD(a); - } - function XNc(a) { - var b; - b = a; - while (b.f) { - b = b.f; - } - return b; - } - function HBb(a, b, c2) { - bD(b, 0, tCb(b[0], c2[0])); - return b; - } - function Gpc(a, b, c2, d) { - var e; - e = a.i; - e.i = b; - e.a = c2; - e.b = d; - } - function C5d(a, b, c2, d) { - XZd.call(this, a, b, c2); - this.b = d; - } - function N3d(a, b, c2, d, e) { - O3d.call(this, a, b, c2, d, e, -1); - } - function b4d(a, b, c2, d, e) { - c4d.call(this, a, b, c2, d, e, -1); - } - function Iie(a, b, c2, d) { - PZd.call(this, a, b, c2); - this.b = d; - } - function Xde(a) { - uId.call(this, a, false); - this.a = false; - } - function Bqd() { - vqd.call(this, "LOOKAHEAD_LAYOUT", 1); - } - function nNd(a) { - this.b = a; - mMd.call(this, a); - mNd(this); - } - function vNd(a) { - this.b = a; - BMd.call(this, a); - uNd(this); - } - function J5d(a, b, c2) { - this.a = a; - G5d.call(this, b, c2, 5, 6); - } - function wje(a, b, c2, d) { - this.b = a; - XZd.call(this, b, c2, d); - } - function Tj(a, b) { - this.b = a; - Aj.call(this, a.b); - this.a = b; - } - function NLc(a) { - this.a = LLc(a.a); - this.b = new dnb(a.b); - } - function Fx(a, b) { - tm(); - Ex.call(this, a, Pm(new mob(b))); - } - function _se(a, b) { - Vse(); - return new aue(a, b, 0); + } + } + if (regStop) { + regStop.call(this); + } else { + this.emit("layoutstop"); + } + return this; + }; + if (!layoutProto.destroy) { + layoutProto.destroy = function() { + return this; + }; + } + layoutProto.cy = function() { + return this._private.cy; + }; + var getCy = /* @__PURE__ */ __name(function getCy2(layout6) { + return layout6._private.cy; + }, "getCy"); + var emitterOpts = { + addEventFields: /* @__PURE__ */ __name(function addEventFields4(layout6, evt) { + evt.layout = layout6; + evt.cy = getCy(layout6); + evt.target = layout6; + }, "addEventFields"), + bubble: /* @__PURE__ */ __name(function bubble3() { + return true; + }, "bubble"), + parent: /* @__PURE__ */ __name(function parent4(layout6) { + return getCy(layout6); + }, "parent") + }; + extend2(layoutProto, { + createEmitter: /* @__PURE__ */ __name(function createEmitter3() { + this._private.emitter = new Emitter2(emitterOpts, this); + return this; + }, "createEmitter"), + emitter: /* @__PURE__ */ __name(function emitter3() { + return this._private.emitter; + }, "emitter"), + on: /* @__PURE__ */ __name(function on3(evt, cb) { + this.emitter().on(evt, cb); + return this; + }, "on"), + one: /* @__PURE__ */ __name(function one4(evt, cb) { + this.emitter().one(evt, cb); + return this; + }, "one"), + once: /* @__PURE__ */ __name(function once3(evt, cb) { + this.emitter().one(evt, cb); + return this; + }, "once"), + removeListener: /* @__PURE__ */ __name(function removeListener3(evt, cb) { + this.emitter().removeListener(evt, cb); + return this; + }, "removeListener"), + removeAllListeners: /* @__PURE__ */ __name(function removeAllListeners3() { + this.emitter().removeAllListeners(); + return this; + }, "removeAllListeners"), + emit: /* @__PURE__ */ __name(function emit3(evt, params) { + this.emitter().emit(evt, params); + return this; + }, "emit") + }); + define2.eventAliasesOn(layoutProto); + ext = Layout2; + } else if (type3 === "renderer" && name !== "null" && name !== "base") { + var BaseRenderer3 = getExtension("renderer", "base"); + var bProto = BaseRenderer3.prototype; + var RegistrantRenderer = registrant; + var rProto = registrant.prototype; + var Renderer = /* @__PURE__ */ __name(function Renderer2() { + BaseRenderer3.apply(this, arguments); + RegistrantRenderer.apply(this, arguments); + }, "Renderer"); + var proto = Renderer.prototype; + for (var pName in bProto) { + var pVal = bProto[pName]; + var existsInR = rProto[pName] != null; + if (existsInR) { + return overrideErr(pName); + } + proto[pName] = pVal; + } + for (var _pName in rProto) { + proto[_pName] = rProto[_pName]; + } + bProto.clientFunctions.forEach(function(name2) { + proto[name2] = proto[name2] || function() { + error("Renderer does not implement `renderer." + name2 + "()` on its prototype"); + }; + }); + ext = Renderer; + } else if (type3 === "__proto__" || type3 === "constructor" || type3 === "prototype") { + return error(type3 + " is an illegal type to be registered, possibly lead to prototype pollutions"); + } + return setMap({ + map: extensions, + keys: [type3, name], + value: ext + }); + } + function getExtension(type3, name) { + return getMap({ + map: extensions, + keys: [type3, name] + }); + } + function setModule(type3, name, moduleType, moduleName, registrant) { + return setMap({ + map: modules, + keys: [type3, name, moduleType, moduleName], + value: registrant + }); + } + function getModule(type3, name, moduleType, moduleName) { + return getMap({ + map: modules, + keys: [type3, name, moduleType, moduleName] + }); + } + var _window, navigator2, typeofstr, typeofobj, typeoffn, typeofhtmlele, instanceStr, string, fn$6, array2, plainObject, object, number$1, integer2, htmlElement, elementOrCollection, element, collection, core, stylesheet, event, emptyString, domElement, boundingBox, promise, ms, memoize$1, camel2dash, dash2camel, prependCamel, capitalize, number6, rgba3, rgbaNoBackRefs, hsla2, hslaNoBackRefs, hex3, hex6, ascending3, descending2, extend2, hex2tuple, hsl2tuple, rgb2tuple, colorname2tuple, color2tuple, colors, setMap, getMap, isObject_1, commonjsGlobal, freeGlobal2, _freeGlobal, freeSelf2, root3, _root, now3, now_1, reWhitespace2, _trimmedEndIndex, reTrimStart2, _baseTrim, Symbol$1, _Symbol, objectProto$5, hasOwnProperty$4, nativeObjectToString$1, symToStringTag$1, _getRawTag, objectProto$4, nativeObjectToString3, _objectToString, nullTag2, undefinedTag2, symToStringTag3, _baseGetTag, isObjectLike_1, symbolTag5, isSymbol_1, NAN2, reIsBadHex2, reIsBinary2, reIsOctal2, freeParseInt2, toNumber_1, FUNC_ERROR_TEXT$1, nativeMax6, nativeMin, debounce_1, performance2, pnow, raf, requestAnimationFrame2, performanceNow, DEFAULT_HASH_SEED, K3, DEFAULT_HASH_SEED_ALT, hashIterableInts, hashInt, hashIntAlt, combineHashes, combineHashesArray, hashArrays, hashIntsArray, hashString, hashStrings, hashStringsArray, warningsEnabled, warnSupported, traceSupported, MAX_INT$1, trueify, falsify, zeroify, noop$1, error, warnings, warn, clone3, copy4, copyArray$1, uuid, _staticEmptyObject, staticEmptyObject, defaults$g, removeFromArray, clearArray, push, getPrefixedProperty, setPrefixedProperty, ObjectMap, Map$2, undef, ObjectSet, Set$1, Element, defineSearch, elesfn$v, heap$1, heap, dijkstraDefaults, elesfn$u, elesfn$t, aStarDefaults, elesfn$s, floydWarshallDefaults, elesfn$r, bellmanFordDefaults, elesfn$q, sqrt2, collapse, contractUntil, elesfn$p, copyPosition, modelToRenderedPosition, renderedToModelPosition, array2point, min5, max5, mean, median, deg2rad, getAngleFromDisp, log22, signum, dist, sqdist, inPlaceSumNormalize, qbezierAt, qbezierPtAt, lineAt, bound, makeBoundingBox, copyBoundingBox, clearBoundingBox, shiftBoundingBox, updateBoundingBox, expandBoundingBoxByPoint, expandBoundingBox, expandBoundingBoxSides, assignBoundingBox, boundingBoxesIntersect, inBoundingBox, pointInBoundingBox, boundingBoxInBoundingBox, roundRectangleIntersectLine, inLineVicinity, inBezierVicinity, solveQuadratic, solveCubic, sqdistToQuadraticBezier, sqdistToFiniteLine, pointInsidePolygonPoints, pointInsidePolygon, pointInsideRoundPolygon, joinLines, expandPolygon, intersectLineEllipse, checkInEllipse, intersectLineCircle, midOfThree, finiteLinesIntersect, polygonIntersectLine, roundPolygonIntersectLine, shortenIntersection, generateUnitNgonPointsFitToSquare, fitPolygonToSquare, generateUnitNgonPoints, getRoundRectangleRadius, getRoundPolygonRadius, getCutRectangleCornerLength, bezierPtsToQuadCoeff, getBarrelCurveConstants, pageRankDefaults, elesfn$o, defaults$f, elesfn$n, defaults$e, elesfn$m, defaults$d, elesfn$l, defaults$c, setOptions$3, getSimilarity$1, addLoops, normalize2, mmult, expand, inflate, hasConverged, assign$2, isDuplicate, removeDuplicates, markovClustering, markovClustering$1, identity5, absDiff, addAbsDiff, addSquaredDiff, sqrt3, maxAbsDiff, getDistance, distances, defaults$b, setOptions$2, getDist, randomCentroids, classify, buildCluster, haveValuesConverged, haveMatricesConverged, seenBefore, randomMedoids, findCost, kMeans, kMedoids, updateCentroids, updateMembership, assign$1, fuzzyCMeans, kClustering, defaults$a, linkageAliases, setOptions$1, mergeClosest, getAllChildren, buildDendrogram, buildClustersFromTree, hierarchicalClustering, hierarchicalClustering$1, defaults$9, setOptions6, getSimilarity2, getPreference, findExemplars, assignClusters, assign4, affinityPropagation, affinityPropagation$1, hierholzerDefaults, elesfn$k, hopcroftTarjanBiconnected, hopcroftTarjanBiconnected$1, tarjanStronglyConnected, tarjanStronglyConnected$1, elesfn$j, STATE_PENDING, STATE_FULFILLED, STATE_REJECTED, api, deliver, execute, execute_handlers, resolver, resolve, Promise$1, Animation, anifn, define$3, isArray2, isArray_1, reIsDeepProp2, reIsPlainProp2, _isKey, asyncTag2, funcTag4, genTag3, proxyTag2, isFunction_1, coreJsData2, _coreJsData, maskSrcKey2, _isMasked, funcProto$1, funcToString$1, _toSource, reRegExpChar2, reIsHostCtor2, funcProto4, objectProto$3, funcToString4, hasOwnProperty$3, reIsNative2, _baseIsNative, _getValue, _getNative, nativeCreate2, _nativeCreate, _hashClear, _hashDelete, HASH_UNDEFINED$1, objectProto$2, hasOwnProperty$2, _hashGet, objectProto$1, hasOwnProperty$1, _hashHas, HASH_UNDEFINED4, _hashSet, _Hash, _listCacheClear, eq_1, _assocIndexOf, arrayProto2, splice2, _listCacheDelete, _listCacheGet, _listCacheHas, _listCacheSet, _ListCache, Map$1, _Map, _mapCacheClear, _isKeyable, _getMapData, _mapCacheDelete, _mapCacheGet, _mapCacheHas, _mapCacheSet, _MapCache, FUNC_ERROR_TEXT3, memoize_1, MAX_MEMOIZE_SIZE2, _memoizeCapped, rePropName2, reEscapeChar2, stringToPath2, _stringToPath, _arrayMap, INFINITY$1, symbolProto4, symbolToString2, _baseToString, toString_1, _castPath, INFINITY5, _toKey, _baseGet, get_1, defineProperty2, _defineProperty, _baseAssignValue, objectProto22, hasOwnProperty19, _assignValue, MAX_SAFE_INTEGER3, reIsUint2, _isIndex, _baseSet, set_1, _copyArray, toPath_1, define$2, define$1, define2, elesfn$i, elesfn$h, tokens, newQuery, Type3, stateSelectors, lookup, stateSelectorMatches, stateSelectorRegex, cleanMetaChars, replaceLastQuery, exprs, consumeExpr, consumeWhitespace, parse3, toString3, parse$1, valCmp, boolCmp, existCmp, data$1, meta, match, matches$1, filter3, matches31, matching, Selector, selfn, elesfn$g, cache, elesfn$f, fn$5, elesfn$e, data3, elesfn$d, fn$4, elesfn$c, beforePositionSet, positionDef, position2, fn$3, elesfn$b, noninf, updateBounds, updateBoundsFromBox, prefixedProperty, updateBoundsFromArrow, updateBoundsFromLabel, updateBoundsFromOutline, boundingBoxImpl, getKey, getBoundingBoxPosKey, cachedBoundingBoxImpl, defBbOpts, defBbOptsKey, filledBbOpts, bounds3, fn$2, elesfn$a, defineDimFns, widthHeight, ifEdge, ifEdgeRenderedPosition, ifEdgeRenderedPositions, controlPoints2, segmentPoints, sourceEndpoint, targetEndpoint, midpoint, pts, renderedName, edgePoints, dimensions, Event, eventRegex, universalNamespace, defaults$8, defaultsKeys, emptyOpts, p2, forEachEvent, makeEventObj, forEachEventObj, emitterOptions$1, argSelector$1, elesfn$9, elesfn$8, fn$1, elesfn$7, zIndexSort, elesfn$6, defineSymbolIterator, getLayoutDimensionOptions, elesfn$5, elesfn$4, eleTakesUpSpace, eleInteractive, parentInteractive, eleVisible, edgeVisibleViaNode, elesfn$3, elesfn$2, defineDagExtremity, defineDagOneHop, defineDagAllHops, Collection, elesfn$1, corefn$9, generateSpringRK4, cubicBezier, easings, corefn$8, emitterOptions, argSelector2, elesfn, corefn$7, corefn$6, corefn$5, rendererDefaults, corefn$4, corefn$3, styfn$8, TRUE, FALSE, styfn$7, styfn$6, styfn$5, styfn$4, styfn$3, styfn$2, styfn$1, Style2, styfn, corefn$2, defaultSelectionType, corefn$1, fn2, Core, corefn, defaults$7, deprecatedOptionDefaults, getInfo, setInfo, defaults$6, defaults$5, DEBUG, defaults$4, createLayoutInfo, findLCA, findLCA_aux, printLayoutInfo, randomizePositions, getScaleInBoundsFn, refreshPositions, step, calculateNodeForces, randomDistance, nodeRepulsion2, nodesOverlap, findClippingPoint, calculateEdgeForces, calculateGravityForces, propagateForces, updatePositions, limitForce, updateAncestryBoundaries, separateComponents, defaults$3, defaults$2, defaults$1, defaults3, layout4, noop4, throwImgErr, BRp$f, BRp$e, BRp$d, x3, y3, v1, v2, sinA, sinA90, radDirection, drawDirection, angle, halfAngle, cRadius, lenOut, radius, limit, startX, startY, stopX, stopY, lastPoint, asVec, invertVec, calcCornerArc, BRp$c, BRp$b, BRp$a, BRp$9, lineAngleFromDelta, lineAngle, bezierAngle, BRp$8, TOO_SMALL_CUT_RECT, warnedCutRect, BRp$7, BRp$6, BRp$5, BRp$4, BRp$3, BRp$2, BRp$1, beforeRenderCallbacks, BaseRenderer, BR, BRp, fullFpsTime, defs, ElementTextureCacheLookup, minTxrH, txrStepH, minLvl$1, maxLvl$1, maxZoom$1, eleTxrSpacing, defTxrWidth, maxTxrW, maxTxrH, minUtility, maxFullness, maxFullnessChecks, deqCost$1, deqAvgCost$1, deqNoDrawCost$1, deqFastCost$1, deqRedrawThreshold$1, maxDeqSize$1, getTxrReasons, initDefaults, ElementTextureCache, ETCp, defNumLayers, minLvl, maxLvl, maxZoom2, deqRedrawThreshold, refineEleDebounceTime, deqCost, deqAvgCost, deqNoDrawCost, deqFastCost, maxDeqSize, invalidThreshold, maxLayerArea, useHighQualityEleTxrReqs, LayeredTextureCache, LTCp, layerIdPool, MAX_INT, CRp$a, impl, CRp$9, getZeroRotation, getLabelRotation, getSourceLabelRotation, getTargetLabelRotation, getOpacity, getTextOpacity, CRp$8, drawEdgeOverlayUnderlay, CRp$7, CRp$6, CRp$5, drawNodeOverlayUnderlay, CRp$4, motionBlurDelay, CRp$3, sin0, cos0, sin2, cos2, ellipseStepSize, i2, CRp$2, CRp$1, CR, CRp, pathsImpld, renderer5, incExts, extensions, modules, extension3, Stylesheet, sheetfn, version3, cytoscape2; + var init_cytoscape_esm = __esm({ + "../../node_modules/.pnpm/cytoscape@3.30.1/node_modules/cytoscape/dist/cytoscape.esm.mjs"() { + "use strict"; + __name(_typeof, "_typeof"); + __name(_classCallCheck, "_classCallCheck"); + __name(_defineProperties, "_defineProperties"); + __name(_createClass, "_createClass"); + __name(_defineProperty$1, "_defineProperty$1"); + __name(_slicedToArray, "_slicedToArray"); + __name(_arrayWithHoles, "_arrayWithHoles"); + __name(_iterableToArrayLimit, "_iterableToArrayLimit"); + __name(_unsupportedIterableToArray, "_unsupportedIterableToArray"); + __name(_arrayLikeToArray, "_arrayLikeToArray"); + __name(_nonIterableRest, "_nonIterableRest"); + __name(_createForOfIteratorHelper, "_createForOfIteratorHelper"); + _window = typeof window === "undefined" ? null : window; + navigator2 = _window ? _window.navigator : null; + _window ? _window.document : null; + typeofstr = _typeof(""); + typeofobj = _typeof({}); + typeoffn = _typeof(function() { + }); + typeofhtmlele = typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement); + instanceStr = /* @__PURE__ */ __name(function instanceStr2(obj) { + return obj && obj.instanceString && fn$6(obj.instanceString) ? obj.instanceString() : null; + }, "instanceStr"); + string = /* @__PURE__ */ __name(function string2(obj) { + return obj != null && _typeof(obj) == typeofstr; + }, "string"); + fn$6 = /* @__PURE__ */ __name(function fn(obj) { + return obj != null && _typeof(obj) === typeoffn; + }, "fn"); + array2 = /* @__PURE__ */ __name(function array3(obj) { + return !elementOrCollection(obj) && (Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array); + }, "array"); + plainObject = /* @__PURE__ */ __name(function plainObject2(obj) { + return obj != null && _typeof(obj) === typeofobj && !array2(obj) && obj.constructor === Object; + }, "plainObject"); + object = /* @__PURE__ */ __name(function object2(obj) { + return obj != null && _typeof(obj) === typeofobj; + }, "object"); + number$1 = /* @__PURE__ */ __name(function number5(obj) { + return obj != null && _typeof(obj) === _typeof(1) && !isNaN(obj); + }, "number"); + integer2 = /* @__PURE__ */ __name(function integer3(obj) { + return number$1(obj) && Math.floor(obj) === obj; + }, "integer"); + htmlElement = /* @__PURE__ */ __name(function htmlElement2(obj) { + if ("undefined" === typeofhtmlele) { + return void 0; + } else { + return null != obj && obj instanceof HTMLElement; + } + }, "htmlElement"); + elementOrCollection = /* @__PURE__ */ __name(function elementOrCollection2(obj) { + return element(obj) || collection(obj); + }, "elementOrCollection"); + element = /* @__PURE__ */ __name(function element2(obj) { + return instanceStr(obj) === "collection" && obj._private.single; + }, "element"); + collection = /* @__PURE__ */ __name(function collection2(obj) { + return instanceStr(obj) === "collection" && !obj._private.single; + }, "collection"); + core = /* @__PURE__ */ __name(function core2(obj) { + return instanceStr(obj) === "core"; + }, "core"); + stylesheet = /* @__PURE__ */ __name(function stylesheet2(obj) { + return instanceStr(obj) === "stylesheet"; + }, "stylesheet"); + event = /* @__PURE__ */ __name(function event2(obj) { + return instanceStr(obj) === "event"; + }, "event"); + emptyString = /* @__PURE__ */ __name(function emptyString2(obj) { + if (obj === void 0 || obj === null) { + return true; + } else if (obj === "" || obj.match(/^\s+$/)) { + return true; + } + return false; + }, "emptyString"); + domElement = /* @__PURE__ */ __name(function domElement2(obj) { + if (typeof HTMLElement === "undefined") { + return false; + } else { + return obj instanceof HTMLElement; + } + }, "domElement"); + boundingBox = /* @__PURE__ */ __name(function boundingBox2(obj) { + return plainObject(obj) && number$1(obj.x1) && number$1(obj.x2) && number$1(obj.y1) && number$1(obj.y2); + }, "boundingBox"); + promise = /* @__PURE__ */ __name(function promise2(obj) { + return object(obj) && fn$6(obj.then); + }, "promise"); + ms = /* @__PURE__ */ __name(function ms2() { + return navigator2 && navigator2.userAgent.match(/msie|trident|edge/i); + }, "ms"); + memoize$1 = /* @__PURE__ */ __name(function memoize2(fn3, keyFn) { + if (!keyFn) { + keyFn = /* @__PURE__ */ __name(function keyFn2() { + if (arguments.length === 1) { + return arguments[0]; + } else if (arguments.length === 0) { + return "undefined"; } - function bte(a, b) { - Vse(); - return new aue(6, a, b); + var args = []; + for (var i2 = 0; i2 < arguments.length; i2++) { + args.push(arguments[i2]); } - function Ztb(a, b) { - uFb(b); - while (a.Ob()) { - b.Cd(a.Pb()); - } + return args.join("$"); + }, "keyFn"); + } + var memoizedFn = /* @__PURE__ */ __name(function memoizedFn2() { + var self2 = this; + var args = arguments; + var ret; + var k2 = keyFn.apply(self2, args); + var cache3 = memoizedFn2.cache; + if (!(ret = cache3[k2])) { + ret = cache3[k2] = fn3.apply(self2, args); + } + return ret; + }, "memoizedFn"); + memoizedFn.cache = {}; + return memoizedFn; + }, "memoize"); + camel2dash = memoize$1(function(str2) { + return str2.replace(/([A-Z])/g, function(v3) { + return "-" + v3.toLowerCase(); + }); + }); + dash2camel = memoize$1(function(str2) { + return str2.replace(/(-\w)/g, function(v3) { + return v3[1].toUpperCase(); + }); + }); + prependCamel = memoize$1(function(prefix, str2) { + return prefix + str2[0].toUpperCase() + str2.substring(1); + }, function(prefix, str2) { + return prefix + "$" + str2; + }); + capitalize = /* @__PURE__ */ __name(function capitalize2(str2) { + if (emptyString(str2)) { + return str2; + } + return str2.charAt(0).toUpperCase() + str2.substring(1); + }, "capitalize"); + number6 = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))"; + rgba3 = "rgb[a]?\\((" + number6 + "[%]?)\\s*,\\s*(" + number6 + "[%]?)\\s*,\\s*(" + number6 + "[%]?)(?:\\s*,\\s*(" + number6 + "))?\\)"; + rgbaNoBackRefs = "rgb[a]?\\((?:" + number6 + "[%]?)\\s*,\\s*(?:" + number6 + "[%]?)\\s*,\\s*(?:" + number6 + "[%]?)(?:\\s*,\\s*(?:" + number6 + "))?\\)"; + hsla2 = "hsl[a]?\\((" + number6 + ")\\s*,\\s*(" + number6 + "[%])\\s*,\\s*(" + number6 + "[%])(?:\\s*,\\s*(" + number6 + "))?\\)"; + hslaNoBackRefs = "hsl[a]?\\((?:" + number6 + ")\\s*,\\s*(?:" + number6 + "[%])\\s*,\\s*(?:" + number6 + "[%])(?:\\s*,\\s*(?:" + number6 + "))?\\)"; + hex3 = "\\#[0-9a-fA-F]{3}"; + hex6 = "\\#[0-9a-fA-F]{6}"; + ascending3 = /* @__PURE__ */ __name(function ascending4(a2, b2) { + if (a2 < b2) { + return -1; + } else if (a2 > b2) { + return 1; + } else { + return 0; + } + }, "ascending"); + descending2 = /* @__PURE__ */ __name(function descending3(a2, b2) { + return -1 * ascending3(a2, b2); + }, "descending"); + extend2 = Object.assign != null ? Object.assign.bind(Object) : function(tgt) { + var args = arguments; + for (var i2 = 1; i2 < args.length; i2++) { + var obj = args[i2]; + if (obj == null) { + continue; + } + var keys3 = Object.keys(obj); + for (var j2 = 0; j2 < keys3.length; j2++) { + var k2 = keys3[j2]; + tgt[k2] = obj[k2]; + } + } + return tgt; + }; + hex2tuple = /* @__PURE__ */ __name(function hex2tuple2(hex2) { + if (!(hex2.length === 4 || hex2.length === 7) || hex2[0] !== "#") { + return; + } + var shortHex = hex2.length === 4; + var r2, g2, b2; + var base = 16; + if (shortHex) { + r2 = parseInt(hex2[1] + hex2[1], base); + g2 = parseInt(hex2[2] + hex2[2], base); + b2 = parseInt(hex2[3] + hex2[3], base); + } else { + r2 = parseInt(hex2[1] + hex2[2], base); + g2 = parseInt(hex2[3] + hex2[4], base); + b2 = parseInt(hex2[5] + hex2[6], base); + } + return [r2, g2, b2]; + }, "hex2tuple"); + hsl2tuple = /* @__PURE__ */ __name(function hsl2tuple2(hsl2) { + var ret; + var h2, s2, l2, a2, r2, g2, b2; + function hue2rgb(p4, q3, t4) { + if (t4 < 0) t4 += 1; + if (t4 > 1) t4 -= 1; + if (t4 < 1 / 6) return p4 + (q3 - p4) * 6 * t4; + if (t4 < 1 / 2) return q3; + if (t4 < 2 / 3) return p4 + (q3 - p4) * (2 / 3 - t4) * 6; + return p4; + } + __name(hue2rgb, "hue2rgb"); + var m2 = new RegExp("^" + hsla2 + "$").exec(hsl2); + if (m2) { + h2 = parseInt(m2[1]); + if (h2 < 0) { + h2 = (360 - -1 * h2 % 360) % 360; + } else if (h2 > 360) { + h2 = h2 % 360; + } + h2 /= 360; + s2 = parseFloat(m2[2]); + if (s2 < 0 || s2 > 100) { + return; + } + s2 = s2 / 100; + l2 = parseFloat(m2[3]); + if (l2 < 0 || l2 > 100) { + return; + } + l2 = l2 / 100; + a2 = m2[4]; + if (a2 !== void 0) { + a2 = parseFloat(a2); + if (a2 < 0 || a2 > 1) { + return; } - function Ujb(a, b) { - return bE(b) ? Yjb(a, b) : !!qtb(a.f, b); + } + if (s2 === 0) { + r2 = g2 = b2 = Math.round(l2 * 255); + } else { + var q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2; + var p3 = 2 * l2 - q2; + r2 = Math.round(255 * hue2rgb(p3, q2, h2 + 1 / 3)); + g2 = Math.round(255 * hue2rgb(p3, q2, h2)); + b2 = Math.round(255 * hue2rgb(p3, q2, h2 - 1 / 3)); + } + ret = [r2, g2, b2, a2]; + } + return ret; + }, "hsl2tuple"); + rgb2tuple = /* @__PURE__ */ __name(function rgb2tuple2(rgb2) { + var ret; + var m2 = new RegExp("^" + rgba3 + "$").exec(rgb2); + if (m2) { + ret = []; + var isPct = []; + for (var i2 = 1; i2 <= 3; i2++) { + var channel2 = m2[i2]; + if (channel2[channel2.length - 1] === "%") { + isPct[i2] = true; } - function O_d(a, b) { - return b.Vh() ? Vvd(a.b, RD(b, 54)) : b; + channel2 = parseFloat(channel2); + if (isPct[i2]) { + channel2 = channel2 / 100 * 255; } - function whb(a, b) { - return lhb(a.substr(0, b.length), b); + if (channel2 < 0 || channel2 > 255) { + return; } - function Fl(a) { - return new is(new Il(a.a.length, a.a)); + ret.push(Math.floor(channel2)); + } + var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; + var allArePct = isPct[1] && isPct[2] && isPct[3]; + if (atLeastOneIsPct && !allArePct) { + return; + } + var alpha = m2[4]; + if (alpha !== void 0) { + alpha = parseFloat(alpha); + if (alpha < 0 || alpha > 1) { + return; } - function Oid(a) { - return new rjd(a.c + a.b / 2, a.d + a.a / 2); + ret.push(alpha); + } + } + return ret; + }, "rgb2tuple"); + colorname2tuple = /* @__PURE__ */ __name(function colorname2tuple2(color2) { + return colors[color2.toLowerCase()]; + }, "colorname2tuple"); + color2tuple = /* @__PURE__ */ __name(function color2tuple2(color2) { + return (array2(color2) ? color2 : null) || colorname2tuple(color2) || hex2tuple(color2) || rgb2tuple(color2) || hsl2tuple(color2); + }, "color2tuple"); + colors = { + // special colour names + transparent: [0, 0, 0, 0], + // NB alpha === 0 + // regular colours + aliceblue: [240, 248, 255], + antiquewhite: [250, 235, 215], + aqua: [0, 255, 255], + aquamarine: [127, 255, 212], + azure: [240, 255, 255], + beige: [245, 245, 220], + bisque: [255, 228, 196], + black: [0, 0, 0], + blanchedalmond: [255, 235, 205], + blue: [0, 0, 255], + blueviolet: [138, 43, 226], + brown: [165, 42, 42], + burlywood: [222, 184, 135], + cadetblue: [95, 158, 160], + chartreuse: [127, 255, 0], + chocolate: [210, 105, 30], + coral: [255, 127, 80], + cornflowerblue: [100, 149, 237], + cornsilk: [255, 248, 220], + crimson: [220, 20, 60], + cyan: [0, 255, 255], + darkblue: [0, 0, 139], + darkcyan: [0, 139, 139], + darkgoldenrod: [184, 134, 11], + darkgray: [169, 169, 169], + darkgreen: [0, 100, 0], + darkgrey: [169, 169, 169], + darkkhaki: [189, 183, 107], + darkmagenta: [139, 0, 139], + darkolivegreen: [85, 107, 47], + darkorange: [255, 140, 0], + darkorchid: [153, 50, 204], + darkred: [139, 0, 0], + darksalmon: [233, 150, 122], + darkseagreen: [143, 188, 143], + darkslateblue: [72, 61, 139], + darkslategray: [47, 79, 79], + darkslategrey: [47, 79, 79], + darkturquoise: [0, 206, 209], + darkviolet: [148, 0, 211], + deeppink: [255, 20, 147], + deepskyblue: [0, 191, 255], + dimgray: [105, 105, 105], + dimgrey: [105, 105, 105], + dodgerblue: [30, 144, 255], + firebrick: [178, 34, 34], + floralwhite: [255, 250, 240], + forestgreen: [34, 139, 34], + fuchsia: [255, 0, 255], + gainsboro: [220, 220, 220], + ghostwhite: [248, 248, 255], + gold: [255, 215, 0], + goldenrod: [218, 165, 32], + gray: [128, 128, 128], + grey: [128, 128, 128], + green: [0, 128, 0], + greenyellow: [173, 255, 47], + honeydew: [240, 255, 240], + hotpink: [255, 105, 180], + indianred: [205, 92, 92], + indigo: [75, 0, 130], + ivory: [255, 255, 240], + khaki: [240, 230, 140], + lavender: [230, 230, 250], + lavenderblush: [255, 240, 245], + lawngreen: [124, 252, 0], + lemonchiffon: [255, 250, 205], + lightblue: [173, 216, 230], + lightcoral: [240, 128, 128], + lightcyan: [224, 255, 255], + lightgoldenrodyellow: [250, 250, 210], + lightgray: [211, 211, 211], + lightgreen: [144, 238, 144], + lightgrey: [211, 211, 211], + lightpink: [255, 182, 193], + lightsalmon: [255, 160, 122], + lightseagreen: [32, 178, 170], + lightskyblue: [135, 206, 250], + lightslategray: [119, 136, 153], + lightslategrey: [119, 136, 153], + lightsteelblue: [176, 196, 222], + lightyellow: [255, 255, 224], + lime: [0, 255, 0], + limegreen: [50, 205, 50], + linen: [250, 240, 230], + magenta: [255, 0, 255], + maroon: [128, 0, 0], + mediumaquamarine: [102, 205, 170], + mediumblue: [0, 0, 205], + mediumorchid: [186, 85, 211], + mediumpurple: [147, 112, 219], + mediumseagreen: [60, 179, 113], + mediumslateblue: [123, 104, 238], + mediumspringgreen: [0, 250, 154], + mediumturquoise: [72, 209, 204], + mediumvioletred: [199, 21, 133], + midnightblue: [25, 25, 112], + mintcream: [245, 255, 250], + mistyrose: [255, 228, 225], + moccasin: [255, 228, 181], + navajowhite: [255, 222, 173], + navy: [0, 0, 128], + oldlace: [253, 245, 230], + olive: [128, 128, 0], + olivedrab: [107, 142, 35], + orange: [255, 165, 0], + orangered: [255, 69, 0], + orchid: [218, 112, 214], + palegoldenrod: [238, 232, 170], + palegreen: [152, 251, 152], + paleturquoise: [175, 238, 238], + palevioletred: [219, 112, 147], + papayawhip: [255, 239, 213], + peachpuff: [255, 218, 185], + peru: [205, 133, 63], + pink: [255, 192, 203], + plum: [221, 160, 221], + powderblue: [176, 224, 230], + purple: [128, 0, 128], + red: [255, 0, 0], + rosybrown: [188, 143, 143], + royalblue: [65, 105, 225], + saddlebrown: [139, 69, 19], + salmon: [250, 128, 114], + sandybrown: [244, 164, 96], + seagreen: [46, 139, 87], + seashell: [255, 245, 238], + sienna: [160, 82, 45], + silver: [192, 192, 192], + skyblue: [135, 206, 235], + slateblue: [106, 90, 205], + slategray: [112, 128, 144], + slategrey: [112, 128, 144], + snow: [255, 250, 250], + springgreen: [0, 255, 127], + steelblue: [70, 130, 180], + tan: [210, 180, 140], + teal: [0, 128, 128], + thistle: [216, 191, 216], + tomato: [255, 99, 71], + turquoise: [64, 224, 208], + violet: [238, 130, 238], + wheat: [245, 222, 179], + white: [255, 255, 255], + whitesmoke: [245, 245, 245], + yellow: [255, 255, 0], + yellowgreen: [154, 205, 50] + }; + setMap = /* @__PURE__ */ __name(function setMap2(options3) { + var obj = options3.map; + var keys3 = options3.keys; + var l2 = keys3.length; + for (var i2 = 0; i2 < l2; i2++) { + var key = keys3[i2]; + if (plainObject(key)) { + throw Error("Tried to set map with object key"); + } + if (i2 < keys3.length - 1) { + if (obj[key] == null) { + obj[key] = {}; } - function yD(a) { - return hD(~a.l & dxe, ~a.m & dxe, ~a.h & exe); + obj = obj[key]; + } else { + obj[key] = options3.value; + } + } + }, "setMap"); + getMap = /* @__PURE__ */ __name(function getMap2(options3) { + var obj = options3.map; + var keys3 = options3.keys; + var l2 = keys3.length; + for (var i2 = 0; i2 < l2; i2++) { + var key = keys3[i2]; + if (plainObject(key)) { + throw Error("Tried to get map with object key"); + } + obj = obj[key]; + if (obj == null) { + return obj; + } + } + return obj; + }, "getMap"); + __name(isObject2, "isObject"); + isObject_1 = isObject2; + commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; + __name(createCommonjsModule, "createCommonjsModule"); + freeGlobal2 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + _freeGlobal = freeGlobal2; + freeSelf2 = typeof self == "object" && self && self.Object === Object && self; + root3 = _freeGlobal || freeSelf2 || Function("return this")(); + _root = root3; + now3 = /* @__PURE__ */ __name(function() { + return _root.Date.now(); + }, "now"); + now_1 = now3; + reWhitespace2 = /\s/; + __name(trimmedEndIndex2, "trimmedEndIndex"); + _trimmedEndIndex = trimmedEndIndex2; + reTrimStart2 = /^\s+/; + __name(baseTrim2, "baseTrim"); + _baseTrim = baseTrim2; + Symbol$1 = _root.Symbol; + _Symbol = Symbol$1; + objectProto$5 = Object.prototype; + hasOwnProperty$4 = objectProto$5.hasOwnProperty; + nativeObjectToString$1 = objectProto$5.toString; + symToStringTag$1 = _Symbol ? _Symbol.toStringTag : void 0; + __name(getRawTag2, "getRawTag"); + _getRawTag = getRawTag2; + objectProto$4 = Object.prototype; + nativeObjectToString3 = objectProto$4.toString; + __name(objectToString2, "objectToString"); + _objectToString = objectToString2; + nullTag2 = "[object Null]"; + undefinedTag2 = "[object Undefined]"; + symToStringTag3 = _Symbol ? _Symbol.toStringTag : void 0; + __name(baseGetTag2, "baseGetTag"); + _baseGetTag = baseGetTag2; + __name(isObjectLike2, "isObjectLike"); + isObjectLike_1 = isObjectLike2; + symbolTag5 = "[object Symbol]"; + __name(isSymbol2, "isSymbol"); + isSymbol_1 = isSymbol2; + NAN2 = 0 / 0; + reIsBadHex2 = /^[-+]0x[0-9a-f]+$/i; + reIsBinary2 = /^0b[01]+$/i; + reIsOctal2 = /^0o[0-7]+$/i; + freeParseInt2 = parseInt; + __name(toNumber2, "toNumber"); + toNumber_1 = toNumber2; + FUNC_ERROR_TEXT$1 = "Expected a function"; + nativeMax6 = Math.max; + nativeMin = Math.min; + __name(debounce, "debounce"); + debounce_1 = debounce; + performance2 = _window ? _window.performance : null; + pnow = performance2 && performance2.now ? function() { + return performance2.now(); + } : function() { + return Date.now(); + }; + raf = function() { + if (_window) { + if (_window.requestAnimationFrame) { + return function(fn3) { + _window.requestAnimationFrame(fn3); + }; + } else if (_window.mozRequestAnimationFrame) { + return function(fn3) { + _window.mozRequestAnimationFrame(fn3); + }; + } else if (_window.webkitRequestAnimationFrame) { + return function(fn3) { + _window.webkitRequestAnimationFrame(fn3); + }; + } else if (_window.msRequestAnimationFrame) { + return function(fn3) { + _window.msRequestAnimationFrame(fn3); + }; + } + } + return function(fn3) { + if (fn3) { + setTimeout(function() { + fn3(pnow()); + }, 1e3 / 60); + } + }; + }(); + requestAnimationFrame2 = /* @__PURE__ */ __name(function requestAnimationFrame3(fn3) { + return raf(fn3); + }, "requestAnimationFrame"); + performanceNow = pnow; + DEFAULT_HASH_SEED = 9261; + K3 = 65599; + DEFAULT_HASH_SEED_ALT = 5381; + hashIterableInts = /* @__PURE__ */ __name(function hashIterableInts2(iterator) { + var seed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_HASH_SEED; + var hash = seed; + var entry; + for (; ; ) { + entry = iterator.next(); + if (entry.done) { + break; + } + hash = hash * K3 + entry.value | 0; + } + return hash; + }, "hashIterableInts"); + hashInt = /* @__PURE__ */ __name(function hashInt2(num) { + var seed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_HASH_SEED; + return seed * K3 + num | 0; + }, "hashInt"); + hashIntAlt = /* @__PURE__ */ __name(function hashIntAlt2(num) { + var seed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_HASH_SEED_ALT; + return (seed << 5) + seed + num | 0; + }, "hashIntAlt"); + combineHashes = /* @__PURE__ */ __name(function combineHashes2(hash1, hash2) { + return hash1 * 2097152 + hash2; + }, "combineHashes"); + combineHashesArray = /* @__PURE__ */ __name(function combineHashesArray2(hashes) { + return hashes[0] * 2097152 + hashes[1]; + }, "combineHashesArray"); + hashArrays = /* @__PURE__ */ __name(function hashArrays2(hashes1, hashes2) { + return [hashInt(hashes1[0], hashes2[0]), hashIntAlt(hashes1[1], hashes2[1])]; + }, "hashArrays"); + hashIntsArray = /* @__PURE__ */ __name(function hashIntsArray2(ints, seed) { + var entry = { + value: 0, + done: false + }; + var i2 = 0; + var length2 = ints.length; + var iterator = { + next: /* @__PURE__ */ __name(function next3() { + if (i2 < length2) { + entry.value = ints[i2++]; + } else { + entry.done = true; } - function cE(a) { - return typeof a === gve || typeof a === kve; + return entry; + }, "next") + }; + return hashIterableInts(iterator, seed); + }, "hashIntsArray"); + hashString = /* @__PURE__ */ __name(function hashString2(str2, seed) { + var entry = { + value: 0, + done: false + }; + var i2 = 0; + var length2 = str2.length; + var iterator = { + next: /* @__PURE__ */ __name(function next3() { + if (i2 < length2) { + entry.value = str2.charCodeAt(i2++); + } else { + entry.done = true; } - function akb(a) { - a.f = new ttb(a); - a.i = new Ntb(a); - ++a.g; + return entry; + }, "next") + }; + return hashIterableInts(iterator, seed); + }, "hashString"); + hashStrings = /* @__PURE__ */ __name(function hashStrings2() { + return hashStringsArray(arguments); + }, "hashStrings"); + hashStringsArray = /* @__PURE__ */ __name(function hashStringsArray2(strs) { + var hash; + for (var i2 = 0; i2 < strs.length; i2++) { + var str2 = strs[i2]; + if (i2 === 0) { + hash = hashString(str2); + } else { + hash = hashString(str2, hash); + } + } + return hash; + }, "hashStringsArray"); + warningsEnabled = true; + warnSupported = console.warn != null; + traceSupported = console.trace != null; + MAX_INT$1 = Number.MAX_SAFE_INTEGER || 9007199254740991; + trueify = /* @__PURE__ */ __name(function trueify2() { + return true; + }, "trueify"); + falsify = /* @__PURE__ */ __name(function falsify2() { + return false; + }, "falsify"); + zeroify = /* @__PURE__ */ __name(function zeroify2() { + return 0; + }, "zeroify"); + noop$1 = /* @__PURE__ */ __name(function noop3() { + }, "noop"); + error = /* @__PURE__ */ __name(function error2(msg) { + throw new Error(msg); + }, "error"); + warnings = /* @__PURE__ */ __name(function warnings2(enabled) { + if (enabled !== void 0) { + warningsEnabled = !!enabled; + } else { + return warningsEnabled; + } + }, "warnings"); + warn = /* @__PURE__ */ __name(function warn2(msg) { + if (!warnings()) { + return; + } + if (warnSupported) { + console.warn(msg); + } else { + console.log(msg); + if (traceSupported) { + console.trace(); + } + } + }, "warn"); + clone3 = /* @__PURE__ */ __name(function clone4(obj) { + return extend2({}, obj); + }, "clone"); + copy4 = /* @__PURE__ */ __name(function copy5(obj) { + if (obj == null) { + return obj; + } + if (array2(obj)) { + return obj.slice(); + } else if (plainObject(obj)) { + return clone3(obj); + } else { + return obj; + } + }, "copy"); + copyArray$1 = /* @__PURE__ */ __name(function copyArray2(arr) { + return arr.slice(); + }, "copyArray"); + uuid = /* @__PURE__ */ __name(function uuid2(a2, b2) { + for ( + // loop :) + b2 = a2 = ""; + // b - result , a - numeric letiable + a2++ < 36; + // + b2 += a2 * 51 & 52 ? ( + // return a random number or 4 + (a2 ^ 15 ? ( + // generate a random number from 0 to 15 + 8 ^ Math.random() * (a2 ^ 20 ? 16 : 4) + ) : 4).toString(16) + ) : "-" + ) { + } + return b2; + }, "uuid"); + _staticEmptyObject = {}; + staticEmptyObject = /* @__PURE__ */ __name(function staticEmptyObject2() { + return _staticEmptyObject; + }, "staticEmptyObject"); + defaults$g = /* @__PURE__ */ __name(function defaults2(_defaults2) { + var keys3 = Object.keys(_defaults2); + return function(opts) { + var filledOpts = {}; + for (var i2 = 0; i2 < keys3.length; i2++) { + var key = keys3[i2]; + var optVal = opts == null ? void 0 : opts[key]; + filledOpts[key] = optVal === void 0 ? _defaults2[key] : optVal; + } + return filledOpts; + }; + }, "defaults"); + removeFromArray = /* @__PURE__ */ __name(function removeFromArray2(arr, ele, oneCopy) { + for (var i2 = arr.length - 1; i2 >= 0; i2--) { + if (arr[i2] === ele) { + arr.splice(i2, 1); + if (oneCopy) { + break; } - function Klb(a) { - if (!a) { - throw Adb(new Dvb()); - } - return a.d; - } - function smb(a) { - var b; - b = omb(a); - sFb(b != null); - return b; - } - function tmb(a) { - var b; - b = pmb(a); - sFb(b != null); - return b; - } - function tv(a, b) { - var c2; - c2 = a.a.gc(); - Sb(b, c2); - return c2 - b; - } - function Ysb(a, b) { - var c2; - c2 = a.a.zc(b, a); - return c2 == null; - } - function rAb(a, b) { - return a.a.zc(b, (Geb(), Eeb)) == null; - } - function _nb(a) { - return new SDb(null, $nb(a, a.length)); - } - function yPb(a, b, c2) { - return zPb(a, RD(b, 42), RD(c2, 176)); + } + } + }, "removeFromArray"); + clearArray = /* @__PURE__ */ __name(function clearArray2(arr) { + arr.splice(0, arr.length); + }, "clearArray"); + push = /* @__PURE__ */ __name(function push2(arr, otherArr) { + for (var i2 = 0; i2 < otherArr.length; i2++) { + var el = otherArr[i2]; + arr.push(el); + } + }, "push"); + getPrefixedProperty = /* @__PURE__ */ __name(function getPrefixedProperty2(obj, propName, prefix) { + if (prefix) { + propName = prependCamel(prefix, propName); + } + return obj[propName]; + }, "getPrefixedProperty"); + setPrefixedProperty = /* @__PURE__ */ __name(function setPrefixedProperty2(obj, propName, prefix, value2) { + if (prefix) { + propName = prependCamel(prefix, propName); + } + obj[propName] = value2; + }, "setPrefixedProperty"); + ObjectMap = /* @__PURE__ */ function() { + function ObjectMap2() { + _classCallCheck(this, ObjectMap2); + this._obj = {}; + } + __name(ObjectMap2, "ObjectMap"); + _createClass(ObjectMap2, [{ + key: "set", + value: /* @__PURE__ */ __name(function set6(key, val) { + this._obj[key] = val; + return this; + }, "set") + }, { + key: "delete", + value: /* @__PURE__ */ __name(function _delete(key) { + this._obj[key] = void 0; + return this; + }, "_delete") + }, { + key: "clear", + value: /* @__PURE__ */ __name(function clear29() { + this._obj = {}; + }, "clear") + }, { + key: "has", + value: /* @__PURE__ */ __name(function has2(key) { + return this._obj[key] !== void 0; + }, "has") + }, { + key: "get", + value: /* @__PURE__ */ __name(function get6(key) { + return this._obj[key]; + }, "get") + }]); + return ObjectMap2; + }(); + Map$2 = typeof Map !== "undefined" ? Map : ObjectMap; + undef = "undefined"; + ObjectSet = /* @__PURE__ */ function() { + function ObjectSet2(arrayOrObjectSet) { + _classCallCheck(this, ObjectSet2); + this._obj = /* @__PURE__ */ Object.create(null); + this.size = 0; + if (arrayOrObjectSet != null) { + var arr; + if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) { + arr = arrayOrObjectSet.toArray(); + } else { + arr = arrayOrObjectSet; } - function Wrb(a, b, c2) { - zsb(a.a, b); - return _Eb(a.b, b.g, c2); + for (var i2 = 0; i2 < arr.length; i2++) { + this.add(arr[i2]); } - function fyb(a, b, c2) { - lyb(c2, a.a.c.length); - $mb(a.a, c2, b); + } + } + __name(ObjectSet2, "ObjectSet"); + _createClass(ObjectSet2, [{ + key: "instanceString", + value: /* @__PURE__ */ __name(function instanceString4() { + return "set"; + }, "instanceString") + }, { + key: "add", + value: /* @__PURE__ */ __name(function add3(val) { + var o2 = this._obj; + if (o2[val] !== 1) { + o2[val] = 1; + this.size++; } - function Knb(a, b, c2, d) { - nFb(b, c2, a.length); - Onb(a, b, c2, d); + }, "add") + }, { + key: "delete", + value: /* @__PURE__ */ __name(function _delete(val) { + var o2 = this._obj; + if (o2[val] === 1) { + o2[val] = 0; + this.size--; } - function Onb(a, b, c2, d) { - var e; - for (e = b; e < c2; ++e) { - a[e] = d; + }, "_delete") + }, { + key: "clear", + value: /* @__PURE__ */ __name(function clear29() { + this._obj = /* @__PURE__ */ Object.create(null); + }, "clear") + }, { + key: "has", + value: /* @__PURE__ */ __name(function has2(val) { + return this._obj[val] === 1; + }, "has") + }, { + key: "toArray", + value: /* @__PURE__ */ __name(function toArray3() { + var _this = this; + return Object.keys(this._obj).filter(function(key) { + return _this.has(key); + }); + }, "toArray") + }, { + key: "forEach", + value: /* @__PURE__ */ __name(function forEach3(callback, thisArg) { + return this.toArray().forEach(callback, thisArg); + }, "forEach") + }]); + return ObjectSet2; + }(); + Set$1 = (typeof Set === "undefined" ? "undefined" : _typeof(Set)) !== undef ? Set : ObjectSet; + Element = /* @__PURE__ */ __name(function Element2(cy, params) { + var restore = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; + if (cy === void 0 || params === void 0 || !core(cy)) { + error("An element must have a core reference and parameters set"); + return; + } + var group2 = params.group; + if (group2 == null) { + if (params.data && params.data.source != null && params.data.target != null) { + group2 = "edges"; + } else { + group2 = "nodes"; + } + } + if (group2 !== "nodes" && group2 !== "edges") { + error("An element must be of type `nodes` or `edges`; you specified `" + group2 + "`"); + return; + } + this.length = 1; + this[0] = this; + var _p = this._private = { + cy, + single: true, + // indicates this is an element + data: params.data || {}, + // data object + position: params.position || { + x: 0, + y: 0 + }, + // (x, y) position pair + autoWidth: void 0, + // width and height of nodes calculated by the renderer when set to special 'auto' value + autoHeight: void 0, + autoPadding: void 0, + compoundBoundsClean: false, + // whether the compound dimensions need to be recalculated the next time dimensions are read + listeners: [], + // array of bound listeners + group: group2, + // string; 'nodes' or 'edges' + style: {}, + // properties as set by the style + rstyle: {}, + // properties for style sent from the renderer to the core + styleCxts: [], + // applied style contexts from the styler + styleKeys: {}, + // per-group keys of style property values + removed: true, + // whether it's inside the vis; true if removed (set true here since we call restore) + selected: params.selected ? true : false, + // whether it's selected + selectable: params.selectable === void 0 ? true : params.selectable ? true : false, + // whether it's selectable + locked: params.locked ? true : false, + // whether the element is locked (cannot be moved) + grabbed: false, + // whether the element is grabbed by the mouse; renderer sets this privately + grabbable: params.grabbable === void 0 ? true : params.grabbable ? true : false, + // whether the element can be grabbed + pannable: params.pannable === void 0 ? group2 === "edges" ? true : false : params.pannable ? true : false, + // whether the element has passthrough panning enabled + active: false, + // whether the element is active from user interaction + classes: new Set$1(), + // map ( className => true ) + animation: { + // object for currently-running animations + current: [], + queue: [] + }, + rscratch: {}, + // object in which the renderer can store information + scratch: params.scratch || {}, + // scratch objects + edges: [], + // array of connected edges + children: [], + // array of children + parent: params.parent && params.parent.isNode() ? params.parent : null, + // parent ref + traversalCache: {}, + // cache of output of traversal functions + backgrounding: false, + // whether background images are loading + bbCache: null, + // cache of the current bounding box + bbCacheShift: { + x: 0, + y: 0 + }, + // shift applied to cached bb to be applied on next get + bodyBounds: null, + // bounds cache of element body, w/o overlay + overlayBounds: null, + // bounds cache of element body, including overlay + labelBounds: { + // bounds cache of labels + all: null, + source: null, + target: null, + main: null + }, + arrowBounds: { + // bounds cache of edge arrows + source: null, + target: null, + "mid-source": null, + "mid-target": null + } + }; + if (_p.position.x == null) { + _p.position.x = 0; + } + if (_p.position.y == null) { + _p.position.y = 0; + } + if (params.renderedPosition) { + var rpos = params.renderedPosition; + var pan2 = cy.pan(); + var zoom2 = cy.zoom(); + _p.position = { + x: (rpos.x - pan2.x) / zoom2, + y: (rpos.y - pan2.y) / zoom2 + }; + } + var classes6 = []; + if (array2(params.classes)) { + classes6 = params.classes; + } else if (string(params.classes)) { + classes6 = params.classes.split(/\s+/); + } + for (var i2 = 0, l2 = classes6.length; i2 < l2; i2++) { + var cls = classes6[i2]; + if (!cls || cls === "") { + continue; + } + _p.classes.add(cls); + } + this.createEmitter(); + var bypass = params.style || params.css; + if (bypass) { + warn("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."); + this.style(bypass); + } + if (restore === void 0 || restore) { + this.restore(); + } + }, "Element"); + defineSearch = /* @__PURE__ */ __name(function defineSearch2(params) { + params = { + bfs: params.bfs || !params.dfs, + dfs: params.dfs || !params.bfs + }; + return /* @__PURE__ */ __name(function searchFn(roots, fn3, directed) { + var options3; + if (plainObject(roots) && !elementOrCollection(roots)) { + options3 = roots; + roots = options3.roots || options3.root; + fn3 = options3.visit; + directed = options3.directed; + } + directed = arguments.length === 2 && !fn$6(fn3) ? fn3 : directed; + fn3 = fn$6(fn3) ? fn3 : function() { + }; + var cy = this._private.cy; + var v3 = roots = string(roots) ? this.filter(roots) : roots; + var Q2 = []; + var connectedNodes = []; + var connectedBy = {}; + var id2depth = {}; + var V2 = {}; + var j2 = 0; + var found; + var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges; + for (var i2 = 0; i2 < v3.length; i2++) { + var vi2 = v3[i2]; + var viId = vi2.id(); + if (vi2.isNode()) { + Q2.unshift(vi2); + if (params.bfs) { + V2[viId] = true; + connectedNodes.push(vi2); } + id2depth[viId] = 0; } - function Snb(a, b) { - var c2; - for (c2 = 0; c2 < b; ++c2) { - a[c2] = false; + } + var _loop = /* @__PURE__ */ __name(function _loop2() { + var v4 = params.bfs ? Q2.shift() : Q2.pop(); + var vId = v4.id(); + if (params.dfs) { + if (V2[vId]) { + return "continue"; } + V2[vId] = true; + connectedNodes.push(v4); } - function cjb(a, b, c2) { - Pib(); - this.e = a; - this.d = b; - this.a = c2; - } - function DBb(a, b, c2) { - this.c = a; - this.a = b; - yob(); - this.b = c2; - } - function nMd(a, b) { - this.d = a; - dMd.call(this, a); - this.e = b; - } - function Ved(a, b, c2) { - Ned(a, b.g, c2); - zsb(a.c, b); - return a; - } - function xYb(a) { - vYb(a, (Cmd(), ymd)); - a.d = true; - return a; - } - function Cfe(a) { - !a.j && Ife(a, Dee(a.g, a.b)); - return a.j; - } - function At(a) { - a.a = null; - a.e = null; - akb(a.b); - a.d = 0; - ++a.c; - } - function znb(a) { - yFb(a.b != -1); - Xmb(a.c, a.a = a.b); - a.b = -1; - } - function Qte(a, b) { - Wse.call(this, 1); - this.a = a; - this.b = b; - } - function uUb(a, b) { - return a > 0 ? $wnd.Math.log(a / b) : -100; - } - function Agb(a, b) { - return Ddb(a, b) < 0 ? -1 : Ddb(a, b) > 0 ? 1 : 0; - } - function Dge(a, b) { - hZd(a, ZD(b, 160) ? b : RD(b, 2036).Rl()); - } - function vFb(a, b) { - if (a == null) { - throw Adb(new Ogb(b)); - } + var depth = id2depth[vId]; + var prevEdge = connectedBy[vId]; + var src = prevEdge != null ? prevEdge.source() : null; + var tgt = prevEdge != null ? prevEdge.target() : null; + var prevNode = prevEdge == null ? void 0 : v4.same(src) ? tgt[0] : src[0]; + var ret = void 0; + ret = fn3(v4, prevEdge, prevNode, j2++, depth); + if (ret === true) { + found = v4; + return "break"; } - function $nb(a, b) { - return jxb(b, a.length), new Gxb(a, b); + if (ret === false) { + return "break"; } - function hsc(a, b) { - if (!b) { - return false; + var vwEdges = v4.connectedEdges().filter(function(e4) { + return (!directed || e4.source().same(v4)) && edges5.has(e4); + }); + for (var _i2 = 0; _i2 < vwEdges.length; _i2++) { + var e3 = vwEdges[_i2]; + var w3 = e3.connectedNodes().filter(function(n2) { + return !n2.same(v4) && nodes6.has(n2); + }); + var wId = w3.id(); + if (w3.length !== 0 && !V2[wId]) { + w3 = w3[0]; + Q2.push(w3); + if (params.bfs) { + V2[wId] = true; + connectedNodes.push(w3); + } + connectedBy[wId] = e3; + id2depth[wId] = id2depth[vId] + 1; } - return ye(a, b); } - function Gs() { - zs(); - return cD(WC(RG, 1), jwe, 549, 0, [ys]); + }, "_loop"); + while (Q2.length !== 0) { + var _ret = _loop(); + if (_ret === "continue") continue; + if (_ret === "break") break; + } + var connectedEles = cy.collection(); + for (var _i = 0; _i < connectedNodes.length; _i++) { + var node2 = connectedNodes[_i]; + var edge = connectedBy[node2.id()]; + if (edge != null) { + connectedEles.push(edge); } - function Xib(a) { - return a.e == 0 ? a : new cjb(-a.e, a.d, a.a); + connectedEles.push(node2); + } + return { + path: cy.collection(connectedEles), + found: cy.collection(found) + }; + }, "searchFn"); + }, "defineSearch"); + elesfn$v = { + breadthFirstSearch: defineSearch({ + bfs: true + }), + depthFirstSearch: defineSearch({ + dfs: true + }) + }; + elesfn$v.bfs = elesfn$v.breadthFirstSearch; + elesfn$v.dfs = elesfn$v.depthFirstSearch; + heap$1 = createCommonjsModule(function(module2, exports2) { + (function() { + var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min9, nlargest, nsmallest, updateItem, _siftdown, _siftup; + floor = Math.floor, min9 = Math.min; + defaultCmp = /* @__PURE__ */ __name(function(x5, y5) { + if (x5 < y5) { + return -1; } - function $Nb(a, b) { - return Qfb(a.c.c + a.c.b, b.c.c + b.c.b); + if (x5 > y5) { + return 1; } - function cvb(a, b) { - Pub(a.d, b, a.b.b, a.b); - ++a.a; - a.c = null; + return 0; + }, "defaultCmp"); + insort = /* @__PURE__ */ __name(function(a2, x5, lo, hi, cmp) { + var mid; + if (lo == null) { + lo = 0; } - function JCb(a, b) { - !a.c ? Rmb(a.b, b) : JCb(a.c, b); - return a; + if (cmp == null) { + cmp = defaultCmp; } - function KB(a, b, c2) { - var d; - d = JB(a, b); - LB(a, b, c2); - return d; + if (lo < 0) { + throw new Error("lo must be non-negative"); } - function Rnb(a, b, c2) { - var d; - for (d = 0; d < b; ++d) { - bD(a, d, c2); - } + if (hi == null) { + hi = a2.length; } - function nhb(a, b, c2, d, e) { - while (b < c2) { - d[e++] = ihb(a, b++); + while (lo < hi) { + mid = floor((lo + hi) / 2); + if (cmp(x5, a2[mid]) < 0) { + hi = mid; + } else { + lo = mid + 1; } } - function Qnc(a, b, c2, d, e) { - Pnc(a, RD(Qc(b.k, c2), 15), c2, d, e); - } - function Nnc(a, b) { - FDb(GDb(a.Oc(), new voc()), new xoc(b)); - } - function tXc(a, b) { - return Qfb(a.e.a + a.f.a, b.e.a + b.f.a); - } - function vXc(a, b) { - return Qfb(a.e.b + a.f.b, b.e.b + b.f.b); - } - function GOc(a) { - return $wnd.Math.abs(a.d.e - a.e.e) - a.a; + return [].splice.apply(a2, [lo, lo - lo].concat(x5)), x5; + }, "insort"); + heappush = /* @__PURE__ */ __name(function(array4, item, cmp) { + if (cmp == null) { + cmp = defaultCmp; } - function ane(a) { - return a == oxe ? mLe : a == pxe ? "-INF" : "" + a; + array4.push(item); + return _siftdown(array4, 0, array4.length - 1, cmp); + }, "heappush"); + heappop = /* @__PURE__ */ __name(function(array4, cmp) { + var lastelt, returnitem; + if (cmp == null) { + cmp = defaultCmp; } - function cne(a) { - return a == oxe ? mLe : a == pxe ? "-INF" : "" + a; + lastelt = array4.pop(); + if (array4.length) { + returnitem = array4[0]; + array4[0] = lastelt; + _siftup(array4, 0, cmp); + } else { + returnitem = lastelt; } - function MSb(a) { - HSb(); - return vCd(JGd(a)) == vCd(LGd(a)); + return returnitem; + }, "heappop"); + heapreplace = /* @__PURE__ */ __name(function(array4, item, cmp) { + var returnitem; + if (cmp == null) { + cmp = defaultCmp; } - function kOd(a, b, c2) { - return RD(a.c.hd(b, RD(c2, 136)), 44); + returnitem = array4[0]; + array4[0] = item; + _siftup(array4, 0, cmp); + return returnitem; + }, "heapreplace"); + heappushpop = /* @__PURE__ */ __name(function(array4, item, cmp) { + var _ref; + if (cmp == null) { + cmp = defaultCmp; } - function IFd(a, b) { - oDd(a, new OC(b.f != null ? b.f : "" + b.g)); + if (array4.length && cmp(array4[0], item) < 0) { + _ref = [array4[0], item], item = _ref[0], array4[0] = _ref[1]; + _siftup(array4, 0, cmp); } - function KFd(a, b) { - oDd(a, new OC(b.f != null ? b.f : "" + b.g)); + return item; + }, "heappushpop"); + heapify = /* @__PURE__ */ __name(function(array4, cmp) { + var i2, _i, _len, _ref1, _results, _results1; + if (cmp == null) { + cmp = defaultCmp; } - function YGd(a, b) { - a.Si() && (b = bHd(a, b)); - return a.Fi(b); + _ref1 = function() { + _results1 = []; + for (var _j = 0, _ref = floor(array4.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--) { + _results1.push(_j); + } + return _results1; + }.apply(this).reverse(); + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + i2 = _ref1[_i]; + _results.push(_siftup(array4, i2, cmp)); } - function VVd(a, b) { - b = a.Yk(null, b); - return UVd(a, null, b); + return _results; + }, "heapify"); + updateItem = /* @__PURE__ */ __name(function(array4, item, cmp) { + var pos; + if (cmp == null) { + cmp = defaultCmp; } - function Wfe(a, b) { - ++a.j; - Tge(a, a.i, b); - Vfe(a, RD(b, 343)); + pos = array4.indexOf(item); + if (pos === -1) { + return; } - function UId(a) { - a ? iz(a, (gib(), fib)) : neb((gib(), a)); + _siftdown(array4, 0, pos, cmp); + return _siftup(array4, pos, cmp); + }, "updateItem"); + nlargest = /* @__PURE__ */ __name(function(array4, n2, cmp) { + var elem, result, _i, _len, _ref; + if (cmp == null) { + cmp = defaultCmp; } - function Twb(a) { - this.d = (uFb(a), a); - this.a = 0; - this.c = Sve; + result = array4.slice(0, n2); + if (!result.length) { + return result; } - function TTc(a, b) { - this.d = bUc(a); - this.c = b; - this.a = 0.5 * b; + heapify(result, cmp); + _ref = array4.slice(n2); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + elem = _ref[_i]; + heappushpop(result, elem, cmp); } - function WTb(a) { - VTb.call(this); - this.a = a; - Rmb(a.a, this); + return result.sort(cmp).reverse(); + }, "nlargest"); + nsmallest = /* @__PURE__ */ __name(function(array4, n2, cmp) { + var elem, los, result, _i, _j, _len, _ref, _ref1, _results; + if (cmp == null) { + cmp = defaultCmp; } - function Zje() { - gub.call(this); - this.a = true; - this.b = true; + if (n2 * 10 <= array4.length) { + result = array4.slice(0, n2).sort(cmp); + if (!result.length) { + return result; + } + los = result[result.length - 1]; + _ref = array4.slice(n2); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + elem = _ref[_i]; + if (cmp(elem, los) < 0) { + insort(result, elem, 0, null, cmp); + result.pop(); + los = result[result.length - 1]; + } + } + return result; } - function WB() { - WB = geb; - UB = new XB(false); - VB = new XB(true); - } - function Pc(a) { - var b; - return b = a.g, !b ? a.g = new th(a) : b; + heapify(array4, cmp); + _results = []; + for (_j = 0, _ref1 = min9(n2, array4.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; 0 <= _ref1 ? ++_j : --_j) { + _results.push(heappop(array4, cmp)); } - function Uc(a) { - var b; - return b = a.k, !b ? a.k = new Bh(a) : b; + return _results; + }, "nsmallest"); + _siftdown = /* @__PURE__ */ __name(function(array4, startpos, pos, cmp) { + var newitem, parent4, parentpos; + if (cmp == null) { + cmp = defaultCmp; } - function ki(a) { - var b; - return b = a.k, !b ? a.k = new Bh(a) : b; + newitem = array4[pos]; + while (pos > startpos) { + parentpos = pos - 1 >> 1; + parent4 = array4[parentpos]; + if (cmp(newitem, parent4) < 0) { + array4[pos] = parent4; + pos = parentpos; + continue; + } + break; } - function ej(a) { - var b; - return b = a.i, !b ? a.i = new Ki(a) : b; + return array4[pos] = newitem; + }, "_siftdown"); + _siftup = /* @__PURE__ */ __name(function(array4, pos, cmp) { + var childpos, endpos, newitem, rightpos, startpos; + if (cmp == null) { + cmp = defaultCmp; } - function bj(a) { - var b; - b = a.f; - return !b ? a.f = new Zj(a) : b; + endpos = array4.length; + startpos = pos; + newitem = array4[pos]; + childpos = 2 * pos + 1; + while (childpos < endpos) { + rightpos = childpos + 1; + if (rightpos < endpos && !(cmp(array4[childpos], array4[rightpos]) < 0)) { + childpos = rightpos; + } + array4[pos] = array4[childpos]; + pos = childpos; + childpos = 2 * pos + 1; } - function Fc(a) { - var b; - b = a.j; - return !b ? a.j = new Sw(a) : b; - } - function Co(a) { - var b; - b = a.d; - return !b ? a.d = new mp(a) : b; + array4[pos] = newitem; + return _siftdown(array4, startpos, pos, cmp); + }, "_siftup"); + Heap = function() { + Heap2.push = heappush; + Heap2.pop = heappop; + Heap2.replace = heapreplace; + Heap2.pushpop = heappushpop; + Heap2.heapify = heapify; + Heap2.updateItem = updateItem; + Heap2.nlargest = nlargest; + Heap2.nsmallest = nsmallest; + function Heap2(cmp) { + this.cmp = cmp != null ? cmp : defaultCmp; + this.nodes = []; } - function ate(a, b, c2) { - Vse(); - return new Yte(a, b, c2); - } - function yj(a, b) { - Pb(b, a.c.b.c.gc()); - return new Nj(a, b); - } - function sv(a, b) { - var c2; - c2 = a.a.gc(); - Pb(b, c2); - return c2 - 1 - b; - } - function sfb(a, b, c2) { - var d; - d = rfb(a, b); - Ffb(c2, d); - return d; - } - function rfb(a, b) { - var c2; - c2 = new pfb(); - c2.j = a; - c2.d = b; - return c2; - } - function Qb(a) { - if (a == null) { - throw Adb(new Ngb()); - } - return a; - } - function OC(a) { - if (a == null) { - throw Adb(new Ngb()); - } - this.a = a; - } - function XA(a) { - vA(); - this.b = new bnb(); - this.a = a; - IA(this, a); - } - function Zs(a) { - this.b = a; - this.a = RD(Hvb(this.b.a.e), 227); - } - function tm() { - tm = geb; - _l(); - sm = new Kx((yob(), yob(), vob)); - } - function Px() { - Px = geb; - _l(); - Ox = new Qx((yob(), yob(), xob)); - } - function lTd() { - lTd = geb; - kTd = _ae(); - !!(JTd(), nTd) && bbe(); - } - function LSc(a) { - a.s = NaN; - a.c = NaN; - MSc(a, a.e); - MSc(a, a.j); - } - function AYd(a) { - return (a.i == null && rYd(a), a.i).length; - } - function wq(a, b) { - return RD(gn(a.a).Md().Xb(b), 44).ld(); - } - function Wjb(a, b) { - return bE(b) ? Xjb(a, b) : Wd(qtb(a.f, b)); - } - function QSb(a, b) { - HSb(); - return a == JGd(b) ? LGd(b) : JGd(b); - } - function rWb(a, b, c2, d) { - return c2 == 0 || (c2 - d) / c2 < a.e || b >= a.g; - } - function bD(a, b, c2) { - pFb(c2 == null || VC(a, c2)); - return a[b] = c2; - } - function yhb(a, b) { - BFb(b, a.length + 1); - return a.substr(b); - } - function yxb(a, b) { - uFb(b); - while (a.c < a.d) { - a.Se(b, a.c++); - } - } - function Dub(a) { - this.d = a; - this.c = a.a.d.a; - this.b = a.a.e.g; - } - function Ggd(a) { - this.c = a; - this.a = new Yub(); - this.b = new Yub(); - } - function R4b(a) { - this.c = new pjd(); - this.a = new bnb(); - this.b = a; - } - function fYb(a) { - this.b = new bnb(); - this.a = new bnb(); - this.c = a; - } - function Pdd(a, b, c2) { - RD(b.b, 68); - Umb(b.a, new Wdd(a, c2, b)); - } - function rdc(a, b) { - Zcc(); - return RD(Vrb(a, b.d), 15).Fc(b); - } - function oDd(a, b) { - var c2; - c2 = a.a.length; - JB(a, c2); - LB(a, c2, b); - } - function eFb(a, b) { - var c2; - c2 = console[a]; - c2.call(console, b); - } - function _Id(a, b) { - var c2; - ++a.j; - c2 = a.Ej(); - a.rj(a.Zi(c2, b)); - } - function lMc(a, b, c2) { - var d; - d = rMc(a, b, c2); - return kMc(a, d); - } - function j2d(a) { - !a.d && (a.d = new XZd(o7, a, 1)); - return a.d; - } - function jVd(a) { - !a.a && (a.a = new XZd(r7, a, 4)); - return a.a; - } - function Jhb(a, b) { - a.a += String.fromCharCode(b); - return a; - } - function Thb(a, b) { - a.a += String.fromCharCode(b); - return a; - } - function D9d(a, b, c2) { - this.a = a; - L6d.call(this, b); - this.b = c2; - } - function Fde(a, b, c2) { - this.a = a; - MKd.call(this, 8, b, null, c2); - } - function aue(a, b, c2) { - Wse.call(this, a); - this.a = b; - this.b = c2; - } - function O8d(a, b, c2) { - t7d.call(this, b); - this.a = a; - this.b = c2; - } - function ut(a) { - this.c = a; - this.b = this.c.a; - this.a = this.c.e; - } - function Zee(a) { - this.a = (uFb(qKe), qKe); - this.b = a; - new O5d(); - } - function Trb(a) { - Ae(a.a); - a.b = $C(jJ, rve, 1, a.b.length, 5, 1); - } - function Ckb(a) { - yFb(a.c != -1); - a.d.gd(a.c); - a.b = a.c; - a.c = -1; - } - function ejd(a) { - return $wnd.Math.sqrt(a.a * a.a + a.b * a.b); - } - function Jzb(a, b) { - return Tyb(a.c, a.f, b, a.b, a.a, a.e, a.d); - } - function eyb(a, b) { - return lyb(b, a.a.c.length), Vmb(a.a, b); - } - function Hb(a, b) { - return dE(a) === dE(b) || a != null && pb(a, b); - } - function O2d(a) { - return ZD(a, 102) && (RD(a, 19).Bb & QHe) != 0; - } - function Fb(a) { - Hvb(a); - return ZD(a, 484) ? RD(a, 484) : jeb(a); - } - function bve(a) { - if (a) - return a.dc(); - return !a.Kc().Ob(); - } - function kte(a) { - if (!Ase) - return false; - return Yjb(Ase, a); + __name(Heap2, "Heap"); + Heap2.prototype.push = function(x5) { + return heappush(this.nodes, x5, this.cmp); + }; + Heap2.prototype.pop = function() { + return heappop(this.nodes, this.cmp); + }; + Heap2.prototype.peek = function() { + return this.nodes[0]; + }; + Heap2.prototype.contains = function(x5) { + return this.nodes.indexOf(x5) !== -1; + }; + Heap2.prototype.replace = function(x5) { + return heapreplace(this.nodes, x5, this.cmp); + }; + Heap2.prototype.pushpop = function(x5) { + return heappushpop(this.nodes, x5, this.cmp); + }; + Heap2.prototype.heapify = function() { + return heapify(this.nodes, this.cmp); + }; + Heap2.prototype.updateItem = function(x5) { + return updateItem(this.nodes, x5, this.cmp); + }; + Heap2.prototype.clear = function() { + return this.nodes = []; + }; + Heap2.prototype.empty = function() { + return this.nodes.length === 0; + }; + Heap2.prototype.size = function() { + return this.nodes.length; + }; + Heap2.prototype.clone = function() { + var heap2; + heap2 = new Heap2(); + heap2.nodes = this.nodes.slice(0); + return heap2; + }; + Heap2.prototype.toArray = function() { + return this.nodes.slice(0); + }; + Heap2.prototype.insert = Heap2.prototype.push; + Heap2.prototype.top = Heap2.prototype.peek; + Heap2.prototype.front = Heap2.prototype.peek; + Heap2.prototype.has = Heap2.prototype.contains; + Heap2.prototype.copy = Heap2.prototype.clone; + return Heap2; + }(); + (function(root4, factory) { + { + return module2.exports = factory(); } - function hDb(a) { - if (0 >= a) { - return new rDb(); + })(this, function() { + return Heap; + }); + }).call(commonjsGlobal); + }); + heap = heap$1; + dijkstraDefaults = defaults$g({ + root: null, + weight: /* @__PURE__ */ __name(function weight(edge) { + return 1; + }, "weight"), + directed: false + }); + elesfn$u = { + dijkstra: /* @__PURE__ */ __name(function dijkstra2(options3) { + if (!plainObject(options3)) { + var args = arguments; + options3 = { + root: args[0], + weight: args[1], + directed: args[2] + }; + } + var _dijkstraDefaults = dijkstraDefaults(options3), root4 = _dijkstraDefaults.root, weight8 = _dijkstraDefaults.weight, directed = _dijkstraDefaults.directed; + var eles = this; + var weightFn = weight8; + var source = string(root4) ? this.filter(root4)[0] : root4[0]; + var dist3 = {}; + var prev2 = {}; + var knownDist = {}; + var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges; + edges5.unmergeBy(function(ele) { + return ele.isLoop(); + }); + var getDist3 = /* @__PURE__ */ __name(function getDist4(node3) { + return dist3[node3.id()]; + }, "getDist"); + var setDist = /* @__PURE__ */ __name(function setDist2(node3, d2) { + dist3[node3.id()] = d2; + Q2.updateItem(node3); + }, "setDist"); + var Q2 = new heap(function(a2, b2) { + return getDist3(a2) - getDist3(b2); + }); + for (var i2 = 0; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; + dist3[node2.id()] = node2.same(source) ? 0 : Infinity; + Q2.push(node2); + } + var distBetween = /* @__PURE__ */ __name(function distBetween2(u3, v4) { + var uvs = (directed ? u3.edgesTo(v4) : u3.edgesWith(v4)).intersect(edges5); + var smallestDistance = Infinity; + var smallestEdge; + for (var _i = 0; _i < uvs.length; _i++) { + var edge = uvs[_i]; + var _weight = weightFn(edge); + if (_weight < smallestDistance || !smallestEdge) { + smallestDistance = _weight; + smallestEdge = edge; } - return iDb(a - 1); } - function Y2b(a) { - if (!a.a && !!a.c) { - return a.c.b; - } - return a.a; + return { + edge: smallestEdge, + dist: smallestDistance + }; + }, "distBetween"); + while (Q2.size() > 0) { + var u2 = Q2.pop(); + var smalletsDist = getDist3(u2); + var uid = u2.id(); + knownDist[uid] = smalletsDist; + if (smalletsDist === Infinity) { + continue; } - function Zx(a) { - if (ZD(a, 616)) { - return a; + var neighbors = u2.neighborhood().intersect(nodes6); + for (var _i2 = 0; _i2 < neighbors.length; _i2++) { + var v3 = neighbors[_i2]; + var vid = v3.id(); + var vDist = distBetween(u2, v3); + var alt = smalletsDist + vDist.dist; + if (alt < getDist3(v3)) { + setDist(v3, alt); + prev2[vid] = { + node: u2, + edge: vDist.edge + }; } - return new sy(a); } - function LCb(a) { - if (!a.c) { - MCb(a); - a.d = true; - } else { - LCb(a.c); + } + return { + distanceTo: /* @__PURE__ */ __name(function distanceTo(node3) { + var target = string(node3) ? nodes6.filter(node3)[0] : node3[0]; + return knownDist[target.id()]; + }, "distanceTo"), + pathTo: /* @__PURE__ */ __name(function pathTo(node3) { + var target = string(node3) ? nodes6.filter(node3)[0] : node3[0]; + var S3 = []; + var u3 = target; + var uid2 = u3.id(); + if (target.length > 0) { + S3.unshift(target); + while (prev2[uid2]) { + var p3 = prev2[uid2]; + S3.unshift(p3.edge); + S3.unshift(p3.node); + u3 = p3.node; + uid2 = u3.id(); + } } - } - function ICb(a) { - if (!a.c) { - a.d = true; - KCb(a); - } else { - a.c.$e(); - } - } - function bHb(a) { - a.b = false; - a.c = false; - a.d = false; - a.a = false; - } - function uMc(a) { - var b, c2; - b = a.c.i.c; - c2 = a.d.i.c; - return b == c2; - } - function _vd(a, b) { - var c2; - c2 = a.Ih(b); - c2 >= 0 ? a.ki(c2) : Tvd(a, b); - } - function mtd(a, b) { - a.c < 0 || a.b.b < a.c ? Oub(a.b, b) : a.a.tf(b); - } - function aBd(a, b) { - WGd((!a.a && (a.a = new F4d(a, a)), a.a), b); - } - function DQb(a, b) { - RQb(RD(b.b, 68), a); - Umb(b.a, new IQb(a)); - } - function Woc(a, b) { - return hgb(b.j.c.length, a.j.c.length); - } - function oed(a, b, c2) { - hed(); - return c2.Lg(a, RD(b.ld(), 149)); - } - function Hvb(a) { - if (a == null) { - throw Adb(new Ngb()); - } - return a; - } - function uFb(a) { - if (a == null) { - throw Adb(new Ngb()); + return eles.spawn(S3); + }, "pathTo") + }; + }, "dijkstra") + }; + elesfn$t = { + // kruskal's algorithm (finds min spanning tree, assuming undirected graph) + // implemented from pseudocode from wikipedia + kruskal: /* @__PURE__ */ __name(function kruskal(weightFn) { + weightFn = weightFn || function(edge2) { + return 1; + }; + var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges; + var numNodes = nodes6.length; + var forest = new Array(numNodes); + var A2 = nodes6; + var findSetIndex = /* @__PURE__ */ __name(function findSetIndex2(ele) { + for (var i3 = 0; i3 < forest.length; i3++) { + var eles = forest[i3]; + if (eles.has(ele)) { + return i3; } - return a; - } - function uKd(a) { - if (a.p != 4) - throw Adb(new cgb()); - return a.e; } - function tKd(a) { - if (a.p != 3) - throw Adb(new cgb()); - return a.e; - } - function CKd(a) { - if (a.p != 3) - throw Adb(new cgb()); - return a.j; - } - function DKd(a) { - if (a.p != 4) - throw Adb(new cgb()); - return a.j; - } - function wKd(a) { - if (a.p != 6) - throw Adb(new cgb()); - return a.f; - } - function FKd(a) { - if (a.p != 6) - throw Adb(new cgb()); - return a.k; - } - function $9d(a) { - !a.b && (a.b = new pae(new lae())); - return a.b; - } - function yfe(a) { - a.c == -2 && Efe(a, vee2(a.g, a.b)); - return a.c; - } - function vfb(a, b) { - var c2; - c2 = rfb("", a); - c2.n = b; - c2.i = 1; - return c2; - } - function kp(a, b, c2, d) { - gp.call(this, a, c2); - this.a = b; - this.f = d; - } - function ct(a, b, c2, d) { - gp.call(this, a, b); - this.d = c2; - this.a = d; - } - function zy(a, b) { - _p.call(this, Gob(Qb(a), Qb(b))); - this.a = b; - } - function ufd() { - Oed.call(this); - aFb(this.j.c, 0); - this.a = -1; - } - function $ae() { - FBd.call(this, AKe, (jTd(), iTd)); - Uae(this); - } - function Bne() { - FBd.call(this, dLe, (Ole(), Nle)); - xne(this); - } - function cdd() { - qs.call(this, "DELAUNAY_TRIANGULATION", 0); - } - function Ehb(a) { - return String.fromCharCode.apply(null, a); - } - function Zjb(a, b, c2) { - return bE(b) ? $jb(a, b, c2) : rtb(a.f, b, c2); - } - function Fob(a) { - yob(); - return !a ? (urb(), urb(), trb) : a.Oe(); - } - function Zu(a) { - dk(a, lwe); - return dz(Bdb(Bdb(5, a), a / 10 | 0)); - } - function yx(a, b) { - ux(); - return new wx(new tl(a), new dl(b)); - } - function fn() { - fn = geb; - en = new Nx(cD(WC(UK, 1), Zve, 44, 0, [])); - } - function tqb(a) { - !a.d && (a.d = new xpb(a.c.Cc())); - return a.d; - } - function qqb(a) { - !a.a && (a.a = new Sqb(a.c.vc())); - return a.a; - } - function sqb(a) { - !a.b && (a.b = new Lqb(a.c.ec())); - return a.b; - } - function qgb(a, b) { - while (b-- > 0) { - a = a << 1 | (a < 0 ? 1 : 0); - } - return a; - } - function BGc(a, b) { - var c2; - c2 = new R4b(a); - ZEb(b.c, c2); - return c2; - } - function FMb(a, b) { - a.u.Hc((Pod(), Lod)) && DMb(a, b); - HMb(a, b); - } - function Fvb(a, b) { - return dE(a) === dE(b) || a != null && pb(a, b); - } - function Vrb(a, b) { - return Bsb(a.a, b) ? a.b[RD(b, 22).g] : null; - } - function YRb() { - VRb(); - return cD(WC($O, 1), jwe, 489, 0, [URb]); - } - function ybd() { - sbd(); - return cD(WC(M1, 1), jwe, 490, 0, [rbd]); - } - function Hbd() { - Cbd(); - return cD(WC(N1, 1), jwe, 558, 0, [Bbd]); - } - function gdd() { - _cd(); - return cD(WC(V1, 1), jwe, 539, 0, [$cd]); - } - function iyd(a) { - !a.n && (a.n = new C5d(I4, a, 1, 7)); - return a.n; - } - function wCd(a) { - !a.c && (a.c = new C5d(K4, a, 9, 9)); - return a.c; - } - function mzd(a) { - !a.c && (a.c = new Yie(E4, a, 5, 8)); - return a.c; - } - function lzd(a) { - !a.b && (a.b = new Yie(E4, a, 4, 7)); - return a.b; - } - function Sed(a) { - a.j.c.length = 0; - Ae(a.c); - sfd(a.a); - return a; - } - function Afe(a) { - a.e == fLe && Gfe(a, Aee(a.g, a.b)); - return a.e; - } - function Bfe(a) { - a.f == fLe && Hfe(a, Bee(a.g, a.b)); - return a.f; - } - function xBd(a, b, c2, d) { - wBd(a, b, c2, false); - j1d(a, d); - return a; - } - function oNd(a, b) { - this.b = a; - nMd.call(this, a, b); - mNd(this); - } - function wNd(a, b) { - this.b = a; - CMd.call(this, a, b); - uNd(this); - } - function Kmb(a) { - this.d = a; - this.a = this.d.b; - this.b = this.d.c; - } - function oy(a, b) { - this.b = a; - this.c = b; - this.a = new Osb(this.b); - } - function ihb(a, b) { - BFb(b, a.length); - return a.charCodeAt(b); - } - function NDd(a, b) { - CGd(a, Kfb(vDd(b, "x")), Kfb(vDd(b, "y"))); + }, "findSetIndex"); + for (var i2 = 0; i2 < numNodes; i2++) { + forest[i2] = this.spawn(nodes6[i2]); + } + var S3 = edges5.sort(function(a2, b2) { + return weightFn(a2) - weightFn(b2); + }); + for (var _i = 0; _i < S3.length; _i++) { + var edge = S3[_i]; + var u2 = edge.source()[0]; + var v3 = edge.target()[0]; + var setUIndex = findSetIndex(u2); + var setVIndex = findSetIndex(v3); + var setU = forest[setUIndex]; + var setV = forest[setVIndex]; + if (setUIndex !== setVIndex) { + A2.merge(edge); + setU.merge(setV); + forest.splice(setVIndex, 1); } - function $Dd(a, b) { - CGd(a, Kfb(vDd(b, "x")), Kfb(vDd(b, "y"))); - } - function CDb(a, b) { - MCb(a); - return new SDb(a, new hEb(b, a.a)); - } - function GDb(a, b) { - MCb(a); - return new SDb(a, new zEb(b, a.a)); - } - function HDb(a, b) { - MCb(a); - return new WCb(a, new nEb(b, a.a)); - } - function IDb(a, b) { - MCb(a); - return new oDb(a, new tEb(b, a.a)); - } - function Ty(a, b) { - return new Ry(RD(Qb(a), 50), RD(Qb(b), 50)); - } - function nHb(a, b) { - return Qfb(a.d.c + a.d.b / 2, b.d.c + b.d.b / 2); - } - function gTb(a, b, c2) { - c2.a ? Eyd(a, b.b - a.f / 2) : Dyd(a, b.a - a.g / 2); - } - function WYb(a, b) { - return Qfb(a.g.c + a.g.b / 2, b.g.c + b.g.b / 2); - } - function RZb(a, b) { - NZb(); - return Qfb((uFb(a), a), (uFb(b), b)); - } - function wSd(a) { - return a != null && tpb(eSd, a.toLowerCase()); - } - function Ae(a) { - var b; - for (b = a.Kc(); b.Ob(); ) { - b.Pb(); - b.Qb(); - } - } - function Ih(a) { - var b; - b = a.b; - !b && (a.b = b = new Xh(a)); - return b; - } - function R0b(a) { - var b; - b = Z5b(a); - if (b) { - return b; - } - return null; - } - function BSb(a, b) { - var c2, d; - c2 = a / b; - d = eE(c2); - c2 > d && ++d; - return d; - } - function Ck(a, b, c2) { - var d; - d = RD(a.d.Kb(c2), 159); - !!d && d.Nb(b); - } - function Vhc(a, b, c2) { - tqc(a.a, c2); - Jpc(c2); - Kqc(a.b, c2); - bqc(b, c2); - } - function oNc(a, b, c2, d) { - this.a = a; - this.c = b; - this.b = c2; - this.d = d; - } - function ROc(a, b, c2, d) { - this.c = a; - this.b = b; - this.a = c2; - this.d = d; - } - function uPc(a, b, c2, d) { - this.c = a; - this.b = b; - this.d = c2; - this.a = d; - } - function Uid2(a, b, c2, d) { - this.c = a; - this.d = b; - this.b = c2; - this.a = d; - } - function GTc(a, b, c2, d) { - this.a = a; - this.d = b; - this.c = c2; - this.b = d; - } - function t1b(a, b, c2, d) { - this.a = a; - this.e = b; - this.d = c2; - this.c = d; - } - function $td(a, b, c2, d) { - this.a = a; - this.c = b; - this.d = c2; - this.b = d; - } - function ehb(a, b, c2) { - this.a = ywe; - this.d = a; - this.b = b; - this.c = c2; - } - function fpc(a, b, c2, d) { - qs.call(this, a, b); - this.a = c2; - this.b = d; - } - function Uwb(a, b) { - this.d = (uFb(a), a); - this.a = 16449; - this.c = b; - } - function CIc(a) { - this.a = new bnb(); - this.e = $C(kE, Nve, 53, a, 0, 2); - } - function ELc(a) { - a.Ug("No crossing minimization", 1); - a.Vg(); - } - function Evb() { - yz.call(this, "There is no more element."); - } - function OEd(a, b, c2, d) { - this.a = a; - this.b = b; - this.c = c2; - this.d = d; - } - function PEd(a, b, c2, d) { - this.a = a; - this.b = b; - this.c = c2; - this.d = d; - } - function h7d(a, b, c2, d) { - this.e = a; - this.a = b; - this.c = c2; - this.d = d; - } - function x7d(a, b, c2, d) { - this.a = a; - this.c = b; - this.d = c2; - this.b = d; - } - function C8d(a, b, c2, d) { - s7d(); - M7d.call(this, b, c2, d); - this.a = a; - } - function J8d(a, b, c2, d) { - s7d(); - M7d.call(this, b, c2, d); - this.a = a; - } - function lwd(a, b, c2) { - var d, e; - d = oSd(a); - e = b.ti(c2, d); - return e; - } - function lBd(a) { - var b, c2; - c2 = (b = new s2d(), b); - l2d(c2, a); - return c2; - } - function mBd(a) { - var b, c2; - c2 = (b = new s2d(), b); - p2d(c2, a); - return c2; - } - function HDd(a, b) { - var c2; - c2 = Wjb(a.f, b); - wEd(b, c2); - return null; - } - function uCd(a) { - !a.b && (a.b = new C5d(G4, a, 12, 3)); - return a.b; - } - function VD(a) { - CFb(a == null || cE(a) && !(a.Tm === keb)); - return a; - } - function gz(a) { - if (a.n) { - a.e !== rwe && a.je(); - a.j = null; - } - return a; - } - function Ng(a) { - ig(a.d); - if (a.d.d != a.c) { - throw Adb(new Jrb()); - } - } - function Bkb(a) { - sFb(a.b < a.d.gc()); - return a.d.Xb(a.c = a.b++); - } - function Xub(a) { - a.a.a = a.c; - a.c.b = a.a; - a.a.b = a.c.a = null; - a.b = 0; - } - function xPd(a) { - this.f = a; - this.c = this.f.e; - a.f > 0 && wPd(this); - } - function Vg(a, b) { - this.a = a; - Pg.call(this, a, RD(a.d, 15).fd(b)); - } - function lrd(a, b) { - return Qfb(urd(a) * trd(a), urd(b) * trd(b)); - } - function mrd(a, b) { - return Qfb(urd(a) * trd(a), urd(b) * trd(b)); - } - function n5b(a) { - return ozd(a) && Heb(TD(Gxd(a, (yCc(), OAc)))); - } - function Sfc(a, b) { - return Rc(a, RD(mQb(b, (yCc(), tBc)), 17), b); - } - function lic(a, b) { - RD(mQb(a, (Ywc(), qwc)), 15).Fc(b); - return b; - } - function C2b(a, b) { - a.b = b.b; - a.c = b.c; - a.d = b.d; - a.a = b.a; - return a; - } - function cEb(a, b, c2, d) { - this.b = a; - this.c = d; - xxb.call(this, b, c2); - } - function Ulc(a, b, c2) { - a.i = 0; - a.e = 0; - if (b == c2) { - return; + } + return A2; + }, "kruskal") + }; + aStarDefaults = defaults$g({ + root: null, + goal: null, + weight: /* @__PURE__ */ __name(function weight2(edge) { + return 1; + }, "weight"), + heuristic: /* @__PURE__ */ __name(function heuristic(edge) { + return 0; + }, "heuristic"), + directed: false + }); + elesfn$s = { + // Implemented from pseudocode from wikipedia + aStar: /* @__PURE__ */ __name(function aStar(options3) { + var cy = this.cy(); + var _aStarDefaults = aStarDefaults(options3), root4 = _aStarDefaults.root, goal = _aStarDefaults.goal, heuristic2 = _aStarDefaults.heuristic, directed = _aStarDefaults.directed, weight8 = _aStarDefaults.weight; + root4 = cy.collection(root4)[0]; + goal = cy.collection(goal)[0]; + var sid = root4.id(); + var tid = goal.id(); + var gScore = {}; + var fScore = {}; + var closedSetIds = {}; + var openSet = new heap(function(a2, b2) { + return fScore[a2.id()] - fScore[b2.id()]; + }); + var openSetIds = new Set$1(); + var cameFrom = {}; + var cameFromEdge = {}; + var addToOpenSet = /* @__PURE__ */ __name(function addToOpenSet2(ele, id26) { + openSet.push(ele); + openSetIds.add(id26); + }, "addToOpenSet"); + var cMin, cMinId; + var popFromOpenSet = /* @__PURE__ */ __name(function popFromOpenSet2() { + cMin = openSet.pop(); + cMinId = cMin.id(); + openSetIds["delete"](cMinId); + }, "popFromOpenSet"); + var isInOpenSet = /* @__PURE__ */ __name(function isInOpenSet2(id26) { + return openSetIds.has(id26); + }, "isInOpenSet"); + addToOpenSet(root4, sid); + gScore[sid] = 0; + fScore[sid] = heuristic2(root4); + var steps = 0; + while (openSet.size() > 0) { + popFromOpenSet(); + steps++; + if (cMinId === tid) { + var path4 = []; + var pathNode = goal; + var pathNodeId = tid; + var pathEdge = cameFromEdge[pathNodeId]; + for (; ; ) { + path4.unshift(pathNode); + if (pathEdge != null) { + path4.unshift(pathEdge); + } + pathNode = cameFrom[pathNodeId]; + if (pathNode == null) { + break; + } + pathNodeId = pathNode.id(); + pathEdge = cameFromEdge[pathNodeId]; } - Qlc(a, b, c2); + return { + found: true, + distance: gScore[cMinId], + path: this.spawn(path4), + steps + }; } - function Vlc(a, b, c2) { - a.i = 0; - a.e = 0; - if (b == c2) { - return; + closedSetIds[cMinId] = true; + var vwEdges = cMin._private.edges; + for (var i2 = 0; i2 < vwEdges.length; i2++) { + var e3 = vwEdges[i2]; + if (!this.hasElementWithId(e3.id())) { + continue; } - Rlc(a, b, c2); - } - function akc(a, b, c2) { - Wjc(); - return _Gb(RD(Wjb(a.e, b), 529), c2); - } - function nd(a) { - var b; - return b = a.f, !b ? a.f = new ne(a, a.c) : b; - } - function nTc(a, b) { - return VTc(a.j, b.s, b.c) + VTc(b.e, a.s, a.c); - } - function Rrc(a, b) { - if (!!a.e && !a.e.a) { - Prc(a.e, b); - Rrc(a.e, b); + if (directed && e3.data("source") !== cMinId) { + continue; } - } - function Qrc(a, b) { - if (!!a.d && !a.d.a) { - Prc(a.d, b); - Qrc(a.d, b); - } - } - function krd(a, b) { - return -Qfb(urd(a) * trd(a), urd(b) * trd(b)); - } - function gtd(a) { - return RD(a.ld(), 149).Pg() + ":" + jeb(a.md()); - } - function EBd() { - BBd(this, new yAd()); - this.wb = (lTd(), kTd); - jTd(); - } - function G7b(a) { - this.b = new bnb(); - Tmb(this.b, this.b); - this.a = a; - } - function WWc(a, b) { - new Yub(); - this.a = new Ejd(); - this.b = a; - this.c = b; - } - function urb() { - urb = geb; - rrb = new wrb(); - srb = new wrb(); - trb = new Brb(); - } - function yob() { - yob = geb; - vob = new Job(); - wob = new apb(); - xob = new ipb(); - } - function FGb() { - FGb = geb; - CGb = new AGb(); - EGb = new fHb(); - DGb = new YGb(); - } - function HSb() { - HSb = geb; - GSb = new bnb(); - FSb = new Tsb(); - ESb = new bnb(); - } - function Rb(a, b) { - if (a == null) { - throw Adb(new Ogb(b)); - } - return a; - } - function tCd(a) { - !a.a && (a.a = new C5d(J4, a, 10, 11)); - return a.a; - } - function uYd(a) { - !a.q && (a.q = new C5d(s7, a, 11, 10)); - return a.q; - } - function xYd(a) { - !a.s && (a.s = new C5d(y7, a, 21, 17)); - return a.s; - } - function er2(a) { - Qb(a); - return Er(new is(Mr(a.a.Kc(), new ir()))); - } - function hfd(a, b) { - rb(a); - rb(b); - return ns(RD(a, 22), RD(b, 22)); - } - function qDd(a, b, c2) { - var d, e; - d = Qeb(c2); - e = new hC(d); - sC(a, b, e); - } - function d4d(a, b, c2, d, e, f2) { - c4d.call(this, a, b, c2, d, e, f2 ? -2 : -1); - } - function sje(a, b, c2, d) { - kZd.call(this, b, c2); - this.b = a; - this.a = d; - } - function Ry(a, b) { - wi.call(this, new ezb(a)); - this.a = a; - this.b = b; - } - function Gu(a) { - this.b = a; - this.c = a; - a.e = null; - a.c = null; - this.a = 1; - } - function Dkc(a) { - lkc(); - var b; - b = RD(a.g, 10); - b.n.a = a.d.c + b.d.b; - } - function fA() { - fA = geb; - var a, b; - b = !lA(); - a = new tA(); - eA = b ? new mA() : a; - } - function Hob(a) { - yob(); - return ZD(a, 59) ? new irb(a) : new Upb(a); - } - function Ux(a) { - return ZD(a, 16) ? new btb(RD(a, 16)) : Vx(a.Kc()); - } - function Vi(a) { - return new ij(a, a.e.Rd().gc() * a.c.Rd().gc()); - } - function fj(a) { - return new sj(a, a.e.Rd().gc() * a.c.Rd().gc()); - } - function Iz(a) { - return !!a && !!a.hashCode ? a.hashCode() : kFb(a); - } - function Yjb(a, b) { - return b == null ? !!qtb(a.f, null) : Jtb(a.i, b); - } - function hYb(a, b) { - var c2; - c2 = $sb(a.a, b); - c2 && (b.d = null); - return c2; - } - function MGb(a, b, c2) { - if (a.f) { - return a.f.ef(b, c2); + var wSrc = e3.source(); + var wTgt = e3.target(); + var w3 = wSrc.id() !== cMinId ? wSrc : wTgt; + var wid = w3.id(); + if (!this.hasElementWithId(wid)) { + continue; } - return false; - } - function cFc(a, b, c2, d) { - bD(a.c[b.g], c2.g, d); - bD(a.c[c2.g], b.g, d); - } - function fFc(a, b, c2, d) { - bD(a.c[b.g], b.g, c2); - bD(a.b[b.g], b.g, d); - } - function sXc(a, b, c2) { - return Kfb(UD(c2.a)) <= a && Kfb(UD(c2.b)) >= b; - } - function yJc(a, b) { - this.g = a; - this.d = cD(WC(jR, 1), WAe, 10, 0, [b]); - } - function lHb(a) { - this.c = a; - this.b = new yAb(RD(Qb(new oHb()), 50)); - } - function UYb(a) { - this.c = a; - this.b = new yAb(RD(Qb(new XYb()), 50)); - } - function $Qb(a) { - this.b = a; - this.a = new yAb(RD(Qb(new bRb()), 50)); - } - function tRc() { - this.b = new _sb(); - this.d = new Yub(); - this.e = new Fyb(); - } - function VTb() { - this.c = new pjd(); - this.d = new pjd(); - this.e = new pjd(); - } - function a1b() { - this.a = new Ejd(); - this.b = (dk(3, iwe), new cnb(3)); - } - function i7d(a, b) { - this.e = a; - this.a = jJ; - this.b = pje(b); - this.c = b; - } - function Vid(a) { - this.c = a.c; - this.d = a.d; - this.b = a.b; - this.a = a.a; - } - function VLd(a, b, c2, d, e, f2) { - this.a = a; - NKd.call(this, b, c2, d, e, f2); - } - function aLd(a, b, c2, d, e, f2) { - this.a = a; - NKd.call(this, b, c2, d, e, f2); - } - function fge(a, b, c2, d, e, f2, g) { - return new lle(a.e, b, c2, d, e, f2, g); - } - function xhb(a, b, c2) { - return c2 >= 0 && lhb(a.substr(c2, b.length), b); - } - function hGd(a, b) { - return ZD(b, 149) && lhb(a.b, RD(b, 149).Pg()); - } - function Tde(a, b) { - return a.a ? b.Gh().Kc() : RD(b.Gh(), 71).Ii(); - } - function Qqb(a, b) { - var c2; - c2 = a.b.Qc(b); - Rqb(c2, a.b.gc()); - return c2; - } - function Ivb(a, b) { - if (a == null) { - throw Adb(new Ogb(b)); - } - return a; - } - function zYd(a) { - if (!a.u) { - yYd(a); - a.u = new w0d(a, a); + if (closedSetIds[wid]) { + continue; } - return a.u; - } - function Kx(a) { - this.a = (yob(), ZD(a, 59) ? new irb(a) : new Upb(a)); - } - function Uwd(a) { - var b; - b = RD(Ywd(a, 16), 29); - return !b ? a.ii() : b; - } - function lz(a, b) { - var c2; - c2 = nfb(a.Rm); - return b == null ? c2 : c2 + ": " + b; - } - function zhb(a, b, c2) { - AFb(b, c2, a.length); - return a.substr(b, c2 - b); - } - function VKb(a, b) { - RJb.call(this); - KKb(this); - this.a = a; - this.c = b; - } - function neb(a) { - !a ? vve : lz(a, a.ie()); - } - function Wz(a) { - Qz(); - $wnd.setTimeout(function() { - throw a; - }, 0); - } - function GHb() { - DHb(); - return cD(WC(uN, 1), jwe, 436, 0, [CHb, BHb]); - } - function OHb() { - LHb(); - return cD(WC(vN, 1), jwe, 435, 0, [JHb, KHb]); - } - function WUb() { - TUb(); - return cD(WC(BP, 1), jwe, 432, 0, [RUb, SUb]); - } - function S8b() { - P8b(); - return cD(WC(vS, 1), jwe, 517, 0, [O8b, N8b]); - } - function Rvc() { - Ovc(); - return cD(WC(lX, 1), jwe, 429, 0, [Mvc, Nvc]); - } - function buc() { - $tc(); - return cD(WC(cX, 1), jwe, 428, 0, [Ytc, Ztc]); - } - function mtc() { - jtc(); - return cD(WC($W, 1), jwe, 431, 0, [htc, itc]); - } - function vEc() { - sEc(); - return cD(WC(xX, 1), jwe, 430, 0, [qEc, rEc]); - } - function vNc() { - sNc(); - return cD(WC(MY, 1), jwe, 531, 0, [rNc, qNc]); - } - function D2c() { - x2c(); - return cD(WC(s0, 1), jwe, 501, 0, [v2c, w2c]); - } - function zQc() { - wQc(); - return cD(WC(FZ, 1), jwe, 523, 0, [vQc, uQc]); - } - function HQc() { - EQc(); - return cD(WC(GZ, 1), jwe, 522, 0, [CQc, DQc]); - } - function iTc() { - fTc(); - return cD(WC(b$, 1), jwe, 528, 0, [eTc, dTc]); - } - function Fuc() { - Cuc(); - return cD(WC(fX, 1), jwe, 488, 0, [Buc, Auc]); - } - function F8c() { - z8c(); - return cD(WC(l1, 1), jwe, 491, 0, [x8c, y8c]); - } - function H9c() { - B9c(); - return cD(WC(t12, 1), jwe, 492, 0, [z9c, A9c]); - } - function D_c() { - A_c(); - return cD(WC(K_, 1), jwe, 433, 0, [z_c, y_c]); - } - function a4c() { - Y3c(); - return cD(WC(H0, 1), jwe, 434, 0, [W3c, X3c]); - } - function gVc() { - dVc(); - return cD(WC(w$, 1), jwe, 465, 0, [bVc, cVc]); - } - function Pbd() { - Mbd(); - return cD(WC(O1, 1), jwe, 438, 0, [Lbd, Kbd]); - } - function rdd() { - ldd(); - return cD(WC(W1, 1), jwe, 437, 0, [kdd, jdd]); - } - function xqd() { - uqd(); - return cD(WC(M3, 1), jwe, 347, 0, [sqd, tqd]); - } - function Jvd(a, b, c2, d) { - return c2 >= 0 ? a.Uh(b, c2, d) : a.Ch(null, c2, d); - } - function ltd(a) { - if (a.b.b == 0) { - return a.a.sf(); - } - return Uub(a.b); - } - function vKd(a) { - if (a.p != 5) - throw Adb(new cgb()); - return Ydb(a.f); - } - function EKd(a) { - if (a.p != 5) - throw Adb(new cgb()); - return Ydb(a.k); - } - function P$d(a) { - dE(a.a) === dE((lYd(), kYd)) && Q$d(a); - return a.a; - } - function iad(a, b) { - a.b = b; - a.c > 0 && a.b > 0 && (a.g = Aad(a.c, a.b, a.a)); - } - function jad(a, b) { - a.c = b; - a.c > 0 && a.b > 0 && (a.g = Aad(a.c, a.b, a.a)); - } - function BUc(a, b) { - yUc(this, new rjd(a.a, a.b)); - zUc(this, gv(b)); - } - function Tp() { - Sp.call(this, new Usb(Sv(12))); - Lb(true); - this.a = 2; - } - function eue(a, b, c2) { - Vse(); - Wse.call(this, a); - this.b = b; - this.a = c2; - } - function C7d(a, b, c2) { - s7d(); - t7d.call(this, b); - this.a = a; - this.b = c2; - } - function qub(a) { - var b; - b = a.c.d.b; - a.b = b; - a.a = a.c.d; - b.a = a.c.d.b = a; - } - function Tub(a) { - return a.b == 0 ? null : (sFb(a.b != 0), Wub(a, a.a.a)); - } - function Xjb(a, b) { - return b == null ? Wd(qtb(a.f, null)) : Ktb(a.i, b); - } - function bzb(a, b, c2, d, e) { - return new Kzb(a, (cAb(), aAb), b, c2, d, e); - } - function Fnb(a, b) { - oFb(b); - return Hnb(a, $C(kE, Pwe, 28, b, 15, 1), b); - } - function Tx(a, b) { - Rb(a, "set1"); - Rb(b, "set2"); - return new ey(a, b); - } - function Kz(a, b) { - var c2 = Jz[a.charCodeAt(0)]; - return c2 == null ? a : c2; - } - function Xyb(a, b) { - var c2, d; - c2 = b; - d = new Gzb(); - Zyb(a, c2, d); - return d.d; - } - function EMb(a, b, c2, d) { - var e; - e = new TJb(); - b.a[c2.g] = e; - Wrb(a.b, d, e); - } - function SXb(a, b) { - var c2; - c2 = BXb(a.f, b); - return $id(fjd(c2), a.f.d); - } - function RFb(a) { - var b; - EJb(a.a); - DJb(a.a); - b = new PJb(a.a); - LJb(b); - } - function _Mb(a, b) { - $Mb(a, true); - Umb(a.e.Rf(), new dNb(a, true, b)); - } - function PSb(a, b) { - HSb(); - return a == vCd(JGd(b)) || a == vCd(LGd(b)); - } - function R0c(a, b) { - B0c(); - return RD(mQb(b, (h_c(), f_c)), 17).a == a; - } - function eE(a) { - return Math.max(Math.min(a, lve), -2147483648) | 0; - } - function sy(a) { - this.a = RD(Qb(a), 277); - this.b = (yob(), new jrb(a)); - } - function qbd(a, b, c2) { - this.i = new bnb(); - this.b = a; - this.g = b; - this.a = c2; - } - function had(a, b, c2) { - this.a = new bnb(); - this.e = a; - this.f = b; - this.c = c2; - } - function _9c(a, b, c2) { - this.c = new bnb(); - this.e = a; - this.f = b; - this.b = c2; - } - function TKb(a) { - RJb.call(this); - KKb(this); - this.a = a; - this.c = true; - } - function ieb(a) { - function b() { - } - b.prototype = a || {}; - return new b(); - } - function zfb(a) { - if (a.Ae()) { - return null; + var tempScore = gScore[cMinId] + weight8(e3); + if (!isInOpenSet(wid)) { + gScore[wid] = tempScore; + fScore[wid] = tempScore + heuristic2(w3); + addToOpenSet(w3, wid); + cameFrom[wid] = cMin; + cameFromEdge[wid] = e3; + continue; } - var b = a.n; - return eeb[b]; - } - function kzd(a) { - if (a.Db >> 16 != 3) - return null; - return RD(a.Cb, 27); - } - function MCd(a) { - if (a.Db >> 16 != 9) - return null; - return RD(a.Cb, 27); - } - function Fzd(a) { - if (a.Db >> 16 != 6) - return null; - return RD(a.Cb, 74); - } - function dVc() { - dVc = geb; - bVc = new eVc(Nye, 0); - cVc = new eVc(Oye, 1); - } - function wQc() { - wQc = geb; - vQc = new xQc(Oye, 0); - uQc = new xQc(Nye, 1); - } - function EQc() { - EQc = geb; - CQc = new FQc(Zye, 0); - DQc = new FQc("UP", 1); - } - function Is() { - Is = geb; - Hs = ss((zs(), cD(WC(RG, 1), jwe, 549, 0, [ys]))); - } - function Wx(a) { - var b; - b = new atb(Sv(a.length)); - zob(b, a); - return b; - } - function B2b(a, b) { - a.b += b.b; - a.c += b.c; - a.d += b.d; - a.a += b.a; - return a; - } - function qmb(a, b) { - if (kmb(a, b)) { - Jmb(a); - return true; + if (tempScore < gScore[wid]) { + gScore[wid] = tempScore; + fScore[wid] = tempScore + heuristic2(w3); + cameFrom[wid] = cMin; + cameFromEdge[wid] = e3; } - return false; - } - function qC(a, b) { - if (b == null) { - throw Adb(new Ngb()); - } - return rC(a, b); - } - function nB(a, b) { - var c2; - c2 = a.q.getHours(); - a.q.setDate(b); - mB(a, c2); - } - function Xvd(a, b, c2) { - var d; - d = a.Ih(b); - d >= 0 ? a.bi(d, c2) : Svd(a, b, c2); - } - function Lvd(a, b) { - var c2; - c2 = a.Ih(b); - return c2 >= 0 ? a.Wh(c2) : Rvd(a, b); - } - function zo(a, b) { - var c2; - Qb(b); - for (c2 = a.a; c2; c2 = c2.c) { - b.Yd(c2.g, c2.i); - } - } - function pMc(a, b, c2) { - var d; - d = qMc(a, b, c2); - a.b = new _Lc(d.c.length); - } - function HId(a, b, c2) { - EId(); - !!a && Zjb(DId, a, b); - !!a && Zjb(CId, a, c2); - } - function bfc(a, b) { - Rec(); - return Geb(), RD(b.a, 17).a < a ? true : false; - } - function afc(a, b) { - Rec(); - return Geb(), RD(b.b, 17).a < a ? true : false; - } - function R7b(a, b) { - return $wnd.Math.abs(a) < $wnd.Math.abs(b) ? a : b; - } - function xCd(a) { - return !a.a && (a.a = new C5d(J4, a, 10, 11)), a.a.i > 0; - } - function sId(a) { - var b; - b = a.d; - b = a.bj(a.f); - WGd(a, b); - return b.Ob(); - } - function bHd(a, b) { - var c2; - c2 = new Kub(b); - Ve(c2, a); - return new dnb(c2); - } - function qKd(a) { - if (a.p != 0) - throw Adb(new cgb()); - return Pdb(a.f, 0); - } - function zKd(a) { - if (a.p != 0) - throw Adb(new cgb()); - return Pdb(a.k, 0); - } - function gBd(a) { - if (a.Db >> 16 != 7) - return null; - return RD(a.Cb, 241); - } - function xXd(a) { - if (a.Db >> 16 != 6) - return null; - return RD(a.Cb, 241); - } - function dCd(a) { - if (a.Db >> 16 != 7) - return null; - return RD(a.Cb, 167); - } - function vCd(a) { - if (a.Db >> 16 != 11) - return null; - return RD(a.Cb, 27); - } - function uWd(a) { - if (a.Db >> 16 != 17) - return null; - return RD(a.Cb, 29); - } - function kVd(a) { - if (a.Db >> 16 != 3) - return null; - return RD(a.Cb, 155); - } - function BDb(a) { - var b; - MCb(a); - b = new _sb(); - return CDb(a, new aEb(b)); - } - function xfb(a, b) { - var c2 = a.a = a.a || []; - return c2[b] || (c2[b] = a.ve(b)); - } - function qB(a, b) { - var c2; - c2 = a.q.getHours(); - a.q.setMonth(b); - mB(a, c2); - } - function oz(a, b) { - ez(this); - this.f = b; - this.g = a; - gz(this); - this.je(); - } - function TQb(a, b) { - this.a = a; - this.c = ajd(this.a); - this.b = new Vid(b); - } - function aGb(a, b, c2) { - this.a = b; - this.c = a; - this.b = (Qb(c2), new dnb(c2)); - } - function s$b(a, b, c2) { - this.a = b; - this.c = a; - this.b = (Qb(c2), new dnb(c2)); - } - function _Kc(a) { - this.a = a; - this.b = $C(qY, Nve, 2043, a.e.length, 0, 2); - } - function fGb() { - this.a = new Iub(); - this.e = new _sb(); - this.g = 0; - this.i = 0; - } - function EId() { - EId = geb; - DId = new Tsb(); - CId = new Tsb(); - IId(zK, new JId()); - } - function KFc() { - KFc = geb; - JFc = nfd(new ufd(), (sXb(), rXb), (hcc(), $bc)); - } - function RFc() { - RFc = geb; - QFc = nfd(new ufd(), (sXb(), rXb), (hcc(), $bc)); - } - function gGc() { - gGc = geb; - fGc = nfd(new ufd(), (sXb(), rXb), (hcc(), $bc)); - } - function ANc() { - ANc = geb; - zNc = pfd(new ufd(), (sXb(), rXb), (hcc(), ybc)); - } - function dOc() { - dOc = geb; - cOc = pfd(new ufd(), (sXb(), rXb), (hcc(), ybc)); - } - function gQc() { - gQc = geb; - fQc = pfd(new ufd(), (sXb(), rXb), (hcc(), ybc)); - } - function WQc() { - WQc = geb; - VQc = pfd(new ufd(), (sXb(), rXb), (hcc(), ybc)); - } - function dZd(a, b, c2, d, e, f2) { - return new P3d(a.e, b, a.Lj(), c2, d, e, f2); - } - function $jb(a, b, c2) { - return b == null ? rtb(a.f, null, c2) : Ltb(a.i, b, c2); - } - function Y0b(a, b) { - !!a.c && Ymb(a.c.g, a); - a.c = b; - !!a.c && Rmb(a.c.g, a); - } - function g3b(a, b) { - !!a.c && Ymb(a.c.a, a); - a.c = b; - !!a.c && Rmb(a.c.a, a); - } - function P3b(a, b) { - !!a.i && Ymb(a.i.j, a); - a.i = b; - !!a.i && Rmb(a.i.j, a); - } - function Z0b(a, b) { - !!a.d && Ymb(a.d.e, a); - a.d = b; - !!a.d && Rmb(a.d.e, a); - } - function _Sc(a, b) { - !!a.a && Ymb(a.a.k, a); - a.a = b; - !!a.a && Rmb(a.a.k, a); - } - function aTc(a, b) { - !!a.b && Ymb(a.b.f, a); - a.b = b; - !!a.b && Rmb(a.b.f, a); - } - function Odd(a, b) { - Pdd(a, a.b, a.c); - RD(a.b.b, 68); - !!b && RD(b.b, 68).b; - } - function j2c(a, b) { - return Qfb(RD(a.c, 65).c.e.b, RD(b.c, 65).c.e.b); - } - function k2c(a, b) { - return Qfb(RD(a.c, 65).c.e.a, RD(b.c, 65).c.e.a); - } - function YXb(a) { - NXb(); - return Geb(), RD(a.a, 86).d.e != 0 ? true : false; - } - function LXd(a, b) { - ZD(a.Cb, 184) && (RD(a.Cb, 184).tb = null); - PAd(a, b); - } - function CWd(a, b) { - ZD(a.Cb, 90) && v$d(yYd(RD(a.Cb, 90)), 4); - PAd(a, b); - } - function _5d(a, b) { - a6d(a, b); - ZD(a.Cb, 90) && v$d(yYd(RD(a.Cb, 90)), 2); - } - function JFd(a, b) { - var c2, d; - c2 = b.c; - d = c2 != null; - d && oDd(a, new OC(b.c)); - } - function v0d(a) { - var b, c2; - c2 = (jTd(), b = new s2d(), b); - l2d(c2, a); - return c2; - } - function E4d(a) { - var b, c2; - c2 = (jTd(), b = new s2d(), b); - l2d(c2, a); - return c2; - } - function Fr(a) { - var b; - while (true) { - b = a.Pb(); - if (!a.Ob()) { - return b; - } - } - } - function nq(a, b, c2) { - Rmb(a.a, (fn(), ck(b, c2), new gp(b, c2))); - return a; - } - function rge(a, b) { - return nke(), wWd(b) ? new ole(b, a) : new Eke(b, a); - } - function ojb(a) { - Pib(); - return Ddb(a, 0) >= 0 ? jjb(a) : Xib(jjb(Odb(a))); - } - function Asb(a) { - var b; - b = RD(UEb(a.b), 9); - return new Fsb(a.a, b, a.c); - } - function Qw(a, b) { - var c2; - c2 = RD(Xv(nd(a.a), b), 16); - return !c2 ? 0 : c2.gc(); - } - function Zmb(a, b, c2) { - var d; - xFb(b, c2, a.c.length); - d = c2 - b; - $Eb(a.c, b, d); - } - function Rkb(a, b, c2) { - xFb(b, c2, a.gc()); - this.c = a; - this.a = b; - this.b = c2 - b; - } - function fgd(a) { - this.c = new Yub(); - this.b = a.b; - this.d = a.c; - this.a = a.a; - } - function qjd(a) { - this.a = $wnd.Math.cos(a); - this.b = $wnd.Math.sin(a); } - function bTc(a, b, c2, d) { - this.c = a; - this.d = d; - _Sc(this, b); - aTc(this, c2); - } - function Si(a, b) { - Qi.call(this, new Usb(Sv(a))); - dk(b, Mve); - this.a = b; - } - function Ryb(a, b, c2) { - return new Kzb(a, (cAb(), _zb), null, false, b, c2); - } - function czb(a, b, c2) { - return new Kzb(a, (cAb(), bAb), b, c2, null, false); - } - function ABb() { - xBb(); - return cD(WC(QL, 1), jwe, 108, 0, [uBb, vBb, wBb]); - } - function yLb() { - vLb(); - return cD(WC(TN, 1), jwe, 472, 0, [uLb, tLb, sLb]); - } - function HKb() { - EKb(); - return cD(WC(MN, 1), jwe, 471, 0, [CKb, BKb, DKb]); - } - function aKb() { - ZJb(); - return cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb]); - } - function DWb() { - AWb(); - return cD(WC(JP, 1), jwe, 391, 0, [yWb, xWb, zWb]); - } - function moc() { - joc(); - return cD(WC(UV, 1), jwe, 372, 0, [ioc, hoc, goc]); - } - function ytc() { - stc(); - return cD(WC(_W, 1), jwe, 322, 0, [qtc, ptc, rtc]); - } - function Htc() { - Etc(); - return cD(WC(aX, 1), jwe, 351, 0, [Btc, Dtc, Ctc]); - } - function kuc() { - huc(); - return cD(WC(dX, 1), jwe, 460, 0, [fuc, euc, guc]); - } - function Avc() { - xvc(); - return cD(WC(jX, 1), jwe, 299, 0, [vvc, wvc, uvc]); - } - function Jvc() { - Gvc(); - return cD(WC(kX, 1), jwe, 311, 0, [Evc, Fvc, Dvc]); - } - function pDc() { - lDc(); - return cD(WC(sX, 1), jwe, 390, 0, [iDc, jDc, kDc]); - } - function EEc() { - BEc(); - return cD(WC(yX, 1), jwe, 463, 0, [AEc, yEc, zEc]); - } - function NEc() { - KEc(); - return cD(WC(zX, 1), jwe, 387, 0, [HEc, IEc, JEc]); - } - function WEc() { - TEc(); - return cD(WC(AX, 1), jwe, 349, 0, [SEc, QEc, REc]); - } - function oFc() { - lFc(); - return cD(WC(CX, 1), jwe, 350, 0, [iFc, jFc, kFc]); - } - function xFc() { - uFc(); - return cD(WC(DX, 1), jwe, 352, 0, [tFc, rFc, sFc]); - } - function GFc() { - DFc(); - return cD(WC(EX, 1), jwe, 388, 0, [BFc, CFc, AFc]); - } - function UKc() { - RKc(); - return cD(WC(nY, 1), jwe, 464, 0, [OKc, PKc, QKc]); - } - function K3b(a) { - return xjd(cD(WC(l3, 1), Nve, 8, 0, [a.i.n, a.n, a.a])); - } - function OZc() { - LZc(); - return cD(WC(F_, 1), jwe, 392, 0, [KZc, JZc, IZc]); - } - function H_c() { - H_c = geb; - G_c = nfd(new ufd(), (YVc(), WVc), (WYc(), MYc)); - } - function A_c() { - A_c = geb; - z_c = new B_c("DFS", 0); - y_c = new B_c("BFS", 1); - } - function TQc(a, b, c2) { - var d; - d = new SQc(); - d.b = b; - d.a = c2; - ++b.b; - Rmb(a.d, d); - } - function NTb(a, b, c2) { - var d; - d = new sjd(c2.d); - $id(d, a); - CGd(b, d.a, d.b); - } - function Nwb(a, b) { - Mwb(a, Ydb(Cdb(Tdb(b, 24), Pxe)), Ydb(Cdb(b, Pxe))); + } + return { + found: false, + distance: void 0, + path: void 0, + steps + }; + }, "aStar") + }; + floydWarshallDefaults = defaults$g({ + weight: /* @__PURE__ */ __name(function weight3(edge) { + return 1; + }, "weight"), + directed: false + }); + elesfn$r = { + // Implemented from pseudocode from wikipedia + floydWarshall: /* @__PURE__ */ __name(function floydWarshall2(options3) { + var cy = this.cy(); + var _floydWarshallDefault = floydWarshallDefaults(options3), weight8 = _floydWarshallDefault.weight, directed = _floydWarshallDefault.directed; + var weightFn = weight8; + var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges; + var N2 = nodes6.length; + var Nsq = N2 * N2; + var indexOf2 = /* @__PURE__ */ __name(function indexOf3(node2) { + return nodes6.indexOf(node2); + }, "indexOf"); + var atIndex = /* @__PURE__ */ __name(function atIndex2(i3) { + return nodes6[i3]; + }, "atIndex"); + var dist3 = new Array(Nsq); + for (var n2 = 0; n2 < Nsq; n2++) { + var j2 = n2 % N2; + var i2 = (n2 - j2) / N2; + if (i2 === j2) { + dist3[n2] = 0; + } else { + dist3[n2] = Infinity; } - function wFb(a, b) { - if (a < 0 || a > b) { - throw Adb(new veb(cye + a + dye + b)); - } + } + var next3 = new Array(Nsq); + var edgeNext = new Array(Nsq); + for (var _i = 0; _i < edges5.length; _i++) { + var edge = edges5[_i]; + var src = edge.source()[0]; + var tgt = edge.target()[0]; + if (src === tgt) { + continue; } - function tFb(a, b) { - if (a < 0 || a >= b) { - throw Adb(new veb(cye + a + dye + b)); - } + var s2 = indexOf2(src); + var t4 = indexOf2(tgt); + var st2 = s2 * N2 + t4; + var _weight = weightFn(edge); + if (dist3[st2] > _weight) { + dist3[st2] = _weight; + next3[st2] = t4; + edgeNext[st2] = edge; } - function BFb(a, b) { - if (a < 0 || a >= b) { - throw Adb(new eib(cye + a + dye + b)); + if (!directed) { + var ts = t4 * N2 + s2; + if (!directed && dist3[ts] > _weight) { + dist3[ts] = _weight; + next3[ts] = s2; + edgeNext[ts] = edge; } } - function Swb(a, b) { - this.b = (uFb(a), a); - this.a = (b & qxe) == 0 ? b | 64 | Ove : b; - } - function ODb(a) { - var b; - MCb(a); - b = (urb(), urb(), srb); - return PDb(a, b); - } - function R9c(a, b, c2) { - var d; - d = S9c(a, b, false); - return d.b <= b && d.a <= c2; - } - function h9c() { - b9c(); - return cD(WC(o1, 1), jwe, 439, 0, [$8c, a9c, _8c]); - } - function c7c() { - _6c(); - return cD(WC(a1, 1), jwe, 394, 0, [Z6c, $6c, Y6c]); - } - function i6c() { - f6c(); - return cD(WC(V0, 1), jwe, 445, 0, [c6c, d6c, e6c]); - } - function D6c() { - z6c(); - return cD(WC(Z0, 1), jwe, 456, 0, [w6c, y6c, x6c]); - } - function k4c() { - g4c(); - return cD(WC(I0, 1), jwe, 393, 0, [d4c, e4c, f4c]); - } - function x5c() { - t5c(); - return cD(WC(N0, 1), jwe, 300, 0, [r5c, s5c, q5c]); - } - function Ind() { - Fnd(); - return cD(WC(y3, 1), jwe, 346, 0, [Dnd, Cnd, End]); - } - function jbd() { - gbd(); - return cD(WC(I1, 1), jwe, 444, 0, [dbd, ebd, fbd]); - } - function Rmd() { - Omd(); - return cD(WC(t32, 1), jwe, 278, 0, [Lmd, Mmd, Nmd]); - } - function pqd() { - mqd(); - return cD(WC(J3, 1), jwe, 280, 0, [kqd, jqd, lqd]); - } - function bv(a) { - Qb(a); - return ZD(a, 16) ? new dnb(RD(a, 16)) : cv(a.Kc()); - } - function Hz(a, b) { - return !!a && !!a.equals ? a.equals(b) : dE(a) === dE(b); - } - function Cdb(a, b) { - return Edb(tD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b)); - } - function Rdb(a, b) { - return Edb(zD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b)); - } - function $db(a, b) { - return Edb(HD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b)); - } - function xs(a, b) { - var c2; - c2 = (uFb(a), a).g; - lFb(!!c2); - uFb(b); - return c2(b); - } - function rv(a, b) { - var c2, d; - d = tv(a, b); - c2 = a.a.fd(d); - return new Gv(a, c2); - } - function CXd(a) { - if (a.Db >> 16 != 6) - return null; - return RD(yvd(a), 241); - } - function sKd(a) { - if (a.p != 2) - throw Adb(new cgb()); - return Ydb(a.f) & Bwe; - } - function BKd(a) { - if (a.p != 2) - throw Adb(new cgb()); - return Ydb(a.k) & Bwe; - } - function ynb(a) { - sFb(a.a < a.c.c.length); - a.b = a.a++; - return a.c.c[a.b]; - } - function $Gb(a, b) { - a.b = a.b | b.b; - a.c = a.c | b.c; - a.d = a.d | b.d; - a.a = a.a | b.a; - } - function NJb(a, b) { - var c2; - c2 = Kfb(UD(a.a.of((umd(), cmd)))); - OJb(a, b, c2); - } - function bjb(a, b) { - cjb.call(this, 1, 2, cD(WC(kE, 1), Pwe, 28, 15, [a, b])); - } - function Yte(a, b, c2) { - Wse.call(this, 25); - this.b = a; - this.a = b; - this.c = c2; - } - function xte(a) { - Vse(); - Wse.call(this, a); - this.c = false; - this.a = false; - } - function xfe(a) { - a.a == (ree(), qee) && Dfe(a, see(a.g, a.b)); - return a.a; - } - function zfe(a) { - a.d == (ree(), qee) && Ffe(a, wee(a.g, a.b)); - return a.d; - } - function IZb(a, b) { - CZb(); - return a.c == b.c ? Qfb(b.d, a.d) : Qfb(b.c, a.c); - } - function GZb(a, b) { - CZb(); - return a.c == b.c ? Qfb(b.d, a.d) : Qfb(a.c, b.c); - } - function HZb(a, b) { - CZb(); - return a.c == b.c ? Qfb(a.d, b.d) : Qfb(a.c, b.c); - } - function JZb(a, b) { - CZb(); - return a.c == b.c ? Qfb(a.d, b.d) : Qfb(b.c, a.c); - } - function Yrb(a, b) { - return Dsb(a.a, b) ? _Eb(a.b, RD(b, 22).g, null) : null; - } - function Lwb(a) { - return Bdb(Sdb(Hdb(Kwb(a, 32)), 32), Hdb(Kwb(a, 32))); - } - function kUb(a) { - return a.b == null || a.b.length == 0 ? "n_" + a.a : "n_" + a.b; - } - function aXc(a) { - return a.c == null || a.c.length == 0 ? "n_" + a.g : "n_" + a.c; - } - function wYc(a, b) { - var c2; - c2 = a + ""; - while (c2.length < b) { - c2 = "0" + c2; - } - return c2; - } - function vkc(a, b) { - var c2; - c2 = RD(Wjb(a.g, b), 60); - Umb(b.d, new ulc(a, c2)); - } - function J_b(a, b) { - var c2, d; - c2 = l2b(a); - d = l2b(b); - return c2 < d ? -1 : c2 > d ? 1 : 0; - } - function Hmc(a, b) { - var c2, d; - c2 = Gmc(b); - d = c2; - return RD(Wjb(a.c, d), 17).a; - } - function CMc(a, b, c2) { - var d; - d = a.d[b.p]; - a.d[b.p] = a.d[c2.p]; - a.d[c2.p] = d; - } - function Jqd(a, b, c2) { - var d; - if (a.n && !!b && !!c2) { - d = new otd(); - Rmb(a.e, d); - } - } - function gYb(a, b) { - Ysb(a.a, b); - if (b.d) { - throw Adb(new yz(jye)); - } - b.d = a; - } - function Had(a, b) { - this.a = new bnb(); - this.d = new bnb(); - this.f = a; - this.c = b; - } - function RWb() { - this.c = new dXb(); - this.a = new I_b(); - this.b = new E0b(); - g0b(); - } - function med() { - hed(); - this.b = new Tsb(); - this.a = new Tsb(); - this.c = new bnb(); - } - function KKd(a, b, c2) { - this.d = a; - this.j = b; - this.e = c2; - this.o = -1; - this.p = 3; - } - function LKd(a, b, c2) { - this.d = a; - this.k = b; - this.f = c2; - this.o = -1; - this.p = 5; - } - function S3d(a, b, c2, d, e, f2) { - R3d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function U3d(a, b, c2, d, e, f2) { - T3d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function W3d(a, b, c2, d, e, f2) { - V3d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function Y3d(a, b, c2, d, e, f2) { - X3d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function $3d(a, b, c2, d, e, f2) { - Z3d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function a4d(a, b, c2, d, e, f2) { - _3d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function f4d(a, b, c2, d, e, f2) { - e4d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function h4d(a, b, c2, d, e, f2) { - g4d.call(this, a, b, c2, d, e); - f2 && (this.o = -2); - } - function N7d(a, b, c2, d) { - t7d.call(this, c2); - this.b = a; - this.c = b; - this.d = d; - } - function mfe(a, b) { - this.f = a; - this.a = (ree(), pee); - this.c = pee; - this.b = b; - } - function Jfe(a, b) { - this.g = a; - this.d = (ree(), qee); - this.a = qee; - this.b = b; - } - function Gme(a, b) { - !a.c && (a.c = new Uge(a, 0)); - Fge(a.c, (nme(), fme), b); - } - function Oge(a, b) { - return Pge(a, b, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0); - } - function lB(a, b) { - return Agb(Hdb(a.q.getTime()), Hdb(b.q.getTime())); - } - function gj(a) { - return fk(a.e.Rd().gc() * a.c.Rd().gc(), 16, new qj(a)); - } - function CYd(a) { - return !!a.u && tYd(a.u.a).i != 0 && !(!!a.n && d$d(a.n)); - } - function p4d(a) { - return !!a.a && o4d(a.a.a).i != 0 && !(!!a.b && o5d(a.b)); - } - function Cxd(a, b) { - if (b == 0) { - return !!a.o && a.o.f != 0; - } - return Kvd(a, b); - } - function Cc(a, b, c2) { - var d; - d = RD(a.Zb().xc(b), 16); - return !!d && d.Hc(c2); - } - function Gc(a, b, c2) { - var d; - d = RD(a.Zb().xc(b), 16); - return !!d && d.Mc(c2); - } - function _yb(a, b) { - var c2; - c2 = 1 - b; - a.a[c2] = azb(a.a[c2], c2); - return azb(a, b); - } - function DFb(a, b) { - var c2, d; - d = Cdb(a, yxe); - c2 = Sdb(b, 32); - return Rdb(c2, d); - } - function bGb(a, b, c2) { - var d; - d = (Qb(a), new dnb(a)); - _Fb(new aGb(d, b, c2)); - } - function t$b(a, b, c2) { - var d; - d = (Qb(a), new dnb(a)); - r$b(new s$b(d, b, c2)); - } - function vBd(a, b, c2, d, e, f2) { - wBd(a, b, c2, f2); - EYd(a, d); - FYd(a, e); - return a; - } - function Xhb(a, b, c2, d) { - a.a += "" + zhb(b == null ? vve : jeb(b), c2, d); - return a; - } - function Jkb(a, b) { - this.a = a; - Dkb.call(this, a); - wFb(b, a.gc()); - this.b = b; - } - function xmb(a) { - this.a = $C(jJ, rve, 1, mgb($wnd.Math.max(8, a)) << 1, 5, 1); - } - function t2b(a) { - return RD(anb(a, $C(jR, WAe, 10, a.c.length, 0, 1)), 199); - } - function s2b(a) { - return RD(anb(a, $C(WQ, VAe, 18, a.c.length, 0, 1)), 483); - } - function Iyb(a) { - return !a.a ? a.c : a.e.length == 0 ? a.a.a : a.a.a + ("" + a.e); - } - function Rib(a) { - while (a.d > 0 && a.a[--a.d] == 0) - ; - a.a[a.d++] == 0 && (a.e = 0); - } - function fvb(a) { - sFb(a.b.b != a.d.a); - a.c = a.b = a.b.b; - --a.a; - return a.c.c; - } - function sRc(a, b, c2) { - a.a = b; - a.c = c2; - a.b.a.$b(); - Xub(a.d); - aFb(a.e.a.c, 0); - } - function Z5c(a, b) { - var c2; - a.e = new R5c(); - c2 = Q2c(b); - _mb(c2, a.c); - $5c(a, c2, 0); - } - function zgd(a, b, c2, d) { - var e; - e = new Hgd(); - e.a = b; - e.b = c2; - e.c = d; - Mub(a.a, e); - } - function Agd(a, b, c2, d) { - var e; - e = new Hgd(); - e.a = b; - e.b = c2; - e.c = d; - Mub(a.b, e); - } - function Tb(a, b, c2) { - if (a < 0 || b < a || b > c2) { - throw Adb(new veb(Kb(a, b, c2))); - } - } - function Pb(a, b) { - if (a < 0 || a >= b) { - throw Adb(new veb(Ib(a, b))); - } - return a; - } - function qz(b) { - if (!("stack" in b)) { - try { - throw b; - } catch (a) { + } + for (var k2 = 0; k2 < N2; k2++) { + for (var _i2 = 0; _i2 < N2; _i2++) { + var ik = _i2 * N2 + k2; + for (var _j = 0; _j < N2; _j++) { + var ij = _i2 * N2 + _j; + var kj = k2 * N2 + _j; + if (dist3[ik] + dist3[kj] < dist3[ij]) { + dist3[ij] = dist3[ik] + dist3[kj]; + next3[ij] = next3[ik]; } } - return b; - } - function Zjc(a) { - Wjc(); - if (ZD(a.g, 10)) { - return RD(a.g, 10); - } - return null; - } - function nx(a) { - if (Ih(a).dc()) { - return false; - } - Jh(a, new rx()); - return true; - } - function Xdb(a) { - var b; - if (Kdb(a)) { - b = a; - return b == -0 ? 0 : b; - } - return ED(a); - } - function lkb(a, b) { - if (ZD(b, 44)) { - return Jd(a.a, RD(b, 44)); - } - return false; - } - function gsb(a, b) { - if (ZD(b, 44)) { - return Jd(a.a, RD(b, 44)); - } - return false; - } - function vub(a, b) { - if (ZD(b, 44)) { - return Jd(a.a, RD(b, 44)); - } - return false; } - function RCb(a) { - var b; - LCb(a); - b = new Prb(); - ixb(a.a, new fDb(b)); - return b; - } - function Vae() { - var a, b, c2; - b = (c2 = (a = new s2d(), a), c2); - Rmb(Rae, b); - return b; - } - function mDb(a) { - var b; - LCb(a); - b = new ltb(); - ixb(a.a, new uDb(b)); - return b; - } - function jDb(a, b) { - if (a.a <= a.b) { - b.Dd(a.a++); - return true; + } + var getArgEle = /* @__PURE__ */ __name(function getArgEle2(ele) { + return (string(ele) ? cy.filter(ele) : ele)[0]; + }, "getArgEle"); + var indexOfArgEle = /* @__PURE__ */ __name(function indexOfArgEle2(ele) { + return indexOf2(getArgEle(ele)); + }, "indexOfArgEle"); + var res = { + distance: /* @__PURE__ */ __name(function distance2(from2, to) { + var i3 = indexOfArgEle(from2); + var j3 = indexOfArgEle(to); + return dist3[i3 * N2 + j3]; + }, "distance"), + path: /* @__PURE__ */ __name(function path4(from2, to) { + var i3 = indexOfArgEle(from2); + var j3 = indexOfArgEle(to); + var fromNode = atIndex(i3); + if (i3 === j3) { + return fromNode.collection(); } - return false; - } - function xzb(a) { - yzb.call(this, a, (cAb(), $zb), null, false, null, false); - } - function $Rb() { - $Rb = geb; - ZRb = ss((VRb(), cD(WC($O, 1), jwe, 489, 0, [URb]))); - } - function CHc() { - CHc = geb; - BHc = yx(sgb(1), sgb(4)); - AHc = yx(sgb(1), sgb(2)); - } - function yXc(a, b) { - return new gud(b, njd(ajd(b.e), a, a), (Geb(), true)); - } - function fv(a) { - return new cnb((dk(a, lwe), dz(Bdb(Bdb(5, a), a / 10 | 0)))); - } - function Wi(a) { - return fk(a.e.Rd().gc() * a.c.Rd().gc(), 273, new kj(a)); - } - function u2b(a) { - return RD(anb(a, $C(xR, XAe, 12, a.c.length, 0, 1)), 2042); - } - function COc(a) { - dOc(); - return !W0b(a) && !(!W0b(a) && a.c.i.c == a.d.i.c); - } - function Y_c(a, b) { - R_c(); - return RD(mQb(b, (h_c(), W$c)), 17).a >= a.gc(); - } - function q8b(a, b) { - w8b(b, a); - y8b(a.d); - y8b(RD(mQb(a, (yCc(), cBc)), 214)); - } - function r8b(a, b) { - z8b(b, a); - B8b(a.d); - B8b(RD(mQb(a, (yCc(), cBc)), 214)); - } - function $0b(a, b, c2) { - !!a.d && Ymb(a.d.e, a); - a.d = b; - !!a.d && Qmb(a.d.e, c2, a); - } - function jPb(a, b, c2) { - return c2.f.c.length > 0 ? yPb(a.a, b, c2) : yPb(a.b, b, c2); - } - function Uz(a, b, c2) { - var d; - d = Sz(); - try { - return Rz(a, b, c2); - } finally { - Vz(d); - } - } - function wDd(a, b) { - var c2, d; - c2 = qC(a, b); - d = null; - !!c2 && (d = c2.pe()); - return d; - } - function yDd(a, b) { - var c2, d; - c2 = qC(a, b); - d = null; - !!c2 && (d = c2.se()); - return d; - } - function xDd(a, b) { - var c2, d; - c2 = JB(a, b); - d = null; - !!c2 && (d = c2.se()); - return d; - } - function zDd(a, b) { - var c2, d; - c2 = qC(a, b); - d = null; - !!c2 && (d = ADd(c2)); - return d; - } - function rEd(a, b, c2) { - var d; - d = uDd(c2); - Do(a.g, d, b); - Do(a.i, b, c2); - return b; - } - function UIc(a, b, c2) { - this.d = new fJc(this); - this.e = a; - this.i = b; - this.f = c2; - } - function Mk(a, b, c2, d) { - this.e = null; - this.c = a; - this.d = b; - this.a = c2; - this.b = d; - } - function urc(a, b, c2, d) { - nrc(this); - this.c = a; - this.e = b; - this.f = c2; - this.b = d; - } - function MKd(a, b, c2, d) { - this.d = a; - this.n = b; - this.g = c2; - this.o = d; - this.p = -1; - } - function Vc(a, b, c2, d) { - return ZD(c2, 59) ? new Kg(a, b, c2, d) : new yg(a, b, c2, d); - } - function gr(a) { - if (ZD(a, 16)) { - return RD(a, 16).dc(); - } - return !a.Kc().Ob(); - } - function Wo(a) { - if (a.e.g != a.b) { - throw Adb(new Jrb()); - } - return !!a.c && a.d > 0; - } - function evb(a) { - sFb(a.b != a.d.c); - a.c = a.b; - a.b = a.b.a; - ++a.a; - return a.c.c; - } - function imb(a, b) { - uFb(b); - bD(a.a, a.c, b); - a.c = a.c + 1 & a.a.length - 1; - mmb(a); - } - function hmb(a, b) { - uFb(b); - a.b = a.b - 1 & a.a.length - 1; - bD(a.a, a.b, b); - mmb(a); - } - function _je(a) { - var b; - b = a.Gh(); - this.a = ZD(b, 71) ? RD(b, 71).Ii() : b.Kc(); - } - function px(a) { - return new Swb(Dob(RD(a.a.md(), 16).gc(), a.a.ld()), 16); - } - function Abd() { - Abd = geb; - zbd = ss((sbd(), cD(WC(M1, 1), jwe, 490, 0, [rbd]))); - } - function Jbd() { - Jbd = geb; - Ibd = ss((Cbd(), cD(WC(N1, 1), jwe, 558, 0, [Bbd]))); - } - function idd() { - idd = geb; - hdd = ss((_cd(), cD(WC(V1, 1), jwe, 539, 0, [$cd]))); - } - function X$b() { - U$b(); - return cD(WC(CQ, 1), jwe, 389, 0, [T$b, R$b, Q$b, S$b]); - } - function hAb() { - cAb(); - return cD(WC(AL, 1), jwe, 304, 0, [$zb, _zb, aAb, bAb]); - } - function LPb() { - IPb(); - return cD(WC(DO, 1), jwe, 332, 0, [FPb, EPb, GPb, HPb]); - } - function LRb() { - IRb(); - return cD(WC(WO, 1), jwe, 406, 0, [FRb, ERb, GRb, HRb]); - } - function pOb() { - mOb(); - return cD(WC(hO, 1), jwe, 417, 0, [lOb, iOb, jOb, kOb]); - } - function uZb() { - nZb(); - return cD(WC(lQ, 1), jwe, 416, 0, [jZb, mZb, kZb, lZb]); - } - function hnc() { - enc(); - return cD(WC(LV, 1), jwe, 421, 0, [anc, bnc, cnc, dnc]); - } - function zec() { - vec(); - return cD(WC(qT, 1), jwe, 371, 0, [uec, sec, tec, rec]); - } - function BDc() { - wDc(); - return cD(WC(tX, 1), jwe, 203, 0, [uDc, vDc, tDc, sDc]); - } - function nEc() { - kEc(); - return cD(WC(wX, 1), jwe, 284, 0, [hEc, gEc, iEc, jEc]); - } - function Unc(a) { - var b; - return a.j == (qpd(), npd) && (b = Vnc(a), Csb(b, Xod)); - } - function qhc(a, b) { - var c2; - c2 = b.a; - Y0b(c2, b.c.d); - Z0b(c2, b.d.d); - Cjd(c2.a, a.n); - } - function _5b(a, b) { - var c2; - c2 = RD(cub(a.b, b), 67); - !c2 && (c2 = new Yub()); - return c2; - } - function $jc(a) { - Wjc(); - if (ZD(a.g, 154)) { - return RD(a.g, 154); + if (next3[i3 * N2 + j3] == null) { + return cy.collection(); } - return null; + var path5 = cy.collection(); + var prev2 = i3; + var edge2; + path5.merge(fromNode); + while (i3 !== j3) { + prev2 = i3; + i3 = next3[i3 * N2 + j3]; + edge2 = edgeNext[prev2 * N2 + i3]; + path5.merge(edge2); + path5.merge(atIndex(i3)); + } + return path5; + }, "path") + }; + return res; + }, "floydWarshall") + // floydWarshall + }; + bellmanFordDefaults = defaults$g({ + weight: /* @__PURE__ */ __name(function weight4(edge) { + return 1; + }, "weight"), + directed: false, + root: null + }); + elesfn$q = { + // Implemented from pseudocode from wikipedia + bellmanFord: /* @__PURE__ */ __name(function bellmanFord(options3) { + var _this = this; + var _bellmanFordDefaults = bellmanFordDefaults(options3), weight8 = _bellmanFordDefaults.weight, directed = _bellmanFordDefaults.directed, root4 = _bellmanFordDefaults.root; + var weightFn = weight8; + var eles = this; + var cy = this.cy(); + var _this$byGroup = this.byGroup(), edges5 = _this$byGroup.edges, nodes6 = _this$byGroup.nodes; + var numNodes = nodes6.length; + var infoMap = new Map$2(); + var hasNegativeWeightCycle = false; + var negativeWeightCycles = []; + root4 = cy.collection(root4)[0]; + edges5.unmergeBy(function(edge2) { + return edge2.isLoop(); + }); + var numEdges = edges5.length; + var getInfo3 = /* @__PURE__ */ __name(function getInfo4(node3) { + var obj = infoMap.get(node3.id()); + if (!obj) { + obj = {}; + infoMap.set(node3.id(), obj); } - function gRc(a) { - a.a = null; - a.e = null; - aFb(a.b.c, 0); - aFb(a.f.c, 0); - a.c = null; - } - function Ovc() { - Ovc = geb; - Mvc = new Pvc(Kye, 0); - Nvc = new Pvc("TOP_LEFT", 1); - } - function sNc() { - sNc = geb; - rNc = new tNc("UPPER", 0); - qNc = new tNc("LOWER", 1); - } - function nWc(a, b) { - return cjd(new rjd(b.e.a + b.f.a / 2, b.e.b + b.f.b / 2), a); - } - function wqc(a, b) { - return RD(Lvb(JDb(RD(Qc(a.k, b), 15).Oc(), lqc)), 113); - } - function xqc(a, b) { - return RD(Lvb(KDb(RD(Qc(a.k, b), 15).Oc(), lqc)), 113); - } - function cWc() { - YVc(); - return cD(WC(H$, 1), jwe, 405, 0, [UVc, VVc, WVc, XVc]); - } - function v_c() { - s_c(); - return cD(WC(J_, 1), jwe, 353, 0, [r_c, p_c, q_c, o_c]); - } - function n5c() { - j5c(); - return cD(WC(M0, 1), jwe, 354, 0, [i5c, g5c, h5c, f5c]); - } - function Tpd() { - Qpd(); - return cD(WC(H3, 1), jwe, 386, 0, [Opd, Ppd, Npd, Mpd]); - } - function Tnd() { - Pnd(); - return cD(WC(z3, 1), jwe, 291, 0, [Ond, Lnd, Mnd, Nnd]); - } - function _md() { - Ymd(); - return cD(WC(u3, 1), jwe, 223, 0, [Xmd, Vmd, Umd, Wmd]); - } - function Jrd() { - Grd(); - return cD(WC(R3, 1), jwe, 320, 0, [Frd, Crd, Erd, Drd]); - } - function wtd() { - ttd(); - return cD(WC(n4, 1), jwe, 415, 0, [qtd, rtd, ptd, std]); - } - function GId(a) { - EId(); - return Ujb(DId, a) ? RD(Wjb(DId, a), 341).Qg() : null; - } - function Avd(a, b, c2) { - return b < 0 ? Rvd(a, c2) : RD(c2, 69).wk().Bk(a, a.hi(), b); - } - function sEd(a, b, c2) { - var d; - d = uDd(c2); - Do(a.j, d, b); - Zjb(a.k, b, c2); - return b; - } - function qEd(a, b, c2) { - var d; - d = uDd(c2); - Do(a.d, d, b); - Zjb(a.e, b, c2); - return b; - } - function DGd(a) { - var b, c2; - b = (bvd(), c2 = new rzd(), c2); - !!a && pzd(b, a); - return b; - } - function WHd(a) { - var b; - b = a.aj(a.i); - a.i > 0 && hib(a.g, 0, b, 0, a.i); - return b; - } - function Led(a, b) { - var c2; - for (c2 = a.j.c.length; c2 < b; c2++) { - Rmb(a.j, a.Ng()); - } - } - function $Ec(a, b, c2, d) { - var e; - e = d[b.g][c2.g]; - return Kfb(UD(mQb(a.a, e))); - } - function QRd(a, b) { - PRd(); - var c2; - c2 = RD(Wjb(ORd, a), 57); - return !c2 || c2.fk(b); - } - function rKd(a) { - if (a.p != 1) - throw Adb(new cgb()); - return Ydb(a.f) << 24 >> 24; - } - function AKd(a) { - if (a.p != 1) - throw Adb(new cgb()); - return Ydb(a.k) << 24 >> 24; - } - function GKd(a) { - if (a.p != 7) - throw Adb(new cgb()); - return Ydb(a.k) << 16 >> 16; - } - function xKd(a) { - if (a.p != 7) - throw Adb(new cgb()); - return Ydb(a.f) << 16 >> 16; - } - function Wib(a, b) { - if (b.e == 0 || a.e == 0) { - return Oib; - } - return Ljb(), Mjb(a, b); - } - function Nd(a, b) { - return dE(b) === dE(a) ? "(this Map)" : b == null ? vve : jeb(b); - } - function MFb(a, b, c2) { - return Jfb(UD(Wd(qtb(a.f, b))), UD(Wd(qtb(a.f, c2)))); - } - function wkc(a, b, c2) { - var d; - d = RD(Wjb(a.g, c2), 60); - Rmb(a.a.c, new Ptd(b, d)); - } - function Slc(a, b, c2) { - a.i = 0; - a.e = 0; - if (b == c2) { - return; - } - Rlc(a, b, c2); - Qlc(a, b, c2); - } - function rTc(a, b, c2, d, e) { - var f2; - f2 = mTc(e, c2, d); - Rmb(b, TSc(e, f2)); - vTc(a, e, b); - } - function Jrc(a, b, c2, d, e) { - this.i = a; - this.a = b; - this.e = c2; - this.j = d; - this.f = e; - } - function iUb(a, b) { - VTb.call(this); - this.a = a; - this.b = b; - Rmb(this.a.b, this); - } - function rTb(a) { - this.b = new Tsb(); - this.c = new Tsb(); - this.d = new Tsb(); - this.a = a; - } - function Dx(a, b) { - var c2; - c2 = new cib(); - a.Gd(c2); - c2.a += ".."; - b.Hd(c2); - return c2.a; - } - function Fsd(a, b) { - var c2; - c2 = b; - while (c2) { - Zid(a, c2.i, c2.j); - c2 = vCd(c2); - } - return a; - } - function pEd(a, b, c2) { - var d; - d = uDd(c2); - Zjb(a.b, d, b); - Zjb(a.c, b, c2); - return b; - } - function Kr(a) { - var b; - b = 0; - while (a.Ob()) { - a.Pb(); - b = Bdb(b, 1); - } - return dz(b); - } - function oke(a, b) { - nke(); - var c2; - c2 = RD(a, 69).vk(); - K6d(c2, b); - return c2.xl(b); - } - function tC(d, a, b) { - if (b) { - var c2 = b.oe(); - d.a[a] = c2(b); - } else { - delete d.a[a]; + return obj; + }, "getInfo"); + var getNodeFromTo = /* @__PURE__ */ __name(function getNodeFromTo2(to) { + return (string(to) ? cy.$(to) : to)[0]; + }, "getNodeFromTo"); + var distanceTo = /* @__PURE__ */ __name(function distanceTo2(to) { + return getInfo3(getNodeFromTo(to)).dist; + }, "distanceTo"); + var pathTo = /* @__PURE__ */ __name(function pathTo2(to) { + var thisStart = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : root4; + var end2 = getNodeFromTo(to); + var path4 = []; + var node3 = end2; + for (; ; ) { + if (node3 == null) { + return _this.spawn(); } - } - function tB(a, b) { - var c2; - c2 = a.q.getHours(); - a.q.setFullYear(b + Owe); - mB(a, c2); - } - function KSd(a, b) { - return RD(b == null ? Wd(qtb(a.f, null)) : Ktb(a.i, b), 288); - } - function hOc(a, b) { - return a == (r3b(), p3b) && b == p3b ? 4 : a == p3b || b == p3b ? 8 : 32; - } - function cge(a, b, c2) { - return dge(a, b, c2, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0); - } - function jge(a, b, c2) { - return kge(a, b, c2, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0); - } - function Qge(a, b, c2) { - return Rge(a, b, c2, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0); - } - function jmb(a) { - if (a.b == a.c) { - return; + var _getInfo = getInfo3(node3), edge2 = _getInfo.edge, pred = _getInfo.pred; + path4.unshift(node3[0]); + if (node3.same(thisStart) && path4.length > 0) { + break; } - a.a = $C(jJ, rve, 1, 8, 5, 1); - a.b = 0; - a.c = 0; - } - function Nsb(a) { - sFb(a.a < a.c.a.length); - a.b = a.a; - Lsb(a); - return a.c.b[a.b]; - } - function tYd(a) { - if (!a.n) { - yYd(a); - a.n = new h$d(a, o7, a); - zYd(a); + if (edge2 != null) { + path4.unshift(edge2); } - return a.n; + node3 = pred; } - function oFb(a) { - if (a < 0) { - throw Adb(new Mgb("Negative array size: " + a)); - } + return eles.spawn(path4); + }, "pathTo"); + for (var i2 = 0; i2 < numNodes; i2++) { + var node2 = nodes6[i2]; + var info2 = getInfo3(node2); + if (node2.same(root4)) { + info2.dist = 0; + } else { + info2.dist = Infinity; } - function LB(d, a, b) { - if (b) { - var c2 = b.oe(); - b = c2(b); - } else { - b = void 0; - } - d.a[a] = b; + info2.pred = null; + info2.edge = null; + } + var replacedEdge = false; + var checkForEdgeReplacement = /* @__PURE__ */ __name(function checkForEdgeReplacement2(node1, node22, edge2, info1, info22, weight9) { + var dist3 = info1.dist + weight9; + if (dist3 < info22.dist && !edge2.same(info1.edge)) { + info22.dist = dist3; + info22.pred = node1; + info22.edge = edge2; + replacedEdge = true; } - function ygc(a, b) { - sgc(); - var c2; - c2 = a.j.g - b.j.g; - if (c2 != 0) { - return c2; + }, "checkForEdgeReplacement"); + for (var _i = 1; _i < numNodes; _i++) { + replacedEdge = false; + for (var e3 = 0; e3 < numEdges; e3++) { + var edge = edges5[e3]; + var src = edge.source(); + var tgt = edge.target(); + var _weight = weightFn(edge); + var srcInfo = getInfo3(src); + var tgtInfo = getInfo3(tgt); + checkForEdgeReplacement(src, tgt, edge, srcInfo, tgtInfo, _weight); + if (!directed) { + checkForEdgeReplacement(tgt, src, edge, tgtInfo, srcInfo, _weight); } - return 0; } - function l_d(a, b) { - gib(); - return WGd(xYd(a.a), b); - } - function q_d(a, b) { - gib(); - return WGd(xYd(a.a), b); - } - function ajb(a, b) { - Pib(); - cjb.call(this, a, 1, cD(WC(kE, 1), Pwe, 28, 15, [b])); - } - function Kte(a, b) { - Vse(); - Wse.call(this, a); - this.a = b; - this.c = -1; - this.b = -1; - } - function L3d(a, b, c2, d) { - KKd.call(this, 1, c2, d); - this.c = a; - this.b = b; - } - function M3d(a, b, c2, d) { - LKd.call(this, 1, c2, d); - this.c = a; - this.b = b; - } - function lle(a, b, c2, d, e, f2, g) { - NKd.call(this, b, d, e, f2, g); - this.c = a; - this.a = c2; - } - function j7d(a, b, c2) { - this.e = a; - this.a = jJ; - this.b = pje(b); - this.c = b; - this.d = c2; - } - function Xo(a) { - this.e = a; - this.c = this.e.a; - this.b = this.e.g; - this.d = this.e.i; - } - function Qtb(a) { - this.d = a; - this.b = this.d.a.entries(); - this.a = this.b.next(); - } - function N9d(a) { - this.c = a; - this.a = RD(WVd(a), 156); - this.b = this.a.jk().wi(); - } - function gub() { - Tsb.call(this); - _tb(this); - this.d.b = this.d; - this.d.a = this.d; - } - function Pub(a, b, c2, d) { - var e; - e = new svb(); - e.c = b; - e.b = c2; - e.a = d; - d.b = c2.a = e; - ++a.b; - } - function USd(a, b) { - var c2; - return c2 = b != null ? Xjb(a, b) : Wd(qtb(a.f, b)), fE(c2); - } - function dTd(a, b) { - var c2; - return c2 = b != null ? Xjb(a, b) : Wd(qtb(a.f, b)), fE(c2); - } - function zDb(a, b) { - var c2; - return b.b.Kb(LDb(a, b.c.Xe(), (c2 = new OEb(b), c2))); - } - function Gnb(a, b) { - var c2; - oFb(b); - return c2 = a.slice(0, b), c2.length = b, dD(c2, a); - } - function Rqb(a, b) { - var c2; - for (c2 = 0; c2 < b; ++c2) { - bD(a, c2, new brb(RD(a[c2], 44))); - } - } - function Tib(a, b) { - var c2; - for (c2 = a.d - 1; c2 >= 0 && a.a[c2] === b[c2]; c2--) - ; - return c2 < 0; - } - function Xx(a) { - var b; - if (a) { - return new Kub(a); - } - b = new Iub(); - _q(b, a); - return b; - } - function nmc(a, b) { - var c2, d; - d = false; - do { - c2 = qmc(a, b); - d = d | c2; - } while (c2); - return d; + if (!replacedEdge) { + break; } - function Vz(a) { - a && aA(($z(), Zz)); - --Nz; - if (a) { - if (Pz != -1) { - Xz(Pz); - Pz = -1; + } + if (replacedEdge) { + var negativeWeightCycleIds = []; + for (var _e = 0; _e < numEdges; _e++) { + var _edge = edges5[_e]; + var _src = _edge.source(); + var _tgt = _edge.target(); + var _weight2 = weightFn(_edge); + var srcDist = getInfo3(_src).dist; + var tgtDist = getInfo3(_tgt).dist; + if (srcDist + _weight2 < tgtDist || !directed && tgtDist + _weight2 < srcDist) { + if (!hasNegativeWeightCycle) { + warn("Graph contains a negative weight cycle for Bellman-Ford"); + hasNegativeWeightCycle = true; } - } - } - function Pwb(a) { - Hwb(); - Mwb(this, Ydb(Cdb(Tdb(a, 24), Pxe)), Ydb(Cdb(a, Pxe))); - } - function IHb() { - IHb = geb; - HHb = ss((DHb(), cD(WC(uN, 1), jwe, 436, 0, [CHb, BHb]))); - } - function QHb() { - QHb = geb; - PHb = ss((LHb(), cD(WC(vN, 1), jwe, 435, 0, [JHb, KHb]))); - } - function YUb() { - YUb = geb; - XUb = ss((TUb(), cD(WC(BP, 1), jwe, 432, 0, [RUb, SUb]))); - } - function U8b() { - U8b = geb; - T8b = ss((P8b(), cD(WC(vS, 1), jwe, 517, 0, [O8b, N8b]))); - } - function Tvc() { - Tvc = geb; - Svc = ss((Ovc(), cD(WC(lX, 1), jwe, 429, 0, [Mvc, Nvc]))); - } - function duc() { - duc = geb; - cuc = ss(($tc(), cD(WC(cX, 1), jwe, 428, 0, [Ytc, Ztc]))); - } - function Huc() { - Huc = geb; - Guc = ss((Cuc(), cD(WC(fX, 1), jwe, 488, 0, [Buc, Auc]))); - } - function xEc() { - xEc = geb; - wEc = ss((sEc(), cD(WC(xX, 1), jwe, 430, 0, [qEc, rEc]))); - } - function xNc() { - xNc = geb; - wNc = ss((sNc(), cD(WC(MY, 1), jwe, 531, 0, [rNc, qNc]))); - } - function otc() { - otc = geb; - ntc = ss((jtc(), cD(WC($W, 1), jwe, 431, 0, [htc, itc]))); - } - function F_c() { - F_c = geb; - E_c = ss((A_c(), cD(WC(K_, 1), jwe, 433, 0, [z_c, y_c]))); - } - function F2c() { - F2c = geb; - E2c = ss((x2c(), cD(WC(s0, 1), jwe, 501, 0, [v2c, w2c]))); - } - function BQc() { - BQc = geb; - AQc = ss((wQc(), cD(WC(FZ, 1), jwe, 523, 0, [vQc, uQc]))); - } - function JQc() { - JQc = geb; - IQc = ss((EQc(), cD(WC(GZ, 1), jwe, 522, 0, [CQc, DQc]))); - } - function kTc() { - kTc = geb; - jTc = ss((fTc(), cD(WC(b$, 1), jwe, 528, 0, [eTc, dTc]))); - } - function iVc() { - iVc = geb; - hVc = ss((dVc(), cD(WC(w$, 1), jwe, 465, 0, [bVc, cVc]))); - } - function c4c() { - c4c = geb; - b4c = ss((Y3c(), cD(WC(H0, 1), jwe, 434, 0, [W3c, X3c]))); - } - function H8c() { - H8c = geb; - G8c = ss((z8c(), cD(WC(l1, 1), jwe, 491, 0, [x8c, y8c]))); - } - function J9c() { - J9c = geb; - I9c = ss((B9c(), cD(WC(t12, 1), jwe, 492, 0, [z9c, A9c]))); - } - function Rbd() { - Rbd = geb; - Qbd = ss((Mbd(), cD(WC(O1, 1), jwe, 438, 0, [Lbd, Kbd]))); - } - function tdd() { - tdd = geb; - sdd = ss((ldd(), cD(WC(W1, 1), jwe, 437, 0, [kdd, jdd]))); - } - function Eqd() { - Eqd = geb; - Dqd = ss((uqd(), cD(WC(M3, 1), jwe, 347, 0, [sqd, tqd]))); - } - function Imd() { - Cmd(); - return cD(WC(s3, 1), jwe, 88, 0, [Amd, zmd, ymd, xmd, Bmd]); - } - function xpd() { - qpd(); - return cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd]); - } - function LSd(a, b, c2) { - return RD(b == null ? rtb(a.f, null, c2) : Ltb(a.i, b, c2), 288); - } - function L6b(a) { - return (a.k == (r3b(), p3b) || a.k == m3b) && nQb(a, (Ywc(), cwc)); - } - function bUb(a) { - return !!a.c && !!a.d ? kUb(a.c) + "->" + kUb(a.d) : "e_" + kFb(a); - } - function xgb(a, b) { - var c2, d; - uFb(b); - for (d = a.Kc(); d.Ob(); ) { - c2 = d.Pb(); - b.Cd(c2); - } - } - function jEd(a, b) { - var c2; - c2 = new uC(); - qDd(c2, "x", b.a); - qDd(c2, "y", b.b); - oDd(a, c2); - } - function mEd(a, b) { - var c2; - c2 = new uC(); - qDd(c2, "x", b.a); - qDd(c2, "y", b.b); - oDd(a, c2); - } - function Gsd(a, b) { - var c2; - c2 = b; - while (c2) { - Zid(a, -c2.i, -c2.j); - c2 = vCd(c2); - } - return a; - } - function ZLc(a, b) { - var c2, d; - c2 = b; - d = 0; - while (c2 > 0) { - d += a.a[c2]; - c2 -= c2 & -c2; - } - return d; - } - function $mb(a, b, c2) { - var d; - d = (tFb(b, a.c.length), a.c[b]); - a.c[b] = c2; - return d; - } - function uIc(a, b, c2) { - a.a.c.length = 0; - yIc(a, b, c2); - a.a.c.length == 0 || rIc(a, b); - } - function wo(a) { - a.i = 0; - Mnb(a.b, null); - Mnb(a.c, null); - a.a = null; - a.e = null; - ++a.g; - } - function gBb() { - gBb = geb; - dBb = true; - bBb = false; - cBb = false; - fBb = false; - eBb = false; - } - function oBb(a) { - gBb(); - if (dBb) { - return; - } - this.c = a; - this.e = true; - this.a = new bnb(); - } - function kDb(a, b) { - this.c = 0; - this.b = b; - txb.call(this, a, 17493); - this.a = this.c; - } - function S_b(a) { - P_b(); - A$b(this); - this.a = new Yub(); - Q_b(this, a); - Mub(this.a, a); - } - function m_b() { - Pmb(this); - this.b = new rjd(oxe, oxe); - this.a = new rjd(pxe, pxe); - } - function z8c() { - z8c = geb; - x8c = new B8c(CBe, 0); - y8c = new B8c("TARGET_WIDTH", 1); - } - function yDb(a, b) { - return (MCb(a), QDb(new SDb(a, new hEb(b, a.a)))).Bd(wDb); - } - function vXb() { - sXb(); - return cD(WC(UP, 1), jwe, 367, 0, [nXb, oXb, pXb, qXb, rXb]); - } - function Fnc() { - Bnc(); - return cD(WC(TV, 1), jwe, 375, 0, [xnc, znc, Anc, ync, wnc]); - } - function Vtc() { - Ptc(); - return cD(WC(bX, 1), jwe, 348, 0, [Ltc, Ktc, Ntc, Otc, Mtc]); - } - function PDc() { - JDc(); - return cD(WC(uX, 1), jwe, 323, 0, [IDc, FDc, GDc, EDc, HDc]); - } - function fxc() { - cxc(); - return cD(WC(mX, 1), jwe, 171, 0, [bxc, Zwc, $wc, _wc, axc]); - } - function k3c() { - g3c(); - return cD(WC(x0, 1), jwe, 368, 0, [e3c, b3c, f3c, c3c, d3c]); - } - function vad() { - sad(); - return cD(WC(x1, 1), jwe, 373, 0, [oad, nad, qad, pad2, rad]); - } - function $bd() { - Xbd(); - return cD(WC(P1, 1), jwe, 324, 0, [Sbd, Tbd, Wbd, Ubd, Vbd]); - } - function _hd() { - Yhd(); - return cD(WC(d3, 1), jwe, 170, 0, [Whd, Vhd, Thd, Xhd, Uhd]); - } - function sod() { - pod(); - return cD(WC(B3, 1), jwe, 256, 0, [mod, ood, kod, lod, nod]); - } - function Tz(b) { - Qz(); - return function() { - return Uz(b, this, arguments); - }; - } - function W0b(a) { - if (!a.c || !a.d) { - return false; - } - return !!a.c.i && a.c.i == a.d.i; - } - function Nfd(a, b) { - if (ZD(b, 143)) { - return lhb(a.c, RD(b, 143).c); - } - return false; - } - function yYd(a) { - if (!a.t) { - a.t = new w$d(a); - VGd(new Cde(a), 0, a.t); - } - return a.t; - } - function jNd(a) { - this.b = a; - dMd.call(this, a); - this.a = RD(Ywd(this.b.a, 4), 129); - } - function sNd(a) { - this.b = a; - yMd.call(this, a); - this.a = RD(Ywd(this.b.a, 4), 129); - } - function Q3d(a, b, c2, d, e) { - OKd.call(this, b, d, e); - this.c = a; - this.b = c2; - } - function V3d(a, b, c2, d, e) { - KKd.call(this, b, d, e); - this.c = a; - this.a = c2; - } - function Z3d(a, b, c2, d, e) { - LKd.call(this, b, d, e); - this.c = a; - this.a = c2; - } - function g4d(a, b, c2, d, e) { - OKd.call(this, b, d, e); - this.c = a; - this.a = c2; - } - function ugd(a, b) { - var c2; - c2 = RD(cub(a.d, b), 23); - return c2 ? c2 : RD(cub(a.e, b), 23); - } - function Blb(a, b) { - var c2, d; - c2 = b.ld(); - d = a.Fe(c2); - return !!d && Fvb(d.e, b.md()); - } - function me(a, b) { - var c2; - c2 = b.ld(); - return new gp(c2, a.e.pc(c2, RD(b.md(), 16))); - } - function ptb(a, b) { - var c2; - c2 = a.a.get(b); - return c2 == null ? $C(jJ, rve, 1, 0, 5, 1) : c2; - } - function khb(a) { - var b; - b = a.length; - return lhb(sxe.substr(sxe.length - b, b), a); - } - function hs(a) { - if (gs(a)) { - a.c = a.a; - return a.a.Pb(); - } else { - throw Adb(new Dvb()); - } - } - function $ib(a, b) { - if (b == 0 || a.e == 0) { - return a; - } - return b > 0 ? tjb(a, b) : qjb(a, -b); - } - function Zib(a, b) { - if (b == 0 || a.e == 0) { - return a; - } - return b > 0 ? qjb(a, b) : tjb(a, -b); - } - function Deb(a) { - Beb.call(this, a == null ? vve : jeb(a), ZD(a, 82) ? RD(a, 82) : null); - } - function Y5d(a) { - var b; - if (!a.c) { - b = a.r; - ZD(b, 90) && (a.c = RD(b, 29)); - } - return a.c; - } - function s0b(a) { - var b; - b = new a1b(); - kQb(b, a); - pQb(b, (yCc(), RAc), null); - return b; - } - function lec(a) { - var b, c2; - b = a.c.i; - c2 = a.d.i; - return b.k == (r3b(), m3b) && c2.k == m3b; - } - function fD(a) { - var b, c2, d; - b = a & dxe; - c2 = a >> 22 & dxe; - d = a < 0 ? exe : 0; - return hD(b, c2, d); - } - function Ky(a) { - var b, c2, d, e; - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - ICb(b); - } - } - function Tc2(a, b) { - var c2, d; - c2 = RD(Yv(a.c, b), 16); - if (c2) { - d = c2.gc(); - c2.$b(); - a.d -= d; - } - } - function Fvd(a, b, c2) { - var d; - return d = a.Ih(b), d >= 0 ? a.Lh(d, c2, true) : Qvd(a, b, c2); - } - function AXc(a, b, c2) { - return Qfb(cjd(jWc(a), ajd(b.b)), cjd(jWc(a), ajd(c2.b))); - } - function BXc(a, b, c2) { - return Qfb(cjd(jWc(a), ajd(b.e)), cjd(jWc(a), ajd(c2.e))); - } - function Kad(a, b) { - return $wnd.Math.min(bjd(b.a, a.d.d.c), bjd(b.b, a.d.d.c)); - } - function LHd(a, b) { - a._i(a.i + 1); - MHd(a, a.i, a.Zi(a.i, b)); - a.Mi(a.i++, b); - a.Ni(); - } - function OHd(a) { - var b, c2; - ++a.j; - b = a.g; - c2 = a.i; - a.g = null; - a.i = 0; - a.Oi(c2, b); - a.Ni(); - } - function yke(a, b, c2) { - var d; - d = new zke(a.a); - Ld(d, a.a.a); - rtb(d.f, b, c2); - a.a.a = d; - } - function mKb(a, b, c2, d) { - var e; - for (e = 0; e < jKb; e++) { - dKb(a.a[e][b.g], c2, d[b.g]); - } - } - function lKb(a, b, c2, d) { - var e; - for (e = 0; e < iKb; e++) { - eKb(a.a[b.g][e], c2, d[b.g]); - } - } - function Qc(a, b) { - var c2; - c2 = RD(a.c.xc(b), 16); - !c2 && (c2 = a.ic(b)); - return a.pc(b, c2); - } - function vm(a) { - var b; - b = (Qb(a), a ? new dnb(a) : cv(a.Kc())); - Eob(b); - return Pm(b); - } - function dv(a) { - var b, c2; - Qb(a); - b = Zu(a.length); - c2 = new cnb(b); - zob(c2, a); - return c2; - } - function Hjb(a, b, c2, d) { - var e; - e = $C(kE, Pwe, 28, b, 15, 1); - Ijb(e, a, b, c2, d); - return e; - } - function Sb(a, b) { - if (a < 0 || a > b) { - throw Adb(new veb(Jb(a, b, "index"))); - } - return a; - } - function Xmb(a, b) { - var c2; - c2 = (tFb(b, a.c.length), a.c[b]); - $Eb(a.c, b, 1); - return c2; - } - function jhb(a, b) { - var c2, d; - c2 = (uFb(a), a); - d = (uFb(b), b); - return c2 == d ? 0 : c2 < d ? -1 : 1; - } - function Orb(a) { - var b; - b = a.e + a.f; - if (isNaN(b) && Rfb(a.d)) { - return a.d; - } - return b; - } - function zc(a) { - a.e = 3; - a.d = a.Yb(); - if (a.e != 2) { - a.e = 0; - return true; - } - return false; - } - function Gyb(a, b) { - !a.a ? a.a = new dib(a.d) : Zhb(a.a, a.b); - Whb(a.a, b); - return a; - } - function _jb(a, b) { - return bE(b) ? b == null ? stb(a.f, null) : Mtb(a.i, b) : stb(a.f, b); - } - function nEb(a, b) { - pxb.call(this, b.zd(), b.yd() & -6); - uFb(a); - this.a = a; - this.b = b; - } - function tEb(a, b) { - txb.call(this, b.zd(), b.yd() & -6); - uFb(a); - this.a = a; - this.b = b; - } - function zEb(a, b) { - xxb.call(this, b.zd(), b.yd() & -6); - uFb(a); - this.a = a; - this.b = b; - } - function M7d(a, b, c2) { - t7d.call(this, c2); - this.b = a; - this.c = b; - this.d = (a8d(), $7d); - } - function OKd(a, b, c2) { - this.d = a; - this.k = b ? 1 : 0; - this.f = c2 ? 1 : 0; - this.o = -1; - this.p = 0; - } - function l4b(a) { - this.c = a; - this.a = new Anb(this.c.a); - this.b = new Anb(this.c.b); - } - function gUb() { - this.e = new bnb(); - this.c = new bnb(); - this.d = new bnb(); - this.b = new bnb(); - } - function DIb() { - this.g = new GIb(); - this.b = new GIb(); - this.a = new bnb(); - this.k = new bnb(); - } - function I_b() { - this.a = new J$b(); - this.b = new N$b(); - this.d = new Z_b(); - this.e = new V_b(); - } - function knc(a, b, c2) { - this.a = a; - this.c = b; - this.d = c2; - Rmb(b.e, this); - Rmb(c2.b, this); - } - function sIc(a, b, c2) { - var d, e; - d = 0; - for (e = 0; e < b.length; e++) { - d += a.tg(b[e], d, c2); - } - } - function nMc(a, b) { - var c2; - c2 = tMc(a, b); - a.b = new _Lc(c2.c.length); - return mMc(a, c2); - } - function pB(a, b) { - var c2; - c2 = a.q.getHours() + (b / 60 | 0); - a.q.setMinutes(b); - mB(a, c2); - } - function _Wc(a) { - var b; - b = a.b; - if (b.b == 0) { - return null; - } - return RD(ju(b, 0), 65).b; - } - function Src(a) { - if (a.a) { - if (a.e) { - return Src(a.e); + if (options3.findNegativeWeightCycles !== false) { + var negativeNodes = []; + if (srcDist + _weight2 < tgtDist) { + negativeNodes.push(_src); + } + if (!directed && tgtDist + _weight2 < srcDist) { + negativeNodes.push(_tgt); + } + var numNegativeNodes = negativeNodes.length; + for (var n2 = 0; n2 < numNegativeNodes; n2++) { + var start3 = negativeNodes[n2]; + var cycle = [start3]; + cycle.push(getInfo3(start3).edge); + var _node = getInfo3(start3).pred; + while (cycle.indexOf(_node) === -1) { + cycle.push(_node); + cycle.push(getInfo3(_node).edge); + _node = getInfo3(_node).pred; + } + cycle = cycle.slice(cycle.indexOf(_node)); + var smallestId = cycle[0].id(); + var smallestIndex = 0; + for (var c3 = 2; c3 < cycle.length; c3 += 2) { + if (cycle[c3].id() < smallestId) { + smallestId = cycle[c3].id(); + smallestIndex = c3; + } + } + cycle = cycle.slice(smallestIndex).concat(cycle.slice(0, smallestIndex)); + cycle.push(cycle[0]); + var cycleId = cycle.map(function(el) { + return el.id(); + }).join(","); + if (negativeWeightCycleIds.indexOf(cycleId) === -1) { + negativeWeightCycles.push(eles.spawn(cycle)); + negativeWeightCycleIds.push(cycleId); + } + } + } else { + break; } - } else { - return a; } - return null; - } - function mIc(a, b) { - if (a.p < b.p) { - return 1; - } else if (a.p > b.p) { - return -1; - } - return 0; - } - function hXd(a) { - var b; - if (!a.a) { - b = a.r; - ZD(b, 156) && (a.a = RD(b, 156)); - } - return a.a; - } - function iOd(a, b, c2) { - var d; - ++a.e; - --a.f; - d = RD(a.d[b].gd(c2), 136); - return d.md(); - } - function fd(a) { - var b, c2; - b = a.ld(); - c2 = RD(a.md(), 16); - return gk(c2.Nc(), new jh(b)); - } - function oae(a, b) { - if (Ujb(a.a, b)) { - _jb(a.a, b); - return true; - } else { - return false; - } - } - function Ui(a, b, c2) { - Pb(b, a.e.Rd().gc()); - Pb(c2, a.c.Rd().gc()); - return a.a[b][c2]; - } - function _Uc(a, b, c2) { - this.a = a; - this.b = b; - this.c = c2; - Rmb(a.t, this); - Rmb(b.i, this); - } - function lg(a, b, c2, d) { - this.f = a; - this.e = b; - this.d = c2; - this.b = d; - this.c = !d ? null : d.d; - } - function YWc() { - this.b = new Yub(); - this.a = new Yub(); - this.b = new Yub(); - this.a = new Yub(); - } - function ree() { - ree = geb; - var a, b; - pee = (jTd(), b = new k1d(), b); - qee = (a = new mXd(), a); - } - function UCb(a) { - var b; - MCb(a); - b = new $Cb(a, a.a.e, a.a.d | 4); - return new WCb(a, b); - } - function ADb(a) { - var b; - LCb(a); - b = 0; - while (a.a.Bd(new MEb())) { - b = Bdb(b, 1); - } - return b; - } - function zxb(a, b) { - uFb(b); - if (a.c < a.d) { - a.Se(b, a.c++); - return true; - } - return false; - } - function cnb(a) { - Pmb(this); - mFb(a >= 0, "Initial capacity must not be negative"); - } - function rid() { - rid = geb; - qid = new jGd("org.eclipse.elk.labels.labelManager"); - } - function iec() { - iec = geb; - hec = new kGd("separateLayerConnections", (vec(), uec)); } - function fTc() { - fTc = geb; - eTc = new gTc("REGULAR", 0); - dTc = new gTc("CRITICAL", 1); - } - function Mbd() { - Mbd = geb; - Lbd = new Nbd("FIXED", 0); - Kbd = new Nbd("CENTER_NODE", 1); - } - function jtc() { - jtc = geb; - htc = new ktc("QUADRATIC", 0); - itc = new ktc("SCANLINE", 1); - } - function Atc() { - Atc = geb; - ztc = ss((stc(), cD(WC(_W, 1), jwe, 322, 0, [qtc, ptc, rtc]))); - } - function Jtc() { - Jtc = geb; - Itc = ss((Etc(), cD(WC(aX, 1), jwe, 351, 0, [Btc, Dtc, Ctc]))); - } - function ooc() { - ooc = geb; - noc = ss((joc(), cD(WC(UV, 1), jwe, 372, 0, [ioc, hoc, goc]))); + } + return { + distanceTo, + pathTo, + hasNegativeWeightCycle, + negativeWeightCycles + }; + }, "bellmanFord") + // bellmanFord + }; + sqrt2 = Math.sqrt(2); + collapse = /* @__PURE__ */ __name(function collapse2(edgeIndex, nodeMap, remainingEdges) { + if (remainingEdges.length === 0) { + error("Karger-Stein must be run on a connected (sub)graph"); + } + var edgeInfo = remainingEdges[edgeIndex]; + var sourceIn = edgeInfo[1]; + var targetIn = edgeInfo[2]; + var partition1 = nodeMap[sourceIn]; + var partition2 = nodeMap[targetIn]; + var newEdges = remainingEdges; + for (var i2 = newEdges.length - 1; i2 >= 0; i2--) { + var edge = newEdges[i2]; + var src = edge[1]; + var tgt = edge[2]; + if (nodeMap[src] === partition1 && nodeMap[tgt] === partition2 || nodeMap[src] === partition2 && nodeMap[tgt] === partition1) { + newEdges.splice(i2, 1); + } + } + for (var _i = 0; _i < newEdges.length; _i++) { + var _edge = newEdges[_i]; + if (_edge[1] === partition2) { + newEdges[_i] = _edge.slice(); + newEdges[_i][1] = partition1; + } else if (_edge[2] === partition2) { + newEdges[_i] = _edge.slice(); + newEdges[_i][2] = partition1; + } + } + for (var _i2 = 0; _i2 < nodeMap.length; _i2++) { + if (nodeMap[_i2] === partition2) { + nodeMap[_i2] = partition1; + } + } + return newEdges; + }, "collapse"); + contractUntil = /* @__PURE__ */ __name(function contractUntil2(metaNodeMap, remainingEdges, size5, sizeLimit) { + while (size5 > sizeLimit) { + var edgeIndex = Math.floor(Math.random() * remainingEdges.length); + remainingEdges = collapse(edgeIndex, metaNodeMap, remainingEdges); + size5--; + } + return remainingEdges; + }, "contractUntil"); + elesfn$p = { + // Computes the minimum cut of an undirected graph + // Returns the correct answer with high probability + kargerStein: /* @__PURE__ */ __name(function kargerStein() { + var _this = this; + var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges; + edges5.unmergeBy(function(edge) { + return edge.isLoop(); + }); + var numNodes = nodes6.length; + var numEdges = edges5.length; + var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2)); + var stopSize = Math.floor(numNodes / sqrt2); + if (numNodes < 2) { + error("At least 2 nodes are required for Karger-Stein algorithm"); + return void 0; + } + var edgeIndexes = []; + for (var i2 = 0; i2 < numEdges; i2++) { + var e3 = edges5[i2]; + edgeIndexes.push([i2, nodes6.indexOf(e3.source()), nodes6.indexOf(e3.target())]); + } + var minCutSize = Infinity; + var minCutEdgeIndexes = []; + var minCutNodeMap = new Array(numNodes); + var metaNodeMap = new Array(numNodes); + var metaNodeMap2 = new Array(numNodes); + var copyNodesMap = /* @__PURE__ */ __name(function copyNodesMap2(from2, to) { + for (var _i3 = 0; _i3 < numNodes; _i3++) { + to[_i3] = from2[_i3]; } - function muc() { - muc = geb; - luc = ss((huc(), cD(WC(dX, 1), jwe, 460, 0, [fuc, euc, guc]))); + }, "copyNodesMap"); + for (var iter = 0; iter <= numIter; iter++) { + for (var _i4 = 0; _i4 < numNodes; _i4++) { + metaNodeMap[_i4] = _i4; } - function Cvc() { - Cvc = geb; - Bvc = ss((xvc(), cD(WC(jX, 1), jwe, 299, 0, [vvc, wvc, uvc]))); + var edgesState = contractUntil(metaNodeMap, edgeIndexes.slice(), numNodes, stopSize); + var edgesState2 = edgesState.slice(); + copyNodesMap(metaNodeMap, metaNodeMap2); + var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2); + var res2 = contractUntil(metaNodeMap2, edgesState2, stopSize, 2); + if (res1.length <= res2.length && res1.length < minCutSize) { + minCutSize = res1.length; + minCutEdgeIndexes = res1; + copyNodesMap(metaNodeMap, minCutNodeMap); + } else if (res2.length <= res1.length && res2.length < minCutSize) { + minCutSize = res2.length; + minCutEdgeIndexes = res2; + copyNodesMap(metaNodeMap2, minCutNodeMap); } - function Lvc() { - Lvc = geb; - Kvc = ss((Gvc(), cD(WC(kX, 1), jwe, 311, 0, [Evc, Fvc, Dvc]))); + } + var cut = this.spawn(minCutEdgeIndexes.map(function(e4) { + return edges5[e4[0]]; + })); + var partition1 = this.spawn(); + var partition2 = this.spawn(); + var witnessNodePartition = minCutNodeMap[0]; + for (var _i5 = 0; _i5 < minCutNodeMap.length; _i5++) { + var partitionId = minCutNodeMap[_i5]; + var node2 = nodes6[_i5]; + if (partitionId === witnessNodePartition) { + partition1.merge(node2); + } else { + partition2.merge(node2); } - function rDc() { - rDc = geb; - qDc = ss((lDc(), cD(WC(sX, 1), jwe, 390, 0, [iDc, jDc, kDc]))); - } - function PEc() { - PEc = geb; - OEc = ss((KEc(), cD(WC(zX, 1), jwe, 387, 0, [HEc, IEc, JEc]))); - } - function YEc() { - YEc = geb; - XEc = ss((TEc(), cD(WC(AX, 1), jwe, 349, 0, [SEc, QEc, REc]))); - } - function GEc() { - GEc = geb; - FEc = ss((BEc(), cD(WC(yX, 1), jwe, 463, 0, [AEc, yEc, zEc]))); - } - function qFc() { - qFc = geb; - pFc = ss((lFc(), cD(WC(CX, 1), jwe, 350, 0, [iFc, jFc, kFc]))); - } - function zFc() { - zFc = geb; - yFc = ss((uFc(), cD(WC(DX, 1), jwe, 352, 0, [tFc, rFc, sFc]))); - } - function IFc() { - IFc = geb; - HFc = ss((DFc(), cD(WC(EX, 1), jwe, 388, 0, [BFc, CFc, AFc]))); - } - function QZc() { - QZc = geb; - PZc = ss((LZc(), cD(WC(F_, 1), jwe, 392, 0, [KZc, JZc, IZc]))); - } - function m4c() { - m4c = geb; - l4c = ss((g4c(), cD(WC(I0, 1), jwe, 393, 0, [d4c, e4c, f4c]))); - } - function z5c() { - z5c = geb; - y5c = ss((t5c(), cD(WC(N0, 1), jwe, 300, 0, [r5c, s5c, q5c]))); - } - function k6c() { - k6c = geb; - j6c = ss((f6c(), cD(WC(V0, 1), jwe, 445, 0, [c6c, d6c, e6c]))); - } - function F6c() { - F6c = geb; - E6c = ss((z6c(), cD(WC(Z0, 1), jwe, 456, 0, [w6c, y6c, x6c]))); - } - function e7c() { - e7c = geb; - d7c = ss((_6c(), cD(WC(a1, 1), jwe, 394, 0, [Z6c, $6c, Y6c]))); - } - function j9c() { - j9c = geb; - i9c = ss((b9c(), cD(WC(o1, 1), jwe, 439, 0, [$8c, a9c, _8c]))); - } - function WKc() { - WKc = geb; - VKc = ss((RKc(), cD(WC(nY, 1), jwe, 464, 0, [OKc, PKc, QKc]))); - } - function JKb() { - JKb = geb; - IKb = ss((EKb(), cD(WC(MN, 1), jwe, 471, 0, [CKb, BKb, DKb]))); - } - function cKb() { - cKb = geb; - bKb = ss((ZJb(), cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb]))); - } - function ALb() { - ALb = geb; - zLb = ss((vLb(), cD(WC(TN, 1), jwe, 472, 0, [uLb, tLb, sLb]))); - } - function CBb() { - CBb = geb; - BBb = ss((xBb(), cD(WC(QL, 1), jwe, 108, 0, [uBb, vBb, wBb]))); - } - function FWb() { - FWb = geb; - EWb = ss((AWb(), cD(WC(JP, 1), jwe, 391, 0, [yWb, xWb, zWb]))); - } - function Knd() { - Knd = geb; - Jnd = ss((Fnd(), cD(WC(y3, 1), jwe, 346, 0, [Dnd, Cnd, End]))); - } - function lbd() { - lbd = geb; - kbd = ss((gbd(), cD(WC(I1, 1), jwe, 444, 0, [dbd, ebd, fbd]))); - } - function Tmd() { - Tmd = geb; - Smd = ss((Omd(), cD(WC(t32, 1), jwe, 278, 0, [Lmd, Mmd, Nmd]))); - } - function rqd() { - rqd = geb; - qqd = ss((mqd(), cD(WC(J3, 1), jwe, 280, 0, [kqd, jqd, lqd]))); - } - function Hxd(a, b) { - return !a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), QNd(a.o, b); - } - function HMb(a, b) { - var c2; - if (a.C) { - c2 = RD(Vrb(a.b, b), 127).n; - c2.d = a.C.d; - c2.a = a.C.a; - } - } - function F8b(a) { - var b, c2, d, e; - e = a.d; - b = a.a; - c2 = a.b; - d = a.c; - a.d = c2; - a.a = d; - a.b = e; - a.c = b; - } - function cOd(a) { - !a.g && (a.g = new hQd()); - !a.g.b && (a.g.b = new ePd(a)); - return a.g.b; - } - function dOd(a) { - !a.g && (a.g = new hQd()); - !a.g.c && (a.g.c = new IPd(a)); - return a.g.c; - } - function lOd(a) { - !a.g && (a.g = new hQd()); - !a.g.d && (a.g.d = new kPd(a)); - return a.g.d; - } - function YNd(a) { - !a.g && (a.g = new hQd()); - !a.g.a && (a.g.a = new qPd(a)); - return a.g.a; - } - function B9d(a, b, c2, d) { - !!c2 && (d = c2.Rh(b, BYd(c2.Dh(), a.c.uk()), null, d)); - return d; - } - function C9d(a, b, c2, d) { - !!c2 && (d = c2.Th(b, BYd(c2.Dh(), a.c.uk()), null, d)); - return d; - } - function Cjb(a, b, c2, d) { - var e; - e = $C(kE, Pwe, 28, b + 1, 15, 1); - Djb(e, a, b, c2, d); - return e; - } - function $C(a, b, c2, d, e, f2) { - var g; - g = _C(e, d); - e != 10 && cD(WC(a, f2), b, c2, e, g); - return g; - } - function $fe(a, b, c2) { - var d, e; - e = new Phe(b, a); - for (d = 0; d < c2; ++d) { - Dhe(e); - } - return e; - } - function $Gd(a, b, c2) { - var d, e; - if (c2 != null) { - for (d = 0; d < b; ++d) { - e = c2[d]; - a.Qi(d, e); - } - } - } - function Yyb(a, b) { - var c2; - c2 = new Gzb(); - c2.c = true; - c2.d = b.md(); - return Zyb(a, b.ld(), c2); - } - function rB(a, b) { - var c2; - c2 = a.q.getHours() + (b / 3600 | 0); - a.q.setSeconds(b); - mB(a, c2); - } - function Ct(a, b) { - var c2, d; - c2 = b; - d = Hob(cv(new Nu(a, c2))); - Ar(new Nu(a, c2)); - return d; - } - function Kdc(a, b) { - b.Ug("Label management", 1); - fE(mQb(a, (rid(), qid))); - b.Vg(); - } - function wge(a, b, c2, d) { - vge(a, b, c2, kge(a, b, d, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0)); - } - function BQb(a, b, c2) { - RD(a.b, 68); - RD(a.b, 68); - RD(a.b, 68); - Umb(a.a, new KQb(c2, b, a)); - } - function AFb(a, b, c2) { - if (a < 0 || b > c2 || b < a) { - throw Adb(new eib(_xe + a + bye + b + Qxe + c2)); - } - } - function NCb(a) { - if (!a) { - this.c = null; - this.b = new bnb(); - } else { - this.c = a; - this.b = null; - } - } - function Fzb(a, b) { - xlb.call(this, a, b); - this.a = $C(vL, Zve, 447, 2, 0, 1); - this.b = true; - } - function hub(a) { - ckb.call(this, a, 0); - _tb(this); - this.d.b = this.d; - this.d.a = this.d; - } - function wtb(a) { - this.e = a; - this.b = this.e.a.entries(); - this.a = $C(jJ, rve, 1, 0, 5, 1); - } - function _Fc() { - _Fc = geb; - $Fc = nfd(pfd(new ufd(), (sXb(), nXb), (hcc(), Ebc)), rXb, $bc); - } - function xuc() { - tuc(); - return cD(WC(eX, 1), jwe, 283, 0, [ouc, nuc, quc, puc, suc, ruc]); + } + var constructComponent = /* @__PURE__ */ __name(function constructComponent2(subset) { + var component2 = _this.spawn(); + subset.forEach(function(node3) { + component2.merge(node3); + node3.connectedEdges().forEach(function(edge) { + if (_this.contains(edge) && !cut.contains(edge)) { + component2.merge(edge); + } + }); + }); + return component2; + }, "constructComponent"); + var components3 = [constructComponent(partition1), constructComponent(partition2)]; + var ret = { + cut, + components: components3, + // n.b. partitions are included to be compatible with the old api spec + // (could be removed in a future major version) + partition1, + partition2 + }; + return ret; + }, "kargerStein") + }; + copyPosition = /* @__PURE__ */ __name(function copyPosition2(p3) { + return { + x: p3.x, + y: p3.y + }; + }, "copyPosition"); + modelToRenderedPosition = /* @__PURE__ */ __name(function modelToRenderedPosition2(p3, zoom2, pan2) { + return { + x: p3.x * zoom2 + pan2.x, + y: p3.y * zoom2 + pan2.y + }; + }, "modelToRenderedPosition"); + renderedToModelPosition = /* @__PURE__ */ __name(function renderedToModelPosition2(p3, zoom2, pan2) { + return { + x: (p3.x - pan2.x) / zoom2, + y: (p3.y - pan2.y) / zoom2 + }; + }, "renderedToModelPosition"); + array2point = /* @__PURE__ */ __name(function array2point2(arr) { + return { + x: arr[0], + y: arr[1] + }; + }, "array2point"); + min5 = /* @__PURE__ */ __name(function min6(arr) { + var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; + var min9 = Infinity; + for (var i2 = begin; i2 < end2; i2++) { + var val = arr[i2]; + if (isFinite(val)) { + min9 = Math.min(val, min9); + } + } + return min9; + }, "min"); + max5 = /* @__PURE__ */ __name(function max6(arr) { + var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; + var max10 = -Infinity; + for (var i2 = begin; i2 < end2; i2++) { + var val = arr[i2]; + if (isFinite(val)) { + max10 = Math.max(val, max10); + } + } + return max10; + }, "max"); + mean = /* @__PURE__ */ __name(function mean2(arr) { + var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; + var total = 0; + var n2 = 0; + for (var i2 = begin; i2 < end2; i2++) { + var val = arr[i2]; + if (isFinite(val)) { + total += val; + n2++; + } + } + return total / n2; + }, "mean"); + median = /* @__PURE__ */ __name(function median2(arr) { + var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; + var copy6 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; + var sort3 = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; + var includeHoles = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; + if (copy6) { + arr = arr.slice(begin, end2); + } else { + if (end2 < arr.length) { + arr.splice(end2, arr.length - end2); + } + if (begin > 0) { + arr.splice(0, begin); + } + } + var off = 0; + for (var i2 = arr.length - 1; i2 >= 0; i2--) { + var v3 = arr[i2]; + if (includeHoles) { + if (!isFinite(v3)) { + arr[i2] = -Infinity; + off++; } - function Ruc() { - Ouc(); - return cD(WC(gX, 1), jwe, 281, 0, [Luc, Kuc, Nuc, Juc, Muc, Iuc]); + } else { + arr.splice(i2, 1); + } + } + if (sort3) { + arr.sort(function(a2, b2) { + return a2 - b2; + }); + } + var len = arr.length; + var mid = Math.floor(len / 2); + if (len % 2 !== 0) { + return arr[mid + 1 + off]; + } else { + return (arr[mid - 1 + off] + arr[mid + off]) / 2; + } + }, "median"); + deg2rad = /* @__PURE__ */ __name(function deg2rad2(deg) { + return Math.PI * deg / 180; + }, "deg2rad"); + getAngleFromDisp = /* @__PURE__ */ __name(function getAngleFromDisp2(dispX, dispY) { + return Math.atan2(dispY, dispX) - Math.PI / 2; + }, "getAngleFromDisp"); + log22 = Math.log2 || function(n2) { + return Math.log(n2) / Math.log(2); + }; + signum = /* @__PURE__ */ __name(function signum2(x5) { + if (x5 > 0) { + return 1; + } else if (x5 < 0) { + return -1; + } else { + return 0; + } + }, "signum"); + dist = /* @__PURE__ */ __name(function dist2(p1, p22) { + return Math.sqrt(sqdist(p1, p22)); + }, "dist"); + sqdist = /* @__PURE__ */ __name(function sqdist2(p1, p22) { + var dx = p22.x - p1.x; + var dy = p22.y - p1.y; + return dx * dx + dy * dy; + }, "sqdist"); + inPlaceSumNormalize = /* @__PURE__ */ __name(function inPlaceSumNormalize2(v3) { + var length2 = v3.length; + var total = 0; + for (var i2 = 0; i2 < length2; i2++) { + total += v3[i2]; + } + for (var _i = 0; _i < length2; _i++) { + v3[_i] = v3[_i] / total; + } + return v3; + }, "inPlaceSumNormalize"); + qbezierAt = /* @__PURE__ */ __name(function qbezierAt2(p0, p1, p22, t4) { + return (1 - t4) * (1 - t4) * p0 + 2 * (1 - t4) * t4 * p1 + t4 * t4 * p22; + }, "qbezierAt"); + qbezierPtAt = /* @__PURE__ */ __name(function qbezierPtAt2(p0, p1, p22, t4) { + return { + x: qbezierAt(p0.x, p1.x, p22.x, t4), + y: qbezierAt(p0.y, p1.y, p22.y, t4) + }; + }, "qbezierPtAt"); + lineAt = /* @__PURE__ */ __name(function lineAt2(p0, p1, t4, d2) { + var vec = { + x: p1.x - p0.x, + y: p1.y - p0.y + }; + var vecDist = dist(p0, p1); + var normVec = { + x: vec.x / vecDist, + y: vec.y / vecDist + }; + t4 = t4 == null ? 0 : t4; + d2 = d2 != null ? d2 : t4 * vecDist; + return { + x: p0.x + normVec.x * d2, + y: p0.y + normVec.y * d2 + }; + }, "lineAt"); + bound = /* @__PURE__ */ __name(function bound2(min9, val, max10) { + return Math.max(min9, Math.min(max10, val)); + }, "bound"); + makeBoundingBox = /* @__PURE__ */ __name(function makeBoundingBox2(bb) { + if (bb == null) { + return { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity, + w: 0, + h: 0 + }; + } else if (bb.x1 != null && bb.y1 != null) { + if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) { + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x2, + y2: bb.y2, + w: bb.x2 - bb.x1, + h: bb.y2 - bb.y1 + }; + } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) { + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x1 + bb.w, + y2: bb.y1 + bb.h, + w: bb.w, + h: bb.h + }; + } + } + }, "makeBoundingBox"); + copyBoundingBox = /* @__PURE__ */ __name(function copyBoundingBox2(bb) { + return { + x1: bb.x1, + x2: bb.x2, + w: bb.w, + y1: bb.y1, + y2: bb.y2, + h: bb.h + }; + }, "copyBoundingBox"); + clearBoundingBox = /* @__PURE__ */ __name(function clearBoundingBox2(bb) { + bb.x1 = Infinity; + bb.y1 = Infinity; + bb.x2 = -Infinity; + bb.y2 = -Infinity; + bb.w = 0; + bb.h = 0; + }, "clearBoundingBox"); + shiftBoundingBox = /* @__PURE__ */ __name(function shiftBoundingBox2(bb, dx, dy) { + return { + x1: bb.x1 + dx, + x2: bb.x2 + dx, + y1: bb.y1 + dy, + y2: bb.y2 + dy, + w: bb.w, + h: bb.h + }; + }, "shiftBoundingBox"); + updateBoundingBox = /* @__PURE__ */ __name(function updateBoundingBox2(bb1, bb2) { + bb1.x1 = Math.min(bb1.x1, bb2.x1); + bb1.x2 = Math.max(bb1.x2, bb2.x2); + bb1.w = bb1.x2 - bb1.x1; + bb1.y1 = Math.min(bb1.y1, bb2.y1); + bb1.y2 = Math.max(bb1.y2, bb2.y2); + bb1.h = bb1.y2 - bb1.y1; + }, "updateBoundingBox"); + expandBoundingBoxByPoint = /* @__PURE__ */ __name(function expandBoundingBoxByPoint2(bb, x5, y5) { + bb.x1 = Math.min(bb.x1, x5); + bb.x2 = Math.max(bb.x2, x5); + bb.w = bb.x2 - bb.x1; + bb.y1 = Math.min(bb.y1, y5); + bb.y2 = Math.max(bb.y2, y5); + bb.h = bb.y2 - bb.y1; + }, "expandBoundingBoxByPoint"); + expandBoundingBox = /* @__PURE__ */ __name(function expandBoundingBox2(bb) { + var padding3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + bb.x1 -= padding3; + bb.x2 += padding3; + bb.y1 -= padding3; + bb.y2 += padding3; + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + return bb; + }, "expandBoundingBox"); + expandBoundingBoxSides = /* @__PURE__ */ __name(function expandBoundingBoxSides2(bb) { + var padding3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0]; + var top2, right3, bottom2, left3; + if (padding3.length === 1) { + top2 = right3 = bottom2 = left3 = padding3[0]; + } else if (padding3.length === 2) { + top2 = bottom2 = padding3[0]; + left3 = right3 = padding3[1]; + } else if (padding3.length === 4) { + var _padding = _slicedToArray(padding3, 4); + top2 = _padding[0]; + right3 = _padding[1]; + bottom2 = _padding[2]; + left3 = _padding[3]; + } + bb.x1 -= left3; + bb.x2 += right3; + bb.y1 -= top2; + bb.y2 += bottom2; + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + return bb; + }, "expandBoundingBoxSides"); + assignBoundingBox = /* @__PURE__ */ __name(function assignBoundingBox2(bb1, bb2) { + bb1.x1 = bb2.x1; + bb1.y1 = bb2.y1; + bb1.x2 = bb2.x2; + bb1.y2 = bb2.y2; + bb1.w = bb1.x2 - bb1.x1; + bb1.h = bb1.y2 - bb1.y1; + }, "assignBoundingBox"); + boundingBoxesIntersect = /* @__PURE__ */ __name(function boundingBoxesIntersect2(bb1, bb2) { + if (bb1.x1 > bb2.x2) { + return false; + } + if (bb2.x1 > bb1.x2) { + return false; + } + if (bb1.x2 < bb2.x1) { + return false; + } + if (bb2.x2 < bb1.x1) { + return false; + } + if (bb1.y2 < bb2.y1) { + return false; + } + if (bb2.y2 < bb1.y1) { + return false; + } + if (bb1.y1 > bb2.y2) { + return false; + } + if (bb2.y1 > bb1.y2) { + return false; + } + return true; + }, "boundingBoxesIntersect"); + inBoundingBox = /* @__PURE__ */ __name(function inBoundingBox2(bb, x5, y5) { + return bb.x1 <= x5 && x5 <= bb.x2 && bb.y1 <= y5 && y5 <= bb.y2; + }, "inBoundingBox"); + pointInBoundingBox = /* @__PURE__ */ __name(function pointInBoundingBox2(bb, pt) { + return inBoundingBox(bb, pt.x, pt.y); + }, "pointInBoundingBox"); + boundingBoxInBoundingBox = /* @__PURE__ */ __name(function boundingBoxInBoundingBox2(bb1, bb2) { + return inBoundingBox(bb1, bb2.x1, bb2.y1) && inBoundingBox(bb1, bb2.x2, bb2.y2); + }, "boundingBoxInBoundingBox"); + roundRectangleIntersectLine = /* @__PURE__ */ __name(function roundRectangleIntersectLine2(x5, y5, nodeX, nodeY, width3, height2, padding3) { + var radius2 = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto"; + var cornerRadius = radius2 === "auto" ? getRoundRectangleRadius(width3, height2) : radius2; + var halfWidth = width3 / 2; + var halfHeight = height2 / 2; + cornerRadius = Math.min(cornerRadius, halfWidth, halfHeight); + var doWidth = cornerRadius !== halfWidth, doHeight = cornerRadius !== halfHeight; + var straightLineIntersections; + if (doWidth) { + var topStartX = nodeX - halfWidth + cornerRadius - padding3; + var topStartY = nodeY - halfHeight - padding3; + var topEndX = nodeX + halfWidth - cornerRadius + padding3; + var topEndY = topStartY; + straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + if (doHeight) { + var rightStartX = nodeX + halfWidth + padding3; + var rightStartY = nodeY - halfHeight + cornerRadius - padding3; + var rightEndX = rightStartX; + var rightEndY = nodeY + halfHeight - cornerRadius + padding3; + straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false); + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + if (doWidth) { + var bottomStartX = nodeX - halfWidth + cornerRadius - padding3; + var bottomStartY = nodeY + halfHeight + padding3; + var bottomEndX = nodeX + halfWidth - cornerRadius + padding3; + var bottomEndY = bottomStartY; + straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false); + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + if (doHeight) { + var leftStartX = nodeX - halfWidth - padding3; + var leftStartY = nodeY - halfHeight + cornerRadius - padding3; + var leftEndX = leftStartX; + var leftEndY = nodeY + halfHeight - cornerRadius + padding3; + straightLineIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false); + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + var arcIntersections; + { + var topLeftCenterX = nodeX - halfWidth + cornerRadius; + var topLeftCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding3); + if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + { + var topRightCenterX = nodeX + halfWidth - cornerRadius; + var topRightCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding3); + if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + { + var bottomRightCenterX = nodeX + halfWidth - cornerRadius; + var bottomRightCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding3); + if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + { + var bottomLeftCenterX = nodeX - halfWidth + cornerRadius; + var bottomLeftCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = intersectLineCircle(x5, y5, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding3); + if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + return []; + }, "roundRectangleIntersectLine"); + inLineVicinity = /* @__PURE__ */ __name(function inLineVicinity2(x5, y5, lx1, ly1, lx2, ly2, tolerance) { + var t4 = tolerance; + var x1 = Math.min(lx1, lx2); + var x22 = Math.max(lx1, lx2); + var y1 = Math.min(ly1, ly2); + var y22 = Math.max(ly1, ly2); + return x1 - t4 <= x5 && x5 <= x22 + t4 && y1 - t4 <= y5 && y5 <= y22 + t4; + }, "inLineVicinity"); + inBezierVicinity = /* @__PURE__ */ __name(function inBezierVicinity2(x5, y5, x1, y1, x22, y22, x32, y32, tolerance) { + var bb = { + x1: Math.min(x1, x32, x22) - tolerance, + x2: Math.max(x1, x32, x22) + tolerance, + y1: Math.min(y1, y32, y22) - tolerance, + y2: Math.max(y1, y32, y22) + tolerance + }; + if (x5 < bb.x1 || x5 > bb.x2 || y5 < bb.y1 || y5 > bb.y2) { + return false; + } else { + return true; + } + }, "inBezierVicinity"); + solveQuadratic = /* @__PURE__ */ __name(function solveQuadratic2(a2, b2, c3, val) { + c3 -= val; + var r2 = b2 * b2 - 4 * a2 * c3; + if (r2 < 0) { + return []; + } + var sqrtR = Math.sqrt(r2); + var denom = 2 * a2; + var root1 = (-b2 + sqrtR) / denom; + var root22 = (-b2 - sqrtR) / denom; + return [root1, root22]; + }, "solveQuadratic"); + solveCubic = /* @__PURE__ */ __name(function solveCubic2(a2, b2, c3, d2, result) { + var epsilon6 = 1e-5; + if (a2 === 0) { + a2 = epsilon6; + } + b2 /= a2; + c3 /= a2; + d2 /= a2; + var discriminant, q2, r2, dum1, s2, t4, term1, r13; + q2 = (3 * c3 - b2 * b2) / 9; + r2 = -(27 * d2) + b2 * (9 * c3 - 2 * (b2 * b2)); + r2 /= 54; + discriminant = q2 * q2 * q2 + r2 * r2; + result[1] = 0; + term1 = b2 / 3; + if (discriminant > 0) { + s2 = r2 + Math.sqrt(discriminant); + s2 = s2 < 0 ? -Math.pow(-s2, 1 / 3) : Math.pow(s2, 1 / 3); + t4 = r2 - Math.sqrt(discriminant); + t4 = t4 < 0 ? -Math.pow(-t4, 1 / 3) : Math.pow(t4, 1 / 3); + result[0] = -term1 + s2 + t4; + term1 += (s2 + t4) / 2; + result[4] = result[2] = -term1; + term1 = Math.sqrt(3) * (-t4 + s2) / 2; + result[3] = term1; + result[5] = -term1; + return; + } + result[5] = result[3] = 0; + if (discriminant === 0) { + r13 = r2 < 0 ? -Math.pow(-r2, 1 / 3) : Math.pow(r2, 1 / 3); + result[0] = -term1 + 2 * r13; + result[4] = result[2] = -(r13 + term1); + return; + } + q2 = -q2; + dum1 = q2 * q2 * q2; + dum1 = Math.acos(r2 / Math.sqrt(dum1)); + r13 = 2 * Math.sqrt(q2); + result[0] = -term1 + r13 * Math.cos(dum1 / 3); + result[2] = -term1 + r13 * Math.cos((dum1 + 2 * Math.PI) / 3); + result[4] = -term1 + r13 * Math.cos((dum1 + 4 * Math.PI) / 3); + return; + }, "solveCubic"); + sqdistToQuadraticBezier = /* @__PURE__ */ __name(function sqdistToQuadraticBezier2(x5, y5, x1, y1, x22, y22, x32, y32) { + var a2 = 1 * x1 * x1 - 4 * x1 * x22 + 2 * x1 * x32 + 4 * x22 * x22 - 4 * x22 * x32 + x32 * x32 + y1 * y1 - 4 * y1 * y22 + 2 * y1 * y32 + 4 * y22 * y22 - 4 * y22 * y32 + y32 * y32; + var b2 = 1 * 9 * x1 * x22 - 3 * x1 * x1 - 3 * x1 * x32 - 6 * x22 * x22 + 3 * x22 * x32 + 9 * y1 * y22 - 3 * y1 * y1 - 3 * y1 * y32 - 6 * y22 * y22 + 3 * y22 * y32; + var c3 = 1 * 3 * x1 * x1 - 6 * x1 * x22 + x1 * x32 - x1 * x5 + 2 * x22 * x22 + 2 * x22 * x5 - x32 * x5 + 3 * y1 * y1 - 6 * y1 * y22 + y1 * y32 - y1 * y5 + 2 * y22 * y22 + 2 * y22 * y5 - y32 * y5; + var d2 = 1 * x1 * x22 - x1 * x1 + x1 * x5 - x22 * x5 + y1 * y22 - y1 * y1 + y1 * y5 - y22 * y5; + var roots = []; + solveCubic(a2, b2, c3, d2, roots); + var zeroThreshold = 1e-7; + var params = []; + for (var index = 0; index < 6; index += 2) { + if (Math.abs(roots[index + 1]) < zeroThreshold && roots[index] >= 0 && roots[index] <= 1) { + params.push(roots[index]); + } + } + params.push(1); + params.push(0); + var minDistanceSquared = -1; + var curX, curY, distSquared; + for (var i2 = 0; i2 < params.length; i2++) { + curX = Math.pow(1 - params[i2], 2) * x1 + 2 * (1 - params[i2]) * params[i2] * x22 + params[i2] * params[i2] * x32; + curY = Math.pow(1 - params[i2], 2) * y1 + 2 * (1 - params[i2]) * params[i2] * y22 + params[i2] * params[i2] * y32; + distSquared = Math.pow(curX - x5, 2) + Math.pow(curY - y5, 2); + if (minDistanceSquared >= 0) { + if (distSquared < minDistanceSquared) { + minDistanceSquared = distSquared; } - function bvc() { - $uc(); - return cD(WC(hX, 1), jwe, 282, 0, [Yuc, Vuc, Zuc, Xuc, Wuc, Uuc]); + } else { + minDistanceSquared = distSquared; + } + } + return minDistanceSquared; + }, "sqdistToQuadraticBezier"); + sqdistToFiniteLine = /* @__PURE__ */ __name(function sqdistToFiniteLine2(x5, y5, x1, y1, x22, y22) { + var offset = [x5 - x1, y5 - y1]; + var line2 = [x22 - x1, y22 - y1]; + var lineSq = line2[0] * line2[0] + line2[1] * line2[1]; + var hypSq = offset[0] * offset[0] + offset[1] * offset[1]; + var dotProduct = offset[0] * line2[0] + offset[1] * line2[1]; + var adjSq = dotProduct * dotProduct / lineSq; + if (dotProduct < 0) { + return hypSq; + } + if (adjSq > lineSq) { + return (x5 - x22) * (x5 - x22) + (y5 - y22) * (y5 - y22); + } + return hypSq - adjSq; + }, "sqdistToFiniteLine"); + pointInsidePolygonPoints = /* @__PURE__ */ __name(function pointInsidePolygonPoints2(x5, y5, points) { + var x1, y1, x22, y22; + var y32; + var up = 0; + for (var i2 = 0; i2 < points.length / 2; i2++) { + x1 = points[i2 * 2]; + y1 = points[i2 * 2 + 1]; + if (i2 + 1 < points.length / 2) { + x22 = points[(i2 + 1) * 2]; + y22 = points[(i2 + 1) * 2 + 1]; + } else { + x22 = points[(i2 + 1 - points.length / 2) * 2]; + y22 = points[(i2 + 1 - points.length / 2) * 2 + 1]; + } + if (x1 == x5 && x22 == x5) ; + else if (x1 >= x5 && x5 >= x22 || x1 <= x5 && x5 <= x22) { + y32 = (x5 - x1) / (x22 - x1) * (y22 - y1) + y1; + if (y32 > y5) { + up++; } - function etc() { - btc(); - return cD(WC(ZW, 1), jwe, 232, 0, [Zsc, _sc, Ysc, $sc, atc, Xsc]); + } else { + continue; + } + } + if (up % 2 === 0) { + return false; + } else { + return true; + } + }, "pointInsidePolygonPoints"); + pointInsidePolygon = /* @__PURE__ */ __name(function pointInsidePolygon2(x5, y5, basePoints, centerX, centerY, width3, height2, direction4, padding3) { + var transformedPoints = new Array(basePoints.length); + var angle2; + if (direction4[0] != null) { + angle2 = Math.atan(direction4[1] / direction4[0]); + if (direction4[0] < 0) { + angle2 = angle2 + Math.PI / 2; + } else { + angle2 = -angle2 - Math.PI / 2; + } + } else { + angle2 = direction4; + } + var cos3 = Math.cos(-angle2); + var sin3 = Math.sin(-angle2); + for (var i2 = 0; i2 < transformedPoints.length / 2; i2++) { + transformedPoints[i2 * 2] = width3 / 2 * (basePoints[i2 * 2] * cos3 - basePoints[i2 * 2 + 1] * sin3); + transformedPoints[i2 * 2 + 1] = height2 / 2 * (basePoints[i2 * 2 + 1] * cos3 + basePoints[i2 * 2] * sin3); + transformedPoints[i2 * 2] += centerX; + transformedPoints[i2 * 2 + 1] += centerY; + } + var points; + if (padding3 > 0) { + var expandedLineSet = expandPolygon(transformedPoints, -padding3); + points = joinLines(expandedLineSet); + } else { + points = transformedPoints; + } + return pointInsidePolygonPoints(x5, y5, points); + }, "pointInsidePolygon"); + pointInsideRoundPolygon = /* @__PURE__ */ __name(function pointInsideRoundPolygon2(x5, y5, basePoints, centerX, centerY, width3, height2, corners) { + var cutPolygonPoints = new Array(basePoints.length * 2); + for (var i2 = 0; i2 < corners.length; i2++) { + var corner = corners[i2]; + cutPolygonPoints[i2 * 4 + 0] = corner.startX; + cutPolygonPoints[i2 * 4 + 1] = corner.startY; + cutPolygonPoints[i2 * 4 + 2] = corner.stopX; + cutPolygonPoints[i2 * 4 + 3] = corner.stopY; + var squaredDistance = Math.pow(corner.cx - x5, 2) + Math.pow(corner.cy - y5, 2); + if (squaredDistance <= Math.pow(corner.radius, 2)) { + return true; + } + } + return pointInsidePolygonPoints(x5, y5, cutPolygonPoints); + }, "pointInsideRoundPolygon"); + joinLines = /* @__PURE__ */ __name(function joinLines2(lineSet) { + var vertices2 = new Array(lineSet.length / 2); + var currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY; + var nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY; + for (var i2 = 0; i2 < lineSet.length / 4; i2++) { + currentLineStartX = lineSet[i2 * 4]; + currentLineStartY = lineSet[i2 * 4 + 1]; + currentLineEndX = lineSet[i2 * 4 + 2]; + currentLineEndY = lineSet[i2 * 4 + 3]; + if (i2 < lineSet.length / 4 - 1) { + nextLineStartX = lineSet[(i2 + 1) * 4]; + nextLineStartY = lineSet[(i2 + 1) * 4 + 1]; + nextLineEndX = lineSet[(i2 + 1) * 4 + 2]; + nextLineEndY = lineSet[(i2 + 1) * 4 + 3]; + } else { + nextLineStartX = lineSet[0]; + nextLineStartY = lineSet[1]; + nextLineEndX = lineSet[2]; + nextLineEndY = lineSet[3]; + } + var intersection3 = finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true); + vertices2[i2 * 2] = intersection3[0]; + vertices2[i2 * 2 + 1] = intersection3[1]; + } + return vertices2; + }, "joinLines"); + expandPolygon = /* @__PURE__ */ __name(function expandPolygon2(points, pad3) { + var expandedLineSet = new Array(points.length * 2); + var currentPointX, currentPointY, nextPointX, nextPointY; + for (var i2 = 0; i2 < points.length / 2; i2++) { + currentPointX = points[i2 * 2]; + currentPointY = points[i2 * 2 + 1]; + if (i2 < points.length / 2 - 1) { + nextPointX = points[(i2 + 1) * 2]; + nextPointY = points[(i2 + 1) * 2 + 1]; + } else { + nextPointX = points[0]; + nextPointY = points[1]; + } + var offsetX = nextPointY - currentPointY; + var offsetY = -(nextPointX - currentPointX); + var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY); + var normalizedOffsetX = offsetX / offsetLength; + var normalizedOffsetY = offsetY / offsetLength; + expandedLineSet[i2 * 4] = currentPointX + normalizedOffsetX * pad3; + expandedLineSet[i2 * 4 + 1] = currentPointY + normalizedOffsetY * pad3; + expandedLineSet[i2 * 4 + 2] = nextPointX + normalizedOffsetX * pad3; + expandedLineSet[i2 * 4 + 3] = nextPointY + normalizedOffsetY * pad3; + } + return expandedLineSet; + }, "expandPolygon"); + intersectLineEllipse = /* @__PURE__ */ __name(function intersectLineEllipse2(x5, y5, centerX, centerY, ellipseWradius, ellipseHradius) { + var dispX = centerX - x5; + var dispY = centerY - y5; + dispX /= ellipseWradius; + dispY /= ellipseHradius; + var len = Math.sqrt(dispX * dispX + dispY * dispY); + var newLength = len - 1; + if (newLength < 0) { + return []; + } + var lenProportion = newLength / len; + return [(centerX - x5) * lenProportion + x5, (centerY - y5) * lenProportion + y5]; + }, "intersectLineEllipse"); + checkInEllipse = /* @__PURE__ */ __name(function checkInEllipse2(x5, y5, width3, height2, centerX, centerY, padding3) { + x5 -= centerX; + y5 -= centerY; + x5 /= width3 / 2 + padding3; + y5 /= height2 / 2 + padding3; + return x5 * x5 + y5 * y5 <= 1; + }, "checkInEllipse"); + intersectLineCircle = /* @__PURE__ */ __name(function intersectLineCircle2(x1, y1, x22, y22, centerX, centerY, radius2) { + var d2 = [x22 - x1, y22 - y1]; + var f3 = [x1 - centerX, y1 - centerY]; + var a2 = d2[0] * d2[0] + d2[1] * d2[1]; + var b2 = 2 * (f3[0] * d2[0] + f3[1] * d2[1]); + var c3 = f3[0] * f3[0] + f3[1] * f3[1] - radius2 * radius2; + var discriminant = b2 * b2 - 4 * a2 * c3; + if (discriminant < 0) { + return []; + } + var t13 = (-b2 + Math.sqrt(discriminant)) / (2 * a2); + var t22 = (-b2 - Math.sqrt(discriminant)) / (2 * a2); + var tMin = Math.min(t13, t22); + var tMax = Math.max(t13, t22); + var inRangeParams = []; + if (tMin >= 0 && tMin <= 1) { + inRangeParams.push(tMin); + } + if (tMax >= 0 && tMax <= 1) { + inRangeParams.push(tMax); + } + if (inRangeParams.length === 0) { + return []; + } + var nearIntersectionX = inRangeParams[0] * d2[0] + x1; + var nearIntersectionY = inRangeParams[0] * d2[1] + y1; + if (inRangeParams.length > 1) { + if (inRangeParams[0] == inRangeParams[1]) { + return [nearIntersectionX, nearIntersectionY]; + } else { + var farIntersectionX = inRangeParams[1] * d2[0] + x1; + var farIntersectionY = inRangeParams[1] * d2[1] + y1; + return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY]; + } + } else { + return [nearIntersectionX, nearIntersectionY]; + } + }, "intersectLineCircle"); + midOfThree = /* @__PURE__ */ __name(function midOfThree2(a2, b2, c3) { + if (b2 <= a2 && a2 <= c3 || c3 <= a2 && a2 <= b2) { + return a2; + } else if (a2 <= b2 && b2 <= c3 || c3 <= b2 && b2 <= a2) { + return b2; + } else { + return c3; + } + }, "midOfThree"); + finiteLinesIntersect = /* @__PURE__ */ __name(function finiteLinesIntersect2(x1, y1, x22, y22, x32, y32, x42, y42, infiniteLines) { + var dx13 = x1 - x32; + var dx21 = x22 - x1; + var dx43 = x42 - x32; + var dy13 = y1 - y32; + var dy21 = y22 - y1; + var dy43 = y42 - y32; + var ua_t = dx43 * dy13 - dy43 * dx13; + var ub_t = dx21 * dy13 - dy21 * dx13; + var u_b = dy43 * dx21 - dx43 * dy21; + if (u_b !== 0) { + var ua = ua_t / u_b; + var ub = ub_t / u_b; + var flptThreshold = 1e-3; + var _min = 0 - flptThreshold; + var _max = 1 + flptThreshold; + if (_min <= ua && ua <= _max && _min <= ub && ub <= _max) { + return [x1 + ua * dx21, y1 + ua * dy21]; + } else { + if (!infiniteLines) { + return []; + } else { + return [x1 + ua * dx21, y1 + ua * dy21]; } - function u3b() { - r3b(); - return cD(WC(hR, 1), jwe, 273, 0, [p3b, o3b, m3b, q3b, n3b, l3b]); + } + } else { + if (ua_t === 0 || ub_t === 0) { + if (midOfThree(x1, x22, x42) === x42) { + return [x42, y42]; } - function Uod() { - Pod(); - return cD(WC(D3, 1), jwe, 279, 0, [Nod, Lod, Mod, Kod, Jod, Ood]); + if (midOfThree(x1, x22, x32) === x32) { + return [x32, y32]; } - function God() { - Bod(); - return cD(WC(C3, 1), jwe, 101, 0, [Aod, zod, yod, vod, xod, wod]); + if (midOfThree(x32, x42, x22) === x22) { + return [x22, y22]; } - function lnd() { - ind(); - return cD(WC(v3, 1), jwe, 321, 0, [gnd, end2, hnd, cnd, fnd, dnd]); + return []; + } else { + return []; + } + } + }, "finiteLinesIntersect"); + polygonIntersectLine = /* @__PURE__ */ __name(function polygonIntersectLine2(x5, y5, basePoints, centerX, centerY, width3, height2, padding3) { + var intersections = []; + var intersection3; + var transformedPoints = new Array(basePoints.length); + var doTransform = true; + if (width3 == null) { + doTransform = false; + } + var points; + if (doTransform) { + for (var i2 = 0; i2 < transformedPoints.length / 2; i2++) { + transformedPoints[i2 * 2] = basePoints[i2 * 2] * width3 + centerX; + transformedPoints[i2 * 2 + 1] = basePoints[i2 * 2 + 1] * height2 + centerY; + } + if (padding3 > 0) { + var expandedLineSet = expandPolygon(transformedPoints, -padding3); + points = joinLines(expandedLineSet); + } else { + points = transformedPoints; + } + } else { + points = basePoints; + } + var currentX, currentY, nextX, nextY; + for (var _i2 = 0; _i2 < points.length / 2; _i2++) { + currentX = points[_i2 * 2]; + currentY = points[_i2 * 2 + 1]; + if (_i2 < points.length / 2 - 1) { + nextX = points[(_i2 + 1) * 2]; + nextY = points[(_i2 + 1) * 2 + 1]; + } else { + nextX = points[0]; + nextY = points[1]; + } + intersection3 = finiteLinesIntersect(x5, y5, centerX, centerY, currentX, currentY, nextX, nextY); + if (intersection3.length !== 0) { + intersections.push(intersection3[0], intersection3[1]); + } + } + return intersections; + }, "polygonIntersectLine"); + roundPolygonIntersectLine = /* @__PURE__ */ __name(function roundPolygonIntersectLine2(x5, y5, basePoints, centerX, centerY, width3, height2, padding3, corners) { + var intersections = []; + var intersection3; + var lines = new Array(basePoints.length * 2); + corners.forEach(function(corner, i3) { + if (i3 === 0) { + lines[lines.length - 2] = corner.startX; + lines[lines.length - 1] = corner.startY; + } else { + lines[i3 * 4 - 2] = corner.startX; + lines[i3 * 4 - 1] = corner.startY; + } + lines[i3 * 4] = corner.stopX; + lines[i3 * 4 + 1] = corner.stopY; + intersection3 = intersectLineCircle(x5, y5, centerX, centerY, corner.cx, corner.cy, corner.radius); + if (intersection3.length !== 0) { + intersections.push(intersection3[0], intersection3[1]); + } + }); + for (var i2 = 0; i2 < lines.length / 4; i2++) { + intersection3 = finiteLinesIntersect(x5, y5, centerX, centerY, lines[i2 * 4], lines[i2 * 4 + 1], lines[i2 * 4 + 2], lines[i2 * 4 + 3], false); + if (intersection3.length !== 0) { + intersections.push(intersection3[0], intersection3[1]); + } + } + if (intersections.length > 2) { + var lowestIntersection = [intersections[0], intersections[1]]; + var lowestSquaredDistance = Math.pow(lowestIntersection[0] - x5, 2) + Math.pow(lowestIntersection[1] - y5, 2); + for (var _i3 = 1; _i3 < intersections.length / 2; _i3++) { + var squaredDistance = Math.pow(intersections[_i3 * 2] - x5, 2) + Math.pow(intersections[_i3 * 2 + 1] - y5, 2); + if (squaredDistance <= lowestSquaredDistance) { + lowestIntersection[0] = intersections[_i3 * 2]; + lowestIntersection[1] = intersections[_i3 * 2 + 1]; + lowestSquaredDistance = squaredDistance; } - function Ujd() { - Rjd(); - return cD(WC(n3, 1), jwe, 255, 0, [Ljd, Ojd, Pjd, Qjd, Mjd, Njd]); + } + return lowestIntersection; + } + return intersections; + }, "roundPolygonIntersectLine"); + shortenIntersection = /* @__PURE__ */ __name(function shortenIntersection2(intersection3, offset, amount) { + var disp = [intersection3[0] - offset[0], intersection3[1] - offset[1]]; + var length2 = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]); + var lenRatio = (length2 - amount) / length2; + if (lenRatio < 0) { + lenRatio = 1e-5; + } + return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]]; + }, "shortenIntersection"); + generateUnitNgonPointsFitToSquare = /* @__PURE__ */ __name(function generateUnitNgonPointsFitToSquare2(sides, rotationRadians) { + var points = generateUnitNgonPoints(sides, rotationRadians); + points = fitPolygonToSquare(points); + return points; + }, "generateUnitNgonPointsFitToSquare"); + fitPolygonToSquare = /* @__PURE__ */ __name(function fitPolygonToSquare2(points) { + var x5, y5; + var sides = points.length / 2; + var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; + for (var i2 = 0; i2 < sides; i2++) { + x5 = points[2 * i2]; + y5 = points[2 * i2 + 1]; + minX = Math.min(minX, x5); + maxX = Math.max(maxX, x5); + minY = Math.min(minY, y5); + maxY = Math.max(maxY, y5); + } + var sx = 2 / (maxX - minX); + var sy = 2 / (maxY - minY); + for (var _i4 = 0; _i4 < sides; _i4++) { + x5 = points[2 * _i4] = points[2 * _i4] * sx; + y5 = points[2 * _i4 + 1] = points[2 * _i4 + 1] * sy; + minX = Math.min(minX, x5); + maxX = Math.max(maxX, x5); + minY = Math.min(minY, y5); + maxY = Math.max(maxY, y5); + } + if (minY < -1) { + for (var _i5 = 0; _i5 < sides; _i5++) { + y5 = points[2 * _i5 + 1] = points[2 * _i5 + 1] + (-1 - minY); + } + } + return points; + }, "fitPolygonToSquare"); + generateUnitNgonPoints = /* @__PURE__ */ __name(function generateUnitNgonPoints2(sides, rotationRadians) { + var increment = 1 / sides * 2 * Math.PI; + var startAngle = sides % 2 === 0 ? Math.PI / 2 + increment / 2 : Math.PI / 2; + startAngle += rotationRadians; + var points = new Array(sides * 2); + var currentAngle; + for (var i2 = 0; i2 < sides; i2++) { + currentAngle = i2 * increment + startAngle; + points[2 * i2] = Math.cos(currentAngle); + points[2 * i2 + 1] = Math.sin(-currentAngle); + } + return points; + }, "generateUnitNgonPoints"); + getRoundRectangleRadius = /* @__PURE__ */ __name(function getRoundRectangleRadius2(width3, height2) { + return Math.min(width3 / 4, height2 / 4, 8); + }, "getRoundRectangleRadius"); + getRoundPolygonRadius = /* @__PURE__ */ __name(function getRoundPolygonRadius2(width3, height2) { + return Math.min(width3 / 10, height2 / 10, 8); + }, "getRoundPolygonRadius"); + getCutRectangleCornerLength = /* @__PURE__ */ __name(function getCutRectangleCornerLength2() { + return 8; + }, "getCutRectangleCornerLength"); + bezierPtsToQuadCoeff = /* @__PURE__ */ __name(function bezierPtsToQuadCoeff2(p0, p1, p22) { + return [p0 - 2 * p1 + p22, 2 * (p1 - p0), p0]; + }, "bezierPtsToQuadCoeff"); + getBarrelCurveConstants = /* @__PURE__ */ __name(function getBarrelCurveConstants2(width3, height2) { + return { + heightOffset: Math.min(15, 0.05 * height2), + widthOffset: Math.min(100, 0.25 * width3), + ctrlPtOffsetPct: 0.05 + }; + }, "getBarrelCurveConstants"); + pageRankDefaults = defaults$g({ + dampingFactor: 0.8, + precision: 1e-6, + iterations: 200, + weight: /* @__PURE__ */ __name(function weight5(edge) { + return 1; + }, "weight") + }); + elesfn$o = { + pageRank: /* @__PURE__ */ __name(function pageRank(options3) { + var _pageRankDefaults = pageRankDefaults(options3), dampingFactor = _pageRankDefaults.dampingFactor, precision = _pageRankDefaults.precision, iterations = _pageRankDefaults.iterations, weight8 = _pageRankDefaults.weight; + var cy = this._private.cy; + var _this$byGroup = this.byGroup(), nodes6 = _this$byGroup.nodes, edges5 = _this$byGroup.edges; + var numNodes = nodes6.length; + var numNodesSqd = numNodes * numNodes; + var numEdges = edges5.length; + var matrix = new Array(numNodesSqd); + var columnSum = new Array(numNodes); + var additionalProb = (1 - dampingFactor) / numNodes; + for (var i2 = 0; i2 < numNodes; i2++) { + for (var j2 = 0; j2 < numNodes; j2++) { + var n2 = i2 * numNodes + j2; + matrix[n2] = 0; } - function xkd() { - ukd(); - return cD(WC(q3, 1), jwe, 298, 0, [tkd, skd, rkd, pkd, okd, qkd]); + columnSum[i2] = 0; + } + for (var _i = 0; _i < numEdges; _i++) { + var edge = edges5[_i]; + var srcId = edge.data("source"); + var tgtId = edge.data("target"); + if (srcId === tgtId) { + continue; } - function K3d(a) { - var b; - if (!a.a && a.b != -1) { - b = a.c.Dh(); - a.a = vYd(b, a.b); + var s2 = nodes6.indexOfId(srcId); + var t4 = nodes6.indexOfId(tgtId); + var w3 = weight8(edge); + var _n = t4 * numNodes + s2; + matrix[_n] += w3; + columnSum[s2] += w3; + } + var p3 = 1 / numNodes + additionalProb; + for (var _j = 0; _j < numNodes; _j++) { + if (columnSum[_j] === 0) { + for (var _i2 = 0; _i2 < numNodes; _i2++) { + var _n2 = _i2 * numNodes + _j; + matrix[_n2] = p3; + } + } else { + for (var _i3 = 0; _i3 < numNodes; _i3++) { + var _n3 = _i3 * numNodes + _j; + matrix[_n3] = matrix[_n3] / columnSum[_j] + additionalProb; } - return a.a; } - function WGd(a, b) { - if (a.Si() && a.Hc(b)) { - return false; - } else { - a.Hi(b); - return true; - } - } - function RKb(a, b) { - Ivb(b, "Horizontal alignment cannot be null"); - a.b = b; - return a; - } - function ite(a, b, c2) { - Vse(); - var d; - d = hte(a, b); - c2 && !!d && kte(a) && (d = null); - return d; - } - function ZKc(a, b, c2) { - var d; - d = a.b[c2.c.p][c2.p]; - d.b += b.b; - d.c += b.c; - d.a += b.a; - ++d.a; - } - function Umc(a, b, c2) { - var d; - a.d[b.g] = c2; - d = a.g.c; - d[b.g] = $wnd.Math.max(d[b.g], c2 + 1); - } - function bjd(a, b) { - var c2, d; - c2 = a.a - b.a; - d = a.b - b.b; - return $wnd.Math.sqrt(c2 * c2 + d * d); - } - function v$b(a, b) { - var c2, d; - for (d = b.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 36); - u$b(a, c2, 0, 0); - } - } - function x$b(a, b, c2) { - var d, e; - for (e = a.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 36); - w$b(d, b, c2); - } - } - function G0c(a) { - var b, c2; - for (c2 = Sub(a.a, 0); c2.b != c2.d.c; ) { - b = RD(evb(c2), 65); - H0c(b); - } - } - function nnc(a, b) { - bub(a.e, b) || dub(a.e, b, new tnc(b)); - return RD(cub(a.e, b), 113); - } - function tBb(a, b, c2, d) { - uFb(a); - uFb(b); - uFb(c2); - uFb(d); - return new DBb(a, b, new NAb()); - } - function DVd(a, b, c2, d) { - this.ak(); - this.a = b; - this.b = a; - this.c = new wje(this, b, c2, d); - } - function O3d(a, b, c2, d, e, f2) { - MKd.call(this, b, d, e, f2); - this.c = a; - this.b = c2; - } - function c4d(a, b, c2, d, e, f2) { - MKd.call(this, b, d, e, f2); - this.c = a; - this.a = c2; - } - function Q9c(a, b) { - var c2, d, e; - e = a.r; - d = a.d; - c2 = S9c(a, b, true); - return c2.b != e || c2.a != d; - } - function Vee(a, b, c2) { - var d, e; - e = (d = N5d(a.b, b), d); - return !e ? null : tfe(Pee(a, e), c2); - } - function _Dd(a, b, c2) { - var d, e, f2; - d = qC(a, c2); - e = null; - !!d && (e = ADd(d)); - f2 = e; - tEd(b, c2, f2); - } - function aEd(a, b, c2) { - var d, e, f2; - d = qC(a, c2); - e = null; - !!d && (e = ADd(d)); - f2 = e; - tEd(b, c2, f2); - } - function Evd(a, b) { - var c2; - return c2 = a.Ih(b), c2 >= 0 ? a.Lh(c2, true, true) : Qvd(a, b, true); - } - function gMc(a, b, c2) { - var d; - d = qMc(a, b, c2); - a.b = new _Lc(d.c.length); - return iMc(a, d); - } - function Pue(a) { - if (a.b <= 0) - throw Adb(new Dvb()); - --a.b; - a.a -= a.c.c; - return sgb(a.a); - } - function PGd(a) { - var b; - if (!a.a) { - throw Adb(new Evb()); - } - b = a.a; - a.a = vCd(a.a); - return b; - } - function WDb(a) { - while (!a.a) { - if (!yEb(a.c, new $Db(a))) { - return false; - } - } - return true; - } - function Nr(a) { - var b; - Qb(a); - if (ZD(a, 204)) { - b = RD(a, 204); - return b; - } - return new Or(a); - } - function Cfd(a) { - Afd(); - RD(a.of((umd(), Lld)), 181).Fc((Pod(), Mod)); - a.qf(Kld, null); - } - function Afd() { - Afd = geb; - xfd = new Gfd(); - zfd = new Ifd(); - yfd = yn((umd(), Kld), xfd, pld, zfd); - } - function Y3c() { - Y3c = geb; - W3c = new $3c("LEAF_NUMBER", 0); - X3c = new $3c("NODE_SIZE", 1); - } - function YLc(a) { - a.a = $C(kE, Pwe, 28, a.b + 1, 15, 1); - a.c = $C(kE, Pwe, 28, a.b, 15, 1); - a.d = 0; - } - function OZb(a, b) { - if (a.a.Ne(b.d, a.b) > 0) { - Rmb(a.c, new fZb(b.c, b.d, a.d)); - a.b = b.d; - } - } - function NHd(a, b) { - if (a.g == null || b >= a.i) - throw Adb(new yNd(b, a.i)); - return a.g[b]; - } - function P_d(a, b, c2) { - gHd(a, c2); - if (c2 != null && !a.fk(c2)) { - throw Adb(new yeb()); - } - return c2; - } - function dD(a, b) { - XC(b) != 10 && cD(rb(b), b.Sm, b.__elementTypeId$, XC(b), a); - return a; - } - function Wnb(a, b, c2, d) { - var e; - d = (urb(), !d ? rrb : d); - e = a.slice(b, c2); - Xnb(e, a, b, c2, -b, d); - } - function zvd(a, b, c2, d, e) { - return b < 0 ? Qvd(a, c2, d) : RD(c2, 69).wk().yk(a, a.hi(), b, d, e); - } - function J9b(a, b) { - return Qfb(Kfb(UD(mQb(a, (Ywc(), Jwc)))), Kfb(UD(mQb(b, Jwc)))); - } - function qAb() { - qAb = geb; - pAb = ss((cAb(), cD(WC(AL, 1), jwe, 304, 0, [$zb, _zb, aAb, bAb]))); - } - function cAb() { - cAb = geb; - $zb = new dAb("All", 0); - _zb = new iAb(); - aAb = new kAb(); - bAb = new nAb(); - } - function EKb() { - EKb = geb; - CKb = new FKb(Nye, 0); - BKb = new FKb(Kye, 1); - DKb = new FKb(Oye, 2); - } - function Zme() { - Zme = geb; - qAd(); - Wme = oxe; - Vme = pxe; - Yme = new Tfb(oxe); - Xme = new Tfb(pxe); - } - function rOb() { - rOb = geb; - qOb = ss((mOb(), cD(WC(hO, 1), jwe, 417, 0, [lOb, iOb, jOb, kOb]))); - } - function NRb() { - NRb = geb; - MRb = ss((IRb(), cD(WC(WO, 1), jwe, 406, 0, [FRb, ERb, GRb, HRb]))); - } - function NPb() { - NPb = geb; - MPb = ss((IPb(), cD(WC(DO, 1), jwe, 332, 0, [FPb, EPb, GPb, HPb]))); - } - function Z$b() { - Z$b = geb; - Y$b = ss((U$b(), cD(WC(CQ, 1), jwe, 389, 0, [T$b, R$b, Q$b, S$b]))); - } - function wZb() { - wZb = geb; - vZb = ss((nZb(), cD(WC(lQ, 1), jwe, 416, 0, [jZb, mZb, kZb, lZb]))); - } - function jnc() { - jnc = geb; - inc = ss((enc(), cD(WC(LV, 1), jwe, 421, 0, [anc, bnc, cnc, dnc]))); - } - function Bec() { - Bec = geb; - Aec = ss((vec(), cD(WC(qT, 1), jwe, 371, 0, [uec, sec, tec, rec]))); - } - function DDc() { - DDc = geb; - CDc = ss((wDc(), cD(WC(tX, 1), jwe, 203, 0, [uDc, vDc, tDc, sDc]))); - } - function pEc() { - pEc = geb; - oEc = ss((kEc(), cD(WC(wX, 1), jwe, 284, 0, [hEc, gEc, iEc, jEc]))); - } - function Cuc() { - Cuc = geb; - Buc = new Duc(LAe, 0); - Auc = new Duc("IMPROVE_STRAIGHTNESS", 1); - } - function _i6(a, b) { - var c2, d; - d = b / a.c.Rd().gc() | 0; - c2 = b % a.c.Rd().gc(); - return Ui(a, d, c2); - } - function iZd(a) { - var b; - if (a.nl()) { - for (b = a.i - 1; b >= 0; --b) { - QHd(a, b); - } - } - return WHd(a); - } - function Nyb(a) { - var b, c2; - if (!a.b) { - return null; - } - c2 = a.b; - while (b = c2.a[0]) { - c2 = b; - } - return c2; - } - function Oyb(a) { - var b, c2; - if (!a.b) { - return null; - } - c2 = a.b; - while (b = c2.a[1]) { - c2 = b; - } - return c2; - } - function Hae(a) { - if (ZD(a, 180)) { - return "" + RD(a, 180).a; - } - return a == null ? null : jeb(a); - } - function Iae(a) { - if (ZD(a, 180)) { - return "" + RD(a, 180).a; - } - return a == null ? null : jeb(a); - } - function eGb(a, b) { - if (b.a) { - throw Adb(new yz(jye)); - } - Ysb(a.a, b); - b.a = a; - !a.j && (a.j = b); - } - function hEb(a, b) { - xxb.call(this, b.zd(), b.yd() & -16449); - uFb(a); - this.a = a; - this.c = b; - } - function zXc(a, b) { - return new gud(b, Zid(ajd(b.e), b.f.a + a, b.f.b + a), (Geb(), false)); - } - function EMc(a, b) { - dMc(); - return Rmb(a, new Ptd(b, sgb(b.e.c.length + b.g.c.length))); - } - function GMc(a, b) { - dMc(); - return Rmb(a, new Ptd(b, sgb(b.e.c.length + b.g.c.length))); - } - function p5c() { - p5c = geb; - o5c = ss((j5c(), cD(WC(M0, 1), jwe, 354, 0, [i5c, g5c, h5c, f5c]))); - } - function x_c() { - x_c = geb; - w_c = ss((s_c(), cD(WC(J_, 1), jwe, 353, 0, [r_c, p_c, q_c, o_c]))); - } - function eWc() { - eWc = geb; - dWc = ss((YVc(), cD(WC(H$, 1), jwe, 405, 0, [UVc, VVc, WVc, XVc]))); - } - function bnd() { - bnd = geb; - and = ss((Ymd(), cD(WC(u3, 1), jwe, 223, 0, [Xmd, Vmd, Umd, Wmd]))); - } - function Vnd() { - Vnd = geb; - Und = ss((Pnd(), cD(WC(z3, 1), jwe, 291, 0, [Ond, Lnd, Mnd, Nnd]))); - } - function Vpd() { - Vpd = geb; - Upd = ss((Qpd(), cD(WC(H3, 1), jwe, 386, 0, [Opd, Ppd, Npd, Mpd]))); - } - function Lrd() { - Lrd = geb; - Krd = ss((Grd(), cD(WC(R3, 1), jwe, 320, 0, [Frd, Crd, Erd, Drd]))); - } - function ytd() { - ytd = geb; - xtd = ss((ttd(), cD(WC(n4, 1), jwe, 415, 0, [qtd, rtd, ptd, std]))); - } - function b9c() { - b9c = geb; - $8c = new d9c(iFe, 0); - a9c = new d9c(mEe, 1); - _8c = new d9c(LAe, 2); - } - function sBb(a, b, c2, d, e) { - uFb(a); - uFb(b); - uFb(c2); - uFb(d); - uFb(e); - return new DBb(a, b, d); - } - function fub(a, b) { - var c2; - c2 = RD(_jb(a.e, b), 400); - if (c2) { - rub(c2); - return c2.e; - } - return null; + } + var eigenvector = new Array(numNodes); + var temp = new Array(numNodes); + var previous; + for (var _i4 = 0; _i4 < numNodes; _i4++) { + eigenvector[_i4] = 1; + } + for (var iter = 0; iter < iterations; iter++) { + for (var _i5 = 0; _i5 < numNodes; _i5++) { + temp[_i5] = 0; } - function Ymb(a, b) { - var c2; - c2 = Wmb(a, b, 0); - if (c2 == -1) { - return false; + for (var _i6 = 0; _i6 < numNodes; _i6++) { + for (var _j2 = 0; _j2 < numNodes; _j2++) { + var _n4 = _i6 * numNodes + _j2; + temp[_i6] += matrix[_n4] * eigenvector[_j2]; } - Xmb(a, c2); - return true; } - function LDb(a, b, c2) { - var d; - LCb(a); - d = new IEb(); - d.a = b; - a.a.Nb(new QEb(d, c2)); - return d.a; + inPlaceSumNormalize(temp); + previous = eigenvector; + eigenvector = temp; + temp = previous; + var diff2 = 0; + for (var _i7 = 0; _i7 < numNodes; _i7++) { + var delta = previous[_i7] - eigenvector[_i7]; + diff2 += delta * delta; } - function VCb(a) { - var b; - LCb(a); - b = $C(iE, vxe, 28, 0, 15, 1); - ixb(a.a, new dDb(b)); - return b; + if (diff2 < precision) { + break; } - function yc(a) { - var b; - if (!xc(a)) { - throw Adb(new Dvb()); + } + var res = { + rank: /* @__PURE__ */ __name(function rank2(node2) { + node2 = cy.collection(node2)[0]; + return eigenvector[nodes6.indexOf(node2)]; + }, "rank") + }; + return res; + }, "pageRank") + // pageRank + }; + defaults$f = defaults$g({ + root: null, + weight: /* @__PURE__ */ __name(function weight6(edge) { + return 1; + }, "weight"), + directed: false, + alpha: 0 + }); + elesfn$n = { + degreeCentralityNormalized: /* @__PURE__ */ __name(function degreeCentralityNormalized(options3) { + options3 = defaults$f(options3); + var cy = this.cy(); + var nodes6 = this.nodes(); + var numNodes = nodes6.length; + if (!options3.directed) { + var degrees3 = {}; + var maxDegree = 0; + for (var i2 = 0; i2 < numNodes; i2++) { + var node2 = nodes6[i2]; + options3.root = node2; + var currDegree = this.degreeCentrality(options3); + if (maxDegree < currDegree.degree) { + maxDegree = currDegree.degree; } - a.e = 1; - b = a.d; - a.d = null; - return b; + degrees3[node2.id()] = currDegree.degree; } - function Odb(a) { - var b; - if (Kdb(a)) { - b = 0 - a; - if (!isNaN(b)) { - return b; + return { + degree: /* @__PURE__ */ __name(function degree(node3) { + if (maxDegree === 0) { + return 0; } - } - return Edb(xD(a)); - } - function Wmb(a, b, c2) { - for (; c2 < a.c.length; ++c2) { - if (Fvb(b, a.c[c2])) { - return c2; + if (string(node3)) { + node3 = cy.filter(node3); } - } - return -1; + return degrees3[node3.id()] / maxDegree; + }, "degree") + }; + } else { + var indegrees = {}; + var outdegrees = {}; + var maxIndegree = 0; + var maxOutdegree = 0; + for (var _i = 0; _i < numNodes; _i++) { + var _node = nodes6[_i]; + var id26 = _node.id(); + options3.root = _node; + var _currDegree = this.degreeCentrality(options3); + if (maxIndegree < _currDegree.indegree) maxIndegree = _currDegree.indegree; + if (maxOutdegree < _currDegree.outdegree) maxOutdegree = _currDegree.outdegree; + indegrees[id26] = _currDegree.indegree; + outdegrees[id26] = _currDegree.outdegree; } - function Gmc(a) { - var b, c2; - c2 = RD(Vmb(a.j, 0), 12); - b = RD(mQb(c2, (Ywc(), Awc)), 12); - return b; - } - function Nu(a, b) { - var c2; - this.f = a; - this.b = b; - c2 = RD(Wjb(a.b, b), 260); - this.c = !c2 ? null : c2.b; - } - function Ckc() { - lkc(); - this.b = new Tsb(); - this.f = new Tsb(); - this.g = new Tsb(); - this.e = new Tsb(); - } - function RSd(a) { - ez(this); - this.g = !a ? null : lz(a, a.ie()); - this.f = a; - gz(this); - this.je(); - } - function pKd(a) { - var b; - b = a.jj(); - b != null && a.d != -1 && RD(b, 94).xh(a); - !!a.i && a.i.oj(); - } - function asc(a) { - var b; - for (b = a.p + 1; b < a.c.a.c.length; ++b) { - --RD(Vmb(a.c.a, b), 10).p; - } - } - function ukb(a) { - yFb(!!a.c); - rFb(a.f.g, a.d); - a.c.Qb(); - a.c = null; - a.b = skb(a); - a.d = a.f.g; - } - function o4d(a) { - if (!a.b) { - a.b = new s5d(a, o7, a); - !a.a && (a.a = new F4d(a, a)); - } - return a.b; - } - function Pee(a, b) { - var c2, d; - c2 = RD(b, 690); - d = c2.xi(); - !d && c2.Ai(d = new wfe(a, b)); - return d; - } - function Qee(a, b) { - var c2, d; - c2 = RD(b, 692); - d = c2.$k(); - !d && c2.cl(d = new Jfe(a, b)); - return d; - } - function _jc(a, b) { - Wjc(); - var c2, d; - c2 = $jc(a); - d = $jc(b); - return !!c2 && !!d && !Aob(c2.k, d.k); - } - function WFb(a, b) { - return Fvb(b, Vmb(a.f, 0)) || Fvb(b, Vmb(a.f, 1)) || Fvb(b, Vmb(a.f, 2)); - } - function Med(a, b) { - if (b < 0) { - throw Adb(new veb(zGe + b)); - } - Led(a, b + 1); - return Vmb(a.j, b); - } - function Ob(a, b, c2, d) { - if (!a) { - throw Adb(new agb(hc(b, cD(WC(jJ, 1), rve, 1, 5, [c2, d])))); - } - } - function P3d(a, b, c2, d, e, f2, g) { - NKd.call(this, b, d, e, f2, g); - this.c = a; - this.b = c2; - } - function UA(a, b, c2) { - var d, e; - d = 10; - for (e = 0; e < c2 - 1; e++) { - b < d && (a.a += "0", a); - d *= 10; - } - a.a += b; - } - function Ahb(a) { - var b, c2; - c2 = a.length; - b = $C(hE, zwe, 28, c2, 15, 1); - nhb(a, 0, c2, b, 0); - return b; - } - function $eb(a) { - Zeb(); - var b, c2; - b = a + 128; - c2 = Yeb[b]; - !c2 && (c2 = Yeb[b] = new Seb(a)); - return c2; - } - function Cub(a) { - rFb(a.d.a.e.g, a.b); - sFb(a.c != a.d.a.d); - a.a = a.c; - a.c = a.c.a; - return a.a; - } - function mDc(a) { - switch (a.g) { - case 0: - return lve; - case 1: - return -1; - default: + return { + indegree: /* @__PURE__ */ __name(function indegree(node3) { + if (maxIndegree == 0) { return 0; - } - } - function ED(a) { - if (uD(a, (MD(), LD)) < 0) { - return -qD(xD(a)); - } - return a.l + a.m * gxe + a.h * hxe; - } - function etd(a) { - (!this.q ? (yob(), yob(), wob) : this.q).Ac(!a.q ? (yob(), yob(), wob) : a.q); - } - function Eud(a, b) { - Cod(RD(RD(a.f, 27).of((umd(), Hld)), 101)) && lQd(wCd(RD(a.f, 27)), b); - } - function Gvd(a, b) { - var c2; - c2 = BYd(a.d, b); - return c2 >= 0 ? Dvd(a, c2, true, true) : Qvd(a, b, true); - } - function Vwd(a) { - var b; - b = SD(Ywd(a, 32)); - if (b == null) { - Wwd(a); - b = SD(Ywd(a, 32)); - } - return b; - } - function Yvd(a) { - var b; - if (!a.Oh()) { - b = AYd(a.Dh()) - a.ji(); - a.$h().Mk(b); - } - return a.zh(); - } - function zQb(a, b) { - yQb = new kRb(); - wQb = b; - xQb = a; - RD(xQb.b, 68); - BQb(xQb, yQb, null); - AQb(xQb); - } - function AWb() { - AWb = geb; - yWb = new BWb("XY", 0); - xWb = new BWb("X", 1); - zWb = new BWb("Y", 2); - } - function vLb() { - vLb = geb; - uLb = new wLb("TOP", 0); - tLb = new wLb(Kye, 1); - sLb = new wLb(Qye, 2); - } - function Gvc() { - Gvc = geb; - Evc = new Hvc(LAe, 0); - Fvc = new Hvc("TOP", 1); - Dvc = new Hvc(Qye, 2); - } - function sEc() { - sEc = geb; - qEc = new tEc("INPUT_ORDER", 0); - rEc = new tEc("PORT_DEGREE", 1); - } - function MD() { - MD = geb; - ID = hD(dxe, dxe, 524287); - JD = hD(0, 0, fxe); - KD = fD(1); - fD(2); - LD = fD(0); - } - function wWd(a) { - var b; - if (a.d != a.r) { - b = WVd(a); - a.e = !!b && b.lk() == aKe; - a.d = b; - } - return a.e; - } - function UHd(a, b, c2) { - var d; - d = a.g[b]; - MHd(a, b, a.Zi(b, c2)); - a.Ri(b, c2, d); - a.Ni(); - return d; - } - function dHd(a, b) { - var c2; - c2 = a.dd(b); - if (c2 >= 0) { - a.gd(c2); - return true; - } else { - return false; - } - } - function xr(a, b) { - var c2; - Qb(a); - Qb(b); - c2 = false; - while (b.Ob()) { - c2 = c2 | a.Fc(b.Pb()); - } - return c2; - } - function cub(a, b) { - var c2; - c2 = RD(Wjb(a.e, b), 400); - if (c2) { - eub(a, c2); - return c2.e; - } - return null; - } - function iB(a) { - var b, c2; - b = a / 60 | 0; - c2 = a % 60; - if (c2 == 0) { - return "" + b; - } - return "" + b + ":" + ("" + c2); - } - function JB(d, a) { - var b = d.a[a]; - var c2 = (HC(), GC)[typeof b]; - return c2 ? c2(b) : NC(typeof b); - } - function EDb(a, b) { - var c2, d; - MCb(a); - d = new zEb(b, a.a); - c2 = new YDb(d); - return new SDb(a, c2); - } - function mwb(a) { - var b; - b = a.b.c.length == 0 ? null : Vmb(a.b, 0); - b != null && owb(a, 0); - return b; - } - function ukc(a, b) { - var c2, d, e; - e = b.c.i; - c2 = RD(Wjb(a.f, e), 60); - d = c2.d.c - c2.e.c; - Bjd(b.a, d, 0); - } - function XLc(a, b) { - var c2; - ++a.d; - ++a.c[b]; - c2 = b + 1; - while (c2 < a.a.length) { - ++a.a[c2]; - c2 += c2 & -c2; - } - } - function Ute(a, b, c2, d) { - Vse(); - Wse.call(this, 26); - this.c = a; - this.a = b; - this.d = c2; - this.b = d; - } - function KA(a, b) { - while (b[0] < a.length && qhb(" \r\n", Fhb(ihb(a, b[0]))) >= 0) { - ++b[0]; - } - } - function eEd(a, b) { - Dyd(a, b == null || Rfb((uFb(b), b)) || isNaN((uFb(b), b)) ? 0 : (uFb(b), b)); - } - function fEd(a, b) { - Eyd(a, b == null || Rfb((uFb(b), b)) || isNaN((uFb(b), b)) ? 0 : (uFb(b), b)); - } - function gEd(a, b) { - Cyd(a, b == null || Rfb((uFb(b), b)) || isNaN((uFb(b), b)) ? 0 : (uFb(b), b)); - } - function hEd(a, b) { - Ayd(a, b == null || Rfb((uFb(b), b)) || isNaN((uFb(b), b)) ? 0 : (uFb(b), b)); - } - function oWc(a, b, c2) { - return cjd(new rjd(c2.e.a + c2.f.a / 2, c2.e.b + c2.f.b / 2), a) == (uFb(b), b); - } - function qge(a, b) { - return ZD(b, 102) && (RD(b, 19).Bb & txe) != 0 ? new She(b, a) : new Phe(b, a); - } - function sge(a, b) { - return ZD(b, 102) && (RD(b, 19).Bb & txe) != 0 ? new She(b, a) : new Phe(b, a); - } - function XC(a) { - return a.__elementTypeCategory$ == null ? 10 : a.__elementTypeCategory$; - } - function Bhb(a, b) { - return b == (wvb(), wvb(), vvb) ? a.toLocaleLowerCase() : a.toLowerCase(); - } - function Mu(a) { - if (!a.e) { - throw Adb(new Dvb()); - } - a.c = a.a = a.e; - a.e = a.e.e; - --a.d; - return a.a.f; - } - function Lu(a) { - if (!a.c) { - throw Adb(new Dvb()); - } - a.e = a.a = a.c; - a.c = a.c.c; - ++a.d; - return a.a.f; - } - function Lsb(a) { - var b; - ++a.a; - for (b = a.c.a.length; a.a < b; ++a.a) { - if (a.c.b[a.a]) { - return; } - } - } - function _z(a) { - var b, c2; - if (a.a) { - c2 = null; - do { - b = a.a; - a.a = null; - c2 = dA(b, c2); - } while (a.a); - a.a = c2; - } - } - function aA(a) { - var b, c2; - if (a.b) { - c2 = null; - do { - b = a.b; - a.b = null; - c2 = dA(b, c2); - } while (a.b); - a.b = c2; - } - } - function eve(a, b) { - var c2; - c2 = 0; - while (a.e != a.i.gc()) { - oFd(b, bMd(a), sgb(c2)); - c2 != lve && ++c2; - } - } - function Llc(a, b) { - var c2; - c2 = $y(a.e.c, b.e.c); - if (c2 == 0) { - return Qfb(a.e.d, b.e.d); - } - return c2; - } - function hdc(a, b) { - var c2, d; - d = b.c; - for (c2 = d + 1; c2 <= b.f; c2++) { - a.a[c2] > a.a[d] && (d = c2); - } - return d; - } - function Krc(a) { - var b; - b = RD(mQb(a, (Ywc(), Wvc)), 313); - if (b) { - return b.a == a; - } - return false; - } - function Lrc(a) { - var b; - b = RD(mQb(a, (Ywc(), Wvc)), 313); - if (b) { - return b.i == a; - } - return false; - } - function xXb() { - xXb = geb; - wXb = ss((sXb(), cD(WC(UP, 1), jwe, 367, 0, [nXb, oXb, pXb, qXb, rXb]))); - } - function Hnc() { - Hnc = geb; - Gnc = ss((Bnc(), cD(WC(TV, 1), jwe, 375, 0, [xnc, znc, Anc, ync, wnc]))); - } - function Xtc() { - Xtc = geb; - Wtc = ss((Ptc(), cD(WC(bX, 1), jwe, 348, 0, [Ltc, Ktc, Ntc, Otc, Mtc]))); - } - function RDc() { - RDc = geb; - QDc = ss((JDc(), cD(WC(uX, 1), jwe, 323, 0, [IDc, FDc, GDc, EDc, HDc]))); - } - function hxc() { - hxc = geb; - gxc = ss((cxc(), cD(WC(mX, 1), jwe, 171, 0, [bxc, Zwc, $wc, _wc, axc]))); - } - function m3c() { - m3c = geb; - l3c = ss((g3c(), cD(WC(x0, 1), jwe, 368, 0, [e3c, b3c, f3c, c3c, d3c]))); - } - function xad() { - xad = geb; - wad = ss((sad(), cD(WC(x1, 1), jwe, 373, 0, [oad, nad, qad, pad2, rad]))); - } - function acd() { - acd = geb; - _bd = ss((Xbd(), cD(WC(P1, 1), jwe, 324, 0, [Sbd, Tbd, Wbd, Ubd, Vbd]))); - } - function Kmd() { - Kmd = geb; - Jmd = ss((Cmd(), cD(WC(s3, 1), jwe, 88, 0, [Amd, zmd, ymd, xmd, Bmd]))); - } - function bid() { - bid = geb; - aid = ss((Yhd(), cD(WC(d3, 1), jwe, 170, 0, [Whd, Vhd, Thd, Xhd, Uhd]))); - } - function uod() { - uod = geb; - tod = ss((pod(), cD(WC(B3, 1), jwe, 256, 0, [mod, ood, kod, lod, nod]))); - } - function zpd() { - zpd = geb; - ypd = ss((qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd]))); - } - function LHb() { - LHb = geb; - JHb = new MHb("BY_SIZE", 0); - KHb = new MHb("BY_SIZE_AND_SHAPE", 1); - } - function TUb() { - TUb = geb; - RUb = new UUb("EADES", 0); - SUb = new UUb("FRUCHTERMAN_REINGOLD", 1); - } - function $tc() { - $tc = geb; - Ytc = new _tc("READING_DIRECTION", 0); - Ztc = new _tc("ROTATION", 1); - } - function CZb() { - CZb = geb; - zZb = new ZZb(); - AZb = new b$b(); - xZb = new f$b(); - yZb = new j$b(); - BZb = new n$b(); - } - function dGb(a) { - this.b = new bnb(); - this.a = new bnb(); - this.c = new bnb(); - this.d = new bnb(); - this.e = a; - } - function XZb(a) { - this.g = a; - this.f = new bnb(); - this.a = $wnd.Math.min(this.g.c.c, this.g.d.c); - } - function UKb(a, b, c2) { - RJb.call(this); - KKb(this); - this.a = a; - this.c = c2; - this.b = b.d; - this.f = b.e; - } - function d6b(a, b, c2) { - var d, e; - for (e = new Anb(c2); e.a < e.c.c.length; ) { - d = ynb(e); - c6b(a, b, d); - } - } - function sC(a, b, c2) { - var d; - if (b == null) { - throw Adb(new Ngb()); - } - d = qC(a, b); - tC(a, b, c2); - return d; - } - function ked(a, b) { - var c2; - c2 = RD(Wjb(a.a, b), 137); - if (!c2) { - c2 = new qQb(); - Zjb(a.a, b, c2); - } - return c2; - } - function vYd(a, b) { - var c2; - c2 = (a.i == null && rYd(a), a.i); - return b >= 0 && b < c2.length ? c2[b] : null; - } - function Gqd(a, b) { - var c2; - c2 = b > 0 ? b - 1 : b; - return Kqd(Lqd(Mqd(Nqd(new Oqd(), c2), a.n), a.j), a.k); - } - function nBd(a) { - var b, c2; - c2 = (b = new q4d(), b); - WGd((!a.q && (a.q = new C5d(s7, a, 11, 10)), a.q), c2); - } - function ofb(a) { - return ((a.i & 2) != 0 ? "interface " : (a.i & 1) != 0 ? "" : "class ") + (lfb(a), a.o); - } - function dz(a) { - if (Ddb(a, lve) > 0) { - return lve; - } - if (Ddb(a, qwe) < 0) { - return qwe; - } - return Ydb(a); - } - function Sv(a) { - if (a < 3) { - dk(a, fwe); - return a + 1; - } - if (a < hwe) { - return eE(a / 0.75 + 1); - } - return lve; - } - function Rwb(a, b) { - uFb(b); - Qwb(a); - if (a.d.Ob()) { - b.Cd(a.d.Pb()); - return true; - } - return false; - } - function ke(a, b) { - var c2, d; - c2 = RD(Xv(a.d, b), 16); - if (!c2) { - return null; - } - d = b; - return a.e.pc(d, c2); - } - function Ufe(a, b, c2, d) { - var e; - a.j = -1; - oLd(a, gge(a, b, c2), (nke(), e = RD(b, 69).vk(), e.xl(d))); - } - function Z_c(a, b) { - R_c(); - return -hgb(RD(mQb(a, (h_c(), W$c)), 17).a, RD(mQb(b, W$c), 17).a); - } - function xo(a, b) { - return !!Ho(a, b, Ydb(Ndb(cwe, qgb(Ydb(Ndb(b == null ? 0 : tb(b), dwe)), 15)))); - } - function dGd() { - aGd(); - return cD(WC(T5, 1), jwe, 245, 0, [_Fd, YFd, ZFd, XFd, $Fd, VFd, UFd, WFd]); - } - function nid() { - kid(); - return cD(WC(e3, 1), jwe, 285, 0, [jid, cid, gid, iid, did, eid, fid, hid]); - } - function hpc() { - epc(); - return cD(WC(hW, 1), jwe, 276, 0, [Zoc, apc, Yoc, dpc, _oc, $oc, cpc, bpc]); - } - function Kcc(a) { - var b; - b = Kfb(UD(mQb(a, (yCc(), FAc)))); - if (b < 0) { - b = 0; - pQb(a, FAc, b); - } - return b; - } - function Odc(a, b) { - var c2, d; - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 72); - pQb(c2, (Ywc(), swc), b); - } - } - function Oic(a, b, c2) { - var d; - d = $wnd.Math.max(0, a.b / 2 - 0.5); - Iic(c2, d, 1); - Rmb(b, new Xic(c2, d)); - } - function lRc(a, b, c2) { - var d; - d = a.a.e[RD(b.a, 10).p] - a.a.e[RD(c2.a, 10).p]; - return eE(Lgb(d)); - } - function PDb(a, b) { - var c2; - MCb(a); - c2 = new cEb(a, a.a.zd(), a.a.yd() | 4, b); - return new SDb(a, c2); - } - function gvb(a) { - var b; - yFb(!!a.c); - b = a.c.a; - Wub(a.d, a.c); - a.b == a.c ? a.b = b : --a.a; - a.c = null; - } - function iqc(a) { - a.a >= -0.01 && a.a <= Tye && (a.a = 0); - a.b >= -0.01 && a.b <= Tye && (a.b = 0); - return a; - } - function Hid(a) { - tid(); - var b, c2; - c2 = KEe; - for (b = 0; b < a.length; b++) { - a[b] > c2 && (c2 = a[b]); - } - return c2; - } - function Zvd(a, b) { - var c2; - c2 = wYd(a.Dh(), b); - if (!c2) { - throw Adb(new agb(KHe + b + NHe)); - } - return c2; - } - function NGd(a, b) { - var c2; - c2 = a; - while (vCd(c2)) { - c2 = vCd(c2); - if (c2 == b) { - return true; + if (string(node3)) { + node3 = cy.filter(node3); } - } - return false; - } - function ix(a, b) { - var c2, d, e; - d = b.a.ld(); - c2 = RD(b.a.md(), 16).gc(); - for (e = 0; e < c2; e++) { - a.Cd(d); - } - } - function Umb(a, b) { - var c2, d, e, f2; - uFb(b); - for (d = a.c, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - b.Cd(c2); - } - } - function q0b(a, b, c2, d, e, f2) { - var g; - g = s0b(d); - Y0b(g, e); - Z0b(g, f2); - Rc(a.a, d, new J0b(g, b, c2.f)); - } - function P8c(a, b) { - Ixd(a, (X6c(), T6c), b.f); - Ixd(a, Q6c, b.e); - Ixd(a, S6c, b.d); - Ixd(a, P6c, b.c); - } - function grc(a, b) { - this.a = new Tsb(); - this.e = new Tsb(); - this.b = (lDc(), kDc); - this.c = a; - this.b = b; - } - function yd(a) { - this.d = a; - this.c = a.c.vc().Kc(); - this.b = null; - this.a = null; - this.e = (zs(), ys); - } - function Wub(a, b) { - var c2; - c2 = b.c; - b.a.b = b.b; - b.b.a = b.a; - b.a = b.b = null; - b.c = null; - --a.b; - return c2; - } - function Esb(a, b) { - if (!!b && a.b[b.g] == b) { - bD(a.b, b.g, null); - --a.c; - return true; - } - return false; - } - function jxb(a, b) { - if (0 > a || a > b) { - throw Adb(new xeb("fromIndex: 0, toIndex: " + a + Qxe + b)); - } - } - function ZHd(a) { - if (a < 0) { - throw Adb(new agb("Illegal Capacity: " + a)); - } - this.g = this.aj(a); - } - function _y(a, b) { - Zy(); - bz(pwe); - return $wnd.Math.abs(a - b) <= pwe || a == b || isNaN(a) && isNaN(b); + return indegrees[node3.id()] / maxIndegree; + }, "indegree"), + outdegree: /* @__PURE__ */ __name(function outdegree(node3) { + if (maxOutdegree === 0) { + return 0; + } + if (string(node3)) { + node3 = cy.filter(node3); + } + return outdegrees[node3.id()] / maxOutdegree; + }, "outdegree") + }; + } + }, "degreeCentralityNormalized"), + // degreeCentralityNormalized + // Implemented from the algorithm in Opsahl's paper + // "Node centrality in weighted networks: Generalizing degree and shortest paths" + // check the heading 2 "Degree" + degreeCentrality: /* @__PURE__ */ __name(function degreeCentrality(options3) { + options3 = defaults$f(options3); + var cy = this.cy(); + var callingEles = this; + var _options = options3, root4 = _options.root, weight8 = _options.weight, directed = _options.directed, alpha = _options.alpha; + root4 = cy.collection(root4)[0]; + if (!directed) { + var connEdges = root4.connectedEdges().intersection(callingEles); + var k2 = connEdges.length; + var s2 = 0; + for (var i2 = 0; i2 < connEdges.length; i2++) { + s2 += weight8(connEdges[i2]); } - function xJc(a, b) { - var c2, d, e, f2; - for (d = a.d, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - pJc(a.g, c2).a = b; - } + return { + degree: Math.pow(k2, 1 - alpha) * Math.pow(s2, alpha) + }; + } else { + var edges5 = root4.connectedEdges(); + var incoming = edges5.filter(function(edge) { + return edge.target().same(root4) && callingEles.has(edge); + }); + var outgoing = edges5.filter(function(edge) { + return edge.source().same(root4) && callingEles.has(edge); + }); + var k_in = incoming.length; + var k_out = outgoing.length; + var s_in = 0; + var s_out = 0; + for (var _i2 = 0; _i2 < incoming.length; _i2++) { + s_in += weight8(incoming[_i2]); } - function BIc(a, b, c2) { - var d, e, f2; - e = b[c2]; - for (d = 0; d < e.length; d++) { - f2 = e[d]; - a.e[f2.c.p][f2.p] = d; - } + for (var _i3 = 0; _i3 < outgoing.length; _i3++) { + s_out += weight8(outgoing[_i3]); } - function nqc(a) { - var b; - for (b = 0; b < a.c.length; b++) { - (tFb(b, a.c.length), RD(a.c[b], 12)).p = b; + return { + indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha), + outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha) + }; + } + }, "degreeCentrality") + // degreeCentrality + }; + elesfn$n.dc = elesfn$n.degreeCentrality; + elesfn$n.dcn = elesfn$n.degreeCentralityNormalised = elesfn$n.degreeCentralityNormalized; + defaults$e = defaults$g({ + harmonic: true, + weight: /* @__PURE__ */ __name(function weight7() { + return 1; + }, "weight"), + directed: false, + root: null + }); + elesfn$m = { + closenessCentralityNormalized: /* @__PURE__ */ __name(function closenessCentralityNormalized(options3) { + var _defaults2 = defaults$e(options3), harmonic = _defaults2.harmonic, weight8 = _defaults2.weight, directed = _defaults2.directed; + var cy = this.cy(); + var closenesses = {}; + var maxCloseness = 0; + var nodes6 = this.nodes(); + var fw = this.floydWarshall({ + weight: weight8, + directed + }); + for (var i2 = 0; i2 < nodes6.length; i2++) { + var currCloseness = 0; + var node_i = nodes6[i2]; + for (var j2 = 0; j2 < nodes6.length; j2++) { + if (i2 !== j2) { + var d2 = fw.distance(node_i, nodes6[j2]); + if (harmonic) { + currCloseness += 1 / d2; + } else { + currCloseness += d2; + } } } - function qqc(a) { - var b, c2; - b = a.a.d.j; - c2 = a.c.d.j; - while (b != c2) { - zsb(a.b, b); - b = tpd(b); - } - zsb(a.b, b); + if (!harmonic) { + currCloseness = 1 / currCloseness; } - function gjd(a) { - var b; - b = $wnd.Math.sqrt(a.a * a.a + a.b * a.b); - if (b > 0) { - a.a /= b; - a.b /= b; - } - return a; + if (maxCloseness < currCloseness) { + maxCloseness = currCloseness; } - function BXd(a) { - var b; - if (a.w) { - return a.w; - } else { - b = CXd(a); - !!b && !b.Vh() && (a.w = b); - return b; + closenesses[node_i.id()] = currCloseness; + } + return { + closeness: /* @__PURE__ */ __name(function closeness(node2) { + if (maxCloseness == 0) { + return 0; } - } - function l2d(a, b) { - var c2, d; - d = a.a; - c2 = m2d(a, b, null); - d != b && !a.e && (c2 = o2d(a, b, c2)); - !!c2 && c2.oj(); - } - function rQc(a, b, c2) { - var d, e; - d = b; - do { - e = Kfb(a.p[d.p]) + c2; - a.p[d.p] = e; - d = a.a[d.p]; - } while (d != b); - } - function heb(a, b, c2) { - var d = function() { - return a.apply(d, arguments); - }; - b.apply(d, c2); - return d; - } - function Gae(a) { - var b; - if (a == null) { - return null; + if (string(node2)) { + node2 = cy.filter(node2)[0].id(); } else { - b = RD(a, 195); - return sAd(b, b.length); - } - } - function QHd(a, b) { - if (a.g == null || b >= a.i) - throw Adb(new yNd(b, a.i)); - return a.Wi(b, a.g[b]); - } - function Dob(a, b) { - yob(); - var c2, d; - d = new bnb(); - for (c2 = 0; c2 < a; ++c2) { - ZEb(d.c, b); - } - return new irb(d); - } - function NDb(a) { - MCb(a); - zFb(true, "n may not be negative"); - return new SDb(a, new DEb(a.a)); - } - function KKb(a) { - a.b = (EKb(), BKb); - a.f = (vLb(), tLb); - a.d = (dk(2, iwe), new cnb(2)); - a.e = new pjd(); - } - function zrd(a) { - this.b = (Qb(a), new dnb(a)); - this.a = new bnb(); - this.d = new bnb(); - this.e = new pjd(); - } - function ZJb() { - ZJb = geb; - WJb = new $Jb("BEGIN", 0); - XJb = new $Jb(Kye, 1); - YJb = new $Jb("END", 2); - } - function Omd() { - Omd = geb; - Lmd = new Pmd(Kye, 0); - Mmd = new Pmd("HEAD", 1); - Nmd = new Pmd("TAIL", 2); - } - function R_c() { - R_c = geb; - Q_c = mfd(mfd(mfd(rfd(new ufd(), (YVc(), VVc)), (WYc(), VYc)), OYc), SYc); - } - function B0c() { - B0c = geb; - A0c = mfd(mfd(mfd(rfd(new ufd(), (YVc(), XVc)), (WYc(), QYc)), LYc), PYc); - } - function gtc() { - gtc = geb; - ftc = ss((btc(), cD(WC(ZW, 1), jwe, 232, 0, [Zsc, _sc, Ysc, $sc, atc, Xsc]))); - } - function zuc() { - zuc = geb; - yuc = ss((tuc(), cD(WC(eX, 1), jwe, 283, 0, [ouc, nuc, quc, puc, suc, ruc]))); - } - function Tuc() { - Tuc = geb; - Suc = ss((Ouc(), cD(WC(gX, 1), jwe, 281, 0, [Luc, Kuc, Nuc, Juc, Muc, Iuc]))); - } - function dvc() { - dvc = geb; - cvc = ss(($uc(), cD(WC(hX, 1), jwe, 282, 0, [Yuc, Vuc, Zuc, Xuc, Wuc, Uuc]))); - } - function w3b() { - w3b = geb; - v3b = ss((r3b(), cD(WC(hR, 1), jwe, 273, 0, [p3b, o3b, m3b, q3b, n3b, l3b]))); - } - function Wjd() { - Wjd = geb; - Vjd = ss((Rjd(), cD(WC(n3, 1), jwe, 255, 0, [Ljd, Ojd, Pjd, Qjd, Mjd, Njd]))); - } - function zkd() { - zkd = geb; - ykd = ss((ukd(), cD(WC(q3, 1), jwe, 298, 0, [tkd, skd, rkd, pkd, okd, qkd]))); - } - function nnd() { - nnd = geb; - mnd = ss((ind(), cD(WC(v3, 1), jwe, 321, 0, [gnd, end2, hnd, cnd, fnd, dnd]))); - } - function Iod() { - Iod = geb; - Hod = ss((Bod(), cD(WC(C3, 1), jwe, 101, 0, [Aod, zod, yod, vod, xod, wod]))); - } - function Wod() { - Wod = geb; - Vod = ss((Pod(), cD(WC(D3, 1), jwe, 279, 0, [Nod, Lod, Mod, Kod, Jod, Ood]))); - } - function kKb() { - kKb = geb; - jKb = (ZJb(), cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb])).length; - iKb = jKb; - } - function hod() { - dod(); - return cD(WC(A3, 1), jwe, 95, 0, [Xnd, Wnd, Znd, cod, bod, aod, $nd, _nd, Ynd]); - } - function eoc(a, b) { - Mnc(); - return hgb(a.b.c.length - a.e.c.length, b.b.c.length - b.e.c.length); - } - function Ao(a, b) { - return $v(Go(a, b, Ydb(Ndb(cwe, qgb(Ydb(Ndb(b == null ? 0 : tb(b), dwe)), 15))))); - } - function rGb(a, b) { - return Zy(), bz(pwe), $wnd.Math.abs(a - b) <= pwe || a == b || isNaN(a) && isNaN(b); - } - function Wxd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 1, c2, a.b)); - } - function Hzd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 3, c2, a.b)); - } - function Ayd(a, b) { - var c2; - c2 = a.f; - a.f = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 3, c2, a.f)); - } - function Cyd(a, b) { - var c2; - c2 = a.g; - a.g = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 4, c2, a.g)); - } - function Dyd(a, b) { - var c2; - c2 = a.i; - a.i = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 5, c2, a.i)); - } - function Eyd(a, b) { - var c2; - c2 = a.j; - a.j = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 6, c2, a.j)); - } - function Ozd(a, b) { - var c2; - c2 = a.j; - a.j = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 1, c2, a.j)); - } - function Izd(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 4, c2, a.c)); - } - function Pzd(a, b) { - var c2; - c2 = a.k; - a.k = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 2, c2, a.k)); - } - function Vxd(a, b) { - var c2; - c2 = a.a; - a.a = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new L3d(a, 0, c2, a.a)); - } - function $Vd(a, b) { - var c2; - c2 = a.s; - a.s = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new M3d(a, 4, c2, a.s)); - } - function bWd(a, b) { - var c2; - c2 = a.t; - a.t = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new M3d(a, 5, c2, a.t)); - } - function Q1d(a, b) { - var c2; - c2 = a.d; - a.d = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new M3d(a, 2, c2, a.d)); - } - function zXd(a, b) { - var c2; - c2 = a.F; - a.F = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 5, c2, b)); - } - function IMd(a, b) { - var c2; - c2 = RD(Wjb((PRd(), ORd), a), 57); - return c2 ? c2.gk(b) : $C(jJ, rve, 1, b, 5, 1); - } - function BXb(a, b) { - var c2; - c2 = ojd(ajd(RD(Wjb(a.g, b), 8)), Pid(RD(Wjb(a.f, b), 470).b)); - return c2; - } - function FGd(a, b) { - var c2, d, e; - c2 = (d = (bvd(), e = new hCd(), e), !!b && eCd(d, b), d); - fCd(c2, a); - return c2; - } - function vDd(a, b) { - var c2, d; - c2 = b in a.a; - if (c2) { - d = qC(a, b).re(); - if (d) { - return d.a; - } - } - return null; - } - function jZd(a, b, c2) { - gHd(a, c2); - if (!a.kl() && c2 != null && !a.fk(c2)) { - throw Adb(new yeb()); + node2 = node2.id(); } - return c2; - } - function Mqd(a, b) { - a.n = b; - if (a.n) { - a.f = new bnb(); - a.e = new bnb(); + return closenesses[node2] / maxCloseness; + }, "closeness") + }; + }, "closenessCentralityNormalized"), + // Implemented from pseudocode from wikipedia + closenessCentrality: /* @__PURE__ */ __name(function closenessCentrality(options3) { + var _defaults2 = defaults$e(options3), root4 = _defaults2.root, weight8 = _defaults2.weight, directed = _defaults2.directed, harmonic = _defaults2.harmonic; + root4 = this.filter(root4)[0]; + var dijkstra3 = this.dijkstra({ + root: root4, + weight: weight8, + directed + }); + var totalDistance = 0; + var nodes6 = this.nodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + var n2 = nodes6[i2]; + if (!n2.same(root4)) { + var d2 = dijkstra3.distanceTo(n2); + if (harmonic) { + totalDistance += 1 / d2; } else { - a.f = null; - a.e = null; + totalDistance += d2; } - return a; } - function Ffb(a, b) { - if (!a) { - return; - } - b.n = a; - var d = zfb(b); - if (!d) { - eeb[a] = [b]; - return; + } + return harmonic ? totalDistance : 1 / totalDistance; + }, "closenessCentrality") + // closenessCentrality + }; + elesfn$m.cc = elesfn$m.closenessCentrality; + elesfn$m.ccn = elesfn$m.closenessCentralityNormalised = elesfn$m.closenessCentralityNormalized; + defaults$d = defaults$g({ + weight: null, + directed: false + }); + elesfn$l = { + // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes + betweennessCentrality: /* @__PURE__ */ __name(function betweennessCentrality(options3) { + var _defaults2 = defaults$d(options3), directed = _defaults2.directed, weight8 = _defaults2.weight; + var weighted = weight8 != null; + var cy = this.cy(); + var V2 = this.nodes(); + var A2 = {}; + var _C = {}; + var max10 = 0; + var C2 = { + set: /* @__PURE__ */ __name(function set6(key, val) { + _C[key] = val; + if (val > max10) { + max10 = val; } - d.Rm = b; - } - function SD(a) { - var b; - CFb(a == null || Array.isArray(a) && (b = XC(a), !(b >= 14 && b <= 16))); - return a; - } - function ws(a, b) { - var c2; - uFb(b); - c2 = a[":" + b]; - mFb(!!c2, "Enum constant undefined: " + b); - return c2; - } - function tfb(a, b, c2, d, e, f2) { - var g; - g = rfb(a, b); - Ffb(c2, g); - g.i = e ? 8 : 0; - g.f = d; - g.e = e; - g.g = f2; - return g; - } - function R3d(a, b, c2, d, e) { - this.d = b; - this.k = d; - this.f = e; - this.o = -1; - this.p = 1; - this.c = a; - this.a = c2; - } - function T3d(a, b, c2, d, e) { - this.d = b; - this.k = d; - this.f = e; - this.o = -1; - this.p = 2; - this.c = a; - this.a = c2; - } - function _3d(a, b, c2, d, e) { - this.d = b; - this.k = d; - this.f = e; - this.o = -1; - this.p = 6; - this.c = a; - this.a = c2; - } - function e4d(a, b, c2, d, e) { - this.d = b; - this.k = d; - this.f = e; - this.o = -1; - this.p = 7; - this.c = a; - this.a = c2; - } - function X3d(a, b, c2, d, e) { - this.d = b; - this.j = d; - this.e = e; - this.o = -1; - this.p = 4; - this.c = a; - this.a = c2; - } - function iGb(a, b) { - var c2, d, e, f2; - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - eGb(a.a, c2); - } - return a; - } - function Al(a) { - var b, c2, d, e; - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Qb(b); - } - return new Gl(a); - } - function ZTb(a) { - var b; - b = ojd(ajd(a.d.d), a.c.d); - wid(b, a.c.e.a, a.c.e.b); - return $id(b, a.c.d); - } - function $Tb(a) { - var b; - b = ojd(ajd(a.c.d), a.d.d); - wid(b, a.d.e.a, a.d.e.b); - return $id(b, a.d.d); - } - function iA(a) { - var b = /function(?:\s+([\w$]+))?\s*\(/; - var c2 = b.exec(a); - return c2 && c2[1] || wwe; - } - function Hnb(a, b, c2) { - var d, e; - e = a.length; - d = $wnd.Math.min(c2, e); - VEb(a, 0, b, 0, d, true); - return b; - } - function ISb(a, b, c2) { - var d, e; - for (e = b.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 74); - Ysb(a, RD(c2.Kb(d), 27)); - } - } - function E1b(a, b) { - Cod(RD(mQb(RD(a.e, 10), (yCc(), BBc)), 101)) && (yob(), _mb(RD(a.e, 10).j, b)); - } - function lIb() { - iIb(); - return cD(WC(xN, 1), jwe, 257, 0, [hIb, cIb, dIb, bIb, fIb, gIb, eIb, aIb, _Hb]); - } - function fDc() { - _Cc(); - return cD(WC(rX, 1), jwe, 265, 0, [ZCc, WCc, XCc, TCc, VCc, $Cc, YCc, SCc, UCc]); - } - function RKc() { - RKc = geb; - OKc = new SKc("BARYCENTER", 0); - PKc = new SKc(jBe, 1); - QKc = new SKc(kBe, 2); - } - function uFc() { - uFc = geb; - tFc = new vFc("NO", 0); - rFc = new vFc(CBe, 1); - sFc = new vFc("LOOK_BACK", 2); - } - function Etc() { - Etc = geb; - Btc = new Ftc("ARD", 0); - Dtc = new Ftc("MSD", 1); - Ctc = new Ftc("MANUAL", 2); - } - function BEc() { - BEc = geb; - AEc = new CEc(Sye, 0); - yEc = new CEc("INPUT", 1); - zEc = new CEc("OUTPUT", 2); - } - function ygd() { - if (!qgd) { - qgd = new xgd(); - wgd(qgd, cD(WC(B2, 1), rve, 134, 0, [new vmd()])); - } - return qgd; - } - function bz(a) { - if (!(a >= 0)) { - throw Adb(new agb("tolerance (" + a + ") must be >= 0")); - } - return a; - } - function hOd(a, b) { - var c2; - if (ZD(b, 44)) { - return a.c.Mc(b); - } else { - c2 = QNd(a, b); - jOd(a, b); - return c2; - } - } - function yBd(a, b, c2) { - YVd(a, b); - PAd(a, c2); - $Vd(a, 0); - bWd(a, 1); - aWd(a, true); - _Vd(a, true); - return a; - } - function ZGd(a, b) { - var c2; - c2 = a.gc(); - if (b < 0 || b > c2) - throw Adb(new aMd(b, c2)); - return new CMd(a, b); - } - function Cad(a, b) { - a.b = $wnd.Math.max(a.b, b.d); - a.e += b.r + (a.a.c.length == 0 ? 0 : a.c); - Rmb(a.a, b); - } - function Jmb(a) { - yFb(a.c >= 0); - if (rmb(a.d, a.c) < 0) { - a.a = a.a - 1 & a.d.a.length - 1; - a.b = a.d.c; - } - a.c = -1; - } - function Nc(a) { - var b, c2; - for (c2 = a.c.Cc().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 16); - b.$b(); - } - a.c.$b(); - a.d = 0; - } - function Zi(a) { - var b, c2, d, e; - for (c2 = a.a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Rnb(b, b.length, null); - } - } - function zjd(a, b) { - var c2, d, e, f2; - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - Pub(a, c2, a.c.b, a.c); - } - } - function St(a, b) { - var c2, d; - for (c2 = 0, d = a.gc(); c2 < d; ++c2) { - if (Fvb(b, a.Xb(c2))) { - return c2; + }, "set"), + get: /* @__PURE__ */ __name(function get6(key) { + return _C[key]; + }, "get") + }; + for (var i2 = 0; i2 < V2.length; i2++) { + var v3 = V2[i2]; + var vid = v3.id(); + if (directed) { + A2[vid] = v3.outgoers().nodes(); + } else { + A2[vid] = v3.openNeighborhood().nodes(); + } + C2.set(vid, 0); + } + var _loop = /* @__PURE__ */ __name(function _loop2(s3) { + var sid = V2[s3].id(); + var S3 = []; + var P2 = {}; + var g2 = {}; + var d2 = {}; + var Q2 = new heap(function(a2, b2) { + return d2[a2] - d2[b2]; + }); + for (var _i = 0; _i < V2.length; _i++) { + var _vid = V2[_i].id(); + P2[_vid] = []; + g2[_vid] = 0; + d2[_vid] = Infinity; + } + g2[sid] = 1; + d2[sid] = 0; + Q2.push(sid); + while (!Q2.empty()) { + var _v = Q2.pop(); + S3.push(_v); + if (weighted) { + for (var j2 = 0; j2 < A2[_v].length; j2++) { + var w3 = A2[_v][j2]; + var vEle = cy.getElementById(_v); + var edge = void 0; + if (vEle.edgesTo(w3).length > 0) { + edge = vEle.edgesTo(w3)[0]; + } else { + edge = w3.edgesTo(vEle)[0]; + } + var edgeWeight = weight8(edge); + w3 = w3.id(); + if (d2[w3] > d2[_v] + edgeWeight) { + d2[w3] = d2[_v] + edgeWeight; + if (Q2.nodes.indexOf(w3) < 0) { + Q2.push(w3); + } else { + Q2.updateItem(w3); + } + g2[w3] = 0; + P2[w3] = []; + } + if (d2[w3] == d2[_v] + edgeWeight) { + g2[w3] = g2[w3] + g2[_v]; + P2[w3].push(_v); + } } - } - return -1; - } - function ogb(a) { - var b, c2; - if (a == 0) { - return 32; } else { - c2 = 0; - for (b = 1; (b & a) == 0; b <<= 1) { - ++c2; - } - return c2; - } - } - function dk(a, b) { - if (a < 0) { - throw Adb(new agb(b + " cannot be negative but was: " + a)); - } - return a; - } - function deb(a, b) { - typeof window === gve && typeof window["$gwt"] === gve && (window["$gwt"][a] = b); - } - function lp(a, b) { - return Vv(Ho(a.a, b, Ydb(Ndb(cwe, qgb(Ydb(Ndb(b == null ? 0 : tb(b), dwe)), 15))))); - } - function FBb(a, b, c2) { - return sBb(a, new CCb(b), new ECb(), new GCb(c2), cD(WC(QL, 1), jwe, 108, 0, [])); - } - function gqd() { - dqd(); - return cD(WC(I3, 1), jwe, 264, 0, [Ypd, $pd, Xpd, _pd, aqd, cqd, bqd, Zpd, Wpd]); - } - function wgb() { - wgb = geb; - vgb = cD(WC(kE, 1), Pwe, 28, 15, [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]); - } - function stc() { - stc = geb; - qtc = new utc("LAYER_SWEEP", 0); - ptc = new utc(BBe, 1); - rtc = new utc(LAe, 2); - } - function nGc() { - nGc = geb; - mGc = pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - } - function yGc() { - yGc = geb; - xGc = pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - } - function SGc() { - SGc = geb; - RGc = pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - } - function lHc() { - lHc = geb; - kHc = pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - } - function tHc() { - tHc = geb; - sHc = pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - } - function RHc() { - RHc = geb; - QHc = pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - } - function YJc() { - YJc = geb; - XJc = nfd(pfd(pfd(new ufd(), (sXb(), pXb), (hcc(), Qbc)), qXb, Gbc), rXb, Pbc); - } - function EJb(a) { - var b, c2; - for (c2 = new Anb(yud(a)); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 695); - b._f(); - } - } - function aeb() { - beb(); - var a = _db; - for (var b = 0; b < arguments.length; b++) { - a.push(arguments[b]); - } - } - function EXb(a) { - zXb(); - this.g = new Tsb(); - this.f = new Tsb(); - this.b = new Tsb(); - this.c = new Tp(); - this.i = a; - } - function d1b() { - this.f = new pjd(); - this.d = new C3b(); - this.c = new pjd(); - this.a = new bnb(); - this.b = new bnb(); - } - function Cje(a, b, c2, d) { - this.ak(); - this.a = b; - this.b = a; - this.c = null; - this.c = new Dje(this, b, c2, d); - } - function NKd(a, b, c2, d, e) { - this.d = a; - this.n = b; - this.g = c2; - this.o = d; - this.p = -1; - e || (this.o = -2 - d - 1); - } - function HWd() { - dWd.call(this); - this.n = -1; - this.g = null; - this.i = null; - this.j = null; - this.Bb |= gwe; - } - function DEb(a) { - xxb.call(this, a.Ad(64) ? Kgb(0, Vdb(a.zd(), 1)) : Sve, a.yd()); - this.b = 1; - this.a = a; - } - function X_c(a, b) { - R_c(); - return RD(mQb(b, (h_c(), W$c)), 17).a < a.gc() && RD(mQb(b, W$c), 17).a >= 0; - } - function Iqd(a, b) { - if (a.r > 0 && a.c < a.r) { - a.c += b; - !!a.i && a.i.d > 0 && a.g != 0 && Iqd(a.i, b / a.r * a.i.d); - } - } - function $Cd(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 1, c2, a.c)); - } - function P1d(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 4, c2, a.c)); - } - function jyd(a, b) { - var c2; - c2 = a.k; - a.k = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 2, c2, a.k)); - } - function JXd(a, b) { - var c2; - c2 = a.D; - a.D = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 2, c2, a.D)); - } - function Kzd(a, b) { - var c2; - c2 = a.f; - a.f = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 8, c2, a.f)); - } - function Lzd(a, b) { - var c2; - c2 = a.i; - a.i = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 7, c2, a.i)); - } - function fCd(a, b) { - var c2; - c2 = a.a; - a.a = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 8, c2, a.a)); - } - function ZCd(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 0, c2, a.b)); - } - function s6d(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 0, c2, a.b)); - } - function t6d(a, b) { - var c2; - c2 = a.c; - a.c = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 1, c2, a.c)); - } - function nVd(a, b) { - var c2; - c2 = a.d; - a.d = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 1, c2, a.d)); - } - function Cte(a, b, c2) { - var d; - a.b = b; - a.a = c2; - d = (a.a & 512) == 512 ? new Gre() : new Tqe(); - a.c = Nqe(d, a.b, a.a); - } - function Gge(a, b) { - return qke(a.e, b) ? (nke(), wWd(b) ? new ole(b, a) : new Eke(b, a)) : new Ble(b, a); - } - function iDb(a) { - var b, c2; - if (0 > a) { - return new rDb(); - } - b = a + 1; - c2 = new kDb(b, a); - return new oDb(null, c2); - } - function Gob(a, b) { - yob(); - var c2; - c2 = new Usb(1); - bE(a) ? $jb(c2, a, b) : rtb(c2.f, a, b); - return new uqb(c2); - } - function pQc(a, b) { - var c2, d; - c2 = a.c; - d = b.e[a.p]; - if (d > 0) { - return RD(Vmb(c2.a, d - 1), 10); + for (var _j = 0; _j < A2[_v].length; _j++) { + var _w = A2[_v][_j].id(); + if (d2[_w] == Infinity) { + Q2.push(_w); + d2[_w] = d2[_v] + 1; + } + if (d2[_w] == d2[_v] + 1) { + g2[_w] = g2[_w] + g2[_v]; + P2[_w].push(_v); + } + } } - return null; } - function TOb(a, b) { - var c2, d; - c2 = a.o + a.p; - d = b.o + b.p; - if (c2 < d) { - return -1; - } - if (c2 == d) { - return 0; - } - return 1; + var e3 = {}; + for (var _i2 = 0; _i2 < V2.length; _i2++) { + e3[V2[_i2].id()] = 0; } - function Z5b(a) { - var b; - b = mQb(a, (Ywc(), Awc)); - if (ZD(b, 167)) { - return Y5b(RD(b, 167)); + while (S3.length > 0) { + var _w2 = S3.pop(); + for (var _j2 = 0; _j2 < P2[_w2].length; _j2++) { + var _v2 = P2[_w2][_j2]; + e3[_v2] = e3[_v2] + g2[_v2] / g2[_w2] * (1 + e3[_w2]); } - return null; - } - function Wp(a) { - var b; - a = $wnd.Math.max(a, 2); - b = mgb(a); - if (a > b) { - b <<= 1; - return b > 0 ? b : hwe; + if (_w2 != V2[s3].id()) { + C2.set(_w2, C2.get(_w2) + e3[_w2]); } - return b; } - function xc(a) { - Ub(a.e != 3); - switch (a.e) { - case 2: - return false; - case 0: - return true; + }, "_loop"); + for (var s2 = 0; s2 < V2.length; s2++) { + _loop(s2); + } + var ret = { + betweenness: /* @__PURE__ */ __name(function betweenness(node2) { + var id26 = cy.collection(node2).id(); + return C2.get(id26); + }, "betweenness"), + betweennessNormalized: /* @__PURE__ */ __name(function betweennessNormalized(node2) { + if (max10 == 0) { + return 0; } - return zc(a); + var id26 = cy.collection(node2).id(); + return C2.get(id26) / max10; + }, "betweennessNormalized") + }; + ret.betweennessNormalised = ret.betweennessNormalized; + return ret; + }, "betweennessCentrality") + // betweennessCentrality + }; + elesfn$l.bc = elesfn$l.betweennessCentrality; + defaults$c = defaults$g({ + expandFactor: 2, + // affects time of computation and cluster granularity to some extent: M * M + inflateFactor: 2, + // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j) + multFactor: 1, + // optional self loops for each node. Use a neutral value to improve cluster computations. + maxIterations: 20, + // maximum number of iterations of the MCL algorithm in a single run + attributes: [ + // attributes/features used to group nodes, ie. similarity values between nodes + function(edge) { + return 1; + } + ] + }); + setOptions$3 = /* @__PURE__ */ __name(function setOptions3(options3) { + return defaults$c(options3); + }, "setOptions"); + getSimilarity$1 = /* @__PURE__ */ __name(function getSimilarity(edge, attributes) { + var total = 0; + for (var i2 = 0; i2 < attributes.length; i2++) { + total += attributes[i2](edge); + } + return total; + }, "getSimilarity"); + addLoops = /* @__PURE__ */ __name(function addLoops2(M2, n2, val) { + for (var i2 = 0; i2 < n2; i2++) { + M2[i2 * n2 + i2] = val; + } + }, "addLoops"); + normalize2 = /* @__PURE__ */ __name(function normalize3(M2, n2) { + var sum2; + for (var col = 0; col < n2; col++) { + sum2 = 0; + for (var row = 0; row < n2; row++) { + sum2 += M2[row * n2 + col]; + } + for (var _row = 0; _row < n2; _row++) { + M2[_row * n2 + col] = M2[_row * n2 + col] / sum2; + } + } + }, "normalize"); + mmult = /* @__PURE__ */ __name(function mmult2(A2, B2, n2) { + var C2 = new Array(n2 * n2); + for (var i2 = 0; i2 < n2; i2++) { + for (var j2 = 0; j2 < n2; j2++) { + C2[i2 * n2 + j2] = 0; + } + for (var k2 = 0; k2 < n2; k2++) { + for (var _j = 0; _j < n2; _j++) { + C2[i2 * n2 + _j] += A2[i2 * n2 + k2] * B2[k2 * n2 + _j]; } - function djd(a, b) { - var c2; - if (ZD(b, 8)) { - c2 = RD(b, 8); - return a.a == c2.a && a.b == c2.b; - } else { - return false; - } + } + } + return C2; + }, "mmult"); + expand = /* @__PURE__ */ __name(function expand2(M2, n2, expandFactor) { + var _M = M2.slice(0); + for (var p3 = 1; p3 < expandFactor; p3++) { + M2 = mmult(M2, _M, n2); + } + return M2; + }, "expand"); + inflate = /* @__PURE__ */ __name(function inflate2(M2, n2, inflateFactor) { + var _M = new Array(n2 * n2); + for (var i2 = 0; i2 < n2 * n2; i2++) { + _M[i2] = Math.pow(M2[i2], inflateFactor); + } + normalize2(_M, n2); + return _M; + }, "inflate"); + hasConverged = /* @__PURE__ */ __name(function hasConverged2(M2, _M, n2, roundFactor) { + for (var i2 = 0; i2 < n2; i2++) { + var v12 = Math.round(M2[i2] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor); + var v22 = Math.round(_M[i2] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor); + if (v12 !== v22) { + return false; + } + } + return true; + }, "hasConverged"); + assign$2 = /* @__PURE__ */ __name(function assign2(M2, n2, nodes6, cy) { + var clusters = []; + for (var i2 = 0; i2 < n2; i2++) { + var cluster = []; + for (var j2 = 0; j2 < n2; j2++) { + if (Math.round(M2[i2 * n2 + j2] * 1e3) / 1e3 > 0) { + cluster.push(nodes6[j2]); } - function Ydd(a, b) { - var c2; - c2 = new kRb(); - RD(b.b, 68); - RD(b.b, 68); - RD(b.b, 68); - Umb(b.a, new ced(a, c2, b)); - } - function gOd(a, b) { - var c2, d; - for (d = b.vc().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 44); - fOd(a, c2.ld(), c2.md()); - } - } - function Jzd(a, b) { - var c2; - c2 = a.d; - a.d = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 11, c2, a.d)); - } - function zWd(a, b) { - var c2; - c2 = a.j; - a.j = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 13, c2, a.j)); - } - function b6d(a, b) { - var c2; - c2 = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 21, c2, a.b)); - } - function YAb(a, b) { - ((gBb(), dBb) ? null : b.c).length == 0 && iBb(b, new rBb()); - $jb(a.a, dBb ? null : b.c, b); - } - function b9b(a, b) { - b.Ug("Hierarchical port constraint processing", 1); - c9b(a); - e9b(a); - b.Vg(); - } - function joc() { - joc = geb; - ioc = new koc("START", 0); - hoc = new koc("MIDDLE", 1); - goc = new koc("END", 2); - } - function x2c() { - x2c = geb; - v2c = new z2c("P1_NODE_PLACEMENT", 0); - w2c = new z2c("P2_EDGE_ROUTING", 1); - } - function JVb() { - JVb = geb; - HVb = new jGd(rAe); - IVb = new jGd(sAe); - GVb = new jGd(tAe); - FVb = new jGd(uAe); - } - function tkb(a) { - var b; - rFb(a.f.g, a.d); - sFb(a.b); - a.c = a.a; - b = RD(a.a.Pb(), 44); - a.b = skb(a); - return b; - } - function P2d(a) { - var b; - if (a.b == null) { - return j3d(), j3d(), i3d; - } - b = a.ul() ? a.tl() : a.sl(); - return b; - } - function nwb(a, b) { - var c2; - c2 = b == null ? -1 : Wmb(a.b, b, 0); - if (c2 < 0) { - return false; - } - owb(a, c2); - return true; + } + if (cluster.length !== 0) { + clusters.push(cy.collection(cluster)); + } + } + return clusters; + }, "assign"); + isDuplicate = /* @__PURE__ */ __name(function isDuplicate2(c1, c22) { + for (var i2 = 0; i2 < c1.length; i2++) { + if (!c22[i2] || c1[i2].id() !== c22[i2].id()) { + return false; + } + } + return true; + }, "isDuplicate"); + removeDuplicates = /* @__PURE__ */ __name(function removeDuplicates2(clusters) { + for (var i2 = 0; i2 < clusters.length; i2++) { + for (var j2 = 0; j2 < clusters.length; j2++) { + if (i2 != j2 && isDuplicate(clusters[i2], clusters[j2])) { + clusters.splice(j2, 1); } - function zsb(a, b) { - var c2; - uFb(b); - c2 = b.g; - if (!a.b[c2]) { - bD(a.b, c2, b); - ++a.c; - return true; - } + } + } + return clusters; + }, "removeDuplicates"); + markovClustering = /* @__PURE__ */ __name(function markovClustering2(options3) { + var nodes6 = this.nodes(); + var edges5 = this.edges(); + var cy = this.cy(); + var opts = setOptions$3(options3); + var id2position = {}; + for (var i2 = 0; i2 < nodes6.length; i2++) { + id2position[nodes6[i2].id()] = i2; + } + var n2 = nodes6.length, n22 = n2 * n2; + var M2 = new Array(n22), _M; + for (var _i = 0; _i < n22; _i++) { + M2[_i] = 0; + } + for (var e3 = 0; e3 < edges5.length; e3++) { + var edge = edges5[e3]; + var _i2 = id2position[edge.source().id()]; + var j2 = id2position[edge.target().id()]; + var sim = getSimilarity$1(edge, opts.attributes); + M2[_i2 * n2 + j2] += sim; + M2[j2 * n2 + _i2] += sim; + } + addLoops(M2, n2, opts.multFactor); + normalize2(M2, n2); + var isStillMoving = true; + var iterations = 0; + while (isStillMoving && iterations < opts.maxIterations) { + isStillMoving = false; + _M = expand(M2, n2, opts.expandFactor); + M2 = inflate(_M, n2, opts.inflateFactor); + if (!hasConverged(M2, _M, n22, 4)) { + isStillMoving = true; + } + iterations++; + } + var clusters = assign$2(M2, n2, nodes6, cy); + clusters = removeDuplicates(clusters); + return clusters; + }, "markovClustering"); + markovClustering$1 = { + markovClustering, + mcl: markovClustering + }; + identity5 = /* @__PURE__ */ __name(function identity6(x5) { + return x5; + }, "identity"); + absDiff = /* @__PURE__ */ __name(function absDiff2(p3, q2) { + return Math.abs(q2 - p3); + }, "absDiff"); + addAbsDiff = /* @__PURE__ */ __name(function addAbsDiff2(total, p3, q2) { + return total + absDiff(p3, q2); + }, "addAbsDiff"); + addSquaredDiff = /* @__PURE__ */ __name(function addSquaredDiff2(total, p3, q2) { + return total + Math.pow(q2 - p3, 2); + }, "addSquaredDiff"); + sqrt3 = /* @__PURE__ */ __name(function sqrt4(x5) { + return Math.sqrt(x5); + }, "sqrt"); + maxAbsDiff = /* @__PURE__ */ __name(function maxAbsDiff2(currentMax, p3, q2) { + return Math.max(currentMax, absDiff(p3, q2)); + }, "maxAbsDiff"); + getDistance = /* @__PURE__ */ __name(function getDistance2(length2, getP, getQ, init3, visit) { + var post = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : identity5; + var ret = init3; + var p3, q2; + for (var dim = 0; dim < length2; dim++) { + p3 = getP(dim); + q2 = getQ(dim); + ret = visit(ret, p3, q2); + } + return post(ret); + }, "getDistance"); + distances = { + euclidean: /* @__PURE__ */ __name(function euclidean(length2, getP, getQ) { + if (length2 >= 2) { + return getDistance(length2, getP, getQ, 0, addSquaredDiff, sqrt3); + } else { + return getDistance(length2, getP, getQ, 0, addAbsDiff); + } + }, "euclidean"), + squaredEuclidean: /* @__PURE__ */ __name(function squaredEuclidean(length2, getP, getQ) { + return getDistance(length2, getP, getQ, 0, addSquaredDiff); + }, "squaredEuclidean"), + manhattan: /* @__PURE__ */ __name(function manhattan(length2, getP, getQ) { + return getDistance(length2, getP, getQ, 0, addAbsDiff); + }, "manhattan"), + max: /* @__PURE__ */ __name(function max7(length2, getP, getQ) { + return getDistance(length2, getP, getQ, -Infinity, maxAbsDiff); + }, "max") + }; + distances["squared-euclidean"] = distances["squaredEuclidean"]; + distances["squaredeuclidean"] = distances["squaredEuclidean"]; + __name(clusteringDistance, "clusteringDistance"); + defaults$b = defaults$g({ + k: 2, + m: 2, + sensitivityThreshold: 1e-4, + distance: "euclidean", + maxIterations: 10, + attributes: [], + testMode: false, + testCentroids: null + }); + setOptions$2 = /* @__PURE__ */ __name(function setOptions4(options3) { + return defaults$b(options3); + }, "setOptions"); + getDist = /* @__PURE__ */ __name(function getDist2(type3, node2, centroid, attributes, mode) { + var noNodeP = mode !== "kMedoids"; + var getP = noNodeP ? function(i2) { + return centroid[i2]; + } : function(i2) { + return attributes[i2](centroid); + }; + var getQ = /* @__PURE__ */ __name(function getQ2(i2) { + return attributes[i2](node2); + }, "getQ"); + var nodeP = centroid; + var nodeQ = node2; + return clusteringDistance(type3, attributes.length, getP, getQ, nodeP, nodeQ); + }, "getDist"); + randomCentroids = /* @__PURE__ */ __name(function randomCentroids2(nodes6, k2, attributes) { + var ndim = attributes.length; + var min9 = new Array(ndim); + var max10 = new Array(ndim); + var centroids = new Array(k2); + var centroid = null; + for (var i2 = 0; i2 < ndim; i2++) { + min9[i2] = nodes6.min(attributes[i2]).value; + max10[i2] = nodes6.max(attributes[i2]).value; + } + for (var c3 = 0; c3 < k2; c3++) { + centroid = []; + for (var _i = 0; _i < ndim; _i++) { + centroid[_i] = Math.random() * (max10[_i] - min9[_i]) + min9[_i]; + } + centroids[c3] = centroid; + } + return centroids; + }, "randomCentroids"); + classify = /* @__PURE__ */ __name(function classify2(node2, centroids, distance2, attributes, type3) { + var min9 = Infinity; + var index = 0; + for (var i2 = 0; i2 < centroids.length; i2++) { + var dist3 = getDist(distance2, node2, centroids[i2], attributes, type3); + if (dist3 < min9) { + min9 = dist3; + index = i2; + } + } + return index; + }, "classify"); + buildCluster = /* @__PURE__ */ __name(function buildCluster2(centroid, nodes6, assignment) { + var cluster = []; + var node2 = null; + for (var n2 = 0; n2 < nodes6.length; n2++) { + node2 = nodes6[n2]; + if (assignment[node2.id()] === centroid) { + cluster.push(node2); + } + } + return cluster; + }, "buildCluster"); + haveValuesConverged = /* @__PURE__ */ __name(function haveValuesConverged2(v12, v22, sensitivityThreshold) { + return Math.abs(v22 - v12) <= sensitivityThreshold; + }, "haveValuesConverged"); + haveMatricesConverged = /* @__PURE__ */ __name(function haveMatricesConverged2(v12, v22, sensitivityThreshold) { + for (var i2 = 0; i2 < v12.length; i2++) { + for (var j2 = 0; j2 < v12[i2].length; j2++) { + var diff2 = Math.abs(v12[i2][j2] - v22[i2][j2]); + if (diff2 > sensitivityThreshold) { return false; } - function azb(a, b) { - var c2, d; - c2 = 1 - b; - d = a.a[c2]; - a.a[c2] = d.a[b]; - d.a[b] = a; - a.b = true; - d.b = false; - return d; - } - function xRb(a, b) { - var c2, d; - for (d = b.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 272); - a.b = true; - Ysb(a.e, c2); - c2.b = a; - } - } - function kic(a, b) { - var c2, d; - c2 = RD(mQb(a, (yCc(), IBc)), 8); - d = RD(mQb(b, IBc), 8); - return Qfb(c2.b, d.b); - } - function SPb(a, b, c2) { - var d, e, f2; - f2 = b >> 5; - e = b & 31; - d = Cdb(Udb(a.n[c2][f2], Ydb(Sdb(e, 1))), 3); - return d; - } - function lmb(a, b, c2) { - var d, e, f2; - f2 = a.a.length - 1; - for (e = a.b, d = 0; d < c2; e = e + 1 & f2, ++d) { - bD(b, d, a.a[e]); - } - } - function owb(a, b) { - var c2; - c2 = Xmb(a.b, a.b.c.length - 1); - if (b < a.b.c.length) { - $mb(a.b, b, c2); - kwb(a, b); - } - } - function NQc(a, b) { - var c2; - c2 = RD(Wjb(a.c, b), 467); - if (!c2) { - c2 = new UQc(); - c2.c = b; - Zjb(a.c, c2.c, c2); - } - return c2; - } - function PUc(a, b) { - var c2, d; - d = new bnb(); - c2 = b; - do { - ZEb(d.c, c2); - c2 = RD(Wjb(a.k, c2), 18); - } while (c2); - return d; - } - function rMc(a, b, c2) { - var d; - d = new bnb(); - sMc(a, b, d, c2, true, true); - a.b = new _Lc(d.c.length); - return d; - } - function tvb(a, b) { - var c2, d; - c2 = a.Pc(); - Wnb(c2, 0, c2.length, b); - for (d = 0; d < c2.length; d++) { - a.hd(d, c2[d]); - } - } - function Bad(a) { - var b, c2; - for (c2 = new dMd(a); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 27); - Dyd(b, 0); - Eyd(b, 0); - } - } - function Bu(a) { - this.e = a; - this.d = new atb(Sv(Ec(this.e).gc())); - this.c = this.e.a; - this.b = this.e.c; - } - function _Lc(a) { - this.b = a; - this.a = $C(kE, Pwe, 28, a + 1, 15, 1); - this.c = $C(kE, Pwe, 28, a, 15, 1); - this.d = 0; - } - function frc(a, b, c2) { - grc.call(this, b, c2); - this.d = $C(jR, WAe, 10, a.a.c.length, 0, 1); - anb(a.a, this.d); - } - function vLc(a, b, c2) { - UIc.call(this, a, b, c2); - this.a = new Tsb(); - this.b = new Tsb(); - this.d = new yLc(this); - } - function Pic(a) { - fHb.call(this); - this.b = Kfb(UD(mQb(a, (yCc(), TBc)))); - this.a = RD(mQb(a, yAc), 223); - } - function _q(a, b) { - var c2; - if (ZD(b, 16)) { - c2 = RD(b, 16); - return a.Gc(c2); - } - return xr(a, RD(Qb(b), 20).Kc()); - } - function KCc(a, b) { - FDb(CDb(new SDb(null, new Swb(new Xkb(a.b), 1)), new esd(a, b)), new isd(a, b)); - } - function f6b(a, b) { - b.Ug(iBe, 1); - FDb(EDb(new SDb(null, new Swb(a.b, 16)), new j6b()), new l6b()); - b.Vg(); - } - function tb(a) { - return bE(a) ? ohb(a) : _D(a) ? Nfb(a) : $D(a) ? Jeb(a) : YD(a) ? a.Hb() : aD(a) ? kFb(a) : Iz(a); - } - function xKc(a) { - var b, c2; - for (c2 = a.c.a.ec().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 219); - DJc(b, new NLc(b.f)); - } - } - function yKc(a) { - var b, c2; - for (c2 = a.c.a.ec().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 219); - EJc(b, new OLc(b.e)); - } - } - function PAd(a, b) { - var c2; - c2 = a.zb; - a.zb = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 1, c2, a.zb)); - } - function CBd(a, b) { - var c2; - c2 = a.xb; - a.xb = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 3, c2, a.xb)); - } - function DBd(a, b) { - var c2; - c2 = a.yb; - a.yb = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 2, c2, a.yb)); - } - function iBd(a, b) { - var c2, d; - c2 = (d = new mXd(), d); - c2.n = b; - WGd((!a.s && (a.s = new C5d(y7, a, 21, 17)), a.s), c2); - } - function oBd(a, b) { - var c2, d; - d = (c2 = new d6d(), c2); - d.n = b; - WGd((!a.s && (a.s = new C5d(y7, a, 21, 17)), a.s), d); - } - function ye(a, b) { - var c2, d, e; - uFb(b); - c2 = false; - for (e = b.Kc(); e.Ob(); ) { - d = e.Pb(); - c2 = c2 | a.Fc(d); - } - return c2; - } - function Sx(a) { - var b, c2, d; - b = 0; - for (d = a.Kc(); d.Ob(); ) { - c2 = d.Pb(); - b += c2 != null ? tb(c2) : 0; - b = ~~b; - } - return b; - } - function oC(e, a) { - var b = e.a; - var c2 = 0; - for (var d in b) { - b.hasOwnProperty(d) && (a[c2++] = d); - } - return a; - } - function gB(a) { - var b; - if (a == 0) { - return "UTC"; - } - if (a < 0) { - a = -a; - b = "UTC+"; - } else { - b = "UTC-"; - } - return b + iB(a); + } + } + return true; + }, "haveMatricesConverged"); + seenBefore = /* @__PURE__ */ __name(function seenBefore2(node2, medoids, n2) { + for (var i2 = 0; i2 < n2; i2++) { + if (node2 === medoids[i2]) return true; + } + return false; + }, "seenBefore"); + randomMedoids = /* @__PURE__ */ __name(function randomMedoids2(nodes6, k2) { + var medoids = new Array(k2); + if (nodes6.length < 50) { + for (var i2 = 0; i2 < k2; i2++) { + var node2 = nodes6[Math.floor(Math.random() * nodes6.length)]; + while (seenBefore(node2, medoids, i2)) { + node2 = nodes6[Math.floor(Math.random() * nodes6.length)]; } - function xib(a) { - if (a.a < 54) { - return a.f < 0 ? -1 : a.f > 0 ? 1 : 0; - } - return (!a.c && (a.c = ojb(Hdb(a.f))), a.c).e; + medoids[i2] = node2; + } + } else { + for (var _i2 = 0; _i2 < k2; _i2++) { + medoids[_i2] = nodes6[Math.floor(Math.random() * nodes6.length)]; + } + } + return medoids; + }, "randomMedoids"); + findCost = /* @__PURE__ */ __name(function findCost2(potentialNewMedoid, cluster, attributes) { + var cost = 0; + for (var n2 = 0; n2 < cluster.length; n2++) { + cost += getDist("manhattan", cluster[n2], potentialNewMedoid, attributes, "kMedoids"); + } + return cost; + }, "findCost"); + kMeans = /* @__PURE__ */ __name(function kMeans2(options3) { + var cy = this.cy(); + var nodes6 = this.nodes(); + var node2 = null; + var opts = setOptions$2(options3); + var clusters = new Array(opts.k); + var assignment = {}; + var centroids; + if (opts.testMode) { + if (typeof opts.testCentroids === "number") { + opts.testCentroids; + centroids = randomCentroids(nodes6, opts.k, opts.attributes); + } else if (_typeof(opts.testCentroids) === "object") { + centroids = opts.testCentroids; + } else { + centroids = randomCentroids(nodes6, opts.k, opts.attributes); + } + } else { + centroids = randomCentroids(nodes6, opts.k, opts.attributes); + } + var isStillMoving = true; + var iterations = 0; + while (isStillMoving && iterations < opts.maxIterations) { + for (var n2 = 0; n2 < nodes6.length; n2++) { + node2 = nodes6[n2]; + assignment[node2.id()] = classify(node2, centroids, opts.distance, opts.attributes, "kMeans"); + } + isStillMoving = false; + for (var c3 = 0; c3 < opts.k; c3++) { + var cluster = buildCluster(c3, nodes6, assignment); + if (cluster.length === 0) { + continue; } - function GXd(a, b) { - if (b) { - if (a.B == null) { - a.B = a.D; - a.D = null; - } - } else if (a.B != null) { - a.D = a.B; - a.B = null; + var ndim = opts.attributes.length; + var centroid = centroids[c3]; + var newCentroid = new Array(ndim); + var sum2 = new Array(ndim); + for (var d2 = 0; d2 < ndim; d2++) { + sum2[d2] = 0; + for (var i2 = 0; i2 < cluster.length; i2++) { + node2 = cluster[i2]; + sum2[d2] += opts.attributes[d2](node2); + } + newCentroid[d2] = sum2[d2] / cluster.length; + if (!haveValuesConverged(newCentroid[d2], centroid[d2], opts.sensitivityThreshold)) { + isStillMoving = true; } } - function rZb(a, b) { - nZb(); - return a == jZb && b == mZb || a == mZb && b == jZb || a == lZb && b == kZb || a == kZb && b == lZb; - } - function sZb(a, b) { - nZb(); - return a == jZb && b == kZb || a == jZb && b == lZb || a == mZb && b == lZb || a == mZb && b == kZb; - } - function zMb(a, b) { - return Zy(), bz(Tye), $wnd.Math.abs(0 - b) <= Tye || 0 == b || isNaN(0) && isNaN(b) ? 0 : a / b; - } - function qsc(a, b) { - return Kfb(UD(Lvb(MDb(GDb(new SDb(null, new Swb(a.c.b, 16)), new Isc(a)), b)))); - } - function tsc(a, b) { - return Kfb(UD(Lvb(MDb(GDb(new SDb(null, new Swb(a.c.b, 16)), new Gsc(a)), b)))); - } - function rvc() { - ovc(); - return cD(WC(iX, 1), jwe, 259, 0, [fvc, hvc, ivc, jvc, kvc, lvc, nvc, evc, gvc, mvc]); - } - function dEc() { - aEc(); - return cD(WC(vX, 1), jwe, 243, 0, [$Dc, VDc, YDc, WDc, XDc, SDc, ZDc, _Dc, TDc, UDc]); - } - function z3c(a, b) { - var c2; - b.Ug("General Compactor", 1); - c2 = h4c(RD(Gxd(a, ($4c(), I4c)), 393)); - c2.Cg(a); - } - function T5c(a, b) { - var c2, d; - c2 = RD(Gxd(a, ($4c(), P4c)), 17); - d = RD(Gxd(b, P4c), 17); - return hgb(c2.a, d.a); + centroids[c3] = newCentroid; + clusters[c3] = cy.collection(cluster); + } + iterations++; + } + return clusters; + }, "kMeans"); + kMedoids = /* @__PURE__ */ __name(function kMedoids2(options3) { + var cy = this.cy(); + var nodes6 = this.nodes(); + var node2 = null; + var opts = setOptions$2(options3); + var clusters = new Array(opts.k); + var medoids; + var assignment = {}; + var curCost; + var minCosts = new Array(opts.k); + if (opts.testMode) { + if (typeof opts.testCentroids === "number") ; + else if (_typeof(opts.testCentroids) === "object") { + medoids = opts.testCentroids; + } else { + medoids = randomMedoids(nodes6, opts.k); + } + } else { + medoids = randomMedoids(nodes6, opts.k); + } + var isStillMoving = true; + var iterations = 0; + while (isStillMoving && iterations < opts.maxIterations) { + for (var n2 = 0; n2 < nodes6.length; n2++) { + node2 = nodes6[n2]; + assignment[node2.id()] = classify(node2, medoids, opts.distance, opts.attributes, "kMedoids"); + } + isStillMoving = false; + for (var m2 = 0; m2 < medoids.length; m2++) { + var cluster = buildCluster(m2, nodes6, assignment); + if (cluster.length === 0) { + continue; } - function Bjd(a, b, c2) { - var d, e; - for (e = Sub(a, 0); e.b != e.d.c; ) { - d = RD(evb(e), 8); - d.a += b; - d.b += c2; + minCosts[m2] = findCost(medoids[m2], cluster, opts.attributes); + for (var _n = 0; _n < cluster.length; _n++) { + curCost = findCost(cluster[_n], cluster, opts.attributes); + if (curCost < minCosts[m2]) { + minCosts[m2] = curCost; + medoids[m2] = cluster[_n]; + isStillMoving = true; } - return a; } - function Go(a, b, c2) { - var d; - for (d = a.b[c2 & a.f]; d; d = d.b) { - if (c2 == d.a && Hb(b, d.g)) { - return d; - } - } - return null; + clusters[m2] = cy.collection(cluster); + } + iterations++; + } + return clusters; + }, "kMedoids"); + updateCentroids = /* @__PURE__ */ __name(function updateCentroids2(centroids, nodes6, U2, weight8, opts) { + var numerator, denominator; + for (var n2 = 0; n2 < nodes6.length; n2++) { + for (var c3 = 0; c3 < centroids.length; c3++) { + weight8[n2][c3] = Math.pow(U2[n2][c3], opts.m); + } + } + for (var _c = 0; _c < centroids.length; _c++) { + for (var dim = 0; dim < opts.attributes.length; dim++) { + numerator = 0; + denominator = 0; + for (var _n2 = 0; _n2 < nodes6.length; _n2++) { + numerator += weight8[_n2][_c] * opts.attributes[dim](nodes6[_n2]); + denominator += weight8[_n2][_c]; } - function Ho(a, b, c2) { - var d; - for (d = a.c[c2 & a.f]; d; d = d.d) { - if (c2 == d.f && Hb(b, d.i)) { - return d; - } - } - return null; + centroids[_c][dim] = numerator / denominator; + } + } + }, "updateCentroids"); + updateMembership = /* @__PURE__ */ __name(function updateMembership2(U2, _U, centroids, nodes6, opts) { + for (var i2 = 0; i2 < U2.length; i2++) { + _U[i2] = U2[i2].slice(); + } + var sum2, numerator, denominator; + var pow = 2 / (opts.m - 1); + for (var c3 = 0; c3 < centroids.length; c3++) { + for (var n2 = 0; n2 < nodes6.length; n2++) { + sum2 = 0; + for (var k2 = 0; k2 < centroids.length; k2++) { + numerator = getDist(opts.distance, nodes6[n2], centroids[c3], opts.attributes, "cmeans"); + denominator = getDist(opts.distance, nodes6[n2], centroids[k2], opts.attributes, "cmeans"); + sum2 += Math.pow(numerator / denominator, pow); } - function sjb(a, b, c2) { - var d, e, f2; - d = 0; - for (e = 0; e < c2; e++) { - f2 = b[e]; - a[e] = f2 << 1 | d; - d = f2 >>> 31; - } - d != 0 && (a[c2] = d); - } - function yzb(a, b, c2, d, e, f2) { - var g; - this.c = a; - g = new bnb(); - Syb(a, g, b, a.b, c2, d, e, f2); - this.a = new Jkb(g, 0); - } - function _5c() { - this.c = new T2c(0); - this.b = new T2c(FEe); - this.d = new T2c(EEe); - this.a = new T2c(Gze); - } - function kMb(a, b, c2, d, e, f2, g) { - qs.call(this, a, b); - this.d = c2; - this.e = d; - this.c = e; - this.b = f2; - this.a = dv(g); - } - function tBd(a, b, c2, d, e, f2, g, h, i2, j, k, l, m) { - ABd(a, b, c2, d, e, f2, g, h, i2, j, k, l, m); - kXd(a, false); - return a; - } - function H0b(a) { - if (a.b.c.i.k == (r3b(), m3b)) { - return RD(mQb(a.b.c.i, (Ywc(), Awc)), 12); - } - return a.b.c; - } - function I0b(a) { - if (a.b.d.i.k == (r3b(), m3b)) { - return RD(mQb(a.b.d.i, (Ywc(), Awc)), 12); - } - return a.b.d; - } - function nDb(a) { - var b; - b = mDb(a); - if (Gdb(b.a, 0)) { - return bwb(), bwb(), awb; - } - return bwb(), new ewb(b.b); - } - function SCb(a) { - var b; - b = RCb(a); - if (Gdb(b.a, 0)) { - return Tvb(), Tvb(), Svb; - } - return Tvb(), new Yvb(b.b); - } - function TCb(a) { - var b; - b = RCb(a); - if (Gdb(b.a, 0)) { - return Tvb(), Tvb(), Svb; - } - return Tvb(), new Yvb(b.c); - } - function o8b(a) { - switch (a.g) { - case 2: - return qpd(), ppd; - case 4: - return qpd(), Xod; - default: - return a; - } + U2[n2][c3] = 1 / sum2; + } + } + }, "updateMembership"); + assign$1 = /* @__PURE__ */ __name(function assign3(nodes6, U2, opts, cy) { + var clusters = new Array(opts.k); + for (var c3 = 0; c3 < clusters.length; c3++) { + clusters[c3] = []; + } + var max10; + var index; + for (var n2 = 0; n2 < U2.length; n2++) { + max10 = -Infinity; + index = -1; + for (var _c2 = 0; _c2 < U2[0].length; _c2++) { + if (U2[n2][_c2] > max10) { + max10 = U2[n2][_c2]; + index = _c2; } - function p8b(a) { - switch (a.g) { - case 1: - return qpd(), npd; - case 3: - return qpd(), Yod; - default: - return a; - } - } - function C9c(a) { - switch (a.g) { - case 0: - return new s9c(); - case 1: - return new x9c(); - default: - return null; - } + } + clusters[index].push(nodes6[n2]); + } + for (var _c3 = 0; _c3 < clusters.length; _c3++) { + clusters[_c3] = cy.collection(clusters[_c3]); + } + return clusters; + }, "assign"); + fuzzyCMeans = /* @__PURE__ */ __name(function fuzzyCMeans2(options3) { + var cy = this.cy(); + var nodes6 = this.nodes(); + var opts = setOptions$2(options3); + var clusters; + var centroids; + var U2; + var _U; + var weight8; + _U = new Array(nodes6.length); + for (var i2 = 0; i2 < nodes6.length; i2++) { + _U[i2] = new Array(opts.k); + } + U2 = new Array(nodes6.length); + for (var _i3 = 0; _i3 < nodes6.length; _i3++) { + U2[_i3] = new Array(opts.k); + } + for (var _i4 = 0; _i4 < nodes6.length; _i4++) { + var total = 0; + for (var j2 = 0; j2 < opts.k; j2++) { + U2[_i4][j2] = Math.random(); + total += U2[_i4][j2]; + } + for (var _j = 0; _j < opts.k; _j++) { + U2[_i4][_j] = U2[_i4][_j] / total; + } + } + centroids = new Array(opts.k); + for (var _i5 = 0; _i5 < opts.k; _i5++) { + centroids[_i5] = new Array(opts.attributes.length); + } + weight8 = new Array(nodes6.length); + for (var _i6 = 0; _i6 < nodes6.length; _i6++) { + weight8[_i6] = new Array(opts.k); + } + var isStillMoving = true; + var iterations = 0; + while (isStillMoving && iterations < opts.maxIterations) { + isStillMoving = false; + updateCentroids(centroids, nodes6, U2, weight8, opts); + updateMembership(U2, _U, centroids, nodes6, opts); + if (!haveMatricesConverged(U2, _U, opts.sensitivityThreshold)) { + isStillMoving = true; + } + iterations++; + } + clusters = assign$1(nodes6, U2, opts, cy); + return { + clusters, + degreeOfMembership: U2 + }; + }, "fuzzyCMeans"); + kClustering = { + kMeans, + kMedoids, + fuzzyCMeans, + fcm: fuzzyCMeans + }; + defaults$a = defaults$g({ + distance: "euclidean", + // distance metric to compare nodes + linkage: "min", + // linkage criterion : how to determine the distance between clusters of nodes + mode: "threshold", + // mode:'threshold' => clusters must be threshold distance apart + threshold: Infinity, + // the distance threshold + // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters + addDendrogram: false, + // whether to add the dendrogram to the graph for viz + dendrogramDepth: 0, + // depth at which dendrogram branches are merged into the returned clusters + attributes: [] + // array of attr functions + }); + linkageAliases = { + "single": "min", + "complete": "max" + }; + setOptions$1 = /* @__PURE__ */ __name(function setOptions5(options3) { + var opts = defaults$a(options3); + var preferredAlias = linkageAliases[opts.linkage]; + if (preferredAlias != null) { + opts.linkage = preferredAlias; + } + return opts; + }, "setOptions"); + mergeClosest = /* @__PURE__ */ __name(function mergeClosest2(clusters, index, dists, mins, opts) { + var minKey = 0; + var min9 = Infinity; + var dist3; + var attrs = opts.attributes; + var getDist3 = /* @__PURE__ */ __name(function getDist4(n1, n2) { + return clusteringDistance(opts.distance, attrs.length, function(i3) { + return attrs[i3](n1); + }, function(i3) { + return attrs[i3](n2); + }, n1, n2); + }, "getDist"); + for (var i2 = 0; i2 < clusters.length; i2++) { + var key = clusters[i2].key; + var _dist = dists[key][mins[key]]; + if (_dist < min9) { + minKey = key; + min9 = _dist; + } + } + if (opts.mode === "threshold" && min9 >= opts.threshold || opts.mode === "dendrogram" && clusters.length === 1) { + return false; + } + var c1 = index[minKey]; + var c22 = index[mins[minKey]]; + var merged; + if (opts.mode === "dendrogram") { + merged = { + left: c1, + right: c22, + key: c1.key + }; + } else { + merged = { + value: c1.value.concat(c22.value), + key: c1.key + }; + } + clusters[c1.index] = merged; + clusters.splice(c22.index, 1); + index[c1.key] = merged; + for (var _i = 0; _i < clusters.length; _i++) { + var cur = clusters[_i]; + if (c1.key === cur.key) { + dist3 = Infinity; + } else if (opts.linkage === "min") { + dist3 = dists[c1.key][cur.key]; + if (dists[c1.key][cur.key] > dists[c22.key][cur.key]) { + dist3 = dists[c22.key][cur.key]; } - function Zcc() { - Zcc = geb; - Ycc = new kGd("edgelabelcenterednessanalysis.includelabel", (Geb(), Eeb)); - } - function jKc() { - jKc = geb; - iKc = mfd(qfd(pfd(pfd(new ufd(), (sXb(), pXb), (hcc(), Qbc)), qXb, Gbc), rXb), Pbc); - } - function DLc() { - DLc = geb; - CLc = mfd(qfd(pfd(pfd(new ufd(), (sXb(), pXb), (hcc(), Qbc)), qXb, Gbc), rXb), Pbc); - } - function lYd() { - lYd = geb; - iYd = new i1d(); - kYd = cD(WC(y7, 1), lKe, 179, 0, []); - jYd = cD(WC(s7, 1), mKe, 62, 0, []); - } - function P8b() { - P8b = geb; - O8b = new Q8b("TO_INTERNAL_LTR", 0); - N8b = new Q8b("TO_INPUT_DIRECTION", 1); - } - function J3b() { - J3b = geb; - G3b = new r4b(); - E3b = new w4b(); - F3b = new A4b(); - D3b = new E4b(); - H3b = new I4b(); - I3b = new M4b(); - } - function Cac(a, b) { - b.Ug(iBe, 1); - LJb(KJb(new PJb((i1b(), new t1b(a, false, false, new _1b()))))); - b.Vg(); - } - function M_c(a, b, c2) { - c2.Ug("DFS Treeifying phase", 1); - L_c(a, b); - J_c(a, b); - a.a = null; - a.b = null; - c2.Vg(); - } - function Leb(a, b) { - Geb(); - return bE(a) ? jhb(a, WD(b)) : _D(a) ? Jfb(a, UD(b)) : $D(a) ? Ieb(a, TD(b)) : a.Fd(b); - } - function Ld(a, b) { - var c2, d; - uFb(b); - for (d = b.vc().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 44); - a.zc(c2.ld(), c2.md()); - } - } - function ege(a, b, c2) { - var d; - for (d = c2.Kc(); d.Ob(); ) { - if (!cge(a, b, d.Pb())) { - return false; - } - } - return true; + } else if (opts.linkage === "max") { + dist3 = dists[c1.key][cur.key]; + if (dists[c1.key][cur.key] < dists[c22.key][cur.key]) { + dist3 = dists[c22.key][cur.key]; } - function S6d(a, b, c2, d, e) { - var f2; - if (c2) { - f2 = BYd(b.Dh(), a.c); - e = c2.Rh(b, -1 - (f2 == -1 ? d : f2), null, e); + } else if (opts.linkage === "mean") { + dist3 = (dists[c1.key][cur.key] * c1.size + dists[c22.key][cur.key] * c22.size) / (c1.size + c22.size); + } else { + if (opts.mode === "dendrogram") dist3 = getDist3(cur.value, c1.value); + else dist3 = getDist3(cur.value[0], c1.value[0]); + } + dists[c1.key][cur.key] = dists[cur.key][c1.key] = dist3; + } + for (var _i2 = 0; _i2 < clusters.length; _i2++) { + var key1 = clusters[_i2].key; + if (mins[key1] === c1.key || mins[key1] === c22.key) { + var _min = key1; + for (var j2 = 0; j2 < clusters.length; j2++) { + var key2 = clusters[j2].key; + if (dists[key1][key2] < dists[key1][_min]) { + _min = key2; } - return e; } - function T6d(a, b, c2, d, e) { - var f2; - if (c2) { - f2 = BYd(b.Dh(), a.c); - e = c2.Th(b, -1 - (f2 == -1 ? d : f2), null, e); - } - return e; + mins[key1] = _min; + } + clusters[_i2].index = _i2; + } + c1.key = c22.key = c1.index = c22.index = null; + return true; + }, "mergeClosest"); + getAllChildren = /* @__PURE__ */ __name(function getAllChildren2(root4, arr, cy) { + if (!root4) return; + if (root4.value) { + arr.push(root4.value); + } else { + if (root4.left) getAllChildren2(root4.left, arr); + if (root4.right) getAllChildren2(root4.right, arr); + } + }, "getAllChildren"); + buildDendrogram = /* @__PURE__ */ __name(function buildDendrogram2(root4, cy) { + if (!root4) return ""; + if (root4.left && root4.right) { + var leftStr = buildDendrogram2(root4.left, cy); + var rightStr = buildDendrogram2(root4.right, cy); + var node2 = cy.add({ + group: "nodes", + data: { + id: leftStr + "," + rightStr } - function Uib(a) { - var b; - if (a.b == -2) { - if (a.e == 0) { - b = -1; - } else { - for (b = 0; a.a[b] == 0; b++) - ; - } - a.b = b; - } - return a.b; - } - function fjb(a) { - uFb(a); - if (a.length == 0) { - throw Adb(new Vgb("Zero length BigInteger")); - } - mjb(this, a); - } - function $Hd(a) { - this.i = a.gc(); - if (this.i > 0) { - this.g = this.aj(this.i + (this.i / 8 | 0) + 1); - a.Qc(this.g); - } - } - function dmc(a, b, c2) { - this.g = a; - this.d = b; - this.e = c2; - this.a = new bnb(); - bmc(this); - yob(); - _mb(this.a, null); - } - function aad(a, b) { - b.q = a; - a.d = $wnd.Math.max(a.d, b.r); - a.b += b.d + (a.a.c.length == 0 ? 0 : a.c); - Rmb(a.a, b); - } - function xid(a, b) { - var c2, d, e, f2; - e = a.c; - c2 = a.c + a.b; - f2 = a.d; - d = a.d + a.a; - return b.a > e && b.a < c2 && b.b > f2 && b.b < d; - } - function Cjd(a, b) { - var c2, d; - for (d = Sub(a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 8); - c2.a += b.a; - c2.b += b.b; - } - return a; - } - function $cc(a) { - var b, c2, d; - d = 0; - for (c2 = new Anb(a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 30); - b.p = d; - ++d; - } - } - function Tnc(a) { - var b, c2, d; - return a.j == (qpd(), Yod) && (b = Vnc(a), c2 = Csb(b, Xod), d = Csb(b, ppd), d || d && c2); - } - function rsd(a, b) { - var c2; - c2 = wsd(a); - return qsd(new rjd(c2.c, c2.d), new rjd(c2.b, c2.a), a.Mf(), b, a.ag()); - } - function wEd(a, b) { - var c2; - c2 = RD(b, 190); - qDd(c2, "x", a.i); - qDd(c2, "y", a.j); - qDd(c2, fIe, a.g); - qDd(c2, eIe, a.f); - } - function CVd(a, b) { - var c2; - if (ZD(b, 85)) { - RD(a.c, 79).Gk(); - c2 = RD(b, 85); - gOd(a, c2); - } else { - RD(a.c, 79).Wb(b); - } + }); + cy.add({ + group: "edges", + data: { + source: leftStr, + target: node2.id() } - function Bvb(a, b) { - var c2, d; - uFb(b); - for (d = a.vc().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 44); - b.Yd(c2.ld(), c2.md()); - } + }); + cy.add({ + group: "edges", + data: { + source: rightStr, + target: node2.id() } - function zr(a, b) { - var c2; - Qb(b); - while (a.Ob()) { - c2 = a.Pb(); - if (!oSc(RD(c2, 10))) { - return false; - } - } - return true; + }); + return node2.id(); + } else if (root4.value) { + return root4.value.id(); + } + }, "buildDendrogram"); + buildClustersFromTree = /* @__PURE__ */ __name(function buildClustersFromTree2(root4, k2, cy) { + if (!root4) return []; + var left3 = [], right3 = [], leaves = []; + if (k2 === 0) { + if (root4.left) getAllChildren(root4.left, left3); + if (root4.right) getAllChildren(root4.right, right3); + leaves = left3.concat(right3); + return [cy.collection(leaves)]; + } else if (k2 === 1) { + if (root4.value) { + return [cy.collection(root4.value)]; + } else { + if (root4.left) getAllChildren(root4.left, left3); + if (root4.right) getAllChildren(root4.right, right3); + return [cy.collection(left3), cy.collection(right3)]; + } + } else { + if (root4.value) { + return [cy.collection(root4.value)]; + } else { + if (root4.left) left3 = buildClustersFromTree2(root4.left, k2 - 1, cy); + if (root4.right) right3 = buildClustersFromTree2(root4.right, k2 - 1, cy); + return left3.concat(right3); + } + } + }, "buildClustersFromTree"); + hierarchicalClustering = /* @__PURE__ */ __name(function hierarchicalClustering2(options3) { + var cy = this.cy(); + var nodes6 = this.nodes(); + var opts = setOptions$1(options3); + var attrs = opts.attributes; + var getDist3 = /* @__PURE__ */ __name(function getDist4(n1, n22) { + return clusteringDistance(opts.distance, attrs.length, function(i3) { + return attrs[i3](n1); + }, function(i3) { + return attrs[i3](n22); + }, n1, n22); + }, "getDist"); + var clusters = []; + var dists = []; + var mins = []; + var index = []; + for (var n2 = 0; n2 < nodes6.length; n2++) { + var cluster = { + value: opts.mode === "dendrogram" ? nodes6[n2] : [nodes6[n2]], + key: n2, + index: n2 + }; + clusters[n2] = cluster; + index[n2] = cluster; + dists[n2] = []; + mins[n2] = 0; + } + for (var i2 = 0; i2 < clusters.length; i2++) { + for (var j2 = 0; j2 <= i2; j2++) { + var dist3 = void 0; + if (opts.mode === "dendrogram") { + dist3 = i2 === j2 ? Infinity : getDist3(clusters[i2].value, clusters[j2].value); + } else { + dist3 = i2 === j2 ? Infinity : getDist3(clusters[i2].value[0], clusters[j2].value[0]); } - function _Ab() { - var a; - if (!XAb) { - XAb = new $Ab(); - a = new oBb(""); - mBb(a, (SAb(), RAb)); - YAb(XAb, a); - } - return XAb; - } - function PBb(a, b) { - return sBb(new lCb(a), new nCb(b), new pCb(b), new rCb(), cD(WC(QL, 1), jwe, 108, 0, [])); - } - function t5c() { - t5c = geb; - r5c = new v5c(LAe, 0); - s5c = new v5c("POLAR_COORDINATE", 1); - q5c = new v5c("ID", 2); - } - function KEc() { - KEc = geb; - HEc = new LEc("EQUALLY", 0); - IEc = new LEc(_ye, 1); - JEc = new LEc("NORTH_SOUTH", 2); - } - function OQb() { - OQb = geb; - MQb = new kGd("debugSVG", (Geb(), false)); - NQb = new kGd("overlapsExisted", true); - } - function pid() { - pid = geb; - oid = ss((kid(), cD(WC(e3, 1), jwe, 285, 0, [jid, cid, gid, iid, did, eid, fid, hid]))); - } - function fGd() { - fGd = geb; - eGd = ss((aGd(), cD(WC(T5, 1), jwe, 245, 0, [_Fd, YFd, ZFd, XFd, $Fd, VFd, UFd, WFd]))); - } - function jpc() { - jpc = geb; - ipc = ss((epc(), cD(WC(hW, 1), jwe, 276, 0, [Zoc, apc, Yoc, dpc, _oc, $oc, cpc, bpc]))); - } - function $Yc() { - WYc(); - return cD(WC(u_, 1), jwe, 262, 0, [VYc, OYc, SYc, TYc, RYc, NYc, UYc, LYc, QYc, PYc, MYc]); - } - function $i(a, b, c2) { - var d, e; - e = RD(Fn(a.d, b), 17); - d = RD(Fn(a.b, c2), 17); - return !e || !d ? null : Ui(a, e.a, d.a); - } - function cgd(a, b) { - var c2; - c2 = sgd(ygd(), a); - if (c2) { - Ixd(b, (umd(), Tld), c2); - return true; - } else { - return false; - } + dists[i2][j2] = dist3; + dists[j2][i2] = dist3; + if (dist3 < dists[i2][mins[i2]]) { + mins[i2] = j2; } - function TMb(a) { - RMb(); - if (a.A.Hc((Qpd(), Mpd))) { - if (!a.B.Hc((dqd(), $pd))) { - return SMb(a); - } - } - return null; + } + } + var merged = mergeClosest(clusters, index, dists, mins, opts); + while (merged) { + merged = mergeClosest(clusters, index, dists, mins, opts); + } + var retClusters; + if (opts.mode === "dendrogram") { + retClusters = buildClustersFromTree(clusters[0], opts.dendrogramDepth, cy); + if (opts.addDendrogram) buildDendrogram(clusters[0], cy); + } else { + retClusters = new Array(clusters.length); + clusters.forEach(function(cluster2, i3) { + cluster2.key = cluster2.index = null; + retClusters[i3] = cy.collection(cluster2.value); + }); + } + return retClusters; + }, "hierarchicalClustering"); + hierarchicalClustering$1 = { + hierarchicalClustering, + hca: hierarchicalClustering + }; + defaults$9 = defaults$g({ + distance: "euclidean", + // distance metric to compare attributes between two nodes + preference: "median", + // suitability of a data point to serve as an exemplar + damping: 0.8, + // damping factor between [0.5, 1) + maxIterations: 1e3, + // max number of iterations to run + minIterations: 100, + // min number of iterations to run in order for clustering to stop + attributes: [ + // functions to quantify the similarity between any two points + // e.g. node => node.data('weight') + ] + }); + setOptions6 = /* @__PURE__ */ __name(function setOptions7(options3) { + var dmp = options3.damping; + var pref = options3.preference; + if (!(0.5 <= dmp && dmp < 1)) { + error("Damping must range on [0.5, 1). Got: ".concat(dmp)); + } + var validPrefs = ["median", "mean", "min", "max"]; + if (!(validPrefs.some(function(v3) { + return v3 === pref; + }) || number$1(pref))) { + error("Preference must be one of [".concat(validPrefs.map(function(p3) { + return "'".concat(p3, "'"); + }).join(", "), "] or a number. Got: ").concat(pref)); + } + return defaults$9(options3); + }, "setOptions"); + getSimilarity2 = /* @__PURE__ */ __name(function getSimilarity3(type3, n1, n2, attributes) { + var attr = /* @__PURE__ */ __name(function attr2(n3, i2) { + return attributes[i2](n3); + }, "attr"); + return -clusteringDistance(type3, attributes.length, function(i2) { + return attr(n1, i2); + }, function(i2) { + return attr(n2, i2); + }, n1, n2); + }, "getSimilarity"); + getPreference = /* @__PURE__ */ __name(function getPreference2(S3, preference) { + var p3 = null; + if (preference === "median") { + p3 = median(S3); + } else if (preference === "mean") { + p3 = mean(S3); + } else if (preference === "min") { + p3 = min5(S3); + } else if (preference === "max") { + p3 = max5(S3); + } else { + p3 = preference; + } + return p3; + }, "getPreference"); + findExemplars = /* @__PURE__ */ __name(function findExemplars2(n2, R2, A2) { + var indices = []; + for (var i2 = 0; i2 < n2; i2++) { + if (R2[i2 * n2 + i2] + A2[i2 * n2 + i2] > 0) { + indices.push(i2); + } + } + return indices; + }, "findExemplars"); + assignClusters = /* @__PURE__ */ __name(function assignClusters2(n2, S3, exemplars) { + var clusters = []; + for (var i2 = 0; i2 < n2; i2++) { + var index = -1; + var max10 = -Infinity; + for (var ei = 0; ei < exemplars.length; ei++) { + var e3 = exemplars[ei]; + if (S3[i2 * n2 + e3] > max10) { + index = e3; + max10 = S3[i2 * n2 + e3]; } - function tUb() { - this.a = RD(iGd((yVb(), aVb)), 17).a; - this.c = Kfb(UD(iGd(rVb))); - this.b = Kfb(UD(iGd(nVb))); - } - function vkb(a) { - this.f = a; - this.e = new Qtb(this.f.i); - this.a = this.e; - this.b = skb(this); - this.d = this.f.g; - } - function Uge(a, b) { - Kfe.call(this, Ibb, a, b); - this.b = this; - this.a = pke(a.Dh(), vYd(this.e.Dh(), this.c)); - } - function bdc(a, b) { - var c2, d; - for (d = new Anb(b.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - a.a[c2.p] = h2b(c2); - } - } - function ofd(a, b) { - var c2; - for (c2 = 0; c2 < b.j.c.length; c2++) { - RD(Med(a, c2), 21).Gc(RD(Med(b, c2), 16)); - } - return a; - } - function peb(a, b, c2, d) { - var e; - e = a.a.length; - c2 > e ? c2 = e : BFb(b, c2 + 1); - a.a = zhb(a.a, 0, b) + ("" + d) + yhb(a.a, c2); - } - function ktb(a, b) { - a.a = Bdb(a.a, 1); - a.c = $wnd.Math.min(a.c, b); - a.b = $wnd.Math.max(a.b, b); - a.d = Bdb(a.d, b); - } - function wdc(a, b) { - return b < a.b.gc() ? RD(a.b.Xb(b), 10) : b == a.b.gc() ? a.a : RD(Vmb(a.e, b - a.b.gc() - 1), 10); - } - function rXc(a, b, c2) { - return Qfb(cjd(jWc(a), new rjd(b.e.a, b.e.b)), cjd(jWc(a), new rjd(c2.e.a, c2.e.b))); - } - function WJc(a, b, c2) { - return a == (RKc(), QKc) ? new PJc() : Kwb(b, 1) != 0 ? new ILc(c2.length) : new pLc(c2.length); - } - function qvd(a, b) { - var c2, d, e; - c2 = a.th(); - if (c2 != null && a.wh()) { - for (d = 0, e = c2.length; d < e; ++d) { - c2[d].dj(b); - } - } - } - function QBb(a, b) { - var c2, d, e; - c2 = a.c.Xe(); - for (e = b.Kc(); e.Ob(); ) { - d = e.Pb(); - a.a.Yd(c2, d); - } - return a.b.Kb(c2); - } - function n2b(a, b) { - var c2, d; - c2 = a; - d = Y2b(c2).e; - while (d) { - c2 = d; - if (c2 == b) { - return true; - } - d = Y2b(c2).e; - } - return false; + } + if (index > 0) { + clusters.push(index); + } + } + for (var _ei = 0; _ei < exemplars.length; _ei++) { + clusters[exemplars[_ei]] = exemplars[_ei]; + } + return clusters; + }, "assignClusters"); + assign4 = /* @__PURE__ */ __name(function assign5(n2, S3, exemplars) { + var clusters = assignClusters(n2, S3, exemplars); + for (var ei = 0; ei < exemplars.length; ei++) { + var ii = []; + for (var c3 = 0; c3 < clusters.length; c3++) { + if (clusters[c3] === exemplars[ei]) { + ii.push(c3); } - function Edb(a) { - var b; - b = a.h; - if (b == 0) { - return a.l + a.m * gxe; - } - if (b == exe) { - return a.l + a.m * gxe - hxe; - } - return a; + } + var maxI = -1; + var maxSum = -Infinity; + for (var i2 = 0; i2 < ii.length; i2++) { + var sum2 = 0; + for (var j2 = 0; j2 < ii.length; j2++) { + sum2 += S3[ii[j2] * n2 + ii[i2]]; } - function LHc(a, b, c2) { - var d, e; - d = a.a.f[b.p]; - e = a.a.f[c2.p]; - if (d < e) { - return -1; - } - if (d == e) { - return 0; - } - return 1; + if (sum2 > maxSum) { + maxI = i2; + maxSum = sum2; } - function Wmc(a, b) { - var c2, d; - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 72); - Rmb(a.d, c2); - $mc(a, c2); - } - } - function E6b(a, b) { - var c2; - b.Ug("Edge and layer constraint edge reversal", 1); - c2 = D6b(a); - C6b(c2); - b.Vg(); - } - function m6c(a, b) { - var c2, d; - for (d = new dMd(a); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 27); - Byd(c2, c2.i + b.b, c2.j + b.d); - } - } - function TNd(a) { - var b; - if (a.d == null) { - ++a.e; - a.f = 0; - SNd(null); - } else { - ++a.e; - b = a.d; - a.d = null; - a.f = 0; - SNd(b); - } - } - function Ys(a) { - var b; - if (a.a == a.b.a) { - throw Adb(new Dvb()); - } - b = a.a; - a.c = b; - a.a = RD(Hvb(a.a.e), 227); - return b; - } - function Ywd(a, b) { - var c2; - if ((a.Db & b) != 0) { - c2 = Xwd(a, b); - return c2 == -1 ? a.Eb : SD(a.Eb)[c2]; - } else { - return null; + } + exemplars[ei] = ii[maxI]; + } + clusters = assignClusters(n2, S3, exemplars); + return clusters; + }, "assign"); + affinityPropagation = /* @__PURE__ */ __name(function affinityPropagation2(options3) { + var cy = this.cy(); + var nodes6 = this.nodes(); + var opts = setOptions6(options3); + var id2position = {}; + for (var i2 = 0; i2 < nodes6.length; i2++) { + id2position[nodes6[i2].id()] = i2; + } + var n2; + var n22; + var S3; + var p3; + var R2; + var A2; + n2 = nodes6.length; + n22 = n2 * n2; + S3 = new Array(n22); + for (var _i = 0; _i < n22; _i++) { + S3[_i] = -Infinity; + } + for (var _i2 = 0; _i2 < n2; _i2++) { + for (var j2 = 0; j2 < n2; j2++) { + if (_i2 !== j2) { + S3[_i2 * n2 + j2] = getSimilarity2(opts.distance, nodes6[_i2], nodes6[j2], opts.attributes); + } + } + } + p3 = getPreference(S3, opts.preference); + for (var _i3 = 0; _i3 < n2; _i3++) { + S3[_i3 * n2 + _i3] = p3; + } + R2 = new Array(n22); + for (var _i4 = 0; _i4 < n22; _i4++) { + R2[_i4] = 0; + } + A2 = new Array(n22); + for (var _i5 = 0; _i5 < n22; _i5++) { + A2[_i5] = 0; + } + var old = new Array(n2); + var Rp = new Array(n2); + var se = new Array(n2); + for (var _i6 = 0; _i6 < n2; _i6++) { + old[_i6] = 0; + Rp[_i6] = 0; + se[_i6] = 0; + } + var e3 = new Array(n2 * opts.minIterations); + for (var _i7 = 0; _i7 < e3.length; _i7++) { + e3[_i7] = 0; + } + var iter; + for (iter = 0; iter < opts.maxIterations; iter++) { + for (var _i8 = 0; _i8 < n2; _i8++) { + var max10 = -Infinity, max22 = -Infinity, maxI = -1, AS = 0; + for (var _j = 0; _j < n2; _j++) { + old[_j] = R2[_i8 * n2 + _j]; + AS = A2[_i8 * n2 + _j] + S3[_i8 * n2 + _j]; + if (AS >= max10) { + max22 = max10; + max10 = AS; + maxI = _j; + } else if (AS > max22) { + max22 = AS; } } - function jBd(a, b) { - var c2, d; - c2 = (d = new HYd(), d); - c2.G = b; - !a.rb && (a.rb = new J5d(a, i7, a)); - WGd(a.rb, c2); - return c2; - } - function kBd(a, b) { - var c2, d; - c2 = (d = new k1d(), d); - c2.G = b; - !a.rb && (a.rb = new J5d(a, i7, a)); - WGd(a.rb, c2); - return c2; - } - function wBd(a, b, c2, d) { - ZD(a.Cb, 184) && (RD(a.Cb, 184).tb = null); - PAd(a, c2); - !!b && HXd(a, b); - d && a.gl(true); - } - function nJc(a, b) { - if (a.c) { - oJc(a, b, true); - FDb(new SDb(null, new Swb(b, 16)), new BJc(a)); - } - oJc(a, b, false); - } - function KRc(a) { - FRc(); - var b; - if (!Urb(ERc, a)) { - b = new HRc(); - b.a = a; - Xrb(ERc, a, b); - } - return RD(Vrb(ERc, a), 645); - } - function k3d(a) { - var b; - if (a.g > 1 || a.Ob()) { - ++a.a; - a.g = 0; - b = a.i; - a.Ob(); - return b; - } else { - throw Adb(new Dvb()); - } + for (var _j2 = 0; _j2 < n2; _j2++) { + R2[_i8 * n2 + _j2] = (1 - opts.damping) * (S3[_i8 * n2 + _j2] - max10) + opts.damping * old[_j2]; } - function GRc(a) { - switch (a.a.g) { - case 1: - return new lSc(); - case 3: - return new VUc(); - default: - return new WRc(); - } + R2[_i8 * n2 + maxI] = (1 - opts.damping) * (S3[_i8 * n2 + maxI] - max22) + opts.damping * old[maxI]; + } + for (var _i9 = 0; _i9 < n2; _i9++) { + var sum2 = 0; + for (var _j3 = 0; _j3 < n2; _j3++) { + old[_j3] = A2[_j3 * n2 + _i9]; + Rp[_j3] = Math.max(0, R2[_j3 * n2 + _i9]); + sum2 += Rp[_j3]; } - function fyd(a, b) { - switch (b) { - case 1: - return !!a.n && a.n.i != 0; - case 2: - return a.k != null; - } - return Cxd(a, b); + sum2 -= Rp[_i9]; + Rp[_i9] = R2[_i9 * n2 + _i9]; + sum2 += Rp[_i9]; + for (var _j4 = 0; _j4 < n2; _j4++) { + A2[_j4 * n2 + _i9] = (1 - opts.damping) * Math.min(0, sum2 - Rp[_j4]) + opts.damping * old[_j4]; } - function Hdb(a) { - if (jxe < a && a < hxe) { - return a < 0 ? $wnd.Math.ceil(a) : $wnd.Math.floor(a); + A2[_i9 * n2 + _i9] = (1 - opts.damping) * (sum2 - Rp[_i9]) + opts.damping * old[_i9]; + } + var K4 = 0; + for (var _i10 = 0; _i10 < n2; _i10++) { + var E2 = A2[_i10 * n2 + _i10] + R2[_i10 * n2 + _i10] > 0 ? 1 : 0; + e3[iter % opts.minIterations * n2 + _i10] = E2; + K4 += E2; + } + if (K4 > 0 && (iter >= opts.minIterations - 1 || iter == opts.maxIterations - 1)) { + var _sum = 0; + for (var _i11 = 0; _i11 < n2; _i11++) { + se[_i11] = 0; + for (var _j5 = 0; _j5 < opts.minIterations; _j5++) { + se[_i11] += e3[_j5 * n2 + _i11]; } - return Edb(vD(a)); - } - function hfb(a) { - var b; - if (a < 128) { - return jfb(), b = ifb[a], !b && (b = ifb[a] = new bfb(a)), b; + if (se[_i11] === 0 || se[_i11] === opts.minIterations) { + _sum++; } - return new bfb(a); } - function PCb(b, c2) { - var d; - try { - c2.de(); - } catch (a) { - a = zdb(a); - if (ZD(a, 82)) { - d = a; - ZEb(b.c, d); - } else - throw Adb(a); - } - } - function Wdb(a) { - var b, c2, d, e; - e = a; - d = 0; - if (e < 0) { - e += hxe; - d = exe; - } - c2 = eE(e / gxe); - b = eE(e - c2 * gxe); - return hD(b, c2, d); - } - function dy(a) { - var b, c2, d; - d = 0; - for (c2 = new Osb(a.a); c2.a < c2.c.a.length; ) { - b = Nsb(c2); - a.b.Hc(b) && ++d; - } - return d; - } - function _u(a) { - var b, c2, d; - b = 1; - for (d = a.Kc(); d.Ob(); ) { - c2 = d.Pb(); - b = 31 * b + (c2 == null ? 0 : tb(c2)); - b = ~~b; - } - return b; - } - function kQb(a, b) { - var c2; - if (!b) { - return a; - } - c2 = b.nf(); - c2.dc() || (!a.q ? a.q = new Vsb(c2) : Ld(a.q, c2)); - return a; - } - function Mtb(a, b) { - var c2; - c2 = a.a.get(b); - if (c2 === void 0) { - ++a.d; - } else { - Ctb(a.a, b); - --a.c; - ++a.b.g; - } - return c2; - } - function a0b(a, b) { - var c2, d, e; - c2 = b.p - a.p; - if (c2 == 0) { - d = a.f.a * a.f.b; - e = b.f.a * b.f.b; - return Qfb(d, e); - } - return c2; - } - function Jfc(a, b) { - var c2, d; - c2 = a.j; - d = b.j; - return c2 != d ? c2.g - d.g : a.p == b.p ? 0 : c2 == (qpd(), Yod) ? a.p - b.p : b.p - a.p; - } - function dFc(a, b, c2, d, e) { - bD(a.c[b.g], c2.g, d); - bD(a.c[c2.g], b.g, d); - bD(a.b[b.g], c2.g, e); - bD(a.b[c2.g], b.g, e); - } - function Jyb(a, b, c2) { - this.b = (uFb(a), a); - this.d = (uFb(b), b); - this.e = (uFb(c2), c2); - this.c = this.d + ("" + this.e); - } - function Phe(a, b) { - this.b = a; - this.e = b; - this.d = b.j; - this.f = (nke(), RD(a, 69).xk()); - this.k = pke(b.e.Dh(), a); - } - function USc(a) { - this.n = new bnb(); - this.e = new Yub(); - this.j = new Yub(); - this.k = new bnb(); - this.f = new bnb(); - this.p = a; - } - function rVc(a) { - a.r = new _sb(); - a.w = new _sb(); - a.t = new bnb(); - a.i = new bnb(); - a.d = new _sb(); - a.a = new Tid(); - a.c = new Tsb(); - } - function mOb() { - mOb = geb; - lOb = new nOb("UP", 0); - iOb = new nOb(Zye, 1); - jOb = new nOb(Nye, 2); - kOb = new nOb(Oye, 3); - } - function xvc() { - xvc = geb; - vvc = new yvc("ONE_SIDED", 0); - wvc = new yvc("TWO_SIDED", 1); - uvc = new yvc("OFF", 2); - } - function B9c() { - B9c = geb; - z9c = new D9c("EQUAL_BETWEEN_STRUCTURES", 0); - A9c = new D9c("TO_ASPECT_RATIO", 1); - } - function hDc() { - hDc = geb; - gDc = ss((_Cc(), cD(WC(rX, 1), jwe, 265, 0, [ZCc, WCc, XCc, TCc, VCc, $Cc, YCc, SCc, UCc]))); - } - function iqd() { - iqd = geb; - hqd = ss((dqd(), cD(WC(I3, 1), jwe, 264, 0, [Ypd, $pd, Xpd, _pd, aqd, cqd, bqd, Zpd, Wpd]))); - } - function jod() { - jod = geb; - iod = ss((dod(), cD(WC(A3, 1), jwe, 95, 0, [Xnd, Wnd, Znd, cod, bod, aod, $nd, _nd, Ynd]))); - } - function nIb() { - nIb = geb; - mIb = ss((iIb(), cD(WC(xN, 1), jwe, 257, 0, [hIb, cIb, dIb, bIb, fIb, gIb, eIb, aIb, _Hb]))); - } - function oSc(a) { - var b; - b = RD(mQb(a, (Ywc(), hwc)), 64); - return a.k == (r3b(), m3b) && (b == (qpd(), ppd) || b == Xod); - } - function j0b(a, b, c2) { - var d, e; - e = RD(mQb(a, (yCc(), RAc)), 75); - if (e) { - d = new Ejd(); - Ajd(d, 0, e); - Cjd(d, c2); - ye(b, d); - } - } - function U2b(a, b, c2) { - var d, e, f2, g; - g = Y2b(a); - d = g.d; - e = g.c; - f2 = a.n; - b && (f2.a = f2.a - d.b - e.a); - c2 && (f2.b = f2.b - d.d - e.b); - } - function OOb(a, b) { - var c2, d; - c2 = a.f.c.length; - d = b.f.c.length; - if (c2 < d) { - return -1; - } - if (c2 == d) { - return 0; - } - return 1; + if (_sum === n2) { + break; } - function S0b(a) { - if (a.b.c.length != 0 && !!RD(Vmb(a.b, 0), 72).a) { - return RD(Vmb(a.b, 0), 72).a; - } - return R0b(a); - } - function fr(a) { - var b; - if (a) { - b = a; - if (b.dc()) { - throw Adb(new Dvb()); - } - return b.Xb(b.gc() - 1); - } - return Fr(a.Kc()); - } - function Dib(a) { - var b; - Ddb(a, 0) < 0 && (a = Qdb(a)); - return b = Ydb(Udb(a, 32)), 64 - (b != 0 ? ngb(b) : ngb(Ydb(a)) + 32); - } - function pBb() { - gBb(); - if (dBb) { - return new oBb(null); - } - return ZAb(_Ab(), "com.google.common.base.Strings"); - } - function eyd(a, b, c2, d) { - if (c2 == 1) { - return !a.n && (a.n = new C5d(I4, a, 1, 7)), rLd(a.n, b, d); - } - return Bxd(a, b, c2, d); - } - function eBd(a, b) { - var c2, d; - d = (c2 = new _9d(), c2); - PAd(d, b); - WGd((!a.A && (a.A = new iie(z7, a, 7)), a.A), d); - return d; - } - function xEd(a, b, c2) { - var d, e, f2, g; - f2 = null; - g = b; - e = wDd(g, iIe); - d = new JEd(a, c2); - f2 = (LDd(d.a, d.b, e), e); - return f2; - } - function iXd(a) { - var b; - if (!a.a || (a.Bb & 1) == 0 && a.a.Vh()) { - b = WVd(a); - ZD(b, 156) && (a.a = RD(b, 156)); - } - return a.a; - } - function Be(a, b) { - var c2, d; - uFb(b); - for (d = b.Kc(); d.Ob(); ) { - c2 = d.Pb(); - if (!a.Hc(c2)) { - return false; + } + } + var exemplarsIndices = findExemplars(n2, R2, A2); + var clusterIndices = assign4(n2, S3, exemplarsIndices); + var clusters = {}; + for (var c3 = 0; c3 < exemplarsIndices.length; c3++) { + clusters[exemplarsIndices[c3]] = []; + } + for (var _i12 = 0; _i12 < nodes6.length; _i12++) { + var pos = id2position[nodes6[_i12].id()]; + var clusterIndex = clusterIndices[pos]; + if (clusterIndex != null) { + clusters[clusterIndex].push(nodes6[_i12]); + } + } + var retClusters = new Array(exemplarsIndices.length); + for (var _c = 0; _c < exemplarsIndices.length; _c++) { + retClusters[_c] = cy.collection(clusters[exemplarsIndices[_c]]); + } + return retClusters; + }, "affinityPropagation"); + affinityPropagation$1 = { + affinityPropagation, + ap: affinityPropagation + }; + hierholzerDefaults = defaults$g({ + root: void 0, + directed: false + }); + elesfn$k = { + hierholzer: /* @__PURE__ */ __name(function hierholzer(options3) { + if (!plainObject(options3)) { + var args = arguments; + options3 = { + root: args[0], + directed: args[1] + }; + } + var _hierholzerDefaults = hierholzerDefaults(options3), root4 = _hierholzerDefaults.root, directed = _hierholzerDefaults.directed; + var eles = this; + var dflag = false; + var oddIn; + var oddOut; + var startVertex; + if (root4) startVertex = string(root4) ? this.filter(root4)[0].id() : root4[0].id(); + var nodes6 = {}; + var edges5 = {}; + if (directed) { + eles.forEach(function(ele) { + var id26 = ele.id(); + if (ele.isNode()) { + var ind = ele.indegree(true); + var outd = ele.outdegree(true); + var d1 = ind - outd; + var d22 = outd - ind; + if (d1 == 1) { + if (oddIn) dflag = true; + else oddIn = id26; + } else if (d22 == 1) { + if (oddOut) dflag = true; + else oddOut = id26; + } else if (d22 > 1 || d1 > 1) { + dflag = true; } + nodes6[id26] = []; + ele.outgoers().forEach(function(e3) { + if (e3.isEdge()) nodes6[id26].push(e3.id()); + }); + } else { + edges5[id26] = [void 0, ele.target().id()]; } - return true; - } - function sD(a, b) { - var c2, d, e; - c2 = a.l + b.l; - d = a.m + b.m + (c2 >> 22); - e = a.h + b.h + (d >> 22); - return hD(c2 & dxe, d & dxe, e & exe); - } - function DD(a, b) { - var c2, d, e; - c2 = a.l - b.l; - d = a.m - b.m + (c2 >> 22); - e = a.h - b.h + (d >> 22); - return hD(c2 & dxe, d & dxe, e & exe); - } - function Jpc(a) { - var b, c2; - Hpc(a); - for (c2 = new Anb(a.d); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 105); - !!b.i && Ipc(b); - } - } - function zdb(a) { - var b; - if (ZD(a, 82)) { - return a; - } - b = a && a.__java$exception; - if (!b) { - b = new Cz(a); - gA(b); - } - return b; - } - function BGd(a) { - if (ZD(a, 193)) { - return RD(a, 123); - } else if (!a) { - throw Adb(new Ogb(HIe)); + }); + } else { + eles.forEach(function(ele) { + var id26 = ele.id(); + if (ele.isNode()) { + var d3 = ele.degree(true); + if (d3 % 2) { + if (!oddIn) oddIn = id26; + else if (!oddOut) oddOut = id26; + else dflag = true; + } + nodes6[id26] = []; + ele.connectedEdges().forEach(function(e3) { + return nodes6[id26].push(e3.id()); + }); } else { - return null; + edges5[id26] = [ele.source().id(), ele.target().id()]; } - } - function skb(a) { - if (a.a.Ob()) { - return true; + }); + } + var result = { + found: false, + trail: void 0 + }; + if (dflag) return result; + else if (oddOut && oddIn) { + if (directed) { + if (startVertex && oddOut != startVertex) { + return result; } - if (a.a != a.e) { - return false; + startVertex = oddOut; + } else { + if (startVertex && oddOut != startVertex && oddIn != startVertex) { + return result; + } else if (!startVertex) { + startVertex = oddOut; } - a.a = new wtb(a.f.f); - return a.a.Ob(); } - function kmb(a, b) { - if (b == null) { - return false; - } - while (a.a != a.b) { - if (pb(b, Imb(a))) { - return true; - } + } else { + if (!startVertex) startVertex = eles[0].id(); + } + var walk = /* @__PURE__ */ __name(function walk2(v3) { + var currentNode = v3; + var subtour2 = [v3]; + var adj, adjTail, adjHead; + while (nodes6[currentNode].length) { + adj = nodes6[currentNode].shift(); + adjTail = edges5[adj][0]; + adjHead = edges5[adj][1]; + if (currentNode != adjHead) { + nodes6[adjHead] = nodes6[adjHead].filter(function(e3) { + return e3 != adj; + }); + currentNode = adjHead; + } else if (!directed && currentNode != adjTail) { + nodes6[adjTail] = nodes6[adjTail].filter(function(e3) { + return e3 != adj; + }); + currentNode = adjTail; } - return false; + subtour2.unshift(adj); + subtour2.unshift(currentNode); } - function dHb(a, b) { - if (!a || !b || a == b) { - return false; - } - return tGb(a.d.c, b.d.c + b.d.b) && tGb(b.d.c, a.d.c + a.d.b); + return subtour2; + }, "walk"); + var trail = []; + var subtour = []; + subtour = walk(startVertex); + while (subtour.length != 1) { + if (nodes6[subtour[0]].length == 0) { + trail.unshift(eles.getElementById(subtour.shift())); + trail.unshift(eles.getElementById(subtour.shift())); + } else { + subtour = walk(subtour.shift()).concat(subtour); } - function Tmb(a, b) { - var c2, d; - c2 = b.Pc(); - d = c2.length; - if (d == 0) { - return false; - } - YEb(a.c, a.c.length, c2); - return true; + } + trail.unshift(eles.getElementById(subtour.shift())); + for (var d2 in nodes6) { + if (nodes6[d2].length) { + return result; } - function NBb(a, b, c2) { - var d, e; - for (e = b.vc().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 44); - a.yc(d.ld(), d.md(), c2); - } - return a; - } - function $Wc(a) { - var b, c2, d; - b = new Yub(); - for (d = Sub(a.d, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 65); - Mub(b, c2.c); - } - return b; - } - function Pdc(a, b) { - var c2, d; - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 72); - pQb(c2, (Ywc(), swc), b); - } - } - function L9c(a, b, c2) { - var d, e; - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 27); - Byd(d, d.i + b, d.j + c2); - } - } - function Nb(a, b) { - if (!a) { - throw Adb(new agb(hc("value already present: %s", cD(WC(jJ, 1), rve, 1, 5, [b])))); - } - } - function Aid(a, b, c2, d, e) { - tid(); - return $wnd.Math.min(Lid(a, b, c2, d, e), Lid(c2, d, a, b, fjd(new rjd(e.a, e.b)))); - } - function Rdd(a, b, c2, d) { - RD(c2.b, 68); - RD(c2.b, 68); - RD(d.b, 68); - RD(d.b, 68); - RD(d.b, 68); - Umb(d.a, new Wdd(a, b, d)); - } - function NGb(a, b) { - a.d == (Cmd(), ymd) || a.d == Bmd ? RD(b.a, 60).c.Fc(RD(b.b, 60)) : RD(b.b, 60).c.Fc(RD(b.a, 60)); - } - function Ued(a, b) { - var c2; - c2 = ev(b.a.gc()); - FDb(PDb(new SDb(null, new Swb(b, 1)), a.i), new ffd(a, c2)); - return c2; - } - function fBd(a) { - var b, c2; - c2 = (b = new _9d(), b); - PAd(c2, "T"); - WGd((!a.d && (a.d = new iie(z7, a, 11)), a.d), c2); - return c2; - } - function cHd(a) { - var b, c2, d, e; - b = 1; - for (c2 = 0, e = a.gc(); c2 < e; ++c2) { - d = a.Vi(c2); - b = 31 * b + (d == null ? 0 : tb(d)); - } - return b; - } - function cj(a, b, c2, d) { - var e; - Pb(b, a.e.Rd().gc()); - Pb(c2, a.c.Rd().gc()); - e = a.a[b][c2]; - bD(a.a[b], c2, d); - return e; - } - function cD(a, b, c2, d, e) { - e.Rm = a; - e.Sm = b; - e.Tm = keb; - e.__elementTypeId$ = c2; - e.__elementTypeCategory$ = d; - return e; - } - function vec() { - vec = geb; - uec = new xec(LAe, 0); - sec = new xec(oBe, 1); - tec = new xec(pBe, 2); - rec = new xec("BOTH", 3); - } - function enc() { - enc = geb; - anc = new fnc(Kye, 0); - bnc = new fnc(Nye, 1); - cnc = new fnc(Oye, 2); - dnc = new fnc("TOP", 3); - } - function nZb() { - nZb = geb; - jZb = new qZb("Q1", 0); - mZb = new qZb("Q4", 1); - kZb = new qZb("Q2", 2); - lZb = new qZb("Q3", 3); - } - function DFc() { - DFc = geb; - BFc = new EFc("OFF", 0); - CFc = new EFc("SINGLE_EDGE", 1); - AFc = new EFc("MULTI_EDGE", 2); - } - function ldd() { - ldd = geb; - kdd = new ndd("MINIMUM_SPANNING_TREE", 0); - jdd = new ndd("MAXIMUM_SPANNING_TREE", 1); - } - function hed() { - hed = geb; - fed = new sed(); - eed = new qed(); - } - function EGd(a) { - var b, c2; - c2 = (bvd(), b = new Rzd(), b); - !!a && WGd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a), c2); - return c2; - } - function N2c(a) { - var b, c2, d, e; - e = new bnb(); - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 27); - b = Q2c(c2); - Tmb(e, b); - } - return e; - } - function Jr(a, b) { - var c2, d; - Rb(b, "predicate"); - for (d = 0; a.Ob(); d++) { - c2 = a.Pb(); - if (b.Lb(c2)) { - return d; - } + } + result.found = true; + result.trail = this.spawn(trail, true); + return result; + }, "hierholzer") + }; + hopcroftTarjanBiconnected = /* @__PURE__ */ __name(function hopcroftTarjanBiconnected2() { + var eles = this; + var nodes6 = {}; + var id26 = 0; + var edgeCount4 = 0; + var components3 = []; + var stack = []; + var visitedEdges = {}; + var buildComponent = /* @__PURE__ */ __name(function buildComponent2(x5, y5) { + var i2 = stack.length - 1; + var cutset = []; + var component2 = eles.spawn(); + while (stack[i2].x != x5 || stack[i2].y != y5) { + cutset.push(stack.pop().edge); + i2--; + } + cutset.push(stack.pop().edge); + cutset.forEach(function(edge) { + var connectedNodes = edge.connectedNodes().intersection(eles); + component2.merge(edge); + connectedNodes.forEach(function(node2) { + var nodeId = node2.id(); + var connectedEdges = node2.connectedEdges().intersection(eles); + component2.merge(node2); + if (!nodes6[nodeId].cutVertex) { + component2.merge(connectedEdges); + } else { + component2.merge(connectedEdges.filter(function(edge2) { + return edge2.isLoop(); + })); } - return -1; - } - function xSd(a, b) { - var c2, d; - d = 0; - if (a < 64 && a <= b) { - b = b < 64 ? b : 63; - for (c2 = a; c2 <= b; c2++) { - d = Rdb(d, Sdb(1, c2)); + }); + }); + components3.push(component2); + }, "buildComponent"); + var biconnectedSearch = /* @__PURE__ */ __name(function biconnectedSearch2(root4, currentNode, parent4) { + if (root4 === parent4) edgeCount4 += 1; + nodes6[currentNode] = { + id: id26, + low: id26++, + cutVertex: false + }; + var edges5 = eles.getElementById(currentNode).connectedEdges().intersection(eles); + if (edges5.size() === 0) { + components3.push(eles.spawn(eles.getElementById(currentNode))); + } else { + var sourceId, targetId, otherNodeId, edgeId; + edges5.forEach(function(edge) { + sourceId = edge.source().id(); + targetId = edge.target().id(); + otherNodeId = sourceId === currentNode ? targetId : sourceId; + if (otherNodeId !== parent4) { + edgeId = edge.id(); + if (!visitedEdges[edgeId]) { + visitedEdges[edgeId] = true; + stack.push({ + x: currentNode, + y: otherNodeId, + edge + }); + } + if (!(otherNodeId in nodes6)) { + biconnectedSearch2(root4, otherNodeId, currentNode); + nodes6[currentNode].low = Math.min(nodes6[currentNode].low, nodes6[otherNodeId].low); + if (nodes6[currentNode].id <= nodes6[otherNodeId].low) { + nodes6[currentNode].cutVertex = true; + buildComponent(currentNode, otherNodeId); + } + } else { + nodes6[currentNode].low = Math.min(nodes6[currentNode].low, nodes6[otherNodeId].id); } } - return d; - } - function oQc(a, b) { - var c2, d; - c2 = a.c; - d = b.e[a.p]; - if (d < c2.a.c.length - 1) { - return RD(Vmb(c2.a, d + 1), 10); - } - return null; - } - function Bob(a) { - yob(); - var b, c2, d; - d = 0; - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - d = d + (b != null ? tb(b) : 0); - d = d | 0; - } - return d; - } - function wsb(a) { - var b, c2, d; - b = RD(a.e && a.e(), 9); - d = (c2 = b.slice(), RD(dD(c2, b), 9)); - return new Fsb(b, d, b.length); - } - function Bdd(a, b, c2) { - var d; - akb(a.a); - Umb(c2.i, new Mdd(a)); - d = new $Fb(RD(Wjb(a.a, b.b), 68)); - Add(a, d, b); - c2.f = d; - } - function bgc(a) { - var b; - X0b(a, true); - b = Awe; - nQb(a, (yCc(), KBc)) && (b += RD(mQb(a, KBc), 17).a); - pQb(a, KBc, sgb(b)); - } - function hB(a) { - var b; - b = new dB(); - b.a = a; - b.b = fB(a); - b.c = $C(qJ, Nve, 2, 2, 6, 1); - b.c[0] = gB(a); - b.c[1] = gB(a); - return b; - } - function Z7b(a) { - var b, c2, d; - c2 = a.n; - d = a.o; - b = a.d; - return new Uid2(c2.a - b.b, c2.b - b.d, d.a + (b.b + b.c), d.b + (b.d + b.a)); - } - function UQb(a, b) { - if (!a || !b || a == b) { - return false; - } - return $y(a.b.c, b.b.c + b.b.b) < 0 && $y(b.b.c, a.b.c + a.b.b) < 0; - } - function Qnd(a) { - switch (a.g) { - case 1: - return Mnd; - case 2: - return Lnd; - case 3: - return Nnd; - default: - return Ond; - } - } - function mec(a) { - switch (RD(mQb(a, (yCc(), UAc)), 171).g) { - case 2: - case 4: - return true; - default: - return false; - } - } - function aHb(a, b, c2) { - switch (c2.g) { - case 2: - a.b = b; - break; - case 1: - a.c = b; - break; - case 4: - a.d = b; - break; - case 3: - a.a = b; - } + }); + } + }, "biconnectedSearch"); + eles.forEach(function(ele) { + if (ele.isNode()) { + var nodeId = ele.id(); + if (!(nodeId in nodes6)) { + edgeCount4 = 0; + biconnectedSearch(nodeId, nodeId); + nodes6[nodeId].cutVertex = edgeCount4 > 1; } - function Exd(a, b) { - switch (b) { - case 0: - !a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)); - a.o.c.$b(); - return; + } + }); + var cutVertices = Object.keys(nodes6).filter(function(id27) { + return nodes6[id27].cutVertex; + }).map(function(id27) { + return eles.getElementById(id27); + }); + return { + cut: eles.spawn(cutVertices), + components: components3 + }; + }, "hopcroftTarjanBiconnected"); + hopcroftTarjanBiconnected$1 = { + hopcroftTarjanBiconnected, + htbc: hopcroftTarjanBiconnected, + htb: hopcroftTarjanBiconnected, + hopcroftTarjanBiconnectedComponents: hopcroftTarjanBiconnected + }; + tarjanStronglyConnected = /* @__PURE__ */ __name(function tarjanStronglyConnected2() { + var eles = this; + var nodes6 = {}; + var index = 0; + var components3 = []; + var stack = []; + var cut = eles.spawn(eles); + var stronglyConnectedSearch = /* @__PURE__ */ __name(function stronglyConnectedSearch2(sourceNodeId) { + stack.push(sourceNodeId); + nodes6[sourceNodeId] = { + index, + low: index++, + explored: false + }; + var connectedEdges = eles.getElementById(sourceNodeId).connectedEdges().intersection(eles); + connectedEdges.forEach(function(edge) { + var targetNodeId = edge.target().id(); + if (targetNodeId !== sourceNodeId) { + if (!(targetNodeId in nodes6)) { + stronglyConnectedSearch2(targetNodeId); } - $vd(a, b); - } - function Mad(a, b) { - var c2, d; - c2 = RD(RD(Wjb(a.g, b.a), 42).a, 68); - d = RD(RD(Wjb(a.g, b.b), 42).a, 68); - return SQb(c2, d); - } - function XGd(a, b, c2) { - var d; - d = a.gc(); - if (b > d) - throw Adb(new aMd(b, d)); - a.Si() && (c2 = bHd(a, c2)); - return a.Ei(b, c2); - } - function eQb(a, b, c2, d, e) { - var f2, g; - for (g = c2; g <= e; g++) { - for (f2 = b; f2 <= d; f2++) { - PPb(a, f2, g) || TPb(a, f2, g, true, false); - } - } - } - function uid(a) { - tid(); - var b, c2, d; - c2 = $C(l3, Nve, 8, 2, 0, 1); - d = 0; - for (b = 0; b < 2; b++) { - d += 0.5; - c2[b] = Cid(d, a); - } - return c2; - } - function xD(a) { - var b, c2, d; - b = ~a.l + 1 & dxe; - c2 = ~a.m + (b == 0 ? 1 : 0) & dxe; - d = ~a.h + (b == 0 && c2 == 0 ? 1 : 0) & exe; - return hD(b, c2, d); - } - function mgb(a) { - var b; - if (a < 0) { - return qwe; - } else if (a == 0) { - return 0; - } else { - for (b = hwe; (b & a) == 0; b >>= 1) - ; - return b; + if (!nodes6[targetNodeId].explored) { + nodes6[sourceNodeId].low = Math.min(nodes6[sourceNodeId].low, nodes6[targetNodeId].low); } } - function zSd(a, b, c2) { - if (a >= 128) - return false; - return a < 64 ? Pdb(Cdb(Sdb(1, a), c2), 0) : Pdb(Cdb(Sdb(1, a - 64), b), 0); - } - function oQb(a, b, c2) { - return c2 == null ? (!a.q && (a.q = new Tsb()), _jb(a.q, b)) : (!a.q && (a.q = new Tsb()), Zjb(a.q, b, c2)), a; - } - function pQb(a, b, c2) { - c2 == null ? (!a.q && (a.q = new Tsb()), _jb(a.q, b)) : (!a.q && (a.q = new Tsb()), Zjb(a.q, b, c2)); - return a; - } - function KTb(a) { - var b, c2; - c2 = new gUb(); - kQb(c2, a); - pQb(c2, (JVb(), HVb), a); - b = new Tsb(); - MTb(a, c2, b); - LTb(a, c2, b); - return c2; - } - function cIc(a) { - var b, c2; - b = a.t - a.k[a.o.p] * a.d + a.j[a.o.p] > a.f; - c2 = a.u + a.e[a.o.p] * a.d > a.f * a.s * a.d; - return b || c2; - } - function qmc(a, b) { - var c2, d, e, f2; - c2 = false; - d = a.a[b].length; - for (f2 = 0; f2 < d - 1; f2++) { - e = f2 + 1; - c2 = c2 | rmc(a, b, f2, e); - } - return c2; - } - function Emc(a) { - var b, c2, d, e; - for (c2 = a.a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Jmc(a, b, (qpd(), npd)); - Jmc(a, b, Yod); - } - } - function tvc() { - tvc = geb; - svc = ss((ovc(), cD(WC(iX, 1), jwe, 259, 0, [fvc, hvc, ivc, jvc, kvc, lvc, nvc, evc, gvc, mvc]))); - } - function fEc() { - fEc = geb; - eEc = ss((aEc(), cD(WC(vX, 1), jwe, 243, 0, [$Dc, VDc, YDc, WDc, XDc, SDc, ZDc, _Dc, TDc, UDc]))); - } - function huc() { - huc = geb; - fuc = new iuc(LAe, 0); - euc = new iuc("INCOMING_ONLY", 1); - guc = new iuc("OUTGOING_ONLY", 2); - } - function HC() { - HC = geb; - GC = { "boolean": IC, "number": JC, "string": LC, "object": KC, "function": KC, "undefined": MC }; - } - function pfb() { - this.o = null; - this.k = null; - this.j = null; - this.d = null; - this.b = null; - this.n = null; - this.a = null; - } - function pj(a, b) { - this.c = a; - this.d = b; - this.b = this.d / this.c.c.Rd().gc() | 0; - this.a = this.d % this.c.c.Rd().gc(); - } - function R$d(a, b) { - this.b = a; - N$d.call(this, (RD(QHd(xYd((lTd(), kTd).o), 10), 19), b.i), b.g); - this.a = (lYd(), kYd); - } - function vB(a, b, c2) { - this.q = new $wnd.Date(); - this.q.setFullYear(a + Owe, b, c2); - this.q.setHours(0, 0, 0, 0); - mB(this, 0); - } - function ckb(a, b) { - mFb(a >= 0, "Negative initial capacity"); - mFb(b >= 0, "Non-positive load factor"); - akb(this); - } - function iib(a, b, c2, d, e) { - var f2, g; - g = a.length; - f2 = c2.length; - if (b < 0 || d < 0 || e < 0 || b + e > g || d + e > f2) { - throw Adb(new ueb()); - } - } - function zob(a, b) { - yob(); - var c2, d, e, f2, g; - g = false; - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - g = g | a.Fc(c2); - } - return g; - } - function Wyb(a, b, c2) { - var d, e; - d = new Fzb(b, c2); - e = new Gzb(); - a.b = Uyb(a, a.b, d, e); - e.b || ++a.c; - a.b.b = false; - return e.d; - } - function omb(a) { - var b; - b = a.a[a.b]; - if (b == null) { - return null; + }); + if (nodes6[sourceNodeId].index === nodes6[sourceNodeId].low) { + var componentNodes = eles.spawn(); + for (; ; ) { + var nodeId = stack.pop(); + componentNodes.merge(eles.getElementById(nodeId)); + nodes6[nodeId].low = nodes6[sourceNodeId].index; + nodes6[nodeId].explored = true; + if (nodeId === sourceNodeId) { + break; } - bD(a.a, a.b, null); - a.b = a.b + 1 & a.a.length - 1; - return b; } - function oD(a) { - var b, c2; - c2 = ngb(a.h); - if (c2 == 32) { - b = ngb(a.m); - return b == 32 ? ngb(a.l) + 32 : b + 20 - 10; - } else { - return c2 - 12; - } - } - function $5d(a) { - var b; - if (!a.c || (a.Bb & 1) == 0 && (a.c.Db & 64) != 0) { - b = WVd(a); - ZD(b, 90) && (a.c = RD(b, 29)); - } - return a.c; - } - function OGb(a) { - var b, c2; - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - b.d.c = -b.d.c - b.d.b; - } - IGb(a); - } - function zYb(a) { - var b, c2; - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - b.g.c = -b.g.c - b.g.b; - } - uYb(a); - } - function Jmc(a, b, c2) { - var d, e, f2, g; - g = aMc(b, c2); - f2 = 0; - for (e = g.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 12); - Zjb(a.c, d, sgb(f2++)); - } - } - function qMc(a, b, c2) { - var d; - d = new bnb(); - sMc(a, b, d, (qpd(), Xod), true, false); - sMc(a, c2, d, ppd, false, false); - return d; - } - function xjd(a) { - var b, c2, d, e, f2; - b = new pjd(); - for (d = a, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - b.a += c2.a; - b.b += c2.b; - } - return b; - } - function CEd(a, b, c2) { - var d, e, f2, g; - f2 = null; - g = b; - e = wDd(g, "labels"); - d = new fFd(a, c2); - f2 = (bEd(d.a, d.b, e), e); - return f2; - } - function Jee(a, b, c2, d) { - var e; - e = Ree(a, b, c2, d); - if (!e) { - e = Iee(a, c2, d); - if (!!e && !Eee(a, b, e)) { - return null; - } - } - return e; + var componentEdges = componentNodes.edgesWith(componentNodes); + var component2 = componentNodes.merge(componentEdges); + components3.push(component2); + cut = cut.difference(component2); + } + }, "stronglyConnectedSearch"); + eles.forEach(function(ele) { + if (ele.isNode()) { + var nodeId = ele.id(); + if (!(nodeId in nodes6)) { + stronglyConnectedSearch(nodeId); } - function Mee(a, b, c2, d) { - var e; - e = See(a, b, c2, d); - if (!e) { - e = Lee(a, c2, d); - if (!!e && !Eee(a, b, e)) { - return null; - } - } - return e; - } - function Cb(a, b, c2) { - Qb(b); - if (c2.Ob()) { - Vhb(b, Fb(c2.Pb())); - while (c2.Ob()) { - Vhb(b, a.a); - Vhb(b, Fb(c2.Pb())); - } - } - return b; + } + }); + return { + cut, + components: components3 + }; + }, "tarjanStronglyConnected"); + tarjanStronglyConnected$1 = { + tarjanStronglyConnected, + tsc: tarjanStronglyConnected, + tscc: tarjanStronglyConnected, + tarjanStronglyConnectedComponents: tarjanStronglyConnected + }; + elesfn$j = {}; + [elesfn$v, elesfn$u, elesfn$t, elesfn$s, elesfn$r, elesfn$q, elesfn$p, elesfn$o, elesfn$n, elesfn$m, elesfn$l, markovClustering$1, kClustering, hierarchicalClustering$1, affinityPropagation$1, elesfn$k, hopcroftTarjanBiconnected$1, tarjanStronglyConnected$1].forEach(function(props) { + extend2(elesfn$j, props); + }); + STATE_PENDING = 0; + STATE_FULFILLED = 1; + STATE_REJECTED = 2; + api = /* @__PURE__ */ __name(function api2(executor) { + if (!(this instanceof api2)) return new api2(executor); + this.id = "Thenable/1.0.7"; + this.state = STATE_PENDING; + this.fulfillValue = void 0; + this.rejectReason = void 0; + this.onFulfilled = []; + this.onRejected = []; + this.proxy = { + then: this.then.bind(this) + }; + if (typeof executor === "function") executor.call(this, this.fulfill.bind(this), this.reject.bind(this)); + }, "api"); + api.prototype = { + /* promise resolving methods */ + fulfill: /* @__PURE__ */ __name(function fulfill(value2) { + return deliver(this, STATE_FULFILLED, "fulfillValue", value2); + }, "fulfill"), + reject: /* @__PURE__ */ __name(function reject2(value2) { + return deliver(this, STATE_REJECTED, "rejectReason", value2); + }, "reject"), + /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ + then: /* @__PURE__ */ __name(function then(onFulfilled, onRejected) { + var curr = this; + var next3 = new api(); + curr.onFulfilled.push(resolver(onFulfilled, next3, "fulfill")); + curr.onRejected.push(resolver(onRejected, next3, "reject")); + execute(curr); + return next3.proxy; + }, "then") + }; + deliver = /* @__PURE__ */ __name(function deliver2(curr, state4, name, value2) { + if (curr.state === STATE_PENDING) { + curr.state = state4; + curr[name] = value2; + execute(curr); + } + return curr; + }, "deliver"); + execute = /* @__PURE__ */ __name(function execute2(curr) { + if (curr.state === STATE_FULFILLED) execute_handlers(curr, "onFulfilled", curr.fulfillValue); + else if (curr.state === STATE_REJECTED) execute_handlers(curr, "onRejected", curr.rejectReason); + }, "execute"); + execute_handlers = /* @__PURE__ */ __name(function execute_handlers2(curr, name, value2) { + if (curr[name].length === 0) return; + var handlers = curr[name]; + curr[name] = []; + var func = /* @__PURE__ */ __name(function func2() { + for (var i2 = 0; i2 < handlers.length; i2++) { + handlers[i2](value2); + } + }, "func"); + if (typeof setImmediate === "function") setImmediate(func); + else setTimeout(func, 0); + }, "execute_handlers"); + resolver = /* @__PURE__ */ __name(function resolver2(cb, next3, method) { + return function(value2) { + if (typeof cb !== "function") + next3[method].call(next3, value2); + else { + var result; + try { + result = cb(value2); + } catch (e3) { + next3.reject(e3); + return; } - function Xb(a, b) { - var c2; - for (c2 = 0; c2 < a.a.a.length; c2++) { - if (!RD(kob(a.a, c2), 178).Lb(b)) { - return false; - } + resolve(next3, result); + } + }; + }, "resolver"); + resolve = /* @__PURE__ */ __name(function resolve2(promise4, x5) { + if (promise4 === x5 || promise4.proxy === x5) { + promise4.reject(new TypeError("cannot resolve promise with itself")); + return; + } + var then2; + if (_typeof(x5) === "object" && x5 !== null || typeof x5 === "function") { + try { + then2 = x5.then; + } catch (e3) { + promise4.reject(e3); + return; + } + } + if (typeof then2 === "function") { + var resolved = false; + try { + then2.call( + x5, + /* resolvePromise */ + /* [Promises/A+ 2.3.3.3.1] */ + function(y5) { + if (resolved) return; + resolved = true; + if (y5 === x5) + promise4.reject(new TypeError("circular thenable chain")); + else resolve2(promise4, y5); + }, + /* rejectPromise */ + /* [Promises/A+ 2.3.3.3.2] */ + function(r2) { + if (resolved) return; + resolved = true; + promise4.reject(r2); } - return true; + ); + } catch (e3) { + if (!resolved) + promise4.reject(e3); + } + return; + } + promise4.fulfill(x5); + }, "resolve"); + api.all = function(ps) { + return new api(function(resolveAll, rejectAll) { + var vals = new Array(ps.length); + var doneCount = 0; + var fulfill2 = /* @__PURE__ */ __name(function fulfill3(i3, val) { + vals[i3] = val; + doneCount++; + if (doneCount === ps.length) { + resolveAll(vals); } - function fB(a) { - var b; - if (a == 0) { - return "Etc/GMT"; - } - if (a < 0) { - a = -a; - b = "Etc/GMT-"; + }, "fulfill"); + for (var i2 = 0; i2 < ps.length; i2++) { + (function(i3) { + var p3 = ps[i3]; + var isPromise = p3 != null && p3.then != null; + if (isPromise) { + p3.then(function(val2) { + fulfill2(i3, val2); + }, function(err) { + rejectAll(err); + }); } else { - b = "Etc/GMT+"; - } - return b + iB(a); - } - function DA(a) { - var b; - if (a.b <= 0) { - return false; - } - b = qhb("MLydhHmsSDkK", Fhb(ihb(a.c, 0))); - return b > 1 || b >= 0 && a.b < 3; - } - function nD(a) { - var b, c2, d; - b = ~a.l + 1 & dxe; - c2 = ~a.m + (b == 0 ? 1 : 0) & dxe; - d = ~a.h + (b == 0 && c2 == 0 ? 1 : 0) & exe; - a.l = b; - a.m = c2; - a.h = d; - } - function Cob(a) { - yob(); - var b, c2, d; - d = 1; - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - d = 31 * d + (b != null ? tb(b) : 0); - d = d | 0; - } - return d; - } - function kD(a, b, c2, d, e) { - var f2; - f2 = BD(a, b); - c2 && nD(f2); - if (e) { - a = mD(a, b); - d ? eD = xD(a) : eD = hD(a.l, a.m, a.h); - } - return f2; - } - function Qlc(a, b, c2) { - a.g = Wlc(a, b, (qpd(), Xod), a.b); - a.d = Wlc(a, c2, Xod, a.b); - if (a.g.c == 0 || a.d.c == 0) { - return; + var val = p3; + fulfill2(i3, val); } - Tlc(a); + })(i2); + } + }); + }; + api.resolve = function(val) { + return new api(function(resolve3, reject3) { + resolve3(val); + }); + }; + api.reject = function(val) { + return new api(function(resolve3, reject3) { + reject3(val); + }); + }; + Promise$1 = typeof Promise !== "undefined" ? Promise : api; + Animation = /* @__PURE__ */ __name(function Animation2(target, opts, opts2) { + var isCore = core(target); + var isEle = !isCore; + var _p = this._private = extend2({ + duration: 1e3 + }, opts, opts2); + _p.target = target; + _p.style = _p.style || _p.css; + _p.started = false; + _p.playing = false; + _p.hooked = false; + _p.applying = false; + _p.progress = 0; + _p.completes = []; + _p.frames = []; + if (_p.complete && fn$6(_p.complete)) { + _p.completes.push(_p.complete); + } + if (isEle) { + var pos = target.position(); + _p.startPosition = _p.startPosition || { + x: pos.x, + y: pos.y + }; + _p.startStyle = _p.startStyle || target.cy().style().getAnimationStartStyle(target, _p.style); + } + if (isCore) { + var pan2 = target.pan(); + _p.startPan = { + x: pan2.x, + y: pan2.y + }; + _p.startZoom = target.zoom(); + } + this.length = 1; + this[0] = this; + }, "Animation"); + anifn = Animation.prototype; + extend2(anifn, { + instanceString: /* @__PURE__ */ __name(function instanceString() { + return "animation"; + }, "instanceString"), + hook: /* @__PURE__ */ __name(function hook() { + var _p = this._private; + if (!_p.hooked) { + var q2; + var tAni = _p.target._private.animation; + if (_p.queue) { + q2 = tAni.queue; + } else { + q2 = tAni.current; } - function Rlc(a, b, c2) { - a.g = Wlc(a, b, (qpd(), ppd), a.j); - a.d = Wlc(a, c2, ppd, a.j); - if (a.g.c == 0 || a.d.c == 0) { - return; - } - Tlc(a); + q2.push(this); + if (elementOrCollection(_p.target)) { + _p.target.cy().addToAnimationPool(_p.target); } - function Xyd(a, b) { - switch (b) { - case 7: - return !!a.e && a.e.i != 0; - case 8: - return !!a.d && a.d.i != 0; - } - return wyd(a, b); + _p.hooked = true; + } + return this; + }, "hook"), + play: /* @__PURE__ */ __name(function play() { + var _p = this._private; + if (_p.progress === 1) { + _p.progress = 0; + } + _p.playing = true; + _p.started = false; + _p.stopped = false; + this.hook(); + return this; + }, "play"), + playing: /* @__PURE__ */ __name(function playing() { + return this._private.playing; + }, "playing"), + apply: /* @__PURE__ */ __name(function apply3() { + var _p = this._private; + _p.applying = true; + _p.started = false; + _p.stopped = false; + this.hook(); + return this; + }, "apply"), + applying: /* @__PURE__ */ __name(function applying() { + return this._private.applying; + }, "applying"), + pause: /* @__PURE__ */ __name(function pause() { + var _p = this._private; + _p.playing = false; + _p.started = false; + return this; + }, "pause"), + stop: /* @__PURE__ */ __name(function stop() { + var _p = this._private; + _p.playing = false; + _p.started = false; + _p.stopped = true; + return this; + }, "stop"), + rewind: /* @__PURE__ */ __name(function rewind() { + return this.progress(0); + }, "rewind"), + fastforward: /* @__PURE__ */ __name(function fastforward() { + return this.progress(1); + }, "fastforward"), + time: /* @__PURE__ */ __name(function time3(t4) { + var _p = this._private; + if (t4 === void 0) { + return _p.progress * _p.duration; + } else { + return this.progress(t4 / _p.duration); + } + }, "time"), + progress: /* @__PURE__ */ __name(function progress(p3) { + var _p = this._private; + var wasPlaying = _p.playing; + if (p3 === void 0) { + return _p.progress; + } else { + if (wasPlaying) { + this.pause(); } - function STb(a, b) { - switch (b.g) { - case 0: - ZD(a.b, 641) || (a.b = new tUb()); - break; - case 1: - ZD(a.b, 642) || (a.b = new zUb()); - } + _p.progress = p3; + _p.started = false; + if (wasPlaying) { + this.play(); } - function tbd(a) { - switch (a.g) { - case 0: - return new _dd(); - default: - throw Adb(new agb(eGe + (a.f != null ? a.f : "" + a.g))); - } + } + return this; + }, "progress"), + completed: /* @__PURE__ */ __name(function completed() { + return this._private.progress === 1; + }, "completed"), + reverse: /* @__PURE__ */ __name(function reverse() { + var _p = this._private; + var wasPlaying = _p.playing; + if (wasPlaying) { + this.pause(); + } + _p.progress = 1 - _p.progress; + _p.started = false; + var swap = /* @__PURE__ */ __name(function swap2(a2, b2) { + var _pa = _p[a2]; + if (_pa == null) { + return; } - function bdd(a) { - switch (a.g) { - case 0: - return new vdd(); - default: - throw Adb(new agb(eGe + (a.f != null ? a.f : "" + a.g))); - } + _p[a2] = _p[b2]; + _p[b2] = _pa; + }, "swap"); + swap("zoom", "startZoom"); + swap("pan", "startPan"); + swap("position", "startPosition"); + if (_p.style) { + for (var i2 = 0; i2 < _p.style.length; i2++) { + var prop = _p.style[i2]; + var name = prop.name; + var startStyleProp = _p.startStyle[name]; + _p.startStyle[name] = prop; + _p.style[i2] = startStyleProp; } - function LCc(a, b, c2) { - return !QDb(CDb(new SDb(null, new Swb(a.c, 16)), new PAb(new gsd(b, c2)))).Bd((xDb(), wDb)); + } + if (wasPlaying) { + this.play(); + } + return this; + }, "reverse"), + promise: /* @__PURE__ */ __name(function promise3(type3) { + var _p = this._private; + var arr; + switch (type3) { + case "frame": + arr = _p.frames; + break; + default: + case "complete": + case "completed": + arr = _p.completes; + } + return new Promise$1(function(resolve3, reject3) { + arr.push(function() { + resolve3(); + }); + }); + }, "promise") + }); + anifn.complete = anifn.completed; + anifn.run = anifn.play; + anifn.running = anifn.playing; + define$3 = { + animated: /* @__PURE__ */ __name(function animated() { + return /* @__PURE__ */ __name(function animatedImpl() { + var self2 = this; + var selfIsArrayLike = self2.length !== void 0; + var all = selfIsArrayLike ? self2 : [self2]; + var cy = this._private.cy || this; + if (!cy.styleEnabled()) { + return false; } - function mWc(a, b) { - return cjd(jWc(RD(mQb(b, (h_c(), H$c)), 88)), new rjd(a.c.e.a - a.b.e.a, a.c.e.b - a.b.e.b)) <= 0; + var ele = all[0]; + if (ele) { + return ele._private.animation.current.length > 0; } - function dve(a, b) { - while (a.g == null && !a.c ? sId(a) : a.g == null || a.i != 0 && RD(a.g[a.i - 1], 51).Ob()) { - mFd(b, tId(a)); - } + }, "animatedImpl"); + }, "animated"), + // animated + clearQueue: /* @__PURE__ */ __name(function clearQueue() { + return /* @__PURE__ */ __name(function clearQueueImpl() { + var self2 = this; + var selfIsArrayLike = self2.length !== void 0; + var all = selfIsArrayLike ? self2 : [self2]; + var cy = this._private.cy || this; + if (!cy.styleEnabled()) { + return this; } - function sYb(a) { - var b, c2; - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - b.f.$b(); - } - NYb(a.b, a); - tYb(a); + for (var i2 = 0; i2 < all.length; i2++) { + var ele = all[i2]; + ele._private.animation.queue = []; } - function Ijd(a) { - var b, c2, d; - b = new Ejd(); - for (d = Sub(a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 8); - hu(b, 0, new sjd(c2)); - } - return b; + return this; + }, "clearQueueImpl"); + }, "clearQueue"), + // clearQueue + delay: /* @__PURE__ */ __name(function delay() { + return /* @__PURE__ */ __name(function delayImpl(time4, complete) { + var cy = this._private.cy || this; + if (!cy.styleEnabled()) { + return this; } - function DDb(a) { - var b; - LCb(a); - b = new IEb(); - if (a.a.Bd(b)) { - return Kvb(), new Ovb(uFb(b.a)); - } - return Kvb(), Kvb(), Jvb; + return this.animate({ + delay: time4, + duration: time4, + complete + }); + }, "delayImpl"); + }, "delay"), + // delay + delayAnimation: /* @__PURE__ */ __name(function delayAnimation() { + return /* @__PURE__ */ __name(function delayAnimationImpl(time4, complete) { + var cy = this._private.cy || this; + if (!cy.styleEnabled()) { + return this; } - function Dxd(a, b, c2) { - switch (b) { - case 0: - !a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)); - CVd(a.o, c2); - return; - } - Wvd(a, b, c2); - } - function bXc(a, b, c2) { - this.g = a; - this.e = new pjd(); - this.f = new pjd(); - this.d = new Yub(); - this.b = new Yub(); - this.a = b; - this.c = c2; - } - function V9c(a, b, c2, d) { - this.b = new bnb(); - this.n = new bnb(); - this.i = d; - this.j = c2; - this.s = a; - this.t = b; - this.r = 0; - this.d = 0; - } - function gHd(a, b) { - if (!a.Li() && b == null) { - throw Adb(new agb("The 'no null' constraint is violated")); - } - return b; - } - function ohb(a) { - var b, c2; - b = 0; - for (c2 = 0; c2 < a.length; c2++) { - b = (b << 5) - b + (BFb(c2, a.length), a.charCodeAt(c2)) | 0; - } - return b; - } - function Myb(a, b) { - var c2, d, e; - e = a.b; - while (e) { - c2 = a.a.Ne(b, e.d); - if (c2 == 0) { - return e; - } - d = c2 < 0 ? 0 : 1; - e = e.a[d]; - } - return null; + return this.animation({ + delay: time4, + duration: time4, + complete + }); + }, "delayAnimationImpl"); + }, "delayAnimation"), + // delay + animation: /* @__PURE__ */ __name(function animation() { + return /* @__PURE__ */ __name(function animationImpl(properties, params) { + var self2 = this; + var selfIsArrayLike = self2.length !== void 0; + var all = selfIsArrayLike ? self2 : [self2]; + var cy = this._private.cy || this; + var isCore = !selfIsArrayLike; + var isEles = !isCore; + if (!cy.styleEnabled()) { + return this; } - function LBb(a, b, c2) { - var d, e; - d = (Geb(), SSb(c2) ? true : false); - e = RD(b.xc(d), 15); - if (!e) { - e = new bnb(); - b.zc(d, e); - } - e.Fc(c2); - } - function q6c(a, b) { - var c2, d; - c2 = RD(Gxd(a, (X7c(), A7c)), 17).a; - d = RD(Gxd(b, A7c), 17).a; - return c2 == d ? -1 : c2 < d ? -1 : c2 > d ? 1 : 0; - } - function ICc(a) { - Rmb(a.c, (hed(), fed)); - if (_y(a.a, Kfb(UD(iGd((QCc(), OCc)))))) { - return new asd(); - } - return new csd(a); - } - function fs(a) { - while (!a.d || !a.d.Ob()) { - if (!!a.b && !nmb(a.b)) { - a.d = RD(smb(a.b), 51); - } else { - return null; - } - } - return a.d; + var style3 = cy.style(); + properties = extend2({}, properties, params); + var propertiesEmpty = Object.keys(properties).length === 0; + if (propertiesEmpty) { + return new Animation(all[0], properties); } - function BVc(a) { - switch (a.g) { - case 1: - return EEe; - default: - case 2: - return 0; - case 3: - return Gze; - case 4: - return FEe; - } - } - function fte() { - Vse(); - var a; - if (Cse) - return Cse; - a = Zse(hte("M", true)); - a = $se(hte("M", false), a); - Cse = a; - return Cse; - } - function ttd() { - ttd = geb; - qtd = new utd("ELK", 0); - rtd = new utd("JSON", 1); - ptd = new utd("DOT", 2); - std = new utd("SVG", 3); - } - function TEc() { - TEc = geb; - SEc = new UEc("STACKED", 0); - QEc = new UEc("REVERSE_STACKED", 1); - REc = new UEc("SEQUENCED", 2); - } - function LZc() { - LZc = geb; - KZc = new MZc(LAe, 0); - JZc = new MZc("MIDDLE_TO_MIDDLE", 1); - IZc = new MZc("AVOID_OVERLAP", 2); - } - function sgc() { - sgc = geb; - qgc = new Lgc(); - rgc = new Ngc(); - pgc = new Dgc(); - ogc = new Pgc(); - ngc = new Hgc(); - mgc = (uFb(ngc), new nrb()); - } - function vnd() { - vnd = geb; - tnd = new A3b(15); - snd = new mGd((umd(), tld), tnd); - und = Qld; - ond = Ekd; - pnd = kld; - rnd = nld; - qnd = mld; - } - function wgd(a, b) { - var c2, d, e, f2, g; - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - g = new Ggd(a); - c2.hf(g); - Bgd(g); - } - akb(a.f); - } - function xw(a, b) { - var c2; - if (b === a) { - return true; - } - if (ZD(b, 229)) { - c2 = RD(b, 229); - return pb(a.Zb(), c2.Zb()); - } - return false; + if (properties.duration === void 0) { + properties.duration = 400; } - function Q_b(a, b) { - if (R_b(a, b)) { - Rc(a.b, RD(mQb(b, (Ywc(), ewc)), 21), b); - Mub(a.a, b); - return true; - } else { - return false; - } + switch (properties.duration) { + case "slow": + properties.duration = 600; + break; + case "fast": + properties.duration = 200; + break; } - function u6b(a) { - var b, c2; - b = RD(mQb(a, (Ywc(), Iwc)), 10); - if (b) { - c2 = b.c; - Ymb(c2.a, b); - c2.a.c.length == 0 && Ymb(Y2b(b).b, c2); - } + if (isEles) { + properties.style = style3.getPropsList(properties.style || properties.css); + properties.css = void 0; } - function dfc(a, b) { - if (nQb(a, (Ywc(), zwc)) && nQb(b, zwc)) { - return RD(mQb(b, zwc), 17).a - RD(mQb(a, zwc), 17).a; - } - return 0; + if (isEles && properties.renderedPosition != null) { + var rpos = properties.renderedPosition; + var pan2 = cy.pan(); + var zoom2 = cy.zoom(); + properties.position = renderedToModelPosition(rpos, zoom2, pan2); } - function ifc(a, b) { - if (nQb(a, (Ywc(), zwc)) && nQb(b, zwc)) { - return RD(mQb(a, zwc), 17).a - RD(mQb(b, zwc), 17).a; - } - return 0; + if (isCore && properties.panBy != null) { + var panBy2 = properties.panBy; + var cyPan = cy.pan(); + properties.pan = { + x: cyPan.x + panBy2.x, + y: cyPan.y + panBy2.y + }; } - function kBb(a) { - if (dBb) { - return $C(JL, Xxe, 581, 0, 0, 1); + var center4 = properties.center || properties.centre; + if (isCore && center4 != null) { + var centerPan = cy.getCenterPan(center4.eles, properties.zoom); + if (centerPan != null) { + properties.pan = centerPan; } - return RD(anb(a.a, $C(JL, Xxe, 581, a.a.c.length, 0, 1)), 856); } - function yn(a, b, c2, d) { - fn(); - return new Nx(cD(WC(UK, 1), Zve, 44, 0, [(ck(a, b), new gp(a, b)), (ck(c2, d), new gp(c2, d))])); - } - function bBd(a, b, c2) { - var d, e; - e = (d = new q4d(), d); - yBd(e, b, c2); - WGd((!a.q && (a.q = new C5d(s7, a, 11, 10)), a.q), e); - return e; - } - function xAd(a) { - var b, c2, d, e; - e = meb(pAd, a); - c2 = e.length; - d = $C(qJ, Nve, 2, c2, 6, 1); - for (b = 0; b < c2; ++b) { - d[b] = e[b]; + if (isCore && properties.fit != null) { + var fit2 = properties.fit; + var fitVp = cy.getFitViewport(fit2.eles || fit2.boundingBox, fit2.padding); + if (fitVp != null) { + properties.pan = fitVp.pan; + properties.zoom = fitVp.zoom; } - return d; } - function jwb(a, b) { - var c2; - if (b * 2 + 1 >= a.b.c.length) { - return; - } - jwb(a, 2 * b + 1); - c2 = 2 * b + 2; - c2 < a.b.c.length && jwb(a, c2); - kwb(a, b); - } - function sKc(a, b) { - var c2, d; - for (d = Sub(a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 219); - if (c2.e.length > 0) { - b.Cd(c2); - c2.i && zKc(c2); - } - } - } - function Ejb(a, b, c2) { - var d; - for (d = c2 - 1; d >= 0 && a[d] === b[d]; d--) - ; - return d < 0 ? 0 : Ldb(Cdb(a[d], yxe), Cdb(b[d], yxe)) ? -1 : 1; - } - function it(a, b, c2) { - var d, e; - this.g = a; - this.c = b; - this.a = this; - this.d = this; - e = Wp(c2); - d = $C(UG, ewe, 227, e, 0, 1); - this.b = d; - } - function fQb(a, b, c2, d, e) { - var f2, g; - for (g = c2; g <= e; g++) { - for (f2 = b; f2 <= d; f2++) { - if (PPb(a, f2, g)) { - return true; - } + if (isCore && plainObject(properties.zoom)) { + var vp = cy.getZoomedViewport(properties.zoom); + if (vp != null) { + if (vp.zoomed) { + properties.zoom = vp.zoom; } - } - return false; - } - function Dc2(a, b) { - var c2, d; - for (d = a.Zb().Cc().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 16); - if (c2.Hc(b)) { - return true; + if (vp.panned) { + properties.pan = vp.pan; } + } else { + properties.zoom = null; } - return false; } - function iu(a, b, c2) { - var d, e, f2, g; - uFb(c2); - g = false; - f2 = a.fd(b); - for (e = c2.Kc(); e.Ob(); ) { - d = e.Pb(); - f2.Rb(d); - g = true; - } - return g; - } - function NMd(a, b) { - var c2, d; - d = RD(Ywd(a.a, 4), 129); - c2 = $C(d6, IJe, 424, b, 0, 1); - d != null && hib(d, 0, c2, 0, d.length); - return c2; - } - function hSd(a, b) { - var c2; - c2 = new lSd((a.f & 256) != 0, a.i, a.a, a.d, (a.f & 16) != 0, a.j, a.g, b); - a.e != null || (c2.c = a); - return c2; - } - function Tv(a, b) { - var c2; - if (a === b) { - return true; - } else if (ZD(b, 85)) { - c2 = RD(b, 85); - return Rx(gn(a), c2.vc()); - } - return false; + return new Animation(all[0], properties); + }, "animationImpl"); + }, "animation"), + // animate + animate: /* @__PURE__ */ __name(function animate() { + return /* @__PURE__ */ __name(function animateImpl(properties, params) { + var self2 = this; + var selfIsArrayLike = self2.length !== void 0; + var all = selfIsArrayLike ? self2 : [self2]; + var cy = this._private.cy || this; + if (!cy.styleEnabled()) { + return this; } - function Vjb(a, b, c2) { - var d, e; - for (e = c2.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 44); - if (a.Be(b, d.md())) { - return true; - } - } - return false; + if (params) { + properties = extend2({}, properties, params); } - function lmc(a, b, c2) { - if (!a.d[b.p][c2.p]) { - kmc(a, b, c2); - a.d[b.p][c2.p] = true; - a.d[c2.p][b.p] = true; - } - return a.a[b.p][c2.p]; + for (var i2 = 0; i2 < all.length; i2++) { + var ele = all[i2]; + var queue = ele.animated() && (properties.queue === void 0 || properties.queue); + var ani = ele.animation(properties, queue ? { + queue: true + } : void 0); + ani.play(); } - function vMc(a, b) { - var c2; - if (!a || a == b || !nQb(b, (Ywc(), pwc))) { - return false; - } - c2 = RD(mQb(b, (Ywc(), pwc)), 10); - return c2 != a; + return this; + }, "animateImpl"); + }, "animate"), + // animate + stop: /* @__PURE__ */ __name(function stop2() { + return /* @__PURE__ */ __name(function stopImpl(clearQueue2, jumpToEnd) { + var self2 = this; + var selfIsArrayLike = self2.length !== void 0; + var all = selfIsArrayLike ? self2 : [self2]; + var cy = this._private.cy || this; + if (!cy.styleEnabled()) { + return this; } - function Bhe(a) { - switch (a.i) { - case 2: { - return true; - } - case 1: { - return false; - } - case -1: { - ++a.c; - } - default: { - return a.$l(); + for (var i2 = 0; i2 < all.length; i2++) { + var ele = all[i2]; + var _p = ele._private; + var anis = _p.animation.current; + for (var j2 = 0; j2 < anis.length; j2++) { + var ani = anis[j2]; + var ani_p = ani._private; + if (jumpToEnd) { + ani_p.duration = 0; } } + if (clearQueue2) { + _p.animation.queue = []; + } + if (!jumpToEnd) { + _p.animation.current = []; + } } - function Che(a) { - switch (a.i) { - case -2: { - return true; - } - case -1: { - return false; + cy.notify("draw"); + return this; + }, "stopImpl"); + }, "stop") + // stop + }; + isArray2 = Array.isArray; + isArray_1 = isArray2; + reIsDeepProp2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + reIsPlainProp2 = /^\w*$/; + __name(isKey2, "isKey"); + _isKey = isKey2; + asyncTag2 = "[object AsyncFunction]"; + funcTag4 = "[object Function]"; + genTag3 = "[object GeneratorFunction]"; + proxyTag2 = "[object Proxy]"; + __name(isFunction2, "isFunction"); + isFunction_1 = isFunction2; + coreJsData2 = _root["__core-js_shared__"]; + _coreJsData = coreJsData2; + maskSrcKey2 = function() { + var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + __name(isMasked2, "isMasked"); + _isMasked = isMasked2; + funcProto$1 = Function.prototype; + funcToString$1 = funcProto$1.toString; + __name(toSource2, "toSource"); + _toSource = toSource2; + reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g; + reIsHostCtor2 = /^\[object .+?Constructor\]$/; + funcProto4 = Function.prototype; + objectProto$3 = Object.prototype; + funcToString4 = funcProto4.toString; + hasOwnProperty$3 = objectProto$3.hasOwnProperty; + reIsNative2 = RegExp( + "^" + funcToString4.call(hasOwnProperty$3).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + __name(baseIsNative2, "baseIsNative"); + _baseIsNative = baseIsNative2; + __name(getValue$1, "getValue$1"); + _getValue = getValue$1; + __name(getNative2, "getNative"); + _getNative = getNative2; + nativeCreate2 = _getNative(Object, "create"); + _nativeCreate = nativeCreate2; + __name(hashClear2, "hashClear"); + _hashClear = hashClear2; + __name(hashDelete2, "hashDelete"); + _hashDelete = hashDelete2; + HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; + objectProto$2 = Object.prototype; + hasOwnProperty$2 = objectProto$2.hasOwnProperty; + __name(hashGet2, "hashGet"); + _hashGet = hashGet2; + objectProto$1 = Object.prototype; + hasOwnProperty$1 = objectProto$1.hasOwnProperty; + __name(hashHas2, "hashHas"); + _hashHas = hashHas2; + HASH_UNDEFINED4 = "__lodash_hash_undefined__"; + __name(hashSet2, "hashSet"); + _hashSet = hashSet2; + __name(Hash2, "Hash"); + Hash2.prototype.clear = _hashClear; + Hash2.prototype["delete"] = _hashDelete; + Hash2.prototype.get = _hashGet; + Hash2.prototype.has = _hashHas; + Hash2.prototype.set = _hashSet; + _Hash = Hash2; + __name(listCacheClear2, "listCacheClear"); + _listCacheClear = listCacheClear2; + __name(eq2, "eq"); + eq_1 = eq2; + __name(assocIndexOf2, "assocIndexOf"); + _assocIndexOf = assocIndexOf2; + arrayProto2 = Array.prototype; + splice2 = arrayProto2.splice; + __name(listCacheDelete2, "listCacheDelete"); + _listCacheDelete = listCacheDelete2; + __name(listCacheGet2, "listCacheGet"); + _listCacheGet = listCacheGet2; + __name(listCacheHas2, "listCacheHas"); + _listCacheHas = listCacheHas2; + __name(listCacheSet2, "listCacheSet"); + _listCacheSet = listCacheSet2; + __name(ListCache2, "ListCache"); + ListCache2.prototype.clear = _listCacheClear; + ListCache2.prototype["delete"] = _listCacheDelete; + ListCache2.prototype.get = _listCacheGet; + ListCache2.prototype.has = _listCacheHas; + ListCache2.prototype.set = _listCacheSet; + _ListCache = ListCache2; + Map$1 = _getNative(_root, "Map"); + _Map = Map$1; + __name(mapCacheClear2, "mapCacheClear"); + _mapCacheClear = mapCacheClear2; + __name(isKeyable2, "isKeyable"); + _isKeyable = isKeyable2; + __name(getMapData2, "getMapData"); + _getMapData = getMapData2; + __name(mapCacheDelete2, "mapCacheDelete"); + _mapCacheDelete = mapCacheDelete2; + __name(mapCacheGet2, "mapCacheGet"); + _mapCacheGet = mapCacheGet2; + __name(mapCacheHas2, "mapCacheHas"); + _mapCacheHas = mapCacheHas2; + __name(mapCacheSet2, "mapCacheSet"); + _mapCacheSet = mapCacheSet2; + __name(MapCache2, "MapCache"); + MapCache2.prototype.clear = _mapCacheClear; + MapCache2.prototype["delete"] = _mapCacheDelete; + MapCache2.prototype.get = _mapCacheGet; + MapCache2.prototype.has = _mapCacheHas; + MapCache2.prototype.set = _mapCacheSet; + _MapCache = MapCache2; + FUNC_ERROR_TEXT3 = "Expected a function"; + __name(memoize3, "memoize"); + memoize3.Cache = _MapCache; + memoize_1 = memoize3; + MAX_MEMOIZE_SIZE2 = 500; + __name(memoizeCapped2, "memoizeCapped"); + _memoizeCapped = memoizeCapped2; + rePropName2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + reEscapeChar2 = /\\(\\)?/g; + stringToPath2 = _memoizeCapped(function(string3) { + var result = []; + if (string3.charCodeAt(0) === 46) { + result.push(""); + } + string3.replace(rePropName2, function(match2, number7, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar2, "$1") : number7 || match2); + }); + return result; + }); + _stringToPath = stringToPath2; + __name(arrayMap2, "arrayMap"); + _arrayMap = arrayMap2; + INFINITY$1 = 1 / 0; + symbolProto4 = _Symbol ? _Symbol.prototype : void 0; + symbolToString2 = symbolProto4 ? symbolProto4.toString : void 0; + __name(baseToString2, "baseToString"); + _baseToString = baseToString2; + __name(toString$1, "toString$1"); + toString_1 = toString$1; + __name(castPath2, "castPath"); + _castPath = castPath2; + INFINITY5 = 1 / 0; + __name(toKey2, "toKey"); + _toKey = toKey2; + __name(baseGet2, "baseGet"); + _baseGet = baseGet2; + __name(get5, "get"); + get_1 = get5; + defineProperty2 = function() { + try { + var func = _getNative(Object, "defineProperty"); + func({}, "", {}); + return func; + } catch (e3) { + } + }(); + _defineProperty = defineProperty2; + __name(baseAssignValue2, "baseAssignValue"); + _baseAssignValue = baseAssignValue2; + objectProto22 = Object.prototype; + hasOwnProperty19 = objectProto22.hasOwnProperty; + __name(assignValue2, "assignValue"); + _assignValue = assignValue2; + MAX_SAFE_INTEGER3 = 9007199254740991; + reIsUint2 = /^(?:0|[1-9]\d*)$/; + __name(isIndex2, "isIndex"); + _isIndex = isIndex2; + __name(baseSet2, "baseSet"); + _baseSet = baseSet2; + __name(set4, "set"); + set_1 = set4; + __name(copyArray3, "copyArray"); + _copyArray = copyArray3; + __name(toPath, "toPath"); + toPath_1 = toPath; + define$2 = { + // access data field + data: /* @__PURE__ */ __name(function data(params) { + var defaults4 = { + field: "data", + bindingEvent: "data", + allowBinding: false, + allowSetting: false, + allowGetting: false, + settingEvent: "data", + settingTriggersEvent: false, + triggerFnName: "trigger", + immutableKeys: {}, + // key => true if immutable + updateStyle: false, + beforeGet: /* @__PURE__ */ __name(function beforeGet2(self2) { + }, "beforeGet"), + beforeSet: /* @__PURE__ */ __name(function beforeSet3(self2, obj) { + }, "beforeSet"), + onSet: /* @__PURE__ */ __name(function onSet3(self2) { + }, "onSet"), + canSet: /* @__PURE__ */ __name(function canSet2(self2) { + return true; + }, "canSet") + }; + params = extend2({}, defaults4, params); + return /* @__PURE__ */ __name(function dataImpl(name, value2) { + var p3 = params; + var self2 = this; + var selfIsArrayLike = self2.length !== void 0; + var all = selfIsArrayLike ? self2 : [self2]; + var single = selfIsArrayLike ? self2[0] : self2; + if (string(name)) { + var isPathLike = name.indexOf(".") !== -1; + var path4 = isPathLike && toPath_1(name); + if (p3.allowGetting && value2 === void 0) { + var ret; + if (single) { + p3.beforeGet(single); + if (path4 && single._private[p3.field][name] === void 0) { + ret = get_1(single._private[p3.field], path4); + } else { + ret = single._private[p3.field][name]; + } } - case 1: { - --a.c; + return ret; + } else if (p3.allowSetting && value2 !== void 0) { + var valid2 = !p3.immutableKeys[name]; + if (valid2) { + var change2 = _defineProperty$1({}, name, value2); + p3.beforeSet(self2, change2); + for (var i2 = 0, l2 = all.length; i2 < l2; i2++) { + var ele = all[i2]; + if (p3.canSet(ele)) { + if (path4 && single._private[p3.field][name] === void 0) { + set_1(ele._private[p3.field], path4, value2); + } else { + ele._private[p3.field][name] = value2; + } + } + } + if (p3.updateStyle) { + self2.updateStyle(); + } + p3.onSet(self2); + if (p3.settingTriggersEvent) { + self2[p3.triggerFnName](p3.settingEvent); + } } - default: { - return a._l(); + } + } else if (p3.allowSetting && plainObject(name)) { + var obj = name; + var k2, v3; + var keys3 = Object.keys(obj); + p3.beforeSet(self2, obj); + for (var _i = 0; _i < keys3.length; _i++) { + k2 = keys3[_i]; + v3 = obj[k2]; + var _valid = !p3.immutableKeys[k2]; + if (_valid) { + for (var j2 = 0; j2 < all.length; j2++) { + var _ele = all[j2]; + if (p3.canSet(_ele)) { + _ele._private[p3.field][k2] = v3; + } + } } } - } - function bgb(a) { - oz.call(this, "The given string does not match the expected format for individual spacings.", a); - } - function J6c(a, b) { - var c2; - b.Ug("Min Size Preprocessing", 1); - c2 = vsd(a); - Ixd(a, (X6c(), U6c), c2.a); - Ixd(a, R6c, c2.b); - b.Vg(); - } - function Djd(a) { - var b, c2, d; - b = 0; - d = $C(l3, Nve, 8, a.b, 0, 1); - c2 = Sub(a, 0); - while (c2.b != c2.d.c) { - d[b++] = RD(evb(c2), 8); + if (p3.updateStyle) { + self2.updateStyle(); } - return d; - } - function Ajd(a, b, c2) { - var d, e, f2; - d = new Yub(); - for (f2 = Sub(c2, 0); f2.b != f2.d.c; ) { - e = RD(evb(f2), 8); - Mub(d, new sjd(e)); + p3.onSet(self2); + if (p3.settingTriggersEvent) { + self2[p3.triggerFnName](p3.settingEvent); } - iu(a, b, d); - } - function az(a, b) { - var c2; - c2 = Bdb(a, b); - if (Ldb($db(a, b), 0) | Jdb($db(a, c2), 0)) { - return c2; + } else if (p3.allowBinding && fn$6(name)) { + var fn3 = name; + self2.on(p3.bindingEvent, fn3); + } else if (p3.allowGetting && name === void 0) { + var _ret; + if (single) { + p3.beforeGet(single); + _ret = single._private[p3.field]; } - return Bdb(Sve, $db(Udb(c2, 63), 1)); + return _ret; } - function le(a, b) { - var c2, d; - c2 = RD(a.d.Bc(b), 16); - if (!c2) { - return null; - } - d = a.e.hc(); - d.Gc(c2); - a.e.d -= c2.gc(); - c2.$b(); - return d; - } - function Dyb(a) { - var b; - b = a.a.c.length; - if (b > 0) { - return lyb(b - 1, a.a.c.length), Xmb(a.a, b - 1); - } else { - throw Adb(new Srb()); + return self2; + }, "dataImpl"); + }, "data"), + // data + // remove data field + removeData: /* @__PURE__ */ __name(function removeData(params) { + var defaults4 = { + field: "data", + event: "data", + triggerFnName: "trigger", + triggerEvent: false, + immutableKeys: {} + // key => true if immutable + }; + params = extend2({}, defaults4, params); + return /* @__PURE__ */ __name(function removeDataImpl(names) { + var p3 = params; + var self2 = this; + var selfIsArrayLike = self2.length !== void 0; + var all = selfIsArrayLike ? self2 : [self2]; + if (string(names)) { + var keys3 = names.split(/\s+/); + var l2 = keys3.length; + for (var i2 = 0; i2 < l2; i2++) { + var key = keys3[i2]; + if (emptyString(key)) { + continue; + } + var valid2 = !p3.immutableKeys[key]; + if (valid2) { + for (var i_a = 0, l_a = all.length; i_a < l_a; i_a++) { + all[i_a]._private[p3.field][key] = void 0; + } + } } - } - function nFb(a, b, c2) { - if (a > b) { - throw Adb(new agb(_xe + a + aye + b)); + if (p3.triggerEvent) { + self2[p3.triggerFnName](p3.event); } - if (a < 0 || b > c2) { - throw Adb(new xeb(_xe + a + bye + b + Qxe + c2)); + } else if (names === void 0) { + for (var _i_a = 0, _l_a = all.length; _i_a < _l_a; _i_a++) { + var _privateFields = all[_i_a]._private[p3.field]; + var _keys = Object.keys(_privateFields); + for (var _i2 = 0; _i2 < _keys.length; _i2++) { + var _key = _keys[_i2]; + var validKeyToDelete = !p3.immutableKeys[_key]; + if (validKeyToDelete) { + _privateFields[_key] = void 0; + } + } } - } - function yXd(a, b) { - if (a.D == null && a.B != null) { - a.D = a.B; - a.B = null; + if (p3.triggerEvent) { + self2[p3.triggerFnName](p3.event); } - JXd(a, b == null ? null : (uFb(b), b)); - !!a.C && a.hl(null); - } - function JCc(a, b) { - var c2; - c2 = iGd((QCc(), OCc)) != null && b.Sg() != null ? Kfb(UD(b.Sg())) / Kfb(UD(iGd(OCc))) : 1; - Zjb(a.b, b, c2); } - function $Lc(a, b) { - var c2, d; - d = a.c[b]; - if (d == 0) { - return; - } - a.c[b] = 0; - a.d -= d; - c2 = b + 1; - while (c2 < a.a.length) { - a.a[c2] -= d; - c2 += c2 & -c2; - } - } - function VHd(a) { - var b; - ++a.j; - if (a.i == 0) { - a.g = null; - } else if (a.i < a.g.length) { - b = a.g; - a.g = a.aj(a.i); - hib(b, 0, a.g, 0, a.i); - } - } - function Ned(a, b, c2) { - if (b < 0) { - throw Adb(new veb(zGe + b)); - } - if (b < a.j.c.length) { - $mb(a.j, b, c2); - } else { - Led(a, b); - Rmb(a.j, c2); - } - } - function uhd(a) { - if (!a.a || (a.a.i & 8) == 0) { - throw Adb(new dgb("Enumeration class expected for layout option " + a.f)); - } - } - function y1d(a) { - var b; - b = (!a.a && (a.a = new C5d(l7, a, 9, 5)), a.a); - if (b.i != 0) { - return N1d(RD(QHd(b, 0), 694)); - } - return null; - } - function yr(a) { - var b; - Qb(a); - Mb(true, "numberToAdvance must be nonnegative"); - for (b = 0; b < 0 && gs(a); b++) { - hs(a); - } - return b; - } - function eSb() { - eSb = geb; - bSb = (VRb(), URb); - aSb = new lGd(vze, bSb); - _Rb = new jGd(wze); - cSb = new jGd(xze); - dSb = new jGd(yze); - } - function s_c() { - s_c = geb; - r_c = new t_c(MAe, 0); - p_c = new t_c(QEe, 1); - q_c = new t_c("FAN", 2); - o_c = new t_c("CONSTRAINT", 3); - } - function g4c() { - g4c = geb; - d4c = new i4c(LAe, 0); - e4c = new i4c("RADIAL_COMPACTION", 1); - f4c = new i4c("WEDGE_COMPACTION", 2); - } - function lFc() { - lFc = geb; - iFc = new mFc("CONSERVATIVE", 0); - jFc = new mFc("CONSERVATIVE_SOFT", 1); - kFc = new mFc("SLOPPY", 2); - } - function xBb() { - xBb = geb; - uBb = new yBb("CONCURRENT", 0); - vBb = new yBb("IDENTITY_FINISH", 1); - wBb = new yBb("UNORDERED", 2); - } - function NXb() { - NXb = geb; - LXb = Wx(cD(WC(s3, 1), jwe, 88, 0, [(Cmd(), ymd), zmd])); - MXb = Wx(cD(WC(s3, 1), jwe, 88, 0, [Bmd, xmd])); - } - function rb(a) { - return bE(a) ? qJ : _D(a) ? VI : $D(a) ? QI : YD(a) ? a.Rm : aD(a) ? a.Rm : a.Rm || Array.isArray(a) && WC(hI, 1) || hI; - } - function Qje(a) { - return !a ? null : (a.i & 1) != 0 ? a == xdb ? QI : a == kE ? bJ : a == jE ? ZI : a == iE ? VI : a == lE ? eJ : a == wdb ? lJ : a == gE ? RI : SI : a; - } - function CIb(a) { - if (a.c != a.b.b || a.i != a.g.b) { - aFb(a.a.c, 0); - Tmb(a.a, a.b); - Tmb(a.a, a.g); - a.c = a.b.b; - a.i = a.g.b; - } - return a.a; - } - function vmb(a, b) { - var c2, d; - c2 = a.a.length - 1; - while (b != a.b) { - d = b - 1 & c2; - bD(a.a, b, a.a[d]); - b = d; - } - bD(a.a, a.b, null); - a.b = a.b + 1 & c2; - } - function umb(a, b) { - var c2, d; - c2 = a.a.length - 1; - a.c = a.c - 1 & c2; - while (b != a.c) { - d = b + 1 & c2; - bD(a.a, b, a.a[d]); - b = d; - } - bD(a.a, a.c, null); - } - function Smb(a, b, c2) { - var d, e; - wFb(b, a.c.length); - d = c2.Pc(); - e = d.length; - if (e == 0) { - return false; - } - YEb(a.c, b, d); - return true; - } - function otb(a, b, c2) { - var d, e, f2, g; - for (e = c2, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - if (a.b.Be(b, d.ld())) { - return d; - } - } - return null; - } - function Tnb(a) { - var b, c2, d, e, f2; - f2 = 1; - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - f2 = 31 * f2 + (b != null ? tb(b) : 0); - f2 = f2 | 0; - } - return f2; - } - function ss(a) { - var b, c2, d, e, f2; - b = {}; - for (d = a, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - b[":" + (c2.f != null ? c2.f : "" + c2.g)] = c2; - } - return b; - } - function tSd(a) { - var b, c2; - if (a == null) - return null; - for (b = 0, c2 = a.length; b < c2; b++) { - if (!GSd(a[b])) - return a[b]; - } - return null; - } - function gKb(a, b) { - if (!a) { - return 0; - } - if (b && !a.j) { - return 0; - } - if (ZD(a, 127)) { - if (RD(a, 127).a.b == 0) { - return 0; - } - } - return a.jf(); - } - function hKb(a, b) { - if (!a) { - return 0; - } - if (b && !a.k) { - return 0; - } - if (ZD(a, 127)) { - if (RD(a, 127).a.a == 0) { - return 0; - } - } - return a.kf(); - } - function orc(a, b) { - if (nQb(a, (Ywc(), zwc)) && nQb(b, zwc)) { - return hgb(RD(mQb(a, zwc), 17).a, RD(mQb(b, zwc), 17).a); - } - return 0; - } - function EHc(a) { - var b, c2, d; - d = 0; - for (c2 = new is(Mr(a.a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - b.c.i == b.d.i || ++d; - } - return d; - } - function Gad(a, b) { - var c2, d, e; - e = b - a.f; - for (d = new Anb(a.d); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 315); - fad(c2, c2.e, c2.f + e); - } - a.f = b; - } - function YVd(a, b) { - var c2, d, e; - d = a.Yk(b, null); - e = null; - if (b) { - e = (jTd(), c2 = new s2d(), c2); - l2d(e, a.r); - } - d = XVd(a, e, d); - !!d && d.oj(); - } - function P0b(a, b) { - var c2, d, e; - c2 = a; - e = 0; - do { - if (c2 == b) { - return e; - } - d = c2.e; - if (!d) { - throw Adb(new _fb()); - } - c2 = Y2b(d); - ++e; - } while (true); - } - function uRb(a) { - var b, c2, d, e; - d = a.b.a; - for (c2 = d.a.ec().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 567); - e = new DSb(b, a.e, a.f); - Rmb(a.g, e); - } - } - function DZb(a) { - var b; - b = new XZb(a); - t$b(a.a, BZb, new mob(cD(WC(wQ, 1), rve, 382, 0, [b]))); - !!b.d && Rmb(b.f, b.d); - return b.f; - } - function M2b(a, b) { - var c2; - for (c2 = 0; c2 < b.length; c2++) { - if (a == (BFb(c2, b.length), b.charCodeAt(c2))) { - return true; - } - } - return false; - } - function BSd(a, b) { - return b < a.length && (BFb(b, a.length), a.charCodeAt(b) != 63) && (BFb(b, a.length), a.charCodeAt(b) != 35); - } - function trc(a, b, c2, d) { - nrc(this); - this.c = $C(jR, WAe, 10, a.a.c.length, 0, 1); - this.e = b; - anb(a.a, this.c); - this.f = c2; - this.b = d; - } - function Cz(a) { - Az(); - ez(this); - gz(this); - this.e = a; - hz(this, a); - this.g = a == null ? vve : jeb(a); - this.a = ""; - this.b = a; - this.a = ""; - } - function Pad() { - this.a = new Qad(); - this.f = new Sad(this); - this.b = new Uad(this); - this.i = new Wad(this); - this.e = new Yad(this); - } - function Ks() { - Js.call(this, new hub(Sv(16))); - dk(2, Mve); - this.b = 2; - this.a = new ct(null, null, 0, null); - Ss(this.a, this.a); - } - function NC(a) { - HC(); - throw Adb(new aC("Unexpected typeof result '" + a + "'; please report this bug to the GWT team")); - } - function AVc(a, b, c2) { - if ($wnd.Math.abs(b - a) < DEe || $wnd.Math.abs(c2 - a) < DEe) { - return true; - } - return b - a > DEe ? a - c2 > DEe : c2 - a > DEe; - } - function vjd(a, b) { - var c2; - for (c2 = 0; c2 < b.length; c2++) { - if (a == (BFb(c2, b.length), b.charCodeAt(c2))) { - return true; - } - } - return false; - } - function HSd(a) { - var b, c2; - if (a == null) - return false; - for (b = 0, c2 = a.length; b < c2; b++) { - if (!GSd(a[b])) - return false; - } - return true; - } - function M8c(a, b) { - var c2, d, e; - d = false; - c2 = b.q.d; - if (b.d < a.b) { - e = dad(b.q, a.b); - if (b.q.d > e) { - ead(b.q, e); - d = c2 != b.q.d; - } - } - return d; - } - function C3c(a, b) { - var c2, d, e, f2, g, h, i2, j; - i2 = b.i; - j = b.j; - d = a.f; - e = d.i; - f2 = d.j; - g = i2 - e; - h = j - f2; - c2 = $wnd.Math.sqrt(g * g + h * h); - return c2; - } - function pBd(a, b) { - var c2, d; - d = Hvd(a); - if (!d) { - c2 = (gSd(), nSd(b)); - d = new Sde(c2); - WGd(d.El(), a); - } - return d; - } - function Sc2(a, b) { - var c2, d; - c2 = RD(a.c.Bc(b), 16); - if (!c2) { - return a.jc(); - } - d = a.hc(); - d.Gc(c2); - a.d -= c2.gc(); - c2.$b(); - return a.mc(d); - } - function tKc(a, b) { - var c2, d; - d = Kwb(a.d, 1) != 0; - c2 = true; - while (c2) { - c2 = false; - c2 = b.c.mg(b.e, d); - c2 = c2 | DKc(a, b, d, false); - d = !d; - } - yKc(a); - } - function omc(a, b, c2, d) { - var e, f2; - a.a = b; - f2 = d ? 0 : 1; - a.f = (e = new mmc(a.c, a.a, c2, f2), new Pmc(c2, a.a, e, a.e, a.b, a.c == (RKc(), PKc))); - } - function Imb(a) { - var b; - sFb(a.a != a.b); - b = a.d.a[a.a]; - zmb(a.b == a.d.c && b != null); - a.c = a.a; - a.a = a.a + 1 & a.d.a.length - 1; - return b; - } - function Vib(a) { - var b; - if (a.c != 0) { - return a.c; - } - for (b = 0; b < a.a.length; b++) { - a.c = a.c * 33 + (a.a[b] & -1); - } - a.c = a.c * a.e; - return a.c; - } - function Oue(a) { - var b; - if (!(a.c.c < 0 ? a.a >= a.c.b : a.a <= a.c.b)) { - throw Adb(new Dvb()); - } - b = a.a; - a.a += a.c.c; - ++a.b; - return sgb(b); - } - function h5b(a) { - var b; - b = new y2b(a.a); - kQb(b, a); - pQb(b, (Ywc(), Awc), a); - b.o.a = a.g; - b.o.b = a.f; - b.n.a = a.i; - b.n.b = a.j; - return b; - } - function tVc(a) { - return (qpd(), hpd).Hc(a.j) ? Kfb(UD(mQb(a, (Ywc(), Swc)))) : xjd(cD(WC(l3, 1), Nve, 8, 0, [a.i.n, a.n, a.a])).b; - } - function ZJc(a) { - var b; - b = vfd(XJc); - RD(mQb(a, (Ywc(), kwc)), 21).Hc((ovc(), kvc)) && pfd(b, (sXb(), pXb), (hcc(), Ybc)); - return b; - } - function M2c(a) { - var b, c2, d, e; - e = new _sb(); - for (d = new Anb(a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 27); - b = P2c(c2); - ye(e, b); - } - return e; - } - function hIc(a) { - var b, c2; - for (c2 = new Anb(a.r); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - if (a.n[b.p] <= 0) { - return b; - } - } - return null; - } - function LGb(a, b, c2) { - var d, e; - for (e = b.a.a.ec().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 60); - if (MGb(a, d, c2)) { - return true; - } - } - return false; - } - function Rcc(a, b, c2, d) { - var e, f2; - for (f2 = a.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 72); - e.n.a = b.a + (d.a - e.o.a) / 2; - e.n.b = b.b; - b.b += e.o.b + c2; - } - } - function hNb(a, b, c2) { - var d; - d = new rMb(a, b); - Rc(a.r, b.ag(), d); - if (c2 && !Rod(a.u)) { - d.c = new TKb(a.d); - Umb(b.Rf(), new kNb(d)); - } - } - function Ddb(a, b) { - var c2; - if (Kdb(a) && Kdb(b)) { - c2 = a - b; - if (!isNaN(c2)) { - return c2; - } - } - return uD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b); - } - function Iid(a, b) { - var c2, d, e; - e = 1; - c2 = a; - d = b >= 0 ? b : -b; - while (d > 0) { - if (d % 2 == 0) { - c2 *= c2; - d = d / 2 | 0; - } else { - e *= c2; - d -= 1; - } - } - return b < 0 ? 1 / e : e; - } - function Jid(a, b) { - var c2, d, e; - e = 1; - c2 = a; - d = b >= 0 ? b : -b; - while (d > 0) { - if (d % 2 == 0) { - c2 *= c2; - d = d / 2 | 0; - } else { - e *= c2; - d -= 1; - } - } - return b < 0 ? 1 / e : e; - } - function Vvd(a, b) { - var c2, d, e, f2; - f2 = (e = a ? Hvd(a) : null, Pje((d = b, e ? e.Gl() : null, d))); - if (f2 == b) { - c2 = Hvd(a); - !!c2 && c2.Gl(); - } - return f2; - } - function g2d(a, b, c2) { - var d, e; - e = a.f; - a.f = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 0, e, b); - !c2 ? c2 = d : c2.nj(d); - } - return c2; - } - function e2d(a, b, c2) { - var d, e; - e = a.b; - a.b = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 3, e, b); - !c2 ? c2 = d : c2.nj(d); - } - return c2; - } - function rAd(a, b, c2) { - var d, e; - e = a.a; - a.a = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 1, e, b); - !c2 ? c2 = d : c2.nj(d); - } - return c2; - } - function SNd(a) { - var b, c2; - if (a != null) { - for (c2 = 0; c2 < a.length; ++c2) { - b = a[c2]; - if (b) { - RD(b.g, 379); - b.i; - } - } - } - } - function Vnb(a, b, c2, d, e, f2, g, h) { - var i2; - i2 = c2; - while (f2 < g) { - i2 >= d || b < c2 && h.Ne(a[b], a[i2]) <= 0 ? bD(e, f2++, a[b++]) : bD(e, f2++, a[i2++]); - } - } - function Njb(a, b, c2, d, e) { - if (b == 0 || d == 0) { - return; - } - b == 1 ? e[d] = Pjb(e, c2, d, a[0]) : d == 1 ? e[b] = Pjb(e, a, b, c2[0]) : Ojb(a, c2, e, b, d); - } - function w9c(a, b, c2) { - var d, e, f2, g; - d = c2 / a.gc(); - e = 0; - for (g = a.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 186); - Gad(f2, f2.f + d * e); - Dad(f2, b, d); - ++e; - } - } - function cad(a) { - var b, c2, d; - d = 0; - for (c2 = new Anb(a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 172); - d = $wnd.Math.max(d, b.g); - } - return d; - } - function EKc(a) { - var b, c2, d; - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 219); - b = c2.c.kg() ? c2.f : c2.a; - !!b && MLc(b, c2.j); - } - } - function lDc() { - lDc = geb; - iDc = new nDc("DUMMY_NODE_OVER", 0); - jDc = new nDc("DUMMY_NODE_UNDER", 1); - kDc = new nDc("EQUAL", 2); - } - function mqd() { - mqd = geb; - kqd = new nqd("PARALLEL_NODE", 0); - jqd = new nqd("HIERARCHICAL_NODE", 1); - lqd = new nqd("ROOT_NODE", 2); - } - function Fnd() { - Fnd = geb; - Dnd = new Gnd("INHERIT", 0); - Cnd = new Gnd("INCLUDE_CHILDREN", 1); - End = new Gnd("SEPARATE_CHILDREN", 2); - } - function hyd(a, b) { - switch (b) { - case 1: - !a.n && (a.n = new C5d(I4, a, 1, 7)); - sLd(a.n); - return; - case 2: - jyd(a, null); - return; - } - Exd(a, b); - } - function c9c(a) { - switch (a.g) { - case 0: - return new R8c(); - case 1: - return new o9c(); - case 2: - return new X8c(); - default: - return null; - } - } - function eq2(a) { - _l(); - switch (a.c) { - case 0: - return Px(), Ox; - case 1: - return new Fy(Ir(new Osb(a))); - default: - return new dq(a); - } - } - function go(a) { - _l(); - switch (a.gc()) { - case 0: - return Px(), Ox; - case 1: - return new Fy(a.Kc().Pb()); - default: - return new Qx(a); - } - } - function Pm(a) { - var b; - switch (a.gc()) { - case 0: - return sm; - case 1: - return new Dy(Qb(a.Xb(0))); - default: - b = a; - return new Kx(b); - } - } - function sgb(a) { - var b, c2; - if (a > -129 && a < 128) { - return ugb(), b = a + 128, c2 = tgb[b], !c2 && (c2 = tgb[b] = new fgb(a)), c2; - } - return new fgb(a); - } - function bhb(a) { - var b, c2; - if (a > -129 && a < 128) { - return dhb(), b = a + 128, c2 = chb[b], !c2 && (c2 = chb[b] = new Xgb(a)), c2; - } - return new Xgb(a); - } - function M$b(a, b) { - var c2; - if (a.a.c.length > 0) { - c2 = RD(Vmb(a.a, a.a.c.length - 1), 579); - if (Q_b(c2, b)) { - return; - } - } - Rmb(a.a, new S_b(b)); - } - function Ekc(a) { - lkc(); - var b, c2; - b = a.d.c - a.e.c; - c2 = RD(a.g, 154); - Umb(c2.b, new Ykc(b)); - Umb(c2.c, new $kc(b)); - xgb(c2.i, new alc(b)); - } - function Mlc(a) { - var b; - b = new bib(); - b.a += "VerticalSegment "; - Yhb(b, a.e); - b.a += " "; - Zhb(b, Eb(new Gb(), new Anb(a.k))); - return b.a; - } - function Fmc(a, b) { - var c2, d, e; - c2 = 0; - for (e = b3b(a, b).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 12); - c2 += mQb(d, (Ywc(), Iwc)) != null ? 1 : 0; - } - return c2; - } - function VTc(a, b, c2) { - var d, e, f2; - d = 0; - for (f2 = Sub(a, 0); f2.b != f2.d.c; ) { - e = Kfb(UD(evb(f2))); - if (e > c2) { - break; - } else - e >= b && ++d; - } - return d; - } - function Wv(b, c2) { - Qb(b); - try { - return b._b(c2); - } catch (a) { - a = zdb(a); - if (ZD(a, 212) || ZD(a, 169)) { - return false; - } else - throw Adb(a); - } - } - function Nk(b, c2) { - Qb(b); - try { - return b.Hc(c2); - } catch (a) { - a = zdb(a); - if (ZD(a, 212) || ZD(a, 169)) { - return false; - } else - throw Adb(a); - } - } - function Ok(b, c2) { - Qb(b); - try { - return b.Mc(c2); - } catch (a) { - a = zdb(a); - if (ZD(a, 212) || ZD(a, 169)) { - return false; - } else - throw Adb(a); - } - } - function Xv(b, c2) { - Qb(b); - try { - return b.xc(c2); - } catch (a) { - a = zdb(a); - if (ZD(a, 212) || ZD(a, 169)) { - return null; - } else - throw Adb(a); - } - } - function Yv(b, c2) { - Qb(b); - try { - return b.Bc(c2); - } catch (a) { - a = zdb(a); - if (ZD(a, 212) || ZD(a, 169)) { - return null; - } else - throw Adb(a); - } - } - function aMc(a, b) { - switch (b.g) { - case 2: - case 1: - return b3b(a, b); - case 3: - case 4: - return hv(b3b(a, b)); - } - return yob(), yob(), vob; - } - function QAd(a) { - var b; - if ((a.Db & 64) != 0) - return awd(a); - b = new Shb(awd(a)); - b.a += " (name: "; - Nhb(b, a.zb); - b.a += ")"; - return b.a; - } - function Fgd(a) { - var b; - b = RD(cub(a.c.c, ""), 233); - if (!b) { - b = new fgd(ogd(ngd(new pgd(), ""), "Other")); - dub(a.c.c, "", b); - } - return b; - } - function hBd(a, b, c2) { - var d, e; - e = a.sb; - a.sb = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 4, e, b); - !c2 ? c2 = d : c2.nj(d); - } - return c2; - } - function ZVd(a, b, c2) { - var d, e; - e = a.r; - a.r = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 8, e, a.r); - !c2 ? c2 = d : c2.nj(d); - } - return c2; - } - function q5d(a, b, c2) { - var d, e; - d = new P3d(a.e, 4, 13, (e = b.c, e ? e : (JTd(), wTd)), null, fZd(a, b), false); - !c2 ? c2 = d : c2.nj(d); - return c2; - } - function p5d(a, b, c2) { - var d, e; - d = new P3d(a.e, 3, 13, null, (e = b.c, e ? e : (JTd(), wTd)), fZd(a, b), false); - !c2 ? c2 = d : c2.nj(d); - return c2; - } - function Oee(a, b) { - var c2, d; - c2 = RD(b, 691); - d = c2.el(); - !d && c2.fl(d = ZD(b, 90) ? new afe(a, RD(b, 29)) : new mfe(a, RD(b, 156))); - return d; - } - function KHd(a, b, c2) { - var d; - a._i(a.i + 1); - d = a.Zi(b, c2); - b != a.i && hib(a.g, b, a.g, b + 1, a.i - b); - bD(a.g, b, d); - ++a.i; - a.Mi(b, c2); - a.Ni(); - } - function Hyb(a, b) { - var c2; - if (b.a) { - c2 = b.a.a.length; - !a.a ? a.a = new dib(a.d) : Zhb(a.a, a.b); - Xhb(a.a, b.a, b.d.length, c2); - } - return a; - } - function wib(a, b) { - var c2; - a.c = b; - a.a = pjb(b); - a.a < 54 && (a.f = (c2 = b.d > 1 ? DFb(b.a[0], b.a[1]) : DFb(b.a[0], 0), Xdb(b.e > 0 ? c2 : Odb(c2)))); - } - function MDb(a, b) { - var c2; - c2 = new IEb(); - if (!a.a.Bd(c2)) { - LCb(a); - return Kvb(), Kvb(), Jvb; - } - return Kvb(), new Ovb(uFb(LDb(a, c2.a, b))); - } - function t9b(a, b) { - var c2; - if (a.c.length == 0) { - return; - } - c2 = RD(anb(a, $C(jR, WAe, 10, a.c.length, 0, 1)), 199); - Znb(c2, new F9b()); - q9b(c2, b); - } - function z9b(a, b) { - var c2; - if (a.c.length == 0) { - return; - } - c2 = RD(anb(a, $C(jR, WAe, 10, a.c.length, 0, 1)), 199); - Znb(c2, new K9b()); - q9b(c2, b); - } - function pb(a, b) { - return bE(a) ? lhb(a, b) : _D(a) ? Lfb(a, b) : $D(a) ? (uFb(a), dE(a) === dE(b)) : YD(a) ? a.Fb(b) : aD(a) ? mb(a, b) : Hz(a, b); - } - function Cvd(a, b, c2) { - if (b < 0) { - Tvd(a, c2); - } else { - if (!c2.rk()) { - throw Adb(new agb(KHe + c2.xe() + LHe)); - } - RD(c2, 69).wk().Ek(a, a.hi(), b); - } - } - function xFb(a, b, c2) { - if (a < 0 || b > c2) { - throw Adb(new veb(_xe + a + bye + b + ", size: " + c2)); - } - if (a > b) { - throw Adb(new agb(_xe + a + aye + b)); - } - } - function oVd(a) { - var b; - if ((a.Db & 64) != 0) - return awd(a); - b = new Shb(awd(a)); - b.a += " (source: "; - Nhb(b, a.d); - b.a += ")"; - return b.a; - } - function JSd(a) { - if (a >= 65 && a <= 70) { - return a - 65 + 10; - } - if (a >= 97 && a <= 102) { - return a - 97 + 10; - } - if (a >= 48 && a <= 57) { - return a - 48; - } - return 0; - } - function lMb(a) { - hMb(); - var b, c2, d, e; - for (c2 = nMb(), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - if (Wmb(b.a, a, 0) != -1) { - return b; - } - } - return gMb; - } - function zde(a, b) { - var c2, d, e, f2; - b.ej(a.a); - f2 = RD(Ywd(a.a, 8), 2035); - if (f2 != null) { - for (c2 = f2, d = 0, e = c2.length; d < e; ++d) { - null.Um(); - } - } - } - function _Vd(a, b) { - var c2; - c2 = (a.Bb & 256) != 0; - b ? a.Bb |= 256 : a.Bb &= -257; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 2, c2, b)); - } - function EYd(a, b) { - var c2; - c2 = (a.Bb & 256) != 0; - b ? a.Bb |= 256 : a.Bb &= -257; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 8, c2, b)); - } - function j1d(a, b) { - var c2; - c2 = (a.Bb & 256) != 0; - b ? a.Bb |= 256 : a.Bb &= -257; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 8, c2, b)); - } - function aWd(a, b) { - var c2; - c2 = (a.Bb & 512) != 0; - b ? a.Bb |= 512 : a.Bb &= -513; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 3, c2, b)); - } - function FYd(a, b) { - var c2; - c2 = (a.Bb & 512) != 0; - b ? a.Bb |= 512 : a.Bb &= -513; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 9, c2, b)); - } - function m2d(a, b, c2) { - var d, e; - e = a.a; - a.a = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 5, e, a.a); - !c2 ? c2 = d : oKd(c2, d); - } - return c2; - } - function kle(a, b) { - var c2; - if (a.b == -1 && !!a.a) { - c2 = a.a.pk(); - a.b = !c2 ? BYd(a.c.Dh(), a.a) : a.c.Hh(a.a.Lj(), c2); - } - return a.c.yh(a.b, b); - } - function t0d(a, b) { - var c2, d; - for (d = new dMd(a); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 29); - if (dE(b) === dE(c2)) { - return true; - } - } - return false; - } - function a9b(a) { - var b, c2; - b = a.k; - if (b == (r3b(), m3b)) { - c2 = RD(mQb(a, (Ywc(), hwc)), 64); - return c2 == (qpd(), Yod) || c2 == npd; - } - return false; - } - function QCb(a) { - var b; - b = RCb(a); - if (Gdb(b.a, 0)) { - return Tvb(), Tvb(), Svb; - } - return Tvb(), new Yvb(Idb(b.a, 0) ? Orb(b) / Xdb(b.a) : 0); - } - function Aib(a, b) { - this.e = b; - this.a = Dib(a); - this.a < 54 ? this.f = Xdb(a) : this.c = (Pib(), Ddb(a, 0) >= 0 ? jjb(a) : Xib(jjb(Odb(a)))); - } - function G0b(a, b, c2, d, e, f2) { - this.e = new bnb(); - this.f = (BEc(), AEc); - Rmb(this.e, a); - this.d = b; - this.a = c2; - this.b = d; - this.f = e; - this.c = f2; - } - function bQb(a, b, c2) { - a.n = YC(lE, [Nve, rxe], [376, 28], 14, [c2, eE($wnd.Math.ceil(b / 32))], 2); - a.o = b; - a.p = c2; - a.j = b - 1 >> 1; - a.k = c2 - 1 >> 1; - } - function ggb(a) { - a -= a >> 1 & 1431655765; - a = (a >> 2 & 858993459) + (a & 858993459); - a = (a >> 4) + a & 252645135; - a += a >> 8; - a += a >> 16; - return a & 63; - } - function C4d(a, b) { - var c2, d; - for (d = new dMd(a); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 142); - if (dE(b) === dE(c2)) { - return true; - } - } - return false; - } - function Iee(a, b, c2) { - var d, e, f2; - f2 = (e = N5d(a.b, b), e); - if (f2) { - d = RD(tfe(Pee(a, f2), ""), 29); - if (d) { - return Ree(a, d, b, c2); - } - } - return null; - } - function Lee(a, b, c2) { - var d, e, f2; - f2 = (e = N5d(a.b, b), e); - if (f2) { - d = RD(tfe(Pee(a, f2), ""), 29); - if (d) { - return See(a, d, b, c2); - } - } - return null; - } - function IDd(a, b) { - var c2; - c2 = Ao(a.i, b); - if (c2 == null) { - throw Adb(new CDd("Node did not exist in input.")); - } - wEd(b, c2); - return null; - } - function wvd(a, b) { - var c2; - c2 = wYd(a, b); - if (ZD(c2, 331)) { - return RD(c2, 35); - } - throw Adb(new agb(KHe + b + "' is not a valid attribute")); - } - function VGd(a, b, c2) { - var d; - d = a.gc(); - if (b > d) - throw Adb(new aMd(b, d)); - if (a.Si() && a.Hc(c2)) { - throw Adb(new agb(LIe)); - } - a.Gi(b, c2); - } - function w7b(a, b) { - b.Ug("Sort end labels", 1); - FDb(CDb(EDb(new SDb(null, new Swb(a.b, 16)), new H7b()), new J7b()), new L7b()); - b.Vg(); - } - function Cmd() { - Cmd = geb; - Amd = new Gmd(Sye, 0); - zmd = new Gmd(Oye, 1); - ymd = new Gmd(Nye, 2); - xmd = new Gmd(Zye, 3); - Bmd = new Gmd("UP", 4); - } - function gbd() { - gbd = geb; - dbd = new hbd("P1_STRUCTURE", 0); - ebd = new hbd("P2_PROCESSING_ORDER", 1); - fbd = new hbd("P3_EXECUTION", 2); - } - function r0c() { - r0c = geb; - q0c = mfd(mfd(rfd(mfd(mfd(rfd(pfd(new ufd(), (YVc(), VVc), (WYc(), VYc)), WVc), RYc), TYc), XVc), NYc), UYc); - } - function s8b(a) { - switch (RD(mQb(a, (Ywc(), owc)), 311).g) { - case 1: - pQb(a, owc, (Gvc(), Dvc)); - break; - case 2: - pQb(a, owc, (Gvc(), Fvc)); - } - } - function bUc(a) { - switch (a) { - case 0: - return new mUc(); - case 1: - return new cUc(); - case 2: - return new hUc(); - default: - throw Adb(new _fb()); - } - } - function Fmd(a) { - switch (a.g) { - case 2: - return zmd; - case 1: - return ymd; - case 4: - return xmd; - case 3: - return Bmd; - default: - return Amd; - } - } - function UNb(a, b) { - switch (a.b.g) { - case 0: - case 1: - return b; - case 2: - case 3: - return new Uid2(b.d, 0, b.a, b.b); - default: - return null; - } - } - function rpd(a) { - switch (a.g) { - case 1: - return ppd; - case 2: - return Yod; - case 3: - return Xod; - case 4: - return npd; - default: - return opd; - } - } - function spd(a) { - switch (a.g) { - case 1: - return npd; - case 2: - return ppd; - case 3: - return Yod; - case 4: - return Xod; - default: - return opd; - } - } - function tpd(a) { - switch (a.g) { - case 1: - return Xod; - case 2: - return npd; - case 3: - return ppd; - case 4: - return Yod; - default: - return opd; - } - } - function cyd(a, b, c2, d) { - switch (b) { - case 1: - return !a.n && (a.n = new C5d(I4, a, 1, 7)), a.n; - case 2: - return a.k; - } - return Axd(a, b, c2, d); - } - function uLd(a, b, c2) { - var d, e; - if (a.Pj()) { - e = a.Qj(); - d = SHd(a, b, c2); - a.Jj(a.Ij(7, sgb(c2), d, b, e)); - return d; - } else { - return SHd(a, b, c2); - } - } - function VNd(a, b) { - var c2, d, e; - if (a.d == null) { - ++a.e; - --a.f; - } else { - e = b.ld(); - c2 = b.Bi(); - d = (c2 & lve) % a.d.length; - iOd(a, d, XNd(a, d, c2, e)); - } - } - function xWd(a, b) { - var c2; - c2 = (a.Bb & gwe) != 0; - b ? a.Bb |= gwe : a.Bb &= -1025; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 10, c2, b)); - } - function DWd(a, b) { - var c2; - c2 = (a.Bb & qxe) != 0; - b ? a.Bb |= qxe : a.Bb &= -4097; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 12, c2, b)); - } - function EWd(a, b) { - var c2; - c2 = (a.Bb & bKe) != 0; - b ? a.Bb |= bKe : a.Bb &= -8193; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 15, c2, b)); - } - function FWd(a, b) { - var c2; - c2 = (a.Bb & cKe) != 0; - b ? a.Bb |= cKe : a.Bb &= -2049; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 11, c2, b)); - } - function zKc(a) { - var b; - if (a.g) { - b = a.c.kg() ? a.f : a.a; - BKc(b.a, a.o, true); - BKc(b.a, a.o, false); - pQb(a.o, (yCc(), BBc), (Bod(), vod)); - } - } - function Orc(a) { - var b; - if (!a.a) { - throw Adb(new dgb("Cannot offset an unassigned cut.")); - } - b = a.c - a.b; - a.b += b; - Qrc(a, b); - Rrc(a, b); - } - function JDd(a, b) { - var c2; - c2 = Wjb(a.k, b); - if (c2 == null) { - throw Adb(new CDd("Port did not exist in input.")); - } - wEd(b, c2); - return null; - } - function Jje(a) { - var b, c2; - for (c2 = Kje(BXd(a)).Kc(); c2.Ob(); ) { - b = WD(c2.Pb()); - if (bAd(a, b)) { - return USd((TSd(), SSd), b); - } - } - return null; - } - function qJb(a) { - var b, c2; - for (c2 = a.p.a.ec().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 218); - if (b.f && a.b[b.c] < -1e-10) { - return b; - } - } - return null; - } - function Lr(a) { - var b, c2; - c2 = Thb(new bib(), 91); - b = true; - while (a.Ob()) { - b || (c2.a += pve, c2); - b = false; - Yhb(c2, a.Pb()); - } - return (c2.a += "]", c2).a; - } - function o_b(a) { - var b, c2, d; - b = new bnb(); - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 602); - Tmb(b, RD(c2.Cf(), 16)); - } - return b; - } - function TXb(a, b) { - var c2, d; - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 42); - Ymb(a.b.b, c2.b); - hYb(RD(c2.a, 194), RD(c2.b, 86)); - } - } - function aRb(a, b) { - var c2; - c2 = Qfb(a.b.c, b.b.c); - if (c2 != 0) { - return c2; - } - c2 = Qfb(a.a.a, b.a.a); - if (c2 != 0) { - return c2; - } - return Qfb(a.a.b, b.a.b); - } - function Qfb(a, b) { - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - if (a == b) { - return a == 0 ? Qfb(1 / a, 1 / b) : 0; - } - return isNaN(a) ? isNaN(b) ? 0 : 1 : -1; - } - function pmb(a) { - var b; - b = a.a[a.c - 1 & a.a.length - 1]; - if (b == null) { - return null; - } - a.c = a.c - 1 & a.a.length - 1; - bD(a.a, a.c, null); - return b; - } - function Dqe(a) { - var b, c2, d; - d = 0; - c2 = a.length; - for (b = 0; b < c2; b++) { - a[b] == 32 || a[b] == 13 || a[b] == 10 || a[b] == 9 || (a[d++] = a[b]); - } - return d; - } - function Nge(a, b) { - var c2, d, e, f2, g; - g = pke(a.e.Dh(), b); - f2 = 0; - c2 = RD(a.g, 124); - for (e = 0; e < a.i; ++e) { - d = c2[e]; - g.am(d.Lk()) && ++f2; - } - return f2; - } - function tge(a, b, c2) { - var d, e; - e = ZD(b, 102) && (RD(b, 19).Bb & txe) != 0 ? new She(b, a) : new Phe(b, a); - for (d = 0; d < c2; ++d) { - Dhe(e); - } - return e; - } - function yrd(a, b, c2) { - var d, e; - if (a.c) { - Isd(a.c, b, c2); - } else { - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 163); - yrd(d, b, c2); - } - } - } - function tGd(a, b, c2) { - var d, e; - d = RD(b.of(a.a), 34); - e = RD(c2.of(a.a), 34); - return d != null && e != null ? Leb(d, e) : d != null ? -1 : e != null ? 1 : 0; - } - function Ce(a, b) { - var c2, d, e; - uFb(b); - c2 = false; - for (d = new Anb(a); d.a < d.c.c.length; ) { - e = ynb(d); - if (b.Hc(e)) { - znb(d); - c2 = true; - } - } - return c2; - } - function xsb(a) { - var b, c2, d, e; - c2 = (b = RD(mfb((d = a.Rm, e = d.f, e == WI ? d : e)), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)); - zsb(c2, a); - return c2; - } - function i2b(a) { - var b, c2; - c2 = RD(mQb(a, (yCc(), rAc)), 88); - if (c2 == (Cmd(), Amd)) { - b = Kfb(UD(mQb(a, Tzc))); - return b >= 1 ? zmd : xmd; - } - return c2; - } - function Xhc(a) { - switch (RD(mQb(a, (yCc(), yAc)), 223).g) { - case 1: - return new jqc(); - case 3: - return new arc(); - default: - return new dqc(); - } - } - function MCb(a) { - if (a.c) { - MCb(a.c); - } else if (a.d) { - throw Adb(new dgb("Stream already terminated, can't be modified or used")); - } - } - function Ltb(a, b, c2) { - var d; - d = a.a.get(b); - a.a.set(b, c2 === void 0 ? null : c2); - if (d === void 0) { - ++a.c; - ++a.b.g; - } else { - ++a.d; - } - return d; - } - function HHc(a, b, c2) { - var d, e; - for (e = a.a.ec().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 10); - if (Be(c2, RD(Vmb(b, d.p), 16))) { - return d; - } - } - return null; - } - function u0c(a, b, c2) { - var d; - d = 0; - !!b && (Emd(a.a) ? d += b.f.a / 2 : d += b.f.b / 2); - !!c2 && (Emd(a.a) ? d += c2.f.a / 2 : d += c2.f.b / 2); - return d; - } - function LWb(a, b, c2) { - var d; - d = c2; - !d && (d = Nqd(new Oqd(), 0)); - d.Ug(EAe, 2); - y0b(a.b, b, d.eh(1)); - NWb(a, b, d.eh(1)); - h0b(b, d.eh(1)); - d.Vg(); - } - function CGd(a, b, c2) { - var d, e; - d = (bvd(), e = new Xxd(), e); - Vxd(d, b); - Wxd(d, c2); - !!a && WGd((!a.a && (a.a = new XZd(D4, a, 5)), a.a), d); - return d; - } - function kyd(a) { - var b; - if ((a.Db & 64) != 0) - return awd(a); - b = new Shb(awd(a)); - b.a += " (identifier: "; - Nhb(b, a.k); - b.a += ")"; - return b.a; - } - function kXd(a, b) { - var c2; - c2 = (a.Bb & QHe) != 0; - b ? a.Bb |= QHe : a.Bb &= -32769; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 18, c2, b)); - } - function a6d(a, b) { - var c2; - c2 = (a.Bb & QHe) != 0; - b ? a.Bb |= QHe : a.Bb &= -32769; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 18, c2, b)); - } - function AWd(a, b) { - var c2; - c2 = (a.Bb & Ove) != 0; - b ? a.Bb |= Ove : a.Bb &= -16385; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 16, c2, b)); - } - function c6d(a, b) { - var c2; - c2 = (a.Bb & txe) != 0; - b ? a.Bb |= txe : a.Bb &= -65537; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new Q3d(a, 1, 20, c2, b)); - } - function qse(a) { - var b; - b = $C(hE, zwe, 28, 2, 15, 1); - a -= txe; - b[0] = (a >> 10) + uxe & Bwe; - b[1] = (a & 1023) + 56320 & Bwe; - return Ihb(b, 0, b.length); - } - function Zfb(a) { - var b; - b = Neb(a); - if (b > 34028234663852886e22) { - return oxe; - } else if (b < -34028234663852886e22) { - return pxe; - } - return b; - } - function Bdb(a, b) { - var c2; - if (Kdb(a) && Kdb(b)) { - c2 = a + b; - if (jxe < c2 && c2 < hxe) { - return c2; - } - } - return Edb(sD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b)); - } - function Ndb(a, b) { - var c2; - if (Kdb(a) && Kdb(b)) { - c2 = a * b; - if (jxe < c2 && c2 < hxe) { - return c2; - } - } - return Edb(wD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b)); - } - function Vdb(a, b) { - var c2; - if (Kdb(a) && Kdb(b)) { - c2 = a - b; - if (jxe < c2 && c2 < hxe) { - return c2; - } - } - return Edb(DD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b)); - } - function b3b(a, b) { - var c2; - a.i || V2b(a); - c2 = RD(Vrb(a.g, b), 42); - return !c2 ? (yob(), yob(), vob) : new Rkb(a.j, RD(c2.a, 17).a, RD(c2.b, 17).a); - } - function ZXb(a) { - NXb(); - return Geb(), IYb(RD(a.a, 86).j, RD(a.b, 88)) || RD(a.a, 86).d.e != 0 && IYb(RD(a.a, 86).j, RD(a.b, 88)) ? true : false; - } - function pWc(a, b) { - return lhb(!!b.b && !!b.c ? aXc(b.b) + "->" + aXc(b.c) : "e_" + tb(b), !!a.b && !!a.c ? aXc(a.b) + "->" + aXc(a.c) : "e_" + tb(a)); - } - function rWc(a, b) { - return lhb(!!b.b && !!b.c ? aXc(b.b) + "->" + aXc(b.c) : "e_" + tb(b), !!a.b && !!a.c ? aXc(a.b) + "->" + aXc(a.c) : "e_" + tb(a)); - } - function $y(a, b) { - Zy(); - return bz(pwe), $wnd.Math.abs(a - b) <= pwe || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : cz(isNaN(a), isNaN(b)); - } - function Ymd() { - Ymd = geb; - Xmd = new Zmd(Sye, 0); - Vmd = new Zmd("POLYLINE", 1); - Umd = new Zmd("ORTHOGONAL", 2); - Wmd = new Zmd("SPLINES", 3); - } - function _6c() { - _6c = geb; - Z6c = new a7c("ASPECT_RATIO_DRIVEN", 0); - $6c = new a7c("MAX_SCALE_DRIVEN", 1); - Y6c = new a7c("AREA_DRIVEN", 2); - } - function Db(b, c2, d) { - var e; - try { - Cb(b, c2, d); - } catch (a) { - a = zdb(a); - if (ZD(a, 606)) { - e = a; - throw Adb(new Deb(e)); - } else - throw Adb(a); - } - return c2; - } - function Im(a) { - var b, c2, d; - for (c2 = 0, d = a.length; c2 < d; c2++) { - if (a[c2] == null) { - throw Adb(new Ogb("at index " + c2)); - } - } - b = a; - return new mob(b); - } - function W2b(a) { - var b, c2, d; - b = new bnb(); - for (d = new Anb(a.j); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 12); - Rmb(b, c2.b); - } - return Qb(b), new Dl(b); - } - function Z2b(a) { - var b, c2, d; - b = new bnb(); - for (d = new Anb(a.j); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 12); - Rmb(b, c2.e); - } - return Qb(b), new Dl(b); - } - function a3b(a) { - var b, c2, d; - b = new bnb(); - for (d = new Anb(a.j); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 12); - Rmb(b, c2.g); - } - return Qb(b), new Dl(b); - } - function MBb(a, b) { - var c2, d, e; - e = new Tsb(); - for (d = b.vc().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 44); - Zjb(e, c2.ld(), QBb(a, RD(c2.md(), 15))); - } - return e; - } - function Mje(a) { - var b, c2; - for (c2 = Nje(BXd(uWd(a))).Kc(); c2.Ob(); ) { - b = WD(c2.Pb()); - if (bAd(a, b)) - return dTd((cTd(), bTd), b); - } - return null; - } - function Cgc(a, b) { - var c2, d, e; - e = 0; - for (d = RD(b.Kb(a), 20).Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 18); - Heb(TD(mQb(c2, (Ywc(), Nwc)))) || ++e; - } - return e; - } - function Uv(a) { - var b, c2, d, e; - b = new oq(a.Rd().gc()); - e = 0; - for (d = Nr(a.Rd().Kc()); d.Ob(); ) { - c2 = d.Pb(); - nq(b, c2, sgb(e++)); - } - return sn(b.a); - } - function Cvb(a, b, c2, d) { - var e, f2; - uFb(d); - uFb(c2); - e = a.xc(b); - f2 = e == null ? c2 : EBb(RD(e, 15), RD(c2, 16)); - f2 == null ? a.Bc(b) : a.zc(b, f2); - return f2; - } - function Unb(a, b, c2, d) { - var e, f2, g; - for (e = b + 1; e < c2; ++e) { - for (f2 = e; f2 > b && d.Ne(a[f2 - 1], a[f2]) > 0; --f2) { - g = a[f2]; - bD(a, f2, a[f2 - 1]); - bD(a, f2 - 1, g); - } - } - } - function Egd(a, b) { - var c2, d, e, f2, g; - c2 = b.f; - dub(a.c.d, c2, b); - if (b.g != null) { - for (e = b.g, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - dub(a.c.e, d, b); - } - } - } - function YSc(a, b) { - var c2, d; - c2 = Sub(a, 0); - while (c2.b != c2.d.c) { - d = Mfb(UD(evb(c2))); - if (d == b) { - return; - } else if (d > b) { - fvb(c2); - break; - } - } - cvb(c2, b); - } - function Kic(a, b) { - var c2, d, e; - d = Zjc(b); - e = Kfb(UD(hFc(d, (yCc(), TBc)))); - c2 = $wnd.Math.max(0, e / 2 - 0.5); - Iic(b, c2, 1); - Rmb(a, new hjc(b, c2)); - } - function L5c(a, b, c2) { - var d; - c2.Ug("Straight Line Edge Routing", 1); - c2.dh(b, eFe); - d = RD(Gxd(b, (u2c(), t2c)), 27); - M5c(a, d); - c2.dh(b, gFe); - } - function K9c(a, b) { - a.n.c.length == 0 && Rmb(a.n, new _9c(a.s, a.t, a.i)); - Rmb(a.b, b); - W9c(RD(Vmb(a.n, a.n.c.length - 1), 209), b); - M9c(a, b); - } - function Zrb(a) { - var b; - this.a = (b = RD(a.e && a.e(), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)); - this.b = $C(jJ, rve, 1, this.a.a.length, 5, 1); - } - function jeb(a) { - var b; - if (Array.isArray(a) && a.Tm === keb) { - return nfb(rb(a)) + "@" + (b = tb(a) >>> 0, b.toString(16)); - } - return a.toString(); - } - function jD(a, b) { - if (a.h == fxe && a.m == 0 && a.l == 0) { - b && (eD = hD(0, 0, 0)); - return gD((MD(), KD)); - } - b && (eD = hD(a.l, a.m, a.h)); - return hD(0, 0, 0); - } - function _Gb(a, b) { - switch (b.g) { - case 2: - return a.b; - case 1: - return a.c; - case 4: - return a.d; - case 3: - return a.a; - default: - return false; - } - } - function IYb(a, b) { - switch (b.g) { - case 2: - return a.b; - case 1: - return a.c; - case 4: - return a.d; - case 3: - return a.a; - default: - return false; - } - } - function vyd(a, b, c2, d) { - switch (b) { - case 3: - return a.f; - case 4: - return a.g; - case 5: - return a.i; - case 6: - return a.j; - } - return cyd(a, b, c2, d); - } - function oIb(a, b) { - if (b == a.d) { - return a.e; - } else if (b == a.e) { - return a.d; - } else { - throw Adb(new agb("Node " + b + " not part of edge " + a)); - } - } - function Uvd(a, b) { - var c2; - c2 = wYd(a.Dh(), b); - if (ZD(c2, 102)) { - return RD(c2, 19); - } - throw Adb(new agb(KHe + b + "' is not a valid reference")); - } - function Bvd(a, b, c2, d) { - if (b < 0) { - Svd(a, c2, d); - } else { - if (!c2.rk()) { - throw Adb(new agb(KHe + c2.xe() + LHe)); - } - RD(c2, 69).wk().Ck(a, a.hi(), b, d); - } - } - function ig(a) { - var b; - if (a.b) { - ig(a.b); - if (a.b.d != a.c) { - throw Adb(new Jrb()); - } - } else if (a.d.dc()) { - b = RD(a.f.c.xc(a.e), 16); - !!b && (a.d = b); - } - } - function VMb(a) { - RMb(); - var b, c2, d, e; - b = a.o.b; - for (d = RD(RD(Qc(a.r, (qpd(), npd)), 21), 87).Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 117); - e = c2.e; - e.b += b; - } - } - function SRb(a) { - var b, c2, d; - this.a = new Iub(); - for (d = new Anb(a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 16); - b = new DRb(); - xRb(b, c2); - Ysb(this.a, b); - } - } - function fdc(a, b) { - var c2, d, e; - d = cdc(a, b); - e = d[d.length - 1] / 2; - for (c2 = 0; c2 < d.length; c2++) { - if (d[c2] >= e) { - return b.c + c2; - } - } - return b.c + b.b.gc(); - } - function lQd(a, b) { - jQd(); - var c2, d, e, f2; - d = iZd(a); - e = b; - Wnb(d, 0, d.length, e); - for (c2 = 0; c2 < d.length; c2++) { - f2 = kQd(a, d[c2], c2); - c2 != f2 && uLd(a, c2, f2); - } - } - function mSd(a, b, c2) { - var d, e; - for (d = 0, e = a.length; d < e; d++) { - if (zSd((BFb(d, a.length), a.charCodeAt(d)), b, c2)) - return true; - } - return false; - } - function ARb(a, b) { - var c2, d; - for (d = a.e.a.ec().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 272); - if (Eid(b, c2.d) || zid(b, c2.d)) { - return true; - } - } - return false; - } - function oMc(a, b, c2, d, e) { - var f2, g, h; - g = e; - while (b.b != b.c) { - f2 = RD(smb(b), 10); - h = RD(b3b(f2, d).Xb(0), 12); - a.d[h.p] = g++; - ZEb(c2.c, h); - } - return g; - } - function vKb(a, b) { - var c2, d, e, f2, g, h; - d = 0; - c2 = 0; - for (f2 = b, g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - if (e > 0) { - d += e; - ++c2; - } - } - c2 > 1 && (d += a.d * (c2 - 1)); - return d; - } - function FFd(a) { - var b, c2, d, e, f2; - f2 = HFd(a); - c2 = cve(a.c); - d = !c2; - if (d) { - e = new MB(); - sC(f2, "knownLayouters", e); - b = new QFd(e); - xgb(a.c, b); - } - return f2; - } - function fHd(a) { - var b, c2, d; - d = new Qhb(); - d.a += "["; - for (b = 0, c2 = a.gc(); b < c2; ) { - Nhb(d, Ghb(a.Vi(b))); - ++b < c2 && (d.a += pve, d); - } - d.a += "]"; - return d.a; - } - function kSd(a) { - if (a.e == null) { - return a; - } else - !a.c && (a.c = new lSd((a.f & 256) != 0, a.i, a.a, a.d, (a.f & 16) != 0, a.j, a.g, null)); - return a.c; - } - function pnc(a) { - if (a.k != (r3b(), p3b)) { - return false; - } - return yDb(new SDb(null, new Twb(new is(Mr(a3b(a).a.Kc(), new ir())))), new qnc()); - } - function hv(a) { - var b, c2; - if (ZD(a, 307)) { - c2 = vm(RD(a, 307)); - b = c2; - return b; - } else - return ZD(a, 441) ? RD(a, 441).a : ZD(a, 59) ? new Fv(a) : new uv(a); - } - function FSd(a) { - var b; - if (a == null) - return true; - b = a.length; - return b > 0 && (BFb(b - 1, a.length), a.charCodeAt(b - 1) == 58) && !mSd(a, aSd, bSd); - } - function Sib(a, b) { - var c2; - if (dE(a) === dE(b)) { - return true; - } - if (ZD(b, 92)) { - c2 = RD(b, 92); - return a.e == c2.e && a.d == c2.d && Tib(a, c2.a); - } - return false; - } - function vpd(a) { - qpd(); - switch (a.g) { - case 4: - return Yod; - case 1: - return Xod; - case 3: - return npd; - case 2: - return ppd; - default: - return opd; - } - } - function jBb(a) { - var b, c2; - if (a.b) { - return a.b; - } - c2 = dBb ? null : a.d; - while (c2) { - b = dBb ? null : c2.b; - if (b) { - return b; - } - c2 = dBb ? null : c2.d; - } - return SAb(), RAb; - } - function LJb(a) { - var b, c2, d; - d = Kfb(UD(a.a.of((umd(), cmd)))); - for (c2 = new Anb(a.a.Sf()); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 695); - OJb(a, b, d); - } - } - function jz(a) { - var b, c2, d, e; - for (b = (a.j == null && (a.j = (fA(), e = eA.me(a), hA(e))), a.j), c2 = 0, d = b.length; c2 < d; ++c2) { - } - } - function OXb(a, b) { - var c2, d; - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 42); - Rmb(a.b.b, RD(c2.b, 86)); - gYb(RD(c2.a, 194), RD(c2.b, 86)); - } - } - function nHc(a, b, c2) { - var d, e; - e = a.a.b; - for (d = e.c.length; d < c2; d++) { - Qmb(e, 0, new R4b(a.a)); - } - g3b(b, RD(Vmb(e, e.c.length - c2), 30)); - a.b[b.p] = c2; - } - function EOc(a, b, c2, d, e) { - dOc(); - rIb(uIb(tIb(sIb(vIb(new wIb(), 0), e.d.e - a), b), e.d)); - rIb(uIb(tIb(sIb(vIb(new wIb(), 0), c2 - e.a.e), e.a), d)); - } - function Ted(a, b) { - var c2; - if (a.d) { - if (Ujb(a.b, b)) { - return RD(Wjb(a.b, b), 47); - } else { - c2 = b.dg(); - Zjb(a.b, b, c2); - return c2; - } - } else { - return b.dg(); - } - } - function hFb(b) { - var c2 = b.e; - function d(a) { - if (!a || a.length == 0) { - return ""; - } - return " " + a.join("\n "); - } - return c2 && (c2.stack || d(b[xwe])); - } - function wyd(a, b) { - switch (b) { - case 3: - return a.f != 0; - case 4: - return a.g != 0; - case 5: - return a.i != 0; - case 6: - return a.j != 0; - } - return fyd(a, b); - } - function y2c(a) { - switch (a.g) { - case 0: - return new D5c(); - case 1: - return new N5c(); - default: - throw Adb(new agb(lBe + (a.f != null ? a.f : "" + a.g))); - } - } - function Z3c(a) { - switch (a.g) { - case 0: - return new G5c(); - case 1: - return new J5c(); - default: - throw Adb(new agb(mFe + (a.f != null ? a.f : "" + a.g))); - } - } - function h4c(a) { - switch (a.g) { - case 1: - return new F3c(); - case 2: - return new x3c(); - default: - throw Adb(new agb(mFe + (a.f != null ? a.f : "" + a.g))); - } - } - function mdd(a) { - switch (a.g) { - case 0: - return new Ddd(); - case 1: - return new Hdd(); - default: - throw Adb(new agb(eGe + (a.f != null ? a.f : "" + a.g))); - } - } - function Owb() { - Hwb(); - var a, b, c2; - c2 = Gwb++ + Date.now(); - a = eE($wnd.Math.floor(c2 * Nxe)) & Pxe; - b = eE(c2 - a * Oxe); - this.a = a ^ 1502; - this.b = b ^ Mxe; - } - function cxc() { - cxc = geb; - bxc = new dxc(LAe, 0); - Zwc = new dxc("FIRST", 1); - $wc = new dxc(oBe, 2); - _wc = new dxc("LAST", 3); - axc = new dxc(pBe, 4); - } - function Grd() { - Grd = geb; - Frd = new Hrd(mEe, 0); - Crd = new Hrd("GROUP_DEC", 1); - Erd = new Hrd("GROUP_MIXED", 2); - Drd = new Hrd("GROUP_INC", 3); - } - function cEd(a, b) { - var c2, d, e, f2; - if (b) { - e = vDd(b, "x"); - c2 = new wFd(a); - Ozd(c2.a, (uFb(e), e)); - f2 = vDd(b, "y"); - d = new zFd(a); - Pzd(d.a, (uFb(f2), f2)); - } - } - function nEd(a, b) { - var c2, d, e, f2; - if (b) { - e = vDd(b, "x"); - c2 = new BFd(a); - Hzd(c2.a, (uFb(e), e)); - f2 = vDd(b, "y"); - d = new CFd(a); - Izd(d.a, (uFb(f2), f2)); - } - } - function Sje(a, b) { - var c2, d, e, f2; - e = new cnb(b.gc()); - for (d = b.Kc(); d.Ob(); ) { - c2 = d.Pb(); - f2 = Rje(a, RD(c2, 58)); - !!f2 && (ZEb(e.c, f2), true); - } - return e; - } - function ze(a, b, c2) { - var d, e; - for (e = a.Kc(); e.Ob(); ) { - d = e.Pb(); - if (dE(b) === dE(d) || b != null && pb(b, d)) { - c2 && e.Qb(); - return true; - } - } - return false; - } - function Y5b(a) { - var b, c2, d; - c2 = a.jh(); - if (c2) { - b = a.Eh(); - if (ZD(b, 167)) { - d = Y5b(RD(b, 167)); - if (d != null) { - return d + "." + c2; - } - } - return c2; - } - return null; - } - function pjb(a) { - var b, c2, d; - if (a.e == 0) { - return 0; - } - b = a.d << 5; - c2 = a.a[a.d - 1]; - if (a.e < 0) { - d = Uib(a); - if (d == a.d - 1) { - --c2; - c2 = c2 | 0; - } - } - b -= ngb(c2); - return b; - } - function kjb(a) { - var b, c2, d; - if (a < Nib.length) { - return Nib[a]; + return self2; + }, "removeDataImpl"); + }, "removeData") + // removeData + }; + define$1 = { + eventAliasesOn: /* @__PURE__ */ __name(function eventAliasesOn(proto) { + var p3 = proto; + p3.addListener = p3.listen = p3.bind = p3.on; + p3.unlisten = p3.unbind = p3.off = p3.removeListener; + p3.trigger = p3.emit; + p3.pon = p3.promiseOn = function(events, selector) { + var self2 = this; + var args = Array.prototype.slice.call(arguments, 0); + return new Promise$1(function(resolve3, reject3) { + var callback = /* @__PURE__ */ __name(function callback2(e3) { + self2.off.apply(self2, offArgs); + resolve3(e3); + }, "callback"); + var onArgs = args.concat([callback]); + var offArgs = onArgs.concat([]); + self2.on.apply(self2, onArgs); + }); + }; + }, "eventAliasesOn") + }; + define2 = {}; + [define$3, define$2, define$1].forEach(function(m2) { + extend2(define2, m2); + }); + elesfn$i = { + animate: define2.animate(), + animation: define2.animation(), + animated: define2.animated(), + clearQueue: define2.clearQueue(), + delay: define2.delay(), + delayAnimation: define2.delayAnimation(), + stop: define2.stop() + }; + elesfn$h = { + classes: /* @__PURE__ */ __name(function classes4(_classes) { + var self2 = this; + if (_classes === void 0) { + var ret = []; + self2[0]._private.classes.forEach(function(cls2) { + return ret.push(cls2); + }); + return ret; + } else if (!array2(_classes)) { + _classes = (_classes || "").match(/\S+/g) || []; + } + var changed = []; + var classesSet = new Set$1(_classes); + for (var j2 = 0; j2 < self2.length; j2++) { + var ele = self2[j2]; + var _p = ele._private; + var eleClasses = _p.classes; + var changedEle = false; + for (var i2 = 0; i2 < _classes.length; i2++) { + var cls = _classes[i2]; + var eleHasClass = eleClasses.has(cls); + if (!eleHasClass) { + changedEle = true; + break; } - c2 = a >> 5; - b = a & 31; - d = $C(kE, Pwe, 28, c2 + 1, 15, 1); - d[c2] = 1 << b; - return new cjb(1, c2 + 1, d); } - function eLd(a, b) { - var c2, d; - if (!b) { - return false; - } else { - for (c2 = 0; c2 < a.i; ++c2) { - d = RD(a.g[c2], 378); - if (d.mj(b)) { - return false; - } - } - return WGd(a, b); - } + if (!changedEle) { + changedEle = eleClasses.size !== _classes.length; } - function ZId(a, b, c2) { - var d, e; - ++a.j; - if (c2.dc()) { - return false; - } else { - for (e = c2.Kc(); e.Ob(); ) { - d = e.Pb(); - a.qj(b, a.Zi(b, d)); - ++b; - } - return true; - } + if (changedEle) { + _p.classes = classesSet; + changed.push(ele); } - function OA(a, b, c2, d) { - var e, f2; - f2 = c2 - b; - if (f2 < 3) { - while (f2 < 3) { - a *= 10; - ++f2; - } - } else { - e = 1; - while (f2 > 3) { - e *= 10; - --f2; - } - a = (a + (e >> 1)) / e | 0; + } + if (changed.length > 0) { + this.spawn(changed).updateStyle().emit("class"); + } + return self2; + }, "classes"), + addClass: /* @__PURE__ */ __name(function addClass4(classes6) { + return this.toggleClass(classes6, true); + }, "addClass"), + hasClass: /* @__PURE__ */ __name(function hasClass(className) { + var ele = this[0]; + return ele != null && ele._private.classes.has(className); + }, "hasClass"), + toggleClass: /* @__PURE__ */ __name(function toggleClass(classes6, toggle) { + if (!array2(classes6)) { + classes6 = classes6.match(/\S+/g) || []; + } + var self2 = this; + var toggleUndefd = toggle === void 0; + var changed = []; + for (var i2 = 0, il = self2.length; i2 < il; i2++) { + var ele = self2[i2]; + var eleClasses = ele._private.classes; + var changedEle = false; + for (var j2 = 0; j2 < classes6.length; j2++) { + var cls = classes6[j2]; + var hasClass2 = eleClasses.has(cls); + var changedNow = false; + if (toggle || toggleUndefd && !hasClass2) { + eleClasses.add(cls); + changedNow = true; + } else if (!toggle || toggleUndefd && hasClass2) { + eleClasses["delete"](cls); + changedNow = true; } - d.i = a; - return true; - } - function BYd(a, b) { - var c2, d, e; - c2 = (a.i == null && rYd(a), a.i); - d = b.Lj(); - if (d != -1) { - for (e = c2.length; d < e; ++d) { - if (c2[d] == b) { - return d; - } - } + if (!changedEle && changedNow) { + changed.push(ele); + changedEle = true; } - return -1; } - function T$d(a) { - var b, c2, d, e, f2; - c2 = RD(a.g, 689); - for (d = a.i - 1; d >= 0; --d) { - b = c2[d]; - for (e = 0; e < d; ++e) { - f2 = c2[e]; - if (U$d(a, b, f2)) { - THd(a, d); - break; - } - } - } + } + if (changed.length > 0) { + this.spawn(changed).updateStyle().emit("class"); + } + return self2; + }, "toggleClass"), + removeClass: /* @__PURE__ */ __name(function removeClass(classes6) { + return this.toggleClass(classes6, false); + }, "removeClass"), + flashClass: /* @__PURE__ */ __name(function flashClass(classes6, duration) { + var self2 = this; + if (duration == null) { + duration = 250; + } else if (duration === 0) { + return self2; + } + self2.addClass(classes6); + setTimeout(function() { + self2.removeClass(classes6); + }, duration); + return self2; + }, "flashClass") + }; + elesfn$h.className = elesfn$h.classNames = elesfn$h.classes; + tokens = { + metaChar: "[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]", + // chars we need to escape in let names, etc + comparatorOp: "=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=", + // binary comparison op (used in data selectors) + boolOp: "\\?|\\!|\\^", + // boolean (unary) operators (used in data selectors) + string: `"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`, + // string literals (used in data selectors) -- doublequotes | singlequotes + number: number6, + // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 + meta: "degree|indegree|outdegree", + // allowed metadata fields (i.e. allowed functions to use from Collection) + separator: "\\s*,\\s*", + // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass + descendant: "\\s+", + child: "\\s+>\\s+", + subject: "\\$", + group: "node|edge|\\*", + directedEdge: "\\s+->\\s+", + undirectedEdge: "\\s+<->\\s+" + }; + tokens.variable = "(?:[\\w-.]|(?:\\\\" + tokens.metaChar + "))+"; + tokens.className = "(?:[\\w-]|(?:\\\\" + tokens.metaChar + "))+"; + tokens.value = tokens.string + "|" + tokens.number; + tokens.id = tokens.variable; + (function() { + var ops, op2, i2; + ops = tokens.comparatorOp.split("|"); + for (i2 = 0; i2 < ops.length; i2++) { + op2 = ops[i2]; + tokens.comparatorOp += "|@" + op2; + } + ops = tokens.comparatorOp.split("|"); + for (i2 = 0; i2 < ops.length; i2++) { + op2 = ops[i2]; + if (op2.indexOf("!") >= 0) { + continue; + } + if (op2 === "=") { + continue; + } + tokens.comparatorOp += "|\\!" + op2; + } + })(); + newQuery = /* @__PURE__ */ __name(function newQuery2() { + return { + checks: [] + }; + }, "newQuery"); + Type3 = { + /** E.g. node */ + GROUP: 0, + /** A collection of elements */ + COLLECTION: 1, + /** A filter(ele) function */ + FILTER: 2, + /** E.g. [foo > 1] */ + DATA_COMPARE: 3, + /** E.g. [foo] */ + DATA_EXIST: 4, + /** E.g. [?foo] */ + DATA_BOOL: 5, + /** E.g. [[degree > 2]] */ + META_COMPARE: 6, + /** E.g. :selected */ + STATE: 7, + /** E.g. #foo */ + ID: 8, + /** E.g. .foo */ + CLASS: 9, + /** E.g. #foo <-> #bar */ + UNDIRECTED_EDGE: 10, + /** E.g. #foo -> #bar */ + DIRECTED_EDGE: 11, + /** E.g. $#foo -> #bar */ + NODE_SOURCE: 12, + /** E.g. #foo -> $#bar */ + NODE_TARGET: 13, + /** E.g. $#foo <-> #bar */ + NODE_NEIGHBOR: 14, + /** E.g. #foo > #bar */ + CHILD: 15, + /** E.g. #foo #bar */ + DESCENDANT: 16, + /** E.g. $#foo > #bar */ + PARENT: 17, + /** E.g. $#foo #bar */ + ANCESTOR: 18, + /** E.g. #foo > $bar > #baz */ + COMPOUND_SPLIT: 19, + /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */ + TRUE: 20 + }; + stateSelectors = [{ + selector: ":selected", + matches: /* @__PURE__ */ __name(function matches(ele) { + return ele.selected(); + }, "matches") + }, { + selector: ":unselected", + matches: /* @__PURE__ */ __name(function matches2(ele) { + return !ele.selected(); + }, "matches") + }, { + selector: ":selectable", + matches: /* @__PURE__ */ __name(function matches3(ele) { + return ele.selectable(); + }, "matches") + }, { + selector: ":unselectable", + matches: /* @__PURE__ */ __name(function matches4(ele) { + return !ele.selectable(); + }, "matches") + }, { + selector: ":locked", + matches: /* @__PURE__ */ __name(function matches5(ele) { + return ele.locked(); + }, "matches") + }, { + selector: ":unlocked", + matches: /* @__PURE__ */ __name(function matches6(ele) { + return !ele.locked(); + }, "matches") + }, { + selector: ":visible", + matches: /* @__PURE__ */ __name(function matches7(ele) { + return ele.visible(); + }, "matches") + }, { + selector: ":hidden", + matches: /* @__PURE__ */ __name(function matches8(ele) { + return !ele.visible(); + }, "matches") + }, { + selector: ":transparent", + matches: /* @__PURE__ */ __name(function matches9(ele) { + return ele.transparent(); + }, "matches") + }, { + selector: ":grabbed", + matches: /* @__PURE__ */ __name(function matches10(ele) { + return ele.grabbed(); + }, "matches") + }, { + selector: ":free", + matches: /* @__PURE__ */ __name(function matches11(ele) { + return !ele.grabbed(); + }, "matches") + }, { + selector: ":removed", + matches: /* @__PURE__ */ __name(function matches12(ele) { + return ele.removed(); + }, "matches") + }, { + selector: ":inside", + matches: /* @__PURE__ */ __name(function matches13(ele) { + return !ele.removed(); + }, "matches") + }, { + selector: ":grabbable", + matches: /* @__PURE__ */ __name(function matches14(ele) { + return ele.grabbable(); + }, "matches") + }, { + selector: ":ungrabbable", + matches: /* @__PURE__ */ __name(function matches15(ele) { + return !ele.grabbable(); + }, "matches") + }, { + selector: ":animated", + matches: /* @__PURE__ */ __name(function matches16(ele) { + return ele.animated(); + }, "matches") + }, { + selector: ":unanimated", + matches: /* @__PURE__ */ __name(function matches17(ele) { + return !ele.animated(); + }, "matches") + }, { + selector: ":parent", + matches: /* @__PURE__ */ __name(function matches18(ele) { + return ele.isParent(); + }, "matches") + }, { + selector: ":childless", + matches: /* @__PURE__ */ __name(function matches19(ele) { + return ele.isChildless(); + }, "matches") + }, { + selector: ":child", + matches: /* @__PURE__ */ __name(function matches20(ele) { + return ele.isChild(); + }, "matches") + }, { + selector: ":orphan", + matches: /* @__PURE__ */ __name(function matches21(ele) { + return ele.isOrphan(); + }, "matches") + }, { + selector: ":nonorphan", + matches: /* @__PURE__ */ __name(function matches22(ele) { + return ele.isChild(); + }, "matches") + }, { + selector: ":compound", + matches: /* @__PURE__ */ __name(function matches23(ele) { + if (ele.isNode()) { + return ele.isParent(); + } else { + return ele.source().isParent() || ele.target().isParent(); + } + }, "matches") + }, { + selector: ":loop", + matches: /* @__PURE__ */ __name(function matches24(ele) { + return ele.isLoop(); + }, "matches") + }, { + selector: ":simple", + matches: /* @__PURE__ */ __name(function matches25(ele) { + return ele.isSimple(); + }, "matches") + }, { + selector: ":active", + matches: /* @__PURE__ */ __name(function matches26(ele) { + return ele.active(); + }, "matches") + }, { + selector: ":inactive", + matches: /* @__PURE__ */ __name(function matches27(ele) { + return !ele.active(); + }, "matches") + }, { + selector: ":backgrounding", + matches: /* @__PURE__ */ __name(function matches28(ele) { + return ele.backgrounding(); + }, "matches") + }, { + selector: ":nonbackgrounding", + matches: /* @__PURE__ */ __name(function matches29(ele) { + return !ele.backgrounding(); + }, "matches") + }].sort(function(a2, b2) { + return descending2(a2.selector, b2.selector); + }); + lookup = function() { + var selToFn = {}; + var s2; + for (var i2 = 0; i2 < stateSelectors.length; i2++) { + s2 = stateSelectors[i2]; + selToFn[s2.selector] = s2.matches; + } + return selToFn; + }(); + stateSelectorMatches = /* @__PURE__ */ __name(function stateSelectorMatches2(sel, ele) { + return lookup[sel](ele); + }, "stateSelectorMatches"); + stateSelectorRegex = "(" + stateSelectors.map(function(s2) { + return s2.selector; + }).join("|") + ")"; + cleanMetaChars = /* @__PURE__ */ __name(function cleanMetaChars2(str2) { + return str2.replace(new RegExp("\\\\(" + tokens.metaChar + ")", "g"), function(match2, $1) { + return $1; + }); + }, "cleanMetaChars"); + replaceLastQuery = /* @__PURE__ */ __name(function replaceLastQuery2(selector, examiningQuery, replacementQuery) { + selector[selector.length - 1] = replacementQuery; + }, "replaceLastQuery"); + exprs = [{ + name: "group", + // just used for identifying when debugging + query: true, + regex: "(" + tokens.group + ")", + populate: /* @__PURE__ */ __name(function populate2(selector, query, _ref) { + var _ref2 = _slicedToArray(_ref, 1), group2 = _ref2[0]; + query.checks.push({ + type: Type3.GROUP, + value: group2 === "*" ? group2 : group2 + "s" + }); + }, "populate") + }, { + name: "state", + query: true, + regex: stateSelectorRegex, + populate: /* @__PURE__ */ __name(function populate3(selector, query, _ref3) { + var _ref4 = _slicedToArray(_ref3, 1), state4 = _ref4[0]; + query.checks.push({ + type: Type3.STATE, + value: state4 + }); + }, "populate") + }, { + name: "id", + query: true, + regex: "\\#(" + tokens.id + ")", + populate: /* @__PURE__ */ __name(function populate4(selector, query, _ref5) { + var _ref6 = _slicedToArray(_ref5, 1), id26 = _ref6[0]; + query.checks.push({ + type: Type3.ID, + value: cleanMetaChars(id26) + }); + }, "populate") + }, { + name: "className", + query: true, + regex: "\\.(" + tokens.className + ")", + populate: /* @__PURE__ */ __name(function populate5(selector, query, _ref7) { + var _ref8 = _slicedToArray(_ref7, 1), className = _ref8[0]; + query.checks.push({ + type: Type3.CLASS, + value: cleanMetaChars(className) + }); + }, "populate") + }, { + name: "dataExists", + query: true, + regex: "\\[\\s*(" + tokens.variable + ")\\s*\\]", + populate: /* @__PURE__ */ __name(function populate6(selector, query, _ref9) { + var _ref10 = _slicedToArray(_ref9, 1), variable = _ref10[0]; + query.checks.push({ + type: Type3.DATA_EXIST, + field: cleanMetaChars(variable) + }); + }, "populate") + }, { + name: "dataCompare", + query: true, + regex: "\\[\\s*(" + tokens.variable + ")\\s*(" + tokens.comparatorOp + ")\\s*(" + tokens.value + ")\\s*\\]", + populate: /* @__PURE__ */ __name(function populate7(selector, query, _ref11) { + var _ref12 = _slicedToArray(_ref11, 3), variable = _ref12[0], comparatorOp = _ref12[1], value2 = _ref12[2]; + var valueIsString = new RegExp("^" + tokens.string + "$").exec(value2) != null; + if (valueIsString) { + value2 = value2.substring(1, value2.length - 1); + } else { + value2 = parseFloat(value2); + } + query.checks.push({ + type: Type3.DATA_COMPARE, + field: cleanMetaChars(variable), + operator: comparatorOp, + value: value2 + }); + }, "populate") + }, { + name: "dataBool", + query: true, + regex: "\\[\\s*(" + tokens.boolOp + ")\\s*(" + tokens.variable + ")\\s*\\]", + populate: /* @__PURE__ */ __name(function populate8(selector, query, _ref13) { + var _ref14 = _slicedToArray(_ref13, 2), boolOp = _ref14[0], variable = _ref14[1]; + query.checks.push({ + type: Type3.DATA_BOOL, + field: cleanMetaChars(variable), + operator: boolOp + }); + }, "populate") + }, { + name: "metaCompare", + query: true, + regex: "\\[\\[\\s*(" + tokens.meta + ")\\s*(" + tokens.comparatorOp + ")\\s*(" + tokens.number + ")\\s*\\]\\]", + populate: /* @__PURE__ */ __name(function populate9(selector, query, _ref15) { + var _ref16 = _slicedToArray(_ref15, 3), meta3 = _ref16[0], comparatorOp = _ref16[1], number7 = _ref16[2]; + query.checks.push({ + type: Type3.META_COMPARE, + field: cleanMetaChars(meta3), + operator: comparatorOp, + value: parseFloat(number7) + }); + }, "populate") + }, { + name: "nextQuery", + separator: true, + regex: tokens.separator, + populate: /* @__PURE__ */ __name(function populate10(selector, query) { + var currentSubject = selector.currentSubject; + var edgeCount4 = selector.edgeCount; + var compoundCount = selector.compoundCount; + var lastQ = selector[selector.length - 1]; + if (currentSubject != null) { + lastQ.subject = currentSubject; + selector.currentSubject = null; + } + lastQ.edgeCount = edgeCount4; + lastQ.compoundCount = compoundCount; + selector.edgeCount = 0; + selector.compoundCount = 0; + var nextQuery = selector[selector.length++] = newQuery(); + return nextQuery; + }, "populate") + }, { + name: "directedEdge", + separator: true, + regex: tokens.directedEdge, + populate: /* @__PURE__ */ __name(function populate11(selector, query) { + if (selector.currentSubject == null) { + var edgeQuery = newQuery(); + var source = query; + var target = newQuery(); + edgeQuery.checks.push({ + type: Type3.DIRECTED_EDGE, + source, + target + }); + replaceLastQuery(selector, query, edgeQuery); + selector.edgeCount++; + return target; + } else { + var srcTgtQ = newQuery(); + var _source = query; + var _target = newQuery(); + srcTgtQ.checks.push({ + type: Type3.NODE_SOURCE, + source: _source, + target: _target + }); + replaceLastQuery(selector, query, srcTgtQ); + selector.edgeCount++; + return _target; + } + }, "populate") + }, { + name: "undirectedEdge", + separator: true, + regex: tokens.undirectedEdge, + populate: /* @__PURE__ */ __name(function populate12(selector, query) { + if (selector.currentSubject == null) { + var edgeQuery = newQuery(); + var source = query; + var target = newQuery(); + edgeQuery.checks.push({ + type: Type3.UNDIRECTED_EDGE, + nodes: [source, target] + }); + replaceLastQuery(selector, query, edgeQuery); + selector.edgeCount++; + return target; + } else { + var nhoodQ = newQuery(); + var node2 = query; + var neighbor = newQuery(); + nhoodQ.checks.push({ + type: Type3.NODE_NEIGHBOR, + node: node2, + neighbor + }); + replaceLastQuery(selector, query, nhoodQ); + return neighbor; + } + }, "populate") + }, { + name: "child", + separator: true, + regex: tokens.child, + populate: /* @__PURE__ */ __name(function populate13(selector, query) { + if (selector.currentSubject == null) { + var parentChildQuery = newQuery(); + var child = newQuery(); + var parent4 = selector[selector.length - 1]; + parentChildQuery.checks.push({ + type: Type3.CHILD, + parent: parent4, + child + }); + replaceLastQuery(selector, query, parentChildQuery); + selector.compoundCount++; + return child; + } else if (selector.currentSubject === query) { + var compound = newQuery(); + var left3 = selector[selector.length - 1]; + var right3 = newQuery(); + var subject = newQuery(); + var _child = newQuery(); + var _parent = newQuery(); + compound.checks.push({ + type: Type3.COMPOUND_SPLIT, + left: left3, + right: right3, + subject + }); + subject.checks = query.checks; + query.checks = [{ + type: Type3.TRUE + }]; + _parent.checks.push({ + type: Type3.TRUE + }); + right3.checks.push({ + type: Type3.PARENT, + // type is swapped on right side queries + parent: _parent, + child: _child + // empty for now + }); + replaceLastQuery(selector, left3, compound); + selector.currentSubject = subject; + selector.compoundCount++; + return _child; + } else { + var _parent2 = newQuery(); + var _child2 = newQuery(); + var pcQChecks = [{ + type: Type3.PARENT, + parent: _parent2, + child: _child2 + }]; + _parent2.checks = query.checks; + query.checks = pcQChecks; + selector.compoundCount++; + return _child2; + } + }, "populate") + }, { + name: "descendant", + separator: true, + regex: tokens.descendant, + populate: /* @__PURE__ */ __name(function populate14(selector, query) { + if (selector.currentSubject == null) { + var ancChQuery = newQuery(); + var descendant = newQuery(); + var ancestor = selector[selector.length - 1]; + ancChQuery.checks.push({ + type: Type3.DESCENDANT, + ancestor, + descendant + }); + replaceLastQuery(selector, query, ancChQuery); + selector.compoundCount++; + return descendant; + } else if (selector.currentSubject === query) { + var compound = newQuery(); + var left3 = selector[selector.length - 1]; + var right3 = newQuery(); + var subject = newQuery(); + var _descendant = newQuery(); + var _ancestor = newQuery(); + compound.checks.push({ + type: Type3.COMPOUND_SPLIT, + left: left3, + right: right3, + subject + }); + subject.checks = query.checks; + query.checks = [{ + type: Type3.TRUE + }]; + _ancestor.checks.push({ + type: Type3.TRUE + }); + right3.checks.push({ + type: Type3.ANCESTOR, + // type is swapped on right side queries + ancestor: _ancestor, + descendant: _descendant + // empty for now + }); + replaceLastQuery(selector, left3, compound); + selector.currentSubject = subject; + selector.compoundCount++; + return _descendant; + } else { + var _ancestor2 = newQuery(); + var _descendant2 = newQuery(); + var adQChecks = [{ + type: Type3.ANCESTOR, + ancestor: _ancestor2, + descendant: _descendant2 + }]; + _ancestor2.checks = query.checks; + query.checks = adQChecks; + selector.compoundCount++; + return _descendant2; + } + }, "populate") + }, { + name: "subject", + modifier: true, + regex: tokens.subject, + populate: /* @__PURE__ */ __name(function populate15(selector, query) { + if (selector.currentSubject != null && selector.currentSubject !== query) { + warn("Redefinition of subject in selector `" + selector.toString() + "`"); + return false; + } + selector.currentSubject = query; + var topQ = selector[selector.length - 1]; + var topChk = topQ.checks[0]; + var topType = topChk == null ? null : topChk.type; + if (topType === Type3.DIRECTED_EDGE) { + topChk.type = Type3.NODE_TARGET; + } else if (topType === Type3.UNDIRECTED_EDGE) { + topChk.type = Type3.NODE_NEIGHBOR; + topChk.node = topChk.nodes[1]; + topChk.neighbor = topChk.nodes[0]; + topChk.nodes = null; + } + }, "populate") + }]; + exprs.forEach(function(e3) { + return e3.regexObj = new RegExp("^" + e3.regex); + }); + consumeExpr = /* @__PURE__ */ __name(function consumeExpr2(remaining) { + var expr; + var match2; + var name; + for (var j2 = 0; j2 < exprs.length; j2++) { + var e3 = exprs[j2]; + var n2 = e3.name; + var m2 = remaining.match(e3.regexObj); + if (m2 != null) { + match2 = m2; + expr = e3; + name = n2; + var consumed = m2[0]; + remaining = remaining.substring(consumed.length); + break; + } + } + return { + expr, + match: match2, + name, + remaining + }; + }, "consumeExpr"); + consumeWhitespace = /* @__PURE__ */ __name(function consumeWhitespace2(remaining) { + var match2 = remaining.match(/^\s+/); + if (match2) { + var consumed = match2[0]; + remaining = remaining.substring(consumed.length); + } + return remaining; + }, "consumeWhitespace"); + parse3 = /* @__PURE__ */ __name(function parse4(selector) { + var self2 = this; + var remaining = self2.inputText = selector; + var currentQuery = self2[0] = newQuery(); + self2.length = 1; + remaining = consumeWhitespace(remaining); + for (; ; ) { + var exprInfo = consumeExpr(remaining); + if (exprInfo.expr == null) { + warn("The selector `" + selector + "`is invalid"); + return false; + } else { + var args = exprInfo.match.slice(1); + var ret = exprInfo.expr.populate(self2, currentQuery, args); + if (ret === false) { + return false; + } else if (ret != null) { + currentQuery = ret; } - function PId(a) { - var b, c2, d, e; - b = new MB(); - for (e = new Ppb(a.b.Kc()); e.b.Ob(); ) { - d = RD(e.b.Pb(), 701); - c2 = LFd(d); - KB(b, b.a.length, c2); - } - return b.a; - } - function VNb(a) { - var b; - !a.c && (a.c = new MNb()); - _mb(a.d, new aOb()); - SNb(a); - b = LNb(a); - FDb(new SDb(null, new Swb(a.d, 16)), new tOb(a)); - return b; - } - function I6b(a, b) { - b.Ug("End label post-processing", 1); - FDb(CDb(EDb(new SDb(null, new Swb(a.b, 16)), new N6b()), new P6b()), new R6b()); - b.Vg(); - } - function RCc(a) { - QCc(); - this.c = dv(cD(WC(g2, 1), rve, 845, 0, [FCc])); - this.b = new Tsb(); - this.a = a; - Zjb(this.b, OCc, 1); - Umb(PCc, new $rd(this)); - } - function wKb(a, b, c2) { - kKb(); - fKb.call(this); - this.a = YC(IN, [Nve, Mye], [603, 217], 0, [jKb, iKb], 2); - this.c = new Tid(); - this.g = a; - this.f = b; - this.d = c2; - } - function gQb(a, b) { - this.n = YC(lE, [Nve, rxe], [376, 28], 14, [b, eE($wnd.Math.ceil(a / 32))], 2); - this.o = a; - this.p = b; - this.j = a - 1 >> 1; - this.k = b - 1 >> 1; - } - function Dfd(a) { - Afd(); - if (RD(a.of((umd(), pld)), 181).Hc((dqd(), bqd))) { - RD(a.of(Lld), 181).Fc((Pod(), Ood)); - RD(a.of(pld), 181).Mc(bqd); - } - } - function ndc(a) { - var b, c2; - b = a.d == (btc(), Ysc); - c2 = jdc(a); - b && !c2 || !b && c2 ? pQb(a.a, (yCc(), Rzc), (Rjd(), Pjd)) : pQb(a.a, (yCc(), Rzc), (Rjd(), Ojd)); - } - function QCc() { - QCc = geb; - GCc(); - OCc = (yCc(), bCc); - PCc = dv(cD(WC(V5, 1), kEe, 149, 0, [SBc, TBc, VBc, WBc, ZBc, $Bc, _Bc, aCc, dCc, fCc, UBc, XBc, cCc])); - } - function RDb(a, b) { - var c2; - c2 = RD(zDb(a, tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - return c2.Qc(__c(c2.gc())); - } - function nXc(a, b) { - var c2, d; - d = new zAb(a.a.ad(b, true)); - if (d.a.gc() <= 1) { - throw Adb(new Ngb()); - } - c2 = d.a.ec().Kc(); - c2.Pb(); - return RD(c2.Pb(), 40); - } - function lQc(a, b, c2) { - var d, e; - d = Kfb(a.p[b.i.p]) + Kfb(a.d[b.i.p]) + b.n.b + b.a.b; - e = Kfb(a.p[c2.i.p]) + Kfb(a.d[c2.i.p]) + c2.n.b + c2.a.b; - return e - d; - } - function XHd(a, b) { - var c2; - if (a.i > 0) { - if (b.length < a.i) { - c2 = IMd(rb(b).c, a.i); - b = c2; - } - hib(a.g, 0, b, 0, a.i); - } - b.length > a.i && bD(b, a.i, null); - return b; - } - function MXd(a) { - var b; - if ((a.Db & 64) != 0) - return QAd(a); - b = new Shb(QAd(a)); - b.a += " (instanceClassName: "; - Nhb(b, a.D); - b.a += ")"; - return b.a; - } - function ySd(a) { - var b, c2, d, e; - e = 0; - for (c2 = 0, d = a.length; c2 < d; c2++) { - b = (BFb(c2, a.length), a.charCodeAt(c2)); - b < 64 && (e = Rdb(e, Sdb(1, b))); - } - return e; - } - function Fjb(a, b, c2) { - var d, e; - d = Cdb(c2, yxe); - for (e = 0; Ddb(d, 0) != 0 && e < b; e++) { - d = Bdb(d, Cdb(a[e], yxe)); - a[e] = Ydb(d); - d = Tdb(d, 32); - } - return Ydb(d); - } - function pge(a, b) { - var c2, d, e, f2; - f2 = pke(a.e.Dh(), b); - c2 = RD(a.g, 124); - for (e = 0; e < a.i; ++e) { - d = c2[e]; - if (f2.am(d.Lk())) { - return false; - } - } - return true; + } + remaining = exprInfo.remaining; + if (remaining.match(/^\s*$/)) { + break; + } + } + var lastQ = self2[self2.length - 1]; + if (self2.currentSubject != null) { + lastQ.subject = self2.currentSubject; + } + lastQ.edgeCount = self2.edgeCount; + lastQ.compoundCount = self2.compoundCount; + for (var i2 = 0; i2 < self2.length; i2++) { + var q2 = self2[i2]; + if (q2.compoundCount > 0 && q2.edgeCount > 0) { + warn("The selector `" + selector + "` is invalid because it uses both a compound selector and an edge selector"); + return false; + } + if (q2.edgeCount > 1) { + warn("The selector `" + selector + "` is invalid because it uses multiple edge selectors"); + return false; + } else if (q2.edgeCount === 1) { + warn("The selector `" + selector + "` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes."); + } + } + return true; + }, "parse"); + toString3 = /* @__PURE__ */ __name(function toString4() { + if (this.toStringCache != null) { + return this.toStringCache; + } + var clean = /* @__PURE__ */ __name(function clean2(obj) { + if (obj == null) { + return ""; + } else { + return obj; + } + }, "clean"); + var cleanVal = /* @__PURE__ */ __name(function cleanVal2(val) { + if (string(val)) { + return '"' + val + '"'; + } else { + return clean(val); + } + }, "cleanVal"); + var space = /* @__PURE__ */ __name(function space2(val) { + return " " + val + " "; + }, "space"); + var checkToString = /* @__PURE__ */ __name(function checkToString2(check, subject) { + var type3 = check.type, value2 = check.value; + switch (type3) { + case Type3.GROUP: { + var group2 = clean(value2); + return group2.substring(0, group2.length - 1); + } + case Type3.DATA_COMPARE: { + var field = check.field, operator = check.operator; + return "[" + field + space(clean(operator)) + cleanVal(value2) + "]"; } - function QNd(a, b) { - var c2, d, e; - if (a.f > 0) { - a._j(); - d = b == null ? 0 : tb(b); - e = (d & lve) % a.d.length; - c2 = XNd(a, e, d, b); - return c2 != -1; - } else { - return false; - } + case Type3.DATA_BOOL: { + var _operator = check.operator, _field = check.field; + return "[" + clean(_operator) + _field + "]"; } - function Nrb(a, b) { - var c2, d; - a.a = Bdb(a.a, 1); - a.c = $wnd.Math.min(a.c, b); - a.b = $wnd.Math.max(a.b, b); - a.d += b; - c2 = b - a.f; - d = a.e + c2; - a.f = d - a.e - c2; - a.e = d; + case Type3.DATA_EXIST: { + var _field2 = check.field; + return "[" + _field2 + "]"; } - function yyd(a, b) { - switch (b) { - case 3: - Ayd(a, 0); - return; - case 4: - Cyd(a, 0); - return; - case 5: - Dyd(a, 0); - return; - case 6: - Eyd(a, 0); - return; - } - hyd(a, b); + case Type3.META_COMPARE: { + var _operator2 = check.operator, _field3 = check.field; + return "[[" + _field3 + space(clean(_operator2)) + cleanVal(value2) + "]]"; } - function c3b(a, b) { - switch (b.g) { - case 1: - return dr(a.j, (J3b(), E3b)); - case 2: - return dr(a.j, (J3b(), G3b)); - default: - return yob(), yob(), vob; - } + case Type3.STATE: { + return value2; } - function zm(a) { - tm(); - var b; - b = a.Pc(); - switch (b.length) { - case 0: - return sm; - case 1: - return new Dy(Qb(b[0])); - default: - return new Kx(Im(b)); - } + case Type3.ID: { + return "#" + value2; } - function kMd(b, c2) { - b.Xj(); - try { - b.d.bd(b.e++, c2); - b.f = b.d.j; - b.g = -1; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - throw Adb(new Jrb()); - } else - throw Adb(a); - } - } - function a8d() { - a8d = geb; - $7d = new b8d(); - T7d = new e8d(); - U7d = new h8d(); - V7d = new k8d(); - W7d = new n8d(); - X7d = new q8d(); - Y7d = new t8d(); - Z7d = new w8d(); - _7d = new z8d(); - } - function YA(a, b) { - WA(); - var c2, d; - c2 = _A(($A(), $A(), ZA)); - d = null; - b == c2 && (d = RD(Xjb(VA, a), 624)); - if (!d) { - d = new XA(a); - b == c2 && $jb(VA, a, d); - } - return d; - } - function zDc(a) { - wDc(); - var b; - (!a.q ? (yob(), yob(), wob) : a.q)._b((yCc(), iBc)) ? b = RD(mQb(a, iBc), 203) : b = RD(mQb(Y2b(a), jBc), 203); - return b; - } - function hFc(a, b) { - var c2, d; - d = null; - if (nQb(a, (yCc(), YBc))) { - c2 = RD(mQb(a, YBc), 96); - c2.pf(b) && (d = c2.of(b)); - } - d == null && (d = mQb(Y2b(a), b)); - return d; - } - function Ze(a, b) { - var c2, d, e; - if (ZD(b, 44)) { - c2 = RD(b, 44); - d = c2.ld(); - e = Xv(a.Rc(), d); - return Hb(e, c2.md()) && (e != null || a.Rc()._b(d)); - } - return false; + case Type3.CLASS: { + return "." + value2; } - function $Nd(a, b) { - var c2, d, e; - if (a.f > 0) { - a._j(); - d = b == null ? 0 : tb(b); - e = (d & lve) % a.d.length; - c2 = WNd(a, e, d, b); - if (c2) { - return c2.md(); - } - } - return null; + case Type3.PARENT: + case Type3.CHILD: { + return queryToString(check.parent, subject) + space(">") + queryToString(check.child, subject); } - function qLd(a, b, c2) { - var d, e, f2; - if (a.Pj()) { - d = a.i; - f2 = a.Qj(); - KHd(a, d, b); - e = a.Ij(3, null, b, d, f2); - !c2 ? c2 = e : c2.nj(e); - } else { - KHd(a, a.i, b); - } - return c2; - } - function f$d(a, b, c2) { - var d, e; - d = new P3d(a.e, 4, 10, (e = b.c, ZD(e, 90) ? RD(e, 29) : (JTd(), zTd)), null, fZd(a, b), false); - !c2 ? c2 = d : c2.nj(d); - return c2; - } - function e$d(a, b, c2) { - var d, e; - d = new P3d(a.e, 3, 10, null, (e = b.c, ZD(e, 90) ? RD(e, 29) : (JTd(), zTd)), fZd(a, b), false); - !c2 ? c2 = d : c2.nj(d); - return c2; - } - function SMb(a) { - RMb(); - var b; - b = new sjd(RD(a.e.of((umd(), nld)), 8)); - if (a.B.Hc((dqd(), Ypd))) { - b.a <= 0 && (b.a = 20); - b.b <= 0 && (b.b = 20); - } - return b; - } - function jjb(a) { - Pib(); - var b, c2; - c2 = Ydb(a); - b = Ydb(Udb(a, 32)); - if (b != 0) { - return new bjb(c2, b); - } - if (c2 > 10 || c2 < 0) { - return new ajb(1, c2); - } - return Lib[c2]; - } - function Mdb(a, b) { - var c2; - if (Kdb(a) && Kdb(b)) { - c2 = a % b; - if (jxe < c2 && c2 < hxe) { - return c2; - } - } - return Edb((iD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b, true), eD)); - } - function G8b(a, b) { - var c2; - D8b(b); - c2 = RD(mQb(a, (yCc(), xAc)), 283); - !!c2 && pQb(a, xAc, uuc(c2)); - E8b(a.c); - E8b(a.f); - F8b(a.d); - F8b(RD(mQb(a, cBc), 214)); - } - function y7b(a) { - var b, c2, d, e; - d = t7b(a); - _mb(d, r7b); - e = a.d; - e.c.length = 0; - for (c2 = new Anb(d); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 466); - Tmb(e, b.b); - } - } - function cmc(a) { - var b; - if (a.c == 0) { - return; - } - b = RD(Vmb(a.a, a.b), 294); - b.b == 1 ? (++a.b, a.b < a.a.c.length && gmc(RD(Vmb(a.a, a.b), 294))) : --b.b; - --a.c; + case Type3.ANCESTOR: + case Type3.DESCENDANT: { + return queryToString(check.ancestor, subject) + " " + queryToString(check.descendant, subject); } - function vdc(a) { - var b; - b = a.a; - do { - b = RD(hs(new is(Mr(a3b(b).a.Kc(), new ir()))), 18).d.i; - b.k == (r3b(), o3b) && Rmb(a.e, b); - } while (b.k == (r3b(), o3b)); - } - function RLc(a) { - this.e = $C(kE, Pwe, 28, a.length, 15, 1); - this.c = $C(xdb, Hye, 28, a.length, 16, 1); - this.b = $C(xdb, Hye, 28, a.length, 16, 1); - this.f = 0; - } - function _Hc(a) { - var b, c2; - a.j = $C(iE, vxe, 28, a.p.c.length, 15, 1); - for (c2 = new Anb(a.p); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - a.j[b.p] = b.o.b / a.i; - } - } - function L_c(a, b) { - var c2, d, e, f2; - f2 = b.b.b; - a.a = new Yub(); - a.b = $C(kE, Pwe, 28, f2, 15, 1); - c2 = 0; - for (e = Sub(b.b, 0); e.b != e.d.c; ) { - d = RD(evb(e), 40); - d.g = c2++; - } - } - function fad(a, b, c2) { - var d, e, f2, g; - f2 = b - a.e; - g = c2 - a.f; - for (e = new Anb(a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 172); - U9c(d, d.s + f2, d.t + g); - } - a.e = b; - a.f = c2; - } - function ose(a, b) { - var c2, d; - d = b.length; - for (c2 = 0; c2 < d; c2 += 2) - rte(a, (BFb(c2, b.length), b.charCodeAt(c2)), (BFb(c2 + 1, b.length), b.charCodeAt(c2 + 1))); - } - function G6c(a, b) { - b.Ug("Min Size Postprocessing", 1); - Ixd(a, (X6c(), W6c), $wnd.Math.max(Kfb(UD(Gxd(a, W6c))), Kfb(UD(Gxd(a, U6c))))); - b.Vg(); - } - function Fpd() { - Fpd = geb; - Cpd = new A3b(15); - Bpd = new mGd((umd(), tld), Cpd); - Epd = new mGd(fmd, 15); - Dpd = new mGd(Sld, sgb(0)); - Apd = new mGd(Dkd, Yze); - } - function Qpd() { - Qpd = geb; - Opd = new Rpd("PORTS", 0); - Ppd = new Rpd("PORT_LABELS", 1); - Npd = new Rpd("NODE_LABELS", 2); - Mpd = new Rpd("MINIMUM_SIZE", 3); - } - function f6c() { - f6c = geb; - c6c = new g6c("P1_WIDTH_APPROXIMATION", 0); - d6c = new g6c("P2_PACKING", 1); - e6c = new g6c("P3_WHITESPACE_ELIMINATION", 2); - } - function $je(a) { - if (a.b == null) { - while (a.a.Ob()) { - a.b = a.a.Pb(); - if (!RD(a.b, 54).Jh()) { - return true; - } - } - a.b = null; - return false; - } else { - return true; - } + case Type3.COMPOUND_SPLIT: { + var lhs = queryToString(check.left, subject); + var sub2 = queryToString(check.subject, subject); + var rhs = queryToString(check.right, subject); + return lhs + (lhs.length > 0 ? " " : "") + sub2 + rhs; } - function Pyb(a, b, c2) { - var d, e, f2; - e = null; - f2 = a.b; - while (f2) { - d = a.a.Ne(b, f2.d); - if (c2 && d == 0) { - return f2; - } - if (d >= 0) { - f2 = f2.a[1]; - } else { - e = f2; - f2 = f2.a[0]; - } - } - return e; + case Type3.TRUE: { + return ""; } - function Qyb(a, b, c2) { - var d, e, f2; - e = null; - f2 = a.b; - while (f2) { - d = a.a.Ne(b, f2.d); - if (c2 && d == 0) { - return f2; - } - if (d <= 0) { - f2 = f2.a[0]; - } else { - e = f2; - f2 = f2.a[1]; - } - } - return e; - } - function rmc(a, b, c2, d) { - var e, f2, g; - e = false; - if (Lmc(a.f, c2, d)) { - Omc(a.f, a.a[b][c2], a.a[b][d]); - f2 = a.a[b]; - g = f2[d]; - f2[d] = f2[c2]; - f2[c2] = g; - e = true; - } - return e; - } - function Nqc(a, b, c2) { - var d, e, f2, g; - e = RD(Wjb(a.b, c2), 183); - d = 0; - for (g = new Anb(b.j); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 113); - e[f2.d.p] && ++d; - } - return d; - } - function lte(a, b, c2) { - var d, e; - d = RD(Xjb(wse, b), 122); - e = RD(Xjb(xse, b), 122); - if (c2) { - $jb(wse, a, d); - $jb(xse, a, e); - } else { - $jb(xse, a, d); - $jb(wse, a, e); - } - } - function qjb(a, b) { - var c2, d, e, f2; - c2 = b >> 5; - b &= 31; - e = a.d + c2 + (b == 0 ? 0 : 1); - d = $C(kE, Pwe, 28, e, 15, 1); - rjb(d, a.a, c2, b); - f2 = new cjb(a.e, e, d); - Rib(f2); - return f2; - } - function zGc(a, b) { - var c2, d, e; - for (d = new is(Mr(a3b(a).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - e = c2.d.i; - if (e.c == b) { - return false; - } - } + } + }, "checkToString"); + var queryToString = /* @__PURE__ */ __name(function queryToString2(query2, subject) { + return query2.checks.reduce(function(str3, chk, i3) { + return str3 + (subject === query2 && i3 === 0 ? "$" : "") + checkToString(chk, subject); + }, ""); + }, "queryToString"); + var str2 = ""; + for (var i2 = 0; i2 < this.length; i2++) { + var query = this[i2]; + str2 += queryToString(query, query.subject); + if (this.length > 1 && i2 < this.length - 1) { + str2 += ", "; + } + } + this.toStringCache = str2; + return str2; + }, "toString"); + parse$1 = { + parse: parse3, + toString: toString3 + }; + valCmp = /* @__PURE__ */ __name(function valCmp2(fieldVal, operator, value2) { + var matches33; + var isFieldStr = string(fieldVal); + var isFieldNum = number$1(fieldVal); + var isValStr = string(value2); + var fieldStr, valStr; + var caseInsensitive = false; + var notExpr = false; + var isIneqCmp = false; + if (operator.indexOf("!") >= 0) { + operator = operator.replace("!", ""); + notExpr = true; + } + if (operator.indexOf("@") >= 0) { + operator = operator.replace("@", ""); + caseInsensitive = true; + } + if (isFieldStr || isValStr || caseInsensitive) { + fieldStr = !isFieldStr && !isFieldNum ? "" : "" + fieldVal; + valStr = "" + value2; + } + if (caseInsensitive) { + fieldVal = fieldStr = fieldStr.toLowerCase(); + value2 = valStr = valStr.toLowerCase(); + } + switch (operator) { + case "*=": + matches33 = fieldStr.indexOf(valStr) >= 0; + break; + case "$=": + matches33 = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0; + break; + case "^=": + matches33 = fieldStr.indexOf(valStr) === 0; + break; + case "=": + matches33 = fieldVal === value2; + break; + case ">": + isIneqCmp = true; + matches33 = fieldVal > value2; + break; + case ">=": + isIneqCmp = true; + matches33 = fieldVal >= value2; + break; + case "<": + isIneqCmp = true; + matches33 = fieldVal < value2; + break; + case "<=": + isIneqCmp = true; + matches33 = fieldVal <= value2; + break; + default: + matches33 = false; + break; + } + if (notExpr && (fieldVal != null || !isIneqCmp)) { + matches33 = !matches33; + } + return matches33; + }, "valCmp"); + boolCmp = /* @__PURE__ */ __name(function boolCmp2(fieldVal, operator) { + switch (operator) { + case "?": + return fieldVal ? true : false; + case "!": + return fieldVal ? false : true; + case "^": + return fieldVal === void 0; + } + }, "boolCmp"); + existCmp = /* @__PURE__ */ __name(function existCmp2(fieldVal) { + return fieldVal !== void 0; + }, "existCmp"); + data$1 = /* @__PURE__ */ __name(function data2(ele, field) { + return ele.data(field); + }, "data"); + meta = /* @__PURE__ */ __name(function meta2(ele, field) { + return ele[field](); + }, "meta"); + match = []; + matches$1 = /* @__PURE__ */ __name(function matches30(query, ele) { + return query.checks.every(function(chk) { + return match[chk.type](chk, ele); + }); + }, "matches"); + match[Type3.GROUP] = function(check, ele) { + var group2 = check.value; + return group2 === "*" || group2 === ele.group(); + }; + match[Type3.STATE] = function(check, ele) { + var stateSelector = check.value; + return stateSelectorMatches(stateSelector, ele); + }; + match[Type3.ID] = function(check, ele) { + var id26 = check.value; + return ele.id() === id26; + }; + match[Type3.CLASS] = function(check, ele) { + var cls = check.value; + return ele.hasClass(cls); + }; + match[Type3.META_COMPARE] = function(check, ele) { + var field = check.field, operator = check.operator, value2 = check.value; + return valCmp(meta(ele, field), operator, value2); + }; + match[Type3.DATA_COMPARE] = function(check, ele) { + var field = check.field, operator = check.operator, value2 = check.value; + return valCmp(data$1(ele, field), operator, value2); + }; + match[Type3.DATA_BOOL] = function(check, ele) { + var field = check.field, operator = check.operator; + return boolCmp(data$1(ele, field), operator); + }; + match[Type3.DATA_EXIST] = function(check, ele) { + var field = check.field; + check.operator; + return existCmp(data$1(ele, field)); + }; + match[Type3.UNDIRECTED_EDGE] = function(check, ele) { + var qA = check.nodes[0]; + var qB = check.nodes[1]; + var src = ele.source(); + var tgt = ele.target(); + return matches$1(qA, src) && matches$1(qB, tgt) || matches$1(qB, src) && matches$1(qA, tgt); + }; + match[Type3.NODE_NEIGHBOR] = function(check, ele) { + return matches$1(check.node, ele) && ele.neighborhood().some(function(n2) { + return n2.isNode() && matches$1(check.neighbor, n2); + }); + }; + match[Type3.DIRECTED_EDGE] = function(check, ele) { + return matches$1(check.source, ele.source()) && matches$1(check.target, ele.target()); + }; + match[Type3.NODE_SOURCE] = function(check, ele) { + return matches$1(check.source, ele) && ele.outgoers().some(function(n2) { + return n2.isNode() && matches$1(check.target, n2); + }); + }; + match[Type3.NODE_TARGET] = function(check, ele) { + return matches$1(check.target, ele) && ele.incomers().some(function(n2) { + return n2.isNode() && matches$1(check.source, n2); + }); + }; + match[Type3.CHILD] = function(check, ele) { + return matches$1(check.child, ele) && matches$1(check.parent, ele.parent()); + }; + match[Type3.PARENT] = function(check, ele) { + return matches$1(check.parent, ele) && ele.children().some(function(c3) { + return matches$1(check.child, c3); + }); + }; + match[Type3.DESCENDANT] = function(check, ele) { + return matches$1(check.descendant, ele) && ele.ancestors().some(function(a2) { + return matches$1(check.ancestor, a2); + }); + }; + match[Type3.ANCESTOR] = function(check, ele) { + return matches$1(check.ancestor, ele) && ele.descendants().some(function(d2) { + return matches$1(check.descendant, d2); + }); + }; + match[Type3.COMPOUND_SPLIT] = function(check, ele) { + return matches$1(check.subject, ele) && matches$1(check.left, ele) && matches$1(check.right, ele); + }; + match[Type3.TRUE] = function() { + return true; + }; + match[Type3.COLLECTION] = function(check, ele) { + var collection4 = check.value; + return collection4.has(ele); + }; + match[Type3.FILTER] = function(check, ele) { + var filter6 = check.value; + return filter6(ele); + }; + filter3 = /* @__PURE__ */ __name(function filter4(collection4) { + var self2 = this; + if (self2.length === 1 && self2[0].checks.length === 1 && self2[0].checks[0].type === Type3.ID) { + return collection4.getElementById(self2[0].checks[0].value).collection(); + } + var selectorFunction = /* @__PURE__ */ __name(function selectorFunction2(element3) { + for (var j2 = 0; j2 < self2.length; j2++) { + var query = self2[j2]; + if (matches$1(query, element3)) { return true; } - function _Ec(a, b, c2) { - var d, e, f2, g, h; - g = a.k; - h = b.k; - d = c2[g.g][h.g]; - e = UD(hFc(a, d)); - f2 = UD(hFc(b, d)); - return $wnd.Math.max((uFb(e), e), (uFb(f2), f2)); - } - function lA() { - if (Error.stackTraceLimit > 0) { - $wnd.Error.stackTraceLimit = Error.stackTraceLimit = 64; - return true; - } - return "stack" in new Error(); + } + return false; + }, "selectorFunction"); + if (self2.text() == null) { + selectorFunction = /* @__PURE__ */ __name(function selectorFunction2() { + return true; + }, "selectorFunction"); + } + return collection4.filter(selectorFunction); + }, "filter"); + matches31 = /* @__PURE__ */ __name(function matches32(ele) { + var self2 = this; + for (var j2 = 0; j2 < self2.length; j2++) { + var query = self2[j2]; + if (matches$1(query, ele)) { + return true; + } + } + return false; + }, "matches"); + matching = { + matches: matches31, + filter: filter3 + }; + Selector = /* @__PURE__ */ __name(function Selector2(selector) { + this.inputText = selector; + this.currentSubject = null; + this.compoundCount = 0; + this.edgeCount = 0; + this.length = 0; + if (selector == null || string(selector) && selector.match(/^\s*$/)) ; + else if (elementOrCollection(selector)) { + this.addQuery({ + checks: [{ + type: Type3.COLLECTION, + value: selector.collection() + }] + }); + } else if (fn$6(selector)) { + this.addQuery({ + checks: [{ + type: Type3.FILTER, + value: selector + }] + }); + } else if (string(selector)) { + if (!this.parse(selector)) { + this.invalid = true; + } + } else { + error("A selector must be created from a string; found "); + } + }, "Selector"); + selfn = Selector.prototype; + [parse$1, matching].forEach(function(p3) { + return extend2(selfn, p3); + }); + selfn.text = function() { + return this.inputText; + }; + selfn.size = function() { + return this.length; + }; + selfn.eq = function(i2) { + return this[i2]; + }; + selfn.sameText = function(otherSel) { + return !this.invalid && !otherSel.invalid && this.text() === otherSel.text(); + }; + selfn.addQuery = function(q2) { + this[this.length++] = q2; + }; + selfn.selector = selfn.toString; + elesfn$g = { + allAre: /* @__PURE__ */ __name(function allAre(selector) { + var selObj = new Selector(selector); + return this.every(function(ele) { + return selObj.matches(ele); + }); + }, "allAre"), + is: /* @__PURE__ */ __name(function is(selector) { + var selObj = new Selector(selector); + return this.some(function(ele) { + return selObj.matches(ele); + }); + }, "is"), + some: /* @__PURE__ */ __name(function some2(fn3, thisArg) { + for (var i2 = 0; i2 < this.length; i2++) { + var ret = !thisArg ? fn3(this[i2], i2, this) : fn3.apply(thisArg, [this[i2], i2, this]); + if (ret) { + return true; } - function sGb(a, b) { - return Zy(), Zy(), bz(pwe), ($wnd.Math.abs(a - b) <= pwe || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : cz(isNaN(a), isNaN(b))) > 0; + } + return false; + }, "some"), + every: /* @__PURE__ */ __name(function every2(fn3, thisArg) { + for (var i2 = 0; i2 < this.length; i2++) { + var ret = !thisArg ? fn3(this[i2], i2, this) : fn3.apply(thisArg, [this[i2], i2, this]); + if (!ret) { + return false; } - function uGb(a, b) { - return Zy(), Zy(), bz(pwe), ($wnd.Math.abs(a - b) <= pwe || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : cz(isNaN(a), isNaN(b))) < 0; + } + return true; + }, "every"), + same: /* @__PURE__ */ __name(function same(collection4) { + if (this === collection4) { + return true; + } + collection4 = this.cy().collection(collection4); + var thisLength = this.length; + var collectionLength = collection4.length; + if (thisLength !== collectionLength) { + return false; + } + if (thisLength === 1) { + return this[0] === collection4[0]; + } + return this.every(function(ele) { + return collection4.hasElementWithId(ele.id()); + }); + }, "same"), + anySame: /* @__PURE__ */ __name(function anySame(collection4) { + collection4 = this.cy().collection(collection4); + return this.some(function(ele) { + return collection4.hasElementWithId(ele.id()); + }); + }, "anySame"), + allAreNeighbors: /* @__PURE__ */ __name(function allAreNeighbors(collection4) { + collection4 = this.cy().collection(collection4); + var nhood = this.neighborhood(); + return collection4.every(function(ele) { + return nhood.hasElementWithId(ele.id()); + }); + }, "allAreNeighbors"), + contains: /* @__PURE__ */ __name(function contains3(collection4) { + collection4 = this.cy().collection(collection4); + var self2 = this; + return collection4.every(function(ele) { + return self2.hasElementWithId(ele.id()); + }); + }, "contains") + }; + elesfn$g.allAreNeighbours = elesfn$g.allAreNeighbors; + elesfn$g.has = elesfn$g.contains; + elesfn$g.equal = elesfn$g.equals = elesfn$g.same; + cache = /* @__PURE__ */ __name(function cache2(fn3, name) { + return /* @__PURE__ */ __name(function traversalCache(arg1, arg2, arg3, arg4) { + var selectorOrEles = arg1; + var eles = this; + var key; + if (selectorOrEles == null) { + key = ""; + } else if (elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) { + key = selectorOrEles.id(); + } + if (eles.length === 1 && key) { + var _p = eles[0]._private; + var tch = _p.traversalCache = _p.traversalCache || {}; + var ch = tch[name] = tch[name] || []; + var hash = hashString(key); + var cacheHit = ch[hash]; + if (cacheHit) { + return cacheHit; + } else { + return ch[hash] = fn3.call(eles, arg1, arg2, arg3, arg4); } - function tGb(a, b) { - return Zy(), Zy(), bz(pwe), ($wnd.Math.abs(a - b) <= pwe || a == b || isNaN(a) && isNaN(b) ? 0 : a < b ? -1 : a > b ? 1 : cz(isNaN(a), isNaN(b))) <= 0; + } else { + return fn3.call(eles, arg1, arg2, arg3, arg4); + } + }, "traversalCache"); + }, "cache"); + elesfn$f = { + parent: /* @__PURE__ */ __name(function parent(selector) { + var parents4 = []; + if (this.length === 1) { + var parent4 = this[0]._private.parent; + if (parent4) { + return parent4; } - function Efb(a, b) { - var c2 = 0; - while (!b[c2] || b[c2] == "") { - c2++; - } - var d = b[c2++]; - for (; c2 < b.length; c2++) { - if (!b[c2] || b[c2] == "") { - continue; - } - d += a + b[c2]; - } - return d; + } + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var _parent = ele._private.parent; + if (_parent) { + parents4.push(_parent); } - function MMd(a) { - var b, c2; - b = RD(Ywd(a.a, 4), 129); - if (b != null) { - c2 = $C(d6, IJe, 424, b.length, 0, 1); - hib(b, 0, c2, 0, b.length); - return c2; - } else { - return JMd; - } + } + return this.spawn(parents4, true).filter(selector); + }, "parent"), + parents: /* @__PURE__ */ __name(function parents3(selector) { + var parents4 = []; + var eles = this.parent(); + while (eles.nonempty()) { + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + parents4.push(ele); } - function kne(a) { - var b, c2, d, e, f2; - if (a == null) - return null; - f2 = new bnb(); - for (c2 = xAd(a), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Rmb(f2, nue(b, true)); - } - return f2; + eles = eles.parent(); + } + return this.spawn(parents4, true).filter(selector); + }, "parents"), + commonAncestors: /* @__PURE__ */ __name(function commonAncestors(selector) { + var ancestors; + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var parents4 = ele.parents(); + ancestors = ancestors || parents4; + ancestors = ancestors.intersect(parents4); + } + return ancestors.filter(selector); + }, "commonAncestors"), + orphans: /* @__PURE__ */ __name(function orphans(selector) { + return this.stdFilter(function(ele) { + return ele.isOrphan(); + }).filter(selector); + }, "orphans"), + nonorphans: /* @__PURE__ */ __name(function nonorphans(selector) { + return this.stdFilter(function(ele) { + return ele.isChild(); + }).filter(selector); + }, "nonorphans"), + children: cache(function(selector) { + var children2 = []; + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var eleChildren = ele._private.children; + for (var j2 = 0; j2 < eleChildren.length; j2++) { + children2.push(eleChildren[j2]); } - function nne(a) { - var b, c2, d, e, f2; - if (a == null) - return null; - f2 = new bnb(); - for (c2 = xAd(a), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Rmb(f2, nue(b, true)); + } + return this.spawn(children2, true).filter(selector); + }, "children"), + siblings: /* @__PURE__ */ __name(function siblings(selector) { + return this.parent().children().not(this).filter(selector); + }, "siblings"), + isParent: /* @__PURE__ */ __name(function isParent() { + var ele = this[0]; + if (ele) { + return ele.isNode() && ele._private.children.length !== 0; + } + }, "isParent"), + isChildless: /* @__PURE__ */ __name(function isChildless() { + var ele = this[0]; + if (ele) { + return ele.isNode() && ele._private.children.length === 0; + } + }, "isChildless"), + isChild: /* @__PURE__ */ __name(function isChild() { + var ele = this[0]; + if (ele) { + return ele.isNode() && ele._private.parent != null; + } + }, "isChild"), + isOrphan: /* @__PURE__ */ __name(function isOrphan() { + var ele = this[0]; + if (ele) { + return ele.isNode() && ele._private.parent == null; + } + }, "isOrphan"), + descendants: /* @__PURE__ */ __name(function descendants3(selector) { + var elements3 = []; + function add3(eles) { + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + elements3.push(ele); + if (ele.children().nonempty()) { + add3(ele.children()); } - return f2; } - function one2(a) { - var b, c2, d, e, f2; - if (a == null) - return null; - f2 = new bnb(); - for (c2 = xAd(a), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Rmb(f2, nue(b, true)); - } - return f2; + } + __name(add3, "add"); + add3(this.children()); + return this.spawn(elements3, true).filter(selector); + }, "descendants") + }; + __name(forEachCompound, "forEachCompound"); + __name(addChildren, "addChildren"); + elesfn$f.forEachDown = function(fn3) { + var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + return forEachCompound(this, fn3, includeSelf, addChildren); + }; + __name(addParent, "addParent"); + elesfn$f.forEachUp = function(fn3) { + var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + return forEachCompound(this, fn3, includeSelf, addParent); + }; + __name(addParentAndChildren, "addParentAndChildren"); + elesfn$f.forEachUpAndDown = function(fn3) { + var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + return forEachCompound(this, fn3, includeSelf, addParentAndChildren); + }; + elesfn$f.ancestors = elesfn$f.parents; + fn$5 = elesfn$e = { + data: define2.data({ + field: "data", + bindingEvent: "data", + allowBinding: true, + allowSetting: true, + settingEvent: "data", + settingTriggersEvent: true, + triggerFnName: "trigger", + allowGetting: true, + immutableKeys: { + "id": true, + "source": true, + "target": true, + "parent": true + }, + updateStyle: true + }), + removeData: define2.removeData({ + field: "data", + event: "data", + triggerFnName: "trigger", + triggerEvent: true, + immutableKeys: { + "id": true, + "source": true, + "target": true, + "parent": true + }, + updateStyle: true + }), + scratch: define2.data({ + field: "scratch", + bindingEvent: "scratch", + allowBinding: true, + allowSetting: true, + settingEvent: "scratch", + settingTriggersEvent: true, + triggerFnName: "trigger", + allowGetting: true, + updateStyle: true + }), + removeScratch: define2.removeData({ + field: "scratch", + event: "scratch", + triggerFnName: "trigger", + triggerEvent: true, + updateStyle: true + }), + rscratch: define2.data({ + field: "rscratch", + allowBinding: false, + allowSetting: true, + settingTriggersEvent: false, + allowGetting: true + }), + removeRscratch: define2.removeData({ + field: "rscratch", + triggerEvent: false + }), + id: /* @__PURE__ */ __name(function id21() { + var ele = this[0]; + if (ele) { + return ele._private.data.id; + } + }, "id") + }; + fn$5.attr = fn$5.data; + fn$5.removeAttr = fn$5.removeData; + data3 = elesfn$e; + elesfn$d = {}; + __name(defineDegreeFunction, "defineDegreeFunction"); + extend2(elesfn$d, { + degree: defineDegreeFunction(function(node2, edge) { + if (edge.source().same(edge.target())) { + return 2; + } else { + return 1; + } + }), + indegree: defineDegreeFunction(function(node2, edge) { + if (edge.target().same(node2)) { + return 1; + } else { + return 0; + } + }), + outdegree: defineDegreeFunction(function(node2, edge) { + if (edge.source().same(node2)) { + return 1; + } else { + return 0; + } + }) + }); + __name(defineDegreeBoundsFunction, "defineDegreeBoundsFunction"); + extend2(elesfn$d, { + minDegree: defineDegreeBoundsFunction("degree", function(degree, min9) { + return degree < min9; + }), + maxDegree: defineDegreeBoundsFunction("degree", function(degree, max10) { + return degree > max10; + }), + minIndegree: defineDegreeBoundsFunction("indegree", function(degree, min9) { + return degree < min9; + }), + maxIndegree: defineDegreeBoundsFunction("indegree", function(degree, max10) { + return degree > max10; + }), + minOutdegree: defineDegreeBoundsFunction("outdegree", function(degree, min9) { + return degree < min9; + }), + maxOutdegree: defineDegreeBoundsFunction("outdegree", function(degree, max10) { + return degree > max10; + }) + }); + extend2(elesfn$d, { + totalDegree: /* @__PURE__ */ __name(function totalDegree(includeLoops) { + var total = 0; + var nodes6 = this.nodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + total += nodes6[i2].degree(includeLoops); + } + return total; + }, "totalDegree") + }); + beforePositionSet = /* @__PURE__ */ __name(function beforePositionSet2(eles, newPos, silent) { + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + if (!ele.locked()) { + var oldPos = ele._private.position; + var delta = { + x: newPos.x != null ? newPos.x - oldPos.x : 0, + y: newPos.y != null ? newPos.y - oldPos.y : 0 + }; + if (ele.isParent() && !(delta.x === 0 && delta.y === 0)) { + ele.children().shift(delta, silent); } - function vrd(a, b) { - var c2, d, e; - if (a.c) { - Ayd(a.c, b); - } else { - c2 = b - trd(a); - for (e = new Anb(a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 163); - vrd(d, trd(d) + c2); - } - } + ele.dirtyBoundingBoxCache(); + } + } + }, "beforePositionSet"); + positionDef = { + field: "position", + bindingEvent: "position", + allowBinding: true, + allowSetting: true, + settingEvent: "position", + settingTriggersEvent: true, + triggerFnName: "emitAndNotify", + allowGetting: true, + validKeys: ["x", "y"], + beforeGet: /* @__PURE__ */ __name(function beforeGet(ele) { + ele.updateCompoundBounds(); + }, "beforeGet"), + beforeSet: /* @__PURE__ */ __name(function beforeSet(eles, newPos) { + beforePositionSet(eles, newPos, false); + }, "beforeSet"), + onSet: /* @__PURE__ */ __name(function onSet(eles) { + eles.dirtyCompoundBoundsCache(); + }, "onSet"), + canSet: /* @__PURE__ */ __name(function canSet(ele) { + return !ele.locked(); + }, "canSet") + }; + fn$4 = elesfn$c = { + position: define2.data(positionDef), + // position but no notification to renderer + silentPosition: define2.data(extend2({}, positionDef, { + allowBinding: false, + allowSetting: true, + settingTriggersEvent: false, + allowGetting: false, + beforeSet: /* @__PURE__ */ __name(function beforeSet2(eles, newPos) { + beforePositionSet(eles, newPos, true); + }, "beforeSet"), + onSet: /* @__PURE__ */ __name(function onSet2(eles) { + eles.dirtyCompoundBoundsCache(); + }, "onSet") + })), + positions: /* @__PURE__ */ __name(function positions(pos, silent) { + if (plainObject(pos)) { + if (silent) { + this.silentPosition(pos); + } else { + this.position(pos); } - function wrd(a, b) { - var c2, d, e; - if (a.c) { - Cyd(a.c, b); - } else { - c2 = b - urd(a); - for (e = new Anb(a.d); e.a < e.c.c.length; ) { - d = RD(ynb(e), 163); - wrd(d, urd(d) + c2); + } else if (fn$6(pos)) { + var _fn = pos; + var cy = this.cy(); + cy.startBatch(); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var _pos = void 0; + if (_pos = _fn(ele, i2)) { + if (silent) { + ele.silentPosition(_pos); + } else { + ele.position(_pos); } } } - function Ihb(a, b, c2) { - var d, e, f2, g; - f2 = b + c2; - AFb(b, f2, a.length); - g = ""; - for (e = b; e < f2; ) { - d = $wnd.Math.min(e + 1e4, f2); - g += Ehb(a.slice(e, d)); - e = d; - } - return g; - } - function jMb(a) { - switch (a.g) { - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - return true; - default: - return false; + cy.endBatch(); + } + return this; + }, "positions"), + silentPositions: /* @__PURE__ */ __name(function silentPositions(pos) { + return this.positions(pos, true); + }, "silentPositions"), + shift: /* @__PURE__ */ __name(function shift(dim, val, silent) { + var delta; + if (plainObject(dim)) { + delta = { + x: number$1(dim.x) ? dim.x : 0, + y: number$1(dim.y) ? dim.y : 0 + }; + silent = val; + } else if (string(dim) && number$1(val)) { + delta = { + x: 0, + y: 0 + }; + delta[dim] = val; + } + if (delta != null) { + var cy = this.cy(); + cy.startBatch(); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + if (cy.hasCompoundNodes() && ele.isChild() && ele.ancestors().anySame(this)) { + continue; } - } - function Ptc() { - Ptc = geb; - Ltc = new Rtc(CBe, 0); - Ktc = new Rtc(DBe, 1); - Ntc = new Rtc(BBe, 2); - Otc = new Rtc(MAe, 3); - Mtc = new Rtc("GREEDY_MODEL_ORDER", 4); - } - function kEc() { - kEc = geb; - hEc = new lEc(LAe, 0); - gEc = new lEc("NODES_AND_EDGES", 1); - iEc = new lEc("PREFER_EDGES", 2); - jEc = new lEc("PREFER_NODES", 3); - } - function mad(a, b, c2, d, e, f2) { - this.a = a; - this.c = b; - this.b = c2; - this.f = d; - this.d = e; - this.e = f2; - this.c > 0 && this.b > 0 && (this.g = Aad(this.c, this.b, this.a)); - } - function rC(f2, a) { - var b = f2.a; - var c2; - a = String(a); - b.hasOwnProperty(a) && (c2 = b[a]); - var d = (HC(), GC)[typeof c2]; - var e = d ? d(c2) : NC(typeof c2); - return e; - } - function uDd(a) { - var b, c2, d; - d = null; - b = uIe in a.a; - c2 = !b; - if (c2) { - throw Adb(new CDd("Every element must have an id.")); - } - d = tDd(qC(a, uIe)); - return d; - } - function Qqe(a) { - var b, c2; - c2 = Rqe(a); - b = null; - while (a.c == 2) { - Mqe(a); - if (!b) { - b = (Vse(), Vse(), new iue(2)); - hue2(b, c2); - c2 = b; - } - c2.Jm(Rqe(a)); - } - return c2; - } - function jOd(a, b) { - var c2, d, e; - a._j(); - d = b == null ? 0 : tb(b); - e = (d & lve) % a.d.length; - c2 = WNd(a, e, d, b); - if (c2) { - hOd(a, c2); - return c2.md(); + var pos = ele.position(); + var newPos = { + x: pos.x + delta.x, + y: pos.y + delta.y + }; + if (silent) { + ele.silentPosition(newPos); } else { - return null; - } - } - function Qib(a, b) { - if (a.e > b.e) { - return 1; - } - if (a.e < b.e) { - return -1; - } - if (a.d > b.d) { - return a.e; - } - if (a.d < b.d) { - return -b.e; - } - return a.e * Ejb(a.a, b.a, a.d); - } - function dfb(a) { - if (a >= 48 && a < 48 + $wnd.Math.min(10, 10)) { - return a - 48; - } - if (a >= 97 && a < 97) { - return a - 97 + 10; - } - if (a >= 65 && a < 65) { - return a - 65 + 10; - } - return -1; - } - function UHc(a, b) { - if (b.c == a) { - return b.d; - } else if (b.d == a) { - return b.c; + ele.position(newPos); } - throw Adb(new agb("Input edge is not connected to the input port.")); } - function Fae(a) { - if (mhb(FGe, a)) { - return Geb(), Feb; - } else if (mhb(GGe, a)) { - return Geb(), Eeb; - } else { - throw Adb(new agb("Expecting true or false")); - } - } - function jFb(a) { - switch (typeof a) { - case jve: - return ohb(a); - case ive: - return Nfb(a); - case hve: - return Jeb(a); - default: - return a == null ? 0 : kFb(a); - } - } - function mfd(a, b) { - if (a.a < 0) { - throw Adb(new dgb("Did not call before(...) or after(...) before calling add(...).")); - } - tfd(a, a.a, b); - return a; - } - function FId(a) { - EId(); - if (ZD(a, 162)) { - return RD(Wjb(CId, zK), 295).Rg(a); - } - if (Ujb(CId, rb(a))) { - return RD(Wjb(CId, rb(a)), 295).Rg(a); - } - return null; - } - function Wwd(a) { - var b, c2; - if ((a.Db & 32) == 0) { - c2 = (b = RD(Ywd(a, 16), 29), AYd(!b ? a.ii() : b) - AYd(a.ii())); - c2 != 0 && $wd(a, 32, $C(jJ, rve, 1, c2, 5, 1)); - } - return a; - } - function $wd(a, b, c2) { - var d; - if ((a.Db & b) != 0) { - if (c2 == null) { - Zwd(a, b); - } else { - d = Xwd(a, b); - d == -1 ? a.Eb = c2 : bD(SD(a.Eb), d, c2); + cy.endBatch(); + } + return this; + }, "shift"), + silentShift: /* @__PURE__ */ __name(function silentShift(dim, val) { + if (plainObject(dim)) { + this.shift(dim, true); + } else if (string(dim) && number$1(val)) { + this.shift(dim, val, true); + } + return this; + }, "silentShift"), + // get/set the rendered (i.e. on screen) positon of the element + renderedPosition: /* @__PURE__ */ __name(function renderedPosition(dim, val) { + var ele = this[0]; + var cy = this.cy(); + var zoom2 = cy.zoom(); + var pan2 = cy.pan(); + var rpos = plainObject(dim) ? dim : void 0; + var setting = rpos !== void 0 || val !== void 0 && string(dim); + if (ele && ele.isNode()) { + if (setting) { + for (var i2 = 0; i2 < this.length; i2++) { + var _ele = this[i2]; + if (val !== void 0) { + _ele.position(dim, (val - pan2[dim]) / zoom2); + } else if (rpos !== void 0) { + _ele.position(renderedToModelPosition(rpos, zoom2, pan2)); } - } else - c2 != null && Twd(a, b, c2); - } - function tTc(a, b, c2, d) { - var e, f2; - if (b.c.length == 0) { - return; } - e = pTc(c2, d); - f2 = oTc(b); - FDb(PDb(new SDb(null, new Swb(f2, 1)), new CTc()), new GTc(a, c2, e, d)); - } - function rmb(a, b) { - var c2, d, e, f2; - d = a.a.length - 1; - c2 = b - a.b & d; - f2 = a.c - b & d; - e = a.c - a.b & d; - zmb(c2 < e); - if (c2 >= f2) { - umb(a, b); - return -1; + } else { + var pos = ele.position(); + rpos = modelToRenderedPosition(pos, zoom2, pan2); + if (dim === void 0) { + return rpos; } else { - vmb(a, b); - return 1; - } - } - function Hvd(a) { - var b, c2, d; - d = a.Jh(); - if (!d) { - b = 0; - for (c2 = a.Ph(); c2; c2 = c2.Ph()) { - if (++b > wxe) { - return c2.Qh(); - } - d = c2.Jh(); - if (!!d || c2 == a) { - break; - } - } + return rpos[dim]; } - return d; } - function Ue(a, b) { - var c2; - if (dE(b) === dE(a)) { - return true; + } else if (!setting) { + return void 0; + } + return this; + }, "renderedPosition"), + // get/set the position relative to the parent + relativePosition: /* @__PURE__ */ __name(function relativePosition(dim, val) { + var ele = this[0]; + var cy = this.cy(); + var ppos = plainObject(dim) ? dim : void 0; + var setting = ppos !== void 0 || val !== void 0 && string(dim); + var hasCompoundNodes2 = cy.hasCompoundNodes(); + if (ele && ele.isNode()) { + if (setting) { + for (var i2 = 0; i2 < this.length; i2++) { + var _ele2 = this[i2]; + var parent4 = hasCompoundNodes2 ? _ele2.parent() : null; + var hasParent = parent4 && parent4.length > 0; + var relativeToParent = hasParent; + if (hasParent) { + parent4 = parent4[0]; + } + var origin = relativeToParent ? parent4.position() : { + x: 0, + y: 0 + }; + if (val !== void 0) { + _ele2.position(dim, val + origin[dim]); + } else if (ppos !== void 0) { + _ele2.position({ + x: ppos.x + origin.x, + y: ppos.y + origin.y + }); + } } - if (!ZD(b, 21)) { - return false; + } else { + var pos = ele.position(); + var _parent = hasCompoundNodes2 ? ele.parent() : null; + var _hasParent = _parent && _parent.length > 0; + var _relativeToParent = _hasParent; + if (_hasParent) { + _parent = _parent[0]; } - c2 = RD(b, 21); - if (c2.gc() != a.gc()) { - return false; + var _origin = _relativeToParent ? _parent.position() : { + x: 0, + y: 0 + }; + ppos = { + x: pos.x - _origin.x, + y: pos.y - _origin.y + }; + if (dim === void 0) { + return ppos; + } else { + return ppos[dim]; } - return a.Ic(c2); } - function kNc(a, b) { - if (a.e < b.e) { - return -1; - } else if (a.e > b.e) { - return 1; - } else if (a.f < b.f) { - return -1; - } else if (a.f > b.f) { - return 1; - } - return tb(a) - tb(b); + } else if (!setting) { + return void 0; + } + return this; + }, "relativePosition") + }; + fn$4.modelPosition = fn$4.point = fn$4.position; + fn$4.modelPositions = fn$4.points = fn$4.positions; + fn$4.renderedPoint = fn$4.renderedPosition; + fn$4.relativePoint = fn$4.relativePosition; + position2 = elesfn$c; + fn$3 = elesfn$b = {}; + elesfn$b.renderedBoundingBox = function(options3) { + var bb = this.boundingBox(options3); + var cy = this.cy(); + var zoom2 = cy.zoom(); + var pan2 = cy.pan(); + var x1 = bb.x1 * zoom2 + pan2.x; + var x22 = bb.x2 * zoom2 + pan2.x; + var y1 = bb.y1 * zoom2 + pan2.y; + var y22 = bb.y2 * zoom2 + pan2.y; + return { + x1, + x2: x22, + y1, + y2: y22, + w: x22 - x1, + h: y22 - y1 + }; + }; + elesfn$b.dirtyCompoundBoundsCache = function() { + var silent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var cy = this.cy(); + if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { + return this; + } + this.forEachUp(function(ele) { + if (ele.isParent()) { + var _p = ele._private; + _p.compoundBoundsClean = false; + _p.bbCache = null; + if (!silent) { + ele.emitAndNotify("bounds"); } - function mhb(a, b) { - uFb(a); - if (b == null) { - return false; - } - if (lhb(a, b)) { - return true; - } - return a.length == b.length && lhb(a.toLowerCase(), b.toLowerCase()); - } - function Hgb(a) { - var b, c2; - if (Ddb(a, -129) > 0 && Ddb(a, 128) < 0) { - return Jgb(), b = Ydb(a) + 128, c2 = Igb[b], !c2 && (c2 = Igb[b] = new zgb(a)), c2; - } - return new zgb(a); - } - function U$b() { - U$b = geb; - T$b = new V$b(LAe, 0); - R$b = new V$b("INSIDE_PORT_SIDE_GROUPS", 1); - Q$b = new V$b("GROUP_MODEL_ORDER", 2); - S$b = new V$b(MAe, 3); - } - function ufe(a) { - var b; - a.b || vfe(a, (b = Hee(a.e, a.a), !b || !lhb(GGe, $Nd((!b.b && (b.b = new SVd((JTd(), FTd), C8, b)), b.b), "qualified")))); - return a.c; - } - function BA(a, b) { - var c2, d; - c2 = (BFb(b, a.length), a.charCodeAt(b)); - d = b + 1; - while (d < a.length && (BFb(d, a.length), a.charCodeAt(d) == c2)) { - ++d; - } - return d - b; - } - function dFb(a, b) { - (!b && console.groupCollapsed != null ? console.groupCollapsed : console.group != null ? console.group : console.log).call(console, a); - } - function EQb(a, b, c2, d) { - d == a ? (RD(c2.b, 68), RD(c2.b, 68), RD(d.b, 68), RD(d.b, 68).c.b) : (RD(c2.b, 68), RD(c2.b, 68), RD(d.b, 68), RD(d.b, 68).c.b); - BQb(d, b, a); - } - function vRb(a) { - var c2, d; - for (c2 = new Anb(a.g); c2.a < c2.c.c.length; ) { - RD(ynb(c2), 568); - } - d = new vQb(a.g, Kfb(a.a), a.c); - vOb(d); - a.g = d.b; - a.d = d.a; - } - function Add(a, b, c2) { - var d, e, f2; - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 225); - d = new $Fb(RD(Wjb(a.a, e.b), 68)); - Rmb(b.a, d); - Add(a, d, e); - } - } - function D4d(a, b, c2) { - var d, e, f2; - d = RD(QHd(o4d(a.a), b), 89); - f2 = (e = d.c, e ? e : (JTd(), wTd)); - (f2.Vh() ? Vvd(a.b, RD(f2, 54)) : f2) == c2 ? i2d(d) : l2d(d, c2); - return f2; - } - function cqc(a, b, c2) { - b.b = $wnd.Math.max(b.b, -c2.a); - b.c = $wnd.Math.max(b.c, c2.a - a.a); - b.d = $wnd.Math.max(b.d, -c2.b); - b.a = $wnd.Math.max(b.a, c2.b - a.b); - } - function JXb(a, b, c2) { - this.c = a; - this.f = new bnb(); - this.e = new pjd(); - this.j = new KYb(); - this.n = new KYb(); - this.b = b; - this.g = new Uid2(b.c, b.d, b.b, b.a); - this.a = c2; - } - function iYb(a) { - var b, c2, d, e; - this.a = new Iub(); - this.d = new _sb(); - this.e = 0; - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !this.f && (this.f = b); - gYb(this, b); - } - } - function djb(a) { - Pib(); - if (a.length == 0) { - this.e = 0; - this.d = 1; - this.a = cD(WC(kE, 1), Pwe, 28, 15, [0]); - } else { - this.e = 1; - this.d = a.length; - this.a = a; - Rib(this); - } - } - function dLb(a, b, c2) { - fKb.call(this); - this.a = $C(IN, Mye, 217, (ZJb(), cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb])).length, 0, 1); - this.b = a; - this.d = b; - this.c = c2; - } - function zfc(a) { - var b, c2, d, e, f2, g; - g = RD(mQb(a, (Ywc(), Awc)), 12); - pQb(g, Swc, a.i.n.b); - b = s2b(a.e); - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - Z0b(c2, g); - } - } - function Afc(a) { - var b, c2, d, e, f2, g; - c2 = RD(mQb(a, (Ywc(), Awc)), 12); - pQb(c2, Swc, a.i.n.b); - b = s2b(a.g); - for (e = b, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - Y0b(d, c2); - } - } - function dRc(a, b) { - WQc(); - var c2, d; - for (d = new is(Mr(W2b(a).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - if (c2.d.i == b || c2.c.i == b) { - return c2; - } - } - return null; + } + }); + return this; + }; + elesfn$b.updateCompoundBounds = function() { + var force = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var cy = this.cy(); + if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { + return this; + } + if (!force && cy.batching()) { + return this; + } + function update2(parent4) { + if (!parent4.isParent()) { + return; + } + var _p2 = parent4._private; + var children2 = parent4.children(); + var includeLabels = parent4.pstyle("compound-sizing-wrt-labels").value === "include"; + var min9 = { + width: { + val: parent4.pstyle("min-width").pfValue, + left: parent4.pstyle("min-width-bias-left"), + right: parent4.pstyle("min-width-bias-right") + }, + height: { + val: parent4.pstyle("min-height").pfValue, + top: parent4.pstyle("min-height-bias-top"), + bottom: parent4.pstyle("min-height-bias-bottom") } - function zee(a, b) { - var c2, d; - c2 = b.qi(a.a); - if (c2) { - d = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), GIe)); - if (d != null) { - return d; - } - } - return b.xe(); - } - function Aee(a, b) { - var c2, d; - c2 = b.qi(a.a); - if (c2) { - d = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), GIe)); - if (d != null) { - return d; - } - } - return b.xe(); - } - function B7b(a, b) { - var c2, d; - c2 = hgb(a.a.c.p, b.a.c.p); - if (c2 != 0) { - return c2; - } - d = hgb(a.a.d.i.p, b.a.d.i.p); - if (d != 0) { - return d; - } - return hgb(b.a.d.p, a.a.d.p); - } - function Wje(a, b) { - var c2, d, e, f2; - for (d = 0, e = b.gc(); d < e; ++d) { - c2 = b.Tl(d); - if (ZD(c2, 102) && (RD(c2, 19).Bb & QHe) != 0) { - f2 = b.Ul(d); - f2 != null && Rje(a, RD(f2, 58)); - } - } - } - function KSb(a, b) { - var c2, d, e; - Rmb(GSb, a); - b.Fc(a); - c2 = RD(Wjb(FSb, a), 21); - if (c2) { - for (e = c2.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 27); - Wmb(GSb, d, 0) != -1 || KSb(d, b); - } - } - } - function Omc(a, b, c2) { - var d, e; - BMc(a.e, b, c2, (qpd(), ppd)); - BMc(a.i, b, c2, Xod); - if (a.a) { - e = RD(mQb(b, (Ywc(), Awc)), 12); - d = RD(mQb(c2, Awc), 12); - CMc(a.g, e, d); - } - } - function mJc(a, b, c2) { - var d, e, f2; - d = b.c.p; - f2 = b.p; - a.b[d][f2] = new yJc(a, b); - if (c2) { - a.a[d][f2] = new dJc(b); - e = RD(mQb(b, (Ywc(), pwc)), 10); - !!e && Rc(a.d, e, b); - } - } - function zIc(a, b, c2) { - var d, e, f2, g; - f2 = b.j; - g = c2.j; - if (f2 != g) { - return f2.g - g.g; - } else { - d = a.f[b.p]; - e = a.f[c2.p]; - return d == 0 && e == 0 ? 0 : d == 0 ? -1 : e == 0 ? 1 : Qfb(d, e); - } + }; + var bb = children2.boundingBox({ + includeLabels, + includeOverlays: false, + // updating the compound bounds happens outside of the regular + // cache cycle (i.e. before fired events) + useCache: false + }); + var pos = _p2.position; + if (bb.w === 0 || bb.h === 0) { + bb = { + w: parent4.pstyle("width").pfValue, + h: parent4.pstyle("height").pfValue + }; + bb.x1 = pos.x - bb.w / 2; + bb.x2 = pos.x + bb.w / 2; + bb.y1 = pos.y - bb.h / 2; + bb.y2 = pos.y + bb.h / 2; + } + function computeBiasValues(propDiff, propBias, propBiasComplement) { + var biasDiff = 0; + var biasComplementDiff = 0; + var biasTotal = propBias + propBiasComplement; + if (propDiff > 0 && biasTotal > 0) { + biasDiff = propBias / biasTotal * propDiff; + biasComplementDiff = propBiasComplement / biasTotal * propDiff; } - function Sz() { - var a; - if (Nz != 0) { - a = Date.now(); - if (a - Oz > 2e3) { - Oz = a; - Pz = $wnd.setTimeout(Yz, 10); - } - } - if (Nz++ == 0) { - _z(($z(), Zz)); - return true; + return { + biasDiff, + biasComplementDiff + }; + } + __name(computeBiasValues, "computeBiasValues"); + function computePaddingValues(width3, height2, paddingObject, relativeTo) { + if (paddingObject.units === "%") { + switch (relativeTo) { + case "width": + return width3 > 0 ? paddingObject.pfValue * width3 : 0; + case "height": + return height2 > 0 ? paddingObject.pfValue * height2 : 0; + case "average": + return width3 > 0 && height2 > 0 ? paddingObject.pfValue * (width3 + height2) / 2 : 0; + case "min": + return width3 > 0 && height2 > 0 ? width3 > height2 ? paddingObject.pfValue * height2 : paddingObject.pfValue * width3 : 0; + case "max": + return width3 > 0 && height2 > 0 ? width3 > height2 ? paddingObject.pfValue * width3 : paddingObject.pfValue * height2 : 0; + default: + return 0; } - return false; - } - function lBb(a, b, c2) { - var d; - (bBb ? (jBb(a), true) : cBb ? (SAb(), true) : fBb ? (SAb(), true) : eBb && (SAb(), false)) && (d = new aBb(b), d.b = c2, hBb(a, d), void 0); + } else if (paddingObject.units === "px") { + return paddingObject.pfValue; + } else { + return 0; } - function oNb(a, b) { - var c2; - c2 = !a.A.Hc((Qpd(), Ppd)) || a.q == (Bod(), wod); - a.u.Hc((Pod(), Lod)) ? c2 ? mNb(a, b) : qNb(a, b) : a.u.Hc(Nod) && (c2 ? nNb(a, b) : rNb(a, b)); + } + __name(computePaddingValues, "computePaddingValues"); + var leftVal = min9.width.left.value; + if (min9.width.left.units === "px" && min9.width.val > 0) { + leftVal = leftVal * 100 / min9.width.val; + } + var rightVal = min9.width.right.value; + if (min9.width.right.units === "px" && min9.width.val > 0) { + rightVal = rightVal * 100 / min9.width.val; + } + var topVal = min9.height.top.value; + if (min9.height.top.units === "px" && min9.height.val > 0) { + topVal = topVal * 100 / min9.height.val; + } + var bottomVal = min9.height.bottom.value; + if (min9.height.bottom.units === "px" && min9.height.val > 0) { + bottomVal = bottomVal * 100 / min9.height.val; + } + var widthBiasDiffs = computeBiasValues(min9.width.val - bb.w, leftVal, rightVal); + var diffLeft = widthBiasDiffs.biasDiff; + var diffRight = widthBiasDiffs.biasComplementDiff; + var heightBiasDiffs = computeBiasValues(min9.height.val - bb.h, topVal, bottomVal); + var diffTop = heightBiasDiffs.biasDiff; + var diffBottom = heightBiasDiffs.biasComplementDiff; + _p2.autoPadding = computePaddingValues(bb.w, bb.h, parent4.pstyle("padding"), parent4.pstyle("padding-relative-to").value); + _p2.autoWidth = Math.max(bb.w, min9.width.val); + pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2; + _p2.autoHeight = Math.max(bb.h, min9.height.val); + pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2; + } + __name(update2, "update"); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var _p = ele._private; + if (!_p.compoundBoundsClean || force) { + update2(ele); + if (!cy.batching()) { + _p.compoundBoundsClean = true; } - function Bed(a) { - var b; - if (dE(Gxd(a, (umd(), Xkd))) === dE((Fnd(), Dnd))) { - if (!vCd(a)) { - Ixd(a, Xkd, End); - } else { - b = RD(Gxd(vCd(a), Xkd), 346); - Ixd(a, Xkd, b); - } - } + } + } + return this; + }; + noninf = /* @__PURE__ */ __name(function noninf2(x5) { + if (x5 === Infinity || x5 === -Infinity) { + return 0; + } + return x5; + }, "noninf"); + updateBounds = /* @__PURE__ */ __name(function updateBounds2(b2, x1, y1, x22, y22) { + if (x22 - x1 === 0 || y22 - y1 === 0) { + return; + } + if (x1 == null || y1 == null || x22 == null || y22 == null) { + return; + } + b2.x1 = x1 < b2.x1 ? x1 : b2.x1; + b2.x2 = x22 > b2.x2 ? x22 : b2.x2; + b2.y1 = y1 < b2.y1 ? y1 : b2.y1; + b2.y2 = y22 > b2.y2 ? y22 : b2.y2; + b2.w = b2.x2 - b2.x1; + b2.h = b2.y2 - b2.y1; + }, "updateBounds"); + updateBoundsFromBox = /* @__PURE__ */ __name(function updateBoundsFromBox2(b2, b22) { + if (b22 == null) { + return b2; + } + return updateBounds(b2, b22.x1, b22.y1, b22.x2, b22.y2); + }, "updateBoundsFromBox"); + prefixedProperty = /* @__PURE__ */ __name(function prefixedProperty2(obj, field, prefix) { + return getPrefixedProperty(obj, field, prefix); + }, "prefixedProperty"); + updateBoundsFromArrow = /* @__PURE__ */ __name(function updateBoundsFromArrow2(bounds4, ele, prefix) { + if (ele.cy().headless()) { + return; + } + var _p = ele._private; + var rstyle = _p.rstyle; + var halfArW = rstyle.arrowWidth / 2; + var arrowType = ele.pstyle(prefix + "-arrow-shape").value; + var x5; + var y5; + if (arrowType !== "none") { + if (prefix === "source") { + x5 = rstyle.srcX; + y5 = rstyle.srcY; + } else if (prefix === "target") { + x5 = rstyle.tgtX; + y5 = rstyle.tgtY; + } else { + x5 = rstyle.midX; + y5 = rstyle.midY; + } + var bbs = _p.arrowBounds = _p.arrowBounds || {}; + var bb = bbs[prefix] = bbs[prefix] || {}; + bb.x1 = x5 - halfArW; + bb.y1 = y5 - halfArW; + bb.x2 = x5 + halfArW; + bb.y2 = y5 + halfArW; + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + expandBoundingBox(bb, 1); + updateBounds(bounds4, bb.x1, bb.y1, bb.x2, bb.y2); + } + }, "updateBoundsFromArrow"); + updateBoundsFromLabel = /* @__PURE__ */ __name(function updateBoundsFromLabel2(bounds4, ele, prefix) { + if (ele.cy().headless()) { + return; + } + var prefixDash; + if (prefix) { + prefixDash = prefix + "-"; + } else { + prefixDash = ""; + } + var _p = ele._private; + var rstyle = _p.rstyle; + var label = ele.pstyle(prefixDash + "label").strValue; + if (label) { + var halign = ele.pstyle("text-halign"); + var valign = ele.pstyle("text-valign"); + var labelWidth = prefixedProperty(rstyle, "labelWidth", prefix); + var labelHeight = prefixedProperty(rstyle, "labelHeight", prefix); + var labelX = prefixedProperty(rstyle, "labelX", prefix); + var labelY = prefixedProperty(rstyle, "labelY", prefix); + var marginX = ele.pstyle(prefixDash + "text-margin-x").pfValue; + var marginY = ele.pstyle(prefixDash + "text-margin-y").pfValue; + var isEdge2 = ele.isEdge(); + var rotation = ele.pstyle(prefixDash + "text-rotation"); + var outlineWidth = ele.pstyle("text-outline-width").pfValue; + var borderWidth = ele.pstyle("text-border-width").pfValue; + var halfBorderWidth = borderWidth / 2; + var padding3 = ele.pstyle("text-background-padding").pfValue; + var marginOfError = 2; + var lh = labelHeight; + var lw = labelWidth; + var lw_2 = lw / 2; + var lh_2 = lh / 2; + var lx1, lx2, ly1, ly2; + if (isEdge2) { + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + } else { + switch (halign.value) { + case "left": + lx1 = labelX - lw; + lx2 = labelX; + break; + case "center": + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + break; + case "right": + lx1 = labelX; + lx2 = labelX + lw; + break; } - function _fc(a) { - var b, c2; - if (nQb(a.d.i, (yCc(), tBc))) { - b = RD(mQb(a.c.i, tBc), 17); - c2 = RD(mQb(a.d.i, tBc), 17); - return hgb(b.a, c2.a) > 0; - } else { - return false; - } + switch (valign.value) { + case "top": + ly1 = labelY - lh; + ly2 = labelY; + break; + case "center": + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + break; + case "bottom": + ly1 = labelY; + ly2 = labelY + lh; + break; } - function g_b(a, b, c2) { - return new Uid2($wnd.Math.min(a.a, b.a) - c2 / 2, $wnd.Math.min(a.b, b.b) - c2 / 2, $wnd.Math.abs(a.a - b.a) + c2, $wnd.Math.abs(a.b - b.b) + c2); - } - function _mc(a) { - var b; - this.d = new bnb(); - this.j = new pjd(); - this.g = new pjd(); - b = a.g.b; - this.f = RD(mQb(Y2b(b), (yCc(), rAc)), 88); - this.e = Kfb(UD(k2b(b, ZBc))); - } - function onc(a) { - this.d = new bnb(); - this.e = new gub(); - this.c = $C(kE, Pwe, 28, (qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd])).length, 15, 1); - this.b = a; - } - function $pc(a, b, c2) { - var d; - d = c2[a.g][b]; - switch (a.g) { - case 1: - case 3: - return new rjd(0, d); - case 2: - case 4: - return new rjd(d, 0); - default: - return null; + } + lx1 += marginX - Math.max(outlineWidth, halfBorderWidth) - padding3 - marginOfError; + lx2 += marginX + Math.max(outlineWidth, halfBorderWidth) + padding3 + marginOfError; + ly1 += marginY - Math.max(outlineWidth, halfBorderWidth) - padding3 - marginOfError; + ly2 += marginY + Math.max(outlineWidth, halfBorderWidth) + padding3 + marginOfError; + var bbPrefix = prefix || "main"; + var bbs = _p.labelBounds; + var bb = bbs[bbPrefix] = bbs[bbPrefix] || {}; + bb.x1 = lx1; + bb.y1 = ly1; + bb.x2 = lx2; + bb.y2 = ly2; + bb.w = lx2 - lx1; + bb.h = ly2 - ly1; + var isAutorotate = isEdge2 && rotation.strValue === "autorotate"; + var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0; + if (isAutorotate || isPfValue) { + var theta = isAutorotate ? prefixedProperty(_p.rstyle, "labelAngle", prefix) : rotation.pfValue; + var cos3 = Math.cos(theta); + var sin3 = Math.sin(theta); + var xo = (lx1 + lx2) / 2; + var yo = (ly1 + ly2) / 2; + if (!isEdge2) { + switch (halign.value) { + case "left": + xo = lx2; + break; + case "right": + xo = lx1; + break; } - } - function Ced(b, c2, d) { - var e, f2; - f2 = RD(ltd(c2.f), 205); - try { - f2.rf(b, d); - mtd(c2.f, f2); - } catch (a) { - a = zdb(a); - if (ZD(a, 103)) { - e = a; - throw Adb(e); - } else - throw Adb(a); - } - } - function tEd(a, b, c2) { - var d, e, f2, g, h, i2; - d = null; - h = vgd(ygd(), b); - f2 = null; - if (h) { - e = null; - i2 = zhd(h, c2); - g = null; - i2 != null && (g = a.qf(h, i2)); - e = g; - f2 = e; - } - d = f2; - return d; - } - function sSd(a, b, c2, d) { - var e; - e = a.length; - if (b >= e) - return e; - for (b = b > 0 ? b : 0; b < e; b++) { - if (zSd((BFb(b, a.length), a.charCodeAt(b)), c2, d)) - break; - } - return b; - } - function anb(a, b) { - var c2, d; - d = a.c.length; - b.length < d && (b = cFb(new Array(d), b)); - for (c2 = 0; c2 < d; ++c2) { - bD(b, c2, a.c[c2]); - } - b.length > d && bD(b, d, null); - return b; - } - function lob(a, b) { - var c2, d; - d = a.a.length; - b.length < d && (b = cFb(new Array(d), b)); - for (c2 = 0; c2 < d; ++c2) { - bD(b, c2, a.a[c2]); - } - b.length > d && bD(b, d, null); - return b; - } - function Bde(a, b) { - var c2, d; - ++a.j; - if (b != null) { - c2 = (d = a.a.Cb, ZD(d, 99) ? RD(d, 99).th() : null); - if (Jnb(b, c2)) { - $wd(a.a, 4, c2); - return; - } + switch (valign.value) { + case "top": + yo = ly2; + break; + case "bottom": + yo = ly1; + break; } - $wd(a.a, 4, RD(b, 129)); } - function mne(a) { - var b; - if (a == null) - return null; - b = Hqe(nue(a, true)); - if (b == null) { - throw Adb(new Mle("Invalid hexBinary value: '" + a + "'")); - } - return b; + var rotate = /* @__PURE__ */ __name(function rotate2(x5, y5) { + x5 = x5 - xo; + y5 = y5 - yo; + return { + x: x5 * cos3 - y5 * sin3 + xo, + y: x5 * sin3 + y5 * cos3 + yo + }; + }, "rotate"); + var px1y1 = rotate(lx1, ly1); + var px1y2 = rotate(lx1, ly2); + var px2y1 = rotate(lx2, ly1); + var px2y2 = rotate(lx2, ly2); + lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x); + lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x); + ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y); + ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y); + } + var bbPrefixRot = bbPrefix + "Rot"; + var bbRot = bbs[bbPrefixRot] = bbs[bbPrefixRot] || {}; + bbRot.x1 = lx1; + bbRot.y1 = ly1; + bbRot.x2 = lx2; + bbRot.y2 = ly2; + bbRot.w = lx2 - lx1; + bbRot.h = ly2 - ly1; + updateBounds(bounds4, lx1, ly1, lx2, ly2); + updateBounds(_p.labelBounds.all, lx1, ly1, lx2, ly2); + } + return bounds4; + }, "updateBoundsFromLabel"); + updateBoundsFromOutline = /* @__PURE__ */ __name(function updateBoundsFromOutline2(bounds4, ele) { + if (ele.cy().headless()) { + return; + } + var outlineOpacity = ele.pstyle("outline-opacity").value; + var outlineWidth = ele.pstyle("outline-width").value; + if (outlineOpacity > 0 && outlineWidth > 0) { + var outlineOffset = ele.pstyle("outline-offset").value; + var nodeShape = ele.pstyle("shape").value; + var outlineSize = outlineWidth + outlineOffset; + var scaleX = (bounds4.w + outlineSize * 2) / bounds4.w; + var scaleY = (bounds4.h + outlineSize * 2) / bounds4.h; + var xOffset = 0; + var yOffset = 0; + if (["diamond", "pentagon", "round-triangle"].includes(nodeShape)) { + scaleX = (bounds4.w + outlineSize * 2.4) / bounds4.w; + yOffset = -outlineSize / 3.6; + } else if (["concave-hexagon", "rhomboid", "right-rhomboid"].includes(nodeShape)) { + scaleX = (bounds4.w + outlineSize * 2.4) / bounds4.w; + } else if (nodeShape === "star") { + scaleX = (bounds4.w + outlineSize * 2.8) / bounds4.w; + scaleY = (bounds4.h + outlineSize * 2.6) / bounds4.h; + yOffset = -outlineSize / 3.8; + } else if (nodeShape === "triangle") { + scaleX = (bounds4.w + outlineSize * 2.8) / bounds4.w; + scaleY = (bounds4.h + outlineSize * 2.4) / bounds4.h; + yOffset = -outlineSize / 1.4; + } else if (nodeShape === "vee") { + scaleX = (bounds4.w + outlineSize * 4.4) / bounds4.w; + scaleY = (bounds4.h + outlineSize * 3.8) / bounds4.h; + yOffset = -outlineSize * 0.5; + } + var hDelta = bounds4.h * scaleY - bounds4.h; + var wDelta = bounds4.w * scaleX - bounds4.w; + expandBoundingBoxSides(bounds4, [Math.ceil(hDelta / 2), Math.ceil(wDelta / 2)]); + if (xOffset != 0 || yOffset !== 0) { + var oBounds = shiftBoundingBox(bounds4, xOffset, yOffset); + updateBoundingBox(bounds4, oBounds); + } + } + }, "updateBoundsFromOutline"); + boundingBoxImpl = /* @__PURE__ */ __name(function boundingBoxImpl2(ele, options3) { + var cy = ele._private.cy; + var styleEnabled2 = cy.styleEnabled(); + var headless2 = cy.headless(); + var bounds4 = makeBoundingBox(); + var _p = ele._private; + var isNode2 = ele.isNode(); + var isEdge2 = ele.isEdge(); + var ex1, ex2, ey1, ey2; + var x5, y5; + var rstyle = _p.rstyle; + var manualExpansion = isNode2 && styleEnabled2 ? ele.pstyle("bounds-expansion").pfValue : [0]; + var isDisplayed = /* @__PURE__ */ __name(function isDisplayed2(ele2) { + return ele2.pstyle("display").value !== "none"; + }, "isDisplayed"); + var displayed = !styleEnabled2 || isDisplayed(ele) && (!isEdge2 || isDisplayed(ele.source()) && isDisplayed(ele.target())); + if (displayed) { + var overlayOpacity = 0; + var overlayPadding = 0; + if (styleEnabled2 && options3.includeOverlays) { + overlayOpacity = ele.pstyle("overlay-opacity").value; + if (overlayOpacity !== 0) { + overlayPadding = ele.pstyle("overlay-padding").value; } - function wA(a, b, c2) { - var d; - if (b.a.length > 0) { - Rmb(a.b, new kB(b.a, c2)); - d = b.a.length; - 0 < d ? b.a = zhb(b.a, 0, 0) : 0 > d && (b.a += Hhb($C(hE, zwe, 28, -d, 15, 1))); - } + } + var underlayOpacity = 0; + var underlayPadding = 0; + if (styleEnabled2 && options3.includeUnderlays) { + underlayOpacity = ele.pstyle("underlay-opacity").value; + if (underlayOpacity !== 0) { + underlayPadding = ele.pstyle("underlay-padding").value; } - function yIb(a, b, c2) { - var d, e, f2; - if (c2[b.d]) { - return; + } + var padding3 = Math.max(overlayPadding, underlayPadding); + var w3 = 0; + var wHalf = 0; + if (styleEnabled2) { + w3 = ele.pstyle("width").pfValue; + wHalf = w3 / 2; + } + if (isNode2 && options3.includeNodes) { + var pos = ele.position(); + x5 = pos.x; + y5 = pos.y; + var _w = ele.outerWidth(); + var halfW = _w / 2; + var h2 = ele.outerHeight(); + var halfH = h2 / 2; + ex1 = x5 - halfW; + ex2 = x5 + halfW; + ey1 = y5 - halfH; + ey2 = y5 + halfH; + updateBounds(bounds4, ex1, ey1, ex2, ey2); + if (styleEnabled2 && options3.includeOutlines) { + updateBoundsFromOutline(bounds4, ele); + } + } else if (isEdge2 && options3.includeEdges) { + if (styleEnabled2 && !headless2) { + var curveStyle = ele.pstyle("curve-style").strValue; + ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX); + ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX); + ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY); + ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY); + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + updateBounds(bounds4, ex1, ey1, ex2, ey2); + if (curveStyle === "haystack") { + var hpts = rstyle.haystackPts; + if (hpts && hpts.length === 2) { + ex1 = hpts[0].x; + ey1 = hpts[0].y; + ex2 = hpts[1].x; + ey2 = hpts[1].y; + if (ex1 > ex2) { + var temp = ex1; + ex1 = ex2; + ex2 = temp; + } + if (ey1 > ey2) { + var _temp = ey1; + ey1 = ey2; + ey2 = _temp; + } + updateBounds(bounds4, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf); + } + } else if (curveStyle === "bezier" || curveStyle === "unbundled-bezier" || curveStyle.endsWith("segments") || curveStyle.endsWith("taxi")) { + var pts2; + switch (curveStyle) { + case "bezier": + case "unbundled-bezier": + pts2 = rstyle.bezierPts; + break; + case "segments": + case "taxi": + case "round-segments": + case "round-taxi": + pts2 = rstyle.linePts; + break; + } + if (pts2 != null) { + for (var j2 = 0; j2 < pts2.length; j2++) { + var pt = pts2[j2]; + ex1 = pt.x - wHalf; + ex2 = pt.x + wHalf; + ey1 = pt.y - wHalf; + ey2 = pt.y + wHalf; + updateBounds(bounds4, ex1, ey1, ex2, ey2); + } + } } - c2[b.d] = true; - for (e = new Anb(CIb(b)); e.a < e.c.c.length; ) { - d = RD(ynb(e), 218); - f2 = oIb(d, b); - yIb(a, f2, c2); + } else { + var n1 = ele.source(); + var n1pos = n1.position(); + var n2 = ele.target(); + var n2pos = n2.position(); + ex1 = n1pos.x; + ex2 = n2pos.x; + ey1 = n1pos.y; + ey2 = n2pos.y; + if (ex1 > ex2) { + var _temp2 = ex1; + ex1 = ex2; + ex2 = _temp2; } - } - function dub(a, b, c2) { - var d, e, f2; - e = RD(Wjb(a.e, b), 400); - if (!e) { - d = new uub(a, b, c2); - Zjb(a.e, b, d); - qub(d); - return null; - } else { - f2 = qlb(e, c2); - eub(a, e); - return f2; + if (ey1 > ey2) { + var _temp3 = ey1; + ey1 = ey2; + ey2 = _temp3; } + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + updateBounds(bounds4, ex1, ey1, ex2, ey2); } - function r5d(a, b, c2, d) { - var e, f2, g; - e = new P3d(a.e, 1, 13, (g = b.c, g ? g : (JTd(), wTd)), (f2 = c2.c, f2 ? f2 : (JTd(), wTd)), fZd(a, b), false); - !d ? d = e : d.nj(e); - return d; + } + if (styleEnabled2 && options3.includeEdges && isEdge2) { + updateBoundsFromArrow(bounds4, ele, "mid-source"); + updateBoundsFromArrow(bounds4, ele, "mid-target"); + updateBoundsFromArrow(bounds4, ele, "source"); + updateBoundsFromArrow(bounds4, ele, "target"); + } + if (styleEnabled2) { + var ghost = ele.pstyle("ghost").value === "yes"; + if (ghost) { + var gx = ele.pstyle("ghost-offset-x").pfValue; + var gy = ele.pstyle("ghost-offset-y").pfValue; + updateBounds(bounds4, bounds4.x1 + gx, bounds4.y1 + gy, bounds4.x2 + gx, bounds4.y2 + gy); } - function nMb() { - hMb(); - return cD(WC(XN, 1), jwe, 164, 0, [eMb, dMb, fMb, XLb, WLb, YLb, _Lb, $Lb, ZLb, cMb, bMb, aMb, ULb, TLb, VLb, RLb, QLb, SLb, OLb, NLb, PLb, gMb]); + } + var bbBody = _p.bodyBounds = _p.bodyBounds || {}; + assignBoundingBox(bbBody, bounds4); + expandBoundingBoxSides(bbBody, manualExpansion); + expandBoundingBox(bbBody, 1); + if (styleEnabled2) { + ex1 = bounds4.x1; + ex2 = bounds4.x2; + ey1 = bounds4.y1; + ey2 = bounds4.y2; + updateBounds(bounds4, ex1 - padding3, ey1 - padding3, ex2 + padding3, ey2 + padding3); + } + var bbOverlay = _p.overlayBounds = _p.overlayBounds || {}; + assignBoundingBox(bbOverlay, bounds4); + expandBoundingBoxSides(bbOverlay, manualExpansion); + expandBoundingBox(bbOverlay, 1); + var bbLabels = _p.labelBounds = _p.labelBounds || {}; + if (bbLabels.all != null) { + clearBoundingBox(bbLabels.all); + } else { + bbLabels.all = makeBoundingBox(); + } + if (styleEnabled2 && options3.includeLabels) { + if (options3.includeMainLabels) { + updateBoundsFromLabel(bounds4, ele, null); } - function jWc(a) { - switch (a.g) { - case 4: - return new rjd(0, -1); - case 1: - return new rjd(1, 0); - case 2: - return new rjd(-1, 0); - default: - return new rjd(0, 1); + if (isEdge2) { + if (options3.includeSourceLabels) { + updateBoundsFromLabel(bounds4, ele, "source"); + } + if (options3.includeTargetLabels) { + updateBoundsFromLabel(bounds4, ele, "target"); } } - function f_b(a) { - switch (a.g) { - case 1: - return Cmd(), Bmd; - case 4: - return Cmd(), ymd; - case 2: - return Cmd(), zmd; - case 3: - return Cmd(), xmd; - } - return Cmd(), Amd; - } - function s$d(a) { - var b; - b = a.hj(null); - switch (b) { - case 10: - return 0; - case 15: - return 1; - case 14: - return 2; - case 11: - return 3; - case 21: - return 4; - } - return -1; - } - function Yhd() { - Yhd = geb; - Whd = new Zhd("PARENTS", 0); - Vhd = new Zhd("NODES", 1); - Thd = new Zhd("EDGES", 2); - Xhd = new Zhd("PORTS", 3); - Uhd = new Zhd("LABELS", 4); - } - function AA(a, b, c2) { - var d; - d = c2.q.getFullYear() - Owe + Owe; - d < 0 && (d = -d); - switch (b) { - case 1: - a.a += d; - break; - case 2: - UA(a, d % 100, 2); - break; - default: - UA(a, d, b); - } - } - function Sub(a, b) { - var c2, d; - wFb(b, a.b); - if (b >= a.b >> 1) { - d = a.c; - for (c2 = a.b; c2 > b; --c2) { - d = d.b; - } - } else { - d = a.a.a; - for (c2 = 0; c2 < b; ++c2) { - d = d.a; - } - } - return new hvb(a, b, d); - } - function DHb() { - DHb = geb; - CHb = new EHb("NUM_OF_EXTERNAL_SIDES_THAN_NUM_OF_EXTENSIONS_LAST", 0); - BHb = new EHb("CORNER_CASES_THAN_SINGLE_SIDE_LAST", 1); - } - function tnc(a) { - this.b = new bnb(); - this.e = new bnb(); - this.d = a; - this.a = !QDb(CDb(new SDb(null, new Twb(new l4b(a.b))), new PAb(new unc()))).Bd((xDb(), wDb)); - } - function ssc(a, b) { - var c2, d, e, f2; - c2 = 0; - for (e = new Anb(b.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - f2 = d.o.a + d.d.c + d.d.b + a.j; - c2 = $wnd.Math.max(c2, f2); - } - return c2; - } - function OUc(a, b) { - var c2, d, e; - e = b.d.i; - d = e.k; - if (d == (r3b(), p3b) || d == l3b) { - return; - } - c2 = new is(Mr(a3b(e).a.Kc(), new ir())); - gs(c2) && Zjb(a.k, b, RD(hs(c2), 18)); - } - function O0c(a, b) { - B0c(); - return Qfb((a.a.b == 0 ? new rjd(a.c.e.a, a.c.e.b) : RD(Qub(a.a), 8)).b, (b.a.b == 0 ? new rjd(b.c.e.a, b.c.e.b) : RD(Qub(b.a), 8)).b); - } - function P0c(a, b) { - B0c(); - return Qfb((a.a.b == 0 ? new rjd(a.c.e.a, a.c.e.b) : RD(Qub(a.a), 8)).a, (b.a.b == 0 ? new rjd(b.c.e.a, b.c.e.b) : RD(Qub(b.a), 8)).a); - } - function S0c(a, b) { - B0c(); - return Qfb((a.a.b == 0 ? new rjd(a.b.e.a, a.b.e.b) : RD(Rub(a.a), 8)).a, (b.a.b == 0 ? new rjd(b.b.e.a, b.b.e.b) : RD(Rub(b.a), 8)).a); - } - function Q0c(a, b) { - B0c(); - return Qfb((a.a.b == 0 ? new rjd(a.b.e.a, a.b.e.b) : RD(Rub(a.a), 8)).b, (b.a.b == 0 ? new rjd(b.b.e.a, b.b.e.b) : RD(Rub(b.a), 8)).b); - } - function pod() { - pod = geb; - mod = new qod("DISTRIBUTED", 0); - ood = new qod("JUSTIFIED", 1); - kod = new qod("BEGIN", 2); - lod = new qod(Kye, 3); - nod = new qod("END", 4); - } - function Kvd(a, b) { - var c2, d, e; - d = vYd(a.Dh(), b); - c2 = b - a.ji(); - return c2 < 0 ? (e = a.Ih(d), e >= 0 ? a.Wh(e) : Rvd(a, d)) : c2 < 0 ? Rvd(a, d) : RD(d, 69).wk().Bk(a, a.hi(), c2); - } - function Fxd(a) { - var b, c2, d; - d = (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), a.o); - for (c2 = d.c.Kc(); c2.e != c2.i.gc(); ) { - b = RD(c2.Yj(), 44); - b.md(); - } - return dOd(d); - } - function iGd(a) { - var b; - if (ZD(a.a, 4)) { - b = FId(a.a); - if (b == null) { - throw Adb(new dgb(HGe + a.b + "'. " + DGe + (lfb(b6), b6.k) + EGe)); - } - return b; - } else { - return a.a; - } - } - function iSd(a, b) { - var c2, d; - if (a.j.length != b.j.length) - return false; - for (c2 = 0, d = a.j.length; c2 < d; c2++) { - if (!lhb(a.j[c2], b.j[c2])) - return false; - } - return true; + } + } + bounds4.x1 = noninf(bounds4.x1); + bounds4.y1 = noninf(bounds4.y1); + bounds4.x2 = noninf(bounds4.x2); + bounds4.y2 = noninf(bounds4.y2); + bounds4.w = noninf(bounds4.x2 - bounds4.x1); + bounds4.h = noninf(bounds4.y2 - bounds4.y1); + if (bounds4.w > 0 && bounds4.h > 0 && displayed) { + expandBoundingBoxSides(bounds4, manualExpansion); + expandBoundingBox(bounds4, 1); + } + return bounds4; + }, "boundingBoxImpl"); + getKey = /* @__PURE__ */ __name(function getKey2(opts) { + var i2 = 0; + var tf = /* @__PURE__ */ __name(function tf2(val) { + return (val ? 1 : 0) << i2++; + }, "tf"); + var key = 0; + key += tf(opts.incudeNodes); + key += tf(opts.includeEdges); + key += tf(opts.includeLabels); + key += tf(opts.includeMainLabels); + key += tf(opts.includeSourceLabels); + key += tf(opts.includeTargetLabels); + key += tf(opts.includeOverlays); + key += tf(opts.includeOutlines); + return key; + }, "getKey"); + getBoundingBoxPosKey = /* @__PURE__ */ __name(function getBoundingBoxPosKey2(ele) { + if (ele.isEdge()) { + var p1 = ele.source().position(); + var p22 = ele.target().position(); + var r2 = /* @__PURE__ */ __name(function r3(x5) { + return Math.round(x5); + }, "r"); + return hashIntsArray([r2(p1.x), r2(p1.y), r2(p22.x), r2(p22.y)]); + } else { + return 0; + } + }, "getBoundingBoxPosKey"); + cachedBoundingBoxImpl = /* @__PURE__ */ __name(function cachedBoundingBoxImpl2(ele, opts) { + var _p = ele._private; + var bb; + var isEdge2 = ele.isEdge(); + var key = opts == null ? defBbOptsKey : getKey(opts); + var usingDefOpts = key === defBbOptsKey; + var currPosKey = getBoundingBoxPosKey(ele); + var isPosKeySame = _p.bbCachePosKey === currPosKey; + var useCache = opts.useCache && isPosKeySame; + var isDirty = /* @__PURE__ */ __name(function isDirty2(ele2) { + return ele2._private.bbCache == null || ele2._private.styleDirty; + }, "isDirty"); + var needRecalc = !useCache || isDirty(ele) || isEdge2 && isDirty(ele.source()) || isDirty(ele.target()); + if (needRecalc) { + if (!isPosKeySame) { + ele.recalculateRenderedStyle(useCache); + } + bb = boundingBoxImpl(ele, defBbOpts); + _p.bbCache = bb; + _p.bbCachePosKey = currPosKey; + } else { + bb = _p.bbCache; + } + if (!usingDefOpts) { + var isNode2 = ele.isNode(); + bb = makeBoundingBox(); + if (opts.includeNodes && isNode2 || opts.includeEdges && !isNode2) { + if (opts.includeOverlays) { + updateBoundsFromBox(bb, _p.overlayBounds); + } else { + updateBoundsFromBox(bb, _p.bodyBounds); } - function bMd(b) { - var c2; - try { - c2 = b.i.Xb(b.e); - b.Xj(); - b.g = b.e++; - return c2; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - b.Xj(); - throw Adb(new Dvb()); - } else - throw Adb(a); - } - } - function xMd(b) { - var c2; - try { - c2 = b.c.Vi(b.e); - b.Xj(); - b.g = b.e++; - return c2; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - b.Xj(); - throw Adb(new Dvb()); - } else - throw Adb(a); - } - } - function vSd(a) { - var b, c2, d, e; - e = 0; - for (c2 = 0, d = a.length; c2 < d; c2++) { - b = (BFb(c2, a.length), a.charCodeAt(c2)); - b >= 64 && b < 128 && (e = Rdb(e, Sdb(1, b - 64))); - } - return e; - } - function k2b(a, b) { - var c2, d; - d = null; - if (nQb(a, (umd(), amd))) { - c2 = RD(mQb(a, amd), 96); - c2.pf(b) && (d = c2.of(b)); - } - d == null && !!Y2b(a) && (d = mQb(Y2b(a), b)); - return d; - } - function i0b(a, b) { - var c2; - c2 = RD(mQb(a, (yCc(), RAc)), 75); - if (br(b, f0b)) { - if (!c2) { - c2 = new Ejd(); - pQb(a, RAc, c2); - } else { - Xub(c2); - } - } else - !!c2 && pQb(a, RAc, null); - return c2; - } - function tSb() { - tSb = geb; - sSb = (umd(), Yld); - mSb = Ukd; - hSb = Dkd; - nSb = tld; - qSb = (YHb(), UHb); - pSb = SHb; - rSb = WHb; - oSb = RHb; - jSb = (eSb(), aSb); - iSb = _Rb; - kSb = cSb; - lSb = dSb; - } - function PZb(a) { - NZb(); - this.c = new bnb(); - this.d = a; - switch (a.g) { - case 0: - case 2: - this.a = Fob(MZb); - this.b = oxe; - break; - case 3: - case 1: - this.a = MZb; - this.b = pxe; + } + if (opts.includeLabels) { + if (opts.includeMainLabels && (!isEdge2 || opts.includeSourceLabels && opts.includeTargetLabels)) { + updateBoundsFromBox(bb, _p.labelBounds.all); + } else { + if (opts.includeMainLabels) { + updateBoundsFromBox(bb, _p.labelBounds.mainRot); } - } - function c9b(a) { - var b; - if (!Cod(RD(mQb(a, (yCc(), BBc)), 101))) { - return; + if (opts.includeSourceLabels) { + updateBoundsFromBox(bb, _p.labelBounds.sourceRot); } - b = a.b; - d9b((tFb(0, b.c.length), RD(b.c[0], 30))); - d9b(RD(Vmb(b, b.c.length - 1), 30)); - } - function ohc(a, b) { - b.Ug("Self-Loop post-processing", 1); - FDb(CDb(CDb(EDb(new SDb(null, new Swb(a.b, 16)), new uhc()), new whc()), new yhc()), new Ahc()); - b.Vg(); - } - function xrd(a, b, c2) { - var d, e; - if (a.c) { - Dyd(a.c, a.c.i + b); - Eyd(a.c, a.c.j + c2); - } else { - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 163); - xrd(d, b, c2); - } + if (opts.includeTargetLabels) { + updateBoundsFromBox(bb, _p.labelBounds.targetRot); } } - function ine(a) { - var b; - if (a == null) - return null; - b = Aqe(nue(a, true)); - if (b == null) { - throw Adb(new Mle("Invalid base64Binary value: '" + a + "'")); - } - return b; + } + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + } + return bb; + }, "cachedBoundingBoxImpl"); + defBbOpts = { + includeNodes: true, + includeEdges: true, + includeLabels: true, + includeMainLabels: true, + includeSourceLabels: true, + includeTargetLabels: true, + includeOverlays: true, + includeUnderlays: true, + includeOutlines: true, + useCache: true + }; + defBbOptsKey = getKey(defBbOpts); + filledBbOpts = defaults$g(defBbOpts); + elesfn$b.boundingBox = function(options3) { + var bounds4; + if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (options3 === void 0 || options3.useCache === void 0 || options3.useCache === true)) { + if (options3 === void 0) { + options3 = defBbOpts; + } else { + options3 = filledBbOpts(options3); + } + bounds4 = cachedBoundingBoxImpl(this[0], options3); + } else { + bounds4 = makeBoundingBox(); + options3 = options3 || defBbOpts; + var opts = filledBbOpts(options3); + var eles = this; + var cy = eles.cy(); + var styleEnabled2 = cy.styleEnabled(); + if (styleEnabled2) { + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var _p = ele._private; + var currPosKey = getBoundingBoxPosKey(ele); + var isPosKeySame = _p.bbCachePosKey === currPosKey; + var useCache = opts.useCache && isPosKeySame && !_p.styleDirty; + ele.recalculateRenderedStyle(useCache); } - function ju(b, c2) { - var d; - d = b.fd(c2); - try { - return d.Pb(); - } catch (a) { - a = zdb(a); - if (ZD(a, 112)) { - throw Adb(new veb("Can't get element " + c2)); - } else - throw Adb(a); - } - } - function ANb(a, b) { - var c2, d, e; - c2 = a.o; - for (e = RD(RD(Qc(a.r, b), 21), 87).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 117); - d.e.a = uNb(d, c2.a); - d.e.b = c2.b * Kfb(UD(d.b.of(sNb))); - } - } - function kdc(a, b) { - var c2, d, e; - e = new cnb(b.gc()); - for (d = b.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 293); - c2.c == c2.f ? _cc(a, c2, c2.c) : adc(a, c2) || (ZEb(e.c, c2), true); - } - return e; - } - function i3b(a) { - var b; - b = new bib(); - b.a += "n"; - a.k != (r3b(), p3b) && Zhb(Zhb((b.a += "(", b), ps(a.k).toLowerCase()), ")"); - Zhb((b.a += "_", b), X2b(a)); - return b.a; - } - function h9b(a, b) { - var c2, d, e, f2; - e = a.k; - c2 = Kfb(UD(mQb(a, (Ywc(), Jwc)))); - f2 = b.k; - d = Kfb(UD(mQb(b, Jwc))); - return f2 != (r3b(), m3b) ? -1 : e != m3b ? 1 : c2 == d ? 0 : c2 < d ? -1 : 1; - } - function Lad(a, b) { - var c2, d; - c2 = RD(RD(Wjb(a.g, b.a), 42).a, 68); - d = RD(RD(Wjb(a.g, b.b), 42).a, 68); - return bjd(b.a, b.b) - bjd(b.a, Pid(c2.b)) - bjd(b.b, Pid(d.b)); - } - function GMb(a, b) { - var c2; - c2 = RD(Vrb(a.b, b), 127).n; - switch (b.g) { - case 1: - a.t >= 0 && (c2.d = a.t); - break; - case 3: - a.t >= 0 && (c2.a = a.t); - } - if (a.C) { - c2.b = a.C.b; - c2.c = a.C.c; - } - } - function JDc() { - JDc = geb; - IDc = new LDc(mEe, 0); - FDc = new LDc(BBe, 1); - GDc = new LDc("LINEAR_SEGMENTS", 2); - EDc = new LDc("BRANDES_KOEPF", 3); - HDc = new LDc(lEe, 4); - } - function IRb() { - IRb = geb; - FRb = new JRb(_ye, 0); - ERb = new JRb(aze, 1); - GRb = new JRb(bze, 2); - HRb = new JRb(cze, 3); - FRb.a = false; - ERb.a = true; - GRb.a = false; - HRb.a = true; - } - function IPb() { - IPb = geb; - FPb = new JPb(_ye, 0); - EPb = new JPb(aze, 1); - GPb = new JPb(bze, 2); - HPb = new JPb(cze, 3); - FPb.a = false; - EPb.a = true; - GPb.a = false; - HPb.a = true; - } - function Ivd(a, b, c2, d) { - var e; - if (c2 >= 0) { - return a.Sh(b, c2, d); - } else { - !!a.Ph() && (d = (e = a.Fh(), e >= 0 ? a.Ah(d) : a.Ph().Th(a, -1 - e, null, d))); - return a.Ch(b, c2, d); + } + this.updateCompoundBounds(!options3.useCache); + for (var _i = 0; _i < eles.length; _i++) { + var _ele = eles[_i]; + updateBoundsFromBox(bounds4, cachedBoundingBoxImpl(_ele, opts)); + } + } + bounds4.x1 = noninf(bounds4.x1); + bounds4.y1 = noninf(bounds4.y1); + bounds4.x2 = noninf(bounds4.x2); + bounds4.y2 = noninf(bounds4.y2); + bounds4.w = noninf(bounds4.x2 - bounds4.x1); + bounds4.h = noninf(bounds4.y2 - bounds4.y1); + return bounds4; + }; + elesfn$b.dirtyBoundingBoxCache = function() { + for (var i2 = 0; i2 < this.length; i2++) { + var _p = this[i2]._private; + _p.bbCache = null; + _p.bbCachePosKey = null; + _p.bodyBounds = null; + _p.overlayBounds = null; + _p.labelBounds.all = null; + _p.labelBounds.source = null; + _p.labelBounds.target = null; + _p.labelBounds.main = null; + _p.labelBounds.sourceRot = null; + _p.labelBounds.targetRot = null; + _p.labelBounds.mainRot = null; + _p.arrowBounds.source = null; + _p.arrowBounds.target = null; + _p.arrowBounds["mid-source"] = null; + _p.arrowBounds["mid-target"] = null; + } + this.emitAndNotify("bounds"); + return this; + }; + elesfn$b.boundingBoxAt = function(fn3) { + var nodes6 = this.nodes(); + var cy = this.cy(); + var hasCompoundNodes2 = cy.hasCompoundNodes(); + var parents4 = cy.collection(); + if (hasCompoundNodes2) { + parents4 = nodes6.filter(function(node2) { + return node2.isParent(); + }); + nodes6 = nodes6.not(parents4); + } + if (plainObject(fn3)) { + var obj = fn3; + fn3 = /* @__PURE__ */ __name(function fn4() { + return obj; + }, "fn"); + } + var storeOldPos = /* @__PURE__ */ __name(function storeOldPos2(node2, i2) { + return node2._private.bbAtOldPos = fn3(node2, i2); + }, "storeOldPos"); + var getOldPos = /* @__PURE__ */ __name(function getOldPos2(node2) { + return node2._private.bbAtOldPos; + }, "getOldPos"); + cy.startBatch(); + nodes6.forEach(storeOldPos).silentPositions(fn3); + if (hasCompoundNodes2) { + parents4.dirtyCompoundBoundsCache(); + parents4.dirtyBoundingBoxCache(); + parents4.updateCompoundBounds(true); + } + var bb = copyBoundingBox(this.boundingBox({ + useCache: false + })); + nodes6.silentPositions(getOldPos); + if (hasCompoundNodes2) { + parents4.dirtyCompoundBoundsCache(); + parents4.dirtyBoundingBoxCache(); + parents4.updateCompoundBounds(true); + } + cy.endBatch(); + return bb; + }; + fn$3.boundingbox = fn$3.bb = fn$3.boundingBox; + fn$3.renderedBoundingbox = fn$3.renderedBoundingBox; + bounds3 = elesfn$b; + fn$2 = elesfn$a = {}; + defineDimFns = /* @__PURE__ */ __name(function defineDimFns2(opts) { + opts.uppercaseName = capitalize(opts.name); + opts.autoName = "auto" + opts.uppercaseName; + opts.labelName = "label" + opts.uppercaseName; + opts.outerName = "outer" + opts.uppercaseName; + opts.uppercaseOuterName = capitalize(opts.outerName); + fn$2[opts.name] = /* @__PURE__ */ __name(function dimImpl() { + var ele = this[0]; + var _p = ele._private; + var cy = _p.cy; + var styleEnabled2 = cy._private.styleEnabled; + if (ele) { + if (styleEnabled2) { + if (ele.isParent()) { + ele.updateCompoundBounds(); + return _p[opts.autoName] || 0; } - } - function Zyd(a, b) { - switch (b) { - case 7: - !a.e && (a.e = new Yie(G4, a, 7, 4)); - sLd(a.e); - return; - case 8: - !a.d && (a.d = new Yie(G4, a, 8, 5)); - sLd(a.d); - return; + var d2 = ele.pstyle(opts.name); + switch (d2.strValue) { + case "label": + ele.recalculateRenderedStyle(); + return _p.rstyle[opts.labelName] || 0; + default: + return d2.pfValue; } - yyd(a, b); - } - function Ixd(a, b, c2) { - c2 == null ? (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), jOd(a.o, b)) : (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), fOd(a.o, b, c2)); - return a; + } else { + return 1; } - function Aob(a, b) { - yob(); - var c2, d, e, f2; - c2 = a; - f2 = b; - if (ZD(a, 21) && !ZD(b, 21)) { - c2 = b; - f2 = a; - } - for (e = c2.Kc(); e.Ob(); ) { - d = e.Pb(); - if (f2.Hc(d)) { - return false; - } - } - return true; + } + }, "dimImpl"); + fn$2["outer" + opts.uppercaseName] = /* @__PURE__ */ __name(function outerDimImpl() { + var ele = this[0]; + var _p = ele._private; + var cy = _p.cy; + var styleEnabled2 = cy._private.styleEnabled; + if (ele) { + if (styleEnabled2) { + var dim = ele[opts.name](); + var border = ele.pstyle("border-width").pfValue; + var padding3 = 2 * ele.padding(); + return dim + border + padding3; + } else { + return 1; } - function qTc(a, b, c2, d) { - if (b.a < d.a) { - return true; - } else if (b.a == d.a) { - if (b.b < d.b) { - return true; - } else if (b.b == d.b) { - if (a.b > c2.b) { - return true; - } - } - } - return false; + } + }, "outerDimImpl"); + fn$2["rendered" + opts.uppercaseName] = /* @__PURE__ */ __name(function renderedDimImpl() { + var ele = this[0]; + if (ele) { + var d2 = ele[opts.name](); + return d2 * this.cy().zoom(); + } + }, "renderedDimImpl"); + fn$2["rendered" + opts.uppercaseOuterName] = /* @__PURE__ */ __name(function renderedOuterDimImpl() { + var ele = this[0]; + if (ele) { + var od = ele[opts.outerName](); + return od * this.cy().zoom(); + } + }, "renderedOuterDimImpl"); + }, "defineDimFns"); + defineDimFns({ + name: "width" + }); + defineDimFns({ + name: "height" + }); + elesfn$a.padding = function() { + var ele = this[0]; + var _p = ele._private; + if (ele.isParent()) { + ele.updateCompoundBounds(); + if (_p.autoPadding !== void 0) { + return _p.autoPadding; + } else { + return ele.pstyle("padding").pfValue; + } + } else { + return ele.pstyle("padding").pfValue; + } + }; + elesfn$a.paddedHeight = function() { + var ele = this[0]; + return ele.height() + 2 * ele.padding(); + }; + elesfn$a.paddedWidth = function() { + var ele = this[0]; + return ele.width() + 2 * ele.padding(); + }; + widthHeight = elesfn$a; + ifEdge = /* @__PURE__ */ __name(function ifEdge2(ele, getValue3) { + if (ele.isEdge()) { + return getValue3(ele); + } + }, "ifEdge"); + ifEdgeRenderedPosition = /* @__PURE__ */ __name(function ifEdgeRenderedPosition2(ele, getPoint) { + if (ele.isEdge()) { + var cy = ele.cy(); + return modelToRenderedPosition(getPoint(ele), cy.zoom(), cy.pan()); + } + }, "ifEdgeRenderedPosition"); + ifEdgeRenderedPositions = /* @__PURE__ */ __name(function ifEdgeRenderedPositions2(ele, getPoints) { + if (ele.isEdge()) { + var cy = ele.cy(); + var pan2 = cy.pan(); + var zoom2 = cy.zoom(); + return getPoints(ele).map(function(p3) { + return modelToRenderedPosition(p3, zoom2, pan2); + }); + } + }, "ifEdgeRenderedPositions"); + controlPoints2 = /* @__PURE__ */ __name(function controlPoints3(ele) { + return ele.renderer().getControlPoints(ele); + }, "controlPoints"); + segmentPoints = /* @__PURE__ */ __name(function segmentPoints2(ele) { + return ele.renderer().getSegmentPoints(ele); + }, "segmentPoints"); + sourceEndpoint = /* @__PURE__ */ __name(function sourceEndpoint2(ele) { + return ele.renderer().getSourceEndpoint(ele); + }, "sourceEndpoint"); + targetEndpoint = /* @__PURE__ */ __name(function targetEndpoint2(ele) { + return ele.renderer().getTargetEndpoint(ele); + }, "targetEndpoint"); + midpoint = /* @__PURE__ */ __name(function midpoint2(ele) { + return ele.renderer().getEdgeMidpoint(ele); + }, "midpoint"); + pts = { + controlPoints: { + get: controlPoints2, + mult: true + }, + segmentPoints: { + get: segmentPoints, + mult: true + }, + sourceEndpoint: { + get: sourceEndpoint + }, + targetEndpoint: { + get: targetEndpoint + }, + midpoint: { + get: midpoint + } + }; + renderedName = /* @__PURE__ */ __name(function renderedName2(name) { + return "rendered" + name[0].toUpperCase() + name.substr(1); + }, "renderedName"); + edgePoints = Object.keys(pts).reduce(function(obj, name) { + var spec = pts[name]; + var rName = renderedName(name); + obj[name] = function() { + return ifEdge(this, spec.get); + }; + if (spec.mult) { + obj[rName] = function() { + return ifEdgeRenderedPositions(this, spec.get); + }; + } else { + obj[rName] = function() { + return ifEdgeRenderedPosition(this, spec.get); + }; + } + return obj; + }, {}); + dimensions = extend2({}, position2, bounds3, widthHeight, edgePoints); + Event = /* @__PURE__ */ __name(function Event2(src, props) { + this.recycle(src, props); + }, "Event"); + __name(returnFalse, "returnFalse"); + __name(returnTrue, "returnTrue"); + Event.prototype = { + instanceString: /* @__PURE__ */ __name(function instanceString2() { + return "event"; + }, "instanceString"), + recycle: /* @__PURE__ */ __name(function recycle(src, props) { + this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; + if (src != null && src.preventDefault) { + this.type = src.type; + this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse; + } else if (src != null && src.type) { + props = src; + } else { + this.type = src; + } + if (props != null) { + this.originalEvent = props.originalEvent; + this.type = props.type != null ? props.type : this.type; + this.cy = props.cy; + this.target = props.target; + this.position = props.position; + this.renderedPosition = props.renderedPosition; + this.namespace = props.namespace; + this.layout = props.layout; + } + if (this.cy != null && this.position != null && this.renderedPosition == null) { + var pos = this.position; + var zoom2 = this.cy.zoom(); + var pan2 = this.cy.pan(); + this.renderedPosition = { + x: pos.x * zoom2 + pan2.x, + y: pos.y * zoom2 + pan2.y + }; + } + this.timeStamp = src && src.timeStamp || Date.now(); + }, "recycle"), + preventDefault: /* @__PURE__ */ __name(function preventDefault() { + this.isDefaultPrevented = returnTrue; + var e3 = this.originalEvent; + if (!e3) { + return; + } + if (e3.preventDefault) { + e3.preventDefault(); + } + }, "preventDefault"), + stopPropagation: /* @__PURE__ */ __name(function stopPropagation() { + this.isPropagationStopped = returnTrue; + var e3 = this.originalEvent; + if (!e3) { + return; + } + if (e3.stopPropagation) { + e3.stopPropagation(); + } + }, "stopPropagation"), + stopImmediatePropagation: /* @__PURE__ */ __name(function stopImmediatePropagation() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, "stopImmediatePropagation"), + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse + }; + eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; + universalNamespace = ".*"; + defaults$8 = { + qualifierCompare: /* @__PURE__ */ __name(function qualifierCompare(q1, q2) { + return q1 === q2; + }, "qualifierCompare"), + eventMatches: /* @__PURE__ */ __name(function eventMatches() { + return true; + }, "eventMatches"), + addEventFields: /* @__PURE__ */ __name(function addEventFields() { + }, "addEventFields"), + callbackContext: /* @__PURE__ */ __name(function callbackContext(context) { + return context; + }, "callbackContext"), + beforeEmit: /* @__PURE__ */ __name(function beforeEmit() { + }, "beforeEmit"), + afterEmit: /* @__PURE__ */ __name(function afterEmit() { + }, "afterEmit"), + bubble: /* @__PURE__ */ __name(function bubble() { + return false; + }, "bubble"), + parent: /* @__PURE__ */ __name(function parent2() { + return null; + }, "parent"), + context: null + }; + defaultsKeys = Object.keys(defaults$8); + emptyOpts = {}; + __name(Emitter2, "Emitter"); + p2 = Emitter2.prototype; + forEachEvent = /* @__PURE__ */ __name(function forEachEvent2(self2, handler, events, qualifier, callback, conf8, confOverrides) { + if (fn$6(qualifier)) { + callback = qualifier; + qualifier = null; + } + if (confOverrides) { + if (conf8 == null) { + conf8 = confOverrides; + } else { + conf8 = extend2({}, conf8, confOverrides); + } + } + var eventList = array2(events) ? events : events.split(/\s+/); + for (var i2 = 0; i2 < eventList.length; i2++) { + var evt = eventList[i2]; + if (emptyString(evt)) { + continue; + } + var match2 = evt.match(eventRegex); + if (match2) { + var type3 = match2[1]; + var namespace = match2[2] ? match2[2] : null; + var ret = handler(self2, evt, type3, namespace, qualifier, callback, conf8); + if (ret === false) { + break; } - function QD(a, b) { - if (bE(a)) { - return !!PD[b]; - } else if (a.Sm) { - return !!a.Sm[b]; - } else if (_D(a)) { - return !!OD[b]; - } else if ($D(a)) { - return !!ND[b]; - } + } + } + }, "forEachEvent"); + makeEventObj = /* @__PURE__ */ __name(function makeEventObj2(self2, obj) { + self2.addEventFields(self2.context, obj); + return new Event(obj.type, obj); + }, "makeEventObj"); + forEachEventObj = /* @__PURE__ */ __name(function forEachEventObj2(self2, handler, events) { + if (event(events)) { + handler(self2, events); + return; + } else if (plainObject(events)) { + handler(self2, makeEventObj(self2, events)); + return; + } + var eventList = array2(events) ? events : events.split(/\s+/); + for (var i2 = 0; i2 < eventList.length; i2++) { + var evt = eventList[i2]; + if (emptyString(evt)) { + continue; + } + var match2 = evt.match(eventRegex); + if (match2) { + var type3 = match2[1]; + var namespace = match2[2] ? match2[2] : null; + var eventObj = makeEventObj(self2, { + type: type3, + namespace, + target: self2.context + }); + handler(self2, eventObj); + } + } + }, "forEachEventObj"); + p2.on = p2.addListener = function(events, qualifier, callback, conf8, confOverrides) { + forEachEvent(this, function(self2, event3, type3, namespace, qualifier2, callback2, conf9) { + if (fn$6(callback2)) { + self2.listeners.push({ + event: event3, + // full event string + callback: callback2, + // callback to run + type: type3, + // the event type (e.g. 'click') + namespace, + // the event namespace (e.g. ".foo") + qualifier: qualifier2, + // a restriction on whether to match this emitter + conf: conf9 + // additional configuration + }); + } + }, events, qualifier, callback, conf8, confOverrides); + return this; + }; + p2.one = function(events, qualifier, callback, conf8) { + return this.on(events, qualifier, callback, conf8, { + one: true + }); + }; + p2.removeListener = p2.off = function(events, qualifier, callback, conf8) { + var _this = this; + if (this.emitting !== 0) { + this.listeners = copyArray$1(this.listeners); + } + var listeners = this.listeners; + var _loop = /* @__PURE__ */ __name(function _loop2(i3) { + var listener = listeners[i3]; + forEachEvent(_this, function(self2, event3, type3, namespace, qualifier2, callback2) { + if ((listener.type === type3 || events === "*") && (!namespace && listener.namespace !== ".*" || listener.namespace === namespace) && (!qualifier2 || self2.qualifierCompare(listener.qualifier, qualifier2)) && (!callback2 || listener.callback === callback2)) { + listeners.splice(i3, 1); return false; } - function udc(a) { - var b; - b = a.a; - do { - b = RD(hs(new is(Mr(Z2b(b).a.Kc(), new ir()))), 18).c.i; - b.k == (r3b(), o3b) && a.b.Fc(b); - } while (b.k == (r3b(), o3b)); - a.b = hv(a.b); - } - function UGc(a, b) { - var c2, d, e; - e = a; - for (d = new is(Mr(Z2b(b).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - !!c2.c.i.c && (e = $wnd.Math.max(e, c2.c.i.c.p)); - } - return e; - } - function INb(a, b) { - var c2, d, e; - e = 0; - d = RD(RD(Qc(a.r, b), 21), 87).Kc(); - while (d.Ob()) { - c2 = RD(d.Pb(), 117); - e += c2.d.d + c2.b.Mf().b + c2.d.a; - d.Ob() && (e += a.w); - } - return e; - } - function AMb(a, b) { - var c2, d, e; - e = 0; - d = RD(RD(Qc(a.r, b), 21), 87).Kc(); - while (d.Ob()) { - c2 = RD(d.Pb(), 117); - e += c2.d.b + c2.b.Mf().a + c2.d.c; - d.Ob() && (e += a.w); - } - return e; - } - function O2c(a) { - var b, c2, d, e; - d = 0; - e = Q2c(a); - if (e.c.length == 0) { - return 1; - } else { - for (c2 = new Anb(e); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 27); - d += O2c(b); - } - } - return d; - } - function aIc(a) { - var b, c2, d; - d = a.c.a; - a.p = (Qb(d), new dnb(d)); - for (c2 = new Anb(d); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - b.p = eIc(b).a; - } - yob(); - _mb(a.p, new nIc()); - } - function UJd(a, b, c2) { - var d, e, f2, g; - d = a.dd(b); - if (d != -1) { - if (a.Pj()) { - f2 = a.Qj(); - g = cJd(a, d); - e = a.Ij(4, g, null, d, f2); - !c2 ? c2 = e : c2.nj(e); - } else { - cJd(a, d); - } - } - return c2; - } - function rLd(a, b, c2) { - var d, e, f2, g; - d = a.dd(b); - if (d != -1) { - if (a.Pj()) { - f2 = a.Qj(); - g = THd(a, d); - e = a.Ij(4, g, null, d, f2); - !c2 ? c2 = e : c2.nj(e); - } else { - THd(a, d); - } - } - return c2; - } - function Tje(a, b, c2, d) { - var e, f2, g; - if (c2.Xh(b)) { - nke(); - if (wWd(b)) { - e = RD(c2.Mh(b), 160); - Wje(a, e); - } else { - f2 = (g = b, !g ? null : RD(d, 54).gi(g)); - !!f2 && Uje(c2.Mh(b), f2); - } - } - } - function Dvd(a, b, c2, d) { - var e, f2, g; - f2 = vYd(a.Dh(), b); - e = b - a.ji(); - return e < 0 ? (g = a.Ih(f2), g >= 0 ? a.Lh(g, c2, true) : Qvd(a, f2, c2)) : RD(f2, 69).wk().yk(a, a.hi(), e, c2, d); - } - function aNb(a, b, c2, d) { - var e, f2; - f2 = b.pf((umd(), ild)) ? RD(b.of(ild), 21) : a.j; - e = lMb(f2); - if (e == (hMb(), gMb)) { - return; + }, events, qualifier, callback, conf8); + }, "_loop"); + for (var i2 = listeners.length - 1; i2 >= 0; i2--) { + _loop(i2); + } + return this; + }; + p2.removeAllListeners = function() { + return this.removeListener("*"); + }; + p2.emit = p2.trigger = function(events, extraParams, manualCallback) { + var listeners = this.listeners; + var numListenersBeforeEmit = listeners.length; + this.emitting++; + if (!array2(extraParams)) { + extraParams = [extraParams]; + } + forEachEventObj(this, function(self2, eventObj) { + if (manualCallback != null) { + listeners = [{ + event: eventObj.event, + type: eventObj.type, + namespace: eventObj.namespace, + callback: manualCallback + }]; + numListenersBeforeEmit = listeners.length; + } + var _loop2 = /* @__PURE__ */ __name(function _loop22(i3) { + var listener = listeners[i3]; + if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self2.eventMatches(self2.context, listener, eventObj)) { + var args = [eventObj]; + if (extraParams != null) { + push(args, extraParams); } - if (c2 && !jMb(e)) { - return; + self2.beforeEmit(self2.context, listener, eventObj); + if (listener.conf && listener.conf.one) { + self2.listeners = self2.listeners.filter(function(l2) { + return l2 !== listener; + }); } - LKb(cNb(a, e, d), b); - } - function Y6b(a) { - switch (a.g) { - case 1: - return mOb(), lOb; - case 3: - return mOb(), iOb; - case 2: - return mOb(), kOb; - case 4: - return mOb(), jOb; - default: - return null; + var context = self2.callbackContext(self2.context, listener, eventObj); + var ret = listener.callback.apply(context, args); + self2.afterEmit(self2.context, listener, eventObj); + if (ret === false) { + eventObj.stopPropagation(); + eventObj.preventDefault(); } } - function kmc(a, b, c2) { - if (a.e) { - switch (a.b) { - case 1: - Ulc(a.c, b, c2); - break; - case 0: - Vlc(a.c, b, c2); - } - } else { - Slc(a.c, b, c2); - } - a.a[b.p][c2.p] = a.c.i; - a.a[c2.p][b.p] = a.c.e; + }, "_loop2"); + for (var i2 = 0; i2 < numListenersBeforeEmit; i2++) { + _loop2(i2); + } + if (self2.bubble(self2.context) && !eventObj.isPropagationStopped()) { + self2.parent(self2.context).emit(eventObj, extraParams); + } + }, events); + this.emitting--; + return this; + }; + emitterOptions$1 = { + qualifierCompare: /* @__PURE__ */ __name(function qualifierCompare2(selector1, selector2) { + if (selector1 == null || selector2 == null) { + return selector1 == null && selector2 == null; + } else { + return selector1.sameText(selector2); + } + }, "qualifierCompare"), + eventMatches: /* @__PURE__ */ __name(function eventMatches2(ele, listener, eventObj) { + var selector = listener.qualifier; + if (selector != null) { + return ele !== eventObj.target && element(eventObj.target) && selector.matches(eventObj.target); + } + return true; + }, "eventMatches"), + addEventFields: /* @__PURE__ */ __name(function addEventFields2(ele, evt) { + evt.cy = ele.cy(); + evt.target = ele; + }, "addEventFields"), + callbackContext: /* @__PURE__ */ __name(function callbackContext2(ele, listener, eventObj) { + return listener.qualifier != null ? eventObj.target : ele; + }, "callbackContext"), + beforeEmit: /* @__PURE__ */ __name(function beforeEmit2(context, listener) { + if (listener.conf && listener.conf.once) { + listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback); + } + }, "beforeEmit"), + bubble: /* @__PURE__ */ __name(function bubble2() { + return true; + }, "bubble"), + parent: /* @__PURE__ */ __name(function parent3(ele) { + return ele.isChild() ? ele.parent() : ele.cy(); + }, "parent") + }; + argSelector$1 = /* @__PURE__ */ __name(function argSelector(arg) { + if (string(arg)) { + return new Selector(arg); + } else { + return arg; + } + }, "argSelector"); + elesfn$9 = { + createEmitter: /* @__PURE__ */ __name(function createEmitter() { + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var _p = ele._private; + if (!_p.emitter) { + _p.emitter = new Emitter2(emitterOptions$1, ele); } - function LLc(a) { - var b, c2; - if (a == null) { - return null; - } - c2 = $C(jR, Nve, 199, a.length, 0, 2); - for (b = 0; b < c2.length; b++) { - c2[b] = RD(Gnb(a[b], a[b].length), 199); - } - return c2; - } - function Dhe(a) { - var b; - if (Bhe(a)) { - Ahe(a); - if (a.ul()) { - b = Bge(a.e, a.b, a.c, a.a, a.j); - a.j = b; - } - a.g = a.a; - ++a.a; - ++a.c; - a.i = 0; - return a.j; - } else { - throw Adb(new Dvb()); - } - } - function YOb(a, b) { - var c2, d, e, f2; - f2 = a.o; - c2 = a.p; - f2 < c2 ? f2 *= f2 : c2 *= c2; - d = f2 + c2; - f2 = b.o; - c2 = b.p; - f2 < c2 ? f2 *= f2 : c2 *= c2; - e = f2 + c2; - if (d < e) { - return -1; - } - if (d == e) { - return 0; - } - return 1; - } - function fZd(a, b) { - var c2, d, e; - e = RHd(a, b); - if (e >= 0) - return e; - if (a.ol()) { - for (d = 0; d < a.i; ++d) { - c2 = a.pl(RD(a.g[d], 58)); - if (dE(c2) === dE(b)) { - return d; - } - } - } - return -1; - } - function eHd(a, b, c2) { - var d, e; - e = a.gc(); - if (b >= e) - throw Adb(new aMd(b, e)); - if (a.Si()) { - d = a.dd(c2); - if (d >= 0 && d != b) { - throw Adb(new agb(LIe)); - } - } - return a.Xi(b, c2); - } - function wx(a, b) { - this.a = RD(Qb(a), 253); - this.b = RD(Qb(b), 253); - if (a.Ed(b) > 0 || a == (Wk(), Vk) || b == (kl(), jl)) { - throw Adb(new agb("Invalid range: " + Dx(a, b))); - } - } - function p_b(a) { - var b, c2; - this.b = new bnb(); - this.c = a; - this.a = false; - for (c2 = new Anb(a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - this.a = this.a | b.k == (r3b(), p3b); - } - } - function xIb(a, b) { - var c2, d, e; - c2 = eJb(new gJb(), a); - for (e = new Anb(b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 125); - rIb(uIb(tIb(vIb(sIb(new wIb(), 0), 0), c2), d)); - } - return c2; - } - function y0b(a, b, c2) { - c2.Ug("Compound graph preprocessor", 1); - a.a = new Tp(); - D0b(a, b, null); - x0b(a, b); - C0b(a); - pQb(b, (Ywc(), _vc), a.a); - a.a = null; - akb(a.b); - c2.Vg(); - } - function aec(a, b, c2) { - var d, e, f2; - for (e = new is(Mr((b ? Z2b(a) : a3b(a)).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - f2 = b ? d.c.i : d.d.i; - f2.k == (r3b(), n3b) && g3b(f2, c2); - } - } - function FZc(a, b) { - var c2, d, e; - b.Ug("Untreeify", 1); - c2 = RD(mQb(a, (q$c(), k$c)), 15); - for (e = c2.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 65); - Mub(d.b.d, d); - Mub(d.c.b, d); - } - b.Vg(); - } - function Znc(a) { - var b, c2, d; - for (d = RD(Qc(a.a, (Bnc(), znc)), 15).Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 105); - b = foc(c2); - Qnc(a, c2, b[0], (joc(), goc), 0); - Qnc(a, c2, b[1], ioc, 1); - } - } - function $nc(a) { - var b, c2, d; - for (d = RD(Qc(a.a, (Bnc(), Anc)), 15).Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 105); - b = foc(c2); - Qnc(a, c2, b[0], (joc(), goc), 0); - Qnc(a, c2, b[1], ioc, 1); - } - } - function wDc() { - wDc = geb; - uDc = new yDc(LAe, 0); - vDc = new yDc("PORT_POSITION", 1); - tDc = new yDc("NODE_SIZE_WHERE_SPACE_PERMITS", 2); - sDc = new yDc("NODE_SIZE", 3); - } - function z6c() { - z6c = geb; - w6c = new A6c("INTERACTIVE_NODE_REORDERER", 0); - y6c = new A6c("MIN_SIZE_PRE_PROCESSOR", 1); - x6c = new A6c("MIN_SIZE_POST_PROCESSOR", 2); - } - function Rjd() { - Rjd = geb; - Ljd = new Sjd("AUTOMATIC", 0); - Ojd = new Sjd(Nye, 1); - Pjd = new Sjd(Oye, 2); - Qjd = new Sjd("TOP", 3); - Mjd = new Sjd(Qye, 4); - Njd = new Sjd(Kye, 5); - } - function Pjb(a, b, c2, d) { - Ljb(); - var e, f2; - e = 0; - for (f2 = 0; f2 < c2; f2++) { - e = Bdb(Ndb(Cdb(b[f2], yxe), Cdb(d, yxe)), Cdb(Ydb(e), yxe)); - a[f2] = Ydb(e); - e = Udb(e, 32); - } - return Ydb(e); - } - function qKb(a, b, c2) { - var d, e; - e = 0; - for (d = 0; d < iKb; d++) { - e = $wnd.Math.max(e, gKb(a.a[b.g][d], c2)); - } - b == (ZJb(), XJb) && !!a.b && (e = $wnd.Math.max(e, a.b.b)); - return e; - } - function Jwb(a, b) { - var c2, d; - lFb(b > 0); - if ((b & -b) == b) { - return eE(b * Kwb(a, 31) * 4656612873077393e-25); - } - do { - c2 = Kwb(a, 31); - d = c2 % b; - } while (c2 - d + (b - 1) < 0); - return eE(d); - } - function d2b(a, b, c2) { - switch (c2.g) { - case 1: - a.a = b.a / 2; - a.b = 0; - break; - case 2: - a.a = b.a; - a.b = b.b / 2; - break; - case 3: - a.a = b.a / 2; - a.b = b.b; - break; - case 4: - a.a = 0; - a.b = b.b / 2; - } - } - function Onc(a, b, c2, d) { - var e, f2; - for (e = b; e < a.c.length; e++) { - f2 = (tFb(e, a.c.length), RD(a.c[e], 12)); - if (c2.Mb(f2)) { - ZEb(d.c, f2); - } else { - return e; - } - } - return a.c.length; - } - function u5c(a) { - switch (a.g) { - case 0: - return null; - case 1: - return new _5c(); - case 2: - return new R5c(); - default: - throw Adb(new agb(mFe + (a.f != null ? a.f : "" + a.g))); - } - } - function U9c(a, b, c2) { - var d, e; - L9c(a, b - a.s, c2 - a.t); - for (e = new Anb(a.n); e.a < e.c.c.length; ) { - d = RD(ynb(e), 209); - Y9c(d, d.e + b - a.s); - Z9c(d, d.f + c2 - a.t); - } - a.s = b; - a.t = c2; - } - function AIb(a) { - var b, c2, d, e, f2; - c2 = 0; - for (e = new Anb(a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 125); - d.d = c2++; - } - b = zIb(a); - f2 = null; - b.c.length > 1 && (f2 = xIb(a, b)); - return f2; - } - function yqd(a) { - var b; - b = Kfb(UD(Gxd(a, (umd(), lmd)))) * $wnd.Math.sqrt((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a).i); - return new rjd(b, b / Kfb(UD(Gxd(a, kmd)))); - } - function Dzd(a) { - var b; - if (!!a.f && a.f.Vh()) { - b = RD(a.f, 54); - a.f = RD(Vvd(a, b), 84); - a.f != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 9, 8, b, a.f)); - } - return a.f; - } - function Ezd(a) { - var b; - if (!!a.i && a.i.Vh()) { - b = RD(a.i, 54); - a.i = RD(Vvd(a, b), 84); - a.i != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 9, 7, b, a.i)); - } - return a.i; - } - function Z5d(a) { - var b; - if (!!a.b && (a.b.Db & 64) != 0) { - b = a.b; - a.b = RD(Vvd(a, b), 19); - a.b != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 9, 21, b, a.b)); - } - return a.b; - } - function UNd(a, b) { - var c2, d, e; - if (a.d == null) { - ++a.e; - ++a.f; - } else { - d = b.Bi(); - _Nd(a, a.f + 1); - e = (d & lve) % a.d.length; - c2 = a.d[e]; - !c2 && (c2 = a.d[e] = a.dk()); - c2.Fc(b); - ++a.f; - } - } - function Mge(a, b, c2) { - var d; - if (b.tk()) { - return false; - } else if (b.Ik() != -2) { - d = b.ik(); - return d == null ? c2 == null : pb(d, c2); - } else - return b.qk() == a.e.Dh() && c2 == null; - } - function Io() { - var a; - dk(16, fwe); - a = Wp(16); - this.b = $C(XF, ewe, 303, a, 0, 1); - this.c = $C(XF, ewe, 303, a, 0, 1); - this.a = null; - this.e = null; - this.i = 0; - this.f = a - 1; - this.g = 0; - } - function j3b(a) { - v2b.call(this); - this.k = (r3b(), p3b); - this.j = (dk(6, iwe), new cnb(6)); - this.b = (dk(2, iwe), new cnb(2)); - this.d = new T2b(); - this.f = new C3b(); - this.a = a; - } - function wgc(a) { - var b, c2; - if (a.c.length <= 1) { - return; - } - b = tgc(a, (qpd(), npd)); - vgc(a, RD(b.a, 17).a, RD(b.b, 17).a); - c2 = tgc(a, ppd); - vgc(a, RD(c2.a, 17).a, RD(c2.b, 17).a); - } - function vHc(a, b, c2) { - var d, e; - e = a.a.b; - for (d = e.c.length; d < c2; d++) { - Qmb(e, e.c.length, new R4b(a.a)); - } - g3b(b, (tFb(c2 - 1, e.c.length), RD(e.c[c2 - 1], 30))); - a.b[b.p] = c2; - } - function K_c(a, b) { - var c2, d, e; - a.b[b.g] = 1; - for (d = Sub(b.d, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 65); - e = c2.c; - a.b[e.g] == 1 ? Mub(a.a, c2) : a.b[e.g] == 2 ? a.b[e.g] = 1 : K_c(a, e); - } - } - function u3c(a, b, c2, d) { - var e, f2, g; - e = d ? RD(Qc(a.a, b), 21) : RD(Qc(a.b, b), 21); - for (g = e.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 27); - if (o3c(a, c2, f2)) { - return true; - } - } - return false; - } - function d$d(a) { - var b, c2; - for (c2 = new dMd(a); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 89); - if (!!b.e || (!b.d && (b.d = new XZd(o7, b, 1)), b.d).i != 0) { - return true; - } - } - return false; - } - function o5d(a) { - var b, c2; - for (c2 = new dMd(a); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 89); - if (!!b.e || (!b.d && (b.d = new XZd(o7, b, 1)), b.d).i != 0) { - return true; - } - } - return false; - } - function dIc(a) { - var b, c2, d; - b = 0; - for (d = new Anb(a.c.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - b += Kr(new is(Mr(a3b(c2).a.Kc(), new ir()))); - } - return b / a.c.a.c.length; - } - function Tcd() { - Tcd = geb; - Scd = (Kcd(), Jcd); - Qcd = new A3b(8); - new mGd((umd(), tld), Qcd); - new mGd(fmd, 8); - Rcd = Hcd; - Ocd = xcd; - Pcd = ycd; - Ncd = new mGd(Mkd, (Geb(), false)); - } - function $dd(a, b, c2) { - var d; - c2.Ug("Shrinking tree compaction", 1); - if (Heb(TD(mQb(b, (OQb(), MQb))))) { - Ydd(a, b.f); - zQb(b.f, (d = b.c, d)); - } else { - zQb(b.f, b.c); - } - c2.Vg(); - } - function Uyd(a, b, c2, d) { - switch (b) { - case 7: - return !a.e && (a.e = new Yie(G4, a, 7, 4)), a.e; - case 8: - return !a.d && (a.d = new Yie(G4, a, 8, 5)), a.d; - } - return vyd(a, b, c2, d); - } - function h2d(a) { - var b; - if (!!a.a && a.a.Vh()) { - b = RD(a.a, 54); - a.a = RD(Vvd(a, b), 142); - a.a != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 9, 5, b, a.a)); - } - return a.a; - } - function Xqe(a) { - if (a < 48) - return -1; - if (a > 102) - return -1; - if (a <= 57) - return a - 48; - if (a < 65) - return -1; - if (a <= 70) - return a - 65 + 10; - if (a < 97) - return -1; - return a - 97 + 10; - } - function ck(a, b) { - if (a == null) { - throw Adb(new Ogb("null key in entry: null=" + b)); - } else if (b == null) { - throw Adb(new Ogb("null value in entry: " + a + "=null")); - } - } - function Cr(a, b) { - var c2, d; - while (a.Ob()) { - if (!b.Ob()) { - return false; - } - c2 = a.Pb(); - d = b.Pb(); - if (!(dE(c2) === dE(d) || c2 != null && pb(c2, d))) { - return false; - } - } - return !b.Ob(); - } - function aLb(a, b) { - var c2; - c2 = cD(WC(iE, 1), vxe, 28, 15, [gKb(a.a[0], b), gKb(a.a[1], b), gKb(a.a[2], b)]); - if (a.d) { - c2[0] = $wnd.Math.max(c2[0], c2[2]); - c2[2] = c2[0]; - } - return c2; - } - function bLb(a, b) { - var c2; - c2 = cD(WC(iE, 1), vxe, 28, 15, [hKb(a.a[0], b), hKb(a.a[1], b), hKb(a.a[2], b)]); - if (a.d) { - c2[0] = $wnd.Math.max(c2[0], c2[2]); - c2[2] = c2[0]; - } - return c2; - } - function vIc(a, b, c2) { - if (!Cod(RD(mQb(b, (yCc(), BBc)), 101))) { - uIc(a, b, e3b(b, c2)); - uIc(a, b, e3b(b, (qpd(), npd))); - uIc(a, b, e3b(b, Yod)); - yob(); - _mb(b.j, new JIc(a)); - } - } - function sUc(a) { - var b, c2; - a.c || vUc(a); - c2 = new Ejd(); - b = new Anb(a.a); - ynb(b); - while (b.a < b.c.c.length) { - Mub(c2, RD(ynb(b), 418).a); - } - sFb(c2.b != 0); - Wub(c2, c2.c.b); - return c2; - } - function O9c(a, b, c2) { - var d, e, f2, g, h; - h = a.r + b; - a.r += b; - a.d += c2; - d = c2 / a.n.c.length; - e = 0; - for (g = new Anb(a.n); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 209); - X9c(f2, h, d, e); - ++e; - } - } - function kHb(a) { - var b, c2, d; - a.b.a.$b(); - a.a = $C(hN, rve, 60, a.c.c.a.b.c.length, 0, 1); - b = 0; - for (d = new Anb(a.c.c.a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 60); - c2.f = b++; - } - } - function TYb(a) { - var b, c2, d; - a.b.a.$b(); - a.a = $C(bQ, rve, 86, a.c.a.a.b.c.length, 0, 1); - b = 0; - for (d = new Anb(a.c.a.a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 86); - c2.i = b++; - } - } - function Er(a) { - var b; - b = yr(a); - if (!gs(a)) { - throw Adb(new veb("position (0) must be less than the number of elements that remained (" + b + ")")); - } - return hs(a); - } - function ZCb(a, b) { - var c2; - if (!a.a) { - c2 = $C(iE, vxe, 28, 0, 15, 1); - ixb(a.b.a, new bDb(c2)); - bFb(c2, heb(iob.prototype.Me, iob, [])); - a.a = new Lxb(c2, a.d); - } - return zxb(a.a, b); - } - function $Pb(b, c2, d) { - var e; - try { - return PPb(b, c2 + b.j, d + b.k); - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - e = a; - throw Adb(new veb(e.g + ize + c2 + pve + d + ").")); - } else - throw Adb(a); - } - } - function _Pb(b, c2, d) { - var e; - try { - return QPb(b, c2 + b.j, d + b.k); - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - e = a; - throw Adb(new veb(e.g + ize + c2 + pve + d + ").")); - } else - throw Adb(a); - } - } - function aQb(b, c2, d) { - var e; - try { - return RPb(b, c2 + b.j, d + b.k); - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - e = a; - throw Adb(new veb(e.g + ize + c2 + pve + d + ").")); - } else - throw Adb(a); - } - } - function J8b(a) { - switch (a.g) { - case 1: - return qpd(), ppd; - case 4: - return qpd(), Yod; - case 3: - return qpd(), Xod; - case 2: - return qpd(), npd; - default: - return qpd(), opd; - } - } - function Imc(a, b, c2) { - if (b.k == (r3b(), p3b) && c2.k == o3b) { - a.d = Fmc(b, (qpd(), npd)); - a.b = Fmc(b, Yod); - } - if (c2.k == p3b && b.k == o3b) { - a.d = Fmc(c2, (qpd(), Yod)); - a.b = Fmc(c2, npd); - } - } - function Mmc(a, b) { - var c2, d, e; - e = b3b(a, b); - for (d = e.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 12); - if (mQb(c2, (Ywc(), Iwc)) != null || k4b(new l4b(c2.b))) { - return true; - } - } - return false; - } - function RNc(a, b, c2) { - c2.Ug("Linear segments node placement", 1); - a.b = RD(mQb(b, (Ywc(), Qwc)), 312); - SNc(a, b); - NNc(a, b); - KNc(a, b); - QNc(a); - a.a = null; - a.b = null; - c2.Vg(); - } - function W9c(a, b) { - Dyd(b, a.e + a.d + (a.c.c.length == 0 ? 0 : a.b)); - Eyd(b, a.f); - a.a = $wnd.Math.max(a.a, b.f); - a.d += b.g + (a.c.c.length == 0 ? 0 : a.b); - Rmb(a.c, b); - return true; - } - function bad(a, b, c2) { - var d, e, f2, g; - g = 0; - d = c2 / a.a.c.length; - for (f2 = new Anb(a.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 172); - U9c(e, e.s, e.t + g * d); - O9c(e, a.d - e.r + b, d); - ++g; - } - } - function Cid(a, b) { - var c2, d, e, f2, g, h; - e = b.length - 1; - g = 0; - h = 0; - for (d = 0; d <= e; d++) { - f2 = b[d]; - c2 = vid(e, d) * Iid(1 - a, e - d) * Iid(a, d); - g += f2.a * c2; - h += f2.b * c2; - } - return new rjd(g, h); - } - function JHd(a, b) { - var c2, d, e, f2, g; - c2 = b.gc(); - a._i(a.i + c2); - f2 = b.Kc(); - g = a.i; - a.i += c2; - for (d = g; d < a.i; ++d) { - e = f2.Pb(); - MHd(a, d, a.Zi(d, e)); - a.Mi(d, e); - a.Ni(); - } - return c2 != 0; - } - function TJd(a, b, c2) { - var d, e, f2; - if (a.Pj()) { - d = a.Ej(); - f2 = a.Qj(); - ++a.j; - a.qj(d, a.Zi(d, b)); - e = a.Ij(3, null, b, d, f2); - !c2 ? c2 = e : c2.nj(e); - } else { - $Id(a, a.Ej(), b); - } - return c2; - } - function u0d(a, b, c2) { - var d, e, f2; - d = RD(QHd(tYd(a.a), b), 89); - f2 = (e = d.c, ZD(e, 90) ? RD(e, 29) : (JTd(), zTd)); - ((f2.Db & 64) != 0 ? Vvd(a.b, f2) : f2) == c2 ? i2d(d) : l2d(d, c2); - return f2; - } - function pne(a) { - var b; - return a == null ? null : new ejb((b = nue(a, true), b.length > 0 && (BFb(0, b.length), b.charCodeAt(0) == 43) ? (BFb(1, b.length + 1), b.substr(1)) : b)); - } - function qne(a) { - var b; - return a == null ? null : new ejb((b = nue(a, true), b.length > 0 && (BFb(0, b.length), b.charCodeAt(0) == 43) ? (BFb(1, b.length + 1), b.substr(1)) : b)); - } - function Syb(a, b, c2, d, e, f2, g, h) { - var i2, j; - if (!d) { - return; - } - i2 = d.a[0]; - !!i2 && Syb(a, b, c2, i2, e, f2, g, h); - Tyb(a, c2, d.d, e, f2, g, h) && b.Fc(d); - j = d.a[1]; - !!j && Syb(a, b, c2, j, e, f2, g, h); + } + return this; + }, "createEmitter"), + emitter: /* @__PURE__ */ __name(function emitter() { + return this._private.emitter; + }, "emitter"), + on: /* @__PURE__ */ __name(function on(events, selector, callback) { + var argSel = argSelector$1(selector); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + ele.emitter().on(events, argSel, callback); + } + return this; + }, "on"), + removeListener: /* @__PURE__ */ __name(function removeListener(events, selector, callback) { + var argSel = argSelector$1(selector); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + ele.emitter().removeListener(events, argSel, callback); + } + return this; + }, "removeListener"), + removeAllListeners: /* @__PURE__ */ __name(function removeAllListeners() { + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + ele.emitter().removeAllListeners(); + } + return this; + }, "removeAllListeners"), + one: /* @__PURE__ */ __name(function one2(events, selector, callback) { + var argSel = argSelector$1(selector); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + ele.emitter().one(events, argSel, callback); + } + return this; + }, "one"), + once: /* @__PURE__ */ __name(function once(events, selector, callback) { + var argSel = argSelector$1(selector); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + ele.emitter().on(events, argSel, callback, { + once: true, + onceCollection: this + }); + } + }, "once"), + emit: /* @__PURE__ */ __name(function emit(events, extraParams) { + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + ele.emitter().emit(events, extraParams); + } + return this; + }, "emit"), + emitAndNotify: /* @__PURE__ */ __name(function emitAndNotify(event3, extraParams) { + if (this.length === 0) { + return; + } + this.cy().notify(event3, this); + this.emit(event3, extraParams); + return this; + }, "emitAndNotify") + }; + define2.eventAliasesOn(elesfn$9); + elesfn$8 = { + nodes: /* @__PURE__ */ __name(function nodes3(selector) { + return this.filter(function(ele) { + return ele.isNode(); + }).filter(selector); + }, "nodes"), + edges: /* @__PURE__ */ __name(function edges3(selector) { + return this.filter(function(ele) { + return ele.isEdge(); + }).filter(selector); + }, "edges"), + // internal helper to get nodes and edges as separate collections with single iteration over elements + byGroup: /* @__PURE__ */ __name(function byGroup() { + var nodes6 = this.spawn(); + var edges5 = this.spawn(); + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + if (ele.isNode()) { + nodes6.push(ele); + } else { + edges5.push(ele); } - function PPb(b, c2, d) { - try { - return Gdb(SPb(b, c2, d), 1); - } catch (a) { - a = zdb(a); - if (ZD(a, 333)) { - throw Adb(new veb(fze + b.o + "*" + b.p + gze + c2 + pve + d + hze)); - } else - throw Adb(a); + } + return { + nodes: nodes6, + edges: edges5 + }; + }, "byGroup"), + filter: /* @__PURE__ */ __name(function filter5(_filter, thisArg) { + if (_filter === void 0) { + return this; + } else if (string(_filter) || elementOrCollection(_filter)) { + return new Selector(_filter).filter(this); + } else if (fn$6(_filter)) { + var filterEles = this.spawn(); + var eles = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var include = thisArg ? _filter.apply(thisArg, [ele, i2, eles]) : _filter(ele, i2, eles); + if (include) { + filterEles.push(ele); } } - function QPb(b, c2, d) { - try { - return Gdb(SPb(b, c2, d), 0); - } catch (a) { - a = zdb(a); - if (ZD(a, 333)) { - throw Adb(new veb(fze + b.o + "*" + b.p + gze + c2 + pve + d + hze)); - } else - throw Adb(a); - } + return filterEles; + } + return this.spawn(); + }, "filter"), + not: /* @__PURE__ */ __name(function not(toRemove) { + if (!toRemove) { + return this; + } else { + if (string(toRemove)) { + toRemove = this.filter(toRemove); } - function RPb(b, c2, d) { - try { - return Gdb(SPb(b, c2, d), 2); - } catch (a) { - a = zdb(a); - if (ZD(a, 333)) { - throw Adb(new veb(fze + b.o + "*" + b.p + gze + c2 + pve + d + hze)); - } else - throw Adb(a); + var elements3 = this.spawn(); + for (var i2 = 0; i2 < this.length; i2++) { + var element3 = this[i2]; + var remove3 = toRemove.has(element3); + if (!remove3) { + elements3.push(element3); } } - function lMd(b, c2) { - if (b.g == -1) { - throw Adb(new cgb()); - } - b.Xj(); - try { - b.d.hd(b.g, c2); - b.f = b.d.j; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - throw Adb(new Jrb()); - } else - throw Adb(a); - } - } - function Y7b(a) { - var b, c2, d, e, f2; - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - b = 0; - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - e.p = b++; - } - } - } - function Ee(a, b) { - var c2, d, e, f2; - f2 = a.gc(); - b.length < f2 && (b = cFb(new Array(f2), b)); - e = b; - d = a.Kc(); - for (c2 = 0; c2 < f2; ++c2) { - bD(e, c2, d.Pb()); - } - b.length > f2 && bD(b, f2, null); - return b; - } - function av(a, b) { - var c2, d; - d = a.gc(); - if (b == null) { - for (c2 = 0; c2 < d; c2++) { - if (a.Xb(c2) == null) { - return c2; - } - } - } else { - for (c2 = 0; c2 < d; c2++) { - if (pb(b, a.Xb(c2))) { - return c2; - } - } - } - return -1; + return elements3; + } + }, "not"), + absoluteComplement: /* @__PURE__ */ __name(function absoluteComplement() { + var cy = this.cy(); + return cy.mutableElements().not(this); + }, "absoluteComplement"), + intersect: /* @__PURE__ */ __name(function intersect2(other) { + if (string(other)) { + var selector = other; + return this.filter(selector); + } + var elements3 = this.spawn(); + var col1 = this; + var col2 = other; + var col1Smaller = this.length < other.length; + var colS = col1Smaller ? col1 : col2; + var colL = col1Smaller ? col2 : col1; + for (var i2 = 0; i2 < colS.length; i2++) { + var ele = colS[i2]; + if (colL.has(ele)) { + elements3.push(ele); } - function Jd(a, b) { - var c2, d, e; - c2 = b.ld(); - e = b.md(); - d = a.xc(c2); - if (!(dE(e) === dE(d) || e != null && pb(e, d))) { - return false; - } - if (d == null && !a._b(c2)) { - return false; + } + return elements3; + }, "intersect"), + xor: /* @__PURE__ */ __name(function xor(other) { + var cy = this._private.cy; + if (string(other)) { + other = cy.$(other); + } + var elements3 = this.spawn(); + var col1 = this; + var col2 = other; + var add3 = /* @__PURE__ */ __name(function add4(col, other2) { + for (var i2 = 0; i2 < col.length; i2++) { + var ele = col[i2]; + var id26 = ele._private.data.id; + var inOther = other2.hasElementWithId(id26); + if (!inOther) { + elements3.push(ele); } - return true; } - function mD(a, b) { - var c2, d, e; - if (b <= 22) { - c2 = a.l & (1 << b) - 1; - d = e = 0; - } else if (b <= 44) { - c2 = a.l; - d = a.m & (1 << b - 22) - 1; - e = 0; + }, "add"); + add3(col1, col2); + add3(col2, col1); + return elements3; + }, "xor"), + diff: /* @__PURE__ */ __name(function diff(other) { + var cy = this._private.cy; + if (string(other)) { + other = cy.$(other); + } + var left3 = this.spawn(); + var right3 = this.spawn(); + var both = this.spawn(); + var col1 = this; + var col2 = other; + var add3 = /* @__PURE__ */ __name(function add4(col, other2, retEles) { + for (var i2 = 0; i2 < col.length; i2++) { + var ele = col[i2]; + var id26 = ele._private.data.id; + var inOther = other2.hasElementWithId(id26); + if (inOther) { + both.merge(ele); } else { - c2 = a.l; - d = a.m; - e = a.h & (1 << b - 44) - 1; - } - return hD(c2, d, e); - } - function pNb(a, b) { - switch (b.g) { - case 1: - return a.f.n.d + a.t; - case 3: - return a.f.n.a + a.t; - case 2: - return a.f.n.c + a.s; - case 4: - return a.f.n.b + a.s; - default: - return 0; + retEles.push(ele); } } - function TNb(a, b) { - var c2, d; - d = b.c; - c2 = b.a; - switch (a.b.g) { - case 0: - c2.d = a.e - d.a - d.d; - break; - case 1: - c2.d += a.e; - break; - case 2: - c2.c = a.e - d.a - d.d; - break; - case 3: - c2.c = a.e + d.d; - } - } - function QRb(a, b, c2, d) { - var e, f2; - this.a = b; - this.c = d; - e = a.a; - PRb(this, new rjd(-e.c, -e.d)); - $id(this.b, c2); - f2 = d / 2; - b.a ? njd(this.b, 0, f2) : njd(this.b, f2, 0); - Rmb(a.c, this); - } - function i2c(a, b, c2, d) { - var e; - this.c = a; - this.d = b; - e = new Yub(); - Pub(e, c2, e.c.b, e.c); - this.a = e; - this.b = RD(mQb(d, (h_c(), H$c)), 88); - this.e = Kfb(UD(mQb(d, $$c))); - h2c(this); - } - function j5c() { - j5c = geb; - i5c = new l5c(LAe, 0); - g5c = new l5c(EBe, 1); - h5c = new l5c("EDGE_LENGTH_BY_POSITION", 2); - f5c = new l5c("CROSSING_MINIMIZATION_BY_POSITION", 3); - } - function uEd(a, b) { - var c2, d; - c2 = RD(Ao(a.g, b), 27); - if (c2) { - return c2; - } - d = RD(Ao(a.j, b), 123); - if (d) { - return d; - } - throw Adb(new CDd("Referenced shape does not exist: " + b)); - } - function Pk(b, c2) { - var d, e; - if (ZD(c2, 253)) { - e = RD(c2, 253); - try { - d = b.Ed(e); - return d == 0; - } catch (a) { - a = zdb(a); - if (ZD(a, 212)) { - return false; - } else - throw Adb(a); - } - } - return false; + }, "add"); + add3(col1, col2, left3); + add3(col2, col1, right3); + return { + left: left3, + right: right3, + both + }; + }, "diff"), + add: /* @__PURE__ */ __name(function add(toAdd) { + var cy = this._private.cy; + if (!toAdd) { + return this; + } + if (string(toAdd)) { + var selector = toAdd; + toAdd = cy.mutableElements().filter(selector); + } + var elements3 = this.spawnSelf(); + for (var i2 = 0; i2 < toAdd.length; i2++) { + var ele = toAdd[i2]; + var add3 = !this.has(ele); + if (add3) { + elements3.push(ele); } - function tWb(a, b) { - if (a.c == b) { - return a.d; - } else if (a.d == b) { - return a.c; - } else { - throw Adb(new agb("Node 'one' must be either source or target of edge 'edge'.")); - } + } + return elements3; + }, "add"), + // in place merge on calling collection + merge: /* @__PURE__ */ __name(function merge3(toAdd) { + var _p = this._private; + var cy = _p.cy; + if (!toAdd) { + return this; + } + if (toAdd && string(toAdd)) { + var selector = toAdd; + toAdd = cy.mutableElements().filter(selector); + } + var map5 = _p.map; + for (var i2 = 0; i2 < toAdd.length; i2++) { + var toAddEle = toAdd[i2]; + var id26 = toAddEle._private.data.id; + var add3 = !map5.has(id26); + if (add3) { + var index = this.length++; + this[index] = toAddEle; + map5.set(id26, { + ele: toAddEle, + index + }); } - function rRc(a, b) { - if (a.c.i == b) { - return a.d.i; - } else if (a.d.i == b) { - return a.c.i; - } else { - throw Adb(new agb("Node " + b + " is neither source nor target of edge " + a)); - } + } + return this; + }, "merge"), + unmergeAt: /* @__PURE__ */ __name(function unmergeAt(i2) { + var ele = this[i2]; + var id26 = ele.id(); + var _p = this._private; + var map5 = _p.map; + this[i2] = void 0; + map5["delete"](id26); + var unmergedLastEle = i2 === this.length - 1; + if (this.length > 1 && !unmergedLastEle) { + var lastEleI = this.length - 1; + var lastEle = this[lastEleI]; + var lastEleId = lastEle._private.data.id; + this[lastEleI] = void 0; + this[i2] = lastEle; + map5.set(lastEleId, { + ele: lastEle, + index: i2 + }); + } + this.length--; + return this; + }, "unmergeAt"), + // remove single ele in place in calling collection + unmergeOne: /* @__PURE__ */ __name(function unmergeOne(ele) { + ele = ele[0]; + var _p = this._private; + var id26 = ele._private.data.id; + var map5 = _p.map; + var entry = map5.get(id26); + if (!entry) { + return this; + } + var i2 = entry.index; + this.unmergeAt(i2); + return this; + }, "unmergeOne"), + // remove eles in place on calling collection + unmerge: /* @__PURE__ */ __name(function unmerge(toRemove) { + var cy = this._private.cy; + if (!toRemove) { + return this; + } + if (toRemove && string(toRemove)) { + var selector = toRemove; + toRemove = cy.mutableElements().filter(selector); + } + for (var i2 = 0; i2 < toRemove.length; i2++) { + this.unmergeOne(toRemove[i2]); + } + return this; + }, "unmerge"), + unmergeBy: /* @__PURE__ */ __name(function unmergeBy(toRmFn) { + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var ele = this[i2]; + if (toRmFn(ele)) { + this.unmergeAt(i2); } - function $gc(a, b, c2) { - c2.Ug("Self-Loop ordering", 1); - FDb(GDb(CDb(CDb(EDb(new SDb(null, new Swb(b.b, 16)), new chc()), new ehc()), new ghc()), new ihc()), new khc(a)); - c2.Vg(); + } + return this; + }, "unmergeBy"), + map: /* @__PURE__ */ __name(function map3(mapFn, thisArg) { + var arr = []; + var eles = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var ret = thisArg ? mapFn.apply(thisArg, [ele, i2, eles]) : mapFn(ele, i2, eles); + arr.push(ret); + } + return arr; + }, "map"), + reduce: /* @__PURE__ */ __name(function reduce2(fn3, initialValue) { + var val = initialValue; + var eles = this; + for (var i2 = 0; i2 < eles.length; i2++) { + val = fn3(val, eles[i2], i2, eles); + } + return val; + }, "reduce"), + max: /* @__PURE__ */ __name(function max8(valFn, thisArg) { + var max10 = -Infinity; + var maxEle; + var eles = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var val = thisArg ? valFn.apply(thisArg, [ele, i2, eles]) : valFn(ele, i2, eles); + if (val > max10) { + max10 = val; + maxEle = ele; } - function Fpc(a, b) { - var c2; - switch (b.g) { - case 2: - case 4: - c2 = a.a; - a.c.d.n.b < c2.d.n.b && (c2 = a.c); - Gpc(a, b, (enc(), dnc), c2); - break; - case 1: - case 3: - Gpc(a, b, (enc(), anc), null); - } - } - function Ypc(a, b, c2, d, e, f2) { - var g, h, i2, j, k; - g = Wpc(b, c2, f2); - h = c2 == (qpd(), Yod) || c2 == ppd ? -1 : 1; - j = a[c2.g]; - for (k = 0; k < j.length; k++) { - i2 = j[k]; - i2 > 0 && (i2 += e); - j[k] = g; - g += h * (i2 + d); - } - } - function vsc(a) { - var b, c2, d; - d = a.f; - a.n = $C(iE, vxe, 28, d, 15, 1); - a.d = $C(iE, vxe, 28, d, 15, 1); - for (b = 0; b < d; b++) { - c2 = RD(Vmb(a.c.b, b), 30); - a.n[b] = ssc(a, c2); - a.d[b] = rsc(a, c2); - } - } - function Xwd(a, b) { - var c2, d, e; - e = 0; - for (d = 2; d < b; d <<= 1) { - (a.Db & d) != 0 && ++e; - } - if (e == 0) { - for (c2 = b <<= 1; c2 <= 128; c2 <<= 1) { - if ((a.Db & c2) != 0) { - return 0; - } - } - return -1; - } else { - return e; - } + } + return { + value: max10, + ele: maxEle + }; + }, "max"), + min: /* @__PURE__ */ __name(function min7(valFn, thisArg) { + var min9 = Infinity; + var minEle; + var eles = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var val = thisArg ? valFn.apply(thisArg, [ele, i2, eles]) : valFn(ele, i2, eles); + if (val < min9) { + min9 = val; + minEle = ele; } - function Sge(a, b) { - var c2, d, e, f2, g; - g = pke(a.e.Dh(), b); - f2 = null; - c2 = RD(a.g, 124); - for (e = 0; e < a.i; ++e) { - d = c2[e]; - if (g.am(d.Lk())) { - !f2 && (f2 = new YHd()); - WGd(f2, d); - } + } + return { + value: min9, + ele: minEle + }; + }, "min") + }; + fn$1 = elesfn$8; + fn$1["u"] = fn$1["|"] = fn$1["+"] = fn$1.union = fn$1.or = fn$1.add; + fn$1["\\"] = fn$1["!"] = fn$1["-"] = fn$1.difference = fn$1.relativeComplement = fn$1.subtract = fn$1.not; + fn$1["n"] = fn$1["&"] = fn$1["."] = fn$1.and = fn$1.intersection = fn$1.intersect; + fn$1["^"] = fn$1["(+)"] = fn$1["(-)"] = fn$1.symmetricDifference = fn$1.symdiff = fn$1.xor; + fn$1.fnFilter = fn$1.filterFn = fn$1.stdFilter = fn$1.filter; + fn$1.complement = fn$1.abscomp = fn$1.absoluteComplement; + elesfn$7 = { + isNode: /* @__PURE__ */ __name(function isNode() { + return this.group() === "nodes"; + }, "isNode"), + isEdge: /* @__PURE__ */ __name(function isEdge() { + return this.group() === "edges"; + }, "isEdge"), + isLoop: /* @__PURE__ */ __name(function isLoop() { + return this.isEdge() && this.source()[0] === this.target()[0]; + }, "isLoop"), + isSimple: /* @__PURE__ */ __name(function isSimple() { + return this.isEdge() && this.source()[0] !== this.target()[0]; + }, "isSimple"), + group: /* @__PURE__ */ __name(function group() { + var ele = this[0]; + if (ele) { + return ele._private.group; + } + }, "group") + }; + zIndexSort = /* @__PURE__ */ __name(function zIndexSort2(a2, b2) { + var cy = a2.cy(); + var hasCompoundNodes2 = cy.hasCompoundNodes(); + function getDepth(ele) { + var style3 = ele.pstyle("z-compound-depth"); + if (style3.value === "auto") { + return hasCompoundNodes2 ? ele.zDepth() : 0; + } else if (style3.value === "bottom") { + return -1; + } else if (style3.value === "top") { + return MAX_INT$1; + } + return 0; + } + __name(getDepth, "getDepth"); + var depthDiff = getDepth(a2) - getDepth(b2); + if (depthDiff !== 0) { + return depthDiff; + } + function getEleDepth(ele) { + var style3 = ele.pstyle("z-index-compare"); + if (style3.value === "auto") { + return ele.isNode() ? 1 : 0; + } + return 0; + } + __name(getEleDepth, "getEleDepth"); + var eleDiff = getEleDepth(a2) - getEleDepth(b2); + if (eleDiff !== 0) { + return eleDiff; + } + var zDiff = a2.pstyle("z-index").value - b2.pstyle("z-index").value; + if (zDiff !== 0) { + return zDiff; + } + return a2.poolIndex() - b2.poolIndex(); + }, "zIndexSort"); + elesfn$6 = { + forEach: /* @__PURE__ */ __name(function forEach2(fn3, thisArg) { + if (fn$6(fn3)) { + var N2 = this.length; + for (var i2 = 0; i2 < N2; i2++) { + var ele = this[i2]; + var ret = thisArg ? fn3.apply(thisArg, [ele, i2, this]) : fn3(ele, i2, this); + if (ret === false) { + break; } - !!f2 && wLd(a, f2); } - function ene(a) { - var b, c2, d; - if (!a) - return null; - if (a.dc()) - return ""; - d = new Qhb(); - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - Nhb(d, WD(b)); - d.a += " "; - } - return qeb(d, d.a.length - 1); - } - function _C(a, b) { - var c2 = new Array(b); - var d; - switch (a) { - case 14: - case 15: - d = 0; - break; - case 16: - d = false; - break; - default: - return c2; - } - for (var e = 0; e < b; ++e) { - c2[e] = d; - } - return c2; - } - function GGb(a) { - var b, c2, d; - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - b.c.$b(); - } - Dmd(a.d) ? d = a.a.c : d = a.a.d; - Umb(d, new WGb(a)); - a.c.df(a); - HGb(a); - } - function oUb(a) { - var b, c2, d, e; - for (c2 = new Anb(a.e.c); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 290); - for (e = new Anb(b.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 454); - hUb(d); - } - YTb(b); - } - } - function gad(a) { - var b, c2, d, e, f2; - d = 0; - f2 = 0; - e = 0; - for (c2 = new Anb(a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 172); - f2 = $wnd.Math.max(f2, b.r); - d += b.d + (e > 0 ? a.c : 0); - ++e; - } - a.b = d; - a.d = f2; - } - function rKb(a, b) { - var c2; - c2 = cD(WC(iE, 1), vxe, 28, 15, [qKb(a, (ZJb(), WJb), b), qKb(a, XJb, b), qKb(a, YJb, b)]); - if (a.f) { - c2[0] = $wnd.Math.max(c2[0], c2[2]); - c2[2] = c2[0]; - } - return c2; - } - function cQb(b, c2, d) { - var e; - try { - TPb(b, c2 + b.j, d + b.k, false, true); - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - e = a; - throw Adb(new veb(e.g + ize + c2 + pve + d + ").")); - } else - throw Adb(a); - } - } - function dQb(b, c2, d) { - var e; - try { - TPb(b, c2 + b.j, d + b.k, true, false); - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - e = a; - throw Adb(new veb(e.g + ize + c2 + pve + d + ").")); - } else - throw Adb(a); - } - } - function u8b(a) { - var b; - if (!nQb(a, (yCc(), dBc))) { - return; - } - b = RD(mQb(a, dBc), 21); - if (b.Hc((dod(), Xnd))) { - b.Mc(Xnd); - b.Fc(Znd); - } else if (b.Hc(Znd)) { - b.Mc(Znd); - b.Fc(Xnd); - } + } + return this; + }, "forEach"), + toArray: /* @__PURE__ */ __name(function toArray() { + var array4 = []; + for (var i2 = 0; i2 < this.length; i2++) { + array4.push(this[i2]); + } + return array4; + }, "toArray"), + slice: /* @__PURE__ */ __name(function slice2(start3, end2) { + var array4 = []; + var thisSize = this.length; + if (end2 == null) { + end2 = thisSize; + } + if (start3 == null) { + start3 = 0; + } + if (start3 < 0) { + start3 = thisSize + start3; + } + if (end2 < 0) { + end2 = thisSize + end2; + } + for (var i2 = start3; i2 >= 0 && i2 < end2 && i2 < thisSize; i2++) { + array4.push(this[i2]); + } + return this.spawn(array4); + }, "slice"), + size: /* @__PURE__ */ __name(function size3() { + return this.length; + }, "size"), + eq: /* @__PURE__ */ __name(function eq3(i2) { + return this[i2] || this.spawn(); + }, "eq"), + first: /* @__PURE__ */ __name(function first2() { + return this[0] || this.spawn(); + }, "first"), + last: /* @__PURE__ */ __name(function last2() { + return this[this.length - 1] || this.spawn(); + }, "last"), + empty: /* @__PURE__ */ __name(function empty2() { + return this.length === 0; + }, "empty"), + nonempty: /* @__PURE__ */ __name(function nonempty() { + return !this.empty(); + }, "nonempty"), + sort: /* @__PURE__ */ __name(function sort2(sortFn) { + if (!fn$6(sortFn)) { + return this; + } + var sorted = this.toArray().sort(sortFn); + return this.spawn(sorted); + }, "sort"), + sortByZIndex: /* @__PURE__ */ __name(function sortByZIndex() { + return this.sort(zIndexSort); + }, "sortByZIndex"), + zDepth: /* @__PURE__ */ __name(function zDepth() { + var ele = this[0]; + if (!ele) { + return void 0; + } + var _p = ele._private; + var group2 = _p.group; + if (group2 === "nodes") { + var depth = _p.data.parent ? ele.parents().size() : 0; + if (!ele.isParent()) { + return MAX_INT$1 - 1; } - function v8b(a) { - var b; - if (!nQb(a, (yCc(), dBc))) { - return; - } - b = RD(mQb(a, dBc), 21); - if (b.Hc((dod(), cod))) { - b.Mc(cod); - b.Fc(aod); - } else if (b.Hc(aod)) { - b.Mc(aod); - b.Fc(cod); - } - } - function oqc(a, b, c2, d) { - var e, f2, g, h; - a.a == null && rqc(a, b); - g = b.b.j.c.length; - f2 = c2.d.p; - h = d.d.p; - e = h - 1; - e < 0 && (e = g - 1); - return f2 <= e ? a.a[e] - a.a[f2] : a.a[g - 1] - a.a[f2] + a.a[e]; - } - function Cud(a) { - var b, c2; - if (!a.b) { - a.b = fv(RD(a.f, 27).kh().i); - for (c2 = new dMd(RD(a.f, 27).kh()); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 135); - Rmb(a.b, new Bud(b)); - } - } - return a.b; - } - function Dud(a) { - var b, c2; - if (!a.e) { - a.e = fv(wCd(RD(a.f, 27)).i); - for (c2 = new dMd(wCd(RD(a.f, 27))); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 123); - Rmb(a.e, new Rud(b)); - } - } - return a.e; - } - function yud(a) { - var b, c2; - if (!a.a) { - a.a = fv(tCd(RD(a.f, 27)).i); - for (c2 = new dMd(tCd(RD(a.f, 27))); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 27); - Rmb(a.a, new Fud(a, b)); - } - } - return a.a; - } - function DXd(b) { - var c2; - if (!b.C && (b.D != null || b.B != null)) { - c2 = EXd(b); - if (c2) { - b.hl(c2); + return depth; + } else { + var src = _p.source; + var tgt = _p.target; + var srcDepth = src.zDepth(); + var tgtDepth = tgt.zDepth(); + return Math.max(srcDepth, tgtDepth, 0); + } + }, "zDepth") + }; + elesfn$6.each = elesfn$6.forEach; + defineSymbolIterator = /* @__PURE__ */ __name(function defineSymbolIterator2() { + var typeofUndef = "undefined"; + var isIteratorSupported = (typeof Symbol === "undefined" ? "undefined" : _typeof(Symbol)) != typeofUndef && _typeof(Symbol.iterator) != typeofUndef; + if (isIteratorSupported) { + elesfn$6[Symbol.iterator] = function() { + var _this = this; + var entry = { + value: void 0, + done: false + }; + var i2 = 0; + var length2 = this.length; + return _defineProperty$1({ + next: /* @__PURE__ */ __name(function next3() { + if (i2 < length2) { + entry.value = _this[i2++]; } else { - try { - b.hl(null); - } catch (a) { - a = zdb(a); - if (!ZD(a, 63)) - throw Adb(a); - } + entry.value = void 0; + entry.done = true; } - } - return b.C; + return entry; + }, "next") + }, Symbol.iterator, function() { + return this; + }); + }; + } + }, "defineSymbolIterator"); + defineSymbolIterator(); + getLayoutDimensionOptions = defaults$g({ + nodeDimensionsIncludeLabels: false + }); + elesfn$5 = { + // Calculates and returns node dimensions { x, y } based on options given + layoutDimensions: /* @__PURE__ */ __name(function layoutDimensions(options3) { + options3 = getLayoutDimensionOptions(options3); + var dims; + if (!this.takesUpSpace()) { + dims = { + w: 0, + h: 0 + }; + } else if (options3.nodeDimensionsIncludeLabels) { + var bbDim = this.boundingBox(); + dims = { + w: bbDim.w, + h: bbDim.h + }; + } else { + dims = { + w: this.outerWidth(), + h: this.outerHeight() + }; + } + if (dims.w === 0 || dims.h === 0) { + dims.w = dims.h = 1; + } + return dims; + }, "layoutDimensions"), + // using standard layout options, apply position function (w/ or w/o animation) + layoutPositions: /* @__PURE__ */ __name(function layoutPositions(layout6, options3, fn3) { + var nodes6 = this.nodes().filter(function(n2) { + return !n2.isParent(); + }); + var cy = this.cy(); + var layoutEles = options3.eles; + var getMemoizeKey = /* @__PURE__ */ __name(function getMemoizeKey2(node3) { + return node3.id(); + }, "getMemoizeKey"); + var fnMem = memoize$1(fn3, getMemoizeKey); + layout6.emit({ + type: "layoutstart", + layout: layout6 + }); + layout6.animations = []; + var calculateSpacing = /* @__PURE__ */ __name(function calculateSpacing2(spacing2, nodesBb, pos) { + var center4 = { + x: nodesBb.x1 + nodesBb.w / 2, + y: nodesBb.y1 + nodesBb.h / 2 + }; + var spacingVector = { + // scale from center of bounding box (not necessarily 0,0) + x: (pos.x - center4.x) * spacing2, + y: (pos.y - center4.y) * spacing2 + }; + return { + x: center4.x + spacingVector.x, + y: center4.y + spacingVector.y + }; + }, "calculateSpacing"); + var useSpacingFactor = options3.spacingFactor && options3.spacingFactor !== 1; + var spacingBb = /* @__PURE__ */ __name(function spacingBb2() { + if (!useSpacingFactor) { + return null; } - function xMb(a) { - switch (a.q.g) { - case 5: - uMb(a, (qpd(), Yod)); - uMb(a, npd); - break; - case 4: - vMb(a, (qpd(), Yod)); - vMb(a, npd); - break; - default: - wMb(a, (qpd(), Yod)); - wMb(a, npd); - } + var bb2 = makeBoundingBox(); + for (var i3 = 0; i3 < nodes6.length; i3++) { + var node3 = nodes6[i3]; + var pos = fnMem(node3, i3); + expandBoundingBoxByPoint(bb2, pos.x, pos.y); } - function GNb(a) { - switch (a.q.g) { - case 5: - DNb(a, (qpd(), Xod)); - DNb(a, ppd); - break; - case 4: - ENb(a, (qpd(), Xod)); - ENb(a, ppd); - break; - default: - FNb(a, (qpd(), Xod)); - FNb(a, ppd); - } - } - function G$b(a, b) { - var c2, d, e; - e = new pjd(); - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 36); - w$b(c2, e.a, 0); - e.a += c2.f.a + b; - e.b = $wnd.Math.max(e.b, c2.f.b); - } - e.b > 0 && (e.b += b); - return e; - } - function I$b(a, b) { - var c2, d, e; - e = new pjd(); - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 36); - w$b(c2, 0, e.b); - e.b += c2.f.b + b; - e.a = $wnd.Math.max(e.a, c2.f.a); - } - e.a > 0 && (e.a += b); - return e; - } - function l2b(a) { - var b, c2, d; - d = lve; - for (c2 = new Anb(a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - nQb(b, (Ywc(), zwc)) && (d = $wnd.Math.min(d, RD(mQb(b, zwc), 17).a)); - } - return d; - } - function PLc(a, b) { - var c2, d; - if (b.length == 0) { - return 0; - } - c2 = lMc(a.a, b[0], (qpd(), ppd)); - c2 += lMc(a.a, b[b.length - 1], Xod); - for (d = 0; d < b.length; d++) { - c2 += QLc(a, d, b); - } - return c2; - } - function VUc() { - HUc(); - this.c = new bnb(); - this.i = new bnb(); - this.e = new Iub(); - this.f = new Iub(); - this.g = new Iub(); - this.j = new bnb(); - this.a = new bnb(); - this.b = new Tsb(); - this.k = new Tsb(); - } - function AXd(a, b) { - var c2, d; - if (a.Db >> 16 == 6) { - return a.Cb.Th(a, 5, t7, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? a.ii() : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function kA(a) { - fA(); - var b = a.e; - if (b && b.stack) { - var c2 = b.stack; - var d = b + "\n"; - c2.substring(0, d.length) == d && (c2 = c2.substring(d.length)); - return c2.split("\n"); - } - return []; + return bb2; + }, "spacingBb"); + var bb = spacingBb(); + var getFinalPos = memoize$1(function(node3, i3) { + var newPos2 = fnMem(node3, i3); + if (useSpacingFactor) { + var spacing2 = Math.abs(options3.spacingFactor); + newPos2 = calculateSpacing(spacing2, bb, newPos2); } - function pgb(a) { - var b; - b = (wgb(), vgb); - return b[a >>> 28] | b[a >> 24 & 15] << 4 | b[a >> 20 & 15] << 8 | b[a >> 16 & 15] << 12 | b[a >> 12 & 15] << 16 | b[a >> 8 & 15] << 20 | b[a >> 4 & 15] << 24 | b[a & 15] << 28; + if (options3.transform != null) { + newPos2 = options3.transform(node3, newPos2); } - function mmb(a) { - var b, c2, d; - if (a.b != a.c) { - return; - } - d = a.a.length; - c2 = mgb($wnd.Math.max(8, d)) << 1; - if (a.b != 0) { - b = WEb(a.a, c2); - lmb(a, b, d); - a.a = b; - a.b = 0; + return newPos2; + }, getMemoizeKey); + if (options3.animate) { + for (var i2 = 0; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; + var newPos = getFinalPos(node2, i2); + var animateNode = options3.animateFilter == null || options3.animateFilter(node2, i2); + if (animateNode) { + var ani = node2.animation({ + position: newPos, + duration: options3.animationDuration, + easing: options3.animationEasing + }); + layout6.animations.push(ani); } else { - aFb(a.a, c2); - } - a.c = d; - } - function uNb(a, b) { - var c2; - c2 = a.b; - return c2.pf((umd(), Gld)) ? c2.ag() == (qpd(), ppd) ? -c2.Mf().a - Kfb(UD(c2.of(Gld))) : b + Kfb(UD(c2.of(Gld))) : c2.ag() == (qpd(), ppd) ? -c2.Mf().a : b; - } - function X2b(a) { - var b; - if (a.b.c.length != 0 && !!RD(Vmb(a.b, 0), 72).a) { - return RD(Vmb(a.b, 0), 72).a; - } - b = R0b(a); - if (b != null) { - return b; + node2.position(newPos); } - return "" + (!a.c ? -1 : Wmb(a.c.a, a, 0)); } - function M3b(a) { - var b; - if (a.f.c.length != 0 && !!RD(Vmb(a.f, 0), 72).a) { - return RD(Vmb(a.f, 0), 72).a; - } - b = R0b(a); - if (b != null) { - return b; - } - return "" + (!a.i ? -1 : Wmb(a.i.j, a, 0)); + if (options3.fit) { + var fitAni = cy.animation({ + fit: { + boundingBox: layoutEles.boundingBoxAt(getFinalPos), + padding: options3.padding + }, + duration: options3.animationDuration, + easing: options3.animationEasing + }); + layout6.animations.push(fitAni); + } else if (options3.zoom !== void 0 && options3.pan !== void 0) { + var zoomPanAni = cy.animation({ + zoom: options3.zoom, + pan: options3.pan, + duration: options3.animationDuration, + easing: options3.animationEasing + }); + layout6.animations.push(zoomPanAni); } - function skc(a, b) { - var c2, d; - if (b < 0 || b >= a.gc()) { - return null; - } - for (c2 = b; c2 < a.gc(); ++c2) { - d = RD(a.Xb(c2), 131); - if (c2 == a.gc() - 1 || !d.o) { - return new Ptd(sgb(c2), d); - } - } - return null; + layout6.animations.forEach(function(ani2) { + return ani2.play(); + }); + layout6.one("layoutready", options3.ready); + layout6.emit({ + type: "layoutready", + layout: layout6 + }); + Promise$1.all(layout6.animations.map(function(ani2) { + return ani2.promise(); + })).then(function() { + layout6.one("layoutstop", options3.stop); + layout6.emit({ + type: "layoutstop", + layout: layout6 + }); + }); + } else { + nodes6.positions(getFinalPos); + if (options3.fit) { + cy.fit(options3.eles, options3.padding); } - function Xrc(a, b, c2) { - var d, e, f2, g, h; - f2 = a.c; - h = c2 ? b : a; - d = c2 ? a : b; - for (e = h.p + 1; e < d.p; ++e) { - g = RD(Vmb(f2.a, e), 10); - if (!(g.k == (r3b(), l3b) || Yrc(g))) { - return false; - } - } - return true; + if (options3.zoom != null) { + cy.zoom(options3.zoom); } - function Ead(a) { - var b, c2, d, e, f2; - f2 = 0; - e = pxe; - d = 0; - for (c2 = new Anb(a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 172); - f2 += b.r + (d > 0 ? a.c : 0); - e = $wnd.Math.max(e, b.d); - ++d; - } - a.e = f2; - a.b = e; - } - function Qud(a) { - var b, c2; - if (!a.b) { - a.b = fv(RD(a.f, 123).kh().i); - for (c2 = new dMd(RD(a.f, 123).kh()); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 135); - Rmb(a.b, new Bud(b)); - } - } - return a.b; - } - function aHd(a, b) { - var c2, d, e; - if (b.dc()) { - return jQd(), jQd(), iQd; - } else { - c2 = new ZLd(a, b.gc()); - for (e = new dMd(a); e.e != e.i.gc(); ) { - d = bMd(e); - b.Hc(d) && WGd(c2, d); - } - return c2; - } + if (options3.pan) { + cy.pan(options3.pan); } - function Axd(a, b, c2, d) { - if (b == 0) { - return d ? (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), a.o) : (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), dOd(a.o)); - } - return Dvd(a, b, c2, d); - } - function rBd(a) { - var b, c2; - if (a.rb) { - for (b = 0, c2 = a.rb.i; b < c2; ++b) { - aAd(QHd(a.rb, b)); - } - } - if (a.vb) { - for (b = 0, c2 = a.vb.i; b < c2; ++b) { - aAd(QHd(a.vb, b)); - } - } - Uee((lke(), jke), a); - a.Bb |= 1; - } - function zBd(a, b, c2, d, e, f2, g, h, i2, j, k, l, m, n) { - ABd(a, b, d, null, e, f2, g, h, i2, j, m, true, n); - a6d(a, k); - ZD(a.Cb, 90) && v$d(yYd(RD(a.Cb, 90)), 2); - !!c2 && b6d(a, c2); - c6d(a, l); - return a; - } - function Jae(b) { - var c2, d; - if (b == null) { - return null; - } - d = 0; - try { - d = Oeb(b, qwe, lve) & Bwe; - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - c2 = Ahb(b); - d = c2[0]; - } else - throw Adb(a); - } - return hfb(d); - } - function Kae(b) { - var c2, d; - if (b == null) { - return null; - } - d = 0; - try { - d = Oeb(b, qwe, lve) & Bwe; - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - c2 = Ahb(b); - d = c2[0]; - } else - throw Adb(a); - } - return hfb(d); - } - function rD(a, b) { - var c2, d, e; - e = a.h - b.h; - if (e < 0) { - return false; - } - c2 = a.l - b.l; - d = a.m - b.m + (c2 >> 22); - e += d >> 22; - if (e < 0) { - return false; - } - a.l = c2 & dxe; - a.m = d & dxe; - a.h = e & exe; - return true; - } - function Tyb(a, b, c2, d, e, f2, g) { - var h, i2; - if (b.Te() && (i2 = a.a.Ne(c2, d), i2 < 0 || !e && i2 == 0)) { - return false; - } - if (b.Ue() && (h = a.a.Ne(c2, f2), h > 0 || !g && h == 0)) { - return false; - } - return true; - } - function Agc(a, b) { - sgc(); - var c2; - c2 = a.j.g - b.j.g; - if (c2 != 0) { - return 0; - } - switch (a.j.g) { - case 2: - return Cgc(b, rgc) - Cgc(a, rgc); - case 4: - return Cgc(a, qgc) - Cgc(b, qgc); - } - return 0; + layout6.one("layoutready", options3.ready); + layout6.emit({ + type: "layoutready", + layout: layout6 + }); + layout6.one("layoutstop", options3.stop); + layout6.emit({ + type: "layoutstop", + layout: layout6 + }); + } + return this; + }, "layoutPositions"), + layout: /* @__PURE__ */ __name(function layout2(options3) { + var cy = this.cy(); + return cy.makeLayout(extend2({}, options3, { + eles: this + })); + }, "layout") + }; + elesfn$5.createLayout = elesfn$5.makeLayout = elesfn$5.layout; + __name(styleCache, "styleCache"); + __name(cacheStyleFunction, "cacheStyleFunction"); + __name(cachePrototypeStyleFunction, "cachePrototypeStyleFunction"); + elesfn$4 = { + recalculateRenderedStyle: /* @__PURE__ */ __name(function recalculateRenderedStyle(useCache) { + var cy = this.cy(); + var renderer7 = cy.renderer(); + var styleEnabled2 = cy.styleEnabled(); + if (renderer7 && styleEnabled2) { + renderer7.recalculateRenderedStyle(this, useCache); + } + return this; + }, "recalculateRenderedStyle"), + dirtyStyleCache: /* @__PURE__ */ __name(function dirtyStyleCache() { + var cy = this.cy(); + var dirty = /* @__PURE__ */ __name(function dirty2(ele) { + return ele._private.styleCache = null; + }, "dirty"); + if (cy.hasCompoundNodes()) { + var eles; + eles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); + eles.merge(eles.connectedEdges()); + eles.forEach(dirty); + } else { + this.forEach(function(ele) { + dirty(ele); + ele.connectedEdges().forEach(dirty); + }); + } + return this; + }, "dirtyStyleCache"), + // fully updates (recalculates) the style for the elements + updateStyle: /* @__PURE__ */ __name(function updateStyle(notifyRenderer) { + var cy = this._private.cy; + if (!cy.styleEnabled()) { + return this; + } + if (cy.batching()) { + var bEles = cy._private.batchStyleEles; + bEles.merge(this); + return this; + } + var hasCompounds = cy.hasCompoundNodes(); + var updatedEles = this; + notifyRenderer = notifyRenderer || notifyRenderer === void 0 ? true : false; + if (hasCompounds) { + updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); + } + var changedEles = updatedEles; + if (notifyRenderer) { + changedEles.emitAndNotify("style"); + } else { + changedEles.emit("style"); + } + updatedEles.forEach(function(ele) { + return ele._private.styleDirty = true; + }); + return this; + }, "updateStyle"), + // private: clears dirty flag and recalculates style + cleanStyle: /* @__PURE__ */ __name(function cleanStyle() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return; + } + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + if (ele._private.styleDirty) { + ele._private.styleDirty = false; + cy.style().apply(ele); } - function uuc(a) { - switch (a.g) { - case 0: - return nuc; - case 1: - return ouc; - case 2: - return puc; - case 3: - return quc; - case 4: - return ruc; - case 5: - return suc; - default: - return null; - } + } + }, "cleanStyle"), + // get the internal parsed style object for the specified property + parsedStyle: /* @__PURE__ */ __name(function parsedStyle(property2) { + var includeNonDefault = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + var ele = this[0]; + var cy = ele.cy(); + if (!cy.styleEnabled()) { + return; + } + if (ele) { + this.cleanStyle(); + var overriddenStyle = ele._private.style[property2]; + if (overriddenStyle != null) { + return overriddenStyle; + } else if (includeNonDefault) { + return cy.style().getDefaultProperty(property2); + } else { + return null; } - function cBd(a, b, c2) { - var d, e; - d = (e = new R5d(), YVd(e, b), PAd(e, c2), WGd((!a.c && (a.c = new C5d(u7, a, 12, 10)), a.c), e), e); - $Vd(d, 0); - bWd(d, 1); - aWd(d, true); - _Vd(d, true); - return d; - } - function THd(a, b) { - var c2, d; - if (b >= a.i) - throw Adb(new yNd(b, a.i)); - ++a.j; - c2 = a.g[b]; - d = a.i - b - 1; - d > 0 && hib(a.g, b + 1, a.g, b, d); - bD(a.g, --a.i, null); - a.Qi(b, c2); - a.Ni(); - return c2; - } - function sWd(a, b) { - var c2, d; - if (a.Db >> 16 == 17) { - return a.Cb.Th(a, 21, h7, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? a.ii() : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function _Fb(a) { - var b, c2, d, e; - yob(); - _mb(a.c, a.a); - for (e = new Anb(a.c); e.a < e.c.c.length; ) { - d = ynb(e); - for (c2 = new Anb(a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 693); - b.bf(d); - } - } - } - function r$b(a) { - var b, c2, d, e; - yob(); - _mb(a.c, a.a); - for (e = new Anb(a.c); e.a < e.c.c.length; ) { - d = ynb(e); - for (c2 = new Anb(a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 382); - b.bf(d); - } - } - } - function rJb(a) { - var b, c2, d, e, f2; - e = lve; - f2 = null; - for (d = new Anb(a.d); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 218); - if (c2.d.j ^ c2.e.j) { - b = c2.e.e - c2.d.e - c2.a; - if (b < e) { - e = b; - f2 = c2; - } - } - } - return f2; - } - function QVb() { - QVb = geb; - OVb = new lGd(vAe, (Geb(), false)); - KVb = new lGd(wAe, 100); - MVb = (AWb(), yWb); - LVb = new lGd(xAe, MVb); - NVb = new lGd(yAe, Vze); - PVb = new lGd(zAe, sgb(lve)); - } - function Xlc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - j = 0; - for (e = a.a[b], f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - k = aMc(d, c2); - for (i2 = k.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 12); - Zjb(a.f, h, sgb(j++)); - } - } - } - function UDd(a, b, c2) { - var d, e, f2, g; - if (c2) { - e = c2.a.length; - d = new vue(e); - for (g = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); g.Ob(); ) { - f2 = RD(g.Pb(), 17); - Rc(a, b, tDd(JB(c2, f2.a))); - } - } - } - function VDd(a, b, c2) { - var d, e, f2, g; - if (c2) { - e = c2.a.length; - d = new vue(e); - for (g = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); g.Ob(); ) { - f2 = RD(g.Pb(), 17); - Rc(a, b, tDd(JB(c2, f2.a))); - } - } - } - function foc(a) { - Mnc(); - var b; - b = RD(Ee(Ec(a.k), $C(E3, NAe, 64, 2, 0, 1)), 126); - Wnb(b, 0, b.length, null); - if (b[0] == (qpd(), Yod) && b[1] == ppd) { - bD(b, 0, ppd); - bD(b, 1, Yod); - } - return b; - } - function hMc(a, b, c2) { - var d, e, f2; - e = fMc(a, b, c2); - f2 = iMc(a, e); - YLc(a.b); - CMc(a, b, c2); - yob(); - _mb(e, new HMc(a)); - d = iMc(a, e); - YLc(a.b); - CMc(a, c2, b); - return new Ptd(sgb(f2), sgb(d)); - } - function JNc() { - JNc = geb; - GNc = pfd(new ufd(), (sXb(), rXb), (hcc(), ybc)); - HNc = new kGd("linearSegments.inputPrio", sgb(0)); - INc = new kGd("linearSegments.outputPrio", sgb(0)); - } - function YVc() { - YVc = geb; - UVc = new $Vc("P1_TREEIFICATION", 0); - VVc = new $Vc("P2_NODE_ORDERING", 1); - WVc = new $Vc("P3_NODE_PLACEMENT", 2); - XVc = new $Vc("P4_EDGE_ROUTING", 3); - } - function yad(a) { - var b, c2, d, e; - c2 = 0; - b = 0; - for (e = new dMd(a); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - c2 = $wnd.Math.max(d.g + d.i, c2); - b = $wnd.Math.max(d.f + d.j, b); - } - return new rjd(c2, b); - } - function ard(a, b) { - var c2, d, e, f2; - f2 = 0; - for (d = new Anb(a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 27); - f2 += $wnd.Math.pow(c2.g * c2.f - b, 2); - } - e = $wnd.Math.sqrt(f2 / (a.c.length - 1)); - return e; - } - function Pnd() { - Pnd = geb; - Ond = new Rnd("UNKNOWN", 0); - Lnd = new Rnd("ABOVE", 1); - Mnd = new Rnd("BELOW", 2); - Nnd = new Rnd("INLINE", 3); - new kGd("org.eclipse.elk.labelSide", Ond); - } - function RHd(a, b) { - var c2; - if (a.Yi() && b != null) { - for (c2 = 0; c2 < a.i; ++c2) { - if (pb(b, a.g[c2])) { - return c2; - } - } + } + }, "parsedStyle"), + numericStyle: /* @__PURE__ */ __name(function numericStyle(property2) { + var ele = this[0]; + if (!ele.cy().styleEnabled()) { + return; + } + if (ele) { + var pstyle = ele.pstyle(property2); + return pstyle.pfValue !== void 0 ? pstyle.pfValue : pstyle.value; + } + }, "numericStyle"), + numericStyleUnits: /* @__PURE__ */ __name(function numericStyleUnits(property2) { + var ele = this[0]; + if (!ele.cy().styleEnabled()) { + return; + } + if (ele) { + return ele.pstyle(property2).units; + } + }, "numericStyleUnits"), + // get the specified css property as a rendered value (i.e. on-screen value) + // or get the whole rendered style if no property specified (NB doesn't allow setting) + renderedStyle: /* @__PURE__ */ __name(function renderedStyle(property2) { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return this; + } + var ele = this[0]; + if (ele) { + return cy.style().getRenderedStyle(ele, property2); + } + }, "renderedStyle"), + // read the calculated css style of the element or override the style (via a bypass) + style: /* @__PURE__ */ __name(function style(name, value2) { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return this; + } + var updateTransitions = false; + var style3 = cy.style(); + if (plainObject(name)) { + var props = name; + style3.applyBypass(this, props, updateTransitions); + this.emitAndNotify("style"); + } else if (string(name)) { + if (value2 === void 0) { + var ele = this[0]; + if (ele) { + return style3.getStylePropertyValue(ele, name); } else { - for (c2 = 0; c2 < a.i; ++c2) { - if (dE(a.g[c2]) === dE(b)) { - return c2; - } - } - } - return -1; - } - function L0b(a, b, c2) { - var d, e; - if (b.c == (BEc(), zEc) && c2.c == yEc) { - return -1; - } else if (b.c == yEc && c2.c == zEc) { - return 1; - } - d = P0b(b.a, a.a); - e = P0b(c2.a, a.a); - return b.c == zEc ? e - d : d - e; - } - function f3b(a, b, c2) { - if (!!c2 && (b < 0 || b > c2.a.c.length)) { - throw Adb(new agb("index must be >= 0 and <= layer node count")); - } - !!a.c && Ymb(a.c.a, a); - a.c = c2; - !!c2 && Qmb(c2.a, b, a); - } - function Gac(a, b) { - var c2, d, e; - for (d = new is(Mr(W2b(a).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - e = RD(b.Kb(c2), 10); - return new cc(Qb(e.n.b + e.o.b / 2)); - } - return wb(), wb(), vb; - } - function RQc(a, b) { - this.c = new Tsb(); - this.a = a; - this.b = b; - this.d = RD(mQb(a, (Ywc(), Qwc)), 312); - dE(mQb(a, (yCc(), eBc))) === dE((Cuc(), Auc)) ? this.e = new BRc() : this.e = new uRc(); - } - function ftd(a, b) { - var c2, d; - d = null; - if (a.pf((umd(), amd))) { - c2 = RD(a.of(amd), 96); - c2.pf(b) && (d = c2.of(b)); - } - d == null && !!a.Tf() && (d = a.Tf().of(b)); - d == null && (d = iGd(b)); - return d; - } - function ku(b, c2) { - var d, e; - d = b.fd(c2); - try { - e = d.Pb(); - d.Qb(); - return e; - } catch (a) { - a = zdb(a); - if (ZD(a, 112)) { - throw Adb(new veb("Can't remove element " + c2)); - } else - throw Adb(a); - } - } - function GA(a, b) { - var c2, d, e; - d = new uB(); - e = new vB(d.q.getFullYear() - Owe, d.q.getMonth(), d.q.getDate()); - c2 = FA(a, b, e); - if (c2 == 0 || c2 < b.length) { - throw Adb(new agb(b)); - } - return e; - } - function iwb(a, b) { - var c2, d, e; - uFb(b); - lFb(b != a); - e = a.b.c.length; - for (d = b.Kc(); d.Ob(); ) { - c2 = d.Pb(); - Rmb(a.b, uFb(c2)); - } - if (e != a.b.c.length) { - jwb(a, 0); - return true; + return; } - return false; + } else { + style3.applyBypass(this, name, value2, updateTransitions); + this.emitAndNotify("style"); } - function dWb() { - dWb = geb; - XVb = (umd(), ald); - new mGd(Pkd, (Geb(), true)); - $Vb = kld; - _Vb = nld; - aWb = pld; - ZVb = ild; - bWb = sld; - cWb = Lld; - WVb = (QVb(), OVb); - UVb = LVb; - VVb = NVb; - YVb = PVb; - TVb = KVb; - } - function U0b(a, b) { - if (b == a.c) { - return a.d; - } else if (b == a.d) { - return a.c; - } else { - throw Adb(new agb("'port' must be either the source port or target port of the edge.")); - } + } else if (name === void 0) { + var _ele = this[0]; + if (_ele) { + return style3.getRawStyle(_ele); + } else { + return; } - function T6b(a, b, c2) { - var d, e; - e = a.o; - d = a.d; - switch (b.g) { - case 1: - return -d.d - c2; - case 3: - return e.b + d.a + c2; - case 2: - return e.a + d.c + c2; - case 4: - return -d.b - c2; - default: - return 0; - } + } + return this; + }, "style"), + removeStyle: /* @__PURE__ */ __name(function removeStyle(names) { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return this; + } + var updateTransitions = false; + var style3 = cy.style(); + var eles = this; + if (names === void 0) { + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + style3.removeAllBypasses(ele, updateTransitions); } - function Y9b(a, b, c2, d) { - var e, f2, g, h; - g3b(b, RD(d.Xb(0), 30)); - h = d.kd(1, d.gc()); - for (f2 = RD(c2.Kb(b), 20).Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 18); - g = e.c.i == b ? e.d.i : e.c.i; - Y9b(a, g, c2, h); - } - } - function Bic(a) { - var b; - b = new Tsb(); - if (nQb(a, (Ywc(), Vwc))) { - return RD(mQb(a, Vwc), 85); - } - FDb(CDb(new SDb(null, new Swb(a.j, 16)), new Dic()), new Fic(b)); - pQb(a, Vwc, b); - return b; - } - function zad(a, b) { - var c2, d, e, f2, g; - d = 0; - e = 0; - c2 = 0; - for (g = new Anb(a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 186); - d = $wnd.Math.max(d, f2.e); - e += f2.b + (c2 > 0 ? b : 0); - ++c2; - } - return new rjd(d, e); - } - function Czd(a, b) { - var c2, d; - if (a.Db >> 16 == 6) { - return a.Cb.Th(a, 6, G4, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (pvd(), hvd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function cCd(a, b) { - var c2, d; - if (a.Db >> 16 == 7) { - return a.Cb.Th(a, 1, H4, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (pvd(), jvd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function LCd(a, b) { - var c2, d; - if (a.Db >> 16 == 9) { - return a.Cb.Th(a, 9, J4, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (pvd(), lvd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function M1d(a, b) { - var c2, d; - if (a.Db >> 16 == 5) { - return a.Cb.Th(a, 9, m7, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (JTd(), tTd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function qBd(a, b) { - var c2, d; - if (a.Db >> 16 == 7) { - return a.Cb.Th(a, 6, t7, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (JTd(), CTd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function iVd(a, b) { - var c2, d; - if (a.Db >> 16 == 3) { - return a.Cb.Th(a, 0, p7, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (JTd(), mTd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); - } - function IEd() { - this.a = new BDd(); - this.g = new Io(); - this.j = new Io(); - this.b = new Tsb(); - this.d = new Io(); - this.i = new Io(); - this.k = new Tsb(); - this.c = new Tsb(); - this.e = new Tsb(); - this.f = new Tsb(); - } - function kQd(a, b, c2) { - var d, e, f2; - c2 < 0 && (c2 = 0); - f2 = a.i; - for (e = c2; e < f2; e++) { - d = QHd(a, e); - if (b == null) { - if (d == null) { - return e; - } - } else if (dE(b) === dE(d) || pb(b, d)) { - return e; - } - } - return -1; + } else { + names = names.split(/\s+/); + for (var _i = 0; _i < eles.length; _i++) { + var _ele2 = eles[_i]; + style3.removeBypasses(_ele2, names, updateTransitions); } - function Bee(a, b) { - var c2, d; - c2 = b.qi(a.a); - if (!c2) { - return null; - } else { - d = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), _Ke)); - return lhb(aLe, d) ? Uee(a, BXd(b.qk())) : d; - } + } + this.emitAndNotify("style"); + return this; + }, "removeStyle"), + show: /* @__PURE__ */ __name(function show() { + this.css("display", "element"); + return this; + }, "show"), + hide: /* @__PURE__ */ __name(function hide() { + this.css("display", "none"); + return this; + }, "hide"), + effectiveOpacity: /* @__PURE__ */ __name(function effectiveOpacity() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return 1; + } + var hasCompoundNodes2 = cy.hasCompoundNodes(); + var ele = this[0]; + if (ele) { + var _p = ele._private; + var parentOpacity = ele.pstyle("opacity").value; + if (!hasCompoundNodes2) { + return parentOpacity; } - function Oje(a, b) { - var c2, d; - if (b) { - if (b == a) { - return true; - } - c2 = 0; - for (d = RD(b, 54).Ph(); !!d && d != b; d = d.Ph()) { - if (++c2 > wxe) { - return Oje(a, d); - } - if (d == a) { - return true; - } - } + var parents4 = !_p.data.parent ? null : ele.parents(); + if (parents4) { + for (var i2 = 0; i2 < parents4.length; i2++) { + var parent4 = parents4[i2]; + var opacity = parent4.pstyle("opacity").value; + parentOpacity = opacity * parentOpacity; } - return false; } - function yNb(a) { - tNb(); - switch (a.q.g) { - case 5: - vNb(a, (qpd(), Yod)); - vNb(a, npd); - break; - case 4: - wNb(a, (qpd(), Yod)); - wNb(a, npd); - break; - default: - xNb(a, (qpd(), Yod)); - xNb(a, npd); - } + return parentOpacity; + } + }, "effectiveOpacity"), + transparent: /* @__PURE__ */ __name(function transparent() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return false; + } + var ele = this[0]; + var hasCompoundNodes2 = ele.cy().hasCompoundNodes(); + if (ele) { + if (!hasCompoundNodes2) { + return ele.pstyle("opacity").value === 0; + } else { + return ele.effectiveOpacity() === 0; } - function CNb(a) { - tNb(); - switch (a.q.g) { - case 5: - zNb(a, (qpd(), Xod)); - zNb(a, ppd); - break; - case 4: - ANb(a, (qpd(), Xod)); - ANb(a, ppd); - break; - default: - BNb(a, (qpd(), Xod)); - BNb(a, ppd); - } + } + }, "transparent"), + backgrounding: /* @__PURE__ */ __name(function backgrounding() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return false; + } + var ele = this[0]; + return ele._private.backgrounding ? true : false; + }, "backgrounding") + }; + __name(checkCompound, "checkCompound"); + __name(defineDerivedStateFunction, "defineDerivedStateFunction"); + eleTakesUpSpace = cacheStyleFunction("eleTakesUpSpace", function(ele) { + return ele.pstyle("display").value === "element" && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true); + }); + elesfn$4.takesUpSpace = cachePrototypeStyleFunction("takesUpSpace", defineDerivedStateFunction({ + ok: eleTakesUpSpace + })); + eleInteractive = cacheStyleFunction("eleInteractive", function(ele) { + return ele.pstyle("events").value === "yes" && ele.pstyle("visibility").value === "visible" && eleTakesUpSpace(ele); + }); + parentInteractive = cacheStyleFunction("parentInteractive", function(parent4) { + return parent4.pstyle("visibility").value === "visible" && eleTakesUpSpace(parent4); + }); + elesfn$4.interactive = cachePrototypeStyleFunction("interactive", defineDerivedStateFunction({ + ok: eleInteractive, + parentOk: parentInteractive, + edgeOkViaNode: eleTakesUpSpace + })); + elesfn$4.noninteractive = function() { + var ele = this[0]; + if (ele) { + return !ele.interactive(); + } + }; + eleVisible = cacheStyleFunction("eleVisible", function(ele) { + return ele.pstyle("visibility").value === "visible" && ele.pstyle("opacity").pfValue !== 0 && eleTakesUpSpace(ele); + }); + edgeVisibleViaNode = eleTakesUpSpace; + elesfn$4.visible = cachePrototypeStyleFunction("visible", defineDerivedStateFunction({ + ok: eleVisible, + edgeOkViaNode: edgeVisibleViaNode + })); + elesfn$4.hidden = function() { + var ele = this[0]; + if (ele) { + return !ele.visible(); + } + }; + elesfn$4.isBundledBezier = cachePrototypeStyleFunction("isBundledBezier", function() { + if (!this.cy().styleEnabled()) { + return false; + } + return !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace(); + }); + elesfn$4.bypass = elesfn$4.css = elesfn$4.style; + elesfn$4.renderedCss = elesfn$4.renderedStyle; + elesfn$4.removeBypass = elesfn$4.removeCss = elesfn$4.removeStyle; + elesfn$4.pstyle = elesfn$4.parsedStyle; + elesfn$3 = {}; + __name(defineSwitchFunction, "defineSwitchFunction"); + __name(defineSwitchSet, "defineSwitchSet"); + defineSwitchSet({ + field: "locked", + overrideField: /* @__PURE__ */ __name(function overrideField(ele) { + return ele.cy().autolock() ? true : void 0; + }, "overrideField"), + on: "lock", + off: "unlock" + }); + defineSwitchSet({ + field: "grabbable", + overrideField: /* @__PURE__ */ __name(function overrideField2(ele) { + return ele.cy().autoungrabify() || ele.pannable() ? false : void 0; + }, "overrideField"), + on: "grabify", + off: "ungrabify" + }); + defineSwitchSet({ + field: "selected", + ableField: "selectable", + overrideAble: /* @__PURE__ */ __name(function overrideAble(ele) { + return ele.cy().autounselectify() ? false : void 0; + }, "overrideAble"), + on: "select", + off: "unselect" + }); + defineSwitchSet({ + field: "selectable", + overrideField: /* @__PURE__ */ __name(function overrideField3(ele) { + return ele.cy().autounselectify() ? false : void 0; + }, "overrideField"), + on: "selectify", + off: "unselectify" + }); + elesfn$3.deselect = elesfn$3.unselect; + elesfn$3.grabbed = function() { + var ele = this[0]; + if (ele) { + return ele._private.grabbed; + } + }; + defineSwitchSet({ + field: "active", + on: "activate", + off: "unactivate" + }); + defineSwitchSet({ + field: "pannable", + on: "panify", + off: "unpanify" + }); + elesfn$3.inactive = function() { + var ele = this[0]; + if (ele) { + return !ele._private.active; + } + }; + elesfn$2 = {}; + defineDagExtremity = /* @__PURE__ */ __name(function defineDagExtremity2(params) { + return /* @__PURE__ */ __name(function dagExtremityImpl(selector) { + var eles = this; + var ret = []; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + if (!ele.isNode()) { + continue; } - function RTb(a) { - var b, c2; - b = RD(mQb(a, (yVb(), mVb)), 17); - if (b) { - c2 = b.a; - c2 == 0 ? pQb(a, (JVb(), IVb), new Owb()) : pQb(a, (JVb(), IVb), new Pwb(c2)); - } else { - pQb(a, (JVb(), IVb), new Pwb(1)); + var disqualified = false; + var edges5 = ele.connectedEdges(); + for (var j2 = 0; j2 < edges5.length; j2++) { + var edge = edges5[j2]; + var src = edge.source(); + var tgt = edge.target(); + if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) { + disqualified = true; + break; } } - function b2b(a, b) { - var c2; - c2 = a.i; - switch (b.g) { - case 1: - return -(a.n.b + a.o.b); - case 2: - return a.n.a - c2.o.a; - case 3: - return a.n.b - c2.o.b; - case 4: - return -(a.n.a + a.o.a); - } - return 0; + if (!disqualified) { + ret.push(ele); } - function wec(a, b) { - switch (a.g) { - case 0: - return b == (cxc(), $wc) ? sec : tec; - case 1: - return b == (cxc(), $wc) ? sec : rec; - case 2: - return b == (cxc(), $wc) ? rec : tec; - default: - return rec; - } + } + return this.spawn(ret, true).filter(selector); + }, "dagExtremityImpl"); + }, "defineDagExtremity"); + defineDagOneHop = /* @__PURE__ */ __name(function defineDagOneHop2(params) { + return function(selector) { + var eles = this; + var oEles = []; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + if (!ele.isNode()) { + continue; } - function Fad(a, b) { - var c2, d, e; - Ymb(a.a, b); - a.e -= b.r + (a.a.c.length == 0 ? 0 : a.c); - e = fFe; - for (d = new Anb(a.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 172); - e = $wnd.Math.max(e, c2.d); + var edges5 = ele.connectedEdges(); + for (var j2 = 0; j2 < edges5.length; j2++) { + var edge = edges5[j2]; + var src = edge.source(); + var tgt = edge.target(); + if (params.outgoing && src === ele) { + oEles.push(edge); + oEles.push(tgt); + } else if (params.incoming && tgt === ele) { + oEles.push(edge); + oEles.push(src); } - a.b = e; } - function jzd(a, b) { - var c2, d; - if (a.Db >> 16 == 3) { - return a.Cb.Th(a, 12, J4, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (pvd(), gvd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); + } + return this.spawn(oEles, true).filter(selector); + }; + }, "defineDagOneHop"); + defineDagAllHops = /* @__PURE__ */ __name(function defineDagAllHops2(params) { + return function(selector) { + var eles = this; + var sEles = []; + var sElesIds = {}; + for (; ; ) { + var next3 = params.outgoing ? eles.outgoers() : eles.incomers(); + if (next3.length === 0) { + break; } - function sCd(a, b) { - var c2, d; - if (a.Db >> 16 == 11) { - return a.Cb.Th(a, 10, J4, b); + var newNext = false; + for (var i2 = 0; i2 < next3.length; i2++) { + var n2 = next3[i2]; + var nid = n2.id(); + if (!sElesIds[nid]) { + sElesIds[nid] = true; + sEles.push(n2); + newNext = true; } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (pvd(), kvd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); } - function n4d(a, b) { - var c2, d; - if (a.Db >> 16 == 10) { - return a.Cb.Th(a, 11, h7, b); - } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (JTd(), ATd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); + if (!newNext) { + break; } - function Q5d(a, b) { - var c2, d; - if (a.Db >> 16 == 10) { - return a.Cb.Th(a, 12, s7, b); + eles = next3; + } + return this.spawn(sEles, true).filter(selector); + }; + }, "defineDagAllHops"); + elesfn$2.clearTraversalCache = function() { + for (var i2 = 0; i2 < this.length; i2++) { + this[i2]._private.traversalCache = null; + } + }; + extend2(elesfn$2, { + // get the root nodes in the DAG + roots: defineDagExtremity({ + noIncomingEdges: true + }), + // get the leaf nodes in the DAG + leaves: defineDagExtremity({ + noOutgoingEdges: true + }), + // normally called children in graph theory + // these nodes =edges=> outgoing nodes + outgoers: cache(defineDagOneHop({ + outgoing: true + }), "outgoers"), + // aka DAG descendants + successors: defineDagAllHops({ + outgoing: true + }), + // normally called parents in graph theory + // these nodes <=edges= incoming nodes + incomers: cache(defineDagOneHop({ + incoming: true + }), "incomers"), + // aka DAG ancestors + predecessors: defineDagAllHops({ + incoming: true + }) + }); + extend2(elesfn$2, { + neighborhood: cache(function(selector) { + var elements3 = []; + var nodes6 = this.nodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; + var connectedEdges = node2.connectedEdges(); + for (var j2 = 0; j2 < connectedEdges.length; j2++) { + var edge = connectedEdges[j2]; + var src = edge.source(); + var tgt = edge.target(); + var otherNode = node2 === src ? tgt : src; + if (otherNode.length > 0) { + elements3.push(otherNode[0]); } - return d = Z5d(RD(vYd((c2 = RD(Ywd(a, 16), 29), !c2 ? (JTd(), DTd) : c2), a.Db >> 16), 19)), a.Cb.Th(a, d.n, d.f, b); + elements3.push(edge[0]); } - function WVd(a) { - var b; - if ((a.Bb & 1) == 0 && !!a.r && a.r.Vh()) { - b = RD(a.r, 54); - a.r = RD(Vvd(a, b), 142); - a.r != b && (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 9, 8, b, a.r)); - } - return a.r; + } + return this.spawn(elements3, true).filter(selector); + }, "neighborhood"), + closedNeighborhood: /* @__PURE__ */ __name(function closedNeighborhood(selector) { + return this.neighborhood().add(this).filter(selector); + }, "closedNeighborhood"), + openNeighborhood: /* @__PURE__ */ __name(function openNeighborhood(selector) { + return this.neighborhood(selector); + }, "openNeighborhood") + }); + elesfn$2.neighbourhood = elesfn$2.neighborhood; + elesfn$2.closedNeighbourhood = elesfn$2.closedNeighborhood; + elesfn$2.openNeighbourhood = elesfn$2.openNeighborhood; + extend2(elesfn$2, { + source: cache(/* @__PURE__ */ __name(function sourceImpl(selector) { + var ele = this[0]; + var src; + if (ele) { + src = ele._private.source || ele.cy().collection(); + } + return src && selector ? src.filter(selector) : src; + }, "sourceImpl"), "source"), + target: cache(/* @__PURE__ */ __name(function targetImpl(selector) { + var ele = this[0]; + var tgt; + if (ele) { + tgt = ele._private.target || ele.cy().collection(); + } + return tgt && selector ? tgt.filter(selector) : tgt; + }, "targetImpl"), "target"), + sources: defineSourceFunction({ + attr: "source" + }), + targets: defineSourceFunction({ + attr: "target" + }) + }); + __name(defineSourceFunction, "defineSourceFunction"); + extend2(elesfn$2, { + edgesWith: cache(defineEdgesWithFunction(), "edgesWith"), + edgesTo: cache(defineEdgesWithFunction({ + thisIsSrc: true + }), "edgesTo") + }); + __name(defineEdgesWithFunction, "defineEdgesWithFunction"); + extend2(elesfn$2, { + connectedEdges: cache(function(selector) { + var retEles = []; + var eles = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var node2 = eles[i2]; + if (!node2.isNode()) { + continue; } - function pKb(a, b, c2) { - var d; - d = cD(WC(iE, 1), vxe, 28, 15, [sKb(a, (ZJb(), WJb), b, c2), sKb(a, XJb, b, c2), sKb(a, YJb, b, c2)]); - if (a.f) { - d[0] = $wnd.Math.max(d[0], d[2]); - d[2] = d[0]; - } - return d; + var edges5 = node2._private.edges; + for (var j2 = 0; j2 < edges5.length; j2++) { + var edge = edges5[j2]; + retEles.push(edge); } - function ddc(a, b) { - var c2, d, e; - e = kdc(a, b); - if (e.c.length == 0) { - return; - } - _mb(e, new Gdc()); - c2 = e.c.length; - for (d = 0; d < c2; d++) { - _cc(a, (tFb(d, e.c.length), RD(e.c[d], 293)), gdc(a, e, d)); - } + } + return this.spawn(retEles, true).filter(selector); + }, "connectedEdges"), + connectedNodes: cache(function(selector) { + var retEles = []; + var eles = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var edge = eles[i2]; + if (!edge.isEdge()) { + continue; } - function Wnc(a) { - var b, c2, d, e; - for (e = RD(Qc(a.a, (Bnc(), wnc)), 15).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 105); - for (c2 = Ec(d.k).Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 64); - Qnc(a, d, b, (joc(), hoc), 1); + retEles.push(edge.source()[0]); + retEles.push(edge.target()[0]); + } + return this.spawn(retEles, true).filter(selector); + }, "connectedNodes"), + parallelEdges: cache(defineParallelEdgesFunction(), "parallelEdges"), + codirectedEdges: cache(defineParallelEdgesFunction({ + codirected: true + }), "codirectedEdges") + }); + __name(defineParallelEdgesFunction, "defineParallelEdgesFunction"); + extend2(elesfn$2, { + components: /* @__PURE__ */ __name(function components2(root4) { + var self2 = this; + var cy = self2.cy(); + var visited = cy.collection(); + var unvisited = root4 == null ? self2.nodes() : root4.nodes(); + var components3 = []; + if (root4 != null && unvisited.empty()) { + unvisited = root4.sources(); + } + var visitInComponent = /* @__PURE__ */ __name(function visitInComponent2(node2, component2) { + visited.merge(node2); + unvisited.unmerge(node2); + component2.merge(node2); + }, "visitInComponent"); + if (unvisited.empty()) { + return self2.spawn(); + } + var _loop = /* @__PURE__ */ __name(function _loop2() { + var cmpt = cy.collection(); + components3.push(cmpt); + var root5 = unvisited[0]; + visitInComponent(root5, cmpt); + self2.bfs({ + directed: false, + roots: root5, + visit: /* @__PURE__ */ __name(function visit(v3) { + return visitInComponent(v3, cmpt); + }, "visit") + }); + cmpt.forEach(function(node2) { + node2.connectedEdges().forEach(function(e3) { + if (self2.has(e3) && cmpt.has(e3.source()) && cmpt.has(e3.target())) { + cmpt.merge(e3); } - } - } - function Yrc(a) { - var b, c2; - if (a.k == (r3b(), o3b)) { - for (c2 = new is(Mr(W2b(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - if (!W0b(b) && a.c == T0b(b, a).c) { - return true; - } - } - } - return false; + }); + }); + }, "_loop"); + do { + _loop(); + } while (unvisited.length > 0); + return components3; + }, "components"), + component: /* @__PURE__ */ __name(function component() { + var ele = this[0]; + return ele.cy().mutableElements().components(ele)[0]; + }, "component") + }); + elesfn$2.componentsOf = elesfn$2.components; + Collection = /* @__PURE__ */ __name(function Collection2(cy, elements3) { + var unique = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; + var removed = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; + if (cy === void 0) { + error("A collection must have a reference to the core"); + return; + } + var map5 = new Map$2(); + var createdElements = false; + if (!elements3) { + elements3 = []; + } else if (elements3.length > 0 && plainObject(elements3[0]) && !element(elements3[0])) { + createdElements = true; + var eles = []; + var elesIds = new Set$1(); + for (var i2 = 0, l2 = elements3.length; i2 < l2; i2++) { + var json3 = elements3[i2]; + if (json3.data == null) { + json3.data = {}; } - function hSc(a) { - var b, c2; - if (a.k == (r3b(), o3b)) { - for (c2 = new is(Mr(W2b(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - if (!W0b(b) && b.c.i.c == b.d.i.c) { - return true; - } - } - } - return false; + var _data = json3.data; + if (_data.id == null) { + _data.id = uuid(); + } else if (cy.hasElementWithId(_data.id) || elesIds.has(_data.id)) { + continue; } - function XDd(a, b) { - var c2, d, e, f2, g; - if (b) { - e = b.a.length; - c2 = new vue(e); - for (g = (c2.b - c2.a) * c2.c < 0 ? (uue(), tue) : new Rue(c2); g.Ob(); ) { - f2 = RD(g.Pb(), 17); - d = xDd(b, f2.a); - !!d && AEd(a, d); - } - } - } - function bbe() { - Tae(); - var a, b; - Xae((lTd(), kTd)); - Wae(kTd); - rBd(kTd); - d2d = (JTd(), wTd); - for (b = new Anb(Rae); b.a < b.c.c.length; ) { - a = RD(ynb(b), 248); - o2d(a, wTd, null); - } - return true; + var ele = new Element(cy, json3, false); + eles.push(ele); + elesIds.add(_data.id); + } + elements3 = eles; + } + this.length = 0; + for (var _i = 0, _l = elements3.length; _i < _l; _i++) { + var element$1 = elements3[_i][0]; + if (element$1 == null) { + continue; + } + var id26 = element$1._private.data.id; + if (!unique || !map5.has(id26)) { + if (unique) { + map5.set(id26, { + index: this.length, + ele: element$1 + }); } - function uD(a, b) { - var c2, d, e, f2, g, h, i2, j; - i2 = a.h >> 19; - j = b.h >> 19; - if (i2 != j) { - return j - i2; - } - e = a.h; - h = b.h; - if (e != h) { - return e - h; - } - d = a.m; - g = b.m; - if (d != g) { - return d - g; - } - c2 = a.l; - f2 = b.l; - return c2 - f2; - } - function YHb() { - YHb = geb; - XHb = (iIb(), fIb); - WHb = new lGd(Aye, XHb); - VHb = (LHb(), KHb); - UHb = new lGd(Bye, VHb); - THb = (DHb(), CHb); - SHb = new lGd(Cye, THb); - RHb = new lGd(Dye, (Geb(), true)); - } - function Iic(a, b, c2) { - var d, e; - d = b * c2; - if (ZD(a.g, 154)) { - e = $jc(a); - if (e.f.d) { - e.f.a || (a.d.a += d + Tye); - } else { - a.d.d -= d + Tye; - a.d.a += d + Tye; - } - } else if (ZD(a.g, 10)) { - a.d.d -= d; - a.d.a += 2 * d; - } - } - function _pc(a, b, c2) { - var d, e, f2, g, h; - e = a[c2.g]; - for (h = new Anb(b.d); h.a < h.c.c.length; ) { - g = RD(ynb(h), 105); - f2 = g.i; - if (!!f2 && f2.i == c2) { - d = g.d[c2.g]; - e[d] = $wnd.Math.max(e[d], f2.j.b); - } - } - } - function k9c(a, b) { - var c2, d, e, f2, g; - d = 0; - e = 0; - c2 = 0; - for (g = new Anb(b.d); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 315); - gad(f2); - d = $wnd.Math.max(d, f2.b); - e += f2.d + (c2 > 0 ? a.b : 0); - ++c2; - } - b.b = d; - b.e = e; - } - function Fo(a) { - var b, c2, d; - d = a.b; - if (Xp(a.i, d.length)) { - c2 = d.length * 2; - a.b = $C(XF, ewe, 303, c2, 0, 1); - a.c = $C(XF, ewe, 303, c2, 0, 1); - a.f = c2 - 1; - a.i = 0; - for (b = a.a; b; b = b.c) { - Bo(a, b, b); - } - ++a.g; - } - } - function VPb(a, b, c2, d) { - var e, f2, g, h; - for (e = 0; e < b.o; e++) { - f2 = e - b.j + c2; - for (g = 0; g < b.p; g++) { - h = g - b.k + d; - PPb(b, e, g) ? aQb(a, f2, h) || cQb(a, f2, h) : RPb(b, e, g) && ($Pb(a, f2, h) || dQb(a, f2, h)); - } - } - } - function k_b(a, b) { - a.b.a = $wnd.Math.min(a.b.a, b.c); - a.b.b = $wnd.Math.min(a.b.b, b.d); - a.a.a = $wnd.Math.max(a.a.a, b.c); - a.a.b = $wnd.Math.max(a.a.b, b.d); - return ZEb(a.c, b), true; - } - function psc(a, b, c2) { - var d; - d = b.c.i; - if (d.k == (r3b(), o3b)) { - pQb(a, (Ywc(), vwc), RD(mQb(d, vwc), 12)); - pQb(a, wwc, RD(mQb(d, wwc), 12)); - } else { - pQb(a, (Ywc(), vwc), b.c); - pQb(a, wwc, c2.d); - } - } - function wid(a, b, c2) { - tid(); - var d, e, f2, g, h, i2; - g = b / 2; - f2 = c2 / 2; - d = $wnd.Math.abs(a.a); - e = $wnd.Math.abs(a.b); - h = 1; - i2 = 1; - d > g && (h = g / d); - e > f2 && (i2 = f2 / e); - ijd(a, $wnd.Math.min(h, i2)); - return a; - } - function OAd() { - qAd(); - var b, c2; - try { - c2 = RD(M5d((YSd(), XSd), $He), 2113); - if (c2) { - return c2; - } - } catch (a) { - a = zdb(a); - if (ZD(a, 103)) { - b = a; - UId((Hde(), b)); - } else - throw Adb(a); - } - return new KAd(); - } - function Qae() { - qAd(); - var b, c2; - try { - c2 = RD(M5d((YSd(), XSd), AKe), 2040); - if (c2) { - return c2; - } - } catch (a) { - a = zdb(a); - if (ZD(a, 103)) { - b = a; - UId((Hde(), b)); - } else - throw Adb(a); - } - return new Mae(); - } - function vne() { - Zme(); - var b, c2; - try { - c2 = RD(M5d((YSd(), XSd), dLe), 2122); - if (c2) { - return c2; - } - } catch (a) { - a = zdb(a); - if (ZD(a, 103)) { - b = a; - UId((Hde(), b)); - } else - throw Adb(a); - } - return new rne(); - } - function f2d(a, b, c2) { - var d, e; - e = a.e; - a.e = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 4, e, b); - !c2 ? c2 = d : c2.nj(d); - } - e != b && (b ? c2 = o2d(a, k2d(a, b), c2) : c2 = o2d(a, a.a, c2)); - return c2; - } - function DB() { - uB.call(this); - this.e = -1; - this.a = false; - this.p = qwe; - this.k = -1; - this.c = -1; - this.b = -1; - this.g = false; - this.f = -1; - this.j = -1; - this.n = -1; - this.i = -1; - this.d = -1; - this.o = qwe; - } - function hHb(a, b) { - var c2, d, e; - d = a.b.d.d; - a.a || (d += a.b.d.a); - e = b.b.d.d; - b.a || (e += b.b.d.a); - c2 = Qfb(d, e); - if (c2 == 0) { - if (!a.a && b.a) { - return -1; - } else if (!b.a && a.a) { - return 1; - } - } - return c2; + this[this.length] = element$1; + this.length++; + } + } + this._private = { + eles: this, + cy, + get map() { + if (this.lazyMap == null) { + this.rebuildMap(); } - function XQb(a, b) { - var c2, d, e; - d = a.b.b.d; - a.a || (d += a.b.b.a); - e = b.b.b.d; - b.a || (e += b.b.b.a); - c2 = Qfb(d, e); - if (c2 == 0) { - if (!a.a && b.a) { - return -1; - } else if (!b.a && a.a) { - return 1; - } - } - return c2; + return this.lazyMap; + }, + set map(m2) { + this.lazyMap = m2; + }, + rebuildMap: /* @__PURE__ */ __name(function rebuildMap() { + var m2 = this.lazyMap = new Map$2(); + var eles2 = this.eles; + for (var _i2 = 0; _i2 < eles2.length; _i2++) { + var _ele = eles2[_i2]; + m2.set(_ele.id(), { + index: _i2, + ele: _ele + }); } - function RYb(a, b) { - var c2, d, e; - d = a.b.g.d; - a.a || (d += a.b.g.a); - e = b.b.g.d; - b.a || (e += b.b.g.a); - c2 = Qfb(d, e); - if (c2 == 0) { - if (!a.a && b.a) { - return -1; - } else if (!b.a && a.a) { - return 1; - } + }, "rebuildMap") + }; + if (unique) { + this._private.map = map5; + } + if (createdElements && !removed) { + this.restore(); + } + }, "Collection"); + elesfn$1 = Element.prototype = Collection.prototype = Object.create(Array.prototype); + elesfn$1.instanceString = function() { + return "collection"; + }; + elesfn$1.spawn = function(eles, unique) { + return new Collection(this.cy(), eles, unique); + }; + elesfn$1.spawnSelf = function() { + return this.spawn(this); + }; + elesfn$1.cy = function() { + return this._private.cy; + }; + elesfn$1.renderer = function() { + return this._private.cy.renderer(); + }; + elesfn$1.element = function() { + return this[0]; + }; + elesfn$1.collection = function() { + if (collection(this)) { + return this; + } else { + return new Collection(this._private.cy, [this]); + } + }; + elesfn$1.unique = function() { + return new Collection(this._private.cy, this, true); + }; + elesfn$1.hasElementWithId = function(id26) { + id26 = "" + id26; + return this._private.map.has(id26); + }; + elesfn$1.getElementById = function(id26) { + id26 = "" + id26; + var cy = this._private.cy; + var entry = this._private.map.get(id26); + return entry ? entry.ele : new Collection(cy); + }; + elesfn$1.$id = elesfn$1.getElementById; + elesfn$1.poolIndex = function() { + var cy = this._private.cy; + var eles = cy._private.elements; + var id26 = this[0]._private.data.id; + return eles._private.map.get(id26).index; + }; + elesfn$1.indexOf = function(ele) { + var id26 = ele[0]._private.data.id; + return this._private.map.get(id26).index; + }; + elesfn$1.indexOfId = function(id26) { + id26 = "" + id26; + return this._private.map.get(id26).index; + }; + elesfn$1.json = function(obj) { + var ele = this.element(); + var cy = this.cy(); + if (ele == null && obj) { + return this; + } + if (ele == null) { + return void 0; + } + var p3 = ele._private; + if (plainObject(obj)) { + cy.startBatch(); + if (obj.data) { + ele.data(obj.data); + var _data2 = p3.data; + if (ele.isEdge()) { + var move = false; + var spec = {}; + var src = obj.data.source; + var tgt = obj.data.target; + if (src != null && src != _data2.source) { + spec.source = "" + src; + move = true; } - return c2; - } - function _Wb() { - _Wb = geb; - YWb = nfd(pfd(pfd(pfd(new ufd(), (sXb(), qXb), (hcc(), Dbc)), qXb, Hbc), rXb, Obc), rXb, rbc); - $Wb = pfd(pfd(new ufd(), qXb, hbc), qXb, sbc); - ZWb = nfd(new ufd(), rXb, ubc); - } - function J6b(a) { - var b, c2, d, e, f2; - b = RD(mQb(a, (Ywc(), cwc)), 85); - f2 = a.n; - for (d = b.Cc().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 314); - e = c2.i; - e.c += f2.a; - e.d += f2.b; - c2.c ? MKb(c2) : OKb(c2); - } - pQb(a, cwc, null); - } - function Wpc(a, b, c2) { - var d, e; - e = a.b; - d = e.d; - switch (b.g) { - case 1: - return -d.d - c2; - case 2: - return e.o.a + d.c + c2; - case 3: - return e.o.b + d.a + c2; - case 4: - return -d.b - c2; - default: - return -1; + if (tgt != null && tgt != _data2.target) { + spec.target = "" + tgt; + move = true; } - } - function CNc(a, b, c2) { - var d, e; - c2.Ug("Interactive node placement", 1); - a.a = RD(mQb(b, (Ywc(), Qwc)), 312); - for (e = new Anb(b.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - BNc(a, d); - } - c2.Vg(); - } - function C5c(a) { - var b, c2, d, e, f2; - d = 0; - e = Hze; - if (a.b) { - for (b = 0; b < 360; b++) { - c2 = b * 0.017453292519943295; - A5c(a, a.d, 0, 0, dFe, c2); - f2 = a.b.Dg(a.d); - if (f2 < e) { - d = c2; - e = f2; - } - } + if (move) { + ele = ele.move(spec); } - A5c(a, a.d, 0, 0, dFe, d); - } - function Oad(a, b) { - var c2, d, e, f2; - f2 = new Tsb(); - b.e = null; - b.f = null; - for (d = new Anb(b.i); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 68); - e = RD(Wjb(a.g, c2.a), 42); - c2.a = Oid(c2.b); - Zjb(f2, c2.a, e); - } - a.g = f2; - } - function Dad(a, b, c2) { - var d, e, f2, g, h, i2; - e = b - a.e; - f2 = e / a.d.c.length; - g = 0; - for (i2 = new Anb(a.d); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 315); - d = a.b - h.b + c2; - fad(h, h.e + g * f2, h.f); - bad(h, f2, d); - ++g; - } - } - function wPd(a) { - var b; - a.f._j(); - if (a.b != -1) { - ++a.b; - b = a.f.d[a.a]; - if (a.b < b.i) { - return; + } else { + var newParentValSpecd = "parent" in obj.data; + var parent4 = obj.data.parent; + if (newParentValSpecd && (parent4 != null || _data2.parent != null) && parent4 != _data2.parent) { + if (parent4 === void 0) { + parent4 = null; } - ++a.a; - } - for (; a.a < a.f.d.length; ++a.a) { - b = a.f.d[a.a]; - if (!!b && b.i != 0) { - a.b = 0; - return; + if (parent4 != null) { + parent4 = "" + parent4; } + ele = ele.move({ + parent: parent4 + }); } - a.b = -1; - } - function Jde(a, b) { - var c2, d, e; - e = b.c.length; - c2 = Lde(a, e == 0 ? "" : (tFb(0, b.c.length), WD(b.c[0]))); - for (d = 1; d < e && !!c2; ++d) { - c2 = RD(c2, 54).Zh((tFb(d, b.c.length), WD(b.c[d]))); - } - return c2; - } - function RIc(a, b) { - var c2, d; - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - a.c[c2.c.p][c2.p].a = Iwb(a.i); - a.c[c2.c.p][c2.p].d = Kfb(a.c[c2.c.p][c2.p].a); - a.c[c2.c.p][c2.p].b = 1; - } - } - function brd(a, b) { - var c2, d, e, f2; - f2 = 0; - for (d = new Anb(a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 163); - f2 += $wnd.Math.pow(urd(c2) * trd(c2) - b, 2); - } - e = $wnd.Math.sqrt(f2 / (a.c.length - 1)); - return e; - } - function uMb(a, b) { - var c2, d, e, f2; - f2 = 0; - for (e = RD(RD(Qc(a.r, b), 21), 87).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 117); - f2 = $wnd.Math.max(f2, d.e.a + d.b.Mf().a); - } - c2 = RD(Vrb(a.b, b), 127); - c2.n.b = 0; - c2.a.a = f2; - } - function DNb(a, b) { - var c2, d, e, f2; - c2 = 0; - for (f2 = RD(RD(Qc(a.r, b), 21), 87).Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 117); - c2 = $wnd.Math.max(c2, e.e.b + e.b.Mf().b); - } - d = RD(Vrb(a.b, b), 127); - d.n.d = 0; - d.a.b = c2; - } - function jMc(a, b, c2, d) { - var e, f2, g; - f2 = eMc(a, b, c2, d); - g = kMc(a, f2); - BMc(a, b, c2, d); - YLc(a.b); - yob(); - _mb(f2, new LMc(a)); - e = kMc(a, f2); - BMc(a, c2, b, d); - YLc(a.b); - return new Ptd(sgb(g), sgb(e)); - } - function udd(a, b) { - var c2; - b.Ug("Delaunay triangulation", 1); - c2 = new bnb(); - Umb(a.i, new ydd(c2)); - Heb(TD(mQb(a, (OQb(), MQb)))) && "null10bw"; - !a.e ? a.e = EFb(c2) : ye(a.e, EFb(c2)); - b.Vg(); - } - function Hsd(a, b, c2) { - var d, e; - Nzd(a, a.j + b, a.k + c2); - for (e = new dMd((!a.a && (a.a = new XZd(D4, a, 5)), a.a)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 377); - Uxd(d, d.a + b, d.b + c2); - } - Gzd(a, a.b + b, a.c + c2); - } - function Vyd(a, b, c2, d) { - switch (c2) { - case 7: - return !a.e && (a.e = new Yie(G4, a, 7, 4)), qLd(a.e, b, d); - case 8: - return !a.d && (a.d = new Yie(G4, a, 8, 5)), qLd(a.d, b, d); - } - return dyd(a, b, c2, d); } - function Wyd(a, b, c2, d) { - switch (c2) { - case 7: - return !a.e && (a.e = new Yie(G4, a, 7, 4)), rLd(a.e, b, d); - case 8: - return !a.d && (a.d = new Yie(G4, a, 8, 5)), rLd(a.d, b, d); + } + if (obj.position) { + ele.position(obj.position); + } + var checkSwitch = /* @__PURE__ */ __name(function checkSwitch2(k2, trueFnName, falseFnName) { + var obj_k = obj[k2]; + if (obj_k != null && obj_k !== p3[k2]) { + if (obj_k) { + ele[trueFnName](); + } else { + ele[falseFnName](); } - return eyd(a, b, c2, d); } - function LDd(a, b, c2) { - var d, e, f2, g, h; - if (c2) { - f2 = c2.a.length; - d = new vue(f2); - for (h = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); h.Ob(); ) { - g = RD(h.Pb(), 17); - e = xDd(c2, g.a); - !!e && DEd(a, e, b); - } - } + }, "checkSwitch"); + checkSwitch("removed", "remove", "restore"); + checkSwitch("selected", "select", "unselect"); + checkSwitch("selectable", "selectify", "unselectify"); + checkSwitch("locked", "lock", "unlock"); + checkSwitch("grabbable", "grabify", "ungrabify"); + checkSwitch("pannable", "panify", "unpanify"); + if (obj.classes != null) { + ele.classes(obj.classes); + } + cy.endBatch(); + return this; + } else if (obj === void 0) { + var json3 = { + data: copy4(p3.data), + position: copy4(p3.position), + group: p3.group, + removed: p3.removed, + selected: p3.selected, + selectable: p3.selectable, + locked: p3.locked, + grabbable: p3.grabbable, + pannable: p3.pannable, + classes: null + }; + json3.classes = ""; + var i2 = 0; + p3.classes.forEach(function(cls) { + return json3.classes += i2++ === 0 ? cls : " " + cls; + }); + return json3; + } + }; + elesfn$1.jsons = function() { + var jsons = []; + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var json3 = ele.json(); + jsons.push(json3); + } + return jsons; + }; + elesfn$1.clone = function() { + var cy = this.cy(); + var elesArr = []; + for (var i2 = 0; i2 < this.length; i2++) { + var ele = this[i2]; + var json3 = ele.json(); + var clone5 = new Element(cy, json3, false); + elesArr.push(clone5); + } + return new Collection(cy, elesArr); + }; + elesfn$1.copy = elesfn$1.clone; + elesfn$1.restore = function() { + var notifyRenderer = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; + var addToPool2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + var self2 = this; + var cy = self2.cy(); + var cy_p = cy._private; + var nodes6 = []; + var edges5 = []; + var elements3; + for (var _i3 = 0, l2 = self2.length; _i3 < l2; _i3++) { + var ele = self2[_i3]; + if (addToPool2 && !ele.removed()) { + continue; + } + if (ele.isNode()) { + nodes6.push(ele); + } else { + edges5.push(ele); + } + } + elements3 = nodes6.concat(edges5); + var i2; + var removeFromElements = /* @__PURE__ */ __name(function removeFromElements2() { + elements3.splice(i2, 1); + i2--; + }, "removeFromElements"); + for (i2 = 0; i2 < elements3.length; i2++) { + var _ele2 = elements3[i2]; + var _private = _ele2._private; + var _data3 = _private.data; + _ele2.clearTraversalCache(); + if (!addToPool2 && !_private.removed) ; + else if (_data3.id === void 0) { + _data3.id = uuid(); + } else if (number$1(_data3.id)) { + _data3.id = "" + _data3.id; + } else if (emptyString(_data3.id) || !string(_data3.id)) { + error("Can not create element with invalid string ID `" + _data3.id + "`"); + removeFromElements(); + continue; + } else if (cy.hasElementWithId(_data3.id)) { + error("Can not create second element with ID `" + _data3.id + "`"); + removeFromElements(); + continue; + } + var id26 = _data3.id; + if (_ele2.isNode()) { + var pos = _private.position; + if (pos.x == null) { + pos.x = 0; } - function fOd(a, b, c2) { - var d, e, f2, g, h; - a._j(); - f2 = b == null ? 0 : tb(b); - if (a.f > 0) { - g = (f2 & lve) % a.d.length; - e = WNd(a, g, f2, b); - if (e) { - h = e.nd(c2); - return h; - } - } - d = a.ck(f2, b, c2); - a.c.Fc(d); - return null; + if (pos.y == null) { + pos.y = 0; } - function Tee(a, b) { - var c2, d, e, f2; - switch (Oee(a, b).Kl()) { - case 3: - case 2: { - c2 = mYd(b); - for (e = 0, f2 = c2.i; e < f2; ++e) { - d = RD(QHd(c2, e), 35); - if (yfe(Qee(a, d)) == 5) { - return d; - } - } - break; - } + } + if (_ele2.isEdge()) { + var edge = _ele2; + var fields = ["source", "target"]; + var fieldsLength = fields.length; + var badSourceOrTarget = false; + for (var j2 = 0; j2 < fieldsLength; j2++) { + var field = fields[j2]; + var val = _data3[field]; + if (number$1(val)) { + val = _data3[field] = "" + _data3[field]; } - return null; - } - function gt(a) { - var b, c2, d, e, f2; - if (Xp(a.f, a.b.length)) { - d = $C(UG, ewe, 227, a.b.length * 2, 0, 1); - a.b = d; - e = d.length - 1; - for (c2 = a.a; c2 != a; c2 = c2._d()) { - f2 = RD(c2, 227); - b = f2.d & e; - f2.a = d[b]; - d[b] = f2; - } - } - } - function gSc(a) { - var b, c2; - c2 = RD(mQb(a, (Ywc(), kwc)), 21); - b = vfd(ZRc); - c2.Hc((ovc(), lvc)) && ofd(b, aSc); - c2.Hc(nvc) && ofd(b, cSc); - c2.Hc(evc) && ofd(b, $Rc); - c2.Hc(gvc) && ofd(b, _Rc); - return b; - } - function Bid(a) { - if (a < 0) { - throw Adb(new agb("The input must be positive")); - } else - return a < sid.length ? Xdb(sid[a]) : $wnd.Math.sqrt(dFe * a) * (Jid(a, a) / Iid(2.718281828459045, a)); - } - function PHd(a, b) { - var c2; - if (a.Yi() && b != null) { - for (c2 = 0; c2 < a.i; ++c2) { - if (pb(b, a.g[c2])) { - return true; - } - } - } else { - for (c2 = 0; c2 < a.i; ++c2) { - if (dE(a.g[c2]) === dE(b)) { - return true; - } - } + if (val == null || val === "") { + error("Can not create edge `" + id26 + "` with unspecified " + field); + badSourceOrTarget = true; + } else if (!cy.hasElementWithId(val)) { + error("Can not create edge `" + id26 + "` with nonexistant " + field + " `" + val + "`"); + badSourceOrTarget = true; } - return false; } - function Br(a, b) { - if (b == null) { - while (a.a.Ob()) { - if (RD(a.a.Pb(), 44).md() == null) { - return true; - } - } - } else { - while (a.a.Ob()) { - if (pb(b, RD(a.a.Pb(), 44).md())) { - return true; - } - } - } - return false; + if (badSourceOrTarget) { + removeFromElements(); + continue; } - function Qy(a, b) { - var c2, d, e; - if (b === a) { - return true; - } else if (ZD(b, 678)) { - e = RD(b, 2046); - return Ue((d = a.g, !d ? a.g = new Di(a) : d), (c2 = e.g, !c2 ? e.g = new Di(e) : c2)); - } else { - return false; - } + var src = cy.getElementById(_data3.source); + var tgt = cy.getElementById(_data3.target); + if (src.same(tgt)) { + src._private.edges.push(edge); + } else { + src._private.edges.push(edge); + tgt._private.edges.push(edge); } - function hA(a) { - var b, c2, d, e; - b = "gA"; - c2 = "vz"; - e = $wnd.Math.min(a.length, 5); - for (d = e - 1; d >= 0; d--) { - if (lhb(a[d].d, b) || lhb(a[d].d, c2)) { - a.length >= d + 1 && a.splice(0, d + 1); + edge._private.source = src; + edge._private.target = tgt; + } + _private.map = new Map$2(); + _private.map.set(id26, { + ele: _ele2, + index: 0 + }); + _private.removed = false; + if (addToPool2) { + cy.addToPool(_ele2); + } + } + for (var _i4 = 0; _i4 < nodes6.length; _i4++) { + var node2 = nodes6[_i4]; + var _data4 = node2._private.data; + if (number$1(_data4.parent)) { + _data4.parent = "" + _data4.parent; + } + var parentId = _data4.parent; + var specifiedParent = parentId != null; + if (specifiedParent || node2._private.parent) { + var parent4 = node2._private.parent ? cy.collection().merge(node2._private.parent) : cy.getElementById(parentId); + if (parent4.empty()) { + _data4.parent = void 0; + } else if (parent4[0].removed()) { + warn("Node added with missing parent, reference to parent removed"); + _data4.parent = void 0; + node2._private.parent = null; + } else { + var selfAsParent = false; + var ancestor = parent4; + while (!ancestor.empty()) { + if (node2.same(ancestor)) { + selfAsParent = true; + _data4.parent = void 0; break; } + ancestor = ancestor.parent(); } - return a; - } - function Fdb(a, b) { - var c2; - if (Kdb(a) && Kdb(b)) { - c2 = a / b; - if (jxe < c2 && c2 < hxe) { - return c2 < 0 ? $wnd.Math.ceil(c2) : $wnd.Math.floor(c2); - } + if (!selfAsParent) { + parent4[0]._private.children.push(node2); + node2._private.parent = parent4[0]; + cy_p.hasCompoundNodes = true; } - return Edb(iD(Kdb(a) ? Wdb(a) : a, Kdb(b) ? Wdb(b) : b, false)); } - function T0b(a, b) { - if (b == a.c.i) { - return a.d.i; - } else if (b == a.d.i) { - return a.c.i; - } else { - throw Adb(new agb("'node' must either be the source node or target node of the edge.")); - } + } + } + if (elements3.length > 0) { + var restored = elements3.length === self2.length ? self2 : new Collection(cy, elements3); + for (var _i5 = 0; _i5 < restored.length; _i5++) { + var _ele3 = restored[_i5]; + if (_ele3.isNode()) { + continue; } - function M5b(a) { - var b, c2, d, e; - e = RD(mQb(a, (Ywc(), Zvc)), 36); - if (e) { - d = new pjd(); - b = Y2b(a.c.i); - while (b != e) { - c2 = b.e; - b = Y2b(c2); - Zid($id($id(d, c2.n), b.c), b.d.b, b.d.d); - } - return d; + _ele3.parallelEdges().clearTraversalCache(); + _ele3.source().clearTraversalCache(); + _ele3.target().clearTraversalCache(); + } + var toUpdateStyle; + if (cy_p.hasCompoundNodes) { + toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent()); + } else { + toUpdateStyle = restored; + } + toUpdateStyle.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(notifyRenderer); + if (notifyRenderer) { + restored.emitAndNotify("add"); + } else if (addToPool2) { + restored.emit("add"); + } + } + return self2; + }; + elesfn$1.removed = function() { + var ele = this[0]; + return ele && ele._private.removed; + }; + elesfn$1.inside = function() { + var ele = this[0]; + return ele && !ele._private.removed; + }; + elesfn$1.remove = function() { + var notifyRenderer = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; + var removeFromPool2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + var self2 = this; + var elesToRemove = []; + var elesToRemoveIds = {}; + var cy = self2._private.cy; + function addConnectedEdges(node2) { + var edges5 = node2._private.edges; + for (var i3 = 0; i3 < edges5.length; i3++) { + add3(edges5[i3]); + } + } + __name(addConnectedEdges, "addConnectedEdges"); + function addChildren2(node2) { + var children2 = node2._private.children; + for (var i3 = 0; i3 < children2.length; i3++) { + add3(children2[i3]); + } + } + __name(addChildren2, "addChildren"); + function add3(ele2) { + var alreadyAdded = elesToRemoveIds[ele2.id()]; + if (removeFromPool2 && ele2.removed() || alreadyAdded) { + return; + } else { + elesToRemoveIds[ele2.id()] = true; + } + if (ele2.isNode()) { + elesToRemove.push(ele2); + addConnectedEdges(ele2); + addChildren2(ele2); + } else { + elesToRemove.unshift(ele2); + } + } + __name(add3, "add"); + for (var i2 = 0, l2 = self2.length; i2 < l2; i2++) { + var ele = self2[i2]; + add3(ele); + } + function removeEdgeRef(node2, edge) { + var connectedEdges = node2._private.edges; + removeFromArray(connectedEdges, edge); + node2.clearTraversalCache(); + } + __name(removeEdgeRef, "removeEdgeRef"); + function removeParallelRef(pllEdge2) { + pllEdge2.clearTraversalCache(); + } + __name(removeParallelRef, "removeParallelRef"); + var alteredParents = []; + alteredParents.ids = {}; + function removeChildRef(parent5, ele2) { + ele2 = ele2[0]; + parent5 = parent5[0]; + var children2 = parent5._private.children; + var pid = parent5.id(); + removeFromArray(children2, ele2); + ele2._private.parent = null; + if (!alteredParents.ids[pid]) { + alteredParents.ids[pid] = true; + alteredParents.push(parent5); + } + } + __name(removeChildRef, "removeChildRef"); + self2.dirtyCompoundBoundsCache(); + if (removeFromPool2) { + cy.removeFromPool(elesToRemove); + } + for (var _i6 = 0; _i6 < elesToRemove.length; _i6++) { + var _ele4 = elesToRemove[_i6]; + if (_ele4.isEdge()) { + var src = _ele4.source()[0]; + var tgt = _ele4.target()[0]; + removeEdgeRef(src, _ele4); + removeEdgeRef(tgt, _ele4); + var pllEdges = _ele4.parallelEdges(); + for (var j2 = 0; j2 < pllEdges.length; j2++) { + var pllEdge = pllEdges[j2]; + removeParallelRef(pllEdge); + if (pllEdge.isBundledBezier()) { + pllEdge.dirtyBoundingBoxCache(); } - return G5b; } - function phc(a) { - var b; - b = RD(mQb(a, (Ywc(), Pwc)), 337); - FDb(EDb(new SDb(null, new Swb(b.d, 16)), new Chc()), new Ehc(a)); - FDb(CDb(new SDb(null, new Swb(b.d, 16)), new Ghc()), new Ihc(a)); + } else { + var parent4 = _ele4.parent(); + if (parent4.length !== 0) { + removeChildRef(parent4, _ele4); } - function Zrc(a, b) { - var c2, d, e, f2; - e = b ? a3b(a) : Z2b(a); - for (d = new is(Mr(e.a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - f2 = T0b(c2, a); - if (f2.k == (r3b(), o3b) && f2.c != a.c) { - return f2; + } + if (removeFromPool2) { + _ele4._private.removed = true; + } + } + var elesStillInside = cy._private.elements; + cy._private.hasCompoundNodes = false; + for (var _i7 = 0; _i7 < elesStillInside.length; _i7++) { + var _ele5 = elesStillInside[_i7]; + if (_ele5.isParent()) { + cy._private.hasCompoundNodes = true; + break; + } + } + var removedElements = new Collection(this.cy(), elesToRemove); + if (removedElements.size() > 0) { + if (notifyRenderer) { + removedElements.emitAndNotify("remove"); + } else if (removeFromPool2) { + removedElements.emit("remove"); + } + } + for (var _i8 = 0; _i8 < alteredParents.length; _i8++) { + var _ele6 = alteredParents[_i8]; + if (!removeFromPool2 || !_ele6.removed()) { + _ele6.updateStyle(); + } + } + return removedElements; + }; + elesfn$1.move = function(struct) { + var cy = this._private.cy; + var eles = this; + var notifyRenderer = false; + var modifyPool = false; + var toString6 = /* @__PURE__ */ __name(function toString7(id26) { + return id26 == null ? id26 : "" + id26; + }, "toString"); + if (struct.source !== void 0 || struct.target !== void 0) { + var srcId = toString6(struct.source); + var tgtId = toString6(struct.target); + var srcExists = srcId != null && cy.hasElementWithId(srcId); + var tgtExists = tgtId != null && cy.hasElementWithId(tgtId); + if (srcExists || tgtExists) { + cy.batch(function() { + eles.remove(notifyRenderer, modifyPool); + eles.emitAndNotify("moveout"); + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var _data5 = ele._private.data; + if (ele.isEdge()) { + if (srcExists) { + _data5.source = srcId; + } + if (tgtExists) { + _data5.target = tgtId; + } } } - return null; - } - function fIc(a) { - var b, c2, d; - for (c2 = new Anb(a.p); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - if (b.k != (r3b(), p3b)) { - continue; + eles.restore(notifyRenderer, modifyPool); + }); + eles.emitAndNotify("move"); + } + } else if (struct.parent !== void 0) { + var parentId = toString6(struct.parent); + var parentExists = parentId === null || cy.hasElementWithId(parentId); + if (parentExists) { + var pidToAssign = parentId === null ? void 0 : parentId; + cy.batch(function() { + var updated = eles.remove(notifyRenderer, modifyPool); + updated.emitAndNotify("moveout"); + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var _data6 = ele._private.data; + if (ele.isNode()) { + _data6.parent = pidToAssign; } - d = b.o.b; - a.i = $wnd.Math.min(a.i, d); - a.g = $wnd.Math.max(a.g, d); - } - } - function OIc(a, b, c2) { - var d, e, f2; - for (f2 = new Anb(b); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 10); - a.c[d.c.p][d.p].e = false; } - for (e = new Anb(b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - NIc(a, d, c2); + updated.restore(notifyRenderer, modifyPool); + }); + eles.emitAndNotify("move"); + } + } + return this; + }; + [elesfn$j, elesfn$i, elesfn$h, elesfn$g, elesfn$f, data3, elesfn$d, dimensions, elesfn$9, elesfn$8, elesfn$7, elesfn$6, elesfn$5, elesfn$4, elesfn$3, elesfn$2].forEach(function(props) { + extend2(elesfn$1, props); + }); + corefn$9 = { + add: /* @__PURE__ */ __name(function add2(opts) { + var elements3; + var cy = this; + if (elementOrCollection(opts)) { + var eles = opts; + if (eles._private.cy === cy) { + elements3 = eles.restore(); + } else { + var jsons = []; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + jsons.push(ele.json()); } + elements3 = new Collection(cy, jsons); } - function uTc(a, b, c2) { - var d, e; - d = VTc(b.j, c2.s, c2.c) + VTc(c2.e, b.s, b.c); - e = VTc(c2.j, b.s, b.c) + VTc(b.e, c2.s, c2.c); - if (d == e) { - if (d > 0) { - a.b += 2; - a.a += d; + } else if (array2(opts)) { + var _jsons = opts; + elements3 = new Collection(cy, _jsons); + } else if (plainObject(opts) && (array2(opts.nodes) || array2(opts.edges))) { + var elesByGroup = opts; + var _jsons2 = []; + var grs = ["nodes", "edges"]; + for (var _i = 0, il = grs.length; _i < il; _i++) { + var group2 = grs[_i]; + var elesArray = elesByGroup[group2]; + if (array2(elesArray)) { + for (var j2 = 0, jl = elesArray.length; j2 < jl; j2++) { + var json3 = extend2({ + group: group2 + }, elesArray[j2]); + _jsons2.push(json3); } - } else { - a.b += 1; - a.a += $wnd.Math.min(d, e); } } - function CVc(a) { - var b; - b = RD(mQb(RD(ju(a.b, 0), 40), (h_c(), T$c)), 107); - pQb(a, (q$c(), SZc), new rjd(0, 0)); - FVc(new YWc(), a, b.b + b.c - Kfb(UD(mQb(a, ZZc))), b.d + b.a - Kfb(UD(mQb(a, _Zc)))); - } - function pDd(a, b) { - var c2, d; - d = false; - if (bE(b)) { - d = true; - oDd(a, new OC(WD(b))); - } - if (!d) { - if (ZD(b, 242)) { - d = true; - oDd(a, (c2 = Qeb(RD(b, 242)), new hC(c2))); - } - } - if (!d) { - throw Adb(new Aeb(tIe)); - } - } - function g$d(a, b, c2, d) { - var e, f2, g; - e = new P3d(a.e, 1, 10, (g = b.c, ZD(g, 90) ? RD(g, 29) : (JTd(), zTd)), (f2 = c2.c, ZD(f2, 90) ? RD(f2, 29) : (JTd(), zTd)), fZd(a, b), false); - !d ? d = e : d.nj(e); - return d; - } - function _2b(a) { - var b, c2; - switch (RD(mQb(Y2b(a), (yCc(), QAc)), 429).g) { - case 0: - b = a.n; - c2 = a.o; - return new rjd(b.a + c2.a / 2, b.b + c2.b / 2); - case 1: - return new sjd(a.n); - default: - return null; - } - } - function Ouc() { - Ouc = geb; - Luc = new Puc(LAe, 0); - Kuc = new Puc("LEFTUP", 1); - Nuc = new Puc("RIGHTUP", 2); - Juc = new Puc("LEFTDOWN", 3); - Muc = new Puc("RIGHTDOWN", 4); - Iuc = new Puc("BALANCED", 5); - } - function dKc(a, b, c2) { - var d, e, f2; - d = Qfb(a.a[b.p], a.a[c2.p]); - if (d == 0) { - e = RD(mQb(b, (Ywc(), qwc)), 15); - f2 = RD(mQb(c2, qwc), 15); - if (e.Hc(c2)) { - return -1; - } else if (f2.Hc(b)) { - return 1; - } - } - return d; - } - function k5c(a) { - switch (a.g) { - case 1: - return new K3c(); - case 2: - return new M3c(); - case 3: - return new I3c(); - case 0: - return null; - default: - throw Adb(new agb(mFe + (a.f != null ? a.f : "" + a.g))); - } - } - function gyd(a, b, c2) { - switch (b) { - case 1: - !a.n && (a.n = new C5d(I4, a, 1, 7)); - sLd(a.n); - !a.n && (a.n = new C5d(I4, a, 1, 7)); - YGd(a.n, RD(c2, 16)); - return; - case 2: - jyd(a, WD(c2)); - return; - } - Dxd(a, b, c2); - } - function xyd(a, b, c2) { - switch (b) { - case 3: - Ayd(a, Kfb(UD(c2))); - return; - case 4: - Cyd(a, Kfb(UD(c2))); - return; - case 5: - Dyd(a, Kfb(UD(c2))); - return; - case 6: - Eyd(a, Kfb(UD(c2))); - return; - } - gyd(a, b, c2); - } - function dBd(a, b, c2) { - var d, e, f2; - f2 = (d = new R5d(), d); - e = XVd(f2, b, null); - !!e && e.oj(); - PAd(f2, c2); - WGd((!a.c && (a.c = new C5d(u7, a, 12, 10)), a.c), f2); - $Vd(f2, 0); - bWd(f2, 1); - aWd(f2, true); - _Vd(f2, true); - } - function M5d(a, b) { - var c2, d, e; - c2 = Ktb(a.i, b); - if (ZD(c2, 241)) { - e = RD(c2, 241); - e.zi() == null && void 0; - return e.wi(); - } else if (ZD(c2, 507)) { - d = RD(c2, 2037); - e = d.b; - return e; - } else { - return null; - } - } - function aj(a, b, c2, d) { - var e, f2; - Qb(b); - Qb(c2); - f2 = RD(Fn(a.d, b), 17); - Ob(!!f2, "Row %s not in %s", b, a.e); - e = RD(Fn(a.b, c2), 17); - Ob(!!e, "Column %s not in %s", c2, a.c); - return cj(a, f2.a, e.a, d); - } - function ZC(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l; - k = e[f2]; - j = f2 == g - 1; - h = j ? d : 0; - l = _C(h, k); - d != 10 && cD(WC(a, g - f2), b[f2], c2[f2], h, l); - if (!j) { - ++f2; - for (i2 = 0; i2 < k; ++i2) { - l[i2] = ZC(a, b, c2, d, e, f2, g); - } - } - return l; - } - function cMd(b) { - if (b.g == -1) { - throw Adb(new cgb()); - } - b.Xj(); - try { - b.i.gd(b.g); - b.f = b.i.j; - b.g < b.e && --b.e; - b.g = -1; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - throw Adb(new Jrb()); - } else - throw Adb(a); - } - } - function v0b(a) { - var b, c2, d, e; - e = -1; - d = 0; - for (c2 = new Anb(a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 249); - if (b.c == (BEc(), yEc)) { - e = d == 0 ? 0 : d - 1; - break; - } else - d == a.c.length - 1 && (e = d); - d += 1; - } - return e; - } - function $9c(a) { - var b, c2, d, e; - e = 0; - b = 0; - for (d = new Anb(a.c); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 27); - Dyd(c2, a.e + e); - Eyd(c2, a.f); - e += c2.g + a.b; - b = $wnd.Math.max(b, c2.f + a.b); - } - a.d = e - a.b; - a.a = b - a.b; - } - function UGb(a) { - var b, c2, d; - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - d = b.d.c; - b.d.c = b.d.d; - b.d.d = d; - d = b.d.b; - b.d.b = b.d.a; - b.d.a = d; - d = b.b.a; - b.b.a = b.b.b; - b.b.b = d; - } - IGb(a); - } - function DYb(a) { - var b, c2, d; - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - d = b.g.c; - b.g.c = b.g.d; - b.g.d = d; - d = b.g.b; - b.g.b = b.g.a; - b.g.a = d; - d = b.e.a; - b.e.a = b.e.b; - b.e.b = d; - } - uYb(a); - } - function pqc(a) { - var b, c2, d, e, f2; - f2 = Ec(a.k); - for (c2 = (qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd])), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - if (b != opd && !f2.Hc(b)) { - return b; - } - } - return null; - } - function drc(a, b) { - var c2, d; - d = RD(Nvb(DDb(CDb(new SDb(null, new Swb(b.j, 16)), new lrc()))), 12); - if (d) { - c2 = RD(Vmb(d.e, 0), 18); - if (c2) { - return RD(mQb(c2, (Ywc(), zwc)), 17).a; - } - } - return mDc(a.b); - } - function FGc(a, b) { - var c2, d, e, f2; - for (f2 = new Anb(b.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - Nnb(a.d); - for (d = new is(Mr(a3b(e).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - CGc(a, e, c2.d.i); - } - } - } - function T9c(a, b) { - var c2, d; - Ymb(a.b, b); - for (d = new Anb(a.n); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 209); - if (Wmb(c2.c, b, 0) != -1) { - Ymb(c2.c, b); - $9c(c2); - c2.c.c.length == 0 && Ymb(a.n, c2); - break; - } - } - N9c(a); - } - function ead(a, b) { - var c2, d, e, f2, g; - g = a.f; - e = 0; - f2 = 0; - for (d = new Anb(a.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 172); - U9c(c2, a.e, g); - Q9c(c2, b); - f2 = $wnd.Math.max(f2, c2.r); - g += c2.d + a.c; - e = g; - } - a.d = f2; - a.b = e; - } - function R2c(a) { - var b, c2; - c2 = yGd(a); - if (gr(c2)) { - return null; - } else { - b = (Qb(c2), RD(Er(new is(Mr(c2.a.Kc(), new ir()))), 74)); - return AGd(RD(QHd((!b.b && (b.b = new Yie(E4, b, 4, 7)), b.b), 0), 84)); - } - } - function vWd(a) { - var b; - if (!a.o) { - b = a.uk(); - b ? a.o = new D9d(a, a, null) : a.al() ? a.o = new U6d(a, null) : yfe(Qee((lke(), jke), a)) == 1 ? a.o = new N9d(a) : a.o = new S9d(a, null); - } - return a.o; - } - function Vje(a, b, c2, d) { - var e, f2, g, h, i2; - if (c2.Xh(b)) { - e = (g = b, !g ? null : RD(d, 54).gi(g)); - if (e) { - i2 = c2.Mh(b); - h = b.t; - if (h > 1 || h == -1) { - f2 = RD(i2, 15); - e.Wb(Sje(a, f2)); - } else { - e.Wb(Rje(a, RD(i2, 58))); - } - } - } - } - function ceb(b, c2, d, e) { - beb(); - var f2 = _db; - function g() { - for (var a = 0; a < f2.length; a++) { - f2[a](); - } - } - if (b) { - try { - fve(g)(); - } catch (a) { - b(c2, a); - } - } else { - fve(g)(); - } - } - function a6b(a, b) { - var c2, d, e, f2; - for (e = (f2 = new Xkb(a.b).a.vc().Kc(), new blb(f2)); e.a.Ob(); ) { - d = (c2 = RD(e.a.Pb(), 44), RD(c2.ld(), 34)); - if (egb(b, RD(d, 17)) < 0) { - return false; - } - } - return true; - } - function b6b(a, b) { - var c2, d, e, f2; - for (e = (f2 = new Xkb(a.b).a.vc().Kc(), new blb(f2)); e.a.Ob(); ) { - d = (c2 = RD(e.a.Pb(), 44), RD(c2.ld(), 34)); - if (egb(b, RD(d, 17)) > 0) { - return false; - } - } - return true; + elements3 = new Collection(cy, _jsons2); + } else { + var _json = opts; + elements3 = new Element(cy, _json).collection(); + } + return elements3; + }, "add"), + remove: /* @__PURE__ */ __name(function remove2(collection4) { + if (elementOrCollection(collection4)) ; + else if (string(collection4)) { + var selector = collection4; + collection4 = this.$(selector); + } + return collection4.remove(); + }, "remove") + }; + __name(generateCubicBezier, "generateCubicBezier"); + generateSpringRK4 = /* @__PURE__ */ function() { + function springAccelerationForState(state4) { + return -state4.tension * state4.x - state4.friction * state4.v; + } + __name(springAccelerationForState, "springAccelerationForState"); + function springEvaluateStateWithDerivative(initialState, dt, derivative) { + var state4 = { + x: initialState.x + derivative.dx * dt, + v: initialState.v + derivative.dv * dt, + tension: initialState.tension, + friction: initialState.friction + }; + return { + dx: state4.v, + dv: springAccelerationForState(state4) + }; + } + __name(springEvaluateStateWithDerivative, "springEvaluateStateWithDerivative"); + function springIntegrateState(state4, dt) { + var a2 = { + dx: state4.v, + dv: springAccelerationForState(state4) + }, b2 = springEvaluateStateWithDerivative(state4, dt * 0.5, a2), c3 = springEvaluateStateWithDerivative(state4, dt * 0.5, b2), d2 = springEvaluateStateWithDerivative(state4, dt, c3), dxdt = 1 / 6 * (a2.dx + 2 * (b2.dx + c3.dx) + d2.dx), dvdt = 1 / 6 * (a2.dv + 2 * (b2.dv + c3.dv) + d2.dv); + state4.x = state4.x + dxdt * dt; + state4.v = state4.v + dvdt * dt; + return state4; + } + __name(springIntegrateState, "springIntegrateState"); + return /* @__PURE__ */ __name(function springRK4Factory(tension, friction, duration) { + var initState = { + x: -1, + v: 0, + tension: null, + friction: null + }, path4 = [0], time_lapsed = 0, tolerance = 1 / 1e4, DT = 16 / 1e3, have_duration, dt, last_state; + tension = parseFloat(tension) || 500; + friction = parseFloat(friction) || 20; + duration = duration || null; + initState.tension = tension; + initState.friction = friction; + have_duration = duration !== null; + if (have_duration) { + time_lapsed = springRK4Factory(tension, friction); + dt = time_lapsed / duration * DT; + } else { + dt = DT; + } + for (; ; ) { + last_state = springIntegrateState(last_state || initState, dt); + path4.push(1 + last_state.x); + time_lapsed += 16; + if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) { + break; } - function okc(a) { - var b, c2, d, e, f2; - for (d = new vkb(new mkb(a.b).a); d.b; ) { - c2 = tkb(d); - b = RD(c2.ld(), 10); - f2 = RD(RD(c2.md(), 42).a, 10); - e = RD(RD(c2.md(), 42).b, 8); - $id(hjd(b.n), $id(ajd(f2.n), e)); - } + } + return !have_duration ? time_lapsed : function(percentComplete) { + return path4[percentComplete * (path4.length - 1) | 0]; + }; + }, "springRK4Factory"); + }(); + cubicBezier = /* @__PURE__ */ __name(function cubicBezier2(t13, p1, t22, p22) { + var bezier = generateCubicBezier(t13, p1, t22, p22); + return function(start3, end2, percent) { + return start3 + (end2 - start3) * bezier(percent); + }; + }, "cubicBezier"); + easings = { + "linear": /* @__PURE__ */ __name(function linear3(start3, end2, percent) { + return start3 + (end2 - start3) * percent; + }, "linear"), + // default easings + "ease": cubicBezier(0.25, 0.1, 0.25, 1), + "ease-in": cubicBezier(0.42, 0, 1, 1), + "ease-out": cubicBezier(0, 0, 0.58, 1), + "ease-in-out": cubicBezier(0.42, 0, 0.58, 1), + // sine + "ease-in-sine": cubicBezier(0.47, 0, 0.745, 0.715), + "ease-out-sine": cubicBezier(0.39, 0.575, 0.565, 1), + "ease-in-out-sine": cubicBezier(0.445, 0.05, 0.55, 0.95), + // quad + "ease-in-quad": cubicBezier(0.55, 0.085, 0.68, 0.53), + "ease-out-quad": cubicBezier(0.25, 0.46, 0.45, 0.94), + "ease-in-out-quad": cubicBezier(0.455, 0.03, 0.515, 0.955), + // cubic + "ease-in-cubic": cubicBezier(0.55, 0.055, 0.675, 0.19), + "ease-out-cubic": cubicBezier(0.215, 0.61, 0.355, 1), + "ease-in-out-cubic": cubicBezier(0.645, 0.045, 0.355, 1), + // quart + "ease-in-quart": cubicBezier(0.895, 0.03, 0.685, 0.22), + "ease-out-quart": cubicBezier(0.165, 0.84, 0.44, 1), + "ease-in-out-quart": cubicBezier(0.77, 0, 0.175, 1), + // quint + "ease-in-quint": cubicBezier(0.755, 0.05, 0.855, 0.06), + "ease-out-quint": cubicBezier(0.23, 1, 0.32, 1), + "ease-in-out-quint": cubicBezier(0.86, 0, 0.07, 1), + // expo + "ease-in-expo": cubicBezier(0.95, 0.05, 0.795, 0.035), + "ease-out-expo": cubicBezier(0.19, 1, 0.22, 1), + "ease-in-out-expo": cubicBezier(1, 0, 0, 1), + // circ + "ease-in-circ": cubicBezier(0.6, 0.04, 0.98, 0.335), + "ease-out-circ": cubicBezier(0.075, 0.82, 0.165, 1), + "ease-in-out-circ": cubicBezier(0.785, 0.135, 0.15, 0.86), + // user param easings... + "spring": /* @__PURE__ */ __name(function spring(tension, friction, duration) { + if (duration === 0) { + return easings.linear; + } + var spring2 = generateSpringRK4(tension, friction, duration); + return function(start3, end2, percent) { + return start3 + (end2 - start3) * spring2(percent); + }; + }, "spring"), + "cubic-bezier": cubicBezier + }; + __name(getEasedValue, "getEasedValue"); + __name(getValue2, "getValue"); + __name(ease, "ease"); + __name(step$1, "step$1"); + __name(valid, "valid"); + __name(startAnimation, "startAnimation"); + __name(stepAll, "stepAll"); + corefn$8 = { + // pull in animation functions + animate: define2.animate(), + animation: define2.animation(), + animated: define2.animated(), + clearQueue: define2.clearQueue(), + delay: define2.delay(), + delayAnimation: define2.delayAnimation(), + stop: define2.stop(), + addToAnimationPool: /* @__PURE__ */ __name(function addToAnimationPool(eles) { + var cy = this; + if (!cy.styleEnabled()) { + return; + } + cy._private.aniEles.merge(eles); + }, "addToAnimationPool"), + stopAnimationLoop: /* @__PURE__ */ __name(function stopAnimationLoop() { + this._private.animationsRunning = false; + }, "stopAnimationLoop"), + startAnimationLoop: /* @__PURE__ */ __name(function startAnimationLoop() { + var cy = this; + cy._private.animationsRunning = true; + if (!cy.styleEnabled()) { + return; + } + function headlessStep() { + if (!cy._private.animationsRunning) { + return; } - function Roc(a) { - switch (RD(mQb(a.b, (yCc(), BAc)), 387).g) { - case 1: - FDb(GDb(EDb(new SDb(null, new Swb(a.d, 16)), new kpc()), new mpc()), new opc()); - break; - case 2: - Toc(a); - break; - case 0: - Soc(a); - } + requestAnimationFrame2(/* @__PURE__ */ __name(function animationStep(now4) { + stepAll(now4, cy); + headlessStep(); + }, "animationStep")); + } + __name(headlessStep, "headlessStep"); + var renderer7 = cy.renderer(); + if (renderer7 && renderer7.beforeRender) { + renderer7.beforeRender(/* @__PURE__ */ __name(function rendererAnimationStep(willDraw, now4) { + stepAll(now4, cy); + }, "rendererAnimationStep"), renderer7.beforeRenderPriorities.animations); + } else { + headlessStep(); + } + }, "startAnimationLoop") + }; + emitterOptions = { + qualifierCompare: /* @__PURE__ */ __name(function qualifierCompare3(selector1, selector2) { + if (selector1 == null || selector2 == null) { + return selector1 == null && selector2 == null; + } else { + return selector1.sameText(selector2); + } + }, "qualifierCompare"), + eventMatches: /* @__PURE__ */ __name(function eventMatches3(cy, listener, eventObj) { + var selector = listener.qualifier; + if (selector != null) { + return cy !== eventObj.target && element(eventObj.target) && selector.matches(eventObj.target); + } + return true; + }, "eventMatches"), + addEventFields: /* @__PURE__ */ __name(function addEventFields3(cy, evt) { + evt.cy = cy; + evt.target = cy; + }, "addEventFields"), + callbackContext: /* @__PURE__ */ __name(function callbackContext3(cy, listener, eventObj) { + return listener.qualifier != null ? eventObj.target : cy; + }, "callbackContext") + }; + argSelector2 = /* @__PURE__ */ __name(function argSelector3(arg) { + if (string(arg)) { + return new Selector(arg); + } else { + return arg; + } + }, "argSelector"); + elesfn = { + createEmitter: /* @__PURE__ */ __name(function createEmitter2() { + var _p = this._private; + if (!_p.emitter) { + _p.emitter = new Emitter2(emitterOptions, this); + } + return this; + }, "createEmitter"), + emitter: /* @__PURE__ */ __name(function emitter2() { + return this._private.emitter; + }, "emitter"), + on: /* @__PURE__ */ __name(function on2(events, selector, callback) { + this.emitter().on(events, argSelector2(selector), callback); + return this; + }, "on"), + removeListener: /* @__PURE__ */ __name(function removeListener2(events, selector, callback) { + this.emitter().removeListener(events, argSelector2(selector), callback); + return this; + }, "removeListener"), + removeAllListeners: /* @__PURE__ */ __name(function removeAllListeners2() { + this.emitter().removeAllListeners(); + return this; + }, "removeAllListeners"), + one: /* @__PURE__ */ __name(function one3(events, selector, callback) { + this.emitter().one(events, argSelector2(selector), callback); + return this; + }, "one"), + once: /* @__PURE__ */ __name(function once2(events, selector, callback) { + this.emitter().one(events, argSelector2(selector), callback); + return this; + }, "once"), + emit: /* @__PURE__ */ __name(function emit2(events, extraParams) { + this.emitter().emit(events, extraParams); + return this; + }, "emit"), + emitAndNotify: /* @__PURE__ */ __name(function emitAndNotify2(event3, eles) { + this.emit(event3); + this.notify(event3, eles); + return this; + }, "emitAndNotify") + }; + define2.eventAliasesOn(elesfn); + corefn$7 = { + png: /* @__PURE__ */ __name(function png(options3) { + var renderer7 = this._private.renderer; + options3 = options3 || {}; + return renderer7.png(options3); + }, "png"), + jpg: /* @__PURE__ */ __name(function jpg(options3) { + var renderer7 = this._private.renderer; + options3 = options3 || {}; + options3.bg = options3.bg || "#fff"; + return renderer7.jpg(options3); + }, "jpg") + }; + corefn$7.jpeg = corefn$7.jpg; + corefn$6 = { + layout: /* @__PURE__ */ __name(function layout3(options3) { + var cy = this; + if (options3 == null) { + error("Layout options must be specified to make a layout"); + return; + } + if (options3.name == null) { + error("A `name` must be specified to make a layout"); + return; + } + var name = options3.name; + var Layout2 = cy.extension("layout", name); + if (Layout2 == null) { + error("No such layout `" + name + "` found. Did you forget to import it and `cytoscape.use()` it?"); + return; + } + var eles; + if (string(options3.eles)) { + eles = cy.$(options3.eles); + } else { + eles = options3.eles != null ? options3.eles : cy.$(); + } + var layout6 = new Layout2(extend2({}, options3, { + cy, + eles + })); + return layout6; + }, "layout") + }; + corefn$6.createLayout = corefn$6.makeLayout = corefn$6.layout; + corefn$5 = { + notify: /* @__PURE__ */ __name(function notify(eventName, eventEles) { + var _p = this._private; + if (this.batching()) { + _p.batchNotifications = _p.batchNotifications || {}; + var eles = _p.batchNotifications[eventName] = _p.batchNotifications[eventName] || this.collection(); + if (eventEles != null) { + eles.merge(eventEles); } - function SVc(a, b, c2) { - var d, e, f2; - d = c2; - !d && (d = new Oqd()); - d.Ug("Layout", a.a.c.length); - for (f2 = new Anb(a.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 47); - if (d.$g()) { - return; - } - e.Kf(b, d.eh(1)); - } - d.Vg(); - } - function ukd() { - ukd = geb; - tkd = new vkd("V_TOP", 0); - skd = new vkd("V_CENTER", 1); - rkd = new vkd("V_BOTTOM", 2); - pkd = new vkd("H_LEFT", 3); - okd = new vkd("H_CENTER", 4); - qkd = new vkd("H_RIGHT", 5); - } - function GYd(a) { - var b; - if ((a.Db & 64) != 0) - return MXd(a); - b = new Shb(MXd(a)); - b.a += " (abstract: "; - Ohb(b, (a.Bb & 256) != 0); - b.a += ", interface: "; - Ohb(b, (a.Bb & 512) != 0); - b.a += ")"; - return b.a; - } - function Bz(a) { - var b; - if (a.c == null) { - b = dE(a.b) === dE(zz) ? null : a.b; - a.d = b == null ? vve : aE(b) ? Ez(VD(b)) : bE(b) ? uwe : nfb(rb(b)); - a.a = a.a + ": " + (aE(b) ? Dz(VD(b)) : b + ""); - a.c = "(" + a.d + ") " + a.a; - } - } - function Gtb() { - function b() { - try { - return (/* @__PURE__ */ new Map()).entries().next().done; - } catch (a) { - return false; - } - } - if (typeof Map === kve && Map.prototype.entries && b()) { - return Map; + return; + } + if (!_p.notificationsEnabled) { + return; + } + var renderer7 = this.renderer(); + if (this.destroyed() || !renderer7) { + return; + } + renderer7.notify(eventName, eventEles); + }, "notify"), + notifications: /* @__PURE__ */ __name(function notifications(bool2) { + var p3 = this._private; + if (bool2 === void 0) { + return p3.notificationsEnabled; + } else { + p3.notificationsEnabled = bool2 ? true : false; + } + return this; + }, "notifications"), + noNotifications: /* @__PURE__ */ __name(function noNotifications(callback) { + this.notifications(false); + callback(); + this.notifications(true); + }, "noNotifications"), + batching: /* @__PURE__ */ __name(function batching() { + return this._private.batchCount > 0; + }, "batching"), + startBatch: /* @__PURE__ */ __name(function startBatch() { + var _p = this._private; + if (_p.batchCount == null) { + _p.batchCount = 0; + } + if (_p.batchCount === 0) { + _p.batchStyleEles = this.collection(); + _p.batchNotifications = {}; + } + _p.batchCount++; + return this; + }, "startBatch"), + endBatch: /* @__PURE__ */ __name(function endBatch() { + var _p = this._private; + if (_p.batchCount === 0) { + return this; + } + _p.batchCount--; + if (_p.batchCount === 0) { + _p.batchStyleEles.updateStyle(); + var renderer7 = this.renderer(); + Object.keys(_p.batchNotifications).forEach(function(eventName) { + var eles = _p.batchNotifications[eventName]; + if (eles.empty()) { + renderer7.notify(eventName); } else { - return Htb(); - } - } - function tUc(a, b) { - var c2, d, e, f2; - f2 = new Jkb(a.e, 0); - c2 = 0; - while (f2.b < f2.d.gc()) { - d = Kfb((sFb(f2.b < f2.d.gc()), UD(f2.d.Xb(f2.c = f2.b++)))); - e = d - b; - if (e > AEe) { - return c2; - } else - e > -1e-6 && ++c2; - } - return c2; - } - function n2d(a, b) { - var c2; - if (b != a.b) { - c2 = null; - !!a.b && (c2 = Jvd(a.b, a, -4, c2)); - !!b && (c2 = Ivd(b, a, -4, c2)); - c2 = e2d(a, b, c2); - !!c2 && c2.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 3, b, b)); - } - function q2d(a, b) { - var c2; - if (b != a.f) { - c2 = null; - !!a.f && (c2 = Jvd(a.f, a, -1, c2)); - !!b && (c2 = Ivd(b, a, -1, c2)); - c2 = g2d(a, b, c2); - !!c2 && c2.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 0, b, b)); - } - function Lge(a, b, c2, d) { - var e, f2, g, h; - if (Mvd(a.e)) { - e = b.Lk(); - h = b.md(); - f2 = c2.md(); - g = fge(a, 1, e, h, f2, e.Jk() ? kge(a, e, f2, ZD(e, 102) && (RD(e, 19).Bb & txe) != 0) : -1, true); - d ? d.nj(g) : d = g; - } - return d; - } - function bne(a) { - var b, c2, d; - if (a == null) - return null; - c2 = RD(a, 15); - if (c2.dc()) - return ""; - d = new Qhb(); - for (b = c2.Kc(); b.Ob(); ) { - Nhb(d, (nme(), WD(b.Pb()))); - d.a += " "; - } - return qeb(d, d.a.length - 1); - } - function fne(a) { - var b, c2, d; - if (a == null) - return null; - c2 = RD(a, 15); - if (c2.dc()) - return ""; - d = new Qhb(); - for (b = c2.Kc(); b.Ob(); ) { - Nhb(d, (nme(), WD(b.Pb()))); - d.a += " "; - } - return qeb(d, d.a.length - 1); - } - function QIc(a, b, c2) { - var d, e; - d = a.c[b.c.p][b.p]; - e = a.c[c2.c.p][c2.p]; - if (d.a != null && e.a != null) { - return Jfb(d.a, e.a); - } else if (d.a != null) { - return -1; - } else if (e.a != null) { - return 1; + renderer7.notify(eventName, eles); } - return 0; - } - function RVc(a, b, c2) { - c2.Ug("Tree layout", 1); - Sed(a.b); - Ved(a.b, (YVc(), UVc), UVc); - Ved(a.b, VVc, VVc); - Ved(a.b, WVc, WVc); - Ved(a.b, XVc, XVc); - a.a = Qed(a.b, b); - SVc(a, b, c2.eh(1)); - c2.Vg(); - return b; - } - function ZDd(a, b) { - var c2, d, e, f2, g, h; - if (b) { - f2 = b.a.length; - c2 = new vue(f2); - for (h = (c2.b - c2.a) * c2.c < 0 ? (uue(), tue) : new Rue(c2); h.Ob(); ) { - g = RD(h.Pb(), 17); - e = xDd(b, g.a); - d = new aFd(a); - $Dd(d.a, e); - } - } - } - function oEd(a, b) { - var c2, d, e, f2, g, h; - if (b) { - f2 = b.a.length; - c2 = new vue(f2); - for (h = (c2.b - c2.a) * c2.c < 0 ? (uue(), tue) : new Rue(c2); h.Ob(); ) { - g = RD(h.Pb(), 17); - e = xDd(b, g.a); - d = new LEd(a); - NDd(d.a, e); - } - } - } - function ESd(b) { - var c2; - if (b != null && b.length > 0 && ihb(b, b.length - 1) == 33) { - try { - c2 = nSd(zhb(b, 0, b.length - 1)); - return c2.e == null; - } catch (a) { - a = zdb(a); - if (!ZD(a, 33)) - throw Adb(a); - } - } - return false; + }); + } + return this; + }, "endBatch"), + batch: /* @__PURE__ */ __name(function batch(callback) { + this.startBatch(); + callback(); + this.endBatch(); + return this; + }, "batch"), + // for backwards compatibility + batchData: /* @__PURE__ */ __name(function batchData(map5) { + var cy = this; + return this.batch(function() { + var ids = Object.keys(map5); + for (var i2 = 0; i2 < ids.length; i2++) { + var id26 = ids[i2]; + var data5 = map5[id26]; + var ele = cy.getElementById(id26); + ele.data(data5); } - function u0b(a, b, c2) { - var d, e, f2; - d = Y2b(b); - e = i2b(d); - f2 = new R3b(); - P3b(f2, b); - switch (c2.g) { - case 1: - Q3b(f2, spd(vpd(e))); - break; - case 2: - Q3b(f2, vpd(e)); - } - pQb(f2, (yCc(), ABc), UD(mQb(a, ABc))); - return f2; + }); + }, "batchData") + }; + rendererDefaults = defaults$g({ + hideEdgesOnViewport: false, + textureOnViewport: false, + motionBlur: false, + motionBlurOpacity: 0.05, + pixelRatio: void 0, + desktopTapThreshold: 4, + touchTapThreshold: 8, + wheelSensitivity: 1, + debug: false, + showFps: false + }); + corefn$4 = { + renderTo: /* @__PURE__ */ __name(function renderTo(context, zoom2, pan2, pxRatio) { + var r2 = this._private.renderer; + r2.renderTo(context, zoom2, pan2, pxRatio); + return this; + }, "renderTo"), + renderer: /* @__PURE__ */ __name(function renderer4() { + return this._private.renderer; + }, "renderer"), + forceRender: /* @__PURE__ */ __name(function forceRender() { + this.notify("draw"); + return this; + }, "forceRender"), + resize: /* @__PURE__ */ __name(function resize() { + this.invalidateSize(); + this.emitAndNotify("resize"); + return this; + }, "resize"), + initRenderer: /* @__PURE__ */ __name(function initRenderer(options3) { + var cy = this; + var RendererProto = cy.extension("renderer", options3.name); + if (RendererProto == null) { + error("Can not initialise: No such renderer `".concat(options3.name, "` found. Did you forget to import it and `cytoscape.use()` it?")); + return; + } + if (options3.wheelSensitivity !== void 0) { + warn("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine."); + } + var rOpts = rendererDefaults(options3); + rOpts.cy = cy; + cy._private.renderer = new RendererProto(rOpts); + this.notify("init"); + }, "initRenderer"), + destroyRenderer: /* @__PURE__ */ __name(function destroyRenderer() { + var cy = this; + cy.notify("destroy"); + var domEle = cy.container(); + if (domEle) { + domEle._cyreg = null; + while (domEle.childNodes.length > 0) { + domEle.removeChild(domEle.childNodes[0]); } - function jdc(a) { - var b, c2; - b = RD(hs(new is(Mr(Z2b(a.a).a.Kc(), new ir()))), 18); - c2 = RD(hs(new is(Mr(a3b(a.a).a.Kc(), new ir()))), 18); - return Heb(TD(mQb(b, (Ywc(), Nwc)))) || Heb(TD(mQb(c2, Nwc))); + } + cy._private.renderer = null; + cy.mutableElements().forEach(function(ele) { + var _p = ele._private; + _p.rscratch = {}; + _p.rstyle = {}; + _p.animation.current = []; + _p.animation.queue = []; + }); + }, "destroyRenderer"), + onRender: /* @__PURE__ */ __name(function onRender(fn3) { + return this.on("render", fn3); + }, "onRender"), + offRender: /* @__PURE__ */ __name(function offRender(fn3) { + return this.off("render", fn3); + }, "offRender") + }; + corefn$4.invalidateDimensions = corefn$4.resize; + corefn$3 = { + // get a collection + // - empty collection on no args + // - collection of elements in the graph on selector arg + // - guarantee a returned collection when elements or collection specified + collection: /* @__PURE__ */ __name(function collection3(eles, opts) { + if (string(eles)) { + return this.$(eles); + } else if (elementOrCollection(eles)) { + return eles.collection(); + } else if (array2(eles)) { + if (!opts) { + opts = {}; } - function Bnc() { - Bnc = geb; - xnc = new Cnc("ONE_SIDE", 0); - znc = new Cnc("TWO_SIDES_CORNER", 1); - Anc = new Cnc("TWO_SIDES_OPPOSING", 2); - ync = new Cnc("THREE_SIDES", 3); - wnc = new Cnc("FOUR_SIDES", 4); + return new Collection(this, eles, opts.unique, opts.removed); + } + return new Collection(this); + }, "collection"), + nodes: /* @__PURE__ */ __name(function nodes4(selector) { + var nodes6 = this.$(function(ele) { + return ele.isNode(); + }); + if (selector) { + return nodes6.filter(selector); + } + return nodes6; + }, "nodes"), + edges: /* @__PURE__ */ __name(function edges4(selector) { + var edges5 = this.$(function(ele) { + return ele.isEdge(); + }); + if (selector) { + return edges5.filter(selector); + } + return edges5; + }, "edges"), + // search the graph like jQuery + $: /* @__PURE__ */ __name(function $2(selector) { + var eles = this._private.elements; + if (selector) { + return eles.filter(selector); + } else { + return eles.spawnSelf(); + } + }, "$"), + mutableElements: /* @__PURE__ */ __name(function mutableElements() { + return this._private.elements; + }, "mutableElements") + }; + corefn$3.elements = corefn$3.filter = corefn$3.$; + styfn$8 = {}; + TRUE = "t"; + FALSE = "f"; + styfn$8.apply = function(eles) { + var self2 = this; + var _p = self2._private; + var cy = _p.cy; + var updatedEles = cy.collection(); + for (var ie = 0; ie < eles.length; ie++) { + var ele = eles[ie]; + var cxtMeta = self2.getContextMeta(ele); + if (cxtMeta.empty) { + continue; + } + var cxtStyle = self2.getContextStyle(cxtMeta); + var app = self2.applyContextStyle(cxtMeta, cxtStyle, ele); + if (ele._private.appliedInitStyle) { + self2.updateTransitions(ele, app.diffProps); + } else { + ele._private.appliedInitStyle = true; + } + var hintsDiff = self2.updateStyleHints(ele); + if (hintsDiff) { + updatedEles.push(ele); + } + } + return updatedEles; + }; + styfn$8.getPropertiesDiff = function(oldCxtKey, newCxtKey) { + var self2 = this; + var cache3 = self2._private.propDiffs = self2._private.propDiffs || {}; + var dualCxtKey = oldCxtKey + "-" + newCxtKey; + var cachedVal = cache3[dualCxtKey]; + if (cachedVal) { + return cachedVal; + } + var diffProps = []; + var addedProp = {}; + for (var i2 = 0; i2 < self2.length; i2++) { + var cxt = self2[i2]; + var oldHasCxt = oldCxtKey[i2] === TRUE; + var newHasCxt = newCxtKey[i2] === TRUE; + var cxtHasDiffed = oldHasCxt !== newHasCxt; + var cxtHasMappedProps = cxt.mappedProperties.length > 0; + if (cxtHasDiffed || newHasCxt && cxtHasMappedProps) { + var props = void 0; + if (cxtHasDiffed && cxtHasMappedProps) { + props = cxt.properties; + } else if (cxtHasDiffed) { + props = cxt.properties; + } else if (cxtHasMappedProps) { + props = cxt.mappedProperties; } - function Usc(a, b) { - var c2, d, e, f2; - f2 = new bnb(); - e = 0; - d = b.Kc(); - while (d.Ob()) { - c2 = sgb(RD(d.Pb(), 17).a + e); - while (c2.a < a.f && !wsc(a, c2.a)) { - c2 = sgb(c2.a + 1); - ++e; + for (var j2 = 0; j2 < props.length; j2++) { + var prop = props[j2]; + var name = prop.name; + var laterCxtOverrides = false; + for (var k2 = i2 + 1; k2 < self2.length; k2++) { + var laterCxt = self2[k2]; + var hasLaterCxt = newCxtKey[k2] === TRUE; + if (!hasLaterCxt) { + continue; } - if (c2.a >= a.f) { + laterCxtOverrides = laterCxt.properties[prop.name] != null; + if (laterCxtOverrides) { break; } - ZEb(f2.c, c2); } - return f2; - } - function iIc(a, b) { - var c2, d, e, f2, g; - for (f2 = new Anb(b.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - for (d = new is(Mr(Z2b(e).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - g = c2.c.i.p; - a.n[g] = a.n[g] - 1; - } + if (!addedProp[name] && !laterCxtOverrides) { + addedProp[name] = true; + diffProps.push(name); } } - function fOc(a) { - var b, c2; - for (c2 = new Anb(a.e.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 30); - wOc(a, b); - } - FDb(CDb(EDb(EDb(new SDb(null, new Swb(a.e.b, 16)), new wPc()), new TPc()), new VPc()), new XPc(a)); + } + } + cache3[dualCxtKey] = diffProps; + return diffProps; + }; + styfn$8.getContextMeta = function(ele) { + var self2 = this; + var cxtKey = ""; + var diffProps; + var prevKey = ele._private.styleCxtKey || ""; + for (var i2 = 0; i2 < self2.length; i2++) { + var context = self2[i2]; + var contextSelectorMatches = context.selector && context.selector.matches(ele); + if (contextSelectorMatches) { + cxtKey += TRUE; + } else { + cxtKey += FALSE; + } + } + diffProps = self2.getPropertiesDiff(prevKey, cxtKey); + ele._private.styleCxtKey = cxtKey; + return { + key: cxtKey, + diffPropNames: diffProps, + empty: diffProps.length === 0 + }; + }; + styfn$8.getContextStyle = function(cxtMeta) { + var cxtKey = cxtMeta.key; + var self2 = this; + var cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; + if (cxtStyles[cxtKey]) { + return cxtStyles[cxtKey]; + } + var style3 = { + _private: { + key: cxtKey + } + }; + for (var i2 = 0; i2 < self2.length; i2++) { + var cxt = self2[i2]; + var hasCxt = cxtKey[i2] === TRUE; + if (!hasCxt) { + continue; + } + for (var j2 = 0; j2 < cxt.properties.length; j2++) { + var prop = cxt.properties[j2]; + style3[prop.name] = prop; + } + } + cxtStyles[cxtKey] = style3; + return style3; + }; + styfn$8.applyContextStyle = function(cxtMeta, cxtStyle, ele) { + var self2 = this; + var diffProps = cxtMeta.diffPropNames; + var retDiffProps = {}; + var types = self2.types; + for (var i2 = 0; i2 < diffProps.length; i2++) { + var diffPropName = diffProps[i2]; + var cxtProp = cxtStyle[diffPropName]; + var eleProp = ele.pstyle(diffPropName); + if (!cxtProp) { + if (!eleProp) { + continue; + } else if (eleProp.bypass) { + cxtProp = { + name: diffPropName, + deleteBypassed: true + }; + } else { + cxtProp = { + name: diffPropName, + "delete": true + }; } - function oKd(a, b) { - if (!b) { - return false; - } else { - if (a.mj(b)) { - return false; - } - if (!a.i) { - if (ZD(b, 152)) { - a.i = RD(b, 152); - return true; - } else { - a.i = new fLd(); - return a.i.nj(b); - } - } else { - return a.i.nj(b); - } - } - } - function Hge(a, b, c2) { - var d, e, f2; - d = b.Lk(); - f2 = b.md(); - e = d.Jk() ? fge(a, 3, d, null, f2, kge(a, d, f2, ZD(d, 102) && (RD(d, 19).Bb & txe) != 0), true) : fge(a, 1, d, d.ik(), f2, -1, true); - c2 ? c2.nj(e) : c2 = e; - return c2; - } - function $me(a) { - a = nue(a, true); - if (lhb(FGe, a) || lhb("1", a)) { - return Geb(), Feb; - } else if (lhb(GGe, a) || lhb("0", a)) { - return Geb(), Eeb; - } - throw Adb(new Mle("Invalid boolean value: '" + a + "'")); - } - function Kd(a, b, c2) { - var d, e, f2; - for (e = a.vc().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 44); - f2 = d.ld(); - if (dE(b) === dE(f2) || b != null && pb(b, f2)) { - if (c2) { - d = new xlb(d.ld(), d.md()); - e.Qb(); - } - return d; - } - } - return null; + } + if (eleProp === cxtProp) { + continue; + } + if (cxtProp.mapped === types.fn && eleProp != null && eleProp.mapping != null && eleProp.mapping.value === cxtProp.value) { + var mapping = eleProp.mapping; + var fnValue = mapping.fnValue = cxtProp.value(ele); + if (fnValue === mapping.prevFnValue) { + continue; } - function WMb(a) { - RMb(); - var b, c2, d; - if (!a.B.Hc((dqd(), Xpd))) { - return; - } - d = a.f.i; - b = new Vid(a.a.c); - c2 = new z3b(); - c2.b = b.c - d.c; - c2.d = b.d - d.d; - c2.c = d.c + d.b - (b.c + b.b); - c2.a = d.d + d.a - (b.d + b.a); - a.e.$f(c2); - } - function CQb(a, b, c2, d) { - var e, f2, g; - g = $wnd.Math.min(c2, FQb(RD(a.b, 68), b, c2, d)); - for (f2 = new Anb(a.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 225); - e != b && (g = $wnd.Math.min(g, CQb(e, b, g, d))); - } - return g; - } - function c1b(a) { - var b, c2, d, e; - e = $C(jR, Nve, 199, a.b.c.length, 0, 2); - d = new Jkb(a.b, 0); - while (d.b < d.d.gc()) { - b = (sFb(d.b < d.d.gc()), RD(d.d.Xb(d.c = d.b++), 30)); - c2 = d.b - 1; - e[c2] = t2b(b.a); - } - return e; - } - function c6b(a, b, c2) { - var d, e, f2; - d = RD(cub(a.a, c2), 34); - if (d != null) { - f2 = RD(cub(a.b, d), 67); - ze(f2, c2, true); - } - e = RD(cub(a.b, b), 67); - if (!e) { - e = new Yub(); - dub(a.b, b, e); - } - Pub(e, c2, e.c.b, e.c); - dub(a.a, c2, b); - } - function _6b(a, b, c2, d, e) { - var f2, g, h, i2; - g = XNb(WNb(_Nb(Y6b(c2)), d), T6b(a, c2, e)); - for (i2 = e3b(a, c2).Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 12); - if (b[h.p]) { - f2 = b[h.p].i; - Rmb(g.d, new sOb(f2, UNb(g, f2))); - } - } - VNb(g); - } - function Ylc(a, b) { - this.f = new Tsb(); - this.b = new Tsb(); - this.j = new Tsb(); - this.a = a; - this.c = b; - this.c > 0 && Xlc(this, this.c - 1, (qpd(), Xod)); - this.c < this.a.length - 1 && Xlc(this, this.c + 1, (qpd(), ppd)); - } - function Iqc(a, b) { - var c2, d, e, f2, g; - for (f2 = new Anb(b.d); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 105); - g = RD(Wjb(a.c, e), 118).o; - for (d = new Osb(e.b); d.a < d.c.a.length; ) { - c2 = RD(Nsb(d), 64); - Umc(e, c2, g); - } - } - } - function qJc(a) { - a.length > 0 && a[0].length > 0 && (this.c = Heb(TD(mQb(Y2b(a[0][0]), (Ywc(), rwc))))); - this.a = $C(aY, Nve, 2117, a.length, 0, 2); - this.b = $C(dY, Nve, 2118, a.length, 0, 2); - this.d = new Ks(); - } - function TOc(a) { - if (a.c.length == 0) { - return false; - } - if ((tFb(0, a.c.length), RD(a.c[0], 18)).c.i.k == (r3b(), o3b)) { - return true; - } - return yDb(GDb(new SDb(null, new Swb(a, 16)), new WOc()), new YOc()); - } - function I5c(a, b) { - var c2, d, e, f2, g, h, i2; - h = Q2c(b); - f2 = b.f; - i2 = b.g; - g = $wnd.Math.sqrt(f2 * f2 + i2 * i2); - e = 0; - for (d = new Anb(h); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 27); - e += I5c(a, c2); - } - return $wnd.Math.max(e, g); - } - function Bod() { - Bod = geb; - Aod = new Eod(Sye, 0); - zod = new Eod("FREE", 1); - yod = new Eod("FIXED_SIDE", 2); - vod = new Eod("FIXED_ORDER", 3); - xod = new Eod("FIXED_RATIO", 4); - wod = new Eod("FIXED_POS", 5); - } - function Cee(a, b) { - var c2, d, e; - c2 = b.qi(a.a); - if (c2) { - e = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), bLe)); - for (d = 1; d < (lke(), kke).length; ++d) { - if (lhb(kke[d], e)) { - return d; - } - } - } - return 0; - } - function aob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Gyb(f2, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function gob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Gyb(f2, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function Md(a) { - var b, c2, d; - d = new Jyb(pve, "{", "}"); - for (c2 = a.vc().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 44); - Gyb(d, Nd(a, b.ld()) + "=" + Nd(a, b.md())); - } - return !d.a ? d.c : d.e.length == 0 ? d.a.a : d.a.a + ("" + d.e); - } - function vJb(a) { - var b, c2, d, e; - while (!nmb(a.o)) { - c2 = RD(smb(a.o), 42); - d = RD(c2.a, 125); - b = RD(c2.b, 218); - e = oIb(b, d); - if (b.e == d) { - EIb(e.g, b); - d.e = e.e + b.a; - } else { - EIb(e.b, b); - d.e = e.e - b.a; - } - Rmb(a.e.a, d); - } - } - function W9b(a, b) { - var c2, d, e; - c2 = null; - for (e = RD(b.Kb(a), 20).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 18); - if (!c2) { - c2 = d.c.i == a ? d.d.i : d.c.i; - } else { - if ((d.c.i == a ? d.d.i : d.c.i) != c2) { - return false; - } - } - } - return true; - } - function UTc(a, b) { - var c2, d, e, f2, g; - c2 = uSc(a, false, b); - for (e = new Anb(c2); e.a < e.c.c.length; ) { - d = RD(ynb(e), 132); - d.d == 0 ? (_Sc(d, null), aTc(d, null)) : (f2 = d.a, g = d.b, _Sc(d, g), aTc(d, f2), void 0); - } - } - function QUc(a) { - var b, c2; - b = new ufd(); - ofd(b, CUc); - c2 = RD(mQb(a, (Ywc(), kwc)), 21); - c2.Hc((ovc(), nvc)) && ofd(b, GUc); - c2.Hc(evc) && ofd(b, DUc); - c2.Hc(lvc) && ofd(b, FUc); - c2.Hc(gvc) && ofd(b, EUc); - return b; - } - function iz(a, b, c2) { - var d, e, f2, g, h; - jz(a); - for (e = (a.k == null && (a.k = $C(rJ, Nve, 82, 0, 0, 1)), a.k), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - iz(d); - } - h = a.f; - !!h && iz(h); - } - function kec(a) { - var b, c2, d, e; - jec(a); - for (c2 = new is(Mr(W2b(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - d = b.c.i == a; - e = d ? b.d : b.c; - d ? Z0b(b, null) : Y0b(b, null); - pQb(b, (Ywc(), Ewc), e); - oec(a, e.i); - } - } - function aqc(a, b, c2, d) { - var e, f2; - f2 = b.i; - e = c2[f2.g][a.d[f2.g]]; - switch (f2.g) { - case 1: - e -= d + b.j.b; - b.g.b = e; - break; - case 3: - e += d; - b.g.b = e; - break; - case 4: - e -= d + b.j.a; - b.g.a = e; - break; - case 2: - e += d; - b.g.a = e; - } + } + var retDiffProp = retDiffProps[diffPropName] = { + prev: eleProp + }; + self2.applyParsedProperty(ele, cxtProp); + retDiffProp.next = ele.pstyle(diffPropName); + if (retDiffProp.next && retDiffProp.next.bypass) { + retDiffProp.next = retDiffProp.next.bypassed; + } + } + return { + diffProps: retDiffProps + }; + }; + styfn$8.updateStyleHints = function(ele) { + var _p = ele._private; + var self2 = this; + var propNames = self2.propertyGroupNames; + var propGrKeys = self2.propertyGroupKeys; + var propHash = /* @__PURE__ */ __name(function propHash2(ele2, propNames2, seedKey) { + return self2.getPropertiesHash(ele2, propNames2, seedKey); + }, "propHash"); + var oldStyleKey = _p.styleKey; + if (ele.removed()) { + return false; + } + var isNode2 = _p.group === "nodes"; + var overriddenStyles = ele._private.style; + propNames = Object.keys(overriddenStyles); + for (var i2 = 0; i2 < propGrKeys.length; i2++) { + var grKey = propGrKeys[i2]; + _p.styleKeys[grKey] = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT]; + } + var updateGrKey1 = /* @__PURE__ */ __name(function updateGrKey12(val, grKey2) { + return _p.styleKeys[grKey2][0] = hashInt(val, _p.styleKeys[grKey2][0]); + }, "updateGrKey1"); + var updateGrKey2 = /* @__PURE__ */ __name(function updateGrKey22(val, grKey2) { + return _p.styleKeys[grKey2][1] = hashIntAlt(val, _p.styleKeys[grKey2][1]); + }, "updateGrKey2"); + var updateGrKey = /* @__PURE__ */ __name(function updateGrKey3(val, grKey2) { + updateGrKey1(val, grKey2); + updateGrKey2(val, grKey2); + }, "updateGrKey"); + var updateGrKeyWStr = /* @__PURE__ */ __name(function updateGrKeyWStr2(strVal, grKey2) { + for (var j2 = 0; j2 < strVal.length; j2++) { + var ch = strVal.charCodeAt(j2); + updateGrKey1(ch, grKey2); + updateGrKey2(ch, grKey2); + } + }, "updateGrKeyWStr"); + var N2 = 2e9; + var cleanNum = /* @__PURE__ */ __name(function cleanNum2(val) { + return -128 < val && val < 128 && Math.floor(val) !== val ? N2 - (val * 1024 | 0) : val; + }, "cleanNum"); + for (var _i = 0; _i < propNames.length; _i++) { + var name = propNames[_i]; + var parsedProp = overriddenStyles[name]; + if (parsedProp == null) { + continue; + } + var propInfo = this.properties[name]; + var type3 = propInfo.type; + var _grKey = propInfo.groupKey; + var normalizedNumberVal = void 0; + if (propInfo.hashOverride != null) { + normalizedNumberVal = propInfo.hashOverride(ele, parsedProp); + } else if (parsedProp.pfValue != null) { + normalizedNumberVal = parsedProp.pfValue; + } + var numberVal = propInfo.enums == null ? parsedProp.value : null; + var haveNormNum = normalizedNumberVal != null; + var haveUnitedNum = numberVal != null; + var haveNum = haveNormNum || haveUnitedNum; + var units = parsedProp.units; + if (type3.number && haveNum && !type3.multiple) { + var v3 = haveNormNum ? normalizedNumberVal : numberVal; + updateGrKey(cleanNum(v3), _grKey); + if (!haveNormNum && units != null) { + updateGrKeyWStr(units, _grKey); } - function K2c(a) { - var b, c2, d; - for (c2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 27); - d = yGd(b); - if (!gs(new is(Mr(d.a.Kc(), new ir())))) { - return b; - } - } - return null; + } else { + updateGrKeyWStr(parsedProp.strValue, _grKey); + } + } + var hash = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT]; + for (var _i2 = 0; _i2 < propGrKeys.length; _i2++) { + var _grKey2 = propGrKeys[_i2]; + var grHash = _p.styleKeys[_grKey2]; + hash[0] = hashInt(grHash[0], hash[0]); + hash[1] = hashIntAlt(grHash[1], hash[1]); + } + _p.styleKey = combineHashes(hash[0], hash[1]); + var sk = _p.styleKeys; + _p.labelDimsKey = combineHashesArray(sk.labelDimensions); + var labelKeys = propHash(ele, ["label"], sk.labelDimensions); + _p.labelKey = combineHashesArray(labelKeys); + _p.labelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, labelKeys)); + if (!isNode2) { + var sourceLabelKeys = propHash(ele, ["source-label"], sk.labelDimensions); + _p.sourceLabelKey = combineHashesArray(sourceLabelKeys); + _p.sourceLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, sourceLabelKeys)); + var targetLabelKeys = propHash(ele, ["target-label"], sk.labelDimensions); + _p.targetLabelKey = combineHashesArray(targetLabelKeys); + _p.targetLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, targetLabelKeys)); + } + if (isNode2) { + var _p$styleKeys = _p.styleKeys, nodeBody = _p$styleKeys.nodeBody, nodeBorder = _p$styleKeys.nodeBorder, nodeOutline = _p$styleKeys.nodeOutline, backgroundImage = _p$styleKeys.backgroundImage, compound = _p$styleKeys.compound, pie2 = _p$styleKeys.pie; + var nodeKeys = [nodeBody, nodeBorder, nodeOutline, backgroundImage, compound, pie2].filter(function(k2) { + return k2 != null; + }).reduce(hashArrays, [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT]); + _p.nodeKey = combineHashesArray(nodeKeys); + _p.hasPie = pie2 != null && pie2[0] !== DEFAULT_HASH_SEED && pie2[1] !== DEFAULT_HASH_SEED_ALT; + } + return oldStyleKey !== _p.styleKey; + }; + styfn$8.clearStyleHints = function(ele) { + var _p = ele._private; + _p.styleCxtKey = ""; + _p.styleKeys = {}; + _p.styleKey = null; + _p.labelKey = null; + _p.labelStyleKey = null; + _p.sourceLabelKey = null; + _p.sourceLabelStyleKey = null; + _p.targetLabelKey = null; + _p.targetLabelStyleKey = null; + _p.nodeKey = null; + _p.hasPie = null; + }; + styfn$8.applyParsedProperty = function(ele, parsedProp) { + var self2 = this; + var prop = parsedProp; + var style3 = ele._private.style; + var flatProp; + var types = self2.types; + var type3 = self2.properties[prop.name].type; + var propIsBypass = prop.bypass; + var origProp = style3[prop.name]; + var origPropIsBypass = origProp && origProp.bypass; + var _p = ele._private; + var flatPropMapping = "mapping"; + var getVal = /* @__PURE__ */ __name(function getVal2(p3) { + if (p3 == null) { + return null; + } else if (p3.pfValue != null) { + return p3.pfValue; + } else { + return p3.value; + } + }, "getVal"); + var checkTriggers = /* @__PURE__ */ __name(function checkTriggers2() { + var fromVal = getVal(origProp); + var toVal = getVal(prop); + self2.checkTriggers(ele, prop.name, fromVal, toVal); + }, "checkTriggers"); + if (parsedProp.name === "curve-style" && ele.isEdge() && // loops must be bundled beziers + (parsedProp.value !== "bezier" && ele.isLoop() || // edges connected to compound nodes can not be haystacks + parsedProp.value === "haystack" && (ele.source().isParent() || ele.target().isParent()))) { + prop = parsedProp = this.parse(parsedProp.name, "bezier", propIsBypass); + } + if (prop["delete"]) { + style3[prop.name] = void 0; + checkTriggers(); + return true; + } + if (prop.deleteBypassed) { + if (!origProp) { + checkTriggers(); + return true; + } else if (origProp.bypass) { + origProp.bypassed = void 0; + checkTriggers(); + return true; + } else { + return false; + } + } + if (prop.deleteBypass) { + if (!origProp) { + checkTriggers(); + return true; + } else if (origProp.bypass) { + style3[prop.name] = origProp.bypassed; + checkTriggers(); + return true; + } else { + return false; + } + } + var printMappingErr = /* @__PURE__ */ __name(function printMappingErr2() { + warn("Do not assign mappings to elements without corresponding data (i.e. ele `" + ele.id() + "` has no mapping for property `" + prop.name + "` with data field `" + prop.field + "`); try a `[" + prop.field + "]` selector to limit scope to elements with `" + prop.field + "` defined"); + }, "printMappingErr"); + switch (prop.mapped) { + case types.mapData: { + var fields = prop.field.split("."); + var fieldVal = _p.data; + for (var i2 = 0; i2 < fields.length && fieldVal; i2++) { + var field = fields[i2]; + fieldVal = fieldVal[field]; } - function g3c() { - g3c = geb; - e3c = new h3c("OVERLAP_REMOVAL", 0); - b3c = new h3c(iFe, 1); - f3c = new h3c("ROTATION", 2); - c3c = new h3c("GRAPH_SIZE_CALCULATION", 3); - d3c = new h3c("OUTGOING_EDGE_ANGLES", 4); - } - function aCd() { - var a; - if (YBd) - return RD(N5d((YSd(), XSd), $He), 2115); - a = RD(ZD(Xjb((YSd(), XSd), $He), 569) ? Xjb(XSd, $He) : new _Bd(), 569); - YBd = true; - ZBd(a); - $Bd(a); - rBd(a); - $jb(XSd, $He, a); - return a; - } - function Tge(a, b, c2) { - var d, e; - if (a.j == 0) - return c2; - e = RD(jZd(a, b, c2), 76); - d = c2.Lk(); - if (!d.rk() || !a.a.am(d)) { - throw Adb(new yz("Invalid entry feature '" + d.qk().zb + "." + d.xe() + "'")); - } - return e; - } - function Yi(a, b) { - var c2, d, e, f2, g, h, i2, j; - for (h = a.a, i2 = 0, j = h.length; i2 < j; ++i2) { - g = h[i2]; - for (d = g, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - if (dE(b) === dE(c2) || b != null && pb(b, c2)) { - return true; - } - } - } + if (fieldVal == null) { + printMappingErr(); return false; } - function yjb(a) { - var b, c2, d; - if (Ddb(a, 0) >= 0) { - c2 = Fdb(a, ixe); - d = Mdb(a, ixe); - } else { - b = Udb(a, 1); - c2 = Fdb(b, 5e8); - d = Mdb(b, 5e8); - d = Bdb(Sdb(d, 1), Cdb(a, 1)); - } - return Rdb(Sdb(d, 32), Cdb(c2, yxe)); - } - function fTb(a, b, c2) { - var d, e; - d = (sFb(b.b != 0), RD(Wub(b, b.a.a), 8)); - switch (c2.g) { - case 0: - d.b = 0; - break; - case 2: - d.b = a.f; - break; - case 3: - d.a = 0; - break; - default: - d.a = a.g; - } - e = Sub(b, 0); - cvb(e, d); - return b; - } - function Vpc(a, b, c2, d) { - var e, f2, g, h, i2; - i2 = a.b; - f2 = b.d; - g = f2.j; - h = $pc(g, i2.d[g.g], c2); - e = $id(ajd(f2.n), f2.a); - switch (f2.j.g) { - case 1: - case 3: - h.a += e.a; - break; - case 2: - case 4: - h.b += e.b; - } - Pub(d, h, d.c.b, d.c); - } - function YNc(a, b, c2) { - var d, e, f2, g; - g = Wmb(a.e, b, 0); - f2 = new ZNc(); - f2.b = c2; - d = new Jkb(a.e, g); - while (d.b < d.d.gc()) { - e = (sFb(d.b < d.d.gc()), RD(d.d.Xb(d.c = d.b++), 10)); - e.p = c2; - Rmb(f2.e, e); - Ckb(d); - } - return f2; - } - function l8c(a, b, c2, d) { - var e, f2, g, h, i2; - e = null; - f2 = 0; - for (h = new Anb(b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 27); - i2 = g.i + g.g; - if (a < g.j + g.f + d) { - !e ? e = g : c2.i - i2 < c2.i - f2 && (e = g); - f2 = e.i + e.g; - } - } - return !e ? 0 : f2 + d; - } - function m8c(a, b, c2, d) { - var e, f2, g, h, i2; - f2 = null; - e = 0; - for (h = new Anb(b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 27); - i2 = g.j + g.f; - if (a < g.i + g.g + d) { - !f2 ? f2 = g : c2.j - i2 < c2.j - e && (f2 = g); - e = f2.j + f2.f; - } - } - return !f2 ? 0 : e + d; - } - function CA(a) { - var b, c2, d; - b = false; - d = a.b.c.length; - for (c2 = 0; c2 < d; c2++) { - if (DA(RD(Vmb(a.b, c2), 443))) { - if (!b && c2 + 1 < d && DA(RD(Vmb(a.b, c2 + 1), 443))) { - b = true; - RD(Vmb(a.b, c2), 443).a = true; - } - } else { - b = false; - } - } - } - function Ijb(a, b, c2, d, e) { - var f2, g; - f2 = 0; - for (g = 0; g < e; g++) { - f2 = Bdb(f2, Vdb(Cdb(b[g], yxe), Cdb(d[g], yxe))); - a[g] = Ydb(f2); - f2 = Tdb(f2, 32); - } - for (; g < c2; g++) { - f2 = Bdb(f2, Cdb(b[g], yxe)); - a[g] = Ydb(f2); - f2 = Tdb(f2, 32); - } - } - function Rjb(a, b) { - Ljb(); - var c2, d; - d = (Pib(), Kib); - c2 = a; - for (; b > 1; b >>= 1) { - (b & 1) != 0 && (d = Wib(d, c2)); - c2.d == 1 ? c2 = Wib(c2, c2) : c2 = new djb(Tjb(c2.a, c2.d, $C(kE, Pwe, 28, c2.d << 1, 15, 1))); - } - d = Wib(d, c2); - return d; - } - function Hwb() { - Hwb = geb; - var a, b, c2, d; - Ewb = $C(iE, vxe, 28, 25, 15, 1); - Fwb = $C(iE, vxe, 28, 33, 15, 1); - d = 152587890625e-16; - for (b = 32; b >= 0; b--) { - Fwb[b] = d; - d *= 0.5; - } - c2 = 1; - for (a = 24; a >= 0; a--) { - Ewb[a] = c2; - c2 *= 0.5; - } - } - function a5b(a) { - var b, c2; - if (Heb(TD(Gxd(a, (yCc(), NAc))))) { - for (c2 = new is(Mr(zGd(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 74); - if (ozd(b)) { - if (Heb(TD(Gxd(b, OAc)))) { - return true; - } - } - } - } + var percent; + if (!number$1(fieldVal)) { + warn("Do not use continuous mappers without specifying numeric data (i.e. `" + prop.field + ": " + fieldVal + "` for `" + ele.id() + "` is non-numeric)"); return false; - } - function Qmc(a, b) { - var c2, d, e; - if (Ysb(a.f, b)) { - b.b = a; - d = b.c; - Wmb(a.j, d, 0) != -1 || Rmb(a.j, d); - e = b.d; - Wmb(a.j, e, 0) != -1 || Rmb(a.j, e); - c2 = b.a.b; - if (c2.c.length != 0) { - !a.i && (a.i = new _mc(a)); - Wmc(a.i, c2); - } - } - } - function Xpc(a) { - var b, c2, d, e, f2; - c2 = a.c.d; - d = c2.j; - e = a.d.d; - f2 = e.j; - if (d == f2) { - return c2.p < e.p ? 0 : 1; - } else if (tpd(d) == f2) { - return 0; - } else if (rpd(d) == f2) { - return 1; - } else { - b = a.b; - return Csb(b.b, tpd(d)) ? 0 : 1; - } - } - function Pfd(a) { - var b; - this.d = new Tsb(); - this.c = a.c; - this.e = a.d; - this.b = a.b; - this.f = new ntd(a.e); - this.a = a.a; - !a.f ? this.g = (b = RD(mfb(T5), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)) : this.g = a.f; - } - function GEd(a, b) { - var c2, d, e, f2, g, h; - e = a; - g = yDd(e, "layoutOptions"); - !g && (g = yDd(e, cIe)); - if (g) { - h = g; - d = null; - !!h && (d = (f2 = oC(h, $C(qJ, Nve, 2, 0, 6, 1)), new CC(h, f2))); - if (d) { - c2 = new bFd(h, b); - xgb(d, c2); - } - } - } - function AGd(a) { - if (ZD(a, 207)) { - return RD(a, 27); - } else if (ZD(a, 193)) { - return MCd(RD(a, 123)); - } else if (!a) { - throw Adb(new Ogb(HIe)); + } else { + var fieldWidth = prop.fieldMax - prop.fieldMin; + if (fieldWidth === 0) { + percent = 0; } else { - throw Adb(new kib("Only support nodes and ports.")); + percent = (fieldVal - prop.fieldMin) / fieldWidth; } } - function SA(a, b, c2, d) { - if (b >= 0 && lhb(a.substr(b, "GMT".length), "GMT")) { - c2[0] = b + 3; - return JA(a, c2, d); - } - if (b >= 0 && lhb(a.substr(b, "UTC".length), "UTC")) { - c2[0] = b + 3; - return JA(a, c2, d); - } - return JA(a, c2, d); + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; } - function Zmc(a, b) { - var c2, d, e, f2, g; - f2 = a.g.a; - g = a.g.b; - for (d = new Anb(a.d); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 72); - e = c2.n; - e.a = f2; - a.i == (qpd(), Yod) ? e.b = g + a.j.b - c2.o.b : e.b = g; - $id(e, b); - f2 += c2.o.a + a.e; - } + if (type3.color) { + var r1 = prop.valueMin[0]; + var r2 = prop.valueMax[0]; + var g1 = prop.valueMin[1]; + var g2 = prop.valueMax[1]; + var b1 = prop.valueMin[2]; + var b2 = prop.valueMax[2]; + var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; + var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; + var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)]; + flatProp = { + // colours are simple, so just create the flat property instead of expensive string parsing + bypass: prop.bypass, + // we're a bypass if the mapping property is a bypass + name: prop.name, + value: clr, + strValue: "rgb(" + clr[0] + ", " + clr[1] + ", " + clr[2] + ")" + }; + } else if (type3.number) { + var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; + flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping); + } else { + return false; } - function Fqd(a, b, c2) { - if (a.b) { - throw Adb(new dgb("The task is already done.")); - } else if (a.p != null) { - return false; - } else { - a.p = b; - a.r = c2; - a.k && (a.o = (gib(), Ndb(Hdb(Date.now()), Awe))); - return true; - } + if (!flatProp) { + printMappingErr(); + return false; } - function HFd(a) { - var b, c2, d, e, f2, g, h; - h = new uC(); - c2 = a.Pg(); - e = c2 != null; - e && sDd(h, uIe, a.Pg()); - d = a.xe(); - f2 = d != null; - f2 && sDd(h, GIe, a.xe()); - b = a.Og(); - g = b != null; - g && sDd(h, "description", a.Og()); - return h; - } - function UVd(a, b, c2) { - var d, e, f2; - f2 = a.q; - a.q = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - e = new N3d(a, 1, 9, f2, b); - !c2 ? c2 = e : c2.nj(e); - } - if (!b) { - !!a.r && (c2 = a.Yk(null, c2)); - } else { - d = b.c; - d != a.r && (c2 = a.Yk(d, c2)); - } - return c2; - } - function gae(a, b, c2) { - var d, e, f2, g, h; - c2 = (h = b, Ivd(h, a.e, -1 - a.c, c2)); - g = $9d(a.a); - for (f2 = (d = new vkb(new mkb(g.a).a), new xae(d)); f2.a.b; ) { - e = RD(tkb(f2.a).ld(), 89); - c2 = o2d(e, k2d(e, a.a), c2); - } - return c2; - } - function hae(a, b, c2) { - var d, e, f2, g, h; - c2 = (h = b, Jvd(h, a.e, -1 - a.c, c2)); - g = $9d(a.a); - for (f2 = (d = new vkb(new mkb(g.a).a), new xae(d)); f2.a.b; ) { - e = RD(tkb(f2.a).ld(), 89); - c2 = o2d(e, k2d(e, a.a), c2); - } - return c2; - } - function rjb(a, b, c2, d) { - var e, f2, g; - if (d == 0) { - hib(b, 0, a, c2, a.length - c2); - } else { - g = 32 - d; - a[a.length - 1] = 0; - for (f2 = a.length - 1; f2 > c2; f2--) { - a[f2] |= b[f2 - c2 - 1] >>> g; - a[f2 - 1] = b[f2 - c2 - 1] << d; - } - } - for (e = 0; e < c2; e++) { - a[e] = 0; - } - } - function CMb(a) { - var b, c2, d, e, f2; - b = 0; - c2 = 0; - for (f2 = a.Kc(); f2.Ob(); ) { - d = RD(f2.Pb(), 117); - b = $wnd.Math.max(b, d.d.b); - c2 = $wnd.Math.max(c2, d.d.c); - } - for (e = a.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 117); - d.d.b = b; - d.d.c = c2; - } - } - function KNb(a) { - var b, c2, d, e, f2; - c2 = 0; - b = 0; - for (f2 = a.Kc(); f2.Ob(); ) { - d = RD(f2.Pb(), 117); - c2 = $wnd.Math.max(c2, d.d.d); - b = $wnd.Math.max(b, d.d.a); - } - for (e = a.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 117); - d.d.d = c2; - d.d.a = b; - } - } - function Pnc(a, b, c2, d, e) { - var f2, g; - f2 = RD(zDb(CDb(b.Oc(), new Foc()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - Eob(f2); - g = RD($i(a.b, c2, d), 15); - e == 0 ? g.cd(0, f2) : g.Gc(f2); - } - function Sdd(a, b, c2) { - c2.Ug("Grow Tree", 1); - a.b = b.f; - if (Heb(TD(mQb(b, (OQb(), MQb))))) { - a.c = new kRb(); - Odd(a, null); - } else { - a.c = new kRb(); - } - a.a = false; - Qdd(a, b.f); - pQb(b, NQb, (Geb(), a.a ? true : false)); - c2.Vg(); - } - function wsd(a) { - var b, c2, d, e; - b = null; - for (e = new Anb(a.Rf()); e.a < e.c.c.length; ) { - d = RD(ynb(e), 187); - c2 = new Uid2(d.Lf().a, d.Lf().b, d.Mf().a, d.Mf().b); - !b ? b = c2 : Sid(b, c2); - } - !b && (b = new Tid()); - return b; - } - function dyd(a, b, c2, d) { - var e, f2; - if (c2 == 1) { - return !a.n && (a.n = new C5d(I4, a, 1, 7)), qLd(a.n, b, d); - } - return f2 = RD(vYd((e = RD(Ywd(a, 16), 29), !e ? a.ii() : e), c2), 69), f2.wk().zk(a, Wwd(a), c2 - AYd(a.ii()), b, d); - } - function IHd(a, b, c2) { - var d, e, f2, g, h; - d = c2.gc(); - a._i(a.i + d); - h = a.i - b; - h > 0 && hib(a.g, b, a.g, b + d, h); - g = c2.Kc(); - a.i += d; - for (e = 0; e < d; ++e) { - f2 = g.Pb(); - MHd(a, b, a.Zi(b, f2)); - a.Mi(b, f2); - a.Ni(); - ++b; - } - return d != 0; - } - function XVd(a, b, c2) { - var d; - if (b != a.q) { - !!a.q && (c2 = Jvd(a.q, a, -10, c2)); - !!b && (c2 = Ivd(b, a, -10, c2)); - c2 = UVd(a, b, c2); - } else if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - d = new N3d(a, 1, 9, b, b); - !c2 ? c2 = d : c2.nj(d); - } - return c2; - } - function ek(a, b, c2, d) { - Mb((c2 & Ove) == 0, "flatMap does not support SUBSIZED characteristic"); - Mb((c2 & 4) == 0, "flatMap does not support SORTED characteristic"); - Qb(a); - Qb(b); - return new Mk(a, b, c2, d); - } - function fz(a, b) { - vFb(b, "Cannot suppress a null exception."); - mFb(b != a, "Exception can not suppress itself."); - if (a.i) { - return; - } - a.k == null ? a.k = cD(WC(rJ, 1), Nve, 82, 0, [b]) : a.k[a.k.length] = b; + flatProp.mapping = prop; + prop = flatProp; + break; + } + case types.data: { + var _fields = prop.field.split("."); + var _fieldVal = _p.data; + for (var _i3 = 0; _i3 < _fields.length && _fieldVal; _i3++) { + var _field = _fields[_i3]; + _fieldVal = _fieldVal[_field]; } - function DLb(a, b) { - var c2; - c2 = ELb(a.b.ag(), b.b.ag()); - if (c2 != 0) { - return c2; - } - switch (a.b.ag().g) { - case 1: - case 2: - return hgb(a.b.Nf(), b.b.Nf()); - case 3: - case 4: - return hgb(b.b.Nf(), a.b.Nf()); - } - return 0; + if (_fieldVal != null) { + flatProp = this.parse(prop.name, _fieldVal, prop.bypass, flatPropMapping); } - function eUb(a) { - var b, c2, d; - d = a.e.c.length; - a.a = YC(kE, [Nve, Pwe], [53, 28], 15, [d, d], 2); - for (c2 = new Anb(a.c); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 290); - a.a[b.c.a][b.d.a] += RD(mQb(b, (yVb(), lVb)), 17).a; - } + if (!flatProp) { + printMappingErr(); + return false; } - function sAd(a, b) { - var c2, d, e, f2, g; - if (a == null) { - return null; - } else { - g = $C(hE, zwe, 28, 2 * b, 15, 1); - for (d = 0, e = 0; d < b; ++d) { - c2 = a[d] >> 4 & 15; - f2 = a[d] & 15; - g[e++] = oAd[c2]; - g[e++] = oAd[f2]; - } - return Ihb(g, 0, g.length); - } - } - function Fhb(a) { - var b, c2; - if (a >= txe) { - b = uxe + (a - txe >> 10 & 1023) & Bwe; - c2 = 56320 + (a - txe & 1023) & Bwe; - return String.fromCharCode(b) + ("" + String.fromCharCode(c2)); - } else { - return String.fromCharCode(a & Bwe); - } - } - function UMb(a, b) { - RMb(); - var c2, d, e, f2; - e = RD(RD(Qc(a.r, b), 21), 87); - if (e.gc() >= 2) { - d = RD(e.Kc().Pb(), 117); - c2 = a.u.Hc((Pod(), Kod)); - f2 = a.u.Hc(Ood); - return !d.a && !c2 && (e.gc() == 2 || f2); - } else { - return false; - } + flatProp.mapping = prop; + prop = flatProp; + break; + } + case types.fn: { + var fn3 = prop.value; + var fnRetVal = prop.fnValue != null ? prop.fnValue : fn3(ele); + prop.prevFnValue = fnRetVal; + if (fnRetVal == null) { + warn("Custom function mappers may not return null (i.e. `" + prop.name + "` for ele `" + ele.id() + "` is null)"); + return false; } - function v3c(a, b, c2, d, e) { - var f2, g, h; - f2 = w3c(a, b, c2, d, e); - h = false; - while (!f2) { - n3c(a, e, true); - h = true; - f2 = w3c(a, b, c2, d, e); - } - h && n3c(a, e, false); - g = N2c(e); - if (g.c.length != 0) { - !!a.d && a.d.Gg(g); - v3c(a, e, c2, d, g); - } - } - function ind() { - ind = geb; - gnd = new jnd(LAe, 0); - end2 = new jnd("DIRECTED", 1); - hnd = new jnd("UNDIRECTED", 2); - cnd = new jnd("ASSOCIATION", 3); - fnd = new jnd("GENERALIZATION", 4); - dnd = new jnd("DEPENDENCY", 5); - } - function nsd(a, b) { - var c2; - if (!MCd(a)) { - throw Adb(new dgb(sHe)); - } - c2 = MCd(a); - switch (b.g) { - case 1: - return -(a.j + a.f); - case 2: - return a.i - c2.g; - case 3: - return a.j - c2.f; - case 4: - return -(a.i + a.g); - } - return 0; + flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping); + if (!flatProp) { + warn("Custom function mappers may not return invalid values for the property type (i.e. `" + prop.name + "` for ele `" + ele.id() + "` is invalid)"); + return false; } - function Jge(a, b, c2) { - var d, e, f2; - d = b.Lk(); - f2 = b.md(); - e = d.Jk() ? fge(a, 4, d, f2, null, kge(a, d, f2, ZD(d, 102) && (RD(d, 19).Bb & txe) != 0), true) : fge(a, d.tk() ? 2 : 1, d, f2, d.ik(), -1, true); - c2 ? c2.nj(e) : c2 = e; - return c2; - } - function lwb(a, b) { - var c2, d; - uFb(b); - d = a.b.c.length; - Rmb(a.b, b); - while (d > 0) { - c2 = d; - d = (d - 1) / 2 | 0; - if (a.a.Ne(Vmb(a.b, d), b) <= 0) { - $mb(a.b, c2, b); - return true; + flatProp.mapping = copy4(prop); + prop = flatProp; + break; + } + case void 0: + break; + default: + return false; + } + if (propIsBypass) { + if (origPropIsBypass) { + prop.bypassed = origProp.bypassed; + } else { + prop.bypassed = origProp; + } + style3[prop.name] = prop; + } else { + if (origPropIsBypass) { + origProp.bypassed = prop; + } else { + style3[prop.name] = prop; + } + } + checkTriggers(); + return true; + }; + styfn$8.cleanElements = function(eles, keepBypasses) { + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + this.clearStyleHints(ele); + ele.dirtyCompoundBoundsCache(); + ele.dirtyBoundingBoxCache(); + if (!keepBypasses) { + ele._private.style = {}; + } else { + var style3 = ele._private.style; + var propNames = Object.keys(style3); + for (var j2 = 0; j2 < propNames.length; j2++) { + var propName = propNames[j2]; + var eleProp = style3[propName]; + if (eleProp != null) { + if (eleProp.bypass) { + eleProp.bypassed = null; + } else { + style3[propName] = null; } - $mb(a.b, c2, Vmb(a.b, d)); } - $mb(a.b, d, b); - return true; } - function sKb(a, b, c2, d) { - var e, f2; - e = 0; - if (!c2) { - for (f2 = 0; f2 < jKb; f2++) { - e = $wnd.Math.max(e, hKb(a.a[f2][b.g], d)); - } - } else { - e = hKb(a.a[c2.g][b.g], d); - } - b == (ZJb(), XJb) && !!a.b && (e = $wnd.Math.max(e, a.b.a)); - return e; + } + } + }; + styfn$8.update = function() { + var cy = this._private.cy; + var eles = cy.mutableElements(); + eles.updateStyle(); + }; + styfn$8.updateTransitions = function(ele, diffProps) { + var self2 = this; + var _p = ele._private; + var props = ele.pstyle("transition-property").value; + var duration = ele.pstyle("transition-duration").pfValue; + var delay2 = ele.pstyle("transition-delay").pfValue; + if (props.length > 0 && duration > 0) { + var style3 = {}; + var anyPrev = false; + for (var i2 = 0; i2 < props.length; i2++) { + var prop = props[i2]; + var styProp = ele.pstyle(prop); + var diffProp = diffProps[prop]; + if (!diffProp) { + continue; } - function Qqc(a, b) { - var c2, d, e, f2, g, h; - e = a.i; - f2 = b.i; - if (!e || !f2) { - return false; - } - if (e.i != f2.i || e.i == (qpd(), Xod) || e.i == (qpd(), ppd)) { - return false; - } - g = e.g.a; - c2 = g + e.j.a; - h = f2.g.a; - d = h + f2.j.a; - return g <= d && c2 >= h; + var prevProp = diffProp.prev; + var fromProp = prevProp; + var toProp = diffProp.next != null ? diffProp.next : styProp; + var diff2 = false; + var initVal = void 0; + var initDt = 1e-6; + if (!fromProp) { + continue; } - function A8c(a) { - switch (a.g) { - case 0: - return new o8c(); - case 1: - return new u8c(); - default: - throw Adb(new agb("No implementation is available for the width approximator " + (a.f != null ? a.f : "" + a.g))); - } + if (number$1(fromProp.pfValue) && number$1(toProp.pfValue)) { + diff2 = toProp.pfValue - fromProp.pfValue; + initVal = fromProp.pfValue + initDt * diff2; + } else if (number$1(fromProp.value) && number$1(toProp.value)) { + diff2 = toProp.value - fromProp.value; + initVal = fromProp.value + initDt * diff2; + } else if (array2(fromProp.value) && array2(toProp.value)) { + diff2 = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2]; + initVal = fromProp.strValue; } - function rDd(a, b, c2, d) { - var e; - e = false; - if (bE(d)) { - e = true; - sDd(b, c2, WD(d)); - } - if (!e) { - if ($D(d)) { - e = true; - rDd(a, b, c2, d); - } - } - if (!e) { - if (ZD(d, 242)) { - e = true; - qDd(b, c2, RD(d, 242)); - } - } - if (!e) { - throw Adb(new Aeb(tIe)); - } + if (diff2) { + style3[prop] = toProp.strValue; + this.applyBypass(ele, prop, initVal); + anyPrev = true; } - function uee(a, b) { - var c2, d, e; - c2 = b.qi(a.a); - if (c2) { - e = $Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), rKe); - if (e != null) { - for (d = 1; d < (lke(), hke).length; ++d) { - if (lhb(hke[d], e)) { - return d; - } - } - } - } - return 0; + } + if (!anyPrev) { + return; + } + _p.transitioning = true; + new Promise$1(function(resolve3) { + if (delay2 > 0) { + ele.delayAnimation(delay2).play().promise().then(resolve3); + } else { + resolve3(); } - function vee2(a, b) { - var c2, d, e; - c2 = b.qi(a.a); - if (c2) { - e = $Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), rKe); - if (e != null) { - for (d = 1; d < (lke(), ike).length; ++d) { - if (lhb(ike[d], e)) { - return d; - } - } - } + }).then(function() { + return ele.animation({ + style: style3, + duration, + easing: ele.pstyle("transition-timing-function").value, + queue: false + }).play().promise(); + }).then(function() { + self2.removeBypasses(ele, props); + ele.emitAndNotify("style"); + _p.transitioning = false; + }); + } else if (_p.transitioning) { + this.removeBypasses(ele, props); + ele.emitAndNotify("style"); + _p.transitioning = false; + } + }; + styfn$8.checkTrigger = function(ele, name, fromValue, toValue, getTrigger, onTrigger) { + var prop = this.properties[name]; + var triggerCheck = getTrigger(prop); + if (triggerCheck != null && triggerCheck(fromValue, toValue)) { + onTrigger(prop); + } + }; + styfn$8.checkZOrderTrigger = function(ele, name, fromValue, toValue) { + var _this = this; + this.checkTrigger(ele, name, fromValue, toValue, function(prop) { + return prop.triggersZOrder; + }, function() { + _this._private.cy.notify("zorder", ele); + }); + }; + styfn$8.checkBoundsTrigger = function(ele, name, fromValue, toValue) { + this.checkTrigger(ele, name, fromValue, toValue, function(prop) { + return prop.triggersBounds; + }, function(prop) { + ele.dirtyCompoundBoundsCache(); + ele.dirtyBoundingBoxCache(); + if ( + // only for beziers -- so performance of other edges isn't affected + prop.triggersBoundsOfParallelBeziers && name === "curve-style" && (fromValue === "bezier" || toValue === "bezier") + ) { + ele.parallelEdges().forEach(function(pllEdge) { + if (pllEdge.isBundledBezier()) { + pllEdge.dirtyBoundingBoxCache(); } - return 0; - } - function Ve(a, b) { - var c2, d, e, f2; - uFb(b); - f2 = a.a.gc(); - if (f2 < b.gc()) { - for (c2 = a.a.ec().Kc(); c2.Ob(); ) { - d = c2.Pb(); - b.Hc(d) && c2.Qb(); - } - } else { - for (e = b.Kc(); e.Ob(); ) { - d = e.Pb(); - a.a.Bc(d) != null; - } + }); + } + if (prop.triggersBoundsOfConnectedEdges && name === "display" && (fromValue === "none" || toValue === "none")) { + ele.connectedEdges().forEach(function(edge) { + edge.dirtyBoundingBoxCache(); + }); + } + }); + }; + styfn$8.checkTriggers = function(ele, name, fromValue, toValue) { + ele.dirtyStyleCache(); + this.checkZOrderTrigger(ele, name, fromValue, toValue); + this.checkBoundsTrigger(ele, name, fromValue, toValue); + }; + styfn$7 = {}; + styfn$7.applyBypass = function(eles, name, value2, updateTransitions) { + var self2 = this; + var props = []; + var isBypass = true; + if (name === "*" || name === "**") { + if (value2 !== void 0) { + for (var i2 = 0; i2 < self2.properties.length; i2++) { + var prop = self2.properties[i2]; + var _name = prop.name; + var parsedProp = this.parse(_name, value2, true); + if (parsedProp) { + props.push(parsedProp); } - return f2 != a.a.gc(); } - function e_b(a) { - var b, c2; - c2 = ajd(xjd(cD(WC(l3, 1), Nve, 8, 0, [a.i.n, a.n, a.a]))); - b = a.i.d; - switch (a.j.g) { - case 1: - c2.b -= b.d; - break; - case 2: - c2.a += b.c; - break; - case 3: - c2.b += b.a; - break; - case 4: - c2.a -= b.b; - } - return c2; - } - function edc(a) { - var b; - b = (Zcc(), RD(hs(new is(Mr(Z2b(a).a.Kc(), new ir()))), 18).c.i); - while (b.k == (r3b(), o3b)) { - pQb(b, (Ywc(), twc), (Geb(), true)); - b = RD(hs(new is(Mr(Z2b(b).a.Kc(), new ir()))), 18).c.i; - } - } - function BMc(a, b, c2, d) { - var e, f2, g, h; - h = aMc(b, d); - for (g = h.Kc(); g.Ob(); ) { - e = RD(g.Pb(), 12); - a.d[e.p] = a.d[e.p] + a.c[c2.p]; - } - h = aMc(c2, d); - for (f2 = h.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 12); - a.d[e.p] = a.d[e.p] - a.c[b.p]; - } - } - function Isd(a, b, c2) { - var d, e; - for (e = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - Byd(d, d.i + b, d.j + c2); - } - xgb((!a.b && (a.b = new C5d(G4, a, 12, 3)), a.b), new Osd(b, c2)); - } - function $yb(a, b, c2, d) { - var e, f2; - f2 = b; - e = f2.d == null || a.a.Ne(c2.d, f2.d) > 0 ? 1 : 0; - while (f2.a[e] != c2) { - f2 = f2.a[e]; - e = a.a.Ne(c2.d, f2.d) > 0 ? 1 : 0; - } - f2.a[e] = d; - d.b = c2.b; - d.a[0] = c2.a[0]; - d.a[1] = c2.a[1]; - c2.a[0] = null; - c2.a[1] = null; - } - function zIb(a) { - var b, c2, d, e; - b = new bnb(); - c2 = $C(xdb, Hye, 28, a.a.c.length, 16, 1); - Snb(c2, c2.length); - for (e = new Anb(a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 125); - if (!c2[d.d]) { - ZEb(b.c, d); - yIb(a, d, c2); - } - } - return b; - } - function UXb(a, b) { - var c2, d, e, f2, g; - e = b == 1 ? MXb : LXb; - for (d = e.a.ec().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 88); - for (g = RD(Qc(a.f.c, c2), 21).Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 42); - Ymb(a.b.b, f2.b); - Ymb(a.b.a, RD(f2.b, 86).d); - } - } - } - function P9b(a, b) { - var c2; - b.Ug("Hierarchical port position processing", 1); - c2 = a.b; - c2.c.length > 0 && O9b((tFb(0, c2.c.length), RD(c2.c[0], 30)), a); - c2.c.length > 1 && O9b(RD(Vmb(c2, c2.c.length - 1), 30), a); - b.Vg(); - } - function Sod(a) { - Pod(); - var b, c2; - b = ysb(Lod, cD(WC(D3, 1), jwe, 279, 0, [Nod])); - if (dy(Tx(b, a)) > 1) { - return false; - } - c2 = ysb(Kod, cD(WC(D3, 1), jwe, 279, 0, [Jod, Ood])); - if (dy(Tx(c2, a)) > 1) { - return false; - } - return true; + } + } else if (string(name)) { + var _parsedProp = this.parse(name, value2, true); + if (_parsedProp) { + props.push(_parsedProp); + } + } else if (plainObject(name)) { + var specifiedProps = name; + updateTransitions = value2; + var names = Object.keys(specifiedProps); + for (var _i = 0; _i < names.length; _i++) { + var _name2 = names[_i]; + var _value = specifiedProps[_name2]; + if (_value === void 0) { + _value = specifiedProps[dash2camel(_name2)]; } - function FBd(a, b) { - var c2; - c2 = Xjb((YSd(), XSd), a); - ZD(c2, 507) ? $jb(XSd, a, new B5d(this, b)) : $jb(XSd, a, this); - BBd(this, b); - if (b == (jTd(), iTd)) { - this.wb = RD(this, 2038); - RD(b, 2040); - } else { - this.wb = (lTd(), kTd); + if (_value !== void 0) { + var _parsedProp2 = this.parse(_name2, _value, true); + if (_parsedProp2) { + props.push(_parsedProp2); } } - function Lae(b) { - var c2, d, e; - if (b == null) { - return null; - } - c2 = null; - for (d = 0; d < nAd.length; ++d) { - try { - return b2d(nAd[d], b); - } catch (a) { - a = zdb(a); - if (ZD(a, 33)) { - e = a; - c2 = e; - } else - throw Adb(a); - } - } - throw Adb(new RSd(c2)); - } - function Mrb() { - Mrb = geb; - Krb = cD(WC(qJ, 1), Nve, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]); - Lrb = cD(WC(qJ, 1), Nve, 2, 6, ["Jan", "Feb", "Mar", "Apr", Gwe, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]); - } - function qBb(a) { - var b, c2, d; - b = lhb(typeof b, Yxe) ? null : new gFb(); - if (!b) { - return; - } - SAb(); - c2 = (d = 900, d >= Awe ? "error" : d >= 900 ? "warn" : d >= 800 ? "info" : "log"); - eFb(c2, a.a); - !!a.b && fFb(b, c2, a.b, "Exception: ", true); - } - function mQb(a, b) { - var c2, d; - d = (!a.q && (a.q = new Tsb()), Wjb(a.q, b)); - if (d != null) { - return d; - } - c2 = b.Sg(); - ZD(c2, 4) && (c2 == null ? (!a.q && (a.q = new Tsb()), _jb(a.q, b)) : (!a.q && (a.q = new Tsb()), Zjb(a.q, b, c2)), a); - return c2; - } - function sXb() { - sXb = geb; - nXb = new tXb("P1_CYCLE_BREAKING", 0); - oXb = new tXb("P2_LAYERING", 1); - pXb = new tXb("P3_NODE_ORDERING", 2); - qXb = new tXb("P4_NODE_PLACEMENT", 3); - rXb = new tXb("P5_EDGE_ROUTING", 4); - } - function KZb(a, b) { - CZb(); - var c2; - if (a.c == b.c) { - if (a.b == b.b || rZb(a.b, b.b)) { - c2 = oZb(a.b) ? 1 : -1; - if (a.a && !b.a) { - return c2; - } else if (!a.a && b.a) { - return -c2; - } - } - return hgb(a.b.g, b.b.g); - } else { - return Qfb(a.c, b.c); - } - } - function E3c(a, b) { - var c2, d, e; - if (p3c(a, b)) { - return true; - } - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 27); - e = R2c(c2); - if (o3c(a, c2, e)) { - return true; - } - if (C3c(a, c2) - a.g <= a.a) { - return true; - } - } - return false; - } - function ncd() { - ncd = geb; - mcd = (Kcd(), Jcd); - jcd = Fcd; - icd = Dcd; - gcd = zcd; - hcd = Bcd; - fcd = new A3b(8); - ecd = new mGd((umd(), tld), fcd); - kcd = new mGd(fmd, 8); - lcd = Hcd; - bcd = ucd; - ccd = wcd; - dcd = new mGd(Mkd, (Geb(), false)); - } - function hkd() { - hkd = geb; - ekd = new A3b(15); - dkd = new mGd((umd(), tld), ekd); - gkd = new mGd(fmd, 15); - fkd = new mGd(Rld, sgb(0)); - $jd = Wkd; - akd = kld; - ckd = pld; - Xjd = new mGd(Dkd, KGe); - _jd = ald; - bkd = nld; - Yjd = Fkd; - Zjd = Kkd; - } - function JGd(a) { - if ((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c).i != 1) { - throw Adb(new agb(JIe)); - } - return AGd(RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84)); - } - function KGd(a) { - if ((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c).i != 1) { - throw Adb(new agb(JIe)); - } - return BGd(RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84)); - } - function MGd(a) { - if ((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c).i != 1) { - throw Adb(new agb(JIe)); - } - return BGd(RD(QHd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c), 0), 84)); - } - function LGd(a) { - if ((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i != 1 || (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c).i != 1) { - throw Adb(new agb(JIe)); - } - return AGd(RD(QHd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c), 0), 84)); - } - function bJd(a, b, c2) { - var d, e, f2; - ++a.j; - e = a.Ej(); - if (b >= e || b < 0) - throw Adb(new veb(MIe + b + NIe + e)); - if (c2 >= e || c2 < 0) - throw Adb(new veb(OIe + c2 + NIe + e)); - b != c2 ? d = (f2 = a.Cj(c2), a.qj(b, f2), f2) : d = a.xj(c2); - return d; - } - function Lje(a) { - var b, c2, d; - d = a; - if (a) { - b = 0; - for (c2 = a.Eh(); c2; c2 = c2.Eh()) { - if (++b > wxe) { - return Lje(c2); - } - d = c2; - if (c2 == a) { - throw Adb(new dgb("There is a cycle in the containment hierarchy of " + a)); - } - } - } - return d; - } - function Fe(a) { - var b, c2, d; - d = new Jyb(pve, "[", "]"); - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - Gyb(d, dE(b) === dE(a) ? "(this Collection)" : b == null ? vve : jeb(b)); - } - return !d.a ? d.c : d.e.length == 0 ? d.a.a : d.a.a + ("" + d.e); - } - function p3c(a, b) { - var c2, d; - d = false; - if (b.gc() < 2) { - return false; - } - for (c2 = 0; c2 < b.gc(); c2++) { - c2 < b.gc() - 1 ? d = d | o3c(a, RD(b.Xb(c2), 27), RD(b.Xb(c2 + 1), 27)) : d = d | o3c(a, RD(b.Xb(c2), 27), RD(b.Xb(0), 27)); - } - return d; - } - function wAd(a, b) { - var c2; - if (b != a.a) { - c2 = null; - !!a.a && (c2 = RD(a.a, 54).Th(a, 4, t7, c2)); - !!b && (c2 = RD(b, 54).Rh(a, 4, t7, c2)); - c2 = rAd(a, b, c2); - !!c2 && c2.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 1, b, b)); - } - function p2d(a, b) { - var c2; - if (b != a.e) { - !!a.e && oae($9d(a.e), a); - !!b && (!b.b && (b.b = new pae(new lae())), nae(b.b, a)); - c2 = f2d(a, b, null); - !!c2 && c2.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 4, b, b)); - } - function $mc(a, b) { - var c2; - c2 = b.o; - if (Dmd(a.f)) { - a.j.a = $wnd.Math.max(a.j.a, c2.a); - a.j.b += c2.b; - a.d.c.length > 1 && (a.j.b += a.e); - } else { - a.j.a += c2.a; - a.j.b = $wnd.Math.max(a.j.b, c2.b); - a.d.c.length > 1 && (a.j.a += a.e); - } - } - function Mnc() { - Mnc = geb; - Jnc = cD(WC(E3, 1), NAe, 64, 0, [(qpd(), Yod), Xod, npd]); - Inc = cD(WC(E3, 1), NAe, 64, 0, [Xod, npd, ppd]); - Knc = cD(WC(E3, 1), NAe, 64, 0, [npd, ppd, Yod]); - Lnc = cD(WC(E3, 1), NAe, 64, 0, [ppd, Yod, Xod]); - } - function Upc(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - g = a.c.d; - h = a.d.d; - if (g.j == h.j) { - return; - } - k = a.b; - e = g.j; - i2 = null; - while (e != h.j) { - i2 = b == 0 ? tpd(e) : rpd(e); - f2 = $pc(e, k.d[e.g], c2); - j = $pc(i2, k.d[i2.g], c2); - Mub(d, $id(f2, j)); - e = i2; - } - } - function OJc(a, b, c2, d) { - var e, f2, g, h, i2; - g = hMc(a.a, b, c2); - h = RD(g.a, 17).a; - f2 = RD(g.b, 17).a; - if (d) { - i2 = RD(mQb(b, (Ywc(), Iwc)), 10); - e = RD(mQb(c2, Iwc), 10); - if (!!i2 && !!e) { - Slc(a.b, i2, e); - h += a.b.i; - f2 += a.b.e; - } - } - return h > f2; - } - function OLc(a) { - var b, c2, d, e, f2, g, h, i2, j; - this.a = LLc(a); - this.b = new bnb(); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - f2 = new bnb(); - Rmb(this.b, f2); - for (h = b, i2 = 0, j = h.length; i2 < j; ++i2) { - g = h[i2]; - Rmb(f2, new dnb(g.j)); - } - } - } - function QLc(a, b, c2) { - var d, e, f2; - f2 = 0; - d = c2[b]; - if (b < c2.length - 1) { - e = c2[b + 1]; - if (a.b[b]) { - f2 = iNc(a.d, d, e); - f2 += lMc(a.a, d, (qpd(), Xod)); - f2 += lMc(a.a, e, ppd); - } else { - f2 = gMc(a.a, d, e); - } - } - a.c[b] && (f2 += nMc(a.a, d)); - return f2; - } - function r0b(a, b, c2, d, e) { - var f2, g, h, i2; - i2 = null; - for (h = new Anb(d); h.a < h.c.c.length; ) { - g = RD(ynb(h), 453); - if (g != c2 && Wmb(g.e, e, 0) != -1) { - i2 = g; - break; - } - } - f2 = s0b(e); - Y0b(f2, c2.b); - Z0b(f2, i2.b); - Rc(a.a, e, new J0b(f2, b, c2.f)); - } - function h2b(a) { - var b, c2, d, e; - if (Emd(RD(mQb(a.b, (yCc(), rAc)), 88))) { - return 0; - } - b = 0; - for (d = new Anb(a.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - if (c2.k == (r3b(), p3b)) { - e = c2.o.a; - b = $wnd.Math.max(b, e); - } - } - return b; - } - function Tlc(a) { - while (a.g.c != 0 && a.d.c != 0) { - if (amc(a.g).c > amc(a.d).c) { - a.i += a.g.c; - cmc(a.d); - } else if (amc(a.d).c > amc(a.g).c) { - a.e += a.d.c; - cmc(a.g); - } else { - a.i += _lc(a.g); - a.e += _lc(a.d); - cmc(a.g); - cmc(a.d); - } - } - } - function vTc(a, b, c2) { - var d, e, f2, g; - f2 = b.q; - g = b.r; - new bTc((fTc(), dTc), b, f2, 1); - new bTc(dTc, f2, g, 1); - for (e = new Anb(c2); e.a < e.c.c.length; ) { - d = RD(ynb(e), 118); - if (d != f2 && d != b && d != g) { - PTc(a.a, d, b); - PTc(a.a, d, g); - } - } - } - function vVc(a, b, c2, d) { - a.a.d = $wnd.Math.min(b, c2); - a.a.a = $wnd.Math.max(b, d) - a.a.d; - if (b < c2) { - a.b = 0.5 * (b + c2); - a.g = CEe * a.b + 0.9 * b; - a.f = CEe * a.b + 0.9 * c2; - } else { - a.b = 0.5 * (b + d); - a.g = CEe * a.b + 0.9 * d; - a.f = CEe * a.b + 0.9 * b; - } - } - function zZc(a) { - var b, c2, d, e; - if (a.b != 0) { - b = new Yub(); - for (e = Sub(a, 0); e.b != e.d.c; ) { - d = RD(evb(e), 40); - ye(b, $Wc(d)); - c2 = d.e; - c2.a = RD(mQb(d, (q$c(), o$c)), 17).a; - c2.b = RD(mQb(d, p$c), 17).a; - } - return b; - } - return new Yub(); - } - function t8b(a) { - switch (RD(mQb(a, (yCc(), UAc)), 171).g) { - case 1: - pQb(a, UAc, (cxc(), _wc)); - break; - case 2: - pQb(a, UAc, (cxc(), axc)); - break; - case 3: - pQb(a, UAc, (cxc(), Zwc)); - break; - case 4: - pQb(a, UAc, (cxc(), $wc)); - } - } - function Whc(a, b, c2) { - var d; - c2.Ug("Self-Loop routing", 1); - d = Xhc(b); - fE(mQb(b, (rid(), qid))); - FDb(GDb(CDb(CDb(EDb(new SDb(null, new Swb(b.b, 16)), new $hc()), new aic()), new cic()), new eic()), new gic(a, d)); - c2.Vg(); - } - function $uc() { - $uc = geb; - Yuc = new _uc(LAe, 0); - Vuc = new _uc(Nye, 1); - Zuc = new _uc(Oye, 2); - Xuc = new _uc("LEFT_RIGHT_CONSTRAINT_LOCKING", 3); - Wuc = new _uc("LEFT_RIGHT_CONNECTION_LOCKING", 4); - Uuc = new _uc(EBe, 5); - } - function tWc(a, b, c2) { - var d, e, f2, g, h, i2, j; - h = c2.a / 2; - f2 = c2.b / 2; - d = $wnd.Math.abs(b.a - a.a); - e = $wnd.Math.abs(b.b - a.b); - i2 = 1; - j = 1; - d > h && (i2 = h / d); - e > f2 && (j = f2 / e); - g = $wnd.Math.min(i2, j); - a.a += g * (b.a - a.a); - a.b += g * (b.b - a.b); - } - function I8c(a, b, c2, d, e) { - var f2, g; - g = false; - f2 = RD(Vmb(c2.b, 0), 27); - while (V8c(a, b, f2, d, e)) { - g = true; - T9c(c2, f2); - if (c2.b.c.length == 0) { - break; - } - f2 = RD(Vmb(c2.b, 0), 27); - } - c2.b.c.length == 0 && Fad(c2.j, c2); - g && gad(b.q); - return g; - } - function Eid(a, b) { - tid(); - var c2, d, e, f2; - if (b.b < 2) { - return false; - } - f2 = Sub(b, 0); - c2 = RD(evb(f2), 8); - d = c2; - while (f2.b != f2.d.c) { - e = RD(evb(f2), 8); - if (Did(a, d, e)) { - return true; - } - d = e; - } - if (Did(a, d, c2)) { - return true; - } - return false; - } - function Bxd(a, b, c2, d) { - var e, f2; - if (c2 == 0) { - return !a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), BVd(a.o, b, d); - } - return f2 = RD(vYd((e = RD(Ywd(a, 16), 29), !e ? a.ii() : e), c2), 69), f2.wk().Ak(a, Wwd(a), c2 - AYd(a.ii()), b, d); - } - function BBd(a, b) { - var c2; - if (b != a.sb) { - c2 = null; - !!a.sb && (c2 = RD(a.sb, 54).Th(a, 1, n7, c2)); - !!b && (c2 = RD(b, 54).Rh(a, 1, n7, c2)); - c2 = hBd(a, b, c2); - !!c2 && c2.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 4, b, b)); - } - function YDd(a, b) { - var c2, d, e, f2; - if (b) { - e = vDd(b, "x"); - c2 = new ZEd(a); - Hzd(c2.a, (uFb(e), e)); - f2 = vDd(b, "y"); - d = new $Ed(a); - Izd(d.a, (uFb(f2), f2)); - } else { - throw Adb(new CDd("All edge sections need an end point.")); - } - } - function WDd(a, b) { - var c2, d, e, f2; - if (b) { - e = vDd(b, "x"); - c2 = new WEd(a); - Ozd(c2.a, (uFb(e), e)); - f2 = vDd(b, "y"); - d = new XEd(a); - Pzd(d.a, (uFb(f2), f2)); - } else { - throw Adb(new CDd("All edge sections need a start point.")); - } - } - function hBb(a, b) { - var c2, d, e, f2, g, h, i2; - for (d = kBb(a), f2 = 0, h = d.length; f2 < h; ++f2) { - qBb(b); - } - i2 = !dBb && a.e ? dBb ? null : a.d : null; - while (i2) { - for (c2 = kBb(i2), e = 0, g = c2.length; e < g; ++e) { - qBb(b); - } - i2 = !dBb && i2.e ? dBb ? null : i2.d : null; - } - } - function aXb(a, b) { - var c2, d; - d = RD(mQb(b, (yCc(), BBc)), 101); - pQb(b, (Ywc(), Fwc), d); - c2 = b.e; - !!c2 && (FDb(new SDb(null, new Swb(c2.a, 16)), new fXb(a)), FDb(EDb(new SDb(null, new Swb(c2.b, 16)), new hXb()), new jXb(a))); - } - function r3b() { - r3b = geb; - p3b = new s3b("NORMAL", 0); - o3b = new s3b("LONG_EDGE", 1); - m3b = new s3b("EXTERNAL_PORT", 2); - q3b = new s3b("NORTH_SOUTH_PORT", 3); - n3b = new s3b("LABEL", 4); - l3b = new s3b("BREAKING_POINT", 5); - } - function x7b(a) { - var b, c2, d, e; - b = false; - if (nQb(a, (Ywc(), cwc))) { - c2 = RD(mQb(a, cwc), 85); - for (e = new Anb(a.j); e.a < e.c.c.length; ) { - d = RD(ynb(e), 12); - if (v7b(d)) { - if (!b) { - u7b(Y2b(a)); - b = true; - } - y7b(RD(c2.xc(d), 314)); - } - } - } - } - function GFd(a) { - var b, c2, d, e, f2, g, h, i2, j; - j = HFd(a); - c2 = a.e; - f2 = c2 != null; - f2 && sDd(j, FIe, a.e); - h = a.k; - g = !!h; - g && sDd(j, "type", ps(a.k)); - d = cve(a.j); - e = !d; - if (e) { - i2 = new MB(); - sC(j, lIe, i2); - b = new SFd(i2); - xgb(a.j, b); - } - return j; - } - function Zv(a) { - var b, c2, d, e; - e = Thb((dk(a.gc(), "size"), new cib()), 123); - d = true; - for (c2 = gn(a).Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 44); - d || (e.a += pve, e); - d = false; - Yhb(Thb(Yhb(e, b.ld()), 61), b.md()); - } - return (e.a += "}", e).a; - } - function AD(a, b) { - var c2, d, e; - b &= 63; - if (b < 22) { - c2 = a.l << b; - d = a.m << b | a.l >> 22 - b; - e = a.h << b | a.m >> 22 - b; - } else if (b < 44) { - c2 = 0; - d = a.l << b - 22; - e = a.m << b - 22 | a.l >> 44 - b; - } else { - c2 = 0; - d = 0; - e = a.l << b - 44; - } - return hD(c2 & dxe, d & dxe, e & exe); - } - function Neb(a) { - Meb == null && (Meb = new RegExp("^\\s*[+-]?(NaN|Infinity|((\\d+\\.?\\d*)|(\\.\\d+))([eE][+-]?\\d+)?[dDfF]?)\\s*$")); - if (!Meb.test(a)) { - throw Adb(new Vgb(nxe + a + '"')); - } - return parseFloat(a); - } - function PXb(a, b) { - var c2, d, e, f2, g; - e = b == 1 ? MXb : LXb; - for (d = e.a.ec().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 88); - for (g = RD(Qc(a.f.c, c2), 21).Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 42); - Rmb(a.b.b, RD(f2.b, 86)); - Rmb(a.b.a, RD(f2.b, 86).d); - } - } - } - function rqc(a, b) { - var c2, d, e, f2; - f2 = b.b.j; - a.a = $C(kE, Pwe, 28, f2.c.length, 15, 1); - e = 0; - for (d = 0; d < f2.c.length; d++) { - c2 = (tFb(d, f2.c.length), RD(f2.c[d], 12)); - c2.e.c.length == 0 && c2.g.c.length == 0 ? e += 1 : e += 3; - a.a[d] = e; - } - } - function tuc() { - tuc = geb; - ouc = new vuc("ALWAYS_UP", 0); - nuc = new vuc("ALWAYS_DOWN", 1); - quc = new vuc("DIRECTION_UP", 2); - puc = new vuc("DIRECTION_DOWN", 3); - suc = new vuc("SMART_UP", 4); - ruc = new vuc("SMART_DOWN", 5); - } - function vid(a, b) { - if (a < 0 || b < 0) { - throw Adb(new agb("k and n must be positive")); - } else if (b > a) { - throw Adb(new agb("k must be smaller than n")); - } else - return b == 0 || b == a ? 1 : a == 0 ? 0 : Bid(a) / (Bid(b) * Bid(a - b)); - } - function msd(a, b) { - var c2, d, e, f2; - c2 = new zId(a); - while (c2.g == null && !c2.c ? sId(c2) : c2.g == null || c2.i != 0 && RD(c2.g[c2.i - 1], 51).Ob()) { - f2 = RD(tId(c2), 58); - if (ZD(f2, 167)) { - d = RD(f2, 167); - for (e = 0; e < b.length; e++) { - b[e].Kg(d); - } - } - } - } - function Fyd(a) { - var b; - if ((a.Db & 64) != 0) - return kyd(a); - b = new Shb(kyd(a)); - b.a += " (height: "; - Khb(b, a.f); - b.a += ", width: "; - Khb(b, a.g); - b.a += ", x: "; - Khb(b, a.i); - b.a += ", y: "; - Khb(b, a.j); - b.a += ")"; - return b.a; - } - function Gn(a) { - var b, c2, d, e, f2, g, h; - b = new gub(); - for (d = a, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - g = Qb(c2.ld()); - h = dub(b, g, Qb(c2.md())); - if (h != null) { - throw Adb(new agb("duplicate key: " + g)); - } - } - this.b = (yob(), new uqb(b)); - } - function bob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - Gyb(f2, String.fromCharCode(b)); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function OUb() { - OUb = geb; - IUb = (TUb(), SUb); - HUb = new lGd(Rze, IUb); - sgb(1); - GUb = new lGd(Sze, sgb(300)); - sgb(0); - LUb = new lGd(Tze, sgb(0)); - MUb = new lGd(Uze, Vze); - JUb = new lGd(Wze, 5); - NUb = SUb; - KUb = RUb; - } - function K6d(a, b) { - var c2; - if (b != null && !a.c.Hk().fk(b)) { - c2 = ZD(b, 58) ? RD(b, 58).Dh().zb : nfb(rb(b)); - throw Adb(new Ifb(KHe + a.c.xe() + "'s type '" + a.c.Hk().xe() + "' does not permit a value of type '" + c2 + "'")); - } - } - function k0b(a, b, c2) { - var d, e; - e = new Jkb(a.b, 0); - while (e.b < e.d.gc()) { - d = (sFb(e.b < e.d.gc()), RD(e.d.Xb(e.c = e.b++), 72)); - if (dE(mQb(d, (Ywc(), Dwc))) !== dE(b)) { - continue; - } - e2b(d.n, Y2b(a.c.i), c2); - Ckb(e); - Rmb(b.b, d); - } - } - function Arc(a) { - var b, c2; - c2 = $wnd.Math.sqrt((a.k == null && (a.k = tsc(a, new Esc())), Kfb(a.k) / (a.b * (a.g == null && (a.g = qsc(a, new Csc())), Kfb(a.g))))); - b = Ydb(Hdb($wnd.Math.round(c2))); - b = $wnd.Math.min(b, a.f); - return b; - } - function sse() { - var a, b, c2; - b = 0; - for (a = 0; a < "X".length; a++) { - c2 = rse((BFb(a, "X".length), "X".charCodeAt(a))); - if (c2 == 0) - throw Adb(new Lqe((BFb(a, "X".length + 1), "Unknown Option: " + "X".substr(a)))); - b |= c2; - } - return b; - } - function R3b() { - J3b(); - v2b.call(this); - this.j = (qpd(), opd); - this.a = new pjd(); - new T2b(); - this.f = (dk(2, iwe), new cnb(2)); - this.e = (dk(4, iwe), new cnb(4)); - this.g = (dk(4, iwe), new cnb(4)); - this.b = new h4b(this.e, this.g); - } - function A6b(a, b) { - var c2, d; - if (Heb(TD(mQb(b, (Ywc(), Nwc))))) { - return false; - } - d = b.c.i; - if (a == (cxc(), Zwc)) { - if (d.k == (r3b(), n3b)) { - return false; - } - } - c2 = RD(mQb(d, (yCc(), UAc)), 171); - if (c2 == $wc) { - return false; - } - return true; + } + } else { + return false; + } + if (props.length === 0) { + return false; + } + var ret = false; + for (var _i2 = 0; _i2 < eles.length; _i2++) { + var ele = eles[_i2]; + var diffProps = {}; + var diffProp = void 0; + for (var j2 = 0; j2 < props.length; j2++) { + var _prop = props[j2]; + if (updateTransitions) { + var prevProp = ele.pstyle(_prop.name); + diffProp = diffProps[_prop.name] = { + prev: prevProp + }; } - function B6b(a, b) { - var c2, d; - if (Heb(TD(mQb(b, (Ywc(), Nwc))))) { - return false; - } - d = b.d.i; - if (a == (cxc(), _wc)) { - if (d.k == (r3b(), n3b)) { - return false; - } - } - c2 = RD(mQb(d, (yCc(), UAc)), 171); - if (c2 == axc) { - return false; - } - return true; + ret = this.applyParsedProperty(ele, copy4(_prop)) || ret; + if (updateTransitions) { + diffProp.next = ele.pstyle(_prop.name); } - function a7b(a, b) { - var c2, d, e, f2, g, h, i2; - g = a.d; - i2 = a.o; - h = new Uid2(-g.b, -g.d, g.b + i2.a + g.c, g.d + i2.b + g.a); - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - !!c2 && Sid(h, c2.i); - } - g.b = -h.c; - g.d = -h.d; - g.c = h.b - g.b - i2.a; - g.a = h.a - g.d - i2.b; - } - function _gc(a, b) { - if (b.a) { - switch (RD(mQb(b.b, (Ywc(), Fwc)), 101).g) { - case 0: - case 1: - Roc(b); - case 2: - FDb(new SDb(null, new Swb(b.d, 16)), new mhc()); - aoc(a.a, b); - } - } else { - FDb(new SDb(null, new Swb(b.d, 16)), new mhc()); - } + } + if (ret) { + this.updateStyleHints(ele); + } + if (updateTransitions) { + this.updateTransitions(ele, diffProps, isBypass); + } + } + return ret; + }; + styfn$7.overrideBypass = function(eles, name, value2) { + name = camel2dash(name); + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + var prop = ele._private.style[name]; + var type3 = this.properties[name].type; + var isColor = type3.color; + var isMulti = type3.mutiple; + var oldValue = !prop ? null : prop.pfValue != null ? prop.pfValue : prop.value; + if (!prop || !prop.bypass) { + this.applyBypass(ele, name, value2); + } else { + prop.value = value2; + if (prop.pfValue != null) { + prop.pfValue = value2; } - function Xbd() { - Xbd = geb; - Sbd = new Ybd("CENTER_DISTANCE", 0); - Tbd = new Ybd("CIRCLE_UNDERLAP", 1); - Wbd = new Ybd("RECTANGLE_UNDERLAP", 2); - Ubd = new Ybd("INVERTED_OVERLAP", 3); - Vbd = new Ybd("MINIMUM_ROOT_DISTANCE", 4); + if (isColor) { + prop.strValue = "rgb(" + value2.join(",") + ")"; + } else if (isMulti) { + prop.strValue = value2.join(" "); + } else { + prop.strValue = "" + value2; } - function Iqe(a) { - Gqe(); - var b, c2, d, e, f2; - if (a == null) - return null; - d = a.length; - e = d * 2; - b = $C(hE, zwe, 28, e, 15, 1); - for (c2 = 0; c2 < d; c2++) { - f2 = a[c2]; - f2 < 0 && (f2 += 256); - b[c2 * 2] = Fqe[f2 >> 4]; - b[c2 * 2 + 1] = Fqe[f2 & 15]; - } - return Ihb(b, 0, b.length); - } - function sn(a) { - fn(); - var b, c2, d; - d = a.c.length; - switch (d) { - case 0: - return en; - case 1: - b = RD(Ir(new Anb(a)), 44); - return xn(b.ld(), b.md()); - default: - c2 = RD(anb(a, $C(UK, Zve, 44, a.c.length, 0, 1)), 173); - return new Mx(c2); - } - } - function KWb(a) { - var b, c2, d, e, f2, g; - b = new wmb(); - c2 = new wmb(); - hmb(b, a); - hmb(c2, a); - while (c2.b != c2.c) { - e = RD(smb(c2), 36); - for (g = new Anb(e.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - if (f2.e) { - d = f2.e; - hmb(b, d); - hmb(c2, d); - } - } - } - return b; + this.updateStyleHints(ele); + } + this.checkTriggers(ele, name, oldValue, value2); + } + }; + styfn$7.removeAllBypasses = function(eles, updateTransitions) { + return this.removeBypasses(eles, this.propertyNames, updateTransitions); + }; + styfn$7.removeBypasses = function(eles, props, updateTransitions) { + var isBypass = true; + for (var j2 = 0; j2 < eles.length; j2++) { + var ele = eles[j2]; + var diffProps = {}; + for (var i2 = 0; i2 < props.length; i2++) { + var name = props[i2]; + var prop = this.properties[name]; + var prevProp = ele.pstyle(prop.name); + if (!prevProp || !prevProp.bypass) { + continue; } - function e3b(a, b) { - switch (b.g) { - case 1: - return dr(a.j, (J3b(), F3b)); - case 2: - return dr(a.j, (J3b(), D3b)); - case 3: - return dr(a.j, (J3b(), H3b)); - case 4: - return dr(a.j, (J3b(), I3b)); - default: - return yob(), yob(), vob; - } + var value2 = ""; + var parsedProp = this.parse(name, value2, true); + var diffProp = diffProps[prop.name] = { + prev: prevProp + }; + this.applyParsedProperty(ele, parsedProp); + diffProp.next = ele.pstyle(prop.name); + } + this.updateStyleHints(ele); + if (updateTransitions) { + this.updateTransitions(ele, diffProps, isBypass); + } + } + }; + styfn$6 = {}; + styfn$6.getEmSizeInPixels = function() { + var px = this.containerCss("font-size"); + if (px != null) { + return parseFloat(px); + } else { + return 1; + } + }; + styfn$6.containerCss = function(propName) { + var cy = this._private.cy; + var domElement3 = cy.container(); + var containerWindow = cy.window(); + if (containerWindow && domElement3 && containerWindow.getComputedStyle) { + return containerWindow.getComputedStyle(domElement3).getPropertyValue(propName); + } + }; + styfn$5 = {}; + styfn$5.getRenderedStyle = function(ele, prop) { + if (prop) { + return this.getStylePropertyValue(ele, prop, true); + } else { + return this.getRawStyle(ele, true); + } + }; + styfn$5.getRawStyle = function(ele, isRenderedVal) { + var self2 = this; + ele = ele[0]; + if (ele) { + var rstyle = {}; + for (var i2 = 0; i2 < self2.properties.length; i2++) { + var prop = self2.properties[i2]; + var val = self2.getStylePropertyValue(ele, prop.name, isRenderedVal); + if (val != null) { + rstyle[prop.name] = val; + rstyle[dash2camel(prop.name)] = val; } - function Zlc(a, b) { - var c2, d, e; - c2 = $lc(b, a.e); - d = RD(Wjb(a.g.f, c2), 17).a; - e = a.a.c.length - 1; - if (a.a.c.length != 0 && RD(Vmb(a.a, e), 294).c == d) { - ++RD(Vmb(a.a, e), 294).a; - ++RD(Vmb(a.a, e), 294).b; - } else { - Rmb(a.a, new hmc(d)); - } - } - function tLc(a, b, c2) { - var d, e; - d = sLc(a, b, c2); - if (d != 0) { - return d; - } - if (nQb(b, (Ywc(), zwc)) && nQb(c2, zwc)) { - e = hgb(RD(mQb(b, zwc), 17).a, RD(mQb(c2, zwc), 17).a); - e < 0 ? uLc(a, b, c2) : e > 0 && uLc(a, c2, b); - return e; - } - return rLc(a, b, c2); - } - function $4c() { - $4c = geb; - R4c = (umd(), Qld); - Y4c = fmd; - K4c = kld; - L4c = nld; - M4c = pld; - J4c = ild; - N4c = sld; - Q4c = Lld; - H4c = (D4c(), o4c); - I4c = p4c; - T4c = v4c; - W4c = y4c; - U4c = w4c; - V4c = x4c; - O4c = r4c; - P4c = t4c; - S4c = u4c; - X4c = z4c; - Z4c = B4c; - G4c = n4c; - } - function P9c(a, b) { - var c2, d, e, f2, g; - if (a.e <= b) { - return a.g; - } - if (R9c(a, a.g, b)) { - return a.g; - } - f2 = a.r; - d = a.g; - g = a.r; - e = (f2 - d) / 2 + d; - while (d + 1 < f2) { - c2 = S9c(a, e, false); - if (c2.b <= e && c2.a <= b) { - g = e; - f2 = e; + } + return rstyle; + } + }; + styfn$5.getIndexedStyle = function(ele, property2, subproperty, index) { + var pstyle = ele.pstyle(property2)[subproperty][index]; + return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property2)[subproperty][0]; + }; + styfn$5.getStylePropertyValue = function(ele, propName, isRenderedVal) { + var self2 = this; + ele = ele[0]; + if (ele) { + var prop = self2.properties[propName]; + if (prop.alias) { + prop = prop.pointsTo; + } + var type3 = prop.type; + var styleProp = ele.pstyle(prop.name); + if (styleProp) { + var value2 = styleProp.value, units = styleProp.units, strValue = styleProp.strValue; + if (isRenderedVal && type3.number && value2 != null && number$1(value2)) { + var zoom2 = ele.cy().zoom(); + var getRenderedValue = /* @__PURE__ */ __name(function getRenderedValue2(val) { + return val * zoom2; + }, "getRenderedValue"); + var getValueStringWithUnits = /* @__PURE__ */ __name(function getValueStringWithUnits2(val, units2) { + return getRenderedValue(val) + units2; + }, "getValueStringWithUnits"); + var isArrayValue = array2(value2); + var haveUnits = isArrayValue ? units.every(function(u2) { + return u2 != null; + }) : units != null; + if (haveUnits) { + if (isArrayValue) { + return value2.map(function(v3, i2) { + return getValueStringWithUnits(v3, units[i2]); + }).join(" "); } else { - d = e; - } - e = (f2 - d) / 2 + d; - } - return g; - } - function Eed(a, b, c2) { - var d; - d = zed(a, b, true); - Fqd(c2, "Recursive Graph Layout", d); - msd(b, cD(WC(j4, 1), rve, 536, 0, [new Bfd()])); - Hxd(b, (umd(), Tld)) || msd(b, cD(WC(j4, 1), rve, 536, 0, [new dgd()])); - Fed(a, b, null, c2); - Hqd(c2); - } - function Hqd(a) { - var b; - if (a.p == null) { - throw Adb(new dgb("The task has not begun yet.")); - } - if (!a.b) { - if (a.k) { - b = (gib(), Ndb(Hdb(Date.now()), Awe)); - a.q = Xdb(Vdb(b, a.o)) * 1e-9; - } - a.c < a.r && Iqd(a, a.r - a.c); - a.b = true; - } - } - function ssd(a) { - var b, c2, d; - d = new Ejd(); - Mub(d, new rjd(a.j, a.k)); - for (c2 = new dMd((!a.a && (a.a = new XZd(D4, a, 5)), a.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 377); - Mub(d, new rjd(b.a, b.b)); - } - Mub(d, new rjd(a.b, a.c)); - return d; - } - function QDd(a, b, c2, d, e) { - var f2, g, h, i2, j, k; - if (e) { - i2 = e.a.length; - f2 = new vue(i2); - for (k = (f2.b - f2.a) * f2.c < 0 ? (uue(), tue) : new Rue(f2); k.Ob(); ) { - j = RD(k.Pb(), 17); - h = xDd(e, j.a); - g = new PEd(a, b, c2, d); - RDd(g.a, g.b, g.c, g.d, h); - } - } - } - function Rx(b, c2) { - var d; - if (dE(b) === dE(c2)) { - return true; - } - if (ZD(c2, 21)) { - d = RD(c2, 21); - try { - return b.gc() == d.gc() && b.Ic(d); - } catch (a) { - a = zdb(a); - if (ZD(a, 169) || ZD(a, 212)) { - return false; - } else - throw Adb(a); - } - } - return false; - } - function Kzb(a, b, c2, d, e, f2) { - this.c = a; - switch (b.g) { - case 2: - if (a.a.Ne(e, c2) < 0) { - throw Adb(new agb(Sxe + e + Txe + c2)); - } - break; - case 1: - a.a.Ne(e, e); - break; - case 3: - a.a.Ne(c2, c2); - } - this.f = b; - this.b = c2; - this.a = d; - this.e = e; - this.d = f2; - } - function LKb(a, b) { - var c2; - Rmb(a.d, b); - c2 = b.Mf(); - if (a.c) { - a.e.a = $wnd.Math.max(a.e.a, c2.a); - a.e.b += c2.b; - a.d.c.length > 1 && (a.e.b += a.a); - } else { - a.e.a += c2.a; - a.e.b = $wnd.Math.max(a.e.b, c2.b); - a.d.c.length > 1 && (a.e.a += a.a); - } - } - function Ipc(a) { - var b, c2, d, e; - e = a.i; - b = e.b; - d = e.j; - c2 = e.g; - switch (e.a.g) { - case 0: - c2.a = (a.g.b.o.a - d.a) / 2; - break; - case 1: - c2.a = b.d.n.a + b.d.a.a; - break; - case 2: - c2.a = b.d.n.a + b.d.a.a - d.a; - break; - case 3: - c2.b = b.d.n.b + b.d.a.b; - } - } - function oOc(a, b, c2) { - var d, e, f2; - for (e = new is(Mr(W2b(c2).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - if (!(!W0b(d) && !(!W0b(d) && d.c.i.c == d.d.i.c))) { - continue; - } - f2 = gOc(a, d, c2, new VOc()); - f2.c.length > 1 && (ZEb(b.c, f2), true); - } - } - function _id(a, b, c2, d, e) { - if (d < b || e < c2) { - throw Adb(new agb("The highx must be bigger then lowx and the highy must be bigger then lowy")); - } - a.a < b ? a.a = b : a.a > d && (a.a = d); - a.b < c2 ? a.b = c2 : a.b > e && (a.b = e); - return a; - } - function LFd(a) { - if (ZD(a, 143)) { - return EFd(RD(a, 143)); - } else if (ZD(a, 233)) { - return FFd(RD(a, 233)); - } else if (ZD(a, 23)) { - return GFd(RD(a, 23)); - } else { - throw Adb(new agb(wIe + Fe(new mob(cD(WC(jJ, 1), rve, 1, 5, [a]))))); - } - } - function ujb(a, b, c2, d, e) { - var f2, g, h; - f2 = true; - for (g = 0; g < d; g++) { - f2 = f2 & c2[g] == 0; - } - if (e == 0) { - hib(c2, d, a, 0, b); - g = b; - } else { - h = 32 - e; - f2 = f2 & c2[g] << h == 0; - for (g = 0; g < b - 1; g++) { - a[g] = c2[g + d] >>> e | c2[g + d + 1] << h; - } - a[g] = c2[g + d] >>> e; - ++g; - } - return f2; - } - function ZQc(a, b, c2, d) { - var e, f2, g; - if (b.k == (r3b(), o3b)) { - for (f2 = new is(Mr(Z2b(b).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - g = e.c.i.k; - if (g == o3b && a.c.a[e.c.i.c.p] == d && a.c.a[b.c.p] == c2) { - return true; - } - } - } - return false; - } - function CD(a, b) { - var c2, d, e, f2; - b &= 63; - c2 = a.h & exe; - if (b < 22) { - f2 = c2 >>> b; - e = a.m >> b | c2 << 22 - b; - d = a.l >> b | a.m << 22 - b; - } else if (b < 44) { - f2 = 0; - e = c2 >>> b - 22; - d = a.m >> b - 22 | a.h << 44 - b; - } else { - f2 = 0; - e = 0; - d = c2 >>> b - 44; - } - return hD(d & dxe, e & dxe, f2 & exe); - } - function mmc(a, b, c2, d) { - var e; - this.b = d; - this.e = a == (RKc(), PKc); - e = b[c2]; - this.d = YC(xdb, [Nve, Hye], [183, 28], 16, [e.length, e.length], 2); - this.a = YC(kE, [Nve, Pwe], [53, 28], 15, [e.length, e.length], 2); - this.c = new Ylc(b, c2); - } - function Rmc(a) { - var b, c2, d; - a.k = new Si((qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd])).length, a.j.c.length); - for (d = new Anb(a.j); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 113); - b = c2.d.j; - Rc(a.k, b, c2); - } - a.e = Dnc(Ec(a.k)); - } - function sVc(a, b) { - var c2, d, e; - Ysb(a.d, b); - c2 = new zVc(); - Zjb(a.c, b, c2); - c2.f = tVc(b.c); - c2.a = tVc(b.d); - c2.d = (HUc(), e = b.c.i.k, e == (r3b(), p3b) || e == l3b); - c2.e = (d = b.d.i.k, d == p3b || d == l3b); - c2.b = b.c.j == (qpd(), ppd); - c2.c = b.d.j == Xod; - } - function sJb(a) { - var b, c2, d, e, f2; - f2 = lve; - e = lve; - for (d = new Anb(CIb(a)); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 218); - b = c2.e.e - c2.d.e; - c2.e == a && b < e ? e = b : b < f2 && (f2 = b); - } - e == lve && (e = -1); - f2 == lve && (f2 = -1); - return new Ptd(sgb(e), sgb(f2)); - } - function qTb(a, b) { - var c2, d, e; - e = Hze; - d = (IRb(), FRb); - e = $wnd.Math.abs(a.b); - c2 = $wnd.Math.abs(b.f - a.b); - if (c2 < e) { - e = c2; - d = GRb; - } - c2 = $wnd.Math.abs(a.a); - if (c2 < e) { - e = c2; - d = HRb; - } - c2 = $wnd.Math.abs(b.g - a.a); - if (c2 < e) { - e = c2; - d = ERb; - } - return d; - } - function adc(a, b) { - var c2, d, e, f2; - c2 = b.a.o.a; - f2 = new Rkb(Y2b(b.a).b, b.c, b.f + 1); - for (e = new Dkb(f2); e.b < e.d.gc(); ) { - d = (sFb(e.b < e.d.gc()), RD(e.d.Xb(e.c = e.b++), 30)); - if (d.c.a >= c2) { - _cc(a, b, d.p); - return true; - } - } - return false; - } - function EA(a, b, c2, d) { - var e, f2, g, h, i2, j; - g = c2.length; - f2 = 0; - e = -1; - j = Bhb((BFb(b, a.length + 1), a.substr(b)), (wvb(), uvb)); - for (h = 0; h < g; ++h) { - i2 = c2[h].length; - if (i2 > f2 && whb(j, Bhb(c2[h], uvb))) { - e = h; - f2 = i2; - } - } - e >= 0 && (d[0] = b + f2); - return e; - } - function gCd(a) { - var b; - if ((a.Db & 64) != 0) - return Fyd(a); - b = new dib(FHe); - !a.a || Zhb(Zhb((b.a += ' "', b), a.a), '"'); - Zhb(Uhb(Zhb(Uhb(Zhb(Uhb(Zhb(Uhb((b.a += " (", b), a.i), ","), a.j), " | "), a.g), ","), a.f), ")"); - return b.a; - } - function xge(a, b, c2) { - var d, e, f2, g, h; - h = pke(a.e.Dh(), b); - e = RD(a.g, 124); - d = 0; - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (h.am(f2.Lk())) { - if (d == c2) { - vLd(a, g); - return nke(), RD(b, 69).xk() ? f2 : f2.md(); - } - ++d; + return getValueStringWithUnits(value2, units); } - } - throw Adb(new veb(HJe + c2 + NIe + d)); - } - function Rqe(a) { - var b, c2, d; - b = a.c; - if (b == 2 || b == 7 || b == 1) { - return Vse(), Vse(), Ese; } else { - d = Pqe(a); - c2 = null; - while ((b = a.c) != 2 && b != 7 && b != 1) { - if (!c2) { - c2 = (Vse(), Vse(), new iue(1)); - hue2(c2, d); - d = c2; - } - hue2(c2, Pqe(a)); - } - return d; - } - } - function Kb(a, b, c2) { - if (a < 0 || a > c2) { - return Jb(a, c2, "start index"); - } - if (b < 0 || b > c2) { - return Jb(b, c2, "end index"); - } - return hc("end index (%s) must not be less than start index (%s)", cD(WC(jJ, 1), rve, 1, 5, [sgb(b), sgb(a)])); - } - function dA(b, c2) { - var d, e, f2, g; - for (e = 0, f2 = b.length; e < f2; e++) { - g = b[e]; - try { - g[1] ? g[0].Um() && (c2 = cA(c2, g)) : g[0].Um(); - } catch (a) { - a = zdb(a); - if (ZD(a, 82)) { - d = a; - Qz(); - Wz(ZD(d, 486) ? RD(d, 486).ke() : d); - } else - throw Adb(a); - } - } - return c2; - } - function _cc(a, b, c2) { - var d, e, f2; - c2 != b.c + b.b.gc() && odc(b.a, wdc(b, c2 - b.c)); - f2 = b.a.c.p; - a.a[f2] = $wnd.Math.max(a.a[f2], b.a.o.a); - for (e = RD(mQb(b.a, (Ywc(), Mwc)), 15).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 72); - pQb(d, Ycc, (Geb(), true)); - } - } - function Aic(a, b) { - var c2, d, e; - e = zic(b); - pQb(b, (Ywc(), xwc), e); - if (e) { - d = lve; - !!qtb(a.f, e) && (d = RD(Wd(qtb(a.f, e)), 17).a); - c2 = RD(Vmb(b.g, 0), 18); - Heb(TD(mQb(c2, Nwc))) || Zjb(a, e, sgb($wnd.Math.min(RD(mQb(c2, zwc), 17).a, d))); - } - } - function aGc(a, b, c2) { - var d, e, f2, g, h; - b.p = -1; - for (h = c3b(b, (BEc(), zEc)).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 12); - for (e = new Anb(g.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - f2 = d.d.i; - b != f2 && (f2.p < 0 ? c2.Fc(d) : f2.p > 0 && aGc(a, f2, c2)); - } - } - b.p = 0; - } - function Ahd(a) { - var b; - this.c = new Yub(); - this.f = a.e; - this.e = a.d; - this.i = a.g; - this.d = a.c; - this.b = a.b; - this.k = a.j; - this.a = a.a; - !a.i ? this.j = (b = RD(mfb(d3), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)) : this.j = a.i; - this.g = a.f; - } - function Wb(a) { - var b, c2, d, e; - b = Thb(Zhb(new dib("Predicates."), "and"), 40); - c2 = true; - for (e = new Dkb(a); e.b < e.d.gc(); ) { - d = (sFb(e.b < e.d.gc()), e.d.Xb(e.c = e.b++)); - c2 || (b.a += ",", b); - b.a += "" + d; - c2 = false; - } - return (b.a += ")", b).a; - } - function vgc(a, b, c2) { - var d, e, f2; - if (c2 <= b + 2) { - return; - } - e = (c2 - b) / 2 | 0; - for (d = 0; d < e; ++d) { - f2 = (tFb(b + d, a.c.length), RD(a.c[b + d], 12)); - $mb(a, b + d, (tFb(c2 - d - 1, a.c.length), RD(a.c[c2 - d - 1], 12))); - tFb(c2 - d - 1, a.c.length); - a.c[c2 - d - 1] = f2; - } - } - function Nmc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - f2 = a.d.p; - h = f2.e; - i2 = f2.r; - a.g = new DMc(i2); - g = a.d.o.c.p; - d = g > 0 ? h[g - 1] : $C(jR, WAe, 10, 0, 0, 1); - e = h[g]; - j = g < h.length - 1 ? h[g + 1] : $C(jR, WAe, 10, 0, 0, 1); - k = b == c2 - 1; - k ? pMc(a.g, e, j) : pMc(a.g, d, e); - } - function Vmc(a) { - var b; - this.j = new bnb(); - this.f = new _sb(); - this.b = (b = RD(mfb(E3), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)); - this.d = $C(kE, Pwe, 28, (qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd])).length, 15, 1); - this.g = a; - } - function D3c(a, b) { - var c2, d, e; - if (b.c.length != 0) { - c2 = E3c(a, b); - e = false; - while (!c2) { - n3c(a, b, true); - e = true; - c2 = E3c(a, b); - } - e && n3c(a, b, false); - d = N2c(b); - !!a.b && a.b.Gg(d); - a.a = C3c(a, (tFb(0, b.c.length), RD(b.c[0], 27))); - D3c(a, d); - } - } - function $vd(a, b) { - var c2, d, e; - d = vYd(a.Dh(), b); - c2 = b - a.ji(); - if (c2 < 0) { - if (!d) { - throw Adb(new agb(OHe + b + PHe)); - } else if (d.rk()) { - e = a.Ih(d); - e >= 0 ? a.ki(e) : Tvd(a, d); + if (isArrayValue) { + return value2.map(function(v3) { + return string(v3) ? v3 : "" + getRenderedValue(v3); + }).join(" "); } else { - throw Adb(new agb(KHe + d.xe() + LHe)); - } - } else { - Cvd(a, c2, d); - } - } - function ADd(a) { - var b, c2; - c2 = null; - b = false; - if (ZD(a, 211)) { - b = true; - c2 = RD(a, 211).a; - } - if (!b) { - if (ZD(a, 263)) { - b = true; - c2 = "" + RD(a, 263).a; - } - } - if (!b) { - if (ZD(a, 493)) { - b = true; - c2 = "" + RD(a, 493).a; - } - } - if (!b) { - throw Adb(new Aeb(tIe)); - } - return c2; - } - function gge(a, b, c2) { - var d, e, f2, g, h, i2; - i2 = pke(a.e.Dh(), b); - d = 0; - h = a.i; - e = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i2.am(f2.Lk())) { - if (c2 == d) { - return g; - } - ++d; - h = g + 1; - } - } - if (c2 == d) { - return h; - } else { - throw Adb(new veb(HJe + c2 + NIe + d)); - } - } - function ucc(a, b) { - var c2, d, e, f2; - if (a.f.c.length == 0) { - return null; - } else { - f2 = new Tid(); - for (d = new Anb(a.f); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 72); - e = c2.o; - f2.b = $wnd.Math.max(f2.b, e.a); - f2.a += e.b; - } - f2.a += (a.f.c.length - 1) * b; - return f2; - } - } - function rOc(a) { - var b, c2, d, e; - c2 = new Yub(); - ye(c2, a.o); - d = new Fyb(); - while (c2.b != 0) { - b = RD(c2.b == 0 ? null : (sFb(c2.b != 0), Wub(c2, c2.a.a)), 515); - e = iOc(a, b, true); - e && Rmb(d.a, b); - } - while (d.a.c.length != 0) { - b = RD(Dyb(d), 515); - iOc(a, b, false); - } - } - function kid() { - kid = geb; - jid = new lid(Sye, 0); - cid = new lid("BOOLEAN", 1); - gid = new lid("INT", 2); - iid = new lid("STRING", 3); - did = new lid("DOUBLE", 4); - eid = new lid("ENUM", 5); - fid = new lid("ENUMSET", 6); - hid = new lid("OBJECT", 7); - } - function Sid(a, b) { - var c2, d, e, f2, g; - d = $wnd.Math.min(a.c, b.c); - f2 = $wnd.Math.min(a.d, b.d); - e = $wnd.Math.max(a.c + a.b, b.c + b.b); - g = $wnd.Math.max(a.d + a.a, b.d + b.a); - if (e < d) { - c2 = d; - d = e; - e = c2; - } - if (g < f2) { - c2 = f2; - f2 = g; - g = c2; - } - Rid(a, d, f2, e - d, g - f2); - } - function m3d(a, b) { - var c2, d; - if (a.f) { - while (b.Ob()) { - c2 = RD(b.Pb(), 76); - d = c2.Lk(); - if (ZD(d, 102) && (RD(d, 19).Bb & QHe) != 0 && (!a.e || d.pk() != C4 || d.Lj() != 0) && c2.md() != null) { - b.Ub(); - return true; - } - } - return false; - } else { - return b.Ob(); - } - } - function o3d(a, b) { - var c2, d; - if (a.f) { - while (b.Sb()) { - c2 = RD(b.Ub(), 76); - d = c2.Lk(); - if (ZD(d, 102) && (RD(d, 19).Bb & QHe) != 0 && (!a.e || d.pk() != C4 || d.Lj() != 0) && c2.md() != null) { - b.Pb(); - return true; - } + return "" + getRenderedValue(value2); } - return false; - } else { - return b.Sb(); - } - } - function lke() { - lke = geb; - ike = cD(WC(qJ, 1), Nve, 2, 6, [TKe, UKe, VKe, WKe, XKe, YKe, FIe]); - hke = cD(WC(qJ, 1), Nve, 2, 6, [TKe, "empty", UKe, pKe, "elementOnly"]); - kke = cD(WC(qJ, 1), Nve, 2, 6, [TKe, "preserve", "replace", ZKe]); - jke = new Yee(); - } - function e2b(a, b, c2) { - var d, e, f2; - if (b == c2) { - return; - } - d = b; - do { - $id(a, d.c); - e = d.e; - if (e) { - f2 = d.d; - Zid(a, f2.b, f2.d); - $id(a, e.n); - d = Y2b(e); - } - } while (e); - d = c2; - do { - ojd(a, d.c); - e = d.e; - if (e) { - f2 = d.d; - njd(a, f2.b, f2.d); - ojd(a, e.n); - d = Y2b(e); - } - } while (e); - } - function Wlc(a, b, c2, d) { - var e, f2, g, h, i2; - if (d.f.c + d.i.c == 0) { - for (g = a.a[a.c], h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - Zjb(d, f2, new dmc(a, f2, c2)); - } - } - e = RD(Wd(qtb(d.f, b)), 677); - e.b = 0; - e.c = e.f; - e.c == 0 || gmc(RD(Vmb(e.a, e.b), 294)); - return e; - } - function btc() { - btc = geb; - Zsc = new ctc("MEDIAN_LAYER", 0); - _sc = new ctc("TAIL_LAYER", 1); - Ysc = new ctc("HEAD_LAYER", 2); - $sc = new ctc("SPACE_EFFICIENT_LAYER", 3); - atc = new ctc("WIDEST_LAYER", 4); - Xsc = new ctc("CENTER_LAYER", 5); - } - function WGc(a) { - var b, c2, d, e; - a.e = 0; - for (e = Sub(a.f, 0); e.b != e.d.c; ) { - d = RD(evb(e), 10); - if (d.p >= a.d.b.c.length) { - b = new R4b(a.d); - b.p = d.p - 1; - Rmb(a.d.b, b); - c2 = new R4b(a.d); - c2.p = d.p; - Rmb(a.d.b, c2); - } - g3b(d, RD(Vmb(a.d.b, d.p), 30)); - } - } - function DVc(a, b, c2) { - var d, e, f2; - if (!a.b[b.g]) { - a.b[b.g] = true; - d = c2; - !d && (d = new YWc()); - Mub(d.b, b); - for (f2 = a.a[b.g].Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 65); - e.b != b && DVc(a, e.b, d); - e.c != b && DVc(a, e.c, d); - Mub(d.a, e); - } - return d; } - return null; + } else if (strValue != null) { + return strValue; } - function iMb(a) { - switch (a.g) { - case 0: - case 1: - case 2: - return qpd(), Yod; - case 3: - case 4: - case 5: - return qpd(), npd; - case 6: - case 7: - case 8: - return qpd(), ppd; - case 9: - case 10: - case 11: - return qpd(), Xod; - default: - return qpd(), opd; - } + } + return null; + } + }; + styfn$5.getAnimationStartStyle = function(ele, aniProps) { + var rstyle = {}; + for (var i2 = 0; i2 < aniProps.length; i2++) { + var aniProp = aniProps[i2]; + var name = aniProp.name; + var styleProp = ele.pstyle(name); + if (styleProp !== void 0) { + if (plainObject(styleProp)) { + styleProp = this.parse(name, styleProp.strValue); + } else { + styleProp = this.parse(name, styleProp); } - function SOc(a, b) { - var c2; - if (a.c.length == 0) { - return false; - } - c2 = zDc((tFb(0, a.c.length), RD(a.c[0], 18)).c.i); - dOc(); - if (c2 == (wDc(), tDc) || c2 == sDc) { - return true; - } - return yDb(GDb(new SDb(null, new Swb(a, 16)), new $Oc()), new aPc(b)); + } + if (styleProp) { + rstyle[name] = styleProp; + } + } + return rstyle; + }; + styfn$5.getPropsList = function(propsObj) { + var self2 = this; + var rstyle = []; + var style3 = propsObj; + var props = self2.properties; + if (style3) { + var names = Object.keys(style3); + for (var i2 = 0; i2 < names.length; i2++) { + var name = names[i2]; + var val = style3[name]; + var prop = props[name] || props[camel2dash(name)]; + var styleProp = this.parse(prop.name, val); + if (styleProp) { + rstyle.push(styleProp); } - function KDd(a, b) { - if (ZD(b, 207)) { - return EDd(a, RD(b, 27)); - } else if (ZD(b, 193)) { - return FDd(a, RD(b, 123)); - } else if (ZD(b, 452)) { - return DDd(a, RD(b, 166)); - } else { - throw Adb(new agb(wIe + Fe(new mob(cD(WC(jJ, 1), rve, 1, 5, [b]))))); - } + } + } + return rstyle; + }; + styfn$5.getNonDefaultPropertiesHash = function(ele, propNames, seed) { + var hash = seed.slice(); + var name, val, strVal, chVal; + var i2, j2; + for (i2 = 0; i2 < propNames.length; i2++) { + name = propNames[i2]; + val = ele.pstyle(name, false); + if (val == null) { + continue; + } else if (val.pfValue != null) { + hash[0] = hashInt(chVal, hash[0]); + hash[1] = hashIntAlt(chVal, hash[1]); + } else { + strVal = val.strValue; + for (j2 = 0; j2 < strVal.length; j2++) { + chVal = strVal.charCodeAt(j2); + hash[0] = hashInt(chVal, hash[0]); + hash[1] = hashIntAlt(chVal, hash[1]); } - function Ou(a, b, c2) { - var d, e; - this.f = a; - d = RD(Wjb(a.b, b), 260); - e = !d ? 0 : d.a; - Sb(c2, e); - if (c2 >= (e / 2 | 0)) { - this.e = !d ? null : d.c; - this.d = e; - while (c2++ < e) { - Mu(this); - } - } else { - this.c = !d ? null : d.b; - while (c2-- > 0) { - Lu(this); - } - } - this.b = b; - this.a = null; + } + } + return hash; + }; + styfn$5.getPropertiesHash = styfn$5.getNonDefaultPropertiesHash; + styfn$4 = {}; + styfn$4.appendFromJson = function(json3) { + var style3 = this; + for (var i2 = 0; i2 < json3.length; i2++) { + var context = json3[i2]; + var selector = context.selector; + var props = context.style || context.css; + var names = Object.keys(props); + style3.selector(selector); + for (var j2 = 0; j2 < names.length; j2++) { + var name = names[j2]; + var value2 = props[name]; + style3.css(name, value2); + } + } + return style3; + }; + styfn$4.fromJson = function(json3) { + var style3 = this; + style3.resetToDefault(); + style3.appendFromJson(json3); + return style3; + }; + styfn$4.json = function() { + var json3 = []; + for (var i2 = this.defaultLength; i2 < this.length; i2++) { + var cxt = this[i2]; + var selector = cxt.selector; + var props = cxt.properties; + var css = {}; + for (var j2 = 0; j2 < props.length; j2++) { + var prop = props[j2]; + css[prop.name] = prop.strValue; + } + json3.push({ + selector: !selector ? "core" : selector.toString(), + style: css + }); + } + return json3; + }; + styfn$3 = {}; + styfn$3.appendFromString = function(string3) { + var self2 = this; + var style3 = this; + var remaining = "" + string3; + var selAndBlockStr; + var blockRem; + var propAndValStr; + remaining = remaining.replace(/[/][*](\s|.)+?[*][/]/g, ""); + function removeSelAndBlockFromRemaining() { + if (remaining.length > selAndBlockStr.length) { + remaining = remaining.substr(selAndBlockStr.length); + } else { + remaining = ""; + } + } + __name(removeSelAndBlockFromRemaining, "removeSelAndBlockFromRemaining"); + function removePropAndValFromRem() { + if (blockRem.length > propAndValStr.length) { + blockRem = blockRem.substr(propAndValStr.length); + } else { + blockRem = ""; + } + } + __name(removePropAndValFromRem, "removePropAndValFromRem"); + for (; ; ) { + var nothingLeftToParse = remaining.match(/^\s*$/); + if (nothingLeftToParse) { + break; + } + var selAndBlock = remaining.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); + if (!selAndBlock) { + warn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + remaining); + break; + } + selAndBlockStr = selAndBlock[0]; + var selectorStr = selAndBlock[1]; + if (selectorStr !== "core") { + var selector = new Selector(selectorStr); + if (selector.invalid) { + warn("Skipping parsing of block: Invalid selector found in string stylesheet: " + selectorStr); + removeSelAndBlockFromRemaining(); + continue; } - function iHb(a, b) { - var c2, d; - b.a ? jHb(a, b) : (c2 = RD(vAb(a.b, b.b), 60), !!c2 && c2 == a.a[b.b.f] && !!c2.a && c2.a != b.b.a && c2.c.Fc(b.b), d = RD(uAb(a.b, b.b), 60), !!d && a.a[d.f] == b.b && !!d.a && d.a != b.b.a && b.b.c.Fc(d), wAb(a.b, b.b), void 0); + } + var blockStr = selAndBlock[2]; + var invalidBlock = false; + blockRem = blockStr; + var props = []; + for (; ; ) { + var _nothingLeftToParse = blockRem.match(/^\s*$/); + if (_nothingLeftToParse) { + break; } - function wMb(a, b) { - var c2, d; - c2 = RD(Vrb(a.b, b), 127); - if (RD(RD(Qc(a.r, b), 21), 87).dc()) { - c2.n.b = 0; - c2.n.c = 0; - return; - } - c2.n.b = a.C.b; - c2.n.c = a.C.c; - a.A.Hc((Qpd(), Ppd)) && BMb(a, b); - d = AMb(a, b); - BLb(a, b) == (pod(), mod) && (d += 2 * a.w); - c2.a.a = d; - } - function FNb(a, b) { - var c2, d; - c2 = RD(Vrb(a.b, b), 127); - if (RD(RD(Qc(a.r, b), 21), 87).dc()) { - c2.n.d = 0; - c2.n.a = 0; - return; - } - c2.n.d = a.C.d; - c2.n.a = a.C.a; - a.A.Hc((Qpd(), Ppd)) && JNb(a, b); - d = INb(a, b); - BLb(a, b) == (pod(), mod) && (d += 2 * a.w); - c2.a.b = d; - } - function VQb(a, b) { - var c2, d, e, f2; - f2 = new bnb(); - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 68); - Rmb(f2, new fRb(c2, true)); - Rmb(f2, new fRb(c2, false)); - } - e = new $Qb(a); - e.a.a.$b(); - bGb(f2, a.b, new mob(cD(WC(bN, 1), rve, 693, 0, [e]))); - } - function iTb(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - i2 = a.a; - n = a.b; - j = b.a; - o2 = b.b; - k = c2.a; - p = c2.b; - l = d.a; - q = d.b; - f2 = i2 * o2 - n * j; - g = k * q - p * l; - e = (i2 - j) * (p - q) - (n - o2) * (k - l); - h = (f2 * (k - l) - g * (i2 - j)) / e; - m = (f2 * (p - q) - g * (n - o2)) / e; - return new rjd(h, m); - } - function Z6b(a, b) { - var c2, d, e; - b.Ug("End label pre-processing", 1); - c2 = Kfb(UD(mQb(a, (yCc(), VBc)))); - d = Kfb(UD(mQb(a, ZBc))); - e = Emd(RD(mQb(a, rAc), 88)); - FDb(EDb(new SDb(null, new Swb(a.b, 16)), new f7b()), new h7b(c2, d, e)); - b.Vg(); - } - function LFc(a, b) { - var c2, d, e; - if (a.d[b.p]) { - return; - } - a.d[b.p] = true; - a.a[b.p] = true; - for (d = new is(Mr(a3b(b).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - if (W0b(c2)) { - continue; - } - e = c2.d.i; - a.a[e.p] ? Rmb(a.b, c2) : LFc(a, e); - } - a.a[b.p] = false; + var propAndVal = blockRem.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); + if (!propAndVal) { + warn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + blockStr); + invalidBlock = true; + break; } - function hGc(a, b, c2) { - var d; - d = 0; - switch (RD(mQb(b, (yCc(), UAc)), 171).g) { - case 2: - d = 2 * -c2 + a.a; - ++a.a; - break; - case 1: - d = -c2; - break; - case 3: - d = c2; - break; - case 4: - d = 2 * c2 + a.b; - ++a.b; - } - nQb(b, (Ywc(), zwc)) && (d += RD(mQb(b, zwc), 17).a); - return d; - } - function JSc(a, b, c2) { - var d, e, f2; - c2.zc(b, a); - Rmb(a.n, b); - f2 = a.p.zg(b); - b.j == a.p.Ag() ? YSc(a.e, f2) : YSc(a.j, f2); - LSc(a); - for (e = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [new T3b(b), new _3b(b)]))); gs(e); ) { - d = RD(hs(e), 12); - c2._b(d) || JSc(a, d, c2); - } - } - function rZc(a, b, c2) { - var d, e, f2; - c2.Ug("Processor set neighbors", 1); - a.a = b.b.b == 0 ? 1 : b.b.b; - e = null; - d = Sub(b.b, 0); - while (!e && d.b != d.d.c) { - f2 = RD(evb(d), 40); - Heb(TD(mQb(f2, (q$c(), n$c)))) && (e = f2); - } - !!e && sZc(a, new dXc(e), c2); - c2.Vg(); - } - function vsd(a) { - var b, c2, d; - c2 = RD(Gxd(a, (umd(), kld)), 21); - if (c2.Hc((Qpd(), Mpd))) { - d = RD(Gxd(a, pld), 21); - b = new sjd(RD(Gxd(a, nld), 8)); - if (d.Hc((dqd(), Ypd))) { - b.a <= 0 && (b.a = 20); - b.b <= 0 && (b.b = 20); - } - return b; - } else { - return new pjd(); - } - } - function nYd(a) { - var b, c2, d; - if (!a.b) { - d = new y_d(); - for (c2 = new yMd(qYd(a)); c2.e != c2.i.gc(); ) { - b = RD(xMd(c2), 19); - (b.Bb & QHe) != 0 && WGd(d, b); - } - VHd(d); - a.b = new N$d((RD(QHd(xYd((lTd(), kTd).o), 8), 19), d.i), d.g); - yYd(a).b &= -9; - } - return a.b; - } - function Dhb(a) { - var b, c2, d; - c2 = a.length; - d = 0; - while (d < c2 && (BFb(d, a.length), a.charCodeAt(d) <= 32)) { - ++d; - } - b = c2; - while (b > d && (BFb(b - 1, a.length), a.charCodeAt(b - 1) <= 32)) { - --b; - } - return d > 0 || b < c2 ? (AFb(d, b, a.length), a.substr(d, b - d)) : a; - } - function vqc(a, b) { - var c2, d, e, f2, g, h, i2, j; - i2 = RD(Ee(Ec(b.k), $C(E3, NAe, 64, 2, 0, 1)), 126); - j = b.g; - c2 = xqc(b, i2[0]); - e = wqc(b, i2[1]); - d = oqc(a, j, c2, e); - f2 = xqc(b, i2[1]); - h = wqc(b, i2[0]); - g = oqc(a, j, f2, h); - if (d <= g) { - b.a = c2; - b.c = e; - } else { - b.a = f2; - b.c = h; - } + propAndValStr = propAndVal[0]; + var propStr = propAndVal[1]; + var valStr = propAndVal[2]; + var prop = self2.properties[propStr]; + if (!prop) { + warn("Skipping property: Invalid property name in: " + propAndValStr); + removePropAndValFromRem(); + continue; } - function Eob(a) { - var h; - yob(); - var b, c2, d, e, f2, g; - if (ZD(a, 59)) { - for (e = 0, d = a.gc() - 1; e < d; ++e, --d) { - h = a.Xb(e); - a.hd(e, a.Xb(d)); - a.hd(d, h); - } - } else { - b = a.ed(); - f2 = a.fd(a.gc()); - while (b.Tb() < f2.Vb()) { - c2 = b.Pb(); - g = f2.Ub(); - b.Wb(g); - f2.Wb(c2); - } - } - } - function lKc(a, b) { - var c2, d, e, f2, g, h; - h = 0; - f2 = new wmb(); - hmb(f2, b); - while (f2.b != f2.c) { - g = RD(smb(f2), 219); - h += PLc(g.d, g.e); - for (e = new Anb(g.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 36); - c2 = RD(Vmb(a.b, d.p), 219); - c2.s || (h += lKc(a, c2)); - } - } - return h; - } - function QTc(a, b, c2, d, e) { - var f2, g, h, i2, j; - if (b) { - for (h = b.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 10); - for (j = d3b(g, (BEc(), zEc), c2).Kc(); j.Ob(); ) { - i2 = RD(j.Pb(), 12); - f2 = RD(Wd(qtb(e.f, i2)), 118); - if (!f2) { - f2 = new USc(a.d); - ZEb(d.c, f2); - JSc(f2, i2, e); - } - } - } - } + var parsedProp = style3.parse(propStr, valStr); + if (!parsedProp) { + warn("Skipping property: Invalid property definition in: " + propAndValStr); + removePropAndValFromRem(); + continue; } - function wVc(a, b, c2) { - var d, e; - rVc(this); - b == (dVc(), bVc) ? Ysb(this.r, a.c) : Ysb(this.w, a.c); - c2 == bVc ? Ysb(this.r, a.d) : Ysb(this.w, a.d); - sVc(this, a); - d = tVc(a.c); - e = tVc(a.d); - vVc(this, d, e, e); - this.o = (HUc(), $wnd.Math.abs(d - e) < 0.2); - } - function Ade(a, b, c2) { - var d, e, f2, g, h, i2; - h = RD(Ywd(a.a, 8), 2035); - if (h != null) { - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - null.Um(); - } - } - d = c2; - if ((a.a.Db & 1) == 0) { - i2 = new Fde(a, c2, b); - d.dj(i2); - } - ZD(d, 686) ? RD(d, 686).fj(a.a) : d.cj() == a.a && d.ej(null); - } - function Cne() { - var a; - if (wne) - return RD(N5d((YSd(), XSd), dLe), 2044); - Dne(); - a = RD(ZD(Xjb((YSd(), XSd), dLe), 594) ? Xjb(XSd, dLe) : new Bne(), 594); - wne = true; - zne(a); - Ane(a); - Zjb((hTd(), gTd), a, new Ene()); - rBd(a); - $jb(XSd, dLe, a); - return a; - } - function NA(a, b, c2, d) { - var e; - e = EA(a, c2, cD(WC(qJ, 1), Nve, 2, 6, [Swe, Twe, Uwe, Vwe, Wwe, Xwe, Ywe]), b); - e < 0 && (e = EA(a, c2, cD(WC(qJ, 1), Nve, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]), b)); - if (e < 0) { - return false; - } - d.d = e; - return true; - } - function QA(a, b, c2, d) { - var e; - e = EA(a, c2, cD(WC(qJ, 1), Nve, 2, 6, [Swe, Twe, Uwe, Vwe, Wwe, Xwe, Ywe]), b); - e < 0 && (e = EA(a, c2, cD(WC(qJ, 1), Nve, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]), b)); - if (e < 0) { - return false; - } - d.d = e; - return true; - } - function rtb(a, b, c2) { - var d, e, f2, g; - g = a.b.Ce(b); - e = (d = a.a.get(g), d == null ? $C(jJ, rve, 1, 0, 5, 1) : d); - if (e.length == 0) { - a.a.set(g, e); - } else { - f2 = otb(a, b, e); - if (f2) { - return f2.nd(c2); - } - } - bD(e, e.length, new xlb(b, c2)); - ++a.c; - ++a.b.g; - return null; - } - function PYb(a) { - var b, c2, d; - MYb(a); - d = new bnb(); - for (c2 = new Anb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - Rmb(d, new _Yb(b, true)); - Rmb(d, new _Yb(b, false)); - } - TYb(a.c); - t$b(d, a.b, new mob(cD(WC(wQ, 1), rve, 382, 0, [a.c]))); - OYb(a); - } - function eHb(a, b) { - var c2, d, e; - e = new bnb(); - for (d = new Anb(a.c.a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 60); - if (b.Lb(c2)) { - Rmb(e, new sHb(c2, true)); - Rmb(e, new sHb(c2, false)); - } - } - kHb(a.e); - bGb(e, a.d, new mob(cD(WC(bN, 1), rve, 693, 0, [a.e]))); - } - function t7b(a) { - var b, c2, d, e; - c2 = new Tsb(); - for (e = new Anb(a.d); e.a < e.c.c.length; ) { - d = RD(ynb(e), 187); - b = RD(d.of((Ywc(), dwc)), 18); - !!qtb(c2.f, b) || Zjb(c2, b, new G7b(b)); - Rmb(RD(Wd(qtb(c2.f, b)), 466).b, d); - } - return new dnb(new glb(c2)); - } - function Xdc(a, b) { - var c2, d, e, f2, g; - d = new xmb(a.j.c.length); - c2 = null; - for (f2 = new Anb(a.j); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 12); - if (e.j != c2) { - d.b == d.c || Ydc(d, c2, b); - jmb(d); - c2 = e.j; - } - g = c7b(e); - !!g && (imb(d, g), true); - } - d.b == d.c || Ydc(d, c2, b); - } - function Lec(a, b) { - var c2, d, e; - d = new Jkb(a.b, 0); - while (d.b < d.d.gc()) { - c2 = (sFb(d.b < d.d.gc()), RD(d.d.Xb(d.c = d.b++), 72)); - e = RD(mQb(c2, (yCc(), wAc)), 278); - if (e == (Omd(), Mmd)) { - Ckb(d); - Rmb(b.b, c2); - nQb(c2, (Ywc(), dwc)) || pQb(c2, dwc, a); - } - } - } - function eIc(a) { - var b, c2, d, e, f2; - b = Kr(new is(Mr(a3b(a).a.Kc(), new ir()))); - for (e = new is(Mr(Z2b(a).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - c2 = d.c.i; - f2 = Kr(new is(Mr(a3b(c2).a.Kc(), new ir()))); - b = $wnd.Math.max(b, f2); - } - return sgb(b); - } - function Jsd(a, b, c2) { - var d, e, f2; - d = RD(Gxd(a, (umd(), Kkd)), 21); - e = 0; - f2 = 0; - b.a > c2.a && (d.Hc((ukd(), okd)) ? e = (b.a - c2.a) / 2 : d.Hc(qkd) && (e = b.a - c2.a)); - b.b > c2.b && (d.Hc((ukd(), skd)) ? f2 = (b.b - c2.b) / 2 : d.Hc(rkd) && (f2 = b.b - c2.b)); - Isd(a, e, f2); - } - function ABd(a, b, c2, d, e, f2, g, h, i2, j, k, l, m) { - ZD(a.Cb, 90) && v$d(yYd(RD(a.Cb, 90)), 4); - PAd(a, c2); - a.f = g; - DWd(a, h); - FWd(a, i2); - xWd(a, j); - EWd(a, k); - aWd(a, l); - AWd(a, m); - _Vd(a, true); - $Vd(a, e); - a.Zk(f2); - YVd(a, b); - d != null && (a.i = null, zWd(a, d)); - } - function Jb(a, b, c2) { - if (a < 0) { - return hc(qve, cD(WC(jJ, 1), rve, 1, 5, [c2, sgb(a)])); - } else if (b < 0) { - throw Adb(new agb(sve + b)); - } else { - return hc("%s (%s) must not be greater than size (%s)", cD(WC(jJ, 1), rve, 1, 5, [c2, sgb(a), sgb(b)])); - } - } - function Xnb(a, b, c2, d, e, f2) { - var g, h, i2, j; - g = d - c2; - if (g < 7) { - Unb(b, c2, d, f2); - return; - } - i2 = c2 + e; - h = d + e; - j = i2 + (h - i2 >> 1); - Xnb(b, a, i2, j, -e, f2); - Xnb(b, a, j, h, -e, f2); - if (f2.Ne(a[j - 1], a[j]) <= 0) { - while (c2 < d) { - bD(b, c2++, a[i2++]); - } - return; - } - Vnb(a, i2, j, h, b, c2, d, f2); - } - function Mqc(a, b) { - var c2, d, e, f2, g, h, i2; - i2 = b.d; - e = b.b.j; - for (h = new Anb(i2); h.a < h.c.c.length; ) { - g = RD(ynb(h), 105); - f2 = $C(xdb, Hye, 28, e.c.length, 16, 1); - Zjb(a.b, g, f2); - c2 = g.a.d.p - 1; - d = g.c.d.p; - while (c2 != d) { - c2 = (c2 + 1) % e.c.length; - f2[c2] = true; - } - } - } - function rGc(a, b) { - nGc(); - if (nQb(a, (Ywc(), zwc)) && nQb(b, zwc)) { - return hgb(RD(mQb(a, zwc), 17).a, RD(mQb(b, zwc), 17).a); - } - throw Adb(new Ked("The BF model order layer assigner requires all real nodes to have a model order.")); - } - function $Gc(a, b) { - SGc(); - if (nQb(a, (Ywc(), zwc)) && nQb(b, zwc)) { - return hgb(RD(mQb(a, zwc), 17).a, RD(mQb(b, zwc), 17).a); - } - throw Adb(new Ked("The DF model order layer assigner requires all real nodes to have a model order.")); - } - function TSc(a, b) { - a.r = new USc(a.p); - SSc2(a.r, a); - ye(a.r.j, a.j); - Xub(a.j); - Mub(a.j, b); - Mub(a.r.e, b); - LSc(a); - LSc(a.r); - while (a.f.c.length != 0) { - $Sc(RD(Vmb(a.f, 0), 132)); - } - while (a.k.c.length != 0) { - $Sc(RD(Vmb(a.k, 0), 132)); - } - return a.r; - } - function Wvd(a, b, c2) { - var d, e, f2; - e = vYd(a.Dh(), b); - d = b - a.ji(); - if (d < 0) { - if (!e) { - throw Adb(new agb(OHe + b + PHe)); - } else if (e.rk()) { - f2 = a.Ih(e); - f2 >= 0 ? a.bi(f2, c2) : Svd(a, e, c2); - } else { - throw Adb(new agb(KHe + e.xe() + LHe)); - } - } else { - Bvd(a, d, e, c2); - } - } - function n3d(a) { - var b, c2; - if (a.f) { - while (a.n > 0) { - b = RD(a.k.Xb(a.n - 1), 76); - c2 = b.Lk(); - if (ZD(c2, 102) && (RD(c2, 19).Bb & QHe) != 0 && (!a.e || c2.pk() != C4 || c2.Lj() != 0) && b.md() != null) { - return true; - } else { - --a.n; - } - } - return false; - } else { - return a.n > 0; - } - } - function Pje(b) { - var c2, d, e, f2; - d = RD(b, 54)._h(); - if (d) { - try { - e = null; - c2 = N5d((YSd(), XSd), jSd(kSd(d))); - if (c2) { - f2 = c2.ai(); - !!f2 && (e = f2.Fl(Chb(d.e))); - } - if (!!e && e != b) { - return Pje(e); - } - } catch (a) { - a = zdb(a); - if (!ZD(a, 63)) - throw Adb(a); - } - } - return b; - } - function P3c(a, b, c2) { - var d, e, f2; - c2.Ug("Remove overlaps", 1); - c2.dh(b, eFe); - d = RD(Gxd(b, (u2c(), t2c)), 27); - a.f = d; - a.a = u5c(RD(Gxd(b, ($4c(), X4c)), 300)); - e = UD(Gxd(b, (umd(), fmd))); - s3c(a, (uFb(e), e)); - f2 = Q2c(d); - O3c(a, b, f2, c2); - c2.dh(b, gFe); - } - function Ded(a) { - var b, c2, d; - if (Heb(TD(Gxd(a, (umd(), $kd))))) { - d = new bnb(); - for (c2 = new is(Mr(zGd(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 74); - ozd(b) && Heb(TD(Gxd(b, _kd))) && (ZEb(d.c, b), true); - } - return d; - } else { - return yob(), yob(), vob; - } - } - function KC(a) { - if (!a) { - return cC(), bC; - } - var b = a.valueOf ? a.valueOf() : a; - if (b !== a) { - var c2 = GC[typeof b]; - return c2 ? c2(b) : NC(typeof b); - } else if (a instanceof Array || a instanceof $wnd.Array) { - return new NB(a); - } else { - return new vC(a); - } - } - function IMb(a, b, c2) { - var d, e, f2; - f2 = a.o; - d = RD(Vrb(a.p, c2), 252); - e = d.i; - e.b = ZKb(d); - e.a = YKb(d); - e.b = $wnd.Math.max(e.b, f2.a); - e.b > f2.a && !b && (e.b = f2.a); - e.c = -(e.b - f2.a) / 2; - switch (c2.g) { - case 1: - e.d = -e.a; - break; - case 3: - e.d = f2.b; - } - $Kb(d); - _Kb(d); - } - function JMb(a, b, c2) { - var d, e, f2; - f2 = a.o; - d = RD(Vrb(a.p, c2), 252); - e = d.i; - e.b = ZKb(d); - e.a = YKb(d); - e.a = $wnd.Math.max(e.a, f2.b); - e.a > f2.b && !b && (e.a = f2.b); - e.d = -(e.a - f2.b) / 2; - switch (c2.g) { - case 4: - e.c = -e.b; - break; + props.push({ + name: propStr, + val: valStr + }); + removePropAndValFromRem(); + } + if (invalidBlock) { + removeSelAndBlockFromRemaining(); + break; + } + style3.selector(selectorStr); + for (var i2 = 0; i2 < props.length; i2++) { + var _prop = props[i2]; + style3.css(_prop.name, _prop.val); + } + removeSelAndBlockFromRemaining(); + } + return style3; + }; + styfn$3.fromString = function(string3) { + var style3 = this; + style3.resetToDefault(); + style3.appendFromString(string3); + return style3; + }; + styfn$2 = {}; + (function() { + var number$12 = number6; + var rgba4 = rgbaNoBackRefs; + var hsla3 = hslaNoBackRefs; + var hex3$1 = hex3; + var hex6$1 = hex6; + var data5 = /* @__PURE__ */ __name(function data6(prefix) { + return "^" + prefix + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; + }, "data"); + var mapData = /* @__PURE__ */ __name(function mapData2(prefix) { + var mapArg = number$12 + "|\\w+|" + rgba4 + "|" + hsla3 + "|" + hex3$1 + "|" + hex6$1; + return "^" + prefix + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + number$12 + ")\\s*\\,\\s*(" + number$12 + ")\\s*,\\s*(" + mapArg + ")\\s*\\,\\s*(" + mapArg + ")\\)$"; + }, "mapData"); + var urlRegexes = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"]; + styfn$2.types = { + time: { + number: true, + min: 0, + units: "s|ms", + implicitUnits: "ms" + }, + percent: { + number: true, + min: 0, + max: 100, + units: "%", + implicitUnits: "%" + }, + percentages: { + number: true, + min: 0, + max: 100, + units: "%", + implicitUnits: "%", + multiple: true + }, + zeroOneNumber: { + number: true, + min: 0, + max: 1, + unitless: true + }, + zeroOneNumbers: { + number: true, + min: 0, + max: 1, + unitless: true, + multiple: true + }, + nOneOneNumber: { + number: true, + min: -1, + max: 1, + unitless: true + }, + nonNegativeInt: { + number: true, + min: 0, + integer: true, + unitless: true + }, + nonNegativeNumber: { + number: true, + min: 0, + unitless: true + }, + position: { + enums: ["parent", "origin"] + }, + nodeSize: { + number: true, + min: 0, + enums: ["label"] + }, + number: { + number: true, + unitless: true + }, + numbers: { + number: true, + unitless: true, + multiple: true + }, + positiveNumber: { + number: true, + unitless: true, + min: 0, + strictMin: true + }, + size: { + number: true, + min: 0 + }, + bidirectionalSize: { + number: true + }, + // allows negative + bidirectionalSizeMaybePercent: { + number: true, + allowPercent: true + }, + // allows negative + bidirectionalSizes: { + number: true, + multiple: true + }, + // allows negative + sizeMaybePercent: { + number: true, + min: 0, + allowPercent: true + }, + axisDirection: { + enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"] + }, + paddingRelativeTo: { + enums: ["width", "height", "average", "min", "max"] + }, + bgWH: { + number: true, + min: 0, + allowPercent: true, + enums: ["auto"], + multiple: true + }, + bgPos: { + number: true, + allowPercent: true, + multiple: true + }, + bgRelativeTo: { + enums: ["inner", "include-padding"], + multiple: true + }, + bgRepeat: { + enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"], + multiple: true + }, + bgFit: { + enums: ["none", "contain", "cover"], + multiple: true + }, + bgCrossOrigin: { + enums: ["anonymous", "use-credentials", "null"], + multiple: true + }, + bgClip: { + enums: ["none", "node"], + multiple: true + }, + bgContainment: { + enums: ["inside", "over"], + multiple: true + }, + color: { + color: true + }, + colors: { + color: true, + multiple: true + }, + fill: { + enums: ["solid", "linear-gradient", "radial-gradient"] + }, + bool: { + enums: ["yes", "no"] + }, + bools: { + enums: ["yes", "no"], + multiple: true + }, + lineStyle: { + enums: ["solid", "dotted", "dashed"] + }, + lineCap: { + enums: ["butt", "round", "square"] + }, + linePosition: { + enums: ["center", "inside", "outside"] + }, + lineJoin: { + enums: ["round", "bevel", "miter"] + }, + borderStyle: { + enums: ["solid", "dotted", "dashed", "double"] + }, + curveStyle: { + enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi", "round-segments", "round-taxi"] + }, + radiusType: { + enums: ["arc-radius", "influence-radius"], + multiple: true + }, + fontFamily: { + regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' + }, + fontStyle: { + enums: ["italic", "normal", "oblique"] + }, + fontWeight: { + enums: ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "800", "900", 100, 200, 300, 400, 500, 600, 700, 800, 900] + }, + textDecoration: { + enums: ["none", "underline", "overline", "line-through"] + }, + textTransform: { + enums: ["none", "uppercase", "lowercase"] + }, + textWrap: { + enums: ["none", "wrap", "ellipsis"] + }, + textOverflowWrap: { + enums: ["whitespace", "anywhere"] + }, + textBackgroundShape: { + enums: ["rectangle", "roundrectangle", "round-rectangle"] + }, + nodeShape: { + enums: ["rectangle", "roundrectangle", "round-rectangle", "cutrectangle", "cut-rectangle", "bottomroundrectangle", "bottom-round-rectangle", "barrel", "ellipse", "triangle", "round-triangle", "square", "pentagon", "round-pentagon", "hexagon", "round-hexagon", "concavehexagon", "concave-hexagon", "heptagon", "round-heptagon", "octagon", "round-octagon", "tag", "round-tag", "star", "diamond", "round-diamond", "vee", "rhomboid", "right-rhomboid", "polygon"] + }, + overlayShape: { + enums: ["roundrectangle", "round-rectangle", "ellipse"] + }, + cornerRadius: { + number: true, + min: 0, + units: "px|em", + implicitUnits: "px", + enums: ["auto"] + }, + compoundIncludeLabels: { + enums: ["include", "exclude"] + }, + arrowShape: { + enums: ["tee", "triangle", "triangle-tee", "circle-triangle", "triangle-cross", "triangle-backcurve", "vee", "square", "circle", "diamond", "chevron", "none"] + }, + arrowFill: { + enums: ["filled", "hollow"] + }, + arrowWidth: { + number: true, + units: "%|px|em", + implicitUnits: "px", + enums: ["match-line"] + }, + display: { + enums: ["element", "none"] + }, + visibility: { + enums: ["hidden", "visible"] + }, + zCompoundDepth: { + enums: ["bottom", "orphan", "auto", "top"] + }, + zIndexCompare: { + enums: ["auto", "manual"] + }, + valign: { + enums: ["top", "center", "bottom"] + }, + halign: { + enums: ["left", "center", "right"] + }, + justification: { + enums: ["left", "center", "right", "auto"] + }, + text: { + string: true + }, + data: { + mapping: true, + regex: data5("data") + }, + layoutData: { + mapping: true, + regex: data5("layoutData") + }, + scratch: { + mapping: true, + regex: data5("scratch") + }, + mapData: { + mapping: true, + regex: mapData("mapData") + }, + mapLayoutData: { + mapping: true, + regex: mapData("mapLayoutData") + }, + mapScratch: { + mapping: true, + regex: mapData("mapScratch") + }, + fn: { + mapping: true, + fn: true + }, + url: { + regexes: urlRegexes, + singleRegexMatchValue: true + }, + urls: { + regexes: urlRegexes, + singleRegexMatchValue: true, + multiple: true + }, + propList: { + propList: true + }, + angle: { + number: true, + units: "deg|rad", + implicitUnits: "rad" + }, + textRotation: { + number: true, + units: "deg|rad", + implicitUnits: "rad", + enums: ["none", "autorotate"] + }, + polygonPointList: { + number: true, + multiple: true, + evenMultiple: true, + min: -1, + max: 1, + unitless: true + }, + edgeDistances: { + enums: ["intersection", "node-position", "endpoints"] + }, + edgeEndpoint: { + number: true, + multiple: true, + units: "%|px|em|deg|rad", + implicitUnits: "px", + enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"], + singleEnum: true, + validate: /* @__PURE__ */ __name(function validate2(valArr, unitsArr) { + switch (valArr.length) { case 2: - e.c = f2.a; - } - $Kb(d); - _Kb(d); - } - function nkc(a, b) { - var c2, d, e, f2, g; - if (b.dc()) { - return; - } - e = RD(b.Xb(0), 131); - if (b.gc() == 1) { - mkc(a, e, e, 1, 0, b); - return; - } - c2 = 1; - while (c2 < b.gc()) { - if (e.j || !e.o) { - f2 = skc(b, c2); - if (f2) { - d = RD(f2.a, 17).a; - g = RD(f2.b, 131); - mkc(a, e, g, c2, d, b); - c2 = d + 1; - e = g; - } - } - } - } - function Soc(a) { - var b, c2, d, e, f2, g; - g = new dnb(a.d); - _mb(g, new upc()); - b = (epc(), cD(WC(hW, 1), jwe, 276, 0, [Zoc, apc, Yoc, dpc, _oc, $oc, cpc, bpc])); - c2 = 0; - for (f2 = new Anb(g); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 105); - d = b[c2 % b.length]; - Uoc(e, d); - ++c2; - } - } - function zid(a, b) { - tid(); - var c2, d, e, f2; - if (b.b < 2) { - return false; - } - f2 = Sub(b, 0); - c2 = RD(evb(f2), 8); - d = c2; - while (f2.b != f2.d.c) { - e = RD(evb(f2), 8); - if (!(xid(a, d) && xid(a, e))) { + return unitsArr[0] !== "deg" && unitsArr[0] !== "rad" && unitsArr[1] !== "deg" && unitsArr[1] !== "rad"; + case 1: + return string(valArr[0]) || unitsArr[0] === "deg" || unitsArr[0] === "rad"; + default: return false; - } - d = e; - } - if (!(xid(a, d) && xid(a, c2))) { - return false; } + }, "validate") + }, + easing: { + regexes: ["^(spring)\\s*\\(\\s*(" + number$12 + ")\\s*,\\s*(" + number$12 + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + number$12 + ")\\s*,\\s*(" + number$12 + ")\\s*,\\s*(" + number$12 + ")\\s*,\\s*(" + number$12 + ")\\s*\\)$"], + enums: ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "ease-in-sine", "ease-out-sine", "ease-in-out-sine", "ease-in-quad", "ease-out-quad", "ease-in-out-quad", "ease-in-cubic", "ease-out-cubic", "ease-in-out-cubic", "ease-in-quart", "ease-out-quart", "ease-in-out-quart", "ease-in-quint", "ease-out-quint", "ease-in-out-quint", "ease-in-expo", "ease-out-expo", "ease-in-out-expo", "ease-in-circ", "ease-out-circ", "ease-in-out-circ"] + }, + gradientDirection: { + enums: [ + "to-bottom", + "to-top", + "to-left", + "to-right", + "to-bottom-right", + "to-bottom-left", + "to-top-right", + "to-top-left", + "to-right-bottom", + "to-left-bottom", + "to-right-top", + "to-left-top" + // different order + ] + }, + boundsExpansion: { + number: true, + multiple: true, + min: 0, + validate: /* @__PURE__ */ __name(function validate2(valArr) { + var length2 = valArr.length; + return length2 === 1 || length2 === 2 || length2 === 4; + }, "validate") + } + }; + var diff2 = { + zeroNonZero: /* @__PURE__ */ __name(function zeroNonZero(val1, val2) { + if ((val1 == null || val2 == null) && val1 !== val2) { return true; } - function HEd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - k = null; - l = a; - g = vDd(l, "x"); - c2 = new iFd(b); - eEd(c2.a, g); - h = vDd(l, "y"); - d = new jFd(b); - fEd(d.a, h); - i2 = vDd(l, fIe); - e = new kFd(b); - gEd(e.a, i2); - j = vDd(l, eIe); - f2 = new lFd(b); - k = (hEd(f2.a, j), j); - return k; - } - function v$d(a, b) { - r$d(a, b); - (a.b & 1) != 0 && (a.a.a = null); - (a.b & 2) != 0 && (a.a.f = null); - if ((a.b & 4) != 0) { - a.a.g = null; - a.a.i = null; - } - if ((a.b & 16) != 0) { - a.a.d = null; - a.a.e = null; - } - (a.b & 8) != 0 && (a.a.b = null); - if ((a.b & 32) != 0) { - a.a.j = null; - a.a.c = null; - } - } - function Lde(b, c2) { - var d, e, f2; - f2 = 0; - if (c2.length > 0) { - try { - f2 = Oeb(c2, qwe, lve); - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - e = a; - throw Adb(new RSd(e)); - } else - throw Adb(a); - } - } - d = (!b.a && (b.a = new Zde(b)), b.a); - return f2 < d.i && f2 >= 0 ? RD(QHd(d, f2), 58) : null; - } - function Ib(a, b) { - if (a < 0) { - return hc(qve, cD(WC(jJ, 1), rve, 1, 5, ["index", sgb(a)])); - } else if (b < 0) { - throw Adb(new agb(sve + b)); - } else { - return hc("%s (%s) must be less than size (%s)", cD(WC(jJ, 1), rve, 1, 5, ["index", sgb(a), sgb(b)])); - } - } - function cob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new dib(f2.d) : Zhb(f2.a, f2.b); - Whb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function dob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new dib(f2.d) : Zhb(f2.a, f2.b); - Whb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function eob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new dib(f2.d) : Zhb(f2.a, f2.b); - Whb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function hob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new dib(f2.d) : Zhb(f2.a, f2.b); - Whb(f2.a, "" + b); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function kwb(a, b) { - var c2, d, e, f2, g, h; - c2 = a.b.c.length; - e = Vmb(a.b, b); - while (b * 2 + 1 < c2) { - d = (f2 = 2 * b + 1, g = f2 + 1, h = f2, g < c2 && a.a.Ne(Vmb(a.b, g), Vmb(a.b, f2)) < 0 && (h = g), h); - if (a.a.Ne(e, Vmb(a.b, d)) < 0) { - break; - } - $mb(a.b, b, Vmb(a.b, d)); - b = d; - } - $mb(a.b, b, e); - } - function oJb(a, b, c2) { - var d, e; - d = c2.d; - e = c2.e; - if (a.g[d.d] <= a.i[b.d] && a.i[b.d] <= a.i[d.d] && a.g[e.d] <= a.i[b.d] && a.i[b.d] <= a.i[e.d]) { - if (a.i[d.d] < a.i[e.d]) { - return false; - } - return true; - } - if (a.i[d.d] < a.i[e.d]) { - return true; - } + if (val1 == 0 && val2 != 0) { + return true; + } else if (val1 != 0 && val2 == 0) { + return true; + } else { return false; } - function SWb(a, b) { - var c2; - c2 = RD(mQb(b, (yCc(), oAc)), 322); - if (c2 != a) { - throw Adb(new Ked("The hierarchy aware processor " + c2 + " in child node " + b + " is only allowed if the root node specifies the same hierarchical processor.")); - } - } - function Kee(a, b) { - var c2, d, e, f2, g; - d = (!b.s && (b.s = new C5d(y7, b, 21, 17)), b.s); - f2 = null; - for (e = 0, g = d.i; e < g; ++e) { - c2 = RD(QHd(d, e), 179); - switch (yfe(Qee(a, c2))) { - case 2: - case 3: { - !f2 && (f2 = new bnb()); - ZEb(f2.c, c2); - } - } - } - return !f2 ? (yob(), yob(), vob) : f2; - } - function PQb(a, b, c2) { - var d, e, f2, g, h, i2; - i2 = oxe; - for (f2 = new Anb(nRb(a.b)); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 177); - for (h = new Anb(nRb(b.b)); h.a < h.c.c.length; ) { - g = RD(ynb(h), 177); - d = Aid(e.a, e.b, g.a, g.b, c2); - i2 = $wnd.Math.min(i2, d); - } - } - return i2; - } - function Q3b(a, b) { - if (!b) { - throw Adb(new Ngb()); - } - a.j = b; - if (!a.d) { - switch (a.j.g) { - case 1: - a.a.a = a.o.a / 2; - a.a.b = 0; - break; - case 2: - a.a.a = a.o.a; - a.a.b = a.o.b / 2; - break; - case 3: - a.a.a = a.o.a / 2; - a.a.b = a.o.b; - break; - case 4: - a.a.a = 0; - a.a.b = a.o.b / 2; - } - } - } - function Jic(a, b) { - var c2, d, e; - if (ZD(b.g, 10) && RD(b.g, 10).k == (r3b(), m3b)) { - return oxe; - } - e = $jc(b); - if (e) { - return $wnd.Math.max(0, a.b / 2 - 0.5); - } - c2 = Zjc(b); - if (c2) { - d = Kfb(UD(hFc(c2, (yCc(), bCc)))); - return $wnd.Math.max(0, d / 2 - 0.5); - } - return oxe; - } - function Lic(a, b) { - var c2, d, e; - if (ZD(b.g, 10) && RD(b.g, 10).k == (r3b(), m3b)) { - return oxe; - } - e = $jc(b); - if (e) { - return $wnd.Math.max(0, a.b / 2 - 0.5); - } - c2 = Zjc(b); - if (c2) { - d = Kfb(UD(hFc(c2, (yCc(), bCc)))); - return $wnd.Math.max(0, d / 2 - 0.5); - } - return oxe; - } - function Jkc(a, b) { - lkc(); - var c2, d, e, f2, g, h; - c2 = null; - for (g = b.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 131); - if (f2.o) { - continue; - } - d = Qid(f2.a); - e = Nid(f2.a); - h = new Nlc(d, e, null, RD(f2.d.a.ec().Kc().Pb(), 18)); - Rmb(h.c, f2.a); - ZEb(a.c, h); - !!c2 && Rmb(c2.d, h); - c2 = h; - } - } - function bmc(a) { - var b, c2, d, e, f2, g; - g = aMc(a.d, a.e); - for (f2 = g.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 12); - d = a.e == (qpd(), ppd) ? e.e : e.g; - for (c2 = new Anb(d); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 18); - if (!W0b(b) && b.c.i.c != b.d.i.c) { - Zlc(a, b); - ++a.f; - ++a.c; - } - } - } - } - function Wsc(a, b) { - var c2, d; - if (b.dc()) { - return yob(), yob(), vob; - } - d = new bnb(); - Rmb(d, sgb(qwe)); - for (c2 = 1; c2 < a.f; ++c2) { - a.a == null && usc(a); - a.a[c2] && Rmb(d, sgb(c2)); - } - if (d.c.length == 1) { - return yob(), yob(), vob; - } - Rmb(d, sgb(lve)); - return Vsc(b, d); - } - function kOc(a, b) { - var c2, d, e, f2, g, h, i2; - g = b.c.i.k != (r3b(), p3b); - i2 = g ? b.d : b.c; - c2 = U0b(b, i2).i; - e = RD(Wjb(a.k, i2), 125); - d = a.i[c2.p].a; - if ($2b(i2.i) < (!c2.c ? -1 : Wmb(c2.c.a, c2, 0))) { - f2 = e; - h = d; - } else { - f2 = d; - h = e; - } - rIb(uIb(tIb(vIb(sIb(new wIb(), 0), 4), f2), h)); - } - function ODd(a, b, c2) { - var d, e, f2, g, h, i2; - if (c2) { - e = c2.a.length; - d = new vue(e); - for (h = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); h.Ob(); ) { - g = RD(h.Pb(), 17); - i2 = uEd(a, tDd(JB(c2, g.a))); - if (i2) { - f2 = (!b.b && (b.b = new Yie(E4, b, 4, 7)), b.b); - WGd(f2, i2); - } - } - } - } - function PDd(a, b, c2) { - var d, e, f2, g, h, i2; - if (c2) { - e = c2.a.length; - d = new vue(e); - for (h = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); h.Ob(); ) { - g = RD(h.Pb(), 17); - i2 = uEd(a, tDd(JB(c2, g.a))); - if (i2) { - f2 = (!b.c && (b.c = new Yie(E4, b, 5, 8)), b.c); - WGd(f2, i2); - } - } - } - } - function Bo(a, b, c2) { - var d, e; - d = b.a & a.f; - b.b = a.b[d]; - a.b[d] = b; - e = b.f & a.f; - b.d = a.c[e]; - a.c[e] = b; - if (!c2) { - b.e = a.e; - b.c = null; - !a.e ? a.a = b : a.e.c = b; - a.e = b; - } else { - b.e = c2.e; - !b.e ? a.a = b : b.e.c = b; - b.c = c2.c; - !b.c ? a.e = b : b.c.e = b; - } - ++a.i; - ++a.g; - } - function Ir(a) { - var b, c2, d; - b = a.Pb(); - if (!a.Ob()) { - return b; - } - d = Yhb(Zhb(new bib(), "expected one element but was: <"), b); - for (c2 = 0; c2 < 4 && a.Ob(); c2++) { - Yhb((d.a += pve, d), a.Pb()); - } - a.Ob() && (d.a += ", ...", d); - d.a += ">"; - throw Adb(new agb(d.a)); - } - function cB(a) { - var b, c2; - c2 = -a.a; - b = cD(WC(hE, 1), zwe, 28, 15, [43, 48, 48, 48, 48]); - if (c2 < 0) { - b[0] = 45; - c2 = -c2; - } - b[1] = b[1] + ((c2 / 60 | 0) / 10 | 0) & Bwe; - b[2] = b[2] + (c2 / 60 | 0) % 10 & Bwe; - b[3] = b[3] + (c2 % 60 / 10 | 0) & Bwe; - b[4] = b[4] + c2 % 10 & Bwe; - return Ihb(b, 0, b.length); - } - function V2b(a) { - var b, c2, d, e; - a.g = new Zrb(RD(Qb(E3), 297)); - d = 0; - c2 = (qpd(), Yod); - b = 0; - for (; b < a.j.c.length; b++) { - e = RD(Vmb(a.j, b), 12); - if (e.j != c2) { - d != b && Wrb(a.g, c2, new Ptd(sgb(d), sgb(b))); - c2 = e.j; - d = b; - } - } - Wrb(a.g, c2, new Ptd(sgb(d), sgb(b))); - } - function u7b(a) { - var b, c2, d, e, f2, g, h; - d = 0; - for (c2 = new Anb(a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 30); - for (f2 = new Anb(b.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - e.p = d++; - for (h = new Anb(e.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - g.p = d++; - } - } - } - } - function Tvd(a, b) { - var c2, d, e; - e = Eee((lke(), jke), a.Dh(), b); - if (e) { - nke(); - RD(e, 69).xk() || (e = zfe(Qee(jke, e))); - d = (c2 = a.Ih(e), RD(c2 >= 0 ? a.Lh(c2, true, true) : Qvd(a, e, true), 160)); - RD(d, 220).Zl(b); - } else { - throw Adb(new agb(KHe + b.xe() + LHe)); - } - } - function Cib(a) { - var b, c2; - if (a > -140737488355328 && a < 140737488355328) { - if (a == 0) { - return 0; - } - b = a < 0; - b && (a = -a); - c2 = eE($wnd.Math.floor($wnd.Math.log(a) / 0.6931471805599453)); - (!b || a != $wnd.Math.pow(2, c2)) && ++c2; - return c2; - } - return Dib(Hdb(a)); - } - function oTc(a) { - var b, c2, d, e, f2, g, h; - f2 = new Iub(); - for (c2 = new Anb(a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 132); - g = b.a; - h = b.b; - if (f2.a._b(g) || f2.a._b(h)) { - continue; - } - e = g; - d = h; - if (g.e.b + g.j.b > 2 && h.e.b + h.j.b <= 2) { - e = h; - d = g; - } - f2.a.zc(e, f2); - e.q = d; - } - return f2; - } - function B5c(a, b, c2) { - c2.Ug("Eades radial", 1); - c2.dh(b, gFe); - a.d = RD(Gxd(b, (u2c(), t2c)), 27); - a.c = Kfb(UD(Gxd(b, ($4c(), S4c)))); - a.e = u5c(RD(Gxd(b, X4c), 300)); - a.a = Z3c(RD(Gxd(b, Z4c), 434)); - a.b = k5c(RD(Gxd(b, O4c), 354)); - C5c(a); - c2.dh(b, gFe); - } - function t8c(a, b) { - b.Ug("Target Width Setter", 1); - if (Hxd(a, (X7c(), W7c))) { - Ixd(a, (X6c(), W6c), UD(Gxd(a, W7c))); - } else { - throw Adb(new Jed("A target width has to be set if the TargetWidthWidthApproximator should be used.")); - } - b.Vg(); - } - function _8b(a, b) { - var c2, d, e; - d = new j3b(a); - kQb(d, b); - pQb(d, (Ywc(), gwc), b); - pQb(d, (yCc(), BBc), (Bod(), wod)); - pQb(d, Rzc, (Rjd(), Njd)); - h3b(d, (r3b(), m3b)); - c2 = new R3b(); - P3b(c2, d); - Q3b(c2, (qpd(), ppd)); - e = new R3b(); - P3b(e, d); - Q3b(e, Xod); - return d; - } - function ttc(a) { - switch (a.g) { - case 0: - return new FKc((RKc(), OKc)); - case 1: - return new aKc(); - case 2: - return new FLc(); - default: - throw Adb(new agb("No implementation is available for the crossing minimizer " + (a.f != null ? a.f : "" + a.g))); - } - } - function THc(a, b) { - var c2, d, e, f2, g; - a.c[b.p] = true; - Rmb(a.a, b); - for (g = new Anb(b.j); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 12); - for (d = new l4b(f2.b); xnb(d.a) || xnb(d.b); ) { - c2 = RD(xnb(d.a) ? ynb(d.a) : ynb(d.b), 18); - e = UHc(f2, c2).i; - a.c[e.p] || THc(a, e); - } - } - } - function J2c(a) { - var b, c2, d, e, f2, g, h; - g = 0; - for (c2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 27); - h = b.g; - e = b.f; - d = $wnd.Math.sqrt(h * h + e * e); - g = $wnd.Math.max(d, g); - f2 = J2c(b); - g = $wnd.Math.max(f2, g); - } - return g; - } - function Pod() { - Pod = geb; - Nod = new Qod("OUTSIDE", 0); - Lod = new Qod("INSIDE", 1); - Mod = new Qod("NEXT_TO_PORT_IF_POSSIBLE", 2); - Kod = new Qod("ALWAYS_SAME_SIDE", 3); - Jod = new Qod("ALWAYS_OTHER_SAME_SIDE", 4); - Ood = new Qod("SPACE_EFFICIENT", 5); - } - function DEd(a, b, c2) { - var d, e, f2, h, i2, j; - d = rEd(a, (e = (bvd(), f2 = new ACd(), f2), !!c2 && yCd(e, c2), e), b); - jyd(d, zDd(b, uIe)); - GEd(b, d); - BEd(b, d); - HEd(b, d); - h = b; - i2 = wDd(h, "ports"); - j = new hFd(a, d); - dEd(j.a, j.b, i2); - CEd(a, b, d); - xEd(a, b, d); - return d; - } - function bB(a) { - var b, c2; - c2 = -a.a; - b = cD(WC(hE, 1), zwe, 28, 15, [43, 48, 48, 58, 48, 48]); - if (c2 < 0) { - b[0] = 45; - c2 = -c2; - } - b[1] = b[1] + ((c2 / 60 | 0) / 10 | 0) & Bwe; - b[2] = b[2] + (c2 / 60 | 0) % 10 & Bwe; - b[4] = b[4] + (c2 % 60 / 10 | 0) & Bwe; - b[5] = b[5] + c2 % 10 & Bwe; - return Ihb(b, 0, b.length); - } - function eB(a) { - var b; - b = cD(WC(hE, 1), zwe, 28, 15, [71, 77, 84, 45, 48, 48, 58, 48, 48]); - if (a <= 0) { - b[3] = 43; - a = -a; - } - b[4] = b[4] + ((a / 60 | 0) / 10 | 0) & Bwe; - b[5] = b[5] + (a / 60 | 0) % 10 & Bwe; - b[7] = b[7] + (a % 60 / 10 | 0) & Bwe; - b[8] = b[8] + a % 10 & Bwe; - return Ihb(b, 0, b.length); - } - function fob(a) { - var b, c2, d, e, f2; - if (a == null) { - return vve; - } - f2 = new Jyb(pve, "[", "]"); - for (c2 = a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - !f2.a ? f2.a = new dib(f2.d) : Zhb(f2.a, f2.b); - Whb(f2.a, "" + Zdb(b)); - } - return !f2.a ? f2.c : f2.e.length == 0 ? f2.a.a : f2.a.a + ("" + f2.e); - } - function uJb(a, b) { - var c2, d, e; - e = lve; - for (d = new Anb(CIb(b)); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 218); - if (c2.f && !a.c[c2.c]) { - a.c[c2.c] = true; - e = $wnd.Math.min(e, uJb(a, oIb(c2, b))); - } - } - a.i[b.d] = a.j; - a.g[b.d] = $wnd.Math.min(e, a.j++); - return a.g[b.d]; - } - function vNb(a, b) { - var c2, d, e; - for (e = RD(RD(Qc(a.r, b), 21), 87).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 117); - d.e.b = (c2 = d.b, c2.pf((umd(), Gld)) ? c2.ag() == (qpd(), Yod) ? -c2.Mf().b - Kfb(UD(c2.of(Gld))) : Kfb(UD(c2.of(Gld))) : c2.ag() == (qpd(), Yod) ? -c2.Mf().b : 0); - } - } - function CSb(a) { - var b, c2, d, e, f2, g, h; - c2 = zRb(a.e); - f2 = ijd(njd(ajd(yRb(a.e)), a.d * a.a, a.c * a.b), -0.5); - b = c2.a - f2.a; - e = c2.b - f2.b; - for (h = 0; h < a.c; h++) { - d = b; - for (g = 0; g < a.d; g++) { - ARb(a.e, new Uid2(d, e, a.a, a.b)) && TPb(a, g, h, false, true); - d += a.a; - } - e += a.b; - } - } - function H0c(a) { - var b, c2, d, e, f2; - b = a.a; - c2 = a.b; - e = a.c; - d = new rjd(c2.e.a + c2.f.a / 2, c2.e.b + c2.f.b / 2); - f2 = new rjd(e.e.a + e.f.a / 2, e.e.b + e.f.b / 2); - Pub(b, d, b.a, b.a.a); - Pub(b, f2, b.c.b, b.c); - tWc(d, RD(ju(b, 1), 8), a.b.f); - tWc(f2, RD(ju(b, b.b - 2), 8), a.c.f); - } - function tDd(a) { - var b, c2; - c2 = false; - if (ZD(a, 211)) { - c2 = true; - return RD(a, 211).a; - } - if (!c2) { - if (ZD(a, 263)) { - b = RD(a, 263).a % 1 == 0; - if (b) { - c2 = true; - return sgb(Ofb(RD(a, 263).a)); - } - } - } - throw Adb(new CDd("Id must be a string or an integer: '" + a + "'.")); - } - function Kde(a, b) { - var c2, d, e, f2, g, h; - f2 = null; - for (e = new Xde((!a.a && (a.a = new Zde(a)), a.a)); Ude(e); ) { - c2 = RD(tId(e), 58); - d = (g = c2.Dh(), h = (mYd(g), g.o), !h || !c2.Xh(h) ? null : Hje(iXd(h), c2.Mh(h))); - if (d != null) { - if (lhb(d, b)) { - f2 = c2; - break; - } - } - } - return f2; - } - function Rw(a, b, c2) { - var d, e, f2, g, h; - dk(c2, "occurrences"); - if (c2 == 0) { - return h = RD(Xv(nd(a.a), b), 16), !h ? 0 : h.gc(); - } - g = RD(Xv(nd(a.a), b), 16); - if (!g) { - return 0; - } - f2 = g.gc(); - if (c2 >= f2) { - g.$b(); - } else { - e = g.Kc(); - for (d = 0; d < c2; d++) { - e.Pb(); - e.Qb(); - } - } - return f2; - } - function qx(a, b, c2) { - var d, e, f2, g; - dk(c2, "oldCount"); - dk(0, "newCount"); - d = RD(Xv(nd(a.a), b), 16); - if ((!d ? 0 : d.gc()) == c2) { - dk(0, "count"); - e = (f2 = RD(Xv(nd(a.a), b), 16), !f2 ? 0 : f2.gc()); - g = -e; - g > 0 ? Hh() : g < 0 && Rw(a, b, -g); - return true; - } else { - return false; - } - } - function YKb(a) { - var b, c2, d, e, f2, g, h; - h = 0; - if (a.b == 0) { - g = aLb(a, true); - b = 0; - for (d = g, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - if (c2 > 0) { - h += c2; - ++b; - } - } - b > 1 && (h += a.c * (b - 1)); - } else { - h = Vvb(SCb(HDb(CDb(_nb(a.a), new oLb()), new qLb()))); - } - return h > 0 ? h + a.n.d + a.n.a : 0; - } - function ZKb(a) { - var b, c2, d, e, f2, g, h; - h = 0; - if (a.b == 0) { - h = Vvb(SCb(HDb(CDb(_nb(a.a), new kLb()), new mLb()))); - } else { - g = bLb(a, true); - b = 0; - for (d = g, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - if (c2 > 0) { - h += c2; - ++b; - } - } - b > 1 && (h += a.c * (b - 1)); - } - return h > 0 ? h + a.n.b + a.n.c : 0; - } - function UOc(a) { - var b, c2; - if (a.c.length != 2) { - throw Adb(new dgb("Order only allowed for two paths.")); - } - b = (tFb(0, a.c.length), RD(a.c[0], 18)); - c2 = (tFb(1, a.c.length), RD(a.c[1], 18)); - if (b.d.i != c2.c.i) { - a.c.length = 0; - ZEb(a.c, c2); - ZEb(a.c, b); - } - } - function O8c(a, b, c2) { - var d; - zyd(c2, b.g, b.f); - Byd(c2, b.i, b.j); - for (d = 0; d < (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i; d++) { - O8c(a, RD(QHd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a), d), 27), RD(QHd((!c2.a && (c2.a = new C5d(J4, c2, 10, 11)), c2.a), d), 27)); - } - } - function DMb(a, b) { - var c2, d, e, f2; - f2 = RD(Vrb(a.b, b), 127); - c2 = f2.a; - for (e = RD(RD(Qc(a.r, b), 21), 87).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 117); - !!d.c && (c2.a = $wnd.Math.max(c2.a, QKb(d.c))); - } - if (c2.a > 0) { - switch (b.g) { - case 2: - f2.n.c = a.s; - break; - case 4: - f2.n.b = a.s; - } - } - } - function ETb(a, b) { - var c2, d, e; - c2 = RD(mQb(b, (yVb(), lVb)), 17).a - RD(mQb(a, lVb), 17).a; - if (c2 == 0) { - d = ojd(ajd(RD(mQb(a, (JVb(), FVb)), 8)), RD(mQb(a, GVb), 8)); - e = ojd(ajd(RD(mQb(b, FVb), 8)), RD(mQb(b, GVb), 8)); - return Qfb(d.a * d.b, e.a * e.b); - } - return c2; - } - function JVc(a, b) { - var c2, d, e; - c2 = RD(mQb(b, (h_c(), X$c)), 17).a - RD(mQb(a, X$c), 17).a; - if (c2 == 0) { - d = ojd(ajd(RD(mQb(a, (q$c(), RZc)), 8)), RD(mQb(a, SZc), 8)); - e = ojd(ajd(RD(mQb(b, RZc), 8)), RD(mQb(b, SZc), 8)); - return Qfb(d.a * d.b, e.a * e.b); - } - return c2; - } - function _0b(a) { - var b, c2; - c2 = new bib(); - c2.a += "e_"; - b = S0b(a); - b != null && (c2.a += "" + b, c2); - if (!!a.c && !!a.d) { - Zhb((c2.a += " ", c2), M3b(a.c)); - Zhb(Yhb((c2.a += "[", c2), a.c.i), "]"); - Zhb((c2.a += SAe, c2), M3b(a.d)); - Zhb(Yhb((c2.a += "[", c2), a.d.i), "]"); - } - return c2.a; - } - function ZVc(a) { - switch (a.g) { - case 0: - return new N_c(); - case 1: - return new V_c(); - case 2: - return new x0c(); - case 3: - return new J0c(); - default: - throw Adb(new agb("No implementation is available for the layout phase " + (a.f != null ? a.f : "" + a.g))); - } - } - function qsd(a, b, c2, d, e) { - var f2; - f2 = 0; - switch (e.g) { - case 1: - f2 = $wnd.Math.max(0, b.b + a.b - (c2.b + d)); - break; - case 3: - f2 = $wnd.Math.max(0, -a.b - d); - break; - case 2: - f2 = $wnd.Math.max(0, -a.a - d); - break; - case 4: - f2 = $wnd.Math.max(0, b.a + a.a - (c2.a + d)); - } - return f2; - } - function MDd(a, b, c2) { - var d, e, f2, g, h; - if (c2) { - e = c2.a.length; - d = new vue(e); - for (h = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); h.Ob(); ) { - g = RD(h.Pb(), 17); - f2 = xDd(c2, g.a); - kIe in f2.a || lIe in f2.a ? yEd(a, f2, b) : EEd(a, f2, b); - OGd(RD(Wjb(a.b, uDd(f2)), 74)); - } - } - } - function jXd(a) { - var b, c2; - switch (a.b) { - case -1: { - return true; - } - case 0: { - c2 = a.t; - if (c2 > 1 || c2 == -1) { - a.b = -1; - return true; - } else { - b = WVd(a); - if (!!b && (nke(), b.lk() == aKe)) { - a.b = -1; - return true; - } else { - a.b = 1; - return false; - } - } - } - default: - case 1: { - return false; - } - } - } - function Sqe(a, b) { - var c2, d, e, f2; - Mqe(a); - if (a.c != 0 || a.a != 123) - throw Adb(new Lqe(TId((Hde(), eJe)))); - f2 = b == 112; - d = a.d; - c2 = phb(a.i, 125, d); - if (c2 < 0) - throw Adb(new Lqe(TId((Hde(), fJe)))); - e = zhb(a.i, d, c2); - a.d = c2 + 1; - return ite(e, f2, (a.e & 512) == 512); - } - function YTb(a) { - var b, c2, d, e, f2, g, h; - d = a.a.c.length; - if (d > 0) { - g = a.c.d; - h = a.d.d; - e = ijd(ojd(new rjd(h.a, h.b), g), 1 / (d + 1)); - f2 = new rjd(g.a, g.b); - for (c2 = new Anb(a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 250); - b.d.a = f2.a + e.a; - b.d.b = f2.b + e.b; - $id(f2, e); - } - } - } - function HXd(a, b) { - var c2, d, e; - if (!b) { - JXd(a, null); - zXd(a, null); - } else if ((b.i & 4) != 0) { - d = "[]"; - for (c2 = b.c; ; c2 = c2.c) { - if ((c2.i & 4) == 0) { - e = shb((lfb(c2), c2.o + d)); - JXd(a, e); - zXd(a, e); - break; - } - d += "[]"; - } - } else { - e = shb((lfb(b), b.o)); - JXd(a, e); - zXd(a, e); - } - a.hl(b); - } - function Bge(a, b, c2, d, e) { - var f2, g, h, i2; - i2 = Age(a, RD(e, 58)); - if (dE(i2) !== dE(e)) { - h = RD(a.g[c2], 76); - f2 = oke(b, i2); - MHd(a, c2, Tge(a, c2, f2)); - if (Mvd(a.e)) { - g = fge(a, 9, f2.Lk(), e, i2, d, false); - oKd(g, new P3d(a.e, 9, a.c, h, f2, d, false)); - pKd(g); - } - return i2; - } - return e; - } - function AGc(a, b, c2) { - var d, e, f2, g, h, i2; - d = RD(Qc(a.c, b), 15); - e = RD(Qc(a.c, c2), 15); - f2 = d.fd(d.gc()); - g = e.fd(e.gc()); - while (f2.Sb() && g.Sb()) { - h = RD(f2.Ub(), 17); - i2 = RD(g.Ub(), 17); - if (h != i2) { - return hgb(h.a, i2.a); - } - } - return !f2.Ob() && !g.Ob() ? 0 : f2.Ob() ? 1 : -1; - } - function FHc(a) { - var b, c2, d, e, f2, g, h; - h = ev(a.c.length); - for (e = new Anb(a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - g = new _sb(); - f2 = a3b(d); - for (c2 = new is(Mr(f2.a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - b.c.i == b.d.i || Ysb(g, b.d.i); - } - ZEb(h.c, g); - } - return h; - } - function xhd(c2, d) { - var e, f2, g; - try { - g = xs(c2.a, d); - return g; - } catch (b) { - b = zdb(b); - if (ZD(b, 33)) { - try { - f2 = Oeb(d, qwe, lve); - e = mfb(c2.a); - if (f2 >= 0 && f2 < e.length) { - return e[f2]; - } - } catch (a) { - a = zdb(a); - if (!ZD(a, 130)) - throw Adb(a); - } - return null; - } else - throw Adb(b); - } - } - function Rvd(a, b) { - var c2, d, e; - e = Eee((lke(), jke), a.Dh(), b); - if (e) { - nke(); - RD(e, 69).xk() || (e = zfe(Qee(jke, e))); - d = (c2 = a.Ih(e), RD(c2 >= 0 ? a.Lh(c2, true, true) : Qvd(a, e, true), 160)); - return RD(d, 220).Wl(b); - } else { - throw Adb(new agb(KHe + b.xe() + NHe)); - } - } - function _ae() { - Tae(); - var a; - if (Sae) - return RD(N5d((YSd(), XSd), AKe), 2038); - RRd(UK, new hde()); - abe(); - a = RD(ZD(Xjb((YSd(), XSd), AKe), 560) ? Xjb(XSd, AKe) : new $ae(), 560); - Sae = true; - Yae(a); - Zae(a); - Zjb((hTd(), gTd), a, new cbe()); - $jb(XSd, AKe, a); - return a; - } - function Vfe(a, b) { - var c2, d, e, f2; - a.j = -1; - if (Mvd(a.e)) { - c2 = a.i; - f2 = a.i != 0; - LHd(a, b); - d = new P3d(a.e, 3, a.c, null, b, c2, f2); - e = b.zl(a.e, a.c, null); - e = Hge(a, b, e); - if (!e) { - qvd(a.e, d); - } else { - e.nj(d); - e.oj(); - } - } else { - LHd(a, b); - e = b.zl(a.e, a.c, null); - !!e && e.oj(); - } - } - function HA(a, b) { - var c2, d, e; - e = 0; - d = b[0]; - if (d >= a.length) { - return -1; - } - c2 = (BFb(d, a.length), a.charCodeAt(d)); - while (c2 >= 48 && c2 <= 57) { - e = e * 10 + (c2 - 48); - ++d; - if (d >= a.length) { - break; - } - c2 = (BFb(d, a.length), a.charCodeAt(d)); - } - d > b[0] ? b[0] = d : e = -1; - return e; - } - function mPb(a) { - var b, c2, d, e, f2; - e = RD(a.a, 17).a; - f2 = RD(a.b, 17).a; - c2 = e; - d = f2; - b = $wnd.Math.max($wnd.Math.abs(e), $wnd.Math.abs(f2)); - if (e <= 0 && e == f2) { - c2 = 0; - d = f2 - 1; - } else { - if (e == -b && f2 != b) { - c2 = f2; - d = e; - f2 >= 0 && ++c2; - } else { - c2 = -f2; - d = e; - } - } - return new Ptd(sgb(c2), sgb(d)); - } - function YPb(a, b, c2, d) { - var e, f2, g, h, i2, j; - for (e = 0; e < b.o; e++) { - f2 = e - b.j + c2; - for (g = 0; g < b.p; g++) { - h = g - b.k + d; - if ((i2 = f2, j = h, i2 += a.j, j += a.k, i2 >= 0 && j >= 0 && i2 < a.o && j < a.p) && (!QPb(b, e, g) && $Pb(a, f2, h) || PPb(b, e, g) && !_Pb(a, f2, h))) { - return true; - } - } - } - return false; - } - function jSc(a, b, c2) { - var d, e, f2, g, h; - g = a.c; - h = a.d; - f2 = xjd(cD(WC(l3, 1), Nve, 8, 0, [g.i.n, g.n, g.a])).b; - e = (f2 + xjd(cD(WC(l3, 1), Nve, 8, 0, [h.i.n, h.n, h.a])).b) / 2; - d = null; - g.j == (qpd(), Xod) ? d = new rjd(b + g.i.c.c.a + c2, e) : d = new rjd(b - c2, e); - hu(a.a, 0, d); - } - function ozd(a) { - var b, c2, d, e; - b = null; - for (d = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [(!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c)]))); gs(d); ) { - c2 = RD(hs(d), 84); - e = AGd(c2); - if (!b) { - b = e; - } else if (b != e) { - return false; - } - } - return true; - } - function SHd(a, b, c2) { - var d; - ++a.j; - if (b >= a.i) - throw Adb(new veb(MIe + b + NIe + a.i)); - if (c2 >= a.i) - throw Adb(new veb(OIe + c2 + NIe + a.i)); - d = a.g[c2]; - if (b != c2) { - b < c2 ? hib(a.g, b, a.g, b + 1, c2 - b) : hib(a.g, c2 + 1, a.g, c2, b - c2); - bD(a.g, b, d); - a.Pi(b, d, c2); - a.Ni(); - } - return d; - } - function Rc(a, b, c2) { - var d; - d = RD(a.c.xc(b), 16); - if (!d) { - d = a.ic(b); - if (d.Fc(c2)) { - ++a.d; - a.c.zc(b, d); - return true; - } else { - throw Adb(new Deb("New Collection violated the Collection spec")); - } - } else if (d.Fc(c2)) { - ++a.d; - return true; - } else { - return false; - } - } - function ngb(a) { - var b, c2, d; - if (a < 0) { - return 0; - } else if (a == 0) { - return 32; - } else { - d = -(a >> 16); - b = d >> 16 & 16; - c2 = 16 - b; - a = a >> b; - d = a - 256; - b = d >> 16 & 8; - c2 += b; - a <<= b; - d = a - qxe; - b = d >> 16 & 4; - c2 += b; - a <<= b; - d = a - Ove; - b = d >> 16 & 2; - c2 += b; - a <<= b; - d = a >> 14; - b = d & ~(d >> 1); - return c2 + 2 - b; - } - } - function RSb(a) { - HSb(); - var b, c2, d, e; - GSb = new bnb(); - FSb = new Tsb(); - ESb = new bnb(); - b = (!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a); - JSb(b); - for (e = new dMd(b); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - if (Wmb(GSb, d, 0) == -1) { - c2 = new bnb(); - Rmb(ESb, c2); - KSb(d, c2); - } - } - return ESb; - } - function sTb(a, b, c2) { - var d, e, f2, g; - a.a = c2.b.d; - if (ZD(b, 326)) { - e = IGd(RD(b, 74), false, false); - f2 = ssd(e); - d = new wTb(a); - xgb(f2, d); - lsd(f2, e); - b.of((umd(), cld)) != null && xgb(RD(b.of(cld), 75), d); - } else { - g = RD(b, 422); - g.rh(g.nh() + a.a.a); - g.sh(g.oh() + a.a.b); - } - } - function hWc(a, b) { - var c2, d, e; - e = new bnb(); - for (d = Sub(b.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 65); - c2.c.g == a.g && dE(mQb(c2.b, (h_c(), f_c))) !== dE(mQb(c2.c, f_c)) && !yDb(new SDb(null, new Swb(e, 16)), new IWc(c2)) && (ZEb(e.c, c2), true); - } - _mb(e, new KWc()); - return e; - } - function fUb(a, b, c2) { - var d, e, f2, g; - if (ZD(b, 153) && ZD(c2, 153)) { - f2 = RD(b, 153); - g = RD(c2, 153); - return a.a[f2.a][g.a] + a.a[g.a][f2.a]; - } else if (ZD(b, 250) && ZD(c2, 250)) { - d = RD(b, 250); - e = RD(c2, 250); - if (d.a == e.a) { - return RD(mQb(e.a, (yVb(), lVb)), 17).a; - } - } - return 0; - } - function q9b(a, b) { - var c2, d, e, f2, g, h, i2, j; - j = Kfb(UD(mQb(b, (yCc(), fCc)))); - i2 = a[0].n.a + a[0].o.a + a[0].d.c + j; - for (h = 1; h < a.length; h++) { - d = a[h].n; - e = a[h].o; - c2 = a[h].d; - f2 = d.a - c2.b - i2; - f2 < 0 && (d.a -= f2); - g = b.f; - g.a = $wnd.Math.max(g.a, d.a + e.a); - i2 = d.a + e.a + c2.c + j; - } - } - function Nad(a, b) { - var c2, d, e, f2, g, h; - d = RD(RD(Wjb(a.g, b.a), 42).a, 68); - e = RD(RD(Wjb(a.g, b.b), 42).a, 68); - f2 = d.b; - g = e.b; - c2 = Kid(f2, g); - if (c2 >= 0) { - return c2; - } - h = ejd(ojd(new rjd(g.c + g.b / 2, g.d + g.a / 2), new rjd(f2.c + f2.b / 2, f2.d + f2.a / 2))); - return -(oRb(f2, g) - 1) * h; - } - function ysd(a, b, c2) { - var d; - FDb(new SDb(null, (!c2.a && (c2.a = new C5d(F4, c2, 6, 6)), new Swb(c2.a, 16))), new Qsd(a, b)); - FDb(new SDb(null, (!c2.n && (c2.n = new C5d(I4, c2, 1, 7)), new Swb(c2.n, 16))), new Ssd(a, b)); - d = RD(Gxd(c2, (umd(), cld)), 75); - !!d && Bjd(d, a, b); - } - function Qvd(a, b, c2) { - var d, e, f2; - f2 = Eee((lke(), jke), a.Dh(), b); - if (f2) { - nke(); - RD(f2, 69).xk() || (f2 = zfe(Qee(jke, f2))); - e = (d = a.Ih(f2), RD(d >= 0 ? a.Lh(d, true, true) : Qvd(a, f2, true), 160)); - return RD(e, 220).Sl(b, c2); - } else { - throw Adb(new agb(KHe + b.xe() + NHe)); - } - } - function WNd(a, b, c2, d) { - var e, f2, g, h, i2; - e = a.d[b]; - if (e) { - f2 = e.g; - i2 = e.i; - if (d != null) { - for (h = 0; h < i2; ++h) { - g = RD(f2[h], 136); - if (g.Bi() == c2 && pb(d, g.ld())) { - return g; - } - } - } else { - for (h = 0; h < i2; ++h) { - g = RD(f2[h], 136); - if (dE(g.ld()) === dE(d)) { - return g; - } - } - } - } - return null; - } - function Nee(a, b) { - var c2, d, e, f2, g; - d = (!b.s && (b.s = new C5d(y7, b, 21, 17)), b.s); - f2 = null; - for (e = 0, g = d.i; e < g; ++e) { - c2 = RD(QHd(d, e), 179); - switch (yfe(Qee(a, c2))) { - case 4: - case 5: - case 6: { - !f2 && (f2 = new bnb()); - ZEb(f2.c, c2); - break; - } - } - } - return !f2 ? (yob(), yob(), vob) : f2; - } - function Yib(a, b) { - var c2; - if (b < 0) { - throw Adb(new teb("Negative exponent")); - } - if (b == 0) { - return Kib; - } else if (b == 1 || Sib(a, Kib) || Sib(a, Oib)) { - return a; - } - if (!_ib(a, 0)) { - c2 = 1; - while (!_ib(a, c2)) { - ++c2; - } - return Wib(kjb(c2 * b), Yib($ib(a, c2), b)); - } - return Rjb(a, b); - } - function Jnb(a, b) { - var c2, d, e; - if (dE(a) === dE(b)) { - return true; - } - if (a == null || b == null) { - return false; - } - if (a.length != b.length) { - return false; - } - for (c2 = 0; c2 < a.length; ++c2) { - d = a[c2]; - e = b[c2]; - if (!(dE(d) === dE(e) || d != null && pb(d, e))) { - return false; - } - } - return true; - } - function EYb(a) { - pYb(); - var b, c2, d; - this.b = oYb; - this.c = (Cmd(), Amd); - this.f = (kYb(), jYb); - this.a = a; - BYb(this, new FYb()); - uYb(this); - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 86); - if (!c2.d) { - b = new iYb(cD(WC(bQ, 1), rve, 86, 0, [c2])); - Rmb(a.a, b); - } - } - } - function U6b(a, b, c2) { - var d, e, f2, g, h, i2; - if (!a || a.c.length == 0) { - return null; - } - f2 = new VKb(b, !c2); - for (e = new Anb(a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 72); - LKb(f2, (i1b(), new D1b(d))); - } - g = f2.i; - g.a = (i2 = f2.n, f2.e.b + i2.d + i2.a); - g.b = (h = f2.n, f2.e.a + h.b + h.c); - return f2; - } - function d9b(a) { - var b, c2, d, e, f2, g, h; - h = t2b(a.a); - Znb(h, new i9b()); - c2 = null; - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - if (d.k != (r3b(), m3b)) { - break; - } - b = RD(mQb(d, (Ywc(), hwc)), 64); - if (b != (qpd(), ppd) && b != Xod) { - continue; - } - !!c2 && RD(mQb(c2, qwc), 15).Fc(d); - c2 = d; - } - } - function wTc(a, b, c2) { - var d, e, f2, g, h, i2, j; - i2 = (tFb(b, a.c.length), RD(a.c[b], 339)); - Xmb(a, b); - if (i2.b / 2 >= c2) { - d = b; - j = (i2.c + i2.a) / 2; - g = j - c2; - if (i2.c <= j - c2) { - e = new BTc(i2.c, g); - Qmb(a, d++, e); - } - h = j + c2; - if (h <= i2.a) { - f2 = new BTc(h, i2.a); - wFb(d, a.c.length); - XEb(a.c, d, f2); - } - } - } - function mZc(a, b, c2) { - var d, e, f2, g, h, i2; - if (!b.dc()) { - e = new Yub(); - for (i2 = b.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 40); - Zjb(a.a, sgb(h.g), sgb(c2)); - for (g = (d = Sub(new dXc(h).a.d, 0), new gXc(d)); dvb(g.a); ) { - f2 = RD(evb(g.a), 65).c; - Pub(e, f2, e.c.b, e.c); - } - } - mZc(a, e, c2 + 1); - } - } - function Ude(a) { - var b; - if (!a.c && a.g == null) { - a.d = a.bj(a.f); - WGd(a, a.d); - b = a.d; - } else { - if (a.g == null) { - return true; - } else if (a.i == 0) { - return false; - } else { - b = RD(a.g[a.i - 1], 51); - } - } - if (b == a.b && null.Vm >= null.Um()) { - tId(a); - return Ude(a); - } else { - return b.Ob(); - } - } - function t_b(a) { - this.a = a; - if (a.c.i.k == (r3b(), m3b)) { - this.c = a.c; - this.d = RD(mQb(a.c.i, (Ywc(), hwc)), 64); - } else if (a.d.i.k == m3b) { - this.c = a.d; - this.d = RD(mQb(a.d.i, (Ywc(), hwc)), 64); - } else { - throw Adb(new agb("Edge " + a + " is not an external edge.")); - } - } - function O1d(a, b) { - var c2, d, e; - e = a.b; - a.b = b; - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 3, e, a.b)); - if (!b) { - PAd(a, null); - Q1d(a, 0); - P1d(a, null); - } else if (b != a) { - PAd(a, b.zb); - Q1d(a, b.d); - c2 = (d = b.c, d == null ? b.zb : d); - P1d(a, c2 == null || lhb(c2, b.zb) ? null : c2); - } - } - function hj(a, b) { - var c2; - this.e = (tm(), Qb(a), tm(), zm(a)); - this.c = (Qb(b), zm(b)); - Lb(this.e.Rd().dc() == this.c.Rd().dc()); - this.d = Uv(this.e); - this.b = Uv(this.c); - c2 = YC(jJ, [Nve, rve], [5, 1], 5, [this.e.Rd().gc(), this.c.Rd().gc()], 2); - this.a = c2; - Zi(this); - } - function Lz(b) { - !Jz && (Jz = Mz()), Jz; - var d = b.replace(/[\x00-\x1f\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200b-\u200f\u2028-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb"\\]/g, function(a) { - return Kz(a); - }); - return '"' + d + '"'; - } - function VEb(a, b, c2, d, e, f2) { - var g, h, i2, j, k; - if (e == 0) { - return; - } - if (dE(a) === dE(c2)) { - a = a.slice(b, b + e); - b = 0; - } - i2 = c2; - for (h = b, j = b + e; h < j; ) { - g = $wnd.Math.min(h + 1e4, j); - e = g - h; - k = a.slice(h, g); - k.splice(0, 0, d, f2 ? e : 0); - Array.prototype.splice.apply(i2, k); - h = g; - d += e; - } - } - function VGb(a) { - FGb(); - var b, c2; - this.b = CGb; - this.c = EGb; - this.g = (wGb(), vGb); - this.d = (Cmd(), Amd); - this.a = a; - IGb(this); - for (c2 = new Anb(a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - !b.a && gGb(iGb(new jGb(), cD(WC(hN, 1), rve, 60, 0, [b])), a); - b.e = new Vid(b.d); - } - } - function yTb(a) { - var b, c2, d, e, f2, g; - e = a.e.c.length; - d = $C(QK, Ize, 15, e, 0, 1); - for (g = new Anb(a.e); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 153); - d[f2.a] = new Yub(); - } - for (c2 = new Anb(a.c); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 290); - d[b.c.a].Fc(b); - d[b.d.a].Fc(b); - } - return d; - } - function OMd(a, b) { - var c2, d, e, f2, g; - c2 = RD(Ywd(a.a, 4), 129); - g = c2 == null ? 0 : c2.length; - if (b >= g) - throw Adb(new aMd(b, g)); - e = c2[b]; - if (g == 1) { - d = null; - } else { - d = $C(d6, IJe, 424, g - 1, 0, 1); - hib(c2, 0, d, 0, b); - f2 = g - b - 1; - f2 > 0 && hib(c2, b + 1, d, b, f2); - } - Bde(a, d); - Ade(a, b, e); - return e; - } - function l3d(a) { - var b, c2; - if (a.f) { - while (a.n < a.o) { - b = RD(!a.j ? a.k.Xb(a.n) : a.j.$i(a.n), 76); - c2 = b.Lk(); - if (ZD(c2, 102) && (RD(c2, 19).Bb & QHe) != 0 && (!a.e || c2.pk() != C4 || c2.Lj() != 0) && b.md() != null) { - return true; - } else { - ++a.n; - } - } - return false; - } else { - return a.n < a.o; - } - } - function Lle() { - Lle = geb; - Jle = RD(QHd(xYd((Qle(), Ple).qb), 6), 35); - Gle = RD(QHd(xYd(Ple.qb), 3), 35); - Hle = RD(QHd(xYd(Ple.qb), 4), 35); - Ile = RD(QHd(xYd(Ple.qb), 5), 19); - vWd(Jle); - vWd(Gle); - vWd(Hle); - vWd(Ile); - Kle = new mob(cD(WC(y7, 1), lKe, 179, 0, [Jle, Gle])); - } - function rMb(a, b) { - var c2; - this.d = new P2b(); - this.b = b; - this.e = new sjd(b.Lf()); - c2 = a.u.Hc((Pod(), Mod)); - a.u.Hc(Lod) ? a.D ? this.a = c2 && !b.bg() : this.a = true : a.u.Hc(Nod) ? c2 ? this.a = !(b.Uf().Kc().Ob() || b.Wf().Kc().Ob()) : this.a = false : this.a = false; - } - function zNb(a, b) { - var c2, d, e, f2; - c2 = a.o.a; - for (f2 = RD(RD(Qc(a.r, b), 21), 87).Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 117); - e.e.a = (d = e.b, d.pf((umd(), Gld)) ? d.ag() == (qpd(), ppd) ? -d.Mf().a - Kfb(UD(d.of(Gld))) : c2 + Kfb(UD(d.of(Gld))) : d.ag() == (qpd(), ppd) ? -d.Mf().a : c2); - } - } - function $4b(a, b) { - var c2, d, e, f2; - c2 = RD(mQb(a, (yCc(), rAc)), 88); - f2 = RD(Gxd(b, GBc), 64); - e = RD(mQb(a, BBc), 101); - if (e != (Bod(), zod) && e != Aod) { - if (f2 == (qpd(), opd)) { - f2 = osd(b, c2); - f2 == opd && (f2 = vpd(c2)); - } - } else { - d = W4b(b); - d > 0 ? f2 = vpd(c2) : f2 = spd(vpd(c2)); - } - Ixd(b, GBc, f2); - } - function agc(a, b) { - var c2; - b.Ug("Partition preprocessing", 1); - c2 = RD(zDb(CDb(EDb(CDb(new SDb(null, new Swb(a.a, 16)), new egc()), new ggc()), new igc()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - FDb(c2.Oc(), new kgc()); - b.Vg(); - } - function Uoc(a, b) { - var c2, d, e, f2, g; - g = a.j; - b.a != b.b && _mb(g, new ypc()); - e = g.c.length / 2 | 0; - for (d = 0; d < e; d++) { - f2 = (tFb(d, g.c.length), RD(g.c[d], 113)); - f2.c && Q3b(f2.d, b.a); - } - for (c2 = e; c2 < g.c.length; c2++) { - f2 = (tFb(c2, g.c.length), RD(g.c[c2], 113)); - f2.c && Q3b(f2.d, b.b); - } - } - function rLc(a, b, c2) { - var d, e, f2; - d = a.c[b.c.p][b.p]; - e = a.c[c2.c.p][c2.p]; - if (d.a != null && e.a != null) { - f2 = Jfb(d.a, e.a); - f2 < 0 ? uLc(a, b, c2) : f2 > 0 && uLc(a, c2, b); - return f2; - } else if (d.a != null) { - uLc(a, b, c2); - return -1; - } else if (e.a != null) { - uLc(a, c2, b); - return 1; - } - return 0; - } - function EVc(a, b) { - var c2, d, e, f2, g; - e = b.b.b; - a.a = $C(QK, Ize, 15, e, 0, 1); - a.b = $C(xdb, Hye, 28, e, 16, 1); - for (g = Sub(b.b, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 40); - a.a[f2.g] = new Yub(); - } - for (d = Sub(b.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 65); - a.a[c2.b.g].Fc(c2); - a.a[c2.c.g].Fc(c2); - } - } - function SJd(a, b) { - var c2, d, e, f2; - if (a.Pj()) { - c2 = a.Ej(); - f2 = a.Qj(); - ++a.j; - a.qj(c2, a.Zi(c2, b)); - d = a.Ij(3, null, b, c2, f2); - if (a.Mj()) { - e = a.Nj(b, null); - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } else { - a.Jj(d); - } - } else { - _Id(a, b); - if (a.Mj()) { - e = a.Nj(b, null); - !!e && e.oj(); - } - } - } - function oLd(a, b, c2) { - var d, e, f2; - if (a.Pj()) { - f2 = a.Qj(); - KHd(a, b, c2); - d = a.Ij(3, null, c2, b, f2); - if (a.Mj()) { - e = a.Nj(c2, null); - a.Tj() && (e = a.Uj(c2, e)); - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } else { - a.Jj(d); - } - } else { - KHd(a, b, c2); - if (a.Mj()) { - e = a.Nj(c2, null); - !!e && e.oj(); - } - } - } - function bge(a, b) { - var c2, d, e, f2, g; - g = pke(a.e.Dh(), b); - e = new YHd(); - c2 = RD(a.g, 124); - for (f2 = a.i; --f2 >= 0; ) { - d = c2[f2]; - g.am(d.Lk()) && WGd(e, d); - } - !wLd(a, e) && Mvd(a.e) && eZd(a, b.Jk() ? fge(a, 6, b, (yob(), vob), null, -1, false) : fge(a, b.tk() ? 2 : 1, b, null, null, -1, false)); - } - function _7b(a, b) { - var c2, d, e, f2, g; - if (a.a == ($uc(), Yuc)) { - return true; - } - f2 = b.a.c; - c2 = b.a.c + b.a.b; - if (b.j) { - d = b.A; - g = d.c.c.a - d.o.a / 2; - e = f2 - (d.n.a + d.o.a); - if (e > g) { - return false; - } - } - if (b.q) { - d = b.C; - g = d.c.c.a - d.o.a / 2; - e = d.n.a - c2; - if (e > g) { - return false; - } - } - return true; - } - function bRc(a) { - WQc(); - var b, c2, d, e, f2, g, h; - c2 = new gub(); - for (e = new Anb(a.e.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - for (g = new Anb(d.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - h = a.g[f2.p]; - b = RD(cub(c2, h), 15); - if (!b) { - b = new bnb(); - dub(c2, h, b); - } - b.Fc(f2); - } - } - return c2; - } - function Qzd(a) { - var b; - if ((a.Db & 64) != 0) - return awd(a); - b = new Shb(awd(a)); - b.a += " (startX: "; - Khb(b, a.j); - b.a += ", startY: "; - Khb(b, a.k); - b.a += ", endX: "; - Khb(b, a.b); - b.a += ", endY: "; - Khb(b, a.c); - b.a += ", identifier: "; - Nhb(b, a.d); - b.a += ")"; - return b.a; - } - function cWd(a) { - var b; - if ((a.Db & 64) != 0) - return QAd(a); - b = new Shb(QAd(a)); - b.a += " (ordered: "; - Ohb(b, (a.Bb & 256) != 0); - b.a += ", unique: "; - Ohb(b, (a.Bb & 512) != 0); - b.a += ", lowerBound: "; - Lhb(b, a.s); - b.a += ", upperBound: "; - Lhb(b, a.t); - b.a += ")"; - return b.a; - } - function uBd(a, b, c2, d, e, f2, g, h) { - var i2; - ZD(a.Cb, 90) && v$d(yYd(RD(a.Cb, 90)), 4); - PAd(a, c2); - a.f = d; - DWd(a, e); - FWd(a, f2); - xWd(a, g); - EWd(a, false); - aWd(a, true); - AWd(a, h); - _Vd(a, true); - $Vd(a, 0); - a.b = 0; - bWd(a, 1); - i2 = XVd(a, b, null); - !!i2 && i2.oj(); - kXd(a, false); - return a; - } - function ZAb(a, b) { - var c2, d, e, f2; - c2 = RD(Xjb(a.a, b), 525); - if (!c2) { - d = new oBb(b); - e = (gBb(), dBb) ? null : d.c; - f2 = zhb(e, 0, $wnd.Math.max(0, thb(e, Fhb(46)))); - nBb(d, ZAb(a, f2)); - (dBb ? null : d.c).length == 0 && iBb(d, new rBb()); - $jb(a.a, dBb ? null : d.c, d); - return d; - } - return c2; - } - function sRb(a, b) { - var c2; - a.b = b; - a.g = new bnb(); - c2 = tRb(a.b); - a.e = c2; - a.f = c2; - a.c = Heb(TD(mQb(a.b, (YHb(), RHb)))); - a.a = UD(mQb(a.b, (umd(), Dkd))); - a.a == null && (a.a = 1); - Kfb(a.a) > 1 ? a.e *= Kfb(a.a) : a.f /= Kfb(a.a); - uRb(a); - vRb(a); - rRb(a); - pQb(a.b, (tSb(), lSb), a.g); - } - function n9b(a, b, c2) { - var d, e, f2, g, h, i2; - d = 0; - i2 = c2; - if (!b) { - d = c2 * (a.c.length - 1); - i2 *= -1; - } - for (f2 = new Anb(a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - pQb(e, (yCc(), Rzc), (Rjd(), Njd)); - e.o.a = d; - for (h = e3b(e, (qpd(), Xod)).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 12); - g.n.a = d; - } - d += i2; - } - } - function gZd(a, b, c2) { - var d, e, f2, g, h, i2; - h = a.pl(c2); - if (h != c2) { - g = a.g[b]; - i2 = h; - MHd(a, b, a.Zi(b, i2)); - f2 = g; - a.Ri(b, i2, f2); - if (a.al()) { - d = c2; - e = a.Oj(d, null); - !RD(h, 54).Ph() && (e = a.Nj(i2, e)); - !!e && e.oj(); - } - Mvd(a.e) && eZd(a, a.Ij(9, c2, h, b, false)); - return h; - } else { - return c2; - } - } - function rYb(a, b) { - var c2, d, e, f2; - for (d = new Anb(a.a.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 194); - c2.g = true; - } - for (f2 = new Anb(a.a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 86); - e.k = Heb(TD(a.e.Kb(new Ptd(e, b)))); - e.d.g = e.d.g & Heb(TD(a.e.Kb(new Ptd(e, b)))); - } - return a; - } - function Rdc(a, b) { - var c2, d; - if (a.c.length != 0) { - if (a.c.length == 2) { - Qdc((tFb(0, a.c.length), RD(a.c[0], 10)), (Pnd(), Lnd)); - Qdc((tFb(1, a.c.length), RD(a.c[1], 10)), Mnd); - } else { - for (d = new Anb(a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - Qdc(c2, b); - } - } - a.c.length = 0; - } - } - function Vnc(a) { - var b, c2, d, e, f2; - c2 = (b = RD(mfb(E3), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)); - f2 = RD(mQb(a, (Ywc(), Iwc)), 10); - if (f2) { - for (e = new Anb(f2.j); e.a < e.c.c.length; ) { - d = RD(ynb(e), 12); - dE(mQb(d, Awc)) === dE(a) && k4b(new l4b(d.b)) && zsb(c2, d.j); - } - } - return c2; - } - function CGc(a, b, c2) { - var d, e, f2, g, h; - if (a.d[c2.p]) { - return; - } - for (e = new is(Mr(a3b(c2).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - h = d.d.i; - for (g = new is(Mr(Z2b(h).a.Kc(), new ir())); gs(g); ) { - f2 = RD(hs(g), 18); - f2.c.i == b && (a.a[f2.p] = true); - } - CGc(a, b, h); - } - a.d[c2.p] = true; - } - function Zwd(a, b) { - var c2, d, e, f2, g, h, i2; - d = ggb(a.Db & 254); - if (d == 1) { - a.Eb = null; - } else { - f2 = SD(a.Eb); - if (d == 2) { - e = Xwd(a, b); - a.Eb = f2[e == 0 ? 1 : 0]; - } else { - g = $C(jJ, rve, 1, d - 1, 5, 1); - for (c2 = 2, h = 0, i2 = 0; c2 <= 128; c2 <<= 1) { - c2 == b ? ++h : (a.Db & c2) != 0 && (g[i2++] = f2[h++]); - } - a.Eb = g; - } - } - a.Db &= ~b; - } - function rse(a) { - var b; - b = 0; - switch (a) { - case 105: - b = 2; - break; - case 109: - b = 8; - break; - case 115: - b = 4; - break; - case 120: - b = 16; - break; - case 117: - b = 32; - break; - case 119: - b = 64; - break; - case 70: - b = 256; - break; - case 72: - b = 128; - break; - case 88: - b = 512; - break; - case 44: - b = gwe; - } - return b; - } - function Ojb(a, b, c2, d, e) { - var f2, g, h, i2; - if (dE(a) === dE(b) && d == e) { - Tjb(a, d, c2); - return; - } - for (h = 0; h < d; h++) { - g = 0; - f2 = a[h]; - for (i2 = 0; i2 < e; i2++) { - g = Bdb(Bdb(Ndb(Cdb(f2, yxe), Cdb(b[i2], yxe)), Cdb(c2[h + i2], yxe)), Cdb(Ydb(g), yxe)); - c2[h + i2] = Ydb(g); - g = Udb(g, 32); - } - c2[h + e] = Ydb(g); - } - } - function tRb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - k = 0; - j = 0; - e = a.a; - h = e.a.gc(); - for (d = e.a.ec().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 567); - b = (c2.b && CRb(c2), c2.a); - l = b.a; - g = b.b; - k += l + g; - j += l * g; - } - i2 = $wnd.Math.sqrt(400 * h * j - 4 * j + k * k) + k; - f2 = 2 * (100 * h - 1); - if (f2 == 0) { - return i2; - } - return i2 / f2; - } - function MSc(a, b) { - if (b.b != 0) { - isNaN(a.s) ? a.s = Kfb((sFb(b.b != 0), UD(b.a.a.c))) : a.s = $wnd.Math.min(a.s, Kfb((sFb(b.b != 0), UD(b.a.a.c)))); - isNaN(a.c) ? a.c = Kfb((sFb(b.b != 0), UD(b.c.b.c))) : a.c = $wnd.Math.max(a.c, Kfb((sFb(b.b != 0), UD(b.c.b.c)))); - } - } - function nzd(a) { - var b, c2, d, e; - b = null; - for (d = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [(!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c)]))); gs(d); ) { - c2 = RD(hs(d), 84); - e = AGd(c2); - if (!b) { - b = vCd(e); - } else if (b != vCd(e)) { - return true; - } - } - return false; - } - function pLd(a, b) { - var c2, d, e, f2; - if (a.Pj()) { - c2 = a.i; - f2 = a.Qj(); - LHd(a, b); - d = a.Ij(3, null, b, c2, f2); - if (a.Mj()) { - e = a.Nj(b, null); - a.Tj() && (e = a.Uj(b, e)); - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } else { - a.Jj(d); - } - } else { - LHd(a, b); - if (a.Mj()) { - e = a.Nj(b, null); - !!e && e.oj(); - } - } - } - function ZQb(a, b) { - var c2, d, e, f2; - f2 = rAb(a.a, b.b); - if (!f2) { - throw Adb(new dgb("Invalid hitboxes for scanline overlap calculation.")); - } - e = false; - for (d = a.a.a.ec().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 68); - if (UQb(b.b, c2)) { - bbd(a.b.a, b.b, c2); - e = true; - } else { - if (e) { - break; - } - } - } - } - function whd(a) { - var b; - if (!a.a) { - throw Adb(new dgb("IDataType class expected for layout option " + a.f)); - } - b = GId(a.a); - if (b == null) { - throw Adb(new dgb("Couldn't create new instance of property '" + a.f + "'. " + DGe + (lfb(b6), b6.k) + EGe)); - } - return RD(b, 423); - } - function yvd(a) { - var b, c2, d, e, f2; - f2 = a.Ph(); - if (f2) { - if (f2.Vh()) { - e = Vvd(a, f2); - if (e != f2) { - c2 = a.Fh(); - d = (b = a.Fh(), b >= 0 ? a.Ah(null) : a.Ph().Th(a, -1 - b, null, null)); - a.Bh(RD(e, 54), c2); - !!d && d.oj(); - a.vh() && a.wh() && c2 > -1 && qvd(a, new N3d(a, 9, c2, f2, e)); - return e; - } - } - } - return f2; - } - function stb(a, b) { - var c2, d, e, f2, g; - f2 = a.b.Ce(b); - d = (c2 = a.a.get(f2), c2 == null ? $C(jJ, rve, 1, 0, 5, 1) : c2); - for (g = 0; g < d.length; g++) { - e = d[g]; - if (a.b.Be(b, e.ld())) { - if (d.length == 1) { - d.length = 0; - Btb(a.a, f2); - } else { - d.splice(g, 1); - } - --a.c; - ++a.b.g; - return e.md(); - } - } - return null; - } - function pWb(a) { - var b, c2, d, e, f2, g, h, i2; - g = 0; - f2 = a.f.e; - for (d = 0; d < f2.c.length; ++d) { - h = (tFb(d, f2.c.length), RD(f2.c[d], 153)); - for (e = d + 1; e < f2.c.length; ++e) { - i2 = (tFb(e, f2.c.length), RD(f2.c[e], 153)); - c2 = bjd(h.d, i2.d); - b = c2 - a.a[h.a][i2.a]; - g += a.i[h.a][i2.a] * b * b; - } - } - return g; - } - function oec(a, b) { - var c2; - if (nQb(b, (yCc(), UAc))) { - return; - } - c2 = wec(RD(mQb(b, hec), 371), RD(mQb(a, UAc), 171)); - pQb(b, hec, c2); - if (gs(new is(Mr(W2b(b).a.Kc(), new ir())))) { - return; - } - switch (c2.g) { - case 1: - pQb(b, UAc, (cxc(), Zwc)); - break; - case 2: - pQb(b, UAc, (cxc(), _wc)); - } - } - function aoc(a, b) { - var c2; - Snc(a); - a.a = (c2 = new Ri(), FDb(new SDb(null, new Swb(b.d, 16)), new zoc(c2)), c2); - Xnc(a, RD(mQb(b.b, (yCc(), CAc)), 349)); - Znc(a); - Ync(a); - Wnc(a); - $nc(a); - _nc(a, b); - FDb(EDb(new SDb(null, gj(ej(a.b).a)), new poc()), new roc()); - b.a = false; - a.a = null; - } - function B$c() { - B$c = geb; - r$c = new lGd(REe, (Geb(), false)); - s$c = new lGd(SEe, 7); - sgb(0); - y$c = new lGd(TEe, sgb(0)); - v$c = new lGd(UEe, sgb(-1)); - A$c = (s_c(), r_c); - z$c = new lGd(VEe, A$c); - u$c = (LZc(), IZc); - t$c = new lGd(WEe, u$c); - x$c = (A_c(), z_c); - w$c = new lGd(XEe, x$c); - } - function _Bd() { - FBd.call(this, $He, (bvd(), avd)); - this.p = null; - this.a = null; - this.f = null; - this.n = null; - this.g = null; - this.c = null; - this.i = null; - this.j = null; - this.d = null; - this.b = null; - this.e = null; - this.k = null; - this.o = null; - this.s = null; - this.q = false; - this.r = false; - } - function aGd() { - aGd = geb; - _Fd = new bGd(FBe, 0); - YFd = new bGd("INSIDE_SELF_LOOPS", 1); - ZFd = new bGd("MULTI_EDGES", 2); - XFd = new bGd("EDGE_LABELS", 3); - $Fd = new bGd("PORTS", 4); - VFd = new bGd("COMPOUND", 5); - UFd = new bGd("CLUSTERS", 6); - WFd = new bGd("DISCONNECTED", 7); - } - function RJd(a, b, c2) { - var d, e, f2; - if (a.Pj()) { - f2 = a.Qj(); - ++a.j; - a.qj(b, a.Zi(b, c2)); - d = a.Ij(3, null, c2, b, f2); - if (a.Mj()) { - e = a.Nj(c2, null); - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } else { - a.Jj(d); - } - } else { - ++a.j; - a.qj(b, a.Zi(b, c2)); - if (a.Mj()) { - e = a.Nj(c2, null); - !!e && e.oj(); - } - } - } - function _ib(a, b) { - var c2, d, e; - if (b == 0) { - return (a.a[0] & 1) != 0; - } - if (b < 0) { - throw Adb(new teb("Negative bit address")); - } - e = b >> 5; - if (e >= a.d) { - return a.e < 0; - } - c2 = a.a[e]; - b = 1 << (b & 31); - if (a.e < 0) { - d = Uib(a); - if (e < d) { - return false; - } else - d == e ? c2 = -c2 : c2 = ~c2; - } - return (c2 & b) != 0; - } - function Zdd(a, b, c2, d) { - var e; - RD(c2.b, 68); - RD(c2.b, 68); - RD(d.b, 68); - RD(d.b, 68); - e = ojd(ajd(RD(c2.b, 68).c), RD(d.b, 68).c); - kjd(e, PQb(RD(c2.b, 68), RD(d.b, 68), e)); - RD(d.b, 68); - RD(d.b, 68); - RD(d.b, 68).c.a + e.a; - RD(d.b, 68).c.b + e.b; - RD(d.b, 68); - Umb(d.a, new ced(a, b, d)); - } - function V$d(a, b) { - var c2, d, e, f2, g, h, i2; - f2 = b.e; - if (f2) { - c2 = yvd(f2); - d = RD(a.g, 689); - for (g = 0; g < a.i; ++g) { - i2 = d[g]; - if (h2d(i2) == c2) { - e = (!i2.d && (i2.d = new XZd(o7, i2, 1)), i2.d); - h = RD(c2.Mh(jwd(f2, f2.Cb, f2.Db >> 16)), 15).dd(f2); - if (h < e.i) { - return V$d(a, RD(QHd(e, h), 89)); - } - } - } - } - return b; - } - function feb(a, b, c2) { - var d = eeb, h; - var e = d[a]; - var f2 = e instanceof Array ? e[0] : null; - if (e && !f2) { - _2 = e; - } else { - _2 = (h = b && b.prototype, !h && (h = eeb[b]), ieb(h)); - _2.Sm = c2; - !b && (_2.Tm = keb); - d[a] = _2; - } - for (var g = 3; g < arguments.length; ++g) { - arguments[g].prototype = _2; - } - f2 && (_2.Rm = f2); - } - function gs(a) { - var b; - while (!RD(Qb(a.a), 51).Ob()) { - a.d = fs(a); - if (!a.d) { - return false; - } - a.a = RD(a.d.Pb(), 51); - if (ZD(a.a, 38)) { - b = RD(a.a, 38); - a.a = b.a; - !a.b && (a.b = new wmb()); - hmb(a.b, a.d); - if (b.b) { - while (!nmb(b.b)) { - hmb(a.b, RD(tmb(b.b), 51)); - } - } - a.d = b.d; - } - } - return true; - } - function xJb(a, b) { - var c2, d, e, f2; - e = 1; - b.j = true; - f2 = null; - for (d = new Anb(CIb(b)); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 218); - if (!a.c[c2.c]) { - a.c[c2.c] = true; - f2 = oIb(c2, b); - if (c2.f) { - e += xJb(a, f2); - } else if (!f2.j && c2.a == c2.e.e - c2.d.e) { - c2.f = true; - Ysb(a.p, c2); - e += xJb(a, f2); - } - } - } - return e; - } - function OYb(a) { - var b, c2, d; - for (c2 = new Anb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - d = (uFb(0), 0); - if (d > 0) { - !(Dmd(a.a.c) && b.n.d) && !(Emd(a.a.c) && b.n.b) && (b.g.d += $wnd.Math.max(0, d / 2 - 0.5)); - !(Dmd(a.a.c) && b.n.a) && !(Emd(a.a.c) && b.n.c) && (b.g.a -= d - 1); - } - } - } - function c7b(a) { - var b, c2, d, e, f2; - e = new bnb(); - f2 = d7b(a, e); - b = RD(mQb(a, (Ywc(), Iwc)), 10); - if (b) { - for (d = new Anb(b.j); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 12); - dE(mQb(c2, Awc)) === dE(a) && (f2 = $wnd.Math.max(f2, d7b(c2, e))); - } - } - e.c.length == 0 || pQb(a, ywc, f2); - return f2 != -1 ? e : null; - } - function rcc(a, b, c2) { - var d, e, f2, g, h, i2; - f2 = RD(Vmb(b.e, 0), 18).c; - d = f2.i; - e = d.k; - i2 = RD(Vmb(c2.g, 0), 18).d; - g = i2.i; - h = g.k; - e == (r3b(), o3b) ? pQb(a, (Ywc(), vwc), RD(mQb(d, vwc), 12)) : pQb(a, (Ywc(), vwc), f2); - h == o3b ? pQb(a, (Ywc(), wwc), RD(mQb(g, wwc), 12)) : pQb(a, (Ywc(), wwc), i2); - } - function ysc(a) { - var b, c2, d; - this.c = a; - d = RD(mQb(a, (yCc(), rAc)), 88); - b = Kfb(UD(mQb(a, Tzc))); - c2 = Kfb(UD(mQb(a, oCc))); - d == (Cmd(), ymd) || d == zmd || d == Amd ? this.b = b * c2 : this.b = 1 / (b * c2); - this.j = Kfb(UD(mQb(a, cCc))); - this.e = Kfb(UD(mQb(a, bCc))); - this.f = a.b.c.length; - } - function BD(a, b) { - var c2, d, e, f2, g; - b &= 63; - c2 = a.h; - d = (c2 & fxe) != 0; - d && (c2 |= -1048576); - if (b < 22) { - g = c2 >> b; - f2 = a.m >> b | c2 << 22 - b; - e = a.l >> b | a.m << 22 - b; - } else if (b < 44) { - g = d ? exe : 0; - f2 = c2 >> b - 22; - e = a.m >> b - 22 | c2 << 44 - b; - } else { - g = d ? exe : 0; - f2 = d ? dxe : 0; - e = c2 >> b - 44; - } - return hD(e & dxe, f2 & dxe, g & exe); - } - function ORb(a) { - var b, c2, d, e, f2, g; - this.c = new bnb(); - this.d = a; - d = oxe; - e = oxe; - b = pxe; - c2 = pxe; - for (g = Sub(a, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 8); - d = $wnd.Math.min(d, f2.a); - e = $wnd.Math.min(e, f2.b); - b = $wnd.Math.max(b, f2.a); - c2 = $wnd.Math.max(c2, f2.b); - } - this.a = new Uid2(d, e, b - d, c2 - e); - } - function Udc(a, b) { - var c2, d, e, f2, g, h; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - for (h = new Anb(e.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - g.k == (r3b(), n3b) && Qdc(g, b); - for (d = new is(Mr(a3b(g).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - Pdc(c2, b); - } - } - } - } - function nec(a, b) { - var c2, d, e; - b.Ug("Layer constraint preprocessing", 1); - c2 = new bnb(); - e = new Jkb(a.a, 0); - while (e.b < e.d.gc()) { - d = (sFb(e.b < e.d.gc()), RD(e.d.Xb(e.c = e.b++), 10)); - if (mec(d)) { - kec(d); - ZEb(c2.c, d); - Ckb(e); - } - } - c2.c.length == 0 || pQb(a, (Ywc(), lwc), c2); - b.Vg(); - } - function $Hc(a) { - var b, c2; - a.e = $C(kE, Pwe, 28, a.p.c.length, 15, 1); - a.k = $C(kE, Pwe, 28, a.p.c.length, 15, 1); - for (c2 = new Anb(a.p); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - a.e[b.p] = Kr(new is(Mr(Z2b(b).a.Kc(), new ir()))); - a.k[b.p] = Kr(new is(Mr(a3b(b).a.Kc(), new ir()))); - } - } - function bIc(a) { - var b, c2, d, e, f2, g; - e = 0; - a.q = new bnb(); - b = new _sb(); - for (g = new Anb(a.p); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - f2.p = e; - for (d = new is(Mr(a3b(f2).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - Ysb(b, c2.d.i); - } - b.a.Bc(f2) != null; - Rmb(a.q, new btb(b)); - b.a.$b(); - ++e; - } - } - function pPd(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - if (a.a.f > 0 && ZD(b, 44)) { - a.a._j(); - j = RD(b, 44); - i2 = j.ld(); - f2 = i2 == null ? 0 : tb(i2); - g = bOd(a.a, f2); - c2 = a.a.d[g]; - if (c2) { - d = RD(c2.g, 379); - k = c2.i; - for (h = 0; h < k; ++h) { - e = d[h]; - if (e.Bi() == f2 && e.Fb(j)) { - pPd(a, j); - return true; - } - } - } - } - return false; - } - function Nje(a) { - var b, c2, d, e, f2, g, h; - b = a.qi(AKe); - if (b) { - h = WD($Nd((!b.b && (b.b = new SVd((JTd(), FTd), C8, b)), b.b), "settingDelegates")); - if (h != null) { - c2 = new bnb(); - for (e = vhb(h, "\\w+"), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - ZEb(c2.c, d); - } - return c2; - } - } - return yob(), yob(), vob; - } - function Ync(a) { - var b, c2, d, e; - for (e = RD(Qc(a.a, (Bnc(), ync)), 15).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 105); - c2 = (b = Ec(d.k), b.Hc((qpd(), Yod)) ? b.Hc(Xod) ? b.Hc(npd) ? b.Hc(ppd) ? null : Jnc : Lnc : Knc : Inc); - Qnc(a, d, c2[0], (joc(), goc), 0); - Qnc(a, d, c2[1], hoc, 1); - Qnc(a, d, c2[2], ioc, 1); - } - } - function Kqc(a, b) { - var c2, d; - c2 = Lqc(b); - Oqc(a, b, c2); - UTc(a.a, RD(mQb(Y2b(b.b), (Ywc(), Lwc)), 234)); - Jqc(a); - Iqc(a, b); - d = $C(kE, Pwe, 28, b.b.j.c.length, 15, 1); - Rqc(a, b, (qpd(), Yod), d, c2); - Rqc(a, b, Xod, d, c2); - Rqc(a, b, npd, d, c2); - Rqc(a, b, ppd, d, c2); - a.a = null; - a.c = null; - a.b = null; - } - function Yyd(a, b, c2) { - switch (b) { - case 7: - !a.e && (a.e = new Yie(G4, a, 7, 4)); - sLd(a.e); - !a.e && (a.e = new Yie(G4, a, 7, 4)); - YGd(a.e, RD(c2, 16)); - return; - case 8: - !a.d && (a.d = new Yie(G4, a, 8, 5)); - sLd(a.d); - !a.d && (a.d = new Yie(G4, a, 8, 5)); - YGd(a.d, RD(c2, 16)); - return; - } - xyd(a, b, c2); - } - function Rt(a, b) { - var c2, d, e, f2, g; - if (dE(b) === dE(a)) { - return true; - } - if (!ZD(b, 15)) { - return false; - } - g = RD(b, 15); - if (a.gc() != g.gc()) { - return false; - } - f2 = g.Kc(); - for (d = a.Kc(); d.Ob(); ) { - c2 = d.Pb(); - e = f2.Pb(); - if (!(dE(c2) === dE(e) || c2 != null && pb(c2, e))) { - return false; - } - } - return true; - } - function jac(a, b) { - var c2, d, e, f2; - f2 = RD(zDb(EDb(EDb(new SDb(null, new Swb(b.b, 16)), new pac()), new rac()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - f2.Jc(new tac()); - c2 = 0; - for (e = f2.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 12); - d.p == -1 && iac(a, d, c2++); - } - } - function KDc(a) { - switch (a.g) { - case 0: - return new iQc(); - case 1: - return new DNc(); - case 2: - return new TNc(); - case 3: - return new aRc(); - case 4: - return new yOc(); - default: - throw Adb(new agb("No implementation is available for the node placer " + (a.f != null ? a.f : "" + a.g))); - } - } - function Qtc(a) { - switch (a.g) { - case 0: - return new UFc(); - case 1: - return new NFc(); - case 2: - return new cGc(); - case 3: - return new jGc(); - case 4: - return new YFc(); - default: - throw Adb(new agb("No implementation is available for the cycle breaker " + (a.f != null ? a.f : "" + a.g))); - } - } - function I_c(a, b) { - var c2, d, e, f2, g; - d = new Yub(); - Pub(d, b, d.c.b, d.c); - do { - c2 = (sFb(d.b != 0), RD(Wub(d, d.a.a), 40)); - a.b[c2.g] = 1; - for (f2 = Sub(c2.d, 0); f2.b != f2.d.c; ) { - e = RD(evb(f2), 65); - g = e.c; - a.b[g.g] == 1 ? Mub(a.a, e) : a.b[g.g] == 2 ? a.b[g.g] = 1 : Pub(d, g, d.c.b, d.c); - } - } while (d.b != 0); - } - function $$b(a, b, c2) { - var d; - d = null; - !!b && (d = b.d); - k_b(a, new eZb(b.n.a - d.b + c2.a, b.n.b - d.d + c2.b)); - k_b(a, new eZb(b.n.a - d.b + c2.a, b.n.b + b.o.b + d.a + c2.b)); - k_b(a, new eZb(b.n.a + b.o.a + d.c + c2.a, b.n.b - d.d + c2.b)); - k_b(a, new eZb(b.n.a + b.o.a + d.c + c2.a, b.n.b + b.o.b + d.a + c2.b)); - } - function iac(a, b, c2) { - var d, e, f2; - b.p = c2; - for (f2 = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [new T3b(b), new _3b(b)]))); gs(f2); ) { - d = RD(hs(f2), 12); - d.p == -1 && iac(a, d, c2); - } - if (b.i.k == (r3b(), o3b)) { - for (e = new Anb(b.i.j); e.a < e.c.c.length; ) { - d = RD(ynb(e), 12); - d != b && d.p == -1 && iac(a, d, c2); - } - } - } - function cRc(a, b) { - var c2, d, e, f2, g, h; - d = new gub(); - g = Xx(new mob(a.g)); - for (f2 = g.a.ec().Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 10); - if (!e) { - b.bh("There are no classes in a balanced layout."); - break; - } - h = a.j[e.p]; - c2 = RD(cub(d, h), 15); - if (!c2) { - c2 = new bnb(); - dub(d, h, c2); - } - c2.Fc(e); - } - return d; - } - function RTc(a) { - var b, c2, d, e, f2; - e = RD(zDb(BDb(ODb(a)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - d = Hze; - if (e.gc() >= 2) { - c2 = e.Kc(); - b = UD(c2.Pb()); - while (c2.Ob()) { - f2 = b; - b = UD(c2.Pb()); - d = $wnd.Math.min(d, (uFb(b), b) - (uFb(f2), f2)); - } - } - return d; - } - function iWc(a, b) { - var c2, d, e; - e = new bnb(); - for (d = Sub(b.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 65); - c2.b.g == a.g && !lhb(c2.b.c, IEe) && dE(mQb(c2.b, (h_c(), f_c))) !== dE(mQb(c2.c, f_c)) && !yDb(new SDb(null, new Swb(e, 16)), new OWc(c2)) && (ZEb(e.c, c2), true); - } - _mb(e, new QWc()); - return e; - } - function $u(a, b) { - var c2, d, e; - if (dE(b) === dE(Qb(a))) { - return true; - } - if (!ZD(b, 15)) { - return false; - } - d = RD(b, 15); - e = a.gc(); - if (e != d.gc()) { - return false; - } - if (ZD(d, 59)) { - for (c2 = 0; c2 < e; c2++) { - if (!Hb(a.Xb(c2), d.Xb(c2))) { - return false; - } - } - return true; - } else { - return Cr(a.Kc(), d.Kc()); - } - } - function Scc(a, b, c2, d, e, f2) { - var g, h, i2, j; - h = !QDb(CDb(a.Oc(), new PAb(new Wcc()))).Bd((xDb(), wDb)); - g = a; - f2 == (Cmd(), Bmd) && (g = hv(g)); - for (j = g.Kc(); j.Ob(); ) { - i2 = RD(j.Pb(), 72); - i2.n.a = b.a; - h ? i2.n.b = b.b + (d.b - i2.o.b) / 2 : e ? i2.n.b = b.b : i2.n.b = b.b + d.b - i2.o.b; - b.a += i2.o.a + c2; - } - } - function Tgc(a, b) { - var c2, d, e, f2, g; - b.Ug("Port side processing", 1); - for (g = new Anb(a.a); g.a < g.c.c.length; ) { - e = RD(ynb(g), 10); - Ugc(e); - } - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - Ugc(e); - } - } - b.Vg(); - } - function bEd(a, b, c2) { - var d, e, f2, g, h, i2, j; - if (c2) { - f2 = c2.a.length; - d = new vue(f2); - for (h = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); h.Ob(); ) { - g = RD(h.Pb(), 17); - i2 = xDd(c2, g.a); - if (i2) { - j = FGd(zDd(i2, hIe), b); - Zjb(a.f, j, i2); - e = uIe in i2.a; - e && jyd(j, zDd(i2, uIe)); - GEd(i2, j); - HEd(i2, j); - } - } - } - } - function MWb(a, b, c2) { - var d, e, f2, g, h; - h = c2; - !h && (h = Nqd(new Oqd(), 0)); - h.Ug(EAe, 1); - cXb(a.c, b); - g = H_b(a.a, b); - if (g.gc() == 1) { - OWb(RD(g.Xb(0), 36), h); - } else { - f2 = 1 / g.gc(); - for (e = g.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 36); - if (c2.$g()) { - return; - } - OWb(d, h.eh(f2)); - } - } - F_b(a.a, g, b); - PWb(b); - h.Vg(); - } - function Hic(a, b, c2) { - var d, e, f2, g, h; - e = a.f; - !e && (e = RD(a.a.a.ec().Kc().Pb(), 60)); - Iic(e, b, c2); - if (a.a.a.gc() == 1) { - return; - } - d = b * c2; - for (g = a.a.a.ec().Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 60); - if (f2 != e) { - h = $jc(f2); - if (h.f.d) { - f2.d.d += d + Tye; - f2.d.a -= d + Tye; - } else - h.f.a && (f2.d.a -= d + Tye); - } - } - } - function kTb(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n; - g = c2 - a; - h = d - b; - f2 = $wnd.Math.atan2(g, h); - i2 = f2 + Gze; - j = f2 - Gze; - k = e * $wnd.Math.sin(i2) + a; - m = e * $wnd.Math.cos(i2) + b; - l = e * $wnd.Math.sin(j) + a; - n = e * $wnd.Math.cos(j) + b; - return dv(cD(WC(l3, 1), Nve, 8, 0, [new rjd(k, m), new rjd(l, n)])); - } - function mQc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l; - e = c2; - k = b; - f2 = k; - do { - f2 = a.a[f2.p]; - h = (l = a.g[f2.p], Kfb(a.p[l.p]) + Kfb(a.d[f2.p]) - f2.d.d); - i2 = pQc(f2, d); - if (i2) { - g = (j = a.g[i2.p], Kfb(a.p[j.p]) + Kfb(a.d[i2.p]) + i2.o.b + i2.d.a); - e = $wnd.Math.min(e, h - (g + bFc(a.k, f2, i2))); - } - } while (k != f2); - return e; - } - function nQc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l; - e = c2; - k = b; - f2 = k; - do { - f2 = a.a[f2.p]; - g = (l = a.g[f2.p], Kfb(a.p[l.p]) + Kfb(a.d[f2.p]) + f2.o.b + f2.d.a); - i2 = oQc(f2, d); - if (i2) { - h = (j = a.g[i2.p], Kfb(a.p[j.p]) + Kfb(a.d[i2.p]) - i2.d.d); - e = $wnd.Math.min(e, h - (g + bFc(a.k, f2, i2))); - } - } while (k != f2); - return e; - } - function r9c(a, b) { - var c2; - b.Ug("Equal Whitespace Eliminator", 1); - if (Hxd(a, (X6c(), V6c))) { - w9c(RD(Gxd(a, V6c), 15), Kfb(UD(Gxd(a, O6c))), (c2 = Kfb(UD(Gxd(a, M6c))), Kfb(UD(Gxd(a, (X7c(), Q7c)))), c2)); - } else { - throw Adb(new Jed("The graph does not contain rows.")); - } - b.Vg(); - } - function Gxd(a, b) { - var c2, d; - d = (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), $Nd(a.o, b)); - if (d != null) { - return d; - } - c2 = b.Sg(); - ZD(c2, 4) && (c2 == null ? (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), jOd(a.o, b)) : (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), fOd(a.o, b, c2)), a); - return c2; - } - function dod() { - dod = geb; - Xnd = new eod("H_LEFT", 0); - Wnd = new eod("H_CENTER", 1); - Znd = new eod("H_RIGHT", 2); - cod = new eod("V_TOP", 3); - bod = new eod("V_CENTER", 4); - aod = new eod("V_BOTTOM", 5); - $nd = new eod("INSIDE", 6); - _nd = new eod("OUTSIDE", 7); - Ynd = new eod("H_PRIORITY", 8); - } - function jJb(a, b) { - var c2, d, e, f2, g, h, i2; - if (!b.f) { - throw Adb(new agb("The input edge is not a tree edge.")); - } - f2 = null; - e = lve; - for (d = new Anb(a.d); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 218); - h = c2.d; - i2 = c2.e; - if (oJb(a, h, b) && !oJb(a, i2, b)) { - g = i2.e - h.e - c2.a; - if (g < e) { - e = g; - f2 = c2; - } - } - } - return f2; - } - function sWb(a) { - var b, c2, d, e, f2, g; - if (a.f.e.c.length <= 1) { - return; - } - b = 0; - e = pWb(a); - c2 = oxe; - do { - b > 0 && (e = c2); - for (g = new Anb(a.f.e); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 153); - if (Heb(TD(mQb(f2, (dWb(), WVb))))) { - continue; - } - d = oWb(a, f2); - $id(hjd(f2.d), d); - } - c2 = pWb(a); - } while (!rWb(a, b++, e, c2)); - } - function Ymc(a, b) { - var c2, d, e, f2, g; - f2 = a.g.a; - g = a.g.b; - for (d = new Anb(a.d); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 72); - e = c2.n; - a.a == (enc(), bnc) || a.i == (qpd(), Xod) ? e.a = f2 : a.a == cnc || a.i == (qpd(), ppd) ? e.a = f2 + a.j.a - c2.o.a : e.a = f2 + (a.j.a - c2.o.a) / 2; - e.b = g; - $id(e, b); - g += c2.o.b + a.e; - } - } - function BEd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - j = a; - i2 = yDd(j, "individualSpacings"); - if (i2) { - d = Hxd(b, (umd(), amd)); - g = !d; - if (g) { - e = new dtd(); - Ixd(b, amd, e); - } - h = RD(Gxd(b, amd), 385); - l = i2; - f2 = null; - !!l && (f2 = (k = oC(l, $C(qJ, Nve, 2, 0, 6, 1)), new CC(l, k))); - if (f2) { - c2 = new dFd(l, h); - xgb(f2, c2); - } - } - } - function FEd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - i2 = null; - l = a; - k = null; - if (DIe in l.a || EIe in l.a || nIe in l.a) { - j = null; - m = EGd(b); - g = yDd(l, DIe); - c2 = new gFd(m); - cEd(c2.a, g); - h = yDd(l, EIe); - d = new AFd(m); - nEd(d.a, h); - f2 = wDd(l, nIe); - e = new DFd(m); - j = (oEd(e.a, f2), f2); - k = j; - } - i2 = k; - return i2; - } - function ox(a, b) { - var c2, d, e; - if (b === a) { - return true; - } - if (ZD(b, 552)) { - e = RD(b, 849); - if (a.a.d != e.a.d || Ih(a).gc() != Ih(e).gc()) { - return false; - } - for (d = Ih(e).Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 425); - if (Qw(a, c2.a.ld()) != RD(c2.a.md(), 16).gc()) { - return false; - } - } - return true; - } - return false; - } - function sPb(a) { - var b, c2, d, e; - d = RD(a.a, 17).a; - e = RD(a.b, 17).a; - b = d; - c2 = e; - if (d == 0 && e == 0) { - c2 -= 1; - } else { - if (d == -1 && e <= 0) { - b = 0; - c2 -= 2; - } else { - if (d <= 0 && e > 0) { - b -= 1; - c2 -= 1; - } else { - if (d >= 0 && e < 0) { - b += 1; - c2 += 1; - } else { - if (d > 0 && e >= 0) { - b -= 1; - c2 += 1; - } else { - b += 1; - c2 -= 1; - } - } - } - } - } - return new Ptd(sgb(b), sgb(c2)); - } - function nNc(a, b) { - if (a.c < b.c) { - return -1; - } else if (a.c > b.c) { - return 1; - } else if (a.b < b.b) { - return -1; - } else if (a.b > b.b) { - return 1; - } else if (a.a != b.a) { - return tb(a.a) - tb(b.a); - } else if (a.d == (sNc(), rNc) && b.d == qNc) { - return -1; - } else if (a.d == qNc && b.d == rNc) { - return 1; - } - return 0; - } - function ARc(a, b) { - var c2, d, e, f2, g; - f2 = b.a; - f2.c.i == b.b ? g = f2.d : g = f2.c; - f2.c.i == b.b ? d = f2.c : d = f2.d; - e = lQc(a.a, g, d); - if (e > 0 && e < Hze) { - c2 = mQc(a.a, d.i, e, a.c); - rQc(a.a, d.i, -c2); - return c2 > 0; - } else if (e < 0 && -e < Hze) { - c2 = nQc(a.a, d.i, -e, a.c); - rQc(a.a, d.i, c2); - return c2 > 0; - } - return false; - } - function X9c(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l; - e = (b - a.d) / a.c.c.length; - f2 = 0; - a.a += c2; - a.d = b; - for (l = new Anb(a.c); l.a < l.c.c.length; ) { - k = RD(ynb(l), 27); - j = k.g; - i2 = k.f; - Dyd(k, k.i + f2 * e); - Eyd(k, k.j + d * c2); - Cyd(k, k.g + e); - Ayd(k, a.a); - ++f2; - h = k.g; - g = k.f; - Jsd(k, new rjd(h, g), new rjd(j, i2)); - } - } - function vAd(a) { - var b, c2, d, e, f2, g, h; - if (a == null) { - return null; - } - h = a.length; - e = (h + 1) / 2 | 0; - g = $C(gE, YHe, 28, e, 15, 1); - h % 2 != 0 && (g[--e] = JAd((BFb(h - 1, a.length), a.charCodeAt(h - 1)))); - for (c2 = 0, d = 0; c2 < e; ++c2) { - b = JAd(ihb(a, d++)); - f2 = JAd(ihb(a, d++)); - g[c2] = (b << 4 | f2) << 24 >> 24; - } - return g; - } - function Bfb(a) { - if (a.ze()) { - var b = a.c; - b.Ae() ? a.o = "[" + b.n : !b.ze() ? a.o = "[L" + b.xe() + ";" : a.o = "[" + b.xe(); - a.b = b.we() + "[]"; - a.k = b.ye() + "[]"; - return; - } - var c2 = a.j; - var d = a.d; - d = d.split("/"); - a.o = Efb(".", [c2, Efb("$", d)]); - a.b = Efb(".", [c2, Efb(".", d)]); - a.k = d[d.length - 1]; - } - function hJb(a, b) { - var c2, d, e, f2, g; - g = null; - for (f2 = new Anb(a.e.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 125); - if (e.b.a.c.length == e.g.a.c.length) { - d = e.e; - g = sJb(e); - for (c2 = e.e - RD(g.a, 17).a + 1; c2 < e.e + RD(g.b, 17).a; c2++) { - b[c2] < b[d] && (d = c2); - } - if (b[d] < b[e.e]) { - --b[e.e]; - ++b[d]; - e.e = d; - } - } - } - } - function qQc(a) { - var b, c2, d, e, f2, g, h, i2; - e = oxe; - d = pxe; - for (c2 = new Anb(a.e.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 30); - for (g = new Anb(b.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - i2 = Kfb(a.p[f2.p]); - h = i2 + Kfb(a.b[a.g[f2.p].p]); - e = $wnd.Math.min(e, i2); - d = $wnd.Math.max(d, h); - } - } - return d - e; - } - function nSd(a) { - gSd(); - var b, c2, d, e; - d = qhb(a, Fhb(35)); - b = d == -1 ? a : (AFb(0, d, a.length), a.substr(0, d)); - c2 = d == -1 ? null : (BFb(d + 1, a.length + 1), a.substr(d + 1)); - e = KSd(fSd, b); - if (!e) { - e = ASd(b); - LSd(fSd, b, e); - c2 != null && (e = hSd(e, c2)); - } else - c2 != null && (e = hSd(e, (uFb(c2), c2))); - return e; - } - function Ree(a, b, c2, d) { - var e, f2, g, h, j; - e = Fee(a, b); - for (h = 0, j = e.gc(); h < j; ++h) { - f2 = RD(e.Xb(h), 179); - if (lhb(d, Afe(Qee(a, f2)))) { - g = Bfe(Qee(a, f2)); - if (c2 == null) { - if (g == null) { - return f2; - } - } else if (lhb(c2, g)) { - return f2; - } else - ; - } - } - return null; - } - function See(a, b, c2, d) { - var e, f2, g, h, j; - e = Gee(a, b); - for (h = 0, j = e.gc(); h < j; ++h) { - f2 = RD(e.Xb(h), 179); - if (lhb(d, Afe(Qee(a, f2)))) { - g = Bfe(Qee(a, f2)); - if (c2 == null) { - if (g == null) { - return f2; - } - } else if (lhb(c2, g)) { - return f2; - } else - ; - } - } - return null; - } - function Pge(a, b, c2) { - var d, e, f2, g, h, i2; - g = new YHd(); - h = pke(a.e.Dh(), b); - d = RD(a.g, 124); - nke(); - if (RD(b, 69).xk()) { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - h.am(e.Lk()) && WGd(g, e); - } - } else { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (h.am(e.Lk())) { - i2 = e.md(); - WGd(g, c2 ? Bge(a, b, f2, g.i, i2) : i2); - } - } - } - return WHd(g); - } - function Kje(a) { - var b, c2, d, e, f2, g, h; - if (a) { - b = a.qi(AKe); - if (b) { - g = WD($Nd((!b.b && (b.b = new SVd((JTd(), FTd), C8, b)), b.b), "conversionDelegates")); - if (g != null) { - h = new bnb(); - for (d = vhb(g, "\\w+"), e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - ZEb(h.c, c2); - } - return h; - } - } - } - return yob(), yob(), vob; - } - function WXb(a, b) { - var c2, d, e, f2, g, h, i2, j; - g = b == 1 ? MXb : LXb; - for (f2 = g.a.ec().Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 88); - for (i2 = RD(Qc(a.f.c, e), 21).Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 42); - d = RD(h.b, 86); - j = RD(h.a, 194); - c2 = j.c; - switch (e.g) { - case 2: - case 1: - d.g.d += c2; - break; - case 4: - case 3: - d.g.c += c2; - } - } - } - } - function idc(a, b) { - var c2, d, e, f2, g; - c2 = new Zrb(ZW); - for (e = (btc(), cD(WC(ZW, 1), jwe, 232, 0, [Zsc, _sc, Ysc, $sc, atc, Xsc])), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - Xrb(c2, d, new bnb()); - } - FDb(GDb(CDb(EDb(new SDb(null, new Swb(a.b, 16)), new ydc()), new Adc()), new Cdc(b)), new Edc(c2)); - return c2; - } - function n3c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - for (f2 = b.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 27); - k = e.i + e.g / 2; - m = e.j + e.f / 2; - i2 = a.f; - g = i2.i + i2.g / 2; - h = i2.j + i2.f / 2; - j = k - g; - l = m - h; - d = $wnd.Math.sqrt(j * j + l * l); - j *= a.e / d; - l *= a.e / d; - if (c2) { - k -= j; - m -= l; - } else { - k += j; - m += l; - } - Dyd(e, k - e.g / 2); - Eyd(e, m - e.f / 2); - } - } - function vte(a) { - var b, c2, d; - if (a.c) - return; - if (a.b == null) - return; - for (b = a.b.length - 4; b >= 0; b -= 2) { - for (c2 = 0; c2 <= b; c2 += 2) { - if (a.b[c2] > a.b[c2 + 2] || a.b[c2] === a.b[c2 + 2] && a.b[c2 + 1] > a.b[c2 + 3]) { - d = a.b[c2 + 2]; - a.b[c2 + 2] = a.b[c2]; - a.b[c2] = d; - d = a.b[c2 + 3]; - a.b[c2 + 3] = a.b[c2 + 1]; - a.b[c2 + 1] = d; - } - } - } - a.c = true; - } - function nKc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - j = -1; - k = 0; - for (g = a, h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - c2 = new hrc(j == -1 ? a[0] : a[j], b, (lDc(), kDc)); - for (d = 0; d < f2.length; d++) { - for (e = d + 1; e < f2.length; e++) { - nQb(f2[d], (Ywc(), zwc)) && nQb(f2[e], zwc) && crc(c2, f2[d], f2[e]) > 0 && ++k; - } - } - ++j; - } - return k; - } - function awd(a) { - var b, c2; - c2 = new dib(nfb(a.Rm)); - c2.a += "@"; - Zhb(c2, (b = tb(a) >>> 0, b.toString(16))); - if (a.Vh()) { - c2.a += " (eProxyURI: "; - Yhb(c2, a._h()); - if (a.Kh()) { - c2.a += " eClass: "; - Yhb(c2, a.Kh()); - } - c2.a += ")"; - } else if (a.Kh()) { - c2.a += " (eClass: "; - Yhb(c2, a.Kh()); - c2.a += ")"; - } - return c2.a; - } - function KGb(a) { - var b, c2, d, e; - if (a.e) { - throw Adb(new dgb((lfb(lN), lye + lN.k + mye))); - } - a.d == (Cmd(), Amd) && JGb(a, ymd); - for (c2 = new Anb(a.a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 316); - b.g = b.i; - } - for (e = new Anb(a.a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 60); - d.i = pxe; - } - a.b.cf(a); - return a; - } - function rUc(a, b) { - var c2, d, e, f2, g; - if (b < 2 * a.b) { - throw Adb(new agb("The knot vector must have at least two time the dimension elements.")); - } - a.f = 1; - for (e = 0; e < a.b; e++) { - Rmb(a.e, 0); - } - g = b + 1 - 2 * a.b; - c2 = g; - for (f2 = 1; f2 < g; f2++) { - Rmb(a.e, f2 / c2); - } - if (a.d) { - for (d = 0; d < a.b; d++) { - Rmb(a.e, 1); - } - } - } - function AEd(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - j = b; - k = RD(lp(Co(a.i), j), 27); - if (!k) { - e = zDd(j, uIe); - h = "Unable to find elk node for json object '" + e; - i2 = h + "' Panic!"; - throw Adb(new CDd(i2)); - } - f2 = wDd(j, "edges"); - c2 = new KEd(a, k); - MDd(c2.a, c2.b, f2); - g = wDd(j, iIe); - d = new VEd(a); - XDd(d.a, g); - } - function XNd(a, b, c2, d) { - var e, f2, g, h, i2; - if (d != null) { - e = a.d[b]; - if (e) { - f2 = e.g; - i2 = e.i; - for (h = 0; h < i2; ++h) { - g = RD(f2[h], 136); - if (g.Bi() == c2 && pb(d, g.ld())) { - return h; - } - } - } - } else { - e = a.d[b]; - if (e) { - f2 = e.g; - i2 = e.i; - for (h = 0; h < i2; ++h) { - g = RD(f2[h], 136); - if (dE(g.ld()) === dE(d)) { - return h; - } - } - } - } - return -1; - } - function N5d(a, b) { - var c2, d, e; - c2 = b == null ? Wd(qtb(a.f, null)) : Ktb(a.i, b); - if (ZD(c2, 241)) { - e = RD(c2, 241); - e.zi() == null && void 0; - return e; - } else if (ZD(c2, 507)) { - d = RD(c2, 2037); - e = d.a; - !!e && (e.yb == null ? void 0 : b == null ? rtb(a.f, null, e) : Ltb(a.i, b, e)); - return e; - } else { - return null; - } - } - function Hqe(a) { - Gqe(); - var b, c2, d, e, f2, g, h; - if (a == null) - return null; - e = a.length; - if (e % 2 != 0) - return null; - b = Ahb(a); - f2 = e / 2 | 0; - c2 = $C(gE, YHe, 28, f2, 15, 1); - for (d = 0; d < f2; d++) { - g = Eqe[b[d * 2]]; - if (g == -1) - return null; - h = Eqe[b[d * 2 + 1]]; - if (h == -1) - return null; - c2[d] = (g << 4 | h) << 24 >> 24; - } - return c2; - } - function cNb(a, b, c2) { - var d, e, f2; - e = RD(Vrb(a.i, b), 314); - if (!e) { - e = new UKb(a.d, b, c2); - Wrb(a.i, b, e); - if (jMb(b)) { - tKb(a.a, b.c, b.b, e); - } else { - f2 = iMb(b); - d = RD(Vrb(a.p, f2), 252); - switch (f2.g) { - case 1: - case 3: - e.j = true; - cLb(d, b.b, e); - break; - case 4: - case 2: - e.k = true; - cLb(d, b.c, e); - } - } - } - return e; - } - function Ndc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - i2 = ev(a.c - a.b & a.a.length - 1); - j = null; - k = null; - for (f2 = new Kmb(a); f2.a != f2.b; ) { - e = RD(Imb(f2), 10); - c2 = (h = RD(mQb(e, (Ywc(), vwc)), 12), !h ? null : h.i); - d = (g = RD(mQb(e, wwc), 12), !g ? null : g.i); - if (j != c2 || k != d) { - Rdc(i2, b); - j = c2; - k = d; - } - ZEb(i2.c, e); - } - Rdc(i2, b); - } - function Rge(a, b, c2, d) { - var e, f2, g, h, i2, j; - h = new YHd(); - i2 = pke(a.e.Dh(), b); - e = RD(a.g, 124); - nke(); - if (RD(b, 69).xk()) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - i2.am(f2.Lk()) && WGd(h, f2); - } - } else { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i2.am(f2.Lk())) { - j = f2.md(); - WGd(h, d ? Bge(a, b, g, h.i, j) : j); - } - } - } - return XHd(h, c2); - } - function oHc(a, b) { - var c2, d, e, f2, g, h, i2, j; - e = a.b[b.p]; - if (e >= 0) { - return e; - } else { - f2 = 1; - for (h = new Anb(b.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - for (d = new Anb(g.g); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - j = c2.d.i; - if (b != j) { - i2 = oHc(a, j); - f2 = $wnd.Math.max(f2, i2 + 1); - } - } - } - nHc(a, b, f2); - return f2; - } - } - function wHc(a, b) { - var c2, d, e, f2, g, h, i2, j; - e = a.b[b.p]; - if (e >= 0) { - return e; - } else { - f2 = 1; - for (h = new Anb(b.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - for (d = new Anb(g.e); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - j = c2.c.i; - if (b != j) { - i2 = wHc(a, j); - f2 = $wnd.Math.max(f2, i2 + 1); - } - } - } - vHc(a, b, f2); - return f2; - } - } - function wLc(a, b, c2) { - var d, e, f2; - for (d = 1; d < a.c.length; d++) { - f2 = (tFb(d, a.c.length), RD(a.c[d], 10)); - e = d; - while (e > 0 && b.Ne((tFb(e - 1, a.c.length), RD(a.c[e - 1], 10)), f2) > 0) { - $mb(a, e, (tFb(e - 1, a.c.length), RD(a.c[e - 1], 10))); - --e; - } - tFb(e, a.c.length); - a.c[e] = f2; - } - c2.a = new Tsb(); - c2.b = new Tsb(); - } - function yhd(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - k = (d = RD(b.e && b.e(), 9), new Fsb(d, RD(WEb(d, d.length), 9), 0)); - i2 = vhb(c2, "[\\[\\]\\s,]+"); - for (f2 = i2, g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - if (Dhb(e).length == 0) { - continue; - } - j = xhd(a, e); - if (j == null) { - return null; - } else { - zsb(k, RD(j, 22)); - } - } - return k; - } - function tse(a) { - var b, c2, d, e; - e = a.length; - b = null; - for (d = 0; d < e; d++) { - c2 = (BFb(d, a.length), a.charCodeAt(d)); - if (qhb(".*+?{[()|\\^$", Fhb(c2)) >= 0) { - if (!b) { - b = new Rhb(); - d > 0 && Nhb(b, (AFb(0, d, a.length), a.substr(0, d))); - } - b.a += "\\"; - Jhb(b, c2 & Bwe); - } else - !!b && Jhb(b, c2 & Bwe); - } - return b ? b.a : a; - } - function MYb(a) { - var b, c2, d; - for (c2 = new Anb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - d = (uFb(0), 0); - if (d > 0) { - !(Dmd(a.a.c) && b.n.d) && !(Emd(a.a.c) && b.n.b) && (b.g.d -= $wnd.Math.max(0, d / 2 - 0.5)); - !(Dmd(a.a.c) && b.n.a) && !(Emd(a.a.c) && b.n.c) && (b.g.a += $wnd.Math.max(0, d - 1)); - } - } - } - function Ydc(a, b, c2) { - var d, e; - if ((a.c - a.b & a.a.length - 1) == 2) { - if (b == (qpd(), Yod) || b == Xod) { - Odc(RD(omb(a), 15), (Pnd(), Lnd)); - Odc(RD(omb(a), 15), Mnd); - } else { - Odc(RD(omb(a), 15), (Pnd(), Mnd)); - Odc(RD(omb(a), 15), Lnd); - } - } else { - for (e = new Kmb(a); e.a != e.b; ) { - d = RD(Imb(e), 15); - Odc(d, c2); - } - } - } - function HGd(a, b) { - var c2, d, e, f2, g, h, i2; - e = cv(new QGd(a)); - h = new Jkb(e, e.c.length); - f2 = cv(new QGd(b)); - i2 = new Jkb(f2, f2.c.length); - g = null; - while (h.b > 0 && i2.b > 0) { - c2 = (sFb(h.b > 0), RD(h.a.Xb(h.c = --h.b), 27)); - d = (sFb(i2.b > 0), RD(i2.a.Xb(i2.c = --i2.b), 27)); - if (c2 == d) { - g = c2; - } else { - break; - } - } - return g; - } - function Dmc(a, b, c2) { - var d, e, f2, g; - if (Hmc(a, b) > Hmc(a, c2)) { - d = b3b(c2, (qpd(), Xod)); - a.d = d.dc() ? 0 : L3b(RD(d.Xb(0), 12)); - g = b3b(b, ppd); - a.b = g.dc() ? 0 : L3b(RD(g.Xb(0), 12)); - } else { - e = b3b(c2, (qpd(), ppd)); - a.d = e.dc() ? 0 : L3b(RD(e.Xb(0), 12)); - f2 = b3b(b, Xod); - a.b = f2.dc() ? 0 : L3b(RD(f2.Xb(0), 12)); - } - } - function wNb(a, b) { - var c2, d, e, f2; - c2 = a.o.a; - for (f2 = RD(RD(Qc(a.r, b), 21), 87).Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 117); - e.e.a = c2 * Kfb(UD(e.b.of(sNb))); - e.e.b = (d = e.b, d.pf((umd(), Gld)) ? d.ag() == (qpd(), Yod) ? -d.Mf().b - Kfb(UD(d.of(Gld))) : Kfb(UD(d.of(Gld))) : d.ag() == (qpd(), Yod) ? -d.Mf().b : 0); - } - } - function Mhc(a, b) { - var c2, d, e, f2; - b.Ug("Self-Loop pre-processing", 1); - for (d = new Anb(a.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - if (pnc(c2)) { - e = (f2 = new onc(c2), pQb(c2, (Ywc(), Pwc), f2), lnc(f2), f2); - FDb(GDb(EDb(new SDb(null, new Swb(e.d, 16)), new Phc()), new Rhc()), new Thc()); - Khc(e); - } - } - b.Vg(); - } - function xsc(a) { - var b, c2, d, e, f2, g, h, i2; - b = true; - e = null; - f2 = null; - j: - for (i2 = new Anb(a.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - for (d = new is(Mr(Z2b(h).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - if (!!e && e != h) { - b = false; - break j; - } - e = h; - g = c2.c.i; - if (!!f2 && f2 != g) { - b = false; - break j; - } - f2 = g; - } - } - return b; - } - function mTc(a, b, c2) { - var d, e, f2, g, h, i2; - f2 = -1; - h = -1; - for (g = 0; g < b.c.length; g++) { - e = (tFb(g, b.c.length), RD(b.c[g], 339)); - if (e.c > a.c) { - break; - } else if (e.a >= a.s) { - f2 < 0 && (f2 = g); - h = g; - } - } - i2 = (a.s + a.c) / 2; - if (f2 >= 0) { - d = lTc(a, b, f2, h); - i2 = yTc((tFb(d, b.c.length), RD(b.c[d], 339))); - wTc(b, d, c2); - } - return i2; - } - function _Ad(a, b, c2) { - var d, e, f2, g, h, i2, j; - g = (f2 = new pVd(), f2); - nVd(g, (uFb(b), b)); - j = (!g.b && (g.b = new SVd((JTd(), FTd), C8, g)), g.b); - for (i2 = 1; i2 < c2.length; i2 += 2) { - fOd(j, c2[i2 - 1], c2[i2]); - } - d = (!a.Ab && (a.Ab = new C5d(f7, a, 0, 3)), a.Ab); - for (h = 0; h < 0; ++h) { - e = jVd(RD(QHd(d, d.i - 1), 598)); - d = e; - } - WGd(d, g); - } - function DSb(a, b, c2) { - var d, e, f2; - jQb.call(this, new bnb()); - this.a = b; - this.b = c2; - this.e = a; - d = (a.b && CRb(a), a.a); - this.d = BSb(d.a, this.a); - this.c = BSb(d.b, this.b); - bQb(this, this.d, this.c); - CSb(this); - for (f2 = this.e.e.a.ec().Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 272); - e.c.c.length > 0 && ASb(this, e); - } - } - function zTb(a, b, c2, d, e, f2) { - var g, h, i2; - if (!e[b.a]) { - e[b.a] = true; - g = d; - !g && (g = new gUb()); - Rmb(g.e, b); - for (i2 = f2[b.a].Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 290); - if (h.d == c2 || h.c == c2) { - continue; - } - h.c != b && zTb(a, h.c, b, g, e, f2); - h.d != b && zTb(a, h.d, b, g, e, f2); - Rmb(g.c, h); - Tmb(g.d, h.b); - } - return g; - } - return null; - } - function v7b(a) { - var b, c2, d, e, f2, g, h; - b = 0; - for (e = new Anb(a.e); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - c2 = yDb(new SDb(null, new Swb(d.b, 16)), new N7b()); - c2 && ++b; - } - for (g = new Anb(a.g); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 18); - h = yDb(new SDb(null, new Swb(f2.b, 16)), new P7b()); - h && ++b; - } - return b >= 2; - } - function _qc(a, b, c2, d, e) { - var f2, g, h, i2, j, k; - f2 = a.c.d.j; - g = RD(ju(c2, 0), 8); - for (k = 1; k < c2.b; k++) { - j = RD(ju(c2, k), 8); - Pub(d, g, d.c.b, d.c); - h = ijd($id(new sjd(g), j), 0.5); - i2 = ijd(new qjd(BVc(f2)), e); - $id(h, i2); - Pub(d, h, d.c.b, d.c); - g = j; - f2 = b == 0 ? tpd(f2) : rpd(f2); - } - Mub(d, (sFb(c2.b != 0), RD(c2.c.b.c, 8))); - } - function fod(a) { - dod(); - var b, c2, d; - c2 = ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [_nd])); - if (dy(Tx(c2, a)) > 1) { - return false; - } - b = ysb(Xnd, cD(WC(A3, 1), jwe, 95, 0, [Wnd, Znd])); - if (dy(Tx(b, a)) > 1) { - return false; - } - d = ysb(cod, cD(WC(A3, 1), jwe, 95, 0, [bod, aod])); - if (dy(Tx(d, a)) > 1) { - return false; - } - return true; - } - function $Uc(a, b, c2) { - var d, e, f2; - for (f2 = new Anb(a.t); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 274); - if (d.b.s < 0 && d.c > 0) { - d.b.n -= d.c; - d.b.n <= 0 && d.b.u > 0 && Mub(b, d.b); - } - } - for (e = new Anb(a.i); e.a < e.c.c.length; ) { - d = RD(ynb(e), 274); - if (d.a.s < 0 && d.c > 0) { - d.a.u -= d.c; - d.a.u <= 0 && d.a.n > 0 && Mub(c2, d.a); - } - } - } - function tId(a) { - var b, c2, d, e, f2; - if (a.g == null) { - a.d = a.bj(a.f); - WGd(a, a.d); - if (a.c) { - f2 = a.f; - return f2; - } - } - b = RD(a.g[a.i - 1], 51); - e = b.Pb(); - a.e = b; - c2 = a.bj(e); - if (c2.Ob()) { - a.d = c2; - WGd(a, c2); - } else { - a.d = null; - while (!b.Ob()) { - bD(a.g, --a.i, null); - if (a.i == 0) { - break; - } - d = RD(a.g[a.i - 1], 51); - b = d; - } - } - return e; - } - function Rfe(a, b) { - var c2, d, e, f2, g, h; - d = b; - e = d.Lk(); - if (qke(a.e, e)) { - if (e.Si() && cge(a, e, d.md())) { - return false; - } - } else { - h = pke(a.e.Dh(), e); - c2 = RD(a.g, 124); - for (f2 = 0; f2 < a.i; ++f2) { - g = c2[f2]; - if (h.am(g.Lk())) { - if (pb(g, d)) { - return false; - } else { - RD(eHd(a, f2, b), 76); - return true; - } - } - } - } - return WGd(a, b); - } - function Icc(a, b, c2, d) { - var e, f2, g, h; - e = new j3b(a); - h3b(e, (r3b(), n3b)); - pQb(e, (Ywc(), Awc), b); - pQb(e, Mwc, d); - pQb(e, (yCc(), BBc), (Bod(), wod)); - pQb(e, vwc, b.c); - pQb(e, wwc, b.d); - Oec(b, e); - h = $wnd.Math.floor(c2 / 2); - for (g = new Anb(e.j); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 12); - f2.n.b = h; - } - return e; - } - function fSc(a) { - var b, c2, d, e, f2, g, h; - b = 0; - for (d = new Anb(a.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - for (f2 = new is(Mr(a3b(c2).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (a == e.d.i.c && e.c.j == (qpd(), ppd)) { - g = K3b(e.c).b; - h = K3b(e.d).b; - b = $wnd.Math.max(b, $wnd.Math.abs(h - g)); - } - } - } - return b; - } - function QTb(a, b, c2) { - var d, e, f2, g, h; - c2.Ug("ELK Force", 1); - Heb(TD(Gxd(b, (yVb(), gVb)))) || RFb((d = new SFb((lud(), new zud(b))), d)); - h = KTb(b); - RTb(h); - STb(a, RD(mQb(h, bVb), 432)); - g = CTb(a.a, h); - for (f2 = g.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 235); - pUb(a.b, e, c2.eh(1 / g.gc())); - } - h = BTb(g); - JTb(h); - c2.Vg(); - } - function d_b(a, b, c2) { - switch (c2.g) { - case 1: - return new rjd(b.a, $wnd.Math.min(a.d.b, b.b)); - case 2: - return new rjd($wnd.Math.max(a.c.a, b.a), b.b); - case 3: - return new rjd(b.a, $wnd.Math.max(a.c.b, b.b)); - case 4: - return new rjd($wnd.Math.min(b.a, a.d.a), b.b); - } - return new rjd(b.a, b.b); - } - function yGd(a) { - var b, c2, d; - b = ev(1 + (!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c).i); - Rmb(b, (!a.d && (a.d = new Yie(G4, a, 8, 5)), a.d)); - for (d = new dMd((!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 123); - Rmb(b, (!c2.d && (c2.d = new Yie(G4, c2, 8, 5)), c2.d)); - } - return Qb(b), new Dl(b); - } - function zGd(a) { - var b, c2, d; - b = ev(1 + (!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c).i); - Rmb(b, (!a.e && (a.e = new Yie(G4, a, 7, 4)), a.e)); - for (d = new dMd((!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 123); - Rmb(b, (!c2.e && (c2.e = new Yie(G4, c2, 7, 4)), c2.e)); - } - return Qb(b), new Dl(b); - } - function jne(a) { - var b, c2, d, e; - if (a == null) { - return null; - } else { - d = nue(a, true); - e = mLe.length; - if (lhb(d.substr(d.length - e, e), mLe)) { - c2 = d.length; - if (c2 == 4) { - b = (BFb(0, d.length), d.charCodeAt(0)); - if (b == 43) { - return Wme; - } else if (b == 45) { - return Vme; - } - } else if (c2 == 3) { - return Wme; - } - } - return Neb(d); - } - } - function _rc(a, b) { - var c2, d, e, f2, g; - b.Ug("Breaking Point Processor", 1); - $rc(a); - if (Heb(TD(mQb(a, (yCc(), uCc))))) { - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - c2 = 0; - for (g = new Anb(d.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - f2.p = c2++; - } - } - Vrc(a); - Wrc(a, true); - Wrc(a, false); - } - b.Vg(); - } - function MJc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m; - l = d ? (qpd(), ppd) : (qpd(), Xod); - e = false; - for (i2 = b[c2], j = 0, k = i2.length; j < k; ++j) { - h = i2[j]; - if (Cod(RD(mQb(h, (yCc(), BBc)), 101))) { - continue; - } - g = h.e; - m = !b3b(h, l).dc() && !!g; - if (m) { - f2 = c1b(g); - a.b = new Ylc(f2, d ? 0 : f2.length - 1); - } - e = e | NJc(a, h, l, m); - } - return e; - } - function gOc(a, b, c2, d) { - var e, f2, g; - g = T0b(b, c2); - ZEb(d.c, b); - if (a.j[g.p] == -1 || a.j[g.p] == 2 || a.a[b.p]) { - return d; - } - a.j[g.p] = -1; - for (f2 = new is(Mr(W2b(g).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (!(!W0b(e) && !(!W0b(e) && e.c.i.c == e.d.i.c)) || e == b) { - continue; - } - return gOc(a, e, g, d); - } - return d; - } - function AOc(a) { - var b, c2, d, e; - b = 0; - c2 = 0; - for (e = new Anb(a.j); e.a < e.c.c.length; ) { - d = RD(ynb(e), 12); - b = Ydb(Bdb(b, ADb(CDb(new SDb(null, new Swb(d.e, 16)), new NPc())))); - c2 = Ydb(Bdb(c2, ADb(CDb(new SDb(null, new Swb(d.g, 16)), new PPc())))); - if (b > 1 || c2 > 1) { - return 2; - } - } - if (b + c2 == 1) { - return 2; - } - return 0; - } - function Kwb(a, b) { - var c2, d, e, f2, g, h; - f2 = a.a * Mxe + a.b * 1502; - h = a.b * Mxe + 11; - c2 = $wnd.Math.floor(h * Nxe); - f2 += c2; - h -= c2 * Oxe; - f2 %= Oxe; - a.a = f2; - a.b = h; - if (b <= 24) { - return $wnd.Math.floor(a.a * Ewb[b]); - } else { - e = a.a * (1 << b - 24); - g = $wnd.Math.floor(a.b * Fwb[b]); - d = e + g; - d >= 2147483648 && (d -= 4294967296); - return d; - } - } - function uSc(a, b, c2) { - var d, e, f2, g, h, i2, j; - f2 = new bnb(); - j = new Yub(); - g = new Yub(); - vSc(a, j, g, b); - tSc(a, j, g, b, c2); - for (i2 = new Anb(a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 118); - for (e = new Anb(h.k); e.a < e.c.c.length; ) { - d = RD(ynb(e), 132); - (!b || d.c == (fTc(), dTc)) && h.g > d.b.g && (ZEb(f2.c, d), true); - } - } - return f2; - } - function jed(a, b, c2) { - var d, e, f2, g, h, i2; - h = a.c; - for (g = (!c2.q ? (yob(), yob(), wob) : c2.q).vc().Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 44); - d = !QDb(CDb(new SDb(null, new Swb(h, 16)), new PAb(new xed(b, f2)))).Bd((xDb(), wDb)); - if (d) { - i2 = f2.md(); - if (ZD(i2, 4)) { - e = FId(i2); - e != null && (i2 = e); - } - b.qf(RD(f2.ld(), 149), i2); - } - } - } - function mbd(a, b, c2) { - var d, e; - Sed(a.b); - Ved(a.b, (gbd(), dbd), (_cd(), $cd)); - Ved(a.b, ebd, b.g); - Ved(a.b, fbd, b.a); - a.a = Qed(a.b, b); - c2.Ug("Compaction by shrinking a tree", a.a.c.length); - if (b.i.c.length > 1) { - for (e = new Anb(a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 47); - d.Kf(b, c2.eh(1)); - } - } - c2.Vg(); - } - function Svd(a, b, c2) { - var d, e, f2; - f2 = Eee((lke(), jke), a.Dh(), b); - if (f2) { - nke(); - if (!RD(f2, 69).xk()) { - f2 = zfe(Qee(jke, f2)); - if (!f2) { - throw Adb(new agb(KHe + b.xe() + LHe)); - } - } - e = (d = a.Ih(f2), RD(d >= 0 ? a.Lh(d, true, true) : Qvd(a, f2, true), 160)); - RD(e, 220).Xl(b, c2); - } else { - throw Adb(new agb(KHe + b.xe() + LHe)); - } - } - function k2d(a, b) { - var c2, d, e, f2, g; - if (!b) { - return null; - } else { - f2 = ZD(a.Cb, 90) || ZD(a.Cb, 102); - g = !f2 && ZD(a.Cb, 331); - for (d = new dMd((!b.a && (b.a = new iae(b, o7, b)), b.a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 89); - e = i2d(c2); - if (f2 ? ZD(e, 90) : g ? ZD(e, 156) : !!e) { - return e; - } - } - return f2 ? (JTd(), zTd) : (JTd(), wTd); - } - } - function W8b(a, b) { - var c2, d, e, f2; - b.Ug("Resize child graph to fit parent.", 1); - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - Tmb(a.a, c2.a); - c2.a.c.length = 0; - } - for (f2 = new Anb(a.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - g3b(e, null); - } - a.b.c.length = 0; - X8b(a); - !!a.e && V8b(a.e, a); - b.Vg(); - } - function Fec(a, b) { - var c2, d, e, f2, g; - b.Ug("Edge joining", 1); - c2 = Heb(TD(mQb(a, (yCc(), mCc)))); - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - g = new Jkb(d.a, 0); - while (g.b < g.d.gc()) { - f2 = (sFb(g.b < g.d.gc()), RD(g.d.Xb(g.c = g.b++), 10)); - if (f2.k == (r3b(), o3b)) { - Hec(f2, c2); - Ckb(g); - } - } - } - b.Vg(); - } - function pTc(a, b) { - var c2, d, e, f2, g; - c2 = new bnb(); - e = EDb(new SDb(null, new Swb(a, 16)), new ITc()); - f2 = EDb(new SDb(null, new Swb(a, 16)), new KTc()); - g = VCb(UCb(HDb(Ly(cD(WC(RM, 1), rve, 848, 0, [e, f2])), new MTc()))); - for (d = 1; d < g.length; d++) { - g[d] - g[d - 1] >= 2 * b && Rmb(c2, new BTc(g[d - 1] + b, g[d] - b)); - } - return c2; - } - function dEd(a, b, c2) { - var d, e, f2, g, h, j, k, l; - if (c2) { - f2 = c2.a.length; - d = new vue(f2); - for (h = (d.b - d.a) * d.c < 0 ? (uue(), tue) : new Rue(d); h.Ob(); ) { - g = RD(h.Pb(), 17); - e = xDd(c2, g.a); - !!e && (j = sEd(a, (k = (bvd(), l = new PCd(), l), !!b && NCd(k, b), k), e), jyd(j, zDd(e, uIe)), GEd(e, j), HEd(e, j), CEd(a, e, j)); - } - } - } - function sYd(a) { - var b, c2, d, e, f2, g; - if (!a.j) { - g = new f1d(); - b = iYd; - f2 = b.a.zc(a, b); - if (f2 == null) { - for (d = new dMd(zYd(a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 29); - e = sYd(c2); - YGd(g, e); - WGd(g, c2); - } - b.a.Bc(a) != null; - } - VHd(g); - a.j = new N$d((RD(QHd(xYd((lTd(), kTd).o), 11), 19), g.i), g.g); - yYd(a).b &= -33; - } - return a.j; - } - function lne(a) { - var b, c2, d, e; - if (a == null) { - return null; - } else { - d = nue(a, true); - e = mLe.length; - if (lhb(d.substr(d.length - e, e), mLe)) { - c2 = d.length; - if (c2 == 4) { - b = (BFb(0, d.length), d.charCodeAt(0)); - if (b == 43) { - return Yme; - } else if (b == 45) { - return Xme; - } - } else if (c2 == 3) { - return Yme; - } - } - return new Ufb(d); - } - } - function pD(a) { - var b, c2, d; - c2 = a.l; - if ((c2 & c2 - 1) != 0) { - return -1; - } - d = a.m; - if ((d & d - 1) != 0) { - return -1; - } - b = a.h; - if ((b & b - 1) != 0) { - return -1; - } - if (b == 0 && d == 0 && c2 == 0) { - return -1; - } - if (b == 0 && d == 0 && c2 != 0) { - return ogb(c2); - } - if (b == 0 && d != 0 && c2 == 0) { - return ogb(d) + 22; - } - if (b != 0 && d == 0 && c2 == 0) { - return ogb(b) + 44; - } - return -1; - } - function yo(a, b) { - var c2, d, e, f2, g; - e = b.a & a.f; - f2 = null; - for (d = a.b[e]; true; d = d.b) { - if (d == b) { - !f2 ? a.b[e] = b.b : f2.b = b.b; - break; - } - f2 = d; - } - g = b.f & a.f; - f2 = null; - for (c2 = a.c[g]; true; c2 = c2.d) { - if (c2 == b) { - !f2 ? a.c[g] = b.d : f2.d = b.d; - break; - } - f2 = c2; - } - !b.e ? a.a = b.c : b.e.c = b.c; - !b.c ? a.e = b.e : b.c.e = b.e; - --a.i; - ++a.g; - } - function Dt(a, b) { - var c2; - b.d ? b.d.b = b.b : a.a = b.b; - b.b ? b.b.d = b.d : a.e = b.d; - if (!b.e && !b.c) { - c2 = RD(Hvb(RD(_jb(a.b, b.a), 260)), 260); - c2.a = 0; - ++a.c; - } else { - c2 = RD(Hvb(RD(Wjb(a.b, b.a), 260)), 260); - --c2.a; - !b.e ? c2.b = RD(Hvb(b.c), 511) : b.e.c = b.c; - !b.c ? c2.c = RD(Hvb(b.e), 511) : b.c.e = b.e; - } - --a.d; - } - function XPb(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - c2 = a.o; - b = a.p; - g = lve; - e = qwe; - h = lve; - f2 = qwe; - for (j = 0; j < c2; ++j) { - for (k = 0; k < b; ++k) { - if (PPb(a, j, k)) { - g = $wnd.Math.min(g, j); - e = $wnd.Math.max(e, j); - h = $wnd.Math.min(h, k); - f2 = $wnd.Math.max(f2, k); - } - } - } - i2 = e - g + 1; - d = f2 - h + 1; - return new $td(sgb(g), sgb(h), sgb(i2), sgb(d)); - } - function FZb(a, b) { - var c2, d, e, f2; - f2 = new Jkb(a, 0); - c2 = (sFb(f2.b < f2.d.gc()), RD(f2.d.Xb(f2.c = f2.b++), 148)); - while (f2.b < f2.d.gc()) { - d = (sFb(f2.b < f2.d.gc()), RD(f2.d.Xb(f2.c = f2.b++), 148)); - e = new fZb(d.c, c2.d, b); - sFb(f2.b > 0); - f2.a.Xb(f2.c = --f2.b); - Ikb(f2, e); - sFb(f2.b < f2.d.gc()); - f2.d.Xb(f2.c = f2.b++); - e.a = false; - c2 = d; - } - } - function n6b(a) { - var b, c2, d, e, f2, g; - e = RD(mQb(a, (Ywc(), Xvc)), 12); - for (g = new Anb(a.j); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 12); - for (d = new Anb(f2.g); d.a < d.c.c.length; ) { - b = RD(ynb(d), 18); - Z0b(b, e); - return f2; - } - for (c2 = new Anb(f2.e); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 18); - Y0b(b, e); - return f2; - } - } - return null; - } - function Xec(a, b, c2) { - var d, e, f2, g, h, i2; - i2 = RD($5b(a.a, b), 17).a; - c2 ? c6b(a.a, sgb(i2 + 1), b) : c6b(a.a, sgb(i2 - 1), b); - g = new Iub(); - for (e = new is(Mr((c2 ? a3b(b) : Z2b(b)).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - c2 ? f2 = d.d.i : f2 = d.c.i; - dE($5b(a.a, f2)) === dE($5b(a.a, b)) && (h = g.a.zc(f2, g), h == null); - } - return g; - } - function yA(a, b, c2) { - var d, e; - d = Hdb(c2.q.getTime()); - if (Ddb(d, 0) < 0) { - e = Awe - Ydb(Mdb(Odb(d), Awe)); - e == Awe && (e = 0); - } else { - e = Ydb(Mdb(d, Awe)); - } - if (b == 1) { - e = $wnd.Math.min((e + 50) / 100 | 0, 9); - Thb(a, 48 + e & Bwe); - } else if (b == 2) { - e = $wnd.Math.min((e + 5) / 10 | 0, 99); - UA(a, e, 2); - } else { - UA(a, e, 3); - b > 3 && UA(a, 0, b - 3); - } - } - function eXb(a) { - var b, c2, d, e; - if (dE(mQb(a, (yCc(), IAc))) === dE((Fnd(), Cnd))) { - return !a.e && dE(mQb(a, gAc)) !== dE((xvc(), uvc)); - } - d = RD(mQb(a, hAc), 299); - e = Heb(TD(mQb(a, nAc))) || dE(mQb(a, oAc)) === dE((stc(), ptc)); - b = RD(mQb(a, fAc), 17).a; - c2 = a.a.c.length; - return !e && d != (xvc(), uvc) && (b == 0 || b > c2); - } - function Rnc(a) { - var b, c2; - c2 = 0; - for (; c2 < a.c.length; c2++) { - if (snc((tFb(c2, a.c.length), RD(a.c[c2], 113))) > 0) { - break; - } - } - if (c2 > 0 && c2 < a.c.length - 1) { - return c2; - } - b = 0; - for (; b < a.c.length; b++) { - if (snc((tFb(b, a.c.length), RD(a.c[b], 113))) > 0) { - break; - } - } - if (b > 0 && c2 < a.c.length - 1) { - return b; - } - return a.c.length / 2 | 0; - } - function Mzd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 6 && !!b) { - if (Oje(a, b)) - throw Adb(new agb(UHe + Qzd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? Czd(a, d) : a.Cb.Th(a, -1 - c2, null, d))); - !!b && (d = Ivd(b, a, 6, d)); - d = Bzd(a, b, d); - !!d && d.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 6, b, b)); - } - function pzd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 3 && !!b) { - if (Oje(a, b)) - throw Adb(new agb(UHe + qzd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? jzd(a, d) : a.Cb.Th(a, -1 - c2, null, d))); - !!b && (d = Ivd(b, a, 12, d)); - d = izd(a, b, d); - !!d && d.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 3, b, b)); - } - function NCd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 9 && !!b) { - if (Oje(a, b)) - throw Adb(new agb(UHe + OCd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? LCd(a, d) : a.Cb.Th(a, -1 - c2, null, d))); - !!b && (d = Ivd(b, a, 9, d)); - d = KCd(a, b, d); - !!d && d.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 9, b, b)); - } - function tWd(b) { - var c2, d, e, f2, g; - e = WVd(b); - g = b.j; - if (g == null && !!e) { - return b.Jk() ? null : e.ik(); - } else if (ZD(e, 156)) { - d = e.jk(); - if (d) { - f2 = d.wi(); - if (f2 != b.i) { - c2 = RD(e, 156); - if (c2.nk()) { - try { - b.g = f2.ti(c2, g); - } catch (a) { - a = zdb(a); - if (ZD(a, 82)) { - b.g = null; - } else - throw Adb(a); - } - } - b.i = f2; - } - } - return b.g; - } - return null; - } - function nRb(a) { - var b; - b = new bnb(); - Rmb(b, new TFb(new rjd(a.c, a.d), new rjd(a.c + a.b, a.d))); - Rmb(b, new TFb(new rjd(a.c, a.d), new rjd(a.c, a.d + a.a))); - Rmb(b, new TFb(new rjd(a.c + a.b, a.d + a.a), new rjd(a.c + a.b, a.d))); - Rmb(b, new TFb(new rjd(a.c + a.b, a.d + a.a), new rjd(a.c, a.d + a.a))); - return b; - } - function ic(b) { - var c2, d, e; - if (b == null) { - return vve; - } - try { - return jeb(b); - } catch (a) { - a = zdb(a); - if (ZD(a, 103)) { - c2 = a; - e = nfb(rb(b)) + "@" + (d = (gib(), jFb(b)) >>> 0, d.toString(16)); - lBb(pBb(), (SAb(), "Exception during lenientFormat for " + e), c2); - return "<" + e + " threw " + nfb(c2.Rm) + ">"; - } else - throw Adb(a); - } - } - function mTb(a, b, c2) { - var d, e, f2; - for (f2 = b.a.ec().Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 74); - d = RD(Wjb(a.b, e), 272); - !d && (vCd(JGd(e)) == vCd(LGd(e)) ? lTb(a, e, c2) : JGd(e) == vCd(LGd(e)) ? Wjb(a.c, e) == null && Wjb(a.b, LGd(e)) != null && oTb(a, e, c2, false) : Wjb(a.d, e) == null && Wjb(a.b, JGd(e)) != null && oTb(a, e, c2, true)); - } - } - function Pfc(a, b) { - var c2, d, e, f2, g, h, i2; - for (e = a.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 10); - h = new R3b(); - P3b(h, d); - Q3b(h, (qpd(), Xod)); - pQb(h, (Ywc(), Hwc), (Geb(), true)); - for (g = b.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 10); - i2 = new R3b(); - P3b(i2, f2); - Q3b(i2, ppd); - pQb(i2, Hwc, true); - c2 = new a1b(); - pQb(c2, Hwc, true); - Y0b(c2, h); - Z0b(c2, i2); - } - } - } - function Pqc(a, b, c2, d) { - var e, f2, g, h; - e = Nqc(a, b, c2); - f2 = Nqc(a, c2, b); - g = RD(Wjb(a.c, b), 118); - h = RD(Wjb(a.c, c2), 118); - if (e < f2) { - new bTc((fTc(), eTc), g, h, f2 - e); - } else if (f2 < e) { - new bTc((fTc(), eTc), h, g, e - f2); - } else if (e != 0 || !(!b.i || !c2.i) && d[b.i.c][c2.i.c]) { - new bTc((fTc(), eTc), g, h, 0); - new bTc(eTc, h, g, 0); - } - } - function rsc(a, b) { - var c2, d, e, f2, g, h, i2; - e = 0; - for (g = new Anb(b.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - e += f2.o.b + f2.d.a + f2.d.d + a.e; - for (d = new is(Mr(Z2b(f2).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - if (c2.c.i.k == (r3b(), q3b)) { - i2 = c2.c.i; - h = RD(mQb(i2, (Ywc(), Awc)), 10); - e += h.o.b + h.d.a + h.d.d; - } - } - } - return e; - } - function sad() { - sad = geb; - oad = new tad("CANDIDATE_POSITION_LAST_PLACED_RIGHT", 0); - nad = new tad("CANDIDATE_POSITION_LAST_PLACED_BELOW", 1); - qad = new tad("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT", 2); - pad2 = new tad("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW", 3); - rad = new tad("WHOLE_DRAWING", 4); - } - function vEd(a, b) { - if (ZD(b, 207)) { - return IDd(a, RD(b, 27)); - } else if (ZD(b, 193)) { - return JDd(a, RD(b, 123)); - } else if (ZD(b, 366)) { - return HDd(a, RD(b, 135)); - } else if (ZD(b, 326)) { - return GDd(a, RD(b, 74)); - } else if (b) { - return null; - } else { - throw Adb(new agb(wIe + Fe(new mob(cD(WC(jJ, 1), rve, 1, 5, [b]))))); - } - } - function Glc(a) { - var b, c2, d, e, f2, g, h; - f2 = new Yub(); - for (e = new Anb(a.d.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 125); - d.b.a.c.length == 0 && (Pub(f2, d, f2.c.b, f2.c), true); - } - if (f2.b > 1) { - b = eJb((c2 = new gJb(), ++a.b, c2), a.d); - for (h = Sub(f2, 0); h.b != h.d.c; ) { - g = RD(evb(h), 125); - rIb(uIb(tIb(vIb(sIb(new wIb(), 1), 0), b), g)); - } - } - } - function isc(a, b, c2) { - var d, e, f2, g, h; - c2.Ug("Breaking Point Removing", 1); - a.a = RD(mQb(b, (yCc(), yAc)), 223); - for (f2 = new Anb(b.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - for (h = new Anb(bv(e.a)); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - if (Krc(g)) { - d = RD(mQb(g, (Ywc(), Wvc)), 313); - !d.d && jsc(a, d); - } - } - } - c2.Vg(); - } - function yCd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 11 && !!b) { - if (Oje(a, b)) - throw Adb(new agb(UHe + zCd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? sCd(a, d) : a.Cb.Th(a, -1 - c2, null, d))); - !!b && (d = Ivd(b, a, 10, d)); - d = rCd(a, b, d); - !!d && d.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 11, b, b)); - } - function C0b(a) { - var b, c2, d, e; - for (d = new vkb(new mkb(a.b).a); d.b; ) { - c2 = tkb(d); - e = RD(c2.ld(), 12); - b = RD(c2.md(), 10); - pQb(b, (Ywc(), Awc), e); - pQb(e, Iwc, b); - pQb(e, nwc, (Geb(), true)); - Q3b(e, RD(mQb(b, hwc), 64)); - mQb(b, hwc); - pQb(e.i, (yCc(), BBc), (Bod(), yod)); - RD(mQb(Y2b(e.i), kwc), 21).Fc((ovc(), kvc)); - } - } - function X7b(a, b, c2) { - var d, e, f2, g, h, i2; - f2 = 0; - g = 0; - if (a.c) { - for (i2 = new Anb(a.d.i.j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 12); - f2 += h.e.c.length; - } - } else { - f2 = 1; - } - if (a.d) { - for (i2 = new Anb(a.c.i.j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 12); - g += h.g.c.length; - } - } else { - g = 1; - } - e = eE(Lgb(g - f2)); - d = (c2 + b) / 2 + (c2 - b) * (0.4 * e); - return d; - } - function Dnc(a) { - Bnc(); - var b, c2; - if (a.Hc((qpd(), opd))) { - throw Adb(new agb("Port sides must not contain UNDEFINED")); - } - switch (a.gc()) { - case 1: - return xnc; - case 2: - b = a.Hc(Xod) && a.Hc(ppd); - c2 = a.Hc(Yod) && a.Hc(npd); - return b || c2 ? Anc : znc; - case 3: - return ync; - case 4: - return wnc; - default: - return null; - } - } - function Did(a, b, c2) { - tid(); - if (xid(a, b) && xid(a, c2)) { - return false; - } - return Fid(new rjd(a.c, a.d), new rjd(a.c + a.b, a.d), b, c2) || Fid(new rjd(a.c + a.b, a.d), new rjd(a.c + a.b, a.d + a.a), b, c2) || Fid(new rjd(a.c + a.b, a.d + a.a), new rjd(a.c, a.d + a.a), b, c2) || Fid(new rjd(a.c, a.d + a.a), new rjd(a.c, a.d), b, c2); - } - function Xee(a, b) { - var c2, d, e, f2; - if (!a.dc()) { - for (c2 = 0, d = a.gc(); c2 < d; ++c2) { - f2 = WD(a.Xb(c2)); - if (f2 == null ? b == null : lhb(f2.substr(0, 3), "!##") ? b != null && (e = b.length, !lhb(f2.substr(f2.length - e, e), b) || f2.length != b.length + 3) && !lhb(dLe, b) : lhb(f2, eLe) && !lhb(dLe, b) || lhb(f2, b)) { - return true; - } - } - } - return false; - } - function $6b(a, b, c2, d) { - var e, f2, g, h, i2, j; - g = a.j.c.length; - i2 = $C(NN, Mye, 314, g, 0, 1); - for (h = 0; h < g; h++) { - f2 = RD(Vmb(a.j, h), 12); - f2.p = h; - i2[h] = U6b(c7b(f2), c2, d); - } - W6b(a, i2, c2, b, d); - j = new Tsb(); - for (e = 0; e < i2.length; e++) { - !!i2[e] && Zjb(j, RD(Vmb(a.j, e), 12), i2[e]); - } - if (j.f.c + j.i.c != 0) { - pQb(a, (Ywc(), cwc), j); - a7b(a, i2); - } - } - function Yfc(a, b) { - var c2, d, e, f2, g, h; - b.Ug("Partition postprocessing", 1); - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - h = new Anb(e.j); - while (h.a < h.c.c.length) { - g = RD(ynb(h), 12); - Heb(TD(mQb(g, (Ywc(), Hwc)))) && znb(h); - } - } - } - b.Vg(); - } - function pkc(a, b, c2) { - var d, e, f2; - for (e = new Anb(a.a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 60); - f2 = Zjc(d); - if (f2) { - if (f2.k == (r3b(), m3b)) { - switch (RD(mQb(f2, (Ywc(), hwc)), 64).g) { - case 4: - f2.n.a = b.a; - break; - case 2: - f2.n.a = c2.a - (f2.o.a + f2.d.c); - break; - case 1: - f2.n.b = b.b; - break; - case 3: - f2.n.b = c2.b - (f2.o.b + f2.d.a); - } - } - } - } - } - function eZc(a, b, c2) { - var d, e, f2; - c2.Ug("Processor determine the height for each level", 1); - a.a = b.b.b == 0 ? 1 : b.b.b; - e = null; - d = Sub(b.b, 0); - while (!e && d.b != d.d.c) { - f2 = RD(evb(d), 40); - Heb(TD(mQb(f2, (q$c(), n$c)))) && (e = f2); - } - !!e && fZc(a, dv(cD(WC(Z$, 1), NEe, 40, 0, [e])), c2, RD(mQb(b, (h_c(), H$c)), 88)); - c2.Vg(); - } - function N8c(a) { - var b, c2, d, e, f2, g; - d = (bvd(), f2 = new ACd(), f2); - zxd(d, a); - for (c2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 27); - g = (e = new ACd(), e); - yCd(g, d); - zyd(g, b.g, b.f); - jyd(g, b.k); - Byd(g, b.i, b.j); - WGd((!d.a && (d.a = new C5d(J4, d, 10, 11)), d.a), g); - zxd(g, b); - } - return d; - } - function ord(a, b, c2) { - var d, e, f2, g, h; - e = RD(Gxd(b, (hkd(), fkd)), 17); - !e && (e = sgb(0)); - f2 = RD(Gxd(c2, fkd), 17); - !f2 && (f2 = sgb(0)); - if (e.a > f2.a) { - return -1; - } else if (e.a < f2.a) { - return 1; - } else { - if (a.a) { - d = Qfb(b.j, c2.j); - if (d != 0) { - return d; - } - d = Qfb(b.i, c2.i); - if (d != 0) { - return d; - } - } - g = b.g * b.f; - h = c2.g * c2.f; - return Qfb(g, h); - } - } - function _Nd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - ++a.e; - i2 = a.d == null ? 0 : a.d.length; - if (b > i2) { - k = a.d; - a.d = $C(D6, KJe, 66, 2 * i2 + 4, 0, 1); - for (f2 = 0; f2 < i2; ++f2) { - j = k[f2]; - if (j) { - d = j.g; - l = j.i; - for (h = 0; h < l; ++h) { - e = RD(d[h], 136); - g = bOd(a, e.Bi()); - c2 = a.d[g]; - !c2 && (c2 = a.d[g] = a.dk()); - c2.Fc(e); - } - } - } - return true; - } else { - return false; - } - } - function Ofe(a, b, c2) { - var d, e, f2, g, h, i2; - e = c2; - f2 = e.Lk(); - if (qke(a.e, f2)) { - if (f2.Si()) { - d = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (pb(h, e) && g != b) { - throw Adb(new agb(LIe)); - } - } - } - } else { - i2 = pke(a.e.Dh(), f2); - d = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (i2.am(h.Lk())) { - throw Adb(new agb(gLe)); - } - } - } - VGd(a, b, c2); - } - function R_b(a, b) { - var c2, d, e, f2, g, h; - c2 = RD(mQb(b, (Ywc(), ewc)), 21); - g = RD(Qc((z$b(), y$b), c2), 21); - h = RD(Qc(O_b, c2), 21); - for (f2 = g.Kc(); f2.Ob(); ) { - d = RD(f2.Pb(), 21); - if (!RD(Qc(a.b, d), 15).dc()) { - return false; - } - } - for (e = h.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 21); - if (!RD(Qc(a.b, d), 15).dc()) { - return false; - } - } - return true; - } - function dad(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - if (a.a.c.length == 1) { - return P9c(RD(Vmb(a.a, 0), 172), b); - } - g = cad(a); - i2 = 0; - j = a.d; - f2 = g; - k = a.d; - h = (j - f2) / 2 + f2; - while (f2 + 1 < j) { - i2 = 0; - for (d = new Anb(a.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 172); - i2 += (e = S9c(c2, h, false), e.a); - } - if (i2 < b) { - k = h; - j = h; - } else { - f2 = h; - } - h = (j - f2) / 2 + f2; - } - return k; - } - function zxd(a, b) { - var c2, d, e, f2, g; - if (!b) { - return a; - } - if (ZD(b, 342)) { - e = RD(b, 342); - f2 = (!a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)), a.o); - for (d = e.gh().c.Kc(); d.e != d.i.gc(); ) { - c2 = RD(d.Yj(), 44); - g = c2.md(); - fOd(f2, RD(c2.ld(), 149), g); - } - } else { - !a.o && (a.o = new DVd((pvd(), mvd), X4, a, 0)); - gOd(a.o, b.nf()); - } - return a; - } - function vD(a) { - var b, c2, d, e, f2; - if (isNaN(a)) { - return MD(), LD; - } - if (a < -9223372036854776e3) { - return MD(), JD; - } - if (a >= 9223372036854776e3) { - return MD(), ID; - } - e = false; - if (a < 0) { - e = true; - a = -a; - } - d = 0; - if (a >= hxe) { - d = eE(a / hxe); - a -= d * hxe; - } - c2 = 0; - if (a >= gxe) { - c2 = eE(a / gxe); - a -= c2 * gxe; - } - b = eE(a); - f2 = hD(b, c2, d); - e && nD(f2); - return f2; - } - function KCb(a) { - var b, c2, d, e, f2; - f2 = new bnb(); - Umb(a.b, new SEb(f2)); - a.b.c.length = 0; - if (f2.c.length != 0) { - b = (tFb(0, f2.c.length), RD(f2.c[0], 82)); - for (c2 = 1, d = f2.c.length; c2 < d; ++c2) { - e = (tFb(c2, f2.c.length), RD(f2.c[c2], 82)); - e != b && fz(b, e); - } - if (ZD(b, 63)) { - throw Adb(RD(b, 63)); - } - if (ZD(b, 296)) { - throw Adb(RD(b, 296)); - } - } - } - function iNb(a, b) { - var c2, d, e, f2; - c2 = !b || !a.u.Hc((Pod(), Lod)); - f2 = 0; - for (e = new Anb(a.e.Xf()); e.a < e.c.c.length; ) { - d = RD(ynb(e), 852); - if (d.ag() == (qpd(), opd)) { - throw Adb(new agb("Label and node size calculator can only be used with ports that have port sides assigned.")); - } - d.Qf(f2++); - hNb(a, d, c2); - } - } - function IGb(a) { - var b, c2, d, e, f2; - for (c2 = new Anb(a.a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 316); - b.j = null; - for (f2 = b.a.a.ec().Kc(); f2.Ob(); ) { - d = RD(f2.Pb(), 60); - hjd(d.b); - (!b.j || d.d.c < b.j.d.c) && (b.j = d); - } - for (e = b.a.a.ec().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 60); - d.b.a = d.d.c - b.j.d.c; - d.b.b = d.d.d - b.j.d.d; - } - } - return a; - } - function uYb(a) { - var b, c2, d, e, f2; - for (c2 = new Anb(a.a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 194); - b.f = null; - for (f2 = b.a.a.ec().Kc(); f2.Ob(); ) { - d = RD(f2.Pb(), 86); - hjd(d.e); - (!b.f || d.g.c < b.f.g.c) && (b.f = d); - } - for (e = b.a.a.ec().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 86); - d.e.a = d.g.c - b.f.g.c; - d.e.b = d.g.d - b.f.g.d; - } - } - return a; - } - function vPb(a) { - var b, c2, d; - c2 = RD(a.a, 17).a; - d = RD(a.b, 17).a; - b = $wnd.Math.max($wnd.Math.abs(c2), $wnd.Math.abs(d)); - if (c2 < b && d == -b) { - return new Ptd(sgb(c2 + 1), sgb(d)); - } - if (c2 == b && d < b) { - return new Ptd(sgb(c2), sgb(d + 1)); - } - if (c2 >= -b && d == b) { - return new Ptd(sgb(c2 - 1), sgb(d)); - } - return new Ptd(sgb(c2), sgb(d - 1)); - } - function lcc() { - hcc(); - return cD(WC(YS, 1), jwe, 81, 0, [nbc, kbc, obc, Ebc, Xbc, Ibc, bcc, Nbc, Vbc, zbc, Rbc, Mbc, Wbc, vbc, dcc, ebc, Qbc, Zbc, Fbc, Ybc, fcc, Tbc, fbc, Ubc, gcc, _bc, ecc, Gbc, sbc, Hbc, Dbc, ccc, ibc, qbc, Kbc, hbc, Lbc, Bbc, wbc, Obc, ybc, lbc, jbc, Cbc, xbc, Pbc, acc, gbc, Sbc, Abc, Jbc, tbc, rbc, $bc, pbc, ubc, mbc]); - } - function Cmc(a, b, c2) { - a.d = 0; - a.b = 0; - b.k == (r3b(), q3b) && c2.k == q3b && RD(mQb(b, (Ywc(), Awc)), 10) == RD(mQb(c2, Awc), 10) && (Gmc(b).j == (qpd(), Yod) ? Dmc(a, b, c2) : Dmc(a, c2, b)); - b.k == q3b && c2.k == o3b ? Gmc(b).j == (qpd(), Yod) ? a.d = 1 : a.b = 1 : c2.k == q3b && b.k == o3b && (Gmc(c2).j == (qpd(), Yod) ? a.b = 1 : a.d = 1); - Imc(a, b, c2); - } - function EFd(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - l = HFd(a); - b = a.a; - i2 = b != null; - i2 && sDd(l, "category", a.a); - e = cve(new Xkb(a.d)); - g = !e; - if (g) { - j = new MB(); - sC(l, "knownOptions", j); - c2 = new MFd(j); - xgb(new Xkb(a.d), c2); - } - f2 = cve(a.g); - h = !f2; - if (h) { - k = new MB(); - sC(l, "supportedFeatures", k); - d = new OFd(k); - xgb(a.g, d); - } - return l; - } - function Ly(a) { - var b, c2, d, e, f2, g, h, i2, j; - d = false; - b = 336; - c2 = 0; - f2 = new hq(a.length); - for (h = a, i2 = 0, j = h.length; i2 < j; ++i2) { - g = h[i2]; - d = d | (MCb(g), false); - e = (LCb(g), g.a); - Rmb(f2.a, Qb(e)); - b &= e.yd(); - c2 = az(c2, e.zd()); - } - return RD(RD(JCb(new SDb(null, ek(new Swb((tm(), zm(f2.a)), 16), new My(), b, c2)), new Oy(a)), 687), 848); - } - function WZb(a, b) { - var c2; - if (!!a.d && (b.c != a.e.c || sZb(a.e.b, b.b))) { - Rmb(a.f, a.d); - a.a = a.d.c + a.d.b; - a.d = null; - a.e = null; - } - pZb(b.b) ? a.c = b : a.b = b; - if (b.b == (nZb(), jZb) && !b.a || b.b == kZb && b.a || b.b == lZb && b.a || b.b == mZb && !b.a) { - if (!!a.c && !!a.b) { - c2 = new Uid2(a.a, a.c.d, b.c - a.a, a.b.d - a.c.d); - a.d = c2; - a.e = b; - } - } - } - function Wed(a) { - var b; - Oed.call(this); - this.i = new ifd(); - this.g = a; - this.f = RD(a.e && a.e(), 9).length; - if (this.f == 0) { - throw Adb(new agb("There must be at least one phase in the phase enumeration.")); - } - this.c = (b = RD(mfb(this.g), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)); - this.a = new ufd(); - this.b = new Tsb(); - } - function eCd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 7 && !!b) { - if (Oje(a, b)) - throw Adb(new agb(UHe + gCd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? cCd(a, d) : a.Cb.Th(a, -1 - c2, null, d))); - !!b && (d = RD(b, 54).Rh(a, 1, H4, d)); - d = bCd(a, b, d); - !!d && d.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 7, b, b)); - } - function lVd(a, b) { - var c2, d; - if (b != a.Cb || a.Db >> 16 != 3 && !!b) { - if (Oje(a, b)) - throw Adb(new agb(UHe + oVd(a))); - d = null; - !!a.Cb && (d = (c2 = a.Db >> 16, c2 >= 0 ? iVd(a, d) : a.Cb.Th(a, -1 - c2, null, d))); - !!b && (d = RD(b, 54).Rh(a, 0, p7, d)); - d = hVd(a, b, d); - !!d && d.oj(); - } else - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 3, b, b)); - } - function Mjb(a, b) { - Ljb(); - var c2, d, e, f2, g, h, i2, j, k; - if (b.d > a.d) { - h = a; - a = b; - b = h; - } - if (b.d < 63) { - return Qjb(a, b); - } - g = (a.d & -2) << 4; - j = $ib(a, g); - k = $ib(b, g); - d = Gjb(a, Zib(j, g)); - e = Gjb(b, Zib(k, g)); - i2 = Mjb(j, k); - c2 = Mjb(d, e); - f2 = Mjb(Gjb(j, d), Gjb(e, k)); - f2 = Bjb(Bjb(f2, i2), c2); - f2 = Zib(f2, g); - i2 = Zib(i2, g << 1); - return Bjb(Bjb(i2, f2), c2); - } - function _Cc() { - _Cc = geb; - ZCc = new bDc(lEe, 0); - WCc = new bDc("LONGEST_PATH", 1); - XCc = new bDc("LONGEST_PATH_SOURCE", 2); - TCc = new bDc("COFFMAN_GRAHAM", 3); - VCc = new bDc(BBe, 4); - $Cc = new bDc("STRETCH_WIDTH", 5); - YCc = new bDc("MIN_WIDTH", 6); - SCc = new bDc("BF_MODEL_ORDER", 7); - UCc = new bDc("DF_MODEL_ORDER", 8); - } - function AKc(a, b, c2) { - var d, e, f2, g, h; - g = aMc(a, c2); - h = $C(jR, WAe, 10, b.length, 0, 1); - d = 0; - for (f2 = g.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 12); - Heb(TD(mQb(e, (Ywc(), nwc)))) && (h[d++] = RD(mQb(e, Iwc), 10)); - } - if (d < b.length) { - throw Adb(new dgb("Expected " + b.length + " hierarchical ports, but found only " + d + ".")); - } - return h; - } - function sBd(a, b) { - var c2, d, e, f2, g, h; - if (!a.tb) { - f2 = (!a.rb && (a.rb = new J5d(a, i7, a)), a.rb); - h = new Usb(f2.i); - for (e = new dMd(f2); e.e != e.i.gc(); ) { - d = RD(bMd(e), 142); - g = d.xe(); - c2 = RD(g == null ? rtb(h.f, null, d) : Ltb(h.i, g, d), 142); - !!c2 && (g == null ? rtb(h.f, null, c2) : Ltb(h.i, g, c2)); - } - a.tb = h; - } - return RD(Xjb(a.tb, b), 142); - } - function wYd(a, b) { - var c2, d, e, f2, g; - (a.i == null && rYd(a), a.i).length; - if (!a.p) { - g = new Usb((3 * a.g.i / 2 | 0) + 1); - for (e = new yMd(a.g); e.e != e.i.gc(); ) { - d = RD(xMd(e), 179); - f2 = d.xe(); - c2 = RD(f2 == null ? rtb(g.f, null, d) : Ltb(g.i, f2, d), 179); - !!c2 && (f2 == null ? rtb(g.f, null, c2) : Ltb(g.i, f2, c2)); - } - a.p = g; - } - return RD(Xjb(a.p, b), 179); - } - function fFb(a, b, c2, d, e) { - var f2, g, h, i2, j; - dFb(d + lz(c2, c2.ie()), e); - eFb(b, hFb(c2)); - f2 = c2.f; - !!f2 && fFb(a, b, f2, "Caused by: ", false); - for (h = (c2.k == null && (c2.k = $C(rJ, Nve, 82, 0, 0, 1)), c2.k), i2 = 0, j = h.length; i2 < j; ++i2) { - g = h[i2]; - fFb(a, b, g, "Suppressed: ", false); - } - console.groupEnd != null && console.groupEnd.call(console); - } - function DKc(a, b, c2, d) { - var e, f2, g, h, i2; - i2 = b.e; - h = i2.length; - g = b.q.ug(i2, c2 ? 0 : h - 1, c2); - e = i2[c2 ? 0 : h - 1]; - g = g | CKc(a, e, c2, d); - for (f2 = c2 ? 1 : h - 2; c2 ? f2 < h : f2 >= 0; f2 += c2 ? 1 : -1) { - g = g | b.c.lg(i2, f2, c2, d && !Heb(TD(mQb(b.j, (Ywc(), jwc)))) && !Heb(TD(mQb(b.j, (Ywc(), Owc))))); - g = g | b.q.ug(i2, f2, c2); - g = g | CKc(a, i2[f2], c2, d); - } - Ysb(a.c, b); - return g; - } - function F6b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - for (k = u2b(a.j), l = 0, m = k.length; l < m; ++l) { - j = k[l]; - if (c2 == (BEc(), yEc) || c2 == AEc) { - i2 = s2b(j.g); - for (e = i2, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - B6b(b, d) && X0b(d, true); - } - } - if (c2 == zEc || c2 == AEc) { - h = s2b(j.e); - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - A6b(b, d) && X0b(d, true); - } - } - } - } - function uqc(a) { - var b, c2; - b = null; - c2 = null; - switch (pqc(a).g) { - case 1: - b = (qpd(), Xod); - c2 = ppd; - break; - case 2: - b = (qpd(), npd); - c2 = Yod; - break; - case 3: - b = (qpd(), ppd); - c2 = Xod; - break; - case 4: - b = (qpd(), Yod); - c2 = npd; - } - Smc(a, RD(Lvb(KDb(RD(Qc(a.k, b), 15).Oc(), lqc)), 113)); - Tmc(a, RD(Lvb(JDb(RD(Qc(a.k, c2), 15).Oc(), lqc)), 113)); - } - function r9b(a) { - var b, c2, d, e, f2, g; - e = RD(Vmb(a.j, 0), 12); - if (e.e.c.length + e.g.c.length == 0) { - a.n.a = 0; - } else { - g = 0; - for (d = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [new T3b(e), new _3b(e)]))); gs(d); ) { - c2 = RD(hs(d), 12); - g += c2.i.n.a + c2.n.a + c2.a.a; - } - b = RD(mQb(a, (yCc(), zBc)), 8); - f2 = !b ? 0 : b.a; - a.n.a = g / (e.e.c.length + e.g.c.length) - f2; - } - } - function Qdd(a, b) { - var c2, d, e; - for (d = new Anb(b.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 225); - RQb(RD(c2.b, 68), ojd(ajd(RD(b.b, 68).c), RD(b.b, 68).a)); - e = oRb(RD(b.b, 68).b, RD(c2.b, 68).b); - e > 1 && (a.a = true); - QQb(RD(c2.b, 68), $id(ajd(RD(b.b, 68).c), ijd(ojd(ajd(RD(c2.b, 68).a), RD(b.b, 68).a), e))); - Odd(a, b); - Qdd(a, c2); - } - } - function tYb(a) { - var b, c2, d, e, f2, g, h; - for (f2 = new Anb(a.a.a); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 194); - d.e = 0; - d.d.a.$b(); - } - for (e = new Anb(a.a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 194); - for (c2 = d.a.a.ec().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 86); - for (h = b.f.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 86); - if (g.d != d) { - Ysb(d.d, g); - ++g.d.e; - } - } - } - } - } - function Hfc(a) { - var b, c2, d, e, f2, g, h, i2; - i2 = a.j.c.length; - c2 = 0; - b = i2; - e = 2 * i2; - for (h = new Anb(a.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - switch (g.j.g) { - case 2: - case 4: - g.p = -1; - break; - case 1: - case 3: - d = g.e.c.length; - f2 = g.g.c.length; - d > 0 && f2 > 0 ? g.p = b++ : d > 0 ? g.p = c2++ : f2 > 0 ? g.p = e++ : g.p = c2++; - } - } - yob(); - _mb(a.j, new Lfc()); - } - function zic(a) { - var b, c2; - c2 = null; - b = RD(Vmb(a.g, 0), 18); - do { - c2 = b.d.i; - if (nQb(c2, (Ywc(), wwc))) { - return RD(mQb(c2, wwc), 12).i; - } - if (c2.k != (r3b(), p3b) && gs(new is(Mr(a3b(c2).a.Kc(), new ir())))) { - b = RD(hs(new is(Mr(a3b(c2).a.Kc(), new ir()))), 18); - } else if (c2.k != p3b) { - return null; - } - } while (!!c2 && c2.k != (r3b(), p3b)); - return c2; - } - function sqc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - h = b.j; - g = b.g; - i2 = RD(Vmb(h, h.c.length - 1), 113); - k = (tFb(0, h.c.length), RD(h.c[0], 113)); - j = oqc(a, g, i2, k); - for (f2 = 1; f2 < h.c.length; f2++) { - c2 = (tFb(f2 - 1, h.c.length), RD(h.c[f2 - 1], 113)); - e = (tFb(f2, h.c.length), RD(h.c[f2], 113)); - d = oqc(a, g, c2, e); - if (d > j) { - i2 = c2; - k = e; - j = d; - } - } - b.a = k; - b.c = i2; - } - function fMc(a, b, c2) { - var d, e, f2, g, h, i2, j; - j = new yAb(new TMc(a)); - for (g = cD(WC(xR, 1), XAe, 12, 0, [b, c2]), h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - j.a.zc(f2, (Geb(), Eeb)) == null; - for (e = new l4b(f2.b); xnb(e.a) || xnb(e.b); ) { - d = RD(xnb(e.a) ? ynb(e.a) : ynb(e.b), 18); - d.c == d.d || rAb(j, f2 == d.c ? d.d : d.c); - } - } - return Qb(j), new dnb(j); - } - function rIb(a) { - if (!a.a.d || !a.a.e) { - throw Adb(new dgb((lfb(zN), zN.k + " must have a source and target " + (lfb(DN), DN.k) + " specified."))); - } - if (a.a.d == a.a.e) { - throw Adb(new dgb("Network simplex does not support self-loops: " + a.a + " " + a.a.d + " " + a.a.e)); - } - EIb(a.a.d.g, a.a); - EIb(a.a.e.b, a.a); - return a.a; - } - function x6b(a, b) { - var c2, d, e, f2, g, h, i2; - b.Ug("Constraints Postprocessor", 1); - g = 0; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - i2 = 0; - h = false; - for (d = new Anb(e.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - if (c2.k == (r3b(), p3b)) { - h = true; - pQb(c2, (yCc(), VAc), sgb(g)); - pQb(c2, mAc, sgb(i2)); - ++i2; - } - } - h && ++g; - } - b.Vg(); - } - function OTc(a, b, c2) { - var d, e, f2, g, h, i2; - d = 0; - if (b.b != 0 && c2.b != 0) { - f2 = Sub(b, 0); - g = Sub(c2, 0); - h = Kfb(UD(evb(f2))); - i2 = Kfb(UD(evb(g))); - e = true; - do { - if (h > i2 - a.b && h < i2 + a.b) { - return -1; - } else - h > i2 - a.a && h < i2 + a.a && ++d; - h <= i2 && f2.b != f2.d.c ? h = Kfb(UD(evb(f2))) : i2 <= h && g.b != g.d.c ? i2 = Kfb(UD(evb(g))) : e = false; - } while (e); - } - return d; - } - function G2c(a, b) { - var c2, d; - Sed(a.a); - Ved(a.a, (x2c(), v2c), v2c); - Ved(a.a, w2c, w2c); - d = new ufd(); - pfd(d, w2c, (g3c(), e3c)); - dE(Gxd(b, ($4c(), I4c))) !== dE((g4c(), d4c)) && pfd(d, w2c, b3c); - Heb(TD(Gxd(b, T4c))) && pfd(d, w2c, f3c); - pfd(d, w2c, c3c); - Heb(TD(Gxd(b, V4c))) && nfd(d, w2c, d3c); - Ped(a.a, d); - c2 = Qed(a.a, b); - return c2; - } - function W6b(a, b, c2, d, e) { - var f2, g, h, i2; - i2 = (f2 = RD(mfb(E3), 9), new Fsb(f2, RD(WEb(f2, f2.length), 9), 0)); - for (h = new Anb(a.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - if (b[g.p]) { - X6b(g, b[g.p], d); - zsb(i2, g.j); - } - } - if (e) { - _6b(a, b, (qpd(), Xod), 2 * c2, d); - _6b(a, b, ppd, 2 * c2, d); - } else { - _6b(a, b, (qpd(), Yod), 2 * c2, d); - _6b(a, b, npd, 2 * c2, d); - } - } - function eec(a) { - var b, c2; - for (c2 = new is(Mr(a3b(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - if (b.d.i.k != (r3b(), n3b)) { - throw Adb(new Jed(nBe + X2b(a) + "' has its layer constraint set to LAST, but has at least one outgoing edge that does not go to a LAST_SEPARATE node. That must not happen.")); - } - } - } - function mHc(a, b, c2) { - var d, e, f2, g, h; - c2.Ug("Longest path layering", 1); - a.a = b; - h = a.a.a; - a.b = $C(kE, Pwe, 28, h.c.length, 15, 1); - d = 0; - for (g = new Anb(h); g.a < g.c.c.length; ) { - e = RD(ynb(g), 10); - e.p = d; - a.b[d] = -1; - ++d; - } - for (f2 = new Anb(h); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - oHc(a, e); - } - h.c.length = 0; - a.a = null; - a.b = null; - c2.Vg(); - } - function JUc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m; - i2 = 0; - for (k = new Anb(a.a); k.a < k.c.c.length; ) { - j = RD(ynb(k), 10); - h = 0; - for (f2 = new is(Mr(Z2b(j).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - l = K3b(e.c).b; - m = K3b(e.d).b; - h = $wnd.Math.max(h, $wnd.Math.abs(m - l)); - } - i2 = $wnd.Math.max(i2, h); - } - g = d * $wnd.Math.min(1, b / c2) * i2; - return g; - } - function J_c(a, b) { - var c2, d, e, f2, g; - g = RD(mQb(b, (h_c(), Y$c)), 433); - for (f2 = Sub(b.b, 0); f2.b != f2.d.c; ) { - e = RD(evb(f2), 40); - if (a.b[e.g] == 0) { - switch (g.g) { - case 0: - K_c(a, e); - break; - case 1: - I_c(a, e); - } - a.b[e.g] = 2; - } - } - for (d = Sub(a.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 65); - ze(c2.b.d, c2, true); - ze(c2.c.b, c2, true); - } - pQb(b, (q$c(), k$c), a.a); - } - function pse(a) { - var b; - b = new Rhb(); - (a & 256) != 0 && (b.a += "F", b); - (a & 128) != 0 && (b.a += "H", b); - (a & 512) != 0 && (b.a += "X", b); - (a & 2) != 0 && (b.a += "i", b); - (a & 8) != 0 && (b.a += "m", b); - (a & 4) != 0 && (b.a += "s", b); - (a & 32) != 0 && (b.a += "u", b); - (a & 64) != 0 && (b.a += "w", b); - (a & 16) != 0 && (b.a += "x", b); - (a & gwe) != 0 && (b.a += ",", b); - return shb(b.a); - } - function W8c(a, b) { - var c2, d, e, f2, g, h; - b.Ug(bGe, 1); - e = RD(Gxd(a, (X7c(), N7c)), 107); - f2 = (!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a); - g = yad(f2); - h = $wnd.Math.max(g.a, Kfb(UD(Gxd(a, (X6c(), U6c)))) - (e.b + e.c)); - d = $wnd.Math.max(g.b, Kfb(UD(Gxd(a, R6c))) - (e.d + e.a)); - c2 = d - g.b; - Ixd(a, M6c, c2); - Ixd(a, O6c, h); - Ixd(a, N6c, d + c2); - b.Vg(); - } - function pke(a, b) { - nke(); - var c2, d, e, f2; - if (!b) { - return mke; - } else if (b == (nme(), kme) || (b == Ule || b == Sle || b == Tle) && a != Rle) { - return new wke(a, b); - } else { - d = RD(b, 692); - c2 = d.$k(); - if (!c2) { - Afe(Qee((lke(), jke), b)); - c2 = d.$k(); - } - f2 = (!c2.i && (c2.i = new Tsb()), c2.i); - e = RD(Wd(qtb(f2.f, a)), 2041); - !e && Zjb(f2, a, e = new wke(a, b)); - return e; - } - } - function jHb(a, b) { - var c2, d; - d = rAb(a.b, b.b); - if (!d) { - throw Adb(new dgb("Invalid hitboxes for scanline constraint calculation.")); - } - (dHb(b.b, RD(tAb(a.b, b.b), 60)) || dHb(b.b, RD(sAb(a.b, b.b), 60))) && (gib(), String.fromCharCode(10)); - a.a[b.b.f] = RD(vAb(a.b, b.b), 60); - c2 = RD(uAb(a.b, b.b), 60); - !!c2 && (a.a[c2.f] = b.b); - } - function lTb(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - f2 = IGd(b, false, false); - j = ssd(f2); - l = Kfb(UD(Gxd(b, (tSb(), mSb)))); - e = jTb(j, l + a.a); - k = new ORb(e); - kQb(k, b); - Zjb(a.b, b, k); - ZEb(c2.c, k); - i2 = (!b.n && (b.n = new C5d(I4, b, 1, 7)), b.n); - for (h = new dMd(i2); h.e != h.i.gc(); ) { - g = RD(bMd(h), 135); - d = nTb(a, g, true, 0, 0); - ZEb(c2.c, d); - } - return k; - } - function Zec(a, b) { - var c2, d, e, f2, g, h, i2; - e = new bnb(); - for (c2 = 0; c2 <= a.j; c2++) { - d = new R4b(b); - d.p = a.j - c2; - ZEb(e.c, d); - } - for (h = new Anb(a.p); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - g3b(g, RD(Vmb(e, a.j - a.g[g.p]), 30)); - } - f2 = new Anb(e); - while (f2.a < f2.c.c.length) { - i2 = RD(ynb(f2), 30); - i2.a.c.length == 0 && znb(f2); - } - b.b.c.length = 0; - Tmb(b.b, e); - } - function xfc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - i2 = RD(mQb(a, (Ywc(), Awc)), 12); - j = xjd(cD(WC(l3, 1), Nve, 8, 0, [i2.i.n, i2.n, i2.a])).a; - k = a.i.n.b; - c2 = s2b(a.e); - for (e = c2, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - Z0b(d, i2); - Oub(d.a, new rjd(j, k)); - if (b) { - h = RD(mQb(d, (yCc(), RAc)), 75); - if (!h) { - h = new Ejd(); - pQb(d, RAc, h); - } - Mub(h, new rjd(j, k)); - } - } - } - function yfc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - e = RD(mQb(a, (Ywc(), Awc)), 12); - j = xjd(cD(WC(l3, 1), Nve, 8, 0, [e.i.n, e.n, e.a])).a; - k = a.i.n.b; - c2 = s2b(a.g); - for (g = c2, h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - Y0b(f2, e); - Nub(f2.a, new rjd(j, k)); - if (b) { - d = RD(mQb(f2, (yCc(), RAc)), 75); - if (!d) { - d = new Ejd(); - pQb(f2, RAc, d); - } - Mub(d, new rjd(j, k)); - } - } - } - function Khc(a) { - var b, c2, d, e, f2, g, h, i2, j; - d = a.b; - f2 = d.e; - g = Cod(RD(mQb(d, (yCc(), BBc)), 101)); - c2 = !!f2 && RD(mQb(f2, (Ywc(), kwc)), 21).Hc((ovc(), hvc)); - if (g || c2) { - return; - } - for (j = (h = new glb(a.e).a.vc().Kc(), new llb(h)); j.a.Ob(); ) { - i2 = (b = RD(j.a.Pb(), 44), RD(b.md(), 113)); - if (i2.a) { - e = i2.d; - P3b(e, null); - i2.c = true; - a.a = true; - } - } - } - function iic(a, b) { - var c2, d, e, f2; - b.Ug("Semi-Interactive Crossing Minimization Processor", 1); - c2 = false; - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - f2 = MDb(PDb(CDb(CDb(new SDb(null, new Swb(d.a, 16)), new nic()), new pic()), new ric()), new vic()); - c2 = c2 | f2.a != null; - } - c2 && pQb(a, (Ywc(), rwc), (Geb(), true)); - b.Vg(); - } - function rKc(a, b) { - var c2, d, e, f2, g, h; - a.b = new bnb(); - a.d = RD(mQb(b, (Ywc(), Lwc)), 234); - a.e = Lwb(a.d); - f2 = new Yub(); - e = dv(cD(WC(eR, 1), OAe, 36, 0, [b])); - g = 0; - while (g < e.c.length) { - d = (tFb(g, e.c.length), RD(e.c[g], 36)); - d.p = g++; - c2 = new FJc(d, a.a, a.b); - Tmb(e, c2.b); - Rmb(a.b, c2); - c2.s && (h = Sub(f2, 0), cvb(h, c2)); - } - a.c = new _sb(); - return f2; - } - function yMb(a, b) { - var c2, d, e, f2, g, h; - for (g = RD(RD(Qc(a.r, b), 21), 87).Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 117); - c2 = f2.c ? QKb(f2.c) : 0; - if (c2 > 0) { - if (f2.a) { - h = f2.b.Mf().a; - if (c2 > h) { - e = (c2 - h) / 2; - f2.d.b = e; - f2.d.c = e; - } - } else { - f2.d.c = a.s + c2; - } - } else if (Rod(a.u)) { - d = wsd(f2.b); - d.c < 0 && (f2.d.b = -d.c); - d.c + d.b > f2.b.Mf().a && (f2.d.c = d.c + d.b - f2.b.Mf().a); - } - } - } - function RUc(a, b) { - var c2, d, e, f2, g; - g = new bnb(); - c2 = b; - do { - f2 = RD(Wjb(a.b, c2), 131); - f2.B = c2.c; - f2.D = c2.d; - ZEb(g.c, f2); - c2 = RD(Wjb(a.k, c2), 18); - } while (c2); - d = (tFb(0, g.c.length), RD(g.c[0], 131)); - d.j = true; - d.A = RD(d.d.a.ec().Kc().Pb(), 18).c.i; - e = RD(Vmb(g, g.c.length - 1), 131); - e.q = true; - e.C = RD(e.d.a.ec().Kc().Pb(), 18).d.i; - return g; - } - function pPb(a) { - var b, c2; - b = RD(a.a, 17).a; - c2 = RD(a.b, 17).a; - if (b >= 0) { - if (b == c2) { - return new Ptd(sgb(-b - 1), sgb(-b - 1)); - } - if (b == -c2) { - return new Ptd(sgb(-b), sgb(c2 + 1)); - } - } - if ($wnd.Math.abs(b) > $wnd.Math.abs(c2)) { - if (b < 0) { - return new Ptd(sgb(-b), sgb(c2)); - } - return new Ptd(sgb(-b), sgb(c2 + 1)); - } - return new Ptd(sgb(b + 1), sgb(c2)); - } - function H8b(a) { - var b, c2; - c2 = RD(mQb(a, (yCc(), UAc)), 171); - b = RD(mQb(a, (Ywc(), owc)), 311); - if (c2 == (cxc(), $wc)) { - pQb(a, UAc, bxc); - pQb(a, owc, (Gvc(), Fvc)); - } else if (c2 == axc) { - pQb(a, UAc, bxc); - pQb(a, owc, (Gvc(), Dvc)); - } else if (b == (Gvc(), Fvc)) { - pQb(a, UAc, $wc); - pQb(a, owc, Evc); - } else if (b == Dvc) { - pQb(a, UAc, axc); - pQb(a, owc, Evc); - } - } - function dSc() { - dSc = geb; - bSc = new pSc(); - ZRc = pfd(new ufd(), (sXb(), pXb), (hcc(), Fbc)); - aSc = nfd(pfd(new ufd(), pXb, Tbc), rXb, Sbc); - cSc = mfd(mfd(rfd(nfd(pfd(new ufd(), nXb, bcc), rXb, acc), qXb), _bc), ccc); - $Rc = nfd(pfd(pfd(pfd(new ufd(), oXb, Ibc), qXb, Kbc), qXb, Lbc), rXb, Jbc); - _Rc = nfd(pfd(pfd(new ufd(), qXb, Lbc), qXb, qbc), rXb, pbc); - } - function HUc() { - HUc = geb; - CUc = pfd(nfd(new ufd(), (sXb(), rXb), (hcc(), tbc)), pXb, Fbc); - GUc = mfd(mfd(rfd(nfd(pfd(new ufd(), nXb, bcc), rXb, acc), qXb), _bc), ccc); - DUc = nfd(pfd(pfd(pfd(new ufd(), oXb, Ibc), qXb, Kbc), qXb, Lbc), rXb, Jbc); - FUc = pfd(pfd(new ufd(), pXb, Tbc), rXb, Sbc); - EUc = nfd(pfd(pfd(new ufd(), qXb, Lbc), qXb, qbc), rXb, pbc); - } - function eSc(a, b, c2, d, e) { - var f2, g; - if ((!W0b(b) && b.c.i.c == b.d.i.c || !djd(xjd(cD(WC(l3, 1), Nve, 8, 0, [e.i.n, e.n, e.a])), c2)) && !W0b(b)) { - b.c == e ? hu(b.a, 0, new sjd(c2)) : Mub(b.a, new sjd(c2)); - if (d && !Zsb(a.a, c2)) { - g = RD(mQb(b, (yCc(), RAc)), 75); - if (!g) { - g = new Ejd(); - pQb(b, RAc, g); - } - f2 = new sjd(c2); - Pub(g, f2, g.c.b, g.c); - Ysb(a.a, f2); - } - } - } - function ht(a, b) { - var c2, d, e, f2; - f2 = Ydb(Ndb(cwe, qgb(Ydb(Ndb(b == null ? 0 : tb(b), dwe)), 15))); - c2 = f2 & a.b.length - 1; - e = null; - for (d = a.b[c2]; d; e = d, d = d.a) { - if (d.d == f2 && Hb(d.i, b)) { - !e ? a.b[c2] = d.a : e.a = d.a; - Ts(RD(Hvb(d.c), 604), RD(Hvb(d.f), 604)); - Ss(RD(Hvb(d.b), 227), RD(Hvb(d.e), 227)); - --a.f; - ++a.e; - return true; - } - } - return false; - } - function dec(a) { - var b, c2; - for (c2 = new is(Mr(Z2b(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - if (b.c.i.k != (r3b(), n3b)) { - throw Adb(new Jed(nBe + X2b(a) + "' has its layer constraint set to FIRST, but has at least one incoming edge that does not come from a FIRST_SEPARATE node. That must not happen.")); - } - } - } - function Twd(a, b, c2) { - var d, e, f2, g, h, i2, j; - e = ggb(a.Db & 254); - if (e == 0) { - a.Eb = c2; - } else { - if (e == 1) { - h = $C(jJ, rve, 1, 2, 5, 1); - f2 = Xwd(a, b); - if (f2 == 0) { - h[0] = c2; - h[1] = a.Eb; - } else { - h[0] = a.Eb; - h[1] = c2; - } - } else { - h = $C(jJ, rve, 1, e + 1, 5, 1); - g = SD(a.Eb); - for (d = 2, i2 = 0, j = 0; d <= 128; d <<= 1) { - d == b ? h[j++] = c2 : (a.Db & d) != 0 && (h[j++] = g[i2++]); - } - } - a.Eb = h; - } - a.Db |= b; - } - function vQb(a, b, c2) { - var d, e, f2, g; - this.b = new bnb(); - e = 0; - d = 0; - for (g = new Anb(a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 176); - c2 && iPb(f2); - Rmb(this.b, f2); - e += f2.o; - d += f2.p; - } - if (this.b.c.length > 0) { - f2 = RD(Vmb(this.b, 0), 176); - e += f2.o; - d += f2.p; - } - e *= 2; - d *= 2; - b > 1 ? e = eE($wnd.Math.ceil(e * b)) : d = eE($wnd.Math.ceil(d / b)); - this.a = new gQb(e, d); - } - function mkc(a, b, c2, d, e, f2) { - var g, h, i2, j, k, l, m, n, o2, p, q, r; - k = d; - if (b.j && b.o) { - n = RD(Wjb(a.f, b.A), 60); - p = n.d.c + n.d.b; - --k; - } else { - p = b.a.c + b.a.b; - } - l = e; - if (c2.q && c2.o) { - n = RD(Wjb(a.f, c2.C), 60); - j = n.d.c; - ++l; - } else { - j = c2.a.c; - } - q = j - p; - i2 = $wnd.Math.max(2, l - k); - h = q / i2; - o2 = p + h; - for (m = k; m < l; ++m) { - g = RD(f2.Xb(m), 131); - r = g.a.b; - g.a.c = o2 - r / 2; - o2 += h; - } - } - function Wrc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - e = b ? new dsc() : new fsc(); - f2 = false; - do { - f2 = false; - j = b ? hv(a.b) : a.b; - for (i2 = j.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 30); - m = bv(h.a); - b || hv(m); - for (l = new Anb(m); l.a < l.c.c.length; ) { - k = RD(ynb(l), 10); - if (e.Mb(k)) { - d = k; - c2 = RD(mQb(k, (Ywc(), Wvc)), 313); - g = b ? c2.b : c2.k; - f2 = Urc(d, g, b, false); - } - } - } - } while (f2); - } - function sMc(a, b, c2, d, e, f2) { - var g, h, i2, j, k, l; - j = c2.c.length; - f2 && (a.c = $C(kE, Pwe, 28, b.length, 15, 1)); - for (g = e ? 0 : b.length - 1; e ? g < b.length : g >= 0; g += e ? 1 : -1) { - h = b[g]; - i2 = d == (qpd(), Xod) ? e ? b3b(h, d) : hv(b3b(h, d)) : e ? hv(b3b(h, d)) : b3b(h, d); - f2 && (a.c[h.p] = i2.gc()); - for (l = i2.Kc(); l.Ob(); ) { - k = RD(l.Pb(), 12); - a.d[k.p] = j++; - } - Tmb(c2, i2); - } - } - function AUc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - f2 = Kfb(UD(a.b.Kc().Pb())); - j = Kfb(UD(fr(b.b))); - d = ijd(ajd(a.a), j - c2); - e = ijd(ajd(b.a), c2 - f2); - k = $id(d, e); - ijd(k, 1 / (j - f2)); - this.a = k; - this.b = new bnb(); - h = true; - g = a.b.Kc(); - g.Pb(); - while (g.Ob()) { - i2 = Kfb(UD(g.Pb())); - if (h && i2 - c2 > AEe) { - this.b.Fc(c2); - h = false; - } - this.b.Fc(i2); - } - h && this.b.Fc(c2); - } - function mJb(a) { - var b, c2, d, e; - pJb(a, a.n); - if (a.d.c.length > 0) { - Nnb(a.c); - while (xJb(a, RD(ynb(new Anb(a.e.a)), 125)) < a.e.a.c.length) { - b = rJb(a); - e = b.e.e - b.d.e - b.a; - b.e.j && (e = -e); - for (d = new Anb(a.e.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 125); - c2.j && (c2.e += e); - } - Nnb(a.c); - } - Nnb(a.c); - uJb(a, RD(ynb(new Anb(a.e.a)), 125)); - iJb(a); - } - } - function ned(a, b) { - hed(); - var c2, d; - c2 = ugd(ygd(), b.Pg()); - if (c2) { - d = c2.j; - if (ZD(a, 207)) { - return xCd(RD(a, 27)) ? Csb(d, (Yhd(), Vhd)) || Csb(d, Whd) : Csb(d, (Yhd(), Vhd)); - } else if (ZD(a, 326)) { - return Csb(d, (Yhd(), Thd)); - } else if (ZD(a, 193)) { - return Csb(d, (Yhd(), Xhd)); - } else if (ZD(a, 366)) { - return Csb(d, (Yhd(), Uhd)); - } - } - return true; - } - function Cge(a, b, c2) { - var d, e, f2, g, h, i2; - e = c2; - f2 = e.Lk(); - if (qke(a.e, f2)) { - if (f2.Si()) { - d = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (pb(h, e) && g != b) { - throw Adb(new agb(LIe)); - } - } - } - } else { - i2 = pke(a.e.Dh(), f2); - d = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - h = d[g]; - if (i2.am(h.Lk()) && g != b) { - throw Adb(new agb(gLe)); - } - } - } - return RD(eHd(a, b, c2), 76); - } - function hz(d, b) { - if (b instanceof Object) { - try { - b.__java$exception = d; - if (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && $doc.documentMode < 9) { - return; - } - var c2 = d; - Object.defineProperties(b, { cause: { get: function() { - var a = c2.he(); - return a && a.fe(); - } }, suppressed: { get: function() { - return c2.ge(); - } } }); - } catch (a) { - } - } - } - function tjb(a, b) { - var c2, d, e, f2, g; - d = b >> 5; - b &= 31; - if (d >= a.d) { - return a.e < 0 ? (Pib(), Jib) : (Pib(), Oib); - } - f2 = a.d - d; - e = $C(kE, Pwe, 28, f2 + 1, 15, 1); - ujb(e, f2, a.a, d, b); - if (a.e < 0) { - for (c2 = 0; c2 < d && a.a[c2] == 0; c2++) - ; - if (c2 < d || b > 0 && a.a[c2] << 32 - b != 0) { - for (c2 = 0; c2 < f2 && e[c2] == -1; c2++) { - e[c2] = 0; - } - c2 == f2 && ++f2; - ++e[c2]; - } - } - g = new cjb(a.e, f2, e); - Rib(g); - return g; - } - function LSb(a) { - var b, c2, d, e; - e = MCd(a); - c2 = new bTb(e); - d = new dTb(e); - b = new bnb(); - Tmb(b, (!a.d && (a.d = new Yie(G4, a, 8, 5)), a.d)); - Tmb(b, (!a.e && (a.e = new Yie(G4, a, 7, 4)), a.e)); - return RD(zDb(GDb(CDb(new SDb(null, new Swb(b, 16)), c2), d), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), wBb), vBb]))), 21); - } - function Tdc(a, b) { - var c2; - c2 = RD(mQb(a, (yCc(), xAc)), 283); - b.Ug("Label side selection (" + c2 + ")", 1); - switch (c2.g) { - case 0: - Udc(a, (Pnd(), Lnd)); - break; - case 1: - Udc(a, (Pnd(), Mnd)); - break; - case 2: - Sdc(a, (Pnd(), Lnd)); - break; - case 3: - Sdc(a, (Pnd(), Mnd)); - break; - case 4: - Vdc(a, (Pnd(), Lnd)); - break; - case 5: - Vdc(a, (Pnd(), Mnd)); - } - b.Vg(); - } - function qke(a, b) { - nke(); - var c2, d, e; - if (b.Jk()) { - return true; - } else if (b.Ik() == -2) { - if (b == (Lle(), Jle) || b == Gle || b == Hle || b == Ile) { - return true; - } else { - e = a.Dh(); - if (BYd(e, b) >= 0) { - return false; - } else { - c2 = Eee((lke(), jke), e, b); - if (!c2) { - return true; - } else { - d = c2.Ik(); - return (d > 1 || d == -1) && yfe(Qee(jke, c2)) != 3; - } - } - } - } else { - return false; - } - } - function _4b(a, b, c2, d) { - var e, f2, g, h, i2; - h = AGd(RD(QHd((!b.b && (b.b = new Yie(E4, b, 4, 7)), b.b), 0), 84)); - i2 = AGd(RD(QHd((!b.c && (b.c = new Yie(E4, b, 5, 8)), b.c), 0), 84)); - if (vCd(h) == vCd(i2)) { - return null; - } - if (NGd(i2, h)) { - return null; - } - g = kzd(b); - if (g == c2) { - return d; - } else { - f2 = RD(Wjb(a.a, g), 10); - if (f2) { - e = f2.e; - if (e) { - return e; - } - } - } - return null; - } - function uHc(a, b, c2) { - var d, e, f2, g, h; - c2.Ug("Longest path to source layering", 1); - a.a = b; - h = a.a.a; - a.b = $C(kE, Pwe, 28, h.c.length, 15, 1); - d = 0; - for (g = new Anb(h); g.a < g.c.c.length; ) { - e = RD(ynb(g), 10); - e.p = d; - a.b[d] = -1; - ++d; - } - for (f2 = new Anb(h); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - wHc(a, e); - } - h.c.length = 0; - a.a = null; - a.b = null; - c2.Vg(); - } - function BKc(a, b, c2) { - var d, e, f2, g, h, i2; - d = pKc(c2, a.length); - g = a[d]; - f2 = qKc(c2, g.length); - if (g[f2].k != (r3b(), m3b)) { - return; - } - i2 = b.j; - for (e = 0; e < i2.c.length; e++) { - h = (tFb(e, i2.c.length), RD(i2.c[e], 12)); - if ((c2 ? h.j == (qpd(), Xod) : h.j == (qpd(), ppd)) && Heb(TD(mQb(h, (Ywc(), nwc))))) { - $mb(i2, e, RD(mQb(g[f2], (Ywc(), Awc)), 12)); - f2 += c2 ? 1 : -1; - } - } - } - function n8c(a, b) { - var c2, d, e, f2, g, h, i2, j; - b.Ug("Greedy Width Approximator", 1); - c2 = Kfb(UD(Gxd(a, (X7c(), x7c)))); - i2 = RD(Gxd(a, N7c), 107); - f2 = RD(Gxd(a, U7c), 394); - g = Heb(TD(Gxd(a, T7c))); - h = Kfb(UD(Gxd(a, Q7c))); - j = (!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a); - Bad(j); - e = new g8c(c2, f2, g); - d = c8c(e, j, h, i2); - Ixd(a, (X6c(), W6c), d.c); - b.Vg(); - } - function yKd(a) { - if (a.g == null) { - switch (a.p) { - case 0: - a.g = qKd(a) ? (Geb(), Feb) : (Geb(), Eeb); - break; - case 1: - a.g = $eb(rKd(a)); - break; - case 2: - a.g = hfb(sKd(a)); - break; - case 3: - a.g = tKd(a); - break; - case 4: - a.g = new Tfb(uKd(a)); - break; - case 6: - a.g = Hgb(wKd(a)); - break; - case 5: - a.g = sgb(vKd(a)); - break; - case 7: - a.g = bhb(xKd(a)); - } - } - return a.g; - } - function HKd(a) { - if (a.n == null) { - switch (a.p) { - case 0: - a.n = zKd(a) ? (Geb(), Feb) : (Geb(), Eeb); - break; - case 1: - a.n = $eb(AKd(a)); - break; - case 2: - a.n = hfb(BKd(a)); - break; - case 3: - a.n = CKd(a); - break; - case 4: - a.n = new Tfb(DKd(a)); - break; - case 6: - a.n = Hgb(FKd(a)); - break; - case 5: - a.n = sgb(EKd(a)); - break; - case 7: - a.n = bhb(GKd(a)); - } - } - return a.n; - } - function Pfe(a, b, c2, d) { - var e, f2, g, h, i2; - h = (nke(), RD(b, 69).xk()); - if (qke(a.e, b)) { - if (b.Si() && dge(a, b, d, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0)) { - throw Adb(new agb(LIe)); - } - } else { - i2 = pke(a.e.Dh(), b); - e = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i2.am(f2.Lk())) { - throw Adb(new agb(gLe)); - } - } - } - VGd(a, gge(a, b, c2), h ? RD(d, 76) : oke(b, d)); - } - function HGb(a) { - var b, c2, d, e, f2, g, h; - for (f2 = new Anb(a.a.a); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 316); - d.g = 0; - d.i = 0; - d.e.a.$b(); - } - for (e = new Anb(a.a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 316); - for (c2 = d.a.a.ec().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 60); - for (h = b.c.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 60); - if (g.a != d) { - Ysb(d.e, g); - ++g.a.g; - ++g.a.i; - } - } - } - } - } - function X8b(a) { - var b, c2, d, e, f2; - e = RD(mQb(a, (yCc(), lBc)), 21); - f2 = RD(mQb(a, oBc), 21); - c2 = new rjd(a.f.a + a.d.b + a.d.c, a.f.b + a.d.d + a.d.a); - b = new sjd(c2); - if (e.Hc((Qpd(), Mpd))) { - d = RD(mQb(a, nBc), 8); - if (f2.Hc((dqd(), Ypd))) { - d.a <= 0 && (d.a = 20); - d.b <= 0 && (d.b = 20); - } - b.a = $wnd.Math.max(c2.a, d.a); - b.b = $wnd.Math.max(c2.b, d.b); - } - Y8b(a, c2, b); - } - function SYb(a, b) { - var c2, d, e; - b.a ? (rAb(a.b, b.b), a.a[b.b.i] = RD(vAb(a.b, b.b), 86), c2 = RD(uAb(a.b, b.b), 86), !!c2 && (a.a[c2.i] = b.b), void 0) : (d = RD(vAb(a.b, b.b), 86), !!d && d == a.a[b.b.i] && !!d.d && d.d != b.b.d && d.f.Fc(b.b), e = RD(uAb(a.b, b.b), 86), !!e && a.a[e.i] == b.b && !!e.d && e.d != b.b.d && b.b.f.Fc(e), wAb(a.b, b.b), void 0); - } - function Oec(a, b) { - var c2, d, e, f2, g, h; - f2 = a.d; - h = Kfb(UD(mQb(a, (yCc(), FAc)))); - if (h < 0) { - h = 0; - pQb(a, FAc, h); - } - b.o.b = h; - g = $wnd.Math.floor(h / 2); - d = new R3b(); - Q3b(d, (qpd(), ppd)); - P3b(d, b); - d.n.b = g; - e = new R3b(); - Q3b(e, Xod); - P3b(e, b); - e.n.b = g; - Z0b(a, d); - c2 = new a1b(); - kQb(c2, a); - pQb(c2, RAc, null); - Y0b(c2, e); - Z0b(c2, f2); - Nec(b, a, c2); - Lec(a, c2); - return c2; - } - function URc(a) { - var b, c2; - c2 = RD(mQb(a, (Ywc(), kwc)), 21); - b = new ufd(); - if (c2.Hc((ovc(), ivc))) { - ofd(b, ORc); - ofd(b, QRc); - } - if (c2.Hc(kvc) || Heb(TD(mQb(a, (yCc(), GAc))))) { - ofd(b, QRc); - c2.Hc(lvc) && ofd(b, RRc); - } - c2.Hc(hvc) && ofd(b, NRc); - c2.Hc(nvc) && ofd(b, SRc); - c2.Hc(jvc) && ofd(b, PRc); - c2.Hc(evc) && ofd(b, LRc); - c2.Hc(gvc) && ofd(b, MRc); - return b; - } - function Qjb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - d = a.d; - f2 = b.d; - h = d + f2; - i2 = a.e != b.e ? -1 : 1; - if (h == 2) { - k = Ndb(Cdb(a.a[0], yxe), Cdb(b.a[0], yxe)); - m = Ydb(k); - l = Ydb(Udb(k, 32)); - return l == 0 ? new ajb(i2, m) : new cjb(i2, 2, cD(WC(kE, 1), Pwe, 28, 15, [m, l])); - } - c2 = a.a; - e = b.a; - g = $C(kE, Pwe, 28, h, 15, 1); - Njb(c2, d, e, f2, g); - j = new cjb(i2, h, g); - Rib(j); - return j; - } - function Uyb(a, b, c2, d) { - var e, f2; - if (!b) { - return c2; - } else { - e = a.a.Ne(c2.d, b.d); - if (e == 0) { - d.d = qlb(b, c2.e); - d.b = true; - return b; - } - f2 = e < 0 ? 0 : 1; - b.a[f2] = Uyb(a, b.a[f2], c2, d); - if (Vyb(b.a[f2])) { - if (Vyb(b.a[1 - f2])) { - b.b = true; - b.a[0].b = false; - b.a[1].b = false; - } else { - Vyb(b.a[f2].a[f2]) ? b = azb(b, 1 - f2) : Vyb(b.a[f2].a[1 - f2]) && (b = _yb(b, 1 - f2)); - } - } - } - return b; - } - function nKb(a, b, c2) { - var d, e, f2, g; - e = a.i; - d = a.n; - mKb(a, (ZJb(), WJb), e.c + d.b, c2); - mKb(a, YJb, e.c + e.b - d.c - c2[2], c2); - g = e.b - d.b - d.c; - if (c2[0] > 0) { - c2[0] += a.d; - g -= c2[0]; - } - if (c2[2] > 0) { - c2[2] += a.d; - g -= c2[2]; - } - f2 = $wnd.Math.max(0, g); - c2[1] = $wnd.Math.max(c2[1], g); - mKb(a, XJb, e.c + d.b + c2[0] - (c2[1] - g) / 2, c2); - if (b == XJb) { - a.c.b = f2; - a.c.c = e.c + d.b + (f2 - g) / 2; - } - } - function D_b() { - this.c = $C(iE, vxe, 28, (qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd])).length, 15, 1); - this.b = $C(iE, vxe, 28, cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd]).length, 15, 1); - this.a = $C(iE, vxe, 28, cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd]).length, 15, 1); - Lnb(this.c, oxe); - Lnb(this.b, pxe); - Lnb(this.a, pxe); - } - function rte(a, b, c2) { - var d, e, f2, g; - if (b <= c2) { - e = b; - f2 = c2; - } else { - e = c2; - f2 = b; - } - d = 0; - if (a.b == null) { - a.b = $C(kE, Pwe, 28, 2, 15, 1); - a.b[0] = e; - a.b[1] = f2; - a.c = true; - } else { - d = a.b.length; - if (a.b[d - 1] + 1 == e) { - a.b[d - 1] = f2; - return; - } - g = $C(kE, Pwe, 28, d + 2, 15, 1); - hib(a.b, 0, g, 0, d); - a.b = g; - a.b[d - 1] >= e && (a.c = false, a.a = false); - a.b[d++] = e; - a.b[d] = f2; - a.c || vte(a); - } - } - function Oqc(a, b, c2) { - var d, e, f2, g, h, i2, j; - j = b.d; - a.a = new cnb(j.c.length); - a.c = new Tsb(); - for (h = new Anb(j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 105); - f2 = new USc(null); - Rmb(a.a, f2); - Zjb(a.c, g, f2); - } - a.b = new Tsb(); - Mqc(a, b); - for (d = 0; d < j.c.length - 1; d++) { - i2 = RD(Vmb(b.d, d), 105); - for (e = d + 1; e < j.c.length; e++) { - Pqc(a, i2, RD(Vmb(b.d, e), 105), c2); - } - } - } - function Q2c(a) { - var b, c2, d, e, f2; - e = new bnb(); - b = new btb((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); - for (d = new is(Mr(zGd(a).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 74); - if (!ZD(QHd((!c2.b && (c2.b = new Yie(E4, c2, 4, 7)), c2.b), 0), 193)) { - f2 = AGd(RD(QHd((!c2.c && (c2.c = new Yie(E4, c2, 5, 8)), c2.c), 0), 84)); - b.a._b(f2) || (ZEb(e.c, f2), true); - } - } - return e; - } - function Nqe(a, b, c2) { - var d, e, f2; - a.e = c2; - a.d = 0; - a.b = 0; - a.f = 1; - a.i = b; - (a.e & 16) == 16 && (a.i = use(a.i)); - a.j = a.i.length; - Mqe(a); - f2 = Qqe(a); - if (a.d != a.j) - throw Adb(new Lqe(TId((Hde(), TIe)))); - if (a.g) { - for (d = 0; d < a.g.a.c.length; d++) { - e = RD(eyb(a.g, d), 592); - if (a.f <= e.a) - throw Adb(new Lqe(TId((Hde(), UIe)))); - } - a.g.a.c.length = 0; - } - return f2; - } - function BNc(a, b) { - var c2, d, e, f2, g, h, i2; - c2 = pxe; - h = (r3b(), p3b); - for (e = new Anb(b.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - f2 = d.k; - if (f2 != p3b) { - g = UD(mQb(d, (Ywc(), Cwc))); - if (g == null) { - c2 = $wnd.Math.max(c2, 0); - d.n.b = c2 + aFc(a.a, f2, h); - } else { - d.n.b = (uFb(g), g); - } - } - i2 = aFc(a.a, f2, h); - d.n.b < c2 + i2 + d.d.d && (d.n.b = c2 + i2 + d.d.d); - c2 = d.n.b + d.o.b + d.d.a; - h = f2; - } - } - function w3c(a, b, c2, d, e) { - var f2, g, h, i2, j, k; - !!a.d && a.d.Gg(e); - f2 = RD(e.Xb(0), 27); - if (u3c(a, c2, f2, false)) { - return true; - } - g = RD(e.Xb(e.gc() - 1), 27); - if (u3c(a, d, g, true)) { - return true; - } - if (p3c(a, e)) { - return true; - } - for (k = e.Kc(); k.Ob(); ) { - j = RD(k.Pb(), 27); - for (i2 = b.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 27); - if (o3c(a, j, h)) { - return true; - } - } - } - return false; - } - function Ovd(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - m = b.c.length; - l = (j = a.Ih(c2), RD(j >= 0 ? a.Lh(j, false, true) : Qvd(a, c2, false), 61)); - n: - for (f2 = l.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 58); - for (k = 0; k < m; ++k) { - g = (tFb(k, b.c.length), RD(b.c[k], 76)); - i2 = g.md(); - h = g.Lk(); - d = e.Nh(h, false); - if (i2 == null ? d != null : !pb(i2, d)) { - continue n; - } - } - return e; - } - return null; - } - function o6b(a, b) { - var c2, d, e, f2, g, h, i2; - b.Ug("Comment post-processing", 1); - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - d = new bnb(); - for (h = new Anb(e.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - i2 = RD(mQb(g, (Ywc(), Xwc)), 15); - c2 = RD(mQb(g, Vvc), 15); - if (!!i2 || !!c2) { - p6b(g, i2, c2); - !!i2 && Tmb(d, i2); - !!c2 && Tmb(d, c2); - } - } - Tmb(e.a, d); - } - b.Vg(); - } - function kac(a, b, c2, d) { - var e, f2, g, h; - e = RD(e3b(b, (qpd(), ppd)).Kc().Pb(), 12); - f2 = RD(e3b(b, Xod).Kc().Pb(), 12); - for (h = new Anb(a.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - while (g.e.c.length != 0) { - Z0b(RD(Vmb(g.e, 0), 18), e); - } - while (g.g.c.length != 0) { - Y0b(RD(Vmb(g.g, 0), 18), f2); - } - } - c2 || pQb(b, (Ywc(), vwc), null); - d || pQb(b, (Ywc(), wwc), null); - } - function IGd(a, b, c2) { - var d, e; - if ((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i == 0) { - return EGd(a); - } else { - d = RD(QHd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a), 0), 166); - if (b) { - sLd((!d.a && (d.a = new XZd(D4, d, 5)), d.a)); - Ozd(d, 0); - Pzd(d, 0); - Hzd(d, 0); - Izd(d, 0); - } - if (c2) { - e = (!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a); - while (e.i > 1) { - vLd(e, e.i - 1); - } - } - return d; - } - } - function Vdc(a, b) { - var c2, d, e, f2, g, h, i2; - c2 = new wmb(); - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - i2 = true; - d = 0; - for (h = new Anb(e.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - switch (g.k.g) { - case 4: - ++d; - case 1: - imb(c2, g); - break; - case 0: - Xdc(g, b); - default: - c2.b == c2.c || Wdc(c2, d, i2, false, b); - i2 = false; - d = 0; - } - } - c2.b == c2.c || Wdc(c2, d, i2, true, b); - } - } - function iMc(a, b) { - var c2, d, e, f2, g, h; - c2 = 0; - for (h = new Anb(b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - $Lc(a.b, a.d[g.p]); - for (e = new l4b(g.b); xnb(e.a) || xnb(e.b); ) { - d = RD(xnb(e.a) ? ynb(e.a) : ynb(e.b), 18); - f2 = AMc(a, g == d.c ? d.d : d.c); - if (f2 > a.d[g.p]) { - c2 += ZLc(a.b, f2); - hmb(a.a, sgb(f2)); - } - } - while (!nmb(a.a)) { - XLc(a.b, RD(smb(a.a), 17).a); - } - } - return c2; - } - function Uec(a) { - var b, c2, d, e, f2, g, h, i2, j; - a.a = new e6b(); - j = 0; - e = 0; - for (d = new Anb(a.i.b); d.a < d.c.c.length; ) { - b = RD(ynb(d), 30); - b.p = e; - for (i2 = new Anb(b.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - h.p = j; - ++j; - } - ++e; - } - f2 = a.r == (aEc(), TDc); - g = f2 ? Qec : Pec; - for (c2 = new Anb(a.i.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 30); - _mb(b.a, g); - d6b(a.a, sgb(b.p), b.a); - } - } - function zed(a, b, c2) { - var d, e, f2, g; - f2 = (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i; - for (e = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - (!d.a && (d.a = new C5d(J4, d, 10, 11)), d.a).i == 0 || (f2 += zed(a, d, false)); - } - if (c2) { - g = vCd(b); - while (g) { - f2 += (!g.a && (g.a = new C5d(J4, g, 10, 11)), g.a).i; - g = vCd(g); - } - } - return f2; - } - function vLd(a, b) { - var c2, d, e, f2; - if (a.Pj()) { - d = null; - e = a.Qj(); - a.Tj() && (d = a.Vj(a.$i(b), null)); - c2 = a.Ij(4, f2 = THd(a, b), null, b, e); - if (a.Mj() && f2 != null) { - d = a.Oj(f2, d); - if (!d) { - a.Jj(c2); - } else { - d.nj(c2); - d.oj(); - } - } else { - if (!d) { - a.Jj(c2); - } else { - d.nj(c2); - d.oj(); - } - } - return f2; - } else { - f2 = THd(a, b); - if (a.Mj() && f2 != null) { - d = a.Oj(f2, null); - !!d && d.oj(); - } - return f2; - } - } - function LNb(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - j = a.a; - b = new _sb(); - i2 = 0; - for (d = new Anb(a.d); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 226); - k = 0; - tvb(c2.b, new ONb()); - for (g = Sub(c2.b, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 226); - if (b.a._b(f2)) { - e = c2.c; - h = f2.c; - k < h.d + h.a + j && k + e.a + j > h.d && (k = h.d + h.a + j); - } - } - c2.c.d = k; - b.a.zc(c2, b); - i2 = $wnd.Math.max(i2, c2.c.d + c2.c.a); - } - return i2; - } - function ovc() { - ovc = geb; - fvc = new pvc("COMMENTS", 0); - hvc = new pvc("EXTERNAL_PORTS", 1); - ivc = new pvc("HYPEREDGES", 2); - jvc = new pvc("HYPERNODES", 3); - kvc = new pvc("NON_FREE_PORTS", 4); - lvc = new pvc("NORTH_SOUTH_PORTS", 5); - nvc = new pvc(FBe, 6); - evc = new pvc("CENTER_LABELS", 7); - gvc = new pvc("END_LABELS", 8); - mvc = new pvc("PARTITIONS", 9); - } - function PA(a, b, c2, d, e) { - if (d < 0) { - d = EA(a, e, cD(WC(qJ, 1), Nve, 2, 6, [Cwe, Dwe, Ewe, Fwe, Gwe, Hwe, Iwe, Jwe, Kwe, Lwe, Mwe, Nwe]), b); - d < 0 && (d = EA(a, e, cD(WC(qJ, 1), Nve, 2, 6, ["Jan", "Feb", "Mar", "Apr", Gwe, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]), b)); - if (d < 0) { - return false; - } - c2.k = d; - return true; - } else if (d > 0) { - c2.k = d - 1; - return true; - } - return false; - } - function RA(a, b, c2, d, e) { - if (d < 0) { - d = EA(a, e, cD(WC(qJ, 1), Nve, 2, 6, [Cwe, Dwe, Ewe, Fwe, Gwe, Hwe, Iwe, Jwe, Kwe, Lwe, Mwe, Nwe]), b); - d < 0 && (d = EA(a, e, cD(WC(qJ, 1), Nve, 2, 6, ["Jan", "Feb", "Mar", "Apr", Gwe, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]), b)); - if (d < 0) { - return false; - } - c2.k = d; - return true; - } else if (d > 0) { - c2.k = d - 1; - return true; - } - return false; - } - function TA(a, b, c2, d, e, f2) { - var g, h, i2, j; - h = 32; - if (d < 0) { - if (b[0] >= a.length) { - return false; - } - h = ihb(a, b[0]); - if (h != 43 && h != 45) { - return false; - } - ++b[0]; - d = HA(a, b); - if (d < 0) { - return false; - } - h == 45 && (d = -d); - } - if (h == 32 && b[0] - c2 == 2 && e.b == 2) { - i2 = new uB(); - j = i2.q.getFullYear() - Owe + Owe - 80; - g = j % 100; - f2.a = d == g; - d += (j / 100 | 0) * 100 + (d < g ? 100 : 0); - } - f2.p = d; - return true; - } - function V4b(a, b) { - var c2, d, e, f2, g; - if (!vCd(a)) { - return; - } - g = RD(mQb(b, (yCc(), lBc)), 181); - dE(Gxd(a, BBc)) === dE((Bod(), Aod)) && Ixd(a, BBc, zod); - d = (lud(), new zud(vCd(a))); - f2 = new Fud(!vCd(a) ? null : new zud(vCd(a)), a); - e = GJb(d, f2, false, true); - zsb(g, (Qpd(), Mpd)); - c2 = RD(mQb(b, nBc), 8); - c2.a = $wnd.Math.max(e.a, c2.a); - c2.b = $wnd.Math.max(e.b, c2.b); - } - function cec(a, b, c2) { - var d, e, f2, g, h, i2; - for (g = RD(mQb(a, (Ywc(), lwc)), 15).Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 10); - switch (RD(mQb(f2, (yCc(), UAc)), 171).g) { - case 2: - g3b(f2, b); - break; - case 4: - g3b(f2, c2); - } - for (e = new is(Mr(W2b(f2).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - if (!!d.c && !!d.d) { - continue; - } - h = !d.d; - i2 = RD(mQb(d, Ewc), 12); - h ? Z0b(d, i2) : Y0b(d, i2); - } - } - } - function epc() { - epc = geb; - Zoc = new fpc(_ye, 0, (qpd(), Yod), Yod); - apc = new fpc(bze, 1, npd, npd); - Yoc = new fpc(aze, 2, Xod, Xod); - dpc = new fpc(cze, 3, ppd, ppd); - _oc = new fpc("NORTH_WEST_CORNER", 4, ppd, Yod); - $oc = new fpc("NORTH_EAST_CORNER", 5, Yod, Xod); - cpc = new fpc("SOUTH_WEST_CORNER", 6, npd, ppd); - bpc = new fpc("SOUTH_EAST_CORNER", 7, Xod, npd); - } - function P2c(a) { - var b, c2, d, e, f2, g; - f2 = new _sb(); - b = new btb((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); - for (e = new is(Mr(zGd(a).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 74); - if (!ZD(QHd((!d.b && (d.b = new Yie(E4, d, 4, 7)), d.b), 0), 193)) { - g = AGd(RD(QHd((!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c), 0), 84)); - b.a._b(g) || (c2 = f2.a.zc(g, f2), c2 == null); - } - } - return f2; - } - function tid() { - tid = geb; - sid = cD(WC(lE, 1), rxe, 28, 14, [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368e3, { l: 3506176, m: 794077, h: 1 }, { l: 884736, m: 916411, h: 20 }, { l: 3342336, m: 3912489, h: 363 }, { l: 589824, m: 3034138, h: 6914 }, { l: 3407872, m: 1962506, h: 138294 }]); - $wnd.Math.pow(2, -65); - } - function Ljb() { - Ljb = geb; - var a, b; - Jjb = $C(uJ, Nve, 92, 32, 0, 1); - Kjb = $C(uJ, Nve, 92, 32, 0, 1); - a = 1; - for (b = 0; b <= 18; b++) { - Jjb[b] = (Pib(), Ddb(a, 0) >= 0 ? jjb(a) : Xib(jjb(Odb(a)))); - Kjb[b] = Jdb(Sdb(a, b), 0) ? jjb(Sdb(a, b)) : Xib(jjb(Odb(Sdb(a, b)))); - a = Ndb(a, 5); - } - for (; b < Kjb.length; b++) { - Jjb[b] = Wib(Jjb[b - 1], Jjb[1]); - Kjb[b] = Wib(Kjb[b - 1], (Pib(), Mib)); - } - } - function tgc(a, b) { - var c2, d, e, f2, g; - if (a.c.length == 0) { - return new Ptd(sgb(0), sgb(0)); - } - c2 = (tFb(0, a.c.length), RD(a.c[0], 12)).j; - g = 0; - f2 = b.g; - d = b.g + 1; - while (g < a.c.length - 1 && c2.g < f2) { - ++g; - c2 = (tFb(g, a.c.length), RD(a.c[g], 12)).j; - } - e = g; - while (e < a.c.length - 1 && c2.g < d) { - ++e; - c2 = (tFb(g, a.c.length), RD(a.c[g], 12)).j; - } - return new Ptd(sgb(g), sgb(e)); - } - function NJc(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - i2 = b3b(b, c2); - (c2 == (qpd(), npd) || c2 == ppd) && (i2 = hv(i2)); - g = false; - do { - e = false; - for (f2 = 0; f2 < i2.gc() - 1; f2++) { - j = RD(i2.Xb(f2), 12); - h = RD(i2.Xb(f2 + 1), 12); - if (OJc(a, j, h, d)) { - g = true; - CMc(a.a, RD(i2.Xb(f2), 12), RD(i2.Xb(f2 + 1), 12)); - k = RD(i2.Xb(f2 + 1), 12); - i2.hd(f2 + 1, RD(i2.Xb(f2), 12)); - i2.hd(f2, k); - e = true; - } - } - } while (e); - return g; - } - function lZc(a, b, c2) { - var d, e, f2, g; - c2.Ug(MEe, 1); - e = RD(zDb(CDb(new SDb(null, new Swb(b.b, 16)), new pZc()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - mZc(a, e, 0); - for (g = Sub(b.b, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 40); - d = Wjb(a.a, sgb(f2.g)) != null ? RD(Wjb(a.a, sgb(f2.g)), 17).a : 0; - pQb(f2, (h_c(), f_c), sgb(d)); - } - c2.Vg(); - } - function o3c(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - h = b.i - a.g / 2; - i2 = c2.i - a.g / 2; - j = b.j - a.g / 2; - k = c2.j - a.g / 2; - f2 = b.g + a.g; - g = c2.g + a.g; - d = b.f + a.g; - e = c2.f + a.g; - if (h < i2 + g && i2 < h && j < k + e && k < j) { - return true; - } else if (i2 < h + f2 && h < i2 && k < j + d && j < k) { - return true; - } else if (h < i2 + g && i2 < h && j < k && k < j + d) { - return true; - } else if (i2 < h + f2 && h < i2 && j < k + e && k < j) { - return true; - } - return false; - } - function gdc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - f2 = b.c.length; - g = (tFb(c2, b.c.length), RD(b.c[c2], 293)); - h = g.a.o.a; - l = g.c; - m = 0; - for (j = g.c; j <= g.f; j++) { - if (h <= a.a[j]) { - return j; - } - k = a.a[j]; - i2 = null; - for (e = c2 + 1; e < f2; e++) { - d = (tFb(e, b.c.length), RD(b.c[e], 293)); - d.c <= j && d.f >= j && (i2 = d); - } - !!i2 && (k = $wnd.Math.max(k, i2.a.o.a)); - if (k > m) { - l = j; - m = k; - } - } - return l; - } - function SNb(a) { - var b, c2, d, e, f2, g, h; - f2 = new yAb(RD(Qb(new eOb()), 50)); - h = pxe; - for (c2 = new Anb(a.d); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 226); - h = b.c.c; - while (f2.a.gc() != 0) { - g = RD(f2.a.Tc(), 226); - if (g.c.c + g.c.b < h) { - f2.a.Bc(g) != null; - } else { - break; - } - } - for (e = f2.a.ec().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 226); - Mub(d.b, b); - Mub(b.b, d); - } - f2.a.zc(b, (Geb(), Eeb)) == null; - } - } - function sZc(a, b, c2) { - var d, e, f2, g, h; - if (!gr(b)) { - h = c2.eh((ZD(b, 16) ? RD(b, 16).gc() : Kr(b.Kc())) / a.a | 0); - h.Ug(OEe, 1); - g = new vZc(); - f2 = null; - for (e = b.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 40); - g = Al(cD(WC(cJ, 1), rve, 20, 0, [g, new dXc(d)])); - if (f2) { - pQb(f2, (q$c(), l$c), d); - pQb(d, b$c, f2); - if (_Wc(d) == _Wc(f2)) { - pQb(f2, m$c, d); - pQb(d, c$c, f2); - } - } - f2 = d; - } - h.Vg(); - sZc(a, g, c2); - } - } - function z1d(a, b) { - var c2, d, e; - if (b == null) { - for (d = (!a.a && (a.a = new C5d(l7, a, 9, 5)), new dMd(a.a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 694); - e = c2.c; - if ((e == null ? c2.zb : e) == null) { - return c2; - } - } - } else { - for (d = (!a.a && (a.a = new C5d(l7, a, 9, 5)), new dMd(a.a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 694); - if (lhb(b, (e = c2.c, e == null ? c2.zb : e))) { - return c2; - } - } - } - return null; - } - function BLb(a, b) { - var c2; - c2 = null; - switch (b.g) { - case 1: - a.e.pf((umd(), Cld)) && (c2 = RD(a.e.of(Cld), 256)); - break; - case 3: - a.e.pf((umd(), Dld)) && (c2 = RD(a.e.of(Dld), 256)); - break; - case 2: - a.e.pf((umd(), Bld)) && (c2 = RD(a.e.of(Bld), 256)); - break; - case 4: - a.e.pf((umd(), Eld)) && (c2 = RD(a.e.of(Eld), 256)); - } - !c2 && (c2 = RD(a.e.of((umd(), zld)), 256)); - return c2; - } - function $5c(a, b, c2) { - var d, e, f2, g, h, i2; - e = c2; - f2 = 0; - for (h = new Anb(b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 27); - Ixd(g, ($4c(), P4c), sgb(e++)); - i2 = Q2c(g); - d = $wnd.Math.atan2(g.j + g.f / 2, g.i + g.g / 2); - d += d < 0 ? dFe : 0; - d < 0.7853981633974483 || d > FFe ? _mb(i2, a.b) : d <= FFe && d > GFe ? _mb(i2, a.d) : d <= GFe && d > HFe ? _mb(i2, a.c) : d <= HFe && _mb(i2, a.a); - f2 = $5c(a, i2, f2); - } - return e; - } - function sTc(a, b, c2, d) { - var e, f2, g, h, i2, j; - e = (d.c + d.a) / 2; - Xub(b.j); - Mub(b.j, e); - Xub(c2.e); - Mub(c2.e, e); - j = new ATc(); - for (h = new Anb(a.f); h.a < h.c.c.length; ) { - f2 = RD(ynb(h), 132); - i2 = f2.a; - uTc(j, b, i2); - uTc(j, c2, i2); - } - for (g = new Anb(a.k); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 132); - i2 = f2.b; - uTc(j, b, i2); - uTc(j, c2, i2); - } - j.b += 2; - j.a += nTc(b, a.q); - j.a += nTc(a.q, c2); - return j; - } - function U_c(a, b, c2) { - var d; - c2.Ug("Processor arrange node", 1); - Heb(TD(mQb(b, (h_c(), G$c)))); - d = RD(Lvb(DDb(CDb(new SDb(null, new Swb(b.b, 16)), new c0c()))), 40); - a.a = RD(mQb(b, g_c), 353); - a.a == (s_c(), q_c) || a.a == p_c ? T_c(a, new mob(cD(WC(Z$, 1), NEe, 40, 0, [d])), c2.eh(1)) : a.a == o_c && S_c(a, new mob(cD(WC(Z$, 1), NEe, 40, 0, [d])), c2.eh(1)); - c2.Vg(); - } - function X7c() { - X7c = geb; - x7c = new mGd((umd(), Dkd), 1.3); - G7c = new mGd(mld, (Geb(), false)); - O7c = new A3b(15); - N7c = new mGd(tld, O7c); - Q7c = new mGd(fmd, 15); - y7c = Kkd; - F7c = kld; - H7c = nld; - I7c = pld; - E7c = ild; - J7c = sld; - P7c = Lld; - U7c = (u7c(), p7c); - T7c = o7c; - W7c = t7c; - V7c = r7c; - M7c = k7c; - L7c = j7c; - K7c = i7c; - S7c = n7c; - B7c = ald; - C7c = bld; - A7c = g7c; - z7c = f7c; - D7c = h7c; - R7c = m7c; - } - function MKb(a) { - var b, c2, d, e, f2, g, h; - c2 = a.i; - b = a.n; - h = c2.d; - a.f == (vLb(), tLb) ? h += (c2.a - a.e.b) / 2 : a.f == sLb && (h += c2.a - a.e.b); - for (e = new Anb(a.d); e.a < e.c.c.length; ) { - d = RD(ynb(e), 187); - g = d.Mf(); - f2 = new pjd(); - f2.b = h; - h += g.b + a.a; - switch (a.b.g) { - case 0: - f2.a = c2.c + b.b; - break; - case 1: - f2.a = c2.c + b.b + (c2.b - g.a) / 2; - break; - case 2: - f2.a = c2.c + c2.b - b.c - g.a; - } - d.Of(f2); - } - } - function OKb(a) { - var b, c2, d, e, f2, g, h; - c2 = a.i; - b = a.n; - h = c2.c; - a.b == (EKb(), BKb) ? h += (c2.b - a.e.a) / 2 : a.b == DKb && (h += c2.b - a.e.a); - for (e = new Anb(a.d); e.a < e.c.c.length; ) { - d = RD(ynb(e), 187); - g = d.Mf(); - f2 = new pjd(); - f2.a = h; - h += g.a + a.a; - switch (a.f.g) { - case 0: - f2.b = c2.d + b.d; - break; - case 1: - f2.b = c2.d + b.d + (c2.a - g.b) / 2; - break; - case 2: - f2.b = c2.d + c2.a - b.a - g.b; - } - d.Of(f2); - } - } - function U7b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2; - k = c2.a.c; - g = c2.a.c + c2.a.b; - f2 = RD(Wjb(c2.c, b), 468); - n = f2.f; - o2 = f2.a; - i2 = new rjd(k, n); - l = new rjd(g, o2); - e = k; - c2.p || (e += a.c); - e += c2.F + c2.v * a.b; - j = new rjd(e, n); - m = new rjd(e, o2); - zjd(b.a, cD(WC(l3, 1), Nve, 8, 0, [i2, j])); - h = c2.d.a.gc() > 1; - if (h) { - d = new rjd(e, c2.b); - Mub(b.a, d); - } - zjd(b.a, cD(WC(l3, 1), Nve, 8, 0, [m, l])); - } - function TGc(a, b, c2) { - var d, e; - if (b < a.d.b.c.length) { - a.b = RD(Vmb(a.d.b, b), 30); - a.a = RD(Vmb(a.d.b, b - 1), 30); - a.c = b; - } else { - a.a = new R4b(a.d); - a.a.p = b - 1; - Rmb(a.d.b, a.a); - a.b = new R4b(a.d); - a.b.p = b; - Rmb(a.d.b, a.b); - a.c = b; - } - g3b(c2, a.b); - for (e = new is(Mr(Z2b(c2).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - !d.c.i.c && d.c.i.k == (r3b(), n3b) && g3b(d.c.i, a.a); - } - } - function Gpd(a) { - Cgd(a, new Pfd($fd(Xfd(Zfd(Yfd(new agd(), qHe), "ELK Randomizer"), 'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.'), new Jpd()))); - Agd(a, qHe, Eze, Cpd); - Agd(a, qHe, _ze, 15); - Agd(a, qHe, bAe, sgb(0)); - Agd(a, qHe, Dze, Yze); - } - function Gqe() { - Gqe = geb; - var a, b, c2, d, e, f2; - Eqe = $C(gE, YHe, 28, 255, 15, 1); - Fqe = $C(hE, zwe, 28, 16, 15, 1); - for (b = 0; b < 255; b++) { - Eqe[b] = -1; - } - for (c2 = 57; c2 >= 48; c2--) { - Eqe[c2] = c2 - 48 << 24 >> 24; - } - for (d = 70; d >= 65; d--) { - Eqe[d] = d - 65 + 10 << 24 >> 24; - } - for (e = 102; e >= 97; e--) { - Eqe[e] = e - 97 + 10 << 24 >> 24; - } - for (f2 = 0; f2 < 10; f2++) - Fqe[f2] = 48 + f2 & Bwe; - for (a = 10; a <= 15; a++) - Fqe[a] = 65 + a - 10 & Bwe; - } - function yYc(a, b) { - b.Ug("Process graph bounds", 1); - pQb(a, (q$c(), ZZc), Uvb(TCb(HDb(new SDb(null, new Swb(a.b, 16)), new DYc())))); - pQb(a, _Zc, Uvb(TCb(HDb(new SDb(null, new Swb(a.b, 16)), new FYc())))); - pQb(a, YZc, Uvb(SCb(HDb(new SDb(null, new Swb(a.b, 16)), new HYc())))); - pQb(a, $Zc, Uvb(SCb(HDb(new SDb(null, new Swb(a.b, 16)), new JYc())))); - b.Vg(); - } - function PWb(a) { - var b, c2, d, e, f2; - e = RD(mQb(a, (yCc(), lBc)), 21); - f2 = RD(mQb(a, oBc), 21); - c2 = new rjd(a.f.a + a.d.b + a.d.c, a.f.b + a.d.d + a.d.a); - b = new sjd(c2); - if (e.Hc((Qpd(), Mpd))) { - d = RD(mQb(a, nBc), 8); - if (f2.Hc((dqd(), Ypd))) { - d.a <= 0 && (d.a = 20); - d.b <= 0 && (d.b = 20); - } - b.a = $wnd.Math.max(c2.a, d.a); - b.b = $wnd.Math.max(c2.b, d.b); - } - Heb(TD(mQb(a, mBc))) || QWb(a, c2, b); - } - function lOc(a, b) { - var c2, d, e, f2; - for (f2 = b3b(b, (qpd(), npd)).Kc(); f2.Ob(); ) { - d = RD(f2.Pb(), 12); - c2 = RD(mQb(d, (Ywc(), Iwc)), 10); - !!c2 && rIb(uIb(tIb(vIb(sIb(new wIb(), 0), 0.1), a.i[b.p].d), a.i[c2.p].a)); - } - for (e = b3b(b, Yod).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 12); - c2 = RD(mQb(d, (Ywc(), Iwc)), 10); - !!c2 && rIb(uIb(tIb(vIb(sIb(new wIb(), 0), 0.1), a.i[c2.p].d), a.i[b.p].a)); - } - } - function oYd(a) { - var b, c2, d, e, f2, g; - if (!a.c) { - g = new W$d(); - b = iYd; - f2 = b.a.zc(a, b); - if (f2 == null) { - for (d = new dMd(tYd(a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 89); - e = i2d(c2); - ZD(e, 90) && YGd(g, oYd(RD(e, 29))); - WGd(g, c2); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - T$d(g); - VHd(g); - a.c = new N$d((RD(QHd(xYd((lTd(), kTd).o), 15), 19), g.i), g.g); - yYd(a).b &= -33; - } - return a.c; - } - function Dre(a) { - var b; - if (a.c != 10) - throw Adb(new Lqe(TId((Hde(), VIe)))); - b = a.a; - switch (b) { - case 110: - b = 10; - break; - case 114: - b = 13; - break; - case 116: - b = 9; - break; - case 92: - case 124: - case 46: - case 94: - case 45: - case 63: - case 42: - case 43: - case 123: - case 125: - case 40: - case 41: - case 91: - case 93: - break; - default: - throw Adb(new Lqe(TId((Hde(), xJe)))); - } - return b; - } - function GD(a) { - var b, c2, d, e, f2; - if (a.l == 0 && a.m == 0 && a.h == 0) { - return "0"; - } - if (a.h == fxe && a.m == 0 && a.l == 0) { - return "-9223372036854775808"; - } - if (a.h >> 19 != 0) { - return "-" + GD(xD(a)); - } - c2 = a; - d = ""; - while (!(c2.l == 0 && c2.m == 0 && c2.h == 0)) { - e = fD(ixe); - c2 = iD(c2, e, true); - b = "" + FD(eD); - if (!(c2.l == 0 && c2.m == 0 && c2.h == 0)) { - f2 = 9 - b.length; - for (; f2 > 0; f2--) { - b = "0" + b; - } - } - d = b + d; - } - return d; - } - function tkc(a) { - var b, c2, d, e, f2, g, h; - b = false; - c2 = 0; - for (e = new Anb(a.d.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - d.p = c2++; - for (g = new Anb(d.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - !b && !gr(W2b(f2)) && (b = true); - } - } - h = ysb((Cmd(), Amd), cD(WC(s3, 1), jwe, 88, 0, [ymd, zmd])); - if (!b) { - zsb(h, Bmd); - zsb(h, xmd); - } - a.a = new dGb(h); - akb(a.f); - akb(a.b); - akb(a.e); - akb(a.g); - } - function Ftb() { - if (!Object.create || !Object.getOwnPropertyNames) { - return false; - } - var a = "__proto__"; - var b = /* @__PURE__ */ Object.create(null); - if (b[a] !== void 0) { - return false; - } - var c2 = Object.getOwnPropertyNames(b); - if (c2.length != 0) { - return false; - } - b[a] = 42; - if (b[a] !== 42) { - return false; - } - if (Object.getOwnPropertyNames(b).length == 0) { - return false; - } - return true; - } - function c_b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - d = c2.c; - e = c2.d; - h = K3b(b.c); - i2 = K3b(b.d); - if (d == b.c) { - h = d_b(a, h, e); - i2 = e_b(b.d); - } else { - h = e_b(b.c); - i2 = d_b(a, i2, e); - } - j = new Fjd(b.a); - Pub(j, h, j.a, j.a.a); - Pub(j, i2, j.c.b, j.c); - g = b.c == d; - l = new E_b(); - for (f2 = 0; f2 < j.b - 1; ++f2) { - k = new Ptd(RD(ju(j, f2), 8), RD(ju(j, f2 + 1), 8)); - g && f2 == 0 || !g && f2 == j.b - 2 ? l.b = k : Rmb(l.a, k); - } - return l; - } - function W1b(a, b) { - var c2, d, e, f2; - f2 = a.j.g - b.j.g; - if (f2 != 0) { - return f2; - } - c2 = RD(mQb(a, (yCc(), CBc)), 17); - d = RD(mQb(b, CBc), 17); - if (!!c2 && !!d) { - e = c2.a - d.a; - if (e != 0) { - return e; - } - } - switch (a.j.g) { - case 1: - return Qfb(a.n.a, b.n.a); - case 2: - return Qfb(a.n.b, b.n.b); - case 3: - return Qfb(b.n.a, a.n.a); - case 4: - return Qfb(b.n.b, a.n.b); - default: - throw Adb(new dgb(UAe)); - } - } - function X9b(a, b, c2, d) { - var e, f2, g, h, i2; - if (Kr((U9b(), new is(Mr(W2b(b).a.Kc(), new ir())))) >= a.a) { - return -1; - } - if (!W9b(b, c2)) { - return -1; - } - if (gr(RD(d.Kb(b), 20))) { - return 1; - } - e = 0; - for (g = RD(d.Kb(b), 20).Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 18); - i2 = f2.c.i == b ? f2.d.i : f2.c.i; - h = X9b(a, i2, c2, d); - if (h == -1) { - return -1; - } - e = $wnd.Math.max(e, h); - if (e > a.c - 1) { - return -1; - } - } - return e + 1; - } - function _Gd(a, b) { - var c2, d, e, f2, g, h; - if (dE(b) === dE(a)) { - return true; - } - if (!ZD(b, 15)) { - return false; - } - d = RD(b, 15); - h = a.gc(); - if (d.gc() != h) { - return false; - } - g = d.Kc(); - if (a.Yi()) { - for (c2 = 0; c2 < h; ++c2) { - e = a.Vi(c2); - f2 = g.Pb(); - if (e == null ? f2 != null : !pb(e, f2)) { - return false; - } - } - } else { - for (c2 = 0; c2 < h; ++c2) { - e = a.Vi(c2); - f2 = g.Pb(); - if (dE(e) !== dE(f2)) { - return false; - } - } - } - return true; - } - function RNd(a, b) { - var c2, d, e, f2, g, h; - if (a.f > 0) { - a._j(); - if (b != null) { - for (f2 = 0; f2 < a.d.length; ++f2) { - c2 = a.d[f2]; - if (c2) { - d = RD(c2.g, 379); - h = c2.i; - for (g = 0; g < h; ++g) { - e = d[g]; - if (pb(b, e.md())) { - return true; - } - } - } - } - } else { - for (f2 = 0; f2 < a.d.length; ++f2) { - c2 = a.d[f2]; - if (c2) { - d = RD(c2.g, 379); - h = c2.i; - for (g = 0; g < h; ++g) { - e = d[g]; - if (dE(b) === dE(e.md())) { - return true; - } - } - } - } - } - } - return false; - } - function see(a, b) { - var c2, d, e; - c2 = b.qi(a.a); - if (c2) { - e = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), "affiliation")); - if (e != null) { - d = thb(e, Fhb(35)); - return d == -1 ? Lee(a, Uee(a, BXd(b.qk())), e) : d == 0 ? Lee(a, null, (BFb(1, e.length + 1), e.substr(1))) : Lee(a, (AFb(0, d, e.length), e.substr(0, d)), (BFb(d + 1, e.length + 1), e.substr(d + 1))); - } - } - return null; - } - function v9b(a, b, c2) { - var d, e, f2, g; - c2.Ug("Orthogonally routing hierarchical port edges", 1); - a.a = 0; - d = y9b(b); - B9b(b, d); - A9b(a, b, d); - w9b(b); - e = RD(mQb(b, (yCc(), BBc)), 101); - f2 = b.b; - u9b((tFb(0, f2.c.length), RD(f2.c[0], 30)), e, b); - u9b(RD(Vmb(f2, f2.c.length - 1), 30), e, b); - g = b.b; - s9b((tFb(0, g.c.length), RD(g.c[0], 30))); - s9b(RD(Vmb(g, g.c.length - 1), 30)); - c2.Vg(); - } - function JAd(a) { - switch (a) { - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: { - return a - 48 << 24 >> 24; - } - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: { - return a - 97 + 10 << 24 >> 24; - } - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: { - return a - 65 + 10 << 24 >> 24; - } - default: { - throw Adb(new Vgb("Invalid hexadecimal")); - } - } - } - function iIb() { - iIb = geb; - hIb = new jIb("SPIRAL", 0); - cIb = new jIb("LINE_BY_LINE", 1); - dIb = new jIb("MANHATTAN", 2); - bIb = new jIb("JITTER", 3); - fIb = new jIb("QUADRANTS_LINE_BY_LINE", 4); - gIb = new jIb("QUADRANTS_MANHATTAN", 5); - eIb = new jIb("QUADRANTS_JITTER", 6); - aIb = new jIb("COMBINE_LINE_BY_LINE_MANHATTAN", 7); - _Hb = new jIb("COMBINE_JITTER_MANHATTAN", 8); - } - function Urc(a, b, c2, d) { - var e, f2, g, h, i2, j; - i2 = Zrc(a, c2); - j = Zrc(b, c2); - e = false; - while (!!i2 && !!j) { - if (d || Xrc(i2, j, c2)) { - g = Zrc(i2, c2); - h = Zrc(j, c2); - asc(b); - asc(a); - f2 = i2.c; - Hec(i2, false); - Hec(j, false); - if (c2) { - f3b(b, j.p, f2); - b.p = j.p; - f3b(a, i2.p + 1, f2); - a.p = i2.p; - } else { - f3b(a, i2.p, f2); - a.p = i2.p; - f3b(b, j.p + 1, f2); - b.p = j.p; - } - g3b(i2, null); - g3b(j, null); - i2 = g; - j = h; - e = true; - } else { - break; - } - } - return e; - } - function aDc(a) { - switch (a.g) { - case 0: - return new XHc(); - case 1: - return new pHc(); - case 3: - return new GGc(); - case 4: - return new gHc(); - case 5: - return new jIc(); - case 6: - return new IHc(); - case 2: - return new xHc(); - case 7: - return new pGc(); - case 8: - return new YGc(); - default: - throw Adb(new agb("No implementation is available for the layerer " + (a.f != null ? a.f : "" + a.g))); - } - } - function tIc(a, b, c2, d) { - var e, f2, g, h, i2; - e = false; - f2 = false; - for (h = new Anb(d.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - dE(mQb(g, (Ywc(), Awc))) === dE(c2) && (g.g.c.length == 0 ? g.e.c.length == 0 || (e = true) : f2 = true); - } - i2 = 0; - e && e ^ f2 ? i2 = c2.j == (qpd(), Yod) ? -a.e[d.c.p][d.p] : b - a.e[d.c.p][d.p] : f2 && e ^ f2 ? i2 = a.e[d.c.p][d.p] + 1 : e && f2 && (i2 = c2.j == (qpd(), Yod) ? 0 : b / 2); - return i2; - } - function lSd(a, b, c2, d, e, f2, g, h) { - var i2, j, k; - i2 = 0; - b != null && (i2 ^= ohb(b.toLowerCase())); - c2 != null && (i2 ^= ohb(c2)); - d != null && (i2 ^= ohb(d)); - g != null && (i2 ^= ohb(g)); - h != null && (i2 ^= ohb(h)); - for (j = 0, k = f2.length; j < k; j++) { - i2 ^= ohb(f2[j]); - } - a ? i2 |= 256 : i2 &= -257; - e ? i2 |= 16 : i2 &= -17; - this.f = i2; - this.i = b == null ? null : (uFb(b), b); - this.a = c2; - this.d = d; - this.j = f2; - this.g = g; - this.e = h; - } - function d3b(a, b, c2) { - var d, e; - e = null; - switch (b.g) { - case 1: - e = (J3b(), E3b); - break; - case 2: - e = (J3b(), G3b); - } - d = null; - switch (c2.g) { - case 1: - d = (J3b(), F3b); - break; - case 2: - d = (J3b(), D3b); - break; - case 3: - d = (J3b(), H3b); - break; - case 4: - d = (J3b(), I3b); - } - return !!e && !!d ? dr(a.j, new Yb(new mob(cD(WC(pE, 1), rve, 178, 0, [RD(Qb(e), 178), RD(Qb(d), 178)])))) : (yob(), yob(), vob); - } - function K8b(a) { - var b, c2, d; - b = RD(mQb(a, (yCc(), nBc)), 8); - pQb(a, nBc, new rjd(b.b, b.a)); - switch (RD(mQb(a, Rzc), 255).g) { - case 1: - pQb(a, Rzc, (Rjd(), Qjd)); - break; - case 2: - pQb(a, Rzc, (Rjd(), Mjd)); - break; - case 3: - pQb(a, Rzc, (Rjd(), Ojd)); - break; - case 4: - pQb(a, Rzc, (Rjd(), Pjd)); - } - if ((!a.q ? (yob(), yob(), wob) : a.q)._b(IBc)) { - c2 = RD(mQb(a, IBc), 8); - d = c2.a; - c2.a = c2.b; - c2.b = d; - } - } - function Pmc(a, b, c2, d, e, f2) { - this.b = c2; - this.d = e; - if (a >= b.length) { - throw Adb(new veb("Greedy SwitchDecider: Free layer not in graph.")); - } - this.c = b[a]; - this.e = new DMc(d); - rMc(this.e, this.c, (qpd(), ppd)); - this.i = new DMc(d); - rMc(this.i, this.c, Xod); - this.f = new Kmc(this.c); - this.a = !f2 && e.i && !e.s && this.c[0].k == (r3b(), m3b); - this.a && Nmc(this, a, b.length); - } - function $Mb(a, b) { - var c2, d, e, f2, g, h; - f2 = !a.B.Hc((dqd(), Wpd)); - g = a.B.Hc(Zpd); - a.a = new wKb(g, f2, a.c); - !!a.n && C2b(a.a.n, a.n); - cLb(a.g, (ZJb(), XJb), a.a); - if (!b) { - d = new dLb(1, f2, a.c); - d.n.a = a.k; - Wrb(a.p, (qpd(), Yod), d); - e = new dLb(1, f2, a.c); - e.n.d = a.k; - Wrb(a.p, npd, e); - h = new dLb(0, f2, a.c); - h.n.c = a.k; - Wrb(a.p, ppd, h); - c2 = new dLb(0, f2, a.c); - c2.n.b = a.k; - Wrb(a.p, Xod, c2); - } - } - function zkc(a) { - var b, c2, d; - b = RD(mQb(a.d, (yCc(), yAc)), 223); - switch (b.g) { - case 2: - c2 = rkc(a); - break; - case 3: - c2 = (d = new bnb(), FDb(CDb(GDb(EDb(EDb(new SDb(null, new Swb(a.d.b, 16)), new wlc()), new ylc()), new Alc()), new Kkc()), new Clc(d)), d); - break; - default: - throw Adb(new dgb("Compaction not supported for " + b + " edges.")); - } - ykc(a, c2); - xgb(new Xkb(a.g), new ilc(a)); - } - function qYc(a, b) { - var c2, d, e, f2, g, h, i2; - b.Ug("Process directions", 1); - c2 = RD(mQb(a, (h_c(), H$c)), 88); - if (c2 != (Cmd(), xmd)) { - for (e = Sub(a.b, 0); e.b != e.d.c; ) { - d = RD(evb(e), 40); - h = RD(mQb(d, (q$c(), o$c)), 17).a; - i2 = RD(mQb(d, p$c), 17).a; - switch (c2.g) { - case 4: - i2 *= -1; - break; - case 1: - f2 = h; - h = i2; - i2 = f2; - break; - case 2: - g = h; - h = -i2; - i2 = g; - } - pQb(d, o$c, sgb(h)); - pQb(d, p$c, sgb(i2)); - } - } - b.Vg(); - } - function led(a, b) { - var c2; - c2 = new qQb(); - !!b && kQb(c2, RD(Wjb(a.a, H4), 96)); - ZD(b, 422) && kQb(c2, RD(Wjb(a.a, L4), 96)); - if (ZD(b, 366)) { - kQb(c2, RD(Wjb(a.a, I4), 96)); - return c2; - } - ZD(b, 84) && kQb(c2, RD(Wjb(a.a, E4), 96)); - if (ZD(b, 207)) { - kQb(c2, RD(Wjb(a.a, J4), 96)); - return c2; - } - if (ZD(b, 193)) { - kQb(c2, RD(Wjb(a.a, K4), 96)); - return c2; - } - ZD(b, 326) && kQb(c2, RD(Wjb(a.a, G4), 96)); - return c2; - } - function a_b(a) { - var b, c2, d, e, f2, g, h, i2; - i2 = new m_b(); - for (h = new Anb(a.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - if (g.k == (r3b(), m3b)) { - continue; - } - $$b(i2, g, new pjd()); - for (f2 = new is(Mr(a3b(g).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (e.c.i.k == m3b || e.d.i.k == m3b) { - continue; - } - for (d = Sub(e.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 8); - b = c2; - k_b(i2, new eZb(b.a, b.b)); - } - } - } - return i2; - } - function Kcd() { - Kcd = geb; - Jcd = new jGd(iGe); - Icd = (_cd(), $cd); - Hcd = new lGd(nGe, Icd); - Gcd = (ldd(), kdd); - Fcd = new lGd(jGe, Gcd); - Ecd = (Xbd(), Tbd); - Dcd = new lGd(kGe, Ecd); - zcd = new lGd(lGe, null); - Ccd = (Mbd(), Kbd); - Bcd = new lGd(mGe, Ccd); - vcd = (sbd(), rbd); - ucd = new lGd(oGe, vcd); - wcd = new lGd(pGe, (Geb(), false)); - xcd = new lGd(qGe, sgb(64)); - ycd = new lGd(rGe, true); - Acd = Lbd; - } - function eHc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - a.p = 1; - e = a.c; - l = new Iub(); - for (k = c3b(a, (BEc(), zEc)).Kc(); k.Ob(); ) { - j = RD(k.Pb(), 12); - for (d = new Anb(j.g); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - i2 = c2.d.i; - if (a != i2) { - f2 = i2.c; - if (f2.p <= e.p) { - g = e.p + 1; - if (g == b.b.c.length) { - h = new R4b(b); - h.p = g; - Rmb(b.b, h); - g3b(i2, h); - } else { - h = RD(Vmb(b.b, g), 30); - g3b(i2, h); - } - l.a.zc(i2, l); - } - } - } - } - return l; - } - function mXc(a, b) { - var c2, d; - c2 = RD(mQb(a, (q$c(), TZc)), 15); - if (!c2 || c2.gc() < 1) { - return null; - } else if (c2.gc() == 1) { - return RD(c2.Xb(0), 40); - } - d = null; - switch (b.g) { - case 2: - d = RD(Lvb(KDb(c2.Oc(), new mYc())), 40); - break; - case 1: - d = RD(Lvb(JDb(c2.Oc(), new KXc())), 40); - break; - case 4: - d = RD(Lvb(KDb(c2.Oc(), new OXc())), 40); - break; - case 3: - d = RD(Lvb(JDb(c2.Oc(), new SXc())), 40); - } - return d; - } - function usc(a) { - var b, c2, d, e, f2, g; - if (a.a != null) { - return; - } - a.a = $C(xdb, Hye, 28, a.c.b.c.length, 16, 1); - a.a[0] = false; - if (nQb(a.c, (yCc(), wCc))) { - d = RD(mQb(a.c, wCc), 15); - for (c2 = d.Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 17).a; - b > 0 && b < a.a.length && (a.a[b] = false); - } - } else { - g = new Anb(a.c.b); - g.a < g.c.c.length && ynb(g); - e = 1; - while (g.a < g.c.c.length) { - f2 = RD(ynb(g), 30); - a.a[e++] = xsc(f2); - } - } - } - function X6c() { - X6c = geb; - M6c = new jGd("additionalHeight"); - N6c = new jGd("drawingHeight"); - O6c = new jGd("drawingWidth"); - R6c = new jGd("minHeight"); - U6c = new jGd("minWidth"); - V6c = new jGd("rows"); - W6c = new jGd("targetWidth"); - T6c = new kGd("minRowIncrease", 0); - Q6c = new kGd("maxRowIncrease", 0); - S6c = new kGd("minRowDecrease", 0); - P6c = new kGd("maxRowDecrease", 0); - } - function r$d(a, b) { - var c2, d, e, f2; - e = a.b; - switch (b) { - case 1: { - a.b |= 1; - a.b |= 4; - a.b |= 8; - break; - } - case 2: { - a.b |= 2; - a.b |= 4; - a.b |= 8; - break; - } - case 4: { - a.b |= 1; - a.b |= 2; - a.b |= 4; - a.b |= 8; - break; - } - case 3: { - a.b |= 16; - a.b |= 8; - break; - } - case 0: { - a.b |= 32; - a.b |= 16; - a.b |= 8; - a.b |= 1; - a.b |= 2; - a.b |= 4; - break; - } - } - if (a.b != e && !!a.c) { - for (d = new dMd(a.c); d.e != d.i.gc(); ) { - f2 = RD(bMd(d), 482); - c2 = yYd(f2); - v$d(c2, b); - } - } - } - function CKc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2; - e = false; - for (g = b, h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - Heb((Geb(), f2.e ? true : false)) && !RD(Vmb(a.b, f2.e.p), 219).s && (e = e | (j = f2.e, k = RD(Vmb(a.b, j.p), 219), l = k.e, m = qKc(c2, l.length), n = l[m][0], n.k == (r3b(), m3b) ? l[m] = AKc(f2, l[m], c2 ? (qpd(), ppd) : (qpd(), Xod)) : k.c.mg(l, c2), o2 = DKc(a, k, c2, d), BKc(k.e, k.o, c2), o2)); - } - return e; - } - function Aed(a, b) { - var c2, d, e, f2, g; - f2 = (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i; - for (e = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - if (dE(Gxd(d, (umd(), Xkd))) !== dE((Fnd(), End))) { - g = RD(Gxd(b, Tld), 143); - c2 = RD(Gxd(d, Tld), 143); - (g == c2 || !!g && Nfd(g, c2)) && (!d.a && (d.a = new C5d(J4, d, 10, 11)), d.a).i != 0 && (f2 += Aed(a, d)); - } - } - return f2; - } - function Toc(a) { - var b, c2, d, e, f2, g, h; - d = 0; - h = 0; - for (g = new Anb(a.d); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 105); - e = RD(zDb(CDb(new SDb(null, new Swb(f2.j, 16)), new Cpc()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - c2 = null; - if (d <= h) { - c2 = (qpd(), Yod); - d += e.gc(); - } else if (h < d) { - c2 = (qpd(), npd); - h += e.gc(); - } - b = c2; - FDb(GDb(e.Oc(), new qpc()), new spc(b)); - } - } - function D6b(a) { - var b, c2, d, e, f2; - f2 = new cnb(a.a.c.length); - for (e = new Anb(a.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - c2 = RD(mQb(d, (yCc(), UAc)), 171); - b = null; - switch (c2.g) { - case 1: - case 2: - b = (huc(), guc); - break; - case 3: - case 4: - b = (huc(), euc); - } - if (b) { - pQb(d, (Ywc(), bwc), (huc(), guc)); - b == euc ? F6b(d, c2, (BEc(), yEc)) : b == guc && F6b(d, c2, (BEc(), zEc)); - } else { - ZEb(f2.c, d); - } - } - return f2; - } - function Snc(a) { - var b, c2, d, e, f2, g, h, i2; - a.b = new hj(new mob((qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd]))), new mob((joc(), cD(WC(UV, 1), jwe, 372, 0, [ioc, hoc, goc])))); - for (g = cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd]), h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - for (c2 = cD(WC(UV, 1), jwe, 372, 0, [ioc, hoc, goc]), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - aj(a.b, f2, b, new bnb()); - } - } - } - function BMb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - g = RD(RD(Qc(a.r, b), 21), 87); - h = a.u.Hc((Pod(), Nod)); - c2 = a.u.Hc(Kod); - d = a.u.Hc(Jod); - j = a.u.Hc(Ood); - l = a.B.Hc((dqd(), cqd)); - k = !c2 && !d && (j || g.gc() == 2); - yMb(a, b); - e = null; - i2 = null; - if (h) { - f2 = g.Kc(); - e = RD(f2.Pb(), 117); - i2 = e; - while (f2.Ob()) { - i2 = RD(f2.Pb(), 117); - } - e.d.b = 0; - i2.d.c = 0; - k && !e.a && (e.d.c = 0); - } - if (l) { - CMb(g); - if (h) { - e.d.b = 0; - i2.d.c = 0; - } - } - } - function JNb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - g = RD(RD(Qc(a.r, b), 21), 87); - h = a.u.Hc((Pod(), Nod)); - c2 = a.u.Hc(Kod); - d = a.u.Hc(Jod); - i2 = a.u.Hc(Ood); - l = a.B.Hc((dqd(), cqd)); - j = !c2 && !d && (i2 || g.gc() == 2); - HNb(a, b); - k = null; - e = null; - if (h) { - f2 = g.Kc(); - k = RD(f2.Pb(), 117); - e = k; - while (f2.Ob()) { - e = RD(f2.Pb(), 117); - } - k.d.d = 0; - e.d.a = 0; - j && !k.a && (k.d.a = 0); - } - if (l) { - KNb(g); - if (h) { - k.d.d = 0; - e.d.a = 0; - } - } - } - function ONc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - e = b.k; - if (b.p >= 0) { - return false; - } else { - b.p = c2.b; - Rmb(c2.e, b); - } - if (e == (r3b(), o3b) || e == q3b) { - for (g = new Anb(b.j); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 12); - for (k = (d = new Anb(new _3b(f2).a.g), new c4b(d)); xnb(k.a); ) { - j = RD(ynb(k.a), 18).d; - h = j.i; - i2 = h.k; - if (b.c != h.c) { - if (i2 == o3b || i2 == q3b) { - if (ONc(a, h, c2)) { - return true; - } - } - } - } - } - } - return true; - } - function GWd(a) { - var b; - if ((a.Db & 64) != 0) - return cWd(a); - b = new Shb(cWd(a)); - b.a += " (changeable: "; - Ohb(b, (a.Bb & gwe) != 0); - b.a += ", volatile: "; - Ohb(b, (a.Bb & cKe) != 0); - b.a += ", transient: "; - Ohb(b, (a.Bb & qxe) != 0); - b.a += ", defaultValueLiteral: "; - Nhb(b, a.j); - b.a += ", unsettable: "; - Ohb(b, (a.Bb & bKe) != 0); - b.a += ", derived: "; - Ohb(b, (a.Bb & Ove) != 0); - b.a += ")"; - return b.a; - } - function tee(a, b) { - var c2, d, e, f2, g; - e = b.qi(a.a); - if (e) { - d = (!e.b && (e.b = new SVd((JTd(), FTd), C8, e)), e.b); - c2 = WD($Nd(d, DKe)); - if (c2 != null) { - f2 = c2.lastIndexOf("#"); - g = f2 == -1 ? Wee(a, b.jk(), c2) : f2 == 0 ? Vee(a, null, (BFb(1, c2.length + 1), c2.substr(1))) : Vee(a, (AFb(0, f2, c2.length), c2.substr(0, f2)), (BFb(f2 + 1, c2.length + 1), c2.substr(f2 + 1))); - if (ZD(g, 156)) { - return RD(g, 156); - } - } - } - return null; - } - function xee(a, b) { - var c2, d, e, f2, g; - d = b.qi(a.a); - if (d) { - c2 = (!d.b && (d.b = new SVd((JTd(), FTd), C8, d)), d.b); - f2 = WD($Nd(c2, $Ke)); - if (f2 != null) { - e = f2.lastIndexOf("#"); - g = e == -1 ? Wee(a, b.jk(), f2) : e == 0 ? Vee(a, null, (BFb(1, f2.length + 1), f2.substr(1))) : Vee(a, (AFb(0, e, f2.length), f2.substr(0, e)), (BFb(e + 1, f2.length + 1), f2.substr(e + 1))); - if (ZD(g, 156)) { - return RD(g, 156); - } - } - } - return null; - } - function rRb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - e = XPb(a.d); - g = RD(mQb(a.b, (tSb(), nSb)), 107); - h = g.b + g.c; - i2 = g.d + g.a; - k = e.d.a * a.e + h; - j = e.b.a * a.f + i2; - RRb(a.b, new rjd(k, j)); - for (m = new Anb(a.g); m.a < m.c.c.length; ) { - l = RD(ynb(m), 568); - b = l.g - e.a.a; - c2 = l.i - e.c.a; - d = $id(jjd(new rjd(b, c2), l.a, l.b), ijd(njd(ajd(yRb(l.e)), l.d * l.a, l.c * l.b), -0.5)); - f2 = zRb(l.e); - BRb(l.e, ojd(d, f2)); - } - } - function Xgc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - b.Ug("Restoring reversed edges", 1); - for (i2 = new Anb(a.b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 30); - for (k = new Anb(h.a); k.a < k.c.c.length; ) { - j = RD(ynb(k), 10); - for (m = new Anb(j.j); m.a < m.c.c.length; ) { - l = RD(ynb(m), 12); - g = s2b(l.g); - for (d = g, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - Heb(TD(mQb(c2, (Ywc(), Nwc)))) && X0b(c2, false); - } - } - } - } - b.Vg(); - } - function Zpc(a, b, c2, d) { - var e, f2, g, h, i2; - i2 = $C(iE, Nve, 109, (qpd(), cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd])).length, 0, 2); - for (f2 = cD(WC(E3, 1), NAe, 64, 0, [opd, Yod, Xod, npd, ppd]), g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - i2[e.g] = $C(iE, vxe, 28, a.c[e.g], 15, 1); - } - _pc(i2, a, Yod); - _pc(i2, a, npd); - Ypc(i2, a, Yod, b, c2, d); - Ypc(i2, a, Xod, b, c2, d); - Ypc(i2, a, npd, b, c2, d); - Ypc(i2, a, ppd, b, c2, d); - return i2; - } - function sLc(a, b, c2) { - if (Ujb(a.a, b)) { - if (Zsb(RD(Wjb(a.a, b), 49), c2)) { - return 1; - } - } else { - Zjb(a.a, b, new _sb()); - } - if (Ujb(a.a, c2)) { - if (Zsb(RD(Wjb(a.a, c2), 49), b)) { - return -1; - } - } else { - Zjb(a.a, c2, new _sb()); - } - if (Ujb(a.b, b)) { - if (Zsb(RD(Wjb(a.b, b), 49), c2)) { - return -1; - } - } else { - Zjb(a.b, b, new _sb()); - } - if (Ujb(a.b, c2)) { - if (Zsb(RD(Wjb(a.b, c2), 49), b)) { - return 1; - } - } else { - Zjb(a.b, c2, new _sb()); - } - return 0; - } - function tMb(a) { - var b, c2, d, e, f2, g; - if (a.q == (Bod(), xod) || a.q == wod) { - return; - } - e = a.f.n.d + SJb(RD(Vrb(a.b, (qpd(), Yod)), 127)) + a.c; - b = a.f.n.a + SJb(RD(Vrb(a.b, npd), 127)) + a.c; - d = RD(Vrb(a.b, Xod), 127); - g = RD(Vrb(a.b, ppd), 127); - f2 = $wnd.Math.max(0, d.n.d - e); - f2 = $wnd.Math.max(f2, g.n.d - e); - c2 = $wnd.Math.max(0, d.n.a - b); - c2 = $wnd.Math.max(c2, g.n.a - b); - d.n.d = f2; - g.n.d = f2; - d.n.a = c2; - g.n.a = c2; - } - function Xfe(a, b, c2, d) { - var e, f2, g, h, i2, j; - if (c2 == null) { - e = RD(a.g, 124); - for (h = 0; h < a.i; ++h) { - g = e[h]; - if (g.Lk() == b) { - return rLd(a, g, d); - } - } - } - f2 = (nke(), RD(b, 69).xk() ? RD(c2, 76) : oke(b, c2)); - if (Mvd(a.e)) { - j = !pge(a, b); - d = qLd(a, f2, d); - i2 = b.Jk() ? fge(a, 3, b, null, c2, kge(a, b, c2, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0), j) : fge(a, 1, b, b.ik(), c2, -1, j); - d ? d.nj(i2) : d = i2; - } else { - d = qLd(a, f2, d); - } - return d; - } - function xgd() { - this.b = new gub(); - this.d = new gub(); - this.e = new gub(); - this.c = new gub(); - this.a = new Tsb(); - this.f = new Tsb(); - HId(l3, new Igd(), new Kgd()); - HId(k3, new ehd(), new ghd()); - HId(h3, new ihd(), new khd()); - HId(i3, new mhd(), new ohd()); - HId(l4, new qhd(), new shd()); - HId(VJ, new Mgd(), new Ogd()); - HId(PK, new Qgd(), new Sgd()); - HId(BK, new Ugd(), new Wgd()); - HId(MK, new Ygd(), new $gd()); - HId(DL, new ahd(), new chd()); - } - function hc(a, b) { - var c2, d, e, f2, g; - a = a == null ? vve : (uFb(a), a); - for (e = 0; e < b.length; e++) { - b[e] = ic(b[e]); - } - c2 = new cib(); - g = 0; - d = 0; - while (d < b.length) { - f2 = a.indexOf("%s", g); - if (f2 == -1) { - break; - } - c2.a += "" + zhb(a == null ? vve : (uFb(a), a), g, f2); - Yhb(c2, b[d++]); - g = f2 + 2; - } - Xhb(c2, a, g, a.length); - if (d < b.length) { - c2.a += " ["; - Yhb(c2, b[d++]); - while (d < b.length) { - c2.a += pve; - Yhb(c2, b[d++]); - } - c2.a += "]"; - } - return c2.a; - } - function kMc(a, b) { - var c2, d, e, f2, g, h, i2; - c2 = 0; - for (i2 = new Anb(b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 12); - $Lc(a.b, a.d[h.p]); - g = 0; - for (e = new l4b(h.b); xnb(e.a) || xnb(e.b); ) { - d = RD(xnb(e.a) ? ynb(e.a) : ynb(e.b), 18); - if (uMc(d)) { - f2 = AMc(a, h == d.c ? d.d : d.c); - if (f2 > a.d[h.p]) { - c2 += ZLc(a.b, f2); - hmb(a.a, sgb(f2)); - } - } else { - ++g; - } - } - c2 += a.b.d * g; - while (!nmb(a.a)) { - XLc(a.b, RD(smb(a.a), 17).a); - } - } - return c2; - } - function pje(a) { - var b, c2, d, e, f2, g; - f2 = 0; - b = WVd(a); - !!b.kk() && (f2 |= 4); - (a.Bb & bKe) != 0 && (f2 |= 2); - if (ZD(a, 102)) { - c2 = RD(a, 19); - e = Z5d(c2); - (c2.Bb & QHe) != 0 && (f2 |= 32); - if (e) { - AYd(uWd(e)); - f2 |= 8; - g = e.t; - (g > 1 || g == -1) && (f2 |= 16); - (e.Bb & QHe) != 0 && (f2 |= 64); - } - (c2.Bb & txe) != 0 && (f2 |= cKe); - f2 |= gwe; - } else { - if (ZD(b, 469)) { - f2 |= 512; - } else { - d = b.kk(); - !!d && (d.i & 1) != 0 && (f2 |= 256); - } - } - (a.Bb & 512) != 0 && (f2 |= 128); - return f2; - } - function vke(a, b) { - var c2; - if (a.f == tke) { - c2 = yfe(Qee((lke(), jke), b)); - return a.e ? c2 == 4 && b != (Lle(), Jle) && b != (Lle(), Gle) && b != (Lle(), Hle) && b != (Lle(), Ile) : c2 == 2; - } - if (!!a.d && (a.d.Hc(b) || a.d.Hc(zfe(Qee((lke(), jke), b))) || a.d.Hc(Eee((lke(), jke), a.b, b)))) { - return true; - } - if (a.f) { - if (Xee((lke(), a.f), Bfe(Qee(jke, b)))) { - c2 = yfe(Qee(jke, b)); - return a.e ? c2 == 4 : c2 == 2; - } - } - return false; - } - function oKc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - m = -1; - n = 0; - for (j = a, k = 0, l = j.length; k < l; ++k) { - i2 = j[k]; - for (f2 = i2, g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - b = new urc(m == -1 ? a[0] : a[m], RD(mQb(Y2b(e), (yCc(), cAc)), 284), Bic(e), Heb(TD(mQb(Y2b(e), bAc)))); - for (c2 = 0; c2 < e.j.c.length; c2++) { - for (d = c2 + 1; d < e.j.c.length; d++) { - prc(b, RD(Vmb(e.j, c2), 12), RD(Vmb(e.j, d), 12)) > 0 && ++n; - } - } - } - ++m; - } - return n; - } - function S2c(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l; - g = RD(Gxd(c2, (umd(), Qld)), 8); - i2 = g.a; - k = g.b + a; - e = $wnd.Math.atan2(k, i2); - e < 0 && (e += dFe); - e += b; - e > dFe && (e -= dFe); - h = RD(Gxd(d, Qld), 8); - j = h.a; - l = h.b + a; - f2 = $wnd.Math.atan2(l, j); - f2 < 0 && (f2 += dFe); - f2 += b; - f2 > dFe && (f2 -= dFe); - return Zy(), bz(1e-10), $wnd.Math.abs(e - f2) <= 1e-10 || e == f2 || isNaN(e) && isNaN(f2) ? 0 : e < f2 ? -1 : e > f2 ? 1 : cz(isNaN(e), isNaN(f2)); - } - function PGb(a) { - var b, c2, d, e, f2, g, h; - h = new Tsb(); - for (d = new Anb(a.a.b); d.a < d.c.c.length; ) { - b = RD(ynb(d), 60); - Zjb(h, b, new bnb()); - } - for (e = new Anb(a.a.b); e.a < e.c.c.length; ) { - b = RD(ynb(e), 60); - b.i = pxe; - for (g = b.c.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 60); - RD(Wd(qtb(h.f, f2)), 15).Fc(b); - } - } - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - b.c.$b(); - b.c = RD(Wd(qtb(h.f, b)), 15); - } - HGb(a); - } - function AYb(a) { - var b, c2, d, e, f2, g, h; - h = new Tsb(); - for (d = new Anb(a.a.b); d.a < d.c.c.length; ) { - b = RD(ynb(d), 86); - Zjb(h, b, new bnb()); - } - for (e = new Anb(a.a.b); e.a < e.c.c.length; ) { - b = RD(ynb(e), 86); - b.o = pxe; - for (g = b.f.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 86); - RD(Wd(qtb(h.f, f2)), 15).Fc(b); - } - } - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - b.f.$b(); - b.f = RD(Wd(qtb(h.f, b)), 15); - } - tYb(a); - } - function WPb(a, b, c2, d) { - var e, f2; - VPb(a, b, c2, d); - hQb(b, a.j - b.j + c2); - iQb(b, a.k - b.k + d); - for (f2 = new Anb(b.f); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 334); - switch (e.a.g) { - case 0: - eQb(a, b.g + e.b.a, 0, b.g + e.c.a, b.i - 1); - break; - case 1: - eQb(a, b.g + b.o, b.i + e.b.a, a.o - 1, b.i + e.c.a); - break; - case 2: - eQb(a, b.g + e.b.a, b.i + b.p, b.g + e.c.a, a.p - 1); - break; - default: - eQb(a, 0, b.i + e.b.a, b.g - 1, b.i + e.c.a); - } - } - } - function $ec(a, b) { - var c2, d, e, f2, g, h, i2, j; - f2 = new bnb(); - b.b.c.length = 0; - c2 = RD(zDb(ODb(new SDb(null, new Swb(new Xkb(a.a.b), 1))), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - for (e = c2.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 17); - g = _5b(a.a, d); - if (g.b != 0) { - h = new R4b(b); - ZEb(f2.c, h); - h.p = d.a; - for (j = Sub(g, 0); j.b != j.d.c; ) { - i2 = RD(evb(j), 10); - g3b(i2, h); - } - } - } - Tmb(b.b, f2); - } - function TPb(b, c2, d, e, f2) { - var g, h, i2; - try { - if (c2 >= b.o) { - throw Adb(new web()); - } - i2 = c2 >> 5; - h = c2 & 31; - g = Sdb(1, Ydb(Sdb(h, 1))); - f2 ? b.n[d][i2] = Rdb(b.n[d][i2], g) : b.n[d][i2] = Cdb(b.n[d][i2], Qdb(g)); - g = Sdb(g, 1); - e ? b.n[d][i2] = Rdb(b.n[d][i2], g) : b.n[d][i2] = Cdb(b.n[d][i2], Qdb(g)); - } catch (a) { - a = zdb(a); - if (ZD(a, 333)) { - throw Adb(new veb(fze + b.o + "*" + b.p + gze + c2 + pve + d + hze)); - } else - throw Adb(a); - } - } - function eMc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m; - m = new yAb(new PMc(a)); - for (h = cD(WC(jR, 1), WAe, 10, 0, [b, c2]), i2 = 0, j = h.length; i2 < j; ++i2) { - g = h[i2]; - for (l = aMc(g, d).Kc(); l.Ob(); ) { - k = RD(l.Pb(), 12); - for (f2 = new l4b(k.b); xnb(f2.a) || xnb(f2.b); ) { - e = RD(xnb(f2.a) ? ynb(f2.a) : ynb(f2.b), 18); - if (!W0b(e)) { - m.a.zc(k, (Geb(), Eeb)) == null; - uMc(e) && rAb(m, k == e.c ? e.d : e.c); - } - } - } - } - return Qb(m), new dnb(m); - } - function w0c(a, b, c2, d) { - var e, f2, g; - if (b) { - f2 = Kfb(UD(mQb(b, (q$c(), j$c)))) + d; - g = c2 + Kfb(UD(mQb(b, d$c))) / 2; - pQb(b, o$c, sgb(Ydb(Hdb($wnd.Math.round(f2))))); - pQb(b, p$c, sgb(Ydb(Hdb($wnd.Math.round(g))))); - b.d.b == 0 || w0c(a, RD(Hr((e = Sub(new dXc(b).a.d, 0), new gXc(e))), 40), c2 + Kfb(UD(mQb(b, d$c))) + a.b, d + Kfb(UD(mQb(b, g$c)))); - mQb(b, m$c) != null && w0c(a, RD(mQb(b, m$c), 40), c2, d); - } - } - function cdc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - i2 = Y2b(b.a); - e = Kfb(UD(mQb(i2, (yCc(), XBc)))) * 2; - k = Kfb(UD(mQb(i2, cCc))); - j = $wnd.Math.max(e, k); - f2 = $C(iE, vxe, 28, b.f - b.c + 1, 15, 1); - d = -j; - c2 = 0; - for (h = b.b.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 10); - d += a.a[g.c.p] + j; - f2[c2++] = d; - } - d += a.a[b.a.c.p] + j; - f2[c2++] = d; - for (m = new Anb(b.e); m.a < m.c.c.length; ) { - l = RD(ynb(m), 10); - d += a.a[l.c.p] + j; - f2[c2++] = d; - } - return f2; - } - function Xud(a, b) { - var c2, d, e, f2; - f2 = RD(Gxd(a, (umd(), Old)), 64).g - RD(Gxd(b, Old), 64).g; - if (f2 != 0) { - return f2; - } - c2 = RD(Gxd(a, Jld), 17); - d = RD(Gxd(b, Jld), 17); - if (!!c2 && !!d) { - e = c2.a - d.a; - if (e != 0) { - return e; - } - } - switch (RD(Gxd(a, Old), 64).g) { - case 1: - return Qfb(a.i, b.i); - case 2: - return Qfb(a.j, b.j); - case 3: - return Qfb(b.i, a.i); - case 4: - return Qfb(b.j, a.j); - default: - throw Adb(new dgb(UAe)); - } - } - function zCd(a) { - var b, c2, d; - if ((a.Db & 64) != 0) - return Fyd(a); - b = new dib(GHe); - c2 = a.k; - if (!c2) { - !a.n && (a.n = new C5d(I4, a, 1, 7)); - if (a.n.i > 0) { - d = (!a.n && (a.n = new C5d(I4, a, 1, 7)), RD(QHd(a.n, 0), 135)).a; - !d || Zhb(Zhb((b.a += ' "', b), d), '"'); - } - } else { - Zhb(Zhb((b.a += ' "', b), c2), '"'); - } - Zhb(Uhb(Zhb(Uhb(Zhb(Uhb(Zhb(Uhb((b.a += " (", b), a.i), ","), a.j), " | "), a.g), ","), a.f), ")"); - return b.a; - } - function OCd(a) { - var b, c2, d; - if ((a.Db & 64) != 0) - return Fyd(a); - b = new dib(HHe); - c2 = a.k; - if (!c2) { - !a.n && (a.n = new C5d(I4, a, 1, 7)); - if (a.n.i > 0) { - d = (!a.n && (a.n = new C5d(I4, a, 1, 7)), RD(QHd(a.n, 0), 135)).a; - !d || Zhb(Zhb((b.a += ' "', b), d), '"'); - } - } else { - Zhb(Zhb((b.a += ' "', b), c2), '"'); - } - Zhb(Uhb(Zhb(Uhb(Zhb(Uhb(Zhb(Uhb((b.a += " (", b), a.i), ","), a.j), " | "), a.g), ","), a.f), ")"); - return b.a; - } - function Xnc(a, b) { - var c2, d, e, f2, g; - b == (TEc(), QEc) && Eob(RD(Qc(a.a, (Bnc(), xnc)), 15)); - for (e = RD(Qc(a.a, (Bnc(), xnc)), 15).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 105); - c2 = RD(Vmb(d.j, 0), 113).d.j; - f2 = new dnb(d.j); - _mb(f2, new Boc()); - switch (b.g) { - case 2: - Pnc(a, f2, c2, (joc(), hoc), 1); - break; - case 1: - case 0: - g = Rnc(f2); - Pnc(a, new Rkb(f2, 0, g), c2, (joc(), hoc), 0); - Pnc(a, new Rkb(f2, g, f2.c.length), c2, hoc, 1); - } - } - } - function sgd(a, b) { - var c2, d, e, f2, g, h, i2; - if (b == null || b.length == 0) { - return null; - } - e = RD(Xjb(a.a, b), 143); - if (!e) { - for (d = (h = new glb(a.b).a.vc().Kc(), new llb(h)); d.a.Ob(); ) { - c2 = (f2 = RD(d.a.Pb(), 44), RD(f2.md(), 143)); - g = c2.c; - i2 = b.length; - if (lhb(g.substr(g.length - i2, i2), b) && (b.length == g.length || ihb(g, g.length - b.length - 1) == 46)) { - if (e) { - return null; - } - e = c2; - } - } - !!e && $jb(a.a, b, e); - } - return e; - } - function HOb(a, b) { - var c2, d, e, f2; - c2 = new MOb(); - d = RD(zDb(GDb(new SDb(null, new Swb(a.f, 16)), c2), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), wBb), vBb]))), 21); - e = d.gc(); - d = RD(zDb(GDb(new SDb(null, new Swb(b.f, 16)), c2), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [wBb, vBb]))), 21); - f2 = d.gc(); - if (e < f2) { - return -1; - } - if (e == f2) { - return 0; - } - return 1; - } - function I8b(a) { - var b, c2, d; - if (!nQb(a, (yCc(), dBc))) { - return; - } - d = RD(mQb(a, dBc), 21); - if (d.dc()) { - return; - } - c2 = (b = RD(mfb(A3), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)); - d.Hc((dod(), $nd)) ? zsb(c2, $nd) : zsb(c2, _nd); - d.Hc(Ynd) || zsb(c2, Ynd); - d.Hc(Xnd) ? zsb(c2, cod) : d.Hc(Wnd) ? zsb(c2, bod) : d.Hc(Znd) && zsb(c2, aod); - d.Hc(cod) ? zsb(c2, Xnd) : d.Hc(bod) ? zsb(c2, Wnd) : d.Hc(aod) && zsb(c2, Znd); - pQb(a, dBc, c2); - } - function KLc(a) { - var b, c2, d, e, f2, g, h; - e = RD(mQb(a, (Ywc(), pwc)), 10); - d = a.j; - c2 = (tFb(0, d.c.length), RD(d.c[0], 12)); - for (g = new Anb(e.j); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 12); - if (dE(f2) === dE(mQb(c2, Awc))) { - if (f2.j == (qpd(), Yod) && a.p > e.p) { - Q3b(f2, npd); - if (f2.d) { - h = f2.o.b; - b = f2.a.b; - f2.a.b = h - b; - } - } else if (f2.j == npd && e.p > a.p) { - Q3b(f2, Yod); - if (f2.d) { - h = f2.o.b; - b = f2.a.b; - f2.a.b = -(h - b); - } - } - break; - } - } - return e; - } - function nTb(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l; - if (!(ZD(b, 207) || ZD(b, 366) || ZD(b, 193))) { - throw Adb(new agb("Method only works for ElkNode-, ElkLabel and ElkPort-objects.")); - } - g = a.a / 2; - i2 = b.i + d - g; - k = b.j + e - g; - j = i2 + b.g + a.a; - l = k + b.f + a.a; - f2 = new Ejd(); - Mub(f2, new rjd(i2, k)); - Mub(f2, new rjd(i2, l)); - Mub(f2, new rjd(j, l)); - Mub(f2, new rjd(j, k)); - h = new ORb(f2); - kQb(h, b); - c2 && Zjb(a.b, b, h); - return h; - } - function w$b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - f2 = new rjd(b, c2); - for (k = new Anb(a.a); k.a < k.c.c.length; ) { - j = RD(ynb(k), 10); - $id(j.n, f2); - for (m = new Anb(j.j); m.a < m.c.c.length; ) { - l = RD(ynb(m), 12); - for (e = new Anb(l.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - Cjd(d.a, f2); - g = RD(mQb(d, (yCc(), RAc)), 75); - !!g && Cjd(g, f2); - for (i2 = new Anb(d.b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 72); - $id(h.n, f2); - } - } - } - } - } - function o2b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - f2 = new rjd(b, c2); - for (k = new Anb(a.a); k.a < k.c.c.length; ) { - j = RD(ynb(k), 10); - $id(j.n, f2); - for (m = new Anb(j.j); m.a < m.c.c.length; ) { - l = RD(ynb(m), 12); - for (e = new Anb(l.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - Cjd(d.a, f2); - g = RD(mQb(d, (yCc(), RAc)), 75); - !!g && Cjd(g, f2); - for (i2 = new Anb(d.b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 72); - $id(h.n, f2); - } - } - } - } - } - function X4b(a) { - if ((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i == 0) { - throw Adb(new Ked("Edges must have a source.")); - } else if ((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c).i == 0) { - throw Adb(new Ked("Edges must have a target.")); - } else { - !a.b && (a.b = new Yie(E4, a, 4, 7)); - if (!(a.b.i <= 1 && (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c.i <= 1))) { - throw Adb(new Ked("Hyperedges are not supported.")); - } - } - } - function mKc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - l = 0; - f2 = new wmb(); - hmb(f2, b); - while (f2.b != f2.c) { - i2 = RD(smb(f2), 219); - j = 0; - k = RD(mQb(b.j, (yCc(), cAc)), 284); - g = Kfb(UD(mQb(b.j, Zzc))); - h = Kfb(UD(mQb(b.j, $zc))); - if (k != (kEc(), hEc)) { - j += g * nKc(i2.e, k); - j += h * oKc(i2.e); - } - l += PLc(i2.d, i2.e) + j; - for (e = new Anb(i2.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 36); - c2 = RD(Vmb(a.b, d.p), 219); - c2.s || (l += lKc(a, c2)); - } - } - return l; - } - function Pib() { - Pib = geb; - var a; - Kib = new ajb(1, 1); - Mib = new ajb(1, 10); - Oib = new ajb(0, 0); - Jib = new ajb(-1, 1); - Lib = cD(WC(uJ, 1), Nve, 92, 0, [Oib, Kib, new ajb(1, 2), new ajb(1, 3), new ajb(1, 4), new ajb(1, 5), new ajb(1, 6), new ajb(1, 7), new ajb(1, 8), new ajb(1, 9), Mib]); - Nib = $C(uJ, Nve, 92, 32, 0, 1); - for (a = 0; a < Nib.length; a++) { - Nib[a] = Jdb(Sdb(1, a), 0) ? jjb(Sdb(1, a)) : Xib(jjb(Odb(Sdb(1, a)))); - } - } - function JJb(a, b, c2, d, e, f2, g) { - a.c = d.Lf().a; - a.d = d.Lf().b; - if (e) { - a.c += e.Lf().a; - a.d += e.Lf().b; - } - a.b = b.Mf().a; - a.a = b.Mf().b; - if (!e) { - c2 ? a.c -= g + b.Mf().a : a.c += d.Mf().a + g; - } else { - switch (e.ag().g) { - case 0: - case 2: - a.c += e.Mf().a + g + f2.a + g; - break; - case 4: - a.c -= g + f2.a + g + b.Mf().a; - break; - case 1: - a.c += e.Mf().a + g; - a.d -= g + f2.b + g + b.Mf().b; - break; - case 3: - a.c += e.Mf().a + g; - a.d += e.Mf().b + g + f2.b + g; - } - } - } - function xdc(a, b) { - var c2, d; - this.b = new bnb(); - this.e = new bnb(); - this.a = a; - this.d = b; - udc(this); - vdc(this); - this.b.dc() ? this.c = a.c.p : this.c = RD(this.b.Xb(0), 10).c.p; - this.e.c.length == 0 ? this.f = a.c.p : this.f = RD(Vmb(this.e, this.e.c.length - 1), 10).c.p; - for (d = RD(mQb(a, (Ywc(), Mwc)), 15).Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 72); - if (nQb(c2, (yCc(), uAc))) { - this.d = RD(mQb(c2, uAc), 232); - break; - } - } - } - function erc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - d = RD(Wjb(a.a, b), 49); - f2 = RD(Wjb(a.a, c2), 49); - e = RD(Wjb(a.e, b), 49); - g = RD(Wjb(a.e, c2), 49); - d.a.zc(c2, d); - g.a.zc(b, g); - for (k = f2.a.ec().Kc(); k.Ob(); ) { - j = RD(k.Pb(), 10); - d.a.zc(j, d); - Ysb(RD(Wjb(a.e, j), 49), b); - ye(RD(Wjb(a.e, j), 49), e); - } - for (i2 = e.a.ec().Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 10); - g.a.zc(h, g); - Ysb(RD(Wjb(a.a, h), 49), c2); - ye(RD(Wjb(a.a, h), 49), f2); - } - } - function uLc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - d = RD(Wjb(a.a, b), 49); - f2 = RD(Wjb(a.a, c2), 49); - e = RD(Wjb(a.b, b), 49); - g = RD(Wjb(a.b, c2), 49); - d.a.zc(c2, d); - g.a.zc(b, g); - for (k = f2.a.ec().Kc(); k.Ob(); ) { - j = RD(k.Pb(), 10); - d.a.zc(j, d); - Ysb(RD(Wjb(a.b, j), 49), b); - ye(RD(Wjb(a.b, j), 49), e); - } - for (i2 = e.a.ec().Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 10); - g.a.zc(h, g); - Ysb(RD(Wjb(a.a, h), 49), c2); - ye(RD(Wjb(a.a, h), 49), f2); - } - } - function rrc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - d = RD(Wjb(a.a, b), 49); - f2 = RD(Wjb(a.a, c2), 49); - e = RD(Wjb(a.d, b), 49); - g = RD(Wjb(a.d, c2), 49); - d.a.zc(c2, d); - g.a.zc(b, g); - for (k = f2.a.ec().Kc(); k.Ob(); ) { - j = RD(k.Pb(), 12); - d.a.zc(j, d); - Ysb(RD(Wjb(a.d, j), 49), b); - ye(RD(Wjb(a.d, j), 49), e); - } - for (i2 = e.a.ec().Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 12); - g.a.zc(h, g); - Ysb(RD(Wjb(a.a, h), 49), c2); - ye(RD(Wjb(a.a, h), 49), f2); - } - } - function lTc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2; - f2 = c2; - if (c2 < d) { - m = (n = new USc(a.p), o2 = new USc(a.p), ye(n.e, a.e), n.q = a.q, n.r = o2, LSc(n), ye(o2.j, a.j), o2.r = n, LSc(o2), new Ptd(n, o2)); - l = RD(m.a, 118); - k = RD(m.b, 118); - e = (tFb(f2, b.c.length), RD(b.c[f2], 339)); - g = sTc(a, l, k, e); - for (j = c2 + 1; j <= d; j++) { - h = (tFb(j, b.c.length), RD(b.c[j], 339)); - i2 = sTc(a, l, k, h); - if (qTc(h, i2, e, g)) { - e = h; - g = i2; - f2 = j; - } - } - } - return f2; - } - function c8c(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2; - g = RD(QHd(b, 0), 27); - Dyd(g, 0); - Eyd(g, 0); - m = new bnb(); - ZEb(m.c, g); - h = g; - f2 = new lad(a.a, g.g, g.f, (sad(), rad)); - for (n = 1; n < b.i; n++) { - o2 = RD(QHd(b, n), 27); - i2 = d8c(a, oad, o2, h, f2, m, c2); - j = d8c(a, nad, o2, h, f2, m, c2); - k = d8c(a, qad, o2, h, f2, m, c2); - l = d8c(a, pad2, o2, h, f2, m, c2); - e = f8c(a, i2, j, k, l, o2, h, d); - Dyd(o2, e.d); - Eyd(o2, e.e); - kad(e, rad); - f2 = e; - h = o2; - ZEb(m.c, o2); - } - return f2; - } - function yEd(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - k = null; - m = b; - l = pEd(a, DGd(c2), m); - jyd(l, zDd(m, uIe)); - g = wDd(m, kIe); - d = new MEd(a, l); - ODd(d.a, d.b, g); - h = wDd(m, lIe); - e = new NEd(a, l); - PDd(e.a, e.b, h); - if ((!l.b && (l.b = new Yie(E4, l, 4, 7)), l.b).i == 0 || (!l.c && (l.c = new Yie(E4, l, 5, 8)), l.c).i == 0) { - f2 = zDd(m, uIe); - i2 = yIe + f2; - j = i2 + zIe; - throw Adb(new CDd(j)); - } - GEd(m, l); - zEd(a, m, l); - k = CEd(a, m, l); - return k; - } - function pJb(a, b) { - var c2, d, e, f2, g, h, i2; - e = $C(kE, Pwe, 28, a.e.a.c.length, 15, 1); - for (g = new Anb(a.e.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 125); - e[f2.d] += f2.b.a.c.length; - } - h = gv(b); - while (h.b != 0) { - f2 = RD(h.b == 0 ? null : (sFb(h.b != 0), Wub(h, h.a.a)), 125); - for (d = Nr(new Anb(f2.g.a)); d.Ob(); ) { - c2 = RD(d.Pb(), 218); - i2 = c2.e; - i2.e = $wnd.Math.max(i2.e, f2.e + c2.a); - --e[i2.d]; - e[i2.d] == 0 && (Pub(h, i2, h.c.b, h.c), true); - } - } - } - function tJb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - c2 = qwe; - e = lve; - for (h = new Anb(a.e.a); h.a < h.c.c.length; ) { - f2 = RD(ynb(h), 125); - e = $wnd.Math.min(e, f2.e); - c2 = $wnd.Math.max(c2, f2.e); - } - b = $C(kE, Pwe, 28, c2 - e + 1, 15, 1); - for (g = new Anb(a.e.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 125); - f2.e -= e; - ++b[f2.e]; - } - d = 0; - if (a.k != null) { - for (j = a.k, k = 0, l = j.length; k < l; ++k) { - i2 = j[k]; - b[d++] += i2; - if (b.length == d) { - break; - } - } - } - return b; - } - function I0c(a, b) { - var c2, d, e, f2, g, h; - b.Ug("Edge routing", 1); - e = RD(mQb(a, (h_c(), K$c)), 392); - if (e == (LZc(), JZc)) { - G0c(a); - } else if (e == IZc) { - RD(Lvb(DDb(CDb(new SDb(null, new Swb(a.b, 16)), new AWc()))), 40); - f2 = Kfb(UD(mQb(a, $$c))); - g = Kfb(UD(mQb(a, J$c))); - h = RD(mQb(a, H$c), 88); - E0c(a, h, f2); - F0c(a, h, f2, g); - D0c(a, h, f2, g); - for (d = Sub(a.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 65); - c2.a.b < 2 && H0c(c2); - } - } - b.Vg(); - } - function IKd(a) { - switch (a.d) { - case 9: - case 8: { - return true; - } - case 3: - case 5: - case 4: - case 6: { - return false; - } - case 7: { - return RD(HKd(a), 17).a == a.o; - } - case 1: - case 2: { - if (a.o == -2) { - return false; - } else { - switch (a.p) { - case 0: - case 1: - case 2: - case 6: - case 5: - case 7: { - return Gdb(a.k, a.f); - } - case 3: - case 4: { - return a.j == a.e; - } - default: { - return a.n == null ? a.g == null : pb(a.n, a.g); - } - } - } - } - default: { - return false; - } - } - } - function Grc(a, b) { - var c2, d, e; - b.Ug("Breaking Point Insertion", 1); - d = new ysc(a); - switch (RD(mQb(a, (yCc(), rCc)), 351).g) { - case 2: - e = new Ksc(); - break; - case 0: - e = new zrc(); - break; - default: - e = new Nsc(); - } - c2 = e.og(a, d); - Heb(TD(mQb(a, tCc))) && (c2 = Frc(a, c2)); - if (!e.pg() && nQb(a, xCc)) { - switch (RD(mQb(a, xCc), 352).g) { - case 2: - c2 = Wsc(d, c2); - break; - case 1: - c2 = Usc(d, c2); - } - } - if (c2.dc()) { - b.Vg(); - return; - } - Drc(a, c2); - b.Vg(); - } - function oJc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - f2 = new cnb(b.c.length); - for (j = new Anb(b); j.a < j.c.c.length; ) { - g = RD(ynb(j), 10); - Rmb(f2, a.b[g.c.p][g.p]); - } - jJc(a, f2, c2); - l = null; - while (l = kJc(f2)) { - lJc(a, RD(l.a, 239), RD(l.b, 239), f2); - } - b.c.length = 0; - for (e = new Anb(f2); e.a < e.c.c.length; ) { - d = RD(ynb(e), 239); - for (h = d.d, i2 = 0, k = h.length; i2 < k; ++i2) { - g = h[i2]; - ZEb(b.c, g); - a.a[g.c.p][g.p].a = pJc(d.g, d.d[0]).a; - } - } - } - function wnd(a) { - Cgd(a, new Pfd($fd(Xfd(Zfd(Yfd(new agd(), pHe), "ELK Fixed"), "Keeps the current layout as it is, without any automatic modification. Optional coordinates can be given for nodes and edge bend points."), new znd()))); - Agd(a, pHe, Eze, tnd); - Agd(a, pHe, fEe, iGd(und)); - Agd(a, pHe, QGe, iGd(ond)); - Agd(a, pHe, jAe, iGd(pnd)); - Agd(a, pHe, CAe, iGd(rnd)); - Agd(a, pHe, hAe, iGd(qnd)); - } - function Do(a, b, c2) { - var d, e, f2, g, h; - d = Ydb(Ndb(cwe, qgb(Ydb(Ndb(b == null ? 0 : tb(b), dwe)), 15))); - h = Ydb(Ndb(cwe, qgb(Ydb(Ndb(c2 == null ? 0 : tb(c2), dwe)), 15))); - f2 = Go(a, b, d); - if (!!f2 && h == f2.f && Hb(c2, f2.i)) { - return c2; - } - g = Ho(a, c2, h); - if (g) { - throw Adb(new agb("value already present: " + c2)); - } - e = new kp(b, d, c2, h); - if (f2) { - yo(a, f2); - Bo(a, e, f2); - f2.e = null; - f2.c = null; - return f2.i; - } else { - Bo(a, e, null); - Fo(a); - return null; - } - } - function V7b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2; - k = c2.a.c; - g = c2.a.c + c2.a.b; - f2 = RD(Wjb(c2.c, b), 468); - n = f2.f; - o2 = f2.a; - f2.b ? i2 = new rjd(g, n) : i2 = new rjd(k, n); - f2.c ? l = new rjd(k, o2) : l = new rjd(g, o2); - e = k; - c2.p || (e += a.c); - e += c2.F + c2.v * a.b; - j = new rjd(e, n); - m = new rjd(e, o2); - zjd(b.a, cD(WC(l3, 1), Nve, 8, 0, [i2, j])); - h = c2.d.a.gc() > 1; - if (h) { - d = new rjd(e, c2.b); - Mub(b.a, d); - } - zjd(b.a, cD(WC(l3, 1), Nve, 8, 0, [m, l])); - } - function aEc() { - aEc = geb; - $Dc = new bEc(LAe, 0); - VDc = new bEc("NIKOLOV", 1); - YDc = new bEc("NIKOLOV_PIXEL", 2); - WDc = new bEc("NIKOLOV_IMPROVED", 3); - XDc = new bEc("NIKOLOV_IMPROVED_PIXEL", 4); - SDc = new bEc("DUMMYNODE_PERCENTAGE", 5); - ZDc = new bEc("NODECOUNT_PERCENTAGE", 6); - _Dc = new bEc("NO_BOUNDARY", 7); - TDc = new bEc("MODEL_ORDER_LEFT_TO_RIGHT", 8); - UDc = new bEc("MODEL_ORDER_RIGHT_TO_LEFT", 9); - } - function use(a) { - var b, c2, d, e, f2; - d = a.length; - b = new Rhb(); - f2 = 0; - while (f2 < d) { - c2 = ihb(a, f2++); - if (c2 == 9 || c2 == 10 || c2 == 12 || c2 == 13 || c2 == 32) - continue; - if (c2 == 35) { - while (f2 < d) { - c2 = ihb(a, f2++); - if (c2 == 13 || c2 == 10) - break; - } - continue; - } - if (c2 == 92 && f2 < d) { - if ((e = (BFb(f2, a.length), a.charCodeAt(f2))) == 35 || e == 9 || e == 10 || e == 12 || e == 13 || e == 32) { - Jhb(b, e & Bwe); - ++f2; - } else { - b.a += "\\"; - Jhb(b, e & Bwe); - ++f2; - } - } else - Jhb(b, c2 & Bwe); - } - return b.a; - } - function D4c() { - D4c = geb; - n4c = new lGd(oFe, (Geb(), false)); - t4c = new lGd(pFe, sgb(0)); - u4c = new lGd(qFe, 0); - v4c = new lGd(rFe, false); - q4c = (g4c(), d4c); - p4c = new lGd(sFe, q4c); - sgb(0); - o4c = new lGd(tFe, sgb(1)); - A4c = (t5c(), r5c); - z4c = new lGd(uFe, A4c); - C4c = (Y3c(), X3c); - B4c = new lGd(vFe, C4c); - s4c = (j5c(), i5c); - r4c = new lGd(wFe, s4c); - y4c = new lGd(xFe, 0); - w4c = new lGd(yFe, false); - x4c = new lGd(zFe, false); - } - function t3c(a, b) { - var c2, d, e; - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 27); - Rc(a.a, c2, c2); - Rc(a.b, c2, c2); - e = Q2c(c2); - if (e.c.length != 0) { - !!a.d && a.d.Gg(e); - Rc(a.a, c2, (tFb(0, e.c.length), RD(e.c[0], 27))); - Rc(a.b, c2, RD(Vmb(e, e.c.length - 1), 27)); - while (N2c(e).c.length != 0) { - e = N2c(e); - !!a.d && a.d.Gg(e); - Rc(a.a, c2, (tFb(0, e.c.length), RD(e.c[0], 27))); - Rc(a.b, c2, RD(Vmb(e, e.c.length - 1), 27)); - } - } - } - } - function jwd(a, b, c2) { - var d, e, f2, g, h, i2; - if (!b) { - return null; - } else { - if (c2 <= -1) { - d = vYd(b.Dh(), -1 - c2); - if (ZD(d, 102)) { - return RD(d, 19); - } else { - g = RD(b.Mh(d), 160); - for (h = 0, i2 = g.gc(); h < i2; ++h) { - if (dE(g.Ul(h)) === dE(a)) { - e = g.Tl(h); - if (ZD(e, 102)) { - f2 = RD(e, 19); - if ((f2.Bb & QHe) != 0) { - return f2; - } - } - } - } - throw Adb(new dgb("The containment feature could not be located")); - } - } else { - return Z5d(RD(vYd(a.Dh(), c2), 19)); - } - } - } - function Lqc(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - c2 = 0; - for (h = new Anb(a.d); h.a < h.c.c.length; ) { - g = RD(ynb(h), 105); - !!g.i && (g.i.c = c2++); - } - b = YC(xdb, [Nve, Hye], [183, 28], 16, [c2, c2], 2); - k = a.d; - for (e = 0; e < k.c.length; e++) { - i2 = (tFb(e, k.c.length), RD(k.c[e], 105)); - if (i2.i) { - for (f2 = e + 1; f2 < k.c.length; f2++) { - j = (tFb(f2, k.c.length), RD(k.c[f2], 105)); - if (j.i) { - d = Qqc(i2, j); - b[i2.i.c][j.i.c] = d; - b[j.i.c][i2.i.c] = d; - } - } - } - } - return b; - } - function u7c() { - u7c = geb; - m7c = new lGd(LFe, (Geb(), false)); - sgb(-1); - f7c = new lGd(MFe, sgb(-1)); - sgb(-1); - g7c = new lGd(NFe, sgb(-1)); - h7c = new lGd(OFe, false); - s7c = (z8c(), x8c); - r7c = new lGd(PFe, s7c); - t7c = new lGd(QFe, -1); - q7c = (_6c(), $6c); - p7c = new lGd(RFe, q7c); - o7c = new lGd(SFe, true); - l7c = (b9c(), $8c); - k7c = new lGd(TFe, l7c); - j7c = new lGd(UFe, false); - sgb(1); - i7c = new lGd(VFe, sgb(1)); - n7c = new jGd(WFe); - } - function WYc() { - WYc = geb; - VYc = new XYc("ROOT_PROC", 0); - OYc = new XYc("FAN_PROC", 1); - SYc = new XYc("LEVEL_PROC", 2); - TYc = new XYc("NEIGHBORS_PROC", 3); - RYc = new XYc("LEVEL_HEIGHT", 4); - NYc = new XYc("DIRECTION_PROC", 5); - UYc = new XYc("NODE_POSITION_PROC", 6); - LYc = new XYc("COMPACTION_PROC", 7); - QYc = new XYc("LEVEL_COORDS", 8); - PYc = new XYc("GRAPH_BOUNDS_PROC", 9); - MYc = new XYc("DETREEIFYING_PROC", 10); - } - function Fee(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - l = zYd(b); - j = null; - e = false; - for (h = 0, k = tYd(l.a).i; h < k; ++h) { - g = RD(N_d(l, h, (f2 = RD(QHd(tYd(l.a), h), 89), i2 = f2.c, ZD(i2, 90) ? RD(i2, 29) : (JTd(), zTd))), 29); - c2 = Fee(a, g); - if (!c2.dc()) { - if (!j) { - j = c2; - } else { - if (!e) { - e = true; - j = new PSd(j); - } - j.Gc(c2); - } - } - } - d = Kee(a, b); - if (d.dc()) { - return !j ? (yob(), yob(), vob) : j; - } else { - if (!j) { - return d; - } else { - e || (j = new PSd(j)); - j.Gc(d); - return j; - } - } - } - function Gee(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - l = zYd(b); - j = null; - d = false; - for (h = 0, k = tYd(l.a).i; h < k; ++h) { - f2 = RD(N_d(l, h, (e = RD(QHd(tYd(l.a), h), 89), i2 = e.c, ZD(i2, 90) ? RD(i2, 29) : (JTd(), zTd))), 29); - c2 = Gee(a, f2); - if (!c2.dc()) { - if (!j) { - j = c2; - } else { - if (!d) { - d = true; - j = new PSd(j); - } - j.Gc(c2); - } - } - } - g = Nee(a, b); - if (g.dc()) { - return !j ? (yob(), yob(), vob) : j; - } else { - if (!j) { - return g; - } else { - d || (j = new PSd(j)); - j.Gc(g); - return j; - } - } - } - function gNb(a) { - var b, c2, d, e; - d = a.o; - RMb(); - if (a.A.dc() || pb(a.A, QMb)) { - e = d.a; - } else { - e = ZKb(a.f); - if (a.A.Hc((Qpd(), Npd)) && !a.B.Hc((dqd(), _pd))) { - e = $wnd.Math.max(e, ZKb(RD(Vrb(a.p, (qpd(), Yod)), 252))); - e = $wnd.Math.max(e, ZKb(RD(Vrb(a.p, npd), 252))); - } - b = TMb(a); - !!b && (e = $wnd.Math.max(e, b.a)); - } - Heb(TD(a.e.Tf().of((umd(), mld)))) ? d.a = $wnd.Math.max(d.a, e) : d.a = e; - c2 = a.f.i; - c2.c = 0; - c2.b = e; - $Kb(a.f); - } - function _fe(a, b, c2) { - var d, e, f2, g, h, i2; - if (ZD(b, 76)) { - return rLd(a, b, c2); - } else { - h = null; - f2 = null; - d = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - e = d[g]; - if (pb(b, e.md())) { - f2 = e.Lk(); - if (ZD(f2, 102) && (RD(f2, 19).Bb & QHe) != 0) { - h = e; - break; - } - } - } - if (h) { - if (Mvd(a.e)) { - i2 = f2.Jk() ? fge(a, 4, f2, b, null, kge(a, f2, b, ZD(f2, 102) && (RD(f2, 19).Bb & txe) != 0), true) : fge(a, f2.tk() ? 2 : 1, f2, b, f2.ik(), -1, true); - c2 ? c2.nj(i2) : c2 = i2; - } - c2 = _fe(a, h, c2); - } - return c2; - } - } - function yge(a, b, c2) { - var d, e, f2, g; - g = pke(a.e.Dh(), b); - d = RD(a.g, 124); - nke(); - if (RD(b, 69).xk()) { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (g.am(e.Lk())) { - if (pb(e, c2)) { - vLd(a, f2); - return true; - } - } - } - } else if (c2 != null) { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (g.am(e.Lk())) { - if (pb(c2, e.md())) { - vLd(a, f2); - return true; - } - } - } - } else { - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (g.am(e.Lk())) { - if (e.md() == null) { - vLd(a, f2); - return true; - } - } - } - } - return false; - } - function xcc(a, b) { - var c2, d, e, f2, g; - b.Ug("Node and Port Label Placement and Node Sizing", 1); - DJb((i1b(), new t1b(a, true, true, new Acc()))); - if (RD(mQb(a, (Ywc(), kwc)), 21).Hc((ovc(), hvc))) { - f2 = RD(mQb(a, (yCc(), EBc)), 21); - e = f2.Hc((Pod(), Mod)); - g = Heb(TD(mQb(a, FBc))); - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - FDb(CDb(new SDb(null, new Swb(c2.a, 16)), new Ccc()), new Ecc(f2, e, g)); - } - } - b.Vg(); - } - function SHc(a, b) { - var c2, d, e, f2, g; - a.c == null || a.c.length < b.c.length ? a.c = $C(xdb, Hye, 28, b.c.length, 16, 1) : Nnb(a.c); - a.a = new bnb(); - d = 0; - for (g = new Anb(b); g.a < g.c.c.length; ) { - e = RD(ynb(g), 10); - e.p = d++; - } - c2 = new Yub(); - for (f2 = new Anb(b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - if (!a.c[e.p]) { - THc(a, e); - c2.b == 0 || (sFb(c2.b != 0), RD(c2.a.a.c, 15)).gc() < a.a.c.length ? Nub(c2, a.a) : Oub(c2, a.a); - a.a = new bnb(); - } - } - return c2; - } - function Ucd(a) { - Cgd(a, new Pfd($fd(Xfd(Zfd(Yfd(new agd(), uGe), "ELK SPOrE Overlap Removal"), 'A node overlap removal algorithm proposed by Nachmanson et al. in "Node overlap removal by growing a tree".'), new Xcd()))); - Agd(a, uGe, iGe, iGd(Scd)); - Agd(a, uGe, Eze, Qcd); - Agd(a, uGe, _ze, 8); - Agd(a, uGe, nGe, iGd(Rcd)); - Agd(a, uGe, qGe, iGd(Ocd)); - Agd(a, uGe, rGe, iGd(Pcd)); - Agd(a, uGe, LDe, (Geb(), false)); - } - function Dee(a, b) { - var c2, d, e, f2, g, h, i2; - c2 = b.qi(a.a); - if (c2) { - i2 = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), cLe)); - if (i2 != null) { - d = new bnb(); - for (f2 = vhb(i2, "\\w"), g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - lhb(e, "##other") ? Rmb(d, "!##" + Uee(a, BXd(b.qk()))) : lhb(e, "##local") ? (d.c.push(null), true) : lhb(e, aLe) ? Rmb(d, Uee(a, BXd(b.qk()))) : (ZEb(d.c, e), true); - } - return d; - } - } - return yob(), yob(), vob; - } - function u$b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n; - g = Zid(b.c, c2, d); - for (l = new Anb(b.a); l.a < l.c.c.length; ) { - k = RD(ynb(l), 10); - $id(k.n, g); - for (n = new Anb(k.j); n.a < n.c.c.length; ) { - m = RD(ynb(n), 12); - for (f2 = new Anb(m.g); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 18); - Cjd(e.a, g); - h = RD(mQb(e, (yCc(), RAc)), 75); - !!h && Cjd(h, g); - for (j = new Anb(e.b); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 72); - $id(i2.n, g); - } - } - } - Rmb(a.a, k); - k.a = a; - } - } - function wYb(a) { - var b, c2, d, e, f2, g, h, i2; - if (a.d) { - throw Adb(new dgb((lfb(eQ), lye + eQ.k + mye))); - } - a.c == (Cmd(), Amd) && vYb(a, ymd); - for (c2 = new Anb(a.a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 194); - b.e = 0; - } - for (g = new Anb(a.a.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 86); - f2.o = pxe; - for (e = f2.f.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 86); - ++d.d.e; - } - } - LYb(a); - for (i2 = new Anb(a.a.b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 86); - h.k = true; - } - return a; - } - function mnc(a, b) { - var c2, d, e, f2, g, h, i2, j; - h = new Vmc(a); - c2 = new Yub(); - Pub(c2, b, c2.c.b, c2.c); - while (c2.b != 0) { - d = RD(c2.b == 0 ? null : (sFb(c2.b != 0), Wub(c2, c2.a.a)), 113); - d.d.p = 1; - for (g = new Anb(d.e); g.a < g.c.c.length; ) { - e = RD(ynb(g), 340); - Qmc(h, e); - j = e.d; - j.d.p == 0 && (Pub(c2, j, c2.c.b, c2.c), true); - } - for (f2 = new Anb(d.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 340); - Qmc(h, e); - i2 = e.c; - i2.d.p == 0 && (Pub(c2, i2, c2.c.b, c2.c), true); - } - } - return h; - } - function ksd(a) { - var b, c2, d, e, f2; - d = Kfb(UD(Gxd(a, (umd(), Uld)))); - if (d == 1) { - return; - } - zyd(a, d * a.g, d * a.f); - c2 = cr(hr((!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c), new Lsd())); - for (f2 = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [(!a.n && (a.n = new C5d(I4, a, 1, 7)), a.n), (!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c), c2]))); gs(f2); ) { - e = RD(hs(f2), 422); - e.qh(d * e.nh(), d * e.oh()); - e.ph(d * e.mh(), d * e.lh()); - b = RD(e.of(Fld), 8); - if (b) { - b.a *= d; - b.b *= d; - } - } - } - function Qfe(a, b, c2) { - var d, e, f2, g, h; - g = (nke(), RD(b, 69).xk()); - if (qke(a.e, b)) { - if (b.Si() && dge(a, b, c2, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0)) { - return false; - } - } else { - h = pke(a.e.Dh(), b); - d = RD(a.g, 124); - for (f2 = 0; f2 < a.i; ++f2) { - e = d[f2]; - if (h.am(e.Lk())) { - if (g ? pb(e, c2) : c2 == null ? e.md() == null : pb(c2, e.md())) { - return false; - } else { - RD(eHd(a, f2, g ? RD(c2, 76) : oke(b, c2)), 76); - return true; - } - } - } - } - return WGd(a, g ? RD(c2, 76) : oke(b, c2)); - } - function _dc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m; - for (g = new Anb(a.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - m = t2b(f2.a); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i2 = j[k]; - switch (RD(mQb(i2, (yCc(), UAc)), 171).g) { - case 1: - dec(i2); - g3b(i2, b); - aec(i2, true, d); - break; - case 3: - eec(i2); - g3b(i2, c2); - aec(i2, false, e); - } - } - } - h = new Jkb(a.b, 0); - while (h.b < h.d.gc()) { - (sFb(h.b < h.d.gc()), RD(h.d.Xb(h.c = h.b++), 30)).a.c.length == 0 && Ckb(h); - } - } - function mjb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - n = b.length; - i2 = n; - BFb(0, b.length); - if (b.charCodeAt(0) == 45) { - l = -1; - m = 1; - --n; - } else { - l = 1; - m = 0; - } - f2 = (xjb(), wjb)[10]; - e = n / f2 | 0; - q = n % f2; - q != 0 && ++e; - h = $C(kE, Pwe, 28, e, 15, 1); - c2 = vjb[8]; - g = 0; - o2 = m + (q == 0 ? f2 : q); - for (p = m; p < i2; p = o2, o2 = p + f2) { - d = Oeb((AFb(p, o2, b.length), b.substr(p, o2 - p)), qwe, lve); - j = (Ljb(), Pjb(h, h, g, c2)); - j += Fjb(h, g, d); - h[g++] = j; - } - k = g; - a.e = l; - a.d = k; - a.a = h; - Rib(a); - } - function bPb(a, b) { - var c2, d, e, f2; - c2 = new gPb(); - d = RD(zDb(GDb(new SDb(null, new Swb(a.f, 16)), c2), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), wBb), vBb]))), 21); - e = d.gc(); - d = RD(zDb(GDb(new SDb(null, new Swb(b.f, 16)), c2), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [wBb, vBb]))), 21); - f2 = d.gc(); - e = e == 1 ? 1 : 0; - f2 = f2 == 1 ? 1 : 0; - if (e < f2) { - return -1; - } - if (e == f2) { - return 0; - } - return 1; - } - function p0b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - h = a.i; - e = Heb(TD(mQb(h, (yCc(), NAc)))); - k = 0; - d = 0; - for (j = new Anb(a.g); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 18); - g = W0b(i2); - f2 = g && e && Heb(TD(mQb(i2, OAc))); - m = i2.d.i; - g && f2 ? ++d : g && !f2 ? ++k : Y2b(m).e == h ? ++d : ++k; - } - for (c2 = new Anb(a.e); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 18); - g = W0b(b); - f2 = g && e && Heb(TD(mQb(b, OAc))); - l = b.c.i; - g && f2 ? ++k : g && !f2 ? ++d : Y2b(l).e == h ? ++k : ++d; - } - return k - d; - } - function sQc(a, b, c2, d) { - this.e = a; - this.k = RD(mQb(a, (Ywc(), Qwc)), 312); - this.g = $C(jR, WAe, 10, b, 0, 1); - this.b = $C(VI, Nve, 345, b, 7, 1); - this.a = $C(jR, WAe, 10, b, 0, 1); - this.d = $C(VI, Nve, 345, b, 7, 1); - this.j = $C(jR, WAe, 10, b, 0, 1); - this.i = $C(VI, Nve, 345, b, 7, 1); - this.p = $C(VI, Nve, 345, b, 7, 1); - this.n = $C(QI, Nve, 485, b, 8, 1); - Mnb(this.n, (Geb(), false)); - this.f = $C(QI, Nve, 485, b, 8, 1); - Mnb(this.f, true); - this.o = c2; - this.c = d; - } - function mdc(a, b) { - var c2, d, e, f2, g, h; - if (b.dc()) { - return; - } - if (RD(b.Xb(0), 293).d == (btc(), $sc)) { - ddc(a, b); - } else { - for (d = b.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 293); - switch (c2.d.g) { - case 5: - _cc(a, c2, fdc(a, c2)); - break; - case 0: - _cc(a, c2, (g = c2.f - c2.c + 1, h = (g - 1) / 2 | 0, c2.c + h)); - break; - case 4: - _cc(a, c2, hdc(a, c2)); - break; - case 2: - ndc(c2); - _cc(a, c2, (f2 = jdc(c2), f2 ? c2.c : c2.f)); - break; - case 1: - ndc(c2); - _cc(a, c2, (e = jdc(c2), e ? c2.f : c2.c)); - } - edc(c2.a); - } - } - } - function zt(a, b, c2, d) { - var e, f2, g; - g = new Hu(b, c2); - if (!a.a) { - a.a = a.e = g; - Zjb(a.b, b, new Gu(g)); - ++a.c; - } else if (!d) { - RD(Hvb(a.e), 511).b = g; - g.d = a.e; - a.e = g; - e = RD(Wjb(a.b, b), 260); - if (!e) { - Zjb(a.b, b, e = new Gu(g)); - ++a.c; - } else { - ++e.a; - f2 = e.c; - f2.c = g; - g.e = f2; - e.c = g; - } - } else { - e = RD(Hvb(RD(Wjb(a.b, b), 260)), 260); - ++e.a; - g.d = d.d; - g.e = d.e; - g.b = d; - g.c = d; - !d.e ? e.b = g : d.e.c = g; - !d.d ? a.a = g : d.d.b = g; - d.d = g; - d.e = g; - } - ++a.d; - return g; - } - function lJb(a, b) { - var c2, d, e, f2, g; - b.Ug("Network simplex", 1); - if (a.e.a.c.length < 1) { - b.Vg(); - return; - } - for (f2 = new Anb(a.e.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 125); - e.e = 0; - } - g = a.e.a.c.length >= 40; - g && wJb(a); - nJb(a); - mJb(a); - c2 = qJb(a); - d = 0; - while (!!c2 && d < a.f) { - kJb(a, c2, jJb(a, c2)); - c2 = qJb(a); - ++d; - } - g && vJb(a); - a.a ? hJb(a, tJb(a)) : tJb(a); - a.b = null; - a.d = null; - a.p = null; - a.c = null; - a.g = null; - a.i = null; - a.n = null; - a.o = null; - b.Vg(); - } - function T7b(a, b) { - var c2, d, e, f2, g, h, i2; - if (b.e) { - return; - } - b.e = true; - for (d = b.d.a.ec().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 18); - if (b.o && b.d.a.gc() <= 1) { - g = b.a.c; - h = b.a.c + b.a.b; - i2 = new rjd(g + (h - g) / 2, b.b); - Mub(RD(b.d.a.ec().Kc().Pb(), 18).a, i2); - continue; - } - e = RD(Wjb(b.c, c2), 468); - if (e.b || e.c) { - V7b(a, c2, b); - continue; - } - f2 = a.d == (lFc(), kFc) && (e.d || e.e) && _7b(a, b) && b.d.a.gc() <= 1; - f2 ? W7b(c2, b) : U7b(a, c2, b); - } - b.k && xgb(b.d, new m8b()); - } - function A5c(a, b, c2, d, e, f2) { - var g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - m = f2; - h = (d + e) / 2 + m; - q = c2 * $wnd.Math.cos(h); - r = c2 * $wnd.Math.sin(h); - s = q - b.g / 2; - t = r - b.f / 2; - Dyd(b, s); - Eyd(b, t); - l = a.a.Eg(b); - p = 2 * $wnd.Math.acos(c2 / c2 + a.c); - if (p < e - d) { - n = p / l; - g = (d + e - p) / 2; - } else { - n = (e - d) / l; - g = d; - } - o2 = Q2c(b); - if (a.e) { - a.e.Fg(a.d); - a.e.Gg(o2); - } - for (j = new Anb(o2); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 27); - k = a.a.Eg(i2); - A5c(a, i2, c2 + a.c, g, g + n * k, f2); - g += n * k; - } - } - function zA(a, b, c2) { - var d; - d = c2.q.getMonth(); - switch (b) { - case 5: - Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"])[d]); - break; - case 4: - Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, [Cwe, Dwe, Ewe, Fwe, Gwe, Hwe, Iwe, Jwe, Kwe, Lwe, Mwe, Nwe])[d]); - break; - case 3: - Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["Jan", "Feb", "Mar", "Apr", Gwe, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[d]); - break; - default: - UA(a, d + 1, b); - } - } - function ATb(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m; - i2 = new rjd(c2, d); - ojd(i2, RD(mQb(b, (JVb(), GVb)), 8)); - for (m = new Anb(b.e); m.a < m.c.c.length; ) { - l = RD(ynb(m), 153); - $id(l.d, i2); - Rmb(a.e, l); - } - for (h = new Anb(b.c); h.a < h.c.c.length; ) { - g = RD(ynb(h), 290); - for (f2 = new Anb(g.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 250); - $id(e.d, i2); - } - Rmb(a.c, g); - } - for (k = new Anb(b.d); k.a < k.c.c.length; ) { - j = RD(ynb(k), 454); - $id(j.d, i2); - Rmb(a.d, j); - } - } - function TFc(a, b) { - var c2, d, e, f2, g, h, i2, j; - for (i2 = new Anb(b.j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 12); - for (e = new l4b(h.b); xnb(e.a) || xnb(e.b); ) { - d = RD(xnb(e.a) ? ynb(e.a) : ynb(e.b), 18); - c2 = d.c == h ? d.d : d.c; - f2 = c2.i; - if (b == f2) { - continue; - } - j = RD(mQb(d, (yCc(), KBc)), 17).a; - j < 0 && (j = 0); - g = f2.p; - if (a.b[g] == 0) { - if (d.d == c2) { - a.a[g] -= j + 1; - a.a[g] <= 0 && a.c[g] > 0 && Mub(a.f, f2); - } else { - a.c[g] -= j + 1; - a.c[g] <= 0 && a.a[g] > 0 && Mub(a.e, f2); - } - } - } - } - } - function FVc(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - i2 = new rjd(c2, d); - ojd(i2, RD(mQb(b, (q$c(), SZc)), 8)); - for (k = Sub(b.b, 0); k.b != k.d.c; ) { - j = RD(evb(k), 40); - $id(j.e, i2); - Mub(a.b, j); - } - for (h = RD(zDb(BDb(new SDb(null, new Swb(b.a, 16))), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 65); - for (f2 = Sub(g.a, 0); f2.b != f2.d.c; ) { - e = RD(evb(f2), 8); - e.a += i2.a; - e.b += i2.b; - } - Mub(a.a, g); - } - } - function kWc(a, b) { - var c2, d, e, f2; - if (0 < (ZD(a, 16) ? RD(a, 16).gc() : Kr(a.Kc()))) { - e = b; - if (1 < e) { - --e; - f2 = new uWc(); - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 40); - f2 = Al(cD(WC(cJ, 1), rve, 20, 0, [f2, new dXc(c2)])); - } - return kWc(f2, e); - } - if (e < 0) { - f2 = new xWc(); - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 40); - f2 = Al(cD(WC(cJ, 1), rve, 20, 0, [f2, new dXc(c2)])); - } - if (0 < (ZD(f2, 16) ? RD(f2, 16).gc() : Kr(f2.Kc()))) { - return kWc(f2, e); - } - } - } - return RD(Hr(a.Kc()), 40); - } - function v0c(a, b, c2) { - var d, e, f2, g; - c2.Ug("Processor order nodes", 2); - a.b = Kfb(UD(mQb(b, (h_c(), _$c)))); - a.a = RD(mQb(b, H$c), 88); - if (a.a == (Cmd(), Amd)) { - a.a = xmd; - pQb(b, H$c, a.a); - } - e = new Yub(); - for (g = Sub(b.b, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 40); - Heb(TD(mQb(f2, (q$c(), n$c)))) && (Pub(e, f2, e.c.b, e.c), true); - } - d = (sFb(e.b != 0), RD(e.a.a.c, 40)); - t0c(a, d); - c2.fh(1); - w0c(a, d, 0 - Kfb(UD(mQb(d, (q$c(), d$c)))) / 2, 0); - c2.fh(1); - c2.Vg(); - } - function dqd() { - dqd = geb; - Ypd = new eqd("DEFAULT_MINIMUM_SIZE", 0); - $pd = new eqd("MINIMUM_SIZE_ACCOUNTS_FOR_PADDING", 1); - Xpd = new eqd("COMPUTE_PADDING", 2); - _pd = new eqd("OUTSIDE_NODE_LABELS_OVERHANG", 3); - aqd = new eqd("PORTS_OVERHANG", 4); - cqd = new eqd("UNIFORM_PORT_SPACING", 5); - bqd = new eqd("SPACE_EFFICIENT_PORT_LABELS", 6); - Zpd = new eqd("FORCE_TABULAR_NODE_LABELS", 7); - Wpd = new eqd("ASYMMETRICAL", 8); - } - function Rje(a, b) { - var c2, d, e, f2, g, h, i2, j; - if (!b) { - return null; - } else { - c2 = (f2 = b.Dh(), !f2 ? null : BXd(f2).wi().si(f2)); - if (c2) { - dub(a, b, c2); - e = b.Dh(); - for (i2 = 0, j = (e.i == null && rYd(e), e.i).length; i2 < j; ++i2) { - h = (d = (e.i == null && rYd(e), e.i), i2 >= 0 && i2 < d.length ? d[i2] : null); - if (h.rk() && !h.sk()) { - if (ZD(h, 331)) { - Tje(a, RD(h, 35), b, c2); - } else { - g = RD(h, 19); - (g.Bb & QHe) != 0 && Vje(a, g, b, c2); - } - } - } - b.Vh() && RD(c2, 54).ei(RD(b, 54)._h()); - } - return c2; - } - } - function kJb(a, b, c2) { - var d, e, f2; - if (!b.f) { - throw Adb(new agb("Given leave edge is no tree edge.")); - } - if (c2.f) { - throw Adb(new agb("Given enter edge is a tree edge already.")); - } - b.f = false; - $sb(a.p, b); - c2.f = true; - Ysb(a.p, c2); - d = c2.e.e - c2.d.e - c2.a; - oJb(a, c2.e, b) || (d = -d); - for (f2 = new Anb(a.e.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 125); - oJb(a, e, b) || (e.e += d); - } - a.j = 1; - Nnb(a.c); - uJb(a, RD(ynb(new Anb(a.e.a)), 125)); - iJb(a); - } - function wIc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n; - BIc(a, b, c2); - f2 = b[c2]; - n = d ? (qpd(), ppd) : (qpd(), Xod); - if (xIc(b.length, c2, d)) { - e = b[d ? c2 - 1 : c2 + 1]; - sIc(a, e, d ? (BEc(), zEc) : (BEc(), yEc)); - for (i2 = f2, k = 0, m = i2.length; k < m; ++k) { - g = i2[k]; - vIc(a, g, n); - } - sIc(a, f2, d ? (BEc(), yEc) : (BEc(), zEc)); - for (h = e, j = 0, l = h.length; j < l; ++j) { - g = h[j]; - !!g.e || vIc(a, g, spd(n)); - } - } else { - for (h = f2, j = 0, l = h.length; j < l; ++j) { - g = h[j]; - vIc(a, g, n); - } - } - return false; - } - function erd(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l; - yob(); - _mb(a, new Urd()); - h = new Jkb(a, 0); - l = new bnb(); - f2 = 0; - while (h.b < h.d.gc()) { - g = (sFb(h.b < h.d.gc()), RD(h.d.Xb(h.c = h.b++), 163)); - if (l.c.length != 0 && urd(g) * trd(g) > f2 * 2) { - k = new zrd(l); - j = urd(g) / trd(g); - i2 = ird(k, b, new z3b(), c2, d, e, j); - $id(hjd(k.e), i2); - l.c.length = 0; - f2 = 0; - ZEb(l.c, k); - ZEb(l.c, g); - f2 = urd(k) * trd(k) + urd(g) * trd(g); - } else { - ZEb(l.c, g); - f2 += urd(g) * trd(g); - } - } - return l; - } - function O9b(a, b) { - var c2, d, e, f2, g, h; - h = RD(mQb(b, (yCc(), BBc)), 101); - if (!(h == (Bod(), xod) || h == wod)) { - return; - } - e = new rjd(b.f.a + b.d.b + b.d.c, b.f.b + b.d.d + b.d.a).b; - for (g = new Anb(a.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - if (f2.k != (r3b(), m3b)) { - continue; - } - c2 = RD(mQb(f2, (Ywc(), hwc)), 64); - if (c2 != (qpd(), Xod) && c2 != ppd) { - continue; - } - d = Kfb(UD(mQb(f2, Jwc))); - h == xod && (d *= e); - f2.n.b = d - RD(mQb(f2, zBc), 8).b; - U2b(f2, false, true); - } - } - function uge(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2; - if (Mvd(a.e)) { - if (b != c2) { - e = RD(a.g, 124); - n = e[c2]; - g = n.Lk(); - if (qke(a.e, g)) { - o2 = pke(a.e.Dh(), g); - i2 = -1; - h = -1; - d = 0; - for (j = 0, l = b > c2 ? b : c2; j <= l; ++j) { - if (j == c2) { - h = d++; - } else { - f2 = e[j]; - k = o2.am(f2.Lk()); - j == b && (i2 = j == l && !k ? d - 1 : d); - k && ++d; - } - } - m = RD(uLd(a, b, c2), 76); - h != i2 && eZd(a, new c4d(a.e, 7, g, sgb(h), n.md(), i2)); - return m; - } - } - } else { - return RD(SHd(a, b, c2), 76); - } - return RD(uLd(a, b, c2), 76); - } - function ugc(a, b) { - var c2, d, e, f2, g, h, i2; - b.Ug("Port order processing", 1); - i2 = RD(mQb(a, (yCc(), HBc)), 430); - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - g = RD(mQb(e, BBc), 101); - h = e.j; - if (g == (Bod(), vod) || g == xod || g == wod) { - yob(); - _mb(h, mgc); - } else if (g != zod && g != Aod) { - yob(); - _mb(h, pgc); - wgc(h); - i2 == (sEc(), rEc) && _mb(h, ogc); - } - e.i = true; - V2b(e); - } - } - b.Vg(); - } - function VHc(a) { - var b, c2, d, e, f2, g, h, i2; - i2 = new Tsb(); - b = new BIb(); - for (g = a.Kc(); g.Ob(); ) { - e = RD(g.Pb(), 10); - h = eJb(fJb(new gJb(), e), b); - rtb(i2.f, e, h); - } - for (f2 = a.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 10); - for (d = new is(Mr(a3b(e).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - if (W0b(c2)) { - continue; - } - rIb(uIb(tIb(sIb(vIb(new wIb(), $wnd.Math.max(1, RD(mQb(c2, (yCc(), LBc)), 17).a)), 1), RD(Wjb(i2, c2.c.i), 125)), RD(Wjb(i2, c2.d.i), 125))); - } - } - return b; - } - function TRc() { - TRc = geb; - ORc = pfd(new ufd(), (sXb(), qXb), (hcc(), Bbc)); - QRc = pfd(new ufd(), pXb, Fbc); - RRc = nfd(pfd(new ufd(), pXb, Tbc), rXb, Sbc); - NRc = nfd(pfd(pfd(new ufd(), pXb, vbc), qXb, wbc), rXb, xbc); - SRc = mfd(mfd(rfd(nfd(pfd(new ufd(), nXb, bcc), rXb, acc), qXb), _bc), ccc); - PRc = nfd(new ufd(), rXb, Cbc); - LRc = nfd(pfd(pfd(pfd(new ufd(), oXb, Ibc), qXb, Kbc), qXb, Lbc), rXb, Jbc); - MRc = nfd(pfd(pfd(new ufd(), qXb, Lbc), qXb, qbc), rXb, pbc); - } - function lD(a, b, c2, d, e, f2) { - var g, h, i2, j, k, l, m; - j = oD(b) - oD(a); - g = AD(b, j); - i2 = hD(0, 0, 0); - while (j >= 0) { - h = rD(a, g); - if (h) { - j < 22 ? (i2.l |= 1 << j, void 0) : j < 44 ? (i2.m |= 1 << j - 22, void 0) : (i2.h |= 1 << j - 44, void 0); - if (a.l == 0 && a.m == 0 && a.h == 0) { - break; - } - } - k = g.m; - l = g.h; - m = g.l; - g.h = l >>> 1; - g.m = k >>> 1 | (l & 1) << 21; - g.l = m >>> 1 | (k & 1) << 21; - --j; - } - c2 && nD(i2); - if (f2) { - if (d) { - eD = xD(a); - e && (eD = DD(eD, (MD(), KD))); - } else { - eD = hD(a.l, a.m, a.h); - } - } - return i2; - } - function rIc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - j = a.e[b.c.p][b.p] + 1; - i2 = b.c.a.c.length + 1; - for (h = new Anb(a.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - l = 0; - f2 = 0; - for (e = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [new T3b(g), new _3b(g)]))); gs(e); ) { - d = RD(hs(e), 12); - if (d.i.c == b.c) { - l += AIc(a, d.i) + 1; - ++f2; - } - } - c2 = l / f2; - k = g.j; - k == (qpd(), Xod) ? c2 < j ? a.f[g.p] = a.c - c2 : a.f[g.p] = a.b + (i2 - c2) : k == ppd && (c2 < j ? a.f[g.p] = a.b + c2 : a.f[g.p] = a.c - (i2 - c2)); - } - } - function Oeb(a, b, c2) { - var d, e, f2, g, h; - if (a == null) { - throw Adb(new Vgb(vve)); - } - f2 = a.length; - g = f2 > 0 && (BFb(0, a.length), a.charCodeAt(0) == 45 || (BFb(0, a.length), a.charCodeAt(0) == 43)) ? 1 : 0; - for (d = g; d < f2; d++) { - if (dfb((BFb(d, a.length), a.charCodeAt(d))) == -1) { - throw Adb(new Vgb(nxe + a + '"')); - } - } - h = parseInt(a, 10); - e = h < b; - if (isNaN(h)) { - throw Adb(new Vgb(nxe + a + '"')); - } else if (e || h > c2) { - throw Adb(new Vgb(nxe + a + '"')); - } - return h; - } - function Jqc(a) { - var b, c2, d, e, f2, g, h; - g = new Yub(); - for (f2 = new Anb(a.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 118); - PSc(e, e.f.c.length); - QSc(e, e.k.c.length); - if (e.i == 0) { - e.o = 0; - Pub(g, e, g.c.b, g.c); - } - } - while (g.b != 0) { - e = RD(g.b == 0 ? null : (sFb(g.b != 0), Wub(g, g.a.a)), 118); - d = e.o + 1; - for (c2 = new Anb(e.f); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 132); - h = b.a; - RSc(h, $wnd.Math.max(h.o, d)); - QSc(h, h.i - 1); - h.i == 0 && (Pub(g, h, g.c.b, g.c), true); - } - } - } - function Ged(a) { - var b, c2, d, e, f2, g, h, i2; - for (g = new Anb(a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 74); - d = AGd(RD(QHd((!f2.b && (f2.b = new Yie(E4, f2, 4, 7)), f2.b), 0), 84)); - h = d.i; - i2 = d.j; - e = RD(QHd((!f2.a && (f2.a = new C5d(F4, f2, 6, 6)), f2.a), 0), 166); - Nzd(e, e.j + h, e.k + i2); - Gzd(e, e.b + h, e.c + i2); - for (c2 = new dMd((!e.a && (e.a = new XZd(D4, e, 5)), e.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 377); - Uxd(b, b.a + h, b.b + i2); - } - Bjd(RD(Gxd(f2, (umd(), cld)), 75), h, i2); - } - } - function Ere(a) { - var b; - switch (a) { - case 100: - return Jre(OLe, true); - case 68: - return Jre(OLe, false); - case 119: - return Jre(PLe, true); - case 87: - return Jre(PLe, false); - case 115: - return Jre(QLe, true); - case 83: - return Jre(QLe, false); - case 99: - return Jre(RLe, true); - case 67: - return Jre(RLe, false); - case 105: - return Jre(SLe, true); - case 73: - return Jre(SLe, false); - default: - throw Adb(new yz((b = a, NLe + b.toString(16)))); - } - } - function b_b(a) { - var b, c2, d, e, f2; - e = RD(Vmb(a.a, 0), 10); - b = new j3b(a); - Rmb(a.a, b); - b.o.a = $wnd.Math.max(1, e.o.a); - b.o.b = $wnd.Math.max(1, e.o.b); - b.n.a = e.n.a; - b.n.b = e.n.b; - switch (RD(mQb(e, (Ywc(), hwc)), 64).g) { - case 4: - b.n.a += 2; - break; - case 1: - b.n.b += 2; - break; - case 2: - b.n.a -= 2; - break; - case 3: - b.n.b -= 2; - } - d = new R3b(); - P3b(d, b); - c2 = new a1b(); - f2 = RD(Vmb(e.j, 0), 12); - Y0b(c2, f2); - Z0b(c2, d); - $id(hjd(d.n), f2.n); - $id(hjd(d.a), f2.a); - return b; - } - function Wdc(a, b, c2, d, e) { - if (c2 && (!d || (a.c - a.b & a.a.length - 1) > 1) && b == 1 && RD(a.a[a.b], 10).k == (r3b(), n3b)) { - Qdc(RD(a.a[a.b], 10), (Pnd(), Lnd)); - } else if (d && (!c2 || (a.c - a.b & a.a.length - 1) > 1) && b == 1 && RD(a.a[a.c - 1 & a.a.length - 1], 10).k == (r3b(), n3b)) { - Qdc(RD(a.a[a.c - 1 & a.a.length - 1], 10), (Pnd(), Mnd)); - } else if ((a.c - a.b & a.a.length - 1) == 2) { - Qdc(RD(omb(a), 10), (Pnd(), Lnd)); - Qdc(RD(omb(a), 10), Mnd); - } else { - Ndc(a, e); - } - jmb(a); - } - function QVc(a, b, c2) { - var d, e, f2, g, h; - f2 = 0; - for (e = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - g = ""; - (!d.n && (d.n = new C5d(I4, d, 1, 7)), d.n).i == 0 || (g = RD(QHd((!d.n && (d.n = new C5d(I4, d, 1, 7)), d.n), 0), 135).a); - h = new bXc(f2++, b, g); - kQb(h, d); - pQb(h, (q$c(), h$c), d); - h.e.b = d.j + d.f / 2; - h.f.a = $wnd.Math.max(d.g, 1); - h.e.a = d.i + d.g / 2; - h.f.b = $wnd.Math.max(d.f, 1); - Mub(b.b, h); - rtb(c2.f, d, h); - } - } - function L5b(a) { - var b, c2, d, e, f2; - d = RD(mQb(a, (Ywc(), Awc)), 27); - f2 = RD(Gxd(d, (yCc(), lBc)), 181).Hc((Qpd(), Ppd)); - if (!a.e) { - e = RD(mQb(a, kwc), 21); - b = new rjd(a.f.a + a.d.b + a.d.c, a.f.b + a.d.d + a.d.a); - if (e.Hc((ovc(), hvc))) { - Ixd(d, BBc, (Bod(), wod)); - Esd(d, b.a, b.b, false, true); - } else { - Heb(TD(Gxd(d, mBc))) || Esd(d, b.a, b.b, true, true); - } - } - f2 ? Ixd(d, lBc, xsb(Ppd)) : Ixd(d, lBc, (c2 = RD(mfb(H3), 9), new Fsb(c2, RD(WEb(c2, c2.length), 9), 0))); - } - function JA(a, b, c2) { - var d, e, f2, g; - if (b[0] >= a.length) { - c2.o = 0; - return true; - } - switch (ihb(a, b[0])) { - case 43: - e = 1; - break; - case 45: - e = -1; - break; - default: - c2.o = 0; - return true; - } - ++b[0]; - f2 = b[0]; - g = HA(a, b); - if (g == 0 && b[0] == f2) { - return false; - } - if (b[0] < a.length && ihb(a, b[0]) == 58) { - d = g * 60; - ++b[0]; - f2 = b[0]; - g = HA(a, b); - if (g == 0 && b[0] == f2) { - return false; - } - d += g; - } else { - d = g; - d < 24 && b[0] - f2 <= 2 ? d *= 60 : d = d % 100 + (d / 100 | 0) * 60; - } - d *= e; - c2.o = -d; - return true; - } - function lnc(a) { - var b, c2, d, e, f2, g, h, i2, j; - g = new bnb(); - for (d = new is(Mr(a3b(a.b).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - W0b(c2) && Rmb(g, new knc(c2, nnc(a, c2.c), nnc(a, c2.d))); - } - for (j = (f2 = new glb(a.e).a.vc().Kc(), new llb(f2)); j.a.Ob(); ) { - h = (b = RD(j.a.Pb(), 44), RD(b.md(), 113)); - h.d.p = 0; - } - for (i2 = (e = new glb(a.e).a.vc().Kc(), new llb(e)); i2.a.Ob(); ) { - h = (b = RD(i2.a.Pb(), 44), RD(b.md(), 113)); - h.d.p == 0 && Rmb(a.d, mnc(a, h)); - } - } - function e5b(a) { - var b, c2, d, e, f2, g, h; - f2 = MCd(a); - for (e = new dMd((!a.e && (a.e = new Yie(G4, a, 7, 4)), a.e)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 74); - h = AGd(RD(QHd((!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c), 0), 84)); - if (!NGd(h, f2)) { - return true; - } - } - for (c2 = new dMd((!a.d && (a.d = new Yie(G4, a, 8, 5)), a.d)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 74); - g = AGd(RD(QHd((!b.b && (b.b = new Yie(E4, b, 4, 7)), b.b), 0), 84)); - if (!NGd(g, f2)) { - return true; - } - } - return false; - } - function jRc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - for (g = new Anb(b.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - for (j = new Anb(f2.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - k = new bnb(); - h = 0; - for (d = new is(Mr(Z2b(i2).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - if (W0b(c2) || !W0b(c2) && c2.c.i.c == c2.d.i.c) { - continue; - } - e = RD(mQb(c2, (yCc(), MBc)), 17).a; - if (e > h) { - h = e; - k.c.length = 0; - } - e == h && Rmb(k, new Ptd(c2.c.i, c2)); - } - yob(); - _mb(k, a.c); - Qmb(a.b, i2.p, k); - } - } - } - function kRc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - for (g = new Anb(b.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - for (j = new Anb(f2.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - k = new bnb(); - h = 0; - for (d = new is(Mr(a3b(i2).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - if (W0b(c2) || !W0b(c2) && c2.c.i.c == c2.d.i.c) { - continue; - } - e = RD(mQb(c2, (yCc(), MBc)), 17).a; - if (e > h) { - h = e; - k.c.length = 0; - } - e == h && Rmb(k, new Ptd(c2.d.i, c2)); - } - yob(); - _mb(k, a.c); - Qmb(a.f, i2.p, k); - } - } - } - function HVc(a, b) { - var c2, d, e, f2, g, h, i2, j; - j = TD(mQb(b, (h_c(), Z$c))); - if (j == null || (uFb(j), j)) { - EVc(a, b); - e = new bnb(); - for (i2 = Sub(b.b, 0); i2.b != i2.d.c; ) { - g = RD(evb(i2), 40); - c2 = DVc(a, g, null); - if (c2) { - kQb(c2, b); - ZEb(e.c, c2); - } - } - a.a = null; - a.b = null; - if (e.c.length > 1) { - for (d = new Anb(e); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 121); - f2 = 0; - for (h = Sub(c2.b, 0); h.b != h.d.c; ) { - g = RD(evb(h), 40); - g.g = f2++; - } - } - } - return e; - } - return dv(cD(WC(W$, 1), Jze, 121, 0, [b])); - } - function hqc(a) { - var b, c2, d, e, f2, g, h, i2; - i2 = new Ejd(); - b = Sub(a, 0); - h = null; - c2 = RD(evb(b), 8); - e = RD(evb(b), 8); - while (b.b != b.d.c) { - h = c2; - c2 = e; - e = RD(evb(b), 8); - f2 = iqc(ojd(new rjd(h.a, h.b), c2)); - g = iqc(ojd(new rjd(e.a, e.b), c2)); - d = 10; - d = $wnd.Math.min(d, $wnd.Math.abs(f2.a + f2.b) / 2); - d = $wnd.Math.min(d, $wnd.Math.abs(g.a + g.b) / 2); - f2.a = Lgb(f2.a) * d; - f2.b = Lgb(f2.b) * d; - g.a = Lgb(g.a) * d; - g.b = Lgb(g.b) * d; - Mub(i2, $id(f2, c2)); - Mub(i2, $id(g, c2)); - } - return i2; - } - function wKc(a, b, c2) { - var d, e, f2, g, h, i2; - c2.Ug("Minimize Crossings " + a.a, 1); - d = b.b.c.length == 0 || !QDb(CDb(new SDb(null, new Swb(b.b, 16)), new PAb(new XKc()))).Bd((xDb(), wDb)); - i2 = b.b.c.length == 1 && RD(Vmb(b.b, 0), 30).a.c.length == 1; - f2 = dE(mQb(b, (yCc(), IAc))) === dE((Fnd(), Cnd)); - if (d || i2 && !f2) { - c2.Vg(); - return; - } - e = rKc(a, b); - g = (h = RD(ju(e, 0), 219), h.c.kg() ? h.c.eg() ? new KKc(a) : new MKc(a) : new IKc(a)); - sKc(e, g); - EKc(a); - c2.Vg(); - } - function xvd(a, b, c2, d) { - var e, f2, g, h, i2; - g = a.Ph(); - i2 = a.Jh(); - e = null; - if (i2) { - if (!!b && (jwd(a, b, c2).Bb & txe) == 0) { - d = rLd(i2.El(), a, d); - a.di(null); - e = b.Qh(); - } else { - i2 = null; - } - } else { - !!g && (i2 = g.Qh()); - !!b && (e = b.Qh()); - } - i2 != e && !!i2 && i2.Il(a); - h = a.Fh(); - a.Bh(b, c2); - i2 != e && !!e && e.Hl(a); - if (a.vh() && a.wh()) { - if (!!g && h >= 0 && h != c2) { - f2 = new N3d(a, 1, h, g, null); - !d ? d = f2 : d.nj(f2); - } - if (c2 >= 0) { - f2 = new N3d(a, 1, c2, h == c2 ? g : null, b); - !d ? d = f2 : d.nj(f2); - } - } - return d; - } - function jSd(a) { - var b, c2, d; - if (a.b == null) { - d = new Qhb(); - if (a.i != null) { - Nhb(d, a.i); - d.a += ":"; - } - if ((a.f & 256) != 0) { - if ((a.f & 256) != 0 && a.a != null) { - wSd(a.i) || (d.a += "//", d); - Nhb(d, a.a); - } - if (a.d != null) { - d.a += "/"; - Nhb(d, a.d); - } - (a.f & 16) != 0 && (d.a += "/", d); - for (b = 0, c2 = a.j.length; b < c2; b++) { - b != 0 && (d.a += "/", d); - Nhb(d, a.j[b]); - } - if (a.g != null) { - d.a += "?"; - Nhb(d, a.g); - } - } else { - Nhb(d, a.a); - } - if (a.e != null) { - d.a += "#"; - Nhb(d, a.e); - } - a.b = d.a; - } - return a.b; - } - function V8b(a, b) { - var c2, d, e, f2, g, h; - for (e = new Anb(b.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - f2 = mQb(d, (Ywc(), Awc)); - if (ZD(f2, 12)) { - g = RD(f2, 12); - h = j2b(b, d, g.o.a, g.o.b); - g.n.a = h.a; - g.n.b = h.b; - Q3b(g, RD(mQb(d, hwc), 64)); - } - } - c2 = new rjd(b.f.a + b.d.b + b.d.c, b.f.b + b.d.d + b.d.a); - if (RD(mQb(b, (Ywc(), kwc)), 21).Hc((ovc(), hvc))) { - pQb(a, (yCc(), BBc), (Bod(), wod)); - RD(mQb(Y2b(a), kwc), 21).Fc(kvc); - r2b(a, c2, false); - } else { - r2b(a, c2, true); - } - } - function Ffc(a, b, c2, d, e) { - var f2, g, h, i2; - f2 = new j3b(a); - h3b(f2, (r3b(), q3b)); - pQb(f2, (yCc(), BBc), (Bod(), wod)); - pQb(f2, (Ywc(), Awc), b.c.i); - g = new R3b(); - pQb(g, Awc, b.c); - Q3b(g, e); - P3b(g, f2); - pQb(b.c, Iwc, f2); - h = new j3b(a); - h3b(h, q3b); - pQb(h, BBc, wod); - pQb(h, Awc, b.d.i); - i2 = new R3b(); - pQb(i2, Awc, b.d); - Q3b(i2, e); - P3b(i2, h); - pQb(b.d, Iwc, h); - Y0b(b, g); - Z0b(b, i2); - wFb(0, c2.c.length); - XEb(c2.c, 0, f2); - ZEb(d.c, h); - pQb(f2, $vc, sgb(1)); - pQb(h, $vc, sgb(1)); - } - function Eo(a, b, c2, d) { - var e, f2, g, h, i2; - i2 = Ydb(Ndb(cwe, qgb(Ydb(Ndb(b == null ? 0 : tb(b), dwe)), 15))); - e = Ydb(Ndb(cwe, qgb(Ydb(Ndb(c2 == null ? 0 : tb(c2), dwe)), 15))); - h = Ho(a, b, i2); - g = Go(a, c2, e); - if (!!h && e == h.a && Hb(c2, h.g)) { - return c2; - } else if (!!g && !d) { - throw Adb(new agb("key already present: " + c2)); - } - !!h && yo(a, h); - !!g && yo(a, g); - f2 = new kp(c2, e, b, i2); - Bo(a, f2, g); - if (g) { - g.e = null; - g.c = null; - } - if (h) { - h.e = null; - h.c = null; - } - Fo(a); - return !h ? null : h.g; - } - function Tjb(a, b, c2) { - var d, e, f2, g, h; - for (f2 = 0; f2 < b; f2++) { - d = 0; - for (h = f2 + 1; h < b; h++) { - d = Bdb(Bdb(Ndb(Cdb(a[f2], yxe), Cdb(a[h], yxe)), Cdb(c2[f2 + h], yxe)), Cdb(Ydb(d), yxe)); - c2[f2 + h] = Ydb(d); - d = Udb(d, 32); - } - c2[f2 + b] = Ydb(d); - } - sjb(c2, c2, b << 1); - d = 0; - for (e = 0, g = 0; e < b; ++e, g++) { - d = Bdb(Bdb(Ndb(Cdb(a[e], yxe), Cdb(a[e], yxe)), Cdb(c2[g], yxe)), Cdb(Ydb(d), yxe)); - c2[g] = Ydb(d); - d = Udb(d, 32); - ++g; - d = Bdb(d, Cdb(c2[g], yxe)); - c2[g] = Ydb(d); - d = Udb(d, 32); - } - return c2; - } - function xOc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - if (gr(b)) { - return; - } - i2 = Kfb(UD(hFc(c2.c, (yCc(), fCc)))); - j = RD(hFc(c2.c, eCc), 140); - !j && (j = new P2b()); - d = c2.a; - e = null; - for (h = b.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 12); - k = 0; - if (!e) { - k = j.d; - } else { - k = i2; - k += e.o.b; - } - f2 = eJb(fJb(new gJb(), g), a.f); - Zjb(a.k, g, f2); - rIb(uIb(tIb(sIb(vIb(new wIb(), 0), eE($wnd.Math.ceil(k))), d), f2)); - e = g; - d = f2; - } - rIb(uIb(tIb(sIb(vIb(new wIb(), 0), eE($wnd.Math.ceil(j.a + e.o.b))), d), c2.d)); - } - function K8c(a, b, c2, d, e, f2, g, h) { - var i2, j, k, l, m, n; - n = false; - m = f2 - c2.s; - k = c2.t - b.f + (j = S9c(c2, m, false), j.a); - if (d.g + h > m) { - return false; - } - l = (i2 = S9c(d, m, false), i2.a); - if (k + h + l <= b.b) { - Q9c(c2, f2 - c2.s); - c2.c = true; - Q9c(d, f2 - c2.s); - U9c(d, c2.s, c2.t + c2.d + h); - d.k = true; - aad(c2.q, d); - n = true; - if (e) { - Cad(b, d); - d.j = b; - if (a.c.length > g) { - Fad((tFb(g, a.c.length), RD(a.c[g], 186)), d); - (tFb(g, a.c.length), RD(a.c[g], 186)).a.c.length == 0 && Xmb(a, g); - } - } - } - return n; - } - function Qfc(a, b) { - var c2, d, e, f2, g, h; - b.Ug("Partition midprocessing", 1); - e = new Tp(); - FDb(CDb(new SDb(null, new Swb(a.a, 16)), new Ufc()), new Wfc(e)); - if (e.d == 0) { - return; - } - h = RD(zDb(ODb((f2 = e.i, new SDb(null, (!f2 ? e.i = new zf(e, e.c) : f2).Nc()))), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - d = h.Kc(); - c2 = RD(d.Pb(), 17); - while (d.Ob()) { - g = RD(d.Pb(), 17); - Pfc(RD(Qc(e, c2), 21), RD(Qc(e, g), 21)); - c2 = g; - } - b.Vg(); - } - function G_b(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - if (b.p == 0) { - b.p = 1; - g = c2; - if (!g) { - e = new bnb(); - f2 = (d = RD(mfb(E3), 9), new Fsb(d, RD(WEb(d, d.length), 9), 0)); - g = new Ptd(e, f2); - } - RD(g.a, 15).Fc(b); - b.k == (r3b(), m3b) && RD(g.b, 21).Fc(RD(mQb(b, (Ywc(), hwc)), 64)); - for (i2 = new Anb(b.j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 12); - for (k = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [new T3b(h), new _3b(h)]))); gs(k); ) { - j = RD(hs(k), 12); - G_b(a, j.i, g); - } - } - return g; - } - return null; - } - function bAd(a, b) { - var c2, d, e, f2, g; - if (a.Ab) { - if (a.Ab) { - g = a.Ab.i; - if (g > 0) { - e = RD(a.Ab.g, 2033); - if (b == null) { - for (f2 = 0; f2 < g; ++f2) { - c2 = e[f2]; - if (c2.d == null) { - return c2; - } - } - } else { - for (f2 = 0; f2 < g; ++f2) { - c2 = e[f2]; - if (lhb(b, c2.d)) { - return c2; - } - } - } - } - } else { - if (b == null) { - for (d = new dMd(a.Ab); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 598); - if (c2.d == null) { - return c2; - } - } - } else { - for (d = new dMd(a.Ab); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 598); - if (lhb(b, c2.d)) { - return c2; - } - } - } - } - } - return null; - } - function RDd(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, p, q, r, s, t, u, v; - n = qEd(a, EGd(b), e); - Jzd(n, zDd(e, uIe)); - o = null; - p = e; - q = yDd(p, xIe); - r = new UEd(n); - WDd(r.a, q); - s = yDd(p, "endPoint"); - t = new YEd(n); - YDd(t.a, s); - u = wDd(p, nIe); - v = new _Ed(n); - ZDd(v.a, u); - l = zDd(e, pIe); - f2 = new QEd(a, n); - SDd(f2.a, f2.b, l); - m = zDd(e, oIe); - g = new REd(a, n); - TDd(g.a, g.b, m); - j = wDd(e, rIe); - h = new SEd(c2, n); - UDd(h.b, h.a, j); - k = wDd(e, qIe); - i2 = new TEd(d, n); - VDd(i2.b, i2.a, k); - } - function q2b(a, b, c2) { - var d, e, f2, g, h; - h = null; - switch (b.g) { - case 1: - for (e = new Anb(a.j); e.a < e.c.c.length; ) { - d = RD(ynb(e), 12); - if (Heb(TD(mQb(d, (Ywc(), mwc))))) { - return d; - } - } - h = new R3b(); - pQb(h, (Ywc(), mwc), (Geb(), true)); - break; - case 2: - for (g = new Anb(a.j); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 12); - if (Heb(TD(mQb(f2, (Ywc(), Gwc))))) { - return f2; - } - } - h = new R3b(); - pQb(h, (Ywc(), Gwc), (Geb(), true)); - } - if (h) { - P3b(h, a); - Q3b(h, c2); - d2b(h.n, a.o, c2); - } - return h; - } - function d7b(a, b) { - var c2, d, e, f2, g, h; - h = -1; - g = new Yub(); - for (d = new l4b(a.b); xnb(d.a) || xnb(d.b); ) { - c2 = RD(xnb(d.a) ? ynb(d.a) : ynb(d.b), 18); - h = $wnd.Math.max(h, Kfb(UD(mQb(c2, (yCc(), FAc))))); - c2.c == a ? FDb(CDb(new SDb(null, new Swb(c2.b, 16)), new j7b()), new l7b(g)) : FDb(CDb(new SDb(null, new Swb(c2.b, 16)), new n7b()), new p7b(g)); - for (f2 = Sub(g, 0); f2.b != f2.d.c; ) { - e = RD(evb(f2), 72); - nQb(e, (Ywc(), dwc)) || pQb(e, dwc, c2); - } - Tmb(b, g); - Xub(g); - } - return h; - } - function _Tc(a, b, c2, d, e) { - var f2, g, h, i2, j; - h = e ? d.b : d.a; - if (Zsb(a.a, d)) { - return; - } - j = h > c2.s && h < c2.c; - i2 = false; - if (c2.e.b != 0 && c2.j.b != 0) { - i2 = i2 | ($wnd.Math.abs(h - Kfb(UD(Qub(c2.e)))) < Vze && $wnd.Math.abs(h - Kfb(UD(Qub(c2.j)))) < Vze); - i2 = i2 | ($wnd.Math.abs(h - Kfb(UD(Rub(c2.e)))) < Vze && $wnd.Math.abs(h - Kfb(UD(Rub(c2.j)))) < Vze); - } - if (j || i2) { - g = RD(mQb(b, (yCc(), RAc)), 75); - if (!g) { - g = new Ejd(); - pQb(b, RAc, g); - } - f2 = new sjd(d); - Pub(g, f2, g.c.b, g.c); - Ysb(a.a, f2); - } - } - function ZPb(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - if (YPb(a, b, c2, d)) { - return true; - } else { - for (g = new Anb(b.f); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 334); - h = false; - i2 = a.j - b.j + c2; - j = i2 + b.o; - k = a.k - b.k + d; - e = k + b.p; - switch (f2.a.g) { - case 0: - h = fQb(a, i2 + f2.b.a, 0, i2 + f2.c.a, k - 1); - break; - case 1: - h = fQb(a, j, k + f2.b.a, a.o - 1, k + f2.c.a); - break; - case 2: - h = fQb(a, i2 + f2.b.a, e, i2 + f2.c.a, a.p - 1); - break; - default: - h = fQb(a, 0, k + f2.b.a, i2 - 1, k + f2.c.a); - } - if (h) { - return true; - } - } - } - return false; - } - function yZc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - c2.Ug("Processor set coordinates", 1); - a.a = b.b.b == 0 ? 1 : b.b.b; - j = null; - d = Sub(b.b, 0); - while (!j && d.b != d.d.c) { - l = RD(evb(d), 40); - if (Heb(TD(mQb(l, (q$c(), n$c))))) { - j = l; - i2 = l.e; - i2.a = RD(mQb(l, o$c), 17).a; - i2.b = RD(mQb(l, p$c), 17).a; - } - } - h = $Wc(j); - k = 1; - do { - h = zZc((e = h, c2.eh(k), e)); - k = h.b / a.a | 0; - } while (h.b != 0); - for (g = Sub(b.b, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 40); - ojd(f2.e, new rjd(f2.f.a / 2, f2.f.b / 2)); - } - c2.Vg(); - } - function uYc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - c2.Ug(MEe, 1); - akb(a.b); - akb(a.a); - h = null; - f2 = Sub(b.b, 0); - while (!h && f2.b != f2.d.c) { - j = RD(evb(f2), 40); - Heb(TD(mQb(j, (q$c(), n$c)))) && (h = j); - } - i2 = new Yub(); - Pub(i2, h, i2.c.b, i2.c); - tYc(a, i2); - for (k = Sub(b.b, 0); k.b != k.d.c; ) { - j = RD(evb(k), 40); - g = WD(mQb(j, (q$c(), a$c))); - e = Xjb(a.b, g) != null ? RD(Xjb(a.b, g), 17).a : 0; - pQb(j, XZc, sgb(e)); - d = 1 + (Xjb(a.a, g) != null ? RD(Xjb(a.a, g), 17).a : 0); - pQb(j, VZc, sgb(d)); - } - c2.Vg(); - } - function ikd(a) { - Cgd(a, new Pfd($fd(Xfd(Zfd(Yfd(new agd(), LGe), "ELK Box"), "Algorithm for packing of unconnected boxes, i.e. graphs without edges."), new lkd()))); - Agd(a, LGe, Eze, ekd); - Agd(a, LGe, _ze, 15); - Agd(a, LGe, $ze, sgb(0)); - Agd(a, LGe, MGe, iGd($jd)); - Agd(a, LGe, jAe, iGd(akd)); - Agd(a, LGe, iAe, iGd(ckd)); - Agd(a, LGe, Dze, KGe); - Agd(a, LGe, dAe, iGd(_jd)); - Agd(a, LGe, CAe, iGd(bkd)); - Agd(a, LGe, NGe, iGd(Yjd)); - Agd(a, LGe, YDe, iGd(Zjd)); - } - function c2b(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - e = a.i; - g = e.o.a; - f2 = e.o.b; - if (g <= 0 && f2 <= 0) { - return qpd(), opd; - } - j = a.n.a; - k = a.n.b; - h = a.o.a; - c2 = a.o.b; - switch (b.g) { - case 2: - case 1: - if (j < 0) { - return qpd(), ppd; - } else if (j + h > g) { - return qpd(), Xod; - } - break; - case 4: - case 3: - if (k < 0) { - return qpd(), Yod; - } else if (k + c2 > f2) { - return qpd(), npd; - } - } - i2 = (j + h / 2) / g; - d = (k + c2 / 2) / f2; - return i2 + d <= 1 && i2 - d <= 0 ? (qpd(), ppd) : i2 + d >= 1 && i2 - d >= 0 ? (qpd(), Xod) : d < 0.5 ? (qpd(), Yod) : (qpd(), npd); - } - function PNc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - c2 = false; - k = Kfb(UD(mQb(b, (yCc(), bCc)))); - o2 = pwe * k; - for (e = new Anb(b.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - j = new Anb(d.a); - f2 = RD(ynb(j), 10); - l = XNc(a.a[f2.p]); - while (j.a < j.c.c.length) { - h = RD(ynb(j), 10); - m = XNc(a.a[h.p]); - if (l != m) { - n = bFc(a.b, f2, h); - g = f2.n.b + f2.o.b + f2.d.a + l.a + n; - i2 = h.n.b - h.d.d + m.a; - if (g > i2 + o2) { - p = l.g + m.g; - m.a = (m.g * m.a + l.g * l.a) / p; - m.g = p; - l.f = m; - c2 = true; - } - } - f2 = h; - l = m; - } - } - return c2; - } - function MJb(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l, m; - m = new Tid(); - for (j = b.Kc(); j.Ob(); ) { - h = RD(j.Pb(), 853); - for (l = new Anb(h.Rf()); l.a < l.c.c.length; ) { - k = RD(ynb(l), 187); - if (dE(k.of((umd(), Qkd))) === dE((Omd(), Nmd))) { - JJb(m, k, false, d, e, f2, g); - Sid(a, m); - } - } - } - for (i2 = c2.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 853); - for (l = new Anb(h.Rf()); l.a < l.c.c.length; ) { - k = RD(ynb(l), 187); - if (dE(k.of((umd(), Qkd))) === dE((Omd(), Mmd))) { - JJb(m, k, true, d, e, f2, g); - Sid(a, m); - } - } - } - } - function PVc(a, b, c2) { - var d, e, f2, g, h, i2, j; - for (g = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); g.e != g.i.gc(); ) { - f2 = RD(bMd(g), 27); - for (e = new is(Mr(zGd(f2).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 74); - if (!nzd(d) && !nzd(d) && !ozd(d)) { - i2 = RD(Wd(qtb(c2.f, f2)), 40); - j = RD(Wjb(c2, AGd(RD(QHd((!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c), 0), 84))), 40); - if (!!i2 && !!j) { - h = new WWc(i2, j); - pQb(h, (q$c(), h$c), d); - kQb(h, d); - Mub(i2.d, h); - Mub(j.b, h); - Mub(b.a, h); - } - } - } - } - } - function HNb(a, b) { - var c2, d, e, f2, g, h, i2, j; - for (i2 = RD(RD(Qc(a.r, b), 21), 87).Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 117); - e = h.c ? PKb(h.c) : 0; - if (e > 0) { - if (h.a) { - j = h.b.Mf().b; - if (e > j) { - if (a.v || h.c.d.c.length == 1) { - g = (e - j) / 2; - h.d.d = g; - h.d.a = g; - } else { - c2 = RD(Vmb(h.c.d, 0), 187).Mf().b; - d = (c2 - j) / 2; - h.d.d = $wnd.Math.max(0, d); - h.d.a = e - d - j; - } - } - } else { - h.d.a = a.t + e; - } - } else if (Rod(a.u)) { - f2 = wsd(h.b); - f2.d < 0 && (h.d.d = -f2.d); - f2.d + f2.a > h.b.Mf().b && (h.d.a = f2.d + f2.a - h.b.Mf().b); - } - } - } - function yVb() { - yVb = geb; - lVb = new mGd((umd(), Rld), sgb(1)); - rVb = new mGd(fmd, 80); - qVb = new mGd($ld, 5); - ZUb = new mGd(Dkd, Yze); - mVb = new mGd(Sld, sgb(1)); - pVb = new mGd(Vld, (Geb(), true)); - iVb = new A3b(50); - hVb = new mGd(tld, iVb); - _Ub = ald; - jVb = Hld; - $Ub = new mGd(Pkd, false); - gVb = sld; - eVb = mld; - fVb = pld; - dVb = kld; - cVb = ild; - kVb = Lld; - bVb = (OUb(), HUb); - sVb = MUb; - aVb = GUb; - nVb = JUb; - oVb = LUb; - vVb = mmd; - xVb = qmd; - uVb = lmd; - tVb = kmd; - wVb = (mqd(), jqd); - new mGd(nmd, wVb); - } - function VC(a, b) { - var c2; - switch (XC(a)) { - case 6: - return bE(b); - case 7: - return _D(b); - case 8: - return $D(b); - case 3: - return Array.isArray(b) && (c2 = XC(b), !(c2 >= 14 && c2 <= 16)); - case 11: - return b != null && typeof b === kve; - case 12: - return b != null && (typeof b === gve || typeof b == kve); - case 0: - return QD(b, a.__elementTypeId$); - case 2: - return cE(b) && !(b.Tm === keb); - case 1: - return cE(b) && !(b.Tm === keb) || QD(b, a.__elementTypeId$); - default: - return true; - } - } - function oRb(a, b) { - var c2, d, e, f2; - d = $wnd.Math.min($wnd.Math.abs(a.c - (b.c + b.b)), $wnd.Math.abs(a.c + a.b - b.c)); - f2 = $wnd.Math.min($wnd.Math.abs(a.d - (b.d + b.a)), $wnd.Math.abs(a.d + a.a - b.d)); - c2 = $wnd.Math.abs(a.c + a.b / 2 - (b.c + b.b / 2)); - if (c2 > a.b / 2 + b.b / 2) { - return 1; - } - e = $wnd.Math.abs(a.d + a.a / 2 - (b.d + b.a / 2)); - if (e > a.a / 2 + b.a / 2) { - return 1; - } - if (c2 == 0 && e == 0) { - return 0; - } - if (c2 == 0) { - return f2 / e + 1; - } - if (e == 0) { - return d / c2 + 1; - } - return $wnd.Math.min(d / c2, f2 / e) + 1; - } - function oWb(a, b) { - var c2, d, e, f2, g, h, i2; - f2 = 0; - h = 0; - i2 = 0; - for (e = new Anb(a.f.e); e.a < e.c.c.length; ) { - d = RD(ynb(e), 153); - if (b == d) { - continue; - } - g = a.i[b.a][d.a]; - f2 += g; - c2 = bjd(b.d, d.d); - c2 > 0 && a.d != (AWb(), zWb) && (h += g * (d.d.a + a.a[b.a][d.a] * (b.d.a - d.d.a) / c2)); - c2 > 0 && a.d != (AWb(), xWb) && (i2 += g * (d.d.b + a.a[b.a][d.a] * (b.d.b - d.d.b) / c2)); - } - switch (a.d.g) { - case 1: - return new rjd(h / f2, b.d.b); - case 2: - return new rjd(b.d.a, i2 / f2); - default: - return new rjd(h / f2, i2 / f2); - } - } - function xsd(a) { - var b, c2, d, e, f2, g; - c2 = (!a.a && (a.a = new XZd(D4, a, 5)), a.a).i + 2; - g = new cnb(c2); - Rmb(g, new rjd(a.j, a.k)); - FDb(new SDb(null, (!a.a && (a.a = new XZd(D4, a, 5)), new Swb(a.a, 16))), new Usd(g)); - Rmb(g, new rjd(a.b, a.c)); - b = 1; - while (b < g.c.length - 1) { - d = (tFb(b - 1, g.c.length), RD(g.c[b - 1], 8)); - e = (tFb(b, g.c.length), RD(g.c[b], 8)); - f2 = (tFb(b + 1, g.c.length), RD(g.c[b + 1], 8)); - d.a == e.a && e.a == f2.a || d.b == e.b && e.b == f2.b ? Xmb(g, b) : ++b; - } - return g; - } - function zgc(a, b) { - sgc(); - var c2, d, e, f2, g; - g = RD(mQb(a.i, (yCc(), BBc)), 101); - f2 = a.j.g - b.j.g; - if (f2 != 0 || !(g == (Bod(), vod) || g == xod || g == wod)) { - return 0; - } - if (g == (Bod(), vod)) { - c2 = RD(mQb(a, CBc), 17); - d = RD(mQb(b, CBc), 17); - if (!!c2 && !!d) { - e = c2.a - d.a; - if (e != 0) { - return e; - } - } - } - switch (a.j.g) { - case 1: - return Qfb(a.n.a, b.n.a); - case 2: - return Qfb(a.n.b, b.n.b); - case 3: - return Qfb(b.n.a, a.n.a); - case 4: - return Qfb(b.n.b, a.n.b); - default: - throw Adb(new dgb(UAe)); - } - } - function Bkc(a, b) { - var c2, d, e, f2, g, h, i2; - c2 = mGb(pGb(nGb(oGb(new qGb(), b), new Vid(b.e)), kkc), a.a); - b.j.c.length == 0 || eGb(RD(Vmb(b.j, 0), 60).a, c2); - i2 = new cHb(); - Zjb(a.e, c2, i2); - g = new _sb(); - h = new _sb(); - for (f2 = new Anb(b.k); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 18); - Ysb(g, e.c); - Ysb(h, e.d); - } - d = g.a.gc() - h.a.gc(); - if (d < 0) { - aHb(i2, true, (Cmd(), ymd)); - aHb(i2, false, zmd); - } else if (d > 0) { - aHb(i2, false, (Cmd(), ymd)); - aHb(i2, true, zmd); - } - Umb(b.g, new Elc(a, c2)); - Zjb(a.g, b, c2); - } - function Ugb() { - Ugb = geb; - var a; - Qgb = cD(WC(kE, 1), Pwe, 28, 15, [-1, -1, 30, 19, 15, 13, 11, 11, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5]); - Rgb2 = $C(kE, Pwe, 28, 37, 15, 1); - Sgb = cD(WC(kE, 1), Pwe, 28, 15, [-1, -1, 63, 40, 32, 28, 25, 23, 21, 20, 19, 19, 18, 18, 17, 17, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13]); - Tgb = $C(lE, rxe, 28, 37, 14, 1); - for (a = 2; a <= 36; a++) { - Rgb2[a] = eE($wnd.Math.pow(a, Qgb[a])); - Tgb[a] = Fdb(Sve, Rgb2[a]); - } - } - function tsd(a) { - var b; - if ((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i != 1) { - throw Adb(new agb(tHe + (!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i)); - } - b = new Ejd(); - !!BGd(RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84)) && ye(b, usd(a, BGd(RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84)), false)); - !!BGd(RD(QHd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c), 0), 84)) && ye(b, usd(a, BGd(RD(QHd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c), 0), 84)), true)); - return b; - } - function zRc(a, b) { - var c2, d, e, f2, g; - b.d ? e = a.a.c == (wQc(), vQc) ? Z2b(b.b) : a3b(b.b) : e = a.a.c == (wQc(), uQc) ? Z2b(b.b) : a3b(b.b); - f2 = false; - for (d = new is(Mr(e.a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - g = Heb(a.a.f[a.a.g[b.b.p].p]); - if (!g && !W0b(c2) && c2.c.i.c == c2.d.i.c) { - continue; - } - if (Heb(a.a.n[a.a.g[b.b.p].p]) || Heb(a.a.n[a.a.g[b.b.p].p])) { - continue; - } - f2 = true; - if (Zsb(a.b, a.a.g[rRc(c2, b.b).p])) { - b.c = true; - b.a = c2; - return b; - } - } - b.c = f2; - b.a = null; - return b; - } - function QJd(a, b, c2) { - var d, e, f2, g, h, i2, j; - d = c2.gc(); - if (d == 0) { - return false; - } else { - if (a.Pj()) { - i2 = a.Qj(); - ZId(a, b, c2); - g = d == 1 ? a.Ij(3, null, c2.Kc().Pb(), b, i2) : a.Ij(5, null, c2, b, i2); - if (a.Mj()) { - h = d < 100 ? null : new gLd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - j = a.xj(e); - h = a.Nj(j, h); - h = h; - } - if (!h) { - a.Jj(g); - } else { - h.nj(g); - h.oj(); - } - } else { - a.Jj(g); - } - } else { - ZId(a, b, c2); - if (a.Mj()) { - h = d < 100 ? null : new gLd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - h = a.Nj(a.xj(e), h); - } - !!h && h.oj(); - } - } - return true; - } - } - function WJd(a, b, c2) { - var d, e, f2, g, h; - if (a.Pj()) { - e = null; - f2 = a.Qj(); - d = a.Ij(1, h = (g = a.Dj(b, a.Zi(b, c2)), g), c2, b, f2); - if (a.Mj() && !(a.Yi() && !!h ? pb(h, c2) : dE(h) === dE(c2))) { - !!h && (e = a.Oj(h, e)); - e = a.Nj(c2, e); - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } else { - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } - return h; - } else { - h = (g = a.Dj(b, a.Zi(b, c2)), g); - if (a.Mj() && !(a.Yi() && !!h ? pb(h, c2) : dE(h) === dE(c2))) { - e = null; - !!h && (e = a.Oj(h, null)); - e = a.Nj(c2, e); - !!e && e.oj(); - } - return h; - } - } - function nUb(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - a.e = b; - a.f = RD(mQb(b, (JVb(), IVb)), 234); - eUb(b); - a.d = $wnd.Math.max(b.e.c.length * 16 + b.c.c.length, 256); - if (!Heb(TD(mQb(b, (yVb(), _Ub))))) { - k = a.e.e.c.length; - for (i2 = new Anb(b.e); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 153); - j = h.d; - j.a = Iwb(a.f) * k; - j.b = Iwb(a.f) * k; - } - } - c2 = b.b; - for (f2 = new Anb(b.c); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 290); - d = RD(mQb(e, oVb), 17).a; - if (d > 0) { - for (g = 0; g < d; g++) { - Rmb(c2, new WTb(e)); - } - YTb(e); - } - } - } - function NId(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2; - m = new OC(a.Zg()); - sC(b, GIe, m); - if (c2 && !a.Xg().a.dc()) { - k = new MB(); - sC(b, "logs", k); - h = 0; - for (o2 = new Ppb(a.Xg().b.Kc()); o2.b.Ob(); ) { - n = WD(o2.b.Pb()); - l = new OC(n); - JB(k, h); - LB(k, h, l); - ++h; - } - } - if (d) { - j = new hC(a.Wg()); - sC(b, "executionTime", j); - } - if (!a.Yg().a.dc()) { - g = new MB(); - sC(b, iIe, g); - h = 0; - for (f2 = new Ppb(a.Yg().b.Kc()); f2.b.Ob(); ) { - e = RD(f2.b.Pb(), 871); - i2 = new uC(); - JB(g, h); - LB(g, h, i2); - NId(e, i2, c2, d); - ++h; - } - } - } - function rue() { - rue = geb; - Gie(); - que = new sue(); - cD(WC(B7, 2), Nve, 381, 0, [cD(WC(B7, 1), _Le, 600, 0, [new oue(wLe)])]); - cD(WC(B7, 2), Nve, 381, 0, [cD(WC(B7, 1), _Le, 600, 0, [new oue(xLe)])]); - cD(WC(B7, 2), Nve, 381, 0, [cD(WC(B7, 1), _Le, 600, 0, [new oue(yLe)]), cD(WC(B7, 1), _Le, 600, 0, [new oue(xLe)])]); - new ejb("-1"); - cD(WC(B7, 2), Nve, 381, 0, [cD(WC(B7, 1), _Le, 600, 0, [new oue("\\c+")])]); - new ejb("0"); - new ejb("0"); - new ejb("1"); - new ejb("0"); - new ejb(ILe); - } - function wac(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - b.Ug("Hypernodes processing", 1); - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - for (h = new Anb(d.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - if (Heb(TD(mQb(g, (yCc(), MAc)))) && g.j.c.length <= 2) { - l = 0; - k = 0; - c2 = 0; - f2 = 0; - for (j = new Anb(g.j); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 12); - switch (i2.j.g) { - case 1: - ++l; - break; - case 2: - ++k; - break; - case 3: - ++c2; - break; - case 4: - ++f2; - } - } - l == 0 && c2 == 0 && vac(a, g, f2 <= k); - } - } - } - b.Vg(); - } - function MUc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l; - for (g = new Anb(b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 18); - i2 = f2.c; - if (c2.a._b(i2)) { - j = (dVc(), bVc); - } else if (d.a._b(i2)) { - j = (dVc(), cVc); - } else { - throw Adb(new agb("Source port must be in one of the port sets.")); - } - k = f2.d; - if (c2.a._b(k)) { - l = (dVc(), bVc); - } else if (d.a._b(k)) { - l = (dVc(), cVc); - } else { - throw Adb(new agb("Target port must be in one of the port sets.")); - } - h = new wVc(f2, j, l); - Zjb(a.b, f2, h); - ZEb(e.c, h); - } - } - function i2d(a) { - var b, c2; - if (!!a.c && a.c.Vh()) { - c2 = RD(a.c, 54); - a.c = RD(Vvd(a, c2), 142); - if (a.c != c2) { - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 9, 2, c2, a.c)); - if (ZD(a.Cb, 411)) { - a.Db >> 16 == -15 && a.Cb.Yh() && pKd(new O3d(a.Cb, 9, 13, c2, a.c, fZd(o4d(RD(a.Cb, 62)), a))); - } else if (ZD(a.Cb, 90)) { - if (a.Db >> 16 == -23 && a.Cb.Yh()) { - b = a.c; - ZD(b, 90) || (b = (JTd(), zTd)); - ZD(c2, 90) || (c2 = (JTd(), zTd)); - pKd(new O3d(a.Cb, 9, 10, c2, b, fZd(tYd(RD(a.Cb, 29)), a))); - } - } - } - } - return a.c; - } - function lac(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - c2.Ug("Hyperedge merging", 1); - jac(a, b); - i2 = new Jkb(b.b, 0); - while (i2.b < i2.d.gc()) { - h = (sFb(i2.b < i2.d.gc()), RD(i2.d.Xb(i2.c = i2.b++), 30)); - k = h.a; - if (k.c.length == 0) { - continue; - } - d = null; - e = null; - f2 = null; - g = null; - for (j = 0; j < k.c.length; j++) { - d = (tFb(j, k.c.length), RD(k.c[j], 10)); - e = d.k; - if (e == (r3b(), o3b) && g == o3b) { - l = hac(d, f2); - if (l.a) { - kac(d, f2, l.b, l.c); - tFb(j, k.c.length); - $Eb(k.c, j, 1); - --j; - d = f2; - e = g; - } - } - f2 = d; - g = e; - } - } - c2.Vg(); - } - function U$d(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2; - if (b == c2) { - return true; - } else { - b = V$d(a, b); - c2 = V$d(a, c2); - d = h2d(b); - if (d) { - k = h2d(c2); - if (k != d) { - if (!k) { - return false; - } else { - i2 = d.mk(); - o2 = k.mk(); - return i2 == o2 && i2 != null; - } - } else { - g = (!b.d && (b.d = new XZd(o7, b, 1)), b.d); - f2 = g.i; - m = (!c2.d && (c2.d = new XZd(o7, c2, 1)), c2.d); - if (f2 == m.i) { - for (j = 0; j < f2; ++j) { - e = RD(QHd(g, j), 89); - l = RD(QHd(m, j), 89); - if (!U$d(a, e, l)) { - return false; - } - } - } - return true; - } - } else { - h = b.e; - n = c2.e; - return h == n; - } - } - } - function vge(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l; - if (qke(a.e, b)) { - l = pke(a.e.Dh(), b); - f2 = RD(a.g, 124); - k = null; - i2 = -1; - h = -1; - e = 0; - for (j = 0; j < a.i; ++j) { - g = f2[j]; - if (l.am(g.Lk())) { - e == c2 && (i2 = j); - if (e == d) { - h = j; - k = g.md(); - } - ++e; - } - } - if (i2 == -1) { - throw Adb(new veb(MIe + c2 + NIe + e)); - } - if (h == -1) { - throw Adb(new veb(OIe + d + NIe + e)); - } - uLd(a, i2, h); - Mvd(a.e) && eZd(a, fge(a, 7, b, sgb(d), k, c2, true)); - return k; - } else { - throw Adb(new agb("The feature must be many-valued to support move")); - } - } - function j2b(a, b, c2, d) { - var e, f2, g, h, i2; - i2 = new sjd(b.n); - i2.a += b.o.a / 2; - i2.b += b.o.b / 2; - h = Kfb(UD(mQb(b, (yCc(), ABc)))); - f2 = a.f; - g = a.d; - e = a.c; - switch (RD(mQb(b, (Ywc(), hwc)), 64).g) { - case 1: - i2.a += g.b + e.a - c2 / 2; - i2.b = -d - h; - b.n.b = -(g.d + h + e.b); - break; - case 2: - i2.a = f2.a + g.b + g.c + h; - i2.b += g.d + e.b - d / 2; - b.n.a = f2.a + g.c + h - e.a; - break; - case 3: - i2.a += g.b + e.a - c2 / 2; - i2.b = f2.b + g.d + g.a + h; - b.n.b = f2.b + g.a + h - e.b; - break; - case 4: - i2.a = -c2 - h; - i2.b += g.d + e.b - d / 2; - b.n.a = -(g.b + h + e.a); - } - return i2; - } - function Z4b(a) { - var b, c2, d, e, f2, g; - d = new d1b(); - kQb(d, a); - dE(mQb(d, (yCc(), rAc))) === dE((Cmd(), Amd)) && pQb(d, rAc, i2b(d)); - if (mQb(d, (rid(), qid)) == null) { - g = RD(Lje(a), 167); - pQb(d, qid, fE(g.of(qid))); - } - pQb(d, (Ywc(), Awc), a); - pQb(d, kwc, (b = RD(mfb(iX), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0))); - e = FJb((!vCd(a) ? null : (lud(), new zud(vCd(a))), lud(), new Fud(!vCd(a) ? null : new zud(vCd(a)), a)), zmd); - f2 = RD(mQb(d, qBc), 107); - c2 = d.d; - B2b(c2, f2); - B2b(c2, e); - return d; - } - function Nec(a, b, c2) { - var d, e; - d = b.c.i; - e = c2.d.i; - if (d.k == (r3b(), o3b)) { - pQb(a, (Ywc(), vwc), RD(mQb(d, vwc), 12)); - pQb(a, wwc, RD(mQb(d, wwc), 12)); - pQb(a, uwc, TD(mQb(d, uwc))); - } else if (d.k == n3b) { - pQb(a, (Ywc(), vwc), RD(mQb(d, vwc), 12)); - pQb(a, wwc, RD(mQb(d, wwc), 12)); - pQb(a, uwc, (Geb(), true)); - } else if (e.k == n3b) { - pQb(a, (Ywc(), vwc), RD(mQb(e, vwc), 12)); - pQb(a, wwc, RD(mQb(e, wwc), 12)); - pQb(a, uwc, (Geb(), true)); - } else { - pQb(a, (Ywc(), vwc), b.c); - pQb(a, wwc, c2.d); - } - } - function wJb(a) { - var b, c2, d, e, f2, g, h; - a.o = new wmb(); - d = new Yub(); - for (g = new Anb(a.e.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 125); - CIb(f2).c.length == 1 && (Pub(d, f2, d.c.b, d.c), true); - } - while (d.b != 0) { - f2 = RD(d.b == 0 ? null : (sFb(d.b != 0), Wub(d, d.a.a)), 125); - if (CIb(f2).c.length == 0) { - continue; - } - b = RD(Vmb(CIb(f2), 0), 218); - c2 = f2.g.a.c.length > 0; - h = oIb(b, f2); - c2 ? FIb(h.b, b) : FIb(h.g, b); - CIb(h).c.length == 1 && (Pub(d, h, d.c.b, d.c), true); - e = new Ptd(f2, b); - hmb(a.o, e); - Ymb(a.e.a, f2); - } - } - function SQb(a, b) { - var c2, d, e, f2, g, h, i2; - d = $wnd.Math.abs(Oid(a.b).a - Oid(b.b).a); - h = $wnd.Math.abs(Oid(a.b).b - Oid(b.b).b); - e = 0; - i2 = 0; - c2 = 1; - g = 1; - if (d > a.b.b / 2 + b.b.b / 2) { - e = $wnd.Math.min($wnd.Math.abs(a.b.c - (b.b.c + b.b.b)), $wnd.Math.abs(a.b.c + a.b.b - b.b.c)); - c2 = 1 - e / d; - } - if (h > a.b.a / 2 + b.b.a / 2) { - i2 = $wnd.Math.min($wnd.Math.abs(a.b.d - (b.b.d + b.b.a)), $wnd.Math.abs(a.b.d + a.b.a - b.b.d)); - g = 1 - i2 / h; - } - f2 = $wnd.Math.min(c2, g); - return (1 - f2) * $wnd.Math.sqrt(d * d + h * h); - } - function LUc(a) { - var b, c2, d, e; - NUc(a, a.e, a.f, (dVc(), bVc), true, a.c, a.i); - NUc(a, a.e, a.f, bVc, false, a.c, a.i); - NUc(a, a.e, a.f, cVc, true, a.c, a.i); - NUc(a, a.e, a.f, cVc, false, a.c, a.i); - MUc(a, a.c, a.e, a.f, a.i); - d = new Jkb(a.i, 0); - while (d.b < d.d.gc()) { - b = (sFb(d.b < d.d.gc()), RD(d.d.Xb(d.c = d.b++), 131)); - e = new Jkb(a.i, d.b); - while (e.b < e.d.gc()) { - c2 = (sFb(e.b < e.d.gc()), RD(e.d.Xb(e.c = e.b++), 131)); - KUc(b, c2); - } - } - WUc(a.i, RD(mQb(a.d, (Ywc(), Lwc)), 234)); - ZUc(a.i); - } - function FXd(a, b) { - var c2, d; - if (b != null) { - d = DXd(a); - if (d) { - if ((d.i & 1) != 0) { - if (d == xdb) { - return $D(b); - } else if (d == kE) { - return ZD(b, 17); - } else if (d == jE) { - return ZD(b, 161); - } else if (d == gE) { - return ZD(b, 222); - } else if (d == hE) { - return ZD(b, 180); - } else if (d == iE) { - return _D(b); - } else if (d == wdb) { - return ZD(b, 191); - } else if (d == lE) { - return ZD(b, 168); - } - } else { - return PRd(), c2 = RD(Wjb(ORd, d), 57), !c2 || c2.fk(b); - } - } else if (ZD(b, 58)) { - return a.dl(RD(b, 58)); - } - } - return false; - } - function zqe() { - zqe = geb; - var a, b, c2, d, e, f2, g, h, i2; - xqe = $C(gE, YHe, 28, 255, 15, 1); - yqe = $C(hE, zwe, 28, 64, 15, 1); - for (b = 0; b < 255; b++) { - xqe[b] = -1; - } - for (c2 = 90; c2 >= 65; c2--) { - xqe[c2] = c2 - 65 << 24 >> 24; - } - for (d = 122; d >= 97; d--) { - xqe[d] = d - 97 + 26 << 24 >> 24; - } - for (e = 57; e >= 48; e--) { - xqe[e] = e - 48 + 52 << 24 >> 24; - } - xqe[43] = 62; - xqe[47] = 63; - for (f2 = 0; f2 <= 25; f2++) - yqe[f2] = 65 + f2 & Bwe; - for (g = 26, i2 = 0; g <= 51; ++g, i2++) - yqe[g] = 97 + i2 & Bwe; - for (a = 52, h = 0; a <= 61; ++a, h++) - yqe[a] = 48 + h & Bwe; - yqe[62] = 43; - yqe[63] = 47; - } - function uib(a, b) { - var c2, d, e, f2, g, h; - e = xib(a); - h = xib(b); - if (e == h) { - if (a.e == b.e && a.a < 54 && b.a < 54) { - return a.f < b.f ? -1 : a.f > b.f ? 1 : 0; - } - d = a.e - b.e; - c2 = (a.d > 0 ? a.d : $wnd.Math.floor((a.a - 1) * xxe) + 1) - (b.d > 0 ? b.d : $wnd.Math.floor((b.a - 1) * xxe) + 1); - if (c2 > d + 1) { - return e; - } else if (c2 < d - 1) { - return -e; - } else { - f2 = (!a.c && (a.c = ojb(Hdb(a.f))), a.c); - g = (!b.c && (b.c = ojb(Hdb(b.f))), b.c); - d < 0 ? f2 = Wib(f2, Sjb(-d)) : d > 0 && (g = Wib(g, Sjb(d))); - return Qib(f2, g); - } - } else - return e < h ? -1 : 1; - } - function pUb(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - c2.Ug(Pze, 1); - a.vf(b); - f2 = 0; - while (a.xf(f2) && !c2.$g()) { - a.wf(); - for (k = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [b.e, b.d, b.b]))); gs(k); ) { - i2 = RD(hs(k), 309); - for (h = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [b.e, b.d, b.b]))); gs(h); ) { - g = RD(hs(h), 309); - if (g != i2) { - e = a.uf(g, i2); - !!e && $id(i2.c, e); - } - } - } - for (j = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [b.e, b.d, b.b]))); gs(j); ) { - i2 = RD(hs(j), 309); - d = i2.c; - _id(d, -a.d, -a.d, a.d, a.d); - $id(i2.d, d); - d.a = 0; - d.b = 0; - } - ++f2; - } - c2.Vg(); - } - function H$b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - if (a.dc()) { - return new pjd(); - } - j = 0; - l = 0; - for (e = a.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 36); - f2 = d.f; - j = $wnd.Math.max(j, f2.a); - l += f2.a * f2.b; - } - j = $wnd.Math.max(j, $wnd.Math.sqrt(l) * Kfb(UD(mQb(RD(a.Kc().Pb(), 36), (yCc(), Tzc))))); - m = 0; - n = 0; - i2 = 0; - c2 = b; - for (h = a.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 36); - k = g.f; - if (m + k.a > j) { - m = 0; - n += i2 + b; - i2 = 0; - } - w$b(g, m, n); - c2 = $wnd.Math.max(c2, m + k.a); - i2 = $wnd.Math.max(i2, k.b); - m += k.a + b; - } - return new rjd(c2 + b, n + i2 + b); - } - function osd(a, b) { - var c2, d, e, f2, g, h, i2; - if (!MCd(a)) { - throw Adb(new dgb(sHe)); - } - d = MCd(a); - f2 = d.g; - e = d.f; - if (f2 <= 0 && e <= 0) { - return qpd(), opd; - } - h = a.i; - i2 = a.j; - switch (b.g) { - case 2: - case 1: - if (h < 0) { - return qpd(), ppd; - } else if (h + a.g > f2) { - return qpd(), Xod; - } - break; - case 4: - case 3: - if (i2 < 0) { - return qpd(), Yod; - } else if (i2 + a.f > e) { - return qpd(), npd; - } - } - g = (h + a.g / 2) / f2; - c2 = (i2 + a.f / 2) / e; - return g + c2 <= 1 && g - c2 <= 0 ? (qpd(), ppd) : g + c2 >= 1 && g - c2 >= 0 ? (qpd(), Xod) : c2 < 0.5 ? (qpd(), Yod) : (qpd(), npd); - } - function Djb(a, b, c2, d, e) { - var f2, g; - f2 = Bdb(Cdb(b[0], yxe), Cdb(d[0], yxe)); - a[0] = Ydb(f2); - f2 = Tdb(f2, 32); - if (c2 >= e) { - for (g = 1; g < e; g++) { - f2 = Bdb(f2, Bdb(Cdb(b[g], yxe), Cdb(d[g], yxe))); - a[g] = Ydb(f2); - f2 = Tdb(f2, 32); - } - for (; g < c2; g++) { - f2 = Bdb(f2, Cdb(b[g], yxe)); - a[g] = Ydb(f2); - f2 = Tdb(f2, 32); - } - } else { - for (g = 1; g < c2; g++) { - f2 = Bdb(f2, Bdb(Cdb(b[g], yxe), Cdb(d[g], yxe))); - a[g] = Ydb(f2); - f2 = Tdb(f2, 32); - } - for (; g < e; g++) { - f2 = Bdb(f2, Cdb(d[g], yxe)); - a[g] = Ydb(f2); - f2 = Tdb(f2, 32); - } - } - Ddb(f2, 0) != 0 && (a[g] = Ydb(f2)); - } - function yte(a) { - Vse(); - var b, c2, d, e, f2, g; - if (a.e != 4 && a.e != 5) - throw Adb(new agb("Token#complementRanges(): must be RANGE: " + a.e)); - f2 = a; - vte(f2); - ste(f2); - d = f2.b.length + 2; - f2.b[0] == 0 && (d -= 2); - c2 = f2.b[f2.b.length - 1]; - c2 == MLe && (d -= 2); - e = new xte(4); - e.b = $C(kE, Pwe, 28, d, 15, 1); - g = 0; - if (f2.b[0] > 0) { - e.b[g++] = 0; - e.b[g++] = f2.b[0] - 1; - } - for (b = 1; b < f2.b.length - 2; b += 2) { - e.b[g++] = f2.b[b] + 1; - e.b[g++] = f2.b[b + 1] - 1; - } - if (c2 != MLe) { - e.b[g++] = c2 + 1; - e.b[g] = MLe; - } - e.a = true; - return e; - } - function zac(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - b.Ug("Layer constraint edge reversal", 1); - for (g = new Anb(a.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - k = -1; - c2 = new bnb(); - j = t2b(f2.a); - for (e = 0; e < j.length; e++) { - d = RD(mQb(j[e], (Ywc(), owc)), 311); - if (k == -1) { - d != (Gvc(), Fvc) && (k = e); - } else { - if (d == (Gvc(), Fvc)) { - g3b(j[e], null); - f3b(j[e], k++, f2); - } - } - d == (Gvc(), Dvc) && (ZEb(c2.c, j[e]), true); - } - for (i2 = new Anb(c2); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - g3b(h, null); - g3b(h, f2); - } - } - b.Vg(); - } - function nLd(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - d = c2.gc(); - if (d == 0) { - return false; - } else { - if (a.Pj()) { - j = a.Qj(); - IHd(a, b, c2); - g = d == 1 ? a.Ij(3, null, c2.Kc().Pb(), b, j) : a.Ij(5, null, c2, b, j); - if (a.Mj()) { - h = d < 100 ? null : new gLd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - k = a.g[e]; - h = a.Nj(k, h); - h = a.Uj(k, h); - } - if (!h) { - a.Jj(g); - } else { - h.nj(g); - h.oj(); - } - } else { - a.Jj(g); - } - } else { - IHd(a, b, c2); - if (a.Mj()) { - h = d < 100 ? null : new gLd(d); - f2 = b + d; - for (e = b; e < f2; ++e) { - i2 = a.g[e]; - h = a.Nj(i2, h); - } - !!h && h.oj(); - } - } - return true; - } - } - function m9b(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - b.Ug("Hierarchical port dummy size processing", 1); - i2 = new bnb(); - k = new bnb(); - d = Kfb(UD(mQb(a, (yCc(), UBc)))); - c2 = d * 2; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - i2.c.length = 0; - k.c.length = 0; - for (h = new Anb(e.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - if (g.k == (r3b(), m3b)) { - j = RD(mQb(g, (Ywc(), hwc)), 64); - j == (qpd(), Yod) ? (ZEb(i2.c, g), true) : j == npd && (ZEb(k.c, g), true); - } - } - n9b(i2, true, c2); - n9b(k, false, c2); - } - b.Vg(); - } - function wSc(a, b, c2, d) { - var e, f2, g, h, i2; - for (g = new Anb(a.k); g.a < g.c.c.length; ) { - e = RD(ynb(g), 132); - if (!d || e.c == (fTc(), dTc)) { - i2 = e.b; - if (i2.g < 0 && e.d > 0) { - PSc(i2, i2.d - e.d); - e.c == (fTc(), dTc) && NSc(i2, i2.a - e.d); - i2.d <= 0 && i2.i > 0 && (Pub(b, i2, b.c.b, b.c), true); - } - } - } - for (f2 = new Anb(a.f); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 132); - if (!d || e.c == (fTc(), dTc)) { - h = e.a; - if (h.g < 0 && e.d > 0) { - QSc(h, h.i - e.d); - e.c == (fTc(), dTc) && OSc(h, h.b - e.d); - h.i <= 0 && h.d > 0 && (Pub(c2, h, c2.c.b, c2.c), true); - } - } - } - } - function drd(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n; - yob(); - _mb(a, new Mrd()); - g = gv(a); - n = new bnb(); - m = new bnb(); - h = null; - i2 = 0; - while (g.b != 0) { - f2 = RD(g.b == 0 ? null : (sFb(g.b != 0), Wub(g, g.a.a)), 163); - if (!h || urd(h) * trd(h) / 2 < urd(f2) * trd(f2)) { - h = f2; - ZEb(n.c, f2); - } else { - i2 += urd(f2) * trd(f2); - ZEb(m.c, f2); - if (m.c.length > 1 && (i2 > urd(h) * trd(h) / 2 || g.b == 0)) { - l = new zrd(m); - k = urd(h) / trd(h); - j = ird(l, b, new z3b(), c2, d, e, k); - $id(hjd(l.e), j); - h = l; - ZEb(n.c, l); - i2 = 0; - m.c.length = 0; - } - } - } - Tmb(n, m); - return n; - } - function hib(a, b, c2, d, e) { - gib(); - var f2, g, h, i2, j, k, l; - vFb(a, "src"); - vFb(c2, "dest"); - l = rb(a); - i2 = rb(c2); - qFb((l.i & 4) != 0, "srcType is not an array"); - qFb((i2.i & 4) != 0, "destType is not an array"); - k = l.c; - g = i2.c; - qFb((k.i & 1) != 0 ? k == g : (g.i & 1) == 0, "Array types don't match"); - iib(a, b, c2, d, e); - if ((k.i & 1) == 0 && l != i2) { - j = SD(a); - f2 = SD(c2); - if (dE(a) === dE(c2) && b < d) { - b += e; - for (h = d + e; h-- > d; ) { - bD(f2, h, j[--b]); - } - } else { - for (h = d + e; d < h; ) { - bD(f2, d++, j[b++]); - } - } - } else { - VEb(a, b, c2, d, e, true); - } - } - function crd(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - b.Ug("Box layout", 2); - e = Mfb(UD(Gxd(a, (hkd(), gkd)))); - f2 = RD(Gxd(a, dkd), 107); - c2 = Heb(TD(Gxd(a, $jd))); - d = Heb(TD(Gxd(a, _jd))); - switch (RD(Gxd(a, Yjd), 320).g) { - case 0: - g = (k = new dnb((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)), yob(), _mb(k, new prd(d)), k); - h = vsd(a); - i2 = UD(Gxd(a, Xjd)); - (i2 == null || (uFb(i2), i2) <= 0) && (i2 = 1.3); - j = grd(g, e, f2, h.a, h.b, c2, (uFb(i2), i2)); - Esd(a, j.a, j.b, false, true); - break; - default: - hrd(a, e, f2, c2); - } - b.Vg(); - } - function uUc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2; - m = tUc(a, c2); - for (i2 = 0; i2 < b; i2++) { - Ikb(e, c2); - n = new bnb(); - o2 = (sFb(d.b < d.d.gc()), RD(d.d.Xb(d.c = d.b++), 418)); - for (k = m + i2; k < a.b; k++) { - h = o2; - o2 = (sFb(d.b < d.d.gc()), RD(d.d.Xb(d.c = d.b++), 418)); - Rmb(n, new AUc(h, o2, c2)); - } - for (l = m + i2; l < a.b; l++) { - sFb(d.b > 0); - d.a.Xb(d.c = --d.b); - l > m + i2 && Ckb(d); - } - for (g = new Anb(n); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 418); - Ikb(d, f2); - } - if (i2 < b - 1) { - for (j = m + i2; j < a.b; j++) { - sFb(d.b > 0); - d.a.Xb(d.c = --d.b); - } - } - } - } - function gte() { - Vse(); - var a, b, c2, d, e, f2; - if (Fse) - return Fse; - a = new xte(4); - ute(a, hte(WLe, true)); - wte(a, hte("M", true)); - wte(a, hte("C", true)); - f2 = new xte(4); - for (d = 0; d < 11; d++) { - rte(f2, d, d); - } - b = new xte(4); - ute(b, hte("M", true)); - rte(b, 4448, 4607); - rte(b, 65438, 65439); - e = new iue(2); - hue2(e, a); - hue2(e, Ese); - c2 = new iue(2); - c2.Jm($se(f2, hte("L", true))); - c2.Jm(b); - c2 = new Kte(3, c2); - c2 = new Qte(e, c2); - Fse = c2; - return Fse; - } - function vhb(a, b) { - var c2, d, e, f2, g, h, i2, j; - c2 = new RegExp(b, "g"); - i2 = $C(qJ, Nve, 2, 0, 6, 1); - d = 0; - j = a; - f2 = null; - while (true) { - h = c2.exec(j); - if (h == null || j == "") { - i2[d] = j; - break; - } else { - g = h.index; - i2[d] = (AFb(0, g, j.length), j.substr(0, g)); - j = zhb(j, g + h[0].length, j.length); - c2.lastIndex = 0; - if (f2 == j) { - i2[d] = (AFb(0, 1, j.length), j.substr(0, 1)); - j = (BFb(1, j.length + 1), j.substr(1)); - } - f2 = j; - ++d; - } - } - if (a.length > 0) { - e = i2.length; - while (e > 0 && i2[e - 1] == "") { - --e; - } - e < i2.length && (i2.length = e); - } - return i2; - } - function h_c() { - h_c = geb; - U$c = new A3b(20); - T$c = new mGd((umd(), tld), U$c); - _$c = new mGd(fmd, 20); - $$c = new mGd(_ld, 3); - E$c = new mGd(Dkd, Yze); - X$c = new mGd(Rld, sgb(1)); - Z$c = new mGd(Vld, (Geb(), true)); - G$c = Mkd; - I$c = (Cmd(), Amd); - H$c = new mGd(Nkd, I$c); - L$c = ald; - M$c = bld; - O$c = kld; - P$c = mld; - Q$c = nld; - R$c = pld; - N$c = ild; - S$c = sld; - V$c = Lld; - g_c = (B$c(), z$c); - Y$c = w$c; - c_c = mmd; - e_c = qmd; - b_c = lmd; - a_c = kmd; - d_c = (mqd(), jqd); - new mGd(nmd, d_c); - W$c = v$c; - K$c = t$c; - f_c = y$c; - F$c = r$c; - J$c = s$c; - } - function bgd(a) { - var b, c2; - b = WD(Gxd(a, (umd(), Akd))); - if (cgd(b, a)) { - return; - } - if (!Hxd(a, Tld) && ((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a).i != 0 || Heb(TD(Gxd(a, $kd))))) { - if (b == null || Dhb(b).length == 0) { - if (!cgd(sxe, a)) { - c2 = Zhb(Zhb(new dib("Unable to load default layout algorithm "), sxe), " for unconfigured node "); - Csd(a, c2); - throw Adb(new Jed(c2.a)); - } - } else { - c2 = Zhb(Zhb(new dib("Layout algorithm '"), b), "' not found for "); - Csd(a, c2); - throw Adb(new Jed(c2.a)); - } - } - } - function $Kb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - c2 = a.i; - b = a.n; - if (a.b == 0) { - n = c2.c + b.b; - m = c2.b - b.b - b.c; - for (g = a.a, i2 = 0, k = g.length; i2 < k; ++i2) { - e = g[i2]; - dKb(e, n, m); - } - } else { - d = bLb(a, false); - dKb(a.a[0], c2.c + b.b, d[0]); - dKb(a.a[2], c2.c + c2.b - b.c - d[2], d[2]); - l = c2.b - b.b - b.c; - if (d[0] > 0) { - l -= d[0] + a.c; - d[0] += a.c; - } - d[2] > 0 && (l -= d[2] + a.c); - d[1] = $wnd.Math.max(d[1], l); - dKb(a.a[1], c2.c + b.b + d[0] - (d[1] - l) / 2, d[1]); - } - for (f2 = a.a, h = 0, j = f2.length; h < j; ++h) { - e = f2[h]; - ZD(e, 336) && RD(e, 336).lf(); - } - } - function iRc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - l = new hRc(); - l.d = 0; - for (g = new Anb(a.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - l.d += f2.a.c.length; - } - d = 0; - e = 0; - l.a = $C(kE, Pwe, 28, a.b.c.length, 15, 1); - j = 0; - k = 0; - l.e = $C(kE, Pwe, 28, l.d, 15, 1); - for (c2 = new Anb(a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 30); - b.p = d++; - l.a[b.p] = e++; - k = 0; - for (i2 = new Anb(b.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - h.p = j++; - l.e[h.p] = k++; - } - } - l.c = new mRc(l); - l.b = ev(l.d); - jRc(l, a); - l.f = ev(l.d); - kRc(l, a); - return l; - } - function M9c(a, b) { - var c2, d, e, f2; - f2 = RD(Vmb(a.n, a.n.c.length - 1), 209).d; - a.p = $wnd.Math.min(a.p, b.g); - a.r = $wnd.Math.max(a.r, f2); - a.g = $wnd.Math.max(a.g, b.g + (a.b.c.length == 1 ? 0 : a.i)); - a.o = $wnd.Math.min(a.o, b.f); - a.e += b.f + (a.b.c.length == 1 ? 0 : a.i); - a.f = $wnd.Math.max(a.f, b.f); - e = a.n.c.length > 0 ? (a.n.c.length - 1) * a.i : 0; - for (d = new Anb(a.n); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 209); - e += c2.a; - } - a.d = e; - a.a = a.e / a.b.c.length - a.i * ((a.b.c.length - 1) / a.b.c.length); - Ead(a.j); - } - function CTb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - k = TD(mQb(b, (yVb(), pVb))); - if (k == null || (uFb(k), k)) { - l = $C(xdb, Hye, 28, b.e.c.length, 16, 1); - g = yTb(b); - e = new Yub(); - for (j = new Anb(b.e); j.a < j.c.c.length; ) { - h = RD(ynb(j), 153); - c2 = zTb(a, h, null, null, l, g); - if (c2) { - kQb(c2, b); - Pub(e, c2, e.c.b, e.c); - } - } - if (e.b > 1) { - for (d = Sub(e, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 235); - f2 = 0; - for (i2 = new Anb(c2.e); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 153); - h.a = f2++; - } - } - } - return e; - } - return dv(cD(WC(tP, 1), Jze, 235, 0, [b])); - } - function rYd(a) { - var b, c2, d, e, f2, g, h; - if (!a.g) { - h = new Z$d(); - b = iYd; - g = b.a.zc(a, b); - if (g == null) { - for (d = new dMd(zYd(a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 29); - YGd(h, rYd(c2)); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - e = h.i; - for (f2 = (!a.s && (a.s = new C5d(y7, a, 21, 17)), new dMd(a.s)); f2.e != f2.i.gc(); ++e) { - BWd(RD(bMd(f2), 462), e); - } - YGd(h, (!a.s && (a.s = new C5d(y7, a, 21, 17)), a.s)); - VHd(h); - a.g = new R$d(a, h); - a.i = RD(h.g, 254); - a.i == null && (a.i = kYd); - a.p = null; - yYd(a).b &= -5; - } - return a.g; - } - function yee(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - c2 = b.qi(a.a); - if (c2) { - i2 = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), "memberTypes")); - if (i2 != null) { - j = new bnb(); - for (f2 = vhb(i2, "\\w"), g = 0, h = f2.length; g < h; ++g) { - e = f2[g]; - d = e.lastIndexOf("#"); - k = d == -1 ? Wee(a, b.jk(), e) : d == 0 ? Vee(a, null, (BFb(1, e.length + 1), e.substr(1))) : Vee(a, (AFb(0, d, e.length), e.substr(0, d)), (BFb(d + 1, e.length + 1), e.substr(d + 1))); - ZD(k, 156) && Rmb(j, RD(k, 156)); - } - return j; - } - } - return yob(), yob(), vob; - } - function _Kb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - d = a.i; - c2 = a.n; - if (a.b == 0) { - b = aLb(a, false); - eKb(a.a[0], d.d + c2.d, b[0]); - eKb(a.a[2], d.d + d.a - c2.a - b[2], b[2]); - m = d.a - c2.d - c2.a; - l = m; - if (b[0] > 0) { - b[0] += a.c; - l -= b[0]; - } - b[2] > 0 && (l -= b[2] + a.c); - b[1] = $wnd.Math.max(b[1], l); - eKb(a.a[1], d.d + c2.d + b[0] - (b[1] - l) / 2, b[1]); - } else { - o2 = d.d + c2.d; - n = d.a - c2.d - c2.a; - for (g = a.a, i2 = 0, k = g.length; i2 < k; ++i2) { - e = g[i2]; - eKb(e, o2, n); - } - } - for (f2 = a.a, h = 0, j = f2.length; h < j; ++h) { - e = f2[h]; - ZD(e, 336) && RD(e, 336).mf(); - } - } - function Erc(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - k = $C(kE, Pwe, 28, a.b.c.length + 1, 15, 1); - j = new _sb(); - d = 0; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - k[d++] = j.a.gc(); - for (i2 = new Anb(e.a); i2.a < i2.c.c.length; ) { - g = RD(ynb(i2), 10); - for (c2 = new is(Mr(a3b(g).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - j.a.zc(b, j); - } - } - for (h = new Anb(e.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - for (c2 = new is(Mr(Z2b(g).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - j.a.Bc(b) != null; - } - } - } - return k; - } - function dge(a, b, c2, d) { - var e, f2, g, h, i2; - i2 = pke(a.e.Dh(), b); - e = RD(a.g, 124); - nke(); - if (RD(b, 69).xk()) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i2.am(f2.Lk()) && pb(f2, c2)) { - return true; - } - } - } else if (c2 != null) { - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - if (i2.am(f2.Lk()) && pb(c2, f2.md())) { - return true; - } - } - if (d) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i2.am(f2.Lk()) && dE(c2) === dE(Age(a, RD(f2.md(), 58)))) { - return true; - } - } - } - } else { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (i2.am(f2.Lk()) && f2.md() == null) { - return false; - } - } - } - return false; - } - function wee(a, b) { - var c2, d, e, f2, g, h; - c2 = b.qi(a.a); - if (c2) { - h = WD($Nd((!c2.b && (c2.b = new SVd((JTd(), FTd), C8, c2)), c2.b), FIe)); - if (h != null) { - e = thb(h, Fhb(35)); - d = b.qk(); - if (e == -1) { - g = Uee(a, BXd(d)); - f2 = h; - } else if (e == 0) { - g = null; - f2 = (BFb(1, h.length + 1), h.substr(1)); - } else { - g = (AFb(0, e, h.length), h.substr(0, e)); - f2 = (BFb(e + 1, h.length + 1), h.substr(e + 1)); - } - switch (yfe(Qee(a, b))) { - case 2: - case 3: { - return Jee(a, d, g, f2); - } - case 0: - case 4: - case 5: - case 6: { - return Mee(a, d, g, f2); - } - } - } - } - return null; - } - function FQb(a, b, c2, d) { - var e, f2, g, h; - h = c2; - for (g = new Anb(b.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 225); - e = RD(f2.b, 68); - if ($y(a.b.c, e.b.c + e.b.b) <= 0 && $y(e.b.c, a.b.c + a.b.b) <= 0 && $y(a.b.d, e.b.d + e.b.a) <= 0 && $y(e.b.d, a.b.d + a.b.a) <= 0) { - if ($y(e.b.c, a.b.c + a.b.b) == 0 && d.a < 0 || $y(e.b.c + e.b.b, a.b.c) == 0 && d.a > 0 || $y(e.b.d, a.b.d + a.b.a) == 0 && d.b < 0 || $y(e.b.d + e.b.a, a.b.d) == 0 && d.b > 0) { - h = 0; - break; - } - } else { - h = $wnd.Math.min(h, PQb(a, e, d)); - } - h = $wnd.Math.min(h, FQb(a, f2, h, d)); - } - return h; - } - function lsd(a, b) { - var c2, d, e, f2, g, h, i2; - if (a.b < 2) { - throw Adb(new agb("The vector chain must contain at least a source and a target point.")); - } - e = (sFb(a.b != 0), RD(a.a.a.c, 8)); - Nzd(b, e.a, e.b); - i2 = new mMd((!b.a && (b.a = new XZd(D4, b, 5)), b.a)); - g = Sub(a, 1); - while (g.a < a.b - 1) { - h = RD(evb(g), 8); - if (i2.e != i2.i.gc()) { - c2 = RD(bMd(i2), 377); - } else { - c2 = (bvd(), d = new Xxd(), d); - kMd(i2, c2); - } - Uxd(c2, h.a, h.b); - } - while (i2.e != i2.i.gc()) { - bMd(i2); - cMd(i2); - } - f2 = (sFb(a.b != 0), RD(a.c.b.c, 8)); - Gzd(b, f2.a, f2.b); - } - function Ege(a, b, c2, d) { - var e, f2, g, h, i2, j; - j = pke(a.e.Dh(), b); - g = RD(a.g, 124); - if (qke(a.e, b)) { - if (b.Si()) { - f2 = kge(a, b, d, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0); - if (f2 >= 0 && f2 != c2) { - throw Adb(new agb(LIe)); - } - } - e = 0; - for (i2 = 0; i2 < a.i; ++i2) { - h = g[i2]; - if (j.am(h.Lk())) { - if (e == c2) { - return RD(eHd(a, i2, (nke(), RD(b, 69).xk() ? RD(d, 76) : oke(b, d))), 76); - } - ++e; - } - } - throw Adb(new veb(HJe + c2 + NIe + e)); - } else { - for (i2 = 0; i2 < a.i; ++i2) { - h = g[i2]; - if (j.am(h.Lk())) { - return nke(), RD(b, 69).xk() ? h : h.md(); - } - } - return null; - } - } - function Epc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - c2 = 0; - for (e = new Anb((tFb(0, a.c.length), RD(a.c[0], 105)).g.b.j); e.a < e.c.c.length; ) { - d = RD(ynb(e), 12); - d.p = c2++; - } - b == (qpd(), Yod) ? _mb(a, new Mpc()) : _mb(a, new Qpc()); - h = 0; - k = a.c.length - 1; - while (h < k) { - g = (tFb(h, a.c.length), RD(a.c[h], 105)); - j = (tFb(k, a.c.length), RD(a.c[k], 105)); - f2 = b == Yod ? g.c : g.a; - i2 = b == Yod ? j.a : j.c; - Gpc(g, b, (enc(), cnc), f2); - Gpc(j, b, bnc, i2); - ++h; - --k; - } - h == k && Gpc((tFb(h, a.c.length), RD(a.c[h], 105)), b, (enc(), anc), null); - } - function lJc(a, b, c2, d) { - var e, f2, g, h, i2, j; - g = new zJc(a, b, c2); - i2 = new Jkb(d, 0); - e = false; - while (i2.b < i2.d.gc()) { - h = (sFb(i2.b < i2.d.gc()), RD(i2.d.Xb(i2.c = i2.b++), 239)); - if (h == b || h == c2) { - Ckb(i2); - } else if (!e && Kfb(pJc(h.g, h.d[0]).a) > Kfb(pJc(g.g, g.d[0]).a)) { - sFb(i2.b > 0); - i2.a.Xb(i2.c = --i2.b); - Ikb(i2, g); - e = true; - } else if (!!h.e && h.e.gc() > 0) { - f2 = (!h.e && (h.e = new bnb()), h.e).Mc(b); - j = (!h.e && (h.e = new bnb()), h.e).Mc(c2); - if (f2 || j) { - (!h.e && (h.e = new bnb()), h.e).Fc(g); - ++g.c; - } - } - } - e || (ZEb(d.c, g), true); - } - function H3c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - l = a.a.i + a.a.g / 2; - m = a.a.i + a.a.g / 2; - o2 = b.i + b.g / 2; - q = b.j + b.f / 2; - h = new rjd(o2, q); - j = RD(Gxd(b, (umd(), Qld)), 8); - j.a = j.a + l; - j.b = j.b + m; - f2 = (h.b - j.b) / (h.a - j.a); - d = h.b - f2 * h.a; - p = c2.i + c2.g / 2; - r = c2.j + c2.f / 2; - i2 = new rjd(p, r); - k = RD(Gxd(c2, Qld), 8); - k.a = k.a + l; - k.b = k.b + m; - g = (i2.b - k.b) / (i2.a - k.a); - e = i2.b - g * i2.a; - n = (d - e) / (g - f2); - if (j.a < n && h.a < n || n < j.a && n < h.a) { - return false; - } else if (k.a < n && i2.a < n || n < k.a && n < i2.a) { - return false; - } - return true; - } - function GDd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - m = RD(Wjb(a.c, b), 190); - if (!m) { - throw Adb(new CDd("Edge did not exist in input.")); - } - j = uDd(m); - f2 = cve((!b.a && (b.a = new C5d(F4, b, 6, 6)), b.a)); - h = !f2; - if (h) { - n = new MB(); - c2 = new pFd(a, j, n); - ave((!b.a && (b.a = new C5d(F4, b, 6, 6)), b.a), c2); - sC(m, mIe, n); - } - e = Hxd(b, (umd(), cld)); - if (e) { - k = RD(Gxd(b, cld), 75); - g = !k || bve(k); - i2 = !g; - if (i2) { - l = new MB(); - d = new xFd(l); - xgb(k, d); - sC(m, "junctionPoints", l); - } - } - sDd(m, "container", kzd(b).k); - return null; - } - function fZc(a, b, c2, d) { - var e, f2, g, h, i2, j; - if (!gr(b)) { - j = c2.eh((ZD(b, 16) ? RD(b, 16).gc() : Kr(b.Kc())) / a.a | 0); - j.Ug(OEe, 1); - i2 = new iZc(); - h = 0; - if (d == (Cmd(), ymd) || d == zmd) { - for (g = b.Kc(); g.Ob(); ) { - e = RD(g.Pb(), 40); - i2 = Al(cD(WC(cJ, 1), rve, 20, 0, [i2, new dXc(e)])); - h < e.f.a && (h = e.f.a); - } - } else { - for (g = b.Kc(); g.Ob(); ) { - e = RD(g.Pb(), 40); - i2 = Al(cD(WC(cJ, 1), rve, 20, 0, [i2, new dXc(e)])); - h < e.f.b && (h = e.f.b); - } - } - for (f2 = b.Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 40); - pQb(e, (q$c(), d$c), h); - } - j.Vg(); - fZc(a, i2, c2, d); - } - } - function XFb(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - this.a = a; - this.b = b; - this.c = c2; - this.e = dv(cD(WC($M, 1), rve, 177, 0, [new TFb(a, b), new TFb(b, c2), new TFb(c2, a)])); - this.f = dv(cD(WC(l3, 1), Nve, 8, 0, [a, b, c2])); - this.d = (d = ojd(ajd(this.b), this.a), e = ojd(ajd(this.c), this.a), f2 = ojd(ajd(this.c), this.b), g = d.a * (this.a.a + this.b.a) + d.b * (this.a.b + this.b.b), h = e.a * (this.a.a + this.c.a) + e.b * (this.a.b + this.c.b), i2 = 2 * (d.a * f2.b - d.b * f2.a), j = (e.b * g - d.b * h) / i2, k = (d.a * h - e.a * g) / i2, new rjd(j, k)); - } - function X0b(a, b) { - var c2, d, e, f2, g, h; - f2 = a.c; - g = a.d; - Y0b(a, null); - Z0b(a, null); - b && Heb(TD(mQb(g, (Ywc(), mwc)))) ? Y0b(a, q2b(g.i, (BEc(), zEc), (qpd(), Xod))) : Y0b(a, g); - b && Heb(TD(mQb(f2, (Ywc(), Gwc)))) ? Z0b(a, q2b(f2.i, (BEc(), yEc), (qpd(), ppd))) : Z0b(a, f2); - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 72); - e = RD(mQb(c2, (yCc(), wAc)), 278); - e == (Omd(), Nmd) ? pQb(c2, wAc, Mmd) : e == Mmd && pQb(c2, wAc, Nmd); - } - h = Heb(TD(mQb(a, (Ywc(), Nwc)))); - pQb(a, Nwc, (Geb(), h ? false : true)); - a.a = Ijd(a.a); - } - function lWc(a, b) { - var c2, d, e, f2, g; - c2 = jWc(RD(mQb(b, (h_c(), H$c)), 88)); - if (a.b.b == 0) { - return null; - } - g = RD(zDb(GDb(new SDb(null, new Swb(a.b, 16)), new UWc()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - f2 = RD(zDb(CDb(new SDb(null, new Swb(b.b, 16)), new CWc(g)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 15); - e = UD(Lvb(JDb(GDb(f2.Oc(), new EWc(c2)), (urb(), urb(), srb)))); - d = RD(Lvb(DDb(CDb(f2.Oc(), new GWc(c2, e)))), 40); - return d; - } - function vOc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - c2 = eJb(new gJb(), a.f); - j = a.i[b.c.i.p]; - n = a.i[b.d.i.p]; - i2 = b.c; - m = b.d; - h = i2.a.b; - l = m.a.b; - j.b || (h += i2.n.b); - n.b || (l += m.n.b); - k = eE($wnd.Math.max(0, h - l)); - g = eE($wnd.Math.max(0, l - h)); - o2 = (p = $wnd.Math.max(1, RD(mQb(b, (yCc(), MBc)), 17).a), q = hOc(b.c.i.k, b.d.i.k), p * q); - e = rIb(uIb(tIb(sIb(vIb(new wIb(), o2), g), c2), RD(Wjb(a.k, b.c), 125))); - f2 = rIb(uIb(tIb(sIb(vIb(new wIb(), o2), k), c2), RD(Wjb(a.k, b.d), 125))); - d = new QOc(e, f2); - a.c[b.p] = d; - } - function MTb(a, b, c2) { - var d, e, f2, g, h, i2; - d = 0; - for (f2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); f2.e != f2.i.gc(); ) { - e = RD(bMd(f2), 27); - g = ""; - (!e.n && (e.n = new C5d(I4, e, 1, 7)), e.n).i == 0 || (g = RD(QHd((!e.n && (e.n = new C5d(I4, e, 1, 7)), e.n), 0), 135).a); - h = new lUb(g); - kQb(h, e); - pQb(h, (JVb(), HVb), e); - h.a = d++; - h.d.a = e.i + e.g / 2; - h.d.b = e.j + e.f / 2; - h.e.a = $wnd.Math.max(e.g, 1); - h.e.b = $wnd.Math.max(e.f, 1); - Rmb(b.e, h); - rtb(c2.f, e, h); - i2 = RD(Gxd(e, (yVb(), jVb)), 101); - i2 == (Bod(), Aod) && (i2 = zod); - } - } - function bec(a, b) { - var c2, d, e, f2, g, h, i2; - b.Ug("Layer constraint postprocessing", 1); - i2 = a.b; - if (i2.c.length != 0) { - d = (tFb(0, i2.c.length), RD(i2.c[0], 30)); - g = RD(Vmb(i2, i2.c.length - 1), 30); - c2 = new R4b(a); - f2 = new R4b(a); - _dc(a, d, g, c2, f2); - c2.a.c.length == 0 || (wFb(0, i2.c.length), XEb(i2.c, 0, c2)); - f2.a.c.length == 0 || (ZEb(i2.c, f2), true); - } - if (nQb(a, (Ywc(), lwc))) { - e = new R4b(a); - h = new R4b(a); - cec(a, e, h); - e.a.c.length == 0 || (wFb(0, i2.c.length), XEb(i2.c, 0, e)); - h.a.c.length == 0 || (ZEb(i2.c, h), true); - } - b.Vg(); - } - function zte(a) { - var b, c2, d; - switch (a) { - case 91: - case 93: - case 45: - case 94: - case 44: - case 92: - d = "\\" + String.fromCharCode(a & Bwe); - break; - case 12: - d = "\\f"; - break; - case 10: - d = "\\n"; - break; - case 13: - d = "\\r"; - break; - case 9: - d = "\\t"; - break; - case 27: - d = "\\e"; - break; - default: - if (a < 32) { - c2 = (b = a >>> 0, "0" + b.toString(16)); - d = "\\x" + zhb(c2, c2.length - 2, c2.length); - } else if (a >= txe) { - c2 = (b = a >>> 0, "0" + b.toString(16)); - d = "\\v" + zhb(c2, c2.length - 6, c2.length); - } else - d = "" + String.fromCharCode(a & Bwe); - } - return d; - } - function Ugc(a) { - var b, c2, d; - if (Dod(RD(mQb(a, (yCc(), BBc)), 101))) { - for (c2 = new Anb(a.j); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 12); - b.j == (qpd(), opd) && (d = RD(mQb(b, (Ywc(), Iwc)), 10), d ? Q3b(b, RD(mQb(d, hwc), 64)) : b.e.c.length - b.g.c.length < 0 ? Q3b(b, Xod) : Q3b(b, ppd)); - } - } else { - for (c2 = new Anb(a.j); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 12); - d = RD(mQb(b, (Ywc(), Iwc)), 10); - d ? Q3b(b, RD(mQb(d, hwc), 64)) : b.e.c.length - b.g.c.length < 0 ? Q3b(b, (qpd(), Xod)) : Q3b(b, (qpd(), ppd)); - } - pQb(a, BBc, (Bod(), yod)); - } - } - function wUc(a) { - var b, c2, d, e, f2, g; - this.e = new bnb(); - this.a = new bnb(); - for (c2 = a.b - 1; c2 < 3; c2++) { - hu(a, 0, RD(ju(a, 0), 8)); - } - if (a.b < 4) { - throw Adb(new agb("At (least dimension + 1) control points are necessary!")); - } else { - this.b = 3; - this.d = true; - this.c = false; - rUc(this, a.b + this.b - 1); - g = new bnb(); - f2 = new Anb(this.e); - for (b = 0; b < this.b - 1; b++) { - Rmb(g, UD(ynb(f2))); - } - for (e = Sub(a, 0); e.b != e.d.c; ) { - d = RD(evb(e), 8); - Rmb(g, UD(ynb(f2))); - Rmb(this.a, new BUc(d, g)); - tFb(0, g.c.length); - g.c.splice(0, 1); - } - } - } - function Sdc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - for (h = new Anb(e.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - if (g.k == (r3b(), n3b)) { - i2 = (j = RD(hs(new is(Mr(Z2b(g).a.Kc(), new ir()))), 18), k = RD(hs(new is(Mr(a3b(g).a.Kc(), new ir()))), 18), !Heb(TD(mQb(j, (Ywc(), Nwc)))) || !Heb(TD(mQb(k, Nwc)))) ? b : Qnd(b); - Qdc(g, i2); - } - for (d = new is(Mr(a3b(g).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - i2 = Heb(TD(mQb(c2, (Ywc(), Nwc)))) ? Qnd(b) : b; - Pdc(c2, i2); - } - } - } - } - function V8c(a, b, c2, d, e) { - var f2, g, h; - if (c2.f >= b.o && c2.f <= b.f || b.a * 0.5 <= c2.f && b.a * 1.5 >= c2.f) { - g = RD(Vmb(b.n, b.n.c.length - 1), 209); - if (g.e + g.d + c2.g + e <= d && (f2 = RD(Vmb(b.n, b.n.c.length - 1), 209), f2.f - a.f + c2.f <= a.b || a.a.c.length == 1)) { - K9c(b, c2); - return true; - } else if (b.s + c2.g <= d && (b.t + b.d + c2.f + e <= a.b || a.a.c.length == 1)) { - Rmb(b.b, c2); - h = RD(Vmb(b.n, b.n.c.length - 1), 209); - Rmb(b.n, new _9c(b.s, h.f + h.a + b.i, b.i)); - W9c(RD(Vmb(b.n, b.n.c.length - 1), 209), c2); - M9c(b, c2); - return true; - } - } - return false; - } - function xLd(a, b, c2) { - var d, e, f2, g; - if (a.Pj()) { - e = null; - f2 = a.Qj(); - d = a.Ij(1, g = UHd(a, b, c2), c2, b, f2); - if (a.Mj() && !(a.Yi() && g != null ? pb(g, c2) : dE(g) === dE(c2))) { - g != null && (e = a.Oj(g, e)); - e = a.Nj(c2, e); - a.Tj() && (e = a.Wj(g, c2, e)); - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } else { - a.Tj() && (e = a.Wj(g, c2, e)); - if (!e) { - a.Jj(d); - } else { - e.nj(d); - e.oj(); - } - } - return g; - } else { - g = UHd(a, b, c2); - if (a.Mj() && !(a.Yi() && g != null ? pb(g, c2) : dE(g) === dE(c2))) { - e = null; - g != null && (e = a.Oj(g, null)); - e = a.Nj(c2, e); - !!e && e.oj(); - } - return g; - } - } - function Rsc(a, b) { - var c2, d, e, f2, g; - b.Ug("Path-Like Graph Wrapping", 1); - if (a.b.c.length == 0) { - b.Vg(); - return; - } - e = new ysc(a); - g = (e.i == null && (e.i = tsc(e, new Asc())), Kfb(e.i) * e.f); - c2 = g / (e.i == null && (e.i = tsc(e, new Asc())), Kfb(e.i)); - if (e.b > c2) { - b.Vg(); - return; - } - switch (RD(mQb(a, (yCc(), rCc)), 351).g) { - case 2: - f2 = new Ksc(); - break; - case 0: - f2 = new zrc(); - break; - default: - f2 = new Nsc(); - } - d = f2.og(a, e); - if (!f2.pg()) { - switch (RD(mQb(a, xCc), 352).g) { - case 2: - d = Wsc(e, d); - break; - case 1: - d = Usc(e, d); - } - } - Qsc(a, e, d); - b.Vg(); - } - function mB(a, b) { - var c2, d, e, f2, g, h, i2, j; - b %= 24; - if (a.q.getHours() != b) { - d = new $wnd.Date(a.q.getTime()); - d.setDate(d.getDate() + 1); - h = a.q.getTimezoneOffset() - d.getTimezoneOffset(); - if (h > 0) { - i2 = h / 60 | 0; - j = h % 60; - e = a.q.getDate(); - c2 = a.q.getHours(); - c2 + i2 >= 24 && ++e; - f2 = new $wnd.Date(a.q.getFullYear(), a.q.getMonth(), e, b + i2, a.q.getMinutes() + j, a.q.getSeconds(), a.q.getMilliseconds()); - a.q.setTime(f2.getTime()); - } - } - g = a.q.getTime(); - a.q.setTime(g + 36e5); - a.q.getHours() != b && a.q.setTime(g); - } - function kKc(a, b) { - var c2, d, e, f2; - Nwb(a.d, a.e); - a.c.a.$b(); - if (Kfb(UD(mQb(b.j, (yCc(), Zzc)))) != 0 || Kfb(UD(mQb(b.j, Zzc))) != 0) { - c2 = Hze; - dE(mQb(b.j, cAc)) !== dE((kEc(), hEc)) && pQb(b.j, (Ywc(), jwc), (Geb(), true)); - f2 = RD(mQb(b.j, gCc), 17).a; - for (e = 0; e < f2; e++) { - d = uKc(a, b); - if (d < c2) { - c2 = d; - xKc(a); - if (c2 == 0) { - break; - } - } - } - } else { - c2 = lve; - dE(mQb(b.j, cAc)) !== dE((kEc(), hEc)) && pQb(b.j, (Ywc(), jwc), (Geb(), true)); - f2 = RD(mQb(b.j, gCc), 17).a; - for (e = 0; e < f2; e++) { - d = vKc(a, b); - if (d < c2) { - c2 = d; - xKc(a); - if (c2 == 0) { - break; - } - } - } - } - } - function Vsc(a, b) { - var c2, d, e, f2, g, h, i2, j; - g = new bnb(); - h = 0; - c2 = 0; - i2 = 0; - while (h < b.c.length - 1 && c2 < a.gc()) { - d = RD(a.Xb(c2), 17).a + i2; - while ((tFb(h + 1, b.c.length), RD(b.c[h + 1], 17)).a < d) { - ++h; - } - j = 0; - f2 = d - (tFb(h, b.c.length), RD(b.c[h], 17)).a; - e = (tFb(h + 1, b.c.length), RD(b.c[h + 1], 17)).a - d; - f2 > e && ++j; - Rmb(g, (tFb(h + j, b.c.length), RD(b.c[h + j], 17))); - i2 += (tFb(h + j, b.c.length), RD(b.c[h + j], 17)).a - d; - ++c2; - while (c2 < a.gc() && RD(a.Xb(c2), 17).a + i2 <= (tFb(h + j, b.c.length), RD(b.c[h + j], 17)).a) { - ++c2; - } - h += 1 + j; - } - return g; - } - function VGc(a, b) { - var c2, d, e, f2, g; - for (g = new is(Mr(Z2b(b).a.Kc(), new ir())); gs(g); ) { - f2 = RD(hs(g), 18); - if (a.f.b == 0) { - e = f2.c.i.k == (r3b(), p3b) && !!f2.c.i.c && f2.c.i.c.p == a.c; - if (gs(new is(Mr(Z2b(f2.c.i).a.Kc(), new ir())))) { - c2 = RD(hs(new is(Mr(Z2b(f2.c.i).a.Kc(), new ir()))), 18).c.i.c; - d = f2.c.i.k == n3b && !!c2 && c2.p == a.c; - } else { - d = false; - } - } else { - e = f2.c.i.k == (r3b(), p3b) && f2.c.i.p == a.c; - d = f2.c.i.k == n3b && RD(hs(new is(Mr(Z2b(f2.c.i).a.Kc(), new ir()))), 18).c.i.p == a.c; - } - if (e || d) { - return true; - } - } - return false; - } - function DHc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - m = new bnb(); - r = Xx(d); - q = b * a.a; - l = 0; - o2 = 0; - f2 = new _sb(); - g = new _sb(); - h = new bnb(); - s = 0; - t = 0; - n = 0; - p = 0; - j = 0; - k = 0; - while (r.a.gc() != 0) { - i2 = HHc(r, e, g); - if (i2) { - r.a.Bc(i2) != null; - ZEb(h.c, i2); - f2.a.zc(i2, f2); - o2 = a.f[i2.p]; - s += a.e[i2.p] - o2 * a.b; - l = a.c[i2.p]; - t += l * a.b; - k += o2 * a.b; - p += a.e[i2.p]; - } - if (!i2 || r.a.gc() == 0 || s >= q && a.e[i2.p] > o2 * a.b || t >= c2 * q) { - ZEb(m.c, h); - h = new bnb(); - ye(g, f2); - f2.a.$b(); - j -= k; - n = $wnd.Math.max(n, j * a.b + p); - j += t; - s = t; - t = 0; - k = 0; - p = 0; - } - } - return new Ptd(n, m); - } - function pYd(a) { - var b, c2, d, e, f2, g, h; - if (!a.d) { - h = new v_d(); - b = iYd; - f2 = b.a.zc(a, b); - if (f2 == null) { - for (d = new dMd(zYd(a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 29); - YGd(h, pYd(c2)); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - g = h.i; - for (e = (!a.q && (a.q = new C5d(s7, a, 11, 10)), new dMd(a.q)); e.e != e.i.gc(); ++g) { - RD(bMd(e), 411); - } - YGd(h, (!a.q && (a.q = new C5d(s7, a, 11, 10)), a.q)); - VHd(h); - a.d = new N$d((RD(QHd(xYd((lTd(), kTd).o), 9), 19), h.i), h.g); - a.e = RD(h.g, 688); - a.e == null && (a.e = jYd); - yYd(a).b &= -17; - } - return a.d; - } - function kge(a, b, c2, d) { - var e, f2, g, h, i2, j; - j = pke(a.e.Dh(), b); - i2 = 0; - e = RD(a.g, 124); - nke(); - if (RD(b, 69).xk()) { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (j.am(f2.Lk())) { - if (pb(f2, c2)) { - return i2; - } - ++i2; - } - } - } else if (c2 != null) { - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - if (j.am(f2.Lk())) { - if (pb(c2, f2.md())) { - return i2; - } - ++i2; - } - } - if (d) { - i2 = 0; - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (j.am(f2.Lk())) { - if (dE(c2) === dE(Age(a, RD(f2.md(), 58)))) { - return i2; - } - ++i2; - } - } - } - } else { - for (g = 0; g < a.i; ++g) { - f2 = e[g]; - if (j.am(f2.Lk())) { - if (f2.md() == null) { - return i2; - } - ++i2; - } - } - } - return -1; - } - function Xje(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p; - if (c2.Xh(b)) { - k = (n = b, !n ? null : RD(d, 54).gi(n)); - if (k) { - p = c2.Nh(b, a.a); - o2 = b.t; - if (o2 > 1 || o2 == -1) { - l = RD(p, 71); - m = RD(k, 71); - if (l.dc()) { - m.$b(); - } else { - g = !!Z5d(b); - f2 = 0; - for (h = a.a ? l.Kc() : l.Ii(); h.Ob(); ) { - j = RD(h.Pb(), 58); - e = RD(cub(a, j), 58); - if (!e) { - if (a.b && !g) { - m.Gi(f2, j); - ++f2; - } - } else { - if (g) { - i2 = m.dd(e); - i2 == -1 ? m.Gi(f2, e) : f2 != i2 && m.Ui(f2, e); - } else { - m.Gi(f2, e); - } - ++f2; - } - } - } - } else { - if (p == null) { - k.Wb(null); - } else { - e = cub(a, p); - e == null ? a.b && !Z5d(b) && k.Wb(p) : k.Wb(e); - } - } - } - } - } - function V9b(a, b) { - var c2, d, e, f2, g, h, i2, j; - c2 = new aac(); - for (e = new is(Mr(Z2b(b).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - if (W0b(d)) { - continue; - } - h = d.c.i; - if (W9b(h, T9b)) { - j = X9b(a, h, T9b, S9b); - if (j == -1) { - continue; - } - c2.b = $wnd.Math.max(c2.b, j); - !c2.a && (c2.a = new bnb()); - Rmb(c2.a, h); - } - } - for (g = new is(Mr(a3b(b).a.Kc(), new ir())); gs(g); ) { - f2 = RD(hs(g), 18); - if (W0b(f2)) { - continue; - } - i2 = f2.d.i; - if (W9b(i2, S9b)) { - j = X9b(a, i2, S9b, T9b); - if (j == -1) { - continue; - } - c2.d = $wnd.Math.max(c2.d, j); - !c2.c && (c2.c = new bnb()); - Rmb(c2.c, i2); - } - } - return c2; - } - function pcc(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - if (c2.d.i == b.i) { - return; - } - e = new j3b(a); - h3b(e, (r3b(), o3b)); - pQb(e, (Ywc(), Awc), c2); - pQb(e, (yCc(), BBc), (Bod(), wod)); - ZEb(d.c, e); - g = new R3b(); - P3b(g, e); - Q3b(g, (qpd(), ppd)); - h = new R3b(); - P3b(h, e); - Q3b(h, Xod); - k = c2.d; - Z0b(c2, g); - f2 = new a1b(); - kQb(f2, c2); - pQb(f2, RAc, null); - Y0b(f2, h); - Z0b(f2, k); - j = new Jkb(c2.b, 0); - while (j.b < j.d.gc()) { - i2 = (sFb(j.b < j.d.gc()), RD(j.d.Xb(j.c = j.b++), 72)); - if (dE(mQb(i2, wAc)) === dE((Omd(), Mmd))) { - pQb(i2, dwc, c2); - Ckb(j); - Rmb(f2.b, i2); - } - } - rcc(e, g, h); - } - function occ(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - if (c2.c.i == b.i) { - return; - } - e = new j3b(a); - h3b(e, (r3b(), o3b)); - pQb(e, (Ywc(), Awc), c2); - pQb(e, (yCc(), BBc), (Bod(), wod)); - ZEb(d.c, e); - g = new R3b(); - P3b(g, e); - Q3b(g, (qpd(), ppd)); - h = new R3b(); - P3b(h, e); - Q3b(h, Xod); - Z0b(c2, g); - f2 = new a1b(); - kQb(f2, c2); - pQb(f2, RAc, null); - Y0b(f2, h); - Z0b(f2, b); - rcc(e, g, h); - j = new Jkb(c2.b, 0); - while (j.b < j.d.gc()) { - i2 = (sFb(j.b < j.d.gc()), RD(j.d.Xb(j.c = j.b++), 72)); - k = RD(mQb(i2, wAc), 278); - if (k == (Omd(), Mmd)) { - nQb(i2, dwc) || pQb(i2, dwc, c2); - Ckb(j); - Rmb(f2.b, i2); - } - } - } - function Sjb(a) { - Ljb(); - var b, c2, d, e; - b = eE(a); - if (a < Kjb.length) { - return Kjb[b]; - } else if (a <= 50) { - return Yib((Pib(), Mib), b); - } else if (a <= Awe) { - return Zib(Yib(Jjb[1], b), b); - } - if (a > 1e6) { - throw Adb(new teb("power of ten too big")); - } - if (a <= lve) { - return Zib(Yib(Jjb[1], b), b); - } - d = Yib(Jjb[1], lve); - e = d; - c2 = Hdb(a - lve); - b = eE(a % lve); - while (Ddb(c2, lve) > 0) { - e = Wib(e, d); - c2 = Vdb(c2, lve); - } - e = Wib(e, Yib(Jjb[1], b)); - e = Zib(e, lve); - c2 = Hdb(a - lve); - while (Ddb(c2, lve) > 0) { - e = Zib(e, lve); - c2 = Vdb(c2, lve); - } - e = Zib(e, b); - return e; - } - function s9b(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - for (i2 = new Anb(a.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - if (h.k != (r3b(), m3b)) { - continue; - } - e = RD(mQb(h, (Ywc(), hwc)), 64); - if (e == (qpd(), Xod) || e == ppd) { - for (d = new is(Mr(W2b(h).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - b = c2.a; - if (b.b == 0) { - continue; - } - j = c2.c; - if (j.i == h) { - f2 = (sFb(b.b != 0), RD(b.a.a.c, 8)); - f2.b = xjd(cD(WC(l3, 1), Nve, 8, 0, [j.i.n, j.n, j.a])).b; - } - k = c2.d; - if (k.i == h) { - g = (sFb(b.b != 0), RD(b.c.b.c, 8)); - g.b = xjd(cD(WC(l3, 1), Nve, 8, 0, [k.i.n, k.n, k.a])).b; - } - } - } - } - } - function Nlc(a, b, c2, d) { - var e, f2, g; - this.j = new bnb(); - this.k = new bnb(); - this.b = new bnb(); - this.c = new bnb(); - this.e = new Tid(); - this.i = new Ejd(); - this.f = new cHb(); - this.d = new bnb(); - this.g = new bnb(); - Rmb(this.b, a); - Rmb(this.b, b); - this.e.c = $wnd.Math.min(a.a, b.a); - this.e.d = $wnd.Math.min(a.b, b.b); - this.e.b = $wnd.Math.abs(a.a - b.a); - this.e.a = $wnd.Math.abs(a.b - b.b); - e = RD(mQb(d, (yCc(), RAc)), 75); - if (e) { - for (g = Sub(e, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 8); - rGb(f2.a, a.a) && Mub(this.i, f2); - } - } - !!c2 && Rmb(this.j, c2); - Rmb(this.k, d); - } - function vSc(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - h = -1; - for (k = new Anb(a); k.a < k.c.c.length; ) { - j = RD(ynb(k), 118); - j.g = h--; - e = Ydb(mDb(IDb(CDb(new SDb(null, new Swb(j.f, 16)), new xSc()), new zSc())).d); - f2 = Ydb(mDb(IDb(CDb(new SDb(null, new Swb(j.k, 16)), new BSc()), new DSc())).d); - g = e; - i2 = f2; - if (!d) { - g = Ydb(mDb(IDb(new SDb(null, new Swb(j.f, 16)), new FSc())).d); - i2 = Ydb(mDb(IDb(new SDb(null, new Swb(j.k, 16)), new HSc())).d); - } - j.d = g; - j.a = e; - j.i = i2; - j.b = f2; - i2 == 0 ? (Pub(c2, j, c2.c.b, c2.c), true) : g == 0 && (Pub(b, j, b.c.b, b.c), true); - } - } - function Qdc(a, b) { - var c2, d, e, f2, g, h; - if (a.k == (r3b(), n3b)) { - c2 = a.k == n3b && !QDb(CDb(RD(mQb(a, (Ywc(), Mwc)), 15).Oc(), new PAb(new x3b()))).Bd((xDb(), wDb)) ? (Pnd(), Nnd) : b; - pQb(a, (Ywc(), swc), c2); - if (c2 != (Pnd(), Mnd)) { - d = RD(mQb(a, Awc), 18); - h = Kfb(UD(mQb(d, (yCc(), FAc)))); - g = 0; - if (c2 == Lnd) { - g = a.o.b - $wnd.Math.ceil(h / 2); - } else if (c2 == Nnd) { - g = $wnd.Math.ceil(a.o.b - Kfb(UD(mQb(Y2b(a), VBc))) - h) / 2; - a.o.b -= Kfb(UD(mQb(Y2b(a), VBc))); - a.o.b -= h; - } - for (f2 = new Anb(a.j); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 12); - e.n.b = g; - } - } - } - } - function XQc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - e = true; - for (g = new Anb(a.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - j = pxe; - k = null; - for (i2 = new Anb(f2.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - l = Kfb(b.p[h.p]) + Kfb(b.d[h.p]) - h.d.d; - d = Kfb(b.p[h.p]) + Kfb(b.d[h.p]) + h.o.b + h.d.a; - if (l > j && d > j) { - k = h; - j = Kfb(b.p[h.p]) + Kfb(b.d[h.p]) + h.o.b + h.d.a; - } else { - e = false; - c2._g() && c2.bh("bk node placement breaks on " + h + " which should have been after " + k); - break; - } - } - if (!e) { - break; - } - } - c2._g() && c2.bh(b + " is feasible: " + e); - return e; - } - function Dfc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m; - f2 = new j3b(a); - h3b(f2, (r3b(), q3b)); - pQb(f2, (yCc(), BBc), (Bod(), wod)); - e = 0; - if (b) { - g = new R3b(); - pQb(g, (Ywc(), Awc), b); - pQb(f2, Awc, b.i); - Q3b(g, (qpd(), ppd)); - P3b(g, f2); - m = s2b(b.e); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i2 = j[k]; - Z0b(i2, g); - } - pQb(b, Iwc, f2); - ++e; - } - if (c2) { - h = new R3b(); - pQb(f2, (Ywc(), Awc), c2.i); - pQb(h, Awc, c2); - Q3b(h, (qpd(), Xod)); - P3b(h, f2); - m = s2b(c2.g); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i2 = j[k]; - Y0b(i2, h); - } - pQb(c2, Iwc, f2); - ++e; - } - pQb(f2, (Ywc(), $vc), sgb(e)); - ZEb(d.c, f2); - return f2; - } - function Bgd(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - for (c2 = (j = new glb(a.c.b).a.vc().Kc(), new llb(j)); c2.a.Ob(); ) { - b = (h = RD(c2.a.Pb(), 44), RD(h.md(), 143)); - e = b.a; - e == null && (e = ""); - d = tgd(a.c, e); - !d && e.length == 0 && (d = Fgd(a)); - !!d && !ze(d.c, b, false) && Mub(d.c, b); - } - for (g = Sub(a.a, 0); g.b != g.d.c; ) { - f2 = RD(evb(g), 487); - k = ugd(a.c, f2.a); - n = ugd(a.c, f2.b); - !!k && !!n && Mub(k.c, new Ptd(n, f2.c)); - } - Xub(a.a); - for (m = Sub(a.b, 0); m.b != m.d.c; ) { - l = RD(evb(m), 487); - b = rgd(a.c, l.a); - i2 = ugd(a.c, l.b); - !!b && !!i2 && Mfd(b, i2, l.c); - } - Xub(a.b); - } - function QId(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - f2 = new vC(a); - g = new IEd(); - e = (wo(g.g), wo(g.j), akb(g.b), wo(g.d), wo(g.i), akb(g.k), akb(g.c), akb(g.e), n = DEd(g, f2, null), AEd(g, f2), n); - if (b) { - j = new vC(b); - h = RId(j); - msd(e, cD(WC(j4, 1), rve, 536, 0, [h])); - } - m = false; - l = false; - if (c2) { - j = new vC(c2); - RIe in j.a && (m = qC(j, RIe).qe().a); - SIe in j.a && (l = qC(j, SIe).qe().a); - } - k = Kqd(Mqd(new Oqd(), m), l); - Eed(new Hed(), e, k); - RIe in f2.a && sC(f2, RIe, null); - if (m || l) { - i2 = new uC(); - NId(k, i2, m, l); - sC(f2, RIe, i2); - } - d = new nFd(g); - dve(new zId(e), d); - } - function FA(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - g = new DB(); - j = cD(WC(kE, 1), Pwe, 28, 15, [0]); - e = -1; - f2 = 0; - d = 0; - for (i2 = 0; i2 < a.b.c.length; ++i2) { - k = RD(Vmb(a.b, i2), 443); - if (k.b > 0) { - if (e < 0 && k.a) { - e = i2; - f2 = j[0]; - d = 0; - } - if (e >= 0) { - h = k.b; - if (i2 == e) { - h -= d++; - if (h == 0) { - return 0; - } - } - if (!MA(b, j, k, h, g)) { - i2 = e - 1; - j[0] = f2; - continue; - } - } else { - e = -1; - if (!MA(b, j, k, 0, g)) { - return 0; - } - } - } else { - e = -1; - if (ihb(k.c, 0) == 32) { - l = j[0]; - KA(b, j); - if (j[0] > l) { - continue; - } - } else if (xhb(b, k.c, j[0])) { - j[0] += k.c.length; - continue; - } - return 0; - } - } - if (!CB(g, c2)) { - return 0; - } - return j[0]; - } - function qWb(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - k = new pwb(new GWb(c2)); - h = $C(xdb, Hye, 28, a.f.e.c.length, 16, 1); - Snb(h, h.length); - c2[b.a] = 0; - for (j = new Anb(a.f.e); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 153); - i2.a != b.a && (c2[i2.a] = lve); - zFb(lwb(k, i2), Bxe); - } - while (k.b.c.length != 0) { - l = RD(mwb(k), 153); - h[l.a] = true; - for (f2 = ru(new su(a.b, l), 0); f2.c; ) { - e = RD(Lu(f2), 290); - m = tWb(e, l); - if (h[m.a]) { - continue; - } - nQb(e, (dWb(), TVb)) ? g = Kfb(UD(mQb(e, TVb))) : g = a.c; - d = c2[l.a] + g; - if (d < c2[m.a]) { - c2[m.a] = d; - nwb(k, m); - zFb(lwb(k, m), Bxe); - } - } - } - } - function iPb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - g = a.o; - d = $C(kE, Pwe, 28, g, 15, 1); - e = $C(kE, Pwe, 28, g, 15, 1); - c2 = a.p; - b = $C(kE, Pwe, 28, c2, 15, 1); - f2 = $C(kE, Pwe, 28, c2, 15, 1); - for (j = 0; j < g; j++) { - l = 0; - while (l < c2 && !PPb(a, j, l)) { - ++l; - } - d[j] = l; - } - for (k = 0; k < g; k++) { - l = c2 - 1; - while (l >= 0 && !PPb(a, k, l)) { - --l; - } - e[k] = l; - } - for (n = 0; n < c2; n++) { - h = 0; - while (h < g && !PPb(a, h, n)) { - ++h; - } - b[n] = h; - } - for (o2 = 0; o2 < c2; o2++) { - h = g - 1; - while (h >= 0 && !PPb(a, h, o2)) { - --h; - } - f2[o2] = h; - } - for (i2 = 0; i2 < g; i2++) { - for (m = 0; m < c2; m++) { - i2 < f2[m] && i2 > b[m] && m < e[i2] && m > d[i2] && TPb(a, i2, m, false, true); - } - } - } - function hUb(a) { - var b, c2, d, e, f2, g, h, i2; - c2 = Heb(TD(mQb(a, (yVb(), $Ub)))); - f2 = a.a.c.d; - h = a.a.d.d; - if (c2) { - g = ijd(ojd(new rjd(h.a, h.b), f2), 0.5); - i2 = ijd(ajd(a.e), 0.5); - b = ojd($id(new rjd(f2.a, f2.b), g), i2); - mjd(a.d, b); - } else { - e = Kfb(UD(mQb(a.a, qVb))); - d = a.d; - if (f2.a >= h.a) { - if (f2.b >= h.b) { - d.a = h.a + (f2.a - h.a) / 2 + e; - d.b = h.b + (f2.b - h.b) / 2 - e - a.e.b; - } else { - d.a = h.a + (f2.a - h.a) / 2 + e; - d.b = f2.b + (h.b - f2.b) / 2 + e; - } - } else { - if (f2.b >= h.b) { - d.a = f2.a + (h.a - f2.a) / 2 + e; - d.b = h.b + (f2.b - h.b) / 2 + e; - } else { - d.a = f2.a + (h.a - f2.a) / 2 + e; - d.b = f2.b + (h.b - f2.b) / 2 - e - a.e.b; - } - } - } - } - function qYd(a) { - var b, c2, d, e, f2, g, h, i2; - if (!a.f) { - i2 = new a_d(); - h = new a_d(); - b = iYd; - g = b.a.zc(a, b); - if (g == null) { - for (f2 = new dMd(zYd(a)); f2.e != f2.i.gc(); ) { - e = RD(bMd(f2), 29); - YGd(i2, qYd(e)); - } - b.a.Bc(a) != null; - b.a.gc() == 0 && void 0; - } - for (d = (!a.s && (a.s = new C5d(y7, a, 21, 17)), new dMd(a.s)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 179); - ZD(c2, 102) && WGd(h, RD(c2, 19)); - } - VHd(h); - a.r = new s_d(a, (RD(QHd(xYd((lTd(), kTd).o), 6), 19), h.i), h.g); - YGd(i2, a.r); - VHd(i2); - a.f = new N$d((RD(QHd(xYd(kTd.o), 5), 19), i2.i), i2.g); - yYd(a).b &= -3; - } - return a.f; - } - function uSb(a) { - Cgd(a, new Pfd($fd(Xfd(Zfd(Yfd(new agd(), Aze), "ELK DisCo"), "Layouter for arranging unconnected subgraphs. The subgraphs themselves are, by default, not laid out."), new xSb()))); - Agd(a, Aze, Bze, iGd(sSb)); - Agd(a, Aze, Cze, iGd(mSb)); - Agd(a, Aze, Dze, iGd(hSb)); - Agd(a, Aze, Eze, iGd(nSb)); - Agd(a, Aze, Bye, iGd(qSb)); - Agd(a, Aze, Cye, iGd(pSb)); - Agd(a, Aze, Aye, iGd(rSb)); - Agd(a, Aze, Dye, iGd(oSb)); - Agd(a, Aze, vze, iGd(jSb)); - Agd(a, Aze, wze, iGd(iSb)); - Agd(a, Aze, xze, iGd(kSb)); - Agd(a, Aze, yze, iGd(lSb)); - } - function qAd() { - qAd = geb; - oAd = cD(WC(hE, 1), zwe, 28, 15, [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70]); - pAd = new RegExp("[ \n\r\f]+"); - try { - nAd = cD(WC(h8, 1), rve, 2114, 0, [new c2d((WA(), YA("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ", _A(($A(), $A(), ZA))))), new c2d(YA("yyyy-MM-dd'T'HH:mm:ss'.'SSS", _A((null, ZA)))), new c2d(YA("yyyy-MM-dd'T'HH:mm:ss", _A((null, ZA)))), new c2d(YA("yyyy-MM-dd'T'HH:mm", _A((null, ZA)))), new c2d(YA("yyyy-MM-dd", _A((null, ZA))))]); - } catch (a) { - a = zdb(a); - if (!ZD(a, 82)) - throw Adb(a); - } - } - function uKc(a, b) { - var c2, d, e, f2; - e = Kwb(a.d, 1) != 0; - d = mKc(a, b); - if (d == 0 && Heb(TD(mQb(b.j, (Ywc(), jwc))))) { - return 0; - } - !Heb(TD(mQb(b.j, (Ywc(), jwc)))) && !Heb(TD(mQb(b.j, Owc))) || dE(mQb(b.j, (yCc(), cAc))) === dE((kEc(), hEc)) ? b.c.mg(b.e, e) : e = Heb(TD(mQb(b.j, jwc))); - DKc(a, b, e, true); - Heb(TD(mQb(b.j, Owc))) && pQb(b.j, Owc, (Geb(), false)); - if (Heb(TD(mQb(b.j, jwc)))) { - pQb(b.j, jwc, (Geb(), false)); - pQb(b.j, Owc, true); - } - c2 = mKc(a, b); - do { - yKc(a); - if (c2 == 0) { - return 0; - } - e = !e; - f2 = c2; - DKc(a, b, e, false); - c2 = mKc(a, b); - } while (f2 > c2); - return f2; - } - function vKc(a, b) { - var c2, d, e, f2; - e = Kwb(a.d, 1) != 0; - d = lKc(a, b); - if (d == 0 && Heb(TD(mQb(b.j, (Ywc(), jwc))))) { - return 0; - } - !Heb(TD(mQb(b.j, (Ywc(), jwc)))) && !Heb(TD(mQb(b.j, Owc))) || dE(mQb(b.j, (yCc(), cAc))) === dE((kEc(), hEc)) ? b.c.mg(b.e, e) : e = Heb(TD(mQb(b.j, jwc))); - DKc(a, b, e, true); - Heb(TD(mQb(b.j, Owc))) && pQb(b.j, Owc, (Geb(), false)); - if (Heb(TD(mQb(b.j, jwc)))) { - pQb(b.j, jwc, (Geb(), false)); - pQb(b.j, Owc, true); - } - c2 = lKc(a, b); - do { - yKc(a); - if (c2 == 0) { - return 0; - } - e = !e; - f2 = c2; - DKc(a, b, e, false); - c2 = lKc(a, b); - } while (f2 > c2); - return f2; - } - function Gid(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m; - i2 = ojd(new rjd(c2.a, c2.b), a); - j = i2.a * b.b - i2.b * b.a; - k = b.a * d.b - b.b * d.a; - l = (i2.a * d.b - i2.b * d.a) / k; - m = j / k; - if (k == 0) { - if (j == 0) { - e = $id(new rjd(c2.a, c2.b), ijd(new rjd(d.a, d.b), 0.5)); - f2 = bjd(a, e); - g = bjd($id(new rjd(a.a, a.b), b), e); - h = $wnd.Math.sqrt(d.a * d.a + d.b * d.b) * 0.5; - if (f2 < g && f2 <= h) { - return new rjd(a.a, a.b); - } - if (g <= h) { - return $id(new rjd(a.a, a.b), b); - } - return null; - } else { - return null; - } - } else { - return l >= 0 && l <= 1 && m >= 0 && m <= 1 ? $id(new rjd(a.a, a.b), ijd(new rjd(b.a, b.b), l)) : null; - } - } - function QWb(a, b, c2) { - var d, e, f2, g, h; - d = RD(mQb(a, (yCc(), dAc)), 21); - c2.a > b.a && (d.Hc((ukd(), okd)) ? a.c.a += (c2.a - b.a) / 2 : d.Hc(qkd) && (a.c.a += c2.a - b.a)); - c2.b > b.b && (d.Hc((ukd(), skd)) ? a.c.b += (c2.b - b.b) / 2 : d.Hc(rkd) && (a.c.b += c2.b - b.b)); - if (RD(mQb(a, (Ywc(), kwc)), 21).Hc((ovc(), hvc)) && (c2.a > b.a || c2.b > b.b)) { - for (h = new Anb(a.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - if (g.k == (r3b(), m3b)) { - e = RD(mQb(g, hwc), 64); - e == (qpd(), Xod) ? g.n.a += c2.a - b.a : e == npd && (g.n.b += c2.b - b.b); - } - } - } - f2 = a.d; - a.f.a = c2.a - f2.b - f2.c; - a.f.b = c2.b - f2.d - f2.a; - } - function Y8b(a, b, c2) { - var d, e, f2, g, h; - d = RD(mQb(a, (yCc(), dAc)), 21); - c2.a > b.a && (d.Hc((ukd(), okd)) ? a.c.a += (c2.a - b.a) / 2 : d.Hc(qkd) && (a.c.a += c2.a - b.a)); - c2.b > b.b && (d.Hc((ukd(), skd)) ? a.c.b += (c2.b - b.b) / 2 : d.Hc(rkd) && (a.c.b += c2.b - b.b)); - if (RD(mQb(a, (Ywc(), kwc)), 21).Hc((ovc(), hvc)) && (c2.a > b.a || c2.b > b.b)) { - for (g = new Anb(a.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - if (f2.k == (r3b(), m3b)) { - e = RD(mQb(f2, hwc), 64); - e == (qpd(), Xod) ? f2.n.a += c2.a - b.a : e == npd && (f2.n.b += c2.b - b.b); - } - } - } - h = a.d; - a.f.a = c2.a - h.b - h.c; - a.f.b = c2.b - h.d - h.a; - } - function KQc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - b = bRc(a); - for (k = (h = new Xkb(b).a.vc().Kc(), new blb(h)); k.a.Ob(); ) { - j = (e = RD(k.a.Pb(), 44), RD(e.ld(), 10)); - l = 0; - m = 0; - l = j.d.d; - m = j.o.b + j.d.a; - a.d[j.p] = 0; - c2 = j; - while ((f2 = a.a[c2.p]) != j) { - d = dRc(c2, f2); - i2 = 0; - a.c == (wQc(), uQc) ? i2 = d.d.n.b + d.d.a.b - d.c.n.b - d.c.a.b : i2 = d.c.n.b + d.c.a.b - d.d.n.b - d.d.a.b; - g = Kfb(a.d[c2.p]) + i2; - a.d[f2.p] = g; - l = $wnd.Math.max(l, f2.d.d - g); - m = $wnd.Math.max(m, g + f2.o.b + f2.d.a); - c2 = f2; - } - c2 = j; - do { - a.d[c2.p] = Kfb(a.d[c2.p]) + l; - c2 = a.a[c2.p]; - } while (c2 != j); - a.b[j.p] = l + m; - } - } - function S9c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - f2 = 0; - g = a.t; - e = 0; - d = 0; - i2 = 0; - m = 0; - l = 0; - if (c2) { - a.n.c.length = 0; - Rmb(a.n, new _9c(a.s, a.t, a.i)); - } - h = 0; - for (k = new Anb(a.b); k.a < k.c.c.length; ) { - j = RD(ynb(k), 27); - if (f2 + j.g + (h > 0 ? a.i : 0) > b && i2 > 0) { - f2 = 0; - g += i2 + a.i; - e = $wnd.Math.max(e, m); - d += i2 + a.i; - i2 = 0; - m = 0; - if (c2) { - ++l; - Rmb(a.n, new _9c(a.s, g, a.i)); - } - h = 0; - } - m += j.g + (h > 0 ? a.i : 0); - i2 = $wnd.Math.max(i2, j.f); - c2 && W9c(RD(Vmb(a.n, l), 209), j); - f2 += j.g + (h > 0 ? a.i : 0); - ++h; - } - e = $wnd.Math.max(e, m); - d += i2; - if (c2) { - a.r = e; - a.d = d; - Ead(a.j); - } - return new Uid2(a.s, a.t, e, d); - } - function CRb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - a.b = false; - l = oxe; - i2 = pxe; - m = oxe; - j = pxe; - for (d = a.e.a.ec().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 272); - e = c2.a; - l = $wnd.Math.min(l, e.c); - i2 = $wnd.Math.max(i2, e.c + e.b); - m = $wnd.Math.min(m, e.d); - j = $wnd.Math.max(j, e.d + e.a); - for (g = new Anb(c2.c); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 407); - b = f2.a; - if (b.a) { - k = e.d + f2.b.b; - h = k + f2.c; - m = $wnd.Math.min(m, k); - j = $wnd.Math.max(j, h); - } else { - k = e.c + f2.b.a; - h = k + f2.c; - l = $wnd.Math.min(l, k); - i2 = $wnd.Math.max(i2, h); - } - } - } - a.a = new rjd(i2 - l, j - m); - a.c = new rjd(l + a.d.a, m + a.d.b); - } - function mYd(a) { - var b, c2, d, e, f2, g, h, i2; - if (!a.a) { - a.o = null; - i2 = new e_d(a); - b = new i_d(); - c2 = iYd; - h = c2.a.zc(a, c2); - if (h == null) { - for (g = new dMd(zYd(a)); g.e != g.i.gc(); ) { - f2 = RD(bMd(g), 29); - YGd(i2, mYd(f2)); - } - c2.a.Bc(a) != null; - c2.a.gc() == 0 && void 0; - } - for (e = (!a.s && (a.s = new C5d(y7, a, 21, 17)), new dMd(a.s)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 179); - ZD(d, 331) && WGd(b, RD(d, 35)); - } - VHd(b); - a.k = new n_d(a, (RD(QHd(xYd((lTd(), kTd).o), 7), 19), b.i), b.g); - YGd(i2, a.k); - VHd(i2); - a.a = new N$d((RD(QHd(xYd(kTd.o), 4), 19), i2.i), i2.g); - yYd(a).b &= -2; - } - return a.a; - } - function age(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - k = pke(a.e.Dh(), b); - e = 0; - f2 = RD(a.g, 124); - i2 = null; - nke(); - if (RD(b, 69).xk()) { - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (k.am(g.Lk())) { - if (pb(g, c2)) { - i2 = g; - break; - } - ++e; - } - } - } else if (c2 != null) { - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (k.am(g.Lk())) { - if (pb(c2, g.md())) { - i2 = g; - break; - } - ++e; - } - } - } else { - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (k.am(g.Lk())) { - if (g.md() == null) { - i2 = g; - break; - } - ++e; - } - } - } - if (i2) { - if (Mvd(a.e)) { - j = b.Jk() ? new lle(a.e, 4, b, c2, null, e, true) : fge(a, b.tk() ? 2 : 1, b, c2, b.ik(), -1, true); - d ? d.nj(j) : d = j; - } - d = _fe(a, i2, d); - } - return d; - } - function d8c(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l, m, n, o2, p; - o2 = 0; - p = 0; - i2 = e.c; - h = e.b; - k = c2.f; - n = c2.g; - switch (b.g) { - case 0: - o2 = d.i + d.g + g; - a.c ? p = m8c(o2, f2, d, g) : p = d.j; - m = $wnd.Math.max(i2, o2 + n); - j = $wnd.Math.max(h, p + k); - break; - case 1: - p = d.j + d.f + g; - a.c ? o2 = l8c(p, f2, d, g) : o2 = d.i; - m = $wnd.Math.max(i2, o2 + n); - j = $wnd.Math.max(h, p + k); - break; - case 2: - o2 = i2 + g; - p = 0; - m = i2 + g + n; - j = $wnd.Math.max(h, k); - break; - case 3: - o2 = 0; - p = h + g; - m = $wnd.Math.max(i2, n); - j = h + g + k; - break; - default: - throw Adb(new agb("IllegalPlacementOption.")); - } - l = new mad(a.a, m, j, b, o2, p); - return l; - } - function g6b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - h = a.d; - l = RD(mQb(a, (Ywc(), Xwc)), 15); - b = RD(mQb(a, Vvc), 15); - if (!l && !b) { - return; - } - f2 = Kfb(UD(hFc(a, (yCc(), QBc)))); - g = Kfb(UD(hFc(a, RBc))); - m = 0; - if (l) { - j = 0; - for (e = l.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 10); - j = $wnd.Math.max(j, d.o.b); - m += d.o.a; - } - m += f2 * (l.gc() - 1); - h.d += j + g; - } - c2 = 0; - if (b) { - j = 0; - for (e = b.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 10); - j = $wnd.Math.max(j, d.o.b); - c2 += d.o.a; - } - c2 += f2 * (b.gc() - 1); - h.a += j + g; - } - i2 = $wnd.Math.max(m, c2); - if (i2 > a.o.a) { - k = (i2 - a.o.a) / 2; - h.b = $wnd.Math.max(h.b, k); - h.c = $wnd.Math.max(h.c, k); - } - } - function RId(a) { - var b, c2, d, e, f2, g, h, i2; - f2 = new med(); - ied(f2, (hed(), eed)); - for (d = (e = oC(a, $C(qJ, Nve, 2, 0, 6, 1)), new Dkb(new mob(new CC(a, e).b))); d.b < d.d.gc(); ) { - c2 = (sFb(d.b < d.d.gc()), WD(d.d.Xb(d.c = d.b++))); - g = vgd(LId, c2); - if (g) { - b = qC(a, c2); - b.te() ? h = b.te().a : b.qe() ? h = "" + b.qe().a : b.re() ? h = "" + b.re().a : h = b.Ib(); - i2 = zhd(g, h); - if (i2 != null) { - (Csb(g.j, (Yhd(), Vhd)) || Csb(g.j, Whd)) && oQb(ked(f2, J4), g, i2); - Csb(g.j, Thd) && oQb(ked(f2, G4), g, i2); - Csb(g.j, Xhd) && oQb(ked(f2, K4), g, i2); - Csb(g.j, Uhd) && oQb(ked(f2, I4), g, i2); - } - } - } - return f2; - } - function ige(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - e = RD(a.g, 124); - if (qke(a.e, b)) { - return nke(), RD(b, 69).xk() ? new ole(b, a) : new Eke(b, a); - } else { - j = pke(a.e.Dh(), b); - d = 0; - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - g = f2.Lk(); - if (j.am(g)) { - nke(); - if (RD(b, 69).xk()) { - return f2; - } else if (g == (Lle(), Jle) || g == Gle) { - i2 = new dib(jeb(f2.md())); - while (++h < a.i) { - f2 = e[h]; - g = f2.Lk(); - (g == Jle || g == Gle) && Zhb(i2, jeb(f2.md())); - } - return Ije(RD(b.Hk(), 156), i2.a); - } else { - k = f2.md(); - k != null && c2 && ZD(b, 102) && (RD(b, 19).Bb & txe) != 0 && (k = Bge(a, b, h, d, k)); - return k; - } - } - ++d; - } - return b.ik(); - } - } - function hge(a, b, c2, d) { - var e, f2, g, h, i2, j; - i2 = pke(a.e.Dh(), b); - f2 = RD(a.g, 124); - if (qke(a.e, b)) { - e = 0; - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (i2.am(g.Lk())) { - if (e == c2) { - nke(); - if (RD(b, 69).xk()) { - return g; - } else { - j = g.md(); - j != null && d && ZD(b, 102) && (RD(b, 19).Bb & txe) != 0 && (j = Bge(a, b, h, e, j)); - return j; - } - } - ++e; - } - } - throw Adb(new veb(HJe + c2 + NIe + e)); - } else { - e = 0; - for (h = 0; h < a.i; ++h) { - g = f2[h]; - if (i2.am(g.Lk())) { - nke(); - if (RD(b, 69).xk()) { - return g; - } else { - j = g.md(); - j != null && d && ZD(b, 102) && (RD(b, 19).Bb & txe) != 0 && (j = Bge(a, b, h, e, j)); - return j; - } - } - ++e; - } - return b.ik(); - } - } - function xjb() { - xjb = geb; - vjb = cD(WC(kE, 1), Pwe, 28, 15, [qwe, 1162261467, hwe, 1220703125, 362797056, 1977326743, hwe, 387420489, ixe, 214358881, 429981696, 815730721, 1475789056, 170859375, 268435456, 410338673, 612220032, 893871739, 128e7, 1801088541, 113379904, 148035889, 191102976, 244140625, 308915776, 387420489, 481890304, 594823321, 729e6, 887503681, hwe, 1291467969, 1544804416, 1838265625, 60466176]); - wjb = cD(WC(kE, 1), Pwe, 28, 15, [-1, -1, 31, 19, 15, 13, 11, 11, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5]); - } - function Gjb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - g = a.e; - i2 = b.e; - if (i2 == 0) { - return a; - } - if (g == 0) { - return b.e == 0 ? b : new cjb(-b.e, b.d, b.a); - } - f2 = a.d; - h = b.d; - if (f2 + h == 2) { - c2 = Cdb(a.a[0], yxe); - d = Cdb(b.a[0], yxe); - g < 0 && (c2 = Odb(c2)); - i2 < 0 && (d = Odb(d)); - return Pib(), Jdb(Vdb(c2, d), 0) ? jjb(Vdb(c2, d)) : Xib(jjb(Odb(Vdb(c2, d)))); - } - e = f2 != h ? f2 > h ? 1 : -1 : Ejb(a.a, b.a, f2); - if (e == -1) { - l = -i2; - k = g == i2 ? Hjb(b.a, h, a.a, f2) : Cjb(b.a, h, a.a, f2); - } else { - l = g; - if (g == i2) { - if (e == 0) { - return Pib(), Oib; - } - k = Hjb(a.a, f2, b.a, h); - } else { - k = Cjb(a.a, f2, b.a, h); - } - } - j = new cjb(l, k.length, k); - Rib(j); - return j; - } - function c5b(a, b) { - var c2, d, e, f2; - f2 = Z4b(b); - !b.c && (b.c = new C5d(K4, b, 9, 9)); - FDb(new SDb(null, (!b.c && (b.c = new C5d(K4, b, 9, 9)), new Swb(b.c, 16))), new s5b(f2)); - e = RD(mQb(f2, (Ywc(), kwc)), 21); - Y4b(b, e); - if (e.Hc((ovc(), hvc))) { - for (d = new dMd((!b.c && (b.c = new C5d(K4, b, 9, 9)), b.c)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 123); - g5b(a, b, f2, c2); - } - } - RD(Gxd(b, (yCc(), lBc)), 181).gc() != 0 && V4b(b, f2); - Heb(TD(mQb(f2, sBc))) && e.Fc(mvc); - nQb(f2, PBc) && HCc(new RCc(Kfb(UD(mQb(f2, PBc)))), f2); - dE(Gxd(b, IAc)) === dE((Fnd(), Cnd)) ? d5b(a, b, f2) : b5b(a, b, f2); - return f2; - } - function Vrc(a) { - var b, c2, d, e, f2, g, h, i2; - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - for (g = new Anb(bv(d.a)); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - if (Lrc(f2)) { - c2 = RD(mQb(f2, (Ywc(), Wvc)), 313); - if (!c2.g && !!c2.d) { - b = c2; - i2 = c2.d; - while (i2) { - Urc(i2.i, i2.k, false, true); - asc(b.a); - asc(i2.i); - asc(i2.k); - asc(i2.b); - Z0b(i2.c, b.c.d); - Z0b(b.c, null); - g3b(b.a, null); - g3b(i2.i, null); - g3b(i2.k, null); - g3b(i2.b, null); - h = new Jrc(b.i, i2.a, b.e, i2.j, i2.f); - h.k = b.k; - h.n = b.n; - h.b = b.b; - h.c = i2.c; - h.g = b.g; - h.d = i2.d; - pQb(b.i, Wvc, h); - pQb(i2.a, Wvc, h); - i2 = i2.d; - b = h; - } - } - } - } - } - } - function nue(a, b) { - var c2, d, e, f2, g, h, i2; - if (a == null) { - return null; - } - f2 = a.length; - if (f2 == 0) { - return ""; - } - i2 = $C(hE, zwe, 28, f2, 15, 1); - AFb(0, f2, a.length); - AFb(0, f2, i2.length); - nhb(a, 0, f2, i2, 0); - c2 = null; - h = b; - for (e = 0, g = 0; e < f2; e++) { - d = i2[e]; - Kqe(); - if (d <= 32 && (Jqe[d] & 2) != 0) { - if (h) { - !c2 && (c2 = new Shb(a)); - Phb(c2, e - g++); - } else { - h = b; - if (d != 32) { - !c2 && (c2 = new Shb(a)); - peb(c2, e - g, e - g + 1, String.fromCharCode(32)); - } - } - } else { - h = false; - } - } - if (h) { - if (!c2) { - return AFb(0, f2 - 1, a.length), a.substr(0, f2 - 1); - } else { - f2 = c2.a.length; - return f2 > 0 ? zhb(c2.a, 0, f2 - 1) : ""; - } - } else { - return !c2 ? a : c2.a; - } - } - function xic(a, b) { - var c2, d, e, f2, g, h, i2; - b.Ug("Sort By Input Model " + mQb(a, (yCc(), cAc)), 1); - e = 0; - for (d = new Anb(a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - i2 = e == 0 ? 0 : e - 1; - h = RD(Vmb(a.b, i2), 30); - for (g = new Anb(c2.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - if (dE(mQb(f2, BBc)) !== dE((Bod(), vod)) && dE(mQb(f2, BBc)) !== dE(wod)) { - yob(); - _mb(f2.j, new trc(h, RD(mQb(a, cAc), 284), Bic(f2), Heb(TD(mQb(a, bAc))))); - b.bh("Node " + f2 + " ports: " + f2.j); - } - } - yob(); - _mb(c2.a, new frc(h, RD(mQb(a, cAc), 284), RD(mQb(a, _zc), 390))); - b.bh("Layer " + e + ": " + c2); - ++e; - } - b.Vg(); - } - function ute(a, b) { - var c2, d, e, f2, g; - g = RD(b, 138); - vte(a); - vte(g); - if (g.b == null) - return; - a.c = true; - if (a.b == null) { - a.b = $C(kE, Pwe, 28, g.b.length, 15, 1); - hib(g.b, 0, a.b, 0, g.b.length); - return; - } - f2 = $C(kE, Pwe, 28, a.b.length + g.b.length, 15, 1); - for (c2 = 0, d = 0, e = 0; c2 < a.b.length || d < g.b.length; ) { - if (c2 >= a.b.length) { - f2[e++] = g.b[d++]; - f2[e++] = g.b[d++]; - } else if (d >= g.b.length) { - f2[e++] = a.b[c2++]; - f2[e++] = a.b[c2++]; - } else if (g.b[d] < a.b[c2] || g.b[d] === a.b[c2] && g.b[d + 1] < a.b[c2 + 1]) { - f2[e++] = g.b[d++]; - f2[e++] = g.b[d++]; - } else { - f2[e++] = a.b[c2++]; - f2[e++] = a.b[c2++]; - } - } - a.b = f2; - } - function hac(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - c2 = Heb(TD(mQb(a, (Ywc(), uwc)))); - h = Heb(TD(mQb(b, uwc))); - d = RD(mQb(a, vwc), 12); - i2 = RD(mQb(b, vwc), 12); - e = RD(mQb(a, wwc), 12); - j = RD(mQb(b, wwc), 12); - k = !!d && d == i2; - l = !!e && e == j; - if (!c2 && !h) { - return new oac(RD(ynb(new Anb(a.j)), 12).p == RD(ynb(new Anb(b.j)), 12).p, k, l); - } - f2 = (!Heb(TD(mQb(a, uwc))) || Heb(TD(mQb(a, twc)))) && (!Heb(TD(mQb(b, uwc))) || Heb(TD(mQb(b, twc)))); - g = (!Heb(TD(mQb(a, uwc))) || !Heb(TD(mQb(a, twc)))) && (!Heb(TD(mQb(b, uwc))) || !Heb(TD(mQb(b, twc)))); - return new oac(k && f2 || l && g, k, l); - } - function N9c(a) { - var b, c2, d, e, f2, g, h, i2; - d = 0; - c2 = 0; - i2 = new Yub(); - b = 0; - for (h = new Anb(a.n); h.a < h.c.c.length; ) { - g = RD(ynb(h), 209); - if (g.c.c.length == 0) { - Pub(i2, g, i2.c.b, i2.c); - } else { - d = $wnd.Math.max(d, g.d); - c2 += g.a + (b > 0 ? a.i : 0); - } - ++b; - } - Ce(a.n, i2); - a.d = c2; - a.r = d; - a.g = 0; - a.f = 0; - a.e = 0; - a.o = oxe; - a.p = oxe; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 27); - a.p = $wnd.Math.min(a.p, e.g); - a.g = $wnd.Math.max(a.g, e.g); - a.f = $wnd.Math.max(a.f, e.f); - a.o = $wnd.Math.min(a.o, e.f); - a.e += e.f + a.i; - } - a.a = a.e / a.b.c.length - a.i * ((a.b.c.length - 1) / a.b.c.length); - Ead(a.j); - } - function qzd(a) { - var b, c2, d, e; - if ((a.Db & 64) != 0) - return kyd(a); - b = new dib(BHe); - d = a.k; - if (!d) { - !a.n && (a.n = new C5d(I4, a, 1, 7)); - if (a.n.i > 0) { - e = (!a.n && (a.n = new C5d(I4, a, 1, 7)), RD(QHd(a.n, 0), 135)).a; - !e || Zhb(Zhb((b.a += ' "', b), e), '"'); - } - } else { - Zhb(Zhb((b.a += ' "', b), d), '"'); - } - c2 = (!a.b && (a.b = new Yie(E4, a, 4, 7)), !(a.b.i <= 1 && (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c.i <= 1))); - c2 ? (b.a += " [", b) : (b.a += " ", b); - Zhb(b, Eb(new Gb(), new dMd(a.b))); - c2 && (b.a += "]", b); - b.a += SAe; - c2 && (b.a += "[", b); - Zhb(b, Eb(new Gb(), new dMd(a.c))); - c2 && (b.a += "]", b); - return b.a; - } - function odc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - v = a.c; - w2 = b.c; - c2 = Wmb(v.a, a, 0); - d = Wmb(w2.a, b, 0); - t = RD(c3b(a, (BEc(), yEc)).Kc().Pb(), 12); - C = RD(c3b(a, zEc).Kc().Pb(), 12); - u = RD(c3b(b, yEc).Kc().Pb(), 12); - D5 = RD(c3b(b, zEc).Kc().Pb(), 12); - r = s2b(t.e); - A = s2b(C.g); - s = s2b(u.e); - B = s2b(D5.g); - f3b(a, d, w2); - for (g = s, k = 0, o2 = g.length; k < o2; ++k) { - e = g[k]; - Z0b(e, t); - } - for (h = B, l = 0, p = h.length; l < p; ++l) { - e = h[l]; - Y0b(e, C); - } - f3b(b, c2, v); - for (i2 = r, m = 0, q = i2.length; m < q; ++m) { - e = i2[m]; - Z0b(e, u); - } - for (f2 = A, j = 0, n = f2.length; j < n; ++j) { - e = f2[j]; - Y0b(e, D5); - } - } - function $2c(a) { - var b, c2, d, e, f2, g, h; - g = RD(Gxd(a, (u2c(), t2c)), 27); - for (d = new dMd((!g.e && (g.e = new Yie(G4, g, 7, 4)), g.e)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 74); - h = new rjd(RD(QHd((!c2.a && (c2.a = new C5d(F4, c2, 6, 6)), c2.a), 0), 166).j, RD(QHd((!c2.a && (c2.a = new C5d(F4, c2, 6, 6)), c2.a), 0), 166).k); - f2 = new rjd(RD(QHd((!c2.a && (c2.a = new C5d(F4, c2, 6, 6)), c2.a), 0), 166).b, RD(QHd((!c2.a && (c2.a = new C5d(F4, c2, 6, 6)), c2.a), 0), 166).c); - e = new rjd(f2.a - h.a, f2.b - h.b); - b = $wnd.Math.atan2(e.b, e.a); - RD(QHd((!c2.c && (c2.c = new Yie(E4, c2, 5, 8)), c2.c), 0), 84).qf(($4c(), W4c), b); - } - } - function o6c(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - b.Ug("Interactive Node Reorderer", 1); - k = (!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a); - h = new bnb(); - for (e = new dMd(k); e.e != e.i.gc(); ) { - c2 = RD(bMd(e), 27); - Hxd(c2, (X7c(), A7c)) && (ZEb(h.c, c2), true); - } - for (f2 = new Anb(h); f2.a < f2.c.c.length; ) { - c2 = RD(ynb(f2), 27); - dHd(k, c2); - } - yob(); - _mb(h, new s6c()); - for (g = new Anb(h); g.a < g.c.c.length; ) { - c2 = RD(ynb(g), 27); - j = RD(Gxd(c2, (X7c(), A7c)), 17).a; - j = $wnd.Math.min(j, k.i); - VGd(k, j, c2); - } - i2 = 0; - for (d = new dMd(k); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 27); - Ixd(c2, (X7c(), z7c), sgb(i2)); - ++i2; - } - b.Vg(); - } - function PTc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - if ($wnd.Math.abs(b.s - b.c) < Vze || $wnd.Math.abs(c2.s - c2.c) < Vze) { - return 0; - } - d = OTc(a, b.j, c2.e); - e = OTc(a, c2.j, b.e); - f2 = d == -1 || e == -1; - g = 0; - if (f2) { - if (d == -1) { - new bTc((fTc(), dTc), c2, b, 1); - ++g; - } - if (e == -1) { - new bTc((fTc(), dTc), b, c2, 1); - ++g; - } - } else { - h = VTc(b.j, c2.s, c2.c); - h += VTc(c2.e, b.s, b.c); - i2 = VTc(c2.j, b.s, b.c); - i2 += VTc(b.e, c2.s, c2.c); - j = d + 16 * h; - k = e + 16 * i2; - if (j < k) { - new bTc((fTc(), eTc), b, c2, k - j); - } else if (j > k) { - new bTc((fTc(), eTc), c2, b, j - k); - } else if (j > 0 && k > 0) { - new bTc((fTc(), eTc), b, c2, 0); - new bTc(eTc, c2, b, 0); - } - } - return g; - } - function pXc(a, b, c2) { - var d, e, f2; - a.a = new bnb(); - for (f2 = Sub(b.b, 0); f2.b != f2.d.c; ) { - e = RD(evb(f2), 40); - while (RD(mQb(e, (h_c(), f_c)), 17).a > a.a.c.length - 1) { - Rmb(a.a, new Ptd(Hze, KEe)); - } - d = RD(mQb(e, f_c), 17).a; - if (c2 == (Cmd(), ymd) || c2 == zmd) { - e.e.a < Kfb(UD(RD(Vmb(a.a, d), 42).a)) && Ntd(RD(Vmb(a.a, d), 42), e.e.a); - e.e.a + e.f.a > Kfb(UD(RD(Vmb(a.a, d), 42).b)) && Otd(RD(Vmb(a.a, d), 42), e.e.a + e.f.a); - } else { - e.e.b < Kfb(UD(RD(Vmb(a.a, d), 42).a)) && Ntd(RD(Vmb(a.a, d), 42), e.e.b); - e.e.b + e.f.b > Kfb(UD(RD(Vmb(a.a, d), 42).b)) && Otd(RD(Vmb(a.a, d), 42), e.e.b + e.f.b); - } - } - } - function g2b(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - f2 = i2b(d); - h = Heb(TD(mQb(d, (yCc(), aBc)))); - if ((h || Heb(TD(mQb(a, MAc)))) && !Dod(RD(mQb(a, BBc), 101))) { - e = vpd(f2); - i2 = q2b(a, c2, c2 == (BEc(), zEc) ? e : spd(e)); - } else { - i2 = new R3b(); - P3b(i2, a); - if (b) { - k = i2.n; - k.a = b.a - a.n.a; - k.b = b.b - a.n.b; - _id(k, 0, 0, a.o.a, a.o.b); - Q3b(i2, c2b(i2, f2)); - } else { - e = vpd(f2); - Q3b(i2, c2 == (BEc(), zEc) ? e : spd(e)); - } - g = RD(mQb(d, (Ywc(), kwc)), 21); - j = i2.j; - switch (f2.g) { - case 2: - case 1: - (j == (qpd(), Yod) || j == npd) && g.Fc((ovc(), lvc)); - break; - case 4: - case 3: - (j == (qpd(), Xod) || j == ppd) && g.Fc((ovc(), lvc)); - } - } - return i2; - } - function VXb(a, b) { - var c2, d, e, f2, g, h; - for (g = new vkb(new mkb(a.f.b).a); g.b; ) { - f2 = tkb(g); - e = RD(f2.ld(), 602); - if (b == 1) { - if (e.Af() != (Cmd(), Bmd) && e.Af() != xmd) { - continue; - } - } else { - if (e.Af() != (Cmd(), ymd) && e.Af() != zmd) { - continue; - } - } - d = RD(RD(f2.md(), 42).b, 86); - h = RD(RD(f2.md(), 42).a, 194); - c2 = h.c; - switch (e.Af().g) { - case 2: - d.g.c = a.e.a; - d.g.b = $wnd.Math.max(1, d.g.b + c2); - break; - case 1: - d.g.c = d.g.c + c2; - d.g.b = $wnd.Math.max(1, d.g.b - c2); - break; - case 4: - d.g.d = a.e.b; - d.g.a = $wnd.Math.max(1, d.g.a + c2); - break; - case 3: - d.g.d = d.g.d + c2; - d.g.a = $wnd.Math.max(1, d.g.a - c2); - } - } - } - function NNc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - h = $C(kE, Pwe, 28, b.b.c.length, 15, 1); - j = $C(hR, jwe, 273, b.b.c.length, 0, 1); - i2 = $C(jR, WAe, 10, b.b.c.length, 0, 1); - for (l = a.a, m = 0, n = l.length; m < n; ++m) { - k = l[m]; - p = 0; - for (g = new Anb(k.e); g.a < g.c.c.length; ) { - e = RD(ynb(g), 10); - d = Q4b(e.c); - ++h[d]; - o2 = Kfb(UD(mQb(b, (yCc(), TBc)))); - h[d] > 0 && !!i2[d] && (o2 = bFc(a.b, i2[d], e)); - p = $wnd.Math.max(p, e.c.c.b + o2); - } - for (f2 = new Anb(k.e); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - e.n.b = p + e.d.d; - c2 = e.c; - c2.c.b = p + e.d.d + e.o.b + e.d.a; - j[Wmb(c2.b.b, c2, 0)] = e.k; - i2[Wmb(c2.b.b, c2, 0)] = e; - } - } - } - function M5c(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - for (d = new is(Mr(zGd(b).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 74); - if (!ZD(QHd((!c2.b && (c2.b = new Yie(E4, c2, 4, 7)), c2.b), 0), 193)) { - i2 = AGd(RD(QHd((!c2.c && (c2.c = new Yie(E4, c2, 5, 8)), c2.c), 0), 84)); - if (!nzd(c2)) { - g = b.i + b.g / 2; - h = b.j + b.f / 2; - k = i2.i + i2.g / 2; - l = i2.j + i2.f / 2; - m = new pjd(); - m.a = k - g; - m.b = l - h; - f2 = new rjd(m.a, m.b); - wid(f2, b.g, b.f); - m.a -= f2.a; - m.b -= f2.b; - g = k - m.a; - h = l - m.b; - j = new rjd(m.a, m.b); - wid(j, i2.g, i2.f); - m.a -= j.a; - m.b -= j.b; - k = g + m.a; - l = h + m.b; - e = IGd(c2, true, true); - Ozd(e, g); - Pzd(e, h); - Hzd(e, k); - Izd(e, l); - M5c(a, i2); - } - } - } - } - function ocd(a) { - Cgd(a, new Pfd($fd(Xfd(Zfd(Yfd(new agd(), hGe), "ELK SPOrE Compaction"), "ShrinkTree is a compaction algorithm that maintains the topology of a layout. The relocation of diagram elements is based on contracting a spanning tree."), new rcd()))); - Agd(a, hGe, iGe, iGd(mcd)); - Agd(a, hGe, jGe, iGd(jcd)); - Agd(a, hGe, kGe, iGd(icd)); - Agd(a, hGe, lGe, iGd(gcd)); - Agd(a, hGe, mGe, iGd(hcd)); - Agd(a, hGe, Eze, fcd); - Agd(a, hGe, _ze, 8); - Agd(a, hGe, nGe, iGd(lcd)); - Agd(a, hGe, oGe, iGd(bcd)); - Agd(a, hGe, pGe, iGd(ccd)); - Agd(a, hGe, LDe, (Geb(), false)); - } - function hQc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - b.Ug("Simple node placement", 1); - l = RD(mQb(a, (Ywc(), Qwc)), 312); - h = 0; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 30); - g = d.c; - g.b = 0; - c2 = null; - for (j = new Anb(d.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - !!c2 && (g.b += _Ec(i2, c2, l.c)); - g.b += i2.d.d + i2.o.b + i2.d.a; - c2 = i2; - } - h = $wnd.Math.max(h, g.b); - } - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - g = d.c; - k = (h - g.b) / 2; - c2 = null; - for (j = new Anb(d.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - !!c2 && (k += _Ec(i2, c2, l.c)); - k += i2.d.d; - i2.n.b = k; - k += i2.o.b + i2.d.a; - c2 = i2; - } - } - b.Vg(); - } - function tqc(a, b) { - var c2, d, e, f2; - nqc(b.b.j); - FDb(GDb(new SDb(null, new Swb(b.d, 16)), new Eqc()), new Gqc()); - for (f2 = new Anb(b.d); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 105); - switch (e.e.g) { - case 0: - c2 = RD(Vmb(e.j, 0), 113).d.j; - Smc(e, RD(Lvb(KDb(RD(Qc(e.k, c2), 15).Oc(), lqc)), 113)); - Tmc(e, RD(Lvb(JDb(RD(Qc(e.k, c2), 15).Oc(), lqc)), 113)); - break; - case 1: - d = foc(e); - Smc(e, RD(Lvb(KDb(RD(Qc(e.k, d[0]), 15).Oc(), lqc)), 113)); - Tmc(e, RD(Lvb(JDb(RD(Qc(e.k, d[1]), 15).Oc(), lqc)), 113)); - break; - case 2: - vqc(a, e); - break; - case 3: - uqc(e); - break; - case 4: - sqc(a, e); - } - qqc(e); - } - a.a = null; - } - function yRc(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - d = a.a.o == (EQc(), DQc) ? oxe : pxe; - h = zRc(a, new xRc(b, c2)); - if (!h.a && h.c) { - Mub(a.d, h); - return d; - } else if (h.a) { - e = h.a.c; - i2 = h.a.d; - if (c2) { - j = a.a.c == (wQc(), vQc) ? i2 : e; - f2 = a.a.c == vQc ? e : i2; - g = a.a.g[f2.i.p]; - k = Kfb(a.a.p[g.p]) + Kfb(a.a.d[f2.i.p]) + f2.n.b + f2.a.b - Kfb(a.a.d[j.i.p]) - j.n.b - j.a.b; - } else { - j = a.a.c == (wQc(), uQc) ? i2 : e; - f2 = a.a.c == uQc ? e : i2; - k = Kfb(a.a.p[a.a.g[f2.i.p].p]) + Kfb(a.a.d[f2.i.p]) + f2.n.b + f2.a.b - Kfb(a.a.d[j.i.p]) - j.n.b - j.a.b; - } - a.a.n[a.a.g[e.i.p].p] = (Geb(), true); - a.a.n[a.a.g[i2.i.p].p] = true; - return k; - } - return d; - } - function Sfe(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l; - if (d.gc() == 0) { - return false; - } - i2 = (nke(), RD(b, 69).xk()); - g = i2 ? d : new ZHd(d.gc()); - if (qke(a.e, b)) { - if (b.Si()) { - for (k = d.Kc(); k.Ob(); ) { - j = k.Pb(); - if (!dge(a, b, j, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0)) { - f2 = oke(b, j); - g.Fc(f2); - } - } - } else if (!i2) { - for (k = d.Kc(); k.Ob(); ) { - j = k.Pb(); - f2 = oke(b, j); - g.Fc(f2); - } - } - } else { - l = pke(a.e.Dh(), b); - e = RD(a.g, 124); - for (h = 0; h < a.i; ++h) { - f2 = e[h]; - if (l.am(f2.Lk())) { - throw Adb(new agb(gLe)); - } - } - if (d.gc() > 1) { - throw Adb(new agb(gLe)); - } - if (!i2) { - f2 = oke(b, d.Kc().Pb()); - g.Fc(f2); - } - } - return XGd(a, gge(a, b, c2), g); - } - function Fge(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - if (qke(a.e, b)) { - i2 = (nke(), RD(b, 69).xk() ? new ole(b, a) : new Eke(b, a)); - bge(i2.c, i2.b); - Ake(i2, RD(c2, 16)); - } else { - k = pke(a.e.Dh(), b); - d = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - e = d[g]; - f2 = e.Lk(); - if (k.am(f2)) { - if (f2 == (Lle(), Jle) || f2 == Gle) { - j = Mge(a, b, c2); - h = g; - j ? vLd(a, g) : ++g; - while (g < a.i) { - e = d[g]; - f2 = e.Lk(); - f2 == Jle || f2 == Gle ? vLd(a, g) : ++g; - } - j || RD(eHd(a, h, oke(b, c2)), 76); - } else - Mge(a, b, c2) ? vLd(a, g) : RD(eHd(a, g, (nke(), RD(b, 69).xk() ? RD(c2, 76) : oke(b, c2))), 76); - return; - } - } - Mge(a, b, c2) || WGd(a, (nke(), RD(b, 69).xk() ? RD(c2, 76) : oke(b, c2))); - } - } - function zPb(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - if (!pb(c2, a.b)) { - a.b = c2; - f2 = new CPb(); - g = RD(zDb(GDb(new SDb(null, new Swb(c2.f, 16)), f2), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), wBb), vBb]))), 21); - a.e = true; - a.f = true; - a.c = true; - a.d = true; - e = g.Hc((IPb(), FPb)); - d = g.Hc(GPb); - e && !d && (a.f = false); - !e && d && (a.d = false); - e = g.Hc(EPb); - d = g.Hc(HPb); - e && !d && (a.c = false); - !e && d && (a.e = false); - } - k = RD(a.a.Ve(b, c2), 42); - i2 = RD(k.a, 17).a; - j = RD(k.b, 17).a; - h = false; - i2 < 0 ? a.c || (h = true) : a.e || (h = true); - j < 0 ? a.d || (h = true) : a.f || (h = true); - return h ? zPb(a, k, c2) : k; - } - function fNb(a) { - var b, c2, d, e; - e = a.o; - RMb(); - if (a.A.dc() || pb(a.A, QMb)) { - b = e.b; - } else { - b = YKb(a.f); - if (a.A.Hc((Qpd(), Npd)) && !a.B.Hc((dqd(), _pd))) { - b = $wnd.Math.max(b, YKb(RD(Vrb(a.p, (qpd(), Xod)), 252))); - b = $wnd.Math.max(b, YKb(RD(Vrb(a.p, ppd), 252))); - } - c2 = TMb(a); - !!c2 && (b = $wnd.Math.max(b, c2.b)); - if (a.A.Hc(Opd)) { - if (a.q == (Bod(), xod) || a.q == wod) { - b = $wnd.Math.max(b, SJb(RD(Vrb(a.b, (qpd(), Xod)), 127))); - b = $wnd.Math.max(b, SJb(RD(Vrb(a.b, ppd), 127))); - } - } - } - Heb(TD(a.e.Tf().of((umd(), mld)))) ? e.b = $wnd.Math.max(e.b, b) : e.b = b; - d = a.f.i; - d.d = 0; - d.a = b; - _Kb(a.f); - } - function yNc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - for (l = 0; l < b.length; l++) { - for (h = a.Kc(); h.Ob(); ) { - f2 = RD(h.Pb(), 230); - f2.hg(l, b); - } - for (m = 0; m < b[l].length; m++) { - for (i2 = a.Kc(); i2.Ob(); ) { - f2 = RD(i2.Pb(), 230); - f2.ig(l, m, b); - } - p = b[l][m].j; - for (n = 0; n < p.c.length; n++) { - for (j = a.Kc(); j.Ob(); ) { - f2 = RD(j.Pb(), 230); - f2.jg(l, m, n, b); - } - o2 = (tFb(n, p.c.length), RD(p.c[n], 12)); - c2 = 0; - for (e = new l4b(o2.b); xnb(e.a) || xnb(e.b); ) { - d = RD(xnb(e.a) ? ynb(e.a) : ynb(e.b), 18); - for (k = a.Kc(); k.Ob(); ) { - f2 = RD(k.Pb(), 230); - f2.gg(l, m, n, c2++, d, b); - } - } - } - } - } - for (g = a.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 230); - f2.fg(); - } - } - function $7b(a, b) { - var c2, d, e, f2, g, h, i2; - a.b = Kfb(UD(mQb(b, (yCc(), UBc)))); - a.c = Kfb(UD(mQb(b, XBc))); - a.d = RD(mQb(b, DAc), 350); - a.a = RD(mQb(b, Xzc), 282); - Y7b(b); - h = RD(zDb(CDb(CDb(EDb(EDb(new SDb(null, new Swb(b.b, 16)), new c8b()), new e8b()), new g8b()), new i8b()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - for (e = h.Kc(); e.Ob(); ) { - c2 = RD(e.Pb(), 18); - g = RD(mQb(c2, (Ywc(), Twc)), 15); - g.Jc(new k8b(a)); - pQb(c2, Twc, null); - } - for (d = h.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 18); - i2 = RD(mQb(c2, (Ywc(), Uwc)), 18); - f2 = RD(mQb(c2, Rwc), 15); - S7b(a, f2, i2); - pQb(c2, Rwc, null); - } - } - function r2d(a, b) { - var c2, d, e, f2, g, h, i2; - if (a.a) { - h = a.a.xe(); - i2 = null; - if (h != null) { - b.a += "" + h; - } else { - g = a.a.mk(); - if (g != null) { - f2 = qhb(g, Fhb(91)); - if (f2 != -1) { - i2 = (BFb(f2, g.length + 1), g.substr(f2)); - b.a += "" + zhb(g == null ? vve : (uFb(g), g), 0, f2); - } else { - b.a += "" + g; - } - } - } - if (!!a.d && a.d.i != 0) { - e = true; - b.a += "<"; - for (d = new dMd(a.d); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 89); - e ? e = false : (b.a += pve, b); - r2d(c2, b); - } - b.a += ">"; - } - i2 != null && (b.a += "" + i2, b); - } else if (a.e) { - h = a.e.zb; - h != null && (b.a += "" + h, b); - } else { - b.a += "?"; - if (a.b) { - b.a += " super "; - r2d(a.b, b); - } else { - if (a.f) { - b.a += " extends "; - r2d(a.f, b); - } - } - } - } - function Uae(a) { - a.b = null; - a.a = null; - a.o = null; - a.q = null; - a.v = null; - a.w = null; - a.B = null; - a.p = null; - a.Q = null; - a.R = null; - a.S = null; - a.T = null; - a.U = null; - a.V = null; - a.W = null; - a.bb = null; - a.eb = null; - a.ab = null; - a.H = null; - a.db = null; - a.c = null; - a.d = null; - a.f = null; - a.n = null; - a.r = null; - a.s = null; - a.u = null; - a.G = null; - a.J = null; - a.e = null; - a.j = null; - a.i = null; - a.g = null; - a.k = null; - a.t = null; - a.F = null; - a.I = null; - a.L = null; - a.M = null; - a.O = null; - a.P = null; - a.$ = null; - a.N = null; - a.Z = null; - a.cb = null; - a.K = null; - a.D = null; - a.A = null; - a.C = null; - a._ = null; - a.fb = null; - a.X = null; - a.Y = null; - a.gb = false; - a.hb = false; - } - function yib(a) { - var b, c2, d, e; - d = Ajb((!a.c && (a.c = ojb(Hdb(a.f))), a.c), 0); - if (a.e == 0 || a.a == 0 && a.f != -1 && a.e < 0) { - return d; - } - b = xib(a) < 0 ? 1 : 0; - c2 = a.e; - e = (d.length + 1 + $wnd.Math.abs(eE(a.e)), new cib()); - b == 1 && (e.a += "-", e); - if (a.e > 0) { - c2 -= d.length - b; - if (c2 >= 0) { - e.a += "0."; - for (; c2 > mib.length; c2 -= mib.length) { - $hb(e, mib); - } - _hb(e, mib, eE(c2)); - Zhb(e, (BFb(b, d.length + 1), d.substr(b))); - } else { - c2 = b - c2; - Zhb(e, zhb(d, b, eE(c2))); - e.a += "."; - Zhb(e, yhb(d, eE(c2))); - } - } else { - Zhb(e, (BFb(b, d.length + 1), d.substr(b))); - for (; c2 < -mib.length; c2 += mib.length) { - $hb(e, mib); - } - _hb(e, mib, eE(-c2)); - } - return e.a; - } - function BOc(a) { - var b, c2, d, e, f2, g, h, i2, j; - if (a.k != (r3b(), p3b)) { - return false; - } - if (a.j.c.length <= 1) { - return false; - } - f2 = RD(mQb(a, (yCc(), BBc)), 101); - if (f2 == (Bod(), wod)) { - return false; - } - e = (wDc(), (!a.q ? (yob(), yob(), wob) : a.q)._b(iBc) ? d = RD(mQb(a, iBc), 203) : d = RD(mQb(Y2b(a), jBc), 203), d); - if (e == uDc) { - return false; - } - if (!(e == tDc || e == sDc)) { - g = Kfb(UD(hFc(a, fCc))); - b = RD(mQb(a, eCc), 140); - !b && (b = new R2b(g, g, g, g)); - j = b3b(a, (qpd(), ppd)); - i2 = b.d + b.a + (j.gc() - 1) * g; - if (i2 > a.o.b) { - return false; - } - c2 = b3b(a, Xod); - h = b.d + b.a + (c2.gc() - 1) * g; - if (h > a.o.b) { - return false; - } - } - return true; - } - function VRc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - b.Ug("Orthogonal edge routing", 1); - j = Kfb(UD(mQb(a, (yCc(), cCc)))); - c2 = Kfb(UD(mQb(a, UBc))); - d = Kfb(UD(mQb(a, XBc))); - m = new TTc(0, c2); - q = 0; - g = new Jkb(a.b, 0); - h = null; - k = null; - i2 = null; - l = null; - do { - k = g.b < g.d.gc() ? (sFb(g.b < g.d.gc()), RD(g.d.Xb(g.c = g.b++), 30)) : null; - l = !k ? null : k.a; - if (h) { - p2b(h, q); - q += h.c.a; - } - p = !h ? q : q + d; - o2 = STc(m, a, i2, l, p); - e = !h || ar(i2, (dSc(), bSc)); - f2 = !k || ar(l, (dSc(), bSc)); - if (o2 > 0) { - n = (o2 - 1) * c2; - !!h && (n += d); - !!k && (n += d); - n < j && !e && !f2 && (n = j); - q += n; - } else - !e && !f2 && (q += j); - h = k; - i2 = l; - } while (k); - a.f.a = q; - b.Vg(); - } - function tfe(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - k = null; - !!a.d && (k = RD(Xjb(a.d, b), 142)); - if (!k) { - f2 = a.a.vi(); - l = f2.i; - if (!a.d || bkb(a.d) != l) { - i2 = new Tsb(); - !!a.d && Ld(i2, a.d); - j = i2.f.c + i2.i.c; - for (h = j; h < l; ++h) { - d = RD(QHd(f2, h), 142); - e = Oee(a.e, d).xe(); - c2 = RD(e == null ? rtb(i2.f, null, d) : Ltb(i2.i, e, d), 142); - !!c2 && c2 != d && (e == null ? rtb(i2.f, null, c2) : Ltb(i2.i, e, c2)); - } - if (i2.f.c + i2.i.c != l) { - for (g = 0; g < j; ++g) { - d = RD(QHd(f2, g), 142); - e = Oee(a.e, d).xe(); - c2 = RD(e == null ? rtb(i2.f, null, d) : Ltb(i2.i, e, d), 142); - !!c2 && c2 != d && (e == null ? rtb(i2.f, null, c2) : Ltb(i2.i, e, c2)); - } - } - a.d = i2; - } - k = RD(Xjb(a.d, b), 142); - } - return k; - } - function w0b(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l, m, n; - l = Heb(TD(mQb(b, (yCc(), bBc)))); - m = null; - f2 == (BEc(), yEc) && d.c.i == c2 ? m = d.c : f2 == zEc && d.d.i == c2 && (m = d.d); - j = g; - if (!j || !l || !!m) { - k = (qpd(), opd); - m ? k = m.j : Dod(RD(mQb(c2, BBc), 101)) && (k = f2 == yEc ? ppd : Xod); - i2 = t0b(a, b, c2, f2, k, d); - h = s0b((Y2b(c2), d)); - if (f2 == yEc) { - Y0b(h, RD(Vmb(i2.j, 0), 12)); - Z0b(h, e); - } else { - Y0b(h, e); - Z0b(h, RD(Vmb(i2.j, 0), 12)); - } - j = new G0b(d, h, i2, RD(mQb(i2, (Ywc(), Awc)), 12), f2, !m); - } else { - Rmb(j.e, d); - n = $wnd.Math.max(Kfb(UD(mQb(j.d, FAc))), Kfb(UD(mQb(d, FAc)))); - pQb(j.d, FAc, n); - } - Rc(a.a, d, new J0b(j.d, b, f2)); - return j; - } - function gSd() { - gSd = geb; - var a; - fSd = new MSd(); - _Rd = $C(qJ, Nve, 2, 0, 6, 1); - URd = Rdb(xSd(33, 58), xSd(1, 26)); - VRd = Rdb(xSd(97, 122), xSd(65, 90)); - WRd = xSd(48, 57); - SRd = Rdb(URd, 0); - TRd = Rdb(VRd, WRd); - XRd = Rdb(Rdb(0, xSd(1, 6)), xSd(33, 38)); - YRd = Rdb(Rdb(WRd, xSd(65, 70)), xSd(97, 102)); - cSd = Rdb(SRd, vSd("-_.!~*'()")); - dSd = Rdb(TRd, ySd("-_.!~*'()")); - vSd(MJe); - ySd(MJe); - Rdb(cSd, vSd(";:@&=+$,")); - Rdb(dSd, ySd(";:@&=+$,")); - ZRd = vSd(":/?#"); - $Rd = ySd(":/?#"); - aSd = vSd("/?#"); - bSd = ySd("/?#"); - a = new _sb(); - a.a.zc("jar", a); - a.a.zc("zip", a); - a.a.zc("archive", a); - eSd = (yob(), new Lqb(a)); - } - function t0b(a, b, c2, d, e, f2) { - var g, h, i2, j, k, l; - g = null; - j = d == (BEc(), yEc) ? f2.c : f2.d; - i2 = i2b(b); - if (j.i == c2) { - g = RD(Wjb(a.b, j), 10); - if (!g) { - g = f2b(j, RD(mQb(c2, (yCc(), BBc)), 101), e, p0b(j), null, j.n, j.o, i2, b); - pQb(g, (Ywc(), Awc), j); - Zjb(a.b, j, g); - } - } else { - g = f2b((k = new qQb(), l = Kfb(UD(mQb(b, (yCc(), TBc)))) / 2, oQb(k, ABc, l), k), RD(mQb(c2, BBc), 101), e, d == yEc ? -1 : 1, null, new pjd(), new rjd(0, 0), i2, b); - h = u0b(g, c2, d); - pQb(g, (Ywc(), Awc), h); - Zjb(a.b, h, g); - } - RD(mQb(b, (Ywc(), kwc)), 21).Fc((ovc(), hvc)); - Dod(RD(mQb(b, (yCc(), BBc)), 101)) ? pQb(b, BBc, (Bod(), yod)) : pQb(b, BBc, (Bod(), zod)); - return g; - } - function Yec(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - h = 0; - o2 = 0; - i2 = Fnb(a.g, a.g.length); - f2 = a.e; - g = a.j; - d = a.b; - e = a.c; - do { - n = 0; - for (k = new Anb(a.q); k.a < k.c.c.length; ) { - j = RD(ynb(k), 10); - m = Wec(a, j); - c2 = true; - (a.r == (aEc(), VDc) || a.r == YDc) && (c2 = Heb(TD(m.b))); - if (RD(m.a, 17).a < 0 && c2) { - ++n; - i2 = Fnb(a.g, a.g.length); - a.e = a.e + RD(m.a, 17).a; - o2 += f2 - a.e; - f2 = a.e + RD(m.a, 17).a; - g = a.j; - d = bv(a.b); - e = bv(a.c); - } else { - a.g = Fnb(i2, i2.length); - a.e = f2; - a.b = (Qb(d), d ? new dnb(d) : cv(new Anb(d))); - a.c = (Qb(e), e ? new dnb(e) : cv(new Anb(e))); - a.j = g; - } - } - ++h; - l = n != 0 && Heb(TD(b.Kb(new Ptd(sgb(o2), sgb(h))))); - } while (l); - } - function e8c(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C; - g = a.f; - m = b.f; - h = g == (sad(), nad) || g == pad2; - n = m == nad || m == pad2; - i2 = g == oad || g == qad; - o2 = m == oad || m == qad; - j = g == oad || g == nad; - p = m == oad || m == nad; - if (h && n) { - return a.f == pad2 ? a : b; - } else if (i2 && o2) { - return a.f == qad ? a : b; - } else if (j && p) { - if (g == oad) { - l = a; - k = b; - } else { - l = b; - k = a; - } - f2 = (q = c2.j + c2.f, r = l.e + d.f, s = $wnd.Math.max(q, r), t = s - $wnd.Math.min(c2.j, l.e), u = l.d + d.g - c2.i, u * t); - e = (v = c2.i + c2.g, w2 = k.d + d.g, A = $wnd.Math.max(v, w2), B = A - $wnd.Math.min(c2.i, k.d), C = k.e + d.f - c2.j, B * C); - return f2 <= e ? a.f == oad ? a : b : a.f == nad ? a : b; - } - return a; - } - function t0c(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - pQb(b, (q$c(), g$c), 0); - i2 = RD(mQb(b, c$c), 40); - if (b.d.b == 0) { - if (i2) { - k = Kfb(UD(mQb(i2, j$c))) + a.b + u0c(a, i2, b); - pQb(b, j$c, k); - } else { - pQb(b, j$c, 0); - } - } else { - for (d = (f2 = Sub(new dXc(b).a.d, 0), new gXc(f2)); dvb(d.a); ) { - c2 = RD(evb(d.a), 65).c; - t0c(a, c2); - } - h = RD(Hr((g = Sub(new dXc(b).a.d, 0), new gXc(g))), 40); - l = RD(Gr((e = Sub(new dXc(b).a.d, 0), new gXc(e))), 40); - j = (Kfb(UD(mQb(l, j$c))) + Kfb(UD(mQb(h, j$c)))) / 2; - if (i2) { - k = Kfb(UD(mQb(i2, j$c))) + a.b + u0c(a, i2, b); - pQb(b, j$c, k); - pQb(b, g$c, Kfb(UD(mQb(b, j$c))) - j); - s0c(a, b); - } else { - pQb(b, j$c, j); - } - } - } - function nJb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - k = a.e.a.c.length; - for (g = new Anb(a.e.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 125); - f2.j = false; - } - a.i = $C(kE, Pwe, 28, k, 15, 1); - a.g = $C(kE, Pwe, 28, k, 15, 1); - a.n = new bnb(); - e = 0; - l = new bnb(); - for (i2 = new Anb(a.e.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 125); - h.d = e++; - h.b.a.c.length == 0 && Rmb(a.n, h); - Tmb(l, h.g); - } - b = 0; - for (d = new Anb(l); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 218); - c2.c = b++; - c2.f = false; - } - j = l.c.length; - if (a.b == null || a.b.length < j) { - a.b = $C(iE, vxe, 28, j, 15, 1); - a.c = $C(xdb, Hye, 28, j, 16, 1); - } else { - Nnb(a.c); - } - a.d = l; - a.p = new Jub(Sv(a.d.c.length)); - a.j = 1; - } - function uWb(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - if (b.e.c.length <= 1) { - return; - } - a.f = b; - a.d = RD(mQb(a.f, (dWb(), UVb)), 391); - a.g = RD(mQb(a.f, YVb), 17).a; - a.e = Kfb(UD(mQb(a.f, VVb))); - a.c = Kfb(UD(mQb(a.f, TVb))); - At(a.b); - for (e = new Anb(a.f.c); e.a < e.c.c.length; ) { - d = RD(ynb(e), 290); - zt(a.b, d.c, d, null); - zt(a.b, d.d, d, null); - } - h = a.f.e.c.length; - a.a = YC(iE, [Nve, vxe], [109, 28], 15, [h, h], 2); - for (j = new Anb(a.f.e); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 153); - qWb(a, i2, a.a[i2.a]); - } - a.i = YC(iE, [Nve, vxe], [109, 28], 15, [h, h], 2); - for (f2 = 0; f2 < h; ++f2) { - for (g = 0; g < h; ++g) { - c2 = a.a[f2][g]; - k = 1 / (c2 * c2); - a.i[f2][g] = k; - } - } - } - function OWb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - h = b.ah(); - h || b.Ug(Pze, 1); - c2 = RD(mQb(a, (Ywc(), Kwc)), 15); - g = 1 / c2.gc(); - if (b._g()) { - b.bh("ELK Layered uses the following " + c2.gc() + " modules:"); - n = 0; - for (m = c2.Kc(); m.Ob(); ) { - k = RD(m.Pb(), 47); - d = (n < 10 ? "0" : "") + n++; - b.bh(" Slot " + d + ": " + nfb(rb(k))); - } - } - for (l = c2.Kc(); l.Ob(); ) { - k = RD(l.Pb(), 47); - if (b.$g()) { - return; - } - k.Kf(a, b.eh(g)); - } - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - Tmb(a.a, e.a); - e.a.c.length = 0; - } - for (j = new Anb(a.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - g3b(i2, null); - } - a.b.c.length = 0; - h || b.Vg(); - } - function y9b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - j = new bnb(); - if (!nQb(a, (Ywc(), fwc))) { - return j; - } - for (d = RD(mQb(a, fwc), 15).Kc(); d.Ob(); ) { - b = RD(d.Pb(), 10); - x9b(b, a); - ZEb(j.c, b); - } - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - for (h = new Anb(e.a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - if (g.k != (r3b(), m3b)) { - continue; - } - i2 = RD(mQb(g, gwc), 10); - !!i2 && (k = new R3b(), P3b(k, g), l = RD(mQb(g, hwc), 64), Q3b(k, l), m = RD(Vmb(i2.j, 0), 12), n = new a1b(), Y0b(n, k), Z0b(n, m), void 0); - } - } - for (c2 = new Anb(j); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 10); - g3b(b, RD(Vmb(a.b, a.b.c.length - 1), 30)); - } - return j; - } - function U8c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - l = new bnb(); - k = new Had(0, c2); - f2 = 0; - Cad(k, new V9c(0, 0, k, c2)); - e = 0; - for (j = new dMd(a); j.e != j.i.gc(); ) { - i2 = RD(bMd(j), 27); - d = RD(Vmb(k.a, k.a.c.length - 1), 172); - h = e + i2.g + (RD(Vmb(k.a, 0), 172).b.c.length == 0 ? 0 : c2); - if (h > b || Heb(TD(Gxd(i2, (X7c(), D7c))))) { - e = 0; - f2 += k.b + c2; - ZEb(l.c, k); - k = new Had(f2, c2); - d = new V9c(0, k.f, k, c2); - Cad(k, d); - e = 0; - } - if (d.b.c.length == 0 || !Heb(TD(Gxd(vCd(i2), (X7c(), L7c)))) && (i2.f >= d.o && i2.f <= d.f || d.a * 0.5 <= i2.f && d.a * 1.5 >= i2.f)) { - K9c(d, i2); - } else { - g = new V9c(d.s + d.r + c2, k.f, k, c2); - Cad(k, g); - K9c(g, i2); - } - e = i2.i + i2.g; - } - ZEb(l.c, k); - return l; - } - function ste(a) { - var b, c2, d, e; - if (a.b == null || a.b.length <= 2) - return; - if (a.a) - return; - b = 0; - e = 0; - while (e < a.b.length) { - if (b != e) { - a.b[b] = a.b[e++]; - a.b[b + 1] = a.b[e++]; - } else - e += 2; - c2 = a.b[b + 1]; - while (e < a.b.length) { - if (c2 + 1 < a.b[e]) - break; - if (c2 + 1 == a.b[e]) { - a.b[b + 1] = a.b[e + 1]; - c2 = a.b[b + 1]; - e += 2; - } else if (c2 >= a.b[e + 1]) { - e += 2; - } else if (c2 < a.b[e + 1]) { - a.b[b + 1] = a.b[e + 1]; - c2 = a.b[b + 1]; - e += 2; - } else { - throw Adb(new yz("Token#compactRanges(): Internel Error: [" + a.b[b] + "," + a.b[b + 1] + "] [" + a.b[e] + "," + a.b[e + 1] + "]")); - } - } - b += 2; - } - if (b != a.b.length) { - d = $C(kE, Pwe, 28, b, 15, 1); - hib(a.b, 0, d, 0, b); - a.b = d; - } - a.a = true; - } - function x0b(a, b) { - var c2, d, e, f2, g, h, i2; - for (g = Ec(a.a).Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 18); - if (f2.b.c.length > 0) { - d = new dnb(RD(Qc(a.a, f2), 21)); - yob(); - _mb(d, new M0b(b)); - e = new Jkb(f2.b, 0); - while (e.b < e.d.gc()) { - c2 = (sFb(e.b < e.d.gc()), RD(e.d.Xb(e.c = e.b++), 72)); - h = -1; - switch (RD(mQb(c2, (yCc(), wAc)), 278).g) { - case 1: - h = d.c.length - 1; - break; - case 0: - h = v0b(d); - break; - case 2: - h = 0; - } - if (h != -1) { - i2 = (tFb(h, d.c.length), RD(d.c[h], 249)); - Rmb(i2.b.b, c2); - RD(mQb(Y2b(i2.b.c.i), (Ywc(), kwc)), 21).Fc((ovc(), gvc)); - RD(mQb(Y2b(i2.b.c.i), kwc), 21).Fc(evc); - Ckb(e); - pQb(c2, Dwc, f2); - } - } - } - Y0b(f2, null); - Z0b(f2, null); - } - } - function wOb(a, b) { - var c2, d, e, f2; - c2 = new BOb(); - d = RD(zDb(GDb(new SDb(null, new Swb(a.f, 16)), c2), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), wBb), vBb]))), 21); - e = d.gc(); - e = e == 2 ? 1 : 0; - e == 1 && Gdb(Mdb(RD(zDb(CDb(d.Lc(), new DOb()), PBb(Hgb(0), new uCb())), 168).a, 2), 0) && (e = 0); - d = RD(zDb(GDb(new SDb(null, new Swb(b.f, 16)), c2), sBb(new _Bb(), new bCb(), new yCb(), new ACb(), cD(WC(QL, 1), jwe, 108, 0, [wBb, vBb]))), 21); - f2 = d.gc(); - f2 = f2 == 2 ? 1 : 0; - f2 == 1 && Gdb(Mdb(RD(zDb(CDb(d.Lc(), new FOb()), PBb(Hgb(0), new uCb())), 168).a, 2), 0) && (f2 = 0); - if (e < f2) { - return -1; - } - if (e == f2) { - return 0; - } - return 1; - } - function W4b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - b = MCd(a); - f2 = Heb(TD(Gxd(b, (yCc(), NAc)))); - k = 0; - e = 0; - for (j = new dMd((!a.e && (a.e = new Yie(G4, a, 7, 4)), a.e)); j.e != j.i.gc(); ) { - i2 = RD(bMd(j), 74); - h = ozd(i2); - g = h && f2 && Heb(TD(Gxd(i2, OAc))); - m = AGd(RD(QHd((!i2.c && (i2.c = new Yie(E4, i2, 5, 8)), i2.c), 0), 84)); - h && g ? ++e : h && !g ? ++k : vCd(m) == b || m == b ? ++e : ++k; - } - for (d = new dMd((!a.d && (a.d = new Yie(G4, a, 8, 5)), a.d)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 74); - h = ozd(c2); - g = h && f2 && Heb(TD(Gxd(c2, OAc))); - l = AGd(RD(QHd((!c2.b && (c2.b = new Yie(E4, c2, 4, 7)), c2.b), 0), 84)); - h && g ? ++k : h && !g ? ++e : vCd(l) == b || l == b ? ++k : ++e; - } - return k - e; - } - function Jec(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - b.Ug("Edge splitting", 1); - if (a.b.c.length <= 2) { - b.Vg(); - return; - } - f2 = new Jkb(a.b, 0); - g = (sFb(f2.b < f2.d.gc()), RD(f2.d.Xb(f2.c = f2.b++), 30)); - while (f2.b < f2.d.gc()) { - e = g; - g = (sFb(f2.b < f2.d.gc()), RD(f2.d.Xb(f2.c = f2.b++), 30)); - for (i2 = new Anb(e.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - for (k = new Anb(h.j); k.a < k.c.c.length; ) { - j = RD(ynb(k), 12); - for (d = new Anb(j.g); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - m = c2.d; - l = m.i.c; - l != e && l != g && Oec(c2, (n = new j3b(a), h3b(n, (r3b(), o3b)), pQb(n, (Ywc(), Awc), c2), pQb(n, (yCc(), BBc), (Bod(), wod)), g3b(n, g), n)); - } - } - } - } - b.Vg(); - } - function MLc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - k = new bnb(); - m = new _sb(); - g = b.b; - for (e = 0; e < g.c.length; e++) { - j = (tFb(e, g.c.length), RD(g.c[e], 30)).a; - k.c.length = 0; - for (f2 = 0; f2 < j.c.length; f2++) { - h = a.a[e][f2]; - h.p = f2; - h.k == (r3b(), q3b) && (ZEb(k.c, h), true); - $mb(RD(Vmb(b.b, e), 30).a, f2, h); - h.j.c.length = 0; - Tmb(h.j, RD(RD(Vmb(a.b, e), 15).Xb(f2), 16)); - Cod(RD(mQb(h, (yCc(), BBc)), 101)) || pQb(h, BBc, (Bod(), vod)); - } - for (d = new Anb(k); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - l = KLc(c2); - m.a.zc(l, m); - m.a.zc(c2, m); - } - } - for (i2 = m.a.ec().Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 10); - yob(); - _mb(h.j, (sgc(), mgc)); - h.i = true; - V2b(h); - } - } - function zib(a) { - var b, c2, d, e, f2; - if (a.g != null) { - return a.g; - } - if (a.a < 32) { - a.g = zjb(Hdb(a.f), eE(a.e)); - return a.g; - } - e = Ajb((!a.c && (a.c = ojb(Hdb(a.f))), a.c), 0); - if (a.e == 0) { - return e; - } - b = (!a.c && (a.c = ojb(Hdb(a.f))), a.c).e < 0 ? 2 : 1; - c2 = e.length; - d = -a.e + c2 - b; - f2 = new bib(); - f2.a += "" + e; - if (a.e > 0 && d >= -6) { - if (d >= 0) { - aib(f2, c2 - eE(a.e), String.fromCharCode(46)); - } else { - peb(f2, b - 1, b - 1, "0."); - aib(f2, b + 1, Ihb(mib, 0, -eE(d) - 1)); - } - } else { - if (c2 - b >= 1) { - aib(f2, b, String.fromCharCode(46)); - ++c2; - } - aib(f2, c2, String.fromCharCode(69)); - d > 0 && aib(f2, ++c2, String.fromCharCode(43)); - aib(f2, ++c2, "" + Zdb(Hdb(d))); - } - a.g = f2.a; - return a.g; - } - function KNc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A; - d = Kfb(UD(mQb(b, (yCc(), hBc)))); - v = RD(mQb(b, gCc), 17).a; - m = 4; - e = 3; - w2 = 20 / v; - n = false; - i2 = 0; - g = lve; - do { - f2 = i2 != 1; - l = i2 != 0; - A = 0; - for (q = a.a, s = 0, u = q.length; s < u; ++s) { - o2 = q[s]; - o2.f = null; - LNc(a, o2, f2, l, d); - A += $wnd.Math.abs(o2.a); - } - do { - h = PNc(a, b); - } while (h); - for (p = a.a, r = 0, t = p.length; r < t; ++r) { - o2 = p[r]; - c2 = XNc(o2).a; - if (c2 != 0) { - for (k = new Anb(o2.e); k.a < k.c.c.length; ) { - j = RD(ynb(k), 10); - j.n.b += c2; - } - } - } - if (i2 == 0 || i2 == 1) { - --m; - if (m <= 0 && (A < g || -m > v)) { - i2 = 2; - g = lve; - } else if (i2 == 0) { - i2 = 1; - g = A; - } else { - i2 = 0; - g = A; - } - } else { - n = A >= g || g - A < w2; - g = A; - n && --e; - } - } while (!(n && e <= 0)); - } - function LFb(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2; - o2 = new Tsb(); - for (f2 = a.a.ec().Kc(); f2.Ob(); ) { - d = RD(f2.Pb(), 177); - Zjb(o2, d, c2.af(d)); - } - g = (Qb(a), a ? new dnb(a) : cv(a.a.ec().Kc())); - _mb(g, new NFb(o2)); - h = Xx(g); - i2 = new $Fb(b); - n = new Tsb(); - rtb(n.f, b, i2); - while (h.a.gc() != 0) { - j = null; - k = null; - l = null; - for (e = h.a.ec().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 177); - if (Kfb(UD(Wd(qtb(o2.f, d)))) <= oxe) { - if (Ujb(n, d.a) && !Ujb(n, d.b)) { - k = d.b; - l = d.a; - j = d; - break; - } - if (Ujb(n, d.b)) { - if (!Ujb(n, d.a)) { - k = d.a; - l = d.b; - j = d; - break; - } - } - } - } - if (!j) { - break; - } - m = new $Fb(k); - Rmb(RD(Wd(qtb(n.f, l)), 225).a, m); - rtb(n.f, k, m); - h.a.Bc(j) != null; - } - return i2; - } - function MFc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - c2.Ug("Depth-first cycle removal", 1); - l = b.a; - k = l.c.length; - a.c = new bnb(); - a.d = $C(xdb, Hye, 28, k, 16, 1); - a.a = $C(xdb, Hye, 28, k, 16, 1); - a.b = new bnb(); - g = 0; - for (j = new Anb(l); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - i2.p = g; - gr(Z2b(i2)) && Rmb(a.c, i2); - ++g; - } - for (n = new Anb(a.c); n.a < n.c.c.length; ) { - m = RD(ynb(n), 10); - LFc(a, m); - } - for (f2 = 0; f2 < k; f2++) { - if (!a.d[f2]) { - h = (tFb(f2, l.c.length), RD(l.c[f2], 10)); - LFc(a, h); - } - } - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - X0b(d, true); - pQb(b, (Ywc(), awc), (Geb(), true)); - } - a.c = null; - a.d = null; - a.a = null; - a.b = null; - c2.Vg(); - } - function Kid(a, b) { - tid(); - var c2, d, e, f2, g, h; - f2 = b.c - (a.c + a.b); - e = a.c - (b.c + b.b); - g = a.d - (b.d + b.a); - c2 = b.d - (a.d + a.a); - d = $wnd.Math.max(e, f2); - h = $wnd.Math.max(g, c2); - Zy(); - bz(vEe); - if (($wnd.Math.abs(d) <= vEe || d == 0 || isNaN(d) && isNaN(0) ? 0 : d < 0 ? -1 : d > 0 ? 1 : cz(isNaN(d), isNaN(0))) >= 0 ^ (bz(vEe), ($wnd.Math.abs(h) <= vEe || h == 0 || isNaN(h) && isNaN(0) ? 0 : h < 0 ? -1 : h > 0 ? 1 : cz(isNaN(h), isNaN(0))) >= 0)) { - return $wnd.Math.max(h, d); - } - bz(vEe); - if (($wnd.Math.abs(d) <= vEe || d == 0 || isNaN(d) && isNaN(0) ? 0 : d < 0 ? -1 : d > 0 ? 1 : cz(isNaN(d), isNaN(0))) > 0) { - return $wnd.Math.sqrt(h * h + d * d); - } - return -$wnd.Math.sqrt(h * h + d * d); - } - function hue2(a, b) { - var c2, d, e, f2, g, h; - if (!b) - return; - !a.a && (a.a = new gyb()); - if (a.e == 2) { - dyb(a.a, b); - return; - } - if (b.e == 1) { - for (e = 0; e < b.Pm(); e++) - hue2(a, b.Lm(e)); - return; - } - h = a.a.a.c.length; - if (h == 0) { - dyb(a.a, b); - return; - } - g = RD(eyb(a.a, h - 1), 122); - if (!((g.e == 0 || g.e == 10) && (b.e == 0 || b.e == 10))) { - dyb(a.a, b); - return; - } - f2 = b.e == 0 ? 2 : b.Mm().length; - if (g.e == 0) { - c2 = new Rhb(); - d = g.Km(); - d >= txe ? Nhb(c2, qse(d)) : Jhb(c2, d & Bwe); - g = new eue(10, null, 0); - fyb(a.a, g, h - 1); - } else { - c2 = (g.Mm().length + f2, new Rhb()); - Nhb(c2, g.Mm()); - } - if (b.e == 0) { - d = b.Km(); - d >= txe ? Nhb(c2, qse(d)) : Jhb(c2, d & Bwe); - } else { - Nhb(c2, b.Mm()); - } - RD(g, 530).b = c2.a; - } - function Qsc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - if (c2.dc()) { - return; - } - h = 0; - m = 0; - d = c2.Kc(); - o2 = RD(d.Pb(), 17).a; - while (h < b.f) { - if (h == o2) { - m = 0; - d.Ob() ? o2 = RD(d.Pb(), 17).a : o2 = b.f + 1; - } - if (h != m) { - q = RD(Vmb(a.b, h), 30); - n = RD(Vmb(a.b, m), 30); - p = bv(q.a); - for (l = new Anb(p); l.a < l.c.c.length; ) { - k = RD(ynb(l), 10); - f3b(k, n.a.c.length, n); - if (m == 0) { - g = bv(Z2b(k)); - for (f2 = new Anb(g); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 18); - X0b(e, true); - pQb(a, (Ywc(), awc), (Geb(), true)); - osc(a, e, 1); - } - } - } - } - ++m; - ++h; - } - i2 = new Jkb(a.b, 0); - while (i2.b < i2.d.gc()) { - j = (sFb(i2.b < i2.d.gc()), RD(i2.d.Xb(i2.c = i2.b++), 30)); - j.a.c.length == 0 && Ckb(i2); - } - } - function Xjc(a, b, c2) { - var d, e, f2; - e = RD(mQb(b, (yCc(), Xzc)), 282); - if (e == ($uc(), Yuc)) { - return; - } - c2.Ug("Horizontal Compaction", 1); - a.a = b; - f2 = new Ckc(); - d = new VGb((f2.d = b, f2.c = RD(mQb(f2.d, yAc), 223), tkc(f2), Akc(f2), zkc(f2), f2.a)); - TGb(d, a.b); - switch (RD(mQb(b, Wzc), 431).g) { - case 1: - RGb(d, new Pic(a.a)); - break; - default: - RGb(d, (FGb(), DGb)); - } - switch (e.g) { - case 1: - KGb(d); - break; - case 2: - KGb(JGb(d, (Cmd(), zmd))); - break; - case 3: - KGb(SGb(JGb(KGb(d), (Cmd(), zmd)), new fkc())); - break; - case 4: - KGb(SGb(JGb(KGb(d), (Cmd(), zmd)), new hkc(f2))); - break; - case 5: - KGb(QGb(d, Vjc)); - } - JGb(d, (Cmd(), ymd)); - d.e = true; - qkc(f2); - c2.Vg(); - } - function bqc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - g = b.b; - k = g.o; - i2 = g.d; - d = Kfb(UD(k2b(g, (yCc(), TBc)))); - e = Kfb(UD(k2b(g, VBc))); - j = Kfb(UD(k2b(g, dCc))); - h = new T2b(); - D2b(h, i2.d, i2.c, i2.a, i2.b); - m = Zpc(b, d, e, j); - for (r = new Anb(b.d); r.a < r.c.c.length; ) { - q = RD(ynb(r), 105); - for (o2 = q.f.a.ec().Kc(); o2.Ob(); ) { - n = RD(o2.Pb(), 340); - f2 = n.a; - l = Xpc(n); - c2 = (s = new Ejd(), Vpc(n, n.c, m, s), Upc(n, l, m, s), Vpc(n, n.d, m, s), s); - c2 = a.ng(n, l, c2); - Xub(f2.a); - ye(f2.a, c2); - FDb(new SDb(null, new Swb(c2, 16)), new fqc(k, h)); - } - p = q.i; - if (p) { - aqc(q, p, m, e); - t = new sjd(p.g); - cqc(k, h, t); - $id(t, p.j); - cqc(k, h, t); - } - } - D2b(i2, h.d, h.c, h.a, h.b); - } - function f8c(a, b, c2, d, e, f2, g, h) { - var i2, j, k, l; - i2 = dv(cD(WC(y1, 1), rve, 238, 0, [b, c2, d, e])); - l = null; - switch (a.b.g) { - case 1: - l = dv(cD(WC(h1, 1), rve, 535, 0, [new r8c(), new h8c(), new j8c()])); - break; - case 0: - l = dv(cD(WC(h1, 1), rve, 535, 0, [new j8c(), new h8c(), new r8c()])); - break; - case 2: - l = dv(cD(WC(h1, 1), rve, 535, 0, [new h8c(), new r8c(), new j8c()])); - } - for (k = new Anb(l); k.a < k.c.c.length; ) { - j = RD(ynb(k), 535); - i2.c.length > 1 && (i2 = j.Hg(i2, a.a, h)); - } - if (i2.c.length == 1) { - return RD(Vmb(i2, i2.c.length - 1), 238); - } - if (i2.c.length == 2) { - return e8c((tFb(0, i2.c.length), RD(i2.c[0], 238)), (tFb(1, i2.c.length), RD(i2.c[1], 238)), g, f2); - } - return null; - } - function CZc(a, b, c2) { - var d, e, f2, g, h, i2, j; - c2.Ug("Find roots", 1); - a.a.c.length = 0; - for (e = Sub(b.b, 0); e.b != e.d.c; ) { - d = RD(evb(e), 40); - if (d.b.b == 0) { - pQb(d, (q$c(), n$c), (Geb(), true)); - Rmb(a.a, d); - } - } - switch (a.a.c.length) { - case 0: - f2 = new bXc(0, b, "DUMMY_ROOT"); - pQb(f2, (q$c(), n$c), (Geb(), true)); - pQb(f2, WZc, true); - Mub(b.b, f2); - break; - case 1: - break; - default: - g = new bXc(0, b, IEe); - for (i2 = new Anb(a.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 40); - j = new WWc(g, h); - pQb(j, (q$c(), WZc), (Geb(), true)); - Mub(g.a.a, j); - Mub(g.d, j); - Mub(h.b, j); - pQb(h, n$c, false); - } - pQb(g, (q$c(), n$c), (Geb(), true)); - pQb(g, WZc, true); - Mub(b.b, g); - } - c2.Vg(); - } - function AQb(a) { - var b, c2, d, e, f2, g; - Umb(a.a, new GQb()); - for (c2 = new Anb(a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 225); - d = ojd(ajd(RD(a.b, 68).c), RD(b.b, 68).c); - if (wQb) { - g = RD(a.b, 68).b; - f2 = RD(b.b, 68).b; - if ($wnd.Math.abs(d.a) >= $wnd.Math.abs(d.b)) { - d.b = 0; - f2.d + f2.a > g.d && f2.d < g.d + g.a && kjd(d, $wnd.Math.max(g.c - (f2.c + f2.b), f2.c - (g.c + g.b))); - } else { - d.a = 0; - f2.c + f2.b > g.c && f2.c < g.c + g.b && kjd(d, $wnd.Math.max(g.d - (f2.d + f2.a), f2.d - (g.d + g.a))); - } - } else { - kjd(d, SQb(RD(a.b, 68), RD(b.b, 68))); - } - e = $wnd.Math.sqrt(d.a * d.a + d.b * d.b); - e = CQb(xQb, b, e, d); - kjd(d, e); - RQb(RD(b.b, 68), d); - Umb(b.a, new IQb(d)); - RD(xQb.b, 68); - BQb(xQb, yQb, b); - } - } - function tOc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - a.f = new BIb(); - j = 0; - e = 0; - for (g = new Anb(a.e.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - for (i2 = new Anb(f2.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - h.p = j++; - for (d = new is(Mr(a3b(h).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 18); - c2.p = e++; - } - b = BOc(h); - for (m = new Anb(h.j); m.a < m.c.c.length; ) { - l = RD(ynb(m), 12); - if (b) { - o2 = l.a.b; - if (o2 != $wnd.Math.floor(o2)) { - k = o2 - Xdb(Hdb($wnd.Math.round(o2))); - l.a.b -= k; - } - } - n = l.n.b + l.a.b; - if (n != $wnd.Math.floor(n)) { - k = n - Xdb(Hdb($wnd.Math.round(n))); - l.n.b -= k; - } - } - } - } - a.g = j; - a.b = e; - a.i = $C(XY, rve, 412, j, 0, 1); - a.c = $C(WY, rve, 655, e, 0, 1); - a.d.a.$b(); - } - function sLd(a) { - var b, c2, d, e, f2, g, h, i2, j; - if (a.Pj()) { - i2 = a.Qj(); - if (a.i > 0) { - b = new zNd(a.i, a.g); - c2 = a.i; - f2 = c2 < 100 ? null : new gLd(c2); - if (a.Tj()) { - for (d = 0; d < a.i; ++d) { - g = a.g[d]; - f2 = a.Vj(g, f2); - } - } - OHd(a); - e = c2 == 1 ? a.Ij(4, QHd(b, 0), null, 0, i2) : a.Ij(6, b, null, -1, i2); - if (a.Mj()) { - for (d = new yMd(b); d.e != d.i.gc(); ) { - f2 = a.Oj(xMd(d), f2); - } - if (!f2) { - a.Jj(e); - } else { - f2.nj(e); - f2.oj(); - } - } else { - if (!f2) { - a.Jj(e); - } else { - f2.nj(e); - f2.oj(); - } - } - } else { - OHd(a); - a.Jj(a.Ij(6, (yob(), vob), null, -1, i2)); - } - } else if (a.Mj()) { - if (a.i > 0) { - h = a.g; - j = a.i; - OHd(a); - f2 = j < 100 ? null : new gLd(j); - for (d = 0; d < j; ++d) { - g = h[d]; - f2 = a.Oj(g, f2); - } - !!f2 && f2.oj(); - } else { - OHd(a); - } - } else { - OHd(a); - } - } - function xVc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - rVc(this); - c2 == (dVc(), bVc) ? Ysb(this.r, a) : Ysb(this.w, a); - k = oxe; - j = pxe; - for (g = b.a.ec().Kc(); g.Ob(); ) { - e = RD(g.Pb(), 42); - h = RD(e.a, 465); - d = RD(e.b, 18); - i2 = d.c; - i2 == a && (i2 = d.d); - h == bVc ? Ysb(this.r, i2) : Ysb(this.w, i2); - m = (qpd(), hpd).Hc(i2.j) ? Kfb(UD(mQb(i2, (Ywc(), Swc)))) : xjd(cD(WC(l3, 1), Nve, 8, 0, [i2.i.n, i2.n, i2.a])).b; - k = $wnd.Math.min(k, m); - j = $wnd.Math.max(j, m); - } - l = (qpd(), hpd).Hc(a.j) ? Kfb(UD(mQb(a, (Ywc(), Swc)))) : xjd(cD(WC(l3, 1), Nve, 8, 0, [a.i.n, a.n, a.a])).b; - vVc(this, l, k, j); - for (f2 = b.a.ec().Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 42); - sVc(this, RD(e.b, 18)); - } - this.o = false; - } - function wD(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G; - c2 = a.l & 8191; - d = a.l >> 13 | (a.m & 15) << 9; - e = a.m >> 4 & 8191; - f2 = a.m >> 17 | (a.h & 255) << 5; - g = (a.h & 1048320) >> 8; - h = b.l & 8191; - i2 = b.l >> 13 | (b.m & 15) << 9; - j = b.m >> 4 & 8191; - k = b.m >> 17 | (b.h & 255) << 5; - l = (b.h & 1048320) >> 8; - B = c2 * h; - C = d * h; - D5 = e * h; - F = f2 * h; - G = g * h; - if (i2 != 0) { - C += c2 * i2; - D5 += d * i2; - F += e * i2; - G += f2 * i2; - } - if (j != 0) { - D5 += c2 * j; - F += d * j; - G += e * j; - } - if (k != 0) { - F += c2 * k; - G += d * k; - } - l != 0 && (G += c2 * l); - n = B & dxe; - o2 = (C & 511) << 13; - m = n + o2; - q = B >> 22; - r = C >> 9; - s = (D5 & 262143) << 4; - t = (F & 31) << 17; - p = q + r + s + t; - v = D5 >> 18; - w2 = F >> 5; - A = (G & 4095) << 8; - u = v + w2 + A; - p += m >> 22; - m &= dxe; - u += p >> 22; - p &= dxe; - u &= exe; - return hD(m, p, u); - } - function Fac(a) { - var b, c2, d, e, f2, g, h; - h = RD(Vmb(a.j, 0), 12); - if (h.g.c.length != 0 && h.e.c.length != 0) { - throw Adb(new dgb("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges.")); - } - if (h.g.c.length != 0) { - f2 = oxe; - for (c2 = new Anb(h.g); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 18); - g = b.d.i; - d = RD(mQb(g, (yCc(), _Ac)), 140); - f2 = $wnd.Math.min(f2, g.n.a - d.b); - } - return new cc(Qb(f2)); - } - if (h.e.c.length != 0) { - e = pxe; - for (c2 = new Anb(h.e); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 18); - g = b.c.i; - d = RD(mQb(g, (yCc(), _Ac)), 140); - e = $wnd.Math.max(e, g.n.a + g.o.a + d.c); - } - return new cc(Qb(e)); - } - return wb(), wb(), vb; - } - function cZd(a, b) { - var c2, d, e, f2, g, h, i2; - if (a.ol()) { - if (a.i > 4) { - if (a.fk(b)) { - if (a.al()) { - e = RD(b, 54); - d = e.Eh(); - i2 = d == a.e && (a.ml() ? e.yh(e.Fh(), a.il()) == a.jl() : -1 - e.Fh() == a.Lj()); - if (a.nl() && !i2 && !d && !!e.Jh()) { - for (f2 = 0; f2 < a.i; ++f2) { - c2 = a.pl(RD(a.g[f2], 58)); - if (dE(c2) === dE(b)) { - return true; - } - } - } - return i2; - } else if (a.ml() && !a.ll()) { - g = RD(b, 58).Mh(Z5d(RD(a.Lk(), 19))); - if (dE(g) === dE(a.e)) { - return true; - } else if (g == null || !RD(g, 58).Vh()) { - return false; - } - } - } else { - return false; - } - } - h = PHd(a, b); - if (a.nl() && !h) { - for (f2 = 0; f2 < a.i; ++f2) { - e = a.pl(RD(a.g[f2], 58)); - if (dE(e) === dE(b)) { - return true; - } - } - } - return h; - } else { - return PHd(a, b); - } - } - function bGc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - c2.Ug("Interactive cycle breaking", 1); - l = new bnb(); - for (n = new Anb(b.a); n.a < n.c.c.length; ) { - m = RD(ynb(n), 10); - m.p = 1; - o2 = _2b(m).a; - for (k = c3b(m, (BEc(), zEc)).Kc(); k.Ob(); ) { - j = RD(k.Pb(), 12); - for (f2 = new Anb(j.g); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 18); - p = d.d.i; - if (p != m) { - q = _2b(p).a; - q < o2 && (ZEb(l.c, d), true); - } - } - } - } - for (g = new Anb(l); g.a < g.c.c.length; ) { - d = RD(ynb(g), 18); - X0b(d, true); - } - l.c.length = 0; - for (i2 = new Anb(b.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - h.p > 0 && aGc(a, h, l); - } - for (e = new Anb(l); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - X0b(d, true); - } - l.c.length = 0; - c2.Vg(); - } - function mMc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - c2 = 0; - k = new bnb(); - for (h = new Anb(b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - $Lc(a.b, a.d[g.p]); - k.c.length = 0; - switch (g.i.k.g) { - case 0: - d = RD(mQb(g, (Ywc(), Iwc)), 10); - Umb(d.j, new XMc(k)); - break; - case 1: - Mvb(DDb(CDb(new SDb(null, new Swb(g.i.j, 16)), new ZMc(g))), new aNc(k)); - break; - case 3: - e = RD(mQb(g, (Ywc(), Awc)), 12); - Rmb(k, new Ptd(e, sgb(g.e.c.length + g.g.c.length))); - } - for (j = new Anb(k); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 42); - f2 = AMc(a, RD(i2.a, 12)); - if (f2 > a.d[g.p]) { - c2 += ZLc(a.b, f2) * RD(i2.b, 17).a; - hmb(a.a, sgb(f2)); - } - } - while (!nmb(a.a)) { - XLc(a.b, RD(smb(a.a), 17).a); - } - } - return c2; - } - function x9b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - k = RD(mQb(a, (Ywc(), hwc)), 64); - d = RD(Vmb(a.j, 0), 12); - k == (qpd(), Yod) ? Q3b(d, npd) : k == npd && Q3b(d, Yod); - if (RD(mQb(b, (yCc(), lBc)), 181).Hc((Qpd(), Ppd))) { - i2 = Kfb(UD(mQb(a, _Bc))); - j = Kfb(UD(mQb(a, aCc))); - g = Kfb(UD(mQb(a, ZBc))); - h = RD(mQb(b, EBc), 21); - if (h.Hc((Pod(), Lod))) { - c2 = j; - l = a.o.a / 2 - d.n.a; - for (f2 = new Anb(d.f); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 72); - e.n.b = c2; - e.n.a = l - e.o.a / 2; - c2 += e.o.b + g; - } - } else if (h.Hc(Nod)) { - for (f2 = new Anb(d.f); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 72); - e.n.a = i2 + a.o.a - d.n.a; - } - } - NJb(new PJb((i1b(), new t1b(b, false, false, new _1b()))), new F1b(null, a, false)); - } - } - function ykc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - if (b.c.length == 0) { - return; - } - yob(); - Ynb(b.c, b.c.length, null); - e = new Anb(b); - d = RD(ynb(e), 154); - while (e.a < e.c.c.length) { - c2 = RD(ynb(e), 154); - if (rGb(d.e.c, c2.e.c) && !(uGb(Mid(d.e).b, c2.e.d) || uGb(Mid(c2.e).b, d.e.d))) { - d = (Tmb(d.k, c2.k), Tmb(d.b, c2.b), Tmb(d.c, c2.c), ye(d.i, c2.i), Tmb(d.d, c2.d), Tmb(d.j, c2.j), f2 = $wnd.Math.min(d.e.c, c2.e.c), g = $wnd.Math.min(d.e.d, c2.e.d), h = $wnd.Math.max(d.e.c + d.e.b, c2.e.c + c2.e.b), i2 = h - f2, j = $wnd.Math.max(d.e.d + d.e.a, c2.e.d + c2.e.a), k = j - g, Rid(d.e, f2, g, i2, k), $Gb(d.f, c2.f), !d.a && (d.a = c2.a), Tmb(d.g, c2.g), Rmb(d.g, c2), d); - } else { - Bkc(a, d); - d = c2; - } - } - Bkc(a, d); - } - function B0b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v; - i2 = new bnb(); - for (f2 = new Anb(b.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - for (h = new Anb(e.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - k = null; - for (t = s2b(g.g), u = 0, v = t.length; u < v; ++u) { - s = t[u]; - if (!n2b(s.d.i, c2)) { - r = w0b(a, b, c2, s, s.c, (BEc(), zEc), k); - r != k && (ZEb(i2.c, r), true); - r.c && (k = r); - } - } - j = null; - for (o2 = s2b(g.e), p = 0, q = o2.length; p < q; ++p) { - n = o2[p]; - if (!n2b(n.c.i, c2)) { - r = w0b(a, b, c2, n, n.d, (BEc(), yEc), j); - r != j && (ZEb(i2.c, r), true); - r.c && (j = r); - } - } - } - } - for (m = new Anb(i2); m.a < m.c.c.length; ) { - l = RD(ynb(m), 453); - Wmb(b.a, l.a, 0) != -1 || Rmb(b.a, l.a); - l.c && (ZEb(d.c, l), true); - } - } - function hrd(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - l = new sjd(RD(Gxd(a, (hkd(), bkd)), 8)); - l.a = $wnd.Math.max(l.a - c2.b - c2.c, 0); - l.b = $wnd.Math.max(l.b - c2.d - c2.a, 0); - e = UD(Gxd(a, Xjd)); - (e == null || (uFb(e), e) <= 0) && (e = 1.3); - h = new bnb(); - for (o2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); o2.e != o2.i.gc(); ) { - n = RD(bMd(o2), 27); - g = new Ard(n); - ZEb(h.c, g); - } - m = RD(Gxd(a, Yjd), 320); - switch (m.g) { - case 3: - q = erd(h, b, l.a, l.b, (j = d, uFb(e), j)); - break; - case 1: - q = drd(h, b, l.a, l.b, (k = d, uFb(e), k)); - break; - default: - q = frd(h, b, l.a, l.b, (i2 = d, uFb(e), i2)); - } - f2 = new zrd(q); - p = ird(f2, b, c2, l.a, l.b, d, (uFb(e), e)); - Esd(a, p.a, p.b, false, true); - } - function m2b(a, b, c2, d) { - var e, f2, g, h, i2, j; - h = a.j; - if (h == (qpd(), opd) && b != (Bod(), zod) && b != (Bod(), Aod)) { - h = c2b(a, c2); - Q3b(a, h); - !(!a.q ? (yob(), yob(), wob) : a.q)._b((yCc(), ABc)) && h != opd && (a.n.a != 0 || a.n.b != 0) && pQb(a, ABc, b2b(a, h)); - } - if (b == (Bod(), xod)) { - j = 0; - switch (h.g) { - case 1: - case 3: - f2 = a.i.o.a; - f2 > 0 && (j = a.n.a / f2); - break; - case 2: - case 4: - e = a.i.o.b; - e > 0 && (j = a.n.b / e); - } - pQb(a, (Ywc(), Jwc), j); - } - i2 = a.o; - g = a.a; - if (d) { - g.a = d.a; - g.b = d.b; - a.d = true; - } else if (b != zod && b != Aod && h != opd) { - switch (h.g) { - case 1: - g.a = i2.a / 2; - break; - case 2: - g.a = i2.a; - g.b = i2.b / 2; - break; - case 3: - g.a = i2.a / 2; - g.b = i2.b; - break; - case 4: - g.b = i2.b / 2; - } - } else { - g.a = i2.a / 2; - g.b = i2.b / 2; - } - } - function VJd(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - if (a.Pj()) { - k = a.Ej(); - i2 = a.Qj(); - if (k > 0) { - b = new $Hd(a.pj()); - c2 = k; - f2 = c2 < 100 ? null : new gLd(c2); - aJd(a, c2, b.g); - e = c2 == 1 ? a.Ij(4, QHd(b, 0), null, 0, i2) : a.Ij(6, b, null, -1, i2); - if (a.Mj()) { - for (d = new dMd(b); d.e != d.i.gc(); ) { - f2 = a.Oj(bMd(d), f2); - } - if (!f2) { - a.Jj(e); - } else { - f2.nj(e); - f2.oj(); - } - } else { - if (!f2) { - a.Jj(e); - } else { - f2.nj(e); - f2.oj(); - } - } - } else { - aJd(a, a.Ej(), a.Fj()); - a.Jj(a.Ij(6, (yob(), vob), null, -1, i2)); - } - } else if (a.Mj()) { - k = a.Ej(); - if (k > 0) { - h = a.Fj(); - j = k; - aJd(a, k, h); - f2 = j < 100 ? null : new gLd(j); - for (d = 0; d < j; ++d) { - g = h[d]; - f2 = a.Oj(g, f2); - } - !!f2 && f2.oj(); - } else { - aJd(a, a.Ej(), a.Fj()); - } - } else { - aJd(a, a.Ej(), a.Fj()); - } - } - function frd(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q; - h = $C(iE, vxe, 28, a.c.length, 15, 1); - m = new pwb(new Qrd()); - iwb(m, a); - j = 0; - p = new bnb(); - while (m.b.c.length != 0) { - g = RD(m.b.c.length == 0 ? null : Vmb(m.b, 0), 163); - if (j > 1 && urd(g) * trd(g) / 2 > h[0]) { - f2 = 0; - while (f2 < p.c.length - 1 && urd(g) * trd(g) / 2 > h[f2]) { - ++f2; - } - o2 = new Rkb(p, 0, f2 + 1); - l = new zrd(o2); - k = urd(g) / trd(g); - i2 = ird(l, b, new z3b(), c2, d, e, k); - $id(hjd(l.e), i2); - zFb(lwb(m, l), Bxe); - n = new Rkb(p, f2 + 1, p.c.length); - iwb(m, n); - p.c.length = 0; - j = 0; - Pnb(h, h.length, 0); - } else { - q = m.b.c.length == 0 ? null : Vmb(m.b, 0); - q != null && owb(m, 0); - j > 0 && (h[j] = h[j - 1]); - h[j] += urd(g) * trd(g); - ++j; - ZEb(p.c, g); - } - } - return p; - } - function _nc(a, b) { - var c2, d, e, f2; - c2 = b.b; - f2 = new dnb(c2.j); - e = 0; - d = c2.j; - d.c.length = 0; - Nnc(RD($i(a.b, (qpd(), Yod), (joc(), ioc)), 15), c2); - e = Onc(f2, e, new Hoc(), d); - Nnc(RD($i(a.b, Yod, hoc), 15), c2); - e = Onc(f2, e, new Joc(), d); - Nnc(RD($i(a.b, Yod, goc), 15), c2); - Nnc(RD($i(a.b, Xod, ioc), 15), c2); - Nnc(RD($i(a.b, Xod, hoc), 15), c2); - e = Onc(f2, e, new Loc(), d); - Nnc(RD($i(a.b, Xod, goc), 15), c2); - Nnc(RD($i(a.b, npd, ioc), 15), c2); - e = Onc(f2, e, new Noc(), d); - Nnc(RD($i(a.b, npd, hoc), 15), c2); - e = Onc(f2, e, new Poc(), d); - Nnc(RD($i(a.b, npd, goc), 15), c2); - Nnc(RD($i(a.b, ppd, ioc), 15), c2); - e = Onc(f2, e, new toc(), d); - Nnc(RD($i(a.b, ppd, hoc), 15), c2); - Nnc(RD($i(a.b, ppd, goc), 15), c2); - } - function jJc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - for (h = new Anb(b); h.a < h.c.c.length; ) { - f2 = RD(ynb(h), 239); - f2.e = null; - f2.c = 0; - } - i2 = null; - for (g = new Anb(b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 239); - l = f2.d[0]; - if (c2 && l.k != (r3b(), p3b)) { - continue; - } - for (n = RD(mQb(l, (Ywc(), qwc)), 15).Kc(); n.Ob(); ) { - m = RD(n.Pb(), 10); - if (!c2 || m.k == (r3b(), p3b)) { - (!f2.e && (f2.e = new bnb()), f2.e).Fc(a.b[m.c.p][m.p]); - ++a.b[m.c.p][m.p].c; - } - } - if (!c2 && l.k == (r3b(), p3b)) { - if (i2) { - for (k = RD(Qc(a.d, i2), 21).Kc(); k.Ob(); ) { - j = RD(k.Pb(), 10); - for (e = RD(Qc(a.d, l), 21).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 10); - wJc(a.b[j.c.p][j.p]).Fc(a.b[d.c.p][d.p]); - ++a.b[d.c.p][d.p].c; - } - } - } - i2 = l; - } - } - } - function iGc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - c2.Ug("Model order cycle breaking", 1); - a.a = 0; - a.b = 0; - n = new bnb(); - k = b.a.c.length; - for (j = new Anb(b.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - nQb(i2, (Ywc(), zwc)) && (k = $wnd.Math.max(k, RD(mQb(i2, zwc), 17).a + 1)); - } - for (p = new Anb(b.a); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 10); - g = hGc(a, o2, k); - for (m = c3b(o2, (BEc(), zEc)).Kc(); m.Ob(); ) { - l = RD(m.Pb(), 12); - for (f2 = new Anb(l.g); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 18); - q = d.d.i; - h = hGc(a, q, k); - h < g && (ZEb(n.c, d), true); - } - } - } - for (e = new Anb(n); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - X0b(d, true); - pQb(b, (Ywc(), awc), (Geb(), true)); - } - n.c.length = 0; - c2.Vg(); - } - function qUb(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - g = b.d; - h = c2.d; - while (g.a - h.a == 0 && g.b - h.b == 0) { - i2 = false; - if (ZD(b, 250) && ZD(c2, 250) && !i2) { - j = RD(b, 250).a; - k = ojd(new sjd($Tb(j)), ZTb(j)); - d = 2; - e = new rjd(k.a / $wnd.Math.sqrt(k.a * k.a + k.b * k.b) * d, -k.b / $wnd.Math.sqrt(k.a * k.a + k.b * k.b) * d); - $id(g, e); - l = RD(c2, 250).a; - m = ojd(new sjd($Tb(l)), ZTb(l)); - d = k == m ? -2 : 2; - f2 = new rjd(m.a / $wnd.Math.sqrt(m.a * m.a + m.b * m.b) * d, -(m.b / $wnd.Math.sqrt(m.a * m.a + m.b * m.b)) * d); - $id(g, f2); - i2 = true; - } else { - g.a += Kwb(a, 26) * Kxe + Kwb(a, 27) * Lxe - 0.5; - g.b += Kwb(a, 26) * Kxe + Kwb(a, 27) * Lxe - 0.5; - h.a += Kwb(a, 26) * Kxe + Kwb(a, 27) * Lxe - 0.5; - h.b += Kwb(a, 26) * Kxe + Kwb(a, 27) * Lxe - 0.5; - } - } - } - function NWb(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, p, q, r; - j = KWb(b); - q = RD(mQb(b, (yCc(), oAc)), 322); - xgb(j, new UWb(q)); - r = RD(mQb(b, gAc), 299); - xgb(j, new WWb(r)); - p = 0; - k = new bnb(); - for (f2 = new Kmb(j); f2.a != f2.b; ) { - e = RD(Imb(f2), 36); - cXb(a.c, e); - m = RD(mQb(e, (Ywc(), Kwc)), 15); - p += m.gc(); - d = m.Kc(); - Rmb(k, new Ptd(e, d)); - } - c2.Ug("Recursive hierarchical layout", p); - n = RD(RD(Vmb(k, k.c.length - 1), 42).b, 51); - while (n.Ob()) { - for (i2 = new Anb(k); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 42); - m = RD(h.b, 51); - g = RD(h.a, 36); - while (m.Ob()) { - l = RD(m.Pb(), 47); - if (ZD(l, 514)) { - if (!g.e) { - l.Kf(g, c2.eh(1)); - break; - } else { - break; - } - } else { - l.Kf(g, c2.eh(1)); - } - } - } - } - c2.Vg(); - } - function Cec(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - b.Ug("Layer size calculation", 1); - k = oxe; - j = pxe; - e = false; - for (h = new Anb(a.b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 30); - i2 = g.c; - i2.a = 0; - i2.b = 0; - if (g.a.c.length == 0) { - continue; - } - e = true; - for (m = new Anb(g.a); m.a < m.c.c.length; ) { - l = RD(ynb(m), 10); - o2 = l.o; - n = l.d; - i2.a = $wnd.Math.max(i2.a, o2.a + n.b + n.c); - } - d = RD(Vmb(g.a, 0), 10); - p = d.n.b - d.d.d; - d.k == (r3b(), m3b) && (p -= RD(mQb(a, (yCc(), eCc)), 140).d); - f2 = RD(Vmb(g.a, g.a.c.length - 1), 10); - c2 = f2.n.b + f2.o.b + f2.d.a; - f2.k == m3b && (c2 += RD(mQb(a, (yCc(), eCc)), 140).a); - i2.b = c2 - p; - k = $wnd.Math.min(k, p); - j = $wnd.Math.max(j, c2); - } - if (!e) { - k = 0; - j = 0; - } - a.f.b = j - k; - a.c.b -= k; - b.Vg(); - } - function p2b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - f2 = 0; - g = 0; - for (j = new Anb(a.a); j.a < j.c.c.length; ) { - h = RD(ynb(j), 10); - f2 = $wnd.Math.max(f2, h.d.b); - g = $wnd.Math.max(g, h.d.c); - } - for (i2 = new Anb(a.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - c2 = RD(mQb(h, (yCc(), Rzc)), 255); - switch (c2.g) { - case 1: - o2 = 0; - break; - case 2: - o2 = 1; - break; - case 5: - o2 = 0.5; - break; - default: - d = 0; - l = 0; - for (n = new Anb(h.j); n.a < n.c.c.length; ) { - m = RD(ynb(n), 12); - m.e.c.length == 0 || ++d; - m.g.c.length == 0 || ++l; - } - d + l == 0 ? o2 = 0.5 : o2 = l / (d + l); - } - q = a.c; - k = h.o.a; - r = (q.a - k) * o2; - o2 > 0.5 ? r -= g * 2 * (o2 - 0.5) : o2 < 0.5 && (r += f2 * 2 * (0.5 - o2)); - e = h.d.b; - r < e && (r = e); - p = h.d.c; - r > q.a - p - k && (r = q.a - p - k); - h.n.a = b + r; - } - } - function jec(a) { - var b, c2, d, e, f2; - d = RD(mQb(a, (yCc(), UAc)), 171); - if (d == (cxc(), $wc)) { - for (c2 = new is(Mr(Z2b(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 18); - if (!lec(b)) { - throw Adb(new Jed(nBe + X2b(a) + "' has its layer constraint set to FIRST_SEPARATE, but has at least one incoming edge. FIRST_SEPARATE nodes must not have incoming edges.")); - } - } - } else if (d == axc) { - for (f2 = new is(Mr(a3b(a).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (!lec(e)) { - throw Adb(new Jed(nBe + X2b(a) + "' has its layer constraint set to LAST_SEPARATE, but has at least one outgoing edge. LAST_SEPARATE nodes must not have outgoing edges.")); - } - } - } - } - function Qed(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - if (a.e && a.c.c < a.f) { - throw Adb(new dgb("Expected " + a.f + " phases to be configured; only found " + a.c.c)); - } - k = RD(mfb(a.g), 9); - n = ev(a.f); - for (f2 = k, h = 0, j = f2.length; h < j; ++h) { - d = f2[h]; - l = RD(Med(a, d.g), 188); - l ? Rmb(n, RD(Ted(a, l), 106)) : (n.c.push(null), true); - } - o2 = new ufd(); - FDb(CDb(GDb(CDb(new SDb(null, new Swb(n, 16)), new Zed()), new _ed(b)), new bfd()), new dfd(o2)); - ofd(o2, a.a); - c2 = new bnb(); - for (e = k, g = 0, i2 = e.length; g < i2; ++g) { - d = e[g]; - Tmb(c2, Ued(a, Ux(RD(Med(o2, d.g), 20)))); - m = RD(Vmb(n, d.g), 106); - !!m && (ZEb(c2.c, m), true); - } - Tmb(c2, Ued(a, Ux(RD(Med(o2, k[k.length - 1].g + 1), 20)))); - return c2; - } - function Frc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - m = new bnb(); - e = new bnb(); - p = null; - for (h = b.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 17); - f2 = new Trc(g.a); - ZEb(e.c, f2); - if (p) { - f2.d = p; - p.e = f2; - } - p = f2; - } - t = Erc(a); - for (k = 0; k < e.c.length; ++k) { - n = null; - q = Src((tFb(0, e.c.length), RD(e.c[0], 661))); - c2 = null; - d = oxe; - for (l = 1; l < a.b.c.length; ++l) { - r = q ? $wnd.Math.abs(q.b - l) : $wnd.Math.abs(l - n.b) + 1; - o2 = n ? $wnd.Math.abs(l - n.b) : r + 1; - if (o2 < r) { - j = n; - i2 = o2; - } else { - j = q; - i2 = r; - } - s = (u = Kfb(UD(mQb(a, (yCc(), sCc)))), t[l] + $wnd.Math.pow(i2, u)); - if (s < d) { - d = s; - c2 = j; - c2.c = l; - } - if (!!q && l == q.b) { - n = q; - q = Nrc(q); - } - } - if (c2) { - Rmb(m, sgb(c2.c)); - c2.a = true; - Orc(c2); - } - } - yob(); - Ynb(m.c, m.c.length, null); - return m; - } - function iD(a, b, c2) { - var d, e, f2, g, h, i2; - if (b.l == 0 && b.m == 0 && b.h == 0) { - throw Adb(new teb("divide by zero")); - } - if (a.l == 0 && a.m == 0 && a.h == 0) { - c2 && (eD = hD(0, 0, 0)); - return hD(0, 0, 0); - } - if (b.h == fxe && b.m == 0 && b.l == 0) { - return jD(a, c2); - } - i2 = false; - if (b.h >> 19 != 0) { - b = xD(b); - i2 = !i2; - } - g = pD(b); - f2 = false; - e = false; - d = false; - if (a.h == fxe && a.m == 0 && a.l == 0) { - e = true; - f2 = true; - if (g == -1) { - a = gD((MD(), ID)); - d = true; - i2 = !i2; - } else { - h = BD(a, g); - i2 && nD(h); - c2 && (eD = hD(0, 0, 0)); - return h; - } - } else if (a.h >> 19 != 0) { - f2 = true; - a = xD(a); - d = true; - i2 = !i2; - } - if (g != -1) { - return kD(a, g, i2, f2, c2); - } - if (uD(a, b) < 0) { - c2 && (f2 ? eD = xD(a) : eD = hD(a.l, a.m, a.h)); - return hD(0, 0, 0); - } - return lD(d ? a : hD(a.l, a.m, a.h), b, i2, f2, e, c2); - } - function Bjb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - g = a.e; - i2 = b.e; - if (g == 0) { - return b; - } - if (i2 == 0) { - return a; - } - f2 = a.d; - h = b.d; - if (f2 + h == 2) { - c2 = Cdb(a.a[0], yxe); - d = Cdb(b.a[0], yxe); - if (g == i2) { - k = Bdb(c2, d); - o2 = Ydb(k); - n = Ydb(Udb(k, 32)); - return n == 0 ? new ajb(g, o2) : new cjb(g, 2, cD(WC(kE, 1), Pwe, 28, 15, [o2, n])); - } - return Pib(), Jdb(g < 0 ? Vdb(d, c2) : Vdb(c2, d), 0) ? jjb(g < 0 ? Vdb(d, c2) : Vdb(c2, d)) : Xib(jjb(Odb(g < 0 ? Vdb(d, c2) : Vdb(c2, d)))); - } else if (g == i2) { - m = g; - l = f2 >= h ? Cjb(a.a, f2, b.a, h) : Cjb(b.a, h, a.a, f2); - } else { - e = f2 != h ? f2 > h ? 1 : -1 : Ejb(a.a, b.a, f2); - if (e == 0) { - return Pib(), Oib; - } - if (e == 1) { - m = g; - l = Hjb(a.a, f2, b.a, h); - } else { - m = i2; - l = Hjb(b.a, h, a.a, f2); - } - } - j = new cjb(m, l.length, l); - Rib(j); - return j; - } - function KUc(a, b) { - var c2, d, e, f2, g, h, i2; - if (a.g > b.f || b.g > a.f) { - return; - } - c2 = 0; - d = 0; - for (g = a.w.a.ec().Kc(); g.Ob(); ) { - e = RD(g.Pb(), 12); - AVc(xjd(cD(WC(l3, 1), Nve, 8, 0, [e.i.n, e.n, e.a])).b, b.g, b.f) && ++c2; - } - for (h = a.r.a.ec().Kc(); h.Ob(); ) { - e = RD(h.Pb(), 12); - AVc(xjd(cD(WC(l3, 1), Nve, 8, 0, [e.i.n, e.n, e.a])).b, b.g, b.f) && --c2; - } - for (i2 = b.w.a.ec().Kc(); i2.Ob(); ) { - e = RD(i2.Pb(), 12); - AVc(xjd(cD(WC(l3, 1), Nve, 8, 0, [e.i.n, e.n, e.a])).b, a.g, a.f) && ++d; - } - for (f2 = b.r.a.ec().Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 12); - AVc(xjd(cD(WC(l3, 1), Nve, 8, 0, [e.i.n, e.n, e.a])).b, a.g, a.f) && --d; - } - if (c2 < d) { - new _Uc(a, b, d - c2); - } else if (d < c2) { - new _Uc(b, a, c2 - d); - } else { - new _Uc(b, a, 0); - new _Uc(a, b, 0); - } - } - function ASb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s; - j = b.c; - e = zRb(a.e); - l = ijd(njd(ajd(yRb(a.e)), a.d * a.a, a.c * a.b), -0.5); - c2 = e.a - l.a; - d = e.b - l.b; - g = b.a; - c2 = g.c - c2; - d = g.d - d; - for (i2 = new Anb(j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 407); - m = h.b; - n = c2 + m.a; - q = d + m.b; - o2 = eE(n / a.a); - r = eE(q / a.b); - f2 = h.a; - switch (f2.g) { - case 0: - k = (IPb(), FPb); - break; - case 1: - k = (IPb(), EPb); - break; - case 2: - k = (IPb(), GPb); - break; - default: - k = (IPb(), HPb); - } - if (f2.a) { - s = eE((q + h.c) / a.b); - Rmb(a.f, new lRb(k, sgb(r), sgb(s))); - f2 == (IRb(), HRb) ? eQb(a, 0, r, o2, s) : eQb(a, o2, r, a.d - 1, s); - } else { - p = eE((n + h.c) / a.a); - Rmb(a.f, new lRb(k, sgb(o2), sgb(p))); - f2 == (IRb(), FRb) ? eQb(a, o2, 0, p, r) : eQb(a, o2, r, p, a.c - 1); - } - } - } - function Q$d(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - b = new Z$d(); - c2 = new Z$d(); - j = lhb(pKe, (e = bAd(a.b, qKe), !e ? null : WD($Nd((!e.b && (e.b = new SVd((JTd(), FTd), C8, e)), e.b), rKe)))); - for (i2 = 0; i2 < a.i; ++i2) { - h = RD(a.g[i2], 179); - if (ZD(h, 102)) { - g = RD(h, 19); - (g.Bb & QHe) != 0 ? ((g.Bb & Ove) == 0 || !j && (f2 = bAd(g, qKe), (!f2 ? null : WD($Nd((!f2.b && (f2.b = new SVd((JTd(), FTd), C8, f2)), f2.b), FIe))) == null)) && WGd(b, g) : (k = Z5d(g), !!k && (k.Bb & QHe) != 0 || ((g.Bb & Ove) == 0 || !j && (d = bAd(g, qKe), (!d ? null : WD($Nd((!d.b && (d.b = new SVd((JTd(), FTd), C8, d)), d.b), FIe))) == null)) && WGd(c2, g)); - } else { - nke(); - if (RD(h, 69).xk()) { - if (!h.sk()) { - WGd(b, h); - WGd(c2, h); - } - } - } - } - VHd(b); - VHd(c2); - a.a = RD(b.g, 254); - RD(c2.g, 254); - } - function Eee(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - if (BYd(b, c2) >= 0) { - return c2; - } - switch (yfe(Qee(a, c2))) { - case 2: { - if (lhb("", Oee(a, c2.qk()).xe())) { - i2 = Bfe(Qee(a, c2)); - h = Afe(Qee(a, c2)); - k = Ree(a, b, i2, h); - if (k) { - return k; - } - e = Fee(a, b); - for (g = 0, l = e.gc(); g < l; ++g) { - k = RD(e.Xb(g), 179); - if (Xee(Cfe(Qee(a, k)), i2)) { - return k; - } - } - } - return null; - } - case 4: { - if (lhb("", Oee(a, c2.qk()).xe())) { - for (d = c2; d; d = xfe(Qee(a, d))) { - j = Bfe(Qee(a, d)); - h = Afe(Qee(a, d)); - k = See(a, b, j, h); - if (k) { - return k; - } - } - i2 = Bfe(Qee(a, c2)); - if (lhb(dLe, i2)) { - return Tee(a, b); - } else { - f2 = Gee(a, b); - for (g = 0, l = f2.gc(); g < l; ++g) { - k = RD(f2.Xb(g), 179); - if (Xee(Cfe(Qee(a, k)), i2)) { - return k; - } - } - } - } - return null; - } - default: { - return null; - } - } - } - function Tfe(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - if (c2.gc() == 0) { - return false; - } - h = (nke(), RD(b, 69).xk()); - f2 = h ? c2 : new ZHd(c2.gc()); - if (qke(a.e, b)) { - if (b.Si()) { - for (j = c2.Kc(); j.Ob(); ) { - i2 = j.Pb(); - if (!dge(a, b, i2, ZD(b, 102) && (RD(b, 19).Bb & txe) != 0)) { - e = oke(b, i2); - f2.Hc(e) || f2.Fc(e); - } - } - } else if (!h) { - for (j = c2.Kc(); j.Ob(); ) { - i2 = j.Pb(); - e = oke(b, i2); - f2.Fc(e); - } - } - } else { - if (c2.gc() > 1) { - throw Adb(new agb(gLe)); - } - k = pke(a.e.Dh(), b); - d = RD(a.g, 124); - for (g = 0; g < a.i; ++g) { - e = d[g]; - if (k.am(e.Lk())) { - if (c2.Hc(h ? e : e.md())) { - return false; - } else { - for (j = c2.Kc(); j.Ob(); ) { - i2 = j.Pb(); - RD(eHd(a, g, h ? RD(i2, 76) : oke(b, i2)), 76); - } - return true; - } - } - } - if (!h) { - e = oke(b, c2.Kc().Pb()); - f2.Fc(e); - } - } - return YGd(a, f2); - } - function QQc(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - k = new Yub(); - for (h = (j = new glb(a.c).a.vc().Kc(), new llb(j)); h.a.Ob(); ) { - f2 = (e = RD(h.a.Pb(), 44), RD(e.md(), 467)); - f2.b == 0 && (Pub(k, f2, k.c.b, k.c), true); - } - while (k.b != 0) { - f2 = RD(k.b == 0 ? null : (sFb(k.b != 0), Wub(k, k.a.a)), 467); - f2.a == null && (f2.a = 0); - for (d = new Anb(f2.d); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 663); - c2.b.a == null ? c2.b.a = Kfb(f2.a) + c2.a : b.o == (EQc(), CQc) ? c2.b.a = $wnd.Math.min(Kfb(c2.b.a), Kfb(f2.a) + c2.a) : c2.b.a = $wnd.Math.max(Kfb(c2.b.a), Kfb(f2.a) + c2.a); - --c2.b.b; - c2.b.b == 0 && Mub(k, c2.b); - } - } - for (g = (i2 = new glb(a.c).a.vc().Kc(), new llb(i2)); g.a.Ob(); ) { - f2 = (e = RD(g.a.Pb(), 44), RD(e.md(), 467)); - b.i[f2.c.p] = f2.a; - } - } - function kSc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2; - k = c2 + b.c.c.a; - for (n = new Anb(b.j); n.a < n.c.c.length; ) { - m = RD(ynb(n), 12); - e = xjd(cD(WC(l3, 1), Nve, 8, 0, [m.i.n, m.n, m.a])); - if (b.k == (r3b(), q3b)) { - h = RD(mQb(m, (Ywc(), Awc)), 12); - e.a = xjd(cD(WC(l3, 1), Nve, 8, 0, [h.i.n, h.n, h.a])).a; - b.n.a = e.a; - } - g = new rjd(0, e.b); - if (m.j == (qpd(), Xod)) { - g.a = k; - } else if (m.j == ppd) { - g.a = c2; - } else { - continue; - } - o2 = $wnd.Math.abs(e.a - g.a); - if (o2 <= d && !hSc(b)) { - continue; - } - f2 = m.g.c.length + m.e.c.length > 1; - for (j = new l4b(m.b); xnb(j.a) || xnb(j.b); ) { - i2 = RD(xnb(j.a) ? ynb(j.a) : ynb(j.b), 18); - l = i2.c == m ? i2.d : i2.c; - $wnd.Math.abs(xjd(cD(WC(l3, 1), Nve, 8, 0, [l.i.n, l.n, l.a])).b - g.b) > 1 && eSc(a, i2, g, f2, m); - } - } - } - function vUc(a) { - var b, c2, d, e, f2, g; - e = new Jkb(a.e, 0); - d = new Jkb(a.a, 0); - if (a.d) { - for (c2 = 0; c2 < a.b; c2++) { - sFb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - } - } else { - for (c2 = 0; c2 < a.b - 1; c2++) { - sFb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - Ckb(e); - } - } - b = Kfb((sFb(e.b < e.d.gc()), UD(e.d.Xb(e.c = e.b++)))); - while (a.f - b > AEe) { - f2 = b; - g = 0; - while ($wnd.Math.abs(b - f2) < AEe) { - ++g; - b = Kfb((sFb(e.b < e.d.gc()), UD(e.d.Xb(e.c = e.b++)))); - sFb(d.b < d.d.gc()); - d.d.Xb(d.c = d.b++); - } - if (g < a.b) { - sFb(e.b > 0); - e.a.Xb(e.c = --e.b); - uUc(a, a.b - g, f2, d, e); - sFb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - } - sFb(d.b > 0); - d.a.Xb(d.c = --d.b); - } - if (!a.d) { - for (c2 = 0; c2 < a.b - 1; c2++) { - sFb(e.b < e.d.gc()); - e.d.Xb(e.c = e.b++); - Ckb(e); - } - } - a.d = true; - a.c = true; - } - function nme() { - nme = geb; - Rle = (Qle(), Ple).b; - Ule = RD(QHd(xYd(Ple.b), 0), 35); - Sle = RD(QHd(xYd(Ple.b), 1), 35); - Tle = RD(QHd(xYd(Ple.b), 2), 35); - cme = Ple.bb; - RD(QHd(xYd(Ple.bb), 0), 35); - RD(QHd(xYd(Ple.bb), 1), 35); - eme = Ple.fb; - fme = RD(QHd(xYd(Ple.fb), 0), 35); - RD(QHd(xYd(Ple.fb), 1), 35); - RD(QHd(xYd(Ple.fb), 2), 19); - hme = Ple.qb; - kme = RD(QHd(xYd(Ple.qb), 0), 35); - RD(QHd(xYd(Ple.qb), 1), 19); - RD(QHd(xYd(Ple.qb), 2), 19); - ime = RD(QHd(xYd(Ple.qb), 3), 35); - jme = RD(QHd(xYd(Ple.qb), 4), 35); - mme = RD(QHd(xYd(Ple.qb), 6), 35); - lme = RD(QHd(xYd(Ple.qb), 5), 19); - Vle = Ple.j; - Wle = Ple.k; - Xle = Ple.q; - Yle = Ple.w; - Zle = Ple.B; - $le = Ple.A; - _le = Ple.C; - ame = Ple.D; - bme = Ple._; - dme = Ple.cb; - gme = Ple.hb; - } - function yIc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - a.c = 0; - a.b = 0; - d = 2 * b.c.a.c.length + 1; - o: - for (l = c2.Kc(); l.Ob(); ) { - k = RD(l.Pb(), 12); - h = k.j == (qpd(), Yod) || k.j == npd; - n = 0; - if (h) { - m = RD(mQb(k, (Ywc(), Iwc)), 10); - if (!m) { - continue; - } - n += tIc(a, d, k, m); - } else { - for (j = new Anb(k.g); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 18); - e = i2.d; - if (e.i.c == b.c) { - Rmb(a.a, k); - continue o; - } else { - n += a.g[e.p]; - } - } - for (g = new Anb(k.e); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 18); - e = f2.c; - if (e.i.c == b.c) { - Rmb(a.a, k); - continue o; - } else { - n -= a.g[e.p]; - } - } - } - if (k.e.c.length + k.g.c.length > 0) { - a.f[k.p] = n / (k.e.c.length + k.g.c.length); - a.c = $wnd.Math.min(a.c, a.f[k.p]); - a.b = $wnd.Math.max(a.b, a.f[k.p]); - } else - h && (a.f[k.p] = n); - } - } - function xne(a) { - a.b = null; - a.bb = null; - a.fb = null; - a.qb = null; - a.a = null; - a.c = null; - a.d = null; - a.e = null; - a.f = null; - a.n = null; - a.M = null; - a.L = null; - a.Q = null; - a.R = null; - a.K = null; - a.db = null; - a.eb = null; - a.g = null; - a.i = null; - a.j = null; - a.k = null; - a.gb = null; - a.o = null; - a.p = null; - a.q = null; - a.r = null; - a.$ = null; - a.ib = null; - a.S = null; - a.T = null; - a.t = null; - a.s = null; - a.u = null; - a.v = null; - a.w = null; - a.B = null; - a.A = null; - a.C = null; - a.D = null; - a.F = null; - a.G = null; - a.H = null; - a.I = null; - a.J = null; - a.P = null; - a.Z = null; - a.U = null; - a.V = null; - a.W = null; - a.X = null; - a.Y = null; - a._ = null; - a.ab = null; - a.cb = null; - a.hb = null; - a.nb = null; - a.lb = null; - a.mb = null; - a.ob = null; - a.pb = null; - a.jb = null; - a.kb = null; - a.N = false; - a.O = false; - } - function C8b(a, b, c2) { - var d, e, f2, g; - c2.Ug("Graph transformation (" + a.a + ")", 1); - g = bv(b.a); - for (f2 = new Anb(b.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - Tmb(g, e.a); - } - d = RD(mQb(b, (yCc(), sAc)), 428); - if (d == ($tc(), Ytc)) { - switch (RD(mQb(b, rAc), 88).g) { - case 2: - q8b(b, g); - break; - case 3: - G8b(b, g); - break; - case 4: - if (a.a == (P8b(), O8b)) { - G8b(b, g); - r8b(b, g); - } else { - r8b(b, g); - G8b(b, g); - } - } - } else { - if (a.a == (P8b(), O8b)) { - switch (RD(mQb(b, rAc), 88).g) { - case 2: - q8b(b, g); - r8b(b, g); - break; - case 3: - G8b(b, g); - q8b(b, g); - break; - case 4: - q8b(b, g); - G8b(b, g); - } - } else { - switch (RD(mQb(b, rAc), 88).g) { - case 2: - q8b(b, g); - r8b(b, g); - break; - case 3: - q8b(b, g); - G8b(b, g); - break; - case 4: - G8b(b, g); - q8b(b, g); - } - } - } - c2.Vg(); - } - function AXb(a) { - var b, c2, d, e, f2, g, h, i2; - for (f2 = new Anb(a.a.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 86); - e.b.c = e.g.c; - e.b.d = e.g.d; - } - i2 = new rjd(oxe, oxe); - b = new rjd(pxe, pxe); - for (d = new Anb(a.a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 86); - i2.a = $wnd.Math.min(i2.a, c2.g.c); - i2.b = $wnd.Math.min(i2.b, c2.g.d); - b.a = $wnd.Math.max(b.a, c2.g.c + c2.g.b); - b.b = $wnd.Math.max(b.b, c2.g.d + c2.g.a); - } - for (h = Uc(a.c).a.nc(); h.Ob(); ) { - g = RD(h.Pb(), 42); - c2 = RD(g.b, 86); - i2.a = $wnd.Math.min(i2.a, c2.g.c); - i2.b = $wnd.Math.min(i2.b, c2.g.d); - b.a = $wnd.Math.max(b.a, c2.g.c + c2.g.b); - b.b = $wnd.Math.max(b.b, c2.g.d + c2.g.a); - } - a.d = fjd(new rjd(i2.a, i2.b)); - a.e = ojd(new rjd(b.a, b.b), i2); - a.a.a.c.length = 0; - a.a.b.c.length = 0; - } - function LZb(a) { - CZb(); - var b, c2, d, e, f2, g, h; - h = new EZb(); - for (c2 = new Anb(a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 148); - (!h.b || b.c >= h.b.c) && (h.b = b); - if (!h.c || b.c <= h.c.c) { - h.d = h.c; - h.c = b; - } - (!h.e || b.d >= h.e.d) && (h.e = b); - (!h.f || b.d <= h.f.d) && (h.f = b); - } - d = new PZb((nZb(), jZb)); - t$b(a, AZb, new mob(cD(WC(wQ, 1), rve, 382, 0, [d]))); - g = new PZb(mZb); - t$b(a, zZb, new mob(cD(WC(wQ, 1), rve, 382, 0, [g]))); - e = new PZb(kZb); - t$b(a, yZb, new mob(cD(WC(wQ, 1), rve, 382, 0, [e]))); - f2 = new PZb(lZb); - t$b(a, xZb, new mob(cD(WC(wQ, 1), rve, 382, 0, [f2]))); - FZb(d.c, jZb); - FZb(e.c, kZb); - FZb(f2.c, lZb); - FZb(g.c, mZb); - h.a.c.length = 0; - Tmb(h.a, d.c); - Tmb(h.a, hv(e.c)); - Tmb(h.a, f2.c); - Tmb(h.a, hv(g.c)); - return h; - } - function n9c(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - b.Ug(bGe, 1); - n = Kfb(UD(Gxd(a, (X6c(), W6c)))); - g = Kfb(UD(Gxd(a, (X7c(), Q7c)))); - h = RD(Gxd(a, N7c), 107); - Bad((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); - k = U8c((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a), n, g); - !a.a && (a.a = new C5d(J4, a, 10, 11)); - for (j = new Anb(k); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 186); - for (e = new Anb(i2.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 172); - m = new had(d.s, d.t, Kfb(UD(Gxd(a, Q7c)))); - aad(m, d); - Rmb(i2.d, m); - } - } - l = zad(k, g); - o2 = $wnd.Math.max(l.a, Kfb(UD(Gxd(a, U6c))) - (h.b + h.c)); - f2 = $wnd.Math.max(l.b, Kfb(UD(Gxd(a, R6c))) - (h.d + h.a)); - c2 = f2 - l.b; - Ixd(a, M6c, c2); - Ixd(a, O6c, o2); - Ixd(a, N6c, f2 + c2); - Ixd(a, V6c, k); - b.Vg(); - } - function A9b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - j = new Iub(); - k = new Iub(); - o2 = new Iub(); - p = new Iub(); - i2 = Kfb(UD(mQb(b, (yCc(), bCc)))); - f2 = Kfb(UD(mQb(b, TBc))); - for (h = new Anb(c2); h.a < h.c.c.length; ) { - g = RD(ynb(h), 10); - l = RD(mQb(g, (Ywc(), hwc)), 64); - if (l == (qpd(), Yod)) { - k.a.zc(g, k); - for (e = new is(Mr(Z2b(g).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - Ysb(j, d.c.i); - } - } else if (l == npd) { - p.a.zc(g, p); - for (e = new is(Mr(Z2b(g).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - Ysb(o2, d.c.i); - } - } - } - if (j.a.gc() != 0) { - m = new TTc(2, f2); - n = STc(m, b, j, k, -i2 - b.c.b); - if (n > 0) { - a.a = i2 + (n - 1) * f2; - b.c.b += a.a; - b.f.b += a.a; - } - } - if (o2.a.gc() != 0) { - m = new TTc(1, f2); - n = STc(m, b, o2, p, b.f.b + i2 - b.c.b); - n > 0 && (b.f.b += i2 + (n - 1) * f2); - } - } - function osc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - k = Kfb(UD(mQb(a, (yCc(), WBc)))); - d = Kfb(UD(mQb(a, nCc))); - m = new dtd(); - pQb(m, WBc, k + d); - j = b; - r = j.d; - p = j.c.i; - s = j.d.i; - q = Q4b(p.c); - t = Q4b(s.c); - e = new bnb(); - for (l = q; l <= t; l++) { - h = new j3b(a); - h3b(h, (r3b(), o3b)); - pQb(h, (Ywc(), Awc), j); - pQb(h, BBc, (Bod(), wod)); - pQb(h, YBc, m); - n = RD(Vmb(a.b, l), 30); - l == q ? f3b(h, n.a.c.length - c2, n) : g3b(h, n); - u = Kfb(UD(mQb(j, FAc))); - if (u < 0) { - u = 0; - pQb(j, FAc, u); - } - h.o.b = u; - o2 = $wnd.Math.floor(u / 2); - g = new R3b(); - Q3b(g, (qpd(), ppd)); - P3b(g, h); - g.n.b = o2; - i2 = new R3b(); - Q3b(i2, Xod); - P3b(i2, h); - i2.n.b = o2; - Z0b(j, g); - f2 = new a1b(); - kQb(f2, j); - pQb(f2, RAc, null); - Y0b(f2, i2); - Z0b(f2, r); - psc(h, j, f2); - ZEb(e.c, f2); - j = f2; - } - return e; - } - function Hec(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - i2 = RD(e3b(a, (qpd(), ppd)).Kc().Pb(), 12).e; - n = RD(e3b(a, Xod).Kc().Pb(), 12).g; - h = i2.c.length; - t = K3b(RD(Vmb(a.j, 0), 12)); - while (h-- > 0) { - p = (tFb(0, i2.c.length), RD(i2.c[0], 18)); - e = (tFb(0, n.c.length), RD(n.c[0], 18)); - s = e.d.e; - f2 = Wmb(s, e, 0); - $0b(p, e.d, f2); - Y0b(e, null); - Z0b(e, null); - o2 = p.a; - b && Mub(o2, new sjd(t)); - for (d = Sub(e.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 8); - Mub(o2, new sjd(c2)); - } - r = p.b; - for (m = new Anb(e.b); m.a < m.c.c.length; ) { - l = RD(ynb(m), 72); - ZEb(r.c, l); - } - q = RD(mQb(p, (yCc(), RAc)), 75); - g = RD(mQb(e, RAc), 75); - if (g) { - if (!q) { - q = new Ejd(); - pQb(p, RAc, q); - } - for (k = Sub(g, 0); k.b != k.d.c; ) { - j = RD(evb(k), 8); - Mub(q, new sjd(j)); - } - } - } - } - function $Qc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - p = b.b.c.length; - if (p < 3) { - return; - } - n = $C(kE, Pwe, 28, p, 15, 1); - l = 0; - for (k = new Anb(b.b); k.a < k.c.c.length; ) { - j = RD(ynb(k), 30); - n[l++] = j.a.c.length; - } - m = new Jkb(b.b, 2); - for (d = 1; d < p - 1; d++) { - c2 = (sFb(m.b < m.d.gc()), RD(m.d.Xb(m.c = m.b++), 30)); - o2 = new Anb(c2.a); - f2 = 0; - h = 0; - for (i2 = 0; i2 < n[d + 1]; i2++) { - t = RD(ynb(o2), 10); - if (i2 == n[d + 1] - 1 || ZQc(a, t, d + 1, d)) { - g = n[d] - 1; - ZQc(a, t, d + 1, d) && (g = a.c.e[RD(RD(RD(Vmb(a.c.b, t.p), 15).Xb(0), 42).a, 10).p]); - while (h <= i2) { - s = RD(Vmb(c2.a, h), 10); - if (!ZQc(a, s, d + 1, d)) { - for (r = RD(Vmb(a.c.b, s.p), 15).Kc(); r.Ob(); ) { - q = RD(r.Pb(), 42); - e = a.c.e[RD(q.a, 10).p]; - (e < f2 || e > g) && Ysb(a.b, RD(q.b, 18)); - } - } - ++h; - } - f2 = g; - } - } - } - } - function zhd(b, c2) { - var d; - if (c2 == null || lhb(c2, vve)) { - return null; - } - if (c2.length == 0 && b.k != (kid(), fid)) { - return null; - } - switch (b.k.g) { - case 1: - return mhb(c2, FGe) ? (Geb(), Feb) : mhb(c2, GGe) ? (Geb(), Eeb) : null; - case 2: - try { - return sgb(Oeb(c2, qwe, lve)); - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - return null; - } else - throw Adb(a); - } - case 4: - try { - return Neb(c2); - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - return null; - } else - throw Adb(a); - } - case 3: - return c2; - case 5: - uhd(b); - return xhd(b, c2); - case 6: - uhd(b); - return yhd(b, b.a, c2); - case 7: - try { - d = whd(b); - d.cg(c2); - return d; - } catch (a) { - a = zdb(a); - if (ZD(a, 33)) { - return null; - } else - throw Adb(a); - } - default: - throw Adb(new dgb("Invalid type set for this layout option.")); - } - } - function JKd(a) { - var b; - switch (a.d) { - case 1: { - if (a.Sj()) { - return a.o != -2; - } - break; - } - case 2: { - if (a.Sj()) { - return a.o == -2; - } - break; - } - case 3: - case 5: - case 4: - case 6: - case 7: { - return a.o > -2; - } - default: { - return false; - } - } - b = a.Rj(); - switch (a.p) { - case 0: - return b != null && Heb(TD(b)) != Pdb(a.k, 0); - case 1: - return b != null && RD(b, 222).a != Ydb(a.k) << 24 >> 24; - case 2: - return b != null && RD(b, 180).a != (Ydb(a.k) & Bwe); - case 6: - return b != null && Pdb(RD(b, 168).a, a.k); - case 5: - return b != null && RD(b, 17).a != Ydb(a.k); - case 7: - return b != null && RD(b, 191).a != Ydb(a.k) << 16 >> 16; - case 3: - return b != null && Kfb(UD(b)) != a.j; - case 4: - return b != null && RD(b, 161).a != a.j; - default: - return b == null ? a.n != null : !pb(b, a.n); - } - } - function N_d(a, b, c2) { - var d, e, f2, g; - if (a.ol() && a.nl()) { - g = O_d(a, RD(c2, 58)); - if (dE(g) !== dE(c2)) { - a.xj(b); - a.Dj(b, P_d(a, b, g)); - if (a.al()) { - f2 = (e = RD(c2, 54), a.ml() ? a.kl() ? e.Th(a.b, Z5d(RD(vYd(Uwd(a.b), a.Lj()), 19)).n, RD(vYd(Uwd(a.b), a.Lj()).Hk(), 29).kk(), null) : e.Th(a.b, BYd(e.Dh(), Z5d(RD(vYd(Uwd(a.b), a.Lj()), 19))), null, null) : e.Th(a.b, -1 - a.Lj(), null, null)); - !RD(g, 54).Ph() && (f2 = (d = RD(g, 54), a.ml() ? a.kl() ? d.Rh(a.b, Z5d(RD(vYd(Uwd(a.b), a.Lj()), 19)).n, RD(vYd(Uwd(a.b), a.Lj()).Hk(), 29).kk(), f2) : d.Rh(a.b, BYd(d.Dh(), Z5d(RD(vYd(Uwd(a.b), a.Lj()), 19))), null, f2) : d.Rh(a.b, -1 - a.Lj(), null, f2))); - !!f2 && f2.oj(); - } - Mvd(a.b) && a.Jj(a.Ij(9, c2, g, b, false)); - return g; - } - } - return c2; - } - function iJb(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - d = new bnb(); - for (g = new Anb(a.e.a); g.a < g.c.c.length; ) { - e = RD(ynb(g), 125); - k = 0; - e.k.c.length = 0; - for (c2 = new Anb(CIb(e)); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 218); - if (b.f) { - Rmb(e.k, b); - ++k; - } - } - k == 1 && (ZEb(d.c, e), true); - } - for (f2 = new Anb(d); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 125); - while (e.k.c.length == 1) { - j = RD(ynb(new Anb(e.k)), 218); - a.b[j.c] = j.g; - h = j.d; - i2 = j.e; - for (c2 = new Anb(CIb(e)); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 218); - pb(b, j) || (b.f ? h == b.d || i2 == b.e ? a.b[j.c] -= a.b[b.c] - b.g : a.b[j.c] += a.b[b.c] - b.g : e == h ? b.d == e ? a.b[j.c] += b.g : a.b[j.c] -= b.g : b.d == e ? a.b[j.c] -= b.g : a.b[j.c] += b.g); - } - Ymb(h.k, j); - Ymb(i2.k, j); - h == e ? e = j.e : e = j.d; - } - } - } - function vMb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - c2 = RD(Vrb(a.b, b), 127); - i2 = RD(RD(Qc(a.r, b), 21), 87); - if (i2.dc()) { - c2.n.b = 0; - c2.n.c = 0; - return; - } - j = a.u.Hc((Pod(), Lod)); - g = 0; - h = i2.Kc(); - k = null; - l = 0; - m = 0; - while (h.Ob()) { - d = RD(h.Pb(), 117); - e = Kfb(UD(d.b.of((tNb(), sNb)))); - f2 = d.b.Mf().a; - a.A.Hc((Qpd(), Ppd)) && BMb(a, b); - if (!k) { - !!a.C && a.C.b > 0 && (g = $wnd.Math.max(g, zMb(a.C.b + d.d.b, e))); - } else { - n = m + k.d.c + a.w + d.d.b; - g = $wnd.Math.max(g, (Zy(), bz(Tye), $wnd.Math.abs(l - e) <= Tye || l == e || isNaN(l) && isNaN(e) ? 0 : n / (e - l))); - } - k = d; - l = e; - m = f2; - } - if (!!a.C && a.C.c > 0) { - n = m + a.C.c; - j && (n += k.d.c); - g = $wnd.Math.max(g, (Zy(), bz(Tye), $wnd.Math.abs(l - 1) <= Tye || l == 1 || isNaN(l) && isNaN(1) ? 0 : n / (1 - l))); - } - c2.n.b = 0; - c2.a.a = g; - } - function ENb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - c2 = RD(Vrb(a.b, b), 127); - i2 = RD(RD(Qc(a.r, b), 21), 87); - if (i2.dc()) { - c2.n.d = 0; - c2.n.a = 0; - return; - } - j = a.u.Hc((Pod(), Lod)); - g = 0; - a.A.Hc((Qpd(), Ppd)) && JNb(a, b); - h = i2.Kc(); - k = null; - m = 0; - l = 0; - while (h.Ob()) { - d = RD(h.Pb(), 117); - f2 = Kfb(UD(d.b.of((tNb(), sNb)))); - e = d.b.Mf().b; - if (!k) { - !!a.C && a.C.d > 0 && (g = $wnd.Math.max(g, zMb(a.C.d + d.d.d, f2))); - } else { - n = l + k.d.a + a.w + d.d.d; - g = $wnd.Math.max(g, (Zy(), bz(Tye), $wnd.Math.abs(m - f2) <= Tye || m == f2 || isNaN(m) && isNaN(f2) ? 0 : n / (f2 - m))); - } - k = d; - m = f2; - l = e; - } - if (!!a.C && a.C.a > 0) { - n = l + a.C.a; - j && (n += k.d.a); - g = $wnd.Math.max(g, (Zy(), bz(Tye), $wnd.Math.abs(m - 1) <= Tye || m == 1 || isNaN(m) && isNaN(1) ? 0 : n / (1 - m))); - } - c2.n.d = 0; - c2.a.b = g; - } - function L8c(a, b, c2, d, e, f2, g, h) { - var i2, j, k, l, m, n, o2, p, q, r; - o2 = false; - j = dad(c2.q, b.f + b.b - c2.q.f); - n = d.f > b.b && h; - r = e - (c2.q.e + j - g); - l = (i2 = S9c(d, r, false), i2.a); - if (n && l > d.f) { - return false; - } - if (n) { - m = 0; - for (q = new Anb(b.d); q.a < q.c.c.length; ) { - p = RD(ynb(q), 315); - m += dad(p, d.f) + g; - } - r = e - m; - } - if (r < d.g) { - return false; - } - k = f2 == a.c.length - 1 && r >= (tFb(f2, a.c.length), RD(a.c[f2], 186)).e; - if (!n && l > b.b && !k) { - return false; - } - if (k || n || l <= b.b) { - if (k && l > b.b) { - c2.d = l; - Q9c(c2, P9c(c2, l)); - } else { - ead(c2.q, j); - c2.c = true; - } - Q9c(d, e - (c2.s + c2.r)); - U9c(d, c2.q.e + c2.q.d, b.f); - Cad(b, d); - if (a.c.length > f2) { - Fad((tFb(f2, a.c.length), RD(a.c[f2], 186)), d); - (tFb(f2, a.c.length), RD(a.c[f2], 186)).a.c.length == 0 && Xmb(a, f2); - } - o2 = true; - } - return o2; - } - function zJc(a, b, c2) { - var d, e, f2, g, h, i2; - this.g = a; - h = b.d.length; - i2 = c2.d.length; - this.d = $C(jR, WAe, 10, h + i2, 0, 1); - for (g = 0; g < h; g++) { - this.d[g] = b.d[g]; - } - for (f2 = 0; f2 < i2; f2++) { - this.d[h + f2] = c2.d[f2]; - } - if (b.e) { - this.e = gv(b.e); - this.e.Mc(c2); - if (c2.e) { - for (e = c2.e.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 239); - if (d == b) { - continue; - } else - this.e.Hc(d) ? --d.c : this.e.Fc(d); - } - } - } else if (c2.e) { - this.e = gv(c2.e); - this.e.Mc(b); - } - this.f = b.f + c2.f; - this.a = b.a + c2.a; - this.a > 0 ? xJc(this, this.f / this.a) : pJc(b.g, b.d[0]).a != null && pJc(c2.g, c2.d[0]).a != null ? xJc(this, (Kfb(pJc(b.g, b.d[0]).a) + Kfb(pJc(c2.g, c2.d[0]).a)) / 2) : pJc(b.g, b.d[0]).a != null ? xJc(this, pJc(b.g, b.d[0]).a) : pJc(c2.g, c2.d[0]).a != null && xJc(this, pJc(c2.g, c2.d[0]).a); - } - function DXb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - a.a = new fYb(wsb(s3)); - for (d = new Anb(b.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 855); - h = new iYb(cD(WC(bQ, 1), rve, 86, 0, [])); - Rmb(a.a.a, h); - for (j = new Anb(c2.d); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 116); - k = new IXb(a, i2); - CXb(k, RD(mQb(c2.c, (Ywc(), ewc)), 21)); - if (!Ujb(a.g, c2)) { - Zjb(a.g, c2, new rjd(i2.c, i2.d)); - Zjb(a.f, c2, k); - } - Rmb(a.a.b, k); - gYb(h, k); - } - for (g = new Anb(c2.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 602); - k = new IXb(a, f2.Df()); - Zjb(a.b, f2, new Ptd(h, k)); - CXb(k, RD(mQb(c2.c, (Ywc(), ewc)), 21)); - if (f2.Bf()) { - l = new JXb(a, f2.Bf(), 1); - CXb(l, RD(mQb(c2.c, ewc), 21)); - e = new iYb(cD(WC(bQ, 1), rve, 86, 0, [])); - gYb(e, l); - Rc(a.c, f2.Af(), new Ptd(h, l)); - } - } - } - return a.a; - } - function gFc(a) { - var b; - this.a = a; - b = (r3b(), cD(WC(hR, 1), jwe, 273, 0, [p3b, o3b, m3b, q3b, n3b, l3b])).length; - this.b = YC(V5, [Nve, kEe], [601, 149], 0, [b, b], 2); - this.c = YC(V5, [Nve, kEe], [601, 149], 0, [b, b], 2); - fFc(this, p3b, (yCc(), bCc), cCc); - dFc(this, p3b, o3b, WBc, XBc); - cFc(this, p3b, q3b, WBc); - cFc(this, p3b, m3b, WBc); - dFc(this, p3b, n3b, bCc, cCc); - fFc(this, o3b, TBc, UBc); - cFc(this, o3b, q3b, TBc); - cFc(this, o3b, m3b, TBc); - dFc(this, o3b, n3b, WBc, XBc); - eFc(this, q3b, TBc); - cFc(this, q3b, m3b, TBc); - cFc(this, q3b, n3b, $Bc); - eFc(this, m3b, fCc); - dFc(this, m3b, n3b, aCc, _Bc); - fFc(this, n3b, TBc, TBc); - fFc(this, l3b, TBc, UBc); - dFc(this, l3b, p3b, WBc, XBc); - dFc(this, l3b, n3b, WBc, XBc); - dFc(this, l3b, o3b, WBc, XBc); - } - function zge(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - g = c2.Lk(); - if (ZD(g, 102) && (RD(g, 19).Bb & txe) != 0) { - m = RD(c2.md(), 54); - p = Vvd(a.e, m); - if (p != m) { - k = oke(g, p); - MHd(a, b, Tge(a, b, k)); - l = null; - if (Mvd(a.e)) { - d = Eee((lke(), jke), a.e.Dh(), g); - if (d != vYd(a.e.Dh(), a.c)) { - q = pke(a.e.Dh(), g); - h = 0; - f2 = RD(a.g, 124); - for (i2 = 0; i2 < b; ++i2) { - e = f2[i2]; - q.am(e.Lk()) && ++h; - } - l = new lle(a.e, 9, d, m, p, h, false); - l.nj(new P3d(a.e, 9, a.c, c2, k, b, false)); - } - } - o2 = RD(g, 19); - n = Z5d(o2); - if (n) { - l = m.Th(a.e, BYd(m.Dh(), n), null, l); - l = RD(p, 54).Rh(a.e, BYd(p.Dh(), n), null, l); - } else if ((o2.Bb & QHe) != 0) { - j = -1 - BYd(a.e.Dh(), o2); - l = m.Th(a.e, j, null, null); - !RD(p, 54).Ph() && (l = RD(p, 54).Rh(a.e, j, null, l)); - } - !!l && l.oj(); - return k; - } - } - return c2; - } - function SId(a) { - var b, c2, d; - wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new vmd()])); - c2 = new NB(a); - for (d = 0; d < c2.a.length; ++d) { - b = JB(c2, d).te().a; - lhb(b, "layered") ? wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new Pzc()])) : lhb(b, "force") ? wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new PUb()])) : lhb(b, "stress") ? wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new RVb()])) : lhb(b, "mrtree") ? wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new C$c()])) : lhb(b, "radial") ? wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new E4c()])) : lhb(b, "disco") ? wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new ZHb(), new fSb()])) : lhb(b, "sporeOverlap") || lhb(b, "sporeCompaction") ? wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new Lcd()])) : lhb(b, "rectpacking") && wgd(LId, cD(WC(B2, 1), rve, 134, 0, [new v7c()])); - } - } - function r2b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - m = new sjd(a.o); - r = b.a / m.a; - h = b.b / m.b; - p = b.a - m.a; - f2 = b.b - m.b; - if (c2) { - e = dE(mQb(a, (yCc(), BBc))) === dE((Bod(), wod)); - for (o2 = new Anb(a.j); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 12); - switch (n.j.g) { - case 1: - e || (n.n.a *= r); - break; - case 2: - n.n.a += p; - e || (n.n.b *= h); - break; - case 3: - e || (n.n.a *= r); - n.n.b += f2; - break; - case 4: - e || (n.n.b *= h); - } - } - } - for (j = new Anb(a.b); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 72); - k = i2.n.a + i2.o.a / 2; - l = i2.n.b + i2.o.b / 2; - q = k / m.a; - g = l / m.b; - if (q + g >= 1) { - if (q - g > 0 && l >= 0) { - i2.n.a += p; - i2.n.b += f2 * g; - } else if (q - g < 0 && k >= 0) { - i2.n.a += p * q; - i2.n.b += f2; - } - } - } - a.o.a = b.a; - a.o.b = b.b; - pQb(a, (yCc(), lBc), (Qpd(), d = RD(mfb(H3), 9), new Fsb(d, RD(WEb(d, d.length), 9), 0))); - } - function ISd(a, b, c2, d, e, f2) { - var g; - if (!(b == null || !mSd(b, ZRd, $Rd))) { - throw Adb(new agb("invalid scheme: " + b)); - } - if (!a && !(c2 != null && qhb(c2, Fhb(35)) == -1 && c2.length > 0 && (BFb(0, c2.length), c2.charCodeAt(0) != 47))) { - throw Adb(new agb("invalid opaquePart: " + c2)); - } - if (a && !(b != null && tpb(eSd, b.toLowerCase())) && !(c2 == null || !mSd(c2, aSd, bSd))) { - throw Adb(new agb(NJe + c2)); - } - if (a && b != null && tpb(eSd, b.toLowerCase()) && !ESd(c2)) { - throw Adb(new agb(NJe + c2)); - } - if (!FSd(d)) { - throw Adb(new agb("invalid device: " + d)); - } - if (!HSd(e)) { - g = e == null ? "invalid segments: null" : "invalid segment: " + tSd(e); - throw Adb(new agb(g)); - } - if (!(f2 == null || qhb(f2, Fhb(35)) == -1)) { - throw Adb(new agb("invalid query: " + f2)); - } - } - function WHc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - c2.Ug("Network simplex layering", 1); - a.b = b; - r = RD(mQb(b, (yCc(), gCc)), 17).a * 4; - q = a.b.a; - if (q.c.length < 1) { - c2.Vg(); - return; - } - f2 = SHc(a, q); - p = null; - for (e = Sub(f2, 0); e.b != e.d.c; ) { - d = RD(evb(e), 15); - h = r * eE($wnd.Math.sqrt(d.gc())); - g = VHc(d); - lJb(yJb(AJb(zJb(CJb(g), h), p), true), c2.eh(1)); - m = a.b.b; - for (o2 = new Anb(g.a); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 125); - while (m.c.length <= n.e) { - Qmb(m, m.c.length, new R4b(a.b)); - } - k = RD(n.f, 10); - g3b(k, RD(Vmb(m, n.e), 30)); - } - if (f2.b > 1) { - p = $C(kE, Pwe, 28, a.b.b.c.length, 15, 1); - l = 0; - for (j = new Anb(a.b.b); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 30); - p[l++] = i2.a.c.length; - } - } - } - q.c.length = 0; - a.a = null; - a.b = null; - a.c = null; - c2.Vg(); - } - function tMc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - k = new bnb(); - l = new wmb(); - f2 = null; - e = 0; - for (d = 0; d < b.length; ++d) { - c2 = b[d]; - vMc(f2, c2) && (e = oMc(a, l, k, cMc, e)); - nQb(c2, (Ywc(), pwc)) && (f2 = RD(mQb(c2, pwc), 10)); - switch (c2.k.g) { - case 0: - for (i2 = lr(dr(b3b(c2, (qpd(), Yod)), new eNc())); xc(i2); ) { - g = RD(yc(i2), 12); - a.d[g.p] = e++; - ZEb(k.c, g); - } - e = oMc(a, l, k, cMc, e); - for (j = lr(dr(b3b(c2, npd), new eNc())); xc(j); ) { - g = RD(yc(j), 12); - a.d[g.p] = e++; - ZEb(k.c, g); - } - break; - case 3: - if (!b3b(c2, bMc).dc()) { - g = RD(b3b(c2, bMc).Xb(0), 12); - a.d[g.p] = e++; - ZEb(k.c, g); - } - b3b(c2, cMc).dc() || hmb(l, c2); - break; - case 1: - for (h = b3b(c2, (qpd(), ppd)).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 12); - a.d[g.p] = e++; - ZEb(k.c, g); - } - b3b(c2, Xod).Jc(new cNc(l, c2)); - } - } - oMc(a, l, k, cMc, e); - return k; - } - function vgd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - if (b == null || b.length == 0) { - return null; - } - f2 = RD(Xjb(a.f, b), 23); - if (!f2) { - for (e = (n = new glb(a.d).a.vc().Kc(), new llb(n)); e.a.Ob(); ) { - c2 = (g = RD(e.a.Pb(), 44), RD(g.md(), 23)); - h = c2.f; - o2 = b.length; - if (lhb(h.substr(h.length - o2, o2), b) && (b.length == h.length || ihb(h, h.length - b.length - 1) == 46)) { - if (f2) { - return null; - } - f2 = c2; - } - } - if (!f2) { - for (d = (m = new glb(a.d).a.vc().Kc(), new llb(m)); d.a.Ob(); ) { - c2 = (g = RD(d.a.Pb(), 44), RD(g.md(), 23)); - l = c2.g; - if (l != null) { - for (i2 = l, j = 0, k = i2.length; j < k; ++j) { - h = i2[j]; - o2 = b.length; - if (lhb(h.substr(h.length - o2, o2), b) && (b.length == h.length || ihb(h, h.length - b.length - 1) == 46)) { - if (f2) { - return null; - } - f2 = c2; - } - } - } - } - } - !!f2 && $jb(a.f, b, f2); - } - return f2; - } - function IA(a, b) { - var c2, d, e, f2, g; - c2 = new cib(); - g = false; - for (f2 = 0; f2 < b.length; f2++) { - d = (BFb(f2, b.length), b.charCodeAt(f2)); - if (d == 32) { - wA(a, c2, 0); - c2.a += " "; - wA(a, c2, 0); - while (f2 + 1 < b.length && (BFb(f2 + 1, b.length), b.charCodeAt(f2 + 1) == 32)) { - ++f2; - } - continue; - } - if (g) { - if (d == 39) { - if (f2 + 1 < b.length && (BFb(f2 + 1, b.length), b.charCodeAt(f2 + 1) == 39)) { - c2.a += String.fromCharCode(d); - ++f2; - } else { - g = false; - } - } else { - c2.a += String.fromCharCode(d); - } - continue; - } - if (qhb("GyMLdkHmsSEcDahKzZv", Fhb(d)) > 0) { - wA(a, c2, 0); - c2.a += String.fromCharCode(d); - e = BA(b, f2); - wA(a, c2, e); - f2 += e - 1; - continue; - } - if (d == 39) { - if (f2 + 1 < b.length && (BFb(f2 + 1, b.length), b.charCodeAt(f2 + 1) == 39)) { - c2.a += "'"; - ++f2; - } else { - g = true; - } - } else { - c2.a += String.fromCharCode(d); - } - } - wA(a, c2, 0); - CA(a); - } - function tSc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - t = Yx(a); - i2 = new bnb(); - f2 = a.c.length; - j = f2 - 1; - k = f2 + 1; - while (t.a.gc() != 0) { - while (c2.b != 0) { - r = (sFb(c2.b != 0), RD(Wub(c2, c2.a.a), 118)); - t.a.Bc(r) != null; - r.g = j--; - wSc(r, b, c2, d); - } - while (b.b != 0) { - s = (sFb(b.b != 0), RD(Wub(b, b.a.a), 118)); - t.a.Bc(s) != null; - s.g = k++; - wSc(s, b, c2, d); - } - h = qwe; - for (p = t.a.ec().Kc(); p.Ob(); ) { - o2 = RD(p.Pb(), 118); - if (!d && o2.b > 0 && o2.a <= 0) { - i2.c.length = 0; - ZEb(i2.c, o2); - break; - } - n = o2.i - o2.d; - if (n >= h) { - if (n > h) { - i2.c.length = 0; - h = n; - } - ZEb(i2.c, o2); - } - } - if (i2.c.length != 0) { - g = RD(Vmb(i2, Jwb(e, i2.c.length)), 118); - t.a.Bc(g) != null; - g.g = k++; - wSc(g, b, c2, d); - i2.c.length = 0; - } - } - q = a.c.length + 1; - for (m = new Anb(a); m.a < m.c.c.length; ) { - l = RD(ynb(m), 118); - l.g < f2 && (l.g = l.g + q); - } - } - function FJc(a, b, c2) { - var d, e, f2, g; - this.j = a; - this.e = c1b(a); - this.o = this.j.e; - this.i = !!this.o; - this.p = this.i ? RD(Vmb(c2, Y2b(this.o).p), 219) : null; - e = RD(mQb(a, (Ywc(), kwc)), 21); - this.g = e.Hc((ovc(), hvc)); - this.b = new bnb(); - this.d = new RLc(this.e); - g = RD(mQb(this.j, Lwc), 234); - this.q = WJc(b, g, this.e); - this.k = new _Kc(this); - f2 = dv(cD(WC(QY, 1), rve, 230, 0, [this, this.d, this.k, this.q])); - if (b == (RKc(), OKc) && !Heb(TD(mQb(a, (yCc(), eAc))))) { - d = new qJc(this.e); - ZEb(f2.c, d); - this.c = new UIc(d, g, RD(this.q, 413)); - } else if (b == OKc && Heb(TD(mQb(a, (yCc(), eAc))))) { - d = new qJc(this.e); - ZEb(f2.c, d); - this.c = new vLc(d, g, RD(this.q, 413)); - } else { - this.c = new smc(b, this); - } - Rmb(f2, this.c); - yNc(f2, this.e); - this.s = $Kc(this.k); - } - function z0b(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q; - f2 = new bnb(); - for (j = new Anb(d); j.a < j.c.c.length; ) { - h = RD(ynb(j), 453); - g = null; - if (h.f == (BEc(), zEc)) { - for (o2 = new Anb(h.e); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 18); - q = n.d.i; - if (Y2b(q) == b) { - q0b(a, b, h, n, h.b, n.d); - } else if (!c2 || n2b(q, c2)) { - r0b(a, b, h, d, n); - } else { - m = w0b(a, b, c2, n, h.b, zEc, g); - m != g && (ZEb(f2.c, m), true); - m.c && (g = m); - } - } - } else { - for (l = new Anb(h.e); l.a < l.c.c.length; ) { - k = RD(ynb(l), 18); - p = k.c.i; - if (Y2b(p) == b) { - q0b(a, b, h, k, k.c, h.b); - } else if (!c2 || n2b(p, c2)) { - continue; - } else { - m = w0b(a, b, c2, k, h.b, yEc, g); - m != g && (ZEb(f2.c, m), true); - m.c && (g = m); - } - } - } - } - for (i2 = new Anb(f2); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 453); - Wmb(b.a, h.a, 0) != -1 || Rmb(b.a, h.a); - h.c && (ZEb(e.c, h), true); - } - } - function QXb(a) { - var b, c2, d, e, f2, g, h; - b = 0; - for (f2 = new Anb(a.b.a); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 194); - d.b = 0; - d.c = 0; - } - PXb(a, 0); - OXb(a, a.g); - uYb(a.c); - yYb(a.c); - c2 = (Cmd(), ymd); - wYb(qYb(vYb(wYb(qYb(vYb(wYb(vYb(a.c, c2)), Fmd(c2)))), c2))); - vYb(a.c, ymd); - TXb(a, a.g); - UXb(a, 0); - VXb(a, 0); - WXb(a, 1); - PXb(a, 1); - OXb(a, a.d); - uYb(a.c); - for (g = new Anb(a.b.a); g.a < g.c.c.length; ) { - d = RD(ynb(g), 194); - b += $wnd.Math.abs(d.c); - } - for (h = new Anb(a.b.a); h.a < h.c.c.length; ) { - d = RD(ynb(h), 194); - d.b = 0; - d.c = 0; - } - c2 = Bmd; - wYb(qYb(vYb(wYb(qYb(vYb(wYb(yYb(vYb(a.c, c2))), Fmd(c2)))), c2))); - vYb(a.c, ymd); - TXb(a, a.d); - UXb(a, 1); - VXb(a, 1); - WXb(a, 0); - yYb(a.c); - for (e = new Anb(a.b.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 194); - b += $wnd.Math.abs(d.c); - } - return b; - } - function A0b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - if (!Heb(TD(mQb(c2, (yCc(), NAc))))) { - return; - } - for (h = new Anb(c2.j); h.a < h.c.c.length; ) { - g = RD(ynb(h), 12); - m = s2b(g.g); - for (j = m, k = 0, l = j.length; k < l; ++k) { - i2 = j[k]; - f2 = i2.d.i == c2; - e = f2 && Heb(TD(mQb(i2, OAc))); - if (e) { - o2 = i2.c; - n = RD(Wjb(a.b, o2), 10); - if (!n) { - n = f2b(o2, (Bod(), zod), o2.j, -1, null, null, o2.o, RD(mQb(b, rAc), 88), b); - pQb(n, (Ywc(), Awc), o2); - Zjb(a.b, o2, n); - Rmb(b.a, n); - } - q = i2.d; - p = RD(Wjb(a.b, q), 10); - if (!p) { - p = f2b(q, (Bod(), zod), q.j, 1, null, null, q.o, RD(mQb(b, rAc), 88), b); - pQb(p, (Ywc(), Awc), q); - Zjb(a.b, q, p); - Rmb(b.a, p); - } - d = s0b(i2); - Y0b(d, RD(Vmb(n.j, 0), 12)); - Z0b(d, RD(Vmb(p.j, 0), 12)); - Rc(a.a, i2, new J0b(d, b, (BEc(), zEc))); - RD(mQb(b, (Ywc(), kwc)), 21).Fc((ovc(), hvc)); - } - } - } - } - function OQc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - for (e = new Anb(a.a.b); e.a < e.c.c.length; ) { - c2 = RD(ynb(e), 30); - for (i2 = new Anb(c2.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - b.j[h.p] = h; - b.i[h.p] = b.o == (EQc(), DQc) ? pxe : oxe; - } - } - akb(a.c); - g = a.a.b; - b.c == (wQc(), uQc) && (g = hv(g)); - sRc(a.e, b, a.b); - Mnb(b.p, null); - for (f2 = g.Kc(); f2.Ob(); ) { - c2 = RD(f2.Pb(), 30); - j = c2.a; - b.o == (EQc(), DQc) && (j = hv(j)); - for (m = j.Kc(); m.Ob(); ) { - l = RD(m.Pb(), 10); - b.g[l.p] == l && PQc(a, l, b); - } - } - QQc(a, b); - for (d = g.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 30); - for (m = new Anb(c2.a); m.a < m.c.c.length; ) { - l = RD(ynb(m), 10); - b.p[l.p] = b.p[b.g[l.p].p]; - if (l == b.g[l.p]) { - k = Kfb(b.i[b.j[l.p].p]); - (b.o == (EQc(), DQc) && k > pxe || b.o == CQc && k < oxe) && (b.p[l.p] = Kfb(b.p[l.p]) + k); - } - } - } - a.e.xg(); - } - function ldc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2; - c2.Ug("Label dummy switching", 1); - d = RD(mQb(b, (yCc(), uAc)), 232); - $cc(b); - e = idc(b, d); - a.a = $C(iE, vxe, 28, b.b.c.length, 15, 1); - for (h = (btc(), cD(WC(ZW, 1), jwe, 232, 0, [Zsc, _sc, Ysc, $sc, atc, Xsc])), k = 0, n = h.length; k < n; ++k) { - f2 = h[k]; - if ((f2 == atc || f2 == Xsc || f2 == $sc) && !RD(Csb(e.a, f2) ? e.b[f2.g] : null, 15).dc()) { - bdc(a, b); - break; - } - } - for (i2 = cD(WC(ZW, 1), jwe, 232, 0, [Zsc, _sc, Ysc, $sc, atc, Xsc]), l = 0, o2 = i2.length; l < o2; ++l) { - f2 = i2[l]; - f2 == atc || f2 == Xsc || f2 == $sc || mdc(a, RD(Csb(e.a, f2) ? e.b[f2.g] : null, 15)); - } - for (g = cD(WC(ZW, 1), jwe, 232, 0, [Zsc, _sc, Ysc, $sc, atc, Xsc]), j = 0, m = g.length; j < m; ++j) { - f2 = g[j]; - (f2 == atc || f2 == Xsc || f2 == $sc) && mdc(a, RD(Csb(e.a, f2) ? e.b[f2.g] : null, 15)); - } - a.a = null; - c2.Vg(); - } - function tte(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - j = b; - if (j.b == null || a.b == null) - return; - vte(a); - ste(a); - vte(j); - ste(j); - c2 = $C(kE, Pwe, 28, a.b.length + j.b.length, 15, 1); - k = 0; - d = 0; - g = 0; - while (d < a.b.length && g < j.b.length) { - e = a.b[d]; - f2 = a.b[d + 1]; - h = j.b[g]; - i2 = j.b[g + 1]; - if (f2 < h) { - d += 2; - } else if (f2 >= h && e <= i2) { - if (h <= e && f2 <= i2) { - c2[k++] = e; - c2[k++] = f2; - d += 2; - } else if (h <= e) { - c2[k++] = e; - c2[k++] = i2; - a.b[d] = i2 + 1; - g += 2; - } else if (f2 <= i2) { - c2[k++] = h; - c2[k++] = f2; - d += 2; - } else { - c2[k++] = h; - c2[k++] = i2; - a.b[d] = i2 + 1; - } - } else if (i2 < e) { - g += 2; - } else { - throw Adb(new yz("Token#intersectRanges(): Internal Error: [" + a.b[d] + "," + a.b[d + 1] + "] & [" + j.b[g] + "," + j.b[g + 1] + "]")); - } - } - while (d < a.b.length) { - c2[k++] = a.b[d++]; - c2[k++] = a.b[d++]; - } - a.b = $C(kE, Pwe, 28, k, 15, 1); - hib(c2, 0, a.b, 0, k); - } - function RXb(a) { - var b, c2, d, e, f2, g, h; - b = new bnb(); - a.g = new bnb(); - a.d = new bnb(); - for (g = new vkb(new mkb(a.f.b).a); g.b; ) { - f2 = tkb(g); - Rmb(b, RD(RD(f2.md(), 42).b, 86)); - Dmd(RD(f2.ld(), 602).Af()) ? Rmb(a.d, RD(f2.md(), 42)) : Rmb(a.g, RD(f2.md(), 42)); - } - OXb(a, a.d); - OXb(a, a.g); - a.c = new EYb(a.b); - CYb(a.c, (zXb(), yXb)); - TXb(a, a.d); - TXb(a, a.g); - Tmb(b, a.c.a.b); - a.e = new rjd(oxe, oxe); - a.a = new rjd(pxe, pxe); - for (d = new Anb(b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 86); - a.e.a = $wnd.Math.min(a.e.a, c2.g.c); - a.e.b = $wnd.Math.min(a.e.b, c2.g.d); - a.a.a = $wnd.Math.max(a.a.a, c2.g.c + c2.g.b); - a.a.b = $wnd.Math.max(a.a.b, c2.g.d + c2.g.a); - } - BYb(a.c, new $Xb()); - h = 0; - do { - e = QXb(a); - ++h; - } while ((h < 2 || e > pwe) && h < 10); - BYb(a.c, new bYb()); - QXb(a); - xYb(a.c); - AXb(a.f); - } - function B9b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - c2 = RD(mQb(a, (yCc(), BBc)), 101); - g = a.f; - f2 = a.d; - h = g.a + f2.b + f2.c; - i2 = 0 - f2.d - a.c.b; - k = g.b + f2.d + f2.a - a.c.b; - j = new bnb(); - l = new bnb(); - for (e = new Anb(b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - switch (c2.g) { - case 1: - case 2: - case 3: - r9b(d); - break; - case 4: - m = RD(mQb(d, zBc), 8); - n = !m ? 0 : m.a; - d.n.a = h * Kfb(UD(mQb(d, (Ywc(), Jwc)))) - n; - U2b(d, true, false); - break; - case 5: - o2 = RD(mQb(d, zBc), 8); - p = !o2 ? 0 : o2.a; - d.n.a = Kfb(UD(mQb(d, (Ywc(), Jwc)))) - p; - U2b(d, true, false); - g.a = $wnd.Math.max(g.a, d.n.a + d.o.a / 2); - } - switch (RD(mQb(d, (Ywc(), hwc)), 64).g) { - case 1: - d.n.b = i2; - ZEb(j.c, d); - break; - case 3: - d.n.b = k; - ZEb(l.c, d); - } - } - switch (c2.g) { - case 1: - case 2: - t9b(j, a); - t9b(l, a); - break; - case 3: - z9b(j, a); - z9b(l, a); - } - } - function $Jc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - switch (a.k.g) { - case 1: - d = RD(mQb(a, (Ywc(), Awc)), 18); - c2 = RD(mQb(d, Bwc), 75); - !c2 ? c2 = new Ejd() : Heb(TD(mQb(d, Nwc))) && (c2 = Ijd(c2)); - j = RD(mQb(a, vwc), 12); - if (j) { - k = xjd(cD(WC(l3, 1), Nve, 8, 0, [j.i.n, j.n, j.a])); - if (b <= k.a) { - return k.b; - } - Pub(c2, k, c2.a, c2.a.a); - } - l = RD(mQb(a, wwc), 12); - if (l) { - m = xjd(cD(WC(l3, 1), Nve, 8, 0, [l.i.n, l.n, l.a])); - if (m.a <= b) { - return m.b; - } - Pub(c2, m, c2.c.b, c2.c); - } - if (c2.b >= 2) { - i2 = Sub(c2, 0); - g = RD(evb(i2), 8); - h = RD(evb(i2), 8); - while (h.a < b && i2.b != i2.d.c) { - g = h; - h = RD(evb(i2), 8); - } - return g.b + (b - g.a) / (h.a - g.a) * (h.b - g.b); - } - break; - case 3: - f2 = RD(mQb(RD(Vmb(a.j, 0), 12), (Ywc(), Awc)), 12); - e = f2.i; - switch (f2.j.g) { - case 1: - return e.n.b; - case 3: - return e.n.b + e.o.b; - } - } - return _2b(a).b; - } - function Akc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - for (g = new Anb(a.d.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 30); - for (i2 = new Anb(f2.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - if (Heb(TD(mQb(h, (yCc(), Uzc))))) { - if (!gr(W2b(h))) { - d = RD(er2(W2b(h)), 18); - k = d.c.i; - k == h && (k = d.d.i); - l = new Ptd(k, ojd(ajd(h.n), k.n)); - Zjb(a.b, h, l); - continue; - } - } - e = new Uid2(h.n.a - h.d.b, h.n.b - h.d.d, h.o.a + h.d.b + h.d.c, h.o.b + h.d.d + h.d.a); - b = mGb(pGb(nGb(oGb(new qGb(), h), e), jkc), a.a); - gGb(hGb(iGb(new jGb(), cD(WC(hN, 1), rve, 60, 0, [b])), b), a.a); - j = new cHb(); - Zjb(a.e, b, j); - c2 = Kr(new is(Mr(Z2b(h).a.Kc(), new ir()))) - Kr(new is(Mr(a3b(h).a.Kc(), new ir()))); - c2 < 0 ? aHb(j, true, (Cmd(), ymd)) : c2 > 0 && aHb(j, true, (Cmd(), zmd)); - h.k == (r3b(), m3b) && bHb(j); - Zjb(a.f, h, b); - } - } - } - function OVc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - e = RD(mQb(a, (q$c(), h$c)), 27); - j = lve; - k = lve; - h = qwe; - i2 = qwe; - for (t = Sub(a.b, 0); t.b != t.d.c; ) { - r = RD(evb(t), 40); - n = r.e; - o2 = r.f; - j = $wnd.Math.min(j, n.a - o2.a / 2); - k = $wnd.Math.min(k, n.b - o2.b / 2); - h = $wnd.Math.max(h, n.a + o2.a / 2); - i2 = $wnd.Math.max(i2, n.b + o2.b / 2); - } - m = RD(Gxd(e, (h_c(), T$c)), 107); - for (s = Sub(a.b, 0); s.b != s.d.c; ) { - r = RD(evb(s), 40); - l = mQb(r, h$c); - if (ZD(l, 207)) { - f2 = RD(l, 27); - Byd(f2, r.e.a, r.e.b); - zxd(f2, r); - } - } - for (q = Sub(a.a, 0); q.b != q.d.c; ) { - p = RD(evb(q), 65); - d = RD(mQb(p, h$c), 74); - if (d) { - b = p.a; - c2 = IGd(d, true, true); - lsd(b, c2); - } - } - u = h - j + (m.b + m.c); - g = i2 - k + (m.d + m.a); - Heb(TD(Gxd(e, (umd(), mld)))) || Esd(e, u, g, false, false); - Ixd(e, Ikd, u - (m.b + m.c)); - Ixd(e, Hkd, g - (m.d + m.a)); - } - function Wec(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l; - i2 = true; - e = 0; - j = a.g[b.p]; - k = b.o.b + a.o; - c2 = a.d[b.p][2]; - $mb(a.b, j, sgb(RD(Vmb(a.b, j), 17).a - 1 + c2)); - $mb(a.c, j, Kfb(UD(Vmb(a.c, j))) - k + c2 * a.f); - ++j; - if (j >= a.j) { - ++a.j; - Rmb(a.b, sgb(1)); - Rmb(a.c, k); - } else { - d = a.d[b.p][1]; - $mb(a.b, j, sgb(RD(Vmb(a.b, j), 17).a + 1 - d)); - $mb(a.c, j, Kfb(UD(Vmb(a.c, j))) + k - d * a.f); - } - (a.r == (aEc(), VDc) && (RD(Vmb(a.b, j), 17).a > a.k || RD(Vmb(a.b, j - 1), 17).a > a.k) || a.r == YDc && (Kfb(UD(Vmb(a.c, j))) > a.n || Kfb(UD(Vmb(a.c, j - 1))) > a.n)) && (i2 = false); - for (g = new is(Mr(Z2b(b).a.Kc(), new ir())); gs(g); ) { - f2 = RD(hs(g), 18); - h = f2.c.i; - if (a.g[h.p] == j) { - l = Wec(a, h); - e = e + RD(l.a, 17).a; - i2 = i2 && Heb(TD(l.b)); - } - } - a.g[b.p] = j; - e = e + a.d[b.p][0]; - return new Ptd(sgb(e), (Geb(), i2 ? true : false)); - } - function cXb(a, b) { - var c2, d, e, f2, g; - c2 = Kfb(UD(mQb(b, (yCc(), TBc)))); - c2 < 2 && pQb(b, TBc, 2); - d = RD(mQb(b, rAc), 88); - d == (Cmd(), Amd) && pQb(b, rAc, i2b(b)); - e = RD(mQb(b, NBc), 17); - e.a == 0 ? pQb(b, (Ywc(), Lwc), new Owb()) : pQb(b, (Ywc(), Lwc), new Pwb(e.a)); - f2 = TD(mQb(b, gBc)); - f2 == null && pQb(b, gBc, (Geb(), dE(mQb(b, yAc)) === dE((Ymd(), Umd)) ? true : false)); - FDb(new SDb(null, new Swb(b.a, 16)), new fXb(a)); - FDb(EDb(new SDb(null, new Swb(b.b, 16)), new hXb()), new jXb(a)); - g = new gFc(b); - pQb(b, (Ywc(), Qwc), g); - Sed(a.a); - Ved(a.a, (sXb(), nXb), RD(mQb(b, pAc), 188)); - Ved(a.a, oXb, RD(mQb(b, $Ac), 188)); - Ved(a.a, pXb, RD(mQb(b, oAc), 188)); - Ved(a.a, qXb, RD(mQb(b, kBc), 188)); - Ved(a.a, rXb, KRc(RD(mQb(b, yAc), 223))); - Ped(a.a, bXb(b)); - pQb(b, Kwc, Qed(a.a, b)); - } - function STc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - l = new Tsb(); - g = new bnb(); - QTc(a, c2, a.d.Ag(), g, l); - QTc(a, d, a.d.Bg(), g, l); - a.b = 0.2 * (p = RTc(EDb(new SDb(null, new Swb(g, 16)), new XTc())), q = RTc(EDb(new SDb(null, new Swb(g, 16)), new ZTc())), $wnd.Math.min(p, q)); - f2 = 0; - for (h = 0; h < g.c.length - 1; h++) { - i2 = (tFb(h, g.c.length), RD(g.c[h], 118)); - for (o2 = h + 1; o2 < g.c.length; o2++) { - f2 += PTc(a, i2, (tFb(o2, g.c.length), RD(g.c[o2], 118))); - } - } - m = RD(mQb(b, (Ywc(), Lwc)), 234); - f2 >= 2 && (r = uSc(g, true, m), !a.e && (a.e = new xTc(a)), tTc(a.e, r, g, a.b), void 0); - UTc(g, m); - WTc(g); - n = -1; - for (k = new Anb(g); k.a < k.c.c.length; ) { - j = RD(ynb(k), 118); - if ($wnd.Math.abs(j.s - j.c) < Vze) { - continue; - } - n = $wnd.Math.max(n, j.o); - a.d.yg(j, e, a.c); - } - a.d.a.a.$b(); - return n + 1; - } - function s0c(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - l = RD(Hr((g = Sub(new dXc(b).a.d, 0), new gXc(g))), 40); - o2 = l ? RD(mQb(l, (q$c(), b$c)), 40) : null; - e = 1; - while (!!l && !!o2) { - i2 = 0; - u = 0; - c2 = l; - d = o2; - for (h = 0; h < e; h++) { - c2 = _Wc(c2); - d = _Wc(d); - u += Kfb(UD(mQb(c2, (q$c(), g$c)))); - i2 += Kfb(UD(mQb(d, g$c))); - } - t = Kfb(UD(mQb(o2, (q$c(), j$c)))); - s = Kfb(UD(mQb(l, j$c))); - m = u0c(a, l, o2); - n = t + i2 + a.b + m - s - u; - if (0 < n) { - j = b; - k = 0; - while (!!j && j != d) { - ++k; - j = RD(mQb(j, c$c), 40); - } - if (j) { - r = n / k; - j = b; - while (j != d) { - q = Kfb(UD(mQb(j, j$c))) + n; - pQb(j, j$c, q); - p = Kfb(UD(mQb(j, g$c))) + n; - pQb(j, g$c, p); - n -= r; - j = RD(mQb(j, c$c), 40); - } - } else { - return; - } - } - ++e; - l.d.b == 0 ? l = kWc(new dXc(b), e) : l = RD(Hr((f2 = Sub(new dXc(l).a.d, 0), new gXc(f2))), 40); - o2 = l ? RD(mQb(l, b$c), 40) : null; - } - } - function Lmc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - if (m = a.c[b], n = a.c[c2], (o2 = RD(mQb(m, (Ywc(), qwc)), 15), !!o2 && o2.gc() != 0 && o2.Hc(n)) || (p = m.k != (r3b(), o3b) && n.k != o3b, q = RD(mQb(m, pwc), 10), r = RD(mQb(n, pwc), 10), s = q != r, t = !!q && q != m || !!r && r != n, u = Mmc(m, (qpd(), Yod)), v = Mmc(n, npd), t = t | (Mmc(m, npd) || Mmc(n, Yod)), w2 = t && s || u || v, p && w2) || m.k == (r3b(), q3b) && n.k == p3b || n.k == (r3b(), q3b) && m.k == p3b) { - return false; - } - k = a.c[b]; - f2 = a.c[c2]; - e = jMc(a.e, k, f2, (qpd(), ppd)); - i2 = jMc(a.i, k, f2, Xod); - Cmc(a.f, k, f2); - j = lmc(a.b, k, f2) + RD(e.a, 17).a + RD(i2.a, 17).a + a.f.d; - h = lmc(a.b, f2, k) + RD(e.b, 17).a + RD(i2.b, 17).a + a.f.b; - if (a.a) { - l = RD(mQb(k, Awc), 12); - g = RD(mQb(f2, Awc), 12); - d = hMc(a.g, l, g); - j += RD(d.a, 17).a; - h += RD(d.b, 17).a; - } - return j > h; - } - function Iad(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s; - j = oxe; - k = oxe; - h = pxe; - i2 = pxe; - for (m = new Anb(b.i); m.a < m.c.c.length; ) { - l = RD(ynb(m), 68); - e = RD(RD(Wjb(a.g, l.a), 42).b, 27); - Byd(e, l.b.c, l.b.d); - j = $wnd.Math.min(j, e.i); - k = $wnd.Math.min(k, e.j); - h = $wnd.Math.max(h, e.i + e.g); - i2 = $wnd.Math.max(i2, e.j + e.f); - } - n = RD(Gxd(a.c, (ncd(), ecd)), 107); - Esd(a.c, h - j + (n.b + n.c), i2 - k + (n.d + n.a), true, true); - Isd(a.c, -j + n.b, -k + n.d); - for (d = new dMd(uCd(a.c)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 74); - g = IGd(c2, true, true); - o2 = JGd(c2); - q = LGd(c2); - p = new rjd(o2.i + o2.g / 2, o2.j + o2.f / 2); - f2 = new rjd(q.i + q.g / 2, q.j + q.f / 2); - r = ojd(new rjd(f2.a, f2.b), p); - wid(r, o2.g, o2.f); - $id(p, r); - s = ojd(new rjd(p.a, p.b), f2); - wid(s, q.g, q.f); - $id(f2, s); - Nzd(g, p.a, p.b); - Gzd(g, f2.a, f2.b); - } - } - function Tcc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - b.Ug("Label dummy removal", 1); - d = Kfb(UD(mQb(a, (yCc(), VBc)))); - e = Kfb(UD(mQb(a, ZBc))); - j = RD(mQb(a, rAc), 88); - for (i2 = new Anb(a.b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 30); - l = new Jkb(h.a, 0); - while (l.b < l.d.gc()) { - k = (sFb(l.b < l.d.gc()), RD(l.d.Xb(l.c = l.b++), 10)); - if (k.k == (r3b(), n3b)) { - m = RD(mQb(k, (Ywc(), Awc)), 18); - o2 = Kfb(UD(mQb(m, FAc))); - g = dE(mQb(k, swc)) === dE((Pnd(), Mnd)); - c2 = new sjd(k.n); - g && (c2.b += o2 + d); - f2 = new rjd(k.o.a, k.o.b + (k.k == n3b && !QDb(CDb(RD(mQb(k, Mwc), 15).Oc(), new PAb(new x3b()))).Bd((xDb(), wDb)) ? 0 : -o2 - d)); - n = RD(mQb(k, Mwc), 15); - j == (Cmd(), Bmd) || j == xmd ? Scc(n, c2, e, f2, g, j) : Rcc(n, c2, e, f2); - Tmb(m.b, n); - Hec(k, dE(mQb(a, yAc)) === dE((Ymd(), Vmd))); - Ckb(l); - } - } - } - b.Vg(); - } - function ZBd(a) { - if (a.q) - return; - a.q = true; - a.p = jBd(a, 0); - a.a = jBd(a, 1); - oBd(a.a, 0); - a.f = jBd(a, 2); - oBd(a.f, 1); - iBd(a.f, 2); - a.n = jBd(a, 3); - iBd(a.n, 3); - iBd(a.n, 4); - iBd(a.n, 5); - iBd(a.n, 6); - a.g = jBd(a, 4); - oBd(a.g, 7); - iBd(a.g, 8); - a.c = jBd(a, 5); - oBd(a.c, 7); - oBd(a.c, 8); - a.i = jBd(a, 6); - oBd(a.i, 9); - oBd(a.i, 10); - oBd(a.i, 11); - oBd(a.i, 12); - iBd(a.i, 13); - a.j = jBd(a, 7); - oBd(a.j, 9); - a.d = jBd(a, 8); - oBd(a.d, 3); - oBd(a.d, 4); - oBd(a.d, 5); - oBd(a.d, 6); - iBd(a.d, 7); - iBd(a.d, 8); - iBd(a.d, 9); - iBd(a.d, 10); - a.b = jBd(a, 9); - iBd(a.b, 0); - iBd(a.b, 1); - a.e = jBd(a, 10); - iBd(a.e, 1); - iBd(a.e, 2); - iBd(a.e, 3); - iBd(a.e, 4); - oBd(a.e, 5); - oBd(a.e, 6); - oBd(a.e, 7); - oBd(a.e, 8); - oBd(a.e, 9); - oBd(a.e, 10); - iBd(a.e, 11); - a.k = jBd(a, 11); - iBd(a.k, 0); - iBd(a.k, 1); - a.o = kBd(a, 12); - a.s = kBd(a, 13); - } - function CXb(a, b) { - b.dc() && JYb(a.j, true, true, true, true); - pb(b, (qpd(), cpd)) && JYb(a.j, true, true, true, false); - pb(b, Zod) && JYb(a.j, false, true, true, true); - pb(b, kpd) && JYb(a.j, true, true, false, true); - pb(b, mpd) && JYb(a.j, true, false, true, true); - pb(b, dpd) && JYb(a.j, false, true, true, false); - pb(b, $od) && JYb(a.j, false, true, false, true); - pb(b, lpd) && JYb(a.j, true, false, false, true); - pb(b, jpd) && JYb(a.j, true, false, true, false); - pb(b, hpd) && JYb(a.j, true, true, true, true); - pb(b, apd) && JYb(a.j, true, true, true, true); - pb(b, hpd) && JYb(a.j, true, true, true, true); - pb(b, _od) && JYb(a.j, true, true, true, true); - pb(b, ipd) && JYb(a.j, true, true, true, true); - pb(b, gpd) && JYb(a.j, true, true, true, true); - pb(b, fpd) && JYb(a.j, true, true, true, true); - } - function tAd(b, c2, d) { - var e, f2, g, h, i2, j, k, l, m; - if (b.a != c2.jk()) { - throw Adb(new agb(VHe + c2.xe() + WHe)); - } - e = Oee((lke(), jke), c2).Jl(); - if (e) { - return e.jk().wi().ri(e, d); - } - h = Oee(jke, c2).Ll(); - if (h) { - if (d == null) { - return null; - } - i2 = RD(d, 15); - if (i2.dc()) { - return ""; - } - m = new Qhb(); - for (g = i2.Kc(); g.Ob(); ) { - f2 = g.Pb(); - Nhb(m, h.jk().wi().ri(h, f2)); - m.a += " "; - } - return qeb(m, m.a.length - 1); - } - l = Oee(jke, c2).Ml(); - if (!l.dc()) { - for (k = l.Kc(); k.Ob(); ) { - j = RD(k.Pb(), 156); - if (j.fk(d)) { - try { - m = j.jk().wi().ri(j, d); - if (m != null) { - return m; - } - } catch (a) { - a = zdb(a); - if (!ZD(a, 103)) - throw Adb(a); - } - } - } - throw Adb(new agb("Invalid value: '" + d + "' for datatype :" + c2.xe())); - } - RD(c2, 847).ok(); - return d == null ? null : ZD(d, 180) ? "" + RD(d, 180).a : rb(d) == qK ? a2d(nAd[0], RD(d, 206)) : jeb(d); - } - function ZUc(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - j = new Yub(); - h = new Yub(); - for (f2 = new Anb(a); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 131); - d.v = 0; - d.n = d.i.c.length; - d.u = d.t.c.length; - d.n == 0 && (Pub(j, d, j.c.b, j.c), true); - d.u == 0 && d.r.a.gc() == 0 && (Pub(h, d, h.c.b, h.c), true); - } - g = -1; - while (j.b != 0) { - d = RD(ku(j, 0), 131); - for (c2 = new Anb(d.t); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 274); - k = b.b; - k.v = $wnd.Math.max(k.v, d.v + 1); - g = $wnd.Math.max(g, k.v); - --k.n; - k.n == 0 && (Pub(j, k, j.c.b, j.c), true); - } - } - if (g > -1) { - for (e = Sub(h, 0); e.b != e.d.c; ) { - d = RD(evb(e), 131); - d.v = g; - } - while (h.b != 0) { - d = RD(ku(h, 0), 131); - for (c2 = new Anb(d.i); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 274); - i2 = b.a; - if (i2.r.a.gc() != 0) { - continue; - } - i2.v = $wnd.Math.min(i2.v, d.v - 1); - --i2.u; - i2.u == 0 && (Pub(h, i2, h.c.b, h.c), true); - } - } - } - } - function WTc(a) { - var b, c2, d, e, f2, g, h, i2, j, k; - j = new bnb(); - h = new bnb(); - for (g = new Anb(a); g.a < g.c.c.length; ) { - e = RD(ynb(g), 118); - PSc(e, e.f.c.length); - QSc(e, e.k.c.length); - e.d == 0 && (ZEb(j.c, e), true); - e.i == 0 && e.e.b == 0 && (ZEb(h.c, e), true); - } - d = -1; - while (j.c.length != 0) { - e = RD(Xmb(j, 0), 118); - for (c2 = new Anb(e.k); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 132); - k = b.b; - RSc(k, $wnd.Math.max(k.o, e.o + 1)); - d = $wnd.Math.max(d, k.o); - PSc(k, k.d - 1); - k.d == 0 && (ZEb(j.c, k), true); - } - } - if (d > -1) { - for (f2 = new Anb(h); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 118); - e.o = d; - } - while (h.c.length != 0) { - e = RD(Xmb(h, 0), 118); - for (c2 = new Anb(e.f); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 132); - i2 = b.a; - if (i2.e.b > 0) { - continue; - } - RSc(i2, $wnd.Math.min(i2.o, e.o - 1)); - QSc(i2, i2.i - 1); - i2.i == 0 && (ZEb(h.c, i2), true); - } - } - } - } - function Lid(a, b, c2, d, e) { - var f2, g, h, i2; - i2 = oxe; - g = false; - h = Gid(a, ojd(new rjd(b.a, b.b), a), $id(new rjd(c2.a, c2.b), e), ojd(new rjd(d.a, d.b), c2)); - f2 = !!h && !($wnd.Math.abs(h.a - a.a) <= IGe && $wnd.Math.abs(h.b - a.b) <= IGe || $wnd.Math.abs(h.a - b.a) <= IGe && $wnd.Math.abs(h.b - b.b) <= IGe); - h = Gid(a, ojd(new rjd(b.a, b.b), a), c2, e); - !!h && (($wnd.Math.abs(h.a - a.a) <= IGe && $wnd.Math.abs(h.b - a.b) <= IGe) == ($wnd.Math.abs(h.a - b.a) <= IGe && $wnd.Math.abs(h.b - b.b) <= IGe) || f2 ? i2 = $wnd.Math.min(i2, ejd(ojd(h, c2))) : g = true); - h = Gid(a, ojd(new rjd(b.a, b.b), a), d, e); - !!h && (g || ($wnd.Math.abs(h.a - a.a) <= IGe && $wnd.Math.abs(h.b - a.b) <= IGe) == ($wnd.Math.abs(h.a - b.a) <= IGe && $wnd.Math.abs(h.b - b.b) <= IGe) || f2) && (i2 = $wnd.Math.min(i2, ejd(ojd(h, d)))); - return i2; - } - function eWb(a) { - Cgd(a, new Pfd(Wfd($fd(Xfd(Zfd(Yfd(new agd(), AAe), BAe), "Minimizes the stress within a layout using stress majorization. Stress exists if the euclidean distance between a pair of nodes doesn't match their graph theoretic distance, that is, the shortest path between the two nodes. The method allows to specify individual edge lengths."), new hWb()), Zze))); - Agd(a, AAe, dAe, iGd(XVb)); - Agd(a, AAe, fAe, (Geb(), true)); - Agd(a, AAe, jAe, iGd($Vb)); - Agd(a, AAe, CAe, iGd(_Vb)); - Agd(a, AAe, iAe, iGd(aWb)); - Agd(a, AAe, kAe, iGd(ZVb)); - Agd(a, AAe, gAe, iGd(bWb)); - Agd(a, AAe, lAe, iGd(cWb)); - Agd(a, AAe, vAe, iGd(WVb)); - Agd(a, AAe, xAe, iGd(UVb)); - Agd(a, AAe, yAe, iGd(VVb)); - Agd(a, AAe, zAe, iGd(YVb)); - Agd(a, AAe, wAe, iGd(TVb)); - } - function kJc(a) { - var b, c2, d, e, f2, g, h, i2; - b = null; - for (d = new Anb(a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 239); - Kfb(pJc(c2.g, c2.d[0]).a); - c2.b = null; - if (!!c2.e && c2.e.gc() > 0 && c2.c == 0) { - !b && (b = new bnb()); - ZEb(b.c, c2); - } - } - if (b) { - while (b.c.length != 0) { - c2 = RD(Xmb(b, 0), 239); - if (!!c2.b && c2.b.c.length > 0) { - for (f2 = (!c2.b && (c2.b = new bnb()), new Anb(c2.b)); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 239); - if (Mfb(pJc(e.g, e.d[0]).a) == Mfb(pJc(c2.g, c2.d[0]).a)) { - if (Wmb(a, e, 0) > Wmb(a, c2, 0)) { - return new Ptd(e, c2); - } - } else if (Kfb(pJc(e.g, e.d[0]).a) > Kfb(pJc(c2.g, c2.d[0]).a)) { - return new Ptd(e, c2); - } - } - } - for (h = (!c2.e && (c2.e = new bnb()), c2.e).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 239); - i2 = (!g.b && (g.b = new bnb()), g.b); - wFb(0, i2.c.length); - XEb(i2.c, 0, c2); - g.c == i2.c.length && (ZEb(b.c, g), true); - } - } - } - return null; - } - function _Jc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - b.Ug("Interactive crossing minimization", 1); - g = 0; - for (f2 = new Anb(a.b); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 30); - d.p = g++; - } - m = c1b(a); - q = new ILc(m.length); - yNc(new mob(cD(WC(QY, 1), rve, 230, 0, [q])), m); - p = 0; - g = 0; - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - c2 = 0; - l = 0; - for (k = new Anb(d.a); k.a < k.c.c.length; ) { - i2 = RD(ynb(k), 10); - if (i2.n.a > 0) { - c2 += i2.n.a + i2.o.a / 2; - ++l; - } - for (o2 = new Anb(i2.j); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 12); - n.p = p++; - } - } - l > 0 && (c2 /= l); - r = $C(iE, vxe, 28, d.a.c.length, 15, 1); - h = 0; - for (j = new Anb(d.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - i2.p = h++; - r[i2.p] = $Jc(i2, c2); - i2.k == (r3b(), o3b) && pQb(i2, (Ywc(), Cwc), r[i2.p]); - } - yob(); - _mb(d.a, new eKc(r)); - wIc(q, m, g, true); - ++g; - } - b.Vg(); - } - function wte(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - if (b.e == 5) { - tte(a, b); - return; - } - j = b; - if (j.b == null || a.b == null) - return; - vte(a); - ste(a); - vte(j); - ste(j); - c2 = $C(kE, Pwe, 28, a.b.length + j.b.length, 15, 1); - k = 0; - d = 0; - g = 0; - while (d < a.b.length && g < j.b.length) { - e = a.b[d]; - f2 = a.b[d + 1]; - h = j.b[g]; - i2 = j.b[g + 1]; - if (f2 < h) { - c2[k++] = a.b[d++]; - c2[k++] = a.b[d++]; - } else if (f2 >= h && e <= i2) { - if (h <= e && f2 <= i2) { - d += 2; - } else if (h <= e) { - a.b[d] = i2 + 1; - g += 2; - } else if (f2 <= i2) { - c2[k++] = e; - c2[k++] = h - 1; - d += 2; - } else { - c2[k++] = e; - c2[k++] = h - 1; - a.b[d] = i2 + 1; - g += 2; - } - } else if (i2 < e) { - g += 2; - } else { - throw Adb(new yz("Token#subtractRanges(): Internal Error: [" + a.b[d] + "," + a.b[d + 1] + "] - [" + j.b[g] + "," + j.b[g + 1] + "]")); - } - } - while (d < a.b.length) { - c2[k++] = a.b[d++]; - c2[k++] = a.b[d++]; - } - a.b = $C(kE, Pwe, 28, k, 15, 1); - hib(c2, 0, a.b, 0, k); - } - function oTb(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - h = IGd(b, false, false); - r = ssd(h); - d && (r = Ijd(r)); - t = Kfb(UD(Gxd(b, (tSb(), mSb)))); - q = (sFb(r.b != 0), RD(r.a.a.c, 8)); - l = RD(ju(r, 1), 8); - if (r.b > 2) { - k = new bnb(); - Tmb(k, new Rkb(r, 1, r.b)); - f2 = jTb(k, t + a.a); - s = new ORb(f2); - kQb(s, b); - ZEb(c2.c, s); - } else { - d ? s = RD(Wjb(a.b, JGd(b)), 272) : s = RD(Wjb(a.b, LGd(b)), 272); - } - i2 = JGd(b); - d && (i2 = LGd(b)); - g = qTb(q, i2); - j = t + a.a; - if (g.a) { - j += $wnd.Math.abs(q.b - l.b); - p = new rjd(l.a, (l.b + q.b) / 2); - } else { - j += $wnd.Math.abs(q.a - l.a); - p = new rjd((l.a + q.a) / 2, l.b); - } - d ? Zjb(a.d, b, new QRb(s, g, p, j)) : Zjb(a.c, b, new QRb(s, g, p, j)); - Zjb(a.b, b, s); - o2 = (!b.n && (b.n = new C5d(I4, b, 1, 7)), b.n); - for (n = new dMd(o2); n.e != n.i.gc(); ) { - m = RD(bMd(n), 135); - e = nTb(a, m, true, 0, 0); - ZEb(c2.c, e); - } - } - function sMb(a) { - var b, c2, d, e, f2, g, h; - if (a.A.dc()) { - return; - } - if (a.A.Hc((Qpd(), Opd))) { - RD(Vrb(a.b, (qpd(), Yod)), 127).k = true; - RD(Vrb(a.b, npd), 127).k = true; - b = a.q != (Bod(), xod) && a.q != wod; - QJb(RD(Vrb(a.b, Xod), 127), b); - QJb(RD(Vrb(a.b, ppd), 127), b); - QJb(a.g, b); - if (a.A.Hc(Ppd)) { - RD(Vrb(a.b, Yod), 127).j = true; - RD(Vrb(a.b, npd), 127).j = true; - RD(Vrb(a.b, Xod), 127).k = true; - RD(Vrb(a.b, ppd), 127).k = true; - a.g.k = true; - } - } - if (a.A.Hc(Npd)) { - a.a.j = true; - a.a.k = true; - a.g.j = true; - a.g.k = true; - h = a.B.Hc((dqd(), _pd)); - for (e = nMb(), f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - c2 = RD(Vrb(a.i, d), 314); - if (c2) { - if (jMb(d)) { - c2.j = true; - c2.k = true; - } else { - c2.j = !h; - c2.k = !h; - } - } - } - } - if (a.A.Hc(Mpd) && a.B.Hc((dqd(), $pd))) { - a.g.j = true; - a.g.j = true; - if (!a.a.j) { - a.a.j = true; - a.a.k = true; - a.a.e = true; - } - } - } - function eOc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - for (d = new Anb(a.e.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - n = a.i[e.p]; - j = n.a.e; - i2 = n.d.e; - e.n.b = j; - r = i2 - j - e.o.b; - b = BOc(e); - m = (wDc(), (!e.q ? (yob(), yob(), wob) : e.q)._b((yCc(), iBc)) ? l = RD(mQb(e, iBc), 203) : l = RD(mQb(Y2b(e), jBc), 203), l); - b && (m == tDc || m == sDc) && (e.o.b += r); - if (b && (m == vDc || m == tDc || m == sDc)) { - for (p = new Anb(e.j); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 12); - if ((qpd(), apd).Hc(o2.j)) { - k = RD(Wjb(a.k, o2), 125); - o2.n.b = k.e - j; - } - } - for (h = new Anb(e.b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 72); - q = RD(mQb(e, dBc), 21); - q.Hc((dod(), aod)) ? g.n.b += r : q.Hc(bod) && (g.n.b += r / 2); - } - (m == tDc || m == sDc) && b3b(e, (qpd(), npd)).Jc(new yPc(r)); - } - } - } - } - function qOc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - j = new bnb(); - for (i2 = new Anb(b.a); i2.a < i2.c.c.length; ) { - g = RD(ynb(i2), 10); - for (m = b3b(g, (qpd(), Xod)).Kc(); m.Ob(); ) { - l = RD(m.Pb(), 12); - for (e = new Anb(l.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - if (!W0b(d) && d.c.i.c == d.d.i.c || W0b(d) || d.d.i.c != c2) { - continue; - } - ZEb(j.c, d); - } - } - } - for (h = hv(c2.a).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 10); - for (m = b3b(g, (qpd(), ppd)).Kc(); m.Ob(); ) { - l = RD(m.Pb(), 12); - for (e = new Anb(l.e); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - if (!W0b(d) && d.c.i.c == d.d.i.c || W0b(d) || d.c.i.c != b) { - continue; - } - if (j.c.length != 0) { - k = new Jkb(j, j.c.length); - f2 = (sFb(k.b > 0), RD(k.a.Xb(k.c = --k.b), 18)); - while (f2 != d && k.b > 0) { - a.a[f2.p] = true; - a.a[d.p] = true; - f2 = (sFb(k.b > 0), RD(k.a.Xb(k.c = --k.b), 18)); - } - k.b > 0 && Ckb(k); - } - } - } - } - } - function Zyb(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - if (!a.b) { - return false; - } - g = null; - m = null; - i2 = new Fzb(null, null); - e = 1; - i2.a[1] = a.b; - l = i2; - while (l.a[e]) { - j = e; - h = m; - m = l; - l = l.a[e]; - d = a.a.Ne(b, l.d); - e = d < 0 ? 0 : 1; - d == 0 && (!c2.c || Fvb(l.e, c2.d)) && (g = l); - if (!(!!l && l.b) && !Vyb(l.a[e])) { - if (Vyb(l.a[1 - e])) { - m = m.a[j] = azb(l, e); - } else if (!Vyb(l.a[1 - e])) { - n = m.a[1 - j]; - if (n) { - if (!Vyb(n.a[1 - j]) && !Vyb(n.a[j])) { - m.b = false; - n.b = true; - l.b = true; - } else { - f2 = h.a[1] == m ? 1 : 0; - Vyb(n.a[j]) ? h.a[f2] = _yb(m, j) : Vyb(n.a[1 - j]) && (h.a[f2] = azb(m, j)); - l.b = h.a[f2].b = true; - h.a[f2].a[0].b = false; - h.a[f2].a[1].b = false; - } - } - } - } - } - if (g) { - c2.b = true; - c2.d = g.e; - if (l != g) { - k = new Fzb(l.d, l.e); - $yb(a, i2, g, k); - m == g && (m = k); - } - m.a[m.a[1] == l ? 1 : 0] = l.a[!l.a[0] ? 1 : 0]; - --a.c; - } - a.b = i2.a[1]; - !!a.b && (a.b.b = false); - return c2.b; - } - function Ilc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - for (e = new Anb(a.a.a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 60); - for (i2 = d.c.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 60); - if (d.a == h.a) { - continue; - } - Dmd(a.a.d) ? l = a.a.g.ff(d, h) : l = a.a.g.gf(d, h); - f2 = d.b.a + d.d.b + l - h.b.a; - f2 = $wnd.Math.ceil(f2); - f2 = $wnd.Math.max(0, f2); - if (_jc(d, h)) { - g = eJb(new gJb(), a.d); - j = eE($wnd.Math.ceil(h.b.a - d.b.a)); - b = j - (h.b.a - d.b.a); - k = $jc(d).a; - c2 = d; - if (!k) { - k = $jc(h).a; - b = -b; - c2 = h; - } - if (k) { - c2.b.a -= b; - k.n.a -= b; - } - rIb(uIb(tIb(vIb(sIb(new wIb(), $wnd.Math.max(0, j)), 1), g), a.c[d.a.d])); - rIb(uIb(tIb(vIb(sIb(new wIb(), $wnd.Math.max(0, -j)), 1), g), a.c[h.a.d])); - } else { - m = 1; - (ZD(d.g, 154) && ZD(h.g, 10) || ZD(h.g, 154) && ZD(d.g, 10)) && (m = 2); - rIb(uIb(tIb(vIb(sIb(new wIb(), eE(f2)), m), a.c[d.a.d]), a.c[h.a.d])); - } - } - } - } - function PIc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - if (c2) { - d = -1; - k = new Jkb(b, 0); - while (k.b < k.d.gc()) { - h = (sFb(k.b < k.d.gc()), RD(k.d.Xb(k.c = k.b++), 10)); - l = a.c[h.c.p][h.p].a; - if (l == null) { - g = d + 1; - f2 = new Jkb(b, k.b); - while (f2.b < f2.d.gc()) { - m = TIc(a, (sFb(f2.b < f2.d.gc()), RD(f2.d.Xb(f2.c = f2.b++), 10))).a; - if (m != null) { - g = (uFb(m), m); - break; - } - } - l = (d + g) / 2; - a.c[h.c.p][h.p].a = l; - a.c[h.c.p][h.p].d = (uFb(l), l); - a.c[h.c.p][h.p].b = 1; - } - d = (uFb(l), l); - } - } else { - e = 0; - for (j = new Anb(b); j.a < j.c.c.length; ) { - h = RD(ynb(j), 10); - a.c[h.c.p][h.p].a != null && (e = $wnd.Math.max(e, Kfb(a.c[h.c.p][h.p].a))); - } - e += 2; - for (i2 = new Anb(b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - if (a.c[h.c.p][h.p].a == null) { - l = Kwb(a.i, 24) * Nxe * e - 1; - a.c[h.c.p][h.p].a = l; - a.c[h.c.p][h.p].d = l; - a.c[h.c.p][h.p].b = 1; - } - } - } - } - function xA(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - !c2 && (c2 = hB(b.q.getTimezoneOffset())); - e = (b.q.getTimezoneOffset() - c2.a) * 6e4; - h = new wB(Bdb(Hdb(b.q.getTime()), e)); - i2 = h; - if (h.q.getTimezoneOffset() != b.q.getTimezoneOffset()) { - e > 0 ? e -= 864e5 : e += 864e5; - i2 = new wB(Bdb(Hdb(b.q.getTime()), e)); - } - k = new cib(); - j = a.a.length; - for (f2 = 0; f2 < j; ) { - d = ihb(a.a, f2); - if (d >= 97 && d <= 122 || d >= 65 && d <= 90) { - for (g = f2 + 1; g < j && ihb(a.a, g) == d; ++g) - ; - LA(k, d, g - f2, h, i2, c2); - f2 = g; - } else if (d == 39) { - ++f2; - if (f2 < j && ihb(a.a, f2) == 39) { - k.a += "'"; - ++f2; - continue; - } - l = false; - while (!l) { - g = f2; - while (g < j && ihb(a.a, g) != 39) { - ++g; - } - if (g >= j) { - throw Adb(new agb("Missing trailing '")); - } - g + 1 < j && ihb(a.a, g + 1) == 39 ? ++g : l = true; - Zhb(k, zhb(a.a, f2, g)); - f2 = g + 1; - } - } else { - k.a += String.fromCharCode(d); - ++f2; - } - } - return k.a; - } - function abe() { - RRd(g7, new Ibe()); - RRd(f7, new nce()); - RRd(h7, new Uce()); - RRd(i7, new kde()); - RRd(k7, new nde()); - RRd(m7, new qde()); - RRd(l7, new tde()); - RRd(n7, new wde()); - RRd(p7, new ebe()); - RRd(q7, new hbe()); - RRd(r7, new kbe()); - RRd(s7, new nbe()); - RRd(t7, new qbe()); - RRd(u7, new tbe()); - RRd(v7, new wbe()); - RRd(y7, new zbe()); - RRd(A7, new Cbe()); - RRd(C8, new Fbe()); - RRd(o7, new Lbe()); - RRd(z7, new Obe()); - RRd(QI, new Rbe()); - RRd(WC(gE, 1), new Ube()); - RRd(RI, new Xbe()); - RRd(SI, new $be()); - RRd(qK, new bce()); - RRd(T6, new ece()); - RRd(VI, new hce()); - RRd(Y6, new kce()); - RRd(Z6, new qce()); - RRd(Tbb, new tce()); - RRd(Jbb, new wce()); - RRd(ZI, new zce()); - RRd(bJ, new Cce()); - RRd(UI, new Fce()); - RRd(eJ, new Ice()); - RRd(VK, new Lce()); - RRd(Aab, new Oce()); - RRd(zab, new Rce()); - RRd(lJ, new Xce()); - RRd(qJ, new $ce()); - RRd(a7, new bde()); - RRd($6, new ede()); - } - function Inb(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - if (a == null) { - return vve; - } - i2 = b.a.zc(a, b); - if (i2 != null) { - return "[...]"; - } - c2 = new Jyb(pve, "[", "]"); - for (e = a, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - if (d != null && (rb(d).i & 4) != 0) { - if (Array.isArray(d) && (k = XC(d), !(k >= 14 && k <= 16))) { - if (b.a._b(d)) { - !c2.a ? c2.a = new dib(c2.d) : Zhb(c2.a, c2.b); - Whb(c2.a, "[...]"); - } else { - h = SD(d); - j = new btb(b); - Gyb(c2, Inb(h, j)); - } - } else - ZD(d, 183) ? Gyb(c2, hob(RD(d, 183))) : ZD(d, 195) ? Gyb(c2, aob(RD(d, 195))) : ZD(d, 201) ? Gyb(c2, bob(RD(d, 201))) : ZD(d, 2111) ? Gyb(c2, gob(RD(d, 2111))) : ZD(d, 53) ? Gyb(c2, eob(RD(d, 53))) : ZD(d, 376) ? Gyb(c2, fob(RD(d, 376))) : ZD(d, 846) ? Gyb(c2, dob(RD(d, 846))) : ZD(d, 109) && Gyb(c2, cob(RD(d, 109))); - } else { - Gyb(c2, d == null ? vve : jeb(d)); - } - } - return !c2.a ? c2.c : c2.e.length == 0 ? c2.a.a : c2.a.a + ("" + c2.e); - } - function KXd(a, b) { - var c2, d, e, f2; - f2 = a.F; - if (b == null) { - a.F = null; - yXd(a, null); - } else { - a.F = (uFb(b), b); - d = qhb(b, Fhb(60)); - if (d != -1) { - e = (AFb(0, d, b.length), b.substr(0, d)); - qhb(b, Fhb(46)) == -1 && !lhb(e, hve) && !lhb(e, dKe) && !lhb(e, eKe) && !lhb(e, fKe) && !lhb(e, gKe) && !lhb(e, hKe) && !lhb(e, iKe) && !lhb(e, jKe) && (e = kKe); - c2 = thb(b, Fhb(62)); - c2 != -1 && (e += "" + (BFb(c2 + 1, b.length + 1), b.substr(c2 + 1))); - yXd(a, e); - } else { - e = b; - if (qhb(b, Fhb(46)) == -1) { - d = qhb(b, Fhb(91)); - d != -1 && (e = (AFb(0, d, b.length), b.substr(0, d))); - if (!lhb(e, hve) && !lhb(e, dKe) && !lhb(e, eKe) && !lhb(e, fKe) && !lhb(e, gKe) && !lhb(e, hKe) && !lhb(e, iKe) && !lhb(e, jKe)) { - e = kKe; - d != -1 && (e += "" + (BFb(d, b.length + 1), b.substr(d))); - } else { - e = b; - } - } - yXd(a, e); - e == b && (a.F = a.D); - } - } - (a.Db & 4) != 0 && (a.Db & 1) == 0 && qvd(a, new N3d(a, 1, 5, f2, b)); - } - function Pvd(b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - j = c2.length - 1; - i2 = (BFb(j, c2.length), c2.charCodeAt(j)); - if (i2 == 93) { - h = qhb(c2, Fhb(91)); - if (h >= 0) { - f2 = Uvd(b, (AFb(1, h, c2.length), c2.substr(1, h - 1))); - l = (AFb(h + 1, j, c2.length), c2.substr(h + 1, j - (h + 1))); - return Nvd(b, l, f2); - } - } else { - d = -1; - _eb == null && (_eb = new RegExp("\\d")); - if (_eb.test(String.fromCharCode(i2))) { - d = uhb(c2, Fhb(46), j - 1); - if (d >= 0) { - e = RD(Fvd(b, Zvd(b, (AFb(1, d, c2.length), c2.substr(1, d - 1))), false), 61); - k = 0; - try { - k = Oeb((BFb(d + 1, c2.length + 1), c2.substr(d + 1)), qwe, lve); - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - g = a; - throw Adb(new RSd(g)); - } else - throw Adb(a); - } - if (k < e.gc()) { - m = e.Xb(k); - ZD(m, 76) && (m = RD(m, 76).md()); - return RD(m, 58); - } - } - } - if (d < 0) { - return RD(Fvd(b, Zvd(b, (BFb(1, c2.length + 1), c2.substr(1))), false), 58); - } - } - return null; - } - function Jcc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - b.Ug("Label dummy insertions", 1); - l = new bnb(); - g = Kfb(UD(mQb(a, (yCc(), VBc)))); - j = Kfb(UD(mQb(a, ZBc))); - k = RD(mQb(a, rAc), 88); - for (n = new Anb(a.a); n.a < n.c.c.length; ) { - m = RD(ynb(n), 10); - for (f2 = new is(Mr(a3b(m).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (e.c.i != e.d.i && br(e.b, Gcc)) { - p = Kcc(e); - o2 = ev(e.b.c.length); - c2 = Icc(a, e, p, o2); - ZEb(l.c, c2); - d = c2.o; - h = new Jkb(e.b, 0); - while (h.b < h.d.gc()) { - i2 = (sFb(h.b < h.d.gc()), RD(h.d.Xb(h.c = h.b++), 72)); - if (dE(mQb(i2, wAc)) === dE((Omd(), Lmd))) { - if (k == (Cmd(), Bmd) || k == xmd) { - d.a += i2.o.a + j; - d.b = $wnd.Math.max(d.b, i2.o.b); - } else { - d.a = $wnd.Math.max(d.a, i2.o.a); - d.b += i2.o.b + j; - } - ZEb(o2.c, i2); - Ckb(h); - } - } - if (k == (Cmd(), Bmd) || k == xmd) { - d.a -= j; - d.b += g + p; - } else { - d.b += g - j + p; - } - } - } - } - Tmb(a.a, l); - b.Vg(); - } - function H_b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - a.c = a.e; - o2 = TD(mQb(b, (yCc(), OBc))); - n = o2 == null || (uFb(o2), o2); - f2 = RD(mQb(b, (Ywc(), kwc)), 21).Hc((ovc(), hvc)); - e = RD(mQb(b, BBc), 101); - c2 = !(e == (Bod(), vod) || e == xod || e == wod); - if (n && (c2 || !f2)) { - for (l = new Anb(b.a); l.a < l.c.c.length; ) { - j = RD(ynb(l), 10); - j.p = 0; - } - m = new bnb(); - for (k = new Anb(b.a); k.a < k.c.c.length; ) { - j = RD(ynb(k), 10); - d = G_b(a, j, null); - if (d) { - i2 = new d1b(); - kQb(i2, b); - pQb(i2, ewc, RD(d.b, 21)); - C2b(i2.d, b.d); - pQb(i2, nBc, null); - for (h = RD(d.a, 15).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 10); - Rmb(i2.a, g); - g.a = i2; - } - m.Fc(i2); - } - } - f2 && (dE(mQb(b, Yzc)) === dE((U$b(), Q$b)) ? a.c = a.b : dE(mQb(b, Yzc)) === dE(S$b) ? a.c = a.d : a.c = a.a); - } else { - m = new mob(cD(WC(eR, 1), OAe, 36, 0, [b])); - } - dE(mQb(b, Yzc)) !== dE((U$b(), T$b)) && (yob(), m.jd(new K_b())); - return m; - } - function o2d(a, b, c2) { - var d, e, f2, g, h, i2, j; - j = a.c; - !b && (b = d2d); - a.c = b; - if ((a.Db & 4) != 0 && (a.Db & 1) == 0) { - i2 = new N3d(a, 1, 2, j, a.c); - !c2 ? c2 = i2 : c2.nj(i2); - } - if (j != b) { - if (ZD(a.Cb, 292)) { - if (a.Db >> 16 == -10) { - c2 = RD(a.Cb, 292).Yk(b, c2); - } else if (a.Db >> 16 == -15) { - !b && (b = (JTd(), wTd)); - !j && (j = (JTd(), wTd)); - if (a.Cb.Yh()) { - i2 = new P3d(a.Cb, 1, 13, j, b, fZd(o4d(RD(a.Cb, 62)), a), false); - !c2 ? c2 = i2 : c2.nj(i2); - } - } - } else if (ZD(a.Cb, 90)) { - if (a.Db >> 16 == -23) { - ZD(b, 90) || (b = (JTd(), zTd)); - ZD(j, 90) || (j = (JTd(), zTd)); - if (a.Cb.Yh()) { - i2 = new P3d(a.Cb, 1, 10, j, b, fZd(tYd(RD(a.Cb, 29)), a), false); - !c2 ? c2 = i2 : c2.nj(i2); - } - } - } else if (ZD(a.Cb, 457)) { - h = RD(a.Cb, 850); - g = (!h.b && (h.b = new pae(new lae())), h.b); - for (f2 = (d = new vkb(new mkb(g.a).a), new xae(d)); f2.a.b; ) { - e = RD(tkb(f2.a).ld(), 89); - c2 = o2d(e, k2d(e, h), c2); - } - } - } - return c2; - } - function Y4b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - g = Heb(TD(Gxd(a, (yCc(), NAc)))); - m = RD(Gxd(a, EBc), 21); - i2 = false; - j = false; - l = new dMd((!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c)); - while (l.e != l.i.gc() && (!i2 || !j)) { - f2 = RD(bMd(l), 123); - h = 0; - for (e = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [(!f2.d && (f2.d = new Yie(G4, f2, 8, 5)), f2.d), (!f2.e && (f2.e = new Yie(G4, f2, 7, 4)), f2.e)]))); gs(e); ) { - d = RD(hs(e), 74); - k = g && ozd(d) && Heb(TD(Gxd(d, OAc))); - c2 = cZd((!d.b && (d.b = new Yie(E4, d, 4, 7)), d.b), f2) ? a == vCd(AGd(RD(QHd((!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c), 0), 84))) : a == vCd(AGd(RD(QHd((!d.b && (d.b = new Yie(E4, d, 4, 7)), d.b), 0), 84))); - if (k || c2) { - ++h; - if (h > 1) { - break; - } - } - } - h > 0 ? i2 = true : m.Hc((Pod(), Lod)) && (!f2.n && (f2.n = new C5d(I4, f2, 1, 7)), f2.n).i > 0 && (i2 = true); - h > 1 && (j = true); - } - i2 && b.Fc((ovc(), hvc)); - j && b.Fc((ovc(), ivc)); - } - function Dsd(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - m = RD(Gxd(a, (umd(), kld)), 21); - if (m.dc()) { - return null; - } - h = 0; - g = 0; - if (m.Hc((Qpd(), Opd))) { - k = RD(Gxd(a, Hld), 101); - d = 2; - c2 = 2; - e = 2; - f2 = 2; - b = !vCd(a) ? RD(Gxd(a, Nkd), 88) : RD(Gxd(vCd(a), Nkd), 88); - for (j = new dMd((!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c)); j.e != j.i.gc(); ) { - i2 = RD(bMd(j), 123); - l = RD(Gxd(i2, Old), 64); - if (l == (qpd(), opd)) { - l = osd(i2, b); - Ixd(i2, Old, l); - } - if (k == (Bod(), wod)) { - switch (l.g) { - case 1: - d = $wnd.Math.max(d, i2.i + i2.g); - break; - case 2: - c2 = $wnd.Math.max(c2, i2.j + i2.f); - break; - case 3: - e = $wnd.Math.max(e, i2.i + i2.g); - break; - case 4: - f2 = $wnd.Math.max(f2, i2.j + i2.f); - } - } else { - switch (l.g) { - case 1: - d += i2.g + 2; - break; - case 2: - c2 += i2.f + 2; - break; - case 3: - e += i2.g + 2; - break; - case 4: - f2 += i2.f + 2; - } - } - } - h = $wnd.Math.max(d, e); - g = $wnd.Math.max(c2, f2); - } - return Esd(a, h, g, true, true); - } - function Rqc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - s = RD(zDb(PDb(CDb(new SDb(null, new Swb(b.d, 16)), new Vqc(c2)), new Xqc(c2)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - l = lve; - k = qwe; - for (i2 = new Anb(b.b.j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 12); - if (h.j == c2) { - l = $wnd.Math.min(l, h.p); - k = $wnd.Math.max(k, h.p); - } - } - if (l == lve) { - for (g = 0; g < s.gc(); g++) { - Umc(RD(s.Xb(g), 105), c2, g); - } - } else { - t = $C(kE, Pwe, 28, e.length, 15, 1); - Qnb(t, t.length); - for (r = s.Kc(); r.Ob(); ) { - q = RD(r.Pb(), 105); - f2 = RD(Wjb(a.b, q), 183); - j = 0; - for (p = l; p <= k; p++) { - f2[p] && (j = $wnd.Math.max(j, d[p])); - } - if (q.i) { - n = q.i.c; - u = new _sb(); - for (m = 0; m < e.length; m++) { - e[n][m] && Ysb(u, sgb(t[m])); - } - while (Zsb(u, sgb(j))) { - ++j; - } - } - Umc(q, c2, j); - for (o2 = l; o2 <= k; o2++) { - f2[o2] && (d[o2] = j + 1); - } - !!q.i && (t[q.i.c] = j); - } - } - } - function wOc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - e = null; - for (d = new Anb(b.a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - BOc(c2) ? f2 = (h = eJb(fJb(new gJb(), c2), a.f), i2 = eJb(fJb(new gJb(), c2), a.f), j = new ROc(c2, true, h, i2), k = c2.o.b, l = (wDc(), (!c2.q ? (yob(), yob(), wob) : c2.q)._b((yCc(), iBc)) ? m = RD(mQb(c2, iBc), 203) : m = RD(mQb(Y2b(c2), jBc), 203), m), n = 1e4, l == sDc && (n = 1), o2 = rIb(uIb(tIb(sIb(vIb(new wIb(), n), eE($wnd.Math.ceil(k))), h), i2)), l == tDc && Ysb(a.d, o2), xOc(a, hv(b3b(c2, (qpd(), ppd))), j), xOc(a, b3b(c2, Xod), j), j) : f2 = (p = eJb(fJb(new gJb(), c2), a.f), FDb(CDb(new SDb(null, new Swb(c2.j, 16)), new cPc()), new ePc(a, p)), new ROc(c2, false, p, p)); - a.i[c2.p] = f2; - if (e) { - g = e.c.d.a + bFc(a.n, e.c, c2) + c2.d.d; - e.b || (g += e.c.o.b); - rIb(uIb(tIb(vIb(sIb(new wIb(), eE($wnd.Math.ceil(g))), 0), e.d), f2.a)); - } - e = f2; - } - } - function h_b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n; - f2 = new t_b(b); - l = c_b(a, b, f2); - n = $wnd.Math.max(Kfb(UD(mQb(b, (yCc(), FAc)))), 1); - for (k = new Anb(l.a); k.a < k.c.c.length; ) { - j = RD(ynb(k), 42); - i2 = g_b(RD(j.a, 8), RD(j.b, 8), n); - o = true; - o = o & l_b(c2, new rjd(i2.c, i2.d)); - o = o & l_b(c2, Zid(new rjd(i2.c, i2.d), i2.b, 0)); - o = o & l_b(c2, Zid(new rjd(i2.c, i2.d), 0, i2.a)); - o & l_b(c2, Zid(new rjd(i2.c, i2.d), i2.b, i2.a)); - } - m = f2.d; - h = g_b(RD(l.b.a, 8), RD(l.b.b, 8), n); - if (m == (qpd(), ppd) || m == Xod) { - d.c[m.g] = $wnd.Math.min(d.c[m.g], h.d); - d.b[m.g] = $wnd.Math.max(d.b[m.g], h.d + h.a); - } else { - d.c[m.g] = $wnd.Math.min(d.c[m.g], h.c); - d.b[m.g] = $wnd.Math.max(d.b[m.g], h.c + h.b); - } - e = pxe; - g = f2.c.i.d; - switch (m.g) { - case 4: - e = g.c; - break; - case 2: - e = g.b; - break; - case 1: - e = g.a; - break; - case 3: - e = g.d; - } - d.a[m.g] = $wnd.Math.max(d.a[m.g], e); - return f2; - } - function W7b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - h = RD(Wjb(b.c, a), 468); - s = b.a.c; - i2 = b.a.c + b.a.b; - C = h.f; - D5 = h.a; - g = C < D5; - p = new rjd(s, C); - t = new rjd(i2, D5); - e = (s + i2) / 2; - q = new rjd(e, C); - u = new rjd(e, D5); - f2 = X7b(a, C, D5); - w2 = K3b(b.B); - A = new rjd(e, f2); - B = K3b(b.D); - c2 = uid(cD(WC(l3, 1), Nve, 8, 0, [w2, A, B])); - n = false; - r = b.B.i; - if (!!r && !!r.c && h.d) { - j = g && r.p < r.c.a.c.length - 1 || !g && r.p > 0; - if (j) { - if (j) { - m = r.p; - g ? ++m : --m; - l = RD(Vmb(r.c.a, m), 10); - d = Z7b(l); - n = !(Did(d, w2, c2[0]) || yid(d, w2, c2[0])); - } - } else { - n = true; - } - } - o2 = false; - v = b.D.i; - if (!!v && !!v.c && h.e) { - k = g && v.p > 0 || !g && v.p < v.c.a.c.length - 1; - if (k) { - m = v.p; - g ? --m : ++m; - l = RD(Vmb(v.c.a, m), 10); - d = Z7b(l); - o2 = !(Did(d, c2[0], B) || yid(d, c2[0], B)); - } else { - o2 = true; - } - } - n && o2 && Mub(a.a, A); - n || zjd(a.a, cD(WC(l3, 1), Nve, 8, 0, [p, q])); - o2 || zjd(a.a, cD(WC(l3, 1), Nve, 8, 0, [u, t])); - } - function MNc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s; - n = b.c.length; - m = 0; - for (l = new Anb(a.b); l.a < l.c.c.length; ) { - k = RD(ynb(l), 30); - r = k.a; - if (r.c.length == 0) { - continue; - } - q = new Anb(r); - j = 0; - s = null; - e = RD(ynb(q), 10); - f2 = null; - while (e) { - f2 = RD(Vmb(b, e.p), 261); - if (f2.c >= 0) { - i2 = null; - h = new Jkb(k.a, j + 1); - while (h.b < h.d.gc()) { - g = (sFb(h.b < h.d.gc()), RD(h.d.Xb(h.c = h.b++), 10)); - i2 = RD(Vmb(b, g.p), 261); - if (i2.d == f2.d && i2.c < f2.c) { - break; - } else { - i2 = null; - } - } - if (i2) { - if (s) { - $mb(d, e.p, sgb(RD(Vmb(d, e.p), 17).a - 1)); - RD(Vmb(c2, s.p), 15).Mc(f2); - } - f2 = YNc(f2, e, n++); - ZEb(b.c, f2); - Rmb(c2, new bnb()); - if (s) { - RD(Vmb(c2, s.p), 15).Fc(f2); - Rmb(d, sgb(1)); - } else { - Rmb(d, sgb(0)); - } - } - } - o2 = null; - if (q.a < q.c.c.length) { - o2 = RD(ynb(q), 10); - p = RD(Vmb(b, o2.p), 261); - RD(Vmb(c2, e.p), 15).Fc(p); - $mb(d, o2.p, sgb(RD(Vmb(d, o2.p), 17).a + 1)); - } - f2.d = m; - f2.c = j++; - s = e; - e = o2; - } - ++m; - } - } - function I5b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - f2 = RD(mQb(a, (Ywc(), Awc)), 74); - if (!f2) { - return; - } - d = a.a; - e = new sjd(c2); - $id(e, M5b(a)); - if (n2b(a.d.i, a.c.i)) { - m = a.c; - l = xjd(cD(WC(l3, 1), Nve, 8, 0, [m.n, m.a])); - ojd(l, c2); - } else { - l = K3b(a.c); - } - Pub(d, l, d.a, d.a.a); - n = K3b(a.d); - mQb(a, Wwc) != null && $id(n, RD(mQb(a, Wwc), 8)); - Pub(d, n, d.c.b, d.c); - Cjd(d, e); - g = IGd(f2, true, true); - Kzd(g, RD(QHd((!f2.b && (f2.b = new Yie(E4, f2, 4, 7)), f2.b), 0), 84)); - Lzd(g, RD(QHd((!f2.c && (f2.c = new Yie(E4, f2, 5, 8)), f2.c), 0), 84)); - lsd(d, g); - for (k = new Anb(a.b); k.a < k.c.c.length; ) { - j = RD(ynb(k), 72); - h = RD(mQb(j, Awc), 135); - Cyd(h, j.o.a); - Ayd(h, j.o.b); - Byd(h, j.n.a + e.a, j.n.b + e.b); - Ixd(h, (Zcc(), Ycc), TD(mQb(j, Ycc))); - } - i2 = RD(mQb(a, (yCc(), RAc)), 75); - if (i2) { - Cjd(i2, e); - Ixd(f2, RAc, i2); - } else { - Ixd(f2, RAc, null); - } - b == (Ymd(), Wmd) ? Ixd(f2, yAc, Wmd) : Ixd(f2, yAc, null); - } - function O3c(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B; - if (c2.c.length != 0) { - o2 = new bnb(); - for (n = new Anb(c2); n.a < n.c.c.length; ) { - m = RD(ynb(n), 27); - Rmb(o2, new rjd(m.i, m.j)); - } - d.dh(b, "Before removing overlaps"); - while (p3c(a, c2)) { - n3c(a, c2, false); - } - d.dh(b, "After removing overlaps"); - h = 0; - i2 = 0; - e = null; - if (c2.c.length != 0) { - e = (tFb(0, c2.c.length), RD(c2.c[0], 27)); - h = e.i - (tFb(0, o2.c.length), RD(o2.c[0], 8)).a; - i2 = e.j - (tFb(0, o2.c.length), RD(o2.c[0], 8)).b; - } - g = $wnd.Math.sqrt(h * h + i2 * i2); - l = M2c(c2); - f2 = 1; - if (l.a.gc() != 0) { - for (k = l.a.ec().Kc(); k.Ob(); ) { - j = RD(k.Pb(), 27); - p = a.f; - q = p.i + p.g / 2; - r = p.j + p.f / 2; - s = j.i + j.g / 2; - t = j.j + j.f / 2; - u = s - q; - v = t - r; - w2 = $wnd.Math.sqrt(u * u + v * v); - A = u / w2; - B = v / w2; - Dyd(j, j.i + A * g); - Eyd(j, j.j + B * g); - } - d.dh(b, "Child movement " + f2); - ++f2; - } - !!a.a && a.a.Gg(new dnb(l)); - O3c(a, b, new dnb(l), d); - } - } - function Fid(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - i2 = a; - k = ojd(new rjd(b.a, b.b), a); - j = c2; - l = ojd(new rjd(d.a, d.b), c2); - m = i2.a; - q = i2.b; - o2 = j.a; - s = j.b; - n = k.a; - r = k.b; - p = l.a; - t = l.b; - e = p * r - n * t; - Zy(); - bz(vEe); - if ($wnd.Math.abs(0 - e) <= vEe || 0 == e || isNaN(0) && isNaN(e)) { - return false; - } - g = 1 / e * ((m - o2) * r - (q - s) * n); - h = 1 / e * -(-(m - o2) * t + (q - s) * p); - f2 = (bz(vEe), ($wnd.Math.abs(0 - g) <= vEe || 0 == g || isNaN(0) && isNaN(g) ? 0 : 0 < g ? -1 : 0 > g ? 1 : cz(isNaN(0), isNaN(g))) < 0 && (bz(vEe), ($wnd.Math.abs(g - 1) <= vEe || g == 1 || isNaN(g) && isNaN(1) ? 0 : g < 1 ? -1 : g > 1 ? 1 : cz(isNaN(g), isNaN(1))) < 0) && (bz(vEe), ($wnd.Math.abs(0 - h) <= vEe || 0 == h || isNaN(0) && isNaN(h) ? 0 : 0 < h ? -1 : 0 > h ? 1 : cz(isNaN(0), isNaN(h))) < 0) && (bz(vEe), ($wnd.Math.abs(h - 1) <= vEe || h == 1 || isNaN(h) && isNaN(1) ? 0 : h < 1 ? -1 : h > 1 ? 1 : cz(isNaN(h), isNaN(1))) < 0)); - return f2; - } - function EXd(b) { - var c2, d, e, f2; - d = b.D != null ? b.D : b.B; - c2 = qhb(d, Fhb(91)); - if (c2 != -1) { - e = (AFb(0, c2, d.length), d.substr(0, c2)); - f2 = new Qhb(); - do - f2.a += "["; - while ((c2 = phb(d, 91, ++c2)) != -1); - if (lhb(e, hve)) - f2.a += "Z"; - else if (lhb(e, dKe)) - f2.a += "B"; - else if (lhb(e, eKe)) - f2.a += "C"; - else if (lhb(e, fKe)) - f2.a += "D"; - else if (lhb(e, gKe)) - f2.a += "F"; - else if (lhb(e, hKe)) - f2.a += "I"; - else if (lhb(e, iKe)) - f2.a += "J"; - else if (lhb(e, jKe)) - f2.a += "S"; - else { - f2.a += "L"; - f2.a += "" + e; - f2.a += ";"; - } - try { - return null; - } catch (a) { - a = zdb(a); - if (!ZD(a, 63)) - throw Adb(a); - } - } else if (qhb(d, Fhb(46)) == -1) { - if (lhb(d, hve)) - return xdb; - else if (lhb(d, dKe)) - return gE; - else if (lhb(d, eKe)) - return hE; - else if (lhb(d, fKe)) - return iE; - else if (lhb(d, gKe)) - return jE; - else if (lhb(d, hKe)) - return kE; - else if (lhb(d, iKe)) - return lE; - else if (lhb(d, jKe)) - return wdb; - } - return null; - } - function pTb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A; - a.e = b; - h = RSb(b); - w2 = new bnb(); - for (d = new Anb(h); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 15); - A = new bnb(); - ZEb(w2.c, A); - i2 = new _sb(); - for (o2 = c2.Kc(); o2.Ob(); ) { - n = RD(o2.Pb(), 27); - f2 = nTb(a, n, true, 0, 0); - ZEb(A.c, f2); - p = n.i; - q = n.j; - m = (!n.n && (n.n = new C5d(I4, n, 1, 7)), n.n); - for (l = new dMd(m); l.e != l.i.gc(); ) { - j = RD(bMd(l), 135); - e = nTb(a, j, false, p, q); - ZEb(A.c, e); - } - v = (!n.c && (n.c = new C5d(K4, n, 9, 9)), n.c); - for (s = new dMd(v); s.e != s.i.gc(); ) { - r = RD(bMd(s), 123); - g = nTb(a, r, false, p, q); - ZEb(A.c, g); - t = r.i + p; - u = r.j + q; - m = (!r.n && (r.n = new C5d(I4, r, 1, 7)), r.n); - for (k = new dMd(m); k.e != k.i.gc(); ) { - j = RD(bMd(k), 135); - e = nTb(a, j, false, t, u); - ZEb(A.c, e); - } - } - ye(i2, Ux(Al(cD(WC(cJ, 1), rve, 20, 0, [zGd(n), yGd(n)])))); - } - mTb(a, i2, A); - } - a.f = new TRb(w2); - kQb(a.f, b); - return a.f; - } - function Yje(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - for (l = new Dub(new wub(a)); l.c != l.d.a.d; ) { - k = Cub(l); - h = RD(k.d, 58); - b = RD(k.e, 58); - g = h.Dh(); - for (p = 0, u = (g.i == null && rYd(g), g.i).length; p < u; ++p) { - j = (f2 = (g.i == null && rYd(g), g.i), p >= 0 && p < f2.length ? f2[p] : null); - if (j.rk() && !j.sk()) { - if (ZD(j, 102)) { - i2 = RD(j, 19); - (i2.Bb & QHe) == 0 && (w2 = Z5d(i2), !(!!w2 && (w2.Bb & QHe) != 0)) && Xje(a, i2, h, b); - } else { - nke(); - if (RD(j, 69).xk()) { - c2 = (v = j, RD(!v ? null : RD(b, 54).gi(v), 160)); - if (c2) { - n = RD(h.Mh(j), 160); - d = c2.gc(); - for (q = 0, o2 = n.gc(); q < o2; ++q) { - m = n.Tl(q); - if (ZD(m, 102)) { - t = n.Ul(q); - e = cub(a, t); - if (e == null && t != null) { - s = RD(m, 19); - if (!a.b || (s.Bb & QHe) != 0 || !!Z5d(s)) { - continue; - } - e = t; - } - if (!c2.Ol(m, e)) { - for (r = 0; r < d; ++r) { - if (c2.Tl(r) == m && dE(c2.Ul(r)) === dE(e)) { - c2.Ti(c2.gc() - 1, r); - --d; - break; - } - } - } - } else { - c2.Ol(n.Tl(q), n.Ul(q)); - } - } - } - } - } - } - } - } - } - function gIc(a, b, c2) { - var d; - c2.Ug("StretchWidth layering", 1); - if (b.a.c.length == 0) { - c2.Vg(); - return; - } - a.c = b; - a.t = 0; - a.u = 0; - a.i = oxe; - a.g = pxe; - a.d = Kfb(UD(mQb(b, (yCc(), TBc)))); - aIc(a); - bIc(a); - $Hc(a); - fIc(a); - _Hc(a); - a.i = $wnd.Math.max(1, a.i); - a.g = $wnd.Math.max(1, a.g); - a.d = a.d / a.i; - a.f = a.g / a.i; - a.s = dIc(a); - d = new R4b(a.c); - Rmb(a.c.b, d); - a.r = bv(a.p); - a.n = Fnb(a.k, a.k.length); - while (a.r.c.length != 0) { - a.o = hIc(a); - if (!a.o || cIc(a) && a.b.a.gc() != 0) { - iIc(a, d); - d = new R4b(a.c); - Rmb(a.c.b, d); - ye(a.a, a.b); - a.b.a.$b(); - a.t = a.u; - a.u = 0; - } else { - if (cIc(a)) { - a.c.b.c.length = 0; - d = new R4b(a.c); - Rmb(a.c.b, d); - a.t = 0; - a.u = 0; - a.b.a.$b(); - a.a.a.$b(); - ++a.f; - a.r = bv(a.p); - a.n = Fnb(a.k, a.k.length); - } else { - g3b(a.o, d); - Ymb(a.r, a.o); - Ysb(a.b, a.o); - a.t = a.t - a.k[a.o.p] * a.d + a.j[a.o.p]; - a.u += a.e[a.o.p] * a.d; - } - } - } - b.a.c.length = 0; - Eob(b.b); - c2.Vg(); - } - function sOc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - a.j = $C(kE, Pwe, 28, a.g, 15, 1); - a.o = new bnb(); - FDb(EDb(new SDb(null, new Swb(a.e.b, 16)), new APc()), new CPc(a)); - a.a = $C(xdb, Hye, 28, a.b, 16, 1); - MDb(new SDb(null, new Swb(a.e.b, 16)), new RPc(a)); - d = (l = new bnb(), FDb(CDb(EDb(new SDb(null, new Swb(a.e.b, 16)), new HPc()), new JPc(a)), new LPc(a, l)), l); - for (i2 = new Anb(d); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 515); - if (h.c.length <= 1) { - continue; - } - if (h.c.length == 2) { - UOc(h); - BOc((tFb(0, h.c.length), RD(h.c[0], 18)).d.i) || Rmb(a.o, h); - continue; - } - if (TOc(h) || SOc(h, new FPc())) { - continue; - } - j = new Anb(h); - e = null; - while (j.a < j.c.c.length) { - b = RD(ynb(j), 18); - c2 = a.c[b.p]; - !e || j.a >= j.c.c.length ? k = hOc((r3b(), p3b), o3b) : k = hOc((r3b(), o3b), o3b); - k *= 2; - f2 = c2.a.g; - c2.a.g = $wnd.Math.max(f2, f2 + (k - f2)); - g = c2.b.g; - c2.b.g = $wnd.Math.max(g, g + (k - g)); - e = b; - } - } - } - function qkc(a) { - var b, c2, d, e; - FDb(CDb(new SDb(null, new Swb(a.a.b, 16)), new Qkc()), new Skc()); - okc(a); - FDb(CDb(new SDb(null, new Swb(a.a.b, 16)), new Ukc()), new Wkc()); - if (a.c == (Ymd(), Wmd)) { - FDb(CDb(EDb(new SDb(null, new Swb(new Xkb(a.f), 1)), new clc()), new elc()), new glc(a)); - FDb(CDb(GDb(EDb(EDb(new SDb(null, new Swb(a.d.b, 16)), new klc()), new mlc()), new olc()), new qlc()), new slc(a)); - } - e = new rjd(oxe, oxe); - b = new rjd(pxe, pxe); - for (d = new Anb(a.a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 60); - e.a = $wnd.Math.min(e.a, c2.d.c); - e.b = $wnd.Math.min(e.b, c2.d.d); - b.a = $wnd.Math.max(b.a, c2.d.c + c2.d.b); - b.b = $wnd.Math.max(b.b, c2.d.d + c2.d.a); - } - $id(hjd(a.d.c), fjd(new rjd(e.a, e.b))); - $id(hjd(a.d.f), ojd(new rjd(b.a, b.b), e)); - pkc(a, e, b); - akb(a.f); - akb(a.b); - akb(a.g); - akb(a.e); - a.a.a.c.length = 0; - a.a.b.c.length = 0; - a.a = null; - a.d = null; - } - function JGb(a, b) { - var c2; - if (a.e) { - throw Adb(new dgb((lfb(lN), lye + lN.k + mye))); - } - if (!cGb(a.a, b)) { - throw Adb(new yz(nye + b + oye)); - } - if (b == a.d) { - return a; - } - c2 = a.d; - a.d = b; - switch (c2.g) { - case 0: - switch (b.g) { - case 2: - GGb(a); - break; - case 1: - OGb(a); - GGb(a); - break; - case 4: - UGb(a); - GGb(a); - break; - case 3: - UGb(a); - OGb(a); - GGb(a); - } - break; - case 2: - switch (b.g) { - case 1: - OGb(a); - PGb(a); - break; - case 4: - UGb(a); - GGb(a); - break; - case 3: - UGb(a); - OGb(a); - GGb(a); - } - break; - case 1: - switch (b.g) { - case 2: - OGb(a); - PGb(a); - break; - case 4: - OGb(a); - UGb(a); - GGb(a); - break; - case 3: - OGb(a); - UGb(a); - OGb(a); - GGb(a); - } - break; - case 4: - switch (b.g) { - case 2: - UGb(a); - GGb(a); - break; - case 1: - UGb(a); - OGb(a); - GGb(a); - break; - case 3: - OGb(a); - PGb(a); - } - break; - case 3: - switch (b.g) { - case 2: - OGb(a); - UGb(a); - GGb(a); - break; - case 1: - OGb(a); - UGb(a); - OGb(a); - GGb(a); - break; - case 4: - OGb(a); - PGb(a); - } - } - return a; - } - function vYb(a, b) { - var c2; - if (a.d) { - throw Adb(new dgb((lfb(eQ), lye + eQ.k + mye))); - } - if (!eYb(a.a, b)) { - throw Adb(new yz(nye + b + oye)); - } - if (b == a.c) { - return a; - } - c2 = a.c; - a.c = b; - switch (c2.g) { - case 0: - switch (b.g) { - case 2: - sYb(a); - break; - case 1: - zYb(a); - sYb(a); - break; - case 4: - DYb(a); - sYb(a); - break; - case 3: - DYb(a); - zYb(a); - sYb(a); - } - break; - case 2: - switch (b.g) { - case 1: - zYb(a); - AYb(a); - break; - case 4: - DYb(a); - sYb(a); - break; - case 3: - DYb(a); - zYb(a); - sYb(a); - } - break; - case 1: - switch (b.g) { - case 2: - zYb(a); - AYb(a); - break; - case 4: - zYb(a); - DYb(a); - sYb(a); - break; - case 3: - zYb(a); - DYb(a); - zYb(a); - sYb(a); - } - break; - case 4: - switch (b.g) { - case 2: - DYb(a); - sYb(a); - break; - case 1: - DYb(a); - zYb(a); - sYb(a); - break; - case 3: - zYb(a); - AYb(a); - } - break; - case 3: - switch (b.g) { - case 2: - zYb(a); - DYb(a); - sYb(a); - break; - case 1: - zYb(a); - DYb(a); - zYb(a); - sYb(a); - break; - case 4: - zYb(a); - AYb(a); - } - } - return a; - } - function Csd(a, b) { - var c2, d, e, f2, g, h, i2, j; - if (ZD(a.Eh(), 167)) { - Csd(RD(a.Eh(), 167), b); - b.a += " > "; - } else { - b.a += "Root "; - } - c2 = a.Dh().zb; - lhb(c2.substr(0, 3), "Elk") ? Zhb(b, (BFb(3, c2.length + 1), c2.substr(3))) : (b.a += "" + c2, b); - e = a.jh(); - if (e) { - Zhb((b.a += " ", b), e); - return; - } - if (ZD(a, 366)) { - j = RD(a, 135).a; - if (j) { - Zhb((b.a += " ", b), j); - return; - } - } - for (g = new dMd(a.kh()); g.e != g.i.gc(); ) { - f2 = RD(bMd(g), 135); - j = f2.a; - if (j) { - Zhb((b.a += " ", b), j); - return; - } - } - if (ZD(a, 326)) { - d = RD(a, 74); - !d.b && (d.b = new Yie(E4, d, 4, 7)); - if (d.b.i != 0 && (!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c.i != 0)) { - b.a += " ("; - h = new mMd((!d.b && (d.b = new Yie(E4, d, 4, 7)), d.b)); - while (h.e != h.i.gc()) { - h.e > 0 && (b.a += pve, b); - Csd(RD(bMd(h), 167), b); - } - b.a += SAe; - i2 = new mMd((!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c)); - while (i2.e != i2.i.gc()) { - i2.e > 0 && (b.a += pve, b); - Csd(RD(bMd(i2), 167), b); - } - b.a += ")"; - } - } - } - function LTb(a, b, c2) { - var d, e, f2, g, h, i2, j, k; - for (i2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 27); - for (e = new is(Mr(zGd(h).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 74); - !d.b && (d.b = new Yie(E4, d, 4, 7)); - if (!(d.b.i <= 1 && (!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c.i <= 1))) { - throw Adb(new Ked("Graph must not contain hyperedges.")); - } - if (!nzd(d) && h != AGd(RD(QHd((!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c), 0), 84))) { - j = new cUb(); - kQb(j, d); - pQb(j, (JVb(), HVb), d); - _Tb(j, RD(Wd(qtb(c2.f, h)), 153)); - aUb(j, RD(Wjb(c2, AGd(RD(QHd((!d.c && (d.c = new Yie(E4, d, 5, 8)), d.c), 0), 84))), 153)); - Rmb(b.c, j); - for (g = new dMd((!d.n && (d.n = new C5d(I4, d, 1, 7)), d.n)); g.e != g.i.gc(); ) { - f2 = RD(bMd(g), 135); - k = new iUb(j, f2.a); - kQb(k, f2); - pQb(k, HVb, f2); - k.e.a = $wnd.Math.max(f2.g, 1); - k.e.b = $wnd.Math.max(f2.f, 1); - hUb(k); - Rmb(b.d, k); - } - } - } - } - } - function Vec(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - c2.Ug("Node promotion heuristic", 1); - a.i = b; - a.r = RD(mQb(b, (yCc(), ZAc)), 243); - a.r != (aEc(), TDc) && a.r != UDc ? Tec(a) : Uec(a); - k = RD(mQb(a.i, YAc), 17).a; - f2 = new nfc(); - switch (a.r.g) { - case 2: - case 1: - Yec(a, f2); - break; - case 3: - a.r = _Dc; - Yec(a, f2); - i2 = 0; - for (h = new Anb(a.b); h.a < h.c.c.length; ) { - g = RD(ynb(h), 17); - i2 = $wnd.Math.max(i2, g.a); - } - if (i2 > a.k) { - a.r = VDc; - Yec(a, f2); - } - break; - case 4: - a.r = _Dc; - Yec(a, f2); - j = 0; - for (e = new Anb(a.c); e.a < e.c.c.length; ) { - d = UD(ynb(e)); - j = $wnd.Math.max(j, (uFb(d), d)); - } - if (j > a.n) { - a.r = YDc; - Yec(a, f2); - } - break; - case 6: - m = eE($wnd.Math.ceil(a.g.length * k / 100)); - Yec(a, new qfc(m)); - break; - case 5: - l = eE($wnd.Math.ceil(a.e * k / 100)); - Yec(a, new tfc(l)); - break; - case 8: - Sec(a, true); - break; - case 9: - Sec(a, false); - break; - default: - Yec(a, f2); - } - a.r != TDc && a.r != UDc ? Zec(a, b) : $ec(a, b); - c2.Vg(); - } - function $rc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - l = a.b; - k = new Jkb(l, 0); - Ikb(k, new R4b(a)); - s = false; - g = 1; - while (k.b < k.d.gc()) { - j = (sFb(k.b < k.d.gc()), RD(k.d.Xb(k.c = k.b++), 30)); - p = (tFb(g, l.c.length), RD(l.c[g], 30)); - q = bv(j.a); - r = q.c.length; - for (o2 = new Anb(q); o2.a < o2.c.c.length; ) { - m = RD(ynb(o2), 10); - g3b(m, p); - } - if (s) { - for (n = hv(q).Kc(); n.Ob(); ) { - m = RD(n.Pb(), 10); - for (f2 = new Anb(bv(Z2b(m))); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 18); - X0b(e, true); - pQb(a, (Ywc(), awc), (Geb(), true)); - d = osc(a, e, r); - c2 = RD(mQb(m, Wvc), 313); - t = RD(Vmb(d, d.c.length - 1), 18); - c2.k = t.c.i; - c2.n = t; - c2.b = e.d.i; - c2.c = e; - } - } - s = false; - } else { - if (q.c.length != 0) { - b = (tFb(0, q.c.length), RD(q.c[0], 10)); - if (b.k == (r3b(), l3b)) { - s = true; - g = -1; - } - } - } - ++g; - } - h = new Jkb(a.b, 0); - while (h.b < h.d.gc()) { - i2 = (sFb(h.b < h.d.gc()), RD(h.d.Xb(h.c = h.b++), 30)); - i2.a.c.length == 0 && Ckb(h); - } - } - function FJb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - l = new CLb(a); - _Mb(l, !(b == (Cmd(), Bmd) || b == xmd)); - k = l.a; - m = new z3b(); - for (e = (ZJb(), cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb])), g = 0, i2 = e.length; g < i2; ++g) { - c2 = e[g]; - j = oKb(k, WJb, c2); - !!j && (m.d = $wnd.Math.max(m.d, j.jf())); - } - for (d = cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb]), f2 = 0, h = d.length; f2 < h; ++f2) { - c2 = d[f2]; - j = oKb(k, YJb, c2); - !!j && (m.a = $wnd.Math.max(m.a, j.jf())); - } - for (p = cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb]), r = 0, t = p.length; r < t; ++r) { - n = p[r]; - j = oKb(k, n, WJb); - !!j && (m.b = $wnd.Math.max(m.b, j.kf())); - } - for (o2 = cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb]), q = 0, s = o2.length; q < s; ++q) { - n = o2[q]; - j = oKb(k, n, YJb); - !!j && (m.c = $wnd.Math.max(m.c, j.kf())); - } - if (m.d > 0) { - m.d += k.n.d; - m.d += k.d; - } - if (m.a > 0) { - m.a += k.n.a; - m.a += k.d; - } - if (m.b > 0) { - m.b += k.n.b; - m.b += k.d; - } - if (m.c > 0) { - m.c += k.n.c; - m.c += k.d; - } - return m; - } - function u9b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2; - m = c2.d; - l = c2.c; - f2 = new rjd(c2.f.a + c2.d.b + c2.d.c, c2.f.b + c2.d.d + c2.d.a); - g = f2.b; - for (j = new Anb(a.a); j.a < j.c.c.length; ) { - h = RD(ynb(j), 10); - if (h.k != (r3b(), m3b)) { - continue; - } - d = RD(mQb(h, (Ywc(), hwc)), 64); - e = RD(mQb(h, iwc), 8); - k = h.n; - switch (d.g) { - case 2: - k.a = c2.f.a + m.c - l.a; - break; - case 4: - k.a = -l.a - m.b; - } - o2 = 0; - switch (d.g) { - case 2: - case 4: - if (b == (Bod(), xod)) { - n = Kfb(UD(mQb(h, Jwc))); - k.b = f2.b * n - RD(mQb(h, (yCc(), zBc)), 8).b; - o2 = k.b + e.b; - U2b(h, false, true); - } else if (b == wod) { - k.b = Kfb(UD(mQb(h, Jwc))) - RD(mQb(h, (yCc(), zBc)), 8).b; - o2 = k.b + e.b; - U2b(h, false, true); - } - } - g = $wnd.Math.max(g, o2); - } - c2.f.b += g - f2.b; - for (i2 = new Anb(a.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - if (h.k != (r3b(), m3b)) { - continue; - } - d = RD(mQb(h, (Ywc(), hwc)), 64); - k = h.n; - switch (d.g) { - case 1: - k.b = -l.b - m.d; - break; - case 3: - k.b = c2.f.b + m.a - l.b; - } - } - } - function nNb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - k = RD(RD(Qc(a.r, b), 21), 87); - if (k.gc() <= 2 || b == (qpd(), Xod) || b == (qpd(), ppd)) { - rNb(a, b); - return; - } - p = a.u.Hc((Pod(), Ood)); - c2 = b == (qpd(), Yod) ? (mOb(), lOb) : (mOb(), iOb); - r = b == Yod ? (vLb(), sLb) : (vLb(), uLb); - d = WNb(_Nb(c2), a.s); - q = b == Yod ? oxe : pxe; - for (j = k.Kc(); j.Ob(); ) { - h = RD(j.Pb(), 117); - if (!h.c || h.c.d.c.length <= 0) { - continue; - } - o2 = h.b.Mf(); - n = h.e; - l = h.c; - m = l.i; - m.b = (f2 = l.n, l.e.a + f2.b + f2.c); - m.a = (g = l.n, l.e.b + g.d + g.a); - if (p) { - m.c = n.a - (e = l.n, l.e.a + e.b + e.c) - a.s; - p = false; - } else { - m.c = n.a + o2.a + a.s; - } - Ivb(r, Pye); - l.f = r; - RKb(l, (EKb(), DKb)); - Rmb(d.d, new sOb(m, UNb(d, m))); - q = b == Yod ? $wnd.Math.min(q, n.b) : $wnd.Math.max(q, n.b + h.b.Mf().b); - } - q += b == Yod ? -a.t : a.t; - VNb((d.e = q, d)); - for (i2 = k.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 117); - if (!h.c || h.c.d.c.length <= 0) { - continue; - } - m = h.c.i; - m.c -= h.e.a; - m.d -= h.e.b; - } - } - function D0b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - e = new bnb(); - for (p = new Anb(b.a); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 10); - n = o2.e; - if (n) { - d = D0b(a, n, o2); - Tmb(e, d); - A0b(a, n, o2); - if (RD(mQb(n, (Ywc(), kwc)), 21).Hc((ovc(), hvc))) { - s = RD(mQb(o2, (yCc(), BBc)), 101); - m = RD(mQb(o2, EBc), 181).Hc((Pod(), Lod)); - for (r = new Anb(o2.j); r.a < r.c.c.length; ) { - q = RD(ynb(r), 12); - f2 = RD(Wjb(a.b, q), 10); - if (!f2) { - f2 = f2b(q, s, q.j, -(q.e.c.length - q.g.c.length), null, new pjd(), q.o, RD(mQb(n, rAc), 88), n); - pQb(f2, Awc, q); - Zjb(a.b, q, f2); - Rmb(n.a, f2); - } - g = RD(Vmb(f2.j, 0), 12); - for (k = new Anb(q.f); k.a < k.c.c.length; ) { - j = RD(ynb(k), 72); - h = new x2b(); - h.o.a = j.o.a; - h.o.b = j.o.b; - Rmb(g.f, h); - if (!m) { - t = q.j; - l = 0; - Rod(RD(mQb(o2, EBc), 21)) && (l = qsd(j.n, j.o, q.o, 0, t)); - s == (Bod(), zod) || (qpd(), apd).Hc(t) ? h.o.a = l : h.o.b = l; - } - } - } - } - } - } - i2 = new bnb(); - z0b(a, b, c2, e, i2); - !!c2 && B0b(a, b, c2, i2); - return i2; - } - function NIc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - if (a.c[b.c.p][b.p].e) { - return; - } else { - a.c[b.c.p][b.p].e = true; - } - a.c[b.c.p][b.p].b = 0; - a.c[b.c.p][b.p].d = 0; - a.c[b.c.p][b.p].a = null; - for (k = new Anb(b.j); k.a < k.c.c.length; ) { - j = RD(ynb(k), 12); - l = c2 ? new T3b(j) : new _3b(j); - for (i2 = l.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 12); - g = h.i; - if (g.c == b.c) { - if (g != b) { - NIc(a, g, c2); - a.c[b.c.p][b.p].b += a.c[g.c.p][g.p].b; - a.c[b.c.p][b.p].d += a.c[g.c.p][g.p].d; - } - } else { - a.c[b.c.p][b.p].d += a.g[h.p]; - ++a.c[b.c.p][b.p].b; - } - } - } - f2 = RD(mQb(b, (Ywc(), Uvc)), 15); - if (f2) { - for (e = f2.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 10); - if (b.c == d.c) { - NIc(a, d, c2); - a.c[b.c.p][b.p].b += a.c[d.c.p][d.p].b; - a.c[b.c.p][b.p].d += a.c[d.c.p][d.p].d; - } - } - } - if (a.c[b.c.p][b.p].b > 0) { - a.c[b.c.p][b.p].d += Kwb(a.i, 24) * Nxe * 0.07000000029802322 - 0.03500000014901161; - a.c[b.c.p][b.p].a = a.c[b.c.p][b.p].d / a.c[b.c.p][b.p].b; - } - } - function D8b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - for (o2 = new Anb(a); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 10); - E8b(n.n); - E8b(n.o); - F8b(n.f); - I8b(n); - K8b(n); - for (q = new Anb(n.j); q.a < q.c.c.length; ) { - p = RD(ynb(q), 12); - E8b(p.n); - E8b(p.a); - E8b(p.o); - Q3b(p, J8b(p.j)); - f2 = RD(mQb(p, (yCc(), CBc)), 17); - !!f2 && pQb(p, CBc, sgb(-f2.a)); - for (e = new Anb(p.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - for (c2 = Sub(d.a, 0); c2.b != c2.d.c; ) { - b = RD(evb(c2), 8); - E8b(b); - } - i2 = RD(mQb(d, RAc), 75); - if (i2) { - for (h = Sub(i2, 0); h.b != h.d.c; ) { - g = RD(evb(h), 8); - E8b(g); - } - } - for (l = new Anb(d.b); l.a < l.c.c.length; ) { - j = RD(ynb(l), 72); - E8b(j.n); - E8b(j.o); - } - } - for (m = new Anb(p.f); m.a < m.c.c.length; ) { - j = RD(ynb(m), 72); - E8b(j.n); - E8b(j.o); - } - } - if (n.k == (r3b(), m3b)) { - pQb(n, (Ywc(), hwc), J8b(RD(mQb(n, hwc), 64))); - H8b(n); - } - for (k = new Anb(n.b); k.a < k.c.c.length; ) { - j = RD(ynb(k), 72); - I8b(j); - E8b(j.o); - E8b(j.n); - } - } - } - function iEd(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G; - D5 = Wjb(a.e, d); - if (D5 == null) { - D5 = new uC(); - n = RD(D5, 190); - s = b + "_s"; - t = s + e; - m = new OC(t); - sC(n, uIe, m); - } - C = RD(D5, 190); - oDd(c2, C); - G = new uC(); - qDd(G, "x", d.j); - qDd(G, "y", d.k); - sC(C, xIe, G); - A = new uC(); - qDd(A, "x", d.b); - qDd(A, "y", d.c); - sC(C, "endPoint", A); - l = cve((!d.a && (d.a = new XZd(D4, d, 5)), d.a)); - o2 = !l; - if (o2) { - w2 = new MB(); - f2 = new qFd(w2); - xgb((!d.a && (d.a = new XZd(D4, d, 5)), d.a), f2); - sC(C, nIe, w2); - } - i2 = Dzd(d); - u = !!i2; - u && rDd(a.a, C, pIe, KDd(a, Dzd(d))); - r = Ezd(d); - v = !!r; - v && rDd(a.a, C, oIe, KDd(a, Ezd(d))); - j = (!d.e && (d.e = new Yie(F4, d, 10, 9)), d.e).i == 0; - p = !j; - if (p) { - B = new MB(); - g = new sFd(a, B); - xgb((!d.e && (d.e = new Yie(F4, d, 10, 9)), d.e), g); - sC(C, rIe, B); - } - k = (!d.g && (d.g = new Yie(F4, d, 9, 10)), d.g).i == 0; - q = !k; - if (q) { - F = new MB(); - h = new uFd(a, F); - xgb((!d.g && (d.g = new Yie(F4, d, 9, 10)), d.g), h); - sC(C, qIe, F); - } - } - function XMb(a) { - RMb(); - var b, c2, d, e, f2, g, h; - d = a.f.n; - for (g = ki(a.r).a.nc(); g.Ob(); ) { - f2 = RD(g.Pb(), 117); - e = 0; - if (f2.b.pf((umd(), Gld))) { - e = Kfb(UD(f2.b.of(Gld))); - if (e < 0) { - switch (f2.b.ag().g) { - case 1: - d.d = $wnd.Math.max(d.d, -e); - break; - case 3: - d.a = $wnd.Math.max(d.a, -e); - break; - case 2: - d.c = $wnd.Math.max(d.c, -e); - break; - case 4: - d.b = $wnd.Math.max(d.b, -e); - } - } - } - if (Rod(a.u)) { - b = rsd(f2.b, e); - h = !RD(a.e.of(pld), 181).Hc((dqd(), Wpd)); - c2 = false; - switch (f2.b.ag().g) { - case 1: - c2 = b > d.d; - d.d = $wnd.Math.max(d.d, b); - if (h && c2) { - d.d = $wnd.Math.max(d.d, d.a); - d.a = d.d + e; - } - break; - case 3: - c2 = b > d.a; - d.a = $wnd.Math.max(d.a, b); - if (h && c2) { - d.a = $wnd.Math.max(d.a, d.d); - d.d = d.a + e; - } - break; - case 2: - c2 = b > d.c; - d.c = $wnd.Math.max(d.c, b); - if (h && c2) { - d.c = $wnd.Math.max(d.b, d.c); - d.b = d.c + e; - } - break; - case 4: - c2 = b > d.b; - d.b = $wnd.Math.max(d.b, b); - if (h && c2) { - d.b = $wnd.Math.max(d.b, d.c); - d.c = d.b + e; - } - } - } - } - } - function pA(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - j = ""; - if (b.length == 0) { - return a.ne(ywe, wwe, -1, -1); - } - k = Dhb(b); - lhb(k.substr(0, 3), "at ") && (k = (BFb(3, k.length + 1), k.substr(3))); - k = k.replace(/\[.*?\]/g, ""); - g = k.indexOf("("); - if (g == -1) { - g = k.indexOf("@"); - if (g == -1) { - j = k; - k = ""; - } else { - j = Dhb((BFb(g + 1, k.length + 1), k.substr(g + 1))); - k = Dhb((AFb(0, g, k.length), k.substr(0, g))); - } - } else { - c2 = k.indexOf(")", g); - j = (AFb(g + 1, c2, k.length), k.substr(g + 1, c2 - (g + 1))); - k = Dhb((AFb(0, g, k.length), k.substr(0, g))); - } - g = qhb(k, Fhb(46)); - g != -1 && (k = (BFb(g + 1, k.length + 1), k.substr(g + 1))); - (k.length == 0 || lhb(k, "Anonymous function")) && (k = wwe); - h = thb(j, Fhb(58)); - e = uhb(j, Fhb(58), h - 1); - i2 = -1; - d = -1; - f2 = ywe; - if (h != -1 && e != -1) { - f2 = (AFb(0, e, j.length), j.substr(0, e)); - i2 = jA((AFb(e + 1, h, j.length), j.substr(e + 1, h - (e + 1)))); - d = jA((BFb(h + 1, j.length + 1), j.substr(h + 1))); - } - return a.ne(f2, k, i2, d); - } - function C6b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - for (j = new Anb(a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - g = RD(mQb(i2, (yCc(), UAc)), 171); - f2 = null; - switch (g.g) { - case 1: - case 2: - f2 = (huc(), guc); - break; - case 3: - case 4: - f2 = (huc(), euc); - } - if (f2) { - pQb(i2, (Ywc(), bwc), (huc(), guc)); - f2 == euc ? F6b(i2, g, (BEc(), yEc)) : f2 == guc && F6b(i2, g, (BEc(), zEc)); - } else { - if (Dod(RD(mQb(i2, BBc), 101)) && i2.j.c.length != 0) { - b = true; - for (l = new Anb(i2.j); l.a < l.c.c.length; ) { - k = RD(ynb(l), 12); - if (!(k.j == (qpd(), Xod) && k.e.c.length - k.g.c.length > 0 || k.j == ppd && k.e.c.length - k.g.c.length < 0)) { - b = false; - break; - } - for (e = new Anb(k.g); e.a < e.c.c.length; ) { - c2 = RD(ynb(e), 18); - h = RD(mQb(c2.d.i, UAc), 171); - if (h == (cxc(), _wc) || h == axc) { - b = false; - break; - } - } - for (d = new Anb(k.e); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - h = RD(mQb(c2.c.i, UAc), 171); - if (h == (cxc(), Zwc) || h == $wc) { - b = false; - break; - } - } - } - b && F6b(i2, g, (BEc(), AEc)); - } - } - } - } - function LNc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - w2 = 0; - n = 0; - for (l = new Anb(b.e); l.a < l.c.c.length; ) { - k = RD(ynb(l), 10); - m = 0; - h = 0; - i2 = c2 ? RD(mQb(k, HNc), 17).a : qwe; - r = d ? RD(mQb(k, INc), 17).a : qwe; - j = $wnd.Math.max(i2, r); - for (t = new Anb(k.j); t.a < t.c.c.length; ) { - s = RD(ynb(t), 12); - u = k.n.b + s.n.b + s.a.b; - if (d) { - for (g = new Anb(s.g); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 18); - p = f2.d; - o2 = p.i; - if (b != a.a[o2.p]) { - q = $wnd.Math.max(RD(mQb(o2, HNc), 17).a, RD(mQb(o2, INc), 17).a); - v = RD(mQb(f2, (yCc(), MBc)), 17).a; - if (v >= j && v >= q) { - m += o2.n.b + p.n.b + p.a.b - u; - ++h; - } - } - } - } - if (c2) { - for (g = new Anb(s.e); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 18); - p = f2.c; - o2 = p.i; - if (b != a.a[o2.p]) { - q = $wnd.Math.max(RD(mQb(o2, HNc), 17).a, RD(mQb(o2, INc), 17).a); - v = RD(mQb(f2, (yCc(), MBc)), 17).a; - if (v >= j && v >= q) { - m += o2.n.b + p.n.b + p.a.b - u; - ++h; - } - } - } - } - } - if (h > 0) { - w2 += m / h; - ++n; - } - } - if (n > 0) { - b.a = e * w2 / n; - b.g = n; - } else { - b.a = 0; - b.g = 0; - } - } - function hTb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A; - f2 = a.f.b; - m = f2.a; - k = f2.b; - o2 = a.e.g; - n = a.e.f; - zyd(a.e, f2.a, f2.b); - w2 = m / o2; - A = k / n; - for (j = new dMd(iyd(a.e)); j.e != j.i.gc(); ) { - i2 = RD(bMd(j), 135); - Dyd(i2, i2.i * w2); - Eyd(i2, i2.j * A); - } - for (s = new dMd(wCd(a.e)); s.e != s.i.gc(); ) { - r = RD(bMd(s), 123); - u = r.i; - v = r.j; - u > 0 && Dyd(r, u * w2); - v > 0 && Eyd(r, v * A); - } - Bvb(a.b, new tTb()); - b = new bnb(); - for (h = new vkb(new mkb(a.c).a); h.b; ) { - g = tkb(h); - d = RD(g.ld(), 74); - c2 = RD(g.md(), 407).a; - e = IGd(d, false, false); - l = fTb(JGd(d), ssd(e), c2); - lsd(l, e); - t = KGd(d); - if (!!t && Wmb(b, t, 0) == -1) { - ZEb(b.c, t); - gTb(t, (sFb(l.b != 0), RD(l.a.a.c, 8)), c2); - } - } - for (q = new vkb(new mkb(a.d).a); q.b; ) { - p = tkb(q); - d = RD(p.ld(), 74); - c2 = RD(p.md(), 407).a; - e = IGd(d, false, false); - l = fTb(LGd(d), Ijd(ssd(e)), c2); - l = Ijd(l); - lsd(l, e); - t = MGd(d); - if (!!t && Wmb(b, t, 0) == -1) { - ZEb(b.c, t); - gTb(t, (sFb(l.b != 0), RD(l.c.b.c, 8)), c2); - } - } - } - function GJb(a, b, c2, d) { - var e, f2, g, h, i2; - h = new CLb(b); - iNb(h, d); - e = true; - if (!!a && a.pf((umd(), Nkd))) { - f2 = RD(a.of((umd(), Nkd)), 88); - e = f2 == (Cmd(), Amd) || f2 == ymd || f2 == zmd; - } - $Mb(h, false); - Umb(h.e.Rf(), new dNb(h, false, e)); - EMb(h, h.f, (ZJb(), WJb), (qpd(), Yod)); - EMb(h, h.f, YJb, npd); - EMb(h, h.g, WJb, ppd); - EMb(h, h.g, YJb, Xod); - GMb(h, Yod); - GMb(h, npd); - FMb(h, Xod); - FMb(h, ppd); - RMb(); - g = h.A.Hc((Qpd(), Mpd)) && h.B.Hc((dqd(), $pd)) ? SMb(h) : null; - !!g && uKb(h.a, g); - XMb(h); - xMb(h); - GNb(h); - sMb(h); - gNb(h); - yNb(h); - oNb(h, Yod); - oNb(h, npd); - tMb(h); - fNb(h); - if (!c2) { - return h.o; - } - VMb(h); - CNb(h); - oNb(h, Xod); - oNb(h, ppd); - i2 = h.B.Hc((dqd(), _pd)); - IMb(h, i2, Yod); - IMb(h, i2, npd); - JMb(h, i2, Xod); - JMb(h, i2, ppd); - FDb(new SDb(null, new Swb(new glb(h.i), 0)), new KMb()); - FDb(CDb(new SDb(null, ki(h.r).a.oc()), new MMb()), new OMb()); - WMb(h); - h.e.Pf(h.o); - FDb(new SDb(null, ki(h.r).a.oc()), new YMb()); - return h.o; - } - function LYb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - j = oxe; - for (d = new Anb(a.a.b); d.a < d.c.c.length; ) { - b = RD(ynb(d), 86); - j = $wnd.Math.min(j, b.d.f.g.c + b.e.a); - } - n = new Yub(); - for (g = new Anb(a.a.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 194); - f2.i = j; - f2.e == 0 && (Pub(n, f2, n.c.b, n.c), true); - } - while (n.b != 0) { - f2 = RD(n.b == 0 ? null : (sFb(n.b != 0), Wub(n, n.a.a)), 194); - e = f2.f.g.c; - for (m = f2.a.a.ec().Kc(); m.Ob(); ) { - k = RD(m.Pb(), 86); - p = f2.i + k.e.a; - k.d.g || k.g.c < p ? k.o = p : k.o = k.g.c; - } - e -= f2.f.o; - f2.b += e; - a.c == (Cmd(), zmd) || a.c == xmd ? f2.c += e : f2.c -= e; - for (l = f2.a.a.ec().Kc(); l.Ob(); ) { - k = RD(l.Pb(), 86); - for (i2 = k.f.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 86); - Dmd(a.c) ? o2 = a.f.yf(k, h) : o2 = a.f.zf(k, h); - h.d.i = $wnd.Math.max(h.d.i, k.o + k.g.b + o2 - h.e.a); - h.k || (h.d.i = $wnd.Math.max(h.d.i, h.g.c - h.e.a)); - --h.d.e; - h.d.e == 0 && Mub(n, h.d); - } - } - } - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 86); - b.g.c = b.o; - } - } - function vOb(a) { - var b, c2, d, e, f2, g, h, i2; - h = a.b; - b = a.a; - switch (RD(mQb(a, (YHb(), UHb)), 435).g) { - case 0: - _mb(h, new Frb(new UOb())); - break; - case 1: - default: - _mb(h, new Frb(new ZOb())); - } - switch (RD(mQb(a, SHb), 436).g) { - case 1: - _mb(h, new POb()); - _mb(h, new cPb()); - _mb(h, new xOb()); - break; - case 0: - default: - _mb(h, new POb()); - _mb(h, new IOb()); - } - switch (RD(mQb(a, WHb), 257).g) { - case 0: - i2 = new wPb(); - break; - case 1: - i2 = new qPb(); - break; - case 2: - i2 = new tPb(); - break; - case 3: - i2 = new nPb(); - break; - case 5: - i2 = new APb(new tPb()); - break; - case 4: - i2 = new APb(new qPb()); - break; - case 7: - i2 = new kPb(new APb(new qPb()), new APb(new tPb())); - break; - case 8: - i2 = new kPb(new APb(new nPb()), new APb(new tPb())); - break; - case 6: - default: - i2 = new APb(new nPb()); - } - for (g = new Anb(h); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 176); - d = 0; - e = 0; - c2 = new Ptd(sgb(d), sgb(e)); - while (ZPb(b, f2, d, e)) { - c2 = RD(i2.Ve(c2, f2), 42); - d = RD(c2.a, 17).a; - e = RD(c2.b, 17).a; - } - WPb(b, f2, d, e); - } - } - function T_c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - c2.Ug(_Ee, 1); - m = (q$c(), XZc); - a.a == (s_c(), p_c) && (m = VZc); - k = 0; - yob(); - b.jd(new uGd(m)); - f2 = b.gc(); - h = b.fd(b.gc()); - j = true; - while (j && h.Sb()) { - s = RD(h.Ub(), 40); - RD(mQb(s, m), 17).a == 0 ? --f2 : j = false; - } - w2 = b.kd(0, f2); - g = new Zub(w2); - w2 = b.kd(f2, b.gc()); - i2 = new Zub(w2); - if (g.b == 0) { - for (p = Sub(i2, 0); p.b != p.d.c; ) { - o2 = RD(evb(p), 40); - pQb(o2, i$c, sgb(k++)); - } - } else { - l = g.b; - for (v = Sub(g, 0); v.b != v.d.c; ) { - u = RD(evb(v), 40); - pQb(u, i$c, sgb(k++)); - d = $Wc(u); - T_c(a, d, c2.eh(1 / l | 0)); - tvb(d, Fob(new uGd(i$c))); - n = new Yub(); - for (t = Sub(d, 0); t.b != t.d.c; ) { - s = RD(evb(t), 40); - for (r = Sub(u.d, 0); r.b != r.d.c; ) { - q = RD(evb(r), 65); - q.c == s && (Pub(n, q, n.c.b, n.c), true); - } - } - Xub(u.d); - ye(u.d, n); - h = Sub(i2, i2.b); - e = u.d.b; - j = true; - while (0 < e && j && h.Sb()) { - s = RD(h.Ub(), 40); - if (RD(mQb(s, m), 17).a == 0) { - pQb(s, i$c, sgb(k++)); - --e; - h.Qb(); - } else { - j = false; - } - } - } - } - c2.Vg(); - } - function S3c(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - l = Kfb(UD(Gxd(a, ($4c(), W4c)))); - if (Heb(TD(Gxd(a, U4c)))) { - k = RD(Gxd(a, (u2c(), t2c)), 27); - f2 = RD(QHd(mzd(RD(QHd((!k.e && (k.e = new Yie(G4, k, 7, 4)), k.e), (!k.e && (k.e = new Yie(G4, k, 7, 4)), k.e).i - 1), 74)), 0), 27); - d = RD(QHd(mzd(RD(QHd((!k.e && (k.e = new Yie(G4, k, 7, 4)), k.e), 0), 74)), 0), 27); - g = new rjd(f2.i + f2.g / 2, f2.j + f2.f / 2); - e = new rjd(d.i + d.g / 2, d.j + d.f / 2); - c2 = l; - c2 <= 0 && (c2 += dFe); - m = $wnd.Math.acos((g.a * e.a + g.b * e.b) / ($wnd.Math.sqrt(g.a * g.a + g.b * g.b) * $wnd.Math.sqrt(e.a * e.a + e.b * e.b))); - m <= 0 && (m += dFe); - b = $wnd.Math.atan2(g.b, g.a); - b <= 0 && (b += dFe); - l = FEe - (b - c2 + m / 2); - } - for (i2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 27); - j = new rjd(h.i + h.g / 2, h.j + h.f / 2); - n = j.a * $wnd.Math.cos(l) - j.b * $wnd.Math.sin(l); - j.b = j.a * $wnd.Math.sin(l) + j.b * $wnd.Math.cos(l); - j.a = n; - Byd(h, j.a - h.g / 2, j.b - h.f / 2); - } - } - function qcc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - b.Ug("Inverted port preprocessing", 1); - k = a.b; - j = new Jkb(k, 0); - c2 = null; - t = new bnb(); - while (j.b < j.d.gc()) { - s = c2; - c2 = (sFb(j.b < j.d.gc()), RD(j.d.Xb(j.c = j.b++), 30)); - for (n = new Anb(t); n.a < n.c.c.length; ) { - l = RD(ynb(n), 10); - g3b(l, s); - } - t.c.length = 0; - for (o2 = new Anb(c2.a); o2.a < o2.c.c.length; ) { - l = RD(ynb(o2), 10); - if (l.k != (r3b(), p3b)) { - continue; - } - if (!Dod(RD(mQb(l, (yCc(), BBc)), 101))) { - continue; - } - for (r = d3b(l, (BEc(), yEc), (qpd(), Xod)).Kc(); r.Ob(); ) { - p = RD(r.Pb(), 12); - i2 = p.e; - h = RD(anb(i2, $C(WQ, VAe, 18, i2.c.length, 0, 1)), 483); - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - occ(a, p, d, t); - } - } - for (q = d3b(l, zEc, ppd).Kc(); q.Ob(); ) { - p = RD(q.Pb(), 12); - i2 = p.g; - h = RD(anb(i2, $C(WQ, VAe, 18, i2.c.length, 0, 1)), 483); - for (e = h, f2 = 0, g = e.length; f2 < g; ++f2) { - d = e[f2]; - pcc(a, p, d, t); - } - } - } - } - for (m = new Anb(t); m.a < m.c.c.length; ) { - l = RD(ynb(m), 10); - g3b(l, c2); - } - b.Vg(); - } - function NUc(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l, m, n, o2, p, q, r, s, t; - m = null; - d == (dVc(), bVc) ? m = b : d == cVc && (m = c2); - for (p = m.a.ec().Kc(); p.Ob(); ) { - o2 = RD(p.Pb(), 12); - q = xjd(cD(WC(l3, 1), Nve, 8, 0, [o2.i.n, o2.n, o2.a])).b; - t = new _sb(); - h = new _sb(); - for (j = new l4b(o2.b); xnb(j.a) || xnb(j.b); ) { - i2 = RD(xnb(j.a) ? ynb(j.a) : ynb(j.b), 18); - if (Heb(TD(mQb(i2, (Ywc(), Nwc)))) != e) { - continue; - } - if (Wmb(f2, i2, 0) != -1) { - i2.d == o2 ? r = i2.c : r = i2.d; - s = xjd(cD(WC(l3, 1), Nve, 8, 0, [r.i.n, r.n, r.a])).b; - if ($wnd.Math.abs(s - q) < 0.2) { - continue; - } - s < q ? b.a._b(r) ? Ysb(t, new Ptd(bVc, i2)) : Ysb(t, new Ptd(cVc, i2)) : b.a._b(r) ? Ysb(h, new Ptd(bVc, i2)) : Ysb(h, new Ptd(cVc, i2)); - } - } - if (t.a.gc() > 1) { - n = new xVc(o2, t, d); - xgb(t, new nVc(a, n)); - ZEb(g.c, n); - for (l = t.a.ec().Kc(); l.Ob(); ) { - k = RD(l.Pb(), 42); - Ymb(f2, k.b); - } - } - if (h.a.gc() > 1) { - n = new xVc(o2, h, d); - xgb(h, new pVc(a, n)); - ZEb(g.c, n); - for (l = h.a.ec().Kc(); l.Ob(); ) { - k = RD(l.Pb(), 42); - Ymb(f2, k.b); - } - } - } - } - function p6b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - p = a.n; - q = a.o; - m = a.d; - l = Kfb(UD(hFc(a, (yCc(), QBc)))); - if (b) { - k = l * (b.gc() - 1); - n = 0; - for (i2 = b.Kc(); i2.Ob(); ) { - g = RD(i2.Pb(), 10); - k += g.o.a; - n = $wnd.Math.max(n, g.o.b); - } - r = p.a - (k - q.a) / 2; - f2 = p.b - m.d + n; - d = q.a / (b.gc() + 1); - e = d; - for (h = b.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 10); - g.n.a = r; - g.n.b = f2 - g.o.b; - r += g.o.a + l; - j = n6b(g); - j.n.a = g.o.a / 2 - j.a.a; - j.n.b = g.o.b; - o2 = RD(mQb(g, (Ywc(), Xvc)), 12); - if (o2.e.c.length + o2.g.c.length == 1) { - o2.n.a = e - o2.a.a; - o2.n.b = 0; - P3b(o2, a); - } - e += d; - } - } - if (c2) { - k = l * (c2.gc() - 1); - n = 0; - for (i2 = c2.Kc(); i2.Ob(); ) { - g = RD(i2.Pb(), 10); - k += g.o.a; - n = $wnd.Math.max(n, g.o.b); - } - r = p.a - (k - q.a) / 2; - f2 = p.b + q.b + m.a - n; - d = q.a / (c2.gc() + 1); - e = d; - for (h = c2.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 10); - g.n.a = r; - g.n.b = f2; - r += g.o.a + l; - j = n6b(g); - j.n.a = g.o.a / 2 - j.a.a; - j.n.b = 0; - o2 = RD(mQb(g, (Ywc(), Xvc)), 12); - if (o2.e.c.length + o2.g.c.length == 1) { - o2.n.a = e - o2.a.a; - o2.n.b = q.b; - P3b(o2, a); - } - e += d; - } - } - } - function Hac(a, b) { - var c2, d, e, f2, g, h; - if (!RD(mQb(b, (Ywc(), kwc)), 21).Hc((ovc(), hvc))) { - return; - } - for (h = new Anb(b.a); h.a < h.c.c.length; ) { - f2 = RD(ynb(h), 10); - if (f2.k == (r3b(), p3b)) { - e = RD(mQb(f2, (yCc(), _Ac)), 140); - a.c = $wnd.Math.min(a.c, f2.n.a - e.b); - a.a = $wnd.Math.max(a.a, f2.n.a + f2.o.a + e.c); - a.d = $wnd.Math.min(a.d, f2.n.b - e.d); - a.b = $wnd.Math.max(a.b, f2.n.b + f2.o.b + e.a); - } - } - for (g = new Anb(b.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - if (f2.k != (r3b(), p3b)) { - switch (f2.k.g) { - case 2: - d = RD(mQb(f2, (yCc(), UAc)), 171); - if (d == (cxc(), $wc)) { - f2.n.a = a.c - 10; - Gac(f2, new Oac()).Jb(new Rac(f2)); - break; - } - if (d == axc) { - f2.n.a = a.a + 10; - Gac(f2, new Uac()).Jb(new Xac(f2)); - break; - } - c2 = RD(mQb(f2, owc), 311); - if (c2 == (Gvc(), Fvc)) { - Fac(f2).Jb(new $ac(f2)); - f2.n.b = a.d - 10; - break; - } - if (c2 == Dvc) { - Fac(f2).Jb(new bbc(f2)); - f2.n.b = a.b + 10; - break; - } - break; - default: - throw Adb(new agb("The node type " + f2.k + " is not supported by the " + XS)); - } - } - } - } - function g5b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - i2 = new rjd(d.i + d.g / 2, d.j + d.f / 2); - n = W4b(d); - o2 = RD(Gxd(b, (yCc(), BBc)), 101); - q = RD(Gxd(d, GBc), 64); - if (!HPd(Fxd(d), ABc)) { - d.i == 0 && d.j == 0 ? p = 0 : p = nsd(d, q); - Ixd(d, ABc, p); - } - j = new rjd(b.g, b.f); - e = f2b(d, o2, q, n, j, i2, new rjd(d.g, d.f), RD(mQb(c2, rAc), 88), c2); - pQb(e, (Ywc(), Awc), d); - f2 = RD(Vmb(e.j, 0), 12); - O3b(f2, e5b(d)); - pQb(e, EBc, (Pod(), xsb(Nod))); - l = RD(Gxd(b, EBc), 181).Hc(Lod); - for (h = new dMd((!d.n && (d.n = new C5d(I4, d, 1, 7)), d.n)); h.e != h.i.gc(); ) { - g = RD(bMd(h), 135); - if (!Heb(TD(Gxd(g, pBc))) && !!g.a) { - m = h5b(g); - Rmb(f2.f, m); - if (!l) { - k = 0; - Rod(RD(Gxd(b, EBc), 21)) && (k = qsd(new rjd(g.i, g.j), new rjd(g.g, g.f), new rjd(d.g, d.f), 0, q)); - switch (q.g) { - case 2: - case 4: - m.o.a = k; - break; - case 1: - case 3: - m.o.b = k; - } - } - } - } - pQb(e, _Bc, UD(Gxd(vCd(b), _Bc))); - pQb(e, aCc, UD(Gxd(vCd(b), aCc))); - pQb(e, ZBc, UD(Gxd(vCd(b), ZBc))); - Rmb(c2.a, e); - Zjb(a.a, d, e); - } - function j5b(a, b, c2, d, e, f2) { - var g, h, i2, j, k, l; - j = new R3b(); - kQb(j, b); - Q3b(j, RD(Gxd(b, (yCc(), GBc)), 64)); - pQb(j, (Ywc(), Awc), b); - P3b(j, c2); - l = j.o; - l.a = b.g; - l.b = b.f; - k = j.n; - k.a = b.i; - k.b = b.j; - Zjb(a.a, b, j); - g = yDb(GDb(EDb(new SDb(null, (!b.e && (b.e = new Yie(G4, b, 7, 4)), new Swb(b.e, 16))), new w5b()), new o5b()), new y5b(b)); - g || (g = yDb(GDb(EDb(new SDb(null, (!b.d && (b.d = new Yie(G4, b, 8, 5)), new Swb(b.d, 16))), new A5b()), new q5b()), new C5b(b))); - g || (g = yDb(new SDb(null, (!b.e && (b.e = new Yie(G4, b, 7, 4)), new Swb(b.e, 16))), new E5b())); - pQb(j, nwc, (Geb(), g ? true : false)); - m2b(j, f2, e, RD(Gxd(b, zBc), 8)); - for (i2 = new dMd((!b.n && (b.n = new C5d(I4, b, 1, 7)), b.n)); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 135); - !Heb(TD(Gxd(h, pBc))) && !!h.a && Rmb(j.f, h5b(h)); - } - switch (e.g) { - case 2: - case 1: - (j.j == (qpd(), Yod) || j.j == npd) && d.Fc((ovc(), lvc)); - break; - case 4: - case 3: - (j.j == (qpd(), Xod) || j.j == ppd) && d.Fc((ovc(), lvc)); - } - return j; - } - function dud(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - t = 0; - o2 = 0; - n = 0; - m = 1; - for (s = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); s.e != s.i.gc(); ) { - q = RD(bMd(s), 27); - m += Kr(new is(Mr(zGd(q).a.Kc(), new ir()))); - B = q.g; - o2 = $wnd.Math.max(o2, B); - l = q.f; - n = $wnd.Math.max(n, l); - t += B * l; - } - p = (!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a).i; - g = t + 2 * d * d * m * p; - f2 = $wnd.Math.sqrt(g); - i2 = $wnd.Math.max(f2 * c2, o2); - h = $wnd.Math.max(f2 / c2, n); - for (r = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); r.e != r.i.gc(); ) { - q = RD(bMd(r), 27); - C = e.b + (Kwb(b, 26) * Kxe + Kwb(b, 27) * Lxe) * (i2 - q.g); - D5 = e.b + (Kwb(b, 26) * Kxe + Kwb(b, 27) * Lxe) * (h - q.f); - Dyd(q, C); - Eyd(q, D5); - } - A = i2 + (e.b + e.c); - w2 = h + (e.d + e.a); - for (v = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); v.e != v.i.gc(); ) { - u = RD(bMd(v), 27); - for (k = new is(Mr(zGd(u).a.Kc(), new ir())); gs(k); ) { - j = RD(hs(k), 74); - nzd(j) || cud(j, b, A, w2); - } - } - A += e.b + e.c; - w2 += e.d + e.a; - Esd(a, A, w2, false, true); - } - function CLb(a) { - var b; - this.r = Ty(new FLb(), new JLb()); - this.b = new Zrb(RD(Qb(E3), 297)); - this.p = new Zrb(RD(Qb(E3), 297)); - this.i = new Zrb(RD(Qb(XN), 297)); - this.e = a; - this.o = new sjd(a.Mf()); - this.D = a.Yf() || Heb(TD(a.of((umd(), $kd)))); - this.A = RD(a.of((umd(), kld)), 21); - this.B = RD(a.of(pld), 21); - this.q = RD(a.of(Hld), 101); - this.u = RD(a.of(Lld), 21); - if (!Sod(this.u)) { - throw Adb(new Jed("Invalid port label placement: " + this.u)); - } - this.v = Heb(TD(a.of(Nld))); - this.j = RD(a.of(ild), 21); - if (!fod(this.j)) { - throw Adb(new Jed("Invalid node label placement: " + this.j)); - } - this.n = RD(ftd(a, gld), 107); - this.k = Kfb(UD(ftd(a, cmd))); - this.d = Kfb(UD(ftd(a, bmd))); - this.w = Kfb(UD(ftd(a, jmd))); - this.s = Kfb(UD(ftd(a, dmd))); - this.t = Kfb(UD(ftd(a, emd))); - this.C = RD(ftd(a, hmd), 140); - this.c = 2 * this.d; - b = !this.B.Hc((dqd(), Wpd)); - this.f = new dLb(0, b, 0); - this.g = new dLb(1, b, 0); - cLb(this.f, (ZJb(), XJb), this.g); - } - function s6b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - b.Ug("Comment pre-processing", 1); - c2 = 0; - i2 = new Anb(a.a); - while (i2.a < i2.c.c.length) { - h = RD(ynb(i2), 10); - if (Heb(TD(mQb(h, (yCc(), Uzc))))) { - ++c2; - e = 0; - d = null; - j = null; - for (o2 = new Anb(h.j); o2.a < o2.c.c.length; ) { - m = RD(ynb(o2), 12); - e += m.e.c.length + m.g.c.length; - if (m.e.c.length == 1) { - d = RD(Vmb(m.e, 0), 18); - j = d.c; - } - if (m.g.c.length == 1) { - d = RD(Vmb(m.g, 0), 18); - j = d.d; - } - } - if (e == 1 && j.e.c.length + j.g.c.length == 1 && !Heb(TD(mQb(j.i, Uzc)))) { - t6b(h, d, j, j.i); - znb(i2); - } else { - r = new bnb(); - for (n = new Anb(h.j); n.a < n.c.c.length; ) { - m = RD(ynb(n), 12); - for (l = new Anb(m.g); l.a < l.c.c.length; ) { - k = RD(ynb(l), 18); - k.d.g.c.length == 0 || (ZEb(r.c, k), true); - } - for (g = new Anb(m.e); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 18); - f2.c.e.c.length == 0 || (ZEb(r.c, f2), true); - } - } - for (q = new Anb(r); q.a < q.c.c.length; ) { - p = RD(ynb(q), 18); - X0b(p, true); - } - } - } - } - b._g() && b.bh("Found " + c2 + " comment boxes"); - b.Vg(); - } - function wke(a, b) { - uke(); - var c2, d, e, f2, g, h, i2; - this.a = new zke(this); - this.b = a; - this.c = b; - this.f = Cfe(Qee((lke(), jke), b)); - if (this.f.dc()) { - if ((h = Tee(jke, a)) == b) { - this.e = true; - this.d = new bnb(); - this.f = new OSd(); - this.f.Fc(dLe); - RD(tfe(Pee(jke, BXd(a)), ""), 29) == a && this.f.Fc(Uee(jke, BXd(a))); - for (e = Gee(jke, a).Kc(); e.Ob(); ) { - d = RD(e.Pb(), 179); - switch (yfe(Qee(jke, d))) { - case 4: { - this.d.Fc(d); - break; - } - case 5: { - this.f.Gc(Cfe(Qee(jke, d))); - break; - } - } - } - } else { - nke(); - if (RD(b, 69).xk()) { - this.e = true; - this.f = null; - this.d = new bnb(); - for (g = 0, i2 = (a.i == null && rYd(a), a.i).length; g < i2; ++g) { - d = (c2 = (a.i == null && rYd(a), a.i), g >= 0 && g < c2.length ? c2[g] : null); - for (f2 = zfe(Qee(jke, d)); f2; f2 = zfe(Qee(jke, f2))) { - f2 == b && this.d.Fc(d); - } - } - } else if (yfe(Qee(jke, b)) == 1 && !!h) { - this.f = null; - this.d = (Lle(), Kle); - } else { - this.f = null; - this.e = true; - this.d = (yob(), new mpb(b)); - } - } - } else { - this.e = yfe(Qee(jke, b)) == 5; - this.f.Fb(tke) && (this.f = tke); - } - } - function qNb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - c2 = 0; - d = pNb(a, b); - m = a.s; - n = a.t; - for (j = RD(RD(Qc(a.r, b), 21), 87).Kc(); j.Ob(); ) { - i2 = RD(j.Pb(), 117); - if (!i2.c || i2.c.d.c.length <= 0) { - continue; - } - o2 = i2.b.Mf(); - h = i2.b.pf((umd(), Gld)) ? Kfb(UD(i2.b.of(Gld))) : 0; - k = i2.c; - l = k.i; - l.b = (g = k.n, k.e.a + g.b + g.c); - l.a = (f2 = k.n, k.e.b + f2.d + f2.a); - switch (b.g) { - case 1: - l.c = i2.a ? (o2.a - l.b) / 2 : o2.a + m; - l.d = o2.b + h + d; - RKb(k, (EKb(), BKb)); - SKb(k, (vLb(), uLb)); - break; - case 3: - l.c = i2.a ? (o2.a - l.b) / 2 : o2.a + m; - l.d = -h - d - l.a; - RKb(k, (EKb(), BKb)); - SKb(k, (vLb(), sLb)); - break; - case 2: - l.c = -h - d - l.b; - if (i2.a) { - e = a.v ? l.a : RD(Vmb(k.d, 0), 187).Mf().b; - l.d = (o2.b - e) / 2; - } else { - l.d = o2.b + n; - } - RKb(k, (EKb(), DKb)); - SKb(k, (vLb(), tLb)); - break; - case 4: - l.c = o2.a + h + d; - if (i2.a) { - e = a.v ? l.a : RD(Vmb(k.d, 0), 187).Mf().b; - l.d = (o2.b - e) / 2; - } else { - l.d = o2.b + n; - } - RKb(k, (EKb(), CKb)); - SKb(k, (vLb(), tLb)); - } - (b == (qpd(), Yod) || b == npd) && (c2 = $wnd.Math.max(c2, l.a)); - } - c2 > 0 && (RD(Vrb(a.b, b), 127).a.b = c2); - } - function wcc(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p; - m = Kfb(UD(mQb(a, (yCc(), _Bc)))); - n = Kfb(UD(mQb(a, aCc))); - l = Kfb(UD(mQb(a, ZBc))); - h = a.o; - f2 = RD(Vmb(a.j, 0), 12); - g = f2.n; - p = ucc(f2, l); - if (!p) { - return; - } - if (b.Hc((Pod(), Lod))) { - switch (RD(mQb(a, (Ywc(), hwc)), 64).g) { - case 1: - p.c = (h.a - p.b) / 2 - g.a; - p.d = n; - break; - case 3: - p.c = (h.a - p.b) / 2 - g.a; - p.d = -n - p.a; - break; - case 2: - if (c2 && f2.e.c.length == 0 && f2.g.c.length == 0) { - k = d ? p.a : RD(Vmb(f2.f, 0), 72).o.b; - p.d = (h.b - k) / 2 - g.b; - } else { - p.d = h.b + n - g.b; - } - p.c = -m - p.b; - break; - case 4: - if (c2 && f2.e.c.length == 0 && f2.g.c.length == 0) { - k = d ? p.a : RD(Vmb(f2.f, 0), 72).o.b; - p.d = (h.b - k) / 2 - g.b; - } else { - p.d = h.b + n - g.b; - } - p.c = m; - } - } else if (b.Hc(Nod)) { - switch (RD(mQb(a, (Ywc(), hwc)), 64).g) { - case 1: - case 3: - p.c = g.a + m; - break; - case 2: - case 4: - if (c2 && !f2.c) { - k = d ? p.a : RD(Vmb(f2.f, 0), 72).o.b; - p.d = (h.b - k) / 2 - g.b; - } else { - p.d = g.b + n; - } - } - } - e = p.d; - for (j = new Anb(f2.f); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 72); - o2 = i2.n; - o2.a = p.c; - o2.b = e; - e += i2.o.b + l; - } - } - function w9b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F; - w2 = new bnb(); - for (o2 = new Anb(a.b); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 30); - for (r = new Anb(n.a); r.a < r.c.c.length; ) { - p = RD(ynb(r), 10); - if (p.k != (r3b(), m3b)) { - continue; - } - if (!nQb(p, (Ywc(), gwc))) { - continue; - } - s = null; - u = null; - t = null; - for (C = new Anb(p.j); C.a < C.c.c.length; ) { - B = RD(ynb(C), 12); - switch (B.j.g) { - case 4: - s = B; - break; - case 2: - u = B; - break; - default: - t = B; - } - } - v = RD(Vmb(t.g, 0), 18); - k = new Fjd(v.a); - j = new sjd(t.n); - $id(j, p.n); - l = Sub(k, 0); - cvb(l, j); - A = Ijd(v.a); - m = new sjd(t.n); - $id(m, p.n); - Pub(A, m, A.c.b, A.c); - D5 = RD(mQb(p, gwc), 10); - F = RD(Vmb(D5.j, 0), 12); - i2 = RD(anb(s.e, $C(WQ, VAe, 18, 0, 0, 1)), 483); - for (d = i2, f2 = 0, h = d.length; f2 < h; ++f2) { - b = d[f2]; - Z0b(b, F); - Ajd(b.a, b.a.b, k); - } - i2 = s2b(u.g); - for (c2 = i2, e = 0, g = c2.length; e < g; ++e) { - b = c2[e]; - Y0b(b, F); - Ajd(b.a, 0, A); - } - Y0b(v, null); - Z0b(v, null); - ZEb(w2.c, p); - } - } - for (q = new Anb(w2); q.a < q.c.c.length; ) { - p = RD(ynb(q), 10); - g3b(p, null); - } - } - function Dne() { - RRd(Vbb, new ioe()); - RRd(Xbb, new Poe()); - RRd(Ybb, new upe()); - RRd(Zbb, new _pe()); - RRd(qJ, new lqe()); - RRd(WC(gE, 1), new oqe()); - RRd(QI, new rqe()); - RRd(RI, new uqe()); - RRd(qJ, new Gne()); - RRd(qJ, new Jne()); - RRd(qJ, new Mne()); - RRd(VI, new Pne()); - RRd(qJ, new Sne()); - RRd(QK, new Vne()); - RRd(QK, new Yne()); - RRd(qJ, new _ne()); - RRd(ZI, new coe()); - RRd(qJ, new foe()); - RRd(qJ, new loe()); - RRd(qJ, new ooe()); - RRd(qJ, new roe()); - RRd(qJ, new uoe()); - RRd(WC(gE, 1), new xoe()); - RRd(qJ, new Aoe()); - RRd(qJ, new Doe()); - RRd(QK, new Goe()); - RRd(QK, new Joe()); - RRd(qJ, new Moe()); - RRd(bJ, new Soe()); - RRd(qJ, new Voe()); - RRd(eJ, new Yoe()); - RRd(qJ, new _oe()); - RRd(qJ, new cpe()); - RRd(qJ, new fpe()); - RRd(qJ, new ipe()); - RRd(QK, new lpe()); - RRd(QK, new ope()); - RRd(qJ, new rpe()); - RRd(qJ, new xpe()); - RRd(qJ, new Ape()); - RRd(qJ, new Dpe()); - RRd(qJ, new Gpe()); - RRd(qJ, new Jpe()); - RRd(lJ, new Mpe()); - RRd(qJ, new Ppe()); - RRd(qJ, new Spe()); - RRd(qJ, new Vpe()); - RRd(lJ, new Ype()); - RRd(eJ, new cqe()); - RRd(qJ, new fqe()); - RRd(bJ, new iqe()); - } - function jsc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - k = new Ejd(); - switch (a.a.g) { - case 3: - m = RD(mQb(b.e, (Ywc(), Twc)), 15); - n = RD(mQb(b.j, Twc), 15); - o2 = RD(mQb(b.f, Twc), 15); - c2 = RD(mQb(b.e, Rwc), 15); - d = RD(mQb(b.j, Rwc), 15); - e = RD(mQb(b.f, Rwc), 15); - g = new bnb(); - Tmb(g, m); - n.Jc(new msc()); - Tmb(g, hv(n)); - Tmb(g, o2); - f2 = new bnb(); - Tmb(f2, c2); - Tmb(f2, hv(d)); - Tmb(f2, e); - pQb(b.f, Twc, g); - pQb(b.f, Rwc, f2); - pQb(b.f, Uwc, b.f); - pQb(b.e, Twc, null); - pQb(b.e, Rwc, null); - pQb(b.j, Twc, null); - pQb(b.j, Rwc, null); - break; - case 1: - ye(k, b.e.a); - Mub(k, b.i.n); - ye(k, hv(b.j.a)); - Mub(k, b.a.n); - ye(k, b.f.a); - break; - default: - ye(k, b.e.a); - ye(k, hv(b.j.a)); - ye(k, b.f.a); - } - Xub(b.f.a); - ye(b.f.a, k); - Y0b(b.f, b.e.c); - h = RD(mQb(b.e, (yCc(), RAc)), 75); - j = RD(mQb(b.j, RAc), 75); - i2 = RD(mQb(b.f, RAc), 75); - if (!!h || !!j || !!i2) { - l = new Ejd(); - hsc(l, i2); - hsc(l, j); - hsc(l, h); - pQb(b.f, RAc, l); - } - Y0b(b.j, null); - Z0b(b.j, null); - Y0b(b.e, null); - Z0b(b.e, null); - g3b(b.a, null); - g3b(b.i, null); - !!b.g && jsc(a, b.g); - } - function tib() { - tib = geb; - var a, b, c2; - new Aib(1, 0); - new Aib(10, 0); - new Aib(0, 0); - lib = $C(tJ, Nve, 247, 11, 0, 1); - mib = $C(hE, zwe, 28, 100, 15, 1); - nib = cD(WC(iE, 1), vxe, 28, 15, [1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125, 6103515625, 30517578125, 152587890625, 762939453125, 3814697265625, 19073486328125, 95367431640625, 476837158203125, 2384185791015625]); - oib = $C(kE, Pwe, 28, nib.length, 15, 1); - pib = cD(WC(iE, 1), vxe, 28, 15, [1, 10, 100, Awe, 1e4, wxe, 1e6, 1e7, 1e8, ixe, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16]); - qib = $C(kE, Pwe, 28, pib.length, 15, 1); - rib = $C(tJ, Nve, 247, 11, 0, 1); - a = 0; - for (; a < rib.length; a++) { - lib[a] = new Aib(a, 0); - rib[a] = new Aib(0, a); - mib[a] = 48; - } - for (; a < mib.length; a++) { - mib[a] = 48; - } - for (c2 = 0; c2 < oib.length; c2++) { - oib[c2] = Cib(nib[c2]); - } - for (b = 0; b < qib.length; b++) { - qib[b] = Cib(pib[b]); - } - Ljb(); - } - function Htb() { - function e() { - this.obj = this.createObject(); - } - e.prototype.createObject = function(a) { - return /* @__PURE__ */ Object.create(null); - }; - e.prototype.get = function(a) { - return this.obj[a]; - }; - e.prototype.set = function(a, b) { - this.obj[a] = b; - }; - e.prototype[Jxe] = function(a) { - delete this.obj[a]; - }; - e.prototype.keys = function() { - return Object.getOwnPropertyNames(this.obj); - }; - e.prototype.entries = function() { - var b = this.keys(); - var c2 = this; - var d = 0; - return { next: function() { - if (d >= b.length) - return { done: true }; - var a = b[d++]; - return { value: [a, c2.get(a)], done: false }; - } }; - }; - if (!Ftb()) { - e.prototype.createObject = function() { - return {}; - }; - e.prototype.get = function(a) { - return this.obj[":" + a]; - }; - e.prototype.set = function(a, b) { - this.obj[":" + a] = b; - }; - e.prototype[Jxe] = function(a) { - delete this.obj[":" + a]; - }; - e.prototype.keys = function() { - var a = []; - for (var b in this.obj) { - b.charCodeAt(0) == 58 && a.push(b.substring(1)); - } - return a; - }; - } - return e; - } - function q$c() { - q$c = geb; - h$c = new jGd(rAe); - new kGd("DEPTH", sgb(0)); - XZc = new kGd("FAN", sgb(0)); - VZc = new kGd(QEe, sgb(0)); - n$c = new kGd("ROOT", (Geb(), false)); - b$c = new kGd("LEFTNEIGHBOR", null); - l$c = new kGd("RIGHTNEIGHBOR", null); - c$c = new kGd("LEFTSIBLING", null); - m$c = new kGd("RIGHTSIBLING", null); - WZc = new kGd("DUMMY", false); - new kGd("LEVEL", sgb(0)); - k$c = new kGd("REMOVABLE_EDGES", new Yub()); - o$c = new kGd("XCOOR", sgb(0)); - p$c = new kGd("YCOOR", sgb(0)); - d$c = new kGd("LEVELHEIGHT", 0); - f$c = new kGd("LEVELMIN", 0); - e$c = new kGd("LEVELMAX", 0); - ZZc = new kGd("GRAPH_XMIN", 0); - _Zc = new kGd("GRAPH_YMIN", 0); - YZc = new kGd("GRAPH_XMAX", 0); - $Zc = new kGd("GRAPH_YMAX", 0); - UZc = new kGd("COMPACT_LEVEL_ASCENSION", false); - TZc = new kGd("COMPACT_CONSTRAINTS", new bnb()); - a$c = new kGd("ID", ""); - i$c = new kGd("POSITION", sgb(0)); - j$c = new kGd("PRELIM", 0); - g$c = new kGd("MODIFIER", 0); - SZc = new jGd(tAe); - RZc = new jGd(uAe); - } - function Bqe(a) { - zqe(); - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - if (a == null) - return null; - l = a.length * 8; - if (l == 0) { - return ""; - } - h = l % 24; - n = l / 24 | 0; - m = h != 0 ? n + 1 : n; - f2 = null; - f2 = $C(hE, zwe, 28, m * 4, 15, 1); - j = 0; - k = 0; - b = 0; - c2 = 0; - d = 0; - g = 0; - e = 0; - for (i2 = 0; i2 < n; i2++) { - b = a[e++]; - c2 = a[e++]; - d = a[e++]; - k = (c2 & 15) << 24 >> 24; - j = (b & 3) << 24 >> 24; - o2 = (b & -128) == 0 ? b >> 2 << 24 >> 24 : (b >> 2 ^ 192) << 24 >> 24; - p = (c2 & -128) == 0 ? c2 >> 4 << 24 >> 24 : (c2 >> 4 ^ 240) << 24 >> 24; - q = (d & -128) == 0 ? d >> 6 << 24 >> 24 : (d >> 6 ^ 252) << 24 >> 24; - f2[g++] = yqe[o2]; - f2[g++] = yqe[p | j << 4]; - f2[g++] = yqe[k << 2 | q]; - f2[g++] = yqe[d & 63]; - } - if (h == 8) { - b = a[e]; - j = (b & 3) << 24 >> 24; - o2 = (b & -128) == 0 ? b >> 2 << 24 >> 24 : (b >> 2 ^ 192) << 24 >> 24; - f2[g++] = yqe[o2]; - f2[g++] = yqe[j << 4]; - f2[g++] = 61; - f2[g++] = 61; - } else if (h == 16) { - b = a[e]; - c2 = a[e + 1]; - k = (c2 & 15) << 24 >> 24; - j = (b & 3) << 24 >> 24; - o2 = (b & -128) == 0 ? b >> 2 << 24 >> 24 : (b >> 2 ^ 192) << 24 >> 24; - p = (c2 & -128) == 0 ? c2 >> 4 << 24 >> 24 : (c2 >> 4 ^ 240) << 24 >> 24; - f2[g++] = yqe[o2]; - f2[g++] = yqe[p | j << 4]; - f2[g++] = yqe[k << 2]; - f2[g++] = 61; - } - return Ihb(f2, 0, f2.length); - } - function CB(a, b) { - var c2, d, e, f2, g, h, i2; - a.e == 0 && a.p > 0 && (a.p = -(a.p - 1)); - a.p > qwe && tB(b, a.p - Owe); - g = b.q.getDate(); - nB(b, 1); - a.k >= 0 && qB(b, a.k); - if (a.c >= 0) { - nB(b, a.c); - } else if (a.k >= 0) { - i2 = new vB(b.q.getFullYear() - Owe, b.q.getMonth(), 35); - d = 35 - i2.q.getDate(); - nB(b, $wnd.Math.min(d, g)); - } else { - nB(b, g); - } - a.f < 0 && (a.f = b.q.getHours()); - a.b > 0 && a.f < 12 && (a.f += 12); - oB(b, a.f == 24 && a.g ? 0 : a.f); - a.j >= 0 && pB(b, a.j); - a.n >= 0 && rB(b, a.n); - a.i >= 0 && sB(b, Bdb(Ndb(Fdb(Hdb(b.q.getTime()), Awe), Awe), a.i)); - if (a.a) { - e = new uB(); - tB(e, e.q.getFullYear() - Owe - 80); - Ldb(Hdb(b.q.getTime()), Hdb(e.q.getTime())) && tB(b, e.q.getFullYear() - Owe + 100); - } - if (a.d >= 0) { - if (a.c == -1) { - c2 = (7 + a.d - b.q.getDay()) % 7; - c2 > 3 && (c2 -= 7); - h = b.q.getMonth(); - nB(b, b.q.getDate() + c2); - b.q.getMonth() != h && nB(b, b.q.getDate() + (c2 > 0 ? -7 : 7)); - } else { - if (b.q.getDay() != a.d) { - return false; - } - } - } - if (a.o > qwe) { - f2 = b.q.getTimezoneOffset(); - sB(b, Bdb(Hdb(b.q.getTime()), (a.o - f2) * 60 * Awe)); - } - return true; - } - function J5b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - e = mQb(b, (Ywc(), Awc)); - if (!ZD(e, 207)) { - return; - } - o2 = RD(e, 27); - p = b.e; - m = new sjd(b.c); - f2 = b.d; - m.a += f2.b; - m.b += f2.d; - u = RD(Gxd(o2, (yCc(), oBc)), 181); - if (Csb(u, (dqd(), Xpd))) { - n = RD(Gxd(o2, qBc), 107); - E2b(n, f2.a); - H2b(n, f2.d); - F2b(n, f2.b); - G2b(n, f2.c); - } - c2 = new bnb(); - for (k = new Anb(b.a); k.a < k.c.c.length; ) { - i2 = RD(ynb(k), 10); - if (ZD(mQb(i2, Awc), 207)) { - K5b(i2, m); - } else if (ZD(mQb(i2, Awc), 193) && !p) { - d = RD(mQb(i2, Awc), 123); - s = j2b(b, i2, d.g, d.f); - Byd(d, s.a, s.b); - } - for (r = new Anb(i2.j); r.a < r.c.c.length; ) { - q = RD(ynb(r), 12); - FDb(CDb(new SDb(null, new Swb(q.g, 16)), new Q5b(i2)), new S5b(c2)); - } - } - if (p) { - for (r = new Anb(p.j); r.a < r.c.c.length; ) { - q = RD(ynb(r), 12); - FDb(CDb(new SDb(null, new Swb(q.g, 16)), new U5b(p)), new W5b(c2)); - } - } - t = RD(Gxd(o2, yAc), 223); - for (h = new Anb(c2); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - I5b(g, t, m); - } - L5b(b); - for (j = new Anb(b.a); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 10); - l = i2.e; - !!l && J5b(a, l); - } - } - function xNb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - if (RD(RD(Qc(a.r, b), 21), 87).dc()) { - return; - } - g = RD(Vrb(a.b, b), 127); - i2 = g.i; - h = g.n; - k = BLb(a, b); - d = i2.b - h.b - h.c; - e = g.a.a; - f2 = i2.c + h.b; - n = a.w; - if ((k == (pod(), mod) || k == ood) && RD(RD(Qc(a.r, b), 21), 87).gc() == 1) { - e = k == mod ? e - 2 * a.w : e; - k = lod; - } - if (d < e && !a.B.Hc((dqd(), aqd))) { - if (k == mod) { - n += (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() + 1); - f2 += n; - } else { - n += (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() - 1); - } - } else { - if (d < e) { - e = k == mod ? e - 2 * a.w : e; - k = lod; - } - switch (k.g) { - case 3: - f2 += (d - e) / 2; - break; - case 4: - f2 += d - e; - break; - case 0: - c2 = (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() + 1); - n += $wnd.Math.max(0, c2); - f2 += n; - break; - case 1: - c2 = (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() - 1); - n += $wnd.Math.max(0, c2); - } - } - for (m = RD(RD(Qc(a.r, b), 21), 87).Kc(); m.Ob(); ) { - l = RD(m.Pb(), 117); - l.e.a = f2 + l.d.b; - l.e.b = (j = l.b, j.pf((umd(), Gld)) ? j.ag() == (qpd(), Yod) ? -j.Mf().b - Kfb(UD(j.of(Gld))) : Kfb(UD(j.of(Gld))) : j.ag() == (qpd(), Yod) ? -j.Mf().b : 0); - f2 += l.d.b + l.b.Mf().a + l.d.c + n; - } - } - function BNb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - if (RD(RD(Qc(a.r, b), 21), 87).dc()) { - return; - } - g = RD(Vrb(a.b, b), 127); - i2 = g.i; - h = g.n; - l = BLb(a, b); - d = i2.a - h.d - h.a; - e = g.a.b; - f2 = i2.d + h.d; - o2 = a.w; - j = a.o.a; - if ((l == (pod(), mod) || l == ood) && RD(RD(Qc(a.r, b), 21), 87).gc() == 1) { - e = l == mod ? e - 2 * a.w : e; - l = lod; - } - if (d < e && !a.B.Hc((dqd(), aqd))) { - if (l == mod) { - o2 += (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() + 1); - f2 += o2; - } else { - o2 += (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() - 1); - } - } else { - if (d < e) { - e = l == mod ? e - 2 * a.w : e; - l = lod; - } - switch (l.g) { - case 3: - f2 += (d - e) / 2; - break; - case 4: - f2 += d - e; - break; - case 0: - c2 = (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() + 1); - o2 += $wnd.Math.max(0, c2); - f2 += o2; - break; - case 1: - c2 = (d - e) / (RD(RD(Qc(a.r, b), 21), 87).gc() - 1); - o2 += $wnd.Math.max(0, c2); - } - } - for (n = RD(RD(Qc(a.r, b), 21), 87).Kc(); n.Ob(); ) { - m = RD(n.Pb(), 117); - m.e.a = (k = m.b, k.pf((umd(), Gld)) ? k.ag() == (qpd(), ppd) ? -k.Mf().a - Kfb(UD(k.of(Gld))) : j + Kfb(UD(k.of(Gld))) : k.ag() == (qpd(), ppd) ? -k.Mf().a : j); - m.e.b = f2 + m.d.d; - f2 += m.d.d + m.b.Mf().b + m.d.a + o2; - } - } - function bZc(a, b) { - var c2, d, e, f2, g; - b.Ug("Processor determine the coords for each level", 1); - d = new bnb(); - for (g = Sub(a.b, 0); g.b != g.d.c; ) { - e = RD(evb(g), 40); - while (RD(mQb(e, (h_c(), f_c)), 17).a > d.c.length - 1) { - Rmb(d, new Ptd(Hze, KEe)); - } - c2 = RD(mQb(e, f_c), 17).a; - if (Dmd(RD(mQb(a, H$c), 88))) { - e.e.a < Kfb(UD((tFb(c2, d.c.length), RD(d.c[c2], 42)).a)) && Ntd((tFb(c2, d.c.length), RD(d.c[c2], 42)), e.e.a); - e.e.a + e.f.a > Kfb(UD((tFb(c2, d.c.length), RD(d.c[c2], 42)).b)) && Otd((tFb(c2, d.c.length), RD(d.c[c2], 42)), e.e.a + e.f.a); - } else { - e.e.b < Kfb(UD((tFb(c2, d.c.length), RD(d.c[c2], 42)).a)) && Ntd((tFb(c2, d.c.length), RD(d.c[c2], 42)), e.e.b); - e.e.b + e.f.b > Kfb(UD((tFb(c2, d.c.length), RD(d.c[c2], 42)).b)) && Otd((tFb(c2, d.c.length), RD(d.c[c2], 42)), e.e.b + e.f.b); - } - } - for (f2 = Sub(a.b, 0); f2.b != f2.d.c; ) { - e = RD(evb(f2), 40); - c2 = RD(mQb(e, (h_c(), f_c)), 17).a; - pQb(e, (q$c(), f$c), UD((tFb(c2, d.c.length), RD(d.c[c2], 42)).a)); - pQb(e, e$c, UD((tFb(c2, d.c.length), RD(d.c[c2], 42)).b)); - } - b.Vg(); - } - function Tec(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - a.o = Kfb(UD(mQb(a.i, (yCc(), bCc)))); - a.f = Kfb(UD(mQb(a.i, XBc))); - a.j = a.i.b.c.length; - h = a.j - 1; - m = 0; - a.k = 0; - a.n = 0; - a.b = dv($C(bJ, Nve, 17, a.j, 0, 1)); - a.c = dv($C(VI, Nve, 345, a.j, 7, 1)); - for (g = new Anb(a.i.b); g.a < g.c.c.length; ) { - e = RD(ynb(g), 30); - e.p = h; - for (l = new Anb(e.a); l.a < l.c.c.length; ) { - k = RD(ynb(l), 10); - k.p = m; - ++m; - } - --h; - } - a.g = $C(kE, Pwe, 28, m, 15, 1); - a.d = YC(kE, [Nve, Pwe], [53, 28], 15, [m, 3], 2); - a.p = new bnb(); - a.q = new bnb(); - b = 0; - a.e = 0; - for (f2 = new Anb(a.i.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 30); - h = e.p; - d = 0; - p = 0; - i2 = e.a.c.length; - j = 0; - for (l = new Anb(e.a); l.a < l.c.c.length; ) { - k = RD(ynb(l), 10); - m = k.p; - a.g[m] = k.c.p; - j += k.o.b + a.o; - c2 = Kr(new is(Mr(Z2b(k).a.Kc(), new ir()))); - o2 = Kr(new is(Mr(a3b(k).a.Kc(), new ir()))); - a.d[m][0] = o2 - c2; - a.d[m][1] = c2; - a.d[m][2] = o2; - d += c2; - p += o2; - c2 > 0 && Rmb(a.q, k); - Rmb(a.p, k); - } - b -= d; - n = i2 + b; - j += b * a.f; - $mb(a.b, h, sgb(n)); - $mb(a.c, h, j); - a.k = $wnd.Math.max(a.k, n); - a.n = $wnd.Math.max(a.n, j); - a.e += b; - b += p; - } - } - function qpd() { - qpd = geb; - var a; - opd = new upd(Sye, 0); - Yod = new upd(_ye, 1); - Xod = new upd(aze, 2); - npd = new upd(bze, 3); - ppd = new upd(cze, 4); - bpd = (yob(), new Lqb((a = RD(mfb(E3), 9), new Fsb(a, RD(WEb(a, a.length), 9), 0)))); - cpd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, []))); - Zod = eq2(ysb(Xod, cD(WC(E3, 1), NAe, 64, 0, []))); - kpd = eq2(ysb(npd, cD(WC(E3, 1), NAe, 64, 0, []))); - mpd = eq2(ysb(ppd, cD(WC(E3, 1), NAe, 64, 0, []))); - hpd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, [npd]))); - apd = eq2(ysb(Xod, cD(WC(E3, 1), NAe, 64, 0, [ppd]))); - jpd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, [ppd]))); - dpd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, [Xod]))); - lpd = eq2(ysb(npd, cD(WC(E3, 1), NAe, 64, 0, [ppd]))); - $od = eq2(ysb(Xod, cD(WC(E3, 1), NAe, 64, 0, [npd]))); - gpd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, [Xod, ppd]))); - _od = eq2(ysb(Xod, cD(WC(E3, 1), NAe, 64, 0, [npd, ppd]))); - ipd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, [npd, ppd]))); - epd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, [Xod, npd]))); - fpd = eq2(ysb(Yod, cD(WC(E3, 1), NAe, 64, 0, [Xod, npd, ppd]))); - } - function Gfc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A; - b.Ug(qBe, 1); - p = new bnb(); - w2 = new bnb(); - for (j = new Anb(a.b); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 30); - r = -1; - o2 = t2b(i2.a); - for (l = o2, m = 0, n = l.length; m < n; ++m) { - k = l[m]; - ++r; - if (!(k.k == (r3b(), p3b) && Dod(RD(mQb(k, (yCc(), BBc)), 101)))) { - continue; - } - Cod(RD(mQb(k, (yCc(), BBc)), 101)) || Hfc(k); - pQb(k, (Ywc(), pwc), k); - p.c.length = 0; - w2.c.length = 0; - c2 = new bnb(); - u = new Yub(); - _q(u, e3b(k, (qpd(), Yod))); - Efc(a, u, p, w2, c2); - h = r; - A = k; - for (f2 = new Anb(p); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 10); - f3b(d, h, i2); - ++r; - pQb(d, pwc, k); - g = RD(Vmb(d.j, 0), 12); - q = RD(mQb(g, Awc), 12); - Heb(TD(mQb(q, Szc))) || RD(mQb(d, qwc), 15).Fc(A); - } - Xub(u); - for (t = e3b(k, npd).Kc(); t.Ob(); ) { - s = RD(t.Pb(), 12); - Pub(u, s, u.a, u.a.a); - } - Efc(a, u, w2, null, c2); - v = k; - for (e = new Anb(w2); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - f3b(d, ++r, i2); - pQb(d, pwc, k); - g = RD(Vmb(d.j, 0), 12); - q = RD(mQb(g, Awc), 12); - Heb(TD(mQb(q, Szc))) || RD(mQb(v, qwc), 15).Fc(d); - } - c2.c.length == 0 || pQb(k, Uvc, c2); - } - } - b.Vg(); - } - function tYc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - if (b.b != 0) { - n = new Yub(); - h = null; - o2 = null; - d = eE($wnd.Math.floor($wnd.Math.log(b.b) * $wnd.Math.LOG10E) + 1); - i2 = 0; - for (t = Sub(b, 0); t.b != t.d.c; ) { - r = RD(evb(t), 40); - if (dE(o2) !== dE(mQb(r, (q$c(), a$c)))) { - o2 = WD(mQb(r, a$c)); - i2 = 0; - } - o2 != null ? h = o2 + wYc(i2++, d) : h = wYc(i2++, d); - pQb(r, a$c, h); - for (q = (e = Sub(new dXc(r).a.d, 0), new gXc(e)); dvb(q.a); ) { - p = RD(evb(q.a), 65).c; - Pub(n, p, n.c.b, n.c); - pQb(p, a$c, h); - } - } - m = new Tsb(); - for (g = 0; g < h.length - d; g++) { - for (s = Sub(b, 0); s.b != s.d.c; ) { - r = RD(evb(s), 40); - j = zhb(WD(mQb(r, (q$c(), a$c))), 0, g + 1); - c2 = (j == null ? Wd(qtb(m.f, null)) : Ktb(m.i, j)) != null ? RD(j == null ? Wd(qtb(m.f, null)) : Ktb(m.i, j), 17).a + 1 : 1; - $jb(m, j, sgb(c2)); - } - } - for (l = new vkb(new mkb(m).a); l.b; ) { - k = tkb(l); - f2 = sgb(Wjb(a.a, k.ld()) != null ? RD(Wjb(a.a, k.ld()), 17).a : 0); - $jb(a.a, WD(k.ld()), sgb(RD(k.md(), 17).a + f2.a)); - f2 = RD(Wjb(a.b, k.ld()), 17); - (!f2 || f2.a < RD(k.md(), 17).a) && $jb(a.b, WD(k.ld()), RD(k.md(), 17)); - } - tYc(a, n); - } - } - function Hpc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - c2 = null; - i2 = null; - e = RD(mQb(a.b, (yCc(), CAc)), 349); - if (e == (TEc(), REc)) { - c2 = new bnb(); - i2 = new bnb(); - } - for (h = new Anb(a.d); h.a < h.c.c.length; ) { - g = RD(ynb(h), 105); - f2 = g.i; - if (!f2) { - continue; - } - switch (g.e.g) { - case 0: - b = RD(Nsb(new Osb(g.b)), 64); - e == REc && b == (qpd(), Yod) ? (ZEb(c2.c, g), true) : e == REc && b == (qpd(), npd) ? (ZEb(i2.c, g), true) : Fpc(g, b); - break; - case 1: - j = g.a.d.j; - k = g.c.d.j; - j == (qpd(), Yod) ? Gpc(g, Yod, (enc(), bnc), g.a) : k == Yod ? Gpc(g, Yod, (enc(), cnc), g.c) : j == npd ? Gpc(g, npd, (enc(), cnc), g.a) : k == npd && Gpc(g, npd, (enc(), bnc), g.c); - break; - case 2: - case 3: - d = g.b; - Csb(d, (qpd(), Yod)) ? Csb(d, npd) ? Csb(d, ppd) ? Csb(d, Xod) || Gpc(g, Yod, (enc(), cnc), g.c) : Gpc(g, Yod, (enc(), bnc), g.a) : Gpc(g, Yod, (enc(), anc), null) : Gpc(g, npd, (enc(), anc), null); - break; - case 4: - l = g.a.d.j; - m = g.a.d.j; - l == (qpd(), Yod) || m == Yod ? Gpc(g, npd, (enc(), anc), null) : Gpc(g, Yod, (enc(), anc), null); - } - } - if (c2) { - c2.c.length == 0 || Epc(c2, (qpd(), Yod)); - i2.c.length == 0 || Epc(i2, (qpd(), npd)); - } - } - function oGc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - c2.Ug("Breadth first model order layering", 1); - a.a = b; - q = new bnb(); - for (p = new Anb(a.a.a); p.a < p.c.c.length; ) { - n = RD(ynb(p), 10); - n.k == (r3b(), p3b) && (ZEb(q.c, n), true); - } - yob(); - _mb(q, new tGc()); - i2 = true; - e = new R4b(a.a); - d = null; - Rmb(a.a.b, e); - for (o2 = new Anb(q); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 10); - if (i2) { - g3b(n, e); - i2 = false; - } else { - for (h = new is(Mr(Z2b(n).a.Kc(), new ir())); gs(h); ) { - f2 = RD(hs(h), 18); - if (f2.c.i.k == (r3b(), p3b) && f2.c.i.c == e || f2.c.i.k == n3b && RD(hs(new is(Mr(Z2b(f2.c.i).a.Kc(), new ir()))), 18).c.i.c == e) { - d = new R4b(a.a); - Rmb(a.a.b, d); - e = new R4b(a.a); - Rmb(a.a.b, e); - } - } - for (g = new is(Mr(Z2b(n).a.Kc(), new ir())); gs(g); ) { - f2 = RD(hs(g), 18); - f2.c.i.k == (r3b(), n3b) && !f2.c.i.c && g3b(f2.c.i, d); - } - g3b(n, e); - } - } - a.a.a.c.length = 0; - r = new bnb(); - for (l = new Anb(a.a.b); l.a < l.c.c.length; ) { - j = RD(ynb(l), 30); - j.a.c.length == 0 && (ZEb(r.c, j), true); - } - Ce(a.a.b, r); - m = 0; - for (k = new Anb(a.a.b); k.a < k.c.c.length; ) { - j = RD(ynb(k), 30); - j.p = m; - ++m; - } - c2.Vg(); - } - function K5b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - d = RD(mQb(a, (Ywc(), Awc)), 27); - o2 = RD(mQb(a, (yCc(), mAc)), 17).a; - f2 = RD(mQb(a, VAc), 17).a; - Ixd(d, mAc, sgb(o2)); - Ixd(d, VAc, sgb(f2)); - Dyd(d, a.n.a + b.a); - Eyd(d, a.n.b + b.b); - if (RD(Gxd(d, lBc), 181).gc() != 0 || !!a.e || dE(mQb(Y2b(a), kBc)) === dE((JDc(), HDc)) && xDc((wDc(), (!a.q ? (yob(), yob(), wob) : a.q)._b(iBc) ? m = RD(mQb(a, iBc), 203) : m = RD(mQb(Y2b(a), jBc), 203), m))) { - Cyd(d, a.o.a); - Ayd(d, a.o.b); - } - for (l = new Anb(a.j); l.a < l.c.c.length; ) { - j = RD(ynb(l), 12); - p = mQb(j, Awc); - if (ZD(p, 193)) { - e = RD(p, 123); - Byd(e, j.n.a, j.n.b); - Ixd(e, GBc, j.j); - } - } - n = RD(mQb(a, dBc), 181).gc() != 0; - for (i2 = new Anb(a.b); i2.a < i2.c.c.length; ) { - g = RD(ynb(i2), 72); - if (n || RD(mQb(g, dBc), 181).gc() != 0) { - c2 = RD(mQb(g, Awc), 135); - zyd(c2, g.o.a, g.o.b); - Byd(c2, g.n.a, g.n.b); - } - } - if (!Rod(RD(mQb(a, EBc), 21))) { - for (k = new Anb(a.j); k.a < k.c.c.length; ) { - j = RD(ynb(k), 12); - for (h = new Anb(j.f); h.a < h.c.c.length; ) { - g = RD(ynb(h), 72); - c2 = RD(mQb(g, Awc), 135); - Cyd(c2, g.o.a); - Ayd(c2, g.o.b); - Byd(c2, g.n.a, g.n.b); - } - } - } - } - function X2c(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C; - b.Ug("Calculate Graph Size", 1); - b.dh(a, eFe); - l = Hze; - m = Hze; - j = fFe; - k = fFe; - for (p = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); p.e != p.i.gc(); ) { - n = RD(bMd(p), 27); - s = n.i; - t = n.j; - C = n.g; - h = n.f; - i2 = RD(Gxd(n, (umd(), eld)), 140); - l = $wnd.Math.min(l, s - i2.b); - m = $wnd.Math.min(m, t - i2.d); - j = $wnd.Math.max(j, s + C + i2.c); - k = $wnd.Math.max(k, t + h + i2.a); - } - r = RD(Gxd(a, (umd(), tld)), 107); - q = new rjd(l - r.b, m - r.d); - B = j - l + (r.b + r.c); - g = k - m + (r.d + r.a); - if (Heb(TD(Gxd(a, ($4c(), G4c))))) { - u = RD(Gxd(a, (u2c(), t2c)), 27); - v = RD(Gxd(u, eld), 140); - w2 = u.i + u.g / 2 + (v.b + v.c) / 2 - q.a; - A = u.j + u.f / 2 + (v.d + v.a) / 2 - q.b; - e = B - w2; - f2 = g - A; - if (e < B / 2) { - c2 = e - w2; - B += c2; - q.a -= c2; - } else { - c2 = w2 - e; - B += c2; - } - if (f2 < g / 2) { - d = f2 - A; - g += d; - q.b -= d; - } else { - d = A - f2; - g += d; - } - } - for (o2 = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); o2.e != o2.i.gc(); ) { - n = RD(bMd(o2), 27); - Dyd(n, n.i - q.a); - Eyd(n, n.j - q.b); - } - if (!Heb(TD(Gxd(a, mld)))) { - Cyd(a, B); - Ayd(a, g); - } - Ixd(a, Ikd, B - (r.b + r.c)); - Ixd(a, Hkd, g - (r.d + r.a)); - b.dh(a, gFe); - } - function IUc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - a.e.a.$b(); - a.f.a.$b(); - a.c.c.length = 0; - a.i.c.length = 0; - a.g.a.$b(); - if (b) { - for (g = new Anb(b.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - for (l = e3b(f2, (qpd(), Xod)).Kc(); l.Ob(); ) { - k = RD(l.Pb(), 12); - Ysb(a.e, k); - for (e = new Anb(k.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - if (W0b(d)) { - continue; - } - Rmb(a.c, d); - OUc(a, d); - h = d.c.i.k; - (h == (r3b(), p3b) || h == q3b || h == m3b || h == l3b) && Rmb(a.j, d); - n = d.d; - m = n.i.c; - m == c2 ? Ysb(a.f, n) : m == b ? Ysb(a.e, n) : Ymb(a.c, d); - } - } - } - } - if (c2) { - for (g = new Anb(c2.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 10); - for (j = new Anb(f2.j); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 12); - for (e = new Anb(i2.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - W0b(d) && Ysb(a.g, d); - } - } - for (l = e3b(f2, (qpd(), ppd)).Kc(); l.Ob(); ) { - k = RD(l.Pb(), 12); - Ysb(a.f, k); - for (e = new Anb(k.g); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - if (W0b(d)) { - continue; - } - Rmb(a.c, d); - OUc(a, d); - h = d.c.i.k; - (h == (r3b(), p3b) || h == q3b || h == m3b || h == l3b) && Rmb(a.j, d); - n = d.d; - m = n.i.c; - m == c2 ? Ysb(a.f, n) : m == b ? Ysb(a.e, n) : Ymb(a.c, d); - } - } - } - } - } - function iSc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - c2.Ug("Polyline edge routing", 1); - q = Kfb(UD(mQb(b, (yCc(), AAc)))); - n = Kfb(UD(mQb(b, cCc))); - e = Kfb(UD(mQb(b, UBc))); - d = $wnd.Math.min(1, e / n); - t = 0; - i2 = 0; - if (b.b.c.length != 0) { - u = fSc(RD(Vmb(b.b, 0), 30)); - t = 0.4 * d * u; - } - h = new Jkb(b.b, 0); - while (h.b < h.d.gc()) { - g = (sFb(h.b < h.d.gc()), RD(h.d.Xb(h.c = h.b++), 30)); - f2 = ar(g, bSc); - f2 && t > 0 && (t -= n); - p2b(g, t); - k = 0; - for (m = new Anb(g.a); m.a < m.c.c.length; ) { - l = RD(ynb(m), 10); - j = 0; - for (p = new is(Mr(a3b(l).a.Kc(), new ir())); gs(p); ) { - o2 = RD(hs(p), 18); - r = K3b(o2.c).b; - s = K3b(o2.d).b; - if (g == o2.d.i.c && !W0b(o2)) { - jSc(o2, t, 0.4 * d * $wnd.Math.abs(r - s)); - if (o2.c.j == (qpd(), ppd)) { - r = 0; - s = 0; - } - } - j = $wnd.Math.max(j, $wnd.Math.abs(s - r)); - } - switch (l.k.g) { - case 0: - case 4: - case 1: - case 3: - case 5: - kSc(a, l, t, q); - } - k = $wnd.Math.max(k, j); - } - if (h.b < h.d.gc()) { - u = fSc((sFb(h.b < h.d.gc()), RD(h.d.Xb(h.c = h.b++), 30))); - k = $wnd.Math.max(k, u); - sFb(h.b > 0); - h.a.Xb(h.c = --h.b); - } - i2 = 0.4 * d * k; - !f2 && h.b < h.d.gc() && (i2 += n); - t += g.c.a + i2; - } - a.a.a.$b(); - b.f.a = t; - c2.Vg(); - } - function GGd(a) { - var b, c2, d, e, f2; - Ivb(a, IIe); - switch ((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i + (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c).i) { - case 0: - throw Adb(new agb("The edge must have at least one source or target.")); - case 1: - return (!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i == 0 ? vCd(AGd(RD(QHd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c), 0), 84))) : vCd(AGd(RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84))); - } - if ((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b).i == 1 && (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c).i == 1) { - e = AGd(RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84)); - f2 = AGd(RD(QHd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c), 0), 84)); - if (vCd(e) == vCd(f2)) { - return vCd(e); - } else if (e == vCd(f2)) { - return e; - } else if (f2 == vCd(e)) { - return f2; - } - } - d = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [(!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), (!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c)]))); - b = AGd(RD(hs(d), 84)); - while (gs(d)) { - c2 = AGd(RD(hs(d), 84)); - if (c2 != b && !NGd(c2, b)) { - if (vCd(c2) == vCd(b)) { - b = vCd(c2); - } else { - b = HGd(b, c2); - if (!b) { - return null; - } - } - } - } - return b; - } - function _zd(b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - n = c2.length; - if (n > 0) { - j = (BFb(0, c2.length), c2.charCodeAt(0)); - if (j != 64) { - if (j == 37) { - m = c2.lastIndexOf("%"); - k = false; - if (m != 0 && (m == n - 1 || (k = (BFb(m + 1, c2.length), c2.charCodeAt(m + 1) == 46)))) { - h = (AFb(1, m, c2.length), c2.substr(1, m - 1)); - u = lhb("%", h) ? null : oSd(h); - e = 0; - if (k) { - try { - e = Oeb((BFb(m + 2, c2.length + 1), c2.substr(m + 2)), qwe, lve); - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - i2 = a; - throw Adb(new RSd(i2)); - } else - throw Adb(a); - } - } - for (r = P2d(b.Gh()); r.Ob(); ) { - p = k3d(r); - if (ZD(p, 519)) { - f2 = RD(p, 598); - t = f2.d; - if ((u == null ? t == null : lhb(u, t)) && e-- == 0) { - return f2; - } - } - } - return null; - } - } - l = c2.lastIndexOf("."); - o2 = l == -1 ? c2 : (AFb(0, l, c2.length), c2.substr(0, l)); - d = 0; - if (l != -1) { - try { - d = Oeb((BFb(l + 1, c2.length + 1), c2.substr(l + 1)), qwe, lve); - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - o2 = c2; - } else - throw Adb(a); - } - } - o2 = lhb("%", o2) ? null : oSd(o2); - for (q = P2d(b.Gh()); q.Ob(); ) { - p = k3d(q); - if (ZD(p, 197)) { - g = RD(p, 197); - s = g.xe(); - if ((o2 == null ? s == null : lhb(o2, s)) && d-- == 0) { - return g; - } - } - } - return null; - } - } - return Pvd(b, c2); - } - function Hlc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s; - k = new Tsb(); - i2 = new Tp(); - for (d = new Anb(a.a.a.b); d.a < d.c.c.length; ) { - b = RD(ynb(d), 60); - j = Zjc(b); - if (j) { - rtb(k.f, j, b); - } else { - s = $jc(b); - if (s) { - for (f2 = new Anb(s.k); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 18); - Rc(i2, e, b); - } - } - } - } - for (c2 = new Anb(a.a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - j = Zjc(b); - if (j) { - for (h = new is(Mr(a3b(j).a.Kc(), new ir())); gs(h); ) { - g = RD(hs(h), 18); - if (W0b(g)) { - continue; - } - o2 = g.c; - r = g.d; - if ((qpd(), hpd).Hc(g.c.j) && hpd.Hc(g.d.j)) { - continue; - } - p = RD(Wjb(k, g.d.i), 60); - rIb(uIb(tIb(vIb(sIb(new wIb(), 0), 100), a.c[b.a.d]), a.c[p.a.d])); - if (o2.j == ppd && q4b((J3b(), o2))) { - for (m = RD(Qc(i2, g), 21).Kc(); m.Ob(); ) { - l = RD(m.Pb(), 60); - if (l.d.c < b.d.c) { - n = a.c[l.a.d]; - q = a.c[b.a.d]; - if (n == q) { - continue; - } - rIb(uIb(tIb(vIb(sIb(new wIb(), 1), 100), n), q)); - } - } - } - if (r.j == Xod && v4b((J3b(), r))) { - for (m = RD(Qc(i2, g), 21).Kc(); m.Ob(); ) { - l = RD(m.Pb(), 60); - if (l.d.c > b.d.c) { - n = a.c[b.a.d]; - q = a.c[l.a.d]; - if (n == q) { - continue; - } - rIb(uIb(tIb(vIb(sIb(new wIb(), 1), 100), n), q)); - } - } - } - } - } - } - } - function mNb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - m = RD(RD(Qc(a.r, b), 21), 87); - if (b == (qpd(), Xod) || b == ppd) { - qNb(a, b); - return; - } - f2 = b == Yod ? (mOb(), iOb) : (mOb(), lOb); - u = b == Yod ? (vLb(), uLb) : (vLb(), sLb); - c2 = RD(Vrb(a.b, b), 127); - d = c2.i; - e = d.c + Hid(cD(WC(iE, 1), vxe, 28, 15, [c2.n.b, a.C.b, a.k])); - r = d.c + d.b - Hid(cD(WC(iE, 1), vxe, 28, 15, [c2.n.c, a.C.c, a.k])); - g = WNb(_Nb(f2), a.t); - s = b == Yod ? pxe : oxe; - for (l = m.Kc(); l.Ob(); ) { - j = RD(l.Pb(), 117); - if (!j.c || j.c.d.c.length <= 0) { - continue; - } - q = j.b.Mf(); - p = j.e; - n = j.c; - o2 = n.i; - o2.b = (i2 = n.n, n.e.a + i2.b + i2.c); - o2.a = (h = n.n, n.e.b + h.d + h.a); - Ivb(u, Pye); - n.f = u; - RKb(n, (EKb(), DKb)); - o2.c = p.a - (o2.b - q.a) / 2; - v = $wnd.Math.min(e, p.a); - w2 = $wnd.Math.max(r, p.a + q.a); - o2.c < v ? o2.c = v : o2.c + o2.b > w2 && (o2.c = w2 - o2.b); - Rmb(g.d, new sOb(o2, UNb(g, o2))); - s = b == Yod ? $wnd.Math.max(s, p.b + j.b.Mf().b) : $wnd.Math.min(s, p.b); - } - s += b == Yod ? a.t : -a.t; - t = VNb((g.e = s, g)); - t > 0 && (RD(Vrb(a.b, b), 127).a.b = t); - for (k = m.Kc(); k.Ob(); ) { - j = RD(k.Pb(), 117); - if (!j.c || j.c.d.c.length <= 0) { - continue; - } - o2 = j.c.i; - o2.c -= j.e.a; - o2.d -= j.e.b; - } - } - function JSb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - b = new Tsb(); - for (i2 = new dMd(a); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 27); - c2 = new _sb(); - Zjb(FSb, h, c2); - n = new TSb(); - e = RD(zDb(new SDb(null, new Twb(new is(Mr(yGd(h).a.Kc(), new ir())))), OBb(n, tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)])))), 85); - ISb(c2, RD(e.xc((Geb(), true)), 16), new VSb()); - d = RD(zDb(CDb(RD(e.xc(false), 15).Lc(), new XSb()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 15); - for (g = d.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 74); - m = KGd(f2); - if (m) { - j = RD(Wd(qtb(b.f, m)), 21); - if (!j) { - j = LSb(m); - rtb(b.f, m, j); - } - ye(c2, j); - } - } - e = RD(zDb(new SDb(null, new Twb(new is(Mr(zGd(h).a.Kc(), new ir())))), OBb(n, tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb])))), 85); - ISb(c2, RD(e.xc(true), 16), new ZSb()); - d = RD(zDb(CDb(RD(e.xc(false), 15).Lc(), new _Sb()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 15); - for (l = d.Kc(); l.Ob(); ) { - k = RD(l.Pb(), 74); - m = MGd(k); - if (m) { - j = RD(Wd(qtb(b.f, m)), 21); - if (!j) { - j = LSb(m); - rtb(b.f, m, j); - } - ye(c2, j); - } - } - } - } - function zjb(a, b) { - xjb(); - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - i2 = Ddb(a, 0) < 0; - i2 && (a = Odb(a)); - if (Ddb(a, 0) == 0) { - switch (b) { - case 0: - return "0"; - case 1: - return zxe; - case 2: - return "0.00"; - case 3: - return "0.000"; - case 4: - return "0.0000"; - case 5: - return "0.00000"; - case 6: - return "0.000000"; - default: - n = new bib(); - b < 0 ? (n.a += "0E+", n) : (n.a += "0E", n); - n.a += b == qwe ? "2147483648" : "" + -b; - return n.a; - } - } - k = 18; - l = $C(hE, zwe, 28, k + 1, 15, 1); - c2 = k; - p = a; - do { - j = p; - p = Fdb(p, 10); - l[--c2] = Ydb(Bdb(48, Vdb(j, Ndb(p, 10)))) & Bwe; - } while (Ddb(p, 0) != 0); - e = Vdb(Vdb(Vdb(k, c2), b), 1); - if (b == 0) { - i2 && (l[--c2] = 45); - return Ihb(l, c2, k - c2); - } - if (b > 0 && Ddb(e, -6) >= 0) { - if (Ddb(e, 0) >= 0) { - f2 = c2 + Ydb(e); - for (h = k - 1; h >= f2; h--) { - l[h + 1] = l[h]; - } - l[++f2] = 46; - i2 && (l[--c2] = 45); - return Ihb(l, c2, k - c2 + 1); - } - for (g = 2; Ldb(g, Bdb(Odb(e), 1)); g++) { - l[--c2] = 48; - } - l[--c2] = 46; - l[--c2] = 48; - i2 && (l[--c2] = 45); - return Ihb(l, c2, k - c2); - } - o2 = c2 + 1; - d = k; - m = new cib(); - i2 && (m.a += "-", m); - if (d - o2 >= 1) { - Thb(m, l[c2]); - m.a += "."; - m.a += Ihb(l, c2 + 1, k - c2 - 1); - } else { - m.a += Ihb(l, c2, k - c2); - } - m.a += "E"; - Ddb(e, 0) > 0 && (m.a += "+", m); - m.a += "" + Zdb(e); - return m.a; - } - function Esd(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - q = new rjd(a.g, a.f); - p = vsd(a); - p.a = $wnd.Math.max(p.a, b); - p.b = $wnd.Math.max(p.b, c2); - w2 = p.a / q.a; - k = p.b / q.b; - u = p.a - q.a; - i2 = p.b - q.b; - if (d) { - g = !vCd(a) ? RD(Gxd(a, (umd(), Nkd)), 88) : RD(Gxd(vCd(a), (umd(), Nkd)), 88); - h = dE(Gxd(a, (umd(), Hld))) === dE((Bod(), wod)); - for (s = new dMd((!a.c && (a.c = new C5d(K4, a, 9, 9)), a.c)); s.e != s.i.gc(); ) { - r = RD(bMd(s), 123); - t = RD(Gxd(r, Old), 64); - if (t == (qpd(), opd)) { - t = osd(r, g); - Ixd(r, Old, t); - } - switch (t.g) { - case 1: - h || Dyd(r, r.i * w2); - break; - case 2: - Dyd(r, r.i + u); - h || Eyd(r, r.j * k); - break; - case 3: - h || Dyd(r, r.i * w2); - Eyd(r, r.j + i2); - break; - case 4: - h || Eyd(r, r.j * k); - } - } - } - zyd(a, p.a, p.b); - if (e) { - for (m = new dMd((!a.n && (a.n = new C5d(I4, a, 1, 7)), a.n)); m.e != m.i.gc(); ) { - l = RD(bMd(m), 135); - n = l.i + l.g / 2; - o2 = l.j + l.f / 2; - v = n / q.a; - j = o2 / q.b; - if (v + j >= 1) { - if (v - j > 0 && o2 >= 0) { - Dyd(l, l.i + u); - Eyd(l, l.j + i2 * j); - } else if (v - j < 0 && n >= 0) { - Dyd(l, l.i + u * v); - Eyd(l, l.j + i2); - } - } - } - } - Ixd(a, (umd(), kld), (Qpd(), f2 = RD(mfb(H3), 9), new Fsb(f2, RD(WEb(f2, f2.length), 9), 0))); - return new rjd(w2, k); - } - function _4c(a) { - Cgd(a, new Pfd(Wfd($fd(Xfd(Zfd(Yfd(new agd(), CFe), "ELK Radial"), 'A radial layout provider which is based on the algorithm of Peter Eades published in "Drawing free trees.", published by International Institute for Advanced Study of Social Information Science, Fujitsu Limited in 1991. The radial layouter takes a tree and places the nodes in radial order around the root. The nodes of the same tree level are placed on the same radius.'), new c5c()), CFe))); - Agd(a, CFe, fEe, iGd(R4c)); - Agd(a, CFe, _ze, iGd(Y4c)); - Agd(a, CFe, jAe, iGd(K4c)); - Agd(a, CFe, CAe, iGd(L4c)); - Agd(a, CFe, iAe, iGd(M4c)); - Agd(a, CFe, kAe, iGd(J4c)); - Agd(a, CFe, gAe, iGd(N4c)); - Agd(a, CFe, lAe, iGd(Q4c)); - Agd(a, CFe, tFe, iGd(H4c)); - Agd(a, CFe, sFe, iGd(I4c)); - Agd(a, CFe, rFe, iGd(T4c)); - Agd(a, CFe, xFe, iGd(W4c)); - Agd(a, CFe, yFe, iGd(U4c)); - Agd(a, CFe, zFe, iGd(V4c)); - Agd(a, CFe, wFe, iGd(O4c)); - Agd(a, CFe, pFe, iGd(P4c)); - Agd(a, CFe, qFe, iGd(S4c)); - Agd(a, CFe, uFe, iGd(X4c)); - Agd(a, CFe, vFe, iGd(Z4c)); - Agd(a, CFe, oFe, iGd(G4c)); - } - function Peb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - if (a == null) { - throw Adb(new Vgb(vve)); - } - j = a; - f2 = a.length; - i2 = false; - if (f2 > 0) { - b = (BFb(0, a.length), a.charCodeAt(0)); - if (b == 45 || b == 43) { - a = (BFb(1, a.length + 1), a.substr(1)); - --f2; - i2 = b == 45; - } - } - if (f2 == 0) { - throw Adb(new Vgb(nxe + j + '"')); - } - while (a.length > 0 && (BFb(0, a.length), a.charCodeAt(0) == 48)) { - a = (BFb(1, a.length + 1), a.substr(1)); - --f2; - } - if (f2 > (Ugb(), Sgb)[10]) { - throw Adb(new Vgb(nxe + j + '"')); - } - for (e = 0; e < f2; e++) { - if (dfb((BFb(e, a.length), a.charCodeAt(e))) == -1) { - throw Adb(new Vgb(nxe + j + '"')); - } - } - l = 0; - g = Qgb[10]; - k = Rgb2[10]; - h = Odb(Tgb[10]); - c2 = true; - d = f2 % g; - if (d > 0) { - l = -parseInt((AFb(0, d, a.length), a.substr(0, d)), 10); - a = (BFb(d, a.length + 1), a.substr(d)); - f2 -= d; - c2 = false; - } - while (f2 >= g) { - d = parseInt((AFb(0, g, a.length), a.substr(0, g)), 10); - a = (BFb(g, a.length + 1), a.substr(g)); - f2 -= g; - if (c2) { - c2 = false; - } else { - if (Ddb(l, h) < 0) { - throw Adb(new Vgb(nxe + j + '"')); - } - l = Ndb(l, k); - } - l = Vdb(l, d); - } - if (Ddb(l, 0) > 0) { - throw Adb(new Vgb(nxe + j + '"')); - } - if (!i2) { - l = Odb(l); - if (Ddb(l, 0) < 0) { - throw Adb(new Vgb(nxe + j + '"')); - } - } - return l; - } - function oSd(a) { - gSd(); - var b, c2, d, e, f2, g, h, i2; - if (a == null) - return null; - e = qhb(a, Fhb(37)); - if (e < 0) { - return a; - } else { - i2 = new dib((AFb(0, e, a.length), a.substr(0, e))); - b = $C(gE, YHe, 28, 4, 15, 1); - h = 0; - d = 0; - for (g = a.length; e < g; e++) { - BFb(e, a.length); - if (a.charCodeAt(e) == 37 && a.length > e + 2 && zSd((BFb(e + 1, a.length), a.charCodeAt(e + 1)), XRd, YRd) && zSd((BFb(e + 2, a.length), a.charCodeAt(e + 2)), XRd, YRd)) { - c2 = DSd((BFb(e + 1, a.length), a.charCodeAt(e + 1)), (BFb(e + 2, a.length), a.charCodeAt(e + 2))); - e += 2; - if (d > 0) { - (c2 & 192) == 128 ? b[h++] = c2 << 24 >> 24 : d = 0; - } else if (c2 >= 128) { - if ((c2 & 224) == 192) { - b[h++] = c2 << 24 >> 24; - d = 2; - } else if ((c2 & 240) == 224) { - b[h++] = c2 << 24 >> 24; - d = 3; - } else if ((c2 & 248) == 240) { - b[h++] = c2 << 24 >> 24; - d = 4; - } - } - if (d > 0) { - if (h == d) { - switch (h) { - case 2: { - Thb(i2, ((b[0] & 31) << 6 | b[1] & 63) & Bwe); - break; - } - case 3: { - Thb(i2, ((b[0] & 15) << 12 | (b[1] & 63) << 6 | b[2] & 63) & Bwe); - break; - } - } - h = 0; - d = 0; - } - } else { - for (f2 = 0; f2 < h; ++f2) { - Thb(i2, b[f2] & Bwe); - } - h = 0; - i2.a += String.fromCharCode(c2); - } - } else { - for (f2 = 0; f2 < h; ++f2) { - Thb(i2, b[f2] & Bwe); - } - h = 0; - Thb(i2, (BFb(e, a.length), a.charCodeAt(e))); - } - } - return i2.a; - } - } - function atd(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - n = vCd(AGd(RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84))); - o2 = vCd(AGd(RD(QHd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c), 0), 84))); - l = n == o2; - h = new pjd(); - b = RD(Gxd(a, (vnd(), ond)), 75); - if (!!b && b.b >= 2) { - if ((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i == 0) { - c2 = (bvd(), e = new Rzd(), e); - WGd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a), c2); - } else if ((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i > 1) { - m = new mMd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a)); - while (m.e != m.i.gc()) { - cMd(m); - } - } - lsd(b, RD(QHd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a), 0), 166)); - } - if (l) { - for (d = new dMd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a)); d.e != d.i.gc(); ) { - c2 = RD(bMd(d), 166); - for (j = new dMd((!c2.a && (c2.a = new XZd(D4, c2, 5)), c2.a)); j.e != j.i.gc(); ) { - i2 = RD(bMd(j), 377); - h.a = $wnd.Math.max(h.a, i2.a); - h.b = $wnd.Math.max(h.b, i2.b); - } - } - } - for (g = new dMd((!a.n && (a.n = new C5d(I4, a, 1, 7)), a.n)); g.e != g.i.gc(); ) { - f2 = RD(bMd(g), 135); - k = RD(Gxd(f2, und), 8); - !!k && Byd(f2, k.a, k.b); - if (l) { - h.a = $wnd.Math.max(h.a, f2.i + f2.g); - h.b = $wnd.Math.max(h.b, f2.j + f2.f); - } - } - return h; - } - function MA(a, b, c2, d, e) { - var f2, g, h; - KA(a, b); - g = b[0]; - f2 = ihb(c2.c, 0); - h = -1; - if (DA(c2)) { - if (d > 0) { - if (g + d > a.length) { - return false; - } - h = HA((AFb(0, g + d, a.length), a.substr(0, g + d)), b); - } else { - h = HA(a, b); - } - } - switch (f2) { - case 71: - h = EA(a, g, cD(WC(qJ, 1), Nve, 2, 6, [Qwe, Rwe]), b); - e.e = h; - return true; - case 77: - return PA(a, b, e, h, g); - case 76: - return RA(a, b, e, h, g); - case 69: - return NA(a, b, g, e); - case 99: - return QA(a, b, g, e); - case 97: - h = EA(a, g, cD(WC(qJ, 1), Nve, 2, 6, ["AM", "PM"]), b); - e.b = h; - return true; - case 121: - return TA(a, b, g, h, c2, e); - case 100: - if (h <= 0) { - return false; - } - e.c = h; - return true; - case 83: - if (h < 0) { - return false; - } - return OA(h, g, b[0], e); - case 104: - h == 12 && (h = 0); - case 75: - case 72: - if (h < 0) { - return false; - } - e.f = h; - e.g = false; - return true; - case 107: - if (h < 0) { - return false; - } - e.f = h; - e.g = true; - return true; - case 109: - if (h < 0) { - return false; - } - e.j = h; - return true; - case 115: - if (h < 0) { - return false; - } - e.n = h; - return true; - case 90: - if (g < a.length && (BFb(g, a.length), a.charCodeAt(g) == 90)) { - ++b[0]; - e.o = 0; - return true; - } - case 122: - case 118: - return SA(a, g, b, e); - default: - return false; - } - } - function YQc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B; - t = b.c.length; - e = new sQc(a.a, c2, null, null); - B = $C(iE, vxe, 28, t, 15, 1); - p = $C(iE, vxe, 28, t, 15, 1); - o2 = $C(iE, vxe, 28, t, 15, 1); - q = 0; - for (h = 0; h < t; h++) { - p[h] = lve; - o2[h] = qwe; - } - for (i2 = 0; i2 < t; i2++) { - d = (tFb(i2, b.c.length), RD(b.c[i2], 185)); - B[i2] = qQc(d); - B[q] > B[i2] && (q = i2); - for (l = new Anb(a.a.b); l.a < l.c.c.length; ) { - k = RD(ynb(l), 30); - for (s = new Anb(k.a); s.a < s.c.c.length; ) { - r = RD(ynb(s), 10); - w2 = Kfb(d.p[r.p]) + Kfb(d.d[r.p]); - p[i2] = $wnd.Math.min(p[i2], w2); - o2[i2] = $wnd.Math.max(o2[i2], w2 + r.o.b); - } - } - } - A = $C(iE, vxe, 28, t, 15, 1); - for (j = 0; j < t; j++) { - (tFb(j, b.c.length), RD(b.c[j], 185)).o == (EQc(), CQc) ? A[j] = p[q] - p[j] : A[j] = o2[q] - o2[j]; - } - f2 = $C(iE, vxe, 28, t, 15, 1); - for (n = new Anb(a.a.b); n.a < n.c.c.length; ) { - m = RD(ynb(n), 30); - for (v = new Anb(m.a); v.a < v.c.c.length; ) { - u = RD(ynb(v), 10); - for (g = 0; g < t; g++) { - f2[g] = Kfb((tFb(g, b.c.length), RD(b.c[g], 185)).p[u.p]) + Kfb((tFb(g, b.c.length), RD(b.c[g], 185)).d[u.p]) + A[g]; - } - bFb(f2, heb(iob.prototype.Me, iob, [])); - e.p[u.p] = (f2[1] + f2[2]) / 2; - e.d[u.p] = 0; - } - } - return e; - } - function X6b(a, b, c2) { - var d, e, f2, g, h; - d = b.i; - f2 = a.i.o; - e = a.i.d; - h = a.n; - g = xjd(cD(WC(l3, 1), Nve, 8, 0, [h, a.a])); - switch (a.j.g) { - case 1: - SKb(b, (vLb(), sLb)); - d.d = -e.d - c2 - d.a; - if (RD(RD(Vmb(b.d, 0), 187).of((Ywc(), swc)), 291) == (Pnd(), Lnd)) { - RKb(b, (EKb(), DKb)); - d.c = g.a - Kfb(UD(mQb(a, ywc))) - c2 - d.b; - } else { - RKb(b, (EKb(), CKb)); - d.c = g.a + Kfb(UD(mQb(a, ywc))) + c2; - } - break; - case 2: - RKb(b, (EKb(), CKb)); - d.c = f2.a + e.c + c2; - if (RD(RD(Vmb(b.d, 0), 187).of((Ywc(), swc)), 291) == (Pnd(), Lnd)) { - SKb(b, (vLb(), sLb)); - d.d = g.b - Kfb(UD(mQb(a, ywc))) - c2 - d.a; - } else { - SKb(b, (vLb(), uLb)); - d.d = g.b + Kfb(UD(mQb(a, ywc))) + c2; - } - break; - case 3: - SKb(b, (vLb(), uLb)); - d.d = f2.b + e.a + c2; - if (RD(RD(Vmb(b.d, 0), 187).of((Ywc(), swc)), 291) == (Pnd(), Lnd)) { - RKb(b, (EKb(), DKb)); - d.c = g.a - Kfb(UD(mQb(a, ywc))) - c2 - d.b; - } else { - RKb(b, (EKb(), CKb)); - d.c = g.a + Kfb(UD(mQb(a, ywc))) + c2; - } - break; - case 4: - RKb(b, (EKb(), DKb)); - d.c = -e.b - c2 - d.b; - if (RD(RD(Vmb(b.d, 0), 187).of((Ywc(), swc)), 291) == (Pnd(), Lnd)) { - SKb(b, (vLb(), sLb)); - d.d = g.b - Kfb(UD(mQb(a, ywc))) - c2 - d.a; - } else { - SKb(b, (vLb(), uLb)); - d.d = g.b + Kfb(UD(mQb(a, ywc))) + c2; - } - } - } - function Q8c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - c2.Ug(AFe, 1); - !b.a && (b.a = new C5d(J4, b, 10, 11)); - d = Kfb(UD(Gxd(b, (X7c(), x7c)))); - k = Kfb(UD(Gxd(b, Q7c))); - m = RD(Gxd(b, N7c), 107); - n = new m9c(d, k); - f2 = l9c(n, b, m); - P8c(b, n); - h = RD(Gxd(b, K7c), 17).a; - while (h > 1) { - e = N8c(b); - l = f2.g; - o2 = RD(Gxd(b, N7c), 107); - p = Kfb(UD(Gxd(b, x7c))); - (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i > 1 && Kfb(UD(Gxd(b, (X6c(), T6c)))) != oxe && (f2.c + (o2.b + o2.c)) / (f2.b + (o2.d + o2.a)) < p ? Ixd(e, (X6c(), W6c), Kfb(UD(Gxd(b, W6c))) + Kfb(UD(Gxd(b, T6c)))) : (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i > 1 && Kfb(UD(Gxd(b, (X6c(), S6c)))) != oxe && (f2.c + (o2.b + o2.c)) / (f2.b + (o2.d + o2.a)) > p && Ixd(e, (X6c(), W6c), $wnd.Math.max(Kfb(UD(Gxd(b, U6c))), Kfb(UD(Gxd(e, W6c))) - Kfb(UD(Gxd(b, S6c))))); - n = new m9c(d, k); - i2 = l9c(n, e, m); - j = i2.g; - if (j >= l && j == j) { - for (g = 0; g < (!e.a && (e.a = new C5d(J4, e, 10, 11)), e.a).i; g++) { - O8c(a, RD(QHd((!e.a && (e.a = new C5d(J4, e, 10, 11)), e.a), g), 27), RD(QHd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a), g), 27)); - } - P8c(b, n); - jad(f2, i2.c); - iad(f2, i2.b); - } - --h; - } - Ixd(b, (X6c(), N6c), f2.b); - Ixd(b, O6c, f2.c); - c2.Vg(); - } - function fHc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s; - b.Ug("Interactive node layering", 1); - c2 = new bnb(); - for (m = new Anb(a.a); m.a < m.c.c.length; ) { - k = RD(ynb(m), 10); - i2 = k.n.a; - h = i2 + k.o.a; - h = $wnd.Math.max(i2 + 1, h); - s = new Jkb(c2, 0); - d = null; - while (s.b < s.d.gc()) { - q = (sFb(s.b < s.d.gc()), RD(s.d.Xb(s.c = s.b++), 578)); - if (q.c >= h) { - sFb(s.b > 0); - s.a.Xb(s.c = --s.b); - break; - } else if (q.a > i2) { - if (!d) { - Rmb(q.b, k); - q.c = $wnd.Math.min(q.c, i2); - q.a = $wnd.Math.max(q.a, h); - d = q; - } else { - Tmb(d.b, q.b); - d.a = $wnd.Math.max(d.a, q.a); - Ckb(s); - } - } - } - if (!d) { - d = new jHc(); - d.c = i2; - d.a = h; - Ikb(s, d); - Rmb(d.b, k); - } - } - g = a.b; - j = 0; - for (r = new Anb(c2); r.a < r.c.c.length; ) { - q = RD(ynb(r), 578); - e = new R4b(a); - e.p = j++; - ZEb(g.c, e); - for (n = new Anb(q.b); n.a < n.c.c.length; ) { - k = RD(ynb(n), 10); - g3b(k, e); - k.p = 0; - } - } - for (l = new Anb(a.a); l.a < l.c.c.length; ) { - k = RD(ynb(l), 10); - if (k.p == 0) { - p = eHc(k, a); - while (p.a.gc() != 0) { - o2 = RD(p.a.ec().Kc().Pb(), 10); - p.a.Bc(o2) != null; - ye(p, eHc(o2, a)); - } - } - } - f2 = new Jkb(g, 0); - while (f2.b < f2.d.gc()) { - (sFb(f2.b < f2.d.gc()), RD(f2.d.Xb(f2.c = f2.b++), 30)).a.c.length == 0 && Ckb(f2); - } - a.a.c.length = 0; - b.Vg(); - } - function grd(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I; - n = 0; - D5 = 0; - for (i2 = new Anb(a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 27); - Dsd(h); - n = $wnd.Math.max(n, h.g); - D5 += h.g * h.f; - } - o2 = D5 / a.c.length; - C = ard(a, o2); - D5 += a.c.length * C; - n = $wnd.Math.max(n, $wnd.Math.sqrt(D5 * g)) + c2.b; - H = c2.b; - I = c2.d; - m = 0; - k = c2.b + c2.c; - B = new Yub(); - Mub(B, sgb(0)); - w2 = new Yub(); - j = new Jkb(a, 0); - while (j.b < j.d.gc()) { - h = (sFb(j.b < j.d.gc()), RD(j.d.Xb(j.c = j.b++), 27)); - G = h.g; - l = h.f; - if (H + G > n) { - if (f2) { - Oub(w2, m); - Oub(B, sgb(j.b - 1)); - } - H = c2.b; - I += m + b; - m = 0; - k = $wnd.Math.max(k, c2.b + c2.c + G); - } - Dyd(h, H); - Eyd(h, I); - k = $wnd.Math.max(k, H + G + c2.c); - m = $wnd.Math.max(m, l); - H += G + b; - } - k = $wnd.Math.max(k, d); - F = I + m + c2.a; - if (F < e) { - m += e - F; - F = e; - } - if (f2) { - H = c2.b; - j = new Jkb(a, 0); - Oub(B, sgb(a.c.length)); - A = Sub(B, 0); - r = RD(evb(A), 17).a; - Oub(w2, m); - v = Sub(w2, 0); - u = 0; - while (j.b < j.d.gc()) { - if (j.b == r) { - H = c2.b; - u = Kfb(UD(evb(v))); - r = RD(evb(A), 17).a; - } - h = (sFb(j.b < j.d.gc()), RD(j.d.Xb(j.c = j.b++), 27)); - s = h.f; - Ayd(h, u); - p = u; - if (j.b == r) { - q = k - H - c2.c; - t = h.g; - Cyd(h, q); - Jsd(h, new rjd(q, p), new rjd(t, s)); - } - H += h.g + b; - } - } - return new rjd(k, F); - } - function h0b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C; - b.Ug("Compound graph postprocessor", 1); - c2 = Heb(TD(mQb(a, (yCc(), mCc)))); - h = RD(mQb(a, (Ywc(), _vc)), 229); - k = new _sb(); - for (r = h.ec().Kc(); r.Ob(); ) { - q = RD(r.Pb(), 18); - g = new dnb(h.cc(q)); - yob(); - _mb(g, new M0b(a)); - v = H0b((tFb(0, g.c.length), RD(g.c[0], 249))); - A = I0b(RD(Vmb(g, g.c.length - 1), 249)); - t = v.i; - n2b(A.i, t) ? s = t.e : s = Y2b(t); - l = i0b(q, g); - Xub(q.a); - m = null; - for (f2 = new Anb(g); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 249); - p = new pjd(); - e2b(p, e.a, s); - n = e.b; - d = new Ejd(); - Ajd(d, 0, n.a); - Cjd(d, p); - u = new sjd(K3b(n.c)); - w2 = new sjd(K3b(n.d)); - $id(u, p); - $id(w2, p); - if (m) { - d.b == 0 ? o2 = w2 : o2 = (sFb(d.b != 0), RD(d.a.a.c, 8)); - B = $wnd.Math.abs(m.a - o2.a) > Vze; - C = $wnd.Math.abs(m.b - o2.b) > Vze; - (!c2 && B && C || c2 && (B || C)) && Mub(q.a, u); - } - ye(q.a, d); - d.b == 0 ? m = u : m = (sFb(d.b != 0), RD(d.c.b.c, 8)); - j0b(n, l, p); - if (I0b(e) == A) { - if (Y2b(A.i) != e.a) { - p = new pjd(); - e2b(p, Y2b(A.i), s); - } - pQb(q, Wwc, p); - } - k0b(n, q, s); - k.a.zc(n, k); - } - Y0b(q, v); - Z0b(q, A); - } - for (j = k.a.ec().Kc(); j.Ob(); ) { - i2 = RD(j.Pb(), 18); - Y0b(i2, null); - Z0b(i2, null); - } - b.Vg(); - } - function lXc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - e = RD(mQb(a, (h_c(), H$c)), 88); - k = e == (Cmd(), ymd) || e == zmd ? xmd : zmd; - c2 = RD(zDb(CDb(new SDb(null, new Swb(a.b, 16)), new $Xc()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - i2 = RD(zDb(GDb(c2.Oc(), new aYc(b)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 15); - i2.Gc(RD(zDb(GDb(c2.Oc(), new cYc(b)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 16)); - i2.jd(new eYc(k)); - m = new yAb(new iYc(e)); - d = new Tsb(); - for (h = i2.Kc(); h.Ob(); ) { - g = RD(h.Pb(), 240); - j = RD(g.a, 40); - if (Heb(TD(g.c))) { - m.a.zc(j, (Geb(), Eeb)) == null; - new zAb(m.a.Zc(j, false)).a.gc() > 0 && Zjb(d, j, RD(new zAb(m.a.Zc(j, false)).a.Vc(), 40)); - new zAb(m.a.ad(j, true)).a.gc() > 1 && Zjb(d, nXc(m, j), j); - } else { - if (new zAb(m.a.Zc(j, false)).a.gc() > 0) { - f2 = RD(new zAb(m.a.Zc(j, false)).a.Vc(), 40); - dE(f2) === dE(Wd(qtb(d.f, j))) && RD(mQb(j, (q$c(), TZc)), 15).Fc(f2); - } - if (new zAb(m.a.ad(j, true)).a.gc() > 1) { - l = nXc(m, j); - dE(Wd(qtb(d.f, l))) === dE(j) && RD(mQb(l, (q$c(), TZc)), 15).Fc(j); - } - m.a.Bc(j) != null; - } - } - } - function BTb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - if (a.gc() == 1) { - return RD(a.Xb(0), 235); - } else if (a.gc() <= 0) { - return new gUb(); - } - for (e = a.Kc(); e.Ob(); ) { - c2 = RD(e.Pb(), 235); - o2 = 0; - k = lve; - l = lve; - i2 = qwe; - j = qwe; - for (n = new Anb(c2.e); n.a < n.c.c.length; ) { - m = RD(ynb(n), 153); - o2 += RD(mQb(m, (yVb(), lVb)), 17).a; - k = $wnd.Math.min(k, m.d.a - m.e.a / 2); - l = $wnd.Math.min(l, m.d.b - m.e.b / 2); - i2 = $wnd.Math.max(i2, m.d.a + m.e.a / 2); - j = $wnd.Math.max(j, m.d.b + m.e.b / 2); - } - pQb(c2, (yVb(), lVb), sgb(o2)); - pQb(c2, (JVb(), GVb), new rjd(k, l)); - pQb(c2, FVb, new rjd(i2, j)); - } - yob(); - a.jd(new FTb()); - p = new gUb(); - kQb(p, RD(a.Xb(0), 96)); - h = 0; - s = 0; - for (f2 = a.Kc(); f2.Ob(); ) { - c2 = RD(f2.Pb(), 235); - q = ojd(ajd(RD(mQb(c2, (JVb(), FVb)), 8)), RD(mQb(c2, GVb), 8)); - h = $wnd.Math.max(h, q.a); - s += q.a * q.b; - } - h = $wnd.Math.max(h, $wnd.Math.sqrt(s) * Kfb(UD(mQb(p, (yVb(), ZUb))))); - r = Kfb(UD(mQb(p, rVb))); - t = 0; - u = 0; - g = 0; - b = r; - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 235); - q = ojd(ajd(RD(mQb(c2, (JVb(), FVb)), 8)), RD(mQb(c2, GVb), 8)); - if (t + q.a > h) { - t = 0; - u += g + r; - g = 0; - } - ATb(p, c2, t, u); - b = $wnd.Math.max(b, t + q.a); - g = $wnd.Math.max(g, q.b); - t += q.a + r; - } - return p; - } - function Aqe(a) { - zqe(); - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - if (a == null) - return null; - f2 = Ahb(a); - o2 = Dqe(f2); - if (o2 % 4 != 0) { - return null; - } - p = o2 / 4 | 0; - if (p == 0) - return $C(gE, YHe, 28, 0, 15, 1); - l = null; - b = 0; - c2 = 0; - d = 0; - e = 0; - g = 0; - h = 0; - i2 = 0; - j = 0; - n = 0; - m = 0; - k = 0; - l = $C(gE, YHe, 28, p * 3, 15, 1); - for (; n < p - 1; n++) { - if (!Cqe(g = f2[k++]) || !Cqe(h = f2[k++]) || !Cqe(i2 = f2[k++]) || !Cqe(j = f2[k++])) - return null; - b = xqe[g]; - c2 = xqe[h]; - d = xqe[i2]; - e = xqe[j]; - l[m++] = (b << 2 | c2 >> 4) << 24 >> 24; - l[m++] = ((c2 & 15) << 4 | d >> 2 & 15) << 24 >> 24; - l[m++] = (d << 6 | e) << 24 >> 24; - } - if (!Cqe(g = f2[k++]) || !Cqe(h = f2[k++])) { - return null; - } - b = xqe[g]; - c2 = xqe[h]; - i2 = f2[k++]; - j = f2[k++]; - if (xqe[i2] == -1 || xqe[j] == -1) { - if (i2 == 61 && j == 61) { - if ((c2 & 15) != 0) - return null; - q = $C(gE, YHe, 28, n * 3 + 1, 15, 1); - hib(l, 0, q, 0, n * 3); - q[m] = (b << 2 | c2 >> 4) << 24 >> 24; - return q; - } else if (i2 != 61 && j == 61) { - d = xqe[i2]; - if ((d & 3) != 0) - return null; - q = $C(gE, YHe, 28, n * 3 + 2, 15, 1); - hib(l, 0, q, 0, n * 3); - q[m++] = (b << 2 | c2 >> 4) << 24 >> 24; - q[m] = ((c2 & 15) << 4 | d >> 2 & 15) << 24 >> 24; - return q; - } else { - return null; - } - } else { - d = xqe[i2]; - e = xqe[j]; - l[m++] = (b << 2 | c2 >> 4) << 24 >> 24; - l[m++] = ((c2 & 15) << 4 | d >> 2 & 15) << 24 >> 24; - l[m++] = (d << 6 | e) << 24 >> 24; - } - return l; - } - function wfc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v; - b.Ug(qBe, 1); - o2 = RD(mQb(a, (yCc(), yAc)), 223); - for (e = new Anb(a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 30); - j = t2b(d.a); - for (g = j, h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - if (f2.k != (r3b(), q3b)) { - continue; - } - if (o2 == (Ymd(), Wmd)) { - for (l = new Anb(f2.j); l.a < l.c.c.length; ) { - k = RD(ynb(l), 12); - k.e.c.length == 0 || zfc(k); - k.g.c.length == 0 || Afc(k); - } - } else if (ZD(mQb(f2, (Ywc(), Awc)), 18)) { - q = RD(mQb(f2, Awc), 18); - r = RD(e3b(f2, (qpd(), ppd)).Kc().Pb(), 12); - s = RD(e3b(f2, Xod).Kc().Pb(), 12); - t = RD(mQb(r, Awc), 12); - u = RD(mQb(s, Awc), 12); - Y0b(q, u); - Z0b(q, t); - v = new sjd(s.i.n); - v.a = xjd(cD(WC(l3, 1), Nve, 8, 0, [u.i.n, u.n, u.a])).a; - Mub(q.a, v); - v = new sjd(r.i.n); - v.a = xjd(cD(WC(l3, 1), Nve, 8, 0, [t.i.n, t.n, t.a])).a; - Mub(q.a, v); - } else { - if (f2.j.c.length >= 2) { - p = true; - m = new Anb(f2.j); - c2 = RD(ynb(m), 12); - n = null; - while (m.a < m.c.c.length) { - n = c2; - c2 = RD(ynb(m), 12); - if (!pb(mQb(n, Awc), mQb(c2, Awc))) { - p = false; - break; - } - } - } else { - p = false; - } - for (l = new Anb(f2.j); l.a < l.c.c.length; ) { - k = RD(ynb(l), 12); - k.e.c.length == 0 || xfc(k, p); - k.g.c.length == 0 || yfc(k, p); - } - } - g3b(f2, null); - } - } - b.Vg(); - } - function LQc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v; - for (h = new Anb(a.a.b); h.a < h.c.c.length; ) { - f2 = RD(ynb(h), 30); - for (t = new Anb(f2.a); t.a < t.c.c.length; ) { - s = RD(ynb(t), 10); - b.g[s.p] = s; - b.a[s.p] = s; - b.d[s.p] = 0; - } - } - i2 = a.a.b; - b.c == (wQc(), uQc) && (i2 = hv(i2)); - for (g = i2.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 30); - n = -1; - m = f2.a; - if (b.o == (EQc(), DQc)) { - n = lve; - m = hv(m); - } - for (v = m.Kc(); v.Ob(); ) { - u = RD(v.Pb(), 10); - l = null; - b.c == uQc ? l = RD(Vmb(a.b.f, u.p), 15) : l = RD(Vmb(a.b.b, u.p), 15); - if (l.gc() > 0) { - d = l.gc(); - j = eE($wnd.Math.floor((d + 1) / 2)) - 1; - e = eE($wnd.Math.ceil((d + 1) / 2)) - 1; - if (b.o == DQc) { - for (k = e; k >= j; k--) { - if (b.a[u.p] == u) { - p = RD(l.Xb(k), 42); - o2 = RD(p.a, 10); - if (!Zsb(c2, p.b) && n > a.b.e[o2.p]) { - b.a[o2.p] = u; - b.g[u.p] = b.g[o2.p]; - b.a[u.p] = b.g[u.p]; - b.f[b.g[u.p].p] = (Geb(), Heb(b.f[b.g[u.p].p]) & u.k == (r3b(), o3b) ? true : false); - n = a.b.e[o2.p]; - } - } - } - } else { - for (k = j; k <= e; k++) { - if (b.a[u.p] == u) { - r = RD(l.Xb(k), 42); - q = RD(r.a, 10); - if (!Zsb(c2, r.b) && n < a.b.e[q.p]) { - b.a[q.p] = u; - b.g[u.p] = b.g[q.p]; - b.a[u.p] = b.g[u.p]; - b.f[b.g[u.p].p] = (Geb(), Heb(b.f[b.g[u.p].p]) & u.k == (r3b(), o3b) ? true : false); - n = a.b.e[q.p]; - } - } - } - } - } - } - } - } - function iOc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B; - t = a.c[(tFb(0, b.c.length), RD(b.c[0], 18)).p]; - A = a.c[(tFb(1, b.c.length), RD(b.c[1], 18)).p]; - if (t.a.e.e - t.a.a - (t.b.e.e - t.b.a) == 0 && A.a.e.e - A.a.a - (A.b.e.e - A.b.a) == 0) { - return false; - } - r = t.b.e.f; - if (!ZD(r, 10)) { - return false; - } - q = RD(r, 10); - v = a.i[q.p]; - w2 = !q.c ? -1 : Wmb(q.c.a, q, 0); - f2 = oxe; - if (w2 > 0) { - e = RD(Vmb(q.c.a, w2 - 1), 10); - g = a.i[e.p]; - B = $wnd.Math.ceil(bFc(a.n, e, q)); - f2 = v.a.e - q.d.d - (g.a.e + e.o.b + e.d.a) - B; - } - j = oxe; - if (w2 < q.c.a.c.length - 1) { - i2 = RD(Vmb(q.c.a, w2 + 1), 10); - k = a.i[i2.p]; - B = $wnd.Math.ceil(bFc(a.n, i2, q)); - j = k.a.e - i2.d.d - (v.a.e + q.o.b + q.d.a) - B; - } - if (c2 && (Zy(), bz(vEe), $wnd.Math.abs(f2 - j) <= vEe || f2 == j || isNaN(f2) && isNaN(j))) { - return true; - } - d = GOc(t.a); - h = -GOc(t.b); - l = -GOc(A.a); - s = GOc(A.b); - p = t.a.e.e - t.a.a - (t.b.e.e - t.b.a) > 0 && A.a.e.e - A.a.a - (A.b.e.e - A.b.a) < 0; - o2 = t.a.e.e - t.a.a - (t.b.e.e - t.b.a) < 0 && A.a.e.e - A.a.a - (A.b.e.e - A.b.a) > 0; - n = t.a.e.e + t.b.a < A.b.e.e + A.a.a; - m = t.a.e.e + t.b.a > A.b.e.e + A.a.a; - u = 0; - !p && !o2 && (m ? f2 + l > 0 ? u = l : j - d > 0 && (u = d) : n && (f2 + h > 0 ? u = h : j - s > 0 && (u = s))); - v.a.e += u; - v.b && (v.d.e += u); - return false; - } - function OJb(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - d = new Uid2(b.Lf().a, b.Lf().b, b.Mf().a, b.Mf().b); - e = new Tid(); - if (a.c) { - for (g = new Anb(b.Rf()); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 187); - e.c = f2.Lf().a + b.Lf().a; - e.d = f2.Lf().b + b.Lf().b; - e.b = f2.Mf().a; - e.a = f2.Mf().b; - Sid(d, e); - } - } - for (j = new Anb(b.Xf()); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 852); - k = i2.Lf().a + b.Lf().a; - l = i2.Lf().b + b.Lf().b; - if (a.e) { - e.c = k; - e.d = l; - e.b = i2.Mf().a; - e.a = i2.Mf().b; - Sid(d, e); - } - if (a.d) { - for (g = new Anb(i2.Rf()); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 187); - e.c = f2.Lf().a + k; - e.d = f2.Lf().b + l; - e.b = f2.Mf().a; - e.a = f2.Mf().b; - Sid(d, e); - } - } - if (a.b) { - m = new rjd(-c2, -c2); - if (RD(b.of((umd(), Lld)), 181).Hc((Pod(), Nod))) { - for (g = new Anb(i2.Rf()); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 187); - m.a += f2.Mf().a + c2; - m.b += f2.Mf().b + c2; - } - } - m.a = $wnd.Math.max(m.a, 0); - m.b = $wnd.Math.max(m.b, 0); - MJb(d, i2.Wf(), i2.Uf(), b, i2, m, c2); - } - } - a.b && MJb(d, b.Wf(), b.Uf(), b, null, null, c2); - h = new S2b(b.Vf()); - h.d = $wnd.Math.max(0, b.Lf().b - d.d); - h.a = $wnd.Math.max(0, d.d + d.a - (b.Lf().b + b.Mf().b)); - h.b = $wnd.Math.max(0, b.Lf().a - d.c); - h.c = $wnd.Math.max(0, d.c + d.b - (b.Lf().a + b.Mf().a)); - b.Zf(h); - } - function Mz() { - var a = ["\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000B", "\\f", "\\r", "\\u000E", "\\u000F", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001A", "\\u001B", "\\u001C", "\\u001D", "\\u001E", "\\u001F"]; - a[34] = '\\"'; - a[92] = "\\\\"; - a[173] = "\\u00ad"; - a[1536] = "\\u0600"; - a[1537] = "\\u0601"; - a[1538] = "\\u0602"; - a[1539] = "\\u0603"; - a[1757] = "\\u06dd"; - a[1807] = "\\u070f"; - a[6068] = "\\u17b4"; - a[6069] = "\\u17b5"; - a[8203] = "\\u200b"; - a[8204] = "\\u200c"; - a[8205] = "\\u200d"; - a[8206] = "\\u200e"; - a[8207] = "\\u200f"; - a[8232] = "\\u2028"; - a[8233] = "\\u2029"; - a[8234] = "\\u202a"; - a[8235] = "\\u202b"; - a[8236] = "\\u202c"; - a[8237] = "\\u202d"; - a[8238] = "\\u202e"; - a[8288] = "\\u2060"; - a[8289] = "\\u2061"; - a[8290] = "\\u2062"; - a[8291] = "\\u2063"; - a[8292] = "\\u2064"; - a[8298] = "\\u206a"; - a[8299] = "\\u206b"; - a[8300] = "\\u206c"; - a[8301] = "\\u206d"; - a[8302] = "\\u206e"; - a[8303] = "\\u206f"; - a[65279] = "\\ufeff"; - a[65529] = "\\ufff9"; - a[65530] = "\\ufffa"; - a[65531] = "\\ufffb"; - return a; - } - function zVb(a) { - Cgd(a, new Pfd(_fd(Wfd($fd(Xfd(Zfd(Yfd(new agd(), Zze), "ELK Force"), "Force-based algorithm provided by the Eclipse Layout Kernel. Implements methods that follow physical analogies by simulating forces that move the nodes into a balanced distribution. Currently the original Eades model and the Fruchterman - Reingold model are supported."), new CVb()), Zze), ysb((aGd(), ZFd), cD(WC(T5, 1), jwe, 245, 0, [XFd]))))); - Agd(a, Zze, $ze, sgb(1)); - Agd(a, Zze, _ze, 80); - Agd(a, Zze, aAe, 5); - Agd(a, Zze, Dze, Yze); - Agd(a, Zze, bAe, sgb(1)); - Agd(a, Zze, cAe, (Geb(), true)); - Agd(a, Zze, Eze, iVb); - Agd(a, Zze, dAe, iGd(_Ub)); - Agd(a, Zze, eAe, iGd(jVb)); - Agd(a, Zze, fAe, false); - Agd(a, Zze, gAe, iGd(gVb)); - Agd(a, Zze, hAe, iGd(eVb)); - Agd(a, Zze, iAe, iGd(fVb)); - Agd(a, Zze, jAe, iGd(dVb)); - Agd(a, Zze, kAe, iGd(cVb)); - Agd(a, Zze, lAe, iGd(kVb)); - Agd(a, Zze, Rze, iGd(bVb)); - Agd(a, Zze, Uze, iGd(sVb)); - Agd(a, Zze, Sze, iGd(aVb)); - Agd(a, Zze, Wze, iGd(nVb)); - Agd(a, Zze, Tze, iGd(oVb)); - Agd(a, Zze, mAe, iGd(vVb)); - Agd(a, Zze, nAe, iGd(xVb)); - Agd(a, Zze, oAe, iGd(uVb)); - Agd(a, Zze, pAe, iGd(tVb)); - Agd(a, Zze, qAe, wVb); - } - function hte(a, b) { - Vse(); - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - if (bkb(wse) == 0) { - l = $C(qdb, Nve, 122, yse.length, 0, 1); - for (g = 0; g < l.length; g++) { - l[g] = new xte(4); - } - d = new Rhb(); - for (f2 = 0; f2 < vse.length; f2++) { - k = new xte(4); - if (f2 < 84) { - h = f2 * 2; - n = (BFb(h, XLe.length), XLe.charCodeAt(h)); - m = (BFb(h + 1, XLe.length), XLe.charCodeAt(h + 1)); - rte(k, n, m); - } else { - h = (f2 - 84) * 2; - rte(k, zse[h], zse[h + 1]); - } - i2 = vse[f2]; - lhb(i2, "Specials") && rte(k, 65520, 65533); - if (lhb(i2, VLe)) { - rte(k, 983040, 1048573); - rte(k, 1048576, 1114109); - } - $jb(wse, i2, k); - $jb(xse, i2, yte(k)); - j = d.a.length; - 0 < j ? d.a = zhb(d.a, 0, 0) : 0 > j && (d.a += Hhb($C(hE, zwe, 28, -j, 15, 1))); - d.a += "Is"; - if (qhb(i2, Fhb(32)) >= 0) { - for (e = 0; e < i2.length; e++) { - BFb(e, i2.length); - i2.charCodeAt(e) != 32 && Jhb(d, (BFb(e, i2.length), i2.charCodeAt(e))); - } - } else { - d.a += "" + i2; - } - lte(d.a, i2, true); - } - lte(WLe, "Cn", false); - lte(YLe, "Cn", true); - c2 = new xte(4); - rte(c2, 0, MLe); - $jb(wse, "ALL", c2); - $jb(xse, "ALL", yte(c2)); - !Ase && (Ase = new Tsb()); - $jb(Ase, WLe, WLe); - !Ase && (Ase = new Tsb()); - $jb(Ase, YLe, YLe); - !Ase && (Ase = new Tsb()); - $jb(Ase, "ALL", "ALL"); - } - o2 = b ? RD(Xjb(wse, a), 138) : RD(Xjb(xse, a), 138); - return o2; - } - function i_c(a) { - Cgd(a, new Pfd(_fd(Wfd($fd(Xfd(Zfd(Yfd(new agd(), ZEe), "ELK Mr. Tree"), "Tree-based algorithm provided by the Eclipse Layout Kernel. Computes a spanning tree of the input graph and arranges all nodes according to the resulting parent-children hierarchy. I pity the fool who doesn't use Mr. Tree Layout."), new l_c()), $Ee), xsb((aGd(), WFd))))); - Agd(a, ZEe, Eze, U$c); - Agd(a, ZEe, _ze, 20); - Agd(a, ZEe, ADe, 3); - Agd(a, ZEe, Dze, Yze); - Agd(a, ZEe, $ze, sgb(1)); - Agd(a, ZEe, cAe, (Geb(), true)); - Agd(a, ZEe, LDe, iGd(G$c)); - Agd(a, ZEe, PDe, I$c); - Agd(a, ZEe, dAe, iGd(L$c)); - Agd(a, ZEe, iEe, iGd(M$c)); - Agd(a, ZEe, jAe, iGd(O$c)); - Agd(a, ZEe, hAe, iGd(P$c)); - Agd(a, ZEe, CAe, iGd(Q$c)); - Agd(a, ZEe, iAe, iGd(R$c)); - Agd(a, ZEe, kAe, iGd(N$c)); - Agd(a, ZEe, gAe, iGd(S$c)); - Agd(a, ZEe, lAe, iGd(V$c)); - Agd(a, ZEe, VEe, iGd(g_c)); - Agd(a, ZEe, XEe, iGd(Y$c)); - Agd(a, ZEe, mAe, iGd(c_c)); - Agd(a, ZEe, nAe, iGd(e_c)); - Agd(a, ZEe, oAe, iGd(b_c)); - Agd(a, ZEe, pAe, iGd(a_c)); - Agd(a, ZEe, qAe, d_c); - Agd(a, ZEe, UEe, iGd(W$c)); - Agd(a, ZEe, WEe, iGd(K$c)); - Agd(a, ZEe, TEe, iGd(f_c)); - Agd(a, ZEe, REe, iGd(F$c)); - Agd(a, ZEe, SEe, iGd(J$c)); - } - function rNb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - j = RD(RD(Qc(a.r, b), 21), 87); - g = UMb(a, b); - c2 = a.u.Hc((Pod(), Jod)); - for (i2 = j.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 117); - if (!h.c || h.c.d.c.length <= 0) { - continue; - } - m = h.b.Mf(); - k = h.c; - l = k.i; - l.b = (f2 = k.n, k.e.a + f2.b + f2.c); - l.a = (e = k.n, k.e.b + e.d + e.a); - switch (b.g) { - case 1: - if (h.a) { - l.c = (m.a - l.b) / 2; - RKb(k, (EKb(), BKb)); - } else if (g || c2) { - l.c = -l.b - a.s; - RKb(k, (EKb(), DKb)); - } else { - l.c = m.a + a.s; - RKb(k, (EKb(), CKb)); - } - l.d = -l.a - a.t; - SKb(k, (vLb(), sLb)); - break; - case 3: - if (h.a) { - l.c = (m.a - l.b) / 2; - RKb(k, (EKb(), BKb)); - } else if (g || c2) { - l.c = -l.b - a.s; - RKb(k, (EKb(), DKb)); - } else { - l.c = m.a + a.s; - RKb(k, (EKb(), CKb)); - } - l.d = m.b + a.t; - SKb(k, (vLb(), uLb)); - break; - case 2: - if (h.a) { - d = a.v ? l.a : RD(Vmb(k.d, 0), 187).Mf().b; - l.d = (m.b - d) / 2; - SKb(k, (vLb(), tLb)); - } else if (g || c2) { - l.d = -l.a - a.t; - SKb(k, (vLb(), sLb)); - } else { - l.d = m.b + a.t; - SKb(k, (vLb(), uLb)); - } - l.c = m.a + a.s; - RKb(k, (EKb(), CKb)); - break; - case 4: - if (h.a) { - d = a.v ? l.a : RD(Vmb(k.d, 0), 187).Mf().b; - l.d = (m.b - d) / 2; - SKb(k, (vLb(), tLb)); - } else if (g || c2) { - l.d = -l.a - a.t; - SKb(k, (vLb(), sLb)); - } else { - l.d = m.b + a.t; - SKb(k, (vLb(), uLb)); - } - l.c = -l.b - a.s; - RKb(k, (EKb(), DKb)); - } - g = false; - } - } - function t6b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s; - m = false; - l = false; - if (Dod(RD(mQb(d, (yCc(), BBc)), 101))) { - g = false; - h = false; - t: - for (o2 = new Anb(d.j); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 12); - for (q = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [new T3b(n), new _3b(n)]))); gs(q); ) { - p = RD(hs(q), 12); - if (!Heb(TD(mQb(p.i, Uzc)))) { - if (n.j == (qpd(), Yod)) { - g = true; - break t; - } - if (n.j == npd) { - h = true; - break t; - } - } - } - } - m = h && !g; - l = g && !h; - } - if (!m && !l && d.b.c.length != 0) { - k = 0; - for (j = new Anb(d.b); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 72); - k += i2.n.b + i2.o.b / 2; - } - k /= d.b.c.length; - s = k >= d.o.b / 2; - } else { - s = !l; - } - if (s) { - r = RD(mQb(d, (Ywc(), Xwc)), 15); - if (!r) { - f2 = new bnb(); - pQb(d, Xwc, f2); - } else if (m) { - f2 = r; - } else { - e = RD(mQb(d, Vvc), 15); - if (!e) { - f2 = new bnb(); - pQb(d, Vvc, f2); - } else { - r.gc() <= e.gc() ? f2 = r : f2 = e; - } - } - } else { - e = RD(mQb(d, (Ywc(), Vvc)), 15); - if (!e) { - f2 = new bnb(); - pQb(d, Vvc, f2); - } else if (l) { - f2 = e; - } else { - r = RD(mQb(d, Xwc), 15); - if (!r) { - f2 = new bnb(); - pQb(d, Xwc, f2); - } else { - e.gc() <= r.gc() ? f2 = e : f2 = r; - } - } - } - f2.Fc(a); - pQb(a, (Ywc(), Xvc), c2); - if (b.d == c2) { - Z0b(b, null); - c2.e.c.length + c2.g.c.length == 0 && P3b(c2, null); - u6b(c2); - } else { - Y0b(b, null); - c2.e.c.length + c2.g.c.length == 0 && P3b(c2, null); - } - Xub(b.a); - } - function GHc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I; - c2.Ug("MinWidth layering", 1); - n = b.b; - A = b.a; - I = RD(mQb(b, (yCc(), WAc)), 17).a; - h = RD(mQb(b, XAc), 17).a; - a.b = Kfb(UD(mQb(b, TBc))); - a.d = oxe; - for (u = new Anb(A); u.a < u.c.c.length; ) { - s = RD(ynb(u), 10); - if (s.k != (r3b(), p3b)) { - continue; - } - D5 = s.o.b; - a.d = $wnd.Math.min(a.d, D5); - } - a.d = $wnd.Math.max(1, a.d); - B = A.c.length; - a.c = $C(kE, Pwe, 28, B, 15, 1); - a.f = $C(kE, Pwe, 28, B, 15, 1); - a.e = $C(iE, vxe, 28, B, 15, 1); - j = 0; - a.a = 0; - for (v = new Anb(A); v.a < v.c.c.length; ) { - s = RD(ynb(v), 10); - s.p = j++; - a.c[s.p] = EHc(Z2b(s)); - a.f[s.p] = EHc(a3b(s)); - a.e[s.p] = s.o.b / a.d; - a.a += a.e[s.p]; - } - a.b /= a.d; - a.a /= B; - w2 = FHc(A); - _mb(A, Fob(new MHc(a))); - p = oxe; - o2 = lve; - g = null; - H = I; - G = I; - f2 = h; - e = h; - if (I < 0) { - H = RD(BHc.a.Id(), 17).a; - G = RD(BHc.b.Id(), 17).a; - } - if (h < 0) { - f2 = RD(AHc.a.Id(), 17).a; - e = RD(AHc.b.Id(), 17).a; - } - for (F = H; F <= G; F++) { - for (d = f2; d <= e; d++) { - C = DHc(a, F, d, A, w2); - r = Kfb(UD(C.a)); - m = RD(C.b, 15); - q = m.gc(); - if (r < p || r == p && q < o2) { - p = r; - o2 = q; - g = m; - } - } - } - for (l = g.Kc(); l.Ob(); ) { - k = RD(l.Pb(), 15); - i2 = new R4b(b); - for (t = k.Kc(); t.Ob(); ) { - s = RD(t.Pb(), 10); - g3b(s, i2); - } - ZEb(n.c, i2); - } - Eob(n); - A.c.length = 0; - c2.Vg(); - } - function UUc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G; - c2.Ug("Spline edge routing", 1); - if (b.b.c.length == 0) { - b.f.a = 0; - c2.Vg(); - return; - } - s = Kfb(UD(mQb(b, (yCc(), cCc)))); - h = Kfb(UD(mQb(b, XBc))); - g = Kfb(UD(mQb(b, UBc))); - r = RD(mQb(b, DAc), 350); - B = r == (lFc(), kFc); - A = Kfb(UD(mQb(b, EAc))); - a.d = b; - a.j.c.length = 0; - a.a.c.length = 0; - akb(a.k); - i2 = RD(Vmb(b.b, 0), 30); - k = ar(i2.a, (dSc(), bSc)); - o2 = RD(Vmb(b.b, b.b.c.length - 1), 30); - l = ar(o2.a, bSc); - p = new Anb(b.b); - q = null; - G = 0; - do { - t = p.a < p.c.c.length ? RD(ynb(p), 30) : null; - IUc(a, q, t); - LUc(a); - C = cwb(nDb(IDb(CDb(new SDb(null, new Swb(a.i, 16)), new jVc()), new lVc()))); - F = 0; - u = G; - m = !q || k && q == i2; - n = !t || l && t == o2; - if (C > 0) { - j = 0; - !!q && (j += h); - j += (C - 1) * g; - !!t && (j += h); - B && !!t && (j = $wnd.Math.max(j, JUc(t, g, s, A))); - if (j < s && !m && !n) { - F = (s - j) / 2; - j = s; - } - u += j; - } else - !m && !n && (u += s); - !!t && p2b(t, u); - for (w2 = new Anb(a.i); w2.a < w2.c.c.length; ) { - v = RD(ynb(w2), 131); - v.a.c = G; - v.a.b = u - G; - v.F = F; - v.p = !q; - } - Tmb(a.a, a.i); - G = u; - !!t && (G += t.c.a); - q = t; - m = n; - } while (t); - for (e = new Anb(a.j); e.a < e.c.c.length; ) { - d = RD(ynb(e), 18); - f2 = PUc(a, d); - pQb(d, (Ywc(), Rwc), f2); - D5 = RUc(a, d); - pQb(d, Twc, D5); - } - b.f.a = G; - a.d = null; - c2.Vg(); - } - function Z9b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - a.b = b; - a.a = RD(mQb(b, (yCc(), JAc)), 17).a; - a.c = RD(mQb(b, LAc), 17).a; - a.c == 0 && (a.c = lve); - q = new Jkb(b.b, 0); - while (q.b < q.d.gc()) { - p = (sFb(q.b < q.d.gc()), RD(q.d.Xb(q.c = q.b++), 30)); - h = new bnb(); - k = -1; - u = -1; - for (t = new Anb(p.a); t.a < t.c.c.length; ) { - s = RD(ynb(t), 10); - if (Kr((U9b(), new is(Mr(W2b(s).a.Kc(), new ir())))) >= a.a) { - d = V9b(a, s); - k = $wnd.Math.max(k, d.b); - u = $wnd.Math.max(u, d.d); - Rmb(h, new Ptd(s, d)); - } - } - B = new bnb(); - for (j = 0; j < k; ++j) { - Qmb(B, 0, (sFb(q.b > 0), q.a.Xb(q.c = --q.b), C = new R4b(a.b), Ikb(q, C), sFb(q.b < q.d.gc()), q.d.Xb(q.c = q.b++), C)); - } - for (g = new Anb(h); g.a < g.c.c.length; ) { - e = RD(ynb(g), 42); - n = RD(e.b, 580).a; - if (!n) { - continue; - } - for (m = new Anb(n); m.a < m.c.c.length; ) { - l = RD(ynb(m), 10); - Y9b(a, l, S9b, B); - } - } - c2 = new bnb(); - for (i2 = 0; i2 < u; ++i2) { - Rmb(c2, (D5 = new R4b(a.b), Ikb(q, D5), D5)); - } - for (f2 = new Anb(h); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 42); - A = RD(e.b, 580).c; - if (!A) { - continue; - } - for (w2 = new Anb(A); w2.a < w2.c.c.length; ) { - v = RD(ynb(w2), 10); - Y9b(a, v, T9b, c2); - } - } - } - r = new Jkb(b.b, 0); - while (r.b < r.d.gc()) { - o2 = (sFb(r.b < r.d.gc()), RD(r.d.Xb(r.c = r.b++), 30)); - o2.a.c.length == 0 && Ckb(r); - } - } - function wLd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - p = a.i != 0; - t = false; - r = null; - if (Mvd(a.e)) { - k = b.gc(); - if (k > 0) { - m = k < 100 ? null : new gLd(k); - j = new $Hd(b); - o2 = j.g; - r = $C(kE, Pwe, 28, k, 15, 1); - d = 0; - u = new ZHd(k); - for (e = 0; e < a.i; ++e) { - h = a.g[e]; - n = h; - v: - for (s = 0; s < 2; ++s) { - for (i2 = k; --i2 >= 0; ) { - if (n != null ? pb(n, o2[i2]) : dE(n) === dE(o2[i2])) { - if (r.length <= d) { - q = r; - r = $C(kE, Pwe, 28, 2 * r.length, 15, 1); - hib(q, 0, r, 0, d); - } - r[d++] = e; - WGd(u, o2[i2]); - break v; - } - } - n = n; - if (dE(n) === dE(h)) { - break; - } - } - } - j = u; - o2 = u.g; - k = d; - if (d > r.length) { - q = r; - r = $C(kE, Pwe, 28, d, 15, 1); - hib(q, 0, r, 0, d); - } - if (d > 0) { - t = true; - for (f2 = 0; f2 < d; ++f2) { - n = o2[f2]; - m = Kge(a, RD(n, 76), m); - } - for (g = d; --g >= 0; ) { - THd(a, r[g]); - } - if (d != k) { - for (e = k; --e >= d; ) { - THd(j, e); - } - q = r; - r = $C(kE, Pwe, 28, d, 15, 1); - hib(q, 0, r, 0, d); - } - b = j; - } - } - } else { - b = aHd(a, b); - for (e = a.i; --e >= 0; ) { - if (b.Hc(a.g[e])) { - THd(a, e); - t = true; - } - } - } - if (t) { - if (r != null) { - c2 = b.gc(); - l = c2 == 1 ? dZd(a, 4, b.Kc().Pb(), null, r[0], p) : dZd(a, 6, b, r, r[0], p); - m = c2 < 100 ? null : new gLd(c2); - for (e = b.Kc(); e.Ob(); ) { - n = e.Pb(); - m = oge(a, RD(n, 76), m); - } - if (!m) { - qvd(a.e, l); - } else { - m.nj(l); - m.oj(); - } - } else { - m = tLd(b.gc()); - for (e = b.Kc(); e.Ob(); ) { - n = e.Pb(); - m = oge(a, RD(n, 76), m); - } - !!m && m.oj(); - } - return true; - } else { - return false; - } - } - function i_b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - c2 = new p_b(b); - c2.a || b_b(b); - j = a_b(b); - i2 = new Tp(); - q = new D_b(); - for (p = new Anb(b.a); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 10); - for (e = new is(Mr(a3b(o2).a.Kc(), new ir())); gs(e); ) { - d = RD(hs(e), 18); - if (d.c.i.k == (r3b(), m3b) || d.d.i.k == m3b) { - k = h_b(a, d, j, q); - Rc(i2, f_b(k.d), k.a); - } - } - } - g = new bnb(); - for (t = RD(mQb(c2.c, (Ywc(), ewc)), 21).Kc(); t.Ob(); ) { - s = RD(t.Pb(), 64); - n = q.c[s.g]; - m = q.b[s.g]; - h = q.a[s.g]; - f2 = null; - r = null; - switch (s.g) { - case 4: - f2 = new Uid2(a.d.a, n, j.b.a - a.d.a, m - n); - r = new Uid2(a.d.a, n, h, m - n); - l_b(j, new rjd(f2.c + f2.b, f2.d)); - l_b(j, new rjd(f2.c + f2.b, f2.d + f2.a)); - break; - case 2: - f2 = new Uid2(j.a.a, n, a.c.a - j.a.a, m - n); - r = new Uid2(a.c.a - h, n, h, m - n); - l_b(j, new rjd(f2.c, f2.d)); - l_b(j, new rjd(f2.c, f2.d + f2.a)); - break; - case 1: - f2 = new Uid2(n, a.d.b, m - n, j.b.b - a.d.b); - r = new Uid2(n, a.d.b, m - n, h); - l_b(j, new rjd(f2.c, f2.d + f2.a)); - l_b(j, new rjd(f2.c + f2.b, f2.d + f2.a)); - break; - case 3: - f2 = new Uid2(n, j.a.b, m - n, a.c.b - j.a.b); - r = new Uid2(n, a.c.b - h, m - n, h); - l_b(j, new rjd(f2.c, f2.d)); - l_b(j, new rjd(f2.c + f2.b, f2.d)); - } - if (f2) { - l = new y_b(); - l.d = s; - l.b = f2; - l.c = r; - l.a = Ux(RD(Qc(i2, f_b(s)), 21)); - ZEb(g.c, l); - } - } - Tmb(c2.b, g); - c2.d = DZb(LZb(j)); - return c2; - } - function PQc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - if (c2.p[b.p] != null) { - return; - } - h = true; - c2.p[b.p] = 0; - g = b; - p = c2.o == (EQc(), CQc) ? pxe : oxe; - do { - e = a.b.e[g.p]; - f2 = g.c.a.c.length; - if (c2.o == CQc && e > 0 || c2.o == DQc && e < f2 - 1) { - i2 = null; - j = null; - c2.o == DQc ? i2 = RD(Vmb(g.c.a, e + 1), 10) : i2 = RD(Vmb(g.c.a, e - 1), 10); - j = c2.g[i2.p]; - PQc(a, j, c2); - p = a.e.wg(p, b, g); - c2.j[b.p] == b && (c2.j[b.p] = c2.j[j.p]); - if (c2.j[b.p] == c2.j[j.p]) { - o2 = bFc(a.d, g, i2); - if (c2.o == DQc) { - d = Kfb(c2.p[b.p]); - l = Kfb(c2.p[j.p]) + Kfb(c2.d[i2.p]) - i2.d.d - o2 - g.d.a - g.o.b - Kfb(c2.d[g.p]); - if (h) { - h = false; - c2.p[b.p] = $wnd.Math.min(l, p); - } else { - c2.p[b.p] = $wnd.Math.min(d, $wnd.Math.min(l, p)); - } - } else { - d = Kfb(c2.p[b.p]); - l = Kfb(c2.p[j.p]) + Kfb(c2.d[i2.p]) + i2.o.b + i2.d.a + o2 + g.d.d - Kfb(c2.d[g.p]); - if (h) { - h = false; - c2.p[b.p] = $wnd.Math.max(l, p); - } else { - c2.p[b.p] = $wnd.Math.max(d, $wnd.Math.max(l, p)); - } - } - } else { - o2 = Kfb(UD(mQb(a.a, (yCc(), bCc)))); - n = NQc(a, c2.j[b.p]); - k = NQc(a, c2.j[j.p]); - if (c2.o == DQc) { - m = Kfb(c2.p[b.p]) + Kfb(c2.d[g.p]) + g.o.b + g.d.a + o2 - (Kfb(c2.p[j.p]) + Kfb(c2.d[i2.p]) - i2.d.d); - TQc(n, k, m); - } else { - m = Kfb(c2.p[b.p]) + Kfb(c2.d[g.p]) - g.d.d - Kfb(c2.p[j.p]) - Kfb(c2.d[i2.p]) - i2.o.b - i2.d.a - o2; - TQc(n, k, m); - } - } - } else { - p = a.e.wg(p, b, g); - } - g = c2.a[g.p]; - } while (g != b); - qRc(a.e, b); - } - function $Kc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C; - c2 = Kfb(UD(mQb(a.a.j, (yCc(), iAc)))); - if (c2 < -1 || !a.a.i || Cod(RD(mQb(a.a.o, BBc), 101)) || b3b(a.a.o, (qpd(), Xod)).gc() < 2 && b3b(a.a.o, ppd).gc() < 2) { - return true; - } - if (a.a.c.kg()) { - return false; - } - v = 0; - u = 0; - t = new bnb(); - for (i2 = a.a.e, j = 0, k = i2.length; j < k; ++j) { - h = i2[j]; - for (m = h, n = 0, p = m.length; n < p; ++n) { - l = m[n]; - if (l.k == (r3b(), q3b)) { - ZEb(t.c, l); - continue; - } - d = a.b[l.c.p][l.p]; - if (l.k == m3b) { - d.b = 1; - RD(mQb(l, (Ywc(), Awc)), 12).j == (qpd(), Xod) && (u += d.a); - } else { - C = b3b(l, (qpd(), ppd)); - C.dc() || !br(C, new lLc()) ? d.c = 1 : (e = b3b(l, Xod), (e.dc() || !br(e, new hLc())) && (v += d.a)); - } - for (g = new is(Mr(a3b(l).a.Kc(), new ir())); gs(g); ) { - f2 = RD(hs(g), 18); - v += d.c; - u += d.b; - B = f2.d.i; - ZKc(a, d, B); - } - r = Al(cD(WC(cJ, 1), rve, 20, 0, [b3b(l, (qpd(), Yod)), b3b(l, npd)])); - for (A = new is(new Il(r.a.length, r.a)); gs(A); ) { - w2 = RD(hs(A), 12); - s = RD(mQb(w2, (Ywc(), Iwc)), 10); - if (s) { - v += d.c; - u += d.b; - ZKc(a, d, s); - } - } - } - for (o2 = new Anb(t); o2.a < o2.c.c.length; ) { - l = RD(ynb(o2), 10); - d = a.b[l.c.p][l.p]; - for (g = new is(Mr(a3b(l).a.Kc(), new ir())); gs(g); ) { - f2 = RD(hs(g), 18); - v += d.c; - u += d.b; - B = f2.d.i; - ZKc(a, d, B); - } - } - t.c.length = 0; - } - b = v + u; - q = b == 0 ? oxe : (v - u) / b; - return q >= c2; - } - function zEd(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G; - t = b; - s = new Tp(); - u = new Tp(); - k = wDd(t, mIe); - d = new OEd(a, c2, s, u); - QDd(d.a, d.b, d.c, d.d, k); - i2 = (A = s.i, !A ? s.i = new zf(s, s.c) : A); - for (C = i2.Kc(); C.Ob(); ) { - B = RD(C.Pb(), 166); - e = RD(Qc(s, B), 21); - for (p = e.Kc(); p.Ob(); ) { - o2 = p.Pb(); - v = RD(Ao(a.d, o2), 166); - if (v) { - h = (!B.e && (B.e = new Yie(F4, B, 10, 9)), B.e); - WGd(h, v); - } else { - g = zDd(t, uIe); - m = AIe + o2 + BIe + g; - n = m + zIe; - throw Adb(new CDd(n)); - } - } - } - j = (w2 = u.i, !w2 ? u.i = new zf(u, u.c) : w2); - for (F = j.Kc(); F.Ob(); ) { - D5 = RD(F.Pb(), 166); - f2 = RD(Qc(u, D5), 21); - for (r = f2.Kc(); r.Ob(); ) { - q = r.Pb(); - v = RD(Ao(a.d, q), 166); - if (v) { - l = (!D5.g && (D5.g = new Yie(F4, D5, 9, 10)), D5.g); - WGd(l, v); - } else { - g = zDd(t, uIe); - m = AIe + q + BIe + g; - n = m + zIe; - throw Adb(new CDd(n)); - } - } - } - !c2.b && (c2.b = new Yie(E4, c2, 4, 7)); - if (c2.b.i != 0 && (!c2.c && (c2.c = new Yie(E4, c2, 5, 8)), c2.c.i != 0) && (!c2.b && (c2.b = new Yie(E4, c2, 4, 7)), c2.b.i <= 1 && (!c2.c && (c2.c = new Yie(E4, c2, 5, 8)), c2.c.i <= 1)) && (!c2.a && (c2.a = new C5d(F4, c2, 6, 6)), c2.a).i == 1) { - G = RD(QHd((!c2.a && (c2.a = new C5d(F4, c2, 6, 6)), c2.a), 0), 166); - if (!Dzd(G) && !Ezd(G)) { - Kzd(G, RD(QHd((!c2.b && (c2.b = new Yie(E4, c2, 4, 7)), c2.b), 0), 84)); - Lzd(G, RD(QHd((!c2.c && (c2.c = new Yie(E4, c2, 5, 8)), c2.c), 0), 84)); - } - } - } - function QNc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - for (t = a.a, u = 0, v = t.length; u < v; ++u) { - s = t[u]; - j = lve; - k = lve; - for (o2 = new Anb(s.e); o2.a < o2.c.c.length; ) { - m = RD(ynb(o2), 10); - g = !m.c ? -1 : Wmb(m.c.a, m, 0); - if (g > 0) { - l = RD(Vmb(m.c.a, g - 1), 10); - B = bFc(a.b, m, l); - q = m.n.b - m.d.d - (l.n.b + l.o.b + l.d.a + B); - } else { - q = m.n.b - m.d.d; - } - j = $wnd.Math.min(q, j); - if (g < m.c.a.c.length - 1) { - l = RD(Vmb(m.c.a, g + 1), 10); - B = bFc(a.b, m, l); - r = l.n.b - l.d.d - (m.n.b + m.o.b + m.d.a + B); - } else { - r = 2 * m.n.b; - } - k = $wnd.Math.min(r, k); - } - i2 = lve; - f2 = false; - e = RD(Vmb(s.e, 0), 10); - for (D5 = new Anb(e.j); D5.a < D5.c.c.length; ) { - C = RD(ynb(D5), 12); - p = e.n.b + C.n.b + C.a.b; - for (d = new Anb(C.e); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - w2 = c2.c; - b = w2.i.n.b + w2.n.b + w2.a.b - p; - if ($wnd.Math.abs(b) < $wnd.Math.abs(i2) && $wnd.Math.abs(b) < (b < 0 ? j : k)) { - i2 = b; - f2 = true; - } - } - } - h = RD(Vmb(s.e, s.e.c.length - 1), 10); - for (A = new Anb(h.j); A.a < A.c.c.length; ) { - w2 = RD(ynb(A), 12); - p = h.n.b + w2.n.b + w2.a.b; - for (d = new Anb(w2.g); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - C = c2.d; - b = C.i.n.b + C.n.b + C.a.b - p; - if ($wnd.Math.abs(b) < $wnd.Math.abs(i2) && $wnd.Math.abs(b) < (b < 0 ? j : k)) { - i2 = b; - f2 = true; - } - } - } - if (f2 && i2 != 0) { - for (n = new Anb(s.e); n.a < n.c.c.length; ) { - m = RD(ynb(n), 10); - m.n.b += i2; - } - } - } - } - function vac(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - d = new bnb(); - e = lve; - f2 = lve; - g = lve; - if (c2) { - e = a.f.a; - for (p = new Anb(b.j); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 12); - for (i2 = new Anb(o2.g); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 18); - if (h.a.b != 0) { - k = RD(Qub(h.a), 8); - if (k.a < e) { - f2 = e - k.a; - g = lve; - d.c.length = 0; - e = k.a; - } - if (k.a <= e) { - ZEb(d.c, h); - h.a.b > 1 && (g = $wnd.Math.min(g, $wnd.Math.abs(RD(ju(h.a, 1), 8).b - k.b))); - } - } - } - } - } else { - for (p = new Anb(b.j); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 12); - for (i2 = new Anb(o2.e); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 18); - if (h.a.b != 0) { - m = RD(Rub(h.a), 8); - if (m.a > e) { - f2 = m.a - e; - g = lve; - d.c.length = 0; - e = m.a; - } - if (m.a >= e) { - ZEb(d.c, h); - h.a.b > 1 && (g = $wnd.Math.min(g, $wnd.Math.abs(RD(ju(h.a, h.a.b - 2), 8).b - m.b))); - } - } - } - } - } - if (d.c.length != 0 && f2 > b.o.a / 2 && g > b.o.b / 2) { - n = new R3b(); - P3b(n, b); - Q3b(n, (qpd(), Yod)); - n.n.a = b.o.a / 2; - r = new R3b(); - P3b(r, b); - Q3b(r, npd); - r.n.a = b.o.a / 2; - r.n.b = b.o.b; - for (i2 = new Anb(d); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 18); - if (c2) { - j = RD(Uub(h.a), 8); - q = h.a.b == 0 ? K3b(h.d) : RD(Qub(h.a), 8); - q.b >= j.b ? Y0b(h, r) : Y0b(h, n); - } else { - j = RD(Vub(h.a), 8); - q = h.a.b == 0 ? K3b(h.c) : RD(Rub(h.a), 8); - q.b >= j.b ? Z0b(h, r) : Z0b(h, n); - } - l = RD(mQb(h, (yCc(), RAc)), 75); - !!l && ze(l, j, true); - } - b.n.a = e - b.o.a / 2; - } - } - function E0c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - for (h = Sub(a.b, 0); h.b != h.d.c; ) { - g = RD(evb(h), 40); - if (lhb(g.c, IEe)) { - continue; - } - j = iWc(g, a); - b == (Cmd(), ymd) || b == zmd ? _mb(j, new D1c()) : _mb(j, new H1c()); - i2 = j.c.length; - for (d = 0; d < i2; d++) { - k = (tFb(d, j.c.length), RD(j.c[d], 65)).c; - lhb(k.c, "n11") && o0; - if (Heb(TD(mQb(g, (q$c(), UZc)))) && !mWc((tFb(d, j.c.length), RD(j.c[d], 65)), a)) { - continue; - } - e = i2 == 1 ? 0.5 : (d + 1) / (i2 + 1); - if (b == ymd) { - f2 = Kfb(UD(mQb(g, f$c))); - m = g.e.b + g.f.b * e; - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd($wnd.Math.min(f2, g.e.a - c2), m)); - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd(g.e.a, m)); - } else if (b == zmd) { - f2 = Kfb(UD(mQb(g, e$c))) + c2; - m = g.e.b + g.f.b * e; - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd(f2, m)); - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd(g.e.a + g.f.a, m)); - } else if (b == Bmd) { - f2 = Kfb(UD(mQb(g, f$c))); - l = g.e.a + g.f.a * e; - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd(l, $wnd.Math.min(g.e.b - c2, f2))); - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd(l, g.e.b)); - } else { - f2 = Kfb(UD(mQb(g, e$c))) + c2; - l = g.e.a + g.f.a * e; - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd(l, f2)); - Nub((tFb(d, j.c.length), RD(j.c[d], 65)).a, new rjd(l, g.e.b + g.f.b)); - } - } - } - } - function f2b(a, b, c2, d, e, f2, g, h, i2) { - var j, k, l, m, n, o2, p; - n = c2; - k = new j3b(i2); - h3b(k, (r3b(), m3b)); - pQb(k, (Ywc(), iwc), g); - pQb(k, (yCc(), BBc), (Bod(), wod)); - p = Kfb(UD(a.of(ABc))); - pQb(k, ABc, p); - l = new R3b(); - P3b(l, k); - if (!(b != zod && b != Aod)) { - d >= 0 ? n = vpd(h) : n = spd(vpd(h)); - a.qf(GBc, n); - } - j = new pjd(); - m = false; - if (a.pf(zBc)) { - mjd(j, RD(a.of(zBc), 8)); - m = true; - } else { - ljd(j, g.a / 2, g.b / 2); - } - switch (n.g) { - case 4: - pQb(k, UAc, (cxc(), $wc)); - pQb(k, bwc, (huc(), guc)); - k.o.b = g.b; - p < 0 && (k.o.a = -p); - Q3b(l, (qpd(), Xod)); - m || (j.a = g.a); - j.a -= g.a; - break; - case 2: - pQb(k, UAc, (cxc(), axc)); - pQb(k, bwc, (huc(), euc)); - k.o.b = g.b; - p < 0 && (k.o.a = -p); - Q3b(l, (qpd(), ppd)); - m || (j.a = 0); - break; - case 1: - pQb(k, owc, (Gvc(), Fvc)); - k.o.a = g.a; - p < 0 && (k.o.b = -p); - Q3b(l, (qpd(), npd)); - m || (j.b = g.b); - j.b -= g.b; - break; - case 3: - pQb(k, owc, (Gvc(), Dvc)); - k.o.a = g.a; - p < 0 && (k.o.b = -p); - Q3b(l, (qpd(), Yod)); - m || (j.b = 0); - } - mjd(l.n, j); - pQb(k, zBc, j); - if (b == vod || b == xod || b == wod) { - o2 = 0; - if (b == vod && a.pf(CBc)) { - switch (n.g) { - case 1: - case 2: - o2 = RD(a.of(CBc), 17).a; - break; - case 3: - case 4: - o2 = -RD(a.of(CBc), 17).a; - } - } else { - switch (n.g) { - case 4: - case 2: - o2 = f2.b; - b == xod && (o2 /= e.b); - break; - case 1: - case 3: - o2 = f2.a; - b == xod && (o2 /= e.a); - } - } - pQb(k, Jwc, o2); - } - pQb(k, hwc, n); - return k; - } - function OId() { - MId(); - function h(f2) { - var g = this; - this.dispatch = function(a) { - var b = a.data; - switch (b.cmd) { - case "algorithms": - var c2 = PId((yob(), new xpb(new glb(LId.b)))); - f2.postMessage({ id: b.id, data: c2 }); - break; - case "categories": - var d = PId((yob(), new xpb(new glb(LId.c)))); - f2.postMessage({ id: b.id, data: d }); - break; - case "options": - var e = PId((yob(), new xpb(new glb(LId.d)))); - f2.postMessage({ id: b.id, data: e }); - break; - case "register": - SId(b.algorithms); - f2.postMessage({ id: b.id }); - break; - case "layout": - QId(b.graph, b.layoutOptions || {}, b.options || {}); - f2.postMessage({ id: b.id, data: b.graph }); - break; - } - }; - this.saveDispatch = function(b) { - try { - g.dispatch(b); - } catch (a) { - f2.postMessage({ id: b.data.id, error: a }); - } - }; - } - function j(b) { - var c2 = this; - this.dispatcher = new h({ postMessage: function(a) { - c2.onmessage({ data: a }); - } }); - this.postMessage = function(a) { - setTimeout(function() { - c2.dispatcher.saveDispatch({ data: a }); - }, 0); - }; - } - if (typeof document === Yxe && typeof self !== Yxe) { - var i2 = new h(self); - self.onmessage = i2.saveDispatch; - } else if (typeof module3 !== Yxe && module3.exports) { - Object.defineProperty(exports3, "__esModule", { value: true }); - module3.exports = { "default": j, Worker: j }; - } - } - function i5b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - k = new j3b(c2); - kQb(k, b); - pQb(k, (Ywc(), Awc), b); - k.o.a = b.g; - k.o.b = b.f; - k.n.a = b.i; - k.n.b = b.j; - Rmb(c2.a, k); - Zjb(a.a, b, k); - ((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i != 0 || Heb(TD(Gxd(b, (yCc(), NAc))))) && pQb(k, Yvc, (Geb(), true)); - j = RD(mQb(c2, kwc), 21); - l = RD(mQb(k, (yCc(), BBc)), 101); - l == (Bod(), Aod) ? pQb(k, BBc, zod) : l != zod && j.Fc((ovc(), kvc)); - m = 0; - d = RD(mQb(c2, rAc), 88); - for (i2 = new dMd((!b.c && (b.c = new C5d(K4, b, 9, 9)), b.c)); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 123); - e = vCd(b); - (dE(Gxd(e, cAc)) !== dE((kEc(), hEc)) || dE(Gxd(e, pAc)) === dE((Ptc(), Otc)) || dE(Gxd(e, pAc)) === dE((Ptc(), Mtc)) || Heb(TD(Gxd(e, eAc))) || dE(Gxd(e, Yzc)) !== dE((U$b(), T$b)) || dE(Gxd(e, ZAc)) === dE((aEc(), TDc)) || dE(Gxd(e, ZAc)) === dE((aEc(), UDc)) || dE(Gxd(e, $Ac)) === dE((_Cc(), SCc)) || dE(Gxd(e, $Ac)) === dE((_Cc(), UCc))) && !Heb(TD(Gxd(b, aAc))) && Ixd(h, zwc, sgb(m++)); - Heb(TD(Gxd(h, pBc))) || j5b(a, h, k, j, d, l); - } - for (g = new dMd((!b.n && (b.n = new C5d(I4, b, 1, 7)), b.n)); g.e != g.i.gc(); ) { - f2 = RD(bMd(g), 135); - !Heb(TD(Gxd(f2, pBc))) && !!f2.a && Rmb(k.b, h5b(f2)); - } - Heb(TD(mQb(k, Uzc))) && j.Fc((ovc(), fvc)); - if (Heb(TD(mQb(k, MAc)))) { - j.Fc((ovc(), jvc)); - j.Fc(ivc); - pQb(k, BBc, zod); - } - return k; - } - function ird(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I; - p = 0; - D5 = 0; - for (j = new Anb(a.b); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 163); - !!i2.c && Dsd(i2.c); - p = $wnd.Math.max(p, urd(i2)); - D5 += urd(i2) * trd(i2); - } - q = D5 / a.b.c.length; - C = brd(a.b, q); - D5 += a.b.c.length * C; - p = $wnd.Math.max(p, $wnd.Math.sqrt(D5 * g)) + c2.b; - H = c2.b; - I = c2.d; - n = 0; - l = c2.b + c2.c; - B = new Yub(); - Mub(B, sgb(0)); - w2 = new Yub(); - k = new Jkb(a.b, 0); - o2 = null; - h = new bnb(); - while (k.b < k.d.gc()) { - i2 = (sFb(k.b < k.d.gc()), RD(k.d.Xb(k.c = k.b++), 163)); - G = urd(i2); - m = trd(i2); - if (H + G > p) { - if (f2) { - Oub(w2, n); - Oub(B, sgb(k.b - 1)); - Rmb(a.d, o2); - h.c.length = 0; - } - H = c2.b; - I += n + b; - n = 0; - l = $wnd.Math.max(l, c2.b + c2.c + G); - } - ZEb(h.c, i2); - xrd(i2, H, I); - l = $wnd.Math.max(l, H + G + c2.c); - n = $wnd.Math.max(n, m); - H += G + b; - o2 = i2; - } - Tmb(a.a, h); - Rmb(a.d, RD(Vmb(h, h.c.length - 1), 163)); - l = $wnd.Math.max(l, d); - F = I + n + c2.a; - if (F < e) { - n += e - F; - F = e; - } - if (f2) { - H = c2.b; - k = new Jkb(a.b, 0); - Oub(B, sgb(a.b.c.length)); - A = Sub(B, 0); - s = RD(evb(A), 17).a; - Oub(w2, n); - v = Sub(w2, 0); - u = 0; - while (k.b < k.d.gc()) { - if (k.b == s) { - H = c2.b; - u = Kfb(UD(evb(v))); - s = RD(evb(A), 17).a; - } - i2 = (sFb(k.b < k.d.gc()), RD(k.d.Xb(k.c = k.b++), 163)); - vrd(i2, u); - if (k.b == s) { - r = l - H - c2.c; - t = urd(i2); - wrd(i2, r); - yrd(i2, (r - t) / 2, 0); - } - H += urd(i2) + b; - } - } - return new rjd(l, F); - } - function zne(a) { - if (a.N) - return; - a.N = true; - a.b = jBd(a, 0); - iBd(a.b, 0); - iBd(a.b, 1); - iBd(a.b, 2); - a.bb = jBd(a, 1); - iBd(a.bb, 0); - iBd(a.bb, 1); - a.fb = jBd(a, 2); - iBd(a.fb, 3); - iBd(a.fb, 4); - oBd(a.fb, 5); - a.qb = jBd(a, 3); - iBd(a.qb, 0); - oBd(a.qb, 1); - oBd(a.qb, 2); - iBd(a.qb, 3); - iBd(a.qb, 4); - oBd(a.qb, 5); - iBd(a.qb, 6); - a.a = kBd(a, 4); - a.c = kBd(a, 5); - a.d = kBd(a, 6); - a.e = kBd(a, 7); - a.f = kBd(a, 8); - a.g = kBd(a, 9); - a.i = kBd(a, 10); - a.j = kBd(a, 11); - a.k = kBd(a, 12); - a.n = kBd(a, 13); - a.o = kBd(a, 14); - a.p = kBd(a, 15); - a.q = kBd(a, 16); - a.s = kBd(a, 17); - a.r = kBd(a, 18); - a.t = kBd(a, 19); - a.u = kBd(a, 20); - a.v = kBd(a, 21); - a.w = kBd(a, 22); - a.B = kBd(a, 23); - a.A = kBd(a, 24); - a.C = kBd(a, 25); - a.D = kBd(a, 26); - a.F = kBd(a, 27); - a.G = kBd(a, 28); - a.H = kBd(a, 29); - a.J = kBd(a, 30); - a.I = kBd(a, 31); - a.K = kBd(a, 32); - a.M = kBd(a, 33); - a.L = kBd(a, 34); - a.P = kBd(a, 35); - a.Q = kBd(a, 36); - a.R = kBd(a, 37); - a.S = kBd(a, 38); - a.T = kBd(a, 39); - a.U = kBd(a, 40); - a.V = kBd(a, 41); - a.X = kBd(a, 42); - a.W = kBd(a, 43); - a.Y = kBd(a, 44); - a.Z = kBd(a, 45); - a.$ = kBd(a, 46); - a._ = kBd(a, 47); - a.ab = kBd(a, 48); - a.cb = kBd(a, 49); - a.db = kBd(a, 50); - a.eb = kBd(a, 51); - a.gb = kBd(a, 52); - a.hb = kBd(a, 53); - a.ib = kBd(a, 54); - a.jb = kBd(a, 55); - a.kb = kBd(a, 56); - a.lb = kBd(a, 57); - a.mb = kBd(a, 58); - a.nb = kBd(a, 59); - a.ob = kBd(a, 60); - a.pb = kBd(a, 61); - } - function w8b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - s = 0; - if (b.f.a == 0) { - for (q = new Anb(a); q.a < q.c.c.length; ) { - o2 = RD(ynb(q), 10); - s = $wnd.Math.max(s, o2.n.a + o2.o.a + o2.d.c); - } - } else { - s = b.f.a - b.c.a; - } - s -= b.c.a; - for (p = new Anb(a); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 10); - x8b(o2.n, s - o2.o.a); - y8b(o2.f); - u8b(o2); - (!o2.q ? (yob(), yob(), wob) : o2.q)._b((yCc(), IBc)) && x8b(RD(mQb(o2, IBc), 8), s - o2.o.a); - switch (RD(mQb(o2, Rzc), 255).g) { - case 1: - pQb(o2, Rzc, (Rjd(), Pjd)); - break; - case 2: - pQb(o2, Rzc, (Rjd(), Ojd)); - } - r = o2.o; - for (u = new Anb(o2.j); u.a < u.c.c.length; ) { - t = RD(ynb(u), 12); - x8b(t.n, r.a - t.o.a); - x8b(t.a, t.o.a); - Q3b(t, o8b(t.j)); - g = RD(mQb(t, CBc), 17); - !!g && pQb(t, CBc, sgb(-g.a)); - for (f2 = new Anb(t.g); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 18); - for (d = Sub(e.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 8); - c2.a = s - c2.a; - } - j = RD(mQb(e, RAc), 75); - if (j) { - for (i2 = Sub(j, 0); i2.b != i2.d.c; ) { - h = RD(evb(i2), 8); - h.a = s - h.a; - } - } - for (m = new Anb(e.b); m.a < m.c.c.length; ) { - k = RD(ynb(m), 72); - x8b(k.n, s - k.o.a); - } - } - for (n = new Anb(t.f); n.a < n.c.c.length; ) { - k = RD(ynb(n), 72); - x8b(k.n, t.o.a - k.o.a); - } - } - if (o2.k == (r3b(), m3b)) { - pQb(o2, (Ywc(), hwc), o8b(RD(mQb(o2, hwc), 64))); - t8b(o2); - } - for (l = new Anb(o2.b); l.a < l.c.c.length; ) { - k = RD(ynb(l), 72); - u8b(k); - x8b(k.n, r.a - k.o.a); - } - } - } - function z8b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - s = 0; - if (b.f.b == 0) { - for (q = new Anb(a); q.a < q.c.c.length; ) { - o2 = RD(ynb(q), 10); - s = $wnd.Math.max(s, o2.n.b + o2.o.b + o2.d.a); - } - } else { - s = b.f.b - b.c.b; - } - s -= b.c.b; - for (p = new Anb(a); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 10); - A8b(o2.n, s - o2.o.b); - B8b(o2.f); - v8b(o2); - (!o2.q ? (yob(), yob(), wob) : o2.q)._b((yCc(), IBc)) && A8b(RD(mQb(o2, IBc), 8), s - o2.o.b); - switch (RD(mQb(o2, Rzc), 255).g) { - case 3: - pQb(o2, Rzc, (Rjd(), Mjd)); - break; - case 4: - pQb(o2, Rzc, (Rjd(), Qjd)); - } - r = o2.o; - for (u = new Anb(o2.j); u.a < u.c.c.length; ) { - t = RD(ynb(u), 12); - A8b(t.n, r.b - t.o.b); - A8b(t.a, t.o.b); - Q3b(t, p8b(t.j)); - g = RD(mQb(t, CBc), 17); - !!g && pQb(t, CBc, sgb(-g.a)); - for (f2 = new Anb(t.g); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 18); - for (d = Sub(e.a, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 8); - c2.b = s - c2.b; - } - j = RD(mQb(e, RAc), 75); - if (j) { - for (i2 = Sub(j, 0); i2.b != i2.d.c; ) { - h = RD(evb(i2), 8); - h.b = s - h.b; - } - } - for (m = new Anb(e.b); m.a < m.c.c.length; ) { - k = RD(ynb(m), 72); - A8b(k.n, s - k.o.b); - } - } - for (n = new Anb(t.f); n.a < n.c.c.length; ) { - k = RD(ynb(n), 72); - A8b(k.n, t.o.b - k.o.b); - } - } - if (o2.k == (r3b(), m3b)) { - pQb(o2, (Ywc(), hwc), p8b(RD(mQb(o2, hwc), 64))); - s8b(o2); - } - for (l = new Anb(o2.b); l.a < l.c.c.length; ) { - k = RD(ynb(l), 72); - v8b(k); - A8b(k.n, r.b - k.o.b); - } - } - } - function Drc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H; - s = new Jkb(a.b, 0); - k = b.Kc(); - o2 = 0; - j = RD(k.Pb(), 17).a; - v = 0; - c2 = new _sb(); - A = new Iub(); - while (s.b < s.d.gc()) { - r = (sFb(s.b < s.d.gc()), RD(s.d.Xb(s.c = s.b++), 30)); - for (u = new Anb(r.a); u.a < u.c.c.length; ) { - t = RD(ynb(u), 10); - for (n = new is(Mr(a3b(t).a.Kc(), new ir())); gs(n); ) { - l = RD(hs(n), 18); - A.a.zc(l, A); - } - for (m = new is(Mr(Z2b(t).a.Kc(), new ir())); gs(m); ) { - l = RD(hs(m), 18); - A.a.Bc(l) != null; - } - } - if (o2 + 1 == j) { - e = new R4b(a); - Ikb(s, e); - f2 = new R4b(a); - Ikb(s, f2); - for (C = A.a.ec().Kc(); C.Ob(); ) { - B = RD(C.Pb(), 18); - if (!c2.a._b(B)) { - ++v; - c2.a.zc(B, c2); - } - g = new j3b(a); - pQb(g, (yCc(), BBc), (Bod(), yod)); - g3b(g, e); - h3b(g, (r3b(), l3b)); - p = new R3b(); - P3b(p, g); - Q3b(p, (qpd(), ppd)); - D5 = new R3b(); - P3b(D5, g); - Q3b(D5, Xod); - d = new j3b(a); - pQb(d, BBc, yod); - g3b(d, f2); - h3b(d, l3b); - q = new R3b(); - P3b(q, d); - Q3b(q, ppd); - F = new R3b(); - P3b(F, d); - Q3b(F, Xod); - w2 = new a1b(); - Y0b(w2, B.c); - Z0b(w2, p); - pQb(w2, (Ywc(), zwc), RD(mQb(B, zwc), 17)); - H = new a1b(); - Y0b(H, D5); - Z0b(H, q); - pQb(H, zwc, RD(mQb(B, zwc), 17)); - Y0b(B, F); - h = new Jrc(g, d, w2, H, B); - pQb(g, Wvc, h); - pQb(d, Wvc, h); - G = w2.c.i; - if (G.k == l3b) { - i2 = RD(mQb(G, Wvc), 313); - i2.d = h; - h.g = i2; - } - } - if (k.Ob()) { - j = RD(k.Pb(), 17).a; - } else { - break; - } - } - ++o2; - } - return sgb(v); - } - function rkc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - p = new bnb(); - for (m = new Anb(a.d.b); m.a < m.c.c.length; ) { - l = RD(ynb(m), 30); - for (o2 = new Anb(l.a); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 10); - e = RD(Wjb(a.f, n), 60); - for (i2 = new is(Mr(a3b(n).a.Kc(), new ir())); gs(i2); ) { - g = RD(hs(i2), 18); - d = Sub(g.a, 0); - j = true; - k = null; - if (d.b != d.d.c) { - b = RD(evb(d), 8); - c2 = null; - if (g.c.j == (qpd(), Yod)) { - q = new Nlc(b, new rjd(b.a, e.d.d), e, g); - q.f.a = true; - q.a = g.c; - ZEb(p.c, q); - } - if (g.c.j == npd) { - q = new Nlc(b, new rjd(b.a, e.d.d + e.d.a), e, g); - q.f.d = true; - q.a = g.c; - ZEb(p.c, q); - } - while (d.b != d.d.c) { - c2 = RD(evb(d), 8); - if (!rGb(b.b, c2.b)) { - k = new Nlc(b, c2, null, g); - ZEb(p.c, k); - if (j) { - j = false; - if (c2.b < e.d.d) { - k.f.a = true; - } else if (c2.b > e.d.d + e.d.a) { - k.f.d = true; - } else { - k.f.d = true; - k.f.a = true; - } - } - } - d.b != d.d.c && (b = c2); - } - if (k) { - f2 = RD(Wjb(a.f, g.d.i), 60); - if (b.b < f2.d.d) { - k.f.a = true; - } else if (b.b > f2.d.d + f2.d.a) { - k.f.d = true; - } else { - k.f.d = true; - k.f.a = true; - } - } - } - } - for (h = new is(Mr(Z2b(n).a.Kc(), new ir())); gs(h); ) { - g = RD(hs(h), 18); - if (g.a.b != 0) { - b = RD(Rub(g.a), 8); - if (g.d.j == (qpd(), Yod)) { - q = new Nlc(b, new rjd(b.a, e.d.d), e, g); - q.f.a = true; - q.a = g.d; - ZEb(p.c, q); - } - if (g.d.j == npd) { - q = new Nlc(b, new rjd(b.a, e.d.d + e.d.a), e, g); - q.f.d = true; - q.a = g.d; - ZEb(p.c, q); - } - } - } - } - } - return p; - } - function Nvd(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m; - i2 = new bnb(); - l = b.length; - g = $5d(c2); - for (j = 0; j < l; ++j) { - k = rhb(b, Fhb(61), j); - d = wvd(g, (AFb(j, k, b.length), b.substr(j, k - j))); - e = iXd(d); - f2 = e.jk().wi(); - switch (ihb(b, ++k)) { - case 39: { - h = phb(b, 39, ++k); - Rmb(i2, new KTd(d, lwd((AFb(k, h, b.length), b.substr(k, h - k)), f2, e))); - j = h + 1; - break; - } - case 34: { - h = phb(b, 34, ++k); - Rmb(i2, new KTd(d, lwd((AFb(k, h, b.length), b.substr(k, h - k)), f2, e))); - j = h + 1; - break; - } - case 91: { - m = new bnb(); - Rmb(i2, new KTd(d, m)); - n: - for (; ; ) { - switch (ihb(b, ++k)) { - case 39: { - h = phb(b, 39, ++k); - Rmb(m, lwd((AFb(k, h, b.length), b.substr(k, h - k)), f2, e)); - k = h + 1; - break; - } - case 34: { - h = phb(b, 34, ++k); - Rmb(m, lwd((AFb(k, h, b.length), b.substr(k, h - k)), f2, e)); - k = h + 1; - break; - } - case 110: { - ++k; - if (b.indexOf("ull", k) == k) { - m.c.push(null); - } else { - throw Adb(new yz(MHe)); - } - k += 3; - break; - } - } - if (k < l) { - switch (BFb(k, b.length), b.charCodeAt(k)) { - case 44: { - break; - } - case 93: { - break n; - } - default: { - throw Adb(new yz("Expecting , or ]")); - } - } - } else { - break; - } - } - j = k + 1; - break; - } - case 110: { - ++k; - if (b.indexOf("ull", k) == k) { - Rmb(i2, new KTd(d, null)); - } else { - throw Adb(new yz(MHe)); - } - j = k + 3; - break; - } - } - if (j < l) { - BFb(j, b.length); - if (b.charCodeAt(j) != 44) { - throw Adb(new yz("Expecting ,")); - } - } else { - break; - } - } - return Ovd(a, i2, c2); - } - function Oqe(a) { - var b, c2, d, e, f2; - b = a.c; - f2 = null; - switch (b) { - case 6: - return a.Em(); - case 13: - return a.Fm(); - case 23: - return a.wm(); - case 22: - return a.Bm(); - case 18: - return a.ym(); - case 8: - Mqe(a); - f2 = (Vse(), Dse); - break; - case 9: - return a.em(true); - case 19: - return a.fm(); - case 10: - switch (a.a) { - case 100: - case 68: - case 119: - case 87: - case 115: - case 83: - f2 = a.dm(a.a); - Mqe(a); - return f2; - case 101: - case 102: - case 110: - case 114: - case 116: - case 117: - case 118: - case 120: - { - c2 = a.cm(); - c2 < txe ? f2 = (Vse(), Vse(), new Hte(0, c2)) : f2 = cte(qse(c2)); - } - break; - case 99: - return a.om(); - case 67: - return a.jm(); - case 105: - return a.rm(); - case 73: - return a.km(); - case 103: - return a.pm(); - case 88: - return a.lm(); - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - return a.gm(); - case 80: - case 112: - f2 = Sqe(a, a.a); - if (!f2) - throw Adb(new Lqe(TId((Hde(), hJe)))); - break; - default: - f2 = Yse(a.a); - } - Mqe(a); - break; - case 0: - if (a.a == 93 || a.a == 123 || a.a == 125) - throw Adb(new Lqe(TId((Hde(), gJe)))); - f2 = Yse(a.a); - d = a.a; - Mqe(a); - if ((d & 64512) == uxe && a.c == 0 && (a.a & 64512) == 56320) { - e = $C(hE, zwe, 28, 2, 15, 1); - e[0] = d & Bwe; - e[1] = a.a & Bwe; - f2 = bte(cte(Ihb(e, 0, e.length)), 0); - Mqe(a); - } - break; - default: - throw Adb(new Lqe(TId((Hde(), gJe)))); - } - return f2; - } - function WUc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F; - C = new Yub(); - w2 = new Yub(); - q = -1; - for (i2 = new Anb(a); i2.a < i2.c.c.length; ) { - g = RD(ynb(i2), 131); - g.s = q--; - k = 0; - t = 0; - for (f2 = new Anb(g.t); f2.a < f2.c.c.length; ) { - d = RD(ynb(f2), 274); - t += d.c; - } - for (e = new Anb(g.i); e.a < e.c.c.length; ) { - d = RD(ynb(e), 274); - k += d.c; - } - g.n = k; - g.u = t; - t == 0 ? (Pub(w2, g, w2.c.b, w2.c), true) : k == 0 && (Pub(C, g, C.c.b, C.c), true); - } - F = Xx(a); - l = a.c.length; - p = l + 1; - r = l - 1; - n = new bnb(); - while (F.a.gc() != 0) { - while (w2.b != 0) { - v = (sFb(w2.b != 0), RD(Wub(w2, w2.a.a), 131)); - F.a.Bc(v) != null; - v.s = r--; - $Uc(v, C, w2); - } - while (C.b != 0) { - A = (sFb(C.b != 0), RD(Wub(C, C.a.a), 131)); - F.a.Bc(A) != null; - A.s = p++; - $Uc(A, C, w2); - } - o2 = qwe; - for (j = F.a.ec().Kc(); j.Ob(); ) { - g = RD(j.Pb(), 131); - s = g.u - g.n; - if (s >= o2) { - if (s > o2) { - n.c.length = 0; - o2 = s; - } - ZEb(n.c, g); - } - } - if (n.c.length != 0) { - m = RD(Vmb(n, Jwb(b, n.c.length)), 131); - F.a.Bc(m) != null; - m.s = p++; - $Uc(m, C, w2); - n.c.length = 0; - } - } - u = a.c.length + 1; - for (h = new Anb(a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 131); - g.s < l && (g.s += u); - } - for (B = new Anb(a); B.a < B.c.c.length; ) { - A = RD(ynb(B), 131); - c2 = new Jkb(A.t, 0); - while (c2.b < c2.d.gc()) { - d = (sFb(c2.b < c2.d.gc()), RD(c2.d.Xb(c2.c = c2.b++), 274)); - D5 = d.b; - if (A.s > D5.s) { - Ckb(c2); - Ymb(D5.i, d); - if (d.c > 0) { - d.a = D5; - Rmb(D5.t, d); - d.b = A; - Rmb(A.i, d); - } - } - } - } - } - function Efc(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F; - p = new cnb(b.b); - u = new cnb(b.b); - m = new cnb(b.b); - B = new cnb(b.b); - q = new cnb(b.b); - for (A = Sub(b, 0); A.b != A.d.c; ) { - v = RD(evb(A), 12); - for (h = new Anb(v.g); h.a < h.c.c.length; ) { - f2 = RD(ynb(h), 18); - if (f2.c.i == f2.d.i) { - if (v.j == f2.d.j) { - ZEb(B.c, f2); - continue; - } else if (v.j == (qpd(), Yod) && f2.d.j == npd) { - ZEb(q.c, f2); - continue; - } - } - } - } - for (i2 = new Anb(q); i2.a < i2.c.c.length; ) { - f2 = RD(ynb(i2), 18); - Ffc(a, f2, c2, d, (qpd(), Xod)); - } - for (g = new Anb(B); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 18); - C = new j3b(a); - h3b(C, (r3b(), q3b)); - pQb(C, (yCc(), BBc), (Bod(), wod)); - pQb(C, (Ywc(), Awc), f2); - D5 = new R3b(); - pQb(D5, Awc, f2.d); - Q3b(D5, (qpd(), ppd)); - P3b(D5, C); - F = new R3b(); - pQb(F, Awc, f2.c); - Q3b(F, Xod); - P3b(F, C); - pQb(f2.c, Iwc, C); - pQb(f2.d, Iwc, C); - Y0b(f2, null); - Z0b(f2, null); - ZEb(c2.c, C); - pQb(C, $vc, sgb(2)); - } - for (w2 = Sub(b, 0); w2.b != w2.d.c; ) { - v = RD(evb(w2), 12); - j = v.e.c.length > 0; - r = v.g.c.length > 0; - j && r ? (ZEb(m.c, v), true) : j ? (ZEb(p.c, v), true) : r && (ZEb(u.c, v), true); - } - for (o2 = new Anb(p); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 12); - Rmb(e, Dfc(a, n, null, c2)); - } - for (t = new Anb(u); t.a < t.c.c.length; ) { - s = RD(ynb(t), 12); - Rmb(e, Dfc(a, null, s, c2)); - } - for (l = new Anb(m); l.a < l.c.c.length; ) { - k = RD(ynb(l), 12); - Rmb(e, Dfc(a, k, k, c2)); - } - } - function psd(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - m = oxe; - n = oxe; - k = 0; - l = 0; - i2 = new bnb(); - for (h = new dMd((!a.b && (a.b = new C5d(G4, a, 12, 3)), a.b)); h.e != h.i.gc(); ) { - f2 = RD(bMd(h), 74); - i2 = Al(cD(WC(cJ, 1), rve, 20, 0, [i2, (!f2.n && (f2.n = new C5d(I4, f2, 1, 7)), f2.n)])); - } - for (t = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [(!a.n && (a.n = new C5d(I4, a, 1, 7)), a.n), (!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a), i2]))); gs(t); ) { - s = RD(hs(t), 422); - j = RD(s.of((umd(), eld)), 140); - m > s.nh() - j.b && (m = s.nh() - j.b); - n > s.oh() - j.d && (n = s.oh() - j.d); - k < s.nh() + s.mh() + j.c && (k = s.nh() + s.mh() + j.c); - l < s.oh() + s.lh() + j.a && (l = s.oh() + s.lh() + j.a); - } - for (g = new dMd((!a.b && (a.b = new C5d(G4, a, 12, 3)), a.b)); g.e != g.i.gc(); ) { - f2 = RD(bMd(g), 74); - for (r = new dMd((!f2.a && (f2.a = new C5d(F4, f2, 6, 6)), f2.a)); r.e != r.i.gc(); ) { - q = RD(bMd(r), 166); - o2 = q.j; - d = q.b; - p = q.k; - e = q.c; - m = $wnd.Math.min(m, o2); - m = $wnd.Math.min(m, d); - k = $wnd.Math.max(k, o2); - k = $wnd.Math.max(k, d); - n = $wnd.Math.min(n, p); - n = $wnd.Math.min(n, e); - l = $wnd.Math.max(l, p); - l = $wnd.Math.max(l, e); - for (c2 = new dMd((!q.a && (q.a = new XZd(D4, q, 5)), q.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 377); - m = $wnd.Math.min(m, b.a); - k = $wnd.Math.max(k, b.a); - n = $wnd.Math.min(n, b.b); - l = $wnd.Math.max(l, b.b); - } - } - } - Ixd(a, (umd(), Ikd), k - m); - Ixd(a, Hkd, l - n); - } - function uOc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - c2.Ug("Network simplex node placement", 1); - a.e = b; - a.n = RD(mQb(b, (Ywc(), Qwc)), 312); - tOc(a); - fOc(a); - FDb(EDb(new SDb(null, new Swb(a.e.b, 16)), new iPc()), new kPc(a)); - FDb(CDb(EDb(CDb(EDb(new SDb(null, new Swb(a.e.b, 16)), new ZPc()), new _Pc()), new bQc()), new dQc()), new gPc(a)); - if (Heb(TD(mQb(a.e, (yCc(), gBc))))) { - g = c2.eh(1); - g.Ug("Straight Edges Pre-Processing", 1); - sOc(a); - g.Vg(); - } - AIb(a.f); - f2 = RD(mQb(b, gCc), 17).a * a.f.a.c.length; - lJb(yJb(zJb(CJb(a.f), f2), false), c2.eh(1)); - if (a.d.a.gc() != 0) { - g = c2.eh(1); - g.Ug("Flexible Where Space Processing", 1); - h = RD(Lvb(KDb(GDb(new SDb(null, new Swb(a.f.a, 16)), new mPc()), new IOc())), 17).a; - i2 = RD(Lvb(JDb(GDb(new SDb(null, new Swb(a.f.a, 16)), new oPc()), new MOc())), 17).a; - j = i2 - h; - k = eJb(new gJb(), a.f); - l = eJb(new gJb(), a.f); - rIb(uIb(tIb(sIb(vIb(new wIb(), 2e4), j), k), l)); - FDb(CDb(CDb(_nb(a.i), new qPc()), new sPc()), new uPc(h, k, j, l)); - for (e = a.d.a.ec().Kc(); e.Ob(); ) { - d = RD(e.Pb(), 218); - d.g = 1; - } - lJb(yJb(zJb(CJb(a.f), f2), false), g.eh(1)); - g.Vg(); - } - if (Heb(TD(mQb(b, gBc)))) { - g = c2.eh(1); - g.Ug("Straight Edges Post-Processing", 1); - rOc(a); - g.Vg(); - } - eOc(a); - a.e = null; - a.f = null; - a.i = null; - a.c = null; - akb(a.k); - a.j = null; - a.a = null; - a.o = null; - a.d.a.$b(); - c2.Vg(); - } - function XGc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - c2.Ug("Depth first model order layering", 1); - a.d = b; - q = new bnb(); - for (p = new Anb(a.d.a); p.a < p.c.c.length; ) { - n = RD(ynb(p), 10); - n.k == (r3b(), p3b) && (ZEb(q.c, n), true); - } - yob(); - _mb(q, new aHc()); - g = true; - a.b = new R4b(a.d); - a.a = null; - Rmb(a.d.b, a.b); - a.b.p = 0; - a.c = 0; - a.f = new Yub(); - for (o2 = new Anb(q); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 10); - if (g) { - g3b(n, a.b); - g = false; - } else { - if (VGc(a, n)) { - m = a.c; - m = UGc(m, n); - d = m + 2; - k = m - a.c; - if (a.f.b == 0) { - TGc(a, d, n); - } else { - if (k > 0) { - for (t = Sub(a.f, 0); t.b != t.d.c; ) { - s = RD(evb(t), 10); - s.p += m - a.e; - } - WGc(a); - Xub(a.f); - TGc(a, d, n); - } else { - Mub(a.f, n); - n.p = d; - a.e = $wnd.Math.max(a.e, d); - for (f2 = new is(Mr(Z2b(n).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (!e.c.i.c && e.c.i.k == (r3b(), n3b)) { - Mub(a.f, e.c.i); - e.c.i.p = d - 1; - } - } - a.c = d; - } - } - } else { - WGc(a); - Xub(a.f); - d = 0; - if (gs(new is(Mr(Z2b(n).a.Kc(), new ir())))) { - m = 0; - m = UGc(m, n); - d = m + 2; - TGc(a, d, n); - } else { - Mub(a.f, n); - n.p = 0; - a.e = $wnd.Math.max(a.e, 0); - a.b = RD(Vmb(a.d.b, 0), 30); - a.c = 0; - } - } - } - } - a.f.b == 0 || WGc(a); - a.d.a.c.length = 0; - r = new bnb(); - for (j = new Anb(a.d.b); j.a < j.c.c.length; ) { - h = RD(ynb(j), 30); - h.a.c.length == 0 && (ZEb(r.c, h), true); - } - Ce(a.d.b, r); - l = 0; - for (i2 = new Anb(a.d.b); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 30); - h.p = l; - ++l; - } - c2.Vg(); - } - function EEd(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I, J, K2; - D5 = null; - G = b; - F = pEd(a, DGd(c2), G); - jyd(F, zDd(G, uIe)); - H = RD(Ao(a.g, tDd(qC(G, bIe))), 27); - m = qC(G, "sourcePort"); - d = null; - !!m && (d = tDd(m)); - I = RD(Ao(a.j, d), 123); - if (!H) { - h = uDd(G); - o2 = "An edge must have a source node (edge id: '" + h; - p = o2 + zIe; - throw Adb(new CDd(p)); - } - if (!!I && !Hb(MCd(I), H)) { - i2 = zDd(G, uIe); - q = "The source port of an edge must be a port of the edge's source node (edge id: '" + i2; - r = q + zIe; - throw Adb(new CDd(r)); - } - B = (!F.b && (F.b = new Yie(E4, F, 4, 7)), F.b); - f2 = null; - I ? f2 = I : f2 = H; - WGd(B, f2); - J = RD(Ao(a.g, tDd(qC(G, CIe))), 27); - n = qC(G, "targetPort"); - e = null; - !!n && (e = tDd(n)); - K2 = RD(Ao(a.j, e), 123); - if (!J) { - l = uDd(G); - s = "An edge must have a target node (edge id: '" + l; - t = s + zIe; - throw Adb(new CDd(t)); - } - if (!!K2 && !Hb(MCd(K2), J)) { - j = zDd(G, uIe); - u = "The target port of an edge must be a port of the edge's target node (edge id: '" + j; - v = u + zIe; - throw Adb(new CDd(v)); - } - C = (!F.c && (F.c = new Yie(E4, F, 5, 8)), F.c); - g = null; - K2 ? g = K2 : g = J; - WGd(C, g); - if ((!F.b && (F.b = new Yie(E4, F, 4, 7)), F.b).i == 0 || (!F.c && (F.c = new Yie(E4, F, 5, 8)), F.c).i == 0) { - k = zDd(G, uIe); - w2 = yIe + k; - A = w2 + zIe; - throw Adb(new CDd(A)); - } - GEd(G, F); - FEd(G, F); - D5 = CEd(a, G, F); - return D5; - } - function JTb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I; - n = RD(mQb(a, (JVb(), HVb)), 27); - t = lve; - u = lve; - r = qwe; - s = qwe; - for (w2 = new Anb(a.e); w2.a < w2.c.c.length; ) { - v = RD(ynb(w2), 153); - F = v.d; - G = v.e; - t = $wnd.Math.min(t, F.a - G.a / 2); - u = $wnd.Math.min(u, F.b - G.b / 2); - r = $wnd.Math.max(r, F.a + G.a / 2); - s = $wnd.Math.max(s, F.b + G.b / 2); - } - for (c2 = new Anb(a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 250); - F = b.d; - G = b.e; - t = $wnd.Math.min(t, F.a - G.a / 2); - u = $wnd.Math.min(u, F.b - G.b / 2); - r = $wnd.Math.max(r, F.a + G.a / 2); - s = $wnd.Math.max(s, F.b + G.b / 2); - } - D5 = RD(Gxd(n, (yVb(), hVb)), 107); - C = new rjd(D5.b - t, D5.d - u); - for (j = new Anb(a.e); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 153); - B = mQb(i2, HVb); - if (ZD(B, 207)) { - p = RD(B, 27); - A = $id(new sjd(i2.d), C); - Byd(p, A.a - p.g / 2, A.b - p.f / 2); - } - } - for (f2 = new Anb(a.c); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 290); - l = RD(mQb(e, HVb), 74); - m = IGd(l, true, true); - H = new sjd(ZTb(e)); - $id(H, C); - Nzd(m, H.a, H.b); - Umb(e.a, new OTb(C, m)); - d = new sjd($Tb(e)); - $id(d, C); - Gzd(m, d.a, d.b); - } - for (h = new Anb(a.d); h.a < h.c.c.length; ) { - g = RD(ynb(h), 454); - o2 = RD(mQb(g, HVb), 135); - q = $id(new sjd(g.d), C); - Byd(o2, q.a, q.b); - } - I = r - t + (D5.b + D5.c); - k = s - u + (D5.d + D5.a); - Heb(TD(Gxd(n, (umd(), mld)))) || Esd(n, I, k, false, true); - Ixd(n, Ikd, I - (D5.b + D5.c)); - Ixd(n, Hkd, k - (D5.d + D5.a)); - } - function F$b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - l = H$b(B$b(a, (qpd(), bpd)), b); - o2 = G$b(B$b(a, cpd), b); - u = G$b(B$b(a, kpd), b); - B = I$b(B$b(a, mpd), b); - m = I$b(B$b(a, Zod), b); - s = G$b(B$b(a, jpd), b); - p = G$b(B$b(a, dpd), b); - w2 = G$b(B$b(a, lpd), b); - v = G$b(B$b(a, $od), b); - C = I$b(B$b(a, apd), b); - r = G$b(B$b(a, hpd), b); - t = G$b(B$b(a, gpd), b); - A = G$b(B$b(a, _od), b); - D5 = I$b(B$b(a, ipd), b); - n = I$b(B$b(a, epd), b); - q = G$b(B$b(a, fpd), b); - c2 = Hid(cD(WC(iE, 1), vxe, 28, 15, [s.a, B.a, w2.a, D5.a])); - d = Hid(cD(WC(iE, 1), vxe, 28, 15, [o2.a, l.a, u.a, q.a])); - e = r.a; - f2 = Hid(cD(WC(iE, 1), vxe, 28, 15, [p.a, m.a, v.a, n.a])); - j = Hid(cD(WC(iE, 1), vxe, 28, 15, [s.b, o2.b, p.b, t.b])); - i2 = Hid(cD(WC(iE, 1), vxe, 28, 15, [B.b, l.b, m.b, q.b])); - k = C.b; - h = Hid(cD(WC(iE, 1), vxe, 28, 15, [w2.b, u.b, v.b, A.b])); - x$b(B$b(a, bpd), c2 + e, j + k); - x$b(B$b(a, fpd), c2 + e, j + k); - x$b(B$b(a, cpd), c2 + e, 0); - x$b(B$b(a, kpd), c2 + e, j + k + i2); - x$b(B$b(a, mpd), 0, j + k); - x$b(B$b(a, Zod), c2 + e + d, j + k); - x$b(B$b(a, dpd), c2 + e + d, 0); - x$b(B$b(a, lpd), 0, j + k + i2); - x$b(B$b(a, $od), c2 + e + d, j + k + i2); - x$b(B$b(a, apd), 0, j); - x$b(B$b(a, hpd), c2, 0); - x$b(B$b(a, _od), 0, j + k + i2); - x$b(B$b(a, epd), c2 + e + d, 0); - g = new pjd(); - g.a = Hid(cD(WC(iE, 1), vxe, 28, 15, [c2 + d + e + f2, C.a, t.a, A.a])); - g.b = Hid(cD(WC(iE, 1), vxe, 28, 15, [j + i2 + k + h, r.b, D5.b, n.b])); - return g; - } - function EFb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - s = new rjd(oxe, oxe); - b = new rjd(pxe, pxe); - for (B = new Anb(a); B.a < B.c.c.length; ) { - A = RD(ynb(B), 8); - s.a = $wnd.Math.min(s.a, A.a); - s.b = $wnd.Math.min(s.b, A.b); - b.a = $wnd.Math.max(b.a, A.a); - b.b = $wnd.Math.max(b.b, A.b); - } - m = new rjd(b.a - s.a, b.b - s.b); - j = new rjd(s.a - 50, s.b - m.a - 50); - k = new rjd(s.a - 50, b.b + m.a + 50); - l = new rjd(b.a + m.b / 2 + 50, s.b + m.b / 2); - n = new XFb(j, k, l); - w2 = new _sb(); - f2 = new bnb(); - c2 = new bnb(); - w2.a.zc(n, w2); - for (D5 = new Anb(a); D5.a < D5.c.c.length; ) { - C = RD(ynb(D5), 8); - f2.c.length = 0; - for (v = w2.a.ec().Kc(); v.Ob(); ) { - t = RD(v.Pb(), 317); - d = t.d; - bjd(d, t.a); - $y(bjd(t.d, C), bjd(t.d, t.a)) < 0 && (ZEb(f2.c, t), true); - } - c2.c.length = 0; - for (u = new Anb(f2); u.a < u.c.c.length; ) { - t = RD(ynb(u), 317); - for (q = new Anb(t.e); q.a < q.c.c.length; ) { - o2 = RD(ynb(q), 177); - g = true; - for (i2 = new Anb(f2); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 317); - h != t && (Fvb(o2, Vmb(h.e, 0)) || Fvb(o2, Vmb(h.e, 1)) || Fvb(o2, Vmb(h.e, 2))) && (g = false); - } - g && (ZEb(c2.c, o2), true); - } - } - Ve(w2, f2); - xgb(w2, new FFb()); - for (p = new Anb(c2); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 177); - Ysb(w2, new XFb(C, o2.a, o2.b)); - } - } - r = new _sb(); - xgb(w2, new HFb(r)); - e = r.a.ec().Kc(); - while (e.Ob()) { - o2 = RD(e.Pb(), 177); - (WFb(n, o2.a) || WFb(n, o2.b)) && e.Qb(); - } - xgb(r, new JFb()); - return r; - } - function pvd() { - pvd = geb; - dvd(); - ovd = cvd.a; - RD(QHd(xYd(cvd.a), 0), 19); - ivd = cvd.f; - RD(QHd(xYd(cvd.f), 0), 19); - RD(QHd(xYd(cvd.f), 1), 35); - nvd = cvd.n; - RD(QHd(xYd(cvd.n), 0), 35); - RD(QHd(xYd(cvd.n), 1), 35); - RD(QHd(xYd(cvd.n), 2), 35); - RD(QHd(xYd(cvd.n), 3), 35); - jvd = cvd.g; - RD(QHd(xYd(cvd.g), 0), 19); - RD(QHd(xYd(cvd.g), 1), 35); - fvd = cvd.c; - RD(QHd(xYd(cvd.c), 0), 19); - RD(QHd(xYd(cvd.c), 1), 19); - kvd = cvd.i; - RD(QHd(xYd(cvd.i), 0), 19); - RD(QHd(xYd(cvd.i), 1), 19); - RD(QHd(xYd(cvd.i), 2), 19); - RD(QHd(xYd(cvd.i), 3), 19); - RD(QHd(xYd(cvd.i), 4), 35); - lvd = cvd.j; - RD(QHd(xYd(cvd.j), 0), 19); - gvd = cvd.d; - RD(QHd(xYd(cvd.d), 0), 19); - RD(QHd(xYd(cvd.d), 1), 19); - RD(QHd(xYd(cvd.d), 2), 19); - RD(QHd(xYd(cvd.d), 3), 19); - RD(QHd(xYd(cvd.d), 4), 35); - RD(QHd(xYd(cvd.d), 5), 35); - RD(QHd(xYd(cvd.d), 6), 35); - RD(QHd(xYd(cvd.d), 7), 35); - evd = cvd.b; - RD(QHd(xYd(cvd.b), 0), 35); - RD(QHd(xYd(cvd.b), 1), 35); - hvd = cvd.e; - RD(QHd(xYd(cvd.e), 0), 35); - RD(QHd(xYd(cvd.e), 1), 35); - RD(QHd(xYd(cvd.e), 2), 35); - RD(QHd(xYd(cvd.e), 3), 35); - RD(QHd(xYd(cvd.e), 4), 19); - RD(QHd(xYd(cvd.e), 5), 19); - RD(QHd(xYd(cvd.e), 6), 19); - RD(QHd(xYd(cvd.e), 7), 19); - RD(QHd(xYd(cvd.e), 8), 19); - RD(QHd(xYd(cvd.e), 9), 19); - RD(QHd(xYd(cvd.e), 10), 35); - mvd = cvd.k; - RD(QHd(xYd(cvd.k), 0), 35); - RD(QHd(xYd(cvd.k), 1), 35); - } - function Pqe(a) { - var b, c2, d, e, f2; - b = a.c; - switch (b) { - case 11: - return a.vm(); - case 12: - return a.xm(); - case 14: - return a.zm(); - case 15: - return a.Cm(); - case 16: - return a.Am(); - case 17: - return a.Dm(); - case 21: - Mqe(a); - return Vse(), Vse(), Ese; - case 10: - switch (a.a) { - case 65: - return a.hm(); - case 90: - return a.mm(); - case 122: - return a.tm(); - case 98: - return a.nm(); - case 66: - return a.im(); - case 60: - return a.sm(); - case 62: - return a.qm(); - } - } - f2 = Oqe(a); - b = a.c; - switch (b) { - case 3: - return a.Im(f2); - case 4: - return a.Gm(f2); - case 5: - return a.Hm(f2); - case 0: - if (a.a == 123 && a.d < a.j) { - e = a.d; - d = 0; - c2 = -1; - if ((b = ihb(a.i, e++)) >= 48 && b <= 57) { - d = b - 48; - while (e < a.j && (b = ihb(a.i, e++)) >= 48 && b <= 57) { - d = d * 10 + b - 48; - if (d < 0) - throw Adb(new Lqe(TId((Hde(), CJe)))); - } - } else { - throw Adb(new Lqe(TId((Hde(), yJe)))); - } - c2 = d; - if (b == 44) { - if (e >= a.j) { - throw Adb(new Lqe(TId((Hde(), AJe)))); - } else if ((b = ihb(a.i, e++)) >= 48 && b <= 57) { - c2 = b - 48; - while (e < a.j && (b = ihb(a.i, e++)) >= 48 && b <= 57) { - c2 = c2 * 10 + b - 48; - if (c2 < 0) - throw Adb(new Lqe(TId((Hde(), CJe)))); - } - if (d > c2) - throw Adb(new Lqe(TId((Hde(), BJe)))); - } else { - c2 = -1; - } - } - if (b != 125) - throw Adb(new Lqe(TId((Hde(), zJe)))); - if (a.bm(e)) { - f2 = (Vse(), Vse(), new Kte(9, f2)); - a.d = e + 1; - } else { - f2 = (Vse(), Vse(), new Kte(3, f2)); - a.d = e; - } - f2.Om(d); - f2.Nm(c2); - Mqe(a); - } - } - return f2; - } - function bXb(a) { - var b, c2, d, e, f2; - c2 = RD(mQb(a, (Ywc(), kwc)), 21); - b = vfd(YWb); - e = RD(mQb(a, (yCc(), IAc)), 346); - e == (Fnd(), Cnd) && ofd(b, ZWb); - Heb(TD(mQb(a, GAc))) ? pfd(b, (sXb(), nXb), (hcc(), Zbc)) : pfd(b, (sXb(), pXb), (hcc(), Zbc)); - mQb(a, (rid(), qid)) != null && ofd(b, $Wb); - (Heb(TD(mQb(a, PAc))) || Heb(TD(mQb(a, HAc)))) && nfd(b, (sXb(), rXb), (hcc(), lbc)); - switch (RD(mQb(a, rAc), 88).g) { - case 2: - case 3: - case 4: - nfd(pfd(b, (sXb(), nXb), (hcc(), nbc)), rXb, mbc); - } - c2.Hc((ovc(), fvc)) && nfd(pfd(pfd(b, (sXb(), nXb), (hcc(), kbc)), qXb, ibc), rXb, jbc); - dE(mQb(a, ZAc)) !== dE((aEc(), $Dc)) && pfd(b, (sXb(), pXb), (hcc(), Rbc)); - if (c2.Hc(mvc)) { - pfd(b, (sXb(), nXb), (hcc(), Xbc)); - pfd(b, oXb, Vbc); - pfd(b, pXb, Wbc); - } - dE(mQb(a, Xzc)) !== dE(($uc(), Yuc)) && dE(mQb(a, yAc)) !== dE((Ymd(), Vmd)) && nfd(b, (sXb(), rXb), (hcc(), Abc)); - Heb(TD(mQb(a, KAc))) && pfd(b, (sXb(), pXb), (hcc(), zbc)); - Heb(TD(mQb(a, nAc))) && pfd(b, (sXb(), pXb), (hcc(), dcc)); - if (eXb(a)) { - dE(mQb(a, IAc)) === dE(Cnd) ? d = RD(mQb(a, gAc), 299) : d = RD(mQb(a, hAc), 299); - f2 = d == (xvc(), vvc) ? (hcc(), Ubc) : (hcc(), gcc); - pfd(b, (sXb(), qXb), f2); - } - switch (RD(mQb(a, vCc), 388).g) { - case 1: - pfd(b, (sXb(), qXb), (hcc(), ecc)); - break; - case 2: - nfd(pfd(pfd(b, (sXb(), pXb), (hcc(), ebc)), qXb, fbc), rXb, gbc); - } - dE(mQb(a, cAc)) !== dE((kEc(), hEc)) && pfd(b, (sXb(), pXb), (hcc(), fcc)); - return b; - } - function crc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - if (Ujb(a.a, b)) { - if (Zsb(RD(Wjb(a.a, b), 49), c2)) { - return 1; - } - } else { - Zjb(a.a, b, new _sb()); - } - if (Ujb(a.a, c2)) { - if (Zsb(RD(Wjb(a.a, c2), 49), b)) { - return -1; - } - } else { - Zjb(a.a, c2, new _sb()); - } - if (Ujb(a.e, b)) { - if (Zsb(RD(Wjb(a.e, b), 49), c2)) { - return -1; - } - } else { - Zjb(a.e, b, new _sb()); - } - if (Ujb(a.e, c2)) { - if (Zsb(RD(Wjb(a.a, c2), 49), b)) { - return 1; - } - } else { - Zjb(a.e, c2, new _sb()); - } - if (a.c == (kEc(), iEc) || !nQb(b, (Ywc(), zwc)) || !nQb(c2, (Ywc(), zwc))) { - l = null; - for (j = new Anb(b.j); j.a < j.c.c.length; ) { - h = RD(ynb(j), 12); - h.e.c.length == 0 || RD(Vmb(h.e, 0), 18).c.i.c != b.c && (l = RD(Vmb(h.e, 0), 18).c); - } - n = null; - for (i2 = new Anb(c2.j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 12); - h.e.c.length == 0 || RD(Vmb(h.e, 0), 18).c.i.c != c2.c && (n = RD(Vmb(h.e, 0), 18).c); - } - if (!!l && !!n) { - k = l.i; - m = n.i; - if (!!k && k == m) { - for (p = new Anb(k.j); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 12); - if (o2 == l) { - erc(a, c2, b); - return -1; - } else if (o2 == n) { - erc(a, b, c2); - return 1; - } - } - return hgb(drc(a, b), drc(a, c2)); - } - for (r = a.d, s = 0, t = r.length; s < t; ++s) { - q = r[s]; - if (q == k) { - erc(a, c2, b); - return -1; - } else if (q == m) { - erc(a, b, c2); - return 1; - } - } - } - if (!nQb(b, (Ywc(), zwc)) || !nQb(c2, zwc)) { - e = drc(a, b); - g = drc(a, c2); - e > g ? erc(a, b, c2) : erc(a, c2, b); - return e < g ? -1 : e > g ? 1 : 0; - } - } - d = RD(mQb(b, (Ywc(), zwc)), 17).a; - f2 = RD(mQb(c2, zwc), 17).a; - d > f2 ? erc(a, b, c2) : erc(a, c2, b); - return d < f2 ? -1 : d > f2 ? 1 : 0; - } - function uAd(b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - if (d == null) { - return null; - } - if (b.a != c2.jk()) { - throw Adb(new agb(VHe + c2.xe() + WHe)); - } - if (ZD(c2, 469)) { - r = z1d(RD(c2, 685), d); - if (!r) { - throw Adb(new agb(XHe + d + "' is not a valid enumerator of '" + c2.xe() + "'")); - } - return r; - } - switch (Oee((lke(), jke), c2).Nl()) { - case 2: { - d = nue(d, false); - break; - } - case 3: { - d = nue(d, true); - break; - } - } - e = Oee(jke, c2).Jl(); - if (e) { - return e.jk().wi().ti(e, d); - } - n = Oee(jke, c2).Ll(); - if (n) { - r = new bnb(); - for (k = xAd(d), l = 0, m = k.length; l < m; ++l) { - j = k[l]; - Rmb(r, n.jk().wi().ti(n, j)); - } - return r; - } - q = Oee(jke, c2).Ml(); - if (!q.dc()) { - for (p = q.Kc(); p.Ob(); ) { - o2 = RD(p.Pb(), 156); - try { - r = o2.jk().wi().ti(o2, d); - if (r != null) { - return r; - } - } catch (a) { - a = zdb(a); - if (!ZD(a, 63)) - throw Adb(a); - } - } - throw Adb(new agb(XHe + d + "' does not match any member types of the union datatype '" + c2.xe() + "'")); - } - RD(c2, 847).ok(); - f2 = Qje(c2.kk()); - if (!f2) - return null; - if (f2 == SI) { - h = 0; - try { - h = Oeb(d, qwe, lve) & Bwe; - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - g = Ahb(d); - h = g[0]; - } else - throw Adb(a); - } - return hfb(h); - } - if (f2 == qK) { - for (i2 = 0; i2 < nAd.length; ++i2) { - try { - return b2d(nAd[i2], d); - } catch (a) { - a = zdb(a); - if (!ZD(a, 33)) - throw Adb(a); - } - } - throw Adb(new agb(XHe + d + "' is not a date formatted string of the form yyyy-MM-dd'T'HH:mm:ss'.'SSSZ or a valid subset thereof")); - } - throw Adb(new agb(XHe + d + "' is invalid. ")); - } - function z$b() { - z$b = geb; - y$b = new Tp(); - Rc(y$b, (qpd(), bpd), fpd); - Rc(y$b, mpd, fpd); - Rc(y$b, mpd, ipd); - Rc(y$b, Zod, epd); - Rc(y$b, Zod, fpd); - Rc(y$b, cpd, fpd); - Rc(y$b, cpd, gpd); - Rc(y$b, kpd, _od); - Rc(y$b, kpd, fpd); - Rc(y$b, hpd, apd); - Rc(y$b, hpd, fpd); - Rc(y$b, hpd, gpd); - Rc(y$b, hpd, _od); - Rc(y$b, apd, hpd); - Rc(y$b, apd, ipd); - Rc(y$b, apd, epd); - Rc(y$b, apd, fpd); - Rc(y$b, jpd, jpd); - Rc(y$b, jpd, gpd); - Rc(y$b, jpd, ipd); - Rc(y$b, dpd, dpd); - Rc(y$b, dpd, gpd); - Rc(y$b, dpd, epd); - Rc(y$b, lpd, lpd); - Rc(y$b, lpd, _od); - Rc(y$b, lpd, ipd); - Rc(y$b, $od, $od); - Rc(y$b, $od, _od); - Rc(y$b, $od, epd); - Rc(y$b, gpd, cpd); - Rc(y$b, gpd, hpd); - Rc(y$b, gpd, jpd); - Rc(y$b, gpd, dpd); - Rc(y$b, gpd, fpd); - Rc(y$b, gpd, gpd); - Rc(y$b, gpd, ipd); - Rc(y$b, gpd, epd); - Rc(y$b, _od, kpd); - Rc(y$b, _od, hpd); - Rc(y$b, _od, lpd); - Rc(y$b, _od, $od); - Rc(y$b, _od, _od); - Rc(y$b, _od, ipd); - Rc(y$b, _od, epd); - Rc(y$b, _od, fpd); - Rc(y$b, ipd, mpd); - Rc(y$b, ipd, apd); - Rc(y$b, ipd, jpd); - Rc(y$b, ipd, lpd); - Rc(y$b, ipd, gpd); - Rc(y$b, ipd, _od); - Rc(y$b, ipd, ipd); - Rc(y$b, ipd, fpd); - Rc(y$b, epd, Zod); - Rc(y$b, epd, apd); - Rc(y$b, epd, dpd); - Rc(y$b, epd, $od); - Rc(y$b, epd, gpd); - Rc(y$b, epd, _od); - Rc(y$b, epd, epd); - Rc(y$b, epd, fpd); - Rc(y$b, fpd, bpd); - Rc(y$b, fpd, mpd); - Rc(y$b, fpd, Zod); - Rc(y$b, fpd, cpd); - Rc(y$b, fpd, kpd); - Rc(y$b, fpd, hpd); - Rc(y$b, fpd, apd); - Rc(y$b, fpd, gpd); - Rc(y$b, fpd, _od); - Rc(y$b, fpd, ipd); - Rc(y$b, fpd, epd); - Rc(y$b, fpd, fpd); - } - function _$b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B; - a.d = new rjd(oxe, oxe); - a.c = new rjd(pxe, pxe); - for (m = b.Kc(); m.Ob(); ) { - k = RD(m.Pb(), 36); - for (t = new Anb(k.a); t.a < t.c.c.length; ) { - s = RD(ynb(t), 10); - a.d.a = $wnd.Math.min(a.d.a, s.n.a - s.d.b); - a.d.b = $wnd.Math.min(a.d.b, s.n.b - s.d.d); - a.c.a = $wnd.Math.max(a.c.a, s.n.a + s.o.a + s.d.c); - a.c.b = $wnd.Math.max(a.c.b, s.n.b + s.o.b + s.d.a); - } - } - h = new q_b(); - for (l = b.Kc(); l.Ob(); ) { - k = RD(l.Pb(), 36); - d = i_b(a, k); - Rmb(h.a, d); - d.a = d.a | !RD(mQb(d.c, (Ywc(), ewc)), 21).dc(); - } - a.b = (NXb(), B = new XXb(), B.f = new EXb(c2), B.b = DXb(B.f, h), B); - RXb((o2 = a.b, new Oqd(), o2)); - a.e = new pjd(); - a.a = a.b.f.e; - for (g = new Anb(h.a); g.a < g.c.c.length; ) { - e = RD(ynb(g), 855); - u = SXb(a.b, e); - o2b(e.c, u.a, u.b); - for (q = new Anb(e.c.a); q.a < q.c.c.length; ) { - p = RD(ynb(q), 10); - if (p.k == (r3b(), m3b)) { - r = d_b(a, p.n, RD(mQb(p, (Ywc(), hwc)), 64)); - $id(hjd(p.n), r); - } - } - } - for (f2 = new Anb(h.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 855); - for (j = new Anb(o_b(e)); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 18); - A = new Fjd(i2.a); - hu(A, 0, K3b(i2.c)); - Mub(A, K3b(i2.d)); - n = null; - for (w2 = Sub(A, 0); w2.b != w2.d.c; ) { - v = RD(evb(w2), 8); - if (!n) { - n = v; - continue; - } - if (_y(n.a, v.a)) { - a.e.a = $wnd.Math.min(a.e.a, n.a); - a.a.a = $wnd.Math.max(a.a.a, n.a); - } else if (_y(n.b, v.b)) { - a.e.b = $wnd.Math.min(a.e.b, n.b); - a.a.b = $wnd.Math.max(a.a.b, n.b); - } - n = v; - } - } - } - fjd(a.e); - $id(a.a, a.e); - } - function vib(a, b) { - var c2, d, e, f2, g, h, i2, j; - c2 = 0; - g = 0; - f2 = b.length; - h = null; - j = new cib(); - if (g < f2 && (BFb(g, b.length), b.charCodeAt(g) == 43)) { - ++g; - ++c2; - if (g < f2 && (BFb(g, b.length), b.charCodeAt(g) == 43 || (BFb(g, b.length), b.charCodeAt(g) == 45))) { - throw Adb(new Vgb(nxe + b + '"')); - } - } - while (g < f2 && (BFb(g, b.length), b.charCodeAt(g) != 46) && (BFb(g, b.length), b.charCodeAt(g) != 101) && (BFb(g, b.length), b.charCodeAt(g) != 69)) { - ++g; - } - j.a += "" + zhb(b == null ? vve : (uFb(b), b), c2, g); - if (g < f2 && (BFb(g, b.length), b.charCodeAt(g) == 46)) { - ++g; - c2 = g; - while (g < f2 && (BFb(g, b.length), b.charCodeAt(g) != 101) && (BFb(g, b.length), b.charCodeAt(g) != 69)) { - ++g; - } - a.e = g - c2; - j.a += "" + zhb(b == null ? vve : (uFb(b), b), c2, g); - } else { - a.e = 0; - } - if (g < f2 && (BFb(g, b.length), b.charCodeAt(g) == 101 || (BFb(g, b.length), b.charCodeAt(g) == 69))) { - ++g; - c2 = g; - if (g < f2 && (BFb(g, b.length), b.charCodeAt(g) == 43)) { - ++g; - g < f2 && (BFb(g, b.length), b.charCodeAt(g) != 45) && ++c2; - } - h = (AFb(c2, f2, b.length), b.substr(c2, f2 - c2)); - a.e = a.e - Oeb(h, qwe, lve); - if (a.e != eE(a.e)) { - throw Adb(new Vgb("Scale out of range.")); - } - } - i2 = j.a; - if (i2.length < 16) { - a.f = (sib == null && (sib = new RegExp("^[+-]?\\d*$", "i")), sib.test(i2) ? parseInt(i2, 10) : NaN); - if (isNaN(a.f)) { - throw Adb(new Vgb(nxe + b + '"')); - } - a.a = Cib(a.f); - } else { - wib(a, new ejb(i2)); - } - a.d = j.a.length; - for (e = 0; e < j.a.length; ++e) { - d = ihb(j.a, e); - if (d != 45 && d != 48) { - break; - } - --a.d; - } - a.d == 0 && (a.d = 1); - } - function Wae(a) { - _Ad(a.b, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "ConsistentTransient"])); - _Ad(a.a, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "WellFormedSourceURI"])); - _Ad(a.o, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "InterfaceIsAbstract AtMostOneID UniqueFeatureNames UniqueOperationSignatures NoCircularSuperTypes WellFormedMapEntryClass ConsistentSuperTypes DisjointFeatureAndOperationSignatures"])); - _Ad(a.p, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "WellFormedInstanceTypeName UniqueTypeParameterNames"])); - _Ad(a.v, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "UniqueEnumeratorNames UniqueEnumeratorLiterals"])); - _Ad(a.R, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "WellFormedName"])); - _Ad(a.T, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "UniqueParameterNames UniqueTypeParameterNames NoRepeatingVoid"])); - _Ad(a.U, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "WellFormedNsURI WellFormedNsPrefix UniqueSubpackageNames UniqueClassifierNames UniqueNsURIs"])); - _Ad(a.W, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "ConsistentOpposite SingleContainer ConsistentKeys ConsistentUnique ConsistentContainer"])); - _Ad(a.bb, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "ValidDefaultValueLiteral"])); - _Ad(a.eb, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "ValidLowerBound ValidUpperBound ConsistentBounds ValidType"])); - _Ad(a.H, AKe, cD(WC(qJ, 1), Nve, 2, 6, [CKe, "ConsistentType ConsistentBounds ConsistentArguments"])); - } - function S7b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C; - if (b.dc()) { - return; - } - e = new Ejd(); - h = c2 ? c2 : RD(b.Xb(0), 18); - o2 = h.c; - HUc(); - m = o2.i.k; - if (!(m == (r3b(), p3b) || m == q3b || m == m3b || m == l3b)) { - throw Adb(new agb("The target node of the edge must be a normal node or a northSouthPort.")); - } - Oub(e, xjd(cD(WC(l3, 1), Nve, 8, 0, [o2.i.n, o2.n, o2.a]))); - if ((qpd(), hpd).Hc(o2.j)) { - q = Kfb(UD(mQb(o2, (Ywc(), Swc)))); - l = new rjd(xjd(cD(WC(l3, 1), Nve, 8, 0, [o2.i.n, o2.n, o2.a])).a, q); - Pub(e, l, e.c.b, e.c); - } - k = null; - d = false; - i2 = b.Kc(); - while (i2.Ob()) { - g = RD(i2.Pb(), 18); - f2 = g.a; - if (f2.b != 0) { - if (d) { - j = ijd($id(k, (sFb(f2.b != 0), RD(f2.a.a.c, 8))), 0.5); - Pub(e, j, e.c.b, e.c); - d = false; - } else { - d = true; - } - k = ajd((sFb(f2.b != 0), RD(f2.c.b.c, 8))); - ye(e, f2); - Xub(f2); - } - } - p = h.d; - if (hpd.Hc(p.j)) { - q = Kfb(UD(mQb(p, (Ywc(), Swc)))); - l = new rjd(xjd(cD(WC(l3, 1), Nve, 8, 0, [p.i.n, p.n, p.a])).a, q); - Pub(e, l, e.c.b, e.c); - } - Oub(e, xjd(cD(WC(l3, 1), Nve, 8, 0, [p.i.n, p.n, p.a]))); - a.d == (lFc(), iFc) && (r = (sFb(e.b != 0), RD(e.a.a.c, 8)), s = RD(ju(e, 1), 8), t = new qjd(BVc(o2.j)), t.a *= 5, t.b *= 5, u = ojd(new rjd(s.a, s.b), r), v = new rjd(R7b(t.a, u.a), R7b(t.b, u.b)), $id(v, r), w2 = Sub(e, 1), cvb(w2, v), A = (sFb(e.b != 0), RD(e.c.b.c, 8)), B = RD(ju(e, e.b - 2), 8), t = new qjd(BVc(p.j)), t.a *= 5, t.b *= 5, u = ojd(new rjd(B.a, B.b), A), C = new rjd(R7b(t.a, u.a), R7b(t.b, u.b)), $id(C, A), hu(e, e.b - 1, C), void 0); - n = new wUc(e); - ye(h.a, sUc(n)); - } - function cud(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I, J, K2, L, M, N, O, P; - t = RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84); - v = t.nh(); - w2 = t.oh(); - u = t.mh() / 2; - p = t.lh() / 2; - if (ZD(t, 193)) { - s = RD(t, 123); - v += MCd(s).i; - v += MCd(s).i; - } - v += u; - w2 += p; - F = RD(QHd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b), 0), 84); - H = F.nh(); - I = F.oh(); - G = F.mh() / 2; - A = F.lh() / 2; - if (ZD(F, 193)) { - D5 = RD(F, 123); - H += MCd(D5).i; - H += MCd(D5).i; - } - H += G; - I += A; - if ((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i == 0) { - h = (bvd(), j = new Rzd(), j); - WGd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a), h); - } else if ((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i > 1) { - o2 = new mMd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a)); - while (o2.e != o2.i.gc()) { - cMd(o2); - } - } - g = RD(QHd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a), 0), 166); - q = H; - H > v + u ? q = v + u : H < v - u && (q = v - u); - r = I; - I > w2 + p ? r = w2 + p : I < w2 - p && (r = w2 - p); - q > v - u && q < v + u && r > w2 - p && r < w2 + p && (q = v + u); - Ozd(g, q); - Pzd(g, r); - B = v; - v > H + G ? B = H + G : v < H - G && (B = H - G); - C = w2; - w2 > I + A ? C = I + A : w2 < I - A && (C = I - A); - B > H - G && B < H + G && C > I - A && C < I + A && (C = I + A); - Hzd(g, B); - Izd(g, C); - sLd((!g.a && (g.a = new XZd(D4, g, 5)), g.a)); - f2 = Jwb(b, 5); - t == F && ++f2; - L = B - q; - O = C - r; - J = $wnd.Math.sqrt(L * L + O * O); - l = J * 0.20000000298023224; - M = L / (f2 + 1); - P = O / (f2 + 1); - K2 = q; - N = r; - for (k = 0; k < f2; k++) { - K2 += M; - N += P; - m = K2 + Kwb(b, 24) * Nxe * l - l / 2; - m < 0 ? m = 1 : m > c2 && (m = c2 - 1); - n = N + Kwb(b, 24) * Nxe * l - l / 2; - n < 0 ? n = 1 : n > d && (n = d - 1); - e = (bvd(), i2 = new Xxd(), i2); - Vxd(e, m); - Wxd(e, n); - WGd((!g.a && (g.a = new XZd(D4, g, 5)), g.a), e); - } - } - function Y7c(a) { - Cgd(a, new Pfd($fd(Xfd(Zfd(Yfd(new agd(), $Fe), "ELK Rectangle Packing"), "Algorithm for packing of unconnected boxes, i.e. graphs without edges. The given order of the boxes is always preserved and the main reading direction of the boxes is left to right. The algorithm is divided into two phases. One phase approximates the width in which the rectangles can be placed. The next phase places the rectangles in rows using the previously calculated width as bounding width and bundles rectangles with a similar height in blocks. A compaction step reduces the size of the drawing. Finally, the rectangles are expanded to fill their bounding box and eliminate empty unused spaces."), new _7c()))); - Agd(a, $Fe, Dze, 1.3); - Agd(a, $Fe, hAe, (Geb(), false)); - Agd(a, $Fe, Eze, O7c); - Agd(a, $Fe, _ze, 15); - Agd(a, $Fe, YDe, iGd(y7c)); - Agd(a, $Fe, jAe, iGd(F7c)); - Agd(a, $Fe, CAe, iGd(H7c)); - Agd(a, $Fe, iAe, iGd(I7c)); - Agd(a, $Fe, kAe, iGd(E7c)); - Agd(a, $Fe, gAe, iGd(J7c)); - Agd(a, $Fe, lAe, iGd(P7c)); - Agd(a, $Fe, RFe, iGd(U7c)); - Agd(a, $Fe, SFe, iGd(T7c)); - Agd(a, $Fe, QFe, iGd(W7c)); - Agd(a, $Fe, PFe, iGd(V7c)); - Agd(a, $Fe, TFe, iGd(M7c)); - Agd(a, $Fe, UFe, iGd(L7c)); - Agd(a, $Fe, VFe, iGd(K7c)); - Agd(a, $Fe, WFe, iGd(S7c)); - Agd(a, $Fe, dAe, iGd(B7c)); - Agd(a, $Fe, iEe, iGd(C7c)); - Agd(a, $Fe, NFe, iGd(A7c)); - Agd(a, $Fe, MFe, iGd(z7c)); - Agd(a, $Fe, OFe, iGd(D7c)); - Agd(a, $Fe, LFe, iGd(R7c)); - } - function Ajb(a, b) { - xjb(); - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H; - B = a.e; - o2 = a.d; - e = a.a; - if (B == 0) { - switch (b) { - case 0: - return "0"; - case 1: - return zxe; - case 2: - return "0.00"; - case 3: - return "0.000"; - case 4: - return "0.0000"; - case 5: - return "0.00000"; - case 6: - return "0.000000"; - default: - w2 = new bib(); - b < 0 ? (w2.a += "0E+", w2) : (w2.a += "0E", w2); - w2.a += -b; - return w2.a; - } - } - t = o2 * 10 + 1 + 7; - u = $C(hE, zwe, 28, t + 1, 15, 1); - c2 = t; - if (o2 == 1) { - h = e[0]; - if (h < 0) { - H = Cdb(h, yxe); - do { - p = H; - H = Fdb(H, 10); - u[--c2] = 48 + Ydb(Vdb(p, Ndb(H, 10))) & Bwe; - } while (Ddb(H, 0) != 0); - } else { - H = h; - do { - p = H; - H = H / 10 | 0; - u[--c2] = 48 + (p - H * 10) & Bwe; - } while (H != 0); - } - } else { - D5 = $C(kE, Pwe, 28, o2, 15, 1); - G = o2; - hib(e, 0, D5, 0, G); - I: - while (true) { - A = 0; - for (j = G - 1; j >= 0; j--) { - F = Bdb(Sdb(A, 32), Cdb(D5[j], yxe)); - r = yjb(F); - D5[j] = Ydb(r); - A = Ydb(Tdb(r, 32)); - } - s = Ydb(A); - q = c2; - do { - u[--c2] = 48 + s % 10 & Bwe; - } while ((s = s / 10 | 0) != 0 && c2 != 0); - d = 9 - q + c2; - for (i2 = 0; i2 < d && c2 > 0; i2++) { - u[--c2] = 48; - } - l = G - 1; - for (; D5[l] == 0; l--) { - if (l == 0) { - break I; - } - } - G = l + 1; - } - while (u[c2] == 48) { - ++c2; - } - } - n = B < 0; - g = t - c2 - b - 1; - if (b == 0) { - n && (u[--c2] = 45); - return Ihb(u, c2, t - c2); - } - if (b > 0 && g >= -6) { - if (g >= 0) { - k = c2 + g; - for (m = t - 1; m >= k; m--) { - u[m + 1] = u[m]; - } - u[++k] = 46; - n && (u[--c2] = 45); - return Ihb(u, c2, t - c2 + 1); - } - for (l = 2; l < -g + 1; l++) { - u[--c2] = 48; - } - u[--c2] = 46; - u[--c2] = 48; - n && (u[--c2] = 45); - return Ihb(u, c2, t - c2); - } - C = c2 + 1; - f2 = t; - v = new cib(); - n && (v.a += "-", v); - if (f2 - C >= 1) { - Thb(v, u[c2]); - v.a += "."; - v.a += Ihb(u, c2 + 1, t - c2 - 1); - } else { - v.a += Ihb(u, c2, t - c2); - } - v.a += "E"; - g > 0 && (v.a += "+", v); - v.a += "" + g; - return v.a; - } - function Jad(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - a.c = b; - a.g = new Tsb(); - c2 = (lud(), new zud(a.c)); - d = new PJb(c2); - LJb(d); - t = WD(Gxd(a.c, (ncd(), gcd))); - i2 = RD(Gxd(a.c, icd), 324); - v = RD(Gxd(a.c, jcd), 437); - g = RD(Gxd(a.c, bcd), 490); - u = RD(Gxd(a.c, hcd), 438); - a.j = Kfb(UD(Gxd(a.c, kcd))); - h = a.a; - switch (i2.g) { - case 0: - h = a.a; - break; - case 1: - h = a.b; - break; - case 2: - h = a.i; - break; - case 3: - h = a.e; - break; - case 4: - h = a.f; - break; - default: - throw Adb(new agb(eGe + (i2.f != null ? i2.f : "" + i2.g))); - } - a.d = new qbd(h, v, g); - pQb(a.d, (OQb(), MQb), TD(Gxd(a.c, dcd))); - a.d.c = Heb(TD(Gxd(a.c, ccd))); - if (tCd(a.c).i == 0) { - return a.d; - } - for (l = new dMd(tCd(a.c)); l.e != l.i.gc(); ) { - k = RD(bMd(l), 27); - n = k.g / 2; - m = k.f / 2; - w2 = new rjd(k.i + n, k.j + m); - while (Ujb(a.g, w2)) { - Zid(w2, ($wnd.Math.random() - 0.5) * Vze, ($wnd.Math.random() - 0.5) * Vze); - } - p = RD(Gxd(k, (umd(), eld)), 140); - q = new TQb(w2, new Uid2(w2.a - n - a.j / 2 - p.b, w2.b - m - a.j / 2 - p.d, k.g + a.j + (p.b + p.c), k.f + a.j + (p.d + p.a))); - Rmb(a.d.i, q); - Zjb(a.g, w2, new Ptd(q, k)); - } - switch (u.g) { - case 0: - if (t == null) { - a.d.d = RD(Vmb(a.d.i, 0), 68); - } else { - for (s = new Anb(a.d.i); s.a < s.c.c.length; ) { - q = RD(ynb(s), 68); - o2 = RD(RD(Wjb(a.g, q.a), 42).b, 27).jh(); - o2 != null && lhb(o2, t) && (a.d.d = q); - } - } - break; - case 1: - e = new rjd(a.c.g, a.c.f); - e.a *= 0.5; - e.b *= 0.5; - Zid(e, a.c.i, a.c.j); - f2 = oxe; - for (r = new Anb(a.d.i); r.a < r.c.c.length; ) { - q = RD(ynb(r), 68); - j = bjd(q.a, e); - if (j < f2) { - f2 = j; - a.d.d = q; - } - } - break; - default: - throw Adb(new agb(eGe + (u.f != null ? u.f : "" + u.g))); - } - return a.d; - } - function b5b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - m = 0; - for (e = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - if (!Heb(TD(Gxd(d, (yCc(), pBc))))) { - k = vCd(d); - if ((dE(Gxd(k, cAc)) !== dE((kEc(), hEc)) || dE(Gxd(k, pAc)) === dE((Ptc(), Otc)) || dE(Gxd(k, pAc)) === dE((Ptc(), Mtc)) || Heb(TD(Gxd(k, eAc))) || dE(Gxd(k, Yzc)) !== dE((U$b(), T$b)) || dE(Gxd(k, ZAc)) === dE((aEc(), TDc)) || dE(Gxd(k, ZAc)) === dE((aEc(), UDc)) || dE(Gxd(k, $Ac)) === dE((_Cc(), SCc)) || dE(Gxd(k, $Ac)) === dE((_Cc(), UCc))) && !Heb(TD(Gxd(d, aAc)))) { - Ixd(d, (Ywc(), zwc), sgb(m)); - ++m; - } - i5b(a, d, c2); - } - } - m = 0; - for (j = new dMd((!b.b && (b.b = new C5d(G4, b, 12, 3)), b.b)); j.e != j.i.gc(); ) { - h = RD(bMd(j), 74); - if (dE(Gxd(b, (yCc(), cAc))) !== dE((kEc(), hEc)) || dE(Gxd(b, pAc)) === dE((Ptc(), Otc)) || dE(Gxd(b, pAc)) === dE((Ptc(), Mtc)) || Heb(TD(Gxd(b, eAc))) || dE(Gxd(b, Yzc)) !== dE((U$b(), T$b)) || dE(Gxd(b, ZAc)) === dE((aEc(), TDc)) || dE(Gxd(b, ZAc)) === dE((aEc(), UDc)) || dE(Gxd(b, $Ac)) === dE((_Cc(), SCc)) || dE(Gxd(b, $Ac)) === dE((_Cc(), UCc))) { - Ixd(h, (Ywc(), zwc), sgb(m)); - ++m; - } - p = JGd(h); - q = LGd(h); - l = Heb(TD(Gxd(p, NAc))); - o2 = !Heb(TD(Gxd(h, pBc))); - n = l && ozd(h) && Heb(TD(Gxd(h, OAc))); - f2 = vCd(p) == b && vCd(p) == vCd(q); - g = (vCd(p) == b && q == b) ^ (vCd(q) == b && p == b); - o2 && !n && (g || f2) && f5b(a, h, b, c2); - } - if (vCd(b)) { - for (i2 = new dMd(uCd(vCd(b))); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 74); - p = JGd(h); - if (p == b && ozd(h)) { - n = Heb(TD(Gxd(p, (yCc(), NAc)))) && Heb(TD(Gxd(h, OAc))); - n && f5b(a, h, b, c2); - } - } - } - } - function SFc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I, J, K2, L; - c2.Ug("Greedy cycle removal", 1); - t = b.a; - L = t.c.length; - a.a = $C(kE, Pwe, 28, L, 15, 1); - a.c = $C(kE, Pwe, 28, L, 15, 1); - a.b = $C(kE, Pwe, 28, L, 15, 1); - j = 0; - for (r = new Anb(t); r.a < r.c.c.length; ) { - p = RD(ynb(r), 10); - p.p = j; - for (C = new Anb(p.j); C.a < C.c.c.length; ) { - w2 = RD(ynb(C), 12); - for (h = new Anb(w2.e); h.a < h.c.c.length; ) { - d = RD(ynb(h), 18); - if (d.c.i == p) { - continue; - } - G = RD(mQb(d, (yCc(), KBc)), 17).a; - a.a[j] += G > 0 ? G + 1 : 1; - } - for (g = new Anb(w2.g); g.a < g.c.c.length; ) { - d = RD(ynb(g), 18); - if (d.d.i == p) { - continue; - } - G = RD(mQb(d, (yCc(), KBc)), 17).a; - a.c[j] += G > 0 ? G + 1 : 1; - } - } - a.c[j] == 0 ? Mub(a.e, p) : a.a[j] == 0 && Mub(a.f, p); - ++j; - } - o2 = -1; - n = 1; - l = new bnb(); - a.d = RD(mQb(b, (Ywc(), Lwc)), 234); - while (L > 0) { - while (a.e.b != 0) { - I = RD(Uub(a.e), 10); - a.b[I.p] = o2--; - TFc(a, I); - --L; - } - while (a.f.b != 0) { - J = RD(Uub(a.f), 10); - a.b[J.p] = n++; - TFc(a, J); - --L; - } - if (L > 0) { - m = qwe; - for (s = new Anb(t); s.a < s.c.c.length; ) { - p = RD(ynb(s), 10); - if (a.b[p.p] == 0) { - u = a.c[p.p] - a.a[p.p]; - if (u >= m) { - if (u > m) { - l.c.length = 0; - m = u; - } - ZEb(l.c, p); - } - } - } - k = a.sg(l); - a.b[k.p] = n++; - TFc(a, k); - --L; - } - } - H = t.c.length + 1; - for (j = 0; j < t.c.length; j++) { - a.b[j] < 0 && (a.b[j] += H); - } - for (q = new Anb(t); q.a < q.c.c.length; ) { - p = RD(ynb(q), 10); - F = u2b(p.j); - for (A = F, B = 0, D5 = A.length; B < D5; ++B) { - w2 = A[B]; - v = s2b(w2.g); - for (e = v, f2 = 0, i2 = e.length; f2 < i2; ++f2) { - d = e[f2]; - K2 = d.d.i.p; - if (a.b[p.p] > a.b[K2]) { - X0b(d, true); - pQb(b, awc, (Geb(), true)); - } - } - } - } - a.a = null; - a.c = null; - a.b = null; - Xub(a.f); - Xub(a.e); - c2.Vg(); - } - function usd(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - v = RD(QHd((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a), 0), 166); - k = new Ejd(); - u = new Tsb(); - w2 = xsd(v); - rtb(u.f, v, w2); - m = new Tsb(); - d = new Yub(); - for (o2 = Fl(Al(cD(WC(cJ, 1), rve, 20, 0, [(!b.d && (b.d = new Yie(G4, b, 8, 5)), b.d), (!b.e && (b.e = new Yie(G4, b, 7, 4)), b.e)]))); gs(o2); ) { - n = RD(hs(o2), 74); - if ((!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i != 1) { - throw Adb(new agb(tHe + (!a.a && (a.a = new C5d(F4, a, 6, 6)), a.a).i)); - } - if (n != a) { - q = RD(QHd((!n.a && (n.a = new C5d(F4, n, 6, 6)), n.a), 0), 166); - Pub(d, q, d.c.b, d.c); - p = RD(Wd(qtb(u.f, q)), 13); - if (!p) { - p = xsd(q); - rtb(u.f, q, p); - } - l = c2 ? ojd(new sjd(RD(Vmb(w2, w2.c.length - 1), 8)), RD(Vmb(p, p.c.length - 1), 8)) : ojd(new sjd((tFb(0, w2.c.length), RD(w2.c[0], 8))), (tFb(0, p.c.length), RD(p.c[0], 8))); - rtb(m.f, q, l); - } - } - if (d.b != 0) { - r = RD(Vmb(w2, c2 ? w2.c.length - 1 : 0), 8); - for (j = 1; j < w2.c.length; j++) { - s = RD(Vmb(w2, c2 ? w2.c.length - 1 - j : j), 8); - e = Sub(d, 0); - while (e.b != e.d.c) { - q = RD(evb(e), 166); - p = RD(Wd(qtb(u.f, q)), 13); - if (p.c.length <= j) { - gvb(e); - } else { - t = $id(new sjd(RD(Vmb(p, c2 ? p.c.length - 1 - j : j), 8)), RD(Wd(qtb(m.f, q)), 8)); - if (s.a != t.a || s.b != t.b) { - f2 = s.a - r.a; - h = s.b - r.b; - g = t.a - r.a; - i2 = t.b - r.b; - g * h == i2 * f2 && (f2 == 0 || isNaN(f2) ? f2 : f2 < 0 ? -1 : 1) == (g == 0 || isNaN(g) ? g : g < 0 ? -1 : 1) && (h == 0 || isNaN(h) ? h : h < 0 ? -1 : 1) == (i2 == 0 || isNaN(i2) ? i2 : i2 < 0 ? -1 : 1) ? ($wnd.Math.abs(f2) < $wnd.Math.abs(g) || $wnd.Math.abs(h) < $wnd.Math.abs(i2)) && (Pub(k, s, k.c.b, k.c), true) : j > 1 && (Pub(k, r, k.c.b, k.c), true); - gvb(e); - } - } - } - r = s; - } - } - return k; - } - function S_c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - c2.Ug(_Ee, 1); - D5 = RD(zDb(CDb(new SDb(null, new Swb(b, 16)), new e0c()), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - k = RD(zDb(CDb(new SDb(null, new Swb(b, 16)), new g0c(b)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 15); - o2 = RD(zDb(CDb(new SDb(null, new Swb(b, 16)), new i0c(b)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 15); - p = $C(Z$, NEe, 40, b.gc(), 0, 1); - for (g = 0; g < k.gc(); g++) { - e = RD(k.Xb(g), 40); - C = RD(mQb(e, (h_c(), W$c)), 17).a; - if (C >= 0 && C < k.gc() && !p[C]) { - p[C] = e; - k.gd(g); - --g; - } - } - for (h = 0; h < k.gc(); h++) { - e = RD(k.Xb(h), 40); - C = RD(mQb(e, (h_c(), W$c)), 17).a; - for (m = 0; ; m++) { - n = C + m; - if (n < p.length && n >= 0 && !p[n]) { - p[n] = e; - k.gd(h); - --h; - break; - } - n = C - m; - if (n < p.length && n >= 0 && !p[n]) { - p[n] = e; - k.gd(h); - --h; - break; - } - } - } - o2.jd(new k0c()); - for (i2 = p.length - 1; i2 >= 0; i2--) { - if (!p[i2] && !o2.dc()) { - p[i2] = RD(o2.Xb(0), 40); - o2.gd(0); - } - } - for (j = 0; j < p.length; j++) { - if (!p[j] && !D5.dc()) { - p[j] = RD(D5.Xb(0), 40); - D5.gd(0); - } - } - for (f2 = 0; f2 < p.length; f2++) { - pQb(p[f2], (q$c(), i$c), sgb(f2)); - } - l = RD(RDb(CDb(new SDb(null, new Swb(b, 16)), new o0c())), 534); - for (w2 = l, A = 0, B = w2.length; A < B; ++A) { - v = w2[A]; - d = $Wc(v); - S_c(a, d, c2.eh(1 / l.length | 0)); - yob(); - tvb(d, new uGd((q$c(), i$c))); - q = new Yub(); - for (u = Sub(d, 0); u.b != u.d.c; ) { - t = RD(evb(u), 40); - for (s = Sub(v.d, 0); s.b != s.d.c; ) { - r = RD(evb(s), 65); - r.c == t && (Pub(q, r, q.c.b, q.c), true); - } - } - Xub(v.d); - ye(v.d, q); - } - c2.Vg(); - } - function jTb(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - d = new bnb(); - h = new bnb(); - q = b / 2; - n = a.gc(); - e = RD(a.Xb(0), 8); - r = RD(a.Xb(1), 8); - o2 = kTb(e.a, e.b, r.a, r.b, q); - Rmb(d, (tFb(0, o2.c.length), RD(o2.c[0], 8))); - Rmb(h, (tFb(1, o2.c.length), RD(o2.c[1], 8))); - for (j = 2; j < n; j++) { - p = e; - e = r; - r = RD(a.Xb(j), 8); - o2 = kTb(e.a, e.b, p.a, p.b, q); - Rmb(d, (tFb(1, o2.c.length), RD(o2.c[1], 8))); - Rmb(h, (tFb(0, o2.c.length), RD(o2.c[0], 8))); - o2 = kTb(e.a, e.b, r.a, r.b, q); - Rmb(d, (tFb(0, o2.c.length), RD(o2.c[0], 8))); - Rmb(h, (tFb(1, o2.c.length), RD(o2.c[1], 8))); - } - o2 = kTb(r.a, r.b, e.a, e.b, q); - Rmb(d, (tFb(1, o2.c.length), RD(o2.c[1], 8))); - Rmb(h, (tFb(0, o2.c.length), RD(o2.c[0], 8))); - c2 = new Ejd(); - g = new bnb(); - Mub(c2, (tFb(0, d.c.length), RD(d.c[0], 8))); - for (k = 1; k < d.c.length - 2; k += 2) { - f2 = (tFb(k, d.c.length), RD(d.c[k], 8)); - m = iTb((tFb(k - 1, d.c.length), RD(d.c[k - 1], 8)), f2, (tFb(k + 1, d.c.length), RD(d.c[k + 1], 8)), (tFb(k + 2, d.c.length), RD(d.c[k + 2], 8))); - !isFinite(m.a) || !isFinite(m.b) ? (Pub(c2, f2, c2.c.b, c2.c), true) : (Pub(c2, m, c2.c.b, c2.c), true); - } - Mub(c2, RD(Vmb(d, d.c.length - 1), 8)); - Rmb(g, (tFb(0, h.c.length), RD(h.c[0], 8))); - for (l = 1; l < h.c.length - 2; l += 2) { - f2 = (tFb(l, h.c.length), RD(h.c[l], 8)); - m = iTb((tFb(l - 1, h.c.length), RD(h.c[l - 1], 8)), f2, (tFb(l + 1, h.c.length), RD(h.c[l + 1], 8)), (tFb(l + 2, h.c.length), RD(h.c[l + 2], 8))); - !isFinite(m.a) || !isFinite(m.b) ? (ZEb(g.c, f2), true) : (ZEb(g.c, m), true); - } - Rmb(g, RD(Vmb(h, h.c.length - 1), 8)); - for (i2 = g.c.length - 1; i2 >= 0; i2--) { - Mub(c2, (tFb(i2, g.c.length), RD(g.c[i2], 8))); - } - return c2; - } - function l9c(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - t = Kfb(UD(Gxd(b, (X6c(), W6c)))); - n = Kfb(UD(Gxd(b, U6c))); - m = Kfb(UD(Gxd(b, R6c))); - Bad((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); - r = U8c((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a), t, a.b); - for (q = 0; q < r.c.length; q++) { - i2 = (tFb(q, r.c.length), RD(r.c[q], 186)); - if (q != 0) { - o2 = (tFb(q - 1, r.c.length), RD(r.c[q - 1], 186)); - Gad(i2, o2.f + o2.b + a.b); - } - p = J8c(q, r, t, a.b, Heb(TD(Gxd(b, (X7c(), L7c))))); - if (Heb(TD(p.b))) { - for (f2 = new Anb(i2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 172); - e.c = false; - e.k = false; - N9c(e); - } - i2.d = new bnb(); - i2.e = t; - --q; - } else { - k9c(a, i2); - if (q + 1 < r.c.length) { - a.e = $wnd.Math.max(i2.e + a.b + RD(Vmb((tFb(q + 1, r.c.length), RD(r.c[q + 1], 186)).a, 0), 172).r - t, a.c); - a.f = $wnd.Math.min(i2.e + a.b + RD(Vmb((tFb(q + 1, r.c.length), RD(r.c[q + 1], 186)).a, 0), 172).r - t, a.d); - if (i2.d.c.length != 0) { - a.c = $wnd.Math.max(a.c, RD(Vmb(i2.d, i2.d.c.length - 1), 315).d + (i2.d.c.length <= 1 ? 0 : a.b)); - a.d = $wnd.Math.min(a.c, RD(Vmb(i2.d, i2.d.c.length - 1), 315).d + (i2.d.c.length <= 1 ? 0 : a.b)); - } - } - if (r.c.length == 1) { - l = RD(Vmb(i2.d, i2.d.c.length - 1), 315); - k = RD(Vmb(l.a, l.a.c.length - 1), 172); - for (h = new Anb(k.n); h.a < h.c.c.length; ) { - g = RD(ynb(h), 209); - a.c = $wnd.Math.max(a.c, k.r - g.d); - a.d = $wnd.Math.min(a.d, k.r - g.d); - a.e = $wnd.Math.max(a.e, g.d + a.b); - a.f = $wnd.Math.min(a.f, g.d + a.b); - } - } - } - } - s = zad(r, a.b); - u = $wnd.Math.max(s.a, n - (c2.b + c2.c)); - j = $wnd.Math.max(s.b, m - (c2.d + c2.a)); - d = j - s.b; - Ixd(b, M6c, d); - Ixd(b, V6c, r); - return new lad(a.a, u, s.b + d, (sad(), rad)); - } - function e9b(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G; - A = RD(mQb(a, (yCc(), BBc)), 101); - if (!(A != (Bod(), zod) && A != Aod)) { - return; - } - o2 = a.b; - n = o2.c.length; - k = new cnb((dk(n + 2, lwe), dz(Bdb(Bdb(5, n + 2), (n + 2) / 10 | 0)))); - p = new cnb((dk(n + 2, lwe), dz(Bdb(Bdb(5, n + 2), (n + 2) / 10 | 0)))); - Rmb(k, new Tsb()); - Rmb(k, new Tsb()); - Rmb(p, new bnb()); - Rmb(p, new bnb()); - w2 = new bnb(); - for (b = 0; b < n; b++) { - c2 = (tFb(b, o2.c.length), RD(o2.c[b], 30)); - B = (tFb(b, k.c.length), RD(k.c[b], 85)); - q = new Tsb(); - ZEb(k.c, q); - D5 = (tFb(b, p.c.length), RD(p.c[b], 15)); - s = new bnb(); - ZEb(p.c, s); - for (e = new Anb(c2.a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - if (a9b(d)) { - ZEb(w2.c, d); - continue; - } - for (j = new is(Mr(Z2b(d).a.Kc(), new ir())); gs(j); ) { - h = RD(hs(j), 18); - F = h.c.i; - if (!a9b(F)) { - continue; - } - C = RD(B.xc(mQb(F, (Ywc(), Awc))), 10); - if (!C) { - C = _8b(a, F); - B.zc(mQb(F, Awc), C); - D5.Fc(C); - } - Y0b(h, RD(Vmb(C.j, 1), 12)); - } - for (i2 = new is(Mr(a3b(d).a.Kc(), new ir())); gs(i2); ) { - h = RD(hs(i2), 18); - G = h.d.i; - if (!a9b(G)) { - continue; - } - r = RD(Wjb(q, mQb(G, (Ywc(), Awc))), 10); - if (!r) { - r = _8b(a, G); - Zjb(q, mQb(G, Awc), r); - ZEb(s.c, r); - } - Z0b(h, RD(Vmb(r.j, 0), 12)); - } - } - } - for (l = 0; l < p.c.length; l++) { - t = (tFb(l, p.c.length), RD(p.c[l], 15)); - if (t.dc()) { - continue; - } - m = null; - if (l == 0) { - m = new R4b(a); - wFb(0, o2.c.length); - XEb(o2.c, 0, m); - } else if (l == k.c.length - 1) { - m = new R4b(a); - ZEb(o2.c, m); - } else { - m = (tFb(l - 1, o2.c.length), RD(o2.c[l - 1], 30)); - } - for (g = t.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 10); - g3b(f2, m); - } - } - for (v = new Anb(w2); v.a < v.c.c.length; ) { - u = RD(ynb(v), 10); - g3b(u, null); - } - pQb(a, (Ywc(), fwc), w2); - } - function SNc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I, J, K2; - I = new bnb(); - for (o2 = new Anb(b.b); o2.a < o2.c.c.length; ) { - m = RD(ynb(o2), 30); - for (v = new Anb(m.a); v.a < v.c.c.length; ) { - u = RD(ynb(v), 10); - u.p = -1; - l = qwe; - B = qwe; - for (D5 = new Anb(u.j); D5.a < D5.c.c.length; ) { - C = RD(ynb(D5), 12); - for (e = new Anb(C.e); e.a < e.c.c.length; ) { - c2 = RD(ynb(e), 18); - F = RD(mQb(c2, (yCc(), MBc)), 17).a; - l = $wnd.Math.max(l, F); - } - for (d = new Anb(C.g); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 18); - F = RD(mQb(c2, (yCc(), MBc)), 17).a; - B = $wnd.Math.max(B, F); - } - } - pQb(u, HNc, sgb(l)); - pQb(u, INc, sgb(B)); - } - } - r = 0; - for (n = new Anb(b.b); n.a < n.c.c.length; ) { - m = RD(ynb(n), 30); - for (v = new Anb(m.a); v.a < v.c.c.length; ) { - u = RD(ynb(v), 10); - if (u.p < 0) { - H = new ZNc(); - H.b = r++; - ONc(a, u, H); - ZEb(I.c, H); - } - } - } - A = ev(I.c.length); - k = ev(I.c.length); - for (g = 0; g < I.c.length; g++) { - Rmb(A, new bnb()); - Rmb(k, sgb(0)); - } - MNc(b, I, A, k); - J = RD(anb(I, $C(SY, uEe, 261, I.c.length, 0, 1)), 854); - w2 = RD(anb(A, $C(QK, Ize, 15, A.c.length, 0, 1)), 198); - j = $C(kE, Pwe, 28, k.c.length, 15, 1); - for (h = 0; h < j.length; h++) { - j[h] = (tFb(h, k.c.length), RD(k.c[h], 17)).a; - } - s = 0; - t = new bnb(); - for (i2 = 0; i2 < J.length; i2++) { - j[i2] == 0 && (ZEb(t.c, J[i2]), true); - } - q = $C(kE, Pwe, 28, J.length, 15, 1); - while (t.c.length != 0) { - H = RD(Xmb(t, 0), 261); - q[H.b] = s++; - while (!w2[H.b].dc()) { - K2 = RD(w2[H.b].gd(0), 261); - --j[K2.b]; - j[K2.b] == 0 && (ZEb(t.c, K2), true); - } - } - a.a = $C(SY, uEe, 261, J.length, 0, 1); - for (f2 = 0; f2 < J.length; f2++) { - p = J[f2]; - G = q[f2]; - a.a[G] = p; - p.b = G; - for (v = new Anb(p.e); v.a < v.c.c.length; ) { - u = RD(ynb(v), 10); - u.p = G; - } - } - return a.a; - } - function J8c(a, b, c2, d, e) { - var f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - p = false; - i2 = false; - m = a + 1; - o2 = (tFb(a, b.c.length), RD(b.c[a], 186)); - h = o2.a; - j = null; - for (g = 0; g < o2.a.c.length; g++) { - f2 = (tFb(g, h.c.length), RD(h.c[g], 172)); - if (f2.c) { - continue; - } - if (f2.b.c.length == 0) { - gib(); - Fad(o2, f2); - --g; - p = true; - continue; - } - if (!f2.k) { - !!j && gad(j); - j = new had(!j ? 0 : j.e + j.d + d, o2.f, d); - U9c(f2, j.e + j.d, o2.f); - Rmb(o2.d, j); - aad(j, f2); - f2.k = true; - } - k = null; - k = (r = null, g < o2.a.c.length - 1 ? r = RD(Vmb(o2.a, g + 1), 172) : m < b.c.length && (tFb(m, b.c.length), RD(b.c[m], 186)).a.c.length != 0 && (r = RD(Vmb((tFb(m, b.c.length), RD(b.c[m], 186)).a, 0), 172)), r); - q = false; - !!k && (q = !pb(k.j, o2)); - if (k) { - if (k.b.c.length != 0 && !Heb(TD(RD(Vmb(k.b, 0), 27).of((X7c(), D7c))))) { - Q9c(f2, c2 - f2.s); - gad(f2.q); - p = p | I8c(o2, f2, k, c2, d); - } else { - Fad(o2, k); - break; - } - if (k.b.c.length == 0) { - b.c.length > m && Fad((tFb(m, b.c.length), RD(b.c[m], 186)), k); - k = null; - while (b.c.length > m && (tFb(m, b.c.length), RD(b.c[m], 186)).a.c.length == 0) { - Ymb(b, (tFb(m, b.c.length), b.c[m])); - } - } - if (!k) { - --g; - continue; - } - if (!Heb(TD(RD(Vmb(k.b, 0), 27).of((X7c(), D7c)))) && K8c(b, o2, f2, k, q, c2, m, d)) { - p = true; - continue; - } - if (q) { - n = o2.b; - l = k.f; - if (!Heb(TD(RD(Vmb(k.b, 0), 27).of(D7c))) && L8c(b, o2, f2, k, c2, m, d, e)) { - p = true; - if (n < l) { - i2 = true; - k.j = o2; - break; - } - continue; - } else if (M8c(o2, f2)) { - f2.c = true; - p = true; - continue; - } - } else if (M8c(o2, f2)) { - f2.c = true; - p = true; - continue; - } - if (p) { - continue; - } - } - if (M8c(o2, f2)) { - f2.c = true; - p = true; - !!k && (k.k = false); - continue; - } else { - gad(f2.q); - } - } - return new Ptd((Geb(), p ? true : false), i2 ? true : false); - } - function yCc() { - yCc = geb; - QBc = (umd(), Wld); - RBc = Xld; - SBc = Yld; - TBc = Zld; - VBc = $ld; - WBc = _ld; - ZBc = bmd; - _Bc = dmd; - aCc = emd; - $Bc = cmd; - bCc = fmd; - dCc = gmd; - fCc = jmd; - YBc = amd; - PBc = (Ozc(), ezc); - UBc = fzc; - XBc = gzc; - cCc = hzc; - JBc = new mGd(Rld, sgb(0)); - KBc = bzc; - LBc = czc; - MBc = dzc; - vCc = Fzc; - nCc = kzc; - oCc = nzc; - rCc = vzc; - pCc = qzc; - qCc = szc; - xCc = Kzc; - wCc = Hzc; - tCc = Bzc; - sCc = zzc; - uCc = Dzc; - iBc = Uyc; - jBc = Vyc; - DAc = dyc; - EAc = gyc; - jCc = mmd; - lCc = qmd; - iCc = lmd; - hCc = kmd; - kCc = (mqd(), jqd); - new mGd(nmd, kCc); - rBc = new A3b(12); - qBc = new mGd(tld, rBc); - zAc = (Ymd(), Umd); - yAc = new mGd(Skd, zAc); - ABc = new mGd(Gld, 0); - NBc = new mGd(Sld, sgb(1)); - Tzc = new mGd(Dkd, Yze); - pBc = rld; - BBc = Hld; - GBc = Old; - qAc = Mkd; - Rzc = Bkd; - IAc = Xkd; - OBc = new mGd(Vld, (Geb(), true)); - NAc = $kd; - OAc = _kd; - lBc = kld; - oBc = pld; - mBc = mld; - tAc = (Cmd(), Amd); - rAc = new mGd(Nkd, tAc); - dBc = ild; - cBc = gld; - EBc = Lld; - DBc = Kld; - FBc = Nld; - uBc = (pod(), ood); - new mGd(zld, uBc); - wBc = Cld; - xBc = Dld; - yBc = Eld; - vBc = Bld; - mCc = jzc; - $Ac = Fyc; - ZAc = Dyc; - gCc = izc; - UAc = vyc; - pAc = Rxc; - oAc = Pxc; - eAc = yxc; - fAc = zxc; - hAc = Exc; - gAc = Axc; - nAc = Nxc; - aBc = Hyc; - bBc = Iyc; - QAc = oyc; - kBc = Zyc; - fBc = Myc; - GAc = jyc; - hBc = Syc; - BAc = _xc; - CAc = byc; - dAc = Kkd; - eBc = Jyc; - Xzc = mxc; - Wzc = kxc; - Vzc = jxc; - KAc = myc; - JAc = lyc; - LAc = nyc; - nBc = nld; - RAc = cld; - FAc = Ukd; - wAc = Qkd; - vAc = Pkd; - iAc = Hxc; - CBc = Jld; - Uzc = Jkd; - MAc = Zkd; - zBc = Fld; - sBc = vld; - tBc = xld; - WAc = yyc; - XAc = Ayc; - IBc = Qld; - Szc = ixc; - YAc = Cyc; - xAc = Xxc; - uAc = Vxc; - _Ac = eld; - SAc = syc; - gBc = Pyc; - eCc = hmd; - sAc = Txc; - HBc = _yc; - AAc = Zxc; - jAc = Jxc; - kAc = Kxc; - TAc = uyc; - lAc = Lxc; - PAc = bld; - VAc = xyc; - mAc = Mxc; - cAc = wxc; - _zc = sxc; - Zzc = qxc; - $zc = rxc; - aAc = uxc; - Yzc = oxc; - bAc = vxc; - HAc = kyc; - } - function Mqe(a) { - var b, c2, d; - if (a.d >= a.j) { - a.a = -1; - a.c = 1; - return; - } - b = ihb(a.i, a.d++); - a.a = b; - if (a.b == 1) { - switch (b) { - case 92: - d = 10; - if (a.d >= a.j) - throw Adb(new Lqe(TId((Hde(), VIe)))); - a.a = ihb(a.i, a.d++); - break; - case 45: - if ((a.e & 512) == 512 && a.d < a.j && ihb(a.i, a.d) == 91) { - ++a.d; - d = 24; - } else - d = 0; - break; - case 91: - if ((a.e & 512) != 512 && a.d < a.j && ihb(a.i, a.d) == 58) { - ++a.d; - d = 20; - break; - } - default: - if ((b & 64512) == uxe && a.d < a.j) { - c2 = ihb(a.i, a.d); - if ((c2 & 64512) == 56320) { - a.a = txe + (b - uxe << 10) + c2 - 56320; - ++a.d; - } - } - d = 0; - } - a.c = d; - return; - } - switch (b) { - case 124: - d = 2; - break; - case 42: - d = 3; - break; - case 43: - d = 4; - break; - case 63: - d = 5; - break; - case 41: - d = 7; - break; - case 46: - d = 8; - break; - case 91: - d = 9; - break; - case 94: - d = 11; - break; - case 36: - d = 12; - break; - case 40: - d = 6; - if (a.d >= a.j) - break; - if (ihb(a.i, a.d) != 63) - break; - if (++a.d >= a.j) - throw Adb(new Lqe(TId((Hde(), WIe)))); - b = ihb(a.i, a.d++); - switch (b) { - case 58: - d = 13; - break; - case 61: - d = 14; - break; - case 33: - d = 15; - break; - case 91: - d = 19; - break; - case 62: - d = 18; - break; - case 60: - if (a.d >= a.j) - throw Adb(new Lqe(TId((Hde(), WIe)))); - b = ihb(a.i, a.d++); - if (b == 61) { - d = 16; - } else if (b == 33) { - d = 17; - } else - throw Adb(new Lqe(TId((Hde(), XIe)))); - break; - case 35: - while (a.d < a.j) { - b = ihb(a.i, a.d++); - if (b == 41) - break; - } - if (b != 41) - throw Adb(new Lqe(TId((Hde(), YIe)))); - d = 21; - break; - default: - if (b == 45 || 97 <= b && b <= 122 || 65 <= b && b <= 90) { - --a.d; - d = 22; - break; - } else if (b == 40) { - d = 23; - break; - } - throw Adb(new Lqe(TId((Hde(), WIe)))); - } - break; - case 92: - d = 10; - if (a.d >= a.j) - throw Adb(new Lqe(TId((Hde(), VIe)))); - a.a = ihb(a.i, a.d++); - break; - default: - d = 0; - } - a.c = d; - } - function oXc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - c2.Ug("Process compaction", 1); - if (!Heb(TD(mQb(b, (h_c(), F$c))))) { - return; - } - e = RD(mQb(b, H$c), 88); - n = Kfb(UD(mQb(b, _$c))); - pXc(a, b, e); - lXc(b, n / 2 / 2); - o2 = b.b; - tvb(o2, new EXc(e)); - for (j = Sub(o2, 0); j.b != j.d.c; ) { - i2 = RD(evb(j), 40); - if (!Heb(TD(mQb(i2, (q$c(), n$c))))) { - d = mXc(i2, e); - p = lWc(i2, b); - l = 0; - m = 0; - if (d) { - q = d.e; - switch (e.g) { - case 2: - l = q.a - n - i2.f.a; - p.e.a - n - i2.f.a < l && (l = p.e.a - n - i2.f.a); - m = l + i2.f.a; - break; - case 1: - l = q.a + d.f.a + n; - p.e.a + n > l && (l = p.e.a + p.f.a + n); - m = l + i2.f.a; - break; - case 4: - l = q.b - n - i2.f.b; - p.e.b - n - i2.f.b < l && (l = p.e.b - n - i2.f.b); - m = l + i2.f.b; - break; - case 3: - l = q.b + d.f.b + n; - p.e.b + n > l && (l = p.e.b + p.f.b + n); - m = l + i2.f.b; - } - } else if (p) { - switch (e.g) { - case 2: - l = p.e.a - n - i2.f.a; - m = l + i2.f.a; - break; - case 1: - l = p.e.a + p.f.a + n; - m = l + i2.f.a; - break; - case 4: - l = p.e.b - n - i2.f.b; - m = l + i2.f.b; - break; - case 3: - l = p.e.b + p.f.b + n; - m = l + i2.f.b; - } - } - if (dE(mQb(b, K$c)) === dE((LZc(), IZc))) { - f2 = l; - g = m; - h = DDb(CDb(new SDb(null, new Swb(a.a, 16)), new IXc(f2, g))); - if (h.a != null) { - e == (Cmd(), ymd) || e == zmd ? i2.e.a = l : i2.e.b = l; - } else { - e == (Cmd(), ymd) || e == Bmd ? h = DDb(CDb(NDb(new SDb(null, new Swb(a.a, 16))), new WXc(f2))) : h = DDb(CDb(NDb(new SDb(null, new Swb(a.a, 16))), new YXc(f2))); - h.a != null && (e == ymd || e == zmd ? i2.e.a = Kfb(UD((sFb(h.a != null), RD(h.a, 42)).a)) : i2.e.b = Kfb(UD((sFb(h.a != null), RD(h.a, 42)).a))); - } - if (h.a != null) { - k = Wmb(a.a, (sFb(h.a != null), h.a), 0); - if (k > 0 && k != RD(mQb(i2, f_c), 17).a) { - pQb(i2, UZc, (Geb(), true)); - pQb(i2, f_c, sgb(k)); - } - } - } else { - e == (Cmd(), ymd) || e == zmd ? i2.e.a = l : i2.e.b = l; - } - } - } - c2.Vg(); - } - function Fre(a) { - var b, c2, d, e, f2, g, h, i2, j; - a.b = 1; - Mqe(a); - b = null; - if (a.c == 0 && a.a == 94) { - Mqe(a); - b = (Vse(), Vse(), new xte(4)); - rte(b, 0, MLe); - h = new xte(4); - } else { - h = (Vse(), Vse(), new xte(4)); - } - e = true; - while ((j = a.c) != 1) { - if (j == 0 && a.a == 93 && !e) { - if (b) { - wte(b, h); - h = b; - } - break; - } - c2 = a.a; - d = false; - if (j == 10) { - switch (c2) { - case 100: - case 68: - case 119: - case 87: - case 115: - case 83: - ute(h, Ere(c2)); - d = true; - break; - case 105: - case 73: - case 99: - case 67: - c2 = (ute(h, Ere(c2)), -1); - c2 < 0 && (d = true); - break; - case 112: - case 80: - i2 = Sqe(a, c2); - if (!i2) - throw Adb(new Lqe(TId((Hde(), hJe)))); - ute(h, i2); - d = true; - break; - default: - c2 = Dre(a); - } - } else if (j == 24 && !e) { - if (b) { - wte(b, h); - h = b; - } - f2 = Fre(a); - wte(h, f2); - if (a.c != 0 || a.a != 93) - throw Adb(new Lqe(TId((Hde(), lJe)))); - break; - } - Mqe(a); - if (!d) { - if (j == 0) { - if (c2 == 91) - throw Adb(new Lqe(TId((Hde(), mJe)))); - if (c2 == 93) - throw Adb(new Lqe(TId((Hde(), nJe)))); - if (c2 == 45 && !e && a.a != 93) - throw Adb(new Lqe(TId((Hde(), oJe)))); - } - if (a.c != 0 || a.a != 45 || c2 == 45 && e) { - rte(h, c2, c2); - } else { - Mqe(a); - if ((j = a.c) == 1) - throw Adb(new Lqe(TId((Hde(), jJe)))); - if (j == 0 && a.a == 93) { - rte(h, c2, c2); - rte(h, 45, 45); - } else if (j == 0 && a.a == 93 || j == 24) { - throw Adb(new Lqe(TId((Hde(), oJe)))); - } else { - g = a.a; - if (j == 0) { - if (g == 91) - throw Adb(new Lqe(TId((Hde(), mJe)))); - if (g == 93) - throw Adb(new Lqe(TId((Hde(), nJe)))); - if (g == 45) - throw Adb(new Lqe(TId((Hde(), oJe)))); - } else - j == 10 && (g = Dre(a)); - Mqe(a); - if (c2 > g) - throw Adb(new Lqe(TId((Hde(), rJe)))); - rte(h, c2, g); - } - } - } - e = false; - } - if (a.c == 1) - throw Adb(new Lqe(TId((Hde(), jJe)))); - vte(h); - ste(h); - a.b = 0; - Mqe(a); - return h; - } - function EGc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v; - c2.Ug("Coffman-Graham Layering", 1); - if (b.a.c.length == 0) { - c2.Vg(); - return; - } - v = RD(mQb(b, (yCc(), SAc)), 17).a; - i2 = 0; - g = 0; - for (m = new Anb(b.a); m.a < m.c.c.length; ) { - l = RD(ynb(m), 10); - l.p = i2++; - for (f2 = new is(Mr(a3b(l).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - e.p = g++; - } - } - a.d = $C(xdb, Hye, 28, i2, 16, 1); - a.a = $C(xdb, Hye, 28, g, 16, 1); - a.b = $C(kE, Pwe, 28, i2, 15, 1); - a.e = $C(kE, Pwe, 28, i2, 15, 1); - a.f = $C(kE, Pwe, 28, i2, 15, 1); - Nc(a.c); - FGc(a, b); - o2 = new pwb(new JGc(a)); - for (u = new Anb(b.a); u.a < u.c.c.length; ) { - s = RD(ynb(u), 10); - for (f2 = new is(Mr(Z2b(s).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - a.a[e.p] || ++a.b[s.p]; - } - a.b[s.p] == 0 && (zFb(lwb(o2, s), Bxe), true); - } - h = 0; - while (o2.b.c.length != 0) { - s = RD(mwb(o2), 10); - a.f[s.p] = h++; - for (f2 = new is(Mr(a3b(s).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (a.a[e.p]) { - continue; - } - q = e.d.i; - --a.b[q.p]; - Rc(a.c, q, sgb(a.f[s.p])); - a.b[q.p] == 0 && (zFb(lwb(o2, q), Bxe), true); - } - } - n = new pwb(new NGc(a)); - for (t = new Anb(b.a); t.a < t.c.c.length; ) { - s = RD(ynb(t), 10); - for (f2 = new is(Mr(a3b(s).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - a.a[e.p] || ++a.e[s.p]; - } - a.e[s.p] == 0 && (zFb(lwb(n, s), Bxe), true); - } - k = new bnb(); - d = BGc(b, k); - while (n.b.c.length != 0) { - r = RD(mwb(n), 10); - (d.a.c.length >= v || !zGc(r, d)) && (d = BGc(b, k)); - g3b(r, d); - for (f2 = new is(Mr(Z2b(r).a.Kc(), new ir())); gs(f2); ) { - e = RD(hs(f2), 18); - if (a.a[e.p]) { - continue; - } - p = e.c.i; - --a.e[p.p]; - a.e[p.p] == 0 && (zFb(lwb(n, p), Bxe), true); - } - } - for (j = k.c.length - 1; j >= 0; --j) { - Rmb(b.b, (tFb(j, k.c.length), RD(k.c[j], 30))); - } - b.a.c.length = 0; - c2.Vg(); - } - function Sec(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - u = false; - do { - u = false; - for (f2 = b ? new Xkb(a.a.b).a.gc() - 2 : 1; b ? f2 >= 0 : f2 < new Xkb(a.a.b).a.gc(); f2 += b ? -1 : 1) { - e = _5b(a.a, sgb(f2)); - for (n = 0; n < e.b; n++) { - l = RD(ju(e, n), 10); - if (!nQb(l, (Ywc(), zwc))) { - continue; - } - if (a6b(a.a, sgb(f2)) && a.r == (aEc(), TDc) || b6b(a.a, sgb(f2)) && a.r == (aEc(), UDc)) { - continue; - } - t = true; - for (r = 0; r < e.b; r++) { - q = RD(ju(e, r), 10); - nQb(q, zwc) && (b && RD(mQb(l, zwc), 17).a < RD(mQb(q, zwc), 17).a || !b && RD(mQb(l, zwc), 17).a > RD(mQb(q, zwc), 17).a) && (t = false); - } - if (!t) { - continue; - } - i2 = b ? f2 + 1 : f2 - 1; - h = _5b(a.a, sgb(i2)); - g = false; - s = true; - d = false; - for (k = Sub(h, 0); k.b != k.d.c; ) { - j = RD(evb(k), 10); - if (nQb(j, zwc)) { - if (j.p != l.p) { - g = g | (b ? RD(mQb(j, zwc), 17).a < RD(mQb(l, zwc), 17).a : RD(mQb(j, zwc), 17).a > RD(mQb(l, zwc), 17).a); - s = false; - } - } else if (!g && s) { - if (j.k == (r3b(), n3b)) { - d = true; - b ? m = RD(hs(new is(Mr(Z2b(j).a.Kc(), new ir()))), 18).c.i : m = RD(hs(new is(Mr(a3b(j).a.Kc(), new ir()))), 18).d.i; - if (m == l) { - b ? c2 = RD(hs(new is(Mr(a3b(j).a.Kc(), new ir()))), 18).d.i : c2 = RD(hs(new is(Mr(Z2b(j).a.Kc(), new ir()))), 18).c.i; - (b ? RD($5b(a.a, c2), 17).a - RD($5b(a.a, m), 17).a : RD($5b(a.a, m), 17).a - RD($5b(a.a, c2), 17).a) <= 2 && (s = false); - } - } - } - } - if (d && s) { - b ? c2 = RD(hs(new is(Mr(a3b(l).a.Kc(), new ir()))), 18).d.i : c2 = RD(hs(new is(Mr(Z2b(l).a.Kc(), new ir()))), 18).c.i; - (b ? RD($5b(a.a, c2), 17).a - RD($5b(a.a, l), 17).a : RD($5b(a.a, l), 17).a - RD($5b(a.a, c2), 17).a) <= 2 && c2.k == (r3b(), p3b) && (s = false); - } - if (g || s) { - p = Xec(a, l, b); - while (p.a.gc() != 0) { - o2 = RD(p.a.ec().Kc().Pb(), 10); - p.a.Bc(o2) != null; - ye(p, Xec(a, o2, b)); - } - --n; - u = true; - } - } - } - } while (u); - } - function Xae(a) { - _Ad(a.c, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#decimal"])); - _Ad(a.d, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#integer"])); - _Ad(a.e, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#boolean"])); - _Ad(a.f, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "EBoolean", GIe, "EBoolean:Object"])); - _Ad(a.i, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#byte"])); - _Ad(a.g, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#hexBinary"])); - _Ad(a.j, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "EByte", GIe, "EByte:Object"])); - _Ad(a.n, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "EChar", GIe, "EChar:Object"])); - _Ad(a.t, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#double"])); - _Ad(a.u, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "EDouble", GIe, "EDouble:Object"])); - _Ad(a.F, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#float"])); - _Ad(a.G, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "EFloat", GIe, "EFloat:Object"])); - _Ad(a.I, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#int"])); - _Ad(a.J, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "EInt", GIe, "EInt:Object"])); - _Ad(a.N, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#long"])); - _Ad(a.O, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "ELong", GIe, "ELong:Object"])); - _Ad(a.Z, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#short"])); - _Ad(a.$, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "EShort", GIe, "EShort:Object"])); - _Ad(a._, qKe, cD(WC(qJ, 1), Nve, 2, 6, [DKe, "http://www.w3.org/2001/XMLSchema#string"])); - } - function C0c(a, b, c2, d, e, f2, g) { - var h, i2, j, k, l, m, n, o2; - m = RD(d.a, 17).a; - n = RD(d.b, 17).a; - l = a.b; - o2 = a.c; - h = 0; - k = 0; - if (b == (Cmd(), ymd) || b == zmd) { - k = Uvb(QCb(HDb(GDb(new SDb(null, new Swb(c2.b, 16)), new b2c()), new b1c()))); - if (l.e.b + l.f.b / 2 > k) { - j = ++n; - h = Kfb(UD(Lvb(JDb(GDb(new SDb(null, new Swb(c2.b, 16)), new d2c(e, j)), new d1c())))); - } else { - i2 = ++m; - h = Kfb(UD(Lvb(KDb(GDb(new SDb(null, new Swb(c2.b, 16)), new f2c(e, i2)), new h1c())))); - } - } else { - k = Uvb(QCb(HDb(GDb(new SDb(null, new Swb(c2.b, 16)), new x1c()), new l1c()))); - if (l.e.a + l.f.a / 2 > k) { - j = ++n; - h = Kfb(UD(Lvb(JDb(GDb(new SDb(null, new Swb(c2.b, 16)), new z1c(e, j)), new n1c())))); - } else { - i2 = ++m; - h = Kfb(UD(Lvb(KDb(GDb(new SDb(null, new Swb(c2.b, 16)), new B1c(e, i2)), new r1c())))); - } - } - if (b == ymd) { - Oub(a.a, new rjd(Kfb(UD(mQb(l, (q$c(), f$c)))) - e, h)); - Oub(a.a, new rjd(o2.e.a + o2.f.a + e + f2, h)); - Oub(a.a, new rjd(o2.e.a + o2.f.a + e + f2, o2.e.b + o2.f.b / 2)); - Oub(a.a, new rjd(o2.e.a + o2.f.a, o2.e.b + o2.f.b / 2)); - } else if (b == zmd) { - Oub(a.a, new rjd(Kfb(UD(mQb(l, (q$c(), e$c)))) + e, l.e.b + l.f.b / 2)); - Oub(a.a, new rjd(l.e.a + l.f.a + e, h)); - Oub(a.a, new rjd(o2.e.a - e - f2, h)); - Oub(a.a, new rjd(o2.e.a - e - f2, o2.e.b + o2.f.b / 2)); - Oub(a.a, new rjd(o2.e.a, o2.e.b + o2.f.b / 2)); - } else if (b == Bmd) { - Oub(a.a, new rjd(h, Kfb(UD(mQb(l, (q$c(), f$c)))) - e)); - Oub(a.a, new rjd(h, o2.e.b + o2.f.b + e + f2)); - Oub(a.a, new rjd(o2.e.a + o2.f.a / 2, o2.e.b + o2.f.b + e + f2)); - Oub(a.a, new rjd(o2.e.a + o2.f.a / 2, o2.e.b + o2.f.b + e)); - } else { - a.a.b == 0 || (RD(Rub(a.a), 8).b = Kfb(UD(mQb(l, (q$c(), e$c)))) + e * RD(g.b, 17).a); - Oub(a.a, new rjd(h, Kfb(UD(mQb(l, (q$c(), e$c)))) + e * RD(g.b, 17).a)); - Oub(a.a, new rjd(h, o2.e.b - e * RD(g.a, 17).a - f2)); - } - return new Ptd(sgb(m), sgb(n)); - } - function ASd(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - g = true; - l = null; - d = null; - e = null; - b = false; - n = _Rd; - j = null; - f2 = null; - h = 0; - i2 = sSd(a, h, ZRd, $Rd); - if (i2 < a.length && (BFb(i2, a.length), a.charCodeAt(i2) == 58)) { - l = (AFb(h, i2, a.length), a.substr(h, i2 - h)); - h = i2 + 1; - } - c2 = l != null && tpb(eSd, l.toLowerCase()); - if (c2) { - i2 = a.lastIndexOf("!/"); - if (i2 == -1) { - throw Adb(new agb("no archive separator")); - } - g = true; - d = zhb(a, h, ++i2); - h = i2; - } else if (h >= 0 && lhb(a.substr(h, "//".length), "//")) { - h += 2; - i2 = sSd(a, h, aSd, bSd); - d = (AFb(h, i2, a.length), a.substr(h, i2 - h)); - h = i2; - } else if (l != null && (h == a.length || (BFb(h, a.length), a.charCodeAt(h) != 47))) { - g = false; - i2 = rhb(a, Fhb(35), h); - i2 == -1 && (i2 = a.length); - d = (AFb(h, i2, a.length), a.substr(h, i2 - h)); - h = i2; - } - if (!c2 && h < a.length && (BFb(h, a.length), a.charCodeAt(h) == 47)) { - i2 = sSd(a, h + 1, aSd, bSd); - k = (AFb(h + 1, i2, a.length), a.substr(h + 1, i2 - (h + 1))); - if (k.length > 0 && ihb(k, k.length - 1) == 58) { - e = k; - h = i2; - } - } - if (h < a.length && (BFb(h, a.length), a.charCodeAt(h) == 47)) { - ++h; - b = true; - } - if (h < a.length && (BFb(h, a.length), a.charCodeAt(h) != 63) && (BFb(h, a.length), a.charCodeAt(h) != 35)) { - m = new bnb(); - while (h < a.length && (BFb(h, a.length), a.charCodeAt(h) != 63) && (BFb(h, a.length), a.charCodeAt(h) != 35)) { - i2 = sSd(a, h, aSd, bSd); - Rmb(m, (AFb(h, i2, a.length), a.substr(h, i2 - h))); - h = i2; - h < a.length && (BFb(h, a.length), a.charCodeAt(h) == 47) && (BSd(a, ++h) || (m.c.push(""), true)); - } - n = $C(qJ, Nve, 2, m.c.length, 6, 1); - anb(m, n); - } - if (h < a.length && (BFb(h, a.length), a.charCodeAt(h) == 63)) { - i2 = phb(a, 35, ++h); - i2 == -1 && (i2 = a.length); - j = (AFb(h, i2, a.length), a.substr(h, i2 - h)); - h = i2; - } - h < a.length && (f2 = yhb(a, ++h)); - ISd(g, l, d, e, n, j); - return new lSd(g, l, d, e, b, n, j, f2); - } - function P_b() { - P_b = geb; - z$b(); - O_b = new Tp(); - Rc(O_b, (qpd(), cpd), bpd); - Rc(O_b, mpd, bpd); - Rc(O_b, dpd, bpd); - Rc(O_b, jpd, bpd); - Rc(O_b, ipd, bpd); - Rc(O_b, gpd, bpd); - Rc(O_b, jpd, cpd); - Rc(O_b, bpd, Zod); - Rc(O_b, cpd, Zod); - Rc(O_b, mpd, Zod); - Rc(O_b, dpd, Zod); - Rc(O_b, hpd, Zod); - Rc(O_b, jpd, Zod); - Rc(O_b, ipd, Zod); - Rc(O_b, gpd, Zod); - Rc(O_b, apd, Zod); - Rc(O_b, bpd, kpd); - Rc(O_b, cpd, kpd); - Rc(O_b, Zod, kpd); - Rc(O_b, mpd, kpd); - Rc(O_b, dpd, kpd); - Rc(O_b, hpd, kpd); - Rc(O_b, jpd, kpd); - Rc(O_b, apd, kpd); - Rc(O_b, lpd, kpd); - Rc(O_b, ipd, kpd); - Rc(O_b, epd, kpd); - Rc(O_b, gpd, kpd); - Rc(O_b, cpd, mpd); - Rc(O_b, dpd, mpd); - Rc(O_b, jpd, mpd); - Rc(O_b, gpd, mpd); - Rc(O_b, cpd, dpd); - Rc(O_b, mpd, dpd); - Rc(O_b, jpd, dpd); - Rc(O_b, dpd, dpd); - Rc(O_b, ipd, dpd); - Rc(O_b, bpd, $od); - Rc(O_b, cpd, $od); - Rc(O_b, Zod, $od); - Rc(O_b, kpd, $od); - Rc(O_b, mpd, $od); - Rc(O_b, dpd, $od); - Rc(O_b, hpd, $od); - Rc(O_b, jpd, $od); - Rc(O_b, lpd, $od); - Rc(O_b, apd, $od); - Rc(O_b, gpd, $od); - Rc(O_b, ipd, $od); - Rc(O_b, fpd, $od); - Rc(O_b, bpd, lpd); - Rc(O_b, cpd, lpd); - Rc(O_b, Zod, lpd); - Rc(O_b, mpd, lpd); - Rc(O_b, dpd, lpd); - Rc(O_b, hpd, lpd); - Rc(O_b, jpd, lpd); - Rc(O_b, apd, lpd); - Rc(O_b, gpd, lpd); - Rc(O_b, epd, lpd); - Rc(O_b, fpd, lpd); - Rc(O_b, cpd, apd); - Rc(O_b, mpd, apd); - Rc(O_b, dpd, apd); - Rc(O_b, jpd, apd); - Rc(O_b, lpd, apd); - Rc(O_b, gpd, apd); - Rc(O_b, ipd, apd); - Rc(O_b, bpd, _od); - Rc(O_b, cpd, _od); - Rc(O_b, Zod, _od); - Rc(O_b, mpd, _od); - Rc(O_b, dpd, _od); - Rc(O_b, hpd, _od); - Rc(O_b, jpd, _od); - Rc(O_b, apd, _od); - Rc(O_b, gpd, _od); - Rc(O_b, cpd, ipd); - Rc(O_b, Zod, ipd); - Rc(O_b, kpd, ipd); - Rc(O_b, dpd, ipd); - Rc(O_b, bpd, epd); - Rc(O_b, cpd, epd); - Rc(O_b, kpd, epd); - Rc(O_b, mpd, epd); - Rc(O_b, dpd, epd); - Rc(O_b, hpd, epd); - Rc(O_b, jpd, epd); - Rc(O_b, jpd, fpd); - Rc(O_b, dpd, fpd); - Rc(O_b, apd, bpd); - Rc(O_b, apd, mpd); - Rc(O_b, apd, Zod); - Rc(O_b, hpd, bpd); - Rc(O_b, hpd, cpd); - Rc(O_b, hpd, kpd); - } - function _Qc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2; - c2.Ug("Brandes & Koepf node placement", 1); - a.a = b; - a.c = iRc(b); - d = RD(mQb(b, (yCc(), fBc)), 281); - n = Heb(TD(mQb(b, gBc))); - a.d = d == (Ouc(), Luc) && !n || d == Iuc; - $Qc(a, b); - v = null; - w2 = null; - r = null; - s = null; - q = (dk(4, iwe), new cnb(4)); - switch (RD(mQb(b, fBc), 281).g) { - case 3: - r = new sQc(b, a.c.d, (EQc(), CQc), (wQc(), uQc)); - ZEb(q.c, r); - break; - case 1: - s = new sQc(b, a.c.d, (EQc(), DQc), (wQc(), uQc)); - ZEb(q.c, s); - break; - case 4: - v = new sQc(b, a.c.d, (EQc(), CQc), (wQc(), vQc)); - ZEb(q.c, v); - break; - case 2: - w2 = new sQc(b, a.c.d, (EQc(), DQc), (wQc(), vQc)); - ZEb(q.c, w2); - break; - default: - r = new sQc(b, a.c.d, (EQc(), CQc), (wQc(), uQc)); - s = new sQc(b, a.c.d, DQc, uQc); - v = new sQc(b, a.c.d, CQc, vQc); - w2 = new sQc(b, a.c.d, DQc, vQc); - ZEb(q.c, v); - ZEb(q.c, w2); - ZEb(q.c, r); - ZEb(q.c, s); - } - e = new MQc(b, a.c); - for (h = new Anb(q); h.a < h.c.c.length; ) { - f2 = RD(ynb(h), 185); - LQc(e, f2, a.b); - KQc(f2); - } - m = new RQc(b, a.c); - for (i2 = new Anb(q); i2.a < i2.c.c.length; ) { - f2 = RD(ynb(i2), 185); - OQc(m, f2); - } - if (c2._g()) { - for (j = new Anb(q); j.a < j.c.c.length; ) { - f2 = RD(ynb(j), 185); - c2.bh(f2 + " size is " + qQc(f2)); - } - } - l = null; - if (a.d) { - k = YQc(a, q, a.c.d); - XQc(b, k, c2) && (l = k); - } - if (!l) { - for (j = new Anb(q); j.a < j.c.c.length; ) { - f2 = RD(ynb(j), 185); - XQc(b, f2, c2) && (!l || qQc(l) > qQc(f2)) && (l = f2); - } - } - !l && (l = (tFb(0, q.c.length), RD(q.c[0], 185))); - for (p = new Anb(b.b); p.a < p.c.c.length; ) { - o2 = RD(ynb(p), 30); - for (u = new Anb(o2.a); u.a < u.c.c.length; ) { - t = RD(ynb(u), 10); - t.n.b = Kfb(l.p[t.p]) + Kfb(l.d[t.p]); - } - } - if (c2._g()) { - c2.bh("Chosen node placement: " + l); - c2.bh("Blocks: " + bRc(l)); - c2.bh("Classes: " + cRc(l, c2)); - c2.bh("Marked edges: " + a.b); - } - for (g = new Anb(q); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 185); - f2.g = null; - f2.b = null; - f2.a = null; - f2.d = null; - f2.j = null; - f2.i = null; - f2.p = null; - } - gRc(a.c); - a.b.a.$b(); - c2.Vg(); - } - function GVc(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G; - if (a.c.length == 1) { - CVc((tFb(0, a.c.length), RD(a.c[0], 121))); - return tFb(0, a.c.length), RD(a.c[0], 121); - } else if (a.c.length <= 0) { - return new YWc(); - } - for (i2 = new Anb(a); i2.a < i2.c.c.length; ) { - g = RD(ynb(i2), 121); - s = 0; - o2 = lve; - p = lve; - m = qwe; - n = qwe; - for (r = Sub(g.b, 0); r.b != r.d.c; ) { - q = RD(evb(r), 40); - s += RD(mQb(q, (h_c(), X$c)), 17).a; - o2 = $wnd.Math.min(o2, q.e.a); - p = $wnd.Math.min(p, q.e.b); - m = $wnd.Math.max(m, q.e.a + q.f.a); - n = $wnd.Math.max(n, q.e.b + q.f.b); - } - pQb(g, (h_c(), X$c), sgb(s)); - pQb(g, (q$c(), SZc), new rjd(o2, p)); - pQb(g, RZc, new rjd(m, n)); - } - yob(); - _mb(a, new KVc()); - v = new YWc(); - kQb(v, (tFb(0, a.c.length), RD(a.c[0], 96))); - l = 0; - D5 = 0; - for (j = new Anb(a); j.a < j.c.c.length; ) { - g = RD(ynb(j), 121); - w2 = ojd(ajd(RD(mQb(g, (q$c(), RZc)), 8)), RD(mQb(g, SZc), 8)); - l = $wnd.Math.max(l, w2.a); - D5 += w2.a * w2.b; - } - l = $wnd.Math.max(l, $wnd.Math.sqrt(D5) * Kfb(UD(mQb(v, (h_c(), E$c))))); - A = Kfb(UD(mQb(v, _$c))); - F = 0; - G = 0; - k = 0; - b = A; - for (h = new Anb(a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 121); - w2 = ojd(ajd(RD(mQb(g, (q$c(), RZc)), 8)), RD(mQb(g, SZc), 8)); - if (F + w2.a > l) { - F = 0; - G += k + A; - k = 0; - } - FVc(v, g, F, G); - b = $wnd.Math.max(b, F + w2.a); - k = $wnd.Math.max(k, w2.b); - F += w2.a + A; - } - u = new Tsb(); - c2 = new Tsb(); - for (C = new Anb(a); C.a < C.c.c.length; ) { - B = RD(ynb(C), 121); - d = Heb(TD(mQb(B, (umd(), Mkd)))); - t = !B.q ? wob : B.q; - for (f2 = t.vc().Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 44); - if (Ujb(u, e.ld())) { - if (dE(RD(e.ld(), 149).Sg()) !== dE(e.md())) { - if (d && Ujb(c2, e.ld())) { - gib(); - "Found different values for property " + RD(e.ld(), 149).Pg() + " in components."; - } else { - Zjb(u, RD(e.ld(), 149), e.md()); - pQb(v, RD(e.ld(), 149), e.md()); - d && Zjb(c2, RD(e.ld(), 149), e.md()); - } - } - } else { - Zjb(u, RD(e.ld(), 149), e.md()); - pQb(v, RD(e.ld(), 149), e.md()); - } - } - } - CVc(v); - return v; - } - function f7d(a, b) { - switch (a.e) { - case 0: - case 2: - case 4: - case 6: - case 42: - case 44: - case 46: - case 48: - case 8: - case 10: - case 12: - case 14: - case 16: - case 18: - case 20: - case 22: - case 24: - case 26: - case 28: - case 30: - case 32: - case 34: - case 36: - case 38: - return new sje(a.b, a.a, b, a.c); - case 1: - return new _Zd(a.a, b, BYd(b.Dh(), a.c)); - case 43: - return new lie(a.a, b, BYd(b.Dh(), a.c)); - case 3: - return new XZd(a.a, b, BYd(b.Dh(), a.c)); - case 45: - return new iie(a.a, b, BYd(b.Dh(), a.c)); - case 41: - return new DVd(RD(WVd(a.c), 29), a.a, b, BYd(b.Dh(), a.c)); - case 50: - return new Cje(RD(WVd(a.c), 29), a.a, b, BYd(b.Dh(), a.c)); - case 5: - return new oie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 47: - return new sie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 7: - return new C5d(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 49: - return new G5d(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 9: - return new gie(a.a, b, BYd(b.Dh(), a.c)); - case 11: - return new eie(a.a, b, BYd(b.Dh(), a.c)); - case 13: - return new aie(a.a, b, BYd(b.Dh(), a.c)); - case 15: - return new Kfe(a.a, b, BYd(b.Dh(), a.c)); - case 17: - return new Cie(a.a, b, BYd(b.Dh(), a.c)); - case 19: - return new zie(a.a, b, BYd(b.Dh(), a.c)); - case 21: - return new vie(a.a, b, BYd(b.Dh(), a.c)); - case 23: - return new PZd(a.a, b, BYd(b.Dh(), a.c)); - case 25: - return new bje(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 27: - return new Yie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 29: - return new Tie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 31: - return new Nie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 33: - return new $ie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 35: - return new Vie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 37: - return new Pie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 39: - return new Iie(a.a, b, BYd(b.Dh(), a.c), a.d.n); - case 40: - return new Uge(b, BYd(b.Dh(), a.c)); - default: - throw Adb(new yz("Unknown feature style: " + a.e)); - } - } - function h2c(a) { - var b, c2, d, e, f2, g, h, i2; - f2 = 0; - e = a.a.b; - for (i2 = Sub(a.a, 0); i2.b != i2.d.c; ) { - h = RD(evb(i2), 240); - g = (f2 + 1) / (e + 1); - if (!a.c && !a.d) { - return; - } else if (!!a.c && !a.d) { - a.g = true; - if (a.b == (Cmd(), ymd)) { - d = a.c.e.b + a.c.f.b + a.e * (f2 + 1); - b = new rjd(Kfb(UD(mQb(a.c, (q$c(), e$c)))) + a.e, d); - c2 = new rjd(Kfb(UD(mQb(a.c, f$c))) - a.e, d); - } else if (a.b == zmd) { - d = a.c.e.b + a.c.f.b + a.e * (f2 + 1); - b = new rjd(Kfb(UD(mQb(a.c, (q$c(), f$c)))) - a.e, d); - c2 = new rjd(Kfb(UD(mQb(a.c, e$c))) + a.e, d); - } else if (a.b == Bmd) { - d = a.c.e.a + a.c.f.a + a.e * (f2 + 1); - b = new rjd(d, Kfb(UD(mQb(a.c, (q$c(), e$c)))) + a.e); - c2 = new rjd(d, Kfb(UD(mQb(a.c, f$c))) - a.e); - } else { - d = a.c.e.a + a.c.f.a + a.e * (f2 + 1); - b = new rjd(d, Kfb(UD(mQb(a.c, (q$c(), f$c)))) - a.e); - c2 = new rjd(d, Kfb(UD(mQb(a.c, e$c))) + a.e); - } - } else if (!!a.c && !!a.d) { - if (a.b == (Cmd(), ymd)) { - d = a.d.e.b * g + (a.c.e.b + a.c.f.b) * (1 - g); - b = new rjd(Kfb(UD(mQb(a.c, (q$c(), e$c)))) + a.e, d); - c2 = new rjd(Kfb(UD(mQb(a.c, f$c))) - a.e, d); - } else if (a.b == zmd) { - d = a.d.e.b * g + (a.c.e.b + a.c.f.b) * (1 - g); - b = new rjd(Kfb(UD(mQb(a.c, (q$c(), f$c)))) - a.e, d); - c2 = new rjd(Kfb(UD(mQb(a.c, e$c))) + a.e, d); - } else if (a.b == Bmd) { - d = a.d.e.a * g + (a.c.e.a + a.c.f.a) * (1 - g); - b = new rjd(d, Kfb(UD(mQb(a.c, (q$c(), e$c)))) + a.e); - c2 = new rjd(d, Kfb(UD(mQb(a.c, f$c))) - a.e); - } else { - d = a.d.e.a * g + (a.c.e.a + a.c.f.a) * (1 - g); - b = new rjd(d, Kfb(UD(mQb(a.c, (q$c(), f$c)))) - a.e); - c2 = new rjd(d, Kfb(UD(mQb(a.c, e$c))) + a.e); - } - } else { - a.f = true; - if (a.b == (Cmd(), ymd)) { - d = a.d.e.b - a.e * (f2 + 1); - b = new rjd(Kfb(UD(mQb(a.d, (q$c(), e$c)))) + a.e, d); - c2 = new rjd(Kfb(UD(mQb(a.d, f$c))) - a.e, d); - } else if (a.b == zmd) { - d = a.d.e.b - a.e * (f2 + 1); - b = new rjd(Kfb(UD(mQb(a.d, (q$c(), f$c)))) - a.e, d); - c2 = new rjd(Kfb(UD(mQb(a.d, e$c))) + a.e, d); - } else if (a.b == Bmd) { - d = a.d.e.a - a.e * (f2 + 1); - b = new rjd(d, Kfb(UD(mQb(a.d, (q$c(), e$c)))) + a.e); - c2 = new rjd(d, Kfb(UD(mQb(a.d, f$c))) - a.e); - } else { - d = a.d.e.a - a.e * (f2 + 1); - b = new rjd(d, Kfb(UD(mQb(a.d, (q$c(), f$c)))) - a.e); - c2 = new rjd(d, Kfb(UD(mQb(a.d, e$c))) + a.e); - } - } - RD(h.a, 8).a = b.a; - RD(h.a, 8).b = b.b; - h.b.a = c2.a; - h.b.b = c2.b; - ++f2; - } - } - function LA(a, b, c2, d, e, f2) { - var g, h, i2, j, k, l, m, n, o2, p, q, r; - switch (b) { - case 71: - h = d.q.getFullYear() - Owe >= -1900 ? 1 : 0; - c2 >= 4 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, [Qwe, Rwe])[h]) : Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["BC", "AD"])[h]); - break; - case 121: - AA(a, c2, d); - break; - case 77: - zA(a, c2, d); - break; - case 107: - i2 = e.q.getHours(); - i2 == 0 ? UA(a, 24, c2) : UA(a, i2, c2); - break; - case 83: - yA(a, c2, e); - break; - case 69: - k = d.q.getDay(); - c2 == 5 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["S", "M", "T", "W", "T", "F", "S"])[k]) : c2 == 4 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, [Swe, Twe, Uwe, Vwe, Wwe, Xwe, Ywe])[k]) : Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"])[k]); - break; - case 97: - e.q.getHours() >= 12 && e.q.getHours() < 24 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["AM", "PM"])[1]) : Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["AM", "PM"])[0]); - break; - case 104: - l = e.q.getHours() % 12; - l == 0 ? UA(a, 12, c2) : UA(a, l, c2); - break; - case 75: - m = e.q.getHours() % 12; - UA(a, m, c2); - break; - case 72: - n = e.q.getHours(); - UA(a, n, c2); - break; - case 99: - o2 = d.q.getDay(); - c2 == 5 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["S", "M", "T", "W", "T", "F", "S"])[o2]) : c2 == 4 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, [Swe, Twe, Uwe, Vwe, Wwe, Xwe, Ywe])[o2]) : c2 == 3 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"])[o2]) : UA(a, o2, 1); - break; - case 76: - p = d.q.getMonth(); - c2 == 5 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"])[p]) : c2 == 4 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, [Cwe, Dwe, Ewe, Fwe, Gwe, Hwe, Iwe, Jwe, Kwe, Lwe, Mwe, Nwe])[p]) : c2 == 3 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["Jan", "Feb", "Mar", "Apr", Gwe, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[p]) : UA(a, p + 1, c2); - break; - case 81: - q = d.q.getMonth() / 3 | 0; - c2 < 4 ? Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["Q1", "Q2", "Q3", "Q4"])[q]) : Zhb(a, cD(WC(qJ, 1), Nve, 2, 6, ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"])[q]); - break; - case 100: - r = d.q.getDate(); - UA(a, r, c2); - break; - case 109: - j = e.q.getMinutes(); - UA(a, j, c2); - break; - case 115: - g = e.q.getSeconds(); - UA(a, g, c2); - break; - case 122: - c2 < 4 ? Zhb(a, f2.c[0]) : Zhb(a, f2.c[1]); - break; - case 118: - Zhb(a, f2.b); - break; - case 90: - c2 < 3 ? Zhb(a, cB(f2)) : c2 == 3 ? Zhb(a, bB(f2)) : Zhb(a, eB(f2.a)); - break; - default: - return false; - } - return true; - } - function f5b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H; - X4b(b); - i2 = RD(QHd((!b.b && (b.b = new Yie(E4, b, 4, 7)), b.b), 0), 84); - k = RD(QHd((!b.c && (b.c = new Yie(E4, b, 5, 8)), b.c), 0), 84); - h = AGd(i2); - j = AGd(k); - g = (!b.a && (b.a = new C5d(F4, b, 6, 6)), b.a).i == 0 ? null : RD(QHd((!b.a && (b.a = new C5d(F4, b, 6, 6)), b.a), 0), 166); - A = RD(Wjb(a.a, h), 10); - F = RD(Wjb(a.a, j), 10); - B = null; - G = null; - if (ZD(i2, 193)) { - w2 = RD(Wjb(a.a, i2), 305); - if (ZD(w2, 12)) { - B = RD(w2, 12); - } else if (ZD(w2, 10)) { - A = RD(w2, 10); - B = RD(Vmb(A.j, 0), 12); - } - } - if (ZD(k, 193)) { - D5 = RD(Wjb(a.a, k), 305); - if (ZD(D5, 12)) { - G = RD(D5, 12); - } else if (ZD(D5, 10)) { - F = RD(D5, 10); - G = RD(Vmb(F.j, 0), 12); - } - } - if (!A || !F) { - throw Adb(new Ked("The source or the target of edge " + b + " could not be found. This usually happens when an edge connects a node laid out by ELK Layered to a node in another level of hierarchy laid out by either another instance of ELK Layered or another layout algorithm alltogether. The former can be solved by setting the hierarchyHandling option to INCLUDE_CHILDREN.")); - } - p = new a1b(); - kQb(p, b); - pQb(p, (Ywc(), Awc), b); - pQb(p, (yCc(), RAc), null); - n = RD(mQb(d, kwc), 21); - A == F && n.Fc((ovc(), nvc)); - if (!B) { - v = (BEc(), zEc); - C = null; - if (!!g && Dod(RD(mQb(A, BBc), 101))) { - C = new rjd(g.j, g.k); - Fsd(C, kzd(b)); - Gsd(C, c2); - if (NGd(j, h)) { - v = yEc; - $id(C, A.n); - } - } - B = g2b(A, C, v, d); - } - if (!G) { - v = (BEc(), yEc); - H = null; - if (!!g && Dod(RD(mQb(F, BBc), 101))) { - H = new rjd(g.b, g.c); - Fsd(H, kzd(b)); - Gsd(H, c2); - } - G = g2b(F, H, v, Y2b(F)); - } - Y0b(p, B); - Z0b(p, G); - (B.e.c.length > 1 || B.g.c.length > 1 || G.e.c.length > 1 || G.g.c.length > 1) && n.Fc((ovc(), ivc)); - for (m = new dMd((!b.n && (b.n = new C5d(I4, b, 1, 7)), b.n)); m.e != m.i.gc(); ) { - l = RD(bMd(m), 135); - if (!Heb(TD(Gxd(l, pBc))) && !!l.a) { - q = h5b(l); - Rmb(p.b, q); - switch (RD(mQb(q, wAc), 278).g) { - case 1: - case 2: - n.Fc((ovc(), gvc)); - break; - case 0: - n.Fc((ovc(), evc)); - pQb(q, wAc, (Omd(), Lmd)); - } - } - } - f2 = RD(mQb(d, oAc), 322); - r = RD(mQb(d, kBc), 323); - e = f2 == (stc(), ptc) || r == (JDc(), FDc); - if (!!g && (!g.a && (g.a = new XZd(D4, g, 5)), g.a).i != 0 && e) { - s = ssd(g); - o2 = new Ejd(); - for (u = Sub(s, 0); u.b != u.d.c; ) { - t = RD(evb(u), 8); - Mub(o2, new sjd(t)); - } - pQb(p, Bwc, o2); - } - return p; - } - function F0c(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I; - C = 0; - D5 = 0; - A = new Tsb(); - v = RD(Lvb(JDb(GDb(new SDb(null, new Swb(a.b, 16)), new v1c()), new Z0c())), 17).a + 1; - B = $C(kE, Pwe, 28, v, 15, 1); - q = $C(kE, Pwe, 28, v, 15, 1); - for (p = 0; p < v; p++) { - B[p] = 0; - q[p] = 0; - } - i2 = RD(zDb(BDb(new SDb(null, new Swb(a.a, 16))), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - for (k = i2.Kc(); k.Ob(); ) { - j = RD(k.Pb(), 65); - G = RD(mQb(j.b, (h_c(), f_c)), 17).a; - I = RD(mQb(j.c, f_c), 17).a; - u = I - G; - if (u > 1) { - for (h = G + 1; h < I; h++) { - l = h; - w2 = RD(zDb(CDb(new SDb(null, new Swb(a.b, 16)), new P1c(l)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [vBb]))), 15); - o2 = 0; - if (b == (Cmd(), ymd) || b == zmd) { - w2.jd(new V1c()); - for (o2 = 0; o2 < w2.gc(); o2++) { - r = (h - G) / (I - G); - if (RD(w2.Xb(o2), 40).e.b > j.b.e.b * (1 - r) + j.c.e.b * r) { - break; - } - } - if (w2.gc() > 0) { - H = j.a.b == 0 ? ajd(j.b.e) : RD(Rub(j.a), 8); - t = $id(ajd(RD(w2.Xb(w2.gc() - 1), 40).e), RD(w2.Xb(w2.gc() - 1), 40).f); - m = $id(ajd(RD(w2.Xb(0), 40).e), RD(w2.Xb(0), 40).f); - if (o2 >= w2.gc() - 1 && H.b > t.b && j.c.e.b > t.b) { - continue; - } - if (o2 <= 0 && H.b < m.a && j.c.e.b < m.b) { - continue; - } - } - } else { - w2.jd(new Z1c()); - for (o2 = 0; o2 < w2.gc(); o2++) { - r = (h - G) / (I - G); - if (RD(w2.Xb(o2), 40).e.a > j.b.e.a * (1 - r) + j.c.e.a * r) { - break; - } - } - if (w2.gc() > 0) { - H = j.a.b == 0 ? ajd(j.b.e) : RD(Rub(j.a), 8); - t = $id(ajd(RD(w2.Xb(w2.gc() - 1), 40).e), RD(w2.Xb(w2.gc() - 1), 40).f); - m = $id(ajd(RD(w2.Xb(0), 40).e), RD(w2.Xb(0), 40).f); - if (o2 >= w2.gc() - 1 && H.a > t.a && j.c.e.a > t.a) { - continue; - } - if (o2 <= 0 && H.a < m.a && j.c.e.a < m.a) { - continue; - } - } - } - e = new pjd(); - f2 = new pjd(); - Mub(j.a, e); - Mub(j.a, f2); - g = new gud(e, f2, j); - s = Rdb(Sdb(h, 32), Cdb(o2, yxe)); - if (Ujb(A, Hgb(s))) { - n = RD(Wjb(A, Hgb(s)), 675); - Mub(n.a, g); - Dmd(n.b) ? tvb(n.a, new l2c()) : tvb(n.a, new p2c()); - h2c(n); - } else { - n = new i2c(o2 == 0 ? null : RD(w2.Xb(o2 - 1), 40), o2 == w2.gc() ? null : RD(w2.Xb(o2), 40), g, a); - Zjb(A, Hgb(s), n); - } - if (b == ymd || b == zmd) { - n.f && n.d.e.b <= Kfb(UD(mQb(a, (q$c(), _Zc)))) && ++C; - n.g && n.c.e.b + n.c.f.b >= Kfb(UD(mQb(a, (q$c(), $Zc)))) && ++D5; - } else { - n.f && n.d.e.a <= Kfb(UD(mQb(a, (q$c(), ZZc)))) && ++C; - n.g && n.c.e.a + n.c.f.a >= Kfb(UD(mQb(a, (q$c(), YZc)))) && ++D5; - } - } - } else if (u == 0) { - H0c(j); - } else if (u < 0) { - ++B[G]; - ++q[I]; - F = C0c(j, b, a, new Ptd(sgb(C), sgb(D5)), c2, d, new Ptd(sgb(q[I]), sgb(B[G]))); - C = RD(F.a, 17).a; - D5 = RD(F.b, 17).a; - } - } - } - function qrc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s; - d = b; - i2 = c2; - if (a.b && d.j == (qpd(), ppd) && i2.j == (qpd(), ppd)) { - s = d; - d = i2; - i2 = s; - } - if (Ujb(a.a, d)) { - if (Zsb(RD(Wjb(a.a, d), 49), i2)) { - return 1; - } - } else { - Zjb(a.a, d, new _sb()); - } - if (Ujb(a.a, i2)) { - if (Zsb(RD(Wjb(a.a, i2), 49), d)) { - return -1; - } - } else { - Zjb(a.a, i2, new _sb()); - } - if (Ujb(a.d, d)) { - if (Zsb(RD(Wjb(a.d, d), 49), i2)) { - return -1; - } - } else { - Zjb(a.d, d, new _sb()); - } - if (Ujb(a.d, i2)) { - if (Zsb(RD(Wjb(a.a, i2), 49), d)) { - return 1; - } - } else { - Zjb(a.d, i2, new _sb()); - } - if (d.j != i2.j) { - r = yrc(d.j, i2.j); - r == -1 ? rrc(a, i2, d) : rrc(a, d, i2); - return r; - } - if (d.e.c.length != 0 && i2.e.c.length != 0) { - if (a.b) { - r = orc(d, i2); - if (r != 0) { - r == -1 ? rrc(a, i2, d) : r == 1 && rrc(a, d, i2); - return r; - } - } - f2 = RD(Vmb(d.e, 0), 18).c.i; - k = RD(Vmb(i2.e, 0), 18).c.i; - if (f2 == k) { - e = RD(mQb(RD(Vmb(d.e, 0), 18), (Ywc(), zwc)), 17).a; - j = RD(mQb(RD(Vmb(i2.e, 0), 18), zwc), 17).a; - e > j ? rrc(a, d, i2) : rrc(a, i2, d); - return e < j ? -1 : e > j ? 1 : 0; - } - for (o2 = a.c, p = 0, q = o2.length; p < q; ++p) { - n = o2[p]; - if (n == f2) { - rrc(a, d, i2); - return 1; - } else if (n == k) { - rrc(a, i2, d); - return -1; - } - } - } - if (d.g.c.length != 0 && i2.g.c.length != 0) { - h = RD(mQb(d, (Ywc(), xwc)), 10); - m = RD(mQb(i2, xwc), 10); - if (a.e == (kEc(), jEc) && !!h && !!m && nQb(h, zwc) && nQb(m, zwc)) { - e = RD(mQb(h, zwc), 17).a; - j = RD(mQb(m, zwc), 17).a; - e > j ? rrc(a, d, i2) : rrc(a, i2, d); - return e < j ? -1 : e > j ? 1 : 0; - } - if (a.b) { - r = orc(d, i2); - if (r != 0) { - r == -1 ? rrc(a, i2, d) : r == 1 && rrc(a, d, i2); - return r; - } - } - g = 0; - l = 0; - nQb(RD(Vmb(d.g, 0), 18), zwc) && (g = RD(mQb(RD(Vmb(d.g, 0), 18), zwc), 17).a); - nQb(RD(Vmb(i2.g, 0), 18), zwc) && (l = RD(mQb(RD(Vmb(d.g, 0), 18), zwc), 17).a); - if (!!h && h == m) { - if (Heb(TD(mQb(RD(Vmb(d.g, 0), 18), Nwc))) && !Heb(TD(mQb(RD(Vmb(i2.g, 0), 18), Nwc)))) { - rrc(a, d, i2); - return 1; - } else if (!Heb(TD(mQb(RD(Vmb(d.g, 0), 18), Nwc))) && Heb(TD(mQb(RD(Vmb(i2.g, 0), 18), Nwc)))) { - rrc(a, i2, d); - return -1; - } - g > l ? rrc(a, d, i2) : rrc(a, i2, d); - return g < l ? -1 : g > l ? 1 : 0; - } - if (a.f) { - a.f._b(h) && (g = RD(a.f.xc(h), 17).a); - a.f._b(m) && (l = RD(a.f.xc(m), 17).a); - } - g > l ? rrc(a, d, i2) : rrc(a, i2, d); - return g < l ? -1 : g > l ? 1 : 0; - } - if (d.e.c.length != 0 && i2.g.c.length != 0) { - rrc(a, d, i2); - return 1; - } else if (d.g.c.length != 0 && i2.e.c.length != 0) { - rrc(a, i2, d); - return -1; - } else if (nQb(d, (Ywc(), zwc)) && nQb(i2, zwc)) { - e = RD(mQb(d, zwc), 17).a; - j = RD(mQb(i2, zwc), 17).a; - e > j ? rrc(a, d, i2) : rrc(a, i2, d); - return e < j ? -1 : e > j ? 1 : 0; - } else { - rrc(a, i2, d); - return -1; - } - } - function Yae(a) { - if (a.gb) - return; - a.gb = true; - a.b = jBd(a, 0); - iBd(a.b, 18); - oBd(a.b, 19); - a.a = jBd(a, 1); - iBd(a.a, 1); - oBd(a.a, 2); - oBd(a.a, 3); - oBd(a.a, 4); - oBd(a.a, 5); - a.o = jBd(a, 2); - iBd(a.o, 8); - iBd(a.o, 9); - oBd(a.o, 10); - oBd(a.o, 11); - oBd(a.o, 12); - oBd(a.o, 13); - oBd(a.o, 14); - oBd(a.o, 15); - oBd(a.o, 16); - oBd(a.o, 17); - oBd(a.o, 18); - oBd(a.o, 19); - oBd(a.o, 20); - oBd(a.o, 21); - oBd(a.o, 22); - oBd(a.o, 23); - nBd(a.o); - nBd(a.o); - nBd(a.o); - nBd(a.o); - nBd(a.o); - nBd(a.o); - nBd(a.o); - nBd(a.o); - nBd(a.o); - nBd(a.o); - a.p = jBd(a, 3); - iBd(a.p, 2); - iBd(a.p, 3); - iBd(a.p, 4); - iBd(a.p, 5); - oBd(a.p, 6); - oBd(a.p, 7); - nBd(a.p); - nBd(a.p); - a.q = jBd(a, 4); - iBd(a.q, 8); - a.v = jBd(a, 5); - oBd(a.v, 9); - nBd(a.v); - nBd(a.v); - nBd(a.v); - a.w = jBd(a, 6); - iBd(a.w, 2); - iBd(a.w, 3); - iBd(a.w, 4); - oBd(a.w, 5); - a.B = jBd(a, 7); - oBd(a.B, 1); - nBd(a.B); - nBd(a.B); - nBd(a.B); - a.Q = jBd(a, 8); - oBd(a.Q, 0); - nBd(a.Q); - a.R = jBd(a, 9); - iBd(a.R, 1); - a.S = jBd(a, 10); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - nBd(a.S); - a.T = jBd(a, 11); - oBd(a.T, 10); - oBd(a.T, 11); - oBd(a.T, 12); - oBd(a.T, 13); - oBd(a.T, 14); - nBd(a.T); - nBd(a.T); - a.U = jBd(a, 12); - iBd(a.U, 2); - iBd(a.U, 3); - oBd(a.U, 4); - oBd(a.U, 5); - oBd(a.U, 6); - oBd(a.U, 7); - nBd(a.U); - a.V = jBd(a, 13); - oBd(a.V, 10); - a.W = jBd(a, 14); - iBd(a.W, 18); - iBd(a.W, 19); - iBd(a.W, 20); - oBd(a.W, 21); - oBd(a.W, 22); - oBd(a.W, 23); - a.bb = jBd(a, 15); - iBd(a.bb, 10); - iBd(a.bb, 11); - iBd(a.bb, 12); - iBd(a.bb, 13); - iBd(a.bb, 14); - iBd(a.bb, 15); - iBd(a.bb, 16); - oBd(a.bb, 17); - nBd(a.bb); - nBd(a.bb); - a.eb = jBd(a, 16); - iBd(a.eb, 2); - iBd(a.eb, 3); - iBd(a.eb, 4); - iBd(a.eb, 5); - iBd(a.eb, 6); - iBd(a.eb, 7); - oBd(a.eb, 8); - oBd(a.eb, 9); - a.ab = jBd(a, 17); - iBd(a.ab, 0); - iBd(a.ab, 1); - a.H = jBd(a, 18); - oBd(a.H, 0); - oBd(a.H, 1); - oBd(a.H, 2); - oBd(a.H, 3); - oBd(a.H, 4); - oBd(a.H, 5); - nBd(a.H); - a.db = jBd(a, 19); - oBd(a.db, 2); - a.c = kBd(a, 20); - a.d = kBd(a, 21); - a.e = kBd(a, 22); - a.f = kBd(a, 23); - a.i = kBd(a, 24); - a.g = kBd(a, 25); - a.j = kBd(a, 26); - a.k = kBd(a, 27); - a.n = kBd(a, 28); - a.r = kBd(a, 29); - a.s = kBd(a, 30); - a.t = kBd(a, 31); - a.u = kBd(a, 32); - a.fb = kBd(a, 33); - a.A = kBd(a, 34); - a.C = kBd(a, 35); - a.D = kBd(a, 36); - a.F = kBd(a, 37); - a.G = kBd(a, 38); - a.I = kBd(a, 39); - a.J = kBd(a, 40); - a.L = kBd(a, 41); - a.M = kBd(a, 42); - a.N = kBd(a, 43); - a.O = kBd(a, 44); - a.P = kBd(a, 45); - a.X = kBd(a, 46); - a.Y = kBd(a, 47); - a.Z = kBd(a, 48); - a.$ = kBd(a, 49); - a._ = kBd(a, 50); - a.cb = kBd(a, 51); - a.K = kBd(a, 52); - } - function d5b(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G; - g = new Yub(); - w2 = RD(mQb(c2, (yCc(), rAc)), 88); - p = 0; - ye(g, (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); - while (g.b != 0) { - k = RD(g.b == 0 ? null : (sFb(g.b != 0), Wub(g, g.a.a)), 27); - j = vCd(k); - (dE(Gxd(j, cAc)) !== dE((kEc(), hEc)) || dE(Gxd(j, pAc)) === dE((Ptc(), Otc)) || dE(Gxd(j, pAc)) === dE((Ptc(), Mtc)) || Heb(TD(Gxd(j, eAc))) || dE(Gxd(j, Yzc)) !== dE((U$b(), T$b)) || dE(Gxd(j, ZAc)) === dE((aEc(), TDc)) || dE(Gxd(j, ZAc)) === dE((aEc(), UDc)) || dE(Gxd(j, $Ac)) === dE((_Cc(), SCc)) || dE(Gxd(j, $Ac)) === dE((_Cc(), UCc))) && !Heb(TD(Gxd(k, aAc))) && Ixd(k, (Ywc(), zwc), sgb(p++)); - r = !Heb(TD(Gxd(k, pBc))); - if (r) { - m = (!k.a && (k.a = new C5d(J4, k, 10, 11)), k.a).i != 0; - o2 = a5b(k); - n = dE(Gxd(k, IAc)) === dE((Fnd(), Cnd)); - G = !Hxd(k, (umd(), Akd)) || khb(WD(Gxd(k, Akd))); - u = null; - if (G && n && (m || o2)) { - u = Z4b(k); - pQb(u, rAc, w2); - nQb(u, PBc) && HCc(new RCc(Kfb(UD(mQb(u, PBc)))), u); - if (RD(Gxd(k, lBc), 181).gc() != 0) { - l = u; - FDb(new SDb(null, (!k.c && (k.c = new C5d(K4, k, 9, 9)), new Swb(k.c, 16))), new u5b(l)); - V4b(k, u); - } - } - A = c2; - B = RD(Wjb(a.a, vCd(k)), 10); - !!B && (A = B.e); - t = i5b(a, k, A); - if (u) { - t.e = u; - u.e = t; - ye(g, (!k.a && (k.a = new C5d(J4, k, 10, 11)), k.a)); - } - } - } - p = 0; - Pub(g, b, g.c.b, g.c); - while (g.b != 0) { - f2 = RD(g.b == 0 ? null : (sFb(g.b != 0), Wub(g, g.a.a)), 27); - for (i2 = new dMd((!f2.b && (f2.b = new C5d(G4, f2, 12, 3)), f2.b)); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 74); - X4b(h); - (dE(Gxd(b, cAc)) !== dE((kEc(), hEc)) || dE(Gxd(b, pAc)) === dE((Ptc(), Otc)) || dE(Gxd(b, pAc)) === dE((Ptc(), Mtc)) || Heb(TD(Gxd(b, eAc))) || dE(Gxd(b, Yzc)) !== dE((U$b(), T$b)) || dE(Gxd(b, ZAc)) === dE((aEc(), TDc)) || dE(Gxd(b, ZAc)) === dE((aEc(), UDc)) || dE(Gxd(b, $Ac)) === dE((_Cc(), SCc)) || dE(Gxd(b, $Ac)) === dE((_Cc(), UCc))) && Ixd(h, (Ywc(), zwc), sgb(p++)); - D5 = AGd(RD(QHd((!h.b && (h.b = new Yie(E4, h, 4, 7)), h.b), 0), 84)); - F = AGd(RD(QHd((!h.c && (h.c = new Yie(E4, h, 5, 8)), h.c), 0), 84)); - if (Heb(TD(Gxd(h, pBc))) || Heb(TD(Gxd(D5, pBc))) || Heb(TD(Gxd(F, pBc)))) { - continue; - } - q = ozd(h) && Heb(TD(Gxd(D5, NAc))) && Heb(TD(Gxd(h, OAc))); - v = f2; - q || NGd(F, D5) ? v = D5 : NGd(D5, F) && (v = F); - A = c2; - B = RD(Wjb(a.a, v), 10); - !!B && (A = B.e); - s = f5b(a, h, v, A); - pQb(s, (Ywc(), Zvc), _4b(a, h, b, c2)); - } - n = dE(Gxd(f2, IAc)) === dE((Fnd(), Cnd)); - if (n) { - for (e = new dMd((!f2.a && (f2.a = new C5d(J4, f2, 10, 11)), f2.a)); e.e != e.i.gc(); ) { - d = RD(bMd(e), 27); - G = !Hxd(d, (umd(), Akd)) || khb(WD(Gxd(d, Akd))); - C = dE(Gxd(d, IAc)) === dE(Cnd); - G && C && (Pub(g, d, g.c.b, g.c), true); - } - } - } - } - function Ywc() { - Ywc = geb; - var a, b; - Awc = new jGd(rAe); - Zvc = new jGd("coordinateOrigin"); - Kwc = new jGd("processors"); - Yvc = new kGd("compoundNode", (Geb(), false)); - nwc = new kGd("insideConnections", false); - Bwc = new jGd("originalBendpoints"); - Cwc = new jGd("originalDummyNodePosition"); - Dwc = new jGd("originalLabelEdge"); - Mwc = new jGd("representedLabels"); - cwc = new jGd("endLabels"); - dwc = new jGd("endLabel.origin"); - swc = new kGd("labelSide", (Pnd(), Ond)); - ywc = new kGd("maxEdgeThickness", 0); - Nwc = new kGd("reversed", false); - Lwc = new jGd(sAe); - vwc = new kGd("longEdgeSource", null); - wwc = new kGd("longEdgeTarget", null); - uwc = new kGd("longEdgeHasLabelDummies", false); - twc = new kGd("longEdgeBeforeLabelDummy", false); - bwc = new kGd("edgeConstraint", (huc(), fuc)); - pwc = new jGd("inLayerLayoutUnit"); - owc = new kGd("inLayerConstraint", (Gvc(), Evc)); - qwc = new kGd("inLayerSuccessorConstraint", new bnb()); - rwc = new kGd("inLayerSuccessorConstraintBetweenNonDummies", false); - Iwc = new jGd("portDummy"); - $vc = new kGd("crossingHint", sgb(0)); - kwc = new kGd("graphProperties", (b = RD(mfb(iX), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0))); - hwc = new kGd("externalPortSide", (qpd(), opd)); - iwc = new kGd("externalPortSize", new pjd()); - fwc = new jGd("externalPortReplacedDummies"); - gwc = new jGd("externalPortReplacedDummy"); - ewc = new kGd("externalPortConnections", (a = RD(mfb(E3), 9), new Fsb(a, RD(WEb(a, a.length), 9), 0))); - Jwc = new kGd(Xye, 0); - Uvc = new jGd("barycenterAssociates"); - Xwc = new jGd("TopSideComments"); - Vvc = new jGd("BottomSideComments"); - Xvc = new jGd("CommentConnectionPort"); - mwc = new kGd("inputCollect", false); - Gwc = new kGd("outputCollect", false); - awc = new kGd("cyclic", false); - _vc = new jGd("crossHierarchyMap"); - Wwc = new jGd("targetOffset"); - new kGd("splineLabelSize", new pjd()); - Qwc = new jGd("spacings"); - Hwc = new kGd("partitionConstraint", false); - Wvc = new jGd("breakingPoint.info"); - Uwc = new jGd("splines.survivingEdge"); - Twc = new jGd("splines.route.start"); - Rwc = new jGd("splines.edgeChain"); - Fwc = new jGd("originalPortConstraints"); - Pwc = new jGd("selfLoopHolder"); - Swc = new jGd("splines.nsPortY"); - zwc = new jGd("modelOrder"); - xwc = new jGd("longEdgeTargetNode"); - jwc = new kGd(GBe, false); - Owc = new kGd(GBe, false); - lwc = new jGd("layerConstraints.hiddenNodes"); - Ewc = new jGd("layerConstraints.opposidePort"); - Vwc = new jGd("targetNode.modelOrder"); - } - function D0c(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2; - for (l = Sub(a.b, 0); l.b != l.d.c; ) { - k = RD(evb(l), 40); - if (lhb(k.c, IEe)) { - continue; - } - f2 = RD(zDb(new SDb(null, new Swb(hWc(k, a), 16)), tBb(new ZBb(), new XBb(), new wCb(), cD(WC(QL, 1), jwe, 108, 0, [(xBb(), vBb)]))), 15); - b == (Cmd(), ymd) || b == zmd ? f2.jd(new L1c()) : f2.jd(new R1c()); - o2 = f2.gc(); - for (e = 0; e < o2; e++) { - g = o2 == 1 ? 0.5 : (1 + e) / (o2 + 1); - if (b == ymd) { - j = Kfb(UD(mQb(k, (q$c(), e$c)))); - if (k.e.a + k.f.a + d < j) { - Oub(RD(f2.Xb(e), 65).a, new rjd(j + c2, k.e.b + k.f.b * g)); - } else if (RD(f2.Xb(e), 65).a.b > 0) { - h = RD(Rub(RD(f2.Xb(e), 65).a), 8).a; - m = k.e.a + k.f.a / 2; - i2 = RD(Rub(RD(f2.Xb(e), 65).a), 8).b; - n = k.e.b + k.f.b / 2; - d > 0 && $wnd.Math.abs(i2 - n) / ($wnd.Math.abs(h - m) / 40) > 50 && (n > i2 ? Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a + d / 5.3, k.e.b + k.f.b * g - d / 2)) : Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a + d / 5.3, k.e.b + k.f.b * g + d / 2))); - } - Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a, k.e.b + k.f.b * g)); - } else if (b == zmd) { - j = Kfb(UD(mQb(k, (q$c(), f$c)))); - if (k.e.a - d > j) { - Oub(RD(f2.Xb(e), 65).a, new rjd(j - c2, k.e.b + k.f.b * g)); - } else if (RD(f2.Xb(e), 65).a.b > 0) { - h = RD(Rub(RD(f2.Xb(e), 65).a), 8).a; - m = k.e.a + k.f.a / 2; - i2 = RD(Rub(RD(f2.Xb(e), 65).a), 8).b; - n = k.e.b + k.f.b / 2; - d > 0 && $wnd.Math.abs(i2 - n) / ($wnd.Math.abs(h - m) / 40) > 50 && (n > i2 ? Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a - d / 5.3, k.e.b + k.f.b * g - d / 2)) : Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a - d / 5.3, k.e.b + k.f.b * g + d / 2))); - } - Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a, k.e.b + k.f.b * g)); - } else if (b == Bmd) { - j = Kfb(UD(mQb(k, (q$c(), e$c)))); - if (k.e.b + k.f.b + d < j) { - Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g, j + c2)); - } else if (RD(f2.Xb(e), 65).a.b > 0) { - h = RD(Rub(RD(f2.Xb(e), 65).a), 8).a; - m = k.e.a + k.f.a / 2; - i2 = RD(Rub(RD(f2.Xb(e), 65).a), 8).b; - n = k.e.b + k.f.b / 2; - d > 0 && $wnd.Math.abs(h - m) / ($wnd.Math.abs(i2 - n) / 40) > 50 && (m > h ? Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g - d / 2, k.e.b + d / 5.3 + k.f.b)) : Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g + d / 2, k.e.b + d / 5.3 + k.f.b))); - } - Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g, k.e.b + k.f.b)); - } else { - j = Kfb(UD(mQb(k, (q$c(), f$c)))); - if (mWc(RD(f2.Xb(e), 65), a)) { - Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g, RD(Rub(RD(f2.Xb(e), 65).a), 8).b)); - } else if (k.e.b - d > j) { - Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g, j - c2)); - } else if (RD(f2.Xb(e), 65).a.b > 0) { - h = RD(Rub(RD(f2.Xb(e), 65).a), 8).a; - m = k.e.a + k.f.a / 2; - i2 = RD(Rub(RD(f2.Xb(e), 65).a), 8).b; - n = k.e.b + k.f.b / 2; - d > 0 && $wnd.Math.abs(h - m) / ($wnd.Math.abs(i2 - n) / 40) > 50 && (m > h ? Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g - d / 2, k.e.b - d / 5.3)) : Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g + d / 2, k.e.b - d / 5.3))); - } - Oub(RD(f2.Xb(e), 65).a, new rjd(k.e.a + k.f.a * g, k.e.b)); - } - } - } - } - function umd() { - umd = geb; - var a, b; - Akd = new jGd(OGe); - Tld = new jGd(PGe); - Ckd = (Rjd(), Ljd); - Bkd = new lGd(MDe, Ckd); - Dkd = new lGd(Dze, null); - Ekd = new jGd(QGe); - Lkd = (ukd(), ysb(tkd, cD(WC(q3, 1), jwe, 298, 0, [pkd]))); - Kkd = new lGd(YDe, Lkd); - Mkd = new lGd(LDe, (Geb(), false)); - Okd = (Cmd(), Amd); - Nkd = new lGd(PDe, Okd); - Tkd = (Ymd(), Xmd); - Skd = new lGd(kDe, Tkd); - Wkd = new lGd(MGe, false); - Ykd = (Fnd(), Dnd); - Xkd = new lGd(fDe, Ykd); - uld = new A3b(12); - tld = new lGd(Eze, uld); - ald = new lGd(dAe, false); - bld = new lGd(iEe, false); - sld = new lGd(gAe, false); - Ild = (Bod(), Aod); - Hld = new lGd(eAe, Ild); - Qld = new jGd(fEe); - Rld = new jGd($ze); - Sld = new jGd(bAe); - Vld = new jGd(cAe); - dld = new Ejd(); - cld = new lGd(ZDe, dld); - Jkd = new lGd(aEe, false); - Zkd = new lGd(bEe, false); - fld = new P2b(); - eld = new lGd(gEe, fld); - rld = new lGd(JDe, false); - Uld = new lGd(SGe, 1); - Ikd = new jGd(TGe); - Hkd = new jGd(UGe); - mmd = new lGd(mAe, false); - new lGd(VGe, true); - sgb(0); - new lGd(WGe, sgb(100)); - new lGd(XGe, false); - sgb(0); - new lGd(YGe, sgb(4e3)); - sgb(0); - new lGd(ZGe, sgb(400)); - new lGd($Ge, false); - new lGd(_Ge, false); - new lGd(aHe, true); - new lGd(bHe, false); - Gkd = (Grd(), Frd); - Fkd = new lGd(NGe, Gkd); - Wld = new lGd(xDe, 10); - Xld = new lGd(yDe, 10); - Yld = new lGd(Bze, 20); - Zld = new lGd(zDe, 10); - $ld = new lGd(aAe, 2); - _ld = new lGd(ADe, 10); - bmd = new lGd(BDe, 0); - cmd = new lGd(EDe, 5); - dmd = new lGd(CDe, 1); - emd = new lGd(DDe, 1); - fmd = new lGd(_ze, 20); - gmd = new lGd(FDe, 10); - jmd = new lGd(GDe, 10); - amd = new jGd(HDe); - imd = new Q2b(); - hmd = new lGd(hEe, imd); - xld = new jGd(eEe); - wld = false; - vld = new lGd(dEe, wld); - hld = new A3b(5); - gld = new lGd(QDe, hld); - jld = (dod(), b = RD(mfb(A3), 9), new Fsb(b, RD(WEb(b, b.length), 9), 0)); - ild = new lGd(kAe, jld); - Ald = (pod(), mod); - zld = new lGd(TDe, Ald); - Cld = new jGd(UDe); - Dld = new jGd(VDe); - Eld = new jGd(WDe); - Bld = new jGd(XDe); - lld = (a = RD(mfb(H3), 9), new Fsb(a, RD(WEb(a, a.length), 9), 0)); - kld = new lGd(jAe, lld); - qld = xsb((dqd(), Ypd)); - pld = new lGd(iAe, qld); - old = new rjd(0, 0); - nld = new lGd(CAe, old); - mld = new lGd(hAe, false); - Rkd = (Omd(), Lmd); - Qkd = new lGd($De, Rkd); - Pkd = new lGd(fAe, false); - sgb(1); - new lGd(dHe, null); - Fld = new jGd(cEe); - Jld = new jGd(_De); - Pld = (qpd(), opd); - Old = new lGd(KDe, Pld); - Gld = new jGd(IDe); - Mld = (Pod(), xsb(Nod)); - Lld = new lGd(lAe, Mld); - Kld = new lGd(RDe, false); - Nld = new lGd(SDe, true); - qmd = new lGd(nAe, 1); - smd = new lGd(eHe, null); - lmd = new lGd(oAe, 150); - kmd = new lGd(pAe, 1.414); - nmd = new lGd(qAe, null); - omd = new lGd(fHe, 1); - $kd = new lGd(NDe, false); - _kd = new lGd(ODe, false); - Ukd = new lGd(Cze, 1); - Vkd = (ind(), gnd); - new lGd(gHe, Vkd); - yld = true; - rmd = (mqd(), jqd); - tmd = jqd; - pmd = jqd; - } - function hcc() { - hcc = geb; - nbc = new icc("DIRECTION_PREPROCESSOR", 0); - kbc = new icc("COMMENT_PREPROCESSOR", 1); - obc = new icc("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER", 2); - Ebc = new icc("INTERACTIVE_EXTERNAL_PORT_POSITIONER", 3); - Xbc = new icc("PARTITION_PREPROCESSOR", 4); - Ibc = new icc("LABEL_DUMMY_INSERTER", 5); - bcc = new icc("SELF_LOOP_PREPROCESSOR", 6); - Nbc = new icc("LAYER_CONSTRAINT_PREPROCESSOR", 7); - Vbc = new icc("PARTITION_MIDPROCESSOR", 8); - zbc = new icc("HIGH_DEGREE_NODE_LAYER_PROCESSOR", 9); - Rbc = new icc("NODE_PROMOTION", 10); - Mbc = new icc("LAYER_CONSTRAINT_POSTPROCESSOR", 11); - Wbc = new icc("PARTITION_POSTPROCESSOR", 12); - vbc = new icc("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR", 13); - dcc = new icc("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR", 14); - ebc = new icc("BREAKING_POINT_INSERTER", 15); - Qbc = new icc("LONG_EDGE_SPLITTER", 16); - Zbc = new icc("PORT_SIDE_PROCESSOR", 17); - Fbc = new icc("INVERTED_PORT_PROCESSOR", 18); - Ybc = new icc("PORT_LIST_SORTER", 19); - fcc = new icc("SORT_BY_INPUT_ORDER_OF_MODEL", 20); - Tbc = new icc("NORTH_SOUTH_PORT_PREPROCESSOR", 21); - fbc = new icc("BREAKING_POINT_PROCESSOR", 22); - Ubc = new icc(jBe, 23); - gcc = new icc(kBe, 24); - _bc = new icc("SELF_LOOP_PORT_RESTORER", 25); - ecc = new icc("SINGLE_EDGE_GRAPH_WRAPPER", 26); - Gbc = new icc("IN_LAYER_CONSTRAINT_PROCESSOR", 27); - sbc = new icc("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR", 28); - Hbc = new icc("LABEL_AND_NODE_SIZE_PROCESSOR", 29); - Dbc = new icc("INNERMOST_NODE_MARGIN_CALCULATOR", 30); - ccc = new icc("SELF_LOOP_ROUTER", 31); - ibc = new icc("COMMENT_NODE_MARGIN_CALCULATOR", 32); - qbc = new icc("END_LABEL_PREPROCESSOR", 33); - Kbc = new icc("LABEL_DUMMY_SWITCHER", 34); - hbc = new icc("CENTER_LABEL_MANAGEMENT_PROCESSOR", 35); - Lbc = new icc("LABEL_SIDE_SELECTOR", 36); - Bbc = new icc("HYPEREDGE_DUMMY_MERGER", 37); - wbc = new icc("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR", 38); - Obc = new icc("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR", 39); - ybc = new icc("HIERARCHICAL_PORT_POSITION_PROCESSOR", 40); - lbc = new icc("CONSTRAINTS_POSTPROCESSOR", 41); - jbc = new icc("COMMENT_POSTPROCESSOR", 42); - Cbc = new icc("HYPERNODE_PROCESSOR", 43); - xbc = new icc("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER", 44); - Pbc = new icc("LONG_EDGE_JOINER", 45); - acc = new icc("SELF_LOOP_POSTPROCESSOR", 46); - gbc = new icc("BREAKING_POINT_REMOVER", 47); - Sbc = new icc("NORTH_SOUTH_PORT_POSTPROCESSOR", 48); - Abc = new icc("HORIZONTAL_COMPACTOR", 49); - Jbc = new icc("LABEL_DUMMY_REMOVER", 50); - tbc = new icc("FINAL_SPLINE_BENDPOINTS_CALCULATOR", 51); - rbc = new icc("END_LABEL_SORTER", 52); - $bc = new icc("REVERSED_EDGE_RESTORER", 53); - pbc = new icc("END_LABEL_POSTPROCESSOR", 54); - ubc = new icc("HIERARCHICAL_NODE_RESIZER", 55); - mbc = new icc("DIRECTION_POSTPROCESSOR", 56); - } - function Ozc() { - Ozc = geb; - Uxc = ($tc(), Ytc); - Txc = new lGd(HBe, Uxc); - jyc = new lGd(IBe, (Geb(), false)); - pyc = (Ovc(), Mvc); - oyc = new lGd(JBe, pyc); - Hyc = new lGd(KBe, false); - Iyc = new lGd(LBe, true); - ixc = new lGd(MBe, false); - azc = (sEc(), qEc); - _yc = new lGd(NBe, azc); - sgb(1); - izc = new lGd(OBe, sgb(7)); - jzc = new lGd(PBe, false); - kyc = new lGd(QBe, false); - Sxc = (Ptc(), Ltc); - Rxc = new lGd(RBe, Sxc); - Gyc = (_Cc(), ZCc); - Fyc = new lGd(SBe, Gyc); - wyc = (cxc(), bxc); - vyc = new lGd(TBe, wyc); - sgb(-1); - uyc = new lGd(UBe, null); - sgb(-1); - xyc = new lGd(VBe, sgb(-1)); - sgb(-1); - yyc = new lGd(WBe, sgb(4)); - sgb(-1); - Ayc = new lGd(XBe, sgb(2)); - Eyc = (aEc(), $Dc); - Dyc = new lGd(YBe, Eyc); - sgb(0); - Cyc = new lGd(ZBe, sgb(0)); - syc = new lGd($Be, sgb(lve)); - Qxc = (stc(), qtc); - Pxc = new lGd(_Be, Qxc); - yxc = new lGd(aCe, false); - Hxc = new lGd(bCe, 0.1); - Nxc = new lGd(cCe, false); - Jxc = new lGd(dCe, null); - Kxc = new lGd(eCe, null); - sgb(-1); - Lxc = new lGd(fCe, null); - sgb(-1); - Mxc = new lGd(gCe, sgb(-1)); - sgb(0); - zxc = new lGd(hCe, sgb(40)); - Fxc = (xvc(), wvc); - Exc = new lGd(iCe, Fxc); - Bxc = uvc; - Axc = new lGd(jCe, Bxc); - $yc = (JDc(), EDc); - Zyc = new lGd(kCe, $yc); - Pyc = new jGd(lCe); - Kyc = (Cuc(), Auc); - Jyc = new lGd(mCe, Kyc); - Nyc = (Ouc(), Luc); - Myc = new lGd(nCe, Nyc); - Syc = new lGd(oCe, 0.3); - Uyc = new jGd(pCe); - Wyc = (wDc(), uDc); - Vyc = new lGd(qCe, Wyc); - ayc = (KEc(), IEc); - _xc = new lGd(rCe, ayc); - cyc = (TEc(), SEc); - byc = new lGd(sCe, cyc); - eyc = (lFc(), kFc); - dyc = new lGd(tCe, eyc); - gyc = new lGd(uCe, 0.2); - Zxc = new lGd(vCe, 2); - ezc = new lGd(wCe, null); - gzc = new lGd(xCe, 10); - fzc = new lGd(yCe, 10); - hzc = new lGd(zCe, 20); - sgb(0); - bzc = new lGd(ACe, sgb(0)); - sgb(0); - czc = new lGd(BCe, sgb(0)); - sgb(0); - dzc = new lGd(CCe, sgb(0)); - jxc = new lGd(DCe, false); - nxc = ($uc(), Yuc); - mxc = new lGd(ECe, nxc); - lxc = (jtc(), itc); - kxc = new lGd(FCe, lxc); - myc = new lGd(GCe, false); - sgb(0); - lyc = new lGd(HCe, sgb(16)); - sgb(0); - nyc = new lGd(ICe, sgb(5)); - Gzc = (DFc(), BFc); - Fzc = new lGd(JCe, Gzc); - kzc = new lGd(KCe, 10); - nzc = new lGd(LCe, 1); - wzc = (Etc(), Dtc); - vzc = new lGd(MCe, wzc); - qzc = new jGd(NCe); - tzc = sgb(1); - sgb(0); - szc = new lGd(OCe, tzc); - Lzc = (uFc(), rFc); - Kzc = new lGd(PCe, Lzc); - Hzc = new jGd(QCe); - Bzc = new lGd(RCe, true); - zzc = new lGd(SCe, 2); - Dzc = new lGd(TCe, true); - Yxc = (tuc(), ruc); - Xxc = new lGd(UCe, Yxc); - Wxc = (btc(), Zsc); - Vxc = new lGd(VCe, Wxc); - xxc = (kEc(), hEc); - wxc = new lGd(WCe, xxc); - vxc = new lGd(XCe, false); - uxc = new lGd(YCe, false); - pxc = (U$b(), T$b); - oxc = new lGd(ZCe, pxc); - txc = (lDc(), iDc); - sxc = new lGd($Ce, txc); - qxc = new lGd(_Ce, 0); - rxc = new lGd(aDe, 0); - ryc = Ntc; - qyc = ptc; - zyc = YCc; - Byc = YCc; - tyc = TCc; - Ixc = (Fnd(), Cnd); - Oxc = qtc; - Gxc = qtc; - Cxc = qtc; - Dxc = Cnd; - Qyc = HDc; - Ryc = EDc; - Lyc = EDc; - Oyc = EDc; - Tyc = GDc; - Yyc = HDc; - Xyc = HDc; - fyc = (Ymd(), Wmd); - hyc = Wmd; - iyc = kFc; - $xc = Vmd; - lzc = CFc; - mzc = AFc; - ozc = CFc; - pzc = AFc; - xzc = CFc; - yzc = AFc; - rzc = Ctc; - uzc = Dtc; - Mzc = CFc; - Nzc = AFc; - Izc = CFc; - Jzc = AFc; - Czc = AFc; - Azc = AFc; - Ezc = AFc; - } - function iNc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I, J, K2, L, M, N, O, P, Q, R, S2, T2, U, V, W, X, Y, Z, $, ab, bb, cb, db2, eb, fb, gb, hb, ib, jb, kb, lb; - cb = 0; - for (H = b, K2 = 0, N = H.length; K2 < N; ++K2) { - F = H[K2]; - for (V = new Anb(F.j); V.a < V.c.c.length; ) { - U = RD(ynb(V), 12); - X = 0; - for (h = new Anb(U.g); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - F.c != g.d.i.c && ++X; - } - X > 0 && (a.a[U.p] = cb++); - } - } - hb = 0; - for (I = c2, L = 0, O = I.length; L < O; ++L) { - F = I[L]; - P = 0; - for (V = new Anb(F.j); V.a < V.c.c.length; ) { - U = RD(ynb(V), 12); - if (U.j == (qpd(), Yod)) { - for (h = new Anb(U.e); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - if (F.c != g.c.i.c) { - ++P; - break; - } - } - } else { - break; - } - } - R = 0; - Y = new Jkb(F.j, F.j.c.length); - while (Y.b > 0) { - U = (sFb(Y.b > 0), RD(Y.a.Xb(Y.c = --Y.b), 12)); - X = 0; - for (h = new Anb(U.e); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - F.c != g.c.i.c && ++X; - } - if (X > 0) { - if (U.j == (qpd(), Yod)) { - a.a[U.p] = hb; - ++hb; - } else { - a.a[U.p] = hb + P + R; - ++R; - } - } - } - hb += R; - } - W = new Tsb(); - o2 = new Iub(); - for (G = b, J = 0, M = G.length; J < M; ++J) { - F = G[J]; - for (fb = new Anb(F.j); fb.a < fb.c.c.length; ) { - eb = RD(ynb(fb), 12); - for (h = new Anb(eb.g); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - jb = g.d; - if (F.c != jb.i.c) { - db2 = RD(Wd(qtb(W.f, eb)), 478); - ib = RD(Wd(qtb(W.f, jb)), 478); - if (!db2 && !ib) { - n = new lNc(); - o2.a.zc(n, o2); - Rmb(n.a, g); - Rmb(n.d, eb); - rtb(W.f, eb, n); - Rmb(n.d, jb); - rtb(W.f, jb, n); - } else if (!db2) { - Rmb(ib.a, g); - Rmb(ib.d, eb); - rtb(W.f, eb, ib); - } else if (!ib) { - Rmb(db2.a, g); - Rmb(db2.d, jb); - rtb(W.f, jb, db2); - } else if (db2 == ib) { - Rmb(db2.a, g); - } else { - Rmb(db2.a, g); - for (T2 = new Anb(ib.d); T2.a < T2.c.c.length; ) { - S2 = RD(ynb(T2), 12); - rtb(W.f, S2, db2); - } - Tmb(db2.a, ib.a); - Tmb(db2.d, ib.d); - o2.a.Bc(ib) != null; - } - } - } - } - } - p = RD(Ee(o2, $C(OY, { 3: 1, 4: 1, 5: 1, 2045: 1 }, 478, o2.a.gc(), 0, 1)), 2045); - D5 = b[0].c; - bb = c2[0].c; - for (k = p, l = 0, m = k.length; l < m; ++l) { - j = k[l]; - j.e = cb; - j.f = hb; - for (V = new Anb(j.d); V.a < V.c.c.length; ) { - U = RD(ynb(V), 12); - Z = a.a[U.p]; - if (U.i.c == D5) { - Z < j.e && (j.e = Z); - Z > j.b && (j.b = Z); - } else if (U.i.c == bb) { - Z < j.f && (j.f = Z); - Z > j.c && (j.c = Z); - } - } - } - Wnb(p, 0, p.length, null); - gb = $C(kE, Pwe, 28, p.length, 15, 1); - d = $C(kE, Pwe, 28, hb + 1, 15, 1); - for (r = 0; r < p.length; r++) { - gb[r] = p[r].f; - d[gb[r]] = 1; - } - f2 = 0; - for (s = 0; s < d.length; s++) { - d[s] == 1 ? d[s] = f2 : --f2; - } - $ = 0; - for (t = 0; t < gb.length; t++) { - gb[t] += d[gb[t]]; - $ = $wnd.Math.max($, gb[t] + 1); - } - i2 = 1; - while (i2 < $) { - i2 *= 2; - } - lb = 2 * i2 - 1; - i2 -= 1; - kb = $C(kE, Pwe, 28, lb, 15, 1); - e = 0; - for (B = 0; B < gb.length; B++) { - A = gb[B] + i2; - ++kb[A]; - while (A > 0) { - A % 2 > 0 && (e += kb[A + 1]); - A = (A - 1) / 2 | 0; - ++kb[A]; - } - } - C = $C(NY, rve, 374, p.length * 2, 0, 1); - for (u = 0; u < p.length; u++) { - C[2 * u] = new oNc(p[u], p[u].e, p[u].b, (sNc(), rNc)); - C[2 * u + 1] = new oNc(p[u], p[u].b, p[u].e, qNc); - } - Wnb(C, 0, C.length, null); - Q = 0; - for (v = 0; v < C.length; v++) { - switch (C[v].d.g) { - case 0: - ++Q; - break; - case 1: - --Q; - e += Q; - } - } - ab = $C(NY, rve, 374, p.length * 2, 0, 1); - for (w2 = 0; w2 < p.length; w2++) { - ab[2 * w2] = new oNc(p[w2], p[w2].f, p[w2].c, (sNc(), rNc)); - ab[2 * w2 + 1] = new oNc(p[w2], p[w2].c, p[w2].f, qNc); - } - Wnb(ab, 0, ab.length, null); - Q = 0; - for (q = 0; q < ab.length; q++) { - switch (ab[q].d.g) { - case 0: - ++Q; - break; - case 1: - --Q; - e += Q; - } - } - return e; - } - function Vse() { - Vse = geb; - Ese = new Wse(7); - Gse = new Hte(8, 94); - new Hte(8, 64); - Hse = new Hte(8, 36); - Nse = new Hte(8, 65); - Ose = new Hte(8, 122); - Pse = new Hte(8, 90); - Sse = new Hte(8, 98); - Lse = new Hte(8, 66); - Qse = new Hte(8, 60); - Tse = new Hte(8, 62); - Dse = new Wse(11); - Bse = new xte(4); - rte(Bse, 48, 57); - Rse = new xte(4); - rte(Rse, 48, 57); - rte(Rse, 65, 90); - rte(Rse, 95, 95); - rte(Rse, 97, 122); - Mse = new xte(4); - rte(Mse, 9, 9); - rte(Mse, 10, 10); - rte(Mse, 12, 12); - rte(Mse, 13, 13); - rte(Mse, 32, 32); - Ise = yte(Bse); - Kse = yte(Rse); - Jse = yte(Mse); - wse = new Tsb(); - xse = new Tsb(); - yse = cD(WC(qJ, 1), Nve, 2, 6, ["Cn", "Lu", "Ll", "Lt", "Lm", "Lo", "Mn", "Me", "Mc", "Nd", "Nl", "No", "Zs", "Zl", "Zp", "Cc", "Cf", null, "Co", "Cs", "Pd", "Ps", "Pe", "Pc", "Po", "Sm", "Sc", "Sk", "So", "Pi", "Pf", "L", "M", "N", "Z", "C", "P", "S"]); - vse = cD(WC(qJ, 1), Nve, 2, 6, ["Basic Latin", "Latin-1 Supplement", "Latin Extended-A", "Latin Extended-B", "IPA Extensions", "Spacing Modifier Letters", "Combining Diacritical Marks", "Greek", "Cyrillic", "Armenian", "Hebrew", "Arabic", "Syriac", "Thaana", "Devanagari", "Bengali", "Gurmukhi", "Gujarati", "Oriya", "Tamil", "Telugu", "Kannada", "Malayalam", "Sinhala", "Thai", "Lao", "Tibetan", "Myanmar", "Georgian", "Hangul Jamo", "Ethiopic", "Cherokee", "Unified Canadian Aboriginal Syllabics", "Ogham", "Runic", "Khmer", "Mongolian", "Latin Extended Additional", "Greek Extended", "General Punctuation", "Superscripts and Subscripts", "Currency Symbols", "Combining Marks for Symbols", "Letterlike Symbols", "Number Forms", "Arrows", "Mathematical Operators", "Miscellaneous Technical", "Control Pictures", "Optical Character Recognition", "Enclosed Alphanumerics", "Box Drawing", "Block Elements", "Geometric Shapes", "Miscellaneous Symbols", "Dingbats", "Braille Patterns", "CJK Radicals Supplement", "Kangxi Radicals", "Ideographic Description Characters", "CJK Symbols and Punctuation", "Hiragana", "Katakana", "Bopomofo", "Hangul Compatibility Jamo", "Kanbun", "Bopomofo Extended", "Enclosed CJK Letters and Months", "CJK Compatibility", "CJK Unified Ideographs Extension A", "CJK Unified Ideographs", "Yi Syllables", "Yi Radicals", "Hangul Syllables", VLe, "CJK Compatibility Ideographs", "Alphabetic Presentation Forms", "Arabic Presentation Forms-A", "Combining Half Marks", "CJK Compatibility Forms", "Small Form Variants", "Arabic Presentation Forms-B", "Specials", "Halfwidth and Fullwidth Forms", "Old Italic", "Gothic", "Deseret", "Byzantine Musical Symbols", "Musical Symbols", "Mathematical Alphanumeric Symbols", "CJK Unified Ideographs Extension B", "CJK Compatibility Ideographs Supplement", "Tags"]); - zse = cD(WC(kE, 1), Pwe, 28, 15, [66304, 66351, 66352, 66383, 66560, 66639, 118784, 119039, 119040, 119295, 119808, 120831, 131072, 173782, 194560, 195103, 917504, 917631]); - } - function hMb() { - hMb = geb; - eMb = new kMb("OUT_T_L", 0, (EKb(), CKb), (vLb(), sLb), (ZJb(), WJb), WJb, cD(WC(bL, 1), rve, 21, 0, [ysb((dod(), _nd), cD(WC(A3, 1), jwe, 95, 0, [cod, Xnd]))])); - dMb = new kMb("OUT_T_C", 1, BKb, sLb, WJb, XJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Wnd])), ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Wnd, Ynd]))])); - fMb = new kMb("OUT_T_R", 2, DKb, sLb, WJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Znd]))])); - XLb = new kMb("OUT_B_L", 3, CKb, uLb, YJb, WJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Xnd]))])); - WLb = new kMb("OUT_B_C", 4, BKb, uLb, YJb, XJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Wnd])), ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Wnd, Ynd]))])); - YLb = new kMb("OUT_B_R", 5, DKb, uLb, YJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Znd]))])); - _Lb = new kMb("OUT_L_T", 6, DKb, uLb, WJb, WJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Xnd, cod, Ynd]))])); - $Lb = new kMb("OUT_L_C", 7, DKb, tLb, XJb, WJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Xnd, bod])), ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Xnd, bod, Ynd]))])); - ZLb = new kMb("OUT_L_B", 8, DKb, sLb, YJb, WJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Xnd, aod, Ynd]))])); - cMb = new kMb("OUT_R_T", 9, CKb, uLb, WJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Znd, cod, Ynd]))])); - bMb = new kMb("OUT_R_C", 10, CKb, tLb, XJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Znd, bod])), ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Znd, bod, Ynd]))])); - aMb = new kMb("OUT_R_B", 11, CKb, sLb, YJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb(_nd, cD(WC(A3, 1), jwe, 95, 0, [Znd, aod, Ynd]))])); - ULb = new kMb("IN_T_L", 12, CKb, uLb, WJb, WJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Xnd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Xnd, Ynd]))])); - TLb = new kMb("IN_T_C", 13, BKb, uLb, WJb, XJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Wnd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Wnd, Ynd]))])); - VLb = new kMb("IN_T_R", 14, DKb, uLb, WJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Znd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [cod, Znd, Ynd]))])); - RLb = new kMb("IN_C_L", 15, CKb, tLb, XJb, WJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [bod, Xnd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [bod, Xnd, Ynd]))])); - QLb = new kMb("IN_C_C", 16, BKb, tLb, XJb, XJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [bod, Wnd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [bod, Wnd, Ynd]))])); - SLb = new kMb("IN_C_R", 17, DKb, tLb, XJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [bod, Znd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [bod, Znd, Ynd]))])); - OLb = new kMb("IN_B_L", 18, CKb, sLb, YJb, WJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Xnd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Xnd, Ynd]))])); - NLb = new kMb("IN_B_C", 19, BKb, sLb, YJb, XJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Wnd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Wnd, Ynd]))])); - PLb = new kMb("IN_B_R", 20, DKb, sLb, YJb, YJb, cD(WC(bL, 1), rve, 21, 0, [ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Znd])), ysb($nd, cD(WC(A3, 1), jwe, 95, 0, [aod, Znd, Ynd]))])); - gMb = new kMb(Sye, 21, null, null, null, null, cD(WC(bL, 1), rve, 21, 0, [])); - } - function JTd() { - JTd = geb; - nTd = (lTd(), kTd).b; - RD(QHd(xYd(kTd.b), 0), 35); - RD(QHd(xYd(kTd.b), 1), 19); - mTd = kTd.a; - RD(QHd(xYd(kTd.a), 0), 35); - RD(QHd(xYd(kTd.a), 1), 19); - RD(QHd(xYd(kTd.a), 2), 19); - RD(QHd(xYd(kTd.a), 3), 19); - RD(QHd(xYd(kTd.a), 4), 19); - oTd = kTd.o; - RD(QHd(xYd(kTd.o), 0), 35); - RD(QHd(xYd(kTd.o), 1), 35); - qTd = RD(QHd(xYd(kTd.o), 2), 19); - RD(QHd(xYd(kTd.o), 3), 19); - RD(QHd(xYd(kTd.o), 4), 19); - RD(QHd(xYd(kTd.o), 5), 19); - RD(QHd(xYd(kTd.o), 6), 19); - RD(QHd(xYd(kTd.o), 7), 19); - RD(QHd(xYd(kTd.o), 8), 19); - RD(QHd(xYd(kTd.o), 9), 19); - RD(QHd(xYd(kTd.o), 10), 19); - RD(QHd(xYd(kTd.o), 11), 19); - RD(QHd(xYd(kTd.o), 12), 19); - RD(QHd(xYd(kTd.o), 13), 19); - RD(QHd(xYd(kTd.o), 14), 19); - RD(QHd(xYd(kTd.o), 15), 19); - RD(QHd(uYd(kTd.o), 0), 62); - RD(QHd(uYd(kTd.o), 1), 62); - RD(QHd(uYd(kTd.o), 2), 62); - RD(QHd(uYd(kTd.o), 3), 62); - RD(QHd(uYd(kTd.o), 4), 62); - RD(QHd(uYd(kTd.o), 5), 62); - RD(QHd(uYd(kTd.o), 6), 62); - RD(QHd(uYd(kTd.o), 7), 62); - RD(QHd(uYd(kTd.o), 8), 62); - RD(QHd(uYd(kTd.o), 9), 62); - pTd = kTd.p; - RD(QHd(xYd(kTd.p), 0), 35); - RD(QHd(xYd(kTd.p), 1), 35); - RD(QHd(xYd(kTd.p), 2), 35); - RD(QHd(xYd(kTd.p), 3), 35); - RD(QHd(xYd(kTd.p), 4), 19); - RD(QHd(xYd(kTd.p), 5), 19); - RD(QHd(uYd(kTd.p), 0), 62); - RD(QHd(uYd(kTd.p), 1), 62); - rTd = kTd.q; - RD(QHd(xYd(kTd.q), 0), 35); - sTd = kTd.v; - RD(QHd(xYd(kTd.v), 0), 19); - RD(QHd(uYd(kTd.v), 0), 62); - RD(QHd(uYd(kTd.v), 1), 62); - RD(QHd(uYd(kTd.v), 2), 62); - tTd = kTd.w; - RD(QHd(xYd(kTd.w), 0), 35); - RD(QHd(xYd(kTd.w), 1), 35); - RD(QHd(xYd(kTd.w), 2), 35); - RD(QHd(xYd(kTd.w), 3), 19); - uTd = kTd.B; - RD(QHd(xYd(kTd.B), 0), 19); - RD(QHd(uYd(kTd.B), 0), 62); - RD(QHd(uYd(kTd.B), 1), 62); - RD(QHd(uYd(kTd.B), 2), 62); - xTd = kTd.Q; - RD(QHd(xYd(kTd.Q), 0), 19); - RD(QHd(uYd(kTd.Q), 0), 62); - yTd = kTd.R; - RD(QHd(xYd(kTd.R), 0), 35); - zTd = kTd.S; - RD(QHd(uYd(kTd.S), 0), 62); - RD(QHd(uYd(kTd.S), 1), 62); - RD(QHd(uYd(kTd.S), 2), 62); - RD(QHd(uYd(kTd.S), 3), 62); - RD(QHd(uYd(kTd.S), 4), 62); - RD(QHd(uYd(kTd.S), 5), 62); - RD(QHd(uYd(kTd.S), 6), 62); - RD(QHd(uYd(kTd.S), 7), 62); - RD(QHd(uYd(kTd.S), 8), 62); - RD(QHd(uYd(kTd.S), 9), 62); - RD(QHd(uYd(kTd.S), 10), 62); - RD(QHd(uYd(kTd.S), 11), 62); - RD(QHd(uYd(kTd.S), 12), 62); - RD(QHd(uYd(kTd.S), 13), 62); - RD(QHd(uYd(kTd.S), 14), 62); - ATd = kTd.T; - RD(QHd(xYd(kTd.T), 0), 19); - RD(QHd(xYd(kTd.T), 2), 19); - BTd = RD(QHd(xYd(kTd.T), 3), 19); - RD(QHd(xYd(kTd.T), 4), 19); - RD(QHd(uYd(kTd.T), 0), 62); - RD(QHd(uYd(kTd.T), 1), 62); - RD(QHd(xYd(kTd.T), 1), 19); - CTd = kTd.U; - RD(QHd(xYd(kTd.U), 0), 35); - RD(QHd(xYd(kTd.U), 1), 35); - RD(QHd(xYd(kTd.U), 2), 19); - RD(QHd(xYd(kTd.U), 3), 19); - RD(QHd(xYd(kTd.U), 4), 19); - RD(QHd(xYd(kTd.U), 5), 19); - RD(QHd(uYd(kTd.U), 0), 62); - DTd = kTd.V; - RD(QHd(xYd(kTd.V), 0), 19); - ETd = kTd.W; - RD(QHd(xYd(kTd.W), 0), 35); - RD(QHd(xYd(kTd.W), 1), 35); - RD(QHd(xYd(kTd.W), 2), 35); - RD(QHd(xYd(kTd.W), 3), 19); - RD(QHd(xYd(kTd.W), 4), 19); - RD(QHd(xYd(kTd.W), 5), 19); - GTd = kTd.bb; - RD(QHd(xYd(kTd.bb), 0), 35); - RD(QHd(xYd(kTd.bb), 1), 35); - RD(QHd(xYd(kTd.bb), 2), 35); - RD(QHd(xYd(kTd.bb), 3), 35); - RD(QHd(xYd(kTd.bb), 4), 35); - RD(QHd(xYd(kTd.bb), 5), 35); - RD(QHd(xYd(kTd.bb), 6), 35); - RD(QHd(xYd(kTd.bb), 7), 19); - RD(QHd(uYd(kTd.bb), 0), 62); - RD(QHd(uYd(kTd.bb), 1), 62); - HTd = kTd.eb; - RD(QHd(xYd(kTd.eb), 0), 35); - RD(QHd(xYd(kTd.eb), 1), 35); - RD(QHd(xYd(kTd.eb), 2), 35); - RD(QHd(xYd(kTd.eb), 3), 35); - RD(QHd(xYd(kTd.eb), 4), 35); - RD(QHd(xYd(kTd.eb), 5), 35); - RD(QHd(xYd(kTd.eb), 6), 19); - RD(QHd(xYd(kTd.eb), 7), 19); - FTd = kTd.ab; - RD(QHd(xYd(kTd.ab), 0), 35); - RD(QHd(xYd(kTd.ab), 1), 35); - vTd = kTd.H; - RD(QHd(xYd(kTd.H), 0), 19); - RD(QHd(xYd(kTd.H), 1), 19); - RD(QHd(xYd(kTd.H), 2), 19); - RD(QHd(xYd(kTd.H), 3), 19); - RD(QHd(xYd(kTd.H), 4), 19); - RD(QHd(xYd(kTd.H), 5), 19); - RD(QHd(uYd(kTd.H), 0), 62); - ITd = kTd.db; - RD(QHd(xYd(kTd.db), 0), 19); - wTd = kTd.M; - } - function Ane(a) { - var b; - if (a.O) - return; - a.O = true; - PAd(a, "type"); - CBd(a, "ecore.xml.type"); - DBd(a, dLe); - b = RD(N5d((YSd(), XSd), dLe), 2044); - WGd(zYd(a.fb), a.b); - vBd(a.b, Vbb, "AnyType", false, false, true); - tBd(RD(QHd(xYd(a.b), 0), 35), a.wb.D, pKe, null, 0, -1, Vbb, false, false, true, false, false, false); - tBd(RD(QHd(xYd(a.b), 1), 35), a.wb.D, "any", null, 0, -1, Vbb, true, true, true, false, false, true); - tBd(RD(QHd(xYd(a.b), 2), 35), a.wb.D, "anyAttribute", null, 0, -1, Vbb, false, false, true, false, false, false); - vBd(a.bb, Xbb, iLe, false, false, true); - tBd(RD(QHd(xYd(a.bb), 0), 35), a.gb, "data", null, 0, 1, Xbb, false, false, true, false, true, false); - tBd(RD(QHd(xYd(a.bb), 1), 35), a.gb, CIe, null, 1, 1, Xbb, false, false, true, false, true, false); - vBd(a.fb, Ybb, jLe, false, false, true); - tBd(RD(QHd(xYd(a.fb), 0), 35), b.gb, "rawValue", null, 0, 1, Ybb, true, true, true, false, true, true); - tBd(RD(QHd(xYd(a.fb), 1), 35), b.a, aIe, null, 0, 1, Ybb, true, true, true, false, true, true); - zBd(RD(QHd(xYd(a.fb), 2), 19), a.wb.q, null, "instanceType", 1, 1, Ybb, false, false, true, false, false, false, false); - vBd(a.qb, Zbb, kLe, false, false, true); - tBd(RD(QHd(xYd(a.qb), 0), 35), a.wb.D, pKe, null, 0, -1, null, false, false, true, false, false, false); - zBd(RD(QHd(xYd(a.qb), 1), 19), a.wb.ab, null, "xMLNSPrefixMap", 0, -1, null, true, false, true, true, false, false, false); - zBd(RD(QHd(xYd(a.qb), 2), 19), a.wb.ab, null, "xSISchemaLocation", 0, -1, null, true, false, true, true, false, false, false); - tBd(RD(QHd(xYd(a.qb), 3), 35), a.gb, "cDATA", null, 0, -2, null, true, true, true, false, false, true); - tBd(RD(QHd(xYd(a.qb), 4), 35), a.gb, "comment", null, 0, -2, null, true, true, true, false, false, true); - zBd(RD(QHd(xYd(a.qb), 5), 19), a.bb, null, KLe, 0, -2, null, true, true, true, true, false, false, true); - tBd(RD(QHd(xYd(a.qb), 6), 35), a.gb, hIe, null, 0, -2, null, true, true, true, false, false, true); - xBd(a.a, jJ, "AnySimpleType", true); - xBd(a.c, qJ, "AnyURI", true); - xBd(a.d, WC(gE, 1), "Base64Binary", true); - xBd(a.e, xdb, "Boolean", true); - xBd(a.f, QI, "BooleanObject", true); - xBd(a.g, gE, "Byte", true); - xBd(a.i, RI, "ByteObject", true); - xBd(a.j, qJ, "Date", true); - xBd(a.k, qJ, "DateTime", true); - xBd(a.n, tJ, "Decimal", true); - xBd(a.o, iE, "Double", true); - xBd(a.p, VI, "DoubleObject", true); - xBd(a.q, qJ, "Duration", true); - xBd(a.s, QK, "ENTITIES", true); - xBd(a.r, QK, "ENTITIESBase", true); - xBd(a.t, qJ, qLe, true); - xBd(a.u, jE, "Float", true); - xBd(a.v, ZI, "FloatObject", true); - xBd(a.w, qJ, "GDay", true); - xBd(a.B, qJ, "GMonth", true); - xBd(a.A, qJ, "GMonthDay", true); - xBd(a.C, qJ, "GYear", true); - xBd(a.D, qJ, "GYearMonth", true); - xBd(a.F, WC(gE, 1), "HexBinary", true); - xBd(a.G, qJ, "ID", true); - xBd(a.H, qJ, "IDREF", true); - xBd(a.J, QK, "IDREFS", true); - xBd(a.I, QK, "IDREFSBase", true); - xBd(a.K, kE, "Int", true); - xBd(a.M, uJ, "Integer", true); - xBd(a.L, bJ, "IntObject", true); - xBd(a.P, qJ, "Language", true); - xBd(a.Q, lE, "Long", true); - xBd(a.R, eJ, "LongObject", true); - xBd(a.S, qJ, "Name", true); - xBd(a.T, qJ, rLe, true); - xBd(a.U, uJ, "NegativeInteger", true); - xBd(a.V, qJ, BLe, true); - xBd(a.X, QK, "NMTOKENS", true); - xBd(a.W, QK, "NMTOKENSBase", true); - xBd(a.Y, uJ, "NonNegativeInteger", true); - xBd(a.Z, uJ, "NonPositiveInteger", true); - xBd(a.$, qJ, "NormalizedString", true); - xBd(a._, qJ, "NOTATION", true); - xBd(a.ab, qJ, "PositiveInteger", true); - xBd(a.cb, qJ, "QName", true); - xBd(a.db, wdb, "Short", true); - xBd(a.eb, lJ, "ShortObject", true); - xBd(a.gb, qJ, uwe, true); - xBd(a.hb, qJ, "Time", true); - xBd(a.ib, qJ, "Token", true); - xBd(a.jb, wdb, "UnsignedByte", true); - xBd(a.kb, lJ, "UnsignedByteObject", true); - xBd(a.lb, lE, "UnsignedInt", true); - xBd(a.mb, eJ, "UnsignedIntObject", true); - xBd(a.nb, uJ, "UnsignedLong", true); - xBd(a.ob, kE, "UnsignedShort", true); - xBd(a.pb, bJ, "UnsignedShortObject", true); - pBd(a, dLe); - yne(a); - } - function Fed(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5, F, G, H, I, J, K2, L, M, N, O, P, Q, R, S2, T2, U, V, W, X, Y, Z, $, ab; - if (d.$g()) { - return yob(), yob(), vob; - } - if (Heb(TD(Gxd(b, (umd(), rld))))) { - return yob(), yob(), vob; - } - A = (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i != 0; - C = Ded(b); - B = !C.dc(); - if (A || B) { - e = RD(Gxd(b, Tld), 143); - if (!e) { - throw Adb(new Jed("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before computing layout.")); - } - Y = Ofd(e, (aGd(), YFd)); - Bed(b); - if (!A && B && !Y) { - return yob(), yob(), vob; - } - t = new bnb(); - if (dE(Gxd(b, Xkd)) === dE((Fnd(), Cnd)) && (Ofd(e, VFd) || Ofd(e, UFd))) { - if (Heb(TD(Gxd(b, mmd)))) { - throw Adb(new Jed("Topdown layout cannot be used together with hierarchy handling.")); - } - M = Aed(a, b); - N = new Yub(); - ye(N, (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); - while (N.b != 0) { - K2 = RD(N.b == 0 ? null : (sFb(N.b != 0), Wub(N, N.a.a)), 27); - Bed(K2); - X = dE(Gxd(K2, Xkd)) === dE(End); - if (X || Hxd(K2, Akd) && !Nfd(e, Gxd(K2, Tld))) { - q = Fed(a, K2, c2, d); - Tmb(t, q); - Ixd(K2, Xkd, End); - ksd(K2); - } else { - ye(N, (!K2.a && (K2.a = new C5d(J4, K2, 10, 11)), K2.a)); - } - } - } else { - M = (!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a).i; - if (Heb(TD(Gxd(b, mmd)))) { - Z = d.eh(1); - Z.Ug(yGe, 1); - if (Gxd(b, nmd) == null) { - throw Adb(new Jed(b.k + " has not been assigned a top-down node type.")); - } - if (RD(Gxd(b, nmd), 280) == (mqd(), jqd) || RD(Gxd(b, nmd), 280) == lqd) { - for (s = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); s.e != s.i.gc(); ) { - r = RD(bMd(s), 27); - J = RD(Gxd(r, Tld), 143); - if ((!r.a && (r.a = new C5d(J4, r, 10, 11)), r.a).i > 0 && (ltd(J.f), false)) { - if (RD(Gxd(r, nmd), 280) == jqd) { - throw Adb(new Jed("Topdown Layout Providers should only be used on parallel nodes.")); - } - fE(ltd(J.f)); - null.Um(); - zyd(r, $wnd.Math.max(r.g, null.Vm), $wnd.Math.max(r.f, null.Vm)); - } else if (Gxd(r, smd) != null) { - h = RD(Gxd(r, smd), 347); - W = h.Tg(r); - zyd(r, $wnd.Math.max(r.g, W.a), $wnd.Math.max(r.f, W.b)); - } - } - } - O = RD(Gxd(b, tld), 107); - n = b.g - (O.b + O.c); - m = b.f - (O.d + O.a); - Z.bh("Available Child Area: (" + n + "|" + m + ")"); - Ixd(b, Dkd, n / m); - Ced(b, e, d.eh(M)); - if (RD(Gxd(b, nmd), 280) == lqd) { - psd(b); - zyd(b, O.b + Kfb(UD(Gxd(b, Ikd))) + O.c, O.d + Kfb(UD(Gxd(b, Hkd))) + O.a); - } - Z.bh("Executed layout algorithm: " + WD(Gxd(b, Akd)) + " on node " + b.k); - if (RD(Gxd(b, nmd), 280) == jqd) { - if (n < 0 || m < 0) { - throw Adb(new Jed("The size defined by the parent parallel node is too small for the space provided by the paddings of the child hierarchical node. " + b.k)); - } - Hxd(b, Ikd) || Hxd(b, Hkd) || psd(b); - p = Kfb(UD(Gxd(b, Ikd))); - o2 = Kfb(UD(Gxd(b, Hkd))); - Z.bh("Desired Child Area: (" + p + "|" + o2 + ")"); - Q = n / p; - R = m / o2; - P = $wnd.Math.min(Q, $wnd.Math.min(R, Kfb(UD(Gxd(b, omd))))); - Ixd(b, qmd, P); - Z.bh(b.k + " -- Local Scale Factor (X|Y): (" + Q + "|" + R + ")"); - u = RD(Gxd(b, Kkd), 21); - f2 = 0; - g = 0; - P < Q && (u.Hc((ukd(), okd)) ? f2 = (n / 2 - p * P / 2) / P : u.Hc(qkd) && (f2 = (n - p * P) / P)); - P < R && (u.Hc((ukd(), skd)) ? g = (m / 2 - o2 * P / 2) / P : u.Hc(rkd) && (g = (m - o2 * P) / P)); - $ = f2 + (O.b / P - O.b); - ab = g + (O.d / P - O.d); - Z.bh("Shift: (" + $ + "|" + ab + ")"); - for (L = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); L.e != L.i.gc(); ) { - K2 = RD(bMd(L), 27); - Dyd(K2, K2.i + $); - Eyd(K2, K2.j + ab); - } - for (w2 = new dMd((!b.b && (b.b = new C5d(G4, b, 12, 3)), b.b)); w2.e != w2.i.gc(); ) { - v = RD(bMd(w2), 74); - for (T2 = new dMd((!v.a && (v.a = new C5d(F4, v, 6, 6)), v.a)); T2.e != T2.i.gc(); ) { - S2 = RD(bMd(T2), 166); - Nzd(S2, S2.j + $, S2.k + ab); - Gzd(S2, S2.b + $, S2.c + ab); - for (j = new dMd((!S2.a && (S2.a = new XZd(D4, S2, 5)), S2.a)); j.e != j.i.gc(); ) { - i2 = RD(bMd(j), 377); - Uxd(i2, i2.a + $, i2.b + ab); - } - } - for (I = new dMd((!v.n && (v.n = new C5d(I4, v, 1, 7)), v.n)); I.e != I.i.gc(); ) { - H = RD(bMd(I), 135); - Byd(H, H.i + $, H.j + ab); - } - G = RD(Gxd(v, cld), 75); - for (F = Sub(G, 0); F.b != F.d.c; ) { - D5 = RD(evb(F), 8); - D5.a += $; - D5.b += ab; - } - Ixd(v, cld, G); - } - } - Z.Vg(); - } - for (l = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); l.e != l.i.gc(); ) { - k = RD(bMd(l), 27); - q = Fed(a, k, c2, d); - Tmb(t, q); - ksd(k); - } - } - if (d.$g()) { - return yob(), yob(), vob; - } - for (V = new Anb(t); V.a < V.c.c.length; ) { - U = RD(ynb(V), 74); - Ixd(U, rld, (Geb(), true)); - } - Heb(TD(Gxd(b, mmd))) || Ced(b, e, d.eh(M)); - Ged(t); - return B && Y ? C : (yob(), yob(), vob); - } else { - return yob(), yob(), vob; - } - } - function Jre(a, b) { - var c2, d; - if (!Bre) { - Bre = new Tsb(); - Cre = new Tsb(); - d = (Vse(), Vse(), new xte(4)); - ose(d, " \n\r\r "); - $jb(Bre, QLe, d); - $jb(Cre, QLe, yte(d)); - d = new xte(4); - ose(d, TLe); - $jb(Bre, OLe, d); - $jb(Cre, OLe, yte(d)); - d = new xte(4); - ose(d, TLe); - $jb(Bre, OLe, d); - $jb(Cre, OLe, yte(d)); - d = new xte(4); - ose(d, ULe); - ute(d, RD(Xjb(Bre, OLe), 122)); - $jb(Bre, PLe, d); - $jb(Cre, PLe, yte(d)); - d = new xte(4); - ose(d, "-.0:AZ__az··ÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁːˑ̀͠͡ͅΆΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁ҃҆ҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆֹֻֽֿֿׁׂ֑֣֡ׄׄאתװײءغـْ٠٩ٰڷںھۀێېۓە۪ۭۨ۰۹ँःअह़्॑॔क़ॣ०९ঁঃঅঌএঐওনপরললশহ়়াৄেৈো্ৗৗড়ঢ়য়ৣ০ৱਂਂਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹ਼਼ਾੂੇੈੋ੍ਖ਼ੜਫ਼ਫ਼੦ੴઁઃઅઋઍઍએઑઓનપરલળવહ઼ૅેૉો્ૠૠ૦૯ଁଃଅଌଏଐଓନପରଲଳଶହ଼ୃେୈୋ୍ୖୗଡ଼ଢ଼ୟୡ୦୯ஂஃஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹாூெைொ்ௗௗ௧௯ఁఃఅఌఎఐఒనపళవహాౄెైొ్ౕౖౠౡ౦౯ಂಃಅಌಎಐಒನಪಳವಹಾೄೆೈೊ್ೕೖೞೞೠೡ೦೯ംഃഅഌഎഐഒനപഹാൃെൈൊ്ൗൗൠൡ൦൯กฮะฺเ๎๐๙ກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະູົຽເໄໆໆ່ໍ໐໙༘༙༠༩༹༹༵༵༷༷༾ཇཉཀྵ྄ཱ྆ྋྐྕྗྗྙྭྱྷྐྵྐྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼ⃐⃜⃡⃡ΩΩKÅ℮℮ↀↂ々々〇〇〡〯〱〵ぁゔ゙゚ゝゞァヺーヾㄅㄬ一龥가힣"); - $jb(Bre, RLe, d); - $jb(Cre, RLe, yte(d)); - d = new xte(4); - ose(d, ULe); - rte(d, 95, 95); - rte(d, 58, 58); - $jb(Bre, SLe, d); - $jb(Cre, SLe, yte(d)); - } - c2 = b ? RD(Xjb(Bre, a), 138) : RD(Xjb(Cre, a), 138); - return c2; - } - function zCc(a) { - Cgd(a, new Pfd(_fd(Wfd($fd(Xfd(Zfd(Yfd(new agd(), sxe), "ELK Layered"), "Layer-based algorithm provided by the Eclipse Layout Kernel. Arranges as many edges as possible into one direction by placing nodes into subsequent layers. This implementation supports different routing styles (straight, orthogonal, splines); if orthogonal routing is selected, arbitrary port constraints are respected, thus enabling the layout of block diagrams such as actor-oriented models or circuit schematics. Furthermore, full layout of compound graphs with cross-hierarchy edges is supported when the respective option is activated on the top level."), new CCc()), sxe), ysb((aGd(), _Fd), cD(WC(T5, 1), jwe, 245, 0, [YFd, ZFd, XFd, $Fd, VFd, UFd]))))); - Agd(a, sxe, xDe, iGd(QBc)); - Agd(a, sxe, yDe, iGd(RBc)); - Agd(a, sxe, Bze, iGd(SBc)); - Agd(a, sxe, zDe, iGd(TBc)); - Agd(a, sxe, aAe, iGd(VBc)); - Agd(a, sxe, ADe, iGd(WBc)); - Agd(a, sxe, BDe, iGd(ZBc)); - Agd(a, sxe, CDe, iGd(_Bc)); - Agd(a, sxe, DDe, iGd(aCc)); - Agd(a, sxe, EDe, iGd($Bc)); - Agd(a, sxe, _ze, iGd(bCc)); - Agd(a, sxe, FDe, iGd(dCc)); - Agd(a, sxe, GDe, iGd(fCc)); - Agd(a, sxe, HDe, iGd(YBc)); - Agd(a, sxe, wCe, iGd(PBc)); - Agd(a, sxe, yCe, iGd(UBc)); - Agd(a, sxe, xCe, iGd(XBc)); - Agd(a, sxe, zCe, iGd(cCc)); - Agd(a, sxe, $ze, sgb(0)); - Agd(a, sxe, ACe, iGd(KBc)); - Agd(a, sxe, BCe, iGd(LBc)); - Agd(a, sxe, CCe, iGd(MBc)); - Agd(a, sxe, JCe, iGd(vCc)); - Agd(a, sxe, KCe, iGd(nCc)); - Agd(a, sxe, LCe, iGd(oCc)); - Agd(a, sxe, MCe, iGd(rCc)); - Agd(a, sxe, NCe, iGd(pCc)); - Agd(a, sxe, OCe, iGd(qCc)); - Agd(a, sxe, PCe, iGd(xCc)); - Agd(a, sxe, QCe, iGd(wCc)); - Agd(a, sxe, RCe, iGd(tCc)); - Agd(a, sxe, SCe, iGd(sCc)); - Agd(a, sxe, TCe, iGd(uCc)); - Agd(a, sxe, pCe, iGd(iBc)); - Agd(a, sxe, qCe, iGd(jBc)); - Agd(a, sxe, tCe, iGd(DAc)); - Agd(a, sxe, uCe, iGd(EAc)); - Agd(a, sxe, mAe, iGd(jCc)); - Agd(a, sxe, nAe, iGd(lCc)); - Agd(a, sxe, oAe, iGd(iCc)); - Agd(a, sxe, pAe, iGd(hCc)); - Agd(a, sxe, qAe, kCc); - Agd(a, sxe, Eze, rBc); - Agd(a, sxe, kDe, zAc); - Agd(a, sxe, IDe, 0); - Agd(a, sxe, bAe, sgb(1)); - Agd(a, sxe, Dze, Yze); - Agd(a, sxe, JDe, iGd(pBc)); - Agd(a, sxe, eAe, iGd(BBc)); - Agd(a, sxe, KDe, iGd(GBc)); - Agd(a, sxe, LDe, iGd(qAc)); - Agd(a, sxe, MDe, iGd(Rzc)); - Agd(a, sxe, fDe, iGd(IAc)); - Agd(a, sxe, cAe, (Geb(), true)); - Agd(a, sxe, NDe, iGd(NAc)); - Agd(a, sxe, ODe, iGd(OAc)); - Agd(a, sxe, jAe, iGd(lBc)); - Agd(a, sxe, iAe, iGd(oBc)); - Agd(a, sxe, hAe, iGd(mBc)); - Agd(a, sxe, PDe, tAc); - Agd(a, sxe, kAe, iGd(dBc)); - Agd(a, sxe, QDe, iGd(cBc)); - Agd(a, sxe, lAe, iGd(EBc)); - Agd(a, sxe, RDe, iGd(DBc)); - Agd(a, sxe, SDe, iGd(FBc)); - Agd(a, sxe, TDe, uBc); - Agd(a, sxe, UDe, iGd(wBc)); - Agd(a, sxe, VDe, iGd(xBc)); - Agd(a, sxe, WDe, iGd(yBc)); - Agd(a, sxe, XDe, iGd(vBc)); - Agd(a, sxe, PBe, iGd(mCc)); - Agd(a, sxe, SBe, iGd($Ac)); - Agd(a, sxe, YBe, iGd(ZAc)); - Agd(a, sxe, OBe, iGd(gCc)); - Agd(a, sxe, TBe, iGd(UAc)); - Agd(a, sxe, RBe, iGd(pAc)); - Agd(a, sxe, _Be, iGd(oAc)); - Agd(a, sxe, aCe, iGd(eAc)); - Agd(a, sxe, hCe, iGd(fAc)); - Agd(a, sxe, iCe, iGd(hAc)); - Agd(a, sxe, jCe, iGd(gAc)); - Agd(a, sxe, cCe, iGd(nAc)); - Agd(a, sxe, KBe, iGd(aBc)); - Agd(a, sxe, LBe, iGd(bBc)); - Agd(a, sxe, JBe, iGd(QAc)); - Agd(a, sxe, kCe, iGd(kBc)); - Agd(a, sxe, nCe, iGd(fBc)); - Agd(a, sxe, IBe, iGd(GAc)); - Agd(a, sxe, oCe, iGd(hBc)); - Agd(a, sxe, rCe, iGd(BAc)); - Agd(a, sxe, sCe, iGd(CAc)); - Agd(a, sxe, YDe, iGd(dAc)); - Agd(a, sxe, mCe, iGd(eBc)); - Agd(a, sxe, ECe, iGd(Xzc)); - Agd(a, sxe, FCe, iGd(Wzc)); - Agd(a, sxe, DCe, iGd(Vzc)); - Agd(a, sxe, GCe, iGd(KAc)); - Agd(a, sxe, HCe, iGd(JAc)); - Agd(a, sxe, ICe, iGd(LAc)); - Agd(a, sxe, CAe, iGd(nBc)); - Agd(a, sxe, ZDe, iGd(RAc)); - Agd(a, sxe, Cze, iGd(FAc)); - Agd(a, sxe, $De, iGd(wAc)); - Agd(a, sxe, fAe, iGd(vAc)); - Agd(a, sxe, bCe, iGd(iAc)); - Agd(a, sxe, _De, iGd(CBc)); - Agd(a, sxe, aEe, iGd(Uzc)); - Agd(a, sxe, bEe, iGd(MAc)); - Agd(a, sxe, cEe, iGd(zBc)); - Agd(a, sxe, dEe, iGd(sBc)); - Agd(a, sxe, eEe, iGd(tBc)); - Agd(a, sxe, WBe, iGd(WAc)); - Agd(a, sxe, XBe, iGd(XAc)); - Agd(a, sxe, fEe, iGd(IBc)); - Agd(a, sxe, MBe, iGd(Szc)); - Agd(a, sxe, ZBe, iGd(YAc)); - Agd(a, sxe, UCe, iGd(xAc)); - Agd(a, sxe, VCe, iGd(uAc)); - Agd(a, sxe, gEe, iGd(_Ac)); - Agd(a, sxe, $Be, iGd(SAc)); - Agd(a, sxe, lCe, iGd(gBc)); - Agd(a, sxe, hEe, iGd(eCc)); - Agd(a, sxe, HBe, iGd(sAc)); - Agd(a, sxe, NBe, iGd(HBc)); - Agd(a, sxe, vCe, iGd(AAc)); - Agd(a, sxe, dCe, iGd(jAc)); - Agd(a, sxe, eCe, iGd(kAc)); - Agd(a, sxe, UBe, iGd(TAc)); - Agd(a, sxe, fCe, iGd(lAc)); - Agd(a, sxe, iEe, iGd(PAc)); - Agd(a, sxe, VBe, iGd(VAc)); - Agd(a, sxe, gCe, iGd(mAc)); - Agd(a, sxe, WCe, iGd(cAc)); - Agd(a, sxe, $Ce, iGd(_zc)); - Agd(a, sxe, _Ce, iGd(Zzc)); - Agd(a, sxe, aDe, iGd($zc)); - Agd(a, sxe, YCe, iGd(aAc)); - Agd(a, sxe, ZCe, iGd(Yzc)); - Agd(a, sxe, XCe, iGd(bAc)); - Agd(a, sxe, QBe, iGd(HAc)); - } - function yne(a) { - _Ad(a.a, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "anySimpleType"])); - _Ad(a.b, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "anyType", rKe, pKe])); - _Ad(RD(QHd(xYd(a.b), 0), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, YKe, GIe, ":mixed"])); - _Ad(RD(QHd(xYd(a.b), 1), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, YKe, cLe, eLe, GIe, ":1", nLe, "lax"])); - _Ad(RD(QHd(xYd(a.b), 2), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, WKe, cLe, eLe, GIe, ":2", nLe, "lax"])); - _Ad(a.c, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "anyURI", bLe, ZKe])); - _Ad(a.d, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "base64Binary", bLe, ZKe])); - _Ad(a.e, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, hve, bLe, ZKe])); - _Ad(a.f, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "boolean:Object", DKe, hve])); - _Ad(a.g, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, dKe])); - _Ad(a.i, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "byte:Object", DKe, dKe])); - _Ad(a.j, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "date", bLe, ZKe])); - _Ad(a.k, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "dateTime", bLe, ZKe])); - _Ad(a.n, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "decimal", bLe, ZKe])); - _Ad(a.o, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, fKe, bLe, ZKe])); - _Ad(a.p, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "double:Object", DKe, fKe])); - _Ad(a.q, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "duration", bLe, ZKe])); - _Ad(a.s, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "ENTITIES", DKe, oLe, pLe, "1"])); - _Ad(a.r, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, oLe, $Ke, qLe])); - _Ad(a.t, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, qLe, DKe, rLe])); - _Ad(a.u, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, gKe, bLe, ZKe])); - _Ad(a.v, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "float:Object", DKe, gKe])); - _Ad(a.w, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "gDay", bLe, ZKe])); - _Ad(a.B, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "gMonth", bLe, ZKe])); - _Ad(a.A, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "gMonthDay", bLe, ZKe])); - _Ad(a.C, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "gYear", bLe, ZKe])); - _Ad(a.D, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "gYearMonth", bLe, ZKe])); - _Ad(a.F, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "hexBinary", bLe, ZKe])); - _Ad(a.G, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "ID", DKe, rLe])); - _Ad(a.H, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "IDREF", DKe, rLe])); - _Ad(a.J, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "IDREFS", DKe, sLe, pLe, "1"])); - _Ad(a.I, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, sLe, $Ke, "IDREF"])); - _Ad(a.K, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, hKe])); - _Ad(a.M, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, tLe])); - _Ad(a.L, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "int:Object", DKe, hKe])); - _Ad(a.P, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "language", DKe, uLe, vLe, wLe])); - _Ad(a.Q, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, iKe])); - _Ad(a.R, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "long:Object", DKe, iKe])); - _Ad(a.S, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "Name", DKe, uLe, vLe, xLe])); - _Ad(a.T, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, rLe, DKe, "Name", vLe, yLe])); - _Ad(a.U, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "negativeInteger", DKe, zLe, ALe, "-1"])); - _Ad(a.V, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, BLe, DKe, uLe, vLe, "\\c+"])); - _Ad(a.X, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "NMTOKENS", DKe, CLe, pLe, "1"])); - _Ad(a.W, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, CLe, $Ke, BLe])); - _Ad(a.Y, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, DLe, DKe, tLe, ELe, "0"])); - _Ad(a.Z, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, zLe, DKe, tLe, ALe, "0"])); - _Ad(a.$, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, FLe, DKe, jve, bLe, "replace"])); - _Ad(a._, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "NOTATION", bLe, ZKe])); - _Ad(a.ab, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "positiveInteger", DKe, DLe, ELe, "1"])); - _Ad(a.bb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "processingInstruction_._type", rKe, "empty"])); - _Ad(RD(QHd(xYd(a.bb), 0), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, VKe, GIe, "data"])); - _Ad(RD(QHd(xYd(a.bb), 1), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, VKe, GIe, CIe])); - _Ad(a.cb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "QName", bLe, ZKe])); - _Ad(a.db, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, jKe])); - _Ad(a.eb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "short:Object", DKe, jKe])); - _Ad(a.fb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "simpleAnyType", rKe, UKe])); - _Ad(RD(QHd(xYd(a.fb), 0), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, ":3", rKe, UKe])); - _Ad(RD(QHd(xYd(a.fb), 1), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, ":4", rKe, UKe])); - _Ad(RD(QHd(xYd(a.fb), 2), 19), qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, ":5", rKe, UKe])); - _Ad(a.gb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, jve, bLe, "preserve"])); - _Ad(a.hb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "time", bLe, ZKe])); - _Ad(a.ib, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, uLe, DKe, FLe, bLe, ZKe])); - _Ad(a.jb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, GLe, ALe, "255", ELe, "0"])); - _Ad(a.kb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "unsignedByte:Object", DKe, GLe])); - _Ad(a.lb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, HLe, ALe, "4294967295", ELe, "0"])); - _Ad(a.mb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "unsignedInt:Object", DKe, HLe])); - _Ad(a.nb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "unsignedLong", DKe, DLe, ALe, ILe, ELe, "0"])); - _Ad(a.ob, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, JLe, ALe, "65535", ELe, "0"])); - _Ad(a.pb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "unsignedShort:Object", DKe, JLe])); - _Ad(a.qb, qKe, cD(WC(qJ, 1), Nve, 2, 6, [GIe, "", rKe, pKe])); - _Ad(RD(QHd(xYd(a.qb), 0), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, YKe, GIe, ":mixed"])); - _Ad(RD(QHd(xYd(a.qb), 1), 19), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, VKe, GIe, "xmlns:prefix"])); - _Ad(RD(QHd(xYd(a.qb), 2), 19), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, VKe, GIe, "xsi:schemaLocation"])); - _Ad(RD(QHd(xYd(a.qb), 3), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, XKe, GIe, "cDATA", _Ke, aLe])); - _Ad(RD(QHd(xYd(a.qb), 4), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, XKe, GIe, "comment", _Ke, aLe])); - _Ad(RD(QHd(xYd(a.qb), 5), 19), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, XKe, GIe, KLe, _Ke, aLe])); - _Ad(RD(QHd(xYd(a.qb), 6), 35), qKe, cD(WC(qJ, 1), Nve, 2, 6, [rKe, XKe, GIe, hIe, _Ke, aLe])); - } - function TId(a) { - return lhb("_UI_EMFDiagnostic_marker", a) ? "EMF Problem" : lhb("_UI_CircularContainment_diagnostic", a) ? "An object may not circularly contain itself" : lhb(TIe, a) ? "Wrong character." : lhb(UIe, a) ? "Invalid reference number." : lhb(VIe, a) ? "A character is required after \\." : lhb(WIe, a) ? "'?' is not expected. '(?:' or '(?=' or '(?!' or '(?<' or '(?#' or '(?>'?" : lhb(XIe, a) ? "'(?<' or '(? toIndex: ", bye = ", toIndex: ", cye = "Index: ", dye = ", Size: ", eye = "org.eclipse.elk.alg.common", fye = { 50: 1 }, gye = "org.eclipse.elk.alg.common.compaction", hye = "Scanline/EventHandler", iye = "org.eclipse.elk.alg.common.compaction.oned", jye = "CNode belongs to another CGroup.", kye = "ISpacingsHandler/1", lye = "The ", mye = " instance has been finished already.", nye = "The direction ", oye = " is not supported by the CGraph instance.", pye = "OneDimensionalCompactor", qye = "OneDimensionalCompactor/lambda$0$Type", rye = "Quadruplet", sye = "ScanlineConstraintCalculator", tye = "ScanlineConstraintCalculator/ConstraintsScanlineHandler", uye = "ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type", vye = "ScanlineConstraintCalculator/Timestamp", wye = "ScanlineConstraintCalculator/lambda$0$Type", xye = { 178: 1, 46: 1 }, yye = "org.eclipse.elk.alg.common.compaction.options", zye = "org.eclipse.elk.core.data", Aye = "org.eclipse.elk.polyomino.traversalStrategy", Bye = "org.eclipse.elk.polyomino.lowLevelSort", Cye = "org.eclipse.elk.polyomino.highLevelSort", Dye = "org.eclipse.elk.polyomino.fill", Eye = { 134: 1 }, Fye = "polyomino", Gye = "org.eclipse.elk.alg.common.networksimplex", Hye = { 183: 1, 3: 1, 4: 1 }, Iye = "org.eclipse.elk.alg.common.nodespacing", Jye = "org.eclipse.elk.alg.common.nodespacing.cellsystem", Kye = "CENTER", Lye = { 217: 1, 336: 1 }, Mye = { 3: 1, 4: 1, 5: 1, 603: 1 }, Nye = "LEFT", Oye = "RIGHT", Pye = "Vertical alignment cannot be null", Qye = "BOTTOM", Rye = "org.eclipse.elk.alg.common.nodespacing.internal", Sye = "UNDEFINED", Tye = 0.01, Uye = "org.eclipse.elk.alg.common.nodespacing.internal.algorithm", Vye = "LabelPlacer/lambda$0$Type", Wye = "LabelPlacer/lambda$1$Type", Xye = "portRatioOrPosition", Yye = "org.eclipse.elk.alg.common.overlaps", Zye = "DOWN", $ye = "org.eclipse.elk.alg.common.polyomino", _ye = "NORTH", aze = "EAST", bze = "SOUTH", cze = "WEST", dze = "org.eclipse.elk.alg.common.polyomino.structures", eze = "Direction", fze = "Grid is only of size ", gze = ". Requested point (", hze = ") is out of bounds.", ize = " Given center based coordinates were (", jze = "org.eclipse.elk.graph.properties", kze = "IPropertyHolder", lze = { 3: 1, 96: 1, 137: 1 }, mze = "org.eclipse.elk.alg.common.spore", nze = "org.eclipse.elk.alg.common.utils", oze = { 205: 1 }, pze = "org.eclipse.elk.core", qze = "Connected Components Compaction", rze = "org.eclipse.elk.alg.disco", sze = "org.eclipse.elk.alg.disco.graph", tze = "org.eclipse.elk.alg.disco.options", uze = "CompactionStrategy", vze = "org.eclipse.elk.disco.componentCompaction.strategy", wze = "org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm", xze = "org.eclipse.elk.disco.debug.discoGraph", yze = "org.eclipse.elk.disco.debug.discoPolys", zze = "componentCompaction", Aze = "org.eclipse.elk.disco", Bze = "org.eclipse.elk.spacing.componentComponent", Cze = "org.eclipse.elk.edge.thickness", Dze = "org.eclipse.elk.aspectRatio", Eze = "org.eclipse.elk.padding", Fze = "org.eclipse.elk.alg.disco.transform", Gze = 1.5707963267948966, Hze = 17976931348623157e292, Ize = { 3: 1, 4: 1, 5: 1, 198: 1 }, Jze = { 3: 1, 6: 1, 4: 1, 5: 1, 100: 1, 115: 1 }, Kze = "org.eclipse.elk.alg.force", Lze = "ComponentsProcessor", Mze = "ComponentsProcessor/1", Nze = "ElkGraphImporter/lambda$0$Type", Oze = "org.eclipse.elk.alg.force.graph", Pze = "Component Layout", Qze = "org.eclipse.elk.alg.force.model", Rze = "org.eclipse.elk.force.model", Sze = "org.eclipse.elk.force.iterations", Tze = "org.eclipse.elk.force.repulsivePower", Uze = "org.eclipse.elk.force.temperature", Vze = 1e-3, Wze = "org.eclipse.elk.force.repulsion", Xze = "org.eclipse.elk.alg.force.options", Yze = 1.600000023841858, Zze = "org.eclipse.elk.force", $ze = "org.eclipse.elk.priority", _ze = "org.eclipse.elk.spacing.nodeNode", aAe = "org.eclipse.elk.spacing.edgeLabel", bAe = "org.eclipse.elk.randomSeed", cAe = "org.eclipse.elk.separateConnectedComponents", dAe = "org.eclipse.elk.interactive", eAe = "org.eclipse.elk.portConstraints", fAe = "org.eclipse.elk.edgeLabels.inline", gAe = "org.eclipse.elk.omitNodeMicroLayout", hAe = "org.eclipse.elk.nodeSize.fixedGraphSize", iAe = "org.eclipse.elk.nodeSize.options", jAe = "org.eclipse.elk.nodeSize.constraints", kAe = "org.eclipse.elk.nodeLabels.placement", lAe = "org.eclipse.elk.portLabels.placement", mAe = "org.eclipse.elk.topdownLayout", nAe = "org.eclipse.elk.topdown.scaleFactor", oAe = "org.eclipse.elk.topdown.hierarchicalNodeWidth", pAe = "org.eclipse.elk.topdown.hierarchicalNodeAspectRatio", qAe = "org.eclipse.elk.topdown.nodeType", rAe = "origin", sAe = "random", tAe = "boundingBox.upLeft", uAe = "boundingBox.lowRight", vAe = "org.eclipse.elk.stress.fixed", wAe = "org.eclipse.elk.stress.desiredEdgeLength", xAe = "org.eclipse.elk.stress.dimension", yAe = "org.eclipse.elk.stress.epsilon", zAe = "org.eclipse.elk.stress.iterationLimit", AAe = "org.eclipse.elk.stress", BAe = "ELK Stress", CAe = "org.eclipse.elk.nodeSize.minimum", DAe = "org.eclipse.elk.alg.force.stress", EAe = "Layered layout", FAe = "org.eclipse.elk.alg.layered", GAe = "org.eclipse.elk.alg.layered.compaction.components", HAe = "org.eclipse.elk.alg.layered.compaction.oned", IAe = "org.eclipse.elk.alg.layered.compaction.oned.algs", JAe = "org.eclipse.elk.alg.layered.compaction.recthull", KAe = "org.eclipse.elk.alg.layered.components", LAe = "NONE", MAe = "MODEL_ORDER", NAe = { 3: 1, 6: 1, 4: 1, 9: 1, 5: 1, 126: 1 }, OAe = { 3: 1, 6: 1, 4: 1, 5: 1, 150: 1, 100: 1, 115: 1 }, PAe = "org.eclipse.elk.alg.layered.compound", QAe = { 47: 1 }, RAe = "org.eclipse.elk.alg.layered.graph", SAe = " -> ", TAe = "Not supported by LGraph", UAe = "Port side is undefined", VAe = { 3: 1, 6: 1, 4: 1, 5: 1, 483: 1, 150: 1, 100: 1, 115: 1 }, WAe = { 3: 1, 6: 1, 4: 1, 5: 1, 150: 1, 199: 1, 210: 1, 100: 1, 115: 1 }, XAe = { 3: 1, 6: 1, 4: 1, 5: 1, 150: 1, 2042: 1, 210: 1, 100: 1, 115: 1 }, YAe = `([{"' \r -`, ZAe = `)]}"' \r -`, $Ae = "The given string contains parts that cannot be parsed as numbers.", _Ae = "org.eclipse.elk.core.math", aBe = { 3: 1, 4: 1, 140: 1, 214: 1, 423: 1 }, bBe = { 3: 1, 4: 1, 107: 1, 214: 1, 423: 1 }, cBe = "org.eclipse.elk.alg.layered.graph.transform", dBe = "ElkGraphImporter", eBe = "ElkGraphImporter/lambda$1$Type", fBe = "ElkGraphImporter/lambda$2$Type", gBe = "ElkGraphImporter/lambda$4$Type", hBe = "org.eclipse.elk.alg.layered.intermediate", iBe = "Node margin calculation", jBe = "ONE_SIDED_GREEDY_SWITCH", kBe = "TWO_SIDED_GREEDY_SWITCH", lBe = "No implementation is available for the layout processor ", mBe = "IntermediateProcessorStrategy", nBe = "Node '", oBe = "FIRST_SEPARATE", pBe = "LAST_SEPARATE", qBe = "Odd port side processing", rBe = "org.eclipse.elk.alg.layered.intermediate.compaction", sBe = "org.eclipse.elk.alg.layered.intermediate.greedyswitch", tBe = "org.eclipse.elk.alg.layered.p3order.counting", uBe = { 230: 1 }, vBe = "org.eclipse.elk.alg.layered.intermediate.loops", wBe = "org.eclipse.elk.alg.layered.intermediate.loops.ordering", xBe = "org.eclipse.elk.alg.layered.intermediate.loops.routing", yBe = "org.eclipse.elk.alg.layered.intermediate.preserveorder", zBe = "org.eclipse.elk.alg.layered.intermediate.wrapping", ABe = "org.eclipse.elk.alg.layered.options", BBe = "INTERACTIVE", CBe = "GREEDY", DBe = "DEPTH_FIRST", EBe = "EDGE_LENGTH", FBe = "SELF_LOOPS", GBe = "firstTryWithInitialOrder", HBe = "org.eclipse.elk.layered.directionCongruency", IBe = "org.eclipse.elk.layered.feedbackEdges", JBe = "org.eclipse.elk.layered.interactiveReferencePoint", KBe = "org.eclipse.elk.layered.mergeEdges", LBe = "org.eclipse.elk.layered.mergeHierarchyEdges", MBe = "org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides", NBe = "org.eclipse.elk.layered.portSortingStrategy", OBe = "org.eclipse.elk.layered.thoroughness", PBe = "org.eclipse.elk.layered.unnecessaryBendpoints", QBe = "org.eclipse.elk.layered.generatePositionAndLayerIds", RBe = "org.eclipse.elk.layered.cycleBreaking.strategy", SBe = "org.eclipse.elk.layered.layering.strategy", TBe = "org.eclipse.elk.layered.layering.layerConstraint", UBe = "org.eclipse.elk.layered.layering.layerChoiceConstraint", VBe = "org.eclipse.elk.layered.layering.layerId", WBe = "org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth", XBe = "org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor", YBe = "org.eclipse.elk.layered.layering.nodePromotion.strategy", ZBe = "org.eclipse.elk.layered.layering.nodePromotion.maxIterations", $Be = "org.eclipse.elk.layered.layering.coffmanGraham.layerBound", _Be = "org.eclipse.elk.layered.crossingMinimization.strategy", aCe = "org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder", bCe = "org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness", cCe = "org.eclipse.elk.layered.crossingMinimization.semiInteractive", dCe = "org.eclipse.elk.layered.crossingMinimization.inLayerPredOf", eCe = "org.eclipse.elk.layered.crossingMinimization.inLayerSuccOf", fCe = "org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint", gCe = "org.eclipse.elk.layered.crossingMinimization.positionId", hCe = "org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold", iCe = "org.eclipse.elk.layered.crossingMinimization.greedySwitch.type", jCe = "org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type", kCe = "org.eclipse.elk.layered.nodePlacement.strategy", lCe = "org.eclipse.elk.layered.nodePlacement.favorStraightEdges", mCe = "org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening", nCe = "org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment", oCe = "org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening", pCe = "org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility", qCe = "org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default", rCe = "org.eclipse.elk.layered.edgeRouting.selfLoopDistribution", sCe = "org.eclipse.elk.layered.edgeRouting.selfLoopOrdering", tCe = "org.eclipse.elk.layered.edgeRouting.splines.mode", uCe = "org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor", vCe = "org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth", wCe = "org.eclipse.elk.layered.spacing.baseValue", xCe = "org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers", yCe = "org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers", zCe = "org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers", ACe = "org.eclipse.elk.layered.priority.direction", BCe = "org.eclipse.elk.layered.priority.shortness", CCe = "org.eclipse.elk.layered.priority.straightness", DCe = "org.eclipse.elk.layered.compaction.connectedComponents", ECe = "org.eclipse.elk.layered.compaction.postCompaction.strategy", FCe = "org.eclipse.elk.layered.compaction.postCompaction.constraints", GCe = "org.eclipse.elk.layered.highDegreeNodes.treatment", HCe = "org.eclipse.elk.layered.highDegreeNodes.threshold", ICe = "org.eclipse.elk.layered.highDegreeNodes.treeHeight", JCe = "org.eclipse.elk.layered.wrapping.strategy", KCe = "org.eclipse.elk.layered.wrapping.additionalEdgeSpacing", LCe = "org.eclipse.elk.layered.wrapping.correctionFactor", MCe = "org.eclipse.elk.layered.wrapping.cutting.strategy", NCe = "org.eclipse.elk.layered.wrapping.cutting.cuts", OCe = "org.eclipse.elk.layered.wrapping.cutting.msd.freedom", PCe = "org.eclipse.elk.layered.wrapping.validify.strategy", QCe = "org.eclipse.elk.layered.wrapping.validify.forbiddenIndices", RCe = "org.eclipse.elk.layered.wrapping.multiEdge.improveCuts", SCe = "org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty", TCe = "org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges", UCe = "org.eclipse.elk.layered.edgeLabels.sideSelection", VCe = "org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy", WCe = "org.eclipse.elk.layered.considerModelOrder.strategy", XCe = "org.eclipse.elk.layered.considerModelOrder.portModelOrder", YCe = "org.eclipse.elk.layered.considerModelOrder.noModelOrder", ZCe = "org.eclipse.elk.layered.considerModelOrder.components", $Ce = "org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy", _Ce = "org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence", aDe = "org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence", bDe = "layering", cDe = "layering.minWidth", dDe = "layering.nodePromotion", eDe = "crossingMinimization", fDe = "org.eclipse.elk.hierarchyHandling", gDe = "crossingMinimization.greedySwitch", hDe = "nodePlacement", iDe = "nodePlacement.bk", jDe = "edgeRouting", kDe = "org.eclipse.elk.edgeRouting", lDe = "spacing", mDe = "priority", nDe = "compaction", oDe = "compaction.postCompaction", pDe = "Specifies whether and how post-process compaction is applied.", qDe = "highDegreeNodes", rDe = "wrapping", sDe = "wrapping.cutting", tDe = "wrapping.validify", uDe = "wrapping.multiEdge", vDe = "edgeLabels", wDe = "considerModelOrder", xDe = "org.eclipse.elk.spacing.commentComment", yDe = "org.eclipse.elk.spacing.commentNode", zDe = "org.eclipse.elk.spacing.edgeEdge", ADe = "org.eclipse.elk.spacing.edgeNode", BDe = "org.eclipse.elk.spacing.labelLabel", CDe = "org.eclipse.elk.spacing.labelPortHorizontal", DDe = "org.eclipse.elk.spacing.labelPortVertical", EDe = "org.eclipse.elk.spacing.labelNode", FDe = "org.eclipse.elk.spacing.nodeSelfLoop", GDe = "org.eclipse.elk.spacing.portPort", HDe = "org.eclipse.elk.spacing.individual", IDe = "org.eclipse.elk.port.borderOffset", JDe = "org.eclipse.elk.noLayout", KDe = "org.eclipse.elk.port.side", LDe = "org.eclipse.elk.debugMode", MDe = "org.eclipse.elk.alignment", NDe = "org.eclipse.elk.insideSelfLoops.activate", ODe = "org.eclipse.elk.insideSelfLoops.yo", PDe = "org.eclipse.elk.direction", QDe = "org.eclipse.elk.nodeLabels.padding", RDe = "org.eclipse.elk.portLabels.nextToPortIfPossible", SDe = "org.eclipse.elk.portLabels.treatAsGroup", TDe = "org.eclipse.elk.portAlignment.default", UDe = "org.eclipse.elk.portAlignment.north", VDe = "org.eclipse.elk.portAlignment.south", WDe = "org.eclipse.elk.portAlignment.west", XDe = "org.eclipse.elk.portAlignment.east", YDe = "org.eclipse.elk.contentAlignment", ZDe = "org.eclipse.elk.junctionPoints", $De = "org.eclipse.elk.edgeLabels.placement", _De = "org.eclipse.elk.port.index", aEe = "org.eclipse.elk.commentBox", bEe = "org.eclipse.elk.hypernode", cEe = "org.eclipse.elk.port.anchor", dEe = "org.eclipse.elk.partitioning.activate", eEe = "org.eclipse.elk.partitioning.partition", fEe = "org.eclipse.elk.position", gEe = "org.eclipse.elk.margins", hEe = "org.eclipse.elk.spacing.portsSurrounding", iEe = "org.eclipse.elk.interactiveLayout", jEe = "org.eclipse.elk.core.util", kEe = { 3: 1, 4: 1, 5: 1, 601: 1 }, lEe = "NETWORK_SIMPLEX", mEe = "SIMPLE", nEe = { 106: 1, 47: 1 }, oEe = "org.eclipse.elk.alg.layered.p1cycles", pEe = "org.eclipse.elk.alg.layered.p2layers", qEe = { 413: 1, 230: 1 }, rEe = { 846: 1, 3: 1, 4: 1 }, sEe = "org.eclipse.elk.alg.layered.p3order", tEe = "org.eclipse.elk.alg.layered.p4nodes", uEe = { 3: 1, 4: 1, 5: 1, 854: 1 }, vEe = 1e-5, wEe = "org.eclipse.elk.alg.layered.p4nodes.bk", xEe = "org.eclipse.elk.alg.layered.p5edges", yEe = "org.eclipse.elk.alg.layered.p5edges.orthogonal", zEe = "org.eclipse.elk.alg.layered.p5edges.orthogonal.direction", AEe = 1e-6, BEe = "org.eclipse.elk.alg.layered.p5edges.splines", CEe = 0.09999999999999998, DEe = 1e-8, EEe = 4.71238898038469, FEe = 3.141592653589793, GEe = "org.eclipse.elk.alg.mrtree", HEe = 0.10000000149011612, IEe = "SUPER_ROOT", JEe = "org.eclipse.elk.alg.mrtree.graph", KEe = -17976931348623157e292, LEe = "org.eclipse.elk.alg.mrtree.intermediate", MEe = "Processor compute fanout", NEe = { 3: 1, 6: 1, 4: 1, 5: 1, 534: 1, 100: 1, 115: 1 }, OEe = "Set neighbors in level", PEe = "org.eclipse.elk.alg.mrtree.options", QEe = "DESCENDANTS", REe = "org.eclipse.elk.mrtree.compaction", SEe = "org.eclipse.elk.mrtree.edgeEndTextureLength", TEe = "org.eclipse.elk.mrtree.treeLevel", UEe = "org.eclipse.elk.mrtree.positionConstraint", VEe = "org.eclipse.elk.mrtree.weighting", WEe = "org.eclipse.elk.mrtree.edgeRoutingMode", XEe = "org.eclipse.elk.mrtree.searchOrder", YEe = "Position Constraint", ZEe = "org.eclipse.elk.mrtree", $Ee = "org.eclipse.elk.tree", _Ee = "Processor arrange level", aFe = "org.eclipse.elk.alg.mrtree.p2order", bFe = "org.eclipse.elk.alg.mrtree.p4route", cFe = "org.eclipse.elk.alg.radial", dFe = 6.283185307179586, eFe = "Before", fFe = 5e-324, gFe = "After", hFe = "org.eclipse.elk.alg.radial.intermediate", iFe = "COMPACTION", jFe = "org.eclipse.elk.alg.radial.intermediate.compaction", kFe = { 3: 1, 4: 1, 5: 1, 100: 1 }, lFe = "org.eclipse.elk.alg.radial.intermediate.optimization", mFe = "No implementation is available for the layout option ", nFe = "org.eclipse.elk.alg.radial.options", oFe = "org.eclipse.elk.radial.centerOnRoot", pFe = "org.eclipse.elk.radial.orderId", qFe = "org.eclipse.elk.radial.radius", rFe = "org.eclipse.elk.radial.rotate", sFe = "org.eclipse.elk.radial.compactor", tFe = "org.eclipse.elk.radial.compactionStepSize", uFe = "org.eclipse.elk.radial.sorter", vFe = "org.eclipse.elk.radial.wedgeCriteria", wFe = "org.eclipse.elk.radial.optimizationCriteria", xFe = "org.eclipse.elk.radial.rotation.targetAngle", yFe = "org.eclipse.elk.radial.rotation.computeAdditionalWedgeSpace", zFe = "org.eclipse.elk.radial.rotation.outgoingEdgeAngles", AFe = "Compaction", BFe = "rotation", CFe = "org.eclipse.elk.radial", DFe = "org.eclipse.elk.alg.radial.p1position.wedge", EFe = "org.eclipse.elk.alg.radial.sorting", FFe = 5.497787143782138, GFe = 3.9269908169872414, HFe = 2.356194490192345, IFe = "org.eclipse.elk.alg.rectpacking", JFe = "org.eclipse.elk.alg.rectpacking.intermediate", KFe = "org.eclipse.elk.alg.rectpacking.options", LFe = "org.eclipse.elk.rectpacking.trybox", MFe = "org.eclipse.elk.rectpacking.currentPosition", NFe = "org.eclipse.elk.rectpacking.desiredPosition", OFe = "org.eclipse.elk.rectpacking.inNewRow", PFe = "org.eclipse.elk.rectpacking.widthApproximation.strategy", QFe = "org.eclipse.elk.rectpacking.widthApproximation.targetWidth", RFe = "org.eclipse.elk.rectpacking.widthApproximation.optimizationGoal", SFe = "org.eclipse.elk.rectpacking.widthApproximation.lastPlaceShift", TFe = "org.eclipse.elk.rectpacking.packing.strategy", UFe = "org.eclipse.elk.rectpacking.packing.compaction.rowHeightReevaluation", VFe = "org.eclipse.elk.rectpacking.packing.compaction.iterations", WFe = "org.eclipse.elk.rectpacking.whiteSpaceElimination.strategy", XFe = "widthApproximation", YFe = "Compaction Strategy", ZFe = "packing.compaction", $Fe = "org.eclipse.elk.rectpacking", _Fe = "org.eclipse.elk.alg.rectpacking.p1widthapproximation", aGe = "org.eclipse.elk.alg.rectpacking.p2packing", bGe = "No Compaction", cGe = "org.eclipse.elk.alg.rectpacking.p3whitespaceelimination", dGe = "org.eclipse.elk.alg.rectpacking.util", eGe = "No implementation available for ", fGe = "org.eclipse.elk.alg.spore", gGe = "org.eclipse.elk.alg.spore.options", hGe = "org.eclipse.elk.sporeCompaction", iGe = "org.eclipse.elk.underlyingLayoutAlgorithm", jGe = "org.eclipse.elk.processingOrder.treeConstruction", kGe = "org.eclipse.elk.processingOrder.spanningTreeCostFunction", lGe = "org.eclipse.elk.processingOrder.preferredRoot", mGe = "org.eclipse.elk.processingOrder.rootSelection", nGe = "org.eclipse.elk.structure.structureExtractionStrategy", oGe = "org.eclipse.elk.compaction.compactionStrategy", pGe = "org.eclipse.elk.compaction.orthogonal", qGe = "org.eclipse.elk.overlapRemoval.maxIterations", rGe = "org.eclipse.elk.overlapRemoval.runScanline", sGe = "processingOrder", tGe = "overlapRemoval", uGe = "org.eclipse.elk.sporeOverlap", vGe = "org.eclipse.elk.alg.spore.p1structure", wGe = "org.eclipse.elk.alg.spore.p2processingorder", xGe = "org.eclipse.elk.alg.spore.p3execution", yGe = "Topdown Layout", zGe = "Invalid index: ", AGe = "org.eclipse.elk.core.alg", BGe = { 341: 1 }, CGe = { 295: 1 }, DGe = "Make sure its type is registered with the ", EGe = " utility class.", FGe = "true", GGe = "false", HGe = "Couldn't clone property '", IGe = 0.05, JGe = "org.eclipse.elk.core.options", KGe = 1.2999999523162842, LGe = "org.eclipse.elk.box", MGe = "org.eclipse.elk.expandNodes", NGe = "org.eclipse.elk.box.packingMode", OGe = "org.eclipse.elk.algorithm", PGe = "org.eclipse.elk.resolvedAlgorithm", QGe = "org.eclipse.elk.bendPoints", RGe = "org.eclipse.elk.labelManager", SGe = "org.eclipse.elk.scaleFactor", TGe = "org.eclipse.elk.childAreaWidth", UGe = "org.eclipse.elk.childAreaHeight", VGe = "org.eclipse.elk.animate", WGe = "org.eclipse.elk.animTimeFactor", XGe = "org.eclipse.elk.layoutAncestors", YGe = "org.eclipse.elk.maxAnimTime", ZGe = "org.eclipse.elk.minAnimTime", $Ge = "org.eclipse.elk.progressBar", _Ge = "org.eclipse.elk.validateGraph", aHe = "org.eclipse.elk.validateOptions", bHe = "org.eclipse.elk.zoomToFit", cHe = "org.eclipse.elk.font.name", dHe = "org.eclipse.elk.font.size", eHe = "org.eclipse.elk.topdown.sizeApproximator", fHe = "org.eclipse.elk.topdown.scaleCap", gHe = "org.eclipse.elk.edge.type", hHe = "partitioning", iHe = "nodeLabels", jHe = "portAlignment", kHe = "nodeSize", lHe = "port", mHe = "portLabels", nHe = "topdown", oHe = "insideSelfLoops", pHe = "org.eclipse.elk.fixed", qHe = "org.eclipse.elk.random", rHe = { 3: 1, 34: 1, 22: 1, 347: 1 }, sHe = "port must have a parent node to calculate the port side", tHe = "The edge needs to have exactly one edge section. Found: ", uHe = "org.eclipse.elk.core.util.adapters", vHe = "org.eclipse.emf.ecore", wHe = "org.eclipse.elk.graph", xHe = "EMapPropertyHolder", yHe = "ElkBendPoint", zHe = "ElkGraphElement", AHe = "ElkConnectableShape", BHe = "ElkEdge", CHe = "ElkEdgeSection", DHe = "EModelElement", EHe = "ENamedElement", FHe = "ElkLabel", GHe = "ElkNode", HHe = "ElkPort", IHe = { 94: 1, 93: 1 }, JHe = "org.eclipse.emf.common.notify.impl", KHe = "The feature '", LHe = "' is not a valid changeable feature", MHe = "Expecting null", NHe = "' is not a valid feature", OHe = "The feature ID", PHe = " is not a valid feature ID", QHe = 32768, RHe = { 110: 1, 94: 1, 93: 1, 58: 1, 54: 1, 99: 1 }, SHe = "org.eclipse.emf.ecore.impl", THe = "org.eclipse.elk.graph.impl", UHe = "Recursive containment not allowed for ", VHe = "The datatype '", WHe = "' is not a valid classifier", XHe = "The value '", YHe = { 195: 1, 3: 1, 4: 1 }, ZHe = "The class '", $He = "http://www.eclipse.org/elk/ElkGraph", _He = "property", aIe = "value", bIe = "source", cIe = "properties", dIe = "identifier", eIe = "height", fIe = "width", gIe = "parent", hIe = "text", iIe = "children", jIe = "hierarchical", kIe = "sources", lIe = "targets", mIe = "sections", nIe = "bendPoints", oIe = "outgoingShape", pIe = "incomingShape", qIe = "outgoingSections", rIe = "incomingSections", sIe = "org.eclipse.emf.common.util", tIe = "Severe implementation error in the Json to ElkGraph importer.", uIe = "id", vIe = "org.eclipse.elk.graph.json", wIe = "Unhandled parameter types: ", xIe = "startPoint", yIe = "An edge must have at least one source and one target (edge id: '", zIe = "').", AIe = "Referenced edge section does not exist: ", BIe = " (edge id: '", CIe = "target", DIe = "sourcePoint", EIe = "targetPoint", FIe = "group", GIe = "name", HIe = "connectableShape cannot be null", IIe = "edge cannot be null", JIe = "Passed edge is not 'simple'.", KIe = "org.eclipse.elk.graph.util", LIe = "The 'no duplicates' constraint is violated", MIe = "targetIndex=", NIe = ", size=", OIe = "sourceIndex=", PIe = { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 59: 1, 70: 1, 66: 1, 61: 1 }, QIe = { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 51: 1, 15: 1, 59: 1, 70: 1, 66: 1, 61: 1, 596: 1 }, RIe = "logging", SIe = "measureExecutionTime", TIe = "parser.parse.1", UIe = "parser.parse.2", VIe = "parser.next.1", WIe = "parser.next.2", XIe = "parser.next.3", YIe = "parser.next.4", ZIe = "parser.factor.1", $Ie = "parser.factor.2", _Ie = "parser.factor.3", aJe = "parser.factor.4", bJe = "parser.factor.5", cJe = "parser.factor.6", dJe = "parser.atom.1", eJe = "parser.atom.2", fJe = "parser.atom.3", gJe = "parser.atom.4", hJe = "parser.atom.5", iJe = "parser.cc.1", jJe = "parser.cc.2", kJe = "parser.cc.3", lJe = "parser.cc.5", mJe = "parser.cc.6", nJe = "parser.cc.7", oJe = "parser.cc.8", pJe = "parser.ope.1", qJe = "parser.ope.2", rJe = "parser.ope.3", sJe = "parser.descape.1", tJe = "parser.descape.2", uJe = "parser.descape.3", vJe = "parser.descape.4", wJe = "parser.descape.5", xJe = "parser.process.1", yJe = "parser.quantifier.1", zJe = "parser.quantifier.2", AJe = "parser.quantifier.3", BJe = "parser.quantifier.4", CJe = "parser.quantifier.5", DJe = "org.eclipse.emf.common.notify", EJe = { 424: 1, 686: 1 }, FJe = { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 70: 1, 61: 1 }, GJe = { 378: 1, 152: 1 }, HJe = "index=", IJe = { 3: 1, 4: 1, 5: 1, 129: 1 }, JJe = { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 59: 1, 70: 1, 61: 1 }, KJe = { 3: 1, 6: 1, 4: 1, 5: 1, 198: 1 }, LJe = { 3: 1, 4: 1, 5: 1, 173: 1, 379: 1 }, MJe = ";/?:@&=+$,", NJe = "invalid authority: ", OJe = "EAnnotation", PJe = "ETypedElement", QJe = "EStructuralFeature", RJe = "EAttribute", SJe = "EClassifier", TJe = "EEnumLiteral", UJe = "EGenericType", VJe = "EOperation", WJe = "EParameter", XJe = "EReference", YJe = "ETypeParameter", ZJe = "org.eclipse.emf.ecore.util", $Je = { 79: 1 }, _Je = { 3: 1, 20: 1, 16: 1, 15: 1, 61: 1, 597: 1, 79: 1, 71: 1, 97: 1 }, aKe = "org.eclipse.emf.ecore.util.FeatureMap$Entry", bKe = 8192, cKe = 2048, dKe = "byte", eKe = "char", fKe = "double", gKe = "float", hKe = "int", iKe = "long", jKe = "short", kKe = "java.lang.Object", lKe = { 3: 1, 4: 1, 5: 1, 254: 1 }, mKe = { 3: 1, 4: 1, 5: 1, 688: 1 }, nKe = { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 59: 1, 70: 1, 66: 1, 61: 1, 71: 1 }, oKe = { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 59: 1, 70: 1, 66: 1, 61: 1, 79: 1, 71: 1, 97: 1 }, pKe = "mixed", qKe = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData", rKe = "kind", sKe = { 3: 1, 4: 1, 5: 1, 689: 1 }, tKe = { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 70: 1, 61: 1, 79: 1, 71: 1, 97: 1 }, uKe = { 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 61: 1, 71: 1 }, vKe = { 51: 1, 128: 1, 287: 1 }, wKe = { 76: 1, 343: 1 }, xKe = "The value of type '", yKe = "' must be of type '", zKe = 1352, AKe = "http://www.eclipse.org/emf/2002/Ecore", BKe = -32768, CKe = "constraints", DKe = "baseType", EKe = "getEStructuralFeature", FKe = "getFeatureID", GKe = "feature", HKe = "getOperationID", IKe = "operation", JKe = "defaultValue", KKe = "eTypeParameters", LKe = "isInstance", MKe = "getEEnumLiteral", NKe = "eContainingClass", OKe = { 57: 1 }, PKe = { 3: 1, 4: 1, 5: 1, 124: 1 }, QKe = "org.eclipse.emf.ecore.resource", RKe = { 94: 1, 93: 1, 599: 1, 2034: 1 }, SKe = "org.eclipse.emf.ecore.resource.impl", TKe = "unspecified", UKe = "simple", VKe = "attribute", WKe = "attributeWildcard", XKe = "element", YKe = "elementWildcard", ZKe = "collapse", $Ke = "itemType", _Ke = "namespace", aLe = "##targetNamespace", bLe = "whiteSpace", cLe = "wildcards", dLe = "http://www.eclipse.org/emf/2003/XMLType", eLe = "##any", fLe = "uninitialized", gLe = "The multiplicity constraint is violated", hLe = "org.eclipse.emf.ecore.xml.type", iLe = "ProcessingInstruction", jLe = "SimpleAnyType", kLe = "XMLTypeDocumentRoot", lLe = "org.eclipse.emf.ecore.xml.type.impl", mLe = "INF", nLe = "processing", oLe = "ENTITIES_._base", pLe = "minLength", qLe = "ENTITY", rLe = "NCName", sLe = "IDREFS_._base", tLe = "integer", uLe = "token", vLe = "pattern", wLe = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*", xLe = "\\i\\c*", yLe = "[\\i-[:]][\\c-[:]]*", zLe = "nonPositiveInteger", ALe = "maxInclusive", BLe = "NMTOKEN", CLe = "NMTOKENS_._base", DLe = "nonNegativeInteger", ELe = "minInclusive", FLe = "normalizedString", GLe = "unsignedByte", HLe = "unsignedInt", ILe = "18446744073709551615", JLe = "unsignedShort", KLe = "processingInstruction", LLe = "org.eclipse.emf.ecore.xml.type.internal", MLe = 1114111, NLe = "Internal Error: shorthands: \\u", OLe = "xml:isDigit", PLe = "xml:isWord", QLe = "xml:isSpace", RLe = "xml:isNameChar", SLe = "xml:isInitialNameChar", TLe = "09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩", ULe = "AZazÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣", VLe = "Private Use", WLe = "ASSIGNED", XLe = "\0€ÿĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\uFEFF\uFEFF＀￯", YLe = "UNASSIGNED", ZLe = { 3: 1, 122: 1 }, $Le = "org.eclipse.emf.ecore.xml.type.util", _Le = { 3: 1, 4: 1, 5: 1, 381: 1 }, aMe = "org.eclipse.xtext.xbase.lib", bMe = "Cannot add elements to a Range", cMe = "Cannot set elements in a Range", dMe = "Cannot remove elements from a Range", eMe = "user.agent"; - var _2, eeb, _db; - $wnd.goog = $wnd.goog || {}; - $wnd.goog.global = $wnd.goog.global || $wnd; - eeb = {}; - feb(1, null, {}, nb); - _2.Fb = function ob(a) { - return mb(this, a); - }; - _2.Gb = function qb() { - return this.Rm; - }; - _2.Hb = function sb() { - return kFb(this); - }; - _2.Ib = function ub() { - var a; - return nfb(rb(this)) + "@" + (a = tb(this) >>> 0, a.toString(16)); - }; - _2.equals = function(a) { - return this.Fb(a); - }; - _2.hashCode = function() { - return this.Hb(); - }; - _2.toString = function() { - return this.Ib(); - }; - var ND, OD, PD; - feb(297, 1, { 297: 1, 2124: 1 }, pfb); - _2.ve = function qfb(a) { - var b; - b = new pfb(); - b.i = 4; - a > 1 ? b.c = xfb(this, a - 1) : b.c = this; - return b; - }; - _2.we = function wfb() { - lfb(this); - return this.b; - }; - _2.xe = function yfb() { - return nfb(this); - }; - _2.ye = function Afb() { - return lfb(this), this.k; - }; - _2.ze = function Cfb() { - return (this.i & 4) != 0; - }; - _2.Ae = function Dfb() { - return (this.i & 1) != 0; - }; - _2.Ib = function Gfb() { - return ofb(this); - }; - _2.i = 0; - var jJ = sfb(mve, "Object", 1); - var UI = sfb(mve, "Class", 297); - feb(2096, 1, nve); - sfb(ove, "Optional", 2096); - feb(1191, 2096, nve, xb); - _2.Fb = function yb(a) { - return a === this; - }; - _2.Hb = function zb() { - return 2040732332; - }; - _2.Ib = function Ab() { - return "Optional.absent()"; - }; - _2.Jb = function Bb(a) { - Qb(a); - return wb(), vb; - }; - var vb; - sfb(ove, "Absent", 1191); - feb(636, 1, {}, Gb); - sfb(ove, "Joiner", 636); - var pE = ufb(ove, "Predicate"); - feb(589, 1, { 178: 1, 589: 1, 3: 1, 46: 1 }, Yb); - _2.Mb = function ac(a) { - return Xb(this, a); - }; - _2.Lb = function Zb(a) { - return Xb(this, a); - }; - _2.Fb = function $b(a) { - var b; - if (ZD(a, 589)) { - b = RD(a, 589); - return Rt(this.a, b.a); - } - return false; - }; - _2.Hb = function _b2() { - return Cob(this.a) + 306654252; - }; - _2.Ib = function bc() { - return Wb(this.a); - }; - sfb(ove, "Predicates/AndPredicate", 589); - feb(419, 2096, { 419: 1, 3: 1 }, cc); - _2.Fb = function dc(a) { - var b; - if (ZD(a, 419)) { - b = RD(a, 419); - return pb(this.a, b.a); - } - return false; - }; - _2.Hb = function ec() { - return 1502476572 + tb(this.a); - }; - _2.Ib = function fc() { - return uve + this.a + ")"; - }; - _2.Jb = function gc(a) { - return new cc(Rb(a.Kb(this.a), "the Function passed to Optional.transform() must not return null.")); - }; - sfb(ove, "Present", 419); - feb(204, 1, wve); - _2.Nb = function kc(a) { - Ztb(this, a); - }; - _2.Qb = function lc() { - jc(); - }; - sfb(xve, "UnmodifiableIterator", 204); - feb(2076, 204, yve); - _2.Qb = function nc() { - jc(); - }; - _2.Rb = function mc(a) { - throw Adb(new jib()); - }; - _2.Wb = function oc(a) { - throw Adb(new jib()); - }; - sfb(xve, "UnmodifiableListIterator", 2076); - feb(399, 2076, yve); - _2.Ob = function rc() { - return this.c < this.d; - }; - _2.Sb = function sc() { - return this.c > 0; - }; - _2.Pb = function tc() { - if (this.c >= this.d) { - throw Adb(new Dvb()); - } - return this.Xb(this.c++); - }; - _2.Tb = function uc() { - return this.c; - }; - _2.Ub = function vc() { - if (this.c <= 0) { - throw Adb(new Dvb()); - } - return this.Xb(--this.c); - }; - _2.Vb = function wc() { - return this.c - 1; - }; - _2.c = 0; - _2.d = 0; - sfb(xve, "AbstractIndexedListIterator", 399); - feb(713, 204, wve); - _2.Ob = function Ac() { - return xc(this); - }; - _2.Pb = function Bc() { - return yc(this); - }; - _2.e = 1; - sfb(xve, "AbstractIterator", 713); - feb(2084, 1, { 229: 1 }); - _2.Zb = function Hc() { - var a; - return a = this.f, !a ? this.f = this.ac() : a; - }; - _2.Fb = function Ic(a) { - return xw(this, a); - }; - _2.Hb = function Jc() { - return tb(this.Zb()); - }; - _2.dc = function Kc() { - return this.gc() == 0; - }; - _2.ec = function Lc() { - return Ec(this); - }; - _2.Ib = function Mc() { - return jeb(this.Zb()); - }; - sfb(xve, "AbstractMultimap", 2084); - feb(742, 2084, zve); - _2.$b = function Xc() { - Nc(this); - }; - _2._b = function Yc(a) { - return Oc(this, a); - }; - _2.ac = function Zc() { - return new ne(this, this.c); - }; - _2.ic = function $c(a) { - return this.hc(); - }; - _2.bc = function _c() { - return new zf(this, this.c); - }; - _2.jc = function ad() { - return this.mc(this.hc()); - }; - _2.kc = function bd() { - return new Hd(this); - }; - _2.lc = function cd() { - return ek(this.c.vc().Nc(), new hh(), 64, this.d); - }; - _2.cc = function dd(a) { - return Qc(this, a); - }; - _2.fc = function gd(a) { - return Sc2(this, a); - }; - _2.gc = function hd() { - return this.d; - }; - _2.mc = function jd(a) { - return yob(), new xpb(a); - }; - _2.nc = function kd() { - return new Dd(this); - }; - _2.oc = function ld() { - return ek(this.c.Cc().Nc(), new Fd(), 64, this.d); - }; - _2.pc = function md(a, b) { - return new lg(this, a, b, null); - }; - _2.d = 0; - sfb(xve, "AbstractMapBasedMultimap", 742); - feb(1696, 742, zve); - _2.hc = function pd() { - return new cnb(this.a); - }; - _2.jc = function qd() { - return yob(), yob(), vob; - }; - _2.cc = function sd(a) { - return RD(Qc(this, a), 15); - }; - _2.fc = function ud(a) { - return RD(Sc2(this, a), 15); - }; - _2.Zb = function od() { - return nd(this); - }; - _2.Fb = function rd(a) { - return xw(this, a); - }; - _2.qc = function td(a) { - return RD(Qc(this, a), 15); - }; - _2.rc = function vd(a) { - return RD(Sc2(this, a), 15); - }; - _2.mc = function wd(a) { - return Hob(RD(a, 15)); - }; - _2.pc = function xd(a, b) { - return Vc(this, a, RD(b, 15), null); - }; - sfb(xve, "AbstractListMultimap", 1696); - feb(748, 1, Ave); - _2.Nb = function zd(a) { - Ztb(this, a); - }; - _2.Ob = function Ad() { - return this.c.Ob() || this.e.Ob(); - }; - _2.Pb = function Bd() { - var a; - if (!this.e.Ob()) { - a = RD(this.c.Pb(), 44); - this.b = a.ld(); - this.a = RD(a.md(), 16); - this.e = this.a.Kc(); - } - return this.sc(this.b, this.e.Pb()); - }; - _2.Qb = function Cd() { - this.e.Qb(); - RD(Hvb(this.a), 16).dc() && this.c.Qb(); - --this.d.d; - }; - sfb(xve, "AbstractMapBasedMultimap/Itr", 748); - feb(1129, 748, Ave, Dd); - _2.sc = function Ed(a, b) { - return b; - }; - sfb(xve, "AbstractMapBasedMultimap/1", 1129); - feb(1130, 1, {}, Fd); - _2.Kb = function Gd(a) { - return RD(a, 16).Nc(); - }; - sfb(xve, "AbstractMapBasedMultimap/1methodref$spliterator$Type", 1130); - feb(1131, 748, Ave, Hd); - _2.sc = function Id(a, b) { - return new gp(a, b); - }; - sfb(xve, "AbstractMapBasedMultimap/2", 1131); - var VK = ufb(Bve, "Map"); - feb(2065, 1, Cve); - _2.wc = function Td(a) { - Bvb(this, a); - }; - _2.yc = function $d(a, b, c2) { - return Cvb(this, a, b, c2); - }; - _2.$b = function Od() { - this.vc().$b(); - }; - _2.tc = function Pd(a) { - return Jd(this, a); - }; - _2._b = function Qd(a) { - return !!Kd(this, a, false); - }; - _2.uc = function Rd(a) { - var b, c2, d; - for (c2 = this.vc().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 44); - d = b.md(); - if (dE(a) === dE(d) || a != null && pb(a, d)) { - return true; - } - } - return false; - }; - _2.Fb = function Sd(a) { - var b, c2, d; - if (a === this) { - return true; - } - if (!ZD(a, 85)) { - return false; - } - d = RD(a, 85); - if (this.gc() != d.gc()) { - return false; - } - for (c2 = d.vc().Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 44); - if (!this.tc(b)) { - return false; - } - } - return true; - }; - _2.xc = function Ud(a) { - return Wd(Kd(this, a, false)); - }; - _2.Hb = function Xd() { - return Bob(this.vc()); - }; - _2.dc = function Yd() { - return this.gc() == 0; - }; - _2.ec = function Zd() { - return new Xkb(this); - }; - _2.zc = function _d(a, b) { - throw Adb(new kib("Put not supported on this map")); - }; - _2.Ac = function ae(a) { - Ld(this, a); - }; - _2.Bc = function be(a) { - return Wd(Kd(this, a, true)); - }; - _2.gc = function ce() { - return this.vc().gc(); - }; - _2.Ib = function de() { - return Md(this); - }; - _2.Cc = function ee() { - return new glb(this); - }; - sfb(Bve, "AbstractMap", 2065); - feb(2085, 2065, Cve); - _2.bc = function ge() { - return new rf(this); - }; - _2.vc = function he() { - return fe(this); - }; - _2.ec = function ie() { - var a; - a = this.g; - return !a ? this.g = this.bc() : a; - }; - _2.Cc = function je() { - var a; - a = this.i; - return !a ? this.i = new nw(this) : a; - }; - sfb(xve, "Maps/ViewCachingAbstractMap", 2085); - feb(402, 2085, Cve, ne); - _2.xc = function se(a) { - return ke(this, a); - }; - _2.Bc = function ve(a) { - return le(this, a); - }; - _2.$b = function oe() { - this.d == this.e.c ? this.e.$b() : Ar(new mf(this)); - }; - _2._b = function pe(a) { - return Wv(this.d, a); - }; - _2.Ec = function qe() { - return new df(this); - }; - _2.Dc = function() { - return this.Ec(); - }; - _2.Fb = function re2(a) { - return this === a || pb(this.d, a); - }; - _2.Hb = function te() { - return tb(this.d); - }; - _2.ec = function ue() { - return this.e.ec(); - }; - _2.gc = function we() { - return this.d.gc(); - }; - _2.Ib = function xe() { - return jeb(this.d); - }; - sfb(xve, "AbstractMapBasedMultimap/AsMap", 402); - var cJ = ufb(mve, "Iterable"); - feb(31, 1, Dve); - _2.Jc = function Le(a) { - xgb(this, a); - }; - _2.Lc = function Ne() { - return this.Oc(); - }; - _2.Nc = function Pe() { - return new Swb(this, 0); - }; - _2.Oc = function Qe() { - return new SDb(null, this.Nc()); - }; - _2.Fc = function Ge(a) { - throw Adb(new kib("Add not supported on this collection")); - }; - _2.Gc = function He(a) { - return ye(this, a); - }; - _2.$b = function Ie() { - Ae(this); - }; - _2.Hc = function Je(a) { - return ze(this, a, false); - }; - _2.Ic = function Ke(a) { - return Be(this, a); - }; - _2.dc = function Me() { - return this.gc() == 0; - }; - _2.Mc = function Oe(a) { - return ze(this, a, true); - }; - _2.Pc = function Re() { - return De(this); - }; - _2.Qc = function Se(a) { - return Ee(this, a); - }; - _2.Ib = function Te() { - return Fe(this); - }; - sfb(Bve, "AbstractCollection", 31); - var bL = ufb(Bve, "Set"); - feb(Eve, 31, Fve); - _2.Nc = function Ye() { - return new Swb(this, 1); - }; - _2.Fb = function We(a) { - return Ue(this, a); - }; - _2.Hb = function Xe() { - return Bob(this); - }; - sfb(Bve, "AbstractSet", Eve); - feb(2068, Eve, Fve); - sfb(xve, "Sets/ImprovedAbstractSet", 2068); - feb(2069, 2068, Fve); - _2.$b = function $e() { - this.Rc().$b(); - }; - _2.Hc = function _e(a) { - return Ze(this, a); - }; - _2.dc = function af() { - return this.Rc().dc(); - }; - _2.Mc = function bf(a) { - var b; - if (this.Hc(a) && ZD(a, 44)) { - b = RD(a, 44); - return this.Rc().ec().Mc(b.ld()); - } - return false; - }; - _2.gc = function cf() { - return this.Rc().gc(); - }; - sfb(xve, "Maps/EntrySet", 2069); - feb(1127, 2069, Fve, df); - _2.Hc = function ef(a) { - return Nk(this.a.d.vc(), a); - }; - _2.Kc = function ff() { - return new mf(this.a); - }; - _2.Rc = function gf() { - return this.a; - }; - _2.Mc = function hf(a) { - var b; - if (!Nk(this.a.d.vc(), a)) { - return false; - } - b = RD(Hvb(RD(a, 44)), 44); - Tc2(this.a.e, b.ld()); - return true; - }; - _2.Nc = function jf() { - return gk(this.a.d.vc().Nc(), new kf(this.a)); - }; - sfb(xve, "AbstractMapBasedMultimap/AsMap/AsMapEntries", 1127); - feb(1128, 1, {}, kf); - _2.Kb = function lf(a) { - return me(this.a, RD(a, 44)); - }; - sfb(xve, "AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type", 1128); - feb(746, 1, Ave, mf); - _2.Nb = function nf(a) { - Ztb(this, a); - }; - _2.Pb = function pf() { - var a; - return a = RD(this.b.Pb(), 44), this.a = RD(a.md(), 16), me(this.c, a); - }; - _2.Ob = function of() { - return this.b.Ob(); - }; - _2.Qb = function qf() { - Vb(!!this.a); - this.b.Qb(); - this.c.e.d -= this.a.gc(); - this.a.$b(); - this.a = null; - }; - sfb(xve, "AbstractMapBasedMultimap/AsMap/AsMapIterator", 746); - feb(542, 2068, Fve, rf); - _2.$b = function sf() { - this.b.$b(); - }; - _2.Hc = function tf(a) { - return this.b._b(a); - }; - _2.Jc = function uf(a) { - Qb(a); - this.b.wc(new lw(a)); - }; - _2.dc = function vf() { - return this.b.dc(); - }; - _2.Kc = function wf() { - return new aw(this.b.vc().Kc()); - }; - _2.Mc = function xf(a) { - if (this.b._b(a)) { - this.b.Bc(a); - return true; - } - return false; - }; - _2.gc = function yf() { - return this.b.gc(); - }; - sfb(xve, "Maps/KeySet", 542); - feb(327, 542, Fve, zf); - _2.$b = function Af() { - var a; - Ar((a = this.b.vc().Kc(), new Hf(this, a))); - }; - _2.Ic = function Bf(a) { - return this.b.ec().Ic(a); - }; - _2.Fb = function Cf(a) { - return this === a || pb(this.b.ec(), a); - }; - _2.Hb = function Df() { - return tb(this.b.ec()); - }; - _2.Kc = function Ef() { - var a; - return a = this.b.vc().Kc(), new Hf(this, a); - }; - _2.Mc = function Ff(a) { - var b, c2; - c2 = 0; - b = RD(this.b.Bc(a), 16); - if (b) { - c2 = b.gc(); - b.$b(); - this.a.d -= c2; - } - return c2 > 0; - }; - _2.Nc = function Gf() { - return this.b.ec().Nc(); - }; - sfb(xve, "AbstractMapBasedMultimap/KeySet", 327); - feb(747, 1, Ave, Hf); - _2.Nb = function If(a) { - Ztb(this, a); - }; - _2.Ob = function Jf() { - return this.c.Ob(); - }; - _2.Pb = function Kf() { - this.a = RD(this.c.Pb(), 44); - return this.a.ld(); - }; - _2.Qb = function Lf() { - var a; - Vb(!!this.a); - a = RD(this.a.md(), 16); - this.c.Qb(); - this.b.a.d -= a.gc(); - a.$b(); - this.a = null; - }; - sfb(xve, "AbstractMapBasedMultimap/KeySet/1", 747); - feb(503, 402, { 85: 1, 133: 1 }, Mf); - _2.bc = function Nf() { - return this.Sc(); - }; - _2.ec = function Qf() { - return this.Uc(); - }; - _2.Sc = function Of() { - return new eg(this.c, this.Wc()); - }; - _2.Tc = function Pf() { - return this.Wc().Tc(); - }; - _2.Uc = function Rf() { - var a; - return a = this.b, !a ? this.b = this.Sc() : a; - }; - _2.Vc = function Sf() { - return this.Wc().Vc(); - }; - _2.Wc = function Tf() { - return RD(this.d, 133); - }; - sfb(xve, "AbstractMapBasedMultimap/SortedAsMap", 503); - feb(446, 503, Gve, Uf); - _2.bc = function Wf() { - return new gg(this.a, RD(RD(this.d, 133), 139)); - }; - _2.Sc = function Xf() { - return new gg(this.a, RD(RD(this.d, 133), 139)); - }; - _2.ec = function _f() { - var a; - return a = this.b, RD(!a ? this.b = new gg(this.a, RD(RD(this.d, 133), 139)) : a, 277); - }; - _2.Uc = function ag() { - var a; - return a = this.b, RD(!a ? this.b = new gg(this.a, RD(RD(this.d, 133), 139)) : a, 277); - }; - _2.Wc = function cg() { - return RD(RD(this.d, 133), 139); - }; - _2.Xc = function Vf(a) { - return RD(RD(this.d, 133), 139).Xc(a); - }; - _2.Yc = function Yf(a) { - return RD(RD(this.d, 133), 139).Yc(a); - }; - _2.Zc = function Zf(a, b) { - return new Uf(this.a, RD(RD(this.d, 133), 139).Zc(a, b)); - }; - _2.$c = function $f(a) { - return RD(RD(this.d, 133), 139).$c(a); - }; - _2._c = function bg(a) { - return RD(RD(this.d, 133), 139)._c(a); - }; - _2.ad = function dg(a, b) { - return new Uf(this.a, RD(RD(this.d, 133), 139).ad(a, b)); - }; - sfb(xve, "AbstractMapBasedMultimap/NavigableAsMap", 446); - feb(502, 327, Hve, eg); - _2.Nc = function fg() { - return this.b.ec().Nc(); - }; - sfb(xve, "AbstractMapBasedMultimap/SortedKeySet", 502); - feb(401, 502, Ive, gg); - sfb(xve, "AbstractMapBasedMultimap/NavigableKeySet", 401); - feb(551, 31, Dve, lg); - _2.Fc = function mg(a) { - var b, c2; - ig(this); - c2 = this.d.dc(); - b = this.d.Fc(a); - if (b) { - ++this.f.d; - c2 && hg(this); - } - return b; - }; - _2.Gc = function ng(a) { - var b, c2, d; - if (a.dc()) { - return false; - } - d = (ig(this), this.d.gc()); - b = this.d.Gc(a); - if (b) { - c2 = this.d.gc(); - this.f.d += c2 - d; - d == 0 && hg(this); - } - return b; - }; - _2.$b = function og() { - var a; - a = (ig(this), this.d.gc()); - if (a == 0) { - return; - } - this.d.$b(); - this.f.d -= a; - jg(this); - }; - _2.Hc = function pg(a) { - ig(this); - return this.d.Hc(a); - }; - _2.Ic = function qg(a) { - ig(this); - return this.d.Ic(a); - }; - _2.Fb = function rg(a) { - if (a === this) { - return true; - } - ig(this); - return pb(this.d, a); - }; - _2.Hb = function sg() { - ig(this); - return tb(this.d); - }; - _2.Kc = function tg() { - ig(this); - return new Og(this); - }; - _2.Mc = function ug(a) { - var b; - ig(this); - b = this.d.Mc(a); - if (b) { - --this.f.d; - jg(this); - } - return b; - }; - _2.gc = function vg() { - return kg(this); - }; - _2.Nc = function wg() { - return ig(this), this.d.Nc(); - }; - _2.Ib = function xg() { - ig(this); - return jeb(this.d); - }; - sfb(xve, "AbstractMapBasedMultimap/WrappedCollection", 551); - var QK = ufb(Bve, "List"); - feb(744, 551, { 20: 1, 31: 1, 16: 1, 15: 1 }, yg); - _2.jd = function Hg(a) { - tvb(this, a); - }; - _2.Nc = function Ig() { - return ig(this), this.d.Nc(); - }; - _2.bd = function zg(a, b) { - var c2; - ig(this); - c2 = this.d.dc(); - RD(this.d, 15).bd(a, b); - ++this.a.d; - c2 && hg(this); - }; - _2.cd = function Ag(a, b) { - var c2, d, e; - if (b.dc()) { - return false; - } - e = (ig(this), this.d.gc()); - c2 = RD(this.d, 15).cd(a, b); - if (c2) { - d = this.d.gc(); - this.a.d += d - e; - e == 0 && hg(this); - } - return c2; - }; - _2.Xb = function Bg(a) { - ig(this); - return RD(this.d, 15).Xb(a); - }; - _2.dd = function Cg(a) { - ig(this); - return RD(this.d, 15).dd(a); - }; - _2.ed = function Dg() { - ig(this); - return new Ug(this); - }; - _2.fd = function Eg(a) { - ig(this); - return new Vg(this, a); - }; - _2.gd = function Fg(a) { - var b; - ig(this); - b = RD(this.d, 15).gd(a); - --this.a.d; - jg(this); - return b; - }; - _2.hd = function Gg(a, b) { - ig(this); - return RD(this.d, 15).hd(a, b); - }; - _2.kd = function Jg(a, b) { - ig(this); - return Vc(this.a, this.e, RD(this.d, 15).kd(a, b), !this.b ? this : this.b); - }; - sfb(xve, "AbstractMapBasedMultimap/WrappedList", 744); - feb(1126, 744, { 20: 1, 31: 1, 16: 1, 15: 1, 59: 1 }, Kg); - sfb(xve, "AbstractMapBasedMultimap/RandomAccessWrappedList", 1126); - feb(628, 1, Ave, Og); - _2.Nb = function Qg(a) { - Ztb(this, a); - }; - _2.Ob = function Rg() { - Ng(this); - return this.b.Ob(); - }; - _2.Pb = function Sg() { - Ng(this); - return this.b.Pb(); - }; - _2.Qb = function Tg() { - Mg(this); - }; - sfb(xve, "AbstractMapBasedMultimap/WrappedCollection/WrappedIterator", 628); - feb(745, 628, Jve, Ug, Vg); - _2.Qb = function _g() { - Mg(this); - }; - _2.Rb = function Wg(a) { - var b; - b = kg(this.a) == 0; - (Ng(this), RD(this.b, 128)).Rb(a); - ++this.a.a.d; - b && hg(this.a); - }; - _2.Sb = function Xg() { - return (Ng(this), RD(this.b, 128)).Sb(); - }; - _2.Tb = function Yg() { - return (Ng(this), RD(this.b, 128)).Tb(); - }; - _2.Ub = function Zg() { - return (Ng(this), RD(this.b, 128)).Ub(); - }; - _2.Vb = function $g() { - return (Ng(this), RD(this.b, 128)).Vb(); - }; - _2.Wb = function ah(a) { - (Ng(this), RD(this.b, 128)).Wb(a); - }; - sfb(xve, "AbstractMapBasedMultimap/WrappedList/WrappedListIterator", 745); - feb(743, 551, Hve, bh); - _2.Nc = function dh() { - return ig(this), this.d.Nc(); - }; - sfb(xve, "AbstractMapBasedMultimap/WrappedSortedSet", 743); - feb(1125, 743, Ive, eh); - sfb(xve, "AbstractMapBasedMultimap/WrappedNavigableSet", 1125); - feb(1124, 551, Fve, fh); - _2.Nc = function gh() { - return ig(this), this.d.Nc(); - }; - sfb(xve, "AbstractMapBasedMultimap/WrappedSet", 1124); - feb(1133, 1, {}, hh); - _2.Kb = function ih(a) { - return fd(RD(a, 44)); - }; - sfb(xve, "AbstractMapBasedMultimap/lambda$1$Type", 1133); - feb(1132, 1, {}, jh); - _2.Kb = function kh(a) { - return new gp(this.a, a); - }; - sfb(xve, "AbstractMapBasedMultimap/lambda$2$Type", 1132); - var UK = ufb(Bve, "Map/Entry"); - feb(358, 1, Kve); - _2.Fb = function lh(a) { - var b; - if (ZD(a, 44)) { - b = RD(a, 44); - return Hb(this.ld(), b.ld()) && Hb(this.md(), b.md()); - } - return false; - }; - _2.Hb = function mh() { - var a, b; - a = this.ld(); - b = this.md(); - return (a == null ? 0 : tb(a)) ^ (b == null ? 0 : tb(b)); - }; - _2.nd = function nh(a) { - throw Adb(new jib()); - }; - _2.Ib = function oh() { - return this.ld() + "=" + this.md(); - }; - sfb(xve, Lve, 358); - feb(2086, 31, Dve); - _2.$b = function ph() { - this.od().$b(); - }; - _2.Hc = function qh(a) { - var b; - if (ZD(a, 44)) { - b = RD(a, 44); - return Cc(this.od(), b.ld(), b.md()); - } - return false; - }; - _2.Mc = function rh(a) { - var b; - if (ZD(a, 44)) { - b = RD(a, 44); - return Gc(this.od(), b.ld(), b.md()); - } - return false; - }; - _2.gc = function sh() { - return this.od().d; - }; - sfb(xve, "Multimaps/Entries", 2086); - feb(749, 2086, Dve, th); - _2.Kc = function uh() { - return this.a.kc(); - }; - _2.od = function vh() { - return this.a; - }; - _2.Nc = function wh() { - return this.a.lc(); - }; - sfb(xve, "AbstractMultimap/Entries", 749); - feb(750, 749, Fve, xh); - _2.Nc = function Ah() { - return this.a.lc(); - }; - _2.Fb = function yh(a) { - return Rx(this, a); - }; - _2.Hb = function zh() { - return Sx(this); - }; - sfb(xve, "AbstractMultimap/EntrySet", 750); - feb(751, 31, Dve, Bh); - _2.$b = function Ch() { - this.a.$b(); - }; - _2.Hc = function Dh(a) { - return Dc2(this.a, a); - }; - _2.Kc = function Eh() { - return this.a.nc(); - }; - _2.gc = function Fh() { - return this.a.d; - }; - _2.Nc = function Gh() { - return this.a.oc(); - }; - sfb(xve, "AbstractMultimap/Values", 751); - feb(2087, 31, { 849: 1, 20: 1, 31: 1, 16: 1 }); - _2.Jc = function Oh(a) { - Qb(a); - Ih(this).Jc(new lx(a)); - }; - _2.Nc = function Sh() { - var a; - return a = Ih(this).Nc(), ek(a, new sx(), 64 | a.yd() & 1296, this.a.d); - }; - _2.Fc = function Kh(a) { - Hh(); - return true; - }; - _2.Gc = function Lh(a) { - return Qb(this), Qb(a), ZD(a, 552) ? nx(RD(a, 849)) : !a.dc() && xr(this, a.Kc()); - }; - _2.Hc = function Mh(a) { - var b; - return b = RD(Xv(nd(this.a), a), 16), (!b ? 0 : b.gc()) > 0; - }; - _2.Fb = function Nh(a) { - return ox(this, a); - }; - _2.Hb = function Ph() { - return tb(Ih(this)); - }; - _2.dc = function Qh() { - return Ih(this).dc(); - }; - _2.Mc = function Rh(a) { - return Rw(this, a, 1) > 0; - }; - _2.Ib = function Th() { - return jeb(Ih(this)); - }; - sfb(xve, "AbstractMultiset", 2087); - feb(2089, 2068, Fve); - _2.$b = function Uh() { - Nc(this.a.a); - }; - _2.Hc = function Vh(a) { - var b, c2; - if (ZD(a, 504)) { - c2 = RD(a, 425); - if (RD(c2.a.md(), 16).gc() <= 0) { - return false; - } - b = Qw(this.a, c2.a.ld()); - return b == RD(c2.a.md(), 16).gc(); - } - return false; - }; - _2.Mc = function Wh(a) { - var b, c2, d, e; - if (ZD(a, 504)) { - c2 = RD(a, 425); - b = c2.a.ld(); - d = RD(c2.a.md(), 16).gc(); - if (d != 0) { - e = this.a; - return qx(e, b, d); - } - } - return false; - }; - sfb(xve, "Multisets/EntrySet", 2089); - feb(1139, 2089, Fve, Xh); - _2.Kc = function Yh() { - return new _w(fe(nd(this.a.a)).Kc()); - }; - _2.gc = function Zh() { - return nd(this.a.a).gc(); - }; - sfb(xve, "AbstractMultiset/EntrySet", 1139); - feb(627, 742, zve); - _2.hc = function ai() { - return this.pd(); - }; - _2.jc = function bi() { - return this.qd(); - }; - _2.cc = function ei(a) { - return this.rd(a); - }; - _2.fc = function gi(a) { - return this.sd(a); - }; - _2.Zb = function _h() { - var a; - return a = this.f, !a ? this.f = this.ac() : a; - }; - _2.qd = function ci() { - return yob(), yob(), xob; - }; - _2.Fb = function di(a) { - return xw(this, a); - }; - _2.rd = function fi(a) { - return RD(Qc(this, a), 21); - }; - _2.sd = function hi(a) { - return RD(Sc2(this, a), 21); - }; - _2.mc = function ii(a) { - return yob(), new Lqb(RD(a, 21)); - }; - _2.pc = function ji(a, b) { - return new fh(this, a, RD(b, 21)); - }; - sfb(xve, "AbstractSetMultimap", 627); - feb(1723, 627, zve); - _2.hc = function mi() { - return new yAb(this.b); - }; - _2.pd = function ni() { - return new yAb(this.b); - }; - _2.jc = function oi() { - return Zx(new yAb(this.b)); - }; - _2.qd = function pi2() { - return Zx(new yAb(this.b)); - }; - _2.cc = function qi(a) { - return RD(RD(Qc(this, a), 21), 87); - }; - _2.rd = function ri(a) { - return RD(RD(Qc(this, a), 21), 87); - }; - _2.fc = function si(a) { - return RD(RD(Sc2(this, a), 21), 87); - }; - _2.sd = function ti(a) { - return RD(RD(Sc2(this, a), 21), 87); - }; - _2.mc = function ui(a) { - return ZD(a, 277) ? Zx(RD(a, 277)) : (yob(), new jrb(RD(a, 87))); - }; - _2.Zb = function li() { - var a; - return a = this.f, !a ? this.f = ZD(this.c, 139) ? new Uf(this, RD(this.c, 139)) : ZD(this.c, 133) ? new Mf(this, RD(this.c, 133)) : new ne(this, this.c) : a; - }; - _2.pc = function vi(a, b) { - return ZD(b, 277) ? new eh(this, a, RD(b, 277)) : new bh(this, a, RD(b, 87)); - }; - sfb(xve, "AbstractSortedSetMultimap", 1723); - feb(1724, 1723, zve); - _2.Zb = function xi() { - var a; - return a = this.f, RD(RD(!a ? this.f = ZD(this.c, 139) ? new Uf(this, RD(this.c, 139)) : ZD(this.c, 133) ? new Mf(this, RD(this.c, 133)) : new ne(this, this.c) : a, 133), 139); - }; - _2.ec = function zi() { - var a; - return a = this.i, RD(RD(!a ? this.i = ZD(this.c, 139) ? new gg(this, RD(this.c, 139)) : ZD(this.c, 133) ? new eg(this, RD(this.c, 133)) : new zf(this, this.c) : a, 87), 277); - }; - _2.bc = function yi() { - return ZD(this.c, 139) ? new gg(this, RD(this.c, 139)) : ZD(this.c, 133) ? new eg(this, RD(this.c, 133)) : new zf(this, this.c); - }; - sfb(xve, "AbstractSortedKeySortedSetMultimap", 1724); - feb(2109, 1, { 2046: 1 }); - _2.Fb = function Ai(a) { - return Qy(this, a); - }; - _2.Hb = function Bi() { - var a; - return Bob((a = this.g, !a ? this.g = new Di(this) : a)); - }; - _2.Ib = function Ci() { - var a; - return Md((a = this.f, !a ? this.f = new Zj(this) : a)); - }; - sfb(xve, "AbstractTable", 2109); - feb(679, Eve, Fve, Di); - _2.$b = function Ei() { - Xi(); - }; - _2.Hc = function Fi(a) { - var b, c2; - if (ZD(a, 479)) { - b = RD(a, 697); - c2 = RD(Xv(bj(this.a), Qm(b.c.e, b.b)), 85); - return !!c2 && Nk(c2.vc(), new gp(Qm(b.c.c, b.a), Ui(b.c, b.b, b.a))); - } - return false; - }; - _2.Kc = function Gi() { - return Vi(this.a); - }; - _2.Mc = function Hi(a) { - var b, c2; - if (ZD(a, 479)) { - b = RD(a, 697); - c2 = RD(Xv(bj(this.a), Qm(b.c.e, b.b)), 85); - return !!c2 && Ok(c2.vc(), new gp(Qm(b.c.c, b.a), Ui(b.c, b.b, b.a))); - } - return false; - }; - _2.gc = function Ii() { - return dj(this.a); - }; - _2.Nc = function Ji() { - return Wi(this.a); - }; - sfb(xve, "AbstractTable/CellSet", 679); - feb(2025, 31, Dve, Ki); - _2.$b = function Li() { - Xi(); - }; - _2.Hc = function Mi(a) { - return Yi(this.a, a); - }; - _2.Kc = function Ni() { - return fj(this.a); - }; - _2.gc = function Oi() { - return dj(this.a); - }; - _2.Nc = function Pi() { - return gj(this.a); - }; - sfb(xve, "AbstractTable/Values", 2025); - feb(1697, 1696, zve); - sfb(xve, "ArrayListMultimapGwtSerializationDependencies", 1697); - feb(520, 1697, zve, Ri, Si); - _2.hc = function Ti() { - return new cnb(this.a); - }; - _2.a = 0; - sfb(xve, "ArrayListMultimap", 520); - feb(678, 2109, { 678: 1, 2046: 1, 3: 1 }, hj); - sfb(xve, "ArrayTable", 678); - feb(2021, 399, yve, ij); - _2.Xb = function jj(a) { - return new pj(this.a, a); - }; - sfb(xve, "ArrayTable/1", 2021); - feb(2022, 1, {}, kj); - _2.td = function lj(a) { - return new pj(this.a, a); - }; - sfb(xve, "ArrayTable/1methodref$getCell$Type", 2022); - feb(2110, 1, { 697: 1 }); - _2.Fb = function mj(a) { - var b; - if (a === this) { - return true; - } - if (ZD(a, 479)) { - b = RD(a, 697); - return Hb(Qm(this.c.e, this.b), Qm(b.c.e, b.b)) && Hb(Qm(this.c.c, this.a), Qm(b.c.c, b.a)) && Hb(Ui(this.c, this.b, this.a), Ui(b.c, b.b, b.a)); - } - return false; - }; - _2.Hb = function nj() { - return Tnb(cD(WC(jJ, 1), rve, 1, 5, [Qm(this.c.e, this.b), Qm(this.c.c, this.a), Ui(this.c, this.b, this.a)])); - }; - _2.Ib = function oj() { - return "(" + Qm(this.c.e, this.b) + "," + Qm(this.c.c, this.a) + ")=" + Ui(this.c, this.b, this.a); - }; - sfb(xve, "Tables/AbstractCell", 2110); - feb(479, 2110, { 479: 1, 697: 1 }, pj); - _2.a = 0; - _2.b = 0; - _2.d = 0; - sfb(xve, "ArrayTable/2", 479); - feb(2024, 1, {}, qj); - _2.td = function rj(a) { - return _i6(this.a, a); - }; - sfb(xve, "ArrayTable/2methodref$getValue$Type", 2024); - feb(2023, 399, yve, sj); - _2.Xb = function tj(a) { - return _i6(this.a, a); - }; - sfb(xve, "ArrayTable/3", 2023); - feb(2077, 2065, Cve); - _2.$b = function vj() { - Ar(this.kc()); - }; - _2.vc = function wj() { - return new gw(this); - }; - _2.lc = function xj() { - return new Uwb(this.kc(), this.gc()); - }; - sfb(xve, "Maps/IteratorBasedAbstractMap", 2077); - feb(842, 2077, Cve); - _2.$b = function Bj() { - throw Adb(new jib()); - }; - _2._b = function Cj(a) { - return En(this.c, a); - }; - _2.kc = function Dj() { - return new Rj(this, this.c.b.c.gc()); - }; - _2.lc = function Ej() { - return fk(this.c.b.c.gc(), 16, new Lj(this)); - }; - _2.xc = function Fj(a) { - var b; - b = RD(Fn(this.c, a), 17); - return !b ? null : this.vd(b.a); - }; - _2.dc = function Gj() { - return this.c.b.c.dc(); - }; - _2.ec = function Hj() { - return hn(this.c); - }; - _2.zc = function Ij(a, b) { - var c2; - c2 = RD(Fn(this.c, a), 17); - if (!c2) { - throw Adb(new agb(this.ud() + " " + a + " not in " + hn(this.c))); - } - return this.wd(c2.a, b); - }; - _2.Bc = function Jj(a) { - throw Adb(new jib()); - }; - _2.gc = function Kj() { - return this.c.b.c.gc(); - }; - sfb(xve, "ArrayTable/ArrayMap", 842); - feb(2020, 1, {}, Lj); - _2.td = function Mj(a) { - return yj(this.a, a); - }; - sfb(xve, "ArrayTable/ArrayMap/0methodref$getEntry$Type", 2020); - feb(2018, 358, Kve, Nj); - _2.ld = function Oj() { - return zj(this.a, this.b); - }; - _2.md = function Pj() { - return this.a.vd(this.b); - }; - _2.nd = function Qj(a) { - return this.a.wd(this.b, a); - }; - _2.b = 0; - sfb(xve, "ArrayTable/ArrayMap/1", 2018); - feb(2019, 399, yve, Rj); - _2.Xb = function Sj(a) { - return yj(this.a, a); - }; - sfb(xve, "ArrayTable/ArrayMap/2", 2019); - feb(2017, 842, Cve, Tj); - _2.ud = function Uj() { - return "Column"; - }; - _2.vd = function Vj(a) { - return Ui(this.b, this.a, a); - }; - _2.wd = function Wj(a, b) { - return cj(this.b, this.a, a, b); - }; - _2.a = 0; - sfb(xve, "ArrayTable/Row", 2017); - feb(843, 842, Cve, Zj); - _2.vd = function _j(a) { - return new Tj(this.a, a); - }; - _2.zc = function ak(a, b) { - return RD(b, 85), Xj(); - }; - _2.wd = function bk(a, b) { - return RD(b, 85), Yj(); - }; - _2.ud = function $j() { - return "Row"; - }; - sfb(xve, "ArrayTable/RowMap", 843); - feb(1157, 1, Pve, hk); - _2.Ad = function lk(a) { - return (this.a.yd() & -262 & a) != 0; - }; - _2.yd = function ik() { - return this.a.yd() & -262; - }; - _2.zd = function jk() { - return this.a.zd(); - }; - _2.Nb = function kk(a) { - this.a.Nb(new pk(a, this.b)); - }; - _2.Bd = function mk(a) { - return this.a.Bd(new nk(a, this.b)); - }; - sfb(xve, "CollectSpliterators/1", 1157); - feb(1158, 1, Qve, nk); - _2.Cd = function ok(a) { - this.a.Cd(this.b.Kb(a)); - }; - sfb(xve, "CollectSpliterators/1/lambda$0$Type", 1158); - feb(1159, 1, Qve, pk); - _2.Cd = function qk(a) { - this.a.Cd(this.b.Kb(a)); - }; - sfb(xve, "CollectSpliterators/1/lambda$1$Type", 1159); - feb(1154, 1, Pve, rk); - _2.Ad = function vk(a) { - return ((16464 | this.b) & a) != 0; - }; - _2.yd = function sk() { - return 16464 | this.b; - }; - _2.zd = function tk() { - return this.a.zd(); - }; - _2.Nb = function uk(a) { - this.a.Qe(new zk(a, this.c)); - }; - _2.Bd = function wk(a) { - return this.a.Re(new xk(a, this.c)); - }; - _2.b = 0; - sfb(xve, "CollectSpliterators/1WithCharacteristics", 1154); - feb(1155, 1, Rve, xk); - _2.Dd = function yk(a) { - this.a.Cd(this.b.td(a)); - }; - sfb(xve, "CollectSpliterators/1WithCharacteristics/lambda$0$Type", 1155); - feb(1156, 1, Rve, zk); - _2.Dd = function Ak(a) { - this.a.Cd(this.b.td(a)); - }; - sfb(xve, "CollectSpliterators/1WithCharacteristics/lambda$1$Type", 1156); - feb(1150, 1, Pve); - _2.Ad = function Gk(a) { - return (this.a & a) != 0; - }; - _2.yd = function Dk() { - return this.a; - }; - _2.zd = function Ek() { - !!this.e && (this.b = Kgb(this.b, this.e.zd())); - return Kgb(this.b, 0); - }; - _2.Nb = function Fk(a) { - if (this.e) { - this.e.Nb(a); - this.e = null; - } - this.c.Nb(new Kk(this, a)); - this.b = 0; - }; - _2.Bd = function Hk(a) { - while (true) { - if (!!this.e && this.e.Bd(a)) { - Pdb(this.b, Sve) && (this.b = Vdb(this.b, 1)); - return true; - } else { - this.e = null; - } - if (!this.c.Bd(new Ik(this))) { - return false; - } - } - }; - _2.a = 0; - _2.b = 0; - sfb(xve, "CollectSpliterators/FlatMapSpliterator", 1150); - feb(1152, 1, Qve, Ik); - _2.Cd = function Jk(a) { - Bk(this.a, a); - }; - sfb(xve, "CollectSpliterators/FlatMapSpliterator/lambda$0$Type", 1152); - feb(1153, 1, Qve, Kk); - _2.Cd = function Lk(a) { - Ck(this.a, this.b, a); - }; - sfb(xve, "CollectSpliterators/FlatMapSpliterator/lambda$1$Type", 1153); - feb(1151, 1150, Pve, Mk); - sfb(xve, "CollectSpliterators/FlatMapSpliteratorOfObject", 1151); - feb(253, 1, Tve); - _2.Fd = function Sk(a) { - return this.Ed(RD(a, 253)); - }; - _2.Ed = function Rk(a) { - var b; - if (a == (kl(), jl)) { - return 1; - } - if (a == (Wk(), Vk)) { - return -1; - } - b = (ux(), Leb(this.a, a.a)); - if (b != 0) { - return b; - } - return ZD(this, 526) == ZD(a, 526) ? 0 : ZD(this, 526) ? 1 : -1; - }; - _2.Id = function Tk() { - return this.a; - }; - _2.Fb = function Uk(a) { - return Pk(this, a); - }; - sfb(xve, "Cut", 253); - feb(1823, 253, Tve, Xk); - _2.Ed = function Yk(a) { - return a == this ? 0 : 1; - }; - _2.Gd = function Zk(a) { - throw Adb(new Ceb()); - }; - _2.Hd = function $k(a) { - a.a += "+∞)"; - }; - _2.Id = function _k() { - throw Adb(new dgb(Uve)); - }; - _2.Hb = function al() { - return gib(), jFb(this); - }; - _2.Jd = function bl(a) { - return false; - }; - _2.Ib = function cl() { - return "+∞"; - }; - var Vk; - sfb(xve, "Cut/AboveAll", 1823); - feb(526, 253, { 253: 1, 526: 1, 3: 1, 34: 1 }, dl); - _2.Gd = function el(a) { - Yhb((a.a += "(", a), this.a); - }; - _2.Hd = function fl(a) { - Thb(Yhb(a, this.a), 93); - }; - _2.Hb = function gl() { - return ~tb(this.a); - }; - _2.Jd = function hl(a) { - return ux(), Leb(this.a, a) < 0; - }; - _2.Ib = function il() { - return "/" + this.a + "\\"; - }; - sfb(xve, "Cut/AboveValue", 526); - feb(1822, 253, Tve, ll); - _2.Ed = function ml(a) { - return a == this ? 0 : -1; - }; - _2.Gd = function nl(a) { - a.a += "(-∞"; - }; - _2.Hd = function ol(a) { - throw Adb(new Ceb()); - }; - _2.Id = function pl() { - throw Adb(new dgb(Uve)); - }; - _2.Hb = function ql() { - return gib(), jFb(this); - }; - _2.Jd = function rl(a) { - return true; - }; - _2.Ib = function sl() { - return "-∞"; - }; - var jl; - sfb(xve, "Cut/BelowAll", 1822); - feb(1824, 253, Tve, tl); - _2.Gd = function ul(a) { - Yhb((a.a += "[", a), this.a); - }; - _2.Hd = function vl(a) { - Thb(Yhb(a, this.a), 41); - }; - _2.Hb = function wl() { - return tb(this.a); - }; - _2.Jd = function xl(a) { - return ux(), Leb(this.a, a) <= 0; - }; - _2.Ib = function yl() { - return "\\" + this.a + "/"; - }; - sfb(xve, "Cut/BelowValue", 1824); - feb(547, 1, Vve); - _2.Jc = function Bl(a) { - xgb(this, a); - }; - _2.Ib = function Cl() { - return Lr(RD(Rb(this, "use Optional.orNull() instead of Optional.or(null)"), 20).Kc()); - }; - sfb(xve, "FluentIterable", 547); - feb(442, 547, Vve, Dl); - _2.Kc = function El() { - return new is(Mr(this.a.Kc(), new ir())); - }; - sfb(xve, "FluentIterable/2", 442); - feb(1059, 547, Vve, Gl); - _2.Kc = function Hl() { - return Fl(this); - }; - sfb(xve, "FluentIterable/3", 1059); - feb(724, 399, yve, Il); - _2.Xb = function Jl(a) { - return this.a[a].Kc(); - }; - sfb(xve, "FluentIterable/3/1", 724); - feb(2070, 1, {}); - _2.Ib = function Kl() { - return jeb(this.Kd().b); - }; - sfb(xve, "ForwardingObject", 2070); - feb(2071, 2070, Wve); - _2.Kd = function Ql() { - return this.Ld(); - }; - _2.Jc = function Rl(a) { - xgb(this, a); - }; - _2.Lc = function Ul() { - return this.Oc(); - }; - _2.Nc = function Xl() { - return new Swb(this, 0); - }; - _2.Oc = function Yl() { - return new SDb(null, this.Nc()); - }; - _2.Fc = function Ll(a) { - return this.Ld(), qpb(); - }; - _2.Gc = function Ml(a) { - return this.Ld(), rpb(); - }; - _2.$b = function Nl() { - this.Ld(), spb(); - }; - _2.Hc = function Ol(a) { - return this.Ld().Hc(a); - }; - _2.Ic = function Pl(a) { - return this.Ld().Ic(a); - }; - _2.dc = function Sl() { - return this.Ld().b.dc(); - }; - _2.Kc = function Tl() { - return this.Ld().Kc(); - }; - _2.Mc = function Vl(a) { - return this.Ld(), vpb(); - }; - _2.gc = function Wl() { - return this.Ld().b.gc(); - }; - _2.Pc = function Zl() { - return this.Ld().Pc(); - }; - _2.Qc = function $l(a) { - return this.Ld().Qc(a); - }; - sfb(xve, "ForwardingCollection", 2071); - feb(2078, 31, Xve); - _2.Kc = function gm() { - return this.Od(); - }; - _2.Fc = function am(a) { - throw Adb(new jib()); - }; - _2.Gc = function bm(a) { - throw Adb(new jib()); - }; - _2.Md = function cm() { - var a; - a = this.c; - return !a ? this.c = this.Nd() : a; - }; - _2.$b = function dm() { - throw Adb(new jib()); - }; - _2.Hc = function em(a) { - return a != null && ze(this, a, false); - }; - _2.Nd = function fm() { - switch (this.gc()) { - case 0: - return tm(), tm(), sm; - case 1: - return tm(), new Dy(Qb(this.Od().Pb())); - default: - return new Fx(this, this.Pc()); - } - }; - _2.Mc = function hm(a) { - throw Adb(new jib()); - }; - sfb(xve, "ImmutableCollection", 2078); - feb(727, 2078, Xve, im); - _2.Kc = function nm() { - return Nr(this.a.Kc()); - }; - _2.Hc = function jm(a) { - return a != null && this.a.Hc(a); - }; - _2.Ic = function km(a) { - return this.a.Ic(a); - }; - _2.dc = function lm() { - return this.a.dc(); - }; - _2.Od = function mm() { - return Nr(this.a.Kc()); - }; - _2.gc = function om() { - return this.a.gc(); - }; - _2.Pc = function pm() { - return this.a.Pc(); - }; - _2.Qc = function qm(a) { - return this.a.Qc(a); - }; - _2.Ib = function rm() { - return jeb(this.a); - }; - sfb(xve, "ForwardingImmutableCollection", 727); - feb(307, 2078, Yve); - _2.Kc = function Em() { - return this.Od(); - }; - _2.ed = function Fm() { - return this.Pd(0); - }; - _2.fd = function Hm(a) { - return this.Pd(a); - }; - _2.jd = function Lm(a) { - tvb(this, a); - }; - _2.Nc = function Mm() { - return new Swb(this, 16); - }; - _2.kd = function Om(a, b) { - return this.Qd(a, b); - }; - _2.bd = function wm(a, b) { - throw Adb(new jib()); - }; - _2.cd = function xm(a, b) { - throw Adb(new jib()); - }; - _2.Md = function ym() { - return this; - }; - _2.Fb = function Am(a) { - return $u(this, a); - }; - _2.Hb = function Bm() { - return _u(this); - }; - _2.dd = function Cm(a) { - return a == null ? -1 : av(this, a); - }; - _2.Od = function Dm() { - return this.Pd(0); - }; - _2.Pd = function Gm(a) { - return um(this, a); - }; - _2.gd = function Jm(a) { - throw Adb(new jib()); - }; - _2.hd = function Km(a, b) { - throw Adb(new jib()); - }; - _2.Qd = function Nm(a, b) { - var c2; - return Pm((c2 = new pv(this), new Rkb(c2, a, b))); - }; - var sm; - sfb(xve, "ImmutableList", 307); - feb(2105, 307, Yve); - _2.Kc = function Zm() { - return Nr(this.Rd().Kc()); - }; - _2.kd = function an(a, b) { - return Pm(this.Rd().kd(a, b)); - }; - _2.Hc = function Rm(a) { - return a != null && this.Rd().Hc(a); - }; - _2.Ic = function Sm(a) { - return this.Rd().Ic(a); - }; - _2.Fb = function Tm(a) { - return pb(this.Rd(), a); - }; - _2.Xb = function Um(a) { - return Qm(this, a); - }; - _2.Hb = function Vm() { - return tb(this.Rd()); - }; - _2.dd = function Wm(a) { - return this.Rd().dd(a); - }; - _2.dc = function Xm() { - return this.Rd().dc(); - }; - _2.Od = function Ym() { - return Nr(this.Rd().Kc()); - }; - _2.gc = function $m() { - return this.Rd().gc(); - }; - _2.Qd = function _m(a, b) { - return Pm(this.Rd().kd(a, b)); - }; - _2.Pc = function bn() { - return this.Rd().Qc($C(jJ, rve, 1, this.Rd().gc(), 5, 1)); - }; - _2.Qc = function cn(a) { - return this.Rd().Qc(a); - }; - _2.Ib = function dn() { - return jeb(this.Rd()); - }; - sfb(xve, "ForwardingImmutableList", 2105); - feb(729, 1, $ve); - _2.vc = function pn() { - return gn(this); - }; - _2.wc = function rn(a) { - Bvb(this, a); - }; - _2.ec = function vn() { - return hn(this); - }; - _2.yc = function wn(a, b, c2) { - return Cvb(this, a, b, c2); - }; - _2.Cc = function Dn() { - return this.Vd(); - }; - _2.$b = function kn() { - throw Adb(new jib()); - }; - _2._b = function ln(a) { - return this.xc(a) != null; - }; - _2.uc = function mn(a) { - return this.Vd().Hc(a); - }; - _2.Td = function nn() { - return new xq(this); - }; - _2.Ud = function on() { - return new Gq(this); - }; - _2.Fb = function qn(a) { - return Tv(this, a); - }; - _2.Hb = function tn() { - return gn(this).Hb(); - }; - _2.dc = function un() { - return this.gc() == 0; - }; - _2.zc = function zn(a, b) { - return jn(); - }; - _2.Bc = function An(a) { - throw Adb(new jib()); - }; - _2.Ib = function Bn() { - return Zv(this); - }; - _2.Vd = function Cn() { - if (this.e) { - return this.e; - } - return this.e = this.Ud(); - }; - _2.c = null; - _2.d = null; - _2.e = null; - var en; - sfb(xve, "ImmutableMap", 729); - feb(730, 729, $ve); - _2._b = function Hn(a) { - return En(this, a); - }; - _2.uc = function In(a) { - return pqb(this.b, a); - }; - _2.Sd = function Jn() { - return go(new Xn2(this)); - }; - _2.Td = function Kn() { - return go(sqb(this.b)); - }; - _2.Ud = function Ln() { - return _l(), new im(tqb(this.b)); - }; - _2.Fb = function Mn(a) { - return rqb(this.b, a); - }; - _2.xc = function Nn(a) { - return Fn(this, a); - }; - _2.Hb = function On() { - return tb(this.b.c); - }; - _2.dc = function Pn() { - return this.b.c.dc(); - }; - _2.gc = function Qn() { - return this.b.c.gc(); - }; - _2.Ib = function Rn() { - return jeb(this.b.c); - }; - sfb(xve, "ForwardingImmutableMap", 730); - feb(2072, 2071, _ve); - _2.Kd = function Sn() { - return this.Wd(); - }; - _2.Ld = function Tn() { - return this.Wd(); - }; - _2.Nc = function Wn() { - return new Swb(this, 1); - }; - _2.Fb = function Un(a) { - return a === this || this.Wd().Fb(a); - }; - _2.Hb = function Vn() { - return this.Wd().Hb(); - }; - sfb(xve, "ForwardingSet", 2072); - feb(1085, 2072, _ve, Xn2); - _2.Kd = function Zn2() { - return qqb(this.a.b); - }; - _2.Ld = function $n() { - return qqb(this.a.b); - }; - _2.Hc = function Yn2(b) { - if (ZD(b, 44) && RD(b, 44).ld() == null) { - return false; - } - try { - return Pqb(qqb(this.a.b), b); - } catch (a) { - a = zdb(a); - if (ZD(a, 212)) { - return false; - } else - throw Adb(a); - } - }; - _2.Wd = function _n() { - return qqb(this.a.b); - }; - _2.Qc = function ao(a) { - var b; - b = Qqb(qqb(this.a.b), a); - qqb(this.a.b).b.gc() < b.length && bD(b, qqb(this.a.b).b.gc(), null); - return b; - }; - sfb(xve, "ForwardingImmutableMap/1", 1085); - feb(2079, 2078, awe); - _2.Kc = function eo() { - return this.Od(); - }; - _2.Nc = function fo() { - return new Swb(this, 1); - }; - _2.Fb = function bo(a) { - return Rx(this, a); - }; - _2.Hb = function co() { - return Sx(this); - }; - sfb(xve, "ImmutableSet", 2079); - feb(719, 2079, awe); - _2.Kc = function no() { - return Nr(new Ppb(this.a.b.Kc())); - }; - _2.Hc = function io(a) { - return a != null && tpb(this.a, a); - }; - _2.Ic = function jo(a) { - return upb(this.a, a); - }; - _2.Hb = function ko() { - return tb(this.a.b); - }; - _2.dc = function lo() { - return this.a.b.dc(); - }; - _2.Od = function mo() { - return Nr(new Ppb(this.a.b.Kc())); - }; - _2.gc = function oo() { - return this.a.b.gc(); - }; - _2.Pc = function po() { - return this.a.b.Pc(); - }; - _2.Qc = function qo(a) { - return wpb(this.a, a); - }; - _2.Ib = function ro() { - return jeb(this.a.b); - }; - sfb(xve, "ForwardingImmutableSet", 719); - feb(2073, 2072, bwe); - _2.Kd = function so() { - return this.b; - }; - _2.Ld = function to() { - return this.b; - }; - _2.Wd = function uo() { - return this.b; - }; - _2.Nc = function vo() { - return new $wb(this); - }; - sfb(xve, "ForwardingSortedSet", 2073); - feb(543, 2077, $ve, Io); - _2.Ac = function Ro(a) { - Ld(this, a); - }; - _2.Cc = function Uo() { - var a; - return a = this.d, new Gp(!a ? this.d = new mp(this) : a); - }; - _2.$b = function Jo() { - wo(this); - }; - _2._b = function Ko(a) { - return !!Go(this, a, Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15)))); - }; - _2.uc = function Lo(a) { - return xo(this, a); - }; - _2.kc = function Mo() { - return new ap(this, this); - }; - _2.wc = function No(a) { - zo(this, a); - }; - _2.xc = function Oo(a) { - return Ao(this, a); - }; - _2.ec = function Po() { - return new Np(this); - }; - _2.zc = function Qo(a, b) { - return Do(this, a, b); - }; - _2.Bc = function So(a) { - var b; - b = Go(this, a, Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15)))); - if (!b) { - return null; - } else { - yo(this, b); - b.e = null; - b.c = null; - return b.i; - } - }; - _2.gc = function To() { - return this.i; - }; - _2.xd = function Vo() { - var a; - return a = this.d, new Gp(!a ? this.d = new mp(this) : a); - }; - _2.f = 0; - _2.g = 0; - _2.i = 0; - sfb(xve, "HashBiMap", 543); - feb(544, 1, Ave); - _2.Nb = function Yo(a) { - Ztb(this, a); - }; - _2.Ob = function Zo() { - return Wo(this); - }; - _2.Pb = function $o() { - var a; - if (!Wo(this)) { - throw Adb(new Dvb()); - } - a = RD(Hvb(this.c), 303); - this.c = a.c; - this.f = a; - --this.d; - return this.Xd(a); - }; - _2.Qb = function _o() { - if (this.e.g != this.b) { - throw Adb(new Jrb()); - } - if (!this.f) { - throw Adb(new dgb(tve)); - } - yo(this.e, this.f); - this.b = this.e.g; - this.f = null; - }; - _2.b = 0; - _2.d = 0; - _2.f = null; - sfb(xve, "HashBiMap/Itr", 544); - feb(1023, 544, Ave, ap); - _2.Xd = function bp(a) { - return new cp(this, a); - }; - sfb(xve, "HashBiMap/1", 1023); - feb(gwe, 358, Kve, cp); - _2.ld = function dp() { - return this.a.g; - }; - _2.md = function ep() { - return this.a.i; - }; - _2.nd = function fp(a) { - var b, c2, d; - c2 = this.a.i; - d = Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15))); - if (d == this.a.f && (dE(a) === dE(c2) || a != null && pb(a, c2))) { - return a; - } - Nb(!Ho(this.b.a, a, d), a); - yo(this.b.a, this.a); - b = new kp(this.a.g, this.a.a, a, d); - Bo(this.b.a, b, this.a); - this.a.e = null; - this.a.c = null; - this.b.b = this.b.a.g; - this.b.f == this.a && (this.b.f = b); - this.a = b; - return c2; - }; - sfb(xve, "HashBiMap/1/MapEntry", gwe); - feb(246, 358, { 358: 1, 246: 1, 3: 1, 44: 1 }, gp); - _2.ld = function hp() { - return this.g; - }; - _2.md = function ip() { - return this.i; - }; - _2.nd = function jp(a) { - throw Adb(new jib()); - }; - sfb(xve, "ImmutableEntry", 246); - feb(303, 246, { 358: 1, 303: 1, 246: 1, 3: 1, 44: 1 }, kp); - _2.a = 0; - _2.f = 0; - var XF = sfb(xve, "HashBiMap/BiEntry", 303); - feb(619, 2077, $ve, mp); - _2.Ac = function vp(a) { - Ld(this, a); - }; - _2.Cc = function yp() { - return new Np(this.a); - }; - _2.$b = function np() { - wo(this.a); - }; - _2._b = function op2(a) { - return xo(this.a, a); - }; - _2.kc = function pp() { - return new Ap(this, this.a); - }; - _2.wc = function qp(a) { - Qb(a); - zo(this.a, new Lp(a)); - }; - _2.xc = function rp(a) { - return lp(this, a); - }; - _2.ec = function sp() { - return new Gp(this); - }; - _2.zc = function up(a, b) { - return Eo(this.a, a, b, false); - }; - _2.Bc = function wp(a) { - var b; - b = Ho(this.a, a, Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15)))); - if (!b) { - return null; - } else { - yo(this.a, b); - b.e = null; - b.c = null; - return b.g; - } - }; - _2.gc = function xp() { - return this.a.i; - }; - _2.xd = function zp() { - return new Np(this.a); - }; - sfb(xve, "HashBiMap/Inverse", 619); - feb(1020, 544, Ave, Ap); - _2.Xd = function Bp(a) { - return new Cp(this, a); - }; - sfb(xve, "HashBiMap/Inverse/1", 1020); - feb(1021, 358, Kve, Cp); - _2.ld = function Dp() { - return this.a.i; - }; - _2.md = function Ep() { - return this.a.g; - }; - _2.nd = function Fp(a) { - var b, c2, d; - d = this.a.g; - b = Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15))); - if (b == this.a.a && (dE(a) === dE(d) || a != null && pb(a, d))) { - return a; - } - Nb(!Go(this.b.a.a, a, b), a); - yo(this.b.a.a, this.a); - c2 = new kp(a, b, this.a.i, this.a.f); - this.a = c2; - Bo(this.b.a.a, c2, null); - this.b.b = this.b.a.a.g; - return d; - }; - sfb(xve, "HashBiMap/Inverse/1/InverseEntry", 1021); - feb(620, 542, Fve, Gp); - _2.Kc = function Hp() { - return new Jp(this.a.a); - }; - _2.Mc = function Ip(a) { - var b; - b = Ho(this.a.a, a, Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15)))); - if (!b) { - return false; - } else { - yo(this.a.a, b); - return true; - } - }; - sfb(xve, "HashBiMap/Inverse/InverseKeySet", 620); - feb(1019, 544, Ave, Jp); - _2.Xd = function Kp(a) { - return a.i; - }; - sfb(xve, "HashBiMap/Inverse/InverseKeySet/1", 1019); - feb(1022, 1, {}, Lp); - _2.Yd = function Mp(a, b) { - tp(this.a, a, b); - }; - sfb(xve, "HashBiMap/Inverse/lambda$0$Type", 1022); - feb(618, 542, Fve, Np); - _2.Kc = function Op() { - return new Qp(this.a); - }; - _2.Mc = function Pp(a) { - var b; - b = Go(this.a, a, Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15)))); - if (!b) { - return false; - } else { - yo(this.a, b); - b.e = null; - b.c = null; - return true; - } - }; - sfb(xve, "HashBiMap/KeySet", 618); - feb(1018, 544, Ave, Qp); - _2.Xd = function Rp(a) { - return a.g; - }; - sfb(xve, "HashBiMap/KeySet/1", 1018); - feb(1123, 627, zve); - sfb(xve, "HashMultimapGwtSerializationDependencies", 1123); - feb(271, 1123, zve, Tp); - _2.hc = function Up() { - return new atb(Sv(this.a)); - }; - _2.pd = function Vp() { - return new atb(Sv(this.a)); - }; - _2.a = 2; - sfb(xve, "HashMultimap", 271); - feb(2097, 307, Yve); - _2.Hc = function Yp(a) { - return this.Zd().Hc(a); - }; - _2.dc = function Zp() { - return this.Zd().dc(); - }; - _2.gc = function $p() { - return this.Zd().gc(); - }; - sfb(xve, "ImmutableAsList", 2097); - feb(2030, 730, $ve); - _2.Vd = function aq() { - return _l(), new Fy(this.a); - }; - _2.Cc = function bq() { - return _l(), new Fy(this.a); - }; - _2.xd = function cq() { - return _l(), new Fy(this.a); - }; - sfb(xve, "ImmutableBiMap", 2030); - feb(2075, 1, {}); - sfb(xve, "ImmutableCollection/Builder", 2075); - feb(1035, 719, awe, dq); - sfb(xve, "ImmutableEnumSet", 1035); - feb(980, 399, yve, fq); - _2.Xb = function gq(a) { - return this.a.Xb(a); - }; - sfb(xve, "ImmutableList/1", 980); - feb(979, 2075, {}, hq); - sfb(xve, "ImmutableList/Builder", 979); - feb(623, 204, wve, iq); - _2.Ob = function jq() { - return this.a.Ob(); - }; - _2.Pb = function kq() { - return RD(this.a.Pb(), 44).ld(); - }; - sfb(xve, "ImmutableMap/1", 623); - feb(1054, 1, {}, lq); - _2.Kb = function mq(a) { - return RD(a, 44).ld(); - }; - sfb(xve, "ImmutableMap/2methodref$getKey$Type", 1054); - feb(1053, 1, {}, oq); - sfb(xve, "ImmutableMap/Builder", 1053); - feb(2098, 2079, awe); - _2.Md = function pq() { - var a; - return a = this.b, !a ? this.b = new Xq(this) : a; - }; - _2.Nd = function qq() { - return new Fx(this, Ee(this, $C(jJ, rve, 1, this.gc(), 5, 1))); - }; - sfb(xve, "ImmutableSet/CachingAsList", 2098); - feb(2099, 2098, awe); - _2.Kc = function uq() { - var a; - return a = gn(this.a).Od(), new iq(a); - }; - _2.Nd = function rq() { - return new Xq(this); - }; - _2.Jc = function sq(a) { - var b, c2; - Qb(a); - c2 = this.gc(); - for (b = 0; b < c2; b++) { - a.Cd(RD(gn(this.a).Md().Xb(b), 44).ld()); - } - }; - _2.Od = function tq() { - var a; - return a = this.b, um(!a ? this.b = new Xq(this) : a, 0); - }; - _2.Nc = function vq() { - return fk(this.gc(), 1296, new Vq(this)); - }; - sfb(xve, "IndexedImmutableSet", 2099); - feb(1230, 2099, awe, xq); - _2.Kc = function Bq() { - var a; - return a = gn(this.a).Od(), new iq(a); - }; - _2.Hc = function yq(a) { - return this.a._b(a); - }; - _2.Jc = function zq(a) { - Qb(a); - Bvb(this.a, new Eq(a)); - }; - _2.Od = function Aq() { - var a; - return a = gn(this.a).Od(), new iq(a); - }; - _2.gc = function Cq() { - return this.a.gc(); - }; - _2.Nc = function Dq() { - return gk(gn(this.a).Nc(), new lq()); - }; - sfb(xve, "ImmutableMapKeySet", 1230); - feb(1231, 1, {}, Eq); - _2.Yd = function Fq(a, b) { - _l(); - this.a.Cd(a); - }; - sfb(xve, "ImmutableMapKeySet/lambda$0$Type", 1231); - feb(1227, 2078, Xve, Gq); - _2.Kc = function Kq() { - return new Pq(this); - }; - _2.Md = function Hq() { - var a; - a = gn(this.a).Md(); - return new Sq(this, a); - }; - _2.Hc = function Iq(a) { - return a != null && Br(new Pq(this), a); - }; - _2.Od = function Jq() { - return new Pq(this); - }; - _2.gc = function Lq() { - return this.a.gc(); - }; - _2.Nc = function Mq() { - return gk(gn(this.a).Nc(), new Nq()); - }; - sfb(xve, "ImmutableMapValues", 1227); - feb(1228, 1, {}, Nq); - _2.Kb = function Oq(a) { - return RD(a, 44).md(); - }; - sfb(xve, "ImmutableMapValues/0methodref$getValue$Type", 1228); - feb(637, 204, wve, Pq); - _2.Ob = function Qq() { - return this.a.Ob(); - }; - _2.Pb = function Rq() { - return RD(this.a.Pb(), 44).md(); - }; - sfb(xve, "ImmutableMapValues/1", 637); - feb(1229, 2097, Yve, Sq); - _2.Zd = function Tq() { - return this.a; - }; - _2.Xb = function Uq(a) { - return RD(this.b.Xb(a), 44).md(); - }; - sfb(xve, "ImmutableMapValues/2", 1229); - feb(1232, 1, {}, Vq); - _2.td = function Wq(a) { - return wq(this.a, a); - }; - sfb(xve, "IndexedImmutableSet/0methodref$get$Type", 1232); - feb(638, 2097, Yve, Xq); - _2.Zd = function Yq() { - return this.a; - }; - _2.Xb = function Zq(a) { - return wq(this.a, a); - }; - _2.gc = function $q() { - return this.a.a.gc(); - }; - sfb(xve, "IndexedImmutableSet/1", 638); - feb(43, 1, {}, ir); - _2.Kb = function jr(a) { - return RD(a, 20).Kc(); - }; - _2.Fb = function kr(a) { - return this === a; - }; - sfb(xve, "Iterables/10", 43); - feb(1055, 547, Vve, mr); - _2.Jc = function nr(a) { - Qb(a); - this.b.Jc(new qr(this.a, a)); - }; - _2.Kc = function or() { - return lr(this); - }; - sfb(xve, "Iterables/4", 1055); - feb(1056, 1, Qve, qr); - _2.Cd = function rr(a) { - pr(this.b, this.a, a); - }; - sfb(xve, "Iterables/4/lambda$0$Type", 1056); - feb(1057, 547, Vve, sr); - _2.Jc = function tr(a) { - Qb(a); - xgb(this.a, new vr(a, this.b)); - }; - _2.Kc = function ur() { - return Mr(new dMd(this.a), this.b); - }; - sfb(xve, "Iterables/5", 1057); - feb(1058, 1, Qve, vr); - _2.Cd = function wr(a) { - this.a.Cd(Ksd(a)); - }; - sfb(xve, "Iterables/5/lambda$0$Type", 1058); - feb(1087, 204, wve, Or); - _2.Ob = function Pr() { - return this.a.Ob(); - }; - _2.Pb = function Qr() { - return this.a.Pb(); - }; - sfb(xve, "Iterators/1", 1087); - feb(1088, 713, wve, Rr); - _2.Yb = function Sr() { - var a; - while (this.b.Ob()) { - a = this.b.Pb(); - if (this.a.Lb(a)) { - return a; - } - } - return this.e = 2, null; - }; - sfb(xve, "Iterators/5", 1088); - feb(497, 1, Ave); - _2.Nb = function Ur(a) { - Ztb(this, a); - }; - _2.Ob = function Vr() { - return this.b.Ob(); - }; - _2.Pb = function Wr() { - return this.$d(this.b.Pb()); - }; - _2.Qb = function Xr() { - this.b.Qb(); - }; - sfb(xve, "TransformedIterator", 497); - feb(1089, 497, Ave, Yr); - _2.$d = function Zr(a) { - return this.a.Kb(a); - }; - sfb(xve, "Iterators/6", 1089); - feb(732, 204, wve, $r); - _2.Ob = function _r() { - return !this.a; - }; - _2.Pb = function as() { - if (this.a) { - throw Adb(new Dvb()); - } - this.a = true; - return this.b; - }; - _2.a = false; - sfb(xve, "Iterators/9", 732); - feb(1086, 399, yve, ds); - _2.Xb = function es(a) { - return this.a[this.b + a]; - }; - _2.b = 0; - var bs; - sfb(xve, "Iterators/ArrayItr", 1086); - feb(38, 1, { 38: 1, 51: 1 }, is); - _2.Nb = function js(a) { - Ztb(this, a); - }; - _2.Ob = function ks() { - return gs(this); - }; - _2.Pb = function ls() { - return hs(this); - }; - _2.Qb = function ms() { - if (!this.c) { - throw Adb(new dgb(tve)); - } - this.c.Qb(); - this.c = null; - }; - sfb(xve, "Iterators/ConcatenatedIterator", 38); - feb(22, 1, { 3: 1, 34: 1, 22: 1 }); - _2.Fd = function rs(a) { - return ns(this, RD(a, 22)); - }; - _2.Fb = function ts(a) { - return this === a; - }; - _2.Hb = function us() { - return kFb(this); - }; - _2.Ib = function vs() { - return ps(this); - }; - _2.g = 0; - var WI = sfb(mve, "Enum", 22); - feb(549, 22, { 549: 1, 3: 1, 34: 1, 22: 1, 51: 1 }, As); - _2.Nb = function Bs(a) { - Ztb(this, a); - }; - _2.Ob = function Cs() { - return false; - }; - _2.Pb = function Ds() { - throw Adb(new Dvb()); - }; - _2.Qb = function Es() { - Vb(false); - }; - var ys; - var RG = tfb(xve, "Iterators/EmptyModifiableIterator", 549, WI, Gs, Fs); - var Hs; - feb(1907, 627, zve); - sfb(xve, "LinkedHashMultimapGwtSerializationDependencies", 1907); - feb(1908, 1907, zve, Ks); - _2.hc = function Ms() { - return new Jub(Sv(this.b)); - }; - _2.$b = function Ls() { - Nc(this); - Ss(this.a, this.a); - }; - _2.pd = function Ns() { - return new Jub(Sv(this.b)); - }; - _2.ic = function Os(a) { - return new it(this, a, this.b); - }; - _2.kc = function Ps() { - return new Zs(this); - }; - _2.lc = function Qs() { - var a; - return new Swb((a = this.g, RD(!a ? this.g = new xh(this) : a, 21)), 17); - }; - _2.ec = function Rs() { - var a; - return a = this.i, !a ? this.i = new zf(this, this.c) : a; - }; - _2.nc = function Us() { - return new cw(new Zs(this)); - }; - _2.oc = function Vs() { - var a; - return gk(new Swb((a = this.g, RD(!a ? this.g = new xh(this) : a, 21)), 17), new Ws()); - }; - _2.b = 2; - sfb(xve, "LinkedHashMultimap", 1908); - feb(1911, 1, {}, Ws); - _2.Kb = function Xs(a) { - return RD(a, 44).md(); - }; - sfb(xve, "LinkedHashMultimap/0methodref$getValue$Type", 1911); - feb(834, 1, Ave, Zs); - _2.Nb = function $s(a) { - Ztb(this, a); - }; - _2.Pb = function at() { - return Ys(this); - }; - _2.Ob = function _s() { - return this.a != this.b.a; - }; - _2.Qb = function bt() { - Vb(!!this.c); - Gc(this.b, this.c.g, this.c.i); - this.c = null; - }; - sfb(xve, "LinkedHashMultimap/1", 834); - feb(227, 246, { 358: 1, 246: 1, 227: 1, 604: 1, 3: 1, 44: 1 }, ct); - _2._d = function dt() { - return RD(Hvb(this.f), 604); - }; - _2.ae = function et(a) { - this.c = a; - }; - _2.be = function ft(a) { - this.f = a; - }; - _2.d = 0; - var UG = sfb(xve, "LinkedHashMultimap/ValueEntry", 227); - feb(1909, 2068, { 604: 1, 20: 1, 31: 1, 16: 1, 21: 1 }, it); - _2.Fc = function jt(a) { - var b, c2, d, e, f2; - f2 = Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15))); - b = f2 & this.b.length - 1; - e = this.b[b]; - for (c2 = e; c2; c2 = c2.a) { - if (c2.d == f2 && Hb(c2.i, a)) { - return false; - } - } - d = new ct(this.c, a, f2, e); - Ts(this.d, d); - d.f = this; - this.d = d; - Ss(RD(Hvb(this.g.a.b), 227), d); - Ss(d, this.g.a); - this.b[b] = d; - ++this.f; - ++this.e; - gt(this); - return true; - }; - _2.$b = function kt() { - var a, b; - Mnb(this.b, null); - this.f = 0; - for (a = this.a; a != this; a = a._d()) { - b = RD(a, 227); - Ss(RD(Hvb(b.b), 227), RD(Hvb(b.e), 227)); - } - this.a = this; - this.d = this; - ++this.e; - }; - _2.Hc = function lt(a) { - var b, c2; - c2 = Ydb(Ndb(cwe, qgb(Ydb(Ndb(a == null ? 0 : tb(a), dwe)), 15))); - for (b = this.b[c2 & this.b.length - 1]; b; b = b.a) { - if (b.d == c2 && Hb(b.i, a)) { - return true; - } - } - return false; - }; - _2.Jc = function mt(a) { - var b; - Qb(a); - for (b = this.a; b != this; b = b._d()) { - a.Cd(RD(b, 227).i); - } - }; - _2._d = function nt() { - return this.a; - }; - _2.Kc = function ot() { - return new ut(this); - }; - _2.Mc = function pt(a) { - return ht(this, a); - }; - _2.ae = function qt(a) { - this.d = a; - }; - _2.be = function rt(a) { - this.a = a; - }; - _2.gc = function st() { - return this.f; - }; - _2.e = 0; - _2.f = 0; - sfb(xve, "LinkedHashMultimap/ValueSet", 1909); - feb(1910, 1, Ave, ut); - _2.Nb = function vt(a) { - Ztb(this, a); - }; - _2.Ob = function wt() { - return tt(this), this.b != this.c; - }; - _2.Pb = function xt() { - var a, b; - tt(this); - if (this.b == this.c) { - throw Adb(new Dvb()); - } - a = RD(this.b, 227); - b = a.i; - this.d = a; - this.b = RD(Hvb(a.f), 604); - return b; - }; - _2.Qb = function yt() { - tt(this); - Vb(!!this.d); - ht(this.c, this.d.i); - this.a = this.c.e; - this.d = null; - }; - _2.a = 0; - sfb(xve, "LinkedHashMultimap/ValueSet/1", 1910); - feb(780, 2084, zve, Et); - _2.Zb = function Ft() { - var a; - return a = this.f, !a ? this.f = new zw(this) : a; - }; - _2.Fb = function Kt(a) { - return xw(this, a); - }; - _2.cc = function Lt(a) { - return new su(this, a); - }; - _2.fc = function Ot(a) { - return Ct(this, a); - }; - _2.$b = function Gt() { - At(this); - }; - _2._b = function Ht(a) { - return Bt(this, a); - }; - _2.ac = function It() { - return new zw(this); - }; - _2.bc = function Jt() { - return new vu(this); - }; - _2.qc = function Mt(a) { - return new su(this, a); - }; - _2.dc = function Nt() { - return !this.a; - }; - _2.rc = function Pt(a) { - return Ct(this, a); - }; - _2.gc = function Qt() { - return this.d; - }; - _2.c = 0; - _2.d = 0; - sfb(xve, "LinkedListMultimap", 780); - feb(56, 31, kwe); - _2.jd = function eu(a) { - tvb(this, a); - }; - _2.Nc = function fu() { - return new Swb(this, 16); - }; - _2.bd = function Tt(a, b) { - throw Adb(new kib("Add not supported on this list")); - }; - _2.Fc = function Ut(a) { - this.bd(this.gc(), a); - return true; - }; - _2.cd = function Vt(a, b) { - var c2, d, e; - uFb(b); - c2 = false; - for (e = b.Kc(); e.Ob(); ) { - d = e.Pb(); - this.bd(a++, d); - c2 = true; - } - return c2; - }; - _2.$b = function Wt() { - this.ce(0, this.gc()); - }; - _2.Fb = function Xt(a) { - return Rt(this, a); - }; - _2.Hb = function Yt() { - return Cob(this); - }; - _2.dd = function Zt(a) { - return St(this, a); - }; - _2.Kc = function $t() { - return new Dkb(this); - }; - _2.ed = function _t() { - return this.fd(0); - }; - _2.fd = function au(a) { - return new Jkb(this, a); - }; - _2.gd = function bu(a) { - throw Adb(new kib("Remove not supported on this list")); - }; - _2.ce = function cu(a, b) { - var c2, d; - d = this.fd(a); - for (c2 = a; c2 < b; ++c2) { - d.Pb(); - d.Qb(); - } - }; - _2.hd = function du(a, b) { - throw Adb(new kib("Set not supported on this list")); - }; - _2.kd = function gu(a, b) { - return new Rkb(this, a, b); - }; - _2.j = 0; - sfb(Bve, "AbstractList", 56); - feb(2062, 56, kwe); - _2.bd = function lu(a, b) { - hu(this, a, b); - }; - _2.cd = function mu(a, b) { - return iu(this, a, b); - }; - _2.Xb = function nu(a) { - return ju(this, a); - }; - _2.Kc = function ou() { - return this.fd(0); - }; - _2.gd = function pu(a) { - return ku(this, a); - }; - _2.hd = function qu(b, c2) { - var d, e; - d = this.fd(b); - try { - e = d.Pb(); - d.Wb(c2); - return e; - } catch (a) { - a = zdb(a); - if (ZD(a, 112)) { - throw Adb(new veb("Can't set element " + b)); - } else - throw Adb(a); - } - }; - sfb(Bve, "AbstractSequentialList", 2062); - feb(646, 2062, kwe, su); - _2.fd = function tu(a) { - return ru(this, a); - }; - _2.gc = function uu() { - var a; - a = RD(Wjb(this.a.b, this.b), 260); - return !a ? 0 : a.a; - }; - sfb(xve, "LinkedListMultimap/1", 646); - feb(1316, 2068, Fve, vu); - _2.Hc = function wu(a) { - return Bt(this.a, a); - }; - _2.Kc = function xu() { - return new Bu(this.a); - }; - _2.Mc = function yu(a) { - return !Ct(this.a, a).a.dc(); - }; - _2.gc = function zu() { - return bkb(this.a.b); - }; - sfb(xve, "LinkedListMultimap/1KeySetImpl", 1316); - feb(1315, 1, Ave, Bu); - _2.Nb = function Cu(a) { - Ztb(this, a); - }; - _2.Ob = function Du() { - Au(this); - return !!this.c; - }; - _2.Pb = function Eu() { - Au(this); - if (!this.c) { - throw Adb(new Dvb()); - } - this.a = this.c; - Ysb(this.d, this.a.a); - do { - this.c = this.c.b; - } while (!!this.c && !Ysb(this.d, this.c.a)); - return this.a.a; - }; - _2.Qb = function Fu() { - Au(this); - Vb(!!this.a); - Ar(new Nu(this.e, this.a.a)); - this.a = null; - this.b = this.e.c; - }; - _2.b = 0; - sfb(xve, "LinkedListMultimap/DistinctKeyIterator", 1315); - feb(260, 1, { 260: 1 }, Gu); - _2.a = 0; - sfb(xve, "LinkedListMultimap/KeyList", 260); - feb(511, 358, { 358: 1, 511: 1, 44: 1 }, Hu); - _2.ld = function Iu() { - return this.a; - }; - _2.md = function Ju() { - return this.f; - }; - _2.nd = function Ku(a) { - var b; - b = this.f; - this.f = a; - return b; - }; - sfb(xve, "LinkedListMultimap/Node", 511); - feb(566, 1, Jve, Nu, Ou); - _2.Nb = function Qu(a) { - Ztb(this, a); - }; - _2.Rb = function Pu(a) { - this.e = zt(this.f, this.b, a, this.c); - ++this.d; - this.a = null; - }; - _2.Ob = function Ru() { - return !!this.c; - }; - _2.Sb = function Su() { - return !!this.e; - }; - _2.Pb = function Tu() { - return Lu(this); - }; - _2.Tb = function Uu() { - return this.d; - }; - _2.Ub = function Vu() { - return Mu(this); - }; - _2.Vb = function Wu() { - return this.d - 1; - }; - _2.Qb = function Xu() { - Vb(!!this.a); - if (this.a != this.c) { - this.e = this.a.e; - --this.d; - } else { - this.c = this.a.c; - } - Dt(this.f, this.a); - this.a = null; - }; - _2.Wb = function Yu(a) { - Ub(!!this.a); - this.a.f = a; - }; - _2.d = 0; - sfb(xve, "LinkedListMultimap/ValueForKeyIterator", 566); - feb(1031, 56, kwe); - _2.bd = function iv(a, b) { - this.a.bd(a, b); - }; - _2.cd = function jv(a, b) { - return this.a.cd(a, b); - }; - _2.Hc = function kv(a) { - return this.a.Hc(a); - }; - _2.Xb = function lv(a) { - return this.a.Xb(a); - }; - _2.gd = function mv(a) { - return this.a.gd(a); - }; - _2.hd = function nv(a, b) { - return this.a.hd(a, b); - }; - _2.gc = function ov() { - return this.a.gc(); - }; - sfb(xve, "Lists/AbstractListWrapper", 1031); - feb(1032, 1031, mwe); - sfb(xve, "Lists/RandomAccessListWrapper", 1032); - feb(1034, 1032, mwe, pv); - _2.fd = function qv(a) { - return this.a.fd(a); - }; - sfb(xve, "Lists/1", 1034); - feb(441, 56, { 441: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1 }, uv); - _2.bd = function vv(a, b) { - this.a.bd(tv(this, a), b); - }; - _2.$b = function wv() { - this.a.$b(); - }; - _2.Xb = function xv(a) { - return this.a.Xb(sv(this, a)); - }; - _2.Kc = function yv() { - return rv(this, 0); - }; - _2.fd = function zv(a) { - return rv(this, a); - }; - _2.gd = function Av(a) { - return this.a.gd(sv(this, a)); - }; - _2.ce = function Bv(a, b) { - (Tb(a, b, this.a.gc()), hv(this.a.kd(tv(this, b), tv(this, a)))).$b(); - }; - _2.hd = function Cv(a, b) { - return this.a.hd(sv(this, a), b); - }; - _2.gc = function Dv() { - return this.a.gc(); - }; - _2.kd = function Ev(a, b) { - return Tb(a, b, this.a.gc()), hv(this.a.kd(tv(this, b), tv(this, a))); - }; - sfb(xve, "Lists/ReverseList", 441); - feb(1030, 441, { 441: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 59: 1 }, Fv); - sfb(xve, "Lists/RandomAccessReverseList", 1030); - feb(1033, 1, Jve, Gv); - _2.Nb = function Iv(a) { - Ztb(this, a); - }; - _2.Rb = function Hv(a) { - this.c.Rb(a); - this.c.Ub(); - this.a = false; - }; - _2.Ob = function Jv() { - return this.c.Sb(); - }; - _2.Sb = function Kv() { - return this.c.Ob(); - }; - _2.Pb = function Lv() { - if (!this.c.Sb()) { - throw Adb(new Dvb()); - } - this.a = true; - return this.c.Ub(); - }; - _2.Tb = function Mv() { - return tv(this.b, this.c.Tb()); - }; - _2.Ub = function Nv() { - if (!this.c.Ob()) { - throw Adb(new Dvb()); - } - this.a = true; - return this.c.Pb(); - }; - _2.Vb = function Ov() { - return tv(this.b, this.c.Tb()) - 1; - }; - _2.Qb = function Pv() { - Vb(this.a); - this.c.Qb(); - this.a = false; - }; - _2.Wb = function Qv(a) { - Ub(this.a); - this.c.Wb(a); - }; - _2.a = false; - sfb(xve, "Lists/ReverseList/1", 1033); - feb(440, 497, Ave, aw); - _2.$d = function bw(a) { - return _v(a); - }; - sfb(xve, "Maps/1", 440); - feb(712, 497, Ave, cw); - _2.$d = function dw(a) { - return RD(a, 44).md(); - }; - sfb(xve, "Maps/2", 712); - feb(975, 497, Ave, ew); - _2.$d = function fw(a) { - return new gp(a, Mw(this.a, a)); - }; - sfb(xve, "Maps/3", 975); - feb(972, 2069, Fve, gw); - _2.Jc = function hw(a) { - uj(this.a, a); - }; - _2.Kc = function iw() { - return this.a.kc(); - }; - _2.Rc = function jw() { - return this.a; - }; - _2.Nc = function kw() { - return this.a.lc(); - }; - sfb(xve, "Maps/IteratorBasedAbstractMap/1", 972); - feb(973, 1, {}, lw); - _2.Yd = function mw(a, b) { - this.a.Cd(a); - }; - sfb(xve, "Maps/KeySet/lambda$0$Type", 973); - feb(971, 31, Dve, nw); - _2.$b = function ow() { - this.a.$b(); - }; - _2.Hc = function pw(a) { - return this.a.uc(a); - }; - _2.Jc = function qw(a) { - Qb(a); - this.a.wc(new vw(a)); - }; - _2.dc = function rw() { - return this.a.dc(); - }; - _2.Kc = function sw() { - return new cw(this.a.vc().Kc()); - }; - _2.Mc = function tw(b) { - var c2, d; - try { - return ze(this, b, true); - } catch (a) { - a = zdb(a); - if (ZD(a, 48)) { - for (d = this.a.vc().Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 44); - if (Hb(b, c2.md())) { - this.a.Bc(c2.ld()); - return true; - } - } - return false; - } else - throw Adb(a); - } - }; - _2.gc = function uw() { - return this.a.gc(); - }; - sfb(xve, "Maps/Values", 971); - feb(974, 1, {}, vw); - _2.Yd = function ww(a, b) { - this.a.Cd(b); - }; - sfb(xve, "Maps/Values/lambda$0$Type", 974); - feb(752, 2085, Cve, zw); - _2.xc = function Dw(a) { - return this.a._b(a) ? this.a.cc(a) : null; - }; - _2.Bc = function Gw(a) { - return this.a._b(a) ? this.a.fc(a) : null; - }; - _2.$b = function Aw() { - this.a.$b(); - }; - _2._b = function Bw(a) { - return this.a._b(a); - }; - _2.Ec = function Cw() { - return new Iw(this); - }; - _2.Dc = function() { - return this.Ec(); - }; - _2.dc = function Ew() { - return this.a.dc(); - }; - _2.ec = function Fw() { - return this.a.ec(); - }; - _2.gc = function Hw() { - return this.a.ec().gc(); - }; - sfb(xve, "Multimaps/AsMap", 752); - feb(1134, 2069, Fve, Iw); - _2.Kc = function Jw() { - return Rv(this.a.a.ec(), new Nw(this)); - }; - _2.Rc = function Kw() { - return this.a; - }; - _2.Mc = function Lw(a) { - var b; - if (!Ze(this, a)) { - return false; - } - b = RD(Hvb(RD(a, 44)), 44); - yw(this.a, b.ld()); - return true; - }; - sfb(xve, "Multimaps/AsMap/EntrySet", 1134); - feb(1138, 1, {}, Nw); - _2.Kb = function Ow(a) { - return Mw(this, a); - }; - _2.Fb = function Pw(a) { - return this === a; - }; - sfb(xve, "Multimaps/AsMap/EntrySet/1", 1138); - feb(552, 2087, { 552: 1, 849: 1, 20: 1, 31: 1, 16: 1 }, Sw); - _2.$b = function Tw() { - Nc(this.a); - }; - _2.Hc = function Uw(a) { - return Oc(this.a, a); - }; - _2.Jc = function Vw(a) { - Qb(a); - xgb(Pc(this.a), new fx(a)); - }; - _2.Kc = function Ww() { - return new aw(Pc(this.a).a.kc()); - }; - _2.gc = function Xw() { - return this.a.d; - }; - _2.Nc = function Yw() { - return gk(Pc(this.a).Nc(), new Zw()); - }; - sfb(xve, "Multimaps/Keys", 552); - feb(1136, 1, {}, Zw); - _2.Kb = function $w(a) { - return RD(a, 44).ld(); - }; - sfb(xve, "Multimaps/Keys/0methodref$getKey$Type", 1136); - feb(1135, 497, Ave, _w); - _2.$d = function ax(a) { - return new ex(RD(a, 44)); - }; - sfb(xve, "Multimaps/Keys/1", 1135); - feb(2088, 1, { 425: 1 }); - _2.Fb = function bx(a) { - var b; - if (ZD(a, 504)) { - b = RD(a, 425); - return RD(this.a.md(), 16).gc() == RD(b.a.md(), 16).gc() && Hb(this.a.ld(), b.a.ld()); - } - return false; - }; - _2.Hb = function cx() { - var a; - a = this.a.ld(); - return (a == null ? 0 : tb(a)) ^ RD(this.a.md(), 16).gc(); - }; - _2.Ib = function dx() { - var a, b; - b = Ghb(this.a.ld()); - a = RD(this.a.md(), 16).gc(); - return a == 1 ? b : b + " x " + a; - }; - sfb(xve, "Multisets/AbstractEntry", 2088); - feb(504, 2088, { 504: 1, 425: 1 }, ex); - sfb(xve, "Multimaps/Keys/1/1", 504); - feb(1137, 1, Qve, fx); - _2.Cd = function gx(a) { - this.a.Cd(RD(a, 44).ld()); - }; - sfb(xve, "Multimaps/Keys/lambda$1$Type", 1137); - feb(1140, 1, Qve, jx); - _2.Cd = function kx(a) { - hx(RD(a, 425)); - }; - sfb(xve, "Multiset/lambda$0$Type", 1140); - feb(753, 1, Qve, lx); - _2.Cd = function mx(a) { - ix(this.a, RD(a, 425)); - }; - sfb(xve, "Multiset/lambda$1$Type", 753); - feb(1141, 1, {}, rx); - sfb(xve, "Multisets/0methodref$add$Type", 1141); - feb(754, 1, {}, sx); - _2.Kb = function tx(a) { - return px(RD(a, 425)); - }; - sfb(xve, "Multisets/lambda$1$Type", 754); - feb(2106, 1, nve); - sfb(xve, "RangeGwtSerializationDependencies", 2106); - feb(521, 2106, { 178: 1, 521: 1, 3: 1, 46: 1 }, wx); - _2.Lb = function xx(a) { - return vx(this, RD(a, 34)); - }; - _2.Mb = function Bx(a) { - return vx(this, RD(a, 34)); - }; - _2.Fb = function zx(a) { - var b; - if (ZD(a, 521)) { - b = RD(a, 521); - return Pk(this.a, b.a) && Pk(this.b, b.b); - } - return false; - }; - _2.Hb = function Ax() { - return this.a.Hb() * 31 + this.b.Hb(); - }; - _2.Ib = function Cx() { - return Dx(this.a, this.b); - }; - sfb(xve, "Range", 521); - feb(654, 2097, Yve, Fx); - _2.fd = function Jx(a) { - return um(this.b, a); - }; - _2.Zd = function Gx() { - return this.a; - }; - _2.Xb = function Hx(a) { - return Qm(this.b, a); - }; - _2.Pd = function Ix(a) { - return um(this.b, a); - }; - sfb(xve, "RegularImmutableAsList", 654); - feb(656, 2105, Yve, Kx); - _2.Rd = function Lx() { - return this.a; - }; - sfb(xve, "RegularImmutableList", 656); - feb(548, 730, $ve, Mx, Nx); - sfb(xve, "RegularImmutableMap", 548); - feb(731, 719, awe, Qx); - var Ox; - sfb(xve, "RegularImmutableSet", 731); - feb(2074, Eve, Fve); - _2.Kc = function by() { - return new oy(this.a, this.b); - }; - _2.Fc = function $x(a) { - throw Adb(new jib()); - }; - _2.Gc = function _x(a) { - throw Adb(new jib()); - }; - _2.$b = function ay() { - throw Adb(new jib()); - }; - _2.Mc = function cy(a) { - throw Adb(new jib()); - }; - sfb(xve, "Sets/SetView", 2074); - feb(976, 2074, Fve, ey); - _2.Kc = function iy() { - return new oy(this.a, this.b); - }; - _2.Hc = function fy(a) { - return Bsb(this.a, a) && this.b.Hc(a); - }; - _2.Ic = function gy(a) { - return Be(this.a, a) && this.b.Ic(a); - }; - _2.dc = function hy() { - return Aob(this.b, this.a); - }; - _2.Lc = function jy() { - return CDb(new SDb(null, new Swb(this.a, 1)), new qy(this.b)); - }; - _2.gc = function ky() { - return dy(this); - }; - _2.Oc = function ly() { - return CDb(new SDb(null, new Swb(this.a, 1)), new my(this.b)); - }; - sfb(xve, "Sets/2", 976); - feb(977, 1, nwe, my); - _2.Mb = function ny(a) { - return this.a.Hc(a); - }; - sfb(xve, "Sets/2/0methodref$contains$Type", 977); - feb(714, 713, wve, oy); - _2.Yb = function py() { - var a; - while (Msb(this.a)) { - a = Nsb(this.a); - if (this.c.Hc(a)) { - return a; - } - } - return this.e = 2, null; - }; - sfb(xve, "Sets/2/1", 714); - feb(978, 1, nwe, qy); - _2.Mb = function ry(a) { - return this.a.Hc(a); - }; - sfb(xve, "Sets/2/1methodref$contains$Type", 978); - feb(616, 2073, { 616: 1, 3: 1, 20: 1, 16: 1, 277: 1, 21: 1, 87: 1 }, sy); - _2.Kd = function ty() { - return this.b; - }; - _2.Ld = function uy() { - return this.b; - }; - _2.Wd = function vy() { - return this.b; - }; - _2.Jc = function wy(a) { - this.a.Jc(a); - }; - _2.Lc = function xy() { - return this.a.Lc(); - }; - _2.Oc = function yy() { - return this.a.Oc(); - }; - sfb(xve, "Sets/UnmodifiableNavigableSet", 616); - feb(2031, 2030, $ve, zy); - _2.Vd = function Ay() { - return _l(), new Fy(this.a); - }; - _2.Cc = function By() { - return _l(), new Fy(this.a); - }; - _2.xd = function Cy() { - return _l(), new Fy(this.a); - }; - sfb(xve, "SingletonImmutableBiMap", 2031); - feb(657, 2105, Yve, Dy); - _2.Rd = function Ey() { - return this.a; - }; - sfb(xve, "SingletonImmutableList", 657); - feb(363, 2079, awe, Fy); - _2.Kc = function Iy() { - return new $r(this.a); - }; - _2.Hc = function Gy(a) { - return pb(this.a, a); - }; - _2.Od = function Hy() { - return new $r(this.a); - }; - _2.gc = function Jy() { - return 1; - }; - sfb(xve, "SingletonImmutableSet", 363); - feb(1148, 1, {}, My); - _2.Kb = function Ny(a) { - return RD(a, 159); - }; - sfb(xve, "Streams/lambda$0$Type", 1148); - feb(1149, 1, owe, Oy); - _2.de = function Py() { - Ky(this.a); - }; - sfb(xve, "Streams/lambda$1$Type", 1149); - feb(1725, 1724, zve, Ry); - _2.Zb = function Sy() { - var a; - return a = this.f, RD(RD(!a ? this.f = ZD(this.c, 139) ? new Uf(this, RD(this.c, 139)) : ZD(this.c, 133) ? new Mf(this, RD(this.c, 133)) : new ne(this, this.c) : a, 133), 139); - }; - _2.hc = function Vy() { - return new yAb(this.b); - }; - _2.pd = function Wy() { - return new yAb(this.b); - }; - _2.ec = function Yy() { - var a; - return a = this.i, RD(RD(!a ? this.i = ZD(this.c, 139) ? new gg(this, RD(this.c, 139)) : ZD(this.c, 133) ? new eg(this, RD(this.c, 133)) : new zf(this, this.c) : a, 87), 277); - }; - _2.ac = function Uy() { - return ZD(this.c, 139) ? new Uf(this, RD(this.c, 139)) : ZD(this.c, 133) ? new Mf(this, RD(this.c, 133)) : new ne(this, this.c); - }; - _2.ic = function Xy(a) { - a == null && this.a.Ne(a, a); - return new yAb(this.b); - }; - sfb(xve, "TreeMultimap", 1725); - feb(82, 1, { 3: 1, 82: 1 }); - _2.ee = function pz(a) { - return new Error(a); - }; - _2.fe = function rz() { - return this.e; - }; - _2.ge = function sz() { - var a, b, c2; - c2 = (this.k == null && (this.k = $C(rJ, Nve, 82, 0, 0, 1)), this.k); - b = $C(jJ, rve, 1, c2.length, 5, 1); - for (a = 0; a < c2.length; a++) { - b[a] = c2[a].e; - } - return b; - }; - _2.he = function tz() { - return this.f; - }; - _2.ie = function uz() { - return this.g; - }; - _2.je = function vz() { - kz(this, qz(this.ee(lz(this, this.g)))); - gA(this); - }; - _2.Ib = function wz() { - return lz(this, this.ie()); - }; - _2.e = rwe; - _2.i = false; - _2.n = true; - var rJ = sfb(mve, "Throwable", 82); - feb(103, 82, { 3: 1, 103: 1, 82: 1 }); - sfb(mve, "Exception", 103); - feb(63, 103, swe, xz, yz); - sfb(mve, "RuntimeException", 63); - feb(607, 63, swe); - sfb(mve, "JsException", 607); - feb(875, 607, swe); - sfb(twe, "JavaScriptExceptionBase", 875); - feb(486, 875, { 486: 1, 3: 1, 103: 1, 63: 1, 82: 1 }, Cz); - _2.ie = function Fz() { - Bz(this); - return this.c; - }; - _2.ke = function Gz() { - return dE(this.b) === dE(zz) ? null : this.b; - }; - var zz; - sfb(vwe, "JavaScriptException", 486); - var hI = sfb(vwe, "JavaScriptObject$", 0); - var Jz; - feb(2047, 1, {}); - sfb(vwe, "Scheduler", 2047); - var Nz = 0, Oz = 0, Pz = -1; - feb(902, 2047, {}, bA); - var Zz; - sfb(twe, "SchedulerImpl", 902); - var eA; - feb(2058, 1, {}); - sfb(twe, "StackTraceCreator/Collector", 2058); - feb(876, 2058, {}, mA); - _2.le = function nA(a) { - var b = {}; - var c2 = []; - a[xwe] = c2; - var d = arguments.callee.caller; - while (d) { - var e = (fA(), d.name || (d.name = iA(d.toString()))); - c2.push(e); - var f2 = ":" + e; - var g = b[f2]; - if (g) { - var h, i2; - for (h = 0, i2 = g.length; h < i2; h++) { - if (g[h] === d) { - return; - } - } - } - (g || (b[f2] = [])).push(d); - d = d.caller; - } - }; - _2.me = function oA(a) { - var b, c2, d, e; - d = (fA(), a && a[xwe] ? a[xwe] : []); - c2 = d.length; - e = $C(mJ, Nve, 319, c2, 0, 1); - for (b = 0; b < c2; b++) { - e[b] = new ehb(d[b], null, -1); - } - return e; - }; - sfb(twe, "StackTraceCreator/CollectorLegacy", 876); - feb(2059, 2058, {}); - _2.le = function qA(a) { - }; - _2.ne = function rA(a, b, c2, d) { - return new ehb(b, a + "@" + d, c2 < 0 ? -1 : c2); - }; - _2.me = function sA(a) { - var b, c2, d, e, f2, g; - e = kA(a); - f2 = $C(mJ, Nve, 319, 0, 0, 1); - b = 0; - d = e.length; - if (d == 0) { - return f2; - } - g = pA(this, e[0]); - lhb(g.d, wwe) || (f2[b++] = g); - for (c2 = 1; c2 < d; c2++) { - f2[b++] = pA(this, e[c2]); - } - return f2; - }; - sfb(twe, "StackTraceCreator/CollectorModern", 2059); - feb(877, 2059, {}, tA); - _2.ne = function uA(a, b, c2, d) { - return new ehb(b, a, -1); - }; - sfb(twe, "StackTraceCreator/CollectorModernNoSourceMap", 877); - feb(1064, 1, {}); - sfb(Zwe, $we, 1064); - feb(624, 1064, { 624: 1 }, XA); - var VA; - sfb(_we, $we, 624); - feb(2101, 1, {}); - sfb(Zwe, axe, 2101); - feb(2102, 2101, {}); - sfb(_we, axe, 2102); - feb(1120, 1, {}, aB); - var ZA; - sfb(_we, "LocaleInfo", 1120); - feb(2027, 1, {}, dB); - _2.a = 0; - sfb(_we, "TimeZone", 2027); - feb(1293, 2102, {}, jB); - sfb("com.google.gwt.i18n.client.impl.cldr", "DateTimeFormatInfoImpl", 1293); - feb(443, 1, { 443: 1 }, kB); - _2.a = false; - _2.b = 0; - sfb(Zwe, "DateTimeFormat/PatternPart", 443); - feb(206, 1, bxe, uB, vB, wB); - _2.Fd = function xB(a) { - return lB(this, RD(a, 206)); - }; - _2.Fb = function yB(a) { - return ZD(a, 206) && Gdb(Hdb(this.q.getTime()), Hdb(RD(a, 206).q.getTime())); - }; - _2.Hb = function zB() { - var a; - a = Hdb(this.q.getTime()); - return Ydb($db(a, Udb(a, 32))); - }; - _2.Ib = function BB() { - var a, b, c2; - c2 = -this.q.getTimezoneOffset(); - a = (c2 >= 0 ? "+" : "") + (c2 / 60 | 0); - b = AB($wnd.Math.abs(c2) % 60); - return (Mrb(), Krb)[this.q.getDay()] + " " + Lrb[this.q.getMonth()] + " " + AB(this.q.getDate()) + " " + AB(this.q.getHours()) + ":" + AB(this.q.getMinutes()) + ":" + AB(this.q.getSeconds()) + " GMT" + a + b + " " + this.q.getFullYear(); - }; - var qK = sfb(Bve, "Date", 206); - feb(2015, 206, bxe, DB); - _2.a = false; - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.e = 0; - _2.f = 0; - _2.g = false; - _2.i = 0; - _2.j = 0; - _2.k = 0; - _2.n = 0; - _2.o = 0; - _2.p = 0; - sfb("com.google.gwt.i18n.shared.impl", "DateRecord", 2015); - feb(2064, 1, {}); - _2.pe = function EB() { - return null; - }; - _2.qe = function FB() { - return null; - }; - _2.re = function GB() { - return null; - }; - _2.se = function HB() { - return null; - }; - _2.te = function IB() { - return null; - }; - sfb(cxe, "JSONValue", 2064); - feb(221, 2064, { 221: 1 }, MB, NB); - _2.Fb = function OB(a) { - if (!ZD(a, 221)) { - return false; - } - return Hz(this.a, RD(a, 221).a); - }; - _2.oe = function PB() { - return TB; - }; - _2.Hb = function QB() { - return Iz(this.a); - }; - _2.pe = function RB() { - return this; - }; - _2.Ib = function SB() { - var a, b, c2; - c2 = new dib("["); - for (b = 0, a = this.a.length; b < a; b++) { - b > 0 && (c2.a += ",", c2); - Yhb(c2, JB(this, b)); - } - c2.a += "]"; - return c2.a; - }; - sfb(cxe, "JSONArray", 221); - feb(493, 2064, { 493: 1 }, XB); - _2.oe = function YB() { - return _B; - }; - _2.qe = function ZB() { - return this; - }; - _2.Ib = function $B() { - return Geb(), "" + this.a; - }; - _2.a = false; - var UB, VB; - sfb(cxe, "JSONBoolean", 493); - feb(997, 63, swe, aC); - sfb(cxe, "JSONException", 997); - feb(1036, 2064, {}, dC); - _2.oe = function eC() { - return gC; - }; - _2.Ib = function fC() { - return vve; - }; - var bC; - sfb(cxe, "JSONNull", 1036); - feb(263, 2064, { 263: 1 }, hC); - _2.Fb = function iC(a) { - if (!ZD(a, 263)) { - return false; - } - return this.a == RD(a, 263).a; - }; - _2.oe = function jC() { - return nC; - }; - _2.Hb = function kC() { - return Nfb(this.a); - }; - _2.re = function lC() { - return this; - }; - _2.Ib = function mC() { - return this.a + ""; - }; - _2.a = 0; - sfb(cxe, "JSONNumber", 263); - feb(190, 2064, { 190: 1 }, uC, vC); - _2.Fb = function wC(a) { - if (!ZD(a, 190)) { - return false; - } - return Hz(this.a, RD(a, 190).a); - }; - _2.oe = function xC() { - return BC; - }; - _2.Hb = function yC() { - return Iz(this.a); - }; - _2.se = function zC() { - return this; - }; - _2.Ib = function AC() { - var a, b, c2, d, e, f2, g; - g = new dib("{"); - a = true; - f2 = oC(this, $C(qJ, Nve, 2, 0, 6, 1)); - for (c2 = f2, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - a ? a = false : (g.a += pve, g); - Zhb(g, Lz(b)); - g.a += ":"; - Yhb(g, qC(this, b)); - } - g.a += "}"; - return g.a; - }; - sfb(cxe, "JSONObject", 190); - feb(605, Eve, Fve, CC); - _2.Hc = function DC(a) { - return bE(a) && pC(this.a, WD(a)); - }; - _2.Kc = function EC() { - return new Dkb(new mob(this.b)); - }; - _2.gc = function FC() { - return this.b.length; - }; - sfb(cxe, "JSONObject/1", 605); - var GC; - feb(211, 2064, { 211: 1 }, OC); - _2.Fb = function PC(a) { - if (!ZD(a, 211)) { - return false; - } - return lhb(this.a, RD(a, 211).a); - }; - _2.oe = function QC() { - return UC; - }; - _2.Hb = function RC() { - return ohb(this.a); - }; - _2.te = function SC() { - return this; - }; - _2.Ib = function TC() { - return Lz(this.a); - }; - sfb(cxe, "JSONString", 211); - var eD; - var ID, JD, KD, LD; - feb(2060, 1, { 533: 1 }); - sfb(kxe, "OutputStream", 2060); - feb(2061, 2060, { 533: 1 }); - sfb(kxe, "FilterOutputStream", 2061); - feb(878, 2061, { 533: 1 }, oeb); - sfb(kxe, "PrintStream", 878); - feb(427, 1, { 484: 1 }); - _2.Ib = function seb() { - return this.a; - }; - sfb(mve, "AbstractStringBuilder", 427); - feb(538, 63, swe, teb); - sfb(mve, "ArithmeticException", 538); - feb(77, 63, lxe, ueb, veb); - sfb(mve, "IndexOutOfBoundsException", 77); - feb(333, 77, { 3: 1, 333: 1, 103: 1, 77: 1, 63: 1, 82: 1 }, web, xeb); - sfb(mve, "ArrayIndexOutOfBoundsException", 333); - feb(537, 63, swe, yeb, zeb); - sfb(mve, "ArrayStoreException", 537); - feb(296, 82, mxe, Aeb); - sfb(mve, "Error", 296); - feb(200, 296, mxe, Ceb, Deb); - sfb(mve, "AssertionError", 200); - ND = { 3: 1, 485: 1, 34: 1 }; - var Eeb, Feb; - var QI = sfb(mve, "Boolean", 485); - feb(242, 1, { 3: 1, 242: 1 }); - var Meb; - sfb(mve, "Number", 242); - feb(222, 242, { 3: 1, 222: 1, 34: 1, 242: 1 }, Seb); - _2.Fd = function Teb(a) { - return Reb(this, RD(a, 222)); - }; - _2.ue = function Ueb() { - return this.a; - }; - _2.Fb = function Veb(a) { - return ZD(a, 222) && RD(a, 222).a == this.a; - }; - _2.Hb = function Web() { - return this.a; - }; - _2.Ib = function Xeb() { - return "" + this.a; - }; - _2.a = 0; - var RI = sfb(mve, "Byte", 222); - var Yeb; - feb(180, 1, { 3: 1, 180: 1, 34: 1 }, bfb); - _2.Fd = function cfb(a) { - return afb(this, RD(a, 180)); - }; - _2.Fb = function efb(a) { - return ZD(a, 180) && RD(a, 180).a == this.a; - }; - _2.Hb = function ffb() { - return this.a; - }; - _2.Ib = function gfb() { - return String.fromCharCode(this.a); - }; - _2.a = 0; - var _eb; - var SI = sfb(mve, "Character", 180); - var ifb; - feb(212, 63, { 3: 1, 212: 1, 103: 1, 63: 1, 82: 1 }, Hfb, Ifb); - sfb(mve, "ClassCastException", 212); - OD = { 3: 1, 34: 1, 345: 1, 242: 1 }; - var VI = sfb(mve, "Double", 345); - feb(161, 242, { 3: 1, 34: 1, 161: 1, 242: 1 }, Tfb, Ufb); - _2.Fd = function Vfb(a) { - return Sfb(this, RD(a, 161)); - }; - _2.ue = function Wfb() { - return this.a; - }; - _2.Fb = function Xfb(a) { - return ZD(a, 161) && Lfb(this.a, RD(a, 161).a); - }; - _2.Hb = function Yfb() { - return eE(this.a); - }; - _2.Ib = function $fb() { - return "" + this.a; - }; - _2.a = 0; - var ZI = sfb(mve, "Float", 161); - feb(33, 63, { 3: 1, 103: 1, 33: 1, 63: 1, 82: 1 }, _fb, agb, bgb); - sfb(mve, "IllegalArgumentException", 33); - feb(73, 63, swe, cgb, dgb); - sfb(mve, "IllegalStateException", 73); - feb(17, 242, { 3: 1, 34: 1, 17: 1, 242: 1 }, fgb); - _2.Fd = function igb(a) { - return egb(this, RD(a, 17)); - }; - _2.ue = function jgb() { - return this.a; - }; - _2.Fb = function kgb(a) { - return ZD(a, 17) && RD(a, 17).a == this.a; - }; - _2.Hb = function lgb() { - return this.a; - }; - _2.Ib = function rgb2() { - return "" + this.a; - }; - _2.a = 0; - var bJ = sfb(mve, "Integer", 17); - var tgb; - var vgb; - feb(168, 242, { 3: 1, 34: 1, 168: 1, 242: 1 }, zgb); - _2.Fd = function Bgb(a) { - return ygb(this, RD(a, 168)); - }; - _2.ue = function Cgb() { - return Xdb(this.a); - }; - _2.Fb = function Dgb(a) { - return ZD(a, 168) && Gdb(RD(a, 168).a, this.a); - }; - _2.Hb = function Egb() { - return Fgb(this.a); - }; - _2.Ib = function Ggb() { - return "" + Zdb(this.a); - }; - _2.a = 0; - var eJ = sfb(mve, "Long", 168); - var Igb; - feb(2140, 1, {}); - feb(1904, 63, swe, Mgb); - sfb(mve, "NegativeArraySizeException", 1904); - feb(169, 607, { 3: 1, 103: 1, 169: 1, 63: 1, 82: 1 }, Ngb, Ogb); - _2.ee = function Pgb(a) { - return new TypeError(a); - }; - sfb(mve, "NullPointerException", 169); - var Qgb, Rgb2, Sgb, Tgb; - feb(130, 33, { 3: 1, 103: 1, 33: 1, 130: 1, 63: 1, 82: 1 }, Vgb); - sfb(mve, "NumberFormatException", 130); - feb(191, 242, { 3: 1, 34: 1, 242: 1, 191: 1 }, Xgb); - _2.Fd = function Ygb(a) { - return Wgb(this, RD(a, 191)); - }; - _2.ue = function Zgb() { - return this.a; - }; - _2.Fb = function $gb(a) { - return ZD(a, 191) && RD(a, 191).a == this.a; - }; - _2.Hb = function _gb() { - return this.a; - }; - _2.Ib = function ahb() { - return "" + this.a; - }; - _2.a = 0; - var lJ = sfb(mve, "Short", 191); - var chb; - feb(319, 1, { 3: 1, 319: 1 }, ehb); - _2.Fb = function fhb(a) { - var b; - if (ZD(a, 319)) { - b = RD(a, 319); - return this.c == b.c && this.d == b.d && this.a == b.a && this.b == b.b; - } - return false; - }; - _2.Hb = function ghb() { - return Tnb(cD(WC(jJ, 1), rve, 1, 5, [sgb(this.c), this.a, this.d, this.b])); - }; - _2.Ib = function hhb() { - return this.a + "." + this.d + "(" + (this.b != null ? this.b : "Unknown Source") + (this.c >= 0 ? ":" + this.c : "") + ")"; - }; - _2.c = 0; - var mJ = sfb(mve, "StackTraceElement", 319); - PD = { 3: 1, 484: 1, 34: 1, 2: 1 }; - var qJ = sfb(mve, uwe, 2); - feb(111, 427, { 484: 1 }, Qhb, Rhb, Shb); - sfb(mve, "StringBuffer", 111); - feb(104, 427, { 484: 1 }, bib, cib, dib); - sfb(mve, "StringBuilder", 104); - feb(702, 77, lxe, eib); - sfb(mve, "StringIndexOutOfBoundsException", 702); - feb(2145, 1, {}); - var fib; - feb(48, 63, { 3: 1, 103: 1, 63: 1, 82: 1, 48: 1 }, jib, kib); - sfb(mve, "UnsupportedOperationException", 48); - feb(247, 242, { 3: 1, 34: 1, 242: 1, 247: 1 }, Aib, Bib); - _2.Fd = function Eib(a) { - return uib(this, RD(a, 247)); - }; - _2.ue = function Fib() { - return Neb(zib(this)); - }; - _2.Fb = function Gib(a) { - var b; - if (this === a) { - return true; - } - if (ZD(a, 247)) { - b = RD(a, 247); - return this.e == b.e && uib(this, b) == 0; - } - return false; - }; - _2.Hb = function Hib() { - var a; - if (this.b != 0) { - return this.b; - } - if (this.a < 54) { - a = Hdb(this.f); - this.b = Ydb(Cdb(a, -1)); - this.b = 33 * this.b + Ydb(Cdb(Tdb(a, 32), -1)); - this.b = 17 * this.b + eE(this.e); - return this.b; - } - this.b = 17 * Vib(this.c) + eE(this.e); - return this.b; - }; - _2.Ib = function Iib() { - return zib(this); - }; - _2.a = 0; - _2.b = 0; - _2.d = 0; - _2.e = 0; - _2.f = 0; - var lib, mib, nib, oib, pib, qib, rib, sib; - var tJ = sfb("java.math", "BigDecimal", 247); - feb(92, 242, { 3: 1, 34: 1, 242: 1, 92: 1 }, ajb, bjb, cjb, djb, ejb); - _2.Fd = function gjb(a) { - return Qib(this, RD(a, 92)); - }; - _2.ue = function hjb() { - return Neb(Ajb(this, 0)); - }; - _2.Fb = function ijb(a) { - return Sib(this, a); - }; - _2.Hb = function ljb() { - return Vib(this); - }; - _2.Ib = function njb() { - return Ajb(this, 0); - }; - _2.b = -2; - _2.c = 0; - _2.d = 0; - _2.e = 0; - var Jib, Kib, Lib, Mib, Nib, Oib; - var uJ = sfb("java.math", "BigInteger", 92); - var vjb, wjb; - var Jjb, Kjb; - feb(498, 2065, Cve); - _2.$b = function dkb() { - akb(this); - }; - _2._b = function ekb(a) { - return Ujb(this, a); - }; - _2.uc = function fkb(a) { - return Vjb(this, a, this.i) || Vjb(this, a, this.f); - }; - _2.vc = function gkb() { - return new mkb(this); - }; - _2.xc = function hkb(a) { - return Wjb(this, a); - }; - _2.zc = function ikb(a, b) { - return Zjb(this, a, b); - }; - _2.Bc = function jkb(a) { - return _jb(this, a); - }; - _2.gc = function kkb() { - return bkb(this); - }; - _2.g = 0; - sfb(Bve, "AbstractHashMap", 498); - feb(267, Eve, Fve, mkb); - _2.$b = function nkb() { - this.a.$b(); - }; - _2.Hc = function okb(a) { - return lkb(this, a); - }; - _2.Kc = function pkb() { - return new vkb(this.a); - }; - _2.Mc = function qkb(a) { - var b; - if (lkb(this, a)) { - b = RD(a, 44).ld(); - this.a.Bc(b); - return true; - } - return false; - }; - _2.gc = function rkb() { - return this.a.gc(); - }; - sfb(Bve, "AbstractHashMap/EntrySet", 267); - feb(268, 1, Ave, vkb); - _2.Nb = function wkb(a) { - Ztb(this, a); - }; - _2.Pb = function ykb() { - return tkb(this); - }; - _2.Ob = function xkb() { - return this.b; - }; - _2.Qb = function zkb() { - ukb(this); - }; - _2.b = false; - _2.d = 0; - sfb(Bve, "AbstractHashMap/EntrySetIterator", 268); - feb(426, 1, Ave, Dkb); - _2.Nb = function Ekb(a) { - Ztb(this, a); - }; - _2.Ob = function Fkb() { - return Akb(this); - }; - _2.Pb = function Gkb() { - return Bkb(this); - }; - _2.Qb = function Hkb() { - Ckb(this); - }; - _2.b = 0; - _2.c = -1; - sfb(Bve, "AbstractList/IteratorImpl", 426); - feb(98, 426, Jve, Jkb); - _2.Qb = function Pkb() { - Ckb(this); - }; - _2.Rb = function Kkb(a) { - Ikb(this, a); - }; - _2.Sb = function Lkb() { - return this.b > 0; - }; - _2.Tb = function Mkb() { - return this.b; - }; - _2.Ub = function Nkb() { - return sFb(this.b > 0), this.a.Xb(this.c = --this.b); - }; - _2.Vb = function Okb() { - return this.b - 1; - }; - _2.Wb = function Qkb(a) { - yFb(this.c != -1); - this.a.hd(this.c, a); - }; - sfb(Bve, "AbstractList/ListIteratorImpl", 98); - feb(244, 56, kwe, Rkb); - _2.bd = function Skb(a, b) { - wFb(a, this.b); - this.c.bd(this.a + a, b); - ++this.b; - }; - _2.Xb = function Tkb(a) { - tFb(a, this.b); - return this.c.Xb(this.a + a); - }; - _2.gd = function Ukb(a) { - var b; - tFb(a, this.b); - b = this.c.gd(this.a + a); - --this.b; - return b; - }; - _2.hd = function Vkb(a, b) { - tFb(a, this.b); - return this.c.hd(this.a + a, b); - }; - _2.gc = function Wkb() { - return this.b; - }; - _2.a = 0; - _2.b = 0; - sfb(Bve, "AbstractList/SubList", 244); - feb(266, Eve, Fve, Xkb); - _2.$b = function Ykb() { - this.a.$b(); - }; - _2.Hc = function Zkb(a) { - return this.a._b(a); - }; - _2.Kc = function $kb() { - var a; - return a = this.a.vc().Kc(), new blb(a); - }; - _2.Mc = function _kb(a) { - if (this.a._b(a)) { - this.a.Bc(a); - return true; - } - return false; - }; - _2.gc = function alb() { - return this.a.gc(); - }; - sfb(Bve, "AbstractMap/1", 266); - feb(541, 1, Ave, blb); - _2.Nb = function clb(a) { - Ztb(this, a); - }; - _2.Ob = function dlb() { - return this.a.Ob(); - }; - _2.Pb = function elb() { - var a; - return a = RD(this.a.Pb(), 44), a.ld(); - }; - _2.Qb = function flb() { - this.a.Qb(); - }; - sfb(Bve, "AbstractMap/1/1", 541); - feb(231, 31, Dve, glb); - _2.$b = function hlb() { - this.a.$b(); - }; - _2.Hc = function ilb(a) { - return this.a.uc(a); - }; - _2.Kc = function jlb() { - var a; - return a = this.a.vc().Kc(), new llb(a); - }; - _2.gc = function klb() { - return this.a.gc(); - }; - sfb(Bve, "AbstractMap/2", 231); - feb(301, 1, Ave, llb); - _2.Nb = function mlb(a) { - Ztb(this, a); - }; - _2.Ob = function nlb() { - return this.a.Ob(); - }; - _2.Pb = function olb() { - var a; - return a = RD(this.a.Pb(), 44), a.md(); - }; - _2.Qb = function plb() { - this.a.Qb(); - }; - sfb(Bve, "AbstractMap/2/1", 301); - feb(494, 1, { 494: 1, 44: 1 }); - _2.Fb = function rlb(a) { - var b; - if (!ZD(a, 44)) { - return false; - } - b = RD(a, 44); - return Fvb(this.d, b.ld()) && Fvb(this.e, b.md()); - }; - _2.ld = function slb() { - return this.d; - }; - _2.md = function tlb() { - return this.e; - }; - _2.Hb = function ulb() { - return Gvb(this.d) ^ Gvb(this.e); - }; - _2.nd = function vlb(a) { - return qlb(this, a); - }; - _2.Ib = function wlb() { - return this.d + "=" + this.e; - }; - sfb(Bve, "AbstractMap/AbstractEntry", 494); - feb(397, 494, { 494: 1, 397: 1, 44: 1 }, xlb); - sfb(Bve, "AbstractMap/SimpleEntry", 397); - feb(2082, 1, Axe); - _2.Fb = function ylb(a) { - var b; - if (!ZD(a, 44)) { - return false; - } - b = RD(a, 44); - return Fvb(this.ld(), b.ld()) && Fvb(this.md(), b.md()); - }; - _2.Hb = function zlb() { - return Gvb(this.ld()) ^ Gvb(this.md()); - }; - _2.Ib = function Alb() { - return this.ld() + "=" + this.md(); - }; - sfb(Bve, Lve, 2082); - feb(2090, 2065, Gve); - _2.Xc = function Dlb(a) { - return Vd(this.Ee(a)); - }; - _2.tc = function Elb(a) { - return Blb(this, a); - }; - _2._b = function Flb(a) { - return Clb(this, a); - }; - _2.vc = function Glb() { - return new Plb(this); - }; - _2.Tc = function Hlb() { - return Klb(this.Ge()); - }; - _2.Yc = function Ilb(a) { - return Vd(this.He(a)); - }; - _2.xc = function Jlb(a) { - var b; - b = a; - return Wd(this.Fe(b)); - }; - _2.$c = function Llb(a) { - return Vd(this.Ie(a)); - }; - _2.ec = function Mlb() { - return new Ulb(this); - }; - _2.Vc = function Nlb() { - return Klb(this.Je()); - }; - _2._c = function Olb(a) { - return Vd(this.Ke(a)); - }; - sfb(Bve, "AbstractNavigableMap", 2090); - feb(629, Eve, Fve, Plb); - _2.Hc = function Qlb(a) { - return ZD(a, 44) && Blb(this.b, RD(a, 44)); - }; - _2.Kc = function Rlb() { - return this.b.De(); - }; - _2.Mc = function Slb(a) { - var b; - if (ZD(a, 44)) { - b = RD(a, 44); - return this.b.Le(b); - } - return false; - }; - _2.gc = function Tlb() { - return this.b.gc(); - }; - sfb(Bve, "AbstractNavigableMap/EntrySet", 629); - feb(1146, Eve, Ive, Ulb); - _2.Nc = function $lb() { - return new $wb(this); - }; - _2.$b = function Vlb() { - this.a.$b(); - }; - _2.Hc = function Wlb(a) { - return Clb(this.a, a); - }; - _2.Kc = function Xlb() { - var a; - a = this.a.vc().b.De(); - return new _lb(a); - }; - _2.Mc = function Ylb(a) { - if (Clb(this.a, a)) { - this.a.Bc(a); - return true; - } - return false; - }; - _2.gc = function Zlb() { - return this.a.gc(); - }; - sfb(Bve, "AbstractNavigableMap/NavigableKeySet", 1146); - feb(1147, 1, Ave, _lb); - _2.Nb = function amb(a) { - Ztb(this, a); - }; - _2.Ob = function bmb() { - return Akb(this.a.a); - }; - _2.Pb = function cmb() { - var a; - a = vzb(this.a); - return a.ld(); - }; - _2.Qb = function dmb() { - wzb(this.a); - }; - sfb(Bve, "AbstractNavigableMap/NavigableKeySet/1", 1147); - feb(2103, 31, Dve); - _2.Fc = function emb(a) { - return zFb(lwb(this, a), Bxe), true; - }; - _2.Gc = function fmb(a) { - uFb(a); - mFb(a != this, "Can't add a queue to itself"); - return ye(this, a); - }; - _2.$b = function gmb() { - while (mwb(this) != null) - ; - }; - sfb(Bve, "AbstractQueue", 2103); - feb(310, 31, { 4: 1, 20: 1, 31: 1, 16: 1 }, wmb, xmb); - _2.Fc = function ymb(a) { - return imb(this, a), true; - }; - _2.$b = function Amb() { - jmb(this); - }; - _2.Hc = function Bmb(a) { - return kmb(new Kmb(this), a); - }; - _2.dc = function Cmb() { - return nmb(this); - }; - _2.Kc = function Dmb() { - return new Kmb(this); - }; - _2.Mc = function Emb(a) { - return qmb(new Kmb(this), a); - }; - _2.gc = function Fmb() { - return this.c - this.b & this.a.length - 1; - }; - _2.Nc = function Gmb() { - return new Swb(this, 272); - }; - _2.Qc = function Hmb(a) { - var b; - b = this.c - this.b & this.a.length - 1; - a.length < b && (a = cFb(new Array(b), a)); - lmb(this, a, b); - a.length > b && bD(a, b, null); - return a; - }; - _2.b = 0; - _2.c = 0; - sfb(Bve, "ArrayDeque", 310); - feb(459, 1, Ave, Kmb); - _2.Nb = function Lmb(a) { - Ztb(this, a); - }; - _2.Ob = function Mmb() { - return this.a != this.b; - }; - _2.Pb = function Nmb() { - return Imb(this); - }; - _2.Qb = function Omb() { - Jmb(this); - }; - _2.a = 0; - _2.b = 0; - _2.c = -1; - sfb(Bve, "ArrayDeque/IteratorImpl", 459); - feb(13, 56, Cxe, bnb, cnb, dnb); - _2.bd = function enb(a, b) { - Qmb(this, a, b); - }; - _2.Fc = function fnb(a) { - return Rmb(this, a); - }; - _2.cd = function gnb(a, b) { - return Smb(this, a, b); - }; - _2.Gc = function hnb(a) { - return Tmb(this, a); - }; - _2.$b = function inb() { - aFb(this.c, 0); - }; - _2.Hc = function jnb(a) { - return Wmb(this, a, 0) != -1; - }; - _2.Jc = function knb(a) { - Umb(this, a); - }; - _2.Xb = function lnb(a) { - return Vmb(this, a); - }; - _2.dd = function mnb(a) { - return Wmb(this, a, 0); - }; - _2.dc = function nnb() { - return this.c.length == 0; - }; - _2.Kc = function onb() { - return new Anb(this); - }; - _2.gd = function pnb(a) { - return Xmb(this, a); - }; - _2.Mc = function qnb(a) { - return Ymb(this, a); - }; - _2.ce = function rnb(a, b) { - Zmb(this, a, b); - }; - _2.hd = function snb(a, b) { - return $mb(this, a, b); - }; - _2.gc = function tnb() { - return this.c.length; - }; - _2.jd = function unb(a) { - _mb(this, a); - }; - _2.Pc = function vnb() { - return UEb(this.c); - }; - _2.Qc = function wnb(a) { - return anb(this, a); - }; - var VJ = sfb(Bve, "ArrayList", 13); - feb(7, 1, Ave, Anb); - _2.Nb = function Bnb(a) { - Ztb(this, a); - }; - _2.Ob = function Cnb() { - return xnb(this); - }; - _2.Pb = function Dnb() { - return ynb(this); - }; - _2.Qb = function Enb() { - znb(this); - }; - _2.a = 0; - _2.b = -1; - sfb(Bve, "ArrayList/1", 7); - feb(2112, $wnd.Function, {}, iob); - _2.Me = function job(a, b) { - return Qfb(a, b); - }; - feb(151, 56, Dxe, mob); - _2.Hc = function nob(a) { - return St(this, a) != -1; - }; - _2.Jc = function oob(a) { - var b, c2, d, e; - uFb(a); - for (c2 = this.a, d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - a.Cd(b); - } - }; - _2.Xb = function pob(a) { - return kob(this, a); - }; - _2.hd = function qob(a, b) { - var c2; - c2 = (tFb(a, this.a.length), this.a[a]); - bD(this.a, a, b); - return c2; - }; - _2.gc = function rob() { - return this.a.length; - }; - _2.jd = function sob(a) { - Ynb(this.a, this.a.length, a); - }; - _2.Pc = function tob() { - return lob(this, $C(jJ, rve, 1, this.a.length, 5, 1)); - }; - _2.Qc = function uob(a) { - return lob(this, a); - }; - sfb(Bve, "Arrays/ArrayList", 151); - var vob, wob, xob; - feb(953, 56, Dxe, Job); - _2.Hc = function Kob(a) { - return false; - }; - _2.Xb = function Lob(a) { - return Iob(a); - }; - _2.Kc = function Mob() { - return yob(), Qob(), Pob; - }; - _2.ed = function Nob() { - return yob(), Qob(), Pob; - }; - _2.gc = function Oob() { - return 0; - }; - sfb(Bve, "Collections/EmptyList", 953); - feb(954, 1, Jve, Rob); - _2.Nb = function Tob(a) { - Ztb(this, a); - }; - _2.Rb = function Sob(a) { - throw Adb(new jib()); - }; - _2.Ob = function Uob() { - return false; - }; - _2.Sb = function Vob() { - return false; - }; - _2.Pb = function Wob() { - throw Adb(new Dvb()); - }; - _2.Tb = function Xob() { - return 0; - }; - _2.Ub = function Yob() { - throw Adb(new Dvb()); - }; - _2.Vb = function Zob() { - return -1; - }; - _2.Qb = function $ob() { - throw Adb(new cgb()); - }; - _2.Wb = function _ob(a) { - throw Adb(new cgb()); - }; - var Pob; - sfb(Bve, "Collections/EmptyListIterator", 954); - feb(956, 2065, $ve, apb); - _2._b = function bpb(a) { - return false; - }; - _2.uc = function cpb(a) { - return false; - }; - _2.vc = function dpb() { - return yob(), xob; - }; - _2.xc = function epb(a) { - return null; - }; - _2.ec = function fpb() { - return yob(), xob; - }; - _2.gc = function gpb() { - return 0; - }; - _2.Cc = function hpb() { - return yob(), vob; - }; - sfb(Bve, "Collections/EmptyMap", 956); - feb(955, Eve, awe, ipb); - _2.Hc = function jpb(a) { - return false; - }; - _2.Kc = function kpb() { - return yob(), Qob(), Pob; - }; - _2.gc = function lpb() { - return 0; - }; - sfb(Bve, "Collections/EmptySet", 955); - feb(608, 56, { 3: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1 }, mpb); - _2.Hc = function npb(a) { - return Fvb(this.a, a); - }; - _2.Xb = function opb(a) { - tFb(a, 1); - return this.a; - }; - _2.gc = function ppb() { - return 1; - }; - sfb(Bve, "Collections/SingletonList", 608); - feb(384, 1, Wve, xpb); - _2.Jc = function Dpb(a) { - xgb(this, a); - }; - _2.Lc = function Gpb() { - return new SDb(null, this.Nc()); - }; - _2.Nc = function Jpb() { - return new Swb(this, 0); - }; - _2.Oc = function Kpb() { - return new SDb(null, this.Nc()); - }; - _2.Fc = function ypb(a) { - return qpb(); - }; - _2.Gc = function zpb(a) { - return rpb(); - }; - _2.$b = function Apb() { - spb(); - }; - _2.Hc = function Bpb(a) { - return tpb(this, a); - }; - _2.Ic = function Cpb(a) { - return upb(this, a); - }; - _2.dc = function Epb() { - return this.b.dc(); - }; - _2.Kc = function Fpb() { - return new Ppb(this.b.Kc()); - }; - _2.Mc = function Hpb(a) { - return vpb(); - }; - _2.gc = function Ipb() { - return this.b.gc(); - }; - _2.Pc = function Lpb() { - return this.b.Pc(); - }; - _2.Qc = function Mpb(a) { - return wpb(this, a); - }; - _2.Ib = function Npb() { - return jeb(this.b); - }; - sfb(Bve, "Collections/UnmodifiableCollection", 384); - feb(383, 1, Ave, Ppb); - _2.Nb = function Qpb(a) { - Ztb(this, a); - }; - _2.Ob = function Rpb() { - return this.b.Ob(); - }; - _2.Pb = function Spb() { - return this.b.Pb(); - }; - _2.Qb = function Tpb() { - Opb(); - }; - sfb(Bve, "Collections/UnmodifiableCollectionIterator", 383); - feb(540, 384, Exe, Upb); - _2.Nc = function fqb() { - return new Swb(this, 16); - }; - _2.bd = function Vpb(a, b) { - throw Adb(new jib()); - }; - _2.cd = function Wpb(a, b) { - throw Adb(new jib()); - }; - _2.Fb = function Xpb(a) { - return pb(this.a, a); - }; - _2.Xb = function Ypb(a) { - return this.a.Xb(a); - }; - _2.Hb = function Zpb() { - return tb(this.a); - }; - _2.dd = function $pb(a) { - return this.a.dd(a); - }; - _2.dc = function _pb() { - return this.a.dc(); - }; - _2.ed = function aqb() { - return new hqb(this.a.fd(0)); - }; - _2.fd = function bqb(a) { - return new hqb(this.a.fd(a)); - }; - _2.gd = function cqb(a) { - throw Adb(new jib()); - }; - _2.hd = function dqb(a, b) { - throw Adb(new jib()); - }; - _2.jd = function eqb(a) { - throw Adb(new jib()); - }; - _2.kd = function gqb(a, b) { - return new Upb(this.a.kd(a, b)); - }; - sfb(Bve, "Collections/UnmodifiableList", 540); - feb(705, 383, Jve, hqb); - _2.Qb = function nqb() { - Opb(); - }; - _2.Rb = function iqb(a) { - throw Adb(new jib()); - }; - _2.Sb = function jqb() { - return this.a.Sb(); - }; - _2.Tb = function kqb() { - return this.a.Tb(); - }; - _2.Ub = function lqb() { - return this.a.Ub(); - }; - _2.Vb = function mqb() { - return this.a.Vb(); - }; - _2.Wb = function oqb(a) { - throw Adb(new jib()); - }; - sfb(Bve, "Collections/UnmodifiableListIterator", 705); - feb(609, 1, Cve, uqb); - _2.wc = function Aqb(a) { - Bvb(this, a); - }; - _2.yc = function Fqb(a, b, c2) { - return Cvb(this, a, b, c2); - }; - _2.$b = function vqb() { - throw Adb(new jib()); - }; - _2._b = function wqb(a) { - return this.c._b(a); - }; - _2.uc = function xqb(a) { - return pqb(this, a); - }; - _2.vc = function yqb() { - return qqb(this); - }; - _2.Fb = function zqb(a) { - return rqb(this, a); - }; - _2.xc = function Bqb(a) { - return this.c.xc(a); - }; - _2.Hb = function Cqb() { - return tb(this.c); - }; - _2.dc = function Dqb() { - return this.c.dc(); - }; - _2.ec = function Eqb() { - return sqb(this); - }; - _2.zc = function Gqb(a, b) { - throw Adb(new jib()); - }; - _2.Bc = function Hqb(a) { - throw Adb(new jib()); - }; - _2.gc = function Iqb() { - return this.c.gc(); - }; - _2.Ib = function Jqb() { - return jeb(this.c); - }; - _2.Cc = function Kqb() { - return tqb(this); - }; - sfb(Bve, "Collections/UnmodifiableMap", 609); - feb(396, 384, _ve, Lqb); - _2.Nc = function Oqb() { - return new Swb(this, 1); - }; - _2.Fb = function Mqb(a) { - return pb(this.b, a); - }; - _2.Hb = function Nqb() { - return tb(this.b); - }; - sfb(Bve, "Collections/UnmodifiableSet", 396); - feb(957, 396, _ve, Sqb); - _2.Hc = function Tqb(a) { - return Pqb(this, a); - }; - _2.Ic = function Uqb(a) { - return this.b.Ic(a); - }; - _2.Kc = function Vqb() { - var a; - a = this.b.Kc(); - return new Yqb(a); - }; - _2.Pc = function Wqb() { - var a; - a = this.b.Pc(); - Rqb(a, a.length); - return a; - }; - _2.Qc = function Xqb(a) { - return Qqb(this, a); - }; - sfb(Bve, "Collections/UnmodifiableMap/UnmodifiableEntrySet", 957); - feb(958, 1, Ave, Yqb); - _2.Nb = function Zqb(a) { - Ztb(this, a); - }; - _2.Pb = function _qb() { - return new brb(RD(this.a.Pb(), 44)); - }; - _2.Ob = function $qb() { - return this.a.Ob(); - }; - _2.Qb = function arb() { - throw Adb(new jib()); - }; - sfb(Bve, "Collections/UnmodifiableMap/UnmodifiableEntrySet/1", 958); - feb(703, 1, Axe, brb); - _2.Fb = function crb(a) { - return this.a.Fb(a); - }; - _2.ld = function drb() { - return this.a.ld(); - }; - _2.md = function erb() { - return this.a.md(); - }; - _2.Hb = function frb() { - return this.a.Hb(); - }; - _2.nd = function grb(a) { - throw Adb(new jib()); - }; - _2.Ib = function hrb() { - return jeb(this.a); - }; - sfb(Bve, "Collections/UnmodifiableMap/UnmodifiableEntrySet/UnmodifiableEntry", 703); - feb(610, 540, { 20: 1, 16: 1, 15: 1, 59: 1 }, irb); - sfb(Bve, "Collections/UnmodifiableRandomAccessList", 610); - feb(704, 396, bwe, jrb); - _2.Nc = function mrb() { - return new $wb(this); - }; - _2.Fb = function krb(a) { - return pb(this.a, a); - }; - _2.Hb = function lrb() { - return tb(this.a); - }; - sfb(Bve, "Collections/UnmodifiableSortedSet", 704); - feb(858, 1, Fxe, nrb); - _2.Ne = function orb(a, b) { - var c2; - return c2 = ygc(RD(a, 12), RD(b, 12)), c2 != 0 ? c2 : zgc(RD(a, 12), RD(b, 12)); - }; - _2.Fb = function prb(a) { - return this === a; - }; - _2.Oe = function qrb() { - return new Frb(this); - }; - sfb(Bve, "Comparator/lambda$0$Type", 858); - var rrb, srb, trb; - feb(769, 1, Fxe, wrb); - _2.Ne = function xrb(a, b) { - return vrb(RD(a, 34), RD(b, 34)); - }; - _2.Fb = function yrb(a) { - return this === a; - }; - _2.Oe = function zrb() { - return urb(), trb; - }; - sfb(Bve, "Comparators/NaturalOrderComparator", 769); - feb(1226, 1, Fxe, Brb); - _2.Ne = function Crb(a, b) { - return Arb(RD(a, 34), RD(b, 34)); - }; - _2.Fb = function Drb(a) { - return this === a; - }; - _2.Oe = function Erb() { - return urb(), srb; - }; - sfb(Bve, "Comparators/ReverseNaturalOrderComparator", 1226); - feb(52, 1, Fxe, Frb); - _2.Fb = function Hrb(a) { - return this === a; - }; - _2.Ne = function Grb(a, b) { - return this.a.Ne(b, a); - }; - _2.Oe = function Irb() { - return this.a; - }; - sfb(Bve, "Comparators/ReversedComparator", 52); - feb(175, 63, swe, Jrb); - sfb(Bve, "ConcurrentModificationException", 175); - var Krb, Lrb; - feb(1948, 1, Gxe, Prb); - _2.Pe = function Qrb(a) { - Nrb(this, a); - }; - _2.Ib = function Rrb() { - return "DoubleSummaryStatistics[count = " + Zdb(this.a) + ", avg = " + (Idb(this.a, 0) ? Orb(this) / Xdb(this.a) : 0) + ", min = " + this.c + ", max = " + this.b + ", sum = " + Orb(this) + "]"; - }; - _2.a = 0; - _2.b = pxe; - _2.c = oxe; - _2.d = 0; - _2.e = 0; - _2.f = 0; - sfb(Bve, "DoubleSummaryStatistics", 1948); - feb(1868, 63, swe, Srb); - sfb(Bve, "EmptyStackException", 1868); - feb(461, 2065, Cve, Zrb); - _2.zc = function dsb(a, b) { - return Xrb(this, a, b); - }; - _2.$b = function $rb() { - Trb(this); - }; - _2._b = function _rb(a) { - return Urb(this, a); - }; - _2.uc = function asb(a) { - var b, c2; - for (c2 = new Osb(this.a); c2.a < c2.c.a.length; ) { - b = Nsb(c2); - if (Fvb(a, this.b[b.g])) { - return true; - } - } - return false; - }; - _2.vc = function bsb() { - return new hsb(this); - }; - _2.xc = function csb(a) { - return Vrb(this, a); - }; - _2.Bc = function esb(a) { - return Yrb(this, a); - }; - _2.gc = function fsb() { - return this.a.c; - }; - sfb(Bve, "EnumMap", 461); - feb(1340, Eve, Fve, hsb); - _2.$b = function isb() { - Trb(this.a); - }; - _2.Hc = function jsb(a) { - return gsb(this, a); - }; - _2.Kc = function ksb() { - return new nsb(this.a); - }; - _2.Mc = function lsb(a) { - var b; - if (gsb(this, a)) { - b = RD(a, 44).ld(); - Yrb(this.a, b); - return true; - } - return false; - }; - _2.gc = function msb() { - return this.a.a.c; - }; - sfb(Bve, "EnumMap/EntrySet", 1340); - feb(1341, 1, Ave, nsb); - _2.Nb = function osb(a) { - Ztb(this, a); - }; - _2.Pb = function qsb() { - return this.b = Nsb(this.a), new ssb(this.c, this.b); - }; - _2.Ob = function psb() { - return Msb(this.a); - }; - _2.Qb = function rsb() { - yFb(!!this.b); - Yrb(this.c, this.b); - this.b = null; - }; - sfb(Bve, "EnumMap/EntrySetIterator", 1341); - feb(1342, 2082, Axe, ssb); - _2.ld = function tsb() { - return this.a; - }; - _2.md = function usb() { - return this.b.b[this.a.g]; - }; - _2.nd = function vsb(a) { - return _Eb(this.b.b, this.a.g, a); - }; - sfb(Bve, "EnumMap/MapEntry", 1342); - feb(181, Eve, { 20: 1, 31: 1, 16: 1, 181: 1, 21: 1 }); - var zK = sfb(Bve, "EnumSet", 181); - feb(162, 181, { 20: 1, 31: 1, 16: 1, 181: 1, 162: 1, 21: 1 }, Fsb); - _2.Fc = function Gsb(a) { - return zsb(this, RD(a, 22)); - }; - _2.Hc = function Hsb(a) { - return Bsb(this, a); - }; - _2.Kc = function Isb() { - return new Osb(this); - }; - _2.Mc = function Jsb(a) { - return Dsb(this, a); - }; - _2.gc = function Ksb() { - return this.c; - }; - _2.c = 0; - sfb(Bve, "EnumSet/EnumSetImpl", 162); - feb(356, 1, Ave, Osb); - _2.Nb = function Psb(a) { - Ztb(this, a); - }; - _2.Pb = function Rsb() { - return Nsb(this); - }; - _2.Ob = function Qsb() { - return Msb(this); - }; - _2.Qb = function Ssb() { - yFb(this.b != -1); - bD(this.c.b, this.b, null); - --this.c.c; - this.b = -1; - }; - _2.a = -1; - _2.b = -1; - sfb(Bve, "EnumSet/EnumSetImpl/IteratorImpl", 356); - feb(45, 498, Hxe, Tsb, Usb, Vsb); - _2.Be = function Wsb(a, b) { - return dE(a) === dE(b) || a != null && pb(a, b); - }; - _2.Ce = function Xsb(a) { - var b; - if (a == null) { - return 0; - } - b = tb(a); - return b | 0; - }; - sfb(Bve, "HashMap", 45); - feb(49, Eve, Ixe, _sb, atb, btb); - _2.Fc = function dtb(a) { - return Ysb(this, a); - }; - _2.$b = function etb() { - this.a.$b(); - }; - _2.Hc = function ftb(a) { - return Zsb(this, a); - }; - _2.dc = function gtb() { - return this.a.gc() == 0; - }; - _2.Kc = function htb() { - return this.a.ec().Kc(); - }; - _2.Mc = function itb(a) { - return $sb(this, a); - }; - _2.gc = function jtb() { - return this.a.gc(); - }; - var BK = sfb(Bve, "HashSet", 49); - feb(1897, 1, Rve, ltb); - _2.Dd = function mtb(a) { - ktb(this, a); - }; - _2.Ib = function ntb() { - return "IntSummaryStatistics[count = " + Zdb(this.a) + ", avg = " + (Idb(this.a, 0) ? Xdb(this.d) / Xdb(this.a) : 0) + ", min = " + this.c + ", max = " + this.b + ", sum = " + Zdb(this.d) + "]"; - }; - _2.a = 0; - _2.b = qwe; - _2.c = lve; - _2.d = 0; - sfb(Bve, "IntSummaryStatistics", 1897); - feb(1062, 1, Vve, ttb); - _2.Jc = function utb(a) { - xgb(this, a); - }; - _2.Kc = function vtb() { - return new wtb(this); - }; - _2.c = 0; - sfb(Bve, "InternalHashCodeMap", 1062); - feb(726, 1, Ave, wtb); - _2.Nb = function xtb(a) { - Ztb(this, a); - }; - _2.Pb = function ztb() { - return this.d = this.a[this.c++], this.d; - }; - _2.Ob = function ytb() { - var a; - if (this.c < this.a.length) { - return true; - } - a = this.b.next(); - if (!a.done) { - this.a = a.value[1]; - this.c = 0; - return true; - } - return false; - }; - _2.Qb = function Atb() { - stb(this.e, this.d.ld()); - this.c != 0 && --this.c; - }; - _2.c = 0; - _2.d = null; - sfb(Bve, "InternalHashCodeMap/1", 726); - var Dtb; - feb(1060, 1, Vve, Ntb); - _2.Jc = function Otb(a) { - xgb(this, a); - }; - _2.Kc = function Ptb() { - return new Qtb(this); - }; - _2.c = 0; - _2.d = 0; - sfb(Bve, "InternalStringMap", 1060); - feb(725, 1, Ave, Qtb); - _2.Nb = function Rtb(a) { - Ztb(this, a); - }; - _2.Pb = function Ttb() { - return this.c = this.a, this.a = this.b.next(), new Vtb(this.d, this.c, this.d.d); - }; - _2.Ob = function Stb() { - return !this.a.done; - }; - _2.Qb = function Utb() { - Mtb(this.d, this.c.value[0]); - }; - sfb(Bve, "InternalStringMap/1", 725); - feb(1061, 2082, Axe, Vtb); - _2.ld = function Wtb() { - return this.b.value[0]; - }; - _2.md = function Xtb() { - if (this.a.d != this.c) { - return Ktb(this.a, this.b.value[0]); - } - return this.b.value[1]; - }; - _2.nd = function Ytb(a) { - return Ltb(this.a, this.b.value[0], a); - }; - _2.c = 0; - sfb(Bve, "InternalStringMap/2", 1061); - feb(215, 45, Hxe, gub, hub); - _2.$b = function iub() { - aub(this); - }; - _2._b = function jub(a) { - return bub(this, a); - }; - _2.uc = function kub(a) { - var b; - b = this.d.a; - while (b != this.d) { - if (Fvb(b.e, a)) { - return true; - } - b = b.a; - } - return false; - }; - _2.vc = function lub() { - return new wub(this); - }; - _2.xc = function mub(a) { - return cub(this, a); - }; - _2.zc = function nub(a, b) { - return dub(this, a, b); - }; - _2.Bc = function oub(a) { - return fub(this, a); - }; - _2.gc = function pub() { - return bkb(this.e); - }; - _2.c = false; - sfb(Bve, "LinkedHashMap", 215); - feb(400, 397, { 494: 1, 397: 1, 400: 1, 44: 1 }, tub, uub); - sfb(Bve, "LinkedHashMap/ChainEntry", 400); - feb(715, Eve, Fve, wub); - _2.$b = function xub() { - aub(this.a); - }; - _2.Hc = function yub(a) { - return vub(this, a); - }; - _2.Kc = function zub() { - return new Dub(this); - }; - _2.Mc = function Aub(a) { - var b; - if (vub(this, a)) { - b = RD(a, 44).ld(); - fub(this.a, b); - return true; - } - return false; - }; - _2.gc = function Bub() { - return bkb(this.a.e); - }; - sfb(Bve, "LinkedHashMap/EntrySet", 715); - feb(716, 1, Ave, Dub); - _2.Nb = function Eub(a) { - Ztb(this, a); - }; - _2.Pb = function Gub() { - return Cub(this); - }; - _2.Ob = function Fub() { - return this.c != this.d.a.d; - }; - _2.Qb = function Hub() { - yFb(!!this.a); - rFb(this.d.a.e.g, this.b); - rub(this.a); - _jb(this.d.a.e, this.a.d); - this.b = this.d.a.e.g; - this.a = null; - }; - _2.b = 0; - sfb(Bve, "LinkedHashMap/EntrySet/EntryIterator", 716); - feb(174, 49, Ixe, Iub, Jub, Kub); - var MK = sfb(Bve, "LinkedHashSet", 174); - feb(67, 2062, { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 67: 1, 15: 1 }, Yub, Zub); - _2.Fc = function $ub(a) { - return Mub(this, a); - }; - _2.$b = function _ub() { - Xub(this); - }; - _2.fd = function avb(a) { - return Sub(this, a); - }; - _2.gc = function bvb() { - return this.b; - }; - _2.b = 0; - var PK = sfb(Bve, "LinkedList", 67); - feb(981, 1, Jve, hvb); - _2.Nb = function jvb(a) { - Ztb(this, a); - }; - _2.Rb = function ivb(a) { - cvb(this, a); - }; - _2.Ob = function kvb() { - return dvb(this); - }; - _2.Sb = function lvb() { - return this.b.b != this.d.a; - }; - _2.Pb = function mvb() { - return evb(this); - }; - _2.Tb = function nvb() { - return this.a; - }; - _2.Ub = function ovb() { - return fvb(this); - }; - _2.Vb = function pvb() { - return this.a - 1; - }; - _2.Qb = function qvb() { - gvb(this); - }; - _2.Wb = function rvb(a) { - yFb(!!this.c); - this.c.c = a; - }; - _2.a = 0; - _2.c = null; - sfb(Bve, "LinkedList/ListIteratorImpl", 981); - feb(617, 1, {}, svb); - sfb(Bve, "LinkedList/Node", 617); - feb(2057, 1, {}); - var uvb, vvb; - sfb(Bve, "Locale", 2057); - feb(873, 2057, {}, xvb); - _2.Ib = function yvb() { - return ""; - }; - sfb(Bve, "Locale/1", 873); - feb(874, 2057, {}, zvb); - _2.Ib = function Avb() { - return "unknown"; - }; - sfb(Bve, "Locale/4", 874); - feb(112, 63, { 3: 1, 103: 1, 63: 1, 82: 1, 112: 1 }, Dvb, Evb); - sfb(Bve, "NoSuchElementException", 112); - feb(475, 1, { 475: 1 }, Ovb); - _2.Fb = function Pvb(a) { - var b; - if (a === this) { - return true; - } - if (!ZD(a, 475)) { - return false; - } - b = RD(a, 475); - return Fvb(this.a, b.a); - }; - _2.Hb = function Qvb() { - return Gvb(this.a); - }; - _2.Ib = function Rvb() { - return this.a != null ? uve + Ghb(this.a) + ")" : "Optional.empty()"; - }; - var Jvb; - sfb(Bve, "Optional", 475); - feb(414, 1, { 414: 1 }, Xvb, Yvb); - _2.Fb = function Zvb(a) { - var b; - if (a === this) { - return true; - } - if (!ZD(a, 414)) { - return false; - } - b = RD(a, 414); - return this.a == b.a && Qfb(this.b, b.b) == 0; - }; - _2.Hb = function $vb() { - return this.a ? eE(this.b) : 0; - }; - _2.Ib = function _vb() { - return this.a ? "OptionalDouble.of(" + ("" + this.b) + ")" : "OptionalDouble.empty()"; - }; - _2.a = false; - _2.b = 0; - var Svb; - sfb(Bve, "OptionalDouble", 414); - feb(524, 1, { 524: 1 }, dwb, ewb); - _2.Fb = function fwb(a) { - var b; - if (a === this) { - return true; - } - if (!ZD(a, 524)) { - return false; - } - b = RD(a, 524); - return this.a == b.a && hgb(this.b, b.b) == 0; - }; - _2.Hb = function gwb() { - return this.a ? this.b : 0; - }; - _2.Ib = function hwb() { - return this.a ? "OptionalInt.of(" + ("" + this.b) + ")" : "OptionalInt.empty()"; - }; - _2.a = false; - _2.b = 0; - var awb; - sfb(Bve, "OptionalInt", 524); - feb(510, 2103, Dve, pwb); - _2.Gc = function qwb(a) { - return iwb(this, a); - }; - _2.$b = function rwb() { - aFb(this.b.c, 0); - }; - _2.Hc = function swb(a) { - return (a == null ? -1 : Wmb(this.b, a, 0)) != -1; - }; - _2.Kc = function twb() { - return new zwb(this); - }; - _2.Mc = function uwb(a) { - return nwb(this, a); - }; - _2.gc = function vwb() { - return this.b.c.length; - }; - _2.Nc = function wwb() { - return new Swb(this, 256); - }; - _2.Pc = function xwb() { - return UEb(this.b.c); - }; - _2.Qc = function ywb(a) { - return anb(this.b, a); - }; - sfb(Bve, "PriorityQueue", 510); - feb(1296, 1, Ave, zwb); - _2.Nb = function Awb(a) { - Ztb(this, a); - }; - _2.Ob = function Bwb() { - return this.a < this.c.b.c.length; - }; - _2.Pb = function Cwb() { - sFb(this.a < this.c.b.c.length); - this.b = this.a++; - return Vmb(this.c.b, this.b); - }; - _2.Qb = function Dwb() { - yFb(this.b != -1); - owb(this.c, this.a = this.b); - this.b = -1; - }; - _2.a = 0; - _2.b = -1; - sfb(Bve, "PriorityQueue/1", 1296); - feb(234, 1, { 234: 1 }, Owb, Pwb); - _2.a = 0; - _2.b = 0; - var Ewb, Fwb, Gwb = 0; - sfb(Bve, "Random", 234); - feb(25, 1, Pve, Swb, Twb, Uwb); - _2.Ad = function Ywb(a) { - return (this.a & a) != 0; - }; - _2.yd = function Vwb() { - return this.a; - }; - _2.zd = function Wwb() { - Qwb(this); - return this.c; - }; - _2.Nb = function Xwb(a) { - Qwb(this); - this.d.Nb(a); - }; - _2.Bd = function Zwb(a) { - return Rwb(this, a); - }; - _2.a = 0; - _2.c = 0; - sfb(Bve, "Spliterators/IteratorSpliterator", 25); - feb(495, 25, Pve, $wb); - sfb(Bve, "SortedSet/1", 495); - feb(611, 1, Gxe, axb); - _2.Pe = function bxb(a) { - this.a.Cd(a); - }; - sfb(Bve, "Spliterator/OfDouble/0methodref$accept$Type", 611); - feb(612, 1, Gxe, cxb); - _2.Pe = function dxb(a) { - this.a.Cd(a); - }; - sfb(Bve, "Spliterator/OfDouble/1methodref$accept$Type", 612); - feb(613, 1, Rve, exb); - _2.Dd = function fxb(a) { - this.a.Cd(sgb(a)); - }; - sfb(Bve, "Spliterator/OfInt/2methodref$accept$Type", 613); - feb(614, 1, Rve, gxb); - _2.Dd = function hxb(a) { - this.a.Cd(sgb(a)); - }; - sfb(Bve, "Spliterator/OfInt/3methodref$accept$Type", 614); - feb(625, 1, Pve); - _2.Nb = function nxb(a) { - _wb(this, a); - }; - _2.Ad = function oxb(a) { - return (this.d & a) != 0; - }; - _2.yd = function lxb() { - return this.d; - }; - _2.zd = function mxb() { - return this.e; - }; - _2.d = 0; - _2.e = 0; - sfb(Bve, "Spliterators/BaseSpliterator", 625); - feb(736, 625, Pve); - _2.Qe = function qxb(a) { - ixb(this, a); - }; - _2.Nb = function rxb(a) { - ZD(a, 189) ? ixb(this, RD(a, 189)) : ixb(this, new cxb(a)); - }; - _2.Bd = function sxb(a) { - return ZD(a, 189) ? this.Re(RD(a, 189)) : this.Re(new axb(a)); - }; - sfb(Bve, "Spliterators/AbstractDoubleSpliterator", 736); - feb(735, 625, Pve); - _2.Qe = function uxb(a) { - ixb(this, a); - }; - _2.Nb = function vxb(a) { - ZD(a, 202) ? ixb(this, RD(a, 202)) : ixb(this, new gxb(a)); - }; - _2.Bd = function wxb(a) { - return ZD(a, 202) ? this.Re(RD(a, 202)) : this.Re(new exb(a)); - }; - sfb(Bve, "Spliterators/AbstractIntSpliterator", 735); - feb(500, 625, Pve); - sfb(Bve, "Spliterators/AbstractSpliterator", 500); - feb(706, 1, Pve); - _2.Nb = function Dxb(a) { - _wb(this, a); - }; - _2.Ad = function Exb(a) { - return (this.b & a) != 0; - }; - _2.yd = function Bxb() { - return this.b; - }; - _2.zd = function Cxb() { - return this.d - this.c; - }; - _2.b = 0; - _2.c = 0; - _2.d = 0; - sfb(Bve, "Spliterators/BaseArraySpliterator", 706); - feb(960, 706, Pve, Gxb); - _2.Se = function Hxb(a, b) { - Fxb(this, RD(a, 41), b); - }; - _2.Nb = function Ixb(a) { - yxb(this, a); - }; - _2.Bd = function Jxb(a) { - return zxb(this, a); - }; - sfb(Bve, "Spliterators/ArraySpliterator", 960); - feb(707, 706, Pve, Lxb); - _2.Se = function Nxb(a, b) { - Kxb(this, RD(a, 189), b); - }; - _2.Qe = function Oxb(a) { - yxb(this, a); - }; - _2.Nb = function Pxb(a) { - ZD(a, 189) ? yxb(this, RD(a, 189)) : yxb(this, new cxb(a)); - }; - _2.Re = function Qxb(a) { - return zxb(this, a); - }; - _2.Bd = function Rxb(a) { - return ZD(a, 189) ? zxb(this, RD(a, 189)) : zxb(this, new axb(a)); - }; - sfb(Bve, "Spliterators/DoubleArraySpliterator", 707); - feb(2066, 1, Pve); - _2.Nb = function Wxb(a) { - _wb(this, a); - }; - _2.Ad = function Xxb(a) { - return (16448 & a) != 0; - }; - _2.yd = function Uxb() { - return 16448; - }; - _2.zd = function Vxb() { - return 0; - }; - var Sxb; - sfb(Bve, "Spliterators/EmptySpliterator", 2066); - feb(959, 2066, Pve, $xb); - _2.Qe = function _xb(a) { - Yxb(a); - }; - _2.Nb = function ayb(a) { - ZD(a, 202) ? Yxb(RD(a, 202)) : Yxb(new gxb(a)); - }; - _2.Re = function byb(a) { - return Zxb(a); - }; - _2.Bd = function cyb(a) { - return ZD(a, 202) ? Zxb(RD(a, 202)) : Zxb(new exb(a)); - }; - sfb(Bve, "Spliterators/EmptySpliterator/OfInt", 959); - feb(588, 56, Rxe, gyb); - _2.bd = function hyb(a, b) { - lyb(a, this.a.c.length + 1); - Qmb(this.a, a, b); - }; - _2.Fc = function iyb(a) { - return Rmb(this.a, a); - }; - _2.cd = function jyb(a, b) { - lyb(a, this.a.c.length + 1); - return Smb(this.a, a, b); - }; - _2.Gc = function kyb(a) { - return Tmb(this.a, a); - }; - _2.$b = function myb() { - aFb(this.a.c, 0); - }; - _2.Hc = function nyb(a) { - return Wmb(this.a, a, 0) != -1; - }; - _2.Ic = function oyb(a) { - return Be(this.a, a); - }; - _2.Jc = function pyb(a) { - Umb(this.a, a); - }; - _2.Xb = function qyb(a) { - return lyb(a, this.a.c.length), Vmb(this.a, a); - }; - _2.dd = function ryb(a) { - return Wmb(this.a, a, 0); - }; - _2.dc = function syb() { - return this.a.c.length == 0; - }; - _2.Kc = function tyb() { - return new Anb(this.a); - }; - _2.gd = function uyb(a) { - return lyb(a, this.a.c.length), Xmb(this.a, a); - }; - _2.ce = function vyb(a, b) { - Zmb(this.a, a, b); - }; - _2.hd = function wyb(a, b) { - return lyb(a, this.a.c.length), $mb(this.a, a, b); - }; - _2.gc = function xyb() { - return this.a.c.length; - }; - _2.jd = function yyb(a) { - _mb(this.a, a); - }; - _2.kd = function zyb(a, b) { - return new Rkb(this.a, a, b); - }; - _2.Pc = function Ayb() { - return UEb(this.a.c); - }; - _2.Qc = function Byb(a) { - return anb(this.a, a); - }; - _2.Ib = function Cyb() { - return Fe(this.a); - }; - sfb(Bve, "Vector", 588); - feb(824, 588, Rxe, Fyb); - sfb(Bve, "Stack", 824); - feb(213, 1, { 213: 1 }, Jyb); - _2.Ib = function Kyb() { - return Iyb(this); - }; - sfb(Bve, "StringJoiner", 213); - feb(553, 2090, { 3: 1, 85: 1, 139: 1, 133: 1 }, dzb, ezb); - _2.$b = function fzb() { - Lyb(this); - }; - _2.De = function gzb() { - return new xzb(this); - }; - _2.vc = function hzb() { - return new Dzb(this); - }; - _2.Ee = function izb(a) { - return Pyb(this, a, true); - }; - _2.Fe = function jzb(a) { - return Myb(this, a); - }; - _2.Ge = function kzb() { - return Nyb(this); - }; - _2.He = function lzb(a) { - return Qyb(this, a, true); - }; - _2.Ie = function mzb(a) { - return Pyb(this, a, false); - }; - _2.Je = function nzb() { - return Oyb(this); - }; - _2.Ke = function ozb(a) { - return Qyb(this, a, false); - }; - _2.Zc = function pzb(a, b) { - return Ryb(this, a, b); - }; - _2.zc = function qzb(a, b) { - return Wyb(this, a, b); - }; - _2.Bc = function rzb(a) { - return Xyb(this, a); - }; - _2.Le = function szb(a) { - return Yyb(this, a); - }; - _2.gc = function tzb() { - return this.c; - }; - _2.ad = function uzb(a, b) { - return czb(this, a, b); - }; - _2.c = 0; - sfb(Bve, "TreeMap", 553); - feb(554, 1, Ave, xzb, yzb); - _2.Nb = function zzb(a) { - Ztb(this, a); - }; - _2.Pb = function Bzb() { - return vzb(this); - }; - _2.Ob = function Azb() { - return Akb(this.a); - }; - _2.Qb = function Czb() { - wzb(this); - }; - sfb(Bve, "TreeMap/EntryIterator", 554); - feb(1142, 629, Fve, Dzb); - _2.$b = function Ezb() { - Lyb(this.a); - }; - sfb(Bve, "TreeMap/EntrySet", 1142); - feb(447, 397, { 494: 1, 397: 1, 44: 1, 447: 1 }, Fzb); - _2.b = false; - var vL = sfb(Bve, "TreeMap/Node", 447); - feb(630, 1, {}, Gzb); - _2.Ib = function Hzb() { - return "State: mv=" + this.c + " value=" + this.d + " done=" + this.a + " found=" + this.b; - }; - _2.a = false; - _2.b = false; - _2.c = false; - sfb(Bve, "TreeMap/State", 630); - feb(631, 2090, Gve, Kzb); - _2.De = function Lzb() { - return new yzb(this.c, this.f, this.b, this.a, this.e, this.d); - }; - _2.vc = function Mzb() { - return new Plb(this); - }; - _2.Ee = function Nzb(a) { - return Izb(this, Pyb(this.c, a, true)); - }; - _2.Fe = function Ozb(a) { - return Izb(this, Myb(this.c, a)); - }; - _2.Ge = function Pzb() { - var a; - return this.f.Te() ? this.a ? a = Pyb(this.c, this.b, true) : a = Pyb(this.c, this.b, false) : a = Nyb(this.c), !!a && Jzb(this, a.d) ? a : null; - }; - _2.He = function Qzb(a) { - return Izb(this, Qyb(this.c, a, true)); - }; - _2.Ie = function Rzb(a) { - return Izb(this, Pyb(this.c, a, false)); - }; - _2.Je = function Szb() { - var a; - this.f.Ue() ? this.d ? a = Qyb(this.c, this.e, true) : a = Qyb(this.c, this.e, false) : a = Oyb(this.c); - return !!a && Jzb(this, a.d) ? a : null; - }; - _2.Ke = function Tzb(a) { - return Izb(this, Qyb(this.c, a, false)); - }; - _2.Zc = function Uzb(a, b) { - if (this.f.Ue() && this.c.a.Ne(a, this.e) > 0) { - throw Adb(new agb(Sxe + a + " greater than " + this.e)); - } - return this.f.Te() ? bzb(this.c, this.b, this.a, a, b) : Ryb(this.c, a, b); - }; - _2.zc = function Vzb(a, b) { - if (!Tyb(this.c, this.f, a, this.b, this.a, this.e, this.d)) { - throw Adb(new agb(a + " outside the range " + this.b + " to " + this.e)); - } - return Wyb(this.c, a, b); - }; - _2.Bc = function Wzb(a) { - var b; - b = a; - if (!Tyb(this.c, this.f, b, this.b, this.a, this.e, this.d)) { - return null; - } - return Xyb(this.c, b); - }; - _2.Le = function Xzb(a) { - return Jzb(this, a.ld()) && Yyb(this.c, a); - }; - _2.gc = function Yzb() { - var a, b, c2; - this.f.Te() ? this.a ? b = Pyb(this.c, this.b, true) : b = Pyb(this.c, this.b, false) : b = Nyb(this.c); - if (!(!!b && Jzb(this, b.d) ? b : null)) { - return 0; - } - a = 0; - for (c2 = new yzb(this.c, this.f, this.b, this.a, this.e, this.d); Akb(c2.a); c2.b = RD(Bkb(c2.a), 44)) { - ++a; - } - return a; - }; - _2.ad = function Zzb(a, b) { - if (this.f.Te() && this.c.a.Ne(a, this.b) < 0) { - throw Adb(new agb(Sxe + a + Txe + this.b)); - } - return this.f.Ue() ? bzb(this.c, a, b, this.e, this.d) : czb(this.c, a, b); - }; - _2.a = false; - _2.d = false; - sfb(Bve, "TreeMap/SubMap", 631); - feb(304, 22, Uxe, dAb); - _2.Te = function eAb() { - return false; - }; - _2.Ue = function fAb() { - return false; - }; - var $zb, _zb, aAb, bAb; - var AL = tfb(Bve, "TreeMap/SubMapType", 304, WI, hAb, gAb); - feb(1143, 304, Uxe, iAb); - _2.Ue = function jAb() { - return true; - }; - tfb(Bve, "TreeMap/SubMapType/1", 1143, AL, null, null); - feb(1144, 304, Uxe, kAb); - _2.Te = function lAb() { - return true; - }; - _2.Ue = function mAb() { - return true; - }; - tfb(Bve, "TreeMap/SubMapType/2", 1144, AL, null, null); - feb(1145, 304, Uxe, nAb); - _2.Te = function oAb() { - return true; - }; - tfb(Bve, "TreeMap/SubMapType/3", 1145, AL, null, null); - var pAb; - feb(157, Eve, { 3: 1, 20: 1, 31: 1, 16: 1, 277: 1, 21: 1, 87: 1, 157: 1 }, xAb, yAb, zAb); - _2.Nc = function GAb() { - return new $wb(this); - }; - _2.Fc = function AAb(a) { - return rAb(this, a); - }; - _2.$b = function BAb() { - this.a.$b(); - }; - _2.Hc = function CAb(a) { - return this.a._b(a); - }; - _2.Kc = function DAb() { - return this.a.ec().Kc(); - }; - _2.Mc = function EAb(a) { - return wAb(this, a); - }; - _2.gc = function FAb() { - return this.a.gc(); - }; - var DL = sfb(Bve, "TreeSet", 157); - feb(1082, 1, {}, JAb); - _2.Ve = function KAb(a, b) { - return HAb(this.a, a, b); - }; - sfb(Vxe, "BinaryOperator/lambda$0$Type", 1082); - feb(1083, 1, {}, LAb); - _2.Ve = function MAb(a, b) { - return IAb(this.a, a, b); - }; - sfb(Vxe, "BinaryOperator/lambda$1$Type", 1083); - feb(952, 1, {}, NAb); - _2.Kb = function OAb(a) { - return a; - }; - sfb(Vxe, "Function/lambda$0$Type", 952); - feb(395, 1, nwe, PAb); - _2.Mb = function QAb(a) { - return !this.a.Mb(a); - }; - sfb(Vxe, "Predicate/lambda$2$Type", 395); - feb(581, 1, { 581: 1 }); - var JL = sfb(Wxe, "Handler", 581); - feb(2107, 1, nve); - _2.xe = function TAb() { - return "DUMMY"; - }; - _2.Ib = function UAb() { - return this.xe(); - }; - var RAb; - sfb(Wxe, "Level", 2107); - feb(1706, 2107, nve, VAb); - _2.xe = function WAb() { - return "INFO"; - }; - sfb(Wxe, "Level/LevelInfo", 1706); - feb(1843, 1, {}, $Ab); - var XAb; - sfb(Wxe, "LogManager", 1843); - feb(1896, 1, nve, aBb); - _2.b = null; - sfb(Wxe, "LogRecord", 1896); - feb(525, 1, { 525: 1 }, oBb); - _2.e = false; - var bBb = false, cBb = false, dBb = false, eBb = false, fBb = false; - sfb(Wxe, "Logger", 525); - feb(835, 581, { 581: 1 }, rBb); - sfb(Wxe, "SimpleConsoleLogHandler", 835); - feb(108, 22, { 3: 1, 34: 1, 22: 1, 108: 1 }, yBb); - var uBb, vBb, wBb; - var QL = tfb(Zxe, "Collector/Characteristics", 108, WI, ABb, zBb); - var BBb; - feb(758, 1, {}, DBb); - sfb(Zxe, "CollectorImpl", 758); - feb(1074, 1, {}, RBb); - _2.Ve = function SBb(a, b) { - return Hyb(RD(a, 213), RD(b, 213)); - }; - sfb(Zxe, "Collectors/10methodref$merge$Type", 1074); - feb(1075, 1, {}, TBb); - _2.Kb = function UBb(a) { - return Iyb(RD(a, 213)); - }; - sfb(Zxe, "Collectors/11methodref$toString$Type", 1075); - feb(1076, 1, {}, VBb); - _2.Kb = function WBb(a) { - return Geb(), SSb(a) ? true : false; - }; - sfb(Zxe, "Collectors/12methodref$test$Type", 1076); - feb(144, 1, {}, XBb); - _2.Yd = function YBb(a, b) { - RD(a, 16).Fc(b); - }; - sfb(Zxe, "Collectors/20methodref$add$Type", 144); - feb(146, 1, {}, ZBb); - _2.Xe = function $Bb() { - return new bnb(); - }; - sfb(Zxe, "Collectors/21methodref$ctor$Type", 146); - feb(359, 1, {}, _Bb); - _2.Xe = function aCb() { - return new _sb(); - }; - sfb(Zxe, "Collectors/23methodref$ctor$Type", 359); - feb(360, 1, {}, bCb); - _2.Yd = function cCb(a, b) { - Ysb(RD(a, 49), b); - }; - sfb(Zxe, "Collectors/24methodref$add$Type", 360); - feb(1069, 1, {}, dCb); - _2.Ve = function eCb(a, b) { - return EBb(RD(a, 15), RD(b, 16)); - }; - sfb(Zxe, "Collectors/4methodref$addAll$Type", 1069); - feb(1073, 1, {}, fCb); - _2.Yd = function gCb(a, b) { - Gyb(RD(a, 213), RD(b, 484)); - }; - sfb(Zxe, "Collectors/9methodref$add$Type", 1073); - feb(1072, 1, {}, hCb); - _2.Xe = function iCb() { - return new Jyb(this.a, this.b, this.c); - }; - sfb(Zxe, "Collectors/lambda$15$Type", 1072); - feb(1077, 1, {}, jCb); - _2.Xe = function kCb() { - var a; - return a = new gub(), dub(a, (Geb(), false), new bnb()), dub(a, true, new bnb()), a; - }; - sfb(Zxe, "Collectors/lambda$22$Type", 1077); - feb(1078, 1, {}, lCb); - _2.Xe = function mCb() { - return cD(WC(jJ, 1), rve, 1, 5, [this.a]); - }; - sfb(Zxe, "Collectors/lambda$25$Type", 1078); - feb(1079, 1, {}, nCb); - _2.Yd = function oCb(a, b) { - GBb(this.a, SD(a)); - }; - sfb(Zxe, "Collectors/lambda$26$Type", 1079); - feb(1080, 1, {}, pCb); - _2.Ve = function qCb(a, b) { - return HBb(this.a, SD(a), SD(b)); - }; - sfb(Zxe, "Collectors/lambda$27$Type", 1080); - feb(1081, 1, {}, rCb); - _2.Kb = function sCb(a) { - return SD(a)[0]; - }; - sfb(Zxe, "Collectors/lambda$28$Type", 1081); - feb(728, 1, {}, uCb); - _2.Ve = function vCb(a, b) { - return tCb(a, b); - }; - sfb(Zxe, "Collectors/lambda$4$Type", 728); - feb(145, 1, {}, wCb); - _2.Ve = function xCb(a, b) { - return JBb(RD(a, 16), RD(b, 16)); - }; - sfb(Zxe, "Collectors/lambda$42$Type", 145); - feb(361, 1, {}, yCb); - _2.Ve = function zCb(a, b) { - return KBb(RD(a, 49), RD(b, 49)); - }; - sfb(Zxe, "Collectors/lambda$50$Type", 361); - feb(362, 1, {}, ACb); - _2.Kb = function BCb(a) { - return RD(a, 49); - }; - sfb(Zxe, "Collectors/lambda$51$Type", 362); - feb(1068, 1, {}, CCb); - _2.Yd = function DCb(a, b) { - LBb(this.a, RD(a, 85), b); - }; - sfb(Zxe, "Collectors/lambda$7$Type", 1068); - feb(1070, 1, {}, ECb); - _2.Ve = function FCb(a, b) { - return NBb(RD(a, 85), RD(b, 85), new dCb()); - }; - sfb(Zxe, "Collectors/lambda$8$Type", 1070); - feb(1071, 1, {}, GCb); - _2.Kb = function HCb(a) { - return MBb(this.a, RD(a, 85)); - }; - sfb(Zxe, "Collectors/lambda$9$Type", 1071); - feb(550, 1, {}); - _2.$e = function OCb() { - ICb(this); - }; - _2.d = false; - sfb(Zxe, "TerminatableStream", 550); - feb(827, 550, $xe, WCb); - _2.$e = function XCb() { - ICb(this); - }; - sfb(Zxe, "DoubleStreamImpl", 827); - feb(1847, 736, Pve, $Cb); - _2.Re = function aDb(a) { - return ZCb(this, RD(a, 189)); - }; - _2.a = null; - sfb(Zxe, "DoubleStreamImpl/2", 1847); - feb(1848, 1, Gxe, bDb); - _2.Pe = function cDb(a) { - _Cb(this.a, a); - }; - sfb(Zxe, "DoubleStreamImpl/2/lambda$0$Type", 1848); - feb(1845, 1, Gxe, dDb); - _2.Pe = function eDb(a) { - YCb(this.a, a); - }; - sfb(Zxe, "DoubleStreamImpl/lambda$0$Type", 1845); - feb(1846, 1, Gxe, fDb); - _2.Pe = function gDb(a) { - Nrb(this.a, a); - }; - sfb(Zxe, "DoubleStreamImpl/lambda$2$Type", 1846); - feb(1397, 735, Pve, kDb); - _2.Re = function lDb(a) { - return jDb(this, RD(a, 202)); - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - sfb(Zxe, "IntStream/5", 1397); - feb(806, 550, $xe, oDb); - _2.$e = function pDb() { - ICb(this); - }; - _2._e = function qDb() { - return LCb(this), this.a; - }; - sfb(Zxe, "IntStreamImpl", 806); - feb(807, 550, $xe, rDb); - _2.$e = function sDb() { - ICb(this); - }; - _2._e = function tDb() { - return LCb(this), Txb(), Sxb; - }; - sfb(Zxe, "IntStreamImpl/Empty", 807); - feb(1687, 1, Rve, uDb); - _2.Dd = function vDb(a) { - ktb(this.a, a); - }; - sfb(Zxe, "IntStreamImpl/lambda$4$Type", 1687); - var RM = ufb(Zxe, "Stream"); - feb(26, 550, { 533: 1, 687: 1, 848: 1 }, SDb); - _2.$e = function TDb() { - ICb(this); - }; - var wDb; - sfb(Zxe, "StreamImpl", 26); - feb(1102, 500, Pve, YDb); - _2.Bd = function ZDb(a) { - while (WDb(this)) { - if (this.a.Bd(a)) { - return true; - } else { - ICb(this.b); - this.b = null; - this.a = null; - } - } - return false; - }; - sfb(Zxe, "StreamImpl/1", 1102); - feb(1103, 1, Qve, $Db); - _2.Cd = function _Db(a) { - XDb(this.a, RD(a, 848)); - }; - sfb(Zxe, "StreamImpl/1/lambda$0$Type", 1103); - feb(1104, 1, nwe, aEb); - _2.Mb = function bEb(a) { - return Ysb(this.a, a); - }; - sfb(Zxe, "StreamImpl/1methodref$add$Type", 1104); - feb(1105, 500, Pve, cEb); - _2.Bd = function dEb(a) { - var b; - if (!this.a) { - b = new bnb(); - this.b.a.Nb(new eEb(b)); - yob(); - _mb(b, this.c); - this.a = new Swb(b, 16); - } - return Rwb(this.a, a); - }; - _2.a = null; - sfb(Zxe, "StreamImpl/5", 1105); - feb(1106, 1, Qve, eEb); - _2.Cd = function fEb(a) { - Rmb(this.a, a); - }; - sfb(Zxe, "StreamImpl/5/2methodref$add$Type", 1106); - feb(737, 500, Pve, hEb); - _2.Bd = function iEb(a) { - this.b = false; - while (!this.b && this.c.Bd(new jEb(this, a))) - ; - return this.b; - }; - _2.b = false; - sfb(Zxe, "StreamImpl/FilterSpliterator", 737); - feb(1096, 1, Qve, jEb); - _2.Cd = function kEb(a) { - gEb(this.a, this.b, a); - }; - sfb(Zxe, "StreamImpl/FilterSpliterator/lambda$0$Type", 1096); - feb(1091, 736, Pve, nEb); - _2.Re = function oEb(a) { - return mEb(this, RD(a, 189)); - }; - sfb(Zxe, "StreamImpl/MapToDoubleSpliterator", 1091); - feb(1095, 1, Qve, pEb); - _2.Cd = function qEb(a) { - lEb(this.a, this.b, a); - }; - sfb(Zxe, "StreamImpl/MapToDoubleSpliterator/lambda$0$Type", 1095); - feb(1090, 735, Pve, tEb); - _2.Re = function uEb(a) { - return sEb(this, RD(a, 202)); - }; - sfb(Zxe, "StreamImpl/MapToIntSpliterator", 1090); - feb(1094, 1, Qve, vEb); - _2.Cd = function wEb(a) { - rEb(this.a, this.b, a); - }; - sfb(Zxe, "StreamImpl/MapToIntSpliterator/lambda$0$Type", 1094); - feb(734, 500, Pve, zEb); - _2.Bd = function AEb(a) { - return yEb(this, a); - }; - sfb(Zxe, "StreamImpl/MapToObjSpliterator", 734); - feb(1093, 1, Qve, BEb); - _2.Cd = function CEb(a) { - xEb(this.a, this.b, a); - }; - sfb(Zxe, "StreamImpl/MapToObjSpliterator/lambda$0$Type", 1093); - feb(1092, 500, Pve, DEb); - _2.Bd = function EEb(a) { - while (Idb(this.b, 0)) { - if (!this.a.Bd(new FEb())) { - return false; - } - this.b = Vdb(this.b, 1); - } - return this.a.Bd(a); - }; - _2.b = 0; - sfb(Zxe, "StreamImpl/SkipSpliterator", 1092); - feb(1097, 1, Qve, FEb); - _2.Cd = function GEb(a) { - }; - sfb(Zxe, "StreamImpl/SkipSpliterator/lambda$0$Type", 1097); - feb(626, 1, Qve, IEb); - _2.Cd = function JEb(a) { - HEb(this, a); - }; - sfb(Zxe, "StreamImpl/ValueConsumer", 626); - feb(1098, 1, Qve, KEb); - _2.Cd = function LEb(a) { - xDb(); - }; - sfb(Zxe, "StreamImpl/lambda$0$Type", 1098); - feb(1099, 1, Qve, MEb); - _2.Cd = function NEb(a) { - xDb(); - }; - sfb(Zxe, "StreamImpl/lambda$1$Type", 1099); - feb(1100, 1, {}, OEb); - _2.Ve = function PEb(a, b) { - return UDb(this.a, a, b); - }; - sfb(Zxe, "StreamImpl/lambda$4$Type", 1100); - feb(1101, 1, Qve, QEb); - _2.Cd = function REb(a) { - VDb(this.b, this.a, a); - }; - sfb(Zxe, "StreamImpl/lambda$5$Type", 1101); - feb(1107, 1, Qve, SEb); - _2.Cd = function TEb(a) { - PCb(this.a, RD(a, 380)); - }; - sfb(Zxe, "TerminatableStream/lambda$0$Type", 1107); - feb(2142, 1, {}); - feb(2014, 1, {}, gFb); - sfb("javaemul.internal", "ConsoleLogger", 2014); - var iFb = 0; - feb(2134, 1, {}); - feb(1830, 1, Qve, FFb); - _2.Cd = function GFb(a) { - RD(a, 317); - }; - sfb(eye, "BowyerWatsonTriangulation/lambda$0$Type", 1830); - feb(1831, 1, Qve, HFb); - _2.Cd = function IFb(a) { - ye(this.a, RD(a, 317).e); - }; - sfb(eye, "BowyerWatsonTriangulation/lambda$1$Type", 1831); - feb(1832, 1, Qve, JFb); - _2.Cd = function KFb(a) { - RD(a, 177); - }; - sfb(eye, "BowyerWatsonTriangulation/lambda$2$Type", 1832); - feb(1827, 1, fye, NFb); - _2.Ne = function OFb(a, b) { - return MFb(this.a, RD(a, 177), RD(b, 177)); - }; - _2.Fb = function PFb(a) { - return this === a; - }; - _2.Oe = function QFb() { - return new Frb(this); - }; - sfb(eye, "NaiveMinST/lambda$0$Type", 1827); - feb(449, 1, {}, SFb); - sfb(eye, "NodeMicroLayout", 449); - feb(177, 1, { 177: 1 }, TFb); - _2.Fb = function UFb(a) { - var b; - if (ZD(a, 177)) { - b = RD(a, 177); - return Fvb(this.a, b.a) && Fvb(this.b, b.b) || Fvb(this.a, b.b) && Fvb(this.b, b.a); - } else { - return false; - } - }; - _2.Hb = function VFb() { - return Gvb(this.a) + Gvb(this.b); - }; - var $M = sfb(eye, "TEdge", 177); - feb(317, 1, { 317: 1 }, XFb); - _2.Fb = function YFb(a) { - var b; - if (ZD(a, 317)) { - b = RD(a, 317); - return WFb(this, b.a) && WFb(this, b.b) && WFb(this, b.c); - } else { - return false; - } - }; - _2.Hb = function ZFb() { - return Gvb(this.a) + Gvb(this.b) + Gvb(this.c); - }; - sfb(eye, "TTriangle", 317); - feb(225, 1, { 225: 1 }, $Fb); - sfb(eye, "Tree", 225); - feb(1218, 1, {}, aGb); - sfb(gye, "Scanline", 1218); - var bN = ufb(gye, hye); - feb(1758, 1, {}, dGb); - sfb(iye, "CGraph", 1758); - feb(316, 1, { 316: 1 }, fGb); - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.g = 0; - _2.i = 0; - _2.k = pxe; - sfb(iye, "CGroup", 316); - feb(830, 1, {}, jGb); - sfb(iye, "CGroup/CGroupBuilder", 830); - feb(60, 1, { 60: 1 }, kGb); - _2.Ib = function lGb() { - var a; - if (this.j) { - return WD(this.j.Kb(this)); - } - return lfb(hN), hN.o + "@" + (a = kFb(this) >>> 0, a.toString(16)); - }; - _2.f = 0; - _2.i = pxe; - var hN = sfb(iye, "CNode", 60); - feb(829, 1, {}, qGb); - sfb(iye, "CNode/CNodeBuilder", 829); - var vGb; - feb(1590, 1, {}, xGb); - _2.ff = function yGb(a, b) { - return 0; - }; - _2.gf = function zGb(a, b) { - return 0; - }; - sfb(iye, kye, 1590); - feb(1853, 1, {}, AGb); - _2.cf = function BGb(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - j = oxe; - for (d = new Anb(a.a.b); d.a < d.c.c.length; ) { - b = RD(ynb(d), 60); - j = $wnd.Math.min(j, b.a.j.d.c + b.b.a); - } - n = new Yub(); - for (g = new Anb(a.a.a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 316); - f2.k = j; - f2.g == 0 && (Pub(n, f2, n.c.b, n.c), true); - } - while (n.b != 0) { - f2 = RD(n.b == 0 ? null : (sFb(n.b != 0), Wub(n, n.a.a)), 316); - e = f2.j.d.c; - for (m = f2.a.a.ec().Kc(); m.Ob(); ) { - k = RD(m.Pb(), 60); - p = f2.k + k.b.a; - !LGb(a, f2, a.d) || k.d.c < p ? k.i = p : k.i = k.d.c; - } - e -= f2.j.i; - f2.b += e; - a.d == (Cmd(), zmd) || a.d == xmd ? f2.c += e : f2.c -= e; - for (l = f2.a.a.ec().Kc(); l.Ob(); ) { - k = RD(l.Pb(), 60); - for (i2 = k.c.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 60); - Dmd(a.d) ? o2 = a.g.ff(k, h) : o2 = a.g.gf(k, h); - h.a.k = $wnd.Math.max(h.a.k, k.i + k.d.b + o2 - h.b.a); - MGb(a, h, a.d) && (h.a.k = $wnd.Math.max(h.a.k, h.d.c - h.b.a)); - --h.a.g; - h.a.g == 0 && Mub(n, h.a); - } - } - } - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - b.d.c = b.i; - } - }; - sfb(iye, "LongestPathCompaction", 1853); - feb(1756, 1, {}, VGb); - _2.e = false; - var CGb, DGb, EGb; - var lN = sfb(iye, pye, 1756); - feb(1757, 1, Qve, WGb); - _2.Cd = function XGb(a) { - NGb(this.a, RD(a, 42)); - }; - sfb(iye, qye, 1757); - feb(1854, 1, {}, YGb); - _2.df = function ZGb(a) { - var b, c2, d, e, f2, g, h; - for (c2 = new Anb(a.a.b); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 60); - b.c.$b(); - } - for (e = new Anb(a.a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 60); - for (g = new Anb(a.a.b); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 60); - if (d == f2) { - continue; - } - if (!!d.a && d.a == f2.a) { - continue; - } - Dmd(a.d) ? h = a.g.gf(d, f2) : h = a.g.ff(d, f2); - (f2.d.c > d.d.c || d.d.c == f2.d.c && d.d.b < f2.d.b) && sGb(f2.d.d + f2.d.a + h, d.d.d) && uGb(f2.d.d, d.d.d + d.d.a + h) && d.c.Fc(f2); - } - } - }; - sfb(iye, "QuadraticConstraintCalculation", 1854); - feb(529, 1, { 529: 1 }, cHb); - _2.a = false; - _2.b = false; - _2.c = false; - _2.d = false; - sfb(iye, rye, 529); - feb(817, 1, {}, fHb); - _2.df = function gHb(a) { - this.c = a; - eHb(this, new xHb()); - }; - sfb(iye, sye, 817); - feb(1784, 1, { 693: 1 }, lHb); - _2.bf = function mHb(a) { - iHb(this, RD(a, 473)); - }; - sfb(iye, tye, 1784); - feb(1785, 1, fye, oHb); - _2.Ne = function pHb(a, b) { - return nHb(RD(a, 60), RD(b, 60)); - }; - _2.Fb = function qHb(a) { - return this === a; - }; - _2.Oe = function rHb() { - return new Frb(this); - }; - sfb(iye, uye, 1785); - feb(473, 1, { 473: 1 }, sHb); - _2.a = false; - sfb(iye, vye, 473); - feb(1786, 1, fye, tHb); - _2.Ne = function uHb(a, b) { - return hHb(RD(a, 473), RD(b, 473)); - }; - _2.Fb = function vHb(a) { - return this === a; - }; - _2.Oe = function wHb() { - return new Frb(this); - }; - sfb(iye, wye, 1786); - feb(1787, 1, xye, xHb); - _2.Lb = function yHb(a) { - return RD(a, 60), true; - }; - _2.Fb = function zHb(a) { - return this === a; - }; - _2.Mb = function AHb(a) { - return RD(a, 60), true; - }; - sfb(iye, "ScanlineConstraintCalculator/lambda$1$Type", 1787); - feb(436, 22, { 3: 1, 34: 1, 22: 1, 436: 1 }, EHb); - var BHb, CHb; - var uN = tfb(yye, "HighLevelSortingCriterion", 436, WI, GHb, FHb); - var HHb; - feb(435, 22, { 3: 1, 34: 1, 22: 1, 435: 1 }, MHb); - var JHb, KHb; - var vN = tfb(yye, "LowLevelSortingCriterion", 435, WI, OHb, NHb); - var PHb; - var B2 = ufb(zye, "ILayoutMetaDataProvider"); - feb(864, 1, Eye, ZHb); - _2.hf = function $Hb(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Aye), Fye), "Polyomino Traversal Strategy"), "Traversal strategy for trying different candidate positions for polyominoes."), XHb), (kid(), eid)), xN), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Bye), Fye), "Polyomino Secondary Sorting Criterion"), "Possible secondary sorting criteria for the processing order of polyominoes. They are used when polyominoes are equal according to the primary sorting criterion HighLevelSortingCriterion."), VHb), eid), vN), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Cye), Fye), "Polyomino Primary Sorting Criterion"), "Possible primary sorting criteria for the processing order of polyominoes."), THb), eid), uN), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Dye), Fye), "Fill Polyominoes"), "Use the Profile Fill algorithm to fill polyominoes to prevent small polyominoes from being placed inside of big polyominoes with large holes. Might increase packing area."), (Geb(), true)), cid), QI), xsb(Whd)))); - }; - var RHb, SHb, THb, UHb, VHb, WHb, XHb; - sfb(yye, "PolyominoOptions", 864); - feb(257, 22, { 3: 1, 34: 1, 22: 1, 257: 1 }, jIb); - var _Hb, aIb, bIb, cIb, dIb, eIb, fIb, gIb, hIb; - var xN = tfb(yye, "TraversalStrategy", 257, WI, lIb, kIb); - var mIb; - feb(218, 1, { 218: 1 }, pIb); - _2.Ib = function qIb() { - return "NEdge[id=" + this.b + " w=" + this.g + " d=" + this.a + "]"; - }; - _2.a = 1; - _2.b = 0; - _2.c = 0; - _2.f = false; - _2.g = 0; - var zN = sfb(Gye, "NEdge", 218); - feb(182, 1, {}, wIb); - sfb(Gye, "NEdge/NEdgeBuilder", 182); - feb(662, 1, {}, BIb); - sfb(Gye, "NGraph", 662); - feb(125, 1, { 125: 1 }, DIb); - _2.c = -1; - _2.d = 0; - _2.e = 0; - _2.i = -1; - _2.j = false; - var DN = sfb(Gye, "NNode", 125); - feb(808, 1, Exe, GIb); - _2.Jc = function OIb(a) { - xgb(this, a); - }; - _2.Lc = function VIb() { - return new SDb(null, new Swb(this, 16)); - }; - _2.jd = function $Ib(a) { - tvb(this, a); - }; - _2.Nc = function _Ib() { - return new Swb(this, 16); - }; - _2.Oc = function aJb() { - return new SDb(null, new Swb(this, 16)); - }; - _2.bd = function HIb(a, b) { - ++this.b; - Qmb(this.a, a, b); - }; - _2.Fc = function IIb(a) { - return EIb(this, a); - }; - _2.cd = function JIb(a, b) { - ++this.b; - return Smb(this.a, a, b); - }; - _2.Gc = function KIb(a) { - ++this.b; - return Tmb(this.a, a); - }; - _2.$b = function LIb() { - ++this.b; - aFb(this.a.c, 0); - }; - _2.Hc = function MIb(a) { - return Wmb(this.a, a, 0) != -1; - }; - _2.Ic = function NIb(a) { - return Be(this.a, a); - }; - _2.Xb = function PIb(a) { - return Vmb(this.a, a); - }; - _2.dd = function QIb(a) { - return Wmb(this.a, a, 0); - }; - _2.dc = function RIb() { - return this.a.c.length == 0; - }; - _2.Kc = function SIb() { - return Nr(new Anb(this.a)); - }; - _2.ed = function TIb() { - throw Adb(new jib()); - }; - _2.fd = function UIb(a) { - throw Adb(new jib()); - }; - _2.gd = function WIb(a) { - ++this.b; - return Xmb(this.a, a); - }; - _2.Mc = function XIb(a) { - return FIb(this, a); - }; - _2.hd = function YIb(a, b) { - ++this.b; - return $mb(this.a, a, b); - }; - _2.gc = function ZIb() { - return this.a.c.length; - }; - _2.kd = function bJb(a, b) { - return new Rkb(this.a, a, b); - }; - _2.Pc = function cJb() { - return UEb(this.a.c); - }; - _2.Qc = function dJb(a) { - return anb(this.a, a); - }; - _2.b = 0; - sfb(Gye, "NNode/ChangeAwareArrayList", 808); - feb(275, 1, {}, gJb); - sfb(Gye, "NNode/NNodeBuilder", 275); - feb(1695, 1, {}, BJb); - _2.a = false; - _2.f = lve; - _2.j = 0; - sfb(Gye, "NetworkSimplex", 1695); - feb(1314, 1, Qve, HJb); - _2.Cd = function IJb(a) { - GJb(this.a, RD(a, 695), true, false); - }; - sfb(Iye, "NodeLabelAndSizeCalculator/lambda$0$Type", 1314); - feb(565, 1, {}, PJb); - _2.b = true; - _2.c = true; - _2.d = true; - _2.e = true; - sfb(Iye, "NodeMarginCalculator", 565); - feb(217, 1, { 217: 1 }); - _2.j = false; - _2.k = false; - var IN = sfb(Jye, "Cell", 217); - feb(127, 217, { 127: 1, 217: 1 }, TJb); - _2.jf = function UJb() { - return SJb(this); - }; - _2.kf = function VJb() { - var a; - a = this.n; - return this.a.a + a.b + a.c; - }; - sfb(Jye, "AtomicCell", 127); - feb(237, 22, { 3: 1, 34: 1, 22: 1, 237: 1 }, $Jb); - var WJb, XJb, YJb; - var JN = tfb(Jye, "ContainerArea", 237, WI, aKb, _Jb); - var bKb; - feb(336, 217, Lye); - sfb(Jye, "ContainerCell", 336); - feb(1538, 336, Lye, wKb); - _2.jf = function xKb() { - var a; - a = 0; - this.e ? this.b ? a = this.b.b : !!this.a[1][1] && (a = this.a[1][1].jf()) : a = vKb(this, rKb(this, true)); - return a > 0 ? a + this.n.d + this.n.a : 0; - }; - _2.kf = function yKb() { - var a, b, c2, d, e; - e = 0; - if (this.e) { - this.b ? e = this.b.a : !!this.a[1][1] && (e = this.a[1][1].kf()); - } else if (this.g) { - e = vKb(this, pKb(this, null, true)); - } else { - for (b = (ZJb(), cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb])), c2 = 0, d = b.length; c2 < d; ++c2) { - a = b[c2]; - e = $wnd.Math.max(e, vKb(this, pKb(this, a, true))); - } - } - return e > 0 ? e + this.n.b + this.n.c : 0; - }; - _2.lf = function zKb() { - var a, b, c2, d, e; - if (this.g) { - a = pKb(this, null, false); - for (c2 = (ZJb(), cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb])), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - nKb(this, b, a); - } - } else { - for (c2 = (ZJb(), cD(WC(JN, 1), jwe, 237, 0, [WJb, XJb, YJb])), d = 0, e = c2.length; d < e; ++d) { - b = c2[d]; - a = pKb(this, b, false); - nKb(this, b, a); - } - } - }; - _2.mf = function AKb() { - var a, b, c2, d; - b = this.i; - a = this.n; - d = rKb(this, false); - lKb(this, (ZJb(), WJb), b.d + a.d, d); - lKb(this, YJb, b.d + b.a - a.a - d[2], d); - c2 = b.a - a.d - a.a; - if (d[0] > 0) { - d[0] += this.d; - c2 -= d[0]; - } - if (d[2] > 0) { - d[2] += this.d; - c2 -= d[2]; - } - this.c.a = $wnd.Math.max(0, c2); - this.c.d = b.d + a.d + (this.c.a - c2) / 2; - d[1] = $wnd.Math.max(d[1], c2); - lKb(this, XJb, b.d + a.d + d[0] - (d[1] - c2) / 2, d); - }; - _2.b = null; - _2.d = 0; - _2.e = false; - _2.f = false; - _2.g = false; - var iKb = 0, jKb = 0; - sfb(Jye, "GridContainerCell", 1538); - feb(471, 22, { 3: 1, 34: 1, 22: 1, 471: 1 }, FKb); - var BKb, CKb, DKb; - var MN = tfb(Jye, "HorizontalLabelAlignment", 471, WI, HKb, GKb); - var IKb; - feb(314, 217, { 217: 1, 314: 1 }, TKb, UKb, VKb); - _2.jf = function WKb() { - return PKb(this); - }; - _2.kf = function XKb() { - return QKb(this); - }; - _2.a = 0; - _2.c = false; - var NN = sfb(Jye, "LabelCell", 314); - feb(252, 336, { 217: 1, 336: 1, 252: 1 }, dLb); - _2.jf = function eLb() { - return YKb(this); - }; - _2.kf = function fLb() { - return ZKb(this); - }; - _2.lf = function iLb() { - $Kb(this); - }; - _2.mf = function jLb() { - _Kb(this); - }; - _2.b = 0; - _2.c = 0; - _2.d = false; - sfb(Jye, "StripContainerCell", 252); - feb(1691, 1, nwe, kLb); - _2.Mb = function lLb(a) { - return gLb(RD(a, 217)); - }; - sfb(Jye, "StripContainerCell/lambda$0$Type", 1691); - feb(1692, 1, {}, mLb); - _2.Ye = function nLb(a) { - return RD(a, 217).kf(); - }; - sfb(Jye, "StripContainerCell/lambda$1$Type", 1692); - feb(1693, 1, nwe, oLb); - _2.Mb = function pLb(a) { - return hLb(RD(a, 217)); - }; - sfb(Jye, "StripContainerCell/lambda$2$Type", 1693); - feb(1694, 1, {}, qLb); - _2.Ye = function rLb(a) { - return RD(a, 217).jf(); - }; - sfb(Jye, "StripContainerCell/lambda$3$Type", 1694); - feb(472, 22, { 3: 1, 34: 1, 22: 1, 472: 1 }, wLb); - var sLb, tLb, uLb; - var TN = tfb(Jye, "VerticalLabelAlignment", 472, WI, yLb, xLb); - var zLb; - feb(800, 1, {}, CLb); - _2.c = 0; - _2.d = 0; - _2.k = 0; - _2.s = 0; - _2.t = 0; - _2.v = false; - _2.w = 0; - _2.D = false; - sfb(Rye, "NodeContext", 800); - feb(1536, 1, fye, FLb); - _2.Ne = function GLb(a, b) { - return ELb(RD(a, 64), RD(b, 64)); - }; - _2.Fb = function HLb(a) { - return this === a; - }; - _2.Oe = function ILb() { - return new Frb(this); - }; - sfb(Rye, "NodeContext/0methodref$comparePortSides$Type", 1536); - feb(1537, 1, fye, JLb); - _2.Ne = function KLb(a, b) { - return DLb(RD(a, 117), RD(b, 117)); - }; - _2.Fb = function LLb(a) { - return this === a; - }; - _2.Oe = function MLb() { - return new Frb(this); - }; - sfb(Rye, "NodeContext/1methodref$comparePortContexts$Type", 1537); - feb(164, 22, { 3: 1, 34: 1, 22: 1, 164: 1 }, kMb); - var NLb, OLb, PLb, QLb, RLb, SLb, TLb, ULb, VLb, WLb, XLb, YLb, ZLb, $Lb, _Lb, aMb, bMb, cMb, dMb, eMb, fMb, gMb; - var XN = tfb(Rye, "NodeLabelLocation", 164, WI, nMb, mMb); - var oMb; - feb(117, 1, { 117: 1 }, rMb); - _2.a = false; - sfb(Rye, "PortContext", 117); - feb(1541, 1, Qve, KMb); - _2.Cd = function LMb(a) { - NKb(RD(a, 314)); - }; - sfb(Uye, Vye, 1541); - feb(1542, 1, nwe, MMb); - _2.Mb = function NMb(a) { - return !!RD(a, 117).c; - }; - sfb(Uye, Wye, 1542); - feb(1543, 1, Qve, OMb); - _2.Cd = function PMb(a) { - NKb(RD(a, 117).c); - }; - sfb(Uye, "LabelPlacer/lambda$2$Type", 1543); - var QMb; - feb(1540, 1, Qve, YMb); - _2.Cd = function ZMb(a) { - RMb(); - qMb(RD(a, 117)); - }; - sfb(Uye, "NodeLabelAndSizeUtilities/lambda$0$Type", 1540); - feb(801, 1, Qve, dNb); - _2.Cd = function eNb(a) { - bNb(this.b, this.c, this.a, RD(a, 187)); - }; - _2.a = false; - _2.c = false; - sfb(Uye, "NodeLabelCellCreator/lambda$0$Type", 801); - feb(1539, 1, Qve, kNb); - _2.Cd = function lNb(a) { - jNb(this.a, RD(a, 187)); - }; - sfb(Uye, "PortContextCreator/lambda$0$Type", 1539); - var sNb; - feb(1902, 1, {}, MNb); - sfb(Yye, "GreedyRectangleStripOverlapRemover", 1902); - feb(1903, 1, fye, ONb); - _2.Ne = function PNb(a, b) { - return NNb(RD(a, 226), RD(b, 226)); - }; - _2.Fb = function QNb(a) { - return this === a; - }; - _2.Oe = function RNb() { - return new Frb(this); - }; - sfb(Yye, "GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type", 1903); - feb(1849, 1, {}, YNb); - _2.a = 5; - _2.e = 0; - sfb(Yye, "RectangleStripOverlapRemover", 1849); - feb(1850, 1, fye, aOb); - _2.Ne = function bOb(a, b) { - return ZNb(RD(a, 226), RD(b, 226)); - }; - _2.Fb = function cOb(a) { - return this === a; - }; - _2.Oe = function dOb() { - return new Frb(this); - }; - sfb(Yye, "RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type", 1850); - feb(1852, 1, fye, eOb); - _2.Ne = function fOb(a, b) { - return $Nb(RD(a, 226), RD(b, 226)); - }; - _2.Fb = function gOb(a) { - return this === a; - }; - _2.Oe = function hOb() { - return new Frb(this); - }; - sfb(Yye, "RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type", 1852); - feb(417, 22, { 3: 1, 34: 1, 22: 1, 417: 1 }, nOb); - var iOb, jOb, kOb, lOb; - var hO = tfb(Yye, "RectangleStripOverlapRemover/OverlapRemovalDirection", 417, WI, pOb, oOb); - var qOb; - feb(226, 1, { 226: 1 }, sOb); - sfb(Yye, "RectangleStripOverlapRemover/RectangleNode", 226); - feb(1851, 1, Qve, tOb); - _2.Cd = function uOb(a) { - TNb(this.a, RD(a, 226)); - }; - sfb(Yye, "RectangleStripOverlapRemover/lambda$1$Type", 1851); - feb(1323, 1, fye, xOb); - _2.Ne = function yOb(a, b) { - return wOb(RD(a, 176), RD(b, 176)); - }; - _2.Fb = function zOb(a) { - return this === a; - }; - _2.Oe = function AOb() { - return new Frb(this); - }; - sfb($ye, "PolyominoCompactor/CornerCasesGreaterThanRestComparator", 1323); - feb(1326, 1, {}, BOb); - _2.Kb = function COb(a) { - return RD(a, 334).a; - }; - sfb($ye, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$0$Type", 1326); - feb(1327, 1, nwe, DOb); - _2.Mb = function EOb(a) { - return RD(a, 332).a; - }; - sfb($ye, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$1$Type", 1327); - feb(1328, 1, nwe, FOb); - _2.Mb = function GOb(a) { - return RD(a, 332).a; - }; - sfb($ye, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$2$Type", 1328); - feb(1321, 1, fye, IOb); - _2.Ne = function JOb(a, b) { - return HOb(RD(a, 176), RD(b, 176)); - }; - _2.Fb = function KOb(a) { - return this === a; - }; - _2.Oe = function LOb() { - return new Frb(this); - }; - sfb($ye, "PolyominoCompactor/MinNumOfExtensionDirectionsComparator", 1321); - feb(1324, 1, {}, MOb); - _2.Kb = function NOb(a) { - return RD(a, 334).a; - }; - sfb($ye, "PolyominoCompactor/MinNumOfExtensionDirectionsComparator/lambda$0$Type", 1324); - feb(781, 1, fye, POb); - _2.Ne = function QOb(a, b) { - return OOb(RD(a, 176), RD(b, 176)); - }; - _2.Fb = function ROb(a) { - return this === a; - }; - _2.Oe = function SOb() { - return new Frb(this); - }; - sfb($ye, "PolyominoCompactor/MinNumOfExtensionsComparator", 781); - feb(1319, 1, fye, UOb); - _2.Ne = function VOb(a, b) { - return TOb(RD(a, 330), RD(b, 330)); - }; - _2.Fb = function WOb(a) { - return this === a; - }; - _2.Oe = function XOb() { - return new Frb(this); - }; - sfb($ye, "PolyominoCompactor/MinPerimeterComparator", 1319); - feb(1320, 1, fye, ZOb); - _2.Ne = function $Ob(a, b) { - return YOb(RD(a, 330), RD(b, 330)); - }; - _2.Fb = function _Ob(a) { - return this === a; - }; - _2.Oe = function aPb() { - return new Frb(this); - }; - sfb($ye, "PolyominoCompactor/MinPerimeterComparatorWithShape", 1320); - feb(1322, 1, fye, cPb); - _2.Ne = function dPb(a, b) { - return bPb(RD(a, 176), RD(b, 176)); - }; - _2.Fb = function ePb(a) { - return this === a; - }; - _2.Oe = function fPb() { - return new Frb(this); - }; - sfb($ye, "PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator", 1322); - feb(1325, 1, {}, gPb); - _2.Kb = function hPb(a) { - return RD(a, 334).a; - }; - sfb($ye, "PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator/lambda$0$Type", 1325); - feb(782, 1, {}, kPb); - _2.Ve = function lPb(a, b) { - return jPb(this, RD(a, 42), RD(b, 176)); - }; - sfb($ye, "SuccessorCombination", 782); - feb(649, 1, {}, nPb); - _2.Ve = function oPb(a, b) { - var c2; - return mPb((c2 = RD(a, 42), RD(b, 176), c2)); - }; - sfb($ye, "SuccessorJitter", 649); - feb(648, 1, {}, qPb); - _2.Ve = function rPb(a, b) { - var c2; - return pPb((c2 = RD(a, 42), RD(b, 176), c2)); - }; - sfb($ye, "SuccessorLineByLine", 648); - feb(573, 1, {}, tPb); - _2.Ve = function uPb(a, b) { - var c2; - return sPb((c2 = RD(a, 42), RD(b, 176), c2)); - }; - sfb($ye, "SuccessorManhattan", 573); - feb(1344, 1, {}, wPb); - _2.Ve = function xPb(a, b) { - var c2; - return vPb((c2 = RD(a, 42), RD(b, 176), c2)); - }; - sfb($ye, "SuccessorMaxNormWindingInMathPosSense", 1344); - feb(409, 1, {}, APb); - _2.Ve = function BPb(a, b) { - return yPb(this, a, b); - }; - _2.c = false; - _2.d = false; - _2.e = false; - _2.f = false; - sfb($ye, "SuccessorQuadrantsGeneric", 409); - feb(1345, 1, {}, CPb); - _2.Kb = function DPb(a) { - return RD(a, 334).a; - }; - sfb($ye, "SuccessorQuadrantsGeneric/lambda$0$Type", 1345); - feb(332, 22, { 3: 1, 34: 1, 22: 1, 332: 1 }, JPb); - _2.a = false; - var EPb, FPb, GPb, HPb; - var DO = tfb(dze, eze, 332, WI, LPb, KPb); - var MPb; - feb(1317, 1, {}); - _2.Ib = function UPb() { - var a, b, c2, d, e, f2; - c2 = " "; - a = sgb(0); - for (e = 0; e < this.o; e++) { - c2 += "" + a.a; - a = sgb(OPb(a.a)); - } - c2 += "\n"; - a = sgb(0); - for (f2 = 0; f2 < this.p; f2++) { - c2 += "" + a.a; - a = sgb(OPb(a.a)); - for (d = 0; d < this.o; d++) { - b = SPb(this, d, f2); - Ddb(b, 0) == 0 ? c2 += "_" : Ddb(b, 1) == 0 ? c2 += "X" : c2 += "0"; - } - c2 += "\n"; - } - return zhb(c2, 0, c2.length - 1); - }; - _2.o = 0; - _2.p = 0; - sfb(dze, "TwoBitGrid", 1317); - feb(330, 1317, { 330: 1 }, gQb); - _2.j = 0; - _2.k = 0; - sfb(dze, "PlanarGrid", 330); - feb(176, 330, { 330: 1, 176: 1 }); - _2.g = 0; - _2.i = 0; - sfb(dze, "Polyomino", 176); - var U5 = ufb(jze, kze); - feb(137, 1, lze, qQb); - _2.qf = function uQb(a, b) { - return oQb(this, a, b); - }; - _2.nf = function rQb() { - return lQb(this); - }; - _2.of = function sQb(a) { - return mQb(this, a); - }; - _2.pf = function tQb(a) { - return nQb(this, a); - }; - sfb(jze, "MapPropertyHolder", 137); - feb(1318, 137, lze, vQb); - sfb(dze, "Polyominoes", 1318); - var wQb = false, xQb, yQb; - feb(1828, 1, Qve, GQb); - _2.Cd = function HQb(a) { - AQb(RD(a, 225)); - }; - sfb(mze, "DepthFirstCompaction/0methodref$compactTree$Type", 1828); - feb(825, 1, Qve, IQb); - _2.Cd = function JQb(a) { - DQb(this.a, RD(a, 225)); - }; - sfb(mze, "DepthFirstCompaction/lambda$1$Type", 825); - feb(1829, 1, Qve, KQb); - _2.Cd = function LQb(a) { - EQb(this.a, this.b, this.c, RD(a, 225)); - }; - sfb(mze, "DepthFirstCompaction/lambda$2$Type", 1829); - var MQb, NQb; - feb(68, 1, { 68: 1 }, TQb); - sfb(mze, "Node", 68); - feb(1214, 1, {}, WQb); - sfb(mze, "ScanlineOverlapCheck", 1214); - feb(1215, 1, { 693: 1 }, $Qb); - _2.bf = function _Qb(a) { - YQb(this, RD(a, 451)); - }; - sfb(mze, "ScanlineOverlapCheck/OverlapsScanlineHandler", 1215); - feb(1216, 1, fye, bRb); - _2.Ne = function cRb(a, b) { - return aRb(RD(a, 68), RD(b, 68)); - }; - _2.Fb = function dRb(a) { - return this === a; - }; - _2.Oe = function eRb() { - return new Frb(this); - }; - sfb(mze, "ScanlineOverlapCheck/OverlapsScanlineHandler/lambda$0$Type", 1216); - feb(451, 1, { 451: 1 }, fRb); - _2.a = false; - sfb(mze, "ScanlineOverlapCheck/Timestamp", 451); - feb(1217, 1, fye, gRb); - _2.Ne = function hRb(a, b) { - return XQb(RD(a, 451), RD(b, 451)); - }; - _2.Fb = function iRb(a) { - return this === a; - }; - _2.Oe = function jRb() { - return new Frb(this); - }; - sfb(mze, "ScanlineOverlapCheck/lambda$0$Type", 1217); - feb(557, 1, {}, kRb); - sfb(nze, "SVGImage", 557); - feb(334, 1, { 334: 1 }, lRb); - _2.Ib = function mRb() { - return "(" + this.a + pve + this.b + pve + this.c + ")"; - }; - sfb(nze, "UniqueTriple", 334); - feb(205, 1, oze); - sfb(pze, "AbstractLayoutProvider", 205); - feb(1114, 205, oze, pRb); - _2.rf = function qRb(a, b) { - var c2, d, e, f2; - b.Ug(qze, 1); - this.a = Kfb(UD(Gxd(a, (tSb(), sSb)))); - if (Hxd(a, iSb)) { - e = WD(Gxd(a, iSb)); - c2 = sgd(ygd(), e); - if (c2) { - d = RD(ltd(c2.f), 205); - d.rf(a, b.eh(1)); - } - } - f2 = new rTb(this.a); - this.b = pTb(f2, a); - switch (RD(Gxd(a, (eSb(), aSb)), 489).g) { - case 0: - sRb(new wRb(), this.b); - Ixd(a, lSb, mQb(this.b, lSb)); - break; - default: - gib(); - } - hTb(f2); - Ixd(a, kSb, this.b); - b.Vg(); - }; - _2.a = 0; - sfb(rze, "DisCoLayoutProvider", 1114); - feb(1208, 1, {}, wRb); - _2.c = false; - _2.e = 0; - _2.f = 0; - sfb(rze, "DisCoPolyominoCompactor", 1208); - feb(567, 1, { 567: 1 }, DRb); - _2.b = true; - sfb(sze, "DCComponent", 567); - feb(406, 22, { 3: 1, 34: 1, 22: 1, 406: 1 }, JRb); - _2.a = false; - var ERb, FRb, GRb, HRb; - var WO = tfb(sze, "DCDirection", 406, WI, LRb, KRb); - var MRb; - feb(272, 137, { 3: 1, 272: 1, 96: 1, 137: 1 }, ORb); - sfb(sze, "DCElement", 272); - feb(407, 1, { 407: 1 }, QRb); - _2.c = 0; - sfb(sze, "DCExtension", 407); - feb(762, 137, lze, TRb); - sfb(sze, "DCGraph", 762); - feb(489, 22, { 3: 1, 34: 1, 22: 1, 489: 1 }, WRb); - var URb; - var $O = tfb(tze, uze, 489, WI, YRb, XRb); - var ZRb; - feb(865, 1, Eye, fSb); - _2.hf = function gSb(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), vze), zze), "Connected Components Compaction Strategy"), "Strategy for packing different connected components in order to save space and enhance readability of a graph."), bSb), (kid(), eid)), $O), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), wze), zze), "Connected Components Layout Algorithm"), "A layout algorithm that is to be applied to each connected component before the components themselves are compacted. If unspecified, the positions of the components' nodes are not altered."), iid), qJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), xze), "debug"), "DCGraph"), "Access to the DCGraph is intended for the debug view,"), hid), jJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), yze), "debug"), "List of Polyominoes"), "Access to the polyominoes is intended for the debug view,"), hid), jJ), xsb(Whd)))); - uSb((new vSb(), a)); - }; - var _Rb, aSb, bSb, cSb, dSb; - sfb(tze, "DisCoMetaDataProvider", 865); - feb(1010, 1, Eye, vSb); - _2.hf = function wSb(a) { - uSb(a); - }; - var hSb, iSb, jSb, kSb, lSb, mSb, nSb, oSb, pSb, qSb, rSb, sSb; - sfb(tze, "DisCoOptions", 1010); - feb(1011, 1, {}, xSb); - _2.sf = function ySb() { - var a; - return a = new pRb(), a; - }; - _2.tf = function zSb(a) { - }; - sfb(tze, "DisCoOptions/DiscoFactory", 1011); - feb(568, 176, { 330: 1, 176: 1, 568: 1 }, DSb); - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = 0; - sfb("org.eclipse.elk.alg.disco.structures", "DCPolyomino", 568); - var ESb, FSb, GSb; - feb(1286, 1, nwe, TSb); - _2.Mb = function USb(a) { - return SSb(a); - }; - sfb(Fze, "ElkGraphComponentsProcessor/lambda$0$Type", 1286); - feb(1287, 1, {}, VSb); - _2.Kb = function WSb(a) { - return HSb(), JGd(RD(a, 74)); - }; - sfb(Fze, "ElkGraphComponentsProcessor/lambda$1$Type", 1287); - feb(1288, 1, nwe, XSb); - _2.Mb = function YSb(a) { - return NSb(RD(a, 74)); - }; - sfb(Fze, "ElkGraphComponentsProcessor/lambda$2$Type", 1288); - feb(1289, 1, {}, ZSb); - _2.Kb = function $Sb(a) { - return HSb(), LGd(RD(a, 74)); - }; - sfb(Fze, "ElkGraphComponentsProcessor/lambda$3$Type", 1289); - feb(1290, 1, nwe, _Sb); - _2.Mb = function aTb(a) { - return OSb(RD(a, 74)); - }; - sfb(Fze, "ElkGraphComponentsProcessor/lambda$4$Type", 1290); - feb(1291, 1, nwe, bTb); - _2.Mb = function cTb(a) { - return PSb(this.a, RD(a, 74)); - }; - sfb(Fze, "ElkGraphComponentsProcessor/lambda$5$Type", 1291); - feb(1292, 1, {}, dTb); - _2.Kb = function eTb(a) { - return QSb(this.a, RD(a, 74)); - }; - sfb(Fze, "ElkGraphComponentsProcessor/lambda$6$Type", 1292); - feb(1205, 1, {}, rTb); - _2.a = 0; - sfb(Fze, "ElkGraphTransformer", 1205); - feb(1206, 1, {}, tTb); - _2.Yd = function uTb(a, b) { - sTb(this, RD(a, 167), RD(b, 272)); - }; - sfb(Fze, "ElkGraphTransformer/OffsetApplier", 1206); - feb(1207, 1, Qve, wTb); - _2.Cd = function xTb(a) { - vTb(this, RD(a, 8)); - }; - sfb(Fze, "ElkGraphTransformer/OffsetApplier/OffSetToChainApplier", 1207); - feb(760, 1, {}, DTb); - sfb(Kze, Lze, 760); - feb(1195, 1, fye, FTb); - _2.Ne = function GTb(a, b) { - return ETb(RD(a, 235), RD(b, 235)); - }; - _2.Fb = function HTb(a) { - return this === a; - }; - _2.Oe = function ITb() { - return new Frb(this); - }; - sfb(Kze, Mze, 1195); - feb(1196, 1, Qve, OTb); - _2.Cd = function PTb(a) { - NTb(this.b, this.a, RD(a, 250)); - }; - sfb(Kze, Nze, 1196); - feb(738, 205, oze, TTb); - _2.rf = function UTb(a, b) { - QTb(this, a, b); - }; - sfb(Kze, "ForceLayoutProvider", 738); - feb(309, 137, { 3: 1, 309: 1, 96: 1, 137: 1 }); - sfb(Oze, "FParticle", 309); - feb(250, 309, { 3: 1, 250: 1, 309: 1, 96: 1, 137: 1 }, WTb); - _2.Ib = function XTb() { - var a; - if (this.a) { - a = Wmb(this.a.a, this, 0); - return a >= 0 ? "b" + a + "[" + bUb(this.a) + "]" : "b[" + bUb(this.a) + "]"; - } - return "b_" + kFb(this); - }; - sfb(Oze, "FBendpoint", 250); - feb(290, 137, { 3: 1, 290: 1, 96: 1, 137: 1 }, cUb); - _2.Ib = function dUb() { - return bUb(this); - }; - sfb(Oze, "FEdge", 290); - feb(235, 137, { 3: 1, 235: 1, 96: 1, 137: 1 }, gUb); - var tP = sfb(Oze, "FGraph", 235); - feb(454, 309, { 3: 1, 454: 1, 309: 1, 96: 1, 137: 1 }, iUb); - _2.Ib = function jUb() { - return this.b == null || this.b.length == 0 ? "l[" + bUb(this.a) + "]" : "l_" + this.b; - }; - sfb(Oze, "FLabel", 454); - feb(153, 309, { 3: 1, 153: 1, 309: 1, 96: 1, 137: 1 }, lUb); - _2.Ib = function mUb() { - return kUb(this); - }; - _2.a = 0; - sfb(Oze, "FNode", 153); - feb(2100, 1, {}); - _2.vf = function rUb(a) { - nUb(this, a); - }; - _2.wf = function sUb() { - oUb(this); - }; - _2.d = 0; - sfb(Qze, "AbstractForceModel", 2100); - feb(641, 2100, { 641: 1 }, tUb); - _2.uf = function vUb(a, b) { - var c2, d, e, f2, g; - qUb(this.f, a, b); - e = ojd(ajd(b.d), a.d); - g = $wnd.Math.sqrt(e.a * e.a + e.b * e.b); - d = $wnd.Math.max(0, g - ejd(a.e) / 2 - ejd(b.e) / 2); - c2 = fUb(this.e, a, b); - c2 > 0 ? f2 = -uUb(d, this.c) * c2 : f2 = yUb(d, this.b) * RD(mQb(a, (yVb(), lVb)), 17).a; - ijd(e, f2 / g); - return e; - }; - _2.vf = function wUb(a) { - nUb(this, a); - this.a = RD(mQb(a, (yVb(), aVb)), 17).a; - this.c = Kfb(UD(mQb(a, rVb))); - this.b = Kfb(UD(mQb(a, nVb))); - }; - _2.xf = function xUb(a) { - return a < this.a; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - sfb(Qze, "EadesModel", 641); - feb(642, 2100, { 642: 1 }, zUb); - _2.uf = function BUb(a, b) { - var c2, d, e, f2, g; - qUb(this.f, a, b); - e = ojd(ajd(b.d), a.d); - g = $wnd.Math.sqrt(e.a * e.a + e.b * e.b); - d = $wnd.Math.max(0, g - ejd(a.e) / 2 - ejd(b.e) / 2); - f2 = FUb(d, this.a) * RD(mQb(a, (yVb(), lVb)), 17).a; - c2 = fUb(this.e, a, b); - c2 > 0 && (f2 -= AUb(d, this.a) * c2); - ijd(e, f2 * this.b / g); - return e; - }; - _2.vf = function CUb(a) { - var b, c2, d, e, f2, g, h; - nUb(this, a); - this.b = Kfb(UD(mQb(a, (yVb(), sVb)))); - this.c = this.b / RD(mQb(a, aVb), 17).a; - d = a.e.c.length; - f2 = 0; - e = 0; - for (h = new Anb(a.e); h.a < h.c.c.length; ) { - g = RD(ynb(h), 153); - f2 += g.e.a; - e += g.e.b; - } - b = f2 * e; - c2 = Kfb(UD(mQb(a, rVb))) * Tye; - this.a = $wnd.Math.sqrt(b / (2 * d)) * c2; - }; - _2.wf = function DUb() { - oUb(this); - this.b -= this.c; - }; - _2.xf = function EUb(a) { - return this.b > 0; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - sfb(Qze, "FruchtermanReingoldModel", 642); - feb(860, 1, Eye, PUb); - _2.hf = function QUb(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Rze), ""), "Force Model"), "Determines the model for force calculation."), IUb), (kid(), eid)), BP), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Sze), ""), "Iterations"), "The number of iterations on the force model."), sgb(300)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Tze), ""), "Repulsive Power"), "Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model"), sgb(0)), gid), bJ), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Uze), ""), "FR Temperature"), "The temperature is used as a scaling factor for particle displacements."), Vze), did), VI), xsb(Whd)))); - zgd(a, Uze, Rze, NUb); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Wze), ""), "Eades Repulsion"), "Factor for repulsive forces in Eades' model."), 5), did), VI), xsb(Whd)))); - zgd(a, Wze, Rze, KUb); - zVb((new AVb(), a)); - }; - var GUb, HUb, IUb, JUb, KUb, LUb, MUb, NUb; - sfb(Xze, "ForceMetaDataProvider", 860); - feb(432, 22, { 3: 1, 34: 1, 22: 1, 432: 1 }, UUb); - var RUb, SUb; - var BP = tfb(Xze, "ForceModelStrategy", 432, WI, WUb, VUb); - var XUb; - feb(Awe, 1, Eye, AVb); - _2.hf = function BVb(a) { - zVb(a); - }; - var ZUb, $Ub, _Ub, aVb, bVb, cVb, dVb, eVb, fVb, gVb, hVb, iVb, jVb, kVb, lVb, mVb, nVb, oVb, pVb, qVb, rVb, sVb, tVb, uVb, vVb, wVb, xVb; - sfb(Xze, "ForceOptions", Awe); - feb(1001, 1, {}, CVb); - _2.sf = function DVb() { - var a; - return a = new TTb(), a; - }; - _2.tf = function EVb(a) { - }; - sfb(Xze, "ForceOptions/ForceFactory", 1001); - var FVb, GVb, HVb, IVb; - feb(861, 1, Eye, RVb); - _2.hf = function SVb(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), vAe), ""), "Fixed Position"), "Prevent that the node is moved by the layout algorithm."), (Geb(), false)), (kid(), cid)), QI), xsb((Yhd(), Vhd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), wAe), ""), "Desired Edge Length"), "Either specified for parent nodes or for individual edges, where the latter takes higher precedence."), 100), did), VI), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Thd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), xAe), ""), "Layout Dimension"), "Dimensions that are permitted to be altered during layout."), MVb), eid), JP), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), yAe), ""), "Stress Epsilon"), "Termination criterion for the iterative process."), Vze), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), zAe), ""), "Iteration Limit"), "Maximum number of performed iterations. Takes higher precedence than 'epsilon'."), sgb(lve)), gid), bJ), xsb(Whd)))); - eWb((new fWb(), a)); - }; - var KVb, LVb, MVb, NVb, OVb, PVb; - sfb(Xze, "StressMetaDataProvider", 861); - feb(1004, 1, Eye, fWb); - _2.hf = function gWb(a) { - eWb(a); - }; - var TVb, UVb, VVb, WVb, XVb, YVb, ZVb, $Vb, _Vb, aWb, bWb, cWb; - sfb(Xze, "StressOptions", 1004); - feb(1005, 1, {}, hWb); - _2.sf = function iWb() { - var a; - return a = new kWb(), a; - }; - _2.tf = function jWb(a) { - }; - sfb(Xze, "StressOptions/StressFactory", 1005); - feb(1110, 205, oze, kWb); - _2.rf = function lWb(a, b) { - var c2, d, e, f2, g; - b.Ug(BAe, 1); - Heb(TD(Gxd(a, (dWb(), XVb)))) ? Heb(TD(Gxd(a, bWb))) || RFb((c2 = new SFb((lud(), new zud(a))), c2)) : QTb(new TTb(), a, b.eh(1)); - e = KTb(a); - d = CTb(this.a, e); - for (g = d.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 235); - if (f2.e.c.length <= 1) { - continue; - } - uWb(this.b, f2); - sWb(this.b); - Umb(f2.d, new mWb()); - } - e = BTb(d); - JTb(e); - b.Vg(); - }; - sfb(DAe, "StressLayoutProvider", 1110); - feb(1111, 1, Qve, mWb); - _2.Cd = function nWb(a) { - hUb(RD(a, 454)); - }; - sfb(DAe, "StressLayoutProvider/lambda$0$Type", 1111); - feb(1002, 1, {}, vWb); - _2.c = 0; - _2.e = 0; - _2.g = 0; - sfb(DAe, "StressMajorization", 1002); - feb(391, 22, { 3: 1, 34: 1, 22: 1, 391: 1 }, BWb); - var xWb, yWb, zWb; - var JP = tfb(DAe, "StressMajorization/Dimension", 391, WI, DWb, CWb); - var EWb; - feb(1003, 1, fye, GWb); - _2.Ne = function HWb(a, b) { - return wWb(this.a, RD(a, 153), RD(b, 153)); - }; - _2.Fb = function IWb(a) { - return this === a; - }; - _2.Oe = function JWb() { - return new Frb(this); - }; - sfb(DAe, "StressMajorization/lambda$0$Type", 1003); - feb(1192, 1, {}, RWb); - sfb(FAe, "ElkLayered", 1192); - feb(1193, 1, Qve, UWb); - _2.Cd = function VWb(a) { - SWb(this.a, RD(a, 36)); - }; - sfb(FAe, "ElkLayered/lambda$0$Type", 1193); - feb(1194, 1, Qve, WWb); - _2.Cd = function XWb(a) { - TWb(this.a, RD(a, 36)); - }; - sfb(FAe, "ElkLayered/lambda$1$Type", 1194); - feb(1281, 1, {}, dXb); - var YWb, ZWb, $Wb; - sfb(FAe, "GraphConfigurator", 1281); - feb(770, 1, Qve, fXb); - _2.Cd = function gXb(a) { - aXb(this.a, RD(a, 10)); - }; - sfb(FAe, "GraphConfigurator/lambda$0$Type", 770); - feb(771, 1, {}, hXb); - _2.Kb = function iXb(a) { - return _Wb(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(FAe, "GraphConfigurator/lambda$1$Type", 771); - feb(772, 1, Qve, jXb); - _2.Cd = function kXb(a) { - aXb(this.a, RD(a, 10)); - }; - sfb(FAe, "GraphConfigurator/lambda$2$Type", 772); - feb(1109, 205, oze, lXb); - _2.rf = function mXb(a, b) { - var c2; - c2 = c5b(new k5b(), a); - dE(Gxd(a, (yCc(), IAc))) === dE((Fnd(), Cnd)) ? LWb(this.a, c2, b) : MWb(this.a, c2, b); - b.$g() || J5b(new N5b(), c2); - }; - sfb(FAe, "LayeredLayoutProvider", 1109); - feb(367, 22, { 3: 1, 34: 1, 22: 1, 367: 1 }, tXb); - var nXb, oXb, pXb, qXb, rXb; - var UP = tfb(FAe, "LayeredPhases", 367, WI, vXb, uXb); - var wXb; - feb(1717, 1, {}, EXb); - _2.i = 0; - var yXb; - sfb(GAe, "ComponentsToCGraphTransformer", 1717); - var jYb; - feb(1718, 1, {}, FXb); - _2.yf = function GXb(a, b) { - return $wnd.Math.min(a.a != null ? Kfb(a.a) : a.c.i, b.a != null ? Kfb(b.a) : b.c.i); - }; - _2.zf = function HXb(a, b) { - return $wnd.Math.min(a.a != null ? Kfb(a.a) : a.c.i, b.a != null ? Kfb(b.a) : b.c.i); - }; - sfb(GAe, "ComponentsToCGraphTransformer/1", 1718); - feb(86, 1, { 86: 1 }); - _2.i = 0; - _2.k = true; - _2.o = pxe; - var bQ = sfb(HAe, "CNode", 86); - feb(470, 86, { 470: 1, 86: 1 }, IXb, JXb); - _2.Ib = function KXb() { - return ""; - }; - sfb(GAe, "ComponentsToCGraphTransformer/CRectNode", 470); - feb(1688, 1, {}, XXb); - var LXb, MXb; - sfb(GAe, "OneDimensionalComponentsCompaction", 1688); - feb(1689, 1, {}, $Xb); - _2.Kb = function _Xb(a) { - return YXb(RD(a, 42)); - }; - _2.Fb = function aYb(a) { - return this === a; - }; - sfb(GAe, "OneDimensionalComponentsCompaction/lambda$0$Type", 1689); - feb(1690, 1, {}, bYb); - _2.Kb = function cYb(a) { - return ZXb(RD(a, 42)); - }; - _2.Fb = function dYb(a) { - return this === a; - }; - sfb(GAe, "OneDimensionalComponentsCompaction/lambda$1$Type", 1690); - feb(1720, 1, {}, fYb); - sfb(HAe, "CGraph", 1720); - feb(194, 1, { 194: 1 }, iYb); - _2.b = 0; - _2.c = 0; - _2.e = 0; - _2.g = true; - _2.i = pxe; - sfb(HAe, "CGroup", 194); - feb(1719, 1, {}, lYb); - _2.yf = function mYb(a, b) { - return $wnd.Math.max(a.a != null ? Kfb(a.a) : a.c.i, b.a != null ? Kfb(b.a) : b.c.i); - }; - _2.zf = function nYb(a, b) { - return $wnd.Math.max(a.a != null ? Kfb(a.a) : a.c.i, b.a != null ? Kfb(b.a) : b.c.i); - }; - sfb(HAe, kye, 1719); - feb(1721, 1, {}, EYb); - _2.d = false; - var oYb; - var eQ = sfb(HAe, pye, 1721); - feb(1722, 1, {}, FYb); - _2.Kb = function GYb(a) { - return pYb(), Geb(), RD(RD(a, 42).a, 86).d.e != 0 ? true : false; - }; - _2.Fb = function HYb(a) { - return this === a; - }; - sfb(HAe, qye, 1722); - feb(833, 1, {}, KYb); - _2.a = false; - _2.b = false; - _2.c = false; - _2.d = false; - sfb(HAe, rye, 833); - feb(1898, 1, {}, QYb); - sfb(IAe, sye, 1898); - var wQ = ufb(JAe, hye); - feb(1899, 1, { 382: 1 }, UYb); - _2.bf = function VYb(a) { - SYb(this, RD(a, 476)); - }; - sfb(IAe, tye, 1899); - feb(Owe, 1, fye, XYb); - _2.Ne = function YYb(a, b) { - return WYb(RD(a, 86), RD(b, 86)); - }; - _2.Fb = function ZYb(a) { - return this === a; - }; - _2.Oe = function $Yb() { - return new Frb(this); - }; - sfb(IAe, uye, Owe); - feb(476, 1, { 476: 1 }, _Yb); - _2.a = false; - sfb(IAe, vye, 476); - feb(1901, 1, fye, aZb); - _2.Ne = function bZb(a, b) { - return RYb(RD(a, 476), RD(b, 476)); - }; - _2.Fb = function cZb(a) { - return this === a; - }; - _2.Oe = function dZb() { - return new Frb(this); - }; - sfb(IAe, wye, 1901); - feb(148, 1, { 148: 1 }, eZb, fZb); - _2.Fb = function gZb(a) { - var b; - if (a == null) { - return false; - } - if (mQ != rb(a)) { - return false; - } - b = RD(a, 148); - return Fvb(this.c, b.c) && Fvb(this.d, b.d); - }; - _2.Hb = function hZb() { - return Tnb(cD(WC(jJ, 1), rve, 1, 5, [this.c, this.d])); - }; - _2.Ib = function iZb() { - return "(" + this.c + pve + this.d + (this.a ? "cx" : "") + this.b + ")"; - }; - _2.a = true; - _2.c = 0; - _2.d = 0; - var mQ = sfb(JAe, "Point", 148); - feb(416, 22, { 3: 1, 34: 1, 22: 1, 416: 1 }, qZb); - var jZb, kZb, lZb, mZb; - var lQ = tfb(JAe, "Point/Quadrant", 416, WI, uZb, tZb); - var vZb; - feb(1708, 1, {}, EZb); - _2.b = null; - _2.c = null; - _2.d = null; - _2.e = null; - _2.f = null; - var xZb, yZb, zZb, AZb, BZb; - sfb(JAe, "RectilinearConvexHull", 1708); - feb(583, 1, { 382: 1 }, PZb); - _2.bf = function QZb(a) { - OZb(this, RD(a, 148)); - }; - _2.b = 0; - var MZb; - sfb(JAe, "RectilinearConvexHull/MaximalElementsEventHandler", 583); - feb(1710, 1, fye, SZb); - _2.Ne = function TZb(a, b) { - return RZb(UD(a), UD(b)); - }; - _2.Fb = function UZb(a) { - return this === a; - }; - _2.Oe = function VZb() { - return new Frb(this); - }; - sfb(JAe, "RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type", 1710); - feb(1709, 1, { 382: 1 }, XZb); - _2.bf = function YZb(a) { - WZb(this, RD(a, 148)); - }; - _2.a = 0; - _2.b = null; - _2.c = null; - _2.d = null; - _2.e = null; - sfb(JAe, "RectilinearConvexHull/RectangleEventHandler", 1709); - feb(1711, 1, fye, ZZb); - _2.Ne = function $Zb(a, b) { - return GZb(RD(a, 148), RD(b, 148)); - }; - _2.Fb = function _Zb(a) { - return this === a; - }; - _2.Oe = function a$b() { - return new Frb(this); - }; - sfb(JAe, "RectilinearConvexHull/lambda$0$Type", 1711); - feb(1712, 1, fye, b$b); - _2.Ne = function c$b(a, b) { - return HZb(RD(a, 148), RD(b, 148)); - }; - _2.Fb = function d$b(a) { - return this === a; - }; - _2.Oe = function e$b() { - return new Frb(this); - }; - sfb(JAe, "RectilinearConvexHull/lambda$1$Type", 1712); - feb(1713, 1, fye, f$b); - _2.Ne = function g$b(a, b) { - return IZb(RD(a, 148), RD(b, 148)); - }; - _2.Fb = function h$b(a) { - return this === a; - }; - _2.Oe = function i$b() { - return new Frb(this); - }; - sfb(JAe, "RectilinearConvexHull/lambda$2$Type", 1713); - feb(1714, 1, fye, j$b); - _2.Ne = function k$b(a, b) { - return JZb(RD(a, 148), RD(b, 148)); - }; - _2.Fb = function l$b(a) { - return this === a; - }; - _2.Oe = function m$b() { - return new Frb(this); - }; - sfb(JAe, "RectilinearConvexHull/lambda$3$Type", 1714); - feb(1715, 1, fye, n$b); - _2.Ne = function o$b(a, b) { - return KZb(RD(a, 148), RD(b, 148)); - }; - _2.Fb = function p$b(a) { - return this === a; - }; - _2.Oe = function q$b() { - return new Frb(this); - }; - sfb(JAe, "RectilinearConvexHull/lambda$4$Type", 1715); - feb(1716, 1, {}, s$b); - sfb(JAe, "Scanline", 1716); - feb(2104, 1, {}); - sfb(KAe, "AbstractGraphPlacer", 2104); - feb(335, 1, { 335: 1 }, C$b); - _2.Ff = function D$b(a) { - if (this.Gf(a)) { - Rc(this.b, RD(mQb(a, (Ywc(), ewc)), 21), a); - return true; - } else { - return false; - } - }; - _2.Gf = function E$b(a) { - var b, c2, d, e; - b = RD(mQb(a, (Ywc(), ewc)), 21); - e = RD(Qc(y$b, b), 21); - for (d = e.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 21); - if (!RD(Qc(this.b, c2), 15).dc()) { - return false; - } - } - return true; - }; - var y$b; - sfb(KAe, "ComponentGroup", 335); - feb(779, 2104, {}, J$b); - _2.Hf = function K$b(a) { - var b, c2; - for (c2 = new Anb(this.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 335); - if (b.Ff(a)) { - return; - } - } - Rmb(this.a, new C$b(a)); - }; - _2.Ef = function L$b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2; - this.a.c.length = 0; - b.a.c.length = 0; - if (a.dc()) { - b.f.a = 0; - b.f.b = 0; - return; - } - g = RD(a.Xb(0), 36); - kQb(b, g); - for (e = a.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 36); - this.Hf(d); - } - o2 = new pjd(); - f2 = Kfb(UD(mQb(g, (yCc(), SBc)))); - for (j = new Anb(this.a); j.a < j.c.c.length; ) { - h = RD(ynb(j), 335); - k = F$b(h, f2); - x$b(Uc(h.b), o2.a, o2.b); - o2.a += k.a; - o2.b += k.b; - } - b.f.a = o2.a - f2; - b.f.b = o2.b - f2; - if (Heb(TD(mQb(g, Vzc))) && dE(mQb(g, yAc)) === dE((Ymd(), Umd))) { - for (n = a.Kc(); n.Ob(); ) { - l = RD(n.Pb(), 36); - w$b(l, l.c.a, l.c.b); - } - c2 = new j_b(); - _$b(c2, a, f2); - for (m = a.Kc(); m.Ob(); ) { - l = RD(m.Pb(), 36); - $id(hjd(l.c), c2.e); - } - $id(hjd(b.f), c2.a); - } - for (i2 = new Anb(this.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 335); - v$b(b, Uc(h.b)); - } - }; - sfb(KAe, "ComponentGroupGraphPlacer", 779); - feb(1312, 779, {}, N$b); - _2.Hf = function O$b(a) { - M$b(this, a); - }; - _2.Ef = function P$b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t; - this.a.c.length = 0; - b.a.c.length = 0; - if (a.dc()) { - b.f.a = 0; - b.f.b = 0; - return; - } - g = RD(a.Xb(0), 36); - kQb(b, g); - for (e = a.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 36); - M$b(this, d); - } - t = new pjd(); - s = new pjd(); - p = new pjd(); - o2 = new pjd(); - f2 = Kfb(UD(mQb(g, (yCc(), SBc)))); - for (j = new Anb(this.a); j.a < j.c.c.length; ) { - h = RD(ynb(j), 335); - if (Dmd(RD(mQb(b, (umd(), Nkd)), 88))) { - p.a = t.a; - for (r = new aw(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = RD(_v(r.b.Pb()), 21); - if (q.Hc((qpd(), Yod))) { - p.a = s.a; - break; - } - } - } else if (Emd(RD(mQb(b, Nkd), 88))) { - p.b = t.b; - for (r = new aw(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = RD(_v(r.b.Pb()), 21); - if (q.Hc((qpd(), ppd))) { - p.b = s.b; - break; - } - } - } - k = F$b(RD(h, 579), f2); - x$b(Uc(h.b), p.a, p.b); - if (Dmd(RD(mQb(b, Nkd), 88))) { - s.a = p.a + k.a; - o2.a = $wnd.Math.max(o2.a, s.a); - for (r = new aw(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = RD(_v(r.b.Pb()), 21); - if (q.Hc((qpd(), npd))) { - t.a = p.a + k.a; - break; - } - } - s.b = p.b + k.b; - p.b = s.b; - o2.b = $wnd.Math.max(o2.b, p.b); - } else if (Emd(RD(mQb(b, Nkd), 88))) { - s.b = p.b + k.b; - o2.b = $wnd.Math.max(o2.b, s.b); - for (r = new aw(Pc(Fc(h.b).a).a.kc()); r.b.Ob(); ) { - q = RD(_v(r.b.Pb()), 21); - if (q.Hc((qpd(), Xod))) { - t.b = p.b + k.b; - break; - } - } - s.a = p.a + k.a; - p.a = s.a; - o2.a = $wnd.Math.max(o2.a, p.a); - } - } - b.f.a = o2.a - f2; - b.f.b = o2.b - f2; - if (Heb(TD(mQb(g, Vzc))) && dE(mQb(g, yAc)) === dE((Ymd(), Umd))) { - for (n = a.Kc(); n.Ob(); ) { - l = RD(n.Pb(), 36); - w$b(l, l.c.a, l.c.b); - } - c2 = new j_b(); - _$b(c2, a, f2); - for (m = a.Kc(); m.Ob(); ) { - l = RD(m.Pb(), 36); - $id(hjd(l.c), c2.e); - } - $id(hjd(b.f), c2.a); - } - for (i2 = new Anb(this.a); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 335); - v$b(b, Uc(h.b)); - } - }; - sfb(KAe, "ComponentGroupModelOrderGraphPlacer", 1312); - feb(389, 22, { 3: 1, 34: 1, 22: 1, 389: 1 }, V$b); - var Q$b, R$b, S$b, T$b; - var CQ = tfb(KAe, "ComponentOrderingStrategy", 389, WI, X$b, W$b); - var Y$b; - feb(659, 1, {}, j_b); - sfb(KAe, "ComponentsCompactor", 659); - feb(1533, 13, Cxe, m_b); - _2.Fc = function n_b(a) { - return k_b(this, RD(a, 148)); - }; - sfb(KAe, "ComponentsCompactor/Hullpoints", 1533); - feb(1530, 1, { 855: 1 }, p_b); - _2.a = false; - sfb(KAe, "ComponentsCompactor/InternalComponent", 1530); - feb(1529, 1, Vve, q_b); - _2.Jc = function r_b(a) { - xgb(this, a); - }; - _2.Kc = function s_b() { - return new Anb(this.a); - }; - sfb(KAe, "ComponentsCompactor/InternalConnectedComponents", 1529); - feb(1532, 1, { 602: 1 }, t_b); - _2.Bf = function v_b() { - return null; - }; - _2.Cf = function w_b() { - return this.a; - }; - _2.Af = function u_b() { - return f_b(this.d); - }; - _2.Df = function x_b() { - return this.b; - }; - sfb(KAe, "ComponentsCompactor/InternalExternalExtension", 1532); - feb(1531, 1, { 602: 1 }, y_b); - _2.Cf = function B_b() { - return this.a; - }; - _2.Af = function z_b() { - return f_b(this.d); - }; - _2.Bf = function A_b() { - return this.c; - }; - _2.Df = function C_b() { - return this.b; - }; - sfb(KAe, "ComponentsCompactor/InternalUnionExternalExtension", 1531); - feb(1535, 1, {}, D_b); - sfb(KAe, "ComponentsCompactor/OuterSegments", 1535); - feb(1534, 1, {}, E_b); - sfb(KAe, "ComponentsCompactor/Segments", 1534); - feb(1282, 1, {}, I_b); - sfb(KAe, Lze, 1282); - feb(1283, 1, fye, K_b); - _2.Ne = function L_b(a, b) { - return J_b(RD(a, 36), RD(b, 36)); - }; - _2.Fb = function M_b(a) { - return this === a; - }; - _2.Oe = function N_b() { - return new Frb(this); - }; - sfb(KAe, "ComponentsProcessor/lambda$0$Type", 1283); - feb(579, 335, { 335: 1, 579: 1 }, S_b); - _2.Ff = function T_b(a) { - return Q_b(this, a); - }; - _2.Gf = function U_b(a) { - return R_b(this, a); - }; - var O_b; - sfb(KAe, "ModelOrderComponentGroup", 579); - feb(1310, 2104, {}, V_b); - _2.Ef = function W_b(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - if (a.gc() == 1) { - l = RD(a.Xb(0), 36); - if (l != b) { - b.a.c.length = 0; - u$b(b, l, 0, 0); - kQb(b, l); - C2b(b.d, l.d); - b.f.a = l.f.a; - b.f.b = l.f.b; - } - return; - } else if (a.dc()) { - b.a.c.length = 0; - b.f.a = 0; - b.f.b = 0; - return; - } - this.Jf(a, b); - e = RD(a.Xb(0), 36); - b.a.c.length = 0; - kQb(b, e); - j = 0; - m = 0; - for (g = a.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 36); - k = f2.f; - j = $wnd.Math.max(j, k.a); - m += k.a * k.b; - } - j = $wnd.Math.max(j, $wnd.Math.sqrt(m) * Kfb(UD(mQb(b, (yCc(), Tzc))))); - d = Kfb(UD(mQb(b, SBc))); - this.If(a, b, j, d); - if (Heb(TD(mQb(e, Vzc)))) { - c2 = new j_b(); - _$b(c2, a, d); - for (i2 = a.Kc(); i2.Ob(); ) { - h = RD(i2.Pb(), 36); - $id(hjd(h.c), c2.e); - } - $id(hjd(b.f), c2.a); - } - v$b(b, a); - }; - _2.If = function X_b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l; - k = 0; - l = 0; - h = 0; - e = d; - for (g = a.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 36); - j = f2.f; - if (k + j.a > c2) { - k = 0; - l += h + d; - h = 0; - } - i2 = f2.c; - w$b(f2, k + i2.a, l + i2.b); - hjd(i2); - e = $wnd.Math.max(e, k + j.a); - h = $wnd.Math.max(h, j.b); - k += j.a + d; - } - b.f.a = e; - b.f.b = l + h; - }; - _2.Jf = function Y_b(a, b) { - var c2, d, e, f2, g; - if (dE(mQb(b, (yCc(), Yzc))) === dE((U$b(), T$b))) { - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 36); - g = 0; - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - g += RD(mQb(e, JBc), 17).a; - } - c2.p = g; - } - yob(); - a.jd(new b0b()); - } - }; - sfb(KAe, "SimpleRowGraphPlacer", 1310); - feb(1313, 1310, {}, Z_b); - _2.If = function $_b(a, b, c2, d) { - var e, f2, g, h, i2, j, k, l, m, n; - m = 0; - n = 0; - h = 0; - e = d; - i2 = null; - l = 0; - for (g = a.Kc(); g.Ob(); ) { - f2 = RD(g.Pb(), 36); - k = f2.f; - if (m + k.a > c2 && !RD(mQb(f2, (Ywc(), ewc)), 21).Hc((qpd(), Yod)) || !!i2 && RD(mQb(i2, (Ywc(), ewc)), 21).Hc((qpd(), Xod)) || RD(mQb(f2, (Ywc(), ewc)), 21).Hc((qpd(), ppd))) { - m = l; - n += h + d; - h = 0; - } - j = f2.c; - RD(mQb(f2, (Ywc(), ewc)), 21).Hc((qpd(), Yod)) && (m = e + d); - w$b(f2, m + j.a, n + j.b); - e = $wnd.Math.max(e, m + k.a); - RD(mQb(f2, ewc), 21).Hc(npd) && (l = $wnd.Math.max(l, m + k.a + d)); - hjd(j); - h = $wnd.Math.max(h, k.b); - m += k.a + d; - i2 = f2; - } - b.f.a = e; - b.f.b = n + h; - }; - _2.Jf = function __b(a, b) { - }; - sfb(KAe, "ModelOrderRowGraphPlacer", 1313); - feb(1311, 1, fye, b0b); - _2.Ne = function c0b(a, b) { - return a0b(RD(a, 36), RD(b, 36)); - }; - _2.Fb = function d0b(a) { - return this === a; - }; - _2.Oe = function e0b() { - return new Frb(this); - }; - sfb(KAe, "SimpleRowGraphPlacer/1", 1311); - var f0b; - feb(1280, 1, xye, l0b); - _2.Lb = function m0b(a) { - var b; - return b = RD(mQb(RD(a, 249).b, (yCc(), RAc)), 75), !!b && b.b != 0; - }; - _2.Fb = function n0b(a) { - return this === a; - }; - _2.Mb = function o0b(a) { - var b; - return b = RD(mQb(RD(a, 249).b, (yCc(), RAc)), 75), !!b && b.b != 0; - }; - sfb(PAe, "CompoundGraphPostprocessor/1", 1280); - feb(1279, 1, QAe, E0b); - _2.Kf = function F0b(a, b) { - y0b(this, RD(a, 36), b); - }; - sfb(PAe, "CompoundGraphPreprocessor", 1279); - feb(453, 1, { 453: 1 }, G0b); - _2.c = false; - sfb(PAe, "CompoundGraphPreprocessor/ExternalPort", 453); - feb(249, 1, { 249: 1 }, J0b); - _2.Ib = function K0b() { - return ps(this.c) + ":" + _0b(this.b); - }; - sfb(PAe, "CrossHierarchyEdge", 249); - feb(777, 1, fye, M0b); - _2.Ne = function N0b(a, b) { - return L0b(this, RD(a, 249), RD(b, 249)); - }; - _2.Fb = function O0b(a) { - return this === a; - }; - _2.Oe = function Q0b() { - return new Frb(this); - }; - sfb(PAe, "CrossHierarchyEdgeComparator", 777); - feb(305, 137, { 3: 1, 305: 1, 96: 1, 137: 1 }); - _2.p = 0; - sfb(RAe, "LGraphElement", 305); - feb(18, 305, { 3: 1, 18: 1, 305: 1, 96: 1, 137: 1 }, a1b); - _2.Ib = function b1b() { - return _0b(this); - }; - var WQ = sfb(RAe, "LEdge", 18); - feb(36, 305, { 3: 1, 20: 1, 36: 1, 305: 1, 96: 1, 137: 1 }, d1b); - _2.Jc = function e1b(a) { - xgb(this, a); - }; - _2.Kc = function f1b() { - return new Anb(this.b); - }; - _2.Ib = function g1b() { - if (this.b.c.length == 0) { - return "G-unlayered" + Fe(this.a); - } else if (this.a.c.length == 0) { - return "G-layered" + Fe(this.b); - } - return "G[layerless" + Fe(this.a) + ", layers" + Fe(this.b) + "]"; - }; - var eR = sfb(RAe, "LGraph", 36); - var h1b; - feb(666, 1, {}); - _2.Lf = function j1b() { - return this.e.n; - }; - _2.of = function k1b(a) { - return mQb(this.e, a); - }; - _2.Mf = function l1b() { - return this.e.o; - }; - _2.Nf = function m1b() { - return this.e.p; - }; - _2.pf = function n1b(a) { - return nQb(this.e, a); - }; - _2.Of = function o1b(a) { - this.e.n.a = a.a; - this.e.n.b = a.b; - }; - _2.Pf = function p1b(a) { - this.e.o.a = a.a; - this.e.o.b = a.b; - }; - _2.Qf = function q1b(a) { - this.e.p = a; - }; - sfb(RAe, "LGraphAdapters/AbstractLShapeAdapter", 666); - feb(474, 1, { 853: 1 }, r1b); - _2.Rf = function s1b() { - var a, b; - if (!this.b) { - this.b = ev(this.a.b.c.length); - for (b = new Anb(this.a.b); b.a < b.c.c.length; ) { - a = RD(ynb(b), 72); - Rmb(this.b, new D1b(a)); - } - } - return this.b; - }; - _2.b = null; - sfb(RAe, "LGraphAdapters/LEdgeAdapter", 474); - feb(665, 1, {}, t1b); - _2.Sf = function u1b() { - var a, b, c2, d, e, f2; - if (!this.b) { - this.b = new bnb(); - for (d = new Anb(this.a.b); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 30); - for (f2 = new Anb(c2.a); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 10); - if (this.c.Mb(e)) { - Rmb(this.b, new F1b(this, e, this.e)); - if (this.d) { - if (nQb(e, (Ywc(), Xwc))) { - for (b = RD(mQb(e, Xwc), 15).Kc(); b.Ob(); ) { - a = RD(b.Pb(), 10); - Rmb(this.b, new F1b(this, a, false)); - } - } - if (nQb(e, Vvc)) { - for (b = RD(mQb(e, Vvc), 15).Kc(); b.Ob(); ) { - a = RD(b.Pb(), 10); - Rmb(this.b, new F1b(this, a, false)); - } - } - } - } - } - } - } - return this.b; - }; - _2.Lf = function v1b() { - throw Adb(new kib(TAe)); - }; - _2.of = function w1b(a) { - return mQb(this.a, a); - }; - _2.Mf = function x1b() { - return this.a.f; - }; - _2.Nf = function y1b() { - return this.a.p; - }; - _2.pf = function z1b(a) { - return nQb(this.a, a); - }; - _2.Of = function A1b(a) { - throw Adb(new kib(TAe)); - }; - _2.Pf = function B1b(a) { - this.a.f.a = a.a; - this.a.f.b = a.b; - }; - _2.Qf = function C1b(a) { - this.a.p = a; - }; - _2.b = null; - _2.d = false; - _2.e = false; - sfb(RAe, "LGraphAdapters/LGraphAdapter", 665); - feb(585, 666, { 187: 1 }, D1b); - sfb(RAe, "LGraphAdapters/LLabelAdapter", 585); - feb(584, 666, { 695: 1 }, F1b); - _2.Tf = function G1b() { - return this.b; - }; - _2.Uf = function H1b() { - return yob(), yob(), vob; - }; - _2.Rf = function I1b() { - var a, b; - if (!this.a) { - this.a = ev(RD(this.e, 10).b.c.length); - for (b = new Anb(RD(this.e, 10).b); b.a < b.c.c.length; ) { - a = RD(ynb(b), 72); - Rmb(this.a, new D1b(a)); - } - } - return this.a; - }; - _2.Vf = function J1b() { - var a; - a = RD(this.e, 10).d; - return new R2b(a.d, a.c, a.a, a.b); - }; - _2.Wf = function K1b() { - return yob(), yob(), vob; - }; - _2.Xf = function L1b() { - var a, b; - if (!this.c) { - this.c = ev(RD(this.e, 10).j.c.length); - for (b = new Anb(RD(this.e, 10).j); b.a < b.c.c.length; ) { - a = RD(ynb(b), 12); - Rmb(this.c, new Q1b(a, this.d)); - } - } - return this.c; - }; - _2.Yf = function M1b() { - return Heb(TD(mQb(RD(this.e, 10), (Ywc(), Yvc)))); - }; - _2.Zf = function N1b(a) { - RD(this.e, 10).d.b = a.b; - RD(this.e, 10).d.d = a.d; - RD(this.e, 10).d.c = a.c; - RD(this.e, 10).d.a = a.a; - }; - _2.$f = function O1b(a) { - RD(this.e, 10).f.b = a.b; - RD(this.e, 10).f.d = a.d; - RD(this.e, 10).f.c = a.c; - RD(this.e, 10).f.a = a.a; - }; - _2._f = function P1b() { - E1b(this, (i1b(), h1b)); - }; - _2.a = null; - _2.b = null; - _2.c = null; - _2.d = false; - sfb(RAe, "LGraphAdapters/LNodeAdapter", 584); - feb(1788, 666, { 852: 1 }, Q1b); - _2.Uf = function R1b() { - var a, b, c2, d, e, f2, g, h; - if (this.d && RD(this.e, 12).i.k == (r3b(), q3b)) { - return yob(), yob(), vob; - } else if (!this.a) { - this.a = new bnb(); - for (c2 = new Anb(RD(this.e, 12).e); c2.a < c2.c.c.length; ) { - a = RD(ynb(c2), 18); - Rmb(this.a, new r1b(a)); - } - if (this.d) { - d = RD(mQb(RD(this.e, 12), (Ywc(), Iwc)), 10); - if (d) { - for (b = new is(Mr(Z2b(d).a.Kc(), new ir())); gs(b); ) { - a = RD(hs(b), 18); - Rmb(this.a, new r1b(a)); - } - } - } - if (nQb(RD(this.e, 12).i, (Ywc(), Pwc))) { - g = RD(mQb(RD(this.e, 12).i, Pwc), 337); - h = RD(cub(g.e, this.e), 113); - if (h) { - for (f2 = new Anb(h.b); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 340); - Rmb(this.a, new r1b(e.a)); - } - } - } - } - return this.a; - }; - _2.Rf = function S1b() { - var a, b; - if (!this.b) { - this.b = ev(RD(this.e, 12).f.c.length); - for (b = new Anb(RD(this.e, 12).f); b.a < b.c.c.length; ) { - a = RD(ynb(b), 72); - Rmb(this.b, new D1b(a)); - } - } - return this.b; - }; - _2.Wf = function T1b() { - var a, b, c2, d, e, f2, g, h; - if (this.d && RD(this.e, 12).i.k == (r3b(), q3b)) { - return yob(), yob(), vob; - } else if (!this.c) { - this.c = new bnb(); - for (c2 = new Anb(RD(this.e, 12).g); c2.a < c2.c.c.length; ) { - a = RD(ynb(c2), 18); - Rmb(this.c, new r1b(a)); - } - if (this.d) { - d = RD(mQb(RD(this.e, 12), (Ywc(), Iwc)), 10); - if (d) { - for (b = new is(Mr(a3b(d).a.Kc(), new ir())); gs(b); ) { - a = RD(hs(b), 18); - Rmb(this.c, new r1b(a)); - } - } - } - if (nQb(RD(this.e, 12).i, (Ywc(), Pwc))) { - g = RD(mQb(RD(this.e, 12).i, Pwc), 337); - h = RD(cub(g.e, this.e), 113); - if (h) { - for (f2 = new Anb(h.e); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 340); - Rmb(this.c, new r1b(e.a)); - } - } - } - } - return this.c; - }; - _2.ag = function U1b() { - return RD(this.e, 12).j; - }; - _2.bg = function V1b() { - return Heb(TD(mQb(RD(this.e, 12), (Ywc(), nwc)))); - }; - _2.a = null; - _2.b = null; - _2.c = null; - _2.d = false; - sfb(RAe, "LGraphAdapters/LPortAdapter", 1788); - feb(1789, 1, fye, X1b); - _2.Ne = function Y1b(a, b) { - return W1b(RD(a, 12), RD(b, 12)); - }; - _2.Fb = function Z1b(a) { - return this === a; - }; - _2.Oe = function $1b() { - return new Frb(this); - }; - sfb(RAe, "LGraphAdapters/PortComparator", 1789); - feb(818, 1, nwe, _1b); - _2.Mb = function a2b(a) { - return RD(a, 10), i1b(), true; - }; - sfb(RAe, "LGraphAdapters/lambda$0$Type", 818); - feb(404, 305, { 3: 1, 305: 1, 404: 1, 96: 1, 137: 1 }); - sfb(RAe, "LShape", 404); - feb(72, 404, { 3: 1, 305: 1, 72: 1, 404: 1, 96: 1, 137: 1 }, x2b, y2b); - _2.Ib = function z2b() { - var a; - a = w2b(this); - return a == null ? "label" : "l_" + a; - }; - sfb(RAe, "LLabel", 72); - feb(214, 1, { 3: 1, 4: 1, 214: 1, 423: 1 }); - _2.Fb = function K2b(a) { - var b; - if (ZD(a, 214)) { - b = RD(a, 214); - return this.d == b.d && this.a == b.a && this.b == b.b && this.c == b.c; - } else { - return false; - } - }; - _2.Hb = function L2b() { - var a, b; - a = Nfb(this.b) << 16; - a |= Nfb(this.a) & Bwe; - b = Nfb(this.c) << 16; - b |= Nfb(this.d) & Bwe; - return a ^ b; - }; - _2.cg = function N2b(b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - g = 0; - while (g < b.length && M2b((BFb(g, b.length), b.charCodeAt(g)), YAe)) { - ++g; - } - c2 = b.length; - while (c2 > 0 && M2b((BFb(c2 - 1, b.length), b.charCodeAt(c2 - 1)), ZAe)) { - --c2; - } - if (g < c2) { - l = vhb((AFb(g, c2, b.length), b.substr(g, c2 - g)), ",|;"); - try { - for (i2 = l, j = 0, k = i2.length; j < k; ++j) { - h = i2[j]; - f2 = vhb(h, "="); - if (f2.length != 2) { - throw Adb(new agb("Expecting a list of key-value pairs.")); - } - e = Dhb(f2[0]); - m = Neb(Dhb(f2[1])); - lhb(e, "top") ? this.d = m : lhb(e, "left") ? this.b = m : lhb(e, "bottom") ? this.a = m : lhb(e, "right") && (this.c = m); - } - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - d = a; - throw Adb(new agb($Ae + d)); - } else - throw Adb(a); - } - } - }; - _2.Ib = function O2b() { - return "[top=" + this.d + ",left=" + this.b + ",bottom=" + this.a + ",right=" + this.c + "]"; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = 0; - sfb(_Ae, "Spacing", 214); - feb(140, 214, aBe, P2b, Q2b, R2b, S2b); - var h3 = sfb(_Ae, "ElkMargin", 140); - feb(660, 140, aBe, T2b); - sfb(RAe, "LMargin", 660); - feb(10, 404, { 3: 1, 305: 1, 10: 1, 404: 1, 96: 1, 137: 1 }, j3b); - _2.Ib = function k3b() { - return i3b(this); - }; - _2.i = false; - var jR = sfb(RAe, "LNode", 10); - feb(273, 22, { 3: 1, 34: 1, 22: 1, 273: 1 }, s3b); - var l3b, m3b, n3b, o3b, p3b, q3b; - var hR = tfb(RAe, "LNode/NodeType", 273, WI, u3b, t3b); - var v3b; - feb(775, 1, nwe, x3b); - _2.Mb = function y3b(a) { - return Heb(TD(mQb(RD(a, 72), (yCc(), vAc)))); - }; - sfb(RAe, "LNode/lambda$0$Type", 775); - feb(107, 214, bBe, z3b, A3b, B3b); - var i3 = sfb(_Ae, "ElkPadding", 107); - feb(778, 107, bBe, C3b); - sfb(RAe, "LPadding", 778); - feb(12, 404, { 3: 1, 305: 1, 12: 1, 404: 1, 96: 1, 137: 1 }, R3b); - _2.Ib = function S3b() { - var a, b, c2; - a = new bib(); - Zhb((a.a += "p_", a), M3b(this)); - !!this.i && Zhb(Yhb((a.a += "[", a), this.i), "]"); - if (this.e.c.length == 1 && this.g.c.length == 0 && RD(Vmb(this.e, 0), 18).c != this) { - b = RD(Vmb(this.e, 0), 18).c; - Zhb((a.a += " << ", a), M3b(b)); - Zhb(Yhb((a.a += "[", a), b.i), "]"); - } - if (this.e.c.length == 0 && this.g.c.length == 1 && RD(Vmb(this.g, 0), 18).d != this) { - c2 = RD(Vmb(this.g, 0), 18).d; - Zhb((a.a += " >> ", a), M3b(c2)); - Zhb(Yhb((a.a += "[", a), c2.i), "]"); - } - return a.a; - }; - _2.c = true; - _2.d = false; - var D3b, E3b, F3b, G3b, H3b, I3b; - var xR = sfb(RAe, "LPort", 12); - feb(408, 1, Vve, T3b); - _2.Jc = function U3b(a) { - xgb(this, a); - }; - _2.Kc = function V3b() { - var a; - a = new Anb(this.a.e); - return new W3b(a); - }; - sfb(RAe, "LPort/1", 408); - feb(1309, 1, Ave, W3b); - _2.Nb = function X3b(a) { - Ztb(this, a); - }; - _2.Pb = function Z3b() { - return RD(ynb(this.a), 18).c; - }; - _2.Ob = function Y3b() { - return xnb(this.a); - }; - _2.Qb = function $3b() { - znb(this.a); - }; - sfb(RAe, "LPort/1/1", 1309); - feb(369, 1, Vve, _3b); - _2.Jc = function a4b(a) { - xgb(this, a); - }; - _2.Kc = function b4b() { - var a; - return a = new Anb(this.a.g), new c4b(a); - }; - sfb(RAe, "LPort/2", 369); - feb(776, 1, Ave, c4b); - _2.Nb = function d4b(a) { - Ztb(this, a); - }; - _2.Pb = function f4b() { - return RD(ynb(this.a), 18).d; - }; - _2.Ob = function e4b() { - return xnb(this.a); - }; - _2.Qb = function g4b() { - znb(this.a); - }; - sfb(RAe, "LPort/2/1", 776); - feb(1302, 1, Vve, h4b); - _2.Jc = function i4b(a) { - xgb(this, a); - }; - _2.Kc = function j4b() { - return new l4b(this); - }; - sfb(RAe, "LPort/CombineIter", 1302); - feb(208, 1, Ave, l4b); - _2.Nb = function m4b(a) { - Ztb(this, a); - }; - _2.Qb = function p4b() { - $tb(); - }; - _2.Ob = function n4b() { - return k4b(this); - }; - _2.Pb = function o4b() { - return xnb(this.a) ? ynb(this.a) : ynb(this.b); - }; - sfb(RAe, "LPort/CombineIter/1", 208); - feb(1303, 1, xye, r4b); - _2.Lb = function s4b(a) { - return q4b(a); - }; - _2.Fb = function t4b(a) { - return this === a; - }; - _2.Mb = function u4b(a) { - return J3b(), RD(a, 12).g.c.length != 0; - }; - sfb(RAe, "LPort/lambda$0$Type", 1303); - feb(1304, 1, xye, w4b); - _2.Lb = function x4b(a) { - return v4b(a); - }; - _2.Fb = function y4b(a) { - return this === a; - }; - _2.Mb = function z4b(a) { - return J3b(), RD(a, 12).e.c.length != 0; - }; - sfb(RAe, "LPort/lambda$1$Type", 1304); - feb(1305, 1, xye, A4b); - _2.Lb = function B4b(a) { - return J3b(), RD(a, 12).j == (qpd(), Yod); - }; - _2.Fb = function C4b(a) { - return this === a; - }; - _2.Mb = function D4b(a) { - return J3b(), RD(a, 12).j == (qpd(), Yod); - }; - sfb(RAe, "LPort/lambda$2$Type", 1305); - feb(1306, 1, xye, E4b); - _2.Lb = function F4b(a) { - return J3b(), RD(a, 12).j == (qpd(), Xod); - }; - _2.Fb = function G4b(a) { - return this === a; - }; - _2.Mb = function H4b(a) { - return J3b(), RD(a, 12).j == (qpd(), Xod); - }; - sfb(RAe, "LPort/lambda$3$Type", 1306); - feb(1307, 1, xye, I4b); - _2.Lb = function J4b(a) { - return J3b(), RD(a, 12).j == (qpd(), npd); - }; - _2.Fb = function K4b(a) { - return this === a; - }; - _2.Mb = function L4b(a) { - return J3b(), RD(a, 12).j == (qpd(), npd); - }; - sfb(RAe, "LPort/lambda$4$Type", 1307); - feb(1308, 1, xye, M4b); - _2.Lb = function N4b(a) { - return J3b(), RD(a, 12).j == (qpd(), ppd); - }; - _2.Fb = function O4b(a) { - return this === a; - }; - _2.Mb = function P4b(a) { - return J3b(), RD(a, 12).j == (qpd(), ppd); - }; - sfb(RAe, "LPort/lambda$5$Type", 1308); - feb(30, 305, { 3: 1, 20: 1, 305: 1, 30: 1, 96: 1, 137: 1 }, R4b); - _2.Jc = function S4b(a) { - xgb(this, a); - }; - _2.Kc = function T4b() { - return new Anb(this.a); - }; - _2.Ib = function U4b() { - return "L_" + Wmb(this.b.b, this, 0) + Fe(this.a); - }; - sfb(RAe, "Layer", 30); - feb(1330, 1, {}, k5b); - sfb(cBe, dBe, 1330); - feb(1334, 1, {}, o5b); - _2.Kb = function p5b(a) { - return AGd(RD(a, 84)); - }; - sfb(cBe, "ElkGraphImporter/0methodref$connectableShapeToNode$Type", 1334); - feb(1337, 1, {}, q5b); - _2.Kb = function r5b(a) { - return AGd(RD(a, 84)); - }; - sfb(cBe, "ElkGraphImporter/1methodref$connectableShapeToNode$Type", 1337); - feb(1331, 1, Qve, s5b); - _2.Cd = function t5b(a) { - $4b(this.a, RD(a, 123)); - }; - sfb(cBe, Nze, 1331); - feb(1332, 1, Qve, u5b); - _2.Cd = function v5b(a) { - $4b(this.a, RD(a, 123)); - }; - sfb(cBe, eBe, 1332); - feb(1333, 1, {}, w5b); - _2.Kb = function x5b(a) { - return new SDb(null, new Swb(mzd(RD(a, 74)), 16)); - }; - sfb(cBe, fBe, 1333); - feb(1335, 1, nwe, y5b); - _2.Mb = function z5b(a) { - return l5b(this.a, RD(a, 27)); - }; - sfb(cBe, gBe, 1335); - feb(1336, 1, {}, A5b); - _2.Kb = function B5b(a) { - return new SDb(null, new Swb(lzd(RD(a, 74)), 16)); - }; - sfb(cBe, "ElkGraphImporter/lambda$5$Type", 1336); - feb(1338, 1, nwe, C5b); - _2.Mb = function D5b(a) { - return m5b(this.a, RD(a, 27)); - }; - sfb(cBe, "ElkGraphImporter/lambda$7$Type", 1338); - feb(1339, 1, nwe, E5b); - _2.Mb = function F5b(a) { - return n5b(RD(a, 74)); - }; - sfb(cBe, "ElkGraphImporter/lambda$8$Type", 1339); - feb(1297, 1, {}, N5b); - var G5b; - sfb(cBe, "ElkGraphLayoutTransferrer", 1297); - feb(1298, 1, nwe, Q5b); - _2.Mb = function R5b(a) { - return O5b(this.a, RD(a, 18)); - }; - sfb(cBe, "ElkGraphLayoutTransferrer/lambda$0$Type", 1298); - feb(1299, 1, Qve, S5b); - _2.Cd = function T5b(a) { - H5b(); - Rmb(this.a, RD(a, 18)); - }; - sfb(cBe, "ElkGraphLayoutTransferrer/lambda$1$Type", 1299); - feb(1300, 1, nwe, U5b); - _2.Mb = function V5b(a) { - return P5b(this.a, RD(a, 18)); - }; - sfb(cBe, "ElkGraphLayoutTransferrer/lambda$2$Type", 1300); - feb(1301, 1, Qve, W5b); - _2.Cd = function X5b(a) { - H5b(); - Rmb(this.a, RD(a, 18)); - }; - sfb(cBe, "ElkGraphLayoutTransferrer/lambda$3$Type", 1301); - feb(819, 1, {}, e6b); - sfb(hBe, "BiLinkedHashMultiMap", 819); - feb(1550, 1, QAe, h6b); - _2.Kf = function i6b(a, b) { - f6b(RD(a, 36), b); - }; - sfb(hBe, "CommentNodeMarginCalculator", 1550); - feb(1551, 1, {}, j6b); - _2.Kb = function k6b(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "CommentNodeMarginCalculator/lambda$0$Type", 1551); - feb(1552, 1, Qve, l6b); - _2.Cd = function m6b(a) { - g6b(RD(a, 10)); - }; - sfb(hBe, "CommentNodeMarginCalculator/lambda$1$Type", 1552); - feb(1553, 1, QAe, q6b); - _2.Kf = function r6b(a, b) { - o6b(RD(a, 36), b); - }; - sfb(hBe, "CommentPostprocessor", 1553); - feb(1554, 1, QAe, v6b); - _2.Kf = function w6b(a, b) { - s6b(RD(a, 36), b); - }; - sfb(hBe, "CommentPreprocessor", 1554); - feb(1555, 1, QAe, y6b); - _2.Kf = function z6b(a, b) { - x6b(RD(a, 36), b); - }; - sfb(hBe, "ConstraintsPostprocessor", 1555); - feb(1556, 1, QAe, G6b); - _2.Kf = function H6b(a, b) { - E6b(RD(a, 36), b); - }; - sfb(hBe, "EdgeAndLayerConstraintEdgeReverser", 1556); - feb(1557, 1, QAe, K6b); - _2.Kf = function M6b(a, b) { - I6b(RD(a, 36), b); - }; - sfb(hBe, "EndLabelPostprocessor", 1557); - feb(1558, 1, {}, N6b); - _2.Kb = function O6b(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "EndLabelPostprocessor/lambda$0$Type", 1558); - feb(1559, 1, nwe, P6b); - _2.Mb = function Q6b(a) { - return L6b(RD(a, 10)); - }; - sfb(hBe, "EndLabelPostprocessor/lambda$1$Type", 1559); - feb(1560, 1, Qve, R6b); - _2.Cd = function S6b(a) { - J6b(RD(a, 10)); - }; - sfb(hBe, "EndLabelPostprocessor/lambda$2$Type", 1560); - feb(1561, 1, QAe, b7b); - _2.Kf = function e7b(a, b) { - Z6b(RD(a, 36), b); - }; - sfb(hBe, "EndLabelPreprocessor", 1561); - feb(1562, 1, {}, f7b); - _2.Kb = function g7b(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "EndLabelPreprocessor/lambda$0$Type", 1562); - feb(1563, 1, Qve, h7b); - _2.Cd = function i7b(a) { - V6b(this.a, this.b, this.c, RD(a, 10)); - }; - _2.a = 0; - _2.b = 0; - _2.c = false; - sfb(hBe, "EndLabelPreprocessor/lambda$1$Type", 1563); - feb(1564, 1, nwe, j7b); - _2.Mb = function k7b(a) { - return dE(mQb(RD(a, 72), (yCc(), wAc))) === dE((Omd(), Nmd)); - }; - sfb(hBe, "EndLabelPreprocessor/lambda$2$Type", 1564); - feb(1565, 1, Qve, l7b); - _2.Cd = function m7b(a) { - Mub(this.a, RD(a, 72)); - }; - sfb(hBe, "EndLabelPreprocessor/lambda$3$Type", 1565); - feb(1566, 1, nwe, n7b); - _2.Mb = function o7b(a) { - return dE(mQb(RD(a, 72), (yCc(), wAc))) === dE((Omd(), Mmd)); - }; - sfb(hBe, "EndLabelPreprocessor/lambda$4$Type", 1566); - feb(1567, 1, Qve, p7b); - _2.Cd = function q7b(a) { - Mub(this.a, RD(a, 72)); - }; - sfb(hBe, "EndLabelPreprocessor/lambda$5$Type", 1567); - feb(1615, 1, QAe, z7b); - _2.Kf = function A7b(a, b) { - w7b(RD(a, 36), b); - }; - var r7b; - sfb(hBe, "EndLabelSorter", 1615); - feb(1616, 1, fye, C7b); - _2.Ne = function D7b(a, b) { - return B7b(RD(a, 466), RD(b, 466)); - }; - _2.Fb = function E7b(a) { - return this === a; - }; - _2.Oe = function F7b() { - return new Frb(this); - }; - sfb(hBe, "EndLabelSorter/1", 1616); - feb(466, 1, { 466: 1 }, G7b); - sfb(hBe, "EndLabelSorter/LabelGroup", 466); - feb(1617, 1, {}, H7b); - _2.Kb = function I7b(a) { - return s7b(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "EndLabelSorter/lambda$0$Type", 1617); - feb(1618, 1, nwe, J7b); - _2.Mb = function K7b(a) { - return s7b(), RD(a, 10).k == (r3b(), p3b); - }; - sfb(hBe, "EndLabelSorter/lambda$1$Type", 1618); - feb(1619, 1, Qve, L7b); - _2.Cd = function M7b(a) { - x7b(RD(a, 10)); - }; - sfb(hBe, "EndLabelSorter/lambda$2$Type", 1619); - feb(1620, 1, nwe, N7b); - _2.Mb = function O7b(a) { - return s7b(), dE(mQb(RD(a, 72), (yCc(), wAc))) === dE((Omd(), Mmd)); - }; - sfb(hBe, "EndLabelSorter/lambda$3$Type", 1620); - feb(1621, 1, nwe, P7b); - _2.Mb = function Q7b(a) { - return s7b(), dE(mQb(RD(a, 72), (yCc(), wAc))) === dE((Omd(), Nmd)); - }; - sfb(hBe, "EndLabelSorter/lambda$4$Type", 1621); - feb(1568, 1, QAe, a8b); - _2.Kf = function b8b(a, b) { - $7b(this, RD(a, 36)); - }; - _2.b = 0; - _2.c = 0; - sfb(hBe, "FinalSplineBendpointsCalculator", 1568); - feb(1569, 1, {}, c8b); - _2.Kb = function d8b(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "FinalSplineBendpointsCalculator/lambda$0$Type", 1569); - feb(1570, 1, {}, e8b); - _2.Kb = function f8b(a) { - return new SDb(null, new Twb(new is(Mr(a3b(RD(a, 10)).a.Kc(), new ir())))); - }; - sfb(hBe, "FinalSplineBendpointsCalculator/lambda$1$Type", 1570); - feb(1571, 1, nwe, g8b); - _2.Mb = function h8b(a) { - return !W0b(RD(a, 18)); - }; - sfb(hBe, "FinalSplineBendpointsCalculator/lambda$2$Type", 1571); - feb(1572, 1, nwe, i8b); - _2.Mb = function j8b(a) { - return nQb(RD(a, 18), (Ywc(), Twc)); - }; - sfb(hBe, "FinalSplineBendpointsCalculator/lambda$3$Type", 1572); - feb(1573, 1, Qve, k8b); - _2.Cd = function l8b(a) { - T7b(this.a, RD(a, 131)); - }; - sfb(hBe, "FinalSplineBendpointsCalculator/lambda$4$Type", 1573); - feb(1574, 1, Qve, m8b); - _2.Cd = function n8b(a) { - Eob(RD(a, 18).a); - }; - sfb(hBe, "FinalSplineBendpointsCalculator/lambda$5$Type", 1574); - feb(803, 1, QAe, L8b); - _2.Kf = function M8b(a, b) { - C8b(this, RD(a, 36), b); - }; - sfb(hBe, "GraphTransformer", 803); - feb(517, 22, { 3: 1, 34: 1, 22: 1, 517: 1 }, Q8b); - var N8b, O8b; - var vS = tfb(hBe, "GraphTransformer/Mode", 517, WI, S8b, R8b); - var T8b; - feb(1575, 1, QAe, Z8b); - _2.Kf = function $8b(a, b) { - W8b(RD(a, 36), b); - }; - sfb(hBe, "HierarchicalNodeResizingProcessor", 1575); - feb(1576, 1, QAe, f9b); - _2.Kf = function g9b(a, b) { - b9b(RD(a, 36), b); - }; - sfb(hBe, "HierarchicalPortConstraintProcessor", 1576); - feb(1577, 1, fye, i9b); - _2.Ne = function j9b(a, b) { - return h9b(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function k9b(a) { - return this === a; - }; - _2.Oe = function l9b() { - return new Frb(this); - }; - sfb(hBe, "HierarchicalPortConstraintProcessor/NodeComparator", 1577); - feb(1578, 1, QAe, o9b); - _2.Kf = function p9b(a, b) { - m9b(RD(a, 36), b); - }; - sfb(hBe, "HierarchicalPortDummySizeProcessor", 1578); - feb(1579, 1, QAe, C9b); - _2.Kf = function D9b(a, b) { - v9b(this, RD(a, 36), b); - }; - _2.a = 0; - sfb(hBe, "HierarchicalPortOrthogonalEdgeRouter", 1579); - feb(1580, 1, fye, F9b); - _2.Ne = function G9b(a, b) { - return E9b(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function H9b(a) { - return this === a; - }; - _2.Oe = function I9b() { - return new Frb(this); - }; - sfb(hBe, "HierarchicalPortOrthogonalEdgeRouter/1", 1580); - feb(1581, 1, fye, K9b); - _2.Ne = function L9b(a, b) { - return J9b(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function M9b(a) { - return this === a; - }; - _2.Oe = function N9b() { - return new Frb(this); - }; - sfb(hBe, "HierarchicalPortOrthogonalEdgeRouter/2", 1581); - feb(1582, 1, QAe, Q9b); - _2.Kf = function R9b(a, b) { - P9b(RD(a, 36), b); - }; - sfb(hBe, "HierarchicalPortPositionProcessor", 1582); - feb(1583, 1, QAe, $9b); - _2.Kf = function _9b(a, b) { - Z9b(this, RD(a, 36)); - }; - _2.a = 0; - _2.c = 0; - var S9b, T9b; - sfb(hBe, "HighDegreeNodeLayeringProcessor", 1583); - feb(580, 1, { 580: 1 }, aac); - _2.b = -1; - _2.d = -1; - sfb(hBe, "HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation", 580); - feb(1584, 1, {}, bac); - _2.Kb = function cac(a) { - return U9b(), Z2b(RD(a, 10)); - }; - _2.Fb = function dac(a) { - return this === a; - }; - sfb(hBe, "HighDegreeNodeLayeringProcessor/lambda$0$Type", 1584); - feb(1585, 1, {}, eac); - _2.Kb = function fac(a) { - return U9b(), a3b(RD(a, 10)); - }; - _2.Fb = function gac(a) { - return this === a; - }; - sfb(hBe, "HighDegreeNodeLayeringProcessor/lambda$1$Type", 1585); - feb(1591, 1, QAe, mac); - _2.Kf = function nac(a, b) { - lac(this, RD(a, 36), b); - }; - sfb(hBe, "HyperedgeDummyMerger", 1591); - feb(804, 1, {}, oac); - _2.a = false; - _2.b = false; - _2.c = false; - sfb(hBe, "HyperedgeDummyMerger/MergeState", 804); - feb(1592, 1, {}, pac); - _2.Kb = function qac(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "HyperedgeDummyMerger/lambda$0$Type", 1592); - feb(1593, 1, {}, rac); - _2.Kb = function sac(a) { - return new SDb(null, new Swb(RD(a, 10).j, 16)); - }; - sfb(hBe, "HyperedgeDummyMerger/lambda$1$Type", 1593); - feb(1594, 1, Qve, tac); - _2.Cd = function uac(a) { - RD(a, 12).p = -1; - }; - sfb(hBe, "HyperedgeDummyMerger/lambda$2$Type", 1594); - feb(1595, 1, QAe, xac); - _2.Kf = function yac(a, b) { - wac(RD(a, 36), b); - }; - sfb(hBe, "HypernodesProcessor", 1595); - feb(1596, 1, QAe, Aac); - _2.Kf = function Bac(a, b) { - zac(RD(a, 36), b); - }; - sfb(hBe, "InLayerConstraintProcessor", 1596); - feb(1597, 1, QAe, Dac); - _2.Kf = function Eac(a, b) { - Cac(RD(a, 36), b); - }; - sfb(hBe, "InnermostNodeMarginCalculator", 1597); - feb(1598, 1, QAe, Iac); - _2.Kf = function Nac(a, b) { - Hac(this, RD(a, 36)); - }; - _2.a = pxe; - _2.b = pxe; - _2.c = oxe; - _2.d = oxe; - var XS = sfb(hBe, "InteractiveExternalPortPositioner", 1598); - feb(1599, 1, {}, Oac); - _2.Kb = function Pac(a) { - return RD(a, 18).d.i; - }; - _2.Fb = function Qac(a) { - return this === a; - }; - sfb(hBe, "InteractiveExternalPortPositioner/lambda$0$Type", 1599); - feb(1600, 1, {}, Rac); - _2.Kb = function Sac(a) { - return Jac(this.a, UD(a)); - }; - _2.Fb = function Tac(a) { - return this === a; - }; - sfb(hBe, "InteractiveExternalPortPositioner/lambda$1$Type", 1600); - feb(1601, 1, {}, Uac); - _2.Kb = function Vac(a) { - return RD(a, 18).c.i; - }; - _2.Fb = function Wac(a) { - return this === a; - }; - sfb(hBe, "InteractiveExternalPortPositioner/lambda$2$Type", 1601); - feb(1602, 1, {}, Xac); - _2.Kb = function Yac(a) { - return Kac(this.a, UD(a)); - }; - _2.Fb = function Zac(a) { - return this === a; - }; - sfb(hBe, "InteractiveExternalPortPositioner/lambda$3$Type", 1602); - feb(1603, 1, {}, $ac); - _2.Kb = function _ac(a) { - return Lac(this.a, UD(a)); - }; - _2.Fb = function abc(a) { - return this === a; - }; - sfb(hBe, "InteractiveExternalPortPositioner/lambda$4$Type", 1603); - feb(1604, 1, {}, bbc); - _2.Kb = function cbc(a) { - return Mac(this.a, UD(a)); - }; - _2.Fb = function dbc(a) { - return this === a; - }; - sfb(hBe, "InteractiveExternalPortPositioner/lambda$5$Type", 1604); - feb(81, 22, { 3: 1, 34: 1, 22: 1, 81: 1, 196: 1 }, icc); - _2.dg = function jcc() { - switch (this.g) { - case 15: - return new Hrc(); - case 22: - return new bsc(); - case 47: - return new ksc(); - case 28: - case 35: - return new Ldc(); - case 32: - return new h6b(); - case 42: - return new q6b(); - case 1: - return new v6b(); - case 41: - return new y6b(); - case 56: - return new L8b((P8b(), O8b)); - case 0: - return new L8b((P8b(), N8b)); - case 2: - return new G6b(); - case 54: - return new K6b(); - case 33: - return new b7b(); - case 51: - return new a8b(); - case 55: - return new Z8b(); - case 13: - return new f9b(); - case 38: - return new o9b(); - case 44: - return new C9b(); - case 40: - return new Q9b(); - case 9: - return new $9b(); - case 49: - return new Yjc(); - case 37: - return new mac(); - case 43: - return new xac(); - case 27: - return new Aac(); - case 30: - return new Dac(); - case 3: - return new Iac(); - case 18: - return new scc(); - case 29: - return new ycc(); - case 5: - return new Lcc(); - case 50: - return new Ucc(); - case 34: - return new pdc(); - case 36: - return new Zdc(); - case 52: - return new z7b(); - case 11: - return new fec(); - case 7: - return new pec(); - case 39: - return new Dec(); - case 45: - return new Gec(); - case 16: - return new Kec(); - case 10: - return new _ec(); - case 48: - return new Bfc(); - case 21: - return new Ifc(); - case 23: - return new FKc((RKc(), PKc)); - case 8: - return new Rfc(); - case 12: - return new Zfc(); - case 4: - return new cgc(); - case 19: - return new xgc(); - case 17: - return new Vgc(); - case 53: - return new Ygc(); - case 6: - return new Nhc(); - case 25: - return new ahc(); - case 46: - return new rhc(); - case 31: - return new Yhc(); - case 14: - return new jic(); - case 26: - return new Ssc(); - case 20: - return new yic(); - case 24: - return new FKc((RKc(), QKc)); - default: - throw Adb(new agb(lBe + (this.f != null ? this.f : "" + this.g))); - } - }; - var ebc, fbc, gbc, hbc, ibc, jbc, kbc, lbc, mbc, nbc, obc, pbc, qbc, rbc, sbc, tbc, ubc, vbc, wbc, xbc, ybc, zbc, Abc, Bbc, Cbc, Dbc, Ebc, Fbc, Gbc, Hbc, Ibc, Jbc, Kbc, Lbc, Mbc, Nbc, Obc, Pbc, Qbc, Rbc, Sbc, Tbc, Ubc, Vbc, Wbc, Xbc, Ybc, Zbc, $bc, _bc, acc, bcc, ccc, dcc, ecc, fcc, gcc; - var YS = tfb(hBe, mBe, 81, WI, lcc, kcc); - var mcc; - feb(1605, 1, QAe, scc); - _2.Kf = function tcc(a, b) { - qcc(RD(a, 36), b); - }; - sfb(hBe, "InvertedPortProcessor", 1605); - feb(1606, 1, QAe, ycc); - _2.Kf = function zcc(a, b) { - xcc(RD(a, 36), b); - }; - sfb(hBe, "LabelAndNodeSizeProcessor", 1606); - feb(1607, 1, nwe, Acc); - _2.Mb = function Bcc(a) { - return RD(a, 10).k == (r3b(), p3b); - }; - sfb(hBe, "LabelAndNodeSizeProcessor/lambda$0$Type", 1607); - feb(1608, 1, nwe, Ccc); - _2.Mb = function Dcc(a) { - return RD(a, 10).k == (r3b(), m3b); - }; - sfb(hBe, "LabelAndNodeSizeProcessor/lambda$1$Type", 1608); - feb(1609, 1, Qve, Ecc); - _2.Cd = function Fcc(a) { - vcc(this.b, this.a, this.c, RD(a, 10)); - }; - _2.a = false; - _2.c = false; - sfb(hBe, "LabelAndNodeSizeProcessor/lambda$2$Type", 1609); - feb(1610, 1, QAe, Lcc); - _2.Kf = function Mcc(a, b) { - Jcc(RD(a, 36), b); - }; - var Gcc; - sfb(hBe, "LabelDummyInserter", 1610); - feb(1611, 1, xye, Ncc); - _2.Lb = function Occ(a) { - return dE(mQb(RD(a, 72), (yCc(), wAc))) === dE((Omd(), Lmd)); - }; - _2.Fb = function Pcc(a) { - return this === a; - }; - _2.Mb = function Qcc(a) { - return dE(mQb(RD(a, 72), (yCc(), wAc))) === dE((Omd(), Lmd)); - }; - sfb(hBe, "LabelDummyInserter/1", 1611); - feb(1612, 1, QAe, Ucc); - _2.Kf = function Vcc(a, b) { - Tcc(RD(a, 36), b); - }; - sfb(hBe, "LabelDummyRemover", 1612); - feb(1613, 1, nwe, Wcc); - _2.Mb = function Xcc(a) { - return Heb(TD(mQb(RD(a, 72), (yCc(), vAc)))); - }; - sfb(hBe, "LabelDummyRemover/lambda$0$Type", 1613); - feb(1378, 1, QAe, pdc); - _2.Kf = function tdc(a, b) { - ldc(this, RD(a, 36), b); - }; - _2.a = null; - var Ycc; - sfb(hBe, "LabelDummySwitcher", 1378); - feb(293, 1, { 293: 1 }, xdc); - _2.c = 0; - _2.d = null; - _2.f = 0; - sfb(hBe, "LabelDummySwitcher/LabelDummyInfo", 293); - feb(1379, 1, {}, ydc); - _2.Kb = function zdc(a) { - return Zcc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "LabelDummySwitcher/lambda$0$Type", 1379); - feb(1380, 1, nwe, Adc); - _2.Mb = function Bdc(a) { - return Zcc(), RD(a, 10).k == (r3b(), n3b); - }; - sfb(hBe, "LabelDummySwitcher/lambda$1$Type", 1380); - feb(1381, 1, {}, Cdc); - _2.Kb = function Ddc(a) { - return qdc(this.a, RD(a, 10)); - }; - sfb(hBe, "LabelDummySwitcher/lambda$2$Type", 1381); - feb(1382, 1, Qve, Edc); - _2.Cd = function Fdc(a) { - rdc(this.a, RD(a, 293)); - }; - sfb(hBe, "LabelDummySwitcher/lambda$3$Type", 1382); - feb(1383, 1, fye, Gdc); - _2.Ne = function Hdc(a, b) { - return sdc(RD(a, 293), RD(b, 293)); - }; - _2.Fb = function Idc(a) { - return this === a; - }; - _2.Oe = function Jdc() { - return new Frb(this); - }; - sfb(hBe, "LabelDummySwitcher/lambda$4$Type", 1383); - feb(802, 1, QAe, Ldc); - _2.Kf = function Mdc(a, b) { - Kdc(RD(a, 36), b); - }; - sfb(hBe, "LabelManagementProcessor", 802); - feb(1614, 1, QAe, Zdc); - _2.Kf = function $dc(a, b) { - Tdc(RD(a, 36), b); - }; - sfb(hBe, "LabelSideSelector", 1614); - feb(1622, 1, QAe, fec); - _2.Kf = function gec(a, b) { - bec(RD(a, 36), b); - }; - sfb(hBe, "LayerConstraintPostprocessor", 1622); - feb(1623, 1, QAe, pec); - _2.Kf = function qec(a, b) { - nec(RD(a, 36), b); - }; - var hec; - sfb(hBe, "LayerConstraintPreprocessor", 1623); - feb(371, 22, { 3: 1, 34: 1, 22: 1, 371: 1 }, xec); - var rec, sec, tec, uec; - var qT = tfb(hBe, "LayerConstraintPreprocessor/HiddenNodeConnections", 371, WI, zec, yec); - var Aec; - feb(1624, 1, QAe, Dec); - _2.Kf = function Eec(a, b) { - Cec(RD(a, 36), b); - }; - sfb(hBe, "LayerSizeAndGraphHeightCalculator", 1624); - feb(1625, 1, QAe, Gec); - _2.Kf = function Iec(a, b) { - Fec(RD(a, 36), b); - }; - sfb(hBe, "LongEdgeJoiner", 1625); - feb(1626, 1, QAe, Kec); - _2.Kf = function Mec(a, b) { - Jec(RD(a, 36), b); - }; - sfb(hBe, "LongEdgeSplitter", 1626); - feb(1627, 1, QAe, _ec); - _2.Kf = function cfc(a, b) { - Vec(this, RD(a, 36), b); - }; - _2.e = 0; - _2.f = 0; - _2.j = 0; - _2.k = 0; - _2.n = 0; - _2.o = 0; - var Pec, Qec; - sfb(hBe, "NodePromotion", 1627); - feb(1628, 1, fye, efc); - _2.Ne = function ffc(a, b) { - return dfc(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function gfc(a) { - return this === a; - }; - _2.Oe = function hfc() { - return new Frb(this); - }; - sfb(hBe, "NodePromotion/1", 1628); - feb(1629, 1, fye, jfc); - _2.Ne = function kfc(a, b) { - return ifc(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function lfc(a) { - return this === a; - }; - _2.Oe = function mfc() { - return new Frb(this); - }; - sfb(hBe, "NodePromotion/2", 1629); - feb(1630, 1, {}, nfc); - _2.Kb = function ofc(a) { - return RD(a, 42), Rec(), Geb(), true; - }; - _2.Fb = function pfc(a) { - return this === a; - }; - sfb(hBe, "NodePromotion/lambda$0$Type", 1630); - feb(1631, 1, {}, qfc); - _2.Kb = function rfc(a) { - return afc(this.a, RD(a, 42)); - }; - _2.Fb = function sfc(a) { - return this === a; - }; - _2.a = 0; - sfb(hBe, "NodePromotion/lambda$1$Type", 1631); - feb(1632, 1, {}, tfc); - _2.Kb = function ufc(a) { - return bfc(this.a, RD(a, 42)); - }; - _2.Fb = function vfc(a) { - return this === a; - }; - _2.a = 0; - sfb(hBe, "NodePromotion/lambda$2$Type", 1632); - feb(1633, 1, QAe, Bfc); - _2.Kf = function Cfc(a, b) { - wfc(RD(a, 36), b); - }; - sfb(hBe, "NorthSouthPortPostprocessor", 1633); - feb(1634, 1, QAe, Ifc); - _2.Kf = function Kfc(a, b) { - Gfc(RD(a, 36), b); - }; - sfb(hBe, "NorthSouthPortPreprocessor", 1634); - feb(1635, 1, fye, Lfc); - _2.Ne = function Mfc(a, b) { - return Jfc(RD(a, 12), RD(b, 12)); - }; - _2.Fb = function Nfc(a) { - return this === a; - }; - _2.Oe = function Ofc() { - return new Frb(this); - }; - sfb(hBe, "NorthSouthPortPreprocessor/lambda$0$Type", 1635); - feb(1636, 1, QAe, Rfc); - _2.Kf = function Tfc(a, b) { - Qfc(RD(a, 36), b); - }; - sfb(hBe, "PartitionMidprocessor", 1636); - feb(1637, 1, nwe, Ufc); - _2.Mb = function Vfc(a) { - return nQb(RD(a, 10), (yCc(), tBc)); - }; - sfb(hBe, "PartitionMidprocessor/lambda$0$Type", 1637); - feb(1638, 1, Qve, Wfc); - _2.Cd = function Xfc(a) { - Sfc(this.a, RD(a, 10)); - }; - sfb(hBe, "PartitionMidprocessor/lambda$1$Type", 1638); - feb(1639, 1, QAe, Zfc); - _2.Kf = function $fc(a, b) { - Yfc(RD(a, 36), b); - }; - sfb(hBe, "PartitionPostprocessor", 1639); - feb(1640, 1, QAe, cgc); - _2.Kf = function dgc(a, b) { - agc(RD(a, 36), b); - }; - sfb(hBe, "PartitionPreprocessor", 1640); - feb(1641, 1, nwe, egc); - _2.Mb = function fgc(a) { - return nQb(RD(a, 10), (yCc(), tBc)); - }; - sfb(hBe, "PartitionPreprocessor/lambda$0$Type", 1641); - feb(1642, 1, {}, ggc); - _2.Kb = function hgc(a) { - return new SDb(null, new Twb(new is(Mr(a3b(RD(a, 10)).a.Kc(), new ir())))); - }; - sfb(hBe, "PartitionPreprocessor/lambda$1$Type", 1642); - feb(1643, 1, nwe, igc); - _2.Mb = function jgc(a) { - return _fc(RD(a, 18)); - }; - sfb(hBe, "PartitionPreprocessor/lambda$2$Type", 1643); - feb(1644, 1, Qve, kgc); - _2.Cd = function lgc(a) { - bgc(RD(a, 18)); - }; - sfb(hBe, "PartitionPreprocessor/lambda$3$Type", 1644); - feb(1645, 1, QAe, xgc); - _2.Kf = function Bgc(a, b) { - ugc(RD(a, 36), b); - }; - var mgc, ngc, ogc, pgc, qgc, rgc; - sfb(hBe, "PortListSorter", 1645); - feb(1648, 1, fye, Dgc); - _2.Ne = function Egc(a, b) { - return ygc(RD(a, 12), RD(b, 12)); - }; - _2.Fb = function Fgc(a) { - return this === a; - }; - _2.Oe = function Ggc() { - return new Frb(this); - }; - sfb(hBe, "PortListSorter/lambda$0$Type", 1648); - feb(1650, 1, fye, Hgc); - _2.Ne = function Igc(a, b) { - return zgc(RD(a, 12), RD(b, 12)); - }; - _2.Fb = function Jgc(a) { - return this === a; - }; - _2.Oe = function Kgc() { - return new Frb(this); - }; - sfb(hBe, "PortListSorter/lambda$1$Type", 1650); - feb(1646, 1, {}, Lgc); - _2.Kb = function Mgc(a) { - return sgc(), RD(a, 12).e; - }; - sfb(hBe, "PortListSorter/lambda$2$Type", 1646); - feb(1647, 1, {}, Ngc); - _2.Kb = function Ogc(a) { - return sgc(), RD(a, 12).g; - }; - sfb(hBe, "PortListSorter/lambda$3$Type", 1647); - feb(1649, 1, fye, Pgc); - _2.Ne = function Qgc(a, b) { - return Agc(RD(a, 12), RD(b, 12)); - }; - _2.Fb = function Rgc(a) { - return this === a; - }; - _2.Oe = function Sgc() { - return new Frb(this); - }; - sfb(hBe, "PortListSorter/lambda$4$Type", 1649); - feb(1651, 1, QAe, Vgc); - _2.Kf = function Wgc(a, b) { - Tgc(RD(a, 36), b); - }; - sfb(hBe, "PortSideProcessor", 1651); - feb(1652, 1, QAe, Ygc); - _2.Kf = function Zgc(a, b) { - Xgc(RD(a, 36), b); - }; - sfb(hBe, "ReversedEdgeRestorer", 1652); - feb(1657, 1, QAe, ahc); - _2.Kf = function bhc(a, b) { - $gc(this, RD(a, 36), b); - }; - sfb(hBe, "SelfLoopPortRestorer", 1657); - feb(1658, 1, {}, chc); - _2.Kb = function dhc(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "SelfLoopPortRestorer/lambda$0$Type", 1658); - feb(1659, 1, nwe, ehc); - _2.Mb = function fhc(a) { - return RD(a, 10).k == (r3b(), p3b); - }; - sfb(hBe, "SelfLoopPortRestorer/lambda$1$Type", 1659); - feb(1660, 1, nwe, ghc); - _2.Mb = function hhc(a) { - return nQb(RD(a, 10), (Ywc(), Pwc)); - }; - sfb(hBe, "SelfLoopPortRestorer/lambda$2$Type", 1660); - feb(1661, 1, {}, ihc); - _2.Kb = function jhc(a) { - return RD(mQb(RD(a, 10), (Ywc(), Pwc)), 337); - }; - sfb(hBe, "SelfLoopPortRestorer/lambda$3$Type", 1661); - feb(1662, 1, Qve, khc); - _2.Cd = function lhc(a) { - _gc(this.a, RD(a, 337)); - }; - sfb(hBe, "SelfLoopPortRestorer/lambda$4$Type", 1662); - feb(805, 1, Qve, mhc); - _2.Cd = function nhc(a) { - Rmc(RD(a, 105)); - }; - sfb(hBe, "SelfLoopPortRestorer/lambda$5$Type", 805); - feb(1663, 1, QAe, rhc); - _2.Kf = function thc(a, b) { - ohc(RD(a, 36), b); - }; - sfb(hBe, "SelfLoopPostProcessor", 1663); - feb(1664, 1, {}, uhc); - _2.Kb = function vhc(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$0$Type", 1664); - feb(1665, 1, nwe, whc); - _2.Mb = function xhc(a) { - return RD(a, 10).k == (r3b(), p3b); - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$1$Type", 1665); - feb(1666, 1, nwe, yhc); - _2.Mb = function zhc(a) { - return nQb(RD(a, 10), (Ywc(), Pwc)); - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$2$Type", 1666); - feb(1667, 1, Qve, Ahc); - _2.Cd = function Bhc(a) { - phc(RD(a, 10)); - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$3$Type", 1667); - feb(1668, 1, {}, Chc); - _2.Kb = function Dhc(a) { - return new SDb(null, new Swb(RD(a, 105).f, 1)); - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$4$Type", 1668); - feb(1669, 1, Qve, Ehc); - _2.Cd = function Fhc(a) { - qhc(this.a, RD(a, 340)); - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$5$Type", 1669); - feb(1670, 1, nwe, Ghc); - _2.Mb = function Hhc(a) { - return !!RD(a, 105).i; - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$6$Type", 1670); - feb(1671, 1, Qve, Ihc); - _2.Cd = function Jhc(a) { - shc(this.a, RD(a, 105)); - }; - sfb(hBe, "SelfLoopPostProcessor/lambda$7$Type", 1671); - feb(1653, 1, QAe, Nhc); - _2.Kf = function Ohc(a, b) { - Mhc(RD(a, 36), b); - }; - sfb(hBe, "SelfLoopPreProcessor", 1653); - feb(1654, 1, {}, Phc); - _2.Kb = function Qhc(a) { - return new SDb(null, new Swb(RD(a, 105).f, 1)); - }; - sfb(hBe, "SelfLoopPreProcessor/lambda$0$Type", 1654); - feb(1655, 1, {}, Rhc); - _2.Kb = function Shc(a) { - return RD(a, 340).a; - }; - sfb(hBe, "SelfLoopPreProcessor/lambda$1$Type", 1655); - feb(1656, 1, Qve, Thc); - _2.Cd = function Uhc(a) { - Lhc(RD(a, 18)); - }; - sfb(hBe, "SelfLoopPreProcessor/lambda$2$Type", 1656); - feb(1672, 1, QAe, Yhc); - _2.Kf = function Zhc(a, b) { - Whc(this, RD(a, 36), b); - }; - sfb(hBe, "SelfLoopRouter", 1672); - feb(1673, 1, {}, $hc); - _2.Kb = function _hc(a) { - return new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(hBe, "SelfLoopRouter/lambda$0$Type", 1673); - feb(1674, 1, nwe, aic); - _2.Mb = function bic(a) { - return RD(a, 10).k == (r3b(), p3b); - }; - sfb(hBe, "SelfLoopRouter/lambda$1$Type", 1674); - feb(1675, 1, nwe, cic); - _2.Mb = function dic(a) { - return nQb(RD(a, 10), (Ywc(), Pwc)); - }; - sfb(hBe, "SelfLoopRouter/lambda$2$Type", 1675); - feb(1676, 1, {}, eic); - _2.Kb = function fic(a) { - return RD(mQb(RD(a, 10), (Ywc(), Pwc)), 337); - }; - sfb(hBe, "SelfLoopRouter/lambda$3$Type", 1676); - feb(1677, 1, Qve, gic); - _2.Cd = function hic(a) { - Vhc(this.a, this.b, RD(a, 337)); - }; - sfb(hBe, "SelfLoopRouter/lambda$4$Type", 1677); - feb(1678, 1, QAe, jic); - _2.Kf = function mic(a, b) { - iic(RD(a, 36), b); - }; - sfb(hBe, "SemiInteractiveCrossMinProcessor", 1678); - feb(1679, 1, nwe, nic); - _2.Mb = function oic(a) { - return RD(a, 10).k == (r3b(), p3b); - }; - sfb(hBe, "SemiInteractiveCrossMinProcessor/lambda$0$Type", 1679); - feb(1680, 1, nwe, pic); - _2.Mb = function qic(a) { - return lQb(RD(a, 10))._b((yCc(), IBc)); - }; - sfb(hBe, "SemiInteractiveCrossMinProcessor/lambda$1$Type", 1680); - feb(1681, 1, fye, ric); - _2.Ne = function sic(a, b) { - return kic(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function tic(a) { - return this === a; - }; - _2.Oe = function uic() { - return new Frb(this); - }; - sfb(hBe, "SemiInteractiveCrossMinProcessor/lambda$2$Type", 1681); - feb(1682, 1, {}, vic); - _2.Ve = function wic(a, b) { - return lic(RD(a, 10), RD(b, 10)); - }; - sfb(hBe, "SemiInteractiveCrossMinProcessor/lambda$3$Type", 1682); - feb(1684, 1, QAe, yic); - _2.Kf = function Cic(a, b) { - xic(RD(a, 36), b); - }; - sfb(hBe, "SortByInputModelProcessor", 1684); - feb(1685, 1, nwe, Dic); - _2.Mb = function Eic(a) { - return RD(a, 12).g.c.length != 0; - }; - sfb(hBe, "SortByInputModelProcessor/lambda$0$Type", 1685); - feb(1686, 1, Qve, Fic); - _2.Cd = function Gic(a) { - Aic(this.a, RD(a, 12)); - }; - sfb(hBe, "SortByInputModelProcessor/lambda$1$Type", 1686); - feb(1759, 817, {}, Pic); - _2.df = function Qic(a) { - var b, c2, d, e; - this.c = a; - switch (this.a.g) { - case 2: - b = new bnb(); - FDb(CDb(new SDb(null, new Swb(this.c.a.b, 16)), new Rjc()), new Tjc(this, b)); - eHb(this, new Zic()); - Umb(b, new bjc()); - b.c.length = 0; - FDb(CDb(new SDb(null, new Swb(this.c.a.b, 16)), new djc()), new fjc(b)); - eHb(this, new jjc()); - Umb(b, new njc()); - b.c.length = 0; - c2 = Wvb(TCb(HDb(new SDb(null, new Swb(this.c.a.b, 16)), new pjc(this))), new rjc()); - FDb(new SDb(null, new Swb(this.c.a.a, 16)), new vjc(c2, b)); - eHb(this, new zjc()); - Umb(b, new Djc()); - b.c.length = 0; - break; - case 3: - d = new bnb(); - eHb(this, new Ric()); - e = Wvb(TCb(HDb(new SDb(null, new Swb(this.c.a.b, 16)), new Vic(this))), new tjc()); - FDb(CDb(new SDb(null, new Swb(this.c.a.b, 16)), new Fjc()), new Hjc(e, d)); - eHb(this, new Ljc()); - Umb(d, new Pjc()); - d.c.length = 0; - break; - default: - throw Adb(new Ied()); - } - }; - _2.b = 0; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation", 1759); - feb(1760, 1, xye, Ric); - _2.Lb = function Sic(a) { - return ZD(RD(a, 60).g, 154); - }; - _2.Fb = function Tic(a) { - return this === a; - }; - _2.Mb = function Uic(a) { - return ZD(RD(a, 60).g, 154); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$0$Type", 1760); - feb(1761, 1, {}, Vic); - _2.Ye = function Wic(a) { - return Jic(this.a, RD(a, 60)); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$1$Type", 1761); - feb(1769, 1, owe, Xic); - _2.de = function Yic() { - Iic(this.a, this.b, -1); - }; - _2.b = 0; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$10$Type", 1769); - feb(1771, 1, xye, Zic); - _2.Lb = function $ic(a) { - return ZD(RD(a, 60).g, 154); - }; - _2.Fb = function _ic(a) { - return this === a; - }; - _2.Mb = function ajc(a) { - return ZD(RD(a, 60).g, 154); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$11$Type", 1771); - feb(1772, 1, Qve, bjc); - _2.Cd = function cjc(a) { - RD(a, 380).de(); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$12$Type", 1772); - feb(1773, 1, nwe, djc); - _2.Mb = function ejc(a) { - return ZD(RD(a, 60).g, 10); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$13$Type", 1773); - feb(1775, 1, Qve, fjc); - _2.Cd = function gjc(a) { - Kic(this.a, RD(a, 60)); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$14$Type", 1775); - feb(1774, 1, owe, hjc); - _2.de = function ijc() { - Iic(this.b, this.a, -1); - }; - _2.a = 0; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$15$Type", 1774); - feb(1776, 1, xye, jjc); - _2.Lb = function kjc(a) { - return ZD(RD(a, 60).g, 10); - }; - _2.Fb = function ljc(a) { - return this === a; - }; - _2.Mb = function mjc(a) { - return ZD(RD(a, 60).g, 10); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$16$Type", 1776); - feb(1777, 1, Qve, njc); - _2.Cd = function ojc(a) { - RD(a, 380).de(); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$17$Type", 1777); - feb(1778, 1, {}, pjc); - _2.Ye = function qjc(a) { - return Lic(this.a, RD(a, 60)); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$18$Type", 1778); - feb(1779, 1, {}, rjc); - _2.We = function sjc() { - return 0; - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$19$Type", 1779); - feb(1762, 1, {}, tjc); - _2.We = function ujc() { - return 0; - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$2$Type", 1762); - feb(1781, 1, Qve, vjc); - _2.Cd = function wjc(a) { - Mic(this.a, this.b, RD(a, 316)); - }; - _2.a = 0; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$20$Type", 1781); - feb(1780, 1, owe, xjc); - _2.de = function yjc() { - Hic(this.a, this.b, -1); - }; - _2.b = 0; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$21$Type", 1780); - feb(1782, 1, xye, zjc); - _2.Lb = function Ajc(a) { - return RD(a, 60), true; - }; - _2.Fb = function Bjc(a) { - return this === a; - }; - _2.Mb = function Cjc(a) { - return RD(a, 60), true; - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$22$Type", 1782); - feb(1783, 1, Qve, Djc); - _2.Cd = function Ejc(a) { - RD(a, 380).de(); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$23$Type", 1783); - feb(1763, 1, nwe, Fjc); - _2.Mb = function Gjc(a) { - return ZD(RD(a, 60).g, 10); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$3$Type", 1763); - feb(1765, 1, Qve, Hjc); - _2.Cd = function Ijc(a) { - Nic(this.a, this.b, RD(a, 60)); - }; - _2.a = 0; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$4$Type", 1765); - feb(1764, 1, owe, Jjc); - _2.de = function Kjc() { - Iic(this.b, this.a, -1); - }; - _2.a = 0; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$5$Type", 1764); - feb(1766, 1, xye, Ljc); - _2.Lb = function Mjc(a) { - return RD(a, 60), true; - }; - _2.Fb = function Njc(a) { - return this === a; - }; - _2.Mb = function Ojc(a) { - return RD(a, 60), true; - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$6$Type", 1766); - feb(1767, 1, Qve, Pjc); - _2.Cd = function Qjc(a) { - RD(a, 380).de(); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$7$Type", 1767); - feb(1768, 1, nwe, Rjc); - _2.Mb = function Sjc(a) { - return ZD(RD(a, 60).g, 154); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$8$Type", 1768); - feb(1770, 1, Qve, Tjc); - _2.Cd = function Ujc(a) { - Oic(this.a, this.b, RD(a, 60)); - }; - sfb(rBe, "EdgeAwareScanlineConstraintCalculation/lambda$9$Type", 1770); - feb(1586, 1, QAe, Yjc); - _2.Kf = function bkc(a, b) { - Xjc(this, RD(a, 36), b); - }; - var Vjc; - sfb(rBe, "HorizontalGraphCompactor", 1586); - feb(1587, 1, {}, ckc); - _2.ff = function dkc(a, b) { - var c2, d, e; - if (_jc(a, b)) { - return 0; - } - c2 = Zjc(a); - d = Zjc(b); - if (!!c2 && c2.k == (r3b(), m3b) || !!d && d.k == (r3b(), m3b)) { - return 0; - } - e = RD(mQb(this.a.a, (Ywc(), Qwc)), 312); - return ZEc(e, c2 ? c2.k : (r3b(), o3b), d ? d.k : (r3b(), o3b)); - }; - _2.gf = function ekc(a, b) { - var c2, d, e; - if (_jc(a, b)) { - return 1; - } - c2 = Zjc(a); - d = Zjc(b); - e = RD(mQb(this.a.a, (Ywc(), Qwc)), 312); - return aFc(e, c2 ? c2.k : (r3b(), o3b), d ? d.k : (r3b(), o3b)); - }; - sfb(rBe, "HorizontalGraphCompactor/1", 1587); - feb(1588, 1, {}, fkc); - _2.ef = function gkc(a, b) { - return Wjc(), a.a.i == 0; - }; - sfb(rBe, "HorizontalGraphCompactor/lambda$0$Type", 1588); - feb(1589, 1, {}, hkc); - _2.ef = function ikc(a, b) { - return akc(this.a, a, b); - }; - sfb(rBe, "HorizontalGraphCompactor/lambda$1$Type", 1589); - feb(1730, 1, {}, Ckc); - var jkc, kkc; - sfb(rBe, "LGraphToCGraphTransformer", 1730); - feb(1738, 1, nwe, Kkc); - _2.Mb = function Lkc(a) { - return a != null; - }; - sfb(rBe, "LGraphToCGraphTransformer/0methodref$nonNull$Type", 1738); - feb(1731, 1, {}, Mkc); - _2.Kb = function Nkc(a) { - return lkc(), jeb(mQb(RD(RD(a, 60).g, 10), (Ywc(), Awc))); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$0$Type", 1731); - feb(1732, 1, {}, Okc); - _2.Kb = function Pkc(a) { - return lkc(), Mlc(RD(RD(a, 60).g, 154)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$1$Type", 1732); - feb(1741, 1, nwe, Qkc); - _2.Mb = function Rkc(a) { - return lkc(), ZD(RD(a, 60).g, 10); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$10$Type", 1741); - feb(1742, 1, Qve, Skc); - _2.Cd = function Tkc(a) { - Dkc(RD(a, 60)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$11$Type", 1742); - feb(1743, 1, nwe, Ukc); - _2.Mb = function Vkc(a) { - return lkc(), ZD(RD(a, 60).g, 154); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$12$Type", 1743); - feb(1747, 1, Qve, Wkc); - _2.Cd = function Xkc(a) { - Ekc(RD(a, 60)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$13$Type", 1747); - feb(1744, 1, Qve, Ykc); - _2.Cd = function Zkc(a) { - Fkc(this.a, RD(a, 8)); - }; - _2.a = 0; - sfb(rBe, "LGraphToCGraphTransformer/lambda$14$Type", 1744); - feb(1745, 1, Qve, $kc); - _2.Cd = function _kc(a) { - Gkc(this.a, RD(a, 116)); - }; - _2.a = 0; - sfb(rBe, "LGraphToCGraphTransformer/lambda$15$Type", 1745); - feb(1746, 1, Qve, alc); - _2.Cd = function blc(a) { - Hkc(this.a, RD(a, 8)); - }; - _2.a = 0; - sfb(rBe, "LGraphToCGraphTransformer/lambda$16$Type", 1746); - feb(1748, 1, {}, clc); - _2.Kb = function dlc(a) { - return lkc(), new SDb(null, new Twb(new is(Mr(a3b(RD(a, 10)).a.Kc(), new ir())))); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$17$Type", 1748); - feb(1749, 1, nwe, elc); - _2.Mb = function flc(a) { - return lkc(), W0b(RD(a, 18)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$18$Type", 1749); - feb(1750, 1, Qve, glc); - _2.Cd = function hlc(a) { - ukc(this.a, RD(a, 18)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$19$Type", 1750); - feb(1734, 1, Qve, ilc); - _2.Cd = function jlc(a) { - vkc(this.a, RD(a, 154)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$2$Type", 1734); - feb(1751, 1, {}, klc); - _2.Kb = function llc(a) { - return lkc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$20$Type", 1751); - feb(1752, 1, {}, mlc); - _2.Kb = function nlc(a) { - return lkc(), new SDb(null, new Twb(new is(Mr(a3b(RD(a, 10)).a.Kc(), new ir())))); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$21$Type", 1752); - feb(1753, 1, {}, olc); - _2.Kb = function plc(a) { - return lkc(), RD(mQb(RD(a, 18), (Ywc(), Twc)), 15); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$22$Type", 1753); - feb(1754, 1, nwe, qlc); - _2.Mb = function rlc(a) { - return Ikc(RD(a, 15)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$23$Type", 1754); - feb(1755, 1, Qve, slc); - _2.Cd = function tlc(a) { - nkc(this.a, RD(a, 15)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$24$Type", 1755); - feb(1733, 1, Qve, ulc); - _2.Cd = function vlc(a) { - wkc(this.a, this.b, RD(a, 154)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$3$Type", 1733); - feb(1735, 1, {}, wlc); - _2.Kb = function xlc(a) { - return lkc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$4$Type", 1735); - feb(1736, 1, {}, ylc); - _2.Kb = function zlc(a) { - return lkc(), new SDb(null, new Twb(new is(Mr(a3b(RD(a, 10)).a.Kc(), new ir())))); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$5$Type", 1736); - feb(1737, 1, {}, Alc); - _2.Kb = function Blc(a) { - return lkc(), RD(mQb(RD(a, 18), (Ywc(), Twc)), 15); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$6$Type", 1737); - feb(1739, 1, Qve, Clc); - _2.Cd = function Dlc(a) { - Jkc(this.a, RD(a, 15)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$8$Type", 1739); - feb(1740, 1, Qve, Elc); - _2.Cd = function Flc(a) { - xkc(this.a, this.b, RD(a, 154)); - }; - sfb(rBe, "LGraphToCGraphTransformer/lambda$9$Type", 1740); - feb(1729, 1, {}, Jlc); - _2.cf = function Klc(a) { - var b, c2, d, e, f2; - this.a = a; - this.d = new BIb(); - this.c = $C(DN, rve, 125, this.a.a.a.c.length, 0, 1); - this.b = 0; - for (c2 = new Anb(this.a.a.a); c2.a < c2.c.c.length; ) { - b = RD(ynb(c2), 316); - b.d = this.b; - f2 = eJb(fJb(new gJb(), b), this.d); - this.c[this.b] = f2; - ++this.b; - } - Ilc(this); - Hlc(this); - Glc(this); - lJb(CJb(this.d), new Oqd()); - for (e = new Anb(this.a.a.b); e.a < e.c.c.length; ) { - d = RD(ynb(e), 60); - d.d.c = this.c[d.a.d].e + d.b.a; - } - }; - _2.b = 0; - sfb(rBe, "NetworkSimplexCompaction", 1729); - feb(154, 1, { 34: 1, 154: 1 }, Nlc); - _2.Fd = function Olc(a) { - return Llc(this, RD(a, 154)); - }; - _2.Ib = function Plc() { - return Mlc(this); - }; - sfb(rBe, "VerticalSegment", 154); - feb(841, 1, {}, Ylc); - _2.c = 0; - _2.e = 0; - _2.i = 0; - sfb(sBe, "BetweenLayerEdgeTwoNodeCrossingsCounter", 841); - feb(677, 1, { 677: 1 }, dmc); - _2.Ib = function emc() { - return "AdjacencyList [node=" + this.d + ", adjacencies= " + this.a + "]"; - }; - _2.b = 0; - _2.c = 0; - _2.f = 0; - sfb(sBe, "BetweenLayerEdgeTwoNodeCrossingsCounter/AdjacencyList", 677); - feb(294, 1, { 34: 1, 294: 1 }, hmc); - _2.Fd = function imc(a) { - return fmc(this, RD(a, 294)); - }; - _2.Ib = function jmc() { - return "Adjacency [position=" + this.c + ", cardinality=" + this.a + ", currentCardinality=" + this.b + "]"; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - sfb(sBe, "BetweenLayerEdgeTwoNodeCrossingsCounter/AdjacencyList/Adjacency", 294); - feb(2026, 1, {}, mmc); - _2.b = 0; - _2.e = false; - sfb(sBe, "CrossingMatrixFiller", 2026); - var QY = ufb(tBe, "IInitializable"); - feb(1867, 1, uBe, smc); - _2.gg = function vmc(a, b, c2, d, e, f2) { - }; - _2.ig = function xmc(a, b, c2) { - }; - _2.eg = function tmc() { - return this.c != (RKc(), PKc); - }; - _2.fg = function umc() { - this.e = $C(kE, Pwe, 28, this.d, 15, 1); - }; - _2.hg = function wmc(a, b) { - b[a][0].c.p = a; - }; - _2.jg = function ymc(a, b, c2, d) { - ++this.d; - }; - _2.kg = function zmc() { - return true; - }; - _2.lg = function Amc(a, b, c2, d) { - omc(this, a, b, c2); - return nmc(this, b); - }; - _2.mg = function Bmc(a, b) { - var c2; - c2 = pmc(b, a.length); - omc(this, a, c2, b); - return qmc(this, c2); - }; - _2.d = 0; - sfb(sBe, "GreedySwitchHeuristic", 1867); - feb(2029, 1, {}, Kmc); - _2.b = 0; - _2.d = 0; - sfb(sBe, "NorthSouthEdgeNeighbouringNodeCrossingsCounter", 2029); - feb(2016, 1, {}, Pmc); - _2.a = false; - sfb(sBe, "SwitchDecider", 2016); - feb(105, 1, { 105: 1 }, Vmc); - _2.a = null; - _2.c = null; - _2.i = null; - sfb(vBe, "SelfHyperLoop", 105); - feb(2013, 1, {}, _mc); - _2.c = 0; - _2.e = 0; - sfb(vBe, "SelfHyperLoopLabels", 2013); - feb(421, 22, { 3: 1, 34: 1, 22: 1, 421: 1 }, fnc); - var anc, bnc, cnc, dnc; - var LV = tfb(vBe, "SelfHyperLoopLabels/Alignment", 421, WI, hnc, gnc); - var inc; - feb(340, 1, { 340: 1 }, knc); - sfb(vBe, "SelfLoopEdge", 340); - feb(337, 1, { 337: 1 }, onc); - _2.a = false; - sfb(vBe, "SelfLoopHolder", 337); - feb(1790, 1, nwe, qnc); - _2.Mb = function rnc(a) { - return W0b(RD(a, 18)); - }; - sfb(vBe, "SelfLoopHolder/lambda$0$Type", 1790); - feb(113, 1, { 113: 1 }, tnc); - _2.a = false; - _2.c = false; - sfb(vBe, "SelfLoopPort", 113); - feb(1855, 1, nwe, unc); - _2.Mb = function vnc(a) { - return W0b(RD(a, 18)); - }; - sfb(vBe, "SelfLoopPort/lambda$0$Type", 1855); - feb(375, 22, { 3: 1, 34: 1, 22: 1, 375: 1 }, Cnc); - var wnc, xnc, ync, znc, Anc; - var TV = tfb(vBe, "SelfLoopType", 375, WI, Fnc, Enc); - var Gnc; - feb(1798, 1, {}, boc); - var Inc, Jnc, Knc, Lnc; - sfb(wBe, "PortRestorer", 1798); - feb(372, 22, { 3: 1, 34: 1, 22: 1, 372: 1 }, koc); - var goc, hoc, ioc; - var UV = tfb(wBe, "PortRestorer/PortSideArea", 372, WI, moc, loc); - var noc; - feb(1799, 1, {}, poc); - _2.Kb = function qoc(a) { - return Mnc(), RD(a, 15).Oc(); - }; - sfb(wBe, "PortRestorer/lambda$0$Type", 1799); - feb(1800, 1, Qve, roc); - _2.Cd = function soc(a) { - Mnc(); - RD(a, 113).c = false; - }; - sfb(wBe, "PortRestorer/lambda$1$Type", 1800); - feb(1809, 1, nwe, toc); - _2.Mb = function uoc(a) { - return Mnc(), RD(a, 12).j == (qpd(), ppd); - }; - sfb(wBe, "PortRestorer/lambda$10$Type", 1809); - feb(1810, 1, {}, voc); - _2.Kb = function woc(a) { - return Mnc(), RD(a, 113).d; - }; - sfb(wBe, "PortRestorer/lambda$11$Type", 1810); - feb(1811, 1, Qve, xoc); - _2.Cd = function yoc(a) { - coc(this.a, RD(a, 12)); - }; - sfb(wBe, "PortRestorer/lambda$12$Type", 1811); - feb(1801, 1, Qve, zoc); - _2.Cd = function Aoc(a) { - doc(this.a, RD(a, 105)); - }; - sfb(wBe, "PortRestorer/lambda$2$Type", 1801); - feb(1802, 1, fye, Boc); - _2.Ne = function Coc(a, b) { - return eoc(RD(a, 113), RD(b, 113)); - }; - _2.Fb = function Doc(a) { - return this === a; - }; - _2.Oe = function Eoc() { - return new Frb(this); - }; - sfb(wBe, "PortRestorer/lambda$3$Type", 1802); - feb(1803, 1, nwe, Foc); - _2.Mb = function Goc(a) { - return Mnc(), RD(a, 113).c; - }; - sfb(wBe, "PortRestorer/lambda$4$Type", 1803); - feb(1804, 1, nwe, Hoc); - _2.Mb = function Ioc(a) { - return Tnc(RD(a, 12)); - }; - sfb(wBe, "PortRestorer/lambda$5$Type", 1804); - feb(1805, 1, nwe, Joc); - _2.Mb = function Koc(a) { - return Mnc(), RD(a, 12).j == (qpd(), Yod); - }; - sfb(wBe, "PortRestorer/lambda$6$Type", 1805); - feb(1806, 1, nwe, Loc); - _2.Mb = function Moc(a) { - return Mnc(), RD(a, 12).j == (qpd(), Xod); - }; - sfb(wBe, "PortRestorer/lambda$7$Type", 1806); - feb(1807, 1, nwe, Noc); - _2.Mb = function Ooc(a) { - return Unc(RD(a, 12)); - }; - sfb(wBe, "PortRestorer/lambda$8$Type", 1807); - feb(1808, 1, nwe, Poc); - _2.Mb = function Qoc(a) { - return Mnc(), RD(a, 12).j == (qpd(), npd); - }; - sfb(wBe, "PortRestorer/lambda$9$Type", 1808); - feb(276, 22, { 3: 1, 34: 1, 22: 1, 276: 1 }, fpc); - var Yoc, Zoc, $oc, _oc, apc, bpc, cpc, dpc; - var hW = tfb(wBe, "PortSideAssigner/Target", 276, WI, hpc, gpc); - var ipc; - feb(1791, 1, {}, kpc); - _2.Kb = function lpc(a) { - return CDb(new SDb(null, new Swb(RD(a, 105).j, 16)), new Cpc()); - }; - sfb(wBe, "PortSideAssigner/lambda$1$Type", 1791); - feb(1792, 1, {}, mpc); - _2.Kb = function npc(a) { - return RD(a, 113).d; - }; - sfb(wBe, "PortSideAssigner/lambda$2$Type", 1792); - feb(1793, 1, Qve, opc); - _2.Cd = function ppc(a) { - Q3b(RD(a, 12), (qpd(), Yod)); - }; - sfb(wBe, "PortSideAssigner/lambda$3$Type", 1793); - feb(1794, 1, {}, qpc); - _2.Kb = function rpc(a) { - return RD(a, 113).d; - }; - sfb(wBe, "PortSideAssigner/lambda$4$Type", 1794); - feb(1795, 1, Qve, spc); - _2.Cd = function tpc(a) { - Voc(this.a, RD(a, 12)); - }; - sfb(wBe, "PortSideAssigner/lambda$5$Type", 1795); - feb(1796, 1, fye, upc); - _2.Ne = function vpc(a, b) { - return Woc(RD(a, 105), RD(b, 105)); - }; - _2.Fb = function wpc(a) { - return this === a; - }; - _2.Oe = function xpc() { - return new Frb(this); - }; - sfb(wBe, "PortSideAssigner/lambda$6$Type", 1796); - feb(1797, 1, fye, ypc); - _2.Ne = function zpc(a, b) { - return Xoc(RD(a, 113), RD(b, 113)); - }; - _2.Fb = function Apc(a) { - return this === a; - }; - _2.Oe = function Bpc() { - return new Frb(this); - }; - sfb(wBe, "PortSideAssigner/lambda$7$Type", 1797); - feb(820, 1, nwe, Cpc); - _2.Mb = function Dpc(a) { - return RD(a, 113).c; - }; - sfb(wBe, "PortSideAssigner/lambda$8$Type", 820); - feb(2108, 1, {}); - sfb(xBe, "AbstractSelfLoopRouter", 2108); - feb(1816, 1, fye, Mpc); - _2.Ne = function Npc(a, b) { - return Kpc(RD(a, 105), RD(b, 105)); - }; - _2.Fb = function Opc(a) { - return this === a; - }; - _2.Oe = function Ppc() { - return new Frb(this); - }; - sfb(xBe, Vye, 1816); - feb(1817, 1, fye, Qpc); - _2.Ne = function Rpc(a, b) { - return Lpc(RD(a, 105), RD(b, 105)); - }; - _2.Fb = function Spc(a) { - return this === a; - }; - _2.Oe = function Tpc() { - return new Frb(this); - }; - sfb(xBe, Wye, 1817); - feb(1856, 2108, {}, dqc); - _2.ng = function eqc(a, b, c2) { - return c2; - }; - sfb(xBe, "OrthogonalSelfLoopRouter", 1856); - feb(1858, 1, Qve, fqc); - _2.Cd = function gqc(a) { - cqc(this.b, this.a, RD(a, 8)); - }; - sfb(xBe, "OrthogonalSelfLoopRouter/lambda$0$Type", 1858); - feb(1857, 1856, {}, jqc); - _2.ng = function kqc(a, b, c2) { - var d, e; - d = a.c.d; - hu(c2, 0, $id(ajd(d.n), d.a)); - e = a.d.d; - Mub(c2, $id(ajd(e.n), e.a)); - return hqc(c2); - }; - sfb(xBe, "PolylineSelfLoopRouter", 1857); - feb(1812, 1, {}, yqc); - _2.a = null; - var lqc; - sfb(xBe, "RoutingDirector", 1812); - feb(1813, 1, fye, Aqc); - _2.Ne = function Bqc(a, b) { - return zqc(RD(a, 113), RD(b, 113)); - }; - _2.Fb = function Cqc(a) { - return this === a; - }; - _2.Oe = function Dqc() { - return new Frb(this); - }; - sfb(xBe, "RoutingDirector/lambda$0$Type", 1813); - feb(1814, 1, {}, Eqc); - _2.Kb = function Fqc(a) { - return mqc(), RD(a, 105).j; - }; - sfb(xBe, "RoutingDirector/lambda$1$Type", 1814); - feb(1815, 1, Qve, Gqc); - _2.Cd = function Hqc(a) { - mqc(); - RD(a, 15).jd(lqc); - }; - sfb(xBe, "RoutingDirector/lambda$2$Type", 1815); - feb(1818, 1, {}, Sqc); - sfb(xBe, "RoutingSlotAssigner", 1818); - feb(1819, 1, nwe, Vqc); - _2.Mb = function Wqc(a) { - return Tqc(this.a, RD(a, 105)); - }; - sfb(xBe, "RoutingSlotAssigner/lambda$0$Type", 1819); - feb(1820, 1, fye, Xqc); - _2.Ne = function Yqc(a, b) { - return Uqc(this.a, RD(a, 105), RD(b, 105)); - }; - _2.Fb = function Zqc(a) { - return this === a; - }; - _2.Oe = function $qc() { - return new Frb(this); - }; - sfb(xBe, "RoutingSlotAssigner/lambda$1$Type", 1820); - feb(1859, 1856, {}, arc); - _2.ng = function brc(a, b, c2) { - var d, e, f2, g; - d = Kfb(UD(k2b(a.b.g.b, (yCc(), VBc)))); - g = new Gjd(cD(WC(l3, 1), Nve, 8, 0, [(f2 = a.c.d, $id(new sjd(f2.n), f2.a))])); - _qc(a, b, c2, g, d); - Mub(g, (e = a.d.d, $id(new sjd(e.n), e.a))); - return sUc(new wUc(g)); - }; - sfb(xBe, "SplineSelfLoopRouter", 1859); - feb(586, 1, fye, frc, hrc); - _2.Ne = function irc(a, b) { - return crc(this, RD(a, 10), RD(b, 10)); - }; - _2.Fb = function jrc(a) { - return this === a; - }; - _2.Oe = function krc() { - return new Frb(this); - }; - sfb(yBe, "ModelOrderNodeComparator", 586); - feb(1821, 1, nwe, lrc); - _2.Mb = function mrc(a) { - return RD(a, 12).e.c.length != 0; - }; - sfb(yBe, "ModelOrderNodeComparator/lambda$0$Type", 1821); - feb(821, 1, fye, trc, urc); - _2.Ne = function vrc(a, b) { - return prc(this, a, b); - }; - _2.Fb = function wrc(a) { - return this === a; - }; - _2.Oe = function xrc() { - return new Frb(this); - }; - _2.b = false; - sfb(yBe, "ModelOrderPortComparator", 821); - feb(815, 1, {}, zrc); - _2.og = function Brc(a, b) { - var c2, d, e, f2; - e = Arc(b); - c2 = new bnb(); - f2 = b.f / e; - for (d = 1; d < e; ++d) { - Rmb(c2, sgb(Ydb(Hdb($wnd.Math.round(d * f2))))); - } - return c2; - }; - _2.pg = function Crc() { - return false; - }; - sfb(zBe, "ARDCutIndexHeuristic", 815); - feb(1544, 1, QAe, Hrc); - _2.Kf = function Irc(a, b) { - Grc(RD(a, 36), b); - }; - sfb(zBe, "BreakingPointInserter", 1544); - feb(313, 1, { 313: 1 }, Jrc); - _2.Ib = function Mrc() { - var a; - a = new bib(); - a.a += "BPInfo["; - a.a += "\n start="; - Yhb(a, this.i); - a.a += "\n end="; - Yhb(a, this.a); - a.a += "\n nodeStartEdge="; - Yhb(a, this.e); - a.a += "\n startEndEdge="; - Yhb(a, this.j); - a.a += "\n originalEdge="; - Yhb(a, this.f); - a.a += "\n startInLayerDummy="; - Yhb(a, this.k); - a.a += "\n startInLayerEdge="; - Yhb(a, this.n); - a.a += "\n endInLayerDummy="; - Yhb(a, this.b); - a.a += "\n endInLayerEdge="; - Yhb(a, this.c); - return a.a; - }; - sfb(zBe, "BreakingPointInserter/BPInfo", 313); - feb(661, 1, { 661: 1 }, Trc); - _2.a = false; - _2.b = 0; - _2.c = 0; - sfb(zBe, "BreakingPointInserter/Cut", 661); - feb(1545, 1, QAe, bsc); - _2.Kf = function csc(a, b) { - _rc(RD(a, 36), b); - }; - sfb(zBe, "BreakingPointProcessor", 1545); - feb(1546, 1, nwe, dsc); - _2.Mb = function esc(a) { - return Krc(RD(a, 10)); - }; - sfb(zBe, "BreakingPointProcessor/0methodref$isEnd$Type", 1546); - feb(1547, 1, nwe, fsc); - _2.Mb = function gsc(a) { - return Lrc(RD(a, 10)); - }; - sfb(zBe, "BreakingPointProcessor/1methodref$isStart$Type", 1547); - feb(1548, 1, QAe, ksc); - _2.Kf = function lsc(a, b) { - isc(this, RD(a, 36), b); - }; - sfb(zBe, "BreakingPointRemover", 1548); - feb(1549, 1, Qve, msc); - _2.Cd = function nsc(a) { - RD(a, 131).k = true; - }; - sfb(zBe, "BreakingPointRemover/lambda$0$Type", 1549); - feb(811, 1, {}, ysc); - _2.b = 0; - _2.e = 0; - _2.f = 0; - _2.j = 0; - sfb(zBe, "GraphStats", 811); - feb(812, 1, {}, Asc); - _2.Ve = function Bsc(a, b) { - return $wnd.Math.max(Kfb(UD(a)), Kfb(UD(b))); - }; - sfb(zBe, "GraphStats/0methodref$max$Type", 812); - feb(813, 1, {}, Csc); - _2.Ve = function Dsc(a, b) { - return $wnd.Math.max(Kfb(UD(a)), Kfb(UD(b))); - }; - sfb(zBe, "GraphStats/2methodref$max$Type", 813); - feb(1726, 1, {}, Esc); - _2.Ve = function Fsc(a, b) { - return zsc(UD(a), UD(b)); - }; - sfb(zBe, "GraphStats/lambda$1$Type", 1726); - feb(1727, 1, {}, Gsc); - _2.Kb = function Hsc(a) { - return ssc(this.a, RD(a, 30)); - }; - sfb(zBe, "GraphStats/lambda$2$Type", 1727); - feb(1728, 1, {}, Isc); - _2.Kb = function Jsc(a) { - return rsc(this.a, RD(a, 30)); - }; - sfb(zBe, "GraphStats/lambda$6$Type", 1728); - feb(814, 1, {}, Ksc); - _2.og = function Lsc(a, b) { - var c2; - c2 = RD(mQb(a, (yCc(), pCc)), 15); - return c2 ? c2 : (yob(), yob(), vob); - }; - _2.pg = function Msc() { - return false; - }; - sfb(zBe, "ICutIndexCalculator/ManualCutIndexCalculator", 814); - feb(816, 1, {}, Nsc); - _2.og = function Osc(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u; - u = (b.n == null && vsc(b), b.n); - i2 = (b.d == null && vsc(b), b.d); - t = $C(iE, vxe, 28, u.length, 15, 1); - t[0] = u[0]; - r = u[0]; - for (j = 1; j < u.length; j++) { - t[j] = t[j - 1] + u[j]; - r += u[j]; - } - e = Arc(b) - 1; - g = RD(mQb(a, (yCc(), qCc)), 17).a; - d = pxe; - c2 = new bnb(); - for (m = $wnd.Math.max(0, e - g); m <= $wnd.Math.min(b.f - 1, e + g); m++) { - p = r / (m + 1); - q = 0; - k = 1; - f2 = new bnb(); - s = pxe; - l = 0; - h = 0; - o2 = i2[0]; - if (m == 0) { - s = r; - h = (b.g == null && (b.g = qsc(b, new Csc())), Kfb(b.g)); - } else { - while (k < b.f) { - if (t[k - 1] - q >= p) { - Rmb(f2, sgb(k)); - s = $wnd.Math.max(s, t[k - 1] - l); - h += o2; - q += t[k - 1] - q; - l = t[k - 1]; - o2 = i2[k]; - } - o2 = $wnd.Math.max(o2, i2[k]); - ++k; - } - h += o2; - } - n = $wnd.Math.min(1 / s, 1 / b.b / h); - if (n > d) { - d = n; - c2 = f2; - } - } - return c2; - }; - _2.pg = function Psc() { - return false; - }; - sfb(zBe, "MSDCutIndexHeuristic", 816); - feb(1683, 1, QAe, Ssc); - _2.Kf = function Tsc(a, b) { - Rsc(RD(a, 36), b); - }; - sfb(zBe, "SingleEdgeGraphWrapper", 1683); - feb(232, 22, { 3: 1, 34: 1, 22: 1, 232: 1 }, ctc); - var Xsc, Ysc, Zsc, $sc, _sc, atc; - var ZW = tfb(ABe, "CenterEdgeLabelPlacementStrategy", 232, WI, etc, dtc); - var ftc; - feb(431, 22, { 3: 1, 34: 1, 22: 1, 431: 1 }, ktc); - var htc, itc; - var $W = tfb(ABe, "ConstraintCalculationStrategy", 431, WI, mtc, ltc); - var ntc; - feb(322, 22, { 3: 1, 34: 1, 22: 1, 322: 1, 188: 1, 196: 1 }, utc); - _2.dg = function wtc() { - return ttc(this); - }; - _2.qg = function vtc() { - return ttc(this); - }; - var ptc, qtc, rtc; - var _W = tfb(ABe, "CrossingMinimizationStrategy", 322, WI, ytc, xtc); - var ztc; - feb(351, 22, { 3: 1, 34: 1, 22: 1, 351: 1 }, Ftc); - var Btc, Ctc, Dtc; - var aX = tfb(ABe, "CuttingStrategy", 351, WI, Htc, Gtc); - var Itc; - feb(348, 22, { 3: 1, 34: 1, 22: 1, 348: 1, 188: 1, 196: 1 }, Rtc); - _2.dg = function Ttc() { - return Qtc(this); - }; - _2.qg = function Stc() { - return Qtc(this); - }; - var Ktc, Ltc, Mtc, Ntc, Otc; - var bX = tfb(ABe, "CycleBreakingStrategy", 348, WI, Vtc, Utc); - var Wtc; - feb(428, 22, { 3: 1, 34: 1, 22: 1, 428: 1 }, _tc); - var Ytc, Ztc; - var cX = tfb(ABe, "DirectionCongruency", 428, WI, buc, auc); - var cuc; - feb(460, 22, { 3: 1, 34: 1, 22: 1, 460: 1 }, iuc); - var euc, fuc, guc; - var dX = tfb(ABe, "EdgeConstraint", 460, WI, kuc, juc); - var luc; - feb(283, 22, { 3: 1, 34: 1, 22: 1, 283: 1 }, vuc); - var nuc, ouc, puc, quc, ruc, suc; - var eX = tfb(ABe, "EdgeLabelSideSelection", 283, WI, xuc, wuc); - var yuc; - feb(488, 22, { 3: 1, 34: 1, 22: 1, 488: 1 }, Duc); - var Auc, Buc; - var fX = tfb(ABe, "EdgeStraighteningStrategy", 488, WI, Fuc, Euc); - var Guc; - feb(281, 22, { 3: 1, 34: 1, 22: 1, 281: 1 }, Puc); - var Iuc, Juc, Kuc, Luc, Muc, Nuc; - var gX = tfb(ABe, "FixedAlignment", 281, WI, Ruc, Quc); - var Suc; - feb(282, 22, { 3: 1, 34: 1, 22: 1, 282: 1 }, _uc); - var Uuc, Vuc, Wuc, Xuc, Yuc, Zuc; - var hX = tfb(ABe, "GraphCompactionStrategy", 282, WI, bvc, avc); - var cvc; - feb(259, 22, { 3: 1, 34: 1, 22: 1, 259: 1 }, pvc); - var evc, fvc, gvc, hvc, ivc, jvc, kvc, lvc, mvc, nvc; - var iX = tfb(ABe, "GraphProperties", 259, WI, rvc, qvc); - var svc; - feb(299, 22, { 3: 1, 34: 1, 22: 1, 299: 1 }, yvc); - var uvc, vvc, wvc; - var jX = tfb(ABe, "GreedySwitchType", 299, WI, Avc, zvc); - var Bvc; - feb(311, 22, { 3: 1, 34: 1, 22: 1, 311: 1 }, Hvc); - var Dvc, Evc, Fvc; - var kX = tfb(ABe, "InLayerConstraint", 311, WI, Jvc, Ivc); - var Kvc; - feb(429, 22, { 3: 1, 34: 1, 22: 1, 429: 1 }, Pvc); - var Mvc, Nvc; - var lX = tfb(ABe, "InteractiveReferencePoint", 429, WI, Rvc, Qvc); - var Svc; - var Uvc, Vvc, Wvc, Xvc, Yvc, Zvc, $vc, _vc, awc, bwc, cwc, dwc, ewc, fwc, gwc, hwc, iwc, jwc, kwc, lwc, mwc, nwc, owc, pwc, qwc, rwc, swc, twc, uwc, vwc, wwc, xwc, ywc, zwc, Awc, Bwc, Cwc, Dwc, Ewc, Fwc, Gwc, Hwc, Iwc, Jwc, Kwc, Lwc, Mwc, Nwc, Owc, Pwc, Qwc, Rwc, Swc, Twc, Uwc, Vwc, Wwc, Xwc; - feb(171, 22, { 3: 1, 34: 1, 22: 1, 171: 1 }, dxc); - var Zwc, $wc, _wc, axc, bxc; - var mX = tfb(ABe, "LayerConstraint", 171, WI, fxc, exc); - var gxc; - feb(859, 1, Eye, Pzc); - _2.hf = function Qzc(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), HBe), ""), "Direction Congruency"), "Specifies how drawings of the same graph with different layout directions compare to each other: either a natural reading direction is preserved or the drawings are rotated versions of each other."), Uxc), (kid(), eid)), cX), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), IBe), ""), "Feedback Edges"), "Whether feedback edges should be highlighted by routing around the nodes."), (Geb(), false)), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), JBe), ""), "Interactive Reference Point"), "Determines which point of a node is considered by interactive layout phases."), pyc), eid), lX), xsb(Whd)))); - zgd(a, JBe, RBe, ryc); - zgd(a, JBe, _Be, qyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), KBe), ""), "Merge Edges"), "Edges that have no ports are merged so they touch the connected nodes at the same points. When this option is disabled, one port is created for each edge directly connected to a node. When it is enabled, all such incoming edges share an input port, and all outgoing edges share an output port."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), LBe), ""), "Merge Hierarchy-Crossing Edges"), "If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible. They are broken by the algorithm, with hierarchical ports inserted as required. Usually, one such port is created for each edge at each hierarchy crossing point. With this option set to true, we try to create as few hierarchical ports as possible in the process. In particular, all edges that form a hyperedge can share a port."), true), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Nhd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), MBe), ""), "Allow Non-Flow Ports To Switch Sides"), "Specifies whether non-flow ports may switch sides if their node's port constraints are either FIXED_SIDE or FIXED_ORDER. A non-flow port is a port on a side that is not part of the currently configured layout flow. For instance, given a left-to-right layout direction, north and south ports would be considered non-flow ports. Further note that the underlying criterium whether to switch sides or not solely relies on the minimization of edge crossings. Hence, edge length and other aesthetics criteria are not addressed."), false), cid), QI), xsb(Xhd)), cD(WC(qJ, 1), Nve, 2, 6, ["org.eclipse.elk.layered.northOrSouthPort"])))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), NBe), ""), "Port Sorting Strategy"), "Only relevant for nodes with FIXED_SIDE port constraints. Determines the way a node's ports are distributed on the sides of a node if their order is not prescribed. The option is set on parent nodes."), azc), eid), xX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), OBe), ""), "Thoroughness"), "How much effort should be spent to produce a nice layout."), sgb(7)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), PBe), ""), "Add Unnecessary Bendpoints"), "Adds bend points even if an edge does not change direction. If true, each long edge dummy will contribute a bend point to its edges and hierarchy-crossing edges will always get a bend point where they cross hierarchy boundaries. By default, bend points are only added where an edge changes direction."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), QBe), ""), "Generate Position and Layer IDs"), "If enabled position id and layer id are generated, which are usually only used internally when setting the interactiveLayout option. This option should be specified on the root node."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), RBe), "cycleBreaking"), "Cycle Breaking Strategy"), "Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right)."), Sxc), eid), bX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), SBe), bDe), "Node Layering Strategy"), "Strategy for node layering."), Gyc), eid), rX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), TBe), bDe), "Layer Constraint"), "Determines a constraint on the placement of the node regarding the layering."), wyc), eid), mX), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), UBe), bDe), "Layer Choice Constraint"), "Allows to set a constraint regarding the layer placement of a node. Let i be the value of teh constraint. Assumed the drawing has n layers and i < n. If set to i, it expresses that the node should be placed in i-th layer. Should i>=n be true then the node is placed in the last layer of the drawing. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."), null), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), VBe), bDe), "Layer ID"), "Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."), sgb(-1)), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), WBe), cDe), "Upper Bound On Width [MinWidth Layerer]"), "Defines a loose upper bound on the width of the MinWidth layerer. If set to '-1' multiple values are tested and the best result is selected."), sgb(4)), gid), bJ), xsb(Whd)))); - zgd(a, WBe, SBe, zyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), XBe), cDe), "Upper Layer Estimation Scaling Factor [MinWidth Layerer]"), "Multiplied with Upper Bound On Width for defining an upper bound on the width of layers which haven't been determined yet, but whose maximum width had been (roughly) estimated by the MinWidth algorithm. Compensates for too high estimations. If set to '-1' multiple values are tested and the best result is selected."), sgb(2)), gid), bJ), xsb(Whd)))); - zgd(a, XBe, SBe, Byc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), YBe), dDe), "Node Promotion Strategy"), "Reduces number of dummy nodes after layering phase (if possible)."), Eyc), eid), vX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ZBe), dDe), "Max Node Promotion Iterations"), "Limits the number of iterations for node promotion."), sgb(0)), gid), bJ), xsb(Whd)))); - zgd(a, ZBe, YBe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), $Be), "layering.coffmanGraham"), "Layer Bound"), "The maximum number of nodes allowed per layer."), sgb(lve)), gid), bJ), xsb(Whd)))); - zgd(a, $Be, SBe, tyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), _Be), eDe), "Crossing Minimization Strategy"), "Strategy for crossing minimization."), Qxc), eid), _W), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), aCe), eDe), "Force Node Model Order"), "The node order given by the model does not change to produce a better layout. E.g. if node A is before node B in the model this is not changed during crossing minimization. This assumes that the node model order is already respected before crossing minimization. This can be achieved by setting considerModelOrder.strategy to NODES_AND_EDGES."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), bCe), eDe), "Hierarchical Sweepiness"), "How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."), 0.1), did), VI), xsb(Whd)))); - zgd(a, bCe, fDe, Ixc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), cCe), eDe), "Semi-Interactive Crossing Minimization"), "Preserves the order of nodes within a layer but still minimizes crossings between edges connecting long edge dummies. Derives the desired order from positions specified by the 'org.eclipse.elk.position' layout option. Requires a crossing minimization strategy that is able to process 'in-layer' constraints."), false), cid), QI), xsb(Whd)))); - zgd(a, cCe, _Be, Oxc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), dCe), eDe), "In Layer Predecessor of"), "Allows to set a constraint which specifies of which node the current node is the predecessor. If set to 's' then the node is the predecessor of 's' and is in the same layer"), null), iid), qJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), eCe), eDe), "In Layer Successor of"), "Allows to set a constraint which specifies of which node the current node is the successor. If set to 's' then the node is the successor of 's' and is in the same layer"), null), iid), qJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), fCe), eDe), "Position Choice Constraint"), "Allows to set a constraint regarding the position placement of a node in a layer. Assumed the layer in which the node placed includes n other nodes and i < n. If set to i, it expresses that the node should be placed at the i-th position. Should i>=n be true then the node is placed at the last position in the layer. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine."), null), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), gCe), eDe), "Position ID"), "Position within a layer that was determined by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set."), sgb(-1)), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), hCe), gDe), "Greedy Switch Activation Threshold"), "By default it is decided automatically if the greedy switch is activated or not. The decision is based on whether the size of the input graph (without dummy nodes) is smaller than the value of this option. A '0' enforces the activation."), sgb(40)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), iCe), gDe), "Greedy Switch Crossing Minimization"), "Greedy Switch strategy for crossing minimization. The greedy switch heuristic is executed after the regular crossing minimization as a post-processor. Note that if 'hierarchyHandling' is set to 'INCLUDE_CHILDREN', the 'greedySwitchHierarchical.type' option must be used."), Fxc), eid), jX), xsb(Whd)))); - zgd(a, iCe, _Be, Gxc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), jCe), "crossingMinimization.greedySwitchHierarchical"), "Greedy Switch Crossing Minimization (hierarchical)"), "Activates the greedy switch heuristic in case hierarchical layout is used. The differences to the non-hierarchical case (see 'greedySwitch.type') are: 1) greedy switch is inactive by default, 3) only the option value set on the node at which hierarchical layout starts is relevant, and 2) if it's activated by the user, it properly addresses hierarchy-crossing edges."), Bxc), eid), jX), xsb(Whd)))); - zgd(a, jCe, _Be, Cxc); - zgd(a, jCe, fDe, Dxc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), kCe), hDe), "Node Placement Strategy"), "Strategy for node placement."), $yc), eid), uX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), lCe), hDe), "Favor Straight Edges Over Balancing"), "Favor straight edges over a balanced node placement. The default behavior is determined automatically based on the used 'edgeRouting'. For an orthogonal style it is set to true, for all other styles to false."), cid), QI), xsb(Whd)))); - zgd(a, lCe, kCe, Qyc); - zgd(a, lCe, kCe, Ryc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), mCe), iDe), "BK Edge Straightening"), "Specifies whether the Brandes Koepf node placer tries to increase the number of straight edges at the expense of diagram size. There is a subtle difference to the 'favorStraightEdges' option, which decides whether a balanced placement of the nodes is desired, or not. In bk terms this means combining the four alignments into a single balanced one, or not. This option on the other hand tries to straighten additional edges during the creation of each of the four alignments."), Kyc), eid), fX), xsb(Whd)))); - zgd(a, mCe, kCe, Lyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), nCe), iDe), "BK Fixed Alignment"), "Tells the BK node placer to use a certain alignment (out of its four) instead of the one producing the smallest height, or the combination of all four."), Nyc), eid), gX), xsb(Whd)))); - zgd(a, nCe, kCe, Oyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), oCe), "nodePlacement.linearSegments"), "Linear Segments Deflection Dampening"), "Dampens the movement of nodes to keep the diagram from getting too large."), 0.3), did), VI), xsb(Whd)))); - zgd(a, oCe, kCe, Tyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), pCe), "nodePlacement.networkSimplex"), "Node Flexibility"), "Aims at shorter and straighter edges. Two configurations are possible: (a) allow ports to move freely on the side they are assigned to (the order is always defined beforehand), (b) additionally allow to enlarge a node wherever it helps. If this option is not configured for a node, the 'nodeFlexibility.default' value is used, which is specified for the node's parent."), eid), tX), xsb(Vhd)))); - zgd(a, pCe, kCe, Yyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), qCe), "nodePlacement.networkSimplex.nodeFlexibility"), "Node Flexibility Default"), "Default value of the 'nodeFlexibility' option for the children of a hierarchical node."), Wyc), eid), tX), xsb(Whd)))); - zgd(a, qCe, kCe, Xyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), rCe), jDe), "Self-Loop Distribution"), "Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."), ayc), eid), zX), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), sCe), jDe), "Self-Loop Ordering"), "Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE."), cyc), eid), AX), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), tCe), "edgeRouting.splines"), "Spline Routing Mode"), "Specifies the way control points are assembled for each individual edge. CONSERVATIVE ensures that edges are properly routed around the nodes but feels rather orthogonal at times. SLOPPY uses fewer control points to obtain curvier edge routes but may result in edges overlapping nodes."), eyc), eid), CX), xsb(Whd)))); - zgd(a, tCe, kDe, fyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), uCe), "edgeRouting.splines.sloppy"), "Sloppy Spline Layer Spacing Factor"), "Spacing factor for routing area between layers when using sloppy spline routing."), 0.2), did), VI), xsb(Whd)))); - zgd(a, uCe, kDe, hyc); - zgd(a, uCe, tCe, iyc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), vCe), "edgeRouting.polyline"), "Sloped Edge Zone Width"), "Width of the strip to the left and to the right of each layer where the polyline edge router is allowed to refrain from ensuring that edges are routed horizontally. This prevents awkward bend points for nodes that extent almost to the edge of their layer."), 2), did), VI), xsb(Whd)))); - zgd(a, vCe, kDe, $xc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), wCe), lDe), "Spacing Base Value"), "An optional base value for all other layout options of the 'spacing' group. It can be used to conveniently alter the overall 'spaciousness' of the drawing. Whenever an explicit value is set for the other layout options, this base value will have no effect. The base value is not inherited, i.e. it must be set for each hierarchical node."), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), xCe), lDe), "Edge Node Between Layers Spacing"), "The spacing to be preserved between nodes and edges that are routed next to the node's layer. For the spacing between nodes and edges that cross the node's layer 'spacing.edgeNode' is used."), 10), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), yCe), lDe), "Edge Edge Between Layer Spacing"), "Spacing to be preserved between pairs of edges that are routed between the same pair of layers. Note that 'spacing.edgeEdge' is used for the spacing between pairs of edges crossing the same layer."), 10), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), zCe), lDe), "Node Node Between Layers Spacing"), "The spacing to be preserved between any pair of nodes of two adjacent layers. Note that 'spacing.nodeNode' is used for the spacing between nodes within the layer itself."), 20), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ACe), mDe), "Direction Priority"), "Defines how important it is to have a certain edge point into the direction of the overall layout. This option is evaluated during the cycle breaking phase."), sgb(0)), gid), bJ), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), BCe), mDe), "Shortness Priority"), "Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase."), sgb(0)), gid), bJ), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), CCe), mDe), "Straightness Priority"), "Defines how important it is to keep an edge straight, i.e. aligned with one of the two axes. This option is evaluated during node placement."), sgb(0)), gid), bJ), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), DCe), nDe), qze), "Tries to further compact components (disconnected sub-graphs)."), false), cid), QI), xsb(Whd)))); - zgd(a, DCe, cAe, true); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ECe), oDe), "Post Compaction Strategy"), pDe), nxc), eid), hX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), FCe), oDe), "Post Compaction Constraint Calculation"), pDe), lxc), eid), $W), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), GCe), qDe), "High Degree Node Treatment"), "Makes room around high degree nodes to place leafs and trees."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), HCe), qDe), "High Degree Node Threshold"), "Whether a node is considered to have a high degree."), sgb(16)), gid), bJ), xsb(Whd)))); - zgd(a, HCe, GCe, true); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ICe), qDe), "High Degree Node Maximum Tree Height"), "Maximum height of a subtree connected to a high degree node to be moved to separate layers."), sgb(5)), gid), bJ), xsb(Whd)))); - zgd(a, ICe, GCe, true); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), JCe), rDe), "Graph Wrapping Strategy"), "For certain graphs and certain prescribed drawing areas it may be desirable to split the laid out graph into chunks that are placed side by side. The edges that connect different chunks are 'wrapped' around from the end of one chunk to the start of the other chunk. The points between the chunks are referred to as 'cuts'."), Gzc), eid), EX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), KCe), rDe), "Additional Wrapped Edges Spacing"), "To visually separate edges that are wrapped from regularly routed edges an additional spacing value can be specified in form of this layout option. The spacing is added to the regular edgeNode spacing."), 10), did), VI), xsb(Whd)))); - zgd(a, KCe, JCe, lzc); - zgd(a, KCe, JCe, mzc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), LCe), rDe), "Correction Factor for Wrapping"), "At times and for certain types of graphs the executed wrapping may produce results that are consistently biased in the same fashion: either wrapping to often or to rarely. This factor can be used to correct the bias. Internally, it is simply multiplied with the 'aspect ratio' layout option."), 1), did), VI), xsb(Whd)))); - zgd(a, LCe, JCe, ozc); - zgd(a, LCe, JCe, pzc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), MCe), sDe), "Cutting Strategy"), "The strategy by which the layer indexes are determined at which the layering crumbles into chunks."), wzc), eid), aX), xsb(Whd)))); - zgd(a, MCe, JCe, xzc); - zgd(a, MCe, JCe, yzc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), NCe), sDe), "Manually Specified Cuts"), "Allows the user to specify her own cuts for a certain graph."), hid), QK), xsb(Whd)))); - zgd(a, NCe, MCe, rzc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), OCe), "wrapping.cutting.msd"), "MSD Freedom"), "The MSD cutting strategy starts with an initial guess on the number of chunks the graph should be split into. The freedom specifies how much the strategy may deviate from this guess. E.g. if an initial number of 3 is computed, a freedom of 1 allows 2, 3, and 4 cuts."), tzc), gid), bJ), xsb(Whd)))); - zgd(a, OCe, MCe, uzc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), PCe), tDe), "Validification Strategy"), "When wrapping graphs, one can specify indices that are not allowed as split points. The validification strategy makes sure every computed split point is allowed."), Lzc), eid), DX), xsb(Whd)))); - zgd(a, PCe, JCe, Mzc); - zgd(a, PCe, JCe, Nzc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), QCe), tDe), "Valid Indices for Wrapping"), null), hid), QK), xsb(Whd)))); - zgd(a, QCe, JCe, Izc); - zgd(a, QCe, JCe, Jzc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), RCe), uDe), "Improve Cuts"), "For general graphs it is important that not too many edges wrap backwards. Thus a compromise between evenly-distributed cuts and the total number of cut edges is sought."), true), cid), QI), xsb(Whd)))); - zgd(a, RCe, JCe, Czc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), SCe), uDe), "Distance Penalty When Improving Cuts"), null), 2), did), VI), xsb(Whd)))); - zgd(a, SCe, JCe, Azc); - zgd(a, SCe, RCe, true); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), TCe), uDe), "Improve Wrapped Edges"), "The initial wrapping is performed in a very simple way. As a consequence, edges that wrap from one chunk to another may be unnecessarily long. Activating this option tries to shorten such edges."), true), cid), QI), xsb(Whd)))); - zgd(a, TCe, JCe, Ezc); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), UCe), vDe), "Edge Label Side Selection"), "Method to decide on edge label sides."), Yxc), eid), eX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), VCe), vDe), "Edge Center Label Placement Strategy"), "Determines in which layer center labels of long edges should be placed."), Wxc), eid), ZW), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Uhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), WCe), wDe), "Consider Model Order"), "Preserves the order of nodes and edges in the model file if this does not lead to additional edge crossings. Depending on the strategy this is not always possible since the node and edge order might be conflicting."), xxc), eid), wX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), XCe), wDe), "Consider Port Order"), "If disabled the port order of output ports is derived from the edge order and input ports are ordered by their incoming connections. If enabled all ports are ordered by the port model order."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), YCe), wDe), "No Model Order"), "Set on a node to not set a model order for this node even though it is a real node."), false), cid), QI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ZCe), wDe), "Consider Model Order for Components"), "If set to NONE the usual ordering strategy (by cumulative node priority and size of nodes) is used. INSIDE_PORT_SIDES orders the components with external ports only inside the groups with the same port side. FORCE_MODEL_ORDER enforces the mode order on components. This option might produce bad alignments and sub optimal drawings in terms of used area since the ordering should be respected."), pxc), eid), CQ), xsb(Whd)))); - zgd(a, ZCe, cAe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), $Ce), wDe), "Long Edge Ordering Strategy"), "Indicates whether long edges are sorted under, over, or equal to nodes that have no connection to a previous layer in a left-to-right or right-to-left layout. Under and over changes to right and left in a vertical layout."), txc), eid), sX), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), _Ce), wDe), "Crossing Counter Node Order Influence"), "Indicates with what percentage (1 for 100%) violations of the node model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal node order. Defaults to no influence (0)."), 0), did), VI), xsb(Whd)))); - zgd(a, _Ce, WCe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), aDe), wDe), "Crossing Counter Port Order Influence"), "Indicates with what percentage (1 for 100%) violations of the port model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal port order. Defaults to no influence (0)."), 0), did), VI), xsb(Whd)))); - zgd(a, aDe, WCe, null); - zCc((new ACc(), a)); - }; - var ixc, jxc, kxc, lxc, mxc, nxc, oxc, pxc, qxc, rxc, sxc, txc, uxc, vxc, wxc, xxc, yxc, zxc, Axc, Bxc, Cxc, Dxc, Exc, Fxc, Gxc, Hxc, Ixc, Jxc, Kxc, Lxc, Mxc, Nxc, Oxc, Pxc, Qxc, Rxc, Sxc, Txc, Uxc, Vxc, Wxc, Xxc, Yxc, Zxc, $xc, _xc, ayc, byc, cyc, dyc, eyc, fyc, gyc, hyc, iyc, jyc, kyc, lyc, myc, nyc, oyc, pyc, qyc, ryc, syc, tyc, uyc, vyc, wyc, xyc, yyc, zyc, Ayc, Byc, Cyc, Dyc, Eyc, Fyc, Gyc, Hyc, Iyc, Jyc, Kyc, Lyc, Myc, Nyc, Oyc, Pyc, Qyc, Ryc, Syc, Tyc, Uyc, Vyc, Wyc, Xyc, Yyc, Zyc, $yc, _yc, azc, bzc, czc, dzc, ezc, fzc, gzc, hzc, izc, jzc, kzc, lzc, mzc, nzc, ozc, pzc, qzc, rzc, szc, tzc, uzc, vzc, wzc, xzc, yzc, zzc, Azc, Bzc, Czc, Dzc, Ezc, Fzc, Gzc, Hzc, Izc, Jzc, Kzc, Lzc, Mzc, Nzc; - sfb(ABe, "LayeredMetaDataProvider", 859); - feb(998, 1, Eye, ACc); - _2.hf = function BCc(a) { - zCc(a); - }; - var Rzc, Szc, Tzc, Uzc, Vzc, Wzc, Xzc, Yzc, Zzc, $zc, _zc, aAc, bAc, cAc, dAc, eAc, fAc, gAc, hAc, iAc, jAc, kAc, lAc, mAc, nAc, oAc, pAc, qAc, rAc, sAc, tAc, uAc, vAc, wAc, xAc, yAc, zAc, AAc, BAc, CAc, DAc, EAc, FAc, GAc, HAc, IAc, JAc, KAc, LAc, MAc, NAc, OAc, PAc, QAc, RAc, SAc, TAc, UAc, VAc, WAc, XAc, YAc, ZAc, $Ac, _Ac, aBc, bBc, cBc, dBc, eBc, fBc, gBc, hBc, iBc, jBc, kBc, lBc, mBc, nBc, oBc, pBc, qBc, rBc, sBc, tBc, uBc, vBc, wBc, xBc, yBc, zBc, ABc, BBc, CBc, DBc, EBc, FBc, GBc, HBc, IBc, JBc, KBc, LBc, MBc, NBc, OBc, PBc, QBc, RBc, SBc, TBc, UBc, VBc, WBc, XBc, YBc, ZBc, $Bc, _Bc, aCc, bCc, cCc, dCc, eCc, fCc, gCc, hCc, iCc, jCc, kCc, lCc, mCc, nCc, oCc, pCc, qCc, rCc, sCc, tCc, uCc, vCc, wCc, xCc; - sfb(ABe, "LayeredOptions", 998); - feb(999, 1, {}, CCc); - _2.sf = function DCc() { - var a; - return a = new lXb(), a; - }; - _2.tf = function ECc(a) { - }; - sfb(ABe, "LayeredOptions/LayeredFactory", 999); - feb(1391, 1, {}); - _2.a = 0; - var FCc; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder", 1391); - feb(792, 1391, {}, RCc); - var OCc, PCc; - sfb(ABe, "LayeredSpacings/LayeredSpacingsBuilder", 792); - feb(265, 22, { 3: 1, 34: 1, 22: 1, 265: 1, 188: 1, 196: 1 }, bDc); - _2.dg = function dDc() { - return aDc(this); - }; - _2.qg = function cDc() { - return aDc(this); - }; - var SCc, TCc, UCc, VCc, WCc, XCc, YCc, ZCc, $Cc; - var rX = tfb(ABe, "LayeringStrategy", 265, WI, fDc, eDc); - var gDc; - feb(390, 22, { 3: 1, 34: 1, 22: 1, 390: 1 }, nDc); - var iDc, jDc, kDc; - var sX = tfb(ABe, "LongEdgeOrderingStrategy", 390, WI, pDc, oDc); - var qDc; - feb(203, 22, { 3: 1, 34: 1, 22: 1, 203: 1 }, yDc); - var sDc, tDc, uDc, vDc; - var tX = tfb(ABe, "NodeFlexibility", 203, WI, BDc, ADc); - var CDc; - feb(323, 22, { 3: 1, 34: 1, 22: 1, 323: 1, 188: 1, 196: 1 }, LDc); - _2.dg = function NDc() { - return KDc(this); - }; - _2.qg = function MDc() { - return KDc(this); - }; - var EDc, FDc, GDc, HDc, IDc; - var uX = tfb(ABe, "NodePlacementStrategy", 323, WI, PDc, ODc); - var QDc; - feb(243, 22, { 3: 1, 34: 1, 22: 1, 243: 1 }, bEc); - var SDc, TDc, UDc, VDc, WDc, XDc, YDc, ZDc, $Dc, _Dc; - var vX = tfb(ABe, "NodePromotionStrategy", 243, WI, dEc, cEc); - var eEc; - feb(284, 22, { 3: 1, 34: 1, 22: 1, 284: 1 }, lEc); - var gEc, hEc, iEc, jEc; - var wX = tfb(ABe, "OrderingStrategy", 284, WI, nEc, mEc); - var oEc; - feb(430, 22, { 3: 1, 34: 1, 22: 1, 430: 1 }, tEc); - var qEc, rEc; - var xX = tfb(ABe, "PortSortingStrategy", 430, WI, vEc, uEc); - var wEc; - feb(463, 22, { 3: 1, 34: 1, 22: 1, 463: 1 }, CEc); - var yEc, zEc, AEc; - var yX = tfb(ABe, "PortType", 463, WI, EEc, DEc); - var FEc; - feb(387, 22, { 3: 1, 34: 1, 22: 1, 387: 1 }, LEc); - var HEc, IEc, JEc; - var zX = tfb(ABe, "SelfLoopDistributionStrategy", 387, WI, NEc, MEc); - var OEc; - feb(349, 22, { 3: 1, 34: 1, 22: 1, 349: 1 }, UEc); - var QEc, REc, SEc; - var AX = tfb(ABe, "SelfLoopOrderingStrategy", 349, WI, WEc, VEc); - var XEc; - feb(312, 1, { 312: 1 }, gFc); - sfb(ABe, "Spacings", 312); - feb(350, 22, { 3: 1, 34: 1, 22: 1, 350: 1 }, mFc); - var iFc, jFc, kFc; - var CX = tfb(ABe, "SplineRoutingMode", 350, WI, oFc, nFc); - var pFc; - feb(352, 22, { 3: 1, 34: 1, 22: 1, 352: 1 }, vFc); - var rFc, sFc, tFc; - var DX = tfb(ABe, "ValidifyStrategy", 352, WI, xFc, wFc); - var yFc; - feb(388, 22, { 3: 1, 34: 1, 22: 1, 388: 1 }, EFc); - var AFc, BFc, CFc; - var EX = tfb(ABe, "WrappingStrategy", 388, WI, GFc, FFc); - var HFc; - feb(1398, 1, nEe, NFc); - _2.rg = function OFc(a) { - return RD(a, 36), JFc; - }; - _2.Kf = function PFc(a, b) { - MFc(this, RD(a, 36), b); - }; - var JFc; - sfb(oEe, "DepthFirstCycleBreaker", 1398); - feb(793, 1, nEe, UFc); - _2.rg = function WFc(a) { - return RD(a, 36), QFc; - }; - _2.Kf = function XFc(a, b) { - SFc(this, RD(a, 36), b); - }; - _2.sg = function VFc(a) { - return RD(Vmb(a, Jwb(this.d, a.c.length)), 10); - }; - var QFc; - sfb(oEe, "GreedyCycleBreaker", 793); - feb(1401, 793, nEe, YFc); - _2.sg = function ZFc(a) { - var b, c2, d, e; - e = null; - b = lve; - for (d = new Anb(a); d.a < d.c.c.length; ) { - c2 = RD(ynb(d), 10); - if (nQb(c2, (Ywc(), zwc)) && RD(mQb(c2, zwc), 17).a < b) { - b = RD(mQb(c2, zwc), 17).a; - e = c2; - } - } - if (!e) { - return RD(Vmb(a, Jwb(this.d, a.c.length)), 10); - } - return e; - }; - sfb(oEe, "GreedyModelOrderCycleBreaker", 1401); - feb(1399, 1, nEe, cGc); - _2.rg = function dGc(a) { - return RD(a, 36), $Fc; - }; - _2.Kf = function eGc(a, b) { - bGc(this, RD(a, 36), b); - }; - var $Fc; - sfb(oEe, "InteractiveCycleBreaker", 1399); - feb(1400, 1, nEe, jGc); - _2.rg = function kGc(a) { - return RD(a, 36), fGc; - }; - _2.Kf = function lGc(a, b) { - iGc(this, RD(a, 36), b); - }; - _2.a = 0; - _2.b = 0; - var fGc; - sfb(oEe, "ModelOrderCycleBreaker", 1400); - feb(1413, 1, nEe, pGc); - _2.rg = function qGc(a) { - return RD(a, 36), mGc; - }; - _2.Kf = function sGc(a, b) { - oGc(this, RD(a, 36), b); - }; - var mGc; - sfb(pEe, "BreadthFirstModelOrderLayerer", 1413); - feb(1414, 1, fye, tGc); - _2.Ne = function uGc(a, b) { - return rGc(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function vGc(a) { - return this === a; - }; - _2.Oe = function wGc() { - return new Frb(this); - }; - sfb(pEe, "BreadthFirstModelOrderLayerer/lambda$0$Type", 1414); - feb(1404, 1, nEe, GGc); - _2.rg = function HGc(a) { - return RD(a, 36), xGc; - }; - _2.Kf = function IGc(a, b) { - EGc(this, RD(a, 36), b); - }; - var xGc; - sfb(pEe, "CoffmanGrahamLayerer", 1404); - feb(1405, 1, fye, JGc); - _2.Ne = function KGc(a, b) { - return AGc(this.a, RD(a, 10), RD(b, 10)); - }; - _2.Fb = function LGc(a) { - return this === a; - }; - _2.Oe = function MGc() { - return new Frb(this); - }; - sfb(pEe, "CoffmanGrahamLayerer/0methodref$compareNodesInTopo$Type", 1405); - feb(1406, 1, fye, NGc); - _2.Ne = function OGc(a, b) { - return DGc(this.a, RD(a, 10), RD(b, 10)); - }; - _2.Fb = function PGc(a) { - return this === a; - }; - _2.Oe = function QGc() { - return new Frb(this); - }; - sfb(pEe, "CoffmanGrahamLayerer/lambda$1$Type", 1406); - feb(1415, 1, nEe, YGc); - _2.rg = function ZGc(a) { - return RD(a, 36), RGc; - }; - _2.Kf = function _Gc(a, b) { - XGc(this, RD(a, 36), b); - }; - _2.c = 0; - _2.e = 0; - var RGc; - sfb(pEe, "DepthFirstModelOrderLayerer", 1415); - feb(1416, 1, fye, aHc); - _2.Ne = function bHc(a, b) { - return $Gc(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function cHc(a) { - return this === a; - }; - _2.Oe = function dHc() { - return new Frb(this); - }; - sfb(pEe, "DepthFirstModelOrderLayerer/lambda$0$Type", 1416); - feb(1407, 1, nEe, gHc); - _2.rg = function hHc(a) { - return RD(a, 36), pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), Ebc)), oXb, Nbc), pXb, Mbc); - }; - _2.Kf = function iHc(a, b) { - fHc(RD(a, 36), b); - }; - sfb(pEe, "InteractiveLayerer", 1407); - feb(578, 1, { 578: 1 }, jHc); - _2.a = 0; - _2.c = 0; - sfb(pEe, "InteractiveLayerer/LayerSpan", 578); - feb(1403, 1, nEe, pHc); - _2.rg = function qHc(a) { - return RD(a, 36), kHc; - }; - _2.Kf = function rHc(a, b) { - mHc(this, RD(a, 36), b); - }; - var kHc; - sfb(pEe, "LongestPathLayerer", 1403); - feb(1412, 1, nEe, xHc); - _2.rg = function yHc(a) { - return RD(a, 36), sHc; - }; - _2.Kf = function zHc(a, b) { - uHc(this, RD(a, 36), b); - }; - var sHc; - sfb(pEe, "LongestPathSourceLayerer", 1412); - feb(1410, 1, nEe, IHc); - _2.rg = function JHc(a) { - return RD(a, 36), pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - }; - _2.Kf = function KHc(a, b) { - GHc(this, RD(a, 36), b); - }; - _2.a = 0; - _2.b = 0; - _2.d = 0; - var AHc, BHc; - sfb(pEe, "MinWidthLayerer", 1410); - feb(1411, 1, fye, MHc); - _2.Ne = function NHc(a, b) { - return LHc(this, RD(a, 10), RD(b, 10)); - }; - _2.Fb = function OHc(a) { - return this === a; - }; - _2.Oe = function PHc() { - return new Frb(this); - }; - sfb(pEe, "MinWidthLayerer/MinOutgoingEdgesComparator", 1411); - feb(1402, 1, nEe, XHc); - _2.rg = function YHc(a) { - return RD(a, 36), QHc; - }; - _2.Kf = function ZHc(a, b) { - WHc(this, RD(a, 36), b); - }; - var QHc; - sfb(pEe, "NetworkSimplexLayerer", 1402); - feb(1408, 1, nEe, jIc); - _2.rg = function kIc(a) { - return RD(a, 36), pfd(pfd(pfd(new ufd(), (sXb(), nXb), (hcc(), obc)), oXb, Nbc), pXb, Mbc); - }; - _2.Kf = function lIc(a, b) { - gIc(this, RD(a, 36), b); - }; - _2.d = 0; - _2.f = 0; - _2.g = 0; - _2.i = 0; - _2.s = 0; - _2.t = 0; - _2.u = 0; - sfb(pEe, "StretchWidthLayerer", 1408); - feb(1409, 1, fye, nIc); - _2.Ne = function oIc(a, b) { - return mIc(RD(a, 10), RD(b, 10)); - }; - _2.Fb = function pIc(a) { - return this === a; - }; - _2.Oe = function qIc() { - return new Frb(this); - }; - sfb(pEe, "StretchWidthLayerer/1", 1409); - feb(413, 1, qEe); - _2.gg = function FIc(a, b, c2, d, e, f2) { - }; - _2.ug = function DIc(a, b, c2) { - return wIc(this, a, b, c2); - }; - _2.fg = function EIc() { - this.g = $C(jE, rEe, 28, this.d, 15, 1); - this.f = $C(jE, rEe, 28, this.d, 15, 1); - }; - _2.hg = function GIc(a, b) { - this.e[a] = $C(kE, Pwe, 28, b[a].length, 15, 1); - }; - _2.ig = function HIc(a, b, c2) { - var d; - d = c2[a][b]; - d.p = b; - this.e[a][b] = b; - }; - _2.jg = function IIc(a, b, c2, d) { - RD(Vmb(d[a][b].j, c2), 12).p = this.d++; - }; - _2.b = 0; - _2.c = 0; - _2.d = 0; - sfb(sEe, "AbstractBarycenterPortDistributor", 413); - feb(1698, 1, fye, JIc); - _2.Ne = function KIc(a, b) { - return zIc(this.a, RD(a, 12), RD(b, 12)); - }; - _2.Fb = function LIc(a) { - return this === a; - }; - _2.Oe = function MIc() { - return new Frb(this); - }; - sfb(sEe, "AbstractBarycenterPortDistributor/lambda$0$Type", 1698); - feb(832, 1, uBe, UIc); - _2.gg = function XIc(a, b, c2, d, e, f2) { - }; - _2.ig = function ZIc(a, b, c2) { - }; - _2.jg = function $Ic(a, b, c2, d) { - }; - _2.eg = function VIc() { - return false; - }; - _2.fg = function WIc() { - this.c = this.e.a; - this.g = this.f.g; - }; - _2.hg = function YIc(a, b) { - b[a][0].c.p = a; - }; - _2.kg = function _Ic() { - return false; - }; - _2.vg = function aJc(a, b, c2, d) { - if (c2) { - RIc(this, a); - } else { - OIc(this, a, d); - PIc(this, a, b); - } - if (a.c.length > 1) { - Heb(TD(mQb(Y2b((tFb(0, a.c.length), RD(a.c[0], 10))), (yCc(), eAc)))) ? wLc(a, this.d, RD(this, 669)) : (yob(), _mb(a, this.d)); - nJc(this.e, a); - } - }; - _2.lg = function bJc(a, b, c2, d) { - var e, f2, g, h, i2, j, k; - if (b != SIc(c2, a.length)) { - f2 = a[b - (c2 ? 1 : -1)]; - sIc(this.f, f2, c2 ? (BEc(), zEc) : (BEc(), yEc)); - } - e = a[b][0]; - k = !d || e.k == (r3b(), m3b); - j = dv(a[b]); - this.vg(j, k, false, c2); - g = 0; - for (i2 = new Anb(j); i2.a < i2.c.c.length; ) { - h = RD(ynb(i2), 10); - a[b][g++] = h; - } - return false; - }; - _2.mg = function cJc(a, b) { - var c2, d, e, f2, g; - g = SIc(b, a.length); - f2 = dv(a[g]); - this.vg(f2, false, true, b); - c2 = 0; - for (e = new Anb(f2); e.a < e.c.c.length; ) { - d = RD(ynb(e), 10); - a[g][c2++] = d; - } - return false; - }; - sfb(sEe, "BarycenterHeuristic", 832); - feb(667, 1, { 667: 1 }, dJc); - _2.Ib = function eJc() { - return "BarycenterState [node=" + this.c + ", summedWeight=" + this.d + ", degree=" + this.b + ", barycenter=" + this.a + ", visited=" + this.e + "]"; - }; - _2.b = 0; - _2.d = 0; - _2.e = false; - var aY = sfb(sEe, "BarycenterHeuristic/BarycenterState", 667); - feb(1865, 1, fye, fJc); - _2.Ne = function gJc(a, b) { - return QIc(this.a, RD(a, 10), RD(b, 10)); - }; - _2.Fb = function hJc(a) { - return this === a; - }; - _2.Oe = function iJc() { - return new Frb(this); - }; - sfb(sEe, "BarycenterHeuristic/lambda$0$Type", 1865); - feb(831, 1, uBe, qJc); - _2.fg = function rJc() { - }; - _2.gg = function sJc(a, b, c2, d, e, f2) { - }; - _2.jg = function vJc(a, b, c2, d) { - }; - _2.hg = function tJc(a, b) { - this.a[a] = $C(aY, { 3: 1, 4: 1, 5: 1, 2117: 1 }, 667, b[a].length, 0, 1); - this.b[a] = $C(dY, { 3: 1, 4: 1, 5: 1, 2118: 1 }, 239, b[a].length, 0, 1); - }; - _2.ig = function uJc(a, b, c2) { - mJc(this, c2[a][b], true); - }; - _2.c = false; - sfb(sEe, "ForsterConstraintResolver", 831); - feb(239, 1, { 239: 1 }, yJc, zJc); - _2.Ib = function AJc() { - var a, b; - b = new bib(); - b.a += "["; - for (a = 0; a < this.d.length; a++) { - Zhb(b, i3b(this.d[a])); - pJc(this.g, this.d[0]).a != null && Zhb(Zhb((b.a += "<", b), Pfb(pJc(this.g, this.d[0]).a)), ">"); - a < this.d.length - 1 && (b.a += pve, b); - } - return (b.a += "]", b).a; - }; - _2.a = 0; - _2.c = 0; - _2.f = 0; - var dY = sfb(sEe, "ForsterConstraintResolver/ConstraintGroup", 239); - feb(1860, 1, Qve, BJc); - _2.Cd = function CJc(a) { - mJc(this.a, RD(a, 10), false); - }; - sfb(sEe, "ForsterConstraintResolver/lambda$0$Type", 1860); - feb(219, 1, { 219: 1, 230: 1 }, FJc); - _2.gg = function HJc(a, b, c2, d, e, f2) { - }; - _2.hg = function IJc(a, b) { - }; - _2.fg = function GJc() { - this.r = $C(kE, Pwe, 28, this.n, 15, 1); - }; - _2.ig = function JJc(a, b, c2) { - var d, e; - e = c2[a][b]; - d = e.e; - !!d && Rmb(this.b, d); - }; - _2.jg = function KJc(a, b, c2, d) { - ++this.n; - }; - _2.Ib = function LJc() { - return Inb(this.e, new _sb()); - }; - _2.g = false; - _2.i = false; - _2.n = 0; - _2.s = false; - sfb(sEe, "GraphInfoHolder", 219); - feb(1905, 1, uBe, PJc); - _2.gg = function SJc(a, b, c2, d, e, f2) { - }; - _2.hg = function TJc(a, b) { - }; - _2.jg = function VJc(a, b, c2, d) { - }; - _2.ug = function QJc(a, b, c2) { - c2 && b > 0 ? (pMc(this.a, a[b - 1], a[b]), void 0) : !c2 && b < a.length - 1 ? (pMc(this.a, a[b], a[b + 1]), void 0) : rMc(this.a, a[b], c2 ? (qpd(), ppd) : (qpd(), Xod)); - return MJc(this, a, b, c2); - }; - _2.fg = function RJc() { - this.d = $C(kE, Pwe, 28, this.c, 15, 1); - this.a = new DMc(this.d); - }; - _2.ig = function UJc(a, b, c2) { - var d; - d = c2[a][b]; - this.c += d.j.c.length; - }; - _2.c = 0; - sfb(sEe, "GreedyPortDistributor", 1905); - feb(1421, 1, nEe, aKc); - _2.rg = function bKc(a) { - return ZJc(RD(a, 36)); - }; - _2.Kf = function cKc(a, b) { - _Jc(RD(a, 36), b); - }; - var XJc; - sfb(sEe, "InteractiveCrossingMinimizer", 1421); - feb(1422, 1, fye, eKc); - _2.Ne = function fKc(a, b) { - return dKc(this, RD(a, 10), RD(b, 10)); - }; - _2.Fb = function gKc(a) { - return this === a; - }; - _2.Oe = function hKc() { - return new Frb(this); - }; - sfb(sEe, "InteractiveCrossingMinimizer/1", 1422); - feb(514, 1, { 514: 1, 106: 1, 47: 1 }, FKc); - _2.rg = function GKc(a) { - var b; - return RD(a, 36), b = vfd(iKc), pfd(b, (sXb(), pXb), (hcc(), Ybc)), b; - }; - _2.Kf = function HKc(a, b) { - wKc(this, RD(a, 36), b); - }; - _2.e = 0; - var iKc; - sfb(sEe, "LayerSweepCrossingMinimizer", 514); - feb(1418, 1, Qve, IKc); - _2.Cd = function JKc(a) { - kKc(this.a, RD(a, 219)); - }; - sfb(sEe, "LayerSweepCrossingMinimizer/0methodref$compareDifferentRandomizedLayouts$Type", 1418); - feb(1419, 1, Qve, KKc); - _2.Cd = function LKc(a) { - tKc(this.a, RD(a, 219)); - }; - sfb(sEe, "LayerSweepCrossingMinimizer/1methodref$minimizeCrossingsNoCounter$Type", 1419); - feb(1420, 1, Qve, MKc); - _2.Cd = function NKc(a) { - vKc(this.a, RD(a, 219)); - }; - sfb(sEe, "LayerSweepCrossingMinimizer/2methodref$minimizeCrossingsWithCounter$Type", 1420); - feb(464, 22, { 3: 1, 34: 1, 22: 1, 464: 1 }, SKc); - var OKc, PKc, QKc; - var nY = tfb(sEe, "LayerSweepCrossingMinimizer/CrossMinType", 464, WI, UKc, TKc); - var VKc; - feb(1417, 1, nwe, XKc); - _2.Mb = function YKc(a) { - return jKc(), RD(a, 30).a.c.length == 0; - }; - sfb(sEe, "LayerSweepCrossingMinimizer/lambda$0$Type", 1417); - feb(1862, 1, uBe, _Kc); - _2.fg = function aLc() { - }; - _2.gg = function bLc(a, b, c2, d, e, f2) { - }; - _2.jg = function eLc(a, b, c2, d) { - }; - _2.hg = function cLc(a, b) { - b[a][0].c.p = a; - this.b[a] = $C(qY, { 3: 1, 4: 1, 5: 1, 2043: 1 }, 668, b[a].length, 0, 1); - }; - _2.ig = function dLc(a, b, c2) { - var d; - d = c2[a][b]; - d.p = b; - bD(this.b[a], b, new fLc()); - }; - sfb(sEe, "LayerSweepTypeDecider", 1862); - feb(668, 1, { 668: 1 }, fLc); - _2.Ib = function gLc() { - return "NodeInfo [connectedEdges=" + this.a + ", hierarchicalInfluence=" + this.b + ", randomInfluence=" + this.c + "]"; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - var qY = sfb(sEe, "LayerSweepTypeDecider/NodeInfo", 668); - feb(1863, 1, xye, hLc); - _2.Lb = function iLc(a) { - return k4b(new l4b(RD(a, 12).b)); - }; - _2.Fb = function jLc(a) { - return this === a; - }; - _2.Mb = function kLc(a) { - return k4b(new l4b(RD(a, 12).b)); - }; - sfb(sEe, "LayerSweepTypeDecider/lambda$0$Type", 1863); - feb(1864, 1, xye, lLc); - _2.Lb = function mLc(a) { - return k4b(new l4b(RD(a, 12).b)); - }; - _2.Fb = function nLc(a) { - return this === a; - }; - _2.Mb = function oLc(a) { - return k4b(new l4b(RD(a, 12).b)); - }; - sfb(sEe, "LayerSweepTypeDecider/lambda$1$Type", 1864); - feb(1906, 413, qEe, pLc); - _2.tg = function qLc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l; - j = this.g; - switch (c2.g) { - case 1: { - d = 0; - e = 0; - for (i2 = new Anb(a.j); i2.a < i2.c.c.length; ) { - g = RD(ynb(i2), 12); - if (g.e.c.length != 0) { - ++d; - g.j == (qpd(), Yod) && ++e; - } - } - f2 = b + e; - l = b + d; - for (h = c3b(a, (BEc(), yEc)).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 12); - if (g.j == (qpd(), Yod)) { - j[g.p] = f2; - --f2; - } else { - j[g.p] = l; - --l; - } - } - return d; - } - case 2: { - k = 0; - for (h = c3b(a, (BEc(), zEc)).Kc(); h.Ob(); ) { - g = RD(h.Pb(), 12); - ++k; - j[g.p] = b + k; - } - return k; - } - default: - throw Adb(new _fb()); - } - }; - sfb(sEe, "LayerTotalPortDistributor", 1906); - feb(669, 832, { 669: 1, 230: 1 }, vLc); - _2.vg = function xLc(a, b, c2, d) { - if (c2) { - RIc(this, a); - } else { - OIc(this, a, d); - PIc(this, a, b); - } - if (a.c.length > 1) { - Heb(TD(mQb(Y2b((tFb(0, a.c.length), RD(a.c[0], 10))), (yCc(), eAc)))) ? wLc(a, this.d, this) : (yob(), _mb(a, this.d)); - Heb(TD(mQb(Y2b((tFb(0, a.c.length), RD(a.c[0], 10))), eAc))) || nJc(this.e, a); - } - }; - sfb(sEe, "ModelOrderBarycenterHeuristic", 669); - feb(1866, 1, fye, yLc); - _2.Ne = function zLc(a, b) { - return tLc(this.a, RD(a, 10), RD(b, 10)); - }; - _2.Fb = function ALc(a) { - return this === a; - }; - _2.Oe = function BLc() { - return new Frb(this); - }; - sfb(sEe, "ModelOrderBarycenterHeuristic/lambda$0$Type", 1866); - feb(1423, 1, nEe, FLc); - _2.rg = function GLc(a) { - var b; - return RD(a, 36), b = vfd(CLc), pfd(b, (sXb(), pXb), (hcc(), Ybc)), b; - }; - _2.Kf = function HLc(a, b) { - ELc((RD(a, 36), b)); - }; - var CLc; - sfb(sEe, "NoCrossingMinimizer", 1423); - feb(809, 413, qEe, ILc); - _2.tg = function JLc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n; - l = this.g; - switch (c2.g) { - case 1: { - e = 0; - f2 = 0; - for (k = new Anb(a.j); k.a < k.c.c.length; ) { - i2 = RD(ynb(k), 12); - if (i2.e.c.length != 0) { - ++e; - i2.j == (qpd(), Yod) && ++f2; - } - } - d = 1 / (e + 1); - g = b + f2 * d; - n = b + 1 - d; - for (j = c3b(a, (BEc(), yEc)).Kc(); j.Ob(); ) { - i2 = RD(j.Pb(), 12); - if (i2.j == (qpd(), Yod)) { - l[i2.p] = g; - g -= d; - } else { - l[i2.p] = n; - n -= d; - } - } - break; - } - case 2: { - h = 0; - for (k = new Anb(a.j); k.a < k.c.c.length; ) { - i2 = RD(ynb(k), 12); - i2.g.c.length == 0 || ++h; - } - d = 1 / (h + 1); - m = b + d; - for (j = c3b(a, (BEc(), zEc)).Kc(); j.Ob(); ) { - i2 = RD(j.Pb(), 12); - l[i2.p] = m; - m += d; - } - break; - } - default: - throw Adb(new agb("Port type is undefined")); - } - return 1; - }; - sfb(sEe, "NodeRelativePortDistributor", 809); - feb(822, 1, {}, NLc, OLc); - sfb(sEe, "SweepCopy", 822); - feb(1861, 1, uBe, RLc); - _2.hg = function ULc(a, b) { - }; - _2.fg = function SLc() { - var a; - a = $C(kE, Pwe, 28, this.f, 15, 1); - this.d = new jNc(a); - this.a = new DMc(a); - }; - _2.gg = function TLc(a, b, c2, d, e, f2) { - var g; - g = RD(Vmb(f2[a][b].j, c2), 12); - e.c == g && e.c.i.c == e.d.i.c && ++this.e[a]; - }; - _2.ig = function VLc(a, b, c2) { - var d; - d = c2[a][b]; - this.c[a] = this.c[a] | d.k == (r3b(), q3b); - }; - _2.jg = function WLc(a, b, c2, d) { - var e; - e = RD(Vmb(d[a][b].j, c2), 12); - e.p = this.f++; - e.g.c.length + e.e.c.length > 1 && (e.j == (qpd(), Xod) ? this.b[a] = true : e.j == ppd && a > 0 && (this.b[a - 1] = true)); - }; - _2.f = 0; - sfb(tBe, "AllCrossingsCounter", 1861); - feb(595, 1, {}, _Lc); - _2.b = 0; - _2.d = 0; - sfb(tBe, "BinaryIndexedTree", 595); - feb(532, 1, {}, DMc); - var bMc, cMc; - sfb(tBe, "CrossingsCounter", 532); - feb(1950, 1, fye, HMc); - _2.Ne = function IMc(a, b) { - return wMc(this.a, RD(a, 12), RD(b, 12)); - }; - _2.Fb = function JMc(a) { - return this === a; - }; - _2.Oe = function KMc() { - return new Frb(this); - }; - sfb(tBe, "CrossingsCounter/lambda$0$Type", 1950); - feb(1951, 1, fye, LMc); - _2.Ne = function MMc(a, b) { - return xMc(this.a, RD(a, 12), RD(b, 12)); - }; - _2.Fb = function NMc(a) { - return this === a; - }; - _2.Oe = function OMc() { - return new Frb(this); - }; - sfb(tBe, "CrossingsCounter/lambda$1$Type", 1951); - feb(1952, 1, fye, PMc); - _2.Ne = function QMc(a, b) { - return yMc(this.a, RD(a, 12), RD(b, 12)); - }; - _2.Fb = function RMc(a) { - return this === a; - }; - _2.Oe = function SMc() { - return new Frb(this); - }; - sfb(tBe, "CrossingsCounter/lambda$2$Type", 1952); - feb(1953, 1, fye, TMc); - _2.Ne = function UMc(a, b) { - return zMc(this.a, RD(a, 12), RD(b, 12)); - }; - _2.Fb = function VMc(a) { - return this === a; - }; - _2.Oe = function WMc() { - return new Frb(this); - }; - sfb(tBe, "CrossingsCounter/lambda$3$Type", 1953); - feb(1954, 1, Qve, XMc); - _2.Cd = function YMc(a) { - EMc(this.a, RD(a, 12)); - }; - sfb(tBe, "CrossingsCounter/lambda$4$Type", 1954); - feb(1955, 1, nwe, ZMc); - _2.Mb = function $Mc(a) { - return FMc(this.a, RD(a, 12)); - }; - sfb(tBe, "CrossingsCounter/lambda$5$Type", 1955); - feb(1956, 1, Qve, aNc); - _2.Cd = function bNc(a) { - _Mc(this, a); - }; - sfb(tBe, "CrossingsCounter/lambda$6$Type", 1956); - feb(1957, 1, Qve, cNc); - _2.Cd = function dNc(a) { - var b; - dMc(); - hmb(this.b, (b = this.a, RD(a, 12), b)); - }; - sfb(tBe, "CrossingsCounter/lambda$7$Type", 1957); - feb(839, 1, xye, eNc); - _2.Lb = function fNc(a) { - return dMc(), nQb(RD(a, 12), (Ywc(), Iwc)); - }; - _2.Fb = function gNc(a) { - return this === a; - }; - _2.Mb = function hNc(a) { - return dMc(), nQb(RD(a, 12), (Ywc(), Iwc)); - }; - sfb(tBe, "CrossingsCounter/lambda$8$Type", 839); - feb(1949, 1, {}, jNc); - sfb(tBe, "HyperedgeCrossingsCounter", 1949); - feb(478, 1, { 34: 1, 478: 1 }, lNc); - _2.Fd = function mNc(a) { - return kNc(this, RD(a, 478)); - }; - _2.b = 0; - _2.c = 0; - _2.e = 0; - _2.f = 0; - var OY = sfb(tBe, "HyperedgeCrossingsCounter/Hyperedge", 478); - feb(374, 1, { 34: 1, 374: 1 }, oNc); - _2.Fd = function pNc(a) { - return nNc(this, RD(a, 374)); - }; - _2.b = 0; - _2.c = 0; - var NY = sfb(tBe, "HyperedgeCrossingsCounter/HyperedgeCorner", 374); - feb(531, 22, { 3: 1, 34: 1, 22: 1, 531: 1 }, tNc); - var qNc, rNc; - var MY = tfb(tBe, "HyperedgeCrossingsCounter/HyperedgeCorner/Type", 531, WI, vNc, uNc); - var wNc; - feb(1425, 1, nEe, DNc); - _2.rg = function ENc(a) { - return RD(mQb(RD(a, 36), (Ywc(), kwc)), 21).Hc((ovc(), hvc)) ? zNc : null; - }; - _2.Kf = function FNc(a, b) { - CNc(this, RD(a, 36), b); - }; - var zNc; - sfb(tEe, "InteractiveNodePlacer", 1425); - feb(1426, 1, nEe, TNc); - _2.rg = function UNc(a) { - return RD(mQb(RD(a, 36), (Ywc(), kwc)), 21).Hc((ovc(), hvc)) ? GNc : null; - }; - _2.Kf = function VNc(a, b) { - RNc(this, RD(a, 36), b); - }; - var GNc, HNc, INc; - sfb(tEe, "LinearSegmentsNodePlacer", 1426); - feb(261, 1, { 34: 1, 261: 1 }, ZNc); - _2.Fd = function $Nc(a) { - return WNc(this, RD(a, 261)); - }; - _2.Fb = function _Nc(a) { - var b; - if (ZD(a, 261)) { - b = RD(a, 261); - return this.b == b.b; - } - return false; - }; - _2.Hb = function aOc() { - return this.b; - }; - _2.Ib = function bOc() { - return "ls" + Fe(this.e); - }; - _2.a = 0; - _2.b = 0; - _2.c = -1; - _2.d = -1; - _2.g = 0; - var SY = sfb(tEe, "LinearSegmentsNodePlacer/LinearSegment", 261); - feb(1428, 1, nEe, yOc); - _2.rg = function zOc(a) { - return RD(mQb(RD(a, 36), (Ywc(), kwc)), 21).Hc((ovc(), hvc)) ? cOc : null; - }; - _2.Kf = function HOc(a, b) { - uOc(this, RD(a, 36), b); - }; - _2.b = 0; - _2.g = 0; - var cOc; - sfb(tEe, "NetworkSimplexPlacer", 1428); - feb(1447, 1, fye, IOc); - _2.Ne = function JOc(a, b) { - return hgb(RD(a, 17).a, RD(b, 17).a); - }; - _2.Fb = function KOc(a) { - return this === a; - }; - _2.Oe = function LOc() { - return new Frb(this); - }; - sfb(tEe, "NetworkSimplexPlacer/0methodref$compare$Type", 1447); - feb(1449, 1, fye, MOc); - _2.Ne = function NOc(a, b) { - return hgb(RD(a, 17).a, RD(b, 17).a); - }; - _2.Fb = function OOc(a) { - return this === a; - }; - _2.Oe = function POc() { - return new Frb(this); - }; - sfb(tEe, "NetworkSimplexPlacer/1methodref$compare$Type", 1449); - feb(655, 1, { 655: 1 }, QOc); - var WY = sfb(tEe, "NetworkSimplexPlacer/EdgeRep", 655); - feb(412, 1, { 412: 1 }, ROc); - _2.b = false; - var XY = sfb(tEe, "NetworkSimplexPlacer/NodeRep", 412); - feb(515, 13, { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 13: 1, 16: 1, 15: 1, 59: 1, 515: 1 }, VOc); - sfb(tEe, "NetworkSimplexPlacer/Path", 515); - feb(1429, 1, {}, WOc); - _2.Kb = function XOc(a) { - return RD(a, 18).d.i.k; - }; - sfb(tEe, "NetworkSimplexPlacer/Path/lambda$0$Type", 1429); - feb(1430, 1, nwe, YOc); - _2.Mb = function ZOc(a) { - return RD(a, 273) == (r3b(), o3b); - }; - sfb(tEe, "NetworkSimplexPlacer/Path/lambda$1$Type", 1430); - feb(1431, 1, {}, $Oc); - _2.Kb = function _Oc(a) { - return RD(a, 18).d.i; - }; - sfb(tEe, "NetworkSimplexPlacer/Path/lambda$2$Type", 1431); - feb(1432, 1, nwe, aPc); - _2.Mb = function bPc(a) { - return EPc(zDc(RD(a, 10))); - }; - sfb(tEe, "NetworkSimplexPlacer/Path/lambda$3$Type", 1432); - feb(1433, 1, nwe, cPc); - _2.Mb = function dPc(a) { - return DOc(RD(a, 12)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$0$Type", 1433); - feb(1434, 1, Qve, ePc); - _2.Cd = function fPc(a) { - jOc(this.a, this.b, RD(a, 12)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$1$Type", 1434); - feb(1443, 1, Qve, gPc); - _2.Cd = function hPc(a) { - kOc(this.a, RD(a, 18)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$10$Type", 1443); - feb(1444, 1, {}, iPc); - _2.Kb = function jPc(a) { - return dOc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$11$Type", 1444); - feb(1445, 1, Qve, kPc); - _2.Cd = function lPc(a) { - lOc(this.a, RD(a, 10)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$12$Type", 1445); - feb(1446, 1, {}, mPc); - _2.Kb = function nPc(a) { - return dOc(), sgb(RD(a, 125).e); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$13$Type", 1446); - feb(1448, 1, {}, oPc); - _2.Kb = function pPc(a) { - return dOc(), sgb(RD(a, 125).e); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$15$Type", 1448); - feb(1450, 1, nwe, qPc); - _2.Mb = function rPc(a) { - return dOc(), RD(a, 412).c.k == (r3b(), p3b); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$17$Type", 1450); - feb(1451, 1, nwe, sPc); - _2.Mb = function tPc(a) { - return dOc(), RD(a, 412).c.j.c.length > 1; - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$18$Type", 1451); - feb(1452, 1, Qve, uPc); - _2.Cd = function vPc(a) { - EOc(this.c, this.b, this.d, this.a, RD(a, 412)); - }; - _2.c = 0; - _2.d = 0; - sfb(tEe, "NetworkSimplexPlacer/lambda$19$Type", 1452); - feb(1435, 1, {}, wPc); - _2.Kb = function xPc(a) { - return dOc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$2$Type", 1435); - feb(1453, 1, Qve, yPc); - _2.Cd = function zPc(a) { - FOc(this.a, RD(a, 12)); - }; - _2.a = 0; - sfb(tEe, "NetworkSimplexPlacer/lambda$20$Type", 1453); - feb(1454, 1, {}, APc); - _2.Kb = function BPc(a) { - return dOc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$21$Type", 1454); - feb(1455, 1, Qve, CPc); - _2.Cd = function DPc(a) { - mOc(this.a, RD(a, 10)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$22$Type", 1455); - feb(1456, 1, nwe, FPc); - _2.Mb = function GPc(a) { - return EPc(a); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$23$Type", 1456); - feb(1457, 1, {}, HPc); - _2.Kb = function IPc(a) { - return dOc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$24$Type", 1457); - feb(1458, 1, nwe, JPc); - _2.Mb = function KPc(a) { - return nOc(this.a, RD(a, 10)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$25$Type", 1458); - feb(1459, 1, Qve, LPc); - _2.Cd = function MPc(a) { - oOc(this.a, this.b, RD(a, 10)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$26$Type", 1459); - feb(1460, 1, nwe, NPc); - _2.Mb = function OPc(a) { - return dOc(), !W0b(RD(a, 18)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$27$Type", 1460); - feb(1461, 1, nwe, PPc); - _2.Mb = function QPc(a) { - return dOc(), !W0b(RD(a, 18)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$28$Type", 1461); - feb(1462, 1, {}, RPc); - _2.Ve = function SPc(a, b) { - return pOc(this.a, RD(a, 30), RD(b, 30)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$29$Type", 1462); - feb(1436, 1, {}, TPc); - _2.Kb = function UPc(a) { - return dOc(), new SDb(null, new Twb(new is(Mr(a3b(RD(a, 10)).a.Kc(), new ir())))); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$3$Type", 1436); - feb(1437, 1, nwe, VPc); - _2.Mb = function WPc(a) { - return dOc(), COc(RD(a, 18)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$4$Type", 1437); - feb(1438, 1, Qve, XPc); - _2.Cd = function YPc(a) { - vOc(this.a, RD(a, 18)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$5$Type", 1438); - feb(1439, 1, {}, ZPc); - _2.Kb = function $Pc(a) { - return dOc(), new SDb(null, new Swb(RD(a, 30).a, 16)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$6$Type", 1439); - feb(1440, 1, nwe, _Pc); - _2.Mb = function aQc(a) { - return dOc(), RD(a, 10).k == (r3b(), p3b); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$7$Type", 1440); - feb(1441, 1, {}, bQc); - _2.Kb = function cQc(a) { - return dOc(), new SDb(null, new Twb(new is(Mr(W2b(RD(a, 10)).a.Kc(), new ir())))); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$8$Type", 1441); - feb(1442, 1, nwe, dQc); - _2.Mb = function eQc(a) { - return dOc(), V0b(RD(a, 18)); - }; - sfb(tEe, "NetworkSimplexPlacer/lambda$9$Type", 1442); - feb(1424, 1, nEe, iQc); - _2.rg = function jQc(a) { - return RD(mQb(RD(a, 36), (Ywc(), kwc)), 21).Hc((ovc(), hvc)) ? fQc : null; - }; - _2.Kf = function kQc(a, b) { - hQc(RD(a, 36), b); - }; - var fQc; - sfb(tEe, "SimpleNodePlacer", 1424); - feb(185, 1, { 185: 1 }, sQc); - _2.Ib = function tQc() { - var a; - a = ""; - this.c == (wQc(), vQc) ? a += Oye : this.c == uQc && (a += Nye); - this.o == (EQc(), CQc) ? a += Zye : this.o == DQc ? a += "UP" : a += "BALANCED"; - return a; - }; - sfb(wEe, "BKAlignedLayout", 185); - feb(523, 22, { 3: 1, 34: 1, 22: 1, 523: 1 }, xQc); - var uQc, vQc; - var FZ = tfb(wEe, "BKAlignedLayout/HDirection", 523, WI, zQc, yQc); - var AQc; - feb(522, 22, { 3: 1, 34: 1, 22: 1, 522: 1 }, FQc); - var CQc, DQc; - var GZ = tfb(wEe, "BKAlignedLayout/VDirection", 522, WI, HQc, GQc); - var IQc; - feb(1699, 1, {}, MQc); - sfb(wEe, "BKAligner", 1699); - feb(1702, 1, {}, RQc); - sfb(wEe, "BKCompactor", 1702); - feb(663, 1, { 663: 1 }, SQc); - _2.a = 0; - sfb(wEe, "BKCompactor/ClassEdge", 663); - feb(467, 1, { 467: 1 }, UQc); - _2.a = null; - _2.b = 0; - sfb(wEe, "BKCompactor/ClassNode", 467); - feb(1427, 1, nEe, aRc); - _2.rg = function eRc(a) { - return RD(mQb(RD(a, 36), (Ywc(), kwc)), 21).Hc((ovc(), hvc)) ? VQc : null; - }; - _2.Kf = function fRc(a, b) { - _Qc(this, RD(a, 36), b); - }; - _2.d = false; - var VQc; - sfb(wEe, "BKNodePlacer", 1427); - feb(1700, 1, {}, hRc); - _2.d = 0; - sfb(wEe, "NeighborhoodInformation", 1700); - feb(1701, 1, fye, mRc); - _2.Ne = function nRc(a, b) { - return lRc(this, RD(a, 42), RD(b, 42)); - }; - _2.Fb = function oRc(a) { - return this === a; - }; - _2.Oe = function pRc() { - return new Frb(this); - }; - sfb(wEe, "NeighborhoodInformation/NeighborComparator", 1701); - feb(823, 1, {}); - sfb(wEe, "ThresholdStrategy", 823); - feb(1825, 823, {}, uRc); - _2.wg = function vRc(a, b, c2) { - return this.a.o == (EQc(), DQc) ? oxe : pxe; - }; - _2.xg = function wRc() { - }; - sfb(wEe, "ThresholdStrategy/NullThresholdStrategy", 1825); - feb(587, 1, { 587: 1 }, xRc); - _2.c = false; - _2.d = false; - sfb(wEe, "ThresholdStrategy/Postprocessable", 587); - feb(1826, 823, {}, BRc); - _2.wg = function CRc(a, b, c2) { - var d, e, f2; - e = b == c2; - d = this.a.a[c2.p] == b; - if (!(e || d)) { - return a; - } - f2 = a; - if (this.a.c == (wQc(), vQc)) { - e && (f2 = yRc(this, b, true)); - !isNaN(f2) && !isFinite(f2) && d && (f2 = yRc(this, c2, false)); - } else { - e && (f2 = yRc(this, b, true)); - !isNaN(f2) && !isFinite(f2) && d && (f2 = yRc(this, c2, false)); - } - return f2; - }; - _2.xg = function DRc() { - var a, b, c2, d, e; - while (this.d.b != 0) { - e = RD(Tub(this.d), 587); - d = zRc(this, e); - if (!d.a) { - continue; - } - a = d.a; - c2 = Heb(this.a.f[this.a.g[e.b.p].p]); - if (!c2 && !W0b(a) && a.c.i.c == a.d.i.c) { - continue; - } - b = ARc(this, e); - b || Eyb(this.e, e); - } - while (this.e.a.c.length != 0) { - ARc(this, RD(Dyb(this.e), 587)); - } - }; - sfb(wEe, "ThresholdStrategy/SimpleThresholdStrategy", 1826); - feb(645, 1, { 645: 1, 188: 1, 196: 1 }, HRc); - _2.dg = function JRc() { - return GRc(this); - }; - _2.qg = function IRc() { - return GRc(this); - }; - var ERc; - sfb(xEe, "EdgeRouterFactory", 645); - feb(1485, 1, nEe, WRc); - _2.rg = function XRc(a) { - return URc(RD(a, 36)); - }; - _2.Kf = function YRc(a, b) { - VRc(RD(a, 36), b); - }; - var LRc, MRc, NRc, ORc, PRc, QRc, RRc, SRc; - sfb(xEe, "OrthogonalEdgeRouter", 1485); - feb(1478, 1, nEe, lSc); - _2.rg = function mSc(a) { - return gSc(RD(a, 36)); - }; - _2.Kf = function nSc(a, b) { - iSc(this, RD(a, 36), b); - }; - var ZRc, $Rc, _Rc, aSc, bSc, cSc; - sfb(xEe, "PolylineEdgeRouter", 1478); - feb(1479, 1, xye, pSc); - _2.Lb = function qSc(a) { - return oSc(RD(a, 10)); - }; - _2.Fb = function rSc(a) { - return this === a; - }; - _2.Mb = function sSc(a) { - return oSc(RD(a, 10)); - }; - sfb(xEe, "PolylineEdgeRouter/1", 1479); - feb(1872, 1, nwe, xSc); - _2.Mb = function ySc(a) { - return RD(a, 132).c == (fTc(), dTc); - }; - sfb(yEe, "HyperEdgeCycleDetector/lambda$0$Type", 1872); - feb(1873, 1, {}, zSc); - _2.Ze = function ASc(a) { - return RD(a, 132).d; - }; - sfb(yEe, "HyperEdgeCycleDetector/lambda$1$Type", 1873); - feb(1874, 1, nwe, BSc); - _2.Mb = function CSc(a) { - return RD(a, 132).c == (fTc(), dTc); - }; - sfb(yEe, "HyperEdgeCycleDetector/lambda$2$Type", 1874); - feb(1875, 1, {}, DSc); - _2.Ze = function ESc(a) { - return RD(a, 132).d; - }; - sfb(yEe, "HyperEdgeCycleDetector/lambda$3$Type", 1875); - feb(1876, 1, {}, FSc); - _2.Ze = function GSc(a) { - return RD(a, 132).d; - }; - sfb(yEe, "HyperEdgeCycleDetector/lambda$4$Type", 1876); - feb(1877, 1, {}, HSc); - _2.Ze = function ISc(a) { - return RD(a, 132).d; - }; - sfb(yEe, "HyperEdgeCycleDetector/lambda$5$Type", 1877); - feb(118, 1, { 34: 1, 118: 1 }, USc); - _2.Fd = function VSc(a) { - return KSc(this, RD(a, 118)); - }; - _2.Fb = function WSc(a) { - var b; - if (ZD(a, 118)) { - b = RD(a, 118); - return this.g == b.g; - } - return false; - }; - _2.Hb = function XSc() { - return this.g; - }; - _2.Ib = function ZSc() { - var a, b, c2, d; - a = new dib("{"); - d = new Anb(this.n); - while (d.a < d.c.c.length) { - c2 = RD(ynb(d), 12); - b = X2b(c2.i); - b == null && (b = "n" + $2b(c2.i)); - a.a += "" + b; - d.a < d.c.c.length && (a.a += ",", a); - } - a.a += "}"; - return a.a; - }; - _2.a = 0; - _2.b = 0; - _2.c = NaN; - _2.d = 0; - _2.g = 0; - _2.i = 0; - _2.o = 0; - _2.s = NaN; - sfb(yEe, "HyperEdgeSegment", 118); - feb(132, 1, { 132: 1 }, bTc); - _2.Ib = function cTc() { - return this.a + "->" + this.b + " (" + os(this.c) + ")"; - }; - _2.d = 0; - sfb(yEe, "HyperEdgeSegmentDependency", 132); - feb(528, 22, { 3: 1, 34: 1, 22: 1, 528: 1 }, gTc); - var dTc, eTc; - var b$ = tfb(yEe, "HyperEdgeSegmentDependency/DependencyType", 528, WI, iTc, hTc); - var jTc; - feb(1878, 1, {}, xTc); - sfb(yEe, "HyperEdgeSegmentSplitter", 1878); - feb(1879, 1, {}, ATc); - _2.a = 0; - _2.b = 0; - sfb(yEe, "HyperEdgeSegmentSplitter/AreaRating", 1879); - feb(339, 1, { 339: 1 }, BTc); - _2.a = 0; - _2.b = 0; - _2.c = 0; - sfb(yEe, "HyperEdgeSegmentSplitter/FreeArea", 339); - feb(1880, 1, fye, CTc); - _2.Ne = function DTc(a, b) { - return zTc(RD(a, 118), RD(b, 118)); - }; - _2.Fb = function ETc(a) { - return this === a; - }; - _2.Oe = function FTc() { - return new Frb(this); - }; - sfb(yEe, "HyperEdgeSegmentSplitter/lambda$0$Type", 1880); - feb(1881, 1, Qve, GTc); - _2.Cd = function HTc(a) { - rTc(this.a, this.d, this.c, this.b, RD(a, 118)); - }; - _2.b = 0; - sfb(yEe, "HyperEdgeSegmentSplitter/lambda$1$Type", 1881); - feb(1882, 1, {}, ITc); - _2.Kb = function JTc(a) { - return new SDb(null, new Swb(RD(a, 118).e, 16)); - }; - sfb(yEe, "HyperEdgeSegmentSplitter/lambda$2$Type", 1882); - feb(1883, 1, {}, KTc); - _2.Kb = function LTc(a) { - return new SDb(null, new Swb(RD(a, 118).j, 16)); - }; - sfb(yEe, "HyperEdgeSegmentSplitter/lambda$3$Type", 1883); - feb(1884, 1, {}, MTc); - _2.Ye = function NTc(a) { - return Kfb(UD(a)); - }; - sfb(yEe, "HyperEdgeSegmentSplitter/lambda$4$Type", 1884); - feb(664, 1, {}, TTc); - _2.a = 0; - _2.b = 0; - _2.c = 0; - sfb(yEe, "OrthogonalRoutingGenerator", 664); - feb(1703, 1, {}, XTc); - _2.Kb = function YTc(a) { - return new SDb(null, new Swb(RD(a, 118).e, 16)); - }; - sfb(yEe, "OrthogonalRoutingGenerator/lambda$0$Type", 1703); - feb(1704, 1, {}, ZTc); - _2.Kb = function $Tc(a) { - return new SDb(null, new Swb(RD(a, 118).j, 16)); - }; - sfb(yEe, "OrthogonalRoutingGenerator/lambda$1$Type", 1704); - feb(670, 1, {}); - sfb(zEe, "BaseRoutingDirectionStrategy", 670); - feb(1870, 670, {}, cUc); - _2.yg = function dUc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - if (!!a.r && !a.q) { - return; - } - k = b + a.o * c2; - for (j = new Anb(a.n); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 12); - l = xjd(cD(WC(l3, 1), Nve, 8, 0, [i2.i.n, i2.n, i2.a])).a; - for (h = new Anb(i2.g); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - if (!W0b(g)) { - o2 = g.d; - p = xjd(cD(WC(l3, 1), Nve, 8, 0, [o2.i.n, o2.n, o2.a])).a; - if ($wnd.Math.abs(l - p) > Vze) { - f2 = k; - e = a; - d = new rjd(l, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - m = a.r; - if (m) { - n = Kfb(UD(ju(m.e, 0))); - d = new rjd(n, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - f2 = b + m.o * c2; - e = m; - d = new rjd(n, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - } - d = new rjd(p, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - } - } - } - } - }; - _2.zg = function eUc(a) { - return a.i.n.a + a.n.a + a.a.a; - }; - _2.Ag = function fUc() { - return qpd(), npd; - }; - _2.Bg = function gUc() { - return qpd(), Yod; - }; - sfb(zEe, "NorthToSouthRoutingStrategy", 1870); - feb(1871, 670, {}, hUc); - _2.yg = function iUc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - if (!!a.r && !a.q) { - return; - } - k = b - a.o * c2; - for (j = new Anb(a.n); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 12); - l = xjd(cD(WC(l3, 1), Nve, 8, 0, [i2.i.n, i2.n, i2.a])).a; - for (h = new Anb(i2.g); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - if (!W0b(g)) { - o2 = g.d; - p = xjd(cD(WC(l3, 1), Nve, 8, 0, [o2.i.n, o2.n, o2.a])).a; - if ($wnd.Math.abs(l - p) > Vze) { - f2 = k; - e = a; - d = new rjd(l, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - m = a.r; - if (m) { - n = Kfb(UD(ju(m.e, 0))); - d = new rjd(n, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - f2 = b - m.o * c2; - e = m; - d = new rjd(n, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - } - d = new rjd(p, f2); - Mub(g.a, d); - _Tc(this, g, e, d, false); - } - } - } - } - }; - _2.zg = function jUc(a) { - return a.i.n.a + a.n.a + a.a.a; - }; - _2.Ag = function kUc() { - return qpd(), Yod; - }; - _2.Bg = function lUc() { - return qpd(), npd; - }; - sfb(zEe, "SouthToNorthRoutingStrategy", 1871); - feb(1869, 670, {}, mUc); - _2.yg = function nUc(a, b, c2) { - var d, e, f2, g, h, i2, j, k, l, m, n, o2, p; - if (!!a.r && !a.q) { - return; - } - k = b + a.o * c2; - for (j = new Anb(a.n); j.a < j.c.c.length; ) { - i2 = RD(ynb(j), 12); - l = xjd(cD(WC(l3, 1), Nve, 8, 0, [i2.i.n, i2.n, i2.a])).b; - for (h = new Anb(i2.g); h.a < h.c.c.length; ) { - g = RD(ynb(h), 18); - if (!W0b(g)) { - o2 = g.d; - p = xjd(cD(WC(l3, 1), Nve, 8, 0, [o2.i.n, o2.n, o2.a])).b; - if ($wnd.Math.abs(l - p) > Vze) { - f2 = k; - e = a; - d = new rjd(f2, l); - Mub(g.a, d); - _Tc(this, g, e, d, true); - m = a.r; - if (m) { - n = Kfb(UD(ju(m.e, 0))); - d = new rjd(f2, n); - Mub(g.a, d); - _Tc(this, g, e, d, true); - f2 = b + m.o * c2; - e = m; - d = new rjd(f2, n); - Mub(g.a, d); - _Tc(this, g, e, d, true); - } - d = new rjd(f2, p); - Mub(g.a, d); - _Tc(this, g, e, d, true); - } - } - } - } - }; - _2.zg = function oUc(a) { - return a.i.n.b + a.n.b + a.a.b; - }; - _2.Ag = function pUc() { - return qpd(), Xod; - }; - _2.Bg = function qUc() { - return qpd(), ppd; - }; - sfb(zEe, "WestToEastRoutingStrategy", 1869); - feb(828, 1, {}, wUc); - _2.Ib = function xUc() { - return Fe(this.a); - }; - _2.b = 0; - _2.c = false; - _2.d = false; - _2.f = 0; - sfb(BEe, "NubSpline", 828); - feb(418, 1, { 418: 1 }, AUc, BUc); - sfb(BEe, "NubSpline/PolarCP", 418); - feb(1480, 1, nEe, VUc); - _2.rg = function XUc(a) { - return QUc(RD(a, 36)); - }; - _2.Kf = function YUc(a, b) { - UUc(this, RD(a, 36), b); - }; - var CUc, DUc, EUc, FUc, GUc; - sfb(BEe, "SplineEdgeRouter", 1480); - feb(274, 1, { 274: 1 }, _Uc); - _2.Ib = function aVc() { - return this.a + " ->(" + this.c + ") " + this.b; - }; - _2.c = 0; - sfb(BEe, "SplineEdgeRouter/Dependency", 274); - feb(465, 22, { 3: 1, 34: 1, 22: 1, 465: 1 }, eVc); - var bVc, cVc; - var w$ = tfb(BEe, "SplineEdgeRouter/SideToProcess", 465, WI, gVc, fVc); - var hVc; - feb(1481, 1, nwe, jVc); - _2.Mb = function kVc(a) { - return HUc(), !RD(a, 131).o; - }; - sfb(BEe, "SplineEdgeRouter/lambda$0$Type", 1481); - feb(1482, 1, {}, lVc); - _2.Ze = function mVc(a) { - return HUc(), RD(a, 131).v + 1; - }; - sfb(BEe, "SplineEdgeRouter/lambda$1$Type", 1482); - feb(1483, 1, Qve, nVc); - _2.Cd = function oVc(a) { - SUc(this.a, this.b, RD(a, 42)); - }; - sfb(BEe, "SplineEdgeRouter/lambda$2$Type", 1483); - feb(1484, 1, Qve, pVc); - _2.Cd = function qVc(a) { - TUc(this.a, this.b, RD(a, 42)); - }; - sfb(BEe, "SplineEdgeRouter/lambda$3$Type", 1484); - feb(131, 1, { 34: 1, 131: 1 }, wVc, xVc); - _2.Fd = function yVc(a) { - return uVc(this, RD(a, 131)); - }; - _2.b = 0; - _2.e = false; - _2.f = 0; - _2.g = 0; - _2.j = false; - _2.k = false; - _2.n = 0; - _2.o = false; - _2.p = false; - _2.q = false; - _2.s = 0; - _2.u = 0; - _2.v = 0; - _2.F = 0; - sfb(BEe, "SplineSegment", 131); - feb(468, 1, { 468: 1 }, zVc); - _2.a = 0; - _2.b = false; - _2.c = false; - _2.d = false; - _2.e = false; - _2.f = 0; - sfb(BEe, "SplineSegment/EdgeInformation", 468); - feb(1198, 1, {}, IVc); - sfb(GEe, Lze, 1198); - feb(1199, 1, fye, KVc); - _2.Ne = function LVc(a, b) { - return JVc(RD(a, 121), RD(b, 121)); - }; - _2.Fb = function MVc(a) { - return this === a; - }; - _2.Oe = function NVc() { - return new Frb(this); - }; - sfb(GEe, Mze, 1199); - feb(1197, 1, {}, TVc); - sfb(GEe, "MrTree", 1197); - feb(405, 22, { 3: 1, 34: 1, 22: 1, 405: 1, 188: 1, 196: 1 }, $Vc); - _2.dg = function aWc() { - return ZVc(this); - }; - _2.qg = function _Vc() { - return ZVc(this); - }; - var UVc, VVc, WVc, XVc; - var H$ = tfb(GEe, "TreeLayoutPhases", 405, WI, cWc, bWc); - var dWc; - feb(1112, 205, oze, fWc); - _2.rf = function gWc(a, b) { - var c2, d, e, f2, g, h, i2, j; - Heb(TD(Gxd(a, (h_c(), S$c)))) || RFb((c2 = new SFb((lud(), new zud(a))), c2)); - g = b.eh(HEe); - g.Ug("build tGraph", 1); - h = (i2 = new YWc(), kQb(i2, a), pQb(i2, (q$c(), h$c), a), j = new Tsb(), QVc(a, i2, j), PVc(a, i2, j), i2); - g.Vg(); - g = b.eh(HEe); - g.Ug("Split graph", 1); - f2 = HVc(this.a, h); - g.Vg(); - for (e = new Anb(f2); e.a < e.c.c.length; ) { - d = RD(ynb(e), 121); - RVc(this.b, d, b.eh(0.5999999940395355 / f2.c.length)); - } - g = b.eh(HEe); - g.Ug("Pack components", 1); - h = GVc(f2); - g.Vg(); - g = b.eh(HEe); - g.Ug("Apply layout results", 1); - OVc(h); - g.Vg(); - }; - sfb(GEe, "TreeLayoutProvider", 1112); - feb(1894, 1, Vve, uWc); - _2.Jc = function vWc(a) { - xgb(this, a); - }; - _2.Kc = function wWc() { - return yob(), Qob(), Pob; - }; - sfb(GEe, "TreeUtil/1", 1894); - feb(1895, 1, Vve, xWc); - _2.Jc = function yWc(a) { - xgb(this, a); - }; - _2.Kc = function zWc() { - return yob(), Qob(), Pob; - }; - sfb(GEe, "TreeUtil/2", 1895); - feb(1885, 1, nwe, AWc); - _2.Mb = function BWc(a) { - return Heb(TD(mQb(RD(a, 40), (q$c(), n$c)))); - }; - sfb(GEe, "TreeUtil/lambda$0$Type", 1885); - feb(1891, 1, nwe, CWc); - _2.Mb = function DWc(a) { - return this.a.Hc(RD(a, 40)); - }; - sfb(GEe, "TreeUtil/lambda$10$Type", 1891); - feb(1892, 1, {}, EWc); - _2.Kb = function FWc(a) { - return nWc(this.a, RD(a, 40)); - }; - sfb(GEe, "TreeUtil/lambda$11$Type", 1892); - feb(1893, 1, nwe, GWc); - _2.Mb = function HWc(a) { - return oWc(this.a, this.b, RD(a, 40)); - }; - sfb(GEe, "TreeUtil/lambda$12$Type", 1893); - feb(1886, 1, nwe, IWc); - _2.Mb = function JWc(a) { - return pWc(this.a, RD(a, 65)); - }; - sfb(GEe, "TreeUtil/lambda$3$Type", 1886); - feb(1887, 1, fye, KWc); - _2.Ne = function LWc(a, b) { - return qWc(RD(a, 65), RD(b, 65)); - }; - _2.Fb = function MWc(a) { - return this === a; - }; - _2.Oe = function NWc() { - return new Frb(this); - }; - sfb(GEe, "TreeUtil/lambda$4$Type", 1887); - feb(1888, 1, nwe, OWc); - _2.Mb = function PWc(a) { - return rWc(this.a, RD(a, 65)); - }; - sfb(GEe, "TreeUtil/lambda$7$Type", 1888); - feb(1889, 1, fye, QWc); - _2.Ne = function RWc(a, b) { - return sWc(RD(a, 65), RD(b, 65)); - }; - _2.Fb = function SWc(a) { - return this === a; - }; - _2.Oe = function TWc() { - return new Frb(this); - }; - sfb(GEe, "TreeUtil/lambda$8$Type", 1889); - feb(1890, 1, {}, UWc); - _2.Kb = function VWc(a) { - return RD(a, 65).b; - }; - sfb(GEe, "TreeUtil/lambda$9$Type", 1890); - feb(508, 137, { 3: 1, 508: 1, 96: 1, 137: 1 }); - _2.g = 0; - sfb(JEe, "TGraphElement", 508); - feb(65, 508, { 3: 1, 65: 1, 508: 1, 96: 1, 137: 1 }, WWc); - _2.Ib = function XWc() { - return !!this.b && !!this.c ? aXc(this.b) + "->" + aXc(this.c) : "e_" + tb(this); - }; - sfb(JEe, "TEdge", 65); - feb(121, 137, { 3: 1, 121: 1, 96: 1, 137: 1 }, YWc); - _2.Ib = function ZWc() { - var a, b, c2, d, e; - e = null; - for (d = Sub(this.b, 0); d.b != d.d.c; ) { - c2 = RD(evb(d), 40); - e += (c2.c == null || c2.c.length == 0 ? "n_" + c2.g : "n_" + c2.c) + "\n"; - } - for (b = Sub(this.a, 0); b.b != b.d.c; ) { - a = RD(evb(b), 65); - e += (!!a.b && !!a.c ? aXc(a.b) + "->" + aXc(a.c) : "e_" + tb(a)) + "\n"; - } - return e; - }; - var W$ = sfb(JEe, "TGraph", 121); - feb(643, 508, { 3: 1, 508: 1, 643: 1, 96: 1, 137: 1 }); - sfb(JEe, "TShape", 643); - feb(40, 643, { 3: 1, 508: 1, 40: 1, 643: 1, 96: 1, 137: 1 }, bXc); - _2.Ib = function cXc() { - return aXc(this); - }; - var Z$ = sfb(JEe, "TNode", 40); - feb(236, 1, Vve, dXc); - _2.Jc = function eXc(a) { - xgb(this, a); - }; - _2.Kc = function fXc() { - var a; - return a = Sub(this.a.d, 0), new gXc(a); - }; - sfb(JEe, "TNode/2", 236); - feb(329, 1, Ave, gXc); - _2.Nb = function hXc(a) { - Ztb(this, a); - }; - _2.Pb = function jXc() { - return RD(evb(this.a), 65).c; - }; - _2.Ob = function iXc() { - return dvb(this.a); - }; - _2.Qb = function kXc() { - gvb(this.a); - }; - sfb(JEe, "TNode/2/1", 329); - feb(1923, 1, QAe, qXc); - _2.Kf = function DXc(a, b) { - oXc(this, RD(a, 121), b); - }; - sfb(LEe, "CompactionProcessor", 1923); - feb(1924, 1, fye, EXc); - _2.Ne = function FXc(a, b) { - return rXc(this.a, RD(a, 40), RD(b, 40)); - }; - _2.Fb = function GXc(a) { - return this === a; - }; - _2.Oe = function HXc() { - return new Frb(this); - }; - sfb(LEe, "CompactionProcessor/lambda$0$Type", 1924); - feb(1925, 1, nwe, IXc); - _2.Mb = function JXc(a) { - return sXc(this.b, this.a, RD(a, 42)); - }; - _2.a = 0; - _2.b = 0; - sfb(LEe, "CompactionProcessor/lambda$1$Type", 1925); - feb(1934, 1, fye, KXc); - _2.Ne = function LXc(a, b) { - return tXc(RD(a, 40), RD(b, 40)); - }; - _2.Fb = function MXc(a) { - return this === a; - }; - _2.Oe = function NXc() { - return new Frb(this); - }; - sfb(LEe, "CompactionProcessor/lambda$10$Type", 1934); - feb(1935, 1, fye, OXc); - _2.Ne = function PXc(a, b) { - return uXc(RD(a, 40), RD(b, 40)); - }; - _2.Fb = function QXc(a) { - return this === a; - }; - _2.Oe = function RXc() { - return new Frb(this); - }; - sfb(LEe, "CompactionProcessor/lambda$11$Type", 1935); - feb(1936, 1, fye, SXc); - _2.Ne = function TXc(a, b) { - return vXc(RD(a, 40), RD(b, 40)); - }; - _2.Fb = function UXc(a) { - return this === a; - }; - _2.Oe = function VXc() { - return new Frb(this); - }; - sfb(LEe, "CompactionProcessor/lambda$12$Type", 1936); - feb(1926, 1, nwe, WXc); - _2.Mb = function XXc(a) { - return wXc(this.a, RD(a, 42)); - }; - _2.a = 0; - sfb(LEe, "CompactionProcessor/lambda$2$Type", 1926); - feb(1927, 1, nwe, YXc); - _2.Mb = function ZXc(a) { - return xXc(this.a, RD(a, 42)); - }; - _2.a = 0; - sfb(LEe, "CompactionProcessor/lambda$3$Type", 1927); - feb(1928, 1, nwe, $Xc); - _2.Mb = function _Xc(a) { - return RD(a, 40).c.indexOf(IEe) == -1; - }; - sfb(LEe, "CompactionProcessor/lambda$4$Type", 1928); - feb(1929, 1, {}, aYc); - _2.Kb = function bYc(a) { - return yXc(this.a, RD(a, 40)); - }; - _2.a = 0; - sfb(LEe, "CompactionProcessor/lambda$5$Type", 1929); - feb(1930, 1, {}, cYc); - _2.Kb = function dYc(a) { - return zXc(this.a, RD(a, 40)); - }; - _2.a = 0; - sfb(LEe, "CompactionProcessor/lambda$6$Type", 1930); - feb(1931, 1, fye, eYc); - _2.Ne = function fYc(a, b) { - return AXc(this.a, RD(a, 240), RD(b, 240)); - }; - _2.Fb = function gYc(a) { - return this === a; - }; - _2.Oe = function hYc() { - return new Frb(this); - }; - sfb(LEe, "CompactionProcessor/lambda$7$Type", 1931); - feb(1932, 1, fye, iYc); - _2.Ne = function jYc(a, b) { - return BXc(this.a, RD(a, 40), RD(b, 40)); - }; - _2.Fb = function kYc(a) { - return this === a; - }; - _2.Oe = function lYc() { - return new Frb(this); - }; - sfb(LEe, "CompactionProcessor/lambda$8$Type", 1932); - feb(1933, 1, fye, mYc); - _2.Ne = function nYc(a, b) { - return CXc(RD(a, 40), RD(b, 40)); - }; - _2.Fb = function oYc(a) { - return this === a; - }; - _2.Oe = function pYc() { - return new Frb(this); - }; - sfb(LEe, "CompactionProcessor/lambda$9$Type", 1933); - feb(1921, 1, QAe, rYc); - _2.Kf = function sYc(a, b) { - qYc(RD(a, 121), b); - }; - sfb(LEe, "DirectionProcessor", 1921); - feb(1913, 1, QAe, vYc); - _2.Kf = function xYc(a, b) { - uYc(this, RD(a, 121), b); - }; - sfb(LEe, "FanProcessor", 1913); - feb(1937, 1, QAe, zYc); - _2.Kf = function CYc(a, b) { - yYc(RD(a, 121), b); - }; - sfb(LEe, "GraphBoundsProcessor", 1937); - feb(1938, 1, {}, DYc); - _2.Ye = function EYc(a) { - return RD(a, 40).e.a; - }; - sfb(LEe, "GraphBoundsProcessor/lambda$0$Type", 1938); - feb(1939, 1, {}, FYc); - _2.Ye = function GYc(a) { - return RD(a, 40).e.b; - }; - sfb(LEe, "GraphBoundsProcessor/lambda$1$Type", 1939); - feb(1940, 1, {}, HYc); - _2.Ye = function IYc(a) { - return AYc(RD(a, 40)); - }; - sfb(LEe, "GraphBoundsProcessor/lambda$2$Type", 1940); - feb(1941, 1, {}, JYc); - _2.Ye = function KYc(a) { - return BYc(RD(a, 40)); - }; - sfb(LEe, "GraphBoundsProcessor/lambda$3$Type", 1941); - feb(262, 22, { 3: 1, 34: 1, 22: 1, 262: 1, 196: 1 }, XYc); - _2.dg = function YYc() { - switch (this.g) { - case 0: - return new DZc(); - case 1: - return new vYc(); - case 2: - return new nZc(); - case 3: - return new tZc(); - case 4: - return new gZc(); - case 8: - return new cZc(); - case 5: - return new rYc(); - case 6: - return new AZc(); - case 7: - return new qXc(); - case 9: - return new zYc(); - case 10: - return new GZc(); - default: - throw Adb(new agb(lBe + (this.f != null ? this.f : "" + this.g))); - } - }; - var LYc, MYc, NYc, OYc, PYc, QYc, RYc, SYc, TYc, UYc, VYc; - var u_ = tfb(LEe, mBe, 262, WI, $Yc, ZYc); - var _Yc; - feb(1920, 1, QAe, cZc); - _2.Kf = function dZc(a, b) { - bZc(RD(a, 121), b); - }; - sfb(LEe, "LevelCoordinatesProcessor", 1920); - feb(1918, 1, QAe, gZc); - _2.Kf = function hZc(a, b) { - eZc(this, RD(a, 121), b); - }; - _2.a = 0; - sfb(LEe, "LevelHeightProcessor", 1918); - feb(1919, 1, Vve, iZc); - _2.Jc = function jZc(a) { - xgb(this, a); - }; - _2.Kc = function kZc() { - return yob(), Qob(), Pob; - }; - sfb(LEe, "LevelHeightProcessor/1", 1919); - feb(1914, 1, QAe, nZc); - _2.Kf = function oZc(a, b) { - lZc(this, RD(a, 121), b); - }; - sfb(LEe, "LevelProcessor", 1914); - feb(1915, 1, nwe, pZc); - _2.Mb = function qZc(a) { - return Heb(TD(mQb(RD(a, 40), (q$c(), n$c)))); - }; - sfb(LEe, "LevelProcessor/lambda$0$Type", 1915); - feb(1916, 1, QAe, tZc); - _2.Kf = function uZc(a, b) { - rZc(this, RD(a, 121), b); - }; - _2.a = 0; - sfb(LEe, "NeighborsProcessor", 1916); - feb(1917, 1, Vve, vZc); - _2.Jc = function wZc(a) { - xgb(this, a); - }; - _2.Kc = function xZc() { - return yob(), Qob(), Pob; - }; - sfb(LEe, "NeighborsProcessor/1", 1917); - feb(1922, 1, QAe, AZc); - _2.Kf = function BZc(a, b) { - yZc(this, RD(a, 121), b); - }; - _2.a = 0; - sfb(LEe, "NodePositionProcessor", 1922); - feb(1912, 1, QAe, DZc); - _2.Kf = function EZc(a, b) { - CZc(this, RD(a, 121), b); - }; - sfb(LEe, "RootProcessor", 1912); - feb(1942, 1, QAe, GZc); - _2.Kf = function HZc(a, b) { - FZc(RD(a, 121), b); - }; - sfb(LEe, "Untreeifyer", 1942); - feb(392, 22, { 3: 1, 34: 1, 22: 1, 392: 1 }, MZc); - var IZc, JZc, KZc; - var F_ = tfb(PEe, "EdgeRoutingMode", 392, WI, OZc, NZc); - var PZc; - var RZc, SZc, TZc, UZc, VZc, WZc, XZc, YZc, ZZc, $Zc, _Zc, a$c, b$c, c$c, d$c, e$c, f$c, g$c, h$c, i$c, j$c, k$c, l$c, m$c, n$c, o$c, p$c; - feb(862, 1, Eye, C$c); - _2.hf = function D$c(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), REe), ""), YEe), "Turns on Tree compaction which decreases the size of the whole tree by placing nodes of multiple levels in one large level"), (Geb(), false)), (kid(), cid)), QI), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), SEe), ""), "Edge End Texture Length"), "Should be set to the length of the texture at the end of an edge. This value can be used to improve the Edge Routing."), 7), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), TEe), ""), "Tree Level"), "The index for the tree level the node is in"), sgb(0)), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), UEe), ""), YEe), "When set to a positive number this option will force the algorithm to place the node to the specified position within the trees layer if weighting is set to constraint"), sgb(-1)), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), VEe), ""), "Weighting of Nodes"), "Which weighting to use when computing a node order."), A$c), eid), J_), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), WEe), ""), "Edge Routing Mode"), "Chooses an Edge Routing algorithm."), u$c), eid), F_), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), XEe), ""), "Search Order"), "Which search order to use when computing a spanning tree."), x$c), eid), K_), xsb(Whd)))); - i_c((new j_c(), a)); - }; - var r$c, s$c, t$c, u$c, v$c, w$c, x$c, y$c, z$c, A$c; - sfb(PEe, "MrTreeMetaDataProvider", 862); - feb(1006, 1, Eye, j_c); - _2.hf = function k_c(a) { - i_c(a); - }; - var E$c, F$c, G$c, H$c, I$c, J$c, K$c, L$c, M$c, N$c, O$c, P$c, Q$c, R$c, S$c, T$c, U$c, V$c, W$c, X$c, Y$c, Z$c, $$c, _$c, a_c, b_c, c_c, d_c, e_c, f_c, g_c; - sfb(PEe, "MrTreeOptions", 1006); - feb(1007, 1, {}, l_c); - _2.sf = function m_c() { - var a; - return a = new fWc(), a; - }; - _2.tf = function n_c(a) { - }; - sfb(PEe, "MrTreeOptions/MrtreeFactory", 1007); - feb(353, 22, { 3: 1, 34: 1, 22: 1, 353: 1 }, t_c); - var o_c, p_c, q_c, r_c; - var J_ = tfb(PEe, "OrderWeighting", 353, WI, v_c, u_c); - var w_c; - feb(433, 22, { 3: 1, 34: 1, 22: 1, 433: 1 }, B_c); - var y_c, z_c; - var K_ = tfb(PEe, "TreeifyingOrder", 433, WI, D_c, C_c); - var E_c; - feb(1486, 1, nEe, N_c); - _2.rg = function O_c(a) { - return RD(a, 121), G_c; - }; - _2.Kf = function P_c(a, b) { - M_c(this, RD(a, 121), b); - }; - var G_c; - sfb("org.eclipse.elk.alg.mrtree.p1treeify", "DFSTreeifyer", 1486); - feb(1487, 1, nEe, V_c); - _2.rg = function W_c(a) { - return RD(a, 121), Q_c; - }; - _2.Kf = function $_c(a, b) { - U_c(this, RD(a, 121), b); - }; - var Q_c; - sfb(aFe, "NodeOrderer", 1487); - feb(1494, 1, {}, a0c); - _2.td = function b0c(a) { - return __c(a); - }; - sfb(aFe, "NodeOrderer/0methodref$lambda$6$Type", 1494); - feb(1488, 1, nwe, c0c); - _2.Mb = function d0c(a) { - return R_c(), Heb(TD(mQb(RD(a, 40), (q$c(), n$c)))); - }; - sfb(aFe, "NodeOrderer/lambda$0$Type", 1488); - feb(1489, 1, nwe, e0c); - _2.Mb = function f0c(a) { - return R_c(), RD(mQb(RD(a, 40), (h_c(), W$c)), 17).a < 0; - }; - sfb(aFe, "NodeOrderer/lambda$1$Type", 1489); - feb(1490, 1, nwe, g0c); - _2.Mb = function h0c(a) { - return X_c(this.a, RD(a, 40)); - }; - sfb(aFe, "NodeOrderer/lambda$2$Type", 1490); - feb(1491, 1, nwe, i0c); - _2.Mb = function j0c(a) { - return Y_c(this.a, RD(a, 40)); - }; - sfb(aFe, "NodeOrderer/lambda$3$Type", 1491); - feb(1492, 1, fye, k0c); - _2.Ne = function l0c(a, b) { - return Z_c(RD(a, 40), RD(b, 40)); - }; - _2.Fb = function m0c(a) { - return this === a; - }; - _2.Oe = function n0c() { - return new Frb(this); - }; - sfb(aFe, "NodeOrderer/lambda$4$Type", 1492); - feb(1493, 1, nwe, o0c); - _2.Mb = function p0c(a) { - return R_c(), RD(mQb(RD(a, 40), (q$c(), XZc)), 17).a != 0; - }; - sfb(aFe, "NodeOrderer/lambda$5$Type", 1493); - feb(1495, 1, nEe, x0c); - _2.rg = function y0c(a) { - return RD(a, 121), q0c; - }; - _2.Kf = function z0c(a, b) { - v0c(this, RD(a, 121), b); - }; - _2.b = 0; - var q0c; - sfb("org.eclipse.elk.alg.mrtree.p3place", "NodePlacer", 1495); - feb(1496, 1, nEe, J0c); - _2.rg = function K0c(a) { - return RD(a, 121), A0c; - }; - _2.Kf = function Y0c(a, b) { - I0c(RD(a, 121), b); - }; - var A0c; - var o0 = sfb(bFe, "EdgeRouter", 1496); - feb(1498, 1, fye, Z0c); - _2.Ne = function $0c(a, b) { - return hgb(RD(a, 17).a, RD(b, 17).a); - }; - _2.Fb = function _0c(a) { - return this === a; - }; - _2.Oe = function a1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/0methodref$compare$Type", 1498); - feb(1503, 1, {}, b1c); - _2.Ye = function c1c(a) { - return Kfb(UD(a)); - }; - sfb(bFe, "EdgeRouter/1methodref$doubleValue$Type", 1503); - feb(1505, 1, fye, d1c); - _2.Ne = function e1c(a, b) { - return Qfb(Kfb(UD(a)), Kfb(UD(b))); - }; - _2.Fb = function f1c(a) { - return this === a; - }; - _2.Oe = function g1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/2methodref$compare$Type", 1505); - feb(1507, 1, fye, h1c); - _2.Ne = function i1c(a, b) { - return Qfb(Kfb(UD(a)), Kfb(UD(b))); - }; - _2.Fb = function j1c(a) { - return this === a; - }; - _2.Oe = function k1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/3methodref$compare$Type", 1507); - feb(1509, 1, {}, l1c); - _2.Ye = function m1c(a) { - return Kfb(UD(a)); - }; - sfb(bFe, "EdgeRouter/4methodref$doubleValue$Type", 1509); - feb(1511, 1, fye, n1c); - _2.Ne = function o1c(a, b) { - return Qfb(Kfb(UD(a)), Kfb(UD(b))); - }; - _2.Fb = function p1c(a) { - return this === a; - }; - _2.Oe = function q1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/5methodref$compare$Type", 1511); - feb(1513, 1, fye, r1c); - _2.Ne = function s1c(a, b) { - return Qfb(Kfb(UD(a)), Kfb(UD(b))); - }; - _2.Fb = function t1c(a) { - return this === a; - }; - _2.Oe = function u1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/6methodref$compare$Type", 1513); - feb(1497, 1, {}, v1c); - _2.Kb = function w1c(a) { - return B0c(), RD(mQb(RD(a, 40), (h_c(), f_c)), 17); - }; - sfb(bFe, "EdgeRouter/lambda$0$Type", 1497); - feb(1508, 1, {}, x1c); - _2.Kb = function y1c(a) { - return L0c(RD(a, 40)); - }; - sfb(bFe, "EdgeRouter/lambda$11$Type", 1508); - feb(1510, 1, {}, z1c); - _2.Kb = function A1c(a) { - return M0c(this.b, this.a, RD(a, 40)); - }; - _2.a = 0; - _2.b = 0; - sfb(bFe, "EdgeRouter/lambda$13$Type", 1510); - feb(1512, 1, {}, B1c); - _2.Kb = function C1c(a) { - return N0c(this.b, this.a, RD(a, 40)); - }; - _2.a = 0; - _2.b = 0; - sfb(bFe, "EdgeRouter/lambda$15$Type", 1512); - feb(1514, 1, fye, D1c); - _2.Ne = function E1c(a, b) { - return O0c(RD(a, 65), RD(b, 65)); - }; - _2.Fb = function F1c(a) { - return this === a; - }; - _2.Oe = function G1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/lambda$17$Type", 1514); - feb(1515, 1, fye, H1c); - _2.Ne = function I1c(a, b) { - return P0c(RD(a, 65), RD(b, 65)); - }; - _2.Fb = function J1c(a) { - return this === a; - }; - _2.Oe = function K1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/lambda$18$Type", 1515); - feb(1516, 1, fye, L1c); - _2.Ne = function M1c(a, b) { - return Q0c(RD(a, 65), RD(b, 65)); - }; - _2.Fb = function N1c(a) { - return this === a; - }; - _2.Oe = function O1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/lambda$19$Type", 1516); - feb(1499, 1, nwe, P1c); - _2.Mb = function Q1c(a) { - return R0c(this.a, RD(a, 40)); - }; - _2.a = 0; - sfb(bFe, "EdgeRouter/lambda$2$Type", 1499); - feb(1517, 1, fye, R1c); - _2.Ne = function S1c(a, b) { - return S0c(RD(a, 65), RD(b, 65)); - }; - _2.Fb = function T1c(a) { - return this === a; - }; - _2.Oe = function U1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/lambda$20$Type", 1517); - feb(1500, 1, fye, V1c); - _2.Ne = function W1c(a, b) { - return T0c(RD(a, 40), RD(b, 40)); - }; - _2.Fb = function X1c(a) { - return this === a; - }; - _2.Oe = function Y1c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/lambda$3$Type", 1500); - feb(1501, 1, fye, Z1c); - _2.Ne = function $1c(a, b) { - return U0c(RD(a, 40), RD(b, 40)); - }; - _2.Fb = function _1c(a) { - return this === a; - }; - _2.Oe = function a2c() { - return new Frb(this); - }; - sfb(bFe, "EdgeRouter/lambda$4$Type", 1501); - feb(1502, 1, {}, b2c); - _2.Kb = function c2c(a) { - return V0c(RD(a, 40)); - }; - sfb(bFe, "EdgeRouter/lambda$5$Type", 1502); - feb(1504, 1, {}, d2c); - _2.Kb = function e2c(a) { - return W0c(this.b, this.a, RD(a, 40)); - }; - _2.a = 0; - _2.b = 0; - sfb(bFe, "EdgeRouter/lambda$7$Type", 1504); - feb(1506, 1, {}, f2c); - _2.Kb = function g2c(a) { - return X0c(this.b, this.a, RD(a, 40)); - }; - _2.a = 0; - _2.b = 0; - sfb(bFe, "EdgeRouter/lambda$9$Type", 1506); - feb(675, 1, { 675: 1 }, i2c); - _2.e = 0; - _2.f = false; - _2.g = false; - sfb(bFe, "MultiLevelEdgeNodeNodeGap", 675); - feb(1943, 1, fye, l2c); - _2.Ne = function m2c(a, b) { - return j2c(RD(a, 240), RD(b, 240)); - }; - _2.Fb = function n2c(a) { - return this === a; - }; - _2.Oe = function o2c() { - return new Frb(this); - }; - sfb(bFe, "MultiLevelEdgeNodeNodeGap/lambda$0$Type", 1943); - feb(1944, 1, fye, p2c); - _2.Ne = function q2c(a, b) { - return k2c(RD(a, 240), RD(b, 240)); - }; - _2.Fb = function r2c(a) { - return this === a; - }; - _2.Oe = function s2c() { - return new Frb(this); - }; - sfb(bFe, "MultiLevelEdgeNodeNodeGap/lambda$1$Type", 1944); - var t2c; - feb(501, 22, { 3: 1, 34: 1, 22: 1, 501: 1, 188: 1, 196: 1 }, z2c); - _2.dg = function B2c() { - return y2c(this); - }; - _2.qg = function A2c() { - return y2c(this); - }; - var v2c, w2c; - var s0 = tfb(cFe, "RadialLayoutPhases", 501, WI, D2c, C2c); - var E2c; - feb(1113, 205, oze, H2c); - _2.rf = function I2c(a, b) { - var c2, d, e, f2, g, h; - c2 = G2c(this, a); - b.Ug("Radial layout", c2.c.length); - Heb(TD(Gxd(a, ($4c(), N4c)))) || RFb((d = new SFb((lud(), new zud(a))), d)); - h = K2c(a); - Ixd(a, (u2c(), t2c), h); - if (!h) { - throw Adb(new agb("The given graph is not a tree!")); - } - e = Kfb(UD(Gxd(a, S4c))); - e == 0 && (e = J2c(a)); - Ixd(a, S4c, e); - for (g = new Anb(G2c(this, a)); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 47); - f2.Kf(a, b.eh(1)); - } - b.Vg(); - }; - sfb(cFe, "RadialLayoutProvider", 1113); - feb(556, 1, fye, T2c); - _2.Ne = function U2c(a, b) { - return S2c(this.a, this.b, RD(a, 27), RD(b, 27)); - }; - _2.Fb = function V2c(a) { - return this === a; - }; - _2.Oe = function W2c() { - return new Frb(this); - }; - _2.a = 0; - _2.b = 0; - sfb(cFe, "RadialUtil/lambda$0$Type", 556); - feb(1395, 1, QAe, Y2c); - _2.Kf = function Z2c(a, b) { - X2c(RD(a, 27), b); - }; - sfb(hFe, "CalculateGraphSize", 1395); - feb(1396, 1, QAe, _2c); - _2.Kf = function a3c(a, b) { - $2c(RD(a, 27)); - }; - sfb(hFe, "EdgeAngleCalculator", 1396); - feb(368, 22, { 3: 1, 34: 1, 22: 1, 368: 1, 196: 1 }, h3c); - _2.dg = function i3c() { - switch (this.g) { - case 0: - return new Q3c(); - case 1: - return new A3c(); - case 2: - return new U3c(); - case 3: - return new Y2c(); - case 4: - return new _2c(); - default: - throw Adb(new agb(lBe + (this.f != null ? this.f : "" + this.g))); - } - }; - var b3c, c3c, d3c, e3c, f3c; - var x0 = tfb(hFe, mBe, 368, WI, k3c, j3c); - var l3c; - feb(653, 1, {}); - _2.e = 1; - _2.g = 0; - sfb(jFe, "AbstractRadiusExtensionCompaction", 653); - feb(1834, 653, {}, x3c); - _2.Cg = function y3c(a) { - var b, c2, d, e, f2, g, h, i2, j; - this.c = RD(Gxd(a, (u2c(), t2c)), 27); - r3c(this, this.c); - this.d = u5c(RD(Gxd(a, ($4c(), X4c)), 300)); - i2 = RD(Gxd(a, H4c), 17); - !!i2 && q3c(this, i2.a); - h = UD(Gxd(a, (umd(), fmd))); - s3c(this, (uFb(h), h)); - j = Q2c(this.c); - !!this.d && this.d.Gg(j); - t3c(this, j); - g = new mob(cD(WC(J4, 1), kFe, 27, 0, [this.c])); - for (c2 = 0; c2 < 2; c2++) { - for (b = 0; b < j.c.length; b++) { - e = new mob(cD(WC(J4, 1), kFe, 27, 0, [(tFb(b, j.c.length), RD(j.c[b], 27))])); - f2 = b < j.c.length - 1 ? (tFb(b + 1, j.c.length), RD(j.c[b + 1], 27)) : (tFb(0, j.c.length), RD(j.c[0], 27)); - d = b == 0 ? RD(Vmb(j, j.c.length - 1), 27) : (tFb(b - 1, j.c.length), RD(j.c[b - 1], 27)); - v3c(this, (tFb(b, j.c.length), RD(j.c[b], 27), g), d, f2, e); - } - } - }; - sfb(jFe, "AnnulusWedgeCompaction", 1834); - feb(1393, 1, QAe, A3c); - _2.Kf = function B3c(a, b) { - z3c(RD(a, 27), b); - }; - sfb(jFe, "GeneralCompactor", 1393); - feb(1833, 653, {}, F3c); - _2.Cg = function G3c(a) { - var b, c2, d, e; - c2 = RD(Gxd(a, (u2c(), t2c)), 27); - this.f = c2; - this.b = u5c(RD(Gxd(a, ($4c(), X4c)), 300)); - e = RD(Gxd(a, H4c), 17); - !!e && q3c(this, e.a); - d = UD(Gxd(a, (umd(), fmd))); - s3c(this, (uFb(d), d)); - b = Q2c(c2); - !!this.b && this.b.Gg(b); - D3c(this, b); - }; - _2.a = 0; - sfb(jFe, "RadialCompaction", 1833); - feb(1842, 1, {}, I3c); - _2.Dg = function J3c(a) { - var b, c2, d, e, f2, g; - this.a = a; - b = 0; - g = Q2c(a); - d = 0; - for (f2 = new Anb(g); f2.a < f2.c.c.length; ) { - e = RD(ynb(f2), 27); - ++d; - for (c2 = d; c2 < g.c.length; c2++) { - H3c(this, e, (tFb(c2, g.c.length), RD(g.c[c2], 27))) && (b += 1); - } - } - return b; - }; - sfb(lFe, "CrossingMinimizationPosition", 1842); - feb(1840, 1, {}, K3c); - _2.Dg = function L3c(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n; - d = 0; - for (c2 = new is(Mr(zGd(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 74); - h = AGd(RD(QHd((!b.c && (b.c = new Yie(E4, b, 5, 8)), b.c), 0), 84)); - j = h.i + h.g / 2; - k = h.j + h.f / 2; - e = a.i + a.g / 2; - f2 = a.j + a.f / 2; - l = new pjd(); - l.a = j - e; - l.b = k - f2; - g = new rjd(l.a, l.b); - wid(g, a.g, a.f); - l.a -= g.a; - l.b -= g.b; - e = j - l.a; - f2 = k - l.b; - i2 = new rjd(l.a, l.b); - wid(i2, h.g, h.f); - l.a -= i2.a; - l.b -= i2.b; - j = e + l.a; - k = f2 + l.b; - m = j - e; - n = k - f2; - d += $wnd.Math.sqrt(m * m + n * n); - } - return d; - }; - sfb(lFe, "EdgeLengthOptimization", 1840); - feb(1841, 1, {}, M3c); - _2.Dg = function N3c(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - d = 0; - for (c2 = new is(Mr(zGd(a).a.Kc(), new ir())); gs(c2); ) { - b = RD(hs(c2), 74); - h = AGd(RD(QHd((!b.c && (b.c = new Yie(E4, b, 5, 8)), b.c), 0), 84)); - i2 = h.i + h.g / 2; - j = h.j + h.f / 2; - e = RD(Gxd(h, (umd(), Qld)), 8); - f2 = a.i + e.a + a.g / 2; - g = a.j + e.b + a.f; - k = i2 - f2; - l = j - g; - d += $wnd.Math.sqrt(k * k + l * l); - } - return d; - }; - sfb(lFe, "EdgeLengthPositionOptimization", 1841); - feb(1392, 653, QAe, Q3c); - _2.Kf = function R3c(a, b) { - P3c(this, RD(a, 27), b); - }; - sfb("org.eclipse.elk.alg.radial.intermediate.overlaps", "RadiusExtensionOverlapRemoval", 1392); - feb(1394, 1, QAe, U3c); - _2.Kf = function V3c(a, b) { - T3c(RD(a, 27), b); - }; - sfb("org.eclipse.elk.alg.radial.intermediate.rotation", "GeneralRotator", 1394); - feb(434, 22, { 3: 1, 34: 1, 22: 1, 434: 1 }, $3c); - var W3c, X3c; - var H0 = tfb(nFe, "AnnulusWedgeCriteria", 434, WI, a4c, _3c); - var b4c; - feb(393, 22, { 3: 1, 34: 1, 22: 1, 393: 1 }, i4c); - var d4c, e4c, f4c; - var I0 = tfb(nFe, uze, 393, WI, k4c, j4c); - var l4c; - feb(863, 1, Eye, E4c); - _2.hf = function F4c(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), oFe), ""), "Center On Root"), "Centers the layout on the root of the tree i.e. so that the central node is also the center node of the final layout. This introduces additional whitespace."), (Geb(), false)), (kid(), cid)), QI), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), pFe), ""), "Order ID"), "The id can be used to define an order for nodes of one radius. This can be used to sort them in the layer accordingly."), sgb(0)), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), qFe), ""), "Radius"), "The radius option can be used to set the initial radius for the radial layouter."), 0), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), rFe), ""), "Rotate"), "The rotate option determines whether a rotation of the layout should be performed."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), sFe), ""), AFe), "With the compacter option it can be determined how compaction on the graph is done. It can be chosen between none, the radial compaction or the compaction of wedges separately."), q4c), eid), I0), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), tFe), ""), "Compaction Step Size"), "Determine the size of steps with which the compaction is done. Step size 1 correlates to a compaction of 1 pixel per Iteration."), sgb(1)), gid), bJ), xsb(Whd)))); - zgd(a, tFe, sFe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), uFe), ""), "Sorter"), "Sort the nodes per radius according to the sorting algorithm. The strategies are none, by the given order id, or sorting them by polar coordinates."), A4c), eid), N0), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), vFe), ""), "Annulus Wedge Criteria"), "Determine how the wedge for the node placement is calculated. It can be chosen between wedge determination by the number of leaves or by the maximum sum of diagonals."), C4c), eid), H0), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), wFe), ""), "Translation Optimization"), "Find the optimal translation of the nodes of the first radii according to this criteria. For example edge crossings can be minimized."), s4c), eid), M0), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), xFe), BFe), "Target Angle"), "The angle in radians that the layout should be rotated to after layout."), 0), did), VI), xsb(Whd)))); - zgd(a, xFe, rFe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), yFe), BFe), "Additional Wedge Space"), "If set to true, modifies the target angle by rotating further such that space is left for an edge to pass in between the nodes. This option should only be used in conjunction with top-down layout."), false), cid), QI), xsb(Whd)))); - zgd(a, yFe, rFe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), zFe), BFe), "Outgoing Edge Angles"), "Calculate the required angle of connected nodes to leave space for an incoming edge. This option should only be used in conjunction with top-down layout."), false), cid), QI), xsb(Whd)))); - _4c((new a5c(), a)); - }; - var n4c, o4c, p4c, q4c, r4c, s4c, t4c, u4c, v4c, w4c, x4c, y4c, z4c, A4c, B4c, C4c; - sfb(nFe, "RadialMetaDataProvider", 863); - feb(1008, 1, Eye, a5c); - _2.hf = function b5c(a) { - _4c(a); - }; - var G4c, H4c, I4c, J4c, K4c, L4c, M4c, N4c, O4c, P4c, Q4c, R4c, S4c, T4c, U4c, V4c, W4c, X4c, Y4c, Z4c; - sfb(nFe, "RadialOptions", 1008); - feb(1009, 1, {}, c5c); - _2.sf = function d5c() { - var a; - return a = new H2c(), a; - }; - _2.tf = function e5c(a) { - }; - sfb(nFe, "RadialOptions/RadialFactory", 1009); - feb(354, 22, { 3: 1, 34: 1, 22: 1, 354: 1 }, l5c); - var f5c, g5c, h5c, i5c; - var M0 = tfb(nFe, "RadialTranslationStrategy", 354, WI, n5c, m5c); - var o5c; - feb(300, 22, { 3: 1, 34: 1, 22: 1, 300: 1 }, v5c); - var q5c, r5c, s5c; - var N0 = tfb(nFe, "SortingStrategy", 300, WI, x5c, w5c); - var y5c; - feb(1476, 1, nEe, D5c); - _2.rg = function E5c(a) { - return RD(a, 27), null; - }; - _2.Kf = function F5c(a, b) { - B5c(this, RD(a, 27), b); - }; - _2.c = 0; - sfb("org.eclipse.elk.alg.radial.p1position", "EadesRadial", 1476); - feb(1838, 1, {}, G5c); - _2.Eg = function H5c(a) { - return O2c(a); - }; - sfb(DFe, "AnnulusWedgeByLeafs", 1838); - feb(1839, 1, {}, J5c); - _2.Eg = function K5c(a) { - return I5c(this, a); - }; - sfb(DFe, "AnnulusWedgeByNodeSpace", 1839); - feb(1477, 1, nEe, N5c); - _2.rg = function O5c(a) { - return RD(a, 27), null; - }; - _2.Kf = function P5c(a, b) { - L5c(this, RD(a, 27), b); - }; - sfb("org.eclipse.elk.alg.radial.p2routing", "StraightLineEdgeRouter", 1477); - feb(826, 1, {}, R5c); - _2.Fg = function S5c(a) { - }; - _2.Gg = function U5c(a) { - Q5c(this, a); - }; - sfb(EFe, "IDSorter", 826); - feb(1837, 1, fye, V5c); - _2.Ne = function W5c(a, b) { - return T5c(RD(a, 27), RD(b, 27)); - }; - _2.Fb = function X5c(a) { - return this === a; - }; - _2.Oe = function Y5c() { - return new Frb(this); - }; - sfb(EFe, "IDSorter/lambda$0$Type", 1837); - feb(1836, 1, {}, _5c); - _2.Fg = function a6c(a) { - Z5c(this, a); - }; - _2.Gg = function b6c(a) { - var b; - if (!a.dc()) { - if (!this.e) { - b = L2c(RD(a.Xb(0), 27)); - Z5c(this, b); - } - Q5c(this.e, a); - } - }; - sfb(EFe, "PolarCoordinateSorter", 1836); - feb(445, 22, { 3: 1, 34: 1, 22: 1, 445: 1 }, g6c); - var c6c, d6c, e6c; - var V0 = tfb(IFe, "RectPackingLayoutPhases", 445, WI, i6c, h6c); - var j6c; - feb(1118, 205, oze, l6c); - _2.rf = function n6c(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, B, C, D5; - b.Ug("Rectangle Packing", 1); - l = RD(Gxd(a, (X7c(), N7c)), 107); - i2 = Heb(TD(Gxd(a, G7c))); - k = Kfb(UD(Gxd(a, Q7c))); - C = Heb(TD(Gxd(a, R7c))); - t = (!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a); - Heb(TD(Gxd(a, J7c))) || RFb((e = new SFb((lud(), new zud(a))), e)); - B = false; - if (C && t.i >= 3) { - v = RD(QHd(t, 0), 27); - w2 = RD(QHd(t, 1), 27); - f2 = 0; - while (f2 + 2 < t.i) { - u = v; - v = w2; - w2 = RD(QHd(t, f2 + 2), 27); - if (u.f >= v.f + w2.f + k || w2.f >= u.f + v.f + k) { - B = true; - break; - } else { - ++f2; - } - } - } else { - B = true; - } - if (!B) { - m = t.i; - for (h = new dMd(t); h.e != h.i.gc(); ) { - g = RD(bMd(h), 27); - Ixd(g, (umd(), Rld), sgb(m)); - --m; - } - crd(a, new Oqd()); - b.Vg(); - return; - } - c2 = (Sed(this.a), Ved(this.a, (f6c(), c6c), RD(Gxd(a, V7c), 188)), Ved(this.a, d6c, RD(Gxd(a, M7c), 188)), Ved(this.a, e6c, RD(Gxd(a, S7c), 188)), Ped(this.a, (D5 = new ufd(), pfd(D5, c6c, (z6c(), y6c)), pfd(D5, d6c, x6c), Heb(TD(Gxd(a, B7c))) && pfd(D5, c6c, w6c), D5)), Qed(this.a, a)); - j = 1 / c2.c.length; - for (o2 = new Anb(c2); o2.a < o2.c.c.length; ) { - n = RD(ynb(o2), 47); - if (b.$g()) { - return; - } - n.Kf(a, b.eh(j)); - } - q = 0; - p = 0; - for (s = new dMd(t); s.e != s.i.gc(); ) { - r = RD(bMd(s), 27); - q = $wnd.Math.max(q, r.i + r.g); - p = $wnd.Math.max(p, r.j + r.f); - } - Jsd(a, new rjd(Kfb(UD(Gxd(a, (X6c(), O6c)))), Kfb(UD(Gxd(a, N6c)))), new rjd(q, p)); - m6c(t, l); - i2 || Esd(a, Kfb(UD(Gxd(a, O6c))) + (l.b + l.c), Kfb(UD(Gxd(a, N6c))) + (l.d + l.a), false, true); - Heb(TD(Gxd(a, J7c))) || RFb((d = new SFb((lud(), new zud(a))), d)); - b.Vg(); - }; - sfb(IFe, "RectPackingLayoutProvider", 1118); - feb(1518, 1, QAe, p6c); - _2.Kf = function r6c(a, b) { - o6c(RD(a, 27), b); - }; - sfb(JFe, "InteractiveNodeReorderer", 1518); - feb(1519, 1, fye, s6c); - _2.Ne = function t6c(a, b) { - return q6c(RD(a, 27), RD(b, 27)); - }; - _2.Fb = function u6c(a) { - return this === a; - }; - _2.Oe = function v6c() { - return new Frb(this); - }; - sfb(JFe, "InteractiveNodeReorderer/lambda$0$Type", 1519); - feb(456, 22, { 3: 1, 34: 1, 22: 1, 456: 1, 196: 1 }, A6c); - _2.dg = function B6c() { - switch (this.g) { - case 0: - return new p6c(); - case 1: - return new K6c(); - case 2: - return new H6c(); - } - return null; - }; - var w6c, x6c, y6c; - var Z0 = tfb(JFe, mBe, 456, WI, D6c, C6c); - var E6c; - feb(1521, 1, QAe, H6c); - _2.Kf = function I6c(a, b) { - G6c(RD(a, 27), b); - }; - sfb(JFe, "MinSizePostProcessor", 1521); - feb(1520, 1, QAe, K6c); - _2.Kf = function L6c(a, b) { - J6c(RD(a, 27), b); - }; - sfb(JFe, "MinSizePreProcessor", 1520); - var M6c, N6c, O6c, P6c, Q6c, R6c, S6c, T6c, U6c, V6c, W6c; - feb(394, 22, { 3: 1, 34: 1, 22: 1, 394: 1 }, a7c); - var Y6c, Z6c, $6c; - var a1 = tfb(KFe, "OptimizationGoal", 394, WI, c7c, b7c); - var d7c; - feb(867, 1, Eye, v7c); - _2.hf = function w7c(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), LFe), ""), "Try box layout first"), "Whether one should check whether the regions are stackable to see whether box layout would do the job. For example, nodes with the same height are not stackable inside a row. Therefore, box layout will perform better and faster."), (Geb(), false)), (kid(), cid)), QI), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), MFe), ""), "Current position of a node in the order of nodes"), "The rectangles are ordered. Normally according to their definition the the model. This option specifies the current position of a node."), sgb(-1)), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), NFe), ""), "Desired index of node"), "The rectangles are ordered. Normally according to their definition the the model. This option allows to specify a desired position that has preference over the original position."), sgb(-1)), gid), bJ), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), OFe), ""), "In new Row"), "If set to true this node begins in a new row. Consequently this node cannot be moved in a previous layer during compaction. Width approximation does does not take this into account."), false), cid), QI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), PFe), XFe), "Width Approximation Strategy"), "Strategy for finding an initial width of the drawing."), s7c), eid), l1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), QFe), XFe), "Target Width"), "Option to place the rectangles in the given target width instead of approximating the width using the desired aspect ratio. The padding is not included in this. Meaning a drawing will have width of targetwidth + horizontal padding."), -1), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), RFe), XFe), "Optimization Goal"), "Optimization goal for approximation of the bounding box given by the first iteration. Determines whether layout is sorted by the maximum scaling, aspect ratio, or area. Depending on the strategy the aspect ratio might be nearly ignored."), q7c), eid), a1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), SFe), XFe), "Shift Last Placed."), "When placing a rectangle behind or below the last placed rectangle in the first iteration, it is sometimes possible to shift the rectangle further to the left or right, resulting in less whitespace. True (default) enables the shift and false disables it. Disabling the shift produces a greater approximated area by the first iteration and a layout, when using ONLY the first iteration (default not the case), where it is sometimes impossible to implement a size transformation of rectangles that will fill the bounding box and eliminate empty spaces."), true), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), TFe), "packing"), YFe), "Strategy for finding an initial placement on nodes."), l7c), eid), o1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), UFe), ZFe), "Row Height Reevaluation"), "During the compaction step the height of a row is normally not changed. If this options is set, the blocks of other rows might be added if they exceed the row height. If this is the case the whole row has to be packed again to be optimal regarding the new row height. This option should, therefore, be used with care since it might be computation heavy."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), VFe), ZFe), "Compaction iterations"), "Defines the number of compaction iterations. E.g. if set to 2 the width is initially approximated, then the drawing is compacted and based on the resulting drawing the target width is decreased or increased and a second compaction step is executed and the result compared to the first one. The best run is used based on the scale measure."), sgb(1)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), WFe), "whiteSpaceElimination"), "White Space Approximation Strategy"), "Strategy for expanding nodes such that whitespace in the parent is eliminated."), eid), t12), xsb(Whd)))); - Y7c((new Z7c(), a)); - }; - var f7c, g7c, h7c, i7c, j7c, k7c, l7c, m7c, n7c, o7c, p7c, q7c, r7c, s7c, t7c; - sfb(KFe, "RectPackingMetaDataProvider", 867); - feb(1016, 1, Eye, Z7c); - _2.hf = function $7c(a) { - Y7c(a); - }; - var x7c, y7c, z7c, A7c, B7c, C7c, D7c, E7c, F7c, G7c, H7c, I7c, J7c, K7c, L7c, M7c, N7c, O7c, P7c, Q7c, R7c, S7c, T7c, U7c, V7c, W7c; - sfb(KFe, "RectPackingOptions", 1016); - feb(1017, 1, {}, _7c); - _2.sf = function a8c() { - var a; - return a = new l6c(), a; - }; - _2.tf = function b8c(a) { - }; - sfb(KFe, "RectPackingOptions/RectpackingFactory", 1017); - feb(1705, 1, {}, g8c); - _2.a = 0; - _2.c = false; - sfb(_Fe, "AreaApproximation", 1705); - var h1 = ufb(_Fe, "BestCandidateFilter"); - feb(673, 1, { 535: 1 }, h8c); - _2.Hg = function i8c(a, b, c2) { - var d, e, f2, g, h, i2; - i2 = new bnb(); - f2 = oxe; - for (h = new Anb(a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 238); - f2 = $wnd.Math.min(f2, (g.c + (c2.b + c2.c)) * (g.b + (c2.d + c2.a))); - } - for (e = new Anb(a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 238); - (d.c + (c2.b + c2.c)) * (d.b + (c2.d + c2.a)) == f2 && (ZEb(i2.c, d), true); - } - return i2; - }; - sfb(_Fe, "AreaFilter", 673); - feb(674, 1, { 535: 1 }, j8c); - _2.Hg = function k8c(a, b, c2) { - var d, e, f2, g, h, i2; - h = new bnb(); - i2 = oxe; - for (g = new Anb(a); g.a < g.c.c.length; ) { - f2 = RD(ynb(g), 238); - i2 = $wnd.Math.min(i2, $wnd.Math.abs((f2.c + (c2.b + c2.c)) / (f2.b + (c2.d + c2.a)) - b)); - } - for (e = new Anb(a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 238); - $wnd.Math.abs((d.c + (c2.b + c2.c)) / (d.b + (c2.d + c2.a)) - b) == i2 && (ZEb(h.c, d), true); - } - return h; - }; - sfb(_Fe, "AspectRatioFilter", 674); - feb(1469, 1, nEe, o8c); - _2.rg = function p8c(a) { - return RD(a, 27), null; - }; - _2.Kf = function q8c(a, b) { - n8c(RD(a, 27), b); - }; - sfb(_Fe, "GreedyWidthApproximator", 1469); - feb(672, 1, { 535: 1 }, r8c); - _2.Hg = function s8c(a, b, c2) { - var d, e, f2, g, h, i2; - i2 = new bnb(); - f2 = pxe; - for (h = new Anb(a); h.a < h.c.c.length; ) { - g = RD(ynb(h), 238); - f2 = $wnd.Math.max(f2, Aad(g.c + (c2.b + c2.c), g.b + (c2.d + c2.a), g.a)); - } - for (e = new Anb(a); e.a < e.c.c.length; ) { - d = RD(ynb(e), 238); - Aad(d.c + (c2.b + c2.c), d.b + (c2.d + c2.a), d.a) == f2 && (ZEb(i2.c, d), true); - } - return i2; - }; - sfb(_Fe, "ScaleMeasureFilter", 672); - feb(1470, 1, nEe, u8c); - _2.rg = function v8c(a) { - return RD(a, 27), null; - }; - _2.Kf = function w8c(a, b) { - t8c(RD(a, 27), b); - }; - sfb(_Fe, "TargetWidthWidthApproximator", 1470); - feb(491, 22, { 3: 1, 34: 1, 22: 1, 491: 1, 188: 1, 196: 1 }, B8c); - _2.dg = function D8c() { - return A8c(this); - }; - _2.qg = function C8c() { - return A8c(this); - }; - var x8c, y8c; - var l1 = tfb(_Fe, "WidthApproximationStrategy", 491, WI, F8c, E8c); - var G8c; - feb(1471, 1, nEe, R8c); - _2.rg = function S8c(a) { - return RD(a, 27), null; - }; - _2.Kf = function T8c(a, b) { - Q8c(this, RD(a, 27), b); - }; - sfb(aGe, "Compactor", 1471); - feb(1473, 1, nEe, X8c); - _2.rg = function Y8c(a) { - return RD(a, 27), null; - }; - _2.Kf = function Z8c(a, b) { - W8c(RD(a, 27), b); - }; - sfb(aGe, "NoPlacement", 1473); - feb(439, 22, { 3: 1, 34: 1, 22: 1, 439: 1, 188: 1, 196: 1 }, d9c); - _2.dg = function f9c() { - return c9c(this); - }; - _2.qg = function e9c() { - return c9c(this); - }; - var $8c, _8c, a9c; - var o1 = tfb(aGe, "PackingStrategy", 439, WI, h9c, g9c); - var i9c; - feb(810, 1, {}, m9c); - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = oxe; - _2.e = 0; - _2.f = oxe; - sfb(aGe, "RowFillingAndCompaction", 810); - feb(1472, 1, nEe, o9c); - _2.rg = function p9c(a) { - return RD(a, 27), null; - }; - _2.Kf = function q9c(a, b) { - n9c(RD(a, 27), b); - }; - sfb(aGe, "SimplePlacement", 1472); - feb(1474, 1, nEe, s9c); - _2.rg = function t9c(a) { - return RD(a, 27), null; - }; - _2.Kf = function u9c(a, b) { - this.Ig(RD(a, 27), b); - }; - _2.Ig = function v9c(a, b) { - r9c(a, b); - }; - sfb(cGe, "EqualWhitespaceEliminator", 1474); - feb(1475, 1474, nEe, x9c); - _2.Ig = function y9c(a, b) { - var c2, d, e, f2, g; - b.Ug("To Aspect Ratio Whitesapce Eliminator", 1); - g = Kfb(UD(Gxd(a, (X6c(), O6c)))); - f2 = Kfb(UD(Gxd(a, N6c))); - e = Kfb(UD(Gxd(a, (X7c(), x7c)))); - c2 = Kfb(UD(Gxd(a, M6c))); - d = g / f2; - if (d < e) { - g = f2 * e; - Ixd(a, O6c, g); - } else { - c2 += g / e - f2; - Ixd(a, M6c, c2); - Ixd(a, N6c, f2 + c2); - } - r9c(a, b); - b.Vg(); - }; - sfb(cGe, "ToAspectratioNodeExpander", 1475); - feb(492, 22, { 3: 1, 34: 1, 22: 1, 492: 1, 188: 1, 196: 1 }, D9c); - _2.dg = function F9c() { - return C9c(this); - }; - _2.qg = function E9c() { - return C9c(this); - }; - var z9c, A9c; - var t12 = tfb(cGe, "WhiteSpaceEliminationStrategy", 492, WI, H9c, G9c); - var I9c; - feb(172, 1, { 172: 1 }, V9c); - _2.a = 0; - _2.c = false; - _2.d = 0; - _2.e = 0; - _2.f = 0; - _2.g = 0; - _2.i = 0; - _2.k = false; - _2.o = oxe; - _2.p = oxe; - _2.r = 0; - _2.s = 0; - _2.t = 0; - sfb(dGe, "Block", 172); - feb(209, 1, { 209: 1 }, _9c); - _2.a = 0; - _2.b = 0; - _2.d = 0; - _2.e = 0; - _2.f = 0; - sfb(dGe, "BlockRow", 209); - feb(315, 1, { 315: 1 }, had); - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.e = 0; - _2.f = 0; - sfb(dGe, "BlockStack", 315); - feb(238, 1, { 238: 1 }, lad, mad); - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.e = 0; - _2.g = 0; - var y1 = sfb(dGe, "DrawingData", 238); - feb(373, 22, { 3: 1, 34: 1, 22: 1, 373: 1 }, tad); - var nad, oad, pad2, qad, rad; - var x1 = tfb(dGe, "DrawingDataDescriptor", 373, WI, vad, uad); - var wad; - feb(186, 1, { 186: 1 }, Had); - _2.b = 0; - _2.c = 0; - _2.e = 0; - _2.f = 0; - sfb(dGe, "RectRow", 186); - feb(763, 1, {}, Pad); - _2.j = 0; - sfb(fGe, dBe, 763); - feb(1209, 1, {}, Qad); - _2.af = function Rad(a) { - return bjd(a.a, a.b); - }; - sfb(fGe, Nze, 1209); - feb(1210, 1, {}, Sad); - _2.af = function Tad(a) { - return Kad(this.a, a); - }; - sfb(fGe, eBe, 1210); - feb(1211, 1, {}, Uad); - _2.af = function Vad(a) { - return Lad(this.a, a); - }; - sfb(fGe, fBe, 1211); - feb(1212, 1, {}, Wad); - _2.af = function Xad(a) { - return Mad(this.a, a); - }; - sfb(fGe, "ElkGraphImporter/lambda$3$Type", 1212); - feb(1213, 1, {}, Yad); - _2.af = function Zad(a) { - return Nad(this.a, a); - }; - sfb(fGe, gBe, 1213); - feb(1115, 205, oze, $ad); - _2.rf = function abd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n; - if (Hxd(a, (ncd(), mcd))) { - n = WD(Gxd(a, (Tcd(), Scd))); - f2 = sgd(ygd(), n); - if (f2) { - g = RD(ltd(f2.f), 205); - g.rf(a, b.eh(1)); - } - } - Ixd(a, hcd, (Mbd(), Kbd)); - Ixd(a, icd, (Xbd(), Ubd)); - Ixd(a, jcd, (ldd(), kdd)); - h = RD(Gxd(a, (Tcd(), Ocd)), 17).a; - b.Ug("Overlap removal", 1); - Heb(TD(Gxd(a, Ncd))) && "null45scanlineOverlaps"; - i2 = new _sb(); - j = new cbd(i2); - d = new Pad(); - c2 = Jad(d, a); - k = true; - e = 0; - while (e < h && k) { - if (Heb(TD(Gxd(a, Pcd)))) { - i2.a.$b(); - VQb(new WQb(j), c2.i); - if (i2.a.gc() == 0) { - break; - } - c2.e = i2; - } - Sed(this.b); - Ved(this.b, (gbd(), dbd), (_cd(), $cd)); - Ved(this.b, ebd, c2.g); - Ved(this.b, fbd, (Cbd(), Bbd)); - this.a = Qed(this.b, c2); - for (m = new Anb(this.a); m.a < m.c.c.length; ) { - l = RD(ynb(m), 47); - l.Kf(c2, b.eh(1)); - } - Oad(d, c2); - k = Heb(TD(mQb(c2, (OQb(), NQb)))); - ++e; - } - Iad(d, c2); - b.Vg(); - }; - sfb(fGe, "OverlapRemovalLayoutProvider", 1115); - feb(1116, 1, {}, cbd); - sfb(fGe, "OverlapRemovalLayoutProvider/lambda$0$Type", 1116); - feb(444, 22, { 3: 1, 34: 1, 22: 1, 444: 1 }, hbd); - var dbd, ebd, fbd; - var I1 = tfb(fGe, "SPOrEPhases", 444, WI, jbd, ibd); - var kbd; - feb(1219, 1, {}, nbd); - sfb(fGe, "ShrinkTree", 1219); - feb(1117, 205, oze, obd); - _2.rf = function pbd(a, b) { - var c2, d, e, f2, g; - if (Hxd(a, (ncd(), mcd))) { - g = WD(Gxd(a, mcd)); - e = sgd(ygd(), g); - if (e) { - f2 = RD(ltd(e.f), 205); - f2.rf(a, b.eh(1)); - } - } - d = new Pad(); - c2 = Jad(d, a); - mbd(this.a, c2, b.eh(1)); - Iad(d, c2); - }; - sfb(fGe, "ShrinkTreeLayoutProvider", 1117); - feb(306, 137, { 3: 1, 306: 1, 96: 1, 137: 1 }, qbd); - _2.c = false; - sfb("org.eclipse.elk.alg.spore.graph", "Graph", 306); - feb(490, 22, { 3: 1, 34: 1, 22: 1, 490: 1, 188: 1, 196: 1 }, ubd); - _2.dg = function wbd() { - return tbd(this); - }; - _2.qg = function vbd() { - return tbd(this); - }; - var rbd; - var M1 = tfb(gGe, uze, 490, WI, ybd, xbd); - var zbd; - feb(558, 22, { 3: 1, 34: 1, 22: 1, 558: 1, 188: 1, 196: 1 }, Dbd); - _2.dg = function Fbd() { - return new Tdd(); - }; - _2.qg = function Ebd() { - return new Tdd(); - }; - var Bbd; - var N1 = tfb(gGe, "OverlapRemovalStrategy", 558, WI, Hbd, Gbd); - var Ibd; - feb(438, 22, { 3: 1, 34: 1, 22: 1, 438: 1 }, Nbd); - var Kbd, Lbd; - var O1 = tfb(gGe, "RootSelection", 438, WI, Pbd, Obd); - var Qbd; - feb(324, 22, { 3: 1, 34: 1, 22: 1, 324: 1 }, Ybd); - var Sbd, Tbd, Ubd, Vbd, Wbd; - var P1 = tfb(gGe, "SpanningTreeCostFunction", 324, WI, $bd, Zbd); - var _bd; - feb(1014, 1, Eye, pcd); - _2.hf = function qcd(a) { - ocd(a); - }; - var bcd, ccd, dcd, ecd, fcd, gcd, hcd, icd, jcd, kcd, lcd, mcd; - sfb(gGe, "SporeCompactionOptions", 1014); - feb(1015, 1, {}, rcd); - _2.sf = function scd() { - var a; - return a = new obd(), a; - }; - _2.tf = function tcd(a) { - }; - sfb(gGe, "SporeCompactionOptions/SporeCompactionFactory", 1015); - feb(866, 1, Eye, Lcd); - _2.hf = function Mcd(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), iGe), ""), "Underlying Layout Algorithm"), "A layout algorithm that is applied to the graph before it is compacted. If this is null, nothing is applied before compaction."), (kid(), iid)), qJ), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), nGe), "structure"), "Structure Extraction Strategy"), "This option defines what kind of triangulation or other partitioning of the plane is applied to the vertices."), Icd), eid), V1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), jGe), sGe), "Tree Construction Strategy"), "Whether a minimum spanning tree or a maximum spanning tree should be constructed."), Gcd), eid), W1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), kGe), sGe), "Cost Function for Spanning Tree"), "The cost function is used in the creation of the spanning tree."), Ecd), eid), P1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), lGe), sGe), "Root node for spanning tree construction"), "The identifier of the node that is preferred as the root of the spanning tree. If this is null, the first node is chosen."), null), iid), qJ), xsb(Whd)))); - zgd(a, lGe, mGe, Acd); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), mGe), sGe), "Root selection for spanning tree"), "This sets the method used to select a root node for the construction of a spanning tree"), Ccd), eid), O1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), oGe), nDe), YFe), "This option defines how the compaction is applied."), vcd), eid), M1), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), pGe), nDe), "Orthogonal Compaction"), "Restricts the translation of nodes to orthogonal directions in the compaction phase."), (Geb(), false)), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), qGe), tGe), "Upper limit for iterations of overlap removal"), null), sgb(64)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), rGe), tGe), "Whether to run a supplementary scanline overlap check."), null), true), cid), QI), xsb(Whd)))); - Ucd((new Vcd(), a)); - ocd((new pcd(), a)); - }; - var ucd, vcd, wcd, xcd, ycd, zcd, Acd, Bcd, Ccd, Dcd, Ecd, Fcd, Gcd, Hcd, Icd, Jcd; - sfb(gGe, "SporeMetaDataProvider", 866); - feb(1012, 1, Eye, Vcd); - _2.hf = function Wcd(a) { - Ucd(a); - }; - var Ncd, Ocd, Pcd, Qcd, Rcd, Scd; - sfb(gGe, "SporeOverlapRemovalOptions", 1012); - feb(1013, 1, {}, Xcd); - _2.sf = function Ycd() { - var a; - return a = new $ad(), a; - }; - _2.tf = function Zcd(a) { - }; - sfb(gGe, "SporeOverlapRemovalOptions/SporeOverlapFactory", 1013); - feb(539, 22, { 3: 1, 34: 1, 22: 1, 539: 1, 188: 1, 196: 1 }, cdd); - _2.dg = function edd() { - return bdd(this); - }; - _2.qg = function ddd() { - return bdd(this); - }; - var $cd; - var V1 = tfb(gGe, "StructureExtractionStrategy", 539, WI, gdd, fdd); - var hdd; - feb(437, 22, { 3: 1, 34: 1, 22: 1, 437: 1, 188: 1, 196: 1 }, ndd); - _2.dg = function pdd() { - return mdd(this); - }; - _2.qg = function odd() { - return mdd(this); - }; - var jdd, kdd; - var W1 = tfb(gGe, "TreeConstructionStrategy", 437, WI, rdd, qdd); - var sdd; - feb(1463, 1, nEe, vdd); - _2.rg = function wdd(a) { - return RD(a, 306), new ufd(); - }; - _2.Kf = function xdd(a, b) { - udd(RD(a, 306), b); - }; - sfb(vGe, "DelaunayTriangulationPhase", 1463); - feb(1464, 1, Qve, ydd); - _2.Cd = function zdd(a) { - Rmb(this.a, RD(a, 68).a); - }; - sfb(vGe, "DelaunayTriangulationPhase/lambda$0$Type", 1464); - feb(794, 1, nEe, Ddd); - _2.rg = function Edd(a) { - return RD(a, 306), new ufd(); - }; - _2.Kf = function Fdd(a, b) { - this.Jg(RD(a, 306), b); - }; - _2.Jg = function Gdd(a, b) { - var c2, d, e; - b.Ug("Minimum spanning tree construction", 1); - a.d ? d = a.d.a : d = RD(Vmb(a.i, 0), 68).a; - Heb(TD(mQb(a, (OQb(), MQb)))) ? e = LFb(a.e, d, (c2 = a.b, c2)) : e = LFb(a.e, d, a.b); - Bdd(this, e, a); - b.Vg(); - }; - sfb(wGe, "MinSTPhase", 794); - feb(1466, 794, nEe, Hdd); - _2.Jg = function Jdd(a, b) { - var c2, d, e, f2; - b.Ug("Maximum spanning tree construction", 1); - c2 = new Kdd(a); - a.d ? e = a.d.c : e = RD(Vmb(a.i, 0), 68).c; - Heb(TD(mQb(a, (OQb(), MQb)))) ? f2 = LFb(a.e, e, (d = c2, d)) : f2 = LFb(a.e, e, c2); - Bdd(this, f2, a); - b.Vg(); - }; - sfb(wGe, "MaxSTPhase", 1466); - feb(1467, 1, {}, Kdd); - _2.af = function Ldd(a) { - return Idd(this.a, a); - }; - sfb(wGe, "MaxSTPhase/lambda$0$Type", 1467); - feb(1465, 1, Qve, Mdd); - _2.Cd = function Ndd(a) { - Cdd(this.a, RD(a, 68)); - }; - sfb(wGe, "MinSTPhase/lambda$0$Type", 1465); - feb(796, 1, nEe, Tdd); - _2.rg = function Udd(a) { - return RD(a, 306), new ufd(); - }; - _2.Kf = function Vdd(a, b) { - Sdd(this, RD(a, 306), b); - }; - _2.a = false; - sfb(xGe, "GrowTreePhase", 796); - feb(797, 1, Qve, Wdd); - _2.Cd = function Xdd(a) { - Rdd(this.a, this.b, this.c, RD(a, 225)); - }; - sfb(xGe, "GrowTreePhase/lambda$0$Type", 797); - feb(1468, 1, nEe, _dd); - _2.rg = function aed(a) { - return RD(a, 306), new ufd(); - }; - _2.Kf = function bed(a, b) { - $dd(this, RD(a, 306), b); - }; - sfb(xGe, "ShrinkTreeCompactionPhase", 1468); - feb(795, 1, Qve, ced); - _2.Cd = function ded(a) { - Zdd(this.a, this.b, this.c, RD(a, 225)); - }; - sfb(xGe, "ShrinkTreeCompactionPhase/lambda$0$Type", 795); - var j4 = ufb(jEe, "IGraphElementVisitor"); - feb(872, 1, { 536: 1 }, med); - _2.Kg = function ped(a) { - var b; - b = led(this, a); - kQb(b, RD(Wjb(this.b, a), 96)); - jed(this, a, b); - }; - var eed, fed; - sfb(pze, "LayoutConfigurator", 872); - var g2 = ufb(pze, "LayoutConfigurator/IPropertyHolderOptionFilter"); - feb(944, 1, { 2032: 1 }, qed); - _2.Lg = function red(a, b) { - return hed(), !a.pf(b); - }; - sfb(pze, "LayoutConfigurator/lambda$0$Type", 944); - feb(943, 1, { 845: 1 }, sed); - _2.Mg = function ted(a, b) { - return hed(), !a.pf(b); - }; - sfb(pze, "LayoutConfigurator/lambda$1$Type", 943); - feb(945, 1, { 2032: 1 }, ved); - _2.Lg = function wed(a, b) { - return ued(a, b); - }; - sfb(pze, "LayoutConfigurator/lambda$2$Type", 945); - feb(946, 1, nwe, xed); - _2.Mb = function yed(a) { - return oed(this.a, this.b, RD(a, 2032)); - }; - sfb(pze, "LayoutConfigurator/lambda$3$Type", 946); - feb(869, 1, {}, Hed); - sfb(pze, "RecursiveGraphLayoutEngine", 869); - feb(224, 63, swe, Ied, Jed); - sfb(pze, "UnsupportedConfigurationException", 224); - feb(370, 63, swe, Ked); - sfb(pze, "UnsupportedGraphException", 370); - feb(761, 1, {}); - sfb(jEe, "AbstractRandomListAccessor", 761); - feb(450, 761, {}, Wed); - _2.Ng = function Yed() { - return null; - }; - _2.d = true; - _2.e = true; - _2.f = 0; - sfb(AGe, "AlgorithmAssembler", 450); - feb(1200, 1, nwe, Zed); - _2.Mb = function $ed(a) { - return !!RD(a, 106); - }; - sfb(AGe, "AlgorithmAssembler/lambda$0$Type", 1200); - feb(1201, 1, {}, _ed); - _2.Kb = function afd(a) { - return Xed(this.a, RD(a, 106)); - }; - sfb(AGe, "AlgorithmAssembler/lambda$1$Type", 1201); - feb(1202, 1, nwe, bfd); - _2.Mb = function cfd(a) { - return !!RD(a, 80); - }; - sfb(AGe, "AlgorithmAssembler/lambda$2$Type", 1202); - feb(1203, 1, Qve, dfd); - _2.Cd = function efd(a) { - ofd(this.a, RD(a, 80)); - }; - sfb(AGe, "AlgorithmAssembler/lambda$3$Type", 1203); - feb(1204, 1, Qve, ffd); - _2.Cd = function gfd(a) { - Red(this.a, this.b, RD(a, 196)); - }; - sfb(AGe, "AlgorithmAssembler/lambda$4$Type", 1204); - feb(1343, 1, fye, ifd); - _2.Ne = function jfd(a, b) { - return hfd(RD(a, 196), RD(b, 196)); - }; - _2.Fb = function kfd(a) { - return this === a; - }; - _2.Oe = function lfd() { - return new Frb(this); - }; - sfb(AGe, "EnumBasedFactoryComparator", 1343); - feb(80, 761, { 80: 1 }, ufd); - _2.Ng = function wfd() { - return new _sb(); - }; - _2.a = 0; - sfb(AGe, "LayoutProcessorConfiguration", 80); - feb(1025, 1, { 536: 1 }, Bfd); - _2.Kg = function Ffd(a) { - Bvb(yfd, new Kfd(a)); - }; - var xfd, yfd, zfd; - sfb(zye, "DeprecatedLayoutOptionReplacer", 1025); - feb(1026, 1, Qve, Gfd); - _2.Cd = function Hfd(a) { - Cfd(RD(a, 167)); - }; - sfb(zye, "DeprecatedLayoutOptionReplacer/lambda$0$Type", 1026); - feb(1027, 1, Qve, Ifd); - _2.Cd = function Jfd(a) { - Dfd(RD(a, 167)); - }; - sfb(zye, "DeprecatedLayoutOptionReplacer/lambda$1$Type", 1027); - feb(1028, 1, {}, Kfd); - _2.Yd = function Lfd(a, b) { - Efd(this.a, RD(a, 149), RD(b, 41)); - }; - sfb(zye, "DeprecatedLayoutOptionReplacer/lambda$2$Type", 1028); - feb(143, 1, { 701: 1, 143: 1 }, Pfd); - _2.Fb = function Qfd(a) { - return Nfd(this, a); - }; - _2.Og = function Rfd() { - return this.b; - }; - _2.Pg = function Sfd() { - return this.c; - }; - _2.xe = function Tfd() { - return this.e; - }; - _2.Hb = function Ufd() { - return ohb(this.c); - }; - _2.Ib = function Vfd() { - return "Layout Algorithm: " + this.c; - }; - var D2 = sfb(zye, "LayoutAlgorithmData", 143); - feb(269, 1, {}, agd); - sfb(zye, "LayoutAlgorithmData/Builder", 269); - feb(1029, 1, { 536: 1 }, dgd); - _2.Kg = function egd(a) { - ZD(a, 207) && !Heb(TD(a.of((umd(), rld)))) && bgd(RD(a, 27)); - }; - sfb(zye, "LayoutAlgorithmResolver", 1029); - feb(233, 1, { 701: 1, 233: 1 }, fgd); - _2.Fb = function ggd(a) { - if (ZD(a, 233)) { - return lhb(this.b, RD(a, 233).b); - } - return false; - }; - _2.Og = function hgd() { - return this.a; - }; - _2.Pg = function igd() { - return this.b; - }; - _2.xe = function jgd() { - return this.d; - }; - _2.Hb = function kgd() { - return ohb(this.b); - }; - _2.Ib = function lgd() { - return "Layout Type: " + this.b; - }; - sfb(zye, "LayoutCategoryData", 233); - feb(357, 1, {}, pgd); - sfb(zye, "LayoutCategoryData/Builder", 357); - feb(879, 1, {}, xgd); - var qgd; - sfb(zye, "LayoutMetaDataService", 879); - feb(880, 1, {}, Ggd); - sfb(zye, "LayoutMetaDataService/Registry", 880); - feb(487, 1, { 487: 1 }, Hgd); - sfb(zye, "LayoutMetaDataService/Registry/Triple", 487); - feb(881, 1, BGe, Igd); - _2.Qg = function Jgd() { - return new pjd(); - }; - sfb(zye, "LayoutMetaDataService/lambda$0$Type", 881); - feb(882, 1, CGe, Kgd); - _2.Rg = function Lgd(a) { - return ajd(RD(a, 8)); - }; - sfb(zye, "LayoutMetaDataService/lambda$1$Type", 882); - feb(891, 1, BGe, Mgd); - _2.Qg = function Ngd() { - return new bnb(); - }; - sfb(zye, "LayoutMetaDataService/lambda$10$Type", 891); - feb(892, 1, CGe, Ogd); - _2.Rg = function Pgd(a) { - return new dnb(RD(a, 13)); - }; - sfb(zye, "LayoutMetaDataService/lambda$11$Type", 892); - feb(893, 1, BGe, Qgd); - _2.Qg = function Rgd() { - return new Yub(); - }; - sfb(zye, "LayoutMetaDataService/lambda$12$Type", 893); - feb(894, 1, CGe, Sgd); - _2.Rg = function Tgd(a) { - return gv(RD(a, 67)); - }; - sfb(zye, "LayoutMetaDataService/lambda$13$Type", 894); - feb(895, 1, BGe, Ugd); - _2.Qg = function Vgd() { - return new _sb(); - }; - sfb(zye, "LayoutMetaDataService/lambda$14$Type", 895); - feb(896, 1, CGe, Wgd); - _2.Rg = function Xgd(a) { - return Ux(RD(a, 49)); - }; - sfb(zye, "LayoutMetaDataService/lambda$15$Type", 896); - feb(897, 1, BGe, Ygd); - _2.Qg = function Zgd() { - return new Iub(); - }; - sfb(zye, "LayoutMetaDataService/lambda$16$Type", 897); - feb(898, 1, CGe, $gd); - _2.Rg = function _gd(a) { - return Xx(RD(a, 49)); - }; - sfb(zye, "LayoutMetaDataService/lambda$17$Type", 898); - feb(899, 1, BGe, ahd); - _2.Qg = function bhd() { - return new xAb(); - }; - sfb(zye, "LayoutMetaDataService/lambda$18$Type", 899); - feb(900, 1, CGe, chd); - _2.Rg = function dhd(a) { - return Yx(RD(a, 157)); - }; - sfb(zye, "LayoutMetaDataService/lambda$19$Type", 900); - feb(883, 1, BGe, ehd); - _2.Qg = function fhd() { - return new Ejd(); - }; - sfb(zye, "LayoutMetaDataService/lambda$2$Type", 883); - feb(884, 1, CGe, ghd); - _2.Rg = function hhd(a) { - return new Fjd(RD(a, 75)); - }; - sfb(zye, "LayoutMetaDataService/lambda$3$Type", 884); - feb(885, 1, BGe, ihd); - _2.Qg = function jhd() { - return new P2b(); - }; - sfb(zye, "LayoutMetaDataService/lambda$4$Type", 885); - feb(886, 1, CGe, khd); - _2.Rg = function lhd(a) { - return new S2b(RD(a, 140)); - }; - sfb(zye, "LayoutMetaDataService/lambda$5$Type", 886); - feb(887, 1, BGe, mhd); - _2.Qg = function nhd() { - return new z3b(); - }; - sfb(zye, "LayoutMetaDataService/lambda$6$Type", 887); - feb(888, 1, CGe, ohd); - _2.Rg = function phd(a) { - return new B3b(RD(a, 107)); - }; - sfb(zye, "LayoutMetaDataService/lambda$7$Type", 888); - feb(889, 1, BGe, qhd); - _2.Qg = function rhd() { - return new dtd(); - }; - sfb(zye, "LayoutMetaDataService/lambda$8$Type", 889); - feb(890, 1, CGe, shd); - _2.Rg = function thd(a) { - return new etd(RD(a, 385)); - }; - sfb(zye, "LayoutMetaDataService/lambda$9$Type", 890); - var V5 = ufb(jze, "IProperty"); - feb(23, 1, { 34: 1, 701: 1, 23: 1, 149: 1 }, Ahd); - _2.Fd = function Bhd(a) { - return vhd(this, RD(a, 149)); - }; - _2.Fb = function Chd(a) { - return ZD(a, 23) ? lhb(this.f, RD(a, 23).f) : ZD(a, 149) && lhb(this.f, RD(a, 149).Pg()); - }; - _2.Sg = function Dhd() { - var a; - if (ZD(this.b, 4)) { - a = FId(this.b); - if (a == null) { - throw Adb(new dgb(HGe + this.f + "'. Make sure it's type is registered with the " + (lfb(b6), b6.k) + EGe)); - } - return a; - } else { - return this.b; - } - }; - _2.Og = function Ehd() { - return this.d; - }; - _2.Pg = function Fhd() { - return this.f; - }; - _2.xe = function Ghd() { - return this.i; - }; - _2.Hb = function Hhd() { - return ohb(this.f); - }; - _2.Ib = function Ihd() { - return "Layout Option: " + this.f; - }; - sfb(zye, "LayoutOptionData", 23); - feb(24, 1, {}, Shd); - sfb(zye, "LayoutOptionData/Builder", 24); - feb(170, 22, { 3: 1, 34: 1, 22: 1, 170: 1 }, Zhd); - var Thd, Uhd, Vhd, Whd, Xhd; - var d3 = tfb(zye, "LayoutOptionData/Target", 170, WI, _hd, $hd); - var aid; - feb(285, 22, { 3: 1, 34: 1, 22: 1, 285: 1 }, lid); - var cid, did, eid, fid, gid, hid, iid, jid; - var e3 = tfb(zye, "LayoutOptionData/Type", 285, WI, nid, mid); - var oid; - var qid; - var sid; - feb(116, 1, { 116: 1 }, Tid, Uid2, Vid); - _2.Fb = function Wid(a) { - var b; - if (a == null || !ZD(a, 116)) { - return false; - } - b = RD(a, 116); - return Fvb(this.c, b.c) && Fvb(this.d, b.d) && Fvb(this.b, b.b) && Fvb(this.a, b.a); - }; - _2.Hb = function Xid() { - return Tnb(cD(WC(jJ, 1), rve, 1, 5, [this.c, this.d, this.b, this.a])); - }; - _2.Ib = function Yid() { - return "Rect[x=" + this.c + ",y=" + this.d + ",w=" + this.b + ",h=" + this.a + "]"; - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = 0; - sfb(_Ae, "ElkRectangle", 116); - feb(8, 1, { 3: 1, 4: 1, 8: 1, 423: 1 }, pjd, qjd, rjd, sjd); - _2.Fb = function tjd(a) { - return djd(this, a); - }; - _2.Hb = function ujd() { - return Nfb(this.a) + pgb(Nfb(this.b)); - }; - _2.cg = function wjd(b) { - var c2, d, e, f2; - e = 0; - while (e < b.length && vjd((BFb(e, b.length), b.charCodeAt(e)), YAe)) { - ++e; - } - c2 = b.length; - while (c2 > 0 && vjd((BFb(c2 - 1, b.length), b.charCodeAt(c2 - 1)), ZAe)) { - --c2; - } - if (e >= c2) { - throw Adb(new agb("The given string does not contain any numbers.")); - } - f2 = vhb((AFb(e, c2, b.length), b.substr(e, c2 - e)), ",|;|\r|\n"); - if (f2.length != 2) { - throw Adb(new agb("Exactly two numbers are expected, " + f2.length + " were found.")); - } - try { - this.a = Neb(Dhb(f2[0])); - this.b = Neb(Dhb(f2[1])); - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - d = a; - throw Adb(new agb($Ae + d)); - } else - throw Adb(a); - } - }; - _2.Ib = function yjd() { - return "(" + this.a + "," + this.b + ")"; - }; - _2.a = 0; - _2.b = 0; - var l3 = sfb(_Ae, "KVector", 8); - feb(75, 67, { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 67: 1, 15: 1, 75: 1, 423: 1 }, Ejd, Fjd, Gjd); - _2.Pc = function Jjd() { - return Djd(this); - }; - _2.cg = function Hjd(b) { - var c2, d, e, f2, g, h; - e = vhb(b, ",|;|\\(|\\)|\\[|\\]|\\{|\\}| | |\n"); - Xub(this); - try { - d = 0; - g = 0; - f2 = 0; - h = 0; - while (d < e.length) { - if (e[d] != null && Dhb(e[d]).length > 0) { - g % 2 == 0 ? f2 = Neb(e[d]) : h = Neb(e[d]); - g > 0 && g % 2 != 0 && Mub(this, new rjd(f2, h)); - ++g; - } - ++d; - } - } catch (a) { - a = zdb(a); - if (ZD(a, 130)) { - c2 = a; - throw Adb(new agb("The given string does not match the expected format for vectors." + c2)); - } else - throw Adb(a); - } - }; - _2.Ib = function Kjd() { - var a, b, c2; - a = new dib("("); - b = Sub(this, 0); - while (b.b != b.d.c) { - c2 = RD(evb(b), 8); - Zhb(a, c2.a + "," + c2.b); - b.b != b.d.c && (a.a += "; ", a); - } - return (a.a += ")", a).a; - }; - var k3 = sfb(_Ae, "KVectorChain", 75); - feb(255, 22, { 3: 1, 34: 1, 22: 1, 255: 1 }, Sjd); - var Ljd, Mjd, Njd, Ojd, Pjd, Qjd; - var n3 = tfb(JGe, "Alignment", 255, WI, Ujd, Tjd); - var Vjd; - feb(991, 1, Eye, jkd); - _2.hf = function kkd(a) { - ikd(a); - }; - var Xjd, Yjd, Zjd, $jd, _jd, akd, bkd, ckd, dkd, ekd, fkd, gkd; - sfb(JGe, "BoxLayouterOptions", 991); - feb(992, 1, {}, lkd); - _2.sf = function mkd() { - var a; - return a = new jrd(), a; - }; - _2.tf = function nkd(a) { - }; - sfb(JGe, "BoxLayouterOptions/BoxFactory", 992); - feb(298, 22, { 3: 1, 34: 1, 22: 1, 298: 1 }, vkd); - var okd, pkd, qkd, rkd, skd, tkd; - var q3 = tfb(JGe, "ContentAlignment", 298, WI, xkd, wkd); - var ykd; - feb(699, 1, Eye, vmd); - _2.hf = function wmd(a) { - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), OGe), ""), "Layout Algorithm"), "Select a specific layout algorithm."), (kid(), iid)), qJ), xsb((Yhd(), Whd))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), PGe), ""), "Resolved Layout Algorithm"), "Meta data associated with the selected algorithm."), hid), D2), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), MDe), ""), "Alignment"), "Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."), Ckd), eid), n3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), Dze), ""), "Aspect Ratio"), "The desired aspect ratio of the drawing, that is the quotient of width by height."), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), QGe), ""), "Bend Points"), "A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points."), hid), k3), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), YDe), ""), "Content Alignment"), "Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option."), Lkd), fid), q3), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), LDe), ""), "Debug Mode"), "Whether additional debug information shall be generated."), (Geb(), false)), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), PDe), ""), eze), "Overall direction of edges: horizontal (right / left) or vertical (down / up)."), Okd), eid), s3), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), kDe), ""), "Edge Routing"), "What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline."), Tkd), eid), u3), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), MGe), ""), "Expand Nodes"), "If active, nodes are expanded to fill the area of their parent."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), fDe), ""), "Hierarchy Handling"), "Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."), Ykd), eid), y3), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Vhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Eze), ""), "Padding"), "The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately."), uld), hid), i3), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Vhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), dAe), ""), "Interactive"), "Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), iEe), ""), "interactive Layout"), "Whether the graph should be changeable interactively and by setting constraints"), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), gAe), ""), "Omit Node Micro Layout"), "Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), eAe), ""), "Port Constraints"), "Defines constraints of the position of the ports of a node."), Ild), eid), C3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), fEe), ""), "Position"), "The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."), hid), l3), ysb(Vhd, cD(WC(d3, 1), jwe, 170, 0, [Xhd, Uhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), $ze), ""), "Priority"), "Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."), gid), bJ), ysb(Vhd, cD(WC(d3, 1), jwe, 170, 0, [Thd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), bAe), ""), "Randomization Seed"), "Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time)."), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), cAe), ""), "Separate Connected Components"), "Whether each connected component should be processed separately."), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ZDe), ""), "Junction Points"), "This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order."), dld), hid), k3), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), aEe), ""), "Comment Box"), "Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related."), false), cid), QI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), bEe), ""), "Hypernode"), "Whether the node should be handled as a hypernode."), false), cid), QI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), RGe), ""), "Label Manager"), "Label managers can shorten labels upon a layout algorithm's request."), hid), g3), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Uhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), gEe), ""), "Margins"), "Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels."), fld), hid), h3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), JDe), ""), "No Layout"), "No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node."), false), cid), QI), ysb(Vhd, cD(WC(d3, 1), jwe, 170, 0, [Thd, Xhd, Uhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), SGe), ""), "Scale Factor"), "The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set."), 1), did), VI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), TGe), ""), "Child Area Width"), "The width of the area occupied by the laid out children of a node."), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), UGe), ""), "Child Area Height"), "The height of the area occupied by the laid out children of a node."), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), mAe), ""), yGe), "Turns topdown layout on and off. If this option is enabled, hierarchical layout will be computed first for the root node and then for its children recursively. Layouts are then scaled down to fit the area provided by their parents. Graphs must follow a certain structure for topdown layout to work properly. {@link TopdownNodeTypes.PARALLEL_NODE} nodes must have children of type {@link TopdownNodeTypes.HIERARCHICAL_NODE} and must define {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} for their children. Furthermore they need to be laid out using an algorithm that is a {@link TopdownLayoutProvider}. Hierarchical nodes can also be parents of other hierarchical nodes and can optionally use a {@link TopdownSizeApproximator} to dynamically set sizes during topdown layout. In this case {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} should be set on the node itself rather than the parent. The values are then used by the size approximator as base values. Hierarchical nodes require the layout option {@link nodeSize.fixedGraphSize} to be true to prevent the algorithm used there from resizing the hierarchical node. This option is not supported if 'Hierarchy Handling' is set to 'INCLUDE_CHILDREN'"), false), cid), QI), xsb(Whd)))); - zgd(a, mAe, qAe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), VGe), ""), "Animate"), "Whether the shift from the old layout to the new computed layout shall be animated."), true), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), WGe), ""), "Animation Time Factor"), "Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'."), sgb(100)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), XGe), ""), "Layout Ancestors"), "Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), YGe), ""), "Maximal Animation Time"), "The maximal time for animations, in milliseconds."), sgb(4e3)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ZGe), ""), "Minimal Animation Time"), "The minimal time for animations, in milliseconds."), sgb(400)), gid), bJ), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), $Ge), ""), "Progress Bar"), "Whether a progress bar shall be displayed during layout computations."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), _Ge), ""), "Validate Graph"), "Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), aHe), ""), "Validate Options"), "Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."), true), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), bHe), ""), "Zoom to Fit"), "Whether the zoom level shall be set to view the whole diagram after layout."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), NGe), "box"), "Box Layout Mode"), "Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better."), Gkd), eid), R3), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), xDe), lDe), "Comment Comment Spacing"), "Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing."), 10), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), yDe), lDe), "Comment Node Spacing"), "Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing."), 10), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Bze), lDe), "Components Spacing"), "Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."), 20), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), zDe), lDe), "Edge Spacing"), "Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines."), 10), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), aAe), lDe), "Edge Label Spacing"), "The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option."), 2), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ADe), lDe), "Edge Node Spacing"), "Spacing to be preserved between nodes and edges."), 10), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), BDe), lDe), "Label Spacing"), "Determines the amount of space to be left between two labels of the same graph element."), 0), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), EDe), lDe), "Label Node Spacing"), "Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option."), 5), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), CDe), lDe), "Horizontal spacing between Label and Port"), "Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."), 1), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), DDe), lDe), "Vertical spacing between Label and Port"), "Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."), 1), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), _ze), lDe), "Node Spacing"), "The minimal distance to be preserved between each two nodes."), 20), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), FDe), lDe), "Node Self Loop Spacing"), "Spacing to be preserved between a node and its self loops."), 10), did), VI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), GDe), lDe), "Port Spacing"), "Spacing between pairs of ports of the same node."), 10), did), VI), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Vhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), HDe), lDe), "Individual Spacing"), "Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."), hid), l4), ysb(Vhd, cD(WC(d3, 1), jwe, 170, 0, [Thd, Xhd, Uhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), hEe), lDe), "Additional Port Space"), "Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border."), imd), hid), h3), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), eEe), hHe), "Layout Partition"), "Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction)."), gid), bJ), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Vhd]))))); - zgd(a, eEe, dEe, yld); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), dEe), hHe), "Layout Partitioning"), "Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle."), wld), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), QDe), iHe), "Node Label Padding"), "Define padding for node labels that are placed inside of a node."), hld), hid), i3), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), kAe), iHe), "Node Label Placement"), "Hints for where node labels are to be placed; if empty, the node label's position is not modified."), jld), fid), A3), ysb(Vhd, cD(WC(d3, 1), jwe, 170, 0, [Uhd]))))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), TDe), jHe), "Port Alignment"), "Defines the default port distribution for a node. May be overridden for each side individually."), Ald), eid), B3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), UDe), jHe), "Port Alignment (North)"), "Defines how ports on the northern side are placed, overriding the node's general port alignment."), eid), B3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), VDe), jHe), "Port Alignment (South)"), "Defines how ports on the southern side are placed, overriding the node's general port alignment."), eid), B3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), WDe), jHe), "Port Alignment (West)"), "Defines how ports on the western side are placed, overriding the node's general port alignment."), eid), B3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), XDe), jHe), "Port Alignment (East)"), "Defines how ports on the eastern side are placed, overriding the node's general port alignment."), eid), B3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), jAe), kHe), "Node Size Constraints"), "What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed."), lld), fid), H3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), iAe), kHe), "Node Size Options"), "Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications."), qld), fid), I3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), CAe), kHe), "Node Size Minimum"), "The minimal size to which a node can be reduced."), old), hid), l3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), hAe), kHe), "Fixed Graph Size"), "By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so."), false), cid), QI), xsb(Whd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), $De), vDe), "Edge Label Placement"), "Gives a hint on where to put edge labels."), Rkd), eid), t32), xsb(Uhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), fAe), vDe), "Inline Edge Labels"), "If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible."), false), cid), QI), xsb(Uhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), cHe), "font"), "Font Name"), "Font name used for a label."), iid), qJ), xsb(Uhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), dHe), "font"), "Font Size"), "Font size used for a label."), gid), bJ), xsb(Uhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), cEe), lHe), "Port Anchor Offset"), "The offset to the port position where connections shall be attached."), hid), l3), xsb(Xhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), _De), lHe), "Port Index"), "The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case."), gid), bJ), xsb(Xhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), KDe), lHe), "Port Side"), "The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports."), Pld), eid), E3), xsb(Xhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Khd(Ohd(Lhd(Mhd(new Shd(), IDe), lHe), "Port Border Offset"), "The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border."), did), VI), xsb(Xhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), lAe), mHe), "Port Label Placement"), "Decides on a placement method for port labels; if empty, the node label's position is not modified."), Mld), fid), D3), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), RDe), mHe), "Port Labels Next to Port"), "Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."), false), cid), QI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), SDe), mHe), "Treat Port Labels as Group"), "If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port."), true), cid), QI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), nAe), nHe), "Topdown Scale Factor"), "The scaling factor to be applied to the nodes laid out within the node in recursive topdown layout. The difference to 'Scale Factor' is that the node itself is not scaled. This value has to be set on hierarchical nodes."), 1), did), VI), xsb(Whd)))); - zgd(a, nAe, qAe, rmd); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), eHe), nHe), "Topdown Size Approximator"), "The size approximator to be used to set sizes of hierarchical nodes during topdown layout. The default value is null, which results in nodes keeping whatever size is defined for them e.g. through parent parallel node or by manually setting the size."), null), eid), M3), xsb(Vhd)))); - zgd(a, eHe, qAe, tmd); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), oAe), nHe), "Topdown Hierarchical Node Width"), "The fixed size of a hierarchical node when using topdown layout. If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."), 150), did), VI), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Vhd]))))); - zgd(a, oAe, qAe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), pAe), nHe), "Topdown Hierarchical Node Aspect Ratio"), "The fixed aspect ratio of a hierarchical node when using topdown layout. Default is 1/sqrt(2). If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."), 1.414), did), VI), ysb(Whd, cD(WC(d3, 1), jwe, 170, 0, [Vhd]))))); - zgd(a, pAe, qAe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), qAe), nHe), "Topdown Node Type"), "The different node types used for topdown layout. If the node type is set to {@link TopdownNodeTypes.PARALLEL_NODE} the algorithm must be set to a {@link TopdownLayoutProvider} such as {@link TopdownPacking}. The {@link nodeSize.fixedGraphSize} option is technically only required for hierarchical nodes."), null), eid), J3), xsb(Vhd)))); - zgd(a, qAe, hAe, null); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), fHe), nHe), "Topdown Scale Cap"), "Determines the upper limit for the topdown scale factor. The default value is 1.0 which ensures that nested children never end up appearing larger than their parents in terms of unit sizes such as the font size. If the limit is larger, nodes will fully utilize the available space, but it is counteriniuitive for inner nodes to have a larger scale than outer nodes."), 1), did), VI), xsb(Whd)))); - zgd(a, fHe, qAe, pmd); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), NDe), oHe), "Activate Inside Self Loops"), "Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports."), false), cid), QI), xsb(Vhd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), ODe), oHe), "Inside Self Loop"), "Whether a self loop should be routed inside a node instead of around that node."), false), cid), QI), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), Cze), "edge"), "Edge Thickness"), "The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it."), 1), did), VI), xsb(Thd)))); - Egd(a, new Ahd(Qhd(Phd(Rhd(Jhd(Khd(Ohd(Lhd(Mhd(new Shd(), gHe), "edge"), "Edge Type"), "The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."), Vkd), eid), v3), xsb(Thd)))); - Dgd(a, new fgd(mgd(ogd(ngd(new pgd(), sxe), "Layered"), 'The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.'))); - Dgd(a, new fgd(mgd(ogd(ngd(new pgd(), "org.eclipse.elk.orthogonal"), "Orthogonal"), `Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia '86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.`))); - Dgd(a, new fgd(mgd(ogd(ngd(new pgd(), Zze), "Force"), "Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984."))); - Dgd(a, new fgd(mgd(ogd(ngd(new pgd(), "org.eclipse.elk.circle"), "Circle"), "Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph."))); - Dgd(a, new fgd(mgd(ogd(ngd(new pgd(), $Ee), "Tree"), "Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type."))); - Dgd(a, new fgd(mgd(ogd(ngd(new pgd(), "org.eclipse.elk.planar"), "Planar"), "Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable."))); - Dgd(a, new fgd(mgd(ogd(ngd(new pgd(), CFe), "Radial"), "Radial layout algorithms usually position the nodes of the graph on concentric circles."))); - wnd((new xnd(), a)); - ikd((new jkd(), a)); - Gpd((new Hpd(), a)); - }; - var Akd, Bkd, Ckd, Dkd, Ekd, Fkd, Gkd, Hkd, Ikd, Jkd, Kkd, Lkd, Mkd, Nkd, Okd, Pkd, Qkd, Rkd, Skd, Tkd, Ukd, Vkd, Wkd, Xkd, Ykd, Zkd, $kd, _kd, ald, bld, cld, dld, eld, fld, gld, hld, ild, jld, kld, lld, mld, nld, old, pld, qld, rld, sld, tld, uld, vld, wld, xld, yld, zld, Ald, Bld, Cld, Dld, Eld, Fld, Gld, Hld, Ild, Jld, Kld, Lld, Mld, Nld, Old, Pld, Qld, Rld, Sld, Tld, Uld, Vld, Wld, Xld, Yld, Zld, $ld, _ld, amd, bmd, cmd, dmd, emd, fmd, gmd, hmd, imd, jmd, kmd, lmd, mmd, nmd, omd, pmd, qmd, rmd, smd, tmd; - sfb(JGe, "CoreOptions", 699); - feb(88, 22, { 3: 1, 34: 1, 22: 1, 88: 1 }, Gmd); - var xmd, ymd, zmd, Amd, Bmd; - var s3 = tfb(JGe, eze, 88, WI, Imd, Hmd); - var Jmd; - feb(278, 22, { 3: 1, 34: 1, 22: 1, 278: 1 }, Pmd); - var Lmd, Mmd, Nmd; - var t32 = tfb(JGe, "EdgeLabelPlacement", 278, WI, Rmd, Qmd); - var Smd; - feb(223, 22, { 3: 1, 34: 1, 22: 1, 223: 1 }, Zmd); - var Umd, Vmd, Wmd, Xmd; - var u3 = tfb(JGe, "EdgeRouting", 223, WI, _md, $md); - var and; - feb(321, 22, { 3: 1, 34: 1, 22: 1, 321: 1 }, jnd); - var cnd, dnd, end2, fnd, gnd, hnd; - var v3 = tfb(JGe, "EdgeType", 321, WI, lnd, knd); - var mnd; - feb(989, 1, Eye, xnd); - _2.hf = function ynd(a) { - wnd(a); - }; - var ond, pnd, qnd, rnd, snd, tnd, und; - sfb(JGe, "FixedLayouterOptions", 989); - feb(990, 1, {}, znd); - _2.sf = function And() { - var a; - return a = new btd(), a; - }; - _2.tf = function Bnd(a) { - }; - sfb(JGe, "FixedLayouterOptions/FixedFactory", 990); - feb(346, 22, { 3: 1, 34: 1, 22: 1, 346: 1 }, Gnd); - var Cnd, Dnd, End; - var y3 = tfb(JGe, "HierarchyHandling", 346, WI, Ind, Hnd); - var Jnd; - feb(291, 22, { 3: 1, 34: 1, 22: 1, 291: 1 }, Rnd); - var Lnd, Mnd, Nnd, Ond; - var z3 = tfb(JGe, "LabelSide", 291, WI, Tnd, Snd); - var Und; - feb(95, 22, { 3: 1, 34: 1, 22: 1, 95: 1 }, eod); - var Wnd, Xnd, Ynd, Znd, $nd, _nd, aod, bod, cod; - var A3 = tfb(JGe, "NodeLabelPlacement", 95, WI, hod, god); - var iod; - feb(256, 22, { 3: 1, 34: 1, 22: 1, 256: 1 }, qod); - var kod, lod, mod, nod, ood; - var B3 = tfb(JGe, "PortAlignment", 256, WI, sod, rod); - var tod; - feb(101, 22, { 3: 1, 34: 1, 22: 1, 101: 1 }, Eod); - var vod, wod, xod, yod, zod, Aod; - var C3 = tfb(JGe, "PortConstraints", 101, WI, God, Fod); - var Hod; - feb(279, 22, { 3: 1, 34: 1, 22: 1, 279: 1 }, Qod); - var Jod, Kod, Lod, Mod, Nod, Ood; - var D3 = tfb(JGe, "PortLabelPlacement", 279, WI, Uod, Tod); - var Vod; - feb(64, 22, { 3: 1, 34: 1, 22: 1, 64: 1 }, upd); - var Xod, Yod, Zod, $od, _od, apd, bpd, cpd, dpd, epd, fpd, gpd, hpd, ipd, jpd, kpd, lpd, mpd, npd, opd, ppd; - var E3 = tfb(JGe, "PortSide", 64, WI, xpd, wpd); - var ypd; - feb(993, 1, Eye, Hpd); - _2.hf = function Ipd(a) { - Gpd(a); - }; - var Apd, Bpd, Cpd, Dpd, Epd; - sfb(JGe, "RandomLayouterOptions", 993); - feb(994, 1, {}, Jpd); - _2.sf = function Kpd() { - var a; - return a = new eud(), a; - }; - _2.tf = function Lpd(a) { - }; - sfb(JGe, "RandomLayouterOptions/RandomFactory", 994); - feb(386, 22, { 3: 1, 34: 1, 22: 1, 386: 1 }, Rpd); - var Mpd, Npd, Opd, Ppd; - var H3 = tfb(JGe, "SizeConstraint", 386, WI, Tpd, Spd); - var Upd; - feb(264, 22, { 3: 1, 34: 1, 22: 1, 264: 1 }, eqd); - var Wpd, Xpd, Ypd, Zpd, $pd, _pd, aqd, bqd, cqd; - var I3 = tfb(JGe, "SizeOptions", 264, WI, gqd, fqd); - var hqd; - feb(280, 22, { 3: 1, 34: 1, 22: 1, 280: 1 }, nqd); - var jqd, kqd, lqd; - var J3 = tfb(JGe, "TopdownNodeTypes", 280, WI, pqd, oqd); - var qqd; - feb(347, 22, rHe); - var sqd, tqd; - var M3 = tfb(JGe, "TopdownSizeApproximator", 347, WI, xqd, wqd); - feb(987, 347, rHe, zqd); - _2.Tg = function Aqd(a) { - return yqd(a); - }; - tfb(JGe, "TopdownSizeApproximator/1", 987, M3, null, null); - feb(988, 347, rHe, Bqd); - _2.Tg = function Cqd(b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B, C, D5; - c2 = RD(Gxd(b, (umd(), Tld)), 143); - A = (bvd(), o2 = new ACd(), o2); - zxd(A, b); - B = new Tsb(); - for (g = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); g.e != g.i.gc(); ) { - e = RD(bMd(g), 27); - t = (n = new ACd(), n); - yCd(t, A); - zxd(t, e); - D5 = yqd(e); - zyd(t, $wnd.Math.max(e.g, D5.a), $wnd.Math.max(e.f, D5.b)); - rtb(B.f, e, t); - } - for (f2 = new dMd((!b.a && (b.a = new C5d(J4, b, 10, 11)), b.a)); f2.e != f2.i.gc(); ) { - e = RD(bMd(f2), 27); - for (l = new dMd((!e.e && (e.e = new Yie(G4, e, 7, 4)), e.e)); l.e != l.i.gc(); ) { - k = RD(bMd(l), 74); - v = RD(Wd(qtb(B.f, e)), 27); - w2 = RD(Wjb(B, QHd((!k.c && (k.c = new Yie(E4, k, 5, 8)), k.c), 0)), 27); - u = (m = new rzd(), m); - WGd((!u.b && (u.b = new Yie(E4, u, 4, 7)), u.b), v); - WGd((!u.c && (u.c = new Yie(E4, u, 5, 8)), u.c), w2); - pzd(u, vCd(v)); - zxd(u, k); - } - } - q = RD(ltd(c2.f), 205); - try { - q.rf(A, new ztd()); - mtd(c2.f, q); - } catch (a) { - a = zdb(a); - if (ZD(a, 103)) { - p = a; - throw Adb(p); - } else - throw Adb(a); - } - Hxd(A, Ikd) || Hxd(A, Hkd) || psd(A); - j = Kfb(UD(Gxd(A, Ikd))); - i2 = Kfb(UD(Gxd(A, Hkd))); - h = j / i2; - d = Kfb(UD(Gxd(A, lmd))) * $wnd.Math.sqrt((!A.a && (A.a = new C5d(J4, A, 10, 11)), A.a).i); - C = RD(Gxd(A, tld), 107); - s = C.b + C.c + 1; - r = C.d + C.a + 1; - return new rjd($wnd.Math.max(s, d), $wnd.Math.max(r, d / h)); - }; - tfb(JGe, "TopdownSizeApproximator/2", 988, M3, null, null); - var Dqd; - feb(344, 1, { 871: 1 }, Oqd); - _2.Ug = function Pqd(a, b) { - return Fqd(this, a, b); - }; - _2.Vg = function Qqd() { - Hqd(this); - }; - _2.Wg = function Rqd() { - return this.q; - }; - _2.Xg = function Sqd() { - return !this.f ? null : Hob(this.f); - }; - _2.Yg = function Tqd() { - return Hob(this.a); - }; - _2.Zg = function Uqd() { - return this.p; - }; - _2.$g = function Vqd() { - return false; - }; - _2._g = function Wqd() { - return this.n; - }; - _2.ah = function Xqd() { - return this.p != null && !this.b; - }; - _2.bh = function Yqd(a) { - var b; - if (this.n) { - b = a; - Rmb(this.f, b); - } - }; - _2.dh = function Zqd(a, b) { - var c2, d; - this.n && !!a && Jqd(this, (c2 = new Zje(), d = Rje(c2, a), Yje(c2), d), (ttd(), qtd)); - }; - _2.eh = function $qd(a) { - var b; - if (this.b) { - return null; - } else { - b = Gqd(this, this.g); - Mub(this.a, b); - b.i = this; - this.d = a; - return b; - } - }; - _2.fh = function _qd(a) { - a > 0 && !this.b && Iqd(this, a); - }; - _2.b = false; - _2.c = 0; - _2.d = -1; - _2.e = null; - _2.f = null; - _2.g = -1; - _2.j = false; - _2.k = false; - _2.n = false; - _2.o = 0; - _2.q = 0; - _2.r = 0; - sfb(jEe, "BasicProgressMonitor", 344); - feb(717, 205, oze, jrd); - _2.rf = function nrd(a, b) { - crd(a, b); - }; - sfb(jEe, "BoxLayoutProvider", 717); - feb(983, 1, fye, prd); - _2.Ne = function qrd(a, b) { - return ord(this, RD(a, 27), RD(b, 27)); - }; - _2.Fb = function rrd(a) { - return this === a; - }; - _2.Oe = function srd() { - return new Frb(this); - }; - _2.a = false; - sfb(jEe, "BoxLayoutProvider/1", 983); - feb(163, 1, { 163: 1 }, zrd, Ard); - _2.Ib = function Brd() { - return this.c ? zCd(this.c) : Fe(this.b); - }; - sfb(jEe, "BoxLayoutProvider/Group", 163); - feb(320, 22, { 3: 1, 34: 1, 22: 1, 320: 1 }, Hrd); - var Crd, Drd, Erd, Frd; - var R3 = tfb(jEe, "BoxLayoutProvider/PackingMode", 320, WI, Jrd, Ird); - var Krd; - feb(984, 1, fye, Mrd); - _2.Ne = function Nrd(a, b) { - return krd(RD(a, 163), RD(b, 163)); - }; - _2.Fb = function Ord(a) { - return this === a; - }; - _2.Oe = function Prd() { - return new Frb(this); - }; - sfb(jEe, "BoxLayoutProvider/lambda$0$Type", 984); - feb(985, 1, fye, Qrd); - _2.Ne = function Rrd(a, b) { - return lrd(RD(a, 163), RD(b, 163)); - }; - _2.Fb = function Srd(a) { - return this === a; - }; - _2.Oe = function Trd() { - return new Frb(this); - }; - sfb(jEe, "BoxLayoutProvider/lambda$1$Type", 985); - feb(986, 1, fye, Urd); - _2.Ne = function Vrd(a, b) { - return mrd(RD(a, 163), RD(b, 163)); - }; - _2.Fb = function Wrd(a) { - return this === a; - }; - _2.Oe = function Xrd() { - return new Frb(this); - }; - sfb(jEe, "BoxLayoutProvider/lambda$2$Type", 986); - feb(1384, 1, { 845: 1 }, Yrd); - _2.Mg = function Zrd(a, b) { - return GCc(), !ZD(b, 167) || ued((hed(), RD(a, 167)), b); - }; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type", 1384); - feb(1385, 1, Qve, $rd); - _2.Cd = function _rd(a) { - JCc(this.a, RD(a, 149)); - }; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type", 1385); - feb(1386, 1, Qve, asd); - _2.Cd = function bsd(a) { - RD(a, 96); - GCc(); - }; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type", 1386); - feb(1390, 1, Qve, csd); - _2.Cd = function dsd(a) { - KCc(this.a, RD(a, 96)); - }; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type", 1390); - feb(1388, 1, nwe, esd); - _2.Mb = function fsd(a) { - return LCc(this.a, this.b, RD(a, 149)); - }; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type", 1388); - feb(1387, 1, nwe, gsd); - _2.Mb = function hsd(a) { - return NCc(this.a, this.b, RD(a, 845)); - }; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type", 1387); - feb(1389, 1, Qve, isd); - _2.Cd = function jsd(a) { - MCc(this.a, this.b, RD(a, 149)); - }; - sfb(jEe, "ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type", 1389); - feb(947, 1, {}, Lsd); - _2.Kb = function Msd(a) { - return Ksd(a); - }; - _2.Fb = function Nsd(a) { - return this === a; - }; - sfb(jEe, "ElkUtil/lambda$0$Type", 947); - feb(948, 1, Qve, Osd); - _2.Cd = function Psd(a) { - ysd(this.a, this.b, RD(a, 74)); - }; - _2.a = 0; - _2.b = 0; - sfb(jEe, "ElkUtil/lambda$1$Type", 948); - feb(949, 1, Qve, Qsd); - _2.Cd = function Rsd(a) { - zsd(this.a, this.b, RD(a, 166)); - }; - _2.a = 0; - _2.b = 0; - sfb(jEe, "ElkUtil/lambda$2$Type", 949); - feb(950, 1, Qve, Ssd); - _2.Cd = function Tsd(a) { - Asd(this.a, this.b, RD(a, 135)); - }; - _2.a = 0; - _2.b = 0; - sfb(jEe, "ElkUtil/lambda$3$Type", 950); - feb(951, 1, Qve, Usd); - _2.Cd = function Vsd(a) { - Bsd(this.a, RD(a, 377)); - }; - sfb(jEe, "ElkUtil/lambda$4$Type", 951); - feb(325, 1, { 34: 1, 325: 1 }, Xsd); - _2.Fd = function Ysd(a) { - return Wsd(this, RD(a, 242)); - }; - _2.Fb = function Zsd(a) { - var b; - if (ZD(a, 325)) { - b = RD(a, 325); - return this.a == b.a; - } - return false; - }; - _2.Hb = function $sd() { - return eE(this.a); - }; - _2.Ib = function _sd() { - return this.a + " (exclusive)"; - }; - _2.a = 0; - sfb(jEe, "ExclusiveBounds/ExclusiveLowerBound", 325); - feb(1119, 205, oze, btd); - _2.rf = function ctd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r, s, t, u, v, w2, A, B; - b.Ug("Fixed Layout", 1); - f2 = RD(Gxd(a, (umd(), Skd)), 223); - l = 0; - m = 0; - for (s = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); s.e != s.i.gc(); ) { - q = RD(bMd(s), 27); - B = RD(Gxd(q, (vnd(), und)), 8); - if (B) { - Byd(q, B.a, B.b); - if (RD(Gxd(q, pnd), 181).Hc((Qpd(), Mpd))) { - n = RD(Gxd(q, rnd), 8); - n.a > 0 && n.b > 0 && Esd(q, n.a, n.b, true, true); - } - } - l = $wnd.Math.max(l, q.i + q.g); - m = $wnd.Math.max(m, q.j + q.f); - for (j = new dMd((!q.n && (q.n = new C5d(I4, q, 1, 7)), q.n)); j.e != j.i.gc(); ) { - h = RD(bMd(j), 135); - B = RD(Gxd(h, und), 8); - !!B && Byd(h, B.a, B.b); - l = $wnd.Math.max(l, q.i + h.i + h.g); - m = $wnd.Math.max(m, q.j + h.j + h.f); - } - for (v = new dMd((!q.c && (q.c = new C5d(K4, q, 9, 9)), q.c)); v.e != v.i.gc(); ) { - u = RD(bMd(v), 123); - B = RD(Gxd(u, und), 8); - !!B && Byd(u, B.a, B.b); - w2 = q.i + u.i; - A = q.j + u.j; - l = $wnd.Math.max(l, w2 + u.g); - m = $wnd.Math.max(m, A + u.f); - for (i2 = new dMd((!u.n && (u.n = new C5d(I4, u, 1, 7)), u.n)); i2.e != i2.i.gc(); ) { - h = RD(bMd(i2), 135); - B = RD(Gxd(h, und), 8); - !!B && Byd(h, B.a, B.b); - l = $wnd.Math.max(l, w2 + h.i + h.g); - m = $wnd.Math.max(m, A + h.j + h.f); - } - } - for (e = new is(Mr(zGd(q).a.Kc(), new ir())); gs(e); ) { - c2 = RD(hs(e), 74); - k = atd(c2); - l = $wnd.Math.max(l, k.a); - m = $wnd.Math.max(m, k.b); - } - for (d = new is(Mr(yGd(q).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 74); - if (vCd(JGd(c2)) != a) { - k = atd(c2); - l = $wnd.Math.max(l, k.a); - m = $wnd.Math.max(m, k.b); - } - } - } - if (f2 == (Ymd(), Umd)) { - for (r = new dMd((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a)); r.e != r.i.gc(); ) { - q = RD(bMd(r), 27); - for (d = new is(Mr(zGd(q).a.Kc(), new ir())); gs(d); ) { - c2 = RD(hs(d), 74); - g = tsd(c2); - g.b == 0 ? Ixd(c2, cld, null) : Ixd(c2, cld, g); - } - } - } - if (!Heb(TD(Gxd(a, (vnd(), qnd))))) { - t = RD(Gxd(a, snd), 107); - p = l + t.b + t.c; - o2 = m + t.d + t.a; - Esd(a, p, o2, true, true); - } - b.Vg(); - }; - sfb(jEe, "FixedLayoutProvider", 1119); - feb(385, 137, { 3: 1, 423: 1, 385: 1, 96: 1, 137: 1 }, dtd, etd); - _2.cg = function htd(b) { - var c2, d, e, f2, g, h, i2, j, k; - if (!b) { - return; - } - try { - j = vhb(b, ";,;"); - for (g = j, h = 0, i2 = g.length; h < i2; ++h) { - f2 = g[h]; - d = vhb(f2, "\\:"); - e = vgd(ygd(), d[0]); - if (!e) { - throw Adb(new agb("Invalid option id: " + d[0])); - } - k = zhd(e, d[1]); - if (k == null) { - throw Adb(new agb("Invalid option value: " + d[1])); - } - k == null ? (!this.q && (this.q = new Tsb()), _jb(this.q, e)) : (!this.q && (this.q = new Tsb()), Zjb(this.q, e, k)); - } - } catch (a) { - a = zdb(a); - if (ZD(a, 103)) { - c2 = a; - throw Adb(new bgb(c2)); - } else - throw Adb(a); - } - }; - _2.Ib = function itd() { - var a; - a = WD(zDb(GDb((!this.q ? (yob(), yob(), wob) : this.q).vc().Oc(), new jtd()), sBb(new hCb(), new fCb(), new RBb(), new TBb(), cD(WC(QL, 1), jwe, 108, 0, [])))); - return a; - }; - var l4 = sfb(jEe, "IndividualSpacings", 385); - feb(982, 1, {}, jtd); - _2.Kb = function ktd(a) { - return gtd(RD(a, 44)); - }; - sfb(jEe, "IndividualSpacings/lambda$0$Type", 982); - feb(718, 1, {}, ntd); - _2.c = 0; - sfb(jEe, "InstancePool", 718); - feb(1835, 1, {}, otd); - sfb(jEe, "LoggedGraph", 1835); - feb(415, 22, { 3: 1, 34: 1, 22: 1, 415: 1 }, utd); - var ptd, qtd, rtd, std; - var n4 = tfb(jEe, "LoggedGraph/Type", 415, WI, wtd, vtd); - var xtd; - feb(1063, 1, { 871: 1 }, ztd); - _2.Ug = function Atd(a, b) { - return false; - }; - _2.Vg = function Btd() { - }; - _2.Wg = function Ctd() { - return 0; - }; - _2.Xg = function Dtd() { - return null; - }; - _2.Yg = function Etd() { - return null; - }; - _2.Zg = function Ftd() { - return null; - }; - _2.$g = function Gtd() { - return false; - }; - _2._g = function Htd() { - return false; - }; - _2.ah = function Itd() { - return false; - }; - _2.bh = function Jtd(a) { - }; - _2.dh = function Ktd(a, b) { - }; - _2.eh = function Ltd(a) { - return this; - }; - _2.fh = function Mtd(a) { - }; - sfb(jEe, "NullElkProgressMonitor", 1063); - feb(42, 1, { 20: 1, 42: 1 }, Ptd); - _2.Jc = function Rtd(a) { - xgb(this, a); - }; - _2.Fb = function Qtd(a) { - var b, c2, d; - if (ZD(a, 42)) { - c2 = RD(a, 42); - b = this.a == null ? c2.a == null : pb(this.a, c2.a); - d = this.b == null ? c2.b == null : pb(this.b, c2.b); - return b && d; - } else { - return false; - } - }; - _2.Hb = function Std() { - var a, b, c2, d, e, f2; - c2 = this.a == null ? 0 : tb(this.a); - a = c2 & Bwe; - b = c2 & -65536; - f2 = this.b == null ? 0 : tb(this.b); - d = f2 & Bwe; - e = f2 & -65536; - return a ^ e >> 16 & Bwe | b ^ d << 16; - }; - _2.Kc = function Ttd() { - return new Vtd(this); - }; - _2.Ib = function Utd() { - return this.a == null && this.b == null ? "pair(null,null)" : this.a == null ? "pair(null," + jeb(this.b) + ")" : this.b == null ? "pair(" + jeb(this.a) + ",null)" : "pair(" + jeb(this.a) + "," + jeb(this.b) + ")"; - }; - sfb(jEe, "Pair", 42); - feb(995, 1, Ave, Vtd); - _2.Nb = function Wtd(a) { - Ztb(this, a); - }; - _2.Ob = function Xtd() { - return !this.c && (!this.b && this.a.a != null || this.a.b != null); - }; - _2.Pb = function Ytd() { - if (!this.c && !this.b && this.a.a != null) { - this.b = true; - return this.a.a; - } else if (!this.c && this.a.b != null) { - this.c = true; - return this.a.b; - } - throw Adb(new Dvb()); - }; - _2.Qb = function Ztd() { - this.c && this.a.b != null ? this.a.b = null : this.b && this.a.a != null && (this.a.a = null); - throw Adb(new cgb()); - }; - _2.b = false; - _2.c = false; - sfb(jEe, "Pair/1", 995); - feb(455, 1, { 455: 1 }, $td); - _2.Fb = function _td(a) { - return Fvb(this.a, RD(a, 455).a) && Fvb(this.c, RD(a, 455).c) && Fvb(this.d, RD(a, 455).d) && Fvb(this.b, RD(a, 455).b); - }; - _2.Hb = function aud() { - return Tnb(cD(WC(jJ, 1), rve, 1, 5, [this.a, this.c, this.d, this.b])); - }; - _2.Ib = function bud() { - return "(" + this.a + pve + this.c + pve + this.d + pve + this.b + ")"; - }; - sfb(jEe, "Quadruple", 455); - feb(1108, 205, oze, eud); - _2.rf = function fud(a, b) { - var c2, d, e, f2, g; - b.Ug("Random Layout", 1); - if ((!a.a && (a.a = new C5d(J4, a, 10, 11)), a.a).i == 0) { - b.Vg(); - return; - } - f2 = RD(Gxd(a, (Fpd(), Dpd)), 17); - !!f2 && f2.a != 0 ? e = new Pwb(f2.a) : e = new Owb(); - c2 = Mfb(UD(Gxd(a, Apd))); - g = Mfb(UD(Gxd(a, Epd))); - d = RD(Gxd(a, Bpd), 107); - dud(a, e, c2, g, d); - b.Vg(); - }; - sfb(jEe, "RandomLayoutProvider", 1108); - feb(240, 1, { 240: 1 }, gud); - _2.Fb = function hud(a) { - return Fvb(this.a, RD(a, 240).a) && Fvb(this.b, RD(a, 240).b) && Fvb(this.c, RD(a, 240).c); - }; - _2.Hb = function iud() { - return Tnb(cD(WC(jJ, 1), rve, 1, 5, [this.a, this.b, this.c])); - }; - _2.Ib = function jud() { - return "(" + this.a + pve + this.b + pve + this.c + ")"; - }; - sfb(jEe, "Triple", 240); - var kud; - feb(562, 1, {}); - _2.Lf = function oud() { - return new rjd(this.f.i, this.f.j); - }; - _2.of = function pud(a) { - if (hGd(a, (umd(), Gld))) { - return Gxd(this.f, mud); - } - return Gxd(this.f, a); - }; - _2.Mf = function qud() { - return new rjd(this.f.g, this.f.f); - }; - _2.Nf = function rud() { - return this.g; - }; - _2.pf = function sud(a) { - return Hxd(this.f, a); - }; - _2.Of = function tud(a) { - Dyd(this.f, a.a); - Eyd(this.f, a.b); - }; - _2.Pf = function uud(a) { - Cyd(this.f, a.a); - Ayd(this.f, a.b); - }; - _2.Qf = function vud(a) { - this.g = a; - }; - _2.g = 0; - var mud; - sfb(uHe, "ElkGraphAdapters/AbstractElkGraphElementAdapter", 562); - feb(563, 1, { 853: 1 }, wud); - _2.Rf = function xud() { - var a, b; - if (!this.b) { - this.b = fv(iyd(this.a).i); - for (b = new dMd(iyd(this.a)); b.e != b.i.gc(); ) { - a = RD(bMd(b), 135); - Rmb(this.b, new Bud(a)); - } - } - return this.b; - }; - _2.b = null; - sfb(uHe, "ElkGraphAdapters/ElkEdgeAdapter", 563); - feb(289, 562, {}, zud); - _2.Sf = function Aud() { - return yud(this); - }; - _2.a = null; - sfb(uHe, "ElkGraphAdapters/ElkGraphAdapter", 289); - feb(640, 562, { 187: 1 }, Bud); - sfb(uHe, "ElkGraphAdapters/ElkLabelAdapter", 640); - feb(639, 562, { 695: 1 }, Fud); - _2.Rf = function Iud() { - return Cud(this); - }; - _2.Vf = function Jud() { - var a; - return a = RD(Gxd(this.f, (umd(), eld)), 140), !a && (a = new P2b()), a; - }; - _2.Xf = function Lud() { - return Dud(this); - }; - _2.Zf = function Nud(a) { - var b; - b = new S2b(a); - Ixd(this.f, (umd(), eld), b); - }; - _2.$f = function Oud(a) { - Ixd(this.f, (umd(), tld), new B3b(a)); - }; - _2.Tf = function Gud() { - return this.d; - }; - _2.Uf = function Hud() { - var a, b; - if (!this.a) { - this.a = new bnb(); - for (b = new is(Mr(yGd(RD(this.f, 27)).a.Kc(), new ir())); gs(b); ) { - a = RD(hs(b), 74); - Rmb(this.a, new wud(a)); - } - } - return this.a; - }; - _2.Wf = function Kud() { - var a, b; - if (!this.c) { - this.c = new bnb(); - for (b = new is(Mr(zGd(RD(this.f, 27)).a.Kc(), new ir())); gs(b); ) { - a = RD(hs(b), 74); - Rmb(this.c, new wud(a)); - } - } - return this.c; - }; - _2.Yf = function Mud() { - return tCd(RD(this.f, 27)).i != 0 || Heb(TD(RD(this.f, 27).of((umd(), $kd)))); - }; - _2._f = function Pud() { - Eud(this, (lud(), kud)); - }; - _2.a = null; - _2.b = null; - _2.c = null; - _2.d = null; - _2.e = null; - sfb(uHe, "ElkGraphAdapters/ElkNodeAdapter", 639); - feb(1284, 562, { 852: 1 }, Rud); - _2.Rf = function Tud() { - return Qud(this); - }; - _2.Uf = function Sud() { - var a, b; - if (!this.a) { - this.a = ev(RD(this.f, 123).hh().i); - for (b = new dMd(RD(this.f, 123).hh()); b.e != b.i.gc(); ) { - a = RD(bMd(b), 74); - Rmb(this.a, new wud(a)); - } - } - return this.a; - }; - _2.Wf = function Uud() { - var a, b; - if (!this.c) { - this.c = ev(RD(this.f, 123).ih().i); - for (b = new dMd(RD(this.f, 123).ih()); b.e != b.i.gc(); ) { - a = RD(bMd(b), 74); - Rmb(this.c, new wud(a)); - } - } - return this.c; - }; - _2.ag = function Vud() { - return RD(RD(this.f, 123).of((umd(), Old)), 64); - }; - _2.bg = function Wud() { - var a, b, c2, d, e, f2, g, h; - d = MCd(RD(this.f, 123)); - for (c2 = new dMd(RD(this.f, 123).ih()); c2.e != c2.i.gc(); ) { - a = RD(bMd(c2), 74); - for (h = new dMd((!a.c && (a.c = new Yie(E4, a, 5, 8)), a.c)); h.e != h.i.gc(); ) { - g = RD(bMd(h), 84); - if (NGd(AGd(g), d)) { - return true; - } else if (AGd(g) == d && Heb(TD(Gxd(a, (umd(), _kd))))) { - return true; - } - } - } - for (b = new dMd(RD(this.f, 123).hh()); b.e != b.i.gc(); ) { - a = RD(bMd(b), 74); - for (f2 = new dMd((!a.b && (a.b = new Yie(E4, a, 4, 7)), a.b)); f2.e != f2.i.gc(); ) { - e = RD(bMd(f2), 84); - if (NGd(AGd(e), d)) { - return true; - } - } - } - return false; - }; - _2.a = null; - _2.b = null; - _2.c = null; - sfb(uHe, "ElkGraphAdapters/ElkPortAdapter", 1284); - feb(1285, 1, fye, Yud); - _2.Ne = function Zud(a, b) { - return Xud(RD(a, 123), RD(b, 123)); - }; - _2.Fb = function $ud(a) { - return this === a; - }; - _2.Oe = function _ud() { - return new Frb(this); - }; - sfb(uHe, "ElkGraphAdapters/PortComparator", 1285); - var r7 = ufb(vHe, "EObject"); - var C4 = ufb(wHe, xHe); - var D4 = ufb(wHe, yHe); - var H4 = ufb(wHe, zHe); - var L4 = ufb(wHe, "ElkShape"); - var E4 = ufb(wHe, AHe); - var G4 = ufb(wHe, BHe); - var F4 = ufb(wHe, CHe); - var p7 = ufb(vHe, DHe); - var n7 = ufb(vHe, "EFactory"); - var avd; - var q7 = ufb(vHe, EHe); - var t7 = ufb(vHe, "EPackage"); - var cvd; - var evd, fvd, gvd, hvd, ivd, jvd, kvd, lvd, mvd, nvd, ovd; - var I4 = ufb(wHe, FHe); - var J4 = ufb(wHe, GHe); - var K4 = ufb(wHe, HHe); - feb(93, 1, IHe); - _2.th = function rvd() { - this.uh(); - return null; - }; - _2.uh = function svd() { - return null; - }; - _2.vh = function tvd() { - return this.uh(), false; - }; - _2.wh = function uvd() { - return false; - }; - _2.xh = function vvd(a) { - qvd(this, a); - }; - sfb(JHe, "BasicNotifierImpl", 93); - feb(99, 93, RHe); - _2.Yh = function Dwd() { - return Mvd(this); - }; - _2.yh = function bwd(a, b) { - return a; - }; - _2.zh = function cwd() { - throw Adb(new jib()); - }; - _2.Ah = function dwd(a) { - var b; - return b = Z5d(RD(vYd(this.Dh(), this.Fh()), 19)), this.Ph().Th(this, b.n, b.f, a); - }; - _2.Bh = function ewd(a, b) { - throw Adb(new jib()); - }; - _2.Ch = function fwd(a, b, c2) { - return xvd(this, a, b, c2); - }; - _2.Dh = function gwd() { - var a; - if (this.zh()) { - a = this.zh().Nk(); - if (a) { - return a; - } - } - return this.ii(); - }; - _2.Eh = function hwd() { - return yvd(this); - }; - _2.Fh = function iwd() { - throw Adb(new jib()); - }; - _2.Gh = function kwd() { - var a, b; - b = this.$h().Ok(); - !b && this.zh().Tk(b = (N2d(), a = P$d(rYd(this.Dh())), a == null ? M2d : new Q2d(this, a))); - return b; - }; - _2.Hh = function mwd(a, b) { - return a; - }; - _2.Ih = function nwd(a) { - var b; - b = a.pk(); - return !b ? BYd(this.Dh(), a) : a.Lj(); - }; - _2.Jh = function owd() { - var a; - a = this.zh(); - return !a ? null : a.Qk(); - }; - _2.Kh = function pwd() { - return !this.zh() ? null : this.zh().Nk(); - }; - _2.Lh = function qwd(a, b, c2) { - return Dvd(this, a, b, c2); - }; - _2.Mh = function rwd(a) { - return Evd(this, a); - }; - _2.Nh = function swd(a, b) { - return Fvd(this, a, b); - }; - _2.Oh = function twd() { - var a; - a = this.zh(); - return !!a && a.Rk(); - }; - _2.Ph = function uwd() { - throw Adb(new jib()); - }; - _2.Qh = function vwd() { - return Hvd(this); - }; - _2.Rh = function wwd(a, b, c2, d) { - return Ivd(this, a, b, d); - }; - _2.Sh = function xwd(a, b, c2) { - var d; - return d = RD(vYd(this.Dh(), b), 69), d.wk().zk(this, this.hi(), b - this.ji(), a, c2); - }; - _2.Th = function ywd(a, b, c2, d) { - return Jvd(this, a, b, d); - }; - _2.Uh = function zwd(a, b, c2) { - var d; - return d = RD(vYd(this.Dh(), b), 69), d.wk().Ak(this, this.hi(), b - this.ji(), a, c2); - }; - _2.Vh = function Awd() { - return !!this.zh() && !!this.zh().Pk(); - }; - _2.Wh = function Bwd(a) { - return Kvd(this, a); - }; - _2.Xh = function Cwd(a) { - return Lvd(this, a); - }; - _2.Zh = function Ewd(a) { - return Pvd(this, a); - }; - _2.$h = function Fwd() { - throw Adb(new jib()); - }; - _2._h = function Gwd() { - return !this.zh() ? null : this.zh().Pk(); - }; - _2.ai = function Hwd() { - return Hvd(this); - }; - _2.bi = function Iwd(a, b) { - Wvd(this, a, b); - }; - _2.ci = function Jwd(a) { - this.$h().Sk(a); - }; - _2.di = function Kwd(a) { - this.$h().Vk(a); - }; - _2.ei = function Lwd(a) { - this.$h().Uk(a); - }; - _2.fi = function Mwd(a, b) { - var c2, d, e, f2; - f2 = this.Jh(); - if (!!f2 && !!a) { - b = rLd(f2.El(), this, b); - f2.Il(this); - } - d = this.Ph(); - if (d) { - if ((jwd(this, this.Ph(), this.Fh()).Bb & txe) != 0) { - e = d.Qh(); - !!e && (!a ? e.Hl(this) : !f2 && e.Il(this)); - } else { - b = (c2 = this.Fh(), c2 >= 0 ? this.Ah(b) : this.Ph().Th(this, -1 - c2, null, b)); - b = this.Ch(null, -1, b); - } - } - this.di(a); - return b; - }; - _2.gi = function Nwd(a) { - var b, c2, d, e, f2, g, h, i2; - c2 = this.Dh(); - f2 = BYd(c2, a); - b = this.ji(); - if (f2 >= b) { - return RD(a, 69).wk().Dk(this, this.hi(), f2 - b); - } else if (f2 <= -1) { - g = Eee((lke(), jke), c2, a); - if (g) { - nke(); - RD(g, 69).xk() || (g = zfe(Qee(jke, g))); - e = (d = this.Ih(g), RD(d >= 0 ? this.Lh(d, true, true) : Qvd(this, g, true), 160)); - i2 = g.Ik(); - if (i2 > 1 || i2 == -1) { - return RD(RD(e, 220).Sl(a, false), 79); - } - } else { - throw Adb(new agb(KHe + a.xe() + NHe)); - } - } else if (a.Jk()) { - return d = this.Ih(a), RD(d >= 0 ? this.Lh(d, false, true) : Qvd(this, a, false), 79); - } - h = new NTd(this, a); - return h; - }; - _2.hi = function Owd() { - return Yvd(this); - }; - _2.ii = function Pwd() { - return (lTd(), kTd).S; - }; - _2.ji = function Qwd() { - return AYd(this.ii()); - }; - _2.ki = function Rwd(a) { - $vd(this, a); - }; - _2.Ib = function Swd() { - return awd(this); - }; - sfb(SHe, "BasicEObjectImpl", 99); - var ZSd; - feb(119, 99, { 110: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1 }); - _2.li = function _wd(a) { - var b; - b = Vwd(this); - return b[a]; - }; - _2.mi = function axd(a, b) { - var c2; - c2 = Vwd(this); - bD(c2, a, b); - }; - _2.ni = function bxd(a) { - var b; - b = Vwd(this); - bD(b, a, null); - }; - _2.th = function cxd() { - return RD(Ywd(this, 4), 129); - }; - _2.uh = function dxd() { - throw Adb(new jib()); - }; - _2.vh = function exd() { - return (this.Db & 4) != 0; - }; - _2.zh = function fxd() { - throw Adb(new jib()); - }; - _2.oi = function gxd(a) { - $wd(this, 2, a); - }; - _2.Bh = function hxd(a, b) { - this.Db = b << 16 | this.Db & 255; - this.oi(a); - }; - _2.Dh = function ixd() { - return Uwd(this); - }; - _2.Fh = function jxd() { - return this.Db >> 16; - }; - _2.Gh = function kxd() { - var a, b; - return N2d(), b = P$d(rYd((a = RD(Ywd(this, 16), 29), !a ? this.ii() : a))), b == null ? M2d : new Q2d(this, b); - }; - _2.wh = function lxd() { - return (this.Db & 1) == 0; - }; - _2.Jh = function mxd() { - return RD(Ywd(this, 128), 2034); - }; - _2.Kh = function nxd() { - return RD(Ywd(this, 16), 29); - }; - _2.Oh = function oxd() { - return (this.Db & 32) != 0; - }; - _2.Ph = function pxd() { - return RD(Ywd(this, 2), 54); - }; - _2.Vh = function qxd() { - return (this.Db & 64) != 0; - }; - _2.$h = function rxd() { - throw Adb(new jib()); - }; - _2._h = function sxd() { - return RD(Ywd(this, 64), 288); - }; - _2.ci = function txd(a) { - $wd(this, 16, a); - }; - _2.di = function uxd(a) { - $wd(this, 128, a); - }; - _2.ei = function vxd(a) { - $wd(this, 64, a); - }; - _2.hi = function wxd() { - return Wwd(this); - }; - _2.Db = 0; - sfb(SHe, "MinimalEObjectImpl", 119); - feb(120, 119, { 110: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }); - _2.oi = function xxd(a) { - this.Cb = a; - }; - _2.Ph = function yxd() { - return this.Cb; - }; - sfb(SHe, "MinimalEObjectImpl/Container", 120); - feb(2083, 120, { 110: 1, 342: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }); - _2.Lh = function Jxd(a, b, c2) { - return Axd(this, a, b, c2); - }; - _2.Uh = function Kxd(a, b, c2) { - return Bxd(this, a, b, c2); - }; - _2.Wh = function Lxd(a) { - return Cxd(this, a); - }; - _2.bi = function Mxd(a, b) { - Dxd(this, a, b); - }; - _2.ii = function Nxd() { - return pvd(), ovd; - }; - _2.ki = function Oxd(a) { - Exd(this, a); - }; - _2.nf = function Pxd() { - return Fxd(this); - }; - _2.gh = function Qxd() { - return !this.o && (this.o = new DVd((pvd(), mvd), X4, this, 0)), this.o; - }; - _2.of = function Rxd(a) { - return Gxd(this, a); - }; - _2.pf = function Sxd(a) { - return Hxd(this, a); - }; - _2.qf = function Txd(a, b) { - return Ixd(this, a, b); - }; - sfb(THe, "EMapPropertyHolderImpl", 2083); - feb(572, 120, { 110: 1, 377: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }, Xxd); - _2.Lh = function Yxd(a, b, c2) { - switch (a) { - case 0: - return this.a; - case 1: - return this.b; - } - return Dvd(this, a, b, c2); - }; - _2.Wh = function Zxd(a) { - switch (a) { - case 0: - return this.a != 0; - case 1: - return this.b != 0; - } - return Kvd(this, a); - }; - _2.bi = function $xd(a, b) { - switch (a) { - case 0: - Vxd(this, Kfb(UD(b))); - return; - case 1: - Wxd(this, Kfb(UD(b))); - return; - } - Wvd(this, a, b); - }; - _2.ii = function _xd() { - return pvd(), evd; - }; - _2.ki = function ayd(a) { - switch (a) { - case 0: - Vxd(this, 0); - return; - case 1: - Wxd(this, 0); - return; - } - $vd(this, a); - }; - _2.Ib = function byd() { - var a; - if ((this.Db & 64) != 0) - return awd(this); - a = new Shb(awd(this)); - a.a += " (x: "; - Khb(a, this.a); - a.a += ", y: "; - Khb(a, this.b); - a.a += ")"; - return a.a; - }; - _2.a = 0; - _2.b = 0; - sfb(THe, "ElkBendPointImpl", 572); - feb(739, 2083, { 110: 1, 342: 1, 167: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }); - _2.Lh = function lyd(a, b, c2) { - return cyd(this, a, b, c2); - }; - _2.Sh = function myd(a, b, c2) { - return dyd(this, a, b, c2); - }; - _2.Uh = function nyd(a, b, c2) { - return eyd(this, a, b, c2); - }; - _2.Wh = function oyd(a) { - return fyd(this, a); - }; - _2.bi = function pyd(a, b) { - gyd(this, a, b); - }; - _2.ii = function qyd() { - return pvd(), ivd; - }; - _2.ki = function ryd(a) { - hyd(this, a); - }; - _2.jh = function syd() { - return this.k; - }; - _2.kh = function tyd() { - return iyd(this); - }; - _2.Ib = function uyd() { - return kyd(this); - }; - _2.k = null; - sfb(THe, "ElkGraphElementImpl", 739); - feb(740, 739, { 110: 1, 342: 1, 167: 1, 422: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }); - _2.Lh = function Gyd(a, b, c2) { - return vyd(this, a, b, c2); - }; - _2.Wh = function Hyd(a) { - return wyd(this, a); - }; - _2.bi = function Iyd(a, b) { - xyd(this, a, b); - }; - _2.ii = function Jyd() { - return pvd(), nvd; - }; - _2.ki = function Kyd(a) { - yyd(this, a); - }; - _2.lh = function Lyd() { - return this.f; - }; - _2.mh = function Myd() { - return this.g; - }; - _2.nh = function Nyd() { - return this.i; - }; - _2.oh = function Oyd() { - return this.j; - }; - _2.ph = function Pyd(a, b) { - zyd(this, a, b); - }; - _2.qh = function Qyd(a, b) { - Byd(this, a, b); - }; - _2.rh = function Ryd(a) { - Dyd(this, a); - }; - _2.sh = function Syd(a) { - Eyd(this, a); - }; - _2.Ib = function Tyd() { - return Fyd(this); - }; - _2.f = 0; - _2.g = 0; - _2.i = 0; - _2.j = 0; - sfb(THe, "ElkShapeImpl", 740); - feb(741, 740, { 110: 1, 342: 1, 84: 1, 167: 1, 422: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }); - _2.Lh = function _yd(a, b, c2) { - return Uyd(this, a, b, c2); - }; - _2.Sh = function azd(a, b, c2) { - return Vyd(this, a, b, c2); - }; - _2.Uh = function bzd(a, b, c2) { - return Wyd(this, a, b, c2); - }; - _2.Wh = function czd(a) { - return Xyd(this, a); - }; - _2.bi = function dzd(a, b) { - Yyd(this, a, b); - }; - _2.ii = function ezd() { - return pvd(), fvd; - }; - _2.ki = function fzd(a) { - Zyd(this, a); - }; - _2.hh = function gzd() { - return !this.d && (this.d = new Yie(G4, this, 8, 5)), this.d; - }; - _2.ih = function hzd() { - return !this.e && (this.e = new Yie(G4, this, 7, 4)), this.e; - }; - sfb(THe, "ElkConnectableShapeImpl", 741); - feb(326, 739, { 110: 1, 342: 1, 74: 1, 167: 1, 326: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }, rzd); - _2.Ah = function szd(a) { - return jzd(this, a); - }; - _2.Lh = function tzd(a, b, c2) { - switch (a) { - case 3: - return kzd(this); - case 4: - return !this.b && (this.b = new Yie(E4, this, 4, 7)), this.b; - case 5: - return !this.c && (this.c = new Yie(E4, this, 5, 8)), this.c; - case 6: - return !this.a && (this.a = new C5d(F4, this, 6, 6)), this.a; - case 7: - return Geb(), !this.b && (this.b = new Yie(E4, this, 4, 7)), this.b.i <= 1 && (!this.c && (this.c = new Yie(E4, this, 5, 8)), this.c.i <= 1) ? false : true; - case 8: - return Geb(), nzd(this) ? true : false; - case 9: - return Geb(), ozd(this) ? true : false; - case 10: - return Geb(), !this.b && (this.b = new Yie(E4, this, 4, 7)), this.b.i != 0 && (!this.c && (this.c = new Yie(E4, this, 5, 8)), this.c.i != 0) ? true : false; - } - return cyd(this, a, b, c2); - }; - _2.Sh = function uzd(a, b, c2) { - var d; - switch (b) { - case 3: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? jzd(this, c2) : this.Cb.Th(this, -1 - d, null, c2))); - return izd(this, RD(a, 27), c2); - case 4: - return !this.b && (this.b = new Yie(E4, this, 4, 7)), qLd(this.b, a, c2); - case 5: - return !this.c && (this.c = new Yie(E4, this, 5, 8)), qLd(this.c, a, c2); - case 6: - return !this.a && (this.a = new C5d(F4, this, 6, 6)), qLd(this.a, a, c2); - } - return dyd(this, a, b, c2); - }; - _2.Uh = function vzd(a, b, c2) { - switch (b) { - case 3: - return izd(this, null, c2); - case 4: - return !this.b && (this.b = new Yie(E4, this, 4, 7)), rLd(this.b, a, c2); - case 5: - return !this.c && (this.c = new Yie(E4, this, 5, 8)), rLd(this.c, a, c2); - case 6: - return !this.a && (this.a = new C5d(F4, this, 6, 6)), rLd(this.a, a, c2); - } - return eyd(this, a, b, c2); - }; - _2.Wh = function wzd(a) { - switch (a) { - case 3: - return !!kzd(this); - case 4: - return !!this.b && this.b.i != 0; - case 5: - return !!this.c && this.c.i != 0; - case 6: - return !!this.a && this.a.i != 0; - case 7: - return !this.b && (this.b = new Yie(E4, this, 4, 7)), !(this.b.i <= 1 && (!this.c && (this.c = new Yie(E4, this, 5, 8)), this.c.i <= 1)); - case 8: - return nzd(this); - case 9: - return ozd(this); - case 10: - return !this.b && (this.b = new Yie(E4, this, 4, 7)), this.b.i != 0 && (!this.c && (this.c = new Yie(E4, this, 5, 8)), this.c.i != 0); - } - return fyd(this, a); - }; - _2.bi = function xzd(a, b) { - switch (a) { - case 3: - pzd(this, RD(b, 27)); - return; - case 4: - !this.b && (this.b = new Yie(E4, this, 4, 7)); - sLd(this.b); - !this.b && (this.b = new Yie(E4, this, 4, 7)); - YGd(this.b, RD(b, 16)); - return; - case 5: - !this.c && (this.c = new Yie(E4, this, 5, 8)); - sLd(this.c); - !this.c && (this.c = new Yie(E4, this, 5, 8)); - YGd(this.c, RD(b, 16)); - return; - case 6: - !this.a && (this.a = new C5d(F4, this, 6, 6)); - sLd(this.a); - !this.a && (this.a = new C5d(F4, this, 6, 6)); - YGd(this.a, RD(b, 16)); - return; - } - gyd(this, a, b); - }; - _2.ii = function yzd() { - return pvd(), gvd; - }; - _2.ki = function zzd(a) { - switch (a) { - case 3: - pzd(this, null); - return; - case 4: - !this.b && (this.b = new Yie(E4, this, 4, 7)); - sLd(this.b); - return; - case 5: - !this.c && (this.c = new Yie(E4, this, 5, 8)); - sLd(this.c); - return; - case 6: - !this.a && (this.a = new C5d(F4, this, 6, 6)); - sLd(this.a); - return; - } - hyd(this, a); - }; - _2.Ib = function Azd() { - return qzd(this); - }; - sfb(THe, "ElkEdgeImpl", 326); - feb(452, 2083, { 110: 1, 342: 1, 166: 1, 452: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }, Rzd); - _2.Ah = function Szd(a) { - return Czd(this, a); - }; - _2.Lh = function Tzd(a, b, c2) { - switch (a) { - case 1: - return this.j; - case 2: - return this.k; - case 3: - return this.b; - case 4: - return this.c; - case 5: - return !this.a && (this.a = new XZd(D4, this, 5)), this.a; - case 6: - return Fzd(this); - case 7: - if (b) - return Ezd(this); - return this.i; - case 8: - if (b) - return Dzd(this); - return this.f; - case 9: - return !this.g && (this.g = new Yie(F4, this, 9, 10)), this.g; - case 10: - return !this.e && (this.e = new Yie(F4, this, 10, 9)), this.e; - case 11: - return this.d; - } - return Axd(this, a, b, c2); - }; - _2.Sh = function Uzd(a, b, c2) { - var d, e, f2; - switch (b) { - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? Czd(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return Bzd(this, RD(a, 74), c2); - case 9: - return !this.g && (this.g = new Yie(F4, this, 9, 10)), qLd(this.g, a, c2); - case 10: - return !this.e && (this.e = new Yie(F4, this, 10, 9)), qLd(this.e, a, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (pvd(), hvd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((pvd(), hvd)), a, c2); - }; - _2.Uh = function Vzd(a, b, c2) { - switch (b) { - case 5: - return !this.a && (this.a = new XZd(D4, this, 5)), rLd(this.a, a, c2); - case 6: - return Bzd(this, null, c2); - case 9: - return !this.g && (this.g = new Yie(F4, this, 9, 10)), rLd(this.g, a, c2); - case 10: - return !this.e && (this.e = new Yie(F4, this, 10, 9)), rLd(this.e, a, c2); - } - return Bxd(this, a, b, c2); - }; - _2.Wh = function Wzd(a) { - switch (a) { - case 1: - return this.j != 0; - case 2: - return this.k != 0; - case 3: - return this.b != 0; - case 4: - return this.c != 0; - case 5: - return !!this.a && this.a.i != 0; - case 6: - return !!Fzd(this); - case 7: - return !!this.i; - case 8: - return !!this.f; - case 9: - return !!this.g && this.g.i != 0; - case 10: - return !!this.e && this.e.i != 0; - case 11: - return this.d != null; - } - return Cxd(this, a); - }; - _2.bi = function Xzd(a, b) { - switch (a) { - case 1: - Ozd(this, Kfb(UD(b))); - return; - case 2: - Pzd(this, Kfb(UD(b))); - return; - case 3: - Hzd(this, Kfb(UD(b))); - return; - case 4: - Izd(this, Kfb(UD(b))); - return; - case 5: - !this.a && (this.a = new XZd(D4, this, 5)); - sLd(this.a); - !this.a && (this.a = new XZd(D4, this, 5)); - YGd(this.a, RD(b, 16)); - return; - case 6: - Mzd(this, RD(b, 74)); - return; - case 7: - Lzd(this, RD(b, 84)); - return; - case 8: - Kzd(this, RD(b, 84)); - return; - case 9: - !this.g && (this.g = new Yie(F4, this, 9, 10)); - sLd(this.g); - !this.g && (this.g = new Yie(F4, this, 9, 10)); - YGd(this.g, RD(b, 16)); - return; - case 10: - !this.e && (this.e = new Yie(F4, this, 10, 9)); - sLd(this.e); - !this.e && (this.e = new Yie(F4, this, 10, 9)); - YGd(this.e, RD(b, 16)); - return; - case 11: - Jzd(this, WD(b)); - return; - } - Dxd(this, a, b); - }; - _2.ii = function Yzd() { - return pvd(), hvd; - }; - _2.ki = function Zzd(a) { - switch (a) { - case 1: - Ozd(this, 0); - return; - case 2: - Pzd(this, 0); - return; - case 3: - Hzd(this, 0); - return; - case 4: - Izd(this, 0); - return; - case 5: - !this.a && (this.a = new XZd(D4, this, 5)); - sLd(this.a); - return; - case 6: - Mzd(this, null); - return; - case 7: - Lzd(this, null); - return; - case 8: - Kzd(this, null); - return; - case 9: - !this.g && (this.g = new Yie(F4, this, 9, 10)); - sLd(this.g); - return; - case 10: - !this.e && (this.e = new Yie(F4, this, 10, 9)); - sLd(this.e); - return; - case 11: - Jzd(this, null); - return; - } - Exd(this, a); - }; - _2.Ib = function $zd() { - return Qzd(this); - }; - _2.b = 0; - _2.c = 0; - _2.d = null; - _2.j = 0; - _2.k = 0; - sfb(THe, "ElkEdgeSectionImpl", 452); - feb(158, 120, { 110: 1, 94: 1, 93: 1, 155: 1, 58: 1, 114: 1, 54: 1, 99: 1, 158: 1, 119: 1, 120: 1 }); - _2.Lh = function cAd(a, b, c2) { - var d; - if (a == 0) { - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - } - return zvd(this, a - AYd(this.ii()), vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), a), b, c2); - }; - _2.Sh = function dAd(a, b, c2) { - var d, e; - if (b == 0) { - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), b), 69), e.wk().zk(this, Wwd(this), b - AYd(this.ii()), a, c2); - }; - _2.Uh = function eAd(a, b, c2) { - var d, e; - if (b == 0) { - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd(this.ii()), a, c2); - }; - _2.Wh = function fAd(a) { - var b; - if (a == 0) { - return !!this.Ab && this.Ab.i != 0; - } - return Avd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.Zh = function gAd(a) { - return _zd(this, a); - }; - _2.bi = function hAd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - } - Bvd(this, a - AYd(this.ii()), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? this.ii() : c2), a), b); - }; - _2.di = function iAd(a) { - $wd(this, 128, a); - }; - _2.ii = function jAd() { - return JTd(), xTd; - }; - _2.ki = function kAd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - } - Cvd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.pi = function lAd() { - this.Bb |= 1; - }; - _2.qi = function mAd(a) { - return bAd(this, a); - }; - _2.Bb = 0; - sfb(SHe, "EModelElementImpl", 158); - feb(720, 158, { 110: 1, 94: 1, 93: 1, 480: 1, 155: 1, 58: 1, 114: 1, 54: 1, 99: 1, 158: 1, 119: 1, 120: 1 }, yAd); - _2.ri = function zAd(a, b) { - return tAd(this, a, b); - }; - _2.si = function AAd(a) { - var b, c2, d, e, f2; - if (this.a != BXd(a) || (a.Bb & 256) != 0) { - throw Adb(new agb(ZHe + a.zb + WHe)); - } - for (d = zYd(a); tYd(d.a).i != 0; ) { - c2 = RD(N_d(d, 0, (b = RD(QHd(tYd(d.a), 0), 89), f2 = b.c, ZD(f2, 90) ? RD(f2, 29) : (JTd(), zTd))), 29); - if (DXd(c2)) { - e = BXd(c2).wi().si(c2); - RD(e, 54).ci(a); - return e; - } - d = zYd(c2); - } - return (a.D != null ? a.D : a.B) == "java.util.Map$Entry" ? new LUd(a) : new zUd(a); - }; - _2.ti = function BAd(a, b) { - return uAd(this, a, b); - }; - _2.Lh = function CAd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.a; - } - return zvd(this, a - AYd((JTd(), uTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? uTd : d), a), b, c2); - }; - _2.Sh = function DAd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 1: - !!this.a && (c2 = RD(this.a, 54).Th(this, 4, t7, c2)); - return rAd(this, RD(a, 241), c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), uTd) : d), b), 69), e.wk().zk(this, Wwd(this), b - AYd((JTd(), uTd)), a, c2); - }; - _2.Uh = function EAd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 1: - return rAd(this, null, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), uTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), uTd)), a, c2); - }; - _2.Wh = function FAd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return !!this.a; - } - return Avd(this, a - AYd((JTd(), uTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? uTd : b), a)); - }; - _2.bi = function GAd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - wAd(this, RD(b, 241)); - return; - } - Bvd(this, a - AYd((JTd(), uTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? uTd : c2), a), b); - }; - _2.ii = function HAd() { - return JTd(), uTd; - }; - _2.ki = function IAd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - wAd(this, null); - return; - } - Cvd(this, a - AYd((JTd(), uTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? uTd : b), a)); - }; - var nAd, oAd, pAd; - sfb(SHe, "EFactoryImpl", 720); - feb(1037, 720, { 110: 1, 2113: 1, 94: 1, 93: 1, 480: 1, 155: 1, 58: 1, 114: 1, 54: 1, 99: 1, 158: 1, 119: 1, 120: 1 }, KAd); - _2.ri = function LAd(a, b) { - switch (a.hk()) { - case 12: - return RD(b, 149).Pg(); - case 13: - return jeb(b); - default: - throw Adb(new agb(VHe + a.xe() + WHe)); - } - }; - _2.si = function MAd(a) { - var b, c2, d, e, f2, g, h, i2; - switch (a.G == -1 && (a.G = (b = BXd(a), b ? fZd(b.vi(), a) : -1)), a.G) { - case 4: - return f2 = new hCd(), f2; - case 6: - return g = new ACd(), g; - case 7: - return h = new PCd(), h; - case 8: - return d = new rzd(), d; - case 9: - return c2 = new Xxd(), c2; - case 10: - return e = new Rzd(), e; - case 11: - return i2 = new _Cd(), i2; - default: - throw Adb(new agb(ZHe + a.zb + WHe)); - } - }; - _2.ti = function NAd(a, b) { - switch (a.hk()) { - case 13: - case 12: - return null; - default: - throw Adb(new agb(VHe + a.xe() + WHe)); - } - }; - sfb(THe, "ElkGraphFactoryImpl", 1037); - feb(448, 158, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 114: 1, 54: 1, 99: 1, 158: 1, 119: 1, 120: 1 }); - _2.Gh = function RAd() { - var a, b; - b = (a = RD(Ywd(this, 16), 29), P$d(rYd(!a ? this.ii() : a))); - return b == null ? (N2d(), N2d(), M2d) : new e3d(this, b); - }; - _2.Lh = function SAd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.xe(); - } - return zvd(this, a - AYd(this.ii()), vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), a), b, c2); - }; - _2.Wh = function TAd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - } - return Avd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.bi = function UAd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - this.ui(WD(b)); - return; - } - Bvd(this, a - AYd(this.ii()), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? this.ii() : c2), a), b); - }; - _2.ii = function VAd() { - return JTd(), yTd; - }; - _2.ki = function WAd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - this.ui(null); - return; - } - Cvd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.xe = function XAd() { - return this.zb; - }; - _2.ui = function YAd(a) { - PAd(this, a); - }; - _2.Ib = function ZAd() { - return QAd(this); - }; - _2.zb = null; - sfb(SHe, "ENamedElementImpl", 448); - feb(184, 448, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 241: 1, 114: 1, 54: 1, 99: 1, 158: 1, 184: 1, 119: 1, 120: 1, 690: 1 }, EBd); - _2.Ah = function GBd(a) { - return qBd(this, a); - }; - _2.Lh = function HBd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.yb; - case 3: - return this.xb; - case 4: - return this.sb; - case 5: - return !this.rb && (this.rb = new J5d(this, i7, this)), this.rb; - case 6: - return !this.vb && (this.vb = new G5d(t7, this, 6, 7)), this.vb; - case 7: - if (b) - return this.Db >> 16 == 7 ? RD(this.Cb, 241) : null; - return gBd(this); - } - return zvd(this, a - AYd((JTd(), CTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? CTd : d), a), b, c2); - }; - _2.Sh = function IBd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 4: - !!this.sb && (c2 = RD(this.sb, 54).Th(this, 1, n7, c2)); - return hBd(this, RD(a, 480), c2); - case 5: - return !this.rb && (this.rb = new J5d(this, i7, this)), qLd(this.rb, a, c2); - case 6: - return !this.vb && (this.vb = new G5d(t7, this, 6, 7)), qLd(this.vb, a, c2); - case 7: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? qBd(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 7, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), CTd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((JTd(), CTd)), a, c2); - }; - _2.Uh = function JBd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 4: - return hBd(this, null, c2); - case 5: - return !this.rb && (this.rb = new J5d(this, i7, this)), rLd(this.rb, a, c2); - case 6: - return !this.vb && (this.vb = new G5d(t7, this, 6, 7)), rLd(this.vb, a, c2); - case 7: - return xvd(this, null, 7, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), CTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), CTd)), a, c2); - }; - _2.Wh = function KBd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return this.yb != null; - case 3: - return this.xb != null; - case 4: - return !!this.sb; - case 5: - return !!this.rb && this.rb.i != 0; - case 6: - return !!this.vb && this.vb.i != 0; - case 7: - return !!gBd(this); - } - return Avd(this, a - AYd((JTd(), CTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? CTd : b), a)); - }; - _2.Zh = function LBd(a) { - var b; - b = sBd(this, a); - return b ? b : _zd(this, a); - }; - _2.bi = function MBd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - PAd(this, WD(b)); - return; - case 2: - DBd(this, WD(b)); - return; - case 3: - CBd(this, WD(b)); - return; - case 4: - BBd(this, RD(b, 480)); - return; - case 5: - !this.rb && (this.rb = new J5d(this, i7, this)); - sLd(this.rb); - !this.rb && (this.rb = new J5d(this, i7, this)); - YGd(this.rb, RD(b, 16)); - return; - case 6: - !this.vb && (this.vb = new G5d(t7, this, 6, 7)); - sLd(this.vb); - !this.vb && (this.vb = new G5d(t7, this, 6, 7)); - YGd(this.vb, RD(b, 16)); - return; - } - Bvd(this, a - AYd((JTd(), CTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? CTd : c2), a), b); - }; - _2.ei = function NBd(a) { - var b, c2; - if (!!a && !!this.rb) { - for (c2 = new dMd(this.rb); c2.e != c2.i.gc(); ) { - b = bMd(c2); - ZD(b, 364) && (RD(b, 364).w = null); - } - } - $wd(this, 64, a); - }; - _2.ii = function OBd() { - return JTd(), CTd; - }; - _2.ki = function PBd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - PAd(this, null); - return; - case 2: - DBd(this, null); - return; - case 3: - CBd(this, null); - return; - case 4: - BBd(this, null); - return; - case 5: - !this.rb && (this.rb = new J5d(this, i7, this)); - sLd(this.rb); - return; - case 6: - !this.vb && (this.vb = new G5d(t7, this, 6, 7)); - sLd(this.vb); - return; - } - Cvd(this, a - AYd((JTd(), CTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? CTd : b), a)); - }; - _2.pi = function QBd() { - rBd(this); - }; - _2.vi = function RBd() { - return !this.rb && (this.rb = new J5d(this, i7, this)), this.rb; - }; - _2.wi = function SBd() { - return this.sb; - }; - _2.xi = function TBd() { - return this.ub; - }; - _2.yi = function UBd() { - return this.xb; - }; - _2.zi = function VBd() { - return this.yb; - }; - _2.Ai = function WBd(a) { - this.ub = a; - }; - _2.Ib = function XBd() { - var a; - if ((this.Db & 64) != 0) - return QAd(this); - a = new Shb(QAd(this)); - a.a += " (nsURI: "; - Nhb(a, this.yb); - a.a += ", nsPrefix: "; - Nhb(a, this.xb); - a.a += ")"; - return a.a; - }; - _2.xb = null; - _2.yb = null; - sfb(SHe, "EPackageImpl", 184); - feb(569, 184, { 110: 1, 2115: 1, 569: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 241: 1, 114: 1, 54: 1, 99: 1, 158: 1, 184: 1, 119: 1, 120: 1, 690: 1 }, _Bd); - _2.q = false; - _2.r = false; - var YBd = false; - sfb(THe, "ElkGraphPackageImpl", 569); - feb(366, 740, { 110: 1, 342: 1, 167: 1, 135: 1, 422: 1, 366: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }, hCd); - _2.Ah = function iCd(a) { - return cCd(this, a); - }; - _2.Lh = function jCd(a, b, c2) { - switch (a) { - case 7: - return dCd(this); - case 8: - return this.a; - } - return vyd(this, a, b, c2); - }; - _2.Sh = function kCd(a, b, c2) { - var d; - switch (b) { - case 7: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? cCd(this, c2) : this.Cb.Th(this, -1 - d, null, c2))); - return bCd(this, RD(a, 167), c2); - } - return dyd(this, a, b, c2); - }; - _2.Uh = function lCd(a, b, c2) { - if (b == 7) { - return bCd(this, null, c2); - } - return eyd(this, a, b, c2); - }; - _2.Wh = function mCd(a) { - switch (a) { - case 7: - return !!dCd(this); - case 8: - return !lhb("", this.a); - } - return wyd(this, a); - }; - _2.bi = function nCd(a, b) { - switch (a) { - case 7: - eCd(this, RD(b, 167)); - return; - case 8: - fCd(this, WD(b)); - return; - } - xyd(this, a, b); - }; - _2.ii = function oCd() { - return pvd(), jvd; - }; - _2.ki = function pCd(a) { - switch (a) { - case 7: - eCd(this, null); - return; - case 8: - fCd(this, ""); - return; - } - yyd(this, a); - }; - _2.Ib = function qCd() { - return gCd(this); - }; - _2.a = ""; - sfb(THe, "ElkLabelImpl", 366); - feb(207, 741, { 110: 1, 342: 1, 84: 1, 167: 1, 27: 1, 422: 1, 207: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }, ACd); - _2.Ah = function BCd(a) { - return sCd(this, a); - }; - _2.Lh = function CCd(a, b, c2) { - switch (a) { - case 9: - return !this.c && (this.c = new C5d(K4, this, 9, 9)), this.c; - case 10: - return !this.a && (this.a = new C5d(J4, this, 10, 11)), this.a; - case 11: - return vCd(this); - case 12: - return !this.b && (this.b = new C5d(G4, this, 12, 3)), this.b; - case 13: - return Geb(), !this.a && (this.a = new C5d(J4, this, 10, 11)), this.a.i > 0 ? true : false; - } - return Uyd(this, a, b, c2); - }; - _2.Sh = function DCd(a, b, c2) { - var d; - switch (b) { - case 9: - return !this.c && (this.c = new C5d(K4, this, 9, 9)), qLd(this.c, a, c2); - case 10: - return !this.a && (this.a = new C5d(J4, this, 10, 11)), qLd(this.a, a, c2); - case 11: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? sCd(this, c2) : this.Cb.Th(this, -1 - d, null, c2))); - return rCd(this, RD(a, 27), c2); - case 12: - return !this.b && (this.b = new C5d(G4, this, 12, 3)), qLd(this.b, a, c2); - } - return Vyd(this, a, b, c2); - }; - _2.Uh = function ECd(a, b, c2) { - switch (b) { - case 9: - return !this.c && (this.c = new C5d(K4, this, 9, 9)), rLd(this.c, a, c2); - case 10: - return !this.a && (this.a = new C5d(J4, this, 10, 11)), rLd(this.a, a, c2); - case 11: - return rCd(this, null, c2); - case 12: - return !this.b && (this.b = new C5d(G4, this, 12, 3)), rLd(this.b, a, c2); - } - return Wyd(this, a, b, c2); - }; - _2.Wh = function FCd(a) { - switch (a) { - case 9: - return !!this.c && this.c.i != 0; - case 10: - return !!this.a && this.a.i != 0; - case 11: - return !!vCd(this); - case 12: - return !!this.b && this.b.i != 0; - case 13: - return !this.a && (this.a = new C5d(J4, this, 10, 11)), this.a.i > 0; - } - return Xyd(this, a); - }; - _2.bi = function GCd(a, b) { - switch (a) { - case 9: - !this.c && (this.c = new C5d(K4, this, 9, 9)); - sLd(this.c); - !this.c && (this.c = new C5d(K4, this, 9, 9)); - YGd(this.c, RD(b, 16)); - return; - case 10: - !this.a && (this.a = new C5d(J4, this, 10, 11)); - sLd(this.a); - !this.a && (this.a = new C5d(J4, this, 10, 11)); - YGd(this.a, RD(b, 16)); - return; - case 11: - yCd(this, RD(b, 27)); - return; - case 12: - !this.b && (this.b = new C5d(G4, this, 12, 3)); - sLd(this.b); - !this.b && (this.b = new C5d(G4, this, 12, 3)); - YGd(this.b, RD(b, 16)); - return; - } - Yyd(this, a, b); - }; - _2.ii = function HCd() { - return pvd(), kvd; - }; - _2.ki = function ICd(a) { - switch (a) { - case 9: - !this.c && (this.c = new C5d(K4, this, 9, 9)); - sLd(this.c); - return; - case 10: - !this.a && (this.a = new C5d(J4, this, 10, 11)); - sLd(this.a); - return; - case 11: - yCd(this, null); - return; - case 12: - !this.b && (this.b = new C5d(G4, this, 12, 3)); - sLd(this.b); - return; - } - Zyd(this, a); - }; - _2.Ib = function JCd() { - return zCd(this); - }; - sfb(THe, "ElkNodeImpl", 207); - feb(193, 741, { 110: 1, 342: 1, 84: 1, 167: 1, 123: 1, 422: 1, 193: 1, 96: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }, PCd); - _2.Ah = function QCd(a) { - return LCd(this, a); - }; - _2.Lh = function RCd(a, b, c2) { - if (a == 9) { - return MCd(this); - } - return Uyd(this, a, b, c2); - }; - _2.Sh = function SCd(a, b, c2) { - var d; - switch (b) { - case 9: - !!this.Cb && (c2 = (d = this.Db >> 16, d >= 0 ? LCd(this, c2) : this.Cb.Th(this, -1 - d, null, c2))); - return KCd(this, RD(a, 27), c2); - } - return Vyd(this, a, b, c2); - }; - _2.Uh = function TCd(a, b, c2) { - if (b == 9) { - return KCd(this, null, c2); - } - return Wyd(this, a, b, c2); - }; - _2.Wh = function UCd(a) { - if (a == 9) { - return !!MCd(this); - } - return Xyd(this, a); - }; - _2.bi = function VCd(a, b) { - switch (a) { - case 9: - NCd(this, RD(b, 27)); - return; - } - Yyd(this, a, b); - }; - _2.ii = function WCd() { - return pvd(), lvd; - }; - _2.ki = function XCd(a) { - switch (a) { - case 9: - NCd(this, null); - return; - } - Zyd(this, a); - }; - _2.Ib = function YCd() { - return OCd(this); - }; - sfb(THe, "ElkPortImpl", 193); - var O6 = ufb(sIe, "BasicEMap/Entry"); - feb(1122, 120, { 110: 1, 44: 1, 94: 1, 93: 1, 136: 1, 58: 1, 114: 1, 54: 1, 99: 1, 119: 1, 120: 1 }, _Cd); - _2.Fb = function fDd(a) { - return this === a; - }; - _2.ld = function hDd() { - return this.b; - }; - _2.Hb = function jDd() { - return kFb(this); - }; - _2.Di = function lDd(a) { - ZCd(this, RD(a, 149)); - }; - _2.Lh = function aDd(a, b, c2) { - switch (a) { - case 0: - return this.b; - case 1: - return this.c; - } - return Dvd(this, a, b, c2); - }; - _2.Wh = function bDd(a) { - switch (a) { - case 0: - return !!this.b; - case 1: - return this.c != null; - } - return Kvd(this, a); - }; - _2.bi = function cDd(a, b) { - switch (a) { - case 0: - ZCd(this, RD(b, 149)); - return; - case 1: - $Cd(this, b); - return; - } - Wvd(this, a, b); - }; - _2.ii = function dDd() { - return pvd(), mvd; - }; - _2.ki = function eDd(a) { - switch (a) { - case 0: - ZCd(this, null); - return; - case 1: - $Cd(this, null); - return; - } - $vd(this, a); - }; - _2.Bi = function gDd() { - var a; - if (this.a == -1) { - a = this.b; - this.a = !a ? 0 : tb(a); - } - return this.a; - }; - _2.md = function iDd() { - return this.c; - }; - _2.Ci = function kDd(a) { - this.a = a; - }; - _2.nd = function mDd(a) { - var b; - b = this.c; - $Cd(this, a); - return b; - }; - _2.Ib = function nDd() { - var a; - if ((this.Db & 64) != 0) - return awd(this); - a = new bib(); - Zhb(Zhb(Zhb(a, this.b ? this.b.Pg() : vve), SAe), Ghb(this.c)); - return a.a; - }; - _2.a = -1; - _2.c = null; - var X4 = sfb(THe, "ElkPropertyToValueMapEntryImpl", 1122); - feb(996, 1, {}, BDd); - sfb(vIe, "JsonAdapter", 996); - feb(216, 63, swe, CDd); - sfb(vIe, "JsonImportException", 216); - feb(868, 1, {}, IEd); - sfb(vIe, "JsonImporter", 868); - feb(903, 1, {}, JEd); - sfb(vIe, "JsonImporter/lambda$0$Type", 903); - feb(904, 1, {}, KEd); - sfb(vIe, "JsonImporter/lambda$1$Type", 904); - feb(912, 1, {}, LEd); - sfb(vIe, "JsonImporter/lambda$10$Type", 912); - feb(914, 1, {}, MEd); - sfb(vIe, "JsonImporter/lambda$11$Type", 914); - feb(915, 1, {}, NEd); - sfb(vIe, "JsonImporter/lambda$12$Type", 915); - feb(921, 1, {}, OEd); - sfb(vIe, "JsonImporter/lambda$13$Type", 921); - feb(920, 1, {}, PEd); - sfb(vIe, "JsonImporter/lambda$14$Type", 920); - feb(916, 1, {}, QEd); - sfb(vIe, "JsonImporter/lambda$15$Type", 916); - feb(917, 1, {}, REd); - sfb(vIe, "JsonImporter/lambda$16$Type", 917); - feb(918, 1, {}, SEd); - sfb(vIe, "JsonImporter/lambda$17$Type", 918); - feb(919, 1, {}, TEd); - sfb(vIe, "JsonImporter/lambda$18$Type", 919); - feb(924, 1, {}, UEd); - sfb(vIe, "JsonImporter/lambda$19$Type", 924); - feb(905, 1, {}, VEd); - sfb(vIe, "JsonImporter/lambda$2$Type", 905); - feb(922, 1, {}, WEd); - sfb(vIe, "JsonImporter/lambda$20$Type", 922); - feb(923, 1, {}, XEd); - sfb(vIe, "JsonImporter/lambda$21$Type", 923); - feb(927, 1, {}, YEd); - sfb(vIe, "JsonImporter/lambda$22$Type", 927); - feb(925, 1, {}, ZEd); - sfb(vIe, "JsonImporter/lambda$23$Type", 925); - feb(926, 1, {}, $Ed); - sfb(vIe, "JsonImporter/lambda$24$Type", 926); - feb(929, 1, {}, _Ed); - sfb(vIe, "JsonImporter/lambda$25$Type", 929); - feb(928, 1, {}, aFd); - sfb(vIe, "JsonImporter/lambda$26$Type", 928); - feb(930, 1, Qve, bFd); - _2.Cd = function cFd(a) { - _Dd(this.b, this.a, WD(a)); - }; - sfb(vIe, "JsonImporter/lambda$27$Type", 930); - feb(931, 1, Qve, dFd); - _2.Cd = function eFd(a) { - aEd(this.b, this.a, WD(a)); - }; - sfb(vIe, "JsonImporter/lambda$28$Type", 931); - feb(932, 1, {}, fFd); - sfb(vIe, "JsonImporter/lambda$29$Type", 932); - feb(908, 1, {}, gFd); - sfb(vIe, "JsonImporter/lambda$3$Type", 908); - feb(933, 1, {}, hFd); - sfb(vIe, "JsonImporter/lambda$30$Type", 933); - feb(934, 1, {}, iFd); - sfb(vIe, "JsonImporter/lambda$31$Type", 934); - feb(935, 1, {}, jFd); - sfb(vIe, "JsonImporter/lambda$32$Type", 935); - feb(936, 1, {}, kFd); - sfb(vIe, "JsonImporter/lambda$33$Type", 936); - feb(937, 1, {}, lFd); - sfb(vIe, "JsonImporter/lambda$34$Type", 937); - feb(870, 1, {}, nFd); - sfb(vIe, "JsonImporter/lambda$35$Type", 870); - feb(941, 1, {}, pFd); - sfb(vIe, "JsonImporter/lambda$36$Type", 941); - feb(938, 1, Qve, qFd); - _2.Cd = function rFd(a) { - jEd(this.a, RD(a, 377)); - }; - sfb(vIe, "JsonImporter/lambda$37$Type", 938); - feb(939, 1, Qve, sFd); - _2.Cd = function tFd(a) { - kEd(this.a, this.b, RD(a, 166)); - }; - sfb(vIe, "JsonImporter/lambda$38$Type", 939); - feb(940, 1, Qve, uFd); - _2.Cd = function vFd(a) { - lEd(this.a, this.b, RD(a, 166)); - }; - sfb(vIe, "JsonImporter/lambda$39$Type", 940); - feb(906, 1, {}, wFd); - sfb(vIe, "JsonImporter/lambda$4$Type", 906); - feb(942, 1, Qve, xFd); - _2.Cd = function yFd(a) { - mEd(this.a, RD(a, 8)); - }; - sfb(vIe, "JsonImporter/lambda$40$Type", 942); - feb(907, 1, {}, zFd); - sfb(vIe, "JsonImporter/lambda$5$Type", 907); - feb(911, 1, {}, AFd); - sfb(vIe, "JsonImporter/lambda$6$Type", 911); - feb(909, 1, {}, BFd); - sfb(vIe, "JsonImporter/lambda$7$Type", 909); - feb(910, 1, {}, CFd); - sfb(vIe, "JsonImporter/lambda$8$Type", 910); - feb(913, 1, {}, DFd); - sfb(vIe, "JsonImporter/lambda$9$Type", 913); - feb(961, 1, Qve, MFd); - _2.Cd = function NFd(a) { - oDd(this.a, new OC(WD(a))); - }; - sfb(vIe, "JsonMetaDataConverter/lambda$0$Type", 961); - feb(962, 1, Qve, OFd); - _2.Cd = function PFd(a) { - IFd(this.a, RD(a, 245)); - }; - sfb(vIe, "JsonMetaDataConverter/lambda$1$Type", 962); - feb(963, 1, Qve, QFd); - _2.Cd = function RFd(a) { - JFd(this.a, RD(a, 143)); - }; - sfb(vIe, "JsonMetaDataConverter/lambda$2$Type", 963); - feb(964, 1, Qve, SFd); - _2.Cd = function TFd(a) { - KFd(this.a, RD(a, 170)); - }; - sfb(vIe, "JsonMetaDataConverter/lambda$3$Type", 964); - feb(245, 22, { 3: 1, 34: 1, 22: 1, 245: 1 }, bGd); - var UFd, VFd, WFd, XFd, YFd, ZFd, $Fd, _Fd; - var T5 = tfb(jze, "GraphFeature", 245, WI, dGd, cGd); - var eGd; - feb(11, 1, { 34: 1, 149: 1 }, jGd, kGd, lGd, mGd); - _2.Fd = function nGd(a) { - return gGd(this, RD(a, 149)); - }; - _2.Fb = function oGd(a) { - return hGd(this, a); - }; - _2.Sg = function pGd() { - return iGd(this); - }; - _2.Pg = function qGd() { - return this.b; - }; - _2.Hb = function rGd() { - return ohb(this.b); - }; - _2.Ib = function sGd() { - return this.b; - }; - sfb(jze, "Property", 11); - feb(671, 1, fye, uGd); - _2.Ne = function vGd(a, b) { - return tGd(this, RD(a, 96), RD(b, 96)); - }; - _2.Fb = function wGd(a) { - return this === a; - }; - _2.Oe = function xGd() { - return new Frb(this); - }; - sfb(jze, "PropertyHolderComparator", 671); - feb(709, 1, Ave, QGd); - _2.Nb = function RGd(a) { - Ztb(this, a); - }; - _2.Pb = function TGd() { - return PGd(this); - }; - _2.Qb = function UGd() { - $tb(); - }; - _2.Ob = function SGd() { - return !!this.a; - }; - sfb(KIe, "ElkGraphUtil/AncestorIterator", 709); - var Y6 = ufb(sIe, "EList"); - feb(70, 56, { 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 70: 1, 61: 1 }); - _2.bd = function hHd(a, b) { - VGd(this, a, b); - }; - _2.Fc = function iHd(a) { - return WGd(this, a); - }; - _2.cd = function jHd(a, b) { - return XGd(this, a, b); - }; - _2.Gc = function kHd(a) { - return YGd(this, a); - }; - _2.Ii = function lHd() { - return new yMd(this); - }; - _2.Ji = function mHd() { - return new BMd(this); - }; - _2.Ki = function nHd(a) { - return ZGd(this, a); - }; - _2.Li = function oHd() { - return true; - }; - _2.Mi = function pHd(a, b) { - }; - _2.Ni = function qHd() { - }; - _2.Oi = function rHd(a, b) { - $Gd(this, a, b); - }; - _2.Pi = function sHd(a, b, c2) { - }; - _2.Qi = function tHd(a, b) { - }; - _2.Ri = function uHd(a, b, c2) { - }; - _2.Fb = function vHd(a) { - return _Gd(this, a); - }; - _2.Hb = function wHd() { - return cHd(this); - }; - _2.Si = function xHd() { - return false; - }; - _2.Kc = function yHd() { - return new dMd(this); - }; - _2.ed = function zHd() { - return new mMd(this); - }; - _2.fd = function AHd(a) { - var b; - b = this.gc(); - if (a < 0 || a > b) - throw Adb(new aMd(a, b)); - return new nMd(this, a); - }; - _2.Ui = function BHd(a, b) { - this.Ti(a, this.dd(b)); - }; - _2.Mc = function CHd(a) { - return dHd(this, a); - }; - _2.Wi = function DHd(a, b) { - return b; - }; - _2.hd = function EHd(a, b) { - return eHd(this, a, b); - }; - _2.Ib = function FHd() { - return fHd(this); - }; - _2.Yi = function GHd() { - return true; - }; - _2.Zi = function HHd(a, b) { - return gHd(this, b); - }; - sfb(sIe, "AbstractEList", 70); - feb(66, 70, PIe, YHd, ZHd, $Hd); - _2.Ei = function _Hd(a, b) { - return IHd(this, a, b); - }; - _2.Fi = function aId(a) { - return JHd(this, a); - }; - _2.Gi = function bId(a, b) { - KHd(this, a, b); - }; - _2.Hi = function cId(a) { - LHd(this, a); - }; - _2.$i = function dId(a) { - return NHd(this, a); - }; - _2.$b = function eId() { - OHd(this); - }; - _2.Hc = function fId(a) { - return PHd(this, a); - }; - _2.Xb = function gId(a) { - return QHd(this, a); - }; - _2._i = function hId(a) { - var b, c2, d; - ++this.j; - c2 = this.g == null ? 0 : this.g.length; - if (a > c2) { - d = this.g; - b = c2 + (c2 / 2 | 0) + 4; - b < a && (b = a); - this.g = this.aj(b); - d != null && hib(d, 0, this.g, 0, this.i); - } - }; - _2.dd = function iId(a) { - return RHd(this, a); - }; - _2.dc = function jId() { - return this.i == 0; - }; - _2.Ti = function kId(a, b) { - return SHd(this, a, b); - }; - _2.aj = function lId(a) { - return $C(jJ, rve, 1, a, 5, 1); - }; - _2.Vi = function mId(a) { - return this.g[a]; - }; - _2.gd = function nId(a) { - return THd(this, a); - }; - _2.Xi = function oId(a, b) { - return UHd(this, a, b); - }; - _2.gc = function pId() { - return this.i; - }; - _2.Pc = function qId() { - return WHd(this); - }; - _2.Qc = function rId(a) { - return XHd(this, a); - }; - _2.i = 0; - var D6 = sfb(sIe, "BasicEList", 66); - var a7 = ufb(sIe, "TreeIterator"); - feb(708, 66, QIe); - _2.Nb = function vId(a) { - Ztb(this, a); - }; - _2.Ob = function wId() { - return this.g == null && !this.c ? sId(this) : this.g == null || this.i != 0 && RD(this.g[this.i - 1], 51).Ob(); - }; - _2.Pb = function xId() { - return tId(this); - }; - _2.Qb = function yId() { - if (!this.e) { - throw Adb(new dgb("There is no valid object to remove.")); - } - this.e.Qb(); - }; - _2.c = false; - sfb(sIe, "AbstractTreeIterator", 708); - feb(700, 708, QIe, zId); - _2.bj = function AId(a) { - var b; - b = RD(a, 58).Gh().Kc(); - ZD(b, 287) && RD(b, 287).wl(new BId()); - return b; - }; - sfb(KIe, "ElkGraphUtil/PropertiesSkippingTreeIterator", 700); - feb(965, 1, {}, BId); - sfb(KIe, "ElkGraphUtil/PropertiesSkippingTreeIterator/1", 965); - var CId, DId; - var b6 = sfb(KIe, "ElkReflect", null); - feb(901, 1, CGe, JId); - _2.Rg = function KId(a) { - return EId(), Asb(RD(a, 181)); - }; - sfb(KIe, "ElkReflect/lambda$0$Type", 901); - var LId; - ufb(sIe, "ResourceLocator"); - feb(1065, 1, {}); - sfb(sIe, "DelegatingResourceLocator", 1065); - feb(1066, 1065, {}); - sfb("org.eclipse.emf.common", "EMFPlugin", 1066); - var d6 = ufb(DJe, "Adapter"); - var e6 = ufb(DJe, "Notification"); - feb(1174, 1, EJe); - _2.cj = function VId() { - return this.d; - }; - _2.dj = function WId(a) { - }; - _2.ej = function XId(a) { - this.d = a; - }; - _2.fj = function YId(a) { - this.d == a && (this.d = null); - }; - _2.d = null; - sfb(JHe, "AdapterImpl", 1174); - feb(2093, 70, FJe); - _2.Ei = function dJd(a, b) { - return ZId(this, a, b); - }; - _2.Fi = function eJd(a) { - var b, c2, d; - ++this.j; - if (a.dc()) { - return false; - } else { - b = this.Ej(); - for (d = a.Kc(); d.Ob(); ) { - c2 = d.Pb(); - this.rj(this.Zi(b, c2)); - ++b; - } - return true; - } - }; - _2.Gi = function fJd(a, b) { - $Id(this, a, b); - }; - _2.Hi = function gJd(a) { - _Id(this, a); - }; - _2.pj = function hJd() { - return this.sj(); - }; - _2.$b = function iJd() { - aJd(this, this.Ej(), this.Fj()); - }; - _2.Hc = function jJd(a) { - return this.uj(a); - }; - _2.Ic = function kJd(a) { - return this.vj(a); - }; - _2.qj = function lJd(a, b) { - this.Bj().Um(); - }; - _2.rj = function mJd(a) { - this.Bj().Um(); - }; - _2.sj = function nJd() { - return this.Bj(); - }; - _2.tj = function oJd() { - this.Bj().Um(); - }; - _2.uj = function pJd(a) { - return this.Bj().Um(); - }; - _2.vj = function qJd(a) { - return this.Bj().Um(); - }; - _2.wj = function rJd(a) { - return this.Bj().Um(); - }; - _2.xj = function sJd(a) { - return this.Bj().Um(); - }; - _2.yj = function tJd() { - return this.Bj().Um(); - }; - _2.zj = function uJd(a) { - return this.Bj().Um(); - }; - _2.Aj = function vJd() { - return this.Bj().Um(); - }; - _2.Cj = function wJd(a) { - return this.Bj().Um(); - }; - _2.Dj = function xJd(a, b) { - return this.Bj().Um(); - }; - _2.Ej = function yJd() { - return this.Bj().Um(); - }; - _2.Fj = function zJd() { - return this.Bj().Um(); - }; - _2.Gj = function AJd(a) { - return this.Bj().Um(); - }; - _2.Hj = function BJd() { - return this.Bj().Um(); - }; - _2.Fb = function CJd(a) { - return this.wj(a); - }; - _2.Xb = function DJd(a) { - return this.Wi(a, this.xj(a)); - }; - _2.Hb = function EJd() { - return this.yj(); - }; - _2.dd = function FJd(a) { - return this.zj(a); - }; - _2.dc = function GJd() { - return this.Aj(); - }; - _2.Ti = function HJd(a, b) { - return bJd(this, a, b); - }; - _2.Vi = function IJd(a) { - return this.xj(a); - }; - _2.gd = function JJd(a) { - return cJd(this, a); - }; - _2.Mc = function KJd(a) { - var b; - b = this.dd(a); - if (b >= 0) { - this.gd(b); - return true; - } else { - return false; - } - }; - _2.Xi = function LJd(a, b) { - return this.Dj(a, this.Zi(a, b)); - }; - _2.gc = function MJd() { - return this.Ej(); - }; - _2.Pc = function NJd() { - return this.Fj(); - }; - _2.Qc = function OJd(a) { - return this.Gj(a); - }; - _2.Ib = function PJd() { - return this.Hj(); - }; - sfb(sIe, "DelegatingEList", 2093); - feb(2094, 2093, FJe); - _2.Ei = function XJd(a, b) { - return QJd(this, a, b); - }; - _2.Fi = function YJd(a) { - return this.Ei(this.Ej(), a); - }; - _2.Gi = function ZJd(a, b) { - RJd(this, a, b); - }; - _2.Hi = function $Jd(a) { - SJd(this, a); - }; - _2.Li = function _Jd() { - return !this.Mj(); - }; - _2.$b = function aKd() { - VJd(this); - }; - _2.Ij = function bKd(a, b, c2, d, e) { - return new aLd(this, a, b, c2, d, e); - }; - _2.Jj = function cKd(a) { - qvd(this.jj(), a); - }; - _2.Kj = function dKd() { - return null; - }; - _2.Lj = function eKd() { - return -1; - }; - _2.jj = function fKd() { - return null; - }; - _2.Mj = function gKd() { - return false; - }; - _2.Nj = function hKd(a, b) { - return b; - }; - _2.Oj = function iKd(a, b) { - return b; - }; - _2.Pj = function jKd() { - return false; - }; - _2.Qj = function kKd() { - return !this.Aj(); - }; - _2.Ti = function lKd(a, b) { - var c2, d; - if (this.Pj()) { - d = this.Qj(); - c2 = bJd(this, a, b); - this.Jj(this.Ij(7, sgb(b), c2, a, d)); - return c2; - } else { - return bJd(this, a, b); - } - }; - _2.gd = function mKd(a) { - var b, c2, d, e; - if (this.Pj()) { - c2 = null; - d = this.Qj(); - b = this.Ij(4, e = cJd(this, a), null, a, d); - if (this.Mj() && !!e) { - c2 = this.Oj(e, c2); - if (!c2) { - this.Jj(b); - } else { - c2.nj(b); - c2.oj(); - } - } else { - if (!c2) { - this.Jj(b); - } else { - c2.nj(b); - c2.oj(); - } - } - return e; - } else { - e = cJd(this, a); - if (this.Mj() && !!e) { - c2 = this.Oj(e, null); - !!c2 && c2.oj(); - } - return e; - } - }; - _2.Xi = function nKd(a, b) { - return WJd(this, a, b); - }; - sfb(JHe, "DelegatingNotifyingListImpl", 2094); - feb(152, 1, GJe); - _2.nj = function PKd(a) { - return oKd(this, a); - }; - _2.oj = function QKd() { - pKd(this); - }; - _2.gj = function RKd() { - return this.d; - }; - _2.Kj = function SKd() { - return null; - }; - _2.Rj = function TKd() { - return null; - }; - _2.hj = function UKd(a) { - return -1; - }; - _2.ij = function VKd() { - return yKd(this); - }; - _2.jj = function WKd() { - return null; - }; - _2.kj = function XKd() { - return HKd(this); - }; - _2.lj = function YKd() { - return this.o < 0 ? this.o < -2 ? -2 - this.o - 1 : -1 : this.o; - }; - _2.Sj = function ZKd() { - return false; - }; - _2.mj = function $Kd(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l; - switch (this.d) { - case 1: - case 2: { - e = a.gj(); - switch (e) { - case 1: - case 2: { - f2 = a.jj(); - if (dE(f2) === dE(this.jj()) && this.hj(null) == a.hj(null)) { - this.g = a.ij(); - a.gj() == 1 && (this.d = 1); - return true; - } - } - } - } - case 4: { - e = a.gj(); - switch (e) { - case 4: { - f2 = a.jj(); - if (dE(f2) === dE(this.jj()) && this.hj(null) == a.hj(null)) { - j = JKd(this); - i2 = this.o < 0 ? this.o < -2 ? -2 - this.o - 1 : -1 : this.o; - g = a.lj(); - this.d = 6; - l = new ZHd(2); - if (i2 <= g) { - WGd(l, this.n); - WGd(l, a.kj()); - this.g = cD(WC(kE, 1), Pwe, 28, 15, [this.o = i2, g + 1]); - } else { - WGd(l, a.kj()); - WGd(l, this.n); - this.g = cD(WC(kE, 1), Pwe, 28, 15, [this.o = g, i2]); - } - this.n = l; - j || (this.o = -2 - this.o - 1); - return true; - } - break; - } - } - break; - } - case 6: { - e = a.gj(); - switch (e) { - case 4: { - f2 = a.jj(); - if (dE(f2) === dE(this.jj()) && this.hj(null) == a.hj(null)) { - j = JKd(this); - g = a.lj(); - k = RD(this.g, 53); - d = $C(kE, Pwe, 28, k.length + 1, 15, 1); - b = 0; - while (b < k.length) { - h = k[b]; - if (h <= g) { - d[b++] = h; - ++g; - } else { - break; - } - } - c2 = RD(this.n, 15); - c2.bd(b, a.kj()); - d[b] = g; - while (++b < d.length) { - d[b] = k[b - 1]; - } - this.g = d; - j || (this.o = -2 - d[0]); - return true; - } - break; - } - } - break; - } - } - return false; - }; - _2.Ib = function _Kd() { - var a, b, c2, d; - d = new Shb(nfb(this.Rm) + "@" + (b = tb(this) >>> 0, b.toString(16))); - d.a += " (eventType: "; - switch (this.d) { - case 1: { - d.a += "SET"; - break; - } - case 2: { - d.a += "UNSET"; - break; - } - case 3: { - d.a += "ADD"; - break; - } - case 5: { - d.a += "ADD_MANY"; - break; - } - case 4: { - d.a += "REMOVE"; - break; - } - case 6: { - d.a += "REMOVE_MANY"; - break; - } - case 7: { - d.a += "MOVE"; - break; - } - case 8: { - d.a += "REMOVING_ADAPTER"; - break; - } - case 9: { - d.a += "RESOLVE"; - break; - } - default: { - Lhb(d, this.d); - break; - } - } - IKd(this) && (d.a += ", touch: true", d); - d.a += ", position: "; - Lhb(d, this.o < 0 ? this.o < -2 ? -2 - this.o - 1 : -1 : this.o); - d.a += ", notifier: "; - Mhb(d, this.jj()); - d.a += ", feature: "; - Mhb(d, this.Kj()); - d.a += ", oldValue: "; - Mhb(d, HKd(this)); - d.a += ", newValue: "; - if (this.d == 6 && ZD(this.g, 53)) { - c2 = RD(this.g, 53); - d.a += "["; - for (a = 0; a < c2.length; ) { - d.a += c2[a]; - ++a < c2.length && (d.a += pve, d); - } - d.a += "]"; - } else { - Mhb(d, yKd(this)); - } - d.a += ", isTouch: "; - Ohb(d, IKd(this)); - d.a += ", wasSet: "; - Ohb(d, JKd(this)); - d.a += ")"; - return d.a; - }; - _2.d = 0; - _2.e = 0; - _2.f = 0; - _2.j = 0; - _2.k = 0; - _2.o = 0; - _2.p = 0; - sfb(JHe, "NotificationImpl", 152); - feb(1188, 152, GJe, aLd); - _2.Kj = function bLd() { - return this.a.Kj(); - }; - _2.hj = function cLd(a) { - return this.a.Lj(); - }; - _2.jj = function dLd() { - return this.a.jj(); - }; - sfb(JHe, "DelegatingNotifyingListImpl/1", 1188); - feb(251, 66, PIe, fLd, gLd); - _2.Fc = function hLd(a) { - return eLd(this, RD(a, 378)); - }; - _2.nj = function iLd(a) { - return eLd(this, a); - }; - _2.oj = function jLd() { - var a, b, c2; - for (a = 0; a < this.i; ++a) { - b = RD(this.g[a], 378); - c2 = b.jj(); - c2 != null && b.gj() != -1 && RD(c2, 94).xh(b); - } - }; - _2.aj = function kLd(a) { - return $C(e6, rve, 378, a, 0, 1); - }; - sfb(JHe, "NotificationChainImpl", 251); - feb(1524, 93, IHe); - _2.uh = function lLd() { - return this.e; - }; - _2.wh = function mLd() { - return (this.f & 1) != 0; - }; - _2.f = 1; - sfb(JHe, "NotifierImpl", 1524); - feb(2091, 66, PIe); - _2.Ei = function yLd(a, b) { - return nLd(this, a, b); - }; - _2.Fi = function zLd(a) { - return this.Ei(this.i, a); - }; - _2.Gi = function ALd(a, b) { - oLd(this, a, b); - }; - _2.Hi = function BLd(a) { - pLd(this, a); - }; - _2.Li = function CLd() { - return !this.Mj(); - }; - _2.$b = function DLd() { - sLd(this); - }; - _2.Ij = function ELd(a, b, c2, d, e) { - return new VLd(this, a, b, c2, d, e); - }; - _2.Jj = function FLd(a) { - qvd(this.jj(), a); - }; - _2.Kj = function GLd() { - return null; - }; - _2.Lj = function HLd() { - return -1; - }; - _2.jj = function ILd() { - return null; - }; - _2.Mj = function JLd() { - return false; - }; - _2.Tj = function KLd() { - return false; - }; - _2.Nj = function LLd(a, b) { - return b; - }; - _2.Oj = function MLd(a, b) { - return b; - }; - _2.Pj = function NLd() { - return false; - }; - _2.Qj = function OLd() { - return this.i != 0; - }; - _2.Ti = function PLd(a, b) { - return uLd(this, a, b); - }; - _2.gd = function QLd(a) { - return vLd(this, a); - }; - _2.Xi = function RLd(a, b) { - return xLd(this, a, b); - }; - _2.Uj = function SLd(a, b) { - return b; - }; - _2.Vj = function TLd(a, b) { - return b; - }; - _2.Wj = function ULd(a, b, c2) { - return c2; - }; - sfb(JHe, "NotifyingListImpl", 2091); - feb(1187, 152, GJe, VLd); - _2.Kj = function WLd() { - return this.a.Kj(); - }; - _2.hj = function XLd(a) { - return this.a.Lj(); - }; - _2.jj = function YLd() { - return this.a.jj(); - }; - sfb(JHe, "NotifyingListImpl/1", 1187); - feb(966, 66, PIe, ZLd); - _2.Hc = function $Ld(a) { - if (this.i > 10) { - if (!this.b || this.c.j != this.a) { - this.b = new btb(this); - this.a = this.j; - } - return Zsb(this.b, a); - } else { - return PHd(this, a); - } - }; - _2.Yi = function _Ld() { - return true; - }; - _2.a = 0; - sfb(sIe, "AbstractEList/1", 966); - feb(302, 77, lxe, aMd); - sfb(sIe, "AbstractEList/BasicIndexOutOfBoundsException", 302); - feb(37, 1, Ave, dMd); - _2.Nb = function gMd(a) { - Ztb(this, a); - }; - _2.Xj = function eMd() { - if (this.i.j != this.f) { - throw Adb(new Jrb()); - } - }; - _2.Yj = function fMd() { - return bMd(this); - }; - _2.Ob = function hMd() { - return this.e != this.i.gc(); - }; - _2.Pb = function iMd() { - return this.Yj(); - }; - _2.Qb = function jMd() { - cMd(this); - }; - _2.e = 0; - _2.f = 0; - _2.g = -1; - sfb(sIe, "AbstractEList/EIterator", 37); - feb(286, 37, Jve, mMd, nMd); - _2.Qb = function vMd() { - cMd(this); - }; - _2.Rb = function oMd(a) { - kMd(this, a); - }; - _2.Zj = function pMd() { - var b; - try { - b = this.d.Xb(--this.e); - this.Xj(); - this.g = this.e; - return b; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - this.Xj(); - throw Adb(new Dvb()); - } else - throw Adb(a); - } - }; - _2.$j = function qMd(a) { - lMd(this, a); - }; - _2.Sb = function rMd() { - return this.e != 0; - }; - _2.Tb = function sMd() { - return this.e; - }; - _2.Ub = function tMd() { - return this.Zj(); - }; - _2.Vb = function uMd() { - return this.e - 1; - }; - _2.Wb = function wMd(a) { - this.$j(a); - }; - sfb(sIe, "AbstractEList/EListIterator", 286); - feb(355, 37, Ave, yMd); - _2.Yj = function zMd() { - return xMd(this); - }; - _2.Qb = function AMd() { - throw Adb(new jib()); - }; - sfb(sIe, "AbstractEList/NonResolvingEIterator", 355); - feb(398, 286, Jve, BMd, CMd); - _2.Rb = function DMd(a) { - throw Adb(new jib()); - }; - _2.Yj = function EMd() { - var b; - try { - b = this.c.Vi(this.e); - this.Xj(); - this.g = this.e++; - return b; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - this.Xj(); - throw Adb(new Dvb()); - } else - throw Adb(a); - } - }; - _2.Zj = function FMd() { - var b; - try { - b = this.c.Vi(--this.e); - this.Xj(); - this.g = this.e; - return b; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - this.Xj(); - throw Adb(new Dvb()); - } else - throw Adb(a); - } - }; - _2.Qb = function GMd() { - throw Adb(new jib()); - }; - _2.Wb = function HMd(a) { - throw Adb(new jib()); - }; - sfb(sIe, "AbstractEList/NonResolvingEListIterator", 398); - feb(2080, 70, JJe); - _2.Ei = function PMd(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m; - e = b.gc(); - if (e != 0) { - j = RD(Ywd(this.a, 4), 129); - k = j == null ? 0 : j.length; - m = k + e; - d = NMd(this, m); - l = k - a; - l > 0 && hib(j, a, d, a + e, l); - i2 = b.Kc(); - for (g = 0; g < e; ++g) { - h = i2.Pb(); - c2 = a + g; - LMd(d, c2, gHd(this, h)); - } - Bde(this, d); - for (f2 = 0; f2 < e; ++f2) { - h = d[a]; - this.Mi(a, h); - ++a; - } - return true; - } else { - ++this.j; - return false; - } - }; - _2.Fi = function QMd(a) { - var b, c2, d, e, f2, g, h, i2, j; - d = a.gc(); - if (d != 0) { - i2 = (c2 = RD(Ywd(this.a, 4), 129), c2 == null ? 0 : c2.length); - j = i2 + d; - b = NMd(this, j); - h = a.Kc(); - for (f2 = i2; f2 < j; ++f2) { - g = h.Pb(); - LMd(b, f2, gHd(this, g)); - } - Bde(this, b); - for (e = i2; e < j; ++e) { - g = b[e]; - this.Mi(e, g); - } - return true; - } else { - ++this.j; - return false; - } - }; - _2.Gi = function RMd(a, b) { - var c2, d, e, f2; - d = RD(Ywd(this.a, 4), 129); - e = d == null ? 0 : d.length; - c2 = NMd(this, e + 1); - f2 = gHd(this, b); - a != e && hib(d, a, c2, a + 1, e - a); - bD(c2, a, f2); - Bde(this, c2); - this.Mi(a, b); - }; - _2.Hi = function SMd(a) { - var b, c2, d; - d = (c2 = RD(Ywd(this.a, 4), 129), c2 == null ? 0 : c2.length); - b = NMd(this, d + 1); - LMd(b, d, gHd(this, a)); - Bde(this, b); - this.Mi(d, a); - }; - _2.Ii = function TMd() { - return new sNd(this); - }; - _2.Ji = function UMd() { - return new vNd(this); - }; - _2.Ki = function VMd(a) { - var b, c2; - c2 = (b = RD(Ywd(this.a, 4), 129), b == null ? 0 : b.length); - if (a < 0 || a > c2) - throw Adb(new aMd(a, c2)); - return new wNd(this, a); - }; - _2.$b = function WMd() { - var a, b; - ++this.j; - a = RD(Ywd(this.a, 4), 129); - b = a == null ? 0 : a.length; - Bde(this, null); - $Gd(this, b, a); - }; - _2.Hc = function XMd(a) { - var b, c2, d, e, f2; - b = RD(Ywd(this.a, 4), 129); - if (b != null) { - if (a != null) { - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - if (pb(a, c2)) { - return true; - } - } - } else { - for (d = b, e = 0, f2 = d.length; e < f2; ++e) { - c2 = d[e]; - if (dE(c2) === dE(a)) { - return true; - } - } - } - } - return false; - }; - _2.Xb = function YMd(a) { - var b, c2; - b = RD(Ywd(this.a, 4), 129); - c2 = b == null ? 0 : b.length; - if (a >= c2) - throw Adb(new aMd(a, c2)); - return b[a]; - }; - _2.dd = function ZMd(a) { - var b, c2, d; - b = RD(Ywd(this.a, 4), 129); - if (b != null) { - if (a != null) { - for (c2 = 0, d = b.length; c2 < d; ++c2) { - if (pb(a, b[c2])) { - return c2; - } - } - } else { - for (c2 = 0, d = b.length; c2 < d; ++c2) { - if (dE(b[c2]) === dE(a)) { - return c2; - } - } - } - } - return -1; - }; - _2.dc = function $Md() { - return RD(Ywd(this.a, 4), 129) == null; - }; - _2.Kc = function _Md() { - return new jNd(this); - }; - _2.ed = function aNd() { - return new nNd(this); - }; - _2.fd = function bNd(a) { - var b, c2; - c2 = (b = RD(Ywd(this.a, 4), 129), b == null ? 0 : b.length); - if (a < 0 || a > c2) - throw Adb(new aMd(a, c2)); - return new oNd(this, a); - }; - _2.Ti = function cNd(a, b) { - var c2, d, e; - c2 = MMd(this); - e = c2 == null ? 0 : c2.length; - if (a >= e) - throw Adb(new veb(MIe + a + NIe + e)); - if (b >= e) - throw Adb(new veb(OIe + b + NIe + e)); - d = c2[b]; - if (a != b) { - a < b ? hib(c2, a, c2, a + 1, b - a) : hib(c2, b + 1, c2, b, a - b); - bD(c2, a, d); - Bde(this, c2); - } - return d; - }; - _2.Vi = function dNd(a) { - return RD(Ywd(this.a, 4), 129)[a]; - }; - _2.gd = function eNd(a) { - return OMd(this, a); - }; - _2.Xi = function fNd(a, b) { - var c2, d; - c2 = MMd(this); - d = c2[a]; - LMd(c2, a, gHd(this, b)); - Bde(this, c2); - return d; - }; - _2.gc = function gNd() { - var a; - return a = RD(Ywd(this.a, 4), 129), a == null ? 0 : a.length; - }; - _2.Pc = function hNd() { - var a, b, c2; - a = RD(Ywd(this.a, 4), 129); - c2 = a == null ? 0 : a.length; - b = $C(d6, IJe, 424, c2, 0, 1); - c2 > 0 && hib(a, 0, b, 0, c2); - return b; - }; - _2.Qc = function iNd(a) { - var b, c2, d; - b = RD(Ywd(this.a, 4), 129); - d = b == null ? 0 : b.length; - if (d > 0) { - if (a.length < d) { - c2 = IMd(rb(a).c, d); - a = c2; - } - hib(b, 0, a, 0, d); - } - a.length > d && bD(a, d, null); - return a; - }; - var JMd; - sfb(sIe, "ArrayDelegatingEList", 2080); - feb(1051, 37, Ave, jNd); - _2.Xj = function kNd() { - if (this.b.j != this.f || dE(RD(Ywd(this.b.a, 4), 129)) !== dE(this.a)) { - throw Adb(new Jrb()); - } - }; - _2.Qb = function lNd() { - cMd(this); - this.a = RD(Ywd(this.b.a, 4), 129); - }; - sfb(sIe, "ArrayDelegatingEList/EIterator", 1051); - feb(722, 286, Jve, nNd, oNd); - _2.Xj = function pNd() { - if (this.b.j != this.f || dE(RD(Ywd(this.b.a, 4), 129)) !== dE(this.a)) { - throw Adb(new Jrb()); - } - }; - _2.$j = function qNd(a) { - lMd(this, a); - this.a = RD(Ywd(this.b.a, 4), 129); - }; - _2.Qb = function rNd() { - cMd(this); - this.a = RD(Ywd(this.b.a, 4), 129); - }; - sfb(sIe, "ArrayDelegatingEList/EListIterator", 722); - feb(1052, 355, Ave, sNd); - _2.Xj = function tNd() { - if (this.b.j != this.f || dE(RD(Ywd(this.b.a, 4), 129)) !== dE(this.a)) { - throw Adb(new Jrb()); - } - }; - sfb(sIe, "ArrayDelegatingEList/NonResolvingEIterator", 1052); - feb(723, 398, Jve, vNd, wNd); - _2.Xj = function xNd() { - if (this.b.j != this.f || dE(RD(Ywd(this.b.a, 4), 129)) !== dE(this.a)) { - throw Adb(new Jrb()); - } - }; - sfb(sIe, "ArrayDelegatingEList/NonResolvingEListIterator", 723); - feb(615, 302, lxe, yNd); - sfb(sIe, "BasicEList/BasicIndexOutOfBoundsException", 615); - feb(710, 66, PIe, zNd); - _2.bd = function ANd(a, b) { - throw Adb(new jib()); - }; - _2.Fc = function BNd(a) { - throw Adb(new jib()); - }; - _2.cd = function CNd(a, b) { - throw Adb(new jib()); - }; - _2.Gc = function DNd(a) { - throw Adb(new jib()); - }; - _2.$b = function ENd() { - throw Adb(new jib()); - }; - _2._i = function FNd(a) { - throw Adb(new jib()); - }; - _2.Kc = function GNd() { - return this.Ii(); - }; - _2.ed = function HNd() { - return this.Ji(); - }; - _2.fd = function INd(a) { - return this.Ki(a); - }; - _2.Ti = function JNd(a, b) { - throw Adb(new jib()); - }; - _2.Ui = function KNd(a, b) { - throw Adb(new jib()); - }; - _2.gd = function LNd(a) { - throw Adb(new jib()); - }; - _2.Mc = function MNd(a) { - throw Adb(new jib()); - }; - _2.hd = function NNd(a, b) { - throw Adb(new jib()); - }; - sfb(sIe, "BasicEList/UnmodifiableEList", 710); - feb(721, 1, { 3: 1, 20: 1, 16: 1, 15: 1, 61: 1, 597: 1 }); - _2.bd = function mOd(a, b) { - ONd(this, a, RD(b, 44)); - }; - _2.Fc = function nOd(a) { - return PNd(this, RD(a, 44)); - }; - _2.Jc = function vOd(a) { - xgb(this, a); - }; - _2.Xb = function wOd(a) { - return RD(QHd(this.c, a), 136); - }; - _2.Ti = function FOd(a, b) { - return RD(this.c.Ti(a, b), 44); - }; - _2.Ui = function GOd(a, b) { - eOd(this, a, RD(b, 44)); - }; - _2.Lc = function JOd() { - return new SDb(null, new Swb(this, 16)); - }; - _2.gd = function KOd(a) { - return RD(this.c.gd(a), 44); - }; - _2.hd = function MOd(a, b) { - return kOd(this, a, RD(b, 44)); - }; - _2.jd = function OOd(a) { - tvb(this, a); - }; - _2.Nc = function POd() { - return new Swb(this, 16); - }; - _2.Oc = function QOd() { - return new SDb(null, new Swb(this, 16)); - }; - _2.cd = function oOd(a, b) { - return this.c.cd(a, b); - }; - _2.Gc = function pOd(a) { - return this.c.Gc(a); - }; - _2.$b = function qOd() { - this.c.$b(); - }; - _2.Hc = function rOd(a) { - return this.c.Hc(a); - }; - _2.Ic = function sOd(a) { - return Be(this.c, a); - }; - _2._j = function tOd() { - var a, b, c2; - if (this.d == null) { - this.d = $C(D6, KJe, 66, 2 * this.f + 1, 0, 1); - c2 = this.e; - this.f = 0; - for (b = this.c.Kc(); b.e != b.i.gc(); ) { - a = RD(b.Yj(), 136); - UNd(this, a); - } - this.e = c2; - } - }; - _2.Fb = function uOd(a) { - return ZNd(this, a); - }; - _2.Hb = function xOd() { - return cHd(this.c); - }; - _2.dd = function yOd(a) { - return this.c.dd(a); - }; - _2.ak = function zOd() { - this.c = new YOd(this); - }; - _2.dc = function AOd() { - return this.f == 0; - }; - _2.Kc = function BOd() { - return this.c.Kc(); - }; - _2.ed = function COd() { - return this.c.ed(); - }; - _2.fd = function DOd(a) { - return this.c.fd(a); - }; - _2.bk = function EOd() { - return dOd(this); - }; - _2.ck = function HOd(a, b, c2) { - return new ZPd(a, b, c2); - }; - _2.dk = function IOd() { - return new cPd(); - }; - _2.Mc = function LOd(a) { - return hOd(this, a); - }; - _2.gc = function NOd() { - return this.f; - }; - _2.kd = function ROd(a, b) { - return new Rkb(this.c, a, b); - }; - _2.Pc = function SOd() { - return this.c.Pc(); - }; - _2.Qc = function TOd(a) { - return this.c.Qc(a); - }; - _2.Ib = function UOd() { - return fHd(this.c); - }; - _2.e = 0; - _2.f = 0; - sfb(sIe, "BasicEMap", 721); - feb(1046, 66, PIe, YOd); - _2.Mi = function ZOd(a, b) { - VOd(this, RD(b, 136)); - }; - _2.Pi = function _Od(a, b, c2) { - var d; - ++(d = this, RD(b, 136), d).a.e; - }; - _2.Qi = function aPd(a, b) { - WOd(this, RD(b, 136)); - }; - _2.Ri = function bPd(a, b, c2) { - XOd(this, RD(b, 136), RD(c2, 136)); - }; - _2.Oi = function $Od(a, b) { - TNd(this.a); - }; - sfb(sIe, "BasicEMap/1", 1046); - feb(1047, 66, PIe, cPd); - _2.aj = function dPd(a) { - return $C(N6, LJe, 621, a, 0, 1); - }; - sfb(sIe, "BasicEMap/2", 1047); - feb(1048, Eve, Fve, ePd); - _2.$b = function fPd() { - this.a.c.$b(); - }; - _2.Hc = function gPd(a) { - return QNd(this.a, a); - }; - _2.Kc = function hPd() { - return this.a.f == 0 ? (jQd(), iQd.a) : new DPd(this.a); - }; - _2.Mc = function iPd(a) { - var b; - b = this.a.f; - jOd(this.a, a); - return this.a.f != b; - }; - _2.gc = function jPd() { - return this.a.f; - }; - sfb(sIe, "BasicEMap/3", 1048); - feb(1049, 31, Dve, kPd); - _2.$b = function lPd() { - this.a.c.$b(); - }; - _2.Hc = function mPd(a) { - return RNd(this.a, a); - }; - _2.Kc = function nPd() { - return this.a.f == 0 ? (jQd(), iQd.a) : new FPd(this.a); - }; - _2.gc = function oPd() { - return this.a.f; - }; - sfb(sIe, "BasicEMap/4", 1049); - feb(1050, Eve, Fve, qPd); - _2.$b = function rPd() { - this.a.c.$b(); - }; - _2.Hc = function sPd(a) { - var b, c2, d, e, f2, g, h, i2, j; - if (this.a.f > 0 && ZD(a, 44)) { - this.a._j(); - i2 = RD(a, 44); - h = i2.ld(); - e = h == null ? 0 : tb(h); - f2 = bOd(this.a, e); - b = this.a.d[f2]; - if (b) { - c2 = RD(b.g, 379); - j = b.i; - for (g = 0; g < j; ++g) { - d = c2[g]; - if (d.Bi() == e && d.Fb(i2)) { - return true; - } - } - } - } - return false; - }; - _2.Kc = function tPd() { - return this.a.f == 0 ? (jQd(), iQd.a) : new xPd(this.a); - }; - _2.Mc = function uPd(a) { - return pPd(this, a); - }; - _2.gc = function vPd() { - return this.a.f; - }; - sfb(sIe, "BasicEMap/5", 1050); - feb(622, 1, Ave, xPd); - _2.Nb = function yPd(a) { - Ztb(this, a); - }; - _2.Ob = function zPd() { - return this.b != -1; - }; - _2.Pb = function APd() { - var a; - if (this.f.e != this.c) { - throw Adb(new Jrb()); - } - if (this.b == -1) { - throw Adb(new Dvb()); - } - this.d = this.a; - this.e = this.b; - wPd(this); - a = RD(this.f.d[this.d].g[this.e], 136); - return this.ek(a); - }; - _2.Qb = function BPd() { - if (this.f.e != this.c) { - throw Adb(new Jrb()); - } - if (this.e == -1) { - throw Adb(new cgb()); - } - this.f.c.Mc(QHd(this.f.d[this.d], this.e)); - this.c = this.f.e; - this.e = -1; - this.a == this.d && this.b != -1 && --this.b; - }; - _2.ek = function CPd(a) { - return a; - }; - _2.a = 0; - _2.b = -1; - _2.c = 0; - _2.d = 0; - _2.e = 0; - sfb(sIe, "BasicEMap/BasicEMapIterator", 622); - feb(1044, 622, Ave, DPd); - _2.ek = function EPd(a) { - return a.ld(); - }; - sfb(sIe, "BasicEMap/BasicEMapKeyIterator", 1044); - feb(1045, 622, Ave, FPd); - _2.ek = function GPd(a) { - return a.md(); - }; - sfb(sIe, "BasicEMap/BasicEMapValueIterator", 1045); - feb(1043, 1, Cve, IPd); - _2.wc = function OPd(a) { - Bvb(this, a); - }; - _2.yc = function TPd(a, b, c2) { - return Cvb(this, a, b, c2); - }; - _2.$b = function JPd() { - this.a.c.$b(); - }; - _2._b = function KPd(a) { - return HPd(this, a); - }; - _2.uc = function LPd(a) { - return RNd(this.a, a); - }; - _2.vc = function MPd() { - return YNd(this.a); - }; - _2.Fb = function NPd(a) { - return ZNd(this.a, a); - }; - _2.xc = function PPd(a) { - return $Nd(this.a, a); - }; - _2.Hb = function QPd() { - return cHd(this.a.c); - }; - _2.dc = function RPd() { - return this.a.f == 0; - }; - _2.ec = function SPd() { - return cOd(this.a); - }; - _2.zc = function UPd(a, b) { - return fOd(this.a, a, b); - }; - _2.Bc = function VPd(a) { - return jOd(this.a, a); - }; - _2.gc = function WPd() { - return this.a.f; - }; - _2.Ib = function XPd() { - return fHd(this.a.c); - }; - _2.Cc = function YPd() { - return lOd(this.a); - }; - sfb(sIe, "BasicEMap/DelegatingMap", 1043); - feb(621, 1, { 44: 1, 136: 1, 621: 1 }, ZPd); - _2.Fb = function $Pd(a) { - var b; - if (ZD(a, 44)) { - b = RD(a, 44); - return (this.b != null ? pb(this.b, b.ld()) : dE(this.b) === dE(b.ld())) && (this.c != null ? pb(this.c, b.md()) : dE(this.c) === dE(b.md())); - } else { - return false; - } - }; - _2.Bi = function _Pd() { - return this.a; - }; - _2.ld = function aQd() { - return this.b; - }; - _2.md = function bQd() { - return this.c; - }; - _2.Hb = function cQd() { - return this.a ^ (this.c == null ? 0 : tb(this.c)); - }; - _2.Ci = function dQd(a) { - this.a = a; - }; - _2.Di = function eQd(a) { - throw Adb(new xz()); - }; - _2.nd = function fQd(a) { - var b; - b = this.c; - this.c = a; - return b; - }; - _2.Ib = function gQd() { - return this.b + "->" + this.c; - }; - _2.a = 0; - var N6 = sfb(sIe, "BasicEMap/EntryImpl", 621); - feb(546, 1, {}, hQd); - sfb(sIe, "BasicEMap/View", 546); - var iQd; - feb(783, 1, {}); - _2.Fb = function xQd(a) { - return Rt((yob(), vob), a); - }; - _2.Hb = function yQd() { - return Cob((yob(), vob)); - }; - _2.Ib = function zQd() { - return Fe((yob(), vob)); - }; - sfb(sIe, "ECollections/BasicEmptyUnmodifiableEList", 783); - feb(1348, 1, Jve, AQd); - _2.Nb = function CQd(a) { - Ztb(this, a); - }; - _2.Rb = function BQd(a) { - throw Adb(new jib()); - }; - _2.Ob = function DQd() { - return false; - }; - _2.Sb = function EQd() { - return false; - }; - _2.Pb = function FQd() { - throw Adb(new Dvb()); - }; - _2.Tb = function GQd() { - return 0; - }; - _2.Ub = function HQd() { - throw Adb(new Dvb()); - }; - _2.Vb = function IQd() { - return -1; - }; - _2.Qb = function JQd() { - throw Adb(new jib()); - }; - _2.Wb = function KQd(a) { - throw Adb(new jib()); - }; - sfb(sIe, "ECollections/BasicEmptyUnmodifiableEList/1", 1348); - feb(1346, 783, { 20: 1, 16: 1, 15: 1, 61: 1 }, LQd); - _2.bd = function MQd(a, b) { - mQd(); - }; - _2.Fc = function NQd(a) { - return nQd(); - }; - _2.cd = function OQd(a, b) { - return oQd(); - }; - _2.Gc = function PQd(a) { - return pQd(); - }; - _2.$b = function QQd() { - qQd(); - }; - _2.Hc = function RQd(a) { - return false; - }; - _2.Ic = function SQd(a) { - return false; - }; - _2.Jc = function TQd(a) { - xgb(this, a); - }; - _2.Xb = function UQd(a) { - return Iob((yob(), a)), null; - }; - _2.dd = function VQd(a) { - return -1; - }; - _2.dc = function WQd() { - return true; - }; - _2.Kc = function XQd() { - return this.a; - }; - _2.ed = function YQd() { - return this.a; - }; - _2.fd = function ZQd(a) { - return this.a; - }; - _2.Ti = function $Qd(a, b) { - return rQd(); - }; - _2.Ui = function _Qd(a, b) { - sQd(); - }; - _2.Lc = function aRd() { - return new SDb(null, new Swb(this, 16)); - }; - _2.gd = function bRd(a) { - return tQd(); - }; - _2.Mc = function cRd(a) { - return uQd(); - }; - _2.hd = function dRd(a, b) { - return vQd(); - }; - _2.gc = function eRd() { - return 0; - }; - _2.jd = function fRd(a) { - tvb(this, a); - }; - _2.Nc = function gRd() { - return new Swb(this, 16); - }; - _2.Oc = function hRd() { - return new SDb(null, new Swb(this, 16)); - }; - _2.kd = function iRd(a, b) { - return yob(), new Rkb(vob, a, b); - }; - _2.Pc = function jRd() { - return De((yob(), vob)); - }; - _2.Qc = function kRd(a) { - return yob(), Ee(vob, a); - }; - sfb(sIe, "ECollections/EmptyUnmodifiableEList", 1346); - feb(1347, 783, { 20: 1, 16: 1, 15: 1, 61: 1, 597: 1 }, lRd); - _2.bd = function mRd(a, b) { - mQd(); - }; - _2.Fc = function nRd(a) { - return nQd(); - }; - _2.cd = function oRd(a, b) { - return oQd(); - }; - _2.Gc = function pRd(a) { - return pQd(); - }; - _2.$b = function qRd() { - qQd(); - }; - _2.Hc = function rRd(a) { - return false; - }; - _2.Ic = function sRd(a) { - return false; - }; - _2.Jc = function tRd(a) { - xgb(this, a); - }; - _2.Xb = function uRd(a) { - return Iob((yob(), a)), null; - }; - _2.dd = function vRd(a) { - return -1; - }; - _2.dc = function wRd() { - return true; - }; - _2.Kc = function xRd() { - return this.a; - }; - _2.ed = function yRd() { - return this.a; - }; - _2.fd = function zRd(a) { - return this.a; - }; - _2.Ti = function BRd(a, b) { - return rQd(); - }; - _2.Ui = function CRd(a, b) { - sQd(); - }; - _2.Lc = function DRd() { - return new SDb(null, new Swb(this, 16)); - }; - _2.gd = function ERd(a) { - return tQd(); - }; - _2.Mc = function FRd(a) { - return uQd(); - }; - _2.hd = function GRd(a, b) { - return vQd(); - }; - _2.gc = function HRd() { - return 0; - }; - _2.jd = function IRd(a) { - tvb(this, a); - }; - _2.Nc = function JRd() { - return new Swb(this, 16); - }; - _2.Oc = function KRd() { - return new SDb(null, new Swb(this, 16)); - }; - _2.kd = function LRd(a, b) { - return yob(), new Rkb(vob, a, b); - }; - _2.Pc = function MRd() { - return De((yob(), vob)); - }; - _2.Qc = function NRd(a) { - return yob(), Ee(vob, a); - }; - _2.bk = function ARd() { - return yob(), yob(), wob; - }; - sfb(sIe, "ECollections/EmptyUnmodifiableEMap", 1347); - var Z6 = ufb(sIe, "Enumerator"); - var ORd; - feb(288, 1, { 288: 1 }, lSd); - _2.Fb = function pSd(a) { - var b; - if (this === a) - return true; - if (!ZD(a, 288)) - return false; - b = RD(a, 288); - return this.f == b.f && rSd(this.i, b.i) && qSd(this.a, (this.f & 256) != 0 ? (b.f & 256) != 0 ? b.a : null : (b.f & 256) != 0 ? null : b.a) && qSd(this.d, b.d) && qSd(this.g, b.g) && qSd(this.e, b.e) && iSd(this, b); - }; - _2.Hb = function uSd() { - return this.f; - }; - _2.Ib = function CSd() { - return jSd(this); - }; - _2.f = 0; - var SRd = 0, TRd = 0, URd = 0, VRd = 0, WRd = 0, XRd = 0, YRd = 0, ZRd = 0, $Rd = 0, _Rd, aSd = 0, bSd = 0, cSd = 0, dSd = 0, eSd, fSd; - sfb(sIe, "URI", 288); - feb(1121, 45, Hxe, MSd); - _2.zc = function NSd(a, b) { - return RD($jb(this, WD(a), RD(b, 288)), 288); - }; - sfb(sIe, "URI/URICache", 1121); - feb(506, 66, PIe, OSd, PSd); - _2.Si = function QSd() { - return true; - }; - sfb(sIe, "UniqueEList", 506); - feb(590, 63, swe, RSd); - sfb(sIe, "WrappedException", 590); - var f7 = ufb(vHe, OJe); - var A7 = ufb(vHe, PJe); - var y7 = ufb(vHe, QJe); - var g7 = ufb(vHe, RJe); - var i7 = ufb(vHe, SJe); - var h7 = ufb(vHe, "EClass"); - var k7 = ufb(vHe, "EDataType"); - var SSd; - feb(1233, 45, Hxe, VSd); - _2.xc = function WSd(a) { - return bE(a) ? Xjb(this, a) : Wd(qtb(this.f, a)); - }; - sfb(vHe, "EDataType/Internal/ConversionDelegate/Factory/Registry/Impl", 1233); - var m7 = ufb(vHe, "EEnum"); - var l7 = ufb(vHe, TJe); - var o7 = ufb(vHe, UJe); - var s7 = ufb(vHe, VJe); - var XSd; - var u7 = ufb(vHe, WJe); - var v7 = ufb(vHe, XJe); - feb(1042, 1, {}, _Sd); - _2.Ib = function aTd() { - return "NIL"; - }; - sfb(vHe, "EStructuralFeature/Internal/DynamicValueHolder/1", 1042); - var bTd; - feb(1041, 45, Hxe, eTd); - _2.xc = function fTd(a) { - return bE(a) ? Xjb(this, a) : Wd(qtb(this.f, a)); - }; - sfb(vHe, "EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl", 1041); - var z7 = ufb(vHe, YJe); - var B7 = ufb(vHe, "EValidator/PatternMatcher"); - var gTd; - var iTd; - var kTd; - var mTd, nTd, oTd, pTd, qTd, rTd, sTd, tTd, uTd, vTd, wTd, xTd, yTd, zTd, ATd, BTd, CTd, DTd, ETd, FTd, GTd, HTd, ITd; - var Jbb = ufb(ZJe, "FeatureMap/Entry"); - feb(545, 1, { 76: 1 }, KTd); - _2.Lk = function LTd() { - return this.a; - }; - _2.md = function MTd() { - return this.b; - }; - sfb(SHe, "BasicEObjectImpl/1", 545); - feb(1040, 1, $Je, NTd); - _2.Fk = function OTd(a) { - return Fvd(this.a, this.b, a); - }; - _2.Qj = function PTd() { - return Lvd(this.a, this.b); - }; - _2.Wb = function QTd(a) { - Xvd(this.a, this.b, a); - }; - _2.Gk = function RTd() { - _vd(this.a, this.b); - }; - sfb(SHe, "BasicEObjectImpl/4", 1040); - feb(2081, 1, { 114: 1 }); - _2.Mk = function UTd(a) { - this.e = a == 0 ? STd : $C(jJ, rve, 1, a, 5, 1); - }; - _2.li = function VTd(a) { - return this.e[a]; - }; - _2.mi = function WTd(a, b) { - this.e[a] = b; - }; - _2.ni = function XTd(a) { - this.e[a] = null; - }; - _2.Nk = function YTd() { - return this.c; - }; - _2.Ok = function ZTd() { - throw Adb(new jib()); - }; - _2.Pk = function $Td() { - throw Adb(new jib()); - }; - _2.Qk = function _Td() { - return this.d; - }; - _2.Rk = function aUd() { - return this.e != null; - }; - _2.Sk = function bUd(a) { - this.c = a; - }; - _2.Tk = function cUd(a) { - throw Adb(new jib()); - }; - _2.Uk = function dUd(a) { - throw Adb(new jib()); - }; - _2.Vk = function eUd(a) { - this.d = a; - }; - var STd; - sfb(SHe, "BasicEObjectImpl/EPropertiesHolderBaseImpl", 2081); - feb(192, 2081, { 114: 1 }, fUd); - _2.Ok = function gUd() { - return this.a; - }; - _2.Pk = function hUd() { - return this.b; - }; - _2.Tk = function iUd(a) { - this.a = a; - }; - _2.Uk = function jUd(a) { - this.b = a; - }; - sfb(SHe, "BasicEObjectImpl/EPropertiesHolderImpl", 192); - feb(516, 99, RHe, kUd); - _2.uh = function lUd() { - return this.f; - }; - _2.zh = function mUd() { - return this.k; - }; - _2.Bh = function nUd(a, b) { - this.g = a; - this.i = b; - }; - _2.Dh = function oUd() { - return (this.j & 2) == 0 ? this.ii() : this.$h().Nk(); - }; - _2.Fh = function pUd() { - return this.i; - }; - _2.wh = function qUd() { - return (this.j & 1) != 0; - }; - _2.Ph = function rUd() { - return this.g; - }; - _2.Vh = function sUd() { - return (this.j & 4) != 0; - }; - _2.$h = function tUd() { - return !this.k && (this.k = new fUd()), this.k; - }; - _2.ci = function uUd(a) { - this.$h().Sk(a); - a ? this.j |= 2 : this.j &= -3; - }; - _2.ei = function vUd(a) { - this.$h().Uk(a); - a ? this.j |= 4 : this.j &= -5; - }; - _2.ii = function wUd() { - return (lTd(), kTd).S; - }; - _2.i = 0; - _2.j = 1; - sfb(SHe, "EObjectImpl", 516); - feb(798, 516, { 110: 1, 94: 1, 93: 1, 58: 1, 114: 1, 54: 1, 99: 1 }, zUd); - _2.li = function AUd(a) { - return this.e[a]; - }; - _2.mi = function BUd(a, b) { - this.e[a] = b; - }; - _2.ni = function CUd(a) { - this.e[a] = null; - }; - _2.Dh = function DUd() { - return this.d; - }; - _2.Ih = function EUd(a) { - return BYd(this.d, a); - }; - _2.Kh = function FUd() { - return this.d; - }; - _2.Oh = function GUd() { - return this.e != null; - }; - _2.$h = function HUd() { - !this.k && (this.k = new VUd()); - return this.k; - }; - _2.ci = function IUd(a) { - this.d = a; - }; - _2.hi = function JUd() { - var a; - if (this.e == null) { - a = AYd(this.d); - this.e = a == 0 ? xUd : $C(jJ, rve, 1, a, 5, 1); - } - return this; - }; - _2.ji = function KUd() { - return 0; - }; - var xUd; - sfb(SHe, "DynamicEObjectImpl", 798); - feb(1522, 798, { 110: 1, 44: 1, 94: 1, 93: 1, 136: 1, 58: 1, 114: 1, 54: 1, 99: 1 }, LUd); - _2.Fb = function NUd(a) { - return this === a; - }; - _2.Hb = function RUd() { - return kFb(this); - }; - _2.ci = function MUd(a) { - this.d = a; - this.b = wYd(a, "key"); - this.c = wYd(a, aIe); - }; - _2.Bi = function OUd() { - var a; - if (this.a == -1) { - a = Gvd(this, this.b); - this.a = a == null ? 0 : tb(a); - } - return this.a; - }; - _2.ld = function PUd() { - return Gvd(this, this.b); - }; - _2.md = function QUd() { - return Gvd(this, this.c); - }; - _2.Ci = function SUd(a) { - this.a = a; - }; - _2.Di = function TUd(a) { - Xvd(this, this.b, a); - }; - _2.nd = function UUd(a) { - var b; - b = Gvd(this, this.c); - Xvd(this, this.c, a); - return b; - }; - _2.a = 0; - sfb(SHe, "DynamicEObjectImpl/BasicEMapEntry", 1522); - feb(1523, 1, { 114: 1 }, VUd); - _2.Mk = function WUd(a) { - throw Adb(new jib()); - }; - _2.li = function XUd(a) { - throw Adb(new jib()); - }; - _2.mi = function YUd(a, b) { - throw Adb(new jib()); - }; - _2.ni = function ZUd(a) { - throw Adb(new jib()); - }; - _2.Nk = function $Ud() { - throw Adb(new jib()); - }; - _2.Ok = function _Ud() { - return this.a; - }; - _2.Pk = function aVd() { - return this.b; - }; - _2.Qk = function bVd() { - return this.c; - }; - _2.Rk = function cVd() { - throw Adb(new jib()); - }; - _2.Sk = function dVd(a) { - throw Adb(new jib()); - }; - _2.Tk = function eVd(a) { - this.a = a; - }; - _2.Uk = function fVd(a) { - this.b = a; - }; - _2.Vk = function gVd(a) { - this.c = a; - }; - sfb(SHe, "DynamicEObjectImpl/DynamicEPropertiesHolderImpl", 1523); - feb(519, 158, { 110: 1, 94: 1, 93: 1, 598: 1, 155: 1, 58: 1, 114: 1, 54: 1, 99: 1, 519: 1, 158: 1, 119: 1, 120: 1 }, pVd); - _2.Ah = function qVd(a) { - return iVd(this, a); - }; - _2.Lh = function rVd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.d; - case 2: - return c2 ? (!this.b && (this.b = new SVd((JTd(), FTd), C8, this)), this.b) : (!this.b && (this.b = new SVd((JTd(), FTd), C8, this)), dOd(this.b)); - case 3: - return kVd(this); - case 4: - return !this.a && (this.a = new XZd(r7, this, 4)), this.a; - case 5: - return !this.c && (this.c = new zie(r7, this, 5)), this.c; - } - return zvd(this, a - AYd((JTd(), mTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? mTd : d), a), b, c2); - }; - _2.Sh = function sVd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 3: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? iVd(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return hVd(this, RD(a, 155), c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), mTd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((JTd(), mTd)), a, c2); - }; - _2.Uh = function tVd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 2: - return !this.b && (this.b = new SVd((JTd(), FTd), C8, this)), BVd(this.b, a, c2); - case 3: - return hVd(this, null, c2); - case 4: - return !this.a && (this.a = new XZd(r7, this, 4)), rLd(this.a, a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), mTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), mTd)), a, c2); - }; - _2.Wh = function uVd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.d != null; - case 2: - return !!this.b && this.b.f != 0; - case 3: - return !!kVd(this); - case 4: - return !!this.a && this.a.i != 0; - case 5: - return !!this.c && this.c.i != 0; - } - return Avd(this, a - AYd((JTd(), mTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? mTd : b), a)); - }; - _2.bi = function vVd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - mVd(this, WD(b)); - return; - case 2: - !this.b && (this.b = new SVd((JTd(), FTd), C8, this)); - CVd(this.b, b); - return; - case 3: - lVd(this, RD(b, 155)); - return; - case 4: - !this.a && (this.a = new XZd(r7, this, 4)); - sLd(this.a); - !this.a && (this.a = new XZd(r7, this, 4)); - YGd(this.a, RD(b, 16)); - return; - case 5: - !this.c && (this.c = new zie(r7, this, 5)); - sLd(this.c); - !this.c && (this.c = new zie(r7, this, 5)); - YGd(this.c, RD(b, 16)); - return; - } - Bvd(this, a - AYd((JTd(), mTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? mTd : c2), a), b); - }; - _2.ii = function wVd() { - return JTd(), mTd; - }; - _2.ki = function xVd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - nVd(this, null); - return; - case 2: - !this.b && (this.b = new SVd((JTd(), FTd), C8, this)); - this.b.c.$b(); - return; - case 3: - lVd(this, null); - return; - case 4: - !this.a && (this.a = new XZd(r7, this, 4)); - sLd(this.a); - return; - case 5: - !this.c && (this.c = new zie(r7, this, 5)); - sLd(this.c); - return; - } - Cvd(this, a - AYd((JTd(), mTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? mTd : b), a)); - }; - _2.Ib = function yVd() { - return oVd(this); - }; - _2.d = null; - sfb(SHe, "EAnnotationImpl", 519); - feb(141, 721, _Je, DVd); - _2.Gi = function EVd(a, b) { - zVd(this, a, RD(b, 44)); - }; - _2.Wk = function FVd(a, b) { - return AVd(this, RD(a, 44), b); - }; - _2.$i = function GVd(a) { - return RD(RD(this.c, 71).$i(a), 136); - }; - _2.Ii = function HVd() { - return RD(this.c, 71).Ii(); - }; - _2.Ji = function IVd() { - return RD(this.c, 71).Ji(); - }; - _2.Ki = function JVd(a) { - return RD(this.c, 71).Ki(a); - }; - _2.Xk = function KVd(a, b) { - return BVd(this, a, b); - }; - _2.Fk = function LVd(a) { - return RD(this.c, 79).Fk(a); - }; - _2.ak = function MVd() { - }; - _2.Qj = function NVd() { - return RD(this.c, 79).Qj(); - }; - _2.ck = function OVd(a, b, c2) { - var d; - d = RD(BXd(this.b).wi().si(this.b), 136); - d.Ci(a); - d.Di(b); - d.nd(c2); - return d; - }; - _2.dk = function PVd() { - return new uje(this); - }; - _2.Wb = function QVd(a) { - CVd(this, a); - }; - _2.Gk = function RVd() { - RD(this.c, 79).Gk(); - }; - sfb(ZJe, "EcoreEMap", 141); - feb(165, 141, _Je, SVd); - _2._j = function TVd() { - var a, b, c2, d, e, f2; - if (this.d == null) { - f2 = $C(D6, KJe, 66, 2 * this.f + 1, 0, 1); - for (c2 = this.c.Kc(); c2.e != c2.i.gc(); ) { - b = RD(c2.Yj(), 136); - d = b.Bi(); - e = (d & lve) % f2.length; - a = f2[e]; - !a && (a = f2[e] = new uje(this)); - a.Fc(b); - } - this.d = f2; - } - }; - sfb(SHe, "EAnnotationImpl/1", 165); - feb(292, 448, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 114: 1, 481: 1, 54: 1, 99: 1, 158: 1, 292: 1, 119: 1, 120: 1 }); - _2.Lh = function eWd(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Geb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return sgb(this.s); - case 5: - return sgb(this.t); - case 6: - return Geb(), this.Jk() ? true : false; - case 7: - return Geb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return WVd(this); - return this.r; - case 9: - return this.q; - } - return zvd(this, a - AYd(this.ii()), vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), a), b, c2); - }; - _2.Uh = function fWd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 9: - return VVd(this, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd(this.ii()), a, c2); - }; - _2.Wh = function gWd(a) { - var b, c2; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return (this.Bb & 256) == 0; - case 3: - return (this.Bb & 512) == 0; - case 4: - return this.s != 0; - case 5: - return this.t != 1; - case 6: - return this.Jk(); - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && j2d(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && j2d(this.q).i == 0); - } - return Avd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.bi = function hWd(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - this.ui(WD(b)); - return; - case 2: - _Vd(this, Heb(TD(b))); - return; - case 3: - aWd(this, Heb(TD(b))); - return; - case 4: - $Vd(this, RD(b, 17).a); - return; - case 5: - this.Zk(RD(b, 17).a); - return; - case 8: - YVd(this, RD(b, 142)); - return; - case 9: - d = XVd(this, RD(b, 89), null); - !!d && d.oj(); - return; - } - Bvd(this, a - AYd(this.ii()), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? this.ii() : c2), a), b); - }; - _2.ii = function iWd() { - return JTd(), HTd; - }; - _2.ki = function jWd(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - this.ui(null); - return; - case 2: - _Vd(this, true); - return; - case 3: - aWd(this, true); - return; - case 4: - $Vd(this, 0); - return; - case 5: - this.Zk(1); - return; - case 8: - YVd(this, null); - return; - case 9: - c2 = XVd(this, null, null); - !!c2 && c2.oj(); - return; - } - Cvd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.pi = function kWd() { - WVd(this); - this.Bb |= 1; - }; - _2.Hk = function lWd() { - return WVd(this); - }; - _2.Ik = function mWd() { - return this.t; - }; - _2.Jk = function nWd() { - var a; - return a = this.t, a > 1 || a == -1; - }; - _2.Si = function oWd() { - return (this.Bb & 512) != 0; - }; - _2.Yk = function pWd(a, b) { - return ZVd(this, a, b); - }; - _2.Zk = function qWd(a) { - bWd(this, a); - }; - _2.Ib = function rWd() { - return cWd(this); - }; - _2.s = 0; - _2.t = 1; - sfb(SHe, "ETypedElementImpl", 292); - feb(462, 292, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 179: 1, 69: 1, 114: 1, 481: 1, 54: 1, 99: 1, 158: 1, 462: 1, 292: 1, 119: 1, 120: 1, 692: 1 }); - _2.Ah = function IWd(a) { - return sWd(this, a); - }; - _2.Lh = function JWd(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Geb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return sgb(this.s); - case 5: - return sgb(this.t); - case 6: - return Geb(), this.Jk() ? true : false; - case 7: - return Geb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return WVd(this); - return this.r; - case 9: - return this.q; - case 10: - return Geb(), (this.Bb & gwe) != 0 ? true : false; - case 11: - return Geb(), (this.Bb & cKe) != 0 ? true : false; - case 12: - return Geb(), (this.Bb & qxe) != 0 ? true : false; - case 13: - return this.j; - case 14: - return tWd(this); - case 15: - return Geb(), (this.Bb & bKe) != 0 ? true : false; - case 16: - return Geb(), (this.Bb & Ove) != 0 ? true : false; - case 17: - return uWd(this); - } - return zvd(this, a - AYd(this.ii()), vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), a), b, c2); - }; - _2.Sh = function KWd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 17: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? sWd(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 17, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd(this.ii()), a, c2); - }; - _2.Uh = function LWd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 9: - return VVd(this, c2); - case 17: - return xvd(this, null, 17, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd(this.ii()), a, c2); - }; - _2.Wh = function MWd(a) { - var b, c2; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return (this.Bb & 256) == 0; - case 3: - return (this.Bb & 512) == 0; - case 4: - return this.s != 0; - case 5: - return this.t != 1; - case 6: - return this.Jk(); - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && j2d(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && j2d(this.q).i == 0); - case 10: - return (this.Bb & gwe) == 0; - case 11: - return (this.Bb & cKe) != 0; - case 12: - return (this.Bb & qxe) != 0; - case 13: - return this.j != null; - case 14: - return tWd(this) != null; - case 15: - return (this.Bb & bKe) != 0; - case 16: - return (this.Bb & Ove) != 0; - case 17: - return !!uWd(this); - } - return Avd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.bi = function NWd(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - CWd(this, WD(b)); - return; - case 2: - _Vd(this, Heb(TD(b))); - return; - case 3: - aWd(this, Heb(TD(b))); - return; - case 4: - $Vd(this, RD(b, 17).a); - return; - case 5: - this.Zk(RD(b, 17).a); - return; - case 8: - YVd(this, RD(b, 142)); - return; - case 9: - d = XVd(this, RD(b, 89), null); - !!d && d.oj(); - return; - case 10: - xWd(this, Heb(TD(b))); - return; - case 11: - FWd(this, Heb(TD(b))); - return; - case 12: - DWd(this, Heb(TD(b))); - return; - case 13: - yWd(this, WD(b)); - return; - case 15: - EWd(this, Heb(TD(b))); - return; - case 16: - AWd(this, Heb(TD(b))); - return; - } - Bvd(this, a - AYd(this.ii()), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? this.ii() : c2), a), b); - }; - _2.ii = function OWd() { - return JTd(), GTd; - }; - _2.ki = function PWd(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - ZD(this.Cb, 90) && v$d(yYd(RD(this.Cb, 90)), 4); - PAd(this, null); - return; - case 2: - _Vd(this, true); - return; - case 3: - aWd(this, true); - return; - case 4: - $Vd(this, 0); - return; - case 5: - this.Zk(1); - return; - case 8: - YVd(this, null); - return; - case 9: - c2 = XVd(this, null, null); - !!c2 && c2.oj(); - return; - case 10: - xWd(this, true); - return; - case 11: - FWd(this, false); - return; - case 12: - DWd(this, false); - return; - case 13: - this.i = null; - zWd(this, null); - return; - case 15: - EWd(this, false); - return; - case 16: - AWd(this, false); - return; - } - Cvd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.pi = function QWd() { - Afe(Qee((lke(), jke), this)); - WVd(this); - this.Bb |= 1; - }; - _2.pk = function RWd() { - return this.f; - }; - _2.ik = function SWd() { - return tWd(this); - }; - _2.qk = function TWd() { - return uWd(this); - }; - _2.uk = function UWd() { - return null; - }; - _2.$k = function VWd() { - return this.k; - }; - _2.Lj = function WWd() { - return this.n; - }; - _2.vk = function XWd() { - return vWd(this); - }; - _2.wk = function YWd() { - var a, b, c2, d, e, f2, g, h, i2; - if (!this.p) { - c2 = uWd(this); - (c2.i == null && rYd(c2), c2.i).length; - d = this.uk(); - !!d && AYd(uWd(d)); - e = WVd(this); - g = e.kk(); - a = !g ? null : (g.i & 1) != 0 ? g == xdb ? QI : g == kE ? bJ : g == jE ? ZI : g == iE ? VI : g == lE ? eJ : g == wdb ? lJ : g == gE ? RI : SI : g; - b = tWd(this); - h = e.ik(); - Mje(this); - (this.Bb & Ove) != 0 && (!!(f2 = Tee((lke(), jke), c2)) && f2 != this || !!(f2 = zfe(Qee(jke, this)))) ? this.p = new Z6d(this, f2) : this.Jk() ? this.al() ? !d ? (this.Bb & bKe) != 0 ? !a ? this.bl() ? this.p = new i7d(42, this) : this.p = new i7d(0, this) : a == UK ? this.p = new g7d(50, O6, this) : this.bl() ? this.p = new g7d(43, a, this) : this.p = new g7d(1, a, this) : !a ? this.bl() ? this.p = new i7d(44, this) : this.p = new i7d(2, this) : a == UK ? this.p = new g7d(41, O6, this) : this.bl() ? this.p = new g7d(45, a, this) : this.p = new g7d(3, a, this) : (this.Bb & bKe) != 0 ? !a ? this.bl() ? this.p = new j7d(46, this, d) : this.p = new j7d(4, this, d) : this.bl() ? this.p = new h7d(47, a, this, d) : this.p = new h7d(5, a, this, d) : !a ? this.bl() ? this.p = new j7d(48, this, d) : this.p = new j7d(6, this, d) : this.bl() ? this.p = new h7d(49, a, this, d) : this.p = new h7d(7, a, this, d) : ZD(e, 156) ? a == Jbb ? this.p = new i7d(40, this) : (this.Bb & 512) != 0 ? (this.Bb & bKe) != 0 ? !a ? this.p = new i7d(8, this) : this.p = new g7d(9, a, this) : !a ? this.p = new i7d(10, this) : this.p = new g7d(11, a, this) : (this.Bb & bKe) != 0 ? !a ? this.p = new i7d(12, this) : this.p = new g7d(13, a, this) : !a ? this.p = new i7d(14, this) : this.p = new g7d(15, a, this) : !d ? this.bl() ? (this.Bb & bKe) != 0 ? !a ? this.p = new i7d(16, this) : this.p = new g7d(17, a, this) : !a ? this.p = new i7d(18, this) : this.p = new g7d(19, a, this) : (this.Bb & bKe) != 0 ? !a ? this.p = new i7d(20, this) : this.p = new g7d(21, a, this) : !a ? this.p = new i7d(22, this) : this.p = new g7d(23, a, this) : (i2 = d.t, i2 > 1 || i2 == -1 ? this.bl() ? (this.Bb & bKe) != 0 ? !a ? this.p = new j7d(24, this, d) : this.p = new h7d(25, a, this, d) : !a ? this.p = new j7d(26, this, d) : this.p = new h7d(27, a, this, d) : (this.Bb & bKe) != 0 ? !a ? this.p = new j7d(28, this, d) : this.p = new h7d(29, a, this, d) : !a ? this.p = new j7d(30, this, d) : this.p = new h7d(31, a, this, d) : this.bl() ? (this.Bb & bKe) != 0 ? !a ? this.p = new j7d(32, this, d) : this.p = new h7d(33, a, this, d) : !a ? this.p = new j7d(34, this, d) : this.p = new h7d(35, a, this, d) : (this.Bb & bKe) != 0 ? !a ? this.p = new j7d(36, this, d) : this.p = new h7d(37, a, this, d) : !a ? this.p = new j7d(38, this, d) : this.p = new h7d(39, a, this, d)) : this._k() ? this.bl() ? this.p = new K7d(RD(e, 29), this, d) : this.p = new C7d(RD(e, 29), this, d) : ZD(e, 156) ? a == Jbb ? this.p = new i7d(40, this) : (this.Bb & bKe) != 0 ? !a ? this.p = new J8d(RD(e, 156), b, h, this) : this.p = new L8d(b, h, this, (a8d(), g == kE ? Y7d : g == xdb ? T7d : g == lE ? Z7d : g == jE ? X7d : g == iE ? W7d : g == wdb ? _7d : g == gE ? U7d : g == hE ? V7d : $7d)) : !a ? this.p = new C8d(RD(e, 156), b, h, this) : this.p = new E8d(b, h, this, (a8d(), g == kE ? Y7d : g == xdb ? T7d : g == lE ? Z7d : g == jE ? X7d : g == iE ? W7d : g == wdb ? _7d : g == gE ? U7d : g == hE ? V7d : $7d)) : this.al() ? !d ? (this.Bb & bKe) != 0 ? this.bl() ? this.p = new d9d(RD(e, 29), this) : this.p = new b9d(RD(e, 29), this) : this.bl() ? this.p = new _8d(RD(e, 29), this) : this.p = new Z8d(RD(e, 29), this) : (this.Bb & bKe) != 0 ? this.bl() ? this.p = new l9d(RD(e, 29), this, d) : this.p = new j9d(RD(e, 29), this, d) : this.bl() ? this.p = new h9d(RD(e, 29), this, d) : this.p = new f9d(RD(e, 29), this, d) : this.bl() ? !d ? (this.Bb & bKe) != 0 ? this.p = new p9d(RD(e, 29), this) : this.p = new n9d(RD(e, 29), this) : (this.Bb & bKe) != 0 ? this.p = new t9d(RD(e, 29), this, d) : this.p = new r9d(RD(e, 29), this, d) : !d ? (this.Bb & bKe) != 0 ? this.p = new v9d(RD(e, 29), this) : this.p = new N8d(RD(e, 29), this) : (this.Bb & bKe) != 0 ? this.p = new z9d(RD(e, 29), this, d) : this.p = new x9d(RD(e, 29), this, d); - } - return this.p; - }; - _2.rk = function ZWd() { - return (this.Bb & gwe) != 0; - }; - _2._k = function $Wd() { - return false; - }; - _2.al = function _Wd() { - return false; - }; - _2.sk = function aXd() { - return (this.Bb & Ove) != 0; - }; - _2.xk = function bXd() { - return wWd(this); - }; - _2.bl = function cXd() { - return false; - }; - _2.tk = function dXd() { - return (this.Bb & bKe) != 0; - }; - _2.cl = function eXd(a) { - this.k = a; - }; - _2.ui = function fXd(a) { - CWd(this, a); - }; - _2.Ib = function gXd() { - return GWd(this); - }; - _2.e = false; - _2.n = 0; - sfb(SHe, "EStructuralFeatureImpl", 462); - feb(331, 462, { 110: 1, 94: 1, 93: 1, 35: 1, 155: 1, 197: 1, 58: 1, 179: 1, 69: 1, 114: 1, 481: 1, 54: 1, 99: 1, 331: 1, 158: 1, 462: 1, 292: 1, 119: 1, 120: 1, 692: 1 }, mXd); - _2.Lh = function nXd(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Geb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return sgb(this.s); - case 5: - return sgb(this.t); - case 6: - return Geb(), jXd(this) ? true : false; - case 7: - return Geb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return WVd(this); - return this.r; - case 9: - return this.q; - case 10: - return Geb(), (this.Bb & gwe) != 0 ? true : false; - case 11: - return Geb(), (this.Bb & cKe) != 0 ? true : false; - case 12: - return Geb(), (this.Bb & qxe) != 0 ? true : false; - case 13: - return this.j; - case 14: - return tWd(this); - case 15: - return Geb(), (this.Bb & bKe) != 0 ? true : false; - case 16: - return Geb(), (this.Bb & Ove) != 0 ? true : false; - case 17: - return uWd(this); - case 18: - return Geb(), (this.Bb & QHe) != 0 ? true : false; - case 19: - if (b) - return iXd(this); - return hXd(this); - } - return zvd(this, a - AYd((JTd(), nTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? nTd : d), a), b, c2); - }; - _2.Wh = function oXd(a) { - var b, c2; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return (this.Bb & 256) == 0; - case 3: - return (this.Bb & 512) == 0; - case 4: - return this.s != 0; - case 5: - return this.t != 1; - case 6: - return jXd(this); - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && j2d(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && j2d(this.q).i == 0); - case 10: - return (this.Bb & gwe) == 0; - case 11: - return (this.Bb & cKe) != 0; - case 12: - return (this.Bb & qxe) != 0; - case 13: - return this.j != null; - case 14: - return tWd(this) != null; - case 15: - return (this.Bb & bKe) != 0; - case 16: - return (this.Bb & Ove) != 0; - case 17: - return !!uWd(this); - case 18: - return (this.Bb & QHe) != 0; - case 19: - return !!hXd(this); - } - return Avd(this, a - AYd((JTd(), nTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? nTd : b), a)); - }; - _2.bi = function pXd(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - CWd(this, WD(b)); - return; - case 2: - _Vd(this, Heb(TD(b))); - return; - case 3: - aWd(this, Heb(TD(b))); - return; - case 4: - $Vd(this, RD(b, 17).a); - return; - case 5: - lXd(this, RD(b, 17).a); - return; - case 8: - YVd(this, RD(b, 142)); - return; - case 9: - d = XVd(this, RD(b, 89), null); - !!d && d.oj(); - return; - case 10: - xWd(this, Heb(TD(b))); - return; - case 11: - FWd(this, Heb(TD(b))); - return; - case 12: - DWd(this, Heb(TD(b))); - return; - case 13: - yWd(this, WD(b)); - return; - case 15: - EWd(this, Heb(TD(b))); - return; - case 16: - AWd(this, Heb(TD(b))); - return; - case 18: - kXd(this, Heb(TD(b))); - return; - } - Bvd(this, a - AYd((JTd(), nTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? nTd : c2), a), b); - }; - _2.ii = function qXd() { - return JTd(), nTd; - }; - _2.ki = function rXd(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - ZD(this.Cb, 90) && v$d(yYd(RD(this.Cb, 90)), 4); - PAd(this, null); - return; - case 2: - _Vd(this, true); - return; - case 3: - aWd(this, true); - return; - case 4: - $Vd(this, 0); - return; - case 5: - this.b = 0; - bWd(this, 1); - return; - case 8: - YVd(this, null); - return; - case 9: - c2 = XVd(this, null, null); - !!c2 && c2.oj(); - return; - case 10: - xWd(this, true); - return; - case 11: - FWd(this, false); - return; - case 12: - DWd(this, false); - return; - case 13: - this.i = null; - zWd(this, null); - return; - case 15: - EWd(this, false); - return; - case 16: - AWd(this, false); - return; - case 18: - kXd(this, false); - return; - } - Cvd(this, a - AYd((JTd(), nTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? nTd : b), a)); - }; - _2.pi = function sXd() { - iXd(this); - Afe(Qee((lke(), jke), this)); - WVd(this); - this.Bb |= 1; - }; - _2.Jk = function tXd() { - return jXd(this); - }; - _2.Yk = function uXd(a, b) { - this.b = 0; - this.a = null; - return ZVd(this, a, b); - }; - _2.Zk = function vXd(a) { - lXd(this, a); - }; - _2.Ib = function wXd() { - var a; - if ((this.Db & 64) != 0) - return GWd(this); - a = new Shb(GWd(this)); - a.a += " (iD: "; - Ohb(a, (this.Bb & QHe) != 0); - a.a += ")"; - return a.a; - }; - _2.b = 0; - sfb(SHe, "EAttributeImpl", 331); - feb(364, 448, { 110: 1, 94: 1, 93: 1, 142: 1, 155: 1, 197: 1, 58: 1, 114: 1, 54: 1, 99: 1, 364: 1, 158: 1, 119: 1, 120: 1, 691: 1 }); - _2.dl = function NXd(a) { - return a.Dh() == this; - }; - _2.Ah = function OXd(a) { - return AXd(this, a); - }; - _2.Bh = function PXd(a, b) { - this.w = null; - this.Db = b << 16 | this.Db & 255; - this.Cb = a; - }; - _2.Lh = function QXd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return DXd(this); - case 4: - return this.ik(); - case 5: - return this.F; - case 6: - if (b) - return BXd(this); - return xXd(this); - case 7: - return !this.A && (this.A = new iie(z7, this, 7)), this.A; - } - return zvd(this, a - AYd(this.ii()), vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), a), b, c2); - }; - _2.Sh = function RXd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? AXd(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 6, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd(this.ii()), a, c2); - }; - _2.Uh = function SXd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 6: - return xvd(this, null, 6, c2); - case 7: - return !this.A && (this.A = new iie(z7, this, 7)), rLd(this.A, a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd(this.ii()), a, c2); - }; - _2.Wh = function TXd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return this.D != null && this.D == this.F; - case 3: - return !!DXd(this); - case 4: - return this.ik() != null; - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!xXd(this); - case 7: - return !!this.A && this.A.i != 0; - } - return Avd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.bi = function UXd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - LXd(this, WD(b)); - return; - case 2: - IXd(this, WD(b)); - return; - case 5: - KXd(this, WD(b)); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - !this.A && (this.A = new iie(z7, this, 7)); - YGd(this.A, RD(b, 16)); - return; - } - Bvd(this, a - AYd(this.ii()), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? this.ii() : c2), a), b); - }; - _2.ii = function VXd() { - return JTd(), pTd; - }; - _2.ki = function WXd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - ZD(this.Cb, 184) && (RD(this.Cb, 184).tb = null); - PAd(this, null); - return; - case 2: - yXd(this, null); - zXd(this, this.D); - return; - case 5: - KXd(this, null); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - return; - } - Cvd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.hk = function XXd() { - var a; - return this.G == -1 && (this.G = (a = BXd(this), a ? fZd(a.vi(), this) : -1)), this.G; - }; - _2.ik = function YXd() { - return null; - }; - _2.jk = function ZXd() { - return BXd(this); - }; - _2.el = function $Xd() { - return this.v; - }; - _2.kk = function _Xd() { - return DXd(this); - }; - _2.lk = function aYd() { - return this.D != null ? this.D : this.B; - }; - _2.mk = function bYd() { - return this.F; - }; - _2.fk = function cYd(a) { - return FXd(this, a); - }; - _2.fl = function dYd(a) { - this.v = a; - }; - _2.gl = function eYd(a) { - GXd(this, a); - }; - _2.hl = function fYd(a) { - this.C = a; - }; - _2.ui = function gYd(a) { - LXd(this, a); - }; - _2.Ib = function hYd() { - return MXd(this); - }; - _2.C = null; - _2.D = null; - _2.G = -1; - sfb(SHe, "EClassifierImpl", 364); - feb(90, 364, { 110: 1, 94: 1, 93: 1, 29: 1, 142: 1, 155: 1, 197: 1, 58: 1, 114: 1, 54: 1, 99: 1, 90: 1, 364: 1, 158: 1, 482: 1, 119: 1, 120: 1, 691: 1 }, HYd); - _2.dl = function IYd(a) { - return DYd(this, a.Dh()); - }; - _2.Lh = function JYd(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return DXd(this); - case 4: - return null; - case 5: - return this.F; - case 6: - if (b) - return BXd(this); - return xXd(this); - case 7: - return !this.A && (this.A = new iie(z7, this, 7)), this.A; - case 8: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 9: - return Geb(), (this.Bb & 512) != 0 ? true : false; - case 10: - return zYd(this); - case 11: - return !this.q && (this.q = new C5d(s7, this, 11, 10)), this.q; - case 12: - return mYd(this); - case 13: - return qYd(this); - case 14: - return qYd(this), this.r; - case 15: - return mYd(this), this.k; - case 16: - return nYd(this); - case 17: - return pYd(this); - case 18: - return rYd(this); - case 19: - return sYd(this); - case 20: - return mYd(this), this.o; - case 21: - return !this.s && (this.s = new C5d(y7, this, 21, 17)), this.s; - case 22: - return tYd(this); - case 23: - return oYd(this); - } - return zvd(this, a - AYd((JTd(), oTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? oTd : d), a), b, c2); - }; - _2.Sh = function KYd(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? AXd(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 6, c2); - case 11: - return !this.q && (this.q = new C5d(s7, this, 11, 10)), qLd(this.q, a, c2); - case 21: - return !this.s && (this.s = new C5d(y7, this, 21, 17)), qLd(this.s, a, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), oTd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((JTd(), oTd)), a, c2); - }; - _2.Uh = function LYd(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 6: - return xvd(this, null, 6, c2); - case 7: - return !this.A && (this.A = new iie(z7, this, 7)), rLd(this.A, a, c2); - case 11: - return !this.q && (this.q = new C5d(s7, this, 11, 10)), rLd(this.q, a, c2); - case 21: - return !this.s && (this.s = new C5d(y7, this, 21, 17)), rLd(this.s, a, c2); - case 22: - return rLd(tYd(this), a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), oTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), oTd)), a, c2); - }; - _2.Wh = function MYd(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return this.D != null && this.D == this.F; - case 3: - return !!DXd(this); - case 4: - return false; - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!xXd(this); - case 7: - return !!this.A && this.A.i != 0; - case 8: - return (this.Bb & 256) != 0; - case 9: - return (this.Bb & 512) != 0; - case 10: - return !!this.u && tYd(this.u.a).i != 0 && !(!!this.n && d$d(this.n)); - case 11: - return !!this.q && this.q.i != 0; - case 12: - return mYd(this).i != 0; - case 13: - return qYd(this).i != 0; - case 14: - return qYd(this), this.r.i != 0; - case 15: - return mYd(this), this.k.i != 0; - case 16: - return nYd(this).i != 0; - case 17: - return pYd(this).i != 0; - case 18: - return rYd(this).i != 0; - case 19: - return sYd(this).i != 0; - case 20: - return mYd(this), !!this.o; - case 21: - return !!this.s && this.s.i != 0; - case 22: - return !!this.n && d$d(this.n); - case 23: - return oYd(this).i != 0; - } - return Avd(this, a - AYd((JTd(), oTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? oTd : b), a)); - }; - _2.Zh = function NYd(a) { - var b; - b = this.i == null || !!this.q && this.q.i != 0 ? null : wYd(this, a); - return b ? b : _zd(this, a); - }; - _2.bi = function OYd(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - LXd(this, WD(b)); - return; - case 2: - IXd(this, WD(b)); - return; - case 5: - KXd(this, WD(b)); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - !this.A && (this.A = new iie(z7, this, 7)); - YGd(this.A, RD(b, 16)); - return; - case 8: - EYd(this, Heb(TD(b))); - return; - case 9: - FYd(this, Heb(TD(b))); - return; - case 10: - VJd(zYd(this)); - YGd(zYd(this), RD(b, 16)); - return; - case 11: - !this.q && (this.q = new C5d(s7, this, 11, 10)); - sLd(this.q); - !this.q && (this.q = new C5d(s7, this, 11, 10)); - YGd(this.q, RD(b, 16)); - return; - case 21: - !this.s && (this.s = new C5d(y7, this, 21, 17)); - sLd(this.s); - !this.s && (this.s = new C5d(y7, this, 21, 17)); - YGd(this.s, RD(b, 16)); - return; - case 22: - sLd(tYd(this)); - YGd(tYd(this), RD(b, 16)); - return; - } - Bvd(this, a - AYd((JTd(), oTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? oTd : c2), a), b); - }; - _2.ii = function PYd() { - return JTd(), oTd; - }; - _2.ki = function QYd(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - ZD(this.Cb, 184) && (RD(this.Cb, 184).tb = null); - PAd(this, null); - return; - case 2: - yXd(this, null); - zXd(this, this.D); - return; - case 5: - KXd(this, null); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - return; - case 8: - EYd(this, false); - return; - case 9: - FYd(this, false); - return; - case 10: - !!this.u && VJd(this.u); - return; - case 11: - !this.q && (this.q = new C5d(s7, this, 11, 10)); - sLd(this.q); - return; - case 21: - !this.s && (this.s = new C5d(y7, this, 21, 17)); - sLd(this.s); - return; - case 22: - !!this.n && sLd(this.n); - return; - } - Cvd(this, a - AYd((JTd(), oTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? oTd : b), a)); - }; - _2.pi = function RYd() { - var a, b; - mYd(this); - qYd(this); - nYd(this); - pYd(this); - rYd(this); - sYd(this); - oYd(this); - OHd(q$d(yYd(this))); - if (this.s) { - for (a = 0, b = this.s.i; a < b; ++a) { - aAd(QHd(this.s, a)); - } - } - if (this.q) { - for (a = 0, b = this.q.i; a < b; ++a) { - aAd(QHd(this.q, a)); - } - } - Oee((lke(), jke), this).xe(); - this.Bb |= 1; - }; - _2.Ib = function SYd() { - return GYd(this); - }; - _2.k = null; - _2.r = null; - var iYd, jYd, kYd; - sfb(SHe, "EClassImpl", 90); - feb(2092, 2091, nKe); - _2.Ei = function TYd(a, b) { - return nLd(this, a, b); - }; - _2.Fi = function UYd(a) { - return nLd(this, this.i, a); - }; - _2.Gi = function VYd(a, b) { - oLd(this, a, b); - }; - _2.Hi = function WYd(a) { - pLd(this, a); - }; - _2.Wk = function XYd(a, b) { - return qLd(this, a, b); - }; - _2.$i = function YYd(a) { - return NHd(this, a); - }; - _2.Xk = function aZd(a, b) { - return rLd(this, a, b); - }; - _2.Xi = function bZd(a, b) { - return xLd(this, a, b); - }; - _2.Ii = function ZYd() { - return new yMd(this); - }; - _2.Ji = function $Yd() { - return new BMd(this); - }; - _2.Ki = function _Yd(a) { - return ZGd(this, a); - }; - sfb(ZJe, "NotifyingInternalEListImpl", 2092); - feb(632, 2092, oKe); - _2.Hc = function lZd(a) { - return cZd(this, a); - }; - _2.Ij = function mZd(a, b, c2, d, e) { - return dZd(this, a, b, c2, d, e); - }; - _2.Jj = function nZd(a) { - eZd(this, a); - }; - _2.Fk = function oZd(a) { - return this; - }; - _2.Lk = function pZd() { - return vYd(this.e.Dh(), this.Lj()); - }; - _2.Kj = function qZd() { - return this.Lk(); - }; - _2.Lj = function rZd() { - return BYd(this.e.Dh(), this.Lk()); - }; - _2.il = function sZd() { - return RD(this.Lk().Hk(), 29).kk(); - }; - _2.jl = function tZd() { - return Z5d(RD(this.Lk(), 19)).n; - }; - _2.jj = function uZd() { - return this.e; - }; - _2.kl = function vZd() { - return true; - }; - _2.ll = function wZd() { - return false; - }; - _2.ml = function xZd() { - return false; - }; - _2.nl = function yZd() { - return false; - }; - _2.dd = function zZd(a) { - return fZd(this, a); - }; - _2.Nj = function AZd(a, b) { - var c2; - return c2 = RD(a, 54), this.ml() ? this.kl() ? c2.Rh(this.e, this.jl(), this.il(), b) : c2.Rh(this.e, BYd(c2.Dh(), Z5d(RD(this.Lk(), 19))), null, b) : c2.Rh(this.e, -1 - this.Lj(), null, b); - }; - _2.Oj = function BZd(a, b) { - var c2; - return c2 = RD(a, 54), this.ml() ? this.kl() ? c2.Th(this.e, this.jl(), this.il(), b) : c2.Th(this.e, BYd(c2.Dh(), Z5d(RD(this.Lk(), 19))), null, b) : c2.Th(this.e, -1 - this.Lj(), null, b); - }; - _2.al = function CZd() { - return false; - }; - _2.ol = function DZd() { - return true; - }; - _2.fk = function EZd(a) { - return QRd(this.d, a); - }; - _2.Pj = function FZd() { - return Mvd(this.e); - }; - _2.Qj = function GZd() { - return this.i != 0; - }; - _2.aj = function HZd(a) { - return IMd(this.d, a); - }; - _2.Wi = function IZd(a, b) { - return this.ol() && this.nl() ? gZd(this, a, RD(b, 58)) : b; - }; - _2.pl = function JZd(a) { - return a.Vh() ? Vvd(this.e, RD(a, 54)) : a; - }; - _2.Wb = function KZd(a) { - hZd(this, a); - }; - _2.Pc = function LZd() { - return iZd(this); - }; - _2.Qc = function MZd(a) { - var b; - if (this.nl()) { - for (b = this.i - 1; b >= 0; --b) { - QHd(this, b); - } - } - return XHd(this, a); - }; - _2.Gk = function NZd() { - sLd(this); - }; - _2.Zi = function OZd(a, b) { - return jZd(this, a, b); - }; - sfb(ZJe, "EcoreEList", 632); - feb(505, 632, oKe, PZd); - _2.Li = function QZd() { - return false; - }; - _2.Lj = function RZd() { - return this.c; - }; - _2.Mj = function SZd() { - return false; - }; - _2.ol = function TZd() { - return true; - }; - _2.Si = function UZd() { - return true; - }; - _2.Wi = function VZd(a, b) { - return b; - }; - _2.Yi = function WZd() { - return false; - }; - _2.c = 0; - sfb(ZJe, "EObjectEList", 505); - feb(83, 505, oKe, XZd); - _2.Mj = function YZd() { - return true; - }; - _2.ml = function ZZd() { - return false; - }; - _2.al = function $Zd() { - return true; - }; - sfb(ZJe, "EObjectContainmentEList", 83); - feb(555, 83, oKe, _Zd); - _2.Ni = function a$d() { - this.b = true; - }; - _2.Qj = function b$d() { - return this.b; - }; - _2.Gk = function c$d() { - var a; - sLd(this); - if (Mvd(this.e)) { - a = this.b; - this.b = false; - qvd(this.e, new Q3d(this.e, 2, this.c, a, false)); - } else { - this.b = false; - } - }; - _2.b = false; - sfb(ZJe, "EObjectContainmentEList/Unsettable", 555); - feb(1161, 555, oKe, h$d); - _2.Ti = function l$d(a, b) { - var c2, d; - return c2 = RD(uLd(this, a, b), 89), Mvd(this.e) && eZd(this, new c4d(this.a, 7, (JTd(), qTd), sgb(b), (d = c2.c, ZD(d, 90) ? RD(d, 29) : zTd), a)), c2; - }; - _2.Uj = function m$d(a, b) { - return e$d(this, RD(a, 89), b); - }; - _2.Vj = function n$d(a, b) { - return f$d(this, RD(a, 89), b); - }; - _2.Wj = function o$d(a, b, c2) { - return g$d(this, RD(a, 89), RD(b, 89), c2); - }; - _2.Ij = function i$d(a, b, c2, d, e) { - switch (a) { - case 3: { - return dZd(this, a, b, c2, d, this.i > 1); - } - case 5: { - return dZd(this, a, b, c2, d, this.i - RD(c2, 15).gc() > 0); - } - default: { - return new P3d(this.e, a, this.c, b, c2, d, true); - } - } - }; - _2.Tj = function j$d() { - return true; - }; - _2.Qj = function k$d() { - return d$d(this); - }; - _2.Gk = function p$d() { - sLd(this); - }; - sfb(SHe, "EClassImpl/1", 1161); - feb(1175, 1174, EJe); - _2.dj = function t$d(a) { - var b, c2, d, e, f2, g, h; - c2 = a.gj(); - if (c2 != 8) { - d = s$d(a); - if (d == 0) { - switch (c2) { - case 1: - case 9: { - h = a.kj(); - if (h != null) { - b = yYd(RD(h, 482)); - !b.c && (b.c = new X9d()); - dHd(b.c, a.jj()); - } - g = a.ij(); - if (g != null) { - e = RD(g, 482); - if ((e.Bb & 1) == 0) { - b = yYd(e); - !b.c && (b.c = new X9d()); - WGd(b.c, RD(a.jj(), 29)); - } - } - break; - } - case 3: { - g = a.ij(); - if (g != null) { - e = RD(g, 482); - if ((e.Bb & 1) == 0) { - b = yYd(e); - !b.c && (b.c = new X9d()); - WGd(b.c, RD(a.jj(), 29)); - } - } - break; - } - case 5: { - g = a.ij(); - if (g != null) { - for (f2 = RD(g, 16).Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 482); - if ((e.Bb & 1) == 0) { - b = yYd(e); - !b.c && (b.c = new X9d()); - WGd(b.c, RD(a.jj(), 29)); - } - } - } - break; - } - case 4: { - h = a.kj(); - if (h != null) { - e = RD(h, 482); - if ((e.Bb & 1) == 0) { - b = yYd(e); - !b.c && (b.c = new X9d()); - dHd(b.c, a.jj()); - } - } - break; - } - case 6: { - h = a.kj(); - if (h != null) { - for (f2 = RD(h, 16).Kc(); f2.Ob(); ) { - e = RD(f2.Pb(), 482); - if ((e.Bb & 1) == 0) { - b = yYd(e); - !b.c && (b.c = new X9d()); - dHd(b.c, a.jj()); - } - } - } - break; - } - } - } - this.ql(d); - } - }; - _2.ql = function u$d(a) { - r$d(this, a); - }; - _2.b = 63; - sfb(SHe, "ESuperAdapter", 1175); - feb(1176, 1175, EJe, w$d); - _2.ql = function x$d(a) { - v$d(this, a); - }; - sfb(SHe, "EClassImpl/10", 1176); - feb(1165, 710, oKe); - _2.Ei = function y$d(a, b) { - return IHd(this, a, b); - }; - _2.Fi = function z$d(a) { - return JHd(this, a); - }; - _2.Gi = function A$d(a, b) { - KHd(this, a, b); - }; - _2.Hi = function B$d(a) { - LHd(this, a); - }; - _2.$i = function D$d(a) { - return NHd(this, a); - }; - _2.Xi = function L$d(a, b) { - return UHd(this, a, b); - }; - _2.Wk = function C$d(a, b) { - throw Adb(new jib()); - }; - _2.Ii = function E$d() { - return new yMd(this); - }; - _2.Ji = function F$d() { - return new BMd(this); - }; - _2.Ki = function G$d(a) { - return ZGd(this, a); - }; - _2.Xk = function H$d(a, b) { - throw Adb(new jib()); - }; - _2.Fk = function I$d(a) { - return this; - }; - _2.Qj = function J$d() { - return this.i != 0; - }; - _2.Wb = function K$d(a) { - throw Adb(new jib()); - }; - _2.Gk = function M$d() { - throw Adb(new jib()); - }; - sfb(ZJe, "EcoreEList/UnmodifiableEList", 1165); - feb(328, 1165, oKe, N$d); - _2.Yi = function O$d() { - return false; - }; - sfb(ZJe, "EcoreEList/UnmodifiableEList/FastCompare", 328); - feb(1168, 328, oKe, R$d); - _2.dd = function S$d(a) { - var b, c2, d; - if (ZD(a, 179)) { - b = RD(a, 179); - c2 = b.Lj(); - if (c2 != -1) { - for (d = this.i; c2 < d; ++c2) { - if (dE(this.g[c2]) === dE(a)) { - return c2; - } - } - } - } - return -1; - }; - sfb(SHe, "EClassImpl/1EAllStructuralFeaturesList", 1168); - feb(1162, 506, PIe, W$d); - _2.aj = function X$d(a) { - return $C(o7, sKe, 89, a, 0, 1); - }; - _2.Yi = function Y$d() { - return false; - }; - sfb(SHe, "EClassImpl/1EGenericSuperTypeEList", 1162); - feb(633, 506, PIe, Z$d); - _2.aj = function $$d(a) { - return $C(y7, lKe, 179, a, 0, 1); - }; - _2.Yi = function _$d() { - return false; - }; - sfb(SHe, "EClassImpl/1EStructuralFeatureUniqueEList", 633); - feb(755, 506, PIe, a_d); - _2.aj = function b_d(a) { - return $C(v7, lKe, 19, a, 0, 1); - }; - _2.Yi = function c_d() { - return false; - }; - sfb(SHe, "EClassImpl/1ReferenceList", 755); - feb(1163, 506, PIe, e_d); - _2.Mi = function f_d(a, b) { - d_d(this, RD(b, 35)); - }; - _2.aj = function g_d(a) { - return $C(g7, lKe, 35, a, 0, 1); - }; - _2.Yi = function h_d() { - return false; - }; - sfb(SHe, "EClassImpl/2", 1163); - feb(1164, 506, PIe, i_d); - _2.aj = function j_d(a) { - return $C(g7, lKe, 35, a, 0, 1); - }; - _2.Yi = function k_d() { - return false; - }; - sfb(SHe, "EClassImpl/3", 1164); - feb(1166, 328, oKe, n_d); - _2.Fc = function o_d(a) { - return l_d(this, RD(a, 35)); - }; - _2.Hi = function p_d(a) { - m_d(this, RD(a, 35)); - }; - sfb(SHe, "EClassImpl/4", 1166); - feb(1167, 328, oKe, s_d); - _2.Fc = function t_d(a) { - return q_d(this, RD(a, 19)); - }; - _2.Hi = function u_d(a) { - r_d(this, RD(a, 19)); - }; - sfb(SHe, "EClassImpl/5", 1167); - feb(1169, 506, PIe, v_d); - _2.aj = function w_d(a) { - return $C(s7, mKe, 62, a, 0, 1); - }; - _2.Yi = function x_d() { - return false; - }; - sfb(SHe, "EClassImpl/6", 1169); - feb(1170, 506, PIe, y_d); - _2.aj = function z_d(a) { - return $C(v7, lKe, 19, a, 0, 1); - }; - _2.Yi = function A_d() { - return false; - }; - sfb(SHe, "EClassImpl/7", 1170); - feb(2095, 2094, { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 70: 1, 61: 1, 71: 1 }); - _2.Ei = function B_d(a, b) { - return QJd(this, a, b); - }; - _2.Fi = function C_d(a) { - return QJd(this, this.Ej(), a); - }; - _2.Gi = function D_d(a, b) { - RJd(this, a, b); - }; - _2.Hi = function E_d(a) { - SJd(this, a); - }; - _2.Wk = function F_d(a, b) { - return TJd(this, a, b); - }; - _2.Xk = function L_d(a, b) { - return UJd(this, a, b); - }; - _2.Xi = function M_d(a, b) { - return WJd(this, a, b); - }; - _2.$i = function G_d(a) { - return this.xj(a); - }; - _2.Ii = function H_d() { - return new yMd(this); - }; - _2.pj = function I_d() { - return this.sj(); - }; - _2.Ji = function J_d() { - return new BMd(this); - }; - _2.Ki = function K_d(a) { - return ZGd(this, a); - }; - sfb(ZJe, "DelegatingNotifyingInternalEListImpl", 2095); - feb(756, 2095, tKe); - _2.Li = function R_d() { - var a; - a = vYd(Uwd(this.b), this.Lj()).Hk(); - return ZD(a, 156) && !ZD(a, 469) && (a.kk().i & 1) == 0; - }; - _2.Hc = function S_d(a) { - var b, c2, d, e, f2, g, h, i2; - if (this.ol()) { - i2 = this.Ej(); - if (i2 > 4) { - if (this.fk(a)) { - if (this.al()) { - d = RD(a, 54); - c2 = d.Eh(); - h = c2 == this.b && (this.ml() ? d.yh(d.Fh(), RD(vYd(Uwd(this.b), this.Lj()).Hk(), 29).kk()) == Z5d(RD(vYd(Uwd(this.b), this.Lj()), 19)).n : -1 - d.Fh() == this.Lj()); - if (this.nl() && !h && !c2 && !!d.Jh()) { - for (e = 0; e < i2; ++e) { - b = O_d(this, this.xj(e)); - if (dE(b) === dE(a)) { - return true; - } - } - } - return h; - } else if (this.ml() && !this.ll()) { - f2 = RD(a, 58).Mh(Z5d(RD(vYd(Uwd(this.b), this.Lj()), 19))); - if (dE(f2) === dE(this.b)) { - return true; - } else if (f2 == null || !RD(f2, 58).Vh()) { - return false; - } - } - } else { - return false; - } - } - g = this.uj(a); - if (this.nl() && !g) { - for (e = 0; e < i2; ++e) { - d = O_d(this, this.xj(e)); - if (dE(d) === dE(a)) { - return true; - } - } - } - return g; - } else { - return this.uj(a); - } - }; - _2.Ij = function T_d(a, b, c2, d, e) { - return new P3d(this.b, a, this.Lj(), b, c2, d, e); - }; - _2.Jj = function U_d(a) { - qvd(this.b, a); - }; - _2.Fk = function V_d(a) { - return this; - }; - _2.Kj = function W_d() { - return vYd(Uwd(this.b), this.Lj()); - }; - _2.Lj = function X_d() { - return BYd(Uwd(this.b), vYd(Uwd(this.b), this.Lj())); - }; - _2.jj = function Y_d() { - return this.b; - }; - _2.kl = function Z_d() { - return !!vYd(Uwd(this.b), this.Lj()).Hk().kk(); - }; - _2.Mj = function $_d() { - var a, b; - b = vYd(Uwd(this.b), this.Lj()); - if (ZD(b, 102)) { - a = RD(b, 19); - return (a.Bb & QHe) != 0 || !!Z5d(RD(b, 19)); - } else { - return false; - } - }; - _2.ll = function __d() { - var a, b, c2, d; - b = vYd(Uwd(this.b), this.Lj()); - if (ZD(b, 102)) { - a = RD(b, 19); - c2 = Z5d(a); - return !!c2 && (d = c2.t, d > 1 || d == -1); - } else { - return false; - } - }; - _2.ml = function a0d() { - var a, b, c2; - b = vYd(Uwd(this.b), this.Lj()); - if (ZD(b, 102)) { - a = RD(b, 19); - c2 = Z5d(a); - return !!c2; - } else { - return false; - } - }; - _2.nl = function b0d() { - var a, b; - b = vYd(Uwd(this.b), this.Lj()); - if (ZD(b, 102)) { - a = RD(b, 19); - return (a.Bb & txe) != 0; - } else { - return false; - } - }; - _2.dd = function c0d(a) { - var b, c2, d, e; - d = this.zj(a); - if (d >= 0) - return d; - if (this.ol()) { - for (c2 = 0, e = this.Ej(); c2 < e; ++c2) { - b = O_d(this, this.xj(c2)); - if (dE(b) === dE(a)) { - return c2; - } - } - } - return -1; - }; - _2.Nj = function d0d(a, b) { - var c2; - return c2 = RD(a, 54), this.ml() ? this.kl() ? c2.Rh(this.b, Z5d(RD(vYd(Uwd(this.b), this.Lj()), 19)).n, RD(vYd(Uwd(this.b), this.Lj()).Hk(), 29).kk(), b) : c2.Rh(this.b, BYd(c2.Dh(), Z5d(RD(vYd(Uwd(this.b), this.Lj()), 19))), null, b) : c2.Rh(this.b, -1 - this.Lj(), null, b); - }; - _2.Oj = function e0d(a, b) { - var c2; - return c2 = RD(a, 54), this.ml() ? this.kl() ? c2.Th(this.b, Z5d(RD(vYd(Uwd(this.b), this.Lj()), 19)).n, RD(vYd(Uwd(this.b), this.Lj()).Hk(), 29).kk(), b) : c2.Th(this.b, BYd(c2.Dh(), Z5d(RD(vYd(Uwd(this.b), this.Lj()), 19))), null, b) : c2.Th(this.b, -1 - this.Lj(), null, b); - }; - _2.al = function f0d() { - var a, b; - b = vYd(Uwd(this.b), this.Lj()); - if (ZD(b, 102)) { - a = RD(b, 19); - return (a.Bb & QHe) != 0; - } else { - return false; - } - }; - _2.ol = function g0d() { - return ZD(vYd(Uwd(this.b), this.Lj()).Hk(), 90); - }; - _2.fk = function h0d(a) { - return vYd(Uwd(this.b), this.Lj()).Hk().fk(a); - }; - _2.Pj = function i0d() { - return Mvd(this.b); - }; - _2.Qj = function j0d() { - return !this.Aj(); - }; - _2.Si = function k0d() { - return vYd(Uwd(this.b), this.Lj()).Si(); - }; - _2.Wi = function l0d(a, b) { - return N_d(this, a, b); - }; - _2.Wb = function m0d(a) { - VJd(this); - YGd(this, RD(a, 15)); - }; - _2.Pc = function n0d() { - var a; - if (this.nl()) { - for (a = this.Ej() - 1; a >= 0; --a) { - N_d(this, a, this.xj(a)); - } - } - return this.Fj(); - }; - _2.Qc = function o0d(a) { - var b; - if (this.nl()) { - for (b = this.Ej() - 1; b >= 0; --b) { - N_d(this, b, this.xj(b)); - } - } - return this.Gj(a); - }; - _2.Gk = function p0d() { - VJd(this); - }; - _2.Zi = function q0d(a, b) { - return P_d(this, a, b); - }; - sfb(ZJe, "DelegatingEcoreEList", 756); - feb(1171, 756, tKe, w0d); - _2.qj = function z0d(a, b) { - r0d(this, a, RD(b, 29)); - }; - _2.rj = function A0d(a) { - s0d(this, RD(a, 29)); - }; - _2.xj = function G0d(a) { - var b, c2; - return b = RD(QHd(tYd(this.a), a), 89), c2 = b.c, ZD(c2, 90) ? RD(c2, 29) : (JTd(), zTd); - }; - _2.Cj = function L0d(a) { - var b, c2; - return b = RD(vLd(tYd(this.a), a), 89), c2 = b.c, ZD(c2, 90) ? RD(c2, 29) : (JTd(), zTd); - }; - _2.Dj = function M0d(a, b) { - return u0d(this, a, RD(b, 29)); - }; - _2.Li = function x0d() { - return false; - }; - _2.Ij = function y0d(a, b, c2, d, e) { - return null; - }; - _2.sj = function B0d() { - return new c1d(this); - }; - _2.tj = function C0d() { - sLd(tYd(this.a)); - }; - _2.uj = function D0d(a) { - return t0d(this, a); - }; - _2.vj = function E0d(a) { - var b, c2; - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - if (!t0d(this, b)) { - return false; - } - } - return true; - }; - _2.wj = function F0d(a) { - var b, c2, d; - if (ZD(a, 15)) { - d = RD(a, 15); - if (d.gc() == tYd(this.a).i) { - for (b = d.Kc(), c2 = new dMd(this); b.Ob(); ) { - if (dE(b.Pb()) !== dE(bMd(c2))) { - return false; - } - } - return true; - } - } - return false; - }; - _2.yj = function H0d() { - var a, b, c2, d, e; - c2 = 1; - for (b = new dMd(tYd(this.a)); b.e != b.i.gc(); ) { - a = RD(bMd(b), 89); - d = (e = a.c, ZD(e, 90) ? RD(e, 29) : (JTd(), zTd)); - c2 = 31 * c2 + (!d ? 0 : kFb(d)); - } - return c2; - }; - _2.zj = function I0d(a) { - var b, c2, d, e; - d = 0; - for (c2 = new dMd(tYd(this.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 89); - if (dE(a) === dE((e = b.c, ZD(e, 90) ? RD(e, 29) : (JTd(), zTd)))) { - return d; - } - ++d; - } - return -1; - }; - _2.Aj = function J0d() { - return tYd(this.a).i == 0; - }; - _2.Bj = function K0d() { - return null; - }; - _2.Ej = function N0d() { - return tYd(this.a).i; - }; - _2.Fj = function O0d() { - var a, b, c2, d, e, f2; - f2 = tYd(this.a).i; - e = $C(jJ, rve, 1, f2, 5, 1); - c2 = 0; - for (b = new dMd(tYd(this.a)); b.e != b.i.gc(); ) { - a = RD(bMd(b), 89); - e[c2++] = (d = a.c, ZD(d, 90) ? RD(d, 29) : (JTd(), zTd)); - } - return e; - }; - _2.Gj = function P0d(a) { - var b, c2, d, e, f2, g, h; - h = tYd(this.a).i; - if (a.length < h) { - e = IMd(rb(a).c, h); - a = e; - } - a.length > h && bD(a, h, null); - d = 0; - for (c2 = new dMd(tYd(this.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 89); - f2 = (g = b.c, ZD(g, 90) ? RD(g, 29) : (JTd(), zTd)); - bD(a, d++, f2); - } - return a; - }; - _2.Hj = function Q0d() { - var a, b, c2, d, e; - e = new Qhb(); - e.a += "["; - a = tYd(this.a); - for (b = 0, d = tYd(this.a).i; b < d; ) { - Nhb(e, Ghb((c2 = RD(QHd(a, b), 89).c, ZD(c2, 90) ? RD(c2, 29) : (JTd(), zTd)))); - ++b < d && (e.a += pve, e); - } - e.a += "]"; - return e.a; - }; - _2.Jj = function R0d(a) { - }; - _2.Lj = function S0d() { - return 10; - }; - _2.kl = function T0d() { - return true; - }; - _2.Mj = function U0d() { - return false; - }; - _2.ll = function V0d() { - return false; - }; - _2.ml = function W0d() { - return false; - }; - _2.nl = function X0d() { - return true; - }; - _2.al = function Y0d() { - return false; - }; - _2.ol = function Z0d() { - return true; - }; - _2.fk = function $0d(a) { - return ZD(a, 90); - }; - _2.Qj = function _0d() { - return CYd(this.a); - }; - _2.Si = function a1d() { - return true; - }; - _2.Yi = function b1d() { - return true; - }; - sfb(SHe, "EClassImpl/8", 1171); - feb(1172, 2062, kwe, c1d); - _2.fd = function d1d(a) { - return ZGd(this.a, a); - }; - _2.gc = function e1d() { - return tYd(this.a.a).i; - }; - sfb(SHe, "EClassImpl/8/1", 1172); - feb(1173, 506, PIe, f1d); - _2.aj = function g1d(a) { - return $C(i7, rve, 142, a, 0, 1); - }; - _2.Yi = function h1d() { - return false; - }; - sfb(SHe, "EClassImpl/9", 1173); - feb(1160, 49, Ixe, i1d); - sfb(SHe, "EClassImpl/MyHashSet", 1160); - feb(577, 364, { 110: 1, 94: 1, 93: 1, 142: 1, 156: 1, 847: 1, 155: 1, 197: 1, 58: 1, 114: 1, 54: 1, 99: 1, 364: 1, 158: 1, 119: 1, 120: 1, 691: 1 }, k1d); - _2.Lh = function l1d(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return DXd(this); - case 4: - return this.ik(); - case 5: - return this.F; - case 6: - if (b) - return BXd(this); - return xXd(this); - case 7: - return !this.A && (this.A = new iie(z7, this, 7)), this.A; - case 8: - return Geb(), (this.Bb & 256) != 0 ? true : false; - } - return zvd(this, a - AYd(this.ii()), vYd((d = RD(Ywd(this, 16), 29), !d ? this.ii() : d), a), b, c2); - }; - _2.Wh = function m1d(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return this.D != null && this.D == this.F; - case 3: - return !!DXd(this); - case 4: - return this.ik() != null; - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!xXd(this); - case 7: - return !!this.A && this.A.i != 0; - case 8: - return (this.Bb & 256) == 0; - } - return Avd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.bi = function n1d(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - LXd(this, WD(b)); - return; - case 2: - IXd(this, WD(b)); - return; - case 5: - KXd(this, WD(b)); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - !this.A && (this.A = new iie(z7, this, 7)); - YGd(this.A, RD(b, 16)); - return; - case 8: - j1d(this, Heb(TD(b))); - return; - } - Bvd(this, a - AYd(this.ii()), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? this.ii() : c2), a), b); - }; - _2.ii = function o1d() { - return JTd(), rTd; - }; - _2.ki = function p1d(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - ZD(this.Cb, 184) && (RD(this.Cb, 184).tb = null); - PAd(this, null); - return; - case 2: - yXd(this, null); - zXd(this, this.D); - return; - case 5: - KXd(this, null); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - return; - case 8: - j1d(this, true); - return; - } - Cvd(this, a - AYd(this.ii()), vYd((b = RD(Ywd(this, 16), 29), !b ? this.ii() : b), a)); - }; - _2.pi = function q1d() { - Oee((lke(), jke), this).xe(); - this.Bb |= 1; - }; - _2.ok = function r1d() { - var a, b, c2; - if (!this.c) { - a = Kje(BXd(this)); - if (!a.dc()) { - for (c2 = a.Kc(); c2.Ob(); ) { - b = WD(c2.Pb()); - !!bAd(this, b) && Jje(this); - } - } - } - return this.b; - }; - _2.ik = function s1d() { - var b; - if (!this.e) { - b = null; - try { - b = DXd(this); - } catch (a) { - a = zdb(a); - if (!ZD(a, 103)) - throw Adb(a); - } - this.d = null; - !!b && (b.i & 1) != 0 && (b == xdb ? this.d = (Geb(), Eeb) : b == kE ? this.d = sgb(0) : b == jE ? this.d = new Tfb(0) : b == iE ? this.d = 0 : b == lE ? this.d = Hgb(0) : b == wdb ? this.d = bhb(0) : b == gE ? this.d = $eb(0) : this.d = hfb(0)); - this.e = true; - } - return this.d; - }; - _2.nk = function t1d() { - return (this.Bb & 256) != 0; - }; - _2.rl = function u1d(a) { - a && (this.D = "org.eclipse.emf.common.util.AbstractEnumerator"); - }; - _2.gl = function v1d(a) { - GXd(this, a); - this.rl(a); - }; - _2.hl = function w1d(a) { - this.C = a; - this.e = false; - }; - _2.Ib = function x1d() { - var a; - if ((this.Db & 64) != 0) - return MXd(this); - a = new Shb(MXd(this)); - a.a += " (serializable: "; - Ohb(a, (this.Bb & 256) != 0); - a.a += ")"; - return a.a; - }; - _2.c = false; - _2.d = null; - _2.e = false; - sfb(SHe, "EDataTypeImpl", 577); - feb(469, 577, { 110: 1, 94: 1, 93: 1, 142: 1, 156: 1, 847: 1, 685: 1, 155: 1, 197: 1, 58: 1, 114: 1, 54: 1, 99: 1, 364: 1, 469: 1, 158: 1, 119: 1, 120: 1, 691: 1 }, A1d); - _2.Lh = function B1d(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return this.D != null ? this.D : this.B; - case 3: - return DXd(this); - case 4: - return y1d(this); - case 5: - return this.F; - case 6: - if (b) - return BXd(this); - return xXd(this); - case 7: - return !this.A && (this.A = new iie(z7, this, 7)), this.A; - case 8: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 9: - return !this.a && (this.a = new C5d(l7, this, 9, 5)), this.a; - } - return zvd(this, a - AYd((JTd(), sTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? sTd : d), a), b, c2); - }; - _2.Sh = function C1d(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 6: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? AXd(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 6, c2); - case 9: - return !this.a && (this.a = new C5d(l7, this, 9, 5)), qLd(this.a, a, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), sTd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((JTd(), sTd)), a, c2); - }; - _2.Uh = function D1d(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 6: - return xvd(this, null, 6, c2); - case 7: - return !this.A && (this.A = new iie(z7, this, 7)), rLd(this.A, a, c2); - case 9: - return !this.a && (this.a = new C5d(l7, this, 9, 5)), rLd(this.a, a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), sTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), sTd)), a, c2); - }; - _2.Wh = function E1d(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return this.D != null && this.D == this.F; - case 3: - return !!DXd(this); - case 4: - return !!y1d(this); - case 5: - return this.F != null && this.F != this.D && this.F != this.B; - case 6: - return !!xXd(this); - case 7: - return !!this.A && this.A.i != 0; - case 8: - return (this.Bb & 256) == 0; - case 9: - return !!this.a && this.a.i != 0; - } - return Avd(this, a - AYd((JTd(), sTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? sTd : b), a)); - }; - _2.bi = function F1d(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - LXd(this, WD(b)); - return; - case 2: - IXd(this, WD(b)); - return; - case 5: - KXd(this, WD(b)); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - !this.A && (this.A = new iie(z7, this, 7)); - YGd(this.A, RD(b, 16)); - return; - case 8: - j1d(this, Heb(TD(b))); - return; - case 9: - !this.a && (this.a = new C5d(l7, this, 9, 5)); - sLd(this.a); - !this.a && (this.a = new C5d(l7, this, 9, 5)); - YGd(this.a, RD(b, 16)); - return; - } - Bvd(this, a - AYd((JTd(), sTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? sTd : c2), a), b); - }; - _2.ii = function G1d() { - return JTd(), sTd; - }; - _2.ki = function H1d(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - ZD(this.Cb, 184) && (RD(this.Cb, 184).tb = null); - PAd(this, null); - return; - case 2: - yXd(this, null); - zXd(this, this.D); - return; - case 5: - KXd(this, null); - return; - case 7: - !this.A && (this.A = new iie(z7, this, 7)); - sLd(this.A); - return; - case 8: - j1d(this, true); - return; - case 9: - !this.a && (this.a = new C5d(l7, this, 9, 5)); - sLd(this.a); - return; - } - Cvd(this, a - AYd((JTd(), sTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? sTd : b), a)); - }; - _2.pi = function I1d() { - var a, b; - if (this.a) { - for (a = 0, b = this.a.i; a < b; ++a) { - aAd(QHd(this.a, a)); - } - } - Oee((lke(), jke), this).xe(); - this.Bb |= 1; - }; - _2.ik = function J1d() { - return y1d(this); - }; - _2.fk = function K1d(a) { - if (a != null) { - return true; - } - return false; - }; - _2.rl = function L1d(a) { - }; - sfb(SHe, "EEnumImpl", 469); - feb(582, 448, { 110: 1, 94: 1, 93: 1, 2039: 1, 694: 1, 155: 1, 197: 1, 58: 1, 114: 1, 54: 1, 99: 1, 582: 1, 158: 1, 119: 1, 120: 1 }, R1d); - _2.xe = function $1d() { - return this.zb; - }; - _2.Ah = function S1d(a) { - return M1d(this, a); - }; - _2.Lh = function T1d(a, b, c2) { - var d, e; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return sgb(this.d); - case 3: - return this.b ? this.b : this.a; - case 4: - return e = this.c, e == null ? this.zb : e; - case 5: - return this.Db >> 16 == 5 ? RD(this.Cb, 685) : null; - } - return zvd(this, a - AYd((JTd(), tTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? tTd : d), a), b, c2); - }; - _2.Sh = function U1d(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 5: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? M1d(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 5, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), tTd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((JTd(), tTd)), a, c2); - }; - _2.Uh = function V1d(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 5: - return xvd(this, null, 5, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), tTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), tTd)), a, c2); - }; - _2.Wh = function W1d(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return this.d != 0; - case 3: - return !!this.b; - case 4: - return this.c != null; - case 5: - return !!(this.Db >> 16 == 5 ? RD(this.Cb, 685) : null); - } - return Avd(this, a - AYd((JTd(), tTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? tTd : b), a)); - }; - _2.bi = function X1d(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - PAd(this, WD(b)); - return; - case 2: - Q1d(this, RD(b, 17).a); - return; - case 3: - O1d(this, RD(b, 2039)); - return; - case 4: - P1d(this, WD(b)); - return; - } - Bvd(this, a - AYd((JTd(), tTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? tTd : c2), a), b); - }; - _2.ii = function Y1d() { - return JTd(), tTd; - }; - _2.ki = function Z1d(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - PAd(this, null); - return; - case 2: - Q1d(this, 0); - return; - case 3: - O1d(this, null); - return; - case 4: - P1d(this, null); - return; - } - Cvd(this, a - AYd((JTd(), tTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? tTd : b), a)); - }; - _2.Ib = function _1d() { - var a; - return a = this.c, a == null ? this.zb : a; - }; - _2.b = null; - _2.c = null; - _2.d = 0; - sfb(SHe, "EEnumLiteralImpl", 582); - var h8 = ufb(SHe, "EFactoryImpl/InternalEDateTimeFormat"); - feb(499, 1, { 2114: 1 }, c2d); - sfb(SHe, "EFactoryImpl/1ClientInternalEDateTimeFormat", 499); - feb(248, 120, { 110: 1, 94: 1, 93: 1, 89: 1, 58: 1, 114: 1, 54: 1, 99: 1, 248: 1, 119: 1, 120: 1 }, s2d); - _2.Ch = function t2d(a, b, c2) { - var d; - c2 = xvd(this, a, b, c2); - if (!!this.e && ZD(a, 179)) { - d = k2d(this, this.e); - d != this.c && (c2 = o2d(this, d, c2)); - } - return c2; - }; - _2.Lh = function u2d(a, b, c2) { - var d; - switch (a) { - case 0: - return this.f; - case 1: - return !this.d && (this.d = new XZd(o7, this, 1)), this.d; - case 2: - if (b) - return i2d(this); - return this.c; - case 3: - return this.b; - case 4: - return this.e; - case 5: - if (b) - return h2d(this); - return this.a; - } - return zvd(this, a - AYd((JTd(), vTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? vTd : d), a), b, c2); - }; - _2.Uh = function v2d(a, b, c2) { - var d, e; - switch (b) { - case 0: - return g2d(this, null, c2); - case 1: - return !this.d && (this.d = new XZd(o7, this, 1)), rLd(this.d, a, c2); - case 3: - return e2d(this, null, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), vTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), vTd)), a, c2); - }; - _2.Wh = function w2d(a) { - var b; - switch (a) { - case 0: - return !!this.f; - case 1: - return !!this.d && this.d.i != 0; - case 2: - return !!this.c; - case 3: - return !!this.b; - case 4: - return !!this.e; - case 5: - return !!this.a; - } - return Avd(this, a - AYd((JTd(), vTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? vTd : b), a)); - }; - _2.bi = function x2d(a, b) { - var c2; - switch (a) { - case 0: - q2d(this, RD(b, 89)); - return; - case 1: - !this.d && (this.d = new XZd(o7, this, 1)); - sLd(this.d); - !this.d && (this.d = new XZd(o7, this, 1)); - YGd(this.d, RD(b, 16)); - return; - case 3: - n2d(this, RD(b, 89)); - return; - case 4: - p2d(this, RD(b, 850)); - return; - case 5: - l2d(this, RD(b, 142)); - return; - } - Bvd(this, a - AYd((JTd(), vTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? vTd : c2), a), b); - }; - _2.ii = function y2d() { - return JTd(), vTd; - }; - _2.ki = function z2d(a) { - var b; - switch (a) { - case 0: - q2d(this, null); - return; - case 1: - !this.d && (this.d = new XZd(o7, this, 1)); - sLd(this.d); - return; - case 3: - n2d(this, null); - return; - case 4: - p2d(this, null); - return; - case 5: - l2d(this, null); - return; - } - Cvd(this, a - AYd((JTd(), vTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? vTd : b), a)); - }; - _2.Ib = function A2d() { - var a; - a = new dib(awd(this)); - a.a += " (expression: "; - r2d(this, a); - a.a += ")"; - return a.a; - }; - var d2d; - sfb(SHe, "EGenericTypeImpl", 248); - feb(2067, 2062, uKe); - _2.Gi = function C2d(a, b) { - B2d(this, a, b); - }; - _2.Wk = function D2d(a, b) { - B2d(this, this.gc(), a); - return b; - }; - _2.$i = function E2d(a) { - return ju(this.pj(), a); - }; - _2.Ii = function F2d() { - return this.Ji(); - }; - _2.pj = function G2d() { - return new mee(this); - }; - _2.Ji = function H2d() { - return this.Ki(0); - }; - _2.Ki = function I2d(a) { - return this.pj().fd(a); - }; - _2.Xk = function J2d(a, b) { - ze(this, a, true); - return b; - }; - _2.Ti = function K2d(a, b) { - var c2, d; - d = ku(this, b); - c2 = this.fd(a); - c2.Rb(d); - return d; - }; - _2.Ui = function L2d(a, b) { - var c2; - ze(this, b, true); - c2 = this.fd(a); - c2.Rb(b); - }; - sfb(ZJe, "AbstractSequentialInternalEList", 2067); - feb(496, 2067, uKe, Q2d); - _2.$i = function R2d(a) { - return ju(this.pj(), a); - }; - _2.Ii = function S2d() { - if (this.b == null) { - return j3d(), j3d(), i3d; - } - return this.sl(); - }; - _2.pj = function T2d() { - return new Whe(this.a, this.b); - }; - _2.Ji = function U2d() { - if (this.b == null) { - return j3d(), j3d(), i3d; - } - return this.sl(); - }; - _2.Ki = function V2d(a) { - var b, c2; - if (this.b == null) { - if (a < 0 || a > 1) { - throw Adb(new veb(HJe + a + ", size=0")); - } - return j3d(), j3d(), i3d; - } - c2 = this.sl(); - for (b = 0; b < a; ++b) { - k3d(c2); - } - return c2; - }; - _2.dc = function W2d() { - var a, b, c2, d, e, f2; - if (this.b != null) { - for (c2 = 0; c2 < this.b.length; ++c2) { - a = this.b[c2]; - if (!this.vl() || this.a.Xh(a)) { - f2 = this.a.Nh(a, false); - nke(); - if (RD(a, 69).xk()) { - b = RD(f2, 160); - for (d = 0, e = b.gc(); d < e; ++d) { - if (O2d(b.Tl(d)) && b.Ul(d) != null) { - return false; - } - } - } else if (a.Jk()) { - if (!RD(f2, 16).dc()) { - return false; - } - } else if (f2 != null) { - return false; - } - } - } - } - return true; - }; - _2.Kc = function X2d() { - return P2d(this); - }; - _2.fd = function Y2d(a) { - var b, c2; - if (this.b == null) { - if (a != 0) { - throw Adb(new veb(HJe + a + ", size=0")); - } - return j3d(), j3d(), i3d; - } - c2 = this.ul() ? this.tl() : this.sl(); - for (b = 0; b < a; ++b) { - k3d(c2); - } - return c2; - }; - _2.Ti = function Z2d(a, b) { - throw Adb(new jib()); - }; - _2.Ui = function $2d(a, b) { - throw Adb(new jib()); - }; - _2.sl = function _2d() { - return new p3d(this.a, this.b); - }; - _2.tl = function a3d() { - return new D3d(this.a, this.b); - }; - _2.ul = function b3d() { - return true; - }; - _2.gc = function c3d() { - var a, b, c2, d, e, f2, g; - e = 0; - if (this.b != null) { - for (c2 = 0; c2 < this.b.length; ++c2) { - a = this.b[c2]; - if (!this.vl() || this.a.Xh(a)) { - g = this.a.Nh(a, false); - nke(); - if (RD(a, 69).xk()) { - b = RD(g, 160); - for (d = 0, f2 = b.gc(); d < f2; ++d) { - O2d(b.Tl(d)) && b.Ul(d) != null && ++e; - } - } else - a.Jk() ? e += RD(g, 16).gc() : g != null && ++e; - } - } - } - return e; - }; - _2.vl = function d3d() { - return true; - }; - var M2d; - sfb(ZJe, "EContentsEList", 496); - feb(1177, 496, uKe, e3d); - _2.sl = function f3d() { - return new H3d(this.a, this.b); - }; - _2.tl = function g3d() { - return new F3d(this.a, this.b); - }; - _2.vl = function h3d() { - return false; - }; - sfb(SHe, "ENamedElementImpl/1", 1177); - feb(287, 1, vKe, p3d); - _2.Nb = function s3d(a) { - Ztb(this, a); - }; - _2.Rb = function q3d(a) { - throw Adb(new jib()); - }; - _2.wl = function r3d(a) { - if (this.g != 0 || !!this.e) { - throw Adb(new dgb("Iterator already in use or already filtered")); - } - this.e = a; - }; - _2.Ob = function t3d() { - var a, b, c2, d, e, f2; - switch (this.g) { - case 3: - case 2: { - return true; - } - case 1: { - return false; - } - case -3: { - !this.p ? ++this.n : this.p.Pb(); - } - default: { - if (!this.k || (!this.p ? !l3d(this) : !m3d(this, this.p))) { - while (this.d < this.c.length) { - b = this.c[this.d++]; - if ((!this.e || b.pk() != C4 || b.Lj() != 0) && (!this.vl() || this.b.Xh(b))) { - f2 = this.b.Nh(b, this.ul()); - this.f = (nke(), RD(b, 69).xk()); - if (this.f || b.Jk()) { - if (this.ul()) { - d = RD(f2, 15); - this.k = d; - } else { - d = RD(f2, 71); - this.k = this.j = d; - } - if (ZD(this.k, 59)) { - this.p = null; - this.o = this.k.gc(); - this.n = 0; - } else { - this.p = !this.j ? this.k.ed() : this.j.Ji(); - } - if (!this.p ? l3d(this) : m3d(this, this.p)) { - e = !this.p ? !this.j ? this.k.Xb(this.n++) : this.j.$i(this.n++) : this.p.Pb(); - if (this.f) { - a = RD(e, 76); - a.Lk(); - c2 = a.md(); - this.i = c2; - } else { - c2 = e; - this.i = c2; - } - this.g = 3; - return true; - } - } else if (f2 != null) { - this.k = null; - this.p = null; - c2 = f2; - this.i = c2; - this.g = 2; - return true; - } - } - } - this.k = null; - this.p = null; - this.f = false; - this.g = 1; - return false; - } else { - e = !this.p ? !this.j ? this.k.Xb(this.n++) : this.j.$i(this.n++) : this.p.Pb(); - if (this.f) { - a = RD(e, 76); - a.Lk(); - c2 = a.md(); - this.i = c2; - } else { - c2 = e; - this.i = c2; - } - this.g = 3; - return true; - } - } - } - }; - _2.Sb = function u3d() { - var a, b, c2, d, e, f2; - switch (this.g) { - case -3: - case -2: { - return true; - } - case -1: { - return false; - } - case 3: { - !this.p ? --this.n : this.p.Ub(); - } - default: { - if (!this.k || (!this.p ? !n3d(this) : !o3d(this, this.p))) { - while (this.d > 0) { - b = this.c[--this.d]; - if ((!this.e || b.pk() != C4 || b.Lj() != 0) && (!this.vl() || this.b.Xh(b))) { - f2 = this.b.Nh(b, this.ul()); - this.f = (nke(), RD(b, 69).xk()); - if (this.f || b.Jk()) { - if (this.ul()) { - d = RD(f2, 15); - this.k = d; - } else { - d = RD(f2, 71); - this.k = this.j = d; - } - if (ZD(this.k, 59)) { - this.o = this.k.gc(); - this.n = this.o; - } else { - this.p = !this.j ? this.k.fd(this.k.gc()) : this.j.Ki(this.k.gc()); - } - if (!this.p ? n3d(this) : o3d(this, this.p)) { - e = !this.p ? !this.j ? this.k.Xb(--this.n) : this.j.$i(--this.n) : this.p.Ub(); - if (this.f) { - a = RD(e, 76); - a.Lk(); - c2 = a.md(); - this.i = c2; - } else { - c2 = e; - this.i = c2; - } - this.g = -3; - return true; - } - } else if (f2 != null) { - this.k = null; - this.p = null; - c2 = f2; - this.i = c2; - this.g = -2; - return true; - } - } - } - this.k = null; - this.p = null; - this.g = -1; - return false; - } else { - e = !this.p ? !this.j ? this.k.Xb(--this.n) : this.j.$i(--this.n) : this.p.Ub(); - if (this.f) { - a = RD(e, 76); - a.Lk(); - c2 = a.md(); - this.i = c2; - } else { - c2 = e; - this.i = c2; - } - this.g = -3; - return true; - } - } - } - }; - _2.Pb = function v3d() { - return k3d(this); - }; - _2.Tb = function w3d() { - return this.a; - }; - _2.Ub = function x3d() { - var a; - if (this.g < -1 || this.Sb()) { - --this.a; - this.g = 0; - a = this.i; - this.Sb(); - return a; - } else { - throw Adb(new Dvb()); - } - }; - _2.Vb = function y3d() { - return this.a - 1; - }; - _2.Qb = function z3d() { - throw Adb(new jib()); - }; - _2.ul = function A3d() { - return false; - }; - _2.Wb = function B3d(a) { - throw Adb(new jib()); - }; - _2.vl = function C3d() { - return true; - }; - _2.a = 0; - _2.d = 0; - _2.f = false; - _2.g = 0; - _2.n = 0; - _2.o = 0; - var i3d; - sfb(ZJe, "EContentsEList/FeatureIteratorImpl", 287); - feb(711, 287, vKe, D3d); - _2.ul = function E3d() { - return true; - }; - sfb(ZJe, "EContentsEList/ResolvingFeatureIteratorImpl", 711); - feb(1178, 711, vKe, F3d); - _2.vl = function G3d() { - return false; - }; - sfb(SHe, "ENamedElementImpl/1/1", 1178); - feb(1179, 287, vKe, H3d); - _2.vl = function I3d() { - return false; - }; - sfb(SHe, "ENamedElementImpl/1/2", 1179); - feb(39, 152, GJe, L3d, M3d, N3d, O3d, P3d, Q3d, R3d, S3d, T3d, U3d, V3d, W3d, X3d, Y3d, Z3d, $3d, _3d, a4d, b4d, c4d, d4d, e4d, f4d, g4d, h4d); - _2.Kj = function i4d() { - return K3d(this); - }; - _2.Rj = function j4d() { - var a; - a = K3d(this); - if (a) { - return a.ik(); - } - return null; - }; - _2.hj = function k4d(a) { - this.b == -1 && !!this.a && (this.b = this.c.Hh(this.a.Lj(), this.a.pk())); - return this.c.yh(this.b, a); - }; - _2.jj = function l4d() { - return this.c; - }; - _2.Sj = function m4d() { - var a; - a = K3d(this); - if (a) { - return a.tk(); - } - return false; - }; - _2.b = -1; - sfb(SHe, "ENotificationImpl", 39); - feb(411, 292, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 62: 1, 114: 1, 481: 1, 54: 1, 99: 1, 158: 1, 411: 1, 292: 1, 119: 1, 120: 1 }, q4d); - _2.Ah = function r4d(a) { - return n4d(this, a); - }; - _2.Lh = function s4d(a, b, c2) { - var d, e, f2; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Geb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return sgb(this.s); - case 5: - return sgb(this.t); - case 6: - return Geb(), f2 = this.t, f2 > 1 || f2 == -1 ? true : false; - case 7: - return Geb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return WVd(this); - return this.r; - case 9: - return this.q; - case 10: - return this.Db >> 16 == 10 ? RD(this.Cb, 29) : null; - case 11: - return !this.d && (this.d = new iie(z7, this, 11)), this.d; - case 12: - return !this.c && (this.c = new C5d(u7, this, 12, 10)), this.c; - case 13: - return !this.a && (this.a = new F4d(this, this)), this.a; - case 14: - return o4d(this); - } - return zvd(this, a - AYd((JTd(), ATd)), vYd((d = RD(Ywd(this, 16), 29), !d ? ATd : d), a), b, c2); - }; - _2.Sh = function t4d(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 10: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? n4d(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 10, c2); - case 12: - return !this.c && (this.c = new C5d(u7, this, 12, 10)), qLd(this.c, a, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), ATd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((JTd(), ATd)), a, c2); - }; - _2.Uh = function u4d(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 9: - return VVd(this, c2); - case 10: - return xvd(this, null, 10, c2); - case 11: - return !this.d && (this.d = new iie(z7, this, 11)), rLd(this.d, a, c2); - case 12: - return !this.c && (this.c = new C5d(u7, this, 12, 10)), rLd(this.c, a, c2); - case 14: - return rLd(o4d(this), a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), ATd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), ATd)), a, c2); - }; - _2.Wh = function v4d(a) { - var b, c2, d; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return (this.Bb & 256) == 0; - case 3: - return (this.Bb & 512) == 0; - case 4: - return this.s != 0; - case 5: - return this.t != 1; - case 6: - return d = this.t, d > 1 || d == -1; - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && j2d(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && j2d(this.q).i == 0); - case 10: - return !!(this.Db >> 16 == 10 ? RD(this.Cb, 29) : null); - case 11: - return !!this.d && this.d.i != 0; - case 12: - return !!this.c && this.c.i != 0; - case 13: - return !!this.a && o4d(this.a.a).i != 0 && !(!!this.b && o5d(this.b)); - case 14: - return !!this.b && o5d(this.b); - } - return Avd(this, a - AYd((JTd(), ATd)), vYd((b = RD(Ywd(this, 16), 29), !b ? ATd : b), a)); - }; - _2.bi = function w4d(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - PAd(this, WD(b)); - return; - case 2: - _Vd(this, Heb(TD(b))); - return; - case 3: - aWd(this, Heb(TD(b))); - return; - case 4: - $Vd(this, RD(b, 17).a); - return; - case 5: - bWd(this, RD(b, 17).a); - return; - case 8: - YVd(this, RD(b, 142)); - return; - case 9: - d = XVd(this, RD(b, 89), null); - !!d && d.oj(); - return; - case 11: - !this.d && (this.d = new iie(z7, this, 11)); - sLd(this.d); - !this.d && (this.d = new iie(z7, this, 11)); - YGd(this.d, RD(b, 16)); - return; - case 12: - !this.c && (this.c = new C5d(u7, this, 12, 10)); - sLd(this.c); - !this.c && (this.c = new C5d(u7, this, 12, 10)); - YGd(this.c, RD(b, 16)); - return; - case 13: - !this.a && (this.a = new F4d(this, this)); - VJd(this.a); - !this.a && (this.a = new F4d(this, this)); - YGd(this.a, RD(b, 16)); - return; - case 14: - sLd(o4d(this)); - YGd(o4d(this), RD(b, 16)); - return; - } - Bvd(this, a - AYd((JTd(), ATd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? ATd : c2), a), b); - }; - _2.ii = function x4d() { - return JTd(), ATd; - }; - _2.ki = function y4d(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - PAd(this, null); - return; - case 2: - _Vd(this, true); - return; - case 3: - aWd(this, true); - return; - case 4: - $Vd(this, 0); - return; - case 5: - bWd(this, 1); - return; - case 8: - YVd(this, null); - return; - case 9: - c2 = XVd(this, null, null); - !!c2 && c2.oj(); - return; - case 11: - !this.d && (this.d = new iie(z7, this, 11)); - sLd(this.d); - return; - case 12: - !this.c && (this.c = new C5d(u7, this, 12, 10)); - sLd(this.c); - return; - case 13: - !!this.a && VJd(this.a); - return; - case 14: - !!this.b && sLd(this.b); - return; - } - Cvd(this, a - AYd((JTd(), ATd)), vYd((b = RD(Ywd(this, 16), 29), !b ? ATd : b), a)); - }; - _2.pi = function z4d() { - var a, b; - if (this.c) { - for (a = 0, b = this.c.i; a < b; ++a) { - aAd(QHd(this.c, a)); - } - } - WVd(this); - this.Bb |= 1; - }; - sfb(SHe, "EOperationImpl", 411); - feb(513, 756, tKe, F4d); - _2.qj = function I4d(a, b) { - A4d(this, a, RD(b, 142)); - }; - _2.rj = function J4d(a) { - B4d(this, RD(a, 142)); - }; - _2.xj = function P4d(a) { - var b, c2; - return b = RD(QHd(o4d(this.a), a), 89), c2 = b.c, c2 ? c2 : (JTd(), wTd); - }; - _2.Cj = function U4d(a) { - var b, c2; - return b = RD(vLd(o4d(this.a), a), 89), c2 = b.c, c2 ? c2 : (JTd(), wTd); - }; - _2.Dj = function V4d(a, b) { - return D4d(this, a, RD(b, 142)); - }; - _2.Li = function G4d() { - return false; - }; - _2.Ij = function H4d(a, b, c2, d, e) { - return null; - }; - _2.sj = function K4d() { - return new l5d(this); - }; - _2.tj = function L4d() { - sLd(o4d(this.a)); - }; - _2.uj = function M4d(a) { - return C4d(this, a); - }; - _2.vj = function N4d(a) { - var b, c2; - for (c2 = a.Kc(); c2.Ob(); ) { - b = c2.Pb(); - if (!C4d(this, b)) { - return false; - } - } - return true; - }; - _2.wj = function O4d(a) { - var b, c2, d; - if (ZD(a, 15)) { - d = RD(a, 15); - if (d.gc() == o4d(this.a).i) { - for (b = d.Kc(), c2 = new dMd(this); b.Ob(); ) { - if (dE(b.Pb()) !== dE(bMd(c2))) { - return false; - } - } - return true; - } - } - return false; - }; - _2.yj = function Q4d() { - var a, b, c2, d, e; - c2 = 1; - for (b = new dMd(o4d(this.a)); b.e != b.i.gc(); ) { - a = RD(bMd(b), 89); - d = (e = a.c, e ? e : (JTd(), wTd)); - c2 = 31 * c2 + (!d ? 0 : tb(d)); - } - return c2; - }; - _2.zj = function R4d(a) { - var b, c2, d, e; - d = 0; - for (c2 = new dMd(o4d(this.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 89); - if (dE(a) === dE((e = b.c, e ? e : (JTd(), wTd)))) { - return d; - } - ++d; - } - return -1; - }; - _2.Aj = function S4d() { - return o4d(this.a).i == 0; - }; - _2.Bj = function T4d() { - return null; - }; - _2.Ej = function W4d() { - return o4d(this.a).i; - }; - _2.Fj = function X4d() { - var a, b, c2, d, e, f2; - f2 = o4d(this.a).i; - e = $C(jJ, rve, 1, f2, 5, 1); - c2 = 0; - for (b = new dMd(o4d(this.a)); b.e != b.i.gc(); ) { - a = RD(bMd(b), 89); - e[c2++] = (d = a.c, d ? d : (JTd(), wTd)); - } - return e; - }; - _2.Gj = function Y4d(a) { - var b, c2, d, e, f2, g, h; - h = o4d(this.a).i; - if (a.length < h) { - e = IMd(rb(a).c, h); - a = e; - } - a.length > h && bD(a, h, null); - d = 0; - for (c2 = new dMd(o4d(this.a)); c2.e != c2.i.gc(); ) { - b = RD(bMd(c2), 89); - f2 = (g = b.c, g ? g : (JTd(), wTd)); - bD(a, d++, f2); - } - return a; - }; - _2.Hj = function Z4d() { - var a, b, c2, d, e; - e = new Qhb(); - e.a += "["; - a = o4d(this.a); - for (b = 0, d = o4d(this.a).i; b < d; ) { - Nhb(e, Ghb((c2 = RD(QHd(a, b), 89).c, c2 ? c2 : (JTd(), wTd)))); - ++b < d && (e.a += pve, e); - } - e.a += "]"; - return e.a; - }; - _2.Jj = function $4d(a) { - }; - _2.Lj = function _4d() { - return 13; - }; - _2.kl = function a5d() { - return true; - }; - _2.Mj = function b5d() { - return false; - }; - _2.ll = function c5d() { - return false; - }; - _2.ml = function d5d() { - return false; - }; - _2.nl = function e5d() { - return true; - }; - _2.al = function f5d() { - return false; - }; - _2.ol = function g5d() { - return true; - }; - _2.fk = function h5d(a) { - return ZD(a, 142); - }; - _2.Qj = function i5d() { - return p4d(this.a); - }; - _2.Si = function j5d() { - return true; - }; - _2.Yi = function k5d() { - return true; - }; - sfb(SHe, "EOperationImpl/1", 513); - feb(1376, 2062, kwe, l5d); - _2.fd = function m5d(a) { - return ZGd(this.a, a); - }; - _2.gc = function n5d() { - return o4d(this.a.a).i; - }; - sfb(SHe, "EOperationImpl/1/1", 1376); - feb(1377, 555, oKe, s5d); - _2.Ti = function w5d(a, b) { - var c2, d; - return c2 = RD(uLd(this, a, b), 89), Mvd(this.e) && eZd(this, new c4d(this.a, 7, (JTd(), BTd), sgb(b), (d = c2.c, d ? d : wTd), a)), c2; - }; - _2.Uj = function x5d(a, b) { - return p5d(this, RD(a, 89), b); - }; - _2.Vj = function y5d(a, b) { - return q5d(this, RD(a, 89), b); - }; - _2.Wj = function z5d(a, b, c2) { - return r5d(this, RD(a, 89), RD(b, 89), c2); - }; - _2.Ij = function t5d(a, b, c2, d, e) { - switch (a) { - case 3: { - return dZd(this, a, b, c2, d, this.i > 1); - } - case 5: { - return dZd(this, a, b, c2, d, this.i - RD(c2, 15).gc() > 0); - } - default: { - return new P3d(this.e, a, this.c, b, c2, d, true); - } - } - }; - _2.Tj = function u5d() { - return true; - }; - _2.Qj = function v5d() { - return o5d(this); - }; - _2.Gk = function A5d() { - sLd(this); - }; - sfb(SHe, "EOperationImpl/2", 1377); - feb(507, 1, { 2037: 1, 507: 1 }, B5d); - sfb(SHe, "EPackageImpl/1", 507); - feb(14, 83, oKe, C5d); - _2.il = function D5d() { - return this.d; - }; - _2.jl = function E5d() { - return this.b; - }; - _2.ml = function F5d() { - return true; - }; - _2.b = 0; - sfb(ZJe, "EObjectContainmentWithInverseEList", 14); - feb(365, 14, oKe, G5d); - _2.nl = function H5d() { - return true; - }; - _2.Wi = function I5d(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectContainmentWithInverseEList/Resolving", 365); - feb(308, 365, oKe, J5d); - _2.Ni = function K5d() { - this.a.tb = null; - }; - sfb(SHe, "EPackageImpl/2", 308); - feb(1278, 1, {}, L5d); - sfb(SHe, "EPackageImpl/3", 1278); - feb(733, 45, Hxe, O5d); - _2._b = function P5d(a) { - return bE(a) ? Yjb(this, a) : !!qtb(this.f, a); - }; - sfb(SHe, "EPackageRegistryImpl", 733); - feb(518, 292, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 2116: 1, 114: 1, 481: 1, 54: 1, 99: 1, 158: 1, 518: 1, 292: 1, 119: 1, 120: 1 }, R5d); - _2.Ah = function S5d(a) { - return Q5d(this, a); - }; - _2.Lh = function T5d(a, b, c2) { - var d, e, f2; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Geb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return sgb(this.s); - case 5: - return sgb(this.t); - case 6: - return Geb(), f2 = this.t, f2 > 1 || f2 == -1 ? true : false; - case 7: - return Geb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return WVd(this); - return this.r; - case 9: - return this.q; - case 10: - return this.Db >> 16 == 10 ? RD(this.Cb, 62) : null; - } - return zvd(this, a - AYd((JTd(), DTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? DTd : d), a), b, c2); - }; - _2.Sh = function U5d(a, b, c2) { - var d, e, f2; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), qLd(this.Ab, a, c2); - case 10: - !!this.Cb && (c2 = (e = this.Db >> 16, e >= 0 ? Q5d(this, c2) : this.Cb.Th(this, -1 - e, null, c2))); - return xvd(this, a, 10, c2); - } - return f2 = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), DTd) : d), b), 69), f2.wk().zk(this, Wwd(this), b - AYd((JTd(), DTd)), a, c2); - }; - _2.Uh = function V5d(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 9: - return VVd(this, c2); - case 10: - return xvd(this, null, 10, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), DTd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), DTd)), a, c2); - }; - _2.Wh = function W5d(a) { - var b, c2, d; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return (this.Bb & 256) == 0; - case 3: - return (this.Bb & 512) == 0; - case 4: - return this.s != 0; - case 5: - return this.t != 1; - case 6: - return d = this.t, d > 1 || d == -1; - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && j2d(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && j2d(this.q).i == 0); - case 10: - return !!(this.Db >> 16 == 10 ? RD(this.Cb, 62) : null); - } - return Avd(this, a - AYd((JTd(), DTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? DTd : b), a)); - }; - _2.ii = function X5d() { - return JTd(), DTd; - }; - sfb(SHe, "EParameterImpl", 518); - feb(102, 462, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 19: 1, 179: 1, 69: 1, 114: 1, 481: 1, 54: 1, 99: 1, 158: 1, 102: 1, 462: 1, 292: 1, 119: 1, 120: 1, 692: 1 }, d6d); - _2.Lh = function e6d(a, b, c2) { - var d, e, f2, g; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return Geb(), (this.Bb & 256) != 0 ? true : false; - case 3: - return Geb(), (this.Bb & 512) != 0 ? true : false; - case 4: - return sgb(this.s); - case 5: - return sgb(this.t); - case 6: - return Geb(), g = this.t, g > 1 || g == -1 ? true : false; - case 7: - return Geb(), e = this.s, e >= 1 ? true : false; - case 8: - if (b) - return WVd(this); - return this.r; - case 9: - return this.q; - case 10: - return Geb(), (this.Bb & gwe) != 0 ? true : false; - case 11: - return Geb(), (this.Bb & cKe) != 0 ? true : false; - case 12: - return Geb(), (this.Bb & qxe) != 0 ? true : false; - case 13: - return this.j; - case 14: - return tWd(this); - case 15: - return Geb(), (this.Bb & bKe) != 0 ? true : false; - case 16: - return Geb(), (this.Bb & Ove) != 0 ? true : false; - case 17: - return uWd(this); - case 18: - return Geb(), (this.Bb & QHe) != 0 ? true : false; - case 19: - return Geb(), f2 = Z5d(this), !!f2 && (f2.Bb & QHe) != 0 ? true : false; - case 20: - return Geb(), (this.Bb & txe) != 0 ? true : false; - case 21: - if (b) - return Z5d(this); - return this.b; - case 22: - if (b) - return $5d(this); - return Y5d(this); - case 23: - return !this.a && (this.a = new zie(g7, this, 23)), this.a; - } - return zvd(this, a - AYd((JTd(), ETd)), vYd((d = RD(Ywd(this, 16), 29), !d ? ETd : d), a), b, c2); - }; - _2.Wh = function f6d(a) { - var b, c2, d, e; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return (this.Bb & 256) == 0; - case 3: - return (this.Bb & 512) == 0; - case 4: - return this.s != 0; - case 5: - return this.t != 1; - case 6: - return e = this.t, e > 1 || e == -1; - case 7: - return c2 = this.s, c2 >= 1; - case 8: - return !!this.r && !this.q.e && j2d(this.q).i == 0; - case 9: - return !!this.q && !(!!this.r && !this.q.e && j2d(this.q).i == 0); - case 10: - return (this.Bb & gwe) == 0; - case 11: - return (this.Bb & cKe) != 0; - case 12: - return (this.Bb & qxe) != 0; - case 13: - return this.j != null; - case 14: - return tWd(this) != null; - case 15: - return (this.Bb & bKe) != 0; - case 16: - return (this.Bb & Ove) != 0; - case 17: - return !!uWd(this); - case 18: - return (this.Bb & QHe) != 0; - case 19: - return d = Z5d(this), !!d && (d.Bb & QHe) != 0; - case 20: - return (this.Bb & txe) == 0; - case 21: - return !!this.b; - case 22: - return !!Y5d(this); - case 23: - return !!this.a && this.a.i != 0; - } - return Avd(this, a - AYd((JTd(), ETd)), vYd((b = RD(Ywd(this, 16), 29), !b ? ETd : b), a)); - }; - _2.bi = function g6d(a, b) { - var c2, d; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - CWd(this, WD(b)); - return; - case 2: - _Vd(this, Heb(TD(b))); - return; - case 3: - aWd(this, Heb(TD(b))); - return; - case 4: - $Vd(this, RD(b, 17).a); - return; - case 5: - bWd(this, RD(b, 17).a); - return; - case 8: - YVd(this, RD(b, 142)); - return; - case 9: - d = XVd(this, RD(b, 89), null); - !!d && d.oj(); - return; - case 10: - xWd(this, Heb(TD(b))); - return; - case 11: - FWd(this, Heb(TD(b))); - return; - case 12: - DWd(this, Heb(TD(b))); - return; - case 13: - yWd(this, WD(b)); - return; - case 15: - EWd(this, Heb(TD(b))); - return; - case 16: - AWd(this, Heb(TD(b))); - return; - case 18: - _5d(this, Heb(TD(b))); - return; - case 20: - c6d(this, Heb(TD(b))); - return; - case 21: - b6d(this, RD(b, 19)); - return; - case 23: - !this.a && (this.a = new zie(g7, this, 23)); - sLd(this.a); - !this.a && (this.a = new zie(g7, this, 23)); - YGd(this.a, RD(b, 16)); - return; - } - Bvd(this, a - AYd((JTd(), ETd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? ETd : c2), a), b); - }; - _2.ii = function h6d() { - return JTd(), ETd; - }; - _2.ki = function i6d(a) { - var b, c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - ZD(this.Cb, 90) && v$d(yYd(RD(this.Cb, 90)), 4); - PAd(this, null); - return; - case 2: - _Vd(this, true); - return; - case 3: - aWd(this, true); - return; - case 4: - $Vd(this, 0); - return; - case 5: - bWd(this, 1); - return; - case 8: - YVd(this, null); - return; - case 9: - c2 = XVd(this, null, null); - !!c2 && c2.oj(); - return; - case 10: - xWd(this, true); - return; - case 11: - FWd(this, false); - return; - case 12: - DWd(this, false); - return; - case 13: - this.i = null; - zWd(this, null); - return; - case 15: - EWd(this, false); - return; - case 16: - AWd(this, false); - return; - case 18: - a6d(this, false); - ZD(this.Cb, 90) && v$d(yYd(RD(this.Cb, 90)), 2); - return; - case 20: - c6d(this, true); - return; - case 21: - b6d(this, null); - return; - case 23: - !this.a && (this.a = new zie(g7, this, 23)); - sLd(this.a); - return; - } - Cvd(this, a - AYd((JTd(), ETd)), vYd((b = RD(Ywd(this, 16), 29), !b ? ETd : b), a)); - }; - _2.pi = function j6d() { - $5d(this); - Afe(Qee((lke(), jke), this)); - WVd(this); - this.Bb |= 1; - }; - _2.uk = function k6d() { - return Z5d(this); - }; - _2._k = function l6d() { - var a; - return a = Z5d(this), !!a && (a.Bb & QHe) != 0; - }; - _2.al = function m6d() { - return (this.Bb & QHe) != 0; - }; - _2.bl = function n6d() { - return (this.Bb & txe) != 0; - }; - _2.Yk = function o6d(a, b) { - this.c = null; - return ZVd(this, a, b); - }; - _2.Ib = function p6d() { - var a; - if ((this.Db & 64) != 0) - return GWd(this); - a = new Shb(GWd(this)); - a.a += " (containment: "; - Ohb(a, (this.Bb & QHe) != 0); - a.a += ", resolveProxies: "; - Ohb(a, (this.Bb & txe) != 0); - a.a += ")"; - return a.a; - }; - sfb(SHe, "EReferenceImpl", 102); - feb(561, 120, { 110: 1, 44: 1, 94: 1, 93: 1, 136: 1, 58: 1, 114: 1, 54: 1, 99: 1, 561: 1, 119: 1, 120: 1 }, v6d); - _2.Fb = function B6d(a) { - return this === a; - }; - _2.ld = function D6d() { - return this.b; - }; - _2.md = function E6d() { - return this.c; - }; - _2.Hb = function F6d() { - return kFb(this); - }; - _2.Di = function H6d(a) { - q6d(this, WD(a)); - }; - _2.nd = function I6d(a) { - return u6d(this, WD(a)); - }; - _2.Lh = function w6d(a, b, c2) { - var d; - switch (a) { - case 0: - return this.b; - case 1: - return this.c; - } - return zvd(this, a - AYd((JTd(), FTd)), vYd((d = RD(Ywd(this, 16), 29), !d ? FTd : d), a), b, c2); - }; - _2.Wh = function x6d(a) { - var b; - switch (a) { - case 0: - return this.b != null; - case 1: - return this.c != null; - } - return Avd(this, a - AYd((JTd(), FTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? FTd : b), a)); - }; - _2.bi = function y6d(a, b) { - var c2; - switch (a) { - case 0: - r6d(this, WD(b)); - return; - case 1: - t6d(this, WD(b)); - return; - } - Bvd(this, a - AYd((JTd(), FTd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? FTd : c2), a), b); - }; - _2.ii = function z6d() { - return JTd(), FTd; - }; - _2.ki = function A6d(a) { - var b; - switch (a) { - case 0: - s6d(this, null); - return; - case 1: - t6d(this, null); - return; - } - Cvd(this, a - AYd((JTd(), FTd)), vYd((b = RD(Ywd(this, 16), 29), !b ? FTd : b), a)); - }; - _2.Bi = function C6d() { - var a; - if (this.a == -1) { - a = this.b; - this.a = a == null ? 0 : ohb(a); - } - return this.a; - }; - _2.Ci = function G6d(a) { - this.a = a; - }; - _2.Ib = function J6d() { - var a; - if ((this.Db & 64) != 0) - return awd(this); - a = new Shb(awd(this)); - a.a += " (key: "; - Nhb(a, this.b); - a.a += ", value: "; - Nhb(a, this.c); - a.a += ")"; - return a.a; - }; - _2.a = -1; - _2.b = null; - _2.c = null; - var C8 = sfb(SHe, "EStringToStringMapEntryImpl", 561); - var Ibb = ufb(ZJe, "FeatureMap/Entry/Internal"); - feb(576, 1, wKe); - _2.xl = function M6d(a) { - return this.yl(RD(a, 54)); - }; - _2.yl = function N6d(a) { - return this.xl(a); - }; - _2.Fb = function O6d(a) { - var b, c2; - if (this === a) { - return true; - } else if (ZD(a, 76)) { - b = RD(a, 76); - if (b.Lk() == this.c) { - c2 = this.md(); - return c2 == null ? b.md() == null : pb(c2, b.md()); - } else { - return false; - } - } else { - return false; - } - }; - _2.Lk = function P6d() { - return this.c; - }; - _2.Hb = function Q6d() { - var a; - a = this.md(); - return tb(this.c) ^ (a == null ? 0 : tb(a)); - }; - _2.Ib = function R6d() { - var a, b; - a = this.c; - b = BXd(a.qk()).yi(); - a.xe(); - return (b != null && b.length != 0 ? b + ":" + a.xe() : a.xe()) + "=" + this.md(); - }; - sfb(SHe, "EStructuralFeatureImpl/BasicFeatureMapEntry", 576); - feb(791, 576, wKe, U6d); - _2.yl = function V6d(a) { - return new U6d(this.c, a); - }; - _2.md = function W6d() { - return this.a; - }; - _2.zl = function X6d(a, b, c2) { - return S6d(this, a, this.a, b, c2); - }; - _2.Al = function Y6d(a, b, c2) { - return T6d(this, a, this.a, b, c2); - }; - sfb(SHe, "EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry", 791); - feb(1350, 1, {}, Z6d); - _2.yk = function $6d(a, b, c2, d, e) { - var f2; - f2 = RD(Evd(a, this.b), 220); - return f2.Yl(this.a).Fk(d); - }; - _2.zk = function _6d(a, b, c2, d, e) { - var f2; - f2 = RD(Evd(a, this.b), 220); - return f2.Pl(this.a, d, e); - }; - _2.Ak = function a7d(a, b, c2, d, e) { - var f2; - f2 = RD(Evd(a, this.b), 220); - return f2.Ql(this.a, d, e); - }; - _2.Bk = function b7d(a, b, c2) { - var d; - d = RD(Evd(a, this.b), 220); - return d.Yl(this.a).Qj(); - }; - _2.Ck = function c7d(a, b, c2, d) { - var e; - e = RD(Evd(a, this.b), 220); - e.Yl(this.a).Wb(d); - }; - _2.Dk = function d7d(a, b, c2) { - return RD(Evd(a, this.b), 220).Yl(this.a); - }; - _2.Ek = function e7d(a, b, c2) { - var d; - d = RD(Evd(a, this.b), 220); - d.Yl(this.a).Gk(); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator", 1350); - feb(91, 1, {}, g7d, h7d, i7d, j7d); - _2.yk = function k7d(a, b, c2, d, e) { - var f2; - f2 = b.li(c2); - f2 == null && b.mi(c2, f2 = f7d(this, a)); - if (!e) { - switch (this.e) { - case 50: - case 41: - return RD(f2, 597).bk(); - case 40: - return RD(f2, 220).Vl(); - } - } - return f2; - }; - _2.zk = function l7d(a, b, c2, d, e) { - var f2, g; - g = b.li(c2); - g == null && b.mi(c2, g = f7d(this, a)); - f2 = RD(g, 71).Wk(d, e); - return f2; - }; - _2.Ak = function m7d(a, b, c2, d, e) { - var f2; - f2 = b.li(c2); - f2 != null && (e = RD(f2, 71).Xk(d, e)); - return e; - }; - _2.Bk = function n7d(a, b, c2) { - var d; - d = b.li(c2); - return d != null && RD(d, 79).Qj(); - }; - _2.Ck = function o7d(a, b, c2, d) { - var e; - e = RD(b.li(c2), 79); - !e && b.mi(c2, e = f7d(this, a)); - e.Wb(d); - }; - _2.Dk = function p7d(a, b, c2) { - var d, e; - e = b.li(c2); - e == null && b.mi(c2, e = f7d(this, a)); - if (ZD(e, 79)) { - return RD(e, 79); - } else { - d = RD(b.li(c2), 15); - return new I9d(d); - } - }; - _2.Ek = function q7d(a, b, c2) { - var d; - d = RD(b.li(c2), 79); - !d && b.mi(c2, d = f7d(this, a)); - d.Gk(); - }; - _2.b = 0; - _2.e = 0; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateMany", 91); - feb(512, 1, {}); - _2.zk = function u7d(a, b, c2, d, e) { - throw Adb(new jib()); - }; - _2.Ak = function v7d(a, b, c2, d, e) { - throw Adb(new jib()); - }; - _2.Dk = function w7d(a, b, c2) { - return new x7d(this, a, b, c2); - }; - var r7d; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingle", 512); - feb(1367, 1, $Je, x7d); - _2.Fk = function y7d(a) { - return this.a.yk(this.c, this.d, this.b, a, true); - }; - _2.Qj = function z7d() { - return this.a.Bk(this.c, this.d, this.b); - }; - _2.Wb = function A7d(a) { - this.a.Ck(this.c, this.d, this.b, a); - }; - _2.Gk = function B7d() { - this.a.Ek(this.c, this.d, this.b); - }; - _2.b = 0; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingle/1", 1367); - feb(784, 512, {}, C7d); - _2.yk = function D7d(a, b, c2, d, e) { - return jwd(a, a.Ph(), a.Fh()) == this.b ? this.bl() && d ? yvd(a) : a.Ph() : null; - }; - _2.zk = function E7d(a, b, c2, d, e) { - var f2, g; - !!a.Ph() && (e = (f2 = a.Fh(), f2 >= 0 ? a.Ah(e) : a.Ph().Th(a, -1 - f2, null, e))); - g = BYd(a.Dh(), this.e); - return a.Ch(d, g, e); - }; - _2.Ak = function F7d(a, b, c2, d, e) { - var f2; - f2 = BYd(a.Dh(), this.e); - return a.Ch(null, f2, e); - }; - _2.Bk = function G7d(a, b, c2) { - var d; - d = BYd(a.Dh(), this.e); - return !!a.Ph() && a.Fh() == d; - }; - _2.Ck = function H7d(a, b, c2, d) { - var e, f2, g, h, i2; - if (d != null && !FXd(this.a, d)) { - throw Adb(new Ifb(xKe + (ZD(d, 58) ? GYd(RD(d, 58).Dh()) : ofb(rb(d))) + yKe + this.a + "'")); - } - e = a.Ph(); - g = BYd(a.Dh(), this.e); - if (dE(d) !== dE(e) || a.Fh() != g && d != null) { - if (Oje(a, RD(d, 58))) - throw Adb(new agb(UHe + a.Ib())); - i2 = null; - !!e && (i2 = (f2 = a.Fh(), f2 >= 0 ? a.Ah(i2) : a.Ph().Th(a, -1 - f2, null, i2))); - h = RD(d, 54); - !!h && (i2 = h.Rh(a, BYd(h.Dh(), this.b), null, i2)); - i2 = a.Ch(h, g, i2); - !!i2 && i2.oj(); - } else { - a.vh() && a.wh() && qvd(a, new N3d(a, 1, g, d, d)); - } - }; - _2.Ek = function I7d(a, b, c2) { - var d, e, f2, g; - d = a.Ph(); - if (d) { - g = (e = a.Fh(), e >= 0 ? a.Ah(null) : a.Ph().Th(a, -1 - e, null, null)); - f2 = BYd(a.Dh(), this.e); - g = a.Ch(null, f2, g); - !!g && g.oj(); - } else { - a.vh() && a.wh() && qvd(a, new b4d(a, 1, this.e, null, null)); - } - }; - _2.bl = function J7d() { - return false; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleContainer", 784); - feb(1351, 784, {}, K7d); - _2.bl = function L7d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving", 1351); - feb(574, 512, {}); - _2.yk = function O7d(a, b, c2, d, e) { - var f2; - return f2 = b.li(c2), f2 == null ? this.b : dE(f2) === dE(r7d) ? null : f2; - }; - _2.Bk = function P7d(a, b, c2) { - var d; - d = b.li(c2); - return d != null && (dE(d) === dE(r7d) || !pb(d, this.b)); - }; - _2.Ck = function Q7d(a, b, c2, d) { - var e, f2; - if (a.vh() && a.wh()) { - e = (f2 = b.li(c2), f2 == null ? this.b : dE(f2) === dE(r7d) ? null : f2); - if (d == null) { - if (this.c != null) { - b.mi(c2, null); - d = this.b; - } else - this.b != null ? b.mi(c2, r7d) : b.mi(c2, null); - } else { - this.Bl(d); - b.mi(c2, d); - } - qvd(a, this.d.Cl(a, 1, this.e, e, d)); - } else { - if (d == null) { - this.c != null ? b.mi(c2, null) : this.b != null ? b.mi(c2, r7d) : b.mi(c2, null); - } else { - this.Bl(d); - b.mi(c2, d); - } - } - }; - _2.Ek = function R7d(a, b, c2) { - var d, e; - if (a.vh() && a.wh()) { - d = (e = b.li(c2), e == null ? this.b : dE(e) === dE(r7d) ? null : e); - b.ni(c2); - qvd(a, this.d.Cl(a, 1, this.e, d, this.b)); - } else { - b.ni(c2); - } - }; - _2.Bl = function S7d(a) { - throw Adb(new Hfb()); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData", 574); - feb(zKe, 1, {}, b8d); - _2.Cl = function c8d(a, b, c2, d, e) { - return new b4d(a, b, c2, d, e); - }; - _2.Dl = function d8d(a, b, c2, d, e, f2) { - return new d4d(a, b, c2, d, e, f2); - }; - var T7d, U7d, V7d, W7d, X7d, Y7d, Z7d, $7d, _7d; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator", zKe); - feb(1368, zKe, {}, e8d); - _2.Cl = function f8d(a, b, c2, d, e) { - return new g4d(a, b, c2, Heb(TD(d)), Heb(TD(e))); - }; - _2.Dl = function g8d(a, b, c2, d, e, f2) { - return new h4d(a, b, c2, Heb(TD(d)), Heb(TD(e)), f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1", 1368); - feb(1369, zKe, {}, h8d); - _2.Cl = function i8d(a, b, c2, d, e) { - return new R3d(a, b, c2, RD(d, 222).a, RD(e, 222).a); - }; - _2.Dl = function j8d(a, b, c2, d, e, f2) { - return new S3d(a, b, c2, RD(d, 222).a, RD(e, 222).a, f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2", 1369); - feb(1370, zKe, {}, k8d); - _2.Cl = function l8d(a, b, c2, d, e) { - return new T3d(a, b, c2, RD(d, 180).a, RD(e, 180).a); - }; - _2.Dl = function m8d(a, b, c2, d, e, f2) { - return new U3d(a, b, c2, RD(d, 180).a, RD(e, 180).a, f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3", 1370); - feb(1371, zKe, {}, n8d); - _2.Cl = function o8d(a, b, c2, d, e) { - return new V3d(a, b, c2, Kfb(UD(d)), Kfb(UD(e))); - }; - _2.Dl = function p8d(a, b, c2, d, e, f2) { - return new W3d(a, b, c2, Kfb(UD(d)), Kfb(UD(e)), f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4", 1371); - feb(1372, zKe, {}, q8d); - _2.Cl = function r8d(a, b, c2, d, e) { - return new X3d(a, b, c2, RD(d, 161).a, RD(e, 161).a); - }; - _2.Dl = function s8d(a, b, c2, d, e, f2) { - return new Y3d(a, b, c2, RD(d, 161).a, RD(e, 161).a, f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5", 1372); - feb(1373, zKe, {}, t8d); - _2.Cl = function u8d(a, b, c2, d, e) { - return new Z3d(a, b, c2, RD(d, 17).a, RD(e, 17).a); - }; - _2.Dl = function v8d(a, b, c2, d, e, f2) { - return new $3d(a, b, c2, RD(d, 17).a, RD(e, 17).a, f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6", 1373); - feb(1374, zKe, {}, w8d); - _2.Cl = function x8d(a, b, c2, d, e) { - return new _3d(a, b, c2, RD(d, 168).a, RD(e, 168).a); - }; - _2.Dl = function y8d(a, b, c2, d, e, f2) { - return new a4d(a, b, c2, RD(d, 168).a, RD(e, 168).a, f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7", 1374); - feb(1375, zKe, {}, z8d); - _2.Cl = function A8d(a, b, c2, d, e) { - return new e4d(a, b, c2, RD(d, 191).a, RD(e, 191).a); - }; - _2.Dl = function B8d(a, b, c2, d, e, f2) { - return new f4d(a, b, c2, RD(d, 191).a, RD(e, 191).a, f2); - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8", 1375); - feb(1353, 574, {}, C8d); - _2.Bl = function D8d(a) { - if (!this.a.fk(a)) { - throw Adb(new Ifb(xKe + rb(a) + yKe + this.a + "'")); - } - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic", 1353); - feb(1354, 574, {}, E8d); - _2.Bl = function F8d(a) { - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic", 1354); - feb(785, 574, {}); - _2.Bk = function G8d(a, b, c2) { - var d; - d = b.li(c2); - return d != null; - }; - _2.Ck = function H8d(a, b, c2, d) { - var e, f2; - if (a.vh() && a.wh()) { - e = true; - f2 = b.li(c2); - if (f2 == null) { - e = false; - f2 = this.b; - } else - dE(f2) === dE(r7d) && (f2 = null); - if (d == null) { - if (this.c != null) { - b.mi(c2, null); - d = this.b; - } else { - b.mi(c2, r7d); - } - } else { - this.Bl(d); - b.mi(c2, d); - } - qvd(a, this.d.Dl(a, 1, this.e, f2, d, !e)); - } else { - if (d == null) { - this.c != null ? b.mi(c2, null) : b.mi(c2, r7d); - } else { - this.Bl(d); - b.mi(c2, d); - } - } - }; - _2.Ek = function I8d(a, b, c2) { - var d, e; - if (a.vh() && a.wh()) { - d = true; - e = b.li(c2); - if (e == null) { - d = false; - e = this.b; - } else - dE(e) === dE(r7d) && (e = null); - b.ni(c2); - qvd(a, this.d.Dl(a, 2, this.e, e, this.b, d)); - } else { - b.ni(c2); - } - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable", 785); - feb(1355, 785, {}, J8d); - _2.Bl = function K8d(a) { - if (!this.a.fk(a)) { - throw Adb(new Ifb(xKe + rb(a) + yKe + this.a + "'")); - } - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic", 1355); - feb(1356, 785, {}, L8d); - _2.Bl = function M8d(a) { - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic", 1356); - feb(410, 512, {}, N8d); - _2.yk = function P8d(a, b, c2, d, e) { - var f2, g, h, i2, j; - j = b.li(c2); - if (this.tk() && dE(j) === dE(r7d)) { - return null; - } else if (this.bl() && d && j != null) { - h = RD(j, 54); - if (h.Vh()) { - i2 = Vvd(a, h); - if (h != i2) { - if (!FXd(this.a, i2)) { - throw Adb(new Ifb(xKe + rb(i2) + yKe + this.a + "'")); - } - b.mi(c2, j = i2); - if (this.al()) { - f2 = RD(i2, 54); - g = h.Th(a, !this.b ? -1 - BYd(a.Dh(), this.e) : BYd(h.Dh(), this.b), null, null); - !f2.Ph() && (g = f2.Rh(a, !this.b ? -1 - BYd(a.Dh(), this.e) : BYd(f2.Dh(), this.b), null, g)); - !!g && g.oj(); - } - a.vh() && a.wh() && qvd(a, new b4d(a, 9, this.e, h, i2)); - } - } - return j; - } else { - return j; - } - }; - _2.zk = function Q8d(a, b, c2, d, e) { - var f2, g; - g = b.li(c2); - dE(g) === dE(r7d) && (g = null); - b.mi(c2, d); - if (this.Mj()) { - if (dE(g) !== dE(d) && g != null) { - f2 = RD(g, 54); - e = f2.Th(a, BYd(f2.Dh(), this.b), null, e); - } - } else - this.al() && g != null && (e = RD(g, 54).Th(a, -1 - BYd(a.Dh(), this.e), null, e)); - if (a.vh() && a.wh()) { - !e && (e = new gLd(4)); - e.nj(new b4d(a, 1, this.e, g, d)); - } - return e; - }; - _2.Ak = function R8d(a, b, c2, d, e) { - var f2; - f2 = b.li(c2); - dE(f2) === dE(r7d) && (f2 = null); - b.ni(c2); - if (a.vh() && a.wh()) { - !e && (e = new gLd(4)); - this.tk() ? e.nj(new b4d(a, 2, this.e, f2, null)) : e.nj(new b4d(a, 1, this.e, f2, null)); - } - return e; - }; - _2.Bk = function S8d(a, b, c2) { - var d; - d = b.li(c2); - return d != null; - }; - _2.Ck = function T8d(a, b, c2, d) { - var e, f2, g, h, i2; - if (d != null && !FXd(this.a, d)) { - throw Adb(new Ifb(xKe + (ZD(d, 58) ? GYd(RD(d, 58).Dh()) : ofb(rb(d))) + yKe + this.a + "'")); - } - i2 = b.li(c2); - h = i2 != null; - this.tk() && dE(i2) === dE(r7d) && (i2 = null); - g = null; - if (this.Mj()) { - if (dE(i2) !== dE(d)) { - if (i2 != null) { - e = RD(i2, 54); - g = e.Th(a, BYd(e.Dh(), this.b), null, g); - } - if (d != null) { - e = RD(d, 54); - g = e.Rh(a, BYd(e.Dh(), this.b), null, g); - } - } - } else if (this.al()) { - if (dE(i2) !== dE(d)) { - i2 != null && (g = RD(i2, 54).Th(a, -1 - BYd(a.Dh(), this.e), null, g)); - d != null && (g = RD(d, 54).Rh(a, -1 - BYd(a.Dh(), this.e), null, g)); - } - } - d == null && this.tk() ? b.mi(c2, r7d) : b.mi(c2, d); - if (a.vh() && a.wh()) { - f2 = new d4d(a, 1, this.e, i2, d, this.tk() && !h); - if (!g) { - qvd(a, f2); - } else { - g.nj(f2); - g.oj(); - } - } else - !!g && g.oj(); - }; - _2.Ek = function U8d(a, b, c2) { - var d, e, f2, g, h; - h = b.li(c2); - g = h != null; - this.tk() && dE(h) === dE(r7d) && (h = null); - f2 = null; - if (h != null) { - if (this.Mj()) { - d = RD(h, 54); - f2 = d.Th(a, BYd(d.Dh(), this.b), null, f2); - } else - this.al() && (f2 = RD(h, 54).Th(a, -1 - BYd(a.Dh(), this.e), null, f2)); - } - b.ni(c2); - if (a.vh() && a.wh()) { - e = new d4d(a, this.tk() ? 2 : 1, this.e, h, null, g); - if (!f2) { - qvd(a, e); - } else { - f2.nj(e); - f2.oj(); - } - } else - !!f2 && f2.oj(); - }; - _2.Mj = function V8d() { - return false; - }; - _2.al = function W8d() { - return false; - }; - _2.bl = function X8d() { - return false; - }; - _2.tk = function Y8d() { - return false; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObject", 410); - feb(575, 410, {}, Z8d); - _2.al = function $8d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment", 575); - feb(1359, 575, {}, _8d); - _2.bl = function a9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving", 1359); - feb(787, 575, {}, b9d); - _2.tk = function c9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable", 787); - feb(1361, 787, {}, d9d); - _2.bl = function e9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving", 1361); - feb(650, 575, {}, f9d); - _2.Mj = function g9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse", 650); - feb(1360, 650, {}, h9d); - _2.bl = function i9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving", 1360); - feb(788, 650, {}, j9d); - _2.tk = function k9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable", 788); - feb(1362, 788, {}, l9d); - _2.bl = function m9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving", 1362); - feb(651, 410, {}, n9d); - _2.bl = function o9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving", 651); - feb(1363, 651, {}, p9d); - _2.tk = function q9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable", 1363); - feb(789, 651, {}, r9d); - _2.Mj = function s9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse", 789); - feb(1364, 789, {}, t9d); - _2.tk = function u9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable", 1364); - feb(1357, 410, {}, v9d); - _2.tk = function w9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable", 1357); - feb(786, 410, {}, x9d); - _2.Mj = function y9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse", 786); - feb(1358, 786, {}, z9d); - _2.tk = function A9d() { - return true; - }; - sfb(SHe, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable", 1358); - feb(790, 576, wKe, D9d); - _2.yl = function E9d(a) { - return new D9d(this.a, this.c, a); - }; - _2.md = function F9d() { - return this.b; - }; - _2.zl = function G9d(a, b, c2) { - return B9d(this, a, this.b, c2); - }; - _2.Al = function H9d(a, b, c2) { - return C9d(this, a, this.b, c2); - }; - sfb(SHe, "EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry", 790); - feb(1365, 1, $Je, I9d); - _2.Fk = function J9d(a) { - return this.a; - }; - _2.Qj = function K9d() { - return ZD(this.a, 97) ? RD(this.a, 97).Qj() : !this.a.dc(); - }; - _2.Wb = function L9d(a) { - this.a.$b(); - this.a.Gc(RD(a, 15)); - }; - _2.Gk = function M9d() { - ZD(this.a, 97) ? RD(this.a, 97).Gk() : this.a.$b(); - }; - sfb(SHe, "EStructuralFeatureImpl/SettingMany", 1365); - feb(1366, 576, wKe, N9d); - _2.xl = function O9d(a) { - return new S9d((nme(), mme), this.b.ri(this.a, a)); - }; - _2.md = function P9d() { - return null; - }; - _2.zl = function Q9d(a, b, c2) { - return c2; - }; - _2.Al = function R9d(a, b, c2) { - return c2; - }; - sfb(SHe, "EStructuralFeatureImpl/SimpleContentFeatureMapEntry", 1366); - feb(652, 576, wKe, S9d); - _2.xl = function T9d(a) { - return new S9d(this.c, a); - }; - _2.md = function U9d() { - return this.a; - }; - _2.zl = function V9d(a, b, c2) { - return c2; - }; - _2.Al = function W9d(a, b, c2) { - return c2; - }; - sfb(SHe, "EStructuralFeatureImpl/SimpleFeatureMapEntry", 652); - feb(403, 506, PIe, X9d); - _2.aj = function Y9d(a) { - return $C(h7, rve, 29, a, 0, 1); - }; - _2.Yi = function Z9d() { - return false; - }; - sfb(SHe, "ESuperAdapter/1", 403); - feb(457, 448, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 114: 1, 850: 1, 54: 1, 99: 1, 158: 1, 457: 1, 119: 1, 120: 1 }, _9d); - _2.Lh = function aae(a, b, c2) { - var d; - switch (a) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), this.Ab; - case 1: - return this.zb; - case 2: - return !this.a && (this.a = new iae(this, o7, this)), this.a; - } - return zvd(this, a - AYd((JTd(), ITd)), vYd((d = RD(Ywd(this, 16), 29), !d ? ITd : d), a), b, c2); - }; - _2.Uh = function bae(a, b, c2) { - var d, e; - switch (b) { - case 0: - return !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)), rLd(this.Ab, a, c2); - case 2: - return !this.a && (this.a = new iae(this, o7, this)), rLd(this.a, a, c2); - } - return e = RD(vYd((d = RD(Ywd(this, 16), 29), !d ? (JTd(), ITd) : d), b), 69), e.wk().Ak(this, Wwd(this), b - AYd((JTd(), ITd)), a, c2); - }; - _2.Wh = function cae(a) { - var b; - switch (a) { - case 0: - return !!this.Ab && this.Ab.i != 0; - case 1: - return this.zb != null; - case 2: - return !!this.a && this.a.i != 0; - } - return Avd(this, a - AYd((JTd(), ITd)), vYd((b = RD(Ywd(this, 16), 29), !b ? ITd : b), a)); - }; - _2.bi = function dae(a, b) { - var c2; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - YGd(this.Ab, RD(b, 16)); - return; - case 1: - PAd(this, WD(b)); - return; - case 2: - !this.a && (this.a = new iae(this, o7, this)); - sLd(this.a); - !this.a && (this.a = new iae(this, o7, this)); - YGd(this.a, RD(b, 16)); - return; - } - Bvd(this, a - AYd((JTd(), ITd)), vYd((c2 = RD(Ywd(this, 16), 29), !c2 ? ITd : c2), a), b); - }; - _2.ii = function eae() { - return JTd(), ITd; - }; - _2.ki = function fae(a) { - var b; - switch (a) { - case 0: - !this.Ab && (this.Ab = new C5d(f7, this, 0, 3)); - sLd(this.Ab); - return; - case 1: - PAd(this, null); - return; - case 2: - !this.a && (this.a = new iae(this, o7, this)); - sLd(this.a); - return; - } - Cvd(this, a - AYd((JTd(), ITd)), vYd((b = RD(Ywd(this, 16), 29), !b ? ITd : b), a)); - }; - sfb(SHe, "ETypeParameterImpl", 457); - feb(458, 83, oKe, iae); - _2.Nj = function jae(a, b) { - return gae(this, RD(a, 89), b); - }; - _2.Oj = function kae(a, b) { - return hae(this, RD(a, 89), b); - }; - sfb(SHe, "ETypeParameterImpl/1", 458); - feb(647, 45, Hxe, lae); - _2.ec = function mae() { - return new pae(this); - }; - sfb(SHe, "ETypeParameterImpl/2", 647); - feb(570, Eve, Fve, pae); - _2.Fc = function qae(a) { - return nae(this, RD(a, 89)); - }; - _2.Gc = function rae(a) { - var b, c2, d; - d = false; - for (c2 = a.Kc(); c2.Ob(); ) { - b = RD(c2.Pb(), 89); - Zjb(this.a, b, "") == null && (d = true); - } - return d; - }; - _2.$b = function sae() { - akb(this.a); - }; - _2.Hc = function tae(a) { - return Ujb(this.a, a); - }; - _2.Kc = function uae() { - var a; - return a = new vkb(new mkb(this.a).a), new xae(a); - }; - _2.Mc = function vae(a) { - return oae(this, a); - }; - _2.gc = function wae() { - return bkb(this.a); - }; - sfb(SHe, "ETypeParameterImpl/2/1", 570); - feb(571, 1, Ave, xae); - _2.Nb = function yae(a) { - Ztb(this, a); - }; - _2.Pb = function Aae() { - return RD(tkb(this.a).ld(), 89); - }; - _2.Ob = function zae() { - return this.a.b; - }; - _2.Qb = function Bae() { - ukb(this.a); - }; - sfb(SHe, "ETypeParameterImpl/2/1/1", 571); - feb(1329, 45, Hxe, Cae); - _2._b = function Dae(a) { - return bE(a) ? Yjb(this, a) : !!qtb(this.f, a); - }; - _2.xc = function Eae(a) { - var b, c2; - b = bE(a) ? Xjb(this, a) : Wd(qtb(this.f, a)); - if (ZD(b, 851)) { - c2 = RD(b, 851); - b = c2.Kk(); - Zjb(this, RD(a, 241), b); - return b; - } else - return b != null ? b : a == null ? (Gie(), Fie) : null; - }; - sfb(SHe, "EValidatorRegistryImpl", 1329); - feb(1349, 720, { 110: 1, 94: 1, 93: 1, 480: 1, 155: 1, 58: 1, 114: 1, 2040: 1, 54: 1, 99: 1, 158: 1, 119: 1, 120: 1 }, Mae); - _2.ri = function Nae(a, b) { - switch (a.hk()) { - case 21: - case 22: - case 23: - case 24: - case 26: - case 31: - case 32: - case 37: - case 38: - case 39: - case 40: - case 43: - case 44: - case 48: - case 49: - case 20: - return b == null ? null : jeb(b); - case 25: - return Gae(b); - case 27: - return Hae(b); - case 28: - return Iae(b); - case 29: - return b == null ? null : a2d(nAd[0], RD(b, 206)); - case 41: - return b == null ? "" : nfb(RD(b, 297)); - case 42: - return jeb(b); - case 50: - return WD(b); - default: - throw Adb(new agb(VHe + a.xe() + WHe)); - } - }; - _2.si = function Oae(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q; - switch (a.G == -1 && (a.G = (m = BXd(a), m ? fZd(m.vi(), a) : -1)), a.G) { - case 0: - return c2 = new mXd(), c2; - case 1: - return b = new pVd(), b; - case 2: - return d = new HYd(), d; - case 4: - return e = new k1d(), e; - case 5: - return f2 = new A1d(), f2; - case 6: - return g = new R1d(), g; - case 7: - return h = new yAd(), h; - case 10: - return j = new kUd(), j; - case 11: - return k = new q4d(), k; - case 12: - return l = new EBd(), l; - case 13: - return n = new R5d(), n; - case 14: - return o2 = new d6d(), o2; - case 17: - return p = new v6d(), p; - case 18: - return i2 = new s2d(), i2; - case 19: - return q = new _9d(), q; - default: - throw Adb(new agb(ZHe + a.zb + WHe)); - } - }; - _2.ti = function Pae(a, b) { - switch (a.hk()) { - case 20: - return b == null ? null : new Bib(b); - case 21: - return b == null ? null : new ejb(b); - case 23: - case 22: - return b == null ? null : Fae(b); - case 26: - case 24: - return b == null ? null : $eb(Oeb(b, -128, 127) << 24 >> 24); - case 25: - return vAd(b); - case 27: - return Jae(b); - case 28: - return Kae(b); - case 29: - return Lae(b); - case 32: - case 31: - return b == null ? null : Neb(b); - case 38: - case 37: - return b == null ? null : new Ufb(b); - case 40: - case 39: - return b == null ? null : sgb(Oeb(b, qwe, lve)); - case 41: - return null; - case 42: - return b == null ? null : null; - case 44: - case 43: - return b == null ? null : Hgb(Peb(b)); - case 49: - case 48: - return b == null ? null : bhb(Oeb(b, BKe, 32767) << 16 >> 16); - case 50: - return b; - default: - throw Adb(new agb(VHe + a.xe() + WHe)); - } - }; - sfb(SHe, "EcoreFactoryImpl", 1349); - feb(560, 184, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 241: 1, 114: 1, 2038: 1, 54: 1, 99: 1, 158: 1, 184: 1, 560: 1, 119: 1, 120: 1, 690: 1 }, $ae); - _2.gb = false; - _2.hb = false; - var Rae, Sae = false; - sfb(SHe, "EcorePackageImpl", 560); - feb(1234, 1, { 851: 1 }, cbe); - _2.Kk = function dbe() { - return fke(), eke; - }; - sfb(SHe, "EcorePackageImpl/1", 1234); - feb(1243, 1, OKe, ebe); - _2.fk = function fbe(a) { - return ZD(a, 155); - }; - _2.gk = function gbe(a) { - return $C(p7, rve, 155, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/10", 1243); - feb(1244, 1, OKe, hbe); - _2.fk = function ibe(a) { - return ZD(a, 197); - }; - _2.gk = function jbe(a) { - return $C(q7, rve, 197, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/11", 1244); - feb(1245, 1, OKe, kbe); - _2.fk = function lbe(a) { - return ZD(a, 58); - }; - _2.gk = function mbe(a) { - return $C(r7, rve, 58, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/12", 1245); - feb(1246, 1, OKe, nbe); - _2.fk = function obe(a) { - return ZD(a, 411); - }; - _2.gk = function pbe(a) { - return $C(s7, mKe, 62, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/13", 1246); - feb(1247, 1, OKe, qbe); - _2.fk = function rbe(a) { - return ZD(a, 241); - }; - _2.gk = function sbe(a) { - return $C(t7, rve, 241, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/14", 1247); - feb(1248, 1, OKe, tbe); - _2.fk = function ube(a) { - return ZD(a, 518); - }; - _2.gk = function vbe(a) { - return $C(u7, rve, 2116, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/15", 1248); - feb(1249, 1, OKe, wbe); - _2.fk = function xbe(a) { - return ZD(a, 102); - }; - _2.gk = function ybe(a) { - return $C(v7, lKe, 19, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/16", 1249); - feb(1250, 1, OKe, zbe); - _2.fk = function Abe(a) { - return ZD(a, 179); - }; - _2.gk = function Bbe(a) { - return $C(y7, lKe, 179, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/17", 1250); - feb(1251, 1, OKe, Cbe); - _2.fk = function Dbe(a) { - return ZD(a, 481); - }; - _2.gk = function Ebe(a) { - return $C(A7, rve, 481, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/18", 1251); - feb(1252, 1, OKe, Fbe); - _2.fk = function Gbe(a) { - return ZD(a, 561); - }; - _2.gk = function Hbe(a) { - return $C(C8, LJe, 561, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/19", 1252); - feb(1235, 1, OKe, Ibe); - _2.fk = function Jbe(a) { - return ZD(a, 331); - }; - _2.gk = function Kbe(a) { - return $C(g7, lKe, 35, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/2", 1235); - feb(1253, 1, OKe, Lbe); - _2.fk = function Mbe(a) { - return ZD(a, 248); - }; - _2.gk = function Nbe(a) { - return $C(o7, sKe, 89, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/20", 1253); - feb(1254, 1, OKe, Obe); - _2.fk = function Pbe(a) { - return ZD(a, 457); - }; - _2.gk = function Qbe(a) { - return $C(z7, rve, 850, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/21", 1254); - feb(1255, 1, OKe, Rbe); - _2.fk = function Sbe(a) { - return $D(a); - }; - _2.gk = function Tbe(a) { - return $C(QI, Nve, 485, a, 8, 1); - }; - sfb(SHe, "EcorePackageImpl/22", 1255); - feb(1256, 1, OKe, Ube); - _2.fk = function Vbe(a) { - return ZD(a, 195); - }; - _2.gk = function Wbe(a) { - return $C(gE, Nve, 195, a, 0, 2); - }; - sfb(SHe, "EcorePackageImpl/23", 1256); - feb(1257, 1, OKe, Xbe); - _2.fk = function Ybe(a) { - return ZD(a, 222); - }; - _2.gk = function Zbe(a) { - return $C(RI, Nve, 222, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/24", 1257); - feb(1258, 1, OKe, $be); - _2.fk = function _be(a) { - return ZD(a, 180); - }; - _2.gk = function ace(a) { - return $C(SI, Nve, 180, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/25", 1258); - feb(1259, 1, OKe, bce); - _2.fk = function cce(a) { - return ZD(a, 206); - }; - _2.gk = function dce(a) { - return $C(qK, Nve, 206, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/26", 1259); - feb(1260, 1, OKe, ece); - _2.fk = function fce(a) { - return false; - }; - _2.gk = function gce(a) { - return $C(T6, rve, 2215, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/27", 1260); - feb(1261, 1, OKe, hce); - _2.fk = function ice(a) { - return _D(a); - }; - _2.gk = function jce(a) { - return $C(VI, Nve, 345, a, 7, 1); - }; - sfb(SHe, "EcorePackageImpl/28", 1261); - feb(1262, 1, OKe, kce); - _2.fk = function lce(a) { - return ZD(a, 61); - }; - _2.gk = function mce(a) { - return $C(Y6, Ize, 61, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/29", 1262); - feb(1236, 1, OKe, nce); - _2.fk = function oce(a) { - return ZD(a, 519); - }; - _2.gk = function pce(a) { - return $C(f7, { 3: 1, 4: 1, 5: 1, 2033: 1 }, 598, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/3", 1236); - feb(1263, 1, OKe, qce); - _2.fk = function rce(a) { - return ZD(a, 582); - }; - _2.gk = function sce(a) { - return $C(Z6, rve, 2039, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/30", 1263); - feb(1264, 1, OKe, tce); - _2.fk = function uce(a) { - return ZD(a, 160); - }; - _2.gk = function vce(a) { - return $C(Tbb, Ize, 160, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/31", 1264); - feb(1265, 1, OKe, wce); - _2.fk = function xce(a) { - return ZD(a, 76); - }; - _2.gk = function yce(a) { - return $C(Jbb, PKe, 76, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/32", 1265); - feb(1266, 1, OKe, zce); - _2.fk = function Ace(a) { - return ZD(a, 161); - }; - _2.gk = function Bce(a) { - return $C(ZI, Nve, 161, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/33", 1266); - feb(1267, 1, OKe, Cce); - _2.fk = function Dce(a) { - return ZD(a, 17); - }; - _2.gk = function Ece(a) { - return $C(bJ, Nve, 17, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/34", 1267); - feb(1268, 1, OKe, Fce); - _2.fk = function Gce(a) { - return ZD(a, 297); - }; - _2.gk = function Hce(a) { - return $C(UI, rve, 297, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/35", 1268); - feb(1269, 1, OKe, Ice); - _2.fk = function Jce(a) { - return ZD(a, 168); - }; - _2.gk = function Kce(a) { - return $C(eJ, Nve, 168, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/36", 1269); - feb(1270, 1, OKe, Lce); - _2.fk = function Mce(a) { - return ZD(a, 85); - }; - _2.gk = function Nce(a) { - return $C(VK, rve, 85, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/37", 1270); - feb(1271, 1, OKe, Oce); - _2.fk = function Pce(a) { - return ZD(a, 599); - }; - _2.gk = function Qce(a) { - return $C(Aab, rve, 599, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/38", 1271); - feb(1272, 1, OKe, Rce); - _2.fk = function Sce(a) { - return false; - }; - _2.gk = function Tce(a) { - return $C(zab, rve, 2216, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/39", 1272); - feb(1237, 1, OKe, Uce); - _2.fk = function Vce(a) { - return ZD(a, 90); - }; - _2.gk = function Wce(a) { - return $C(h7, rve, 29, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/4", 1237); - feb(1273, 1, OKe, Xce); - _2.fk = function Yce(a) { - return ZD(a, 191); - }; - _2.gk = function Zce(a) { - return $C(lJ, Nve, 191, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/40", 1273); - feb(1274, 1, OKe, $ce); - _2.fk = function _ce(a) { - return bE(a); - }; - _2.gk = function ade(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(SHe, "EcorePackageImpl/41", 1274); - feb(1275, 1, OKe, bde); - _2.fk = function cde(a) { - return ZD(a, 596); - }; - _2.gk = function dde(a) { - return $C(a7, rve, 596, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/42", 1275); - feb(1276, 1, OKe, ede); - _2.fk = function fde(a) { - return false; - }; - _2.gk = function gde(a) { - return $C($6, Nve, 2217, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/43", 1276); - feb(1277, 1, OKe, hde); - _2.fk = function ide(a) { - return ZD(a, 44); - }; - _2.gk = function jde(a) { - return $C(UK, Zve, 44, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/44", 1277); - feb(1238, 1, OKe, kde); - _2.fk = function lde(a) { - return ZD(a, 142); - }; - _2.gk = function mde(a) { - return $C(i7, rve, 142, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/5", 1238); - feb(1239, 1, OKe, nde); - _2.fk = function ode(a) { - return ZD(a, 156); - }; - _2.gk = function pde(a) { - return $C(k7, rve, 156, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/6", 1239); - feb(1240, 1, OKe, qde); - _2.fk = function rde(a) { - return ZD(a, 469); - }; - _2.gk = function sde(a) { - return $C(m7, rve, 685, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/7", 1240); - feb(1241, 1, OKe, tde); - _2.fk = function ude(a) { - return ZD(a, 582); - }; - _2.gk = function vde(a) { - return $C(l7, rve, 694, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/8", 1241); - feb(1242, 1, OKe, wde); - _2.fk = function xde(a) { - return ZD(a, 480); - }; - _2.gk = function yde(a) { - return $C(n7, rve, 480, a, 0, 1); - }; - sfb(SHe, "EcorePackageImpl/9", 1242); - feb(1038, 2080, JJe, Cde); - _2.Mi = function Dde(a, b) { - zde(this, RD(b, 424)); - }; - _2.Qi = function Ede(a, b) { - Ade(this, a, RD(b, 424)); - }; - sfb(SHe, "MinimalEObjectImpl/1ArrayDelegatingAdapterList", 1038); - feb(1039, 152, GJe, Fde); - _2.jj = function Gde() { - return this.a.a; - }; - sfb(SHe, "MinimalEObjectImpl/1ArrayDelegatingAdapterList/1", 1039); - feb(1067, 1066, {}, Ide); - sfb("org.eclipse.emf.ecore.plugin", "EcorePlugin", 1067); - var Aab = ufb(QKe, "Resource"); - feb(799, 1524, RKe); - _2.Hl = function Mde(a) { - }; - _2.Il = function Nde(a) { - }; - _2.El = function Ode() { - return !this.a && (this.a = new Zde(this)), this.a; - }; - _2.Fl = function Pde(a) { - var b, c2, d, e, f2; - d = a.length; - if (d > 0) { - BFb(0, a.length); - if (a.charCodeAt(0) == 47) { - f2 = new cnb(4); - e = 1; - for (b = 1; b < d; ++b) { - BFb(b, a.length); - if (a.charCodeAt(b) == 47) { - Rmb(f2, e == b ? "" : (AFb(e, b, a.length), a.substr(e, b - e))); - e = b + 1; - } - } - Rmb(f2, (BFb(e, a.length + 1), a.substr(e))); - return Jde(this, f2); - } else { - BFb(d - 1, a.length); - if (a.charCodeAt(d - 1) == 63) { - c2 = uhb(a, Fhb(63), d - 2); - c2 > 0 && (a = (AFb(0, c2, a.length), a.substr(0, c2))); - } - } - } - return Kde(this, a); - }; - _2.Gl = function Qde() { - return this.c; - }; - _2.Ib = function Rde() { - var a; - return nfb(this.Rm) + "@" + (a = tb(this) >>> 0, a.toString(16)) + " uri='" + this.d + "'"; - }; - _2.b = false; - sfb(SKe, "ResourceImpl", 799); - feb(1525, 799, RKe, Sde); - sfb(SKe, "BinaryResourceImpl", 1525); - feb(1190, 708, QIe); - _2.bj = function Vde(a) { - return ZD(a, 58) ? Tde(this, RD(a, 58)) : ZD(a, 599) ? new dMd(RD(a, 599).El()) : dE(a) === dE(this.f) ? RD(a, 16).Kc() : (jQd(), iQd.a); - }; - _2.Ob = function Wde() { - return Ude(this); - }; - _2.a = false; - sfb(ZJe, "EcoreUtil/ContentTreeIterator", 1190); - feb(1526, 1190, QIe, Xde); - _2.bj = function Yde(a) { - return dE(a) === dE(this.f) ? RD(a, 15).Kc() : new _je(RD(a, 58)); - }; - sfb(SKe, "ResourceImpl/5", 1526); - feb(658, 2092, nKe, Zde); - _2.Hc = function $de(a) { - return this.i <= 4 ? PHd(this, a) : ZD(a, 54) && RD(a, 54).Jh() == this.a; - }; - _2.Mi = function _de(a, b) { - a == this.i - 1 && (this.a.b || (this.a.b = true, null)); - }; - _2.Oi = function aee(a, b) { - a == 0 ? this.a.b || (this.a.b = true, null) : $Gd(this, a, b); - }; - _2.Qi = function bee(a, b) { - }; - _2.Ri = function cee(a, b, c2) { - }; - _2.Lj = function dee() { - return 2; - }; - _2.jj = function eee() { - return this.a; - }; - _2.Mj = function fee() { - return true; - }; - _2.Nj = function gee(a, b) { - var c2; - c2 = RD(a, 54); - b = c2.fi(this.a, b); - return b; - }; - _2.Oj = function hee(a, b) { - var c2; - c2 = RD(a, 54); - return c2.fi(null, b); - }; - _2.Pj = function iee() { - return false; - }; - _2.Si = function jee() { - return true; - }; - _2.aj = function kee(a) { - return $C(r7, rve, 58, a, 0, 1); - }; - _2.Yi = function lee() { - return false; - }; - sfb(SKe, "ResourceImpl/ContentsEList", 658); - feb(970, 2062, kwe, mee); - _2.fd = function nee(a) { - return this.a.Ki(a); - }; - _2.gc = function oee() { - return this.a.gc(); - }; - sfb(ZJe, "AbstractSequentialInternalEList/1", 970); - var hke, ike, jke, kke; - feb(634, 1, {}, Yee); - var pee, qee; - sfb(ZJe, "BasicExtendedMetaData", 634); - feb(1181, 1, {}, afe); - _2.Jl = function bfe() { - return null; - }; - _2.Kl = function cfe() { - this.a == -2 && $ee(this, uee(this.d, this.b)); - return this.a; - }; - _2.Ll = function dfe() { - return null; - }; - _2.Ml = function efe() { - return yob(), yob(), vob; - }; - _2.xe = function ffe() { - this.c == fLe && _ee(this, zee(this.d, this.b)); - return this.c; - }; - _2.Nl = function gfe() { - return 0; - }; - _2.a = -2; - _2.c = fLe; - sfb(ZJe, "BasicExtendedMetaData/EClassExtendedMetaDataImpl", 1181); - feb(1182, 1, {}, mfe); - _2.Jl = function nfe() { - this.a == (ree(), pee) && hfe(this, tee(this.f, this.b)); - return this.a; - }; - _2.Kl = function ofe() { - return 0; - }; - _2.Ll = function pfe() { - this.c == (ree(), pee) && ife(this, xee(this.f, this.b)); - return this.c; - }; - _2.Ml = function qfe() { - !this.d && jfe(this, yee(this.f, this.b)); - return this.d; - }; - _2.xe = function rfe() { - this.e == fLe && kfe(this, zee(this.f, this.b)); - return this.e; - }; - _2.Nl = function sfe() { - this.g == -2 && lfe(this, Cee(this.f, this.b)); - return this.g; - }; - _2.e = fLe; - _2.g = -2; - sfb(ZJe, "BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl", 1182); - feb(1180, 1, {}, wfe); - _2.b = false; - _2.c = false; - sfb(ZJe, "BasicExtendedMetaData/EPackageExtendedMetaDataImpl", 1180); - feb(1183, 1, {}, Jfe); - _2.c = -2; - _2.e = fLe; - _2.f = fLe; - sfb(ZJe, "BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl", 1183); - feb(593, 632, oKe, Kfe); - _2.Lj = function Lfe() { - return this.c; - }; - _2.ol = function Mfe() { - return false; - }; - _2.Wi = function Nfe(a, b) { - return b; - }; - _2.c = 0; - sfb(ZJe, "EDataTypeEList", 593); - var Tbb = ufb(ZJe, "FeatureMap"); - feb(78, 593, { 3: 1, 4: 1, 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 59: 1, 70: 1, 66: 1, 61: 1, 79: 1, 160: 1, 220: 1, 2036: 1, 71: 1, 97: 1 }, Uge); - _2.bd = function Vge(a, b) { - Ofe(this, a, RD(b, 76)); - }; - _2.Fc = function Wge(a) { - return Rfe(this, RD(a, 76)); - }; - _2.Hi = function _ge(a) { - Wfe(this, RD(a, 76)); - }; - _2.Nj = function khe(a, b) { - return mge(this, RD(a, 76), b); - }; - _2.Oj = function lhe(a, b) { - return oge(this, RD(a, 76), b); - }; - _2.Ti = function nhe(a, b) { - return uge(this, a, b); - }; - _2.Wi = function phe(a, b) { - return zge(this, a, RD(b, 76)); - }; - _2.hd = function rhe(a, b) { - return Cge(this, a, RD(b, 76)); - }; - _2.Uj = function vhe(a, b) { - return Ige(this, RD(a, 76), b); - }; - _2.Vj = function whe(a, b) { - return Kge(this, RD(a, 76), b); - }; - _2.Wj = function xhe(a, b, c2) { - return Lge(this, RD(a, 76), RD(b, 76), c2); - }; - _2.Zi = function zhe(a, b) { - return Tge(this, a, RD(b, 76)); - }; - _2.Ol = function Xge(a, b) { - return Qfe(this, a, b); - }; - _2.cd = function Yge(a, b) { - var c2, d, e, f2, g, h, i2, j, k; - j = new ZHd(b.gc()); - for (e = b.Kc(); e.Ob(); ) { - d = RD(e.Pb(), 76); - f2 = d.Lk(); - if (qke(this.e, f2)) { - (!f2.Si() || !cge(this, f2, d.md()) && !PHd(j, d)) && WGd(j, d); - } else { - k = pke(this.e.Dh(), f2); - c2 = RD(this.g, 124); - g = true; - for (h = 0; h < this.i; ++h) { - i2 = c2[h]; - if (k.am(i2.Lk())) { - RD(eHd(this, h, d), 76); - g = false; - break; - } - } - g && WGd(j, d); - } - } - return XGd(this, a, j); - }; - _2.Gc = function Zge(a) { - var b, c2, d, e, f2, g, h, i2, j; - i2 = new ZHd(a.gc()); - for (d = a.Kc(); d.Ob(); ) { - c2 = RD(d.Pb(), 76); - e = c2.Lk(); - if (qke(this.e, e)) { - (!e.Si() || !cge(this, e, c2.md()) && !PHd(i2, c2)) && WGd(i2, c2); - } else { - j = pke(this.e.Dh(), e); - b = RD(this.g, 124); - f2 = true; - for (g = 0; g < this.i; ++g) { - h = b[g]; - if (j.am(h.Lk())) { - RD(eHd(this, g, c2), 76); - f2 = false; - break; - } - } - f2 && WGd(i2, c2); - } - } - return YGd(this, i2); - }; - _2.Fi = function $ge(a) { - this.j = -1; - return nLd(this, this.i, a); - }; - _2.Pl = function ahe(a, b, c2) { - return Xfe(this, a, b, c2); - }; - _2.Xk = function bhe(a, b) { - return _fe(this, a, b); - }; - _2.Ql = function che(a, b, c2) { - return age(this, a, b, c2); - }; - _2.Rl = function dhe() { - return this; - }; - _2.Sl = function ehe(a, b) { - return ige(this, a, b); - }; - _2.Tl = function fhe(a) { - return RD(QHd(this, a), 76).Lk(); - }; - _2.Ul = function ghe(a) { - return RD(QHd(this, a), 76).md(); - }; - _2.Vl = function hhe() { - return this.b; - }; - _2.Mj = function ihe() { - return true; - }; - _2.Tj = function jhe() { - return true; - }; - _2.Wl = function mhe(a) { - return !pge(this, a); - }; - _2.aj = function ohe(a) { - return $C(Ibb, PKe, 343, a, 0, 1); - }; - _2.pl = function qhe(a) { - return Age(this, a); - }; - _2.Wb = function she(a) { - Dge(this, a); - }; - _2.Xl = function the(a, b) { - Fge(this, a, b); - }; - _2.Yl = function uhe(a) { - return Gge(this, a); - }; - _2.Zl = function yhe(a) { - Sge(this, a); - }; - sfb(ZJe, "BasicFeatureMap", 78); - feb(1960, 1, Jve); - _2.Nb = function Fhe(a) { - Ztb(this, a); - }; - _2.Rb = function Ehe(b) { - if (this.g == -1) { - throw Adb(new cgb()); - } - Ahe(this); - try { - Pfe(this.e, this.b, this.a, b); - this.d = this.e.j; - Dhe(this); - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - throw Adb(new Jrb()); - } else - throw Adb(a); - } - }; - _2.Ob = function Ghe() { - return Bhe(this); - }; - _2.Sb = function Hhe() { - return Che(this); - }; - _2.Pb = function Ihe() { - return Dhe(this); - }; - _2.Tb = function Jhe() { - return this.a; - }; - _2.Ub = function Khe() { - var a; - if (Che(this)) { - Ahe(this); - this.g = --this.a; - if (this.ul()) { - a = Bge(this.e, this.b, this.c, this.a, this.j); - this.j = a; - } - this.i = 0; - return this.j; - } else { - throw Adb(new Dvb()); - } - }; - _2.Vb = function Lhe() { - return this.a - 1; - }; - _2.Qb = function Mhe() { - if (this.g == -1) { - throw Adb(new cgb()); - } - Ahe(this); - try { - xge(this.e, this.b, this.g); - this.d = this.e.j; - if (this.g < this.a) { - --this.a; - --this.c; - } - --this.g; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - throw Adb(new Jrb()); - } else - throw Adb(a); - } - }; - _2.ul = function Nhe() { - return false; - }; - _2.Wb = function Ohe(b) { - if (this.g == -1) { - throw Adb(new cgb()); - } - Ahe(this); - try { - Ege(this.e, this.b, this.g, b); - this.d = this.e.j; - } catch (a) { - a = zdb(a); - if (ZD(a, 77)) { - throw Adb(new Jrb()); - } else - throw Adb(a); - } - }; - _2.a = 0; - _2.c = 0; - _2.d = 0; - _2.f = false; - _2.g = 0; - _2.i = 0; - sfb(ZJe, "FeatureMapUtil/BasicFeatureEIterator", 1960); - feb(420, 1960, Jve, Phe); - _2.$l = function Qhe() { - var a, b, c2; - c2 = this.e.i; - a = RD(this.e.g, 124); - while (this.c < c2) { - b = a[this.c]; - if (this.k.am(b.Lk())) { - this.j = this.f ? b : b.md(); - this.i = 2; - return true; - } - ++this.c; - } - this.i = 1; - this.g = -1; - return false; - }; - _2._l = function Rhe() { - var a, b; - a = RD(this.e.g, 124); - while (--this.c >= 0) { - b = a[this.c]; - if (this.k.am(b.Lk())) { - this.j = this.f ? b : b.md(); - this.i = -2; - return true; - } - } - this.i = -1; - this.g = -1; - return false; - }; - sfb(ZJe, "BasicFeatureMap/FeatureEIterator", 420); - feb(676, 420, Jve, She); - _2.ul = function The() { - return true; - }; - sfb(ZJe, "BasicFeatureMap/ResolvingFeatureEIterator", 676); - feb(968, 496, uKe, Uhe); - _2.pj = function Vhe() { - return this; - }; - sfb(ZJe, "EContentsEList/1", 968); - feb(969, 496, uKe, Whe); - _2.ul = function Xhe() { - return false; - }; - sfb(ZJe, "EContentsEList/2", 969); - feb(967, 287, vKe, Yhe); - _2.wl = function Zhe(a) { - }; - _2.Ob = function $he() { - return false; - }; - _2.Sb = function _he() { - return false; - }; - sfb(ZJe, "EContentsEList/FeatureIteratorImpl/1", 967); - feb(840, 593, oKe, aie); - _2.Ni = function bie() { - this.a = true; - }; - _2.Qj = function cie() { - return this.a; - }; - _2.Gk = function die() { - var a; - sLd(this); - if (Mvd(this.e)) { - a = this.a; - this.a = false; - qvd(this.e, new Q3d(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - sfb(ZJe, "EDataTypeEList/Unsettable", 840); - feb(1958, 593, oKe, eie); - _2.Si = function fie() { - return true; - }; - sfb(ZJe, "EDataTypeUniqueEList", 1958); - feb(1959, 840, oKe, gie); - _2.Si = function hie() { - return true; - }; - sfb(ZJe, "EDataTypeUniqueEList/Unsettable", 1959); - feb(147, 83, oKe, iie); - _2.nl = function jie() { - return true; - }; - _2.Wi = function kie(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectContainmentEList/Resolving", 147); - feb(1184, 555, oKe, lie); - _2.nl = function mie() { - return true; - }; - _2.Wi = function nie(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectContainmentEList/Unsettable/Resolving", 1184); - feb(766, 14, oKe, oie); - _2.Ni = function pie2() { - this.a = true; - }; - _2.Qj = function qie() { - return this.a; - }; - _2.Gk = function rie() { - var a; - sLd(this); - if (Mvd(this.e)) { - a = this.a; - this.a = false; - qvd(this.e, new Q3d(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - sfb(ZJe, "EObjectContainmentWithInverseEList/Unsettable", 766); - feb(1222, 766, oKe, sie); - _2.nl = function tie() { - return true; - }; - _2.Wi = function uie(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectContainmentWithInverseEList/Unsettable/Resolving", 1222); - feb(757, 505, oKe, vie); - _2.Ni = function wie() { - this.a = true; - }; - _2.Qj = function xie() { - return this.a; - }; - _2.Gk = function yie() { - var a; - sLd(this); - if (Mvd(this.e)) { - a = this.a; - this.a = false; - qvd(this.e, new Q3d(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - sfb(ZJe, "EObjectEList/Unsettable", 757); - feb(338, 505, oKe, zie); - _2.nl = function Aie() { - return true; - }; - _2.Wi = function Bie(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectResolvingEList", 338); - feb(1844, 757, oKe, Cie); - _2.nl = function Die() { - return true; - }; - _2.Wi = function Eie(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectResolvingEList/Unsettable", 1844); - feb(1527, 1, {}, Hie); - var Fie; - sfb(ZJe, "EObjectValidator", 1527); - feb(559, 505, oKe, Iie); - _2.il = function Jie() { - return this.d; - }; - _2.jl = function Kie() { - return this.b; - }; - _2.Mj = function Lie() { - return true; - }; - _2.ml = function Mie() { - return true; - }; - _2.b = 0; - sfb(ZJe, "EObjectWithInverseEList", 559); - feb(1225, 559, oKe, Nie); - _2.ll = function Oie() { - return true; - }; - sfb(ZJe, "EObjectWithInverseEList/ManyInverse", 1225); - feb(635, 559, oKe, Pie); - _2.Ni = function Qie() { - this.a = true; - }; - _2.Qj = function Rie() { - return this.a; - }; - _2.Gk = function Sie() { - var a; - sLd(this); - if (Mvd(this.e)) { - a = this.a; - this.a = false; - qvd(this.e, new Q3d(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - sfb(ZJe, "EObjectWithInverseEList/Unsettable", 635); - feb(1224, 635, oKe, Tie); - _2.ll = function Uie() { - return true; - }; - sfb(ZJe, "EObjectWithInverseEList/Unsettable/ManyInverse", 1224); - feb(767, 559, oKe, Vie); - _2.nl = function Wie() { - return true; - }; - _2.Wi = function Xie(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectWithInverseResolvingEList", 767); - feb(32, 767, oKe, Yie); - _2.ll = function Zie() { - return true; - }; - sfb(ZJe, "EObjectWithInverseResolvingEList/ManyInverse", 32); - feb(768, 635, oKe, $ie); - _2.nl = function _ie() { - return true; - }; - _2.Wi = function aje(a, b) { - return gZd(this, a, RD(b, 58)); - }; - sfb(ZJe, "EObjectWithInverseResolvingEList/Unsettable", 768); - feb(1223, 768, oKe, bje); - _2.ll = function cje() { - return true; - }; - sfb(ZJe, "EObjectWithInverseResolvingEList/Unsettable/ManyInverse", 1223); - feb(1185, 632, oKe); - _2.Li = function dje() { - return (this.b & 1792) == 0; - }; - _2.Ni = function eje() { - this.b |= 1; - }; - _2.kl = function fje() { - return (this.b & 4) != 0; - }; - _2.Mj = function gje() { - return (this.b & 40) != 0; - }; - _2.ll = function hje() { - return (this.b & 16) != 0; - }; - _2.ml = function ije() { - return (this.b & 8) != 0; - }; - _2.nl = function jje() { - return (this.b & cKe) != 0; - }; - _2.al = function kje() { - return (this.b & 32) != 0; - }; - _2.ol = function lje() { - return (this.b & gwe) != 0; - }; - _2.fk = function mje(a) { - return !this.d ? this.Lk().Hk().fk(a) : QRd(this.d, a); - }; - _2.Qj = function nje() { - return (this.b & 2) != 0 ? (this.b & 1) != 0 : this.i != 0; - }; - _2.Si = function oje() { - return (this.b & 128) != 0; - }; - _2.Gk = function qje() { - var a; - sLd(this); - if ((this.b & 2) != 0) { - if (Mvd(this.e)) { - a = (this.b & 1) != 0; - this.b &= -2; - eZd(this, new Q3d(this.e, 2, BYd(this.e.Dh(), this.Lk()), a, false)); - } else { - this.b &= -2; - } - } - }; - _2.Yi = function rje() { - return (this.b & 1536) == 0; - }; - _2.b = 0; - sfb(ZJe, "EcoreEList/Generic", 1185); - feb(1186, 1185, oKe, sje); - _2.Lk = function tje() { - return this.a; - }; - sfb(ZJe, "EcoreEList/Dynamic", 1186); - feb(765, 66, PIe, uje); - _2.aj = function vje(a) { - return IMd(this.a.a, a); - }; - sfb(ZJe, "EcoreEMap/1", 765); - feb(764, 83, oKe, wje); - _2.Mi = function xje(a, b) { - UNd(this.b, RD(b, 136)); - }; - _2.Oi = function yje(a, b) { - TNd(this.b); - }; - _2.Pi = function zje(a, b, c2) { - var d; - ++(d = this.b, RD(b, 136), d).e; - }; - _2.Qi = function Aje(a, b) { - VNd(this.b, RD(b, 136)); - }; - _2.Ri = function Bje(a, b, c2) { - VNd(this.b, RD(c2, 136)); - dE(c2) === dE(b) && RD(c2, 136).Ci(aOd(RD(b, 136).ld())); - UNd(this.b, RD(b, 136)); - }; - sfb(ZJe, "EcoreEMap/DelegateEObjectContainmentEList", 764); - feb(1220, 141, _Je, Cje); - sfb(ZJe, "EcoreEMap/Unsettable", 1220); - feb(1221, 764, oKe, Dje); - _2.Ni = function Eje() { - this.a = true; - }; - _2.Qj = function Fje() { - return this.a; - }; - _2.Gk = function Gje() { - var a; - sLd(this); - if (Mvd(this.e)) { - a = this.a; - this.a = false; - qvd(this.e, new Q3d(this.e, 2, this.c, a, false)); - } else { - this.a = false; - } - }; - _2.a = false; - sfb(ZJe, "EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList", 1221); - feb(1189, 215, Hxe, Zje); - _2.a = false; - _2.b = false; - sfb(ZJe, "EcoreUtil/Copier", 1189); - feb(759, 1, Ave, _je); - _2.Nb = function ake(a) { - Ztb(this, a); - }; - _2.Ob = function bke() { - return $je(this); - }; - _2.Pb = function cke() { - var a; - $je(this); - a = this.b; - this.b = null; - return a; - }; - _2.Qb = function dke() { - this.a.Qb(); - }; - sfb(ZJe, "EcoreUtil/ProperContentIterator", 759); - feb(1528, 1527, {}, gke); - var eke; - sfb(ZJe, "EcoreValidator", 1528); - var mke; - ufb(ZJe, "FeatureMapUtil/Validator"); - feb(1295, 1, { 2041: 1 }, rke); - _2.am = function ske(a) { - return true; - }; - sfb(ZJe, "FeatureMapUtil/1", 1295); - feb(773, 1, { 2041: 1 }, wke); - _2.am = function xke(a) { - var b; - if (this.c == a) - return true; - b = TD(Wjb(this.a, a)); - if (b == null) { - if (vke(this, a)) { - yke(this.a, a, (Geb(), Feb)); - return true; - } else { - yke(this.a, a, (Geb(), Eeb)); - return false; - } - } else { - return b == (Geb(), Feb); - } - }; - _2.e = false; - var tke; - sfb(ZJe, "FeatureMapUtil/BasicValidator", 773); - feb(774, 45, Hxe, zke); - sfb(ZJe, "FeatureMapUtil/BasicValidator/Cache", 774); - feb(509, 56, { 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 61: 1, 79: 1, 71: 1, 97: 1 }, Eke); - _2.bd = function Fke(a, b) { - Pfe(this.c, this.b, a, b); - }; - _2.Fc = function Gke(a) { - return Qfe(this.c, this.b, a); - }; - _2.cd = function Hke(a, b) { - return Sfe(this.c, this.b, a, b); - }; - _2.Gc = function Ike(a) { - return Ake(this, a); - }; - _2.Gi = function Jke(a, b) { - Ufe(this.c, this.b, a, b); - }; - _2.Wk = function Kke(a, b) { - return Xfe(this.c, this.b, a, b); - }; - _2.$i = function Lke(a) { - return hge(this.c, this.b, a, false); - }; - _2.Ii = function Mke() { - return Yfe(this.c, this.b); - }; - _2.Ji = function Nke() { - return Zfe(this.c, this.b); - }; - _2.Ki = function Oke(a) { - return $fe(this.c, this.b, a); - }; - _2.Xk = function Pke(a, b) { - return Bke(this, a, b); - }; - _2.$b = function Qke() { - Cke(this); - }; - _2.Hc = function Rke(a) { - return cge(this.c, this.b, a); - }; - _2.Ic = function Ske(a) { - return ege(this.c, this.b, a); - }; - _2.Xb = function Tke(a) { - return hge(this.c, this.b, a, true); - }; - _2.Fk = function Uke(a) { - return this; - }; - _2.dd = function Vke(a) { - return jge(this.c, this.b, a); - }; - _2.dc = function Wke() { - return Dke(this); - }; - _2.Qj = function Xke() { - return !pge(this.c, this.b); - }; - _2.Kc = function Yke() { - return qge(this.c, this.b); - }; - _2.ed = function Zke() { - return sge(this.c, this.b); - }; - _2.fd = function $ke(a) { - return tge(this.c, this.b, a); - }; - _2.Ti = function _ke(a, b) { - return vge(this.c, this.b, a, b); - }; - _2.Ui = function ale(a, b) { - wge(this.c, this.b, a, b); - }; - _2.gd = function ble(a) { - return xge(this.c, this.b, a); - }; - _2.Mc = function cle(a) { - return yge(this.c, this.b, a); - }; - _2.hd = function dle(a, b) { - return Ege(this.c, this.b, a, b); - }; - _2.Wb = function ele(a) { - bge(this.c, this.b); - Ake(this, RD(a, 15)); - }; - _2.gc = function fle() { - return Nge(this.c, this.b); - }; - _2.Pc = function gle() { - return Oge(this.c, this.b); - }; - _2.Qc = function hle(a) { - return Qge(this.c, this.b, a); - }; - _2.Ib = function ile() { - var a, b; - b = new Qhb(); - b.a += "["; - for (a = Yfe(this.c, this.b); Bhe(a); ) { - Nhb(b, Ghb(Dhe(a))); - Bhe(a) && (b.a += pve, b); - } - b.a += "]"; - return b.a; - }; - _2.Gk = function jle() { - bge(this.c, this.b); - }; - sfb(ZJe, "FeatureMapUtil/FeatureEList", 509); - feb(644, 39, GJe, lle); - _2.hj = function mle(a) { - return kle(this, a); - }; - _2.mj = function nle(a) { - var b, c2, d, e, f2, g, h; - switch (this.d) { - case 1: - case 2: { - f2 = a.jj(); - if (dE(f2) === dE(this.c) && kle(this, null) == a.hj(null)) { - this.g = a.ij(); - a.gj() == 1 && (this.d = 1); - return true; - } - break; - } - case 3: { - e = a.gj(); - switch (e) { - case 3: { - f2 = a.jj(); - if (dE(f2) === dE(this.c) && kle(this, null) == a.hj(null)) { - this.d = 5; - b = new ZHd(2); - WGd(b, this.g); - WGd(b, a.ij()); - this.g = b; - return true; - } - break; - } - } - break; - } - case 5: { - e = a.gj(); - switch (e) { - case 3: { - f2 = a.jj(); - if (dE(f2) === dE(this.c) && kle(this, null) == a.hj(null)) { - c2 = RD(this.g, 16); - c2.Fc(a.ij()); - return true; - } - break; - } - } - break; - } - case 4: { - e = a.gj(); - switch (e) { - case 3: { - f2 = a.jj(); - if (dE(f2) === dE(this.c) && kle(this, null) == a.hj(null)) { - this.d = 1; - this.g = a.ij(); - return true; - } - break; - } - case 4: { - f2 = a.jj(); - if (dE(f2) === dE(this.c) && kle(this, null) == a.hj(null)) { - this.d = 6; - h = new ZHd(2); - WGd(h, this.n); - WGd(h, a.kj()); - this.n = h; - g = cD(WC(kE, 1), Pwe, 28, 15, [this.o, a.lj()]); - this.g = g; - return true; - } - break; - } - } - break; - } - case 6: { - e = a.gj(); - switch (e) { - case 4: { - f2 = a.jj(); - if (dE(f2) === dE(this.c) && kle(this, null) == a.hj(null)) { - c2 = RD(this.n, 16); - c2.Fc(a.kj()); - g = RD(this.g, 53); - d = $C(kE, Pwe, 28, g.length + 1, 15, 1); - hib(g, 0, d, 0, g.length); - d[g.length] = a.lj(); - this.g = d; - return true; - } - break; - } - } - break; - } - } - return false; - }; - sfb(ZJe, "FeatureMapUtil/FeatureENotificationImpl", 644); - feb(564, 509, { 20: 1, 31: 1, 56: 1, 16: 1, 15: 1, 61: 1, 79: 1, 160: 1, 220: 1, 2036: 1, 71: 1, 97: 1 }, ole); - _2.Ol = function ple(a, b) { - return Qfe(this.c, a, b); - }; - _2.Pl = function qle(a, b, c2) { - return Xfe(this.c, a, b, c2); - }; - _2.Ql = function rle(a, b, c2) { - return age(this.c, a, b, c2); - }; - _2.Rl = function sle() { - return this; - }; - _2.Sl = function tle(a, b) { - return ige(this.c, a, b); - }; - _2.Tl = function ule(a) { - return RD(hge(this.c, this.b, a, false), 76).Lk(); - }; - _2.Ul = function vle(a) { - return RD(hge(this.c, this.b, a, false), 76).md(); - }; - _2.Vl = function wle() { - return this.a; - }; - _2.Wl = function xle(a) { - return !pge(this.c, a); - }; - _2.Xl = function yle(a, b) { - Fge(this.c, a, b); - }; - _2.Yl = function zle(a) { - return Gge(this.c, a); - }; - _2.Zl = function Ale(a) { - Sge(this.c, a); - }; - sfb(ZJe, "FeatureMapUtil/FeatureFeatureMap", 564); - feb(1294, 1, $Je, Ble); - _2.Fk = function Cle(a) { - return hge(this.b, this.a, -1, a); - }; - _2.Qj = function Dle() { - return !pge(this.b, this.a); - }; - _2.Wb = function Ele(a) { - Fge(this.b, this.a, a); - }; - _2.Gk = function Fle() { - bge(this.b, this.a); - }; - sfb(ZJe, "FeatureMapUtil/FeatureValue", 1294); - var Gle, Hle, Ile, Jle, Kle; - var Vbb = ufb(hLe, "AnyType"); - feb(680, 63, swe, Mle); - sfb(hLe, "InvalidDatatypeValueException", 680); - var Xbb = ufb(hLe, iLe); - var Ybb = ufb(hLe, jLe); - var Zbb = ufb(hLe, kLe); - var Nle; - var Ple; - var Rle, Sle, Tle, Ule, Vle, Wle, Xle, Yle, Zle, $le, _le, ame, bme, cme, dme, eme, fme, gme, hme, ime, jme, kme, lme, mme; - feb(844, 516, { 110: 1, 94: 1, 93: 1, 58: 1, 54: 1, 99: 1, 857: 1 }, ome); - _2.Lh = function pme(a, b, c2) { - switch (a) { - case 0: - if (c2) - return !this.c && (this.c = new Uge(this, 0)), this.c; - return !this.c && (this.c = new Uge(this, 0)), this.c.b; - case 1: - if (c2) - return !this.c && (this.c = new Uge(this, 0)), RD(rge(this.c, (nme(), Sle)), 160); - return (!this.c && (this.c = new Uge(this, 0)), RD(RD(rge(this.c, (nme(), Sle)), 160), 220)).Vl(); - case 2: - if (c2) - return !this.b && (this.b = new Uge(this, 2)), this.b; - return !this.b && (this.b = new Uge(this, 2)), this.b.b; - } - return zvd(this, a - AYd(this.ii()), vYd((this.j & 2) == 0 ? this.ii() : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b, c2); - }; - _2.Uh = function qme(a, b, c2) { - var d; - switch (b) { - case 0: - return !this.c && (this.c = new Uge(this, 0)), _fe(this.c, a, c2); - case 1: - return (!this.c && (this.c = new Uge(this, 0)), RD(RD(rge(this.c, (nme(), Sle)), 160), 71)).Xk(a, c2); - case 2: - return !this.b && (this.b = new Uge(this, 2)), _fe(this.b, a, c2); - } - return d = RD(vYd((this.j & 2) == 0 ? this.ii() : (!this.k && (this.k = new fUd()), this.k).Nk(), b), 69), d.wk().Ak(this, Yvd(this), b - AYd(this.ii()), a, c2); - }; - _2.Wh = function rme(a) { - switch (a) { - case 0: - return !!this.c && this.c.i != 0; - case 1: - return !(!this.c && (this.c = new Uge(this, 0)), RD(rge(this.c, (nme(), Sle)), 160)).dc(); - case 2: - return !!this.b && this.b.i != 0; - } - return Avd(this, a - AYd(this.ii()), vYd((this.j & 2) == 0 ? this.ii() : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - _2.bi = function sme(a, b) { - switch (a) { - case 0: - !this.c && (this.c = new Uge(this, 0)); - Dge(this.c, b); - return; - case 1: - (!this.c && (this.c = new Uge(this, 0)), RD(RD(rge(this.c, (nme(), Sle)), 160), 220)).Wb(b); - return; - case 2: - !this.b && (this.b = new Uge(this, 2)); - Dge(this.b, b); - return; - } - Bvd(this, a - AYd(this.ii()), vYd((this.j & 2) == 0 ? this.ii() : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b); - }; - _2.ii = function tme() { - return nme(), Rle; - }; - _2.ki = function ume(a) { - switch (a) { - case 0: - !this.c && (this.c = new Uge(this, 0)); - sLd(this.c); - return; - case 1: - (!this.c && (this.c = new Uge(this, 0)), RD(rge(this.c, (nme(), Sle)), 160)).$b(); - return; - case 2: - !this.b && (this.b = new Uge(this, 2)); - sLd(this.b); - return; - } - Cvd(this, a - AYd(this.ii()), vYd((this.j & 2) == 0 ? this.ii() : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - _2.Ib = function vme() { - var a; - if ((this.j & 4) != 0) - return awd(this); - a = new Shb(awd(this)); - a.a += " (mixed: "; - Mhb(a, this.c); - a.a += ", anyAttribute: "; - Mhb(a, this.b); - a.a += ")"; - return a.a; - }; - sfb(lLe, "AnyTypeImpl", 844); - feb(681, 516, { 110: 1, 94: 1, 93: 1, 58: 1, 54: 1, 99: 1, 2119: 1, 681: 1 }, yme); - _2.Lh = function zme(a, b, c2) { - switch (a) { - case 0: - return this.a; - case 1: - return this.b; - } - return zvd(this, a - AYd((nme(), cme)), vYd((this.j & 2) == 0 ? cme : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b, c2); - }; - _2.Wh = function Ame(a) { - switch (a) { - case 0: - return this.a != null; - case 1: - return this.b != null; - } - return Avd(this, a - AYd((nme(), cme)), vYd((this.j & 2) == 0 ? cme : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - _2.bi = function Bme(a, b) { - switch (a) { - case 0: - wme(this, WD(b)); - return; - case 1: - xme(this, WD(b)); - return; - } - Bvd(this, a - AYd((nme(), cme)), vYd((this.j & 2) == 0 ? cme : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b); - }; - _2.ii = function Cme() { - return nme(), cme; - }; - _2.ki = function Dme(a) { - switch (a) { - case 0: - this.a = null; - return; - case 1: - this.b = null; - return; - } - Cvd(this, a - AYd((nme(), cme)), vYd((this.j & 2) == 0 ? cme : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - _2.Ib = function Eme() { - var a; - if ((this.j & 4) != 0) - return awd(this); - a = new Shb(awd(this)); - a.a += " (data: "; - Nhb(a, this.a); - a.a += ", target: "; - Nhb(a, this.b); - a.a += ")"; - return a.a; - }; - _2.a = null; - _2.b = null; - sfb(lLe, "ProcessingInstructionImpl", 681); - feb(682, 844, { 110: 1, 94: 1, 93: 1, 58: 1, 54: 1, 99: 1, 857: 1, 2120: 1, 682: 1 }, Hme); - _2.Lh = function Ime(a, b, c2) { - switch (a) { - case 0: - if (c2) - return !this.c && (this.c = new Uge(this, 0)), this.c; - return !this.c && (this.c = new Uge(this, 0)), this.c.b; - case 1: - if (c2) - return !this.c && (this.c = new Uge(this, 0)), RD(rge(this.c, (nme(), Sle)), 160); - return (!this.c && (this.c = new Uge(this, 0)), RD(RD(rge(this.c, (nme(), Sle)), 160), 220)).Vl(); - case 2: - if (c2) - return !this.b && (this.b = new Uge(this, 2)), this.b; - return !this.b && (this.b = new Uge(this, 2)), this.b.b; - case 3: - return !this.c && (this.c = new Uge(this, 0)), WD(ige(this.c, (nme(), fme), true)); - case 4: - return Ije(this.a, (!this.c && (this.c = new Uge(this, 0)), WD(ige(this.c, (nme(), fme), true)))); - case 5: - return this.a; - } - return zvd(this, a - AYd((nme(), eme)), vYd((this.j & 2) == 0 ? eme : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b, c2); - }; - _2.Wh = function Jme(a) { - switch (a) { - case 0: - return !!this.c && this.c.i != 0; - case 1: - return !(!this.c && (this.c = new Uge(this, 0)), RD(rge(this.c, (nme(), Sle)), 160)).dc(); - case 2: - return !!this.b && this.b.i != 0; - case 3: - return !this.c && (this.c = new Uge(this, 0)), WD(ige(this.c, (nme(), fme), true)) != null; - case 4: - return Ije(this.a, (!this.c && (this.c = new Uge(this, 0)), WD(ige(this.c, (nme(), fme), true)))) != null; - case 5: - return !!this.a; - } - return Avd(this, a - AYd((nme(), eme)), vYd((this.j & 2) == 0 ? eme : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - _2.bi = function Kme(a, b) { - switch (a) { - case 0: - !this.c && (this.c = new Uge(this, 0)); - Dge(this.c, b); - return; - case 1: - (!this.c && (this.c = new Uge(this, 0)), RD(RD(rge(this.c, (nme(), Sle)), 160), 220)).Wb(b); - return; - case 2: - !this.b && (this.b = new Uge(this, 2)); - Dge(this.b, b); - return; - case 3: - Gme(this, WD(b)); - return; - case 4: - Gme(this, Hje(this.a, b)); - return; - case 5: - Fme(this, RD(b, 156)); - return; - } - Bvd(this, a - AYd((nme(), eme)), vYd((this.j & 2) == 0 ? eme : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b); - }; - _2.ii = function Lme() { - return nme(), eme; - }; - _2.ki = function Mme(a) { - switch (a) { - case 0: - !this.c && (this.c = new Uge(this, 0)); - sLd(this.c); - return; - case 1: - (!this.c && (this.c = new Uge(this, 0)), RD(rge(this.c, (nme(), Sle)), 160)).$b(); - return; - case 2: - !this.b && (this.b = new Uge(this, 2)); - sLd(this.b); - return; - case 3: - !this.c && (this.c = new Uge(this, 0)); - Fge(this.c, (nme(), fme), null); - return; - case 4: - Gme(this, Hje(this.a, null)); - return; - case 5: - this.a = null; - return; - } - Cvd(this, a - AYd((nme(), eme)), vYd((this.j & 2) == 0 ? eme : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - sfb(lLe, "SimpleAnyTypeImpl", 682); - feb(683, 516, { 110: 1, 94: 1, 93: 1, 58: 1, 54: 1, 99: 1, 2121: 1, 683: 1 }, Nme); - _2.Lh = function Ome(a, b, c2) { - switch (a) { - case 0: - if (c2) - return !this.a && (this.a = new Uge(this, 0)), this.a; - return !this.a && (this.a = new Uge(this, 0)), this.a.b; - case 1: - return c2 ? (!this.b && (this.b = new DVd((JTd(), FTd), C8, this, 1)), this.b) : (!this.b && (this.b = new DVd((JTd(), FTd), C8, this, 1)), dOd(this.b)); - case 2: - return c2 ? (!this.c && (this.c = new DVd((JTd(), FTd), C8, this, 2)), this.c) : (!this.c && (this.c = new DVd((JTd(), FTd), C8, this, 2)), dOd(this.c)); - case 3: - return !this.a && (this.a = new Uge(this, 0)), rge(this.a, (nme(), ime)); - case 4: - return !this.a && (this.a = new Uge(this, 0)), rge(this.a, (nme(), jme)); - case 5: - return !this.a && (this.a = new Uge(this, 0)), rge(this.a, (nme(), lme)); - case 6: - return !this.a && (this.a = new Uge(this, 0)), rge(this.a, (nme(), mme)); - } - return zvd(this, a - AYd((nme(), hme)), vYd((this.j & 2) == 0 ? hme : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b, c2); - }; - _2.Uh = function Pme(a, b, c2) { - var d; - switch (b) { - case 0: - return !this.a && (this.a = new Uge(this, 0)), _fe(this.a, a, c2); - case 1: - return !this.b && (this.b = new DVd((JTd(), FTd), C8, this, 1)), BVd(this.b, a, c2); - case 2: - return !this.c && (this.c = new DVd((JTd(), FTd), C8, this, 2)), BVd(this.c, a, c2); - case 5: - return !this.a && (this.a = new Uge(this, 0)), Bke(rge(this.a, (nme(), lme)), a, c2); - } - return d = RD(vYd((this.j & 2) == 0 ? (nme(), hme) : (!this.k && (this.k = new fUd()), this.k).Nk(), b), 69), d.wk().Ak(this, Yvd(this), b - AYd((nme(), hme)), a, c2); - }; - _2.Wh = function Qme(a) { - switch (a) { - case 0: - return !!this.a && this.a.i != 0; - case 1: - return !!this.b && this.b.f != 0; - case 2: - return !!this.c && this.c.f != 0; - case 3: - return !this.a && (this.a = new Uge(this, 0)), !Dke(rge(this.a, (nme(), ime))); - case 4: - return !this.a && (this.a = new Uge(this, 0)), !Dke(rge(this.a, (nme(), jme))); - case 5: - return !this.a && (this.a = new Uge(this, 0)), !Dke(rge(this.a, (nme(), lme))); - case 6: - return !this.a && (this.a = new Uge(this, 0)), !Dke(rge(this.a, (nme(), mme))); - } - return Avd(this, a - AYd((nme(), hme)), vYd((this.j & 2) == 0 ? hme : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - _2.bi = function Rme(a, b) { - switch (a) { - case 0: - !this.a && (this.a = new Uge(this, 0)); - Dge(this.a, b); - return; - case 1: - !this.b && (this.b = new DVd((JTd(), FTd), C8, this, 1)); - CVd(this.b, b); - return; - case 2: - !this.c && (this.c = new DVd((JTd(), FTd), C8, this, 2)); - CVd(this.c, b); - return; - case 3: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), ime))); - !this.a && (this.a = new Uge(this, 0)); - Ake(rge(this.a, ime), RD(b, 16)); - return; - case 4: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), jme))); - !this.a && (this.a = new Uge(this, 0)); - Ake(rge(this.a, jme), RD(b, 16)); - return; - case 5: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), lme))); - !this.a && (this.a = new Uge(this, 0)); - Ake(rge(this.a, lme), RD(b, 16)); - return; - case 6: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), mme))); - !this.a && (this.a = new Uge(this, 0)); - Ake(rge(this.a, mme), RD(b, 16)); - return; - } - Bvd(this, a - AYd((nme(), hme)), vYd((this.j & 2) == 0 ? hme : (!this.k && (this.k = new fUd()), this.k).Nk(), a), b); - }; - _2.ii = function Sme() { - return nme(), hme; - }; - _2.ki = function Tme(a) { - switch (a) { - case 0: - !this.a && (this.a = new Uge(this, 0)); - sLd(this.a); - return; - case 1: - !this.b && (this.b = new DVd((JTd(), FTd), C8, this, 1)); - this.b.c.$b(); - return; - case 2: - !this.c && (this.c = new DVd((JTd(), FTd), C8, this, 2)); - this.c.c.$b(); - return; - case 3: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), ime))); - return; - case 4: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), jme))); - return; - case 5: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), lme))); - return; - case 6: - !this.a && (this.a = new Uge(this, 0)); - Cke(rge(this.a, (nme(), mme))); - return; - } - Cvd(this, a - AYd((nme(), hme)), vYd((this.j & 2) == 0 ? hme : (!this.k && (this.k = new fUd()), this.k).Nk(), a)); - }; - _2.Ib = function Ume() { - var a; - if ((this.j & 4) != 0) - return awd(this); - a = new Shb(awd(this)); - a.a += " (mixed: "; - Mhb(a, this.a); - a.a += ")"; - return a.a; - }; - sfb(lLe, "XMLTypeDocumentRootImpl", 683); - feb(2028, 720, { 110: 1, 94: 1, 93: 1, 480: 1, 155: 1, 58: 1, 114: 1, 54: 1, 99: 1, 158: 1, 119: 1, 120: 1, 2122: 1 }, rne); - _2.ri = function sne(a, b) { - switch (a.hk()) { - case 7: - case 8: - case 9: - case 10: - case 16: - case 22: - case 23: - case 24: - case 25: - case 26: - case 32: - case 33: - case 34: - case 36: - case 37: - case 44: - case 45: - case 50: - case 51: - case 53: - case 55: - case 56: - case 57: - case 58: - case 60: - case 61: - case 4: - return b == null ? null : jeb(b); - case 19: - case 28: - case 29: - case 35: - case 38: - case 39: - case 41: - case 46: - case 52: - case 54: - case 5: - return WD(b); - case 6: - return _me(RD(b, 195)); - case 12: - case 47: - case 49: - case 11: - return tAd(this, a, b); - case 13: - return b == null ? null : yib(RD(b, 247)); - case 15: - case 14: - return b == null ? null : ane(Kfb(UD(b))); - case 17: - return bne((nme(), b)); - case 18: - return bne(b); - case 21: - case 20: - return b == null ? null : cne(RD(b, 161).a); - case 27: - return dne(RD(b, 195)); - case 30: - return ene((nme(), RD(b, 15))); - case 31: - return ene(RD(b, 15)); - case 40: - return hne((nme(), b)); - case 42: - return fne((nme(), b)); - case 43: - return fne(b); - case 59: - case 48: - return gne((nme(), b)); - default: - throw Adb(new agb(VHe + a.xe() + WHe)); - } - }; - _2.si = function tne(a) { - var b, c2, d, e, f2; - switch (a.G == -1 && (a.G = (c2 = BXd(a), c2 ? fZd(c2.vi(), a) : -1)), a.G) { - case 0: - return b = new ome(), b; - case 1: - return d = new yme(), d; - case 2: - return e = new Hme(), e; - case 3: - return f2 = new Nme(), f2; - default: - throw Adb(new agb(ZHe + a.zb + WHe)); - } - }; - _2.ti = function une(a, b) { - var c2, d, e, f2, g, h, i2, j, k, l, m, n, o2, p, q, r; - switch (a.hk()) { - case 5: - case 52: - case 4: - return b; - case 6: - return ine(b); - case 8: - case 7: - return b == null ? null : $me(b); - case 9: - return b == null ? null : $eb(Oeb((d = nue(b, true), d.length > 0 && (BFb(0, d.length), d.charCodeAt(0) == 43) ? (BFb(1, d.length + 1), d.substr(1)) : d), -128, 127) << 24 >> 24); - case 10: - return b == null ? null : $eb(Oeb((e = nue(b, true), e.length > 0 && (BFb(0, e.length), e.charCodeAt(0) == 43) ? (BFb(1, e.length + 1), e.substr(1)) : e), -128, 127) << 24 >> 24); - case 11: - return WD(uAd(this, (nme(), Vle), b)); - case 12: - return WD(uAd(this, (nme(), Wle), b)); - case 13: - return b == null ? null : new Bib(nue(b, true)); - case 15: - case 14: - return jne(b); - case 16: - return WD(uAd(this, (nme(), Xle), b)); - case 17: - return kne((nme(), b)); - case 18: - return kne(b); - case 28: - case 29: - case 35: - case 38: - case 39: - case 41: - case 54: - case 19: - return nue(b, true); - case 21: - case 20: - return lne(b); - case 22: - return WD(uAd(this, (nme(), Yle), b)); - case 23: - return WD(uAd(this, (nme(), Zle), b)); - case 24: - return WD(uAd(this, (nme(), $le), b)); - case 25: - return WD(uAd(this, (nme(), _le), b)); - case 26: - return WD(uAd(this, (nme(), ame), b)); - case 27: - return mne(b); - case 30: - return nne((nme(), b)); - case 31: - return nne(b); - case 32: - return b == null ? null : sgb(Oeb((k = nue(b, true), k.length > 0 && (BFb(0, k.length), k.charCodeAt(0) == 43) ? (BFb(1, k.length + 1), k.substr(1)) : k), qwe, lve)); - case 33: - return b == null ? null : new ejb((l = nue(b, true), l.length > 0 && (BFb(0, l.length), l.charCodeAt(0) == 43) ? (BFb(1, l.length + 1), l.substr(1)) : l)); - case 34: - return b == null ? null : sgb(Oeb((m = nue(b, true), m.length > 0 && (BFb(0, m.length), m.charCodeAt(0) == 43) ? (BFb(1, m.length + 1), m.substr(1)) : m), qwe, lve)); - case 36: - return b == null ? null : Hgb(Peb((n = nue(b, true), n.length > 0 && (BFb(0, n.length), n.charCodeAt(0) == 43) ? (BFb(1, n.length + 1), n.substr(1)) : n))); - case 37: - return b == null ? null : Hgb(Peb((o2 = nue(b, true), o2.length > 0 && (BFb(0, o2.length), o2.charCodeAt(0) == 43) ? (BFb(1, o2.length + 1), o2.substr(1)) : o2))); - case 40: - return qne((nme(), b)); - case 42: - return one2((nme(), b)); - case 43: - return one2(b); - case 44: - return b == null ? null : new ejb((p = nue(b, true), p.length > 0 && (BFb(0, p.length), p.charCodeAt(0) == 43) ? (BFb(1, p.length + 1), p.substr(1)) : p)); - case 45: - return b == null ? null : new ejb((q = nue(b, true), q.length > 0 && (BFb(0, q.length), q.charCodeAt(0) == 43) ? (BFb(1, q.length + 1), q.substr(1)) : q)); - case 46: - return nue(b, false); - case 47: - return WD(uAd(this, (nme(), bme), b)); - case 59: - case 48: - return pne((nme(), b)); - case 49: - return WD(uAd(this, (nme(), dme), b)); - case 50: - return b == null ? null : bhb(Oeb((r = nue(b, true), r.length > 0 && (BFb(0, r.length), r.charCodeAt(0) == 43) ? (BFb(1, r.length + 1), r.substr(1)) : r), BKe, 32767) << 16 >> 16); - case 51: - return b == null ? null : bhb(Oeb((f2 = nue(b, true), f2.length > 0 && (BFb(0, f2.length), f2.charCodeAt(0) == 43) ? (BFb(1, f2.length + 1), f2.substr(1)) : f2), BKe, 32767) << 16 >> 16); - case 53: - return WD(uAd(this, (nme(), gme), b)); - case 55: - return b == null ? null : bhb(Oeb((g = nue(b, true), g.length > 0 && (BFb(0, g.length), g.charCodeAt(0) == 43) ? (BFb(1, g.length + 1), g.substr(1)) : g), BKe, 32767) << 16 >> 16); - case 56: - return b == null ? null : bhb(Oeb((h = nue(b, true), h.length > 0 && (BFb(0, h.length), h.charCodeAt(0) == 43) ? (BFb(1, h.length + 1), h.substr(1)) : h), BKe, 32767) << 16 >> 16); - case 57: - return b == null ? null : Hgb(Peb((i2 = nue(b, true), i2.length > 0 && (BFb(0, i2.length), i2.charCodeAt(0) == 43) ? (BFb(1, i2.length + 1), i2.substr(1)) : i2))); - case 58: - return b == null ? null : Hgb(Peb((j = nue(b, true), j.length > 0 && (BFb(0, j.length), j.charCodeAt(0) == 43) ? (BFb(1, j.length + 1), j.substr(1)) : j))); - case 60: - return b == null ? null : sgb(Oeb((c2 = nue(b, true), c2.length > 0 && (BFb(0, c2.length), c2.charCodeAt(0) == 43) ? (BFb(1, c2.length + 1), c2.substr(1)) : c2), qwe, lve)); - case 61: - return b == null ? null : sgb(Oeb(nue(b, true), qwe, lve)); - default: - throw Adb(new agb(VHe + a.xe() + WHe)); - } - }; - var Vme, Wme, Xme, Yme; - sfb(lLe, "XMLTypeFactoryImpl", 2028); - feb(594, 184, { 110: 1, 94: 1, 93: 1, 155: 1, 197: 1, 58: 1, 241: 1, 114: 1, 54: 1, 99: 1, 158: 1, 184: 1, 119: 1, 120: 1, 690: 1, 2044: 1, 594: 1 }, Bne); - _2.N = false; - _2.O = false; - var wne = false; - sfb(lLe, "XMLTypePackageImpl", 594); - feb(1961, 1, { 851: 1 }, Ene); - _2.Kk = function Fne() { - return rue(), que; - }; - sfb(lLe, "XMLTypePackageImpl/1", 1961); - feb(1970, 1, OKe, Gne); - _2.fk = function Hne(a) { - return bE(a); - }; - _2.gk = function Ine(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/10", 1970); - feb(1971, 1, OKe, Jne); - _2.fk = function Kne(a) { - return bE(a); - }; - _2.gk = function Lne(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/11", 1971); - feb(1972, 1, OKe, Mne); - _2.fk = function Nne(a) { - return bE(a); - }; - _2.gk = function One(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/12", 1972); - feb(1973, 1, OKe, Pne); - _2.fk = function Qne(a) { - return _D(a); - }; - _2.gk = function Rne(a) { - return $C(VI, Nve, 345, a, 7, 1); - }; - sfb(lLe, "XMLTypePackageImpl/13", 1973); - feb(1974, 1, OKe, Sne); - _2.fk = function Tne(a) { - return bE(a); - }; - _2.gk = function Une(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/14", 1974); - feb(1975, 1, OKe, Vne); - _2.fk = function Wne(a) { - return ZD(a, 15); - }; - _2.gk = function Xne(a) { - return $C(QK, Ize, 15, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/15", 1975); - feb(1976, 1, OKe, Yne); - _2.fk = function Zne(a) { - return ZD(a, 15); - }; - _2.gk = function $ne(a) { - return $C(QK, Ize, 15, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/16", 1976); - feb(1977, 1, OKe, _ne); - _2.fk = function aoe(a) { - return bE(a); - }; - _2.gk = function boe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/17", 1977); - feb(1978, 1, OKe, coe); - _2.fk = function doe(a) { - return ZD(a, 161); - }; - _2.gk = function eoe(a) { - return $C(ZI, Nve, 161, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/18", 1978); - feb(1979, 1, OKe, foe); - _2.fk = function goe(a) { - return bE(a); - }; - _2.gk = function hoe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/19", 1979); - feb(1962, 1, OKe, ioe); - _2.fk = function joe(a) { - return ZD(a, 857); - }; - _2.gk = function koe(a) { - return $C(Vbb, rve, 857, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/2", 1962); - feb(1980, 1, OKe, loe); - _2.fk = function moe(a) { - return bE(a); - }; - _2.gk = function noe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/20", 1980); - feb(1981, 1, OKe, ooe); - _2.fk = function poe(a) { - return bE(a); - }; - _2.gk = function qoe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/21", 1981); - feb(1982, 1, OKe, roe); - _2.fk = function soe(a) { - return bE(a); - }; - _2.gk = function toe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/22", 1982); - feb(1983, 1, OKe, uoe); - _2.fk = function voe(a) { - return bE(a); - }; - _2.gk = function woe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/23", 1983); - feb(1984, 1, OKe, xoe); - _2.fk = function yoe(a) { - return ZD(a, 195); - }; - _2.gk = function zoe(a) { - return $C(gE, Nve, 195, a, 0, 2); - }; - sfb(lLe, "XMLTypePackageImpl/24", 1984); - feb(1985, 1, OKe, Aoe); - _2.fk = function Boe(a) { - return bE(a); - }; - _2.gk = function Coe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/25", 1985); - feb(1986, 1, OKe, Doe); - _2.fk = function Eoe(a) { - return bE(a); - }; - _2.gk = function Foe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/26", 1986); - feb(1987, 1, OKe, Goe); - _2.fk = function Hoe(a) { - return ZD(a, 15); - }; - _2.gk = function Ioe(a) { - return $C(QK, Ize, 15, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/27", 1987); - feb(1988, 1, OKe, Joe); - _2.fk = function Koe(a) { - return ZD(a, 15); - }; - _2.gk = function Loe(a) { - return $C(QK, Ize, 15, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/28", 1988); - feb(1989, 1, OKe, Moe); - _2.fk = function Noe(a) { - return bE(a); - }; - _2.gk = function Ooe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/29", 1989); - feb(1963, 1, OKe, Poe); - _2.fk = function Qoe(a) { - return ZD(a, 681); - }; - _2.gk = function Roe(a) { - return $C(Xbb, rve, 2119, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/3", 1963); - feb(1990, 1, OKe, Soe); - _2.fk = function Toe(a) { - return ZD(a, 17); - }; - _2.gk = function Uoe(a) { - return $C(bJ, Nve, 17, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/30", 1990); - feb(1991, 1, OKe, Voe); - _2.fk = function Woe(a) { - return bE(a); - }; - _2.gk = function Xoe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/31", 1991); - feb(1992, 1, OKe, Yoe); - _2.fk = function Zoe(a) { - return ZD(a, 168); - }; - _2.gk = function $oe(a) { - return $C(eJ, Nve, 168, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/32", 1992); - feb(1993, 1, OKe, _oe); - _2.fk = function ape(a) { - return bE(a); - }; - _2.gk = function bpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/33", 1993); - feb(1994, 1, OKe, cpe); - _2.fk = function dpe(a) { - return bE(a); - }; - _2.gk = function epe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/34", 1994); - feb(1995, 1, OKe, fpe); - _2.fk = function gpe(a) { - return bE(a); - }; - _2.gk = function hpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/35", 1995); - feb(1996, 1, OKe, ipe); - _2.fk = function jpe(a) { - return bE(a); - }; - _2.gk = function kpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/36", 1996); - feb(1997, 1, OKe, lpe); - _2.fk = function mpe(a) { - return ZD(a, 15); - }; - _2.gk = function npe(a) { - return $C(QK, Ize, 15, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/37", 1997); - feb(1998, 1, OKe, ope); - _2.fk = function ppe(a) { - return ZD(a, 15); - }; - _2.gk = function qpe(a) { - return $C(QK, Ize, 15, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/38", 1998); - feb(1999, 1, OKe, rpe); - _2.fk = function spe(a) { - return bE(a); - }; - _2.gk = function tpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/39", 1999); - feb(1964, 1, OKe, upe); - _2.fk = function vpe(a) { - return ZD(a, 682); - }; - _2.gk = function wpe(a) { - return $C(Ybb, rve, 2120, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/4", 1964); - feb(2e3, 1, OKe, xpe); - _2.fk = function ype(a) { - return bE(a); - }; - _2.gk = function zpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/40", 2e3); - feb(2001, 1, OKe, Ape); - _2.fk = function Bpe(a) { - return bE(a); - }; - _2.gk = function Cpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/41", 2001); - feb(2002, 1, OKe, Dpe); - _2.fk = function Epe(a) { - return bE(a); - }; - _2.gk = function Fpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/42", 2002); - feb(2003, 1, OKe, Gpe); - _2.fk = function Hpe(a) { - return bE(a); - }; - _2.gk = function Ipe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/43", 2003); - feb(2004, 1, OKe, Jpe); - _2.fk = function Kpe(a) { - return bE(a); - }; - _2.gk = function Lpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/44", 2004); - feb(2005, 1, OKe, Mpe); - _2.fk = function Npe(a) { - return ZD(a, 191); - }; - _2.gk = function Ope(a) { - return $C(lJ, Nve, 191, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/45", 2005); - feb(2006, 1, OKe, Ppe); - _2.fk = function Qpe(a) { - return bE(a); - }; - _2.gk = function Rpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/46", 2006); - feb(2007, 1, OKe, Spe); - _2.fk = function Tpe(a) { - return bE(a); - }; - _2.gk = function Upe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/47", 2007); - feb(2008, 1, OKe, Vpe); - _2.fk = function Wpe(a) { - return bE(a); - }; - _2.gk = function Xpe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/48", 2008); - feb(2009, 1, OKe, Ype); - _2.fk = function Zpe(a) { - return ZD(a, 191); - }; - _2.gk = function $pe(a) { - return $C(lJ, Nve, 191, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/49", 2009); - feb(1965, 1, OKe, _pe); - _2.fk = function aqe(a) { - return ZD(a, 683); - }; - _2.gk = function bqe(a) { - return $C(Zbb, rve, 2121, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/5", 1965); - feb(2010, 1, OKe, cqe); - _2.fk = function dqe(a) { - return ZD(a, 168); - }; - _2.gk = function eqe(a) { - return $C(eJ, Nve, 168, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/50", 2010); - feb(2011, 1, OKe, fqe); - _2.fk = function gqe(a) { - return bE(a); - }; - _2.gk = function hqe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/51", 2011); - feb(2012, 1, OKe, iqe); - _2.fk = function jqe(a) { - return ZD(a, 17); - }; - _2.gk = function kqe(a) { - return $C(bJ, Nve, 17, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/52", 2012); - feb(1966, 1, OKe, lqe); - _2.fk = function mqe(a) { - return bE(a); - }; - _2.gk = function nqe(a) { - return $C(qJ, Nve, 2, a, 6, 1); - }; - sfb(lLe, "XMLTypePackageImpl/6", 1966); - feb(1967, 1, OKe, oqe); - _2.fk = function pqe(a) { - return ZD(a, 195); - }; - _2.gk = function qqe(a) { - return $C(gE, Nve, 195, a, 0, 2); - }; - sfb(lLe, "XMLTypePackageImpl/7", 1967); - feb(1968, 1, OKe, rqe); - _2.fk = function sqe(a) { - return $D(a); - }; - _2.gk = function tqe(a) { - return $C(QI, Nve, 485, a, 8, 1); - }; - sfb(lLe, "XMLTypePackageImpl/8", 1968); - feb(1969, 1, OKe, uqe); - _2.fk = function vqe(a) { - return ZD(a, 222); - }; - _2.gk = function wqe(a) { - return $C(RI, Nve, 222, a, 0, 1); - }; - sfb(lLe, "XMLTypePackageImpl/9", 1969); - var xqe, yqe; - var Eqe, Fqe; - var Jqe; - feb(55, 63, swe, Lqe); - sfb(LLe, "RegEx/ParseException", 55); - feb(836, 1, {}, Tqe); - _2.bm = function Uqe(a) { - return a < this.j && ihb(this.i, a) == 63; - }; - _2.cm = function Vqe() { - var a, b, c2, d, e; - if (this.c != 10) - throw Adb(new Lqe(TId((Hde(), VIe)))); - a = this.a; - switch (a) { - case 101: - a = 27; - break; - case 102: - a = 12; - break; - case 110: - a = 10; - break; - case 114: - a = 13; - break; - case 116: - a = 9; - break; - case 120: - Mqe(this); - if (this.c != 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - if (this.a == 123) { - e = 0; - c2 = 0; - do { - Mqe(this); - if (this.c != 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - if ((e = Xqe(this.a)) < 0) - break; - if (c2 > c2 * 16) - throw Adb(new Lqe(TId((Hde(), tJe)))); - c2 = c2 * 16 + e; - } while (true); - if (this.a != 125) - throw Adb(new Lqe(TId((Hde(), uJe)))); - if (c2 > MLe) - throw Adb(new Lqe(TId((Hde(), vJe)))); - a = c2; - } else { - e = 0; - if (this.c != 0 || (e = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - c2 = e; - Mqe(this); - if (this.c != 0 || (e = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - c2 = c2 * 16 + e; - a = c2; - } - break; - case 117: - d = 0; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - a = b; - break; - case 118: - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - Mqe(this); - if (this.c != 0 || (d = Xqe(this.a)) < 0) - throw Adb(new Lqe(TId((Hde(), sJe)))); - b = b * 16 + d; - if (b > MLe) - throw Adb(new Lqe(TId((Hde(), "parser.descappe.4")))); - a = b; - break; - case 65: - case 90: - case 122: - throw Adb(new Lqe(TId((Hde(), wJe)))); - } - return a; - }; - _2.dm = function Wqe(a) { - var b, c2; - switch (a) { - case 100: - c2 = (this.e & 32) == 32 ? hte("Nd", true) : (Vse(), Bse); - break; - case 68: - c2 = (this.e & 32) == 32 ? hte("Nd", false) : (Vse(), Ise); - break; - case 119: - c2 = (this.e & 32) == 32 ? hte("IsWord", true) : (Vse(), Rse); - break; - case 87: - c2 = (this.e & 32) == 32 ? hte("IsWord", false) : (Vse(), Kse); - break; - case 115: - c2 = (this.e & 32) == 32 ? hte("IsSpace", true) : (Vse(), Mse); - break; - case 83: - c2 = (this.e & 32) == 32 ? hte("IsSpace", false) : (Vse(), Jse); - break; - default: - throw Adb(new yz((b = a, NLe + b.toString(16)))); - } - return c2; - }; - _2.em = function Yqe(a) { - var b, c2, d, e, f2, g, h, i2, j, k, l, m; - this.b = 1; - Mqe(this); - b = null; - if (this.c == 0 && this.a == 94) { - Mqe(this); - if (a) { - k = (Vse(), Vse(), new xte(5)); - } else { - b = (Vse(), Vse(), new xte(4)); - rte(b, 0, MLe); - k = new xte(4); - } - } else { - k = (Vse(), Vse(), new xte(4)); - } - e = true; - while ((m = this.c) != 1) { - if (m == 0 && this.a == 93 && !e) - break; - e = false; - c2 = this.a; - d = false; - if (m == 10) { - switch (c2) { - case 100: - case 68: - case 119: - case 87: - case 115: - case 83: - ute(k, this.dm(c2)); - d = true; - break; - case 105: - case 73: - case 99: - case 67: - c2 = this.um(k, c2); - c2 < 0 && (d = true); - break; - case 112: - case 80: - l = Sqe(this, c2); - if (!l) - throw Adb(new Lqe(TId((Hde(), hJe)))); - ute(k, l); - d = true; - break; - default: - c2 = this.cm(); - } - } else if (m == 20) { - g = phb(this.i, 58, this.d); - if (g < 0) - throw Adb(new Lqe(TId((Hde(), iJe)))); - h = true; - if (ihb(this.i, this.d) == 94) { - ++this.d; - h = false; - } - f2 = zhb(this.i, this.d, g); - i2 = ite(f2, h, (this.e & 512) == 512); - if (!i2) - throw Adb(new Lqe(TId((Hde(), kJe)))); - ute(k, i2); - d = true; - if (g + 1 >= this.j || ihb(this.i, g + 1) != 93) - throw Adb(new Lqe(TId((Hde(), iJe)))); - this.d = g + 2; - } - Mqe(this); - if (!d) { - if (this.c != 0 || this.a != 45) { - rte(k, c2, c2); - } else { - Mqe(this); - if ((m = this.c) == 1) - throw Adb(new Lqe(TId((Hde(), jJe)))); - if (m == 0 && this.a == 93) { - rte(k, c2, c2); - rte(k, 45, 45); - } else { - j = this.a; - m == 10 && (j = this.cm()); - Mqe(this); - rte(k, c2, j); - } - } - } - (this.e & gwe) == gwe && this.c == 0 && this.a == 44 && Mqe(this); - } - if (this.c == 1) - throw Adb(new Lqe(TId((Hde(), jJe)))); - if (b) { - wte(b, k); - k = b; - } - vte(k); - ste(k); - this.b = 0; - Mqe(this); - return k; - }; - _2.fm = function Zqe() { - var a, b, c2, d; - c2 = this.em(false); - while ((d = this.c) != 7) { - a = this.a; - if (d == 0 && (a == 45 || a == 38) || d == 4) { - Mqe(this); - if (this.c != 9) - throw Adb(new Lqe(TId((Hde(), pJe)))); - b = this.em(false); - if (d == 4) - ute(c2, b); - else if (a == 45) - wte(c2, b); - else if (a == 38) - tte(c2, b); - else - throw Adb(new yz("ASSERT")); - } else { - throw Adb(new Lqe(TId((Hde(), qJe)))); - } - } - Mqe(this); - return c2; - }; - _2.gm = function $qe() { - var a, b; - a = this.a - 48; - b = (Vse(), Vse(), new eue(12, null, a)); - !this.g && (this.g = new gyb()); - dyb(this.g, new Bte(a)); - Mqe(this); - return b; - }; - _2.hm = function _qe() { - Mqe(this); - return Vse(), Nse; - }; - _2.im = function are() { - Mqe(this); - return Vse(), Lse; - }; - _2.jm = function bre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.km = function cre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.lm = function dre() { - Mqe(this); - return fte(); - }; - _2.mm = function ere() { - Mqe(this); - return Vse(), Pse; - }; - _2.nm = function fre() { - Mqe(this); - return Vse(), Sse; - }; - _2.om = function gre() { - var a; - if (this.d >= this.j || ((a = ihb(this.i, this.d++)) & 65504) != 64) - throw Adb(new Lqe(TId((Hde(), dJe)))); - Mqe(this); - return Vse(), Vse(), new Hte(0, a - 64); - }; - _2.pm = function hre() { - Mqe(this); - return gte(); - }; - _2.qm = function ire() { - Mqe(this); - return Vse(), Tse; - }; - _2.rm = function jre() { - var a; - a = (Vse(), Vse(), new Hte(0, 105)); - Mqe(this); - return a; - }; - _2.sm = function kre() { - Mqe(this); - return Vse(), Qse; - }; - _2.tm = function lre() { - Mqe(this); - return Vse(), Ose; - }; - _2.um = function mre(a, b) { - return this.cm(); - }; - _2.vm = function nre() { - Mqe(this); - return Vse(), Gse; - }; - _2.wm = function ore() { - var a, b, c2, d, e; - if (this.d + 1 >= this.j) - throw Adb(new Lqe(TId((Hde(), aJe)))); - d = -1; - b = null; - a = ihb(this.i, this.d); - if (49 <= a && a <= 57) { - d = a - 48; - !this.g && (this.g = new gyb()); - dyb(this.g, new Bte(d)); - ++this.d; - if (ihb(this.i, this.d) != 41) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - ++this.d; - } else { - a == 63 && --this.d; - Mqe(this); - b = Pqe(this); - switch (b.e) { - case 20: - case 21: - case 22: - case 23: - break; - case 8: - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - break; - default: - throw Adb(new Lqe(TId((Hde(), bJe)))); - } - } - Mqe(this); - e = Qqe(this); - c2 = null; - if (e.e == 2) { - if (e.Pm() != 2) - throw Adb(new Lqe(TId((Hde(), cJe)))); - c2 = e.Lm(1); - e = e.Lm(0); - } - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return Vse(), Vse(), new Ute(d, b, e, c2); - }; - _2.xm = function pre() { - Mqe(this); - return Vse(), Hse; - }; - _2.ym = function qre() { - var a; - Mqe(this); - a = _se(24, Qqe(this)); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return a; - }; - _2.zm = function rre() { - var a; - Mqe(this); - a = _se(20, Qqe(this)); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return a; - }; - _2.Am = function sre() { - var a; - Mqe(this); - a = _se(22, Qqe(this)); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return a; - }; - _2.Bm = function tre() { - var a, b, c2, d, e; - a = 0; - c2 = 0; - b = -1; - while (this.d < this.j) { - b = ihb(this.i, this.d); - e = rse(b); - if (e == 0) - break; - a |= e; - ++this.d; - } - if (this.d >= this.j) - throw Adb(new Lqe(TId((Hde(), $Ie)))); - if (b == 45) { - ++this.d; - while (this.d < this.j) { - b = ihb(this.i, this.d); - e = rse(b); - if (e == 0) - break; - c2 |= e; - ++this.d; - } - if (this.d >= this.j) - throw Adb(new Lqe(TId((Hde(), $Ie)))); - } - if (b == 58) { - ++this.d; - Mqe(this); - d = ate(Qqe(this), a, c2); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - } else if (b == 41) { - ++this.d; - Mqe(this); - d = ate(Qqe(this), a, c2); - } else - throw Adb(new Lqe(TId((Hde(), _Ie)))); - return d; - }; - _2.Cm = function ure() { - var a; - Mqe(this); - a = _se(21, Qqe(this)); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return a; - }; - _2.Dm = function vre() { - var a; - Mqe(this); - a = _se(23, Qqe(this)); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return a; - }; - _2.Em = function wre() { - var a, b; - Mqe(this); - a = this.f++; - b = bte(Qqe(this), a); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return b; - }; - _2.Fm = function xre() { - var a; - Mqe(this); - a = bte(Qqe(this), 0); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return a; - }; - _2.Gm = function yre(a) { - Mqe(this); - if (this.c == 5) { - Mqe(this); - return $se(a, (Vse(), Vse(), new Kte(9, a))); - } else - return $se(a, (Vse(), Vse(), new Kte(3, a))); - }; - _2.Hm = function zre(a) { - var b; - Mqe(this); - b = (Vse(), Vse(), new iue(2)); - if (this.c == 5) { - Mqe(this); - hue2(b, Ese); - hue2(b, a); - } else { - hue2(b, a); - hue2(b, Ese); - } - return b; - }; - _2.Im = function Are(a) { - Mqe(this); - if (this.c == 5) { - Mqe(this); - return Vse(), Vse(), new Kte(9, a); - } else - return Vse(), Vse(), new Kte(3, a); - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - _2.d = 0; - _2.e = 0; - _2.f = 1; - _2.g = null; - _2.j = 0; - sfb(LLe, "RegEx/RegexParser", 836); - feb(1947, 836, {}, Gre); - _2.bm = function Hre(a) { - return false; - }; - _2.cm = function Ire() { - return Dre(this); - }; - _2.dm = function Kre(a) { - return Ere(a); - }; - _2.em = function Lre(a) { - return Fre(this); - }; - _2.fm = function Mre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.gm = function Nre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.hm = function Ore() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.im = function Pre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.jm = function Qre() { - Mqe(this); - return Ere(67); - }; - _2.km = function Rre() { - Mqe(this); - return Ere(73); - }; - _2.lm = function Sre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.mm = function Tre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.nm = function Ure() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.om = function Vre() { - Mqe(this); - return Ere(99); - }; - _2.pm = function Wre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.qm = function Xre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.rm = function Yre() { - Mqe(this); - return Ere(105); - }; - _2.sm = function Zre() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.tm = function $re() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.um = function _re(a, b) { - return ute(a, Ere(b)), -1; - }; - _2.vm = function ase() { - Mqe(this); - return Vse(), Vse(), new Hte(0, 94); - }; - _2.wm = function bse() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.xm = function cse() { - Mqe(this); - return Vse(), Vse(), new Hte(0, 36); - }; - _2.ym = function dse() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.zm = function ese() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.Am = function fse() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.Bm = function gse() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.Cm = function hse() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.Dm = function ise() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.Em = function jse() { - var a; - Mqe(this); - a = bte(Qqe(this), 0); - if (this.c != 7) - throw Adb(new Lqe(TId((Hde(), ZIe)))); - Mqe(this); - return a; - }; - _2.Fm = function kse() { - throw Adb(new Lqe(TId((Hde(), xJe)))); - }; - _2.Gm = function lse(a) { - Mqe(this); - return $se(a, (Vse(), Vse(), new Kte(3, a))); - }; - _2.Hm = function mse(a) { - var b; - Mqe(this); - b = (Vse(), Vse(), new iue(2)); - hue2(b, a); - hue2(b, Ese); - return b; - }; - _2.Im = function nse(a) { - Mqe(this); - return Vse(), Vse(), new Kte(3, a); - }; - var Bre = null, Cre = null; - sfb(LLe, "RegEx/ParserForXMLSchema", 1947); - feb(122, 1, ZLe, Wse); - _2.Jm = function Xse(a) { - throw Adb(new yz("Not supported.")); - }; - _2.Km = function dte() { - return -1; - }; - _2.Lm = function ete(a) { - return null; - }; - _2.Mm = function jte() { - return null; - }; - _2.Nm = function mte(a) { - }; - _2.Om = function nte(a) { - }; - _2.Pm = function ote() { - return 0; - }; - _2.Ib = function pte() { - return this.Qm(0); - }; - _2.Qm = function qte(a) { - return this.e == 11 ? "." : ""; - }; - _2.e = 0; - var vse, wse, xse, yse, zse, Ase = null, Bse, Cse = null, Dse, Ese, Fse = null, Gse, Hse, Ise, Jse, Kse, Lse, Mse, Nse, Ose, Pse, Qse, Rse, Sse, Tse; - var qdb = sfb(LLe, "RegEx/Token", 122); - feb(138, 122, { 3: 1, 138: 1, 122: 1 }, xte); - _2.Qm = function Ate(a) { - var b, c2, d; - if (this.e == 4) { - if (this == Dse) - c2 = "."; - else if (this == Bse) - c2 = "\\d"; - else if (this == Rse) - c2 = "\\w"; - else if (this == Mse) - c2 = "\\s"; - else { - d = new Qhb(); - d.a += "["; - for (b = 0; b < this.b.length; b += 2) { - (a & gwe) != 0 && b > 0 && (d.a += ",", d); - if (this.b[b] === this.b[b + 1]) { - Nhb(d, zte(this.b[b])); - } else { - Nhb(d, zte(this.b[b])); - d.a += "-"; - Nhb(d, zte(this.b[b + 1])); - } - } - d.a += "]"; - c2 = d.a; - } - } else { - if (this == Ise) - c2 = "\\D"; - else if (this == Kse) - c2 = "\\W"; - else if (this == Jse) - c2 = "\\S"; - else { - d = new Qhb(); - d.a += "[^"; - for (b = 0; b < this.b.length; b += 2) { - (a & gwe) != 0 && b > 0 && (d.a += ",", d); - if (this.b[b] === this.b[b + 1]) { - Nhb(d, zte(this.b[b])); - } else { - Nhb(d, zte(this.b[b])); - d.a += "-"; - Nhb(d, zte(this.b[b + 1])); - } - } - d.a += "]"; - c2 = d.a; - } - } - return c2; - }; - _2.a = false; - _2.c = false; - sfb(LLe, "RegEx/RangeToken", 138); - feb(592, 1, { 592: 1 }, Bte); - _2.a = 0; - sfb(LLe, "RegEx/RegexParser/ReferencePosition", 592); - feb(591, 1, { 3: 1, 591: 1 }, Dte); - _2.Fb = function Ete(a) { - var b; - if (a == null) - return false; - if (!ZD(a, 591)) - return false; - b = RD(a, 591); - return lhb(this.b, b.b) && this.a == b.a; - }; - _2.Hb = function Fte() { - return ohb(this.b + "/" + pse(this.a)); - }; - _2.Ib = function Gte() { - return this.c.Qm(this.a); - }; - _2.a = 0; - sfb(LLe, "RegEx/RegularExpression", 591); - feb(228, 122, ZLe, Hte); - _2.Km = function Ite() { - return this.a; - }; - _2.Qm = function Jte(a) { - var b, c2, d; - switch (this.e) { - case 0: - switch (this.a) { - case 124: - case 42: - case 43: - case 63: - case 40: - case 41: - case 46: - case 91: - case 123: - case 92: - d = "\\" + XD(this.a & Bwe); - break; - case 12: - d = "\\f"; - break; - case 10: - d = "\\n"; - break; - case 13: - d = "\\r"; - break; - case 9: - d = "\\t"; - break; - case 27: - d = "\\e"; - break; - default: - if (this.a >= txe) { - c2 = (b = this.a >>> 0, "0" + b.toString(16)); - d = "\\v" + zhb(c2, c2.length - 6, c2.length); - } else - d = "" + XD(this.a & Bwe); - } - break; - case 8: - this == Gse || this == Hse ? d = "" + XD(this.a & Bwe) : d = "\\" + XD(this.a & Bwe); - break; - default: - d = null; - } - return d; - }; - _2.a = 0; - sfb(LLe, "RegEx/Token/CharToken", 228); - feb(318, 122, ZLe, Kte); - _2.Lm = function Lte(a) { - return this.a; - }; - _2.Nm = function Mte(a) { - this.b = a; - }; - _2.Om = function Nte(a) { - this.c = a; - }; - _2.Pm = function Ote() { - return 1; - }; - _2.Qm = function Pte(a) { - var b; - if (this.e == 3) { - if (this.c < 0 && this.b < 0) { - b = this.a.Qm(a) + "*"; - } else if (this.c == this.b) { - b = this.a.Qm(a) + "{" + this.c + "}"; - } else if (this.c >= 0 && this.b >= 0) { - b = this.a.Qm(a) + "{" + this.c + "," + this.b + "}"; - } else if (this.c >= 0 && this.b < 0) { - b = this.a.Qm(a) + "{" + this.c + ",}"; - } else - throw Adb(new yz("Token#toString(): CLOSURE " + this.c + pve + this.b)); - } else { - if (this.c < 0 && this.b < 0) { - b = this.a.Qm(a) + "*?"; - } else if (this.c == this.b) { - b = this.a.Qm(a) + "{" + this.c + "}?"; - } else if (this.c >= 0 && this.b >= 0) { - b = this.a.Qm(a) + "{" + this.c + "," + this.b + "}?"; - } else if (this.c >= 0 && this.b < 0) { - b = this.a.Qm(a) + "{" + this.c + ",}?"; - } else - throw Adb(new yz("Token#toString(): NONGREEDYCLOSURE " + this.c + pve + this.b)); - } - return b; - }; - _2.b = 0; - _2.c = 0; - sfb(LLe, "RegEx/Token/ClosureToken", 318); - feb(837, 122, ZLe, Qte); - _2.Lm = function Rte(a) { - return a == 0 ? this.a : this.b; - }; - _2.Pm = function Ste() { - return 2; - }; - _2.Qm = function Tte(a) { - var b; - this.b.e == 3 && this.b.Lm(0) == this.a ? b = this.a.Qm(a) + "+" : this.b.e == 9 && this.b.Lm(0) == this.a ? b = this.a.Qm(a) + "+?" : b = this.a.Qm(a) + ("" + this.b.Qm(a)); - return b; - }; - sfb(LLe, "RegEx/Token/ConcatToken", 837); - feb(1945, 122, ZLe, Ute); - _2.Lm = function Vte(a) { - if (a == 0) - return this.d; - if (a == 1) - return this.b; - throw Adb(new yz("Internal Error: " + a)); - }; - _2.Pm = function Wte() { - return !this.b ? 1 : 2; - }; - _2.Qm = function Xte(a) { - var b; - this.c > 0 ? b = "(?(" + this.c + ")" : this.a.e == 8 ? b = "(?(" + this.a + ")" : b = "(?" + this.a; - !this.b ? b += this.d + ")" : b += this.d + "|" + this.b + ")"; - return b; - }; - _2.c = 0; - sfb(LLe, "RegEx/Token/ConditionToken", 1945); - feb(1946, 122, ZLe, Yte); - _2.Lm = function Zte(a) { - return this.b; - }; - _2.Pm = function $te() { - return 1; - }; - _2.Qm = function _te(a) { - return "(?" + (this.a == 0 ? "" : pse(this.a)) + (this.c == 0 ? "" : pse(this.c)) + ":" + this.b.Qm(a) + ")"; - }; - _2.a = 0; - _2.c = 0; - sfb(LLe, "RegEx/Token/ModifierToken", 1946); - feb(838, 122, ZLe, aue); - _2.Lm = function bue(a) { - return this.a; - }; - _2.Pm = function cue() { - return 1; - }; - _2.Qm = function due(a) { - var b; - b = null; - switch (this.e) { - case 6: - this.b == 0 ? b = "(?:" + this.a.Qm(a) + ")" : b = "(" + this.a.Qm(a) + ")"; - break; - case 20: - b = "(?=" + this.a.Qm(a) + ")"; - break; - case 21: - b = "(?!" + this.a.Qm(a) + ")"; - break; - case 22: - b = "(?<=" + this.a.Qm(a) + ")"; - break; - case 23: - b = "(?" + this.a.Qm(a) + ")"; - } - return b; - }; - _2.b = 0; - sfb(LLe, "RegEx/Token/ParenToken", 838); - feb(530, 122, { 3: 1, 122: 1, 530: 1 }, eue); - _2.Mm = function fue() { - return this.b; - }; - _2.Qm = function gue(a) { - return this.e == 12 ? "\\" + this.a : tse(this.b); - }; - _2.a = 0; - sfb(LLe, "RegEx/Token/StringToken", 530); - feb(477, 122, ZLe, iue); - _2.Jm = function jue(a) { - hue2(this, a); - }; - _2.Lm = function kue(a) { - return RD(eyb(this.a, a), 122); - }; - _2.Pm = function lue() { - return !this.a ? 0 : this.a.a.c.length; - }; - _2.Qm = function mue(a) { - var b, c2, d, e, f2; - if (this.e == 1) { - if (this.a.a.c.length == 2) { - b = RD(eyb(this.a, 0), 122); - c2 = RD(eyb(this.a, 1), 122); - c2.e == 3 && c2.Lm(0) == b ? e = b.Qm(a) + "+" : c2.e == 9 && c2.Lm(0) == b ? e = b.Qm(a) + "+?" : e = b.Qm(a) + ("" + c2.Qm(a)); - } else { - f2 = new Qhb(); - for (d = 0; d < this.a.a.c.length; d++) { - Nhb(f2, RD(eyb(this.a, d), 122).Qm(a)); - } - e = f2.a; - } - return e; - } - if (this.a.a.c.length == 2 && RD(eyb(this.a, 1), 122).e == 7) { - e = RD(eyb(this.a, 0), 122).Qm(a) + "?"; - } else if (this.a.a.c.length == 2 && RD(eyb(this.a, 0), 122).e == 7) { - e = RD(eyb(this.a, 1), 122).Qm(a) + "??"; - } else { - f2 = new Qhb(); - Nhb(f2, RD(eyb(this.a, 0), 122).Qm(a)); - for (d = 1; d < this.a.a.c.length; d++) { - f2.a += "|"; - Nhb(f2, RD(eyb(this.a, d), 122).Qm(a)); - } - e = f2.a; - } - return e; - }; - sfb(LLe, "RegEx/Token/UnionToken", 477); - feb(527, 1, { 600: 1 }, oue); - _2.Ib = function pue() { - return this.a.b; - }; - sfb($Le, "XMLTypeUtil/PatternMatcherImpl", 527); - feb(1707, 1527, {}, sue); - var que; - sfb($Le, "XMLTypeValidator", 1707); - feb(270, 1, Vve, vue); - _2.Jc = function wue(a) { - xgb(this, a); - }; - _2.Kc = function xue() { - return (this.b - this.a) * this.c < 0 ? tue : new Rue(this); - }; - _2.a = 0; - _2.b = 0; - _2.c = 0; - var tue; - sfb(aMe, "ExclusiveRange", 270); - feb(1084, 1, Jve, Cue); - _2.Rb = function Due(a) { - RD(a, 17); - yue(); - }; - _2.Nb = function Eue(a) { - Ztb(this, a); - }; - _2.Pb = function Hue() { - return zue(); - }; - _2.Ub = function Jue() { - return Aue(); - }; - _2.Wb = function Mue(a) { - RD(a, 17); - Bue(); - }; - _2.Ob = function Fue() { - return false; - }; - _2.Sb = function Gue() { - return false; - }; - _2.Tb = function Iue() { - return -1; - }; - _2.Vb = function Kue() { - return -1; - }; - _2.Qb = function Lue() { - throw Adb(new kib(dMe)); - }; - sfb(aMe, "ExclusiveRange/1", 1084); - feb(258, 1, Jve, Rue); - _2.Rb = function Sue(a) { - RD(a, 17); - Nue(); - }; - _2.Nb = function Tue(a) { - Ztb(this, a); - }; - _2.Pb = function Wue() { - return Oue(this); - }; - _2.Ub = function Yue() { - return Pue(this); - }; - _2.Wb = function _ue(a) { - RD(a, 17); - Que(); - }; - _2.Ob = function Uue() { - return this.c.c < 0 ? this.a >= this.c.b : this.a <= this.c.b; - }; - _2.Sb = function Vue() { - return this.b > 0; - }; - _2.Tb = function Xue() { - return this.b; - }; - _2.Vb = function Zue() { - return this.b - 1; - }; - _2.Qb = function $ue() { - throw Adb(new kib(dMe)); - }; - _2.a = 0; - _2.b = 0; - sfb(aMe, "ExclusiveRange/RangeIterator", 258); - var hE = vfb(eKe, "C"); - var kE = vfb(hKe, "I"); - var xdb = vfb(hve, "Z"); - var lE = vfb(iKe, "J"); - var gE = vfb(dKe, "B"); - var iE = vfb(fKe, "D"); - var jE = vfb(gKe, "F"); - var wdb = vfb(jKe, "S"); - var g3 = ufb("org.eclipse.elk.core.labels", "ILabelManager"); - var T6 = ufb(sIe, "DiagnosticChain"); - var zab = ufb(QKe, "ResourceSet"); - var $6 = sfb(sIe, "InvocationTargetException", null); - var fve = (Qz(), Tz); - var gwtOnLoad = gwtOnLoad = ceb; - aeb(leb); - deb("permProps", [[["locale", "default"], [eMe, "gecko1_8"]], [["locale", "default"], [eMe, "safari"]]]); - gwtOnLoad(null, "elk", null); - }).call(this); - }).call(this, typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); - }, {}], 3: [function(require, module3, exports3) { - function _classCallCheck(instance2, Constructor) { - if (!(instance2 instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _possibleConstructorReturn(self2, call) { - if (!self2) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self2; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; - } - var ELK2 = require("./elk-api.js").default; - var ELKNode = function(_ELK) { - _inherits(ELKNode2, _ELK); - function ELKNode2() { - var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - _classCallCheck(this, ELKNode2); - var optionsClone = Object.assign({}, options2); - var workerThreadsExist = false; - try { - require.resolve("web-worker"); - workerThreadsExist = true; - } catch (e) { - } - if (options2.workerUrl) { - if (workerThreadsExist) { - var Worker2 = require("web-worker"); - optionsClone.workerFactory = function(url) { - return new Worker2(url); - }; - } else { - console.warn("Web worker requested but 'web-worker' package not installed. \nConsider installing the package or pass your own 'workerFactory' to ELK's constructor.\n... Falling back to non-web worker version."); - } - } - if (!optionsClone.workerFactory) { - var _require = require("./elk-worker.min.js"), _Worker = _require.Worker; - optionsClone.workerFactory = function(url) { - return new _Worker(url); - }; - } - return _possibleConstructorReturn(this, (ELKNode2.__proto__ || Object.getPrototypeOf(ELKNode2)).call(this, optionsClone)); - } - return ELKNode2; - }(ELK2); - Object.defineProperty(module3.exports, "__esModule", { - value: true - }); - module3.exports = ELKNode; - ELKNode.default = ELKNode; - }, { "./elk-api.js": 1, "./elk-worker.min.js": 2, "web-worker": 4 }], 4: [function(require, module3, exports3) { - module3.exports = Worker; - }, {}] }, {}, [3])(3); - }); - })(elk_bundled); - var elk_bundledExports = elk_bundled.exports; - const ELK = /* @__PURE__ */ getDefaultExportFromCjs(elk_bundledExports); - const elk = new ELK(); - let portPos = {}; - const conf = {}; - let nodeDb = {}; - const addVertices = async function(vert, svgId, root2, doc, diagObj, parentLookupDb, graph) { - const svg2 = root2.select(`[id="${svgId}"]`); - const nodes2 = svg2.insert("g").attr("class", "nodes"); - const keys2 = Object.keys(vert); - await Promise.all( - keys2.map(async function(id2) { - const vertex = vert[id2]; - let classStr = "default"; - if (vertex.classes.length > 0) { - classStr = vertex.classes.join(" "); - } - classStr = classStr + " flowchart-label"; - const styles2 = getStylesFromArray(vertex.styles); - let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id; - const labelData = { width: 0, height: 0 }; - const ports = [ - { - id: vertex.id + "-west", - layoutOptions: { - "port.side": "WEST" - } - }, - { - id: vertex.id + "-east", - layoutOptions: { - "port.side": "EAST" - } - }, - { - id: vertex.id + "-south", - layoutOptions: { - "port.side": "SOUTH" - } - }, - { - id: vertex.id + "-north", - layoutOptions: { - "port.side": "NORTH" - } - } - ]; - let radius = 0; - let _shape = ""; - let layoutOptions = {}; - switch (vertex.type) { - case "round": - radius = 5; - _shape = "rect"; - break; - case "square": - _shape = "rect"; - break; - case "diamond": - _shape = "question"; - layoutOptions = { - portConstraints: "FIXED_SIDE" - }; - break; - case "hexagon": - _shape = "hexagon"; - break; - case "odd": - _shape = "rect_left_inv_arrow"; - break; - case "lean_right": - _shape = "lean_right"; - break; - case "lean_left": - _shape = "lean_left"; - break; - case "trapezoid": - _shape = "trapezoid"; - break; - case "inv_trapezoid": - _shape = "inv_trapezoid"; - break; - case "odd_right": - _shape = "rect_left_inv_arrow"; - break; - case "circle": - _shape = "circle"; - break; - case "ellipse": - _shape = "ellipse"; - break; - case "stadium": - _shape = "stadium"; - break; - case "subroutine": - _shape = "subroutine"; - break; - case "cylinder": - _shape = "cylinder"; - break; - case "group": - _shape = "rect"; - break; - case "doublecircle": - _shape = "doublecircle"; - break; - default: - _shape = "rect"; - } - const node2 = { - labelStyle: styles2.labelStyle, - shape: _shape, - labelText: vertexText, - labelType: vertex.labelType, - rx: radius, - ry: radius, - class: classStr, - style: styles2.style, - id: vertex.id, - link: vertex.link, - linkTarget: vertex.linkTarget, - tooltip: diagObj.db.getTooltip(vertex.id) || "", - domId: diagObj.db.lookUpDomId(vertex.id), - haveCallback: vertex.haveCallback, - width: vertex.type === "group" ? 500 : void 0, - dir: vertex.dir, - type: vertex.type, - props: vertex.props, - padding: getConfig$2().flowchart.padding - }; - let boundingBox; - let nodeEl; - if (node2.type !== "group") { - nodeEl = await insertNode(nodes2, node2, vertex.dir); - boundingBox = nodeEl.node().getBBox(); - } else { - doc.createElementNS("http://www.w3.org/2000/svg", "text"); - const { shapeSvg, bbox } = await labelHelper(nodes2, node2, void 0, true); - labelData.width = bbox.width; - labelData.wrappingWidth = getConfig$2().flowchart.wrappingWidth; - labelData.height = bbox.height; - labelData.labelNode = shapeSvg.node(); - node2.labelData = labelData; - } - const data = { - id: vertex.id, - ports: vertex.type === "diamond" ? ports : [], - // labelStyle: styles.labelStyle, - // shape: _shape, - layoutOptions, - labelText: vertexText, - labelData, - // labels: [{ text: vertexText }], - // rx: radius, - // ry: radius, - // class: classStr, - // style: styles.style, - // link: vertex.link, - // linkTarget: vertex.linkTarget, - // tooltip: diagObj.db.getTooltip(vertex.id) || '', - domId: diagObj.db.lookUpDomId(vertex.id), - // haveCallback: vertex.haveCallback, - width: boundingBox == null ? void 0 : boundingBox.width, - height: boundingBox == null ? void 0 : boundingBox.height, - // dir: vertex.dir, - type: vertex.type, - // props: vertex.props, - // padding: getConfig().flowchart.padding, - // boundingBox, - el: nodeEl, - parent: parentLookupDb.parentById[vertex.id] - }; - nodeDb[node2.id] = data; - }) - ); - return graph; - }; - const getNextPosition = (position2, edgeDirection, graphDirection) => { - const portPos2 = { - TB: { - in: { - north: "north" - }, - out: { - south: "west", - west: "east", - east: "south" - } - }, - LR: { - in: { - west: "west" - }, - out: { - east: "south", - south: "north", - north: "east" - } - }, - RL: { - in: { - east: "east" - }, - out: { - west: "north", - north: "south", - south: "west" - } - }, - BT: { - in: { - south: "south" - }, - out: { - north: "east", - east: "west", - west: "north" - } - } - }; - portPos2.TD = portPos2.TB; - return portPos2[graphDirection][edgeDirection][position2]; - }; - const getNextPort = (node2, edgeDirection, graphDirection) => { - log$1.info("getNextPort", { node: node2, edgeDirection, graphDirection }); - if (!portPos[node2]) { - switch (graphDirection) { - case "TB": - case "TD": - portPos[node2] = { - inPosition: "north", - outPosition: "south" - }; - break; - case "BT": - portPos[node2] = { - inPosition: "south", - outPosition: "north" - }; - break; - case "RL": - portPos[node2] = { - inPosition: "east", - outPosition: "west" - }; - break; - case "LR": - portPos[node2] = { - inPosition: "west", - outPosition: "east" - }; - break; - } - } - const result = edgeDirection === "in" ? portPos[node2].inPosition : portPos[node2].outPosition; - if (edgeDirection === "in") { - portPos[node2].inPosition = getNextPosition( - portPos[node2].inPosition, - edgeDirection, - graphDirection - ); - } else { - portPos[node2].outPosition = getNextPosition( - portPos[node2].outPosition, - edgeDirection, - graphDirection - ); - } - return result; - }; - const getEdgeStartEndPoint = (edge, dir2) => { - let source = edge.start; - let target = edge.end; - const sourceId = source; - const targetId = target; - const startNode = nodeDb[source]; - const endNode = nodeDb[target]; - if (!startNode || !endNode) { - return { source, target }; - } - if (startNode.type === "diamond") { - source = `${source}-${getNextPort(source, "out", dir2)}`; - } - if (endNode.type === "diamond") { - target = `${target}-${getNextPort(target, "in", dir2)}`; - } - return { source, target, sourceId, targetId }; - }; - const addEdges = function(edges2, diagObj, graph, svg2) { - log$1.info("abc78 edges = ", edges2); - const labelsEl = svg2.insert("g").attr("class", "edgeLabels"); - let linkIdCnt = {}; - let dir2 = diagObj.db.getDirection(); - let defaultStyle2; - let defaultLabelStyle; - if (edges2.defaultStyle !== void 0) { - const defaultStyles = getStylesFromArray(edges2.defaultStyle); - defaultStyle2 = defaultStyles.style; - defaultLabelStyle = defaultStyles.labelStyle; - } - edges2.forEach(function(edge) { - const linkIdBase = "L-" + edge.start + "-" + edge.end; - if (linkIdCnt[linkIdBase] === void 0) { - linkIdCnt[linkIdBase] = 0; - log$1.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]); - } else { - linkIdCnt[linkIdBase]++; - log$1.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]); - } - let linkId = linkIdBase + "-" + linkIdCnt[linkIdBase]; - log$1.info("abc78 new link id to be used is", linkIdBase, linkId, linkIdCnt[linkIdBase]); - const linkNameStart = "LS-" + edge.start; - const linkNameEnd = "LE-" + edge.end; - const edgeData = { style: "", labelStyle: "" }; - edgeData.minlen = edge.length || 1; - if (edge.type === "arrow_open") { - edgeData.arrowhead = "none"; - } else { - edgeData.arrowhead = "normal"; - } - edgeData.arrowTypeStart = "arrow_open"; - edgeData.arrowTypeEnd = "arrow_open"; - switch (edge.type) { - case "double_arrow_cross": - edgeData.arrowTypeStart = "arrow_cross"; - case "arrow_cross": - edgeData.arrowTypeEnd = "arrow_cross"; - break; - case "double_arrow_point": - edgeData.arrowTypeStart = "arrow_point"; - case "arrow_point": - edgeData.arrowTypeEnd = "arrow_point"; - break; - case "double_arrow_circle": - edgeData.arrowTypeStart = "arrow_circle"; - case "arrow_circle": - edgeData.arrowTypeEnd = "arrow_circle"; - break; - } - let style = ""; - let labelStyle = ""; - switch (edge.stroke) { - case "normal": - style = "fill:none;"; - if (defaultStyle2 !== void 0) { - style = defaultStyle2; - } - if (defaultLabelStyle !== void 0) { - labelStyle = defaultLabelStyle; - } - edgeData.thickness = "normal"; - edgeData.pattern = "solid"; - break; - case "dotted": - edgeData.thickness = "normal"; - edgeData.pattern = "dotted"; - edgeData.style = "fill:none;stroke-width:2px;stroke-dasharray:3;"; - break; - case "thick": - edgeData.thickness = "thick"; - edgeData.pattern = "solid"; - edgeData.style = "stroke-width: 3.5px;fill:none;"; - break; - } - if (edge.style !== void 0) { - const styles2 = getStylesFromArray(edge.style); - style = styles2.style; - labelStyle = styles2.labelStyle; - } - edgeData.style = edgeData.style += style; - edgeData.labelStyle = edgeData.labelStyle += labelStyle; - if (edge.interpolate !== void 0) { - edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear); - } else if (edges2.defaultInterpolate !== void 0) { - edgeData.curve = interpolateToCurve(edges2.defaultInterpolate, curveLinear); - } else { - edgeData.curve = interpolateToCurve(conf.curve, curveLinear); - } - if (edge.text === void 0) { - if (edge.style !== void 0) { - edgeData.arrowheadStyle = "fill: #333"; - } - } else { - edgeData.arrowheadStyle = "fill: #333"; - edgeData.labelpos = "c"; - } - edgeData.labelType = edge.labelType; - edgeData.label = edge.text.replace(common$1.lineBreakRegex, "\n"); - if (edge.style === void 0) { - edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none;"; - } - edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); - edgeData.id = linkId; - edgeData.classes = "flowchart-link " + linkNameStart + " " + linkNameEnd; - const labelEl = insertEdgeLabel(labelsEl, edgeData); - const { source, target, sourceId, targetId } = getEdgeStartEndPoint(edge, dir2); - log$1.debug("abc78 source and target", source, target); - graph.edges.push({ - id: "e" + edge.start + edge.end, - sources: [source], - targets: [target], - sourceId, - targetId, - labelEl, - labels: [ - { - width: edgeData.width, - height: edgeData.height, - orgWidth: edgeData.width, - orgHeight: edgeData.height, - text: edgeData.label, - layoutOptions: { - "edgeLabels.inline": "true", - "edgeLabels.placement": "CENTER" - } - } - ], - edgeData - }); - }); - return graph; - }; - const addMarkersToEdge = function(svgPath, edgeData, diagramType, arrowMarkerAbsolute, id2) { - let url = ""; - if (arrowMarkerAbsolute) { - url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, "\\("); - url = url.replace(/\)/g, "\\)"); - } - addEdgeMarkers(svgPath, edgeData, url, id2, diagramType); - }; - const getClasses$2 = function(text2, diagObj) { - log$1.info("Extracting classes"); - return diagObj.db.getClasses(); - }; - const addSubGraphs = function(db2) { - const parentLookupDb = { parentById: {}, childrenById: {} }; - const subgraphs = db2.getSubGraphs(); - log$1.info("Subgraphs - ", subgraphs); - subgraphs.forEach(function(subgraph) { - subgraph.nodes.forEach(function(node2) { - parentLookupDb.parentById[node2] = subgraph.id; - if (parentLookupDb.childrenById[subgraph.id] === void 0) { - parentLookupDb.childrenById[subgraph.id] = []; - } - parentLookupDb.childrenById[subgraph.id].push(node2); - }); - }); - subgraphs.forEach(function(subgraph) { - ({ id: subgraph.id }); - if (parentLookupDb.parentById[subgraph.id] !== void 0) { - parentLookupDb.parentById[subgraph.id]; - } - }); - return parentLookupDb; - }; - const calcOffset = function(src, dest, parentLookupDb) { - const ancestor = findCommonAncestor(src, dest, parentLookupDb); - if (ancestor === void 0 || ancestor === "root") { - return { x: 0, y: 0 }; - } - const ancestorOffset = nodeDb[ancestor].offset; - return { x: ancestorOffset.posX, y: ancestorOffset.posY }; - }; - const insertEdge = function(edgesEl, edge, edgeData, diagObj, parentLookupDb, id2) { - const offset = calcOffset(edge.sourceId, edge.targetId, parentLookupDb); - const src = edge.sections[0].startPoint; - const dest = edge.sections[0].endPoint; - const segments = edge.sections[0].bendPoints ? edge.sections[0].bendPoints : []; - const segPoints = segments.map((segment) => [segment.x + offset.x, segment.y + offset.y]); - const points = [ - [src.x + offset.x, src.y + offset.y], - ...segPoints, - [dest.x + offset.x, dest.y + offset.y] - ]; - const { x: x2, y: y2 } = getLineFunctionsWithOffset(edge.edgeData); - const curve = line$1().x(x2).y(y2).curve(curveLinear); - const edgePath = edgesEl.insert("path").attr("d", curve(points)).attr("class", "path " + edgeData.classes).attr("fill", "none"); - const edgeG = edgesEl.insert("g").attr("class", "edgeLabel"); - const edgeWithLabel = d3select(edgeG.node().appendChild(edge.labelEl)); - const box = edgeWithLabel.node().firstChild.getBoundingClientRect(); - edgeWithLabel.attr("width", box.width); - edgeWithLabel.attr("height", box.height); - edgeG.attr( - "transform", - `translate(${edge.labels[0].x + offset.x}, ${edge.labels[0].y + offset.y})` - ); - addMarkersToEdge(edgePath, edgeData, diagObj.type, diagObj.arrowMarkerAbsolute, id2); - }; - const insertChildren = (nodeArray, parentLookupDb) => { - nodeArray.forEach((node2) => { - if (!node2.children) { - node2.children = []; - } - const childIds = parentLookupDb.childrenById[node2.id]; - if (childIds) { - childIds.forEach((childId) => { - node2.children.push(nodeDb[childId]); - }); - } - insertChildren(node2.children, parentLookupDb); - }); - }; - const draw$4 = async function(text2, id2, _version, diagObj) { - var _a2; - diagObj.db.clear(); - nodeDb = {}; - portPos = {}; - diagObj.db.setGen("gen-2"); - diagObj.parser.parse(text2); - const renderEl = d3select("body").append("div").attr("style", "height:400px").attr("id", "cy"); - let graph = { - id: "root", - layoutOptions: { - "elk.hierarchyHandling": "INCLUDE_CHILDREN", - "org.eclipse.elk.padding": "[top=100, left=100, bottom=110, right=110]", - "elk.layered.spacing.edgeNodeBetweenLayers": "30", - // 'elk.layered.mergeEdges': 'true', - "elk.direction": "DOWN" - // 'elk.ports.sameLayerEdges': true, - // 'nodePlacement.strategy': 'SIMPLE', - }, - children: [], - edges: [] - }; - log$1.info("Drawing flowchart using v3 renderer", elk); - let dir2 = diagObj.db.getDirection(); - switch (dir2) { - case "BT": - graph.layoutOptions["elk.direction"] = "UP"; - break; - case "TB": - graph.layoutOptions["elk.direction"] = "DOWN"; - break; - case "LR": - graph.layoutOptions["elk.direction"] = "RIGHT"; - break; - case "RL": - graph.layoutOptions["elk.direction"] = "LEFT"; - break; - } - const { securityLevel, flowchart: conf2 } = getConfig$2(); - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - const svg2 = root2.select(`[id="${id2}"]`); - const markers2 = ["point", "circle", "cross"]; - insertMarkers$4(svg2, markers2, diagObj.type, id2); - const vert = diagObj.db.getVertices(); - let subG; - const subGraphs2 = diagObj.db.getSubGraphs(); - log$1.info("Subgraphs - ", subGraphs2); - for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) { - subG = subGraphs2[i2]; - diagObj.db.addVertex( - subG.id, - { text: subG.title, type: subG.labelType }, - "group", - void 0, - subG.classes, - subG.dir - ); - } - const subGraphsEl = svg2.insert("g").attr("class", "subgraphs"); - const parentLookupDb = addSubGraphs(diagObj.db); - graph = await addVertices(vert, id2, root2, doc, diagObj, parentLookupDb, graph); - const edgesEl = svg2.insert("g").attr("class", "edges edgePath"); - const edges2 = diagObj.db.getEdges(); - graph = addEdges(edges2, diagObj, graph, svg2); - const nodes2 = Object.keys(nodeDb); - nodes2.forEach((nodeId) => { - const node2 = nodeDb[nodeId]; - if (!node2.parent) { - graph.children.push(node2); - } - if (parentLookupDb.childrenById[nodeId] !== void 0) { - node2.labels = [ - { - text: node2.labelText, - layoutOptions: { - "nodeLabels.placement": "[H_CENTER, V_TOP, INSIDE]" - }, - width: node2.labelData.width, - height: node2.labelData.height - // width: 100, - // height: 100, - } - ]; - delete node2.x; - delete node2.y; - delete node2.width; - delete node2.height; - } - }); - insertChildren(graph.children, parentLookupDb); - log$1.info("after layout", JSON.stringify(graph, null, 2)); - const g = await elk.layout(graph); - drawNodes$1(0, 0, g.children, svg2, subGraphsEl, diagObj, 0); - log$1.info("after layout", g); - (_a2 = g.edges) == null ? void 0 : _a2.map((edge) => { - insertEdge(edgesEl, edge, edge.edgeData, diagObj, parentLookupDb, id2); - }); - setupGraphViewbox$1({}, svg2, conf2.diagramPadding, conf2.useMaxWidth); - renderEl.remove(); - }; - const drawNodes$1 = (relX, relY, nodeArray, svg2, subgraphsEl, diagObj, depth) => { - nodeArray.forEach(function(node2) { - if (node2) { - nodeDb[node2.id].offset = { - posX: node2.x + relX, - posY: node2.y + relY, - x: relX, - y: relY, - depth, - width: node2.width, - height: node2.height - }; - if (node2.type === "group") { - const subgraphEl = subgraphsEl.insert("g").attr("class", "subgraph"); - subgraphEl.insert("rect").attr("class", "subgraph subgraph-lvl-" + depth % 5 + " node").attr("x", node2.x + relX).attr("y", node2.y + relY).attr("width", node2.width).attr("height", node2.height); - const label = subgraphEl.insert("g").attr("class", "label"); - const labelCentering = getConfig$2().flowchart.htmlLabels ? node2.labelData.width / 2 : 0; - label.attr( - "transform", - `translate(${node2.labels[0].x + relX + node2.x + labelCentering}, ${node2.labels[0].y + relY + node2.y + 3})` - ); - label.node().appendChild(node2.labelData.labelNode); - log$1.info("Id (UGH)= ", node2.type, node2.labels); - } else { - log$1.info("Id (UGH)= ", node2.id); - node2.el.attr( - "transform", - `translate(${node2.x + relX + node2.width / 2}, ${node2.y + relY + node2.height / 2})` - ); - } - } - }); - nodeArray.forEach(function(node2) { - if (node2 && node2.type === "group") { - drawNodes$1(relX + node2.x, relY + node2.y, node2.children, svg2, subgraphsEl, diagObj, depth + 1); - } - }); - }; - const renderer$4 = { - getClasses: getClasses$2, - draw: draw$4 - }; - const genSections$2 = (options2) => { - let sections2 = ""; - for (let i2 = 0; i2 < 5; i2++) { - sections2 += ` - .subgraph-lvl-${i2} { - fill: ${options2[`surface${i2}`]}; - stroke: ${options2[`surfacePeer${i2}`]}; - } - `; - } - return sections2; - }; - const getStyles$3 = (options2) => `.label { - font-family: ${options2.fontFamily}; - color: ${options2.nodeTextColor || options2.textColor}; - } - .cluster-label text { - fill: ${options2.titleColor}; - } - .cluster-label span { - color: ${options2.titleColor}; - } - - .label text,span { - fill: ${options2.nodeTextColor || options2.textColor}; - color: ${options2.nodeTextColor || options2.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; - stroke-width: 1px; - } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${options2.arrowheadColor}; - } - - .edgePath .path { - stroke: ${options2.lineColor}; - stroke-width: 2.0px; - } - - .flowchart-link { - stroke: ${options2.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${options2.edgeLabelBackground}; - rect { - opacity: 0.85; - background-color: ${options2.edgeLabelBackground}; - fill: ${options2.edgeLabelBackground}; - } - text-align: center; - } - - .cluster rect { - fill: ${options2.clusterBkg}; - stroke: ${options2.clusterBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${options2.titleColor}; - } - - .cluster span { - color: ${options2.titleColor}; - } - /* .cluster div { - color: ${options2.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${options2.fontFamily}; - font-size: 12px; - background: ${options2.tertiaryColor}; - border: 1px solid ${options2.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; - } - .subgraph { - stroke-width:2; - rx:3; - } - // .subgraph-lvl-1 { - // fill:#ccc; - // // stroke:black; - // } - - .flowchart-label text { - text-anchor: middle; - } - - ${genSections$2(options2)} -`; - const styles$2 = getStyles$3; - const diagram$4 = { - db: db$f, - renderer: renderer$4, - parser: parser$u, - styles: styles$2 - }; - const flowchartElkDefinition = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$4 - }, Symbol.toStringTag, { value: "Module" })); - var parser$6 = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 16], $V7 = [1, 17]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "timeline": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "title": 11, "acc_title": 12, "acc_title_value": 13, "acc_descr": 14, "acc_descr_value": 15, "acc_descr_multiline_value": 16, "section": 17, "period_statement": 18, "event_statement": 19, "period": 20, "event": 21, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "timeline", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 20: "period", 21: "event" }, - productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [18, 1], [19, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 1: - return $$[$0 - 1]; - case 2: - this.$ = []; - break; - case 3: - $$[$0 - 1].push($$[$0]); - this.$ = $$[$0 - 1]; - break; - case 4: - case 5: - this.$ = $$[$0]; - break; - case 6: - case 7: - this.$ = []; - break; - case 8: - yy.getCommonDb().setDiagramTitle($$[$0].substr(6)); - this.$ = $$[$0].substr(6); - break; - case 9: - this.$ = $$[$0].trim(); - yy.getCommonDb().setAccTitle(this.$); - break; - case 10: - case 11: - this.$ = $$[$0].trim(); - yy.getCommonDb().setAccDescription(this.$); - break; - case 12: - yy.addSection($$[$0].substr(8)); - this.$ = $$[$0].substr(8); - break; - case 15: - yy.addTask($$[$0], 0, ""); - this.$ = $$[$0]; - break; - case 16: - yy.addEvent($$[$0].substr(2)); - this.$ = $$[$0]; - break; - } - }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 18, 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), { 13: [1, 19] }, { 15: [1, 20] }, o($V0, [2, 11]), o($V0, [2, 12]), o($V0, [2, 13]), o($V0, [2, 14]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 4]), o($V0, [2, 9]), o($V0, [2, 10])], - defaultActions: {}, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; - } - return token2; - } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; - } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; - } - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - break; - case 1: - break; - case 2: - return 10; - case 3: - break; - case 4: - break; - case 5: - return 4; - case 6: - return 11; - case 7: - this.begin("acc_title"); - return 12; - case 8: - this.popState(); - return "acc_title_value"; - case 9: - this.begin("acc_descr"); - return 14; - case 10: - this.popState(); - return "acc_descr_value"; - case 11: - this.begin("acc_descr_multiline"); - break; - case 12: - this.popState(); - break; - case 13: - return "acc_descr_multiline_value"; - case 14: - return 17; - case 15: - return 21; - case 16: - return 20; - case 17: - return 6; - case 18: - return "INVALID"; - } - }, - rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?::\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?:$)/i, /^(?:.)/i], - conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$6.parser = parser$6; - const parser$7 = parser$6; - let currentSection = ""; - let currentTaskId = 0; - const sections = []; - const tasks = []; - const rawTasks = []; - const getCommonDb = () => commonDb; - const clear$3 = function() { - sections.length = 0; - tasks.length = 0; - currentSection = ""; - rawTasks.length = 0; - clear$n(); - }; - const addSection = function(txt) { - currentSection = txt; - sections.push(txt); - }; - const getSections = function() { - return sections; - }; - const getTasks = function() { - let allItemsProcessed = compileTasks(); - const maxDepth = 100; - let iterationCount = 0; - while (!allItemsProcessed && iterationCount < maxDepth) { - allItemsProcessed = compileTasks(); - iterationCount++; - } - tasks.push(...rawTasks); - return tasks; - }; - const addTask = function(period, length2, event) { - const rawTask = { - id: currentTaskId++, - section: currentSection, - type: currentSection, - task: period, - score: length2 ? length2 : 0, - //if event is defined, then add it the events array - events: event ? [event] : [] - }; - rawTasks.push(rawTask); - }; - const addEvent = function(event) { - const currentTask = rawTasks.find((task) => task.id === currentTaskId - 1); - currentTask.events.push(event); - }; - const addTaskOrg = function(descr) { - const newTask = { - section: currentSection, - type: currentSection, - description: descr, - task: descr, - classes: [] - }; - tasks.push(newTask); - }; - const compileTasks = function() { - const compileTask = function(pos) { - return rawTasks[pos].processed; - }; - let allProcessed = true; - for (const [i2, rawTask] of rawTasks.entries()) { - compileTask(i2); - allProcessed = allProcessed && rawTask.processed; - } - return allProcessed; - }; - const timelineDb = { - clear: clear$3, - getCommonDb, - addSection, - getSections, - getTasks, - addTask, - addTaskOrg, - addEvent - }; - const db$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - addEvent, - addSection, - addTask, - addTaskOrg, - clear: clear$3, - default: timelineDb, - getCommonDb, - getSections, - getTasks - }, Symbol.toStringTag, { value: "Module" })); - const MAX_SECTIONS$1 = 12; - const drawRect = function(elem, rectData) { - const rectElem = elem.append("rect"); - rectElem.attr("x", rectData.x); - rectElem.attr("y", rectData.y); - rectElem.attr("fill", rectData.fill); - rectElem.attr("stroke", rectData.stroke); - rectElem.attr("width", rectData.width); - rectElem.attr("height", rectData.height); - rectElem.attr("rx", rectData.rx); - rectElem.attr("ry", rectData.ry); - if (rectData.class !== void 0) { - rectElem.attr("class", rectData.class); - } - return rectElem; - }; - const drawFace = function(element2, faceData) { - const radius = 15; - const circleElement = element2.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible"); - const face = element2.append("g"); - face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); - face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); - function smile(face2) { - const arc = d3arc().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); - face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")"); - } - function sad(face2) { - const arc = d3arc().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); - face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")"); - } - function ambivalent(face2) { - face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666"); - } - if (faceData.score > 3) { - smile(face); - } else if (faceData.score < 3) { - sad(face); - } else { - ambivalent(face); - } - return circleElement; - }; - const drawCircle = function(element2, circleData) { - const circleElement = element2.append("circle"); - circleElement.attr("cx", circleData.cx); - circleElement.attr("cy", circleData.cy); - circleElement.attr("class", "actor-" + circleData.pos); - circleElement.attr("fill", circleData.fill); - circleElement.attr("stroke", circleData.stroke); - circleElement.attr("r", circleData.r); - if (circleElement.class !== void 0) { - circleElement.attr("class", circleElement.class); - } - if (circleData.title !== void 0) { - circleElement.append("title").text(circleData.title); - } - return circleElement; - }; - const drawText = function(elem, textData) { - const nText = textData.text.replace(//gi, " "); - const textElem = elem.append("text"); - textElem.attr("x", textData.x); - textElem.attr("y", textData.y); - textElem.attr("class", "legend"); - textElem.style("text-anchor", textData.anchor); - if (textData.class !== void 0) { - textElem.attr("class", textData.class); - } - const span = textElem.append("tspan"); - span.attr("x", textData.x + textData.textMargin * 2); - span.text(nText); - return textElem; - }; - const drawLabel = function(elem, txtObject) { - function genPoints(x2, y2, width2, height, cut) { - return x2 + "," + y2 + " " + (x2 + width2) + "," + y2 + " " + (x2 + width2) + "," + (y2 + height - cut) + " " + (x2 + width2 - cut * 1.2) + "," + (y2 + height) + " " + x2 + "," + (y2 + height); - } - const polygon = elem.append("polygon"); - polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7)); - polygon.attr("class", "labelBox"); - txtObject.y = txtObject.y + txtObject.labelMargin; - txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin; - drawText(elem, txtObject); - }; - const drawSection = function(elem, section, conf2) { - const g = elem.append("g"); - const rect2 = getNoteRect(); - rect2.x = section.x; - rect2.y = section.y; - rect2.fill = section.fill; - rect2.width = conf2.width; - rect2.height = conf2.height; - rect2.class = "journey-section section-type-" + section.num; - rect2.rx = 3; - rect2.ry = 3; - drawRect(g, rect2); - _drawTextCandidateFunc(conf2)( - section.text, - g, - rect2.x, - rect2.y, - rect2.width, - rect2.height, - { class: "journey-section section-type-" + section.num }, - conf2, - section.colour - ); - }; - let taskCount = -1; - const drawTask = function(elem, task, conf2) { - const center2 = task.x + conf2.width / 2; - const g = elem.append("g"); - taskCount++; - const maxHeight = 300 + 5 * 30; - g.append("line").attr("id", "task" + taskCount).attr("x1", center2).attr("y1", task.y).attr("x2", center2).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"); - drawFace(g, { - cx: center2, - cy: 300 + (5 - task.score) * 30, - score: task.score - }); - const rect2 = getNoteRect(); - rect2.x = task.x; - rect2.y = task.y; - rect2.fill = task.fill; - rect2.width = conf2.width; - rect2.height = conf2.height; - rect2.class = "task task-type-" + task.num; - rect2.rx = 3; - rect2.ry = 3; - drawRect(g, rect2); - task.x + 14; - _drawTextCandidateFunc(conf2)( - task.task, - g, - rect2.x, - rect2.y, - rect2.width, - rect2.height, - { class: "task" }, - conf2, - task.colour - ); - }; - const drawBackgroundRect = function(elem, bounds2) { - const rectElem = drawRect(elem, { - x: bounds2.startx, - y: bounds2.starty, - width: bounds2.stopx - bounds2.startx, - height: bounds2.stopy - bounds2.starty, - fill: bounds2.fill, - class: "rect" - }); - rectElem.lower(); - }; - const getTextObj = function() { - return { - x: 0, - y: 0, - fill: void 0, - "text-anchor": "start", - width: 100, - height: 100, - textMargin: 0, - rx: 0, - ry: 0 - }; - }; - const getNoteRect = function() { - return { - x: 0, - y: 0, - width: 100, - anchor: "start", - height: 100, - rx: 0, - ry: 0 - }; - }; - const _drawTextCandidateFunc = function() { - function byText(content2, g, x2, y2, width2, height, textAttrs, colour) { - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2 + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content2); - _setTextAttrs(text2, textAttrs); - } - function byTspan(content2, g, x2, y2, width2, height, textAttrs, conf2, colour) { - const { taskFontSize, taskFontFamily } = conf2; - const lines = content2.split(//gi); - for (let i2 = 0; i2 < lines.length; i2++) { - const dy = i2 * taskFontSize - taskFontSize * (lines.length - 1) / 2; - const text2 = g.append("text").attr("x", x2 + width2 / 2).attr("y", y2).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily); - text2.append("tspan").attr("x", x2 + width2 / 2).attr("dy", dy).text(lines[i2]); - text2.attr("y", y2 + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"); - _setTextAttrs(text2, textAttrs); - } - } - function byFo(content2, g, x2, y2, width2, height, textAttrs, conf2) { - const body = g.append("switch"); - const f2 = body.append("foreignObject").attr("x", x2).attr("y", y2).attr("width", width2).attr("height", height).attr("position", "fixed"); - const text2 = f2.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); - text2.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content2); - byTspan(content2, body, x2, y2, width2, height, textAttrs, conf2); - _setTextAttrs(text2, textAttrs); - } - function _setTextAttrs(toText, fromTextAttrsDict) { - for (const key in fromTextAttrsDict) { - if (key in fromTextAttrsDict) { - toText.attr(key, fromTextAttrsDict[key]); - } - } - } - return function(conf2) { - return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan; - }; - }(); - const initGraphics = function(graphics) { - graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z"); - }; - function wrap(text2, width2) { - text2.each(function() { - var text3 = d3select(this), words = text3.text().split(/(\s+|
    )/).reverse(), word, line2 = [], lineHeight = 1.1, y2 = text3.attr("y"), dy = parseFloat(text3.attr("dy")), tspan = text3.text(null).append("tspan").attr("x", 0).attr("y", y2).attr("dy", dy + "em"); - for (let j = 0; j < words.length; j++) { - word = words[words.length - 1 - j]; - line2.push(word); - tspan.text(line2.join(" ").trim()); - if (tspan.node().getComputedTextLength() > width2 || word === "
    ") { - line2.pop(); - tspan.text(line2.join(" ").trim()); - if (word === "
    ") { - line2 = [""]; - } else { - line2 = [word]; - } - tspan = text3.append("tspan").attr("x", 0).attr("y", y2).attr("dy", lineHeight + "em").text(word); - } - } - }); - } - const drawNode$1 = function(elem, node2, fullSection, conf2) { - const section = fullSection % MAX_SECTIONS$1 - 1; - const nodeElem = elem.append("g"); - node2.section = section; - nodeElem.attr( - "class", - (node2.class ? node2.class + " " : "") + "timeline-node " + ("section-" + section) - ); - const bkgElem = nodeElem.append("g"); - const textElem = nodeElem.append("g"); - const txt = textElem.append("text").text(node2.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node2.width); - const bbox = txt.node().getBBox(); - const fontSize = conf2.fontSize && conf2.fontSize.replace ? conf2.fontSize.replace("px", "") : conf2.fontSize; - node2.height = bbox.height + fontSize * 1.1 * 0.5 + node2.padding; - node2.height = Math.max(node2.height, node2.maxHeight); - node2.width = node2.width + 2 * node2.padding; - textElem.attr("transform", "translate(" + node2.width / 2 + ", " + node2.padding / 2 + ")"); - defaultBkg$1(bkgElem, node2, section); - return node2; - }; - const getVirtualNodeHeight = function(elem, node2, conf2) { - const textElem = elem.append("g"); - const txt = textElem.append("text").text(node2.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node2.width); - const bbox = txt.node().getBBox(); - const fontSize = conf2.fontSize && conf2.fontSize.replace ? conf2.fontSize.replace("px", "") : conf2.fontSize; - textElem.remove(); - return bbox.height + fontSize * 1.1 * 0.5 + node2.padding; - }; - const defaultBkg$1 = function(elem, node2, section) { - const rd = 5; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + node2.type).attr( - "d", - `M0 ${node2.height - rd} v${-node2.height + 2 * rd} q0,-5 5,-5 h${node2.width - 2 * rd} q5,0 5,5 v${node2.height - rd} H0 Z` - ); - elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node2.height).attr("x2", node2.width).attr("y2", node2.height); - }; - const svgDraw = { - drawRect, - drawCircle, - drawSection, - drawText, - drawLabel, - drawTask, - drawBackgroundRect, - getTextObj, - getNoteRect, - initGraphics, - drawNode: drawNode$1, - getVirtualNodeHeight - }; - const draw$3 = function(text2, id2, version2, diagObj) { - var _a2, _b2; - const conf2 = getConfig$1(); - const LEFT_MARGIN2 = conf2.leftMargin ?? 50; - log$1.debug("timeline", diagObj.db); - const securityLevel = conf2.securityLevel; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = root2.select("#" + id2); - svg2.append("g"); - const tasks2 = diagObj.db.getTasks(); - const title2 = diagObj.db.getCommonDb().getDiagramTitle(); - log$1.debug("task", tasks2); - svgDraw.initGraphics(svg2); - const sections2 = diagObj.db.getSections(); - log$1.debug("sections", sections2); - let maxSectionHeight = 0; - let maxTaskHeight = 0; - let depthY = 0; - let sectionBeginY = 0; - let masterX = 50 + LEFT_MARGIN2; - let masterY = 50; - sectionBeginY = 50; - let sectionNumber = 0; - let hasSections = true; - sections2.forEach(function(section) { - const sectionNode = { - number: sectionNumber, - descr: section, - section: sectionNumber, - width: 150, - padding: 20, - maxHeight: maxSectionHeight - }; - const sectionHeight = svgDraw.getVirtualNodeHeight(svg2, sectionNode, conf2); - log$1.debug("sectionHeight before draw", sectionHeight); - maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20); - }); - let maxEventCount = 0; - let maxEventLineLength = 0; - log$1.debug("tasks.length", tasks2.length); - for (const [i2, task] of tasks2.entries()) { - const taskNode = { - number: i2, - descr: task, - section: task.section, - width: 150, - padding: 20, - maxHeight: maxTaskHeight - }; - const taskHeight = svgDraw.getVirtualNodeHeight(svg2, taskNode, conf2); - log$1.debug("taskHeight before draw", taskHeight); - maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20); - maxEventCount = Math.max(maxEventCount, task.events.length); - let maxEventLineLengthTemp = 0; - for (let j = 0; j < task.events.length; j++) { - const event = task.events[j]; - const eventNode = { - descr: event, - section: task.section, - number: task.section, - width: 150, - padding: 20, - maxHeight: 50 - }; - maxEventLineLengthTemp += svgDraw.getVirtualNodeHeight(svg2, eventNode, conf2); - } - maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp); - } - log$1.debug("maxSectionHeight before draw", maxSectionHeight); - log$1.debug("maxTaskHeight before draw", maxTaskHeight); - if (sections2 && sections2.length > 0) { - sections2.forEach((section) => { - const tasksForSection = tasks2.filter((task) => task.section === section); - const sectionNode = { - number: sectionNumber, - descr: section, - section: sectionNumber, - width: 200 * Math.max(tasksForSection.length, 1) - 50, - padding: 20, - maxHeight: maxSectionHeight - }; - log$1.debug("sectionNode", sectionNode); - const sectionNodeWrapper = svg2.append("g"); - const node2 = svgDraw.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf2); - log$1.debug("sectionNode output", node2); - sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`); - masterY += maxSectionHeight + 50; - if (tasksForSection.length > 0) { - drawTasks( - svg2, - tasksForSection, - sectionNumber, - masterX, - masterY, - maxTaskHeight, - conf2, - maxEventCount, - maxEventLineLength, - maxSectionHeight, - false - ); - } - masterX += 200 * Math.max(tasksForSection.length, 1); - masterY = sectionBeginY; - sectionNumber++; - }); - } else { - hasSections = false; - drawTasks( - svg2, - tasks2, - sectionNumber, - masterX, - masterY, - maxTaskHeight, - conf2, - maxEventCount, - maxEventLineLength, - maxSectionHeight, - true - ); - } - const box = svg2.node().getBBox(); - log$1.debug("bounds", box); - if (title2) { - svg2.append("text").text(title2).attr("x", box.width / 2 - LEFT_MARGIN2).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20); - } - depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100; - const lineWrapper = svg2.append("g").attr("class", "lineWrapper"); - lineWrapper.append("line").attr("x1", LEFT_MARGIN2).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN2).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); - setupGraphViewbox$1( - void 0, - svg2, - ((_a2 = conf2.timeline) == null ? void 0 : _a2.padding) ?? 50, - ((_b2 = conf2.timeline) == null ? void 0 : _b2.useMaxWidth) ?? false - ); - }; - const drawTasks = function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf2, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) { - var _a2; - for (const task of tasks2) { - const taskNode = { - descr: task.task, - section: sectionColor, - number: sectionColor, - width: 150, - padding: 20, - maxHeight: maxTaskHeight - }; - log$1.debug("taskNode", taskNode); - const taskWrapper = diagram2.append("g").attr("class", "taskWrapper"); - const node2 = svgDraw.drawNode(taskWrapper, taskNode, sectionColor, conf2); - const taskHeight = node2.height; - log$1.debug("taskHeight after draw", taskHeight); - taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`); - maxTaskHeight = Math.max(maxTaskHeight, taskHeight); - if (task.events) { - const lineWrapper = diagram2.append("g").attr("class", "lineWrapper"); - let lineLength = maxTaskHeight; - masterY += 100; - lineLength = lineLength + drawEvents(diagram2, task.events, sectionColor, masterX, masterY, conf2); - masterY -= 100; - lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr( - "y2", - masterY + maxTaskHeight + (isWithoutSections ? maxTaskHeight : maxSectionHeight) + maxEventLineLength + 120 - ).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5"); - } - masterX = masterX + 200; - if (isWithoutSections && !((_a2 = conf2.timeline) == null ? void 0 : _a2.disableMulticolor)) { - sectionColor++; - } - } - masterY = masterY - 10; - }; - const drawEvents = function(diagram2, events, sectionColor, masterX, masterY, conf2) { - let maxEventHeight = 0; - const eventBeginY = masterY; - masterY = masterY + 100; - for (const event of events) { - const eventNode = { - descr: event, - section: sectionColor, - number: sectionColor, - width: 150, - padding: 20, - maxHeight: 50 - }; - log$1.debug("eventNode", eventNode); - const eventWrapper = diagram2.append("g").attr("class", "eventWrapper"); - const node2 = svgDraw.drawNode(eventWrapper, eventNode, sectionColor, conf2); - const eventHeight = node2.height; - maxEventHeight = maxEventHeight + eventHeight; - eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`); - masterY = masterY + 10 + eventHeight; - } - masterY = eventBeginY; - return maxEventHeight; - }; - const renderer$3 = { - setConf: () => { - }, - draw: draw$3 - }; - const genSections$1 = (options2) => { - let sections2 = ""; - for (let i2 = 0; i2 < options2.THEME_COLOR_LIMIT; i2++) { - options2["lineColor" + i2] = options2["lineColor" + i2] || options2["cScaleInv" + i2]; - if (isDark$1(options2["lineColor" + i2])) { - options2["lineColor" + i2] = lighten$1(options2["lineColor" + i2], 20); - } else { - options2["lineColor" + i2] = darken$1(options2["lineColor" + i2], 20); - } - } - for (let i2 = 0; i2 < options2.THEME_COLOR_LIMIT; i2++) { - const sw = "" + (17 - 3 * i2); - sections2 += ` - .section-${i2 - 1} rect, .section-${i2 - 1} path, .section-${i2 - 1} circle, .section-${i2 - 1} path { - fill: ${options2["cScale" + i2]}; - } - .section-${i2 - 1} text { - fill: ${options2["cScaleLabel" + i2]}; - } - .node-icon-${i2 - 1} { - font-size: 40px; - color: ${options2["cScaleLabel" + i2]}; - } - .section-edge-${i2 - 1}{ - stroke: ${options2["cScale" + i2]}; - } - .edge-depth-${i2 - 1}{ - stroke-width: ${sw}; - } - .section-${i2 - 1} line { - stroke: ${options2["cScaleInv" + i2]} ; - stroke-width: 3; - } - - .lineWrapper line{ - stroke: ${options2["cScaleLabel" + i2]} ; - } - - .disabled, .disabled circle, .disabled text { - fill: lightgray; - } - .disabled text { - fill: #efefef; - } - `; - } - return sections2; - }; - const getStyles$2 = (options2) => ` - .edge { - stroke-width: 3; - } - ${genSections$1(options2)} - .section-root rect, .section-root path, .section-root circle { - fill: ${options2.git0}; - } - .section-root text { - fill: ${options2.gitBranchLabel0}; - } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; - } - .edge { - fill: none; - } - .eventWrapper { - filter: brightness(120%); - } -`; - const styles$1 = getStyles$2; - const diagram$3 = { - db: db$5, - renderer: renderer$3, - parser: parser$7, - styles: styles$1 - }; - const timelineDefinition = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$3 - }, Symbol.toStringTag, { value: "Module" })); - var parser$4 = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 6, 13, 15, 16, 19, 22], $Vd = [1, 33], $Ve = [1, 34], $Vf = [1, 6, 7, 11, 13, 15, 16, 19, 22]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "mindMap": 4, "spaceLines": 5, "SPACELINE": 6, "NL": 7, "MINDMAP": 8, "document": 9, "stop": 10, "EOF": 11, "statement": 12, "SPACELIST": 13, "node": 14, "ICON": 15, "CLASS": 16, "nodeWithId": 17, "nodeWithoutId": 18, "NODE_DSTART": 19, "NODE_DESCR": 20, "NODE_DEND": 21, "NODE_ID": 22, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" }, - productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 6: - case 7: - return yy; - case 8: - yy.getLogger().trace("Stop NL "); - break; - case 9: - yy.getLogger().trace("Stop EOF "); - break; - case 11: - yy.getLogger().trace("Stop NL2 "); - break; - case 12: - yy.getLogger().trace("Stop EOF2 "); - break; - case 15: - yy.getLogger().info("Node: ", $$[$0].id); - yy.addNode($$[$0 - 1].length, $$[$0].id, $$[$0].descr, $$[$0].type); - break; - case 16: - yy.getLogger().trace("Icon: ", $$[$0]); - yy.decorateNode({ icon: $$[$0] }); - break; - case 17: - case 21: - yy.decorateNode({ class: $$[$0] }); - break; - case 18: - yy.getLogger().trace("SPACELIST"); - break; - case 19: - yy.getLogger().trace("Node: ", $$[$0].id); - yy.addNode(0, $$[$0].id, $$[$0].descr, $$[$0].type); - break; - case 20: - yy.decorateNode({ icon: $$[$0] }); - break; - case 25: - yy.getLogger().trace("node found ..", $$[$0 - 2]); - this.$ = { id: $$[$0 - 1], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) }; - break; - case 26: - this.$ = { id: $$[$0], descr: $$[$0], type: yy.nodeType.DEFAULT }; - break; - case 27: - yy.getLogger().trace("node found ..", $$[$0 - 3]); - this.$ = { id: $$[$0 - 3], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) }; - break; - } - }, - table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: $V0 }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: $V0 }, { 6: $V1, 7: [1, 10], 9: 9, 12: 11, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, o($V7, [2, 3]), { 1: [2, 2] }, o($V7, [2, 4]), o($V7, [2, 5]), { 1: [2, 6], 6: $V1, 12: 21, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, { 6: $V1, 9: 22, 12: 11, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, { 6: $V8, 7: $V9, 10: 23, 11: $Va }, o($Vb, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: $V5, 22: $V6 }), o($Vb, [2, 18]), o($Vb, [2, 19]), o($Vb, [2, 20]), o($Vb, [2, 21]), o($Vb, [2, 23]), o($Vb, [2, 24]), o($Vb, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: $V8, 7: $V9, 10: 32, 11: $Va }, { 1: [2, 7], 6: $V1, 12: 21, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, o($Vc, [2, 14], { 7: $Vd, 11: $Ve }), o($Vf, [2, 8]), o($Vf, [2, 9]), o($Vf, [2, 10]), o($Vb, [2, 15]), o($Vb, [2, 16]), o($Vb, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, o($Vc, [2, 13], { 7: $Vd, 11: $Ve }), o($Vf, [2, 11]), o($Vf, [2, 12]), { 21: [1, 37] }, o($Vb, [2, 25]), o($Vb, [2, 27])], - defaultActions: { 2: [2, 1], 6: [2, 2] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; - } - return token2; - } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; - } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; - } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; - } - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - yy.getLogger().trace("Found comment", yy_.yytext); - return 6; - case 1: - return 8; - case 2: - this.begin("CLASS"); - break; - case 3: - this.popState(); - return 16; - case 4: - this.popState(); - break; - case 5: - yy.getLogger().trace("Begin icon"); - this.begin("ICON"); - break; - case 6: - yy.getLogger().trace("SPACELINE"); - return 6; - case 7: - return 7; - case 8: - return 15; - case 9: - yy.getLogger().trace("end icon"); - this.popState(); - break; - case 10: - yy.getLogger().trace("Exploding node"); - this.begin("NODE"); - return 19; - case 11: - yy.getLogger().trace("Cloud"); - this.begin("NODE"); - return 19; - case 12: - yy.getLogger().trace("Explosion Bang"); - this.begin("NODE"); - return 19; - case 13: - yy.getLogger().trace("Cloud Bang"); - this.begin("NODE"); - return 19; - case 14: - this.begin("NODE"); - return 19; - case 15: - this.begin("NODE"); - return 19; - case 16: - this.begin("NODE"); - return 19; - case 17: - this.begin("NODE"); - return 19; - case 18: - return 13; - case 19: - return 22; - case 20: - return 11; - case 21: - this.begin("NSTR2"); - break; - case 22: - return "NODE_DESCR"; - case 23: - this.popState(); - break; - case 24: - yy.getLogger().trace("Starting NSTR"); - this.begin("NSTR"); - break; - case 25: - yy.getLogger().trace("description:", yy_.yytext); - return "NODE_DESCR"; - case 26: - this.popState(); - break; - case 27: - this.popState(); - yy.getLogger().trace("node end ))"); - return "NODE_DEND"; - case 28: - this.popState(); - yy.getLogger().trace("node end )"); - return "NODE_DEND"; - case 29: - this.popState(); - yy.getLogger().trace("node end ...", yy_.yytext); - return "NODE_DEND"; - case 30: - this.popState(); - yy.getLogger().trace("node end (("); - return "NODE_DEND"; - case 31: - this.popState(); - yy.getLogger().trace("node end (-"); - return "NODE_DEND"; - case 32: - this.popState(); - yy.getLogger().trace("node end (-"); - return "NODE_DEND"; - case 33: - this.popState(); - yy.getLogger().trace("node end (("); - return "NODE_DEND"; - case 34: - this.popState(); - yy.getLogger().trace("node end (("); - return "NODE_DEND"; - case 35: - yy.getLogger().trace("Long description:", yy_.yytext); - return 20; - case 36: - yy.getLogger().trace("Long description:", yy_.yytext); - return 20; - } - }, - rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i], - conditions: { "CLASS": { "rules": [3, 4], "inclusive": false }, "ICON": { "rules": [8, 9], "inclusive": false }, "NSTR2": { "rules": [22, 23], "inclusive": false }, "NSTR": { "rules": [25, 26], "inclusive": false }, "NODE": { "rules": [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$4.parser = parser$4; - const parser$5 = parser$4; - let nodes$1 = []; - let cnt$1 = 0; - let elements = {}; - const clear$2 = () => { - nodes$1 = []; - cnt$1 = 0; - elements = {}; - }; - const getParent = function(level) { - for (let i2 = nodes$1.length - 1; i2 >= 0; i2--) { - if (nodes$1[i2].level < level) { - return nodes$1[i2]; - } - } - return null; - }; - const getMindmap = () => { - return nodes$1.length > 0 ? nodes$1[0] : null; - }; - const addNode = (level, id2, descr, type2) => { - var _a2, _b2; - log$1.info("addNode", level, id2, descr, type2); - const conf2 = getConfig$1(); - let padding2 = ((_a2 = conf2.mindmap) == null ? void 0 : _a2.padding) ?? defaultConfig$2.mindmap.padding; - switch (type2) { - case nodeType.ROUNDED_RECT: - case nodeType.RECT: - case nodeType.HEXAGON: - padding2 *= 2; - } - const node2 = { - id: cnt$1++, - nodeId: sanitizeText$6(id2, conf2), - level, - descr: sanitizeText$6(descr, conf2), - type: type2, - children: [], - width: ((_b2 = conf2.mindmap) == null ? void 0 : _b2.maxNodeWidth) ?? defaultConfig$2.mindmap.maxNodeWidth, - padding: padding2 - }; - const parent = getParent(level); - if (parent) { - parent.children.push(node2); - nodes$1.push(node2); - } else { - if (nodes$1.length === 0) { - nodes$1.push(node2); - } else { - throw new Error( - 'There can be only one root. No parent could be found for ("' + node2.descr + '")' - ); - } - } - }; - const nodeType = { - DEFAULT: 0, - NO_BORDER: 0, - ROUNDED_RECT: 1, - RECT: 2, - CIRCLE: 3, - CLOUD: 4, - BANG: 5, - HEXAGON: 6 - }; - const getType = (startStr, endStr) => { - log$1.debug("In get type", startStr, endStr); - switch (startStr) { - case "[": - return nodeType.RECT; - case "(": - return endStr === ")" ? nodeType.ROUNDED_RECT : nodeType.CLOUD; - case "((": - return nodeType.CIRCLE; - case ")": - return nodeType.CLOUD; - case "))": - return nodeType.BANG; - case "{{": - return nodeType.HEXAGON; - default: - return nodeType.DEFAULT; - } - }; - const setElementForId = (id2, element2) => { - elements[id2] = element2; - }; - const decorateNode = (decoration) => { - if (!decoration) { - return; - } - const config2 = getConfig$1(); - const node2 = nodes$1[nodes$1.length - 1]; - if (decoration.icon) { - node2.icon = sanitizeText$6(decoration.icon, config2); - } - if (decoration.class) { - node2.class = sanitizeText$6(decoration.class, config2); - } - }; - const type2Str = (type2) => { - switch (type2) { - case nodeType.DEFAULT: - return "no-border"; - case nodeType.RECT: - return "rect"; - case nodeType.ROUNDED_RECT: - return "rounded-rect"; - case nodeType.CIRCLE: - return "circle"; - case nodeType.CLOUD: - return "cloud"; - case nodeType.BANG: - return "bang"; - case nodeType.HEXAGON: - return "hexgon"; - default: - return "no-border"; - } - }; - const getLogger$1 = () => log$1; - const getElementById = (id2) => elements[id2]; - const db$3 = { - clear: clear$2, - addNode, - getMindmap, - nodeType, - getType, - setElementForId, - decorateNode, - type2Str, - getLogger: getLogger$1, - getElementById - }; - const db$4 = db$3; - var cytoscape_umd = { exports: {} }; - (function(module2, exports2) { - (function(global2, factory) { - module2.exports = factory(); - })(commonjsGlobal, function() { - function _typeof(obj) { - "@babel/helpers - typeof"; - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof(obj); - } - function _classCallCheck(instance2, Constructor) { - if (!(instance2 instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i3 = 0; i3 < props.length; i3++) { - var descriptor = props[i3]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; - } - function _defineProperty$1(obj, key, value2) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value2, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value2; - } - return obj; - } - function _slicedToArray(arr, i3) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i3) || _unsupportedIterableToArray(arr, i3) || _nonIterableRest(); - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) - return arr; - } - function _iterableToArrayLimit(arr, i3) { - var _i6 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; - if (_i6 == null) - return; - var _arr = []; - var _n = true; - var _d = false; - var _s, _e; - try { - for (_i6 = _i6.call(arr); !(_n = (_s = _i6.next()).done); _n = true) { - _arr.push(_s.value); - if (i3 && _arr.length === i3) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i6["return"] != null) - _i6["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i3 = 0, arr2 = new Array(len); i3 < len; i3++) - arr2[i3] = arr[i3]; - return arr2; - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var _window = typeof window === "undefined" ? null : window; - var navigator2 = _window ? _window.navigator : null; - _window ? _window.document : null; - var typeofstr = _typeof(""); - var typeofobj = _typeof({}); - var typeoffn = _typeof(function() { - }); - var typeofhtmlele = typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement); - var instanceStr = function instanceStr2(obj) { - return obj && obj.instanceString && fn$6(obj.instanceString) ? obj.instanceString() : null; - }; - var string2 = function string3(obj) { - return obj != null && _typeof(obj) == typeofstr; - }; - var fn$6 = function fn2(obj) { - return obj != null && _typeof(obj) === typeoffn; - }; - var array2 = function array3(obj) { - return !elementOrCollection(obj) && (Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array); - }; - var plainObject = function plainObject2(obj) { - return obj != null && _typeof(obj) === typeofobj && !array2(obj) && obj.constructor === Object; - }; - var object2 = function object3(obj) { - return obj != null && _typeof(obj) === typeofobj; - }; - var number$12 = function number3(obj) { - return obj != null && _typeof(obj) === _typeof(1) && !isNaN(obj); - }; - var integer = function integer2(obj) { - return number$12(obj) && Math.floor(obj) === obj; - }; - var htmlElement = function htmlElement2(obj) { - if ("undefined" === typeofhtmlele) { - return void 0; - } else { - return null != obj && obj instanceof HTMLElement; - } - }; - var elementOrCollection = function elementOrCollection2(obj) { - return element2(obj) || collection(obj); - }; - var element2 = function element3(obj) { - return instanceStr(obj) === "collection" && obj._private.single; - }; - var collection = function collection2(obj) { - return instanceStr(obj) === "collection" && !obj._private.single; - }; - var core2 = function core3(obj) { - return instanceStr(obj) === "core"; - }; - var stylesheet = function stylesheet2(obj) { - return instanceStr(obj) === "stylesheet"; - }; - var event = function event2(obj) { - return instanceStr(obj) === "event"; - }; - var emptyString = function emptyString2(obj) { - if (obj === void 0 || obj === null) { - return true; - } else if (obj === "" || obj.match(/^\s+$/)) { - return true; - } - return false; - }; - var domElement = function domElement2(obj) { - if (typeof HTMLElement === "undefined") { - return false; - } else { - return obj instanceof HTMLElement; - } - }; - var boundingBox = function boundingBox2(obj) { - return plainObject(obj) && number$12(obj.x1) && number$12(obj.x2) && number$12(obj.y1) && number$12(obj.y2); - }; - var promise = function promise2(obj) { - return object2(obj) && fn$6(obj.then); - }; - var ms = function ms2() { - return navigator2 && navigator2.userAgent.match(/msie|trident|edge/i); - }; - var memoize$1 = function memoize3(fn2, keyFn) { - if (!keyFn) { - keyFn = function keyFn2() { - if (arguments.length === 1) { - return arguments[0]; - } else if (arguments.length === 0) { - return "undefined"; - } - var args = []; - for (var i3 = 0; i3 < arguments.length; i3++) { - args.push(arguments[i3]); - } - return args.join("$"); - }; - } - var memoizedFn = function memoizedFn2() { - var self2 = this; - var args = arguments; - var ret; - var k = keyFn.apply(self2, args); - var cache2 = memoizedFn2.cache; - if (!(ret = cache2[k])) { - ret = cache2[k] = fn2.apply(self2, args); - } - return ret; - }; - memoizedFn.cache = {}; - return memoizedFn; - }; - var camel2dash = memoize$1(function(str2) { - return str2.replace(/([A-Z])/g, function(v) { - return "-" + v.toLowerCase(); - }); - }); - var dash2camel = memoize$1(function(str2) { - return str2.replace(/(-\w)/g, function(v) { - return v[1].toUpperCase(); - }); - }); - var prependCamel = memoize$1(function(prefix, str2) { - return prefix + str2[0].toUpperCase() + str2.substring(1); - }, function(prefix, str2) { - return prefix + "$" + str2; - }); - var capitalize = function capitalize2(str2) { - if (emptyString(str2)) { - return str2; - } - return str2.charAt(0).toUpperCase() + str2.substring(1); - }; - var number2 = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))"; - var rgba2 = "rgb[a]?\\((" + number2 + "[%]?)\\s*,\\s*(" + number2 + "[%]?)\\s*,\\s*(" + number2 + "[%]?)(?:\\s*,\\s*(" + number2 + "))?\\)"; - var rgbaNoBackRefs = "rgb[a]?\\((?:" + number2 + "[%]?)\\s*,\\s*(?:" + number2 + "[%]?)\\s*,\\s*(?:" + number2 + "[%]?)(?:\\s*,\\s*(?:" + number2 + "))?\\)"; - var hsla2 = "hsl[a]?\\((" + number2 + ")\\s*,\\s*(" + number2 + "[%])\\s*,\\s*(" + number2 + "[%])(?:\\s*,\\s*(" + number2 + "))?\\)"; - var hslaNoBackRefs = "hsl[a]?\\((?:" + number2 + ")\\s*,\\s*(?:" + number2 + "[%])\\s*,\\s*(?:" + number2 + "[%])(?:\\s*,\\s*(?:" + number2 + "))?\\)"; - var hex3 = "\\#[0-9a-fA-F]{3}"; - var hex6 = "\\#[0-9a-fA-F]{6}"; - var ascending2 = function ascending3(a, b) { - if (a < b) { - return -1; - } else if (a > b) { - return 1; - } else { - return 0; - } - }; - var descending2 = function descending3(a, b) { - return -1 * ascending2(a, b); - }; - var extend2 = Object.assign != null ? Object.assign.bind(Object) : function(tgt) { - var args = arguments; - for (var i3 = 1; i3 < args.length; i3++) { - var obj = args[i3]; - if (obj == null) { - continue; - } - var keys2 = Object.keys(obj); - for (var j = 0; j < keys2.length; j++) { - var k = keys2[j]; - tgt[k] = obj[k]; - } - } - return tgt; - }; - var hex2tuple = function hex2tuple2(hex2) { - if (!(hex2.length === 4 || hex2.length === 7) || hex2[0] !== "#") { - return; - } - var shortHex = hex2.length === 4; - var r, g, b; - var base = 16; - if (shortHex) { - r = parseInt(hex2[1] + hex2[1], base); - g = parseInt(hex2[2] + hex2[2], base); - b = parseInt(hex2[3] + hex2[3], base); - } else { - r = parseInt(hex2[1] + hex2[2], base); - g = parseInt(hex2[3] + hex2[4], base); - b = parseInt(hex2[5] + hex2[6], base); - } - return [r, g, b]; - }; - var hsl2tuple = function hsl2tuple2(hsl2) { - var ret; - var h, s, l, a, r, g, b; - function hue2rgb(p3, q2, t) { - if (t < 0) - t += 1; - if (t > 1) - t -= 1; - if (t < 1 / 6) - return p3 + (q2 - p3) * 6 * t; - if (t < 1 / 2) - return q2; - if (t < 2 / 3) - return p3 + (q2 - p3) * (2 / 3 - t) * 6; - return p3; - } - var m = new RegExp("^" + hsla2 + "$").exec(hsl2); - if (m) { - h = parseInt(m[1]); - if (h < 0) { - h = (360 - -1 * h % 360) % 360; - } else if (h > 360) { - h = h % 360; - } - h /= 360; - s = parseFloat(m[2]); - if (s < 0 || s > 100) { - return; - } - s = s / 100; - l = parseFloat(m[3]); - if (l < 0 || l > 100) { - return; - } - l = l / 100; - a = m[4]; - if (a !== void 0) { - a = parseFloat(a); - if (a < 0 || a > 1) { - return; - } - } - if (s === 0) { - r = g = b = Math.round(l * 255); - } else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p2 = 2 * l - q; - r = Math.round(255 * hue2rgb(p2, q, h + 1 / 3)); - g = Math.round(255 * hue2rgb(p2, q, h)); - b = Math.round(255 * hue2rgb(p2, q, h - 1 / 3)); - } - ret = [r, g, b, a]; - } - return ret; - }; - var rgb2tuple = function rgb2tuple2(rgb2) { - var ret; - var m = new RegExp("^" + rgba2 + "$").exec(rgb2); - if (m) { - ret = []; - var isPct = []; - for (var i3 = 1; i3 <= 3; i3++) { - var channel2 = m[i3]; - if (channel2[channel2.length - 1] === "%") { - isPct[i3] = true; - } - channel2 = parseFloat(channel2); - if (isPct[i3]) { - channel2 = channel2 / 100 * 255; - } - if (channel2 < 0 || channel2 > 255) { - return; - } - ret.push(Math.floor(channel2)); - } - var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; - var allArePct = isPct[1] && isPct[2] && isPct[3]; - if (atLeastOneIsPct && !allArePct) { - return; - } - var alpha = m[4]; - if (alpha !== void 0) { - alpha = parseFloat(alpha); - if (alpha < 0 || alpha > 1) { - return; - } - ret.push(alpha); - } - } - return ret; - }; - var colorname2tuple = function colorname2tuple2(color2) { - return colors2[color2.toLowerCase()]; - }; - var color2tuple = function color2tuple2(color2) { - return (array2(color2) ? color2 : null) || colorname2tuple(color2) || hex2tuple(color2) || rgb2tuple(color2) || hsl2tuple(color2); - }; - var colors2 = { - // special colour names - transparent: [0, 0, 0, 0], - // NB alpha === 0 - // regular colours - aliceblue: [240, 248, 255], - antiquewhite: [250, 235, 215], - aqua: [0, 255, 255], - aquamarine: [127, 255, 212], - azure: [240, 255, 255], - beige: [245, 245, 220], - bisque: [255, 228, 196], - black: [0, 0, 0], - blanchedalmond: [255, 235, 205], - blue: [0, 0, 255], - blueviolet: [138, 43, 226], - brown: [165, 42, 42], - burlywood: [222, 184, 135], - cadetblue: [95, 158, 160], - chartreuse: [127, 255, 0], - chocolate: [210, 105, 30], - coral: [255, 127, 80], - cornflowerblue: [100, 149, 237], - cornsilk: [255, 248, 220], - crimson: [220, 20, 60], - cyan: [0, 255, 255], - darkblue: [0, 0, 139], - darkcyan: [0, 139, 139], - darkgoldenrod: [184, 134, 11], - darkgray: [169, 169, 169], - darkgreen: [0, 100, 0], - darkgrey: [169, 169, 169], - darkkhaki: [189, 183, 107], - darkmagenta: [139, 0, 139], - darkolivegreen: [85, 107, 47], - darkorange: [255, 140, 0], - darkorchid: [153, 50, 204], - darkred: [139, 0, 0], - darksalmon: [233, 150, 122], - darkseagreen: [143, 188, 143], - darkslateblue: [72, 61, 139], - darkslategray: [47, 79, 79], - darkslategrey: [47, 79, 79], - darkturquoise: [0, 206, 209], - darkviolet: [148, 0, 211], - deeppink: [255, 20, 147], - deepskyblue: [0, 191, 255], - dimgray: [105, 105, 105], - dimgrey: [105, 105, 105], - dodgerblue: [30, 144, 255], - firebrick: [178, 34, 34], - floralwhite: [255, 250, 240], - forestgreen: [34, 139, 34], - fuchsia: [255, 0, 255], - gainsboro: [220, 220, 220], - ghostwhite: [248, 248, 255], - gold: [255, 215, 0], - goldenrod: [218, 165, 32], - gray: [128, 128, 128], - grey: [128, 128, 128], - green: [0, 128, 0], - greenyellow: [173, 255, 47], - honeydew: [240, 255, 240], - hotpink: [255, 105, 180], - indianred: [205, 92, 92], - indigo: [75, 0, 130], - ivory: [255, 255, 240], - khaki: [240, 230, 140], - lavender: [230, 230, 250], - lavenderblush: [255, 240, 245], - lawngreen: [124, 252, 0], - lemonchiffon: [255, 250, 205], - lightblue: [173, 216, 230], - lightcoral: [240, 128, 128], - lightcyan: [224, 255, 255], - lightgoldenrodyellow: [250, 250, 210], - lightgray: [211, 211, 211], - lightgreen: [144, 238, 144], - lightgrey: [211, 211, 211], - lightpink: [255, 182, 193], - lightsalmon: [255, 160, 122], - lightseagreen: [32, 178, 170], - lightskyblue: [135, 206, 250], - lightslategray: [119, 136, 153], - lightslategrey: [119, 136, 153], - lightsteelblue: [176, 196, 222], - lightyellow: [255, 255, 224], - lime: [0, 255, 0], - limegreen: [50, 205, 50], - linen: [250, 240, 230], - magenta: [255, 0, 255], - maroon: [128, 0, 0], - mediumaquamarine: [102, 205, 170], - mediumblue: [0, 0, 205], - mediumorchid: [186, 85, 211], - mediumpurple: [147, 112, 219], - mediumseagreen: [60, 179, 113], - mediumslateblue: [123, 104, 238], - mediumspringgreen: [0, 250, 154], - mediumturquoise: [72, 209, 204], - mediumvioletred: [199, 21, 133], - midnightblue: [25, 25, 112], - mintcream: [245, 255, 250], - mistyrose: [255, 228, 225], - moccasin: [255, 228, 181], - navajowhite: [255, 222, 173], - navy: [0, 0, 128], - oldlace: [253, 245, 230], - olive: [128, 128, 0], - olivedrab: [107, 142, 35], - orange: [255, 165, 0], - orangered: [255, 69, 0], - orchid: [218, 112, 214], - palegoldenrod: [238, 232, 170], - palegreen: [152, 251, 152], - paleturquoise: [175, 238, 238], - palevioletred: [219, 112, 147], - papayawhip: [255, 239, 213], - peachpuff: [255, 218, 185], - peru: [205, 133, 63], - pink: [255, 192, 203], - plum: [221, 160, 221], - powderblue: [176, 224, 230], - purple: [128, 0, 128], - red: [255, 0, 0], - rosybrown: [188, 143, 143], - royalblue: [65, 105, 225], - saddlebrown: [139, 69, 19], - salmon: [250, 128, 114], - sandybrown: [244, 164, 96], - seagreen: [46, 139, 87], - seashell: [255, 245, 238], - sienna: [160, 82, 45], - silver: [192, 192, 192], - skyblue: [135, 206, 235], - slateblue: [106, 90, 205], - slategray: [112, 128, 144], - slategrey: [112, 128, 144], - snow: [255, 250, 250], - springgreen: [0, 255, 127], - steelblue: [70, 130, 180], - tan: [210, 180, 140], - teal: [0, 128, 128], - thistle: [216, 191, 216], - tomato: [255, 99, 71], - turquoise: [64, 224, 208], - violet: [238, 130, 238], - wheat: [245, 222, 179], - white: [255, 255, 255], - whitesmoke: [245, 245, 245], - yellow: [255, 255, 0], - yellowgreen: [154, 205, 50] - }; - var setMap = function setMap2(options2) { - var obj = options2.map; - var keys2 = options2.keys; - var l = keys2.length; - for (var i3 = 0; i3 < l; i3++) { - var key = keys2[i3]; - if (plainObject(key)) { - throw Error("Tried to set map with object key"); - } - if (i3 < keys2.length - 1) { - if (obj[key] == null) { - obj[key] = {}; - } - obj = obj[key]; - } else { - obj[key] = options2.value; - } - } - }; - var getMap = function getMap2(options2) { - var obj = options2.map; - var keys2 = options2.keys; - var l = keys2.length; - for (var i3 = 0; i3 < l; i3++) { - var key = keys2[i3]; - if (plainObject(key)) { - throw Error("Tried to get map with object key"); - } - obj = obj[key]; - if (obj == null) { - return obj; - } - } - return obj; - }; - function isObject2(value2) { - var type2 = typeof value2; - return value2 != null && (type2 == "object" || type2 == "function"); - } - var isObject_12 = isObject2; - var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : {}; - function createCommonjsModule(fn2, module3) { - return module3 = { exports: {} }, fn2(module3, module3.exports), module3.exports; - } - var freeGlobal2 = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1; - var _freeGlobal = freeGlobal2; - var freeSelf2 = typeof self == "object" && self && self.Object === Object && self; - var root2 = _freeGlobal || freeSelf2 || Function("return this")(); - var _root = root2; - var now2 = function() { - return _root.Date.now(); - }; - var now_1 = now2; - var reWhitespace2 = /\s/; - function trimmedEndIndex2(string3) { - var index2 = string3.length; - while (index2-- && reWhitespace2.test(string3.charAt(index2))) { - } - return index2; - } - var _trimmedEndIndex = trimmedEndIndex2; - var reTrimStart2 = /^\s+/; - function baseTrim2(string3) { - return string3 ? string3.slice(0, _trimmedEndIndex(string3) + 1).replace(reTrimStart2, "") : string3; - } - var _baseTrim = baseTrim2; - var Symbol$12 = _root.Symbol; - var _Symbol = Symbol$12; - var objectProto$52 = Object.prototype; - var hasOwnProperty$42 = objectProto$52.hasOwnProperty; - var nativeObjectToString$12 = objectProto$52.toString; - var symToStringTag$12 = _Symbol ? _Symbol.toStringTag : void 0; - function getRawTag2(value2) { - var isOwn = hasOwnProperty$42.call(value2, symToStringTag$12), tag = value2[symToStringTag$12]; - try { - value2[symToStringTag$12] = void 0; - var unmasked = true; - } catch (e) { - } - var result = nativeObjectToString$12.call(value2); - if (unmasked) { - if (isOwn) { - value2[symToStringTag$12] = tag; - } else { - delete value2[symToStringTag$12]; - } - } - return result; - } - var _getRawTag = getRawTag2; - var objectProto$42 = Object.prototype; - var nativeObjectToString2 = objectProto$42.toString; - function objectToString2(value2) { - return nativeObjectToString2.call(value2); - } - var _objectToString = objectToString2; - var nullTag2 = "[object Null]", undefinedTag2 = "[object Undefined]"; - var symToStringTag2 = _Symbol ? _Symbol.toStringTag : void 0; - function baseGetTag2(value2) { - if (value2 == null) { - return value2 === void 0 ? undefinedTag2 : nullTag2; - } - return symToStringTag2 && symToStringTag2 in Object(value2) ? _getRawTag(value2) : _objectToString(value2); - } - var _baseGetTag = baseGetTag2; - function isObjectLike2(value2) { - return value2 != null && typeof value2 == "object"; - } - var isObjectLike_1 = isObjectLike2; - var symbolTag2 = "[object Symbol]"; - function isSymbol2(value2) { - return typeof value2 == "symbol" || isObjectLike_1(value2) && _baseGetTag(value2) == symbolTag2; - } - var isSymbol_1 = isSymbol2; - var NAN2 = 0 / 0; - var reIsBadHex2 = /^[-+]0x[0-9a-f]+$/i; - var reIsBinary2 = /^0b[01]+$/i; - var reIsOctal2 = /^0o[0-7]+$/i; - var freeParseInt2 = parseInt; - function toNumber2(value2) { - if (typeof value2 == "number") { - return value2; - } - if (isSymbol_1(value2)) { - return NAN2; - } - if (isObject_12(value2)) { - var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2; - value2 = isObject_12(other) ? other + "" : other; - } - if (typeof value2 != "string") { - return value2 === 0 ? value2 : +value2; - } - value2 = _baseTrim(value2); - var isBinary2 = reIsBinary2.test(value2); - return isBinary2 || reIsOctal2.test(value2) ? freeParseInt2(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex2.test(value2) ? NAN2 : +value2; - } - var toNumber_1 = toNumber2; - var FUNC_ERROR_TEXT$1 = "Expected a function"; - var nativeMax2 = Math.max, nativeMin = Math.min; - function debounce(func, wait, options2) { - var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT$1); - } - wait = toNumber_1(wait) || 0; - if (isObject_12(options2)) { - leading = !!options2.leading; - maxing = "maxWait" in options2; - maxWait = maxing ? nativeMax2(toNumber_1(options2.maxWait) || 0, wait) : maxWait; - trailing = "trailing" in options2 ? !!options2.trailing : trailing; - } - function invokeFunc(time2) { - var args = lastArgs, thisArg = lastThis; - lastArgs = lastThis = void 0; - lastInvokeTime = time2; - result = func.apply(thisArg, args); - return result; - } - function leadingEdge(time2) { - lastInvokeTime = time2; - timerId = setTimeout(timerExpired, wait); - return leading ? invokeFunc(time2) : result; - } - function remainingWait(time2) { - var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; - return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; - } - function shouldInvoke(time2) { - var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime; - return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; - } - function timerExpired() { - var time2 = now_1(); - if (shouldInvoke(time2)) { - return trailingEdge(time2); - } - timerId = setTimeout(timerExpired, remainingWait(time2)); - } - function trailingEdge(time2) { - timerId = void 0; - if (trailing && lastArgs) { - return invokeFunc(time2); - } - lastArgs = lastThis = void 0; - return result; - } - function cancel() { - if (timerId !== void 0) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = void 0; - } - function flush() { - return timerId === void 0 ? result : trailingEdge(now_1()); - } - function debounced() { - var time2 = now_1(), isInvoking = shouldInvoke(time2); - lastArgs = arguments; - lastThis = this; - lastCallTime = time2; - if (isInvoking) { - if (timerId === void 0) { - return leadingEdge(lastCallTime); - } - if (maxing) { - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === void 0) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - var debounce_1 = debounce; - var performance2 = _window ? _window.performance : null; - var pnow = performance2 && performance2.now ? function() { - return performance2.now(); - } : function() { - return Date.now(); - }; - var raf = function() { - if (_window) { - if (_window.requestAnimationFrame) { - return function(fn2) { - _window.requestAnimationFrame(fn2); - }; - } else if (_window.mozRequestAnimationFrame) { - return function(fn2) { - _window.mozRequestAnimationFrame(fn2); - }; - } else if (_window.webkitRequestAnimationFrame) { - return function(fn2) { - _window.webkitRequestAnimationFrame(fn2); - }; - } else if (_window.msRequestAnimationFrame) { - return function(fn2) { - _window.msRequestAnimationFrame(fn2); - }; - } - } - return function(fn2) { - if (fn2) { - setTimeout(function() { - fn2(pnow()); - }, 1e3 / 60); - } - }; - }(); - var requestAnimationFrame2 = function requestAnimationFrame3(fn2) { - return raf(fn2); - }; - var performanceNow = pnow; - var DEFAULT_HASH_SEED = 9261; - var K2 = 65599; - var DEFAULT_HASH_SEED_ALT = 5381; - var hashIterableInts = function hashIterableInts2(iterator) { - var seed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_HASH_SEED; - var hash = seed; - var entry; - for (; ; ) { - entry = iterator.next(); - if (entry.done) { - break; - } - hash = hash * K2 + entry.value | 0; - } - return hash; - }; - var hashInt = function hashInt2(num) { - var seed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_HASH_SEED; - return seed * K2 + num | 0; - }; - var hashIntAlt = function hashIntAlt2(num) { - var seed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_HASH_SEED_ALT; - return (seed << 5) + seed + num | 0; - }; - var combineHashes = function combineHashes2(hash1, hash2) { - return hash1 * 2097152 + hash2; - }; - var combineHashesArray = function combineHashesArray2(hashes) { - return hashes[0] * 2097152 + hashes[1]; - }; - var hashArrays = function hashArrays2(hashes1, hashes2) { - return [hashInt(hashes1[0], hashes2[0]), hashIntAlt(hashes1[1], hashes2[1])]; - }; - var hashIntsArray = function hashIntsArray2(ints, seed) { - var entry = { - value: 0, - done: false - }; - var i3 = 0; - var length2 = ints.length; - var iterator = { - next: function next2() { - if (i3 < length2) { - entry.value = ints[i3++]; - } else { - entry.done = true; - } - return entry; - } - }; - return hashIterableInts(iterator, seed); - }; - var hashString = function hashString2(str2, seed) { - var entry = { - value: 0, - done: false - }; - var i3 = 0; - var length2 = str2.length; - var iterator = { - next: function next2() { - if (i3 < length2) { - entry.value = str2.charCodeAt(i3++); - } else { - entry.done = true; - } - return entry; - } - }; - return hashIterableInts(iterator, seed); - }; - var hashStrings = function hashStrings2() { - return hashStringsArray(arguments); - }; - var hashStringsArray = function hashStringsArray2(strs) { - var hash; - for (var i3 = 0; i3 < strs.length; i3++) { - var str2 = strs[i3]; - if (i3 === 0) { - hash = hashString(str2); - } else { - hash = hashString(str2, hash); - } - } - return hash; - }; - var warningsEnabled = true; - var warnSupported = console.warn != null; - var traceSupported = console.trace != null; - var MAX_INT$1 = Number.MAX_SAFE_INTEGER || 9007199254740991; - var trueify = function trueify2() { - return true; - }; - var falsify = function falsify2() { - return false; - }; - var zeroify = function zeroify2() { - return 0; - }; - var noop$12 = function noop3() { - }; - var error = function error2(msg) { - throw new Error(msg); - }; - var warnings = function warnings2(enabled) { - if (enabled !== void 0) { - warningsEnabled = !!enabled; - } else { - return warningsEnabled; - } - }; - var warn = function warn2(msg) { - if (!warnings()) { - return; - } - if (warnSupported) { - console.warn(msg); - } else { - console.log(msg); - if (traceSupported) { - console.trace(); - } - } - }; - var clone2 = function clone3(obj) { - return extend2({}, obj); - }; - var copy2 = function copy3(obj) { - if (obj == null) { - return obj; - } - if (array2(obj)) { - return obj.slice(); - } else if (plainObject(obj)) { - return clone2(obj); - } else { - return obj; - } - }; - var copyArray$1 = function copyArray3(arr) { - return arr.slice(); - }; - var uuid = function uuid2(a, b) { - for ( - // loop :) - b = a = ""; - // b - result , a - numeric letiable - a++ < 36; - // - b += a * 51 & 52 ? ( - // return a random number or 4 - (a ^ 15 ? ( - // generate a random number from 0 to 15 - 8 ^ Math.random() * (a ^ 20 ? 16 : 4) - ) : 4).toString(16) - ) : "-" - ) { - } - return b; - }; - var _staticEmptyObject = {}; - var staticEmptyObject = function staticEmptyObject2() { - return _staticEmptyObject; - }; - var defaults$g = function defaults3(_defaults) { - var keys2 = Object.keys(_defaults); - return function(opts) { - var filledOpts = {}; - for (var i3 = 0; i3 < keys2.length; i3++) { - var key = keys2[i3]; - var optVal = opts == null ? void 0 : opts[key]; - filledOpts[key] = optVal === void 0 ? _defaults[key] : optVal; - } - return filledOpts; - }; - }; - var removeFromArray = function removeFromArray2(arr, ele, oneCopy) { - for (var i3 = arr.length - 1; i3 >= 0; i3--) { - if (arr[i3] === ele) { - arr.splice(i3, 1); - if (oneCopy) { - break; - } - } - } - }; - var clearArray = function clearArray2(arr) { - arr.splice(0, arr.length); - }; - var push2 = function push3(arr, otherArr) { - for (var i3 = 0; i3 < otherArr.length; i3++) { - var el = otherArr[i3]; - arr.push(el); - } - }; - var getPrefixedProperty = function getPrefixedProperty2(obj, propName, prefix) { - if (prefix) { - propName = prependCamel(prefix, propName); - } - return obj[propName]; - }; - var setPrefixedProperty = function setPrefixedProperty2(obj, propName, prefix, value2) { - if (prefix) { - propName = prependCamel(prefix, propName); - } - obj[propName] = value2; - }; - var ObjectMap = /* @__PURE__ */ function() { - function ObjectMap2() { - _classCallCheck(this, ObjectMap2); - this._obj = {}; - } - _createClass(ObjectMap2, [{ - key: "set", - value: function set3(key, val) { - this._obj[key] = val; - return this; - } - }, { - key: "delete", - value: function _delete(key) { - this._obj[key] = void 0; - return this; - } - }, { - key: "clear", - value: function clear2() { - this._obj = {}; - } - }, { - key: "has", - value: function has2(key) { - return this._obj[key] !== void 0; - } - }, { - key: "get", - value: function get3(key) { - return this._obj[key]; - } - }]); - return ObjectMap2; - }(); - var Map$22 = typeof Map !== "undefined" ? Map : ObjectMap; - var undef = "undefined"; - var ObjectSet = /* @__PURE__ */ function() { - function ObjectSet2(arrayOrObjectSet) { - _classCallCheck(this, ObjectSet2); - this._obj = /* @__PURE__ */ Object.create(null); - this.size = 0; - if (arrayOrObjectSet != null) { - var arr; - if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) { - arr = arrayOrObjectSet.toArray(); - } else { - arr = arrayOrObjectSet; - } - for (var i3 = 0; i3 < arr.length; i3++) { - this.add(arr[i3]); - } - } - } - _createClass(ObjectSet2, [{ - key: "instanceString", - value: function instanceString() { - return "set"; - } - }, { - key: "add", - value: function add(val) { - var o = this._obj; - if (o[val] !== 1) { - o[val] = 1; - this.size++; - } - } - }, { - key: "delete", - value: function _delete(val) { - var o = this._obj; - if (o[val] === 1) { - o[val] = 0; - this.size--; - } - } - }, { - key: "clear", - value: function clear2() { - this._obj = /* @__PURE__ */ Object.create(null); - } - }, { - key: "has", - value: function has2(val) { - return this._obj[val] === 1; - } - }, { - key: "toArray", - value: function toArray2() { - var _this = this; - return Object.keys(this._obj).filter(function(key) { - return _this.has(key); - }); - } - }, { - key: "forEach", - value: function forEach2(callback, thisArg) { - return this.toArray().forEach(callback, thisArg); - } - }]); - return ObjectSet2; - }(); - var Set$12 = (typeof Set === "undefined" ? "undefined" : _typeof(Set)) !== undef ? Set : ObjectSet; - var Element = function Element2(cy, params) { - var restore = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; - if (cy === void 0 || params === void 0 || !core2(cy)) { - error("An element must have a core reference and parameters set"); - return; - } - var group = params.group; - if (group == null) { - if (params.data && params.data.source != null && params.data.target != null) { - group = "edges"; - } else { - group = "nodes"; - } - } - if (group !== "nodes" && group !== "edges") { - error("An element must be of type `nodes` or `edges`; you specified `" + group + "`"); - return; - } - this.length = 1; - this[0] = this; - var _p = this._private = { - cy, - single: true, - // indicates this is an element - data: params.data || {}, - // data object - position: params.position || { - x: 0, - y: 0 - }, - // (x, y) position pair - autoWidth: void 0, - // width and height of nodes calculated by the renderer when set to special 'auto' value - autoHeight: void 0, - autoPadding: void 0, - compoundBoundsClean: false, - // whether the compound dimensions need to be recalculated the next time dimensions are read - listeners: [], - // array of bound listeners - group, - // string; 'nodes' or 'edges' - style: {}, - // properties as set by the style - rstyle: {}, - // properties for style sent from the renderer to the core - styleCxts: [], - // applied style contexts from the styler - styleKeys: {}, - // per-group keys of style property values - removed: true, - // whether it's inside the vis; true if removed (set true here since we call restore) - selected: params.selected ? true : false, - // whether it's selected - selectable: params.selectable === void 0 ? true : params.selectable ? true : false, - // whether it's selectable - locked: params.locked ? true : false, - // whether the element is locked (cannot be moved) - grabbed: false, - // whether the element is grabbed by the mouse; renderer sets this privately - grabbable: params.grabbable === void 0 ? true : params.grabbable ? true : false, - // whether the element can be grabbed - pannable: params.pannable === void 0 ? group === "edges" ? true : false : params.pannable ? true : false, - // whether the element has passthrough panning enabled - active: false, - // whether the element is active from user interaction - classes: new Set$12(), - // map ( className => true ) - animation: { - // object for currently-running animations - current: [], - queue: [] - }, - rscratch: {}, - // object in which the renderer can store information - scratch: params.scratch || {}, - // scratch objects - edges: [], - // array of connected edges - children: [], - // array of children - parent: params.parent && params.parent.isNode() ? params.parent : null, - // parent ref - traversalCache: {}, - // cache of output of traversal functions - backgrounding: false, - // whether background images are loading - bbCache: null, - // cache of the current bounding box - bbCacheShift: { - x: 0, - y: 0 - }, - // shift applied to cached bb to be applied on next get - bodyBounds: null, - // bounds cache of element body, w/o overlay - overlayBounds: null, - // bounds cache of element body, including overlay - labelBounds: { - // bounds cache of labels - all: null, - source: null, - target: null, - main: null - }, - arrowBounds: { - // bounds cache of edge arrows - source: null, - target: null, - "mid-source": null, - "mid-target": null - } - }; - if (_p.position.x == null) { - _p.position.x = 0; - } - if (_p.position.y == null) { - _p.position.y = 0; - } - if (params.renderedPosition) { - var rpos = params.renderedPosition; - var pan = cy.pan(); - var zoom = cy.zoom(); - _p.position = { - x: (rpos.x - pan.x) / zoom, - y: (rpos.y - pan.y) / zoom - }; - } - var classes2 = []; - if (array2(params.classes)) { - classes2 = params.classes; - } else if (string2(params.classes)) { - classes2 = params.classes.split(/\s+/); - } - for (var i3 = 0, l = classes2.length; i3 < l; i3++) { - var cls = classes2[i3]; - if (!cls || cls === "") { - continue; - } - _p.classes.add(cls); - } - this.createEmitter(); - var bypass = params.style || params.css; - if (bypass) { - warn("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."); - this.style(bypass); - } - if (restore === void 0 || restore) { - this.restore(); - } - }; - var defineSearch = function defineSearch2(params) { - params = { - bfs: params.bfs || !params.dfs, - dfs: params.dfs || !params.bfs - }; - return function searchFn(roots, fn2, directed) { - var options2; - if (plainObject(roots) && !elementOrCollection(roots)) { - options2 = roots; - roots = options2.roots || options2.root; - fn2 = options2.visit; - directed = options2.directed; - } - directed = arguments.length === 2 && !fn$6(fn2) ? fn2 : directed; - fn2 = fn$6(fn2) ? fn2 : function() { - }; - var cy = this._private.cy; - var v = roots = string2(roots) ? this.filter(roots) : roots; - var Q = []; - var connectedNodes = []; - var connectedBy = {}; - var id2depth = {}; - var V = {}; - var j = 0; - var found; - var _this$byGroup = this.byGroup(), nodes2 = _this$byGroup.nodes, edges2 = _this$byGroup.edges; - for (var i3 = 0; i3 < v.length; i3++) { - var vi = v[i3]; - var viId = vi.id(); - if (vi.isNode()) { - Q.unshift(vi); - if (params.bfs) { - V[viId] = true; - connectedNodes.push(vi); - } - id2depth[viId] = 0; - } - } - var _loop = function _loop2() { - var v2 = params.bfs ? Q.shift() : Q.pop(); - var vId = v2.id(); - if (params.dfs) { - if (V[vId]) { - return "continue"; - } - V[vId] = true; - connectedNodes.push(v2); - } - var depth = id2depth[vId]; - var prevEdge = connectedBy[vId]; - var src = prevEdge != null ? prevEdge.source() : null; - var tgt = prevEdge != null ? prevEdge.target() : null; - var prevNode = prevEdge == null ? void 0 : v2.same(src) ? tgt[0] : src[0]; - var ret = void 0; - ret = fn2(v2, prevEdge, prevNode, j++, depth); - if (ret === true) { - found = v2; - return "break"; - } - if (ret === false) { - return "break"; - } - var vwEdges = v2.connectedEdges().filter(function(e3) { - return (!directed || e3.source().same(v2)) && edges2.has(e3); - }); - for (var _i22 = 0; _i22 < vwEdges.length; _i22++) { - var e = vwEdges[_i22]; - var w2 = e.connectedNodes().filter(function(n) { - return !n.same(v2) && nodes2.has(n); - }); - var wId = w2.id(); - if (w2.length !== 0 && !V[wId]) { - w2 = w2[0]; - Q.push(w2); - if (params.bfs) { - V[wId] = true; - connectedNodes.push(w2); - } - connectedBy[wId] = e; - id2depth[wId] = id2depth[vId] + 1; - } - } - }; - while (Q.length !== 0) { - var _ret = _loop(); - if (_ret === "continue") - continue; - if (_ret === "break") - break; - } - var connectedEles = cy.collection(); - for (var _i6 = 0; _i6 < connectedNodes.length; _i6++) { - var node2 = connectedNodes[_i6]; - var edge = connectedBy[node2.id()]; - if (edge != null) { - connectedEles.push(edge); - } - connectedEles.push(node2); - } - return { - path: cy.collection(connectedEles), - found: cy.collection(found) - }; - }; - }; - var elesfn$v = { - breadthFirstSearch: defineSearch({ - bfs: true - }), - depthFirstSearch: defineSearch({ - dfs: true - }) - }; - elesfn$v.bfs = elesfn$v.breadthFirstSearch; - elesfn$v.dfs = elesfn$v.depthFirstSearch; - var heap$1 = createCommonjsModule(function(module3, exports3) { - (function() { - var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min3, nlargest, nsmallest, updateItem, _siftdown, _siftup; - floor = Math.floor, min3 = Math.min; - defaultCmp = function(x2, y2) { - if (x2 < y2) { - return -1; - } - if (x2 > y2) { - return 1; - } - return 0; - }; - insort = function(a, x2, lo, hi, cmp) { - var mid; - if (lo == null) { - lo = 0; - } - if (cmp == null) { - cmp = defaultCmp; - } - if (lo < 0) { - throw new Error("lo must be non-negative"); - } - if (hi == null) { - hi = a.length; - } - while (lo < hi) { - mid = floor((lo + hi) / 2); - if (cmp(x2, a[mid]) < 0) { - hi = mid; - } else { - lo = mid + 1; - } - } - return [].splice.apply(a, [lo, lo - lo].concat(x2)), x2; - }; - heappush = function(array3, item, cmp) { - if (cmp == null) { - cmp = defaultCmp; - } - array3.push(item); - return _siftdown(array3, 0, array3.length - 1, cmp); - }; - heappop = function(array3, cmp) { - var lastelt, returnitem; - if (cmp == null) { - cmp = defaultCmp; - } - lastelt = array3.pop(); - if (array3.length) { - returnitem = array3[0]; - array3[0] = lastelt; - _siftup(array3, 0, cmp); - } else { - returnitem = lastelt; - } - return returnitem; - }; - heapreplace = function(array3, item, cmp) { - var returnitem; - if (cmp == null) { - cmp = defaultCmp; - } - returnitem = array3[0]; - array3[0] = item; - _siftup(array3, 0, cmp); - return returnitem; - }; - heappushpop = function(array3, item, cmp) { - var _ref; - if (cmp == null) { - cmp = defaultCmp; - } - if (array3.length && cmp(array3[0], item) < 0) { - _ref = [array3[0], item], item = _ref[0], array3[0] = _ref[1]; - _siftup(array3, 0, cmp); - } - return item; - }; - heapify = function(array3, cmp) { - var i3, _i6, _len, _ref1, _results, _results1; - if (cmp == null) { - cmp = defaultCmp; - } - _ref1 = (function() { - _results1 = []; - for (var _j = 0, _ref = floor(array3.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--) { - _results1.push(_j); - } - return _results1; - }).apply(this).reverse(); - _results = []; - for (_i6 = 0, _len = _ref1.length; _i6 < _len; _i6++) { - i3 = _ref1[_i6]; - _results.push(_siftup(array3, i3, cmp)); - } - return _results; - }; - updateItem = function(array3, item, cmp) { - var pos; - if (cmp == null) { - cmp = defaultCmp; - } - pos = array3.indexOf(item); - if (pos === -1) { - return; - } - _siftdown(array3, 0, pos, cmp); - return _siftup(array3, pos, cmp); - }; - nlargest = function(array3, n, cmp) { - var elem, result, _i6, _len, _ref; - if (cmp == null) { - cmp = defaultCmp; - } - result = array3.slice(0, n); - if (!result.length) { - return result; - } - heapify(result, cmp); - _ref = array3.slice(n); - for (_i6 = 0, _len = _ref.length; _i6 < _len; _i6++) { - elem = _ref[_i6]; - heappushpop(result, elem, cmp); - } - return result.sort(cmp).reverse(); - }; - nsmallest = function(array3, n, cmp) { - var elem, los, result, _i6, _j, _len, _ref, _ref1, _results; - if (cmp == null) { - cmp = defaultCmp; - } - if (n * 10 <= array3.length) { - result = array3.slice(0, n).sort(cmp); - if (!result.length) { - return result; - } - los = result[result.length - 1]; - _ref = array3.slice(n); - for (_i6 = 0, _len = _ref.length; _i6 < _len; _i6++) { - elem = _ref[_i6]; - if (cmp(elem, los) < 0) { - insort(result, elem, 0, null, cmp); - result.pop(); - los = result[result.length - 1]; - } - } - return result; - } - heapify(array3, cmp); - _results = []; - for (_j = 0, _ref1 = min3(n, array3.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; 0 <= _ref1 ? ++_j : --_j) { - _results.push(heappop(array3, cmp)); - } - return _results; - }; - _siftdown = function(array3, startpos, pos, cmp) { - var newitem, parent, parentpos; - if (cmp == null) { - cmp = defaultCmp; - } - newitem = array3[pos]; - while (pos > startpos) { - parentpos = pos - 1 >> 1; - parent = array3[parentpos]; - if (cmp(newitem, parent) < 0) { - array3[pos] = parent; - pos = parentpos; - continue; - } - break; - } - return array3[pos] = newitem; - }; - _siftup = function(array3, pos, cmp) { - var childpos, endpos, newitem, rightpos, startpos; - if (cmp == null) { - cmp = defaultCmp; - } - endpos = array3.length; - startpos = pos; - newitem = array3[pos]; - childpos = 2 * pos + 1; - while (childpos < endpos) { - rightpos = childpos + 1; - if (rightpos < endpos && !(cmp(array3[childpos], array3[rightpos]) < 0)) { - childpos = rightpos; - } - array3[pos] = array3[childpos]; - pos = childpos; - childpos = 2 * pos + 1; - } - array3[pos] = newitem; - return _siftdown(array3, startpos, pos, cmp); - }; - Heap = function() { - Heap2.push = heappush; - Heap2.pop = heappop; - Heap2.replace = heapreplace; - Heap2.pushpop = heappushpop; - Heap2.heapify = heapify; - Heap2.updateItem = updateItem; - Heap2.nlargest = nlargest; - Heap2.nsmallest = nsmallest; - function Heap2(cmp) { - this.cmp = cmp != null ? cmp : defaultCmp; - this.nodes = []; - } - Heap2.prototype.push = function(x2) { - return heappush(this.nodes, x2, this.cmp); - }; - Heap2.prototype.pop = function() { - return heappop(this.nodes, this.cmp); - }; - Heap2.prototype.peek = function() { - return this.nodes[0]; - }; - Heap2.prototype.contains = function(x2) { - return this.nodes.indexOf(x2) !== -1; - }; - Heap2.prototype.replace = function(x2) { - return heapreplace(this.nodes, x2, this.cmp); - }; - Heap2.prototype.pushpop = function(x2) { - return heappushpop(this.nodes, x2, this.cmp); - }; - Heap2.prototype.heapify = function() { - return heapify(this.nodes, this.cmp); - }; - Heap2.prototype.updateItem = function(x2) { - return updateItem(this.nodes, x2, this.cmp); - }; - Heap2.prototype.clear = function() { - return this.nodes = []; - }; - Heap2.prototype.empty = function() { - return this.nodes.length === 0; - }; - Heap2.prototype.size = function() { - return this.nodes.length; - }; - Heap2.prototype.clone = function() { - var heap2; - heap2 = new Heap2(); - heap2.nodes = this.nodes.slice(0); - return heap2; - }; - Heap2.prototype.toArray = function() { - return this.nodes.slice(0); - }; - Heap2.prototype.insert = Heap2.prototype.push; - Heap2.prototype.top = Heap2.prototype.peek; - Heap2.prototype.front = Heap2.prototype.peek; - Heap2.prototype.has = Heap2.prototype.contains; - Heap2.prototype.copy = Heap2.prototype.clone; - return Heap2; - }(); - (function(root3, factory) { - { - return module3.exports = factory(); - } - })(this, function() { - return Heap; - }); - }).call(commonjsGlobal$1); - }); - var heap = heap$1; - var dijkstraDefaults = defaults$g({ - root: null, - weight: function weight(edge) { - return 1; - }, - directed: false - }); - var elesfn$u = { - dijkstra: function dijkstra(options2) { - if (!plainObject(options2)) { - var args = arguments; - options2 = { - root: args[0], - weight: args[1], - directed: args[2] - }; - } - var _dijkstraDefaults = dijkstraDefaults(options2), root3 = _dijkstraDefaults.root, weight = _dijkstraDefaults.weight, directed = _dijkstraDefaults.directed; - var eles = this; - var weightFn = weight; - var source = string2(root3) ? this.filter(root3)[0] : root3[0]; - var dist3 = {}; - var prev2 = {}; - var knownDist = {}; - var _this$byGroup = this.byGroup(), nodes2 = _this$byGroup.nodes, edges2 = _this$byGroup.edges; - edges2.unmergeBy(function(ele) { - return ele.isLoop(); - }); - var getDist2 = function getDist3(node3) { - return dist3[node3.id()]; - }; - var setDist = function setDist2(node3, d) { - dist3[node3.id()] = d; - Q.updateItem(node3); - }; - var Q = new heap(function(a, b) { - return getDist2(a) - getDist2(b); - }); - for (var i3 = 0; i3 < nodes2.length; i3++) { - var node2 = nodes2[i3]; - dist3[node2.id()] = node2.same(source) ? 0 : Infinity; - Q.push(node2); - } - var distBetween = function distBetween2(u2, v2) { - var uvs = (directed ? u2.edgesTo(v2) : u2.edgesWith(v2)).intersect(edges2); - var smallestDistance = Infinity; - var smallestEdge; - for (var _i6 = 0; _i6 < uvs.length; _i6++) { - var edge = uvs[_i6]; - var _weight = weightFn(edge); - if (_weight < smallestDistance || !smallestEdge) { - smallestDistance = _weight; - smallestEdge = edge; - } - } - return { - edge: smallestEdge, - dist: smallestDistance - }; - }; - while (Q.size() > 0) { - var u = Q.pop(); - var smalletsDist = getDist2(u); - var uid = u.id(); - knownDist[uid] = smalletsDist; - if (smalletsDist === Infinity) { - continue; - } - var neighbors = u.neighborhood().intersect(nodes2); - for (var _i22 = 0; _i22 < neighbors.length; _i22++) { - var v = neighbors[_i22]; - var vid = v.id(); - var vDist = distBetween(u, v); - var alt = smalletsDist + vDist.dist; - if (alt < getDist2(v)) { - setDist(v, alt); - prev2[vid] = { - node: u, - edge: vDist.edge - }; - } - } - } - return { - distanceTo: function distanceTo(node3) { - var target = string2(node3) ? nodes2.filter(node3)[0] : node3[0]; - return knownDist[target.id()]; - }, - pathTo: function pathTo(node3) { - var target = string2(node3) ? nodes2.filter(node3)[0] : node3[0]; - var S2 = []; - var u2 = target; - var uid2 = u2.id(); - if (target.length > 0) { - S2.unshift(target); - while (prev2[uid2]) { - var p2 = prev2[uid2]; - S2.unshift(p2.edge); - S2.unshift(p2.node); - u2 = p2.node; - uid2 = u2.id(); - } - } - return eles.spawn(S2); - } - }; - } - }; - var elesfn$t = { - // kruskal's algorithm (finds min spanning tree, assuming undirected graph) - // implemented from pseudocode from wikipedia - kruskal: function kruskal(weightFn) { - weightFn = weightFn || function(edge2) { - return 1; - }; - var _this$byGroup = this.byGroup(), nodes2 = _this$byGroup.nodes, edges2 = _this$byGroup.edges; - var numNodes = nodes2.length; - var forest = new Array(numNodes); - var A = nodes2; - var findSetIndex = function findSetIndex2(ele) { - for (var i4 = 0; i4 < forest.length; i4++) { - var eles = forest[i4]; - if (eles.has(ele)) { - return i4; - } - } - }; - for (var i3 = 0; i3 < numNodes; i3++) { - forest[i3] = this.spawn(nodes2[i3]); - } - var S2 = edges2.sort(function(a, b) { - return weightFn(a) - weightFn(b); - }); - for (var _i6 = 0; _i6 < S2.length; _i6++) { - var edge = S2[_i6]; - var u = edge.source()[0]; - var v = edge.target()[0]; - var setUIndex = findSetIndex(u); - var setVIndex = findSetIndex(v); - var setU = forest[setUIndex]; - var setV = forest[setVIndex]; - if (setUIndex !== setVIndex) { - A.merge(edge); - setU.merge(setV); - forest.splice(setVIndex, 1); - } - } - return A; - } - }; - var aStarDefaults = defaults$g({ - root: null, - goal: null, - weight: function weight(edge) { - return 1; - }, - heuristic: function heuristic(edge) { - return 0; - }, - directed: false - }); - var elesfn$s = { - // Implemented from pseudocode from wikipedia - aStar: function aStar(options2) { - var cy = this.cy(); - var _aStarDefaults = aStarDefaults(options2), root3 = _aStarDefaults.root, goal = _aStarDefaults.goal, heuristic = _aStarDefaults.heuristic, directed = _aStarDefaults.directed, weight = _aStarDefaults.weight; - root3 = cy.collection(root3)[0]; - goal = cy.collection(goal)[0]; - var sid = root3.id(); - var tid = goal.id(); - var gScore = {}; - var fScore = {}; - var closedSetIds = {}; - var openSet = new heap(function(a, b) { - return fScore[a.id()] - fScore[b.id()]; - }); - var openSetIds = new Set$12(); - var cameFrom = {}; - var cameFromEdge = {}; - var addToOpenSet = function addToOpenSet2(ele, id2) { - openSet.push(ele); - openSetIds.add(id2); - }; - var cMin, cMinId; - var popFromOpenSet = function popFromOpenSet2() { - cMin = openSet.pop(); - cMinId = cMin.id(); - openSetIds["delete"](cMinId); - }; - var isInOpenSet = function isInOpenSet2(id2) { - return openSetIds.has(id2); - }; - addToOpenSet(root3, sid); - gScore[sid] = 0; - fScore[sid] = heuristic(root3); - var steps = 0; - while (openSet.size() > 0) { - popFromOpenSet(); - steps++; - if (cMinId === tid) { - var path2 = []; - var pathNode = goal; - var pathNodeId = tid; - var pathEdge = cameFromEdge[pathNodeId]; - for (; ; ) { - path2.unshift(pathNode); - if (pathEdge != null) { - path2.unshift(pathEdge); - } - pathNode = cameFrom[pathNodeId]; - if (pathNode == null) { - break; - } - pathNodeId = pathNode.id(); - pathEdge = cameFromEdge[pathNodeId]; - } - return { - found: true, - distance: gScore[cMinId], - path: this.spawn(path2), - steps - }; - } - closedSetIds[cMinId] = true; - var vwEdges = cMin._private.edges; - for (var i3 = 0; i3 < vwEdges.length; i3++) { - var e = vwEdges[i3]; - if (!this.hasElementWithId(e.id())) { - continue; - } - if (directed && e.data("source") !== cMinId) { - continue; - } - var wSrc = e.source(); - var wTgt = e.target(); - var w2 = wSrc.id() !== cMinId ? wSrc : wTgt; - var wid = w2.id(); - if (!this.hasElementWithId(wid)) { - continue; - } - if (closedSetIds[wid]) { - continue; - } - var tempScore = gScore[cMinId] + weight(e); - if (!isInOpenSet(wid)) { - gScore[wid] = tempScore; - fScore[wid] = tempScore + heuristic(w2); - addToOpenSet(w2, wid); - cameFrom[wid] = cMin; - cameFromEdge[wid] = e; - continue; - } - if (tempScore < gScore[wid]) { - gScore[wid] = tempScore; - fScore[wid] = tempScore + heuristic(w2); - cameFrom[wid] = cMin; - cameFromEdge[wid] = e; - } - } - } - return { - found: false, - distance: void 0, - path: void 0, - steps - }; - } - }; - var floydWarshallDefaults = defaults$g({ - weight: function weight(edge) { - return 1; - }, - directed: false - }); - var elesfn$r = { - // Implemented from pseudocode from wikipedia - floydWarshall: function floydWarshall(options2) { - var cy = this.cy(); - var _floydWarshallDefault = floydWarshallDefaults(options2), weight = _floydWarshallDefault.weight, directed = _floydWarshallDefault.directed; - var weightFn = weight; - var _this$byGroup = this.byGroup(), nodes2 = _this$byGroup.nodes, edges2 = _this$byGroup.edges; - var N = nodes2.length; - var Nsq = N * N; - var indexOf = function indexOf2(node2) { - return nodes2.indexOf(node2); - }; - var atIndex = function atIndex2(i4) { - return nodes2[i4]; - }; - var dist3 = new Array(Nsq); - for (var n = 0; n < Nsq; n++) { - var j = n % N; - var i3 = (n - j) / N; - if (i3 === j) { - dist3[n] = 0; - } else { - dist3[n] = Infinity; - } - } - var next2 = new Array(Nsq); - var edgeNext = new Array(Nsq); - for (var _i6 = 0; _i6 < edges2.length; _i6++) { - var edge = edges2[_i6]; - var src = edge.source()[0]; - var tgt = edge.target()[0]; - if (src === tgt) { - continue; - } - var s = indexOf(src); - var t = indexOf(tgt); - var st = s * N + t; - var _weight = weightFn(edge); - if (dist3[st] > _weight) { - dist3[st] = _weight; - next2[st] = t; - edgeNext[st] = edge; - } - if (!directed) { - var ts = t * N + s; - if (!directed && dist3[ts] > _weight) { - dist3[ts] = _weight; - next2[ts] = s; - edgeNext[ts] = edge; - } - } - } - for (var k = 0; k < N; k++) { - for (var _i22 = 0; _i22 < N; _i22++) { - var ik = _i22 * N + k; - for (var _j = 0; _j < N; _j++) { - var ij = _i22 * N + _j; - var kj = k * N + _j; - if (dist3[ik] + dist3[kj] < dist3[ij]) { - dist3[ij] = dist3[ik] + dist3[kj]; - next2[ij] = next2[ik]; - } - } - } - } - var getArgEle = function getArgEle2(ele) { - return (string2(ele) ? cy.filter(ele) : ele)[0]; - }; - var indexOfArgEle = function indexOfArgEle2(ele) { - return indexOf(getArgEle(ele)); - }; - var res = { - distance: function distance2(from2, to) { - var i4 = indexOfArgEle(from2); - var j2 = indexOfArgEle(to); - return dist3[i4 * N + j2]; - }, - path: function path2(from2, to) { - var i4 = indexOfArgEle(from2); - var j2 = indexOfArgEle(to); - var fromNode = atIndex(i4); - if (i4 === j2) { - return fromNode.collection(); - } - if (next2[i4 * N + j2] == null) { - return cy.collection(); - } - var path3 = cy.collection(); - var prev2 = i4; - var edge2; - path3.merge(fromNode); - while (i4 !== j2) { - prev2 = i4; - i4 = next2[i4 * N + j2]; - edge2 = edgeNext[prev2 * N + i4]; - path3.merge(edge2); - path3.merge(atIndex(i4)); - } - return path3; - } - }; - return res; - } - // floydWarshall - }; - var bellmanFordDefaults = defaults$g({ - weight: function weight(edge) { - return 1; - }, - directed: false, - root: null - }); - var elesfn$q = { - // Implemented from pseudocode from wikipedia - bellmanFord: function bellmanFord(options2) { - var _this = this; - var _bellmanFordDefaults = bellmanFordDefaults(options2), weight = _bellmanFordDefaults.weight, directed = _bellmanFordDefaults.directed, root3 = _bellmanFordDefaults.root; - var weightFn = weight; - var eles = this; - var cy = this.cy(); - var _this$byGroup = this.byGroup(), edges2 = _this$byGroup.edges, nodes2 = _this$byGroup.nodes; - var numNodes = nodes2.length; - var infoMap = new Map$22(); - var hasNegativeWeightCycle = false; - var negativeWeightCycles = []; - root3 = cy.collection(root3)[0]; - edges2.unmergeBy(function(edge2) { - return edge2.isLoop(); - }); - var numEdges = edges2.length; - var getInfo3 = function getInfo4(node3) { - var obj = infoMap.get(node3.id()); - if (!obj) { - obj = {}; - infoMap.set(node3.id(), obj); - } - return obj; - }; - var getNodeFromTo = function getNodeFromTo2(to) { - return (string2(to) ? cy.$(to) : to)[0]; - }; - var distanceTo = function distanceTo2(to) { - return getInfo3(getNodeFromTo(to)).dist; - }; - var pathTo = function pathTo2(to) { - var thisStart = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : root3; - var end2 = getNodeFromTo(to); - var path2 = []; - var node3 = end2; - for (; ; ) { - if (node3 == null) { - return _this.spawn(); - } - var _getInfo = getInfo3(node3), edge2 = _getInfo.edge, pred = _getInfo.pred; - path2.unshift(node3[0]); - if (node3.same(thisStart) && path2.length > 0) { - break; - } - if (edge2 != null) { - path2.unshift(edge2); - } - node3 = pred; - } - return eles.spawn(path2); - }; - for (var i3 = 0; i3 < numNodes; i3++) { - var node2 = nodes2[i3]; - var info2 = getInfo3(node2); - if (node2.same(root3)) { - info2.dist = 0; - } else { - info2.dist = Infinity; - } - info2.pred = null; - info2.edge = null; - } - var replacedEdge = false; - var checkForEdgeReplacement = function checkForEdgeReplacement2(node1, node22, edge2, info1, info22, weight2) { - var dist3 = info1.dist + weight2; - if (dist3 < info22.dist && !edge2.same(info1.edge)) { - info22.dist = dist3; - info22.pred = node1; - info22.edge = edge2; - replacedEdge = true; - } - }; - for (var _i6 = 1; _i6 < numNodes; _i6++) { - replacedEdge = false; - for (var e = 0; e < numEdges; e++) { - var edge = edges2[e]; - var src = edge.source(); - var tgt = edge.target(); - var _weight = weightFn(edge); - var srcInfo = getInfo3(src); - var tgtInfo = getInfo3(tgt); - checkForEdgeReplacement(src, tgt, edge, srcInfo, tgtInfo, _weight); - if (!directed) { - checkForEdgeReplacement(tgt, src, edge, tgtInfo, srcInfo, _weight); - } - } - if (!replacedEdge) { - break; - } - } - if (replacedEdge) { - var negativeWeightCycleIds = []; - for (var _e = 0; _e < numEdges; _e++) { - var _edge = edges2[_e]; - var _src = _edge.source(); - var _tgt = _edge.target(); - var _weight2 = weightFn(_edge); - var srcDist = getInfo3(_src).dist; - var tgtDist = getInfo3(_tgt).dist; - if (srcDist + _weight2 < tgtDist || !directed && tgtDist + _weight2 < srcDist) { - if (!hasNegativeWeightCycle) { - warn("Graph contains a negative weight cycle for Bellman-Ford"); - hasNegativeWeightCycle = true; - } - if (options2.findNegativeWeightCycles !== false) { - var negativeNodes = []; - if (srcDist + _weight2 < tgtDist) { - negativeNodes.push(_src); - } - if (!directed && tgtDist + _weight2 < srcDist) { - negativeNodes.push(_tgt); - } - var numNegativeNodes = negativeNodes.length; - for (var n = 0; n < numNegativeNodes; n++) { - var start2 = negativeNodes[n]; - var cycle = [start2]; - cycle.push(getInfo3(start2).edge); - var _node = getInfo3(start2).pred; - while (cycle.indexOf(_node) === -1) { - cycle.push(_node); - cycle.push(getInfo3(_node).edge); - _node = getInfo3(_node).pred; - } - cycle = cycle.slice(cycle.indexOf(_node)); - var smallestId = cycle[0].id(); - var smallestIndex = 0; - for (var c2 = 2; c2 < cycle.length; c2 += 2) { - if (cycle[c2].id() < smallestId) { - smallestId = cycle[c2].id(); - smallestIndex = c2; - } - } - cycle = cycle.slice(smallestIndex).concat(cycle.slice(0, smallestIndex)); - cycle.push(cycle[0]); - var cycleId = cycle.map(function(el) { - return el.id(); - }).join(","); - if (negativeWeightCycleIds.indexOf(cycleId) === -1) { - negativeWeightCycles.push(eles.spawn(cycle)); - negativeWeightCycleIds.push(cycleId); - } - } - } else { - break; - } - } - } - } - return { - distanceTo, - pathTo, - hasNegativeWeightCycle, - negativeWeightCycles - }; - } - // bellmanFord - }; - var sqrt2 = Math.sqrt(2); - var collapse = function collapse2(edgeIndex, nodeMap, remainingEdges) { - if (remainingEdges.length === 0) { - error("Karger-Stein must be run on a connected (sub)graph"); - } - var edgeInfo = remainingEdges[edgeIndex]; - var sourceIn = edgeInfo[1]; - var targetIn = edgeInfo[2]; - var partition1 = nodeMap[sourceIn]; - var partition2 = nodeMap[targetIn]; - var newEdges = remainingEdges; - for (var i3 = newEdges.length - 1; i3 >= 0; i3--) { - var edge = newEdges[i3]; - var src = edge[1]; - var tgt = edge[2]; - if (nodeMap[src] === partition1 && nodeMap[tgt] === partition2 || nodeMap[src] === partition2 && nodeMap[tgt] === partition1) { - newEdges.splice(i3, 1); - } - } - for (var _i6 = 0; _i6 < newEdges.length; _i6++) { - var _edge = newEdges[_i6]; - if (_edge[1] === partition2) { - newEdges[_i6] = _edge.slice(); - newEdges[_i6][1] = partition1; - } else if (_edge[2] === partition2) { - newEdges[_i6] = _edge.slice(); - newEdges[_i6][2] = partition1; - } - } - for (var _i22 = 0; _i22 < nodeMap.length; _i22++) { - if (nodeMap[_i22] === partition2) { - nodeMap[_i22] = partition1; - } - } - return newEdges; - }; - var contractUntil = function contractUntil2(metaNodeMap, remainingEdges, size2, sizeLimit) { - while (size2 > sizeLimit) { - var edgeIndex = Math.floor(Math.random() * remainingEdges.length); - remainingEdges = collapse(edgeIndex, metaNodeMap, remainingEdges); - size2--; - } - return remainingEdges; - }; - var elesfn$p = { - // Computes the minimum cut of an undirected graph - // Returns the correct answer with high probability - kargerStein: function kargerStein() { - var _this = this; - var _this$byGroup = this.byGroup(), nodes2 = _this$byGroup.nodes, edges2 = _this$byGroup.edges; - edges2.unmergeBy(function(edge) { - return edge.isLoop(); - }); - var numNodes = nodes2.length; - var numEdges = edges2.length; - var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2)); - var stopSize = Math.floor(numNodes / sqrt2); - if (numNodes < 2) { - error("At least 2 nodes are required for Karger-Stein algorithm"); - return void 0; - } - var edgeIndexes = []; - for (var i3 = 0; i3 < numEdges; i3++) { - var e = edges2[i3]; - edgeIndexes.push([i3, nodes2.indexOf(e.source()), nodes2.indexOf(e.target())]); - } - var minCutSize = Infinity; - var minCutEdgeIndexes = []; - var minCutNodeMap = new Array(numNodes); - var metaNodeMap = new Array(numNodes); - var metaNodeMap2 = new Array(numNodes); - var copyNodesMap = function copyNodesMap2(from2, to) { - for (var _i32 = 0; _i32 < numNodes; _i32++) { - to[_i32] = from2[_i32]; - } - }; - for (var iter = 0; iter <= numIter; iter++) { - for (var _i42 = 0; _i42 < numNodes; _i42++) { - metaNodeMap[_i42] = _i42; - } - var edgesState = contractUntil(metaNodeMap, edgeIndexes.slice(), numNodes, stopSize); - var edgesState2 = edgesState.slice(); - copyNodesMap(metaNodeMap, metaNodeMap2); - var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2); - var res2 = contractUntil(metaNodeMap2, edgesState2, stopSize, 2); - if (res1.length <= res2.length && res1.length < minCutSize) { - minCutSize = res1.length; - minCutEdgeIndexes = res1; - copyNodesMap(metaNodeMap, minCutNodeMap); - } else if (res2.length <= res1.length && res2.length < minCutSize) { - minCutSize = res2.length; - minCutEdgeIndexes = res2; - copyNodesMap(metaNodeMap2, minCutNodeMap); - } - } - var cut = this.spawn(minCutEdgeIndexes.map(function(e3) { - return edges2[e3[0]]; - })); - var partition1 = this.spawn(); - var partition2 = this.spawn(); - var witnessNodePartition = minCutNodeMap[0]; - for (var _i52 = 0; _i52 < minCutNodeMap.length; _i52++) { - var partitionId = minCutNodeMap[_i52]; - var node2 = nodes2[_i52]; - if (partitionId === witnessNodePartition) { - partition1.merge(node2); - } else { - partition2.merge(node2); - } - } - var constructComponent = function constructComponent2(subset) { - var component = _this.spawn(); - subset.forEach(function(node3) { - component.merge(node3); - node3.connectedEdges().forEach(function(edge) { - if (_this.contains(edge) && !cut.contains(edge)) { - component.merge(edge); - } - }); - }); - return component; - }; - var components = [constructComponent(partition1), constructComponent(partition2)]; - var ret = { - cut, - components, - // n.b. partitions are included to be compatible with the old api spec - // (could be removed in a future major version) - partition1, - partition2 - }; - return ret; - } - }; - var copyPosition = function copyPosition2(p2) { - return { - x: p2.x, - y: p2.y - }; - }; - var modelToRenderedPosition = function modelToRenderedPosition2(p2, zoom, pan) { - return { - x: p2.x * zoom + pan.x, - y: p2.y * zoom + pan.y - }; - }; - var renderedToModelPosition = function renderedToModelPosition2(p2, zoom, pan) { - return { - x: (p2.x - pan.x) / zoom, - y: (p2.y - pan.y) / zoom - }; - }; - var array2point = function array2point2(arr) { - return { - x: arr[0], - y: arr[1] - }; - }; - var min2 = function min3(arr) { - var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; - var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; - var min4 = Infinity; - for (var i3 = begin; i3 < end2; i3++) { - var val = arr[i3]; - if (isFinite(val)) { - min4 = Math.min(val, min4); - } - } - return min4; - }; - var max2 = function max3(arr) { - var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; - var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; - var max4 = -Infinity; - for (var i3 = begin; i3 < end2; i3++) { - var val = arr[i3]; - if (isFinite(val)) { - max4 = Math.max(val, max4); - } - } - return max4; - }; - var mean = function mean2(arr) { - var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; - var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; - var total = 0; - var n = 0; - for (var i3 = begin; i3 < end2; i3++) { - var val = arr[i3]; - if (isFinite(val)) { - total += val; - n++; - } - } - return total / n; - }; - var median = function median2(arr) { - var begin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; - var end2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : arr.length; - var copy3 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; - var sort2 = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; - var includeHoles = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; - if (copy3) { - arr = arr.slice(begin, end2); - } else { - if (end2 < arr.length) { - arr.splice(end2, arr.length - end2); - } - if (begin > 0) { - arr.splice(0, begin); - } - } - var off = 0; - for (var i3 = arr.length - 1; i3 >= 0; i3--) { - var v = arr[i3]; - if (includeHoles) { - if (!isFinite(v)) { - arr[i3] = -Infinity; - off++; - } - } else { - arr.splice(i3, 1); - } - } - if (sort2) { - arr.sort(function(a, b) { - return a - b; - }); - } - var len = arr.length; - var mid = Math.floor(len / 2); - if (len % 2 !== 0) { - return arr[mid + 1 + off]; - } else { - return (arr[mid - 1 + off] + arr[mid + off]) / 2; - } - }; - var deg2rad = function deg2rad2(deg) { - return Math.PI * deg / 180; - }; - var getAngleFromDisp = function getAngleFromDisp2(dispX, dispY) { - return Math.atan2(dispY, dispX) - Math.PI / 2; - }; - var log2 = Math.log2 || function(n) { - return Math.log(n) / Math.log(2); - }; - var signum = function signum2(x2) { - if (x2 > 0) { - return 1; - } else if (x2 < 0) { - return -1; - } else { - return 0; - } - }; - var dist2 = function dist3(p1, p2) { - return Math.sqrt(sqdist(p1, p2)); - }; - var sqdist = function sqdist2(p1, p2) { - var dx = p2.x - p1.x; - var dy = p2.y - p1.y; - return dx * dx + dy * dy; - }; - var inPlaceSumNormalize = function inPlaceSumNormalize2(v) { - var length2 = v.length; - var total = 0; - for (var i3 = 0; i3 < length2; i3++) { - total += v[i3]; - } - for (var _i6 = 0; _i6 < length2; _i6++) { - v[_i6] = v[_i6] / total; - } - return v; - }; - var qbezierAt = function qbezierAt2(p0, p1, p2, t) { - return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2; - }; - var qbezierPtAt = function qbezierPtAt2(p0, p1, p2, t) { - return { - x: qbezierAt(p0.x, p1.x, p2.x, t), - y: qbezierAt(p0.y, p1.y, p2.y, t) - }; - }; - var lineAt = function lineAt2(p0, p1, t, d) { - var vec = { - x: p1.x - p0.x, - y: p1.y - p0.y - }; - var vecDist = dist2(p0, p1); - var normVec = { - x: vec.x / vecDist, - y: vec.y / vecDist - }; - t = t == null ? 0 : t; - d = d != null ? d : t * vecDist; - return { - x: p0.x + normVec.x * d, - y: p0.y + normVec.y * d - }; - }; - var bound = function bound2(min3, val, max3) { - return Math.max(min3, Math.min(max3, val)); - }; - var makeBoundingBox = function makeBoundingBox2(bb) { - if (bb == null) { - return { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity, - w: 0, - h: 0 - }; - } else if (bb.x1 != null && bb.y1 != null) { - if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) { - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x2, - y2: bb.y2, - w: bb.x2 - bb.x1, - h: bb.y2 - bb.y1 - }; - } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) { - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x1 + bb.w, - y2: bb.y1 + bb.h, - w: bb.w, - h: bb.h - }; - } - } - }; - var copyBoundingBox = function copyBoundingBox2(bb) { - return { - x1: bb.x1, - x2: bb.x2, - w: bb.w, - y1: bb.y1, - y2: bb.y2, - h: bb.h - }; - }; - var clearBoundingBox = function clearBoundingBox2(bb) { - bb.x1 = Infinity; - bb.y1 = Infinity; - bb.x2 = -Infinity; - bb.y2 = -Infinity; - bb.w = 0; - bb.h = 0; - }; - var shiftBoundingBox = function shiftBoundingBox2(bb, dx, dy) { - return { - x1: bb.x1 + dx, - x2: bb.x2 + dx, - y1: bb.y1 + dy, - y2: bb.y2 + dy, - w: bb.w, - h: bb.h - }; - }; - var updateBoundingBox = function updateBoundingBox2(bb1, bb2) { - bb1.x1 = Math.min(bb1.x1, bb2.x1); - bb1.x2 = Math.max(bb1.x2, bb2.x2); - bb1.w = bb1.x2 - bb1.x1; - bb1.y1 = Math.min(bb1.y1, bb2.y1); - bb1.y2 = Math.max(bb1.y2, bb2.y2); - bb1.h = bb1.y2 - bb1.y1; - }; - var expandBoundingBoxByPoint = function expandBoundingBoxByPoint2(bb, x2, y2) { - bb.x1 = Math.min(bb.x1, x2); - bb.x2 = Math.max(bb.x2, x2); - bb.w = bb.x2 - bb.x1; - bb.y1 = Math.min(bb.y1, y2); - bb.y2 = Math.max(bb.y2, y2); - bb.h = bb.y2 - bb.y1; - }; - var expandBoundingBox = function expandBoundingBox2(bb) { - var padding2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; - bb.x1 -= padding2; - bb.x2 += padding2; - bb.y1 -= padding2; - bb.y2 += padding2; - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - return bb; - }; - var expandBoundingBoxSides = function expandBoundingBoxSides2(bb) { - var padding2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0]; - var top2, right2, bottom2, left2; - if (padding2.length === 1) { - top2 = right2 = bottom2 = left2 = padding2[0]; - } else if (padding2.length === 2) { - top2 = bottom2 = padding2[0]; - left2 = right2 = padding2[1]; - } else if (padding2.length === 4) { - var _padding = _slicedToArray(padding2, 4); - top2 = _padding[0]; - right2 = _padding[1]; - bottom2 = _padding[2]; - left2 = _padding[3]; - } - bb.x1 -= left2; - bb.x2 += right2; - bb.y1 -= top2; - bb.y2 += bottom2; - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - return bb; - }; - var assignBoundingBox = function assignBoundingBox2(bb1, bb2) { - bb1.x1 = bb2.x1; - bb1.y1 = bb2.y1; - bb1.x2 = bb2.x2; - bb1.y2 = bb2.y2; - bb1.w = bb1.x2 - bb1.x1; - bb1.h = bb1.y2 - bb1.y1; - }; - var boundingBoxesIntersect = function boundingBoxesIntersect2(bb1, bb2) { - if (bb1.x1 > bb2.x2) { - return false; - } - if (bb2.x1 > bb1.x2) { - return false; - } - if (bb1.x2 < bb2.x1) { - return false; - } - if (bb2.x2 < bb1.x1) { - return false; - } - if (bb1.y2 < bb2.y1) { - return false; - } - if (bb2.y2 < bb1.y1) { - return false; - } - if (bb1.y1 > bb2.y2) { - return false; - } - if (bb2.y1 > bb1.y2) { - return false; - } - return true; - }; - var inBoundingBox = function inBoundingBox2(bb, x2, y2) { - return bb.x1 <= x2 && x2 <= bb.x2 && bb.y1 <= y2 && y2 <= bb.y2; - }; - var pointInBoundingBox = function pointInBoundingBox2(bb, pt) { - return inBoundingBox(bb, pt.x, pt.y); - }; - var boundingBoxInBoundingBox = function boundingBoxInBoundingBox2(bb1, bb2) { - return inBoundingBox(bb1, bb2.x1, bb2.y1) && inBoundingBox(bb1, bb2.x2, bb2.y2); - }; - var roundRectangleIntersectLine = function roundRectangleIntersectLine2(x2, y2, nodeX, nodeY, width2, height, padding2) { - var cornerRadius = getRoundRectangleRadius(width2, height); - var halfWidth = width2 / 2; - var halfHeight = height / 2; - var straightLineIntersections; - { - var topStartX = nodeX - halfWidth + cornerRadius - padding2; - var topStartY = nodeY - halfHeight - padding2; - var topEndX = nodeX + halfWidth - cornerRadius + padding2; - var topEndY = topStartY; - straightLineIntersections = finiteLinesIntersect(x2, y2, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - { - var rightStartX = nodeX + halfWidth + padding2; - var rightStartY = nodeY - halfHeight + cornerRadius - padding2; - var rightEndX = rightStartX; - var rightEndY = nodeY + halfHeight - cornerRadius + padding2; - straightLineIntersections = finiteLinesIntersect(x2, y2, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false); - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - { - var bottomStartX = nodeX - halfWidth + cornerRadius - padding2; - var bottomStartY = nodeY + halfHeight + padding2; - var bottomEndX = nodeX + halfWidth - cornerRadius + padding2; - var bottomEndY = bottomStartY; - straightLineIntersections = finiteLinesIntersect(x2, y2, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false); - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - { - var leftStartX = nodeX - halfWidth - padding2; - var leftStartY = nodeY - halfHeight + cornerRadius - padding2; - var leftEndX = leftStartX; - var leftEndY = nodeY + halfHeight - cornerRadius + padding2; - straightLineIntersections = finiteLinesIntersect(x2, y2, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false); - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - var arcIntersections; - { - var topLeftCenterX = nodeX - halfWidth + cornerRadius; - var topLeftCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = intersectLineCircle(x2, y2, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding2); - if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - { - var topRightCenterX = nodeX + halfWidth - cornerRadius; - var topRightCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = intersectLineCircle(x2, y2, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding2); - if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - { - var bottomRightCenterX = nodeX + halfWidth - cornerRadius; - var bottomRightCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = intersectLineCircle(x2, y2, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding2); - if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - { - var bottomLeftCenterX = nodeX - halfWidth + cornerRadius; - var bottomLeftCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = intersectLineCircle(x2, y2, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding2); - if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - return []; - }; - var inLineVicinity = function inLineVicinity2(x2, y2, lx1, ly1, lx2, ly2, tolerance) { - var t = tolerance; - var x1 = Math.min(lx1, lx2); - var x22 = Math.max(lx1, lx2); - var y1 = Math.min(ly1, ly2); - var y22 = Math.max(ly1, ly2); - return x1 - t <= x2 && x2 <= x22 + t && y1 - t <= y2 && y2 <= y22 + t; - }; - var inBezierVicinity = function inBezierVicinity2(x2, y2, x1, y1, x22, y22, x3, y3, tolerance) { - var bb = { - x1: Math.min(x1, x3, x22) - tolerance, - x2: Math.max(x1, x3, x22) + tolerance, - y1: Math.min(y1, y3, y22) - tolerance, - y2: Math.max(y1, y3, y22) + tolerance - }; - if (x2 < bb.x1 || x2 > bb.x2 || y2 < bb.y1 || y2 > bb.y2) { - return false; - } else { - return true; - } - }; - var solveQuadratic = function solveQuadratic2(a, b, c2, val) { - c2 -= val; - var r = b * b - 4 * a * c2; - if (r < 0) { - return []; - } - var sqrtR = Math.sqrt(r); - var denom = 2 * a; - var root1 = (-b + sqrtR) / denom; - var root22 = (-b - sqrtR) / denom; - return [root1, root22]; - }; - var solveCubic = function solveCubic2(a, b, c2, d, result) { - var epsilon2 = 1e-5; - if (a === 0) { - a = epsilon2; - } - b /= a; - c2 /= a; - d /= a; - var discriminant, q, r, dum1, s, t, term1, r13; - q = (3 * c2 - b * b) / 9; - r = -(27 * d) + b * (9 * c2 - 2 * (b * b)); - r /= 54; - discriminant = q * q * q + r * r; - result[1] = 0; - term1 = b / 3; - if (discriminant > 0) { - s = r + Math.sqrt(discriminant); - s = s < 0 ? -Math.pow(-s, 1 / 3) : Math.pow(s, 1 / 3); - t = r - Math.sqrt(discriminant); - t = t < 0 ? -Math.pow(-t, 1 / 3) : Math.pow(t, 1 / 3); - result[0] = -term1 + s + t; - term1 += (s + t) / 2; - result[4] = result[2] = -term1; - term1 = Math.sqrt(3) * (-t + s) / 2; - result[3] = term1; - result[5] = -term1; - return; - } - result[5] = result[3] = 0; - if (discriminant === 0) { - r13 = r < 0 ? -Math.pow(-r, 1 / 3) : Math.pow(r, 1 / 3); - result[0] = -term1 + 2 * r13; - result[4] = result[2] = -(r13 + term1); - return; - } - q = -q; - dum1 = q * q * q; - dum1 = Math.acos(r / Math.sqrt(dum1)); - r13 = 2 * Math.sqrt(q); - result[0] = -term1 + r13 * Math.cos(dum1 / 3); - result[2] = -term1 + r13 * Math.cos((dum1 + 2 * Math.PI) / 3); - result[4] = -term1 + r13 * Math.cos((dum1 + 4 * Math.PI) / 3); - return; - }; - var sqdistToQuadraticBezier = function sqdistToQuadraticBezier2(x2, y2, x1, y1, x22, y22, x3, y3) { - var a = 1 * x1 * x1 - 4 * x1 * x22 + 2 * x1 * x3 + 4 * x22 * x22 - 4 * x22 * x3 + x3 * x3 + y1 * y1 - 4 * y1 * y22 + 2 * y1 * y3 + 4 * y22 * y22 - 4 * y22 * y3 + y3 * y3; - var b = 1 * 9 * x1 * x22 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x22 * x22 + 3 * x22 * x3 + 9 * y1 * y22 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y22 * y22 + 3 * y22 * y3; - var c2 = 1 * 3 * x1 * x1 - 6 * x1 * x22 + x1 * x3 - x1 * x2 + 2 * x22 * x22 + 2 * x22 * x2 - x3 * x2 + 3 * y1 * y1 - 6 * y1 * y22 + y1 * y3 - y1 * y2 + 2 * y22 * y22 + 2 * y22 * y2 - y3 * y2; - var d = 1 * x1 * x22 - x1 * x1 + x1 * x2 - x22 * x2 + y1 * y22 - y1 * y1 + y1 * y2 - y22 * y2; - var roots = []; - solveCubic(a, b, c2, d, roots); - var zeroThreshold = 1e-7; - var params = []; - for (var index2 = 0; index2 < 6; index2 += 2) { - if (Math.abs(roots[index2 + 1]) < zeroThreshold && roots[index2] >= 0 && roots[index2] <= 1) { - params.push(roots[index2]); - } - } - params.push(1); - params.push(0); - var minDistanceSquared = -1; - var curX, curY, distSquared; - for (var i3 = 0; i3 < params.length; i3++) { - curX = Math.pow(1 - params[i3], 2) * x1 + 2 * (1 - params[i3]) * params[i3] * x22 + params[i3] * params[i3] * x3; - curY = Math.pow(1 - params[i3], 2) * y1 + 2 * (1 - params[i3]) * params[i3] * y22 + params[i3] * params[i3] * y3; - distSquared = Math.pow(curX - x2, 2) + Math.pow(curY - y2, 2); - if (minDistanceSquared >= 0) { - if (distSquared < minDistanceSquared) { - minDistanceSquared = distSquared; - } - } else { - minDistanceSquared = distSquared; - } - } - return minDistanceSquared; - }; - var sqdistToFiniteLine = function sqdistToFiniteLine2(x2, y2, x1, y1, x22, y22) { - var offset = [x2 - x1, y2 - y1]; - var line2 = [x22 - x1, y22 - y1]; - var lineSq = line2[0] * line2[0] + line2[1] * line2[1]; - var hypSq = offset[0] * offset[0] + offset[1] * offset[1]; - var dotProduct = offset[0] * line2[0] + offset[1] * line2[1]; - var adjSq = dotProduct * dotProduct / lineSq; - if (dotProduct < 0) { - return hypSq; - } - if (adjSq > lineSq) { - return (x2 - x22) * (x2 - x22) + (y2 - y22) * (y2 - y22); - } - return hypSq - adjSq; - }; - var pointInsidePolygonPoints = function pointInsidePolygonPoints2(x2, y2, points) { - var x1, y1, x22, y22; - var y3; - var up = 0; - for (var i3 = 0; i3 < points.length / 2; i3++) { - x1 = points[i3 * 2]; - y1 = points[i3 * 2 + 1]; - if (i3 + 1 < points.length / 2) { - x22 = points[(i3 + 1) * 2]; - y22 = points[(i3 + 1) * 2 + 1]; - } else { - x22 = points[(i3 + 1 - points.length / 2) * 2]; - y22 = points[(i3 + 1 - points.length / 2) * 2 + 1]; - } - if (x1 == x2 && x22 == x2) - ; - else if (x1 >= x2 && x2 >= x22 || x1 <= x2 && x2 <= x22) { - y3 = (x2 - x1) / (x22 - x1) * (y22 - y1) + y1; - if (y3 > y2) { - up++; - } - } else { - continue; - } - } - if (up % 2 === 0) { - return false; - } else { - return true; - } - }; - var pointInsidePolygon = function pointInsidePolygon2(x2, y2, basePoints, centerX, centerY, width2, height, direction2, padding2) { - var transformedPoints = new Array(basePoints.length); - var angle; - if (direction2[0] != null) { - angle = Math.atan(direction2[1] / direction2[0]); - if (direction2[0] < 0) { - angle = angle + Math.PI / 2; - } else { - angle = -angle - Math.PI / 2; - } - } else { - angle = direction2; - } - var cos3 = Math.cos(-angle); - var sin3 = Math.sin(-angle); - for (var i3 = 0; i3 < transformedPoints.length / 2; i3++) { - transformedPoints[i3 * 2] = width2 / 2 * (basePoints[i3 * 2] * cos3 - basePoints[i3 * 2 + 1] * sin3); - transformedPoints[i3 * 2 + 1] = height / 2 * (basePoints[i3 * 2 + 1] * cos3 + basePoints[i3 * 2] * sin3); - transformedPoints[i3 * 2] += centerX; - transformedPoints[i3 * 2 + 1] += centerY; - } - var points; - if (padding2 > 0) { - var expandedLineSet = expandPolygon(transformedPoints, -padding2); - points = joinLines(expandedLineSet); - } else { - points = transformedPoints; - } - return pointInsidePolygonPoints(x2, y2, points); - }; - var pointInsideRoundPolygon = function pointInsideRoundPolygon2(x2, y2, basePoints, centerX, centerY, width2, height) { - var cutPolygonPoints = new Array(basePoints.length); - var halfW = width2 / 2; - var halfH = height / 2; - var cornerRadius = getRoundPolygonRadius(width2, height); - var squaredCornerRadius = cornerRadius * cornerRadius; - for (var i3 = 0; i3 < basePoints.length / 4; i3++) { - var sourceUv = void 0, destUv = void 0; - if (i3 === 0) { - sourceUv = basePoints.length - 2; - } else { - sourceUv = i3 * 4 - 2; - } - destUv = i3 * 4 + 2; - var px = centerX + halfW * basePoints[i3 * 4]; - var py = centerY + halfH * basePoints[i3 * 4 + 1]; - var cosTheta = -basePoints[sourceUv] * basePoints[destUv] - basePoints[sourceUv + 1] * basePoints[destUv + 1]; - var offset = cornerRadius / Math.tan(Math.acos(cosTheta) / 2); - var cp0x = px - offset * basePoints[sourceUv]; - var cp0y = py - offset * basePoints[sourceUv + 1]; - var cp1x = px + offset * basePoints[destUv]; - var cp1y = py + offset * basePoints[destUv + 1]; - cutPolygonPoints[i3 * 4] = cp0x; - cutPolygonPoints[i3 * 4 + 1] = cp0y; - cutPolygonPoints[i3 * 4 + 2] = cp1x; - cutPolygonPoints[i3 * 4 + 3] = cp1y; - var orthx = basePoints[sourceUv + 1]; - var orthy = -basePoints[sourceUv]; - var cosAlpha = orthx * basePoints[destUv] + orthy * basePoints[destUv + 1]; - if (cosAlpha < 0) { - orthx *= -1; - orthy *= -1; - } - var cx = cp0x + orthx * cornerRadius; - var cy = cp0y + orthy * cornerRadius; - var squaredDistance = Math.pow(cx - x2, 2) + Math.pow(cy - y2, 2); - if (squaredDistance <= squaredCornerRadius) { - return true; - } - } - return pointInsidePolygonPoints(x2, y2, cutPolygonPoints); - }; - var joinLines = function joinLines2(lineSet) { - var vertices2 = new Array(lineSet.length / 2); - var currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY; - var nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY; - for (var i3 = 0; i3 < lineSet.length / 4; i3++) { - currentLineStartX = lineSet[i3 * 4]; - currentLineStartY = lineSet[i3 * 4 + 1]; - currentLineEndX = lineSet[i3 * 4 + 2]; - currentLineEndY = lineSet[i3 * 4 + 3]; - if (i3 < lineSet.length / 4 - 1) { - nextLineStartX = lineSet[(i3 + 1) * 4]; - nextLineStartY = lineSet[(i3 + 1) * 4 + 1]; - nextLineEndX = lineSet[(i3 + 1) * 4 + 2]; - nextLineEndY = lineSet[(i3 + 1) * 4 + 3]; - } else { - nextLineStartX = lineSet[0]; - nextLineStartY = lineSet[1]; - nextLineEndX = lineSet[2]; - nextLineEndY = lineSet[3]; - } - var intersection2 = finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true); - vertices2[i3 * 2] = intersection2[0]; - vertices2[i3 * 2 + 1] = intersection2[1]; - } - return vertices2; - }; - var expandPolygon = function expandPolygon2(points, pad2) { - var expandedLineSet = new Array(points.length * 2); - var currentPointX, currentPointY, nextPointX, nextPointY; - for (var i3 = 0; i3 < points.length / 2; i3++) { - currentPointX = points[i3 * 2]; - currentPointY = points[i3 * 2 + 1]; - if (i3 < points.length / 2 - 1) { - nextPointX = points[(i3 + 1) * 2]; - nextPointY = points[(i3 + 1) * 2 + 1]; - } else { - nextPointX = points[0]; - nextPointY = points[1]; - } - var offsetX = nextPointY - currentPointY; - var offsetY = -(nextPointX - currentPointX); - var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY); - var normalizedOffsetX = offsetX / offsetLength; - var normalizedOffsetY = offsetY / offsetLength; - expandedLineSet[i3 * 4] = currentPointX + normalizedOffsetX * pad2; - expandedLineSet[i3 * 4 + 1] = currentPointY + normalizedOffsetY * pad2; - expandedLineSet[i3 * 4 + 2] = nextPointX + normalizedOffsetX * pad2; - expandedLineSet[i3 * 4 + 3] = nextPointY + normalizedOffsetY * pad2; - } - return expandedLineSet; - }; - var intersectLineEllipse = function intersectLineEllipse2(x2, y2, centerX, centerY, ellipseWradius, ellipseHradius) { - var dispX = centerX - x2; - var dispY = centerY - y2; - dispX /= ellipseWradius; - dispY /= ellipseHradius; - var len = Math.sqrt(dispX * dispX + dispY * dispY); - var newLength = len - 1; - if (newLength < 0) { - return []; - } - var lenProportion = newLength / len; - return [(centerX - x2) * lenProportion + x2, (centerY - y2) * lenProportion + y2]; - }; - var checkInEllipse = function checkInEllipse2(x2, y2, width2, height, centerX, centerY, padding2) { - x2 -= centerX; - y2 -= centerY; - x2 /= width2 / 2 + padding2; - y2 /= height / 2 + padding2; - return x2 * x2 + y2 * y2 <= 1; - }; - var intersectLineCircle = function intersectLineCircle2(x1, y1, x2, y2, centerX, centerY, radius) { - var d = [x2 - x1, y2 - y1]; - var f2 = [x1 - centerX, y1 - centerY]; - var a = d[0] * d[0] + d[1] * d[1]; - var b = 2 * (f2[0] * d[0] + f2[1] * d[1]); - var c2 = f2[0] * f2[0] + f2[1] * f2[1] - radius * radius; - var discriminant = b * b - 4 * a * c2; - if (discriminant < 0) { - return []; - } - var t12 = (-b + Math.sqrt(discriminant)) / (2 * a); - var t22 = (-b - Math.sqrt(discriminant)) / (2 * a); - var tMin = Math.min(t12, t22); - var tMax = Math.max(t12, t22); - var inRangeParams = []; - if (tMin >= 0 && tMin <= 1) { - inRangeParams.push(tMin); - } - if (tMax >= 0 && tMax <= 1) { - inRangeParams.push(tMax); - } - if (inRangeParams.length === 0) { - return []; - } - var nearIntersectionX = inRangeParams[0] * d[0] + x1; - var nearIntersectionY = inRangeParams[0] * d[1] + y1; - if (inRangeParams.length > 1) { - if (inRangeParams[0] == inRangeParams[1]) { - return [nearIntersectionX, nearIntersectionY]; - } else { - var farIntersectionX = inRangeParams[1] * d[0] + x1; - var farIntersectionY = inRangeParams[1] * d[1] + y1; - return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY]; - } - } else { - return [nearIntersectionX, nearIntersectionY]; - } - }; - var midOfThree = function midOfThree2(a, b, c2) { - if (b <= a && a <= c2 || c2 <= a && a <= b) { - return a; - } else if (a <= b && b <= c2 || c2 <= b && b <= a) { - return b; - } else { - return c2; - } - }; - var finiteLinesIntersect = function finiteLinesIntersect2(x1, y1, x2, y2, x3, y3, x4, y4, infiniteLines) { - var dx13 = x1 - x3; - var dx21 = x2 - x1; - var dx43 = x4 - x3; - var dy13 = y1 - y3; - var dy21 = y2 - y1; - var dy43 = y4 - y3; - var ua_t = dx43 * dy13 - dy43 * dx13; - var ub_t = dx21 * dy13 - dy21 * dx13; - var u_b = dy43 * dx21 - dx43 * dy21; - if (u_b !== 0) { - var ua = ua_t / u_b; - var ub = ub_t / u_b; - var flptThreshold = 1e-3; - var _min = 0 - flptThreshold; - var _max = 1 + flptThreshold; - if (_min <= ua && ua <= _max && _min <= ub && ub <= _max) { - return [x1 + ua * dx21, y1 + ua * dy21]; - } else { - if (!infiniteLines) { - return []; - } else { - return [x1 + ua * dx21, y1 + ua * dy21]; - } - } - } else { - if (ua_t === 0 || ub_t === 0) { - if (midOfThree(x1, x2, x4) === x4) { - return [x4, y4]; - } - if (midOfThree(x1, x2, x3) === x3) { - return [x3, y3]; - } - if (midOfThree(x3, x4, x2) === x2) { - return [x2, y2]; - } - return []; - } else { - return []; - } - } - }; - var polygonIntersectLine = function polygonIntersectLine2(x2, y2, basePoints, centerX, centerY, width2, height, padding2) { - var intersections = []; - var intersection2; - var transformedPoints = new Array(basePoints.length); - var doTransform = true; - if (width2 == null) { - doTransform = false; - } - var points; - if (doTransform) { - for (var i3 = 0; i3 < transformedPoints.length / 2; i3++) { - transformedPoints[i3 * 2] = basePoints[i3 * 2] * width2 + centerX; - transformedPoints[i3 * 2 + 1] = basePoints[i3 * 2 + 1] * height + centerY; - } - if (padding2 > 0) { - var expandedLineSet = expandPolygon(transformedPoints, -padding2); - points = joinLines(expandedLineSet); - } else { - points = transformedPoints; - } - } else { - points = basePoints; - } - var currentX, currentY, nextX, nextY; - for (var _i22 = 0; _i22 < points.length / 2; _i22++) { - currentX = points[_i22 * 2]; - currentY = points[_i22 * 2 + 1]; - if (_i22 < points.length / 2 - 1) { - nextX = points[(_i22 + 1) * 2]; - nextY = points[(_i22 + 1) * 2 + 1]; - } else { - nextX = points[0]; - nextY = points[1]; - } - intersection2 = finiteLinesIntersect(x2, y2, centerX, centerY, currentX, currentY, nextX, nextY); - if (intersection2.length !== 0) { - intersections.push(intersection2[0], intersection2[1]); - } - } - return intersections; - }; - var roundPolygonIntersectLine = function roundPolygonIntersectLine2(x2, y2, basePoints, centerX, centerY, width2, height, padding2) { - var intersections = []; - var intersection2; - var lines = new Array(basePoints.length); - var halfW = width2 / 2; - var halfH = height / 2; - var cornerRadius = getRoundPolygonRadius(width2, height); - for (var i3 = 0; i3 < basePoints.length / 4; i3++) { - var sourceUv = void 0, destUv = void 0; - if (i3 === 0) { - sourceUv = basePoints.length - 2; - } else { - sourceUv = i3 * 4 - 2; - } - destUv = i3 * 4 + 2; - var px = centerX + halfW * basePoints[i3 * 4]; - var py = centerY + halfH * basePoints[i3 * 4 + 1]; - var cosTheta = -basePoints[sourceUv] * basePoints[destUv] - basePoints[sourceUv + 1] * basePoints[destUv + 1]; - var offset = cornerRadius / Math.tan(Math.acos(cosTheta) / 2); - var cp0x = px - offset * basePoints[sourceUv]; - var cp0y = py - offset * basePoints[sourceUv + 1]; - var cp1x = px + offset * basePoints[destUv]; - var cp1y = py + offset * basePoints[destUv + 1]; - if (i3 === 0) { - lines[basePoints.length - 2] = cp0x; - lines[basePoints.length - 1] = cp0y; - } else { - lines[i3 * 4 - 2] = cp0x; - lines[i3 * 4 - 1] = cp0y; - } - lines[i3 * 4] = cp1x; - lines[i3 * 4 + 1] = cp1y; - var orthx = basePoints[sourceUv + 1]; - var orthy = -basePoints[sourceUv]; - var cosAlpha = orthx * basePoints[destUv] + orthy * basePoints[destUv + 1]; - if (cosAlpha < 0) { - orthx *= -1; - orthy *= -1; - } - var cx = cp0x + orthx * cornerRadius; - var cy = cp0y + orthy * cornerRadius; - intersection2 = intersectLineCircle(x2, y2, centerX, centerY, cx, cy, cornerRadius); - if (intersection2.length !== 0) { - intersections.push(intersection2[0], intersection2[1]); - } - } - for (var _i32 = 0; _i32 < lines.length / 4; _i32++) { - intersection2 = finiteLinesIntersect(x2, y2, centerX, centerY, lines[_i32 * 4], lines[_i32 * 4 + 1], lines[_i32 * 4 + 2], lines[_i32 * 4 + 3], false); - if (intersection2.length !== 0) { - intersections.push(intersection2[0], intersection2[1]); - } - } - if (intersections.length > 2) { - var lowestIntersection = [intersections[0], intersections[1]]; - var lowestSquaredDistance = Math.pow(lowestIntersection[0] - x2, 2) + Math.pow(lowestIntersection[1] - y2, 2); - for (var _i42 = 1; _i42 < intersections.length / 2; _i42++) { - var squaredDistance = Math.pow(intersections[_i42 * 2] - x2, 2) + Math.pow(intersections[_i42 * 2 + 1] - y2, 2); - if (squaredDistance <= lowestSquaredDistance) { - lowestIntersection[0] = intersections[_i42 * 2]; - lowestIntersection[1] = intersections[_i42 * 2 + 1]; - lowestSquaredDistance = squaredDistance; - } - } - return lowestIntersection; - } - return intersections; - }; - var shortenIntersection = function shortenIntersection2(intersection2, offset, amount) { - var disp = [intersection2[0] - offset[0], intersection2[1] - offset[1]]; - var length2 = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]); - var lenRatio = (length2 - amount) / length2; - if (lenRatio < 0) { - lenRatio = 1e-5; - } - return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]]; - }; - var generateUnitNgonPointsFitToSquare = function generateUnitNgonPointsFitToSquare2(sides, rotationRadians) { - var points = generateUnitNgonPoints(sides, rotationRadians); - points = fitPolygonToSquare(points); - return points; - }; - var fitPolygonToSquare = function fitPolygonToSquare2(points) { - var x2, y2; - var sides = points.length / 2; - var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; - for (var i3 = 0; i3 < sides; i3++) { - x2 = points[2 * i3]; - y2 = points[2 * i3 + 1]; - minX = Math.min(minX, x2); - maxX = Math.max(maxX, x2); - minY = Math.min(minY, y2); - maxY = Math.max(maxY, y2); - } - var sx = 2 / (maxX - minX); - var sy = 2 / (maxY - minY); - for (var _i52 = 0; _i52 < sides; _i52++) { - x2 = points[2 * _i52] = points[2 * _i52] * sx; - y2 = points[2 * _i52 + 1] = points[2 * _i52 + 1] * sy; - minX = Math.min(minX, x2); - maxX = Math.max(maxX, x2); - minY = Math.min(minY, y2); - maxY = Math.max(maxY, y2); - } - if (minY < -1) { - for (var _i6 = 0; _i6 < sides; _i6++) { - y2 = points[2 * _i6 + 1] = points[2 * _i6 + 1] + (-1 - minY); - } - } - return points; - }; - var generateUnitNgonPoints = function generateUnitNgonPoints2(sides, rotationRadians) { - var increment = 1 / sides * 2 * Math.PI; - var startAngle = sides % 2 === 0 ? Math.PI / 2 + increment / 2 : Math.PI / 2; - startAngle += rotationRadians; - var points = new Array(sides * 2); - var currentAngle; - for (var i3 = 0; i3 < sides; i3++) { - currentAngle = i3 * increment + startAngle; - points[2 * i3] = Math.cos(currentAngle); - points[2 * i3 + 1] = Math.sin(-currentAngle); - } - return points; - }; - var getRoundRectangleRadius = function getRoundRectangleRadius2(width2, height) { - return Math.min(width2 / 4, height / 4, 8); - }; - var getRoundPolygonRadius = function getRoundPolygonRadius2(width2, height) { - return Math.min(width2 / 10, height / 10, 8); - }; - var getCutRectangleCornerLength = function getCutRectangleCornerLength2() { - return 8; - }; - var bezierPtsToQuadCoeff = function bezierPtsToQuadCoeff2(p0, p1, p2) { - return [p0 - 2 * p1 + p2, 2 * (p1 - p0), p0]; - }; - var getBarrelCurveConstants = function getBarrelCurveConstants2(width2, height) { - return { - heightOffset: Math.min(15, 0.05 * height), - widthOffset: Math.min(100, 0.25 * width2), - ctrlPtOffsetPct: 0.05 - }; - }; - var pageRankDefaults = defaults$g({ - dampingFactor: 0.8, - precision: 1e-6, - iterations: 200, - weight: function weight(edge) { - return 1; - } - }); - var elesfn$o = { - pageRank: function pageRank(options2) { - var _pageRankDefaults = pageRankDefaults(options2), dampingFactor = _pageRankDefaults.dampingFactor, precision = _pageRankDefaults.precision, iterations = _pageRankDefaults.iterations, weight = _pageRankDefaults.weight; - var cy = this._private.cy; - var _this$byGroup = this.byGroup(), nodes2 = _this$byGroup.nodes, edges2 = _this$byGroup.edges; - var numNodes = nodes2.length; - var numNodesSqd = numNodes * numNodes; - var numEdges = edges2.length; - var matrix = new Array(numNodesSqd); - var columnSum = new Array(numNodes); - var additionalProb = (1 - dampingFactor) / numNodes; - for (var i3 = 0; i3 < numNodes; i3++) { - for (var j = 0; j < numNodes; j++) { - var n = i3 * numNodes + j; - matrix[n] = 0; - } - columnSum[i3] = 0; - } - for (var _i6 = 0; _i6 < numEdges; _i6++) { - var edge = edges2[_i6]; - var srcId = edge.data("source"); - var tgtId = edge.data("target"); - if (srcId === tgtId) { - continue; - } - var s = nodes2.indexOfId(srcId); - var t = nodes2.indexOfId(tgtId); - var w2 = weight(edge); - var _n = t * numNodes + s; - matrix[_n] += w2; - columnSum[s] += w2; - } - var p2 = 1 / numNodes + additionalProb; - for (var _j = 0; _j < numNodes; _j++) { - if (columnSum[_j] === 0) { - for (var _i22 = 0; _i22 < numNodes; _i22++) { - var _n2 = _i22 * numNodes + _j; - matrix[_n2] = p2; - } - } else { - for (var _i32 = 0; _i32 < numNodes; _i32++) { - var _n3 = _i32 * numNodes + _j; - matrix[_n3] = matrix[_n3] / columnSum[_j] + additionalProb; - } - } - } - var eigenvector = new Array(numNodes); - var temp = new Array(numNodes); - var previous2; - for (var _i42 = 0; _i42 < numNodes; _i42++) { - eigenvector[_i42] = 1; - } - for (var iter = 0; iter < iterations; iter++) { - for (var _i52 = 0; _i52 < numNodes; _i52++) { - temp[_i52] = 0; - } - for (var _i62 = 0; _i62 < numNodes; _i62++) { - for (var _j2 = 0; _j2 < numNodes; _j2++) { - var _n4 = _i62 * numNodes + _j2; - temp[_i62] += matrix[_n4] * eigenvector[_j2]; - } - } - inPlaceSumNormalize(temp); - previous2 = eigenvector; - eigenvector = temp; - temp = previous2; - var diff = 0; - for (var _i7 = 0; _i7 < numNodes; _i7++) { - var delta = previous2[_i7] - eigenvector[_i7]; - diff += delta * delta; - } - if (diff < precision) { - break; - } - } - var res = { - rank: function rank2(node2) { - node2 = cy.collection(node2)[0]; - return eigenvector[nodes2.indexOf(node2)]; - } - }; - return res; - } - // pageRank - }; - var defaults$f = defaults$g({ - root: null, - weight: function weight(edge) { - return 1; - }, - directed: false, - alpha: 0 - }); - var elesfn$n = { - degreeCentralityNormalized: function degreeCentralityNormalized(options2) { - options2 = defaults$f(options2); - var cy = this.cy(); - var nodes2 = this.nodes(); - var numNodes = nodes2.length; - if (!options2.directed) { - var degrees2 = {}; - var maxDegree = 0; - for (var i3 = 0; i3 < numNodes; i3++) { - var node2 = nodes2[i3]; - options2.root = node2; - var currDegree = this.degreeCentrality(options2); - if (maxDegree < currDegree.degree) { - maxDegree = currDegree.degree; - } - degrees2[node2.id()] = currDegree.degree; - } - return { - degree: function degree(node3) { - if (maxDegree === 0) { - return 0; - } - if (string2(node3)) { - node3 = cy.filter(node3); - } - return degrees2[node3.id()] / maxDegree; - } - }; - } else { - var indegrees = {}; - var outdegrees = {}; - var maxIndegree = 0; - var maxOutdegree = 0; - for (var _i6 = 0; _i6 < numNodes; _i6++) { - var _node = nodes2[_i6]; - var id2 = _node.id(); - options2.root = _node; - var _currDegree = this.degreeCentrality(options2); - if (maxIndegree < _currDegree.indegree) - maxIndegree = _currDegree.indegree; - if (maxOutdegree < _currDegree.outdegree) - maxOutdegree = _currDegree.outdegree; - indegrees[id2] = _currDegree.indegree; - outdegrees[id2] = _currDegree.outdegree; - } - return { - indegree: function indegree(node3) { - if (maxIndegree == 0) { - return 0; - } - if (string2(node3)) { - node3 = cy.filter(node3); - } - return indegrees[node3.id()] / maxIndegree; - }, - outdegree: function outdegree(node3) { - if (maxOutdegree === 0) { - return 0; - } - if (string2(node3)) { - node3 = cy.filter(node3); - } - return outdegrees[node3.id()] / maxOutdegree; - } - }; - } - }, - // degreeCentralityNormalized - // Implemented from the algorithm in Opsahl's paper - // "Node centrality in weighted networks: Generalizing degree and shortest paths" - // check the heading 2 "Degree" - degreeCentrality: function degreeCentrality(options2) { - options2 = defaults$f(options2); - var cy = this.cy(); - var callingEles = this; - var _options = options2, root3 = _options.root, weight = _options.weight, directed = _options.directed, alpha = _options.alpha; - root3 = cy.collection(root3)[0]; - if (!directed) { - var connEdges = root3.connectedEdges().intersection(callingEles); - var k = connEdges.length; - var s = 0; - for (var i3 = 0; i3 < connEdges.length; i3++) { - s += weight(connEdges[i3]); - } - return { - degree: Math.pow(k, 1 - alpha) * Math.pow(s, alpha) - }; - } else { - var edges2 = root3.connectedEdges(); - var incoming = edges2.filter(function(edge) { - return edge.target().same(root3) && callingEles.has(edge); - }); - var outgoing = edges2.filter(function(edge) { - return edge.source().same(root3) && callingEles.has(edge); - }); - var k_in = incoming.length; - var k_out = outgoing.length; - var s_in = 0; - var s_out = 0; - for (var _i22 = 0; _i22 < incoming.length; _i22++) { - s_in += weight(incoming[_i22]); - } - for (var _i32 = 0; _i32 < outgoing.length; _i32++) { - s_out += weight(outgoing[_i32]); - } - return { - indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha), - outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha) - }; - } - } - // degreeCentrality - }; - elesfn$n.dc = elesfn$n.degreeCentrality; - elesfn$n.dcn = elesfn$n.degreeCentralityNormalised = elesfn$n.degreeCentralityNormalized; - var defaults$e = defaults$g({ - harmonic: true, - weight: function weight() { - return 1; - }, - directed: false, - root: null - }); - var elesfn$m = { - closenessCentralityNormalized: function closenessCentralityNormalized(options2) { - var _defaults = defaults$e(options2), harmonic = _defaults.harmonic, weight = _defaults.weight, directed = _defaults.directed; - var cy = this.cy(); - var closenesses = {}; - var maxCloseness = 0; - var nodes2 = this.nodes(); - var fw = this.floydWarshall({ - weight, - directed - }); - for (var i3 = 0; i3 < nodes2.length; i3++) { - var currCloseness = 0; - var node_i = nodes2[i3]; - for (var j = 0; j < nodes2.length; j++) { - if (i3 !== j) { - var d = fw.distance(node_i, nodes2[j]); - if (harmonic) { - currCloseness += 1 / d; - } else { - currCloseness += d; - } - } - } - if (!harmonic) { - currCloseness = 1 / currCloseness; - } - if (maxCloseness < currCloseness) { - maxCloseness = currCloseness; - } - closenesses[node_i.id()] = currCloseness; - } - return { - closeness: function closeness(node2) { - if (maxCloseness == 0) { - return 0; - } - if (string2(node2)) { - node2 = cy.filter(node2)[0].id(); - } else { - node2 = node2.id(); - } - return closenesses[node2] / maxCloseness; - } - }; - }, - // Implemented from pseudocode from wikipedia - closenessCentrality: function closenessCentrality(options2) { - var _defaults2 = defaults$e(options2), root3 = _defaults2.root, weight = _defaults2.weight, directed = _defaults2.directed, harmonic = _defaults2.harmonic; - root3 = this.filter(root3)[0]; - var dijkstra = this.dijkstra({ - root: root3, - weight, - directed - }); - var totalDistance = 0; - var nodes2 = this.nodes(); - for (var i3 = 0; i3 < nodes2.length; i3++) { - var n = nodes2[i3]; - if (!n.same(root3)) { - var d = dijkstra.distanceTo(n); - if (harmonic) { - totalDistance += 1 / d; - } else { - totalDistance += d; - } - } - } - return harmonic ? totalDistance : 1 / totalDistance; - } - // closenessCentrality - }; - elesfn$m.cc = elesfn$m.closenessCentrality; - elesfn$m.ccn = elesfn$m.closenessCentralityNormalised = elesfn$m.closenessCentralityNormalized; - var defaults$d = defaults$g({ - weight: null, - directed: false - }); - var elesfn$l = { - // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes - betweennessCentrality: function betweennessCentrality(options2) { - var _defaults = defaults$d(options2), directed = _defaults.directed, weight = _defaults.weight; - var weighted = weight != null; - var cy = this.cy(); - var V = this.nodes(); - var A = {}; - var _C = {}; - var max3 = 0; - var C = { - set: function set3(key, val) { - _C[key] = val; - if (val > max3) { - max3 = val; - } - }, - get: function get3(key) { - return _C[key]; - } - }; - for (var i3 = 0; i3 < V.length; i3++) { - var v = V[i3]; - var vid = v.id(); - if (directed) { - A[vid] = v.outgoers().nodes(); - } else { - A[vid] = v.openNeighborhood().nodes(); - } - C.set(vid, 0); - } - var _loop = function _loop2(s2) { - var sid = V[s2].id(); - var S2 = []; - var P = {}; - var g = {}; - var d = {}; - var Q = new heap(function(a, b) { - return d[a] - d[b]; - }); - for (var _i6 = 0; _i6 < V.length; _i6++) { - var _vid = V[_i6].id(); - P[_vid] = []; - g[_vid] = 0; - d[_vid] = Infinity; - } - g[sid] = 1; - d[sid] = 0; - Q.push(sid); - while (!Q.empty()) { - var _v = Q.pop(); - S2.push(_v); - if (weighted) { - for (var j = 0; j < A[_v].length; j++) { - var w2 = A[_v][j]; - var vEle = cy.getElementById(_v); - var edge = void 0; - if (vEle.edgesTo(w2).length > 0) { - edge = vEle.edgesTo(w2)[0]; - } else { - edge = w2.edgesTo(vEle)[0]; - } - var edgeWeight = weight(edge); - w2 = w2.id(); - if (d[w2] > d[_v] + edgeWeight) { - d[w2] = d[_v] + edgeWeight; - if (Q.nodes.indexOf(w2) < 0) { - Q.push(w2); - } else { - Q.updateItem(w2); - } - g[w2] = 0; - P[w2] = []; - } - if (d[w2] == d[_v] + edgeWeight) { - g[w2] = g[w2] + g[_v]; - P[w2].push(_v); - } - } - } else { - for (var _j = 0; _j < A[_v].length; _j++) { - var _w = A[_v][_j].id(); - if (d[_w] == Infinity) { - Q.push(_w); - d[_w] = d[_v] + 1; - } - if (d[_w] == d[_v] + 1) { - g[_w] = g[_w] + g[_v]; - P[_w].push(_v); - } - } - } - } - var e = {}; - for (var _i22 = 0; _i22 < V.length; _i22++) { - e[V[_i22].id()] = 0; - } - while (S2.length > 0) { - var _w2 = S2.pop(); - for (var _j2 = 0; _j2 < P[_w2].length; _j2++) { - var _v2 = P[_w2][_j2]; - e[_v2] = e[_v2] + g[_v2] / g[_w2] * (1 + e[_w2]); - } - if (_w2 != V[s2].id()) { - C.set(_w2, C.get(_w2) + e[_w2]); - } - } - }; - for (var s = 0; s < V.length; s++) { - _loop(s); - } - var ret = { - betweenness: function betweenness(node2) { - var id2 = cy.collection(node2).id(); - return C.get(id2); - }, - betweennessNormalized: function betweennessNormalized(node2) { - if (max3 == 0) { - return 0; - } - var id2 = cy.collection(node2).id(); - return C.get(id2) / max3; - } - }; - ret.betweennessNormalised = ret.betweennessNormalized; - return ret; - } - // betweennessCentrality - }; - elesfn$l.bc = elesfn$l.betweennessCentrality; - var defaults$c = defaults$g({ - expandFactor: 2, - // affects time of computation and cluster granularity to some extent: M * M - inflateFactor: 2, - // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j) - multFactor: 1, - // optional self loops for each node. Use a neutral value to improve cluster computations. - maxIterations: 20, - // maximum number of iterations of the MCL algorithm in a single run - attributes: [ - // attributes/features used to group nodes, ie. similarity values between nodes - function(edge) { - return 1; - } - ] - }); - var setOptions$3 = function setOptions3(options2) { - return defaults$c(options2); - }; - var getSimilarity$1 = function getSimilarity2(edge, attributes) { - var total = 0; - for (var i3 = 0; i3 < attributes.length; i3++) { - total += attributes[i3](edge); - } - return total; - }; - var addLoops = function addLoops2(M, n, val) { - for (var i3 = 0; i3 < n; i3++) { - M[i3 * n + i3] = val; - } - }; - var normalize2 = function normalize3(M, n) { - var sum2; - for (var col = 0; col < n; col++) { - sum2 = 0; - for (var row = 0; row < n; row++) { - sum2 += M[row * n + col]; - } - for (var _row = 0; _row < n; _row++) { - M[_row * n + col] = M[_row * n + col] / sum2; - } - } - }; - var mmult = function mmult2(A, B, n) { - var C = new Array(n * n); - for (var i3 = 0; i3 < n; i3++) { - for (var j = 0; j < n; j++) { - C[i3 * n + j] = 0; - } - for (var k = 0; k < n; k++) { - for (var _j = 0; _j < n; _j++) { - C[i3 * n + _j] += A[i3 * n + k] * B[k * n + _j]; - } - } - } - return C; - }; - var expand = function expand2(M, n, expandFactor) { - var _M = M.slice(0); - for (var p2 = 1; p2 < expandFactor; p2++) { - M = mmult(M, _M, n); - } - return M; - }; - var inflate = function inflate2(M, n, inflateFactor) { - var _M = new Array(n * n); - for (var i3 = 0; i3 < n * n; i3++) { - _M[i3] = Math.pow(M[i3], inflateFactor); - } - normalize2(_M, n); - return _M; - }; - var hasConverged = function hasConverged2(M, _M, n2, roundFactor) { - for (var i3 = 0; i3 < n2; i3++) { - var v1 = Math.round(M[i3] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor); - var v2 = Math.round(_M[i3] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor); - if (v1 !== v2) { - return false; - } - } - return true; - }; - var assign$2 = function assign2(M, n, nodes2, cy) { - var clusters = []; - for (var i3 = 0; i3 < n; i3++) { - var cluster = []; - for (var j = 0; j < n; j++) { - if (Math.round(M[i3 * n + j] * 1e3) / 1e3 > 0) { - cluster.push(nodes2[j]); - } - } - if (cluster.length !== 0) { - clusters.push(cy.collection(cluster)); - } - } - return clusters; - }; - var isDuplicate = function isDuplicate2(c1, c2) { - for (var i3 = 0; i3 < c1.length; i3++) { - if (!c2[i3] || c1[i3].id() !== c2[i3].id()) { - return false; - } - } - return true; - }; - var removeDuplicates = function removeDuplicates2(clusters) { - for (var i3 = 0; i3 < clusters.length; i3++) { - for (var j = 0; j < clusters.length; j++) { - if (i3 != j && isDuplicate(clusters[i3], clusters[j])) { - clusters.splice(j, 1); - } - } - } - return clusters; - }; - var markovClustering = function markovClustering2(options2) { - var nodes2 = this.nodes(); - var edges2 = this.edges(); - var cy = this.cy(); - var opts = setOptions$3(options2); - var id2position = {}; - for (var i3 = 0; i3 < nodes2.length; i3++) { - id2position[nodes2[i3].id()] = i3; - } - var n = nodes2.length, n2 = n * n; - var M = new Array(n2), _M; - for (var _i6 = 0; _i6 < n2; _i6++) { - M[_i6] = 0; - } - for (var e = 0; e < edges2.length; e++) { - var edge = edges2[e]; - var _i22 = id2position[edge.source().id()]; - var j = id2position[edge.target().id()]; - var sim = getSimilarity$1(edge, opts.attributes); - M[_i22 * n + j] += sim; - M[j * n + _i22] += sim; - } - addLoops(M, n, opts.multFactor); - normalize2(M, n); - var isStillMoving = true; - var iterations = 0; - while (isStillMoving && iterations < opts.maxIterations) { - isStillMoving = false; - _M = expand(M, n, opts.expandFactor); - M = inflate(_M, n, opts.inflateFactor); - if (!hasConverged(M, _M, n2, 4)) { - isStillMoving = true; - } - iterations++; - } - var clusters = assign$2(M, n, nodes2, cy); - clusters = removeDuplicates(clusters); - return clusters; - }; - var markovClustering$1 = { - markovClustering, - mcl: markovClustering - }; - var identity2 = function identity3(x2) { - return x2; - }; - var absDiff = function absDiff2(p2, q) { - return Math.abs(q - p2); - }; - var addAbsDiff = function addAbsDiff2(total, p2, q) { - return total + absDiff(p2, q); - }; - var addSquaredDiff = function addSquaredDiff2(total, p2, q) { - return total + Math.pow(q - p2, 2); - }; - var sqrt3 = function sqrt4(x2) { - return Math.sqrt(x2); - }; - var maxAbsDiff = function maxAbsDiff2(currentMax, p2, q) { - return Math.max(currentMax, absDiff(p2, q)); - }; - var getDistance = function getDistance2(length2, getP, getQ, init2, visit) { - var post = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : identity2; - var ret = init2; - var p2, q; - for (var dim = 0; dim < length2; dim++) { - p2 = getP(dim); - q = getQ(dim); - ret = visit(ret, p2, q); - } - return post(ret); - }; - var distances = { - euclidean: function euclidean(length2, getP, getQ) { - if (length2 >= 2) { - return getDistance(length2, getP, getQ, 0, addSquaredDiff, sqrt3); - } else { - return getDistance(length2, getP, getQ, 0, addAbsDiff); - } - }, - squaredEuclidean: function squaredEuclidean(length2, getP, getQ) { - return getDistance(length2, getP, getQ, 0, addSquaredDiff); - }, - manhattan: function manhattan(length2, getP, getQ) { - return getDistance(length2, getP, getQ, 0, addAbsDiff); - }, - max: function max3(length2, getP, getQ) { - return getDistance(length2, getP, getQ, -Infinity, maxAbsDiff); - } - }; - distances["squared-euclidean"] = distances["squaredEuclidean"]; - distances["squaredeuclidean"] = distances["squaredEuclidean"]; - function clusteringDistance(method, length2, getP, getQ, nodeP, nodeQ) { - var impl2; - if (fn$6(method)) { - impl2 = method; - } else { - impl2 = distances[method] || distances.euclidean; - } - if (length2 === 0 && fn$6(method)) { - return impl2(nodeP, nodeQ); - } else { - return impl2(length2, getP, getQ, nodeP, nodeQ); - } - } - var defaults$b = defaults$g({ - k: 2, - m: 2, - sensitivityThreshold: 1e-4, - distance: "euclidean", - maxIterations: 10, - attributes: [], - testMode: false, - testCentroids: null - }); - var setOptions$2 = function setOptions3(options2) { - return defaults$b(options2); - }; - var getDist = function getDist2(type2, node2, centroid, attributes, mode) { - var noNodeP = mode !== "kMedoids"; - var getP = noNodeP ? function(i3) { - return centroid[i3]; - } : function(i3) { - return attributes[i3](centroid); - }; - var getQ = function getQ2(i3) { - return attributes[i3](node2); - }; - var nodeP = centroid; - var nodeQ = node2; - return clusteringDistance(type2, attributes.length, getP, getQ, nodeP, nodeQ); - }; - var randomCentroids = function randomCentroids2(nodes2, k, attributes) { - var ndim = attributes.length; - var min3 = new Array(ndim); - var max3 = new Array(ndim); - var centroids = new Array(k); - var centroid = null; - for (var i3 = 0; i3 < ndim; i3++) { - min3[i3] = nodes2.min(attributes[i3]).value; - max3[i3] = nodes2.max(attributes[i3]).value; - } - for (var c2 = 0; c2 < k; c2++) { - centroid = []; - for (var _i6 = 0; _i6 < ndim; _i6++) { - centroid[_i6] = Math.random() * (max3[_i6] - min3[_i6]) + min3[_i6]; - } - centroids[c2] = centroid; - } - return centroids; - }; - var classify = function classify2(node2, centroids, distance2, attributes, type2) { - var min3 = Infinity; - var index2 = 0; - for (var i3 = 0; i3 < centroids.length; i3++) { - var dist3 = getDist(distance2, node2, centroids[i3], attributes, type2); - if (dist3 < min3) { - min3 = dist3; - index2 = i3; - } - } - return index2; - }; - var buildCluster = function buildCluster2(centroid, nodes2, assignment) { - var cluster = []; - var node2 = null; - for (var n = 0; n < nodes2.length; n++) { - node2 = nodes2[n]; - if (assignment[node2.id()] === centroid) { - cluster.push(node2); - } - } - return cluster; - }; - var haveValuesConverged = function haveValuesConverged2(v1, v2, sensitivityThreshold) { - return Math.abs(v2 - v1) <= sensitivityThreshold; - }; - var haveMatricesConverged = function haveMatricesConverged2(v1, v2, sensitivityThreshold) { - for (var i3 = 0; i3 < v1.length; i3++) { - for (var j = 0; j < v1[i3].length; j++) { - var diff = Math.abs(v1[i3][j] - v2[i3][j]); - if (diff > sensitivityThreshold) { - return false; - } - } - } - return true; - }; - var seenBefore = function seenBefore2(node2, medoids, n) { - for (var i3 = 0; i3 < n; i3++) { - if (node2 === medoids[i3]) - return true; - } - return false; - }; - var randomMedoids = function randomMedoids2(nodes2, k) { - var medoids = new Array(k); - if (nodes2.length < 50) { - for (var i3 = 0; i3 < k; i3++) { - var node2 = nodes2[Math.floor(Math.random() * nodes2.length)]; - while (seenBefore(node2, medoids, i3)) { - node2 = nodes2[Math.floor(Math.random() * nodes2.length)]; - } - medoids[i3] = node2; - } - } else { - for (var _i22 = 0; _i22 < k; _i22++) { - medoids[_i22] = nodes2[Math.floor(Math.random() * nodes2.length)]; - } - } - return medoids; - }; - var findCost = function findCost2(potentialNewMedoid, cluster, attributes) { - var cost = 0; - for (var n = 0; n < cluster.length; n++) { - cost += getDist("manhattan", cluster[n], potentialNewMedoid, attributes, "kMedoids"); - } - return cost; - }; - var kMeans = function kMeans2(options2) { - var cy = this.cy(); - var nodes2 = this.nodes(); - var node2 = null; - var opts = setOptions$2(options2); - var clusters = new Array(opts.k); - var assignment = {}; - var centroids; - if (opts.testMode) { - if (typeof opts.testCentroids === "number") { - opts.testCentroids; - centroids = randomCentroids(nodes2, opts.k, opts.attributes); - } else if (_typeof(opts.testCentroids) === "object") { - centroids = opts.testCentroids; - } else { - centroids = randomCentroids(nodes2, opts.k, opts.attributes); - } - } else { - centroids = randomCentroids(nodes2, opts.k, opts.attributes); - } - var isStillMoving = true; - var iterations = 0; - while (isStillMoving && iterations < opts.maxIterations) { - for (var n = 0; n < nodes2.length; n++) { - node2 = nodes2[n]; - assignment[node2.id()] = classify(node2, centroids, opts.distance, opts.attributes, "kMeans"); - } - isStillMoving = false; - for (var c2 = 0; c2 < opts.k; c2++) { - var cluster = buildCluster(c2, nodes2, assignment); - if (cluster.length === 0) { - continue; - } - var ndim = opts.attributes.length; - var centroid = centroids[c2]; - var newCentroid = new Array(ndim); - var sum2 = new Array(ndim); - for (var d = 0; d < ndim; d++) { - sum2[d] = 0; - for (var i3 = 0; i3 < cluster.length; i3++) { - node2 = cluster[i3]; - sum2[d] += opts.attributes[d](node2); - } - newCentroid[d] = sum2[d] / cluster.length; - if (!haveValuesConverged(newCentroid[d], centroid[d], opts.sensitivityThreshold)) { - isStillMoving = true; - } - } - centroids[c2] = newCentroid; - clusters[c2] = cy.collection(cluster); - } - iterations++; - } - return clusters; - }; - var kMedoids = function kMedoids2(options2) { - var cy = this.cy(); - var nodes2 = this.nodes(); - var node2 = null; - var opts = setOptions$2(options2); - var clusters = new Array(opts.k); - var medoids; - var assignment = {}; - var curCost; - var minCosts = new Array(opts.k); - if (opts.testMode) { - if (typeof opts.testCentroids === "number") - ; - else if (_typeof(opts.testCentroids) === "object") { - medoids = opts.testCentroids; - } else { - medoids = randomMedoids(nodes2, opts.k); - } - } else { - medoids = randomMedoids(nodes2, opts.k); - } - var isStillMoving = true; - var iterations = 0; - while (isStillMoving && iterations < opts.maxIterations) { - for (var n = 0; n < nodes2.length; n++) { - node2 = nodes2[n]; - assignment[node2.id()] = classify(node2, medoids, opts.distance, opts.attributes, "kMedoids"); - } - isStillMoving = false; - for (var m = 0; m < medoids.length; m++) { - var cluster = buildCluster(m, nodes2, assignment); - if (cluster.length === 0) { - continue; - } - minCosts[m] = findCost(medoids[m], cluster, opts.attributes); - for (var _n = 0; _n < cluster.length; _n++) { - curCost = findCost(cluster[_n], cluster, opts.attributes); - if (curCost < minCosts[m]) { - minCosts[m] = curCost; - medoids[m] = cluster[_n]; - isStillMoving = true; - } - } - clusters[m] = cy.collection(cluster); - } - iterations++; - } - return clusters; - }; - var updateCentroids = function updateCentroids2(centroids, nodes2, U, weight, opts) { - var numerator, denominator; - for (var n = 0; n < nodes2.length; n++) { - for (var c2 = 0; c2 < centroids.length; c2++) { - weight[n][c2] = Math.pow(U[n][c2], opts.m); - } - } - for (var _c = 0; _c < centroids.length; _c++) { - for (var dim = 0; dim < opts.attributes.length; dim++) { - numerator = 0; - denominator = 0; - for (var _n2 = 0; _n2 < nodes2.length; _n2++) { - numerator += weight[_n2][_c] * opts.attributes[dim](nodes2[_n2]); - denominator += weight[_n2][_c]; - } - centroids[_c][dim] = numerator / denominator; - } - } - }; - var updateMembership = function updateMembership2(U, _U, centroids, nodes2, opts) { - for (var i3 = 0; i3 < U.length; i3++) { - _U[i3] = U[i3].slice(); - } - var sum2, numerator, denominator; - var pow = 2 / (opts.m - 1); - for (var c2 = 0; c2 < centroids.length; c2++) { - for (var n = 0; n < nodes2.length; n++) { - sum2 = 0; - for (var k = 0; k < centroids.length; k++) { - numerator = getDist(opts.distance, nodes2[n], centroids[c2], opts.attributes, "cmeans"); - denominator = getDist(opts.distance, nodes2[n], centroids[k], opts.attributes, "cmeans"); - sum2 += Math.pow(numerator / denominator, pow); - } - U[n][c2] = 1 / sum2; - } - } - }; - var assign$1 = function assign2(nodes2, U, opts, cy) { - var clusters = new Array(opts.k); - for (var c2 = 0; c2 < clusters.length; c2++) { - clusters[c2] = []; - } - var max3; - var index2; - for (var n = 0; n < U.length; n++) { - max3 = -Infinity; - index2 = -1; - for (var _c2 = 0; _c2 < U[0].length; _c2++) { - if (U[n][_c2] > max3) { - max3 = U[n][_c2]; - index2 = _c2; - } - } - clusters[index2].push(nodes2[n]); - } - for (var _c3 = 0; _c3 < clusters.length; _c3++) { - clusters[_c3] = cy.collection(clusters[_c3]); - } - return clusters; - }; - var fuzzyCMeans = function fuzzyCMeans2(options2) { - var cy = this.cy(); - var nodes2 = this.nodes(); - var opts = setOptions$2(options2); - var clusters; - var centroids; - var U; - var _U; - var weight; - _U = new Array(nodes2.length); - for (var i3 = 0; i3 < nodes2.length; i3++) { - _U[i3] = new Array(opts.k); - } - U = new Array(nodes2.length); - for (var _i32 = 0; _i32 < nodes2.length; _i32++) { - U[_i32] = new Array(opts.k); - } - for (var _i42 = 0; _i42 < nodes2.length; _i42++) { - var total = 0; - for (var j = 0; j < opts.k; j++) { - U[_i42][j] = Math.random(); - total += U[_i42][j]; - } - for (var _j = 0; _j < opts.k; _j++) { - U[_i42][_j] = U[_i42][_j] / total; - } - } - centroids = new Array(opts.k); - for (var _i52 = 0; _i52 < opts.k; _i52++) { - centroids[_i52] = new Array(opts.attributes.length); - } - weight = new Array(nodes2.length); - for (var _i6 = 0; _i6 < nodes2.length; _i6++) { - weight[_i6] = new Array(opts.k); - } - var isStillMoving = true; - var iterations = 0; - while (isStillMoving && iterations < opts.maxIterations) { - isStillMoving = false; - updateCentroids(centroids, nodes2, U, weight, opts); - updateMembership(U, _U, centroids, nodes2, opts); - if (!haveMatricesConverged(U, _U, opts.sensitivityThreshold)) { - isStillMoving = true; - } - iterations++; - } - clusters = assign$1(nodes2, U, opts, cy); - return { - clusters, - degreeOfMembership: U - }; - }; - var kClustering = { - kMeans, - kMedoids, - fuzzyCMeans, - fcm: fuzzyCMeans - }; - var defaults$a = defaults$g({ - distance: "euclidean", - // distance metric to compare nodes - linkage: "min", - // linkage criterion : how to determine the distance between clusters of nodes - mode: "threshold", - // mode:'threshold' => clusters must be threshold distance apart - threshold: Infinity, - // the distance threshold - // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters - addDendrogram: false, - // whether to add the dendrogram to the graph for viz - dendrogramDepth: 0, - // depth at which dendrogram branches are merged into the returned clusters - attributes: [] - // array of attr functions - }); - var linkageAliases = { - "single": "min", - "complete": "max" - }; - var setOptions$1 = function setOptions3(options2) { - var opts = defaults$a(options2); - var preferredAlias = linkageAliases[opts.linkage]; - if (preferredAlias != null) { - opts.linkage = preferredAlias; - } - return opts; - }; - var mergeClosest = function mergeClosest2(clusters, index2, dists, mins, opts) { - var minKey = 0; - var min3 = Infinity; - var dist3; - var attrs = opts.attributes; - var getDist2 = function getDist3(n1, n2) { - return clusteringDistance(opts.distance, attrs.length, function(i4) { - return attrs[i4](n1); - }, function(i4) { - return attrs[i4](n2); - }, n1, n2); - }; - for (var i3 = 0; i3 < clusters.length; i3++) { - var key = clusters[i3].key; - var _dist = dists[key][mins[key]]; - if (_dist < min3) { - minKey = key; - min3 = _dist; - } - } - if (opts.mode === "threshold" && min3 >= opts.threshold || opts.mode === "dendrogram" && clusters.length === 1) { - return false; - } - var c1 = index2[minKey]; - var c2 = index2[mins[minKey]]; - var merged; - if (opts.mode === "dendrogram") { - merged = { - left: c1, - right: c2, - key: c1.key - }; - } else { - merged = { - value: c1.value.concat(c2.value), - key: c1.key - }; - } - clusters[c1.index] = merged; - clusters.splice(c2.index, 1); - index2[c1.key] = merged; - for (var _i6 = 0; _i6 < clusters.length; _i6++) { - var cur = clusters[_i6]; - if (c1.key === cur.key) { - dist3 = Infinity; - } else if (opts.linkage === "min") { - dist3 = dists[c1.key][cur.key]; - if (dists[c1.key][cur.key] > dists[c2.key][cur.key]) { - dist3 = dists[c2.key][cur.key]; - } - } else if (opts.linkage === "max") { - dist3 = dists[c1.key][cur.key]; - if (dists[c1.key][cur.key] < dists[c2.key][cur.key]) { - dist3 = dists[c2.key][cur.key]; - } - } else if (opts.linkage === "mean") { - dist3 = (dists[c1.key][cur.key] * c1.size + dists[c2.key][cur.key] * c2.size) / (c1.size + c2.size); - } else { - if (opts.mode === "dendrogram") - dist3 = getDist2(cur.value, c1.value); - else - dist3 = getDist2(cur.value[0], c1.value[0]); - } - dists[c1.key][cur.key] = dists[cur.key][c1.key] = dist3; - } - for (var _i22 = 0; _i22 < clusters.length; _i22++) { - var key1 = clusters[_i22].key; - if (mins[key1] === c1.key || mins[key1] === c2.key) { - var _min = key1; - for (var j = 0; j < clusters.length; j++) { - var key2 = clusters[j].key; - if (dists[key1][key2] < dists[key1][_min]) { - _min = key2; - } - } - mins[key1] = _min; - } - clusters[_i22].index = _i22; - } - c1.key = c2.key = c1.index = c2.index = null; - return true; - }; - var getAllChildren = function getAllChildren2(root3, arr, cy) { - if (!root3) - return; - if (root3.value) { - arr.push(root3.value); - } else { - if (root3.left) - getAllChildren2(root3.left, arr); - if (root3.right) - getAllChildren2(root3.right, arr); - } - }; - var buildDendrogram = function buildDendrogram2(root3, cy) { - if (!root3) - return ""; - if (root3.left && root3.right) { - var leftStr = buildDendrogram2(root3.left, cy); - var rightStr = buildDendrogram2(root3.right, cy); - var node2 = cy.add({ - group: "nodes", - data: { - id: leftStr + "," + rightStr - } - }); - cy.add({ - group: "edges", - data: { - source: leftStr, - target: node2.id() - } - }); - cy.add({ - group: "edges", - data: { - source: rightStr, - target: node2.id() - } - }); - return node2.id(); - } else if (root3.value) { - return root3.value.id(); - } - }; - var buildClustersFromTree = function buildClustersFromTree2(root3, k, cy) { - if (!root3) - return []; - var left2 = [], right2 = [], leaves = []; - if (k === 0) { - if (root3.left) - getAllChildren(root3.left, left2); - if (root3.right) - getAllChildren(root3.right, right2); - leaves = left2.concat(right2); - return [cy.collection(leaves)]; - } else if (k === 1) { - if (root3.value) { - return [cy.collection(root3.value)]; - } else { - if (root3.left) - getAllChildren(root3.left, left2); - if (root3.right) - getAllChildren(root3.right, right2); - return [cy.collection(left2), cy.collection(right2)]; - } - } else { - if (root3.value) { - return [cy.collection(root3.value)]; - } else { - if (root3.left) - left2 = buildClustersFromTree2(root3.left, k - 1, cy); - if (root3.right) - right2 = buildClustersFromTree2(root3.right, k - 1, cy); - return left2.concat(right2); - } - } - }; - var hierarchicalClustering = function hierarchicalClustering2(options2) { - var cy = this.cy(); - var nodes2 = this.nodes(); - var opts = setOptions$1(options2); - var attrs = opts.attributes; - var getDist2 = function getDist3(n1, n2) { - return clusteringDistance(opts.distance, attrs.length, function(i4) { - return attrs[i4](n1); - }, function(i4) { - return attrs[i4](n2); - }, n1, n2); - }; - var clusters = []; - var dists = []; - var mins = []; - var index2 = []; - for (var n = 0; n < nodes2.length; n++) { - var cluster = { - value: opts.mode === "dendrogram" ? nodes2[n] : [nodes2[n]], - key: n, - index: n - }; - clusters[n] = cluster; - index2[n] = cluster; - dists[n] = []; - mins[n] = 0; - } - for (var i3 = 0; i3 < clusters.length; i3++) { - for (var j = 0; j <= i3; j++) { - var dist3 = void 0; - if (opts.mode === "dendrogram") { - dist3 = i3 === j ? Infinity : getDist2(clusters[i3].value, clusters[j].value); - } else { - dist3 = i3 === j ? Infinity : getDist2(clusters[i3].value[0], clusters[j].value[0]); - } - dists[i3][j] = dist3; - dists[j][i3] = dist3; - if (dist3 < dists[i3][mins[i3]]) { - mins[i3] = j; - } - } - } - var merged = mergeClosest(clusters, index2, dists, mins, opts); - while (merged) { - merged = mergeClosest(clusters, index2, dists, mins, opts); - } - var retClusters; - if (opts.mode === "dendrogram") { - retClusters = buildClustersFromTree(clusters[0], opts.dendrogramDepth, cy); - if (opts.addDendrogram) - buildDendrogram(clusters[0], cy); - } else { - retClusters = new Array(clusters.length); - clusters.forEach(function(cluster2, i4) { - cluster2.key = cluster2.index = null; - retClusters[i4] = cy.collection(cluster2.value); - }); - } - return retClusters; - }; - var hierarchicalClustering$1 = { - hierarchicalClustering, - hca: hierarchicalClustering - }; - var defaults$9 = defaults$g({ - distance: "euclidean", - // distance metric to compare attributes between two nodes - preference: "median", - // suitability of a data point to serve as an exemplar - damping: 0.8, - // damping factor between [0.5, 1) - maxIterations: 1e3, - // max number of iterations to run - minIterations: 100, - // min number of iterations to run in order for clustering to stop - attributes: [ - // functions to quantify the similarity between any two points - // e.g. node => node.data('weight') - ] - }); - var setOptions2 = function setOptions3(options2) { - var dmp = options2.damping; - var pref = options2.preference; - if (!(0.5 <= dmp && dmp < 1)) { - error("Damping must range on [0.5, 1). Got: ".concat(dmp)); - } - var validPrefs = ["median", "mean", "min", "max"]; - if (!(validPrefs.some(function(v) { - return v === pref; - }) || number$12(pref))) { - error("Preference must be one of [".concat(validPrefs.map(function(p2) { - return "'".concat(p2, "'"); - }).join(", "), "] or a number. Got: ").concat(pref)); - } - return defaults$9(options2); - }; - var getSimilarity = function getSimilarity2(type2, n1, n2, attributes) { - var attr = function attr2(n, i3) { - return attributes[i3](n); - }; - return -clusteringDistance(type2, attributes.length, function(i3) { - return attr(n1, i3); - }, function(i3) { - return attr(n2, i3); - }, n1, n2); - }; - var getPreference = function getPreference2(S2, preference) { - var p2 = null; - if (preference === "median") { - p2 = median(S2); - } else if (preference === "mean") { - p2 = mean(S2); - } else if (preference === "min") { - p2 = min2(S2); - } else if (preference === "max") { - p2 = max2(S2); - } else { - p2 = preference; - } - return p2; - }; - var findExemplars = function findExemplars2(n, R, A) { - var indices = []; - for (var i3 = 0; i3 < n; i3++) { - if (R[i3 * n + i3] + A[i3 * n + i3] > 0) { - indices.push(i3); - } - } - return indices; - }; - var assignClusters = function assignClusters2(n, S2, exemplars) { - var clusters = []; - for (var i3 = 0; i3 < n; i3++) { - var index2 = -1; - var max3 = -Infinity; - for (var ei = 0; ei < exemplars.length; ei++) { - var e = exemplars[ei]; - if (S2[i3 * n + e] > max3) { - index2 = e; - max3 = S2[i3 * n + e]; - } - } - if (index2 > 0) { - clusters.push(index2); - } - } - for (var _ei = 0; _ei < exemplars.length; _ei++) { - clusters[exemplars[_ei]] = exemplars[_ei]; - } - return clusters; - }; - var assign = function assign2(n, S2, exemplars) { - var clusters = assignClusters(n, S2, exemplars); - for (var ei = 0; ei < exemplars.length; ei++) { - var ii = []; - for (var c2 = 0; c2 < clusters.length; c2++) { - if (clusters[c2] === exemplars[ei]) { - ii.push(c2); - } - } - var maxI = -1; - var maxSum = -Infinity; - for (var i3 = 0; i3 < ii.length; i3++) { - var sum2 = 0; - for (var j = 0; j < ii.length; j++) { - sum2 += S2[ii[j] * n + ii[i3]]; - } - if (sum2 > maxSum) { - maxI = i3; - maxSum = sum2; - } - } - exemplars[ei] = ii[maxI]; - } - clusters = assignClusters(n, S2, exemplars); - return clusters; - }; - var affinityPropagation = function affinityPropagation2(options2) { - var cy = this.cy(); - var nodes2 = this.nodes(); - var opts = setOptions2(options2); - var id2position = {}; - for (var i3 = 0; i3 < nodes2.length; i3++) { - id2position[nodes2[i3].id()] = i3; - } - var n; - var n2; - var S2; - var p2; - var R; - var A; - n = nodes2.length; - n2 = n * n; - S2 = new Array(n2); - for (var _i6 = 0; _i6 < n2; _i6++) { - S2[_i6] = -Infinity; - } - for (var _i22 = 0; _i22 < n; _i22++) { - for (var j = 0; j < n; j++) { - if (_i22 !== j) { - S2[_i22 * n + j] = getSimilarity(opts.distance, nodes2[_i22], nodes2[j], opts.attributes); - } - } - } - p2 = getPreference(S2, opts.preference); - for (var _i32 = 0; _i32 < n; _i32++) { - S2[_i32 * n + _i32] = p2; - } - R = new Array(n2); - for (var _i42 = 0; _i42 < n2; _i42++) { - R[_i42] = 0; - } - A = new Array(n2); - for (var _i52 = 0; _i52 < n2; _i52++) { - A[_i52] = 0; - } - var old = new Array(n); - var Rp = new Array(n); - var se = new Array(n); - for (var _i62 = 0; _i62 < n; _i62++) { - old[_i62] = 0; - Rp[_i62] = 0; - se[_i62] = 0; - } - var e = new Array(n * opts.minIterations); - for (var _i7 = 0; _i7 < e.length; _i7++) { - e[_i7] = 0; - } - var iter; - for (iter = 0; iter < opts.maxIterations; iter++) { - for (var _i8 = 0; _i8 < n; _i8++) { - var max3 = -Infinity, max22 = -Infinity, maxI = -1, AS = 0; - for (var _j = 0; _j < n; _j++) { - old[_j] = R[_i8 * n + _j]; - AS = A[_i8 * n + _j] + S2[_i8 * n + _j]; - if (AS >= max3) { - max22 = max3; - max3 = AS; - maxI = _j; - } else if (AS > max22) { - max22 = AS; - } - } - for (var _j2 = 0; _j2 < n; _j2++) { - R[_i8 * n + _j2] = (1 - opts.damping) * (S2[_i8 * n + _j2] - max3) + opts.damping * old[_j2]; - } - R[_i8 * n + maxI] = (1 - opts.damping) * (S2[_i8 * n + maxI] - max22) + opts.damping * old[maxI]; - } - for (var _i9 = 0; _i9 < n; _i9++) { - var sum2 = 0; - for (var _j3 = 0; _j3 < n; _j3++) { - old[_j3] = A[_j3 * n + _i9]; - Rp[_j3] = Math.max(0, R[_j3 * n + _i9]); - sum2 += Rp[_j3]; - } - sum2 -= Rp[_i9]; - Rp[_i9] = R[_i9 * n + _i9]; - sum2 += Rp[_i9]; - for (var _j4 = 0; _j4 < n; _j4++) { - A[_j4 * n + _i9] = (1 - opts.damping) * Math.min(0, sum2 - Rp[_j4]) + opts.damping * old[_j4]; - } - A[_i9 * n + _i9] = (1 - opts.damping) * (sum2 - Rp[_i9]) + opts.damping * old[_i9]; - } - var K3 = 0; - for (var _i10 = 0; _i10 < n; _i10++) { - var E = A[_i10 * n + _i10] + R[_i10 * n + _i10] > 0 ? 1 : 0; - e[iter % opts.minIterations * n + _i10] = E; - K3 += E; - } - if (K3 > 0 && (iter >= opts.minIterations - 1 || iter == opts.maxIterations - 1)) { - var _sum = 0; - for (var _i11 = 0; _i11 < n; _i11++) { - se[_i11] = 0; - for (var _j5 = 0; _j5 < opts.minIterations; _j5++) { - se[_i11] += e[_j5 * n + _i11]; - } - if (se[_i11] === 0 || se[_i11] === opts.minIterations) { - _sum++; - } - } - if (_sum === n) { - break; - } - } - } - var exemplarsIndices = findExemplars(n, R, A); - var clusterIndices = assign(n, S2, exemplarsIndices); - var clusters = {}; - for (var c2 = 0; c2 < exemplarsIndices.length; c2++) { - clusters[exemplarsIndices[c2]] = []; - } - for (var _i12 = 0; _i12 < nodes2.length; _i12++) { - var pos = id2position[nodes2[_i12].id()]; - var clusterIndex = clusterIndices[pos]; - if (clusterIndex != null) { - clusters[clusterIndex].push(nodes2[_i12]); - } - } - var retClusters = new Array(exemplarsIndices.length); - for (var _c = 0; _c < exemplarsIndices.length; _c++) { - retClusters[_c] = cy.collection(clusters[exemplarsIndices[_c]]); - } - return retClusters; - }; - var affinityPropagation$1 = { - affinityPropagation, - ap: affinityPropagation - }; - var hierholzerDefaults = defaults$g({ - root: void 0, - directed: false - }); - var elesfn$k = { - hierholzer: function hierholzer(options2) { - if (!plainObject(options2)) { - var args = arguments; - options2 = { - root: args[0], - directed: args[1] - }; - } - var _hierholzerDefaults = hierholzerDefaults(options2), root3 = _hierholzerDefaults.root, directed = _hierholzerDefaults.directed; - var eles = this; - var dflag = false; - var oddIn; - var oddOut; - var startVertex; - if (root3) - startVertex = string2(root3) ? this.filter(root3)[0].id() : root3[0].id(); - var nodes2 = {}; - var edges2 = {}; - if (directed) { - eles.forEach(function(ele) { - var id2 = ele.id(); - if (ele.isNode()) { - var ind = ele.indegree(true); - var outd = ele.outdegree(true); - var d1 = ind - outd; - var d2 = outd - ind; - if (d1 == 1) { - if (oddIn) - dflag = true; - else - oddIn = id2; - } else if (d2 == 1) { - if (oddOut) - dflag = true; - else - oddOut = id2; - } else if (d2 > 1 || d1 > 1) { - dflag = true; - } - nodes2[id2] = []; - ele.outgoers().forEach(function(e) { - if (e.isEdge()) - nodes2[id2].push(e.id()); - }); - } else { - edges2[id2] = [void 0, ele.target().id()]; - } - }); - } else { - eles.forEach(function(ele) { - var id2 = ele.id(); - if (ele.isNode()) { - var d2 = ele.degree(true); - if (d2 % 2) { - if (!oddIn) - oddIn = id2; - else if (!oddOut) - oddOut = id2; - else - dflag = true; - } - nodes2[id2] = []; - ele.connectedEdges().forEach(function(e) { - return nodes2[id2].push(e.id()); - }); - } else { - edges2[id2] = [ele.source().id(), ele.target().id()]; - } - }); - } - var result = { - found: false, - trail: void 0 - }; - if (dflag) - return result; - else if (oddOut && oddIn) { - if (directed) { - if (startVertex && oddOut != startVertex) { - return result; - } - startVertex = oddOut; - } else { - if (startVertex && oddOut != startVertex && oddIn != startVertex) { - return result; - } else if (!startVertex) { - startVertex = oddOut; - } - } - } else { - if (!startVertex) - startVertex = eles[0].id(); - } - var walk = function walk2(v) { - var currentNode = v; - var subtour2 = [v]; - var adj, adjTail, adjHead; - while (nodes2[currentNode].length) { - adj = nodes2[currentNode].shift(); - adjTail = edges2[adj][0]; - adjHead = edges2[adj][1]; - if (currentNode != adjHead) { - nodes2[adjHead] = nodes2[adjHead].filter(function(e) { - return e != adj; - }); - currentNode = adjHead; - } else if (!directed && currentNode != adjTail) { - nodes2[adjTail] = nodes2[adjTail].filter(function(e) { - return e != adj; - }); - currentNode = adjTail; - } - subtour2.unshift(adj); - subtour2.unshift(currentNode); - } - return subtour2; - }; - var trail = []; - var subtour = []; - subtour = walk(startVertex); - while (subtour.length != 1) { - if (nodes2[subtour[0]].length == 0) { - trail.unshift(eles.getElementById(subtour.shift())); - trail.unshift(eles.getElementById(subtour.shift())); - } else { - subtour = walk(subtour.shift()).concat(subtour); - } - } - trail.unshift(eles.getElementById(subtour.shift())); - for (var d in nodes2) { - if (nodes2[d].length) { - return result; - } - } - result.found = true; - result.trail = this.spawn(trail, true); - return result; - } - }; - var hopcroftTarjanBiconnected = function hopcroftTarjanBiconnected2() { - var eles = this; - var nodes2 = {}; - var id2 = 0; - var edgeCount2 = 0; - var components = []; - var stack = []; - var visitedEdges = {}; - var buildComponent = function buildComponent2(x2, y2) { - var i3 = stack.length - 1; - var cutset = []; - var component = eles.spawn(); - while (stack[i3].x != x2 || stack[i3].y != y2) { - cutset.push(stack.pop().edge); - i3--; - } - cutset.push(stack.pop().edge); - cutset.forEach(function(edge) { - var connectedNodes = edge.connectedNodes().intersection(eles); - component.merge(edge); - connectedNodes.forEach(function(node2) { - var nodeId = node2.id(); - var connectedEdges = node2.connectedEdges().intersection(eles); - component.merge(node2); - if (!nodes2[nodeId].cutVertex) { - component.merge(connectedEdges); - } else { - component.merge(connectedEdges.filter(function(edge2) { - return edge2.isLoop(); - })); - } - }); - }); - components.push(component); - }; - var biconnectedSearch = function biconnectedSearch2(root3, currentNode, parent) { - if (root3 === parent) - edgeCount2 += 1; - nodes2[currentNode] = { - id: id2, - low: id2++, - cutVertex: false - }; - var edges2 = eles.getElementById(currentNode).connectedEdges().intersection(eles); - if (edges2.size() === 0) { - components.push(eles.spawn(eles.getElementById(currentNode))); - } else { - var sourceId, targetId, otherNodeId, edgeId; - edges2.forEach(function(edge) { - sourceId = edge.source().id(); - targetId = edge.target().id(); - otherNodeId = sourceId === currentNode ? targetId : sourceId; - if (otherNodeId !== parent) { - edgeId = edge.id(); - if (!visitedEdges[edgeId]) { - visitedEdges[edgeId] = true; - stack.push({ - x: currentNode, - y: otherNodeId, - edge - }); - } - if (!(otherNodeId in nodes2)) { - biconnectedSearch2(root3, otherNodeId, currentNode); - nodes2[currentNode].low = Math.min(nodes2[currentNode].low, nodes2[otherNodeId].low); - if (nodes2[currentNode].id <= nodes2[otherNodeId].low) { - nodes2[currentNode].cutVertex = true; - buildComponent(currentNode, otherNodeId); - } - } else { - nodes2[currentNode].low = Math.min(nodes2[currentNode].low, nodes2[otherNodeId].id); - } - } - }); - } - }; - eles.forEach(function(ele) { - if (ele.isNode()) { - var nodeId = ele.id(); - if (!(nodeId in nodes2)) { - edgeCount2 = 0; - biconnectedSearch(nodeId, nodeId); - nodes2[nodeId].cutVertex = edgeCount2 > 1; - } - } - }); - var cutVertices = Object.keys(nodes2).filter(function(id3) { - return nodes2[id3].cutVertex; - }).map(function(id3) { - return eles.getElementById(id3); - }); - return { - cut: eles.spawn(cutVertices), - components - }; - }; - var hopcroftTarjanBiconnected$1 = { - hopcroftTarjanBiconnected, - htbc: hopcroftTarjanBiconnected, - htb: hopcroftTarjanBiconnected, - hopcroftTarjanBiconnectedComponents: hopcroftTarjanBiconnected - }; - var tarjanStronglyConnected = function tarjanStronglyConnected2() { - var eles = this; - var nodes2 = {}; - var index2 = 0; - var components = []; - var stack = []; - var cut = eles.spawn(eles); - var stronglyConnectedSearch = function stronglyConnectedSearch2(sourceNodeId) { - stack.push(sourceNodeId); - nodes2[sourceNodeId] = { - index: index2, - low: index2++, - explored: false - }; - var connectedEdges = eles.getElementById(sourceNodeId).connectedEdges().intersection(eles); - connectedEdges.forEach(function(edge) { - var targetNodeId = edge.target().id(); - if (targetNodeId !== sourceNodeId) { - if (!(targetNodeId in nodes2)) { - stronglyConnectedSearch2(targetNodeId); - } - if (!nodes2[targetNodeId].explored) { - nodes2[sourceNodeId].low = Math.min(nodes2[sourceNodeId].low, nodes2[targetNodeId].low); - } - } - }); - if (nodes2[sourceNodeId].index === nodes2[sourceNodeId].low) { - var componentNodes = eles.spawn(); - for (; ; ) { - var nodeId = stack.pop(); - componentNodes.merge(eles.getElementById(nodeId)); - nodes2[nodeId].low = nodes2[sourceNodeId].index; - nodes2[nodeId].explored = true; - if (nodeId === sourceNodeId) { - break; - } - } - var componentEdges = componentNodes.edgesWith(componentNodes); - var component = componentNodes.merge(componentEdges); - components.push(component); - cut = cut.difference(component); - } - }; - eles.forEach(function(ele) { - if (ele.isNode()) { - var nodeId = ele.id(); - if (!(nodeId in nodes2)) { - stronglyConnectedSearch(nodeId); - } - } - }); - return { - cut, - components - }; - }; - var tarjanStronglyConnected$1 = { - tarjanStronglyConnected, - tsc: tarjanStronglyConnected, - tscc: tarjanStronglyConnected, - tarjanStronglyConnectedComponents: tarjanStronglyConnected - }; - var elesfn$j = {}; - [elesfn$v, elesfn$u, elesfn$t, elesfn$s, elesfn$r, elesfn$q, elesfn$p, elesfn$o, elesfn$n, elesfn$m, elesfn$l, markovClustering$1, kClustering, hierarchicalClustering$1, affinityPropagation$1, elesfn$k, hopcroftTarjanBiconnected$1, tarjanStronglyConnected$1].forEach(function(props) { - extend2(elesfn$j, props); - }); - /*! - Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable - Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) - Licensed under The MIT License (http://opensource.org/licenses/MIT) - */ - var STATE_PENDING = 0; - var STATE_FULFILLED = 1; - var STATE_REJECTED = 2; - var api = function api2(executor) { - if (!(this instanceof api2)) - return new api2(executor); - this.id = "Thenable/1.0.7"; - this.state = STATE_PENDING; - this.fulfillValue = void 0; - this.rejectReason = void 0; - this.onFulfilled = []; - this.onRejected = []; - this.proxy = { - then: this.then.bind(this) - }; - if (typeof executor === "function") - executor.call(this, this.fulfill.bind(this), this.reject.bind(this)); - }; - api.prototype = { - /* promise resolving methods */ - fulfill: function fulfill(value2) { - return deliver(this, STATE_FULFILLED, "fulfillValue", value2); - }, - reject: function reject(value2) { - return deliver(this, STATE_REJECTED, "rejectReason", value2); - }, - /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ - then: function then(onFulfilled, onRejected) { - var curr = this; - var next2 = new api(); - curr.onFulfilled.push(resolver2(onFulfilled, next2, "fulfill")); - curr.onRejected.push(resolver2(onRejected, next2, "reject")); - execute(curr); - return next2.proxy; - } - }; - var deliver = function deliver2(curr, state2, name, value2) { - if (curr.state === STATE_PENDING) { - curr.state = state2; - curr[name] = value2; - execute(curr); - } - return curr; - }; - var execute = function execute2(curr) { - if (curr.state === STATE_FULFILLED) - execute_handlers(curr, "onFulfilled", curr.fulfillValue); - else if (curr.state === STATE_REJECTED) - execute_handlers(curr, "onRejected", curr.rejectReason); - }; - var execute_handlers = function execute_handlers2(curr, name, value2) { - if (curr[name].length === 0) - return; - var handlers = curr[name]; - curr[name] = []; - var func = function func2() { - for (var i3 = 0; i3 < handlers.length; i3++) { - handlers[i3](value2); - } - }; - if (typeof setImmediate === "function") - setImmediate(func); - else - setTimeout(func, 0); - }; - var resolver2 = function resolver3(cb, next2, method) { - return function(value2) { - if (typeof cb !== "function") - next2[method].call(next2, value2); - else { - var result; - try { - result = cb(value2); - } catch (e) { - next2.reject(e); - return; - } - resolve(next2, result); - } - }; - }; - var resolve = function resolve2(promise2, x2) { - if (promise2 === x2 || promise2.proxy === x2) { - promise2.reject(new TypeError("cannot resolve promise with itself")); - return; - } - var then; - if (_typeof(x2) === "object" && x2 !== null || typeof x2 === "function") { - try { - then = x2.then; - } catch (e) { - promise2.reject(e); - return; - } - } - if (typeof then === "function") { - var resolved = false; - try { - then.call( - x2, - /* resolvePromise */ - /* [Promises/A+ 2.3.3.3.1] */ - function(y2) { - if (resolved) - return; - resolved = true; - if (y2 === x2) - promise2.reject(new TypeError("circular thenable chain")); - else - resolve2(promise2, y2); - }, - /* rejectPromise */ - /* [Promises/A+ 2.3.3.3.2] */ - function(r) { - if (resolved) - return; - resolved = true; - promise2.reject(r); - } - ); - } catch (e) { - if (!resolved) - promise2.reject(e); - } - return; - } - promise2.fulfill(x2); - }; - api.all = function(ps) { - return new api(function(resolveAll2, rejectAll) { - var vals = new Array(ps.length); - var doneCount = 0; - var fulfill = function fulfill2(i4, val) { - vals[i4] = val; - doneCount++; - if (doneCount === ps.length) { - resolveAll2(vals); - } - }; - for (var i3 = 0; i3 < ps.length; i3++) { - (function(i4) { - var p2 = ps[i4]; - var isPromise = p2 != null && p2.then != null; - if (isPromise) { - p2.then(function(val2) { - fulfill(i4, val2); - }, function(err) { - rejectAll(err); - }); - } else { - var val = p2; - fulfill(i4, val); - } - })(i3); - } - }); - }; - api.resolve = function(val) { - return new api(function(resolve2, reject) { - resolve2(val); - }); - }; - api.reject = function(val) { - return new api(function(resolve2, reject) { - reject(val); - }); - }; - var Promise$12 = typeof Promise !== "undefined" ? Promise : api; - var Animation = function Animation2(target, opts, opts2) { - var isCore = core2(target); - var isEle = !isCore; - var _p = this._private = extend2({ - duration: 1e3 - }, opts, opts2); - _p.target = target; - _p.style = _p.style || _p.css; - _p.started = false; - _p.playing = false; - _p.hooked = false; - _p.applying = false; - _p.progress = 0; - _p.completes = []; - _p.frames = []; - if (_p.complete && fn$6(_p.complete)) { - _p.completes.push(_p.complete); - } - if (isEle) { - var pos = target.position(); - _p.startPosition = _p.startPosition || { - x: pos.x, - y: pos.y - }; - _p.startStyle = _p.startStyle || target.cy().style().getAnimationStartStyle(target, _p.style); - } - if (isCore) { - var pan = target.pan(); - _p.startPan = { - x: pan.x, - y: pan.y - }; - _p.startZoom = target.zoom(); - } - this.length = 1; - this[0] = this; - }; - var anifn = Animation.prototype; - extend2(anifn, { - instanceString: function instanceString() { - return "animation"; - }, - hook: function hook() { - var _p = this._private; - if (!_p.hooked) { - var q; - var tAni = _p.target._private.animation; - if (_p.queue) { - q = tAni.queue; - } else { - q = tAni.current; - } - q.push(this); - if (elementOrCollection(_p.target)) { - _p.target.cy().addToAnimationPool(_p.target); - } - _p.hooked = true; - } - return this; - }, - play: function play() { - var _p = this._private; - if (_p.progress === 1) { - _p.progress = 0; - } - _p.playing = true; - _p.started = false; - _p.stopped = false; - this.hook(); - return this; - }, - playing: function playing() { - return this._private.playing; - }, - apply: function apply2() { - var _p = this._private; - _p.applying = true; - _p.started = false; - _p.stopped = false; - this.hook(); - return this; - }, - applying: function applying() { - return this._private.applying; - }, - pause: function pause() { - var _p = this._private; - _p.playing = false; - _p.started = false; - return this; - }, - stop: function stop() { - var _p = this._private; - _p.playing = false; - _p.started = false; - _p.stopped = true; - return this; - }, - rewind: function rewind() { - return this.progress(0); - }, - fastforward: function fastforward() { - return this.progress(1); - }, - time: function time2(t) { - var _p = this._private; - if (t === void 0) { - return _p.progress * _p.duration; - } else { - return this.progress(t / _p.duration); - } - }, - progress: function progress(p2) { - var _p = this._private; - var wasPlaying = _p.playing; - if (p2 === void 0) { - return _p.progress; - } else { - if (wasPlaying) { - this.pause(); - } - _p.progress = p2; - _p.started = false; - if (wasPlaying) { - this.play(); - } - } - return this; - }, - completed: function completed() { - return this._private.progress === 1; - }, - reverse: function reverse() { - var _p = this._private; - var wasPlaying = _p.playing; - if (wasPlaying) { - this.pause(); - } - _p.progress = 1 - _p.progress; - _p.started = false; - var swap = function swap2(a, b) { - var _pa = _p[a]; - if (_pa == null) { - return; - } - _p[a] = _p[b]; - _p[b] = _pa; - }; - swap("zoom", "startZoom"); - swap("pan", "startPan"); - swap("position", "startPosition"); - if (_p.style) { - for (var i3 = 0; i3 < _p.style.length; i3++) { - var prop = _p.style[i3]; - var name = prop.name; - var startStyleProp = _p.startStyle[name]; - _p.startStyle[name] = prop; - _p.style[i3] = startStyleProp; - } - } - if (wasPlaying) { - this.play(); - } - return this; - }, - promise: function promise2(type2) { - var _p = this._private; - var arr; - switch (type2) { - case "frame": - arr = _p.frames; - break; - default: - case "complete": - case "completed": - arr = _p.completes; - } - return new Promise$12(function(resolve2, reject) { - arr.push(function() { - resolve2(); - }); - }); - } - }); - anifn.complete = anifn.completed; - anifn.run = anifn.play; - anifn.running = anifn.playing; - var define$3 = { - animated: function animated() { - return function animatedImpl() { - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all2 = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return false; - } - var ele = all2[0]; - if (ele) { - return ele._private.animation.current.length > 0; - } - }; - }, - // animated - clearQueue: function clearQueue() { - return function clearQueueImpl() { - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all2 = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return this; - } - for (var i3 = 0; i3 < all2.length; i3++) { - var ele = all2[i3]; - ele._private.animation.queue = []; - } - return this; - }; - }, - // clearQueue - delay: function delay() { - return function delayImpl(time2, complete) { - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return this; - } - return this.animate({ - delay: time2, - duration: time2, - complete - }); - }; - }, - // delay - delayAnimation: function delayAnimation() { - return function delayAnimationImpl(time2, complete) { - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return this; - } - return this.animation({ - delay: time2, - duration: time2, - complete - }); - }; - }, - // delay - animation: function animation() { - return function animationImpl(properties, params) { - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all2 = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - var isCore = !selfIsArrayLike; - var isEles = !isCore; - if (!cy.styleEnabled()) { - return this; - } - var style = cy.style(); - properties = extend2({}, properties, params); - var propertiesEmpty = Object.keys(properties).length === 0; - if (propertiesEmpty) { - return new Animation(all2[0], properties); - } - if (properties.duration === void 0) { - properties.duration = 400; - } - switch (properties.duration) { - case "slow": - properties.duration = 600; - break; - case "fast": - properties.duration = 200; - break; - } - if (isEles) { - properties.style = style.getPropsList(properties.style || properties.css); - properties.css = void 0; - } - if (isEles && properties.renderedPosition != null) { - var rpos = properties.renderedPosition; - var pan = cy.pan(); - var zoom = cy.zoom(); - properties.position = renderedToModelPosition(rpos, zoom, pan); - } - if (isCore && properties.panBy != null) { - var panBy = properties.panBy; - var cyPan = cy.pan(); - properties.pan = { - x: cyPan.x + panBy.x, - y: cyPan.y + panBy.y - }; - } - var center2 = properties.center || properties.centre; - if (isCore && center2 != null) { - var centerPan = cy.getCenterPan(center2.eles, properties.zoom); - if (centerPan != null) { - properties.pan = centerPan; - } - } - if (isCore && properties.fit != null) { - var fit = properties.fit; - var fitVp = cy.getFitViewport(fit.eles || fit.boundingBox, fit.padding); - if (fitVp != null) { - properties.pan = fitVp.pan; - properties.zoom = fitVp.zoom; - } - } - if (isCore && plainObject(properties.zoom)) { - var vp = cy.getZoomedViewport(properties.zoom); - if (vp != null) { - if (vp.zoomed) { - properties.zoom = vp.zoom; - } - if (vp.panned) { - properties.pan = vp.pan; - } - } else { - properties.zoom = null; - } - } - return new Animation(all2[0], properties); - }; - }, - // animate - animate: function animate() { - return function animateImpl(properties, params) { - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all2 = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return this; - } - if (params) { - properties = extend2({}, properties, params); - } - for (var i3 = 0; i3 < all2.length; i3++) { - var ele = all2[i3]; - var queue = ele.animated() && (properties.queue === void 0 || properties.queue); - var ani = ele.animation(properties, queue ? { - queue: true - } : void 0); - ani.play(); - } - return this; - }; - }, - // animate - stop: function stop() { - return function stopImpl(clearQueue, jumpToEnd) { - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all2 = selfIsArrayLike ? self2 : [self2]; - var cy = this._private.cy || this; - if (!cy.styleEnabled()) { - return this; - } - for (var i3 = 0; i3 < all2.length; i3++) { - var ele = all2[i3]; - var _p = ele._private; - var anis = _p.animation.current; - for (var j = 0; j < anis.length; j++) { - var ani = anis[j]; - var ani_p = ani._private; - if (jumpToEnd) { - ani_p.duration = 0; - } - } - if (clearQueue) { - _p.animation.queue = []; - } - if (!jumpToEnd) { - _p.animation.current = []; - } - } - cy.notify("draw"); - return this; - }; - } - // stop - }; - var isArray2 = Array.isArray; - var isArray_1 = isArray2; - var reIsDeepProp2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp2 = /^\w*$/; - function isKey2(value2, object3) { - if (isArray_1(value2)) { - return false; - } - var type2 = typeof value2; - if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value2 == null || isSymbol_1(value2)) { - return true; - } - return reIsPlainProp2.test(value2) || !reIsDeepProp2.test(value2) || object3 != null && value2 in Object(object3); - } - var _isKey = isKey2; - var asyncTag2 = "[object AsyncFunction]", funcTag2 = "[object Function]", genTag2 = "[object GeneratorFunction]", proxyTag2 = "[object Proxy]"; - function isFunction2(value2) { - if (!isObject_12(value2)) { - return false; - } - var tag = _baseGetTag(value2); - return tag == funcTag2 || tag == genTag2 || tag == asyncTag2 || tag == proxyTag2; - } - var isFunction_1 = isFunction2; - var coreJsData2 = _root["__core-js_shared__"]; - var _coreJsData = coreJsData2; - var maskSrcKey2 = function() { - var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || ""); - return uid ? "Symbol(src)_1." + uid : ""; - }(); - function isMasked2(func) { - return !!maskSrcKey2 && maskSrcKey2 in func; - } - var _isMasked = isMasked2; - var funcProto$12 = Function.prototype; - var funcToString$12 = funcProto$12.toString; - function toSource2(func) { - if (func != null) { - try { - return funcToString$12.call(func); - } catch (e) { - } - try { - return func + ""; - } catch (e) { - } - } - return ""; - } - var _toSource = toSource2; - var reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g; - var reIsHostCtor2 = /^\[object .+?Constructor\]$/; - var funcProto2 = Function.prototype, objectProto$32 = Object.prototype; - var funcToString2 = funcProto2.toString; - var hasOwnProperty$32 = objectProto$32.hasOwnProperty; - var reIsNative2 = RegExp( - "^" + funcToString2.call(hasOwnProperty$32).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" - ); - function baseIsNative2(value2) { - if (!isObject_12(value2) || _isMasked(value2)) { - return false; - } - var pattern = isFunction_1(value2) ? reIsNative2 : reIsHostCtor2; - return pattern.test(_toSource(value2)); - } - var _baseIsNative = baseIsNative2; - function getValue$1(object3, key) { - return object3 == null ? void 0 : object3[key]; - } - var _getValue = getValue$1; - function getNative2(object3, key) { - var value2 = _getValue(object3, key); - return _baseIsNative(value2) ? value2 : void 0; - } - var _getNative = getNative2; - var nativeCreate2 = _getNative(Object, "create"); - var _nativeCreate = nativeCreate2; - function hashClear2() { - this.__data__ = _nativeCreate ? _nativeCreate(null) : {}; - this.size = 0; - } - var _hashClear = hashClear2; - function hashDelete2(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - var _hashDelete = hashDelete2; - var HASH_UNDEFINED$12 = "__lodash_hash_undefined__"; - var objectProto$22 = Object.prototype; - var hasOwnProperty$22 = objectProto$22.hasOwnProperty; - function hashGet2(key) { - var data2 = this.__data__; - if (_nativeCreate) { - var result = data2[key]; - return result === HASH_UNDEFINED$12 ? void 0 : result; - } - return hasOwnProperty$22.call(data2, key) ? data2[key] : void 0; - } - var _hashGet = hashGet2; - var objectProto$12 = Object.prototype; - var hasOwnProperty$12 = objectProto$12.hasOwnProperty; - function hashHas2(key) { - var data2 = this.__data__; - return _nativeCreate ? data2[key] !== void 0 : hasOwnProperty$12.call(data2, key); - } - var _hashHas = hashHas2; - var HASH_UNDEFINED2 = "__lodash_hash_undefined__"; - function hashSet2(key, value2) { - var data2 = this.__data__; - this.size += this.has(key) ? 0 : 1; - data2[key] = _nativeCreate && value2 === void 0 ? HASH_UNDEFINED2 : value2; - return this; - } - var _hashSet = hashSet2; - function Hash2(entries2) { - var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index2 < length2) { - var entry = entries2[index2]; - this.set(entry[0], entry[1]); - } - } - Hash2.prototype.clear = _hashClear; - Hash2.prototype["delete"] = _hashDelete; - Hash2.prototype.get = _hashGet; - Hash2.prototype.has = _hashHas; - Hash2.prototype.set = _hashSet; - var _Hash = Hash2; - function listCacheClear2() { - this.__data__ = []; - this.size = 0; - } - var _listCacheClear = listCacheClear2; - function eq2(value2, other) { - return value2 === other || value2 !== value2 && other !== other; - } - var eq_1 = eq2; - function assocIndexOf2(array3, key) { - var length2 = array3.length; - while (length2--) { - if (eq_1(array3[length2][0], key)) { - return length2; - } - } - return -1; - } - var _assocIndexOf = assocIndexOf2; - var arrayProto2 = Array.prototype; - var splice2 = arrayProto2.splice; - function listCacheDelete2(key) { - var data2 = this.__data__, index2 = _assocIndexOf(data2, key); - if (index2 < 0) { - return false; - } - var lastIndex = data2.length - 1; - if (index2 == lastIndex) { - data2.pop(); - } else { - splice2.call(data2, index2, 1); - } - --this.size; - return true; - } - var _listCacheDelete = listCacheDelete2; - function listCacheGet2(key) { - var data2 = this.__data__, index2 = _assocIndexOf(data2, key); - return index2 < 0 ? void 0 : data2[index2][1]; - } - var _listCacheGet = listCacheGet2; - function listCacheHas2(key) { - return _assocIndexOf(this.__data__, key) > -1; - } - var _listCacheHas = listCacheHas2; - function listCacheSet2(key, value2) { - var data2 = this.__data__, index2 = _assocIndexOf(data2, key); - if (index2 < 0) { - ++this.size; - data2.push([key, value2]); - } else { - data2[index2][1] = value2; - } - return this; - } - var _listCacheSet = listCacheSet2; - function ListCache2(entries2) { - var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index2 < length2) { - var entry = entries2[index2]; - this.set(entry[0], entry[1]); - } - } - ListCache2.prototype.clear = _listCacheClear; - ListCache2.prototype["delete"] = _listCacheDelete; - ListCache2.prototype.get = _listCacheGet; - ListCache2.prototype.has = _listCacheHas; - ListCache2.prototype.set = _listCacheSet; - var _ListCache = ListCache2; - var Map$12 = _getNative(_root, "Map"); - var _Map = Map$12; - function mapCacheClear2() { - this.size = 0; - this.__data__ = { - "hash": new _Hash(), - "map": new (_Map || _ListCache)(), - "string": new _Hash() - }; - } - var _mapCacheClear = mapCacheClear2; - function isKeyable2(value2) { - var type2 = typeof value2; - return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value2 !== "__proto__" : value2 === null; - } - var _isKeyable = isKeyable2; - function getMapData2(map2, key) { - var data2 = map2.__data__; - return _isKeyable(key) ? data2[typeof key == "string" ? "string" : "hash"] : data2.map; - } - var _getMapData = getMapData2; - function mapCacheDelete2(key) { - var result = _getMapData(this, key)["delete"](key); - this.size -= result ? 1 : 0; - return result; - } - var _mapCacheDelete = mapCacheDelete2; - function mapCacheGet2(key) { - return _getMapData(this, key).get(key); - } - var _mapCacheGet = mapCacheGet2; - function mapCacheHas2(key) { - return _getMapData(this, key).has(key); - } - var _mapCacheHas = mapCacheHas2; - function mapCacheSet2(key, value2) { - var data2 = _getMapData(this, key), size2 = data2.size; - data2.set(key, value2); - this.size += data2.size == size2 ? 0 : 1; - return this; - } - var _mapCacheSet = mapCacheSet2; - function MapCache2(entries2) { - var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; - this.clear(); - while (++index2 < length2) { - var entry = entries2[index2]; - this.set(entry[0], entry[1]); - } - } - MapCache2.prototype.clear = _mapCacheClear; - MapCache2.prototype["delete"] = _mapCacheDelete; - MapCache2.prototype.get = _mapCacheGet; - MapCache2.prototype.has = _mapCacheHas; - MapCache2.prototype.set = _mapCacheSet; - var _MapCache = MapCache2; - var FUNC_ERROR_TEXT2 = "Expected a function"; - function memoize2(func, resolver3) { - if (typeof func != "function" || resolver3 != null && typeof resolver3 != "function") { - throw new TypeError(FUNC_ERROR_TEXT2); - } - var memoized = function() { - var args = arguments, key = resolver3 ? resolver3.apply(this, args) : args[0], cache2 = memoized.cache; - if (cache2.has(key)) { - return cache2.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache2.set(key, result) || cache2; - return result; - }; - memoized.cache = new (memoize2.Cache || _MapCache)(); - return memoized; - } - memoize2.Cache = _MapCache; - var memoize_1 = memoize2; - var MAX_MEMOIZE_SIZE2 = 500; - function memoizeCapped2(func) { - var result = memoize_1(func, function(key) { - if (cache2.size === MAX_MEMOIZE_SIZE2) { - cache2.clear(); - } - return key; - }); - var cache2 = result.cache; - return result; - } - var _memoizeCapped = memoizeCapped2; - var rePropName2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - var reEscapeChar2 = /\\(\\)?/g; - var stringToPath2 = _memoizeCapped(function(string3) { - var result = []; - if (string3.charCodeAt(0) === 46) { - result.push(""); - } - string3.replace(rePropName2, function(match2, number3, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar2, "$1") : number3 || match2); - }); - return result; - }); - var _stringToPath = stringToPath2; - function arrayMap2(array3, iteratee) { - var index2 = -1, length2 = array3 == null ? 0 : array3.length, result = Array(length2); - while (++index2 < length2) { - result[index2] = iteratee(array3[index2], index2, array3); - } - return result; - } - var _arrayMap = arrayMap2; - var INFINITY$12 = 1 / 0; - var symbolProto2 = _Symbol ? _Symbol.prototype : void 0, symbolToString2 = symbolProto2 ? symbolProto2.toString : void 0; - function baseToString2(value2) { - if (typeof value2 == "string") { - return value2; - } - if (isArray_1(value2)) { - return _arrayMap(value2, baseToString2) + ""; - } - if (isSymbol_1(value2)) { - return symbolToString2 ? symbolToString2.call(value2) : ""; - } - var result = value2 + ""; - return result == "0" && 1 / value2 == -INFINITY$12 ? "-0" : result; - } - var _baseToString = baseToString2; - function toString$12(value2) { - return value2 == null ? "" : _baseToString(value2); - } - var toString_1 = toString$12; - function castPath2(value2, object3) { - if (isArray_1(value2)) { - return value2; - } - return _isKey(value2, object3) ? [value2] : _stringToPath(toString_1(value2)); - } - var _castPath = castPath2; - var INFINITY2 = 1 / 0; - function toKey2(value2) { - if (typeof value2 == "string" || isSymbol_1(value2)) { - return value2; - } - var result = value2 + ""; - return result == "0" && 1 / value2 == -INFINITY2 ? "-0" : result; - } - var _toKey = toKey2; - function baseGet2(object3, path2) { - path2 = _castPath(path2, object3); - var index2 = 0, length2 = path2.length; - while (object3 != null && index2 < length2) { - object3 = object3[_toKey(path2[index2++])]; - } - return index2 && index2 == length2 ? object3 : void 0; - } - var _baseGet = baseGet2; - function get2(object3, path2, defaultValue) { - var result = object3 == null ? void 0 : _baseGet(object3, path2); - return result === void 0 ? defaultValue : result; - } - var get_1 = get2; - var defineProperty2 = function() { - try { - var func = _getNative(Object, "defineProperty"); - func({}, "", {}); - return func; - } catch (e) { - } - }(); - var _defineProperty = defineProperty2; - function baseAssignValue2(object3, key, value2) { - if (key == "__proto__" && _defineProperty) { - _defineProperty(object3, key, { - "configurable": true, - "enumerable": true, - "value": value2, - "writable": true - }); - } else { - object3[key] = value2; - } - } - var _baseAssignValue = baseAssignValue2; - var objectProto2 = Object.prototype; - var hasOwnProperty2 = objectProto2.hasOwnProperty; - function assignValue2(object3, key, value2) { - var objValue = object3[key]; - if (!(hasOwnProperty2.call(object3, key) && eq_1(objValue, value2)) || value2 === void 0 && !(key in object3)) { - _baseAssignValue(object3, key, value2); - } - } - var _assignValue = assignValue2; - var MAX_SAFE_INTEGER2 = 9007199254740991; - var reIsUint2 = /^(?:0|[1-9]\d*)$/; - function isIndex2(value2, length2) { - var type2 = typeof value2; - length2 = length2 == null ? MAX_SAFE_INTEGER2 : length2; - return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint2.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2); - } - var _isIndex = isIndex2; - function baseSet2(object3, path2, value2, customizer) { - if (!isObject_12(object3)) { - return object3; - } - path2 = _castPath(path2, object3); - var index2 = -1, length2 = path2.length, lastIndex = length2 - 1, nested = object3; - while (nested != null && ++index2 < length2) { - var key = _toKey(path2[index2]), newValue = value2; - if (key === "__proto__" || key === "constructor" || key === "prototype") { - return object3; - } - if (index2 != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : void 0; - if (newValue === void 0) { - newValue = isObject_12(objValue) ? objValue : _isIndex(path2[index2 + 1]) ? [] : {}; - } - } - _assignValue(nested, key, newValue); - nested = nested[key]; - } - return object3; - } - var _baseSet = baseSet2; - function set2(object3, path2, value2) { - return object3 == null ? object3 : _baseSet(object3, path2, value2); - } - var set_1 = set2; - function copyArray2(source, array3) { - var index2 = -1, length2 = source.length; - array3 || (array3 = Array(length2)); - while (++index2 < length2) { - array3[index2] = source[index2]; - } - return array3; - } - var _copyArray = copyArray2; - function toPath(value2) { - if (isArray_1(value2)) { - return _arrayMap(value2, _toKey); - } - return isSymbol_1(value2) ? [value2] : _copyArray(_stringToPath(toString_1(value2))); - } - var toPath_1 = toPath; - var define$2 = { - // access data field - data: function data2(params) { - var defaults3 = { - field: "data", - bindingEvent: "data", - allowBinding: false, - allowSetting: false, - allowGetting: false, - settingEvent: "data", - settingTriggersEvent: false, - triggerFnName: "trigger", - immutableKeys: {}, - // key => true if immutable - updateStyle: false, - beforeGet: function beforeGet(self2) { - }, - beforeSet: function beforeSet(self2, obj) { - }, - onSet: function onSet(self2) { - }, - canSet: function canSet(self2) { - return true; - } - }; - params = extend2({}, defaults3, params); - return function dataImpl(name, value2) { - var p2 = params; - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all2 = selfIsArrayLike ? self2 : [self2]; - var single = selfIsArrayLike ? self2[0] : self2; - if (string2(name)) { - var isPathLike = name.indexOf(".") !== -1; - var path2 = isPathLike && toPath_1(name); - if (p2.allowGetting && value2 === void 0) { - var ret; - if (single) { - p2.beforeGet(single); - if (path2 && single._private[p2.field][name] === void 0) { - ret = get_1(single._private[p2.field], path2); - } else { - ret = single._private[p2.field][name]; - } - } - return ret; - } else if (p2.allowSetting && value2 !== void 0) { - var valid2 = !p2.immutableKeys[name]; - if (valid2) { - var change2 = _defineProperty$1({}, name, value2); - p2.beforeSet(self2, change2); - for (var i3 = 0, l = all2.length; i3 < l; i3++) { - var ele = all2[i3]; - if (p2.canSet(ele)) { - if (path2 && single._private[p2.field][name] === void 0) { - set_1(ele._private[p2.field], path2, value2); - } else { - ele._private[p2.field][name] = value2; - } - } - } - if (p2.updateStyle) { - self2.updateStyle(); - } - p2.onSet(self2); - if (p2.settingTriggersEvent) { - self2[p2.triggerFnName](p2.settingEvent); - } - } - } - } else if (p2.allowSetting && plainObject(name)) { - var obj = name; - var k, v; - var keys2 = Object.keys(obj); - p2.beforeSet(self2, obj); - for (var _i6 = 0; _i6 < keys2.length; _i6++) { - k = keys2[_i6]; - v = obj[k]; - var _valid = !p2.immutableKeys[k]; - if (_valid) { - for (var j = 0; j < all2.length; j++) { - var _ele = all2[j]; - if (p2.canSet(_ele)) { - _ele._private[p2.field][k] = v; - } - } - } - } - if (p2.updateStyle) { - self2.updateStyle(); - } - p2.onSet(self2); - if (p2.settingTriggersEvent) { - self2[p2.triggerFnName](p2.settingEvent); - } - } else if (p2.allowBinding && fn$6(name)) { - var fn2 = name; - self2.on(p2.bindingEvent, fn2); - } else if (p2.allowGetting && name === void 0) { - var _ret; - if (single) { - p2.beforeGet(single); - _ret = single._private[p2.field]; - } - return _ret; - } - return self2; - }; - }, - // data - // remove data field - removeData: function removeData(params) { - var defaults3 = { - field: "data", - event: "data", - triggerFnName: "trigger", - triggerEvent: false, - immutableKeys: {} - // key => true if immutable - }; - params = extend2({}, defaults3, params); - return function removeDataImpl(names) { - var p2 = params; - var self2 = this; - var selfIsArrayLike = self2.length !== void 0; - var all2 = selfIsArrayLike ? self2 : [self2]; - if (string2(names)) { - var keys2 = names.split(/\s+/); - var l = keys2.length; - for (var i3 = 0; i3 < l; i3++) { - var key = keys2[i3]; - if (emptyString(key)) { - continue; - } - var valid2 = !p2.immutableKeys[key]; - if (valid2) { - for (var i_a = 0, l_a = all2.length; i_a < l_a; i_a++) { - all2[i_a]._private[p2.field][key] = void 0; - } - } - } - if (p2.triggerEvent) { - self2[p2.triggerFnName](p2.event); - } - } else if (names === void 0) { - for (var _i_a = 0, _l_a = all2.length; _i_a < _l_a; _i_a++) { - var _privateFields = all2[_i_a]._private[p2.field]; - var _keys = Object.keys(_privateFields); - for (var _i22 = 0; _i22 < _keys.length; _i22++) { - var _key = _keys[_i22]; - var validKeyToDelete = !p2.immutableKeys[_key]; - if (validKeyToDelete) { - _privateFields[_key] = void 0; - } - } - } - if (p2.triggerEvent) { - self2[p2.triggerFnName](p2.event); - } - } - return self2; - }; - } - // removeData - }; - var define$1 = { - eventAliasesOn: function eventAliasesOn(proto) { - var p2 = proto; - p2.addListener = p2.listen = p2.bind = p2.on; - p2.unlisten = p2.unbind = p2.off = p2.removeListener; - p2.trigger = p2.emit; - p2.pon = p2.promiseOn = function(events, selector2) { - var self2 = this; - var args = Array.prototype.slice.call(arguments, 0); - return new Promise$12(function(resolve2, reject) { - var callback = function callback2(e) { - self2.off.apply(self2, offArgs); - resolve2(e); - }; - var onArgs = args.concat([callback]); - var offArgs = onArgs.concat([]); - self2.on.apply(self2, onArgs); - }); - }; - } - }; - var define3 = {}; - [define$3, define$2, define$1].forEach(function(m) { - extend2(define3, m); - }); - var elesfn$i = { - animate: define3.animate(), - animation: define3.animation(), - animated: define3.animated(), - clearQueue: define3.clearQueue(), - delay: define3.delay(), - delayAnimation: define3.delayAnimation(), - stop: define3.stop() - }; - var elesfn$h = { - classes: function classes2(_classes) { - var self2 = this; - if (_classes === void 0) { - var ret = []; - self2[0]._private.classes.forEach(function(cls2) { - return ret.push(cls2); - }); - return ret; - } else if (!array2(_classes)) { - _classes = (_classes || "").match(/\S+/g) || []; - } - var changed = []; - var classesSet = new Set$12(_classes); - for (var j = 0; j < self2.length; j++) { - var ele = self2[j]; - var _p = ele._private; - var eleClasses = _p.classes; - var changedEle = false; - for (var i3 = 0; i3 < _classes.length; i3++) { - var cls = _classes[i3]; - var eleHasClass = eleClasses.has(cls); - if (!eleHasClass) { - changedEle = true; - break; - } - } - if (!changedEle) { - changedEle = eleClasses.size !== _classes.length; - } - if (changedEle) { - _p.classes = classesSet; - changed.push(ele); - } - } - if (changed.length > 0) { - this.spawn(changed).updateStyle().emit("class"); - } - return self2; - }, - addClass: function addClass2(classes2) { - return this.toggleClass(classes2, true); - }, - hasClass: function hasClass(className) { - var ele = this[0]; - return ele != null && ele._private.classes.has(className); - }, - toggleClass: function toggleClass(classes2, toggle) { - if (!array2(classes2)) { - classes2 = classes2.match(/\S+/g) || []; - } - var self2 = this; - var toggleUndefd = toggle === void 0; - var changed = []; - for (var i3 = 0, il = self2.length; i3 < il; i3++) { - var ele = self2[i3]; - var eleClasses = ele._private.classes; - var changedEle = false; - for (var j = 0; j < classes2.length; j++) { - var cls = classes2[j]; - var hasClass = eleClasses.has(cls); - var changedNow = false; - if (toggle || toggleUndefd && !hasClass) { - eleClasses.add(cls); - changedNow = true; - } else if (!toggle || toggleUndefd && hasClass) { - eleClasses["delete"](cls); - changedNow = true; - } - if (!changedEle && changedNow) { - changed.push(ele); - changedEle = true; - } - } - } - if (changed.length > 0) { - this.spawn(changed).updateStyle().emit("class"); - } - return self2; - }, - removeClass: function removeClass(classes2) { - return this.toggleClass(classes2, false); - }, - flashClass: function flashClass(classes2, duration) { - var self2 = this; - if (duration == null) { - duration = 250; - } else if (duration === 0) { - return self2; - } - self2.addClass(classes2); - setTimeout(function() { - self2.removeClass(classes2); - }, duration); - return self2; - } - }; - elesfn$h.className = elesfn$h.classNames = elesfn$h.classes; - var tokens = { - metaChar: "[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]", - // chars we need to escape in let names, etc - comparatorOp: "=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=", - // binary comparison op (used in data selectors) - boolOp: "\\?|\\!|\\^", - // boolean (unary) operators (used in data selectors) - string: `"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`, - // string literals (used in data selectors) -- doublequotes | singlequotes - number: number2, - // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 - meta: "degree|indegree|outdegree", - // allowed metadata fields (i.e. allowed functions to use from Collection) - separator: "\\s*,\\s*", - // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass - descendant: "\\s+", - child: "\\s+>\\s+", - subject: "\\$", - group: "node|edge|\\*", - directedEdge: "\\s+->\\s+", - undirectedEdge: "\\s+<->\\s+" - }; - tokens.variable = "(?:[\\w-.]|(?:\\\\" + tokens.metaChar + "))+"; - tokens.className = "(?:[\\w-]|(?:\\\\" + tokens.metaChar + "))+"; - tokens.value = tokens.string + "|" + tokens.number; - tokens.id = tokens.variable; - (function() { - var ops, op2, i3; - ops = tokens.comparatorOp.split("|"); - for (i3 = 0; i3 < ops.length; i3++) { - op2 = ops[i3]; - tokens.comparatorOp += "|@" + op2; - } - ops = tokens.comparatorOp.split("|"); - for (i3 = 0; i3 < ops.length; i3++) { - op2 = ops[i3]; - if (op2.indexOf("!") >= 0) { - continue; - } - if (op2 === "=") { - continue; - } - tokens.comparatorOp += "|\\!" + op2; - } - })(); - var newQuery = function newQuery2() { - return { - checks: [] - }; - }; - var Type2 = { - /** E.g. node */ - GROUP: 0, - /** A collection of elements */ - COLLECTION: 1, - /** A filter(ele) function */ - FILTER: 2, - /** E.g. [foo > 1] */ - DATA_COMPARE: 3, - /** E.g. [foo] */ - DATA_EXIST: 4, - /** E.g. [?foo] */ - DATA_BOOL: 5, - /** E.g. [[degree > 2]] */ - META_COMPARE: 6, - /** E.g. :selected */ - STATE: 7, - /** E.g. #foo */ - ID: 8, - /** E.g. .foo */ - CLASS: 9, - /** E.g. #foo <-> #bar */ - UNDIRECTED_EDGE: 10, - /** E.g. #foo -> #bar */ - DIRECTED_EDGE: 11, - /** E.g. $#foo -> #bar */ - NODE_SOURCE: 12, - /** E.g. #foo -> $#bar */ - NODE_TARGET: 13, - /** E.g. $#foo <-> #bar */ - NODE_NEIGHBOR: 14, - /** E.g. #foo > #bar */ - CHILD: 15, - /** E.g. #foo #bar */ - DESCENDANT: 16, - /** E.g. $#foo > #bar */ - PARENT: 17, - /** E.g. $#foo #bar */ - ANCESTOR: 18, - /** E.g. #foo > $bar > #baz */ - COMPOUND_SPLIT: 19, - /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */ - TRUE: 20 - }; - var stateSelectors = [{ - selector: ":selected", - matches: function matches2(ele) { - return ele.selected(); - } - }, { - selector: ":unselected", - matches: function matches2(ele) { - return !ele.selected(); - } - }, { - selector: ":selectable", - matches: function matches2(ele) { - return ele.selectable(); - } - }, { - selector: ":unselectable", - matches: function matches2(ele) { - return !ele.selectable(); - } - }, { - selector: ":locked", - matches: function matches2(ele) { - return ele.locked(); - } - }, { - selector: ":unlocked", - matches: function matches2(ele) { - return !ele.locked(); - } - }, { - selector: ":visible", - matches: function matches2(ele) { - return ele.visible(); - } - }, { - selector: ":hidden", - matches: function matches2(ele) { - return !ele.visible(); - } - }, { - selector: ":transparent", - matches: function matches2(ele) { - return ele.transparent(); - } - }, { - selector: ":grabbed", - matches: function matches2(ele) { - return ele.grabbed(); - } - }, { - selector: ":free", - matches: function matches2(ele) { - return !ele.grabbed(); - } - }, { - selector: ":removed", - matches: function matches2(ele) { - return ele.removed(); - } - }, { - selector: ":inside", - matches: function matches2(ele) { - return !ele.removed(); - } - }, { - selector: ":grabbable", - matches: function matches2(ele) { - return ele.grabbable(); - } - }, { - selector: ":ungrabbable", - matches: function matches2(ele) { - return !ele.grabbable(); - } - }, { - selector: ":animated", - matches: function matches2(ele) { - return ele.animated(); - } - }, { - selector: ":unanimated", - matches: function matches2(ele) { - return !ele.animated(); - } - }, { - selector: ":parent", - matches: function matches2(ele) { - return ele.isParent(); - } - }, { - selector: ":childless", - matches: function matches2(ele) { - return ele.isChildless(); - } - }, { - selector: ":child", - matches: function matches2(ele) { - return ele.isChild(); - } - }, { - selector: ":orphan", - matches: function matches2(ele) { - return ele.isOrphan(); - } - }, { - selector: ":nonorphan", - matches: function matches2(ele) { - return ele.isChild(); - } - }, { - selector: ":compound", - matches: function matches2(ele) { - if (ele.isNode()) { - return ele.isParent(); - } else { - return ele.source().isParent() || ele.target().isParent(); - } - } - }, { - selector: ":loop", - matches: function matches2(ele) { - return ele.isLoop(); - } - }, { - selector: ":simple", - matches: function matches2(ele) { - return ele.isSimple(); - } - }, { - selector: ":active", - matches: function matches2(ele) { - return ele.active(); - } - }, { - selector: ":inactive", - matches: function matches2(ele) { - return !ele.active(); - } - }, { - selector: ":backgrounding", - matches: function matches2(ele) { - return ele.backgrounding(); - } - }, { - selector: ":nonbackgrounding", - matches: function matches2(ele) { - return !ele.backgrounding(); - } - }].sort(function(a, b) { - return descending2(a.selector, b.selector); - }); - var lookup = function() { - var selToFn = {}; - var s; - for (var i3 = 0; i3 < stateSelectors.length; i3++) { - s = stateSelectors[i3]; - selToFn[s.selector] = s.matches; - } - return selToFn; - }(); - var stateSelectorMatches = function stateSelectorMatches2(sel, ele) { - return lookup[sel](ele); - }; - var stateSelectorRegex = "(" + stateSelectors.map(function(s) { - return s.selector; - }).join("|") + ")"; - var cleanMetaChars = function cleanMetaChars2(str2) { - return str2.replace(new RegExp("\\\\(" + tokens.metaChar + ")", "g"), function(match2, $1) { - return $1; - }); - }; - var replaceLastQuery = function replaceLastQuery2(selector2, examiningQuery, replacementQuery) { - selector2[selector2.length - 1] = replacementQuery; - }; - var exprs = [{ - name: "group", - // just used for identifying when debugging - query: true, - regex: "(" + tokens.group + ")", - populate: function populate(selector2, query, _ref) { - var _ref2 = _slicedToArray(_ref, 1), group = _ref2[0]; - query.checks.push({ - type: Type2.GROUP, - value: group === "*" ? group : group + "s" - }); - } - }, { - name: "state", - query: true, - regex: stateSelectorRegex, - populate: function populate(selector2, query, _ref3) { - var _ref4 = _slicedToArray(_ref3, 1), state2 = _ref4[0]; - query.checks.push({ - type: Type2.STATE, - value: state2 - }); - } - }, { - name: "id", - query: true, - regex: "\\#(" + tokens.id + ")", - populate: function populate(selector2, query, _ref5) { - var _ref6 = _slicedToArray(_ref5, 1), id2 = _ref6[0]; - query.checks.push({ - type: Type2.ID, - value: cleanMetaChars(id2) - }); - } - }, { - name: "className", - query: true, - regex: "\\.(" + tokens.className + ")", - populate: function populate(selector2, query, _ref7) { - var _ref8 = _slicedToArray(_ref7, 1), className = _ref8[0]; - query.checks.push({ - type: Type2.CLASS, - value: cleanMetaChars(className) - }); - } - }, { - name: "dataExists", - query: true, - regex: "\\[\\s*(" + tokens.variable + ")\\s*\\]", - populate: function populate(selector2, query, _ref9) { - var _ref10 = _slicedToArray(_ref9, 1), variable = _ref10[0]; - query.checks.push({ - type: Type2.DATA_EXIST, - field: cleanMetaChars(variable) - }); - } - }, { - name: "dataCompare", - query: true, - regex: "\\[\\s*(" + tokens.variable + ")\\s*(" + tokens.comparatorOp + ")\\s*(" + tokens.value + ")\\s*\\]", - populate: function populate(selector2, query, _ref11) { - var _ref12 = _slicedToArray(_ref11, 3), variable = _ref12[0], comparatorOp = _ref12[1], value2 = _ref12[2]; - var valueIsString = new RegExp("^" + tokens.string + "$").exec(value2) != null; - if (valueIsString) { - value2 = value2.substring(1, value2.length - 1); - } else { - value2 = parseFloat(value2); - } - query.checks.push({ - type: Type2.DATA_COMPARE, - field: cleanMetaChars(variable), - operator: comparatorOp, - value: value2 - }); - } - }, { - name: "dataBool", - query: true, - regex: "\\[\\s*(" + tokens.boolOp + ")\\s*(" + tokens.variable + ")\\s*\\]", - populate: function populate(selector2, query, _ref13) { - var _ref14 = _slicedToArray(_ref13, 2), boolOp = _ref14[0], variable = _ref14[1]; - query.checks.push({ - type: Type2.DATA_BOOL, - field: cleanMetaChars(variable), - operator: boolOp - }); - } - }, { - name: "metaCompare", - query: true, - regex: "\\[\\[\\s*(" + tokens.meta + ")\\s*(" + tokens.comparatorOp + ")\\s*(" + tokens.number + ")\\s*\\]\\]", - populate: function populate(selector2, query, _ref15) { - var _ref16 = _slicedToArray(_ref15, 3), meta2 = _ref16[0], comparatorOp = _ref16[1], number3 = _ref16[2]; - query.checks.push({ - type: Type2.META_COMPARE, - field: cleanMetaChars(meta2), - operator: comparatorOp, - value: parseFloat(number3) - }); - } - }, { - name: "nextQuery", - separator: true, - regex: tokens.separator, - populate: function populate(selector2, query) { - var currentSubject = selector2.currentSubject; - var edgeCount2 = selector2.edgeCount; - var compoundCount = selector2.compoundCount; - var lastQ = selector2[selector2.length - 1]; - if (currentSubject != null) { - lastQ.subject = currentSubject; - selector2.currentSubject = null; - } - lastQ.edgeCount = edgeCount2; - lastQ.compoundCount = compoundCount; - selector2.edgeCount = 0; - selector2.compoundCount = 0; - var nextQuery = selector2[selector2.length++] = newQuery(); - return nextQuery; - } - }, { - name: "directedEdge", - separator: true, - regex: tokens.directedEdge, - populate: function populate(selector2, query) { - if (selector2.currentSubject == null) { - var edgeQuery = newQuery(); - var source = query; - var target = newQuery(); - edgeQuery.checks.push({ - type: Type2.DIRECTED_EDGE, - source, - target - }); - replaceLastQuery(selector2, query, edgeQuery); - selector2.edgeCount++; - return target; - } else { - var srcTgtQ = newQuery(); - var _source = query; - var _target = newQuery(); - srcTgtQ.checks.push({ - type: Type2.NODE_SOURCE, - source: _source, - target: _target - }); - replaceLastQuery(selector2, query, srcTgtQ); - selector2.edgeCount++; - return _target; - } - } - }, { - name: "undirectedEdge", - separator: true, - regex: tokens.undirectedEdge, - populate: function populate(selector2, query) { - if (selector2.currentSubject == null) { - var edgeQuery = newQuery(); - var source = query; - var target = newQuery(); - edgeQuery.checks.push({ - type: Type2.UNDIRECTED_EDGE, - nodes: [source, target] - }); - replaceLastQuery(selector2, query, edgeQuery); - selector2.edgeCount++; - return target; - } else { - var nhoodQ = newQuery(); - var node2 = query; - var neighbor = newQuery(); - nhoodQ.checks.push({ - type: Type2.NODE_NEIGHBOR, - node: node2, - neighbor - }); - replaceLastQuery(selector2, query, nhoodQ); - return neighbor; - } - } - }, { - name: "child", - separator: true, - regex: tokens.child, - populate: function populate(selector2, query) { - if (selector2.currentSubject == null) { - var parentChildQuery = newQuery(); - var child = newQuery(); - var parent = selector2[selector2.length - 1]; - parentChildQuery.checks.push({ - type: Type2.CHILD, - parent, - child - }); - replaceLastQuery(selector2, query, parentChildQuery); - selector2.compoundCount++; - return child; - } else if (selector2.currentSubject === query) { - var compound = newQuery(); - var left2 = selector2[selector2.length - 1]; - var right2 = newQuery(); - var subject = newQuery(); - var _child = newQuery(); - var _parent = newQuery(); - compound.checks.push({ - type: Type2.COMPOUND_SPLIT, - left: left2, - right: right2, - subject - }); - subject.checks = query.checks; - query.checks = [{ - type: Type2.TRUE - }]; - _parent.checks.push({ - type: Type2.TRUE - }); - right2.checks.push({ - type: Type2.PARENT, - // type is swapped on right side queries - parent: _parent, - child: _child - // empty for now - }); - replaceLastQuery(selector2, left2, compound); - selector2.currentSubject = subject; - selector2.compoundCount++; - return _child; - } else { - var _parent2 = newQuery(); - var _child2 = newQuery(); - var pcQChecks = [{ - type: Type2.PARENT, - parent: _parent2, - child: _child2 - }]; - _parent2.checks = query.checks; - query.checks = pcQChecks; - selector2.compoundCount++; - return _child2; - } - } - }, { - name: "descendant", - separator: true, - regex: tokens.descendant, - populate: function populate(selector2, query) { - if (selector2.currentSubject == null) { - var ancChQuery = newQuery(); - var descendant = newQuery(); - var ancestor = selector2[selector2.length - 1]; - ancChQuery.checks.push({ - type: Type2.DESCENDANT, - ancestor, - descendant - }); - replaceLastQuery(selector2, query, ancChQuery); - selector2.compoundCount++; - return descendant; - } else if (selector2.currentSubject === query) { - var compound = newQuery(); - var left2 = selector2[selector2.length - 1]; - var right2 = newQuery(); - var subject = newQuery(); - var _descendant = newQuery(); - var _ancestor = newQuery(); - compound.checks.push({ - type: Type2.COMPOUND_SPLIT, - left: left2, - right: right2, - subject - }); - subject.checks = query.checks; - query.checks = [{ - type: Type2.TRUE - }]; - _ancestor.checks.push({ - type: Type2.TRUE - }); - right2.checks.push({ - type: Type2.ANCESTOR, - // type is swapped on right side queries - ancestor: _ancestor, - descendant: _descendant - // empty for now - }); - replaceLastQuery(selector2, left2, compound); - selector2.currentSubject = subject; - selector2.compoundCount++; - return _descendant; - } else { - var _ancestor2 = newQuery(); - var _descendant2 = newQuery(); - var adQChecks = [{ - type: Type2.ANCESTOR, - ancestor: _ancestor2, - descendant: _descendant2 - }]; - _ancestor2.checks = query.checks; - query.checks = adQChecks; - selector2.compoundCount++; - return _descendant2; - } - } - }, { - name: "subject", - modifier: true, - regex: tokens.subject, - populate: function populate(selector2, query) { - if (selector2.currentSubject != null && selector2.currentSubject !== query) { - warn("Redefinition of subject in selector `" + selector2.toString() + "`"); - return false; - } - selector2.currentSubject = query; - var topQ = selector2[selector2.length - 1]; - var topChk = topQ.checks[0]; - var topType = topChk == null ? null : topChk.type; - if (topType === Type2.DIRECTED_EDGE) { - topChk.type = Type2.NODE_TARGET; - } else if (topType === Type2.UNDIRECTED_EDGE) { - topChk.type = Type2.NODE_NEIGHBOR; - topChk.node = topChk.nodes[1]; - topChk.neighbor = topChk.nodes[0]; - topChk.nodes = null; - } - } - }]; - exprs.forEach(function(e) { - return e.regexObj = new RegExp("^" + e.regex); - }); - var consumeExpr = function consumeExpr2(remaining) { - var expr; - var match2; - var name; - for (var j = 0; j < exprs.length; j++) { - var e = exprs[j]; - var n = e.name; - var m = remaining.match(e.regexObj); - if (m != null) { - match2 = m; - expr = e; - name = n; - var consumed = m[0]; - remaining = remaining.substring(consumed.length); - break; - } - } - return { - expr, - match: match2, - name, - remaining - }; - }; - var consumeWhitespace = function consumeWhitespace2(remaining) { - var match2 = remaining.match(/^\s+/); - if (match2) { - var consumed = match2[0]; - remaining = remaining.substring(consumed.length); - } - return remaining; - }; - var parse2 = function parse3(selector2) { - var self2 = this; - var remaining = self2.inputText = selector2; - var currentQuery = self2[0] = newQuery(); - self2.length = 1; - remaining = consumeWhitespace(remaining); - for (; ; ) { - var exprInfo = consumeExpr(remaining); - if (exprInfo.expr == null) { - warn("The selector `" + selector2 + "`is invalid"); - return false; - } else { - var args = exprInfo.match.slice(1); - var ret = exprInfo.expr.populate(self2, currentQuery, args); - if (ret === false) { - return false; - } else if (ret != null) { - currentQuery = ret; - } - } - remaining = exprInfo.remaining; - if (remaining.match(/^\s*$/)) { - break; - } - } - var lastQ = self2[self2.length - 1]; - if (self2.currentSubject != null) { - lastQ.subject = self2.currentSubject; - } - lastQ.edgeCount = self2.edgeCount; - lastQ.compoundCount = self2.compoundCount; - for (var i3 = 0; i3 < self2.length; i3++) { - var q = self2[i3]; - if (q.compoundCount > 0 && q.edgeCount > 0) { - warn("The selector `" + selector2 + "` is invalid because it uses both a compound selector and an edge selector"); - return false; - } - if (q.edgeCount > 1) { - warn("The selector `" + selector2 + "` is invalid because it uses multiple edge selectors"); - return false; - } else if (q.edgeCount === 1) { - warn("The selector `" + selector2 + "` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes."); - } - } - return true; - }; - var toString2 = function toString3() { - if (this.toStringCache != null) { - return this.toStringCache; - } - var clean = function clean2(obj) { - if (obj == null) { - return ""; - } else { - return obj; - } - }; - var cleanVal = function cleanVal2(val) { - if (string2(val)) { - return '"' + val + '"'; - } else { - return clean(val); - } - }; - var space = function space2(val) { - return " " + val + " "; - }; - var checkToString = function checkToString2(check, subject) { - var type2 = check.type, value2 = check.value; - switch (type2) { - case Type2.GROUP: { - var group = clean(value2); - return group.substring(0, group.length - 1); - } - case Type2.DATA_COMPARE: { - var field = check.field, operator = check.operator; - return "[" + field + space(clean(operator)) + cleanVal(value2) + "]"; - } - case Type2.DATA_BOOL: { - var _operator = check.operator, _field = check.field; - return "[" + clean(_operator) + _field + "]"; - } - case Type2.DATA_EXIST: { - var _field2 = check.field; - return "[" + _field2 + "]"; - } - case Type2.META_COMPARE: { - var _operator2 = check.operator, _field3 = check.field; - return "[[" + _field3 + space(clean(_operator2)) + cleanVal(value2) + "]]"; - } - case Type2.STATE: { - return value2; - } - case Type2.ID: { - return "#" + value2; - } - case Type2.CLASS: { - return "." + value2; - } - case Type2.PARENT: - case Type2.CHILD: { - return queryToString(check.parent, subject) + space(">") + queryToString(check.child, subject); - } - case Type2.ANCESTOR: - case Type2.DESCENDANT: { - return queryToString(check.ancestor, subject) + " " + queryToString(check.descendant, subject); - } - case Type2.COMPOUND_SPLIT: { - var lhs = queryToString(check.left, subject); - var sub2 = queryToString(check.subject, subject); - var rhs = queryToString(check.right, subject); - return lhs + (lhs.length > 0 ? " " : "") + sub2 + rhs; - } - case Type2.TRUE: { - return ""; - } - } - }; - var queryToString = function queryToString2(query2, subject) { - return query2.checks.reduce(function(str3, chk, i4) { - return str3 + (subject === query2 && i4 === 0 ? "$" : "") + checkToString(chk, subject); - }, ""); - }; - var str2 = ""; - for (var i3 = 0; i3 < this.length; i3++) { - var query = this[i3]; - str2 += queryToString(query, query.subject); - if (this.length > 1 && i3 < this.length - 1) { - str2 += ", "; - } - } - this.toStringCache = str2; - return str2; - }; - var parse$12 = { - parse: parse2, - toString: toString2 - }; - var valCmp = function valCmp2(fieldVal, operator, value2) { - var matches2; - var isFieldStr = string2(fieldVal); - var isFieldNum = number$12(fieldVal); - var isValStr = string2(value2); - var fieldStr, valStr; - var caseInsensitive = false; - var notExpr = false; - var isIneqCmp = false; - if (operator.indexOf("!") >= 0) { - operator = operator.replace("!", ""); - notExpr = true; - } - if (operator.indexOf("@") >= 0) { - operator = operator.replace("@", ""); - caseInsensitive = true; - } - if (isFieldStr || isValStr || caseInsensitive) { - fieldStr = !isFieldStr && !isFieldNum ? "" : "" + fieldVal; - valStr = "" + value2; - } - if (caseInsensitive) { - fieldVal = fieldStr = fieldStr.toLowerCase(); - value2 = valStr = valStr.toLowerCase(); - } - switch (operator) { - case "*=": - matches2 = fieldStr.indexOf(valStr) >= 0; - break; - case "$=": - matches2 = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0; - break; - case "^=": - matches2 = fieldStr.indexOf(valStr) === 0; - break; - case "=": - matches2 = fieldVal === value2; - break; - case ">": - isIneqCmp = true; - matches2 = fieldVal > value2; - break; - case ">=": - isIneqCmp = true; - matches2 = fieldVal >= value2; - break; - case "<": - isIneqCmp = true; - matches2 = fieldVal < value2; - break; - case "<=": - isIneqCmp = true; - matches2 = fieldVal <= value2; - break; - default: - matches2 = false; - break; - } - if (notExpr && (fieldVal != null || !isIneqCmp)) { - matches2 = !matches2; - } - return matches2; - }; - var boolCmp = function boolCmp2(fieldVal, operator) { - switch (operator) { - case "?": - return fieldVal ? true : false; - case "!": - return fieldVal ? false : true; - case "^": - return fieldVal === void 0; - } - }; - var existCmp = function existCmp2(fieldVal) { - return fieldVal !== void 0; - }; - var data$1 = function data2(ele, field) { - return ele.data(field); - }; - var meta = function meta2(ele, field) { - return ele[field](); - }; - var match = []; - var matches$1 = function matches2(query, ele) { - return query.checks.every(function(chk) { - return match[chk.type](chk, ele); - }); - }; - match[Type2.GROUP] = function(check, ele) { - var group = check.value; - return group === "*" || group === ele.group(); - }; - match[Type2.STATE] = function(check, ele) { - var stateSelector = check.value; - return stateSelectorMatches(stateSelector, ele); - }; - match[Type2.ID] = function(check, ele) { - var id2 = check.value; - return ele.id() === id2; - }; - match[Type2.CLASS] = function(check, ele) { - var cls = check.value; - return ele.hasClass(cls); - }; - match[Type2.META_COMPARE] = function(check, ele) { - var field = check.field, operator = check.operator, value2 = check.value; - return valCmp(meta(ele, field), operator, value2); - }; - match[Type2.DATA_COMPARE] = function(check, ele) { - var field = check.field, operator = check.operator, value2 = check.value; - return valCmp(data$1(ele, field), operator, value2); - }; - match[Type2.DATA_BOOL] = function(check, ele) { - var field = check.field, operator = check.operator; - return boolCmp(data$1(ele, field), operator); - }; - match[Type2.DATA_EXIST] = function(check, ele) { - var field = check.field; - check.operator; - return existCmp(data$1(ele, field)); - }; - match[Type2.UNDIRECTED_EDGE] = function(check, ele) { - var qA = check.nodes[0]; - var qB = check.nodes[1]; - var src = ele.source(); - var tgt = ele.target(); - return matches$1(qA, src) && matches$1(qB, tgt) || matches$1(qB, src) && matches$1(qA, tgt); - }; - match[Type2.NODE_NEIGHBOR] = function(check, ele) { - return matches$1(check.node, ele) && ele.neighborhood().some(function(n) { - return n.isNode() && matches$1(check.neighbor, n); - }); - }; - match[Type2.DIRECTED_EDGE] = function(check, ele) { - return matches$1(check.source, ele.source()) && matches$1(check.target, ele.target()); - }; - match[Type2.NODE_SOURCE] = function(check, ele) { - return matches$1(check.source, ele) && ele.outgoers().some(function(n) { - return n.isNode() && matches$1(check.target, n); - }); - }; - match[Type2.NODE_TARGET] = function(check, ele) { - return matches$1(check.target, ele) && ele.incomers().some(function(n) { - return n.isNode() && matches$1(check.source, n); - }); - }; - match[Type2.CHILD] = function(check, ele) { - return matches$1(check.child, ele) && matches$1(check.parent, ele.parent()); - }; - match[Type2.PARENT] = function(check, ele) { - return matches$1(check.parent, ele) && ele.children().some(function(c2) { - return matches$1(check.child, c2); - }); - }; - match[Type2.DESCENDANT] = function(check, ele) { - return matches$1(check.descendant, ele) && ele.ancestors().some(function(a) { - return matches$1(check.ancestor, a); - }); - }; - match[Type2.ANCESTOR] = function(check, ele) { - return matches$1(check.ancestor, ele) && ele.descendants().some(function(d) { - return matches$1(check.descendant, d); - }); - }; - match[Type2.COMPOUND_SPLIT] = function(check, ele) { - return matches$1(check.subject, ele) && matches$1(check.left, ele) && matches$1(check.right, ele); - }; - match[Type2.TRUE] = function() { - return true; - }; - match[Type2.COLLECTION] = function(check, ele) { - var collection2 = check.value; - return collection2.has(ele); - }; - match[Type2.FILTER] = function(check, ele) { - var filter3 = check.value; - return filter3(ele); - }; - var filter2 = function filter3(collection2) { - var self2 = this; - if (self2.length === 1 && self2[0].checks.length === 1 && self2[0].checks[0].type === Type2.ID) { - return collection2.getElementById(self2[0].checks[0].value).collection(); - } - var selectorFunction = function selectorFunction2(element3) { - for (var j = 0; j < self2.length; j++) { - var query = self2[j]; - if (matches$1(query, element3)) { - return true; - } - } - return false; - }; - if (self2.text() == null) { - selectorFunction = function selectorFunction2() { - return true; - }; - } - return collection2.filter(selectorFunction); - }; - var matches = function matches2(ele) { - var self2 = this; - for (var j = 0; j < self2.length; j++) { - var query = self2[j]; - if (matches$1(query, ele)) { - return true; - } - } - return false; - }; - var matching = { - matches, - filter: filter2 - }; - var Selector = function Selector2(selector2) { - this.inputText = selector2; - this.currentSubject = null; - this.compoundCount = 0; - this.edgeCount = 0; - this.length = 0; - if (selector2 == null || string2(selector2) && selector2.match(/^\s*$/)) - ; - else if (elementOrCollection(selector2)) { - this.addQuery({ - checks: [{ - type: Type2.COLLECTION, - value: selector2.collection() - }] - }); - } else if (fn$6(selector2)) { - this.addQuery({ - checks: [{ - type: Type2.FILTER, - value: selector2 - }] - }); - } else if (string2(selector2)) { - if (!this.parse(selector2)) { - this.invalid = true; - } - } else { - error("A selector must be created from a string; found "); - } - }; - var selfn = Selector.prototype; - [parse$12, matching].forEach(function(p2) { - return extend2(selfn, p2); - }); - selfn.text = function() { - return this.inputText; - }; - selfn.size = function() { - return this.length; - }; - selfn.eq = function(i3) { - return this[i3]; - }; - selfn.sameText = function(otherSel) { - return !this.invalid && !otherSel.invalid && this.text() === otherSel.text(); - }; - selfn.addQuery = function(q) { - this[this.length++] = q; - }; - selfn.selector = selfn.toString; - var elesfn$g = { - allAre: function allAre(selector2) { - var selObj = new Selector(selector2); - return this.every(function(ele) { - return selObj.matches(ele); - }); - }, - is: function is(selector2) { - var selObj = new Selector(selector2); - return this.some(function(ele) { - return selObj.matches(ele); - }); - }, - some: function some(fn2, thisArg) { - for (var i3 = 0; i3 < this.length; i3++) { - var ret = !thisArg ? fn2(this[i3], i3, this) : fn2.apply(thisArg, [this[i3], i3, this]); - if (ret) { - return true; - } - } - return false; - }, - every: function every(fn2, thisArg) { - for (var i3 = 0; i3 < this.length; i3++) { - var ret = !thisArg ? fn2(this[i3], i3, this) : fn2.apply(thisArg, [this[i3], i3, this]); - if (!ret) { - return false; - } - } - return true; - }, - same: function same(collection2) { - if (this === collection2) { - return true; - } - collection2 = this.cy().collection(collection2); - var thisLength = this.length; - var collectionLength = collection2.length; - if (thisLength !== collectionLength) { - return false; - } - if (thisLength === 1) { - return this[0] === collection2[0]; - } - return this.every(function(ele) { - return collection2.hasElementWithId(ele.id()); - }); - }, - anySame: function anySame(collection2) { - collection2 = this.cy().collection(collection2); - return this.some(function(ele) { - return collection2.hasElementWithId(ele.id()); - }); - }, - allAreNeighbors: function allAreNeighbors(collection2) { - collection2 = this.cy().collection(collection2); - var nhood = this.neighborhood(); - return collection2.every(function(ele) { - return nhood.hasElementWithId(ele.id()); - }); - }, - contains: function contains2(collection2) { - collection2 = this.cy().collection(collection2); - var self2 = this; - return collection2.every(function(ele) { - return self2.hasElementWithId(ele.id()); - }); - } - }; - elesfn$g.allAreNeighbours = elesfn$g.allAreNeighbors; - elesfn$g.has = elesfn$g.contains; - elesfn$g.equal = elesfn$g.equals = elesfn$g.same; - var cache = function cache2(fn2, name) { - return function traversalCache(arg1, arg2, arg3, arg4) { - var selectorOrEles = arg1; - var eles = this; - var key; - if (selectorOrEles == null) { - key = ""; - } else if (elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) { - key = selectorOrEles.id(); - } - if (eles.length === 1 && key) { - var _p = eles[0]._private; - var tch = _p.traversalCache = _p.traversalCache || {}; - var ch2 = tch[name] = tch[name] || []; - var hash = hashString(key); - var cacheHit = ch2[hash]; - if (cacheHit) { - return cacheHit; - } else { - return ch2[hash] = fn2.call(eles, arg1, arg2, arg3, arg4); - } - } else { - return fn2.call(eles, arg1, arg2, arg3, arg4); - } - }; - }; - var elesfn$f = { - parent: function parent(selector2) { - var parents2 = []; - if (this.length === 1) { - var parent2 = this[0]._private.parent; - if (parent2) { - return parent2; - } - } - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var _parent = ele._private.parent; - if (_parent) { - parents2.push(_parent); - } - } - return this.spawn(parents2, true).filter(selector2); - }, - parents: function parents2(selector2) { - var parents3 = []; - var eles = this.parent(); - while (eles.nonempty()) { - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - parents3.push(ele); - } - eles = eles.parent(); - } - return this.spawn(parents3, true).filter(selector2); - }, - commonAncestors: function commonAncestors(selector2) { - var ancestors; - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var parents2 = ele.parents(); - ancestors = ancestors || parents2; - ancestors = ancestors.intersect(parents2); - } - return ancestors.filter(selector2); - }, - orphans: function orphans(selector2) { - return this.stdFilter(function(ele) { - return ele.isOrphan(); - }).filter(selector2); - }, - nonorphans: function nonorphans(selector2) { - return this.stdFilter(function(ele) { - return ele.isChild(); - }).filter(selector2); - }, - children: cache(function(selector2) { - var children2 = []; - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var eleChildren = ele._private.children; - for (var j = 0; j < eleChildren.length; j++) { - children2.push(eleChildren[j]); - } - } - return this.spawn(children2, true).filter(selector2); - }, "children"), - siblings: function siblings(selector2) { - return this.parent().children().not(this).filter(selector2); - }, - isParent: function isParent() { - var ele = this[0]; - if (ele) { - return ele.isNode() && ele._private.children.length !== 0; - } - }, - isChildless: function isChildless() { - var ele = this[0]; - if (ele) { - return ele.isNode() && ele._private.children.length === 0; - } - }, - isChild: function isChild() { - var ele = this[0]; - if (ele) { - return ele.isNode() && ele._private.parent != null; - } - }, - isOrphan: function isOrphan() { - var ele = this[0]; - if (ele) { - return ele.isNode() && ele._private.parent == null; - } - }, - descendants: function descendants2(selector2) { - var elements2 = []; - function add(eles) { - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - elements2.push(ele); - if (ele.children().nonempty()) { - add(ele.children()); - } - } - } - add(this.children()); - return this.spawn(elements2, true).filter(selector2); - } - }; - function forEachCompound(eles, fn2, includeSelf, recursiveStep) { - var q = []; - var did = new Set$12(); - var cy = eles.cy(); - var hasCompounds = cy.hasCompoundNodes(); - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - if (includeSelf) { - q.push(ele); - } else if (hasCompounds) { - recursiveStep(q, did, ele); - } - } - while (q.length > 0) { - var _ele = q.shift(); - fn2(_ele); - did.add(_ele.id()); - if (hasCompounds) { - recursiveStep(q, did, _ele); - } - } - return eles; - } - function addChildren(q, did, ele) { - if (ele.isParent()) { - var children2 = ele._private.children; - for (var i3 = 0; i3 < children2.length; i3++) { - var child = children2[i3]; - if (!did.has(child.id())) { - q.push(child); - } - } - } - } - elesfn$f.forEachDown = function(fn2) { - var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - return forEachCompound(this, fn2, includeSelf, addChildren); - }; - function addParent(q, did, ele) { - if (ele.isChild()) { - var parent = ele._private.parent; - if (!did.has(parent.id())) { - q.push(parent); - } - } - } - elesfn$f.forEachUp = function(fn2) { - var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - return forEachCompound(this, fn2, includeSelf, addParent); - }; - function addParentAndChildren(q, did, ele) { - addParent(q, did, ele); - addChildren(q, did, ele); - } - elesfn$f.forEachUpAndDown = function(fn2) { - var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - return forEachCompound(this, fn2, includeSelf, addParentAndChildren); - }; - elesfn$f.ancestors = elesfn$f.parents; - var fn$5, elesfn$e; - fn$5 = elesfn$e = { - data: define3.data({ - field: "data", - bindingEvent: "data", - allowBinding: true, - allowSetting: true, - settingEvent: "data", - settingTriggersEvent: true, - triggerFnName: "trigger", - allowGetting: true, - immutableKeys: { - "id": true, - "source": true, - "target": true, - "parent": true - }, - updateStyle: true - }), - removeData: define3.removeData({ - field: "data", - event: "data", - triggerFnName: "trigger", - triggerEvent: true, - immutableKeys: { - "id": true, - "source": true, - "target": true, - "parent": true - }, - updateStyle: true - }), - scratch: define3.data({ - field: "scratch", - bindingEvent: "scratch", - allowBinding: true, - allowSetting: true, - settingEvent: "scratch", - settingTriggersEvent: true, - triggerFnName: "trigger", - allowGetting: true, - updateStyle: true - }), - removeScratch: define3.removeData({ - field: "scratch", - event: "scratch", - triggerFnName: "trigger", - triggerEvent: true, - updateStyle: true - }), - rscratch: define3.data({ - field: "rscratch", - allowBinding: false, - allowSetting: true, - settingTriggersEvent: false, - allowGetting: true - }), - removeRscratch: define3.removeData({ - field: "rscratch", - triggerEvent: false - }), - id: function id2() { - var ele = this[0]; - if (ele) { - return ele._private.data.id; - } - } - }; - fn$5.attr = fn$5.data; - fn$5.removeAttr = fn$5.removeData; - var data = elesfn$e; - var elesfn$d = {}; - function defineDegreeFunction(callback) { - return function(includeLoops) { - var self2 = this; - if (includeLoops === void 0) { - includeLoops = true; - } - if (self2.length === 0) { - return; - } - if (self2.isNode() && !self2.removed()) { - var degree = 0; - var node2 = self2[0]; - var connectedEdges = node2._private.edges; - for (var i3 = 0; i3 < connectedEdges.length; i3++) { - var edge = connectedEdges[i3]; - if (!includeLoops && edge.isLoop()) { - continue; - } - degree += callback(node2, edge); - } - return degree; - } else { - return; - } - }; - } - extend2(elesfn$d, { - degree: defineDegreeFunction(function(node2, edge) { - if (edge.source().same(edge.target())) { - return 2; - } else { - return 1; - } - }), - indegree: defineDegreeFunction(function(node2, edge) { - if (edge.target().same(node2)) { - return 1; - } else { - return 0; - } - }), - outdegree: defineDegreeFunction(function(node2, edge) { - if (edge.source().same(node2)) { - return 1; - } else { - return 0; - } - }) - }); - function defineDegreeBoundsFunction(degreeFn, callback) { - return function(includeLoops) { - var ret; - var nodes2 = this.nodes(); - for (var i3 = 0; i3 < nodes2.length; i3++) { - var ele = nodes2[i3]; - var degree = ele[degreeFn](includeLoops); - if (degree !== void 0 && (ret === void 0 || callback(degree, ret))) { - ret = degree; - } - } - return ret; - }; - } - extend2(elesfn$d, { - minDegree: defineDegreeBoundsFunction("degree", function(degree, min3) { - return degree < min3; - }), - maxDegree: defineDegreeBoundsFunction("degree", function(degree, max3) { - return degree > max3; - }), - minIndegree: defineDegreeBoundsFunction("indegree", function(degree, min3) { - return degree < min3; - }), - maxIndegree: defineDegreeBoundsFunction("indegree", function(degree, max3) { - return degree > max3; - }), - minOutdegree: defineDegreeBoundsFunction("outdegree", function(degree, min3) { - return degree < min3; - }), - maxOutdegree: defineDegreeBoundsFunction("outdegree", function(degree, max3) { - return degree > max3; - }) - }); - extend2(elesfn$d, { - totalDegree: function totalDegree(includeLoops) { - var total = 0; - var nodes2 = this.nodes(); - for (var i3 = 0; i3 < nodes2.length; i3++) { - total += nodes2[i3].degree(includeLoops); - } - return total; - } - }); - var fn$4, elesfn$c; - var beforePositionSet = function beforePositionSet2(eles, newPos, silent) { - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - if (!ele.locked()) { - var oldPos = ele._private.position; - var delta = { - x: newPos.x != null ? newPos.x - oldPos.x : 0, - y: newPos.y != null ? newPos.y - oldPos.y : 0 - }; - if (ele.isParent() && !(delta.x === 0 && delta.y === 0)) { - ele.children().shift(delta, silent); - } - ele.dirtyBoundingBoxCache(); - } - } - }; - var positionDef = { - field: "position", - bindingEvent: "position", - allowBinding: true, - allowSetting: true, - settingEvent: "position", - settingTriggersEvent: true, - triggerFnName: "emitAndNotify", - allowGetting: true, - validKeys: ["x", "y"], - beforeGet: function beforeGet(ele) { - ele.updateCompoundBounds(); - }, - beforeSet: function beforeSet(eles, newPos) { - beforePositionSet(eles, newPos, false); - }, - onSet: function onSet(eles) { - eles.dirtyCompoundBoundsCache(); - }, - canSet: function canSet(ele) { - return !ele.locked(); - } - }; - fn$4 = elesfn$c = { - position: define3.data(positionDef), - // position but no notification to renderer - silentPosition: define3.data(extend2({}, positionDef, { - allowBinding: false, - allowSetting: true, - settingTriggersEvent: false, - allowGetting: false, - beforeSet: function beforeSet(eles, newPos) { - beforePositionSet(eles, newPos, true); - }, - onSet: function onSet(eles) { - eles.dirtyCompoundBoundsCache(); - } - })), - positions: function positions(pos, silent) { - if (plainObject(pos)) { - if (silent) { - this.silentPosition(pos); - } else { - this.position(pos); - } - } else if (fn$6(pos)) { - var _fn = pos; - var cy = this.cy(); - cy.startBatch(); - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var _pos = void 0; - if (_pos = _fn(ele, i3)) { - if (silent) { - ele.silentPosition(_pos); - } else { - ele.position(_pos); - } - } - } - cy.endBatch(); - } - return this; - }, - silentPositions: function silentPositions(pos) { - return this.positions(pos, true); - }, - shift: function shift(dim, val, silent) { - var delta; - if (plainObject(dim)) { - delta = { - x: number$12(dim.x) ? dim.x : 0, - y: number$12(dim.y) ? dim.y : 0 - }; - silent = val; - } else if (string2(dim) && number$12(val)) { - delta = { - x: 0, - y: 0 - }; - delta[dim] = val; - } - if (delta != null) { - var cy = this.cy(); - cy.startBatch(); - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - if (cy.hasCompoundNodes() && ele.isChild() && ele.ancestors().anySame(this)) { - continue; - } - var pos = ele.position(); - var newPos = { - x: pos.x + delta.x, - y: pos.y + delta.y - }; - if (silent) { - ele.silentPosition(newPos); - } else { - ele.position(newPos); - } - } - cy.endBatch(); - } - return this; - }, - silentShift: function silentShift(dim, val) { - if (plainObject(dim)) { - this.shift(dim, true); - } else if (string2(dim) && number$12(val)) { - this.shift(dim, val, true); - } - return this; - }, - // get/set the rendered (i.e. on screen) positon of the element - renderedPosition: function renderedPosition(dim, val) { - var ele = this[0]; - var cy = this.cy(); - var zoom = cy.zoom(); - var pan = cy.pan(); - var rpos = plainObject(dim) ? dim : void 0; - var setting = rpos !== void 0 || val !== void 0 && string2(dim); - if (ele && ele.isNode()) { - if (setting) { - for (var i3 = 0; i3 < this.length; i3++) { - var _ele = this[i3]; - if (val !== void 0) { - _ele.position(dim, (val - pan[dim]) / zoom); - } else if (rpos !== void 0) { - _ele.position(renderedToModelPosition(rpos, zoom, pan)); - } - } - } else { - var pos = ele.position(); - rpos = modelToRenderedPosition(pos, zoom, pan); - if (dim === void 0) { - return rpos; - } else { - return rpos[dim]; - } - } - } else if (!setting) { - return void 0; - } - return this; - }, - // get/set the position relative to the parent - relativePosition: function relativePosition(dim, val) { - var ele = this[0]; - var cy = this.cy(); - var ppos = plainObject(dim) ? dim : void 0; - var setting = ppos !== void 0 || val !== void 0 && string2(dim); - var hasCompoundNodes = cy.hasCompoundNodes(); - if (ele && ele.isNode()) { - if (setting) { - for (var i3 = 0; i3 < this.length; i3++) { - var _ele2 = this[i3]; - var parent = hasCompoundNodes ? _ele2.parent() : null; - var hasParent = parent && parent.length > 0; - var relativeToParent = hasParent; - if (hasParent) { - parent = parent[0]; - } - var origin = relativeToParent ? parent.position() : { - x: 0, - y: 0 - }; - if (val !== void 0) { - _ele2.position(dim, val + origin[dim]); - } else if (ppos !== void 0) { - _ele2.position({ - x: ppos.x + origin.x, - y: ppos.y + origin.y - }); - } - } - } else { - var pos = ele.position(); - var _parent = hasCompoundNodes ? ele.parent() : null; - var _hasParent = _parent && _parent.length > 0; - var _relativeToParent = _hasParent; - if (_hasParent) { - _parent = _parent[0]; - } - var _origin = _relativeToParent ? _parent.position() : { - x: 0, - y: 0 - }; - ppos = { - x: pos.x - _origin.x, - y: pos.y - _origin.y - }; - if (dim === void 0) { - return ppos; - } else { - return ppos[dim]; - } - } - } else if (!setting) { - return void 0; - } - return this; - } - }; - fn$4.modelPosition = fn$4.point = fn$4.position; - fn$4.modelPositions = fn$4.points = fn$4.positions; - fn$4.renderedPoint = fn$4.renderedPosition; - fn$4.relativePoint = fn$4.relativePosition; - var position2 = elesfn$c; - var fn$3, elesfn$b; - fn$3 = elesfn$b = {}; - elesfn$b.renderedBoundingBox = function(options2) { - var bb = this.boundingBox(options2); - var cy = this.cy(); - var zoom = cy.zoom(); - var pan = cy.pan(); - var x1 = bb.x1 * zoom + pan.x; - var x2 = bb.x2 * zoom + pan.x; - var y1 = bb.y1 * zoom + pan.y; - var y2 = bb.y2 * zoom + pan.y; - return { - x1, - x2, - y1, - y2, - w: x2 - x1, - h: y2 - y1 - }; - }; - elesfn$b.dirtyCompoundBoundsCache = function() { - var silent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; - var cy = this.cy(); - if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { - return this; - } - this.forEachUp(function(ele) { - if (ele.isParent()) { - var _p = ele._private; - _p.compoundBoundsClean = false; - _p.bbCache = null; - if (!silent) { - ele.emitAndNotify("bounds"); - } - } - }); - return this; - }; - elesfn$b.updateCompoundBounds = function() { - var force = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; - var cy = this.cy(); - if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { - return this; - } - if (!force && cy.batching()) { - return this; - } - function update2(parent) { - if (!parent.isParent()) { - return; - } - var _p2 = parent._private; - var children2 = parent.children(); - var includeLabels = parent.pstyle("compound-sizing-wrt-labels").value === "include"; - var min3 = { - width: { - val: parent.pstyle("min-width").pfValue, - left: parent.pstyle("min-width-bias-left"), - right: parent.pstyle("min-width-bias-right") - }, - height: { - val: parent.pstyle("min-height").pfValue, - top: parent.pstyle("min-height-bias-top"), - bottom: parent.pstyle("min-height-bias-bottom") - } - }; - var bb = children2.boundingBox({ - includeLabels, - includeOverlays: false, - // updating the compound bounds happens outside of the regular - // cache cycle (i.e. before fired events) - useCache: false - }); - var pos = _p2.position; - if (bb.w === 0 || bb.h === 0) { - bb = { - w: parent.pstyle("width").pfValue, - h: parent.pstyle("height").pfValue - }; - bb.x1 = pos.x - bb.w / 2; - bb.x2 = pos.x + bb.w / 2; - bb.y1 = pos.y - bb.h / 2; - bb.y2 = pos.y + bb.h / 2; - } - function computeBiasValues(propDiff, propBias, propBiasComplement) { - var biasDiff = 0; - var biasComplementDiff = 0; - var biasTotal = propBias + propBiasComplement; - if (propDiff > 0 && biasTotal > 0) { - biasDiff = propBias / biasTotal * propDiff; - biasComplementDiff = propBiasComplement / biasTotal * propDiff; - } - return { - biasDiff, - biasComplementDiff - }; - } - function computePaddingValues(width2, height, paddingObject, relativeTo) { - if (paddingObject.units === "%") { - switch (relativeTo) { - case "width": - return width2 > 0 ? paddingObject.pfValue * width2 : 0; - case "height": - return height > 0 ? paddingObject.pfValue * height : 0; - case "average": - return width2 > 0 && height > 0 ? paddingObject.pfValue * (width2 + height) / 2 : 0; - case "min": - return width2 > 0 && height > 0 ? width2 > height ? paddingObject.pfValue * height : paddingObject.pfValue * width2 : 0; - case "max": - return width2 > 0 && height > 0 ? width2 > height ? paddingObject.pfValue * width2 : paddingObject.pfValue * height : 0; - default: - return 0; - } - } else if (paddingObject.units === "px") { - return paddingObject.pfValue; - } else { - return 0; - } - } - var leftVal = min3.width.left.value; - if (min3.width.left.units === "px" && min3.width.val > 0) { - leftVal = leftVal * 100 / min3.width.val; - } - var rightVal = min3.width.right.value; - if (min3.width.right.units === "px" && min3.width.val > 0) { - rightVal = rightVal * 100 / min3.width.val; - } - var topVal = min3.height.top.value; - if (min3.height.top.units === "px" && min3.height.val > 0) { - topVal = topVal * 100 / min3.height.val; - } - var bottomVal = min3.height.bottom.value; - if (min3.height.bottom.units === "px" && min3.height.val > 0) { - bottomVal = bottomVal * 100 / min3.height.val; - } - var widthBiasDiffs = computeBiasValues(min3.width.val - bb.w, leftVal, rightVal); - var diffLeft = widthBiasDiffs.biasDiff; - var diffRight = widthBiasDiffs.biasComplementDiff; - var heightBiasDiffs = computeBiasValues(min3.height.val - bb.h, topVal, bottomVal); - var diffTop = heightBiasDiffs.biasDiff; - var diffBottom = heightBiasDiffs.biasComplementDiff; - _p2.autoPadding = computePaddingValues(bb.w, bb.h, parent.pstyle("padding"), parent.pstyle("padding-relative-to").value); - _p2.autoWidth = Math.max(bb.w, min3.width.val); - pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2; - _p2.autoHeight = Math.max(bb.h, min3.height.val); - pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2; - } - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var _p = ele._private; - if (!_p.compoundBoundsClean || force) { - update2(ele); - if (!cy.batching()) { - _p.compoundBoundsClean = true; - } - } - } - return this; - }; - var noninf = function noninf2(x2) { - if (x2 === Infinity || x2 === -Infinity) { - return 0; - } - return x2; - }; - var updateBounds = function updateBounds2(b, x1, y1, x2, y2) { - if (x2 - x1 === 0 || y2 - y1 === 0) { - return; - } - if (x1 == null || y1 == null || x2 == null || y2 == null) { - return; - } - b.x1 = x1 < b.x1 ? x1 : b.x1; - b.x2 = x2 > b.x2 ? x2 : b.x2; - b.y1 = y1 < b.y1 ? y1 : b.y1; - b.y2 = y2 > b.y2 ? y2 : b.y2; - b.w = b.x2 - b.x1; - b.h = b.y2 - b.y1; - }; - var updateBoundsFromBox = function updateBoundsFromBox2(b, b2) { - if (b2 == null) { - return b; - } - return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2); - }; - var prefixedProperty = function prefixedProperty2(obj, field, prefix) { - return getPrefixedProperty(obj, field, prefix); - }; - var updateBoundsFromArrow = function updateBoundsFromArrow2(bounds3, ele, prefix) { - if (ele.cy().headless()) { - return; - } - var _p = ele._private; - var rstyle = _p.rstyle; - var halfArW = rstyle.arrowWidth / 2; - var arrowType = ele.pstyle(prefix + "-arrow-shape").value; - var x2; - var y2; - if (arrowType !== "none") { - if (prefix === "source") { - x2 = rstyle.srcX; - y2 = rstyle.srcY; - } else if (prefix === "target") { - x2 = rstyle.tgtX; - y2 = rstyle.tgtY; - } else { - x2 = rstyle.midX; - y2 = rstyle.midY; - } - var bbs = _p.arrowBounds = _p.arrowBounds || {}; - var bb = bbs[prefix] = bbs[prefix] || {}; - bb.x1 = x2 - halfArW; - bb.y1 = y2 - halfArW; - bb.x2 = x2 + halfArW; - bb.y2 = y2 + halfArW; - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - expandBoundingBox(bb, 1); - updateBounds(bounds3, bb.x1, bb.y1, bb.x2, bb.y2); - } - }; - var updateBoundsFromLabel = function updateBoundsFromLabel2(bounds3, ele, prefix) { - if (ele.cy().headless()) { - return; - } - var prefixDash; - if (prefix) { - prefixDash = prefix + "-"; - } else { - prefixDash = ""; - } - var _p = ele._private; - var rstyle = _p.rstyle; - var label = ele.pstyle(prefixDash + "label").strValue; - if (label) { - var halign = ele.pstyle("text-halign"); - var valign = ele.pstyle("text-valign"); - var labelWidth = prefixedProperty(rstyle, "labelWidth", prefix); - var labelHeight = prefixedProperty(rstyle, "labelHeight", prefix); - var labelX = prefixedProperty(rstyle, "labelX", prefix); - var labelY = prefixedProperty(rstyle, "labelY", prefix); - var marginX = ele.pstyle(prefixDash + "text-margin-x").pfValue; - var marginY = ele.pstyle(prefixDash + "text-margin-y").pfValue; - var isEdge = ele.isEdge(); - var rotation = ele.pstyle(prefixDash + "text-rotation"); - var outlineWidth = ele.pstyle("text-outline-width").pfValue; - var borderWidth = ele.pstyle("text-border-width").pfValue; - var halfBorderWidth = borderWidth / 2; - var padding2 = ele.pstyle("text-background-padding").pfValue; - var marginOfError = 2; - var lh = labelHeight; - var lw = labelWidth; - var lw_2 = lw / 2; - var lh_2 = lh / 2; - var lx1, lx2, ly1, ly2; - if (isEdge) { - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - } else { - switch (halign.value) { - case "left": - lx1 = labelX - lw; - lx2 = labelX; - break; - case "center": - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - break; - case "right": - lx1 = labelX; - lx2 = labelX + lw; - break; - } - switch (valign.value) { - case "top": - ly1 = labelY - lh; - ly2 = labelY; - break; - case "center": - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - break; - case "bottom": - ly1 = labelY; - ly2 = labelY + lh; - break; - } - } - lx1 += marginX - Math.max(outlineWidth, halfBorderWidth) - padding2 - marginOfError; - lx2 += marginX + Math.max(outlineWidth, halfBorderWidth) + padding2 + marginOfError; - ly1 += marginY - Math.max(outlineWidth, halfBorderWidth) - padding2 - marginOfError; - ly2 += marginY + Math.max(outlineWidth, halfBorderWidth) + padding2 + marginOfError; - var bbPrefix = prefix || "main"; - var bbs = _p.labelBounds; - var bb = bbs[bbPrefix] = bbs[bbPrefix] || {}; - bb.x1 = lx1; - bb.y1 = ly1; - bb.x2 = lx2; - bb.y2 = ly2; - bb.w = lx2 - lx1; - bb.h = ly2 - ly1; - var isAutorotate = isEdge && rotation.strValue === "autorotate"; - var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0; - if (isAutorotate || isPfValue) { - var theta = isAutorotate ? prefixedProperty(_p.rstyle, "labelAngle", prefix) : rotation.pfValue; - var cos3 = Math.cos(theta); - var sin3 = Math.sin(theta); - var xo = (lx1 + lx2) / 2; - var yo = (ly1 + ly2) / 2; - if (!isEdge) { - switch (halign.value) { - case "left": - xo = lx2; - break; - case "right": - xo = lx1; - break; - } - switch (valign.value) { - case "top": - yo = ly2; - break; - case "bottom": - yo = ly1; - break; - } - } - var rotate = function rotate2(x2, y2) { - x2 = x2 - xo; - y2 = y2 - yo; - return { - x: x2 * cos3 - y2 * sin3 + xo, - y: x2 * sin3 + y2 * cos3 + yo - }; - }; - var px1y1 = rotate(lx1, ly1); - var px1y2 = rotate(lx1, ly2); - var px2y1 = rotate(lx2, ly1); - var px2y2 = rotate(lx2, ly2); - lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x); - lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x); - ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y); - ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y); - } - var bbPrefixRot = bbPrefix + "Rot"; - var bbRot = bbs[bbPrefixRot] = bbs[bbPrefixRot] || {}; - bbRot.x1 = lx1; - bbRot.y1 = ly1; - bbRot.x2 = lx2; - bbRot.y2 = ly2; - bbRot.w = lx2 - lx1; - bbRot.h = ly2 - ly1; - updateBounds(bounds3, lx1, ly1, lx2, ly2); - updateBounds(_p.labelBounds.all, lx1, ly1, lx2, ly2); - } - return bounds3; - }; - var updateBoundsFromOutline = function updateBoundsFromOutline2(bounds3, ele) { - if (ele.cy().headless()) { - return; - } - var outlineOpacity = ele.pstyle("outline-opacity").value; - var outlineWidth = ele.pstyle("outline-width").value; - if (outlineOpacity > 0 && outlineWidth > 0) { - var outlineOffset = ele.pstyle("outline-offset").value; - var nodeShape = ele.pstyle("shape").value; - var outlineSize = outlineWidth + outlineOffset; - var scaleX = (bounds3.w + outlineSize * 2) / bounds3.w; - var scaleY = (bounds3.h + outlineSize * 2) / bounds3.h; - var xOffset = 0; - var yOffset = 0; - if (["diamond", "pentagon", "round-triangle"].includes(nodeShape)) { - scaleX = (bounds3.w + outlineSize * 2.4) / bounds3.w; - yOffset = -outlineSize / 3.6; - } else if (["concave-hexagon", "rhomboid", "right-rhomboid"].includes(nodeShape)) { - scaleX = (bounds3.w + outlineSize * 2.4) / bounds3.w; - } else if (nodeShape === "star") { - scaleX = (bounds3.w + outlineSize * 2.8) / bounds3.w; - scaleY = (bounds3.h + outlineSize * 2.6) / bounds3.h; - yOffset = -outlineSize / 3.8; - } else if (nodeShape === "triangle") { - scaleX = (bounds3.w + outlineSize * 2.8) / bounds3.w; - scaleY = (bounds3.h + outlineSize * 2.4) / bounds3.h; - yOffset = -outlineSize / 1.4; - } else if (nodeShape === "vee") { - scaleX = (bounds3.w + outlineSize * 4.4) / bounds3.w; - scaleY = (bounds3.h + outlineSize * 3.8) / bounds3.h; - yOffset = -outlineSize * 0.5; - } - var hDelta = bounds3.h * scaleY - bounds3.h; - var wDelta = bounds3.w * scaleX - bounds3.w; - expandBoundingBoxSides(bounds3, [Math.ceil(hDelta / 2), Math.ceil(wDelta / 2)]); - if (xOffset != 0 || yOffset !== 0) { - var oBounds = shiftBoundingBox(bounds3, xOffset, yOffset); - updateBoundingBox(bounds3, oBounds); - } - } - }; - var boundingBoxImpl = function boundingBoxImpl2(ele, options2) { - var cy = ele._private.cy; - var styleEnabled = cy.styleEnabled(); - var headless = cy.headless(); - var bounds3 = makeBoundingBox(); - var _p = ele._private; - var isNode = ele.isNode(); - var isEdge = ele.isEdge(); - var ex1, ex2, ey1, ey2; - var x2, y2; - var rstyle = _p.rstyle; - var manualExpansion = isNode && styleEnabled ? ele.pstyle("bounds-expansion").pfValue : [0]; - var isDisplayed = function isDisplayed2(ele2) { - return ele2.pstyle("display").value !== "none"; - }; - var displayed = !styleEnabled || isDisplayed(ele) && (!isEdge || isDisplayed(ele.source()) && isDisplayed(ele.target())); - if (displayed) { - var overlayOpacity = 0; - var overlayPadding = 0; - if (styleEnabled && options2.includeOverlays) { - overlayOpacity = ele.pstyle("overlay-opacity").value; - if (overlayOpacity !== 0) { - overlayPadding = ele.pstyle("overlay-padding").value; - } - } - var underlayOpacity = 0; - var underlayPadding = 0; - if (styleEnabled && options2.includeUnderlays) { - underlayOpacity = ele.pstyle("underlay-opacity").value; - if (underlayOpacity !== 0) { - underlayPadding = ele.pstyle("underlay-padding").value; - } - } - var padding2 = Math.max(overlayPadding, underlayPadding); - var w2 = 0; - var wHalf = 0; - if (styleEnabled) { - w2 = ele.pstyle("width").pfValue; - wHalf = w2 / 2; - } - if (isNode && options2.includeNodes) { - var pos = ele.position(); - x2 = pos.x; - y2 = pos.y; - var _w = ele.outerWidth(); - var halfW = _w / 2; - var h = ele.outerHeight(); - var halfH = h / 2; - ex1 = x2 - halfW; - ex2 = x2 + halfW; - ey1 = y2 - halfH; - ey2 = y2 + halfH; - updateBounds(bounds3, ex1, ey1, ex2, ey2); - if (styleEnabled && options2.includeOutlines) { - updateBoundsFromOutline(bounds3, ele); - } - } else if (isEdge && options2.includeEdges) { - if (styleEnabled && !headless) { - var curveStyle = ele.pstyle("curve-style").strValue; - ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX); - ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX); - ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY); - ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY); - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - updateBounds(bounds3, ex1, ey1, ex2, ey2); - if (curveStyle === "haystack") { - var hpts = rstyle.haystackPts; - if (hpts && hpts.length === 2) { - ex1 = hpts[0].x; - ey1 = hpts[0].y; - ex2 = hpts[1].x; - ey2 = hpts[1].y; - if (ex1 > ex2) { - var temp = ex1; - ex1 = ex2; - ex2 = temp; - } - if (ey1 > ey2) { - var _temp = ey1; - ey1 = ey2; - ey2 = _temp; - } - updateBounds(bounds3, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf); - } - } else if (curveStyle === "bezier" || curveStyle === "unbundled-bezier" || curveStyle === "segments" || curveStyle === "taxi") { - var pts2; - switch (curveStyle) { - case "bezier": - case "unbundled-bezier": - pts2 = rstyle.bezierPts; - break; - case "segments": - case "taxi": - pts2 = rstyle.linePts; - break; - } - if (pts2 != null) { - for (var j = 0; j < pts2.length; j++) { - var pt = pts2[j]; - ex1 = pt.x - wHalf; - ex2 = pt.x + wHalf; - ey1 = pt.y - wHalf; - ey2 = pt.y + wHalf; - updateBounds(bounds3, ex1, ey1, ex2, ey2); - } - } - } - } else { - var n1 = ele.source(); - var n1pos = n1.position(); - var n2 = ele.target(); - var n2pos = n2.position(); - ex1 = n1pos.x; - ex2 = n2pos.x; - ey1 = n1pos.y; - ey2 = n2pos.y; - if (ex1 > ex2) { - var _temp2 = ex1; - ex1 = ex2; - ex2 = _temp2; - } - if (ey1 > ey2) { - var _temp3 = ey1; - ey1 = ey2; - ey2 = _temp3; - } - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - updateBounds(bounds3, ex1, ey1, ex2, ey2); - } - } - if (styleEnabled && options2.includeEdges && isEdge) { - updateBoundsFromArrow(bounds3, ele, "mid-source"); - updateBoundsFromArrow(bounds3, ele, "mid-target"); - updateBoundsFromArrow(bounds3, ele, "source"); - updateBoundsFromArrow(bounds3, ele, "target"); - } - if (styleEnabled) { - var ghost = ele.pstyle("ghost").value === "yes"; - if (ghost) { - var gx = ele.pstyle("ghost-offset-x").pfValue; - var gy = ele.pstyle("ghost-offset-y").pfValue; - updateBounds(bounds3, bounds3.x1 + gx, bounds3.y1 + gy, bounds3.x2 + gx, bounds3.y2 + gy); - } - } - var bbBody = _p.bodyBounds = _p.bodyBounds || {}; - assignBoundingBox(bbBody, bounds3); - expandBoundingBoxSides(bbBody, manualExpansion); - expandBoundingBox(bbBody, 1); - if (styleEnabled) { - ex1 = bounds3.x1; - ex2 = bounds3.x2; - ey1 = bounds3.y1; - ey2 = bounds3.y2; - updateBounds(bounds3, ex1 - padding2, ey1 - padding2, ex2 + padding2, ey2 + padding2); - } - var bbOverlay = _p.overlayBounds = _p.overlayBounds || {}; - assignBoundingBox(bbOverlay, bounds3); - expandBoundingBoxSides(bbOverlay, manualExpansion); - expandBoundingBox(bbOverlay, 1); - var bbLabels = _p.labelBounds = _p.labelBounds || {}; - if (bbLabels.all != null) { - clearBoundingBox(bbLabels.all); - } else { - bbLabels.all = makeBoundingBox(); - } - if (styleEnabled && options2.includeLabels) { - if (options2.includeMainLabels) { - updateBoundsFromLabel(bounds3, ele, null); - } - if (isEdge) { - if (options2.includeSourceLabels) { - updateBoundsFromLabel(bounds3, ele, "source"); - } - if (options2.includeTargetLabels) { - updateBoundsFromLabel(bounds3, ele, "target"); - } - } - } - } - bounds3.x1 = noninf(bounds3.x1); - bounds3.y1 = noninf(bounds3.y1); - bounds3.x2 = noninf(bounds3.x2); - bounds3.y2 = noninf(bounds3.y2); - bounds3.w = noninf(bounds3.x2 - bounds3.x1); - bounds3.h = noninf(bounds3.y2 - bounds3.y1); - if (bounds3.w > 0 && bounds3.h > 0 && displayed) { - expandBoundingBoxSides(bounds3, manualExpansion); - expandBoundingBox(bounds3, 1); - } - return bounds3; - }; - var getKey = function getKey2(opts) { - var i3 = 0; - var tf = function tf2(val) { - return (val ? 1 : 0) << i3++; - }; - var key = 0; - key += tf(opts.incudeNodes); - key += tf(opts.includeEdges); - key += tf(opts.includeLabels); - key += tf(opts.includeMainLabels); - key += tf(opts.includeSourceLabels); - key += tf(opts.includeTargetLabels); - key += tf(opts.includeOverlays); - key += tf(opts.includeOutlines); - return key; - }; - var getBoundingBoxPosKey = function getBoundingBoxPosKey2(ele) { - if (ele.isEdge()) { - var p1 = ele.source().position(); - var p2 = ele.target().position(); - var r = function r2(x2) { - return Math.round(x2); - }; - return hashIntsArray([r(p1.x), r(p1.y), r(p2.x), r(p2.y)]); - } else { - return 0; - } - }; - var cachedBoundingBoxImpl = function cachedBoundingBoxImpl2(ele, opts) { - var _p = ele._private; - var bb; - var isEdge = ele.isEdge(); - var key = opts == null ? defBbOptsKey : getKey(opts); - var usingDefOpts = key === defBbOptsKey; - var currPosKey = getBoundingBoxPosKey(ele); - var isPosKeySame = _p.bbCachePosKey === currPosKey; - var useCache = opts.useCache && isPosKeySame; - var isDirty = function isDirty2(ele2) { - return ele2._private.bbCache == null || ele2._private.styleDirty; - }; - var needRecalc = !useCache || isDirty(ele) || isEdge && isDirty(ele.source()) || isDirty(ele.target()); - if (needRecalc) { - if (!isPosKeySame) { - ele.recalculateRenderedStyle(useCache); - } - bb = boundingBoxImpl(ele, defBbOpts); - _p.bbCache = bb; - _p.bbCachePosKey = currPosKey; - } else { - bb = _p.bbCache; - } - if (!usingDefOpts) { - var isNode = ele.isNode(); - bb = makeBoundingBox(); - if (opts.includeNodes && isNode || opts.includeEdges && !isNode) { - if (opts.includeOverlays) { - updateBoundsFromBox(bb, _p.overlayBounds); - } else { - updateBoundsFromBox(bb, _p.bodyBounds); - } - } - if (opts.includeLabels) { - if (opts.includeMainLabels && (!isEdge || opts.includeSourceLabels && opts.includeTargetLabels)) { - updateBoundsFromBox(bb, _p.labelBounds.all); - } else { - if (opts.includeMainLabels) { - updateBoundsFromBox(bb, _p.labelBounds.mainRot); - } - if (opts.includeSourceLabels) { - updateBoundsFromBox(bb, _p.labelBounds.sourceRot); - } - if (opts.includeTargetLabels) { - updateBoundsFromBox(bb, _p.labelBounds.targetRot); - } - } - } - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - } - return bb; - }; - var defBbOpts = { - includeNodes: true, - includeEdges: true, - includeLabels: true, - includeMainLabels: true, - includeSourceLabels: true, - includeTargetLabels: true, - includeOverlays: true, - includeUnderlays: true, - includeOutlines: true, - useCache: true - }; - var defBbOptsKey = getKey(defBbOpts); - var filledBbOpts = defaults$g(defBbOpts); - elesfn$b.boundingBox = function(options2) { - var bounds3; - if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (options2 === void 0 || options2.useCache === void 0 || options2.useCache === true)) { - if (options2 === void 0) { - options2 = defBbOpts; - } else { - options2 = filledBbOpts(options2); - } - bounds3 = cachedBoundingBoxImpl(this[0], options2); - } else { - bounds3 = makeBoundingBox(); - options2 = options2 || defBbOpts; - var opts = filledBbOpts(options2); - var eles = this; - var cy = eles.cy(); - var styleEnabled = cy.styleEnabled(); - if (styleEnabled) { - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var _p = ele._private; - var currPosKey = getBoundingBoxPosKey(ele); - var isPosKeySame = _p.bbCachePosKey === currPosKey; - var useCache = opts.useCache && isPosKeySame && !_p.styleDirty; - ele.recalculateRenderedStyle(useCache); - } - } - this.updateCompoundBounds(!options2.useCache); - for (var _i6 = 0; _i6 < eles.length; _i6++) { - var _ele = eles[_i6]; - updateBoundsFromBox(bounds3, cachedBoundingBoxImpl(_ele, opts)); - } - } - bounds3.x1 = noninf(bounds3.x1); - bounds3.y1 = noninf(bounds3.y1); - bounds3.x2 = noninf(bounds3.x2); - bounds3.y2 = noninf(bounds3.y2); - bounds3.w = noninf(bounds3.x2 - bounds3.x1); - bounds3.h = noninf(bounds3.y2 - bounds3.y1); - return bounds3; - }; - elesfn$b.dirtyBoundingBoxCache = function() { - for (var i3 = 0; i3 < this.length; i3++) { - var _p = this[i3]._private; - _p.bbCache = null; - _p.bbCachePosKey = null; - _p.bodyBounds = null; - _p.overlayBounds = null; - _p.labelBounds.all = null; - _p.labelBounds.source = null; - _p.labelBounds.target = null; - _p.labelBounds.main = null; - _p.labelBounds.sourceRot = null; - _p.labelBounds.targetRot = null; - _p.labelBounds.mainRot = null; - _p.arrowBounds.source = null; - _p.arrowBounds.target = null; - _p.arrowBounds["mid-source"] = null; - _p.arrowBounds["mid-target"] = null; - } - this.emitAndNotify("bounds"); - return this; - }; - elesfn$b.boundingBoxAt = function(fn2) { - var nodes2 = this.nodes(); - var cy = this.cy(); - var hasCompoundNodes = cy.hasCompoundNodes(); - var parents2 = cy.collection(); - if (hasCompoundNodes) { - parents2 = nodes2.filter(function(node2) { - return node2.isParent(); - }); - nodes2 = nodes2.not(parents2); - } - if (plainObject(fn2)) { - var obj = fn2; - fn2 = function fn3() { - return obj; - }; - } - var storeOldPos = function storeOldPos2(node2, i3) { - return node2._private.bbAtOldPos = fn2(node2, i3); - }; - var getOldPos = function getOldPos2(node2) { - return node2._private.bbAtOldPos; - }; - cy.startBatch(); - nodes2.forEach(storeOldPos).silentPositions(fn2); - if (hasCompoundNodes) { - parents2.dirtyCompoundBoundsCache(); - parents2.dirtyBoundingBoxCache(); - parents2.updateCompoundBounds(true); - } - var bb = copyBoundingBox(this.boundingBox({ - useCache: false - })); - nodes2.silentPositions(getOldPos); - if (hasCompoundNodes) { - parents2.dirtyCompoundBoundsCache(); - parents2.dirtyBoundingBoxCache(); - parents2.updateCompoundBounds(true); - } - cy.endBatch(); - return bb; - }; - fn$3.boundingbox = fn$3.bb = fn$3.boundingBox; - fn$3.renderedBoundingbox = fn$3.renderedBoundingBox; - var bounds2 = elesfn$b; - var fn$2, elesfn$a; - fn$2 = elesfn$a = {}; - var defineDimFns = function defineDimFns2(opts) { - opts.uppercaseName = capitalize(opts.name); - opts.autoName = "auto" + opts.uppercaseName; - opts.labelName = "label" + opts.uppercaseName; - opts.outerName = "outer" + opts.uppercaseName; - opts.uppercaseOuterName = capitalize(opts.outerName); - fn$2[opts.name] = function dimImpl() { - var ele = this[0]; - var _p = ele._private; - var cy = _p.cy; - var styleEnabled = cy._private.styleEnabled; - if (ele) { - if (styleEnabled) { - if (ele.isParent()) { - ele.updateCompoundBounds(); - return _p[opts.autoName] || 0; - } - var d = ele.pstyle(opts.name); - switch (d.strValue) { - case "label": - ele.recalculateRenderedStyle(); - return _p.rstyle[opts.labelName] || 0; - default: - return d.pfValue; - } - } else { - return 1; - } - } - }; - fn$2["outer" + opts.uppercaseName] = function outerDimImpl() { - var ele = this[0]; - var _p = ele._private; - var cy = _p.cy; - var styleEnabled = cy._private.styleEnabled; - if (ele) { - if (styleEnabled) { - var dim = ele[opts.name](); - var border = ele.pstyle("border-width").pfValue; - var padding2 = 2 * ele.padding(); - return dim + border + padding2; - } else { - return 1; - } - } - }; - fn$2["rendered" + opts.uppercaseName] = function renderedDimImpl() { - var ele = this[0]; - if (ele) { - var d = ele[opts.name](); - return d * this.cy().zoom(); - } - }; - fn$2["rendered" + opts.uppercaseOuterName] = function renderedOuterDimImpl() { - var ele = this[0]; - if (ele) { - var od = ele[opts.outerName](); - return od * this.cy().zoom(); - } - }; - }; - defineDimFns({ - name: "width" - }); - defineDimFns({ - name: "height" - }); - elesfn$a.padding = function() { - var ele = this[0]; - var _p = ele._private; - if (ele.isParent()) { - ele.updateCompoundBounds(); - if (_p.autoPadding !== void 0) { - return _p.autoPadding; - } else { - return ele.pstyle("padding").pfValue; - } - } else { - return ele.pstyle("padding").pfValue; - } - }; - elesfn$a.paddedHeight = function() { - var ele = this[0]; - return ele.height() + 2 * ele.padding(); - }; - elesfn$a.paddedWidth = function() { - var ele = this[0]; - return ele.width() + 2 * ele.padding(); - }; - var widthHeight = elesfn$a; - var ifEdge = function ifEdge2(ele, getValue3) { - if (ele.isEdge()) { - return getValue3(ele); - } - }; - var ifEdgeRenderedPosition = function ifEdgeRenderedPosition2(ele, getPoint) { - if (ele.isEdge()) { - var cy = ele.cy(); - return modelToRenderedPosition(getPoint(ele), cy.zoom(), cy.pan()); - } - }; - var ifEdgeRenderedPositions = function ifEdgeRenderedPositions2(ele, getPoints) { - if (ele.isEdge()) { - var cy = ele.cy(); - var pan = cy.pan(); - var zoom = cy.zoom(); - return getPoints(ele).map(function(p2) { - return modelToRenderedPosition(p2, zoom, pan); - }); - } - }; - var controlPoints2 = function controlPoints3(ele) { - return ele.renderer().getControlPoints(ele); - }; - var segmentPoints = function segmentPoints2(ele) { - return ele.renderer().getSegmentPoints(ele); - }; - var sourceEndpoint = function sourceEndpoint2(ele) { - return ele.renderer().getSourceEndpoint(ele); - }; - var targetEndpoint = function targetEndpoint2(ele) { - return ele.renderer().getTargetEndpoint(ele); - }; - var midpoint = function midpoint2(ele) { - return ele.renderer().getEdgeMidpoint(ele); - }; - var pts = { - controlPoints: { - get: controlPoints2, - mult: true - }, - segmentPoints: { - get: segmentPoints, - mult: true - }, - sourceEndpoint: { - get: sourceEndpoint - }, - targetEndpoint: { - get: targetEndpoint - }, - midpoint: { - get: midpoint - } - }; - var renderedName = function renderedName2(name) { - return "rendered" + name[0].toUpperCase() + name.substr(1); - }; - var edgePoints = Object.keys(pts).reduce(function(obj, name) { - var spec = pts[name]; - var rName = renderedName(name); - obj[name] = function() { - return ifEdge(this, spec.get); - }; - if (spec.mult) { - obj[rName] = function() { - return ifEdgeRenderedPositions(this, spec.get); - }; - } else { - obj[rName] = function() { - return ifEdgeRenderedPosition(this, spec.get); - }; - } - return obj; - }, {}); - var dimensions = extend2({}, position2, bounds2, widthHeight, edgePoints); - /*! - Event object based on jQuery events, MIT license - - https://jquery.org/license/ - https://tldrlegal.com/license/mit-license - https://github.com/jquery/jquery/blob/master/src/event.js - */ - var Event = function Event2(src, props) { - this.recycle(src, props); - }; - function returnFalse() { - return false; - } - function returnTrue() { - return true; - } - Event.prototype = { - instanceString: function instanceString() { - return "event"; - }, - recycle: function recycle(src, props) { - this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; - if (src != null && src.preventDefault) { - this.type = src.type; - this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse; - } else if (src != null && src.type) { - props = src; - } else { - this.type = src; - } - if (props != null) { - this.originalEvent = props.originalEvent; - this.type = props.type != null ? props.type : this.type; - this.cy = props.cy; - this.target = props.target; - this.position = props.position; - this.renderedPosition = props.renderedPosition; - this.namespace = props.namespace; - this.layout = props.layout; - } - if (this.cy != null && this.position != null && this.renderedPosition == null) { - var pos = this.position; - var zoom = this.cy.zoom(); - var pan = this.cy.pan(); - this.renderedPosition = { - x: pos.x * zoom + pan.x, - y: pos.y * zoom + pan.y - }; - } - this.timeStamp = src && src.timeStamp || Date.now(); - }, - preventDefault: function preventDefault() { - this.isDefaultPrevented = returnTrue; - var e = this.originalEvent; - if (!e) { - return; - } - if (e.preventDefault) { - e.preventDefault(); - } - }, - stopPropagation: function stopPropagation() { - this.isPropagationStopped = returnTrue; - var e = this.originalEvent; - if (!e) { - return; - } - if (e.stopPropagation) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function stopImmediatePropagation() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse - }; - var eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; - var universalNamespace = ".*"; - var defaults$8 = { - qualifierCompare: function qualifierCompare(q1, q2) { - return q1 === q2; - }, - eventMatches: function eventMatches() { - return true; - }, - addEventFields: function addEventFields() { - }, - callbackContext: function callbackContext(context) { - return context; - }, - beforeEmit: function beforeEmit() { - }, - afterEmit: function afterEmit() { - }, - bubble: function bubble() { - return false; - }, - parent: function parent() { - return null; - }, - context: null - }; - var defaultsKeys = Object.keys(defaults$8); - var emptyOpts = {}; - function Emitter() { - var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyOpts; - var context = arguments.length > 1 ? arguments[1] : void 0; - for (var i3 = 0; i3 < defaultsKeys.length; i3++) { - var key = defaultsKeys[i3]; - this[key] = opts[key] || defaults$8[key]; - } - this.context = context || this.context; - this.listeners = []; - this.emitting = 0; - } - var p = Emitter.prototype; - var forEachEvent = function forEachEvent2(self2, handler, events, qualifier, callback, conf2, confOverrides) { - if (fn$6(qualifier)) { - callback = qualifier; - qualifier = null; - } - if (confOverrides) { - if (conf2 == null) { - conf2 = confOverrides; - } else { - conf2 = extend2({}, conf2, confOverrides); - } - } - var eventList = array2(events) ? events : events.split(/\s+/); - for (var i3 = 0; i3 < eventList.length; i3++) { - var evt = eventList[i3]; - if (emptyString(evt)) { - continue; - } - var match2 = evt.match(eventRegex); - if (match2) { - var type2 = match2[1]; - var namespace2 = match2[2] ? match2[2] : null; - var ret = handler(self2, evt, type2, namespace2, qualifier, callback, conf2); - if (ret === false) { - break; - } - } - } - }; - var makeEventObj = function makeEventObj2(self2, obj) { - self2.addEventFields(self2.context, obj); - return new Event(obj.type, obj); - }; - var forEachEventObj = function forEachEventObj2(self2, handler, events) { - if (event(events)) { - handler(self2, events); - return; - } else if (plainObject(events)) { - handler(self2, makeEventObj(self2, events)); - return; - } - var eventList = array2(events) ? events : events.split(/\s+/); - for (var i3 = 0; i3 < eventList.length; i3++) { - var evt = eventList[i3]; - if (emptyString(evt)) { - continue; - } - var match2 = evt.match(eventRegex); - if (match2) { - var type2 = match2[1]; - var namespace2 = match2[2] ? match2[2] : null; - var eventObj = makeEventObj(self2, { - type: type2, - namespace: namespace2, - target: self2.context - }); - handler(self2, eventObj); - } - } - }; - p.on = p.addListener = function(events, qualifier, callback, conf2, confOverrides) { - forEachEvent(this, function(self2, event2, type2, namespace2, qualifier2, callback2, conf3) { - if (fn$6(callback2)) { - self2.listeners.push({ - event: event2, - // full event string - callback: callback2, - // callback to run - type: type2, - // the event type (e.g. 'click') - namespace: namespace2, - // the event namespace (e.g. ".foo") - qualifier: qualifier2, - // a restriction on whether to match this emitter - conf: conf3 - // additional configuration - }); - } - }, events, qualifier, callback, conf2, confOverrides); - return this; - }; - p.one = function(events, qualifier, callback, conf2) { - return this.on(events, qualifier, callback, conf2, { - one: true - }); - }; - p.removeListener = p.off = function(events, qualifier, callback, conf2) { - var _this = this; - if (this.emitting !== 0) { - this.listeners = copyArray$1(this.listeners); - } - var listeners = this.listeners; - var _loop = function _loop2(i4) { - var listener = listeners[i4]; - forEachEvent(_this, function(self2, event2, type2, namespace2, qualifier2, callback2) { - if ((listener.type === type2 || events === "*") && (!namespace2 && listener.namespace !== ".*" || listener.namespace === namespace2) && (!qualifier2 || self2.qualifierCompare(listener.qualifier, qualifier2)) && (!callback2 || listener.callback === callback2)) { - listeners.splice(i4, 1); - return false; - } - }, events, qualifier, callback, conf2); - }; - for (var i3 = listeners.length - 1; i3 >= 0; i3--) { - _loop(i3); - } - return this; - }; - p.removeAllListeners = function() { - return this.removeListener("*"); - }; - p.emit = p.trigger = function(events, extraParams, manualCallback) { - var listeners = this.listeners; - var numListenersBeforeEmit = listeners.length; - this.emitting++; - if (!array2(extraParams)) { - extraParams = [extraParams]; - } - forEachEventObj(this, function(self2, eventObj) { - if (manualCallback != null) { - listeners = [{ - event: eventObj.event, - type: eventObj.type, - namespace: eventObj.namespace, - callback: manualCallback - }]; - numListenersBeforeEmit = listeners.length; - } - var _loop2 = function _loop22(i4) { - var listener = listeners[i4]; - if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self2.eventMatches(self2.context, listener, eventObj)) { - var args = [eventObj]; - if (extraParams != null) { - push2(args, extraParams); - } - self2.beforeEmit(self2.context, listener, eventObj); - if (listener.conf && listener.conf.one) { - self2.listeners = self2.listeners.filter(function(l) { - return l !== listener; - }); - } - var context = self2.callbackContext(self2.context, listener, eventObj); - var ret = listener.callback.apply(context, args); - self2.afterEmit(self2.context, listener, eventObj); - if (ret === false) { - eventObj.stopPropagation(); - eventObj.preventDefault(); - } - } - }; - for (var i3 = 0; i3 < numListenersBeforeEmit; i3++) { - _loop2(i3); - } - if (self2.bubble(self2.context) && !eventObj.isPropagationStopped()) { - self2.parent(self2.context).emit(eventObj, extraParams); - } - }, events); - this.emitting--; - return this; - }; - var emitterOptions$1 = { - qualifierCompare: function qualifierCompare(selector1, selector2) { - if (selector1 == null || selector2 == null) { - return selector1 == null && selector2 == null; - } else { - return selector1.sameText(selector2); - } - }, - eventMatches: function eventMatches(ele, listener, eventObj) { - var selector2 = listener.qualifier; - if (selector2 != null) { - return ele !== eventObj.target && element2(eventObj.target) && selector2.matches(eventObj.target); - } - return true; - }, - addEventFields: function addEventFields(ele, evt) { - evt.cy = ele.cy(); - evt.target = ele; - }, - callbackContext: function callbackContext(ele, listener, eventObj) { - return listener.qualifier != null ? eventObj.target : ele; - }, - beforeEmit: function beforeEmit(context, listener) { - if (listener.conf && listener.conf.once) { - listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback); - } - }, - bubble: function bubble() { - return true; - }, - parent: function parent(ele) { - return ele.isChild() ? ele.parent() : ele.cy(); - } - }; - var argSelector$1 = function argSelector2(arg) { - if (string2(arg)) { - return new Selector(arg); - } else { - return arg; - } - }; - var elesfn$9 = { - createEmitter: function createEmitter() { - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var _p = ele._private; - if (!_p.emitter) { - _p.emitter = new Emitter(emitterOptions$1, ele); - } - } - return this; - }, - emitter: function emitter() { - return this._private.emitter; - }, - on: function on(events, selector2, callback) { - var argSel = argSelector$1(selector2); - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - ele.emitter().on(events, argSel, callback); - } - return this; - }, - removeListener: function removeListener(events, selector2, callback) { - var argSel = argSelector$1(selector2); - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - ele.emitter().removeListener(events, argSel, callback); - } - return this; - }, - removeAllListeners: function removeAllListeners() { - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - ele.emitter().removeAllListeners(); - } - return this; - }, - one: function one2(events, selector2, callback) { - var argSel = argSelector$1(selector2); - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - ele.emitter().one(events, argSel, callback); - } - return this; - }, - once: function once(events, selector2, callback) { - var argSel = argSelector$1(selector2); - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - ele.emitter().on(events, argSel, callback, { - once: true, - onceCollection: this - }); - } - }, - emit: function emit(events, extraParams) { - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - ele.emitter().emit(events, extraParams); - } - return this; - }, - emitAndNotify: function emitAndNotify(event2, extraParams) { - if (this.length === 0) { - return; - } - this.cy().notify(event2, this); - this.emit(event2, extraParams); - return this; - } - }; - define3.eventAliasesOn(elesfn$9); - var elesfn$8 = { - nodes: function nodes2(selector2) { - return this.filter(function(ele) { - return ele.isNode(); - }).filter(selector2); - }, - edges: function edges2(selector2) { - return this.filter(function(ele) { - return ele.isEdge(); - }).filter(selector2); - }, - // internal helper to get nodes and edges as separate collections with single iteration over elements - byGroup: function byGroup() { - var nodes2 = this.spawn(); - var edges2 = this.spawn(); - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - if (ele.isNode()) { - nodes2.push(ele); - } else { - edges2.push(ele); - } - } - return { - nodes: nodes2, - edges: edges2 - }; - }, - filter: function filter3(_filter, thisArg) { - if (_filter === void 0) { - return this; - } else if (string2(_filter) || elementOrCollection(_filter)) { - return new Selector(_filter).filter(this); - } else if (fn$6(_filter)) { - var filterEles = this.spawn(); - var eles = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var include = thisArg ? _filter.apply(thisArg, [ele, i3, eles]) : _filter(ele, i3, eles); - if (include) { - filterEles.push(ele); - } - } - return filterEles; - } - return this.spawn(); - }, - not: function not(toRemove) { - if (!toRemove) { - return this; - } else { - if (string2(toRemove)) { - toRemove = this.filter(toRemove); - } - var elements2 = this.spawn(); - for (var i3 = 0; i3 < this.length; i3++) { - var element3 = this[i3]; - var remove2 = toRemove.has(element3); - if (!remove2) { - elements2.push(element3); - } - } - return elements2; - } - }, - absoluteComplement: function absoluteComplement() { - var cy = this.cy(); - return cy.mutableElements().not(this); - }, - intersect: function intersect2(other) { - if (string2(other)) { - var selector2 = other; - return this.filter(selector2); - } - var elements2 = this.spawn(); - var col1 = this; - var col2 = other; - var col1Smaller = this.length < other.length; - var colS = col1Smaller ? col1 : col2; - var colL = col1Smaller ? col2 : col1; - for (var i3 = 0; i3 < colS.length; i3++) { - var ele = colS[i3]; - if (colL.has(ele)) { - elements2.push(ele); - } - } - return elements2; - }, - xor: function xor(other) { - var cy = this._private.cy; - if (string2(other)) { - other = cy.$(other); - } - var elements2 = this.spawn(); - var col1 = this; - var col2 = other; - var add = function add2(col, other2) { - for (var i3 = 0; i3 < col.length; i3++) { - var ele = col[i3]; - var id2 = ele._private.data.id; - var inOther = other2.hasElementWithId(id2); - if (!inOther) { - elements2.push(ele); - } - } - }; - add(col1, col2); - add(col2, col1); - return elements2; - }, - diff: function diff(other) { - var cy = this._private.cy; - if (string2(other)) { - other = cy.$(other); - } - var left2 = this.spawn(); - var right2 = this.spawn(); - var both = this.spawn(); - var col1 = this; - var col2 = other; - var add = function add2(col, other2, retEles) { - for (var i3 = 0; i3 < col.length; i3++) { - var ele = col[i3]; - var id2 = ele._private.data.id; - var inOther = other2.hasElementWithId(id2); - if (inOther) { - both.merge(ele); - } else { - retEles.push(ele); - } - } - }; - add(col1, col2, left2); - add(col2, col1, right2); - return { - left: left2, - right: right2, - both - }; - }, - add: function add(toAdd) { - var cy = this._private.cy; - if (!toAdd) { - return this; - } - if (string2(toAdd)) { - var selector2 = toAdd; - toAdd = cy.mutableElements().filter(selector2); - } - var elements2 = this.spawnSelf(); - for (var i3 = 0; i3 < toAdd.length; i3++) { - var ele = toAdd[i3]; - var add2 = !this.has(ele); - if (add2) { - elements2.push(ele); - } - } - return elements2; - }, - // in place merge on calling collection - merge: function merge2(toAdd) { - var _p = this._private; - var cy = _p.cy; - if (!toAdd) { - return this; - } - if (toAdd && string2(toAdd)) { - var selector2 = toAdd; - toAdd = cy.mutableElements().filter(selector2); - } - var map2 = _p.map; - for (var i3 = 0; i3 < toAdd.length; i3++) { - var toAddEle = toAdd[i3]; - var id2 = toAddEle._private.data.id; - var add = !map2.has(id2); - if (add) { - var index2 = this.length++; - this[index2] = toAddEle; - map2.set(id2, { - ele: toAddEle, - index: index2 - }); - } - } - return this; - }, - unmergeAt: function unmergeAt(i3) { - var ele = this[i3]; - var id2 = ele.id(); - var _p = this._private; - var map2 = _p.map; - this[i3] = void 0; - map2["delete"](id2); - var unmergedLastEle = i3 === this.length - 1; - if (this.length > 1 && !unmergedLastEle) { - var lastEleI = this.length - 1; - var lastEle = this[lastEleI]; - var lastEleId = lastEle._private.data.id; - this[lastEleI] = void 0; - this[i3] = lastEle; - map2.set(lastEleId, { - ele: lastEle, - index: i3 - }); - } - this.length--; - return this; - }, - // remove single ele in place in calling collection - unmergeOne: function unmergeOne(ele) { - ele = ele[0]; - var _p = this._private; - var id2 = ele._private.data.id; - var map2 = _p.map; - var entry = map2.get(id2); - if (!entry) { - return this; - } - var i3 = entry.index; - this.unmergeAt(i3); - return this; - }, - // remove eles in place on calling collection - unmerge: function unmerge(toRemove) { - var cy = this._private.cy; - if (!toRemove) { - return this; - } - if (toRemove && string2(toRemove)) { - var selector2 = toRemove; - toRemove = cy.mutableElements().filter(selector2); - } - for (var i3 = 0; i3 < toRemove.length; i3++) { - this.unmergeOne(toRemove[i3]); - } - return this; - }, - unmergeBy: function unmergeBy(toRmFn) { - for (var i3 = this.length - 1; i3 >= 0; i3--) { - var ele = this[i3]; - if (toRmFn(ele)) { - this.unmergeAt(i3); - } - } - return this; - }, - map: function map2(mapFn, thisArg) { - var arr = []; - var eles = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var ret = thisArg ? mapFn.apply(thisArg, [ele, i3, eles]) : mapFn(ele, i3, eles); - arr.push(ret); - } - return arr; - }, - reduce: function reduce2(fn2, initialValue) { - var val = initialValue; - var eles = this; - for (var i3 = 0; i3 < eles.length; i3++) { - val = fn2(val, eles[i3], i3, eles); - } - return val; - }, - max: function max3(valFn, thisArg) { - var max4 = -Infinity; - var maxEle; - var eles = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var val = thisArg ? valFn.apply(thisArg, [ele, i3, eles]) : valFn(ele, i3, eles); - if (val > max4) { - max4 = val; - maxEle = ele; - } - } - return { - value: max4, - ele: maxEle - }; - }, - min: function min3(valFn, thisArg) { - var min4 = Infinity; - var minEle; - var eles = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var val = thisArg ? valFn.apply(thisArg, [ele, i3, eles]) : valFn(ele, i3, eles); - if (val < min4) { - min4 = val; - minEle = ele; - } - } - return { - value: min4, - ele: minEle - }; - } - }; - var fn$1 = elesfn$8; - fn$1["u"] = fn$1["|"] = fn$1["+"] = fn$1.union = fn$1.or = fn$1.add; - fn$1["\\"] = fn$1["!"] = fn$1["-"] = fn$1.difference = fn$1.relativeComplement = fn$1.subtract = fn$1.not; - fn$1["n"] = fn$1["&"] = fn$1["."] = fn$1.and = fn$1.intersection = fn$1.intersect; - fn$1["^"] = fn$1["(+)"] = fn$1["(-)"] = fn$1.symmetricDifference = fn$1.symdiff = fn$1.xor; - fn$1.fnFilter = fn$1.filterFn = fn$1.stdFilter = fn$1.filter; - fn$1.complement = fn$1.abscomp = fn$1.absoluteComplement; - var elesfn$7 = { - isNode: function isNode() { - return this.group() === "nodes"; - }, - isEdge: function isEdge() { - return this.group() === "edges"; - }, - isLoop: function isLoop() { - return this.isEdge() && this.source()[0] === this.target()[0]; - }, - isSimple: function isSimple() { - return this.isEdge() && this.source()[0] !== this.target()[0]; - }, - group: function group() { - var ele = this[0]; - if (ele) { - return ele._private.group; - } - } - }; - var zIndexSort = function zIndexSort2(a, b) { - var cy = a.cy(); - var hasCompoundNodes = cy.hasCompoundNodes(); - function getDepth(ele) { - var style = ele.pstyle("z-compound-depth"); - if (style.value === "auto") { - return hasCompoundNodes ? ele.zDepth() : 0; - } else if (style.value === "bottom") { - return -1; - } else if (style.value === "top") { - return MAX_INT$1; - } - return 0; - } - var depthDiff = getDepth(a) - getDepth(b); - if (depthDiff !== 0) { - return depthDiff; - } - function getEleDepth(ele) { - var style = ele.pstyle("z-index-compare"); - if (style.value === "auto") { - return ele.isNode() ? 1 : 0; - } - return 0; - } - var eleDiff = getEleDepth(a) - getEleDepth(b); - if (eleDiff !== 0) { - return eleDiff; - } - var zDiff = a.pstyle("z-index").value - b.pstyle("z-index").value; - if (zDiff !== 0) { - return zDiff; - } - return a.poolIndex() - b.poolIndex(); - }; - var elesfn$6 = { - forEach: function forEach2(fn2, thisArg) { - if (fn$6(fn2)) { - var N = this.length; - for (var i3 = 0; i3 < N; i3++) { - var ele = this[i3]; - var ret = thisArg ? fn2.apply(thisArg, [ele, i3, this]) : fn2(ele, i3, this); - if (ret === false) { - break; - } - } - } - return this; - }, - toArray: function toArray2() { - var array3 = []; - for (var i3 = 0; i3 < this.length; i3++) { - array3.push(this[i3]); - } - return array3; - }, - slice: function slice2(start2, end2) { - var array3 = []; - var thisSize = this.length; - if (end2 == null) { - end2 = thisSize; - } - if (start2 == null) { - start2 = 0; - } - if (start2 < 0) { - start2 = thisSize + start2; - } - if (end2 < 0) { - end2 = thisSize + end2; - } - for (var i3 = start2; i3 >= 0 && i3 < end2 && i3 < thisSize; i3++) { - array3.push(this[i3]); - } - return this.spawn(array3); - }, - size: function size2() { - return this.length; - }, - eq: function eq3(i3) { - return this[i3] || this.spawn(); - }, - first: function first() { - return this[0] || this.spawn(); - }, - last: function last2() { - return this[this.length - 1] || this.spawn(); - }, - empty: function empty2() { - return this.length === 0; - }, - nonempty: function nonempty() { - return !this.empty(); - }, - sort: function sort2(sortFn) { - if (!fn$6(sortFn)) { - return this; - } - var sorted = this.toArray().sort(sortFn); - return this.spawn(sorted); - }, - sortByZIndex: function sortByZIndex() { - return this.sort(zIndexSort); - }, - zDepth: function zDepth() { - var ele = this[0]; - if (!ele) { - return void 0; - } - var _p = ele._private; - var group = _p.group; - if (group === "nodes") { - var depth = _p.data.parent ? ele.parents().size() : 0; - if (!ele.isParent()) { - return MAX_INT$1 - 1; - } - return depth; - } else { - var src = _p.source; - var tgt = _p.target; - var srcDepth = src.zDepth(); - var tgtDepth = tgt.zDepth(); - return Math.max(srcDepth, tgtDepth, 0); - } - } - }; - elesfn$6.each = elesfn$6.forEach; - var defineSymbolIterator = function defineSymbolIterator2() { - var typeofUndef = "undefined"; - var isIteratorSupported = (typeof Symbol === "undefined" ? "undefined" : _typeof(Symbol)) != typeofUndef && _typeof(Symbol.iterator) != typeofUndef; - if (isIteratorSupported) { - elesfn$6[Symbol.iterator] = function() { - var _this = this; - var entry = { - value: void 0, - done: false - }; - var i3 = 0; - var length2 = this.length; - return _defineProperty$1({ - next: function next2() { - if (i3 < length2) { - entry.value = _this[i3++]; - } else { - entry.value = void 0; - entry.done = true; - } - return entry; - } - }, Symbol.iterator, function() { - return this; - }); - }; - } - }; - defineSymbolIterator(); - var getLayoutDimensionOptions = defaults$g({ - nodeDimensionsIncludeLabels: false - }); - var elesfn$5 = { - // Calculates and returns node dimensions { x, y } based on options given - layoutDimensions: function layoutDimensions(options2) { - options2 = getLayoutDimensionOptions(options2); - var dims; - if (!this.takesUpSpace()) { - dims = { - w: 0, - h: 0 - }; - } else if (options2.nodeDimensionsIncludeLabels) { - var bbDim = this.boundingBox(); - dims = { - w: bbDim.w, - h: bbDim.h - }; - } else { - dims = { - w: this.outerWidth(), - h: this.outerHeight() - }; - } - if (dims.w === 0 || dims.h === 0) { - dims.w = dims.h = 1; - } - return dims; - }, - // using standard layout options, apply position function (w/ or w/o animation) - layoutPositions: function layoutPositions(layout3, options2, fn2) { - var nodes2 = this.nodes().filter(function(n) { - return !n.isParent(); - }); - var cy = this.cy(); - var layoutEles = options2.eles; - var getMemoizeKey = function getMemoizeKey2(node3) { - return node3.id(); - }; - var fnMem = memoize$1(fn2, getMemoizeKey); - layout3.emit({ - type: "layoutstart", - layout: layout3 - }); - layout3.animations = []; - var calculateSpacing = function calculateSpacing2(spacing2, nodesBb, pos) { - var center2 = { - x: nodesBb.x1 + nodesBb.w / 2, - y: nodesBb.y1 + nodesBb.h / 2 - }; - var spacingVector = { - // scale from center of bounding box (not necessarily 0,0) - x: (pos.x - center2.x) * spacing2, - y: (pos.y - center2.y) * spacing2 - }; - return { - x: center2.x + spacingVector.x, - y: center2.y + spacingVector.y - }; - }; - var useSpacingFactor = options2.spacingFactor && options2.spacingFactor !== 1; - var spacingBb = function spacingBb2() { - if (!useSpacingFactor) { - return null; - } - var bb2 = makeBoundingBox(); - for (var i4 = 0; i4 < nodes2.length; i4++) { - var node3 = nodes2[i4]; - var pos = fnMem(node3, i4); - expandBoundingBoxByPoint(bb2, pos.x, pos.y); - } - return bb2; - }; - var bb = spacingBb(); - var getFinalPos = memoize$1(function(node3, i4) { - var newPos2 = fnMem(node3, i4); - if (useSpacingFactor) { - var spacing2 = Math.abs(options2.spacingFactor); - newPos2 = calculateSpacing(spacing2, bb, newPos2); - } - if (options2.transform != null) { - newPos2 = options2.transform(node3, newPos2); - } - return newPos2; - }, getMemoizeKey); - if (options2.animate) { - for (var i3 = 0; i3 < nodes2.length; i3++) { - var node2 = nodes2[i3]; - var newPos = getFinalPos(node2, i3); - var animateNode = options2.animateFilter == null || options2.animateFilter(node2, i3); - if (animateNode) { - var ani = node2.animation({ - position: newPos, - duration: options2.animationDuration, - easing: options2.animationEasing - }); - layout3.animations.push(ani); - } else { - node2.position(newPos); - } - } - if (options2.fit) { - var fitAni = cy.animation({ - fit: { - boundingBox: layoutEles.boundingBoxAt(getFinalPos), - padding: options2.padding - }, - duration: options2.animationDuration, - easing: options2.animationEasing - }); - layout3.animations.push(fitAni); - } else if (options2.zoom !== void 0 && options2.pan !== void 0) { - var zoomPanAni = cy.animation({ - zoom: options2.zoom, - pan: options2.pan, - duration: options2.animationDuration, - easing: options2.animationEasing - }); - layout3.animations.push(zoomPanAni); - } - layout3.animations.forEach(function(ani2) { - return ani2.play(); - }); - layout3.one("layoutready", options2.ready); - layout3.emit({ - type: "layoutready", - layout: layout3 - }); - Promise$12.all(layout3.animations.map(function(ani2) { - return ani2.promise(); - })).then(function() { - layout3.one("layoutstop", options2.stop); - layout3.emit({ - type: "layoutstop", - layout: layout3 - }); - }); - } else { - nodes2.positions(getFinalPos); - if (options2.fit) { - cy.fit(options2.eles, options2.padding); - } - if (options2.zoom != null) { - cy.zoom(options2.zoom); - } - if (options2.pan) { - cy.pan(options2.pan); - } - layout3.one("layoutready", options2.ready); - layout3.emit({ - type: "layoutready", - layout: layout3 - }); - layout3.one("layoutstop", options2.stop); - layout3.emit({ - type: "layoutstop", - layout: layout3 - }); - } - return this; - }, - layout: function layout3(options2) { - var cy = this.cy(); - return cy.makeLayout(extend2({}, options2, { - eles: this - })); - } - }; - elesfn$5.createLayout = elesfn$5.makeLayout = elesfn$5.layout; - function styleCache(key, fn2, ele) { - var _p = ele._private; - var cache2 = _p.styleCache = _p.styleCache || []; - var val; - if ((val = cache2[key]) != null) { - return val; - } else { - val = cache2[key] = fn2(ele); - return val; - } - } - function cacheStyleFunction(key, fn2) { - key = hashString(key); - return function cachedStyleFunction(ele) { - return styleCache(key, fn2, ele); - }; - } - function cachePrototypeStyleFunction(key, fn2) { - key = hashString(key); - var selfFn = function selfFn2(ele) { - return fn2.call(ele); - }; - return function cachedPrototypeStyleFunction() { - var ele = this[0]; - if (ele) { - return styleCache(key, selfFn, ele); - } - }; - } - var elesfn$4 = { - recalculateRenderedStyle: function recalculateRenderedStyle(useCache) { - var cy = this.cy(); - var renderer3 = cy.renderer(); - var styleEnabled = cy.styleEnabled(); - if (renderer3 && styleEnabled) { - renderer3.recalculateRenderedStyle(this, useCache); - } - return this; - }, - dirtyStyleCache: function dirtyStyleCache() { - var cy = this.cy(); - var dirty = function dirty2(ele) { - return ele._private.styleCache = null; - }; - if (cy.hasCompoundNodes()) { - var eles; - eles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); - eles.merge(eles.connectedEdges()); - eles.forEach(dirty); - } else { - this.forEach(function(ele) { - dirty(ele); - ele.connectedEdges().forEach(dirty); - }); - } - return this; - }, - // fully updates (recalculates) the style for the elements - updateStyle: function updateStyle(notifyRenderer) { - var cy = this._private.cy; - if (!cy.styleEnabled()) { - return this; - } - if (cy.batching()) { - var bEles = cy._private.batchStyleEles; - bEles.merge(this); - return this; - } - var hasCompounds = cy.hasCompoundNodes(); - var updatedEles = this; - notifyRenderer = notifyRenderer || notifyRenderer === void 0 ? true : false; - if (hasCompounds) { - updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); - } - var changedEles = updatedEles; - if (notifyRenderer) { - changedEles.emitAndNotify("style"); - } else { - changedEles.emit("style"); - } - updatedEles.forEach(function(ele) { - return ele._private.styleDirty = true; - }); - return this; - }, - // private: clears dirty flag and recalculates style - cleanStyle: function cleanStyle() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return; - } - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - if (ele._private.styleDirty) { - ele._private.styleDirty = false; - cy.style().apply(ele); - } - } - }, - // get the internal parsed style object for the specified property - parsedStyle: function parsedStyle(property2) { - var includeNonDefault = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - var ele = this[0]; - var cy = ele.cy(); - if (!cy.styleEnabled()) { - return; - } - if (ele) { - this.cleanStyle(); - var overriddenStyle = ele._private.style[property2]; - if (overriddenStyle != null) { - return overriddenStyle; - } else if (includeNonDefault) { - return cy.style().getDefaultProperty(property2); - } else { - return null; - } - } - }, - numericStyle: function numericStyle(property2) { - var ele = this[0]; - if (!ele.cy().styleEnabled()) { - return; - } - if (ele) { - var pstyle = ele.pstyle(property2); - return pstyle.pfValue !== void 0 ? pstyle.pfValue : pstyle.value; - } - }, - numericStyleUnits: function numericStyleUnits(property2) { - var ele = this[0]; - if (!ele.cy().styleEnabled()) { - return; - } - if (ele) { - return ele.pstyle(property2).units; - } - }, - // get the specified css property as a rendered value (i.e. on-screen value) - // or get the whole rendered style if no property specified (NB doesn't allow setting) - renderedStyle: function renderedStyle(property2) { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return this; - } - var ele = this[0]; - if (ele) { - return cy.style().getRenderedStyle(ele, property2); - } - }, - // read the calculated css style of the element or override the style (via a bypass) - style: function style(name, value2) { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return this; - } - var updateTransitions = false; - var style2 = cy.style(); - if (plainObject(name)) { - var props = name; - style2.applyBypass(this, props, updateTransitions); - this.emitAndNotify("style"); - } else if (string2(name)) { - if (value2 === void 0) { - var ele = this[0]; - if (ele) { - return style2.getStylePropertyValue(ele, name); - } else { - return; - } - } else { - style2.applyBypass(this, name, value2, updateTransitions); - this.emitAndNotify("style"); - } - } else if (name === void 0) { - var _ele = this[0]; - if (_ele) { - return style2.getRawStyle(_ele); - } else { - return; - } - } - return this; - }, - removeStyle: function removeStyle(names) { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return this; - } - var updateTransitions = false; - var style = cy.style(); - var eles = this; - if (names === void 0) { - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - style.removeAllBypasses(ele, updateTransitions); - } - } else { - names = names.split(/\s+/); - for (var _i6 = 0; _i6 < eles.length; _i6++) { - var _ele2 = eles[_i6]; - style.removeBypasses(_ele2, names, updateTransitions); - } - } - this.emitAndNotify("style"); - return this; - }, - show: function show() { - this.css("display", "element"); - return this; - }, - hide: function hide() { - this.css("display", "none"); - return this; - }, - effectiveOpacity: function effectiveOpacity() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return 1; - } - var hasCompoundNodes = cy.hasCompoundNodes(); - var ele = this[0]; - if (ele) { - var _p = ele._private; - var parentOpacity = ele.pstyle("opacity").value; - if (!hasCompoundNodes) { - return parentOpacity; - } - var parents2 = !_p.data.parent ? null : ele.parents(); - if (parents2) { - for (var i3 = 0; i3 < parents2.length; i3++) { - var parent = parents2[i3]; - var opacity = parent.pstyle("opacity").value; - parentOpacity = opacity * parentOpacity; - } - } - return parentOpacity; - } - }, - transparent: function transparent() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return false; - } - var ele = this[0]; - var hasCompoundNodes = ele.cy().hasCompoundNodes(); - if (ele) { - if (!hasCompoundNodes) { - return ele.pstyle("opacity").value === 0; - } else { - return ele.effectiveOpacity() === 0; - } - } - }, - backgrounding: function backgrounding() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return false; - } - var ele = this[0]; - return ele._private.backgrounding ? true : false; - } - }; - function checkCompound(ele, parentOk) { - var _p = ele._private; - var parents2 = _p.data.parent ? ele.parents() : null; - if (parents2) { - for (var i3 = 0; i3 < parents2.length; i3++) { - var parent = parents2[i3]; - if (!parentOk(parent)) { - return false; - } - } - } - return true; - } - function defineDerivedStateFunction(specs) { - var ok = specs.ok; - var edgeOkViaNode = specs.edgeOkViaNode || specs.ok; - var parentOk = specs.parentOk || specs.ok; - return function() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return true; - } - var ele = this[0]; - var hasCompoundNodes = cy.hasCompoundNodes(); - if (ele) { - var _p = ele._private; - if (!ok(ele)) { - return false; - } - if (ele.isNode()) { - return !hasCompoundNodes || checkCompound(ele, parentOk); - } else { - var src = _p.source; - var tgt = _p.target; - return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode))); - } - } - }; - } - var eleTakesUpSpace = cacheStyleFunction("eleTakesUpSpace", function(ele) { - return ele.pstyle("display").value === "element" && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true); - }); - elesfn$4.takesUpSpace = cachePrototypeStyleFunction("takesUpSpace", defineDerivedStateFunction({ - ok: eleTakesUpSpace - })); - var eleInteractive = cacheStyleFunction("eleInteractive", function(ele) { - return ele.pstyle("events").value === "yes" && ele.pstyle("visibility").value === "visible" && eleTakesUpSpace(ele); - }); - var parentInteractive = cacheStyleFunction("parentInteractive", function(parent) { - return parent.pstyle("visibility").value === "visible" && eleTakesUpSpace(parent); - }); - elesfn$4.interactive = cachePrototypeStyleFunction("interactive", defineDerivedStateFunction({ - ok: eleInteractive, - parentOk: parentInteractive, - edgeOkViaNode: eleTakesUpSpace - })); - elesfn$4.noninteractive = function() { - var ele = this[0]; - if (ele) { - return !ele.interactive(); - } - }; - var eleVisible = cacheStyleFunction("eleVisible", function(ele) { - return ele.pstyle("visibility").value === "visible" && ele.pstyle("opacity").pfValue !== 0 && eleTakesUpSpace(ele); - }); - var edgeVisibleViaNode = eleTakesUpSpace; - elesfn$4.visible = cachePrototypeStyleFunction("visible", defineDerivedStateFunction({ - ok: eleVisible, - edgeOkViaNode: edgeVisibleViaNode - })); - elesfn$4.hidden = function() { - var ele = this[0]; - if (ele) { - return !ele.visible(); - } - }; - elesfn$4.isBundledBezier = cachePrototypeStyleFunction("isBundledBezier", function() { - if (!this.cy().styleEnabled()) { - return false; - } - return !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace(); - }); - elesfn$4.bypass = elesfn$4.css = elesfn$4.style; - elesfn$4.renderedCss = elesfn$4.renderedStyle; - elesfn$4.removeBypass = elesfn$4.removeCss = elesfn$4.removeStyle; - elesfn$4.pstyle = elesfn$4.parsedStyle; - var elesfn$3 = {}; - function defineSwitchFunction(params) { - return function() { - var args = arguments; - var changedEles = []; - if (args.length === 2) { - var data2 = args[0]; - var handler = args[1]; - this.on(params.event, data2, handler); - } else if (args.length === 1 && fn$6(args[0])) { - var _handler = args[0]; - this.on(params.event, _handler); - } else if (args.length === 0 || args.length === 1 && array2(args[0])) { - var addlEvents = args.length === 1 ? args[0] : null; - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var able = !params.ableField || ele._private[params.ableField]; - var changed = ele._private[params.field] != params.value; - if (params.overrideAble) { - var overrideAble = params.overrideAble(ele); - if (overrideAble !== void 0) { - able = overrideAble; - if (!overrideAble) { - return this; - } - } - } - if (able) { - ele._private[params.field] = params.value; - if (changed) { - changedEles.push(ele); - } - } - } - var changedColl = this.spawn(changedEles); - changedColl.updateStyle(); - changedColl.emit(params.event); - if (addlEvents) { - changedColl.emit(addlEvents); - } - } - return this; - }; - } - function defineSwitchSet(params) { - elesfn$3[params.field] = function() { - var ele = this[0]; - if (ele) { - if (params.overrideField) { - var val = params.overrideField(ele); - if (val !== void 0) { - return val; - } - } - return ele._private[params.field]; - } - }; - elesfn$3[params.on] = defineSwitchFunction({ - event: params.on, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: true - }); - elesfn$3[params.off] = defineSwitchFunction({ - event: params.off, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: false - }); - } - defineSwitchSet({ - field: "locked", - overrideField: function overrideField(ele) { - return ele.cy().autolock() ? true : void 0; - }, - on: "lock", - off: "unlock" - }); - defineSwitchSet({ - field: "grabbable", - overrideField: function overrideField(ele) { - return ele.cy().autoungrabify() || ele.pannable() ? false : void 0; - }, - on: "grabify", - off: "ungrabify" - }); - defineSwitchSet({ - field: "selected", - ableField: "selectable", - overrideAble: function overrideAble(ele) { - return ele.cy().autounselectify() ? false : void 0; - }, - on: "select", - off: "unselect" - }); - defineSwitchSet({ - field: "selectable", - overrideField: function overrideField(ele) { - return ele.cy().autounselectify() ? false : void 0; - }, - on: "selectify", - off: "unselectify" - }); - elesfn$3.deselect = elesfn$3.unselect; - elesfn$3.grabbed = function() { - var ele = this[0]; - if (ele) { - return ele._private.grabbed; - } - }; - defineSwitchSet({ - field: "active", - on: "activate", - off: "unactivate" - }); - defineSwitchSet({ - field: "pannable", - on: "panify", - off: "unpanify" - }); - elesfn$3.inactive = function() { - var ele = this[0]; - if (ele) { - return !ele._private.active; - } - }; - var elesfn$2 = {}; - var defineDagExtremity = function defineDagExtremity2(params) { - return function dagExtremityImpl(selector2) { - var eles = this; - var ret = []; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - if (!ele.isNode()) { - continue; - } - var disqualified = false; - var edges2 = ele.connectedEdges(); - for (var j = 0; j < edges2.length; j++) { - var edge = edges2[j]; - var src = edge.source(); - var tgt = edge.target(); - if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) { - disqualified = true; - break; - } - } - if (!disqualified) { - ret.push(ele); - } - } - return this.spawn(ret, true).filter(selector2); - }; - }; - var defineDagOneHop = function defineDagOneHop2(params) { - return function(selector2) { - var eles = this; - var oEles = []; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - if (!ele.isNode()) { - continue; - } - var edges2 = ele.connectedEdges(); - for (var j = 0; j < edges2.length; j++) { - var edge = edges2[j]; - var src = edge.source(); - var tgt = edge.target(); - if (params.outgoing && src === ele) { - oEles.push(edge); - oEles.push(tgt); - } else if (params.incoming && tgt === ele) { - oEles.push(edge); - oEles.push(src); - } - } - } - return this.spawn(oEles, true).filter(selector2); - }; - }; - var defineDagAllHops = function defineDagAllHops2(params) { - return function(selector2) { - var eles = this; - var sEles = []; - var sElesIds = {}; - for (; ; ) { - var next2 = params.outgoing ? eles.outgoers() : eles.incomers(); - if (next2.length === 0) { - break; - } - var newNext = false; - for (var i3 = 0; i3 < next2.length; i3++) { - var n = next2[i3]; - var nid = n.id(); - if (!sElesIds[nid]) { - sElesIds[nid] = true; - sEles.push(n); - newNext = true; - } - } - if (!newNext) { - break; - } - eles = next2; - } - return this.spawn(sEles, true).filter(selector2); - }; - }; - elesfn$2.clearTraversalCache = function() { - for (var i3 = 0; i3 < this.length; i3++) { - this[i3]._private.traversalCache = null; - } - }; - extend2(elesfn$2, { - // get the root nodes in the DAG - roots: defineDagExtremity({ - noIncomingEdges: true - }), - // get the leaf nodes in the DAG - leaves: defineDagExtremity({ - noOutgoingEdges: true - }), - // normally called children in graph theory - // these nodes =edges=> outgoing nodes - outgoers: cache(defineDagOneHop({ - outgoing: true - }), "outgoers"), - // aka DAG descendants - successors: defineDagAllHops({ - outgoing: true - }), - // normally called parents in graph theory - // these nodes <=edges= incoming nodes - incomers: cache(defineDagOneHop({ - incoming: true - }), "incomers"), - // aka DAG ancestors - predecessors: defineDagAllHops({ - incoming: true - }) - }); - extend2(elesfn$2, { - neighborhood: cache(function(selector2) { - var elements2 = []; - var nodes2 = this.nodes(); - for (var i3 = 0; i3 < nodes2.length; i3++) { - var node2 = nodes2[i3]; - var connectedEdges = node2.connectedEdges(); - for (var j = 0; j < connectedEdges.length; j++) { - var edge = connectedEdges[j]; - var src = edge.source(); - var tgt = edge.target(); - var otherNode = node2 === src ? tgt : src; - if (otherNode.length > 0) { - elements2.push(otherNode[0]); - } - elements2.push(edge[0]); - } - } - return this.spawn(elements2, true).filter(selector2); - }, "neighborhood"), - closedNeighborhood: function closedNeighborhood(selector2) { - return this.neighborhood().add(this).filter(selector2); - }, - openNeighborhood: function openNeighborhood(selector2) { - return this.neighborhood(selector2); - } - }); - elesfn$2.neighbourhood = elesfn$2.neighborhood; - elesfn$2.closedNeighbourhood = elesfn$2.closedNeighborhood; - elesfn$2.openNeighbourhood = elesfn$2.openNeighborhood; - extend2(elesfn$2, { - source: cache(function sourceImpl(selector2) { - var ele = this[0]; - var src; - if (ele) { - src = ele._private.source || ele.cy().collection(); - } - return src && selector2 ? src.filter(selector2) : src; - }, "source"), - target: cache(function targetImpl(selector2) { - var ele = this[0]; - var tgt; - if (ele) { - tgt = ele._private.target || ele.cy().collection(); - } - return tgt && selector2 ? tgt.filter(selector2) : tgt; - }, "target"), - sources: defineSourceFunction({ - attr: "source" - }), - targets: defineSourceFunction({ - attr: "target" - }) - }); - function defineSourceFunction(params) { - return function sourceImpl(selector2) { - var sources = []; - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var src = ele._private[params.attr]; - if (src) { - sources.push(src); - } - } - return this.spawn(sources, true).filter(selector2); - }; - } - extend2(elesfn$2, { - edgesWith: cache(defineEdgesWithFunction(), "edgesWith"), - edgesTo: cache(defineEdgesWithFunction({ - thisIsSrc: true - }), "edgesTo") - }); - function defineEdgesWithFunction(params) { - return function edgesWithImpl(otherNodes) { - var elements2 = []; - var cy = this._private.cy; - var p2 = params || {}; - if (string2(otherNodes)) { - otherNodes = cy.$(otherNodes); - } - for (var h = 0; h < otherNodes.length; h++) { - var edges2 = otherNodes[h]._private.edges; - for (var i3 = 0; i3 < edges2.length; i3++) { - var edge = edges2[i3]; - var edgeData = edge._private.data; - var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target); - var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target); - var edgeConnectsThisAndOther = thisToOther || otherToThis; - if (!edgeConnectsThisAndOther) { - continue; - } - if (p2.thisIsSrc || p2.thisIsTgt) { - if (p2.thisIsSrc && !thisToOther) { - continue; - } - if (p2.thisIsTgt && !otherToThis) { - continue; - } - } - elements2.push(edge); - } - } - return this.spawn(elements2, true); - }; - } - extend2(elesfn$2, { - connectedEdges: cache(function(selector2) { - var retEles = []; - var eles = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var node2 = eles[i3]; - if (!node2.isNode()) { - continue; - } - var edges2 = node2._private.edges; - for (var j = 0; j < edges2.length; j++) { - var edge = edges2[j]; - retEles.push(edge); - } - } - return this.spawn(retEles, true).filter(selector2); - }, "connectedEdges"), - connectedNodes: cache(function(selector2) { - var retEles = []; - var eles = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var edge = eles[i3]; - if (!edge.isEdge()) { - continue; - } - retEles.push(edge.source()[0]); - retEles.push(edge.target()[0]); - } - return this.spawn(retEles, true).filter(selector2); - }, "connectedNodes"), - parallelEdges: cache(defineParallelEdgesFunction(), "parallelEdges"), - codirectedEdges: cache(defineParallelEdgesFunction({ - codirected: true - }), "codirectedEdges") - }); - function defineParallelEdgesFunction(params) { - var defaults3 = { - codirected: false - }; - params = extend2({}, defaults3, params); - return function parallelEdgesImpl(selector2) { - var elements2 = []; - var edges2 = this.edges(); - var p2 = params; - for (var i3 = 0; i3 < edges2.length; i3++) { - var edge1 = edges2[i3]; - var edge1_p = edge1._private; - var src1 = edge1_p.source; - var srcid1 = src1._private.data.id; - var tgtid1 = edge1_p.data.target; - var srcEdges1 = src1._private.edges; - for (var j = 0; j < srcEdges1.length; j++) { - var edge2 = srcEdges1[j]; - var edge2data = edge2._private.data; - var tgtid2 = edge2data.target; - var srcid2 = edge2data.source; - var codirected = tgtid2 === tgtid1 && srcid2 === srcid1; - var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; - if (p2.codirected && codirected || !p2.codirected && (codirected || oppdirected)) { - elements2.push(edge2); - } - } - } - return this.spawn(elements2, true).filter(selector2); - }; - } - extend2(elesfn$2, { - components: function components(root3) { - var self2 = this; - var cy = self2.cy(); - var visited = cy.collection(); - var unvisited = root3 == null ? self2.nodes() : root3.nodes(); - var components2 = []; - if (root3 != null && unvisited.empty()) { - unvisited = root3.sources(); - } - var visitInComponent = function visitInComponent2(node2, component) { - visited.merge(node2); - unvisited.unmerge(node2); - component.merge(node2); - }; - if (unvisited.empty()) { - return self2.spawn(); - } - var _loop = function _loop2() { - var cmpt = cy.collection(); - components2.push(cmpt); - var root4 = unvisited[0]; - visitInComponent(root4, cmpt); - self2.bfs({ - directed: false, - roots: root4, - visit: function visit(v) { - return visitInComponent(v, cmpt); - } - }); - cmpt.forEach(function(node2) { - node2.connectedEdges().forEach(function(e) { - if (self2.has(e) && cmpt.has(e.source()) && cmpt.has(e.target())) { - cmpt.merge(e); - } - }); - }); - }; - do { - _loop(); - } while (unvisited.length > 0); - return components2; - }, - component: function component() { - var ele = this[0]; - return ele.cy().mutableElements().components(ele)[0]; - } - }); - elesfn$2.componentsOf = elesfn$2.components; - var Collection = function Collection2(cy, elements2) { - var unique = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; - var removed = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; - if (cy === void 0) { - error("A collection must have a reference to the core"); - return; - } - var map2 = new Map$22(); - var createdElements = false; - if (!elements2) { - elements2 = []; - } else if (elements2.length > 0 && plainObject(elements2[0]) && !element2(elements2[0])) { - createdElements = true; - var eles = []; - var elesIds = new Set$12(); - for (var i3 = 0, l = elements2.length; i3 < l; i3++) { - var json2 = elements2[i3]; - if (json2.data == null) { - json2.data = {}; - } - var _data = json2.data; - if (_data.id == null) { - _data.id = uuid(); - } else if (cy.hasElementWithId(_data.id) || elesIds.has(_data.id)) { - continue; - } - var ele = new Element(cy, json2, false); - eles.push(ele); - elesIds.add(_data.id); - } - elements2 = eles; - } - this.length = 0; - for (var _i6 = 0, _l = elements2.length; _i6 < _l; _i6++) { - var element$1 = elements2[_i6][0]; - if (element$1 == null) { - continue; - } - var id2 = element$1._private.data.id; - if (!unique || !map2.has(id2)) { - if (unique) { - map2.set(id2, { - index: this.length, - ele: element$1 - }); - } - this[this.length] = element$1; - this.length++; - } - } - this._private = { - eles: this, - cy, - get map() { - if (this.lazyMap == null) { - this.rebuildMap(); - } - return this.lazyMap; - }, - set map(m) { - this.lazyMap = m; - }, - rebuildMap: function rebuildMap() { - var m = this.lazyMap = new Map$22(); - var eles2 = this.eles; - for (var _i22 = 0; _i22 < eles2.length; _i22++) { - var _ele = eles2[_i22]; - m.set(_ele.id(), { - index: _i22, - ele: _ele - }); - } - } - }; - if (unique) { - this._private.map = map2; - } - if (createdElements && !removed) { - this.restore(); - } - }; - var elesfn$1 = Element.prototype = Collection.prototype = Object.create(Array.prototype); - elesfn$1.instanceString = function() { - return "collection"; - }; - elesfn$1.spawn = function(eles, unique) { - return new Collection(this.cy(), eles, unique); - }; - elesfn$1.spawnSelf = function() { - return this.spawn(this); - }; - elesfn$1.cy = function() { - return this._private.cy; - }; - elesfn$1.renderer = function() { - return this._private.cy.renderer(); - }; - elesfn$1.element = function() { - return this[0]; - }; - elesfn$1.collection = function() { - if (collection(this)) { - return this; - } else { - return new Collection(this._private.cy, [this]); - } - }; - elesfn$1.unique = function() { - return new Collection(this._private.cy, this, true); - }; - elesfn$1.hasElementWithId = function(id2) { - id2 = "" + id2; - return this._private.map.has(id2); - }; - elesfn$1.getElementById = function(id2) { - id2 = "" + id2; - var cy = this._private.cy; - var entry = this._private.map.get(id2); - return entry ? entry.ele : new Collection(cy); - }; - elesfn$1.$id = elesfn$1.getElementById; - elesfn$1.poolIndex = function() { - var cy = this._private.cy; - var eles = cy._private.elements; - var id2 = this[0]._private.data.id; - return eles._private.map.get(id2).index; - }; - elesfn$1.indexOf = function(ele) { - var id2 = ele[0]._private.data.id; - return this._private.map.get(id2).index; - }; - elesfn$1.indexOfId = function(id2) { - id2 = "" + id2; - return this._private.map.get(id2).index; - }; - elesfn$1.json = function(obj) { - var ele = this.element(); - var cy = this.cy(); - if (ele == null && obj) { - return this; - } - if (ele == null) { - return void 0; - } - var p2 = ele._private; - if (plainObject(obj)) { - cy.startBatch(); - if (obj.data) { - ele.data(obj.data); - var _data2 = p2.data; - if (ele.isEdge()) { - var move = false; - var spec = {}; - var src = obj.data.source; - var tgt = obj.data.target; - if (src != null && src != _data2.source) { - spec.source = "" + src; - move = true; - } - if (tgt != null && tgt != _data2.target) { - spec.target = "" + tgt; - move = true; - } - if (move) { - ele = ele.move(spec); - } - } else { - var newParentValSpecd = "parent" in obj.data; - var parent = obj.data.parent; - if (newParentValSpecd && (parent != null || _data2.parent != null) && parent != _data2.parent) { - if (parent === void 0) { - parent = null; - } - if (parent != null) { - parent = "" + parent; - } - ele = ele.move({ - parent - }); - } - } - } - if (obj.position) { - ele.position(obj.position); - } - var checkSwitch = function checkSwitch2(k, trueFnName, falseFnName) { - var obj_k = obj[k]; - if (obj_k != null && obj_k !== p2[k]) { - if (obj_k) { - ele[trueFnName](); - } else { - ele[falseFnName](); - } - } - }; - checkSwitch("removed", "remove", "restore"); - checkSwitch("selected", "select", "unselect"); - checkSwitch("selectable", "selectify", "unselectify"); - checkSwitch("locked", "lock", "unlock"); - checkSwitch("grabbable", "grabify", "ungrabify"); - checkSwitch("pannable", "panify", "unpanify"); - if (obj.classes != null) { - ele.classes(obj.classes); - } - cy.endBatch(); - return this; - } else if (obj === void 0) { - var json2 = { - data: copy2(p2.data), - position: copy2(p2.position), - group: p2.group, - removed: p2.removed, - selected: p2.selected, - selectable: p2.selectable, - locked: p2.locked, - grabbable: p2.grabbable, - pannable: p2.pannable, - classes: null - }; - json2.classes = ""; - var i3 = 0; - p2.classes.forEach(function(cls) { - return json2.classes += i3++ === 0 ? cls : " " + cls; - }); - return json2; - } - }; - elesfn$1.jsons = function() { - var jsons = []; - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var json2 = ele.json(); - jsons.push(json2); - } - return jsons; - }; - elesfn$1.clone = function() { - var cy = this.cy(); - var elesArr = []; - for (var i3 = 0; i3 < this.length; i3++) { - var ele = this[i3]; - var json2 = ele.json(); - var clone3 = new Element(cy, json2, false); - elesArr.push(clone3); - } - return new Collection(cy, elesArr); - }; - elesfn$1.copy = elesfn$1.clone; - elesfn$1.restore = function() { - var notifyRenderer = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; - var addToPool = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - var self2 = this; - var cy = self2.cy(); - var cy_p = cy._private; - var nodes2 = []; - var edges2 = []; - var elements2; - for (var _i32 = 0, l = self2.length; _i32 < l; _i32++) { - var ele = self2[_i32]; - if (addToPool && !ele.removed()) { - continue; - } - if (ele.isNode()) { - nodes2.push(ele); - } else { - edges2.push(ele); - } - } - elements2 = nodes2.concat(edges2); - var i3; - var removeFromElements = function removeFromElements2() { - elements2.splice(i3, 1); - i3--; - }; - for (i3 = 0; i3 < elements2.length; i3++) { - var _ele2 = elements2[i3]; - var _private = _ele2._private; - var _data3 = _private.data; - _ele2.clearTraversalCache(); - if (!addToPool && !_private.removed) - ; - else if (_data3.id === void 0) { - _data3.id = uuid(); - } else if (number$12(_data3.id)) { - _data3.id = "" + _data3.id; - } else if (emptyString(_data3.id) || !string2(_data3.id)) { - error("Can not create element with invalid string ID `" + _data3.id + "`"); - removeFromElements(); - continue; - } else if (cy.hasElementWithId(_data3.id)) { - error("Can not create second element with ID `" + _data3.id + "`"); - removeFromElements(); - continue; - } - var id2 = _data3.id; - if (_ele2.isNode()) { - var pos = _private.position; - if (pos.x == null) { - pos.x = 0; - } - if (pos.y == null) { - pos.y = 0; - } - } - if (_ele2.isEdge()) { - var edge = _ele2; - var fields = ["source", "target"]; - var fieldsLength = fields.length; - var badSourceOrTarget = false; - for (var j = 0; j < fieldsLength; j++) { - var field = fields[j]; - var val = _data3[field]; - if (number$12(val)) { - val = _data3[field] = "" + _data3[field]; - } - if (val == null || val === "") { - error("Can not create edge `" + id2 + "` with unspecified " + field); - badSourceOrTarget = true; - } else if (!cy.hasElementWithId(val)) { - error("Can not create edge `" + id2 + "` with nonexistant " + field + " `" + val + "`"); - badSourceOrTarget = true; - } - } - if (badSourceOrTarget) { - removeFromElements(); - continue; - } - var src = cy.getElementById(_data3.source); - var tgt = cy.getElementById(_data3.target); - if (src.same(tgt)) { - src._private.edges.push(edge); - } else { - src._private.edges.push(edge); - tgt._private.edges.push(edge); - } - edge._private.source = src; - edge._private.target = tgt; - } - _private.map = new Map$22(); - _private.map.set(id2, { - ele: _ele2, - index: 0 - }); - _private.removed = false; - if (addToPool) { - cy.addToPool(_ele2); - } - } - for (var _i42 = 0; _i42 < nodes2.length; _i42++) { - var node2 = nodes2[_i42]; - var _data4 = node2._private.data; - if (number$12(_data4.parent)) { - _data4.parent = "" + _data4.parent; - } - var parentId = _data4.parent; - var specifiedParent = parentId != null; - if (specifiedParent || node2._private.parent) { - var parent = node2._private.parent ? cy.collection().merge(node2._private.parent) : cy.getElementById(parentId); - if (parent.empty()) { - _data4.parent = void 0; - } else if (parent[0].removed()) { - warn("Node added with missing parent, reference to parent removed"); - _data4.parent = void 0; - node2._private.parent = null; - } else { - var selfAsParent = false; - var ancestor = parent; - while (!ancestor.empty()) { - if (node2.same(ancestor)) { - selfAsParent = true; - _data4.parent = void 0; - break; - } - ancestor = ancestor.parent(); - } - if (!selfAsParent) { - parent[0]._private.children.push(node2); - node2._private.parent = parent[0]; - cy_p.hasCompoundNodes = true; - } - } - } - } - if (elements2.length > 0) { - var restored = elements2.length === self2.length ? self2 : new Collection(cy, elements2); - for (var _i52 = 0; _i52 < restored.length; _i52++) { - var _ele3 = restored[_i52]; - if (_ele3.isNode()) { - continue; - } - _ele3.parallelEdges().clearTraversalCache(); - _ele3.source().clearTraversalCache(); - _ele3.target().clearTraversalCache(); - } - var toUpdateStyle; - if (cy_p.hasCompoundNodes) { - toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent()); - } else { - toUpdateStyle = restored; - } - toUpdateStyle.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(notifyRenderer); - if (notifyRenderer) { - restored.emitAndNotify("add"); - } else if (addToPool) { - restored.emit("add"); - } - } - return self2; - }; - elesfn$1.removed = function() { - var ele = this[0]; - return ele && ele._private.removed; - }; - elesfn$1.inside = function() { - var ele = this[0]; - return ele && !ele._private.removed; - }; - elesfn$1.remove = function() { - var notifyRenderer = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; - var removeFromPool = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - var self2 = this; - var elesToRemove = []; - var elesToRemoveIds = {}; - var cy = self2._private.cy; - function addConnectedEdges(node2) { - var edges2 = node2._private.edges; - for (var i4 = 0; i4 < edges2.length; i4++) { - add(edges2[i4]); - } - } - function addChildren2(node2) { - var children2 = node2._private.children; - for (var i4 = 0; i4 < children2.length; i4++) { - add(children2[i4]); - } - } - function add(ele2) { - var alreadyAdded = elesToRemoveIds[ele2.id()]; - if (removeFromPool && ele2.removed() || alreadyAdded) { - return; - } else { - elesToRemoveIds[ele2.id()] = true; - } - if (ele2.isNode()) { - elesToRemove.push(ele2); - addConnectedEdges(ele2); - addChildren2(ele2); - } else { - elesToRemove.unshift(ele2); - } - } - for (var i3 = 0, l = self2.length; i3 < l; i3++) { - var ele = self2[i3]; - add(ele); - } - function removeEdgeRef(node2, edge) { - var connectedEdges = node2._private.edges; - removeFromArray(connectedEdges, edge); - node2.clearTraversalCache(); - } - function removeParallelRef(pllEdge2) { - pllEdge2.clearTraversalCache(); - } - var alteredParents = []; - alteredParents.ids = {}; - function removeChildRef(parent2, ele2) { - ele2 = ele2[0]; - parent2 = parent2[0]; - var children2 = parent2._private.children; - var pid = parent2.id(); - removeFromArray(children2, ele2); - ele2._private.parent = null; - if (!alteredParents.ids[pid]) { - alteredParents.ids[pid] = true; - alteredParents.push(parent2); - } - } - self2.dirtyCompoundBoundsCache(); - if (removeFromPool) { - cy.removeFromPool(elesToRemove); - } - for (var _i6 = 0; _i6 < elesToRemove.length; _i6++) { - var _ele4 = elesToRemove[_i6]; - if (_ele4.isEdge()) { - var src = _ele4.source()[0]; - var tgt = _ele4.target()[0]; - removeEdgeRef(src, _ele4); - removeEdgeRef(tgt, _ele4); - var pllEdges = _ele4.parallelEdges(); - for (var j = 0; j < pllEdges.length; j++) { - var pllEdge = pllEdges[j]; - removeParallelRef(pllEdge); - if (pllEdge.isBundledBezier()) { - pllEdge.dirtyBoundingBoxCache(); - } - } - } else { - var parent = _ele4.parent(); - if (parent.length !== 0) { - removeChildRef(parent, _ele4); - } - } - if (removeFromPool) { - _ele4._private.removed = true; - } - } - var elesStillInside = cy._private.elements; - cy._private.hasCompoundNodes = false; - for (var _i7 = 0; _i7 < elesStillInside.length; _i7++) { - var _ele5 = elesStillInside[_i7]; - if (_ele5.isParent()) { - cy._private.hasCompoundNodes = true; - break; - } - } - var removedElements = new Collection(this.cy(), elesToRemove); - if (removedElements.size() > 0) { - if (notifyRenderer) { - removedElements.emitAndNotify("remove"); - } else if (removeFromPool) { - removedElements.emit("remove"); - } - } - for (var _i8 = 0; _i8 < alteredParents.length; _i8++) { - var _ele6 = alteredParents[_i8]; - if (!removeFromPool || !_ele6.removed()) { - _ele6.updateStyle(); - } - } - return removedElements; - }; - elesfn$1.move = function(struct) { - var cy = this._private.cy; - var eles = this; - var notifyRenderer = false; - var modifyPool = false; - var toString3 = function toString4(id2) { - return id2 == null ? id2 : "" + id2; - }; - if (struct.source !== void 0 || struct.target !== void 0) { - var srcId = toString3(struct.source); - var tgtId = toString3(struct.target); - var srcExists = srcId != null && cy.hasElementWithId(srcId); - var tgtExists = tgtId != null && cy.hasElementWithId(tgtId); - if (srcExists || tgtExists) { - cy.batch(function() { - eles.remove(notifyRenderer, modifyPool); - eles.emitAndNotify("moveout"); - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var _data5 = ele._private.data; - if (ele.isEdge()) { - if (srcExists) { - _data5.source = srcId; - } - if (tgtExists) { - _data5.target = tgtId; - } - } - } - eles.restore(notifyRenderer, modifyPool); - }); - eles.emitAndNotify("move"); - } - } else if (struct.parent !== void 0) { - var parentId = toString3(struct.parent); - var parentExists = parentId === null || cy.hasElementWithId(parentId); - if (parentExists) { - var pidToAssign = parentId === null ? void 0 : parentId; - cy.batch(function() { - var updated = eles.remove(notifyRenderer, modifyPool); - updated.emitAndNotify("moveout"); - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var _data6 = ele._private.data; - if (ele.isNode()) { - _data6.parent = pidToAssign; - } - } - updated.restore(notifyRenderer, modifyPool); - }); - eles.emitAndNotify("move"); - } - } - return this; - }; - [elesfn$j, elesfn$i, elesfn$h, elesfn$g, elesfn$f, data, elesfn$d, dimensions, elesfn$9, elesfn$8, elesfn$7, elesfn$6, elesfn$5, elesfn$4, elesfn$3, elesfn$2].forEach(function(props) { - extend2(elesfn$1, props); - }); - var corefn$9 = { - add: function add(opts) { - var elements2; - var cy = this; - if (elementOrCollection(opts)) { - var eles = opts; - if (eles._private.cy === cy) { - elements2 = eles.restore(); - } else { - var jsons = []; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - jsons.push(ele.json()); - } - elements2 = new Collection(cy, jsons); - } - } else if (array2(opts)) { - var _jsons = opts; - elements2 = new Collection(cy, _jsons); - } else if (plainObject(opts) && (array2(opts.nodes) || array2(opts.edges))) { - var elesByGroup = opts; - var _jsons2 = []; - var grs = ["nodes", "edges"]; - for (var _i6 = 0, il = grs.length; _i6 < il; _i6++) { - var group = grs[_i6]; - var elesArray = elesByGroup[group]; - if (array2(elesArray)) { - for (var j = 0, jl = elesArray.length; j < jl; j++) { - var json2 = extend2({ - group - }, elesArray[j]); - _jsons2.push(json2); - } - } - } - elements2 = new Collection(cy, _jsons2); - } else { - var _json = opts; - elements2 = new Element(cy, _json).collection(); - } - return elements2; - }, - remove: function remove2(collection2) { - if (elementOrCollection(collection2)) - ; - else if (string2(collection2)) { - var selector2 = collection2; - collection2 = this.$(selector2); - } - return collection2.remove(); - } - }; - /*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ - function generateCubicBezier(mX1, mY1, mX2, mY2) { - var NEWTON_ITERATIONS = 4, NEWTON_MIN_SLOPE = 1e-3, SUBDIVISION_PRECISION = 1e-7, SUBDIVISION_MAX_ITERATIONS = 10, kSplineTableSize = 11, kSampleStepSize = 1 / (kSplineTableSize - 1), float32ArraySupported = typeof Float32Array !== "undefined"; - if (arguments.length !== 4) { - return false; - } - for (var i3 = 0; i3 < 4; ++i3) { - if (typeof arguments[i3] !== "number" || isNaN(arguments[i3]) || !isFinite(arguments[i3])) { - return false; - } - } - mX1 = Math.min(mX1, 1); - mX2 = Math.min(mX2, 1); - mX1 = Math.max(mX1, 0); - mX2 = Math.max(mX2, 0); - var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); - function A(aA1, aA2) { - return 1 - 3 * aA2 + 3 * aA1; - } - function B(aA1, aA2) { - return 3 * aA2 - 6 * aA1; - } - function C(aA1) { - return 3 * aA1; - } - function calcBezier(aT, aA1, aA2) { - return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; - } - function getSlope(aT, aA1, aA2) { - return 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1); - } - function newtonRaphsonIterate(aX, aGuessT) { - for (var _i6 = 0; _i6 < NEWTON_ITERATIONS; ++_i6) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0) { - return aGuessT; - } - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - return aGuessT; - } - function calcSampleValues() { - for (var _i22 = 0; _i22 < kSplineTableSize; ++_i22) { - mSampleValues[_i22] = calcBezier(_i22 * kSampleStepSize, mX1, mX2); - } - } - function binarySubdivide(aX, aA, aB) { - var currentX, currentT, i4 = 0; - do { - currentT = aA + (aB - aA) / 2; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i4 < SUBDIVISION_MAX_ITERATIONS); - return currentT; - } - function getTForX(aX) { - var intervalStart = 0, currentSample = 1, lastSample = kSplineTableSize - 1; - for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - --currentSample; - var dist3 = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), guessForT = intervalStart + dist3 * kSampleStepSize, initialSlope = getSlope(guessForT, mX1, mX2); - if (initialSlope >= NEWTON_MIN_SLOPE) { - return newtonRaphsonIterate(aX, guessForT); - } else if (initialSlope === 0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); - } - } - var _precomputed = false; - function precompute() { - _precomputed = true; - if (mX1 !== mY1 || mX2 !== mY2) { - calcSampleValues(); - } - } - var f2 = function f3(aX) { - if (!_precomputed) { - precompute(); - } - if (mX1 === mY1 && mX2 === mY2) { - return aX; - } - if (aX === 0) { - return 0; - } - if (aX === 1) { - return 1; - } - return calcBezier(getTForX(aX), mY1, mY2); - }; - f2.getControlPoints = function() { - return [{ - x: mX1, - y: mY1 - }, { - x: mX2, - y: mY2 - }]; - }; - var str2 = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; - f2.toString = function() { - return str2; - }; - return f2; - } - /*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ - var generateSpringRK4 = function() { - function springAccelerationForState(state2) { - return -state2.tension * state2.x - state2.friction * state2.v; - } - function springEvaluateStateWithDerivative(initialState, dt, derivative) { - var state2 = { - x: initialState.x + derivative.dx * dt, - v: initialState.v + derivative.dv * dt, - tension: initialState.tension, - friction: initialState.friction - }; - return { - dx: state2.v, - dv: springAccelerationForState(state2) - }; - } - function springIntegrateState(state2, dt) { - var a = { - dx: state2.v, - dv: springAccelerationForState(state2) - }, b = springEvaluateStateWithDerivative(state2, dt * 0.5, a), c2 = springEvaluateStateWithDerivative(state2, dt * 0.5, b), d = springEvaluateStateWithDerivative(state2, dt, c2), dxdt = 1 / 6 * (a.dx + 2 * (b.dx + c2.dx) + d.dx), dvdt = 1 / 6 * (a.dv + 2 * (b.dv + c2.dv) + d.dv); - state2.x = state2.x + dxdt * dt; - state2.v = state2.v + dvdt * dt; - return state2; - } - return function springRK4Factory(tension, friction, duration) { - var initState = { - x: -1, - v: 0, - tension: null, - friction: null - }, path2 = [0], time_lapsed = 0, tolerance = 1 / 1e4, DT = 16 / 1e3, have_duration, dt, last_state; - tension = parseFloat(tension) || 500; - friction = parseFloat(friction) || 20; - duration = duration || null; - initState.tension = tension; - initState.friction = friction; - have_duration = duration !== null; - if (have_duration) { - time_lapsed = springRK4Factory(tension, friction); - dt = time_lapsed / duration * DT; - } else { - dt = DT; - } - for (; ; ) { - last_state = springIntegrateState(last_state || initState, dt); - path2.push(1 + last_state.x); - time_lapsed += 16; - if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) { - break; - } - } - return !have_duration ? time_lapsed : function(percentComplete) { - return path2[percentComplete * (path2.length - 1) | 0]; - }; - }; - }(); - var cubicBezier = function cubicBezier2(t12, p1, t22, p2) { - var bezier = generateCubicBezier(t12, p1, t22, p2); - return function(start2, end2, percent) { - return start2 + (end2 - start2) * bezier(percent); - }; - }; - var easings = { - "linear": function linear2(start2, end2, percent) { - return start2 + (end2 - start2) * percent; - }, - // default easings - "ease": cubicBezier(0.25, 0.1, 0.25, 1), - "ease-in": cubicBezier(0.42, 0, 1, 1), - "ease-out": cubicBezier(0, 0, 0.58, 1), - "ease-in-out": cubicBezier(0.42, 0, 0.58, 1), - // sine - "ease-in-sine": cubicBezier(0.47, 0, 0.745, 0.715), - "ease-out-sine": cubicBezier(0.39, 0.575, 0.565, 1), - "ease-in-out-sine": cubicBezier(0.445, 0.05, 0.55, 0.95), - // quad - "ease-in-quad": cubicBezier(0.55, 0.085, 0.68, 0.53), - "ease-out-quad": cubicBezier(0.25, 0.46, 0.45, 0.94), - "ease-in-out-quad": cubicBezier(0.455, 0.03, 0.515, 0.955), - // cubic - "ease-in-cubic": cubicBezier(0.55, 0.055, 0.675, 0.19), - "ease-out-cubic": cubicBezier(0.215, 0.61, 0.355, 1), - "ease-in-out-cubic": cubicBezier(0.645, 0.045, 0.355, 1), - // quart - "ease-in-quart": cubicBezier(0.895, 0.03, 0.685, 0.22), - "ease-out-quart": cubicBezier(0.165, 0.84, 0.44, 1), - "ease-in-out-quart": cubicBezier(0.77, 0, 0.175, 1), - // quint - "ease-in-quint": cubicBezier(0.755, 0.05, 0.855, 0.06), - "ease-out-quint": cubicBezier(0.23, 1, 0.32, 1), - "ease-in-out-quint": cubicBezier(0.86, 0, 0.07, 1), - // expo - "ease-in-expo": cubicBezier(0.95, 0.05, 0.795, 0.035), - "ease-out-expo": cubicBezier(0.19, 1, 0.22, 1), - "ease-in-out-expo": cubicBezier(1, 0, 0, 1), - // circ - "ease-in-circ": cubicBezier(0.6, 0.04, 0.98, 0.335), - "ease-out-circ": cubicBezier(0.075, 0.82, 0.165, 1), - "ease-in-out-circ": cubicBezier(0.785, 0.135, 0.15, 0.86), - // user param easings... - "spring": function spring(tension, friction, duration) { - if (duration === 0) { - return easings.linear; - } - var spring2 = generateSpringRK4(tension, friction, duration); - return function(start2, end2, percent) { - return start2 + (end2 - start2) * spring2(percent); - }; - }, - "cubic-bezier": cubicBezier - }; - function getEasedValue(type2, start2, end2, percent, easingFn) { - if (percent === 1) { - return end2; - } - if (start2 === end2) { - return end2; - } - var val = easingFn(start2, end2, percent); - if (type2 == null) { - return val; - } - if (type2.roundValue || type2.color) { - val = Math.round(val); - } - if (type2.min !== void 0) { - val = Math.max(val, type2.min); - } - if (type2.max !== void 0) { - val = Math.min(val, type2.max); - } - return val; - } - function getValue2(prop, spec) { - if (prop.pfValue != null || prop.value != null) { - if (prop.pfValue != null && (spec == null || spec.type.units !== "%")) { - return prop.pfValue; - } else { - return prop.value; - } - } else { - return prop; - } - } - function ease(startProp, endProp, percent, easingFn, propSpec) { - var type2 = propSpec != null ? propSpec.type : null; - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - var start2 = getValue2(startProp, propSpec); - var end2 = getValue2(endProp, propSpec); - if (number$12(start2) && number$12(end2)) { - return getEasedValue(type2, start2, end2, percent, easingFn); - } else if (array2(start2) && array2(end2)) { - var easedArr = []; - for (var i3 = 0; i3 < end2.length; i3++) { - var si = start2[i3]; - var ei = end2[i3]; - if (si != null && ei != null) { - var val = getEasedValue(type2, si, ei, percent, easingFn); - easedArr.push(val); - } else { - easedArr.push(ei); - } - } - return easedArr; - } - return void 0; - } - function step$1(self2, ani, now3, isCore) { - var isEles = !isCore; - var _p = self2._private; - var ani_p = ani._private; - var pEasing = ani_p.easing; - var startTime = ani_p.startTime; - var cy = isCore ? self2 : self2.cy(); - var style = cy.style(); - if (!ani_p.easingImpl) { - if (pEasing == null) { - ani_p.easingImpl = easings["linear"]; - } else { - var easingVals; - if (string2(pEasing)) { - var easingProp = style.parse("transition-timing-function", pEasing); - easingVals = easingProp.value; - } else { - easingVals = pEasing; - } - var name, args; - if (string2(easingVals)) { - name = easingVals; - args = []; - } else { - name = easingVals[1]; - args = easingVals.slice(2).map(function(n) { - return +n; - }); - } - if (args.length > 0) { - if (name === "spring") { - args.push(ani_p.duration); - } - ani_p.easingImpl = easings[name].apply(null, args); - } else { - ani_p.easingImpl = easings[name]; - } - } - } - var easing = ani_p.easingImpl; - var percent; - if (ani_p.duration === 0) { - percent = 1; - } else { - percent = (now3 - startTime) / ani_p.duration; - } - if (ani_p.applying) { - percent = ani_p.progress; - } - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - if (ani_p.delay == null) { - var startPos = ani_p.startPosition; - var endPos = ani_p.position; - if (endPos && isEles && !self2.locked()) { - var newPos = {}; - if (valid(startPos.x, endPos.x)) { - newPos.x = ease(startPos.x, endPos.x, percent, easing); - } - if (valid(startPos.y, endPos.y)) { - newPos.y = ease(startPos.y, endPos.y, percent, easing); - } - self2.position(newPos); - } - var startPan = ani_p.startPan; - var endPan = ani_p.pan; - var pan = _p.pan; - var animatingPan = endPan != null && isCore; - if (animatingPan) { - if (valid(startPan.x, endPan.x)) { - pan.x = ease(startPan.x, endPan.x, percent, easing); - } - if (valid(startPan.y, endPan.y)) { - pan.y = ease(startPan.y, endPan.y, percent, easing); - } - self2.emit("pan"); - } - var startZoom = ani_p.startZoom; - var endZoom = ani_p.zoom; - var animatingZoom = endZoom != null && isCore; - if (animatingZoom) { - if (valid(startZoom, endZoom)) { - _p.zoom = bound(_p.minZoom, ease(startZoom, endZoom, percent, easing), _p.maxZoom); - } - self2.emit("zoom"); - } - if (animatingPan || animatingZoom) { - self2.emit("viewport"); - } - var props = ani_p.style; - if (props && props.length > 0 && isEles) { - for (var i3 = 0; i3 < props.length; i3++) { - var prop = props[i3]; - var _name = prop.name; - var end2 = prop; - var start2 = ani_p.startStyle[_name]; - var propSpec = style.properties[start2.name]; - var easedVal = ease(start2, end2, percent, easing, propSpec); - style.overrideBypass(self2, _name, easedVal); - } - self2.emit("style"); - } - } - ani_p.progress = percent; - return percent; - } - function valid(start2, end2) { - if (start2 == null || end2 == null) { - return false; - } - if (number$12(start2) && number$12(end2)) { - return true; - } else if (start2 && end2) { - return true; - } - return false; - } - function startAnimation(self2, ani, now3, isCore) { - var ani_p = ani._private; - ani_p.started = true; - ani_p.startTime = now3 - ani_p.progress * ani_p.duration; - } - function stepAll(now3, cy) { - var eles = cy._private.aniEles; - var doneEles = []; - function stepOne(ele2, isCore) { - var _p = ele2._private; - var current = _p.animation.current; - var queue = _p.animation.queue; - var ranAnis = false; - if (current.length === 0) { - var next2 = queue.shift(); - if (next2) { - current.push(next2); - } - } - var callbacks = function callbacks2(_callbacks) { - for (var j = _callbacks.length - 1; j >= 0; j--) { - var cb = _callbacks[j]; - cb(); - } - _callbacks.splice(0, _callbacks.length); - }; - for (var i3 = current.length - 1; i3 >= 0; i3--) { - var ani = current[i3]; - var ani_p = ani._private; - if (ani_p.stopped) { - current.splice(i3, 1); - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - callbacks(ani_p.frames); - continue; - } - if (!ani_p.playing && !ani_p.applying) { - continue; - } - if (ani_p.playing && ani_p.applying) { - ani_p.applying = false; - } - if (!ani_p.started) { - startAnimation(ele2, ani, now3); - } - step$1(ele2, ani, now3, isCore); - if (ani_p.applying) { - ani_p.applying = false; - } - callbacks(ani_p.frames); - if (ani_p.step != null) { - ani_p.step(now3); - } - if (ani.completed()) { - current.splice(i3, 1); - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - callbacks(ani_p.completes); - } - ranAnis = true; - } - if (!isCore && current.length === 0 && queue.length === 0) { - doneEles.push(ele2); - } - return ranAnis; - } - var ranEleAni = false; - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; - var handledThisEle = stepOne(ele); - ranEleAni = ranEleAni || handledThisEle; - } - var ranCoreAni = stepOne(cy, true); - if (ranEleAni || ranCoreAni) { - if (eles.length > 0) { - cy.notify("draw", eles); - } else { - cy.notify("draw"); - } - } - eles.unmerge(doneEles); - cy.emit("step"); - } - var corefn$8 = { - // pull in animation functions - animate: define3.animate(), - animation: define3.animation(), - animated: define3.animated(), - clearQueue: define3.clearQueue(), - delay: define3.delay(), - delayAnimation: define3.delayAnimation(), - stop: define3.stop(), - addToAnimationPool: function addToAnimationPool(eles) { - var cy = this; - if (!cy.styleEnabled()) { - return; - } - cy._private.aniEles.merge(eles); - }, - stopAnimationLoop: function stopAnimationLoop() { - this._private.animationsRunning = false; - }, - startAnimationLoop: function startAnimationLoop() { - var cy = this; - cy._private.animationsRunning = true; - if (!cy.styleEnabled()) { - return; - } - function headlessStep() { - if (!cy._private.animationsRunning) { - return; - } - requestAnimationFrame2(function animationStep(now3) { - stepAll(now3, cy); - headlessStep(); - }); - } - var renderer3 = cy.renderer(); - if (renderer3 && renderer3.beforeRender) { - renderer3.beforeRender(function rendererAnimationStep(willDraw, now3) { - stepAll(now3, cy); - }, renderer3.beforeRenderPriorities.animations); - } else { - headlessStep(); - } - } - }; - var emitterOptions = { - qualifierCompare: function qualifierCompare(selector1, selector2) { - if (selector1 == null || selector2 == null) { - return selector1 == null && selector2 == null; - } else { - return selector1.sameText(selector2); - } - }, - eventMatches: function eventMatches(cy, listener, eventObj) { - var selector2 = listener.qualifier; - if (selector2 != null) { - return cy !== eventObj.target && element2(eventObj.target) && selector2.matches(eventObj.target); - } - return true; - }, - addEventFields: function addEventFields(cy, evt) { - evt.cy = cy; - evt.target = cy; - }, - callbackContext: function callbackContext(cy, listener, eventObj) { - return listener.qualifier != null ? eventObj.target : cy; - } - }; - var argSelector = function argSelector2(arg) { - if (string2(arg)) { - return new Selector(arg); - } else { - return arg; - } - }; - var elesfn = { - createEmitter: function createEmitter() { - var _p = this._private; - if (!_p.emitter) { - _p.emitter = new Emitter(emitterOptions, this); - } - return this; - }, - emitter: function emitter() { - return this._private.emitter; - }, - on: function on(events, selector2, callback) { - this.emitter().on(events, argSelector(selector2), callback); - return this; - }, - removeListener: function removeListener(events, selector2, callback) { - this.emitter().removeListener(events, argSelector(selector2), callback); - return this; - }, - removeAllListeners: function removeAllListeners() { - this.emitter().removeAllListeners(); - return this; - }, - one: function one2(events, selector2, callback) { - this.emitter().one(events, argSelector(selector2), callback); - return this; - }, - once: function once(events, selector2, callback) { - this.emitter().one(events, argSelector(selector2), callback); - return this; - }, - emit: function emit(events, extraParams) { - this.emitter().emit(events, extraParams); - return this; - }, - emitAndNotify: function emitAndNotify(event2, eles) { - this.emit(event2); - this.notify(event2, eles); - return this; - } - }; - define3.eventAliasesOn(elesfn); - var corefn$7 = { - png: function png(options2) { - var renderer3 = this._private.renderer; - options2 = options2 || {}; - return renderer3.png(options2); - }, - jpg: function jpg(options2) { - var renderer3 = this._private.renderer; - options2 = options2 || {}; - options2.bg = options2.bg || "#fff"; - return renderer3.jpg(options2); - } - }; - corefn$7.jpeg = corefn$7.jpg; - var corefn$6 = { - layout: function layout3(options2) { - var cy = this; - if (options2 == null) { - error("Layout options must be specified to make a layout"); - return; - } - if (options2.name == null) { - error("A `name` must be specified to make a layout"); - return; - } - var name = options2.name; - var Layout2 = cy.extension("layout", name); - if (Layout2 == null) { - error("No such layout `" + name + "` found. Did you forget to import it and `cytoscape.use()` it?"); - return; - } - var eles; - if (string2(options2.eles)) { - eles = cy.$(options2.eles); - } else { - eles = options2.eles != null ? options2.eles : cy.$(); - } - var layout4 = new Layout2(extend2({}, options2, { - cy, - eles - })); - return layout4; - } - }; - corefn$6.createLayout = corefn$6.makeLayout = corefn$6.layout; - var corefn$5 = { - notify: function notify(eventName, eventEles) { - var _p = this._private; - if (this.batching()) { - _p.batchNotifications = _p.batchNotifications || {}; - var eles = _p.batchNotifications[eventName] = _p.batchNotifications[eventName] || this.collection(); - if (eventEles != null) { - eles.merge(eventEles); - } - return; - } - if (!_p.notificationsEnabled) { - return; - } - var renderer3 = this.renderer(); - if (this.destroyed() || !renderer3) { - return; - } - renderer3.notify(eventName, eventEles); - }, - notifications: function notifications(bool2) { - var p2 = this._private; - if (bool2 === void 0) { - return p2.notificationsEnabled; - } else { - p2.notificationsEnabled = bool2 ? true : false; - } - return this; - }, - noNotifications: function noNotifications(callback) { - this.notifications(false); - callback(); - this.notifications(true); - }, - batching: function batching() { - return this._private.batchCount > 0; - }, - startBatch: function startBatch() { - var _p = this._private; - if (_p.batchCount == null) { - _p.batchCount = 0; - } - if (_p.batchCount === 0) { - _p.batchStyleEles = this.collection(); - _p.batchNotifications = {}; - } - _p.batchCount++; - return this; - }, - endBatch: function endBatch() { - var _p = this._private; - if (_p.batchCount === 0) { - return this; - } - _p.batchCount--; - if (_p.batchCount === 0) { - _p.batchStyleEles.updateStyle(); - var renderer3 = this.renderer(); - Object.keys(_p.batchNotifications).forEach(function(eventName) { - var eles = _p.batchNotifications[eventName]; - if (eles.empty()) { - renderer3.notify(eventName); - } else { - renderer3.notify(eventName, eles); - } - }); - } - return this; - }, - batch: function batch(callback) { - this.startBatch(); - callback(); - this.endBatch(); - return this; - }, - // for backwards compatibility - batchData: function batchData(map2) { - var cy = this; - return this.batch(function() { - var ids = Object.keys(map2); - for (var i3 = 0; i3 < ids.length; i3++) { - var id2 = ids[i3]; - var data2 = map2[id2]; - var ele = cy.getElementById(id2); - ele.data(data2); - } - }); - } - }; - var rendererDefaults = defaults$g({ - hideEdgesOnViewport: false, - textureOnViewport: false, - motionBlur: false, - motionBlurOpacity: 0.05, - pixelRatio: void 0, - desktopTapThreshold: 4, - touchTapThreshold: 8, - wheelSensitivity: 1, - debug: false, - showFps: false - }); - var corefn$4 = { - renderTo: function renderTo(context, zoom, pan, pxRatio) { - var r = this._private.renderer; - r.renderTo(context, zoom, pan, pxRatio); - return this; - }, - renderer: function renderer3() { - return this._private.renderer; - }, - forceRender: function forceRender() { - this.notify("draw"); - return this; - }, - resize: function resize() { - this.invalidateSize(); - this.emitAndNotify("resize"); - return this; - }, - initRenderer: function initRenderer(options2) { - var cy = this; - var RendererProto = cy.extension("renderer", options2.name); - if (RendererProto == null) { - error("Can not initialise: No such renderer `".concat(options2.name, "` found. Did you forget to import it and `cytoscape.use()` it?")); - return; - } - if (options2.wheelSensitivity !== void 0) { - warn("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine."); - } - var rOpts = rendererDefaults(options2); - rOpts.cy = cy; - cy._private.renderer = new RendererProto(rOpts); - this.notify("init"); - }, - destroyRenderer: function destroyRenderer() { - var cy = this; - cy.notify("destroy"); - var domEle = cy.container(); - if (domEle) { - domEle._cyreg = null; - while (domEle.childNodes.length > 0) { - domEle.removeChild(domEle.childNodes[0]); - } - } - cy._private.renderer = null; - cy.mutableElements().forEach(function(ele) { - var _p = ele._private; - _p.rscratch = {}; - _p.rstyle = {}; - _p.animation.current = []; - _p.animation.queue = []; - }); - }, - onRender: function onRender(fn2) { - return this.on("render", fn2); - }, - offRender: function offRender(fn2) { - return this.off("render", fn2); - } - }; - corefn$4.invalidateDimensions = corefn$4.resize; - var corefn$3 = { - // get a collection - // - empty collection on no args - // - collection of elements in the graph on selector arg - // - guarantee a returned collection when elements or collection specified - collection: function collection2(eles, opts) { - if (string2(eles)) { - return this.$(eles); - } else if (elementOrCollection(eles)) { - return eles.collection(); - } else if (array2(eles)) { - if (!opts) { - opts = {}; - } - return new Collection(this, eles, opts.unique, opts.removed); - } - return new Collection(this); - }, - nodes: function nodes2(selector2) { - var nodes3 = this.$(function(ele) { - return ele.isNode(); - }); - if (selector2) { - return nodes3.filter(selector2); - } - return nodes3; - }, - edges: function edges2(selector2) { - var edges3 = this.$(function(ele) { - return ele.isEdge(); - }); - if (selector2) { - return edges3.filter(selector2); - } - return edges3; - }, - // search the graph like jQuery - $: function $(selector2) { - var eles = this._private.elements; - if (selector2) { - return eles.filter(selector2); - } else { - return eles.spawnSelf(); - } - }, - mutableElements: function mutableElements() { - return this._private.elements; - } - }; - corefn$3.elements = corefn$3.filter = corefn$3.$; - var styfn$8 = {}; - var TRUE = "t"; - var FALSE = "f"; - styfn$8.apply = function(eles) { - var self2 = this; - var _p = self2._private; - var cy = _p.cy; - var updatedEles = cy.collection(); - for (var ie = 0; ie < eles.length; ie++) { - var ele = eles[ie]; - var cxtMeta = self2.getContextMeta(ele); - if (cxtMeta.empty) { - continue; - } - var cxtStyle = self2.getContextStyle(cxtMeta); - var app = self2.applyContextStyle(cxtMeta, cxtStyle, ele); - if (ele._private.appliedInitStyle) { - self2.updateTransitions(ele, app.diffProps); - } else { - ele._private.appliedInitStyle = true; - } - var hintsDiff = self2.updateStyleHints(ele); - if (hintsDiff) { - updatedEles.push(ele); - } - } - return updatedEles; - }; - styfn$8.getPropertiesDiff = function(oldCxtKey, newCxtKey) { - var self2 = this; - var cache2 = self2._private.propDiffs = self2._private.propDiffs || {}; - var dualCxtKey = oldCxtKey + "-" + newCxtKey; - var cachedVal = cache2[dualCxtKey]; - if (cachedVal) { - return cachedVal; - } - var diffProps = []; - var addedProp = {}; - for (var i3 = 0; i3 < self2.length; i3++) { - var cxt = self2[i3]; - var oldHasCxt = oldCxtKey[i3] === TRUE; - var newHasCxt = newCxtKey[i3] === TRUE; - var cxtHasDiffed = oldHasCxt !== newHasCxt; - var cxtHasMappedProps = cxt.mappedProperties.length > 0; - if (cxtHasDiffed || newHasCxt && cxtHasMappedProps) { - var props = void 0; - if (cxtHasDiffed && cxtHasMappedProps) { - props = cxt.properties; - } else if (cxtHasDiffed) { - props = cxt.properties; - } else if (cxtHasMappedProps) { - props = cxt.mappedProperties; - } - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - var name = prop.name; - var laterCxtOverrides = false; - for (var k = i3 + 1; k < self2.length; k++) { - var laterCxt = self2[k]; - var hasLaterCxt = newCxtKey[k] === TRUE; - if (!hasLaterCxt) { - continue; - } - laterCxtOverrides = laterCxt.properties[prop.name] != null; - if (laterCxtOverrides) { - break; - } - } - if (!addedProp[name] && !laterCxtOverrides) { - addedProp[name] = true; - diffProps.push(name); - } - } - } - } - cache2[dualCxtKey] = diffProps; - return diffProps; - }; - styfn$8.getContextMeta = function(ele) { - var self2 = this; - var cxtKey = ""; - var diffProps; - var prevKey = ele._private.styleCxtKey || ""; - for (var i3 = 0; i3 < self2.length; i3++) { - var context = self2[i3]; - var contextSelectorMatches = context.selector && context.selector.matches(ele); - if (contextSelectorMatches) { - cxtKey += TRUE; - } else { - cxtKey += FALSE; - } - } - diffProps = self2.getPropertiesDiff(prevKey, cxtKey); - ele._private.styleCxtKey = cxtKey; - return { - key: cxtKey, - diffPropNames: diffProps, - empty: diffProps.length === 0 - }; - }; - styfn$8.getContextStyle = function(cxtMeta) { - var cxtKey = cxtMeta.key; - var self2 = this; - var cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; - if (cxtStyles[cxtKey]) { - return cxtStyles[cxtKey]; - } - var style = { - _private: { - key: cxtKey - } - }; - for (var i3 = 0; i3 < self2.length; i3++) { - var cxt = self2[i3]; - var hasCxt = cxtKey[i3] === TRUE; - if (!hasCxt) { - continue; - } - for (var j = 0; j < cxt.properties.length; j++) { - var prop = cxt.properties[j]; - style[prop.name] = prop; - } - } - cxtStyles[cxtKey] = style; - return style; - }; - styfn$8.applyContextStyle = function(cxtMeta, cxtStyle, ele) { - var self2 = this; - var diffProps = cxtMeta.diffPropNames; - var retDiffProps = {}; - var types = self2.types; - for (var i3 = 0; i3 < diffProps.length; i3++) { - var diffPropName = diffProps[i3]; - var cxtProp = cxtStyle[diffPropName]; - var eleProp = ele.pstyle(diffPropName); - if (!cxtProp) { - if (!eleProp) { - continue; - } else if (eleProp.bypass) { - cxtProp = { - name: diffPropName, - deleteBypassed: true - }; - } else { - cxtProp = { - name: diffPropName, - "delete": true - }; - } - } - if (eleProp === cxtProp) { - continue; - } - if (cxtProp.mapped === types.fn && eleProp != null && eleProp.mapping != null && eleProp.mapping.value === cxtProp.value) { - var mapping = eleProp.mapping; - var fnValue = mapping.fnValue = cxtProp.value(ele); - if (fnValue === mapping.prevFnValue) { - continue; - } - } - var retDiffProp = retDiffProps[diffPropName] = { - prev: eleProp - }; - self2.applyParsedProperty(ele, cxtProp); - retDiffProp.next = ele.pstyle(diffPropName); - if (retDiffProp.next && retDiffProp.next.bypass) { - retDiffProp.next = retDiffProp.next.bypassed; - } - } - return { - diffProps: retDiffProps - }; - }; - styfn$8.updateStyleHints = function(ele) { - var _p = ele._private; - var self2 = this; - var propNames = self2.propertyGroupNames; - var propGrKeys = self2.propertyGroupKeys; - var propHash = function propHash2(ele2, propNames2, seedKey) { - return self2.getPropertiesHash(ele2, propNames2, seedKey); - }; - var oldStyleKey = _p.styleKey; - if (ele.removed()) { - return false; - } - var isNode = _p.group === "nodes"; - var overriddenStyles = ele._private.style; - propNames = Object.keys(overriddenStyles); - for (var i3 = 0; i3 < propGrKeys.length; i3++) { - var grKey = propGrKeys[i3]; - _p.styleKeys[grKey] = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT]; - } - var updateGrKey1 = function updateGrKey12(val, grKey2) { - return _p.styleKeys[grKey2][0] = hashInt(val, _p.styleKeys[grKey2][0]); - }; - var updateGrKey2 = function updateGrKey22(val, grKey2) { - return _p.styleKeys[grKey2][1] = hashIntAlt(val, _p.styleKeys[grKey2][1]); - }; - var updateGrKey = function updateGrKey3(val, grKey2) { - updateGrKey1(val, grKey2); - updateGrKey2(val, grKey2); - }; - var updateGrKeyWStr = function updateGrKeyWStr2(strVal, grKey2) { - for (var j = 0; j < strVal.length; j++) { - var ch2 = strVal.charCodeAt(j); - updateGrKey1(ch2, grKey2); - updateGrKey2(ch2, grKey2); - } - }; - var N = 2e9; - var cleanNum = function cleanNum2(val) { - return -128 < val && val < 128 && Math.floor(val) !== val ? N - (val * 1024 | 0) : val; - }; - for (var _i6 = 0; _i6 < propNames.length; _i6++) { - var name = propNames[_i6]; - var parsedProp = overriddenStyles[name]; - if (parsedProp == null) { - continue; - } - var propInfo = this.properties[name]; - var type2 = propInfo.type; - var _grKey = propInfo.groupKey; - var normalizedNumberVal = void 0; - if (propInfo.hashOverride != null) { - normalizedNumberVal = propInfo.hashOverride(ele, parsedProp); - } else if (parsedProp.pfValue != null) { - normalizedNumberVal = parsedProp.pfValue; - } - var numberVal = propInfo.enums == null ? parsedProp.value : null; - var haveNormNum = normalizedNumberVal != null; - var haveUnitedNum = numberVal != null; - var haveNum = haveNormNum || haveUnitedNum; - var units = parsedProp.units; - if (type2.number && haveNum && !type2.multiple) { - var v = haveNormNum ? normalizedNumberVal : numberVal; - updateGrKey(cleanNum(v), _grKey); - if (!haveNormNum && units != null) { - updateGrKeyWStr(units, _grKey); - } - } else { - updateGrKeyWStr(parsedProp.strValue, _grKey); - } - } - var hash = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT]; - for (var _i22 = 0; _i22 < propGrKeys.length; _i22++) { - var _grKey2 = propGrKeys[_i22]; - var grHash = _p.styleKeys[_grKey2]; - hash[0] = hashInt(grHash[0], hash[0]); - hash[1] = hashIntAlt(grHash[1], hash[1]); - } - _p.styleKey = combineHashes(hash[0], hash[1]); - var sk = _p.styleKeys; - _p.labelDimsKey = combineHashesArray(sk.labelDimensions); - var labelKeys = propHash(ele, ["label"], sk.labelDimensions); - _p.labelKey = combineHashesArray(labelKeys); - _p.labelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, labelKeys)); - if (!isNode) { - var sourceLabelKeys = propHash(ele, ["source-label"], sk.labelDimensions); - _p.sourceLabelKey = combineHashesArray(sourceLabelKeys); - _p.sourceLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, sourceLabelKeys)); - var targetLabelKeys = propHash(ele, ["target-label"], sk.labelDimensions); - _p.targetLabelKey = combineHashesArray(targetLabelKeys); - _p.targetLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, targetLabelKeys)); - } - if (isNode) { - var _p$styleKeys = _p.styleKeys, nodeBody = _p$styleKeys.nodeBody, nodeBorder = _p$styleKeys.nodeBorder, nodeOutline = _p$styleKeys.nodeOutline, backgroundImage = _p$styleKeys.backgroundImage, compound = _p$styleKeys.compound, pie2 = _p$styleKeys.pie; - var nodeKeys = [nodeBody, nodeBorder, nodeOutline, backgroundImage, compound, pie2].filter(function(k) { - return k != null; - }).reduce(hashArrays, [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT]); - _p.nodeKey = combineHashesArray(nodeKeys); - _p.hasPie = pie2 != null && pie2[0] !== DEFAULT_HASH_SEED && pie2[1] !== DEFAULT_HASH_SEED_ALT; - } - return oldStyleKey !== _p.styleKey; - }; - styfn$8.clearStyleHints = function(ele) { - var _p = ele._private; - _p.styleCxtKey = ""; - _p.styleKeys = {}; - _p.styleKey = null; - _p.labelKey = null; - _p.labelStyleKey = null; - _p.sourceLabelKey = null; - _p.sourceLabelStyleKey = null; - _p.targetLabelKey = null; - _p.targetLabelStyleKey = null; - _p.nodeKey = null; - _p.hasPie = null; - }; - styfn$8.applyParsedProperty = function(ele, parsedProp) { - var self2 = this; - var prop = parsedProp; - var style = ele._private.style; - var flatProp; - var types = self2.types; - var type2 = self2.properties[prop.name].type; - var propIsBypass = prop.bypass; - var origProp = style[prop.name]; - var origPropIsBypass = origProp && origProp.bypass; - var _p = ele._private; - var flatPropMapping = "mapping"; - var getVal = function getVal2(p2) { - if (p2 == null) { - return null; - } else if (p2.pfValue != null) { - return p2.pfValue; - } else { - return p2.value; - } - }; - var checkTriggers = function checkTriggers2() { - var fromVal = getVal(origProp); - var toVal = getVal(prop); - self2.checkTriggers(ele, prop.name, fromVal, toVal); - }; - if (parsedProp.name === "curve-style" && ele.isEdge() && // loops must be bundled beziers - (parsedProp.value !== "bezier" && ele.isLoop() || // edges connected to compound nodes can not be haystacks - parsedProp.value === "haystack" && (ele.source().isParent() || ele.target().isParent()))) { - prop = parsedProp = this.parse(parsedProp.name, "bezier", propIsBypass); - } - if (prop["delete"]) { - style[prop.name] = void 0; - checkTriggers(); - return true; - } - if (prop.deleteBypassed) { - if (!origProp) { - checkTriggers(); - return true; - } else if (origProp.bypass) { - origProp.bypassed = void 0; - checkTriggers(); - return true; - } else { - return false; - } - } - if (prop.deleteBypass) { - if (!origProp) { - checkTriggers(); - return true; - } else if (origProp.bypass) { - style[prop.name] = origProp.bypassed; - checkTriggers(); - return true; - } else { - return false; - } - } - var printMappingErr = function printMappingErr2() { - warn("Do not assign mappings to elements without corresponding data (i.e. ele `" + ele.id() + "` has no mapping for property `" + prop.name + "` with data field `" + prop.field + "`); try a `[" + prop.field + "]` selector to limit scope to elements with `" + prop.field + "` defined"); - }; - switch (prop.mapped) { - case types.mapData: { - var fields = prop.field.split("."); - var fieldVal = _p.data; - for (var i3 = 0; i3 < fields.length && fieldVal; i3++) { - var field = fields[i3]; - fieldVal = fieldVal[field]; - } - if (fieldVal == null) { - printMappingErr(); - return false; - } - var percent; - if (!number$12(fieldVal)) { - warn("Do not use continuous mappers without specifying numeric data (i.e. `" + prop.field + ": " + fieldVal + "` for `" + ele.id() + "` is non-numeric)"); - return false; - } else { - var fieldWidth = prop.fieldMax - prop.fieldMin; - if (fieldWidth === 0) { - percent = 0; - } else { - percent = (fieldVal - prop.fieldMin) / fieldWidth; - } - } - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - if (type2.color) { - var r1 = prop.valueMin[0]; - var r2 = prop.valueMax[0]; - var g1 = prop.valueMin[1]; - var g2 = prop.valueMax[1]; - var b1 = prop.valueMin[2]; - var b2 = prop.valueMax[2]; - var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; - var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; - var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)]; - flatProp = { - // colours are simple, so just create the flat property instead of expensive string parsing - bypass: prop.bypass, - // we're a bypass if the mapping property is a bypass - name: prop.name, - value: clr, - strValue: "rgb(" + clr[0] + ", " + clr[1] + ", " + clr[2] + ")" - }; - } else if (type2.number) { - var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; - flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping); - } else { - return false; - } - if (!flatProp) { - printMappingErr(); - return false; - } - flatProp.mapping = prop; - prop = flatProp; - break; - } - case types.data: { - var _fields = prop.field.split("."); - var _fieldVal = _p.data; - for (var _i32 = 0; _i32 < _fields.length && _fieldVal; _i32++) { - var _field = _fields[_i32]; - _fieldVal = _fieldVal[_field]; - } - if (_fieldVal != null) { - flatProp = this.parse(prop.name, _fieldVal, prop.bypass, flatPropMapping); - } - if (!flatProp) { - printMappingErr(); - return false; - } - flatProp.mapping = prop; - prop = flatProp; - break; - } - case types.fn: { - var fn2 = prop.value; - var fnRetVal = prop.fnValue != null ? prop.fnValue : fn2(ele); - prop.prevFnValue = fnRetVal; - if (fnRetVal == null) { - warn("Custom function mappers may not return null (i.e. `" + prop.name + "` for ele `" + ele.id() + "` is null)"); - return false; - } - flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping); - if (!flatProp) { - warn("Custom function mappers may not return invalid values for the property type (i.e. `" + prop.name + "` for ele `" + ele.id() + "` is invalid)"); - return false; - } - flatProp.mapping = copy2(prop); - prop = flatProp; - break; - } - case void 0: - break; - default: - return false; - } - if (propIsBypass) { - if (origPropIsBypass) { - prop.bypassed = origProp.bypassed; - } else { - prop.bypassed = origProp; - } - style[prop.name] = prop; - } else { - if (origPropIsBypass) { - origProp.bypassed = prop; - } else { - style[prop.name] = prop; - } - } - checkTriggers(); - return true; - }; - styfn$8.cleanElements = function(eles, keepBypasses) { - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - this.clearStyleHints(ele); - ele.dirtyCompoundBoundsCache(); - ele.dirtyBoundingBoxCache(); - if (!keepBypasses) { - ele._private.style = {}; - } else { - var style = ele._private.style; - var propNames = Object.keys(style); - for (var j = 0; j < propNames.length; j++) { - var propName = propNames[j]; - var eleProp = style[propName]; - if (eleProp != null) { - if (eleProp.bypass) { - eleProp.bypassed = null; - } else { - style[propName] = null; - } - } - } - } - } - }; - styfn$8.update = function() { - var cy = this._private.cy; - var eles = cy.mutableElements(); - eles.updateStyle(); - }; - styfn$8.updateTransitions = function(ele, diffProps) { - var self2 = this; - var _p = ele._private; - var props = ele.pstyle("transition-property").value; - var duration = ele.pstyle("transition-duration").pfValue; - var delay = ele.pstyle("transition-delay").pfValue; - if (props.length > 0 && duration > 0) { - var style = {}; - var anyPrev = false; - for (var i3 = 0; i3 < props.length; i3++) { - var prop = props[i3]; - var styProp = ele.pstyle(prop); - var diffProp = diffProps[prop]; - if (!diffProp) { - continue; - } - var prevProp = diffProp.prev; - var fromProp = prevProp; - var toProp = diffProp.next != null ? diffProp.next : styProp; - var diff = false; - var initVal = void 0; - var initDt = 1e-6; - if (!fromProp) { - continue; - } - if (number$12(fromProp.pfValue) && number$12(toProp.pfValue)) { - diff = toProp.pfValue - fromProp.pfValue; - initVal = fromProp.pfValue + initDt * diff; - } else if (number$12(fromProp.value) && number$12(toProp.value)) { - diff = toProp.value - fromProp.value; - initVal = fromProp.value + initDt * diff; - } else if (array2(fromProp.value) && array2(toProp.value)) { - diff = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2]; - initVal = fromProp.strValue; - } - if (diff) { - style[prop] = toProp.strValue; - this.applyBypass(ele, prop, initVal); - anyPrev = true; - } - } - if (!anyPrev) { - return; - } - _p.transitioning = true; - new Promise$12(function(resolve2) { - if (delay > 0) { - ele.delayAnimation(delay).play().promise().then(resolve2); - } else { - resolve2(); - } - }).then(function() { - return ele.animation({ - style, - duration, - easing: ele.pstyle("transition-timing-function").value, - queue: false - }).play().promise(); - }).then(function() { - self2.removeBypasses(ele, props); - ele.emitAndNotify("style"); - _p.transitioning = false; - }); - } else if (_p.transitioning) { - this.removeBypasses(ele, props); - ele.emitAndNotify("style"); - _p.transitioning = false; - } - }; - styfn$8.checkTrigger = function(ele, name, fromValue, toValue, getTrigger, onTrigger) { - var prop = this.properties[name]; - var triggerCheck = getTrigger(prop); - if (triggerCheck != null && triggerCheck(fromValue, toValue)) { - onTrigger(prop); - } - }; - styfn$8.checkZOrderTrigger = function(ele, name, fromValue, toValue) { - var _this = this; - this.checkTrigger(ele, name, fromValue, toValue, function(prop) { - return prop.triggersZOrder; - }, function() { - _this._private.cy.notify("zorder", ele); - }); - }; - styfn$8.checkBoundsTrigger = function(ele, name, fromValue, toValue) { - this.checkTrigger(ele, name, fromValue, toValue, function(prop) { - return prop.triggersBounds; - }, function(prop) { - ele.dirtyCompoundBoundsCache(); - ele.dirtyBoundingBoxCache(); - if ( - // only for beziers -- so performance of other edges isn't affected - prop.triggersBoundsOfParallelBeziers && name === "curve-style" && (fromValue === "bezier" || toValue === "bezier") - ) { - ele.parallelEdges().forEach(function(pllEdge) { - if (pllEdge.isBundledBezier()) { - pllEdge.dirtyBoundingBoxCache(); - } - }); - } - if (prop.triggersBoundsOfConnectedEdges && name === "display" && (fromValue === "none" || toValue === "none")) { - ele.connectedEdges().forEach(function(edge) { - edge.dirtyBoundingBoxCache(); - }); - } - }); - }; - styfn$8.checkTriggers = function(ele, name, fromValue, toValue) { - ele.dirtyStyleCache(); - this.checkZOrderTrigger(ele, name, fromValue, toValue); - this.checkBoundsTrigger(ele, name, fromValue, toValue); - }; - var styfn$7 = {}; - styfn$7.applyBypass = function(eles, name, value2, updateTransitions) { - var self2 = this; - var props = []; - var isBypass = true; - if (name === "*" || name === "**") { - if (value2 !== void 0) { - for (var i3 = 0; i3 < self2.properties.length; i3++) { - var prop = self2.properties[i3]; - var _name = prop.name; - var parsedProp = this.parse(_name, value2, true); - if (parsedProp) { - props.push(parsedProp); - } - } - } - } else if (string2(name)) { - var _parsedProp = this.parse(name, value2, true); - if (_parsedProp) { - props.push(_parsedProp); - } - } else if (plainObject(name)) { - var specifiedProps = name; - updateTransitions = value2; - var names = Object.keys(specifiedProps); - for (var _i6 = 0; _i6 < names.length; _i6++) { - var _name2 = names[_i6]; - var _value = specifiedProps[_name2]; - if (_value === void 0) { - _value = specifiedProps[dash2camel(_name2)]; - } - if (_value !== void 0) { - var _parsedProp2 = this.parse(_name2, _value, true); - if (_parsedProp2) { - props.push(_parsedProp2); - } - } - } - } else { - return false; - } - if (props.length === 0) { - return false; - } - var ret = false; - for (var _i22 = 0; _i22 < eles.length; _i22++) { - var ele = eles[_i22]; - var diffProps = {}; - var diffProp = void 0; - for (var j = 0; j < props.length; j++) { - var _prop = props[j]; - if (updateTransitions) { - var prevProp = ele.pstyle(_prop.name); - diffProp = diffProps[_prop.name] = { - prev: prevProp - }; - } - ret = this.applyParsedProperty(ele, copy2(_prop)) || ret; - if (updateTransitions) { - diffProp.next = ele.pstyle(_prop.name); - } - } - if (ret) { - this.updateStyleHints(ele); - } - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); - } - } - return ret; - }; - styfn$7.overrideBypass = function(eles, name, value2) { - name = camel2dash(name); - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - var prop = ele._private.style[name]; - var type2 = this.properties[name].type; - var isColor = type2.color; - var isMulti = type2.mutiple; - var oldValue = !prop ? null : prop.pfValue != null ? prop.pfValue : prop.value; - if (!prop || !prop.bypass) { - this.applyBypass(ele, name, value2); - } else { - prop.value = value2; - if (prop.pfValue != null) { - prop.pfValue = value2; - } - if (isColor) { - prop.strValue = "rgb(" + value2.join(",") + ")"; - } else if (isMulti) { - prop.strValue = value2.join(" "); - } else { - prop.strValue = "" + value2; - } - this.updateStyleHints(ele); - } - this.checkTriggers(ele, name, oldValue, value2); - } - }; - styfn$7.removeAllBypasses = function(eles, updateTransitions) { - return this.removeBypasses(eles, this.propertyNames, updateTransitions); - }; - styfn$7.removeBypasses = function(eles, props, updateTransitions) { - var isBypass = true; - for (var j = 0; j < eles.length; j++) { - var ele = eles[j]; - var diffProps = {}; - for (var i3 = 0; i3 < props.length; i3++) { - var name = props[i3]; - var prop = this.properties[name]; - var prevProp = ele.pstyle(prop.name); - if (!prevProp || !prevProp.bypass) { - continue; - } - var value2 = ""; - var parsedProp = this.parse(name, value2, true); - var diffProp = diffProps[prop.name] = { - prev: prevProp - }; - this.applyParsedProperty(ele, parsedProp); - diffProp.next = ele.pstyle(prop.name); - } - this.updateStyleHints(ele); - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); - } - } - }; - var styfn$6 = {}; - styfn$6.getEmSizeInPixels = function() { - var px = this.containerCss("font-size"); - if (px != null) { - return parseFloat(px); - } else { - return 1; - } - }; - styfn$6.containerCss = function(propName) { - var cy = this._private.cy; - var domElement2 = cy.container(); - var containerWindow = cy.window(); - if (containerWindow && domElement2 && containerWindow.getComputedStyle) { - return containerWindow.getComputedStyle(domElement2).getPropertyValue(propName); - } - }; - var styfn$5 = {}; - styfn$5.getRenderedStyle = function(ele, prop) { - if (prop) { - return this.getStylePropertyValue(ele, prop, true); - } else { - return this.getRawStyle(ele, true); - } - }; - styfn$5.getRawStyle = function(ele, isRenderedVal) { - var self2 = this; - ele = ele[0]; - if (ele) { - var rstyle = {}; - for (var i3 = 0; i3 < self2.properties.length; i3++) { - var prop = self2.properties[i3]; - var val = self2.getStylePropertyValue(ele, prop.name, isRenderedVal); - if (val != null) { - rstyle[prop.name] = val; - rstyle[dash2camel(prop.name)] = val; - } - } - return rstyle; - } - }; - styfn$5.getIndexedStyle = function(ele, property2, subproperty, index2) { - var pstyle = ele.pstyle(property2)[subproperty][index2]; - return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property2)[subproperty][0]; - }; - styfn$5.getStylePropertyValue = function(ele, propName, isRenderedVal) { - var self2 = this; - ele = ele[0]; - if (ele) { - var prop = self2.properties[propName]; - if (prop.alias) { - prop = prop.pointsTo; - } - var type2 = prop.type; - var styleProp = ele.pstyle(prop.name); - if (styleProp) { - var value2 = styleProp.value, units = styleProp.units, strValue = styleProp.strValue; - if (isRenderedVal && type2.number && value2 != null && number$12(value2)) { - var zoom = ele.cy().zoom(); - var getRenderedValue = function getRenderedValue2(val) { - return val * zoom; - }; - var getValueStringWithUnits = function getValueStringWithUnits2(val, units2) { - return getRenderedValue(val) + units2; - }; - var isArrayValue = array2(value2); - var haveUnits = isArrayValue ? units.every(function(u) { - return u != null; - }) : units != null; - if (haveUnits) { - if (isArrayValue) { - return value2.map(function(v, i3) { - return getValueStringWithUnits(v, units[i3]); - }).join(" "); - } else { - return getValueStringWithUnits(value2, units); - } - } else { - if (isArrayValue) { - return value2.map(function(v) { - return string2(v) ? v : "" + getRenderedValue(v); - }).join(" "); - } else { - return "" + getRenderedValue(value2); - } - } - } else if (strValue != null) { - return strValue; - } - } - return null; - } - }; - styfn$5.getAnimationStartStyle = function(ele, aniProps) { - var rstyle = {}; - for (var i3 = 0; i3 < aniProps.length; i3++) { - var aniProp = aniProps[i3]; - var name = aniProp.name; - var styleProp = ele.pstyle(name); - if (styleProp !== void 0) { - if (plainObject(styleProp)) { - styleProp = this.parse(name, styleProp.strValue); - } else { - styleProp = this.parse(name, styleProp); - } - } - if (styleProp) { - rstyle[name] = styleProp; - } - } - return rstyle; - }; - styfn$5.getPropsList = function(propsObj) { - var self2 = this; - var rstyle = []; - var style = propsObj; - var props = self2.properties; - if (style) { - var names = Object.keys(style); - for (var i3 = 0; i3 < names.length; i3++) { - var name = names[i3]; - var val = style[name]; - var prop = props[name] || props[camel2dash(name)]; - var styleProp = this.parse(prop.name, val); - if (styleProp) { - rstyle.push(styleProp); - } - } - } - return rstyle; - }; - styfn$5.getNonDefaultPropertiesHash = function(ele, propNames, seed) { - var hash = seed.slice(); - var name, val, strVal, chVal; - var i3, j; - for (i3 = 0; i3 < propNames.length; i3++) { - name = propNames[i3]; - val = ele.pstyle(name, false); - if (val == null) { - continue; - } else if (val.pfValue != null) { - hash[0] = hashInt(chVal, hash[0]); - hash[1] = hashIntAlt(chVal, hash[1]); - } else { - strVal = val.strValue; - for (j = 0; j < strVal.length; j++) { - chVal = strVal.charCodeAt(j); - hash[0] = hashInt(chVal, hash[0]); - hash[1] = hashIntAlt(chVal, hash[1]); - } - } - } - return hash; - }; - styfn$5.getPropertiesHash = styfn$5.getNonDefaultPropertiesHash; - var styfn$4 = {}; - styfn$4.appendFromJson = function(json2) { - var style = this; - for (var i3 = 0; i3 < json2.length; i3++) { - var context = json2[i3]; - var selector2 = context.selector; - var props = context.style || context.css; - var names = Object.keys(props); - style.selector(selector2); - for (var j = 0; j < names.length; j++) { - var name = names[j]; - var value2 = props[name]; - style.css(name, value2); - } - } - return style; - }; - styfn$4.fromJson = function(json2) { - var style = this; - style.resetToDefault(); - style.appendFromJson(json2); - return style; - }; - styfn$4.json = function() { - var json2 = []; - for (var i3 = this.defaultLength; i3 < this.length; i3++) { - var cxt = this[i3]; - var selector2 = cxt.selector; - var props = cxt.properties; - var css = {}; - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - css[prop.name] = prop.strValue; - } - json2.push({ - selector: !selector2 ? "core" : selector2.toString(), - style: css - }); - } - return json2; - }; - var styfn$3 = {}; - styfn$3.appendFromString = function(string3) { - var self2 = this; - var style = this; - var remaining = "" + string3; - var selAndBlockStr; - var blockRem; - var propAndValStr; - remaining = remaining.replace(/[/][*](\s|.)+?[*][/]/g, ""); - function removeSelAndBlockFromRemaining() { - if (remaining.length > selAndBlockStr.length) { - remaining = remaining.substr(selAndBlockStr.length); - } else { - remaining = ""; - } - } - function removePropAndValFromRem() { - if (blockRem.length > propAndValStr.length) { - blockRem = blockRem.substr(propAndValStr.length); - } else { - blockRem = ""; - } - } - for (; ; ) { - var nothingLeftToParse = remaining.match(/^\s*$/); - if (nothingLeftToParse) { - break; - } - var selAndBlock = remaining.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); - if (!selAndBlock) { - warn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + remaining); - break; - } - selAndBlockStr = selAndBlock[0]; - var selectorStr = selAndBlock[1]; - if (selectorStr !== "core") { - var selector2 = new Selector(selectorStr); - if (selector2.invalid) { - warn("Skipping parsing of block: Invalid selector found in string stylesheet: " + selectorStr); - removeSelAndBlockFromRemaining(); - continue; - } - } - var blockStr = selAndBlock[2]; - var invalidBlock = false; - blockRem = blockStr; - var props = []; - for (; ; ) { - var _nothingLeftToParse = blockRem.match(/^\s*$/); - if (_nothingLeftToParse) { - break; - } - var propAndVal = blockRem.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); - if (!propAndVal) { - warn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + blockStr); - invalidBlock = true; - break; - } - propAndValStr = propAndVal[0]; - var propStr = propAndVal[1]; - var valStr = propAndVal[2]; - var prop = self2.properties[propStr]; - if (!prop) { - warn("Skipping property: Invalid property name in: " + propAndValStr); - removePropAndValFromRem(); - continue; - } - var parsedProp = style.parse(propStr, valStr); - if (!parsedProp) { - warn("Skipping property: Invalid property definition in: " + propAndValStr); - removePropAndValFromRem(); - continue; - } - props.push({ - name: propStr, - val: valStr - }); - removePropAndValFromRem(); - } - if (invalidBlock) { - removeSelAndBlockFromRemaining(); - break; - } - style.selector(selectorStr); - for (var i3 = 0; i3 < props.length; i3++) { - var _prop = props[i3]; - style.css(_prop.name, _prop.val); - } - removeSelAndBlockFromRemaining(); - } - return style; - }; - styfn$3.fromString = function(string3) { - var style = this; - style.resetToDefault(); - style.appendFromString(string3); - return style; - }; - var styfn$2 = {}; - (function() { - var number$13 = number2; - var rgba3 = rgbaNoBackRefs; - var hsla3 = hslaNoBackRefs; - var hex3$1 = hex3; - var hex6$1 = hex6; - var data2 = function data3(prefix) { - return "^" + prefix + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; - }; - var mapData = function mapData2(prefix) { - var mapArg = number$13 + "|\\w+|" + rgba3 + "|" + hsla3 + "|" + hex3$1 + "|" + hex6$1; - return "^" + prefix + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + number$13 + ")\\s*\\,\\s*(" + number$13 + ")\\s*,\\s*(" + mapArg + ")\\s*\\,\\s*(" + mapArg + ")\\)$"; - }; - var urlRegexes = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"]; - styfn$2.types = { - time: { - number: true, - min: 0, - units: "s|ms", - implicitUnits: "ms" - }, - percent: { - number: true, - min: 0, - max: 100, - units: "%", - implicitUnits: "%" - }, - percentages: { - number: true, - min: 0, - max: 100, - units: "%", - implicitUnits: "%", - multiple: true - }, - zeroOneNumber: { - number: true, - min: 0, - max: 1, - unitless: true - }, - zeroOneNumbers: { - number: true, - min: 0, - max: 1, - unitless: true, - multiple: true - }, - nOneOneNumber: { - number: true, - min: -1, - max: 1, - unitless: true - }, - nonNegativeInt: { - number: true, - min: 0, - integer: true, - unitless: true - }, - nonNegativeNumber: { - number: true, - min: 0, - unitless: true - }, - position: { - enums: ["parent", "origin"] - }, - nodeSize: { - number: true, - min: 0, - enums: ["label"] - }, - number: { - number: true, - unitless: true - }, - numbers: { - number: true, - unitless: true, - multiple: true - }, - positiveNumber: { - number: true, - unitless: true, - min: 0, - strictMin: true - }, - size: { - number: true, - min: 0 - }, - bidirectionalSize: { - number: true - }, - // allows negative - bidirectionalSizeMaybePercent: { - number: true, - allowPercent: true - }, - // allows negative - bidirectionalSizes: { - number: true, - multiple: true - }, - // allows negative - sizeMaybePercent: { - number: true, - min: 0, - allowPercent: true - }, - axisDirection: { - enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"] - }, - paddingRelativeTo: { - enums: ["width", "height", "average", "min", "max"] - }, - bgWH: { - number: true, - min: 0, - allowPercent: true, - enums: ["auto"], - multiple: true - }, - bgPos: { - number: true, - allowPercent: true, - multiple: true - }, - bgRelativeTo: { - enums: ["inner", "include-padding"], - multiple: true - }, - bgRepeat: { - enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"], - multiple: true - }, - bgFit: { - enums: ["none", "contain", "cover"], - multiple: true - }, - bgCrossOrigin: { - enums: ["anonymous", "use-credentials", "null"], - multiple: true - }, - bgClip: { - enums: ["none", "node"], - multiple: true - }, - bgContainment: { - enums: ["inside", "over"], - multiple: true - }, - color: { - color: true - }, - colors: { - color: true, - multiple: true - }, - fill: { - enums: ["solid", "linear-gradient", "radial-gradient"] - }, - bool: { - enums: ["yes", "no"] - }, - bools: { - enums: ["yes", "no"], - multiple: true - }, - lineStyle: { - enums: ["solid", "dotted", "dashed"] - }, - lineCap: { - enums: ["butt", "round", "square"] - }, - borderStyle: { - enums: ["solid", "dotted", "dashed", "double"] - }, - curveStyle: { - enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi"] - }, - fontFamily: { - regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' - }, - fontStyle: { - enums: ["italic", "normal", "oblique"] - }, - fontWeight: { - enums: ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "800", "900", 100, 200, 300, 400, 500, 600, 700, 800, 900] - }, - textDecoration: { - enums: ["none", "underline", "overline", "line-through"] - }, - textTransform: { - enums: ["none", "uppercase", "lowercase"] - }, - textWrap: { - enums: ["none", "wrap", "ellipsis"] - }, - textOverflowWrap: { - enums: ["whitespace", "anywhere"] - }, - textBackgroundShape: { - enums: ["rectangle", "roundrectangle", "round-rectangle"] - }, - nodeShape: { - enums: ["rectangle", "roundrectangle", "round-rectangle", "cutrectangle", "cut-rectangle", "bottomroundrectangle", "bottom-round-rectangle", "barrel", "ellipse", "triangle", "round-triangle", "square", "pentagon", "round-pentagon", "hexagon", "round-hexagon", "concavehexagon", "concave-hexagon", "heptagon", "round-heptagon", "octagon", "round-octagon", "tag", "round-tag", "star", "diamond", "round-diamond", "vee", "rhomboid", "right-rhomboid", "polygon"] - }, - overlayShape: { - enums: ["roundrectangle", "round-rectangle", "ellipse"] - }, - compoundIncludeLabels: { - enums: ["include", "exclude"] - }, - arrowShape: { - enums: ["tee", "triangle", "triangle-tee", "circle-triangle", "triangle-cross", "triangle-backcurve", "vee", "square", "circle", "diamond", "chevron", "none"] - }, - arrowFill: { - enums: ["filled", "hollow"] - }, - arrowWidth: { - number: true, - units: "%|px|em", - implicitUnits: "px", - enums: ["match-line"] - }, - display: { - enums: ["element", "none"] - }, - visibility: { - enums: ["hidden", "visible"] - }, - zCompoundDepth: { - enums: ["bottom", "orphan", "auto", "top"] - }, - zIndexCompare: { - enums: ["auto", "manual"] - }, - valign: { - enums: ["top", "center", "bottom"] - }, - halign: { - enums: ["left", "center", "right"] - }, - justification: { - enums: ["left", "center", "right", "auto"] - }, - text: { - string: true - }, - data: { - mapping: true, - regex: data2("data") - }, - layoutData: { - mapping: true, - regex: data2("layoutData") - }, - scratch: { - mapping: true, - regex: data2("scratch") - }, - mapData: { - mapping: true, - regex: mapData("mapData") - }, - mapLayoutData: { - mapping: true, - regex: mapData("mapLayoutData") - }, - mapScratch: { - mapping: true, - regex: mapData("mapScratch") - }, - fn: { - mapping: true, - fn: true - }, - url: { - regexes: urlRegexes, - singleRegexMatchValue: true - }, - urls: { - regexes: urlRegexes, - singleRegexMatchValue: true, - multiple: true - }, - propList: { - propList: true - }, - angle: { - number: true, - units: "deg|rad", - implicitUnits: "rad" - }, - textRotation: { - number: true, - units: "deg|rad", - implicitUnits: "rad", - enums: ["none", "autorotate"] - }, - polygonPointList: { - number: true, - multiple: true, - evenMultiple: true, - min: -1, - max: 1, - unitless: true - }, - edgeDistances: { - enums: ["intersection", "node-position", "endpoints"] - }, - edgeEndpoint: { - number: true, - multiple: true, - units: "%|px|em|deg|rad", - implicitUnits: "px", - enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"], - singleEnum: true, - validate: function validate2(valArr, unitsArr) { - switch (valArr.length) { - case 2: - return unitsArr[0] !== "deg" && unitsArr[0] !== "rad" && unitsArr[1] !== "deg" && unitsArr[1] !== "rad"; - case 1: - return string2(valArr[0]) || unitsArr[0] === "deg" || unitsArr[0] === "rad"; - default: - return false; - } - } - }, - easing: { - regexes: ["^(spring)\\s*\\(\\s*(" + number$13 + ")\\s*,\\s*(" + number$13 + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + number$13 + ")\\s*,\\s*(" + number$13 + ")\\s*,\\s*(" + number$13 + ")\\s*,\\s*(" + number$13 + ")\\s*\\)$"], - enums: ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "ease-in-sine", "ease-out-sine", "ease-in-out-sine", "ease-in-quad", "ease-out-quad", "ease-in-out-quad", "ease-in-cubic", "ease-out-cubic", "ease-in-out-cubic", "ease-in-quart", "ease-out-quart", "ease-in-out-quart", "ease-in-quint", "ease-out-quint", "ease-in-out-quint", "ease-in-expo", "ease-out-expo", "ease-in-out-expo", "ease-in-circ", "ease-out-circ", "ease-in-out-circ"] - }, - gradientDirection: { - enums: [ - "to-bottom", - "to-top", - "to-left", - "to-right", - "to-bottom-right", - "to-bottom-left", - "to-top-right", - "to-top-left", - "to-right-bottom", - "to-left-bottom", - "to-right-top", - "to-left-top" - // different order - ] - }, - boundsExpansion: { - number: true, - multiple: true, - min: 0, - validate: function validate2(valArr) { - var length2 = valArr.length; - return length2 === 1 || length2 === 2 || length2 === 4; - } - } - }; - var diff = { - zeroNonZero: function zeroNonZero(val1, val2) { - if ((val1 == null || val2 == null) && val1 !== val2) { - return true; - } - if (val1 == 0 && val2 != 0) { - return true; - } else if (val1 != 0 && val2 == 0) { - return true; - } else { - return false; - } - }, - any: function any(val1, val2) { + }, "zeroNonZero"), + any: /* @__PURE__ */ __name(function any(val1, val2) { return val1 != val2; - }, - emptyNonEmpty: function emptyNonEmpty(str1, str2) { + }, "any"), + emptyNonEmpty: /* @__PURE__ */ __name(function emptyNonEmpty(str1, str2) { var empty1 = emptyString(str1); - var empty2 = emptyString(str2); - return empty1 && !empty2 || !empty1 && empty2; - } + var empty22 = emptyString(str2); + return empty1 && !empty22 || !empty1 && empty22; + }, "emptyNonEmpty") }; - var t = styfn$2.types; + var t4 = styfn$2.types; var mainLabel = [{ name: "label", - type: t.text, - triggersBounds: diff.any, - triggersZOrder: diff.emptyNonEmpty + type: t4.text, + triggersBounds: diff2.any, + triggersZOrder: diff2.emptyNonEmpty }, { name: "text-rotation", - type: t.textRotation, - triggersBounds: diff.any + type: t4.textRotation, + triggersBounds: diff2.any }, { name: "text-margin-x", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }, { name: "text-margin-y", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }]; var sourceLabel = [{ name: "source-label", - type: t.text, - triggersBounds: diff.any + type: t4.text, + triggersBounds: diff2.any }, { name: "source-text-rotation", - type: t.textRotation, - triggersBounds: diff.any + type: t4.textRotation, + triggersBounds: diff2.any }, { name: "source-text-margin-x", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }, { name: "source-text-margin-y", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }, { name: "source-text-offset", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }]; var targetLabel = [{ name: "target-label", - type: t.text, - triggersBounds: diff.any + type: t4.text, + triggersBounds: diff2.any }, { name: "target-text-rotation", - type: t.textRotation, - triggersBounds: diff.any + type: t4.textRotation, + triggersBounds: diff2.any }, { name: "target-text-margin-x", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }, { name: "target-text-margin-y", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }, { name: "target-text-offset", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }]; var labelDimensions = [{ name: "font-family", - type: t.fontFamily, - triggersBounds: diff.any + type: t4.fontFamily, + triggersBounds: diff2.any }, { name: "font-style", - type: t.fontStyle, - triggersBounds: diff.any + type: t4.fontStyle, + triggersBounds: diff2.any }, { name: "font-weight", - type: t.fontWeight, - triggersBounds: diff.any + type: t4.fontWeight, + triggersBounds: diff2.any }, { name: "font-size", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "text-transform", - type: t.textTransform, - triggersBounds: diff.any + type: t4.textTransform, + triggersBounds: diff2.any }, { name: "text-wrap", - type: t.textWrap, - triggersBounds: diff.any + type: t4.textWrap, + triggersBounds: diff2.any }, { name: "text-overflow-wrap", - type: t.textOverflowWrap, - triggersBounds: diff.any + type: t4.textOverflowWrap, + triggersBounds: diff2.any }, { name: "text-max-width", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "text-outline-width", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "line-height", - type: t.positiveNumber, - triggersBounds: diff.any + type: t4.positiveNumber, + triggersBounds: diff2.any }]; var commonLabel = [{ name: "text-valign", - type: t.valign, - triggersBounds: diff.any + type: t4.valign, + triggersBounds: diff2.any }, { name: "text-halign", - type: t.halign, - triggersBounds: diff.any + type: t4.halign, + triggersBounds: diff2.any }, { name: "color", - type: t.color + type: t4.color }, { name: "text-outline-color", - type: t.color + type: t4.color }, { name: "text-outline-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "text-background-color", - type: t.color + type: t4.color }, { name: "text-background-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "text-background-padding", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "text-border-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "text-border-color", - type: t.color + type: t4.color }, { name: "text-border-width", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "text-border-style", - type: t.borderStyle, - triggersBounds: diff.any + type: t4.borderStyle, + triggersBounds: diff2.any }, { name: "text-background-shape", - type: t.textBackgroundShape, - triggersBounds: diff.any + type: t4.textBackgroundShape, + triggersBounds: diff2.any }, { name: "text-justification", - type: t.justification + type: t4.justification }]; var behavior = [{ name: "events", - type: t.bool, - triggersZOrder: diff.any + type: t4.bool, + triggersZOrder: diff2.any }, { name: "text-events", - type: t.bool, - triggersZOrder: diff.any + type: t4.bool, + triggersZOrder: diff2.any }]; var visibility = [{ name: "display", - type: t.display, - triggersZOrder: diff.any, - triggersBounds: diff.any, + type: t4.display, + triggersZOrder: diff2.any, + triggersBounds: diff2.any, triggersBoundsOfConnectedEdges: true }, { name: "visibility", - type: t.visibility, - triggersZOrder: diff.any + type: t4.visibility, + triggersZOrder: diff2.any }, { name: "opacity", - type: t.zeroOneNumber, - triggersZOrder: diff.zeroNonZero + type: t4.zeroOneNumber, + triggersZOrder: diff2.zeroNonZero }, { name: "text-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "min-zoomed-font-size", - type: t.size + type: t4.size }, { name: "z-compound-depth", - type: t.zCompoundDepth, - triggersZOrder: diff.any + type: t4.zCompoundDepth, + triggersZOrder: diff2.any }, { name: "z-index-compare", - type: t.zIndexCompare, - triggersZOrder: diff.any + type: t4.zIndexCompare, + triggersZOrder: diff2.any }, { name: "z-index", - type: t.number, - triggersZOrder: diff.any + type: t4.number, + triggersZOrder: diff2.any }]; var overlay = [{ name: "overlay-padding", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "overlay-color", - type: t.color + type: t4.color }, { name: "overlay-opacity", - type: t.zeroOneNumber, - triggersBounds: diff.zeroNonZero + type: t4.zeroOneNumber, + triggersBounds: diff2.zeroNonZero }, { name: "overlay-shape", - type: t.overlayShape, - triggersBounds: diff.any + type: t4.overlayShape, + triggersBounds: diff2.any + }, { + name: "overlay-corner-radius", + type: t4.cornerRadius }]; var underlay = [{ name: "underlay-padding", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "underlay-color", - type: t.color + type: t4.color }, { name: "underlay-opacity", - type: t.zeroOneNumber, - triggersBounds: diff.zeroNonZero + type: t4.zeroOneNumber, + triggersBounds: diff2.zeroNonZero }, { name: "underlay-shape", - type: t.overlayShape, - triggersBounds: diff.any + type: t4.overlayShape, + triggersBounds: diff2.any + }, { + name: "underlay-corner-radius", + type: t4.cornerRadius }]; - var transition = [{ + var transition2 = [{ name: "transition-property", - type: t.propList + type: t4.propList }, { name: "transition-duration", - type: t.time + type: t4.time }, { name: "transition-delay", - type: t.time + type: t4.time }, { name: "transition-timing-function", - type: t.easing + type: t4.easing }]; - var nodeSizeHashOverride = function nodeSizeHashOverride2(ele, parsedProp) { + var nodeSizeHashOverride = /* @__PURE__ */ __name(function nodeSizeHashOverride2(ele, parsedProp) { if (parsedProp.value === "label") { return -ele.poolIndex(); } else { return parsedProp.pfValue; } - }; + }, "nodeSizeHashOverride"); var nodeBody = [{ name: "height", - type: t.nodeSize, - triggersBounds: diff.any, + type: t4.nodeSize, + triggersBounds: diff2.any, hashOverride: nodeSizeHashOverride }, { name: "width", - type: t.nodeSize, - triggersBounds: diff.any, + type: t4.nodeSize, + triggersBounds: diff2.any, hashOverride: nodeSizeHashOverride }, { name: "shape", - type: t.nodeShape, - triggersBounds: diff.any + type: t4.nodeShape, + triggersBounds: diff2.any }, { name: "shape-polygon-points", - type: t.polygonPointList, - triggersBounds: diff.any + type: t4.polygonPointList, + triggersBounds: diff2.any + }, { + name: "corner-radius", + type: t4.cornerRadius }, { name: "background-color", - type: t.color + type: t4.color }, { name: "background-fill", - type: t.fill + type: t4.fill }, { name: "background-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "background-blacken", - type: t.nOneOneNumber + type: t4.nOneOneNumber }, { name: "background-gradient-stop-colors", - type: t.colors + type: t4.colors }, { name: "background-gradient-stop-positions", - type: t.percentages + type: t4.percentages }, { name: "background-gradient-direction", - type: t.gradientDirection + type: t4.gradientDirection }, { name: "padding", - type: t.sizeMaybePercent, - triggersBounds: diff.any + type: t4.sizeMaybePercent, + triggersBounds: diff2.any }, { name: "padding-relative-to", - type: t.paddingRelativeTo, - triggersBounds: diff.any + type: t4.paddingRelativeTo, + triggersBounds: diff2.any }, { name: "bounds-expansion", - type: t.boundsExpansion, - triggersBounds: diff.any + type: t4.boundsExpansion, + triggersBounds: diff2.any }]; var nodeBorder = [{ name: "border-color", - type: t.color + type: t4.color }, { name: "border-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "border-width", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "border-style", - type: t.borderStyle + type: t4.borderStyle + }, { + name: "border-cap", + type: t4.lineCap + }, { + name: "border-join", + type: t4.lineJoin + }, { + name: "border-dash-pattern", + type: t4.numbers + }, { + name: "border-dash-offset", + type: t4.number + }, { + name: "border-position", + type: t4.linePosition }]; var nodeOutline = [{ name: "outline-color", - type: t.color + type: t4.color }, { name: "outline-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "outline-width", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "outline-style", - type: t.borderStyle + type: t4.borderStyle }, { name: "outline-offset", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }]; var backgroundImage = [{ name: "background-image", - type: t.urls + type: t4.urls }, { name: "background-image-crossorigin", - type: t.bgCrossOrigin + type: t4.bgCrossOrigin }, { name: "background-image-opacity", - type: t.zeroOneNumbers + type: t4.zeroOneNumbers }, { name: "background-image-containment", - type: t.bgContainment + type: t4.bgContainment }, { name: "background-image-smoothing", - type: t.bools + type: t4.bools }, { name: "background-position-x", - type: t.bgPos + type: t4.bgPos }, { name: "background-position-y", - type: t.bgPos + type: t4.bgPos }, { name: "background-width-relative-to", - type: t.bgRelativeTo + type: t4.bgRelativeTo }, { name: "background-height-relative-to", - type: t.bgRelativeTo + type: t4.bgRelativeTo }, { name: "background-repeat", - type: t.bgRepeat + type: t4.bgRepeat }, { name: "background-fit", - type: t.bgFit + type: t4.bgFit }, { name: "background-clip", - type: t.bgClip + type: t4.bgClip }, { name: "background-width", - type: t.bgWH + type: t4.bgWH }, { name: "background-height", - type: t.bgWH + type: t4.bgWH }, { name: "background-offset-x", - type: t.bgPos + type: t4.bgPos }, { name: "background-offset-y", - type: t.bgPos + type: t4.bgPos }]; var compound = [{ name: "position", - type: t.position, - triggersBounds: diff.any + type: t4.position, + triggersBounds: diff2.any }, { name: "compound-sizing-wrt-labels", - type: t.compoundIncludeLabels, - triggersBounds: diff.any + type: t4.compoundIncludeLabels, + triggersBounds: diff2.any }, { name: "min-width", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "min-width-bias-left", - type: t.sizeMaybePercent, - triggersBounds: diff.any + type: t4.sizeMaybePercent, + triggersBounds: diff2.any }, { name: "min-width-bias-right", - type: t.sizeMaybePercent, - triggersBounds: diff.any + type: t4.sizeMaybePercent, + triggersBounds: diff2.any }, { name: "min-height", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "min-height-bias-top", - type: t.sizeMaybePercent, - triggersBounds: diff.any + type: t4.sizeMaybePercent, + triggersBounds: diff2.any }, { name: "min-height-bias-bottom", - type: t.sizeMaybePercent, - triggersBounds: diff.any + type: t4.sizeMaybePercent, + triggersBounds: diff2.any }]; var edgeLine = [{ name: "line-style", - type: t.lineStyle + type: t4.lineStyle }, { name: "line-color", - type: t.color + type: t4.color }, { name: "line-fill", - type: t.fill + type: t4.fill }, { name: "line-cap", - type: t.lineCap + type: t4.lineCap }, { name: "line-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "line-dash-pattern", - type: t.numbers + type: t4.numbers }, { name: "line-dash-offset", - type: t.number + type: t4.number + }, { + name: "line-outline-width", + type: t4.size + }, { + name: "line-outline-color", + type: t4.color }, { name: "line-gradient-stop-colors", - type: t.colors + type: t4.colors }, { name: "line-gradient-stop-positions", - type: t.percentages + type: t4.percentages }, { name: "curve-style", - type: t.curveStyle, - triggersBounds: diff.any, + type: t4.curveStyle, + triggersBounds: diff2.any, triggersBoundsOfParallelBeziers: true }, { name: "haystack-radius", - type: t.zeroOneNumber, - triggersBounds: diff.any + type: t4.zeroOneNumber, + triggersBounds: diff2.any }, { name: "source-endpoint", - type: t.edgeEndpoint, - triggersBounds: diff.any + type: t4.edgeEndpoint, + triggersBounds: diff2.any }, { name: "target-endpoint", - type: t.edgeEndpoint, - triggersBounds: diff.any + type: t4.edgeEndpoint, + triggersBounds: diff2.any }, { name: "control-point-step-size", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "control-point-distances", - type: t.bidirectionalSizes, - triggersBounds: diff.any + type: t4.bidirectionalSizes, + triggersBounds: diff2.any }, { name: "control-point-weights", - type: t.numbers, - triggersBounds: diff.any + type: t4.numbers, + triggersBounds: diff2.any }, { name: "segment-distances", - type: t.bidirectionalSizes, - triggersBounds: diff.any + type: t4.bidirectionalSizes, + triggersBounds: diff2.any }, { name: "segment-weights", - type: t.numbers, - triggersBounds: diff.any + type: t4.numbers, + triggersBounds: diff2.any + }, { + name: "segment-radii", + type: t4.numbers, + triggersBounds: diff2.any + }, { + name: "radius-type", + type: t4.radiusType, + triggersBounds: diff2.any }, { name: "taxi-turn", - type: t.bidirectionalSizeMaybePercent, - triggersBounds: diff.any + type: t4.bidirectionalSizeMaybePercent, + triggersBounds: diff2.any }, { name: "taxi-turn-min-distance", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "taxi-direction", - type: t.axisDirection, - triggersBounds: diff.any + type: t4.axisDirection, + triggersBounds: diff2.any + }, { + name: "taxi-radius", + type: t4.number, + triggersBounds: diff2.any }, { name: "edge-distances", - type: t.edgeDistances, - triggersBounds: diff.any + type: t4.edgeDistances, + triggersBounds: diff2.any }, { name: "arrow-scale", - type: t.positiveNumber, - triggersBounds: diff.any + type: t4.positiveNumber, + triggersBounds: diff2.any }, { name: "loop-direction", - type: t.angle, - triggersBounds: diff.any + type: t4.angle, + triggersBounds: diff2.any }, { name: "loop-sweep", - type: t.angle, - triggersBounds: diff.any + type: t4.angle, + triggersBounds: diff2.any }, { name: "source-distance-from-node", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }, { name: "target-distance-from-node", - type: t.size, - triggersBounds: diff.any + type: t4.size, + triggersBounds: diff2.any }]; var ghost = [{ name: "ghost", - type: t.bool, - triggersBounds: diff.any + type: t4.bool, + triggersBounds: diff2.any }, { name: "ghost-offset-x", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }, { name: "ghost-offset-y", - type: t.bidirectionalSize, - triggersBounds: diff.any + type: t4.bidirectionalSize, + triggersBounds: diff2.any }, { name: "ghost-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }]; - var core3 = [{ + var core4 = [{ name: "selection-box-color", - type: t.color + type: t4.color }, { name: "selection-box-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "selection-box-border-color", - type: t.color + type: t4.color }, { name: "selection-box-border-width", - type: t.size + type: t4.size }, { name: "active-bg-color", - type: t.color + type: t4.color }, { name: "active-bg-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }, { name: "active-bg-size", - type: t.size + type: t4.size }, { name: "outside-texture-bg-color", - type: t.color + type: t4.color }, { name: "outside-texture-bg-opacity", - type: t.zeroOneNumber + type: t4.zeroOneNumber }]; var pie2 = []; styfn$2.pieBackgroundN = 16; pie2.push({ name: "pie-size", - type: t.sizeMaybePercent + type: t4.sizeMaybePercent }); - for (var i3 = 1; i3 <= styfn$2.pieBackgroundN; i3++) { + for (var i2 = 1; i2 <= styfn$2.pieBackgroundN; i2++) { pie2.push({ - name: "pie-" + i3 + "-background-color", - type: t.color + name: "pie-" + i2 + "-background-color", + type: t4.color }); pie2.push({ - name: "pie-" + i3 + "-background-size", - type: t.percent + name: "pie-" + i2 + "-background-size", + type: t4.percent }); pie2.push({ - name: "pie-" + i3 + "-background-opacity", - type: t.zeroOneNumber + name: "pie-" + i2 + "-background-opacity", + type: t4.zeroOneNumber }); } var edgeArrow = []; var arrowPrefixes = styfn$2.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]; [{ name: "arrow-shape", - type: t.arrowShape, - triggersBounds: diff.any + type: t4.arrowShape, + triggersBounds: diff2.any }, { name: "arrow-color", - type: t.color + type: t4.color }, { name: "arrow-fill", - type: t.arrowFill + type: t4.arrowFill }, { name: "arrow-width", - type: t.arrowWidth + type: t4.arrowWidth }].forEach(function(prop2) { arrowPrefixes.forEach(function(prefix) { var name = prefix + "-" + prop2.name; - var type2 = prop2.type, triggersBounds = prop2.triggersBounds; + var type3 = prop2.type, triggersBounds = prop2.triggersBounds; edgeArrow.push({ name, - type: type2, + type: type3, triggersBounds }); }); }, {}); - var props = styfn$2.properties = [].concat(behavior, transition, visibility, overlay, underlay, ghost, commonLabel, labelDimensions, mainLabel, sourceLabel, targetLabel, nodeBody, nodeBorder, nodeOutline, backgroundImage, pie2, compound, edgeLine, edgeArrow, core3); + var props = styfn$2.properties = [].concat(behavior, transition2, visibility, overlay, underlay, ghost, commonLabel, labelDimensions, mainLabel, sourceLabel, targetLabel, nodeBody, nodeBorder, nodeOutline, backgroundImage, pie2, compound, edgeLine, edgeArrow, core4); var propGroups = styfn$2.propertyGroups = { // common to all eles behavior, - transition, + transition: transition2, visibility, overlay, underlay, @@ -175607,7 +108508,7 @@ g.stateGroup line { // edge props edgeLine, edgeArrow, - core: core3 + core: core4 }; var propGroupNames = styfn$2.propertyGroupNames = {}; var propGroupKeys = styfn$2.propertyGroupKeys = Object.keys(propGroups); @@ -175628,6 +108529,15 @@ g.stateGroup line { }, { name: "control-point-weight", pointsTo: "control-point-weights" + }, { + name: "segment-distance", + pointsTo: "segment-distances" + }, { + name: "segment-weight", + pointsTo: "segment-weights" + }, { + name: "segment-radius", + pointsTo: "segment-radii" }, { name: "edge-text-rotation", pointsTo: "text-rotation" @@ -175644,15 +108554,15 @@ g.stateGroup line { name: "padding-bottom", pointsTo: "padding" }]; - styfn$2.propertyNames = props.map(function(p2) { - return p2.name; + styfn$2.propertyNames = props.map(function(p3) { + return p3.name; }); - for (var _i6 = 0; _i6 < props.length; _i6++) { - var prop = props[_i6]; + for (var _i = 0; _i < props.length; _i++) { + var prop = props[_i]; props[prop.name] = prop; } - for (var _i22 = 0; _i22 < aliases.length; _i22++) { - var alias = aliases[_i22]; + for (var _i2 = 0; _i2 < aliases.length; _i2++) { + var alias = aliases[_i2]; var pointsToProp = props[alias.pointsTo]; var aliasProp = { name: alias.name, @@ -175736,10 +108646,12 @@ g.stateGroup line { "overlay-color": "#000", "overlay-padding": 10, "overlay-shape": "round-rectangle", + "overlay-corner-radius": "auto", "underlay-opacity": 0, "underlay-color": "#000", "underlay-padding": 10, "underlay-shape": "round-rectangle", + "underlay-corner-radius": "auto", "transition-property": "none", "transition-duration": 0, "transition-delay": 0, @@ -175769,6 +108681,11 @@ g.stateGroup line { "border-opacity": 1, "border-width": 0, "border-style": "solid", + "border-dash-pattern": [4, 2], + "border-dash-offset": 0, + "border-cap": "butt", + "border-join": "miter", + "border-position": "center", "outline-color": "#999", "outline-opacity": 1, "outline-width": 0, @@ -175778,6 +108695,7 @@ g.stateGroup line { "width": 30, "shape": "ellipse", "shape-polygon-points": "-1, -1, 1, -1, 1, 1, -1, 1", + "corner-radius": "auto", "bounds-expansion": 0, // node gradient "background-gradient-direction": "to-bottom", @@ -175812,8 +108730,8 @@ g.stateGroup line { name: "pie-{{i}}-background-opacity", value: 1 }].reduce(function(css, prop2) { - for (var i4 = 1; i4 <= styfn$2.pieBackgroundN; i4++) { - var name2 = prop2.name.replace("{{i}}", i4); + for (var i3 = 1; i3 <= styfn$2.pieBackgroundN; i3++) { + var name2 = prop2.name.replace("{{i}}", i3); var val2 = prop2.value; css[name2] = val2; } @@ -175825,13 +108743,18 @@ g.stateGroup line { "line-fill": "solid", "line-cap": "butt", "line-opacity": 1, + "line-outline-width": 0, + "line-outline-color": "#000", "line-gradient-stop-colors": "#999", "line-gradient-stop-positions": "0%", "control-point-step-size": 40, "control-point-weights": 0.5, "segment-weights": 0.5, "segment-distances": 20, + "segment-radii": 15, + "radius-type": "arc-radius", "taxi-turn": "50%", + "taxi-radius": 15, "taxi-turn-min-distance": 10, "taxi-direction": "auto", "edge-distances": "intersection", @@ -175867,8 +108790,8 @@ g.stateGroup line { return css; }, {})); var parsedProps = {}; - for (var i3 = 0; i3 < this.properties.length; i3++) { - var prop = this.properties[i3]; + for (var i2 = 0; i2 < this.properties.length; i2++) { + var prop = this.properties[i2]; if (prop.pointsTo) { continue; } @@ -175912,7 +108835,7 @@ g.stateGroup line { }); this.defaultLength = this.length; }; - var styfn$1 = {}; + styfn$1 = {}; styfn$1.parse = function(name, value2, propIsBypass, propIsFlat) { var self2 = this; if (fn$6(value2)) { @@ -175928,9 +108851,9 @@ g.stateGroup line { ret = propCache[argHash] = self2.parseImplWarn(name, value2, propIsBypass, propIsFlat); } if (propIsBypass || propIsFlat === "mapping") { - ret = copy2(ret); + ret = copy4(ret); if (ret) { - ret.value = copy2(ret.value); + ret.value = copy4(ret.value); } } return ret; @@ -175961,12 +108884,12 @@ g.stateGroup line { property2 = property2.pointsTo; name = property2.name; } - var valueIsString = string2(value2); + var valueIsString = string(value2); if (valueIsString) { value2 = value2.trim(); } - var type2 = property2.type; - if (!type2) { + var type3 = property2.type; + if (!type3) { return null; } if (propIsBypass && (value2 === "" || value2 === null)) { @@ -175986,31 +108909,30 @@ g.stateGroup line { bypass: propIsBypass }; } - var data2, mapData; - if (!valueIsString || propIsFlat || value2.length < 7 || value2[1] !== "a") - ; - else if (value2.length >= 7 && value2[0] === "d" && (data2 = new RegExp(types.data.regex).exec(value2))) { + var data5, mapData; + if (!valueIsString || propIsFlat || value2.length < 7 || value2[1] !== "a") ; + else if (value2.length >= 7 && value2[0] === "d" && (data5 = new RegExp(types.data.regex).exec(value2))) { if (propIsBypass) { return false; } var mapped = types.data; return { name, - value: data2, + value: data5, strValue: "" + value2, mapped, - field: data2[1], + field: data5[1], bypass: propIsBypass }; } else if (value2.length >= 10 && value2[0] === "m" && (mapData = new RegExp(types.mapData.regex).exec(value2))) { if (propIsBypass) { return false; } - if (type2.multiple) { + if (type3.multiple) { return false; } var _mapped = types.mapData; - if (!(type2.color || type2.number)) { + if (!(type3.color || type3.number)) { return false; } var valueMin = this.parse(name, mapData[4]); @@ -176024,12 +108946,12 @@ g.stateGroup line { if (valueMin.pfValue === valueMax.pfValue || valueMin.strValue === valueMax.strValue) { warn("`" + name + ": " + value2 + "` is not a valid mapper because the output range is zero; converting to `" + name + ": " + valueMin.strValue + "`"); return this.parse(name, valueMin.strValue); - } else if (type2.color) { + } else if (type3.color) { var c1 = valueMin.value; - var c2 = valueMax.value; - var same = c1[0] === c2[0] && c1[1] === c2[1] && c1[2] === c2[2] && // optional alpha - (c1[3] === c2[3] || (c1[3] == null || c1[3] === 1) && (c2[3] == null || c2[3] === 1)); - if (same) { + var c22 = valueMax.value; + var same2 = c1[0] === c22[0] && c1[1] === c22[1] && c1[2] === c22[2] && // optional alpha + (c1[3] === c22[3] || (c1[3] == null || c1[3] === 1) && (c22[3] == null || c22[3] === 1)); + if (same2) { return false; } } @@ -176047,7 +108969,7 @@ g.stateGroup line { bypass: propIsBypass }; } - if (type2.multiple && propIsFlat !== "multiple") { + if (type3.multiple && propIsFlat !== "multiple") { var vals; if (valueIsString) { vals = value2.split(/\s+/); @@ -176056,7 +108978,7 @@ g.stateGroup line { } else { vals = [value2]; } - if (type2.evenMultiple && vals.length % 2 !== 0) { + if (type3.evenMultiple && vals.length % 2 !== 0) { return null; } var valArr = []; @@ -176064,19 +108986,19 @@ g.stateGroup line { var pfValArr = []; var strVal = ""; var hasEnum = false; - for (var i3 = 0; i3 < vals.length; i3++) { - var p2 = self2.parse(name, vals[i3], propIsBypass, "multiple"); - hasEnum = hasEnum || string2(p2.value); - valArr.push(p2.value); - pfValArr.push(p2.pfValue != null ? p2.pfValue : p2.value); - unitsArr.push(p2.units); - strVal += (i3 > 0 ? " " : "") + p2.strValue; - } - if (type2.validate && !type2.validate(valArr, unitsArr)) { + for (var i2 = 0; i2 < vals.length; i2++) { + var p3 = self2.parse(name, vals[i2], propIsBypass, "multiple"); + hasEnum = hasEnum || string(p3.value); + valArr.push(p3.value); + pfValArr.push(p3.pfValue != null ? p3.pfValue : p3.value); + unitsArr.push(p3.units); + strVal += (i2 > 0 ? " " : "") + p3.strValue; + } + if (type3.validate && !type3.validate(valArr, unitsArr)) { return null; } - if (type2.singleEnum && hasEnum) { - if (valArr.length === 1 && string2(valArr[0])) { + if (type3.singleEnum && hasEnum) { + if (valArr.length === 1 && string(valArr[0])) { return { name, value: valArr[0], @@ -176096,9 +109018,9 @@ g.stateGroup line { units: unitsArr }; } - var checkEnums = function checkEnums2() { - for (var _i6 = 0; _i6 < type2.enums.length; _i6++) { - var en = type2.enums[_i6]; + var checkEnums = /* @__PURE__ */ __name(function checkEnums2() { + for (var _i = 0; _i < type3.enums.length; _i++) { + var en = type3.enums[_i]; if (en === value2) { return { name, @@ -176109,43 +109031,43 @@ g.stateGroup line { } } return null; - }; - if (type2.number) { + }, "checkEnums"); + if (type3.number) { var units; var implicitUnits = "px"; - if (type2.units) { - units = type2.units; + if (type3.units) { + units = type3.units; } - if (type2.implicitUnits) { - implicitUnits = type2.implicitUnits; + if (type3.implicitUnits) { + implicitUnits = type3.implicitUnits; } - if (!type2.unitless) { + if (!type3.unitless) { if (valueIsString) { - var unitsRegex = "px|em" + (type2.allowPercent ? "|\\%" : ""); + var unitsRegex = "px|em" + (type3.allowPercent ? "|\\%" : ""); if (units) { unitsRegex = units; } - var match2 = value2.match("^(" + number2 + ")(" + unitsRegex + ")?$"); + var match2 = value2.match("^(" + number6 + ")(" + unitsRegex + ")?$"); if (match2) { value2 = match2[1]; units = match2[2] || implicitUnits; } - } else if (!units || type2.implicitUnits) { + } else if (!units || type3.implicitUnits) { units = implicitUnits; } } value2 = parseFloat(value2); - if (isNaN(value2) && type2.enums === void 0) { + if (isNaN(value2) && type3.enums === void 0) { return null; } - if (isNaN(value2) && type2.enums !== void 0) { + if (isNaN(value2) && type3.enums !== void 0) { value2 = passedValue; return checkEnums(); } - if (type2.integer && !integer(value2)) { + if (type3.integer && !integer2(value2)) { return null; } - if (type2.min !== void 0 && (value2 < type2.min || type2.strictMin && value2 === type2.min) || type2.max !== void 0 && (value2 > type2.max || type2.strictMax && value2 === type2.max)) { + if (type3.min !== void 0 && (value2 < type3.min || type3.strictMin && value2 === type3.min) || type3.max !== void 0 && (value2 > type3.max || type3.strictMax && value2 === type3.max)) { return null; } var ret = { @@ -176155,7 +109077,7 @@ g.stateGroup line { units, bypass: propIsBypass }; - if (type2.unitless || units !== "px" && units !== "em") { + if (type3.unitless || units !== "px" && units !== "em") { ret.pfValue = value2; } else { ret.pfValue = units === "px" || !units ? value2 : this.getEmSizeInPixels() * value2; @@ -176170,15 +109092,14 @@ g.stateGroup line { ret.pfValue = value2 / 100; } return ret; - } else if (type2.propList) { + } else if (type3.propList) { var props = []; var propsStr = "" + value2; - if (propsStr === "none") - ; + if (propsStr === "none") ; else { var propsSplit = propsStr.split(/\s*,\s*|\s+/); - for (var _i22 = 0; _i22 < propsSplit.length; _i22++) { - var propName = propsSplit[_i22].trim(); + for (var _i2 = 0; _i2 < propsSplit.length; _i2++) { + var propName = propsSplit[_i2].trim(); if (self2.properties[propName]) { props.push(propName); } else { @@ -176195,7 +109116,7 @@ g.stateGroup line { strValue: props.length === 0 ? "none" : props.join(" "), bypass: propIsBypass }; - } else if (type2.color) { + } else if (type3.color) { var tuple = color2tuple(value2); if (!tuple) { return null; @@ -176208,45 +109129,45 @@ g.stateGroup line { // n.b. no spaces b/c of multiple support bypass: propIsBypass }; - } else if (type2.regex || type2.regexes) { - if (type2.enums) { + } else if (type3.regex || type3.regexes) { + if (type3.enums) { var enumProp = checkEnums(); if (enumProp) { return enumProp; } } - var regexes = type2.regexes ? type2.regexes : [type2.regex]; - for (var _i32 = 0; _i32 < regexes.length; _i32++) { - var regex = new RegExp(regexes[_i32]); - var m = regex.exec(value2); - if (m) { + var regexes = type3.regexes ? type3.regexes : [type3.regex]; + for (var _i3 = 0; _i3 < regexes.length; _i3++) { + var regex = new RegExp(regexes[_i3]); + var m2 = regex.exec(value2); + if (m2) { return { name, - value: type2.singleRegexMatchValue ? m[1] : m, + value: type3.singleRegexMatchValue ? m2[1] : m2, strValue: "" + value2, bypass: propIsBypass }; } } return null; - } else if (type2.string) { + } else if (type3.string) { return { name, value: "" + value2, strValue: "" + value2, bypass: propIsBypass }; - } else if (type2.enums) { + } else if (type3.enums) { return checkEnums(); } else { return null; } }; - var Style2 = function Style3(cy) { + Style2 = /* @__PURE__ */ __name(function Style3(cy) { if (!(this instanceof Style3)) { return new Style3(cy); } - if (!core2(cy)) { + if (!core(cy)) { error("A style must have a core reference"); return; } @@ -176256,8 +109177,8 @@ g.stateGroup line { }; this.length = 0; this.resetToDefault(); - }; - var styfn = Style2.prototype; + }, "Style"); + styfn = Style2.prototype; styfn.instanceString = function() { return "style"; }; @@ -176265,8 +109186,8 @@ g.stateGroup line { var _p = this._private; var cy = _p.cy; var eles = cy.elements(); - for (var i3 = 0; i3 < this.length; i3++) { - this[i3] = void 0; + for (var i2 = 0; i2 < this.length; i2++) { + this[i2] = void 0; } this.length = 0; _p.contextStyles = {}; @@ -176288,13 +109209,13 @@ g.stateGroup line { return this._private.coreStyle[propName] || this.getDefaultProperty(propName); }; styfn.selector = function(selectorStr) { - var selector2 = selectorStr === "core" ? null : new Selector(selectorStr); - var i3 = this.length++; - this[i3] = { - selector: selector2, + var selector = selectorStr === "core" ? null : new Selector(selectorStr); + var i2 = this.length++; + this[i2] = { + selector, properties: [], mappedProperties: [], - index: i3 + index: i2 }; return this; }; @@ -176302,12 +109223,12 @@ g.stateGroup line { var self2 = this; var args = arguments; if (args.length === 1) { - var map2 = args[0]; - for (var i3 = 0; i3 < self2.properties.length; i3++) { - var prop = self2.properties[i3]; - var mapVal = map2[prop.name]; + var map5 = args[0]; + for (var i2 = 0; i2 < self2.properties.length; i2++) { + var prop = self2.properties[i2]; + var mapVal = map5[prop.name]; if (mapVal === void 0) { - mapVal = map2[dash2camel(prop.name)]; + mapVal = map5[dash2camel(prop.name)]; } if (mapVal !== void 0) { this.cssRule(prop.name, mapVal); @@ -176322,36 +109243,36 @@ g.stateGroup line { styfn.cssRule = function(name, value2) { var property2 = this.parse(name, value2); if (property2) { - var i3 = this.length - 1; - this[i3].properties.push(property2); - this[i3].properties[property2.name] = property2; + var i2 = this.length - 1; + this[i2].properties.push(property2); + this[i2].properties[property2.name] = property2; if (property2.name.match(/pie-(\d+)-background-size/) && property2.value) { this._private.hasPie = true; } if (property2.mapped) { - this[i3].mappedProperties.push(property2); + this[i2].mappedProperties.push(property2); } - var currentSelectorIsCore = !this[i3].selector; + var currentSelectorIsCore = !this[i2].selector; if (currentSelectorIsCore) { this._private.coreStyle[property2.name] = property2; } } return this; }; - styfn.append = function(style) { - if (stylesheet(style)) { - style.appendToStyle(this); - } else if (array2(style)) { - this.appendFromJson(style); - } else if (string2(style)) { - this.appendFromString(style); + styfn.append = function(style3) { + if (stylesheet(style3)) { + style3.appendToStyle(this); + } else if (array2(style3)) { + this.appendFromJson(style3); + } else if (string(style3)) { + this.appendFromString(style3); } return this; }; - Style2.fromJson = function(cy, json2) { - var style = new Style2(cy); - style.fromJson(json2); - return style; + Style2.fromJson = function(cy, json3) { + var style3 = new Style2(cy); + style3.fromJson(json3); + return style3; }; Style2.fromString = function(cy, string3) { return new Style2(cy).fromString(string3); @@ -176364,59 +109285,59 @@ g.stateGroup line { Style2.propertyGroups = styfn.propertyGroups; Style2.propertyGroupNames = styfn.propertyGroupNames; Style2.propertyGroupKeys = styfn.propertyGroupKeys; - var corefn$2 = { - style: function style(newStyle) { + corefn$2 = { + style: /* @__PURE__ */ __name(function style2(newStyle) { if (newStyle) { - var s = this.setStyle(newStyle); - s.update(); + var s2 = this.setStyle(newStyle); + s2.update(); } return this._private.style; - }, - setStyle: function setStyle2(style) { + }, "style"), + setStyle: /* @__PURE__ */ __name(function setStyle2(style3) { var _p = this._private; - if (stylesheet(style)) { - _p.style = style.generateStyle(this); - } else if (array2(style)) { - _p.style = Style2.fromJson(this, style); - } else if (string2(style)) { - _p.style = Style2.fromString(this, style); + if (stylesheet(style3)) { + _p.style = style3.generateStyle(this); + } else if (array2(style3)) { + _p.style = Style2.fromJson(this, style3); + } else if (string(style3)) { + _p.style = Style2.fromString(this, style3); } else { _p.style = Style2(this); } return _p.style; - }, + }, "setStyle"), // e.g. cy.data() changed => recalc ele mappers - updateStyle: function updateStyle() { + updateStyle: /* @__PURE__ */ __name(function updateStyle2() { this.mutableElements().updateStyle(); - } + }, "updateStyle") }; - var defaultSelectionType = "single"; - var corefn$1 = { - autolock: function autolock(bool2) { + defaultSelectionType = "single"; + corefn$1 = { + autolock: /* @__PURE__ */ __name(function autolock(bool2) { if (bool2 !== void 0) { this._private.autolock = bool2 ? true : false; } else { return this._private.autolock; } return this; - }, - autoungrabify: function autoungrabify(bool2) { + }, "autolock"), + autoungrabify: /* @__PURE__ */ __name(function autoungrabify(bool2) { if (bool2 !== void 0) { this._private.autoungrabify = bool2 ? true : false; } else { return this._private.autoungrabify; } return this; - }, - autounselectify: function autounselectify(bool2) { + }, "autoungrabify"), + autounselectify: /* @__PURE__ */ __name(function autounselectify(bool2) { if (bool2 !== void 0) { this._private.autounselectify = bool2 ? true : false; } else { return this._private.autounselectify; } return this; - }, - selectionType: function selectionType(selType) { + }, "autounselectify"), + selectionType: /* @__PURE__ */ __name(function selectionType(selType) { var _p = this._private; if (_p.selectionType == null) { _p.selectionType = defaultSelectionType; @@ -176429,56 +109350,56 @@ g.stateGroup line { return _p.selectionType; } return this; - }, - panningEnabled: function panningEnabled(bool2) { + }, "selectionType"), + panningEnabled: /* @__PURE__ */ __name(function panningEnabled(bool2) { if (bool2 !== void 0) { this._private.panningEnabled = bool2 ? true : false; } else { return this._private.panningEnabled; } return this; - }, - userPanningEnabled: function userPanningEnabled(bool2) { + }, "panningEnabled"), + userPanningEnabled: /* @__PURE__ */ __name(function userPanningEnabled(bool2) { if (bool2 !== void 0) { this._private.userPanningEnabled = bool2 ? true : false; } else { return this._private.userPanningEnabled; } return this; - }, - zoomingEnabled: function zoomingEnabled(bool2) { + }, "userPanningEnabled"), + zoomingEnabled: /* @__PURE__ */ __name(function zoomingEnabled(bool2) { if (bool2 !== void 0) { this._private.zoomingEnabled = bool2 ? true : false; } else { return this._private.zoomingEnabled; } return this; - }, - userZoomingEnabled: function userZoomingEnabled(bool2) { + }, "zoomingEnabled"), + userZoomingEnabled: /* @__PURE__ */ __name(function userZoomingEnabled(bool2) { if (bool2 !== void 0) { this._private.userZoomingEnabled = bool2 ? true : false; } else { return this._private.userZoomingEnabled; } return this; - }, - boxSelectionEnabled: function boxSelectionEnabled(bool2) { + }, "userZoomingEnabled"), + boxSelectionEnabled: /* @__PURE__ */ __name(function boxSelectionEnabled(bool2) { if (bool2 !== void 0) { this._private.boxSelectionEnabled = bool2 ? true : false; } else { return this._private.boxSelectionEnabled; } return this; - }, - pan: function pan() { + }, "boxSelectionEnabled"), + pan: /* @__PURE__ */ __name(function pan() { var args = arguments; var pan2 = this._private.pan; - var dim, val, dims, x2, y2; + var dim, val, dims, x5, y5; switch (args.length) { case 0: return pan2; case 1: - if (string2(args[0])) { + if (string(args[0])) { dim = args[0]; return pan2[dim]; } else if (plainObject(args[0])) { @@ -176486,13 +109407,13 @@ g.stateGroup line { return this; } dims = args[0]; - x2 = dims.x; - y2 = dims.y; - if (number$12(x2)) { - pan2.x = x2; + x5 = dims.x; + y5 = dims.y; + if (number$1(x5)) { + pan2.x = x5; } - if (number$12(y2)) { - pan2.y = y2; + if (number$1(y5)) { + pan2.y = y5; } this.emit("pan viewport"); } @@ -176503,7 +109424,7 @@ g.stateGroup line { } dim = args[0]; val = args[1]; - if ((dim === "x" || dim === "y") && number$12(val)) { + if ((dim === "x" || dim === "y") && number$1(val)) { pan2[dim] = val; } this.emit("pan viewport"); @@ -176511,11 +109432,11 @@ g.stateGroup line { } this.notify("viewport"); return this; - }, - panBy: function panBy(arg0, arg1) { + }, "pan"), + panBy: /* @__PURE__ */ __name(function panBy(arg0, arg1) { var args = arguments; - var pan = this._private.pan; - var dim, val, dims, x2, y2; + var pan2 = this._private.pan; + var dim, val, dims, x5, y5; if (!this._private.panningEnabled) { return this; } @@ -176523,13 +109444,13 @@ g.stateGroup line { case 1: if (plainObject(arg0)) { dims = args[0]; - x2 = dims.x; - y2 = dims.y; - if (number$12(x2)) { - pan.x += x2; + x5 = dims.x; + y5 = dims.y; + if (number$1(x5)) { + pan2.x += x5; } - if (number$12(y2)) { - pan.y += y2; + if (number$1(y5)) { + pan2.y += y5; } this.emit("pan viewport"); } @@ -176537,17 +109458,17 @@ g.stateGroup line { case 2: dim = arg0; val = arg1; - if ((dim === "x" || dim === "y") && number$12(val)) { - pan[dim] += val; + if ((dim === "x" || dim === "y") && number$1(val)) { + pan2[dim] += val; } this.emit("pan viewport"); break; } this.notify("viewport"); return this; - }, - fit: function fit(elements2, padding2) { - var viewportState = this.getFitViewport(elements2, padding2); + }, "panBy"), + fit: /* @__PURE__ */ __name(function fit(elements3, padding3) { + var viewportState = this.getFitViewport(elements3, padding3); if (viewportState) { var _p = this._private; _p.zoom = viewportState.zoom; @@ -176556,21 +109477,21 @@ g.stateGroup line { this.notify("viewport"); } return this; - }, - getFitViewport: function getFitViewport(elements2, padding2) { - if (number$12(elements2) && padding2 === void 0) { - padding2 = elements2; - elements2 = void 0; + }, "fit"), + getFitViewport: /* @__PURE__ */ __name(function getFitViewport(elements3, padding3) { + if (number$1(elements3) && padding3 === void 0) { + padding3 = elements3; + elements3 = void 0; } if (!this._private.panningEnabled || !this._private.zoomingEnabled) { return; } var bb; - if (string2(elements2)) { - var sel = elements2; - elements2 = this.$(sel); - } else if (boundingBox(elements2)) { - var bbe = elements2; + if (string(elements3)) { + var sel = elements3; + elements3 = this.$(sel); + } else if (boundingBox(elements3)) { + var bbe = elements3; bb = { x1: bbe.x1, y1: bbe.y1, @@ -176579,82 +109500,82 @@ g.stateGroup line { }; bb.w = bb.x2 - bb.x1; bb.h = bb.y2 - bb.y1; - } else if (!elementOrCollection(elements2)) { - elements2 = this.mutableElements(); + } else if (!elementOrCollection(elements3)) { + elements3 = this.mutableElements(); } - if (elementOrCollection(elements2) && elements2.empty()) { + if (elementOrCollection(elements3) && elements3.empty()) { return; } - bb = bb || elements2.boundingBox(); - var w2 = this.width(); - var h = this.height(); - var zoom; - padding2 = number$12(padding2) ? padding2 : 0; - if (!isNaN(w2) && !isNaN(h) && w2 > 0 && h > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) { - zoom = Math.min((w2 - 2 * padding2) / bb.w, (h - 2 * padding2) / bb.h); - zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom; - zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom; - var pan = { + bb = bb || elements3.boundingBox(); + var w3 = this.width(); + var h2 = this.height(); + var zoom2; + padding3 = number$1(padding3) ? padding3 : 0; + if (!isNaN(w3) && !isNaN(h2) && w3 > 0 && h2 > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) { + zoom2 = Math.min((w3 - 2 * padding3) / bb.w, (h2 - 2 * padding3) / bb.h); + zoom2 = zoom2 > this._private.maxZoom ? this._private.maxZoom : zoom2; + zoom2 = zoom2 < this._private.minZoom ? this._private.minZoom : zoom2; + var pan2 = { // now pan to middle - x: (w2 - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 + x: (w3 - zoom2 * (bb.x1 + bb.x2)) / 2, + y: (h2 - zoom2 * (bb.y1 + bb.y2)) / 2 }; return { - zoom, - pan + zoom: zoom2, + pan: pan2 }; } return; - }, - zoomRange: function zoomRange(min3, max3) { + }, "getFitViewport"), + zoomRange: /* @__PURE__ */ __name(function zoomRange(min9, max10) { var _p = this._private; - if (max3 == null) { - var opts = min3; - min3 = opts.min; - max3 = opts.max; - } - if (number$12(min3) && number$12(max3) && min3 <= max3) { - _p.minZoom = min3; - _p.maxZoom = max3; - } else if (number$12(min3) && max3 === void 0 && min3 <= _p.maxZoom) { - _p.minZoom = min3; - } else if (number$12(max3) && min3 === void 0 && max3 >= _p.minZoom) { - _p.maxZoom = max3; + if (max10 == null) { + var opts = min9; + min9 = opts.min; + max10 = opts.max; + } + if (number$1(min9) && number$1(max10) && min9 <= max10) { + _p.minZoom = min9; + _p.maxZoom = max10; + } else if (number$1(min9) && max10 === void 0 && min9 <= _p.maxZoom) { + _p.minZoom = min9; + } else if (number$1(max10) && min9 === void 0 && max10 >= _p.minZoom) { + _p.maxZoom = max10; } return this; - }, - minZoom: function minZoom(zoom) { - if (zoom === void 0) { + }, "zoomRange"), + minZoom: /* @__PURE__ */ __name(function minZoom(zoom2) { + if (zoom2 === void 0) { return this._private.minZoom; } else { return this.zoomRange({ - min: zoom + min: zoom2 }); } - }, - maxZoom: function maxZoom2(zoom) { - if (zoom === void 0) { + }, "minZoom"), + maxZoom: /* @__PURE__ */ __name(function maxZoom(zoom2) { + if (zoom2 === void 0) { return this._private.maxZoom; } else { return this.zoomRange({ - max: zoom + max: zoom2 }); } - }, - getZoomedViewport: function getZoomedViewport(params) { + }, "maxZoom"), + getZoomedViewport: /* @__PURE__ */ __name(function getZoomedViewport(params) { var _p = this._private; var currentPan = _p.pan; var currentZoom = _p.zoom; var pos; - var zoom; + var zoom2; var bail = false; if (!_p.zoomingEnabled) { bail = true; } - if (number$12(params)) { - zoom = params; + if (number$1(params)) { + zoom2 = params; } else if (plainObject(params)) { - zoom = params.level; + zoom2 = params.level; if (params.position != null) { pos = modelToRenderedPosition(params.position, currentZoom, currentPan); } else if (params.renderedPosition != null) { @@ -176664,35 +109585,35 @@ g.stateGroup line { bail = true; } } - zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom; - zoom = zoom < _p.minZoom ? _p.minZoom : zoom; - if (bail || !number$12(zoom) || zoom === currentZoom || pos != null && (!number$12(pos.x) || !number$12(pos.y))) { + zoom2 = zoom2 > _p.maxZoom ? _p.maxZoom : zoom2; + zoom2 = zoom2 < _p.minZoom ? _p.minZoom : zoom2; + if (bail || !number$1(zoom2) || zoom2 === currentZoom || pos != null && (!number$1(pos.x) || !number$1(pos.y))) { return null; } if (pos != null) { var pan1 = currentPan; var zoom1 = currentZoom; - var zoom2 = zoom; + var zoom22 = zoom2; var pan2 = { - x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, - y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y + x: -zoom22 / zoom1 * (pos.x - pan1.x) + pos.x, + y: -zoom22 / zoom1 * (pos.y - pan1.y) + pos.y }; return { zoomed: true, panned: true, - zoom: zoom2, + zoom: zoom22, pan: pan2 }; } else { return { zoomed: true, panned: false, - zoom, + zoom: zoom2, pan: currentPan }; } - }, - zoom: function zoom(params) { + }, "getZoomedViewport"), + zoom: /* @__PURE__ */ __name(function zoom(params) { if (params === void 0) { return this._private.zoom; } else { @@ -176710,8 +109631,8 @@ g.stateGroup line { this.notify("viewport"); return this; } - }, - viewport: function viewport(opts) { + }, "zoom"), + viewport: /* @__PURE__ */ __name(function viewport(opts) { var _p = this._private; var zoomDefd = true; var panDefd = true; @@ -176721,7 +109642,7 @@ g.stateGroup line { if (!opts) { return this; } - if (!number$12(opts.zoom)) { + if (!number$1(opts.zoom)) { zoomDefd = false; } if (!plainObject(opts.pan)) { @@ -176731,22 +109652,22 @@ g.stateGroup line { return this; } if (zoomDefd) { - var z = opts.zoom; - if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) { + var z2 = opts.zoom; + if (z2 < _p.minZoom || z2 > _p.maxZoom || !_p.zoomingEnabled) { zoomFailed = true; } else { - _p.zoom = z; + _p.zoom = z2; events.push("zoom"); } } if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) { - var p2 = opts.pan; - if (number$12(p2.x)) { - _p.pan.x = p2.x; + var p3 = opts.pan; + if (number$1(p3.x)) { + _p.pan.x = p3.x; panFailed = false; } - if (number$12(p2.y)) { - _p.pan.y = p2.y; + if (number$1(p3.y)) { + _p.pan.y = p3.y; panFailed = false; } if (!panFailed) { @@ -176759,41 +109680,41 @@ g.stateGroup line { this.notify("viewport"); } return this; - }, - center: function center2(elements2) { - var pan = this.getCenterPan(elements2); - if (pan) { - this._private.pan = pan; + }, "viewport"), + center: /* @__PURE__ */ __name(function center2(elements3) { + var pan2 = this.getCenterPan(elements3); + if (pan2) { + this._private.pan = pan2; this.emit("pan viewport"); this.notify("viewport"); } return this; - }, - getCenterPan: function getCenterPan(elements2, zoom) { + }, "center"), + getCenterPan: /* @__PURE__ */ __name(function getCenterPan(elements3, zoom2) { if (!this._private.panningEnabled) { return; } - if (string2(elements2)) { - var selector2 = elements2; - elements2 = this.mutableElements().filter(selector2); - } else if (!elementOrCollection(elements2)) { - elements2 = this.mutableElements(); + if (string(elements3)) { + var selector = elements3; + elements3 = this.mutableElements().filter(selector); + } else if (!elementOrCollection(elements3)) { + elements3 = this.mutableElements(); } - if (elements2.length === 0) { + if (elements3.length === 0) { return; } - var bb = elements2.boundingBox(); - var w2 = this.width(); - var h = this.height(); - zoom = zoom === void 0 ? this._private.zoom : zoom; - var pan = { + var bb = elements3.boundingBox(); + var w3 = this.width(); + var h2 = this.height(); + zoom2 = zoom2 === void 0 ? this._private.zoom : zoom2; + var pan2 = { // middle - x: (w2 - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 + x: (w3 - zoom2 * (bb.x1 + bb.x2)) / 2, + y: (h2 - zoom2 * (bb.y1 + bb.y2)) / 2 }; - return pan; - }, - reset: function reset2() { + return pan2; + }, "getCenterPan"), + reset: /* @__PURE__ */ __name(function reset3() { if (!this._private.panningEnabled || !this._private.zoomingEnabled) { return this; } @@ -176805,74 +109726,72 @@ g.stateGroup line { zoom: 1 }); return this; - }, - invalidateSize: function invalidateSize() { + }, "reset"), + invalidateSize: /* @__PURE__ */ __name(function invalidateSize() { this._private.sizeCache = null; - }, - size: function size2() { + }, "invalidateSize"), + size: /* @__PURE__ */ __name(function size4() { var _p = this._private; - var container = _p.container; + var container2 = _p.container; var cy = this; - return _p.sizeCache = _p.sizeCache || (container ? function() { - var style = cy.window().getComputedStyle(container); - var val = function val2(name) { - return parseFloat(style.getPropertyValue(name)); - }; + return _p.sizeCache = _p.sizeCache || (container2 ? function() { + var style3 = cy.window().getComputedStyle(container2); + var val = /* @__PURE__ */ __name(function val2(name) { + return parseFloat(style3.getPropertyValue(name)); + }, "val"); return { - width: container.clientWidth - val("padding-left") - val("padding-right"), - height: container.clientHeight - val("padding-top") - val("padding-bottom") + width: container2.clientWidth - val("padding-left") - val("padding-right"), + height: container2.clientHeight - val("padding-top") - val("padding-bottom") }; }() : { // fallback if no container (not 0 b/c can be used for dividing etc) width: 1, height: 1 }); - }, - width: function width2() { + }, "size"), + width: /* @__PURE__ */ __name(function width2() { return this.size().width; - }, - height: function height() { + }, "width"), + height: /* @__PURE__ */ __name(function height() { return this.size().height; - }, - extent: function extent() { - var pan = this._private.pan; - var zoom = this._private.zoom; + }, "height"), + extent: /* @__PURE__ */ __name(function extent() { + var pan2 = this._private.pan; + var zoom2 = this._private.zoom; var rb = this.renderedExtent(); - var b = { - x1: (rb.x1 - pan.x) / zoom, - x2: (rb.x2 - pan.x) / zoom, - y1: (rb.y1 - pan.y) / zoom, - y2: (rb.y2 - pan.y) / zoom + var b2 = { + x1: (rb.x1 - pan2.x) / zoom2, + x2: (rb.x2 - pan2.x) / zoom2, + y1: (rb.y1 - pan2.y) / zoom2, + y2: (rb.y2 - pan2.y) / zoom2 }; - b.w = b.x2 - b.x1; - b.h = b.y2 - b.y1; - return b; - }, - renderedExtent: function renderedExtent() { - var width2 = this.width(); - var height = this.height(); + b2.w = b2.x2 - b2.x1; + b2.h = b2.y2 - b2.y1; + return b2; + }, "extent"), + renderedExtent: /* @__PURE__ */ __name(function renderedExtent() { + var width3 = this.width(); + var height2 = this.height(); return { x1: 0, y1: 0, - x2: width2, - y2: height, - w: width2, - h: height + x2: width3, + y2: height2, + w: width3, + h: height2 }; - }, - multiClickDebounceTime: function multiClickDebounceTime(_int) { - if (_int) - this._private.multiClickDebounceTime = _int; - else - return this._private.multiClickDebounceTime; + }, "renderedExtent"), + multiClickDebounceTime: /* @__PURE__ */ __name(function multiClickDebounceTime(_int) { + if (_int) this._private.multiClickDebounceTime = _int; + else return this._private.multiClickDebounceTime; return this; - } + }, "multiClickDebounceTime") }; corefn$1.centre = corefn$1.center; corefn$1.autolockNodes = corefn$1.autolock; corefn$1.autoungrabifyNodes = corefn$1.autoungrabify; - var fn = { - data: define3.data({ + fn2 = { + data: define2.data({ field: "data", bindingEvent: "data", allowBinding: true, @@ -176883,14 +109802,14 @@ g.stateGroup line { allowGetting: true, updateStyle: true }), - removeData: define3.removeData({ + removeData: define2.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }), - scratch: define3.data({ + scratch: define2.data({ field: "scratch", bindingEvent: "scratch", allowBinding: true, @@ -176901,7 +109820,7 @@ g.stateGroup line { allowGetting: true, updateStyle: true }), - removeScratch: define3.removeData({ + removeScratch: define2.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", @@ -176909,49 +109828,49 @@ g.stateGroup line { updateStyle: true }) }; - fn.attr = fn.data; - fn.removeAttr = fn.removeData; - var Core = function Core2(opts) { + fn2.attr = fn2.data; + fn2.removeAttr = fn2.removeData; + Core = /* @__PURE__ */ __name(function Core2(opts) { var cy = this; opts = extend2({}, opts); - var container = opts.container; - if (container && !htmlElement(container) && htmlElement(container[0])) { - container = container[0]; + var container2 = opts.container; + if (container2 && !htmlElement(container2) && htmlElement(container2[0])) { + container2 = container2[0]; } - var reg = container ? container._cyreg : null; + var reg = container2 ? container2._cyreg : null; reg = reg || {}; if (reg && reg.cy) { reg.cy.destroy(); reg = {}; } var readies = reg.readies = reg.readies || []; - if (container) { - container._cyreg = reg; + if (container2) { + container2._cyreg = reg; } reg.cy = cy; - var head2 = _window !== void 0 && container !== void 0 && !opts.headless; - var options2 = opts; - options2.layout = extend2({ + var head2 = _window !== void 0 && container2 !== void 0 && !opts.headless; + var options3 = opts; + options3.layout = extend2({ name: head2 ? "grid" : "null" - }, options2.layout); - options2.renderer = extend2({ + }, options3.layout); + options3.renderer = extend2({ name: head2 ? "canvas" : "null" - }, options2.renderer); - var defVal = function defVal2(def, val, altVal) { + }, options3.renderer); + var defVal = /* @__PURE__ */ __name(function defVal2(def2, val, altVal) { if (val !== void 0) { return val; } else if (altVal !== void 0) { return altVal; } else { - return def; + return def2; } - }; + }, "defVal"); var _p = this._private = { - container, + container: container2, // html dom ele container ready: false, // whether ready has been triggered - options: options2, + options: options3, // cached options elements: new Collection(this), // elements in the graph @@ -176959,7 +109878,7 @@ g.stateGroup line { // list of listeners aniEles: new Collection(this), // elements being animated - data: options2.data || {}, + data: options3.data || {}, // data for the core scratch: {}, // scratch object for core @@ -176971,19 +109890,19 @@ g.stateGroup line { // whether notifications are sent to the renderer minZoom: 1e-50, maxZoom: 1e50, - zoomingEnabled: defVal(true, options2.zoomingEnabled), - userZoomingEnabled: defVal(true, options2.userZoomingEnabled), - panningEnabled: defVal(true, options2.panningEnabled), - userPanningEnabled: defVal(true, options2.userPanningEnabled), - boxSelectionEnabled: defVal(true, options2.boxSelectionEnabled), - autolock: defVal(false, options2.autolock, options2.autolockNodes), - autoungrabify: defVal(false, options2.autoungrabify, options2.autoungrabifyNodes), - autounselectify: defVal(false, options2.autounselectify), - styleEnabled: options2.styleEnabled === void 0 ? head2 : options2.styleEnabled, - zoom: number$12(options2.zoom) ? options2.zoom : 1, + zoomingEnabled: defVal(true, options3.zoomingEnabled), + userZoomingEnabled: defVal(true, options3.userZoomingEnabled), + panningEnabled: defVal(true, options3.panningEnabled), + userPanningEnabled: defVal(true, options3.userPanningEnabled), + boxSelectionEnabled: defVal(true, options3.boxSelectionEnabled), + autolock: defVal(false, options3.autolock, options3.autolockNodes), + autoungrabify: defVal(false, options3.autoungrabify, options3.autoungrabifyNodes), + autounselectify: defVal(false, options3.autounselectify), + styleEnabled: options3.styleEnabled === void 0 ? head2 : options3.styleEnabled, + zoom: number$1(options3.zoom) ? options3.zoom : 1, pan: { - x: plainObject(options2.pan) && number$12(options2.pan.x) ? options2.pan.x : 0, - y: plainObject(options2.pan) && number$12(options2.pan.y) ? options2.pan.y : 0 + x: plainObject(options3.pan) && number$1(options3.pan.x) ? options3.pan.x : 0, + y: plainObject(options3.pan) && number$1(options3.pan.y) ? options3.pan.y : 0 }, animation: { // object for currently-running animations @@ -176991,41 +109910,41 @@ g.stateGroup line { queue: [] }, hasCompoundNodes: false, - multiClickDebounceTime: defVal(250, options2.multiClickDebounceTime) + multiClickDebounceTime: defVal(250, options3.multiClickDebounceTime) }; this.createEmitter(); - this.selectionType(options2.selectionType); + this.selectionType(options3.selectionType); this.zoomRange({ - min: options2.minZoom, - max: options2.maxZoom + min: options3.minZoom, + max: options3.maxZoom }); - var loadExtData = function loadExtData2(extData, next2) { + var loadExtData = /* @__PURE__ */ __name(function loadExtData2(extData, next3) { var anyIsPromise = extData.some(promise); if (anyIsPromise) { - return Promise$12.all(extData).then(next2); + return Promise$1.all(extData).then(next3); } else { - next2(extData); + next3(extData); } - }; + }, "loadExtData"); if (_p.styleEnabled) { cy.setStyle([]); } - var rendererOptions = extend2({}, options2, options2.renderer); + var rendererOptions = extend2({}, options3, options3.renderer); cy.initRenderer(rendererOptions); - var setElesAndLayout = function setElesAndLayout2(elements2, onload, ondone) { + var setElesAndLayout = /* @__PURE__ */ __name(function setElesAndLayout2(elements3, onload, ondone) { cy.notifications(false); var oldEles = cy.mutableElements(); if (oldEles.length > 0) { oldEles.remove(); } - if (elements2 != null) { - if (plainObject(elements2) || array2(elements2)) { - cy.add(elements2); + if (elements3 != null) { + if (plainObject(elements3) || array2(elements3)) { + cy.add(elements3); } } - cy.one("layoutready", function(e) { + cy.one("layoutready", function(e3) { cy.notifications(true); - cy.emit(e); + cy.emit(e3); cy.one("load", onload); cy.emitAndNotify("load"); }).one("layoutstop", function() { @@ -177035,8 +109954,8 @@ g.stateGroup line { var layoutOpts = extend2({}, cy._private.options.layout); layoutOpts.eles = cy.elements(); cy.layout(layoutOpts).run(); - }; - loadExtData([options2.style, options2.elements], function(thens) { + }, "setElesAndLayout"); + loadExtData([options3.style, options3.elements], function(thens) { var initStyle = thens[0]; var initEles = thens[1]; if (_p.styleEnabled) { @@ -177045,110 +109964,108 @@ g.stateGroup line { setElesAndLayout(initEles, function() { cy.startAnimationLoop(); _p.ready = true; - if (fn$6(options2.ready)) { - cy.on("ready", options2.ready); + if (fn$6(options3.ready)) { + cy.on("ready", options3.ready); } - for (var i3 = 0; i3 < readies.length; i3++) { - var fn2 = readies[i3]; - cy.on("ready", fn2); + for (var i2 = 0; i2 < readies.length; i2++) { + var fn3 = readies[i2]; + cy.on("ready", fn3); } if (reg) { reg.readies = []; } cy.emit("ready"); - }, options2.done); + }, options3.done); }); - }; - var corefn = Core.prototype; + }, "Core"); + corefn = Core.prototype; extend2(corefn, { - instanceString: function instanceString() { + instanceString: /* @__PURE__ */ __name(function instanceString3() { return "core"; - }, - isReady: function isReady() { + }, "instanceString"), + isReady: /* @__PURE__ */ __name(function isReady() { return this._private.ready; - }, - destroyed: function destroyed() { + }, "isReady"), + destroyed: /* @__PURE__ */ __name(function destroyed() { return this._private.destroyed; - }, - ready: function ready(fn2) { + }, "destroyed"), + ready: /* @__PURE__ */ __name(function ready(fn3) { if (this.isReady()) { - this.emitter().emit("ready", [], fn2); + this.emitter().emit("ready", [], fn3); } else { - this.on("ready", fn2); + this.on("ready", fn3); } return this; - }, - destroy: function destroy() { + }, "ready"), + destroy: /* @__PURE__ */ __name(function destroy() { var cy = this; - if (cy.destroyed()) - return; + if (cy.destroyed()) return; cy.stopAnimationLoop(); cy.destroyRenderer(); this.emit("destroy"); cy._private.destroyed = true; return cy; - }, - hasElementWithId: function hasElementWithId(id2) { - return this._private.elements.hasElementWithId(id2); - }, - getElementById: function getElementById2(id2) { - return this._private.elements.getElementById(id2); - }, - hasCompoundNodes: function hasCompoundNodes() { + }, "destroy"), + hasElementWithId: /* @__PURE__ */ __name(function hasElementWithId(id26) { + return this._private.elements.hasElementWithId(id26); + }, "hasElementWithId"), + getElementById: /* @__PURE__ */ __name(function getElementById2(id26) { + return this._private.elements.getElementById(id26); + }, "getElementById"), + hasCompoundNodes: /* @__PURE__ */ __name(function hasCompoundNodes() { return this._private.hasCompoundNodes; - }, - headless: function headless() { + }, "hasCompoundNodes"), + headless: /* @__PURE__ */ __name(function headless() { return this._private.renderer.isHeadless(); - }, - styleEnabled: function styleEnabled() { + }, "headless"), + styleEnabled: /* @__PURE__ */ __name(function styleEnabled() { return this._private.styleEnabled; - }, - addToPool: function addToPool(eles) { + }, "styleEnabled"), + addToPool: /* @__PURE__ */ __name(function addToPool(eles) { this._private.elements.merge(eles); return this; - }, - removeFromPool: function removeFromPool(eles) { + }, "addToPool"), + removeFromPool: /* @__PURE__ */ __name(function removeFromPool(eles) { this._private.elements.unmerge(eles); return this; - }, - container: function container() { + }, "removeFromPool"), + container: /* @__PURE__ */ __name(function container() { return this._private.container || null; - }, - window: function window2() { - var container = this._private.container; - if (container == null) - return _window; + }, "container"), + window: /* @__PURE__ */ __name(function window2() { + var container2 = this._private.container; + if (container2 == null) return _window; var ownerDocument = this._private.container.ownerDocument; if (ownerDocument === void 0 || ownerDocument == null) { return _window; } return ownerDocument.defaultView || _window; - }, - mount: function mount(container) { - if (container == null) { + }, "window"), + mount: /* @__PURE__ */ __name(function mount(container2) { + if (container2 == null) { return; } var cy = this; var _p = cy._private; - var options2 = _p.options; - if (!htmlElement(container) && htmlElement(container[0])) { - container = container[0]; + var options3 = _p.options; + if (!htmlElement(container2) && htmlElement(container2[0])) { + container2 = container2[0]; } cy.stopAnimationLoop(); cy.destroyRenderer(); - _p.container = container; + _p.container = container2; _p.styleEnabled = true; cy.invalidateSize(); - cy.initRenderer(extend2({}, options2, options2.renderer, { + cy.initRenderer(extend2({}, options3, options3.renderer, { // allow custom renderer name to be re-used, otherwise use canvas - name: options2.renderer.name === "null" ? "canvas" : options2.renderer.name + name: options3.renderer.name === "null" ? "canvas" : options3.renderer.name })); cy.startAnimationLoop(); - cy.style(options2.style); + cy.style(options3.style); cy.emit("mount"); return cy; - }, - unmount: function unmount() { + }, "mount"), + unmount: /* @__PURE__ */ __name(function unmount() { var cy = this; cy.stopAnimationLoop(); cy.destroyRenderer(); @@ -177157,33 +110074,33 @@ g.stateGroup line { }); cy.emit("unmount"); return cy; - }, - options: function options2() { - return copy2(this._private.options); - }, - json: function json2(obj) { + }, "unmount"), + options: /* @__PURE__ */ __name(function options2() { + return copy4(this._private.options); + }, "options"), + json: /* @__PURE__ */ __name(function json(obj) { var cy = this; var _p = cy._private; var eles = cy.mutableElements(); - var getFreshRef = function getFreshRef2(ele) { + var getFreshRef = /* @__PURE__ */ __name(function getFreshRef2(ele) { return cy.getElementById(ele.id()); - }; + }, "getFreshRef"); if (plainObject(obj)) { cy.startBatch(); if (obj.elements) { var idInJson = {}; - var updateEles = function updateEles2(jsons, gr2) { + var updateEles = /* @__PURE__ */ __name(function updateEles2(jsons, gr2) { var toAdd = []; var toMod = []; - for (var i4 = 0; i4 < jsons.length; i4++) { - var json4 = jsons[i4]; + for (var i3 = 0; i3 < jsons.length; i3++) { + var json4 = jsons[i3]; if (!json4.data.id) { warn("cy.json() cannot handle elements without an ID attribute"); continue; } - var id2 = "" + json4.data.id; - var ele = cy.getElementById(id2); - idInJson[id2] = true; + var id26 = "" + json4.data.id; + var ele = cy.getElementById(id26); + idInJson[id26] = true; if (ele.length !== 0) { toMod.push({ ele, @@ -177199,20 +110116,20 @@ g.stateGroup line { } } cy.add(toAdd); - for (var _i6 = 0; _i6 < toMod.length; _i6++) { - var _toMod$_i = toMod[_i6], _ele = _toMod$_i.ele, _json = _toMod$_i.json; + for (var _i = 0; _i < toMod.length; _i++) { + var _toMod$_i = toMod[_i], _ele = _toMod$_i.ele, _json = _toMod$_i.json; _ele.json(_json); } - }; + }, "updateEles"); if (array2(obj.elements)) { updateEles(obj.elements); } else { var grs = ["nodes", "edges"]; - for (var i3 = 0; i3 < grs.length; i3++) { - var gr = grs[i3]; - var elements2 = obj.elements[gr]; - if (array2(elements2)) { - updateEles(elements2, gr); + for (var i2 = 0; i2 < grs.length; i2++) { + var gr = grs[i2]; + var elements3 = obj.elements[gr]; + if (array2(elements3)) { + updateEles(elements3, gr); } } } @@ -177250,10 +110167,10 @@ g.stateGroup line { cy.data(obj.data); } var fields = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"]; - for (var _i22 = 0; _i22 < fields.length; _i22++) { - var f2 = fields[_i22]; - if (obj[f2] != null) { - cy[f2](obj[f2]); + for (var _i2 = 0; _i2 < fields.length; _i2++) { + var f3 = fields[_i2]; + if (obj[f3] != null) { + cy[f3](obj[f3]); } } cy.endBatch(); @@ -177268,18 +110185,18 @@ g.stateGroup line { } else { json3.elements = {}; eles.forEach(function(ele) { - var group = ele.group(); - if (!json3.elements[group]) { - json3.elements[group] = []; + var group2 = ele.group(); + if (!json3.elements[group2]) { + json3.elements[group2] = []; } - json3.elements[group].push(ele.json()); + json3.elements[group2].push(ele.json()); }); } if (this._private.styleEnabled) { json3.style = cy.style().json(); } - json3.data = copy2(cy.data()); - var options2 = _p.options; + json3.data = copy4(cy.data()); + var options3 = _p.options; json3.zoomingEnabled = _p.zoomingEnabled; json3.userZoomingEnabled = _p.userZoomingEnabled; json3.zoom = _p.zoom; @@ -177287,23 +110204,23 @@ g.stateGroup line { json3.maxZoom = _p.maxZoom; json3.panningEnabled = _p.panningEnabled; json3.userPanningEnabled = _p.userPanningEnabled; - json3.pan = copy2(_p.pan); + json3.pan = copy4(_p.pan); json3.boxSelectionEnabled = _p.boxSelectionEnabled; - json3.renderer = copy2(options2.renderer); - json3.hideEdgesOnViewport = options2.hideEdgesOnViewport; - json3.textureOnViewport = options2.textureOnViewport; - json3.wheelSensitivity = options2.wheelSensitivity; - json3.motionBlur = options2.motionBlur; - json3.multiClickDebounceTime = options2.multiClickDebounceTime; + json3.renderer = copy4(options3.renderer); + json3.hideEdgesOnViewport = options3.hideEdgesOnViewport; + json3.textureOnViewport = options3.textureOnViewport; + json3.wheelSensitivity = options3.wheelSensitivity; + json3.motionBlur = options3.motionBlur; + json3.multiClickDebounceTime = options3.multiClickDebounceTime; return json3; } - } + }, "json") }); corefn.$id = corefn.getElementById; - [corefn$9, corefn$8, elesfn, corefn$7, corefn$6, corefn$5, corefn$4, corefn$3, corefn$2, corefn$1, fn].forEach(function(props) { + [corefn$9, corefn$8, elesfn, corefn$7, corefn$6, corefn$5, corefn$4, corefn$3, corefn$2, corefn$1, fn2].forEach(function(props) { extend2(corefn, props); }); - var defaults$7 = { + defaults$7 = { fit: true, // whether to fit the viewport to the graph directed: false, @@ -177332,176 +110249,174 @@ g.stateGroup line { // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled, - animateFilter: function animateFilter(node2, i3) { + animateFilter: /* @__PURE__ */ __name(function animateFilter(node2, i2) { return true; - }, + }, "animateFilter"), // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop - transform: function transform(node2, position3) { - return position3; - } + transform: /* @__PURE__ */ __name(function transform2(node2, position5) { + return position5; + }, "transform") // transform a given node position. Useful for changing flow direction in discrete layouts }; - var deprecatedOptionDefaults = { + deprecatedOptionDefaults = { maximal: false, // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also acyclic: false // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops }; - var getInfo2 = function getInfo3(ele) { + getInfo = /* @__PURE__ */ __name(function getInfo2(ele) { return ele.scratch("breadthfirst"); - }; - var setInfo2 = function setInfo3(ele, obj) { + }, "getInfo"); + setInfo = /* @__PURE__ */ __name(function setInfo2(ele, obj) { return ele.scratch("breadthfirst", obj); - }; - function BreadthFirstLayout(options2) { - this.options = extend2({}, defaults$7, deprecatedOptionDefaults, options2); - } + }, "setInfo"); + __name(BreadthFirstLayout, "BreadthFirstLayout"); BreadthFirstLayout.prototype.run = function() { var params = this.options; - var options2 = params; + var options3 = params; var cy = params.cy; - var eles = options2.eles; - var nodes2 = eles.nodes().filter(function(n2) { - return !n2.isParent(); + var eles = options3.eles; + var nodes6 = eles.nodes().filter(function(n3) { + return !n3.isParent(); }); var graph = eles; - var directed = options2.directed; - var maximal = options2.acyclic || options2.maximal || options2.maximalAdjustments > 0; - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { + var directed = options3.directed; + var maximal = options3.acyclic || options3.maximal || options3.maximalAdjustments > 0; + var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : { x1: 0, y1: 0, w: cy.width(), h: cy.height() }); var roots; - if (elementOrCollection(options2.roots)) { - roots = options2.roots; - } else if (array2(options2.roots)) { + if (elementOrCollection(options3.roots)) { + roots = options3.roots; + } else if (array2(options3.roots)) { var rootsArray = []; - for (var i3 = 0; i3 < options2.roots.length; i3++) { - var id2 = options2.roots[i3]; - var ele = cy.getElementById(id2); + for (var i2 = 0; i2 < options3.roots.length; i2++) { + var id26 = options3.roots[i2]; + var ele = cy.getElementById(id26); rootsArray.push(ele); } roots = cy.collection(rootsArray); - } else if (string2(options2.roots)) { - roots = cy.$(options2.roots); + } else if (string(options3.roots)) { + roots = cy.$(options3.roots); } else { if (directed) { - roots = nodes2.roots(); + roots = nodes6.roots(); } else { - var components = eles.components(); + var components3 = eles.components(); roots = cy.collection(); - var _loop = function _loop2(_i9) { - var comp = components[_i9]; + var _loop = /* @__PURE__ */ __name(function _loop2(_i3) { + var comp = components3[_i3]; var maxDegree = comp.maxDegree(false); var compRoots = comp.filter(function(ele2) { return ele2.degree(false) === maxDegree; }); roots = roots.add(compRoots); - }; - for (var _i6 = 0; _i6 < components.length; _i6++) { - _loop(_i6); + }, "_loop"); + for (var _i = 0; _i < components3.length; _i++) { + _loop(_i); } } } var depths = []; var foundByBfs = {}; - var addToDepth = function addToDepth2(ele2, d) { - if (depths[d] == null) { - depths[d] = []; - } - var i4 = depths[d].length; - depths[d].push(ele2); - setInfo2(ele2, { - index: i4, - depth: d + var addToDepth = /* @__PURE__ */ __name(function addToDepth2(ele2, d2) { + if (depths[d2] == null) { + depths[d2] = []; + } + var i3 = depths[d2].length; + depths[d2].push(ele2); + setInfo(ele2, { + index: i3, + depth: d2 }); - }; - var changeDepth = function changeDepth2(ele2, newDepth) { - var _getInfo = getInfo2(ele2), depth = _getInfo.depth, index2 = _getInfo.index; - depths[depth][index2] = null; + }, "addToDepth"); + var changeDepth = /* @__PURE__ */ __name(function changeDepth2(ele2, newDepth) { + var _getInfo = getInfo(ele2), depth = _getInfo.depth, index = _getInfo.index; + depths[depth][index] = null; addToDepth(ele2, newDepth); - }; + }, "changeDepth"); graph.bfs({ roots, - directed: options2.directed, - visit: function visit(node2, edge, pNode, i4, depth) { + directed: options3.directed, + visit: /* @__PURE__ */ __name(function visit(node2, edge, pNode, i3, depth) { var ele2 = node2[0]; - var id3 = ele2.id(); + var id27 = ele2.id(); addToDepth(ele2, depth); - foundByBfs[id3] = true; - } + foundByBfs[id27] = true; + }, "visit") }); var orphanNodes = []; - for (var _i22 = 0; _i22 < nodes2.length; _i22++) { - var _ele = nodes2[_i22]; + for (var _i2 = 0; _i2 < nodes6.length; _i2++) { + var _ele = nodes6[_i2]; if (foundByBfs[_ele.id()]) { continue; } else { orphanNodes.push(_ele); } } - var assignDepthsAt = function assignDepthsAt2(i4) { - var eles2 = depths[i4]; - for (var j = 0; j < eles2.length; j++) { - var _ele2 = eles2[j]; + var assignDepthsAt = /* @__PURE__ */ __name(function assignDepthsAt2(i3) { + var eles2 = depths[i3]; + for (var j2 = 0; j2 < eles2.length; j2++) { + var _ele2 = eles2[j2]; if (_ele2 == null) { - eles2.splice(j, 1); - j--; + eles2.splice(j2, 1); + j2--; continue; } - setInfo2(_ele2, { - depth: i4, - index: j + setInfo(_ele2, { + depth: i3, + index: j2 }); } - }; - var assignDepths = function assignDepths2() { - for (var _i32 = 0; _i32 < depths.length; _i32++) { - assignDepthsAt(_i32); + }, "assignDepthsAt"); + var assignDepths = /* @__PURE__ */ __name(function assignDepths2() { + for (var _i3 = 0; _i3 < depths.length; _i3++) { + assignDepthsAt(_i3); } - }; - var adjustMaximally = function adjustMaximally2(ele2, shifted2) { - var eInfo = getInfo2(ele2); + }, "assignDepths"); + var adjustMaximally = /* @__PURE__ */ __name(function adjustMaximally2(ele2, shifted2) { + var eInfo = getInfo(ele2); var incomers = ele2.incomers().filter(function(el) { return el.isNode() && eles.has(el); }); var maxDepth = -1; - var id3 = ele2.id(); - for (var k = 0; k < incomers.length; k++) { - var incmr = incomers[k]; - var iInfo = getInfo2(incmr); + var id27 = ele2.id(); + for (var k2 = 0; k2 < incomers.length; k2++) { + var incmr = incomers[k2]; + var iInfo = getInfo(incmr); maxDepth = Math.max(maxDepth, iInfo.depth); } if (eInfo.depth <= maxDepth) { - if (!options2.acyclic && shifted2[id3]) { + if (!options3.acyclic && shifted2[id27]) { return null; } var newDepth = maxDepth + 1; changeDepth(ele2, newDepth); - shifted2[id3] = newDepth; + shifted2[id27] = newDepth; return true; } return false; - }; + }, "adjustMaximally"); if (directed && maximal) { - var Q = []; + var Q2 = []; var shifted = {}; - var enqueue = function enqueue2(n2) { - return Q.push(n2); - }; - var dequeue = function dequeue2() { - return Q.shift(); - }; - nodes2.forEach(function(n2) { - return Q.push(n2); + var enqueue = /* @__PURE__ */ __name(function enqueue2(n3) { + return Q2.push(n3); + }, "enqueue"); + var dequeue = /* @__PURE__ */ __name(function dequeue2() { + return Q2.shift(); + }, "dequeue"); + nodes6.forEach(function(n3) { + return Q2.push(n3); }); - while (Q.length > 0) { + while (Q2.length > 0) { var _ele3 = dequeue(); var didShift = adjustMaximally(_ele3, shifted); if (didShift) { @@ -177516,41 +110431,41 @@ g.stateGroup line { } assignDepths(); var minDistance = 0; - if (options2.avoidOverlap) { - for (var _i42 = 0; _i42 < nodes2.length; _i42++) { - var n = nodes2[_i42]; - var nbb = n.layoutDimensions(options2); - var w2 = nbb.w; - var h = nbb.h; - minDistance = Math.max(minDistance, w2, h); + if (options3.avoidOverlap) { + for (var _i4 = 0; _i4 < nodes6.length; _i4++) { + var n2 = nodes6[_i4]; + var nbb = n2.layoutDimensions(options3); + var w3 = nbb.w; + var h2 = nbb.h; + minDistance = Math.max(minDistance, w3, h2); } } var cachedWeightedPercent = {}; - var getWeightedPercent = function getWeightedPercent2(ele2) { + var getWeightedPercent = /* @__PURE__ */ __name(function getWeightedPercent2(ele2) { if (cachedWeightedPercent[ele2.id()]) { return cachedWeightedPercent[ele2.id()]; } - var eleDepth = getInfo2(ele2).depth; + var eleDepth = getInfo(ele2).depth; var neighbors = ele2.neighborhood(); var percent = 0; var samples = 0; - for (var _i52 = 0; _i52 < neighbors.length; _i52++) { - var neighbor = neighbors[_i52]; - if (neighbor.isEdge() || neighbor.isParent() || !nodes2.has(neighbor)) { + for (var _i5 = 0; _i5 < neighbors.length; _i5++) { + var neighbor = neighbors[_i5]; + if (neighbor.isEdge() || neighbor.isParent() || !nodes6.has(neighbor)) { continue; } - var bf = getInfo2(neighbor); + var bf = getInfo(neighbor); if (bf == null) { continue; } - var index2 = bf.index; + var index = bf.index; var depth = bf.depth; - if (index2 == null || depth == null) { + if (index == null || depth == null) { continue; } var nDepth = depths[depth].length; if (depth < eleDepth) { - percent += index2 / nDepth; + percent += index / nDepth; samples++; } } @@ -177561,23 +110476,23 @@ g.stateGroup line { } cachedWeightedPercent[ele2.id()] = percent; return percent; - }; - var sortFn = function sortFn2(a, b) { - var apct = getWeightedPercent(a); - var bpct = getWeightedPercent(b); - var diff = apct - bpct; - if (diff === 0) { - return ascending2(a.id(), b.id()); + }, "getWeightedPercent"); + var sortFn = /* @__PURE__ */ __name(function sortFn2(a2, b2) { + var apct = getWeightedPercent(a2); + var bpct = getWeightedPercent(b2); + var diff2 = apct - bpct; + if (diff2 === 0) { + return ascending3(a2.id(), b2.id()); } else { - return diff; + return diff2; } - }; - if (options2.depthSort !== void 0) { - sortFn = options2.depthSort; + }, "sortFn"); + if (options3.depthSort !== void 0) { + sortFn = options3.depthSort; } - for (var _i62 = 0; _i62 < depths.length; _i62++) { - depths[_i62].sort(sortFn); - assignDepthsAt(_i62); + for (var _i6 = 0; _i6 < depths.length; _i6++) { + depths[_i6].sort(sortFn); + assignDepthsAt(_i6); } var orphanDepth = []; for (var _i7 = 0; _i7 < orphanNodes.length; _i7++) { @@ -177589,42 +110504,42 @@ g.stateGroup line { for (var _i8 = 0; _i8 < depths.length; _i8++) { biggestDepthSize = Math.max(depths[_i8].length, biggestDepthSize); } - var center2 = { + var center4 = { x: bb.x1 + bb.w / 2, y: bb.x1 + bb.h / 2 }; - var maxDepthSize = depths.reduce(function(max3, eles2) { - return Math.max(max3, eles2.length); + var maxDepthSize = depths.reduce(function(max10, eles2) { + return Math.max(max10, eles2.length); }, 0); - var getPosition = function getPosition2(ele2) { - var _getInfo2 = getInfo2(ele2), depth = _getInfo2.depth, index2 = _getInfo2.index; + var getPosition = /* @__PURE__ */ __name(function getPosition2(ele2) { + var _getInfo2 = getInfo(ele2), depth = _getInfo2.depth, index = _getInfo2.index; var depthSize = depths[depth].length; - var distanceX = Math.max(bb.w / ((options2.grid ? maxDepthSize : depthSize) + 1), minDistance); + var distanceX = Math.max(bb.w / ((options3.grid ? maxDepthSize : depthSize) + 1), minDistance); var distanceY = Math.max(bb.h / (depths.length + 1), minDistance); var radiusStepSize = Math.min(bb.w / 2 / depths.length, bb.h / 2 / depths.length); radiusStepSize = Math.max(radiusStepSize, minDistance); - if (!options2.circle) { + if (!options3.circle) { var epos = { - x: center2.x + (index2 + 1 - (depthSize + 1) / 2) * distanceX, + x: center4.x + (index + 1 - (depthSize + 1) / 2) * distanceX, y: (depth + 1) * distanceY }; return epos; } else { - var radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); - var theta = 2 * Math.PI / depths[depth].length * index2; + var radius2 = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); + var theta = 2 * Math.PI / depths[depth].length * index; if (depth === 0 && depths[0].length === 1) { - radius = 1; + radius2 = 1; } return { - x: center2.x + radius * Math.cos(theta), - y: center2.y + radius * Math.sin(theta) + x: center4.x + radius2 * Math.cos(theta), + y: center4.y + radius2 * Math.sin(theta) }; } - }; - eles.nodes().layoutPositions(this, options2, getPosition); + }, "getPosition"); + eles.nodes().layoutPositions(this, options3, getPosition); return this; }; - var defaults$6 = { + defaults$6 = { fit: true, // whether to fit the viewport to the graph padding: 30, @@ -177653,81 +110568,79 @@ g.stateGroup line { // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled - animateFilter: function animateFilter(node2, i3) { + animateFilter: /* @__PURE__ */ __name(function animateFilter2(node2, i2) { return true; - }, + }, "animateFilter"), // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop - transform: function transform(node2, position3) { - return position3; - } + transform: /* @__PURE__ */ __name(function transform3(node2, position5) { + return position5; + }, "transform") // transform a given node position. Useful for changing flow direction in discrete layouts }; - function CircleLayout(options2) { - this.options = extend2({}, defaults$6, options2); - } + __name(CircleLayout, "CircleLayout"); CircleLayout.prototype.run = function() { var params = this.options; - var options2 = params; + var options3 = params; var cy = params.cy; - var eles = options2.eles; - var clockwise = options2.counterclockwise !== void 0 ? !options2.counterclockwise : options2.clockwise; - var nodes2 = eles.nodes().not(":parent"); - if (options2.sort) { - nodes2 = nodes2.sort(options2.sort); + var eles = options3.eles; + var clockwise = options3.counterclockwise !== void 0 ? !options3.counterclockwise : options3.clockwise; + var nodes6 = eles.nodes().not(":parent"); + if (options3.sort) { + nodes6 = nodes6.sort(options3.sort); } - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { + var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : { x1: 0, y1: 0, w: cy.width(), h: cy.height() }); - var center2 = { + var center4 = { x: bb.x1 + bb.w / 2, y: bb.y1 + bb.h / 2 }; - var sweep = options2.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / nodes2.length : options2.sweep; - var dTheta = sweep / Math.max(1, nodes2.length - 1); - var r; + var sweep = options3.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / nodes6.length : options3.sweep; + var dTheta = sweep / Math.max(1, nodes6.length - 1); + var r2; var minDistance = 0; - for (var i3 = 0; i3 < nodes2.length; i3++) { - var n = nodes2[i3]; - var nbb = n.layoutDimensions(options2); - var w2 = nbb.w; - var h = nbb.h; - minDistance = Math.max(minDistance, w2, h); - } - if (number$12(options2.radius)) { - r = options2.radius; - } else if (nodes2.length <= 1) { - r = 0; + for (var i2 = 0; i2 < nodes6.length; i2++) { + var n2 = nodes6[i2]; + var nbb = n2.layoutDimensions(options3); + var w3 = nbb.w; + var h2 = nbb.h; + minDistance = Math.max(minDistance, w3, h2); + } + if (number$1(options3.radius)) { + r2 = options3.radius; + } else if (nodes6.length <= 1) { + r2 = 0; } else { - r = Math.min(bb.h, bb.w) / 2 - minDistance; + r2 = Math.min(bb.h, bb.w) / 2 - minDistance; } - if (nodes2.length > 1 && options2.avoidOverlap) { + if (nodes6.length > 1 && options3.avoidOverlap) { minDistance *= 1.75; var dcos = Math.cos(dTheta) - Math.cos(0); var dsin = Math.sin(dTheta) - Math.sin(0); var rMin = Math.sqrt(minDistance * minDistance / (dcos * dcos + dsin * dsin)); - r = Math.max(rMin, r); + r2 = Math.max(rMin, r2); } - var getPos = function getPos2(ele, i4) { - var theta = options2.startAngle + i4 * dTheta * (clockwise ? 1 : -1); - var rx = r * Math.cos(theta); - var ry = r * Math.sin(theta); + var getPos = /* @__PURE__ */ __name(function getPos2(ele, i3) { + var theta = options3.startAngle + i3 * dTheta * (clockwise ? 1 : -1); + var rx = r2 * Math.cos(theta); + var ry = r2 * Math.sin(theta); var pos = { - x: center2.x + rx, - y: center2.y + ry + x: center4.x + rx, + y: center4.y + ry }; return pos; - }; - eles.nodes().layoutPositions(this, options2, getPos); + }, "getPos"); + eles.nodes().layoutPositions(this, options3, getPos); return this; }; - var defaults$5 = { + defaults$5 = { fit: true, // whether to fit the viewport to the graph padding: 30, @@ -177754,119 +110667,117 @@ g.stateGroup line { // width of layout area (overrides container width) spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - concentric: function concentric(node2) { + concentric: /* @__PURE__ */ __name(function concentric(node2) { return node2.degree(); - }, - levelWidth: function levelWidth(nodes2) { - return nodes2.maxDegree() / 4; - }, + }, "concentric"), + levelWidth: /* @__PURE__ */ __name(function levelWidth(nodes6) { + return nodes6.maxDegree() / 4; + }, "levelWidth"), animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled - animateFilter: function animateFilter(node2, i3) { + animateFilter: /* @__PURE__ */ __name(function animateFilter3(node2, i2) { return true; - }, + }, "animateFilter"), // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop - transform: function transform(node2, position3) { - return position3; - } + transform: /* @__PURE__ */ __name(function transform4(node2, position5) { + return position5; + }, "transform") // transform a given node position. Useful for changing flow direction in discrete layouts }; - function ConcentricLayout(options2) { - this.options = extend2({}, defaults$5, options2); - } + __name(ConcentricLayout, "ConcentricLayout"); ConcentricLayout.prototype.run = function() { var params = this.options; - var options2 = params; - var clockwise = options2.counterclockwise !== void 0 ? !options2.counterclockwise : options2.clockwise; + var options3 = params; + var clockwise = options3.counterclockwise !== void 0 ? !options3.counterclockwise : options3.clockwise; var cy = params.cy; - var eles = options2.eles; - var nodes2 = eles.nodes().not(":parent"); - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { + var eles = options3.eles; + var nodes6 = eles.nodes().not(":parent"); + var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : { x1: 0, y1: 0, w: cy.width(), h: cy.height() }); - var center2 = { + var center4 = { x: bb.x1 + bb.w / 2, y: bb.y1 + bb.h / 2 }; var nodeValues = []; var maxNodeSize = 0; - for (var i3 = 0; i3 < nodes2.length; i3++) { - var node2 = nodes2[i3]; + for (var i2 = 0; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; var value2 = void 0; - value2 = options2.concentric(node2); + value2 = options3.concentric(node2); nodeValues.push({ value: value2, node: node2 }); node2._private.scratch.concentric = value2; } - nodes2.updateStyle(); - for (var _i6 = 0; _i6 < nodes2.length; _i6++) { - var _node = nodes2[_i6]; - var nbb = _node.layoutDimensions(options2); + nodes6.updateStyle(); + for (var _i = 0; _i < nodes6.length; _i++) { + var _node = nodes6[_i]; + var nbb = _node.layoutDimensions(options3); maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h); } - nodeValues.sort(function(a, b) { - return b.value - a.value; + nodeValues.sort(function(a2, b2) { + return b2.value - a2.value; }); - var levelWidth = options2.levelWidth(nodes2); + var levelWidth2 = options3.levelWidth(nodes6); var levels = [[]]; var currentLevel = levels[0]; - for (var _i22 = 0; _i22 < nodeValues.length; _i22++) { - var val = nodeValues[_i22]; + for (var _i2 = 0; _i2 < nodeValues.length; _i2++) { + var val = nodeValues[_i2]; if (currentLevel.length > 0) { - var diff = Math.abs(currentLevel[0].value - val.value); - if (diff >= levelWidth) { + var diff2 = Math.abs(currentLevel[0].value - val.value); + if (diff2 >= levelWidth2) { currentLevel = []; levels.push(currentLevel); } } currentLevel.push(val); } - var minDist = maxNodeSize + options2.minNodeSpacing; - if (!options2.avoidOverlap) { + var minDist = maxNodeSize + options3.minNodeSpacing; + if (!options3.avoidOverlap) { var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1; var maxR = Math.min(bb.w, bb.h) / 2 - minDist; var rStep = maxR / (levels.length + firstLvlHasMulti ? 1 : 0); minDist = Math.min(minDist, rStep); } - var r = 0; - for (var _i32 = 0; _i32 < levels.length; _i32++) { - var level = levels[_i32]; - var sweep = options2.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / level.length : options2.sweep; + var r2 = 0; + for (var _i3 = 0; _i3 < levels.length; _i3++) { + var level = levels[_i3]; + var sweep = options3.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / level.length : options3.sweep; var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1); - if (level.length > 1 && options2.avoidOverlap) { + if (level.length > 1 && options3.avoidOverlap) { var dcos = Math.cos(dTheta) - Math.cos(0); var dsin = Math.sin(dTheta) - Math.sin(0); var rMin = Math.sqrt(minDist * minDist / (dcos * dcos + dsin * dsin)); - r = Math.max(rMin, r); + r2 = Math.max(rMin, r2); } - level.r = r; - r += minDist; + level.r = r2; + r2 += minDist; } - if (options2.equidistant) { + if (options3.equidistant) { var rDeltaMax = 0; var _r = 0; - for (var _i42 = 0; _i42 < levels.length; _i42++) { - var _level = levels[_i42]; + for (var _i4 = 0; _i4 < levels.length; _i4++) { + var _level = levels[_i4]; var rDelta = _level.r - _r; rDeltaMax = Math.max(rDeltaMax, rDelta); } _r = 0; - for (var _i52 = 0; _i52 < levels.length; _i52++) { - var _level2 = levels[_i52]; - if (_i52 === 0) { + for (var _i5 = 0; _i5 < levels.length; _i5++) { + var _level2 = levels[_i5]; + if (_i5 === 0) { _r = _level2.r; } _level2.r = _r; @@ -177874,34 +110785,33 @@ g.stateGroup line { } } var pos = {}; - for (var _i62 = 0; _i62 < levels.length; _i62++) { - var _level3 = levels[_i62]; + for (var _i6 = 0; _i6 < levels.length; _i6++) { + var _level3 = levels[_i6]; var _dTheta = _level3.dTheta; var _r2 = _level3.r; - for (var j = 0; j < _level3.length; j++) { - var _val = _level3[j]; - var theta = options2.startAngle + (clockwise ? 1 : -1) * _dTheta * j; - var p2 = { - x: center2.x + _r2 * Math.cos(theta), - y: center2.y + _r2 * Math.sin(theta) + for (var j2 = 0; j2 < _level3.length; j2++) { + var _val = _level3[j2]; + var theta = options3.startAngle + (clockwise ? 1 : -1) * _dTheta * j2; + var p3 = { + x: center4.x + _r2 * Math.cos(theta), + y: center4.y + _r2 * Math.sin(theta) }; - pos[_val.node.id()] = p2; + pos[_val.node.id()] = p3; } } - eles.nodes().layoutPositions(this, options2, function(ele) { - var id2 = ele.id(); - return pos[id2]; + eles.nodes().layoutPositions(this, options3, function(ele) { + var id26 = ele.id(); + return pos[id26]; }); return this; }; - var DEBUG; - var defaults$4 = { + defaults$4 = { // Called on `layoutready` - ready: function ready() { - }, + ready: /* @__PURE__ */ __name(function ready2() { + }, "ready"), // Called on `layoutstop` - stop: function stop() { - }, + stop: /* @__PURE__ */ __name(function stop3() { + }, "stop"), // Whether to animate while running the layout // true : Animate continuously as the layout is running // false : Just show the end result @@ -177914,9 +110824,9 @@ g.stateGroup line { // A function that determines whether the node should be animated // All nodes animated by default on animate enabled // Non-animated nodes are positioned immediately when the layout starts - animateFilter: function animateFilter(node2, i3) { + animateFilter: /* @__PURE__ */ __name(function animateFilter4(node2, i2) { return true; - }, + }, "animateFilter"), // The layout animates only after this many milliseconds for animate:true // (prevents flashing on fast runs) animationThreshold: 250, @@ -177935,19 +110845,19 @@ g.stateGroup line { // Extra spacing between components in non-compound graphs componentSpacing: 40, // Node repulsion (non overlapping) multiplier - nodeRepulsion: function nodeRepulsion2(node2) { + nodeRepulsion: /* @__PURE__ */ __name(function nodeRepulsion(node2) { return 2048; - }, + }, "nodeRepulsion"), // Node repulsion (overlapping) multiplier nodeOverlap: 4, // Ideal edge (non nested) length - idealEdgeLength: function idealEdgeLength(edge) { + idealEdgeLength: /* @__PURE__ */ __name(function idealEdgeLength(edge) { return 32; - }, + }, "idealEdgeLength"), // Divisor to compute edge forces - edgeElasticity: function edgeElasticity(edge) { + edgeElasticity: /* @__PURE__ */ __name(function edgeElasticity(edge) { return 32; - }, + }, "edgeElasticity"), // Nesting factor (multiplier) to compute ideal edge length for nested edges nestingFactor: 1.2, // Gravity force (constant) @@ -177961,107 +110871,90 @@ g.stateGroup line { // Lower temperature threshold (below this point the layout will end) minTemp: 1 }; - function CoseLayout(options2) { - this.options = extend2({}, defaults$4, options2); - this.options.layout = this; - var nodes2 = this.options.eles.nodes(); - var edges2 = this.options.eles.edges(); - var notEdges = edges2.filter(function(e) { - var sourceId = e.source().data("id"); - var targetId = e.target().data("id"); - var hasSource = nodes2.some(function(n) { - return n.data("id") === sourceId; - }); - var hasTarget = nodes2.some(function(n) { - return n.data("id") === targetId; - }); - return !hasSource || !hasTarget; - }); - this.options.eles = this.options.eles.not(notEdges); - } + __name(CoseLayout, "CoseLayout"); CoseLayout.prototype.run = function() { - var options2 = this.options; - var cy = options2.cy; - var layout3 = this; - layout3.stopped = false; - if (options2.animate === true || options2.animate === false) { - layout3.emit({ + var options3 = this.options; + var cy = options3.cy; + var layout6 = this; + layout6.stopped = false; + if (options3.animate === true || options3.animate === false) { + layout6.emit({ type: "layoutstart", - layout: layout3 + layout: layout6 }); } - if (true === options2.debug) { + if (true === options3.debug) { DEBUG = true; } else { DEBUG = false; } - var layoutInfo = createLayoutInfo(cy, layout3, options2); + var layoutInfo = createLayoutInfo(cy, layout6, options3); if (DEBUG) { printLayoutInfo(layoutInfo); } - if (options2.randomize) { + if (options3.randomize) { randomizePositions(layoutInfo); } var startTime = performanceNow(); - var refresh = function refresh2() { - refreshPositions(layoutInfo, cy, options2); - if (true === options2.fit) { - cy.fit(options2.padding); - } - }; - var mainLoop = function mainLoop2(i4) { - if (layout3.stopped || i4 >= options2.numIter) { + var refresh = /* @__PURE__ */ __name(function refresh2() { + refreshPositions(layoutInfo, cy, options3); + if (true === options3.fit) { + cy.fit(options3.padding); + } + }, "refresh"); + var mainLoop = /* @__PURE__ */ __name(function mainLoop2(i3) { + if (layout6.stopped || i3 >= options3.numIter) { return false; } - step(layoutInfo, options2); - layoutInfo.temperature = layoutInfo.temperature * options2.coolingFactor; - if (layoutInfo.temperature < options2.minTemp) { + step(layoutInfo, options3); + layoutInfo.temperature = layoutInfo.temperature * options3.coolingFactor; + if (layoutInfo.temperature < options3.minTemp) { return false; } return true; - }; - var done = function done2() { - if (options2.animate === true || options2.animate === false) { + }, "mainLoop"); + var done = /* @__PURE__ */ __name(function done2() { + if (options3.animate === true || options3.animate === false) { refresh(); - layout3.one("layoutstop", options2.stop); - layout3.emit({ + layout6.one("layoutstop", options3.stop); + layout6.emit({ type: "layoutstop", - layout: layout3 + layout: layout6 }); } else { - var nodes2 = options2.eles.nodes(); - var getScaledPos = getScaleInBoundsFn(layoutInfo, options2, nodes2); - nodes2.layoutPositions(layout3, options2, getScaledPos); + var nodes6 = options3.eles.nodes(); + var getScaledPos = getScaleInBoundsFn(layoutInfo, options3, nodes6); + nodes6.layoutPositions(layout6, options3, getScaledPos); } - }; - var i3 = 0; + }, "done"); + var i2 = 0; var loopRet = true; - if (options2.animate === true) { - var frame2 = function frame3() { - var f2 = 0; - while (loopRet && f2 < options2.refresh) { - loopRet = mainLoop(i3); - i3++; - f2++; + if (options3.animate === true) { + var frame2 = /* @__PURE__ */ __name(function frame3() { + var f3 = 0; + while (loopRet && f3 < options3.refresh) { + loopRet = mainLoop(i2); + i2++; + f3++; } if (!loopRet) { - separateComponents(layoutInfo, options2); + separateComponents(layoutInfo, options3); done(); } else { - var now3 = performanceNow(); - if (now3 - startTime >= options2.animationThreshold) { + var now4 = performanceNow(); + if (now4 - startTime >= options3.animationThreshold) { refresh(); } requestAnimationFrame2(frame3); } - }; + }, "frame"); frame2(); } else { while (loopRet) { - loopRet = mainLoop(i3); - i3++; + loopRet = mainLoop(i2); + i2++; } - separateComponents(layoutInfo, options2); + separateComponents(layoutInfo, options3); done(); } return this; @@ -178080,10 +110973,10 @@ g.stateGroup line { } return this; }; - var createLayoutInfo = function createLayoutInfo2(cy, layout3, options2) { - var edges2 = options2.eles.edges(); - var nodes2 = options2.eles.nodes(); - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { + createLayoutInfo = /* @__PURE__ */ __name(function createLayoutInfo2(cy, layout6, options3) { + var edges5 = options3.eles.edges(); + var nodes6 = options3.eles.nodes(); + var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : { x1: 0, y1: 0, w: cy.width(), @@ -178093,36 +110986,36 @@ g.stateGroup line { isCompound: cy.hasCompoundNodes(), layoutNodes: [], idToIndex: {}, - nodeSize: nodes2.size(), + nodeSize: nodes6.size(), graphSet: [], indexToGraph: [], layoutEdges: [], - edgeSize: edges2.size(), - temperature: options2.initialTemp, + edgeSize: edges5.size(), + temperature: options3.initialTemp, clientWidth: bb.w, clientHeight: bb.h, boundingBox: bb }; - var components = options2.eles.components(); + var components3 = options3.eles.components(); var id2cmptId = {}; - for (var i3 = 0; i3 < components.length; i3++) { - var component = components[i3]; - for (var j = 0; j < component.length; j++) { - var node2 = component[j]; - id2cmptId[node2.id()] = i3; + for (var i2 = 0; i2 < components3.length; i2++) { + var component2 = components3[i2]; + for (var j2 = 0; j2 < component2.length; j2++) { + var node2 = component2[j2]; + id2cmptId[node2.id()] = i2; } } - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = nodes2[i3]; - var nbb = n.layoutDimensions(options2); + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = nodes6[i2]; + var nbb = n2.layoutDimensions(options3); var tempNode = {}; - tempNode.isLocked = n.locked(); - tempNode.id = n.data("id"); - tempNode.parentId = n.data("parent"); - tempNode.cmptId = id2cmptId[n.id()]; + tempNode.isLocked = n2.locked(); + tempNode.id = n2.data("id"); + tempNode.parentId = n2.data("parent"); + tempNode.cmptId = id2cmptId[n2.id()]; tempNode.children = []; - tempNode.positionX = n.position("x"); - tempNode.positionY = n.position("y"); + tempNode.positionX = n2.position("x"); + tempNode.positionY = n2.position("y"); tempNode.offsetX = 0; tempNode.offsetY = 0; tempNode.height = nbb.w; @@ -178131,56 +111024,56 @@ g.stateGroup line { tempNode.minX = tempNode.positionX - tempNode.width / 2; tempNode.maxY = tempNode.positionY + tempNode.height / 2; tempNode.minY = tempNode.positionY - tempNode.height / 2; - tempNode.padLeft = parseFloat(n.style("padding")); - tempNode.padRight = parseFloat(n.style("padding")); - tempNode.padTop = parseFloat(n.style("padding")); - tempNode.padBottom = parseFloat(n.style("padding")); - tempNode.nodeRepulsion = fn$6(options2.nodeRepulsion) ? options2.nodeRepulsion(n) : options2.nodeRepulsion; + tempNode.padLeft = parseFloat(n2.style("padding")); + tempNode.padRight = parseFloat(n2.style("padding")); + tempNode.padTop = parseFloat(n2.style("padding")); + tempNode.padBottom = parseFloat(n2.style("padding")); + tempNode.nodeRepulsion = fn$6(options3.nodeRepulsion) ? options3.nodeRepulsion(n2) : options3.nodeRepulsion; layoutInfo.layoutNodes.push(tempNode); - layoutInfo.idToIndex[tempNode.id] = i3; + layoutInfo.idToIndex[tempNode.id] = i2; } var queue = []; - var start2 = 0; + var start3 = 0; var end2 = -1; var tempGraph = []; - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = layoutInfo.layoutNodes[i3]; - var p_id = n.parentId; + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = layoutInfo.layoutNodes[i2]; + var p_id = n2.parentId; if (null != p_id) { - layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id); + layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n2.id); } else { - queue[++end2] = n.id; - tempGraph.push(n.id); + queue[++end2] = n2.id; + tempGraph.push(n2.id); } } layoutInfo.graphSet.push(tempGraph); - while (start2 <= end2) { - var node_id = queue[start2++]; + while (start3 <= end2) { + var node_id = queue[start3++]; var node_ix = layoutInfo.idToIndex[node_id]; var node2 = layoutInfo.layoutNodes[node_ix]; var children2 = node2.children; if (children2.length > 0) { layoutInfo.graphSet.push(children2); - for (var i3 = 0; i3 < children2.length; i3++) { - queue[++end2] = children2[i3]; + for (var i2 = 0; i2 < children2.length; i2++) { + queue[++end2] = children2[i2]; } } } - for (var i3 = 0; i3 < layoutInfo.graphSet.length; i3++) { - var graph = layoutInfo.graphSet[i3]; - for (var j = 0; j < graph.length; j++) { - var index2 = layoutInfo.idToIndex[graph[j]]; - layoutInfo.indexToGraph[index2] = i3; + for (var i2 = 0; i2 < layoutInfo.graphSet.length; i2++) { + var graph = layoutInfo.graphSet[i2]; + for (var j2 = 0; j2 < graph.length; j2++) { + var index = layoutInfo.idToIndex[graph[j2]]; + layoutInfo.indexToGraph[index] = i2; } } - for (var i3 = 0; i3 < layoutInfo.edgeSize; i3++) { - var e = edges2[i3]; + for (var i2 = 0; i2 < layoutInfo.edgeSize; i2++) { + var e3 = edges5[i2]; var tempEdge = {}; - tempEdge.id = e.data("id"); - tempEdge.sourceId = e.data("source"); - tempEdge.targetId = e.data("target"); - var idealLength = fn$6(options2.idealEdgeLength) ? options2.idealEdgeLength(e) : options2.idealEdgeLength; - var elasticity = fn$6(options2.edgeElasticity) ? options2.edgeElasticity(e) : options2.edgeElasticity; + tempEdge.id = e3.data("id"); + tempEdge.sourceId = e3.data("source"); + tempEdge.targetId = e3.data("target"); + var idealLength = fn$6(options3.idealEdgeLength) ? options3.idealEdgeLength(e3) : options3.idealEdgeLength; + var elasticity = fn$6(options3.edgeElasticity) ? options3.edgeElasticity(e3) : options3.edgeElasticity; var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId]; var targetIx = layoutInfo.idToIndex[tempEdge.targetId]; var sourceGraph = layoutInfo.indexToGraph[sourceIx]; @@ -178199,23 +111092,23 @@ g.stateGroup line { tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; depth++; } - idealLength *= depth * options2.nestingFactor; + idealLength *= depth * options3.nestingFactor; } tempEdge.idealLength = idealLength; tempEdge.elasticity = elasticity; layoutInfo.layoutEdges.push(tempEdge); } return layoutInfo; - }; - var findLCA = function findLCA2(node1, node2, layoutInfo) { + }, "createLayoutInfo"); + findLCA = /* @__PURE__ */ __name(function findLCA2(node1, node2, layoutInfo) { var res = findLCA_aux(node1, node2, 0, layoutInfo); if (2 > res.count) { return 0; } else { return res.graph; } - }; - var findLCA_aux = function findLCA_aux2(node1, node2, graphIx, layoutInfo) { + }, "findLCA"); + findLCA_aux = /* @__PURE__ */ __name(function findLCA_aux2(node1, node2, graphIx, layoutInfo) { var graph = layoutInfo.graphSet[graphIx]; if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) { return { @@ -178223,9 +111116,9 @@ g.stateGroup line { graph: graphIx }; } - var c2 = 0; - for (var i3 = 0; i3 < graph.length; i3++) { - var nodeId = graph[i3]; + var c3 = 0; + for (var i2 = 0; i2 < graph.length; i2++) { + var nodeId = graph[i2]; var nodeIx = layoutInfo.idToIndex[nodeId]; var children2 = layoutInfo.layoutNodes[nodeIx].children; if (0 === children2.length) { @@ -178236,8 +111129,8 @@ g.stateGroup line { if (0 === result.count) { continue; } else if (1 === result.count) { - c2++; - if (2 === c2) { + c3++; + if (2 === c3) { break; } } else { @@ -178245,23 +111138,22 @@ g.stateGroup line { } } return { - count: c2, + count: c3, graph: graphIx }; - }; - var printLayoutInfo; - var randomizePositions = function randomizePositions2(layoutInfo, cy) { - var width2 = layoutInfo.clientWidth; - var height = layoutInfo.clientHeight; - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = layoutInfo.layoutNodes[i3]; - if (0 === n.children.length && !n.isLocked) { - n.positionX = Math.random() * width2; - n.positionY = Math.random() * height; - } - } - }; - var getScaleInBoundsFn = function getScaleInBoundsFn2(layoutInfo, options2, nodes2) { + }, "findLCA_aux"); + randomizePositions = /* @__PURE__ */ __name(function randomizePositions2(layoutInfo, cy) { + var width3 = layoutInfo.clientWidth; + var height2 = layoutInfo.clientHeight; + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = layoutInfo.layoutNodes[i2]; + if (0 === n2.children.length && !n2.isLocked) { + n2.positionX = Math.random() * width3; + n2.positionY = Math.random() * height2; + } + } + }, "randomizePositions"); + getScaleInBoundsFn = /* @__PURE__ */ __name(function getScaleInBoundsFn2(layoutInfo, options3, nodes6) { var bb = layoutInfo.boundingBox; var coseBB = { x1: Infinity, @@ -178269,8 +111161,8 @@ g.stateGroup line { y1: Infinity, y2: -Infinity }; - if (options2.boundingBox) { - nodes2.forEach(function(node2) { + if (options3.boundingBox) { + nodes6.forEach(function(node2) { var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node2.data("id")]]; coseBB.x1 = Math.min(coseBB.x1, lnode.positionX); coseBB.x2 = Math.max(coseBB.x2, lnode.positionX); @@ -178280,9 +111172,9 @@ g.stateGroup line { coseBB.w = coseBB.x2 - coseBB.x1; coseBB.h = coseBB.y2 - coseBB.y1; } - return function(ele, i3) { + return function(ele, i2) { var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data("id")]]; - if (options2.boundingBox) { + if (options3.boundingBox) { var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; return { @@ -178296,45 +111188,45 @@ g.stateGroup line { }; } }; - }; - var refreshPositions = function refreshPositions2(layoutInfo, cy, options2) { - var layout3 = options2.layout; - var nodes2 = options2.eles.nodes(); - var getScaledPos = getScaleInBoundsFn(layoutInfo, options2, nodes2); - nodes2.positions(getScaledPos); + }, "getScaleInBoundsFn"); + refreshPositions = /* @__PURE__ */ __name(function refreshPositions2(layoutInfo, cy, options3) { + var layout6 = options3.layout; + var nodes6 = options3.eles.nodes(); + var getScaledPos = getScaleInBoundsFn(layoutInfo, options3, nodes6); + nodes6.positions(getScaledPos); if (true !== layoutInfo.ready) { layoutInfo.ready = true; - layout3.one("layoutready", options2.ready); - layout3.emit({ + layout6.one("layoutready", options3.ready); + layout6.emit({ type: "layoutready", layout: this }); } - }; - var step = function step2(layoutInfo, options2, _step) { - calculateNodeForces(layoutInfo, options2); + }, "refreshPositions"); + step = /* @__PURE__ */ __name(function step2(layoutInfo, options3, _step) { + calculateNodeForces(layoutInfo, options3); calculateEdgeForces(layoutInfo); - calculateGravityForces(layoutInfo, options2); + calculateGravityForces(layoutInfo, options3); propagateForces(layoutInfo); updatePositions(layoutInfo); - }; - var calculateNodeForces = function calculateNodeForces2(layoutInfo, options2) { - for (var i3 = 0; i3 < layoutInfo.graphSet.length; i3++) { - var graph = layoutInfo.graphSet[i3]; + }, "step"); + calculateNodeForces = /* @__PURE__ */ __name(function calculateNodeForces2(layoutInfo, options3) { + for (var i2 = 0; i2 < layoutInfo.graphSet.length; i2++) { + var graph = layoutInfo.graphSet[i2]; var numNodes = graph.length; - for (var j = 0; j < numNodes; j++) { - var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; - for (var k = j + 1; k < numNodes; k++) { - var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k]]]; - nodeRepulsion(node1, node2, layoutInfo, options2); + for (var j2 = 0; j2 < numNodes; j2++) { + var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j2]]]; + for (var k2 = j2 + 1; k2 < numNodes; k2++) { + var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k2]]]; + nodeRepulsion2(node1, node2, layoutInfo, options3); } } } - }; - var randomDistance = function randomDistance2(max3) { - return -max3 + 2 * max3 * Math.random(); - }; - var nodeRepulsion = function nodeRepulsion2(node1, node2, layoutInfo, options2) { + }, "calculateNodeForces"); + randomDistance = /* @__PURE__ */ __name(function randomDistance2(max10) { + return -max10 + 2 * max10 * Math.random(); + }, "randomDistance"); + nodeRepulsion2 = /* @__PURE__ */ __name(function nodeRepulsion3(node1, node2, layoutInfo, options3) { var cmptId1 = node1.cmptId; var cmptId2 = node2.cmptId; if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) { @@ -178349,15 +111241,15 @@ g.stateGroup line { } var overlap = nodesOverlap(node1, node2, directionX, directionY); if (overlap > 0) { - var force = options2.nodeOverlap * overlap; + var force = options3.nodeOverlap * overlap; var distance2 = Math.sqrt(directionX * directionX + directionY * directionY); var forceX = force * directionX / distance2; var forceY = force * directionY / distance2; } else { var point1 = findClippingPoint(node1, directionX, directionY); - var point2 = findClippingPoint(node2, -1 * directionX, -1 * directionY); - var distanceX = point2.x - point1.x; - var distanceY = point2.y - point1.y; + var point22 = findClippingPoint(node2, -1 * directionX, -1 * directionY); + var distanceX = point22.x - point1.x; + var distanceY = point22.y - point1.y; var distanceSqr = distanceX * distanceX + distanceY * distanceY; var distance2 = Math.sqrt(distanceSqr); var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr; @@ -178373,8 +111265,8 @@ g.stateGroup line { node2.offsetY += forceY; } return; - }; - var nodesOverlap = function nodesOverlap2(node1, node2, dX, dY) { + }, "nodeRepulsion"); + nodesOverlap = /* @__PURE__ */ __name(function nodesOverlap2(node1, node2, dX, dY) { if (dX > 0) { var overlapX = node1.maxX - node2.minX; } else { @@ -178390,50 +111282,50 @@ g.stateGroup line { } else { return 0; } - }; - var findClippingPoint = function findClippingPoint2(node2, dX, dY) { - var X = node2.positionX; - var Y = node2.positionY; - var H = node2.height || 1; - var W = node2.width || 1; + }, "nodesOverlap"); + findClippingPoint = /* @__PURE__ */ __name(function findClippingPoint2(node2, dX, dY) { + var X3 = node2.positionX; + var Y3 = node2.positionY; + var H2 = node2.height || 1; + var W2 = node2.width || 1; var dirSlope = dY / dX; - var nodeSlope = H / W; + var nodeSlope = H2 / W2; var res = {}; if (0 === dX && 0 < dY) { - res.x = X; - res.y = Y + H / 2; + res.x = X3; + res.y = Y3 + H2 / 2; return res; } if (0 === dX && 0 > dY) { - res.x = X; - res.y = Y + H / 2; + res.x = X3; + res.y = Y3 + H2 / 2; return res; } if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X + W / 2; - res.y = Y + W * dY / 2 / dX; + res.x = X3 + W2 / 2; + res.y = Y3 + W2 * dY / 2 / dX; return res; } if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X - W / 2; - res.y = Y - W * dY / 2 / dX; + res.x = X3 - W2 / 2; + res.y = Y3 - W2 * dY / 2 / dX; return res; } if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X + H * dX / 2 / dY; - res.y = Y + H / 2; + res.x = X3 + H2 * dX / 2 / dY; + res.y = Y3 + H2 / 2; return res; } if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X - H * dX / 2 / dY; - res.y = Y - H / 2; + res.x = X3 - H2 * dX / 2 / dY; + res.y = Y3 - H2 / 2; return res; } return res; - }; - var calculateEdgeForces = function calculateEdgeForces2(layoutInfo, options2) { - for (var i3 = 0; i3 < layoutInfo.edgeSize; i3++) { - var edge = layoutInfo.layoutEdges[i3]; + }, "findClippingPoint"); + calculateEdgeForces = /* @__PURE__ */ __name(function calculateEdgeForces2(layoutInfo, options3) { + for (var i2 = 0; i2 < layoutInfo.edgeSize; i2++) { + var edge = layoutInfo.layoutEdges[i2]; var sourceIx = layoutInfo.idToIndex[edge.sourceId]; var source = layoutInfo.layoutNodes[sourceIx]; var targetIx = layoutInfo.idToIndex[edge.targetId]; @@ -178444,14 +111336,14 @@ g.stateGroup line { continue; } var point1 = findClippingPoint(source, directionX, directionY); - var point2 = findClippingPoint(target, -1 * directionX, -1 * directionY); - var lx = point2.x - point1.x; - var ly = point2.y - point1.y; - var l = Math.sqrt(lx * lx + ly * ly); - var force = Math.pow(edge.idealLength - l, 2) / edge.elasticity; - if (0 !== l) { - var forceX = force * lx / l; - var forceY = force * ly / l; + var point22 = findClippingPoint(target, -1 * directionX, -1 * directionY); + var lx = point22.x - point1.x; + var ly = point22.y - point1.y; + var l2 = Math.sqrt(lx * lx + ly * ly); + var force = Math.pow(edge.idealLength - l2, 2) / edge.elasticity; + if (0 !== l2) { + var forceX = force * lx / l2; + var forceY = force * ly / l2; } else { var forceX = 0; var forceY = 0; @@ -178465,108 +111357,108 @@ g.stateGroup line { target.offsetY -= forceY; } } - }; - var calculateGravityForces = function calculateGravityForces2(layoutInfo, options2) { - if (options2.gravity === 0) { + }, "calculateEdgeForces"); + calculateGravityForces = /* @__PURE__ */ __name(function calculateGravityForces2(layoutInfo, options3) { + if (options3.gravity === 0) { return; } var distThreshold = 1; - for (var i3 = 0; i3 < layoutInfo.graphSet.length; i3++) { - var graph = layoutInfo.graphSet[i3]; + for (var i2 = 0; i2 < layoutInfo.graphSet.length; i2++) { + var graph = layoutInfo.graphSet[i2]; var numNodes = graph.length; - if (0 === i3) { + if (0 === i2) { var centerX = layoutInfo.clientHeight / 2; var centerY = layoutInfo.clientWidth / 2; } else { var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]]; - var parent = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]]; - var centerX = parent.positionX; - var centerY = parent.positionY; + var parent4 = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]]; + var centerX = parent4.positionX; + var centerY = parent4.positionY; } - for (var j = 0; j < numNodes; j++) { - var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; + for (var j2 = 0; j2 < numNodes; j2++) { + var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j2]]]; if (node2.isLocked) { continue; } var dx = centerX - node2.positionX; var dy = centerY - node2.positionY; - var d = Math.sqrt(dx * dx + dy * dy); - if (d > distThreshold) { - var fx = options2.gravity * dx / d; - var fy = options2.gravity * dy / d; + var d2 = Math.sqrt(dx * dx + dy * dy); + if (d2 > distThreshold) { + var fx = options3.gravity * dx / d2; + var fy = options3.gravity * dy / d2; node2.offsetX += fx; node2.offsetY += fy; } } } - }; - var propagateForces = function propagateForces2(layoutInfo, options2) { + }, "calculateGravityForces"); + propagateForces = /* @__PURE__ */ __name(function propagateForces2(layoutInfo, options3) { var queue = []; - var start2 = 0; + var start3 = 0; var end2 = -1; queue.push.apply(queue, layoutInfo.graphSet[0]); end2 += layoutInfo.graphSet[0].length; - while (start2 <= end2) { - var nodeId = queue[start2++]; + while (start3 <= end2) { + var nodeId = queue[start3++]; var nodeIndex = layoutInfo.idToIndex[nodeId]; var node2 = layoutInfo.layoutNodes[nodeIndex]; var children2 = node2.children; if (0 < children2.length && !node2.isLocked) { var offX = node2.offsetX; var offY = node2.offsetY; - for (var i3 = 0; i3 < children2.length; i3++) { - var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children2[i3]]]; + for (var i2 = 0; i2 < children2.length; i2++) { + var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children2[i2]]]; childNode.offsetX += offX; childNode.offsetY += offY; - queue[++end2] = children2[i3]; + queue[++end2] = children2[i2]; } node2.offsetX = 0; node2.offsetY = 0; } } - }; - var updatePositions = function updatePositions2(layoutInfo, options2) { - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = layoutInfo.layoutNodes[i3]; - if (0 < n.children.length) { - n.maxX = void 0; - n.minX = void 0; - n.maxY = void 0; - n.minY = void 0; + }, "propagateForces"); + updatePositions = /* @__PURE__ */ __name(function updatePositions2(layoutInfo, options3) { + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = layoutInfo.layoutNodes[i2]; + if (0 < n2.children.length) { + n2.maxX = void 0; + n2.minX = void 0; + n2.maxY = void 0; + n2.minY = void 0; } } - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = layoutInfo.layoutNodes[i3]; - if (0 < n.children.length || n.isLocked) { + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = layoutInfo.layoutNodes[i2]; + if (0 < n2.children.length || n2.isLocked) { continue; } - var tempForce = limitForce(n.offsetX, n.offsetY, layoutInfo.temperature); - n.positionX += tempForce.x; - n.positionY += tempForce.y; - n.offsetX = 0; - n.offsetY = 0; - n.minX = n.positionX - n.width; - n.maxX = n.positionX + n.width; - n.minY = n.positionY - n.height; - n.maxY = n.positionY + n.height; - updateAncestryBoundaries(n, layoutInfo); - } - for (var i3 = 0; i3 < layoutInfo.nodeSize; i3++) { - var n = layoutInfo.layoutNodes[i3]; - if (0 < n.children.length && !n.isLocked) { - n.positionX = (n.maxX + n.minX) / 2; - n.positionY = (n.maxY + n.minY) / 2; - n.width = n.maxX - n.minX; - n.height = n.maxY - n.minY; - } - } - }; - var limitForce = function limitForce2(forceX, forceY, max3) { + var tempForce = limitForce(n2.offsetX, n2.offsetY, layoutInfo.temperature); + n2.positionX += tempForce.x; + n2.positionY += tempForce.y; + n2.offsetX = 0; + n2.offsetY = 0; + n2.minX = n2.positionX - n2.width; + n2.maxX = n2.positionX + n2.width; + n2.minY = n2.positionY - n2.height; + n2.maxY = n2.positionY + n2.height; + updateAncestryBoundaries(n2, layoutInfo); + } + for (var i2 = 0; i2 < layoutInfo.nodeSize; i2++) { + var n2 = layoutInfo.layoutNodes[i2]; + if (0 < n2.children.length && !n2.isLocked) { + n2.positionX = (n2.maxX + n2.minX) / 2; + n2.positionY = (n2.maxY + n2.minY) / 2; + n2.width = n2.maxX - n2.minX; + n2.height = n2.maxY - n2.minY; + } + } + }, "updatePositions"); + limitForce = /* @__PURE__ */ __name(function limitForce2(forceX, forceY, max10) { var force = Math.sqrt(forceX * forceX + forceY * forceY); - if (force > max3) { + if (force > max10) { var res = { - x: max3 * forceX / force, - y: max3 * forceY / force + x: max10 * forceX / force, + y: max10 * forceY / force }; } else { var res = { @@ -178575,97 +111467,97 @@ g.stateGroup line { }; } return res; - }; - var updateAncestryBoundaries = function updateAncestryBoundaries2(node2, layoutInfo) { + }, "limitForce"); + updateAncestryBoundaries = /* @__PURE__ */ __name(function updateAncestryBoundaries2(node2, layoutInfo) { var parentId = node2.parentId; if (null == parentId) { return; } - var p2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; + var p3 = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; var flag = false; - if (null == p2.maxX || node2.maxX + p2.padRight > p2.maxX) { - p2.maxX = node2.maxX + p2.padRight; + if (null == p3.maxX || node2.maxX + p3.padRight > p3.maxX) { + p3.maxX = node2.maxX + p3.padRight; flag = true; } - if (null == p2.minX || node2.minX - p2.padLeft < p2.minX) { - p2.minX = node2.minX - p2.padLeft; + if (null == p3.minX || node2.minX - p3.padLeft < p3.minX) { + p3.minX = node2.minX - p3.padLeft; flag = true; } - if (null == p2.maxY || node2.maxY + p2.padBottom > p2.maxY) { - p2.maxY = node2.maxY + p2.padBottom; + if (null == p3.maxY || node2.maxY + p3.padBottom > p3.maxY) { + p3.maxY = node2.maxY + p3.padBottom; flag = true; } - if (null == p2.minY || node2.minY - p2.padTop < p2.minY) { - p2.minY = node2.minY - p2.padTop; + if (null == p3.minY || node2.minY - p3.padTop < p3.minY) { + p3.minY = node2.minY - p3.padTop; flag = true; } if (flag) { - return updateAncestryBoundaries2(p2, layoutInfo); + return updateAncestryBoundaries2(p3, layoutInfo); } return; - }; - var separateComponents = function separateComponents2(layoutInfo, options2) { - var nodes2 = layoutInfo.layoutNodes; - var components = []; - for (var i3 = 0; i3 < nodes2.length; i3++) { - var node2 = nodes2[i3]; + }, "updateAncestryBoundaries"); + separateComponents = /* @__PURE__ */ __name(function separateComponents2(layoutInfo, options3) { + var nodes6 = layoutInfo.layoutNodes; + var components3 = []; + for (var i2 = 0; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; var cid = node2.cmptId; - var component = components[cid] = components[cid] || []; - component.push(node2); + var component2 = components3[cid] = components3[cid] || []; + component2.push(node2); } var totalA = 0; - for (var i3 = 0; i3 < components.length; i3++) { - var c2 = components[i3]; - if (!c2) { + for (var i2 = 0; i2 < components3.length; i2++) { + var c3 = components3[i2]; + if (!c3) { continue; } - c2.x1 = Infinity; - c2.x2 = -Infinity; - c2.y1 = Infinity; - c2.y2 = -Infinity; - for (var j = 0; j < c2.length; j++) { - var n = c2[j]; - c2.x1 = Math.min(c2.x1, n.positionX - n.width / 2); - c2.x2 = Math.max(c2.x2, n.positionX + n.width / 2); - c2.y1 = Math.min(c2.y1, n.positionY - n.height / 2); - c2.y2 = Math.max(c2.y2, n.positionY + n.height / 2); - } - c2.w = c2.x2 - c2.x1; - c2.h = c2.y2 - c2.y1; - totalA += c2.w * c2.h; - } - components.sort(function(c1, c22) { + c3.x1 = Infinity; + c3.x2 = -Infinity; + c3.y1 = Infinity; + c3.y2 = -Infinity; + for (var j2 = 0; j2 < c3.length; j2++) { + var n2 = c3[j2]; + c3.x1 = Math.min(c3.x1, n2.positionX - n2.width / 2); + c3.x2 = Math.max(c3.x2, n2.positionX + n2.width / 2); + c3.y1 = Math.min(c3.y1, n2.positionY - n2.height / 2); + c3.y2 = Math.max(c3.y2, n2.positionY + n2.height / 2); + } + c3.w = c3.x2 - c3.x1; + c3.h = c3.y2 - c3.y1; + totalA += c3.w * c3.h; + } + components3.sort(function(c1, c22) { return c22.w * c22.h - c1.w * c1.h; }); - var x2 = 0; - var y2 = 0; + var x5 = 0; + var y5 = 0; var usedW = 0; var rowH = 0; var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight; - for (var i3 = 0; i3 < components.length; i3++) { - var c2 = components[i3]; - if (!c2) { + for (var i2 = 0; i2 < components3.length; i2++) { + var c3 = components3[i2]; + if (!c3) { continue; } - for (var j = 0; j < c2.length; j++) { - var n = c2[j]; - if (!n.isLocked) { - n.positionX += x2 - c2.x1; - n.positionY += y2 - c2.y1; + for (var j2 = 0; j2 < c3.length; j2++) { + var n2 = c3[j2]; + if (!n2.isLocked) { + n2.positionX += x5 - c3.x1; + n2.positionY += y5 - c3.y1; } } - x2 += c2.w + options2.componentSpacing; - usedW += c2.w + options2.componentSpacing; - rowH = Math.max(rowH, c2.h); + x5 += c3.w + options3.componentSpacing; + usedW += c3.w + options3.componentSpacing; + rowH = Math.max(rowH, c3.h); if (usedW > maxRowW) { - y2 += rowH + options2.componentSpacing; - x2 = 0; + y5 += rowH + options3.componentSpacing; + x5 = 0; usedW = 0; rowH = 0; } } - }; - var defaults$3 = { + }, "separateComponents"); + defaults$3 = { fit: true, // whether to fit the viewport to the graph padding: 30, @@ -178686,8 +111578,8 @@ g.stateGroup line { // force num of rows in the grid cols: void 0, // force num of columns in the grid - position: function position3(node2) { - }, + position: /* @__PURE__ */ __name(function position3(node2) { + }, "position"), // returns { row, col } for element sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } @@ -178697,75 +111589,73 @@ g.stateGroup line { // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled - animateFilter: function animateFilter(node2, i3) { + animateFilter: /* @__PURE__ */ __name(function animateFilter5(node2, i2) { return true; - }, + }, "animateFilter"), // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop - transform: function transform(node2, position3) { - return position3; - } + transform: /* @__PURE__ */ __name(function transform5(node2, position5) { + return position5; + }, "transform") // transform a given node position. Useful for changing flow direction in discrete layouts }; - function GridLayout(options2) { - this.options = extend2({}, defaults$3, options2); - } + __name(GridLayout, "GridLayout"); GridLayout.prototype.run = function() { var params = this.options; - var options2 = params; + var options3 = params; var cy = params.cy; - var eles = options2.eles; - var nodes2 = eles.nodes().not(":parent"); - if (options2.sort) { - nodes2 = nodes2.sort(options2.sort); + var eles = options3.eles; + var nodes6 = eles.nodes().not(":parent"); + if (options3.sort) { + nodes6 = nodes6.sort(options3.sort); } - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { + var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : { x1: 0, y1: 0, w: cy.width(), h: cy.height() }); if (bb.h === 0 || bb.w === 0) { - eles.nodes().layoutPositions(this, options2, function(ele) { + eles.nodes().layoutPositions(this, options3, function(ele) { return { x: bb.x1, y: bb.y1 }; }); } else { - var cells = nodes2.size(); + var cells = nodes6.size(); var splits = Math.sqrt(cells * bb.h / bb.w); var rows = Math.round(splits); var cols = Math.round(bb.w / bb.h * splits); - var small = function small2(val) { + var small = /* @__PURE__ */ __name(function small2(val) { if (val == null) { return Math.min(rows, cols); } else { - var min3 = Math.min(rows, cols); - if (min3 == rows) { + var min9 = Math.min(rows, cols); + if (min9 == rows) { rows = val; } else { cols = val; } } - }; - var large = function large2(val) { + }, "small"); + var large = /* @__PURE__ */ __name(function large2(val) { if (val == null) { return Math.max(rows, cols); } else { - var max3 = Math.max(rows, cols); - if (max3 == rows) { + var max10 = Math.max(rows, cols); + if (max10 == rows) { rows = val; } else { cols = val; } } - }; - var oRows = options2.rows; - var oCols = options2.cols != null ? options2.cols : options2.columns; + }, "large"); + var oRows = options3.rows; + var oCols = options3.cols != null ? options3.cols : options3.columns; if (oRows != null && oCols != null) { rows = oRows; cols = oCols; @@ -178796,46 +111686,46 @@ g.stateGroup line { } var cellWidth = bb.w / cols; var cellHeight = bb.h / rows; - if (options2.condense) { + if (options3.condense) { cellWidth = 0; cellHeight = 0; } - if (options2.avoidOverlap) { - for (var i3 = 0; i3 < nodes2.length; i3++) { - var node2 = nodes2[i3]; + if (options3.avoidOverlap) { + for (var i2 = 0; i2 < nodes6.length; i2++) { + var node2 = nodes6[i2]; var pos = node2._private.position; if (pos.x == null || pos.y == null) { pos.x = 0; pos.y = 0; } - var nbb = node2.layoutDimensions(options2); - var p2 = options2.avoidOverlapPadding; - var w2 = nbb.w + p2; - var h = nbb.h + p2; - cellWidth = Math.max(cellWidth, w2); - cellHeight = Math.max(cellHeight, h); + var nbb = node2.layoutDimensions(options3); + var p3 = options3.avoidOverlapPadding; + var w3 = nbb.w + p3; + var h2 = nbb.h + p3; + cellWidth = Math.max(cellWidth, w3); + cellHeight = Math.max(cellHeight, h2); } } var cellUsed = {}; - var used = function used2(row2, col2) { + var used = /* @__PURE__ */ __name(function used2(row2, col2) { return cellUsed["c-" + row2 + "-" + col2] ? true : false; - }; - var use = function use2(row2, col2) { + }, "used"); + var use2 = /* @__PURE__ */ __name(function use3(row2, col2) { cellUsed["c-" + row2 + "-" + col2] = true; - }; + }, "use"); var row = 0; var col = 0; - var moveToNextCell = function moveToNextCell2() { + var moveToNextCell = /* @__PURE__ */ __name(function moveToNextCell2() { col++; if (col >= cols) { col = 0; row++; } - }; + }, "moveToNextCell"); var id2manPos = {}; - for (var _i6 = 0; _i6 < nodes2.length; _i6++) { - var _node = nodes2[_i6]; - var rcPos = options2.position(_node); + for (var _i = 0; _i < nodes6.length; _i++) { + var _node = nodes6[_i]; + var rcPos = options3.position(_node); if (rcPos && (rcPos.row !== void 0 || rcPos.col !== void 0)) { var _pos = { row: rcPos.row, @@ -178853,69 +111743,67 @@ g.stateGroup line { } } id2manPos[_node.id()] = _pos; - use(_pos.row, _pos.col); + use2(_pos.row, _pos.col); } } - var getPos = function getPos2(element3, i4) { - var x2, y2; + var getPos = /* @__PURE__ */ __name(function getPos2(element3, i3) { + var x5, y5; if (element3.locked() || element3.isParent()) { return false; } var rcPos2 = id2manPos[element3.id()]; if (rcPos2) { - x2 = rcPos2.col * cellWidth + cellWidth / 2 + bb.x1; - y2 = rcPos2.row * cellHeight + cellHeight / 2 + bb.y1; + x5 = rcPos2.col * cellWidth + cellWidth / 2 + bb.x1; + y5 = rcPos2.row * cellHeight + cellHeight / 2 + bb.y1; } else { while (used(row, col)) { moveToNextCell(); } - x2 = col * cellWidth + cellWidth / 2 + bb.x1; - y2 = row * cellHeight + cellHeight / 2 + bb.y1; - use(row, col); + x5 = col * cellWidth + cellWidth / 2 + bb.x1; + y5 = row * cellHeight + cellHeight / 2 + bb.y1; + use2(row, col); moveToNextCell(); } return { - x: x2, - y: y2 + x: x5, + y: y5 }; - }; - nodes2.layoutPositions(this, options2, getPos); + }, "getPos"); + nodes6.layoutPositions(this, options3, getPos); } return this; }; - var defaults$2 = { - ready: function ready() { - }, + defaults$2 = { + ready: /* @__PURE__ */ __name(function ready3() { + }, "ready"), // on layoutready - stop: function stop() { - } + stop: /* @__PURE__ */ __name(function stop4() { + }, "stop") // on layoutstop }; - function NullLayout(options2) { - this.options = extend2({}, defaults$2, options2); - } + __name(NullLayout, "NullLayout"); NullLayout.prototype.run = function() { - var options2 = this.options; - var eles = options2.eles; - var layout3 = this; - options2.cy; - layout3.emit("layoutstart"); + var options3 = this.options; + var eles = options3.eles; + var layout6 = this; + options3.cy; + layout6.emit("layoutstart"); eles.nodes().positions(function() { return { x: 0, y: 0 }; }); - layout3.one("layoutready", options2.ready); - layout3.emit("layoutready"); - layout3.one("layoutstop", options2.stop); - layout3.emit("layoutstop"); + layout6.one("layoutready", options3.ready); + layout6.emit("layoutready"); + layout6.one("layoutstop", options3.stop); + layout6.emit("layoutstop"); return this; }; NullLayout.prototype.stop = function() { return this; }; - var defaults$12 = { + defaults$1 = { positions: void 0, // map of (node id) => (position obj); or function(node){ return somPos; } zoom: void 0, @@ -178934,50 +111822,49 @@ g.stateGroup line { // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled - animateFilter: function animateFilter(node2, i3) { + animateFilter: /* @__PURE__ */ __name(function animateFilter6(node2, i2) { return true; - }, + }, "animateFilter"), // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop - transform: function transform(node2, position3) { - return position3; - } + transform: /* @__PURE__ */ __name(function transform6(node2, position5) { + return position5; + }, "transform") // transform a given node position. Useful for changing flow direction in discrete layouts }; - function PresetLayout(options2) { - this.options = extend2({}, defaults$12, options2); - } + __name(PresetLayout, "PresetLayout"); PresetLayout.prototype.run = function() { - var options2 = this.options; - var eles = options2.eles; - var nodes2 = eles.nodes(); - var posIsFn = fn$6(options2.positions); + var options3 = this.options; + var eles = options3.eles; + var nodes6 = eles.nodes(); + var posIsFn = fn$6(options3.positions); function getPosition(node2) { - if (options2.positions == null) { + if (options3.positions == null) { return copyPosition(node2.position()); } if (posIsFn) { - return options2.positions(node2); + return options3.positions(node2); } - var pos = options2.positions[node2._private.data.id]; + var pos = options3.positions[node2._private.data.id]; if (pos == null) { return null; } return pos; } - nodes2.layoutPositions(this, options2, function(node2, i3) { - var position3 = getPosition(node2); - if (node2.locked() || position3 == null) { + __name(getPosition, "getPosition"); + nodes6.layoutPositions(this, options3, function(node2, i2) { + var position5 = getPosition(node2); + if (node2.locked() || position5 == null) { return false; } - return position3; + return position5; }); return this; }; - var defaults2 = { + defaults3 = { fit: true, // whether to fit to viewport padding: 30, @@ -178990,42 +111877,40 @@ g.stateGroup line { // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled - animateFilter: function animateFilter(node2, i3) { + animateFilter: /* @__PURE__ */ __name(function animateFilter7(node2, i2) { return true; - }, + }, "animateFilter"), // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop - transform: function transform(node2, position3) { - return position3; - } + transform: /* @__PURE__ */ __name(function transform7(node2, position5) { + return position5; + }, "transform") // transform a given node position. Useful for changing flow direction in discrete layouts }; - function RandomLayout(options2) { - this.options = extend2({}, defaults2, options2); - } + __name(RandomLayout, "RandomLayout"); RandomLayout.prototype.run = function() { - var options2 = this.options; - var cy = options2.cy; - var eles = options2.eles; - var bb = makeBoundingBox(options2.boundingBox ? options2.boundingBox : { + var options3 = this.options; + var cy = options3.cy; + var eles = options3.eles; + var bb = makeBoundingBox(options3.boundingBox ? options3.boundingBox : { x1: 0, y1: 0, w: cy.width(), h: cy.height() }); - var getPos = function getPos2(node2, i3) { + var getPos = /* @__PURE__ */ __name(function getPos2(node2, i2) { return { x: bb.x1 + Math.round(Math.random() * bb.w), y: bb.y1 + Math.round(Math.random() * bb.h) }; - }; - eles.nodes().layoutPositions(this, options2, getPos); + }, "getPos"); + eles.nodes().layoutPositions(this, options3, getPos); return this; }; - var layout2 = [{ + layout4 = [{ name: "breadthfirst", impl: BreadthFirstLayout }, { @@ -179050,99 +111935,96 @@ g.stateGroup line { name: "random", impl: RandomLayout }]; - function NullRenderer(options2) { - this.options = options2; - this.notifications = 0; - } - var noop2 = function noop3() { - }; - var throwImgErr = function throwImgErr2() { + __name(NullRenderer, "NullRenderer"); + noop4 = /* @__PURE__ */ __name(function noop5() { + }, "noop"); + throwImgErr = /* @__PURE__ */ __name(function throwImgErr2() { throw new Error("A headless instance can not render images"); - }; + }, "throwImgErr"); NullRenderer.prototype = { - recalculateRenderedStyle: noop2, - notify: function notify() { + recalculateRenderedStyle: noop4, + notify: /* @__PURE__ */ __name(function notify2() { this.notifications++; - }, - init: noop2, - isHeadless: function isHeadless() { + }, "notify"), + init: noop4, + isHeadless: /* @__PURE__ */ __name(function isHeadless() { return true; - }, + }, "isHeadless"), png: throwImgErr, jpg: throwImgErr }; - var BRp$f = {}; + BRp$f = {}; BRp$f.arrowShapeWidth = 0.3; BRp$f.registerArrowShapes = function() { var arrowShapes = this.arrowShapes = {}; - var renderer3 = this; - var bbCollide = function bbCollide2(x2, y2, size2, angle, translation, edgeWidth, padding2) { - var x1 = translation.x - size2 / 2 - padding2; - var x22 = translation.x + size2 / 2 + padding2; - var y1 = translation.y - size2 / 2 - padding2; - var y22 = translation.y + size2 / 2 + padding2; - var inside = x1 <= x2 && x2 <= x22 && y1 <= y2 && y2 <= y22; + var renderer7 = this; + var bbCollide = /* @__PURE__ */ __name(function bbCollide2(x5, y5, size5, angle2, translation, edgeWidth, padding3) { + var x1 = translation.x - size5 / 2 - padding3; + var x22 = translation.x + size5 / 2 + padding3; + var y1 = translation.y - size5 / 2 - padding3; + var y22 = translation.y + size5 / 2 + padding3; + var inside = x1 <= x5 && x5 <= x22 && y1 <= y5 && y5 <= y22; return inside; - }; - var transform = function transform2(x2, y2, size2, angle, translation) { - var xRotated = x2 * Math.cos(angle) - y2 * Math.sin(angle); - var yRotated = x2 * Math.sin(angle) + y2 * Math.cos(angle); - var xScaled = xRotated * size2; - var yScaled = yRotated * size2; + }, "bbCollide"); + var transform8 = /* @__PURE__ */ __name(function transform9(x5, y5, size5, angle2, translation) { + var xRotated = x5 * Math.cos(angle2) - y5 * Math.sin(angle2); + var yRotated = x5 * Math.sin(angle2) + y5 * Math.cos(angle2); + var xScaled = xRotated * size5; + var yScaled = yRotated * size5; var xTranslated = xScaled + translation.x; var yTranslated = yScaled + translation.y; return { x: xTranslated, y: yTranslated }; - }; - var transformPoints = function transformPoints2(pts2, size2, angle, translation) { + }, "transform"); + var transformPoints = /* @__PURE__ */ __name(function transformPoints2(pts2, size5, angle2, translation) { var retPts = []; - for (var i3 = 0; i3 < pts2.length; i3 += 2) { - var x2 = pts2[i3]; - var y2 = pts2[i3 + 1]; - retPts.push(transform(x2, y2, size2, angle, translation)); + for (var i2 = 0; i2 < pts2.length; i2 += 2) { + var x5 = pts2[i2]; + var y5 = pts2[i2 + 1]; + retPts.push(transform8(x5, y5, size5, angle2, translation)); } return retPts; - }; - var pointsToArr = function pointsToArr2(pts2) { + }, "transformPoints"); + var pointsToArr = /* @__PURE__ */ __name(function pointsToArr2(pts2) { var ret = []; - for (var i3 = 0; i3 < pts2.length; i3++) { - var p2 = pts2[i3]; - ret.push(p2.x, p2.y); + for (var i2 = 0; i2 < pts2.length; i2++) { + var p3 = pts2[i2]; + ret.push(p3.x, p3.y); } return ret; - }; - var standardGap = function standardGap2(edge) { + }, "pointsToArr"); + var standardGap = /* @__PURE__ */ __name(function standardGap2(edge) { return edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").pfValue * 2; - }; - var defineArrowShape = function defineArrowShape2(name, defn) { - if (string2(defn)) { + }, "standardGap"); + var defineArrowShape = /* @__PURE__ */ __name(function defineArrowShape2(name, defn) { + if (string(defn)) { defn = arrowShapes[defn]; } arrowShapes[name] = extend2({ name, points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], - collide: function collide(x2, y2, size2, angle, translation, padding2) { - var points = pointsToArr(transformPoints(this.points, size2 + 2 * padding2, angle, translation)); - var inside = pointInsidePolygonPoints(x2, y2, points); + collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, padding3) { + var points = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation)); + var inside = pointInsidePolygonPoints(x5, y5, points); return inside; - }, + }, "collide"), roughCollide: bbCollide, - draw: function draw2(context, size2, angle, translation) { - var points = transformPoints(this.points, size2, angle, translation); - renderer3.arrowShapeImpl("polygon")(context, points); - }, - spacing: function spacing2(edge) { + draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation) { + var points = transformPoints(this.points, size5, angle2, translation); + renderer7.arrowShapeImpl("polygon")(context, points); + }, "draw"), + spacing: /* @__PURE__ */ __name(function spacing2(edge) { return 0; - }, + }, "spacing"), gap: standardGap }, defn); - }; + }, "defineArrowShape"); defineArrowShape("none", { collide: falsify, roughCollide: falsify, - draw: noop$12, + draw: noop$1, spacing: zeroify, gap: zeroify }); @@ -179154,47 +112036,47 @@ g.stateGroup line { points: arrowShapes["triangle"].points, controlPoint: [0, -0.15], roughCollide: bbCollide, - draw: function draw2(context, size2, angle, translation, edgeWidth) { - var ptsTrans = transformPoints(this.points, size2, angle, translation); + draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + var ptsTrans = transformPoints(this.points, size5, angle2, translation); var ctrlPt = this.controlPoint; - var ctrlPtTrans = transform(ctrlPt[0], ctrlPt[1], size2, angle, translation); - renderer3.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); - }, - gap: function gap(edge) { + var ctrlPtTrans = transform8(ctrlPt[0], ctrlPt[1], size5, angle2, translation); + renderer7.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); + }, "draw"), + gap: /* @__PURE__ */ __name(function gap(edge) { return standardGap(edge) * 0.8; - } + }, "gap") }); defineArrowShape("triangle-tee", { points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], - collide: function collide(x2, y2, size2, angle, translation, edgeWidth, padding2) { - var triPts = pointsToArr(transformPoints(this.points, size2 + 2 * padding2, angle, translation)); - var teePts = pointsToArr(transformPoints(this.pointsTee, size2 + 2 * padding2, angle, translation)); - var inside = pointInsidePolygonPoints(x2, y2, triPts) || pointInsidePolygonPoints(x2, y2, teePts); + collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) { + var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation)); + var teePts = pointsToArr(transformPoints(this.pointsTee, size5 + 2 * padding3, angle2, translation)); + var inside = pointInsidePolygonPoints(x5, y5, triPts) || pointInsidePolygonPoints(x5, y5, teePts); return inside; - }, - draw: function draw2(context, size2, angle, translation, edgeWidth) { - var triPts = transformPoints(this.points, size2, angle, translation); - var teePts = transformPoints(this.pointsTee, size2, angle, translation); - renderer3.arrowShapeImpl(this.name)(context, triPts, teePts); - } + }, "collide"), + draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + var triPts = transformPoints(this.points, size5, angle2, translation); + var teePts = transformPoints(this.pointsTee, size5, angle2, translation); + renderer7.arrowShapeImpl(this.name)(context, triPts, teePts); + }, "draw") }); defineArrowShape("circle-triangle", { radius: 0.15, pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15], - collide: function collide(x2, y2, size2, angle, translation, edgeWidth, padding2) { - var t = translation; - var circleInside = Math.pow(t.x - x2, 2) + Math.pow(t.y - y2, 2) <= Math.pow((size2 + 2 * padding2) * this.radius, 2); - var triPts = pointsToArr(transformPoints(this.points, size2 + 2 * padding2, angle, translation)); - return pointInsidePolygonPoints(x2, y2, triPts) || circleInside; - }, - draw: function draw2(context, size2, angle, translation, edgeWidth) { - var triPts = transformPoints(this.pointsTr, size2, angle, translation); - renderer3.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size2); - }, - spacing: function spacing2(edge) { - return renderer3.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; - } + collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) { + var t4 = translation; + var circleInside = Math.pow(t4.x - x5, 2) + Math.pow(t4.y - y5, 2) <= Math.pow((size5 + 2 * padding3) * this.radius, 2); + var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation)); + return pointInsidePolygonPoints(x5, y5, triPts) || circleInside; + }, "collide"), + draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + var triPts = transformPoints(this.pointsTr, size5, angle2, translation); + renderer7.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size5); + }, "draw"), + spacing: /* @__PURE__ */ __name(function spacing2(edge) { + return renderer7.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; + }, "spacing") }); defineArrowShape("triangle-cross", { points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], @@ -179210,96 +112092,96 @@ g.stateGroup line { 0.15, -0.4 ], - crossLinePts: function crossLinePts(size2, edgeWidth) { - var p2 = this.baseCrossLinePts.slice(); - var shiftFactor = edgeWidth / size2; + crossLinePts: /* @__PURE__ */ __name(function crossLinePts(size5, edgeWidth) { + var p3 = this.baseCrossLinePts.slice(); + var shiftFactor = edgeWidth / size5; var y0 = 3; var y1 = 5; - p2[y0] = p2[y0] - shiftFactor; - p2[y1] = p2[y1] - shiftFactor; - return p2; - }, - collide: function collide(x2, y2, size2, angle, translation, edgeWidth, padding2) { - var triPts = pointsToArr(transformPoints(this.points, size2 + 2 * padding2, angle, translation)); - var teePts = pointsToArr(transformPoints(this.crossLinePts(size2, edgeWidth), size2 + 2 * padding2, angle, translation)); - var inside = pointInsidePolygonPoints(x2, y2, triPts) || pointInsidePolygonPoints(x2, y2, teePts); + p3[y0] = p3[y0] - shiftFactor; + p3[y1] = p3[y1] - shiftFactor; + return p3; + }, "crossLinePts"), + collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) { + var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation)); + var teePts = pointsToArr(transformPoints(this.crossLinePts(size5, edgeWidth), size5 + 2 * padding3, angle2, translation)); + var inside = pointInsidePolygonPoints(x5, y5, triPts) || pointInsidePolygonPoints(x5, y5, teePts); return inside; - }, - draw: function draw2(context, size2, angle, translation, edgeWidth) { - var triPts = transformPoints(this.points, size2, angle, translation); - var crossLinePts = transformPoints(this.crossLinePts(size2, edgeWidth), size2, angle, translation); - renderer3.arrowShapeImpl(this.name)(context, triPts, crossLinePts); - } + }, "collide"), + draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + var triPts = transformPoints(this.points, size5, angle2, translation); + var crossLinePts = transformPoints(this.crossLinePts(size5, edgeWidth), size5, angle2, translation); + renderer7.arrowShapeImpl(this.name)(context, triPts, crossLinePts); + }, "draw") }); defineArrowShape("vee", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], - gap: function gap(edge) { + gap: /* @__PURE__ */ __name(function gap(edge) { return standardGap(edge) * 0.525; - } + }, "gap") }); defineArrowShape("circle", { radius: 0.15, - collide: function collide(x2, y2, size2, angle, translation, edgeWidth, padding2) { - var t = translation; - var inside = Math.pow(t.x - x2, 2) + Math.pow(t.y - y2, 2) <= Math.pow((size2 + 2 * padding2) * this.radius, 2); + collide: /* @__PURE__ */ __name(function collide(x5, y5, size5, angle2, translation, edgeWidth, padding3) { + var t4 = translation; + var inside = Math.pow(t4.x - x5, 2) + Math.pow(t4.y - y5, 2) <= Math.pow((size5 + 2 * padding3) * this.radius, 2); return inside; - }, - draw: function draw2(context, size2, angle, translation, edgeWidth) { - renderer3.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size2); - }, - spacing: function spacing2(edge) { - return renderer3.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; - } + }, "collide"), + draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + renderer7.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size5); + }, "draw"), + spacing: /* @__PURE__ */ __name(function spacing2(edge) { + return renderer7.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; + }, "spacing") }); defineArrowShape("tee", { points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], - spacing: function spacing2(edge) { + spacing: /* @__PURE__ */ __name(function spacing2(edge) { return 1; - }, - gap: function gap(edge) { + }, "spacing"), + gap: /* @__PURE__ */ __name(function gap(edge) { return 1; - } + }, "gap") }); defineArrowShape("square", { points: [-0.15, 0, 0.15, 0, 0.15, -0.3, -0.15, -0.3] }); defineArrowShape("diamond", { points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], - gap: function gap(edge) { + gap: /* @__PURE__ */ __name(function gap(edge) { return edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").value; - } + }, "gap") }); defineArrowShape("chevron", { points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15], - gap: function gap(edge) { + gap: /* @__PURE__ */ __name(function gap(edge) { return 0.95 * edge.pstyle("width").pfValue * edge.pstyle("arrow-scale").value; - } + }, "gap") }); }; - var BRp$e = {}; + BRp$e = {}; BRp$e.projectIntoViewport = function(clientX, clientY) { var cy = this.cy; var offsets = this.findContainerClientCoords(); var offsetLeft = offsets[0]; var offsetTop = offsets[1]; var scale = offsets[4]; - var pan = cy.pan(); - var zoom = cy.zoom(); - var x2 = ((clientX - offsetLeft) / scale - pan.x) / zoom; - var y2 = ((clientY - offsetTop) / scale - pan.y) / zoom; - return [x2, y2]; + var pan2 = cy.pan(); + var zoom2 = cy.zoom(); + var x5 = ((clientX - offsetLeft) / scale - pan2.x) / zoom2; + var y5 = ((clientY - offsetTop) / scale - pan2.y) / zoom2; + return [x5, y5]; }; BRp$e.findContainerClientCoords = function() { if (this.containerBB) { return this.containerBB; } - var container = this.container; - var rect2 = container.getBoundingClientRect(); - var style = this.cy.window().getComputedStyle(container); - var styleValue2 = function styleValue3(name) { - return parseFloat(style.getPropertyValue(name)); - }; - var padding2 = { + var container2 = this.container; + var rect4 = container2.getBoundingClientRect(); + var style3 = this.cy.window().getComputedStyle(container2); + var styleValue2 = /* @__PURE__ */ __name(function styleValue3(name) { + return parseFloat(style3.getPropertyValue(name)); + }, "styleValue"); + var padding3 = { left: styleValue2("padding-left"), right: styleValue2("padding-right"), top: styleValue2("padding-top"), @@ -179311,34 +112193,34 @@ g.stateGroup line { top: styleValue2("border-top-width"), bottom: styleValue2("border-bottom-width") }; - var clientWidth = container.clientWidth; - var clientHeight = container.clientHeight; - var paddingHor = padding2.left + padding2.right; - var paddingVer = padding2.top + padding2.bottom; + var clientWidth = container2.clientWidth; + var clientHeight = container2.clientHeight; + var paddingHor = padding3.left + padding3.right; + var paddingVer = padding3.top + padding3.bottom; var borderHor = border.left + border.right; - var scale = rect2.width / (clientWidth + borderHor); + var scale = rect4.width / (clientWidth + borderHor); var unscaledW = clientWidth - paddingHor; var unscaledH = clientHeight - paddingVer; - var left2 = rect2.left + padding2.left + border.left; - var top2 = rect2.top + padding2.top + border.top; - return this.containerBB = [left2, top2, unscaledW, unscaledH, scale]; + var left3 = rect4.left + padding3.left + border.left; + var top2 = rect4.top + padding3.top + border.top; + return this.containerBB = [left3, top2, unscaledW, unscaledH, scale]; }; BRp$e.invalidateContainerClientCoordsCache = function() { this.containerBB = null; }; - BRp$e.findNearestElement = function(x2, y2, interactiveElementsOnly, isTouch) { - return this.findNearestElements(x2, y2, interactiveElementsOnly, isTouch)[0]; + BRp$e.findNearestElement = function(x5, y5, interactiveElementsOnly, isTouch) { + return this.findNearestElements(x5, y5, interactiveElementsOnly, isTouch)[0]; }; - BRp$e.findNearestElements = function(x2, y2, interactiveElementsOnly, isTouch) { + BRp$e.findNearestElements = function(x5, y5, interactiveElementsOnly, isTouch) { var self2 = this; - var r = this; - var eles = r.getCachedZSortedEles(); + var r2 = this; + var eles = r2.getCachedZSortedEles(); var near = []; - var zoom = r.cy.zoom(); - var hasCompounds = r.cy.hasCompoundNodes(); - var edgeThreshold = (isTouch ? 24 : 8) / zoom; - var nodeThreshold = (isTouch ? 8 : 2) / zoom; - var labelThreshold = (isTouch ? 8 : 2) / zoom; + var zoom2 = r2.cy.zoom(); + var hasCompounds = r2.cy.hasCompoundNodes(); + var edgeThreshold = (isTouch ? 24 : 8) / zoom2; + var nodeThreshold = (isTouch ? 8 : 2) / zoom2; + var labelThreshold = (isTouch ? 8 : 2) / zoom2; var minSqDist = Infinity; var nearEdge; var nearNode; @@ -179357,9 +112239,9 @@ g.stateGroup line { if (ele2.isEdge() && (sqDist == null || sqDist < minSqDist)) { if (nearEdge) { if (nearEdge.pstyle("z-compound-depth").value === ele2.pstyle("z-compound-depth").value && nearEdge.pstyle("z-compound-depth").value === ele2.pstyle("z-compound-depth").value) { - for (var i4 = 0; i4 < near.length; i4++) { - if (near[i4].isEdge()) { - near[i4] = ele2; + for (var i3 = 0; i3 < near.length; i3++) { + if (near[i3].isEdge()) { + near[i3] = ele2; nearEdge = ele2; minSqDist = sqDist != null ? sqDist : minSqDist; break; @@ -179373,43 +112255,47 @@ g.stateGroup line { } } } + __name(addEle, "addEle"); function checkNode(node2) { - var width2 = node2.outerWidth() + 2 * nodeThreshold; - var height = node2.outerHeight() + 2 * nodeThreshold; - var hw = width2 / 2; - var hh = height / 2; + var width3 = node2.outerWidth() + 2 * nodeThreshold; + var height2 = node2.outerHeight() + 2 * nodeThreshold; + var hw = width3 / 2; + var hh = height2 / 2; var pos = node2.position(); - if (pos.x - hw <= x2 && x2 <= pos.x + hw && pos.y - hh <= y2 && y2 <= pos.y + hh) { - var shape = r.nodeShapes[self2.getNodeShape(node2)]; - if (shape.checkPoint(x2, y2, 0, width2, height, pos.x, pos.y)) { + var cornerRadius = node2.pstyle("corner-radius").value === "auto" ? "auto" : node2.pstyle("corner-radius").pfValue; + var rs = node2._private.rscratch; + if (pos.x - hw <= x5 && x5 <= pos.x + hw && pos.y - hh <= y5 && y5 <= pos.y + hh) { + var shape = r2.nodeShapes[self2.getNodeShape(node2)]; + if (shape.checkPoint(x5, y5, 0, width3, height2, pos.x, pos.y, cornerRadius, rs)) { addEle(node2, 0); return true; } } } + __name(checkNode, "checkNode"); function checkEdge(edge) { var _p = edge._private; var rs = _p.rscratch; var styleWidth = edge.pstyle("width").pfValue; var scale = edge.pstyle("arrow-scale").value; - var width2 = styleWidth / 2 + edgeThreshold; - var widthSq = width2 * width2; - var width22 = width2 * 2; + var width3 = styleWidth / 2 + edgeThreshold; + var widthSq = width3 * width3; + var width22 = width3 * 2; var src = _p.source; var tgt = _p.target; var sqDist; if (rs.edgeType === "segments" || rs.edgeType === "straight" || rs.edgeType === "haystack") { var pts2 = rs.allpts; - for (var i4 = 0; i4 + 3 < pts2.length; i4 += 2) { - if (inLineVicinity(x2, y2, pts2[i4], pts2[i4 + 1], pts2[i4 + 2], pts2[i4 + 3], width22) && widthSq > (sqDist = sqdistToFiniteLine(x2, y2, pts2[i4], pts2[i4 + 1], pts2[i4 + 2], pts2[i4 + 3]))) { + for (var i3 = 0; i3 + 3 < pts2.length; i3 += 2) { + if (inLineVicinity(x5, y5, pts2[i3], pts2[i3 + 1], pts2[i3 + 2], pts2[i3 + 3], width22) && widthSq > (sqDist = sqdistToFiniteLine(x5, y5, pts2[i3], pts2[i3 + 1], pts2[i3 + 2], pts2[i3 + 3]))) { addEle(edge, sqDist); return true; } } } else if (rs.edgeType === "bezier" || rs.edgeType === "multibezier" || rs.edgeType === "self" || rs.edgeType === "compound") { var pts2 = rs.allpts; - for (var i4 = 0; i4 + 5 < rs.allpts.length; i4 += 4) { - if (inBezierVicinity(x2, y2, pts2[i4], pts2[i4 + 1], pts2[i4 + 2], pts2[i4 + 3], pts2[i4 + 4], pts2[i4 + 5], width22) && widthSq > (sqDist = sqdistToQuadraticBezier(x2, y2, pts2[i4], pts2[i4 + 1], pts2[i4 + 2], pts2[i4 + 3], pts2[i4 + 4], pts2[i4 + 5]))) { + for (var i3 = 0; i3 + 5 < rs.allpts.length; i3 += 4) { + if (inBezierVicinity(x5, y5, pts2[i3], pts2[i3 + 1], pts2[i3 + 2], pts2[i3 + 3], pts2[i3 + 4], pts2[i3 + 5], width22) && widthSq > (sqDist = sqdistToQuadraticBezier(x5, y5, pts2[i3], pts2[i3 + 1], pts2[i3 + 2], pts2[i3 + 3], pts2[i3 + 4], pts2[i3 + 5]))) { addEle(edge, sqDist); return true; } @@ -179418,7 +112304,7 @@ g.stateGroup line { var src = src || _p.source; var tgt = tgt || _p.target; var arSize = self2.getArrowWidth(styleWidth, scale); - var arrows2 = [{ + var arrows = [{ name: "source", x: rs.arrowStartX, y: rs.arrowStartY, @@ -179439,14 +112325,14 @@ g.stateGroup line { y: rs.midY, angle: rs.midtgtArrowAngle }]; - for (var i4 = 0; i4 < arrows2.length; i4++) { - var ar = arrows2[i4]; - var shape = r.arrowShapes[edge.pstyle(ar.name + "-arrow-shape").value]; + for (var i3 = 0; i3 < arrows.length; i3++) { + var ar = arrows[i3]; + var shape = r2.arrowShapes[edge.pstyle(ar.name + "-arrow-shape").value]; var edgeWidth = edge.pstyle("width").pfValue; - if (shape.roughCollide(x2, y2, arSize, ar.angle, { + if (shape.roughCollide(x5, y5, arSize, ar.angle, { x: ar.x, y: ar.y - }, edgeWidth, edgeThreshold) && shape.collide(x2, y2, arSize, ar.angle, { + }, edgeWidth, edgeThreshold) && shape.collide(x5, y5, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold)) { @@ -179459,9 +112345,11 @@ g.stateGroup line { checkNode(tgt); } } + __name(checkEdge, "checkEdge"); function preprop(obj, name, pre) { return getPrefixedProperty(obj, name, pre); } + __name(preprop, "preprop"); function checkLabel(ele2, prefix) { var _p = ele2._private; var th = labelThreshold; @@ -179490,14 +112378,14 @@ g.stateGroup line { if (theta) { var cos3 = Math.cos(theta); var sin3 = Math.sin(theta); - var rotate = function rotate2(x3, y3) { - x3 = x3 - lx; - y3 = y3 - ly; + var rotate = /* @__PURE__ */ __name(function rotate2(x6, y6) { + x6 = x6 - lx; + y6 = y6 - ly; return { - x: x3 * cos3 - y3 * sin3 + lx, - y: x3 * sin3 + y3 * cos3 + ly + x: x6 * cos3 - y6 * sin3 + lx, + y: x6 * sin3 + y6 * cos3 + ly }; - }; + }, "rotate"); var px1y1 = rotate(lx1, ly1); var px1y2 = rotate(lx1, ly2); var px2y1 = rotate(lx2, ly1); @@ -179513,19 +112401,20 @@ g.stateGroup line { px1y2.x + ox, px1y2.y + oy ]; - if (pointInsidePolygonPoints(x2, y2, points)) { + if (pointInsidePolygonPoints(x5, y5, points)) { addEle(ele2); return true; } } else { - if (inBoundingBox(bb, x2, y2)) { + if (inBoundingBox(bb, x5, y5)) { addEle(ele2); return true; } } } - for (var i3 = eles.length - 1; i3 >= 0; i3--) { - var ele = eles[i3]; + __name(checkLabel, "checkLabel"); + for (var i2 = eles.length - 1; i2 >= 0; i2--) { + var ele = eles[i2]; if (ele.isNode()) { checkNode(ele) || checkLabel(ele); } else { @@ -179534,25 +112423,25 @@ g.stateGroup line { } return near; }; - BRp$e.getAllInBox = function(x1, y1, x2, y2) { + BRp$e.getAllInBox = function(x1, y1, x22, y22) { var eles = this.getCachedZSortedEles().interactive; var box = []; - var x1c = Math.min(x1, x2); - var x2c = Math.max(x1, x2); - var y1c = Math.min(y1, y2); - var y2c = Math.max(y1, y2); + var x1c = Math.min(x1, x22); + var x2c = Math.max(x1, x22); + var y1c = Math.min(y1, y22); + var y2c = Math.max(y1, y22); x1 = x1c; - x2 = x2c; + x22 = x2c; y1 = y1c; - y2 = y2c; + y22 = y2c; var boxBb = makeBoundingBox({ x1, y1, - x2, - y2 + x2: x22, + y2: y22 }); - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; + for (var e3 = 0; e3 < eles.length; e3++) { + var ele = eles[e3]; if (ele.isNode()) { var node2 = ele; var nodeBb = node2.boundingBox({ @@ -179576,8 +112465,8 @@ g.stateGroup line { if (rs.edgeType === "bezier" || rs.edgeType === "multibezier" || rs.edgeType === "self" || rs.edgeType === "compound" || rs.edgeType === "segments" || rs.edgeType === "haystack") { var pts2 = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts; var allInside = true; - for (var i3 = 0; i3 < pts2.length; i3++) { - if (!pointInBoundingBox(boxBb, pts2[i3])) { + for (var i2 = 0; i2 < pts2.length; i2++) { + if (!pointInBoundingBox(boxBb, pts2[i2])) { allInside = false; break; } @@ -179592,7 +112481,7 @@ g.stateGroup line { } return box; }; - var BRp$d = {}; + BRp$d = {}; BRp$d.calculateArrowAngles = function(edge) { var rs = edge._private.rscratch; var isHaystack = rs.edgeType === "haystack"; @@ -179602,55 +112491,57 @@ g.stateGroup line { var isCompound = rs.edgeType === "compound"; var isSelf = rs.edgeType === "self"; var dispX, dispY; - var startX, startY, endX, endY, midX, midY; + var startX2, startY2, endX, endY, midX, midY; if (isHaystack) { - startX = rs.haystackPts[0]; - startY = rs.haystackPts[1]; + startX2 = rs.haystackPts[0]; + startY2 = rs.haystackPts[1]; endX = rs.haystackPts[2]; endY = rs.haystackPts[3]; } else { - startX = rs.arrowStartX; - startY = rs.arrowStartY; + startX2 = rs.arrowStartX; + startY2 = rs.arrowStartY; endX = rs.arrowEndX; endY = rs.arrowEndY; } midX = rs.midX; midY = rs.midY; if (isSegments) { - dispX = startX - rs.segpts[0]; - dispY = startY - rs.segpts[1]; + dispX = startX2 - rs.segpts[0]; + dispY = startY2 - rs.segpts[1]; } else if (isMultibezier || isCompound || isSelf || isBezier) { var pts2 = rs.allpts; var bX = qbezierAt(pts2[0], pts2[2], pts2[4], 0.1); var bY = qbezierAt(pts2[1], pts2[3], pts2[5], 0.1); - dispX = startX - bX; - dispY = startY - bY; + dispX = startX2 - bX; + dispY = startY2 - bY; } else { - dispX = startX - midX; - dispY = startY - midY; + dispX = startX2 - midX; + dispY = startY2 - midY; } rs.srcArrowAngle = getAngleFromDisp(dispX, dispY); var midX = rs.midX; var midY = rs.midY; if (isHaystack) { - midX = (startX + endX) / 2; - midY = (startY + endY) / 2; + midX = (startX2 + endX) / 2; + midY = (startY2 + endY) / 2; } - dispX = endX - startX; - dispY = endY - startY; + dispX = endX - startX2; + dispY = endY - startY2; if (isSegments) { var pts2 = rs.allpts; if (pts2.length / 2 % 2 === 0) { - var i22 = pts2.length / 2; - var i1 = i22 - 2; - dispX = pts2[i22] - pts2[i1]; - dispY = pts2[i22 + 1] - pts2[i1 + 1]; + var i2 = pts2.length / 2; + var i1 = i2 - 2; + dispX = pts2[i2] - pts2[i1]; + dispY = pts2[i2 + 1] - pts2[i1 + 1]; + } else if (rs.isRound) { + dispX = rs.midVector[1]; + dispY = -rs.midVector[0]; } else { - var i22 = pts2.length / 2 - 1; - var i1 = i22 - 2; - var i3 = i22 + 2; - dispX = pts2[i22] - pts2[i1]; - dispY = pts2[i22 + 1] - pts2[i1 + 1]; + var i2 = pts2.length / 2 - 1; + var i1 = i2 - 2; + dispX = pts2[i2] - pts2[i1]; + dispY = pts2[i2 + 1] - pts2[i1 + 1]; } } else if (isMultibezier || isCompound || isSelf) { var pts2 = rs.allpts; @@ -179684,13 +112575,12 @@ g.stateGroup line { dispY *= -1; if (isSegments) { var pts2 = rs.allpts; - if (pts2.length / 2 % 2 === 0) - ; - else { - var i22 = pts2.length / 2 - 1; - var i3 = i22 + 2; - dispX = -(pts2[i3] - pts2[i22]); - dispY = -(pts2[i3 + 1] - pts2[i22 + 1]); + if (pts2.length / 2 % 2 === 0) ; + else if (!rs.isRound) { + var i2 = pts2.length / 2 - 1; + var i3 = i2 + 2; + dispX = -(pts2[i3] - pts2[i2]); + dispY = -(pts2[i3 + 1] - pts2[i2 + 1]); } } rs.midsrcArrowAngle = getAngleFromDisp(dispX, dispY); @@ -179699,9 +112589,9 @@ g.stateGroup line { dispY = endY - rs.segpts[rs.segpts.length - 1]; } else if (isMultibezier || isCompound || isSelf || isBezier) { var pts2 = rs.allpts; - var l = pts2.length; - var bX = qbezierAt(pts2[l - 6], pts2[l - 4], pts2[l - 2], 0.9); - var bY = qbezierAt(pts2[l - 5], pts2[l - 3], pts2[l - 1], 0.9); + var l2 = pts2.length; + var bX = qbezierAt(pts2[l2 - 6], pts2[l2 - 4], pts2[l2 - 2], 0.9); + var bY = qbezierAt(pts2[l2 - 5], pts2[l2 - 3], pts2[l2 - 1], 0.9); dispX = endX - bX; dispY = endY - bY; } else { @@ -179711,31 +112601,105 @@ g.stateGroup line { rs.tgtArrowAngle = getAngleFromDisp(dispX, dispY); }; BRp$d.getArrowWidth = BRp$d.getArrowHeight = function(edgeWidth, scale) { - var cache2 = this.arrowWidthCache = this.arrowWidthCache || {}; - var cachedVal = cache2[edgeWidth + ", " + scale]; + var cache3 = this.arrowWidthCache = this.arrowWidthCache || {}; + var cachedVal = cache3[edgeWidth + ", " + scale]; if (cachedVal) { return cachedVal; } cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale; - cache2[edgeWidth + ", " + scale] = cachedVal; + cache3[edgeWidth + ", " + scale] = cachedVal; return cachedVal; }; - var BRp$c = {}; + v1 = {}; + v2 = {}; + asVec = /* @__PURE__ */ __name(function asVec2(p3, pp, v3) { + v3.x = pp.x - p3.x; + v3.y = pp.y - p3.y; + v3.len = Math.sqrt(v3.x * v3.x + v3.y * v3.y); + v3.nx = v3.x / v3.len; + v3.ny = v3.y / v3.len; + v3.ang = Math.atan2(v3.ny, v3.nx); + }, "asVec"); + invertVec = /* @__PURE__ */ __name(function invertVec2(originalV, invertedV) { + invertedV.x = originalV.x * -1; + invertedV.y = originalV.y * -1; + invertedV.nx = originalV.nx * -1; + invertedV.ny = originalV.ny * -1; + invertedV.ang = originalV.ang > 0 ? -(Math.PI - originalV.ang) : Math.PI + originalV.ang; + }, "invertVec"); + calcCornerArc = /* @__PURE__ */ __name(function calcCornerArc2(previousPoint, currentPoint, nextPoint, radiusMax, isArcRadius) { + previousPoint !== lastPoint ? asVec(currentPoint, previousPoint, v1) : invertVec(v2, v1); + asVec(currentPoint, nextPoint, v2); + sinA = v1.nx * v2.ny - v1.ny * v2.nx; + sinA90 = v1.nx * v2.nx - v1.ny * -v2.ny; + angle = Math.asin(Math.max(-1, Math.min(1, sinA))); + if (Math.abs(angle) < 1e-6) { + x3 = currentPoint.x; + y3 = currentPoint.y; + cRadius = radius = 0; + return; + } + radDirection = 1; + drawDirection = false; + if (sinA90 < 0) { + if (angle < 0) { + angle = Math.PI + angle; + } else { + angle = Math.PI - angle; + radDirection = -1; + drawDirection = true; + } + } else { + if (angle > 0) { + radDirection = -1; + drawDirection = true; + } + } + if (currentPoint.radius !== void 0) { + radius = currentPoint.radius; + } else { + radius = radiusMax; + } + halfAngle = angle / 2; + limit = Math.min(v1.len / 2, v2.len / 2); + if (isArcRadius) { + lenOut = Math.abs(Math.cos(halfAngle) * radius / Math.sin(halfAngle)); + if (lenOut > limit) { + lenOut = limit; + cRadius = Math.abs(lenOut * Math.sin(halfAngle) / Math.cos(halfAngle)); + } else { + cRadius = radius; + } + } else { + lenOut = Math.min(limit, radius); + cRadius = Math.abs(lenOut * Math.sin(halfAngle) / Math.cos(halfAngle)); + } + stopX = currentPoint.x + v2.nx * lenOut; + stopY = currentPoint.y + v2.ny * lenOut; + x3 = stopX - v2.ny * cRadius * radDirection; + y3 = stopY + v2.nx * cRadius * radDirection; + startX = currentPoint.x + v1.nx * lenOut; + startY = currentPoint.y + v1.ny * lenOut; + lastPoint = currentPoint; + }, "calcCornerArc"); + __name(drawPreparedRoundCorner, "drawPreparedRoundCorner"); + __name(getRoundCorner, "getRoundCorner"); + BRp$c = {}; BRp$c.findMidptPtsEtc = function(edge, pairInfo) { var posPts = pairInfo.posPts, intersectionPts = pairInfo.intersectionPts, vectorNormInverse = pairInfo.vectorNormInverse; var midptPts; var srcManEndpt = edge.pstyle("source-endpoint"); var tgtManEndpt = edge.pstyle("target-endpoint"); var haveManualEndPts = srcManEndpt.units != null && tgtManEndpt.units != null; - var recalcVectorNormInverse = function recalcVectorNormInverse2(x12, y12, x22, y22) { - var dy = y22 - y12; - var dx = x22 - x12; - var l = Math.sqrt(dx * dx + dy * dy); + var recalcVectorNormInverse = /* @__PURE__ */ __name(function recalcVectorNormInverse2(x12, y12, x23, y23) { + var dy = y23 - y12; + var dx = x23 - x12; + var l2 = Math.sqrt(dx * dx + dy * dy); return { - x: -dy / l, - y: dx / l + x: -dy / l2, + y: dx / l2 }; - }; + }, "recalcVectorNormInverse"); var edgeDistances = edge.pstyle("edge-distances").value; switch (edgeDistances) { case "node-position": @@ -179747,14 +112711,14 @@ g.stateGroup line { case "endpoints": { if (haveManualEndPts) { var _this$manualEndptToPx = this.manualEndptToPx(edge.source()[0], srcManEndpt), _this$manualEndptToPx2 = _slicedToArray(_this$manualEndptToPx, 2), x1 = _this$manualEndptToPx2[0], y1 = _this$manualEndptToPx2[1]; - var _this$manualEndptToPx3 = this.manualEndptToPx(edge.target()[0], tgtManEndpt), _this$manualEndptToPx4 = _slicedToArray(_this$manualEndptToPx3, 2), x2 = _this$manualEndptToPx4[0], y2 = _this$manualEndptToPx4[1]; + var _this$manualEndptToPx3 = this.manualEndptToPx(edge.target()[0], tgtManEndpt), _this$manualEndptToPx4 = _slicedToArray(_this$manualEndptToPx3, 2), x22 = _this$manualEndptToPx4[0], y22 = _this$manualEndptToPx4[1]; var endPts = { x1, y1, - x2, - y2 + x2: x22, + y2: y22 }; - vectorNormInverse = recalcVectorNormInverse(x1, y1, x2, y2); + vectorNormInverse = recalcVectorNormInverse(x1, y1, x22, y22); midptPts = endPts; } else { warn("Edge ".concat(edge.id(), " has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")); @@ -179768,21 +112732,21 @@ g.stateGroup line { vectorNormInverse }; }; - BRp$c.findHaystackPoints = function(edges2) { - for (var i3 = 0; i3 < edges2.length; i3++) { - var edge = edges2[i3]; + BRp$c.findHaystackPoints = function(edges5) { + for (var i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; var _p = edge._private; var rs = _p.rscratch; if (!rs.haystack) { - var angle = Math.random() * 2 * Math.PI; + var angle2 = Math.random() * 2 * Math.PI; rs.source = { - x: Math.cos(angle), - y: Math.sin(angle) + x: Math.cos(angle2), + y: Math.sin(angle2) }; - angle = Math.random() * 2 * Math.PI; + angle2 = Math.random() * 2 * Math.PI; rs.target = { - x: Math.cos(angle), - y: Math.sin(angle) + x: Math.cos(angle2), + y: Math.sin(angle2) }; } var src = _p.source; @@ -179793,8 +112757,8 @@ g.stateGroup line { var tgtW = tgt.width(); var srcH = src.height(); var tgtH = tgt.height(); - var radius = edge.pstyle("haystack-radius").value; - var halfRadius = radius / 2; + var radius2 = edge.pstyle("haystack-radius").value; + var halfRadius = radius2 / 2; rs.haystackPts = rs.allpts = [rs.source.x * srcW * halfRadius + srcPos.x, rs.source.y * srcH * halfRadius + srcPos.y, rs.target.x * tgtW * halfRadius + tgtPos.x, rs.target.y * tgtH * halfRadius + tgtPos.y]; rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2; rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; @@ -179810,23 +112774,31 @@ g.stateGroup line { var rs = edge._private.rscratch; var segmentWs = edge.pstyle("segment-weights"); var segmentDs = edge.pstyle("segment-distances"); + var segmentRs = edge.pstyle("segment-radii"); + var segmentTs = edge.pstyle("radius-type"); var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length); + var lastRadius = segmentRs.pfValue[segmentRs.pfValue.length - 1]; + var lastRadiusType = segmentTs.pfValue[segmentTs.pfValue.length - 1]; rs.edgeType = "segments"; rs.segpts = []; - for (var s = 0; s < segmentsN; s++) { - var w2 = segmentWs.pfValue[s]; - var d = segmentDs.pfValue[s]; - var w1 = 1 - w2; - var w22 = w2; + rs.radii = []; + rs.isArcRadius = []; + for (var s2 = 0; s2 < segmentsN; s2++) { + var w3 = segmentWs.pfValue[s2]; + var d2 = segmentDs.pfValue[s2]; + var w1 = 1 - w3; + var w22 = w3; var _this$findMidptPtsEtc = this.findMidptPtsEtc(edge, pairInfo), midptPts = _this$findMidptPtsEtc.midptPts, vectorNormInverse = _this$findMidptPtsEtc.vectorNormInverse; var adjustedMidpt = { x: midptPts.x1 * w1 + midptPts.x2 * w22, y: midptPts.y1 * w1 + midptPts.y2 * w22 }; - rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d, adjustedMidpt.y + vectorNormInverse.y * d); + rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d2, adjustedMidpt.y + vectorNormInverse.y * d2); + rs.radii.push(segmentRs.pfValue[s2] !== void 0 ? segmentRs.pfValue[s2] : lastRadius); + rs.isArcRadius.push((segmentTs.pfValue[s2] !== void 0 ? segmentTs.pfValue[s2] : lastRadiusType) === "arc-radius"); } }; - BRp$c.findLoopPoints = function(edge, pairInfo, i3, edgeIsUnbundled) { + BRp$c.findLoopPoints = function(edge, pairInfo, i2, edgeIsUnbundled) { var rs = edge._private.rscratch; var dirCounts = pairInfo.dirCounts, srcPos = pairInfo.srcPos; var ctrlptDists = edge.pstyle("control-point-distances"); @@ -179835,30 +112807,30 @@ g.stateGroup line { var loopSwp = edge.pstyle("loop-sweep").pfValue; var stepSize = edge.pstyle("control-point-step-size").pfValue; rs.edgeType = "self"; - var j = i3; + var j2 = i2; var loopDist = stepSize; if (edgeIsUnbundled) { - j = 0; + j2 = 0; loopDist = ctrlptDist; } var loopAngle = loopDir - Math.PI / 2; var outAngle = loopAngle - loopSwp / 2; var inAngle = loopAngle + loopSwp / 2; var dc = String(loopDir + "_" + loopSwp); - j = dirCounts[dc] === void 0 ? dirCounts[dc] = 0 : ++dirCounts[dc]; - rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1)]; + j2 = dirCounts[dc] === void 0 ? dirCounts[dc] = 0 : ++dirCounts[dc]; + rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j2 / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j2 / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j2 / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j2 / 3 + 1)]; }; - BRp$c.findCompoundLoopPoints = function(edge, pairInfo, i3, edgeIsUnbundled) { + BRp$c.findCompoundLoopPoints = function(edge, pairInfo, i2, edgeIsUnbundled) { var rs = edge._private.rscratch; rs.edgeType = "compound"; var srcPos = pairInfo.srcPos, tgtPos = pairInfo.tgtPos, srcW = pairInfo.srcW, srcH = pairInfo.srcH, tgtW = pairInfo.tgtW, tgtH = pairInfo.tgtH; var stepSize = edge.pstyle("control-point-step-size").pfValue; var ctrlptDists = edge.pstyle("control-point-distances"); var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : void 0; - var j = i3; + var j2 = i2; var loopDist = stepSize; if (edgeIsUnbundled) { - j = 0; + j2 = 0; loopDist = ctrlptDist; } var loopW = 50; @@ -179877,12 +112849,12 @@ g.stateGroup line { var minCompoundStretch = 0.5; var compoundStretchA = Math.max(minCompoundStretch, Math.log(srcW * 0.01)); var compoundStretchB = Math.max(minCompoundStretch, Math.log(tgtW * 0.01)); - rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, loopPos.y]; + rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j2 / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j2 / 3 + 1) * compoundStretchB, loopPos.y]; }; BRp$c.findStraightEdgePoints = function(edge) { edge._private.rscratch.edgeType = "straight"; }; - BRp$c.findBezierPoints = function(edge, pairInfo, i3, edgeIsUnbundled, edgeIsSwapped) { + BRp$c.findBezierPoints = function(edge, pairInfo, i2, edgeIsUnbundled, edgeIsSwapped) { var rs = edge._private.rscratch; var stepSize = edge.pstyle("control-point-step-size").pfValue; var ctrlptDists = edge.pstyle("control-point-distances"); @@ -179893,13 +112865,13 @@ g.stateGroup line { var multi = edgeIsUnbundled; rs.edgeType = multi ? "multibezier" : "bezier"; rs.ctrlpts = []; - for (var b = 0; b < bezierN; b++) { - var normctrlptDist = (0.5 - pairInfo.eles.length / 2 + i3) * stepSize * (edgeIsSwapped ? -1 : 1); + for (var b2 = 0; b2 < bezierN; b2++) { + var normctrlptDist = (0.5 - pairInfo.eles.length / 2 + i2) * stepSize * (edgeIsSwapped ? -1 : 1); var manctrlptDist = void 0; var sign2 = signum(normctrlptDist); if (multi) { - ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; - ctrlptWeight = ctrlptWs.value[b]; + ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b2] : stepSize; + ctrlptWeight = ctrlptWs.value[b2]; } if (edgeIsUnbundled) { manctrlptDist = ctrlptDist; @@ -179908,11 +112880,11 @@ g.stateGroup line { } var distanceFromMidpoint = manctrlptDist !== void 0 ? manctrlptDist : normctrlptDist; var w1 = 1 - ctrlptWeight; - var w2 = ctrlptWeight; + var w22 = ctrlptWeight; var _this$findMidptPtsEtc2 = this.findMidptPtsEtc(edge, pairInfo), midptPts = _this$findMidptPtsEtc2.midptPts, vectorNormInverse = _this$findMidptPtsEtc2.vectorNormInverse; var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 + x: midptPts.x1 * w1 + midptPts.x2 * w22, + y: midptPts.y1 * w1 + midptPts.y2 * w22 }; rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint); } @@ -179941,13 +112913,13 @@ g.stateGroup line { var dh = dIncludesNodeBody ? (srcH + tgtH) / 2 : 0; var pdx = posPts.x2 - posPts.x1; var pdy = posPts.y2 - posPts.y1; - var subDWH = function subDWH2(dxy, dwh) { + var subDWH = /* @__PURE__ */ __name(function subDWH2(dxy, dwh) { if (dxy > 0) { return Math.max(dxy - dwh, 0); } else { return Math.min(dxy + dwh, 0); } - }; + }, "subDWH"); var dx = subDWH(pdx, dw); var dy = subDWH(pdy, dh); var isExplicitDir = false; @@ -179961,41 +112933,41 @@ g.stateGroup line { isExplicitDir = true; } var isVert = taxiDir === VERTICAL; - var l = isVert ? dy : dx; + var l2 = isVert ? dy : dx; var pl = isVert ? pdy : pdx; var sgnL = signum(pl); var forcedDir = false; if (!(isExplicitDir && (turnIsPercent || turnIsNegative)) && (rawTaxiDir === DOWNWARD && pl < 0 || rawTaxiDir === UPWARD && pl > 0 || rawTaxiDir === LEFTWARD && pl > 0 || rawTaxiDir === RIGHTWARD && pl < 0)) { sgnL *= -1; - l = sgnL * Math.abs(l); + l2 = sgnL * Math.abs(l2); forcedDir = true; } - var d; + var d2; if (turnIsPercent) { - var p2 = taxiTurnPfVal < 0 ? 1 + taxiTurnPfVal : taxiTurnPfVal; - d = p2 * l; + var p3 = taxiTurnPfVal < 0 ? 1 + taxiTurnPfVal : taxiTurnPfVal; + d2 = p3 * l2; } else { - var k = taxiTurnPfVal < 0 ? l : 0; - d = k + taxiTurnPfVal * sgnL; - } - var getIsTooClose = function getIsTooClose2(d2) { - return Math.abs(d2) < minD || Math.abs(d2) >= Math.abs(l); - }; - var isTooCloseSrc = getIsTooClose(d); - var isTooCloseTgt = getIsTooClose(Math.abs(l) - Math.abs(d)); + var k2 = taxiTurnPfVal < 0 ? l2 : 0; + d2 = k2 + taxiTurnPfVal * sgnL; + } + var getIsTooClose = /* @__PURE__ */ __name(function getIsTooClose2(d3) { + return Math.abs(d3) < minD || Math.abs(d3) >= Math.abs(l2); + }, "getIsTooClose"); + var isTooCloseSrc = getIsTooClose(d2); + var isTooCloseTgt = getIsTooClose(Math.abs(l2) - Math.abs(d2)); var isTooClose = isTooCloseSrc || isTooCloseTgt; if (isTooClose && !forcedDir) { if (isVert) { var lShapeInsideSrc = Math.abs(pl) <= srcH / 2; var lShapeInsideTgt = Math.abs(pdx) <= tgtW / 2; if (lShapeInsideSrc) { - var x2 = (posPts.x1 + posPts.x2) / 2; - var y1 = posPts.y1, y2 = posPts.y2; - rs.segpts = [x2, y1, x2, y2]; + var x5 = (posPts.x1 + posPts.x2) / 2; + var y1 = posPts.y1, y22 = posPts.y2; + rs.segpts = [x5, y1, x5, y22]; } else if (lShapeInsideTgt) { - var y3 = (posPts.y1 + posPts.y2) / 2; + var y5 = (posPts.y1 + posPts.y2) / 2; var x1 = posPts.x1, x22 = posPts.x2; - rs.segpts = [x1, y3, x22, y3]; + rs.segpts = [x1, y5, x22, y5]; } else { rs.segpts = [posPts.x1, posPts.y2]; } @@ -180016,28 +112988,34 @@ g.stateGroup line { } } else { if (isVert) { - var _y4 = posPts.y1 + d + (dIncludesNodeBody ? srcH / 2 * sgnL : 0); + var _y4 = posPts.y1 + d2 + (dIncludesNodeBody ? srcH / 2 * sgnL : 0); var _x4 = posPts.x1, _x5 = posPts.x2; rs.segpts = [_x4, _y4, _x5, _y4]; } else { - var _x6 = posPts.x1 + d + (dIncludesNodeBody ? srcW / 2 * sgnL : 0); + var _x6 = posPts.x1 + d2 + (dIncludesNodeBody ? srcW / 2 * sgnL : 0); var _y5 = posPts.y1, _y6 = posPts.y2; rs.segpts = [_x6, _y5, _x6, _y6]; } } + if (rs.isRound) { + var radius2 = edge.pstyle("taxi-radius").value; + var isArcRadius = edge.pstyle("radius-type").value[0] === "arc-radius"; + rs.radii = new Array(rs.segpts.length / 2).fill(radius2); + rs.isArcRadius = new Array(rs.segpts.length / 2).fill(isArcRadius); + } }; BRp$c.tryToCorrectInvalidPoints = function(edge, pairInfo) { var rs = edge._private.rscratch; if (rs.edgeType === "bezier") { - var srcPos = pairInfo.srcPos, tgtPos = pairInfo.tgtPos, srcW = pairInfo.srcW, srcH = pairInfo.srcH, tgtW = pairInfo.tgtW, tgtH = pairInfo.tgtH, srcShape = pairInfo.srcShape, tgtShape = pairInfo.tgtShape; - var badStart = !number$12(rs.startX) || !number$12(rs.startY); - var badAStart = !number$12(rs.arrowStartX) || !number$12(rs.arrowStartY); - var badEnd = !number$12(rs.endX) || !number$12(rs.endY); - var badAEnd = !number$12(rs.arrowEndX) || !number$12(rs.arrowEndY); + var srcPos = pairInfo.srcPos, tgtPos = pairInfo.tgtPos, srcW = pairInfo.srcW, srcH = pairInfo.srcH, tgtW = pairInfo.tgtW, tgtH = pairInfo.tgtH, srcShape = pairInfo.srcShape, tgtShape = pairInfo.tgtShape, srcCornerRadius = pairInfo.srcCornerRadius, tgtCornerRadius = pairInfo.tgtCornerRadius, srcRs = pairInfo.srcRs, tgtRs = pairInfo.tgtRs; + var badStart = !number$1(rs.startX) || !number$1(rs.startY); + var badAStart = !number$1(rs.arrowStartX) || !number$1(rs.arrowStartY); + var badEnd = !number$1(rs.endX) || !number$1(rs.endY); + var badAEnd = !number$1(rs.arrowEndX) || !number$1(rs.arrowEndY); var minCpADistFactor = 3; var arrowW = this.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.arrowShapeWidth; var minCpADist = minCpADistFactor * arrowW; - var startACpDist = dist2({ + var startACpDist = dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { @@ -180045,7 +113023,7 @@ g.stateGroup line { y: rs.startY }); var closeStartACp = startACpDist < minCpADist; - var endACpDist = dist2({ + var endACpDist = dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { @@ -180067,13 +113045,13 @@ g.stateGroup line { x: cpD.x / cpL, y: cpD.y / cpL }; - var radius = Math.max(srcW, srcH); + var radius2 = Math.max(srcW, srcH); var cpProj = { // *2 radius guarantees outside shape - x: rs.ctrlpts[0] + cpM.x * 2 * radius, - y: rs.ctrlpts[1] + cpM.y * 2 * radius + x: rs.ctrlpts[0] + cpM.x * 2 * radius2, + y: rs.ctrlpts[1] + cpM.y * 2 * radius2 }; - var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0); + var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0, srcCornerRadius, srcRs); if (closeStartACp) { rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); @@ -180101,7 +113079,7 @@ g.stateGroup line { x: rs.ctrlpts[0] + _cpM.x * 2 * _radius, y: rs.ctrlpts[1] + _cpM.y * 2 * _radius }; - var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, _cpProj.x, _cpProj.y, 0); + var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, _cpProj.x, _cpProj.y, 0, tgtCornerRadius, tgtRs); if (closeEndACp) { rs.ctrlpts[0] = rs.ctrlpts[0] + _cpM.x * (minCpADist - endACpDist); rs.ctrlpts[1] = rs.ctrlpts[1] + _cpM.y * (minCpADist - endACpDist); @@ -180120,23 +113098,23 @@ g.stateGroup line { if (rs.edgeType === "multibezier" || rs.edgeType === "bezier" || rs.edgeType === "self" || rs.edgeType === "compound") { rs.allpts = []; rs.allpts.push(rs.startX, rs.startY); - for (var b = 0; b + 1 < rs.ctrlpts.length; b += 2) { - rs.allpts.push(rs.ctrlpts[b], rs.ctrlpts[b + 1]); - if (b + 3 < rs.ctrlpts.length) { - rs.allpts.push((rs.ctrlpts[b] + rs.ctrlpts[b + 2]) / 2, (rs.ctrlpts[b + 1] + rs.ctrlpts[b + 3]) / 2); + for (var b2 = 0; b2 + 1 < rs.ctrlpts.length; b2 += 2) { + rs.allpts.push(rs.ctrlpts[b2], rs.ctrlpts[b2 + 1]); + if (b2 + 3 < rs.ctrlpts.length) { + rs.allpts.push((rs.ctrlpts[b2] + rs.ctrlpts[b2 + 2]) / 2, (rs.ctrlpts[b2 + 1] + rs.ctrlpts[b2 + 3]) / 2); } } rs.allpts.push(rs.endX, rs.endY); - var m, mt; + var m2, mt; if (rs.ctrlpts.length / 2 % 2 === 0) { - m = rs.allpts.length / 2 - 1; - rs.midX = rs.allpts[m]; - rs.midY = rs.allpts[m + 1]; + m2 = rs.allpts.length / 2 - 1; + rs.midX = rs.allpts[m2]; + rs.midY = rs.allpts[m2 + 1]; } else { - m = rs.allpts.length / 2 - 3; + m2 = rs.allpts.length / 2 - 3; mt = 0.5; - rs.midX = qbezierAt(rs.allpts[m], rs.allpts[m + 2], rs.allpts[m + 4], mt); - rs.midY = qbezierAt(rs.allpts[m + 1], rs.allpts[m + 3], rs.allpts[m + 5], mt); + rs.midX = qbezierAt(rs.allpts[m2], rs.allpts[m2 + 2], rs.allpts[m2 + 4], mt); + rs.midY = qbezierAt(rs.allpts[m2 + 1], rs.allpts[m2 + 3], rs.allpts[m2 + 5], mt); } } else if (rs.edgeType === "straight") { rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; @@ -180147,21 +113125,55 @@ g.stateGroup line { rs.allpts.push(rs.startX, rs.startY); rs.allpts.push.apply(rs.allpts, rs.segpts); rs.allpts.push(rs.endX, rs.endY); + if (rs.isRound) { + rs.roundCorners = []; + for (var i2 = 2; i2 + 3 < rs.allpts.length; i2 += 2) { + var radius2 = rs.radii[i2 / 2 - 1]; + var isArcRadius = rs.isArcRadius[i2 / 2 - 1]; + rs.roundCorners.push(getRoundCorner({ + x: rs.allpts[i2 - 2], + y: rs.allpts[i2 - 1] + }, { + x: rs.allpts[i2], + y: rs.allpts[i2 + 1], + radius: radius2 + }, { + x: rs.allpts[i2 + 2], + y: rs.allpts[i2 + 3] + }, radius2, isArcRadius)); + } + } if (rs.segpts.length % 4 === 0) { var i22 = rs.segpts.length / 2; var i1 = i22 - 2; rs.midX = (rs.segpts[i1] + rs.segpts[i22]) / 2; rs.midY = (rs.segpts[i1 + 1] + rs.segpts[i22 + 1]) / 2; } else { - var _i6 = rs.segpts.length / 2 - 1; - rs.midX = rs.segpts[_i6]; - rs.midY = rs.segpts[_i6 + 1]; + var _i = rs.segpts.length / 2 - 1; + if (!rs.isRound) { + rs.midX = rs.segpts[_i]; + rs.midY = rs.segpts[_i + 1]; + } else { + var point8 = { + x: rs.segpts[_i], + y: rs.segpts[_i + 1] + }; + var corner = rs.roundCorners[_i / 2]; + var v3 = [point8.x - corner.cx, point8.y - corner.cy]; + var factor = corner.radius / Math.sqrt(Math.pow(v3[0], 2) + Math.pow(v3[1], 2)); + v3 = v3.map(function(c3) { + return c3 * factor; + }); + rs.midX = corner.cx + v3[0]; + rs.midY = corner.cy + v3[1]; + rs.midVector = v3; + } } } }; BRp$c.checkForInvalidEdgeWarning = function(edge) { var rs = edge[0]._private.rscratch; - if (rs.nodesOverlap || number$12(rs.startX) && number$12(rs.startY) && number$12(rs.endX) && number$12(rs.endY)) { + if (rs.nodesOverlap || number$1(rs.startX) && number$1(rs.startY) && number$1(rs.endX) && number$1(rs.endY)) { rs.loggedErr = false; } else { if (!rs.loggedErr) { @@ -180170,37 +113182,37 @@ g.stateGroup line { } } }; - BRp$c.findEdgeControlPoints = function(edges2) { + BRp$c.findEdgeControlPoints = function(edges5) { var _this = this; - if (!edges2 || edges2.length === 0) { + if (!edges5 || edges5.length === 0) { return; } - var r = this; - var cy = r.cy; + var r2 = this; + var cy = r2.cy; var hasCompounds = cy.hasCompoundNodes(); var hashTable = { - map: new Map$22(), - get: function get3(pairId2) { - var map2 = this.map.get(pairId2[0]); - if (map2 != null) { - return map2.get(pairId2[1]); + map: new Map$2(), + get: /* @__PURE__ */ __name(function get6(pairId2) { + var map22 = this.map.get(pairId2[0]); + if (map22 != null) { + return map22.get(pairId2[1]); } else { return null; } - }, - set: function set3(pairId2, val) { - var map2 = this.map.get(pairId2[0]); - if (map2 == null) { - map2 = new Map$22(); - this.map.set(pairId2[0], map2); + }, "get"), + set: /* @__PURE__ */ __name(function set6(pairId2, val) { + var map22 = this.map.get(pairId2[0]); + if (map22 == null) { + map22 = new Map$2(); + this.map.set(pairId2[0], map22); } - map2.set(pairId2[1], val); - } + map22.set(pairId2[1], val); + }, "set") }; var pairIds = []; var haystackEdges = []; - for (var i3 = 0; i3 < edges2.length; i3++) { - var edge = edges2[i3]; + for (var i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; var _p = edge._private; var curveStyle = edge.pstyle("curve-style").value; if (edge.removed() || !edge.takesUpSpace()) { @@ -180210,7 +113222,7 @@ g.stateGroup line { haystackEdges.push(edge); continue; } - var edgeIsUnbundled = curveStyle === "unbundled-bezier" || curveStyle === "segments" || curveStyle === "straight" || curveStyle === "straight-triangle" || curveStyle === "taxi"; + var edgeIsUnbundled = curveStyle === "unbundled-bezier" || curveStyle.endsWith("segments") || curveStyle === "straight" || curveStyle === "straight-triangle" || curveStyle.endsWith("taxi"); var edgeIsBezier = curveStyle === "unbundled-bezier" || curveStyle === "bezier"; var src = _p.source; var tgt = _p.target; @@ -180233,13 +113245,13 @@ g.stateGroup line { tableEntry.hasBezier = true; } } - var _loop = function _loop2(p3) { - var pairId2 = pairIds[p3]; + var _loop = /* @__PURE__ */ __name(function _loop2(p4) { + var pairId2 = pairIds[p4]; var pairInfo = hashTable.get(pairId2); var swappedpairInfo = void 0; if (!pairInfo.hasUnbundled) { - var pllEdges = pairInfo.eles[0].parallelEdges().filter(function(e) { - return e.isBundledBezier(); + var pllEdges = pairInfo.eles[0].parallelEdges().filter(function(e3) { + return e3.isBundledBezier(); }); clearArray(pairInfo.eles); pllEdges.forEach(function(edge2) { @@ -180263,8 +113275,12 @@ g.stateGroup line { var srcH = pairInfo.srcH = src2.outerHeight(); var tgtW = pairInfo.tgtW = tgt2.outerWidth(); var tgtH = pairInfo.tgtH = tgt2.outerHeight(); - var srcShape = pairInfo.srcShape = r.nodeShapes[_this.getNodeShape(src2)]; - var tgtShape = pairInfo.tgtShape = r.nodeShapes[_this.getNodeShape(tgt2)]; + var srcShape = pairInfo.srcShape = r2.nodeShapes[_this.getNodeShape(src2)]; + var tgtShape = pairInfo.tgtShape = r2.nodeShapes[_this.getNodeShape(tgt2)]; + var srcCornerRadius = pairInfo.srcCornerRadius = src2.pstyle("corner-radius").value === "auto" ? "auto" : src2.pstyle("corner-radius").pfValue; + var tgtCornerRadius = pairInfo.tgtCornerRadius = tgt2.pstyle("corner-radius").value === "auto" ? "auto" : tgt2.pstyle("corner-radius").pfValue; + var tgtRs = pairInfo.tgtRs = tgt2._private.rscratch; + var srcRs = pairInfo.srcRs = src2._private.rscratch; pairInfo.dirCounts = { "north": 0, "west": 0, @@ -180275,17 +113291,17 @@ g.stateGroup line { "northeast": 0, "southeast": 0 }; - for (var _i22 = 0; _i22 < pairInfo.eles.length; _i22++) { - var _edge = pairInfo.eles[_i22]; + for (var _i2 = 0; _i2 < pairInfo.eles.length; _i2++) { + var _edge = pairInfo.eles[_i2]; var rs = _edge[0]._private.rscratch; var _curveStyle = _edge.pstyle("curve-style").value; - var _edgeIsUnbundled = _curveStyle === "unbundled-bezier" || _curveStyle === "segments" || _curveStyle === "taxi"; + var _edgeIsUnbundled = _curveStyle === "unbundled-bezier" || _curveStyle.endsWith("segments") || _curveStyle.endsWith("taxi"); var edgeIsSwapped = !src2.same(_edge.source()); if (!pairInfo.calculatedIntersection && src2 !== tgt2 && (pairInfo.hasBezier || pairInfo.hasUnbundled)) { pairInfo.calculatedIntersection = true; - var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0); + var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0, srcCornerRadius, srcRs); var srcIntn = pairInfo.srcIntn = srcOutside; - var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0); + var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0, tgtCornerRadius, tgtRs); var tgtIntn = pairInfo.tgtIntn = tgtOutside; var intersectionPts = pairInfo.intersectionPts = { x1: srcOutside[0], @@ -180301,20 +113317,20 @@ g.stateGroup line { }; var dy = tgtOutside[1] - srcOutside[1]; var dx = tgtOutside[0] - srcOutside[0]; - var l = Math.sqrt(dx * dx + dy * dy); + var l2 = Math.sqrt(dx * dx + dy * dy); var vector = pairInfo.vector = { x: dx, y: dy }; var vectorNorm = pairInfo.vectorNorm = { - x: vector.x / l, - y: vector.y / l + x: vector.x / l2, + y: vector.y / l2 }; var vectorNormInverse = { x: -vectorNorm.y, y: vectorNorm.x }; - pairInfo.nodesOverlap = !number$12(l) || tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y) || srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y); + pairInfo.nodesOverlap = !number$1(l2) || tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y, tgtCornerRadius, tgtRs) || srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y, srcCornerRadius, srcRs); pairInfo.vectorNormInverse = vectorNormInverse; swappedpairInfo = { nodesOverlap: pairInfo.nodesOverlap, @@ -180363,18 +113379,19 @@ g.stateGroup line { rs.nodesOverlap = passedPairInfo.nodesOverlap; rs.srcIntn = passedPairInfo.srcIntn; rs.tgtIntn = passedPairInfo.tgtIntn; + rs.isRound = _curveStyle.startsWith("round"); if (hasCompounds && (src2.isParent() || src2.isChild() || tgt2.isParent() || tgt2.isChild()) && (src2.parents().anySame(tgt2) || tgt2.parents().anySame(src2) || src2.same(tgt2) && src2.isParent())) { - _this.findCompoundLoopPoints(_edge, passedPairInfo, _i22, _edgeIsUnbundled); + _this.findCompoundLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled); } else if (src2 === tgt2) { - _this.findLoopPoints(_edge, passedPairInfo, _i22, _edgeIsUnbundled); - } else if (_curveStyle === "segments") { + _this.findLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled); + } else if (_curveStyle.endsWith("segments")) { _this.findSegmentsPoints(_edge, passedPairInfo); - } else if (_curveStyle === "taxi") { + } else if (_curveStyle.endsWith("taxi")) { _this.findTaxiPoints(_edge, passedPairInfo); - } else if (_curveStyle === "straight" || !_edgeIsUnbundled && pairInfo.eles.length % 2 === 1 && _i22 === Math.floor(pairInfo.eles.length / 2)) { + } else if (_curveStyle === "straight" || !_edgeIsUnbundled && pairInfo.eles.length % 2 === 1 && _i2 === Math.floor(pairInfo.eles.length / 2)) { _this.findStraightEdgePoints(_edge); } else { - _this.findBezierPoints(_edge, passedPairInfo, _i22, _edgeIsUnbundled, edgeIsSwapped); + _this.findBezierPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled, edgeIsSwapped); } _this.findEndpoints(_edge); _this.tryToCorrectInvalidPoints(_edge, passedPairInfo); @@ -180385,39 +113402,25 @@ g.stateGroup line { _this.recalculateEdgeLabelProjections(_edge); _this.calculateLabelAngles(_edge); } - }; - for (var p2 = 0; p2 < pairIds.length; p2++) { - _loop(p2); + }, "_loop"); + for (var p3 = 0; p3 < pairIds.length; p3++) { + _loop(p3); } this.findHaystackPoints(haystackEdges); }; - function getPts(pts2) { - var retPts = []; - if (pts2 == null) { - return; - } - for (var i3 = 0; i3 < pts2.length; i3 += 2) { - var x2 = pts2[i3]; - var y2 = pts2[i3 + 1]; - retPts.push({ - x: x2, - y: y2 - }); - } - return retPts; - } + __name(getPts, "getPts"); BRp$c.getSegmentPoints = function(edge) { var rs = edge[0]._private.rscratch; - var type2 = rs.edgeType; - if (type2 === "segments") { + var type3 = rs.edgeType; + if (type3 === "segments") { this.recalculateRenderedStyle(edge); return getPts(rs.segpts); } }; BRp$c.getControlPoints = function(edge) { var rs = edge[0]._private.rscratch; - var type2 = rs.edgeType; - if (type2 === "bezier" || type2 === "multibezier" || type2 === "self" || type2 === "compound") { + var type3 = rs.edgeType; + if (type3 === "bezier" || type3 === "multibezier" || type3 === "self" || type3 === "compound") { this.recalculateRenderedStyle(edge); return getPts(rs.ctrlpts); } @@ -180430,34 +113433,35 @@ g.stateGroup line { y: rs.midY }; }; - var BRp$b = {}; + BRp$b = {}; BRp$b.manualEndptToPx = function(node2, prop) { - var r = this; + var r2 = this; var npos = node2.position(); - var w2 = node2.outerWidth(); - var h = node2.outerHeight(); + var w3 = node2.outerWidth(); + var h2 = node2.outerHeight(); + var rs = node2._private.rscratch; if (prop.value.length === 2) { - var p2 = [prop.pfValue[0], prop.pfValue[1]]; + var p3 = [prop.pfValue[0], prop.pfValue[1]]; if (prop.units[0] === "%") { - p2[0] = p2[0] * w2; + p3[0] = p3[0] * w3; } if (prop.units[1] === "%") { - p2[1] = p2[1] * h; + p3[1] = p3[1] * h2; } - p2[0] += npos.x; - p2[1] += npos.y; - return p2; + p3[0] += npos.x; + p3[1] += npos.y; + return p3; } else { - var angle = prop.pfValue[0]; - angle = -Math.PI / 2 + angle; - var l = 2 * Math.max(w2, h); - var _p = [npos.x + Math.cos(angle) * l, npos.y + Math.sin(angle) * l]; - return r.nodeShapes[this.getNodeShape(node2)].intersectLine(npos.x, npos.y, w2, h, _p[0], _p[1], 0); + var angle2 = prop.pfValue[0]; + angle2 = -Math.PI / 2 + angle2; + var l2 = 2 * Math.max(w3, h2); + var _p = [npos.x + Math.cos(angle2) * l2, npos.y + Math.sin(angle2) * l2]; + return r2.nodeShapes[this.getNodeShape(node2)].intersectLine(npos.x, npos.y, w3, h2, _p[0], _p[1], 0, node2.pstyle("corner-radius").value === "auto" ? "auto" : node2.pstyle("corner-radius").pfValue, rs); } }; BRp$b.findEndpoints = function(edge) { - var r = this; - var intersect2; + var r2 = this; + var intersect3; var source = edge.source()[0]; var target = edge.target()[0]; var srcPos = source.position(); @@ -180466,51 +113470,55 @@ g.stateGroup line { var srcArShape = edge.pstyle("source-arrow-shape").value; var tgtDist = edge.pstyle("target-distance-from-node").pfValue; var srcDist = edge.pstyle("source-distance-from-node").pfValue; + var srcRs = source._private.rscratch; + var tgtRs = target._private.rscratch; var curveStyle = edge.pstyle("curve-style").value; var rs = edge._private.rscratch; - var et = rs.edgeType; + var et2 = rs.edgeType; var taxi = curveStyle === "taxi"; - var self2 = et === "self" || et === "compound"; - var bezier = et === "bezier" || et === "multibezier" || self2; - var multi = et !== "bezier"; - var lines = et === "straight" || et === "segments"; - var segments = et === "segments"; + var self2 = et2 === "self" || et2 === "compound"; + var bezier = et2 === "bezier" || et2 === "multibezier" || self2; + var multi = et2 !== "bezier"; + var lines = et2 === "straight" || et2 === "segments"; + var segments = et2 === "segments"; var hasEndpts = bezier || multi || lines; var overrideEndpts = self2 || taxi; var srcManEndpt = edge.pstyle("source-endpoint"); var srcManEndptVal = overrideEndpts ? "outside-to-node" : srcManEndpt.value; + var srcCornerRadius = source.pstyle("corner-radius").value === "auto" ? "auto" : source.pstyle("corner-radius").pfValue; var tgtManEndpt = edge.pstyle("target-endpoint"); var tgtManEndptVal = overrideEndpts ? "outside-to-node" : tgtManEndpt.value; + var tgtCornerRadius = target.pstyle("corner-radius").value === "auto" ? "auto" : target.pstyle("corner-radius").pfValue; rs.srcManEndpt = srcManEndpt; rs.tgtManEndpt = tgtManEndpt; var p1; - var p2; + var p22; var p1_i; var p2_i; if (bezier) { var cpStart = [rs.ctrlpts[0], rs.ctrlpts[1]]; var cpEnd = multi ? [rs.ctrlpts[rs.ctrlpts.length - 2], rs.ctrlpts[rs.ctrlpts.length - 1]] : cpStart; p1 = cpEnd; - p2 = cpStart; + p22 = cpStart; } else if (lines) { var srcArrowFromPt = !segments ? [tgtPos.x, tgtPos.y] : rs.segpts.slice(0, 2); var tgtArrowFromPt = !segments ? [srcPos.x, srcPos.y] : rs.segpts.slice(rs.segpts.length - 2); p1 = tgtArrowFromPt; - p2 = srcArrowFromPt; + p22 = srcArrowFromPt; } if (tgtManEndptVal === "inside-to-node") { - intersect2 = [tgtPos.x, tgtPos.y]; + intersect3 = [tgtPos.x, tgtPos.y]; } else if (tgtManEndpt.units) { - intersect2 = this.manualEndptToPx(target, tgtManEndpt); + intersect3 = this.manualEndptToPx(target, tgtManEndpt); } else if (tgtManEndptVal === "outside-to-line") { - intersect2 = rs.tgtIntn; + intersect3 = rs.tgtIntn; } else { if (tgtManEndptVal === "outside-to-node" || tgtManEndptVal === "outside-to-node-or-label") { p1_i = p1; } else if (tgtManEndptVal === "outside-to-line" || tgtManEndptVal === "outside-to-line-or-label") { p1_i = [srcPos.x, srcPos.y]; } - intersect2 = r.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0); + intersect3 = r2.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0, tgtCornerRadius, tgtRs); if (tgtManEndptVal === "outside-to-node-or-label" || tgtManEndptVal === "outside-to-line-or-label") { var trs = target._private.rscratch; var lw = trs.labelWidth; @@ -180534,11 +113542,11 @@ g.stateGroup line { var labelIntersect = polygonIntersectLine(p1_i[0], p1_i[1], [lx - lw2, ly - lh2, lx + lw2, ly - lh2, lx + lw2, ly + lh2, lx - lw2, ly + lh2], tgtPos.x, tgtPos.y); if (labelIntersect.length > 0) { var refPt = srcPos; - var intSqdist = sqdist(refPt, array2point(intersect2)); + var intSqdist = sqdist(refPt, array2point(intersect3)); var labIntSqdist = sqdist(refPt, array2point(labelIntersect)); var minSqDist = intSqdist; if (labIntSqdist < intSqdist) { - intersect2 = labelIntersect; + intersect3 = labelIntersect; minSqDist = labIntSqdist; } if (labelIntersect.length > 2) { @@ -180547,31 +113555,31 @@ g.stateGroup line { y: labelIntersect[3] }); if (labInt2SqDist < minSqDist) { - intersect2 = [labelIntersect[2], labelIntersect[3]]; + intersect3 = [labelIntersect[2], labelIntersect[3]]; } } } } } - var arrowEnd = shortenIntersection(intersect2, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist); - var edgeEnd = shortenIntersection(intersect2, p1, r.arrowShapes[tgtArShape].gap(edge) + tgtDist); + var arrowEnd = shortenIntersection(intersect3, p1, r2.arrowShapes[tgtArShape].spacing(edge) + tgtDist); + var edgeEnd = shortenIntersection(intersect3, p1, r2.arrowShapes[tgtArShape].gap(edge) + tgtDist); rs.endX = edgeEnd[0]; rs.endY = edgeEnd[1]; rs.arrowEndX = arrowEnd[0]; rs.arrowEndY = arrowEnd[1]; if (srcManEndptVal === "inside-to-node") { - intersect2 = [srcPos.x, srcPos.y]; + intersect3 = [srcPos.x, srcPos.y]; } else if (srcManEndpt.units) { - intersect2 = this.manualEndptToPx(source, srcManEndpt); + intersect3 = this.manualEndptToPx(source, srcManEndpt); } else if (srcManEndptVal === "outside-to-line") { - intersect2 = rs.srcIntn; + intersect3 = rs.srcIntn; } else { if (srcManEndptVal === "outside-to-node" || srcManEndptVal === "outside-to-node-or-label") { - p2_i = p2; + p2_i = p22; } else if (srcManEndptVal === "outside-to-line" || srcManEndptVal === "outside-to-line-or-label") { p2_i = [tgtPos.x, tgtPos.y]; } - intersect2 = r.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0); + intersect3 = r2.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0, srcCornerRadius, srcRs); if (srcManEndptVal === "outside-to-node-or-label" || srcManEndptVal === "outside-to-line-or-label") { var srs = source._private.rscratch; var _lw = srs.labelWidth; @@ -180595,11 +113603,11 @@ g.stateGroup line { var _labelIntersect = polygonIntersectLine(p2_i[0], p2_i[1], [_lx - _lw2, _ly - _lh2, _lx + _lw2, _ly - _lh2, _lx + _lw2, _ly + _lh2, _lx - _lw2, _ly + _lh2], srcPos.x, srcPos.y); if (_labelIntersect.length > 0) { var _refPt = tgtPos; - var _intSqdist = sqdist(_refPt, array2point(intersect2)); + var _intSqdist = sqdist(_refPt, array2point(intersect3)); var _labIntSqdist = sqdist(_refPt, array2point(_labelIntersect)); var _minSqDist = _intSqdist; if (_labIntSqdist < _intSqdist) { - intersect2 = [_labelIntersect[0], _labelIntersect[1]]; + intersect3 = [_labelIntersect[0], _labelIntersect[1]]; _minSqDist = _labIntSqdist; } if (_labelIntersect.length > 2) { @@ -180608,20 +113616,20 @@ g.stateGroup line { y: _labelIntersect[3] }); if (_labInt2SqDist < _minSqDist) { - intersect2 = [_labelIntersect[2], _labelIntersect[3]]; + intersect3 = [_labelIntersect[2], _labelIntersect[3]]; } } } } } - var arrowStart = shortenIntersection(intersect2, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist); - var edgeStart = shortenIntersection(intersect2, p2, r.arrowShapes[srcArShape].gap(edge) + srcDist); + var arrowStart = shortenIntersection(intersect3, p22, r2.arrowShapes[srcArShape].spacing(edge) + srcDist); + var edgeStart = shortenIntersection(intersect3, p22, r2.arrowShapes[srcArShape].gap(edge) + srcDist); rs.startX = edgeStart[0]; rs.startY = edgeStart[1]; rs.arrowStartX = arrowStart[0]; rs.arrowStartY = arrowStart[1]; if (hasEndpts) { - if (!number$12(rs.startX) || !number$12(rs.startY) || !number$12(rs.endX) || !number$12(rs.endY)) { + if (!number$1(rs.startX) || !number$1(rs.startY) || !number$1(rs.endX) || !number$1(rs.endY)) { rs.badLine = true; } else { rs.badLine = false; @@ -180660,42 +113668,29 @@ g.stateGroup line { }; } }; - var BRp$a = {}; - function pushBezierPts(r, edge, pts2) { - var qbezierAt$1 = function qbezierAt$12(p1, p22, p3, t) { - return qbezierAt(p1, p22, p3, t); - }; - var _p = edge._private; - var bpts = _p.rstyle.bezierPts; - for (var i3 = 0; i3 < r.bezierProjPcts.length; i3++) { - var p2 = r.bezierProjPcts[i3]; - bpts.push({ - x: qbezierAt$1(pts2[0], pts2[2], pts2[4], p2), - y: qbezierAt$1(pts2[1], pts2[3], pts2[5], p2) - }); - } - } + BRp$a = {}; + __name(pushBezierPts, "pushBezierPts"); BRp$a.storeEdgeProjections = function(edge) { var _p = edge._private; var rs = _p.rscratch; - var et = rs.edgeType; + var et2 = rs.edgeType; _p.rstyle.bezierPts = null; _p.rstyle.linePts = null; _p.rstyle.haystackPts = null; - if (et === "multibezier" || et === "bezier" || et === "self" || et === "compound") { + if (et2 === "multibezier" || et2 === "bezier" || et2 === "self" || et2 === "compound") { _p.rstyle.bezierPts = []; - for (var i3 = 0; i3 + 5 < rs.allpts.length; i3 += 4) { - pushBezierPts(this, edge, rs.allpts.slice(i3, i3 + 6)); + for (var i2 = 0; i2 + 5 < rs.allpts.length; i2 += 4) { + pushBezierPts(this, edge, rs.allpts.slice(i2, i2 + 6)); } - } else if (et === "segments") { + } else if (et2 === "segments") { var lpts = _p.rstyle.linePts = []; - for (var i3 = 0; i3 + 1 < rs.allpts.length; i3 += 2) { + for (var i2 = 0; i2 + 1 < rs.allpts.length; i2 += 2) { lpts.push({ - x: rs.allpts[i3], - y: rs.allpts[i3 + 1] + x: rs.allpts[i2], + y: rs.allpts[i2 + 1] }); } - } else if (et === "haystack") { + } else if (et2 === "haystack") { var hpts = rs.haystackPts; _p.rstyle.haystackPts = [{ x: hpts[0], @@ -180707,20 +113702,20 @@ g.stateGroup line { } _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.arrowShapeWidth; }; - BRp$a.recalculateEdgeProjections = function(edges2) { - this.findEdgeControlPoints(edges2); + BRp$a.recalculateEdgeProjections = function(edges5) { + this.findEdgeControlPoints(edges5); }; - var BRp$9 = {}; + BRp$9 = {}; BRp$9.recalculateNodeLabelProjection = function(node2) { - var content2 = node2.pstyle("label").strValue; - if (emptyString(content2)) { + var content = node2.pstyle("label").strValue; + if (emptyString(content)) { return; } var textX, textY; var _p = node2._private; var nodeWidth = node2.width(); var nodeHeight = node2.height(); - var padding2 = node2.padding(); + var padding3 = node2.padding(); var nodePos = node2.position(); var textHalign = node2.pstyle("text-halign").strValue; var textValign = node2.pstyle("text-valign").strValue; @@ -180728,20 +113723,20 @@ g.stateGroup line { var rstyle = _p.rstyle; switch (textHalign) { case "left": - textX = nodePos.x - nodeWidth / 2 - padding2; + textX = nodePos.x - nodeWidth / 2 - padding3; break; case "right": - textX = nodePos.x + nodeWidth / 2 + padding2; + textX = nodePos.x + nodeWidth / 2 + padding3; break; default: textX = nodePos.x; } switch (textValign) { case "top": - textY = nodePos.y - nodeHeight / 2 - padding2; + textY = nodePos.y - nodeHeight / 2 - padding3; break; case "bottom": - textY = nodePos.y + nodeHeight / 2 + padding2; + textY = nodePos.y + nodeHeight / 2 + padding3; break; default: textY = nodePos.y; @@ -180753,69 +113748,68 @@ g.stateGroup line { this.calculateLabelAngles(node2); this.applyLabelDimensions(node2); }; - var lineAngleFromDelta = function lineAngleFromDelta2(dx, dy) { - var angle = Math.atan(dy / dx); - if (dx === 0 && angle < 0) { - angle = angle * -1; + lineAngleFromDelta = /* @__PURE__ */ __name(function lineAngleFromDelta2(dx, dy) { + var angle2 = Math.atan(dy / dx); + if (dx === 0 && angle2 < 0) { + angle2 = angle2 * -1; } - return angle; - }; - var lineAngle = function lineAngle2(p0, p1) { + return angle2; + }, "lineAngleFromDelta"); + lineAngle = /* @__PURE__ */ __name(function lineAngle2(p0, p1) { var dx = p1.x - p0.x; var dy = p1.y - p0.y; return lineAngleFromDelta(dx, dy); - }; - var bezierAngle = function bezierAngle2(p0, p1, p2, t) { - var t02 = bound(0, t - 1e-3, 1); - var t12 = bound(0, t + 1e-3, 1); - var lp0 = qbezierPtAt(p0, p1, p2, t02); - var lp1 = qbezierPtAt(p0, p1, p2, t12); + }, "lineAngle"); + bezierAngle = /* @__PURE__ */ __name(function bezierAngle2(p0, p1, p22, t4) { + var t03 = bound(0, t4 - 1e-3, 1); + var t13 = bound(0, t4 + 1e-3, 1); + var lp0 = qbezierPtAt(p0, p1, p22, t03); + var lp1 = qbezierPtAt(p0, p1, p22, t13); return lineAngle(lp0, lp1); - }; + }, "bezierAngle"); BRp$9.recalculateEdgeLabelProjections = function(edge) { - var p2; + var p3; var _p = edge._private; var rs = _p.rscratch; - var r = this; - var content2 = { + var r2 = this; + var content = { mid: edge.pstyle("label").strValue, source: edge.pstyle("source-label").strValue, target: edge.pstyle("target-label").strValue }; - if (content2.mid || content2.source || content2.target) - ; + if (content.mid || content.source || content.target) ; else { return; } - p2 = { + p3 = { x: rs.midX, y: rs.midY }; - var setRs = function setRs2(propName, prefix, value2) { + var setRs = /* @__PURE__ */ __name(function setRs2(propName, prefix, value2) { setPrefixedProperty(_p.rscratch, propName, prefix, value2); setPrefixedProperty(_p.rstyle, propName, prefix, value2); - }; - setRs("labelX", null, p2.x); - setRs("labelY", null, p2.y); + }, "setRs"); + setRs("labelX", null, p3.x); + setRs("labelY", null, p3.y); var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); setRs("labelAutoAngle", null, midAngle); - var createControlPointInfo = function createControlPointInfo2() { + var createControlPointInfo = /* @__PURE__ */ __name(function createControlPointInfo2() { if (createControlPointInfo2.cache) { return createControlPointInfo2.cache; } var ctrlpts = []; - for (var i3 = 0; i3 + 5 < rs.allpts.length; i3 += 4) { + for (var i2 = 0; i2 + 5 < rs.allpts.length; i2 += 4) { var p0 = { - x: rs.allpts[i3], - y: rs.allpts[i3 + 1] + x: rs.allpts[i2], + y: rs.allpts[i2 + 1] }; var p1 = { - x: rs.allpts[i3 + 2], - y: rs.allpts[i3 + 3] + x: rs.allpts[i2 + 2], + y: rs.allpts[i2 + 3] }; var p22 = { - x: rs.allpts[i3 + 4], - y: rs.allpts[i3 + 5] + x: rs.allpts[i2 + 4], + y: rs.allpts[i2 + 5] }; ctrlpts.push({ p0, @@ -180827,39 +113821,40 @@ g.stateGroup line { }); } var bpts = _p.rstyle.bezierPts; - var nProjs = r.bezierProjPcts.length; - function addSegment(cp2, p02, p12, t02, t12) { - var length2 = dist2(p02, p12); + var nProjs = r2.bezierProjPcts.length; + function addSegment(cp2, p02, p12, t03, t13) { + var length2 = dist(p02, p12); var prevSegment = cp2.segments[cp2.segments.length - 1]; var segment = { p0: p02, p1: p12, - t0: t02, - t1: t12, + t0: t03, + t1: t13, startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, length: length2 }; cp2.segments.push(segment); cp2.length += length2; } - for (var _i6 = 0; _i6 < ctrlpts.length; _i6++) { - var cp = ctrlpts[_i6]; - var prevCp = ctrlpts[_i6 - 1]; + __name(addSegment, "addSegment"); + for (var _i = 0; _i < ctrlpts.length; _i++) { + var cp = ctrlpts[_i]; + var prevCp = ctrlpts[_i - 1]; if (prevCp) { cp.startDist = prevCp.startDist + prevCp.length; } - addSegment(cp, cp.p0, bpts[_i6 * nProjs], 0, r.bezierProjPcts[0]); - for (var j = 0; j < nProjs - 1; j++) { - addSegment(cp, bpts[_i6 * nProjs + j], bpts[_i6 * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]); + addSegment(cp, cp.p0, bpts[_i * nProjs], 0, r2.bezierProjPcts[0]); + for (var j2 = 0; j2 < nProjs - 1; j2++) { + addSegment(cp, bpts[_i * nProjs + j2], bpts[_i * nProjs + j2 + 1], r2.bezierProjPcts[j2], r2.bezierProjPcts[j2 + 1]); } - addSegment(cp, bpts[_i6 * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); + addSegment(cp, bpts[_i * nProjs + nProjs - 1], cp.p2, r2.bezierProjPcts[nProjs - 1], 1); } return createControlPointInfo2.cache = ctrlpts; - }; - var calculateEndProjection = function calculateEndProjection2(prefix) { - var angle; + }, "createControlPointInfo"); + var calculateEndProjection = /* @__PURE__ */ __name(function calculateEndProjection2(prefix) { + var angle2; var isSrc = prefix === "source"; - if (!content2[prefix]) { + if (!content[prefix]) { return; } var offset = edge.pstyle(prefix + "-text-offset").pfValue; @@ -180872,11 +113867,11 @@ g.stateGroup line { var selected; var startDist = 0; var totalDist = 0; - for (var i3 = 0; i3 < cps.length; i3++) { - var _cp = cps[isSrc ? i3 : cps.length - 1 - i3]; - for (var j = 0; j < _cp.segments.length; j++) { - var _seg = _cp.segments[isSrc ? j : _cp.segments.length - 1 - j]; - var lastSeg = i3 === cps.length - 1 && j === _cp.segments.length - 1; + for (var i2 = 0; i2 < cps.length; i2++) { + var _cp = cps[isSrc ? i2 : cps.length - 1 - i2]; + for (var j2 = 0; j2 < _cp.segments.length; j2++) { + var _seg = _cp.segments[isSrc ? j2 : _cp.segments.length - 1 - j2]; + var lastSeg = i2 === cps.length - 1 && j2 === _cp.segments.length - 1; startDist = totalDist; totalDist += _seg.length; if (totalDist >= offset || lastSeg) { @@ -180895,57 +113890,57 @@ g.stateGroup line { var seg = selected.segment; var tSegment = (offset - startDist) / seg.length; var segDt = seg.t1 - seg.t0; - var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; - t = bound(0, t, 1); - p2 = qbezierPtAt(cp.p0, cp.p1, cp.p2, t); - angle = bezierAngle(cp.p0, cp.p1, cp.p2, t); + var t4 = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; + t4 = bound(0, t4, 1); + p3 = qbezierPtAt(cp.p0, cp.p1, cp.p2, t4); + angle2 = bezierAngle(cp.p0, cp.p1, cp.p2, t4); break; } case "straight": case "segments": case "haystack": { - var d = 0, di, d0; + var d2 = 0, di, d0; var p0, p1; - var l = rs.allpts.length; - for (var _i22 = 0; _i22 + 3 < l; _i22 += 2) { + var l2 = rs.allpts.length; + for (var _i2 = 0; _i2 + 3 < l2; _i2 += 2) { if (isSrc) { p0 = { - x: rs.allpts[_i22], - y: rs.allpts[_i22 + 1] + x: rs.allpts[_i2], + y: rs.allpts[_i2 + 1] }; p1 = { - x: rs.allpts[_i22 + 2], - y: rs.allpts[_i22 + 3] + x: rs.allpts[_i2 + 2], + y: rs.allpts[_i2 + 3] }; } else { p0 = { - x: rs.allpts[l - 2 - _i22], - y: rs.allpts[l - 1 - _i22] + x: rs.allpts[l2 - 2 - _i2], + y: rs.allpts[l2 - 1 - _i2] }; p1 = { - x: rs.allpts[l - 4 - _i22], - y: rs.allpts[l - 3 - _i22] + x: rs.allpts[l2 - 4 - _i2], + y: rs.allpts[l2 - 3 - _i2] }; } - di = dist2(p0, p1); - d0 = d; - d += di; - if (d >= offset) { + di = dist(p0, p1); + d0 = d2; + d2 += di; + if (d2 >= offset) { break; } } var pD = offset - d0; var _t = pD / di; _t = bound(0, _t, 1); - p2 = lineAt(p0, p1, _t); - angle = lineAngle(p0, p1); + p3 = lineAt(p0, p1, _t); + angle2 = lineAngle(p0, p1); break; } } - setRs("labelX", prefix, p2.x); - setRs("labelY", prefix, p2.y); - setRs("labelAutoAngle", prefix, angle); - }; + setRs("labelX", prefix, p3.x); + setRs("labelY", prefix, p3.y); + setRs("labelAutoAngle", prefix, angle2); + }, "calculateEndProjection"); calculateEndProjection("source"); calculateEndProjection("target"); this.applyLabelDimensions(edge); @@ -180967,12 +113962,12 @@ g.stateGroup line { var numLines = textWrap !== "wrap" ? 1 : Math.max(lines.length, 1); var normPerLineHeight = labelDims.height / numLines; var labelLineHeight = normPerLineHeight * lineHeight; - var width2 = labelDims.width; - var height = labelDims.height + (numLines - 1) * (lineHeight - 1) * normPerLineHeight; - setPrefixedProperty(_p.rstyle, "labelWidth", prefix, width2); - setPrefixedProperty(_p.rscratch, "labelWidth", prefix, width2); - setPrefixedProperty(_p.rstyle, "labelHeight", prefix, height); - setPrefixedProperty(_p.rscratch, "labelHeight", prefix, height); + var width3 = labelDims.width; + var height2 = labelDims.height + (numLines - 1) * (lineHeight - 1) * normPerLineHeight; + setPrefixedProperty(_p.rstyle, "labelWidth", prefix, width3); + setPrefixedProperty(_p.rscratch, "labelWidth", prefix, width3); + setPrefixedProperty(_p.rstyle, "labelHeight", prefix, height2); + setPrefixedProperty(_p.rscratch, "labelHeight", prefix, height2); setPrefixedProperty(_p.rscratch, "labelLineHeight", prefix, labelLineHeight); }; BRp$9.getLabelText = function(ele, prefix) { @@ -180980,19 +113975,18 @@ g.stateGroup line { var pfd = prefix ? prefix + "-" : ""; var text2 = ele.pstyle(pfd + "label").strValue; var textTransform = ele.pstyle("text-transform").value; - var rscratch = function rscratch2(propName, value2) { + var rscratch = /* @__PURE__ */ __name(function rscratch2(propName, value2) { if (value2) { setPrefixedProperty(_p.rscratch, propName, prefix, value2); return value2; } else { return getPrefixedProperty(_p.rscratch, propName, prefix); } - }; + }, "rscratch"); if (!text2) { return ""; } - if (textTransform == "none") - ; + if (textTransform == "none") ; else if (textTransform == "uppercase") { text2 = text2.toUpperCase(); } else if (textTransform == "lowercase") { @@ -181004,16 +113998,15 @@ g.stateGroup line { if (labelKey != null && rscratch("labelWrapKey") === labelKey) { return rscratch("labelWrapCachedText"); } - var zwsp = "​"; + var zwsp = "\u200B"; var lines = text2.split("\n"); var maxW = ele.pstyle("text-max-width").pfValue; var overflow = ele.pstyle("text-overflow-wrap").value; var overflowAny = overflow === "anywhere"; var wrappedLines = []; - var wordsRegex = /[\s\u200b]+/; - var wordSeparator = overflowAny ? "" : " "; - for (var l = 0; l < lines.length; l++) { - var line2 = lines[l]; + var separatorRegex = /[\s\u200b]+|$/g; + for (var l2 = 0; l2 < lines.length; l2++) { + var line2 = lines[l2]; var lineDims = this.calculateLabelDimensions(ele, line2); var lineW = lineDims.width; if (overflowAny) { @@ -181021,21 +114014,32 @@ g.stateGroup line { line2 = processedLine; } if (lineW > maxW) { - var words = line2.split(wordsRegex); + var separatorMatches = line2.matchAll(separatorRegex); var subline = ""; - for (var w2 = 0; w2 < words.length; w2++) { - var word = words[w2]; - var testLine = subline.length === 0 ? word : subline + wordSeparator + word; - var testDims = this.calculateLabelDimensions(ele, testLine); - var testW = testDims.width; - if (testW <= maxW) { - subline += word + wordSeparator; - } else { - if (subline) { - wrappedLines.push(subline); + var previousIndex = 0; + var _iterator = _createForOfIteratorHelper(separatorMatches), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var separatorMatch = _step.value; + var wordSeparator = separatorMatch[0]; + var word = line2.substring(previousIndex, separatorMatch.index); + previousIndex = separatorMatch.index + wordSeparator.length; + var testLine = subline.length === 0 ? word : subline + word + wordSeparator; + var testDims = this.calculateLabelDimensions(ele, testLine); + var testW = testDims.width; + if (testW <= maxW) { + subline += word + wordSeparator; + } else { + if (subline) { + wrappedLines.push(subline); + } + subline = word + wordSeparator; } - subline = word + wordSeparator; } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } if (!subline.match(/^[\s\u200b]+$/)) { wrappedLines.push(subline); @@ -181050,18 +114054,18 @@ g.stateGroup line { } else if (wrapStyle === "ellipsis") { var _maxW = ele.pstyle("text-max-width").pfValue; var ellipsized = ""; - var ellipsis = "…"; + var ellipsis = "\u2026"; var incLastCh = false; if (this.calculateLabelDimensions(ele, text2).width < _maxW) { return text2; } - for (var i3 = 0; i3 < text2.length; i3++) { - var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text2[i3] + ellipsis).width; + for (var i2 = 0; i2 < text2.length; i2++) { + var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text2[i2] + ellipsis).width; if (widthWithNextCh > _maxW) { break; } - ellipsized += text2[i3]; - if (i3 === text2.length - 1) { + ellipsized += text2[i2]; + if (i2 === text2.length - 1) { incLastCh = true; } } @@ -181093,22 +114097,24 @@ g.stateGroup line { } }; BRp$9.calculateLabelDimensions = function(ele, text2) { - var r = this; + var r2 = this; + var containerWindow = r2.cy.window(); + var document2 = containerWindow.document; var cacheKey = hashString(text2, ele._private.labelDimsKey); - var cache2 = r.labelDimCache || (r.labelDimCache = []); - var existingVal = cache2[cacheKey]; + var cache3 = r2.labelDimCache || (r2.labelDimCache = []); + var existingVal = cache3[cacheKey]; if (existingVal != null) { return existingVal; } - var padding2 = 0; + var padding3 = 0; var fStyle = ele.pstyle("font-style").strValue; - var size2 = ele.pstyle("font-size").pfValue; + var size5 = ele.pstyle("font-size").pfValue; var family = ele.pstyle("font-family").strValue; - var weight = ele.pstyle("font-weight").strValue; + var weight8 = ele.pstyle("font-weight").strValue; var canvas = this.labelCalcCanvas; var c2d = this.labelCalcCanvasContext; if (!canvas) { - canvas = this.labelCalcCanvas = document.createElement("canvas"); + canvas = this.labelCalcCanvas = document2.createElement("canvas"); c2d = this.labelCalcCanvasContext = canvas.getContext("2d"); var ds = canvas.style; ds.position = "absolute"; @@ -181118,35 +114124,35 @@ g.stateGroup line { ds.visibility = "hidden"; ds.pointerEvents = "none"; } - c2d.font = "".concat(fStyle, " ").concat(weight, " ").concat(size2, "px ").concat(family); - var width2 = 0; - var height = 0; + c2d.font = "".concat(fStyle, " ").concat(weight8, " ").concat(size5, "px ").concat(family); + var width3 = 0; + var height2 = 0; var lines = text2.split("\n"); - for (var i3 = 0; i3 < lines.length; i3++) { - var line2 = lines[i3]; + for (var i2 = 0; i2 < lines.length; i2++) { + var line2 = lines[i2]; var metrics = c2d.measureText(line2); - var w2 = Math.ceil(metrics.width); - var h = size2; - width2 = Math.max(w2, width2); - height += h; - } - width2 += padding2; - height += padding2; - return cache2[cacheKey] = { - width: width2, - height + var w3 = Math.ceil(metrics.width); + var h2 = size5; + width3 = Math.max(w3, width3); + height2 += h2; + } + width3 += padding3; + height2 += padding3; + return cache3[cacheKey] = { + width: width3, + height: height2 }; }; BRp$9.calculateLabelAngle = function(ele, prefix) { var _p = ele._private; var rs = _p.rscratch; - var isEdge = ele.isEdge(); + var isEdge2 = ele.isEdge(); var prefixDash = prefix ? prefix + "-" : ""; var rot = ele.pstyle(prefixDash + "text-rotation"); var rotStr = rot.strValue; if (rotStr === "none") { return 0; - } else if (isEdge && rotStr === "autorotate") { + } else if (isEdge2 && rotStr === "autorotate") { return rs.labelAutoAngle; } else if (rotStr === "autorotate") { return 0; @@ -181155,21 +114161,21 @@ g.stateGroup line { } }; BRp$9.calculateLabelAngles = function(ele) { - var r = this; - var isEdge = ele.isEdge(); + var r2 = this; + var isEdge2 = ele.isEdge(); var _p = ele._private; var rs = _p.rscratch; - rs.labelAngle = r.calculateLabelAngle(ele); - if (isEdge) { - rs.sourceLabelAngle = r.calculateLabelAngle(ele, "source"); - rs.targetLabelAngle = r.calculateLabelAngle(ele, "target"); + rs.labelAngle = r2.calculateLabelAngle(ele); + if (isEdge2) { + rs.sourceLabelAngle = r2.calculateLabelAngle(ele, "source"); + rs.targetLabelAngle = r2.calculateLabelAngle(ele, "target"); } }; - var BRp$8 = {}; - var TOO_SMALL_CUT_RECT = 28; - var warnedCutRect = false; + BRp$8 = {}; + TOO_SMALL_CUT_RECT = 28; + warnedCutRect = false; BRp$8.getNodeShape = function(node2) { - var r = this; + var r2 = this; var shape = node2.pstyle("shape").value; if (shape === "cutrectangle" && (node2.width() < TOO_SMALL_CUT_RECT || node2.height() < TOO_SMALL_CUT_RECT)) { if (!warnedCutRect) { @@ -181187,41 +114193,41 @@ g.stateGroup line { } if (shape === "polygon") { var points = node2.pstyle("shape-polygon-points").value; - return r.nodeShapes.makePolygon(points).name; + return r2.nodeShapes.makePolygon(points).name; } return shape; }; - var BRp$7 = {}; + BRp$7 = {}; BRp$7.registerCalculationListeners = function() { var cy = this.cy; var elesToUpdate = cy.collection(); - var r = this; - var enqueue = function enqueue2(eles) { + var r2 = this; + var enqueue = /* @__PURE__ */ __name(function enqueue2(eles) { var dirtyStyleCaches = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; elesToUpdate.merge(eles); if (dirtyStyleCaches) { - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; var _p = ele._private; var rstyle = _p.rstyle; rstyle.clean = false; rstyle.cleanConnected = false; } } - }; - r.binder(cy).on("bounds.* dirty.*", function onDirtyBounds(e) { - var ele = e.target; + }, "enqueue"); + r2.binder(cy).on("bounds.* dirty.*", /* @__PURE__ */ __name(function onDirtyBounds(e3) { + var ele = e3.target; enqueue(ele); - }).on("style.* background.*", function onDirtyStyle(e) { - var ele = e.target; + }, "onDirtyBounds")).on("style.* background.*", /* @__PURE__ */ __name(function onDirtyStyle(e3) { + var ele = e3.target; enqueue(ele, false); - }); - var updateEleCalcs = function updateEleCalcs2(willDraw) { + }, "onDirtyStyle")); + var updateEleCalcs = /* @__PURE__ */ __name(function updateEleCalcs2(willDraw) { if (willDraw) { - var fns = r.onUpdateEleCalcsFns; + var fns = r2.onUpdateEleCalcsFns; elesToUpdate.cleanStyle(); - for (var i3 = 0; i3 < elesToUpdate.length; i3++) { - var ele = elesToUpdate[i3]; + for (var i2 = 0; i2 < elesToUpdate.length; i2++) { + var ele = elesToUpdate[i2]; var rstyle = ele._private.rstyle; if (ele.isNode() && !rstyle.cleanConnected) { enqueue(ele.connectedEdges()); @@ -181229,38 +114235,38 @@ g.stateGroup line { } } if (fns) { - for (var _i6 = 0; _i6 < fns.length; _i6++) { - var fn2 = fns[_i6]; - fn2(willDraw, elesToUpdate); + for (var _i = 0; _i < fns.length; _i++) { + var fn3 = fns[_i]; + fn3(willDraw, elesToUpdate); } } - r.recalculateRenderedStyle(elesToUpdate); + r2.recalculateRenderedStyle(elesToUpdate); elesToUpdate = cy.collection(); } - }; - r.flushRenderedStyleQueue = function() { + }, "updateEleCalcs"); + r2.flushRenderedStyleQueue = function() { updateEleCalcs(true); }; - r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs); + r2.beforeRender(updateEleCalcs, r2.beforeRenderPriorities.eleCalcs); }; - BRp$7.onUpdateEleCalcs = function(fn2) { + BRp$7.onUpdateEleCalcs = function(fn3) { var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; - fns.push(fn2); + fns.push(fn3); }; BRp$7.recalculateRenderedStyle = function(eles, useCache) { - var isCleanConnected = function isCleanConnected2(ele2) { + var isCleanConnected = /* @__PURE__ */ __name(function isCleanConnected2(ele2) { return ele2._private.rstyle.cleanConnected; - }; - var edges2 = []; - var nodes2 = []; + }, "isCleanConnected"); + var edges5 = []; + var nodes6 = []; if (this.destroyed) { return; } if (useCache === void 0) { useCache = true; } - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; var _p = ele._private; var rstyle = _p.rstyle; if (ele.isEdge() && (!isCleanConnected(ele.source()) || !isCleanConnected(ele.target()))) { @@ -181273,14 +114279,14 @@ g.stateGroup line { continue; } if (_p.group === "nodes") { - nodes2.push(ele); + nodes6.push(ele); } else { - edges2.push(ele); + edges5.push(ele); } rstyle.clean = true; } - for (var _i22 = 0; _i22 < nodes2.length; _i22++) { - var _ele = nodes2[_i22]; + for (var _i2 = 0; _i2 < nodes6.length; _i2++) { + var _ele = nodes6[_i2]; var _p2 = _ele._private; var _rstyle = _p2.rstyle; var pos = _ele.position(); @@ -181290,9 +114296,9 @@ g.stateGroup line { _rstyle.nodeW = _ele.pstyle("width").pfValue; _rstyle.nodeH = _ele.pstyle("height").pfValue; } - this.recalculateEdgeProjections(edges2); - for (var _i32 = 0; _i32 < edges2.length; _i32++) { - var _ele2 = edges2[_i32]; + this.recalculateEdgeProjections(edges5); + for (var _i3 = 0; _i3 < edges5.length; _i3++) { + var _ele2 = edges5[_i3]; var _p3 = _ele2._private; var _rstyle2 = _p3.rstyle; var rs = _p3.rscratch; @@ -181307,7 +114313,7 @@ g.stateGroup line { _rstyle2.targetLabelAngle = rs.targetLabelAngle; } }; - var BRp$6 = {}; + BRp$6 = {}; BRp$6.updateCachedGrabbedEles = function() { var eles = this.cachedZSortedEles; if (!eles) { @@ -181316,8 +114322,8 @@ g.stateGroup line { eles.drag = []; eles.nondrag = []; var grabTargets = []; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; var rs = ele._private.rscratch; if (ele.grabbed() && !ele.isParent()) { grabTargets.push(ele); @@ -181327,8 +114333,8 @@ g.stateGroup line { eles.nondrag.push(ele); } } - for (var i3 = 0; i3 < grabTargets.length; i3++) { - var ele = grabTargets[i3]; + for (var i2 = 0; i2 < grabTargets.length; i2++) { + var ele = grabTargets[i2]; eles.drag.push(ele); } }; @@ -181349,23 +114355,23 @@ g.stateGroup line { } return eles; }; - var BRp$5 = {}; + BRp$5 = {}; [BRp$e, BRp$d, BRp$c, BRp$b, BRp$a, BRp$9, BRp$8, BRp$7, BRp$6].forEach(function(props) { extend2(BRp$5, props); }); - var BRp$4 = {}; + BRp$4 = {}; BRp$4.getCachedImage = function(url, crossOrigin, onLoad) { - var r = this; - var imageCache = r.imageCache = r.imageCache || {}; - var cache2 = imageCache[url]; - if (cache2) { - if (!cache2.image.complete) { - cache2.image.addEventListener("load", onLoad); - } - return cache2.image; + var r2 = this; + var imageCache = r2.imageCache = r2.imageCache || {}; + var cache3 = imageCache[url]; + if (cache3) { + if (!cache3.image.complete) { + cache3.image.addEventListener("load", onLoad); + } + return cache3.image; } else { - cache2 = imageCache[url] = imageCache[url] || {}; - var image = cache2.image = new Image(); + cache3 = imageCache[url] = imageCache[url] || {}; + var image = cache3.image = new Image(); image.addEventListener("load", onLoad); image.addEventListener("error", function() { image.error = true; @@ -181380,51 +114386,51 @@ g.stateGroup line { return image; } }; - var BRp$3 = {}; - BRp$3.registerBinding = function(target, event2, handler, useCapture) { + BRp$3 = {}; + BRp$3.registerBinding = function(target, event3, handler, useCapture) { var args = Array.prototype.slice.apply(arguments, [1]); - var b = this.binder(target); - return b.on.apply(b, args); + var b2 = this.binder(target); + return b2.on.apply(b2, args); }; BRp$3.binder = function(tgt) { - var r = this; - var containerWindow = r.cy.window(); + var r2 = this; + var containerWindow = r2.cy.window(); var tgtIsDom = tgt === containerWindow || tgt === containerWindow.document || tgt === containerWindow.document.body || domElement(tgt); - if (r.supportsPassiveEvents == null) { + if (r2.supportsPassiveEvents == null) { var supportsPassive = false; try { var opts = Object.defineProperty({}, "passive", { - get: function get3() { + get: /* @__PURE__ */ __name(function get6() { supportsPassive = true; return true; - } + }, "get") }); containerWindow.addEventListener("test", null, opts); } catch (err) { } - r.supportsPassiveEvents = supportsPassive; + r2.supportsPassiveEvents = supportsPassive; } - var on = function on2(event2, handler, useCapture) { + var on3 = /* @__PURE__ */ __name(function on4(event3, handler, useCapture) { var args = Array.prototype.slice.call(arguments); - if (tgtIsDom && r.supportsPassiveEvents) { + if (tgtIsDom && r2.supportsPassiveEvents) { args[2] = { capture: useCapture != null ? useCapture : false, passive: false, once: false }; } - r.bindings.push({ + r2.bindings.push({ target: tgt, args }); (tgt.addEventListener || tgt.on).apply(tgt, args); return this; - }; + }, "on"); return { - on, - addEventListener: on, - addListener: on, - bind: on + on: on3, + addEventListener: on3, + addListener: on3, + bind: on3 }; }; BRp$3.nodeIsDraggable = function(node2) { @@ -181434,32 +114440,32 @@ g.stateGroup line { return this.nodeIsDraggable(node2) && node2.interactive(); }; BRp$3.load = function() { - var r = this; - var containerWindow = r.cy.window(); - var isSelected = function isSelected2(ele) { + var r2 = this; + var containerWindow = r2.cy.window(); + var isSelected = /* @__PURE__ */ __name(function isSelected2(ele) { return ele.selected(); - }; - var triggerEvents = function triggerEvents2(target, names, e, position3) { + }, "isSelected"); + var triggerEvents = /* @__PURE__ */ __name(function triggerEvents2(target, names, e3, position5) { if (target == null) { - target = r.cy; + target = r2.cy; } - for (var i3 = 0; i3 < names.length; i3++) { - var name = names[i3]; + for (var i2 = 0; i2 < names.length; i2++) { + var name = names[i2]; target.emit({ - originalEvent: e, + originalEvent: e3, type: name, - position: position3 + position: position5 }); } - }; - var isMultSelKeyDown = function isMultSelKeyDown2(e) { - return e.shiftKey || e.metaKey || e.ctrlKey; - }; - var allowPanningPassthrough = function allowPanningPassthrough2(down, downs) { + }, "triggerEvents"); + var isMultSelKeyDown = /* @__PURE__ */ __name(function isMultSelKeyDown2(e3) { + return e3.shiftKey || e3.metaKey || e3.ctrlKey; + }, "isMultSelKeyDown"); + var allowPanningPassthrough = /* @__PURE__ */ __name(function allowPanningPassthrough2(down, downs) { var allowPassthrough = true; - if (r.cy.hasCompoundNodes() && down && down.pannable()) { - for (var i3 = 0; downs && i3 < downs.length; i3++) { - var down = downs[i3]; + if (r2.cy.hasCompoundNodes() && down && down.pannable()) { + for (var i2 = 0; downs && i2 < downs.length; i2++) { + var down = downs[i2]; if (down.isNode() && down.isParent() && !down.pannable()) { allowPassthrough = false; break; @@ -181469,34 +114475,34 @@ g.stateGroup line { allowPassthrough = true; } return allowPassthrough; - }; - var setGrabbed = function setGrabbed2(ele) { + }, "allowPanningPassthrough"); + var setGrabbed = /* @__PURE__ */ __name(function setGrabbed2(ele) { ele[0]._private.grabbed = true; - }; - var setFreed = function setFreed2(ele) { + }, "setGrabbed"); + var setFreed = /* @__PURE__ */ __name(function setFreed2(ele) { ele[0]._private.grabbed = false; - }; - var setInDragLayer = function setInDragLayer2(ele) { + }, "setFreed"); + var setInDragLayer = /* @__PURE__ */ __name(function setInDragLayer2(ele) { ele[0]._private.rscratch.inDragLayer = true; - }; - var setOutDragLayer = function setOutDragLayer2(ele) { + }, "setInDragLayer"); + var setOutDragLayer = /* @__PURE__ */ __name(function setOutDragLayer2(ele) { ele[0]._private.rscratch.inDragLayer = false; - }; - var setGrabTarget = function setGrabTarget2(ele) { + }, "setOutDragLayer"); + var setGrabTarget = /* @__PURE__ */ __name(function setGrabTarget2(ele) { ele[0]._private.rscratch.isGrabTarget = true; - }; - var removeGrabTarget = function removeGrabTarget2(ele) { + }, "setGrabTarget"); + var removeGrabTarget = /* @__PURE__ */ __name(function removeGrabTarget2(ele) { ele[0]._private.rscratch.isGrabTarget = false; - }; - var addToDragList = function addToDragList2(ele, opts) { + }, "removeGrabTarget"); + var addToDragList = /* @__PURE__ */ __name(function addToDragList2(ele, opts) { var list2 = opts.addToList; var listHasEle = list2.has(ele); if (!listHasEle && ele.grabbable() && !ele.locked()) { list2.merge(ele); setGrabbed(ele); } - }; - var addDescendantsToDrag = function addDescendantsToDrag2(node2, opts) { + }, "addToDragList"); + var addDescendantsToDrag = /* @__PURE__ */ __name(function addDescendantsToDrag2(node2, opts) { if (!node2.cy().hasCompoundNodes()) { return; } @@ -181511,140 +114517,140 @@ g.stateGroup line { if (opts.addToList) { addToDragList(innerNodes, opts); } - }; - var addNodesToDrag = function addNodesToDrag2(nodes2, opts) { + }, "addDescendantsToDrag"); + var addNodesToDrag = /* @__PURE__ */ __name(function addNodesToDrag2(nodes6, opts) { opts = opts || {}; - var hasCompoundNodes = nodes2.cy().hasCompoundNodes(); + var hasCompoundNodes2 = nodes6.cy().hasCompoundNodes(); if (opts.inDragLayer) { - nodes2.forEach(setInDragLayer); - nodes2.neighborhood().stdFilter(function(ele) { - return !hasCompoundNodes || ele.isEdge(); + nodes6.forEach(setInDragLayer); + nodes6.neighborhood().stdFilter(function(ele) { + return !hasCompoundNodes2 || ele.isEdge(); }).forEach(setInDragLayer); } if (opts.addToList) { - nodes2.forEach(function(ele) { + nodes6.forEach(function(ele) { addToDragList(ele, opts); }); } - addDescendantsToDrag(nodes2, opts); - updateAncestorsInDragLayer(nodes2, { + addDescendantsToDrag(nodes6, opts); + updateAncestorsInDragLayer(nodes6, { inDragLayer: opts.inDragLayer }); - r.updateCachedGrabbedEles(); - }; + r2.updateCachedGrabbedEles(); + }, "addNodesToDrag"); var addNodeToDrag = addNodesToDrag; - var freeDraggedElements = function freeDraggedElements2(grabbedEles) { + var freeDraggedElements = /* @__PURE__ */ __name(function freeDraggedElements2(grabbedEles) { if (!grabbedEles) { return; } - r.getCachedZSortedEles().forEach(function(ele) { + r2.getCachedZSortedEles().forEach(function(ele) { setFreed(ele); setOutDragLayer(ele); removeGrabTarget(ele); }); - r.updateCachedGrabbedEles(); - }; - var updateAncestorsInDragLayer = function updateAncestorsInDragLayer2(node2, opts) { + r2.updateCachedGrabbedEles(); + }, "freeDraggedElements"); + var updateAncestorsInDragLayer = /* @__PURE__ */ __name(function updateAncestorsInDragLayer2(node2, opts) { if (opts.inDragLayer == null && opts.addToList == null) { return; } if (!node2.cy().hasCompoundNodes()) { return; } - var parent = node2.ancestors().orphans(); - if (parent.same(node2)) { + var parent4 = node2.ancestors().orphans(); + if (parent4.same(node2)) { return; } - var nodes2 = parent.descendants().spawnSelf().merge(parent).unmerge(node2).unmerge(node2.descendants()); - var edges2 = nodes2.connectedEdges(); + var nodes6 = parent4.descendants().spawnSelf().merge(parent4).unmerge(node2).unmerge(node2.descendants()); + var edges5 = nodes6.connectedEdges(); if (opts.inDragLayer) { - edges2.forEach(setInDragLayer); - nodes2.forEach(setInDragLayer); + edges5.forEach(setInDragLayer); + nodes6.forEach(setInDragLayer); } if (opts.addToList) { - nodes2.forEach(function(ele) { + nodes6.forEach(function(ele) { addToDragList(ele, opts); }); } - }; - var blurActiveDomElement = function blurActiveDomElement2() { + }, "updateAncestorsInDragLayer"); + var blurActiveDomElement = /* @__PURE__ */ __name(function blurActiveDomElement2() { if (document.activeElement != null && document.activeElement.blur != null) { document.activeElement.blur(); } - }; + }, "blurActiveDomElement"); var haveMutationsApi = typeof MutationObserver !== "undefined"; var haveResizeObserverApi = typeof ResizeObserver !== "undefined"; if (haveMutationsApi) { - r.removeObserver = new MutationObserver(function(mutns) { - for (var i3 = 0; i3 < mutns.length; i3++) { - var mutn = mutns[i3]; + r2.removeObserver = new MutationObserver(function(mutns) { + for (var i2 = 0; i2 < mutns.length; i2++) { + var mutn = mutns[i2]; var rNodes = mutn.removedNodes; if (rNodes) { - for (var j = 0; j < rNodes.length; j++) { - var rNode = rNodes[j]; - if (rNode === r.container) { - r.destroy(); + for (var j2 = 0; j2 < rNodes.length; j2++) { + var rNode = rNodes[j2]; + if (rNode === r2.container) { + r2.destroy(); break; } } } } }); - if (r.container.parentNode) { - r.removeObserver.observe(r.container.parentNode, { + if (r2.container.parentNode) { + r2.removeObserver.observe(r2.container.parentNode, { childList: true }); } } else { - r.registerBinding(r.container, "DOMNodeRemoved", function(e) { - r.destroy(); + r2.registerBinding(r2.container, "DOMNodeRemoved", function(e3) { + r2.destroy(); }); } var onResize = debounce_1(function() { - r.cy.resize(); + r2.cy.resize(); }, 100); if (haveMutationsApi) { - r.styleObserver = new MutationObserver(onResize); - r.styleObserver.observe(r.container, { + r2.styleObserver = new MutationObserver(onResize); + r2.styleObserver.observe(r2.container, { attributes: true }); } - r.registerBinding(containerWindow, "resize", onResize); + r2.registerBinding(containerWindow, "resize", onResize); if (haveResizeObserverApi) { - r.resizeObserver = new ResizeObserver(onResize); - r.resizeObserver.observe(r.container); + r2.resizeObserver = new ResizeObserver(onResize); + r2.resizeObserver.observe(r2.container); } - var forEachUp = function forEachUp2(domEle, fn2) { + var forEachUp = /* @__PURE__ */ __name(function forEachUp2(domEle, fn3) { while (domEle != null) { - fn2(domEle); + fn3(domEle); domEle = domEle.parentNode; } - }; - var invalidateCoords = function invalidateCoords2() { - r.invalidateContainerClientCoordsCache(); - }; - forEachUp(r.container, function(domEle) { - r.registerBinding(domEle, "transitionend", invalidateCoords); - r.registerBinding(domEle, "animationend", invalidateCoords); - r.registerBinding(domEle, "scroll", invalidateCoords); + }, "forEachUp"); + var invalidateCoords = /* @__PURE__ */ __name(function invalidateCoords2() { + r2.invalidateContainerClientCoordsCache(); + }, "invalidateCoords"); + forEachUp(r2.container, function(domEle) { + r2.registerBinding(domEle, "transitionend", invalidateCoords); + r2.registerBinding(domEle, "animationend", invalidateCoords); + r2.registerBinding(domEle, "scroll", invalidateCoords); }); - r.registerBinding(r.container, "contextmenu", function(e) { - e.preventDefault(); + r2.registerBinding(r2.container, "contextmenu", function(e3) { + e3.preventDefault(); }); - var inBoxSelection = function inBoxSelection2() { - return r.selection[4] !== 0; - }; - var eventInContainer = function eventInContainer2(e) { - var containerPageCoords = r.findContainerClientCoords(); - var x2 = containerPageCoords[0]; - var y2 = containerPageCoords[1]; - var width2 = containerPageCoords[2]; - var height = containerPageCoords[3]; - var positions = e.touches ? e.touches : [e]; + var inBoxSelection = /* @__PURE__ */ __name(function inBoxSelection2() { + return r2.selection[4] !== 0; + }, "inBoxSelection"); + var eventInContainer = /* @__PURE__ */ __name(function eventInContainer2(e3) { + var containerPageCoords = r2.findContainerClientCoords(); + var x5 = containerPageCoords[0]; + var y5 = containerPageCoords[1]; + var width3 = containerPageCoords[2]; + var height2 = containerPageCoords[3]; + var positions2 = e3.touches ? e3.touches : [e3]; var atLeastOnePosInside = false; - for (var i3 = 0; i3 < positions.length; i3++) { - var p2 = positions[i3]; - if (x2 <= p2.clientX && p2.clientX <= x2 + width2 && y2 <= p2.clientY && p2.clientY <= y2 + height) { + for (var i2 = 0; i2 < positions2.length; i2++) { + var p3 = positions2[i2]; + if (x5 <= p3.clientX && p3.clientX <= x5 + width3 && y5 <= p3.clientY && p3.clientY <= y5 + height2) { atLeastOnePosInside = true; break; } @@ -181652,12 +114658,12 @@ g.stateGroup line { if (!atLeastOnePosInside) { return false; } - var container = r.container; - var target = e.target; + var container2 = r2.container; + var target = e3.target; var tParent = target.parentNode; var containerIsTarget = false; while (tParent) { - if (tParent === container) { + if (tParent === container2) { containerIsTarget = true; break; } @@ -181667,35 +114673,38 @@ g.stateGroup line { return false; } return true; - }; - r.registerBinding(r.container, "mousedown", function mousedownHandler(e) { - if (!eventInContainer(e)) { + }, "eventInContainer"); + r2.registerBinding(r2.container, "mousedown", /* @__PURE__ */ __name(function mousedownHandler(e3) { + if (!eventInContainer(e3)) { + return; + } + if (r2.hoverData.which === 1 && e3.which !== 1) { return; } - e.preventDefault(); + e3.preventDefault(); blurActiveDomElement(); - r.hoverData.capture = true; - r.hoverData.which = e.which; - var cy = r.cy; - var gpos = [e.clientX, e.clientY]; - var pos = r.projectIntoViewport(gpos[0], gpos[1]); - var select = r.selection; - var nears = r.findNearestElements(pos[0], pos[1], true, false); + r2.hoverData.capture = true; + r2.hoverData.which = e3.which; + var cy = r2.cy; + var gpos = [e3.clientX, e3.clientY]; + var pos = r2.projectIntoViewport(gpos[0], gpos[1]); + var select = r2.selection; + var nears = r2.findNearestElements(pos[0], pos[1], true, false); var near = nears[0]; - var draggedElements = r.dragData.possibleDragElements; - r.hoverData.mdownPos = pos; - r.hoverData.mdownGPos = gpos; - var checkForTaphold = function checkForTaphold2() { - r.hoverData.tapholdCancelled = false; - clearTimeout(r.hoverData.tapholdTimeout); - r.hoverData.tapholdTimeout = setTimeout(function() { - if (r.hoverData.tapholdCancelled) { + var draggedElements = r2.dragData.possibleDragElements; + r2.hoverData.mdownPos = pos; + r2.hoverData.mdownGPos = gpos; + var checkForTaphold = /* @__PURE__ */ __name(function checkForTaphold2() { + r2.hoverData.tapholdCancelled = false; + clearTimeout(r2.hoverData.tapholdTimeout); + r2.hoverData.tapholdTimeout = setTimeout(function() { + if (r2.hoverData.tapholdCancelled) { return; } else { - var ele = r.hoverData.down; + var ele = r2.hoverData.down; if (ele) { ele.emit({ - originalEvent: e, + originalEvent: e3, type: "taphold", position: { x: pos[0], @@ -181704,7 +114713,7 @@ g.stateGroup line { }); } else { cy.emit({ - originalEvent: e, + originalEvent: e3, type: "taphold", position: { x: pos[0], @@ -181713,12 +114722,12 @@ g.stateGroup line { }); } } - }, r.tapholdDuration); - }; - if (e.which == 3) { - r.hoverData.cxtStarted = true; + }, r2.tapholdDuration); + }, "checkForTaphold"); + if (e3.which == 3) { + r2.hoverData.cxtStarted = true; var cxtEvt = { - originalEvent: e, + originalEvent: e3, type: "cxttapstart", position: { x: pos[0], @@ -181728,43 +114737,43 @@ g.stateGroup line { if (near) { near.activate(); near.emit(cxtEvt); - r.hoverData.down = near; + r2.hoverData.down = near; } else { cy.emit(cxtEvt); } - r.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); - r.hoverData.cxtDragged = false; - } else if (e.which == 1) { + r2.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); + r2.hoverData.cxtDragged = false; + } else if (e3.which == 1) { if (near) { near.activate(); } { if (near != null) { - if (r.nodeIsGrabbable(near)) { - var makeEvent = function makeEvent2(type2) { + if (r2.nodeIsGrabbable(near)) { + var makeEvent = /* @__PURE__ */ __name(function makeEvent2(type3) { return { - originalEvent: e, - type: type2, + originalEvent: e3, + type: type3, position: { x: pos[0], y: pos[1] } }; - }; - var triggerGrab = function triggerGrab2(ele) { + }, "makeEvent"); + var triggerGrab = /* @__PURE__ */ __name(function triggerGrab2(ele) { ele.emit(makeEvent("grab")); - }; + }, "triggerGrab"); setGrabTarget(near); if (!near.selected()) { - draggedElements = r.dragData.possibleDragElements = cy.collection(); + draggedElements = r2.dragData.possibleDragElements = cy.collection(); addNodeToDrag(near, { addToList: draggedElements }); near.emit(makeEvent("grabon")).emit(makeEvent("grab")); } else { - draggedElements = r.dragData.possibleDragElements = cy.collection(); + draggedElements = r2.dragData.possibleDragElements = cy.collection(); var selectedNodes = cy.$(function(ele) { - return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele); + return ele.isNode() && ele.selected() && r2.nodeIsGrabbable(ele); }); addNodesToDrag(selectedNodes, { addToList: draggedElements @@ -181772,26 +114781,26 @@ g.stateGroup line { near.emit(makeEvent("grabon")); selectedNodes.forEach(triggerGrab); } - r.redrawHint("eles", true); - r.redrawHint("drag", true); + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); } } - r.hoverData.down = near; - r.hoverData.downs = nears; - r.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); + r2.hoverData.down = near; + r2.hoverData.downs = nears; + r2.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); } - triggerEvents(near, ["mousedown", "tapstart", "vmousedown"], e, { + triggerEvents(near, ["mousedown", "tapstart", "vmousedown"], e3, { x: pos[0], y: pos[1] }); if (near == null) { select[4] = 1; - r.data.bgActivePosistion = { + r2.data.bgActivePosistion = { x: pos[0], y: pos[1] }; - r.redrawHint("select", true); - r.redraw(); + r2.redrawHint("select", true); + r2.redraw(); } else if (near.pannable()) { select[4] = 1; } @@ -181799,28 +114808,28 @@ g.stateGroup line { } select[0] = select[2] = pos[0]; select[1] = select[3] = pos[1]; - }, false); - r.registerBinding(containerWindow, "mousemove", function mousemoveHandler(e) { - var capture = r.hoverData.capture; - if (!capture && !eventInContainer(e)) { + }, "mousedownHandler"), false); + r2.registerBinding(containerWindow, "mousemove", /* @__PURE__ */ __name(function mousemoveHandler(e3) { + var capture = r2.hoverData.capture; + if (!capture && !eventInContainer(e3)) { return; } - var preventDefault = false; - var cy = r.cy; - var zoom = cy.zoom(); - var gpos = [e.clientX, e.clientY]; - var pos = r.projectIntoViewport(gpos[0], gpos[1]); - var mdownPos = r.hoverData.mdownPos; - var mdownGPos = r.hoverData.mdownGPos; - var select = r.selection; + var preventDefault2 = false; + var cy = r2.cy; + var zoom2 = cy.zoom(); + var gpos = [e3.clientX, e3.clientY]; + var pos = r2.projectIntoViewport(gpos[0], gpos[1]); + var mdownPos = r2.hoverData.mdownPos; + var mdownGPos = r2.hoverData.mdownGPos; + var select = r2.selection; var near = null; - if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) { - near = r.findNearestElement(pos[0], pos[1], true, false); + if (!r2.hoverData.draggingEles && !r2.hoverData.dragging && !r2.hoverData.selecting) { + near = r2.findNearestElement(pos[0], pos[1], true, false); } - var last2 = r.hoverData.last; - var down = r.hoverData.down; + var last3 = r2.hoverData.last; + var down = r2.hoverData.down; var disp = [pos[0] - select[2], pos[1] - select[3]]; - var draggedElements = r.dragData.possibleDragElements; + var draggedElements = r2.dragData.possibleDragElements; var isOverThresholdDrag; if (mdownGPos) { var dx = gpos[0] - mdownGPos[0]; @@ -181828,14 +114837,14 @@ g.stateGroup line { var dy = gpos[1] - mdownGPos[1]; var dy2 = dy * dy; var dist22 = dx2 + dy2; - r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist22 >= r.desktopTapThreshold2; + r2.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist22 >= r2.desktopTapThreshold2; } - var multSelKeyDown = isMultSelKeyDown(e); + var multSelKeyDown = isMultSelKeyDown(e3); if (isOverThresholdDrag) { - r.hoverData.tapholdCancelled = true; + r2.hoverData.tapholdCancelled = true; } - var updateDragDelta = function updateDragDelta2() { - var dragDelta2 = r.hoverData.dragDelta = r.hoverData.dragDelta || []; + var updateDragDelta = /* @__PURE__ */ __name(function updateDragDelta2() { + var dragDelta2 = r2.hoverData.dragDelta = r2.hoverData.dragDelta || []; if (dragDelta2.length === 0) { dragDelta2.push(disp[0]); dragDelta2.push(disp[1]); @@ -181843,17 +114852,17 @@ g.stateGroup line { dragDelta2[0] += disp[0]; dragDelta2[1] += disp[1]; } - }; - preventDefault = true; - triggerEvents(near, ["mousemove", "vmousemove", "tapdrag"], e, { + }, "updateDragDelta"); + preventDefault2 = true; + triggerEvents(near, ["mousemove", "vmousemove", "tapdrag"], e3, { x: pos[0], y: pos[1] }); - var goIntoBoxMode = function goIntoBoxMode2() { - r.data.bgActivePosistion = void 0; - if (!r.hoverData.selecting) { + var goIntoBoxMode = /* @__PURE__ */ __name(function goIntoBoxMode2() { + r2.data.bgActivePosistion = void 0; + if (!r2.hoverData.selecting) { cy.emit({ - originalEvent: e, + originalEvent: e3, type: "boxstart", position: { x: pos[0], @@ -181862,14 +114871,14 @@ g.stateGroup line { }); } select[4] = 1; - r.hoverData.selecting = true; - r.redrawHint("select", true); - r.redraw(); - }; - if (r.hoverData.which === 3) { + r2.hoverData.selecting = true; + r2.redrawHint("select", true); + r2.redraw(); + }, "goIntoBoxMode"); + if (r2.hoverData.which === 3) { if (isOverThresholdDrag) { var cxtEvt = { - originalEvent: e, + originalEvent: e3, type: "cxtdrag", position: { x: pos[0], @@ -181881,11 +114890,11 @@ g.stateGroup line { } else { cy.emit(cxtEvt); } - r.hoverData.cxtDragged = true; - if (!r.hoverData.cxtOver || near !== r.hoverData.cxtOver) { - if (r.hoverData.cxtOver) { - r.hoverData.cxtOver.emit({ - originalEvent: e, + r2.hoverData.cxtDragged = true; + if (!r2.hoverData.cxtOver || near !== r2.hoverData.cxtOver) { + if (r2.hoverData.cxtOver) { + r2.hoverData.cxtOver.emit({ + originalEvent: e3, type: "cxtdragout", position: { x: pos[0], @@ -181893,10 +114902,10 @@ g.stateGroup line { } }); } - r.hoverData.cxtOver = near; + r2.hoverData.cxtOver = near; if (near) { near.emit({ - originalEvent: e, + originalEvent: e3, type: "cxtdragover", position: { x: pos[0], @@ -181906,41 +114915,41 @@ g.stateGroup line { } } } - } else if (r.hoverData.dragging) { - preventDefault = true; + } else if (r2.hoverData.dragging) { + preventDefault2 = true; if (cy.panningEnabled() && cy.userPanningEnabled()) { var deltaP; - if (r.hoverData.justStartedPan) { - var mdPos = r.hoverData.mdownPos; + if (r2.hoverData.justStartedPan) { + var mdPos = r2.hoverData.mdownPos; deltaP = { - x: (pos[0] - mdPos[0]) * zoom, - y: (pos[1] - mdPos[1]) * zoom + x: (pos[0] - mdPos[0]) * zoom2, + y: (pos[1] - mdPos[1]) * zoom2 }; - r.hoverData.justStartedPan = false; + r2.hoverData.justStartedPan = false; } else { deltaP = { - x: disp[0] * zoom, - y: disp[1] * zoom + x: disp[0] * zoom2, + y: disp[1] * zoom2 }; } cy.panBy(deltaP); cy.emit("dragpan"); - r.hoverData.dragged = true; + r2.hoverData.dragged = true; } - pos = r.projectIntoViewport(e.clientX, e.clientY); + pos = r2.projectIntoViewport(e3.clientX, e3.clientY); } else if (select[4] == 1 && (down == null || down.pannable())) { if (isOverThresholdDrag) { - if (!r.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) { + if (!r2.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) { goIntoBoxMode(); - } else if (!r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) { - var allowPassthrough = allowPanningPassthrough(down, r.hoverData.downs); + } else if (!r2.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) { + var allowPassthrough = allowPanningPassthrough(down, r2.hoverData.downs); if (allowPassthrough) { - r.hoverData.dragging = true; - r.hoverData.justStartedPan = true; + r2.hoverData.dragging = true; + r2.hoverData.justStartedPan = true; select[4] = 0; - r.data.bgActivePosistion = array2point(mdownPos); - r.redrawHint("select", true); - r.redraw(); + r2.data.bgActivePosistion = array2point(mdownPos); + r2.redrawHint("select", true); + r2.redraw(); } } if (down && down.pannable() && down.active()) { @@ -181951,20 +114960,20 @@ g.stateGroup line { if (down && down.pannable() && down.active()) { down.unactivate(); } - if ((!down || !down.grabbed()) && near != last2) { - if (last2) { - triggerEvents(last2, ["mouseout", "tapdragout"], e, { + if ((!down || !down.grabbed()) && near != last3) { + if (last3) { + triggerEvents(last3, ["mouseout", "tapdragout"], e3, { x: pos[0], y: pos[1] }); } if (near) { - triggerEvents(near, ["mouseover", "tapdragover"], e, { + triggerEvents(near, ["mouseover", "tapdragover"], e3, { x: pos[0], y: pos[1] }); } - r.hoverData.last = near; + r2.hoverData.last = near; } if (down) { if (isOverThresholdDrag) { @@ -181973,19 +114982,19 @@ g.stateGroup line { freeDraggedElements(draggedElements); down.emit("freeon"); draggedElements.emit("free"); - if (r.dragData.didDrag) { + if (r2.dragData.didDrag) { down.emit("dragfreeon"); draggedElements.emit("dragfree"); } } goIntoBoxMode(); - } else if (down && down.grabbed() && r.nodeIsDraggable(down)) { - var justStartedDrag = !r.dragData.didDrag; + } else if (down && down.grabbed() && r2.nodeIsDraggable(down)) { + var justStartedDrag = !r2.dragData.didDrag; if (justStartedDrag) { - r.redrawHint("eles", true); + r2.redrawHint("eles", true); } - r.dragData.didDrag = true; - if (!r.hoverData.draggingEles) { + r2.dragData.didDrag = true; + if (!r2.hoverData.draggingEles) { addNodesToDrag(draggedElements, { inDragLayer: true }); @@ -181994,64 +115003,65 @@ g.stateGroup line { x: 0, y: 0 }; - if (number$12(disp[0]) && number$12(disp[1])) { + if (number$1(disp[0]) && number$1(disp[1])) { totalShift.x += disp[0]; totalShift.y += disp[1]; if (justStartedDrag) { - var dragDelta = r.hoverData.dragDelta; - if (dragDelta && number$12(dragDelta[0]) && number$12(dragDelta[1])) { + var dragDelta = r2.hoverData.dragDelta; + if (dragDelta && number$1(dragDelta[0]) && number$1(dragDelta[1])) { totalShift.x += dragDelta[0]; totalShift.y += dragDelta[1]; } } } - r.hoverData.draggingEles = true; + r2.hoverData.draggingEles = true; draggedElements.silentShift(totalShift).emit("position drag"); - r.redrawHint("drag", true); - r.redraw(); + r2.redrawHint("drag", true); + r2.redraw(); } } else { updateDragDelta(); } } - preventDefault = true; + preventDefault2 = true; } select[2] = pos[0]; select[3] = pos[1]; - if (preventDefault) { - if (e.stopPropagation) - e.stopPropagation(); - if (e.preventDefault) - e.preventDefault(); + if (preventDefault2) { + if (e3.stopPropagation) e3.stopPropagation(); + if (e3.preventDefault) e3.preventDefault(); return false; } - }, false); + }, "mousemoveHandler"), false); var clickTimeout, didDoubleClick, prevClickTimeStamp; - r.registerBinding(containerWindow, "mouseup", function mouseupHandler(e) { - var capture = r.hoverData.capture; + r2.registerBinding(containerWindow, "mouseup", /* @__PURE__ */ __name(function mouseupHandler(e3) { + if (r2.hoverData.which === 1 && e3.which !== 1 && r2.hoverData.capture) { + return; + } + var capture = r2.hoverData.capture; if (!capture) { return; } - r.hoverData.capture = false; - var cy = r.cy; - var pos = r.projectIntoViewport(e.clientX, e.clientY); - var select = r.selection; - var near = r.findNearestElement(pos[0], pos[1], true, false); - var draggedElements = r.dragData.possibleDragElements; - var down = r.hoverData.down; - var multSelKeyDown = isMultSelKeyDown(e); - if (r.data.bgActivePosistion) { - r.redrawHint("select", true); - r.redraw(); - } - r.hoverData.tapholdCancelled = true; - r.data.bgActivePosistion = void 0; + r2.hoverData.capture = false; + var cy = r2.cy; + var pos = r2.projectIntoViewport(e3.clientX, e3.clientY); + var select = r2.selection; + var near = r2.findNearestElement(pos[0], pos[1], true, false); + var draggedElements = r2.dragData.possibleDragElements; + var down = r2.hoverData.down; + var multSelKeyDown = isMultSelKeyDown(e3); + if (r2.data.bgActivePosistion) { + r2.redrawHint("select", true); + r2.redraw(); + } + r2.hoverData.tapholdCancelled = true; + r2.data.bgActivePosistion = void 0; if (down) { down.unactivate(); } - if (r.hoverData.which === 3) { + if (r2.hoverData.which === 3) { var cxtEvt = { - originalEvent: e, + originalEvent: e3, type: "cxttapend", position: { x: pos[0], @@ -182063,9 +115073,9 @@ g.stateGroup line { } else { cy.emit(cxtEvt); } - if (!r.hoverData.cxtDragged) { + if (!r2.hoverData.cxtDragged) { var cxtTap = { - originalEvent: e, + originalEvent: e3, type: "cxttap", position: { x: pos[0], @@ -182078,53 +115088,51 @@ g.stateGroup line { cy.emit(cxtTap); } } - r.hoverData.cxtDragged = false; - r.hoverData.which = null; - } else if (r.hoverData.which === 1) { - triggerEvents(near, ["mouseup", "tapend", "vmouseup"], e, { + r2.hoverData.cxtDragged = false; + r2.hoverData.which = null; + } else if (r2.hoverData.which === 1) { + triggerEvents(near, ["mouseup", "tapend", "vmouseup"], e3, { x: pos[0], y: pos[1] }); - if (!r.dragData.didDrag && // didn't move a node around - !r.hoverData.dragged && // didn't pan - !r.hoverData.selecting && // not box selection - !r.hoverData.isOverThresholdDrag) { - triggerEvents(down, ["click", "tap", "vclick"], e, { + if (!r2.dragData.didDrag && // didn't move a node around + !r2.hoverData.dragged && // didn't pan + !r2.hoverData.selecting && // not box selection + !r2.hoverData.isOverThresholdDrag) { + triggerEvents(down, ["click", "tap", "vclick"], e3, { x: pos[0], y: pos[1] }); didDoubleClick = false; - if (e.timeStamp - prevClickTimeStamp <= cy.multiClickDebounceTime()) { + if (e3.timeStamp - prevClickTimeStamp <= cy.multiClickDebounceTime()) { clickTimeout && clearTimeout(clickTimeout); didDoubleClick = true; prevClickTimeStamp = null; - triggerEvents(down, ["dblclick", "dbltap", "vdblclick"], e, { + triggerEvents(down, ["dblclick", "dbltap", "vdblclick"], e3, { x: pos[0], y: pos[1] }); } else { clickTimeout = setTimeout(function() { - if (didDoubleClick) - return; - triggerEvents(down, ["oneclick", "onetap", "voneclick"], e, { + if (didDoubleClick) return; + triggerEvents(down, ["oneclick", "onetap", "voneclick"], e3, { x: pos[0], y: pos[1] }); }, cy.multiClickDebounceTime()); - prevClickTimeStamp = e.timeStamp; + prevClickTimeStamp = e3.timeStamp; } } - if (down == null && !r.dragData.didDrag && !r.hoverData.selecting && !r.hoverData.dragged && !isMultSelKeyDown(e)) { + if (down == null && !r2.dragData.didDrag && !r2.hoverData.selecting && !r2.hoverData.dragged && !isMultSelKeyDown(e3)) { cy.$(isSelected).unselect(["tapunselect"]); if (draggedElements.length > 0) { - r.redrawHint("eles", true); + r2.redrawHint("eles", true); } - r.dragData.possibleDragElements = draggedElements = cy.collection(); + r2.dragData.possibleDragElements = draggedElements = cy.collection(); } - if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) { + if (near == down && !r2.dragData.didDrag && !r2.hoverData.selecting) { if (near != null && near._private.selectable) { - if (r.hoverData.dragging) - ; + if (r2.hoverData.dragging) ; else if (cy.selectionType() === "additive" || multSelKeyDown) { if (near.selected()) { near.unselect(["tapunselect"]); @@ -182137,26 +115145,26 @@ g.stateGroup line { near.select(["tapselect"]); } } - r.redrawHint("eles", true); + r2.redrawHint("eles", true); } } - if (r.hoverData.selecting) { - var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); - r.redrawHint("select", true); + if (r2.hoverData.selecting) { + var box = cy.collection(r2.getAllInBox(select[0], select[1], select[2], select[3])); + r2.redrawHint("select", true); if (box.length > 0) { - r.redrawHint("eles", true); + r2.redrawHint("eles", true); } cy.emit({ type: "boxend", - originalEvent: e, + originalEvent: e3, position: { x: pos[0], y: pos[1] } }); - var eleWouldBeSelected = function eleWouldBeSelected2(ele) { + var eleWouldBeSelected = /* @__PURE__ */ __name(function eleWouldBeSelected2(ele) { return ele.selectable() && !ele.selected(); - }; + }, "eleWouldBeSelected"); if (cy.selectionType() === "additive") { box.emit("box").stdFilter(eleWouldBeSelected).select().emit("boxselect"); } else { @@ -182165,23 +115173,23 @@ g.stateGroup line { } box.emit("box").stdFilter(eleWouldBeSelected).select().emit("boxselect"); } - r.redraw(); + r2.redraw(); } - if (r.hoverData.dragging) { - r.hoverData.dragging = false; - r.redrawHint("select", true); - r.redrawHint("eles", true); - r.redraw(); + if (r2.hoverData.dragging) { + r2.hoverData.dragging = false; + r2.redrawHint("select", true); + r2.redrawHint("eles", true); + r2.redraw(); } if (!select[4]) { - r.redrawHint("drag", true); - r.redrawHint("eles", true); + r2.redrawHint("drag", true); + r2.redrawHint("eles", true); var downWasGrabbed = down && down.grabbed(); freeDraggedElements(draggedElements); if (downWasGrabbed) { down.emit("freeon"); draggedElements.emit("free"); - if (r.dragData.didDrag) { + if (r2.dragData.didDrag) { down.emit("dragfreeon"); draggedElements.emit("dragfree"); } @@ -182189,55 +115197,55 @@ g.stateGroup line { } } select[4] = 0; - r.hoverData.down = null; - r.hoverData.cxtStarted = false; - r.hoverData.draggingEles = false; - r.hoverData.selecting = false; - r.hoverData.isOverThresholdDrag = false; - r.dragData.didDrag = false; - r.hoverData.dragged = false; - r.hoverData.dragDelta = []; - r.hoverData.mdownPos = null; - r.hoverData.mdownGPos = null; - }, false); - var wheelHandler = function wheelHandler2(e) { - if (r.scrollingPage) { + r2.hoverData.down = null; + r2.hoverData.cxtStarted = false; + r2.hoverData.draggingEles = false; + r2.hoverData.selecting = false; + r2.hoverData.isOverThresholdDrag = false; + r2.dragData.didDrag = false; + r2.hoverData.dragged = false; + r2.hoverData.dragDelta = []; + r2.hoverData.mdownPos = null; + r2.hoverData.mdownGPos = null; + }, "mouseupHandler"), false); + var wheelHandler = /* @__PURE__ */ __name(function wheelHandler2(e3) { + if (r2.scrollingPage) { return; } - var cy = r.cy; - var zoom = cy.zoom(); - var pan = cy.pan(); - var pos = r.projectIntoViewport(e.clientX, e.clientY); - var rpos = [pos[0] * zoom + pan.x, pos[1] * zoom + pan.y]; - if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) { - e.preventDefault(); + var cy = r2.cy; + var zoom2 = cy.zoom(); + var pan2 = cy.pan(); + var pos = r2.projectIntoViewport(e3.clientX, e3.clientY); + var rpos = [pos[0] * zoom2 + pan2.x, pos[1] * zoom2 + pan2.y]; + if (r2.hoverData.draggingEles || r2.hoverData.dragging || r2.hoverData.cxtStarted || inBoxSelection()) { + e3.preventDefault(); return; } if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) { - e.preventDefault(); - r.data.wheelZooming = true; - clearTimeout(r.data.wheelTimeout); - r.data.wheelTimeout = setTimeout(function() { - r.data.wheelZooming = false; - r.redrawHint("eles", true); - r.redraw(); + e3.preventDefault(); + r2.data.wheelZooming = true; + clearTimeout(r2.data.wheelTimeout); + r2.data.wheelTimeout = setTimeout(function() { + r2.data.wheelZooming = false; + r2.redrawHint("eles", true); + r2.redraw(); }, 150); - var diff; - if (e.deltaY != null) { - diff = e.deltaY / -250; - } else if (e.wheelDeltaY != null) { - diff = e.wheelDeltaY / 1e3; + var diff2; + if (e3.deltaY != null) { + diff2 = e3.deltaY / -250; + } else if (e3.wheelDeltaY != null) { + diff2 = e3.wheelDeltaY / 1e3; } else { - diff = e.wheelDelta / 1e3; + diff2 = e3.wheelDelta / 1e3; } - diff = diff * r.wheelSensitivity; - var needsWheelFix = e.deltaMode === 1; + diff2 = diff2 * r2.wheelSensitivity; + var needsWheelFix = e3.deltaMode === 1; if (needsWheelFix) { - diff *= 33; + diff2 *= 33; } - var newZoom = cy.zoom() * Math.pow(10, diff); - if (e.type === "gesturechange") { - newZoom = r.gestureStartZoom * e.scale; + var newZoom = cy.zoom() * Math.pow(10, diff2); + if (e3.type === "gesturechange") { + newZoom = r2.gestureStartZoom * e3.scale; } cy.zoom({ level: newZoom, @@ -182246,174 +115254,173 @@ g.stateGroup line { y: rpos[1] } }); - cy.emit(e.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); - } - }; - r.registerBinding(r.container, "wheel", wheelHandler, true); - r.registerBinding(containerWindow, "scroll", function scrollHandler(e) { - r.scrollingPage = true; - clearTimeout(r.scrollingPageTimeout); - r.scrollingPageTimeout = setTimeout(function() { - r.scrollingPage = false; + cy.emit(e3.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); + } + }, "wheelHandler"); + r2.registerBinding(r2.container, "wheel", wheelHandler, true); + r2.registerBinding(containerWindow, "scroll", /* @__PURE__ */ __name(function scrollHandler(e3) { + r2.scrollingPage = true; + clearTimeout(r2.scrollingPageTimeout); + r2.scrollingPageTimeout = setTimeout(function() { + r2.scrollingPage = false; }, 250); - }, true); - r.registerBinding(r.container, "gesturestart", function gestureStartHandler(e) { - r.gestureStartZoom = r.cy.zoom(); - if (!r.hasTouchStarted) { - e.preventDefault(); + }, "scrollHandler"), true); + r2.registerBinding(r2.container, "gesturestart", /* @__PURE__ */ __name(function gestureStartHandler(e3) { + r2.gestureStartZoom = r2.cy.zoom(); + if (!r2.hasTouchStarted) { + e3.preventDefault(); } - }, true); - r.registerBinding(r.container, "gesturechange", function(e) { - if (!r.hasTouchStarted) { - wheelHandler(e); + }, "gestureStartHandler"), true); + r2.registerBinding(r2.container, "gesturechange", function(e3) { + if (!r2.hasTouchStarted) { + wheelHandler(e3); } }, true); - r.registerBinding(r.container, "mouseout", function mouseOutHandler(e) { - var pos = r.projectIntoViewport(e.clientX, e.clientY); - r.cy.emit({ - originalEvent: e, + r2.registerBinding(r2.container, "mouseout", /* @__PURE__ */ __name(function mouseOutHandler(e3) { + var pos = r2.projectIntoViewport(e3.clientX, e3.clientY); + r2.cy.emit({ + originalEvent: e3, type: "mouseout", position: { x: pos[0], y: pos[1] } }); - }, false); - r.registerBinding(r.container, "mouseover", function mouseOverHandler(e) { - var pos = r.projectIntoViewport(e.clientX, e.clientY); - r.cy.emit({ - originalEvent: e, + }, "mouseOutHandler"), false); + r2.registerBinding(r2.container, "mouseover", /* @__PURE__ */ __name(function mouseOverHandler(e3) { + var pos = r2.projectIntoViewport(e3.clientX, e3.clientY); + r2.cy.emit({ + originalEvent: e3, type: "mouseover", position: { x: pos[0], y: pos[1] } }); - }, false); + }, "mouseOverHandler"), false); var f1x1, f1y1, f2x1, f2y1; var distance1, distance1Sq; var center1, modelCenter1; var offsetLeft, offsetTop; var containerWidth, containerHeight; var twoFingersStartInside; - var distance2 = function distance3(x1, y1, x2, y2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); - }; - var distanceSq = function distanceSq2(x1, y1, x2, y2) { - return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); - }; + var distance2 = /* @__PURE__ */ __name(function distance3(x1, y1, x22, y22) { + return Math.sqrt((x22 - x1) * (x22 - x1) + (y22 - y1) * (y22 - y1)); + }, "distance"); + var distanceSq = /* @__PURE__ */ __name(function distanceSq2(x1, y1, x22, y22) { + return (x22 - x1) * (x22 - x1) + (y22 - y1) * (y22 - y1); + }, "distanceSq"); var touchstartHandler; - r.registerBinding(r.container, "touchstart", touchstartHandler = function touchstartHandler2(e) { - r.hasTouchStarted = true; - if (!eventInContainer(e)) { + r2.registerBinding(r2.container, "touchstart", touchstartHandler = /* @__PURE__ */ __name(function touchstartHandler2(e3) { + r2.hasTouchStarted = true; + if (!eventInContainer(e3)) { return; } blurActiveDomElement(); - r.touchData.capture = true; - r.data.bgActivePosistion = void 0; - var cy = r.cy; - var now3 = r.touchData.now; - var earlier = r.touchData.earlier; - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now3[0] = pos[0]; - now3[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY); - now3[2] = pos[0]; - now3[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY); - now3[4] = pos[0]; - now3[5] = pos[1]; - } - if (e.touches[1]) { - r.touchData.singleTouchMoved = true; - freeDraggedElements(r.dragData.touchDragEles); - var offsets = r.findContainerClientCoords(); + r2.touchData.capture = true; + r2.data.bgActivePosistion = void 0; + var cy = r2.cy; + var now4 = r2.touchData.now; + var earlier = r2.touchData.earlier; + if (e3.touches[0]) { + var pos = r2.projectIntoViewport(e3.touches[0].clientX, e3.touches[0].clientY); + now4[0] = pos[0]; + now4[1] = pos[1]; + } + if (e3.touches[1]) { + var pos = r2.projectIntoViewport(e3.touches[1].clientX, e3.touches[1].clientY); + now4[2] = pos[0]; + now4[3] = pos[1]; + } + if (e3.touches[2]) { + var pos = r2.projectIntoViewport(e3.touches[2].clientX, e3.touches[2].clientY); + now4[4] = pos[0]; + now4[5] = pos[1]; + } + if (e3.touches[1]) { + r2.touchData.singleTouchMoved = true; + freeDraggedElements(r2.dragData.touchDragEles); + var offsets = r2.findContainerClientCoords(); offsetLeft = offsets[0]; offsetTop = offsets[1]; containerWidth = offsets[2]; containerHeight = offsets[3]; - f1x1 = e.touches[0].clientX - offsetLeft; - f1y1 = e.touches[0].clientY - offsetTop; - f2x1 = e.touches[1].clientX - offsetLeft; - f2y1 = e.touches[1].clientY - offsetTop; + f1x1 = e3.touches[0].clientX - offsetLeft; + f1y1 = e3.touches[0].clientY - offsetTop; + f2x1 = e3.touches[1].clientX - offsetLeft; + f2y1 = e3.touches[1].clientY - offsetTop; twoFingersStartInside = 0 <= f1x1 && f1x1 <= containerWidth && 0 <= f2x1 && f2x1 <= containerWidth && 0 <= f1y1 && f1y1 <= containerHeight && 0 <= f2y1 && f2y1 <= containerHeight; - var pan = cy.pan(); - var zoom = cy.zoom(); + var pan2 = cy.pan(); + var zoom2 = cy.zoom(); distance1 = distance2(f1x1, f1y1, f2x1, f2y1); distance1Sq = distanceSq(f1x1, f1y1, f2x1, f2y1); center1 = [(f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2]; - modelCenter1 = [(center1[0] - pan.x) / zoom, (center1[1] - pan.y) / zoom]; + modelCenter1 = [(center1[0] - pan2.x) / zoom2, (center1[1] - pan2.y) / zoom2]; var cxtDistThreshold = 200; var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; - if (distance1Sq < cxtDistThresholdSq && !e.touches[2]) { - var near1 = r.findNearestElement(now3[0], now3[1], true, true); - var near2 = r.findNearestElement(now3[2], now3[3], true, true); + if (distance1Sq < cxtDistThresholdSq && !e3.touches[2]) { + var near1 = r2.findNearestElement(now4[0], now4[1], true, true); + var near2 = r2.findNearestElement(now4[2], now4[3], true, true); if (near1 && near1.isNode()) { near1.activate().emit({ - originalEvent: e, + originalEvent: e3, type: "cxttapstart", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); - r.touchData.start = near1; + r2.touchData.start = near1; } else if (near2 && near2.isNode()) { near2.activate().emit({ - originalEvent: e, + originalEvent: e3, type: "cxttapstart", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); - r.touchData.start = near2; + r2.touchData.start = near2; } else { cy.emit({ - originalEvent: e, + originalEvent: e3, type: "cxttapstart", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); } - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; + if (r2.touchData.start) { + r2.touchData.start._private.grabbed = false; } - r.touchData.cxt = true; - r.touchData.cxtDragged = false; - r.data.bgActivePosistion = void 0; - r.redraw(); + r2.touchData.cxt = true; + r2.touchData.cxtDragged = false; + r2.data.bgActivePosistion = void 0; + r2.redraw(); return; } } - if (e.touches[2]) { + if (e3.touches[2]) { if (cy.boxSelectionEnabled()) { - e.preventDefault(); + e3.preventDefault(); } - } else if (e.touches[1]) - ; - else if (e.touches[0]) { - var nears = r.findNearestElements(now3[0], now3[1], true, true); + } else if (e3.touches[1]) ; + else if (e3.touches[0]) { + var nears = r2.findNearestElements(now4[0], now4[1], true, true); var near = nears[0]; if (near != null) { near.activate(); - r.touchData.start = near; - r.touchData.starts = nears; - if (r.nodeIsGrabbable(near)) { - var draggedEles = r.dragData.touchDragEles = cy.collection(); + r2.touchData.start = near; + r2.touchData.starts = nears; + if (r2.nodeIsGrabbable(near)) { + var draggedEles = r2.dragData.touchDragEles = cy.collection(); var selectedNodes = null; - r.redrawHint("eles", true); - r.redrawHint("drag", true); + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); if (near.selected()) { selectedNodes = cy.$(function(ele) { - return ele.selected() && r.nodeIsGrabbable(ele); + return ele.selected() && r2.nodeIsGrabbable(ele); }); addNodesToDrag(selectedNodes, { addToList: draggedEles @@ -182424,103 +115431,103 @@ g.stateGroup line { }); } setGrabTarget(near); - var makeEvent = function makeEvent2(type2) { + var makeEvent = /* @__PURE__ */ __name(function makeEvent2(type3) { return { - originalEvent: e, - type: type2, + originalEvent: e3, + type: type3, position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }; - }; + }, "makeEvent"); near.emit(makeEvent("grabon")); if (selectedNodes) { - selectedNodes.forEach(function(n) { - n.emit(makeEvent("grab")); + selectedNodes.forEach(function(n2) { + n2.emit(makeEvent("grab")); }); } else { near.emit(makeEvent("grab")); } } } - triggerEvents(near, ["touchstart", "tapstart", "vmousedown"], e, { - x: now3[0], - y: now3[1] + triggerEvents(near, ["touchstart", "tapstart", "vmousedown"], e3, { + x: now4[0], + y: now4[1] }); if (near == null) { - r.data.bgActivePosistion = { + r2.data.bgActivePosistion = { x: pos[0], y: pos[1] }; - r.redrawHint("select", true); - r.redraw(); - } - r.touchData.singleTouchMoved = false; - r.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(); - clearTimeout(r.touchData.tapholdTimeout); - r.touchData.tapholdTimeout = setTimeout(function() { - if (r.touchData.singleTouchMoved === false && !r.pinching && !r.touchData.selecting) { - triggerEvents(r.touchData.start, ["taphold"], e, { - x: now3[0], - y: now3[1] + r2.redrawHint("select", true); + r2.redraw(); + } + r2.touchData.singleTouchMoved = false; + r2.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(); + clearTimeout(r2.touchData.tapholdTimeout); + r2.touchData.tapholdTimeout = setTimeout(function() { + if (r2.touchData.singleTouchMoved === false && !r2.pinching && !r2.touchData.selecting) { + triggerEvents(r2.touchData.start, ["taphold"], e3, { + x: now4[0], + y: now4[1] }); } - }, r.tapholdDuration); + }, r2.tapholdDuration); } - if (e.touches.length >= 1) { - var sPos = r.touchData.startPosition = [null, null, null, null, null, null]; - for (var i3 = 0; i3 < now3.length; i3++) { - sPos[i3] = earlier[i3] = now3[i3]; + if (e3.touches.length >= 1) { + var sPos = r2.touchData.startPosition = [null, null, null, null, null, null]; + for (var i2 = 0; i2 < now4.length; i2++) { + sPos[i2] = earlier[i2] = now4[i2]; } - var touch0 = e.touches[0]; - r.touchData.startGPosition = [touch0.clientX, touch0.clientY]; + var touch0 = e3.touches[0]; + r2.touchData.startGPosition = [touch0.clientX, touch0.clientY]; } - }, false); + }, "touchstartHandler"), false); var touchmoveHandler; - r.registerBinding(window, "touchmove", touchmoveHandler = function touchmoveHandler2(e) { - var capture = r.touchData.capture; - if (!capture && !eventInContainer(e)) { + r2.registerBinding(containerWindow, "touchmove", touchmoveHandler = /* @__PURE__ */ __name(function touchmoveHandler2(e3) { + var capture = r2.touchData.capture; + if (!capture && !eventInContainer(e3)) { return; } - var select = r.selection; - var cy = r.cy; - var now3 = r.touchData.now; - var earlier = r.touchData.earlier; - var zoom = cy.zoom(); - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now3[0] = pos[0]; - now3[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY); - now3[2] = pos[0]; - now3[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY); - now3[4] = pos[0]; - now3[5] = pos[1]; - } - var startGPos = r.touchData.startGPosition; + var select = r2.selection; + var cy = r2.cy; + var now4 = r2.touchData.now; + var earlier = r2.touchData.earlier; + var zoom2 = cy.zoom(); + if (e3.touches[0]) { + var pos = r2.projectIntoViewport(e3.touches[0].clientX, e3.touches[0].clientY); + now4[0] = pos[0]; + now4[1] = pos[1]; + } + if (e3.touches[1]) { + var pos = r2.projectIntoViewport(e3.touches[1].clientX, e3.touches[1].clientY); + now4[2] = pos[0]; + now4[3] = pos[1]; + } + if (e3.touches[2]) { + var pos = r2.projectIntoViewport(e3.touches[2].clientX, e3.touches[2].clientY); + now4[4] = pos[0]; + now4[5] = pos[1]; + } + var startGPos = r2.touchData.startGPosition; var isOverThresholdDrag; - if (capture && e.touches[0] && startGPos) { + if (capture && e3.touches[0] && startGPos) { var disp = []; - for (var j = 0; j < now3.length; j++) { - disp[j] = now3[j] - earlier[j]; + for (var j2 = 0; j2 < now4.length; j2++) { + disp[j2] = now4[j2] - earlier[j2]; } - var dx = e.touches[0].clientX - startGPos[0]; + var dx = e3.touches[0].clientX - startGPos[0]; var dx2 = dx * dx; - var dy = e.touches[0].clientY - startGPos[1]; + var dy = e3.touches[0].clientY - startGPos[1]; var dy2 = dy * dy; var dist22 = dx2 + dy2; - isOverThresholdDrag = dist22 >= r.touchTapThreshold2; + isOverThresholdDrag = dist22 >= r2.touchTapThreshold2; } - if (capture && r.touchData.cxt) { - e.preventDefault(); - var f1x2 = e.touches[0].clientX - offsetLeft, f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, f2y2 = e.touches[1].clientY - offsetTop; + if (capture && r2.touchData.cxt) { + e3.preventDefault(); + var f1x2 = e3.touches[0].clientX - offsetLeft, f1y2 = e3.touches[0].clientY - offsetTop; + var f2x2 = e3.touches[1].clientX - offsetLeft, f2y2 = e3.touches[1].clientY - offsetTop; var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2); var factorSq = distance2Sq / distance1Sq; var distThreshold = 150; @@ -182528,113 +115535,113 @@ g.stateGroup line { var factorThreshold = 1.5; var factorThresholdSq = factorThreshold * factorThreshold; if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) { - r.touchData.cxt = false; - r.data.bgActivePosistion = void 0; - r.redrawHint("select", true); + r2.touchData.cxt = false; + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); var cxtEvt = { - originalEvent: e, + originalEvent: e3, type: "cxttapend", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }; - if (r.touchData.start) { - r.touchData.start.unactivate().emit(cxtEvt); - r.touchData.start = null; + if (r2.touchData.start) { + r2.touchData.start.unactivate().emit(cxtEvt); + r2.touchData.start = null; } else { cy.emit(cxtEvt); } } } - if (capture && r.touchData.cxt) { + if (capture && r2.touchData.cxt) { var cxtEvt = { - originalEvent: e, + originalEvent: e3, type: "cxtdrag", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }; - r.data.bgActivePosistion = void 0; - r.redrawHint("select", true); - if (r.touchData.start) { - r.touchData.start.emit(cxtEvt); + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); + if (r2.touchData.start) { + r2.touchData.start.emit(cxtEvt); } else { cy.emit(cxtEvt); } - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; + if (r2.touchData.start) { + r2.touchData.start._private.grabbed = false; } - r.touchData.cxtDragged = true; - var near = r.findNearestElement(now3[0], now3[1], true, true); - if (!r.touchData.cxtOver || near !== r.touchData.cxtOver) { - if (r.touchData.cxtOver) { - r.touchData.cxtOver.emit({ - originalEvent: e, + r2.touchData.cxtDragged = true; + var near = r2.findNearestElement(now4[0], now4[1], true, true); + if (!r2.touchData.cxtOver || near !== r2.touchData.cxtOver) { + if (r2.touchData.cxtOver) { + r2.touchData.cxtOver.emit({ + originalEvent: e3, type: "cxtdragout", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); } - r.touchData.cxtOver = near; + r2.touchData.cxtOver = near; if (near) { near.emit({ - originalEvent: e, + originalEvent: e3, type: "cxtdragover", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); } } - } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) { - e.preventDefault(); - r.data.bgActivePosistion = void 0; + } else if (capture && e3.touches[2] && cy.boxSelectionEnabled()) { + e3.preventDefault(); + r2.data.bgActivePosistion = void 0; this.lastThreeTouch = +/* @__PURE__ */ new Date(); - if (!r.touchData.selecting) { + if (!r2.touchData.selecting) { cy.emit({ - originalEvent: e, + originalEvent: e3, type: "boxstart", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); } - r.touchData.selecting = true; - r.touchData.didSelect = true; + r2.touchData.selecting = true; + r2.touchData.didSelect = true; select[4] = 1; if (!select || select.length === 0 || select[0] === void 0) { - select[0] = (now3[0] + now3[2] + now3[4]) / 3; - select[1] = (now3[1] + now3[3] + now3[5]) / 3; - select[2] = (now3[0] + now3[2] + now3[4]) / 3 + 1; - select[3] = (now3[1] + now3[3] + now3[5]) / 3 + 1; + select[0] = (now4[0] + now4[2] + now4[4]) / 3; + select[1] = (now4[1] + now4[3] + now4[5]) / 3; + select[2] = (now4[0] + now4[2] + now4[4]) / 3 + 1; + select[3] = (now4[1] + now4[3] + now4[5]) / 3 + 1; } else { - select[2] = (now3[0] + now3[2] + now3[4]) / 3; - select[3] = (now3[1] + now3[3] + now3[5]) / 3; - } - r.redrawHint("select", true); - r.redraw(); - } else if (capture && e.touches[1] && !r.touchData.didSelect && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) { - e.preventDefault(); - r.data.bgActivePosistion = void 0; - r.redrawHint("select", true); - var draggedEles = r.dragData.touchDragEles; + select[2] = (now4[0] + now4[2] + now4[4]) / 3; + select[3] = (now4[1] + now4[3] + now4[5]) / 3; + } + r2.redrawHint("select", true); + r2.redraw(); + } else if (capture && e3.touches[1] && !r2.touchData.didSelect && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) { + e3.preventDefault(); + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); + var draggedEles = r2.dragData.touchDragEles; if (draggedEles) { - r.redrawHint("drag", true); - for (var i3 = 0; i3 < draggedEles.length; i3++) { - var de_p = draggedEles[i3]._private; + r2.redrawHint("drag", true); + for (var i2 = 0; i2 < draggedEles.length; i2++) { + var de_p = draggedEles[i2]._private; de_p.grabbed = false; de_p.rscratch.inDragLayer = false; } } - var _start = r.touchData.start; - var f1x2 = e.touches[0].clientX - offsetLeft, f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, f2y2 = e.touches[1].clientY - offsetTop; + var _start = r2.touchData.start; + var f1x2 = e3.touches[0].clientX - offsetLeft, f1y2 = e3.touches[0].clientY - offsetTop; + var f2x2 = e3.touches[1].clientX - offsetLeft, f2y2 = e3.touches[1].clientY - offsetTop; var distance22 = distance2(f1x2, f1y2, f2x2, f2y2); var factor = distance22 / distance1; if (twoFingersStartInside) { @@ -182645,28 +115652,28 @@ g.stateGroup line { var tx = (df1x + df2x) / 2; var ty = (df1y + df2y) / 2; var zoom1 = cy.zoom(); - var zoom2 = zoom1 * factor; + var zoom22 = zoom1 * factor; var pan1 = cy.pan(); var ctrx = modelCenter1[0] * zoom1 + pan1.x; var ctry = modelCenter1[1] * zoom1 + pan1.y; var pan2 = { - x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx, - y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry + x: -zoom22 / zoom1 * (ctrx - pan1.x - tx) + ctrx, + y: -zoom22 / zoom1 * (ctry - pan1.y - ty) + ctry }; if (_start && _start.active()) { - var draggedEles = r.dragData.touchDragEles; + var draggedEles = r2.dragData.touchDragEles; freeDraggedElements(draggedEles); - r.redrawHint("drag", true); - r.redrawHint("eles", true); + r2.redrawHint("drag", true); + r2.redrawHint("eles", true); _start.unactivate().emit("freeon"); draggedEles.emit("free"); - if (r.dragData.didDrag) { + if (r2.dragData.didDrag) { _start.emit("dragfreeon"); draggedEles.emit("dragfree"); } } cy.viewport({ - zoom: zoom2, + zoom: zoom22, pan: pan2, cancelOnFailedZoom: true }); @@ -182676,68 +115683,68 @@ g.stateGroup line { f1y1 = f1y2; f2x1 = f2x2; f2y1 = f2y2; - r.pinching = true; - } - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now3[0] = pos[0]; - now3[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY); - now3[2] = pos[0]; - now3[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY); - now3[4] = pos[0]; - now3[5] = pos[1]; - } - } else if (e.touches[0] && !r.touchData.didSelect) { - var start2 = r.touchData.start; - var last2 = r.touchData.last; + r2.pinching = true; + } + if (e3.touches[0]) { + var pos = r2.projectIntoViewport(e3.touches[0].clientX, e3.touches[0].clientY); + now4[0] = pos[0]; + now4[1] = pos[1]; + } + if (e3.touches[1]) { + var pos = r2.projectIntoViewport(e3.touches[1].clientX, e3.touches[1].clientY); + now4[2] = pos[0]; + now4[3] = pos[1]; + } + if (e3.touches[2]) { + var pos = r2.projectIntoViewport(e3.touches[2].clientX, e3.touches[2].clientY); + now4[4] = pos[0]; + now4[5] = pos[1]; + } + } else if (e3.touches[0] && !r2.touchData.didSelect) { + var start3 = r2.touchData.start; + var last3 = r2.touchData.last; var near; - if (!r.hoverData.draggingEles && !r.swipePanning) { - near = r.findNearestElement(now3[0], now3[1], true, true); + if (!r2.hoverData.draggingEles && !r2.swipePanning) { + near = r2.findNearestElement(now4[0], now4[1], true, true); } - if (capture && start2 != null) { - e.preventDefault(); + if (capture && start3 != null) { + e3.preventDefault(); } - if (capture && start2 != null && r.nodeIsDraggable(start2)) { + if (capture && start3 != null && r2.nodeIsDraggable(start3)) { if (isOverThresholdDrag) { - var draggedEles = r.dragData.touchDragEles; - var justStartedDrag = !r.dragData.didDrag; + var draggedEles = r2.dragData.touchDragEles; + var justStartedDrag = !r2.dragData.didDrag; if (justStartedDrag) { addNodesToDrag(draggedEles, { inDragLayer: true }); } - r.dragData.didDrag = true; + r2.dragData.didDrag = true; var totalShift = { x: 0, y: 0 }; - if (number$12(disp[0]) && number$12(disp[1])) { + if (number$1(disp[0]) && number$1(disp[1])) { totalShift.x += disp[0]; totalShift.y += disp[1]; if (justStartedDrag) { - r.redrawHint("eles", true); - var dragDelta = r.touchData.dragDelta; - if (dragDelta && number$12(dragDelta[0]) && number$12(dragDelta[1])) { + r2.redrawHint("eles", true); + var dragDelta = r2.touchData.dragDelta; + if (dragDelta && number$1(dragDelta[0]) && number$1(dragDelta[1])) { totalShift.x += dragDelta[0]; totalShift.y += dragDelta[1]; } } } - r.hoverData.draggingEles = true; + r2.hoverData.draggingEles = true; draggedEles.silentShift(totalShift).emit("position drag"); - r.redrawHint("drag", true); - if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) { - r.redrawHint("eles", true); + r2.redrawHint("drag", true); + if (r2.touchData.startPosition[0] == earlier[0] && r2.touchData.startPosition[1] == earlier[1]) { + r2.redrawHint("eles", true); } - r.redraw(); + r2.redraw(); } else { - var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; + var dragDelta = r2.touchData.dragDelta = r2.touchData.dragDelta || []; if (dragDelta.length === 0) { dragDelta.push(disp[0]); dragDelta.push(disp[1]); @@ -182748,449 +115755,457 @@ g.stateGroup line { } } { - triggerEvents(start2 || near, ["touchmove", "tapdrag", "vmousemove"], e, { - x: now3[0], - y: now3[1] + triggerEvents(start3 || near, ["touchmove", "tapdrag", "vmousemove"], e3, { + x: now4[0], + y: now4[1] }); - if ((!start2 || !start2.grabbed()) && near != last2) { - if (last2) { - last2.emit({ - originalEvent: e, + if ((!start3 || !start3.grabbed()) && near != last3) { + if (last3) { + last3.emit({ + originalEvent: e3, type: "tapdragout", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); } if (near) { near.emit({ - originalEvent: e, + originalEvent: e3, type: "tapdragover", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); } } - r.touchData.last = near; + r2.touchData.last = near; } if (capture) { - for (var i3 = 0; i3 < now3.length; i3++) { - if (now3[i3] && r.touchData.startPosition[i3] && isOverThresholdDrag) { - r.touchData.singleTouchMoved = true; + for (var i2 = 0; i2 < now4.length; i2++) { + if (now4[i2] && r2.touchData.startPosition[i2] && isOverThresholdDrag) { + r2.touchData.singleTouchMoved = true; } } } - if (capture && (start2 == null || start2.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) { - var allowPassthrough = allowPanningPassthrough(start2, r.touchData.starts); + if (capture && (start3 == null || start3.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) { + var allowPassthrough = allowPanningPassthrough(start3, r2.touchData.starts); if (allowPassthrough) { - e.preventDefault(); - if (!r.data.bgActivePosistion) { - r.data.bgActivePosistion = array2point(r.touchData.startPosition); + e3.preventDefault(); + if (!r2.data.bgActivePosistion) { + r2.data.bgActivePosistion = array2point(r2.touchData.startPosition); } - if (r.swipePanning) { + if (r2.swipePanning) { cy.panBy({ - x: disp[0] * zoom, - y: disp[1] * zoom + x: disp[0] * zoom2, + y: disp[1] * zoom2 }); cy.emit("dragpan"); } else if (isOverThresholdDrag) { - r.swipePanning = true; + r2.swipePanning = true; cy.panBy({ - x: dx * zoom, - y: dy * zoom + x: dx * zoom2, + y: dy * zoom2 }); cy.emit("dragpan"); - if (start2) { - start2.unactivate(); - r.redrawHint("select", true); - r.touchData.start = null; + if (start3) { + start3.unactivate(); + r2.redrawHint("select", true); + r2.touchData.start = null; } } } - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now3[0] = pos[0]; - now3[1] = pos[1]; + var pos = r2.projectIntoViewport(e3.touches[0].clientX, e3.touches[0].clientY); + now4[0] = pos[0]; + now4[1] = pos[1]; } } - for (var j = 0; j < now3.length; j++) { - earlier[j] = now3[j]; + for (var j2 = 0; j2 < now4.length; j2++) { + earlier[j2] = now4[j2]; } - if (capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null) { - r.data.bgActivePosistion = void 0; - r.redrawHint("select", true); - r.redraw(); + if (capture && e3.touches.length > 0 && !r2.hoverData.draggingEles && !r2.swipePanning && r2.data.bgActivePosistion != null) { + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); + r2.redraw(); } - }, false); + }, "touchmoveHandler"), false); var touchcancelHandler; - r.registerBinding(containerWindow, "touchcancel", touchcancelHandler = function touchcancelHandler2(e) { - var start2 = r.touchData.start; - r.touchData.capture = false; - if (start2) { - start2.unactivate(); + r2.registerBinding(containerWindow, "touchcancel", touchcancelHandler = /* @__PURE__ */ __name(function touchcancelHandler2(e3) { + var start3 = r2.touchData.start; + r2.touchData.capture = false; + if (start3) { + start3.unactivate(); } - }); + }, "touchcancelHandler")); var touchendHandler, didDoubleTouch, touchTimeout, prevTouchTimeStamp; - r.registerBinding(containerWindow, "touchend", touchendHandler = function touchendHandler2(e) { - var start2 = r.touchData.start; - var capture = r.touchData.capture; + r2.registerBinding(containerWindow, "touchend", touchendHandler = /* @__PURE__ */ __name(function touchendHandler2(e3) { + var start3 = r2.touchData.start; + var capture = r2.touchData.capture; if (capture) { - if (e.touches.length === 0) { - r.touchData.capture = false; + if (e3.touches.length === 0) { + r2.touchData.capture = false; } - e.preventDefault(); + e3.preventDefault(); } else { return; } - var select = r.selection; - r.swipePanning = false; - r.hoverData.draggingEles = false; - var cy = r.cy; - var zoom = cy.zoom(); - var now3 = r.touchData.now; - var earlier = r.touchData.earlier; - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now3[0] = pos[0]; - now3[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY); - now3[2] = pos[0]; - now3[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY); - now3[4] = pos[0]; - now3[5] = pos[1]; - } - if (start2) { - start2.unactivate(); + var select = r2.selection; + r2.swipePanning = false; + r2.hoverData.draggingEles = false; + var cy = r2.cy; + var zoom2 = cy.zoom(); + var now4 = r2.touchData.now; + var earlier = r2.touchData.earlier; + if (e3.touches[0]) { + var pos = r2.projectIntoViewport(e3.touches[0].clientX, e3.touches[0].clientY); + now4[0] = pos[0]; + now4[1] = pos[1]; + } + if (e3.touches[1]) { + var pos = r2.projectIntoViewport(e3.touches[1].clientX, e3.touches[1].clientY); + now4[2] = pos[0]; + now4[3] = pos[1]; + } + if (e3.touches[2]) { + var pos = r2.projectIntoViewport(e3.touches[2].clientX, e3.touches[2].clientY); + now4[4] = pos[0]; + now4[5] = pos[1]; + } + if (start3) { + start3.unactivate(); } var ctxTapend; - if (r.touchData.cxt) { + if (r2.touchData.cxt) { ctxTapend = { - originalEvent: e, + originalEvent: e3, type: "cxttapend", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }; - if (start2) { - start2.emit(ctxTapend); + if (start3) { + start3.emit(ctxTapend); } else { cy.emit(ctxTapend); } - if (!r.touchData.cxtDragged) { + if (!r2.touchData.cxtDragged) { var ctxTap = { - originalEvent: e, + originalEvent: e3, type: "cxttap", position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }; - if (start2) { - start2.emit(ctxTap); + if (start3) { + start3.emit(ctxTap); } else { cy.emit(ctxTap); } } - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; + if (r2.touchData.start) { + r2.touchData.start._private.grabbed = false; } - r.touchData.cxt = false; - r.touchData.start = null; - r.redraw(); + r2.touchData.cxt = false; + r2.touchData.start = null; + r2.redraw(); return; } - if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) { - r.touchData.selecting = false; - var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); + if (!e3.touches[2] && cy.boxSelectionEnabled() && r2.touchData.selecting) { + r2.touchData.selecting = false; + var box = cy.collection(r2.getAllInBox(select[0], select[1], select[2], select[3])); select[0] = void 0; select[1] = void 0; select[2] = void 0; select[3] = void 0; select[4] = 0; - r.redrawHint("select", true); + r2.redrawHint("select", true); cy.emit({ type: "boxend", - originalEvent: e, + originalEvent: e3, position: { - x: now3[0], - y: now3[1] + x: now4[0], + y: now4[1] } }); - var eleWouldBeSelected = function eleWouldBeSelected2(ele) { + var eleWouldBeSelected = /* @__PURE__ */ __name(function eleWouldBeSelected2(ele) { return ele.selectable() && !ele.selected(); - }; + }, "eleWouldBeSelected"); box.emit("box").stdFilter(eleWouldBeSelected).select().emit("boxselect"); if (box.nonempty()) { - r.redrawHint("eles", true); - } - r.redraw(); - } - if (start2 != null) { - start2.unactivate(); - } - if (e.touches[2]) { - r.data.bgActivePosistion = void 0; - r.redrawHint("select", true); - } else if (e.touches[1]) - ; - else if (e.touches[0]) - ; - else if (!e.touches[0]) { - r.data.bgActivePosistion = void 0; - r.redrawHint("select", true); - var draggedEles = r.dragData.touchDragEles; - if (start2 != null) { - var startWasGrabbed = start2._private.grabbed; + r2.redrawHint("eles", true); + } + r2.redraw(); + } + if (start3 != null) { + start3.unactivate(); + } + if (e3.touches[2]) { + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); + } else if (e3.touches[1]) ; + else if (e3.touches[0]) ; + else if (!e3.touches[0]) { + r2.data.bgActivePosistion = void 0; + r2.redrawHint("select", true); + var draggedEles = r2.dragData.touchDragEles; + if (start3 != null) { + var startWasGrabbed = start3._private.grabbed; freeDraggedElements(draggedEles); - r.redrawHint("drag", true); - r.redrawHint("eles", true); + r2.redrawHint("drag", true); + r2.redrawHint("eles", true); if (startWasGrabbed) { - start2.emit("freeon"); + start3.emit("freeon"); draggedEles.emit("free"); - if (r.dragData.didDrag) { - start2.emit("dragfreeon"); + if (r2.dragData.didDrag) { + start3.emit("dragfreeon"); draggedEles.emit("dragfree"); } } - triggerEvents(start2, ["touchend", "tapend", "vmouseup", "tapdragout"], e, { - x: now3[0], - y: now3[1] + triggerEvents(start3, ["touchend", "tapend", "vmouseup", "tapdragout"], e3, { + x: now4[0], + y: now4[1] }); - start2.unactivate(); - r.touchData.start = null; + start3.unactivate(); + r2.touchData.start = null; } else { - var near = r.findNearestElement(now3[0], now3[1], true, true); - triggerEvents(near, ["touchend", "tapend", "vmouseup", "tapdragout"], e, { - x: now3[0], - y: now3[1] + var near = r2.findNearestElement(now4[0], now4[1], true, true); + triggerEvents(near, ["touchend", "tapend", "vmouseup", "tapdragout"], e3, { + x: now4[0], + y: now4[1] }); } - var dx = r.touchData.startPosition[0] - now3[0]; + var dx = r2.touchData.startPosition[0] - now4[0]; var dx2 = dx * dx; - var dy = r.touchData.startPosition[1] - now3[1]; + var dy = r2.touchData.startPosition[1] - now4[1]; var dy2 = dy * dy; var dist22 = dx2 + dy2; - var rdist2 = dist22 * zoom * zoom; - if (!r.touchData.singleTouchMoved) { - if (!start2) { + var rdist2 = dist22 * zoom2 * zoom2; + if (!r2.touchData.singleTouchMoved) { + if (!start3) { cy.$(":selected").unselect(["tapunselect"]); } - triggerEvents(start2, ["tap", "vclick"], e, { - x: now3[0], - y: now3[1] + triggerEvents(start3, ["tap", "vclick"], e3, { + x: now4[0], + y: now4[1] }); didDoubleTouch = false; - if (e.timeStamp - prevTouchTimeStamp <= cy.multiClickDebounceTime()) { + if (e3.timeStamp - prevTouchTimeStamp <= cy.multiClickDebounceTime()) { touchTimeout && clearTimeout(touchTimeout); didDoubleTouch = true; prevTouchTimeStamp = null; - triggerEvents(start2, ["dbltap", "vdblclick"], e, { - x: now3[0], - y: now3[1] + triggerEvents(start3, ["dbltap", "vdblclick"], e3, { + x: now4[0], + y: now4[1] }); } else { touchTimeout = setTimeout(function() { - if (didDoubleTouch) - return; - triggerEvents(start2, ["onetap", "voneclick"], e, { - x: now3[0], - y: now3[1] + if (didDoubleTouch) return; + triggerEvents(start3, ["onetap", "voneclick"], e3, { + x: now4[0], + y: now4[1] }); }, cy.multiClickDebounceTime()); - prevTouchTimeStamp = e.timeStamp; + prevTouchTimeStamp = e3.timeStamp; } } - if (start2 != null && !r.dragData.didDrag && start2._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching) { + if (start3 != null && !r2.dragData.didDrag && start3._private.selectable && rdist2 < r2.touchTapThreshold2 && !r2.pinching) { if (cy.selectionType() === "single") { - cy.$(isSelected).unmerge(start2).unselect(["tapunselect"]); - start2.select(["tapselect"]); + cy.$(isSelected).unmerge(start3).unselect(["tapunselect"]); + start3.select(["tapselect"]); } else { - if (start2.selected()) { - start2.unselect(["tapunselect"]); + if (start3.selected()) { + start3.unselect(["tapunselect"]); } else { - start2.select(["tapselect"]); + start3.select(["tapselect"]); } } - r.redrawHint("eles", true); + r2.redrawHint("eles", true); } - r.touchData.singleTouchMoved = true; + r2.touchData.singleTouchMoved = true; } - for (var j = 0; j < now3.length; j++) { - earlier[j] = now3[j]; + for (var j2 = 0; j2 < now4.length; j2++) { + earlier[j2] = now4[j2]; } - r.dragData.didDrag = false; - if (e.touches.length === 0) { - r.touchData.dragDelta = []; - r.touchData.startPosition = [null, null, null, null, null, null]; - r.touchData.startGPosition = null; - r.touchData.didSelect = false; + r2.dragData.didDrag = false; + if (e3.touches.length === 0) { + r2.touchData.dragDelta = []; + r2.touchData.startPosition = [null, null, null, null, null, null]; + r2.touchData.startGPosition = null; + r2.touchData.didSelect = false; } - if (e.touches.length < 2) { - if (e.touches.length === 1) { - r.touchData.startGPosition = [e.touches[0].clientX, e.touches[0].clientY]; + if (e3.touches.length < 2) { + if (e3.touches.length === 1) { + r2.touchData.startGPosition = [e3.touches[0].clientX, e3.touches[0].clientY]; } - r.pinching = false; - r.redrawHint("eles", true); - r.redraw(); + r2.pinching = false; + r2.redrawHint("eles", true); + r2.redraw(); } - }, false); + }, "touchendHandler"), false); if (typeof TouchEvent === "undefined") { var pointers = []; - var makeTouch = function makeTouch2(e) { + var makeTouch = /* @__PURE__ */ __name(function makeTouch2(e3) { return { - clientX: e.clientX, - clientY: e.clientY, + clientX: e3.clientX, + clientY: e3.clientY, force: 1, - identifier: e.pointerId, - pageX: e.pageX, - pageY: e.pageY, - radiusX: e.width / 2, - radiusY: e.height / 2, - screenX: e.screenX, - screenY: e.screenY, - target: e.target - }; - }; - var makePointer = function makePointer2(e) { + identifier: e3.pointerId, + pageX: e3.pageX, + pageY: e3.pageY, + radiusX: e3.width / 2, + radiusY: e3.height / 2, + screenX: e3.screenX, + screenY: e3.screenY, + target: e3.target + }; + }, "makeTouch"); + var makePointer = /* @__PURE__ */ __name(function makePointer2(e3) { return { - event: e, - touch: makeTouch(e) - }; - }; - var addPointer = function addPointer2(e) { - pointers.push(makePointer(e)); - }; - var removePointer = function removePointer2(e) { - for (var i3 = 0; i3 < pointers.length; i3++) { - var p2 = pointers[i3]; - if (p2.event.pointerId === e.pointerId) { - pointers.splice(i3, 1); + event: e3, + touch: makeTouch(e3) + }; + }, "makePointer"); + var addPointer = /* @__PURE__ */ __name(function addPointer2(e3) { + pointers.push(makePointer(e3)); + }, "addPointer"); + var removePointer = /* @__PURE__ */ __name(function removePointer2(e3) { + for (var i2 = 0; i2 < pointers.length; i2++) { + var p3 = pointers[i2]; + if (p3.event.pointerId === e3.pointerId) { + pointers.splice(i2, 1); return; } } - }; - var updatePointer = function updatePointer2(e) { - var p2 = pointers.filter(function(p3) { - return p3.event.pointerId === e.pointerId; + }, "removePointer"); + var updatePointer = /* @__PURE__ */ __name(function updatePointer2(e3) { + var p3 = pointers.filter(function(p4) { + return p4.event.pointerId === e3.pointerId; })[0]; - p2.event = e; - p2.touch = makeTouch(e); - }; - var addTouchesToEvent = function addTouchesToEvent2(e) { - e.touches = pointers.map(function(p2) { - return p2.touch; + p3.event = e3; + p3.touch = makeTouch(e3); + }, "updatePointer"); + var addTouchesToEvent = /* @__PURE__ */ __name(function addTouchesToEvent2(e3) { + e3.touches = pointers.map(function(p3) { + return p3.touch; }); - }; - var pointerIsMouse = function pointerIsMouse2(e) { - return e.pointerType === "mouse" || e.pointerType === 4; - }; - r.registerBinding(r.container, "pointerdown", function(e) { - if (pointerIsMouse(e)) { + }, "addTouchesToEvent"); + var pointerIsMouse = /* @__PURE__ */ __name(function pointerIsMouse2(e3) { + return e3.pointerType === "mouse" || e3.pointerType === 4; + }, "pointerIsMouse"); + r2.registerBinding(r2.container, "pointerdown", function(e3) { + if (pointerIsMouse(e3)) { return; } - e.preventDefault(); - addPointer(e); - addTouchesToEvent(e); - touchstartHandler(e); + e3.preventDefault(); + addPointer(e3); + addTouchesToEvent(e3); + touchstartHandler(e3); }); - r.registerBinding(r.container, "pointerup", function(e) { - if (pointerIsMouse(e)) { + r2.registerBinding(r2.container, "pointerup", function(e3) { + if (pointerIsMouse(e3)) { return; } - removePointer(e); - addTouchesToEvent(e); - touchendHandler(e); + removePointer(e3); + addTouchesToEvent(e3); + touchendHandler(e3); }); - r.registerBinding(r.container, "pointercancel", function(e) { - if (pointerIsMouse(e)) { + r2.registerBinding(r2.container, "pointercancel", function(e3) { + if (pointerIsMouse(e3)) { return; } - removePointer(e); - addTouchesToEvent(e); - touchcancelHandler(e); + removePointer(e3); + addTouchesToEvent(e3); + touchcancelHandler(e3); }); - r.registerBinding(r.container, "pointermove", function(e) { - if (pointerIsMouse(e)) { + r2.registerBinding(r2.container, "pointermove", function(e3) { + if (pointerIsMouse(e3)) { return; } - e.preventDefault(); - updatePointer(e); - addTouchesToEvent(e); - touchmoveHandler(e); + e3.preventDefault(); + updatePointer(e3); + addTouchesToEvent(e3); + touchmoveHandler(e3); }); } }; - var BRp$2 = {}; + BRp$2 = {}; BRp$2.generatePolygon = function(name, points) { return this.nodeShapes[name] = { renderer: this, name, points, - draw: function draw2(context, centerX, centerY, width2, height) { - this.renderer.nodeShapeImpl("polygon", context, centerX, centerY, width2, height, this.points); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height, x2, y2, padding2) { - return polygonIntersectLine(x2, y2, this.points, nodeX, nodeY, width2 / 2, height / 2, padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height, centerX, centerY) { - return pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height, [0, -1], padding2); - } + draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + this.renderer.nodeShapeImpl("polygon", context, centerX, centerY, width3, height2, this.points); + }, "draw"), + intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { + return polygonIntersectLine(x5, y5, this.points, nodeX, nodeY, width3 / 2, height2 / 2, padding3); + }, "intersectLine"), + checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) { + return pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2, [0, -1], padding3); + }, "checkPoint") }; }; BRp$2.generateEllipse = function() { return this.nodeShapes["ellipse"] = { renderer: this, name: "ellipse", - draw: function draw2(context, centerX, centerY, width2, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height, x2, y2, padding2) { - return intersectLineEllipse(x2, y2, nodeX, nodeY, width2 / 2 + padding2, height / 2 + padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height, centerX, centerY) { - return checkInEllipse(x2, y2, width2, height, centerX, centerY, padding2); - } + draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2); + }, "draw"), + intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { + return intersectLineEllipse(x5, y5, nodeX, nodeY, width3 / 2 + padding3, height2 / 2 + padding3); + }, "intersectLine"), + checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) { + return checkInEllipse(x5, y5, width3, height2, centerX, centerY, padding3); + }, "checkPoint") }; }; BRp$2.generateRoundPolygon = function(name, points) { - var allPoints = new Array(points.length * 2); - for (var i3 = 0; i3 < points.length / 2; i3++) { - var sourceIndex = i3 * 2; - var destIndex = void 0; - if (i3 < points.length / 2 - 1) { - destIndex = (i3 + 1) * 2; - } else { - destIndex = 0; - } - allPoints[i3 * 4] = points[sourceIndex]; - allPoints[i3 * 4 + 1] = points[sourceIndex + 1]; - var xDest = points[destIndex] - points[sourceIndex]; - var yDest = points[destIndex + 1] - points[sourceIndex + 1]; - var norm = Math.sqrt(xDest * xDest + yDest * yDest); - allPoints[i3 * 4 + 2] = xDest / norm; - allPoints[i3 * 4 + 3] = yDest / norm; - } return this.nodeShapes[name] = { renderer: this, name, - points: allPoints, - draw: function draw2(context, centerX, centerY, width2, height) { - this.renderer.nodeShapeImpl("round-polygon", context, centerX, centerY, width2, height, this.points); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height, x2, y2, padding2) { - return roundPolygonIntersectLine(x2, y2, this.points, nodeX, nodeY, width2, height); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height, centerX, centerY) { - return pointInsideRoundPolygon(x2, y2, this.points, centerX, centerY, width2, height); - } + points, + getOrCreateCorners: /* @__PURE__ */ __name(function getOrCreateCorners(centerX, centerY, width3, height2, cornerRadius, rs, field) { + if (rs[field] !== void 0 && rs[field + "-cx"] === centerX && rs[field + "-cy"] === centerY) { + return rs[field]; + } + rs[field] = new Array(points.length / 2); + rs[field + "-cx"] = centerX; + rs[field + "-cy"] = centerY; + var halfW = width3 / 2; + var halfH = height2 / 2; + cornerRadius = cornerRadius === "auto" ? getRoundPolygonRadius(width3, height2) : cornerRadius; + var p3 = new Array(points.length / 2); + for (var _i = 0; _i < points.length / 2; _i++) { + p3[_i] = { + x: centerX + halfW * points[_i * 2], + y: centerY + halfH * points[_i * 2 + 1] + }; + } + var i2, p1, p22, p32, len = p3.length; + p1 = p3[len - 1]; + for (i2 = 0; i2 < len; i2++) { + p22 = p3[i2 % len]; + p32 = p3[(i2 + 1) % len]; + rs[field][i2] = getRoundCorner(p1, p22, p32, cornerRadius); + p1 = p22; + p22 = p32; + } + return rs[field]; + }, "getOrCreateCorners"), + draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius, rs) { + this.renderer.nodeShapeImpl("round-polygon", context, centerX, centerY, width3, height2, this.points, this.getOrCreateCorners(centerX, centerY, width3, height2, cornerRadius, rs, "drawCorners")); + }, "draw"), + intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius, rs) { + return roundPolygonIntersectLine(x5, y5, this.points, nodeX, nodeY, width3, height2, padding3, this.getOrCreateCorners(nodeX, nodeY, width3, height2, cornerRadius, rs, "corners")); + }, "intersectLine"), + checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius, rs) { + return pointInsideRoundPolygon(x5, y5, this.points, centerX, centerY, width3, height2, this.getOrCreateCorners(centerX, centerY, width3, height2, cornerRadius, rs, "corners")); + }, "checkPoint") }; }; BRp$2.generateRoundRectangle = function() { @@ -183198,35 +116213,38 @@ g.stateGroup line { renderer: this, name: "round-rectangle", points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height, x2, y2, padding2) { - return roundRectangleIntersectLine(x2, y2, nodeX, nodeY, width2, height, padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height, centerX, centerY) { - var cornerRadius = getRoundRectangleRadius(width2, height); + draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, this.points, cornerRadius); + }, "draw"), + intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { + return roundRectangleIntersectLine(x5, y5, nodeX, nodeY, width3, height2, padding3, cornerRadius); + }, "intersectLine"), + checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) { + var halfWidth = width3 / 2; + var halfHeight = height2 / 2; + cornerRadius = cornerRadius === "auto" ? getRoundRectangleRadius(width3, height2) : cornerRadius; + cornerRadius = Math.min(halfWidth, halfHeight, cornerRadius); var diam = cornerRadius * 2; - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height - diam, [0, -1], padding2)) { + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding3)) { return true; } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - diam, height, [0, -1], padding2)) { + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding3)) { return true; } - if (checkInEllipse(x2, y2, diam, diam, centerX - width2 / 2 + cornerRadius, centerY - height / 2 + cornerRadius, padding2)) { + if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY - halfHeight + cornerRadius, padding3)) { return true; } - if (checkInEllipse(x2, y2, diam, diam, centerX + width2 / 2 - cornerRadius, centerY - height / 2 + cornerRadius, padding2)) { + if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY - halfHeight + cornerRadius, padding3)) { return true; } - if (checkInEllipse(x2, y2, diam, diam, centerX + width2 / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding2)) { + if (checkInEllipse(x5, y5, diam, diam, centerX + halfWidth - cornerRadius, centerY + halfHeight - cornerRadius, padding3)) { return true; } - if (checkInEllipse(x2, y2, diam, diam, centerX - width2 / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding2)) { + if (checkInEllipse(x5, y5, diam, diam, centerX - halfWidth + cornerRadius, centerY + halfHeight - cornerRadius, padding3)) { return true; } return false; - } + }, "checkPoint") }; }; BRp$2.generateCutRectangle = function() { @@ -183235,13 +116253,13 @@ g.stateGroup line { name: "cut-rectangle", cornerLength: getCutRectangleCornerLength(), points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height); - }, - generateCutTrianglePts: function generateCutTrianglePts(width2, height, centerX, centerY) { - var cl = this.cornerLength; - var hh = height / 2; - var hw = width2 / 2; + draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, null, cornerRadius); + }, "draw"), + generateCutTrianglePts: /* @__PURE__ */ __name(function generateCutTrianglePts(width3, height2, centerX, centerY, cornerRadius) { + var cl = cornerRadius === "auto" ? this.cornerLength : cornerRadius; + var hh = height2 / 2; + var hw = width3 / 2; var xBegin = centerX - hw; var xEnd = centerX + hw; var yBegin = centerY - hh; @@ -183252,22 +116270,23 @@ g.stateGroup line { bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl], bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl] }; - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height, x2, y2, padding2) { - var cPts = this.generateCutTrianglePts(width2 + 2 * padding2, height + 2 * padding2, nodeX, nodeY); + }, "generateCutTrianglePts"), + intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { + var cPts = this.generateCutTrianglePts(width3 + 2 * padding3, height2 + 2 * padding3, nodeX, nodeY, cornerRadius); var pts2 = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]); - return polygonIntersectLine(x2, y2, pts2, nodeX, nodeY); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height, centerX, centerY) { - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height - 2 * this.cornerLength, [0, -1], padding2)) { + return polygonIntersectLine(x5, y5, pts2, nodeX, nodeY); + }, "intersectLine"), + checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) { + var cl = cornerRadius === "auto" ? this.cornerLength : cornerRadius; + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - 2 * cl, [0, -1], padding3)) { return true; } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - 2 * this.cornerLength, height, [0, -1], padding2)) { + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - 2 * cl, height2, [0, -1], padding3)) { return true; } - var cutTrianglePts = this.generateCutTrianglePts(width2, height, centerX, centerY); - return pointInsidePolygonPoints(x2, y2, cutTrianglePts.topLeft) || pointInsidePolygonPoints(x2, y2, cutTrianglePts.topRight) || pointInsidePolygonPoints(x2, y2, cutTrianglePts.bottomRight) || pointInsidePolygonPoints(x2, y2, cutTrianglePts.bottomLeft); - } + var cutTrianglePts = this.generateCutTrianglePts(width3, height2, centerX, centerY); + return pointInsidePolygonPoints(x5, y5, cutTrianglePts.topLeft) || pointInsidePolygonPoints(x5, y5, cutTrianglePts.topRight) || pointInsidePolygonPoints(x5, y5, cutTrianglePts.bottomRight) || pointInsidePolygonPoints(x5, y5, cutTrianglePts.bottomLeft); + }, "checkPoint") }; }; BRp$2.generateBarrel = function() { @@ -183275,15 +116294,15 @@ g.stateGroup line { renderer: this, name: "barrel", points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height, x2, y2, padding2) { - var t02 = 0.15; - var t12 = 0.5; + draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2); + }, "draw"), + intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { + var t03 = 0.15; + var t13 = 0.5; var t22 = 0.85; - var bPts = this.generateBarrelBezierPts(width2 + 2 * padding2, height + 2 * padding2, nodeX, nodeY); - var approximateBarrelCurvePts = function approximateBarrelCurvePts2(pts3) { + var bPts = this.generateBarrelBezierPts(width3 + 2 * padding3, height2 + 2 * padding3, nodeX, nodeY); + var approximateBarrelCurvePts = /* @__PURE__ */ __name(function approximateBarrelCurvePts2(pts3) { var m0 = qbezierPtAt({ x: pts3[0], y: pts3[1] @@ -183293,7 +116312,7 @@ g.stateGroup line { }, { x: pts3[4], y: pts3[5] - }, t02); + }, t03); var m1 = qbezierPtAt({ x: pts3[0], y: pts3[1] @@ -183303,7 +116322,7 @@ g.stateGroup line { }, { x: pts3[4], y: pts3[5] - }, t12); + }, t13); var m2 = qbezierPtAt({ x: pts3[0], y: pts3[1] @@ -183315,21 +116334,21 @@ g.stateGroup line { y: pts3[5] }, t22); return [pts3[0], pts3[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts3[4], pts3[5]]; - }; + }, "approximateBarrelCurvePts"); var pts2 = [].concat(approximateBarrelCurvePts(bPts.topLeft), approximateBarrelCurvePts(bPts.topRight), approximateBarrelCurvePts(bPts.bottomRight), approximateBarrelCurvePts(bPts.bottomLeft)); - return polygonIntersectLine(x2, y2, pts2, nodeX, nodeY); - }, - generateBarrelBezierPts: function generateBarrelBezierPts(width2, height, centerX, centerY) { - var hh = height / 2; - var hw = width2 / 2; + return polygonIntersectLine(x5, y5, pts2, nodeX, nodeY); + }, "intersectLine"), + generateBarrelBezierPts: /* @__PURE__ */ __name(function generateBarrelBezierPts(width3, height2, centerX, centerY) { + var hh = height2 / 2; + var hw = width3 / 2; var xBegin = centerX - hw; var xEnd = centerX + hw; var yBegin = centerY - hh; var yEnd = centerY + hh; - var curveConstants = getBarrelCurveConstants(width2, height); + var curveConstants = getBarrelCurveConstants(width3, height2); var hOffset = curveConstants.heightOffset; var wOffset = curveConstants.widthOffset; - var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width2; + var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width3; var pts2 = { topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin], topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset], @@ -183341,19 +116360,19 @@ g.stateGroup line { pts2.bottomLeft.isBottom = true; pts2.bottomRight.isBottom = true; return pts2; - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height, centerX, centerY) { - var curveConstants = getBarrelCurveConstants(width2, height); + }, "generateBarrelBezierPts"), + checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) { + var curveConstants = getBarrelCurveConstants(width3, height2); var hOffset = curveConstants.heightOffset; var wOffset = curveConstants.widthOffset; - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height - 2 * hOffset, [0, -1], padding2)) { + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - 2 * hOffset, [0, -1], padding3)) { return true; } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - 2 * wOffset, height, [0, -1], padding2)) { + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - 2 * wOffset, height2, [0, -1], padding3)) { return true; } - var barrelCurvePts = this.generateBarrelBezierPts(width2, height, centerX, centerY); - var getCurveT = function getCurveT2(x3, y3, curvePts) { + var barrelCurvePts = this.generateBarrelBezierPts(width3, height2, centerX, centerY); + var getCurveT = /* @__PURE__ */ __name(function getCurveT2(x6, y6, curvePts) { var x0 = curvePts[4]; var x1 = curvePts[2]; var x22 = curvePts[0]; @@ -183363,39 +116382,39 @@ g.stateGroup line { var xMax = Math.max(x0, x22); var yMin = Math.min(y02, y23); var yMax = Math.max(y02, y23); - if (xMin <= x3 && x3 <= xMax && yMin <= y3 && y3 <= yMax) { + if (xMin <= x6 && x6 <= xMax && yMin <= y6 && y6 <= yMax) { var coeff = bezierPtsToQuadCoeff(x0, x1, x22); - var roots = solveQuadratic(coeff[0], coeff[1], coeff[2], x3); - var validRoots = roots.filter(function(r) { - return 0 <= r && r <= 1; + var roots = solveQuadratic(coeff[0], coeff[1], coeff[2], x6); + var validRoots = roots.filter(function(r2) { + return 0 <= r2 && r2 <= 1; }); if (validRoots.length > 0) { return validRoots[0]; } } return null; - }; + }, "getCurveT"); var curveRegions = Object.keys(barrelCurvePts); - for (var i3 = 0; i3 < curveRegions.length; i3++) { - var corner = curveRegions[i3]; + for (var i2 = 0; i2 < curveRegions.length; i2++) { + var corner = curveRegions[i2]; var cornerPts = barrelCurvePts[corner]; - var t = getCurveT(x2, y2, cornerPts); - if (t == null) { + var t4 = getCurveT(x5, y5, cornerPts); + if (t4 == null) { continue; } var y0 = cornerPts[5]; var y1 = cornerPts[3]; var y22 = cornerPts[1]; - var bezY = qbezierAt(y0, y1, y22, t); - if (cornerPts.isTop && bezY <= y2) { + var bezY = qbezierAt(y0, y1, y22, t4); + if (cornerPts.isTop && bezY <= y5) { return true; } - if (cornerPts.isBottom && y2 <= bezY) { + if (cornerPts.isBottom && y5 <= bezY) { return true; } } return false; - } + }, "checkPoint") }; }; BRp$2.generateBottomRoundrectangle = function() { @@ -183403,48 +116422,48 @@ g.stateGroup line { renderer: this, name: "bottom-round-rectangle", points: generateUnitNgonPointsFitToSquare(4, 0), - draw: function draw2(context, centerX, centerY, width2, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width2, height); - }, - intersectLine: function intersectLine2(nodeX, nodeY, width2, height, x2, y2, padding2) { - var topStartX = nodeX - (width2 / 2 + padding2); - var topStartY = nodeY - (height / 2 + padding2); + draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, this.points, cornerRadius); + }, "draw"), + intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { + var topStartX = nodeX - (width3 / 2 + padding3); + var topStartY = nodeY - (height2 / 2 + padding3); var topEndY = topStartY; - var topEndX = nodeX + (width2 / 2 + padding2); - var topIntersections = finiteLinesIntersect(x2, y2, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); + var topEndX = nodeX + (width3 / 2 + padding3); + var topIntersections = finiteLinesIntersect(x5, y5, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); if (topIntersections.length > 0) { return topIntersections; } - return roundRectangleIntersectLine(x2, y2, nodeX, nodeY, width2, height, padding2); - }, - checkPoint: function checkPoint(x2, y2, padding2, width2, height, centerX, centerY) { - var cornerRadius = getRoundRectangleRadius(width2, height); + return roundRectangleIntersectLine(x5, y5, nodeX, nodeY, width3, height2, padding3, cornerRadius); + }, "intersectLine"), + checkPoint: /* @__PURE__ */ __name(function checkPoint(x5, y5, padding3, width3, height2, centerX, centerY, cornerRadius) { + cornerRadius = cornerRadius === "auto" ? getRoundRectangleRadius(width3, height2) : cornerRadius; var diam = 2 * cornerRadius; - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2, height - diam, [0, -1], padding2)) { + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3, height2 - diam, [0, -1], padding3)) { return true; } - if (pointInsidePolygon(x2, y2, this.points, centerX, centerY, width2 - diam, height, [0, -1], padding2)) { + if (pointInsidePolygon(x5, y5, this.points, centerX, centerY, width3 - diam, height2, [0, -1], padding3)) { return true; } - var outerWidth = width2 / 2 + 2 * padding2; - var outerHeight = height / 2 + 2 * padding2; + var outerWidth = width3 / 2 + 2 * padding3; + var outerHeight = height2 / 2 + 2 * padding3; var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight]; - if (pointInsidePolygonPoints(x2, y2, points)) { + if (pointInsidePolygonPoints(x5, y5, points)) { return true; } - if (checkInEllipse(x2, y2, diam, diam, centerX + width2 / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding2)) { + if (checkInEllipse(x5, y5, diam, diam, centerX + width3 / 2 - cornerRadius, centerY + height2 / 2 - cornerRadius, padding3)) { return true; } - if (checkInEllipse(x2, y2, diam, diam, centerX - width2 / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding2)) { + if (checkInEllipse(x5, y5, diam, diam, centerX - width3 / 2 + cornerRadius, centerY + height2 / 2 - cornerRadius, padding3)) { return true; } return false; - } + }, "checkPoint") }; }; BRp$2.registerNodeShapes = function() { var nodeShapes = this.nodeShapes = {}; - var renderer3 = this; + var renderer7 = this; this.generateEllipse(); this.generatePolygon("triangle", generateUnitNgonPointsFitToSquare(3, 0)); this.generateRoundPolygon("round-triangle", generateUnitNgonPointsFitToSquare(3, 0)); @@ -183473,15 +116492,15 @@ g.stateGroup line { var innerPoints = generateUnitNgonPoints(5, Math.PI / 5); var innerRadius = 0.5 * (3 - Math.sqrt(5)); innerRadius *= 1.57; - for (var i3 = 0; i3 < innerPoints.length / 2; i3++) { - innerPoints[i3 * 2] *= innerRadius; - innerPoints[i3 * 2 + 1] *= innerRadius; + for (var i2 = 0; i2 < innerPoints.length / 2; i2++) { + innerPoints[i2 * 2] *= innerRadius; + innerPoints[i2 * 2 + 1] *= innerRadius; } - for (var i3 = 0; i3 < 20 / 4; i3++) { - star5Points[i3 * 4] = outerPoints[i3 * 2]; - star5Points[i3 * 4 + 1] = outerPoints[i3 * 2 + 1]; - star5Points[i3 * 4 + 2] = innerPoints[i3 * 2]; - star5Points[i3 * 4 + 3] = innerPoints[i3 * 2 + 1]; + for (var i2 = 0; i2 < 20 / 4; i2++) { + star5Points[i2 * 4] = outerPoints[i2 * 2]; + star5Points[i2 * 4 + 1] = outerPoints[i2 * 2 + 1]; + star5Points[i2 * 4 + 2] = innerPoints[i2 * 2]; + star5Points[i2 * 4 + 3] = innerPoints[i2 * 2 + 1]; } } star5Points = fitPolygonToSquare(star5Points); @@ -183502,104 +116521,103 @@ g.stateGroup line { if (shape = this[name]) { return shape; } - return renderer3.generatePolygon(name, points); + return renderer7.generatePolygon(name, points); }; }; - var BRp$1 = {}; + BRp$1 = {}; BRp$1.timeToRender = function() { return this.redrawTotalTime / this.redrawCount; }; - BRp$1.redraw = function(options2) { - options2 = options2 || staticEmptyObject(); - var r = this; - if (r.averageRedrawTime === void 0) { - r.averageRedrawTime = 0; + BRp$1.redraw = function(options3) { + options3 = options3 || staticEmptyObject(); + var r2 = this; + if (r2.averageRedrawTime === void 0) { + r2.averageRedrawTime = 0; } - if (r.lastRedrawTime === void 0) { - r.lastRedrawTime = 0; + if (r2.lastRedrawTime === void 0) { + r2.lastRedrawTime = 0; } - if (r.lastDrawTime === void 0) { - r.lastDrawTime = 0; + if (r2.lastDrawTime === void 0) { + r2.lastDrawTime = 0; } - r.requestedFrame = true; - r.renderOptions = options2; + r2.requestedFrame = true; + r2.renderOptions = options3; }; - BRp$1.beforeRender = function(fn2, priority) { + BRp$1.beforeRender = function(fn3, priority3) { if (this.destroyed) { return; } - if (priority == null) { + if (priority3 == null) { error("Priority is not optional for beforeRender"); } var cbs = this.beforeRenderCallbacks; cbs.push({ - fn: fn2, - priority + fn: fn3, + priority: priority3 }); - cbs.sort(function(a, b) { - return b.priority - a.priority; + cbs.sort(function(a2, b2) { + return b2.priority - a2.priority; }); }; - var beforeRenderCallbacks = function beforeRenderCallbacks2(r, willDraw, startTime) { - var cbs = r.beforeRenderCallbacks; - for (var i3 = 0; i3 < cbs.length; i3++) { - cbs[i3].fn(willDraw, startTime); + beforeRenderCallbacks = /* @__PURE__ */ __name(function beforeRenderCallbacks2(r2, willDraw, startTime) { + var cbs = r2.beforeRenderCallbacks; + for (var i2 = 0; i2 < cbs.length; i2++) { + cbs[i2].fn(willDraw, startTime); } - }; + }, "beforeRenderCallbacks"); BRp$1.startRenderLoop = function() { - var r = this; - var cy = r.cy; - if (r.renderLoopStarted) { + var r2 = this; + var cy = r2.cy; + if (r2.renderLoopStarted) { return; } else { - r.renderLoopStarted = true; + r2.renderLoopStarted = true; } - var renderFn = function renderFn2(requestTime) { - if (r.destroyed) { + var renderFn = /* @__PURE__ */ __name(function renderFn2(requestTime) { + if (r2.destroyed) { return; } - if (cy.batching()) - ; - else if (r.requestedFrame && !r.skipFrame) { - beforeRenderCallbacks(r, true, requestTime); + if (cy.batching()) ; + else if (r2.requestedFrame && !r2.skipFrame) { + beforeRenderCallbacks(r2, true, requestTime); var startTime = performanceNow(); - r.render(r.renderOptions); - var endTime = r.lastDrawTime = performanceNow(); - if (r.averageRedrawTime === void 0) { - r.averageRedrawTime = endTime - startTime; + r2.render(r2.renderOptions); + var endTime = r2.lastDrawTime = performanceNow(); + if (r2.averageRedrawTime === void 0) { + r2.averageRedrawTime = endTime - startTime; } - if (r.redrawCount === void 0) { - r.redrawCount = 0; + if (r2.redrawCount === void 0) { + r2.redrawCount = 0; } - r.redrawCount++; - if (r.redrawTotalTime === void 0) { - r.redrawTotalTime = 0; + r2.redrawCount++; + if (r2.redrawTotalTime === void 0) { + r2.redrawTotalTime = 0; } var duration = endTime - startTime; - r.redrawTotalTime += duration; - r.lastRedrawTime = duration; - r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; - r.requestedFrame = false; + r2.redrawTotalTime += duration; + r2.lastRedrawTime = duration; + r2.averageRedrawTime = r2.averageRedrawTime / 2 + duration / 2; + r2.requestedFrame = false; } else { - beforeRenderCallbacks(r, false, requestTime); + beforeRenderCallbacks(r2, false, requestTime); } - r.skipFrame = false; + r2.skipFrame = false; requestAnimationFrame2(renderFn2); - }; + }, "renderFn"); requestAnimationFrame2(renderFn); }; - var BaseRenderer = function BaseRenderer2(options2) { - this.init(options2); - }; - var BR = BaseRenderer; - var BRp = BR.prototype; + BaseRenderer = /* @__PURE__ */ __name(function BaseRenderer2(options3) { + this.init(options3); + }, "BaseRenderer"); + BR = BaseRenderer; + BRp = BR.prototype; BRp.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"]; - BRp.init = function(options2) { - var r = this; - r.options = options2; - r.cy = options2.cy; - var ctr = r.container = options2.cy.container(); - var containerWindow = r.cy.window(); + BRp.init = function(options3) { + var r2 = this; + r2.options = options3; + r2.cy = options3.cy; + var ctr = r2.container = options3.cy.container(); + var containerWindow = r2.cy.window(); if (containerWindow) { var document2 = containerWindow.document; var head2 = document2.head; @@ -183610,20 +116628,20 @@ g.stateGroup line { ctr.className = (ctr.className || "") + " " + className; } if (!stylesheetAlreadyExists) { - var stylesheet2 = document2.createElement("style"); - stylesheet2.id = stylesheetId; - stylesheet2.textContent = "." + className + " { position: relative; }"; - head2.insertBefore(stylesheet2, head2.children[0]); + var stylesheet3 = document2.createElement("style"); + stylesheet3.id = stylesheetId; + stylesheet3.textContent = "." + className + " { position: relative; }"; + head2.insertBefore(stylesheet3, head2.children[0]); } var computedStyle = containerWindow.getComputedStyle(ctr); - var position3 = computedStyle.getPropertyValue("position"); - if (position3 === "static") { + var position5 = computedStyle.getPropertyValue("position"); + if (position5 === "static") { warn("A Cytoscape container has style position:static and so can not use UI extensions properly"); } } - r.selection = [void 0, void 0, void 0, void 0, 0]; - r.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]; - r.hoverData = { + r2.selection = [void 0, void 0, void 0, void 0, 0]; + r2.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]; + r2.hoverData = { down: null, last: null, downTime: null, @@ -183632,10 +116650,10 @@ g.stateGroup line { initialPan: [null, null], capture: false }; - r.dragData = { + r2.dragData = { possibleDragElements: [] }; - r.touchData = { + r2.touchData = { start: null, capture: false, // These 3 fields related to tap, taphold events @@ -183645,30 +116663,30 @@ g.stateGroup line { now: [null, null, null, null, null, null], earlier: [null, null, null, null, null, null] }; - r.redraws = 0; - r.showFps = options2.showFps; - r.debug = options2.debug; - r.hideEdgesOnViewport = options2.hideEdgesOnViewport; - r.textureOnViewport = options2.textureOnViewport; - r.wheelSensitivity = options2.wheelSensitivity; - r.motionBlurEnabled = options2.motionBlur; - r.forcedPixelRatio = number$12(options2.pixelRatio) ? options2.pixelRatio : null; - r.motionBlur = options2.motionBlur; - r.motionBlurOpacity = options2.motionBlurOpacity; - r.motionBlurTransparency = 1 - r.motionBlurOpacity; - r.motionBlurPxRatio = 1; - r.mbPxRBlurry = 1; - r.minMbLowQualFrames = 4; - r.fullQualityMb = false; - r.clearedForMotionBlur = []; - r.desktopTapThreshold = options2.desktopTapThreshold; - r.desktopTapThreshold2 = options2.desktopTapThreshold * options2.desktopTapThreshold; - r.touchTapThreshold = options2.touchTapThreshold; - r.touchTapThreshold2 = options2.touchTapThreshold * options2.touchTapThreshold; - r.tapholdDuration = 500; - r.bindings = []; - r.beforeRenderCallbacks = []; - r.beforeRenderPriorities = { + r2.redraws = 0; + r2.showFps = options3.showFps; + r2.debug = options3.debug; + r2.hideEdgesOnViewport = options3.hideEdgesOnViewport; + r2.textureOnViewport = options3.textureOnViewport; + r2.wheelSensitivity = options3.wheelSensitivity; + r2.motionBlurEnabled = options3.motionBlur; + r2.forcedPixelRatio = number$1(options3.pixelRatio) ? options3.pixelRatio : null; + r2.motionBlur = options3.motionBlur; + r2.motionBlurOpacity = options3.motionBlurOpacity; + r2.motionBlurTransparency = 1 - r2.motionBlurOpacity; + r2.motionBlurPxRatio = 1; + r2.mbPxRBlurry = 1; + r2.minMbLowQualFrames = 4; + r2.fullQualityMb = false; + r2.clearedForMotionBlur = []; + r2.desktopTapThreshold = options3.desktopTapThreshold; + r2.desktopTapThreshold2 = options3.desktopTapThreshold * options3.desktopTapThreshold; + r2.touchTapThreshold = options3.touchTapThreshold; + r2.touchTapThreshold2 = options3.touchTapThreshold * options3.touchTapThreshold; + r2.tapholdDuration = 500; + r2.bindings = []; + r2.beforeRenderCallbacks = []; + r2.beforeRenderPriorities = { // higher priority execs before lower one animations: 400, eleCalcs: 300, @@ -183676,65 +116694,65 @@ g.stateGroup line { lyrTxrDeq: 150, lyrTxrSkip: 100 }; - r.registerNodeShapes(); - r.registerArrowShapes(); - r.registerCalculationListeners(); + r2.registerNodeShapes(); + r2.registerArrowShapes(); + r2.registerCalculationListeners(); }; BRp.notify = function(eventName, eles) { - var r = this; - var cy = r.cy; + var r2 = this; + var cy = r2.cy; if (this.destroyed) { return; } if (eventName === "init") { - r.load(); + r2.load(); return; } if (eventName === "destroy") { - r.destroy(); + r2.destroy(); return; } if (eventName === "add" || eventName === "remove" || eventName === "move" && cy.hasCompoundNodes() || eventName === "load" || eventName === "zorder" || eventName === "mount") { - r.invalidateCachedZSortedEles(); + r2.invalidateCachedZSortedEles(); } if (eventName === "viewport") { - r.redrawHint("select", true); + r2.redrawHint("select", true); } if (eventName === "load" || eventName === "resize" || eventName === "mount") { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); + r2.invalidateContainerClientCoordsCache(); + r2.matchCanvasSize(r2.container); } - r.redrawHint("eles", true); - r.redrawHint("drag", true); + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); this.startRenderLoop(); this.redraw(); }; BRp.destroy = function() { - var r = this; - r.destroyed = true; - r.cy.stopAnimationLoop(); - for (var i3 = 0; i3 < r.bindings.length; i3++) { - var binding = r.bindings[i3]; - var b = binding; - var tgt = b.target; - (tgt.off || tgt.removeEventListener).apply(tgt, b.args); - } - r.bindings = []; - r.beforeRenderCallbacks = []; - r.onUpdateEleCalcsFns = []; - if (r.removeObserver) { - r.removeObserver.disconnect(); - } - if (r.styleObserver) { - r.styleObserver.disconnect(); - } - if (r.resizeObserver) { - r.resizeObserver.disconnect(); - } - if (r.labelCalcDiv) { + var r2 = this; + r2.destroyed = true; + r2.cy.stopAnimationLoop(); + for (var i2 = 0; i2 < r2.bindings.length; i2++) { + var binding = r2.bindings[i2]; + var b2 = binding; + var tgt = b2.target; + (tgt.off || tgt.removeEventListener).apply(tgt, b2.args); + } + r2.bindings = []; + r2.beforeRenderCallbacks = []; + r2.onUpdateEleCalcsFns = []; + if (r2.removeObserver) { + r2.removeObserver.disconnect(); + } + if (r2.styleObserver) { + r2.styleObserver.disconnect(); + } + if (r2.resizeObserver) { + r2.resizeObserver.disconnect(); + } + if (r2.labelCalcDiv) { try { - document.body.removeChild(r.labelCalcDiv); - } catch (e) { + document.body.removeChild(r2.labelCalcDiv); + } catch (e3) { } } }; @@ -183744,36 +116762,36 @@ g.stateGroup line { [BRp$f, BRp$5, BRp$4, BRp$3, BRp$2, BRp$1].forEach(function(props) { extend2(BRp, props); }); - var fullFpsTime = 1e3 / 60; - var defs = { - setupDequeueing: function setupDequeueing(opts) { - return function setupDequeueingImpl() { + fullFpsTime = 1e3 / 60; + defs = { + setupDequeueing: /* @__PURE__ */ __name(function setupDequeueing(opts) { + return /* @__PURE__ */ __name(function setupDequeueingImpl() { var self2 = this; - var r = this.renderer; + var r2 = this.renderer; if (self2.dequeueingSetup) { return; } else { self2.dequeueingSetup = true; } var queueRedraw = debounce_1(function() { - r.redrawHint("eles", true); - r.redrawHint("drag", true); - r.redraw(); + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + r2.redraw(); }, opts.deqRedrawThreshold); - var dequeue = function dequeue2(willDraw, frameStartTime) { + var dequeue = /* @__PURE__ */ __name(function dequeue2(willDraw, frameStartTime) { var startTime = performanceNow(); - var avgRenderTime = r.averageRedrawTime; - var renderTime = r.lastRedrawTime; + var avgRenderTime = r2.averageRedrawTime; + var renderTime = r2.lastRedrawTime; var deqd = []; - var extent = r.cy.extent(); - var pixelRatio = r.getPixelRatio(); + var extent2 = r2.cy.extent(); + var pixelRatio = r2.getPixelRatio(); if (!willDraw) { - r.flushRenderedStyleQueue(); + r2.flushRenderedStyleQueue(); } while (true) { - var now3 = performanceNow(); - var duration = now3 - startTime; - var frameDuration = now3 - frameStartTime; + var now4 = performanceNow(); + var duration = now4 - startTime; + var frameDuration = now4 - frameStartTime; if (renderTime < fullFpsTime) { var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0); if (frameDuration >= opts.deqFastCost * timeAvailable) { @@ -183788,10 +116806,10 @@ g.stateGroup line { break; } } - var thisDeqd = opts.deq(self2, pixelRatio, extent); + var thisDeqd = opts.deq(self2, pixelRatio, extent2); if (thisDeqd.length > 0) { - for (var i3 = 0; i3 < thisDeqd.length; i3++) { - deqd.push(thisDeqd[i3]); + for (var i2 = 0; i2 < thisDeqd.length; i2++) { + deqd.push(thisDeqd[i2]); } } else { break; @@ -183799,212 +116817,213 @@ g.stateGroup line { } if (deqd.length > 0) { opts.onDeqd(self2, deqd); - if (!willDraw && opts.shouldRedraw(self2, deqd, pixelRatio, extent)) { + if (!willDraw && opts.shouldRedraw(self2, deqd, pixelRatio, extent2)) { queueRedraw(); } } - }; - var priority = opts.priority || noop$12; - r.beforeRender(dequeue, priority(self2)); - }; - } + }, "dequeue"); + var priority3 = opts.priority || noop$1; + r2.beforeRender(dequeue, priority3(self2)); + }, "setupDequeueingImpl"); + }, "setupDequeueing") }; - var ElementTextureCacheLookup = /* @__PURE__ */ function() { - function ElementTextureCacheLookup2(getKey2) { + ElementTextureCacheLookup = /* @__PURE__ */ function() { + function ElementTextureCacheLookup2(getKey3) { var doesEleInvalidateKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : falsify; _classCallCheck(this, ElementTextureCacheLookup2); - this.idsByKey = new Map$22(); - this.keyForId = new Map$22(); - this.cachesByLvl = new Map$22(); + this.idsByKey = new Map$2(); + this.keyForId = new Map$2(); + this.cachesByLvl = new Map$2(); this.lvls = []; - this.getKey = getKey2; + this.getKey = getKey3; this.doesEleInvalidateKey = doesEleInvalidateKey; } + __name(ElementTextureCacheLookup2, "ElementTextureCacheLookup"); _createClass(ElementTextureCacheLookup2, [{ key: "getIdsFor", - value: function getIdsFor(key) { + value: /* @__PURE__ */ __name(function getIdsFor(key) { if (key == null) { error("Can not get id list for null key"); } var idsByKey = this.idsByKey; var ids = this.idsByKey.get(key); if (!ids) { - ids = new Set$12(); + ids = new Set$1(); idsByKey.set(key, ids); } return ids; - } + }, "getIdsFor") }, { key: "addIdForKey", - value: function addIdForKey(key, id2) { + value: /* @__PURE__ */ __name(function addIdForKey(key, id26) { if (key != null) { - this.getIdsFor(key).add(id2); + this.getIdsFor(key).add(id26); } - } + }, "addIdForKey") }, { key: "deleteIdForKey", - value: function deleteIdForKey(key, id2) { + value: /* @__PURE__ */ __name(function deleteIdForKey(key, id26) { if (key != null) { - this.getIdsFor(key)["delete"](id2); + this.getIdsFor(key)["delete"](id26); } - } + }, "deleteIdForKey") }, { key: "getNumberOfIdsForKey", - value: function getNumberOfIdsForKey(key) { + value: /* @__PURE__ */ __name(function getNumberOfIdsForKey(key) { if (key == null) { return 0; } else { return this.getIdsFor(key).size; } - } + }, "getNumberOfIdsForKey") }, { key: "updateKeyMappingFor", - value: function updateKeyMappingFor(ele) { - var id2 = ele.id(); - var prevKey = this.keyForId.get(id2); + value: /* @__PURE__ */ __name(function updateKeyMappingFor(ele) { + var id26 = ele.id(); + var prevKey = this.keyForId.get(id26); var currKey = this.getKey(ele); - this.deleteIdForKey(prevKey, id2); - this.addIdForKey(currKey, id2); - this.keyForId.set(id2, currKey); - } + this.deleteIdForKey(prevKey, id26); + this.addIdForKey(currKey, id26); + this.keyForId.set(id26, currKey); + }, "updateKeyMappingFor") }, { key: "deleteKeyMappingFor", - value: function deleteKeyMappingFor(ele) { - var id2 = ele.id(); - var prevKey = this.keyForId.get(id2); - this.deleteIdForKey(prevKey, id2); - this.keyForId["delete"](id2); - } + value: /* @__PURE__ */ __name(function deleteKeyMappingFor(ele) { + var id26 = ele.id(); + var prevKey = this.keyForId.get(id26); + this.deleteIdForKey(prevKey, id26); + this.keyForId["delete"](id26); + }, "deleteKeyMappingFor") }, { key: "keyHasChangedFor", - value: function keyHasChangedFor(ele) { - var id2 = ele.id(); - var prevKey = this.keyForId.get(id2); + value: /* @__PURE__ */ __name(function keyHasChangedFor(ele) { + var id26 = ele.id(); + var prevKey = this.keyForId.get(id26); var newKey = this.getKey(ele); return prevKey !== newKey; - } + }, "keyHasChangedFor") }, { key: "isInvalid", - value: function isInvalid(ele) { + value: /* @__PURE__ */ __name(function isInvalid(ele) { return this.keyHasChangedFor(ele) || this.doesEleInvalidateKey(ele); - } + }, "isInvalid") }, { key: "getCachesAt", - value: function getCachesAt(lvl) { + value: /* @__PURE__ */ __name(function getCachesAt(lvl) { var cachesByLvl = this.cachesByLvl, lvls = this.lvls; var caches = cachesByLvl.get(lvl); if (!caches) { - caches = new Map$22(); + caches = new Map$2(); cachesByLvl.set(lvl, caches); lvls.push(lvl); } return caches; - } + }, "getCachesAt") }, { key: "getCache", - value: function getCache(key, lvl) { + value: /* @__PURE__ */ __name(function getCache(key, lvl) { return this.getCachesAt(lvl).get(key); - } + }, "getCache") }, { key: "get", - value: function get3(ele, lvl) { + value: /* @__PURE__ */ __name(function get6(ele, lvl) { var key = this.getKey(ele); - var cache2 = this.getCache(key, lvl); - if (cache2 != null) { + var cache3 = this.getCache(key, lvl); + if (cache3 != null) { this.updateKeyMappingFor(ele); } - return cache2; - } + return cache3; + }, "get") }, { key: "getForCachedKey", - value: function getForCachedKey(ele, lvl) { + value: /* @__PURE__ */ __name(function getForCachedKey(ele, lvl) { var key = this.keyForId.get(ele.id()); - var cache2 = this.getCache(key, lvl); - return cache2; - } + var cache3 = this.getCache(key, lvl); + return cache3; + }, "getForCachedKey") }, { key: "hasCache", - value: function hasCache(key, lvl) { + value: /* @__PURE__ */ __name(function hasCache(key, lvl) { return this.getCachesAt(lvl).has(key); - } + }, "hasCache") }, { key: "has", - value: function has2(ele, lvl) { + value: /* @__PURE__ */ __name(function has2(ele, lvl) { var key = this.getKey(ele); return this.hasCache(key, lvl); - } + }, "has") }, { key: "setCache", - value: function setCache(key, lvl, cache2) { - cache2.key = key; - this.getCachesAt(lvl).set(key, cache2); - } + value: /* @__PURE__ */ __name(function setCache(key, lvl, cache3) { + cache3.key = key; + this.getCachesAt(lvl).set(key, cache3); + }, "setCache") }, { key: "set", - value: function set3(ele, lvl, cache2) { + value: /* @__PURE__ */ __name(function set6(ele, lvl, cache3) { var key = this.getKey(ele); - this.setCache(key, lvl, cache2); + this.setCache(key, lvl, cache3); this.updateKeyMappingFor(ele); - } + }, "set") }, { key: "deleteCache", - value: function deleteCache(key, lvl) { + value: /* @__PURE__ */ __name(function deleteCache(key, lvl) { this.getCachesAt(lvl)["delete"](key); - } + }, "deleteCache") }, { key: "delete", - value: function _delete(ele, lvl) { + value: /* @__PURE__ */ __name(function _delete(ele, lvl) { var key = this.getKey(ele); this.deleteCache(key, lvl); - } + }, "_delete") }, { key: "invalidateKey", - value: function invalidateKey(key) { + value: /* @__PURE__ */ __name(function invalidateKey(key) { var _this = this; this.lvls.forEach(function(lvl) { return _this.deleteCache(key, lvl); }); - } + }, "invalidateKey") // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key) }, { key: "invalidate", - value: function invalidate(ele) { - var id2 = ele.id(); - var key = this.keyForId.get(id2); + value: /* @__PURE__ */ __name(function invalidate(ele) { + var id26 = ele.id(); + var key = this.keyForId.get(id26); this.deleteKeyMappingFor(ele); var entireKeyInvalidated = this.doesEleInvalidateKey(ele); if (entireKeyInvalidated) { this.invalidateKey(key); } return entireKeyInvalidated || this.getNumberOfIdsForKey(key) === 0; - } + }, "invalidate") }]); return ElementTextureCacheLookup2; }(); - var minTxrH = 25; - var txrStepH = 50; - var minLvl$1 = -4; - var maxLvl$1 = 3; - var maxZoom$1 = 7.99; - var eleTxrSpacing = 8; - var defTxrWidth = 1024; - var maxTxrW = 1024; - var maxTxrH = 1024; - var minUtility = 0.2; - var maxFullness = 0.8; - var maxFullnessChecks = 10; - var deqCost$1 = 0.15; - var deqAvgCost$1 = 0.1; - var deqNoDrawCost$1 = 0.9; - var deqFastCost$1 = 0.9; - var deqRedrawThreshold$1 = 100; - var maxDeqSize$1 = 1; - var getTxrReasons = { + minTxrH = 25; + txrStepH = 50; + minLvl$1 = -4; + maxLvl$1 = 3; + maxZoom$1 = 7.99; + eleTxrSpacing = 8; + defTxrWidth = 1024; + maxTxrW = 1024; + maxTxrH = 1024; + minUtility = 0.2; + maxFullness = 0.8; + maxFullnessChecks = 10; + deqCost$1 = 0.15; + deqAvgCost$1 = 0.1; + deqNoDrawCost$1 = 0.9; + deqFastCost$1 = 0.9; + deqRedrawThreshold$1 = 100; + maxDeqSize$1 = 1; + getTxrReasons = { dequeue: "dequeue", downscale: "downscale", highQuality: "highQuality" }; - var initDefaults = defaults$g({ + initDefaults = defaults$g({ getKey: null, doesEleInvalidateKey: falsify, drawElement: null, @@ -184015,16 +117034,16 @@ g.stateGroup line { allowEdgeTxrCaching: true, allowParentTxrCaching: true }); - var ElementTextureCache = function ElementTextureCache2(renderer3, initOptions) { + ElementTextureCache = /* @__PURE__ */ __name(function ElementTextureCache2(renderer7, initOptions) { var self2 = this; - self2.renderer = renderer3; + self2.renderer = renderer7; self2.onDequeues = []; var opts = initDefaults(initOptions); extend2(self2, opts); self2.lookup = new ElementTextureCacheLookup(opts.getKey, opts.doesEleInvalidateKey); self2.setupDequeueing(); - }; - var ETCp = ElementTextureCache.prototype; + }, "ElementTextureCache"); + ETCp = ElementTextureCache.prototype; ETCp.reasons = getTxrReasons; ETCp.getTextureQueue = function(txrH) { var self2 = this; @@ -184039,10 +117058,10 @@ g.stateGroup line { }; ETCp.getElementQueue = function() { var self2 = this; - var q = self2.eleCacheQueue = self2.eleCacheQueue || new heap(function(a, b) { - return b.reqs - a.reqs; + var q2 = self2.eleCacheQueue = self2.eleCacheQueue || new heap(function(a2, b2) { + return b2.reqs - a2.reqs; }); - return q; + return q2; }; ETCp.getElementKeyToQueue = function() { var self2 = this; @@ -184051,8 +117070,8 @@ g.stateGroup line { }; ETCp.getElement = function(ele, bb, pxRatio, lvl, reason) { var self2 = this; - var r = this.renderer; - var zoom = r.cy.zoom(); + var r2 = this.renderer; + var zoom2 = r2.cy.zoom(); var lookup2 = this.lookup; if (!bb || bb.w === 0 || bb.h === 0 || isNaN(bb.w) || isNaN(bb.h) || !ele.visible() || ele.removed()) { return null; @@ -184061,17 +117080,17 @@ g.stateGroup line { return null; } if (lvl == null) { - lvl = Math.ceil(log2(zoom * pxRatio)); + lvl = Math.ceil(log22(zoom2 * pxRatio)); } if (lvl < minLvl$1) { lvl = minLvl$1; - } else if (zoom >= maxZoom$1 || lvl > maxLvl$1) { + } else if (zoom2 >= maxZoom$1 || lvl > maxLvl$1) { return null; } var scale = Math.pow(2, lvl); var eleScaledH = bb.h * scale; var eleScaledW = bb.w * scale; - var scaledLabelShown = r.eleTextBiggerThanMin(ele, scale); + var scaledLabelShown = r2.eleTextBiggerThanMin(ele, scale); if (!this.isVisible(ele, scaledLabelShown)) { return null; } @@ -184096,9 +117115,9 @@ g.stateGroup line { } var txrQ = self2.getTextureQueue(txrH); var txr = txrQ[txrQ.length - 2]; - var addNewTxr = function addNewTxr2() { + var addNewTxr = /* @__PURE__ */ __name(function addNewTxr2() { return self2.recycleTexture(txrH, eleScaledW) || self2.addTexture(txrH, eleScaledW); - }; + }, "addNewTxr"); if (!txr) { txr = txrQ[txrQ.length - 1]; } @@ -184108,24 +117127,24 @@ g.stateGroup line { if (txr.width - txr.usedWidth < eleScaledW) { txr = addNewTxr(); } - var scalableFrom = function scalableFrom2(otherCache) { + var scalableFrom = /* @__PURE__ */ __name(function scalableFrom2(otherCache) { return otherCache && otherCache.scaledLabelShown === scaledLabelShown; - }; + }, "scalableFrom"); var deqing = reason && reason === getTxrReasons.dequeue; var highQualityReq = reason && reason === getTxrReasons.highQuality; var downscaleReq = reason && reason === getTxrReasons.downscale; var higherCache; - for (var l = lvl + 1; l <= maxLvl$1; l++) { - var c2 = lookup2.get(ele, l); - if (c2) { - higherCache = c2; + for (var l2 = lvl + 1; l2 <= maxLvl$1; l2++) { + var c3 = lookup2.get(ele, l2); + if (c3) { + higherCache = c3; break; } } var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; - var downscale = function downscale2() { + var downscale = /* @__PURE__ */ __name(function downscale2() { txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH); - }; + }, "downscale"); txr.context.setTransform(1, 0, 0, 1, 0, 0); txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH); if (scalableFrom(oneUpCache)) { @@ -184177,8 +117196,8 @@ g.stateGroup line { return eleCache; }; ETCp.invalidateElements = function(eles) { - for (var i3 = 0; i3 < eles.length; i3++) { - this.invalidateElement(eles[i3]); + for (var i2 = 0; i2 < eles.length; i2++) { + this.invalidateElement(eles[i2]); } }; ETCp.invalidateElement = function(ele) { @@ -184190,15 +117209,15 @@ g.stateGroup line { return; } for (var lvl = minLvl$1; lvl <= maxLvl$1; lvl++) { - var cache2 = lookup2.getForCachedKey(ele, lvl); - if (cache2) { - caches.push(cache2); + var cache3 = lookup2.getForCachedKey(ele, lvl); + if (cache3) { + caches.push(cache3); } } var noOtherElesUseCache = lookup2.invalidate(ele); if (noOtherElesUseCache) { - for (var i3 = 0; i3 < caches.length; i3++) { - var _cache = caches[i3]; + for (var i2 = 0; i2 < caches.length; i2++) { + var _cache = caches[i2]; var txr = _cache.texture; txr.invalidatedWidth += _cache.width; _cache.invalidated = true; @@ -184229,8 +117248,8 @@ g.stateGroup line { removeFromArray(txrQ, txr); txr.retired = true; var eleCaches = txr.eleCaches; - for (var i3 = 0; i3 < eleCaches.length; i3++) { - var eleCache = eleCaches[i3]; + for (var i2 = 0; i2 < eleCaches.length; i2++) { + var eleCache = eleCaches[i2]; lookup2.deleteCache(eleCache.key, eleCache.level); } clearArray(eleCaches); @@ -184256,8 +117275,8 @@ g.stateGroup line { var self2 = this; var txrQ = self2.getTextureQueue(txrH); var rtxtrQ = self2.getRetiredTextureQueue(txrH); - for (var i3 = 0; i3 < rtxtrQ.length; i3++) { - var txr = rtxtrQ[i3]; + for (var i2 = 0; i2 < rtxtrQ.length; i2++) { + var txr = rtxtrQ[i2]; if (txr.width >= minW) { txr.retired = false; txr.usedWidth = 0; @@ -184274,7 +117293,7 @@ g.stateGroup line { }; ETCp.queueElement = function(ele, lvl) { var self2 = this; - var q = self2.getElementQueue(); + var q2 = self2.getElementQueue(); var k2q = self2.getElementKeyToQueue(); var key = this.getKey(ele); var existingReq = k2q[key]; @@ -184282,7 +117301,7 @@ g.stateGroup line { existingReq.level = Math.max(existingReq.level, lvl); existingReq.eles.merge(ele); existingReq.reqs++; - q.updateItem(existingReq); + q2.updateItem(existingReq); } else { var req = { eles: ele.spawn().merge(ele), @@ -184290,19 +117309,19 @@ g.stateGroup line { reqs: 1, key }; - q.push(req); + q2.push(req); k2q[key] = req; } }; ETCp.dequeue = function(pxRatio) { var self2 = this; - var q = self2.getElementQueue(); + var q2 = self2.getElementQueue(); var k2q = self2.getElementKeyToQueue(); var dequeued = []; var lookup2 = self2.lookup; - for (var i3 = 0; i3 < maxDeqSize$1; i3++) { - if (q.size() > 0) { - var req = q.pop(); + for (var i2 = 0; i2 < maxDeqSize$1; i2++) { + if (q2.size() > 0) { + var req = q2.pop(); var key = req.key; var ele = req.eles[0]; var cacheExists = lookup2.hasCache(ele, req.level); @@ -184321,26 +117340,26 @@ g.stateGroup line { }; ETCp.removeFromQueue = function(ele) { var self2 = this; - var q = self2.getElementQueue(); + var q2 = self2.getElementQueue(); var k2q = self2.getElementKeyToQueue(); var key = this.getKey(ele); var req = k2q[key]; if (req != null) { if (req.eles.length === 1) { req.reqs = MAX_INT$1; - q.updateItem(req); - q.pop(); + q2.updateItem(req); + q2.pop(); k2q[key] = null; } else { req.eles.unmerge(ele); } } }; - ETCp.onDequeue = function(fn2) { - this.onDequeues.push(fn2); + ETCp.onDequeue = function(fn3) { + this.onDequeues.push(fn3); }; - ETCp.offDequeue = function(fn2) { - removeFromArray(this.onDequeues, fn2); + ETCp.offDequeue = function(fn3) { + removeFromArray(this.onDequeues, fn3); }; ETCp.setupDequeueing = defs.setupDequeueing({ deqRedrawThreshold: deqRedrawThreshold$1, @@ -184348,49 +117367,49 @@ g.stateGroup line { deqAvgCost: deqAvgCost$1, deqNoDrawCost: deqNoDrawCost$1, deqFastCost: deqFastCost$1, - deq: function deq(self2, pxRatio, extent) { - return self2.dequeue(pxRatio, extent); - }, - onDeqd: function onDeqd(self2, deqd) { - for (var i3 = 0; i3 < self2.onDequeues.length; i3++) { - var fn2 = self2.onDequeues[i3]; - fn2(deqd); - } - }, - shouldRedraw: function shouldRedraw(self2, deqd, pxRatio, extent) { - for (var i3 = 0; i3 < deqd.length; i3++) { - var eles = deqd[i3].eles; - for (var j = 0; j < eles.length; j++) { - var bb = eles[j].boundingBox(); - if (boundingBoxesIntersect(bb, extent)) { + deq: /* @__PURE__ */ __name(function deq(self2, pxRatio, extent2) { + return self2.dequeue(pxRatio, extent2); + }, "deq"), + onDeqd: /* @__PURE__ */ __name(function onDeqd(self2, deqd) { + for (var i2 = 0; i2 < self2.onDequeues.length; i2++) { + var fn3 = self2.onDequeues[i2]; + fn3(deqd); + } + }, "onDeqd"), + shouldRedraw: /* @__PURE__ */ __name(function shouldRedraw(self2, deqd, pxRatio, extent2) { + for (var i2 = 0; i2 < deqd.length; i2++) { + var eles = deqd[i2].eles; + for (var j2 = 0; j2 < eles.length; j2++) { + var bb = eles[j2].boundingBox(); + if (boundingBoxesIntersect(bb, extent2)) { return true; } } } return false; - }, - priority: function priority(self2) { + }, "shouldRedraw"), + priority: /* @__PURE__ */ __name(function priority(self2) { return self2.renderer.beforeRenderPriorities.eleTxrDeq; - } + }, "priority") }); - var defNumLayers = 1; - var minLvl = -4; - var maxLvl = 2; - var maxZoom = 3.99; - var deqRedrawThreshold = 50; - var refineEleDebounceTime = 50; - var deqCost = 0.15; - var deqAvgCost = 0.1; - var deqNoDrawCost = 0.9; - var deqFastCost = 0.9; - var maxDeqSize = 1; - var invalidThreshold = 250; - var maxLayerArea = 4e3 * 4e3; - var useHighQualityEleTxrReqs = true; - var LayeredTextureCache = function LayeredTextureCache2(renderer3) { + defNumLayers = 1; + minLvl = -4; + maxLvl = 2; + maxZoom2 = 3.99; + deqRedrawThreshold = 50; + refineEleDebounceTime = 50; + deqCost = 0.15; + deqAvgCost = 0.1; + deqNoDrawCost = 0.9; + deqFastCost = 0.9; + maxDeqSize = 1; + invalidThreshold = 250; + maxLayerArea = 4e3 * 4e3; + useHighQualityEleTxrReqs = true; + LayeredTextureCache = /* @__PURE__ */ __name(function LayeredTextureCache2(renderer7) { var self2 = this; - var r = self2.renderer = renderer3; - var cy = r.cy; + var r2 = self2.renderer = renderer7; + var cy = r2.cy; self2.layersByLevel = {}; self2.firstGet = true; self2.lastInvalidationTime = performanceNow() - 2 * invalidThreshold; @@ -184400,33 +117419,33 @@ g.stateGroup line { self2.refineElementTextures(self2.eleTxrDeqs); self2.eleTxrDeqs.unmerge(self2.eleTxrDeqs); }, refineEleDebounceTime); - r.beforeRender(function(willDraw, now3) { - if (now3 - self2.lastInvalidationTime <= invalidThreshold) { + r2.beforeRender(function(willDraw, now4) { + if (now4 - self2.lastInvalidationTime <= invalidThreshold) { self2.skipping = true; } else { self2.skipping = false; } - }, r.beforeRenderPriorities.lyrTxrSkip); - var qSort = function qSort2(a, b) { - return b.reqs - a.reqs; - }; + }, r2.beforeRenderPriorities.lyrTxrSkip); + var qSort = /* @__PURE__ */ __name(function qSort2(a2, b2) { + return b2.reqs - a2.reqs; + }, "qSort"); self2.layersQueue = new heap(qSort); self2.setupDequeueing(); - }; - var LTCp = LayeredTextureCache.prototype; - var layerIdPool = 0; - var MAX_INT = Math.pow(2, 53) - 1; + }, "LayeredTextureCache"); + LTCp = LayeredTextureCache.prototype; + layerIdPool = 0; + MAX_INT = Math.pow(2, 53) - 1; LTCp.makeLayer = function(bb, lvl) { var scale = Math.pow(2, lvl); - var w2 = Math.ceil(bb.w * scale); - var h = Math.ceil(bb.h * scale); - var canvas = this.renderer.makeOffscreenCanvas(w2, h); + var w3 = Math.ceil(bb.w * scale); + var h2 = Math.ceil(bb.h * scale); + var canvas = this.renderer.makeOffscreenCanvas(w3, h2); var layer = { id: layerIdPool = ++layerIdPool % MAX_INT, bb, level: lvl, - width: w2, - height: h, + width: w3, + height: h2, canvas, context: canvas.getContext("2d"), eles: [], @@ -184442,16 +117461,16 @@ g.stateGroup line { }; LTCp.getLayers = function(eles, pxRatio, lvl) { var self2 = this; - var r = self2.renderer; - var cy = r.cy; - var zoom = cy.zoom(); + var r2 = self2.renderer; + var cy = r2.cy; + var zoom2 = cy.zoom(); var firstGet = self2.firstGet; self2.firstGet = false; if (lvl == null) { - lvl = Math.ceil(log2(zoom * pxRatio)); + lvl = Math.ceil(log22(zoom2 * pxRatio)); if (lvl < minLvl) { lvl = minLvl; - } else if (zoom >= maxZoom || lvl > maxLvl) { + } else if (zoom2 >= maxZoom2 || lvl > maxLvl) { return null; } } @@ -184462,48 +117481,48 @@ g.stateGroup line { var bb; var lvlComplete = self2.levelIsComplete(lvl, eles); var tmpLayers; - var checkTempLevels = function checkTempLevels2() { - var canUseAsTmpLvl = function canUseAsTmpLvl2(l) { - self2.validateLayersElesOrdering(l, eles); - if (self2.levelIsComplete(l, eles)) { - tmpLayers = layersByLvl[l]; + var checkTempLevels = /* @__PURE__ */ __name(function checkTempLevels2() { + var canUseAsTmpLvl = /* @__PURE__ */ __name(function canUseAsTmpLvl2(l2) { + self2.validateLayersElesOrdering(l2, eles); + if (self2.levelIsComplete(l2, eles)) { + tmpLayers = layersByLvl[l2]; return true; } - }; - var checkLvls = function checkLvls2(dir2) { + }, "canUseAsTmpLvl"); + var checkLvls = /* @__PURE__ */ __name(function checkLvls2(dir2) { if (tmpLayers) { return; } - for (var l = lvl + dir2; minLvl <= l && l <= maxLvl; l += dir2) { - if (canUseAsTmpLvl(l)) { + for (var l2 = lvl + dir2; minLvl <= l2 && l2 <= maxLvl; l2 += dir2) { + if (canUseAsTmpLvl(l2)) { break; } } - }; + }, "checkLvls"); checkLvls(1); checkLvls(-1); - for (var i4 = layers.length - 1; i4 >= 0; i4--) { - var layer2 = layers[i4]; + for (var i3 = layers.length - 1; i3 >= 0; i3--) { + var layer2 = layers[i3]; if (layer2.invalid) { removeFromArray(layers, layer2); } } - }; + }, "checkTempLevels"); if (!lvlComplete) { checkTempLevels(); } else { return layers; } - var getBb = function getBb2() { + var getBb = /* @__PURE__ */ __name(function getBb2() { if (!bb) { bb = makeBoundingBox(); - for (var i4 = 0; i4 < eles.length; i4++) { - updateBoundingBox(bb, eles[i4].boundingBox()); + for (var i3 = 0; i3 < eles.length; i3++) { + updateBoundingBox(bb, eles[i3].boundingBox()); } } return bb; - }; - var makeLayer = function makeLayer2(opts) { + }, "getBb"); + var makeLayer = /* @__PURE__ */ __name(function makeLayer2(opts) { opts = opts || {}; var after = opts.after; getBb(); @@ -184513,21 +117532,21 @@ g.stateGroup line { } var layer2 = self2.makeLayer(bb, lvl); if (after != null) { - var index2 = layers.indexOf(after) + 1; - layers.splice(index2, 0, layer2); + var index = layers.indexOf(after) + 1; + layers.splice(index, 0, layer2); } else if (opts.insert === void 0 || opts.insert) { layers.unshift(layer2); } return layer2; - }; + }, "makeLayer"); if (self2.skipping && !firstGet) { return null; } var layer = null; var maxElesPerLayer = eles.length / defNumLayers; var allowLazyQueueing = !firstGet; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; var rs = ele._private.rscratch; var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; var existingLayer = caches[lvl]; @@ -184565,7 +117584,7 @@ g.stateGroup line { }; LTCp.drawEleInLayer = function(layer, ele, lvl, pxRatio) { var self2 = this; - var r = this.renderer; + var r2 = this.renderer; var context = layer.context; var bb = ele.boundingBox(); if (bb.w === 0 || bb.h === 0 || !ele.visible()) { @@ -184573,13 +117592,13 @@ g.stateGroup line { } lvl = self2.getEleLevelForLayerLevel(lvl, pxRatio); { - r.setImgSmoothing(context, false); + r2.setImgSmoothing(context, false); } { - r.drawCachedElement(context, ele, null, null, lvl, useHighQualityEleTxrReqs); + r2.drawCachedElement(context, ele, null, null, lvl, useHighQualityEleTxrReqs); } { - r.setImgSmoothing(context, true); + r2.setImgSmoothing(context, true); } }; LTCp.levelIsComplete = function(lvl, eles) { @@ -184589,8 +117608,8 @@ g.stateGroup line { return false; } var numElesInLayers = 0; - for (var i3 = 0; i3 < layers.length; i3++) { - var layer = layers[i3]; + for (var i2 = 0; i2 < layers.length; i2++) { + var layer = layers[i2]; if (layer.reqs > 0) { return false; } @@ -184609,12 +117628,12 @@ g.stateGroup line { if (!layers) { return; } - for (var i3 = 0; i3 < layers.length; i3++) { - var layer = layers[i3]; + for (var i2 = 0; i2 < layers.length; i2++) { + var layer = layers[i2]; var offset = -1; - for (var j = 0; j < eles.length; j++) { - if (layer.eles[0] === eles[j]) { - offset = j; + for (var j2 = 0; j2 < eles.length; j2++) { + if (layer.eles[0] === eles[j2]) { + offset = j2; break; } } @@ -184622,9 +117641,9 @@ g.stateGroup line { this.invalidateLayer(layer); continue; } - var o = offset; - for (var j = 0; j < layer.eles.length; j++) { - if (layer.eles[j] !== eles[o + j]) { + var o2 = offset; + for (var j2 = 0; j2 < layer.eles.length; j2++) { + if (layer.eles[j2] !== eles[o2 + j2]) { this.invalidateLayer(layer); break; } @@ -184633,14 +117652,14 @@ g.stateGroup line { }; LTCp.updateElementsInLayers = function(eles, update2) { var self2 = this; - var isEles = element2(eles[0]); - for (var i3 = 0; i3 < eles.length; i3++) { - var req = isEles ? null : eles[i3]; - var ele = isEles ? eles[i3] : eles[i3].ele; + var isEles = element(eles[0]); + for (var i2 = 0; i2 < eles.length; i2++) { + var req = isEles ? null : eles[i2]; + var ele = isEles ? eles[i2] : eles[i2].ele; var rs = ele._private.rscratch; var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - for (var l = minLvl; l <= maxLvl; l++) { - var layer = caches[l]; + for (var l2 = minLvl; l2 <= maxLvl; l2++) { + var layer = caches[l2]; if (!layer) { continue; } @@ -184654,8 +117673,8 @@ g.stateGroup line { LTCp.haveLayers = function() { var self2 = this; var haveLayers = false; - for (var l = minLvl; l <= maxLvl; l++) { - var layers = self2.layersByLevel[l]; + for (var l2 = minLvl; l2 <= maxLvl; l2++) { + var layers = self2.layersByLevel[l2]; if (layers && layers.length > 0) { haveLayers = true; break; @@ -184672,9 +117691,9 @@ g.stateGroup line { if (eles.length === 0 || !self2.haveLayers()) { return; } - self2.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) { + self2.updateElementsInLayers(eles, /* @__PURE__ */ __name(function invalAssocLayers(layer, ele, req) { self2.invalidateLayer(layer); - }); + }, "invalAssocLayers")); }; LTCp.invalidateLayer = function(layer) { this.lastInvalidationTime = performanceNow(); @@ -184690,8 +117709,8 @@ g.stateGroup line { if (layer.replacement) { layer.replacement.invalid = true; } - for (var i3 = 0; i3 < eles.length; i3++) { - var caches = eles[i3]._private.rscratch.imgLayerCaches; + for (var i2 = 0; i2 < eles.length; i2++) { + var caches = eles[i2]._private.rscratch.imgLayerCaches; if (caches) { caches[lvl] = null; } @@ -184699,7 +117718,7 @@ g.stateGroup line { }; LTCp.refineElementTextures = function(eles) { var self2 = this; - self2.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) { + self2.updateElementsInLayers(eles, /* @__PURE__ */ __name(function refineEachEle(layer, ele, req) { var rLyr = layer.replacement; if (!rLyr) { rLyr = layer.replacement = self2.makeLayer(layer.bb, layer.level); @@ -184707,11 +117726,11 @@ g.stateGroup line { rLyr.eles = layer.eles; } if (!rLyr.reqs) { - for (var i3 = 0; i3 < rLyr.eles.length; i3++) { - self2.queueLayer(rLyr, rLyr.eles[i3]); + for (var i2 = 0; i2 < rLyr.eles.length; i2++) { + self2.queueLayer(rLyr, rLyr.eles[i2]); } } - }); + }, "refineEachEle")); }; LTCp.enqueueElementRefinement = function(ele) { this.eleTxrDeqs.merge(ele); @@ -184719,7 +117738,7 @@ g.stateGroup line { }; LTCp.queueLayer = function(layer, ele) { var self2 = this; - var q = self2.layersQueue; + var q2 = self2.layersQueue; var elesQ = layer.elesQueue; var hasId = elesQ.hasId = elesQ.hasId || {}; if (layer.replacement) { @@ -184734,32 +117753,32 @@ g.stateGroup line { } if (layer.reqs) { layer.reqs++; - q.updateItem(layer); + q2.updateItem(layer); } else { layer.reqs = 1; - q.push(layer); + q2.push(layer); } }; LTCp.dequeue = function(pxRatio) { var self2 = this; - var q = self2.layersQueue; + var q2 = self2.layersQueue; var deqd = []; var eleDeqs = 0; while (eleDeqs < maxDeqSize) { - if (q.size() === 0) { + if (q2.size() === 0) { break; } - var layer = q.peek(); + var layer = q2.peek(); if (layer.replacement) { - q.pop(); + q2.pop(); continue; } if (layer.replaces && layer !== layer.replaces.replacement) { - q.pop(); + q2.pop(); continue; } if (layer.invalid) { - q.pop(); + q2.pop(); continue; } var ele = layer.elesQueue.shift(); @@ -184771,7 +117790,7 @@ g.stateGroup line { deqd.push(true); } if (layer.elesQueue.length === 0) { - q.pop(); + q2.pop(); layer.reqs = 0; if (layer.replaces) { self2.applyLayerReplacement(layer); @@ -184785,25 +117804,25 @@ g.stateGroup line { var self2 = this; var layersInLevel = self2.layersByLevel[layer.level]; var replaced = layer.replaces; - var index2 = layersInLevel.indexOf(replaced); - if (index2 < 0 || replaced.invalid) { + var index = layersInLevel.indexOf(replaced); + if (index < 0 || replaced.invalid) { return; } - layersInLevel[index2] = layer; - for (var i3 = 0; i3 < layer.eles.length; i3++) { - var _p = layer.eles[i3]._private; - var cache2 = _p.imgLayerCaches = _p.imgLayerCaches || {}; - if (cache2) { - cache2[layer.level] = layer; + layersInLevel[index] = layer; + for (var i2 = 0; i2 < layer.eles.length; i2++) { + var _p = layer.eles[i2]._private; + var cache3 = _p.imgLayerCaches = _p.imgLayerCaches || {}; + if (cache3) { + cache3[layer.level] = layer; } } self2.requestRedraw(); }; LTCp.requestRedraw = debounce_1(function() { - var r = this.renderer; - r.redrawHint("eles", true); - r.redrawHint("drag", true); - r.redraw(); + var r2 = this.renderer; + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); + r2.redraw(); }, 100); LTCp.setupDequeueing = defs.setupDequeueing({ deqRedrawThreshold, @@ -184811,73 +117830,21 @@ g.stateGroup line { deqAvgCost, deqNoDrawCost, deqFastCost, - deq: function deq(self2, pxRatio) { + deq: /* @__PURE__ */ __name(function deq2(self2, pxRatio) { return self2.dequeue(pxRatio); - }, - onDeqd: noop$12, + }, "deq"), + onDeqd: noop$1, shouldRedraw: trueify, - priority: function priority(self2) { + priority: /* @__PURE__ */ __name(function priority2(self2) { return self2.renderer.beforeRenderPriorities.lyrTxrDeq; - } + }, "priority") }); - var CRp$a = {}; - var impl; - function polygon(context, points) { - for (var i3 = 0; i3 < points.length; i3++) { - var pt = points[i3]; - context.lineTo(pt.x, pt.y); - } - } - function triangleBackcurve(context, points, controlPoint) { - var firstPt; - for (var i3 = 0; i3 < points.length; i3++) { - var pt = points[i3]; - if (i3 === 0) { - firstPt = pt; - } - context.lineTo(pt.x, pt.y); - } - context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y); - } - function triangleTee(context, trianglePoints, teePoints) { - if (context.beginPath) { - context.beginPath(); - } - var triPts = trianglePoints; - for (var i3 = 0; i3 < triPts.length; i3++) { - var pt = triPts[i3]; - context.lineTo(pt.x, pt.y); - } - var teePts = teePoints; - var firstTeePt = teePoints[0]; - context.moveTo(firstTeePt.x, firstTeePt.y); - for (var i3 = 1; i3 < teePts.length; i3++) { - var pt = teePts[i3]; - context.lineTo(pt.x, pt.y); - } - if (context.closePath) { - context.closePath(); - } - } - function circleTriangle(context, trianglePoints, rx, ry, r) { - if (context.beginPath) { - context.beginPath(); - } - context.arc(rx, ry, r, 0, Math.PI * 2, false); - var triPts = trianglePoints; - var firstTrPt = triPts[0]; - context.moveTo(firstTrPt.x, firstTrPt.y); - for (var i3 = 0; i3 < triPts.length; i3++) { - var pt = triPts[i3]; - context.lineTo(pt.x, pt.y); - } - if (context.closePath) { - context.closePath(); - } - } - function circle2(context, rx, ry, r) { - context.arc(rx, ry, r, 0, Math.PI * 2, false); - } + CRp$a = {}; + __name(polygon, "polygon"); + __name(triangleBackcurve, "triangleBackcurve"); + __name(triangleTee, "triangleTee"); + __name(circleTriangle, "circleTriangle"); + __name(circle5, "circle"); CRp$a.arrowShapeImpl = function(name) { return (impl || (impl = { "polygon": polygon, @@ -184885,72 +117852,72 @@ g.stateGroup line { "triangle-tee": triangleTee, "circle-triangle": circleTriangle, "triangle-cross": triangleTee, - "circle": circle2 + "circle": circle5 }))[name]; }; - var CRp$9 = {}; + CRp$9 = {}; CRp$9.drawElement = function(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity) { - var r = this; + var r2 = this; if (ele.isNode()) { - r.drawNode(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); + r2.drawNode(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); } else { - r.drawEdge(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); + r2.drawEdge(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity); } }; CRp$9.drawElementOverlay = function(context, ele) { - var r = this; + var r2 = this; if (ele.isNode()) { - r.drawNodeOverlay(context, ele); + r2.drawNodeOverlay(context, ele); } else { - r.drawEdgeOverlay(context, ele); + r2.drawEdgeOverlay(context, ele); } }; CRp$9.drawElementUnderlay = function(context, ele) { - var r = this; + var r2 = this; if (ele.isNode()) { - r.drawNodeUnderlay(context, ele); + r2.drawNodeUnderlay(context, ele); } else { - r.drawEdgeUnderlay(context, ele); + r2.drawEdgeUnderlay(context, ele); } }; - CRp$9.drawCachedElementPortion = function(context, ele, eleTxrCache, pxRatio, lvl, reason, getRotation, getOpacity2) { - var r = this; + CRp$9.drawCachedElementPortion = function(context, ele, eleTxrCache, pxRatio, lvl, reason, getRotation, getOpacity3) { + var r2 = this; var bb = eleTxrCache.getBoundingBox(ele); if (bb.w === 0 || bb.h === 0) { return; } var eleCache = eleTxrCache.getElement(ele, bb, pxRatio, lvl, reason); if (eleCache != null) { - var opacity = getOpacity2(r, ele); + var opacity = getOpacity3(r2, ele); if (opacity === 0) { return; } - var theta = getRotation(r, ele); - var x1 = bb.x1, y1 = bb.y1, w2 = bb.w, h = bb.h; - var x2, y2, sx, sy, smooth; + var theta = getRotation(r2, ele); + var x1 = bb.x1, y1 = bb.y1, w3 = bb.w, h2 = bb.h; + var x5, y5, sx, sy, smooth; if (theta !== 0) { var rotPt = eleTxrCache.getRotationPoint(ele); sx = rotPt.x; sy = rotPt.y; context.translate(sx, sy); context.rotate(theta); - smooth = r.getImgSmoothing(context); + smooth = r2.getImgSmoothing(context); if (!smooth) { - r.setImgSmoothing(context, true); + r2.setImgSmoothing(context, true); } var off = eleTxrCache.getRotationOffset(ele); - x2 = off.x; - y2 = off.y; + x5 = off.x; + y5 = off.y; } else { - x2 = x1; - y2 = y1; + x5 = x1; + y5 = y1; } var oldGlobalAlpha; if (opacity !== 1) { oldGlobalAlpha = context.globalAlpha; context.globalAlpha = oldGlobalAlpha * opacity; } - context.drawImage(eleCache.texture.canvas, eleCache.x, 0, eleCache.width, eleCache.height, x2, y2, w2, h); + context.drawImage(eleCache.texture.canvas, eleCache.x, 0, eleCache.width, eleCache.height, x5, y5, w3, h2); if (opacity !== 1) { context.globalAlpha = oldGlobalAlpha; } @@ -184958,84 +117925,84 @@ g.stateGroup line { context.rotate(-theta); context.translate(-sx, -sy); if (!smooth) { - r.setImgSmoothing(context, false); + r2.setImgSmoothing(context, false); } } } else { eleTxrCache.drawElement(context, ele); } }; - var getZeroRotation = function getZeroRotation2() { + getZeroRotation = /* @__PURE__ */ __name(function getZeroRotation2() { return 0; - }; - var getLabelRotation = function getLabelRotation2(r, ele) { - return r.getTextAngle(ele, null); - }; - var getSourceLabelRotation = function getSourceLabelRotation2(r, ele) { - return r.getTextAngle(ele, "source"); - }; - var getTargetLabelRotation = function getTargetLabelRotation2(r, ele) { - return r.getTextAngle(ele, "target"); - }; - var getOpacity = function getOpacity2(r, ele) { + }, "getZeroRotation"); + getLabelRotation = /* @__PURE__ */ __name(function getLabelRotation2(r2, ele) { + return r2.getTextAngle(ele, null); + }, "getLabelRotation"); + getSourceLabelRotation = /* @__PURE__ */ __name(function getSourceLabelRotation2(r2, ele) { + return r2.getTextAngle(ele, "source"); + }, "getSourceLabelRotation"); + getTargetLabelRotation = /* @__PURE__ */ __name(function getTargetLabelRotation2(r2, ele) { + return r2.getTextAngle(ele, "target"); + }, "getTargetLabelRotation"); + getOpacity = /* @__PURE__ */ __name(function getOpacity2(r2, ele) { return ele.effectiveOpacity(); - }; - var getTextOpacity = function getTextOpacity2(e, ele) { + }, "getOpacity"); + getTextOpacity = /* @__PURE__ */ __name(function getTextOpacity2(e3, ele) { return ele.pstyle("text-opacity").pfValue * ele.effectiveOpacity(); - }; - CRp$9.drawCachedElement = function(context, ele, pxRatio, extent, lvl, requestHighQuality) { - var r = this; - var _r$data = r.data, eleTxrCache = _r$data.eleTxrCache, lblTxrCache = _r$data.lblTxrCache, slbTxrCache = _r$data.slbTxrCache, tlbTxrCache = _r$data.tlbTxrCache; + }, "getTextOpacity"); + CRp$9.drawCachedElement = function(context, ele, pxRatio, extent2, lvl, requestHighQuality) { + var r2 = this; + var _r$data = r2.data, eleTxrCache = _r$data.eleTxrCache, lblTxrCache = _r$data.lblTxrCache, slbTxrCache = _r$data.slbTxrCache, tlbTxrCache = _r$data.tlbTxrCache; var bb = ele.boundingBox(); var reason = requestHighQuality === true ? eleTxrCache.reasons.highQuality : null; if (bb.w === 0 || bb.h === 0 || !ele.visible()) { return; } - if (!extent || boundingBoxesIntersect(bb, extent)) { - var isEdge = ele.isEdge(); + if (!extent2 || boundingBoxesIntersect(bb, extent2)) { + var isEdge2 = ele.isEdge(); var badLine = ele.element()._private.rscratch.badLine; - r.drawElementUnderlay(context, ele); - r.drawCachedElementPortion(context, ele, eleTxrCache, pxRatio, lvl, reason, getZeroRotation, getOpacity); - if (!isEdge || !badLine) { - r.drawCachedElementPortion(context, ele, lblTxrCache, pxRatio, lvl, reason, getLabelRotation, getTextOpacity); + r2.drawElementUnderlay(context, ele); + r2.drawCachedElementPortion(context, ele, eleTxrCache, pxRatio, lvl, reason, getZeroRotation, getOpacity); + if (!isEdge2 || !badLine) { + r2.drawCachedElementPortion(context, ele, lblTxrCache, pxRatio, lvl, reason, getLabelRotation, getTextOpacity); } - if (isEdge && !badLine) { - r.drawCachedElementPortion(context, ele, slbTxrCache, pxRatio, lvl, reason, getSourceLabelRotation, getTextOpacity); - r.drawCachedElementPortion(context, ele, tlbTxrCache, pxRatio, lvl, reason, getTargetLabelRotation, getTextOpacity); + if (isEdge2 && !badLine) { + r2.drawCachedElementPortion(context, ele, slbTxrCache, pxRatio, lvl, reason, getSourceLabelRotation, getTextOpacity); + r2.drawCachedElementPortion(context, ele, tlbTxrCache, pxRatio, lvl, reason, getTargetLabelRotation, getTextOpacity); } - r.drawElementOverlay(context, ele); + r2.drawElementOverlay(context, ele); } }; CRp$9.drawElements = function(context, eles) { - var r = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - r.drawElement(context, ele); + var r2 = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + r2.drawElement(context, ele); } }; - CRp$9.drawCachedElements = function(context, eles, pxRatio, extent) { - var r = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; - r.drawCachedElement(context, ele, pxRatio, extent); + CRp$9.drawCachedElements = function(context, eles, pxRatio, extent2) { + var r2 = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; + r2.drawCachedElement(context, ele, pxRatio, extent2); } }; - CRp$9.drawCachedNodes = function(context, eles, pxRatio, extent) { - var r = this; - for (var i3 = 0; i3 < eles.length; i3++) { - var ele = eles[i3]; + CRp$9.drawCachedNodes = function(context, eles, pxRatio, extent2) { + var r2 = this; + for (var i2 = 0; i2 < eles.length; i2++) { + var ele = eles[i2]; if (!ele.isNode()) { continue; } - r.drawCachedElement(context, ele, pxRatio, extent); + r2.drawCachedElement(context, ele, pxRatio, extent2); } }; - CRp$9.drawLayeredElements = function(context, eles, pxRatio, extent) { - var r = this; - var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio); + CRp$9.drawLayeredElements = function(context, eles, pxRatio, extent2) { + var r2 = this; + var layers = r2.data.lyrTxrCache.getLayers(eles, pxRatio); if (layers) { - for (var i3 = 0; i3 < layers.length; i3++) { - var layer = layers[i3]; + for (var i2 = 0; i2 < layers.length; i2++) { + var layer = layers[i2]; var bb = layer.bb; if (bb.w === 0 || bb.h === 0) { continue; @@ -185043,15 +118010,15 @@ g.stateGroup line { context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h); } } else { - r.drawCachedElements(context, eles, pxRatio, extent); + r2.drawCachedElements(context, eles, pxRatio, extent2); } }; - var CRp$8 = {}; + CRp$8 = {}; CRp$8.drawEdge = function(context, edge, shiftToOriginWithBb) { - var drawLabel2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; + var drawLabel4 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; - var r = this; + var r2 = this; var rs = edge._private.rscratch; if (shouldDrawOpacity && !edge.visible()) { return; @@ -185070,40 +118037,59 @@ g.stateGroup line { var lineStyle = edge.pstyle("line-style").value; var edgeWidth = edge.pstyle("width").pfValue; var lineCap = edge.pstyle("line-cap").value; + var lineOutlineWidth = edge.pstyle("line-outline-width").value; + var lineOutlineColor = edge.pstyle("line-outline-color").value; var effectiveLineOpacity = opacity * lineOpacity; var effectiveArrowOpacity = opacity * lineOpacity; - var drawLine = function drawLine2() { + var drawLine = /* @__PURE__ */ __name(function drawLine2() { var strokeOpacity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : effectiveLineOpacity; if (curveStyle === "straight-triangle") { - r.eleStrokeStyle(context, edge, strokeOpacity); - r.drawEdgeTrianglePath(edge, context, rs.allpts); + r2.eleStrokeStyle(context, edge, strokeOpacity); + r2.drawEdgeTrianglePath(edge, context, rs.allpts); } else { context.lineWidth = edgeWidth; context.lineCap = lineCap; - r.eleStrokeStyle(context, edge, strokeOpacity); - r.drawEdgePath(edge, context, rs.allpts, lineStyle); + r2.eleStrokeStyle(context, edge, strokeOpacity); + r2.drawEdgePath(edge, context, rs.allpts, lineStyle); context.lineCap = "butt"; } - }; - var drawOverlay = function drawOverlay2() { + }, "drawLine"); + var drawLineOutline = /* @__PURE__ */ __name(function drawLineOutline2() { + var strokeOpacity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : effectiveLineOpacity; + context.lineWidth = edgeWidth + lineOutlineWidth; + context.lineCap = lineCap; + if (lineOutlineWidth > 0) { + r2.colorStrokeStyle(context, lineOutlineColor[0], lineOutlineColor[1], lineOutlineColor[2], strokeOpacity); + } else { + context.lineCap = "butt"; + return; + } + if (curveStyle === "straight-triangle") { + r2.drawEdgeTrianglePath(edge, context, rs.allpts); + } else { + r2.drawEdgePath(edge, context, rs.allpts, lineStyle); + context.lineCap = "butt"; + } + }, "drawLineOutline"); + var drawOverlay = /* @__PURE__ */ __name(function drawOverlay2() { if (!shouldDrawOverlay) { return; } - r.drawEdgeOverlay(context, edge); - }; - var drawUnderlay = function drawUnderlay2() { + r2.drawEdgeOverlay(context, edge); + }, "drawOverlay"); + var drawUnderlay = /* @__PURE__ */ __name(function drawUnderlay2() { if (!shouldDrawOverlay) { return; } - r.drawEdgeUnderlay(context, edge); - }; - var drawArrows2 = function drawArrows3() { + r2.drawEdgeUnderlay(context, edge); + }, "drawUnderlay"); + var drawArrows2 = /* @__PURE__ */ __name(function drawArrows3() { var arrowOpacity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : effectiveArrowOpacity; - r.drawArrowheads(context, edge, arrowOpacity); - }; - var drawText2 = function drawText3() { - r.drawElementText(context, edge, null, drawLabel2); - }; + r2.drawArrowheads(context, edge, arrowOpacity); + }, "drawArrows"); + var drawText6 = /* @__PURE__ */ __name(function drawText7() { + r2.drawElementText(context, edge, null, drawLabel4); + }, "drawText"); context.lineJoin = "round"; var ghost = edge.pstyle("ghost").value === "yes"; if (ghost) { @@ -185115,17 +118101,19 @@ g.stateGroup line { drawLine(effectiveGhostOpacity); drawArrows2(effectiveGhostOpacity); context.translate(-gx, -gy); + } else { + drawLineOutline(); } drawUnderlay(); drawLine(); drawArrows2(); drawOverlay(); - drawText2(); + drawText6(); if (shiftToOriginWithBb) { context.translate(bb.x1, bb.y1); } }; - var drawEdgeOverlayUnderlay = function drawEdgeOverlayUnderlay2(overlayOrUnderlay) { + drawEdgeOverlayUnderlay = /* @__PURE__ */ __name(function drawEdgeOverlayUnderlay2(overlayOrUnderlay) { if (!["overlay", "underlay"].includes(overlayOrUnderlay)) { throw new Error("Invalid state"); } @@ -185137,28 +118125,28 @@ g.stateGroup line { if (opacity === 0) { return; } - var r = this; - var usePaths = r.usePaths(); + var r2 = this; + var usePaths = r2.usePaths(); var rs = edge._private.rscratch; - var padding2 = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue; - var width2 = 2 * padding2; + var padding3 = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue; + var width3 = 2 * padding3; var color2 = edge.pstyle("".concat(overlayOrUnderlay, "-color")).value; - context.lineWidth = width2; + context.lineWidth = width3; if (rs.edgeType === "self" && !usePaths) { context.lineCap = "butt"; } else { context.lineCap = "round"; } - r.colorStrokeStyle(context, color2[0], color2[1], color2[2], opacity); - r.drawEdgePath(edge, context, rs.allpts, "solid"); + r2.colorStrokeStyle(context, color2[0], color2[1], color2[2], opacity); + r2.drawEdgePath(edge, context, rs.allpts, "solid"); }; - }; + }, "drawEdgeOverlayUnderlay"); CRp$8.drawEdgeOverlay = drawEdgeOverlayUnderlay("overlay"); CRp$8.drawEdgeUnderlay = drawEdgeOverlayUnderlay("underlay"); - CRp$8.drawEdgePath = function(edge, context, pts2, type2) { + CRp$8.drawEdgePath = function(edge, context, pts2, type3) { var rs = edge._private.rscratch; var canvasCxt = context; - var path2; + var path4; var pathCacheHit = false; var usePaths = this.usePaths(); var lineDashPattern = edge.pstyle("line-dash-pattern").pfValue; @@ -185167,16 +118155,16 @@ g.stateGroup line { var pathCacheKey = pts2.join("$"); var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; if (keyMatches) { - path2 = context = rs.pathCache; + path4 = context = rs.pathCache; pathCacheHit = true; } else { - path2 = context = new Path2D(); + path4 = context = new Path2D(); rs.pathCacheKey = pathCacheKey; - rs.pathCache = path2; + rs.pathCache = path4; } } if (canvasCxt.setLineDash) { - switch (type2) { + switch (type3) { case "dotted": canvasCxt.setLineDash([1, 1]); break; @@ -185199,22 +118187,41 @@ g.stateGroup line { case "self": case "compound": case "multibezier": - for (var i3 = 2; i3 + 3 < pts2.length; i3 += 4) { - context.quadraticCurveTo(pts2[i3], pts2[i3 + 1], pts2[i3 + 2], pts2[i3 + 3]); + for (var i2 = 2; i2 + 3 < pts2.length; i2 += 4) { + context.quadraticCurveTo(pts2[i2], pts2[i2 + 1], pts2[i2 + 2], pts2[i2 + 3]); } break; case "straight": - case "segments": case "haystack": - for (var _i6 = 2; _i6 + 1 < pts2.length; _i6 += 2) { - context.lineTo(pts2[_i6], pts2[_i6 + 1]); + for (var _i = 2; _i + 1 < pts2.length; _i += 2) { + context.lineTo(pts2[_i], pts2[_i + 1]); + } + break; + case "segments": + if (rs.isRound) { + var _iterator = _createForOfIteratorHelper(rs.roundCorners), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var corner = _step.value; + drawPreparedRoundCorner(context, corner); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + context.lineTo(pts2[pts2.length - 2], pts2[pts2.length - 1]); + } else { + for (var _i2 = 2; _i2 + 1 < pts2.length; _i2 += 2) { + context.lineTo(pts2[_i2], pts2[_i2 + 1]); + } } break; } } context = canvasCxt; if (usePaths) { - context.stroke(path2); + context.stroke(path4); } else { context.stroke(); } @@ -185225,15 +118232,15 @@ g.stateGroup line { CRp$8.drawEdgeTrianglePath = function(edge, context, pts2) { context.fillStyle = context.strokeStyle; var edgeWidth = edge.pstyle("width").pfValue; - for (var i3 = 0; i3 + 1 < pts2.length; i3 += 2) { - var vector = [pts2[i3 + 2] - pts2[i3], pts2[i3 + 3] - pts2[i3 + 1]]; + for (var i2 = 0; i2 + 1 < pts2.length; i2 += 2) { + var vector = [pts2[i2 + 2] - pts2[i2], pts2[i2 + 3] - pts2[i2 + 1]]; var length2 = Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]); - var normal2 = [vector[1] / length2, -vector[0] / length2]; - var triangleHead = [normal2[0] * edgeWidth / 2, normal2[1] * edgeWidth / 2]; + var normal = [vector[1] / length2, -vector[0] / length2]; + var triangleHead = [normal[0] * edgeWidth / 2, normal[1] * edgeWidth / 2]; context.beginPath(); - context.moveTo(pts2[i3] - triangleHead[0], pts2[i3 + 1] - triangleHead[1]); - context.lineTo(pts2[i3] + triangleHead[0], pts2[i3 + 1] + triangleHead[1]); - context.lineTo(pts2[i3 + 2], pts2[i3 + 3]); + context.moveTo(pts2[i2] - triangleHead[0], pts2[i2 + 1] - triangleHead[1]); + context.lineTo(pts2[i2] + triangleHead[0], pts2[i2 + 1] + triangleHead[1]); + context.lineTo(pts2[i2 + 2], pts2[i2 + 3]); context.closePath(); context.fill(); } @@ -185250,8 +118257,8 @@ g.stateGroup line { this.drawArrowhead(context, edge, "target", rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity); } }; - CRp$8.drawArrowhead = function(context, edge, prefix, x2, y2, angle, opacity) { - if (isNaN(x2) || x2 == null || isNaN(y2) || y2 == null || isNaN(angle) || angle == null) { + CRp$8.drawArrowhead = function(context, edge, prefix, x5, y5, angle2, opacity) { + if (isNaN(x5) || x5 == null || isNaN(y5) || y5 == null || isNaN(angle2) || angle2 == null) { return; } var self2 = this; @@ -185264,8 +118271,7 @@ g.stateGroup line { var edgeWidth = edge.pstyle("width").pfValue; var pArrowWidth = edge.pstyle(prefix + "-arrow-width"); var arrowWidth = pArrowWidth.value === "match-line" ? edgeWidth : pArrowWidth.pfValue; - if (pArrowWidth.units === "%") - arrowWidth *= edgeWidth; + if (pArrowWidth.units === "%") arrowWidth *= edgeWidth; var edgeOpacity = edge.pstyle("opacity").value; if (opacity === void 0) { opacity = edgeOpacity; @@ -185275,37 +118281,37 @@ g.stateGroup line { context.globalCompositeOperation = "destination-out"; self2.colorFillStyle(context, 255, 255, 255, 1); self2.colorStrokeStyle(context, 255, 255, 255, 1); - self2.drawArrowShape(edge, context, arrowClearFill, edgeWidth, arrowShape, arrowWidth, x2, y2, angle); + self2.drawArrowShape(edge, context, arrowClearFill, edgeWidth, arrowShape, arrowWidth, x5, y5, angle2); context.globalCompositeOperation = gco; } var color2 = edge.pstyle(prefix + "-arrow-color").value; self2.colorFillStyle(context, color2[0], color2[1], color2[2], opacity); self2.colorStrokeStyle(context, color2[0], color2[1], color2[2], opacity); - self2.drawArrowShape(edge, context, arrowFill, edgeWidth, arrowShape, arrowWidth, x2, y2, angle); + self2.drawArrowShape(edge, context, arrowFill, edgeWidth, arrowShape, arrowWidth, x5, y5, angle2); }; - CRp$8.drawArrowShape = function(edge, context, fill, edgeWidth, shape, shapeWidth, x2, y2, angle) { - var r = this; + CRp$8.drawArrowShape = function(edge, context, fill, edgeWidth, shape, shapeWidth, x5, y5, angle2) { + var r2 = this; var usePaths = this.usePaths() && shape !== "triangle-cross"; var pathCacheHit = false; - var path2; + var path4; var canvasContext = context; var translation = { - x: x2, - y: y2 + x: x5, + y: y5 }; var scale = edge.pstyle("arrow-scale").value; - var size2 = this.getArrowWidth(edgeWidth, scale); - var shapeImpl = r.arrowShapes[shape]; + var size5 = this.getArrowWidth(edgeWidth, scale); + var shapeImpl = r2.arrowShapes[shape]; if (usePaths) { - var cache2 = r.arrowPathCache = r.arrowPathCache || []; + var cache3 = r2.arrowPathCache = r2.arrowPathCache || []; var key = hashString(shape); - var cachedPath = cache2[key]; + var cachedPath = cache3[key]; if (cachedPath != null) { - path2 = context = cachedPath; + path4 = context = cachedPath; pathCacheHit = true; } else { - path2 = context = new Path2D(); - cache2[key] = path2; + path4 = context = new Path2D(); + cache3[key] = path4; } } if (!pathCacheHit) { @@ -185318,7 +118324,7 @@ g.stateGroup line { y: 0 }, 1); } else { - shapeImpl.draw(context, size2, angle, translation, edgeWidth); + shapeImpl.draw(context, size5, angle2, translation, edgeWidth); } if (context.closePath) { context.closePath(); @@ -185326,62 +118332,64 @@ g.stateGroup line { } context = canvasContext; if (usePaths) { - context.translate(x2, y2); - context.rotate(angle); - context.scale(size2, size2); + context.translate(x5, y5); + context.rotate(angle2); + context.scale(size5, size5); } if (fill === "filled" || fill === "both") { if (usePaths) { - context.fill(path2); + context.fill(path4); } else { context.fill(); } } if (fill === "hollow" || fill === "both") { - context.lineWidth = shapeWidth / (usePaths ? size2 : 1); + context.lineWidth = shapeWidth / (usePaths ? size5 : 1); context.lineJoin = "miter"; if (usePaths) { - context.stroke(path2); + context.stroke(path4); } else { context.stroke(); } } if (usePaths) { - context.scale(1 / size2, 1 / size2); - context.rotate(-angle); - context.translate(-x2, -y2); + context.scale(1 / size5, 1 / size5); + context.rotate(-angle2); + context.translate(-x5, -y5); } }; - var CRp$7 = {}; - CRp$7.safeDrawImage = function(context, img, ix, iy, iw, ih, x2, y2, w2, h) { - if (iw <= 0 || ih <= 0 || w2 <= 0 || h <= 0) { + CRp$7 = {}; + CRp$7.safeDrawImage = function(context, img, ix, iy, iw, ih, x5, y5, w3, h2) { + if (iw <= 0 || ih <= 0 || w3 <= 0 || h2 <= 0) { return; } try { - context.drawImage(img, ix, iy, iw, ih, x2, y2, w2, h); - } catch (e) { - warn(e); + context.drawImage(img, ix, iy, iw, ih, x5, y5, w3, h2); + } catch (e3) { + warn(e3); } }; - CRp$7.drawInscribedImage = function(context, img, node2, index2, nodeOpacity) { - var r = this; + CRp$7.drawInscribedImage = function(context, img, node2, index, nodeOpacity) { + var r2 = this; var pos = node2.position(); var nodeX = pos.x; var nodeY = pos.y; var styleObj = node2.cy().style(); var getIndexedStyle = styleObj.getIndexedStyle.bind(styleObj); - var fit = getIndexedStyle(node2, "background-fit", "value", index2); - var repeat2 = getIndexedStyle(node2, "background-repeat", "value", index2); + var fit2 = getIndexedStyle(node2, "background-fit", "value", index); + var repeat2 = getIndexedStyle(node2, "background-repeat", "value", index); var nodeW = node2.width(); var nodeH = node2.height(); var paddingX2 = node2.padding() * 2; - var nodeTW = nodeW + (getIndexedStyle(node2, "background-width-relative-to", "value", index2) === "inner" ? 0 : paddingX2); - var nodeTH = nodeH + (getIndexedStyle(node2, "background-height-relative-to", "value", index2) === "inner" ? 0 : paddingX2); + var nodeTW = nodeW + (getIndexedStyle(node2, "background-width-relative-to", "value", index) === "inner" ? 0 : paddingX2); + var nodeTH = nodeH + (getIndexedStyle(node2, "background-height-relative-to", "value", index) === "inner" ? 0 : paddingX2); var rs = node2._private.rscratch; - var clip = getIndexedStyle(node2, "background-clip", "value", index2); + var clip = getIndexedStyle(node2, "background-clip", "value", index); var shouldClip = clip === "node"; - var imgOpacity = getIndexedStyle(node2, "background-image-opacity", "value", index2) * nodeOpacity; - var smooth = getIndexedStyle(node2, "background-image-smoothing", "value", index2); + var imgOpacity = getIndexedStyle(node2, "background-image-opacity", "value", index) * nodeOpacity; + var smooth = getIndexedStyle(node2, "background-image-smoothing", "value", index); + var cornerRadius = node2.pstyle("corner-radius").value; + if (cornerRadius !== "auto") cornerRadius = node2.pstyle("corner-radius").pfValue; var imgW = img.width || img.cachedW; var imgH = img.height || img.cachedH; if (null == imgW || null == imgH) { @@ -185390,79 +118398,79 @@ g.stateGroup line { imgH = img.cachedH = img.height || img.offsetHeight; document.body.removeChild(img); } - var w2 = imgW; - var h = imgH; - if (getIndexedStyle(node2, "background-width", "value", index2) !== "auto") { - if (getIndexedStyle(node2, "background-width", "units", index2) === "%") { - w2 = getIndexedStyle(node2, "background-width", "pfValue", index2) * nodeTW; + var w3 = imgW; + var h2 = imgH; + if (getIndexedStyle(node2, "background-width", "value", index) !== "auto") { + if (getIndexedStyle(node2, "background-width", "units", index) === "%") { + w3 = getIndexedStyle(node2, "background-width", "pfValue", index) * nodeTW; } else { - w2 = getIndexedStyle(node2, "background-width", "pfValue", index2); + w3 = getIndexedStyle(node2, "background-width", "pfValue", index); } } - if (getIndexedStyle(node2, "background-height", "value", index2) !== "auto") { - if (getIndexedStyle(node2, "background-height", "units", index2) === "%") { - h = getIndexedStyle(node2, "background-height", "pfValue", index2) * nodeTH; + if (getIndexedStyle(node2, "background-height", "value", index) !== "auto") { + if (getIndexedStyle(node2, "background-height", "units", index) === "%") { + h2 = getIndexedStyle(node2, "background-height", "pfValue", index) * nodeTH; } else { - h = getIndexedStyle(node2, "background-height", "pfValue", index2); + h2 = getIndexedStyle(node2, "background-height", "pfValue", index); } } - if (w2 === 0 || h === 0) { + if (w3 === 0 || h2 === 0) { return; } - if (fit === "contain") { - var scale = Math.min(nodeTW / w2, nodeTH / h); - w2 *= scale; - h *= scale; - } else if (fit === "cover") { - var scale = Math.max(nodeTW / w2, nodeTH / h); - w2 *= scale; - h *= scale; - } - var x2 = nodeX - nodeTW / 2; - var posXUnits = getIndexedStyle(node2, "background-position-x", "units", index2); - var posXPfVal = getIndexedStyle(node2, "background-position-x", "pfValue", index2); + if (fit2 === "contain") { + var scale = Math.min(nodeTW / w3, nodeTH / h2); + w3 *= scale; + h2 *= scale; + } else if (fit2 === "cover") { + var scale = Math.max(nodeTW / w3, nodeTH / h2); + w3 *= scale; + h2 *= scale; + } + var x5 = nodeX - nodeTW / 2; + var posXUnits = getIndexedStyle(node2, "background-position-x", "units", index); + var posXPfVal = getIndexedStyle(node2, "background-position-x", "pfValue", index); if (posXUnits === "%") { - x2 += (nodeTW - w2) * posXPfVal; + x5 += (nodeTW - w3) * posXPfVal; } else { - x2 += posXPfVal; + x5 += posXPfVal; } - var offXUnits = getIndexedStyle(node2, "background-offset-x", "units", index2); - var offXPfVal = getIndexedStyle(node2, "background-offset-x", "pfValue", index2); + var offXUnits = getIndexedStyle(node2, "background-offset-x", "units", index); + var offXPfVal = getIndexedStyle(node2, "background-offset-x", "pfValue", index); if (offXUnits === "%") { - x2 += (nodeTW - w2) * offXPfVal; + x5 += (nodeTW - w3) * offXPfVal; } else { - x2 += offXPfVal; + x5 += offXPfVal; } - var y2 = nodeY - nodeTH / 2; - var posYUnits = getIndexedStyle(node2, "background-position-y", "units", index2); - var posYPfVal = getIndexedStyle(node2, "background-position-y", "pfValue", index2); + var y5 = nodeY - nodeTH / 2; + var posYUnits = getIndexedStyle(node2, "background-position-y", "units", index); + var posYPfVal = getIndexedStyle(node2, "background-position-y", "pfValue", index); if (posYUnits === "%") { - y2 += (nodeTH - h) * posYPfVal; + y5 += (nodeTH - h2) * posYPfVal; } else { - y2 += posYPfVal; + y5 += posYPfVal; } - var offYUnits = getIndexedStyle(node2, "background-offset-y", "units", index2); - var offYPfVal = getIndexedStyle(node2, "background-offset-y", "pfValue", index2); + var offYUnits = getIndexedStyle(node2, "background-offset-y", "units", index); + var offYPfVal = getIndexedStyle(node2, "background-offset-y", "pfValue", index); if (offYUnits === "%") { - y2 += (nodeTH - h) * offYPfVal; + y5 += (nodeTH - h2) * offYPfVal; } else { - y2 += offYPfVal; + y5 += offYPfVal; } if (rs.pathCache) { - x2 -= nodeX; - y2 -= nodeY; + x5 -= nodeX; + y5 -= nodeY; nodeX = 0; nodeY = 0; } var gAlpha = context.globalAlpha; context.globalAlpha = imgOpacity; - var smoothingEnabled = r.getImgSmoothing(context); + var smoothingEnabled = r2.getImgSmoothing(context); var isSmoothingSwitched = false; if (smooth === "no" && smoothingEnabled) { - r.setImgSmoothing(context, false); + r2.setImgSmoothing(context, false); isSmoothingSwitched = true; } else if (smooth === "yes" && !smoothingEnabled) { - r.setImgSmoothing(context, true); + r2.setImgSmoothing(context, true); isSmoothingSwitched = true; } if (repeat2 === "no-repeat") { @@ -185471,33 +118479,33 @@ g.stateGroup line { if (rs.pathCache) { context.clip(rs.pathCache); } else { - r.nodeShapes[r.getNodeShape(node2)].draw(context, nodeX, nodeY, nodeTW, nodeTH); + r2.nodeShapes[r2.getNodeShape(node2)].draw(context, nodeX, nodeY, nodeTW, nodeTH, cornerRadius, rs); context.clip(); } } - r.safeDrawImage(context, img, 0, 0, imgW, imgH, x2, y2, w2, h); + r2.safeDrawImage(context, img, 0, 0, imgW, imgH, x5, y5, w3, h2); if (shouldClip) { context.restore(); } } else { var pattern = context.createPattern(img, repeat2); context.fillStyle = pattern; - r.nodeShapes[r.getNodeShape(node2)].draw(context, nodeX, nodeY, nodeTW, nodeTH); - context.translate(x2, y2); + r2.nodeShapes[r2.getNodeShape(node2)].draw(context, nodeX, nodeY, nodeTW, nodeTH, cornerRadius, rs); + context.translate(x5, y5); context.fill(); - context.translate(-x2, -y2); + context.translate(-x5, -y5); } context.globalAlpha = gAlpha; if (isSmoothingSwitched) { - r.setImgSmoothing(context, smoothingEnabled); + r2.setImgSmoothing(context, smoothingEnabled); } }; - var CRp$6 = {}; + CRp$6 = {}; CRp$6.eleTextBiggerThanMin = function(ele, scale) { if (!scale) { - var zoom = ele.cy().zoom(); + var zoom2 = ele.cy().zoom(); var pxRatio = this.getPixelRatio(); - var lvl = Math.ceil(log2(zoom * pxRatio)); + var lvl = Math.ceil(log22(zoom2 * pxRatio)); scale = Math.pow(2, lvl); } var computedSize = ele.pstyle("font-size").pfValue * scale; @@ -185509,9 +118517,9 @@ g.stateGroup line { }; CRp$6.drawElementText = function(context, ele, shiftToOriginWithBb, force, prefix) { var useEleOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; - var r = this; + var r2 = this; if (force == null) { - if (useEleOpacity && !r.eleTextBiggerThanMin(ele)) { + if (useEleOpacity && !r2.eleTextBiggerThanMin(ele)) { return; } } else if (force === false) { @@ -185522,7 +118530,7 @@ g.stateGroup line { if (!label || !label.value) { return; } - var justification = r.getLabelJustification(ele); + var justification = r2.getLabelJustification(ele); context.textAlign = justification; context.textBaseline = "bottom"; } else { @@ -185543,32 +118551,32 @@ g.stateGroup line { context.translate(-bb.x1, -bb.y1); } if (prefix == null) { - r.drawText(context, ele, null, applyRotation, useEleOpacity); + r2.drawText(context, ele, null, applyRotation, useEleOpacity); if (ele.isEdge()) { - r.drawText(context, ele, "source", applyRotation, useEleOpacity); - r.drawText(context, ele, "target", applyRotation, useEleOpacity); + r2.drawText(context, ele, "source", applyRotation, useEleOpacity); + r2.drawText(context, ele, "target", applyRotation, useEleOpacity); } } else { - r.drawText(context, ele, prefix, applyRotation, useEleOpacity); + r2.drawText(context, ele, prefix, applyRotation, useEleOpacity); } if (shiftToOriginWithBb) { context.translate(bb.x1, bb.y1); } }; CRp$6.getFontCache = function(context) { - var cache2; + var cache3; this.fontCaches = this.fontCaches || []; - for (var i3 = 0; i3 < this.fontCaches.length; i3++) { - cache2 = this.fontCaches[i3]; - if (cache2.context === context) { - return cache2; + for (var i2 = 0; i2 < this.fontCaches.length; i2++) { + cache3 = this.fontCaches[i2]; + if (cache3.context === context) { + return cache3; } } - cache2 = { + cache3 = { context }; - this.fontCaches.push(cache2); - return cache2; + this.fontCaches.push(cache3); + return cache3; }; CRp$6.setupTextStyle = function(context, ele) { var useEleOpacity = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; @@ -185585,25 +118593,7 @@ g.stateGroup line { this.colorFillStyle(context, color2[0], color2[1], color2[2], opacity); this.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity); }; - function roundRect(ctx, x2, y2, width2, height) { - var radius = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5; - var stroke = arguments.length > 6 ? arguments[6] : void 0; - ctx.beginPath(); - ctx.moveTo(x2 + radius, y2); - ctx.lineTo(x2 + width2 - radius, y2); - ctx.quadraticCurveTo(x2 + width2, y2, x2 + width2, y2 + radius); - ctx.lineTo(x2 + width2, y2 + height - radius); - ctx.quadraticCurveTo(x2 + width2, y2 + height, x2 + width2 - radius, y2 + height); - ctx.lineTo(x2 + radius, y2 + height); - ctx.quadraticCurveTo(x2, y2 + height, x2, y2 + height - radius); - ctx.lineTo(x2, y2 + radius); - ctx.quadraticCurveTo(x2, y2, x2 + radius, y2); - ctx.closePath(); - if (stroke) - ctx.stroke(); - else - ctx.fill(); - } + __name(roundRect, "roundRect"); CRp$6.getTextAngle = function(ele, prefix) { var theta; var _p = ele._private; @@ -185643,10 +118633,10 @@ g.stateGroup line { var textH = getPrefixedProperty(rscratch, "labelHeight", prefix); var marginX = ele.pstyle(pdash + "text-margin-x").pfValue; var marginY = ele.pstyle(pdash + "text-margin-y").pfValue; - var isEdge = ele.isEdge(); + var isEdge2 = ele.isEdge(); var halign = ele.pstyle("text-halign").value; var valign = ele.pstyle("text-valign").value; - if (isEdge) { + if (isEdge2) { halign = "center"; valign = "center"; } @@ -185760,8 +118750,7 @@ g.stateGroup line { var lineHeight = getPrefixedProperty(rscratch, "labelLineHeight", prefix); var halfTextW = textW / 2; var justification = this.getLabelJustification(ele); - if (justification === "auto") - ; + if (justification === "auto") ; else if (halign === "left") { if (justification === "left") { textX += -textW; @@ -185790,11 +118779,11 @@ g.stateGroup line { textY -= (lines.length - 1) * lineHeight; break; } - for (var l = 0; l < lines.length; l++) { + for (var l2 = 0; l2 < lines.length; l2++) { if (lineWidth > 0) { - context.strokeText(lines[l], textX, textY); + context.strokeText(lines[l2], textX, textY); } - context.fillText(lines[l], textX, textY); + context.fillText(lines[l2], textX, textY); textY += lineHeight; } } else { @@ -185809,29 +118798,29 @@ g.stateGroup line { } } }; - var CRp$5 = {}; + CRp$5 = {}; CRp$5.drawNode = function(context, node2, shiftToOriginWithBb) { - var drawLabel2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; + var drawLabel4 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; - var r = this; + var r2 = this; var nodeWidth, nodeHeight; var _p = node2._private; var rs = _p.rscratch; var pos = node2.position(); - if (!number$12(pos.x) || !number$12(pos.y)) { + if (!number$1(pos.x) || !number$1(pos.y)) { return; } if (shouldDrawOpacity && !node2.visible()) { return; } var eleOpacity = shouldDrawOpacity ? node2.effectiveOpacity() : 1; - var usePaths = r.usePaths(); - var path2; + var usePaths = r2.usePaths(); + var path4; var pathCacheHit = false; - var padding2 = node2.padding(); - nodeWidth = node2.width() + 2 * padding2; - nodeHeight = node2.height() + 2 * padding2; + var padding3 = node2.padding(); + nodeWidth = node2.width() + 2 * padding3; + nodeHeight = node2.height() + 2 * padding3; var bb; if (shiftToOriginWithBb) { bb = shiftToOriginWithBb; @@ -185842,13 +118831,13 @@ g.stateGroup line { var urlDefined = new Array(urls.length); var image = new Array(urls.length); var numImages = 0; - for (var i3 = 0; i3 < urls.length; i3++) { - var url = urls[i3]; - var defd = urlDefined[i3] = url != null && url !== "none"; + for (var i2 = 0; i2 < urls.length; i2++) { + var url = urls[i2]; + var defd = urlDefined[i2] = url != null && url !== "none"; if (defd) { - var bgImgCrossOrigin = node2.cy().style().getIndexedStyle(node2, "background-image-crossorigin", "value", i3); + var bgImgCrossOrigin = node2.cy().style().getIndexedStyle(node2, "background-image-crossorigin", "value", i2); numImages++; - image[i3] = r.getCachedImage(url, bgImgCrossOrigin, function() { + image[i2] = r2.getCachedImage(url, bgImgCrossOrigin, function() { _p.backgroundTimestamp = Date.now(); node2.emitAndNotify("background"); }); @@ -185859,53 +118848,59 @@ g.stateGroup line { var bgOpacity = node2.pstyle("background-opacity").value * eleOpacity; var borderColor = node2.pstyle("border-color").value; var borderStyle = node2.pstyle("border-style").value; + var borderJoin = node2.pstyle("border-join").value; + var borderCap = node2.pstyle("border-cap").value; + var borderPosition = node2.pstyle("border-position").value; + var borderPattern = node2.pstyle("border-dash-pattern").pfValue; + var borderOffset = node2.pstyle("border-dash-offset").pfValue; var borderOpacity = node2.pstyle("border-opacity").value * eleOpacity; var outlineWidth = node2.pstyle("outline-width").pfValue; var outlineColor = node2.pstyle("outline-color").value; var outlineStyle = node2.pstyle("outline-style").value; var outlineOpacity = node2.pstyle("outline-opacity").value * eleOpacity; var outlineOffset = node2.pstyle("outline-offset").value; - context.lineJoin = "miter"; - var setupShapeColor = function setupShapeColor2() { + var cornerRadius = node2.pstyle("corner-radius").value; + if (cornerRadius !== "auto") cornerRadius = node2.pstyle("corner-radius").pfValue; + var setupShapeColor = /* @__PURE__ */ __name(function setupShapeColor2() { var bgOpy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bgOpacity; - r.eleFillStyle(context, node2, bgOpy); - }; - var setupBorderColor = function setupBorderColor2() { + r2.eleFillStyle(context, node2, bgOpy); + }, "setupShapeColor"); + var setupBorderColor = /* @__PURE__ */ __name(function setupBorderColor2() { var bdrOpy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : borderOpacity; - r.colorStrokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy); - }; - var setupOutlineColor = function setupOutlineColor2() { + r2.colorStrokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy); + }, "setupBorderColor"); + var setupOutlineColor = /* @__PURE__ */ __name(function setupOutlineColor2() { var otlnOpy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : outlineOpacity; - r.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], otlnOpy); - }; - var getPath = function getPath2(width2, height, shape, points) { - var pathCache = r.nodePathCache = r.nodePathCache || []; - var key = hashStrings(shape === "polygon" ? shape + "," + points.join(",") : shape, "" + height, "" + width2); + r2.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], otlnOpy); + }, "setupOutlineColor"); + var getPath = /* @__PURE__ */ __name(function getPath2(width3, height2, shape, points) { + var pathCache = r2.nodePathCache = r2.nodePathCache || []; + var key = hashStrings(shape === "polygon" ? shape + "," + points.join(",") : shape, "" + height2, "" + width3, "" + cornerRadius); var cachedPath = pathCache[key]; - var path3; + var path5; var cacheHit = false; if (cachedPath != null) { - path3 = cachedPath; + path5 = cachedPath; cacheHit = true; - rs.pathCache = path3; + rs.pathCache = path5; } else { - path3 = new Path2D(); - pathCache[key] = rs.pathCache = path3; + path5 = new Path2D(); + pathCache[key] = rs.pathCache = path5; } return { - path: path3, + path: path5, cacheHit }; - }; + }, "getPath"); var styleShape = node2.pstyle("shape").strValue; var shapePts = node2.pstyle("shape-polygon-points").pfValue; if (usePaths) { context.translate(pos.x, pos.y); var shapePath = getPath(nodeWidth, nodeHeight, styleShape, shapePts); - path2 = shapePath.path; + path4 = shapePath.path; pathCacheHit = shapePath.cacheHit; } - var drawShape = function drawShape2() { + var drawShape = /* @__PURE__ */ __name(function drawShape2() { if (!pathCacheHit) { var npos = pos; if (usePaths) { @@ -185914,71 +118909,73 @@ g.stateGroup line { y: 0 }; } - r.nodeShapes[r.getNodeShape(node2)].draw(path2 || context, npos.x, npos.y, nodeWidth, nodeHeight); + r2.nodeShapes[r2.getNodeShape(node2)].draw(path4 || context, npos.x, npos.y, nodeWidth, nodeHeight, cornerRadius, rs); } if (usePaths) { - context.fill(path2); + context.fill(path4); } else { context.fill(); } - }; - var drawImages = function drawImages2() { + }, "drawShape"); + var drawImages = /* @__PURE__ */ __name(function drawImages2() { var nodeOpacity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : eleOpacity; var inside = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; var prevBging = _p.backgrounding; var totalCompleted = 0; - for (var _i6 = 0; _i6 < image.length; _i6++) { - var bgContainment = node2.cy().style().getIndexedStyle(node2, "background-image-containment", "value", _i6); + for (var _i = 0; _i < image.length; _i++) { + var bgContainment = node2.cy().style().getIndexedStyle(node2, "background-image-containment", "value", _i); if (inside && bgContainment === "over" || !inside && bgContainment === "inside") { totalCompleted++; continue; } - if (urlDefined[_i6] && image[_i6].complete && !image[_i6].error) { + if (urlDefined[_i] && image[_i].complete && !image[_i].error) { totalCompleted++; - r.drawInscribedImage(context, image[_i6], node2, _i6, nodeOpacity); + r2.drawInscribedImage(context, image[_i], node2, _i, nodeOpacity); } } _p.backgrounding = !(totalCompleted === numImages); if (prevBging !== _p.backgrounding) { node2.updateStyle(false); } - }; - var drawPie = function drawPie2() { + }, "drawImages"); + var drawPie = /* @__PURE__ */ __name(function drawPie2() { var redrawShape = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; var pieOpacity = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : eleOpacity; - if (r.hasPie(node2)) { - r.drawPie(context, node2, pieOpacity); + if (r2.hasPie(node2)) { + r2.drawPie(context, node2, pieOpacity); if (redrawShape) { if (!usePaths) { - r.nodeShapes[r.getNodeShape(node2)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight); + r2.nodeShapes[r2.getNodeShape(node2)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight, cornerRadius, rs); } } } - }; - var darken2 = function darken3() { + }, "drawPie"); + var darken2 = /* @__PURE__ */ __name(function darken3() { var darkenOpacity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : eleOpacity; var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity; - var c2 = darkness > 0 ? 0 : 255; + var c3 = darkness > 0 ? 0 : 255; if (darkness !== 0) { - r.colorFillStyle(context, c2, c2, c2, opacity); + r2.colorFillStyle(context, c3, c3, c3, opacity); if (usePaths) { - context.fill(path2); + context.fill(path4); } else { context.fill(); } } - }; - var drawBorder = function drawBorder2() { + }, "darken"); + var drawBorder = /* @__PURE__ */ __name(function drawBorder2() { if (borderWidth > 0) { context.lineWidth = borderWidth; - context.lineCap = "butt"; + context.lineCap = borderCap; + context.lineJoin = borderJoin; if (context.setLineDash) { switch (borderStyle) { case "dotted": context.setLineDash([1, 1]); break; case "dashed": - context.setLineDash([4, 2]); + context.setLineDash(borderPattern); + context.lineDashOffset = borderOffset; break; case "solid": case "double": @@ -185986,17 +118983,28 @@ g.stateGroup line { break; } } - if (usePaths) { - context.stroke(path2); + if (borderPosition !== "center") { + context.save(); + context.lineWidth *= 2; + if (borderPosition === "inside") { + usePaths ? context.clip(path4) : context.clip(); + } else { + var region = new Path2D(); + region.rect(-nodeWidth / 2 - borderWidth, -nodeHeight / 2 - borderWidth, nodeWidth + 2 * borderWidth, nodeHeight + 2 * borderWidth); + region.addPath(path4); + context.clip(region, "evenodd"); + } + usePaths ? context.stroke(path4) : context.stroke(); + context.restore(); } else { - context.stroke(); + usePaths ? context.stroke(path4) : context.stroke(); } if (borderStyle === "double") { context.lineWidth = borderWidth / 3; var gco = context.globalCompositeOperation; context.globalCompositeOperation = "destination-out"; if (usePaths) { - context.stroke(path2); + context.stroke(path4); } else { context.stroke(); } @@ -186006,8 +119014,8 @@ g.stateGroup line { context.setLineDash([]); } } - }; - var drawOutline = function drawOutline2() { + }, "drawBorder"); + var drawOutline = /* @__PURE__ */ __name(function drawOutline2() { if (outlineWidth > 0) { context.lineWidth = outlineWidth; context.lineCap = "butt"; @@ -186032,61 +119040,92 @@ g.stateGroup line { y: 0 }; } - var shape = r.getNodeShape(node2); - var scaleX = (nodeWidth + borderWidth + (outlineWidth + outlineOffset)) / nodeWidth; - var scaleY = (nodeHeight + borderWidth + (outlineWidth + outlineOffset)) / nodeHeight; + var shape = r2.getNodeShape(node2); + var bWidth = borderWidth; + if (borderPosition === "inside") bWidth = 0; + if (borderPosition === "outside") bWidth *= 2; + var scaleX = (nodeWidth + bWidth + (outlineWidth + outlineOffset)) / nodeWidth; + var scaleY = (nodeHeight + bWidth + (outlineWidth + outlineOffset)) / nodeHeight; var sWidth = nodeWidth * scaleX; var sHeight = nodeHeight * scaleY; - var points = r.nodeShapes[shape].points; + var points = r2.nodeShapes[shape].points; var _path; if (usePaths) { var outlinePath = getPath(sWidth, sHeight, shape, points); _path = outlinePath.path; } if (shape === "ellipse") { - r.drawEllipsePath(_path || context, npos.x, npos.y, sWidth, sHeight); + r2.drawEllipsePath(_path || context, npos.x, npos.y, sWidth, sHeight); } else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(shape)) { var sMult = 0; var offsetX = 0; var offsetY = 0; if (shape === "round-diamond") { - sMult = (borderWidth + outlineOffset + outlineWidth) * 1.4; + sMult = (bWidth + outlineOffset + outlineWidth) * 1.4; } else if (shape === "round-heptagon") { - sMult = (borderWidth + outlineOffset + outlineWidth) * 1.075; - offsetY = -(borderWidth / 2 + outlineOffset + outlineWidth) / 35; + sMult = (bWidth + outlineOffset + outlineWidth) * 1.075; + offsetY = -(bWidth / 2 + outlineOffset + outlineWidth) / 35; } else if (shape === "round-hexagon") { - sMult = (borderWidth + outlineOffset + outlineWidth) * 1.12; + sMult = (bWidth + outlineOffset + outlineWidth) * 1.12; } else if (shape === "round-pentagon") { - sMult = (borderWidth + outlineOffset + outlineWidth) * 1.13; - offsetY = -(borderWidth / 2 + outlineOffset + outlineWidth) / 15; + sMult = (bWidth + outlineOffset + outlineWidth) * 1.13; + offsetY = -(bWidth / 2 + outlineOffset + outlineWidth) / 15; } else if (shape === "round-tag") { - sMult = (borderWidth + outlineOffset + outlineWidth) * 1.12; - offsetX = (borderWidth / 2 + outlineWidth + outlineOffset) * 0.07; + sMult = (bWidth + outlineOffset + outlineWidth) * 1.12; + offsetX = (bWidth / 2 + outlineWidth + outlineOffset) * 0.07; } else if (shape === "round-triangle") { - sMult = (borderWidth + outlineOffset + outlineWidth) * (Math.PI / 2); - offsetY = -(borderWidth + outlineOffset / 2 + outlineWidth) / Math.PI; + sMult = (bWidth + outlineOffset + outlineWidth) * (Math.PI / 2); + offsetY = -(bWidth + outlineOffset / 2 + outlineWidth) / Math.PI; } if (sMult !== 0) { scaleX = (nodeWidth + sMult) / nodeWidth; - scaleY = (nodeHeight + sMult) / nodeHeight; + sWidth = nodeWidth * scaleX; + if (!["round-hexagon", "round-tag"].includes(shape)) { + scaleY = (nodeHeight + sMult) / nodeHeight; + sHeight = nodeHeight * scaleY; + } + } + cornerRadius = cornerRadius === "auto" ? getRoundPolygonRadius(sWidth, sHeight) : cornerRadius; + var halfW = sWidth / 2; + var halfH = sHeight / 2; + var radius2 = cornerRadius + (bWidth + outlineWidth + outlineOffset) / 2; + var p3 = new Array(points.length / 2); + var corners = new Array(points.length / 2); + for (var _i3 = 0; _i3 < points.length / 2; _i3++) { + p3[_i3] = { + x: npos.x + offsetX + halfW * points[_i3 * 2], + y: npos.y + offsetY + halfH * points[_i3 * 2 + 1] + }; } - r.drawRoundPolygonPath(_path || context, npos.x + offsetX, npos.y + offsetY, nodeWidth * scaleX, nodeHeight * scaleY, points); + var _i2, p1, p22, p32, len = p3.length; + p1 = p3[len - 1]; + for (_i2 = 0; _i2 < len; _i2++) { + p22 = p3[_i2 % len]; + p32 = p3[(_i2 + 1) % len]; + corners[_i2] = getRoundCorner(p1, p22, p32, radius2); + p1 = p22; + p22 = p32; + } + r2.drawRoundPolygonPath(_path || context, npos.x + offsetX, npos.y + offsetY, nodeWidth * scaleX, nodeHeight * scaleY, points, corners); } else if (["roundrectangle", "round-rectangle"].includes(shape)) { - r.drawRoundRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight); + cornerRadius = cornerRadius === "auto" ? getRoundRectangleRadius(sWidth, sHeight) : cornerRadius; + r2.drawRoundRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight, cornerRadius + (bWidth + outlineWidth + outlineOffset) / 2); } else if (["cutrectangle", "cut-rectangle"].includes(shape)) { - r.drawCutRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight); + cornerRadius = cornerRadius === "auto" ? getCutRectangleCornerLength() : cornerRadius; + r2.drawCutRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight, null, cornerRadius + (bWidth + outlineWidth + outlineOffset) / 4); } else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(shape)) { - r.drawBottomRoundRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight); + cornerRadius = cornerRadius === "auto" ? getRoundRectangleRadius(sWidth, sHeight) : cornerRadius; + r2.drawBottomRoundRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight, cornerRadius + (bWidth + outlineWidth + outlineOffset) / 2); } else if (shape === "barrel") { - r.drawBarrelPath(_path || context, npos.x, npos.y, sWidth, sHeight); + r2.drawBarrelPath(_path || context, npos.x, npos.y, sWidth, sHeight); } else if (shape.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(shape)) { - var pad2 = (borderWidth + outlineWidth + outlineOffset) / nodeWidth; - points = joinLines(expandPolygon(points, pad2)); - r.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points); + var pad3 = (bWidth + outlineWidth + outlineOffset) / nodeWidth; + points = joinLines(expandPolygon(points, pad3)); + r2.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points); } else { - var _pad = (borderWidth + outlineWidth + outlineOffset) / nodeWidth; + var _pad = (bWidth + outlineWidth + outlineOffset) / nodeWidth; points = joinLines(expandPolygon(points, -_pad)); - r.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points); + r2.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points); } if (usePaths) { context.stroke(_path); @@ -186094,7 +119133,7 @@ g.stateGroup line { context.stroke(); } if (outlineStyle === "double") { - context.lineWidth = borderWidth / 3; + context.lineWidth = bWidth / 3; var gco = context.globalCompositeOperation; context.globalCompositeOperation = "destination-out"; if (usePaths) { @@ -186108,20 +119147,20 @@ g.stateGroup line { context.setLineDash([]); } } - }; - var drawOverlay = function drawOverlay2() { + }, "drawOutline"); + var drawOverlay = /* @__PURE__ */ __name(function drawOverlay2() { if (shouldDrawOverlay) { - r.drawNodeOverlay(context, node2, pos, nodeWidth, nodeHeight); + r2.drawNodeOverlay(context, node2, pos, nodeWidth, nodeHeight); } - }; - var drawUnderlay = function drawUnderlay2() { + }, "drawOverlay"); + var drawUnderlay = /* @__PURE__ */ __name(function drawUnderlay2() { if (shouldDrawOverlay) { - r.drawNodeUnderlay(context, node2, pos, nodeWidth, nodeHeight); + r2.drawNodeUnderlay(context, node2, pos, nodeWidth, nodeHeight); } - }; - var drawText2 = function drawText3() { - r.drawElementText(context, node2, null, drawLabel2); - }; + }, "drawUnderlay"); + var drawText6 = /* @__PURE__ */ __name(function drawText7() { + r2.drawElementText(context, node2, null, drawLabel4); + }, "drawText"); var ghost = node2.pstyle("ghost").value === "yes"; if (ghost) { var gx = node2.pstyle("ghost-offset-x").pfValue; @@ -186161,25 +119200,26 @@ g.stateGroup line { if (usePaths) { context.translate(-pos.x, -pos.y); } - drawText2(); + drawText6(); drawOverlay(); if (shiftToOriginWithBb) { context.translate(bb.x1, bb.y1); } }; - var drawNodeOverlayUnderlay = function drawNodeOverlayUnderlay2(overlayOrUnderlay) { + drawNodeOverlayUnderlay = /* @__PURE__ */ __name(function drawNodeOverlayUnderlay2(overlayOrUnderlay) { if (!["overlay", "underlay"].includes(overlayOrUnderlay)) { throw new Error("Invalid state"); } return function(context, node2, pos, nodeWidth, nodeHeight) { - var r = this; + var r2 = this; if (!node2.visible()) { return; } - var padding2 = node2.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue; + var padding3 = node2.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue; var opacity = node2.pstyle("".concat(overlayOrUnderlay, "-opacity")).value; var color2 = node2.pstyle("".concat(overlayOrUnderlay, "-color")).value; var shape = node2.pstyle("".concat(overlayOrUnderlay, "-shape")).value; + var radius2 = node2.pstyle("".concat(overlayOrUnderlay, "-corner-radius")).value; if (opacity > 0) { pos = pos || node2.position(); if (nodeWidth == null || nodeHeight == null) { @@ -186187,12 +119227,12 @@ g.stateGroup line { nodeWidth = node2.width() + 2 * _padding; nodeHeight = node2.height() + 2 * _padding; } - r.colorFillStyle(context, color2[0], color2[1], color2[2], opacity); - r.nodeShapes[shape].draw(context, pos.x, pos.y, nodeWidth + padding2 * 2, nodeHeight + padding2 * 2); + r2.colorFillStyle(context, color2[0], color2[1], color2[2], opacity); + r2.nodeShapes[shape].draw(context, pos.x, pos.y, nodeWidth + padding3 * 2, nodeHeight + padding3 * 2, radius2); context.fill(); } }; - }; + }, "drawNodeOverlayUnderlay"); CRp$5.drawNodeOverlay = drawNodeOverlayUnderlay("overlay"); CRp$5.drawNodeUnderlay = drawNodeOverlayUnderlay("underlay"); CRp$5.hasPie = function(node2) { @@ -186204,90 +119244,91 @@ g.stateGroup line { pos = pos || node2.position(); var cyStyle = node2.cy().style(); var pieSize = node2.pstyle("pie-size"); - var x2 = pos.x; - var y2 = pos.y; + var x5 = pos.x; + var y5 = pos.y; var nodeW = node2.width(); var nodeH = node2.height(); - var radius = Math.min(nodeW, nodeH) / 2; + var radius2 = Math.min(nodeW, nodeH) / 2; var lastPercent = 0; var usePaths = this.usePaths(); if (usePaths) { - x2 = 0; - y2 = 0; + x5 = 0; + y5 = 0; } if (pieSize.units === "%") { - radius = radius * pieSize.pfValue; + radius2 = radius2 * pieSize.pfValue; } else if (pieSize.pfValue !== void 0) { - radius = pieSize.pfValue / 2; + radius2 = pieSize.pfValue / 2; } - for (var i3 = 1; i3 <= cyStyle.pieBackgroundN; i3++) { - var size2 = node2.pstyle("pie-" + i3 + "-background-size").value; - var color2 = node2.pstyle("pie-" + i3 + "-background-color").value; - var opacity = node2.pstyle("pie-" + i3 + "-background-opacity").value * nodeOpacity; - var percent = size2 / 100; + for (var i2 = 1; i2 <= cyStyle.pieBackgroundN; i2++) { + var size5 = node2.pstyle("pie-" + i2 + "-background-size").value; + var color2 = node2.pstyle("pie-" + i2 + "-background-color").value; + var opacity = node2.pstyle("pie-" + i2 + "-background-opacity").value * nodeOpacity; + var percent = size5 / 100; if (percent + lastPercent > 1) { percent = 1 - lastPercent; } var angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; var angleDelta = 2 * Math.PI * percent; var angleEnd = angleStart + angleDelta; - if (size2 === 0 || lastPercent >= 1 || lastPercent + percent > 1) { + if (size5 === 0 || lastPercent >= 1 || lastPercent + percent > 1) { continue; } context.beginPath(); - context.moveTo(x2, y2); - context.arc(x2, y2, radius, angleStart, angleEnd); + context.moveTo(x5, y5); + context.arc(x5, y5, radius2, angleStart, angleEnd); context.closePath(); this.colorFillStyle(context, color2[0], color2[1], color2[2], opacity); context.fill(); lastPercent += percent; } }; - var CRp$4 = {}; - var motionBlurDelay = 100; + CRp$4 = {}; + motionBlurDelay = 100; CRp$4.getPixelRatio = function() { var context = this.data.contexts[0]; if (this.forcedPixelRatio != null) { return this.forcedPixelRatio; } + var containerWindow = this.cy.window(); var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; - return (window.devicePixelRatio || 1) / backingStore; + return (containerWindow.devicePixelRatio || 1) / backingStore; }; CRp$4.paintCache = function(context) { var caches = this.paintCaches = this.paintCaches || []; var needToCreateCache = true; - var cache2; - for (var i3 = 0; i3 < caches.length; i3++) { - cache2 = caches[i3]; - if (cache2.context === context) { + var cache3; + for (var i2 = 0; i2 < caches.length; i2++) { + cache3 = caches[i2]; + if (cache3.context === context) { needToCreateCache = false; break; } } if (needToCreateCache) { - cache2 = { + cache3 = { context }; - caches.push(cache2); + caches.push(cache3); } - return cache2; + return cache3; }; CRp$4.createGradientStyleFor = function(context, shapeStyleName, ele, fill, opacity) { var gradientStyle; var usePaths = this.usePaths(); - var colors3 = ele.pstyle(shapeStyleName + "-gradient-stop-colors").value, positions = ele.pstyle(shapeStyleName + "-gradient-stop-positions").pfValue; + var colors2 = ele.pstyle(shapeStyleName + "-gradient-stop-colors").value, positions2 = ele.pstyle(shapeStyleName + "-gradient-stop-positions").pfValue; if (fill === "radial-gradient") { if (ele.isEdge()) { - var start2 = ele.sourceEndpoint(), end2 = ele.targetEndpoint(), mid = ele.midpoint(); - var d1 = dist2(start2, mid); - var d2 = dist2(end2, mid); + var start3 = ele.sourceEndpoint(), end2 = ele.targetEndpoint(), mid = ele.midpoint(); + var d1 = dist(start3, mid); + var d2 = dist(end2, mid); gradientStyle = context.createRadialGradient(mid.x, mid.y, 0, mid.x, mid.y, Math.max(d1, d2)); } else { var pos = usePaths ? { x: 0, y: 0 - } : ele.position(), width2 = ele.paddedWidth(), height = ele.paddedHeight(); - gradientStyle = context.createRadialGradient(pos.x, pos.y, 0, pos.x, pos.y, Math.max(width2, height)); + } : ele.position(), width3 = ele.paddedWidth(), height2 = ele.paddedHeight(); + gradientStyle = context.createRadialGradient(pos.x, pos.y, 0, pos.x, pos.y, Math.max(width3, height2)); } } else { if (ele.isEdge()) { @@ -186298,8 +119339,8 @@ g.stateGroup line { x: 0, y: 0 } : ele.position(), _width = ele.paddedWidth(), _height = ele.paddedHeight(), halfWidth = _width / 2, halfHeight = _height / 2; - var direction2 = ele.pstyle("background-gradient-direction").value; - switch (direction2) { + var direction4 = ele.pstyle("background-gradient-direction").value; + switch (direction4) { case "to-bottom": gradientStyle = context.createLinearGradient(_pos.x, _pos.y - halfHeight, _pos.x, _pos.y + halfHeight); break; @@ -186331,23 +119372,21 @@ g.stateGroup line { } } } - if (!gradientStyle) - return null; - var hasPositions = positions.length === colors3.length; - var length2 = colors3.length; - for (var i3 = 0; i3 < length2; i3++) { - gradientStyle.addColorStop(hasPositions ? positions[i3] : i3 / (length2 - 1), "rgba(" + colors3[i3][0] + "," + colors3[i3][1] + "," + colors3[i3][2] + "," + opacity + ")"); + if (!gradientStyle) return null; + var hasPositions = positions2.length === colors2.length; + var length2 = colors2.length; + for (var i2 = 0; i2 < length2; i2++) { + gradientStyle.addColorStop(hasPositions ? positions2[i2] : i2 / (length2 - 1), "rgba(" + colors2[i2][0] + "," + colors2[i2][1] + "," + colors2[i2][2] + "," + opacity + ")"); } return gradientStyle; }; CRp$4.gradientFillStyle = function(context, ele, fill, opacity) { var gradientStyle = this.createGradientStyleFor(context, "background", ele, fill, opacity); - if (!gradientStyle) - return null; + if (!gradientStyle) return null; context.fillStyle = gradientStyle; }; - CRp$4.colorFillStyle = function(context, r, g, b, a) { - context.fillStyle = "rgba(" + r + "," + g + "," + b + "," + a + ")"; + CRp$4.colorFillStyle = function(context, r2, g2, b2, a2) { + context.fillStyle = "rgba(" + r2 + "," + g2 + "," + b2 + "," + a2 + ")"; }; CRp$4.eleFillStyle = function(context, ele, opacity) { var backgroundFill = ele.pstyle("background-fill").value; @@ -186360,12 +119399,11 @@ g.stateGroup line { }; CRp$4.gradientStrokeStyle = function(context, ele, fill, opacity) { var gradientStyle = this.createGradientStyleFor(context, "line", ele, fill, opacity); - if (!gradientStyle) - return null; + if (!gradientStyle) return null; context.strokeStyle = gradientStyle; }; - CRp$4.colorStrokeStyle = function(context, r, g, b, a) { - context.strokeStyle = "rgba(" + r + "," + g + "," + b + "," + a + ")"; + CRp$4.colorStrokeStyle = function(context, r2, g2, b2, a2) { + context.strokeStyle = "rgba(" + r2 + "," + g2 + "," + b2 + "," + a2 + ")"; }; CRp$4.eleStrokeStyle = function(context, ele, opacity) { var lineFill = ele.pstyle("line-fill").value; @@ -186376,130 +119414,130 @@ g.stateGroup line { this.colorStrokeStyle(context, lineColor[0], lineColor[1], lineColor[2], opacity); } }; - CRp$4.matchCanvasSize = function(container) { - var r = this; - var data2 = r.data; - var bb = r.findContainerClientCoords(); - var width2 = bb[2]; - var height = bb[3]; - var pixelRatio = r.getPixelRatio(); - var mbPxRatio = r.motionBlurPxRatio; - if (container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE] || container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]) { + CRp$4.matchCanvasSize = function(container2) { + var r2 = this; + var data5 = r2.data; + var bb = r2.findContainerClientCoords(); + var width3 = bb[2]; + var height2 = bb[3]; + var pixelRatio = r2.getPixelRatio(); + var mbPxRatio = r2.motionBlurPxRatio; + if (container2 === r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_NODE] || container2 === r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_DRAG]) { pixelRatio = mbPxRatio; } - var canvasWidth = width2 * pixelRatio; - var canvasHeight = height * pixelRatio; + var canvasWidth = width3 * pixelRatio; + var canvasHeight = height2 * pixelRatio; var canvas; - if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) { + if (canvasWidth === r2.canvasWidth && canvasHeight === r2.canvasHeight) { return; } - r.fontCaches = null; - var canvasContainer = data2.canvasContainer; - canvasContainer.style.width = width2 + "px"; - canvasContainer.style.height = height + "px"; - for (var i3 = 0; i3 < r.CANVAS_LAYERS; i3++) { - canvas = data2.canvases[i3]; + r2.fontCaches = null; + var canvasContainer = data5.canvasContainer; + canvasContainer.style.width = width3 + "px"; + canvasContainer.style.height = height2 + "px"; + for (var i2 = 0; i2 < r2.CANVAS_LAYERS; i2++) { + canvas = data5.canvases[i2]; canvas.width = canvasWidth; canvas.height = canvasHeight; - canvas.style.width = width2 + "px"; - canvas.style.height = height + "px"; + canvas.style.width = width3 + "px"; + canvas.style.height = height2 + "px"; } - for (var i3 = 0; i3 < r.BUFFER_COUNT; i3++) { - canvas = data2.bufferCanvases[i3]; + for (var i2 = 0; i2 < r2.BUFFER_COUNT; i2++) { + canvas = data5.bufferCanvases[i2]; canvas.width = canvasWidth; canvas.height = canvasHeight; - canvas.style.width = width2 + "px"; - canvas.style.height = height + "px"; + canvas.style.width = width3 + "px"; + canvas.style.height = height2 + "px"; } - r.textureMult = 1; + r2.textureMult = 1; if (pixelRatio <= 1) { - canvas = data2.bufferCanvases[r.TEXTURE_BUFFER]; - r.textureMult = 2; - canvas.width = canvasWidth * r.textureMult; - canvas.height = canvasHeight * r.textureMult; + canvas = data5.bufferCanvases[r2.TEXTURE_BUFFER]; + r2.textureMult = 2; + canvas.width = canvasWidth * r2.textureMult; + canvas.height = canvasHeight * r2.textureMult; } - r.canvasWidth = canvasWidth; - r.canvasHeight = canvasHeight; + r2.canvasWidth = canvasWidth; + r2.canvasHeight = canvasHeight; }; - CRp$4.renderTo = function(cxt, zoom, pan, pxRatio) { + CRp$4.renderTo = function(cxt, zoom2, pan2, pxRatio) { this.render({ forcedContext: cxt, - forcedZoom: zoom, - forcedPan: pan, + forcedZoom: zoom2, + forcedPan: pan2, drawAllLayers: true, forcedPxRatio: pxRatio }); }; - CRp$4.render = function(options2) { - options2 = options2 || staticEmptyObject(); - var forcedContext = options2.forcedContext; - var drawAllLayers = options2.drawAllLayers; - var drawOnlyNodeLayer = options2.drawOnlyNodeLayer; - var forcedZoom = options2.forcedZoom; - var forcedPan = options2.forcedPan; - var r = this; - var pixelRatio = options2.forcedPxRatio === void 0 ? this.getPixelRatio() : options2.forcedPxRatio; - var cy = r.cy; - var data2 = r.data; - var needDraw = data2.canvasNeedsRedraw; - var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming); - var motionBlur = options2.motionBlur !== void 0 ? options2.motionBlur : r.motionBlur; - var mbPxRatio = r.motionBlurPxRatio; - var hasCompoundNodes = cy.hasCompoundNodes(); - var inNodeDragGesture = r.hoverData.draggingEles; - var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false; - motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection; + CRp$4.render = function(options3) { + options3 = options3 || staticEmptyObject(); + var forcedContext = options3.forcedContext; + var drawAllLayers = options3.drawAllLayers; + var drawOnlyNodeLayer = options3.drawOnlyNodeLayer; + var forcedZoom = options3.forcedZoom; + var forcedPan = options3.forcedPan; + var r2 = this; + var pixelRatio = options3.forcedPxRatio === void 0 ? this.getPixelRatio() : options3.forcedPxRatio; + var cy = r2.cy; + var data5 = r2.data; + var needDraw = data5.canvasNeedsRedraw; + var textureDraw = r2.textureOnViewport && !forcedContext && (r2.pinching || r2.hoverData.dragging || r2.swipePanning || r2.data.wheelZooming); + var motionBlur = options3.motionBlur !== void 0 ? options3.motionBlur : r2.motionBlur; + var mbPxRatio = r2.motionBlurPxRatio; + var hasCompoundNodes2 = cy.hasCompoundNodes(); + var inNodeDragGesture = r2.hoverData.draggingEles; + var inBoxSelection = r2.hoverData.selecting || r2.touchData.selecting ? true : false; + motionBlur = motionBlur && !forcedContext && r2.motionBlurEnabled && !inBoxSelection; var motionBlurFadeEffect = motionBlur; if (!forcedContext) { - if (r.prevPxRatio !== pixelRatio) { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); - r.redrawHint("eles", true); - r.redrawHint("drag", true); + if (r2.prevPxRatio !== pixelRatio) { + r2.invalidateContainerClientCoordsCache(); + r2.matchCanvasSize(r2.container); + r2.redrawHint("eles", true); + r2.redrawHint("drag", true); } - r.prevPxRatio = pixelRatio; + r2.prevPxRatio = pixelRatio; } - if (!forcedContext && r.motionBlurTimeout) { - clearTimeout(r.motionBlurTimeout); + if (!forcedContext && r2.motionBlurTimeout) { + clearTimeout(r2.motionBlurTimeout); } if (motionBlur) { - if (r.mbFrames == null) { - r.mbFrames = 0; + if (r2.mbFrames == null) { + r2.mbFrames = 0; } - r.mbFrames++; - if (r.mbFrames < 3) { + r2.mbFrames++; + if (r2.mbFrames < 3) { motionBlurFadeEffect = false; } - if (r.mbFrames > r.minMbLowQualFrames) { - r.motionBlurPxRatio = r.mbPxRBlurry; + if (r2.mbFrames > r2.minMbLowQualFrames) { + r2.motionBlurPxRatio = r2.mbPxRBlurry; } } - if (r.clearingMotionBlur) { - r.motionBlurPxRatio = 1; + if (r2.clearingMotionBlur) { + r2.motionBlurPxRatio = 1; } - if (r.textureDrawLastFrame && !textureDraw) { - needDraw[r.NODE] = true; - needDraw[r.SELECT_BOX] = true; + if (r2.textureDrawLastFrame && !textureDraw) { + needDraw[r2.NODE] = true; + needDraw[r2.SELECT_BOX] = true; } - var style = cy.style(); - var zoom = cy.zoom(); - var effectiveZoom = forcedZoom !== void 0 ? forcedZoom : zoom; - var pan = cy.pan(); + var style3 = cy.style(); + var zoom2 = cy.zoom(); + var effectiveZoom = forcedZoom !== void 0 ? forcedZoom : zoom2; + var pan2 = cy.pan(); var effectivePan = { - x: pan.x, - y: pan.y + x: pan2.x, + y: pan2.y }; var vp = { - zoom, + zoom: zoom2, pan: { - x: pan.x, - y: pan.y + x: pan2.x, + y: pan2.y } }; - var prevVp = r.prevViewport; + var prevVp = r2.prevViewport; var viewportIsDiff = prevVp === void 0 || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; - if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes)) { - r.motionBlurPxRatio = 1; + if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes2)) { + r2.motionBlurPxRatio = 1; } if (forcedPan) { effectivePan = forcedPan; @@ -186507,35 +119545,36 @@ g.stateGroup line { effectiveZoom *= pixelRatio; effectivePan.x *= pixelRatio; effectivePan.y *= pixelRatio; - var eles = r.getCachedZSortedEles(); - function mbclear(context2, x2, y2, w2, h) { + var eles = r2.getCachedZSortedEles(); + function mbclear(context2, x5, y5, w3, h2) { var gco = context2.globalCompositeOperation; context2.globalCompositeOperation = "destination-out"; - r.colorFillStyle(context2, 255, 255, 255, r.motionBlurTransparency); - context2.fillRect(x2, y2, w2, h); + r2.colorFillStyle(context2, 255, 255, 255, r2.motionBlurTransparency); + context2.fillRect(x5, y5, w3, h2); context2.globalCompositeOperation = gco; } - function setContextTransform(context2, clear3) { - var ePan, eZoom, w2, h; - if (!r.clearingMotionBlur && (context2 === data2.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context2 === data2.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) { + __name(mbclear, "mbclear"); + function setContextTransform(context2, clear30) { + var ePan, eZoom, w3, h2; + if (!r2.clearingMotionBlur && (context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] || context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG])) { ePan = { - x: pan.x * mbPxRatio, - y: pan.y * mbPxRatio + x: pan2.x * mbPxRatio, + y: pan2.y * mbPxRatio }; - eZoom = zoom * mbPxRatio; - w2 = r.canvasWidth * mbPxRatio; - h = r.canvasHeight * mbPxRatio; + eZoom = zoom2 * mbPxRatio; + w3 = r2.canvasWidth * mbPxRatio; + h2 = r2.canvasHeight * mbPxRatio; } else { ePan = effectivePan; eZoom = effectiveZoom; - w2 = r.canvasWidth; - h = r.canvasHeight; + w3 = r2.canvasWidth; + h2 = r2.canvasHeight; } context2.setTransform(1, 0, 0, 1, 0, 0); - if (clear3 === "motionBlur") { - mbclear(context2, 0, 0, w2, h); - } else if (!forcedContext && (clear3 === void 0 || clear3)) { - context2.clearRect(0, 0, w2, h); + if (clear30 === "motionBlur") { + mbclear(context2, 0, 0, w3, h2); + } else if (!forcedContext && (clear30 === void 0 || clear30)) { + context2.clearRect(0, 0, w3, h2); } if (!drawAllLayers) { context2.translate(ePan.x, ePan.y); @@ -186548,125 +119587,126 @@ g.stateGroup line { context2.scale(forcedZoom, forcedZoom); } } + __name(setContextTransform, "setContextTransform"); if (!textureDraw) { - r.textureDrawLastFrame = false; + r2.textureDrawLastFrame = false; } if (textureDraw) { - r.textureDrawLastFrame = true; - if (!r.textureCache) { - r.textureCache = {}; - r.textureCache.bb = cy.mutableElements().boundingBox(); - r.textureCache.texture = r.data.bufferCanvases[r.TEXTURE_BUFFER]; - var cxt = r.data.bufferContexts[r.TEXTURE_BUFFER]; + r2.textureDrawLastFrame = true; + if (!r2.textureCache) { + r2.textureCache = {}; + r2.textureCache.bb = cy.mutableElements().boundingBox(); + r2.textureCache.texture = r2.data.bufferCanvases[r2.TEXTURE_BUFFER]; + var cxt = r2.data.bufferContexts[r2.TEXTURE_BUFFER]; cxt.setTransform(1, 0, 0, 1, 0, 0); - cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult); - r.render({ + cxt.clearRect(0, 0, r2.canvasWidth * r2.textureMult, r2.canvasHeight * r2.textureMult); + r2.render({ forcedContext: cxt, drawOnlyNodeLayer: true, - forcedPxRatio: pixelRatio * r.textureMult + forcedPxRatio: pixelRatio * r2.textureMult }); - var vp = r.textureCache.viewport = { + var vp = r2.textureCache.viewport = { zoom: cy.zoom(), pan: cy.pan(), - width: r.canvasWidth, - height: r.canvasHeight + width: r2.canvasWidth, + height: r2.canvasHeight }; vp.mpan = { x: (0 - vp.pan.x) / vp.zoom, y: (0 - vp.pan.y) / vp.zoom }; } - needDraw[r.DRAG] = false; - needDraw[r.NODE] = false; - var context = data2.contexts[r.NODE]; - var texture = r.textureCache.texture; - var vp = r.textureCache.viewport; + needDraw[r2.DRAG] = false; + needDraw[r2.NODE] = false; + var context = data5.contexts[r2.NODE]; + var texture = r2.textureCache.texture; + var vp = r2.textureCache.viewport; context.setTransform(1, 0, 0, 1, 0, 0); if (motionBlur) { mbclear(context, 0, 0, vp.width, vp.height); } else { context.clearRect(0, 0, vp.width, vp.height); } - var outsideBgColor = style.core("outside-texture-bg-color").value; - var outsideBgOpacity = style.core("outside-texture-bg-opacity").value; - r.colorFillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity); + var outsideBgColor = style3.core("outside-texture-bg-color").value; + var outsideBgOpacity = style3.core("outside-texture-bg-opacity").value; + r2.colorFillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity); context.fillRect(0, 0, vp.width, vp.height); - var zoom = cy.zoom(); + var zoom2 = cy.zoom(); setContextTransform(context, false); context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); - } else if (r.textureOnViewport && !forcedContext) { - r.textureCache = null; + } else if (r2.textureOnViewport && !forcedContext) { + r2.textureCache = null; } - var extent = cy.extent(); - var vpManip = r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles || r.cy.animated(); - var hideEdges = r.hideEdgesOnViewport && vpManip; + var extent2 = cy.extent(); + var vpManip = r2.pinching || r2.hoverData.dragging || r2.swipePanning || r2.data.wheelZooming || r2.hoverData.draggingEles || r2.cy.animated(); + var hideEdges = r2.hideEdgesOnViewport && vpManip; var needMbClear = []; - needMbClear[r.NODE] = !needDraw[r.NODE] && motionBlur && !r.clearedForMotionBlur[r.NODE] || r.clearingMotionBlur; - if (needMbClear[r.NODE]) { - r.clearedForMotionBlur[r.NODE] = true; - } - needMbClear[r.DRAG] = !needDraw[r.DRAG] && motionBlur && !r.clearedForMotionBlur[r.DRAG] || r.clearingMotionBlur; - if (needMbClear[r.DRAG]) { - r.clearedForMotionBlur[r.DRAG] = true; - } - if (needDraw[r.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r.NODE]) { - var useBuffer = motionBlur && !needMbClear[r.NODE] && mbPxRatio !== 1; - var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] : data2.contexts[r.NODE]); - var clear2 = motionBlur && !useBuffer ? "motionBlur" : void 0; - setContextTransform(context, clear2); + needMbClear[r2.NODE] = !needDraw[r2.NODE] && motionBlur && !r2.clearedForMotionBlur[r2.NODE] || r2.clearingMotionBlur; + if (needMbClear[r2.NODE]) { + r2.clearedForMotionBlur[r2.NODE] = true; + } + needMbClear[r2.DRAG] = !needDraw[r2.DRAG] && motionBlur && !r2.clearedForMotionBlur[r2.DRAG] || r2.clearingMotionBlur; + if (needMbClear[r2.DRAG]) { + r2.clearedForMotionBlur[r2.DRAG] = true; + } + if (needDraw[r2.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r2.NODE]) { + var useBuffer = motionBlur && !needMbClear[r2.NODE] && mbPxRatio !== 1; + var context = forcedContext || (useBuffer ? r2.data.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] : data5.contexts[r2.NODE]); + var clear29 = motionBlur && !useBuffer ? "motionBlur" : void 0; + setContextTransform(context, clear29); if (hideEdges) { - r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent); + r2.drawCachedNodes(context, eles.nondrag, pixelRatio, extent2); } else { - r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent); + r2.drawLayeredElements(context, eles.nondrag, pixelRatio, extent2); } - if (r.debug) { - r.drawDebugPoints(context, eles.nondrag); + if (r2.debug) { + r2.drawDebugPoints(context, eles.nondrag); } if (!drawAllLayers && !motionBlur) { - needDraw[r.NODE] = false; + needDraw[r2.NODE] = false; } } - if (!drawOnlyNodeLayer && (needDraw[r.DRAG] || drawAllLayers || needMbClear[r.DRAG])) { - var useBuffer = motionBlur && !needMbClear[r.DRAG] && mbPxRatio !== 1; - var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG] : data2.contexts[r.DRAG]); + if (!drawOnlyNodeLayer && (needDraw[r2.DRAG] || drawAllLayers || needMbClear[r2.DRAG])) { + var useBuffer = motionBlur && !needMbClear[r2.DRAG] && mbPxRatio !== 1; + var context = forcedContext || (useBuffer ? r2.data.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG] : data5.contexts[r2.DRAG]); setContextTransform(context, motionBlur && !useBuffer ? "motionBlur" : void 0); if (hideEdges) { - r.drawCachedNodes(context, eles.drag, pixelRatio, extent); + r2.drawCachedNodes(context, eles.drag, pixelRatio, extent2); } else { - r.drawCachedElements(context, eles.drag, pixelRatio, extent); + r2.drawCachedElements(context, eles.drag, pixelRatio, extent2); } - if (r.debug) { - r.drawDebugPoints(context, eles.drag); + if (r2.debug) { + r2.drawDebugPoints(context, eles.drag); } if (!drawAllLayers && !motionBlur) { - needDraw[r.DRAG] = false; + needDraw[r2.DRAG] = false; } } - if (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) { - var context = forcedContext || data2.contexts[r.SELECT_BOX]; + if (r2.showFps || !drawOnlyNodeLayer && needDraw[r2.SELECT_BOX] && !drawAllLayers) { + var context = forcedContext || data5.contexts[r2.SELECT_BOX]; setContextTransform(context); - if (r.selection[4] == 1 && (r.hoverData.selecting || r.touchData.selecting)) { - var zoom = r.cy.zoom(); - var borderWidth = style.core("selection-box-border-width").value / zoom; + if (r2.selection[4] == 1 && (r2.hoverData.selecting || r2.touchData.selecting)) { + var zoom2 = r2.cy.zoom(); + var borderWidth = style3.core("selection-box-border-width").value / zoom2; context.lineWidth = borderWidth; - context.fillStyle = "rgba(" + style.core("selection-box-color").value[0] + "," + style.core("selection-box-color").value[1] + "," + style.core("selection-box-color").value[2] + "," + style.core("selection-box-opacity").value + ")"; - context.fillRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); + context.fillStyle = "rgba(" + style3.core("selection-box-color").value[0] + "," + style3.core("selection-box-color").value[1] + "," + style3.core("selection-box-color").value[2] + "," + style3.core("selection-box-opacity").value + ")"; + context.fillRect(r2.selection[0], r2.selection[1], r2.selection[2] - r2.selection[0], r2.selection[3] - r2.selection[1]); if (borderWidth > 0) { - context.strokeStyle = "rgba(" + style.core("selection-box-border-color").value[0] + "," + style.core("selection-box-border-color").value[1] + "," + style.core("selection-box-border-color").value[2] + "," + style.core("selection-box-opacity").value + ")"; - context.strokeRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); + context.strokeStyle = "rgba(" + style3.core("selection-box-border-color").value[0] + "," + style3.core("selection-box-border-color").value[1] + "," + style3.core("selection-box-border-color").value[2] + "," + style3.core("selection-box-opacity").value + ")"; + context.strokeRect(r2.selection[0], r2.selection[1], r2.selection[2] - r2.selection[0], r2.selection[3] - r2.selection[1]); } } - if (data2.bgActivePosistion && !r.hoverData.selecting) { - var zoom = r.cy.zoom(); - var pos = data2.bgActivePosistion; - context.fillStyle = "rgba(" + style.core("active-bg-color").value[0] + "," + style.core("active-bg-color").value[1] + "," + style.core("active-bg-color").value[2] + "," + style.core("active-bg-opacity").value + ")"; + if (data5.bgActivePosistion && !r2.hoverData.selecting) { + var zoom2 = r2.cy.zoom(); + var pos = data5.bgActivePosistion; + context.fillStyle = "rgba(" + style3.core("active-bg-color").value[0] + "," + style3.core("active-bg-color").value[1] + "," + style3.core("active-bg-color").value[2] + "," + style3.core("active-bg-opacity").value + ")"; context.beginPath(); - context.arc(pos.x, pos.y, style.core("active-bg-size").pfValue / zoom, 0, 2 * Math.PI); + context.arc(pos.x, pos.y, style3.core("active-bg-size").pfValue / zoom2, 0, 2 * Math.PI); context.fill(); } - var timeToRender = r.lastRedrawTime; - if (r.showFps && timeToRender) { + var timeToRender = r2.lastRedrawTime; + if (r2.showFps && timeToRender) { timeToRender = Math.round(timeToRender); var fps = Math.round(1e3 / timeToRender); context.setTransform(1, 0, 0, 1, 0, 0); @@ -186679,20 +119719,20 @@ g.stateGroup line { context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20); } if (!drawAllLayers) { - needDraw[r.SELECT_BOX] = false; + needDraw[r2.SELECT_BOX] = false; } } if (motionBlur && mbPxRatio !== 1) { - var cxtNode = data2.contexts[r.NODE]; - var txtNode = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE]; - var cxtDrag = data2.contexts[r.DRAG]; - var txtDrag = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]; - var drawMotionBlur = function drawMotionBlur2(cxt2, txt, needClear) { + var cxtNode = data5.contexts[r2.NODE]; + var txtNode = r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_NODE]; + var cxtDrag = data5.contexts[r2.DRAG]; + var txtDrag = r2.data.bufferCanvases[r2.MOTIONBLUR_BUFFER_DRAG]; + var drawMotionBlur = /* @__PURE__ */ __name(function drawMotionBlur2(cxt2, txt, needClear) { cxt2.setTransform(1, 0, 0, 1, 0, 0); if (needClear || !motionBlurFadeEffect) { - cxt2.clearRect(0, 0, r.canvasWidth, r.canvasHeight); + cxt2.clearRect(0, 0, r2.canvasWidth, r2.canvasHeight); } else { - mbclear(cxt2, 0, 0, r.canvasWidth, r.canvasHeight); + mbclear(cxt2, 0, 0, r2.canvasWidth, r2.canvasHeight); } var pxr = mbPxRatio; cxt2.drawImage( @@ -186701,150 +119741,124 @@ g.stateGroup line { 0, 0, // sx, sy - r.canvasWidth * pxr, - r.canvasHeight * pxr, + r2.canvasWidth * pxr, + r2.canvasHeight * pxr, // sw, sh 0, 0, // x, y - r.canvasWidth, - r.canvasHeight + r2.canvasWidth, + r2.canvasHeight // w, h ); - }; - if (needDraw[r.NODE] || needMbClear[r.NODE]) { - drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]); - needDraw[r.NODE] = false; + }, "drawMotionBlur"); + if (needDraw[r2.NODE] || needMbClear[r2.NODE]) { + drawMotionBlur(cxtNode, txtNode, needMbClear[r2.NODE]); + needDraw[r2.NODE] = false; } - if (needDraw[r.DRAG] || needMbClear[r.DRAG]) { - drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]); - needDraw[r.DRAG] = false; + if (needDraw[r2.DRAG] || needMbClear[r2.DRAG]) { + drawMotionBlur(cxtDrag, txtDrag, needMbClear[r2.DRAG]); + needDraw[r2.DRAG] = false; } } - r.prevViewport = vp; - if (r.clearingMotionBlur) { - r.clearingMotionBlur = false; - r.motionBlurCleared = true; - r.motionBlur = true; + r2.prevViewport = vp; + if (r2.clearingMotionBlur) { + r2.clearingMotionBlur = false; + r2.motionBlurCleared = true; + r2.motionBlur = true; } if (motionBlur) { - r.motionBlurTimeout = setTimeout(function() { - r.motionBlurTimeout = null; - r.clearedForMotionBlur[r.NODE] = false; - r.clearedForMotionBlur[r.DRAG] = false; - r.motionBlur = false; - r.clearingMotionBlur = !textureDraw; - r.mbFrames = 0; - needDraw[r.NODE] = true; - needDraw[r.DRAG] = true; - r.redraw(); + r2.motionBlurTimeout = setTimeout(function() { + r2.motionBlurTimeout = null; + r2.clearedForMotionBlur[r2.NODE] = false; + r2.clearedForMotionBlur[r2.DRAG] = false; + r2.motionBlur = false; + r2.clearingMotionBlur = !textureDraw; + r2.mbFrames = 0; + needDraw[r2.NODE] = true; + needDraw[r2.DRAG] = true; + r2.redraw(); }, motionBlurDelay); } if (!forcedContext) { cy.emit("render"); } }; - var CRp$3 = {}; - CRp$3.drawPolygonPath = function(context, x2, y2, width2, height, points) { - var halfW = width2 / 2; - var halfH = height / 2; + CRp$3 = {}; + CRp$3.drawPolygonPath = function(context, x5, y5, width3, height2, points) { + var halfW = width3 / 2; + var halfH = height2 / 2; if (context.beginPath) { context.beginPath(); } - context.moveTo(x2 + halfW * points[0], y2 + halfH * points[1]); - for (var i3 = 1; i3 < points.length / 2; i3++) { - context.lineTo(x2 + halfW * points[i3 * 2], y2 + halfH * points[i3 * 2 + 1]); + context.moveTo(x5 + halfW * points[0], y5 + halfH * points[1]); + for (var i2 = 1; i2 < points.length / 2; i2++) { + context.lineTo(x5 + halfW * points[i2 * 2], y5 + halfH * points[i2 * 2 + 1]); } context.closePath(); }; - CRp$3.drawRoundPolygonPath = function(context, x2, y2, width2, height, points) { - var halfW = width2 / 2; - var halfH = height / 2; - var cornerRadius = getRoundPolygonRadius(width2, height); - if (context.beginPath) { - context.beginPath(); - } - for (var _i6 = 0; _i6 < points.length / 4; _i6++) { - var sourceUv = void 0, destUv = void 0; - if (_i6 === 0) { - sourceUv = points.length - 2; - } else { - sourceUv = _i6 * 4 - 2; - } - destUv = _i6 * 4 + 2; - var px = x2 + halfW * points[_i6 * 4]; - var py = y2 + halfH * points[_i6 * 4 + 1]; - var cosTheta = -points[sourceUv] * points[destUv] - points[sourceUv + 1] * points[destUv + 1]; - var offset = cornerRadius / Math.tan(Math.acos(cosTheta) / 2); - var cp0x = px - offset * points[sourceUv]; - var cp0y = py - offset * points[sourceUv + 1]; - var cp1x = px + offset * points[destUv]; - var cp1y = py + offset * points[destUv + 1]; - if (_i6 === 0) { - context.moveTo(cp0x, cp0y); - } else { - context.lineTo(cp0x, cp0y); - } - context.arcTo(px, py, cp1x, cp1y, cornerRadius); - } + CRp$3.drawRoundPolygonPath = function(context, x5, y5, width3, height2, points, corners) { + corners.forEach(function(corner) { + return drawPreparedRoundCorner(context, corner); + }); context.closePath(); }; - CRp$3.drawRoundRectanglePath = function(context, x2, y2, width2, height) { - var halfWidth = width2 / 2; - var halfHeight = height / 2; - var cornerRadius = getRoundRectangleRadius(width2, height); + CRp$3.drawRoundRectanglePath = function(context, x5, y5, width3, height2, radius2) { + var halfWidth = width3 / 2; + var halfHeight = height2 / 2; + var cornerRadius = radius2 === "auto" ? getRoundRectangleRadius(width3, height2) : Math.min(radius2, halfHeight, halfWidth); if (context.beginPath) { context.beginPath(); } - context.moveTo(x2, y2 - halfHeight); - context.arcTo(x2 + halfWidth, y2 - halfHeight, x2 + halfWidth, y2, cornerRadius); - context.arcTo(x2 + halfWidth, y2 + halfHeight, x2, y2 + halfHeight, cornerRadius); - context.arcTo(x2 - halfWidth, y2 + halfHeight, x2 - halfWidth, y2, cornerRadius); - context.arcTo(x2 - halfWidth, y2 - halfHeight, x2, y2 - halfHeight, cornerRadius); - context.lineTo(x2, y2 - halfHeight); + context.moveTo(x5, y5 - halfHeight); + context.arcTo(x5 + halfWidth, y5 - halfHeight, x5 + halfWidth, y5, cornerRadius); + context.arcTo(x5 + halfWidth, y5 + halfHeight, x5, y5 + halfHeight, cornerRadius); + context.arcTo(x5 - halfWidth, y5 + halfHeight, x5 - halfWidth, y5, cornerRadius); + context.arcTo(x5 - halfWidth, y5 - halfHeight, x5, y5 - halfHeight, cornerRadius); + context.lineTo(x5, y5 - halfHeight); context.closePath(); }; - CRp$3.drawBottomRoundRectanglePath = function(context, x2, y2, width2, height) { - var halfWidth = width2 / 2; - var halfHeight = height / 2; - var cornerRadius = getRoundRectangleRadius(width2, height); + CRp$3.drawBottomRoundRectanglePath = function(context, x5, y5, width3, height2, radius2) { + var halfWidth = width3 / 2; + var halfHeight = height2 / 2; + var cornerRadius = radius2 === "auto" ? getRoundRectangleRadius(width3, height2) : radius2; if (context.beginPath) { context.beginPath(); } - context.moveTo(x2, y2 - halfHeight); - context.lineTo(x2 + halfWidth, y2 - halfHeight); - context.lineTo(x2 + halfWidth, y2); - context.arcTo(x2 + halfWidth, y2 + halfHeight, x2, y2 + halfHeight, cornerRadius); - context.arcTo(x2 - halfWidth, y2 + halfHeight, x2 - halfWidth, y2, cornerRadius); - context.lineTo(x2 - halfWidth, y2 - halfHeight); - context.lineTo(x2, y2 - halfHeight); + context.moveTo(x5, y5 - halfHeight); + context.lineTo(x5 + halfWidth, y5 - halfHeight); + context.lineTo(x5 + halfWidth, y5); + context.arcTo(x5 + halfWidth, y5 + halfHeight, x5, y5 + halfHeight, cornerRadius); + context.arcTo(x5 - halfWidth, y5 + halfHeight, x5 - halfWidth, y5, cornerRadius); + context.lineTo(x5 - halfWidth, y5 - halfHeight); + context.lineTo(x5, y5 - halfHeight); context.closePath(); }; - CRp$3.drawCutRectanglePath = function(context, x2, y2, width2, height) { - var halfWidth = width2 / 2; - var halfHeight = height / 2; - var cornerLength = getCutRectangleCornerLength(); + CRp$3.drawCutRectanglePath = function(context, x5, y5, width3, height2, points, corners) { + var halfWidth = width3 / 2; + var halfHeight = height2 / 2; + var cornerLength = corners === "auto" ? getCutRectangleCornerLength() : corners; if (context.beginPath) { context.beginPath(); } - context.moveTo(x2 - halfWidth + cornerLength, y2 - halfHeight); - context.lineTo(x2 + halfWidth - cornerLength, y2 - halfHeight); - context.lineTo(x2 + halfWidth, y2 - halfHeight + cornerLength); - context.lineTo(x2 + halfWidth, y2 + halfHeight - cornerLength); - context.lineTo(x2 + halfWidth - cornerLength, y2 + halfHeight); - context.lineTo(x2 - halfWidth + cornerLength, y2 + halfHeight); - context.lineTo(x2 - halfWidth, y2 + halfHeight - cornerLength); - context.lineTo(x2 - halfWidth, y2 - halfHeight + cornerLength); + context.moveTo(x5 - halfWidth + cornerLength, y5 - halfHeight); + context.lineTo(x5 + halfWidth - cornerLength, y5 - halfHeight); + context.lineTo(x5 + halfWidth, y5 - halfHeight + cornerLength); + context.lineTo(x5 + halfWidth, y5 + halfHeight - cornerLength); + context.lineTo(x5 + halfWidth - cornerLength, y5 + halfHeight); + context.lineTo(x5 - halfWidth + cornerLength, y5 + halfHeight); + context.lineTo(x5 - halfWidth, y5 + halfHeight - cornerLength); + context.lineTo(x5 - halfWidth, y5 - halfHeight + cornerLength); context.closePath(); }; - CRp$3.drawBarrelPath = function(context, x2, y2, width2, height) { - var halfWidth = width2 / 2; - var halfHeight = height / 2; - var xBegin = x2 - halfWidth; - var xEnd = x2 + halfWidth; - var yBegin = y2 - halfHeight; - var yEnd = y2 + halfHeight; - var barrelCurveConstants = getBarrelCurveConstants(width2, height); + CRp$3.drawBarrelPath = function(context, x5, y5, width3, height2) { + var halfWidth = width3 / 2; + var halfHeight = height2 / 2; + var xBegin = x5 - halfWidth; + var xEnd = x5 + halfWidth; + var yBegin = y5 - halfHeight; + var yEnd = y5 + halfHeight; + var barrelCurveConstants = getBarrelCurveConstants(width3, height2); var wOffset = barrelCurveConstants.widthOffset; var hOffset = barrelCurveConstants.heightOffset; var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; @@ -186862,29 +119876,29 @@ g.stateGroup line { context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset); context.closePath(); }; - var sin0 = Math.sin(0); - var cos0 = Math.cos(0); - var sin2 = {}; - var cos2 = {}; - var ellipseStepSize = Math.PI / 40; - for (var i2 = 0 * Math.PI; i2 < 2 * Math.PI; i2 += ellipseStepSize) { + sin0 = Math.sin(0); + cos0 = Math.cos(0); + sin2 = {}; + cos2 = {}; + ellipseStepSize = Math.PI / 40; + for (i2 = 0 * Math.PI; i2 < 2 * Math.PI; i2 += ellipseStepSize) { sin2[i2] = Math.sin(i2); cos2[i2] = Math.cos(i2); } - CRp$3.drawEllipsePath = function(context, centerX, centerY, width2, height) { + CRp$3.drawEllipsePath = function(context, centerX, centerY, width3, height2) { if (context.beginPath) { context.beginPath(); } if (context.ellipse) { - context.ellipse(centerX, centerY, width2 / 2, height / 2, 0, 0, 2 * Math.PI); + context.ellipse(centerX, centerY, width3 / 2, height2 / 2, 0, 0, 2 * Math.PI); } else { var xPos, yPos; - var rw = width2 / 2; - var rh = height / 2; - for (var i3 = 0 * Math.PI; i3 < 2 * Math.PI; i3 += ellipseStepSize) { - xPos = centerX - rw * sin2[i3] * sin0 + rw * cos2[i3] * cos0; - yPos = centerY + rh * cos2[i3] * sin0 + rh * sin2[i3] * cos0; - if (i3 === 0) { + var rw = width3 / 2; + var rh = height2 / 2; + for (var i2 = 0 * Math.PI; i2 < 2 * Math.PI; i2 += ellipseStepSize) { + xPos = centerX - rw * sin2[i2] * sin0 + rw * cos2[i2] * cos0; + yPos = centerY + rh * cos2[i2] * sin0 + rh * sin2[i2] * cos0; + if (i2 === 0) { context.moveTo(xPos, yPos); } else { context.lineTo(xPos, yPos); @@ -186893,66 +119907,66 @@ g.stateGroup line { } context.closePath(); }; - var CRp$2 = {}; - CRp$2.createBuffer = function(w2, h) { + CRp$2 = {}; + CRp$2.createBuffer = function(w3, h2) { var buffer = document.createElement("canvas"); - buffer.width = w2; - buffer.height = h; + buffer.width = w3; + buffer.height = h2; return [buffer, buffer.getContext("2d")]; }; - CRp$2.bufferCanvasImage = function(options2) { + CRp$2.bufferCanvasImage = function(options3) { var cy = this.cy; var eles = cy.mutableElements(); var bb = eles.boundingBox(); var ctrRect = this.findContainerClientCoords(); - var width2 = options2.full ? Math.ceil(bb.w) : ctrRect[2]; - var height = options2.full ? Math.ceil(bb.h) : ctrRect[3]; - var specdMaxDims = number$12(options2.maxWidth) || number$12(options2.maxHeight); + var width3 = options3.full ? Math.ceil(bb.w) : ctrRect[2]; + var height2 = options3.full ? Math.ceil(bb.h) : ctrRect[3]; + var specdMaxDims = number$1(options3.maxWidth) || number$1(options3.maxHeight); var pxRatio = this.getPixelRatio(); var scale = 1; - if (options2.scale !== void 0) { - width2 *= options2.scale; - height *= options2.scale; - scale = options2.scale; + if (options3.scale !== void 0) { + width3 *= options3.scale; + height2 *= options3.scale; + scale = options3.scale; } else if (specdMaxDims) { var maxScaleW = Infinity; var maxScaleH = Infinity; - if (number$12(options2.maxWidth)) { - maxScaleW = scale * options2.maxWidth / width2; + if (number$1(options3.maxWidth)) { + maxScaleW = scale * options3.maxWidth / width3; } - if (number$12(options2.maxHeight)) { - maxScaleH = scale * options2.maxHeight / height; + if (number$1(options3.maxHeight)) { + maxScaleH = scale * options3.maxHeight / height2; } scale = Math.min(maxScaleW, maxScaleH); - width2 *= scale; - height *= scale; + width3 *= scale; + height2 *= scale; } if (!specdMaxDims) { - width2 *= pxRatio; - height *= pxRatio; + width3 *= pxRatio; + height2 *= pxRatio; scale *= pxRatio; } var buffCanvas = document.createElement("canvas"); - buffCanvas.width = width2; - buffCanvas.height = height; - buffCanvas.style.width = width2 + "px"; - buffCanvas.style.height = height + "px"; + buffCanvas.width = width3; + buffCanvas.height = height2; + buffCanvas.style.width = width3 + "px"; + buffCanvas.style.height = height2 + "px"; var buffCxt = buffCanvas.getContext("2d"); - if (width2 > 0 && height > 0) { - buffCxt.clearRect(0, 0, width2, height); + if (width3 > 0 && height2 > 0) { + buffCxt.clearRect(0, 0, width3, height2); buffCxt.globalCompositeOperation = "source-over"; var zsortedEles = this.getCachedZSortedEles(); - if (options2.full) { + if (options3.full) { buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale); buffCxt.scale(scale, scale); this.drawElements(buffCxt, zsortedEles); buffCxt.scale(1 / scale, 1 / scale); buffCxt.translate(bb.x1 * scale, bb.y1 * scale); } else { - var pan = cy.pan(); + var pan2 = cy.pan(); var translation = { - x: pan.x * scale, - y: pan.y * scale + x: pan2.x * scale, + y: pan2.y * scale }; scale *= cy.zoom(); buffCxt.translate(translation.x, translation.y); @@ -186961,88 +119975,48 @@ g.stateGroup line { buffCxt.scale(1 / scale, 1 / scale); buffCxt.translate(-translation.x, -translation.y); } - if (options2.bg) { + if (options3.bg) { buffCxt.globalCompositeOperation = "destination-over"; - buffCxt.fillStyle = options2.bg; - buffCxt.rect(0, 0, width2, height); + buffCxt.fillStyle = options3.bg; + buffCxt.rect(0, 0, width3, height2); buffCxt.fill(); } } return buffCanvas; }; - function b64ToBlob(b64, mimeType) { - var bytes = atob(b64); - var buff = new ArrayBuffer(bytes.length); - var buffUint8 = new Uint8Array(buff); - for (var i3 = 0; i3 < bytes.length; i3++) { - buffUint8[i3] = bytes.charCodeAt(i3); - } - return new Blob([buff], { - type: mimeType - }); - } - function b64UriToB64(b64uri) { - var i3 = b64uri.indexOf(","); - return b64uri.substr(i3 + 1); - } - function output(options2, canvas, mimeType) { - var getB64Uri = function getB64Uri2() { - return canvas.toDataURL(mimeType, options2.quality); - }; - switch (options2.output) { - case "blob-promise": - return new Promise$12(function(resolve2, reject) { - try { - canvas.toBlob(function(blob) { - if (blob != null) { - resolve2(blob); - } else { - reject(new Error("`canvas.toBlob()` sent a null value in its callback")); - } - }, mimeType, options2.quality); - } catch (err) { - reject(err); - } - }); - case "blob": - return b64ToBlob(b64UriToB64(getB64Uri()), mimeType); - case "base64": - return b64UriToB64(getB64Uri()); - case "base64uri": - default: - return getB64Uri(); - } - } - CRp$2.png = function(options2) { - return output(options2, this.bufferCanvasImage(options2), "image/png"); + __name(b64ToBlob, "b64ToBlob"); + __name(b64UriToB64, "b64UriToB64"); + __name(output, "output"); + CRp$2.png = function(options3) { + return output(options3, this.bufferCanvasImage(options3), "image/png"); }; - CRp$2.jpg = function(options2) { - return output(options2, this.bufferCanvasImage(options2), "image/jpeg"); + CRp$2.jpg = function(options3) { + return output(options3, this.bufferCanvasImage(options3), "image/jpeg"); }; - var CRp$1 = {}; - CRp$1.nodeShapeImpl = function(name, context, centerX, centerY, width2, height, points) { + CRp$1 = {}; + CRp$1.nodeShapeImpl = function(name, context, centerX, centerY, width3, height2, points, corners) { switch (name) { case "ellipse": - return this.drawEllipsePath(context, centerX, centerY, width2, height); + return this.drawEllipsePath(context, centerX, centerY, width3, height2); case "polygon": - return this.drawPolygonPath(context, centerX, centerY, width2, height, points); + return this.drawPolygonPath(context, centerX, centerY, width3, height2, points); case "round-polygon": - return this.drawRoundPolygonPath(context, centerX, centerY, width2, height, points); + return this.drawRoundPolygonPath(context, centerX, centerY, width3, height2, points, corners); case "roundrectangle": case "round-rectangle": - return this.drawRoundRectanglePath(context, centerX, centerY, width2, height); + return this.drawRoundRectanglePath(context, centerX, centerY, width3, height2, corners); case "cutrectangle": case "cut-rectangle": - return this.drawCutRectanglePath(context, centerX, centerY, width2, height); + return this.drawCutRectanglePath(context, centerX, centerY, width3, height2, points, corners); case "bottomroundrectangle": case "bottom-round-rectangle": - return this.drawBottomRoundRectanglePath(context, centerX, centerY, width2, height); + return this.drawBottomRoundRectanglePath(context, centerX, centerY, width3, height2, corners); case "barrel": - return this.drawBarrelPath(context, centerX, centerY, width2, height); + return this.drawBarrelPath(context, centerX, centerY, width3, height2); } }; - var CR = CanvasRenderer; - var CRp = CanvasRenderer.prototype; + CR = CanvasRenderer; + CRp = CanvasRenderer.prototype; CRp.CANVAS_LAYERS = 3; CRp.SELECT_BOX = 0; CRp.DRAG = 1; @@ -187051,257 +120025,27 @@ g.stateGroup line { CRp.TEXTURE_BUFFER = 0; CRp.MOTIONBLUR_BUFFER_NODE = 1; CRp.MOTIONBLUR_BUFFER_DRAG = 2; - function CanvasRenderer(options2) { - var r = this; - r.data = { - canvases: new Array(CRp.CANVAS_LAYERS), - contexts: new Array(CRp.CANVAS_LAYERS), - canvasNeedsRedraw: new Array(CRp.CANVAS_LAYERS), - bufferCanvases: new Array(CRp.BUFFER_COUNT), - bufferContexts: new Array(CRp.CANVAS_LAYERS) - }; - var tapHlOffAttr = "-webkit-tap-highlight-color"; - var tapHlOffStyle = "rgba(0,0,0,0)"; - r.data.canvasContainer = document.createElement("div"); - var containerStyle = r.data.canvasContainer.style; - r.data.canvasContainer.style[tapHlOffAttr] = tapHlOffStyle; - containerStyle.position = "relative"; - containerStyle.zIndex = "0"; - containerStyle.overflow = "hidden"; - var container = options2.cy.container(); - container.appendChild(r.data.canvasContainer); - container.style[tapHlOffAttr] = tapHlOffStyle; - var styleMap2 = { - "-webkit-user-select": "none", - "-moz-user-select": "-moz-none", - "user-select": "none", - "-webkit-tap-highlight-color": "rgba(0,0,0,0)", - "outline-style": "none" - }; - if (ms()) { - styleMap2["-ms-touch-action"] = "none"; - styleMap2["touch-action"] = "none"; - } - for (var i3 = 0; i3 < CRp.CANVAS_LAYERS; i3++) { - var canvas = r.data.canvases[i3] = document.createElement("canvas"); - r.data.contexts[i3] = canvas.getContext("2d"); - Object.keys(styleMap2).forEach(function(k) { - canvas.style[k] = styleMap2[k]; - }); - canvas.style.position = "absolute"; - canvas.setAttribute("data-id", "layer" + i3); - canvas.style.zIndex = String(CRp.CANVAS_LAYERS - i3); - r.data.canvasContainer.appendChild(canvas); - r.data.canvasNeedsRedraw[i3] = false; - } - r.data.topCanvas = r.data.canvases[0]; - r.data.canvases[CRp.NODE].setAttribute("data-id", "layer" + CRp.NODE + "-node"); - r.data.canvases[CRp.SELECT_BOX].setAttribute("data-id", "layer" + CRp.SELECT_BOX + "-selectbox"); - r.data.canvases[CRp.DRAG].setAttribute("data-id", "layer" + CRp.DRAG + "-drag"); - for (var i3 = 0; i3 < CRp.BUFFER_COUNT; i3++) { - r.data.bufferCanvases[i3] = document.createElement("canvas"); - r.data.bufferContexts[i3] = r.data.bufferCanvases[i3].getContext("2d"); - r.data.bufferCanvases[i3].style.position = "absolute"; - r.data.bufferCanvases[i3].setAttribute("data-id", "buffer" + i3); - r.data.bufferCanvases[i3].style.zIndex = String(-i3 - 1); - r.data.bufferCanvases[i3].style.visibility = "hidden"; - } - r.pathsEnabled = true; - var emptyBb = makeBoundingBox(); - var getBoxCenter = function getBoxCenter2(bb) { - return { - x: (bb.x1 + bb.x2) / 2, - y: (bb.y1 + bb.y2) / 2 - }; - }; - var getCenterOffset = function getCenterOffset2(bb) { - return { - x: -bb.w / 2, - y: -bb.h / 2 - }; - }; - var backgroundTimestampHasChanged = function backgroundTimestampHasChanged2(ele) { - var _p = ele[0]._private; - var same = _p.oldBackgroundTimestamp === _p.backgroundTimestamp; - return !same; - }; - var getStyleKey = function getStyleKey2(ele) { - return ele[0]._private.nodeKey; - }; - var getLabelKey = function getLabelKey2(ele) { - return ele[0]._private.labelStyleKey; - }; - var getSourceLabelKey = function getSourceLabelKey2(ele) { - return ele[0]._private.sourceLabelStyleKey; - }; - var getTargetLabelKey = function getTargetLabelKey2(ele) { - return ele[0]._private.targetLabelStyleKey; - }; - var drawElement = function drawElement2(context, ele, bb, scaledLabelShown, useEleOpacity) { - return r.drawElement(context, ele, bb, false, false, useEleOpacity); - }; - var drawLabel2 = function drawLabel3(context, ele, bb, scaledLabelShown, useEleOpacity) { - return r.drawElementText(context, ele, bb, scaledLabelShown, "main", useEleOpacity); - }; - var drawSourceLabel = function drawSourceLabel2(context, ele, bb, scaledLabelShown, useEleOpacity) { - return r.drawElementText(context, ele, bb, scaledLabelShown, "source", useEleOpacity); - }; - var drawTargetLabel = function drawTargetLabel2(context, ele, bb, scaledLabelShown, useEleOpacity) { - return r.drawElementText(context, ele, bb, scaledLabelShown, "target", useEleOpacity); - }; - var getElementBox = function getElementBox2(ele) { - ele.boundingBox(); - return ele[0]._private.bodyBounds; - }; - var getLabelBox = function getLabelBox2(ele) { - ele.boundingBox(); - return ele[0]._private.labelBounds.main || emptyBb; - }; - var getSourceLabelBox = function getSourceLabelBox2(ele) { - ele.boundingBox(); - return ele[0]._private.labelBounds.source || emptyBb; - }; - var getTargetLabelBox = function getTargetLabelBox2(ele) { - ele.boundingBox(); - return ele[0]._private.labelBounds.target || emptyBb; - }; - var isLabelVisibleAtScale = function isLabelVisibleAtScale2(ele, scaledLabelShown) { - return scaledLabelShown; - }; - var getElementRotationPoint = function getElementRotationPoint2(ele) { - return getBoxCenter(getElementBox(ele)); - }; - var addTextMargin = function addTextMargin2(prefix, pt, ele) { - var pre = prefix ? prefix + "-" : ""; - return { - x: pt.x + ele.pstyle(pre + "text-margin-x").pfValue, - y: pt.y + ele.pstyle(pre + "text-margin-y").pfValue - }; - }; - var getRsPt = function getRsPt2(ele, x2, y2) { - var rs = ele[0]._private.rscratch; - return { - x: rs[x2], - y: rs[y2] - }; - }; - var getLabelRotationPoint = function getLabelRotationPoint2(ele) { - return addTextMargin("", getRsPt(ele, "labelX", "labelY"), ele); - }; - var getSourceLabelRotationPoint = function getSourceLabelRotationPoint2(ele) { - return addTextMargin("source", getRsPt(ele, "sourceLabelX", "sourceLabelY"), ele); - }; - var getTargetLabelRotationPoint = function getTargetLabelRotationPoint2(ele) { - return addTextMargin("target", getRsPt(ele, "targetLabelX", "targetLabelY"), ele); - }; - var getElementRotationOffset = function getElementRotationOffset2(ele) { - return getCenterOffset(getElementBox(ele)); - }; - var getSourceLabelRotationOffset = function getSourceLabelRotationOffset2(ele) { - return getCenterOffset(getSourceLabelBox(ele)); - }; - var getTargetLabelRotationOffset = function getTargetLabelRotationOffset2(ele) { - return getCenterOffset(getTargetLabelBox(ele)); - }; - var getLabelRotationOffset = function getLabelRotationOffset2(ele) { - var bb = getLabelBox(ele); - var p2 = getCenterOffset(getLabelBox(ele)); - if (ele.isNode()) { - switch (ele.pstyle("text-halign").value) { - case "left": - p2.x = -bb.w; - break; - case "right": - p2.x = 0; - break; - } - switch (ele.pstyle("text-valign").value) { - case "top": - p2.y = -bb.h; - break; - case "bottom": - p2.y = 0; - break; - } - } - return p2; - }; - var eleTxrCache = r.data.eleTxrCache = new ElementTextureCache(r, { - getKey: getStyleKey, - doesEleInvalidateKey: backgroundTimestampHasChanged, - drawElement, - getBoundingBox: getElementBox, - getRotationPoint: getElementRotationPoint, - getRotationOffset: getElementRotationOffset, - allowEdgeTxrCaching: false, - allowParentTxrCaching: false - }); - var lblTxrCache = r.data.lblTxrCache = new ElementTextureCache(r, { - getKey: getLabelKey, - drawElement: drawLabel2, - getBoundingBox: getLabelBox, - getRotationPoint: getLabelRotationPoint, - getRotationOffset: getLabelRotationOffset, - isVisible: isLabelVisibleAtScale - }); - var slbTxrCache = r.data.slbTxrCache = new ElementTextureCache(r, { - getKey: getSourceLabelKey, - drawElement: drawSourceLabel, - getBoundingBox: getSourceLabelBox, - getRotationPoint: getSourceLabelRotationPoint, - getRotationOffset: getSourceLabelRotationOffset, - isVisible: isLabelVisibleAtScale - }); - var tlbTxrCache = r.data.tlbTxrCache = new ElementTextureCache(r, { - getKey: getTargetLabelKey, - drawElement: drawTargetLabel, - getBoundingBox: getTargetLabelBox, - getRotationPoint: getTargetLabelRotationPoint, - getRotationOffset: getTargetLabelRotationOffset, - isVisible: isLabelVisibleAtScale - }); - var lyrTxrCache = r.data.lyrTxrCache = new LayeredTextureCache(r); - r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) { - eleTxrCache.invalidateElements(eles); - lblTxrCache.invalidateElements(eles); - slbTxrCache.invalidateElements(eles); - tlbTxrCache.invalidateElements(eles); - lyrTxrCache.invalidateElements(eles); - for (var _i6 = 0; _i6 < eles.length; _i6++) { - var _p = eles[_i6]._private; - _p.oldBackgroundTimestamp = _p.backgroundTimestamp; - } - }); - var refineInLayers = function refineInLayers2(reqs) { - for (var i4 = 0; i4 < reqs.length; i4++) { - lyrTxrCache.enqueueElementRefinement(reqs[i4].ele); - } - }; - eleTxrCache.onDequeue(refineInLayers); - lblTxrCache.onDequeue(refineInLayers); - slbTxrCache.onDequeue(refineInLayers); - tlbTxrCache.onDequeue(refineInLayers); - } - CRp.redrawHint = function(group, bool2) { - var r = this; - switch (group) { + __name(CanvasRenderer, "CanvasRenderer"); + CRp.redrawHint = function(group2, bool2) { + var r2 = this; + switch (group2) { case "eles": - r.data.canvasNeedsRedraw[CRp.NODE] = bool2; + r2.data.canvasNeedsRedraw[CRp.NODE] = bool2; break; case "drag": - r.data.canvasNeedsRedraw[CRp.DRAG] = bool2; + r2.data.canvasNeedsRedraw[CRp.DRAG] = bool2; break; case "select": - r.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool2; + r2.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool2; break; } }; - var pathsImpld = typeof Path2D !== "undefined"; - CRp.path2dEnabled = function(on) { - if (on === void 0) { + pathsImpld = typeof Path2D !== "undefined"; + CRp.path2dEnabled = function(on3) { + if (on3 === void 0) { return this.pathsEnabled; } - this.pathsEnabled = on ? true : false; + this.pathsEnabled = on3 ? true : false; }; CRp.usePaths = function() { return pathsImpld && this.pathsEnabled; @@ -187322,21 +120066,23 @@ g.stateGroup line { return context.webkitImageSmoothingEnabled || context.mozImageSmoothingEnabled || context.msImageSmoothingEnabled; } }; - CRp.makeOffscreenCanvas = function(width2, height) { + CRp.makeOffscreenCanvas = function(width3, height2) { var canvas; if ((typeof OffscreenCanvas === "undefined" ? "undefined" : _typeof(OffscreenCanvas)) !== "undefined") { - canvas = new OffscreenCanvas(width2, height); + canvas = new OffscreenCanvas(width3, height2); } else { - canvas = document.createElement("canvas"); - canvas.width = width2; - canvas.height = height; + var containerWindow = this.cy.window(); + var document2 = containerWindow.document; + canvas = document2.createElement("canvas"); + canvas.width = width3; + canvas.height = height2; } return canvas; }; [CRp$a, CRp$9, CRp$8, CRp$7, CRp$6, CRp$5, CRp$4, CRp$3, CRp$2, CRp$1].forEach(function(props) { extend2(CRp, props); }); - var renderer2 = [{ + renderer5 = [{ name: "null", impl: NullRenderer }, { @@ -187346,195 +120092,20 @@ g.stateGroup line { name: "canvas", impl: CR }]; - var incExts = [{ + incExts = [{ type: "layout", - extensions: layout2 + extensions: layout4 }, { type: "renderer", - extensions: renderer2 + extensions: renderer5 }]; - var extensions = {}; - var modules = {}; - function setExtension(type2, name, registrant) { - var ext = registrant; - var overrideErr = function overrideErr2(field) { - warn("Can not register `" + name + "` for `" + type2 + "` since `" + field + "` already exists in the prototype and can not be overridden"); - }; - if (type2 === "core") { - if (Core.prototype[name]) { - return overrideErr(name); - } else { - Core.prototype[name] = registrant; - } - } else if (type2 === "collection") { - if (Collection.prototype[name]) { - return overrideErr(name); - } else { - Collection.prototype[name] = registrant; - } - } else if (type2 === "layout") { - var Layout2 = function Layout3(options2) { - this.options = options2; - registrant.call(this, options2); - if (!plainObject(this._private)) { - this._private = {}; - } - this._private.cy = options2.cy; - this._private.listeners = []; - this.createEmitter(); - }; - var layoutProto = Layout2.prototype = Object.create(registrant.prototype); - var optLayoutFns = []; - for (var i3 = 0; i3 < optLayoutFns.length; i3++) { - var fnName = optLayoutFns[i3]; - layoutProto[fnName] = layoutProto[fnName] || function() { - return this; - }; - } - if (layoutProto.start && !layoutProto.run) { - layoutProto.run = function() { - this.start(); - return this; - }; - } else if (!layoutProto.start && layoutProto.run) { - layoutProto.start = function() { - this.run(); - return this; - }; - } - var regStop = registrant.prototype.stop; - layoutProto.stop = function() { - var opts = this.options; - if (opts && opts.animate) { - var anis = this.animations; - if (anis) { - for (var _i6 = 0; _i6 < anis.length; _i6++) { - anis[_i6].stop(); - } - } - } - if (regStop) { - regStop.call(this); - } else { - this.emit("layoutstop"); - } - return this; - }; - if (!layoutProto.destroy) { - layoutProto.destroy = function() { - return this; - }; - } - layoutProto.cy = function() { - return this._private.cy; - }; - var getCy = function getCy2(layout3) { - return layout3._private.cy; - }; - var emitterOpts = { - addEventFields: function addEventFields(layout3, evt) { - evt.layout = layout3; - evt.cy = getCy(layout3); - evt.target = layout3; - }, - bubble: function bubble() { - return true; - }, - parent: function parent(layout3) { - return getCy(layout3); - } - }; - extend2(layoutProto, { - createEmitter: function createEmitter() { - this._private.emitter = new Emitter(emitterOpts, this); - return this; - }, - emitter: function emitter() { - return this._private.emitter; - }, - on: function on(evt, cb) { - this.emitter().on(evt, cb); - return this; - }, - one: function one2(evt, cb) { - this.emitter().one(evt, cb); - return this; - }, - once: function once(evt, cb) { - this.emitter().one(evt, cb); - return this; - }, - removeListener: function removeListener(evt, cb) { - this.emitter().removeListener(evt, cb); - return this; - }, - removeAllListeners: function removeAllListeners() { - this.emitter().removeAllListeners(); - return this; - }, - emit: function emit(evt, params) { - this.emitter().emit(evt, params); - return this; - } - }); - define3.eventAliasesOn(layoutProto); - ext = Layout2; - } else if (type2 === "renderer" && name !== "null" && name !== "base") { - var BaseRenderer2 = getExtension("renderer", "base"); - var bProto = BaseRenderer2.prototype; - var RegistrantRenderer = registrant; - var rProto = registrant.prototype; - var Renderer = function Renderer2() { - BaseRenderer2.apply(this, arguments); - RegistrantRenderer.apply(this, arguments); - }; - var proto = Renderer.prototype; - for (var pName in bProto) { - var pVal = bProto[pName]; - var existsInR = rProto[pName] != null; - if (existsInR) { - return overrideErr(pName); - } - proto[pName] = pVal; - } - for (var _pName in rProto) { - proto[_pName] = rProto[_pName]; - } - bProto.clientFunctions.forEach(function(name2) { - proto[name2] = proto[name2] || function() { - error("Renderer does not implement `renderer." + name2 + "()` on its prototype"); - }; - }); - ext = Renderer; - } else if (type2 === "__proto__" || type2 === "constructor" || type2 === "prototype") { - return error(type2 + " is an illegal type to be registered, possibly lead to prototype pollutions"); - } - return setMap({ - map: extensions, - keys: [type2, name], - value: ext - }); - } - function getExtension(type2, name) { - return getMap({ - map: extensions, - keys: [type2, name] - }); - } - function setModule(type2, name, moduleType, moduleName, registrant) { - return setMap({ - map: modules, - keys: [type2, name, moduleType, moduleName], - value: registrant - }); - } - function getModule(type2, name, moduleType, moduleName) { - return getMap({ - map: modules, - keys: [type2, name, moduleType, moduleName] - }); - } - var extension2 = function extension3() { + extensions = {}; + modules = {}; + __name(setExtension, "setExtension"); + __name(getExtension, "getExtension"); + __name(setModule, "setModule"); + __name(getModule, "getModule"); + extension3 = /* @__PURE__ */ __name(function extension4() { if (arguments.length === 2) { return getExtension.apply(null, arguments); } else if (arguments.length === 3) { @@ -187546,44 +120117,44 @@ g.stateGroup line { } else { error("Invalid extension access syntax"); } - }; - Core.prototype.extension = extension2; - incExts.forEach(function(group) { - group.extensions.forEach(function(ext) { - setExtension(group.type, ext.name, ext.impl); + }, "extension"); + Core.prototype.extension = extension3; + incExts.forEach(function(group2) { + group2.extensions.forEach(function(ext) { + setExtension(group2.type, ext.name, ext.impl); }); }); - var Stylesheet = function Stylesheet2() { + Stylesheet = /* @__PURE__ */ __name(function Stylesheet2() { if (!(this instanceof Stylesheet2)) { return new Stylesheet2(); } this.length = 0; - }; - var sheetfn = Stylesheet.prototype; + }, "Stylesheet"); + sheetfn = Stylesheet.prototype; sheetfn.instanceString = function() { return "stylesheet"; }; - sheetfn.selector = function(selector2) { - var i3 = this.length++; - this[i3] = { - selector: selector2, + sheetfn.selector = function(selector) { + var i2 = this.length++; + this[i2] = { + selector, properties: [] }; return this; }; sheetfn.css = function(name, value2) { - var i3 = this.length - 1; - if (string2(name)) { - this[i3].properties.push({ + var i2 = this.length - 1; + if (string(name)) { + this[i2].properties.push({ name, value: value2 }); } else if (plainObject(name)) { - var map2 = name; - var propNames = Object.keys(map2); - for (var j = 0; j < propNames.length; j++) { - var key = propNames[j]; - var mapVal = map2[key]; + var map5 = name; + var propNames = Object.keys(map5); + for (var j2 = 0; j2 < propNames.length; j2++) { + var key = propNames[j2]; + var mapVal = map5[key]; if (mapVal == null) { continue; } @@ -187593,7 +120164,7 @@ g.stateGroup line { } var _name = prop.name; var _value = mapVal; - this[i3].properties.push({ + this[i2].properties.push({ name: _name, value: _value }); @@ -187603,33 +120174,33 @@ g.stateGroup line { }; sheetfn.style = sheetfn.css; sheetfn.generateStyle = function(cy) { - var style = new Style2(cy); - return this.appendToStyle(style); + var style3 = new Style2(cy); + return this.appendToStyle(style3); }; - sheetfn.appendToStyle = function(style) { - for (var i3 = 0; i3 < this.length; i3++) { - var context = this[i3]; - var selector2 = context.selector; + sheetfn.appendToStyle = function(style3) { + for (var i2 = 0; i2 < this.length; i2++) { + var context = this[i2]; + var selector = context.selector; var props = context.properties; - style.selector(selector2); - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - style.css(prop.name, prop.value); + style3.selector(selector); + for (var j2 = 0; j2 < props.length; j2++) { + var prop = props[j2]; + style3.css(prop.name, prop.value); } } - return style; + return style3; }; - var version2 = "3.28.1"; - var cytoscape2 = function cytoscape3(options2) { - if (options2 === void 0) { - options2 = {}; + version3 = "3.30.1"; + cytoscape2 = /* @__PURE__ */ __name(function cytoscape3(options3) { + if (options3 === void 0) { + options3 = {}; } - if (plainObject(options2)) { - return new Core(options2); - } else if (string2(options2)) { - return extension2.apply(extension2, arguments); + if (plainObject(options3)) { + return new Core(options3); + } else if (string(options3)) { + return extension3.apply(extension3, arguments); } - }; + }, "cytoscape"); cytoscape2.use = function(ext) { var args = Array.prototype.slice.call(arguments, 1); args.unshift(cytoscape2); @@ -187639,28 +120210,28 @@ g.stateGroup line { cytoscape2.warnings = function(bool2) { return warnings(bool2); }; - cytoscape2.version = version2; + cytoscape2.version = version3; cytoscape2.stylesheet = cytoscape2.Stylesheet = Stylesheet; - return cytoscape2; - }); - })(cytoscape_umd); - var cytoscape_umdExports = cytoscape_umd.exports; - const cytoscape$1 = /* @__PURE__ */ getDefaultExportFromCjs(cytoscape_umdExports); - var cytoscapeCoseBilkent = { exports: {} }; - var coseBase = { exports: {} }; - var layoutBase = { exports: {} }; - var hasRequiredLayoutBase; - function requireLayoutBase() { - if (hasRequiredLayoutBase) - return layoutBase.exports; - hasRequiredLayoutBase = 1; - (function(module2, exports2) { - (function webpackUniversalModuleDefinition(root2, factory) { - module2.exports = factory(); - })(commonjsGlobal, function() { + } + }); + + // ../../node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js + var require_layout_base = __commonJS({ + "../../node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js"(exports2, module2) { + "use strict"; + (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) { + if (typeof exports2 === "object" && typeof module2 === "object") + module2.exports = factory(); + else if (typeof define === "function" && define.amd) + define([], factory); + else if (typeof exports2 === "object") + exports2["layoutBase"] = factory(); + else + root4["layoutBase"] = factory(); + }, "webpackUniversalModuleDefinition"))(exports2, function() { return ( /******/ - function(modules) { + function(modules2) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) { @@ -187675,11 +120246,12 @@ g.stateGroup line { exports: {} /******/ }; - modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); + modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); module3.l = true; return module3.exports; } - __webpack_require__.m = modules; + __name(__webpack_require__, "__webpack_require__"); + __webpack_require__.m = modules2; __webpack_require__.c = installedModules; __webpack_require__.i = function(value2) { return value2; @@ -187700,20 +120272,20 @@ g.stateGroup line { __webpack_require__.n = function(module3) { var getter = module3 && module3.__esModule ? ( /******/ - function getDefault() { + /* @__PURE__ */ __name(function getDefault() { return module3["default"]; - } + }, "getDefault") ) : ( /******/ - function getModuleExports() { + /* @__PURE__ */ __name(function getModuleExports() { return module3; - } + }, "getModuleExports") ); __webpack_require__.d(getter, "a", getter); return getter; }; - __webpack_require__.o = function(object2, property2) { - return Object.prototype.hasOwnProperty.call(object2, property2); + __webpack_require__.o = function(object3, property2) { + return Object.prototype.hasOwnProperty.call(object3, property2); }; __webpack_require__.p = ""; return __webpack_require__(__webpack_require__.s = 26); @@ -187721,8 +120293,10 @@ g.stateGroup line { /* 0 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function LayoutConstants() { } + __name(LayoutConstants, "LayoutConstants"); LayoutConstants.QUALITY = 1; LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED = false; LayoutConstants.DEFAULT_INCREMENTAL = false; @@ -187745,6 +120319,7 @@ g.stateGroup line { /* 1 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraphObject = __webpack_require__(2); var IGeometry = __webpack_require__(8); var IMath = __webpack_require__(9); @@ -187756,6 +120331,7 @@ g.stateGroup line { this.source = source; this.target = target; } + __name(LEdge, "LEdge"); LEdge.prototype = Object.create(LGraphObject.prototype); for (var prop in LGraphObject) { LEdge[prop] = LGraphObject[prop]; @@ -187798,12 +120374,12 @@ g.stateGroup line { }; LEdge.prototype.getOtherEndInGraph = function(node2, graph) { var otherEnd = this.getOtherEnd(node2); - var root2 = graph.getGraphManager().getRoot(); + var root4 = graph.getGraphManager().getRoot(); while (true) { if (otherEnd.getOwner() == graph) { return otherEnd; } - if (otherEnd.getOwner() == root2) { + if (otherEnd.getOwner() == root4) { break; } otherEnd = otherEnd.getOwner().getParent(); @@ -187841,37 +120417,38 @@ g.stateGroup line { /* 2 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function LGraphObject(vGraphObject) { this.vGraphObject = vGraphObject; } + __name(LGraphObject, "LGraphObject"); module3.exports = LGraphObject; }, /* 3 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraphObject = __webpack_require__(2); var Integer = __webpack_require__(10); var RectangleD = __webpack_require__(13); var LayoutConstants = __webpack_require__(0); var RandomSeed = __webpack_require__(16); var PointD = __webpack_require__(4); - function LNode(gm, loc, size2, vNode) { - if (size2 == null && vNode == null) { + function LNode(gm, loc, size5, vNode) { + if (size5 == null && vNode == null) { vNode = loc; } LGraphObject.call(this, vNode); - if (gm.graphManager != null) - gm = gm.graphManager; + if (gm.graphManager != null) gm = gm.graphManager; this.estimatedSize = Integer.MIN_VALUE; this.inclusionTreeDepth = Integer.MAX_VALUE; this.vGraphObject = vNode; this.edges = []; this.graphManager = gm; - if (size2 != null && loc != null) - this.rect = new RectangleD(loc.x, loc.y, size2.width, size2.height); - else - this.rect = new RectangleD(); + if (size5 != null && loc != null) this.rect = new RectangleD(loc.x, loc.y, size5.width, size5.height); + else this.rect = new RectangleD(); } + __name(LNode, "LNode"); LNode.prototype = Object.create(LGraphObject.prototype); for (var prop in LGraphObject) { LNode[prop] = LGraphObject[prop]; @@ -187888,14 +120465,14 @@ g.stateGroup line { LNode.prototype.getWidth = function() { return this.rect.width; }; - LNode.prototype.setWidth = function(width2) { - this.rect.width = width2; + LNode.prototype.setWidth = function(width3) { + this.rect.width = width3; }; LNode.prototype.getHeight = function() { return this.rect.height; }; - LNode.prototype.setHeight = function(height) { - this.rect.height = height; + LNode.prototype.setHeight = function(height2) { + this.rect.height = height2; }; LNode.prototype.getCenterX = function() { return this.rect.x + this.rect.width / 2; @@ -187928,9 +120505,9 @@ g.stateGroup line { this.rect.x = cx - this.rect.width / 2; this.rect.y = cy - this.rect.height / 2; }; - LNode.prototype.setLocation = function(x2, y2) { - this.rect.x = x2; - this.rect.y = y2; + LNode.prototype.setLocation = function(x5, y5) { + this.rect.x = x5; + this.rect.y = y5; }; LNode.prototype.moveBy = function(dx, dy) { this.rect.x += dx; @@ -187938,24 +120515,24 @@ g.stateGroup line { }; LNode.prototype.getEdgeListToNode = function(to) { var edgeList2 = []; + var edge; var self2 = this; - self2.edges.forEach(function(edge) { - if (edge.target == to) { - if (edge.source != self2) - throw "Incorrect edge source!"; - edgeList2.push(edge); + self2.edges.forEach(function(edge2) { + if (edge2.target == to) { + if (edge2.source != self2) throw "Incorrect edge source!"; + edgeList2.push(edge2); } }); return edgeList2; }; LNode.prototype.getEdgesBetween = function(other) { var edgeList2 = []; + var edge; var self2 = this; - self2.edges.forEach(function(edge) { - if (!(edge.source == self2 || edge.target == self2)) - throw "Incorrect edge source and/or target"; - if (edge.target == other || edge.source == other) { - edgeList2.push(edge); + self2.edges.forEach(function(edge2) { + if (!(edge2.source == self2 || edge2.target == self2)) throw "Incorrect edge source and/or target"; + if (edge2.target == other || edge2.source == other) { + edgeList2.push(edge2); } }); return edgeList2; @@ -187981,9 +120558,9 @@ g.stateGroup line { var children2; withNeighborsList.add(this); if (this.child != null) { - var nodes2 = this.child.getNodes(); - for (var i2 = 0; i2 < nodes2.length; i2++) { - childNode = nodes2[i2]; + var nodes6 = this.child.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + childNode = nodes6[i2]; children2 = childNode.withChildren(); children2.forEach(function(node2) { withNeighborsList.add(node2); @@ -187998,9 +120575,9 @@ g.stateGroup line { if (this.child == null) { noOfChildren = 1; } else { - var nodes2 = this.child.getNodes(); - for (var i2 = 0; i2 < nodes2.length; i2++) { - childNode = nodes2[i2]; + var nodes6 = this.child.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + childNode = nodes6[i2]; noOfChildren += childNode.getNoOfChildren(); } } @@ -188049,17 +120626,17 @@ g.stateGroup line { this.setWidth(childGraph.getRight() - childGraph.getLeft()); this.setHeight(childGraph.getBottom() - childGraph.getTop()); if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) { - var width2 = childGraph.getRight() - childGraph.getLeft(); - var height = childGraph.getBottom() - childGraph.getTop(); - if (this.labelWidth > width2) { - this.rect.x -= (this.labelWidth - width2) / 2; + var width3 = childGraph.getRight() - childGraph.getLeft(); + var height2 = childGraph.getBottom() - childGraph.getTop(); + if (this.labelWidth > width3) { + this.rect.x -= (this.labelWidth - width3) / 2; this.setWidth(this.labelWidth); } - if (this.labelHeight > height) { + if (this.labelHeight > height2) { if (this.labelPos == "center") { - this.rect.y -= (this.labelHeight - height) / 2; + this.rect.y -= (this.labelHeight - height2) / 2; } else if (this.labelPos == "top") { - this.rect.y -= this.labelHeight - height; + this.rect.y -= this.labelHeight - height2; } this.setHeight(this.labelHeight); } @@ -188073,11 +120650,11 @@ g.stateGroup line { return this.inclusionTreeDepth; }; LNode.prototype.transform = function(trans) { - var left2 = this.rect.x; - if (left2 > LayoutConstants.WORLD_BOUNDARY) { - left2 = LayoutConstants.WORLD_BOUNDARY; - } else if (left2 < -LayoutConstants.WORLD_BOUNDARY) { - left2 = -LayoutConstants.WORLD_BOUNDARY; + var left3 = this.rect.x; + if (left3 > LayoutConstants.WORLD_BOUNDARY) { + left3 = LayoutConstants.WORLD_BOUNDARY; + } else if (left3 < -LayoutConstants.WORLD_BOUNDARY) { + left3 = -LayoutConstants.WORLD_BOUNDARY; } var top2 = this.rect.y; if (top2 > LayoutConstants.WORLD_BOUNDARY) { @@ -188085,7 +120662,7 @@ g.stateGroup line { } else if (top2 < -LayoutConstants.WORLD_BOUNDARY) { top2 = -LayoutConstants.WORLD_BOUNDARY; } - var leftTop = new PointD(left2, top2); + var leftTop = new PointD(left3, top2); var vLeftTop = trans.inverseTransformPoint(leftTop); this.setLocation(vLeftTop.x, vLeftTop.y); }; @@ -188112,26 +120689,28 @@ g.stateGroup line { /* 4 */ /***/ function(module3, exports3, __webpack_require__) { - function PointD(x2, y2) { - if (x2 == null && y2 == null) { + "use strict"; + function PointD(x5, y5) { + if (x5 == null && y5 == null) { this.x = 0; this.y = 0; } else { - this.x = x2; - this.y = y2; + this.x = x5; + this.y = y5; } } + __name(PointD, "PointD"); PointD.prototype.getX = function() { return this.x; }; PointD.prototype.getY = function() { return this.y; }; - PointD.prototype.setX = function(x2) { - this.x = x2; + PointD.prototype.setX = function(x5) { + this.x = x5; }; - PointD.prototype.setY = function(y2) { - this.y = y2; + PointD.prototype.setY = function(y5) { + this.y = y5; }; PointD.prototype.getDifference = function(pt) { return new DimensionD(this.x - pt.x, this.y - pt.y); @@ -188149,6 +120728,7 @@ g.stateGroup line { /* 5 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraphObject = __webpack_require__(2); var Integer = __webpack_require__(10); var LayoutConstants = __webpack_require__(0); @@ -188156,22 +120736,23 @@ g.stateGroup line { var LNode = __webpack_require__(3); var LEdge = __webpack_require__(1); var RectangleD = __webpack_require__(13); - var Point2 = __webpack_require__(12); + var Point3 = __webpack_require__(12); var LinkedList = __webpack_require__(11); - function LGraph(parent, obj2, vGraph) { + function LGraph(parent4, obj2, vGraph) { LGraphObject.call(this, vGraph); this.estimatedSize = Integer.MIN_VALUE; this.margin = LayoutConstants.DEFAULT_GRAPH_MARGIN; this.edges = []; this.nodes = []; this.isConnected = false; - this.parent = parent; + this.parent = parent4; if (obj2 != null && obj2 instanceof LGraphManager) { this.graphManager = obj2; } else if (obj2 != null && obj2 instanceof Layout) { this.graphManager = obj2.graphManager; } } + __name(LGraph, "LGraph"); LGraph.prototype = Object.create(LGraphObject.prototype); for (var prop in LGraphObject) { LGraph[prop] = LGraphObject[prop]; @@ -188251,8 +120832,8 @@ g.stateGroup line { } var edgesToBeRemoved = node2.edges.slice(); var edge; - var s = edgesToBeRemoved.length; - for (var i2 = 0; i2 < s; i2++) { + var s2 = edgesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { edge = edgesToBeRemoved[i2]; if (edge.isInterGraph) { this.graphManager.remove(edge); @@ -188260,11 +120841,11 @@ g.stateGroup line { edge.source.owner.remove(edge); } } - var index2 = this.nodes.indexOf(node2); - if (index2 == -1) { + var index = this.nodes.indexOf(node2); + if (index == -1) { throw "Node not in owner node list!"; } - this.nodes.splice(index2, 1); + this.nodes.splice(index, 1); } else if (obj instanceof LEdge) { var edge = obj; if (edge == null) { @@ -188285,47 +120866,47 @@ g.stateGroup line { if (edge.target != edge.source) { edge.target.edges.splice(targetIndex, 1); } - var index2 = edge.source.owner.getEdges().indexOf(edge); - if (index2 == -1) { + var index = edge.source.owner.getEdges().indexOf(edge); + if (index == -1) { throw "Not in owner's edge list!"; } - edge.source.owner.getEdges().splice(index2, 1); + edge.source.owner.getEdges().splice(index, 1); } }; LGraph.prototype.updateLeftTop = function() { var top2 = Integer.MAX_VALUE; - var left2 = Integer.MAX_VALUE; + var left3 = Integer.MAX_VALUE; var nodeTop; var nodeLeft; var margin; - var nodes2 = this.getNodes(); - var s = nodes2.length; - for (var i2 = 0; i2 < s; i2++) { - var lNode = nodes2[i2]; + var nodes6 = this.getNodes(); + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; nodeTop = lNode.getTop(); nodeLeft = lNode.getLeft(); if (top2 > nodeTop) { top2 = nodeTop; } - if (left2 > nodeLeft) { - left2 = nodeLeft; + if (left3 > nodeLeft) { + left3 = nodeLeft; } } if (top2 == Integer.MAX_VALUE) { return null; } - if (nodes2[0].getParent().paddingLeft != void 0) { - margin = nodes2[0].getParent().paddingLeft; + if (nodes6[0].getParent().paddingLeft != void 0) { + margin = nodes6[0].getParent().paddingLeft; } else { margin = this.margin; } - this.left = left2 - margin; + this.left = left3 - margin; this.top = top2 - margin; - return new Point2(this.left, this.top); + return new Point3(this.left, this.top); }; LGraph.prototype.updateBounds = function(recursive) { - var left2 = Integer.MAX_VALUE; - var right2 = -Integer.MAX_VALUE; + var left3 = Integer.MAX_VALUE; + var right3 = -Integer.MAX_VALUE; var top2 = Integer.MAX_VALUE; var bottom2 = -Integer.MAX_VALUE; var nodeLeft; @@ -188333,10 +120914,10 @@ g.stateGroup line { var nodeTop; var nodeBottom; var margin; - var nodes2 = this.nodes; - var s = nodes2.length; - for (var i2 = 0; i2 < s; i2++) { - var lNode = nodes2[i2]; + var nodes6 = this.nodes; + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; if (recursive && lNode.child != null) { lNode.updateBounds(); } @@ -188344,11 +120925,11 @@ g.stateGroup line { nodeRight = lNode.getRight(); nodeTop = lNode.getTop(); nodeBottom = lNode.getBottom(); - if (left2 > nodeLeft) { - left2 = nodeLeft; + if (left3 > nodeLeft) { + left3 = nodeLeft; } - if (right2 < nodeRight) { - right2 = nodeRight; + if (right3 < nodeRight) { + right3 = nodeRight; } if (top2 > nodeTop) { top2 = nodeTop; @@ -188357,15 +120938,15 @@ g.stateGroup line { bottom2 = nodeBottom; } } - var boundingRect = new RectangleD(left2, top2, right2 - left2, bottom2 - top2); - if (left2 == Integer.MAX_VALUE) { + var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2); + if (left3 == Integer.MAX_VALUE) { this.left = this.parent.getLeft(); this.right = this.parent.getRight(); this.top = this.parent.getTop(); this.bottom = this.parent.getBottom(); } - if (nodes2[0].getParent().paddingLeft != void 0) { - margin = nodes2[0].getParent().paddingLeft; + if (nodes6[0].getParent().paddingLeft != void 0) { + margin = nodes6[0].getParent().paddingLeft; } else { margin = this.margin; } @@ -188374,27 +120955,27 @@ g.stateGroup line { this.top = boundingRect.y - margin; this.bottom = boundingRect.y + boundingRect.height + margin; }; - LGraph.calculateBounds = function(nodes2) { - var left2 = Integer.MAX_VALUE; - var right2 = -Integer.MAX_VALUE; + LGraph.calculateBounds = function(nodes6) { + var left3 = Integer.MAX_VALUE; + var right3 = -Integer.MAX_VALUE; var top2 = Integer.MAX_VALUE; var bottom2 = -Integer.MAX_VALUE; var nodeLeft; var nodeRight; var nodeTop; var nodeBottom; - var s = nodes2.length; - for (var i2 = 0; i2 < s; i2++) { - var lNode = nodes2[i2]; + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; nodeLeft = lNode.getLeft(); nodeRight = lNode.getRight(); nodeTop = lNode.getTop(); nodeBottom = lNode.getBottom(); - if (left2 > nodeLeft) { - left2 = nodeLeft; + if (left3 > nodeLeft) { + left3 = nodeLeft; } - if (right2 < nodeRight) { - right2 = nodeRight; + if (right3 < nodeRight) { + right3 = nodeRight; } if (top2 > nodeTop) { top2 = nodeTop; @@ -188403,7 +120984,7 @@ g.stateGroup line { bottom2 = nodeBottom; } } - var boundingRect = new RectangleD(left2, top2, right2 - left2, bottom2 - top2); + var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2); return boundingRect; }; LGraph.prototype.getInclusionTreeDepth = function() { @@ -188420,17 +121001,17 @@ g.stateGroup line { return this.estimatedSize; }; LGraph.prototype.calcEstimatedSize = function() { - var size2 = 0; - var nodes2 = this.nodes; - var s = nodes2.length; - for (var i2 = 0; i2 < s; i2++) { - var lNode = nodes2[i2]; - size2 += lNode.calcEstimatedSize(); - } - if (size2 == 0) { + var size5 = 0; + var nodes6 = this.nodes; + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; + size5 += lNode.calcEstimatedSize(); + } + if (size5 == 0) { this.estimatedSize = LayoutConstants.EMPTY_COMPOUND_NODE_SIZE; } else { - this.estimatedSize = size2 / Math.sqrt(this.nodes.length); + this.estimatedSize = size5 / Math.sqrt(this.nodes.length); } return this.estimatedSize; }; @@ -188453,8 +121034,8 @@ g.stateGroup line { while (queue.length !== 0) { currentNode = queue.shift(); neighborEdges = currentNode.getEdges(); - var size2 = neighborEdges.length; - for (var i2 = 0; i2 < size2; i2++) { + var size5 = neighborEdges.length; + for (var i2 = 0; i2 < size5; i2++) { var neighborEdge = neighborEdges[i2]; currentNeighbor = neighborEdge.getOtherEndInGraph(currentNode, this); if (currentNeighbor != null && !visited.has(currentNeighbor)) { @@ -188484,19 +121065,21 @@ g.stateGroup line { /* 6 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraph; var LEdge = __webpack_require__(1); - function LGraphManager(layout2) { + function LGraphManager(layout6) { LGraph = __webpack_require__(5); - this.layout = layout2; + this.layout = layout6; this.graphs = []; this.edges = []; } + __name(LGraphManager, "LGraphManager"); LGraphManager.prototype.addRoot = function() { var ngraph = this.layout.newGraph(); var nnode = this.layout.newNode(null); - var root2 = this.add(ngraph, nnode); - this.setRootGraph(root2); + var root4 = this.add(ngraph, nnode); + this.setRootGraph(root4); return this.rootGraph; }; LGraphManager.prototype.add = function(newGraph, parentNode, newEdge, sourceNode, targetNode) { @@ -188567,24 +121150,24 @@ g.stateGroup line { var edgesToBeRemoved = []; edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges()); var edge; - var s = edgesToBeRemoved.length; - for (var i2 = 0; i2 < s; i2++) { + var s2 = edgesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { edge = edgesToBeRemoved[i2]; graph.remove(edge); } var nodesToBeRemoved = []; nodesToBeRemoved = nodesToBeRemoved.concat(graph.getNodes()); var node2; - s = nodesToBeRemoved.length; - for (var i2 = 0; i2 < s; i2++) { + s2 = nodesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { node2 = nodesToBeRemoved[i2]; graph.remove(node2); } if (graph == this.rootGraph) { this.setRootGraph(null); } - var index2 = this.graphs.indexOf(graph); - this.graphs.splice(index2, 1); + var index = this.graphs.indexOf(graph); + this.graphs.splice(index, 1); graph.parent = null; } else if (lObj instanceof LEdge) { edge = lObj; @@ -188600,18 +121183,18 @@ g.stateGroup line { if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) { throw "Source and/or target doesn't know this edge!"; } - var index2 = edge.source.edges.indexOf(edge); - edge.source.edges.splice(index2, 1); - index2 = edge.target.edges.indexOf(edge); - edge.target.edges.splice(index2, 1); + var index = edge.source.edges.indexOf(edge); + edge.source.edges.splice(index, 1); + index = edge.target.edges.indexOf(edge); + edge.target.edges.splice(index, 1); if (!(edge.source.owner != null && edge.source.owner.getGraphManager() != null)) { throw "Edge owner graph or owner graph manager is null!"; } if (edge.source.owner.getGraphManager().edges.indexOf(edge) == -1) { throw "Not in owner graph manager's edge list!"; } - var index2 = edge.source.owner.getGraphManager().edges.indexOf(edge); - edge.source.owner.getGraphManager().edges.splice(index2, 1); + var index = edge.source.owner.getGraphManager().edges.indexOf(edge); + edge.source.owner.getGraphManager().edges.splice(index, 1); } }; LGraphManager.prototype.updateBounds = function() { @@ -188624,8 +121207,8 @@ g.stateGroup line { if (this.allNodes == null) { var nodeList = []; var graphs = this.getGraphs(); - var s = graphs.length; - for (var i2 = 0; i2 < s; i2++) { + var s2 = graphs.length; + for (var i2 = 0; i2 < s2; i2++) { nodeList = nodeList.concat(graphs[i2].getNodes()); } this.allNodes = nodeList; @@ -188645,7 +121228,7 @@ g.stateGroup line { if (this.allEdges == null) { var edgeList2 = []; var graphs = this.getGraphs(); - graphs.length; + var s2 = graphs.length; for (var i2 = 0; i2 < graphs.length; i2++) { edgeList2 = edgeList2.concat(graphs[i2].getEdges()); } @@ -188722,10 +121305,10 @@ g.stateGroup line { var targetNode; var sourceAncestorGraph; var targetAncestorGraph; - var edges2 = this.getAllEdges(); - var s = edges2.length; - for (var i2 = 0; i2 < s; i2++) { - edge = edges2[i2]; + var edges5 = this.getAllEdges(); + var s2 = edges5.length; + for (var i2 = 0; i2 < s2; i2++) { + edge = edges5[i2]; sourceNode = edge.source; targetNode = edge.target; edge.lca = null; @@ -188795,10 +121378,10 @@ g.stateGroup line { depth = 1; } var node2; - var nodes2 = graph.getNodes(); - var s = nodes2.length; - for (var i2 = 0; i2 < s; i2++) { - node2 = nodes2[i2]; + var nodes6 = graph.getNodes(); + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + node2 = nodes6[i2]; node2.inclusionTreeDepth = depth; if (node2.child != null) { this.calcInclusionTreeDepths(node2.child, depth + 1); @@ -188807,8 +121390,8 @@ g.stateGroup line { }; LGraphManager.prototype.includesInvalidEdge = function() { var edge; - var s = this.edges.length; - for (var i2 = 0; i2 < s; i2++) { + var s2 = this.edges.length; + for (var i2 = 0; i2 < s2; i2++) { edge = this.edges[i2]; if (this.isOneAncestorOfOther(edge.source, edge.target)) { return true; @@ -188821,9 +121404,11 @@ g.stateGroup line { /* 7 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LayoutConstants = __webpack_require__(0); function FDLayoutConstants() { } + __name(FDLayoutConstants, "FDLayoutConstants"); for (var prop in LayoutConstants) { FDLayoutConstants[prop] = LayoutConstants[prop]; } @@ -188853,9 +121438,11 @@ g.stateGroup line { /* 8 */ /***/ function(module3, exports3, __webpack_require__) { - var Point2 = __webpack_require__(12); + "use strict"; + var Point3 = __webpack_require__(12); function IGeometry() { } + __name(IGeometry, "IGeometry"); IGeometry.calcSeparationAmount = function(rectA, rectB, overlapAmount, separationBuffer) { if (!rectA.intersects(rectB)) { throw "assert failed"; @@ -188943,8 +121530,8 @@ g.stateGroup line { result[2] = p2x; result[3] = topLeftBy; return false; - } else - ; + } else { + } } else if (p1y === p2y) { if (p1x > p2x) { result[0] = topLeftAx; @@ -188958,8 +121545,8 @@ g.stateGroup line { result[2] = topLeftBx; result[3] = p2y; return false; - } else - ; + } else { + } } else { var slopeA = rectA.height / rectA.width; var slopeB = rectB.height / rectB.width; @@ -189098,34 +121685,34 @@ g.stateGroup line { return 1 + line2 % 4; } }; - IGeometry.getIntersection = function(s1, s2, f1, f2) { - if (f2 == null) { + IGeometry.getIntersection = function(s1, s2, f1, f22) { + if (f22 == null) { return this.getIntersection2(s1, s2, f1); } var x1 = s1.x; var y1 = s1.y; - var x2 = s2.x; - var y2 = s2.y; - var x3 = f1.x; - var y3 = f1.y; - var x4 = f2.x; - var y4 = f2.y; + var x22 = s2.x; + var y22 = s2.y; + var x32 = f1.x; + var y32 = f1.y; + var x42 = f22.x; + var y42 = f22.y; var x5 = void 0, y5 = void 0; - var a1 = void 0, a2 = void 0, b1 = void 0, b2 = void 0, c1 = void 0, c2 = void 0; + var a1 = void 0, a2 = void 0, b1 = void 0, b2 = void 0, c1 = void 0, c22 = void 0; var denom = void 0; - a1 = y2 - y1; - b1 = x1 - x2; - c1 = x2 * y1 - x1 * y2; - a2 = y4 - y3; - b2 = x3 - x4; - c2 = x4 * y3 - x3 * y4; + a1 = y22 - y1; + b1 = x1 - x22; + c1 = x22 * y1 - x1 * y22; + a2 = y42 - y32; + b2 = x32 - x42; + c22 = x42 * y32 - x32 * y42; denom = a1 * b2 - a2 * b1; if (denom === 0) { return null; } - x5 = (b1 * c2 - b2 * c1) / denom; - y5 = (a2 * c1 - a1 * c2) / denom; - return new Point2(x5, y5); + x5 = (b1 * c22 - b2 * c1) / denom; + y5 = (a2 * c1 - a1 * c22) / denom; + return new Point3(x5, y5); }; IGeometry.angleOfVector = function(Cx, Cy, Nx, Ny) { var C_angle = void 0; @@ -189143,21 +121730,21 @@ g.stateGroup line { } return C_angle; }; - IGeometry.doIntersect = function(p1, p2, p3, p4) { - var a = p1.x; - var b = p1.y; - var c2 = p2.x; - var d = p2.y; - var p = p3.x; - var q = p3.y; - var r = p4.x; - var s = p4.y; - var det = (c2 - a) * (s - q) - (r - p) * (d - b); + IGeometry.doIntersect = function(p1, p22, p3, p4) { + var a2 = p1.x; + var b2 = p1.y; + var c3 = p22.x; + var d2 = p22.y; + var p5 = p3.x; + var q2 = p3.y; + var r2 = p4.x; + var s2 = p4.y; + var det = (c3 - a2) * (s2 - q2) - (r2 - p5) * (d2 - b2); if (det === 0) { return false; } else { - var lambda = ((s - q) * (r - a) + (p - r) * (s - b)) / det; - var gamma2 = ((b - d) * (r - a) + (c2 - a) * (s - b)) / det; + var lambda = ((s2 - q2) * (r2 - a2) + (p5 - r2) * (s2 - b2)) / det; + var gamma2 = ((b2 - d2) * (r2 - a2) + (c3 - a2) * (s2 - b2)) / det; return 0 < lambda && lambda < 1 && 0 < gamma2 && gamma2 < 1; } }; @@ -189170,8 +121757,10 @@ g.stateGroup line { /* 9 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function IMath() { } + __name(IMath, "IMath"); IMath.sign = function(value2) { if (value2 > 0) { return 1; @@ -189192,8 +121781,10 @@ g.stateGroup line { /* 10 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function Integer() { } + __name(Integer, "Integer"); Integer.MAX_VALUE = 2147483647; Integer.MIN_VALUE = -2147483648; module3.exports = Integer; @@ -189201,164 +121792,165 @@ g.stateGroup line { /* 11 */ /***/ function(module3, exports3, __webpack_require__) { - var _createClass = function() { + "use strict"; + var _createClass2 = /* @__PURE__ */ function() { function defineProperties(target, props) { for (var i2 = 0; i2 < props.length; i2++) { var descriptor = props[i2]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; + if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + __name(defineProperties, "defineProperties"); return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _classCallCheck(instance2, Constructor) { + function _classCallCheck2(instance2, Constructor) { if (!(instance2 instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var nodeFrom = function nodeFrom2(value2) { + __name(_classCallCheck2, "_classCallCheck"); + var nodeFrom = /* @__PURE__ */ __name(function nodeFrom2(value2) { return { value: value2, next: null, prev: null }; - }; - var add = function add2(prev2, node2, next2, list2) { + }, "nodeFrom"); + var add3 = /* @__PURE__ */ __name(function add4(prev2, node2, next3, list2) { if (prev2 !== null) { prev2.next = node2; } else { list2.head = node2; } - if (next2 !== null) { - next2.prev = node2; + if (next3 !== null) { + next3.prev = node2; } else { list2.tail = node2; } node2.prev = prev2; - node2.next = next2; + node2.next = next3; list2.length++; return node2; - }; - var _remove = function _remove2(node2, list2) { - var prev2 = node2.prev, next2 = node2.next; + }, "add"); + var _remove = /* @__PURE__ */ __name(function _remove2(node2, list2) { + var prev2 = node2.prev, next3 = node2.next; if (prev2 !== null) { - prev2.next = next2; + prev2.next = next3; } else { - list2.head = next2; + list2.head = next3; } - if (next2 !== null) { - next2.prev = prev2; + if (next3 !== null) { + next3.prev = prev2; } else { list2.tail = prev2; } node2.prev = node2.next = null; list2.length--; return node2; - }; + }, "_remove"); var LinkedList = function() { function LinkedList2(vals) { var _this = this; - _classCallCheck(this, LinkedList2); + _classCallCheck2(this, LinkedList2); this.length = 0; this.head = null; this.tail = null; if (vals != null) { - vals.forEach(function(v) { - return _this.push(v); + vals.forEach(function(v3) { + return _this.push(v3); }); } } - _createClass(LinkedList2, [{ + __name(LinkedList2, "LinkedList"); + _createClass2(LinkedList2, [{ key: "size", - value: function size2() { + value: /* @__PURE__ */ __name(function size5() { return this.length; - } + }, "size") }, { key: "insertBefore", - value: function insertBefore(val, otherNode) { - return add(otherNode.prev, nodeFrom(val), otherNode, this); - } + value: /* @__PURE__ */ __name(function insertBefore(val, otherNode) { + return add3(otherNode.prev, nodeFrom(val), otherNode, this); + }, "insertBefore") }, { key: "insertAfter", - value: function insertAfter(val, otherNode) { - return add(otherNode, nodeFrom(val), otherNode.next, this); - } + value: /* @__PURE__ */ __name(function insertAfter(val, otherNode) { + return add3(otherNode, nodeFrom(val), otherNode.next, this); + }, "insertAfter") }, { key: "insertNodeBefore", - value: function insertNodeBefore(newNode, otherNode) { - return add(otherNode.prev, newNode, otherNode, this); - } + value: /* @__PURE__ */ __name(function insertNodeBefore(newNode, otherNode) { + return add3(otherNode.prev, newNode, otherNode, this); + }, "insertNodeBefore") }, { key: "insertNodeAfter", - value: function insertNodeAfter(newNode, otherNode) { - return add(otherNode, newNode, otherNode.next, this); - } + value: /* @__PURE__ */ __name(function insertNodeAfter(newNode, otherNode) { + return add3(otherNode, newNode, otherNode.next, this); + }, "insertNodeAfter") }, { key: "push", - value: function push2(val) { - return add(this.tail, nodeFrom(val), null, this); - } + value: /* @__PURE__ */ __name(function push3(val) { + return add3(this.tail, nodeFrom(val), null, this); + }, "push") }, { key: "unshift", - value: function unshift(val) { - return add(null, nodeFrom(val), this.head, this); - } + value: /* @__PURE__ */ __name(function unshift(val) { + return add3(null, nodeFrom(val), this.head, this); + }, "unshift") }, { key: "remove", - value: function remove2(node2) { + value: /* @__PURE__ */ __name(function remove3(node2) { return _remove(node2, this); - } + }, "remove") }, { key: "pop", - value: function pop() { + value: /* @__PURE__ */ __name(function pop() { return _remove(this.tail, this).value; - } + }, "pop") }, { key: "popNode", - value: function popNode() { + value: /* @__PURE__ */ __name(function popNode() { return _remove(this.tail, this); - } + }, "popNode") }, { key: "shift", - value: function shift() { + value: /* @__PURE__ */ __name(function shift2() { return _remove(this.head, this).value; - } + }, "shift") }, { key: "shiftNode", - value: function shiftNode() { + value: /* @__PURE__ */ __name(function shiftNode() { return _remove(this.head, this); - } + }, "shiftNode") }, { key: "get_object_at", - value: function get_object_at(index2) { - if (index2 <= this.length()) { + value: /* @__PURE__ */ __name(function get_object_at(index) { + if (index <= this.length()) { var i2 = 1; var current = this.head; - while (i2 < index2) { + while (i2 < index) { current = current.next; i2++; } return current.value; } - } + }, "get_object_at") }, { key: "set_object_at", - value: function set_object_at(index2, value2) { - if (index2 <= this.length()) { + value: /* @__PURE__ */ __name(function set_object_at(index, value2) { + if (index <= this.length()) { var i2 = 1; var current = this.head; - while (i2 < index2) { + while (i2 < index) { current = current.next; i2++; } current.value = value2; } - } + }, "set_object_at") }]); return LinkedList2; }(); @@ -189367,101 +121959,105 @@ g.stateGroup line { /* 12 */ /***/ function(module3, exports3, __webpack_require__) { - function Point2(x2, y2, p) { + "use strict"; + function Point3(x5, y5, p3) { this.x = null; this.y = null; - if (x2 == null && y2 == null && p == null) { + if (x5 == null && y5 == null && p3 == null) { this.x = 0; this.y = 0; - } else if (typeof x2 == "number" && typeof y2 == "number" && p == null) { - this.x = x2; - this.y = y2; - } else if (x2.constructor.name == "Point" && y2 == null && p == null) { - p = x2; - this.x = p.x; - this.y = p.y; + } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) { + this.x = x5; + this.y = y5; + } else if (x5.constructor.name == "Point" && y5 == null && p3 == null) { + p3 = x5; + this.x = p3.x; + this.y = p3.y; } } - Point2.prototype.getX = function() { + __name(Point3, "Point"); + Point3.prototype.getX = function() { return this.x; }; - Point2.prototype.getY = function() { + Point3.prototype.getY = function() { return this.y; }; - Point2.prototype.getLocation = function() { - return new Point2(this.x, this.y); + Point3.prototype.getLocation = function() { + return new Point3(this.x, this.y); }; - Point2.prototype.setLocation = function(x2, y2, p) { - if (x2.constructor.name == "Point" && y2 == null && p == null) { - p = x2; - this.setLocation(p.x, p.y); - } else if (typeof x2 == "number" && typeof y2 == "number" && p == null) { - if (parseInt(x2) == x2 && parseInt(y2) == y2) { - this.move(x2, y2); + Point3.prototype.setLocation = function(x5, y5, p3) { + if (x5.constructor.name == "Point" && y5 == null && p3 == null) { + p3 = x5; + this.setLocation(p3.x, p3.y); + } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) { + if (parseInt(x5) == x5 && parseInt(y5) == y5) { + this.move(x5, y5); } else { - this.x = Math.floor(x2 + 0.5); - this.y = Math.floor(y2 + 0.5); + this.x = Math.floor(x5 + 0.5); + this.y = Math.floor(y5 + 0.5); } } }; - Point2.prototype.move = function(x2, y2) { - this.x = x2; - this.y = y2; + Point3.prototype.move = function(x5, y5) { + this.x = x5; + this.y = y5; }; - Point2.prototype.translate = function(dx, dy) { + Point3.prototype.translate = function(dx, dy) { this.x += dx; this.y += dy; }; - Point2.prototype.equals = function(obj) { + Point3.prototype.equals = function(obj) { if (obj.constructor.name == "Point") { var pt = obj; return this.x == pt.x && this.y == pt.y; } return this == obj; }; - Point2.prototype.toString = function() { - return new Point2().constructor.name + "[x=" + this.x + ",y=" + this.y + "]"; + Point3.prototype.toString = function() { + return new Point3().constructor.name + "[x=" + this.x + ",y=" + this.y + "]"; }; - module3.exports = Point2; + module3.exports = Point3; }, /* 13 */ /***/ function(module3, exports3, __webpack_require__) { - function RectangleD(x2, y2, width2, height) { + "use strict"; + function RectangleD(x5, y5, width3, height2) { this.x = 0; this.y = 0; this.width = 0; this.height = 0; - if (x2 != null && y2 != null && width2 != null && height != null) { - this.x = x2; - this.y = y2; - this.width = width2; - this.height = height; + if (x5 != null && y5 != null && width3 != null && height2 != null) { + this.x = x5; + this.y = y5; + this.width = width3; + this.height = height2; } } + __name(RectangleD, "RectangleD"); RectangleD.prototype.getX = function() { return this.x; }; - RectangleD.prototype.setX = function(x2) { - this.x = x2; + RectangleD.prototype.setX = function(x5) { + this.x = x5; }; RectangleD.prototype.getY = function() { return this.y; }; - RectangleD.prototype.setY = function(y2) { - this.y = y2; + RectangleD.prototype.setY = function(y5) { + this.y = y5; }; RectangleD.prototype.getWidth = function() { return this.width; }; - RectangleD.prototype.setWidth = function(width2) { - this.width = width2; + RectangleD.prototype.setWidth = function(width3) { + this.width = width3; }; RectangleD.prototype.getHeight = function() { return this.height; }; - RectangleD.prototype.setHeight = function(height) { - this.height = height; + RectangleD.prototype.setHeight = function(height2) { + this.height = height2; }; RectangleD.prototype.getRight = function() { return this.x + this.width; @@ -189469,17 +122065,17 @@ g.stateGroup line { RectangleD.prototype.getBottom = function() { return this.y + this.height; }; - RectangleD.prototype.intersects = function(a) { - if (this.getRight() < a.x) { + RectangleD.prototype.intersects = function(a2) { + if (this.getRight() < a2.x) { return false; } - if (this.getBottom() < a.y) { + if (this.getBottom() < a2.y) { return false; } - if (a.getRight() < this.x) { + if (a2.getRight() < this.x) { return false; } - if (a.getBottom() < this.y) { + if (a2.getBottom() < this.y) { return false; } return true; @@ -189513,13 +122109,15 @@ g.stateGroup line { /* 14 */ /***/ function(module3, exports3, __webpack_require__) { - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { + "use strict"; + var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { return typeof obj; } : function(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; function UniqueIDGeneretor() { } + __name(UniqueIDGeneretor, "UniqueIDGeneretor"); UniqueIDGeneretor.lastID = 0; UniqueIDGeneretor.createID = function(obj) { if (UniqueIDGeneretor.isPrimitive(obj)) { @@ -189532,20 +122130,20 @@ g.stateGroup line { UniqueIDGeneretor.lastID++; return obj.uniqueID; }; - UniqueIDGeneretor.getString = function(id2) { - if (id2 == null) - id2 = UniqueIDGeneretor.lastID; - return "Object#" + id2; + UniqueIDGeneretor.getString = function(id26) { + if (id26 == null) id26 = UniqueIDGeneretor.lastID; + return "Object#" + id26; }; UniqueIDGeneretor.isPrimitive = function(arg) { - var type2 = typeof arg === "undefined" ? "undefined" : _typeof(arg); - return arg == null || type2 != "object" && type2 != "function"; + var type3 = typeof arg === "undefined" ? "undefined" : _typeof2(arg); + return arg == null || type3 != "object" && type3 != "function"; }; module3.exports = UniqueIDGeneretor; }, /* 15 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { @@ -189556,6 +122154,7 @@ g.stateGroup line { return Array.from(arr); } } + __name(_toConsumableArray, "_toConsumableArray"); var LayoutConstants = __webpack_require__(0); var LGraphManager = __webpack_require__(6); var LNode = __webpack_require__(3); @@ -189563,9 +122162,9 @@ g.stateGroup line { var LGraph = __webpack_require__(5); var PointD = __webpack_require__(4); var Transform2 = __webpack_require__(17); - var Emitter = __webpack_require__(27); + var Emitter3 = __webpack_require__(27); function Layout2(isRemoteUse) { - Emitter.call(this); + Emitter3.call(this); this.layoutQuality = LayoutConstants.QUALITY; this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; this.incremental = LayoutConstants.DEFAULT_INCREMENTAL; @@ -189582,8 +122181,9 @@ g.stateGroup line { this.isRemoteUse = isRemoteUse; } } + __name(Layout2, "Layout"); Layout2.RANDOM_SEED = 1; - Layout2.prototype = Object.create(Emitter.prototype); + Layout2.prototype = Object.create(Emitter3.prototype); Layout2.prototype.getGraphManager = function() { return this.graphManager; }; @@ -189651,13 +122251,15 @@ g.stateGroup line { this.graphManager.resetAllEdges(); } if (!this.isRemoteUse) { + var edge; var allEdges = this.graphManager.getAllEdges(); for (var i2 = 0; i2 < allEdges.length; i2++) { - allEdges[i2]; + edge = allEdges[i2]; } - var nodes2 = this.graphManager.getRoot().getNodes(); - for (var i2 = 0; i2 < nodes2.length; i2++) { - nodes2[i2]; + var node2; + var nodes6 = this.graphManager.getRoot().getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; } this.update(this.graphManager.getRoot()); } @@ -189668,9 +122270,9 @@ g.stateGroup line { } else if (obj instanceof LNode) { var node2 = obj; if (node2.getChild() != null) { - var nodes2 = node2.getChild().getNodes(); - for (var i2 = 0; i2 < nodes2.length; i2++) { - update(nodes2[i2]); + var nodes6 = node2.getChild().getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + update(nodes6[i2]); } } if (node2.vGraphObject != null) { @@ -189716,10 +122318,10 @@ g.stateGroup line { trans.setWorldOrgY(newLeftTop.y); trans.setDeviceOrgX(leftTop.x); trans.setDeviceOrgY(leftTop.y); - var nodes2 = this.getAllNodes(); + var nodes6 = this.getAllNodes(); var node2; - for (var i2 = 0; i2 < nodes2.length; i2++) { - node2 = nodes2[i2]; + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; node2.transform(trans); } } @@ -189732,9 +122334,9 @@ g.stateGroup line { } else { var lNode; var childGraph; - var nodes2 = graph.getNodes(); - for (var i2 = 0; i2 < nodes2.length; i2++) { - lNode = nodes2[i2]; + var nodes6 = graph.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + lNode = nodes6[i2]; childGraph = lNode.getChild(); if (childGraph == null) { lNode.scatter(); @@ -189762,7 +122364,7 @@ g.stateGroup line { } var visited = /* @__PURE__ */ new Set(); var toBeVisited = []; - var parents2 = /* @__PURE__ */ new Map(); + var parents4 = /* @__PURE__ */ new Map(); var unProcessedNodes = []; unProcessedNodes = unProcessedNodes.concat(allNodes); while (unProcessedNodes.length > 0 && isForest) { @@ -189774,10 +122376,10 @@ g.stateGroup line { var neighborEdges = currentNode.getEdges(); for (var i2 = 0; i2 < neighborEdges.length; i2++) { var currentNeighbor = neighborEdges[i2].getOtherEnd(currentNode); - if (parents2.get(currentNode) != currentNeighbor) { + if (parents4.get(currentNode) != currentNeighbor) { if (!visited.has(currentNeighbor)) { toBeVisited.push(currentNeighbor); - parents2.set(currentNeighbor, currentNode); + parents4.set(currentNeighbor, currentNode); } else { isForest = false; break; @@ -189792,13 +122394,13 @@ g.stateGroup line { flatForest.push(temp); for (var i2 = 0; i2 < temp.length; i2++) { var value2 = temp[i2]; - var index2 = unProcessedNodes.indexOf(value2); - if (index2 > -1) { - unProcessedNodes.splice(index2, 1); + var index = unProcessedNodes.indexOf(value2); + if (index > -1) { + unProcessedNodes.splice(index, 1); } } visited = /* @__PURE__ */ new Set(); - parents2 = /* @__PURE__ */ new Map(); + parents4 = /* @__PURE__ */ new Map(); } } return flatForest; @@ -189827,19 +122429,19 @@ g.stateGroup line { return dummyNodes; }; Layout2.prototype.createBendpointsFromDummyNodes = function() { - var edges2 = []; - edges2 = edges2.concat(this.graphManager.getAllEdges()); - edges2 = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges2); - for (var k = 0; k < edges2.length; k++) { - var lEdge = edges2[k]; + var edges5 = []; + edges5 = edges5.concat(this.graphManager.getAllEdges()); + edges5 = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges5); + for (var k2 = 0; k2 < edges5.length; k2++) { + var lEdge = edges5[k2]; if (lEdge.bendpoints.length > 0) { - var path2 = this.edgeToDummyNodes.get(lEdge); - for (var i2 = 0; i2 < path2.length; i2++) { - var dummyNode = path2[i2]; - var p = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY()); + var path4 = this.edgeToDummyNodes.get(lEdge); + for (var i2 = 0; i2 < path4.length; i2++) { + var dummyNode = path4[i2]; + var p3 = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY()); var ebp = lEdge.bendpoints.get(i2); - ebp.x = p.x; - ebp.y = p.y; + ebp.x = p3.x; + ebp.y = p3.y; dummyNode.getOwner().remove(dummyNode); } this.graphManager.add(lEdge, lEdge.source, lEdge.target); @@ -189858,20 +122460,20 @@ g.stateGroup line { } return value2; } else { - var a, b; + var a2, b2; if (sliderValue <= 50) { - a = 9 * defaultValue / 500; - b = defaultValue / 10; + a2 = 9 * defaultValue / 500; + b2 = defaultValue / 10; } else { - a = 9 * defaultValue / 50; - b = -8 * defaultValue; + a2 = 9 * defaultValue / 50; + b2 = -8 * defaultValue; } - return a * sliderValue + b; + return a2 * sliderValue + b2; } }; - Layout2.findCenterOfTree = function(nodes2) { + Layout2.findCenterOfTree = function(nodes6) { var list2 = []; - list2 = list2.concat(nodes2); + list2 = list2.concat(nodes6); var removedNodes = []; var remainingDegrees = /* @__PURE__ */ new Map(); var foundCenter = false; @@ -189896,9 +122498,9 @@ g.stateGroup line { tempList = []; for (var i2 = 0; i2 < list2.length; i2++) { var node2 = list2[i2]; - var index2 = list2.indexOf(node2); - if (index2 >= 0) { - list2.splice(index2, 1); + var index = list2.indexOf(node2); + if (index >= 0) { + list2.splice(index, 1); } var neighbours = node2.getNeighborsList(); neighbours.forEach(function(neighbour) { @@ -189928,8 +122530,10 @@ g.stateGroup line { /* 16 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function RandomSeed() { } + __name(RandomSeed, "RandomSeed"); RandomSeed.seed = 1; RandomSeed.x = 0; RandomSeed.nextDouble = function() { @@ -189941,8 +122545,9 @@ g.stateGroup line { /* 17 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var PointD = __webpack_require__(4); - function Transform2(x2, y2) { + function Transform2(x5, y5) { this.lworldOrgX = 0; this.lworldOrgY = 0; this.ldeviceOrgX = 0; @@ -189952,6 +122557,7 @@ g.stateGroup line { this.ldeviceExtX = 1; this.ldeviceExtY = 1; } + __name(Transform2, "Transform"); Transform2.prototype.getWorldOrgX = function() { return this.lworldOrgX; }; @@ -190000,35 +122606,35 @@ g.stateGroup line { Transform2.prototype.setDeviceExtY = function(dey) { this.ldeviceExtY = dey; }; - Transform2.prototype.transformX = function(x2) { + Transform2.prototype.transformX = function(x5) { var xDevice = 0; var worldExtX = this.lworldExtX; if (worldExtX != 0) { - xDevice = this.ldeviceOrgX + (x2 - this.lworldOrgX) * this.ldeviceExtX / worldExtX; + xDevice = this.ldeviceOrgX + (x5 - this.lworldOrgX) * this.ldeviceExtX / worldExtX; } return xDevice; }; - Transform2.prototype.transformY = function(y2) { + Transform2.prototype.transformY = function(y5) { var yDevice = 0; var worldExtY = this.lworldExtY; if (worldExtY != 0) { - yDevice = this.ldeviceOrgY + (y2 - this.lworldOrgY) * this.ldeviceExtY / worldExtY; + yDevice = this.ldeviceOrgY + (y5 - this.lworldOrgY) * this.ldeviceExtY / worldExtY; } return yDevice; }; - Transform2.prototype.inverseTransformX = function(x2) { + Transform2.prototype.inverseTransformX = function(x5) { var xWorld = 0; var deviceExtX = this.ldeviceExtX; if (deviceExtX != 0) { - xWorld = this.lworldOrgX + (x2 - this.ldeviceOrgX) * this.lworldExtX / deviceExtX; + xWorld = this.lworldOrgX + (x5 - this.ldeviceOrgX) * this.lworldExtX / deviceExtX; } return xWorld; }; - Transform2.prototype.inverseTransformY = function(y2) { + Transform2.prototype.inverseTransformY = function(y5) { var yWorld = 0; var deviceExtY = this.ldeviceExtY; if (deviceExtY != 0) { - yWorld = this.lworldOrgY + (y2 - this.ldeviceOrgY) * this.lworldExtY / deviceExtY; + yWorld = this.lworldOrgY + (y5 - this.ldeviceOrgY) * this.lworldExtY / deviceExtY; } return yWorld; }; @@ -190041,6 +122647,7 @@ g.stateGroup line { /* 18 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { @@ -190051,6 +122658,7 @@ g.stateGroup line { return Array.from(arr); } } + __name(_toConsumableArray, "_toConsumableArray"); var Layout2 = __webpack_require__(15); var FDLayoutConstants = __webpack_require__(7); var LayoutConstants = __webpack_require__(0); @@ -190073,6 +122681,7 @@ g.stateGroup line { this.oldTotalDisplacement = 0; this.maxIterations = FDLayoutConstants.MAX_ITERATIONS; } + __name(FDLayout, "FDLayout"); FDLayout.prototype = Object.create(Layout2.prototype); for (var prop in Layout2) { FDLayout[prop] = Layout2[prop]; @@ -190109,15 +122718,15 @@ g.stateGroup line { } }; FDLayout.prototype.initSpringEmbedder = function() { - var s = this.getAllNodes().length; + var s2 = this.getAllNodes().length; if (this.incremental) { - if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) { - this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR)); + if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) { + this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR)); } this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL; } else { - if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) { - this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1 - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR)); + if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) { + this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1 - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR)); } else { this.coolingFactor = 1; } @@ -190139,7 +122748,7 @@ g.stateGroup line { FDLayout.prototype.calcRepulsionForces = function() { var gridUpdateAllowed = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; var forceToNodeSurroundingUpdate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - var i2, j; + var i2, j2; var nodeA, nodeB; var lNodes = this.getAllNodes(); var processedNodeSet; @@ -190156,8 +122765,8 @@ g.stateGroup line { } else { for (i2 = 0; i2 < lNodes.length; i2++) { nodeA = lNodes[i2]; - for (j = i2 + 1; j < lNodes.length; j++) { - nodeB = lNodes[j]; + for (j2 = i2 + 1; j2 < lNodes.length; j2++) { + nodeB = lNodes[j2]; if (nodeA.getOwner() != nodeB.getOwner()) { continue; } @@ -190198,8 +122807,7 @@ g.stateGroup line { } } length2 = edge.getLength(); - if (length2 == 0) - return; + if (length2 == 0) return; springForce = this.springConstant * (length2 - idealLength); springForceX = springForce * (edge.lengthX / length2); springForceY = springForce * (edge.lengthY / length2); @@ -190323,25 +122931,25 @@ g.stateGroup line { grid[i2] = new Array(sizeY); } for (var i2 = 0; i2 < sizeX; i2++) { - for (var j = 0; j < sizeY; j++) { - grid[i2][j] = new Array(); + for (var j2 = 0; j2 < sizeY; j2++) { + grid[i2][j2] = new Array(); } } return grid; }; - FDLayout.prototype.addNodeToGrid = function(v, left2, top2) { - var startX = 0; + FDLayout.prototype.addNodeToGrid = function(v3, left3, top2) { + var startX2 = 0; var finishX = 0; - var startY = 0; + var startY2 = 0; var finishY = 0; - startX = parseInt(Math.floor((v.getRect().x - left2) / this.repulsionRange)); - finishX = parseInt(Math.floor((v.getRect().width + v.getRect().x - left2) / this.repulsionRange)); - startY = parseInt(Math.floor((v.getRect().y - top2) / this.repulsionRange)); - finishY = parseInt(Math.floor((v.getRect().height + v.getRect().y - top2) / this.repulsionRange)); - for (var i2 = startX; i2 <= finishX; i2++) { - for (var j = startY; j <= finishY; j++) { - this.grid[i2][j].push(v); - v.setGridCoordinates(startX, finishX, startY, finishY); + startX2 = parseInt(Math.floor((v3.getRect().x - left3) / this.repulsionRange)); + finishX = parseInt(Math.floor((v3.getRect().width + v3.getRect().x - left3) / this.repulsionRange)); + startY2 = parseInt(Math.floor((v3.getRect().y - top2) / this.repulsionRange)); + finishY = parseInt(Math.floor((v3.getRect().height + v3.getRect().y - top2) / this.repulsionRange)); + for (var i2 = startX2; i2 <= finishX; i2++) { + for (var j2 = startY2; j2 <= finishY; j2++) { + this.grid[i2][j2].push(v3); + v3.setGridCoordinates(startX2, finishX, startY2, finishY); } } }; @@ -190362,10 +122970,10 @@ g.stateGroup line { var nodeB; var grid = this.grid; for (var i2 = nodeA.startX - 1; i2 < nodeA.finishX + 2; i2++) { - for (var j = nodeA.startY - 1; j < nodeA.finishY + 2; j++) { - if (!(i2 < 0 || j < 0 || i2 >= grid.length || j >= grid[0].length)) { - for (var k = 0; k < grid[i2][j].length; k++) { - nodeB = grid[i2][j][k]; + for (var j2 = nodeA.startY - 1; j2 < nodeA.finishY + 2; j2++) { + if (!(i2 < 0 || j2 < 0 || i2 >= grid.length || j2 >= grid[0].length)) { + for (var k2 = 0; k2 < grid[i2][j2].length; k2++) { + nodeB = grid[i2][j2][k2]; if (nodeA.getOwner() != nodeB.getOwner() || nodeA == nodeB) { continue; } @@ -190394,12 +123002,14 @@ g.stateGroup line { /* 19 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LEdge = __webpack_require__(1); var FDLayoutConstants = __webpack_require__(7); function FDLayoutEdge(source, target, vEdge) { LEdge.call(this, source, target, vEdge); this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH; } + __name(FDLayoutEdge, "FDLayoutEdge"); FDLayoutEdge.prototype = Object.create(LEdge.prototype); for (var prop in LEdge) { FDLayoutEdge[prop] = LEdge[prop]; @@ -190409,9 +123019,10 @@ g.stateGroup line { /* 20 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LNode = __webpack_require__(3); - function FDLayoutNode(gm, loc, size2, vNode) { - LNode.call(this, gm, loc, size2, vNode); + function FDLayoutNode(gm, loc, size5, vNode) { + LNode.call(this, gm, loc, size5, vNode); this.springForceX = 0; this.springForceY = 0; this.repulsionForceX = 0; @@ -190426,6 +123037,7 @@ g.stateGroup line { this.finishY = 0; this.surrounding = []; } + __name(FDLayoutNode, "FDLayoutNode"); FDLayoutNode.prototype = Object.create(LNode.prototype); for (var prop in LNode) { FDLayoutNode[prop] = LNode[prop]; @@ -190441,36 +123053,40 @@ g.stateGroup line { /* 21 */ /***/ function(module3, exports3, __webpack_require__) { - function DimensionD2(width2, height) { + "use strict"; + function DimensionD2(width3, height2) { this.width = 0; this.height = 0; - if (width2 !== null && height !== null) { - this.height = height; - this.width = width2; + if (width3 !== null && height2 !== null) { + this.height = height2; + this.width = width3; } } + __name(DimensionD2, "DimensionD"); DimensionD2.prototype.getWidth = function() { return this.width; }; - DimensionD2.prototype.setWidth = function(width2) { - this.width = width2; + DimensionD2.prototype.setWidth = function(width3) { + this.width = width3; }; DimensionD2.prototype.getHeight = function() { return this.height; }; - DimensionD2.prototype.setHeight = function(height) { - this.height = height; + DimensionD2.prototype.setHeight = function(height2) { + this.height = height2; }; module3.exports = DimensionD2; }, /* 22 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var UniqueIDGeneretor = __webpack_require__(14); function HashMap() { this.map = {}; this.keys = []; } + __name(HashMap, "HashMap"); HashMap.prototype.put = function(key, value2) { var theId = UniqueIDGeneretor.createID(key); if (!this.contains(theId)) { @@ -190479,7 +123095,7 @@ g.stateGroup line { } }; HashMap.prototype.contains = function(key) { - UniqueIDGeneretor.createID(key); + var theId = UniqueIDGeneretor.createID(key); return this.map[key] != null; }; HashMap.prototype.get = function(key) { @@ -190494,14 +123110,16 @@ g.stateGroup line { /* 23 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var UniqueIDGeneretor = __webpack_require__(14); function HashSet() { this.set = {}; } + __name(HashSet, "HashSet"); + ; HashSet.prototype.add = function(obj) { var theId = UniqueIDGeneretor.createID(obj); - if (!this.contains(theId)) - this.set[theId] = obj; + if (!this.contains(theId)) this.set[theId] = obj; }; HashSet.prototype.remove = function(obj) { delete this.set[UniqueIDGeneretor.createID(obj)]; @@ -190519,20 +123137,20 @@ g.stateGroup line { return Object.keys(this.set).length; }; HashSet.prototype.addAllTo = function(list2) { - var keys2 = Object.keys(this.set); - var length2 = keys2.length; + var keys3 = Object.keys(this.set); + var length2 = keys3.length; for (var i2 = 0; i2 < length2; i2++) { - list2.push(this.set[keys2[i2]]); + list2.push(this.set[keys3[i2]]); } }; HashSet.prototype.size = function() { return Object.keys(this.set).length; }; HashSet.prototype.addAll = function(list2) { - var s = list2.length; - for (var i2 = 0; i2 < s; i2++) { - var v = list2[i2]; - this.add(v); + var s2 = list2.length; + for (var i2 = 0; i2 < s2; i2++) { + var v3 = list2[i2]; + this.add(v3); } }; module3.exports = HashSet; @@ -190540,101 +123158,94 @@ g.stateGroup line { /* 24 */ /***/ function(module3, exports3, __webpack_require__) { - var _createClass = function() { + "use strict"; + var _createClass2 = /* @__PURE__ */ function() { function defineProperties(target, props) { for (var i2 = 0; i2 < props.length; i2++) { var descriptor = props[i2]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; + if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + __name(defineProperties, "defineProperties"); return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _classCallCheck(instance2, Constructor) { + function _classCallCheck2(instance2, Constructor) { if (!(instance2 instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + __name(_classCallCheck2, "_classCallCheck"); var LinkedList = __webpack_require__(11); var Quicksort = function() { - function Quicksort2(A, compareFunction) { - _classCallCheck(this, Quicksort2); - if (compareFunction !== null || compareFunction !== void 0) - this.compareFunction = this._defaultCompareFunction; + function Quicksort2(A2, compareFunction) { + _classCallCheck2(this, Quicksort2); + if (compareFunction !== null || compareFunction !== void 0) this.compareFunction = this._defaultCompareFunction; var length2 = void 0; - if (A instanceof LinkedList) - length2 = A.size(); - else - length2 = A.length; - this._quicksort(A, 0, length2 - 1); + if (A2 instanceof LinkedList) length2 = A2.size(); + else length2 = A2.length; + this._quicksort(A2, 0, length2 - 1); } - _createClass(Quicksort2, [{ + __name(Quicksort2, "Quicksort"); + _createClass2(Quicksort2, [{ key: "_quicksort", - value: function _quicksort(A, p, r) { - if (p < r) { - var q = this._partition(A, p, r); - this._quicksort(A, p, q); - this._quicksort(A, q + 1, r); + value: /* @__PURE__ */ __name(function _quicksort(A2, p3, r2) { + if (p3 < r2) { + var q2 = this._partition(A2, p3, r2); + this._quicksort(A2, p3, q2); + this._quicksort(A2, q2 + 1, r2); } - } + }, "_quicksort") }, { key: "_partition", - value: function _partition(A, p, r) { - var x2 = this._get(A, p); - var i2 = p; - var j = r; + value: /* @__PURE__ */ __name(function _partition(A2, p3, r2) { + var x5 = this._get(A2, p3); + var i2 = p3; + var j2 = r2; while (true) { - while (this.compareFunction(x2, this._get(A, j))) { - j--; + while (this.compareFunction(x5, this._get(A2, j2))) { + j2--; } - while (this.compareFunction(this._get(A, i2), x2)) { + while (this.compareFunction(this._get(A2, i2), x5)) { i2++; } - if (i2 < j) { - this._swap(A, i2, j); + if (i2 < j2) { + this._swap(A2, i2, j2); i2++; - j--; - } else - return j; + j2--; + } else return j2; } - } + }, "_partition") }, { key: "_get", - value: function _get(object2, index2) { - if (object2 instanceof LinkedList) - return object2.get_object_at(index2); - else - return object2[index2]; - } + value: /* @__PURE__ */ __name(function _get(object3, index) { + if (object3 instanceof LinkedList) return object3.get_object_at(index); + else return object3[index]; + }, "_get") }, { key: "_set", - value: function _set(object2, index2, value2) { - if (object2 instanceof LinkedList) - object2.set_object_at(index2, value2); - else - object2[index2] = value2; - } + value: /* @__PURE__ */ __name(function _set(object3, index, value2) { + if (object3 instanceof LinkedList) object3.set_object_at(index, value2); + else object3[index] = value2; + }, "_set") }, { key: "_swap", - value: function _swap(A, i2, j) { - var temp = this._get(A, i2); - this._set(A, i2, this._get(A, j)); - this._set(A, j, temp); - } + value: /* @__PURE__ */ __name(function _swap(A2, i2, j2) { + var temp = this._get(A2, i2); + this._set(A2, i2, this._get(A2, j2)); + this._set(A2, j2, temp); + }, "_swap") }, { key: "_defaultCompareFunction", - value: function _defaultCompareFunction(a, b) { - return b > a; - } + value: /* @__PURE__ */ __name(function _defaultCompareFunction(a2, b2) { + return b2 > a2; + }, "_defaultCompareFunction") }]); return Quicksort2; }(); @@ -190643,36 +123254,36 @@ g.stateGroup line { /* 25 */ /***/ function(module3, exports3, __webpack_require__) { - var _createClass = function() { + "use strict"; + var _createClass2 = /* @__PURE__ */ function() { function defineProperties(target, props) { for (var i2 = 0; i2 < props.length; i2++) { var descriptor = props[i2]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; + if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + __name(defineProperties, "defineProperties"); return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _classCallCheck(instance2, Constructor) { + function _classCallCheck2(instance2, Constructor) { if (!(instance2 instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + __name(_classCallCheck2, "_classCallCheck"); var NeedlemanWunsch = function() { function NeedlemanWunsch2(sequence1, sequence2) { var match_score = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1; var mismatch_penalty = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1; var gap_penalty = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1; - _classCallCheck(this, NeedlemanWunsch2); + _classCallCheck2(this, NeedlemanWunsch2); this.sequence1 = sequence1; this.sequence2 = sequence2; this.match_score = match_score; @@ -190683,64 +123294,63 @@ g.stateGroup line { this.grid = new Array(this.iMax); for (var i2 = 0; i2 < this.iMax; i2++) { this.grid[i2] = new Array(this.jMax); - for (var j = 0; j < this.jMax; j++) { - this.grid[i2][j] = 0; + for (var j2 = 0; j2 < this.jMax; j2++) { + this.grid[i2][j2] = 0; } } this.tracebackGrid = new Array(this.iMax); - for (var _i6 = 0; _i6 < this.iMax; _i6++) { - this.tracebackGrid[_i6] = new Array(this.jMax); + for (var _i = 0; _i < this.iMax; _i++) { + this.tracebackGrid[_i] = new Array(this.jMax); for (var _j = 0; _j < this.jMax; _j++) { - this.tracebackGrid[_i6][_j] = [null, null, null]; + this.tracebackGrid[_i][_j] = [null, null, null]; } } this.alignments = []; this.score = -1; this.computeGrids(); } - _createClass(NeedlemanWunsch2, [{ + __name(NeedlemanWunsch2, "NeedlemanWunsch"); + _createClass2(NeedlemanWunsch2, [{ key: "getScore", - value: function getScore() { + value: /* @__PURE__ */ __name(function getScore() { return this.score; - } + }, "getScore") }, { key: "getAlignments", - value: function getAlignments() { + value: /* @__PURE__ */ __name(function getAlignments() { return this.alignments; - } + }, "getAlignments") // Main dynamic programming procedure }, { key: "computeGrids", - value: function computeGrids() { - for (var j = 1; j < this.jMax; j++) { - this.grid[0][j] = this.grid[0][j - 1] + this.gap_penalty; - this.tracebackGrid[0][j] = [false, false, true]; + value: /* @__PURE__ */ __name(function computeGrids() { + for (var j2 = 1; j2 < this.jMax; j2++) { + this.grid[0][j2] = this.grid[0][j2 - 1] + this.gap_penalty; + this.tracebackGrid[0][j2] = [false, false, true]; } for (var i2 = 1; i2 < this.iMax; i2++) { this.grid[i2][0] = this.grid[i2 - 1][0] + this.gap_penalty; this.tracebackGrid[i2][0] = [false, true, false]; } - for (var _i22 = 1; _i22 < this.iMax; _i22++) { + for (var _i2 = 1; _i2 < this.iMax; _i2++) { for (var _j2 = 1; _j2 < this.jMax; _j2++) { var diag = void 0; - if (this.sequence1[_i22 - 1] === this.sequence2[_j2 - 1]) - diag = this.grid[_i22 - 1][_j2 - 1] + this.match_score; - else - diag = this.grid[_i22 - 1][_j2 - 1] + this.mismatch_penalty; - var up = this.grid[_i22 - 1][_j2] + this.gap_penalty; - var left2 = this.grid[_i22][_j2 - 1] + this.gap_penalty; - var maxOf = [diag, up, left2]; + if (this.sequence1[_i2 - 1] === this.sequence2[_j2 - 1]) diag = this.grid[_i2 - 1][_j2 - 1] + this.match_score; + else diag = this.grid[_i2 - 1][_j2 - 1] + this.mismatch_penalty; + var up = this.grid[_i2 - 1][_j2] + this.gap_penalty; + var left3 = this.grid[_i2][_j2 - 1] + this.gap_penalty; + var maxOf = [diag, up, left3]; var indices = this.arrayAllMaxIndexes(maxOf); - this.grid[_i22][_j2] = maxOf[indices[0]]; - this.tracebackGrid[_i22][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)]; + this.grid[_i2][_j2] = maxOf[indices[0]]; + this.tracebackGrid[_i2][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)]; } } this.score = this.grid[this.iMax - 1][this.jMax - 1]; - } + }, "computeGrids") // Gets all possible valid sequence combinations }, { key: "alignmentTraceback", - value: function alignmentTraceback() { + value: /* @__PURE__ */ __name(function alignmentTraceback() { var inProcessAlignments = []; inProcessAlignments.push({ pos: [this.sequence1.length, this.sequence2.length], @@ -190771,30 +123381,29 @@ g.stateGroup line { seq2: this.sequence2[current.pos[1] - 1] + current.seq2 }); } - if (current.pos[0] === 0 && current.pos[1] === 0) - this.alignments.push({ - sequence1: current.seq1, - sequence2: current.seq2 - }); + if (current.pos[0] === 0 && current.pos[1] === 0) this.alignments.push({ + sequence1: current.seq1, + sequence2: current.seq2 + }); inProcessAlignments.shift(); } return this.alignments; - } + }, "alignmentTraceback") // Helper Functions }, { key: "getAllIndexes", - value: function getAllIndexes(arr, val) { + value: /* @__PURE__ */ __name(function getAllIndexes(arr, val) { var indexes = [], i2 = -1; while ((i2 = arr.indexOf(val, i2 + 1)) !== -1) { indexes.push(i2); } return indexes; - } + }, "getAllIndexes") }, { key: "arrayAllMaxIndexes", - value: function arrayAllMaxIndexes(array2) { - return this.getAllIndexes(array2, Math.max.apply(null, array2)); - } + value: /* @__PURE__ */ __name(function arrayAllMaxIndexes(array4) { + return this.getAllIndexes(array4, Math.max.apply(null, array4)); + }, "arrayAllMaxIndexes") }]); return NeedlemanWunsch2; }(); @@ -190803,87 +123412,95 @@ g.stateGroup line { /* 26 */ /***/ function(module3, exports3, __webpack_require__) { - var layoutBase2 = function layoutBase3() { + "use strict"; + var layoutBase = /* @__PURE__ */ __name(function layoutBase2() { return; - }; - layoutBase2.FDLayout = __webpack_require__(18); - layoutBase2.FDLayoutConstants = __webpack_require__(7); - layoutBase2.FDLayoutEdge = __webpack_require__(19); - layoutBase2.FDLayoutNode = __webpack_require__(20); - layoutBase2.DimensionD = __webpack_require__(21); - layoutBase2.HashMap = __webpack_require__(22); - layoutBase2.HashSet = __webpack_require__(23); - layoutBase2.IGeometry = __webpack_require__(8); - layoutBase2.IMath = __webpack_require__(9); - layoutBase2.Integer = __webpack_require__(10); - layoutBase2.Point = __webpack_require__(12); - layoutBase2.PointD = __webpack_require__(4); - layoutBase2.RandomSeed = __webpack_require__(16); - layoutBase2.RectangleD = __webpack_require__(13); - layoutBase2.Transform = __webpack_require__(17); - layoutBase2.UniqueIDGeneretor = __webpack_require__(14); - layoutBase2.Quicksort = __webpack_require__(24); - layoutBase2.LinkedList = __webpack_require__(11); - layoutBase2.LGraphObject = __webpack_require__(2); - layoutBase2.LGraph = __webpack_require__(5); - layoutBase2.LEdge = __webpack_require__(1); - layoutBase2.LGraphManager = __webpack_require__(6); - layoutBase2.LNode = __webpack_require__(3); - layoutBase2.Layout = __webpack_require__(15); - layoutBase2.LayoutConstants = __webpack_require__(0); - layoutBase2.NeedlemanWunsch = __webpack_require__(25); - module3.exports = layoutBase2; + }, "layoutBase"); + layoutBase.FDLayout = __webpack_require__(18); + layoutBase.FDLayoutConstants = __webpack_require__(7); + layoutBase.FDLayoutEdge = __webpack_require__(19); + layoutBase.FDLayoutNode = __webpack_require__(20); + layoutBase.DimensionD = __webpack_require__(21); + layoutBase.HashMap = __webpack_require__(22); + layoutBase.HashSet = __webpack_require__(23); + layoutBase.IGeometry = __webpack_require__(8); + layoutBase.IMath = __webpack_require__(9); + layoutBase.Integer = __webpack_require__(10); + layoutBase.Point = __webpack_require__(12); + layoutBase.PointD = __webpack_require__(4); + layoutBase.RandomSeed = __webpack_require__(16); + layoutBase.RectangleD = __webpack_require__(13); + layoutBase.Transform = __webpack_require__(17); + layoutBase.UniqueIDGeneretor = __webpack_require__(14); + layoutBase.Quicksort = __webpack_require__(24); + layoutBase.LinkedList = __webpack_require__(11); + layoutBase.LGraphObject = __webpack_require__(2); + layoutBase.LGraph = __webpack_require__(5); + layoutBase.LEdge = __webpack_require__(1); + layoutBase.LGraphManager = __webpack_require__(6); + layoutBase.LNode = __webpack_require__(3); + layoutBase.Layout = __webpack_require__(15); + layoutBase.LayoutConstants = __webpack_require__(0); + layoutBase.NeedlemanWunsch = __webpack_require__(25); + module3.exports = layoutBase; }, /* 27 */ /***/ function(module3, exports3, __webpack_require__) { - function Emitter() { + "use strict"; + function Emitter3() { this.listeners = []; } - var p = Emitter.prototype; - p.addListener = function(event, callback) { + __name(Emitter3, "Emitter"); + var p3 = Emitter3.prototype; + p3.addListener = function(event3, callback) { this.listeners.push({ - event, + event: event3, callback }); }; - p.removeListener = function(event, callback) { + p3.removeListener = function(event3, callback) { for (var i2 = this.listeners.length; i2 >= 0; i2--) { - var l = this.listeners[i2]; - if (l.event === event && l.callback === callback) { + var l2 = this.listeners[i2]; + if (l2.event === event3 && l2.callback === callback) { this.listeners.splice(i2, 1); } } }; - p.emit = function(event, data) { + p3.emit = function(event3, data5) { for (var i2 = 0; i2 < this.listeners.length; i2++) { - var l = this.listeners[i2]; - if (event === l.event) { - l.callback(data); + var l2 = this.listeners[i2]; + if (event3 === l2.event) { + l2.callback(data5); } } }; - module3.exports = Emitter; + module3.exports = Emitter3; } /******/ ]) ); }); - })(layoutBase); - return layoutBase.exports; - } - var hasRequiredCoseBase; - function requireCoseBase() { - if (hasRequiredCoseBase) - return coseBase.exports; - hasRequiredCoseBase = 1; - (function(module2, exports2) { - (function webpackUniversalModuleDefinition(root2, factory) { - module2.exports = factory(requireLayoutBase()); - })(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE_0__) { + } + }); + + // ../../node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js + var require_cose_base = __commonJS({ + "../../node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js"(exports2, module2) { + "use strict"; + (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) { + if (typeof exports2 === "object" && typeof module2 === "object") + module2.exports = factory(require_layout_base()); + else if (typeof define === "function" && define.amd) + define(["layout-base"], factory); + else if (typeof exports2 === "object") + exports2["coseBase"] = factory(require_layout_base()); + else + root4["coseBase"] = factory(root4["layoutBase"]); + }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE_0__) { return ( /******/ - function(modules) { + function(modules2) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) { @@ -190898,11 +123515,12 @@ g.stateGroup line { exports: {} /******/ }; - modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); + modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); module3.l = true; return module3.exports; } - __webpack_require__.m = modules; + __name(__webpack_require__, "__webpack_require__"); + __webpack_require__.m = modules2; __webpack_require__.c = installedModules; __webpack_require__.i = function(value2) { return value2; @@ -190923,20 +123541,20 @@ g.stateGroup line { __webpack_require__.n = function(module3) { var getter = module3 && module3.__esModule ? ( /******/ - function getDefault() { + /* @__PURE__ */ __name(function getDefault() { return module3["default"]; - } + }, "getDefault") ) : ( /******/ - function getModuleExports() { + /* @__PURE__ */ __name(function getModuleExports() { return module3; - } + }, "getModuleExports") ); __webpack_require__.d(getter, "a", getter); return getter; }; - __webpack_require__.o = function(object2, property2) { - return Object.prototype.hasOwnProperty.call(object2, property2); + __webpack_require__.o = function(object3, property2) { + return Object.prototype.hasOwnProperty.call(object3, property2); }; __webpack_require__.p = ""; return __webpack_require__(__webpack_require__.s = 7); @@ -190949,9 +123567,11 @@ g.stateGroup line { /* 1 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var FDLayoutConstants = __webpack_require__(0).FDLayoutConstants; function CoSEConstants() { } + __name(CoSEConstants, "CoSEConstants"); for (var prop in FDLayoutConstants) { CoSEConstants[prop] = FDLayoutConstants[prop]; } @@ -190967,10 +123587,12 @@ g.stateGroup line { /* 2 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var FDLayoutEdge = __webpack_require__(0).FDLayoutEdge; function CoSEEdge(source, target, vEdge) { FDLayoutEdge.call(this, source, target, vEdge); } + __name(CoSEEdge, "CoSEEdge"); CoSEEdge.prototype = Object.create(FDLayoutEdge.prototype); for (var prop in FDLayoutEdge) { CoSEEdge[prop] = FDLayoutEdge[prop]; @@ -190980,10 +123602,12 @@ g.stateGroup line { /* 3 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraph = __webpack_require__(0).LGraph; - function CoSEGraph(parent, graphMgr, vGraph) { - LGraph.call(this, parent, graphMgr, vGraph); + function CoSEGraph(parent4, graphMgr, vGraph) { + LGraph.call(this, parent4, graphMgr, vGraph); } + __name(CoSEGraph, "CoSEGraph"); CoSEGraph.prototype = Object.create(LGraph.prototype); for (var prop in LGraph) { CoSEGraph[prop] = LGraph[prop]; @@ -190993,10 +123617,12 @@ g.stateGroup line { /* 4 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var LGraphManager = __webpack_require__(0).LGraphManager; - function CoSEGraphManager(layout2) { - LGraphManager.call(this, layout2); + function CoSEGraphManager(layout6) { + LGraphManager.call(this, layout6); } + __name(CoSEGraphManager, "CoSEGraphManager"); CoSEGraphManager.prototype = Object.create(LGraphManager.prototype); for (var prop in LGraphManager) { CoSEGraphManager[prop] = LGraphManager[prop]; @@ -191006,24 +123632,26 @@ g.stateGroup line { /* 5 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var FDLayoutNode = __webpack_require__(0).FDLayoutNode; var IMath = __webpack_require__(0).IMath; - function CoSENode(gm, loc, size2, vNode) { - FDLayoutNode.call(this, gm, loc, size2, vNode); + function CoSENode(gm, loc, size5, vNode) { + FDLayoutNode.call(this, gm, loc, size5, vNode); } + __name(CoSENode, "CoSENode"); CoSENode.prototype = Object.create(FDLayoutNode.prototype); for (var prop in FDLayoutNode) { CoSENode[prop] = FDLayoutNode[prop]; } CoSENode.prototype.move = function() { - var layout2 = this.graphManager.getLayout(); - this.displacementX = layout2.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren; - this.displacementY = layout2.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren; - if (Math.abs(this.displacementX) > layout2.coolingFactor * layout2.maxNodeDisplacement) { - this.displacementX = layout2.coolingFactor * layout2.maxNodeDisplacement * IMath.sign(this.displacementX); + var layout6 = this.graphManager.getLayout(); + this.displacementX = layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren; + this.displacementY = layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren; + if (Math.abs(this.displacementX) > layout6.coolingFactor * layout6.maxNodeDisplacement) { + this.displacementX = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementX); } - if (Math.abs(this.displacementY) > layout2.coolingFactor * layout2.maxNodeDisplacement) { - this.displacementY = layout2.coolingFactor * layout2.maxNodeDisplacement * IMath.sign(this.displacementY); + if (Math.abs(this.displacementY) > layout6.coolingFactor * layout6.maxNodeDisplacement) { + this.displacementY = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementY); } if (this.child == null) { this.moveBy(this.displacementX, this.displacementY); @@ -191032,7 +123660,7 @@ g.stateGroup line { } else { this.propogateDisplacementToChildren(this.displacementX, this.displacementY); } - layout2.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY); + layout6.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY); this.springForceX = 0; this.springForceY = 0; this.repulsionForceX = 0; @@ -191043,10 +123671,10 @@ g.stateGroup line { this.displacementY = 0; }; CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) { - var nodes2 = this.getChild().getNodes(); + var nodes6 = this.getChild().getNodes(); var node2; - for (var i2 = 0; i2 < nodes2.length; i2++) { - node2 = nodes2[i2]; + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; if (node2.getChild() == null) { node2.moveBy(dX, dY); node2.displacementX += dX; @@ -191065,8 +123693,8 @@ g.stateGroup line { CoSENode.prototype.getPred2 = function() { return pred2; }; - CoSENode.prototype.setNext = function(next2) { - this.next = next2; + CoSENode.prototype.setNext = function(next3) { + this.next = next3; }; CoSENode.prototype.getNext = function() { return next; @@ -191082,6 +123710,7 @@ g.stateGroup line { /* 6 */ /***/ function(module3, exports3, __webpack_require__) { + "use strict"; var FDLayout = __webpack_require__(0).FDLayout; var CoSEGraphManager = __webpack_require__(4); var CoSEGraph = __webpack_require__(3); @@ -191090,7 +123719,7 @@ g.stateGroup line { var CoSEConstants = __webpack_require__(1); var FDLayoutConstants = __webpack_require__(0).FDLayoutConstants; var LayoutConstants = __webpack_require__(0).LayoutConstants; - var Point2 = __webpack_require__(0).Point; + var Point3 = __webpack_require__(0).Point; var PointD = __webpack_require__(0).PointD; var Layout2 = __webpack_require__(0).Layout; var Integer = __webpack_require__(0).Integer; @@ -191101,6 +123730,7 @@ g.stateGroup line { FDLayout.call(this); this.toBeTiled = {}; } + __name(CoSELayout, "CoSELayout"); CoSELayout.prototype = Object.create(FDLayout.prototype); for (var prop in FDLayout) { CoSELayout[prop] = FDLayout[prop]; @@ -191170,10 +123800,10 @@ g.stateGroup line { this.reduceTrees(); this.graphManager.resetAllNodesToApplyGravitation(); var allNodes = new Set(this.getAllNodes()); - var intersection2 = this.nodesWithGravity.filter(function(x2) { - return allNodes.has(x2); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); }); - this.graphManager.setAllNodesToApplyGravitation(intersection2); + this.graphManager.setAllNodesToApplyGravitation(intersection3); this.positionNodesRandomly(); } } else { @@ -191181,10 +123811,10 @@ g.stateGroup line { this.reduceTrees(); this.graphManager.resetAllNodesToApplyGravitation(); var allNodes = new Set(this.getAllNodes()); - var intersection2 = this.nodesWithGravity.filter(function(x2) { - return allNodes.has(x2); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); }); - this.graphManager.setAllNodesToApplyGravitation(intersection2); + this.graphManager.setAllNodesToApplyGravitation(intersection3); } } this.initSpringEmbedder(); @@ -191225,10 +123855,10 @@ g.stateGroup line { this.growTree(this.prunedNodesAll); this.graphManager.resetAllNodesToApplyGravitation(); var allNodes = new Set(this.getAllNodes()); - var intersection2 = this.nodesWithGravity.filter(function(x2) { - return allNodes.has(x2); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); }); - this.graphManager.setAllNodesToApplyGravitation(intersection2); + this.graphManager.setAllNodesToApplyGravitation(intersection3); this.graphManager.updateBounds(); this.updateGrid(); this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; @@ -191265,14 +123895,14 @@ g.stateGroup line { var allNodes = this.graphManager.getAllNodes(); var pData = {}; for (var i2 = 0; i2 < allNodes.length; i2++) { - var rect2 = allNodes[i2].rect; - var id2 = allNodes[i2].id; - pData[id2] = { - id: id2, - x: rect2.getCenterX(), - y: rect2.getCenterY(), - w: rect2.width, - h: rect2.height + var rect4 = allNodes[i2].rect; + var id26 = allNodes[i2].id; + pData[id26] = { + id: id26, + x: rect4.getCenterX(), + y: rect4.getCenterY(), + w: rect4.width, + h: rect4.height }; } return pData; @@ -191294,9 +123924,9 @@ g.stateGroup line { var nodeList = []; var graph; var graphs = this.graphManager.getGraphs(); - var size2 = graphs.length; + var size5 = graphs.length; var i2; - for (i2 = 0; i2 < size2; i2++) { + for (i2 = 0; i2 < size5; i2++) { graph = graphs[i2]; graph.updateConnected(); if (!graph.isConnected) { @@ -191306,12 +123936,12 @@ g.stateGroup line { return nodeList; }; CoSELayout.prototype.createBendpoints = function() { - var edges2 = []; - edges2 = edges2.concat(this.graphManager.getAllEdges()); + var edges5 = []; + edges5 = edges5.concat(this.graphManager.getAllEdges()); var visited = /* @__PURE__ */ new Set(); var i2; - for (i2 = 0; i2 < edges2.length; i2++) { - var edge = edges2[i2]; + for (i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; if (!visited.has(edge)) { var source = edge.getSource(); var target = edge.getTarget(); @@ -191326,9 +123956,9 @@ g.stateGroup line { edgeList2 = edgeList2.concat(target.getEdgeListToNode(source)); if (!visited.has(edgeList2[0])) { if (edgeList2.length > 1) { - var k; - for (k = 0; k < edgeList2.length; k++) { - var multiEdge = edgeList2[k]; + var k2; + for (k2 = 0; k2 < edgeList2.length; k2++) { + var multiEdge = edgeList2[k2]; multiEdge.getBendpoints().push(new PointD()); this.createDummyNodesForBendpoints(multiEdge); } @@ -191339,4417 +123969,9497 @@ g.stateGroup line { } } } - if (visited.size == edges2.length) { + if (visited.size == edges5.length) { break; } } }; CoSELayout.prototype.positionNodesRadially = function(forest) { - var currentStartingPoint = new Point2(0, 0); + var currentStartingPoint = new Point3(0, 0); var numberOfColumns = Math.ceil(Math.sqrt(forest.length)); - var height = 0; + var height2 = 0; var currentY = 0; var currentX = 0; - var point2 = new PointD(0, 0); + var point8 = new PointD(0, 0); for (var i2 = 0; i2 < forest.length; i2++) { if (i2 % numberOfColumns == 0) { currentX = 0; - currentY = height; + currentY = height2; if (i2 != 0) { currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION; } - height = 0; + height2 = 0; + } + var tree = forest[i2]; + var centerNode = Layout2.findCenterOfTree(tree); + currentStartingPoint.x = currentX; + currentStartingPoint.y = currentY; + point8 = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint); + if (point8.y > height2) { + height2 = Math.floor(point8.y); + } + currentX = Math.floor(point8.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION); + } + this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point8.x / 2, LayoutConstants.WORLD_CENTER_Y - point8.y / 2)); + }; + CoSELayout.radialLayout = function(tree, centerNode, startingPoint) { + var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION); + CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep); + var bounds4 = LGraph.calculateBounds(tree); + var transform8 = new Transform2(); + transform8.setDeviceOrgX(bounds4.getMinX()); + transform8.setDeviceOrgY(bounds4.getMinY()); + transform8.setWorldOrgX(startingPoint.x); + transform8.setWorldOrgY(startingPoint.y); + for (var i2 = 0; i2 < tree.length; i2++) { + var node2 = tree[i2]; + node2.transform(transform8); + } + var bottomRight = new PointD(bounds4.getMaxX(), bounds4.getMaxY()); + return transform8.inverseTransformPoint(bottomRight); + }; + CoSELayout.branchRadialLayout = function(node2, parentOfNode, startAngle, endAngle, distance2, radialSeparation) { + var halfInterval = (endAngle - startAngle + 1) / 2; + if (halfInterval < 0) { + halfInterval += 180; + } + var nodeAngle = (halfInterval + startAngle) % 360; + var teta = nodeAngle * IGeometry.TWO_PI / 360; + var cos_teta = Math.cos(teta); + var x_ = distance2 * Math.cos(teta); + var y_ = distance2 * Math.sin(teta); + node2.setCenter(x_, y_); + var neighborEdges = []; + neighborEdges = neighborEdges.concat(node2.getEdges()); + var childCount = neighborEdges.length; + if (parentOfNode != null) { + childCount--; + } + var branchCount = 0; + var incEdgesCount = neighborEdges.length; + var startIndex; + var edges5 = node2.getEdgesBetween(parentOfNode); + while (edges5.length > 1) { + var temp = edges5[0]; + edges5.splice(0, 1); + var index = neighborEdges.indexOf(temp); + if (index >= 0) { + neighborEdges.splice(index, 1); + } + incEdgesCount--; + childCount--; + } + if (parentOfNode != null) { + startIndex = (neighborEdges.indexOf(edges5[0]) + 1) % incEdgesCount; + } else { + startIndex = 0; + } + var stepAngle = Math.abs(endAngle - startAngle) / childCount; + for (var i2 = startIndex; branchCount != childCount; i2 = ++i2 % incEdgesCount) { + var currentNeighbor = neighborEdges[i2].getOtherEnd(node2); + if (currentNeighbor == parentOfNode) { + continue; + } + var childStartAngle = (startAngle + branchCount * stepAngle) % 360; + var childEndAngle = (childStartAngle + stepAngle) % 360; + CoSELayout.branchRadialLayout(currentNeighbor, node2, childStartAngle, childEndAngle, distance2 + radialSeparation, radialSeparation); + branchCount++; + } + }; + CoSELayout.maxDiagonalInTree = function(tree) { + var maxDiagonal = Integer.MIN_VALUE; + for (var i2 = 0; i2 < tree.length; i2++) { + var node2 = tree[i2]; + var diagonal = node2.getDiagonal(); + if (diagonal > maxDiagonal) { + maxDiagonal = diagonal; + } + } + return maxDiagonal; + }; + CoSELayout.prototype.calcRepulsionRange = function() { + return 2 * (this.level + 1) * this.idealEdgeLength; + }; + CoSELayout.prototype.groupZeroDegreeMembers = function() { + var self2 = this; + var tempMemberGroups = {}; + this.memberGroups = {}; + this.idToDummyNode = {}; + var zeroDegree = []; + var allNodes = this.graphManager.getAllNodes(); + for (var i2 = 0; i2 < allNodes.length; i2++) { + var node2 = allNodes[i2]; + var parent4 = node2.getParent(); + if (this.getNodeDegreeWithChildren(node2) === 0 && (parent4.id == void 0 || !this.getToBeTiled(parent4))) { + zeroDegree.push(node2); + } + } + for (var i2 = 0; i2 < zeroDegree.length; i2++) { + var node2 = zeroDegree[i2]; + var p_id = node2.getParent().id; + if (typeof tempMemberGroups[p_id] === "undefined") tempMemberGroups[p_id] = []; + tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node2); + } + Object.keys(tempMemberGroups).forEach(function(p_id2) { + if (tempMemberGroups[p_id2].length > 1) { + var dummyCompoundId = "DummyCompound_" + p_id2; + self2.memberGroups[dummyCompoundId] = tempMemberGroups[p_id2]; + var parent5 = tempMemberGroups[p_id2][0].getParent(); + var dummyCompound = new CoSENode(self2.graphManager); + dummyCompound.id = dummyCompoundId; + dummyCompound.paddingLeft = parent5.paddingLeft || 0; + dummyCompound.paddingRight = parent5.paddingRight || 0; + dummyCompound.paddingBottom = parent5.paddingBottom || 0; + dummyCompound.paddingTop = parent5.paddingTop || 0; + self2.idToDummyNode[dummyCompoundId] = dummyCompound; + var dummyParentGraph = self2.getGraphManager().add(self2.newGraph(), dummyCompound); + var parentGraph = parent5.getChild(); + parentGraph.add(dummyCompound); + for (var i3 = 0; i3 < tempMemberGroups[p_id2].length; i3++) { + var node3 = tempMemberGroups[p_id2][i3]; + parentGraph.remove(node3); + dummyParentGraph.add(node3); + } + } + }); + }; + CoSELayout.prototype.clearCompounds = function() { + var childGraphMap = {}; + var idToNode = {}; + this.performDFSOnCompounds(); + for (var i2 = 0; i2 < this.compoundOrder.length; i2++) { + idToNode[this.compoundOrder[i2].id] = this.compoundOrder[i2]; + childGraphMap[this.compoundOrder[i2].id] = [].concat(this.compoundOrder[i2].getChild().getNodes()); + this.graphManager.remove(this.compoundOrder[i2].getChild()); + this.compoundOrder[i2].child = null; + } + this.graphManager.resetAllNodes(); + this.tileCompoundMembers(childGraphMap, idToNode); + }; + CoSELayout.prototype.clearZeroDegreeMembers = function() { + var self2 = this; + var tiledZeroDegreePack = this.tiledZeroDegreePack = []; + Object.keys(this.memberGroups).forEach(function(id26) { + var compoundNode = self2.idToDummyNode[id26]; + tiledZeroDegreePack[id26] = self2.tileNodes(self2.memberGroups[id26], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = tiledZeroDegreePack[id26].width; + compoundNode.rect.height = tiledZeroDegreePack[id26].height; + }); + }; + CoSELayout.prototype.repopulateCompounds = function() { + for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) { + var lCompoundNode = this.compoundOrder[i2]; + var id26 = lCompoundNode.id; + var horizontalMargin = lCompoundNode.paddingLeft; + var verticalMargin = lCompoundNode.paddingTop; + this.adjustLocations(this.tiledMemberPack[id26], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin); + } + }; + CoSELayout.prototype.repopulateZeroDegreeMembers = function() { + var self2 = this; + var tiledPack = this.tiledZeroDegreePack; + Object.keys(tiledPack).forEach(function(id26) { + var compoundNode = self2.idToDummyNode[id26]; + var horizontalMargin = compoundNode.paddingLeft; + var verticalMargin = compoundNode.paddingTop; + self2.adjustLocations(tiledPack[id26], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin); + }); + }; + CoSELayout.prototype.getToBeTiled = function(node2) { + var id26 = node2.id; + if (this.toBeTiled[id26] != null) { + return this.toBeTiled[id26]; + } + var childGraph = node2.getChild(); + if (childGraph == null) { + this.toBeTiled[id26] = false; + return false; + } + var children2 = childGraph.getNodes(); + for (var i2 = 0; i2 < children2.length; i2++) { + var theChild = children2[i2]; + if (this.getNodeDegree(theChild) > 0) { + this.toBeTiled[id26] = false; + return false; + } + if (theChild.getChild() == null) { + this.toBeTiled[theChild.id] = false; + continue; + } + if (!this.getToBeTiled(theChild)) { + this.toBeTiled[id26] = false; + return false; + } + } + this.toBeTiled[id26] = true; + return true; + }; + CoSELayout.prototype.getNodeDegree = function(node2) { + var id26 = node2.id; + var edges5 = node2.getEdges(); + var degree = 0; + for (var i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; + if (edge.getSource().id !== edge.getTarget().id) { + degree = degree + 1; + } + } + return degree; + }; + CoSELayout.prototype.getNodeDegreeWithChildren = function(node2) { + var degree = this.getNodeDegree(node2); + if (node2.getChild() == null) { + return degree; + } + var children2 = node2.getChild().getNodes(); + for (var i2 = 0; i2 < children2.length; i2++) { + var child = children2[i2]; + degree += this.getNodeDegreeWithChildren(child); + } + return degree; + }; + CoSELayout.prototype.performDFSOnCompounds = function() { + this.compoundOrder = []; + this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes()); + }; + CoSELayout.prototype.fillCompexOrderByDFS = function(children2) { + for (var i2 = 0; i2 < children2.length; i2++) { + var child = children2[i2]; + if (child.getChild() != null) { + this.fillCompexOrderByDFS(child.getChild().getNodes()); + } + if (this.getToBeTiled(child)) { + this.compoundOrder.push(child); + } + } + }; + CoSELayout.prototype.adjustLocations = function(organization, x5, y5, compoundHorizontalMargin, compoundVerticalMargin) { + x5 += compoundHorizontalMargin; + y5 += compoundVerticalMargin; + var left3 = x5; + for (var i2 = 0; i2 < organization.rows.length; i2++) { + var row = organization.rows[i2]; + x5 = left3; + var maxHeight = 0; + for (var j2 = 0; j2 < row.length; j2++) { + var lnode = row[j2]; + lnode.rect.x = x5; + lnode.rect.y = y5; + x5 += lnode.rect.width + organization.horizontalPadding; + if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height; + } + y5 += maxHeight + organization.verticalPadding; + } + }; + CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) { + var self2 = this; + this.tiledMemberPack = []; + Object.keys(childGraphMap).forEach(function(id26) { + var compoundNode = idToNode[id26]; + self2.tiledMemberPack[id26] = self2.tileNodes(childGraphMap[id26], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = self2.tiledMemberPack[id26].width; + compoundNode.rect.height = self2.tiledMemberPack[id26].height; + }); + }; + CoSELayout.prototype.tileNodes = function(nodes6, minWidth) { + var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL; + var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL; + var organization = { + rows: [], + rowWidth: [], + rowHeight: [], + width: 0, + height: minWidth, + // assume minHeight equals to minWidth + verticalPadding, + horizontalPadding + }; + nodes6.sort(function(n1, n2) { + if (n1.rect.width * n1.rect.height > n2.rect.width * n2.rect.height) return -1; + if (n1.rect.width * n1.rect.height < n2.rect.width * n2.rect.height) return 1; + return 0; + }); + for (var i2 = 0; i2 < nodes6.length; i2++) { + var lNode = nodes6[i2]; + if (organization.rows.length == 0) { + this.insertNodeToRow(organization, lNode, 0, minWidth); + } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) { + this.insertNodeToRow(organization, lNode, this.getShortestRowIndex(organization), minWidth); + } else { + this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth); + } + this.shiftToLastRow(organization); + } + return organization; + }; + CoSELayout.prototype.insertNodeToRow = function(organization, node2, rowIndex, minWidth) { + var minCompoundSize = minWidth; + if (rowIndex == organization.rows.length) { + var secondDimension = []; + organization.rows.push(secondDimension); + organization.rowWidth.push(minCompoundSize); + organization.rowHeight.push(0); + } + var w3 = organization.rowWidth[rowIndex] + node2.rect.width; + if (organization.rows[rowIndex].length > 0) { + w3 += organization.horizontalPadding; + } + organization.rowWidth[rowIndex] = w3; + if (organization.width < w3) { + organization.width = w3; + } + var h2 = node2.rect.height; + if (rowIndex > 0) h2 += organization.verticalPadding; + var extraHeight = 0; + if (h2 > organization.rowHeight[rowIndex]) { + extraHeight = organization.rowHeight[rowIndex]; + organization.rowHeight[rowIndex] = h2; + extraHeight = organization.rowHeight[rowIndex] - extraHeight; + } + organization.height += extraHeight; + organization.rows[rowIndex].push(node2); + }; + CoSELayout.prototype.getShortestRowIndex = function(organization) { + var r2 = -1; + var min9 = Number.MAX_VALUE; + for (var i2 = 0; i2 < organization.rows.length; i2++) { + if (organization.rowWidth[i2] < min9) { + r2 = i2; + min9 = organization.rowWidth[i2]; + } + } + return r2; + }; + CoSELayout.prototype.getLongestRowIndex = function(organization) { + var r2 = -1; + var max10 = Number.MIN_VALUE; + for (var i2 = 0; i2 < organization.rows.length; i2++) { + if (organization.rowWidth[i2] > max10) { + r2 = i2; + max10 = organization.rowWidth[i2]; + } + } + return r2; + }; + CoSELayout.prototype.canAddHorizontal = function(organization, extraWidth, extraHeight) { + var sri = this.getShortestRowIndex(organization); + if (sri < 0) { + return true; + } + var min9 = organization.rowWidth[sri]; + if (min9 + organization.horizontalPadding + extraWidth <= organization.width) return true; + var hDiff = 0; + if (organization.rowHeight[sri] < extraHeight) { + if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri]; + } + var add_to_row_ratio; + if (organization.width - min9 >= extraWidth + organization.horizontalPadding) { + add_to_row_ratio = (organization.height + hDiff) / (min9 + extraWidth + organization.horizontalPadding); + } else { + add_to_row_ratio = (organization.height + hDiff) / organization.width; + } + hDiff = extraHeight + organization.verticalPadding; + var add_new_row_ratio; + if (organization.width < extraWidth) { + add_new_row_ratio = (organization.height + hDiff) / extraWidth; + } else { + add_new_row_ratio = (organization.height + hDiff) / organization.width; + } + if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio; + if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio; + return add_to_row_ratio < add_new_row_ratio; + }; + CoSELayout.prototype.shiftToLastRow = function(organization) { + var longest = this.getLongestRowIndex(organization); + var last3 = organization.rowWidth.length - 1; + var row = organization.rows[longest]; + var node2 = row[row.length - 1]; + var diff2 = node2.width + organization.horizontalPadding; + if (organization.width - organization.rowWidth[last3] > diff2 && longest != last3) { + row.splice(-1, 1); + organization.rows[last3].push(node2); + organization.rowWidth[longest] = organization.rowWidth[longest] - diff2; + organization.rowWidth[last3] = organization.rowWidth[last3] + diff2; + organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)]; + var maxHeight = Number.MIN_VALUE; + for (var i2 = 0; i2 < row.length; i2++) { + if (row[i2].height > maxHeight) maxHeight = row[i2].height; + } + if (longest > 0) maxHeight += organization.verticalPadding; + var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last3]; + organization.rowHeight[longest] = maxHeight; + if (organization.rowHeight[last3] < node2.height + organization.verticalPadding) organization.rowHeight[last3] = node2.height + organization.verticalPadding; + var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last3]; + organization.height += finalTotal - prevTotal; + this.shiftToLastRow(organization); + } + }; + CoSELayout.prototype.tilingPreLayout = function() { + if (CoSEConstants.TILE) { + this.groupZeroDegreeMembers(); + this.clearCompounds(); + this.clearZeroDegreeMembers(); + } + }; + CoSELayout.prototype.tilingPostLayout = function() { + if (CoSEConstants.TILE) { + this.repopulateZeroDegreeMembers(); + this.repopulateCompounds(); + } + }; + CoSELayout.prototype.reduceTrees = function() { + var prunedNodesAll = []; + var containsLeaf = true; + var node2; + while (containsLeaf) { + var allNodes = this.graphManager.getAllNodes(); + var prunedNodesInStepTemp = []; + containsLeaf = false; + for (var i2 = 0; i2 < allNodes.length; i2++) { + node2 = allNodes[i2]; + if (node2.getEdges().length == 1 && !node2.getEdges()[0].isInterGraph && node2.getChild() == null) { + prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner()]); + containsLeaf = true; + } } - var tree = forest[i2]; - var centerNode = Layout2.findCenterOfTree(tree); - currentStartingPoint.x = currentX; - currentStartingPoint.y = currentY; - point2 = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint); - if (point2.y > height) { - height = Math.floor(point2.y); + if (containsLeaf == true) { + var prunedNodesInStep = []; + for (var j2 = 0; j2 < prunedNodesInStepTemp.length; j2++) { + if (prunedNodesInStepTemp[j2][0].getEdges().length == 1) { + prunedNodesInStep.push(prunedNodesInStepTemp[j2]); + prunedNodesInStepTemp[j2][0].getOwner().remove(prunedNodesInStepTemp[j2][0]); + } + } + prunedNodesAll.push(prunedNodesInStep); + this.graphManager.resetAllNodes(); + this.graphManager.resetAllEdges(); } - currentX = Math.floor(point2.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION); } - this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point2.x / 2, LayoutConstants.WORLD_CENTER_Y - point2.y / 2)); + this.prunedNodesAll = prunedNodesAll; }; - CoSELayout.radialLayout = function(tree, centerNode, startingPoint) { - var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION); - CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep); - var bounds2 = LGraph.calculateBounds(tree); - var transform = new Transform2(); - transform.setDeviceOrgX(bounds2.getMinX()); - transform.setDeviceOrgY(bounds2.getMinY()); - transform.setWorldOrgX(startingPoint.x); - transform.setWorldOrgY(startingPoint.y); - for (var i2 = 0; i2 < tree.length; i2++) { - var node2 = tree[i2]; - node2.transform(transform); + CoSELayout.prototype.growTree = function(prunedNodesAll) { + var lengthOfPrunedNodesInStep = prunedNodesAll.length; + var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1]; + var nodeData; + for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) { + nodeData = prunedNodesInStep[i2]; + this.findPlaceforPrunedNode(nodeData); + nodeData[2].add(nodeData[0]); + nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target); } - var bottomRight = new PointD(bounds2.getMaxX(), bounds2.getMaxY()); - return transform.inverseTransformPoint(bottomRight); + prunedNodesAll.splice(prunedNodesAll.length - 1, 1); + this.graphManager.resetAllNodes(); + this.graphManager.resetAllEdges(); }; - CoSELayout.branchRadialLayout = function(node2, parentOfNode, startAngle, endAngle, distance2, radialSeparation) { - var halfInterval = (endAngle - startAngle + 1) / 2; - if (halfInterval < 0) { - halfInterval += 180; + CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData) { + var gridForPrunedNode; + var nodeToConnect; + var prunedNode = nodeData[0]; + if (prunedNode == nodeData[1].source) { + nodeToConnect = nodeData[1].target; + } else { + nodeToConnect = nodeData[1].source; } - var nodeAngle = (halfInterval + startAngle) % 360; - var teta = nodeAngle * IGeometry.TWO_PI / 360; - var x_ = distance2 * Math.cos(teta); - var y_ = distance2 * Math.sin(teta); - node2.setCenter(x_, y_); - var neighborEdges = []; - neighborEdges = neighborEdges.concat(node2.getEdges()); - var childCount = neighborEdges.length; - if (parentOfNode != null) { - childCount--; + var startGridX = nodeToConnect.startX; + var finishGridX = nodeToConnect.finishX; + var startGridY = nodeToConnect.startY; + var finishGridY = nodeToConnect.finishY; + var upNodeCount = 0; + var downNodeCount = 0; + var rightNodeCount = 0; + var leftNodeCount = 0; + var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount]; + if (startGridY > 0) { + for (var i2 = startGridX; i2 <= finishGridX; i2++) { + controlRegions[0] += this.grid[i2][startGridY - 1].length + this.grid[i2][startGridY].length - 1; + } } - var branchCount = 0; - var incEdgesCount = neighborEdges.length; - var startIndex; - var edges2 = node2.getEdgesBetween(parentOfNode); - while (edges2.length > 1) { - var temp = edges2[0]; - edges2.splice(0, 1); - var index2 = neighborEdges.indexOf(temp); - if (index2 >= 0) { - neighborEdges.splice(index2, 1); + if (finishGridX < this.grid.length - 1) { + for (var i2 = startGridY; i2 <= finishGridY; i2++) { + controlRegions[1] += this.grid[finishGridX + 1][i2].length + this.grid[finishGridX][i2].length - 1; } - incEdgesCount--; - childCount--; } - if (parentOfNode != null) { - startIndex = (neighborEdges.indexOf(edges2[0]) + 1) % incEdgesCount; - } else { - startIndex = 0; + if (finishGridY < this.grid[0].length - 1) { + for (var i2 = startGridX; i2 <= finishGridX; i2++) { + controlRegions[2] += this.grid[i2][finishGridY + 1].length + this.grid[i2][finishGridY].length - 1; + } } - var stepAngle = Math.abs(endAngle - startAngle) / childCount; - for (var i2 = startIndex; branchCount != childCount; i2 = ++i2 % incEdgesCount) { - var currentNeighbor = neighborEdges[i2].getOtherEnd(node2); - if (currentNeighbor == parentOfNode) { - continue; + if (startGridX > 0) { + for (var i2 = startGridY; i2 <= finishGridY; i2++) { + controlRegions[3] += this.grid[startGridX - 1][i2].length + this.grid[startGridX][i2].length - 1; } - var childStartAngle = (startAngle + branchCount * stepAngle) % 360; - var childEndAngle = (childStartAngle + stepAngle) % 360; - CoSELayout.branchRadialLayout(currentNeighbor, node2, childStartAngle, childEndAngle, distance2 + radialSeparation, radialSeparation); - branchCount++; } - }; - CoSELayout.maxDiagonalInTree = function(tree) { - var maxDiagonal = Integer.MIN_VALUE; - for (var i2 = 0; i2 < tree.length; i2++) { - var node2 = tree[i2]; - var diagonal = node2.getDiagonal(); - if (diagonal > maxDiagonal) { - maxDiagonal = diagonal; + var min9 = Integer.MAX_VALUE; + var minCount; + var minIndex; + for (var j2 = 0; j2 < controlRegions.length; j2++) { + if (controlRegions[j2] < min9) { + min9 = controlRegions[j2]; + minCount = 1; + minIndex = j2; + } else if (controlRegions[j2] == min9) { + minCount++; } } - return maxDiagonal; + if (minCount == 3 && min9 == 0) { + if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) { + gridForPrunedNode = 1; + } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) { + gridForPrunedNode = 0; + } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) { + gridForPrunedNode = 3; + } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) { + gridForPrunedNode = 2; + } + } else if (minCount == 2 && min9 == 0) { + var random2 = Math.floor(Math.random() * 2); + if (controlRegions[0] == 0 && controlRegions[1] == 0) { + ; + if (random2 == 0) { + gridForPrunedNode = 0; + } else { + gridForPrunedNode = 1; + } + } else if (controlRegions[0] == 0 && controlRegions[2] == 0) { + if (random2 == 0) { + gridForPrunedNode = 0; + } else { + gridForPrunedNode = 2; + } + } else if (controlRegions[0] == 0 && controlRegions[3] == 0) { + if (random2 == 0) { + gridForPrunedNode = 0; + } else { + gridForPrunedNode = 3; + } + } else if (controlRegions[1] == 0 && controlRegions[2] == 0) { + if (random2 == 0) { + gridForPrunedNode = 1; + } else { + gridForPrunedNode = 2; + } + } else if (controlRegions[1] == 0 && controlRegions[3] == 0) { + if (random2 == 0) { + gridForPrunedNode = 1; + } else { + gridForPrunedNode = 3; + } + } else { + if (random2 == 0) { + gridForPrunedNode = 2; + } else { + gridForPrunedNode = 3; + } + } + } else if (minCount == 4 && min9 == 0) { + var random2 = Math.floor(Math.random() * 4); + gridForPrunedNode = random2; + } else { + gridForPrunedNode = minIndex; + } + if (gridForPrunedNode == 0) { + prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2); + } else if (gridForPrunedNode == 1) { + prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY()); + } else if (gridForPrunedNode == 2) { + prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2); + } else { + prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY()); + } }; - CoSELayout.prototype.calcRepulsionRange = function() { - return 2 * (this.level + 1) * this.idealEdgeLength; + module3.exports = CoSELayout; + }, + /* 7 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var coseBase = {}; + coseBase.layoutBase = __webpack_require__(0); + coseBase.CoSEConstants = __webpack_require__(1); + coseBase.CoSEEdge = __webpack_require__(2); + coseBase.CoSEGraph = __webpack_require__(3); + coseBase.CoSEGraphManager = __webpack_require__(4); + coseBase.CoSELayout = __webpack_require__(6); + coseBase.CoSENode = __webpack_require__(5); + module3.exports = coseBase; + } + /******/ + ]) + ); + }); + } + }); + + // ../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.30.1/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js + var require_cytoscape_cose_bilkent = __commonJS({ + "../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.30.1/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"(exports2, module2) { + "use strict"; + (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) { + if (typeof exports2 === "object" && typeof module2 === "object") + module2.exports = factory(require_cose_base()); + else if (typeof define === "function" && define.amd) + define(["cose-base"], factory); + else if (typeof exports2 === "object") + exports2["cytoscapeCoseBilkent"] = factory(require_cose_base()); + else + root4["cytoscapeCoseBilkent"] = factory(root4["coseBase"]); + }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE_0__) { + return ( + /******/ + function(modules2) { + var installedModules = {}; + function __webpack_require__(moduleId) { + if (installedModules[moduleId]) { + return installedModules[moduleId].exports; + } + var module3 = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ }; - CoSELayout.prototype.groupZeroDegreeMembers = function() { - var self2 = this; - var tempMemberGroups = {}; - this.memberGroups = {}; - this.idToDummyNode = {}; - var zeroDegree = []; - var allNodes = this.graphManager.getAllNodes(); - for (var i2 = 0; i2 < allNodes.length; i2++) { - var node2 = allNodes[i2]; - var parent = node2.getParent(); - if (this.getNodeDegreeWithChildren(node2) === 0 && (parent.id == void 0 || !this.getToBeTiled(parent))) { - zeroDegree.push(node2); - } + modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); + module3.l = true; + return module3.exports; + } + __name(__webpack_require__, "__webpack_require__"); + __webpack_require__.m = modules2; + __webpack_require__.c = installedModules; + __webpack_require__.i = function(value2) { + return value2; + }; + __webpack_require__.d = function(exports3, name, getter) { + if (!__webpack_require__.o(exports3, name)) { + Object.defineProperty(exports3, name, { + /******/ + configurable: false, + /******/ + enumerable: true, + /******/ + get: getter + /******/ + }); + } + }; + __webpack_require__.n = function(module3) { + var getter = module3 && module3.__esModule ? ( + /******/ + /* @__PURE__ */ __name(function getDefault() { + return module3["default"]; + }, "getDefault") + ) : ( + /******/ + /* @__PURE__ */ __name(function getModuleExports() { + return module3; + }, "getModuleExports") + ); + __webpack_require__.d(getter, "a", getter); + return getter; + }; + __webpack_require__.o = function(object3, property2) { + return Object.prototype.hasOwnProperty.call(object3, property2); + }; + __webpack_require__.p = ""; + return __webpack_require__(__webpack_require__.s = 1); + }([ + /* 0 */ + /***/ + function(module3, exports3) { + module3.exports = __WEBPACK_EXTERNAL_MODULE_0__; + }, + /* 1 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LayoutConstants = __webpack_require__(0).layoutBase.LayoutConstants; + var FDLayoutConstants = __webpack_require__(0).layoutBase.FDLayoutConstants; + var CoSEConstants = __webpack_require__(0).CoSEConstants; + var CoSELayout = __webpack_require__(0).CoSELayout; + var CoSENode = __webpack_require__(0).CoSENode; + var PointD = __webpack_require__(0).layoutBase.PointD; + var DimensionD2 = __webpack_require__(0).layoutBase.DimensionD; + var defaults4 = { + // Called on `layoutready` + ready: /* @__PURE__ */ __name(function ready4() { + }, "ready"), + // Called on `layoutstop` + stop: /* @__PURE__ */ __name(function stop5() { + }, "stop"), + // 'draft', 'default' or 'proof" + // - 'draft' fast cooling rate + // - 'default' moderate cooling rate + // - "proof" slow cooling rate + quality: "default", + // include labels in node dimensions + nodeDimensionsIncludeLabels: false, + // number of ticks per frame; higher is faster but more jerky + refresh: 30, + // Whether to fit the network view after when done + fit: true, + // Padding on fit + padding: 10, + // Whether to enable incremental mode + randomize: true, + // Node repulsion (non overlapping) multiplier + nodeRepulsion: 4500, + // Ideal edge (non nested) length + idealEdgeLength: 50, + // Divisor to compute edge forces + edgeElasticity: 0.45, + // Nesting factor (multiplier) to compute ideal edge length for nested edges + nestingFactor: 0.1, + // Gravity force (constant) + gravity: 0.25, + // Maximum number of iterations to perform + numIter: 2500, + // For enabling tiling + tile: true, + // Type of layout animation. The option set is {'during', 'end', false} + animate: "end", + // Duration for animate:end + animationDuration: 500, + // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function) + tilingPaddingVertical: 10, + // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function) + tilingPaddingHorizontal: 10, + // Gravity range (constant) for compounds + gravityRangeCompound: 1.5, + // Gravity force (constant) for compounds + gravityCompound: 1, + // Gravity range (constant) + gravityRange: 3.8, + // Initial cooling factor for incremental layout + initialEnergyOnIncremental: 0.5 + }; + function extend5(defaults5, options3) { + var obj = {}; + for (var i2 in defaults5) { + obj[i2] = defaults5[i2]; } - for (var i2 = 0; i2 < zeroDegree.length; i2++) { - var node2 = zeroDegree[i2]; - var p_id = node2.getParent().id; - if (typeof tempMemberGroups[p_id] === "undefined") - tempMemberGroups[p_id] = []; - tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node2); + for (var i2 in options3) { + obj[i2] = options3[i2]; } - Object.keys(tempMemberGroups).forEach(function(p_id2) { - if (tempMemberGroups[p_id2].length > 1) { - var dummyCompoundId = "DummyCompound_" + p_id2; - self2.memberGroups[dummyCompoundId] = tempMemberGroups[p_id2]; - var parent2 = tempMemberGroups[p_id2][0].getParent(); - var dummyCompound = new CoSENode(self2.graphManager); - dummyCompound.id = dummyCompoundId; - dummyCompound.paddingLeft = parent2.paddingLeft || 0; - dummyCompound.paddingRight = parent2.paddingRight || 0; - dummyCompound.paddingBottom = parent2.paddingBottom || 0; - dummyCompound.paddingTop = parent2.paddingTop || 0; - self2.idToDummyNode[dummyCompoundId] = dummyCompound; - var dummyParentGraph = self2.getGraphManager().add(self2.newGraph(), dummyCompound); - var parentGraph = parent2.getChild(); - parentGraph.add(dummyCompound); - for (var i3 = 0; i3 < tempMemberGroups[p_id2].length; i3++) { - var node3 = tempMemberGroups[p_id2][i3]; - parentGraph.remove(node3); - dummyParentGraph.add(node3); + return obj; + } + __name(extend5, "extend"); + ; + function _CoSELayout(_options) { + this.options = extend5(defaults4, _options); + getUserOptions(this.options); + } + __name(_CoSELayout, "_CoSELayout"); + var getUserOptions = /* @__PURE__ */ __name(function getUserOptions2(options3) { + if (options3.nodeRepulsion != null) CoSEConstants.DEFAULT_REPULSION_STRENGTH = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = options3.nodeRepulsion; + if (options3.idealEdgeLength != null) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options3.idealEdgeLength; + if (options3.edgeElasticity != null) CoSEConstants.DEFAULT_SPRING_STRENGTH = FDLayoutConstants.DEFAULT_SPRING_STRENGTH = options3.edgeElasticity; + if (options3.nestingFactor != null) CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options3.nestingFactor; + if (options3.gravity != null) CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options3.gravity; + if (options3.numIter != null) CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options3.numIter; + if (options3.gravityRange != null) CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options3.gravityRange; + if (options3.gravityCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options3.gravityCompound; + if (options3.gravityRangeCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options3.gravityRangeCompound; + if (options3.initialEnergyOnIncremental != null) CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options3.initialEnergyOnIncremental; + if (options3.quality == "draft") LayoutConstants.QUALITY = 0; + else if (options3.quality == "proof") LayoutConstants.QUALITY = 2; + else LayoutConstants.QUALITY = 1; + CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options3.nodeDimensionsIncludeLabels; + CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options3.randomize; + CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options3.animate; + CoSEConstants.TILE = options3.tile; + CoSEConstants.TILING_PADDING_VERTICAL = typeof options3.tilingPaddingVertical === "function" ? options3.tilingPaddingVertical.call() : options3.tilingPaddingVertical; + CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options3.tilingPaddingHorizontal === "function" ? options3.tilingPaddingHorizontal.call() : options3.tilingPaddingHorizontal; + }, "getUserOptions"); + _CoSELayout.prototype.run = function() { + var ready4; + var frameId; + var options3 = this.options; + var idToLNode = this.idToLNode = {}; + var layout6 = this.layout = new CoSELayout(); + var self2 = this; + self2.stopped = false; + this.cy = this.options.cy; + this.cy.trigger({ type: "layoutstart", layout: this }); + var gm = layout6.newGraphManager(); + this.gm = gm; + var nodes6 = this.options.eles.nodes(); + var edges5 = this.options.eles.edges(); + this.root = gm.addRoot(); + this.processChildrenList(this.root, this.getTopMostNodes(nodes6), layout6); + for (var i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; + var sourceNode = this.idToLNode[edge.data("source")]; + var targetNode = this.idToLNode[edge.data("target")]; + if (sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) { + var e1 = gm.add(layout6.newEdge(), sourceNode, targetNode); + e1.id = edge.id(); + } + } + var getPositions = /* @__PURE__ */ __name(function getPositions2(ele, i3) { + if (typeof ele === "number") { + ele = i3; + } + var theId = ele.data("id"); + var lNode = self2.idToLNode[theId]; + return { + x: lNode.getRect().getCenterX(), + y: lNode.getRect().getCenterY() + }; + }, "getPositions"); + var iterateAnimated = /* @__PURE__ */ __name(function iterateAnimated2() { + var afterReposition = /* @__PURE__ */ __name(function afterReposition2() { + if (options3.fit) { + options3.cy.fit(options3.eles, options3.padding); + } + if (!ready4) { + ready4 = true; + self2.cy.one("layoutready", options3.ready); + self2.cy.trigger({ type: "layoutready", layout: self2 }); + } + }, "afterReposition"); + var ticksPerFrame = self2.options.refresh; + var isDone; + for (var i3 = 0; i3 < ticksPerFrame && !isDone; i3++) { + isDone = self2.stopped || self2.layout.tick(); + } + if (isDone) { + if (layout6.checkLayoutSuccess() && !layout6.isSubLayout) { + layout6.doPostLayout(); + } + if (layout6.tilingPostLayout) { + layout6.tilingPostLayout(); + } + layout6.isLayoutFinished = true; + self2.options.eles.nodes().positions(getPositions); + afterReposition(); + self2.cy.one("layoutstop", self2.options.stop); + self2.cy.trigger({ type: "layoutstop", layout: self2 }); + if (frameId) { + cancelAnimationFrame(frameId); + } + ready4 = false; + return; + } + var animationData = self2.layout.getPositionsData(); + options3.eles.nodes().positions(function(ele, i4) { + if (typeof ele === "number") { + ele = i4; + } + if (!ele.isParent()) { + var theId = ele.id(); + var pNode = animationData[theId]; + var temp = ele; + while (pNode == null) { + pNode = animationData[temp.data("parent")] || animationData["DummyCompound_" + temp.data("parent")]; + animationData[theId] = pNode; + temp = temp.parent()[0]; + if (temp == void 0) { + break; + } + } + if (pNode != null) { + return { + x: pNode.x, + y: pNode.y + }; + } else { + return { + x: ele.position("x"), + y: ele.position("y") + }; + } } + }); + afterReposition(); + frameId = requestAnimationFrame(iterateAnimated2); + }, "iterateAnimated"); + layout6.addListener("layoutstarted", function() { + if (self2.options.animate === "during") { + frameId = requestAnimationFrame(iterateAnimated); } }); - }; - CoSELayout.prototype.clearCompounds = function() { - var childGraphMap = {}; - var idToNode = {}; - this.performDFSOnCompounds(); - for (var i2 = 0; i2 < this.compoundOrder.length; i2++) { - idToNode[this.compoundOrder[i2].id] = this.compoundOrder[i2]; - childGraphMap[this.compoundOrder[i2].id] = [].concat(this.compoundOrder[i2].getChild().getNodes()); - this.graphManager.remove(this.compoundOrder[i2].getChild()); - this.compoundOrder[i2].child = null; + layout6.runLayout(); + if (this.options.animate !== "during") { + self2.options.eles.nodes().not(":parent").layoutPositions(self2, self2.options, getPositions); + ready4 = false; } - this.graphManager.resetAllNodes(); - this.tileCompoundMembers(childGraphMap, idToNode); + return this; }; - CoSELayout.prototype.clearZeroDegreeMembers = function() { - var self2 = this; - var tiledZeroDegreePack = this.tiledZeroDegreePack = []; - Object.keys(this.memberGroups).forEach(function(id2) { - var compoundNode = self2.idToDummyNode[id2]; - tiledZeroDegreePack[id2] = self2.tileNodes(self2.memberGroups[id2], compoundNode.paddingLeft + compoundNode.paddingRight); - compoundNode.rect.width = tiledZeroDegreePack[id2].width; - compoundNode.rect.height = tiledZeroDegreePack[id2].height; + _CoSELayout.prototype.getTopMostNodes = function(nodes6) { + var nodesMap2 = {}; + for (var i2 = 0; i2 < nodes6.length; i2++) { + nodesMap2[nodes6[i2].id()] = true; + } + var roots = nodes6.filter(function(ele, i3) { + if (typeof ele === "number") { + ele = i3; + } + var parent4 = ele.parent()[0]; + while (parent4 != null) { + if (nodesMap2[parent4.id()]) { + return false; + } + parent4 = parent4.parent()[0]; + } + return true; }); + return roots; }; - CoSELayout.prototype.repopulateCompounds = function() { - for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) { - var lCompoundNode = this.compoundOrder[i2]; - var id2 = lCompoundNode.id; - var horizontalMargin = lCompoundNode.paddingLeft; - var verticalMargin = lCompoundNode.paddingTop; - this.adjustLocations(this.tiledMemberPack[id2], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin); + _CoSELayout.prototype.processChildrenList = function(parent4, children2, layout6) { + var size5 = children2.length; + for (var i2 = 0; i2 < size5; i2++) { + var theChild = children2[i2]; + var children_of_children = theChild.children(); + var theNode; + var dimensions2 = theChild.layoutDimensions({ + nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels + }); + if (theChild.outerWidth() != null && theChild.outerHeight() != null) { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(theChild.position("x") - dimensions2.w / 2, theChild.position("y") - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h)))); + } else { + theNode = parent4.add(new CoSENode(this.graphManager)); + } + theNode.id = theChild.data("id"); + theNode.paddingLeft = parseInt(theChild.css("padding")); + theNode.paddingTop = parseInt(theChild.css("padding")); + theNode.paddingRight = parseInt(theChild.css("padding")); + theNode.paddingBottom = parseInt(theChild.css("padding")); + if (this.options.nodeDimensionsIncludeLabels) { + if (theChild.isParent()) { + var labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false }).w; + var labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false }).h; + var labelPos = theChild.css("text-halign"); + theNode.labelWidth = labelWidth; + theNode.labelHeight = labelHeight; + theNode.labelPos = labelPos; + } + } + this.idToLNode[theChild.data("id")] = theNode; + if (isNaN(theNode.rect.x)) { + theNode.rect.x = 0; + } + if (isNaN(theNode.rect.y)) { + theNode.rect.y = 0; + } + if (children_of_children != null && children_of_children.length > 0) { + var theNewGraph; + theNewGraph = layout6.getGraphManager().add(layout6.newGraph(), theNode); + this.processChildrenList(theNewGraph, children_of_children, layout6); + } } }; - CoSELayout.prototype.repopulateZeroDegreeMembers = function() { - var self2 = this; - var tiledPack = this.tiledZeroDegreePack; - Object.keys(tiledPack).forEach(function(id2) { - var compoundNode = self2.idToDummyNode[id2]; - var horizontalMargin = compoundNode.paddingLeft; - var verticalMargin = compoundNode.paddingTop; - self2.adjustLocations(tiledPack[id2], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin); - }); + _CoSELayout.prototype.stop = function() { + this.stopped = true; + return this; }; - CoSELayout.prototype.getToBeTiled = function(node2) { - var id2 = node2.id; - if (this.toBeTiled[id2] != null) { - return this.toBeTiled[id2]; + var register = /* @__PURE__ */ __name(function register2(cytoscape4) { + cytoscape4("layout", "cose-bilkent", _CoSELayout); + }, "register"); + if (typeof cytoscape !== "undefined") { + register(cytoscape); + } + module3.exports = register; + } + /******/ + ]) + ); + }); + } + }); + + // src/diagrams/mindmap/svgDraw.ts + function insertPolygonShape3(parent4, w3, h2, points, node2) { + return parent4.insert("polygon", ":first-child").attr( + "points", + points.map(function(d2) { + return d2.x + "," + d2.y; + }).join(" ") + ).attr("transform", "translate(" + (node2.width - w3) / 2 + ", " + h2 + ")"); + } + var MAX_SECTIONS2, defaultBkg2, rectBkg, cloudBkg, bangBkg, circleBkg, hexagonBkg, roundedRectBkg, drawNode2, positionNode3; + var init_svgDraw6 = __esm({ + "src/diagrams/mindmap/svgDraw.ts"() { + "use strict"; + init_createText(); + init_utils2(); + MAX_SECTIONS2 = 12; + defaultBkg2 = /* @__PURE__ */ __name(function(db7, elem, node2, section) { + const rd = 5; + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr( + "d", + `M0 ${node2.height - rd} v${-node2.height + 2 * rd} q0,-5 5,-5 h${node2.width - 2 * rd} q5,0 5,5 v${node2.height - rd} H0 Z` + ); + elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node2.height).attr("x2", node2.width).attr("y2", node2.height); + }, "defaultBkg"); + rectBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { + elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width); + }, "rectBkg"); + cloudBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { + const w3 = node2.width; + const h2 = node2.height; + const r1 = 0.15 * w3; + const r2 = 0.25 * w3; + const r3 = 0.35 * w3; + const r4 = 0.2 * w3; + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr( + "d", + `M0 0 a${r1},${r1} 0 0,1 ${w3 * 0.25},${-1 * w3 * 0.1} + a${r3},${r3} 1 0,1 ${w3 * 0.4},${-1 * w3 * 0.1} + a${r2},${r2} 1 0,1 ${w3 * 0.35},${1 * w3 * 0.2} + + a${r1},${r1} 1 0,1 ${w3 * 0.15},${1 * h2 * 0.35} + a${r4},${r4} 1 0,1 ${-1 * w3 * 0.15},${1 * h2 * 0.65} + + a${r2},${r1} 1 0,1 ${-1 * w3 * 0.25},${w3 * 0.15} + a${r3},${r3} 1 0,1 ${-1 * w3 * 0.5},${0} + a${r1},${r1} 1 0,1 ${-1 * w3 * 0.25},${-1 * w3 * 0.15} + + a${r1},${r1} 1 0,1 ${-1 * w3 * 0.1},${-1 * h2 * 0.35} + a${r4},${r4} 1 0,1 ${w3 * 0.1},${-1 * h2 * 0.65} + + H0 V0 Z` + ); + }, "cloudBkg"); + bangBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { + const w3 = node2.width; + const h2 = node2.height; + const r2 = 0.15 * w3; + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr( + "d", + `M0 0 a${r2},${r2} 1 0,0 ${w3 * 0.25},${-1 * h2 * 0.1} + a${r2},${r2} 1 0,0 ${w3 * 0.25},${0} + a${r2},${r2} 1 0,0 ${w3 * 0.25},${0} + a${r2},${r2} 1 0,0 ${w3 * 0.25},${1 * h2 * 0.1} + + a${r2},${r2} 1 0,0 ${w3 * 0.15},${1 * h2 * 0.33} + a${r2 * 0.8},${r2 * 0.8} 1 0,0 ${0},${1 * h2 * 0.34} + a${r2},${r2} 1 0,0 ${-1 * w3 * 0.15},${1 * h2 * 0.33} + + a${r2},${r2} 1 0,0 ${-1 * w3 * 0.25},${h2 * 0.15} + a${r2},${r2} 1 0,0 ${-1 * w3 * 0.25},${0} + a${r2},${r2} 1 0,0 ${-1 * w3 * 0.25},${0} + a${r2},${r2} 1 0,0 ${-1 * w3 * 0.25},${-1 * h2 * 0.15} + + a${r2},${r2} 1 0,0 ${-1 * w3 * 0.1},${-1 * h2 * 0.33} + a${r2 * 0.8},${r2 * 0.8} 1 0,0 ${0},${-1 * h2 * 0.34} + a${r2},${r2} 1 0,0 ${w3 * 0.1},${-1 * h2 * 0.33} + + H0 V0 Z` + ); + }, "bangBkg"); + circleBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { + elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr("r", node2.width / 2); + }, "circleBkg"); + __name(insertPolygonShape3, "insertPolygonShape"); + hexagonBkg = /* @__PURE__ */ __name(function(_db, elem, node2) { + const h2 = node2.height; + const f3 = 4; + const m2 = h2 / f3; + const w3 = node2.width - node2.padding + 2 * m2; + const points = [ + { x: m2, y: 0 }, + { x: w3 - m2, y: 0 }, + { x: w3, y: -h2 / 2 }, + { x: w3 - m2, y: -h2 }, + { x: m2, y: -h2 }, + { x: 0, y: -h2 / 2 } + ]; + insertPolygonShape3(elem, w3, h2, points, node2); + }, "hexagonBkg"); + roundedRectBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { + elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr("height", node2.height).attr("rx", node2.padding).attr("ry", node2.padding).attr("width", node2.width); + }, "roundedRectBkg"); + drawNode2 = /* @__PURE__ */ __name(async function(db7, elem, node2, fullSection, conf8) { + const htmlLabels = conf8.htmlLabels; + const section = fullSection % (MAX_SECTIONS2 - 1); + const nodeElem = elem.append("g"); + node2.section = section; + let sectionClass = "section-" + section; + if (section < 0) { + sectionClass += " section-root"; + } + nodeElem.attr("class", (node2.class ? node2.class + " " : "") + "mindmap-node " + sectionClass); + const bkgElem = nodeElem.append("g"); + const textElem = nodeElem.append("g"); + const description = node2.descr.replace(/()/g, "\n"); + await createText( + textElem, + description, + { + useHtmlLabels: htmlLabels, + width: node2.width, + classes: "mindmap-node-label" + }, + conf8 + ); + if (!htmlLabels) { + textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"); + } + const bbox = textElem.node().getBBox(); + const [fontSize] = parseFontSize(conf8.fontSize); + node2.height = bbox.height + fontSize * 1.1 * 0.5 + node2.padding; + node2.width = bbox.width + 2 * node2.padding; + if (node2.icon) { + if (node2.type === db7.nodeType.CIRCLE) { + node2.height += 50; + node2.width += 50; + const icon = nodeElem.append("foreignObject").attr("height", "50px").attr("width", node2.width).attr("style", "text-align: center;"); + icon.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon); + textElem.attr( + "transform", + "translate(" + node2.width / 2 + ", " + (node2.height / 2 - 1.5 * node2.padding) + ")" + ); + } else { + node2.width += 50; + const orgHeight = node2.height; + node2.height = Math.max(orgHeight, 60); + const heightDiff = Math.abs(node2.height - orgHeight); + const icon = nodeElem.append("foreignObject").attr("width", "60px").attr("height", node2.height).attr("style", "text-align: center;margin-top:" + heightDiff / 2 + "px;"); + icon.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon); + textElem.attr( + "transform", + "translate(" + (25 + node2.width / 2) + ", " + (heightDiff / 2 + node2.padding / 2) + ")" + ); + } + } else { + if (!htmlLabels) { + const dx = node2.width / 2; + const dy = node2.padding / 2; + textElem.attr("transform", "translate(" + dx + ", " + dy + ")"); + } else { + const dx = (node2.width - bbox.width) / 2; + const dy = (node2.height - bbox.height) / 2; + textElem.attr("transform", "translate(" + dx + ", " + dy + ")"); + } + } + switch (node2.type) { + case db7.nodeType.DEFAULT: + defaultBkg2(db7, bkgElem, node2, section); + break; + case db7.nodeType.ROUNDED_RECT: + roundedRectBkg(db7, bkgElem, node2, section); + break; + case db7.nodeType.RECT: + rectBkg(db7, bkgElem, node2, section); + break; + case db7.nodeType.CIRCLE: + bkgElem.attr("transform", "translate(" + node2.width / 2 + ", " + +node2.height / 2 + ")"); + circleBkg(db7, bkgElem, node2, section); + break; + case db7.nodeType.CLOUD: + cloudBkg(db7, bkgElem, node2, section); + break; + case db7.nodeType.BANG: + bangBkg(db7, bkgElem, node2, section); + break; + case db7.nodeType.HEXAGON: + hexagonBkg(db7, bkgElem, node2, section); + break; + } + db7.setElementForId(node2.id, nodeElem); + return node2.height; + }, "drawNode"); + positionNode3 = /* @__PURE__ */ __name(function(db7, node2) { + const nodeElem = db7.getElementById(node2.id); + const x5 = node2.x || 0; + const y5 = node2.y || 0; + nodeElem.attr("transform", "translate(" + x5 + "," + y5 + ")"); + }, "positionNode"); + } + }); + + // src/diagrams/mindmap/mindmapRenderer.ts + async function drawNodes(db7, svg, mindmap, section, conf8) { + await drawNode2(db7, svg, mindmap, section, conf8); + if (mindmap.children) { + await Promise.all( + mindmap.children.map( + (child, index) => drawNodes(db7, svg, child, section < 0 ? index : section, conf8) + ) + ); + } + } + function drawEdges(edgesEl, cy) { + cy.edges().map((edge, id26) => { + const data5 = edge.data(); + if (edge[0]._private.bodyBounds) { + const bounds4 = edge[0]._private.rscratch; + log.trace("Edge: ", id26, data5); + edgesEl.insert("path").attr( + "d", + `M ${bounds4.startX},${bounds4.startY} L ${bounds4.midX},${bounds4.midY} L${bounds4.endX},${bounds4.endY} ` + ).attr("class", "edge section-edge-" + data5.section + " edge-depth-" + data5.depth); + } + }); + } + function addNodes(mindmap, cy, conf8, level) { + cy.add({ + group: "nodes", + data: { + id: mindmap.id.toString(), + labelText: mindmap.descr, + height: mindmap.height, + width: mindmap.width, + level, + nodeId: mindmap.id, + padding: mindmap.padding, + type: mindmap.type + }, + position: { + x: mindmap.x, + y: mindmap.y + } + }); + if (mindmap.children) { + mindmap.children.forEach((child) => { + addNodes(child, cy, conf8, level + 1); + cy.add({ + group: "edges", + data: { + id: `${mindmap.id}_${child.id}`, + source: mindmap.id, + target: child.id, + depth: level, + section: child.section + } + }); + }); + } + } + function layoutMindmap(node2, conf8) { + return new Promise((resolve3) => { + const renderEl = select_default2("body").append("div").attr("id", "cy").attr("style", "display:none"); + const cy = cytoscape2({ + container: document.getElementById("cy"), + // container to render in + style: [ + { + selector: "edge", + style: { + "curve-style": "bezier" + } + } + ] + }); + renderEl.remove(); + addNodes(node2, cy, conf8, 0); + cy.nodes().forEach(function(n2) { + n2.layoutDimensions = () => { + const data5 = n2.data(); + return { w: data5.width, h: data5.height }; + }; + }); + cy.layout({ + name: "cose-bilkent", + // @ts-ignore Types for cose-bilkent are not correct? + quality: "proof", + styleEnabled: false, + animate: false + }).run(); + cy.ready((e3) => { + log.info("Ready", e3); + resolve3(cy); + }); + }); + } + function positionNodes(db7, cy) { + cy.nodes().map((node2, id26) => { + const data5 = node2.data(); + data5.x = node2.position().x; + data5.y = node2.position().y; + positionNode3(db7, data5); + const el = db7.getElementById(data5.nodeId); + log.info("Id:", id26, "Position: (", node2.position().x, ", ", node2.position().y, ")", data5); + el.attr( + "transform", + `translate(${node2.position().x - data5.width / 2}, ${node2.position().y - data5.height / 2})` + ); + el.attr("attr", `apa-${id26})`); + }); + } + var import_cytoscape_cose_bilkent, draw19, mindmapRenderer_default; + var init_mindmapRenderer = __esm({ + "src/diagrams/mindmap/mindmapRenderer.ts"() { + "use strict"; + init_cytoscape_esm(); + import_cytoscape_cose_bilkent = __toESM(require_cytoscape_cose_bilkent(), 1); + init_src32(); + init_diagramAPI(); + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + init_svgDraw6(); + init_defaultConfig(); + cytoscape2.use(import_cytoscape_cose_bilkent.default); + __name(drawNodes, "drawNodes"); + __name(drawEdges, "drawEdges"); + __name(addNodes, "addNodes"); + __name(layoutMindmap, "layoutMindmap"); + __name(positionNodes, "positionNodes"); + draw19 = /* @__PURE__ */ __name(async (text2, id26, _version, diagObj) => { + log.debug("Rendering mindmap diagram\n" + text2); + const db7 = diagObj.db; + const mm = db7.getMindmap(); + if (!mm) { + return; + } + const conf8 = getConfig2(); + conf8.htmlLabels = false; + const svg = selectSvgElement(id26); + const edgesElem = svg.append("g"); + edgesElem.attr("class", "mindmap-edges"); + const nodesElem = svg.append("g"); + nodesElem.attr("class", "mindmap-nodes"); + await drawNodes(db7, nodesElem, mm, -1, conf8); + const cy = await layoutMindmap(mm, conf8); + drawEdges(edgesElem, cy); + positionNodes(db7, cy); + setupGraphViewbox( + void 0, + svg, + conf8.mindmap?.padding ?? defaultConfig_default.mindmap.padding, + conf8.mindmap?.useMaxWidth ?? defaultConfig_default.mindmap.useMaxWidth + ); + }, "draw"); + mindmapRenderer_default = { + draw: draw19 + }; + } + }); + + // src/diagrams/mindmap/styles.ts + var genSections2, getStyles14, styles_default13; + var init_styles13 = __esm({ + "src/diagrams/mindmap/styles.ts"() { + "use strict"; + init_dist(); + genSections2 = /* @__PURE__ */ __name((options3) => { + let sections5 = ""; + for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) { + options3["lineColor" + i2] = options3["lineColor" + i2] || options3["cScaleInv" + i2]; + if (is_dark_default(options3["lineColor" + i2])) { + options3["lineColor" + i2] = lighten_default(options3["lineColor" + i2], 20); + } else { + options3["lineColor" + i2] = darken_default(options3["lineColor" + i2], 20); + } + } + for (let i2 = 0; i2 < options3.THEME_COLOR_LIMIT; i2++) { + const sw = "" + (17 - 3 * i2); + sections5 += ` + .section-${i2 - 1} rect, .section-${i2 - 1} path, .section-${i2 - 1} circle, .section-${i2 - 1} polygon, .section-${i2 - 1} path { + fill: ${options3["cScale" + i2]}; + } + .section-${i2 - 1} text { + fill: ${options3["cScaleLabel" + i2]}; + } + .node-icon-${i2 - 1} { + font-size: 40px; + color: ${options3["cScaleLabel" + i2]}; + } + .section-edge-${i2 - 1}{ + stroke: ${options3["cScale" + i2]}; + } + .edge-depth-${i2 - 1}{ + stroke-width: ${sw}; + } + .section-${i2 - 1} line { + stroke: ${options3["cScaleInv" + i2]} ; + stroke-width: 3; + } + + .disabled, .disabled circle, .disabled text { + fill: lightgray; + } + .disabled text { + fill: #efefef; + } + `; + } + return sections5; + }, "genSections"); + getStyles14 = /* @__PURE__ */ __name((options3) => ` + .edge { + stroke-width: 3; + } + ${genSections2(options3)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${options3.git0}; + } + .section-root text { + fill: ${options3.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .mindmap-node-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } +`, "getStyles"); + styles_default13 = getStyles14; + } + }); + + // src/diagrams/mindmap/mindmap-definition.ts + var mindmap_definition_exports = {}; + __export(mindmap_definition_exports, { + diagram: () => diagram19 + }); + var diagram19; + var init_mindmap_definition = __esm({ + "src/diagrams/mindmap/mindmap-definition.ts"() { + "use strict"; + init_mindmap(); + init_mindmapDb(); + init_mindmapRenderer(); + init_styles13(); + diagram19 = { + db: mindmapDb_default, + renderer: mindmapRenderer_default, + parser: mindmap_default, + styles: styles_default13 + }; + } + }); + + // src/diagrams/sankey/parser/sankey.jison + var parser18, sankey_default; + var init_sankey = __esm({ + "src/diagrams/sankey/parser/sankey.jison"() { + "use strict"; + parser18 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 9], $V1 = [1, 10], $V2 = [1, 5, 10, 12]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "start": 3, "SANKEY": 4, "NEWLINE": 5, "csv": 6, "opt_eof": 7, "record": 8, "csv_tail": 9, "EOF": 10, "field[source]": 11, "COMMA": 12, "field[target]": 13, "field[value]": 14, "field": 15, "escaped": 16, "non_escaped": 17, "DQUOTE": 18, "ESCAPED_TEXT": 19, "NON_ESCAPED_TEXT": 20, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" }, + productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 7: + const source = yy.findOrCreateNode($$[$0 - 4].trim().replaceAll('""', '"')); + const target = yy.findOrCreateNode($$[$0 - 2].trim().replaceAll('""', '"')); + const value2 = parseFloat($$[$0].trim()); + yy.addLink(source, target, value2); + break; + case 8: + case 9: + case 11: + this.$ = $$[$0]; + break; + case 10: + this.$ = $$[$0 - 1]; + break; + } + }, "anonymous"), + table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 1: [2, 6], 7: 11, 10: [1, 12] }, o2($V1, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, o2($V2, [2, 8]), o2($V2, [2, 9]), { 19: [1, 16] }, o2($V2, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, o2($V1, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 15: 18, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 18: [1, 19] }, o2($V1, [2, 3]), { 12: [1, 20] }, o2($V2, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: $V0, 20: $V1 }, o2([1, 5, 10], [2, 7])], + defaultActions: { 11: [2, 1], 12: [2, 5] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; + } + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); } - var childGraph = node2.getChild(); - if (childGraph == null) { - this.toBeTiled[id2] = false; - return false; + token2 = self2.symbols_[token2] || token2; + } + return token2; + } + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); } - var children2 = childGraph.getNodes(); - for (var i2 = 0; i2 < children2.length; i2++) { - var theChild = children2[i2]; - if (this.getNodeDegree(theChild) > 0) { - this.toBeTiled[id2] = false; - return false; - } - if (theChild.getChild() == null) { - this.toBeTiled[theChild.id] = false; - continue; - } - if (!this.getToBeTiled(theChild)) { - this.toBeTiled[id2] = false; - return false; + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); } } - this.toBeTiled[id2] = true; - return true; - }; - CoSELayout.prototype.getNodeDegree = function(node2) { - node2.id; - var edges2 = node2.getEdges(); - var degree = 0; - for (var i2 = 0; i2 < edges2.length; i2++) { - var edge = edges2[i2]; - if (edge.getSource().id !== edge.getTarget().id) { - degree = degree + 1; + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; } - } - return degree; + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: + return true; + } + } + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 }; - CoSELayout.prototype.getNodeDegreeWithChildren = function(node2) { - var degree = this.getNodeDegree(node2); - if (node2.getChild() == null) { - return degree; - } - var children2 = node2.getChild().getNodes(); - for (var i2 = 0; i2 < children2.length; i2++) { - var child = children2[i2]; - degree += this.getNodeDegreeWithChildren(child); - } - return degree; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; - CoSELayout.prototype.performDFSOnCompounds = function() { - this.compoundOrder = []; - this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes()); + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length }; - CoSELayout.prototype.fillCompexOrderByDFS = function(children2) { - for (var i2 = 0; i2 < children2.length; i2++) { - var child = children2[i2]; - if (child.getChild() != null) { - this.fillCompexOrderByDFS(child.getChild().getNodes()); - } - if (this.getToBeTiled(child)) { - this.compoundOrder.push(child); + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; + } + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; + } else { + return false; + } + } else if (!this.options.flex) { + break; } } - }; - CoSELayout.prototype.adjustLocations = function(organization, x2, y2, compoundHorizontalMargin, compoundVerticalMargin) { - x2 += compoundHorizontalMargin; - y2 += compoundVerticalMargin; - var left2 = x2; - for (var i2 = 0; i2 < organization.rows.length; i2++) { - var row = organization.rows[i2]; - x2 = left2; - var maxHeight = 0; - for (var j = 0; j < row.length; j++) { - var lnode = row[j]; - lnode.rect.x = x2; - lnode.rect.y = y2; - x2 += lnode.rect.width + organization.horizontalPadding; - if (lnode.rect.height > maxHeight) - maxHeight = lnode.rect.height; + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; + } + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: { "case-insensitive": true }, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + this.pushState("csv"); + return 4; + break; + case 1: + return 10; + break; + case 2: + return 5; + break; + case 3: + return 12; + break; + case 4: + this.pushState("escaped_text"); + return 18; + break; + case 5: + return 20; + break; + case 6: + this.popState("escaped_text"); + return 18; + break; + case 7: + return 19; + break; + } + }, "anonymous"), + rules: [/^(?:sankey-beta\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i], + conditions: { "csv": { "rules": [1, 2, 3, 4, 5, 6, 7], "inclusive": false }, "escaped_text": { "rules": [6, 7], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser18.parser = parser18; + sankey_default = parser18; + } + }); + + // src/diagrams/sankey/sankeyDB.ts + var links2, nodes5, nodesMap, clear26, SankeyLink, addLink2, SankeyNode, findOrCreateNode, getNodes, getLinks2, getGraph, sankeyDB_default; + var init_sankeyDB = __esm({ + "src/diagrams/sankey/sankeyDB.ts"() { + "use strict"; + init_diagramAPI(); + init_common(); + init_commonDb(); + links2 = []; + nodes5 = []; + nodesMap = /* @__PURE__ */ new Map(); + clear26 = /* @__PURE__ */ __name(() => { + links2 = []; + nodes5 = []; + nodesMap = /* @__PURE__ */ new Map(); + clear(); + }, "clear"); + SankeyLink = class { + constructor(source, target, value2 = 0) { + this.source = source; + this.target = target; + this.value = value2; + } + static { + __name(this, "SankeyLink"); + } + }; + addLink2 = /* @__PURE__ */ __name((source, target, value2) => { + links2.push(new SankeyLink(source, target, value2)); + }, "addLink"); + SankeyNode = class { + constructor(ID) { + this.ID = ID; + } + static { + __name(this, "SankeyNode"); + } + }; + findOrCreateNode = /* @__PURE__ */ __name((ID) => { + ID = common_default.sanitizeText(ID, getConfig2()); + let node2 = nodesMap.get(ID); + if (node2 === void 0) { + node2 = new SankeyNode(ID); + nodesMap.set(ID, node2); + nodes5.push(node2); + } + return node2; + }, "findOrCreateNode"); + getNodes = /* @__PURE__ */ __name(() => nodes5, "getNodes"); + getLinks2 = /* @__PURE__ */ __name(() => links2, "getLinks"); + getGraph = /* @__PURE__ */ __name(() => ({ + nodes: nodes5.map((node2) => ({ id: node2.ID })), + links: links2.map((link3) => ({ + source: link3.source.ID, + target: link3.target.ID, + value: link3.value + })) + }), "getGraph"); + sankeyDB_default = { + nodesMap, + getConfig: /* @__PURE__ */ __name(() => getConfig2().sankey, "getConfig"), + getNodes, + getLinks: getLinks2, + getGraph, + addLink: addLink2, + findOrCreateNode, + getAccTitle, + setAccTitle, + getAccDescription, + setAccDescription, + getDiagramTitle, + setDiagramTitle, + clear: clear26 + }; + } + }); + + // ../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/max.js + function max9(values2, valueof) { + let max10; + if (valueof === void 0) { + for (const value2 of values2) { + if (value2 != null && (max10 < value2 || max10 === void 0 && value2 >= value2)) { + max10 = value2; + } + } + } else { + let index = -1; + for (let value2 of values2) { + if ((value2 = valueof(value2, ++index, values2)) != null && (max10 < value2 || max10 === void 0 && value2 >= value2)) { + max10 = value2; + } + } + } + return max10; + } + var init_max3 = __esm({ + "../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/max.js"() { + "use strict"; + __name(max9, "max"); + } + }); + + // ../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/min.js + function min8(values2, valueof) { + let min9; + if (valueof === void 0) { + for (const value2 of values2) { + if (value2 != null && (min9 > value2 || min9 === void 0 && value2 >= value2)) { + min9 = value2; + } + } + } else { + let index = -1; + for (let value2 of values2) { + if ((value2 = valueof(value2, ++index, values2)) != null && (min9 > value2 || min9 === void 0 && value2 >= value2)) { + min9 = value2; + } + } + } + return min9; + } + var init_min3 = __esm({ + "../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/min.js"() { + "use strict"; + __name(min8, "min"); + } + }); + + // ../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/sum.js + function sum(values2, valueof) { + let sum2 = 0; + if (valueof === void 0) { + for (let value2 of values2) { + if (value2 = +value2) { + sum2 += value2; + } + } + } else { + let index = -1; + for (let value2 of values2) { + if (value2 = +valueof(value2, ++index, values2)) { + sum2 += value2; + } + } + } + return sum2; + } + var init_sum = __esm({ + "../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/sum.js"() { + "use strict"; + __name(sum, "sum"); + } + }); + + // ../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/index.js + var init_src33 = __esm({ + "../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/index.js"() { + "use strict"; + init_max3(); + init_min3(); + init_sum(); + } + }); + + // ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/align.js + function targetDepth(d2) { + return d2.target.depth; + } + function left2(node2) { + return node2.depth; + } + function right2(node2, n2) { + return n2 - 1 - node2.height; + } + function justify(node2, n2) { + return node2.sourceLinks.length ? node2.depth : n2 - 1; + } + function center3(node2) { + return node2.targetLinks.length ? node2.depth : node2.sourceLinks.length ? min8(node2.sourceLinks, targetDepth) - 1 : 0; + } + var init_align = __esm({ + "../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/align.js"() { + "use strict"; + init_src33(); + __name(targetDepth, "targetDepth"); + __name(left2, "left"); + __name(right2, "right"); + __name(justify, "justify"); + __name(center3, "center"); + } + }); + + // ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/constant.js + function constant2(x5) { + return function() { + return x5; + }; + } + var init_constant8 = __esm({ + "../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/constant.js"() { + "use strict"; + __name(constant2, "constant"); + } + }); + + // ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/sankey.js + function ascendingSourceBreadth(a2, b2) { + return ascendingBreadth(a2.source, b2.source) || a2.index - b2.index; + } + function ascendingTargetBreadth(a2, b2) { + return ascendingBreadth(a2.target, b2.target) || a2.index - b2.index; + } + function ascendingBreadth(a2, b2) { + return a2.y0 - b2.y0; + } + function value(d2) { + return d2.value; + } + function defaultId(d2) { + return d2.index; + } + function defaultNodes(graph) { + return graph.nodes; + } + function defaultLinks(graph) { + return graph.links; + } + function find3(nodeById, id26) { + const node2 = nodeById.get(id26); + if (!node2) throw new Error("missing: " + id26); + return node2; + } + function computeLinkBreadths({ nodes: nodes6 }) { + for (const node2 of nodes6) { + let y0 = node2.y0; + let y1 = y0; + for (const link3 of node2.sourceLinks) { + link3.y0 = y0 + link3.width / 2; + y0 += link3.width; + } + for (const link3 of node2.targetLinks) { + link3.y1 = y1 + link3.width / 2; + y1 += link3.width; + } + } + } + function Sankey() { + let x0 = 0, y0 = 0, x1 = 1, y1 = 1; + let dx = 24; + let dy = 8, py; + let id26 = defaultId; + let align = justify; + let sort3; + let linkSort; + let nodes6 = defaultNodes; + let links3 = defaultLinks; + let iterations = 6; + function sankey() { + const graph = { nodes: nodes6.apply(null, arguments), links: links3.apply(null, arguments) }; + computeNodeLinks(graph); + computeNodeValues(graph); + computeNodeDepths(graph); + computeNodeHeights(graph); + computeNodeBreadths(graph); + computeLinkBreadths(graph); + return graph; + } + __name(sankey, "sankey"); + sankey.update = function(graph) { + computeLinkBreadths(graph); + return graph; + }; + sankey.nodeId = function(_2) { + return arguments.length ? (id26 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : id26; + }; + sankey.nodeAlign = function(_2) { + return arguments.length ? (align = typeof _2 === "function" ? _2 : constant2(_2), sankey) : align; + }; + sankey.nodeSort = function(_2) { + return arguments.length ? (sort3 = _2, sankey) : sort3; + }; + sankey.nodeWidth = function(_2) { + return arguments.length ? (dx = +_2, sankey) : dx; + }; + sankey.nodePadding = function(_2) { + return arguments.length ? (dy = py = +_2, sankey) : dy; + }; + sankey.nodes = function(_2) { + return arguments.length ? (nodes6 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : nodes6; + }; + sankey.links = function(_2) { + return arguments.length ? (links3 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : links3; + }; + sankey.linkSort = function(_2) { + return arguments.length ? (linkSort = _2, sankey) : linkSort; + }; + sankey.size = function(_2) { + return arguments.length ? (x0 = y0 = 0, x1 = +_2[0], y1 = +_2[1], sankey) : [x1 - x0, y1 - y0]; + }; + sankey.extent = function(_2) { + return arguments.length ? (x0 = +_2[0][0], x1 = +_2[1][0], y0 = +_2[0][1], y1 = +_2[1][1], sankey) : [[x0, y0], [x1, y1]]; + }; + sankey.iterations = function(_2) { + return arguments.length ? (iterations = +_2, sankey) : iterations; + }; + function computeNodeLinks({ nodes: nodes7, links: links4 }) { + for (const [i2, node2] of nodes7.entries()) { + node2.index = i2; + node2.sourceLinks = []; + node2.targetLinks = []; + } + const nodeById = new Map(nodes7.map((d2, i2) => [id26(d2, i2, nodes7), d2])); + for (const [i2, link3] of links4.entries()) { + link3.index = i2; + let { source, target } = link3; + if (typeof source !== "object") source = link3.source = find3(nodeById, source); + if (typeof target !== "object") target = link3.target = find3(nodeById, target); + source.sourceLinks.push(link3); + target.targetLinks.push(link3); + } + if (linkSort != null) { + for (const { sourceLinks, targetLinks } of nodes7) { + sourceLinks.sort(linkSort); + targetLinks.sort(linkSort); + } + } + } + __name(computeNodeLinks, "computeNodeLinks"); + function computeNodeValues({ nodes: nodes7 }) { + for (const node2 of nodes7) { + node2.value = node2.fixedValue === void 0 ? Math.max(sum(node2.sourceLinks, value), sum(node2.targetLinks, value)) : node2.fixedValue; + } + } + __name(computeNodeValues, "computeNodeValues"); + function computeNodeDepths({ nodes: nodes7 }) { + const n2 = nodes7.length; + let current = new Set(nodes7); + let next3 = /* @__PURE__ */ new Set(); + let x5 = 0; + while (current.size) { + for (const node2 of current) { + node2.depth = x5; + for (const { target } of node2.sourceLinks) { + next3.add(target); + } + } + if (++x5 > n2) throw new Error("circular link"); + current = next3; + next3 = /* @__PURE__ */ new Set(); + } + } + __name(computeNodeDepths, "computeNodeDepths"); + function computeNodeHeights({ nodes: nodes7 }) { + const n2 = nodes7.length; + let current = new Set(nodes7); + let next3 = /* @__PURE__ */ new Set(); + let x5 = 0; + while (current.size) { + for (const node2 of current) { + node2.height = x5; + for (const { source } of node2.targetLinks) { + next3.add(source); + } + } + if (++x5 > n2) throw new Error("circular link"); + current = next3; + next3 = /* @__PURE__ */ new Set(); + } + } + __name(computeNodeHeights, "computeNodeHeights"); + function computeNodeLayers({ nodes: nodes7 }) { + const x5 = max9(nodes7, (d2) => d2.depth) + 1; + const kx = (x1 - x0 - dx) / (x5 - 1); + const columns = new Array(x5); + for (const node2 of nodes7) { + const i2 = Math.max(0, Math.min(x5 - 1, Math.floor(align.call(null, node2, x5)))); + node2.layer = i2; + node2.x0 = x0 + i2 * kx; + node2.x1 = node2.x0 + dx; + if (columns[i2]) columns[i2].push(node2); + else columns[i2] = [node2]; + } + if (sort3) for (const column2 of columns) { + column2.sort(sort3); + } + return columns; + } + __name(computeNodeLayers, "computeNodeLayers"); + function initializeNodeBreadths(columns) { + const ky = min8(columns, (c3) => (y1 - y0 - (c3.length - 1) * py) / sum(c3, value)); + for (const nodes7 of columns) { + let y5 = y0; + for (const node2 of nodes7) { + node2.y0 = y5; + node2.y1 = y5 + node2.value * ky; + y5 = node2.y1 + py; + for (const link3 of node2.sourceLinks) { + link3.width = link3.value * ky; + } + } + y5 = (y1 - y5 + py) / (nodes7.length + 1); + for (let i2 = 0; i2 < nodes7.length; ++i2) { + const node2 = nodes7[i2]; + node2.y0 += y5 * (i2 + 1); + node2.y1 += y5 * (i2 + 1); + } + reorderLinks(nodes7); + } + } + __name(initializeNodeBreadths, "initializeNodeBreadths"); + function computeNodeBreadths(graph) { + const columns = computeNodeLayers(graph); + py = Math.min(dy, (y1 - y0) / (max9(columns, (c3) => c3.length) - 1)); + initializeNodeBreadths(columns); + for (let i2 = 0; i2 < iterations; ++i2) { + const alpha = Math.pow(0.99, i2); + const beta = Math.max(1 - alpha, (i2 + 1) / iterations); + relaxRightToLeft(columns, alpha, beta); + relaxLeftToRight(columns, alpha, beta); + } + } + __name(computeNodeBreadths, "computeNodeBreadths"); + function relaxLeftToRight(columns, alpha, beta) { + for (let i2 = 1, n2 = columns.length; i2 < n2; ++i2) { + const column2 = columns[i2]; + for (const target of column2) { + let y5 = 0; + let w3 = 0; + for (const { source, value: value2 } of target.targetLinks) { + let v3 = value2 * (target.layer - source.layer); + y5 += targetTop(source, target) * v3; + w3 += v3; + } + if (!(w3 > 0)) continue; + let dy2 = (y5 / w3 - target.y0) * alpha; + target.y0 += dy2; + target.y1 += dy2; + reorderNodeLinks(target); + } + if (sort3 === void 0) column2.sort(ascendingBreadth); + resolveCollisions(column2, beta); + } + } + __name(relaxLeftToRight, "relaxLeftToRight"); + function relaxRightToLeft(columns, alpha, beta) { + for (let n2 = columns.length, i2 = n2 - 2; i2 >= 0; --i2) { + const column2 = columns[i2]; + for (const source of column2) { + let y5 = 0; + let w3 = 0; + for (const { target, value: value2 } of source.sourceLinks) { + let v3 = value2 * (target.layer - source.layer); + y5 += sourceTop(source, target) * v3; + w3 += v3; + } + if (!(w3 > 0)) continue; + let dy2 = (y5 / w3 - source.y0) * alpha; + source.y0 += dy2; + source.y1 += dy2; + reorderNodeLinks(source); + } + if (sort3 === void 0) column2.sort(ascendingBreadth); + resolveCollisions(column2, beta); + } + } + __name(relaxRightToLeft, "relaxRightToLeft"); + function resolveCollisions(nodes7, alpha) { + const i2 = nodes7.length >> 1; + const subject = nodes7[i2]; + resolveCollisionsBottomToTop(nodes7, subject.y0 - py, i2 - 1, alpha); + resolveCollisionsTopToBottom(nodes7, subject.y1 + py, i2 + 1, alpha); + resolveCollisionsBottomToTop(nodes7, y1, nodes7.length - 1, alpha); + resolveCollisionsTopToBottom(nodes7, y0, 0, alpha); + } + __name(resolveCollisions, "resolveCollisions"); + function resolveCollisionsTopToBottom(nodes7, y5, i2, alpha) { + for (; i2 < nodes7.length; ++i2) { + const node2 = nodes7[i2]; + const dy2 = (y5 - node2.y0) * alpha; + if (dy2 > 1e-6) node2.y0 += dy2, node2.y1 += dy2; + y5 = node2.y1 + py; + } + } + __name(resolveCollisionsTopToBottom, "resolveCollisionsTopToBottom"); + function resolveCollisionsBottomToTop(nodes7, y5, i2, alpha) { + for (; i2 >= 0; --i2) { + const node2 = nodes7[i2]; + const dy2 = (node2.y1 - y5) * alpha; + if (dy2 > 1e-6) node2.y0 -= dy2, node2.y1 -= dy2; + y5 = node2.y0 - py; + } + } + __name(resolveCollisionsBottomToTop, "resolveCollisionsBottomToTop"); + function reorderNodeLinks({ sourceLinks, targetLinks }) { + if (linkSort === void 0) { + for (const { source: { sourceLinks: sourceLinks2 } } of targetLinks) { + sourceLinks2.sort(ascendingTargetBreadth); + } + for (const { target: { targetLinks: targetLinks2 } } of sourceLinks) { + targetLinks2.sort(ascendingSourceBreadth); + } + } + } + __name(reorderNodeLinks, "reorderNodeLinks"); + function reorderLinks(nodes7) { + if (linkSort === void 0) { + for (const { sourceLinks, targetLinks } of nodes7) { + sourceLinks.sort(ascendingTargetBreadth); + targetLinks.sort(ascendingSourceBreadth); + } + } + } + __name(reorderLinks, "reorderLinks"); + function targetTop(source, target) { + let y5 = source.y0 - (source.sourceLinks.length - 1) * py / 2; + for (const { target: node2, width: width3 } of source.sourceLinks) { + if (node2 === target) break; + y5 += width3 + py; + } + for (const { source: node2, width: width3 } of target.targetLinks) { + if (node2 === source) break; + y5 -= width3; + } + return y5; + } + __name(targetTop, "targetTop"); + function sourceTop(source, target) { + let y5 = target.y0 - (target.targetLinks.length - 1) * py / 2; + for (const { source: node2, width: width3 } of target.targetLinks) { + if (node2 === source) break; + y5 += width3 + py; + } + for (const { target: node2, width: width3 } of source.sourceLinks) { + if (node2 === target) break; + y5 -= width3; + } + return y5; + } + __name(sourceTop, "sourceTop"); + return sankey; + } + var init_sankey2 = __esm({ + "../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/sankey.js"() { + "use strict"; + init_src33(); + init_align(); + init_constant8(); + __name(ascendingSourceBreadth, "ascendingSourceBreadth"); + __name(ascendingTargetBreadth, "ascendingTargetBreadth"); + __name(ascendingBreadth, "ascendingBreadth"); + __name(value, "value"); + __name(defaultId, "defaultId"); + __name(defaultNodes, "defaultNodes"); + __name(defaultLinks, "defaultLinks"); + __name(find3, "find"); + __name(computeLinkBreadths, "computeLinkBreadths"); + __name(Sankey, "Sankey"); + } + }); + + // ../../node_modules/.pnpm/d3-path@1.0.9/node_modules/d3-path/src/path.js + function Path2() { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null; + this._ = ""; + } + function path3() { + return new Path2(); + } + var pi3, tau3, epsilon5, tauEpsilon2, path_default; + var init_path3 = __esm({ + "../../node_modules/.pnpm/d3-path@1.0.9/node_modules/d3-path/src/path.js"() { + "use strict"; + pi3 = Math.PI; + tau3 = 2 * pi3; + epsilon5 = 1e-6; + tauEpsilon2 = tau3 - epsilon5; + __name(Path2, "Path"); + __name(path3, "path"); + Path2.prototype = path3.prototype = { + constructor: Path2, + moveTo: /* @__PURE__ */ __name(function(x5, y5) { + this._ += "M" + (this._x0 = this._x1 = +x5) + "," + (this._y0 = this._y1 = +y5); + }, "moveTo"), + closePath: /* @__PURE__ */ __name(function() { + if (this._x1 !== null) { + this._x1 = this._x0, this._y1 = this._y0; + this._ += "Z"; + } + }, "closePath"), + lineTo: /* @__PURE__ */ __name(function(x5, y5) { + this._ += "L" + (this._x1 = +x5) + "," + (this._y1 = +y5); + }, "lineTo"), + quadraticCurveTo: /* @__PURE__ */ __name(function(x1, y1, x5, y5) { + this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x5) + "," + (this._y1 = +y5); + }, "quadraticCurveTo"), + bezierCurveTo: /* @__PURE__ */ __name(function(x1, y1, x22, y22, x5, y5) { + this._ += "C" + +x1 + "," + +y1 + "," + +x22 + "," + +y22 + "," + (this._x1 = +x5) + "," + (this._y1 = +y5); + }, "bezierCurveTo"), + arcTo: /* @__PURE__ */ __name(function(x1, y1, x22, y22, r2) { + x1 = +x1, y1 = +y1, x22 = +x22, y22 = +y22, r2 = +r2; + var x0 = this._x1, y0 = this._y1, x21 = x22 - x1, y21 = y22 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01; + if (r2 < 0) throw new Error("negative radius: " + r2); + if (this._x1 === null) { + this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); + } else if (!(l01_2 > epsilon5)) ; + else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon5) || !r2) { + this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); + } else { + var x20 = x22 - x0, y20 = y22 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l2 = r2 * Math.tan((pi3 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l2 / l01, t21 = l2 / l21; + if (Math.abs(t01 - 1) > epsilon5) { + this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); + } + this._ += "A" + r2 + "," + r2 + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); + } + }, "arcTo"), + arc: /* @__PURE__ */ __name(function(x5, y5, r2, a0, a1, ccw) { + x5 = +x5, y5 = +y5, r2 = +r2, ccw = !!ccw; + var dx = r2 * Math.cos(a0), dy = r2 * Math.sin(a0), x0 = x5 + dx, y0 = y5 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; + if (r2 < 0) throw new Error("negative radius: " + r2); + if (this._x1 === null) { + this._ += "M" + x0 + "," + y0; + } else if (Math.abs(this._x1 - x0) > epsilon5 || Math.abs(this._y1 - y0) > epsilon5) { + this._ += "L" + x0 + "," + y0; + } + if (!r2) return; + if (da < 0) da = da % tau3 + tau3; + if (da > tauEpsilon2) { + this._ += "A" + r2 + "," + r2 + ",0,1," + cw + "," + (x5 - dx) + "," + (y5 - dy) + "A" + r2 + "," + r2 + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); + } else if (da > epsilon5) { + this._ += "A" + r2 + "," + r2 + ",0," + +(da >= pi3) + "," + cw + "," + (this._x1 = x5 + r2 * Math.cos(a1)) + "," + (this._y1 = y5 + r2 * Math.sin(a1)); + } + }, "arc"), + rect: /* @__PURE__ */ __name(function(x5, y5, w3, h2) { + this._ += "M" + (this._x0 = this._x1 = +x5) + "," + (this._y0 = this._y1 = +y5) + "h" + +w3 + "v" + +h2 + "h" + -w3 + "Z"; + }, "rect"), + toString: /* @__PURE__ */ __name(function() { + return this._; + }, "toString") + }; + path_default = path3; + } + }); + + // ../../node_modules/.pnpm/d3-path@1.0.9/node_modules/d3-path/src/index.js + var init_src34 = __esm({ + "../../node_modules/.pnpm/d3-path@1.0.9/node_modules/d3-path/src/index.js"() { + "use strict"; + init_path3(); + } + }); + + // ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/constant.js + function constant_default7(x5) { + return /* @__PURE__ */ __name(function constant3() { + return x5; + }, "constant"); + } + var init_constant9 = __esm({ + "../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/constant.js"() { + "use strict"; + __name(constant_default7, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/point.js + function x4(p3) { + return p3[0]; + } + function y4(p3) { + return p3[1]; + } + var init_point2 = __esm({ + "../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/point.js"() { + "use strict"; + __name(x4, "x"); + __name(y4, "y"); + } + }); + + // ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/array.js + var slice3; + var init_array4 = __esm({ + "../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/array.js"() { + "use strict"; + slice3 = Array.prototype.slice; + } + }); + + // ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/link/index.js + function linkSource(d2) { + return d2.source; + } + function linkTarget(d2) { + return d2.target; + } + function link2(curve) { + var source = linkSource, target = linkTarget, x5 = x4, y5 = y4, context = null; + function link3() { + var buffer, argv = slice3.call(arguments), s2 = source.apply(this, argv), t4 = target.apply(this, argv); + if (!context) context = buffer = path_default(); + curve(context, +x5.apply(this, (argv[0] = s2, argv)), +y5.apply(this, argv), +x5.apply(this, (argv[0] = t4, argv)), +y5.apply(this, argv)); + if (buffer) return context = null, buffer + "" || null; + } + __name(link3, "link"); + link3.source = function(_2) { + return arguments.length ? (source = _2, link3) : source; + }; + link3.target = function(_2) { + return arguments.length ? (target = _2, link3) : target; + }; + link3.x = function(_2) { + return arguments.length ? (x5 = typeof _2 === "function" ? _2 : constant_default7(+_2), link3) : x5; + }; + link3.y = function(_2) { + return arguments.length ? (y5 = typeof _2 === "function" ? _2 : constant_default7(+_2), link3) : y5; + }; + link3.context = function(_2) { + return arguments.length ? (context = _2 == null ? null : _2, link3) : context; + }; + return link3; + } + function curveHorizontal(context, x0, y0, x1, y1) { + context.moveTo(x0, y0); + context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1); + } + function linkHorizontal() { + return link2(curveHorizontal); + } + var init_link = __esm({ + "../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/link/index.js"() { + "use strict"; + init_src34(); + init_array4(); + init_constant9(); + init_point2(); + __name(linkSource, "linkSource"); + __name(linkTarget, "linkTarget"); + __name(link2, "link"); + __name(curveHorizontal, "curveHorizontal"); + __name(linkHorizontal, "linkHorizontal"); + } + }); + + // ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/index.js + var init_src35 = __esm({ + "../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/index.js"() { + "use strict"; + init_link(); + } + }); + + // ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/sankeyLinkHorizontal.js + function horizontalSource(d2) { + return [d2.source.x1, d2.y0]; + } + function horizontalTarget(d2) { + return [d2.target.x0, d2.y1]; + } + function sankeyLinkHorizontal_default() { + return linkHorizontal().source(horizontalSource).target(horizontalTarget); + } + var init_sankeyLinkHorizontal = __esm({ + "../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/sankeyLinkHorizontal.js"() { + "use strict"; + init_src35(); + __name(horizontalSource, "horizontalSource"); + __name(horizontalTarget, "horizontalTarget"); + __name(sankeyLinkHorizontal_default, "default"); + } + }); + + // ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/index.js + var init_src36 = __esm({ + "../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/index.js"() { + "use strict"; + init_sankey2(); + init_align(); + init_sankeyLinkHorizontal(); + } + }); + + // src/rendering-util/uid.ts + var Uid; + var init_uid = __esm({ + "src/rendering-util/uid.ts"() { + "use strict"; + Uid = class _Uid { + static { + __name(this, "Uid"); + } + static { + this.count = 0; + } + static next(name) { + return new _Uid(name + ++_Uid.count); + } + constructor(id26) { + this.id = id26; + this.href = `#${id26}`; + } + toString() { + return "url(" + this.href + ")"; + } + }; + } + }); + + // src/diagrams/sankey/sankeyRenderer.ts + var alignmentsMap, draw20, sankeyRenderer_default; + var init_sankeyRenderer = __esm({ + "src/diagrams/sankey/sankeyRenderer.ts"() { + "use strict"; + init_diagramAPI(); + init_src32(); + init_src36(); + init_setupGraphViewbox(); + init_uid(); + alignmentsMap = { + left: left2, + right: right2, + center: center3, + justify + }; + draw20 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + const { securityLevel, sankey: conf8 } = getConfig2(); + const defaultSankeyConfig = defaultConfig2.sankey; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); + const width3 = conf8?.width ?? defaultSankeyConfig.width; + const height2 = conf8?.height ?? defaultSankeyConfig.width; + const useMaxWidth = conf8?.useMaxWidth ?? defaultSankeyConfig.useMaxWidth; + const nodeAlignment = conf8?.nodeAlignment ?? defaultSankeyConfig.nodeAlignment; + const prefix = conf8?.prefix ?? defaultSankeyConfig.prefix; + const suffix = conf8?.suffix ?? defaultSankeyConfig.suffix; + const showValues = conf8?.showValues ?? defaultSankeyConfig.showValues; + const graph = diagObj.db.getGraph(); + const nodeAlign = alignmentsMap[nodeAlignment]; + const nodeWidth = 10; + const sankey = Sankey().nodeId((d2) => d2.id).nodeWidth(nodeWidth).nodePadding(10 + (showValues ? 15 : 0)).nodeAlign(nodeAlign).extent([ + [0, 0], + [width3, height2] + ]); + sankey(graph); + const colorScheme = ordinal(Tableau10_default); + svg.append("g").attr("class", "nodes").selectAll(".node").data(graph.nodes).join("g").attr("class", "node").attr("id", (d2) => (d2.uid = Uid.next("node-")).id).attr("transform", function(d2) { + return "translate(" + d2.x0 + "," + d2.y0 + ")"; + }).attr("x", (d2) => d2.x0).attr("y", (d2) => d2.y0).append("rect").attr("height", (d2) => { + return d2.y1 - d2.y0; + }).attr("width", (d2) => d2.x1 - d2.x0).attr("fill", (d2) => colorScheme(d2.id)); + const getText = /* @__PURE__ */ __name(({ id: id27, value: value2 }) => { + if (!showValues) { + return id27; + } + return `${id27} +${prefix}${Math.round(value2 * 100) / 100}${suffix}`; + }, "getText"); + svg.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(graph.nodes).join("text").attr("x", (d2) => d2.x0 < width3 / 2 ? d2.x1 + 6 : d2.x0 - 6).attr("y", (d2) => (d2.y1 + d2.y0) / 2).attr("dy", `${showValues ? "0" : "0.35"}em`).attr("text-anchor", (d2) => d2.x0 < width3 / 2 ? "start" : "end").text(getText); + const link3 = svg.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(graph.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"); + const linkColor = conf8?.linkColor ?? "gradient"; + if (linkColor === "gradient") { + const gradient = link3.append("linearGradient").attr("id", (d2) => (d2.uid = Uid.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (d2) => d2.source.x1).attr("x2", (d2) => d2.target.x0); + gradient.append("stop").attr("offset", "0%").attr("stop-color", (d2) => colorScheme(d2.source.id)); + gradient.append("stop").attr("offset", "100%").attr("stop-color", (d2) => colorScheme(d2.target.id)); + } + let coloring; + switch (linkColor) { + case "gradient": + coloring = /* @__PURE__ */ __name((d2) => d2.uid, "coloring"); + break; + case "source": + coloring = /* @__PURE__ */ __name((d2) => colorScheme(d2.source.id), "coloring"); + break; + case "target": + coloring = /* @__PURE__ */ __name((d2) => colorScheme(d2.target.id), "coloring"); + break; + default: + coloring = linkColor; + } + link3.append("path").attr("d", sankeyLinkHorizontal_default()).attr("stroke", coloring).attr("stroke-width", (d2) => Math.max(1, d2.width)); + setupGraphViewbox(void 0, svg, 0, useMaxWidth); + }, "draw"); + sankeyRenderer_default = { + draw: draw20 + }; + } + }); + + // src/diagrams/sankey/sankeyUtils.ts + var prepareTextForParsing; + var init_sankeyUtils = __esm({ + "src/diagrams/sankey/sankeyUtils.ts"() { + "use strict"; + prepareTextForParsing = /* @__PURE__ */ __name((text2) => { + const textToParse = text2.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, "\n").trim(); + return textToParse; + }, "prepareTextForParsing"); + } + }); + + // src/diagrams/sankey/sankeyDiagram.ts + var sankeyDiagram_exports = {}; + __export(sankeyDiagram_exports, { + diagram: () => diagram20 + }); + var originalParse, diagram20; + var init_sankeyDiagram = __esm({ + "src/diagrams/sankey/sankeyDiagram.ts"() { + "use strict"; + init_sankey(); + init_sankeyDB(); + init_sankeyRenderer(); + init_sankeyUtils(); + originalParse = sankey_default.parse.bind(sankey_default); + sankey_default.parse = (text2) => originalParse(prepareTextForParsing(text2)); + diagram20 = { + parser: sankey_default, + db: sankeyDB_default, + renderer: sankeyRenderer_default + }; + } + }); + + // src/diagrams/packet/db.ts + var defaultPacketData, data4, DEFAULT_PACKET_CONFIG, getConfig5, getPacket, pushWord, clear27, db5; + var init_db = __esm({ + "src/diagrams/packet/db.ts"() { + "use strict"; + init_config(); + init_defaultConfig(); + init_utils2(); + init_commonDb(); + defaultPacketData = { + packet: [] + }; + data4 = structuredClone(defaultPacketData); + DEFAULT_PACKET_CONFIG = defaultConfig_default.packet; + getConfig5 = /* @__PURE__ */ __name(() => { + const config6 = cleanAndMerge({ + ...DEFAULT_PACKET_CONFIG, + ...getConfig().packet + }); + if (config6.showBits) { + config6.paddingY += 10; + } + return config6; + }, "getConfig"); + getPacket = /* @__PURE__ */ __name(() => data4.packet, "getPacket"); + pushWord = /* @__PURE__ */ __name((word) => { + if (word.length > 0) { + data4.packet.push(word); + } + }, "pushWord"); + clear27 = /* @__PURE__ */ __name(() => { + clear(); + data4 = structuredClone(defaultPacketData); + }, "clear"); + db5 = { + pushWord, + getPacket, + getConfig: getConfig5, + clear: clear27, + setAccTitle, + getAccTitle, + setDiagramTitle, + getDiagramTitle, + getAccDescription, + setAccDescription + }; + } + }); + + // src/diagrams/packet/parser.ts + var maxPacketSize, populate16, getNextFittingBlock, parser19; + var init_parser3 = __esm({ + "src/diagrams/packet/parser.ts"() { + "use strict"; + init_mermaid_parser_core(); + init_logger(); + init_populateCommonDb(); + init_db(); + maxPacketSize = 1e4; + populate16 = /* @__PURE__ */ __name((ast) => { + populateCommonDb(ast, db5); + let lastByte = -1; + let word = []; + let row = 1; + const { bitsPerRow } = db5.getConfig(); + for (let { start: start3, end: end2, label } of ast.blocks) { + if (end2 && end2 < start3) { + throw new Error(`Packet block ${start3} - ${end2} is invalid. End must be greater than start.`); + } + if (start3 !== lastByte + 1) { + throw new Error( + `Packet block ${start3} - ${end2 ?? start3} is not contiguous. It should start from ${lastByte + 1}.` + ); + } + lastByte = end2 ?? start3; + log.debug(`Packet block ${start3} - ${lastByte} with label ${label}`); + while (word.length <= bitsPerRow + 1 && db5.getPacket().length < maxPacketSize) { + const [block3, nextBlock] = getNextFittingBlock({ start: start3, end: end2, label }, row, bitsPerRow); + word.push(block3); + if (block3.end + 1 === row * bitsPerRow) { + db5.pushWord(word); + word = []; + row++; + } + if (!nextBlock) { + break; + } + ({ start: start3, end: end2, label } = nextBlock); + } + } + db5.pushWord(word); + }, "populate"); + getNextFittingBlock = /* @__PURE__ */ __name((block3, row, bitsPerRow) => { + if (block3.end === void 0) { + block3.end = block3.start; + } + if (block3.start > block3.end) { + throw new Error(`Block start ${block3.start} is greater than block end ${block3.end}.`); + } + if (block3.end + 1 <= row * bitsPerRow) { + return [block3, void 0]; + } + return [ + { + start: block3.start, + end: row * bitsPerRow - 1, + label: block3.label + }, + { + start: row * bitsPerRow, + end: block3.end, + label: block3.label + } + ]; + }, "getNextFittingBlock"); + parser19 = { + parse: /* @__PURE__ */ __name(async (input) => { + const ast = await parse2("packet", input); + log.debug(ast); + populate16(ast); + }, "parse") + }; + } + }); + + // src/diagrams/packet/renderer.ts + var draw21, drawWord, renderer6; + var init_renderer = __esm({ + "src/diagrams/packet/renderer.ts"() { + "use strict"; + init_selectSvgElement(); + init_setupGraphViewbox(); + draw21 = /* @__PURE__ */ __name((_text, id26, _version, diagram23) => { + const db7 = diagram23.db; + const config6 = db7.getConfig(); + const { rowHeight, paddingY, bitWidth, bitsPerRow } = config6; + const words = db7.getPacket(); + const title2 = db7.getDiagramTitle(); + const totalRowHeight = rowHeight + paddingY; + const svgHeight = totalRowHeight * (words.length + 1) - (title2 ? 0 : rowHeight); + const svgWidth = bitWidth * bitsPerRow + 2; + const svg = selectSvgElement(id26); + svg.attr("viewbox", `0 0 ${svgWidth} ${svgHeight}`); + configureSvgSize(svg, svgHeight, svgWidth, config6.useMaxWidth); + for (const [word, packet2] of words.entries()) { + drawWord(svg, packet2, word, config6); + } + svg.append("text").text(title2).attr("x", svgWidth / 2).attr("y", svgHeight - totalRowHeight / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle"); + }, "draw"); + drawWord = /* @__PURE__ */ __name((svg, word, rowNumber, { rowHeight, paddingX, paddingY, bitWidth, bitsPerRow, showBits }) => { + const group2 = svg.append("g"); + const wordY = rowNumber * (rowHeight + paddingY) + paddingY; + for (const block3 of word) { + const blockX = block3.start % bitsPerRow * bitWidth + 1; + const width3 = (block3.end - block3.start + 1) * bitWidth - paddingX; + group2.append("rect").attr("x", blockX).attr("y", wordY).attr("width", width3).attr("height", rowHeight).attr("class", "packetBlock"); + group2.append("text").attr("x", blockX + width3 / 2).attr("y", wordY + rowHeight / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(block3.label); + if (!showBits) { + continue; + } + const isSingleBlock = block3.end === block3.start; + const bitNumberY = wordY - 2; + group2.append("text").attr("x", blockX + (isSingleBlock ? width3 / 2 : 0)).attr("y", bitNumberY).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", isSingleBlock ? "middle" : "start").text(block3.start); + if (!isSingleBlock) { + group2.append("text").attr("x", blockX + width3).attr("y", bitNumberY).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(block3.end); + } + } + }, "drawWord"); + renderer6 = { draw: draw21 }; + } + }); + + // src/diagrams/packet/styles.ts + var defaultPacketStyleOptions, styles2; + var init_styles14 = __esm({ + "src/diagrams/packet/styles.ts"() { + "use strict"; + init_utils2(); + defaultPacketStyleOptions = { + byteFontSize: "10px", + startByteColor: "black", + endByteColor: "black", + labelColor: "black", + labelFontSize: "12px", + titleColor: "black", + titleFontSize: "14px", + blockStrokeColor: "black", + blockStrokeWidth: "1", + blockFillColor: "#efefef" + }; + styles2 = /* @__PURE__ */ __name(({ packet: packet2 } = {}) => { + const options3 = cleanAndMerge(defaultPacketStyleOptions, packet2); + return ` + .packetByte { + font-size: ${options3.byteFontSize}; + } + .packetByte.start { + fill: ${options3.startByteColor}; + } + .packetByte.end { + fill: ${options3.endByteColor}; + } + .packetLabel { + fill: ${options3.labelColor}; + font-size: ${options3.labelFontSize}; + } + .packetTitle { + fill: ${options3.titleColor}; + font-size: ${options3.titleFontSize}; + } + .packetBlock { + stroke: ${options3.blockStrokeColor}; + stroke-width: ${options3.blockStrokeWidth}; + fill: ${options3.blockFillColor}; + } + `; + }, "styles"); + } + }); + + // src/diagrams/packet/diagram.ts + var diagram_exports = {}; + __export(diagram_exports, { + diagram: () => diagram21 + }); + var diagram21; + var init_diagram = __esm({ + "src/diagrams/packet/diagram.ts"() { + "use strict"; + init_db(); + init_parser3(); + init_renderer(); + init_styles14(); + diagram21 = { + parser: parser19, + db: db5, + renderer: renderer6, + styles: styles2 + }; + } + }); + + // src/diagrams/block/parser/block.jison + var parser20, block_default; + var init_block = __esm({ + "src/diagrams/block/parser/block.jison"() { + "use strict"; + parser20 = function() { + var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) { + for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; + return o3; + }, "o"), $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49]; + var parser21 = { + trace: /* @__PURE__ */ __name(function trace() { + }, "trace"), + yy: {}, + symbols_: { "error": 2, "spaceLines": 3, "SPACELINE": 4, "NL": 5, "separator": 6, "SPACE": 7, "EOF": 8, "start": 9, "BLOCK_DIAGRAM_KEY": 10, "document": 11, "stop": 12, "statement": 13, "link": 14, "LINK": 15, "START_LINK": 16, "LINK_LABEL": 17, "STR": 18, "nodeStatement": 19, "columnsStatement": 20, "SPACE_BLOCK": 21, "blockStatement": 22, "classDefStatement": 23, "cssClassStatement": 24, "styleStatement": 25, "node": 26, "SIZE": 27, "COLUMNS": 28, "id-block": 29, "end": 30, "block": 31, "NODE_ID": 32, "nodeShapeNLabel": 33, "dirList": 34, "DIR": 35, "NODE_DSTART": 36, "NODE_DEND": 37, "BLOCK_ARROW_START": 38, "BLOCK_ARROW_END": 39, "classDef": 40, "CLASSDEF_ID": 41, "CLASSDEF_STYLEOPTS": 42, "DEFAULT": 43, "class": 44, "CLASSENTITY_IDS": 45, "STYLECLASS": 46, "style": 47, "STYLE_ENTITY_IDS": 48, "STYLE_DEFINITION_DATA": 49, "$accept": 0, "$end": 1 }, + terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" }, + productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]], + performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { + var $0 = $$.length - 1; + switch (yystate) { + case 4: + yy.getLogger().debug("Rule: separator (NL) "); + break; + case 5: + yy.getLogger().debug("Rule: separator (Space) "); + break; + case 6: + yy.getLogger().debug("Rule: separator (EOF) "); + break; + case 7: + yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]); + yy.setHierarchy($$[$0 - 1]); + break; + case 8: + yy.getLogger().debug("Stop NL "); + break; + case 9: + yy.getLogger().debug("Stop EOF "); + break; + case 10: + yy.getLogger().debug("Stop NL2 "); + break; + case 11: + yy.getLogger().debug("Stop EOF2 "); + break; + case 12: + yy.getLogger().debug("Rule: statement: ", $$[$0]); + typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]]; + break; + case 13: + yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]); + this.$ = [$$[$0 - 1]].concat($$[$0]); + break; + case 14: + yy.getLogger().debug("Rule: link: ", $$[$0], yytext); + this.$ = { edgeTypeStr: $$[$0], label: "" }; + break; + case 15: + yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]); + this.$ = { edgeTypeStr: $$[$0], label: $$[$0 - 1] }; + break; + case 18: + const num = parseInt($$[$0]); + const spaceId = yy.generateId(); + this.$ = { id: spaceId, type: "space", label: "", width: num, children: [] }; + break; + case 23: + yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr); + const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr); + this.$ = [ + { id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions }, + { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" }, + { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions } + ]; + break; + case 24: + yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]); + this.$ = { id: $$[$0 - 1].id, label: $$[$0 - 1].label, type: yy.typeStr2Type($$[$0 - 1].typeStr), directions: $$[$0 - 1].directions, widthInColumns: parseInt($$[$0], 10) }; + break; + case 25: + yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]); + this.$ = { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions, widthInColumns: 1 }; + break; + case 26: + yy.getLogger().debug("APA123", this ? this : "na"); + yy.getLogger().debug("COLUMNS: ", $$[$0]); + this.$ = { type: "column-setting", columns: $$[$0] === "auto" ? -1 : parseInt($$[$0]) }; + break; + case 27: + yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]); + const id26 = yy.generateId(); + this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] }; + break; + case 28: + yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]); + const id27 = yy.generateId(); + this.$ = { id: id27, type: "composite", label: "", children: $$[$0 - 1] }; + break; + case 29: + yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]); + this.$ = { id: $$[$0] }; + break; + case 30: + yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]); + this.$ = { id: $$[$0 - 1], label: $$[$0].label, typeStr: $$[$0].typeStr, directions: $$[$0].directions }; + break; + case 31: + yy.getLogger().debug("Rule: dirList: ", $$[$0]); + this.$ = [$$[$0]]; + break; + case 32: + yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]); + this.$ = [$$[$0 - 1]].concat($$[$0]); + break; + case 33: + yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]); + this.$ = { typeStr: $$[$0 - 2] + $$[$0], label: $$[$0 - 1] }; + break; + case 34: + yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]); + this.$ = { typeStr: $$[$0 - 3] + $$[$0], label: $$[$0 - 2], directions: $$[$0 - 1] }; + break; + case 35: + case 36: + this.$ = { type: "classDef", id: $$[$0 - 1].trim(), css: $$[$0].trim() }; + break; + case 37: + this.$ = { type: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() }; + break; + case 38: + this.$ = { type: "applyStyles", id: $$[$0 - 1].trim(), stylesStr: $$[$0].trim() }; + break; + } + }, "anonymous"), + table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 8: [1, 20] }, o2($V8, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: $V0, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }), o2($V9, [2, 16], { 14: 22, 15: $Va, 16: $Vb }), o2($V9, [2, 17]), o2($V9, [2, 18]), o2($V9, [2, 19]), o2($V9, [2, 20]), o2($V9, [2, 21]), o2($V9, [2, 22]), o2($Vc, [2, 25], { 27: [1, 25] }), o2($V9, [2, 26]), { 19: 26, 26: 12, 32: $V4 }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, o2($Vd, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, o2($V8, [2, 13]), { 26: 35, 32: $V4 }, { 32: [2, 14] }, { 17: [1, 36] }, o2($Vc, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: $Va, 16: $Vb, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, o2($Vd, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, o2($Vc, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, o2($V9, [2, 28]), o2($V9, [2, 35]), o2($V9, [2, 36]), o2($V9, [2, 37]), o2($V9, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: $Ve }, { 15: [1, 50] }, o2($V9, [2, 27]), o2($Vd, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: $Ve, 39: [2, 31] }, { 32: [2, 15] }, o2($Vd, [2, 34]), { 39: [2, 32] }], + defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] }, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (hash.recoverable) { + this.trace(str2); + } else { + var error3 = new Error(str2); + error3.hash = hash; + throw error3; + } + }, "parseError"), + parse: /* @__PURE__ */ __name(function parse8(input) { + var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1; + var args = lstack.slice.call(arguments, 1); + var lexer3 = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k2 in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k2)) { + sharedState.yy[k2] = this.yy[k2]; + } + } + lexer3.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer3; + sharedState.yy.parser = this; + if (typeof lexer3.yylloc == "undefined") { + lexer3.yylloc = {}; + } + var yyloc = lexer3.yylloc; + lstack.push(yyloc); + var ranges = lexer3.options && lexer3.options.ranges; + if (typeof sharedState.yy.parseError === "function") { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n2) { + stack.length = stack.length - 2 * n2; + vstack.length = vstack.length - n2; + lstack.length = lstack.length - n2; + } + __name(popStack, "popStack"); + function lex2() { + var token2; + token2 = tstack.pop() || lexer3.lex() || EOF2; + if (typeof token2 !== "number") { + if (token2 instanceof Array) { + tstack = token2; + token2 = tstack.pop(); + } + token2 = self2.symbols_[token2] || token2; + } + return token2; + } + __name(lex2, "lex"); + var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + while (true) { + state4 = stack[stack.length - 1]; + if (this.defaultActions[state4]) { + action = this.defaultActions[state4]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex2(); + } + action = table[state4] && table[state4][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + expected = []; + for (p3 in table[state4]) { + if (this.terminals_[p3] && p3 > TERROR) { + expected.push("'" + this.terminals_[p3] + "'"); } - y2 += maxHeight + organization.verticalPadding; } - }; - CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) { - var self2 = this; - this.tiledMemberPack = []; - Object.keys(childGraphMap).forEach(function(id2) { - var compoundNode = idToNode[id2]; - self2.tiledMemberPack[id2] = self2.tileNodes(childGraphMap[id2], compoundNode.paddingLeft + compoundNode.paddingRight); - compoundNode.rect.width = self2.tiledMemberPack[id2].width; - compoundNode.rect.height = self2.tiledMemberPack[id2].height; - }); - }; - CoSELayout.prototype.tileNodes = function(nodes2, minWidth) { - var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL; - var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL; - var organization = { - rows: [], - rowWidth: [], - rowHeight: [], - width: 0, - height: minWidth, - // assume minHeight equals to minWidth - verticalPadding, - horizontalPadding - }; - nodes2.sort(function(n1, n2) { - if (n1.rect.width * n1.rect.height > n2.rect.width * n2.rect.height) - return -1; - if (n1.rect.width * n1.rect.height < n2.rect.width * n2.rect.height) - return 1; - return 0; + if (lexer3.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, { + text: lexer3.match, + token: this.terminals_[symbol] || symbol, + line: lexer3.yylineno, + loc: yyloc, + expected }); - for (var i2 = 0; i2 < nodes2.length; i2++) { - var lNode = nodes2[i2]; - if (organization.rows.length == 0) { - this.insertNodeToRow(organization, lNode, 0, minWidth); - } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) { - this.insertNodeToRow(organization, lNode, this.getShortestRowIndex(organization), minWidth); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer3.yytext); + lstack.push(lexer3.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer3.yyleng; + yytext = lexer3.yytext; + yylineno = lexer3.yylineno; + yyloc = lexer3.yylloc; + if (recovering > 0) { + recovering--; + } } else { - this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth); - } - this.shiftToLastRow(organization); - } - return organization; - }; - CoSELayout.prototype.insertNodeToRow = function(organization, node2, rowIndex, minWidth) { - var minCompoundSize = minWidth; - if (rowIndex == organization.rows.length) { - var secondDimension = []; - organization.rows.push(secondDimension); - organization.rowWidth.push(minCompoundSize); - organization.rowHeight.push(0); - } - var w2 = organization.rowWidth[rowIndex] + node2.rect.width; - if (organization.rows[rowIndex].length > 0) { - w2 += organization.horizontalPadding; - } - organization.rowWidth[rowIndex] = w2; - if (organization.width < w2) { - organization.width = w2; - } - var h = node2.rect.height; - if (rowIndex > 0) - h += organization.verticalPadding; - var extraHeight = 0; - if (h > organization.rowHeight[rowIndex]) { - extraHeight = organization.rowHeight[rowIndex]; - organization.rowHeight[rowIndex] = h; - extraHeight = organization.rowHeight[rowIndex] - extraHeight; - } - organization.height += extraHeight; - organization.rows[rowIndex].push(node2); - }; - CoSELayout.prototype.getShortestRowIndex = function(organization) { - var r = -1; - var min2 = Number.MAX_VALUE; - for (var i2 = 0; i2 < organization.rows.length; i2++) { - if (organization.rowWidth[i2] < min2) { - r = i2; - min2 = organization.rowWidth[i2]; - } - } - return r; - }; - CoSELayout.prototype.getLongestRowIndex = function(organization) { - var r = -1; - var max2 = Number.MIN_VALUE; - for (var i2 = 0; i2 < organization.rows.length; i2++) { - if (organization.rowWidth[i2] > max2) { - r = i2; - max2 = organization.rowWidth[i2]; + symbol = preErrorSymbol; + preErrorSymbol = null; } - } - return r; - }; - CoSELayout.prototype.canAddHorizontal = function(organization, extraWidth, extraHeight) { - var sri = this.getShortestRowIndex(organization); - if (sri < 0) { - return true; - } - var min2 = organization.rowWidth[sri]; - if (min2 + organization.horizontalPadding + extraWidth <= organization.width) + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r2 = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r2 !== "undefined") { + return r2; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState2); + break; + case 3: return true; - var hDiff = 0; - if (organization.rowHeight[sri] < extraHeight) { - if (sri > 0) - hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri]; - } - var add_to_row_ratio; - if (organization.width - min2 >= extraWidth + organization.horizontalPadding) { - add_to_row_ratio = (organization.height + hDiff) / (min2 + extraWidth + organization.horizontalPadding); - } else { - add_to_row_ratio = (organization.height + hDiff) / organization.width; - } - hDiff = extraHeight + organization.verticalPadding; - var add_new_row_ratio; - if (organization.width < extraWidth) { - add_new_row_ratio = (organization.height + hDiff) / extraWidth; - } else { - add_new_row_ratio = (organization.height + hDiff) / organization.width; - } - if (add_new_row_ratio < 1) - add_new_row_ratio = 1 / add_new_row_ratio; - if (add_to_row_ratio < 1) - add_to_row_ratio = 1 / add_to_row_ratio; - return add_to_row_ratio < add_new_row_ratio; - }; - CoSELayout.prototype.shiftToLastRow = function(organization) { - var longest = this.getLongestRowIndex(organization); - var last2 = organization.rowWidth.length - 1; - var row = organization.rows[longest]; - var node2 = row[row.length - 1]; - var diff = node2.width + organization.horizontalPadding; - if (organization.width - organization.rowWidth[last2] > diff && longest != last2) { - row.splice(-1, 1); - organization.rows[last2].push(node2); - organization.rowWidth[longest] = organization.rowWidth[longest] - diff; - organization.rowWidth[last2] = organization.rowWidth[last2] + diff; - organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)]; - var maxHeight = Number.MIN_VALUE; - for (var i2 = 0; i2 < row.length; i2++) { - if (row[i2].height > maxHeight) - maxHeight = row[i2].height; - } - if (longest > 0) - maxHeight += organization.verticalPadding; - var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last2]; - organization.rowHeight[longest] = maxHeight; - if (organization.rowHeight[last2] < node2.height + organization.verticalPadding) - organization.rowHeight[last2] = node2.height + organization.verticalPadding; - var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last2]; - organization.height += finalTotal - prevTotal; - this.shiftToLastRow(organization); - } - }; - CoSELayout.prototype.tilingPreLayout = function() { - if (CoSEConstants.TILE) { - this.groupZeroDegreeMembers(); - this.clearCompounds(); - this.clearZeroDegreeMembers(); - } - }; - CoSELayout.prototype.tilingPostLayout = function() { - if (CoSEConstants.TILE) { - this.repopulateZeroDegreeMembers(); - this.repopulateCompounds(); - } + } + } + return true; + }, "parse") + }; + var lexer2 = /* @__PURE__ */ function() { + var lexer3 = { + EOF: 1, + parseError: /* @__PURE__ */ __name(function parseError(str2, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str2, hash); + } else { + throw new Error(str2); + } + }, "parseError"), + // resets the lexer, sets new input + setInput: /* @__PURE__ */ __name(function(input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ""; + this.conditionStack = ["INITIAL"]; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 }; - CoSELayout.prototype.reduceTrees = function() { - var prunedNodesAll = []; - var containsLeaf = true; - var node2; - while (containsLeaf) { - var allNodes = this.graphManager.getAllNodes(); - var prunedNodesInStepTemp = []; - containsLeaf = false; - for (var i2 = 0; i2 < allNodes.length; i2++) { - node2 = allNodes[i2]; - if (node2.getEdges().length == 1 && !node2.getEdges()[0].isInterGraph && node2.getChild() == null) { - prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner()]); - containsLeaf = true; - } - } - if (containsLeaf == true) { - var prunedNodesInStep = []; - for (var j = 0; j < prunedNodesInStepTemp.length; j++) { - if (prunedNodesInStepTemp[j][0].getEdges().length == 1) { - prunedNodesInStep.push(prunedNodesInStepTemp[j]); - prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]); - } - } - prunedNodesAll.push(prunedNodesInStep); - this.graphManager.resetAllNodes(); - this.graphManager.resetAllEdges(); - } - } - this.prunedNodesAll = prunedNodesAll; + if (this.options.ranges) { + this.yylloc.range = [0, 0]; + } + this.offset = 0; + return this; + }, "setInput"), + // consumes and returns one char from the input + input: /* @__PURE__ */ __name(function() { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + this._input = this._input.slice(1); + return ch; + }, "input"), + // unshifts one char (or a string) into the input + unput: /* @__PURE__ */ __name(function(ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r2 = this.yylloc.range; + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; - CoSELayout.prototype.growTree = function(prunedNodesAll) { - var lengthOfPrunedNodesInStep = prunedNodesAll.length; - var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1]; - var nodeData; - for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) { - nodeData = prunedNodesInStep[i2]; - this.findPlaceforPrunedNode(nodeData); - nodeData[2].add(nodeData[0]); - nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target); + if (this.options.ranges) { + this.yylloc.range = [r2[0], r2[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, "unput"), + // When called from action, caches matched text and appends it on next action + more: /* @__PURE__ */ __name(function() { + this._more = true; + return this; + }, "more"), + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + reject: /* @__PURE__ */ __name(function() { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + return this; + }, "reject"), + // retain first n characters of the match + less: /* @__PURE__ */ __name(function(n2) { + this.unput(this.match.slice(n2)); + }, "less"), + // displays already matched input, i.e. for error messages + pastInput: /* @__PURE__ */ __name(function() { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); + }, "pastInput"), + // displays upcoming input, i.e. for error messages + upcomingInput: /* @__PURE__ */ __name(function() { + var next3 = this.match; + if (next3.length < 20) { + next3 += this._input.substr(0, 20 - next3.length); + } + return (next3.substr(0, 20) + (next3.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, "upcomingInput"), + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: /* @__PURE__ */ __name(function() { + var pre = this.pastInput(); + var c3 = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c3 + "^"; + }, "showPosition"), + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: /* @__PURE__ */ __name(function(match2, indexed_rule) { + var token2, lines, backup; + if (this.options.backtrack_lexer) { + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); } - prunedNodesAll.splice(prunedNodesAll.length - 1, 1); - this.graphManager.resetAllNodes(); - this.graphManager.resetAllEdges(); + } + lines = match2[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length }; - CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData) { - var gridForPrunedNode; - var nodeToConnect; - var prunedNode = nodeData[0]; - if (prunedNode == nodeData[1].source) { - nodeToConnect = nodeData[1].target; - } else { - nodeToConnect = nodeData[1].source; - } - var startGridX = nodeToConnect.startX; - var finishGridX = nodeToConnect.finishX; - var startGridY = nodeToConnect.startY; - var finishGridY = nodeToConnect.finishY; - var upNodeCount = 0; - var downNodeCount = 0; - var rightNodeCount = 0; - var leftNodeCount = 0; - var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount]; - if (startGridY > 0) { - for (var i2 = startGridX; i2 <= finishGridX; i2++) { - controlRegions[0] += this.grid[i2][startGridY - 1].length + this.grid[i2][startGridY].length - 1; - } - } - if (finishGridX < this.grid.length - 1) { - for (var i2 = startGridY; i2 <= finishGridY; i2++) { - controlRegions[1] += this.grid[finishGridX + 1][i2].length + this.grid[finishGridX][i2].length - 1; - } - } - if (finishGridY < this.grid[0].length - 1) { - for (var i2 = startGridX; i2 <= finishGridX; i2++) { - controlRegions[2] += this.grid[i2][finishGridY + 1].length + this.grid[i2][finishGridY].length - 1; - } - } - if (startGridX > 0) { - for (var i2 = startGridY; i2 <= finishGridY; i2++) { - controlRegions[3] += this.grid[startGridX - 1][i2].length + this.grid[startGridX][i2].length - 1; - } - } - var min2 = Integer.MAX_VALUE; - var minCount; - var minIndex; - for (var j = 0; j < controlRegions.length; j++) { - if (controlRegions[j] < min2) { - min2 = controlRegions[j]; - minCount = 1; - minIndex = j; - } else if (controlRegions[j] == min2) { - minCount++; - } + this.yytext += match2[0]; + this.match += match2[0]; + this.matches = match2; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match2[0].length); + this.matched += match2[0]; + token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token2) { + return token2; + } else if (this._backtrack) { + for (var k2 in backup) { + this[k2] = backup[k2]; } - if (minCount == 3 && min2 == 0) { - if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) { - gridForPrunedNode = 1; - } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) { - gridForPrunedNode = 0; - } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) { - gridForPrunedNode = 3; - } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) { - gridForPrunedNode = 2; - } - } else if (minCount == 2 && min2 == 0) { - var random2 = Math.floor(Math.random() * 2); - if (controlRegions[0] == 0 && controlRegions[1] == 0) { - if (random2 == 0) { - gridForPrunedNode = 0; - } else { - gridForPrunedNode = 1; - } - } else if (controlRegions[0] == 0 && controlRegions[2] == 0) { - if (random2 == 0) { - gridForPrunedNode = 0; - } else { - gridForPrunedNode = 2; - } - } else if (controlRegions[0] == 0 && controlRegions[3] == 0) { - if (random2 == 0) { - gridForPrunedNode = 0; - } else { - gridForPrunedNode = 3; - } - } else if (controlRegions[1] == 0 && controlRegions[2] == 0) { - if (random2 == 0) { - gridForPrunedNode = 1; - } else { - gridForPrunedNode = 2; - } - } else if (controlRegions[1] == 0 && controlRegions[3] == 0) { - if (random2 == 0) { - gridForPrunedNode = 1; - } else { - gridForPrunedNode = 3; - } - } else { - if (random2 == 0) { - gridForPrunedNode = 2; + return false; + } + return false; + }, "test_match"), + // return next match in input + next: /* @__PURE__ */ __name(function() { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + var token2, match2, tempMatch, index; + if (!this._more) { + this.yytext = ""; + this.match = ""; + } + var rules = this._currentRules(); + for (var i2 = 0; i2 < rules.length; i2++) { + tempMatch = this._input.match(this.rules[rules[i2]]); + if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) { + match2 = tempMatch; + index = i2; + if (this.options.backtrack_lexer) { + token2 = this.test_match(tempMatch, rules[i2]); + if (token2 !== false) { + return token2; + } else if (this._backtrack) { + match2 = false; + continue; } else { - gridForPrunedNode = 3; + return false; } + } else if (!this.options.flex) { + break; } - } else if (minCount == 4 && min2 == 0) { - var random2 = Math.floor(Math.random() * 4); - gridForPrunedNode = random2; - } else { - gridForPrunedNode = minIndex; } - if (gridForPrunedNode == 0) { - prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2); - } else if (gridForPrunedNode == 1) { - prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY()); - } else if (gridForPrunedNode == 2) { - prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2); - } else { - prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY()); + } + if (match2) { + token2 = this.test_match(match2, rules[index]); + if (token2 !== false) { + return token2; } - }; - module3.exports = CoSELayout; + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, "next"), + // return next match that has a token + lex: /* @__PURE__ */ __name(function lex2() { + var r2 = this.next(); + if (r2) { + return r2; + } else { + return this.lex(); + } + }, "lex"), + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: /* @__PURE__ */ __name(function begin(condition) { + this.conditionStack.push(condition); + }, "begin"), + // pop the previously active lexer condition state off the condition stack + popState: /* @__PURE__ */ __name(function popState() { + var n2 = this.conditionStack.length - 1; + if (n2 > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, "popState"), + // produce the lexer rule set which is active for the currently active lexer condition state + _currentRules: /* @__PURE__ */ __name(function _currentRules() { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, "_currentRules"), + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: /* @__PURE__ */ __name(function topState(n2) { + n2 = this.conditionStack.length - 1 - Math.abs(n2 || 0); + if (n2 >= 0) { + return this.conditionStack[n2]; + } else { + return "INITIAL"; + } + }, "topState"), + // alias for begin(condition) + pushState: /* @__PURE__ */ __name(function pushState(condition) { + this.begin(condition); + }, "pushState"), + // return the number of states currently on the stack + stateStackSize: /* @__PURE__ */ __name(function stateStackSize() { + return this.conditionStack.length; + }, "stateStackSize"), + options: {}, + performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { + var YYSTATE = YY_START; + switch ($avoiding_name_collisions) { + case 0: + return 10; + break; + case 1: + yy.getLogger().debug("Found space-block"); + return 31; + break; + case 2: + yy.getLogger().debug("Found nl-block"); + return 31; + break; + case 3: + yy.getLogger().debug("Found space-block"); + return 29; + break; + case 4: + yy.getLogger().debug(".", yy_.yytext); + break; + case 5: + yy.getLogger().debug("_", yy_.yytext); + break; + case 6: + return 5; + break; + case 7: + yy_.yytext = -1; + return 28; + break; + case 8: + yy_.yytext = yy_.yytext.replace(/columns\s+/, ""); + yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext); + return 28; + break; + case 9: + this.pushState("md_string"); + break; + case 10: + return "MD_STR"; + break; + case 11: + this.popState(); + break; + case 12: + this.pushState("string"); + break; + case 13: + yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext); + this.popState(); + break; + case 14: + yy.getLogger().debug("LEX: STR end:", yy_.yytext); + return "STR"; + break; + case 15: + yy_.yytext = yy_.yytext.replace(/space\:/, ""); + yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext); + return 21; + break; + case 16: + yy_.yytext = "1"; + yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext); + return 21; + break; + case 17: + return 43; + break; + case 18: + return "LINKSTYLE"; + break; + case 19: + return "INTERPOLATE"; + break; + case 20: + this.pushState("CLASSDEF"); + return 40; + break; + case 21: + this.popState(); + this.pushState("CLASSDEFID"); + return "DEFAULT_CLASSDEF_ID"; + break; + case 22: + this.popState(); + this.pushState("CLASSDEFID"); + return 41; + break; + case 23: + this.popState(); + return 42; + break; + case 24: + this.pushState("CLASS"); + return 44; + break; + case 25: + this.popState(); + this.pushState("CLASS_STYLE"); + return 45; + break; + case 26: + this.popState(); + return 46; + break; + case 27: + this.pushState("STYLE_STMNT"); + return 47; + break; + case 28: + this.popState(); + this.pushState("STYLE_DEFINITION"); + return 48; + break; + case 29: + this.popState(); + return 49; + break; + case 30: + this.pushState("acc_title"); + return "acc_title"; + break; + case 31: + this.popState(); + return "acc_title_value"; + break; + case 32: + this.pushState("acc_descr"); + return "acc_descr"; + break; + case 33: + this.popState(); + return "acc_descr_value"; + break; + case 34: + this.pushState("acc_descr_multiline"); + break; + case 35: + this.popState(); + break; + case 36: + return "acc_descr_multiline_value"; + break; + case 37: + return 30; + break; + case 38: + this.popState(); + yy.getLogger().debug("Lex: (("); + return "NODE_DEND"; + break; + case 39: + this.popState(); + yy.getLogger().debug("Lex: (("); + return "NODE_DEND"; + break; + case 40: + this.popState(); + yy.getLogger().debug("Lex: ))"); + return "NODE_DEND"; + break; + case 41: + this.popState(); + yy.getLogger().debug("Lex: (("); + return "NODE_DEND"; + break; + case 42: + this.popState(); + yy.getLogger().debug("Lex: (("); + return "NODE_DEND"; + break; + case 43: + this.popState(); + yy.getLogger().debug("Lex: (-"); + return "NODE_DEND"; + break; + case 44: + this.popState(); + yy.getLogger().debug("Lex: -)"); + return "NODE_DEND"; + break; + case 45: + this.popState(); + yy.getLogger().debug("Lex: (("); + return "NODE_DEND"; + break; + case 46: + this.popState(); + yy.getLogger().debug("Lex: ]]"); + return "NODE_DEND"; + break; + case 47: + this.popState(); + yy.getLogger().debug("Lex: ("); + return "NODE_DEND"; + break; + case 48: + this.popState(); + yy.getLogger().debug("Lex: ])"); + return "NODE_DEND"; + break; + case 49: + this.popState(); + yy.getLogger().debug("Lex: /]"); + return "NODE_DEND"; + break; + case 50: + this.popState(); + yy.getLogger().debug("Lex: /]"); + return "NODE_DEND"; + break; + case 51: + this.popState(); + yy.getLogger().debug("Lex: )]"); + return "NODE_DEND"; + break; + case 52: + this.popState(); + yy.getLogger().debug("Lex: )"); + return "NODE_DEND"; + break; + case 53: + this.popState(); + yy.getLogger().debug("Lex: ]>"); + return "NODE_DEND"; + break; + case 54: + this.popState(); + yy.getLogger().debug("Lex: ]"); + return "NODE_DEND"; + break; + case 55: + yy.getLogger().debug("Lexa: -)"); + this.pushState("NODE"); + return 36; + break; + case 56: + yy.getLogger().debug("Lexa: (-"); + this.pushState("NODE"); + return 36; + break; + case 57: + yy.getLogger().debug("Lexa: ))"); + this.pushState("NODE"); + return 36; + break; + case 58: + yy.getLogger().debug("Lexa: )"); + this.pushState("NODE"); + return 36; + break; + case 59: + yy.getLogger().debug("Lex: ((("); + this.pushState("NODE"); + return 36; + break; + case 60: + yy.getLogger().debug("Lexa: )"); + this.pushState("NODE"); + return 36; + break; + case 61: + yy.getLogger().debug("Lexa: )"); + this.pushState("NODE"); + return 36; + break; + case 62: + yy.getLogger().debug("Lexa: )"); + this.pushState("NODE"); + return 36; + break; + case 63: + yy.getLogger().debug("Lexc: >"); + this.pushState("NODE"); + return 36; + break; + case 64: + yy.getLogger().debug("Lexa: (["); + this.pushState("NODE"); + return 36; + break; + case 65: + yy.getLogger().debug("Lexa: )"); + this.pushState("NODE"); + return 36; + break; + case 66: + this.pushState("NODE"); + return 36; + break; + case 67: + this.pushState("NODE"); + return 36; + break; + case 68: + this.pushState("NODE"); + return 36; + break; + case 69: + this.pushState("NODE"); + return 36; + break; + case 70: + this.pushState("NODE"); + return 36; + break; + case 71: + this.pushState("NODE"); + return 36; + break; + case 72: + this.pushState("NODE"); + return 36; + break; + case 73: + yy.getLogger().debug("Lexa: ["); + this.pushState("NODE"); + return 36; + break; + case 74: + this.pushState("BLOCK_ARROW"); + yy.getLogger().debug("LEX ARR START"); + return 38; + break; + case 75: + yy.getLogger().debug("Lex: NODE_ID", yy_.yytext); + return 32; + break; + case 76: + yy.getLogger().debug("Lex: EOF", yy_.yytext); + return 8; + break; + case 77: + this.pushState("md_string"); + break; + case 78: + this.pushState("md_string"); + break; + case 79: + return "NODE_DESCR"; + break; + case 80: + this.popState(); + break; + case 81: + yy.getLogger().debug("Lex: Starting string"); + this.pushState("string"); + break; + case 82: + yy.getLogger().debug("LEX ARR: Starting string"); + this.pushState("string"); + break; + case 83: + yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext); + return "NODE_DESCR"; + break; + case 84: + yy.getLogger().debug("LEX POPPING"); + this.popState(); + break; + case 85: + yy.getLogger().debug("Lex: =>BAE"); + this.pushState("ARROW_DIR"); + break; + case 86: + yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); + yy.getLogger().debug("Lex (right): dir:", yy_.yytext); + return "DIR"; + break; + case 87: + yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); + yy.getLogger().debug("Lex (left):", yy_.yytext); + return "DIR"; + break; + case 88: + yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); + yy.getLogger().debug("Lex (x):", yy_.yytext); + return "DIR"; + break; + case 89: + yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); + yy.getLogger().debug("Lex (y):", yy_.yytext); + return "DIR"; + break; + case 90: + yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); + yy.getLogger().debug("Lex (up):", yy_.yytext); + return "DIR"; + break; + case 91: + yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); + yy.getLogger().debug("Lex (down):", yy_.yytext); + return "DIR"; + break; + case 92: + yy_.yytext = "]>"; + yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext); + this.popState(); + this.popState(); + return "BLOCK_ARROW_END"; + break; + case 93: + yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#"); + return 15; + break; + case 94: + yy.getLogger().debug("Lex: LINK", yy_.yytext); + return 15; + break; + case 95: + yy.getLogger().debug("Lex: LINK", yy_.yytext); + return 15; + break; + case 96: + yy.getLogger().debug("Lex: LINK", yy_.yytext); + return 15; + break; + case 97: + yy.getLogger().debug("Lex: START_LINK", yy_.yytext); + this.pushState("LLABEL"); + return 16; + break; + case 98: + yy.getLogger().debug("Lex: START_LINK", yy_.yytext); + this.pushState("LLABEL"); + return 16; + break; + case 99: + yy.getLogger().debug("Lex: START_LINK", yy_.yytext); + this.pushState("LLABEL"); + return 16; + break; + case 100: + this.pushState("md_string"); + break; + case 101: + yy.getLogger().debug("Lex: Starting string"); + this.pushState("string"); + return "LINK_LABEL"; + break; + case 102: + this.popState(); + yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#"); + return 15; + break; + case 103: + this.popState(); + yy.getLogger().debug("Lex: LINK", yy_.yytext); + return 15; + break; + case 104: + this.popState(); + yy.getLogger().debug("Lex: LINK", yy_.yytext); + return 15; + break; + case 105: + yy.getLogger().debug("Lex: COLON", yy_.yytext); + yy_.yytext = yy_.yytext.slice(1); + return 27; + break; + } + }, "anonymous"), + rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/], + conditions: { "STYLE_DEFINITION": { "rules": [29], "inclusive": false }, "STYLE_STMNT": { "rules": [28], "inclusive": false }, "CLASSDEFID": { "rules": [23], "inclusive": false }, "CLASSDEF": { "rules": [21, 22], "inclusive": false }, "CLASS_STYLE": { "rules": [26], "inclusive": false }, "CLASS": { "rules": [25], "inclusive": false }, "LLABEL": { "rules": [100, 101, 102, 103, 104], "inclusive": false }, "ARROW_DIR": { "rules": [86, 87, 88, 89, 90, 91, 92], "inclusive": false }, "BLOCK_ARROW": { "rules": [77, 82, 85], "inclusive": false }, "NODE": { "rules": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], "inclusive": false }, "md_string": { "rules": [10, 11, 79, 80], "inclusive": false }, "space": { "rules": [], "inclusive": false }, "string": { "rules": [13, 14, 83, 84], "inclusive": false }, "acc_descr_multiline": { "rules": [35, 36], "inclusive": false }, "acc_descr": { "rules": [33], "inclusive": false }, "acc_title": { "rules": [31], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], "inclusive": true } } + }; + return lexer3; + }(); + parser21.lexer = lexer2; + function Parser3() { + this.yy = {}; + } + __name(Parser3, "Parser"); + Parser3.prototype = parser21; + parser21.Parser = Parser3; + return new Parser3(); + }(); + parser20.parser = parser20; + block_default = parser20; + } + }); + + // src/diagrams/block/blockDB.ts + function typeStr2Type(typeStr) { + log.debug("typeStr2Type", typeStr); + switch (typeStr) { + case "[]": + return "square"; + case "()": + log.debug("we have a round"); + return "round"; + case "(())": + return "circle"; + case ">]": + return "rect_left_inv_arrow"; + case "{}": + return "diamond"; + case "{{}}": + return "hexagon"; + case "([])": + return "stadium"; + case "[[]]": + return "subroutine"; + case "[()]": + return "cylinder"; + case "((()))": + return "doublecircle"; + case "[//]": + return "lean_right"; + case "[\\\\]": + return "lean_left"; + case "[/\\]": + return "trapezoid"; + case "[\\/]": + return "inv_trapezoid"; + case "<[]>": + return "block_arrow"; + default: + return "na"; + } + } + function edgeTypeStr2Type(typeStr) { + log.debug("typeStr2Type", typeStr); + switch (typeStr) { + case "==": + return "thick"; + default: + return "normal"; + } + } + function edgeStrToEdgeData(typeStr) { + switch (typeStr.trim()) { + case "--x": + return "arrow_cross"; + case "--o": + return "arrow_circle"; + default: + return "arrow_point"; + } + } + var blockDatabase, edgeList, edgeCount3, COLOR_KEYWORD2, FILL_KEYWORD2, BG_FILL2, STYLECLASS_SEP2, config5, classes5, sanitizeText7, addStyleClass2, addStyle2Node, setCssClass3, populateBlockDatabase, blocks, rootBlock, clear28, cnt3, generateId3, setHierarchy, getColumns, getBlocksFlat, getBlocks, getEdges2, getBlock, setBlock, getLogger2, getClasses6, db6, blockDB_default; + var init_blockDB = __esm({ + "src/diagrams/block/blockDB.ts"() { + "use strict"; + init_clone2(); + init_config(); + init_diagramAPI(); + init_logger(); + init_common(); + init_commonDb(); + blockDatabase = /* @__PURE__ */ new Map(); + edgeList = []; + edgeCount3 = /* @__PURE__ */ new Map(); + COLOR_KEYWORD2 = "color"; + FILL_KEYWORD2 = "fill"; + BG_FILL2 = "bgFill"; + STYLECLASS_SEP2 = ","; + config5 = getConfig2(); + classes5 = /* @__PURE__ */ new Map(); + sanitizeText7 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, config5), "sanitizeText"); + addStyleClass2 = /* @__PURE__ */ __name(function(id26, styleAttributes = "") { + let foundClass = classes5.get(id26); + if (!foundClass) { + foundClass = { id: id26, styles: [], textStyles: [] }; + classes5.set(id26, foundClass); + } + if (styleAttributes !== void 0 && styleAttributes !== null) { + styleAttributes.split(STYLECLASS_SEP2).forEach((attrib) => { + const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim(); + if (RegExp(COLOR_KEYWORD2).exec(attrib)) { + const newStyle1 = fixedAttrib.replace(FILL_KEYWORD2, BG_FILL2); + const newStyle2 = newStyle1.replace(COLOR_KEYWORD2, FILL_KEYWORD2); + foundClass.textStyles.push(newStyle2); + } + foundClass.styles.push(fixedAttrib); + }); + } + }, "addStyleClass"); + addStyle2Node = /* @__PURE__ */ __name(function(id26, styles3 = "") { + const foundBlock = blockDatabase.get(id26); + if (styles3 !== void 0 && styles3 !== null) { + foundBlock.styles = styles3.split(STYLECLASS_SEP2); + } + }, "addStyle2Node"); + setCssClass3 = /* @__PURE__ */ __name(function(itemIds, cssClassName) { + itemIds.split(",").forEach(function(id26) { + let foundBlock = blockDatabase.get(id26); + if (foundBlock === void 0) { + const trimmedId = id26.trim(); + foundBlock = { id: trimmedId, type: "na", children: [] }; + blockDatabase.set(trimmedId, foundBlock); + } + if (!foundBlock.classes) { + foundBlock.classes = []; + } + foundBlock.classes.push(cssClassName); + }); + }, "setCssClass"); + populateBlockDatabase = /* @__PURE__ */ __name((_blockList, parent4) => { + const blockList = _blockList.flat(); + const children2 = []; + for (const block3 of blockList) { + if (block3.label) { + block3.label = sanitizeText7(block3.label); + } + if (block3.type === "classDef") { + addStyleClass2(block3.id, block3.css); + continue; + } + if (block3.type === "applyClass") { + setCssClass3(block3.id, block3?.styleClass ?? ""); + continue; + } + if (block3.type === "applyStyles") { + if (block3?.stylesStr) { + addStyle2Node(block3.id, block3?.stylesStr); + } + continue; + } + if (block3.type === "column-setting") { + parent4.columns = block3.columns ?? -1; + } else if (block3.type === "edge") { + const count = (edgeCount3.get(block3.id) ?? 0) + 1; + edgeCount3.set(block3.id, count); + block3.id = count + "-" + block3.id; + edgeList.push(block3); + } else { + if (!block3.label) { + if (block3.type === "composite") { + block3.label = ""; + } else { + block3.label = block3.id; + } + } + const existingBlock = blockDatabase.get(block3.id); + if (existingBlock === void 0) { + blockDatabase.set(block3.id, block3); + } else { + if (block3.type !== "na") { + existingBlock.type = block3.type; + } + if (block3.label !== block3.id) { + existingBlock.label = block3.label; + } + } + if (block3.children) { + populateBlockDatabase(block3.children, block3); + } + if (block3.type === "space") { + const w3 = block3.width ?? 1; + for (let j2 = 0; j2 < w3; j2++) { + const newBlock = clone_default2(block3); + newBlock.id = newBlock.id + "-" + j2; + blockDatabase.set(newBlock.id, newBlock); + children2.push(newBlock); + } + } else if (existingBlock === void 0) { + children2.push(block3); + } + } + } + parent4.children = children2; + }, "populateBlockDatabase"); + blocks = []; + rootBlock = { id: "root", type: "composite", children: [], columns: -1 }; + clear28 = /* @__PURE__ */ __name(() => { + log.debug("Clear called"); + clear(); + rootBlock = { id: "root", type: "composite", children: [], columns: -1 }; + blockDatabase = /* @__PURE__ */ new Map([["root", rootBlock]]); + blocks = []; + classes5 = /* @__PURE__ */ new Map(); + edgeList = []; + edgeCount3 = /* @__PURE__ */ new Map(); + }, "clear"); + __name(typeStr2Type, "typeStr2Type"); + __name(edgeTypeStr2Type, "edgeTypeStr2Type"); + __name(edgeStrToEdgeData, "edgeStrToEdgeData"); + cnt3 = 0; + generateId3 = /* @__PURE__ */ __name(() => { + cnt3++; + return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt3; + }, "generateId"); + setHierarchy = /* @__PURE__ */ __name((block3) => { + rootBlock.children = block3; + populateBlockDatabase(block3, rootBlock); + blocks = rootBlock.children; + }, "setHierarchy"); + getColumns = /* @__PURE__ */ __name((blockId) => { + const block3 = blockDatabase.get(blockId); + if (!block3) { + return -1; + } + if (block3.columns) { + return block3.columns; + } + if (!block3.children) { + return -1; + } + return block3.children.length; + }, "getColumns"); + getBlocksFlat = /* @__PURE__ */ __name(() => { + return [...blockDatabase.values()]; + }, "getBlocksFlat"); + getBlocks = /* @__PURE__ */ __name(() => { + return blocks || []; + }, "getBlocks"); + getEdges2 = /* @__PURE__ */ __name(() => { + return edgeList; + }, "getEdges"); + getBlock = /* @__PURE__ */ __name((id26) => { + return blockDatabase.get(id26); + }, "getBlock"); + setBlock = /* @__PURE__ */ __name((block3) => { + blockDatabase.set(block3.id, block3); + }, "setBlock"); + getLogger2 = /* @__PURE__ */ __name(() => console, "getLogger"); + getClasses6 = /* @__PURE__ */ __name(function() { + return classes5; + }, "getClasses"); + db6 = { + getConfig: /* @__PURE__ */ __name(() => getConfig().block, "getConfig"), + typeStr2Type, + edgeTypeStr2Type, + edgeStrToEdgeData, + getLogger: getLogger2, + getBlocksFlat, + getBlocks, + getEdges: getEdges2, + setHierarchy, + getBlock, + setBlock, + getColumns, + getClasses: getClasses6, + clear: clear28, + generateId: generateId3 + }; + blockDB_default = db6; + } + }); + + // src/diagrams/block/styles.ts + var fade2, getStyles15, styles_default14; + var init_styles15 = __esm({ + "src/diagrams/block/styles.ts"() { + "use strict"; + init_dist(); + fade2 = /* @__PURE__ */ __name((color2, opacity) => { + const channel2 = channel_default2; + const r2 = channel2(color2, "r"); + const g2 = channel2(color2, "g"); + const b2 = channel2(color2, "b"); + return rgba_default(r2, g2, b2, opacity); + }, "fade"); + getStyles15 = /* @__PURE__ */ __name((options3) => `.label { + font-family: ${options3.fontFamily}; + color: ${options3.nodeTextColor || options3.textColor}; + } + .cluster-label text { + fill: ${options3.titleColor}; + } + .cluster-label span,p { + color: ${options3.titleColor}; + } + + + + .label text,span,p { + fill: ${options3.nodeTextColor || options3.textColor}; + color: ${options3.nodeTextColor || options3.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${options3.mainBkg}; + stroke: ${options3.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${options3.arrowheadColor}; + } + + .edgePath .path { + stroke: ${options3.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${options3.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${options3.edgeLabelBackground}; + rect { + opacity: 0.5; + background-color: ${options3.edgeLabelBackground}; + fill: ${options3.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${fade2(options3.edgeLabelBackground, 0.5)}; + // background-color: + } + + .node .cluster { + // fill: ${fade2(options3.mainBkg, 0.5)}; + fill: ${fade2(options3.clusterBkg, 0.5)}; + stroke: ${fade2(options3.clusterBorder, 0.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${options3.titleColor}; + } + + .cluster span,p { + color: ${options3.titleColor}; + } + /* .cluster div { + color: ${options3.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${options3.fontFamily}; + font-size: 12px; + background: ${options3.tertiaryColor}; + border: 1px solid ${options3.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${options3.textColor}; + } +`, "getStyles"); + styles_default14 = getStyles15; + } + }); + + // src/diagrams/block/layout.ts + function calculateBlockPosition(columns, position5) { + if (columns === 0 || !Number.isInteger(columns)) { + throw new Error("Columns must be an integer !== 0."); + } + if (position5 < 0 || !Number.isInteger(position5)) { + throw new Error("Position must be a non-negative integer." + position5); + } + if (columns < 0) { + return { px: position5, py: 0 }; + } + if (columns === 1) { + return { px: 0, py: position5 }; + } + const px = position5 % columns; + const py = Math.floor(position5 / columns); + return { px, py }; + } + function setBlockSizes(block3, db7, siblingWidth = 0, siblingHeight = 0) { + log.debug( + "setBlockSizes abc95 (start)", + block3.id, + block3?.size?.x, + "block width =", + block3?.size, + "sieblingWidth", + siblingWidth + ); + if (!block3?.size?.width) { + block3.size = { + width: siblingWidth, + height: siblingHeight, + x: 0, + y: 0 + }; + } + let maxWidth = 0; + let maxHeight = 0; + if (block3.children?.length > 0) { + for (const child of block3.children) { + setBlockSizes(child, db7); + } + const childSize = getMaxChildSize(block3); + maxWidth = childSize.width; + maxHeight = childSize.height; + log.debug("setBlockSizes abc95 maxWidth of", block3.id, ":s children is ", maxWidth, maxHeight); + for (const child of block3.children) { + if (child.size) { + log.debug( + `abc95 Setting size of children of ${block3.id} id=${child.id} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}` + ); + child.size.width = maxWidth * (child.widthInColumns ?? 1) + padding2 * ((child.widthInColumns ?? 1) - 1); + child.size.height = maxHeight; + child.size.x = 0; + child.size.y = 0; + log.debug( + `abc95 updating size of ${block3.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}` + ); + } + } + for (const child of block3.children) { + setBlockSizes(child, db7, maxWidth, maxHeight); + } + const columns = block3.columns ?? -1; + let numItems = 0; + for (const child of block3.children) { + numItems += child.widthInColumns ?? 1; + } + let xSize = block3.children.length; + if (columns > 0 && columns < numItems) { + xSize = columns; + } + const ySize = Math.ceil(numItems / xSize); + let width3 = xSize * (maxWidth + padding2) + padding2; + let height2 = ySize * (maxHeight + padding2) + padding2; + if (width3 < siblingWidth) { + log.debug( + `Detected to small siebling: abc95 ${block3.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width3}` + ); + width3 = siblingWidth; + height2 = siblingHeight; + const childWidth = (siblingWidth - xSize * padding2 - padding2) / xSize; + const childHeight = (siblingHeight - ySize * padding2 - padding2) / ySize; + log.debug("Size indata abc88", block3.id, "childWidth", childWidth, "maxWidth", maxWidth); + log.debug("Size indata abc88", block3.id, "childHeight", childHeight, "maxHeight", maxHeight); + log.debug("Size indata abc88 xSize", xSize, "padding", padding2); + for (const child of block3.children) { + if (child.size) { + child.size.width = childWidth; + child.size.height = childHeight; + child.size.x = 0; + child.size.y = 0; + } + } + } + log.debug( + `abc95 (finale calc) ${block3.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block3.children.length} width=${Math.max(width3, block3.size?.width || 0)}` + ); + if (width3 < (block3?.size?.width || 0)) { + width3 = block3?.size?.width || 0; + const num = columns > 0 ? Math.min(block3.children.length, columns) : block3.children.length; + if (num > 0) { + const childWidth = (width3 - num * padding2 - padding2) / num; + log.debug("abc95 (growing to fit) width", block3.id, width3, block3.size?.width, childWidth); + for (const child of block3.children) { + if (child.size) { + child.size.width = childWidth; + } + } + } + } + block3.size = { + width: width3, + height: height2, + x: 0, + y: 0 + }; + } + log.debug( + "setBlockSizes abc94 (done)", + block3.id, + block3?.size?.x, + block3?.size?.width, + block3?.size?.y, + block3?.size?.height + ); + } + function layoutBlocks(block3, db7) { + log.debug( + `abc85 layout blocks (=>layoutBlocks) ${block3.id} x: ${block3?.size?.x} y: ${block3?.size?.y} width: ${block3?.size?.width}` + ); + const columns = block3.columns ?? -1; + log.debug("layoutBlocks columns abc95", block3.id, "=>", columns, block3); + if (block3.children && // find max width of children + block3.children.length > 0) { + const width3 = block3?.children[0]?.size?.width ?? 0; + const widthOfChildren = block3.children.length * width3 + (block3.children.length - 1) * padding2; + log.debug("widthOfChildren 88", widthOfChildren, "posX"); + let columnPos = 0; + log.debug("abc91 block?.size?.x", block3.id, block3?.size?.x); + let startingPosX = block3?.size?.x ? block3?.size?.x + (-block3?.size?.width / 2 || 0) : -padding2; + let rowPos = 0; + for (const child of block3.children) { + const parent4 = block3; + if (!child.size) { + continue; + } + const { width: width4, height: height2 } = child.size; + const { px, py } = calculateBlockPosition(columns, columnPos); + if (py != rowPos) { + rowPos = py; + startingPosX = block3?.size?.x ? block3?.size?.x + (-block3?.size?.width / 2 || 0) : -padding2; + log.debug("New row in layout for block", block3.id, " and child ", child.id, rowPos); + } + log.debug( + `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${parent4?.size?.x},${parent4?.size?.y}) parent: ${parent4.id} width: ${width4}${padding2}` + ); + if (parent4.size) { + const halfWidth = width4 / 2; + child.size.x = startingPosX + padding2 + halfWidth; + log.debug( + `abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding2} width=${width4} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width4 * (child?.widthInColumns ?? 1) / 2}` + ); + startingPosX = child.size.x + halfWidth; + child.size.y = parent4.size.y - parent4.size.height / 2 + py * (height2 + padding2) + height2 / 2 + padding2; + log.debug( + `abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding2}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width4 * (child?.widthInColumns ?? 1) / 2}` + ); + } + if (child.children) { + layoutBlocks(child, db7); + } + columnPos += child?.widthInColumns ?? 1; + log.debug("abc88 columnsPos", child, columnPos); + } + } + log.debug( + `layout blocks (<==layoutBlocks) ${block3.id} x: ${block3?.size?.x} y: ${block3?.size?.y} width: ${block3?.size?.width}` + ); + } + function findBounds(block3, { minX, minY, maxX, maxY } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) { + if (block3.size && block3.id !== "root") { + const { x: x5, y: y5, width: width3, height: height2 } = block3.size; + if (x5 - width3 / 2 < minX) { + minX = x5 - width3 / 2; + } + if (y5 - height2 / 2 < minY) { + minY = y5 - height2 / 2; + } + if (x5 + width3 / 2 > maxX) { + maxX = x5 + width3 / 2; + } + if (y5 + height2 / 2 > maxY) { + maxY = y5 + height2 / 2; + } + } + if (block3.children) { + for (const child of block3.children) { + ({ minX, minY, maxX, maxY } = findBounds(child, { minX, minY, maxX, maxY })); + } + } + return { minX, minY, maxX, maxY }; + } + function layout5(db7) { + const root4 = db7.getBlock("root"); + if (!root4) { + return; + } + setBlockSizes(root4, db7, 0, 0); + layoutBlocks(root4, db7); + log.debug("getBlocks", JSON.stringify(root4, null, 2)); + const { minX, minY, maxX, maxY } = findBounds(root4); + const height2 = maxY - minY; + const width3 = maxX - minX; + return { x: minX, y: minY, width: width3, height: height2 }; + } + var padding2, getMaxChildSize; + var init_layout2 = __esm({ + "src/diagrams/block/layout.ts"() { + "use strict"; + init_logger(); + init_diagramAPI(); + padding2 = getConfig2()?.block?.padding ?? 8; + __name(calculateBlockPosition, "calculateBlockPosition"); + getMaxChildSize = /* @__PURE__ */ __name((block3) => { + let maxWidth = 0; + let maxHeight = 0; + for (const child of block3.children) { + const { width: width3, height: height2, x: x5, y: y5 } = child.size ?? { width: 0, height: 0, x: 0, y: 0 }; + log.debug( + "getMaxChildSize abc95 child:", + child.id, + "width:", + width3, + "height:", + height2, + "x:", + x5, + "y:", + y5, + child.type + ); + if (child.type === "space") { + continue; + } + if (width3 > maxWidth) { + maxWidth = width3 / (block3.widthInColumns ?? 1); + } + if (height2 > maxHeight) { + maxHeight = height2; + } + } + return { width: maxWidth, height: maxHeight }; + }, "getMaxChildSize"); + __name(setBlockSizes, "setBlockSizes"); + __name(layoutBlocks, "layoutBlocks"); + __name(findBounds, "findBounds"); + __name(layout5, "layout"); + } + }); + + // src/diagrams/block/renderHelpers.ts + function getNodeFromBlock(block3, db7, positioned = false) { + const vertex = block3; + let classStr = "default"; + if ((vertex?.classes?.length || 0) > 0) { + classStr = (vertex?.classes ?? []).join(" "); + } + classStr = classStr + " flowchart-label"; + let radius2 = 0; + let shape = ""; + let padding3; + switch (vertex.type) { + case "round": + radius2 = 5; + shape = "rect"; + break; + case "composite": + radius2 = 0; + shape = "composite"; + padding3 = 0; + break; + case "square": + shape = "rect"; + break; + case "diamond": + shape = "question"; + break; + case "hexagon": + shape = "hexagon"; + break; + case "block_arrow": + shape = "block_arrow"; + break; + case "odd": + shape = "rect_left_inv_arrow"; + break; + case "lean_right": + shape = "lean_right"; + break; + case "lean_left": + shape = "lean_left"; + break; + case "trapezoid": + shape = "trapezoid"; + break; + case "inv_trapezoid": + shape = "inv_trapezoid"; + break; + case "rect_left_inv_arrow": + shape = "rect_left_inv_arrow"; + break; + case "circle": + shape = "circle"; + break; + case "ellipse": + shape = "ellipse"; + break; + case "stadium": + shape = "stadium"; + break; + case "subroutine": + shape = "subroutine"; + break; + case "cylinder": + shape = "cylinder"; + break; + case "group": + shape = "rect"; + break; + case "doublecircle": + shape = "doublecircle"; + break; + default: + shape = "rect"; + } + const styles3 = getStylesFromArray(vertex?.styles ?? []); + const vertexText = vertex.label; + const bounds4 = vertex.size ?? { width: 0, height: 0, x: 0, y: 0 }; + const node2 = { + labelStyle: styles3.labelStyle, + shape, + labelText: vertexText, + rx: radius2, + ry: radius2, + class: classStr, + style: styles3.style, + id: vertex.id, + directions: vertex.directions, + width: bounds4.width, + height: bounds4.height, + x: bounds4.x, + y: bounds4.y, + positioned, + intersect: void 0, + type: vertex.type, + padding: padding3 ?? getConfig()?.block?.padding ?? 0 + }; + return node2; + } + async function calculateBlockSize(elem, block3, db7) { + const node2 = getNodeFromBlock(block3, db7, false); + if (node2.type === "group") { + return; + } + const nodeEl = await insertNode(elem, node2); + const boundingBox3 = nodeEl.node().getBBox(); + const obj = db7.getBlock(node2.id); + obj.size = { width: boundingBox3.width, height: boundingBox3.height, x: 0, y: 0, node: nodeEl }; + db7.setBlock(obj); + nodeEl.remove(); + } + async function insertBlockPositioned(elem, block3, db7) { + const node2 = getNodeFromBlock(block3, db7, true); + const obj = db7.getBlock(node2.id); + if (obj.type !== "space") { + await insertNode(elem, node2); + block3.intersect = node2?.intersect; + positionNode(node2); + } + } + async function performOperations(elem, blocks2, db7, operation) { + for (const block3 of blocks2) { + await operation(elem, block3, db7); + if (block3.children) { + await performOperations(elem, block3.children, db7, operation); + } + } + } + async function calculateBlockSizes(elem, blocks2, db7) { + await performOperations(elem, blocks2, db7, calculateBlockSize); + } + async function insertBlocks(elem, blocks2, db7) { + await performOperations(elem, blocks2, db7, insertBlockPositioned); + } + async function insertEdges(elem, edges5, blocks2, db7, id26) { + const g2 = new Graph({ + multigraph: true, + compound: true + }); + g2.setGraph({ + rankdir: "TB", + nodesep: 10, + ranksep: 10, + marginx: 8, + marginy: 8 + }); + for (const block3 of blocks2) { + if (block3.size) { + g2.setNode(block3.id, { + width: block3.size.width, + height: block3.size.height, + intersect: block3.intersect + }); + } + } + for (const edge of edges5) { + if (edge.start && edge.end) { + const startBlock = db7.getBlock(edge.start); + const endBlock = db7.getBlock(edge.end); + if (startBlock?.size && endBlock?.size) { + const start3 = startBlock.size; + const end2 = endBlock.size; + const points = [ + { x: start3.x, y: start3.y }, + { x: start3.x + (end2.x - start3.x) / 2, y: start3.y + (end2.y - start3.y) / 2 }, + { x: end2.x, y: end2.y } + ]; + insertEdge2( + elem, + { v: edge.start, w: edge.end, name: edge.id }, + { + ...edge, + arrowTypeEnd: edge.arrowTypeEnd, + arrowTypeStart: edge.arrowTypeStart, + points, + classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1" }, - /* 7 */ - /***/ - function(module3, exports3, __webpack_require__) { - var coseBase2 = {}; - coseBase2.layoutBase = __webpack_require__(0); - coseBase2.CoSEConstants = __webpack_require__(1); - coseBase2.CoSEEdge = __webpack_require__(2); - coseBase2.CoSEGraph = __webpack_require__(3); - coseBase2.CoSEGraphManager = __webpack_require__(4); - coseBase2.CoSELayout = __webpack_require__(6); - coseBase2.CoSENode = __webpack_require__(5); - module3.exports = coseBase2; + void 0, + "block", + g2, + id26 + ); + if (edge.label) { + await insertEdgeLabel2(elem, { + ...edge, + label: edge.label, + labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;", + arrowTypeEnd: edge.arrowTypeEnd, + arrowTypeStart: edge.arrowTypeStart, + points, + classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1" + }); + positionEdgeLabel2( + { ...edge, x: points[1].x, y: points[1].y }, + { + originalPath: points + } + ); + } + } + } + } + } + var init_renderHelpers = __esm({ + "src/diagrams/block/renderHelpers.ts"() { + "use strict"; + init_graphlib(); + init_config(); + init_edges2(); + init_nodes2(); + init_utils2(); + __name(getNodeFromBlock, "getNodeFromBlock"); + __name(calculateBlockSize, "calculateBlockSize"); + __name(insertBlockPositioned, "insertBlockPositioned"); + __name(performOperations, "performOperations"); + __name(calculateBlockSizes, "calculateBlockSizes"); + __name(insertBlocks, "insertBlocks"); + __name(insertEdges, "insertEdges"); + } + }); + + // src/diagrams/block/blockRenderer.ts + var getClasses7, draw22, blockRenderer_default; + var init_blockRenderer = __esm({ + "src/diagrams/block/blockRenderer.ts"() { + "use strict"; + init_src32(); + init_config(); + init_markers2(); + init_logger(); + init_setupGraphViewbox(); + init_layout2(); + init_renderHelpers(); + getClasses7 = /* @__PURE__ */ __name(function(text2, diagObj) { + return diagObj.db.getClasses(); + }, "getClasses"); + draw22 = /* @__PURE__ */ __name(async function(text2, id26, _version, diagObj) { + const { securityLevel, block: conf8 } = getConfig(); + const db7 = diagObj.db; + let sandboxElement; + if (securityLevel === "sandbox") { + sandboxElement = select_default2("#i" + id26); + } + const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); + const svg = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); + const markers3 = ["point", "circle", "cross"]; + markers_default2(svg, markers3, diagObj.type, id26); + const bl = db7.getBlocks(); + const blArr = db7.getBlocksFlat(); + const edges5 = db7.getEdges(); + const nodes6 = svg.insert("g").attr("class", "block"); + await calculateBlockSizes(nodes6, bl, db7); + const bounds4 = layout5(db7); + await insertBlocks(nodes6, bl, db7); + await insertEdges(nodes6, edges5, blArr, db7, id26); + if (bounds4) { + const bounds22 = bounds4; + const magicFactor = Math.max(1, Math.round(0.125 * (bounds22.width / bounds22.height))); + const height2 = bounds22.height + magicFactor + 10; + const width3 = bounds22.width + 10; + const { useMaxWidth } = conf8; + configureSvgSize(svg, height2, width3, !!useMaxWidth); + log.debug("Here Bounds", bounds4, bounds22); + svg.attr( + "viewBox", + `${bounds22.x - 5} ${bounds22.y - 5} ${bounds22.width + 10} ${bounds22.height + 10}` + ); + } + }, "draw"); + blockRenderer_default = { + draw: draw22, + getClasses: getClasses7 + }; + } + }); + + // src/diagrams/block/blockDiagram.ts + var blockDiagram_exports = {}; + __export(blockDiagram_exports, { + diagram: () => diagram22 + }); + var diagram22; + var init_blockDiagram = __esm({ + "src/diagrams/block/blockDiagram.ts"() { + "use strict"; + init_block(); + init_blockDB(); + init_styles15(); + init_blockRenderer(); + diagram22 = { + parser: block_default, + db: blockDB_default, + renderer: blockRenderer_default, + styles: styles_default14 + }; + } + }); + + // src/mermaid.ts + var mermaid_exports = {}; + __export(mermaid_exports, { + default: () => mermaid_default + }); + init_esm(); + init_detectType(); + + // src/diagrams/c4/c4Detector.ts + var id2 = "c4"; + var detector = /* @__PURE__ */ __name((txt) => { + return /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt); + }, "detector"); + var loader = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_c4Diagram2(), c4Diagram_exports)); + return { id: id2, diagram: diagram23 }; + }, "loader"); + var plugin = { + id: id2, + detector, + loader + }; + var c4Detector_default = plugin; + + // src/diagrams/flowchart/flowDetector.ts + var id3 = "flowchart"; + var detector2 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.flowchart?.defaultRenderer === "dagre-wrapper" || config6?.flowchart?.defaultRenderer === "elk") { + return false; + } + return /^\s*graph/.test(txt); + }, "detector"); + var loader2 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id3, diagram: diagram23 }; + }, "loader"); + var plugin2 = { + id: id3, + detector: detector2, + loader: loader2 + }; + var flowDetector_default = plugin2; + + // src/diagrams/flowchart/flowDetector-v2.ts + var id4 = "flowchart-v2"; + var detector3 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.flowchart?.defaultRenderer === "dagre-d3" || config6?.flowchart?.defaultRenderer === "elk") { + return false; + } + if (/^\s*graph/.test(txt) && config6?.flowchart?.defaultRenderer === "dagre-wrapper") { + return true; + } + return /^\s*flowchart/.test(txt); + }, "detector"); + var loader3 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id4, diagram: diagram23 }; + }, "loader"); + var plugin3 = { + id: id4, + detector: detector3, + loader: loader3 + }; + var flowDetector_v2_default = plugin3; + + // src/diagrams/er/erDetector.ts + var id5 = "er"; + var detector4 = /* @__PURE__ */ __name((txt) => { + return /^\s*erDiagram/.test(txt); + }, "detector"); + var loader4 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_erDiagram2(), erDiagram_exports)); + return { id: id5, diagram: diagram23 }; + }, "loader"); + var plugin4 = { + id: id5, + detector: detector4, + loader: loader4 + }; + var erDetector_default = plugin4; + + // src/diagrams/git/gitGraphDetector.ts + var id6 = "gitGraph"; + var detector5 = /* @__PURE__ */ __name((txt) => { + return /^\s*gitGraph/.test(txt); + }, "detector"); + var loader5 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_gitGraphDiagram(), gitGraphDiagram_exports)); + return { id: id6, diagram: diagram23 }; + }, "loader"); + var plugin5 = { + id: id6, + detector: detector5, + loader: loader5 + }; + var gitGraphDetector_default = plugin5; + + // src/diagrams/gantt/ganttDetector.ts + var id7 = "gantt"; + var detector6 = /* @__PURE__ */ __name((txt) => { + return /^\s*gantt/.test(txt); + }, "detector"); + var loader6 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_ganttDiagram(), ganttDiagram_exports)); + return { id: id7, diagram: diagram23 }; + }, "loader"); + var plugin6 = { + id: id7, + detector: detector6, + loader: loader6 + }; + var ganttDetector_default = plugin6; + + // src/diagrams/info/infoDetector.ts + var id8 = "info"; + var detector7 = /* @__PURE__ */ __name((txt) => { + return /^\s*info/.test(txt); + }, "detector"); + var loader7 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_infoDiagram(), infoDiagram_exports)); + return { id: id8, diagram: diagram23 }; + }, "loader"); + var info = { + id: id8, + detector: detector7, + loader: loader7 + }; + + // src/diagrams/pie/pieDetector.ts + var id9 = "pie"; + var detector8 = /* @__PURE__ */ __name((txt) => { + return /^\s*pie/.test(txt); + }, "detector"); + var loader8 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_pieDiagram(), pieDiagram_exports)); + return { id: id9, diagram: diagram23 }; + }, "loader"); + var pie = { + id: id9, + detector: detector8, + loader: loader8 + }; + + // src/diagrams/quadrant-chart/quadrantDetector.ts + var id10 = "quadrantChart"; + var detector9 = /* @__PURE__ */ __name((txt) => { + return /^\s*quadrantChart/.test(txt); + }, "detector"); + var loader9 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_quadrantDiagram(), quadrantDiagram_exports)); + return { id: id10, diagram: diagram23 }; + }, "loader"); + var plugin7 = { + id: id10, + detector: detector9, + loader: loader9 + }; + var quadrantDetector_default = plugin7; + + // src/diagrams/xychart/xychartDetector.ts + var id11 = "xychart"; + var detector10 = /* @__PURE__ */ __name((txt) => { + return /^\s*xychart-beta/.test(txt); + }, "detector"); + var loader10 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_xychartDiagram(), xychartDiagram_exports)); + return { id: id11, diagram: diagram23 }; + }, "loader"); + var plugin8 = { + id: id11, + detector: detector10, + loader: loader10 + }; + var xychartDetector_default = plugin8; + + // src/diagrams/requirement/requirementDetector.ts + var id12 = "requirement"; + var detector11 = /* @__PURE__ */ __name((txt) => { + return /^\s*requirement(Diagram)?/.test(txt); + }, "detector"); + var loader11 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_requirementDiagram2(), requirementDiagram_exports)); + return { id: id12, diagram: diagram23 }; + }, "loader"); + var plugin9 = { + id: id12, + detector: detector11, + loader: loader11 + }; + var requirementDetector_default = plugin9; + + // src/diagrams/sequence/sequenceDetector.ts + var id13 = "sequence"; + var detector12 = /* @__PURE__ */ __name((txt) => { + return /^\s*sequenceDiagram/.test(txt); + }, "detector"); + var loader12 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_sequenceDiagram2(), sequenceDiagram_exports)); + return { id: id13, diagram: diagram23 }; + }, "loader"); + var plugin10 = { + id: id13, + detector: detector12, + loader: loader12 + }; + var sequenceDetector_default = plugin10; + + // src/diagrams/class/classDetector.ts + var id14 = "class"; + var detector13 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.class?.defaultRenderer === "dagre-wrapper") { + return false; + } + return /^\s*classDiagram/.test(txt); + }, "detector"); + var loader13 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_classDiagram2(), classDiagram_exports)); + return { id: id14, diagram: diagram23 }; + }, "loader"); + var plugin11 = { + id: id14, + detector: detector13, + loader: loader13 + }; + var classDetector_default = plugin11; + + // src/diagrams/class/classDetector-V2.ts + var id15 = "classDiagram"; + var detector14 = /* @__PURE__ */ __name((txt, config6) => { + if (/^\s*classDiagram/.test(txt) && config6?.class?.defaultRenderer === "dagre-wrapper") { + return true; + } + return /^\s*classDiagram-v2/.test(txt); + }, "detector"); + var loader14 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_classDiagram_v2(), classDiagram_v2_exports)); + return { id: id15, diagram: diagram23 }; + }, "loader"); + var plugin12 = { + id: id15, + detector: detector14, + loader: loader14 + }; + var classDetector_V2_default = plugin12; + + // src/diagrams/state/stateDetector.ts + var id16 = "state"; + var detector15 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.state?.defaultRenderer === "dagre-wrapper") { + return false; + } + return /^\s*stateDiagram/.test(txt); + }, "detector"); + var loader15 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_stateDiagram2(), stateDiagram_exports)); + return { id: id16, diagram: diagram23 }; + }, "loader"); + var plugin13 = { + id: id16, + detector: detector15, + loader: loader15 + }; + var stateDetector_default = plugin13; + + // src/diagrams/state/stateDetector-V2.ts + var id17 = "stateDiagram"; + var detector16 = /* @__PURE__ */ __name((txt, config6) => { + if (/^\s*stateDiagram-v2/.test(txt)) { + return true; + } + if (/^\s*stateDiagram/.test(txt) && config6?.state?.defaultRenderer === "dagre-wrapper") { + return true; + } + return false; + }, "detector"); + var loader16 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_stateDiagram_v2(), stateDiagram_v2_exports)); + return { id: id17, diagram: diagram23 }; + }, "loader"); + var plugin14 = { + id: id17, + detector: detector16, + loader: loader16 + }; + var stateDetector_V2_default = plugin14; + + // src/diagrams/user-journey/journeyDetector.ts + var id18 = "journey"; + var detector17 = /* @__PURE__ */ __name((txt) => { + return /^\s*journey/.test(txt); + }, "detector"); + var loader17 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_journeyDiagram(), journeyDiagram_exports)); + return { id: id18, diagram: diagram23 }; + }, "loader"); + var plugin15 = { + id: id18, + detector: detector17, + loader: loader17 + }; + var journeyDetector_default = plugin15; + + // src/diagrams/error/errorRenderer.ts + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + var draw17 = /* @__PURE__ */ __name((_text, id26, version4) => { + log.debug("rendering svg for syntax error\n"); + const svg = selectSvgElement(id26); + const g2 = svg.append("g"); + svg.attr("viewBox", "0 0 2412 512"); + configureSvgSize(svg, 100, 512, true); + g2.append("path").attr("class", "error-icon").attr( + "d", + "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z" + ); + g2.append("path").attr("class", "error-icon").attr( + "d", + "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z" + ); + g2.append("path").attr("class", "error-icon").attr( + "d", + "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z" + ); + g2.append("path").attr("class", "error-icon").attr( + "d", + "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z" + ); + g2.append("path").attr("class", "error-icon").attr( + "d", + "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z" + ); + g2.append("path").attr("class", "error-icon").attr( + "d", + "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z" + ); + g2.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text"); + g2.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${version4}`); + }, "draw"); + var renderer3 = { draw: draw17 }; + var errorRenderer_default = renderer3; + + // src/diagrams/error/errorDiagram.ts + var diagram17 = { + db: {}, + renderer: renderer3, + parser: { + parse: /* @__PURE__ */ __name(() => { + return; + }, "parse") + } + }; + var errorDiagram_default = diagram17; + + // src/diagrams/flowchart/elk/detector.ts + var id19 = "flowchart-elk"; + var detector18 = /* @__PURE__ */ __name((txt, config6 = {}) => { + if ( + // If diagram explicitly states flowchart-elk + /^\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk + /^\s*flowchart|graph/.test(txt) && config6?.flowchart?.defaultRenderer === "elk" + ) { + config6.layout = "elk"; + return true; + } + return false; + }, "detector"); + var loader18 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id19, diagram: diagram23 }; + }, "loader"); + var plugin16 = { + id: id19, + detector: detector18, + loader: loader18 + }; + var detector_default = plugin16; + + // src/diagrams/timeline/detector.ts + var id20 = "timeline"; + var detector19 = /* @__PURE__ */ __name((txt) => { + return /^\s*timeline/.test(txt); + }, "detector"); + var loader19 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_timeline_definition(), timeline_definition_exports)); + return { id: id20, diagram: diagram23 }; + }, "loader"); + var plugin17 = { + id: id20, + detector: detector19, + loader: loader19 + }; + var detector_default2 = plugin17; + + // src/diagrams/mindmap/detector.ts + var id22 = "mindmap"; + var detector20 = /* @__PURE__ */ __name((txt) => { + return /^\s*mindmap/.test(txt); + }, "detector"); + var loader20 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_mindmap_definition(), mindmap_definition_exports)); + return { id: id22, diagram: diagram23 }; + }, "loader"); + var plugin18 = { + id: id22, + detector: detector20, + loader: loader20 + }; + var detector_default3 = plugin18; + + // src/diagrams/sankey/sankeyDetector.ts + var id23 = "sankey"; + var detector21 = /* @__PURE__ */ __name((txt) => { + return /^\s*sankey-beta/.test(txt); + }, "detector"); + var loader21 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_sankeyDiagram(), sankeyDiagram_exports)); + return { id: id23, diagram: diagram23 }; + }, "loader"); + var plugin19 = { + id: id23, + detector: detector21, + loader: loader21 + }; + var sankeyDetector_default = plugin19; + + // src/diagrams/packet/detector.ts + var id24 = "packet"; + var detector22 = /* @__PURE__ */ __name((txt) => { + return /^\s*packet-beta/.test(txt); + }, "detector"); + var loader22 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_diagram(), diagram_exports)); + return { id: id24, diagram: diagram23 }; + }, "loader"); + var packet = { + id: id24, + detector: detector22, + loader: loader22 + }; + + // src/diagrams/block/blockDetector.ts + var id25 = "block"; + var detector23 = /* @__PURE__ */ __name((txt) => { + return /^\s*block-beta/.test(txt); + }, "detector"); + var loader23 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram23 } = await Promise.resolve().then(() => (init_blockDiagram(), blockDiagram_exports)); + return { id: id25, diagram: diagram23 }; + }, "loader"); + var plugin20 = { + id: id25, + detector: detector23, + loader: loader23 + }; + var blockDetector_default = plugin20; + + // src/diagram-api/diagram-orchestration.ts + init_detectType(); + init_diagramAPI(); + var hasLoadedDiagrams = false; + var addDiagrams = /* @__PURE__ */ __name(() => { + if (hasLoadedDiagrams) { + return; + } + hasLoadedDiagrams = true; + registerDiagram("error", errorDiagram_default, (text2) => { + return text2.toLowerCase().trim() === "error"; + }); + registerDiagram( + "---", + // --- diagram type may appear if YAML front-matter is not parsed correctly + { + db: { + clear: /* @__PURE__ */ __name(() => { + }, "clear") + }, + styles: {}, + // should never be used + renderer: { + draw: /* @__PURE__ */ __name(() => { + }, "draw") + }, + parser: { + parse: /* @__PURE__ */ __name(() => { + throw new Error( + "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks" + ); + }, "parse") + }, + init: /* @__PURE__ */ __name(() => null, "init") + // no op + }, + (text2) => { + return text2.toLowerCase().trimStart().startsWith("---"); + } + ); + registerLazyLoadedDiagrams( + c4Detector_default, + classDetector_V2_default, + classDetector_default, + erDetector_default, + ganttDetector_default, + info, + pie, + requirementDetector_default, + sequenceDetector_default, + detector_default, + flowDetector_v2_default, + flowDetector_default, + detector_default3, + detector_default2, + gitGraphDetector_default, + stateDetector_V2_default, + stateDetector_default, + journeyDetector_default, + quadrantDetector_default, + sankeyDetector_default, + packet, + xychartDetector_default, + blockDetector_default + ); + }, "addDiagrams"); + + // src/diagram-api/loadDiagram.ts + init_logger(); + init_detectType(); + init_diagramAPI(); + var loadRegisteredDiagrams = /* @__PURE__ */ __name(async () => { + log.debug(`Loading registered diagrams`); + const results = await Promise.allSettled( + Object.entries(detectors).map(async ([key, { detector: detector24, loader: loader25 }]) => { + if (loader25) { + try { + getDiagram(key); + } catch { + try { + const { diagram: diagram23, id: id26 } = await loader25(); + registerDiagram(id26, diagram23, detector24); + } catch (err) { + log.error(`Failed to load external diagram with key ${key}. Removing from detectors.`); + delete detectors[key]; + throw err; } - /******/ - ]) - ); - }); - })(coseBase); - return coseBase.exports; - } - (function(module2, exports2) { - (function webpackUniversalModuleDefinition(root2, factory) { - module2.exports = factory(requireCoseBase()); - })(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE_0__) { - return ( - /******/ - function(modules) { - var installedModules = {}; - function __webpack_require__(moduleId) { - if (installedModules[moduleId]) { - return installedModules[moduleId].exports; - } - var module3 = installedModules[moduleId] = { - /******/ - i: moduleId, - /******/ - l: false, - /******/ - exports: {} - /******/ - }; - modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); - module3.l = true; - return module3.exports; } - __webpack_require__.m = modules; - __webpack_require__.c = installedModules; - __webpack_require__.i = function(value2) { - return value2; - }; - __webpack_require__.d = function(exports3, name, getter) { - if (!__webpack_require__.o(exports3, name)) { - Object.defineProperty(exports3, name, { - /******/ - configurable: false, - /******/ - enumerable: true, - /******/ - get: getter - /******/ - }); - } - }; - __webpack_require__.n = function(module3) { - var getter = module3 && module3.__esModule ? ( - /******/ - function getDefault() { - return module3["default"]; - } - ) : ( - /******/ - function getModuleExports() { - return module3; - } - ); - __webpack_require__.d(getter, "a", getter); - return getter; - }; - __webpack_require__.o = function(object2, property2) { - return Object.prototype.hasOwnProperty.call(object2, property2); - }; - __webpack_require__.p = ""; - return __webpack_require__(__webpack_require__.s = 1); - }([ - /* 0 */ - /***/ - function(module3, exports3) { - module3.exports = __WEBPACK_EXTERNAL_MODULE_0__; - }, - /* 1 */ - /***/ - function(module3, exports3, __webpack_require__) { - var LayoutConstants = __webpack_require__(0).layoutBase.LayoutConstants; - var FDLayoutConstants = __webpack_require__(0).layoutBase.FDLayoutConstants; - var CoSEConstants = __webpack_require__(0).CoSEConstants; - var CoSELayout = __webpack_require__(0).CoSELayout; - var CoSENode = __webpack_require__(0).CoSENode; - var PointD = __webpack_require__(0).layoutBase.PointD; - var DimensionD2 = __webpack_require__(0).layoutBase.DimensionD; - var defaults2 = { - // Called on `layoutready` - ready: function ready() { - }, - // Called on `layoutstop` - stop: function stop() { - }, - // 'draft', 'default' or 'proof" - // - 'draft' fast cooling rate - // - 'default' moderate cooling rate - // - "proof" slow cooling rate - quality: "default", - // include labels in node dimensions - nodeDimensionsIncludeLabels: false, - // number of ticks per frame; higher is faster but more jerky - refresh: 30, - // Whether to fit the network view after when done - fit: true, - // Padding on fit - padding: 10, - // Whether to enable incremental mode - randomize: true, - // Node repulsion (non overlapping) multiplier - nodeRepulsion: 4500, - // Ideal edge (non nested) length - idealEdgeLength: 50, - // Divisor to compute edge forces - edgeElasticity: 0.45, - // Nesting factor (multiplier) to compute ideal edge length for nested edges - nestingFactor: 0.1, - // Gravity force (constant) - gravity: 0.25, - // Maximum number of iterations to perform - numIter: 2500, - // For enabling tiling - tile: true, - // Type of layout animation. The option set is {'during', 'end', false} - animate: "end", - // Duration for animate:end - animationDuration: 500, - // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function) - tilingPaddingVertical: 10, - // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function) - tilingPaddingHorizontal: 10, - // Gravity range (constant) for compounds - gravityRangeCompound: 1.5, - // Gravity force (constant) for compounds - gravityCompound: 1, - // Gravity range (constant) - gravityRange: 3.8, - // Initial cooling factor for incremental layout - initialEnergyOnIncremental: 0.5 - }; - function extend2(defaults3, options2) { - var obj = {}; - for (var i2 in defaults3) { - obj[i2] = defaults3[i2]; - } - for (var i2 in options2) { - obj[i2] = options2[i2]; - } - return obj; - } - function _CoSELayout(_options) { - this.options = extend2(defaults2, _options); - getUserOptions(this.options); - } - var getUserOptions = function getUserOptions2(options2) { - if (options2.nodeRepulsion != null) - CoSEConstants.DEFAULT_REPULSION_STRENGTH = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = options2.nodeRepulsion; - if (options2.idealEdgeLength != null) - CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options2.idealEdgeLength; - if (options2.edgeElasticity != null) - CoSEConstants.DEFAULT_SPRING_STRENGTH = FDLayoutConstants.DEFAULT_SPRING_STRENGTH = options2.edgeElasticity; - if (options2.nestingFactor != null) - CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options2.nestingFactor; - if (options2.gravity != null) - CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options2.gravity; - if (options2.numIter != null) - CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options2.numIter; - if (options2.gravityRange != null) - CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options2.gravityRange; - if (options2.gravityCompound != null) - CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options2.gravityCompound; - if (options2.gravityRangeCompound != null) - CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options2.gravityRangeCompound; - if (options2.initialEnergyOnIncremental != null) - CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options2.initialEnergyOnIncremental; - if (options2.quality == "draft") - LayoutConstants.QUALITY = 0; - else if (options2.quality == "proof") - LayoutConstants.QUALITY = 2; - else - LayoutConstants.QUALITY = 1; - CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options2.nodeDimensionsIncludeLabels; - CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options2.randomize; - CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options2.animate; - CoSEConstants.TILE = options2.tile; - CoSEConstants.TILING_PADDING_VERTICAL = typeof options2.tilingPaddingVertical === "function" ? options2.tilingPaddingVertical.call() : options2.tilingPaddingVertical; - CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options2.tilingPaddingHorizontal === "function" ? options2.tilingPaddingHorizontal.call() : options2.tilingPaddingHorizontal; - }; - _CoSELayout.prototype.run = function() { - var ready; - var frameId; - var options2 = this.options; - this.idToLNode = {}; - var layout2 = this.layout = new CoSELayout(); - var self2 = this; - self2.stopped = false; - this.cy = this.options.cy; - this.cy.trigger({ type: "layoutstart", layout: this }); - var gm = layout2.newGraphManager(); - this.gm = gm; - var nodes2 = this.options.eles.nodes(); - var edges2 = this.options.eles.edges(); - this.root = gm.addRoot(); - this.processChildrenList(this.root, this.getTopMostNodes(nodes2), layout2); - for (var i2 = 0; i2 < edges2.length; i2++) { - var edge = edges2[i2]; - var sourceNode = this.idToLNode[edge.data("source")]; - var targetNode = this.idToLNode[edge.data("target")]; - if (sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) { - var e1 = gm.add(layout2.newEdge(), sourceNode, targetNode); - e1.id = edge.id(); - } - } - var getPositions = function getPositions2(ele, i3) { - if (typeof ele === "number") { - ele = i3; - } - var theId = ele.data("id"); - var lNode = self2.idToLNode[theId]; - return { - x: lNode.getRect().getCenterX(), - y: lNode.getRect().getCenterY() - }; - }; - var iterateAnimated = function iterateAnimated2() { - var afterReposition = function afterReposition2() { - if (options2.fit) { - options2.cy.fit(options2.eles, options2.padding); - } - if (!ready) { - ready = true; - self2.cy.one("layoutready", options2.ready); - self2.cy.trigger({ type: "layoutready", layout: self2 }); - } - }; - var ticksPerFrame = self2.options.refresh; - var isDone; - for (var i3 = 0; i3 < ticksPerFrame && !isDone; i3++) { - isDone = self2.stopped || self2.layout.tick(); - } - if (isDone) { - if (layout2.checkLayoutSuccess() && !layout2.isSubLayout) { - layout2.doPostLayout(); - } - if (layout2.tilingPostLayout) { - layout2.tilingPostLayout(); - } - layout2.isLayoutFinished = true; - self2.options.eles.nodes().positions(getPositions); - afterReposition(); - self2.cy.one("layoutstop", self2.options.stop); - self2.cy.trigger({ type: "layoutstop", layout: self2 }); - if (frameId) { - cancelAnimationFrame(frameId); - } - ready = false; - return; - } - var animationData = self2.layout.getPositionsData(); - options2.eles.nodes().positions(function(ele, i4) { - if (typeof ele === "number") { - ele = i4; - } - if (!ele.isParent()) { - var theId = ele.id(); - var pNode = animationData[theId]; - var temp = ele; - while (pNode == null) { - pNode = animationData[temp.data("parent")] || animationData["DummyCompound_" + temp.data("parent")]; - animationData[theId] = pNode; - temp = temp.parent()[0]; - if (temp == void 0) { - break; - } - } - if (pNode != null) { - return { - x: pNode.x, - y: pNode.y - }; - } else { - return { - x: ele.position("x"), - y: ele.position("y") - }; - } - } - }); - afterReposition(); - frameId = requestAnimationFrame(iterateAnimated2); - }; - layout2.addListener("layoutstarted", function() { - if (self2.options.animate === "during") { - frameId = requestAnimationFrame(iterateAnimated); - } - }); - layout2.runLayout(); - if (this.options.animate !== "during") { - self2.options.eles.nodes().not(":parent").layoutPositions(self2, self2.options, getPositions); - ready = false; - } - return this; - }; - _CoSELayout.prototype.getTopMostNodes = function(nodes2) { - var nodesMap2 = {}; - for (var i2 = 0; i2 < nodes2.length; i2++) { - nodesMap2[nodes2[i2].id()] = true; - } - var roots = nodes2.filter(function(ele, i3) { - if (typeof ele === "number") { - ele = i3; - } - var parent = ele.parent()[0]; - while (parent != null) { - if (nodesMap2[parent.id()]) { - return false; - } - parent = parent.parent()[0]; - } - return true; - }); - return roots; - }; - _CoSELayout.prototype.processChildrenList = function(parent, children2, layout2) { - var size2 = children2.length; - for (var i2 = 0; i2 < size2; i2++) { - var theChild = children2[i2]; - var children_of_children = theChild.children(); - var theNode; - var dimensions = theChild.layoutDimensions({ - nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels - }); - if (theChild.outerWidth() != null && theChild.outerHeight() != null) { - theNode = parent.add(new CoSENode(layout2.graphManager, new PointD(theChild.position("x") - dimensions.w / 2, theChild.position("y") - dimensions.h / 2), new DimensionD2(parseFloat(dimensions.w), parseFloat(dimensions.h)))); - } else { - theNode = parent.add(new CoSENode(this.graphManager)); - } - theNode.id = theChild.data("id"); - theNode.paddingLeft = parseInt(theChild.css("padding")); - theNode.paddingTop = parseInt(theChild.css("padding")); - theNode.paddingRight = parseInt(theChild.css("padding")); - theNode.paddingBottom = parseInt(theChild.css("padding")); - if (this.options.nodeDimensionsIncludeLabels) { - if (theChild.isParent()) { - var labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false }).w; - var labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false }).h; - var labelPos = theChild.css("text-halign"); - theNode.labelWidth = labelWidth; - theNode.labelHeight = labelHeight; - theNode.labelPos = labelPos; + } + }) + ); + const failed = results.filter((result) => result.status === "rejected"); + if (failed.length > 0) { + log.error(`Failed to load ${failed.length} external diagrams`); + for (const res of failed) { + log.error(res); + } + throw new Error(`Failed to load ${failed.length} external diagrams`); + } + }, "loadRegisteredDiagrams"); + + // src/mermaid.ts + init_logger(); + + // src/mermaidAPI.ts + init_src32(); + + // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Enum.js + var COMMENT = "comm"; + var RULESET = "rule"; + var DECLARATION = "decl"; + var IMPORT = "@import"; + var KEYFRAMES = "@keyframes"; + var LAYER = "@layer"; + + // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Utility.js + var abs3 = Math.abs; + var from = String.fromCharCode; + function trim(value2) { + return value2.trim(); + } + __name(trim, "trim"); + function replace(value2, pattern, replacement) { + return value2.replace(pattern, replacement); + } + __name(replace, "replace"); + function indexof(value2, search, position5) { + return value2.indexOf(search, position5); + } + __name(indexof, "indexof"); + function charat(value2, index) { + return value2.charCodeAt(index) | 0; + } + __name(charat, "charat"); + function substr(value2, begin, end2) { + return value2.slice(begin, end2); + } + __name(substr, "substr"); + function strlen(value2) { + return value2.length; + } + __name(strlen, "strlen"); + function sizeof(value2) { + return value2.length; + } + __name(sizeof, "sizeof"); + function append2(value2, array4) { + return array4.push(value2), value2; + } + __name(append2, "append"); + + // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Tokenizer.js + var line = 1; + var column = 1; + var length = 0; + var position4 = 0; + var character = 0; + var characters = ""; + function node(value2, root4, parent4, type3, props, children2, length2, siblings2) { + return { value: value2, root: root4, parent: parent4, type: type3, props, children: children2, line, column, length: length2, return: "", siblings: siblings2 }; + } + __name(node, "node"); + function char() { + return character; + } + __name(char, "char"); + function prev() { + character = position4 > 0 ? charat(characters, --position4) : 0; + if (column--, character === 10) + column = 1, line--; + return character; + } + __name(prev, "prev"); + function next2() { + character = position4 < length ? charat(characters, position4++) : 0; + if (column++, character === 10) + column = 1, line++; + return character; + } + __name(next2, "next"); + function peek() { + return charat(characters, position4); + } + __name(peek, "peek"); + function caret2() { + return position4; + } + __name(caret2, "caret"); + function slice4(begin, end2) { + return substr(characters, begin, end2); + } + __name(slice4, "slice"); + function token(type3) { + switch (type3) { + case 0: + case 9: + case 10: + case 13: + case 32: + return 5; + case 33: + case 43: + case 44: + case 47: + case 62: + case 64: + case 126: + case 59: + case 123: + case 125: + return 4; + case 58: + return 3; + case 34: + case 39: + case 40: + case 91: + return 2; + case 41: + case 93: + return 1; + } + return 0; + } + __name(token, "token"); + function alloc(value2) { + return line = column = 1, length = strlen(characters = value2), position4 = 0, []; + } + __name(alloc, "alloc"); + function dealloc(value2) { + return characters = "", value2; + } + __name(dealloc, "dealloc"); + function delimit(type3) { + return trim(slice4(position4 - 1, delimiter2(type3 === 91 ? type3 + 2 : type3 === 40 ? type3 + 1 : type3))); + } + __name(delimit, "delimit"); + function whitespace(type3) { + while (character = peek()) + if (character < 33) + next2(); + else + break; + return token(type3) > 2 || token(character) > 3 ? "" : " "; + } + __name(whitespace, "whitespace"); + function escaping(index, count) { + while (--count && next2()) + if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) + break; + return slice4(index, caret2() + (count < 6 && peek() == 32 && next2() == 32)); + } + __name(escaping, "escaping"); + function delimiter2(type3) { + while (next2()) + switch (character) { + case type3: + return position4; + case 34: + case 39: + if (type3 !== 34 && type3 !== 39) + delimiter2(character); + break; + case 40: + if (type3 === 41) + delimiter2(type3); + break; + case 92: + next2(); + break; + } + return position4; + } + __name(delimiter2, "delimiter"); + function commenter(type3, index) { + while (next2()) + if (type3 + character === 47 + 10) + break; + else if (type3 + character === 42 + 42 && peek() === 47) + break; + return "/*" + slice4(index, position4 - 1) + "*" + from(type3 === 47 ? type3 : next2()); + } + __name(commenter, "commenter"); + function identifier(index) { + while (!token(peek())) + next2(); + return slice4(index, position4); + } + __name(identifier, "identifier"); + + // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Parser.js + function compile(value2) { + return dealloc(parse5("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2)); + } + __name(compile, "compile"); + function parse5(value2, root4, parent4, rule, rules, rulesets, pseudo, points, declarations) { + var index = 0; + var offset = 0; + var length2 = pseudo; + var atrule = 0; + var property2 = 0; + var previous = 0; + var variable = 1; + var scanning = 1; + var ampersand = 1; + var character2 = 0; + var type3 = ""; + var props = rules; + var children2 = rulesets; + var reference = rule; + var characters2 = type3; + while (scanning) + switch (previous = character2, character2 = next2()) { + case 40: + if (previous != 108 && charat(characters2, length2 - 1) == 58) { + if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs3(index ? points[index - 1] : 0)) != -1) + ampersand = -1; + break; + } + case 34: + case 39: + case 91: + characters2 += delimit(character2); + break; + case 9: + case 10: + case 13: + case 32: + characters2 += whitespace(previous); + break; + case 92: + characters2 += escaping(caret2() - 1, 7); + continue; + case 47: + switch (peek()) { + case 42: + case 47: + append2(comment(commenter(next2(), caret2()), root4, parent4, declarations), declarations); + break; + default: + characters2 += "/"; + } + break; + case 123 * variable: + points[index++] = strlen(characters2) * ampersand; + case 125 * variable: + case 59: + case 0: + switch (character2) { + case 0: + case 125: + scanning = 0; + case 59 + offset: + if (ampersand == -1) characters2 = replace(characters2, /\f/g, ""); + if (property2 > 0 && strlen(characters2) - length2) + append2(property2 > 32 ? declaration(characters2 + ";", rule, parent4, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent4, length2 - 2, declarations), declarations); + break; + case 59: + characters2 += ";"; + default: + append2(reference = ruleset(characters2, root4, parent4, index, offset, rules, points, type3, props = [], children2 = [], length2, rulesets), rulesets); + if (character2 === 123) + if (offset === 0) + parse5(characters2, root4, reference, reference, props, rulesets, length2, points, children2); + else + switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) { + case 100: + case 108: + case 109: + case 115: + parse5(value2, reference, reference, rule && append2(ruleset(value2, reference, reference, 0, 0, rules, points, type3, rules, props = [], length2, children2), children2), rules, children2, length2, points, rule ? props : children2); + break; + default: + parse5(characters2, reference, reference, reference, [""], children2, 0, points, children2); } - } - this.idToLNode[theChild.data("id")] = theNode; - if (isNaN(theNode.rect.x)) { - theNode.rect.x = 0; - } - if (isNaN(theNode.rect.y)) { - theNode.rect.y = 0; - } - if (children_of_children != null && children_of_children.length > 0) { - var theNewGraph; - theNewGraph = layout2.getGraphManager().add(layout2.newGraph(), theNode); - this.processChildrenList(theNewGraph, children_of_children, layout2); - } - } - }; - _CoSELayout.prototype.stop = function() { - this.stopped = true; - return this; - }; - var register = function register2(cytoscape2) { - cytoscape2("layout", "cose-bilkent", _CoSELayout); - }; - if (typeof cytoscape !== "undefined") { - register(cytoscape); - } - module3.exports = register; } - /******/ - ]) + index = offset = property2 = 0, variable = ampersand = 1, type3 = characters2 = "", length2 = pseudo; + break; + case 58: + length2 = 1 + strlen(characters2), property2 = previous; + default: + if (variable < 1) { + if (character2 == 123) + --variable; + else if (character2 == 125 && variable++ == 0 && prev() == 125) + continue; + } + switch (characters2 += from(character2), character2 * variable) { + case 38: + ampersand = offset > 0 ? 1 : (characters2 += "\f", -1); + break; + case 44: + points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1; + break; + case 64: + if (peek() === 45) + characters2 += delimit(next2()); + atrule = peek(), offset = length2 = strlen(type3 = characters2 += identifier(caret2())), character2++; + break; + case 45: + if (previous === 45 && strlen(characters2) == 2) + variable = 0; + } + } + return rulesets; + } + __name(parse5, "parse"); + function ruleset(value2, root4, parent4, index, offset, rules, points, type3, props, children2, length2, siblings2) { + var post = offset - 1; + var rule = offset === 0 ? rules : [""]; + var size5 = sizeof(rule); + for (var i2 = 0, j2 = 0, k2 = 0; i2 < index; ++i2) + for (var x5 = 0, y5 = substr(value2, post + 1, post = abs3(j2 = points[i2])), z2 = value2; x5 < size5; ++x5) + if (z2 = trim(j2 > 0 ? rule[x5] + " " + y5 : replace(y5, /&\f/g, rule[x5]))) + props[k2++] = z2; + return node(value2, root4, parent4, offset === 0 ? RULESET : type3, props, children2, length2, siblings2); + } + __name(ruleset, "ruleset"); + function comment(value2, root4, parent4, siblings2) { + return node(value2, root4, parent4, COMMENT, from(char()), substr(value2, 2, -2), 0, siblings2); + } + __name(comment, "comment"); + function declaration(value2, root4, parent4, length2, siblings2) { + return node(value2, root4, parent4, DECLARATION, substr(value2, 0, length2), substr(value2, length2 + 1, -1), length2, siblings2); + } + __name(declaration, "declaration"); + + // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Serializer.js + function serialize(children2, callback) { + var output2 = ""; + for (var i2 = 0; i2 < children2.length; i2++) + output2 += callback(children2[i2], i2, children2, callback) || ""; + return output2; + } + __name(serialize, "serialize"); + function stringify(element3, index, children2, callback) { + switch (element3.type) { + case LAYER: + if (element3.children.length) break; + case IMPORT: + case DECLARATION: + return element3.return = element3.return || element3.value; + case COMMENT: + return ""; + case KEYFRAMES: + return element3.return = element3.value + "{" + serialize(element3.children, callback) + "}"; + case RULESET: + if (!strlen(element3.value = element3.props.join(","))) return ""; + } + return strlen(children2 = serialize(element3.children, callback)) ? element3.return = element3.value + "{" + children2 + "}" : ""; + } + __name(stringify, "stringify"); + + // src/mermaidAPI.ts + init_package(); + init_config(); + + // src/Diagram.ts + init_config(); + init_diagramAPI(); + init_detectType(); + init_errors(); + init_utils2(); + var Diagram = class _Diagram { + constructor(type3, text2, db7, parser21, renderer7) { + this.type = type3; + this.text = text2; + this.db = db7; + this.parser = parser21; + this.renderer = renderer7; + } + static { + __name(this, "Diagram"); + } + static async fromText(text2, metadata = {}) { + const config6 = getConfig(); + const type3 = detectType(text2, config6); + text2 = encodeEntities(text2) + "\n"; + try { + getDiagram(type3); + } catch { + const loader25 = getDiagramLoader(type3); + if (!loader25) { + throw new UnknownDiagramError(`Diagram ${type3} not found.`); + } + const { id: id26, diagram: diagram23 } = await loader25(); + registerDiagram(id26, diagram23); + } + const { db: db7, parser: parser21, renderer: renderer7, init: init3 } = getDiagram(type3); + if (parser21.parser) { + parser21.parser.yy = db7; + } + db7.clear?.(); + init3?.(config6); + if (metadata.title) { + db7.setDiagramTitle?.(metadata.title); + } + await parser21.parse(text2); + return new _Diagram(type3, text2, db7, parser21, renderer7); + } + async render(id26, version4) { + await this.renderer.draw(this.text, id26, version4, this); + } + getParser() { + return this.parser; + } + getType() { + return this.type; + } + }; + + // src/interactionDb.ts + var interactionFunctions = []; + var attachFunctions = /* @__PURE__ */ __name(() => { + interactionFunctions.forEach((f3) => { + f3(); + }); + interactionFunctions = []; + }, "attachFunctions"); + + // src/mermaidAPI.ts + init_logger(); + init_styles(); + init_themes(); + var import_dompurify2 = __toESM(require_purify(), 1); + init_common(); + init_isEmpty(); + + // src/accessibility.ts + var SVG_ROLE = "graphics-document document"; + function setA11yDiagramInfo(svg, diagramType) { + svg.attr("role", SVG_ROLE); + if (diagramType !== "") { + svg.attr("aria-roledescription", diagramType); + } + } + __name(setA11yDiagramInfo, "setA11yDiagramInfo"); + function addSVGa11yTitleDescription(svg, a11yTitle, a11yDesc, baseId) { + if (svg.insert === void 0) { + return; + } + if (a11yDesc) { + const descId = `chart-desc-${baseId}`; + svg.attr("aria-describedby", descId); + svg.insert("desc", ":first-child").attr("id", descId).text(a11yDesc); + } + if (a11yTitle) { + const titleId = `chart-title-${baseId}`; + svg.attr("aria-labelledby", titleId); + svg.insert("title", ":first-child").attr("id", titleId).text(a11yTitle); + } + } + __name(addSVGa11yTitleDescription, "addSVGa11yTitleDescription"); + + // src/diagram-api/comments.ts + var cleanupComments = /* @__PURE__ */ __name((text2) => { + return text2.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart(); + }, "cleanupComments"); + + // src/diagram-api/frontmatter.ts + init_regexes(); + + // ../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs + function isNothing(subject) { + return typeof subject === "undefined" || subject === null; + } + __name(isNothing, "isNothing"); + function isObject3(subject) { + return typeof subject === "object" && subject !== null; + } + __name(isObject3, "isObject"); + function toArray2(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + return [sequence]; + } + __name(toArray2, "toArray"); + function extend3(target, source) { + var index, length2, key, sourceKeys; + if (source) { + sourceKeys = Object.keys(source); + for (index = 0, length2 = sourceKeys.length; index < length2; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + return target; + } + __name(extend3, "extend"); + function repeat(string3, count) { + var result = "", cycle; + for (cycle = 0; cycle < count; cycle += 1) { + result += string3; + } + return result; + } + __name(repeat, "repeat"); + function isNegativeZero(number7) { + return number7 === 0 && Number.NEGATIVE_INFINITY === 1 / number7; + } + __name(isNegativeZero, "isNegativeZero"); + var isNothing_1 = isNothing; + var isObject_12 = isObject3; + var toArray_1 = toArray2; + var repeat_1 = repeat; + var isNegativeZero_1 = isNegativeZero; + var extend_1 = extend3; + var common = { + isNothing: isNothing_1, + isObject: isObject_12, + toArray: toArray_1, + repeat: repeat_1, + isNegativeZero: isNegativeZero_1, + extend: extend_1 + }; + function formatError(exception2, compact2) { + var where = "", message = exception2.reason || "(unknown reason)"; + if (!exception2.mark) return message; + if (exception2.mark.name) { + where += 'in "' + exception2.mark.name + '" '; + } + where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")"; + if (!compact2 && exception2.mark.snippet) { + where += "\n\n" + exception2.mark.snippet; + } + return message + " " + where; + } + __name(formatError, "formatError"); + function YAMLException$1(reason, mark) { + Error.call(this); + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack || ""; + } + } + __name(YAMLException$1, "YAMLException$1"); + YAMLException$1.prototype = Object.create(Error.prototype); + YAMLException$1.prototype.constructor = YAMLException$1; + YAMLException$1.prototype.toString = /* @__PURE__ */ __name(function toString5(compact2) { + return this.name + ": " + formatError(this, compact2); + }, "toString"); + var exception = YAMLException$1; + function getLine(buffer, lineStart, lineEnd, position5, maxLineLength) { + var head2 = ""; + var tail = ""; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + if (position5 - lineStart > maxHalfLength) { + head2 = " ... "; + lineStart = position5 - maxHalfLength + head2.length; + } + if (lineEnd - position5 > maxHalfLength) { + tail = " ..."; + lineEnd = position5 + maxHalfLength - tail.length; + } + return { + str: head2 + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail, + pos: position5 - lineStart + head2.length + // relative position + }; + } + __name(getLine, "getLine"); + function padStart(string3, max10) { + return common.repeat(" ", max10 - string3.length) + string3; + } + __name(padStart, "padStart"); + function makeSnippet(mark, options3) { + options3 = Object.create(options3 || null); + if (!mark.buffer) return null; + if (!options3.maxLength) options3.maxLength = 79; + if (typeof options3.indent !== "number") options3.indent = 1; + if (typeof options3.linesBefore !== "number") options3.linesBefore = 3; + if (typeof options3.linesAfter !== "number") options3.linesAfter = 2; + var re2 = /\r?\n|\r|\0/g; + var lineStarts = [0]; + var lineEnds = []; + var match2; + var foundLineNo = -1; + while (match2 = re2.exec(mark.buffer)) { + lineEnds.push(match2.index); + lineStarts.push(match2.index + match2[0].length); + if (mark.position <= match2.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; + var result = "", i2, line2; + var lineNoLength = Math.min(mark.line + options3.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options3.maxLength - (options3.indent + lineNoLength + 3); + for (i2 = 1; i2 <= options3.linesBefore; i2++) { + if (foundLineNo - i2 < 0) break; + line2 = getLine( + mark.buffer, + lineStarts[foundLineNo - i2], + lineEnds[foundLineNo - i2], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i2]), + maxLineLength + ); + result = common.repeat(" ", options3.indent) + padStart((mark.line - i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result; + } + line2 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(" ", options3.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line2.str + "\n"; + result += common.repeat("-", options3.indent + lineNoLength + 3 + line2.pos) + "^\n"; + for (i2 = 1; i2 <= options3.linesAfter; i2++) { + if (foundLineNo + i2 >= lineEnds.length) break; + line2 = getLine( + mark.buffer, + lineStarts[foundLineNo + i2], + lineEnds[foundLineNo + i2], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i2]), + maxLineLength ); + result += common.repeat(" ", options3.indent) + padStart((mark.line + i2 + 1).toString(), lineNoLength) + " | " + line2.str + "\n"; + } + return result.replace(/\n$/, ""); + } + __name(makeSnippet, "makeSnippet"); + var snippet = makeSnippet; + var TYPE_CONSTRUCTOR_OPTIONS = [ + "kind", + "multi", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "representName", + "defaultStyle", + "styleAliases" + ]; + var YAML_NODE_KINDS = [ + "scalar", + "sequence", + "mapping" + ]; + function compileStyleAliases(map5) { + var result = {}; + if (map5 !== null) { + Object.keys(map5).forEach(function(style3) { + map5[style3].forEach(function(alias) { + result[String(alias)] = style3; + }); + }); + } + return result; + } + __name(compileStyleAliases, "compileStyleAliases"); + function Type$1(tag2, options3) { + options3 = options3 || {}; + Object.keys(options3).forEach(function(name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag2 + '" YAML type.'); + } }); - })(cytoscapeCoseBilkent); - var cytoscapeCoseBilkentExports = cytoscapeCoseBilkent.exports; - const coseBilkent = /* @__PURE__ */ getDefaultExportFromCjs(cytoscapeCoseBilkentExports); - const MAX_SECTIONS = 12; - const defaultBkg = function(db2, elem, node2, section) { - const rd = 5; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db2.type2Str(node2.type)).attr( - "d", - `M0 ${node2.height - rd} v${-node2.height + 2 * rd} q0,-5 5,-5 h${node2.width - 2 * rd} q5,0 5,5 v${node2.height - rd} H0 Z` - ); - elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node2.height).attr("x2", node2.width).attr("y2", node2.height); - }; - const rectBkg = function(db2, elem, node2) { - elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db2.type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width); - }; - const cloudBkg = function(db2, elem, node2) { - const w2 = node2.width; - const h = node2.height; - const r1 = 0.15 * w2; - const r2 = 0.25 * w2; - const r3 = 0.35 * w2; - const r4 = 0.2 * w2; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db2.type2Str(node2.type)).attr( - "d", - `M0 0 a${r1},${r1} 0 0,1 ${w2 * 0.25},${-1 * w2 * 0.1} - a${r3},${r3} 1 0,1 ${w2 * 0.4},${-1 * w2 * 0.1} - a${r2},${r2} 1 0,1 ${w2 * 0.35},${1 * w2 * 0.2} - - a${r1},${r1} 1 0,1 ${w2 * 0.15},${1 * h * 0.35} - a${r4},${r4} 1 0,1 ${-1 * w2 * 0.15},${1 * h * 0.65} - - a${r2},${r1} 1 0,1 ${-1 * w2 * 0.25},${w2 * 0.15} - a${r3},${r3} 1 0,1 ${-1 * w2 * 0.5},${0} - a${r1},${r1} 1 0,1 ${-1 * w2 * 0.25},${-1 * w2 * 0.15} - - a${r1},${r1} 1 0,1 ${-1 * w2 * 0.1},${-1 * h * 0.35} - a${r4},${r4} 1 0,1 ${w2 * 0.1},${-1 * h * 0.65} - - H0 V0 Z` - ); - }; - const bangBkg = function(db2, elem, node2) { - const w2 = node2.width; - const h = node2.height; - const r = 0.15 * w2; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db2.type2Str(node2.type)).attr( - "d", - `M0 0 a${r},${r} 1 0,0 ${w2 * 0.25},${-1 * h * 0.1} - a${r},${r} 1 0,0 ${w2 * 0.25},${0} - a${r},${r} 1 0,0 ${w2 * 0.25},${0} - a${r},${r} 1 0,0 ${w2 * 0.25},${1 * h * 0.1} - - a${r},${r} 1 0,0 ${w2 * 0.15},${1 * h * 0.33} - a${r * 0.8},${r * 0.8} 1 0,0 ${0},${1 * h * 0.34} - a${r},${r} 1 0,0 ${-1 * w2 * 0.15},${1 * h * 0.33} - - a${r},${r} 1 0,0 ${-1 * w2 * 0.25},${h * 0.15} - a${r},${r} 1 0,0 ${-1 * w2 * 0.25},${0} - a${r},${r} 1 0,0 ${-1 * w2 * 0.25},${0} - a${r},${r} 1 0,0 ${-1 * w2 * 0.25},${-1 * h * 0.15} - - a${r},${r} 1 0,0 ${-1 * w2 * 0.1},${-1 * h * 0.33} - a${r * 0.8},${r * 0.8} 1 0,0 ${0},${-1 * h * 0.34} - a${r},${r} 1 0,0 ${w2 * 0.1},${-1 * h * 0.33} - - H0 V0 Z` - ); - }; - const circleBkg = function(db2, elem, node2) { - elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db2.type2Str(node2.type)).attr("r", node2.width / 2); - }; - function insertPolygonShape(parent, w2, h, points, node2) { - return parent.insert("polygon", ":first-child").attr( - "points", - points.map(function(d) { - return d.x + "," + d.y; - }).join(" ") - ).attr("transform", "translate(" + (node2.width - w2) / 2 + ", " + h + ")"); - } - const hexagonBkg = function(_db, elem, node2) { - const h = node2.height; - const f2 = 4; - const m = h / f2; - const w2 = node2.width - node2.padding + 2 * m; - const points = [ - { x: m, y: 0 }, - { x: w2 - m, y: 0 }, - { x: w2, y: -h / 2 }, - { x: w2 - m, y: -h }, - { x: m, y: -h }, - { x: 0, y: -h / 2 } - ]; - insertPolygonShape(elem, w2, h, points, node2); - }; - const roundedRectBkg = function(db2, elem, node2) { - elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db2.type2Str(node2.type)).attr("height", node2.height).attr("rx", node2.padding).attr("ry", node2.padding).attr("width", node2.width); - }; - const drawNode = function(db2, elem, node2, fullSection, conf2) { - const htmlLabels = conf2.htmlLabels; - const section = fullSection % (MAX_SECTIONS - 1); - const nodeElem = elem.append("g"); - node2.section = section; - let sectionClass = "section-" + section; - if (section < 0) { - sectionClass += " section-root"; - } - nodeElem.attr("class", (node2.class ? node2.class + " " : "") + "mindmap-node " + sectionClass); - const bkgElem = nodeElem.append("g"); - const textElem = nodeElem.append("g"); - const description = node2.descr.replace(/()/g, "\n"); - createText(textElem, description, { - useHtmlLabels: htmlLabels, - width: node2.width, - classes: "mindmap-node-label" + this.options = options3; + this.tag = tag2; + this.kind = options3["kind"] || null; + this.resolve = options3["resolve"] || function() { + return true; + }; + this.construct = options3["construct"] || function(data5) { + return data5; + }; + this.instanceOf = options3["instanceOf"] || null; + this.predicate = options3["predicate"] || null; + this.represent = options3["represent"] || null; + this.representName = options3["representName"] || null; + this.defaultStyle = options3["defaultStyle"] || null; + this.multi = options3["multi"] || false; + this.styleAliases = compileStyleAliases(options3["styleAliases"] || null); + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag2 + '" YAML type.'); + } + } + __name(Type$1, "Type$1"); + var type2 = Type$1; + function compileList(schema2, name) { + var result = []; + schema2[name].forEach(function(currentType) { + var newIndex = result.length; + result.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { + newIndex = previousIndex; + } + }); + result[newIndex] = currentType; }); - if (!htmlLabels) { - textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"); - } - const bbox = textElem.node().getBBox(); - const [fontSize] = parseFontSize(conf2.fontSize); - node2.height = bbox.height + fontSize * 1.1 * 0.5 + node2.padding; - node2.width = bbox.width + 2 * node2.padding; - if (node2.icon) { - if (node2.type === db2.nodeType.CIRCLE) { - node2.height += 50; - node2.width += 50; - const icon = nodeElem.append("foreignObject").attr("height", "50px").attr("width", node2.width).attr("style", "text-align: center;"); - icon.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon); - textElem.attr( - "transform", - "translate(" + node2.width / 2 + ", " + (node2.height / 2 - 1.5 * node2.padding) + ")" - ); - } else { - node2.width += 50; - const orgHeight = node2.height; - node2.height = Math.max(orgHeight, 60); - const heightDiff = Math.abs(node2.height - orgHeight); - const icon = nodeElem.append("foreignObject").attr("width", "60px").attr("height", node2.height).attr("style", "text-align: center;margin-top:" + heightDiff / 2 + "px;"); - icon.append("div").attr("class", "icon-container").append("i").attr("class", "node-icon-" + section + " " + node2.icon); - textElem.attr( - "transform", - "translate(" + (25 + node2.width / 2) + ", " + (heightDiff / 2 + node2.padding / 2) + ")" - ); + return result; + } + __name(compileList, "compileList"); + function compileMap() { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] } - } else { - if (!htmlLabels) { - const dx = node2.width / 2; - const dy = node2.padding / 2; - textElem.attr("transform", "translate(" + dx + ", " + dy + ")"); + }, index, length2; + function collectType(type3) { + if (type3.multi) { + result.multi[type3.kind].push(type3); + result.multi["fallback"].push(type3); } else { - const dx = (node2.width - bbox.width) / 2; - const dy = (node2.height - bbox.height) / 2; - textElem.attr("transform", "translate(" + dx + ", " + dy + ")"); + result[type3.kind][type3.tag] = result["fallback"][type3.tag] = type3; } } - switch (node2.type) { - case db2.nodeType.DEFAULT: - defaultBkg(db2, bkgElem, node2, section); - break; - case db2.nodeType.ROUNDED_RECT: - roundedRectBkg(db2, bkgElem, node2); - break; - case db2.nodeType.RECT: - rectBkg(db2, bkgElem, node2); - break; - case db2.nodeType.CIRCLE: - bkgElem.attr("transform", "translate(" + node2.width / 2 + ", " + +node2.height / 2 + ")"); - circleBkg(db2, bkgElem, node2); - break; - case db2.nodeType.CLOUD: - cloudBkg(db2, bkgElem, node2); - break; - case db2.nodeType.BANG: - bangBkg(db2, bkgElem, node2); - break; - case db2.nodeType.HEXAGON: - hexagonBkg(db2, bkgElem, node2); - break; - } - db2.setElementForId(node2.id, nodeElem); - return node2.height; - }; - const positionNode = function(db2, node2) { - const nodeElem = db2.getElementById(node2.id); - const x2 = node2.x || 0; - const y2 = node2.y || 0; - nodeElem.attr("transform", "translate(" + x2 + "," + y2 + ")"); - }; - cytoscape$1.use(coseBilkent); - function drawNodes(db2, svg2, mindmap2, section, conf2) { - drawNode(db2, svg2, mindmap2, section, conf2); - if (mindmap2.children) { - mindmap2.children.forEach((child, index2) => { - drawNodes(db2, svg2, child, section < 0 ? index2 : section, conf2); - }); + __name(collectType, "collectType"); + for (index = 0, length2 = arguments.length; index < length2; index += 1) { + arguments[index].forEach(collectType); } + return result; } - function drawEdges(edgesEl, cy) { - cy.edges().map((edge, id2) => { - const data = edge.data(); - if (edge[0]._private.bodyBounds) { - const bounds2 = edge[0]._private.rscratch; - log$1.trace("Edge: ", id2, data); - edgesEl.insert("path").attr( - "d", - `M ${bounds2.startX},${bounds2.startY} L ${bounds2.midX},${bounds2.midY} L${bounds2.endX},${bounds2.endY} ` - ).attr("class", "edge section-edge-" + data.section + " edge-depth-" + data.depth); + __name(compileMap, "compileMap"); + function Schema$1(definition) { + return this.extend(definition); + } + __name(Schema$1, "Schema$1"); + Schema$1.prototype.extend = /* @__PURE__ */ __name(function extend4(definition) { + var implicit2 = []; + var explicit = []; + if (definition instanceof type2) { + explicit.push(definition); + } else if (Array.isArray(definition)) { + explicit = explicit.concat(definition); + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + if (definition.implicit) implicit2 = implicit2.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); + } else { + throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + } + implicit2.forEach(function(type$1) { + if (!(type$1 instanceof type2)) { + throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + if (type$1.loadKind && type$1.loadKind !== "scalar") { + throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + } + if (type$1.multi) { + throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); } }); - } - function addNodes(mindmap2, cy, conf2, level) { - cy.add({ - group: "nodes", - data: { - id: mindmap2.id.toString(), - labelText: mindmap2.descr, - height: mindmap2.height, - width: mindmap2.width, - level, - nodeId: mindmap2.id, - padding: mindmap2.padding, - type: mindmap2.type - }, - position: { - x: mindmap2.x, - y: mindmap2.y + explicit.forEach(function(type$1) { + if (!(type$1 instanceof type2)) { + throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); } }); - if (mindmap2.children) { - mindmap2.children.forEach((child) => { - addNodes(child, cy, conf2, level + 1); - cy.add({ - group: "edges", - data: { - id: `${mindmap2.id}_${child.id}`, - source: mindmap2.id, - target: child.id, - depth: level, - section: child.section - } - }); - }); - } + var result = Object.create(Schema$1.prototype); + result.implicit = (this.implicit || []).concat(implicit2); + result.explicit = (this.explicit || []).concat(explicit); + result.compiledImplicit = compileList(result, "implicit"); + result.compiledExplicit = compileList(result, "explicit"); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + return result; + }, "extend"); + var schema = Schema$1; + var str = new type2("tag:yaml.org,2002:str", { + kind: "scalar", + construct: /* @__PURE__ */ __name(function(data5) { + return data5 !== null ? data5 : ""; + }, "construct") + }); + var seq = new type2("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: /* @__PURE__ */ __name(function(data5) { + return data5 !== null ? data5 : []; + }, "construct") + }); + var map4 = new type2("tag:yaml.org,2002:map", { + kind: "mapping", + construct: /* @__PURE__ */ __name(function(data5) { + return data5 !== null ? data5 : {}; + }, "construct") + }); + var failsafe = new schema({ + explicit: [ + str, + seq, + map4 + ] + }); + function resolveYamlNull(data5) { + if (data5 === null) return true; + var max10 = data5.length; + return max10 === 1 && data5 === "~" || max10 === 4 && (data5 === "null" || data5 === "Null" || data5 === "NULL"); } - function layoutMindmap(node2, conf2) { - return new Promise((resolve) => { - const renderEl = d3select("body").append("div").attr("id", "cy").attr("style", "display:none"); - const cy = cytoscape$1({ - container: document.getElementById("cy"), - // container to render in - style: [ - { - selector: "edge", - style: { - "curve-style": "bezier" - } - } - ] - }); - renderEl.remove(); - addNodes(node2, cy, conf2, 0); - cy.nodes().forEach(function(n) { - n.layoutDimensions = () => { - const data = n.data(); - return { w: data.width, h: data.height }; - }; - }); - cy.layout({ - name: "cose-bilkent", - // @ts-ignore Types for cose-bilkent are not correct? - quality: "proof", - styleEnabled: false, - animate: false - }).run(); - cy.ready((e) => { - log$1.info("Ready", e); - resolve(cy); - }); - }); + __name(resolveYamlNull, "resolveYamlNull"); + function constructYamlNull() { + return null; } - function positionNodes(db2, cy) { - cy.nodes().map((node2, id2) => { - const data = node2.data(); - data.x = node2.position().x; - data.y = node2.position().y; - positionNode(db2, data); - const el = db2.getElementById(data.nodeId); - log$1.info("Id:", id2, "Position: (", node2.position().x, ", ", node2.position().y, ")", data); - el.attr( - "transform", - `translate(${node2.position().x - data.width / 2}, ${node2.position().y - data.height / 2})` - ); - el.attr("attr", `apa-${id2})`); - }); + __name(constructYamlNull, "constructYamlNull"); + function isNull(object3) { + return object3 === null; } - const draw$2 = async (text2, id2, _version, diagObj) => { - var _a2, _b2; - log$1.debug("Rendering mindmap diagram\n" + text2); - const db2 = diagObj.db; - const mm = db2.getMindmap(); - if (!mm) { - return; - } - const conf2 = getConfig$1(); - conf2.htmlLabels = false; - const svg2 = selectSvgElement(id2); - const edgesElem = svg2.append("g"); - edgesElem.attr("class", "mindmap-edges"); - const nodesElem = svg2.append("g"); - nodesElem.attr("class", "mindmap-nodes"); - drawNodes(db2, nodesElem, mm, -1, conf2); - const cy = await layoutMindmap(mm, conf2); - drawEdges(edgesElem, cy); - positionNodes(db2, cy); - setupGraphViewbox$1( - void 0, - svg2, - ((_a2 = conf2.mindmap) == null ? void 0 : _a2.padding) ?? defaultConfig$2.mindmap.padding, - ((_b2 = conf2.mindmap) == null ? void 0 : _b2.useMaxWidth) ?? defaultConfig$2.mindmap.useMaxWidth - ); - }; - const renderer$2 = { - draw: draw$2 - }; - const genSections = (options2) => { - let sections2 = ""; - for (let i2 = 0; i2 < options2.THEME_COLOR_LIMIT; i2++) { - options2["lineColor" + i2] = options2["lineColor" + i2] || options2["cScaleInv" + i2]; - if (isDark$1(options2["lineColor" + i2])) { - options2["lineColor" + i2] = lighten$1(options2["lineColor" + i2], 20); - } else { - options2["lineColor" + i2] = darken$1(options2["lineColor" + i2], 20); + __name(isNull, "isNull"); + var _null = new type2("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: /* @__PURE__ */ __name(function() { + return "~"; + }, "canonical"), + lowercase: /* @__PURE__ */ __name(function() { + return "null"; + }, "lowercase"), + uppercase: /* @__PURE__ */ __name(function() { + return "NULL"; + }, "uppercase"), + camelcase: /* @__PURE__ */ __name(function() { + return "Null"; + }, "camelcase"), + empty: /* @__PURE__ */ __name(function() { + return ""; + }, "empty") + }, + defaultStyle: "lowercase" + }); + function resolveYamlBoolean(data5) { + if (data5 === null) return false; + var max10 = data5.length; + return max10 === 4 && (data5 === "true" || data5 === "True" || data5 === "TRUE") || max10 === 5 && (data5 === "false" || data5 === "False" || data5 === "FALSE"); + } + __name(resolveYamlBoolean, "resolveYamlBoolean"); + function constructYamlBoolean(data5) { + return data5 === "true" || data5 === "True" || data5 === "TRUE"; + } + __name(constructYamlBoolean, "constructYamlBoolean"); + function isBoolean(object3) { + return Object.prototype.toString.call(object3) === "[object Boolean]"; + } + __name(isBoolean, "isBoolean"); + var bool = new type2("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: /* @__PURE__ */ __name(function(object3) { + return object3 ? "true" : "false"; + }, "lowercase"), + uppercase: /* @__PURE__ */ __name(function(object3) { + return object3 ? "TRUE" : "FALSE"; + }, "uppercase"), + camelcase: /* @__PURE__ */ __name(function(object3) { + return object3 ? "True" : "False"; + }, "camelcase") + }, + defaultStyle: "lowercase" + }); + function isHexCode(c3) { + return 48 <= c3 && c3 <= 57 || 65 <= c3 && c3 <= 70 || 97 <= c3 && c3 <= 102; + } + __name(isHexCode, "isHexCode"); + function isOctCode(c3) { + return 48 <= c3 && c3 <= 55; + } + __name(isOctCode, "isOctCode"); + function isDecCode(c3) { + return 48 <= c3 && c3 <= 57; + } + __name(isDecCode, "isDecCode"); + function resolveYamlInteger(data5) { + if (data5 === null) return false; + var max10 = data5.length, index = 0, hasDigits = false, ch; + if (!max10) return false; + ch = data5[index]; + if (ch === "-" || ch === "+") { + ch = data5[++index]; + } + if (ch === "0") { + if (index + 1 === max10) return true; + ch = data5[++index]; + if (ch === "b") { + index++; + for (; index < max10; index++) { + ch = data5[index]; + if (ch === "_") continue; + if (ch !== "0" && ch !== "1") return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "x") { + index++; + for (; index < max10; index++) { + ch = data5[index]; + if (ch === "_") continue; + if (!isHexCode(data5.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "o") { + index++; + for (; index < max10; index++) { + ch = data5[index]; + if (ch === "_") continue; + if (!isOctCode(data5.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; } } - for (let i2 = 0; i2 < options2.THEME_COLOR_LIMIT; i2++) { - const sw = "" + (17 - 3 * i2); - sections2 += ` - .section-${i2 - 1} rect, .section-${i2 - 1} path, .section-${i2 - 1} circle, .section-${i2 - 1} polygon, .section-${i2 - 1} path { - fill: ${options2["cScale" + i2]}; + if (ch === "_") return false; + for (; index < max10; index++) { + ch = data5[index]; + if (ch === "_") continue; + if (!isDecCode(data5.charCodeAt(index))) { + return false; + } + hasDigits = true; } - .section-${i2 - 1} text { - fill: ${options2["cScaleLabel" + i2]}; + if (!hasDigits || ch === "_") return false; + return true; + } + __name(resolveYamlInteger, "resolveYamlInteger"); + function constructYamlInteger(data5) { + var value2 = data5, sign2 = 1, ch; + if (value2.indexOf("_") !== -1) { + value2 = value2.replace(/_/g, ""); } - .node-icon-${i2 - 1} { - font-size: 40px; - color: ${options2["cScaleLabel" + i2]}; + ch = value2[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") sign2 = -1; + value2 = value2.slice(1); + ch = value2[0]; } - .section-edge-${i2 - 1}{ - stroke: ${options2["cScale" + i2]}; + if (value2 === "0") return 0; + if (ch === "0") { + if (value2[1] === "b") return sign2 * parseInt(value2.slice(2), 2); + if (value2[1] === "x") return sign2 * parseInt(value2.slice(2), 16); + if (value2[1] === "o") return sign2 * parseInt(value2.slice(2), 8); } - .edge-depth-${i2 - 1}{ - stroke-width: ${sw}; + return sign2 * parseInt(value2, 10); + } + __name(constructYamlInteger, "constructYamlInteger"); + function isInteger(object3) { + return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 === 0 && !common.isNegativeZero(object3)); + } + __name(isInteger, "isInteger"); + var int = new type2("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: /* @__PURE__ */ __name(function(obj) { + return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); + }, "binary"), + octal: /* @__PURE__ */ __name(function(obj) { + return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); + }, "octal"), + decimal: /* @__PURE__ */ __name(function(obj) { + return obj.toString(10); + }, "decimal"), + /* eslint-disable max-len */ + hexadecimal: /* @__PURE__ */ __name(function(obj) { + return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); + }, "hexadecimal") + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] } - .section-${i2 - 1} line { - stroke: ${options2["cScaleInv" + i2]} ; - stroke-width: 3; + }); + var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" + ); + function resolveYamlFloat(data5) { + if (data5 === null) return false; + if (!YAML_FLOAT_PATTERN.test(data5) || // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data5[data5.length - 1] === "_") { + return false; } - - .disabled, .disabled circle, .disabled text { - fill: lightgray; + return true; + } + __name(resolveYamlFloat, "resolveYamlFloat"); + function constructYamlFloat(data5) { + var value2, sign2; + value2 = data5.replace(/_/g, "").toLowerCase(); + sign2 = value2[0] === "-" ? -1 : 1; + if ("+-".indexOf(value2[0]) >= 0) { + value2 = value2.slice(1); } - .disabled text { - fill: #efefef; + if (value2 === ".inf") { + return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + } else if (value2 === ".nan") { + return NaN; } - `; + return sign2 * parseFloat(value2, 10); + } + __name(constructYamlFloat, "constructYamlFloat"); + var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + function representYamlFloat(object3, style3) { + var res; + if (isNaN(object3)) { + switch (style3) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + } else if (Number.POSITIVE_INFINITY === object3) { + switch (style3) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + } else if (Number.NEGATIVE_INFINITY === object3) { + switch (style3) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + } else if (common.isNegativeZero(object3)) { + return "-0.0"; } - return sections2; - }; - const getStyles$1 = (options2) => ` - .edge { - stroke-width: 3; + res = object3.toString(10); + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; } - ${genSections(options2)} - .section-root rect, .section-root path, .section-root circle, .section-root polygon { - fill: ${options2.git0}; + __name(representYamlFloat, "representYamlFloat"); + function isFloat(object3) { + return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 !== 0 || common.isNegativeZero(object3)); } - .section-root text { - fill: ${options2.gitBranchLabel0}; + __name(isFloat, "isFloat"); + var float = new type2("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: "lowercase" + }); + var json2 = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] + }); + var core3 = json2; + var YAML_DATE_REGEXP = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" + ); + var YAML_TIMESTAMP_REGEXP = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" + ); + function resolveYamlTimestamp(data5) { + if (data5 === null) return false; + if (YAML_DATE_REGEXP.exec(data5) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data5) !== null) return true; + return false; } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; + __name(resolveYamlTimestamp, "resolveYamlTimestamp"); + function constructYamlTimestamp(data5) { + var match2, year, month, day, hour, minute, second2, fraction = 0, delta = null, tz_hour, tz_minute, date2; + match2 = YAML_DATE_REGEXP.exec(data5); + if (match2 === null) match2 = YAML_TIMESTAMP_REGEXP.exec(data5); + if (match2 === null) throw new Error("Date resolve error"); + year = +match2[1]; + month = +match2[2] - 1; + day = +match2[3]; + if (!match2[4]) { + return new Date(Date.UTC(year, month, day)); + } + hour = +match2[4]; + minute = +match2[5]; + second2 = +match2[6]; + if (match2[7]) { + fraction = match2[7].slice(0, 3); + while (fraction.length < 3) { + fraction += "0"; + } + fraction = +fraction; + } + if (match2[9]) { + tz_hour = +match2[10]; + tz_minute = +(match2[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 6e4; + if (match2[9] === "-") delta = -delta; + } + date2 = new Date(Date.UTC(year, month, day, hour, minute, second2, fraction)); + if (delta) date2.setTime(date2.getTime() - delta); + return date2; } - .edge { - fill: none; + __name(constructYamlTimestamp, "constructYamlTimestamp"); + function representYamlTimestamp(object3) { + return object3.toISOString(); } - .mindmap-node-label { - dy: 1em; - alignment-baseline: middle; - text-anchor: middle; - dominant-baseline: middle; - text-align: center; + __name(representYamlTimestamp, "representYamlTimestamp"); + var timestamp = new type2("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp + }); + function resolveYamlMerge(data5) { + return data5 === "<<" || data5 === null; } -`; - const styles = getStyles$1; - const diagram$2 = { - db: db$4, - renderer: renderer$2, - parser: parser$5, - styles - }; - const mindmapDefinition = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$2 - }, Symbol.toStringTag, { value: "Module" })); - var parser$2 = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 9], $V1 = [1, 10], $V2 = [1, 5, 10, 12]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "start": 3, "SANKEY": 4, "NEWLINE": 5, "csv": 6, "opt_eof": 7, "record": 8, "csv_tail": 9, "EOF": 10, "field[source]": 11, "COMMA": 12, "field[target]": 13, "field[value]": 14, "field": 15, "escaped": 16, "non_escaped": 17, "DQUOTE": 18, "ESCAPED_TEXT": 19, "NON_ESCAPED_TEXT": 20, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" }, - productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 7: - const source = yy.findOrCreateNode($$[$0 - 4].trim().replaceAll('""', '"')); - const target = yy.findOrCreateNode($$[$0 - 2].trim().replaceAll('""', '"')); - const value2 = parseFloat($$[$0].trim()); - yy.addLink(source, target, value2); - break; - case 8: - case 9: - case 11: - this.$ = $$[$0]; - break; - case 10: - this.$ = $$[$0 - 1]; - break; - } - }, - table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 1: [2, 6], 7: 11, 10: [1, 12] }, o($V1, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, o($V2, [2, 8]), o($V2, [2, 9]), { 19: [1, 16] }, o($V2, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, o($V1, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 15: 18, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 18: [1, 19] }, o($V1, [2, 3]), { 12: [1, 20] }, o($V2, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: $V0, 20: $V1 }, o([1, 5, 10], [2, 7])], - defaultActions: { 11: [2, 1], 12: [2, 5] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); - } else { - var error = new Error(str2); - error.hash = hash; - throw error; - } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; - } - return token2; - } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; + __name(resolveYamlMerge, "resolveYamlMerge"); + var merge4 = new type2("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: resolveYamlMerge + }); + var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; + function resolveYamlBinary(data5) { + if (data5 === null) return false; + var code, idx, bitlen = 0, max10 = data5.length, map5 = BASE64_MAP; + for (idx = 0; idx < max10; idx++) { + code = map5.indexOf(data5.charAt(idx)); + if (code > 64) continue; + if (code < 0) return false; + bitlen += 6; + } + return bitlen % 8 === 0; + } + __name(resolveYamlBinary, "resolveYamlBinary"); + function constructYamlBinary(data5) { + var idx, tailbits, input = data5.replace(/[\r\n=]/g, ""), max10 = input.length, map5 = BASE64_MAP, bits = 0, result = []; + for (idx = 0; idx < max10; idx++) { + if (idx % 4 === 0 && idx) { + result.push(bits >> 16 & 255); + result.push(bits >> 8 & 255); + result.push(bits & 255); } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; - } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; - } - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: { "case-insensitive": true }, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - this.pushState("csv"); - return 4; - case 1: - return 10; - case 2: - return 5; - case 3: - return 12; - case 4: - this.pushState("escaped_text"); - return 18; - case 5: - return 20; - case 6: - this.popState("escaped_text"); - return 18; - case 7: - return 19; - } - }, - rules: [/^(?:sankey-beta\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i], - conditions: { "csv": { "rules": [1, 2, 3, 4, 5, 6, 7], "inclusive": false }, "escaped_text": { "rules": [6, 7], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser$2.parser = parser$2; - const parser$3 = parser$2; - let links = []; - let nodes = []; - let nodesMap = {}; - const clear$1 = () => { - links = []; - nodes = []; - nodesMap = {}; - clear$n(); - }; - class SankeyLink { - constructor(source, target, value2 = 0) { - this.source = source; - this.target = target; - this.value = value2; + bits = bits << 6 | map5.indexOf(input.charAt(idx)); + } + tailbits = max10 % 4 * 6; + if (tailbits === 0) { + result.push(bits >> 16 & 255); + result.push(bits >> 8 & 255); + result.push(bits & 255); + } else if (tailbits === 18) { + result.push(bits >> 10 & 255); + result.push(bits >> 2 & 255); + } else if (tailbits === 12) { + result.push(bits >> 4 & 255); + } + return new Uint8Array(result); + } + __name(constructYamlBinary, "constructYamlBinary"); + function representYamlBinary(object3) { + var result = "", bits = 0, idx, tail, max10 = object3.length, map5 = BASE64_MAP; + for (idx = 0; idx < max10; idx++) { + if (idx % 3 === 0 && idx) { + result += map5[bits >> 18 & 63]; + result += map5[bits >> 12 & 63]; + result += map5[bits >> 6 & 63]; + result += map5[bits & 63]; + } + bits = (bits << 8) + object3[idx]; + } + tail = max10 % 3; + if (tail === 0) { + result += map5[bits >> 18 & 63]; + result += map5[bits >> 12 & 63]; + result += map5[bits >> 6 & 63]; + result += map5[bits & 63]; + } else if (tail === 2) { + result += map5[bits >> 10 & 63]; + result += map5[bits >> 4 & 63]; + result += map5[bits << 2 & 63]; + result += map5[64]; + } else if (tail === 1) { + result += map5[bits >> 2 & 63]; + result += map5[bits << 4 & 63]; + result += map5[64]; + result += map5[64]; + } + return result; + } + __name(representYamlBinary, "representYamlBinary"); + function isBinary(obj) { + return Object.prototype.toString.call(obj) === "[object Uint8Array]"; + } + __name(isBinary, "isBinary"); + var binary = new type2("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary + }); + var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; + var _toString$2 = Object.prototype.toString; + function resolveYamlOmap(data5) { + if (data5 === null) return true; + var objectKeys = [], index, length2, pair, pairKey, pairHasKey, object3 = data5; + for (index = 0, length2 = object3.length; index < length2; index += 1) { + pair = object3[index]; + pairHasKey = false; + if (_toString$2.call(pair) !== "[object Object]") return false; + for (pairKey in pair) { + if (_hasOwnProperty$3.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + if (!pairHasKey) return false; + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; } + return true; } - const addLink = (source, target, value2) => { - links.push(new SankeyLink(source, target, value2)); - }; - class SankeyNode { - constructor(ID) { - this.ID = ID; - } + __name(resolveYamlOmap, "resolveYamlOmap"); + function constructYamlOmap(data5) { + return data5 !== null ? data5 : []; } - const findOrCreateNode = (ID) => { - ID = common$1.sanitizeText(ID, getConfig$1()); - if (!nodesMap[ID]) { - nodesMap[ID] = new SankeyNode(ID); - nodes.push(nodesMap[ID]); - } - return nodesMap[ID]; - }; - const getNodes = () => nodes; - const getLinks = () => links; - const getGraph = () => ({ - nodes: nodes.map((node2) => ({ id: node2.ID })), - links: links.map((link2) => ({ - source: link2.source.ID, - target: link2.target.ID, - value: link2.value - })) - }); - const db$2 = { - nodesMap, - getConfig: () => getConfig$1().sankey, - getNodes, - getLinks, - getGraph, - addLink, - findOrCreateNode, - getAccTitle, - setAccTitle, - getAccDescription, - setAccDescription, - getDiagramTitle, - setDiagramTitle, - clear: clear$1 - }; - function max(values2, valueof) { - let max2; - if (valueof === void 0) { - for (const value2 of values2) { - if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) { - max2 = value2; - } - } - } else { - let index2 = -1; - for (let value2 of values2) { - if ((value2 = valueof(value2, ++index2, values2)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) { - max2 = value2; - } - } + __name(constructYamlOmap, "constructYamlOmap"); + var omap = new type2("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: resolveYamlOmap, + construct: constructYamlOmap + }); + var _toString$1 = Object.prototype.toString; + function resolveYamlPairs(data5) { + if (data5 === null) return true; + var index, length2, pair, keys3, result, object3 = data5; + result = new Array(object3.length); + for (index = 0, length2 = object3.length; index < length2; index += 1) { + pair = object3[index]; + if (_toString$1.call(pair) !== "[object Object]") return false; + keys3 = Object.keys(pair); + if (keys3.length !== 1) return false; + result[index] = [keys3[0], pair[keys3[0]]]; } - return max2; + return true; } - function min(values2, valueof) { - let min2; - if (valueof === void 0) { - for (const value2 of values2) { - if (value2 != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) { - min2 = value2; - } - } - } else { - let index2 = -1; - for (let value2 of values2) { - if ((value2 = valueof(value2, ++index2, values2)) != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) { - min2 = value2; - } - } + __name(resolveYamlPairs, "resolveYamlPairs"); + function constructYamlPairs(data5) { + if (data5 === null) return []; + var index, length2, pair, keys3, result, object3 = data5; + result = new Array(object3.length); + for (index = 0, length2 = object3.length; index < length2; index += 1) { + pair = object3[index]; + keys3 = Object.keys(pair); + result[index] = [keys3[0], pair[keys3[0]]]; } - return min2; + return result; } - function sum(values2, valueof) { - let sum2 = 0; - if (valueof === void 0) { - for (let value2 of values2) { - if (value2 = +value2) { - sum2 += value2; - } - } - } else { - let index2 = -1; - for (let value2 of values2) { - if (value2 = +valueof(value2, ++index2, values2)) { - sum2 += value2; - } + __name(constructYamlPairs, "constructYamlPairs"); + var pairs = new type2("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: resolveYamlPairs, + construct: constructYamlPairs + }); + var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + function resolveYamlSet(data5) { + if (data5 === null) return true; + var key, object3 = data5; + for (key in object3) { + if (_hasOwnProperty$2.call(object3, key)) { + if (object3[key] !== null) return false; } } - return sum2; + return true; } - function targetDepth(d) { - return d.target.depth; + __name(resolveYamlSet, "resolveYamlSet"); + function constructYamlSet(data5) { + return data5 !== null ? data5 : {}; } - function left(node2) { - return node2.depth; + __name(constructYamlSet, "constructYamlSet"); + var set5 = new type2("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: resolveYamlSet, + construct: constructYamlSet + }); + var _default = core3.extend({ + implicit: [ + timestamp, + merge4 + ], + explicit: [ + binary, + omap, + pairs, + set5 + ] + }); + var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var CONTEXT_FLOW_IN = 1; + var CONTEXT_FLOW_OUT = 2; + var CONTEXT_BLOCK_IN = 3; + var CONTEXT_BLOCK_OUT = 4; + var CHOMPING_CLIP = 1; + var CHOMPING_STRIP = 2; + var CHOMPING_KEEP = 3; + var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; + var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; + var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; + var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function _class(obj) { + return Object.prototype.toString.call(obj); } - function right(node2, n) { - return n - 1 - node2.height; + __name(_class, "_class"); + function is_EOL(c3) { + return c3 === 10 || c3 === 13; } - function justify(node2, n) { - return node2.sourceLinks.length ? node2.depth : n - 1; + __name(is_EOL, "is_EOL"); + function is_WHITE_SPACE(c3) { + return c3 === 9 || c3 === 32; } - function center(node2) { - return node2.targetLinks.length ? node2.depth : node2.sourceLinks.length ? min(node2.sourceLinks, targetDepth) - 1 : 0; + __name(is_WHITE_SPACE, "is_WHITE_SPACE"); + function is_WS_OR_EOL(c3) { + return c3 === 9 || c3 === 32 || c3 === 10 || c3 === 13; } - function constant$1(x2) { - return function() { - return x2; - }; + __name(is_WS_OR_EOL, "is_WS_OR_EOL"); + function is_FLOW_INDICATOR(c3) { + return c3 === 44 || c3 === 91 || c3 === 93 || c3 === 123 || c3 === 125; } - function ascendingSourceBreadth(a, b) { - return ascendingBreadth(a.source, b.source) || a.index - b.index; + __name(is_FLOW_INDICATOR, "is_FLOW_INDICATOR"); + function fromHexCode(c3) { + var lc; + if (48 <= c3 && c3 <= 57) { + return c3 - 48; + } + lc = c3 | 32; + if (97 <= lc && lc <= 102) { + return lc - 97 + 10; + } + return -1; } - function ascendingTargetBreadth(a, b) { - return ascendingBreadth(a.target, b.target) || a.index - b.index; + __name(fromHexCode, "fromHexCode"); + function escapedHexLen(c3) { + if (c3 === 120) { + return 2; + } + if (c3 === 117) { + return 4; + } + if (c3 === 85) { + return 8; + } + return 0; } - function ascendingBreadth(a, b) { - return a.y0 - b.y0; + __name(escapedHexLen, "escapedHexLen"); + function fromDecimalCode(c3) { + if (48 <= c3 && c3 <= 57) { + return c3 - 48; + } + return -1; } - function value(d) { - return d.value; + __name(fromDecimalCode, "fromDecimalCode"); + function simpleEscapeSequence(c3) { + return c3 === 48 ? "\0" : c3 === 97 ? "\x07" : c3 === 98 ? "\b" : c3 === 116 ? " " : c3 === 9 ? " " : c3 === 110 ? "\n" : c3 === 118 ? "\v" : c3 === 102 ? "\f" : c3 === 114 ? "\r" : c3 === 101 ? "\x1B" : c3 === 32 ? " " : c3 === 34 ? '"' : c3 === 47 ? "/" : c3 === 92 ? "\\" : c3 === 78 ? "\x85" : c3 === 95 ? "\xA0" : c3 === 76 ? "\u2028" : c3 === 80 ? "\u2029" : ""; } - function defaultId(d) { - return d.index; + __name(simpleEscapeSequence, "simpleEscapeSequence"); + function charFromCodepoint(c3) { + if (c3 <= 65535) { + return String.fromCharCode(c3); + } + return String.fromCharCode( + (c3 - 65536 >> 10) + 55296, + (c3 - 65536 & 1023) + 56320 + ); } - function defaultNodes(graph) { - return graph.nodes; + __name(charFromCodepoint, "charFromCodepoint"); + var simpleEscapeCheck = new Array(256); + var simpleEscapeMap = new Array(256); + for (i2 = 0; i2 < 256; i2++) { + simpleEscapeCheck[i2] = simpleEscapeSequence(i2) ? 1 : 0; + simpleEscapeMap[i2] = simpleEscapeSequence(i2); } - function defaultLinks(graph) { - return graph.links; + var i2; + function State$1(input, options3) { + this.input = input; + this.filename = options3["filename"] || null; + this.schema = options3["schema"] || _default; + this.onWarning = options3["onWarning"] || null; + this.legacy = options3["legacy"] || false; + this.json = options3["json"] || false; + this.listener = options3["listener"] || null; + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + this.firstTabInLine = -1; + this.documents = []; } - function find(nodeById, id2) { - const node2 = nodeById.get(id2); - if (!node2) - throw new Error("missing: " + id2); - return node2; + __name(State$1, "State$1"); + function generateError(state4, message) { + var mark = { + name: state4.filename, + buffer: state4.input.slice(0, -1), + // omit trailing \0 + position: state4.position, + line: state4.line, + column: state4.position - state4.lineStart + }; + mark.snippet = snippet(mark); + return new exception(message, mark); } - function computeLinkBreadths({ nodes: nodes2 }) { - for (const node2 of nodes2) { - let y0 = node2.y0; - let y1 = y0; - for (const link2 of node2.sourceLinks) { - link2.y0 = y0 + link2.width / 2; - y0 += link2.width; - } - for (const link2 of node2.targetLinks) { - link2.y1 = y1 + link2.width / 2; - y1 += link2.width; - } - } + __name(generateError, "generateError"); + function throwError(state4, message) { + throw generateError(state4, message); } - function Sankey() { - let x0 = 0, y0 = 0, x1 = 1, y1 = 1; - let dx = 24; - let dy = 8, py; - let id2 = defaultId; - let align = justify; - let sort2; - let linkSort; - let nodes2 = defaultNodes; - let links2 = defaultLinks; - let iterations = 6; - function sankey2() { - const graph = { nodes: nodes2.apply(null, arguments), links: links2.apply(null, arguments) }; - computeNodeLinks(graph); - computeNodeValues(graph); - computeNodeDepths(graph); - computeNodeHeights(graph); - computeNodeBreadths(graph); - computeLinkBreadths(graph); - return graph; + __name(throwError, "throwError"); + function throwWarning(state4, message) { + if (state4.onWarning) { + state4.onWarning.call(null, generateError(state4, message)); } - sankey2.update = function(graph) { - computeLinkBreadths(graph); - return graph; - }; - sankey2.nodeId = function(_2) { - return arguments.length ? (id2 = typeof _2 === "function" ? _2 : constant$1(_2), sankey2) : id2; - }; - sankey2.nodeAlign = function(_2) { - return arguments.length ? (align = typeof _2 === "function" ? _2 : constant$1(_2), sankey2) : align; - }; - sankey2.nodeSort = function(_2) { - return arguments.length ? (sort2 = _2, sankey2) : sort2; - }; - sankey2.nodeWidth = function(_2) { - return arguments.length ? (dx = +_2, sankey2) : dx; - }; - sankey2.nodePadding = function(_2) { - return arguments.length ? (dy = py = +_2, sankey2) : dy; - }; - sankey2.nodes = function(_2) { - return arguments.length ? (nodes2 = typeof _2 === "function" ? _2 : constant$1(_2), sankey2) : nodes2; - }; - sankey2.links = function(_2) { - return arguments.length ? (links2 = typeof _2 === "function" ? _2 : constant$1(_2), sankey2) : links2; - }; - sankey2.linkSort = function(_2) { - return arguments.length ? (linkSort = _2, sankey2) : linkSort; - }; - sankey2.size = function(_2) { - return arguments.length ? (x0 = y0 = 0, x1 = +_2[0], y1 = +_2[1], sankey2) : [x1 - x0, y1 - y0]; - }; - sankey2.extent = function(_2) { - return arguments.length ? (x0 = +_2[0][0], x1 = +_2[1][0], y0 = +_2[0][1], y1 = +_2[1][1], sankey2) : [[x0, y0], [x1, y1]]; - }; - sankey2.iterations = function(_2) { - return arguments.length ? (iterations = +_2, sankey2) : iterations; - }; - function computeNodeLinks({ nodes: nodes3, links: links3 }) { - for (const [i2, node2] of nodes3.entries()) { - node2.index = i2; - node2.sourceLinks = []; - node2.targetLinks = []; + } + __name(throwWarning, "throwWarning"); + var directiveHandlers = { + YAML: /* @__PURE__ */ __name(function handleYamlDirective(state4, name, args) { + var match2, major, minor; + if (state4.version !== null) { + throwError(state4, "duplication of %YAML directive"); } - const nodeById = new Map(nodes3.map((d, i2) => [id2(d, i2, nodes3), d])); - for (const [i2, link2] of links3.entries()) { - link2.index = i2; - let { source, target } = link2; - if (typeof source !== "object") - source = link2.source = find(nodeById, source); - if (typeof target !== "object") - target = link2.target = find(nodeById, target); - source.sourceLinks.push(link2); - target.targetLinks.push(link2); + if (args.length !== 1) { + throwError(state4, "YAML directive accepts exactly one argument"); } - if (linkSort != null) { - for (const { sourceLinks, targetLinks } of nodes3) { - sourceLinks.sort(linkSort); - targetLinks.sort(linkSort); - } + match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match2 === null) { + throwError(state4, "ill-formed argument of the YAML directive"); } - } - function computeNodeValues({ nodes: nodes3 }) { - for (const node2 of nodes3) { - node2.value = node2.fixedValue === void 0 ? Math.max(sum(node2.sourceLinks, value), sum(node2.targetLinks, value)) : node2.fixedValue; + major = parseInt(match2[1], 10); + minor = parseInt(match2[2], 10); + if (major !== 1) { + throwError(state4, "unacceptable YAML version of the document"); } - } - function computeNodeDepths({ nodes: nodes3 }) { - const n = nodes3.length; - let current = new Set(nodes3); - let next2 = /* @__PURE__ */ new Set(); - let x2 = 0; - while (current.size) { - for (const node2 of current) { - node2.depth = x2; - for (const { target } of node2.sourceLinks) { - next2.add(target); - } - } - if (++x2 > n) - throw new Error("circular link"); - current = next2; - next2 = /* @__PURE__ */ new Set(); + state4.version = args[0]; + state4.checkLineBreaks = minor < 2; + if (minor !== 1 && minor !== 2) { + throwWarning(state4, "unsupported YAML version of the document"); } - } - function computeNodeHeights({ nodes: nodes3 }) { - const n = nodes3.length; - let current = new Set(nodes3); - let next2 = /* @__PURE__ */ new Set(); - let x2 = 0; - while (current.size) { - for (const node2 of current) { - node2.height = x2; - for (const { source } of node2.targetLinks) { - next2.add(source); + }, "handleYamlDirective"), + TAG: /* @__PURE__ */ __name(function handleTagDirective(state4, name, args) { + var handle, prefix; + if (args.length !== 2) { + throwError(state4, "TAG directive accepts exactly two arguments"); + } + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state4, "ill-formed tag handle (first argument) of the TAG directive"); + } + if (_hasOwnProperty$1.call(state4.tagMap, handle)) { + throwError(state4, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state4, "ill-formed tag prefix (second argument) of the TAG directive"); + } + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state4, "tag prefix is malformed: " + prefix); + } + state4.tagMap[handle] = prefix; + }, "handleTagDirective") + }; + function captureSegment(state4, start3, end2, checkJson) { + var _position, _length, _character, _result; + if (start3 < end2) { + _result = state4.input.slice(start3, end2); + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { + throwError(state4, "expected valid JSON character"); } } - if (++x2 > n) - throw new Error("circular link"); - current = next2; - next2 = /* @__PURE__ */ new Set(); + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state4, "the stream contains non-printable characters"); } + state4.result += _result; } - function computeNodeLayers({ nodes: nodes3 }) { - const x2 = max(nodes3, (d) => d.depth) + 1; - const kx = (x1 - x0 - dx) / (x2 - 1); - const columns = new Array(x2); - for (const node2 of nodes3) { - const i2 = Math.max(0, Math.min(x2 - 1, Math.floor(align.call(null, node2, x2)))); - node2.layer = i2; - node2.x0 = x0 + i2 * kx; - node2.x1 = node2.x0 + dx; - if (columns[i2]) - columns[i2].push(node2); - else - columns[i2] = [node2]; + } + __name(captureSegment, "captureSegment"); + function mergeMappings(state4, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + if (!common.isObject(source)) { + throwError(state4, "cannot merge mappings; the provided source object is unacceptable"); + } + sourceKeys = Object.keys(source); + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + if (!_hasOwnProperty$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; } - if (sort2) - for (const column2 of columns) { - column2.sort(sort2); - } - return columns; } - function initializeNodeBreadths(columns) { - const ky = min(columns, (c2) => (y1 - y0 - (c2.length - 1) * py) / sum(c2, value)); - for (const nodes3 of columns) { - let y2 = y0; - for (const node2 of nodes3) { - node2.y0 = y2; - node2.y1 = y2 + node2.value * ky; - y2 = node2.y1 + py; - for (const link2 of node2.sourceLinks) { - link2.width = link2.value * ky; - } + } + __name(mergeMappings, "mergeMappings"); + function storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { + var index, quantity; + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state4, "nested arrays are not supported inside keys"); } - y2 = (y1 - y2 + py) / (nodes3.length + 1); - for (let i2 = 0; i2 < nodes3.length; ++i2) { - const node2 = nodes3[i2]; - node2.y0 += y2 * (i2 + 1); - node2.y1 += y2 * (i2 + 1); + if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") { + keyNode[index] = "[object Object]"; } - reorderLinks(nodes3); } } - function computeNodeBreadths(graph) { - const columns = computeNodeLayers(graph); - py = Math.min(dy, (y1 - y0) / (max(columns, (c2) => c2.length) - 1)); - initializeNodeBreadths(columns); - for (let i2 = 0; i2 < iterations; ++i2) { - const alpha = Math.pow(0.99, i2); - const beta = Math.max(1 - alpha, (i2 + 1) / iterations); - relaxRightToLeft(columns, alpha, beta); - relaxLeftToRight(columns, alpha, beta); - } + if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") { + keyNode = "[object Object]"; } - function relaxLeftToRight(columns, alpha, beta) { - for (let i2 = 1, n = columns.length; i2 < n; ++i2) { - const column2 = columns[i2]; - for (const target of column2) { - let y2 = 0; - let w2 = 0; - for (const { source, value: value2 } of target.targetLinks) { - let v = value2 * (target.layer - source.layer); - y2 += targetTop(source, target) * v; - w2 += v; - } - if (!(w2 > 0)) - continue; - let dy2 = (y2 / w2 - target.y0) * alpha; - target.y0 += dy2; - target.y1 += dy2; - reorderNodeLinks(target); - } - if (sort2 === void 0) - column2.sort(ascendingBreadth); - resolveCollisions(column2, beta); - } + keyNode = String(keyNode); + if (_result === null) { + _result = {}; } - function relaxRightToLeft(columns, alpha, beta) { - for (let n = columns.length, i2 = n - 2; i2 >= 0; --i2) { - const column2 = columns[i2]; - for (const source of column2) { - let y2 = 0; - let w2 = 0; - for (const { target, value: value2 } of source.sourceLinks) { - let v = value2 * (target.layer - source.layer); - y2 += sourceTop(source, target) * v; - w2 += v; - } - if (!(w2 > 0)) - continue; - let dy2 = (y2 / w2 - source.y0) * alpha; - source.y0 += dy2; - source.y1 += dy2; - reorderNodeLinks(source); + if (keyTag === "tag:yaml.org,2002:merge") { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state4, _result, valueNode[index], overridableKeys); } - if (sort2 === void 0) - column2.sort(ascendingBreadth); - resolveCollisions(column2, beta); + } else { + mergeMappings(state4, _result, valueNode, overridableKeys); } - } - function resolveCollisions(nodes3, alpha) { - const i2 = nodes3.length >> 1; - const subject = nodes3[i2]; - resolveCollisionsBottomToTop(nodes3, subject.y0 - py, i2 - 1, alpha); - resolveCollisionsTopToBottom(nodes3, subject.y1 + py, i2 + 1, alpha); - resolveCollisionsBottomToTop(nodes3, y1, nodes3.length - 1, alpha); - resolveCollisionsTopToBottom(nodes3, y0, 0, alpha); - } - function resolveCollisionsTopToBottom(nodes3, y2, i2, alpha) { - for (; i2 < nodes3.length; ++i2) { - const node2 = nodes3[i2]; - const dy2 = (y2 - node2.y0) * alpha; - if (dy2 > 1e-6) - node2.y0 += dy2, node2.y1 += dy2; - y2 = node2.y1 + py; + } else { + if (!state4.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) { + state4.line = startLine || state4.line; + state4.lineStart = startLineStart || state4.lineStart; + state4.position = startPos || state4.position; + throwError(state4, "duplicated mapping key"); } - } - function resolveCollisionsBottomToTop(nodes3, y2, i2, alpha) { - for (; i2 >= 0; --i2) { - const node2 = nodes3[i2]; - const dy2 = (node2.y1 - y2) * alpha; - if (dy2 > 1e-6) - node2.y0 -= dy2, node2.y1 -= dy2; - y2 = node2.y0 - py; + if (keyNode === "__proto__") { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; } + delete overridableKeys[keyNode]; } - function reorderNodeLinks({ sourceLinks, targetLinks }) { - if (linkSort === void 0) { - for (const { source: { sourceLinks: sourceLinks2 } } of targetLinks) { - sourceLinks2.sort(ascendingTargetBreadth); - } - for (const { target: { targetLinks: targetLinks2 } } of sourceLinks) { - targetLinks2.sort(ascendingSourceBreadth); - } + return _result; + } + __name(storeMappingPair, "storeMappingPair"); + function readLineBreak(state4) { + var ch; + ch = state4.input.charCodeAt(state4.position); + if (ch === 10) { + state4.position++; + } else if (ch === 13) { + state4.position++; + if (state4.input.charCodeAt(state4.position) === 10) { + state4.position++; } + } else { + throwError(state4, "a line break is expected"); } - function reorderLinks(nodes3) { - if (linkSort === void 0) { - for (const { sourceLinks, targetLinks } of nodes3) { - sourceLinks.sort(ascendingTargetBreadth); - targetLinks.sort(ascendingSourceBreadth); + state4.line += 1; + state4.lineStart = state4.position; + state4.firstTabInLine = -1; + } + __name(readLineBreak, "readLineBreak"); + function skipSeparationSpace(state4, allowComments, checkIndent) { + var lineBreaks = 0, ch = state4.input.charCodeAt(state4.position); + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 9 && state4.firstTabInLine === -1) { + state4.firstTabInLine = state4.position; } + ch = state4.input.charCodeAt(++state4.position); } - } - function targetTop(source, target) { - let y2 = source.y0 - (source.sourceLinks.length - 1) * py / 2; - for (const { target: node2, width: width2 } of source.sourceLinks) { - if (node2 === target) - break; - y2 += width2 + py; + if (allowComments && ch === 35) { + do { + ch = state4.input.charCodeAt(++state4.position); + } while (ch !== 10 && ch !== 13 && ch !== 0); } - for (const { source: node2, width: width2 } of target.targetLinks) { - if (node2 === source) - break; - y2 -= width2; + if (is_EOL(ch)) { + readLineBreak(state4); + ch = state4.input.charCodeAt(state4.position); + lineBreaks++; + state4.lineIndent = 0; + while (ch === 32) { + state4.lineIndent++; + ch = state4.input.charCodeAt(++state4.position); + } + } else { + break; } - return y2; } - function sourceTop(source, target) { - let y2 = target.y0 - (target.targetLinks.length - 1) * py / 2; - for (const { source: node2, width: width2 } of target.targetLinks) { - if (node2 === source) - break; - y2 += width2 + py; - } - for (const { target: node2, width: width2 } of source.sourceLinks) { - if (node2 === target) - break; - y2 -= width2; - } - return y2; + if (checkIndent !== -1 && lineBreaks !== 0 && state4.lineIndent < checkIndent) { + throwWarning(state4, "deficient indentation"); } - return sankey2; + return lineBreaks; } - var pi = Math.PI, tau = 2 * pi, epsilon = 1e-6, tauEpsilon = tau - epsilon; - function Path() { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; - this._ = ""; + __name(skipSeparationSpace, "skipSeparationSpace"); + function testDocumentSeparator(state4) { + var _position = state4.position, ch; + ch = state4.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state4.input.charCodeAt(_position + 1) && ch === state4.input.charCodeAt(_position + 2)) { + _position += 3; + ch = state4.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + return false; } - function path() { - return new Path(); + __name(testDocumentSeparator, "testDocumentSeparator"); + function writeFoldedLines(state4, count) { + if (count === 1) { + state4.result += " "; + } else if (count > 1) { + state4.result += common.repeat("\n", count - 1); + } } - Path.prototype = path.prototype = { - constructor: Path, - moveTo: function(x2, y2) { - this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2); - }, - closePath: function() { - if (this._x1 !== null) { - this._x1 = this._x0, this._y1 = this._y0; - this._ += "Z"; + __name(writeFoldedLines, "writeFoldedLines"); + function readPlainScalar(state4, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state4.kind, _result = state4.result, ch; + ch = state4.input.charCodeAt(state4.position); + if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) { + return false; + } + if (ch === 63 || ch === 45) { + following = state4.input.charCodeAt(state4.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; } - }, - lineTo: function(x2, y2) { - this._ += "L" + (this._x1 = +x2) + "," + (this._y1 = +y2); - }, - quadraticCurveTo: function(x1, y1, x2, y2) { - this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x2) + "," + (this._y1 = +y2); - }, - bezierCurveTo: function(x1, y1, x2, y2, x3, y3) { - this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x3) + "," + (this._y1 = +y3); - }, - arcTo: function(x1, y1, x2, y2, r) { - x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; - var x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01; - if (r < 0) - throw new Error("negative radius: " + r); - if (this._x1 === null) { - this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); - } else if (!(l01_2 > epsilon)) - ; - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { - this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); - } else { - var x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21; - if (Math.abs(t01 - 1) > epsilon) { - this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); + } + state4.kind = "scalar"; + state4.result = ""; + captureStart = captureEnd = state4.position; + hasPendingContent = false; + while (ch !== 0) { + if (ch === 58) { + following = state4.input.charCodeAt(state4.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + } else if (ch === 35) { + preceding = state4.input.charCodeAt(state4.position - 1); + if (is_WS_OR_EOL(preceding)) { + break; + } + } else if (state4.position === state4.lineStart && testDocumentSeparator(state4) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + } else if (is_EOL(ch)) { + _line = state4.line; + _lineStart = state4.lineStart; + _lineIndent = state4.lineIndent; + skipSeparationSpace(state4, false, -1); + if (state4.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state4.input.charCodeAt(state4.position); + continue; + } else { + state4.position = captureEnd; + state4.line = _line; + state4.lineStart = _lineStart; + state4.lineIndent = _lineIndent; + break; } - this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); } - }, - arc: function(x2, y2, r, a0, a1, ccw) { - x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw; - var dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; - if (r < 0) - throw new Error("negative radius: " + r); - if (this._x1 === null) { - this._ += "M" + x0 + "," + y0; - } else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { - this._ += "L" + x0 + "," + y0; - } - if (!r) - return; - if (da < 0) - da = da % tau + tau; - if (da > tauEpsilon) { - this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x2 - dx) + "," + (y2 - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); - } else if (da > epsilon) { - this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x2 + r * Math.cos(a1)) + "," + (this._y1 = y2 + r * Math.sin(a1)); + if (hasPendingContent) { + captureSegment(state4, captureStart, captureEnd, false); + writeFoldedLines(state4, state4.line - _line); + captureStart = captureEnd = state4.position; + hasPendingContent = false; } - }, - rect: function(x2, y2, w2, h) { - this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2) + "h" + +w2 + "v" + +h + "h" + -w2 + "Z"; - }, - toString: function() { - return this._; + if (!is_WHITE_SPACE(ch)) { + captureEnd = state4.position + 1; + } + ch = state4.input.charCodeAt(++state4.position); } - }; - function constant(x2) { - return function constant2() { - return x2; - }; - } - function x(p) { - return p[0]; - } - function y(p) { - return p[1]; - } - var slice = Array.prototype.slice; - function linkSource(d) { - return d.source; - } - function linkTarget(d) { - return d.target; - } - function link(curve) { - var source = linkSource, target = linkTarget, x$12 = x, y$12 = y, context = null; - function link2() { - var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv); - if (!context) - context = buffer = path(); - curve(context, +x$12.apply(this, (argv[0] = s, argv)), +y$12.apply(this, argv), +x$12.apply(this, (argv[0] = t, argv)), +y$12.apply(this, argv)); - if (buffer) - return context = null, buffer + "" || null; + captureSegment(state4, captureStart, captureEnd, false); + if (state4.result) { + return true; } - link2.source = function(_2) { - return arguments.length ? (source = _2, link2) : source; - }; - link2.target = function(_2) { - return arguments.length ? (target = _2, link2) : target; - }; - link2.x = function(_2) { - return arguments.length ? (x$12 = typeof _2 === "function" ? _2 : constant(+_2), link2) : x$12; - }; - link2.y = function(_2) { - return arguments.length ? (y$12 = typeof _2 === "function" ? _2 : constant(+_2), link2) : y$12; - }; - link2.context = function(_2) { - return arguments.length ? (context = _2 == null ? null : _2, link2) : context; - }; - return link2; - } - function curveHorizontal(context, x0, y0, x1, y1) { - context.moveTo(x0, y0); - context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1); - } - function linkHorizontal() { - return link(curveHorizontal); - } - function horizontalSource(d) { - return [d.source.x1, d.y0]; - } - function horizontalTarget(d) { - return [d.target.x0, d.y1]; + state4.kind = _kind; + state4.result = _result; + return false; } - function d3SankeyLinkHorizontal() { - return linkHorizontal().source(horizontalSource).target(horizontalTarget); + __name(readPlainScalar, "readPlainScalar"); + function readSingleQuotedScalar(state4, nodeIndent) { + var ch, captureStart, captureEnd; + ch = state4.input.charCodeAt(state4.position); + if (ch !== 39) { + return false; + } + state4.kind = "scalar"; + state4.result = ""; + state4.position++; + captureStart = captureEnd = state4.position; + while ((ch = state4.input.charCodeAt(state4.position)) !== 0) { + if (ch === 39) { + captureSegment(state4, captureStart, state4.position, true); + ch = state4.input.charCodeAt(++state4.position); + if (ch === 39) { + captureStart = state4.position; + state4.position++; + captureEnd = state4.position; + } else { + return true; + } + } else if (is_EOL(ch)) { + captureSegment(state4, captureStart, captureEnd, true); + writeFoldedLines(state4, skipSeparationSpace(state4, false, nodeIndent)); + captureStart = captureEnd = state4.position; + } else if (state4.position === state4.lineStart && testDocumentSeparator(state4)) { + throwError(state4, "unexpected end of the document within a single quoted scalar"); + } else { + state4.position++; + captureEnd = state4.position; + } + } + throwError(state4, "unexpected end of the stream within a single quoted scalar"); } - const _Uid = class _Uid2 { - static next(name) { - return new _Uid2(name + ++_Uid2.count); + __name(readSingleQuotedScalar, "readSingleQuotedScalar"); + function readDoubleQuotedScalar(state4, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, ch; + ch = state4.input.charCodeAt(state4.position); + if (ch !== 34) { + return false; + } + state4.kind = "scalar"; + state4.result = ""; + state4.position++; + captureStart = captureEnd = state4.position; + while ((ch = state4.input.charCodeAt(state4.position)) !== 0) { + if (ch === 34) { + captureSegment(state4, captureStart, state4.position, true); + state4.position++; + return true; + } else if (ch === 92) { + captureSegment(state4, captureStart, state4.position, true); + ch = state4.input.charCodeAt(++state4.position); + if (is_EOL(ch)) { + skipSeparationSpace(state4, false, nodeIndent); + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state4.result += simpleEscapeMap[ch]; + state4.position++; + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state4.input.charCodeAt(++state4.position); + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + } else { + throwError(state4, "expected hexadecimal character"); + } + } + state4.result += charFromCodepoint(hexResult); + state4.position++; + } else { + throwError(state4, "unknown escape sequence"); + } + captureStart = captureEnd = state4.position; + } else if (is_EOL(ch)) { + captureSegment(state4, captureStart, captureEnd, true); + writeFoldedLines(state4, skipSeparationSpace(state4, false, nodeIndent)); + captureStart = captureEnd = state4.position; + } else if (state4.position === state4.lineStart && testDocumentSeparator(state4)) { + throwError(state4, "unexpected end of the document within a double quoted scalar"); + } else { + state4.position++; + captureEnd = state4.position; + } } - constructor(id2) { - this.id = id2; - this.href = `#${id2}`; + throwError(state4, "unexpected end of the stream within a double quoted scalar"); + } + __name(readDoubleQuotedScalar, "readDoubleQuotedScalar"); + function readFlowCollection(state4, nodeIndent) { + var readNext = true, _line, _lineStart, _pos, _tag2 = state4.tag, _result, _anchor = state4.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch; + ch = state4.input.charCodeAt(state4.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = []; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = {}; + } else { + return false; } - toString() { - return "url(" + this.href + ")"; + if (state4.anchor !== null) { + state4.anchorMap[state4.anchor] = _result; + } + ch = state4.input.charCodeAt(++state4.position); + while (ch !== 0) { + skipSeparationSpace(state4, true, nodeIndent); + ch = state4.input.charCodeAt(state4.position); + if (ch === terminator) { + state4.position++; + state4.tag = _tag2; + state4.anchor = _anchor; + state4.kind = isMapping ? "mapping" : "sequence"; + state4.result = _result; + return true; + } else if (!readNext) { + throwError(state4, "missed comma between flow collection entries"); + } else if (ch === 44) { + throwError(state4, "expected the node content, but found ','"); + } + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + if (ch === 63) { + following = state4.input.charCodeAt(state4.position + 1); + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state4.position++; + skipSeparationSpace(state4, true, nodeIndent); + } + } + _line = state4.line; + _lineStart = state4.lineStart; + _pos = state4.position; + composeNode(state4, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state4.tag; + keyNode = state4.result; + skipSeparationSpace(state4, true, nodeIndent); + ch = state4.input.charCodeAt(state4.position); + if ((isExplicitPair || state4.line === _line) && ch === 58) { + isPair = true; + ch = state4.input.charCodeAt(++state4.position); + skipSeparationSpace(state4, true, nodeIndent); + composeNode(state4, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state4.result; + } + if (isMapping) { + storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state4, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + skipSeparationSpace(state4, true, nodeIndent); + ch = state4.input.charCodeAt(state4.position); + if (ch === 44) { + readNext = true; + ch = state4.input.charCodeAt(++state4.position); + } else { + readNext = false; + } } - }; - _Uid.count = 0; - let Uid = _Uid; - const alignmentsMap = { - left, - right, - center, - justify - }; - const draw$1 = function(text2, id2, _version, diagObj) { - const { securityLevel, sankey: conf2 } = getConfig$1(); - const defaultSankeyConfig = defaultConfig.sankey; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = securityLevel === "sandbox" ? root2.select(`[id="${id2}"]`) : d3select(`[id="${id2}"]`); - const width2 = (conf2 == null ? void 0 : conf2.width) ?? defaultSankeyConfig.width; - const height = (conf2 == null ? void 0 : conf2.height) ?? defaultSankeyConfig.width; - const useMaxWidth = (conf2 == null ? void 0 : conf2.useMaxWidth) ?? defaultSankeyConfig.useMaxWidth; - const nodeAlignment = (conf2 == null ? void 0 : conf2.nodeAlignment) ?? defaultSankeyConfig.nodeAlignment; - const prefix = (conf2 == null ? void 0 : conf2.prefix) ?? defaultSankeyConfig.prefix; - const suffix = (conf2 == null ? void 0 : conf2.suffix) ?? defaultSankeyConfig.suffix; - const showValues = (conf2 == null ? void 0 : conf2.showValues) ?? defaultSankeyConfig.showValues; - const graph = diagObj.db.getGraph(); - const nodeAlign = alignmentsMap[nodeAlignment]; - const nodeWidth = 10; - const sankey2 = Sankey().nodeId((d) => d.id).nodeWidth(nodeWidth).nodePadding(10 + (showValues ? 15 : 0)).nodeAlign(nodeAlign).extent([ - [0, 0], - [width2, height] - ]); - sankey2(graph); - const colorScheme = ordinal(d3schemeTableau10); - svg2.append("g").attr("class", "nodes").selectAll(".node").data(graph.nodes).join("g").attr("class", "node").attr("id", (d) => (d.uid = Uid.next("node-")).id).attr("transform", function(d) { - return "translate(" + d.x0 + "," + d.y0 + ")"; - }).attr("x", (d) => d.x0).attr("y", (d) => d.y0).append("rect").attr("height", (d) => { - return d.y1 - d.y0; - }).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => colorScheme(d.id)); - const getText = ({ id: id22, value: value2 }) => { - if (!showValues) { - return id22; - } - return `${id22} -${prefix}${Math.round(value2 * 100) / 100}${suffix}`; - }; - svg2.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(graph.nodes).join("text").attr("x", (d) => d.x0 < width2 / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", `${showValues ? "0" : "0.35"}em`).attr("text-anchor", (d) => d.x0 < width2 / 2 ? "start" : "end").text(getText); - const link2 = svg2.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(graph.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"); - const linkColor = (conf2 == null ? void 0 : conf2.linkColor) || "gradient"; - if (linkColor === "gradient") { - const gradient = link2.append("linearGradient").attr("id", (d) => (d.uid = Uid.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (d) => d.source.x1).attr("x2", (d) => d.target.x0); - gradient.append("stop").attr("offset", "0%").attr("stop-color", (d) => colorScheme(d.source.id)); - gradient.append("stop").attr("offset", "100%").attr("stop-color", (d) => colorScheme(d.target.id)); - } - let coloring; - switch (linkColor) { - case "gradient": - coloring = (d) => d.uid; - break; - case "source": - coloring = (d) => colorScheme(d.source.id); - break; - case "target": - coloring = (d) => colorScheme(d.target.id); - break; - default: - coloring = linkColor; + throwError(state4, "unexpected end of the stream within a flow collection"); + } + __name(readFlowCollection, "readFlowCollection"); + function readBlockScalar(state4, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; + ch = state4.input.charCodeAt(state4.position); + if (ch === 124) { + folding = false; + } else if (ch === 62) { + folding = true; + } else { + return false; } - link2.append("path").attr("d", d3SankeyLinkHorizontal()).attr("stroke", coloring).attr("stroke-width", (d) => Math.max(1, d.width)); - setupGraphViewbox$1(void 0, svg2, 0, useMaxWidth); - }; - const renderer$1 = { - draw: draw$1 - }; - const prepareTextForParsing = (text2) => { - const textToParse = text2.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, "\n").trim(); - return textToParse; - }; - const originalParse = parser$3.parse.bind(parser$3); - parser$3.parse = (text2) => originalParse(prepareTextForParsing(text2)); - const diagram$1 = { - parser: parser$3, - db: db$2, - renderer: renderer$1 - }; - const sankeyDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram: diagram$1 - }, Symbol.toStringTag, { value: "Module" })); - var parser = function() { - var o = function(k, v, o2, l) { - for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) - ; - return o2; - }, $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49]; - var parser2 = { - trace: function trace() { - }, - yy: {}, - symbols_: { "error": 2, "spaceLines": 3, "SPACELINE": 4, "NL": 5, "separator": 6, "SPACE": 7, "EOF": 8, "start": 9, "BLOCK_DIAGRAM_KEY": 10, "document": 11, "stop": 12, "statement": 13, "link": 14, "LINK": 15, "START_LINK": 16, "LINK_LABEL": 17, "STR": 18, "nodeStatement": 19, "columnsStatement": 20, "SPACE_BLOCK": 21, "blockStatement": 22, "classDefStatement": 23, "cssClassStatement": 24, "styleStatement": 25, "node": 26, "SIZE": 27, "COLUMNS": 28, "id-block": 29, "end": 30, "block": 31, "NODE_ID": 32, "nodeShapeNLabel": 33, "dirList": 34, "DIR": 35, "NODE_DSTART": 36, "NODE_DEND": 37, "BLOCK_ARROW_START": 38, "BLOCK_ARROW_END": 39, "classDef": 40, "CLASSDEF_ID": 41, "CLASSDEF_STYLEOPTS": 42, "DEFAULT": 43, "class": 44, "CLASSENTITY_IDS": 45, "STYLECLASS": 46, "style": 47, "STYLE_ENTITY_IDS": 48, "STYLE_DEFINITION_DATA": 49, "$accept": 0, "$end": 1 }, - terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" }, - productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - var $0 = $$.length - 1; - switch (yystate) { - case 4: - yy.getLogger().debug("Rule: separator (NL) "); - break; - case 5: - yy.getLogger().debug("Rule: separator (Space) "); - break; - case 6: - yy.getLogger().debug("Rule: separator (EOF) "); - break; - case 7: - yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]); - yy.setHierarchy($$[$0 - 1]); - break; - case 8: - yy.getLogger().debug("Stop NL "); - break; - case 9: - yy.getLogger().debug("Stop EOF "); - break; - case 10: - yy.getLogger().debug("Stop NL2 "); - break; - case 11: - yy.getLogger().debug("Stop EOF2 "); - break; - case 12: - yy.getLogger().debug("Rule: statement: ", $$[$0]); - typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]]; - break; - case 13: - yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]); - this.$ = [$$[$0 - 1]].concat($$[$0]); - break; - case 14: - yy.getLogger().debug("Rule: link: ", $$[$0], yytext); - this.$ = { edgeTypeStr: $$[$0], label: "" }; - break; - case 15: - yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]); - this.$ = { edgeTypeStr: $$[$0], label: $$[$0 - 1] }; - break; - case 18: - const num = parseInt($$[$0]); - const spaceId = yy.generateId(); - this.$ = { id: spaceId, type: "space", label: "", width: num, children: [] }; - break; - case 23: - yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr); - const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr); - this.$ = [ - { id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions }, - { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" }, - { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions } - ]; - break; - case 24: - yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]); - this.$ = { id: $$[$0 - 1].id, label: $$[$0 - 1].label, type: yy.typeStr2Type($$[$0 - 1].typeStr), directions: $$[$0 - 1].directions, widthInColumns: parseInt($$[$0], 10) }; - break; - case 25: - yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]); - this.$ = { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions, widthInColumns: 1 }; - break; - case 26: - yy.getLogger().debug("APA123", this ? this : "na"); - yy.getLogger().debug("COLUMNS: ", $$[$0]); - this.$ = { type: "column-setting", columns: $$[$0] === "auto" ? -1 : parseInt($$[$0]) }; - break; - case 27: - yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]); - yy.generateId(); - this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] }; - break; - case 28: - yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]); - const id2 = yy.generateId(); - this.$ = { id: id2, type: "composite", label: "", children: $$[$0 - 1] }; - break; - case 29: - yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]); - this.$ = { id: $$[$0] }; - break; - case 30: - yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]); - this.$ = { id: $$[$0 - 1], label: $$[$0].label, typeStr: $$[$0].typeStr, directions: $$[$0].directions }; - break; - case 31: - yy.getLogger().debug("Rule: dirList: ", $$[$0]); - this.$ = [$$[$0]]; - break; - case 32: - yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]); - this.$ = [$$[$0 - 1]].concat($$[$0]); - break; - case 33: - yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]); - this.$ = { typeStr: $$[$0 - 2] + $$[$0], label: $$[$0 - 1] }; - break; - case 34: - yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]); - this.$ = { typeStr: $$[$0 - 3] + $$[$0], label: $$[$0 - 2], directions: $$[$0 - 1] }; - break; - case 35: - case 36: - this.$ = { type: "classDef", id: $$[$0 - 1].trim(), css: $$[$0].trim() }; - break; - case 37: - this.$ = { type: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() }; - break; - case 38: - this.$ = { type: "applyStyles", id: $$[$0 - 1].trim(), stylesStr: $$[$0].trim() }; - break; - } - }, - table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 8: [1, 20] }, o($V8, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: $V0, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }), o($V9, [2, 16], { 14: 22, 15: $Va, 16: $Vb }), o($V9, [2, 17]), o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), o($V9, [2, 21]), o($V9, [2, 22]), o($Vc, [2, 25], { 27: [1, 25] }), o($V9, [2, 26]), { 19: 26, 26: 12, 32: $V4 }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, o($Vd, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, o($V8, [2, 13]), { 26: 35, 32: $V4 }, { 32: [2, 14] }, { 17: [1, 36] }, o($Vc, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: $Va, 16: $Vb, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, o($Vd, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, o($Vc, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, o($V9, [2, 28]), o($V9, [2, 35]), o($V9, [2, 36]), o($V9, [2, 37]), o($V9, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: $Ve }, { 15: [1, 50] }, o($V9, [2, 27]), o($Vd, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: $Ve, 39: [2, 31] }, { 32: [2, 15] }, o($Vd, [2, 34]), { 39: [2, 32] }], - defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] }, - parseError: function parseError(str2, hash) { - if (hash.recoverable) { - this.trace(str2); + state4.kind = "scalar"; + state4.result = ""; + while (ch !== 0) { + ch = state4.input.charCodeAt(++state4.position); + if (ch === 43 || ch === 45) { + if (CHOMPING_CLIP === chomping) { + chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; } else { - var error = new Error(str2); - error.hash = hash; - throw error; + throwError(state4, "repeat of a chomping mode identifier"); } - }, - parse: function parse2(input) { - var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer2 = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer2.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer2; - sharedState.yy.parser = this; - if (typeof lexer2.yylloc == "undefined") { - lexer2.yylloc = {}; - } - var yyloc = lexer2.yylloc; - lstack.push(yyloc); - var ranges = lexer2.options && lexer2.options.ranges; - if (typeof sharedState.yy.parseError === "function") { - this.parseError = sharedState.yy.parseError; + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state4, "bad explicit indentation width of a block scalar; it cannot be less than one"); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; } else { - this.parseError = Object.getPrototypeOf(this).parseError; + throwError(state4, "repeat of an indentation width identifier"); } - function lex2() { - var token2; - token2 = tstack.pop() || lexer2.lex() || EOF; - if (typeof token2 !== "number") { - if (token2 instanceof Array) { - tstack = token2; - token2 = tstack.pop(); - } - token2 = self2.symbols_[token2] || token2; - } - return token2; - } - var symbol, state2, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state2 = stack[stack.length - 1]; - if (this.defaultActions[state2]) { - action = this.defaultActions[state2]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex2(); - } - action = table[state2] && table[state2][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - expected = []; - for (p in table[state2]) { - if (this.terminals_[p] && p > TERROR) { - expected.push("'" + this.terminals_[p] + "'"); - } - } - if (lexer2.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { - text: lexer2.match, - token: this.terminals_[symbol] || symbol, - line: lexer2.yylineno, - loc: yyloc, - expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer2.yytext); - lstack.push(lexer2.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer2.yyleng; - yytext = lexer2.yytext; - yylineno = lexer2.yylineno; - yyloc = lexer2.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + } else { + break; + } + } + if (is_WHITE_SPACE(ch)) { + do { + ch = state4.input.charCodeAt(++state4.position); + } while (is_WHITE_SPACE(ch)); + if (ch === 35) { + do { + ch = state4.input.charCodeAt(++state4.position); + } while (!is_EOL(ch) && ch !== 0); + } + } + while (ch !== 0) { + readLineBreak(state4); + state4.lineIndent = 0; + ch = state4.input.charCodeAt(state4.position); + while ((!detectedIndent || state4.lineIndent < textIndent) && ch === 32) { + state4.lineIndent++; + ch = state4.input.charCodeAt(++state4.position); + } + if (!detectedIndent && state4.lineIndent > textIndent) { + textIndent = state4.lineIndent; + } + if (is_EOL(ch)) { + emptyLines++; + continue; + } + if (state4.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP) { + state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { + state4.result += "\n"; } } - return true; + break; } - }; - var lexer = function() { - var lexer2 = { - EOF: 1, - parseError: function parseError(str2, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str2, hash); - } else { - throw new Error(str2); - } - }, - // resets the lexer, sets new input - setInput: function(input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0, 0]; - } - this.offset = 0; - return this; - }, - // consumes and returns one char from the input - input: function() { - var ch2 = this._input[0]; - this.yytext += ch2; - this.yyleng++; - this.offset++; - this.match += ch2; - this.matched += ch2; - var lines = ch2.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - this._input = this._input.slice(1); - return ch2; - }, - // unshifts one char (or a string) into the input - unput: function(ch2) { - var len = ch2.length; - var lines = ch2.split(/(?:\r\n?|\n)/g); - this._input = ch2 + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - this._more = true; - return this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - return this; - }, - // retain first n characters of the match - less: function(n) { - this.unput(this.match.slice(n)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var next2 = this.match; - if (next2.length < 20) { - next2 += this._input.substr(0, 20 - next2.length); - } - return (next2.substr(0, 20) + (next2.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var pre = this.pastInput(); - var c2 = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c2 + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(match, indexed_rule) { - var token2, lines, backup; - if (this.options.backtrack_lexer) { - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token2 = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token2) { - return token2; - } else if (this._backtrack) { - for (var k in backup) { - this[k] = backup[k]; - } - return false; - } - return false; - }, - // return next match in input - next: function() { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - var token2, match, tempMatch, index2; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i2 = 0; i2 < rules.length; i2++) { - tempMatch = this._input.match(this.rules[rules[i2]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index2 = i2; - if (this.options.backtrack_lexer) { - token2 = this.test_match(tempMatch, rules[i2]); - if (token2 !== false) { - return token2; - } else if (this._backtrack) { - match = false; - continue; - } else { - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token2 = this.test_match(match, rules[index2]); - if (token2 !== false) { - return token2; - } - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - // return next match that has a token - lex: function lex2() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - // pop the previously active lexer condition state off the condition stack - popState: function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - // alias for begin(condition) - pushState: function pushState(condition) { - this.begin(condition); - }, - // return the number of states currently on the stack - stateStackSize: function stateStackSize() { - return this.conditionStack.length; - }, - options: {}, - performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - switch ($avoiding_name_collisions) { - case 0: - return 10; - case 1: - yy.getLogger().debug("Found space-block"); - return 31; - case 2: - yy.getLogger().debug("Found nl-block"); - return 31; - case 3: - yy.getLogger().debug("Found space-block"); - return 29; - case 4: - yy.getLogger().debug(".", yy_.yytext); - break; - case 5: - yy.getLogger().debug("_", yy_.yytext); - break; - case 6: - return 5; - case 7: - yy_.yytext = -1; - return 28; - case 8: - yy_.yytext = yy_.yytext.replace(/columns\s+/, ""); - yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext); - return 28; - case 9: - this.pushState("md_string"); - break; - case 10: - return "MD_STR"; - case 11: - this.popState(); - break; - case 12: - this.pushState("string"); - break; - case 13: - yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext); - this.popState(); - break; - case 14: - yy.getLogger().debug("LEX: STR end:", yy_.yytext); - return "STR"; - case 15: - yy_.yytext = yy_.yytext.replace(/space\:/, ""); - yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext); - return 21; - case 16: - yy_.yytext = "1"; - yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext); - return 21; - case 17: - return 43; - case 18: - return "LINKSTYLE"; - case 19: - return "INTERPOLATE"; - case 20: - this.pushState("CLASSDEF"); - return 40; - case 21: - this.popState(); - this.pushState("CLASSDEFID"); - return "DEFAULT_CLASSDEF_ID"; - case 22: - this.popState(); - this.pushState("CLASSDEFID"); - return 41; - case 23: - this.popState(); - return 42; - case 24: - this.pushState("CLASS"); - return 44; - case 25: - this.popState(); - this.pushState("CLASS_STYLE"); - return 45; - case 26: - this.popState(); - return 46; - case 27: - this.pushState("STYLE_STMNT"); - return 47; - case 28: - this.popState(); - this.pushState("STYLE_DEFINITION"); - return 48; - case 29: - this.popState(); - return 49; - case 30: - this.pushState("acc_title"); - return "acc_title"; - case 31: - this.popState(); - return "acc_title_value"; - case 32: - this.pushState("acc_descr"); - return "acc_descr"; - case 33: - this.popState(); - return "acc_descr_value"; - case 34: - this.pushState("acc_descr_multiline"); - break; - case 35: - this.popState(); - break; - case 36: - return "acc_descr_multiline_value"; - case 37: - return 30; - case 38: - this.popState(); - yy.getLogger().debug("Lex: (("); - return "NODE_DEND"; - case 39: - this.popState(); - yy.getLogger().debug("Lex: (("); - return "NODE_DEND"; - case 40: - this.popState(); - yy.getLogger().debug("Lex: ))"); - return "NODE_DEND"; - case 41: - this.popState(); - yy.getLogger().debug("Lex: (("); - return "NODE_DEND"; - case 42: - this.popState(); - yy.getLogger().debug("Lex: (("); - return "NODE_DEND"; - case 43: - this.popState(); - yy.getLogger().debug("Lex: (-"); - return "NODE_DEND"; - case 44: - this.popState(); - yy.getLogger().debug("Lex: -)"); - return "NODE_DEND"; - case 45: - this.popState(); - yy.getLogger().debug("Lex: (("); - return "NODE_DEND"; - case 46: - this.popState(); - yy.getLogger().debug("Lex: ]]"); - return "NODE_DEND"; - case 47: - this.popState(); - yy.getLogger().debug("Lex: ("); - return "NODE_DEND"; - case 48: - this.popState(); - yy.getLogger().debug("Lex: ])"); - return "NODE_DEND"; - case 49: - this.popState(); - yy.getLogger().debug("Lex: /]"); - return "NODE_DEND"; - case 50: - this.popState(); - yy.getLogger().debug("Lex: /]"); - return "NODE_DEND"; - case 51: - this.popState(); - yy.getLogger().debug("Lex: )]"); - return "NODE_DEND"; - case 52: - this.popState(); - yy.getLogger().debug("Lex: )"); - return "NODE_DEND"; - case 53: - this.popState(); - yy.getLogger().debug("Lex: ]>"); - return "NODE_DEND"; - case 54: - this.popState(); - yy.getLogger().debug("Lex: ]"); - return "NODE_DEND"; - case 55: - yy.getLogger().debug("Lexa: -)"); - this.pushState("NODE"); - return 36; - case 56: - yy.getLogger().debug("Lexa: (-"); - this.pushState("NODE"); - return 36; - case 57: - yy.getLogger().debug("Lexa: ))"); - this.pushState("NODE"); - return 36; - case 58: - yy.getLogger().debug("Lexa: )"); - this.pushState("NODE"); - return 36; - case 59: - yy.getLogger().debug("Lex: ((("); - this.pushState("NODE"); - return 36; - case 60: - yy.getLogger().debug("Lexa: )"); - this.pushState("NODE"); - return 36; - case 61: - yy.getLogger().debug("Lexa: )"); - this.pushState("NODE"); - return 36; - case 62: - yy.getLogger().debug("Lexa: )"); - this.pushState("NODE"); - return 36; - case 63: - yy.getLogger().debug("Lexc: >"); - this.pushState("NODE"); - return 36; - case 64: - yy.getLogger().debug("Lexa: (["); - this.pushState("NODE"); - return 36; - case 65: - yy.getLogger().debug("Lexa: )"); - this.pushState("NODE"); - return 36; - case 66: - this.pushState("NODE"); - return 36; - case 67: - this.pushState("NODE"); - return 36; - case 68: - this.pushState("NODE"); - return 36; - case 69: - this.pushState("NODE"); - return 36; - case 70: - this.pushState("NODE"); - return 36; - case 71: - this.pushState("NODE"); - return 36; - case 72: - this.pushState("NODE"); - return 36; - case 73: - yy.getLogger().debug("Lexa: ["); - this.pushState("NODE"); - return 36; - case 74: - this.pushState("BLOCK_ARROW"); - yy.getLogger().debug("LEX ARR START"); - return 38; - case 75: - yy.getLogger().debug("Lex: NODE_ID", yy_.yytext); - return 32; - case 76: - yy.getLogger().debug("Lex: EOF", yy_.yytext); - return 8; - case 77: - this.pushState("md_string"); - break; - case 78: - this.pushState("md_string"); - break; - case 79: - return "NODE_DESCR"; - case 80: - this.popState(); - break; - case 81: - yy.getLogger().debug("Lex: Starting string"); - this.pushState("string"); - break; - case 82: - yy.getLogger().debug("LEX ARR: Starting string"); - this.pushState("string"); - break; - case 83: - yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext); - return "NODE_DESCR"; - case 84: - yy.getLogger().debug("LEX POPPING"); - this.popState(); - break; - case 85: - yy.getLogger().debug("Lex: =>BAE"); - this.pushState("ARROW_DIR"); - break; - case 86: - yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); - yy.getLogger().debug("Lex (right): dir:", yy_.yytext); - return "DIR"; - case 87: - yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); - yy.getLogger().debug("Lex (left):", yy_.yytext); - return "DIR"; - case 88: - yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); - yy.getLogger().debug("Lex (x):", yy_.yytext); - return "DIR"; - case 89: - yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); - yy.getLogger().debug("Lex (y):", yy_.yytext); - return "DIR"; - case 90: - yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); - yy.getLogger().debug("Lex (up):", yy_.yytext); - return "DIR"; - case 91: - yy_.yytext = yy_.yytext.replace(/^,\s*/, ""); - yy.getLogger().debug("Lex (down):", yy_.yytext); - return "DIR"; - case 92: - yy_.yytext = "]>"; - yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext); - this.popState(); - this.popState(); - return "BLOCK_ARROW_END"; - case 93: - yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#"); - return 15; - case 94: - yy.getLogger().debug("Lex: LINK", yy_.yytext); - return 15; - case 95: - yy.getLogger().debug("Lex: LINK", yy_.yytext); - return 15; - case 96: - yy.getLogger().debug("Lex: LINK", yy_.yytext); - return 15; - case 97: - yy.getLogger().debug("Lex: START_LINK", yy_.yytext); - this.pushState("LLABEL"); - return 16; - case 98: - yy.getLogger().debug("Lex: START_LINK", yy_.yytext); - this.pushState("LLABEL"); - return 16; - case 99: - yy.getLogger().debug("Lex: START_LINK", yy_.yytext); - this.pushState("LLABEL"); - return 16; - case 100: - this.pushState("md_string"); - break; - case 101: - yy.getLogger().debug("Lex: Starting string"); - this.pushState("string"); - return "LINK_LABEL"; - case 102: - this.popState(); - yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#"); - return 15; - case 103: - this.popState(); - yy.getLogger().debug("Lex: LINK", yy_.yytext); - return 15; - case 104: - this.popState(); - yy.getLogger().debug("Lex: LINK", yy_.yytext); - return 15; - case 105: - yy.getLogger().debug("Lex: COLON", yy_.yytext); - yy_.yytext = yy_.yytext.slice(1); - return 27; + if (folding) { + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (atMoreIndented) { + atMoreIndented = false; + state4.result += common.repeat("\n", emptyLines + 1); + } else if (emptyLines === 0) { + if (didReadContent) { + state4.result += " "; } - }, - rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/], - conditions: { "STYLE_DEFINITION": { "rules": [29], "inclusive": false }, "STYLE_STMNT": { "rules": [28], "inclusive": false }, "CLASSDEFID": { "rules": [23], "inclusive": false }, "CLASSDEF": { "rules": [21, 22], "inclusive": false }, "CLASS_STYLE": { "rules": [26], "inclusive": false }, "CLASS": { "rules": [25], "inclusive": false }, "LLABEL": { "rules": [100, 101, 102, 103, 104], "inclusive": false }, "ARROW_DIR": { "rules": [86, 87, 88, 89, 90, 91, 92], "inclusive": false }, "BLOCK_ARROW": { "rules": [77, 82, 85], "inclusive": false }, "NODE": { "rules": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], "inclusive": false }, "md_string": { "rules": [10, 11, 79, 80], "inclusive": false }, "space": { "rules": [], "inclusive": false }, "string": { "rules": [13, 14, 83, 84], "inclusive": false }, "acc_descr_multiline": { "rules": [35, 36], "inclusive": false }, "acc_descr": { "rules": [33], "inclusive": false }, "acc_title": { "rules": [31], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], "inclusive": true } } - }; - return lexer2; - }(); - parser2.lexer = lexer; - function Parser2() { - this.yy = {}; - } - Parser2.prototype = parser2; - parser2.Parser = Parser2; - return new Parser2(); - }(); - parser.parser = parser; - const parser$1 = parser; - let blockDatabase = {}; - let edgeList = []; - let edgeCount = {}; - const COLOR_KEYWORD = "color"; - const FILL_KEYWORD = "fill"; - const BG_FILL = "bgFill"; - const STYLECLASS_SEP = ","; - const config = getConfig$1(); - let classes = {}; - const sanitizeText = (txt) => common$1.sanitizeText(txt, config); - const addStyleClass = function(id2, styleAttributes = "") { - if (classes[id2] === void 0) { - classes[id2] = { id: id2, styles: [], textStyles: [] }; - } - const foundClass = classes[id2]; - if (styleAttributes !== void 0 && styleAttributes !== null) { - styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => { - const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim(); - if (attrib.match(COLOR_KEYWORD)) { - const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL); - const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD); - foundClass.textStyles.push(newStyle2); - } - foundClass.styles.push(fixedAttrib); - }); + } else { + state4.result += common.repeat("\n", emptyLines); + } + } else { + state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state4.position; + while (!is_EOL(ch) && ch !== 0) { + ch = state4.input.charCodeAt(++state4.position); + } + captureSegment(state4, captureStart, state4.position, false); } - }; - const addStyle2Node = function(id2, styles2 = "") { - const foundBlock = blockDatabase[id2]; - if (styles2 !== void 0 && styles2 !== null) { - foundBlock.styles = styles2.split(STYLECLASS_SEP); + return true; + } + __name(readBlockScalar, "readBlockScalar"); + function readBlockSequence(state4, nodeIndent) { + var _line, _tag2 = state4.tag, _anchor = state4.anchor, _result = [], following, detected = false, ch; + if (state4.firstTabInLine !== -1) return false; + if (state4.anchor !== null) { + state4.anchorMap[state4.anchor] = _result; } - }; - const setCssClass = function(itemIds, cssClassName) { - itemIds.split(",").forEach(function(id2) { - let foundBlock = blockDatabase[id2]; - if (foundBlock === void 0) { - const trimmedId = id2.trim(); - blockDatabase[trimmedId] = { id: trimmedId, type: "na", children: [] }; - foundBlock = blockDatabase[trimmedId]; - } - if (!foundBlock.classes) { - foundBlock.classes = []; - } - foundBlock.classes.push(cssClassName); - }); - }; - const populateBlockDatabase = (_blockList, parent) => { - const blockList = _blockList.flat(); - const children2 = []; - for (const block2 of blockList) { - if (block2.label) { - block2.label = sanitizeText(block2.label); - } - if (block2.type === "classDef") { - addStyleClass(block2.id, block2.css); - continue; + ch = state4.input.charCodeAt(state4.position); + while (ch !== 0) { + if (state4.firstTabInLine !== -1) { + state4.position = state4.firstTabInLine; + throwError(state4, "tab characters must not be used in indentation"); } - if (block2.type === "applyClass") { - setCssClass(block2.id, (block2 == null ? void 0 : block2.styleClass) || ""); - continue; + if (ch !== 45) { + break; } - if (block2.type === "applyStyles") { - if (block2 == null ? void 0 : block2.stylesStr) { - addStyle2Node(block2.id, block2 == null ? void 0 : block2.stylesStr); + following = state4.input.charCodeAt(state4.position + 1); + if (!is_WS_OR_EOL(following)) { + break; + } + detected = true; + state4.position++; + if (skipSeparationSpace(state4, true, -1)) { + if (state4.lineIndent <= nodeIndent) { + _result.push(null); + ch = state4.input.charCodeAt(state4.position); + continue; } - continue; } - if (block2.type === "column-setting") { - parent.columns = block2.columns || -1; - } else if (block2.type === "edge") { - if (edgeCount[block2.id]) { - edgeCount[block2.id]++; + _line = state4.line; + composeNode(state4, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state4.result); + skipSeparationSpace(state4, true, -1); + ch = state4.input.charCodeAt(state4.position); + if ((state4.line === _line || state4.lineIndent > nodeIndent) && ch !== 0) { + throwError(state4, "bad indentation of a sequence entry"); + } else if (state4.lineIndent < nodeIndent) { + break; + } + } + if (detected) { + state4.tag = _tag2; + state4.anchor = _anchor; + state4.kind = "sequence"; + state4.result = _result; + return true; + } + return false; + } + __name(readBlockSequence, "readBlockSequence"); + function readBlockMapping(state4, nodeIndent, flowIndent) { + var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag2 = state4.tag, _anchor = state4.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state4.firstTabInLine !== -1) return false; + if (state4.anchor !== null) { + state4.anchorMap[state4.anchor] = _result; + } + ch = state4.input.charCodeAt(state4.position); + while (ch !== 0) { + if (!atExplicitKey && state4.firstTabInLine !== -1) { + state4.position = state4.firstTabInLine; + throwError(state4, "tab characters must not be used in indentation"); + } + following = state4.input.charCodeAt(state4.position + 1); + _line = state4.line; + if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { + if (ch === 63) { + if (atExplicitKey) { + storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = true; + allowCompact = true; + } else if (atExplicitKey) { + atExplicitKey = false; + allowCompact = true; } else { - edgeCount[block2.id] = 1; + throwError(state4, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); } - block2.id = edgeCount[block2.id] + "-" + block2.id; - edgeList.push(block2); + state4.position += 1; + ch = following; } else { - if (!block2.label) { - if (block2.type === "composite") { - block2.label = ""; - } else { - block2.label = block2.id; - } + _keyLine = state4.line; + _keyLineStart = state4.lineStart; + _keyPos = state4.position; + if (!composeNode(state4, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + break; } - const newBlock = !blockDatabase[block2.id]; - if (newBlock) { - blockDatabase[block2.id] = block2; - } else { - if (block2.type !== "na") { - blockDatabase[block2.id].type = block2.type; + if (state4.line === _line) { + ch = state4.input.charCodeAt(state4.position); + while (is_WHITE_SPACE(ch)) { + ch = state4.input.charCodeAt(++state4.position); } - if (block2.label !== block2.id) { - blockDatabase[block2.id].label = block2.label; + if (ch === 58) { + ch = state4.input.charCodeAt(++state4.position); + if (!is_WS_OR_EOL(ch)) { + throwError(state4, "a whitespace character is expected after the key-value separator within a block mapping"); + } + if (atExplicitKey) { + storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state4.tag; + keyNode = state4.result; + } else if (detected) { + throwError(state4, "can not read an implicit mapping pair; a colon is missed"); + } else { + state4.tag = _tag2; + state4.anchor = _anchor; + return true; } + } else if (detected) { + throwError(state4, "can not read a block mapping entry; a multiline key may not be an implicit key"); + } else { + state4.tag = _tag2; + state4.anchor = _anchor; + return true; } - if (block2.children) { - populateBlockDatabase(block2.children, block2); + } + if (state4.line === _line || state4.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state4.line; + _keyLineStart = state4.lineStart; + _keyPos = state4.position; } - if (block2.type === "space") { - const w2 = block2.width || 1; - for (let j = 0; j < w2; j++) { - const newBlock2 = clone$1(block2); - newBlock2.id = newBlock2.id + "-" + j; - blockDatabase[newBlock2.id] = newBlock2; - children2.push(newBlock2); + if (composeNode(state4, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state4.result; + } else { + valueNode = state4.result; } - } else if (newBlock) { - children2.push(block2); } + if (!atExplicitKey) { + storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace(state4, true, -1); + ch = state4.input.charCodeAt(state4.position); + } + if ((state4.line === _line || state4.lineIndent > nodeIndent) && ch !== 0) { + throwError(state4, "bad indentation of a mapping entry"); + } else if (state4.lineIndent < nodeIndent) { + break; } } - parent.children = children2; - }; - let blocks = []; - let rootBlock = { id: "root", type: "composite", children: [], columns: -1 }; - const clear = () => { - log$1.debug("Clear called"); - clear$n(); - rootBlock = { id: "root", type: "composite", children: [], columns: -1 }; - blockDatabase = { root: rootBlock }; - blocks = []; - classes = {}; - edgeList = []; - edgeCount = {}; - }; - function typeStr2Type(typeStr) { - log$1.debug("typeStr2Type", typeStr); - switch (typeStr) { - case "[]": - return "square"; - case "()": - log$1.debug("we have a round"); - return "round"; - case "(())": - return "circle"; - case ">]": - return "rect_left_inv_arrow"; - case "{}": - return "diamond"; - case "{{}}": - return "hexagon"; - case "([])": - return "stadium"; - case "[[]]": - return "subroutine"; - case "[()]": - return "cylinder"; - case "((()))": - return "doublecircle"; - case "[//]": - return "lean_right"; - case "[\\\\]": - return "lean_left"; - case "[/\\]": - return "trapezoid"; - case "[\\/]": - return "inv_trapezoid"; - case "<[]>": - return "block_arrow"; - default: - return "na"; + if (atExplicitKey) { + storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); } - } - function edgeTypeStr2Type(typeStr) { - log$1.debug("typeStr2Type", typeStr); - switch (typeStr) { - case "==": - return "thick"; - default: - return "normal"; + if (detected) { + state4.tag = _tag2; + state4.anchor = _anchor; + state4.kind = "mapping"; + state4.result = _result; } + return detected; } - function edgeStrToEdgeData(typeStr) { - switch (typeStr.trim()) { - case "--x": - return "arrow_cross"; - case "--o": - return "arrow_circle"; - default: - return "arrow_point"; + __name(readBlockMapping, "readBlockMapping"); + function readTagProperty(state4) { + var _position, isVerbatim = false, isNamed2 = false, tagHandle, tagName, ch; + ch = state4.input.charCodeAt(state4.position); + if (ch !== 33) return false; + if (state4.tag !== null) { + throwError(state4, "duplication of a tag property"); } - } - let cnt = 0; - const generateId = () => { - cnt++; - return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt; - }; - const setHierarchy = (block2) => { - rootBlock.children = block2; - populateBlockDatabase(block2, rootBlock); - blocks = rootBlock.children; - }; - const getColumns = (blockId) => { - const block2 = blockDatabase[blockId]; - if (!block2) { - return -1; + ch = state4.input.charCodeAt(++state4.position); + if (ch === 60) { + isVerbatim = true; + ch = state4.input.charCodeAt(++state4.position); + } else if (ch === 33) { + isNamed2 = true; + tagHandle = "!!"; + ch = state4.input.charCodeAt(++state4.position); + } else { + tagHandle = "!"; + } + _position = state4.position; + if (isVerbatim) { + do { + ch = state4.input.charCodeAt(++state4.position); + } while (ch !== 0 && ch !== 62); + if (state4.position < state4.length) { + tagName = state4.input.slice(_position, state4.position); + ch = state4.input.charCodeAt(++state4.position); + } else { + throwError(state4, "unexpected end of the stream within a verbatim tag"); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + if (ch === 33) { + if (!isNamed2) { + tagHandle = state4.input.slice(_position - 1, state4.position + 1); + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state4, "named tag handle cannot contain such characters"); + } + isNamed2 = true; + _position = state4.position + 1; + } else { + throwError(state4, "tag suffix cannot contain exclamation marks"); + } + } + ch = state4.input.charCodeAt(++state4.position); + } + tagName = state4.input.slice(_position, state4.position); + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state4, "tag suffix cannot contain flow indicator characters"); + } } - if (block2.columns) { - return block2.columns; + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state4, "tag name cannot contain such characters: " + tagName); } - if (!block2.children) { - return -1; + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state4, "tag name is malformed: " + tagName); } - return block2.children.length; - }; - const getBlocksFlat = () => { - return [...Object.values(blockDatabase)]; - }; - const getBlocks = () => { - return blocks || []; - }; - const getEdges = () => { - return edgeList; - }; - const getBlock = (id2) => { - return blockDatabase[id2]; - }; - const setBlock = (block2) => { - blockDatabase[block2.id] = block2; - }; - const getLogger = () => console; - const getClasses$1 = function() { - return classes; - }; - const db = { - getConfig: () => getConfig$2().block, - typeStr2Type, - edgeTypeStr2Type, - edgeStrToEdgeData, - getLogger, - getBlocksFlat, - getBlocks, - getEdges, - setHierarchy, - getBlock, - setBlock, - getColumns, - getClasses: getClasses$1, - clear, - generateId - }; - const db$1 = db; - const fade = (color2, opacity) => { - const channel2 = channel$1; - const r = channel2(color2, "r"); - const g = channel2(color2, "g"); - const b = channel2(color2, "b"); - return rgba$1(r, g, b, opacity); - }; - const getStyles = (options2) => `.label { - font-family: ${options2.fontFamily}; - color: ${options2.nodeTextColor || options2.textColor}; - } - .cluster-label text { - fill: ${options2.titleColor}; - } - .cluster-label span,p { - color: ${options2.titleColor}; - } - - - - .label text,span,p { - fill: ${options2.nodeTextColor || options2.textColor}; - color: ${options2.nodeTextColor || options2.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${options2.mainBkg}; - stroke: ${options2.nodeBorder}; - stroke-width: 1px; - } - .flowchart-label text { - text-anchor: middle; - } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${options2.arrowheadColor}; - } - - .edgePath .path { - stroke: ${options2.lineColor}; - stroke-width: 2.0px; - } - - .flowchart-link { - stroke: ${options2.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${options2.edgeLabelBackground}; - rect { - opacity: 0.5; - background-color: ${options2.edgeLabelBackground}; - fill: ${options2.edgeLabelBackground}; + if (isVerbatim) { + state4.tag = tagName; + } else if (_hasOwnProperty$1.call(state4.tagMap, tagHandle)) { + state4.tag = state4.tagMap[tagHandle] + tagName; + } else if (tagHandle === "!") { + state4.tag = "!" + tagName; + } else if (tagHandle === "!!") { + state4.tag = "tag:yaml.org,2002:" + tagName; + } else { + throwError(state4, 'undeclared tag handle "' + tagHandle + '"'); } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${fade(options2.edgeLabelBackground, 0.5)}; - // background-color: - } - - .node .cluster { - // fill: ${fade(options2.mainBkg, 0.5)}; - fill: ${fade(options2.clusterBkg, 0.5)}; - stroke: ${fade(options2.clusterBorder, 0.2)}; - box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; - stroke-width: 1px; - } - - .cluster text { - fill: ${options2.titleColor}; - } - - .cluster span,p { - color: ${options2.titleColor}; + return true; } - /* .cluster div { - color: ${options2.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${options2.fontFamily}; - font-size: 12px; - background: ${options2.tertiaryColor}; - border: 1px solid ${options2.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; + __name(readTagProperty, "readTagProperty"); + function readAnchorProperty(state4) { + var _position, ch; + ch = state4.input.charCodeAt(state4.position); + if (ch !== 38) return false; + if (state4.anchor !== null) { + throwError(state4, "duplication of an anchor property"); + } + ch = state4.input.charCodeAt(++state4.position); + _position = state4.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state4.input.charCodeAt(++state4.position); + } + if (state4.position === _position) { + throwError(state4, "name of an anchor node must contain at least one character"); + } + state4.anchor = state4.input.slice(_position, state4.position); + return true; } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${options2.textColor}; + __name(readAnchorProperty, "readAnchorProperty"); + function readAlias(state4) { + var _position, alias, ch; + ch = state4.input.charCodeAt(state4.position); + if (ch !== 42) return false; + ch = state4.input.charCodeAt(++state4.position); + _position = state4.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state4.input.charCodeAt(++state4.position); + } + if (state4.position === _position) { + throwError(state4, "name of an alias node must contain at least one character"); + } + alias = state4.input.slice(_position, state4.position); + if (!_hasOwnProperty$1.call(state4.anchorMap, alias)) { + throwError(state4, 'unidentified alias "' + alias + '"'); + } + state4.result = state4.anchorMap[alias]; + skipSeparationSpace(state4, true, -1); + return true; } -`; - const flowStyles = getStyles; - function getNodeFromBlock(block2, db2, positioned = false) { - var _a2, _b2, _c; - const vertex = block2; - let classStr = "default"; - if ((((_a2 = vertex == null ? void 0 : vertex.classes) == null ? void 0 : _a2.length) || 0) > 0) { - classStr = ((vertex == null ? void 0 : vertex.classes) || []).join(" "); + __name(readAlias, "readAlias"); + function composeNode(state4, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent; + if (state4.listener !== null) { + state4.listener("open", state4); } - classStr = classStr + " flowchart-label"; - let radius = 0; - let shape = ""; - let padding2; - switch (vertex.type) { - case "round": - radius = 5; - shape = "rect"; - break; - case "composite": - radius = 0; - shape = "composite"; - padding2 = 0; - break; - case "square": - shape = "rect"; - break; - case "diamond": - shape = "question"; - break; - case "hexagon": - shape = "hexagon"; - break; - case "block_arrow": - shape = "block_arrow"; - break; - case "odd": - shape = "rect_left_inv_arrow"; - break; - case "lean_right": - shape = "lean_right"; - break; - case "lean_left": - shape = "lean_left"; - break; - case "trapezoid": - shape = "trapezoid"; - break; - case "inv_trapezoid": - shape = "inv_trapezoid"; - break; - case "rect_left_inv_arrow": - shape = "rect_left_inv_arrow"; - break; - case "circle": - shape = "circle"; - break; - case "ellipse": - shape = "ellipse"; - break; - case "stadium": - shape = "stadium"; - break; - case "subroutine": - shape = "subroutine"; - break; - case "cylinder": - shape = "cylinder"; - break; - case "group": - shape = "rect"; - break; - case "doublecircle": - shape = "doublecircle"; + state4.tag = null; + state4.anchor = null; + state4.kind = null; + state4.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace(state4, true, -1)) { + atNewLine = true; + if (state4.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state4.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state4.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + if (indentStatus === 1) { + while (readTagProperty(state4) || readAnchorProperty(state4)) { + if (skipSeparationSpace(state4, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state4.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state4.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state4.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + blockIndent = state4.position - state4.lineStart; + if (indentStatus === 1) { + if (allowBlockCollections && (readBlockSequence(state4, blockIndent) || readBlockMapping(state4, blockIndent, flowIndent)) || readFlowCollection(state4, flowIndent)) { + hasContent = true; + } else { + if (allowBlockScalars && readBlockScalar(state4, flowIndent) || readSingleQuotedScalar(state4, flowIndent) || readDoubleQuotedScalar(state4, flowIndent)) { + hasContent = true; + } else if (readAlias(state4)) { + hasContent = true; + if (state4.tag !== null || state4.anchor !== null) { + throwError(state4, "alias node should not have any properties"); + } + } else if (readPlainScalar(state4, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + if (state4.tag === null) { + state4.tag = "?"; + } + } + if (state4.anchor !== null) { + state4.anchorMap[state4.anchor] = state4.result; + } + } + } else if (indentStatus === 0) { + hasContent = allowBlockCollections && readBlockSequence(state4, blockIndent); + } + } + if (state4.tag === null) { + if (state4.anchor !== null) { + state4.anchorMap[state4.anchor] = state4.result; + } + } else if (state4.tag === "?") { + if (state4.result !== null && state4.kind !== "scalar") { + throwError(state4, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state4.kind + '"'); + } + for (typeIndex = 0, typeQuantity = state4.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type3 = state4.implicitTypes[typeIndex]; + if (type3.resolve(state4.result)) { + state4.result = type3.construct(state4.result); + state4.tag = type3.tag; + if (state4.anchor !== null) { + state4.anchorMap[state4.anchor] = state4.result; + } + break; + } + } + } else if (state4.tag !== "!") { + if (_hasOwnProperty$1.call(state4.typeMap[state4.kind || "fallback"], state4.tag)) { + type3 = state4.typeMap[state4.kind || "fallback"][state4.tag]; + } else { + type3 = null; + typeList = state4.typeMap.multi[state4.kind || "fallback"]; + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state4.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type3 = typeList[typeIndex]; + break; + } + } + } + if (!type3) { + throwError(state4, "unknown tag !<" + state4.tag + ">"); + } + if (state4.result !== null && type3.kind !== state4.kind) { + throwError(state4, "unacceptable node kind for !<" + state4.tag + '> tag; it should be "' + type3.kind + '", not "' + state4.kind + '"'); + } + if (!type3.resolve(state4.result, state4.tag)) { + throwError(state4, "cannot resolve a node with !<" + state4.tag + "> explicit tag"); + } else { + state4.result = type3.construct(state4.result, state4.tag); + if (state4.anchor !== null) { + state4.anchorMap[state4.anchor] = state4.result; + } + } + } + if (state4.listener !== null) { + state4.listener("close", state4); + } + return state4.tag !== null || state4.anchor !== null || hasContent; + } + __name(composeNode, "composeNode"); + function readDocument(state4) { + var documentStart = state4.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state4.version = null; + state4.checkLineBreaks = state4.legacy; + state4.tagMap = /* @__PURE__ */ Object.create(null); + state4.anchorMap = /* @__PURE__ */ Object.create(null); + while ((ch = state4.input.charCodeAt(state4.position)) !== 0) { + skipSeparationSpace(state4, true, -1); + ch = state4.input.charCodeAt(state4.position); + if (state4.lineIndent > 0 || ch !== 37) { break; - default: - shape = "rect"; + } + hasDirectives = true; + ch = state4.input.charCodeAt(++state4.position); + _position = state4.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state4.input.charCodeAt(++state4.position); + } + directiveName = state4.input.slice(_position, state4.position); + directiveArgs = []; + if (directiveName.length < 1) { + throwError(state4, "directive name must not be less than one character in length"); + } + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state4.input.charCodeAt(++state4.position); + } + if (ch === 35) { + do { + ch = state4.input.charCodeAt(++state4.position); + } while (ch !== 0 && !is_EOL(ch)); + break; + } + if (is_EOL(ch)) break; + _position = state4.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state4.input.charCodeAt(++state4.position); + } + directiveArgs.push(state4.input.slice(_position, state4.position)); + } + if (ch !== 0) readLineBreak(state4); + if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state4, directiveName, directiveArgs); + } else { + throwWarning(state4, 'unknown document directive "' + directiveName + '"'); + } } - const styles2 = getStylesFromArray((vertex == null ? void 0 : vertex.styles) || []); - const vertexText = vertex.label; - const bounds2 = vertex.size || { width: 0, height: 0, x: 0, y: 0 }; - const node2 = { - labelStyle: styles2.labelStyle, - shape, - labelText: vertexText, - rx: radius, - ry: radius, - class: classStr, - style: styles2.style, - id: vertex.id, - directions: vertex.directions, - width: bounds2.width, - height: bounds2.height, - x: bounds2.x, - y: bounds2.y, - positioned, - intersect: void 0, - type: vertex.type, - padding: padding2 ?? (((_c = (_b2 = getConfig$2()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) || 0) - }; - return node2; - } - async function calculateBlockSize(elem, block2, db2) { - const node2 = getNodeFromBlock(block2, db2, false); - if (node2.type === "group") { + skipSeparationSpace(state4, true, -1); + if (state4.lineIndent === 0 && state4.input.charCodeAt(state4.position) === 45 && state4.input.charCodeAt(state4.position + 1) === 45 && state4.input.charCodeAt(state4.position + 2) === 45) { + state4.position += 3; + skipSeparationSpace(state4, true, -1); + } else if (hasDirectives) { + throwError(state4, "directives end mark is expected"); + } + composeNode(state4, state4.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state4, true, -1); + if (state4.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state4.input.slice(documentStart, state4.position))) { + throwWarning(state4, "non-ASCII line breaks are interpreted as content"); + } + state4.documents.push(state4.result); + if (state4.position === state4.lineStart && testDocumentSeparator(state4)) { + if (state4.input.charCodeAt(state4.position) === 46) { + state4.position += 3; + skipSeparationSpace(state4, true, -1); + } return; } - const nodeEl = await insertNode(elem, node2); - const boundingBox = nodeEl.node().getBBox(); - const obj = db2.getBlock(node2.id); - obj.size = { width: boundingBox.width, height: boundingBox.height, x: 0, y: 0, node: nodeEl }; - db2.setBlock(obj); - nodeEl.remove(); - } - async function insertBlockPositioned(elem, block2, db2) { - const node2 = getNodeFromBlock(block2, db2, true); - const obj = db2.getBlock(node2.id); - if (obj.type !== "space") { - await insertNode(elem, node2); - block2.intersect = node2 == null ? void 0 : node2.intersect; - positionNode$1(node2); + if (state4.position < state4.length - 1) { + throwError(state4, "end of the stream or a document separator is expected"); + } else { + return; } } - async function performOperations(elem, blocks2, db2, operation) { - for (const block2 of blocks2) { - await operation(elem, block2, db2); - if (block2.children) { - await performOperations(elem, block2.children, db2, operation); + __name(readDocument, "readDocument"); + function loadDocuments(input, options3) { + input = String(input); + options3 = options3 || {}; + if (input.length !== 0) { + if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) { + input += "\n"; + } + if (input.charCodeAt(0) === 65279) { + input = input.slice(1); } } + var state4 = new State$1(input, options3); + var nullpos = input.indexOf("\0"); + if (nullpos !== -1) { + state4.position = nullpos; + throwError(state4, "null byte is not allowed in input"); + } + state4.input += "\0"; + while (state4.input.charCodeAt(state4.position) === 32) { + state4.lineIndent += 1; + state4.position += 1; + } + while (state4.position < state4.length - 1) { + readDocument(state4); + } + return state4.documents; } - async function calculateBlockSizes(elem, blocks2, db2) { - await performOperations(elem, blocks2, db2, calculateBlockSize); + __name(loadDocuments, "loadDocuments"); + function loadAll$1(input, iterator, options3) { + if (iterator !== null && typeof iterator === "object" && typeof options3 === "undefined") { + options3 = iterator; + iterator = null; + } + var documents2 = loadDocuments(input, options3); + if (typeof iterator !== "function") { + return documents2; + } + for (var index = 0, length2 = documents2.length; index < length2; index += 1) { + iterator(documents2[index]); + } } - async function insertBlocks(elem, blocks2, db2) { - await performOperations(elem, blocks2, db2, insertBlockPositioned); + __name(loadAll$1, "loadAll$1"); + function load$1(input, options3) { + var documents2 = loadDocuments(input, options3); + if (documents2.length === 0) { + return void 0; + } else if (documents2.length === 1) { + return documents2[0]; + } + throw new exception("expected a single document in the stream, but found more"); } - async function insertEdges(elem, edges2, blocks2, db2, id2) { - const g = new Graph({ - multigraph: true, - compound: true - }); - g.setGraph({ - rankdir: "TB", - nodesep: 10, - ranksep: 10, - marginx: 8, - marginy: 8 - }); - for (const block2 of blocks2) { - if (block2.size) { - g.setNode(block2.id, { - width: block2.size.width, - height: block2.size.height, - intersect: block2.intersect - }); + __name(load$1, "load$1"); + var loadAll_1 = loadAll$1; + var load_1 = load$1; + var loader24 = { + loadAll: loadAll_1, + load: load_1 + }; + var _toString = Object.prototype.toString; + var _hasOwnProperty = Object.prototype.hasOwnProperty; + var CHAR_BOM = 65279; + var CHAR_TAB = 9; + var CHAR_LINE_FEED = 10; + var CHAR_CARRIAGE_RETURN = 13; + var CHAR_SPACE = 32; + var CHAR_EXCLAMATION = 33; + var CHAR_DOUBLE_QUOTE = 34; + var CHAR_SHARP = 35; + var CHAR_PERCENT = 37; + var CHAR_AMPERSAND = 38; + var CHAR_SINGLE_QUOTE = 39; + var CHAR_ASTERISK = 42; + var CHAR_COMMA = 44; + var CHAR_MINUS = 45; + var CHAR_COLON = 58; + var CHAR_EQUALS = 61; + var CHAR_GREATER_THAN = 62; + var CHAR_QUESTION = 63; + var CHAR_COMMERCIAL_AT = 64; + var CHAR_LEFT_SQUARE_BRACKET = 91; + var CHAR_RIGHT_SQUARE_BRACKET = 93; + var CHAR_GRAVE_ACCENT = 96; + var CHAR_LEFT_CURLY_BRACKET = 123; + var CHAR_VERTICAL_LINE = 124; + var CHAR_RIGHT_CURLY_BRACKET = 125; + var ESCAPE_SEQUENCES = {}; + ESCAPE_SEQUENCES[0] = "\\0"; + ESCAPE_SEQUENCES[7] = "\\a"; + ESCAPE_SEQUENCES[8] = "\\b"; + ESCAPE_SEQUENCES[9] = "\\t"; + ESCAPE_SEQUENCES[10] = "\\n"; + ESCAPE_SEQUENCES[11] = "\\v"; + ESCAPE_SEQUENCES[12] = "\\f"; + ESCAPE_SEQUENCES[13] = "\\r"; + ESCAPE_SEQUENCES[27] = "\\e"; + ESCAPE_SEQUENCES[34] = '\\"'; + ESCAPE_SEQUENCES[92] = "\\\\"; + ESCAPE_SEQUENCES[133] = "\\N"; + ESCAPE_SEQUENCES[160] = "\\_"; + ESCAPE_SEQUENCES[8232] = "\\L"; + ESCAPE_SEQUENCES[8233] = "\\P"; + var DEPRECATED_BOOLEANS_SYNTAX = [ + "y", + "Y", + "yes", + "Yes", + "YES", + "on", + "On", + "ON", + "n", + "N", + "no", + "No", + "NO", + "off", + "Off", + "OFF" + ]; + var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + function compileStyleMap(schema2, map5) { + var result, keys3, index, length2, tag2, style3, type3; + if (map5 === null) return {}; + result = {}; + keys3 = Object.keys(map5); + for (index = 0, length2 = keys3.length; index < length2; index += 1) { + tag2 = keys3[index]; + style3 = String(map5[tag2]); + if (tag2.slice(0, 2) === "!!") { + tag2 = "tag:yaml.org,2002:" + tag2.slice(2); + } + type3 = schema2.compiledTypeMap["fallback"][tag2]; + if (type3 && _hasOwnProperty.call(type3.styleAliases, style3)) { + style3 = type3.styleAliases[style3]; + } + result[tag2] = style3; + } + return result; + } + __name(compileStyleMap, "compileStyleMap"); + function encodeHex(character2) { + var string3, handle, length2; + string3 = character2.toString(16).toUpperCase(); + if (character2 <= 255) { + handle = "x"; + length2 = 2; + } else if (character2 <= 65535) { + handle = "u"; + length2 = 4; + } else if (character2 <= 4294967295) { + handle = "U"; + length2 = 8; + } else { + throw new exception("code point within a string may not be greater than 0xFFFFFFFF"); + } + return "\\" + handle + common.repeat("0", length2 - string3.length) + string3; + } + __name(encodeHex, "encodeHex"); + var QUOTING_TYPE_SINGLE = 1; + var QUOTING_TYPE_DOUBLE = 2; + function State(options3) { + this.schema = options3["schema"] || _default; + this.indent = Math.max(1, options3["indent"] || 2); + this.noArrayIndent = options3["noArrayIndent"] || false; + this.skipInvalid = options3["skipInvalid"] || false; + this.flowLevel = common.isNothing(options3["flowLevel"]) ? -1 : options3["flowLevel"]; + this.styleMap = compileStyleMap(this.schema, options3["styles"] || null); + this.sortKeys = options3["sortKeys"] || false; + this.lineWidth = options3["lineWidth"] || 80; + this.noRefs = options3["noRefs"] || false; + this.noCompatMode = options3["noCompatMode"] || false; + this.condenseFlow = options3["condenseFlow"] || false; + this.quotingType = options3["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options3["forceQuotes"] || false; + this.replacer = typeof options3["replacer"] === "function" ? options3["replacer"] : null; + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + this.tag = null; + this.result = ""; + this.duplicates = []; + this.usedDuplicates = null; + } + __name(State, "State"); + function indentString(string3, spaces) { + var ind = common.repeat(" ", spaces), position5 = 0, next3 = -1, result = "", line2, length2 = string3.length; + while (position5 < length2) { + next3 = string3.indexOf("\n", position5); + if (next3 === -1) { + line2 = string3.slice(position5); + position5 = length2; + } else { + line2 = string3.slice(position5, next3 + 1); + position5 = next3 + 1; } + if (line2.length && line2 !== "\n") result += ind; + result += line2; } - for (const edge of edges2) { - if (edge.start && edge.end) { - const startBlock = db2.getBlock(edge.start); - const endBlock = db2.getBlock(edge.end); - if ((startBlock == null ? void 0 : startBlock.size) && (endBlock == null ? void 0 : endBlock.size)) { - const start2 = startBlock.size; - const end2 = endBlock.size; - const points = [ - { x: start2.x, y: start2.y }, - { x: start2.x + (end2.x - start2.x) / 2, y: start2.y + (end2.y - start2.y) / 2 }, - { x: end2.x, y: end2.y } - ]; - await insertEdge$1( - elem, - { v: edge.start, w: edge.end, name: edge.id }, - { - ...edge, - arrowTypeEnd: edge.arrowTypeEnd, - arrowTypeStart: edge.arrowTypeStart, - points, - classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1" - }, - void 0, - "block", - g, - id2 - ); - if (edge.label) { - await insertEdgeLabel(elem, { - ...edge, - label: edge.label, - labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;", - arrowTypeEnd: edge.arrowTypeEnd, - arrowTypeStart: edge.arrowTypeStart, - points, - classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1" - }); - await positionEdgeLabel( - { ...edge, x: points[1].x, y: points[1].y }, - { - originalPath: points - } - ); - } - } + return result; + } + __name(indentString, "indentString"); + function generateNextLine(state4, level) { + return "\n" + common.repeat(" ", state4.indent * level); + } + __name(generateNextLine, "generateNextLine"); + function testImplicitResolving(state4, str2) { + var index, length2, type3; + for (index = 0, length2 = state4.implicitTypes.length; index < length2; index += 1) { + type3 = state4.implicitTypes[index]; + if (type3.resolve(str2)) { + return true; } } + return false; } - const padding = ((_b = (_a = getConfig$1()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) || 8; - function calculateBlockPosition(columns, position2) { - if (columns === 0 || !Number.isInteger(columns)) { - throw new Error("Columns must be an integer !== 0."); + __name(testImplicitResolving, "testImplicitResolving"); + function isWhitespace2(c3) { + return c3 === CHAR_SPACE || c3 === CHAR_TAB; + } + __name(isWhitespace2, "isWhitespace"); + function isPrintable(c3) { + return 32 <= c3 && c3 <= 126 || 161 <= c3 && c3 <= 55295 && c3 !== 8232 && c3 !== 8233 || 57344 <= c3 && c3 <= 65533 && c3 !== CHAR_BOM || 65536 <= c3 && c3 <= 1114111; + } + __name(isPrintable, "isPrintable"); + function isNsCharOrWhitespace(c3) { + return isPrintable(c3) && c3 !== CHAR_BOM && c3 !== CHAR_CARRIAGE_RETURN && c3 !== CHAR_LINE_FEED; + } + __name(isNsCharOrWhitespace, "isNsCharOrWhitespace"); + function isPlainSafe(c3, prev2, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c3); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace2(c3); + return ( + // ns-plain-safe + (inblock ? ( + // c = flow-in + cIsNsCharOrWhitespace + ) : cIsNsCharOrWhitespace && c3 !== CHAR_COMMA && c3 !== CHAR_LEFT_SQUARE_BRACKET && c3 !== CHAR_RIGHT_SQUARE_BRACKET && c3 !== CHAR_LEFT_CURLY_BRACKET && c3 !== CHAR_RIGHT_CURLY_BRACKET) && c3 !== CHAR_SHARP && !(prev2 === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev2) && !isWhitespace2(prev2) && c3 === CHAR_SHARP || prev2 === CHAR_COLON && cIsNsChar + ); + } + __name(isPlainSafe, "isPlainSafe"); + function isPlainSafeFirst(c3) { + return isPrintable(c3) && c3 !== CHAR_BOM && !isWhitespace2(c3) && c3 !== CHAR_MINUS && c3 !== CHAR_QUESTION && c3 !== CHAR_COLON && c3 !== CHAR_COMMA && c3 !== CHAR_LEFT_SQUARE_BRACKET && c3 !== CHAR_RIGHT_SQUARE_BRACKET && c3 !== CHAR_LEFT_CURLY_BRACKET && c3 !== CHAR_RIGHT_CURLY_BRACKET && c3 !== CHAR_SHARP && c3 !== CHAR_AMPERSAND && c3 !== CHAR_ASTERISK && c3 !== CHAR_EXCLAMATION && c3 !== CHAR_VERTICAL_LINE && c3 !== CHAR_EQUALS && c3 !== CHAR_GREATER_THAN && c3 !== CHAR_SINGLE_QUOTE && c3 !== CHAR_DOUBLE_QUOTE && c3 !== CHAR_PERCENT && c3 !== CHAR_COMMERCIAL_AT && c3 !== CHAR_GRAVE_ACCENT; + } + __name(isPlainSafeFirst, "isPlainSafeFirst"); + function isPlainSafeLast(c3) { + return !isWhitespace2(c3) && c3 !== CHAR_COLON; + } + __name(isPlainSafeLast, "isPlainSafeLast"); + function codePointAt(string3, pos) { + var first3 = string3.charCodeAt(pos), second2; + if (first3 >= 55296 && first3 <= 56319 && pos + 1 < string3.length) { + second2 = string3.charCodeAt(pos + 1); + if (second2 >= 56320 && second2 <= 57343) { + return (first3 - 55296) * 1024 + second2 - 56320 + 65536; + } + } + return first3; + } + __name(codePointAt, "codePointAt"); + function needIndentIndicator(string3) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string3); + } + __name(needIndentIndicator, "needIndentIndicator"); + var STYLE_PLAIN = 1; + var STYLE_SINGLE = 2; + var STYLE_LITERAL = 3; + var STYLE_FOLDED = 4; + var STYLE_DOUBLE = 5; + function chooseScalarStyle(string3, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) { + var i2; + var char2 = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; + var plain = isPlainSafeFirst(codePointAt(string3, 0)) && isPlainSafeLast(codePointAt(string3, string3.length - 1)); + if (singleLineOnly || forceQuotes) { + for (i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) { + char2 = codePointAt(string3, i2); + if (!isPrintable(char2)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char2, prevChar, inblock); + prevChar = char2; + } + } else { + for (i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) { + char2 = codePointAt(string3, i2); + if (char2 === CHAR_LINE_FEED) { + hasLineBreak = true; + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. + i2 - previousLineBreak - 1 > lineWidth && string3[previousLineBreak + 1] !== " "; + previousLineBreak = i2; + } + } else if (!isPrintable(char2)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char2, prevChar, inblock); + prevChar = char2; + } + hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i2 - previousLineBreak - 1 > lineWidth && string3[previousLineBreak + 1] !== " "); + } + if (!hasLineBreak && !hasFoldableLine) { + if (plain && !forceQuotes && !testAmbiguousType(string3)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + if (indentPerLevel > 9 && needIndentIndicator(string3)) { + return STYLE_DOUBLE; + } + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + __name(chooseScalarStyle, "chooseScalarStyle"); + function writeScalar(state4, string3, level, iskey, inblock) { + state4.dump = function() { + if (string3.length === 0) { + return state4.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state4.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string3) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string3)) { + return state4.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string3 + '"' : "'" + string3 + "'"; + } + } + var indent = state4.indent * Math.max(1, level); + var lineWidth = state4.lineWidth === -1 ? -1 : Math.max(Math.min(state4.lineWidth, 40), state4.lineWidth - indent); + var singleLineOnly = iskey || state4.flowLevel > -1 && level >= state4.flowLevel; + function testAmbiguity(string4) { + return testImplicitResolving(state4, string4); + } + __name(testAmbiguity, "testAmbiguity"); + switch (chooseScalarStyle( + string3, + singleLineOnly, + state4.indent, + lineWidth, + testAmbiguity, + state4.quotingType, + state4.forceQuotes && !iskey, + inblock + )) { + case STYLE_PLAIN: + return string3; + case STYLE_SINGLE: + return "'" + string3.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return "|" + blockHeader(string3, state4.indent) + dropEndingNewline(indentString(string3, indent)); + case STYLE_FOLDED: + return ">" + blockHeader(string3, state4.indent) + dropEndingNewline(indentString(foldString(string3, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string3) + '"'; + default: + throw new exception("impossible error: invalid scalar style"); + } + }(); + } + __name(writeScalar, "writeScalar"); + function blockHeader(string3, indentPerLevel) { + var indentIndicator = needIndentIndicator(string3) ? String(indentPerLevel) : ""; + var clip = string3[string3.length - 1] === "\n"; + var keep = clip && (string3[string3.length - 2] === "\n" || string3 === "\n"); + var chomp = keep ? "+" : clip ? "" : "-"; + return indentIndicator + chomp + "\n"; + } + __name(blockHeader, "blockHeader"); + function dropEndingNewline(string3) { + return string3[string3.length - 1] === "\n" ? string3.slice(0, -1) : string3; + } + __name(dropEndingNewline, "dropEndingNewline"); + function foldString(string3, width3) { + var lineRe = /(\n+)([^\n]*)/g; + var result = function() { + var nextLF = string3.indexOf("\n"); + nextLF = nextLF !== -1 ? nextLF : string3.length; + lineRe.lastIndex = nextLF; + return foldLine(string3.slice(0, nextLF), width3); + }(); + var prevMoreIndented = string3[0] === "\n" || string3[0] === " "; + var moreIndented; + var match2; + while (match2 = lineRe.exec(string3)) { + var prefix = match2[1], line2 = match2[2]; + moreIndented = line2[0] === " "; + result += prefix + (!prevMoreIndented && !moreIndented && line2 !== "" ? "\n" : "") + foldLine(line2, width3); + prevMoreIndented = moreIndented; } - if (position2 < 0 || !Number.isInteger(position2)) { - throw new Error("Position must be a non-negative integer." + position2); + return result; + } + __name(foldString, "foldString"); + function foldLine(line2, width3) { + if (line2 === "" || line2[0] === " ") return line2; + var breakRe = / [^ ]/g; + var match2; + var start3 = 0, end2, curr = 0, next3 = 0; + var result = ""; + while (match2 = breakRe.exec(line2)) { + next3 = match2.index; + if (next3 - start3 > width3) { + end2 = curr > start3 ? curr : next3; + result += "\n" + line2.slice(start3, end2); + start3 = end2 + 1; + } + curr = next3; + } + result += "\n"; + if (line2.length - start3 > width3 && curr > start3) { + result += line2.slice(start3, curr) + "\n" + line2.slice(curr + 1); + } else { + result += line2.slice(start3); + } + return result.slice(1); + } + __name(foldLine, "foldLine"); + function escapeString(string3) { + var result = ""; + var char2 = 0; + var escapeSeq; + for (var i2 = 0; i2 < string3.length; char2 >= 65536 ? i2 += 2 : i2++) { + char2 = codePointAt(string3, i2); + escapeSeq = ESCAPE_SEQUENCES[char2]; + if (!escapeSeq && isPrintable(char2)) { + result += string3[i2]; + if (char2 >= 65536) result += string3[i2 + 1]; + } else { + result += escapeSeq || encodeHex(char2); + } } - if (columns < 0) { - return { px: position2, py: 0 }; + return result; + } + __name(escapeString, "escapeString"); + function writeFlowSequence(state4, level, object3) { + var _result = "", _tag2 = state4.tag, index, length2, value2; + for (index = 0, length2 = object3.length; index < length2; index += 1) { + value2 = object3[index]; + if (state4.replacer) { + value2 = state4.replacer.call(object3, String(index), value2); + } + if (writeNode(state4, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state4, level, null, false, false)) { + if (_result !== "") _result += "," + (!state4.condenseFlow ? " " : ""); + _result += state4.dump; + } } - if (columns === 1) { - return { px: 0, py: position2 }; + state4.tag = _tag2; + state4.dump = "[" + _result + "]"; + } + __name(writeFlowSequence, "writeFlowSequence"); + function writeBlockSequence(state4, level, object3, compact2) { + var _result = "", _tag2 = state4.tag, index, length2, value2; + for (index = 0, length2 = object3.length; index < length2; index += 1) { + value2 = object3[index]; + if (state4.replacer) { + value2 = state4.replacer.call(object3, String(index), value2); + } + if (writeNode(state4, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state4, level + 1, null, true, true, false, true)) { + if (!compact2 || _result !== "") { + _result += generateNextLine(state4, level); + } + if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) { + _result += "-"; + } else { + _result += "- "; + } + _result += state4.dump; + } } - const px = position2 % columns; - const py = Math.floor(position2 / columns); - return { px, py }; + state4.tag = _tag2; + state4.dump = _result || "[]"; } - const getMaxChildSize = (block2) => { - let maxWidth = 0; - let maxHeight = 0; - for (const child of block2.children) { - const { width: width2, height, x: x2, y: y2 } = child.size || { width: 0, height: 0, x: 0, y: 0 }; - log$1.debug( - "getMaxChildSize abc95 child:", - child.id, - "width:", - width2, - "height:", - height, - "x:", - x2, - "y:", - y2, - child.type - ); - if (child.type === "space") { - continue; + __name(writeBlockSequence, "writeBlockSequence"); + function writeFlowMapping(state4, level, object3) { + var _result = "", _tag2 = state4.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, pairBuffer; + for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) { + pairBuffer = ""; + if (_result !== "") pairBuffer += ", "; + if (state4.condenseFlow) pairBuffer += '"'; + objectKey = objectKeyList[index]; + objectValue = object3[objectKey]; + if (state4.replacer) { + objectValue = state4.replacer.call(object3, objectKey, objectValue); } - if (width2 > maxWidth) { - maxWidth = width2 / (block2.widthInColumns || 1); + if (!writeNode(state4, level, objectKey, false, false)) { + continue; } - if (height > maxHeight) { - maxHeight = height; + if (state4.dump.length > 1024) pairBuffer += "? "; + pairBuffer += state4.dump + (state4.condenseFlow ? '"' : "") + ":" + (state4.condenseFlow ? "" : " "); + if (!writeNode(state4, level, objectValue, false, false)) { + continue; } - } - return { width: maxWidth, height: maxHeight }; - }; - function setBlockSizes(block2, db2, siblingWidth = 0, siblingHeight = 0) { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k; - log$1.debug( - "setBlockSizes abc95 (start)", - block2.id, - (_a2 = block2 == null ? void 0 : block2.size) == null ? void 0 : _a2.x, - "block width =", - block2 == null ? void 0 : block2.size, - "sieblingWidth", - siblingWidth - ); - if (!((_b2 = block2 == null ? void 0 : block2.size) == null ? void 0 : _b2.width)) { - block2.size = { - width: siblingWidth, - height: siblingHeight, - x: 0, - y: 0 - }; - } - let maxWidth = 0; - let maxHeight = 0; - if (((_c = block2.children) == null ? void 0 : _c.length) > 0) { - for (const child of block2.children) { - setBlockSizes(child, db2); + pairBuffer += state4.dump; + _result += pairBuffer; + } + state4.tag = _tag2; + state4.dump = "{" + _result + "}"; + } + __name(writeFlowMapping, "writeFlowMapping"); + function writeBlockMapping(state4, level, object3, compact2) { + var _result = "", _tag2 = state4.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, explicitPair, pairBuffer; + if (state4.sortKeys === true) { + objectKeyList.sort(); + } else if (typeof state4.sortKeys === "function") { + objectKeyList.sort(state4.sortKeys); + } else if (state4.sortKeys) { + throw new exception("sortKeys must be a boolean or a function"); + } + for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) { + pairBuffer = ""; + if (!compact2 || _result !== "") { + pairBuffer += generateNextLine(state4, level); + } + objectKey = objectKeyList[index]; + objectValue = object3[objectKey]; + if (state4.replacer) { + objectValue = state4.replacer.call(object3, objectKey, objectValue); + } + if (!writeNode(state4, level + 1, objectKey, true, true, true)) { + continue; } - const childSize = getMaxChildSize(block2); - maxWidth = childSize.width; - maxHeight = childSize.height; - log$1.debug("setBlockSizes abc95 maxWidth of", block2.id, ":s children is ", maxWidth, maxHeight); - for (const child of block2.children) { - if (child.size) { - log$1.debug( - `abc95 Setting size of children of ${block2.id} id=${child.id} ${maxWidth} ${maxHeight} ${child.size}` - ); - child.size.width = maxWidth * (child.widthInColumns || 1) + padding * ((child.widthInColumns || 1) - 1); - child.size.height = maxHeight; - child.size.x = 0; - child.size.y = 0; - log$1.debug( - `abc95 updating size of ${block2.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}` - ); + explicitPair = state4.tag !== null && state4.tag !== "?" || state4.dump && state4.dump.length > 1024; + if (explicitPair) { + if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) { + pairBuffer += "?"; + } else { + pairBuffer += "? "; } } - for (const child of block2.children) { - setBlockSizes(child, db2, maxWidth, maxHeight); + pairBuffer += state4.dump; + if (explicitPair) { + pairBuffer += generateNextLine(state4, level); } - const columns = block2.columns || -1; - let numItems = 0; - for (const child of block2.children) { - numItems += child.widthInColumns || 1; + if (!writeNode(state4, level + 1, objectValue, true, explicitPair)) { + continue; } - let xSize = block2.children.length; - if (columns > 0 && columns < numItems) { - xSize = columns; + if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) { + pairBuffer += ":"; + } else { + pairBuffer += ": "; + } + pairBuffer += state4.dump; + _result += pairBuffer; + } + state4.tag = _tag2; + state4.dump = _result || "{}"; + } + __name(writeBlockMapping, "writeBlockMapping"); + function detectType2(state4, object3, explicit) { + var _result, typeList, index, length2, type3, style3; + typeList = explicit ? state4.explicitTypes : state4.implicitTypes; + for (index = 0, length2 = typeList.length; index < length2; index += 1) { + type3 = typeList[index]; + if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object3 === "object" && object3 instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object3))) { + if (explicit) { + if (type3.multi && type3.representName) { + state4.tag = type3.representName(object3); + } else { + state4.tag = type3.tag; + } + } else { + state4.tag = "?"; + } + if (type3.represent) { + style3 = state4.styleMap[type3.tag] || type3.defaultStyle; + if (_toString.call(type3.represent) === "[object Function]") { + _result = type3.represent(object3, style3); + } else if (_hasOwnProperty.call(type3.represent, style3)) { + _result = type3.represent[style3](object3, style3); + } else { + throw new exception("!<" + type3.tag + '> tag resolver accepts not "' + style3 + '" style'); + } + state4.dump = _result; + } + return true; } - block2.widthInColumns || 1; - const ySize = Math.ceil(numItems / xSize); - let width2 = xSize * (maxWidth + padding) + padding; - let height = ySize * (maxHeight + padding) + padding; - if (width2 < siblingWidth) { - log$1.debug( - `Detected to small siebling: abc95 ${block2.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width2}` - ); - width2 = siblingWidth; - height = siblingHeight; - const childWidth = (siblingWidth - xSize * padding - padding) / xSize; - const childHeight = (siblingHeight - ySize * padding - padding) / ySize; - log$1.debug("Size indata abc88", block2.id, "childWidth", childWidth, "maxWidth", maxWidth); - log$1.debug("Size indata abc88", block2.id, "childHeight", childHeight, "maxHeight", maxHeight); - log$1.debug("Size indata abc88 xSize", xSize, "padding", padding); - for (const child of block2.children) { - if (child.size) { - child.size.width = childWidth; - child.size.height = childHeight; - child.size.x = 0; - child.size.y = 0; + } + return false; + } + __name(detectType2, "detectType"); + function writeNode(state4, level, object3, block3, compact2, iskey, isblockseq) { + state4.tag = null; + state4.dump = object3; + if (!detectType2(state4, object3, false)) { + detectType2(state4, object3, true); + } + var type3 = _toString.call(state4.dump); + var inblock = block3; + var tagStr; + if (block3) { + block3 = state4.flowLevel < 0 || state4.flowLevel > level; + } + var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate; + if (objectOrArray) { + duplicateIndex = state4.duplicates.indexOf(object3); + duplicate = duplicateIndex !== -1; + } + if (state4.tag !== null && state4.tag !== "?" || duplicate || state4.indent !== 2 && level > 0) { + compact2 = false; + } + if (duplicate && state4.usedDuplicates[duplicateIndex]) { + state4.dump = "*ref_" + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state4.usedDuplicates[duplicateIndex]) { + state4.usedDuplicates[duplicateIndex] = true; + } + if (type3 === "[object Object]") { + if (block3 && Object.keys(state4.dump).length !== 0) { + writeBlockMapping(state4, level, state4.dump, compact2); + if (duplicate) { + state4.dump = "&ref_" + duplicateIndex + state4.dump; + } + } else { + writeFlowMapping(state4, level, state4.dump); + if (duplicate) { + state4.dump = "&ref_" + duplicateIndex + " " + state4.dump; + } + } + } else if (type3 === "[object Array]") { + if (block3 && state4.dump.length !== 0) { + if (state4.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state4, level - 1, state4.dump, compact2); + } else { + writeBlockSequence(state4, level, state4.dump, compact2); } + if (duplicate) { + state4.dump = "&ref_" + duplicateIndex + state4.dump; + } + } else { + writeFlowSequence(state4, level, state4.dump); + if (duplicate) { + state4.dump = "&ref_" + duplicateIndex + " " + state4.dump; + } + } + } else if (type3 === "[object String]") { + if (state4.tag !== "?") { + writeScalar(state4, state4.dump, level, iskey, inblock); } + } else if (type3 === "[object Undefined]") { + return false; + } else { + if (state4.skipInvalid) return false; + throw new exception("unacceptable kind of an object to dump " + type3); + } + if (state4.tag !== null && state4.tag !== "?") { + tagStr = encodeURI( + state4.tag[0] === "!" ? state4.tag.slice(1) : state4.tag + ).replace(/!/g, "%21"); + if (state4.tag[0] === "!") { + tagStr = "!" + tagStr; + } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") { + tagStr = "!!" + tagStr.slice(18); + } else { + tagStr = "!<" + tagStr + ">"; + } + state4.dump = tagStr + " " + state4.dump; } - log$1.debug( - `abc95 (finale calc) ${block2.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block2.children.length} width=${Math.max(width2, ((_d = block2.size) == null ? void 0 : _d.width) || 0)}` - ); - if (width2 < (((_e = block2 == null ? void 0 : block2.size) == null ? void 0 : _e.width) || 0)) { - width2 = ((_f = block2 == null ? void 0 : block2.size) == null ? void 0 : _f.width) || 0; - const num = columns > 0 ? Math.min(block2.children.length, columns) : block2.children.length; - if (num > 0) { - const childWidth = (width2 - num * padding - padding) / num; - log$1.debug("abc95 (growing to fit) width", block2.id, width2, (_g = block2.size) == null ? void 0 : _g.width, childWidth); - for (const child of block2.children) { - if (child.size) { - child.size.width = childWidth; - } + } + return true; + } + __name(writeNode, "writeNode"); + function getDuplicateReferences(object3, state4) { + var objects = [], duplicatesIndexes = [], index, length2; + inspectNode(object3, objects, duplicatesIndexes); + for (index = 0, length2 = duplicatesIndexes.length; index < length2; index += 1) { + state4.duplicates.push(objects[duplicatesIndexes[index]]); + } + state4.usedDuplicates = new Array(length2); + } + __name(getDuplicateReferences, "getDuplicateReferences"); + function inspectNode(object3, objects, duplicatesIndexes) { + var objectKeyList, index, length2; + if (object3 !== null && typeof object3 === "object") { + index = objects.indexOf(object3); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object3); + if (Array.isArray(object3)) { + for (index = 0, length2 = object3.length; index < length2; index += 1) { + inspectNode(object3[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object3); + for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) { + inspectNode(object3[objectKeyList[index]], objects, duplicatesIndexes); } } } - block2.size = { - width: width2, - height, - x: 0, - y: 0 + } + } + __name(inspectNode, "inspectNode"); + function dump$1(input, options3) { + options3 = options3 || {}; + var state4 = new State(options3); + if (!state4.noRefs) getDuplicateReferences(input, state4); + var value2 = input; + if (state4.replacer) { + value2 = state4.replacer.call({ "": value2 }, "", value2); + } + if (writeNode(state4, 0, value2, true, true)) return state4.dump + "\n"; + return ""; + } + __name(dump$1, "dump$1"); + var dump_1 = dump$1; + var dumper = { + dump: dump_1 + }; + function renamed(from2, to) { + return function() { + throw new Error("Function yaml." + from2 + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default."); + }; + } + __name(renamed, "renamed"); + var JSON_SCHEMA = json2; + var load = loader24.load; + var loadAll = loader24.loadAll; + var dump = dumper.dump; + var safeLoad = renamed("safeLoad", "load"); + var safeLoadAll = renamed("safeLoadAll", "loadAll"); + var safeDump = renamed("safeDump", "dump"); + + // src/diagram-api/frontmatter.ts + function extractFrontMatter(text2) { + const matches33 = text2.match(frontMatterRegex); + if (!matches33) { + return { + text: text2, + metadata: {} }; } - log$1.debug( - "setBlockSizes abc94 (done)", - block2.id, - (_h = block2 == null ? void 0 : block2.size) == null ? void 0 : _h.x, - (_i6 = block2 == null ? void 0 : block2.size) == null ? void 0 : _i6.width, - (_j = block2 == null ? void 0 : block2.size) == null ? void 0 : _j.y, - (_k = block2 == null ? void 0 : block2.size) == null ? void 0 : _k.height - ); + let parsed = load(matches33[1], { + // To support config, we need JSON schema. + // https://www.yaml.org/spec/1.2/spec.html#id2803231 + schema: JSON_SCHEMA + }) ?? {}; + parsed = typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {}; + const metadata = {}; + if (parsed.displayMode) { + metadata.displayMode = parsed.displayMode.toString(); + } + if (parsed.title) { + metadata.title = parsed.title.toString(); + } + if (parsed.config) { + metadata.config = parsed.config; + } + return { + text: text2.slice(matches33[0].length), + metadata + }; } - function layoutBlocks(block2, db2) { - var _a2, _b2, _c, _d, _e, _f, _g, _h, _i6, _j, _k, _l, _m, _n, _o, _p, _q; - log$1.debug( - `abc85 layout blocks (=>layoutBlocks) ${block2.id} x: ${(_a2 = block2 == null ? void 0 : block2.size) == null ? void 0 : _a2.x} y: ${(_b2 = block2 == null ? void 0 : block2.size) == null ? void 0 : _b2.y} width: ${(_c = block2 == null ? void 0 : block2.size) == null ? void 0 : _c.width}` + __name(extractFrontMatter, "extractFrontMatter"); + + // src/preprocess.ts + init_utils2(); + var cleanupText = /* @__PURE__ */ __name((code) => { + return code.replace(/\r\n?/g, "\n").replace( + /<(\w+)([^>]*)>/g, + (match2, tag2, attributes) => "<" + tag2 + attributes.replace(/="([^"]*)"/g, "='$1'") + ">" ); - const columns = block2.columns || -1; - log$1.debug("layoutBlocks columns abc95", block2.id, "=>", columns, block2); - if (block2.children && // find max width of children - block2.children.length > 0) { - const width2 = ((_e = (_d = block2 == null ? void 0 : block2.children[0]) == null ? void 0 : _d.size) == null ? void 0 : _e.width) || 0; - const widthOfChildren = block2.children.length * width2 + (block2.children.length - 1) * padding; - log$1.debug("widthOfChildren 88", widthOfChildren, "posX"); - let columnPos = 0; - log$1.debug("abc91 block?.size?.x", block2.id, (_f = block2 == null ? void 0 : block2.size) == null ? void 0 : _f.x); - let startingPosX = ((_g = block2 == null ? void 0 : block2.size) == null ? void 0 : _g.x) ? ((_h = block2 == null ? void 0 : block2.size) == null ? void 0 : _h.x) + (-((_i6 = block2 == null ? void 0 : block2.size) == null ? void 0 : _i6.width) / 2 || 0) : -padding; - let rowPos = 0; - for (const child of block2.children) { - const parent = block2; - if (!child.size) { - continue; - } - const { width: width22, height } = child.size; - const { px, py } = calculateBlockPosition(columns, columnPos); - if (py != rowPos) { - rowPos = py; - startingPosX = ((_j = block2 == null ? void 0 : block2.size) == null ? void 0 : _j.x) ? ((_k = block2 == null ? void 0 : block2.size) == null ? void 0 : _k.x) + (-((_l = block2 == null ? void 0 : block2.size) == null ? void 0 : _l.width) / 2 || 0) : -padding; - log$1.debug("New row in layout for block", block2.id, " and child ", child.id, rowPos); + }, "cleanupText"); + var processFrontmatter = /* @__PURE__ */ __name((code) => { + const { text: text2, metadata } = extractFrontMatter(code); + const { displayMode: displayMode2, title: title2, config: config6 = {} } = metadata; + if (displayMode2) { + if (!config6.gantt) { + config6.gantt = {}; + } + config6.gantt.displayMode = displayMode2; + } + return { title: title2, config: config6, text: text2 }; + }, "processFrontmatter"); + var processDirectives = /* @__PURE__ */ __name((code) => { + const initDirective = utils_default2.detectInit(code) ?? {}; + const wrapDirectives = utils_default2.detectDirective(code, "wrap"); + if (Array.isArray(wrapDirectives)) { + initDirective.wrap = wrapDirectives.some(({ type: type3 }) => type3 === "wrap"); + } else if (wrapDirectives?.type === "wrap") { + initDirective.wrap = true; + } + return { + text: removeDirectives(code), + directive: initDirective + }; + }, "processDirectives"); + function preprocessDiagram(code) { + const cleanedCode = cleanupText(code); + const frontMatterResult = processFrontmatter(cleanedCode); + const directiveResult = processDirectives(frontMatterResult.text); + const config6 = cleanAndMerge(frontMatterResult.config, directiveResult.directive); + code = cleanupComments(directiveResult.text); + return { + code, + title: frontMatterResult.title, + config: config6 + }; + } + __name(preprocessDiagram, "preprocessDiagram"); + + // src/mermaidAPI.ts + init_utils2(); + + // src/utils/base64.ts + function toBase64(str2) { + const utf8Bytes = new TextEncoder().encode(str2); + const utf8Str = Array.from(utf8Bytes, (byte) => String.fromCodePoint(byte)).join(""); + return btoa(utf8Str); + } + __name(toBase64, "toBase64"); + + // src/mermaidAPI.ts + init_assignWithDepth(); + var MAX_TEXTLENGTH = 5e4; + var MAX_TEXTLENGTH_EXCEEDED_MSG = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa"; + var SECURITY_LVL_SANDBOX = "sandbox"; + var SECURITY_LVL_LOOSE = "loose"; + var XMLNS_SVG_STD = "http://www.w3.org/2000/svg"; + var XMLNS_XLINK_STD = "http://www.w3.org/1999/xlink"; + var XMLNS_XHTML_STD = "http://www.w3.org/1999/xhtml"; + var IFRAME_WIDTH = "100%"; + var IFRAME_HEIGHT = "100%"; + var IFRAME_STYLES = "border:0;margin:0;"; + var IFRAME_BODY_STYLE = "margin:0"; + var IFRAME_SANDBOX_OPTS = "allow-top-navigation-by-user-activation allow-popups"; + var IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.'; + var DOMPURIFY_TAGS = ["foreignobject"]; + var DOMPURIFY_ATTR = ["dominant-baseline"]; + function processAndSetConfigs(text2) { + const processed2 = preprocessDiagram(text2); + reset(); + addDirective(processed2.config ?? {}); + return processed2; + } + __name(processAndSetConfigs, "processAndSetConfigs"); + async function parse6(text2, parseOptions) { + addDiagrams(); + try { + const { code } = processAndSetConfigs(text2); + const diagram23 = await getDiagramFromText(code); + return { diagramType: diagram23.type }; + } catch (error3) { + if (parseOptions?.suppressErrors) { + return false; + } + throw error3; + } + } + __name(parse6, "parse"); + var cssImportantStyles = /* @__PURE__ */ __name((cssClass, element3, cssClasses = []) => { + return ` +.${cssClass} ${element3} { ${cssClasses.join(" !important; ")} !important; }`; + }, "cssImportantStyles"); + var createCssStyles = /* @__PURE__ */ __name((config6, classDefs = /* @__PURE__ */ new Map()) => { + let cssStyles = ""; + if (config6.themeCSS !== void 0) { + cssStyles += ` +${config6.themeCSS}`; + } + if (config6.fontFamily !== void 0) { + cssStyles += ` +:root { --mermaid-font-family: ${config6.fontFamily}}`; + } + if (config6.altFontFamily !== void 0) { + cssStyles += ` +:root { --mermaid-alt-font-family: ${config6.altFontFamily}}`; + } + if (classDefs instanceof Map) { + const htmlLabels = config6.htmlLabels ?? config6.flowchart?.htmlLabels; + const cssHtmlElements = ["> *", "span"]; + const cssShapeElements = ["rect", "polygon", "ellipse", "circle", "path"]; + const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements; + classDefs.forEach((styleClassDef) => { + if (!isEmpty_default(styleClassDef.styles)) { + cssElements.forEach((cssElement) => { + cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles); + }); } - log$1.debug( - `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${(_m = parent == null ? void 0 : parent.size) == null ? void 0 : _m.x},${(_n = parent == null ? void 0 : parent.size) == null ? void 0 : _n.y}) parent: ${parent.id} width: ${width22}${padding}` - ); - if (parent.size) { - const halfWidth = width22 / 2; - child.size.x = startingPosX + padding + halfWidth; - log$1.debug( - `abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width22} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width22 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}` - ); - startingPosX = child.size.x + halfWidth; - child.size.y = parent.size.y - parent.size.height / 2 + py * (height + padding) + height / 2 + padding; - log$1.debug( - `abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width22 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}` + if (!isEmpty_default(styleClassDef.textStyles)) { + cssStyles += cssImportantStyles( + styleClassDef.id, + "tspan", + (styleClassDef?.textStyles || []).map((s2) => s2.replace("color", "fill")) ); } - if (child.children) { - layoutBlocks(child); - } - columnPos += (child == null ? void 0 : child.widthInColumns) || 1; - log$1.debug("abc88 columnsPos", child, columnPos); + }); + } + return cssStyles; + }, "createCssStyles"); + var createUserStyles = /* @__PURE__ */ __name((config6, graphType, classDefs, svgId) => { + const userCSSstyles = createCssStyles(config6, classDefs); + const allStyles = styles_default(graphType, userCSSstyles, config6.themeVariables); + return serialize(compile(`${svgId}{${allStyles}}`), stringify); + }, "createUserStyles"); + var cleanUpSvgCode = /* @__PURE__ */ __name((svgCode = "", inSandboxMode, useArrowMarkerUrls) => { + let cleanedUpSvg = svgCode; + if (!useArrowMarkerUrls && !inSandboxMode) { + cleanedUpSvg = cleanedUpSvg.replace( + /marker-end="url\([\d+./:=?A-Za-z-]*?#/g, + 'marker-end="url(#' + ); + } + cleanedUpSvg = decodeEntities(cleanedUpSvg); + cleanedUpSvg = cleanedUpSvg.replace(/
    /g, "
    "); + return cleanedUpSvg; + }, "cleanUpSvgCode"); + var putIntoIFrame = /* @__PURE__ */ __name((svgCode = "", svgElement) => { + const height2 = svgElement?.viewBox?.baseVal?.height ? svgElement.viewBox.baseVal.height + "px" : IFRAME_HEIGHT; + const base64encodedSrc = toBase64(`${svgCode}`); + return ``; + }, "putIntoIFrame"); + var appendDivSvgG = /* @__PURE__ */ __name((parentRoot, id26, enclosingDivId, divStyle, svgXlink) => { + const enclosingDiv = parentRoot.append("div"); + enclosingDiv.attr("id", enclosingDivId); + if (divStyle) { + enclosingDiv.attr("style", divStyle); + } + const svgNode2 = enclosingDiv.append("svg").attr("id", id26).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD); + if (svgXlink) { + svgNode2.attr("xmlns:xlink", svgXlink); + } + svgNode2.append("g"); + return parentRoot; + }, "appendDivSvgG"); + function sandboxedIframe(parentNode, iFrameId) { + return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); + } + __name(sandboxedIframe, "sandboxedIframe"); + var removeExistingElements = /* @__PURE__ */ __name((doc, id26, divId, iFrameId) => { + doc.getElementById(id26)?.remove(); + doc.getElementById(divId)?.remove(); + doc.getElementById(iFrameId)?.remove(); + }, "removeExistingElements"); + var render6 = /* @__PURE__ */ __name(async function(id26, text2, svgContainingElement) { + addDiagrams(); + const processed2 = processAndSetConfigs(text2); + text2 = processed2.code; + const config6 = getConfig(); + log.debug(config6); + if (text2.length > (config6?.maxTextSize ?? MAX_TEXTLENGTH)) { + text2 = MAX_TEXTLENGTH_EXCEEDED_MSG; + } + const idSelector = "#" + id26; + const iFrameID = "i" + id26; + const iFrameID_selector = "#" + iFrameID; + const enclosingDivID = "d" + id26; + const enclosingDivID_selector = "#" + enclosingDivID; + const removeTempElements = /* @__PURE__ */ __name(() => { + const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector; + const node2 = select_default2(tmpElementSelector).node(); + if (node2 && "remove" in node2) { + node2.remove(); + } + }, "removeTempElements"); + let root4 = select_default2("body"); + const isSandboxed = config6.securityLevel === SECURITY_LVL_SANDBOX; + const isLooseSecurityLevel = config6.securityLevel === SECURITY_LVL_LOOSE; + const fontFamily = config6.fontFamily; + if (svgContainingElement !== void 0) { + if (svgContainingElement) { + svgContainingElement.innerHTML = ""; + } + if (isSandboxed) { + const iframe = sandboxedIframe(select_default2(svgContainingElement), iFrameID); + root4 = select_default2(iframe.nodes()[0].contentDocument.body); + root4.node().style.margin = 0; + } else { + root4 = select_default2(svgContainingElement); + } + appendDivSvgG(root4, id26, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD); + } else { + removeExistingElements(document, id26, enclosingDivID, iFrameID); + if (isSandboxed) { + const iframe = sandboxedIframe(select_default2("body"), iFrameID); + root4 = select_default2(iframe.nodes()[0].contentDocument.body); + root4.node().style.margin = 0; + } else { + root4 = select_default2("body"); } + appendDivSvgG(root4, id26, enclosingDivID); } - log$1.debug( - `layout blocks (<==layoutBlocks) ${block2.id} x: ${(_o = block2 == null ? void 0 : block2.size) == null ? void 0 : _o.x} y: ${(_p = block2 == null ? void 0 : block2.size) == null ? void 0 : _p.y} width: ${(_q = block2 == null ? void 0 : block2.size) == null ? void 0 : _q.width}` - ); + let diag; + let parseEncounteredException; + try { + diag = await Diagram.fromText(text2, { title: processed2.title }); + } catch (error3) { + if (config6.suppressErrorRendering) { + removeTempElements(); + throw error3; + } + diag = await Diagram.fromText("error"); + parseEncounteredException = error3; + } + const element3 = root4.select(enclosingDivID_selector).node(); + const diagramType = diag.type; + const svg = element3.firstChild; + const firstChild = svg.firstChild; + const diagramClassDefs = diag.renderer.getClasses?.(text2, diag); + const rules = createUserStyles(config6, diagramType, diagramClassDefs, idSelector); + const style1 = document.createElement("style"); + style1.innerHTML = rules; + svg.insertBefore(style1, firstChild); + try { + await diag.renderer.draw(text2, id26, version2, diag); + } catch (e3) { + if (config6.suppressErrorRendering) { + removeTempElements(); + } else { + errorRenderer_default.draw(text2, id26, version2); + } + throw e3; + } + const svgNode2 = root4.select(`${enclosingDivID_selector} svg`); + const a11yTitle = diag.db.getAccTitle?.(); + const a11yDescr = diag.db.getAccDescription?.(); + addA11yInfo(diagramType, svgNode2, a11yTitle, a11yDescr); + root4.select(`[id="${id26}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD); + let svgCode = root4.select(enclosingDivID_selector).node().innerHTML; + log.debug("config.arrowMarkerAbsolute", config6.arrowMarkerAbsolute); + svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config6.arrowMarkerAbsolute)); + if (isSandboxed) { + const svgEl = root4.select(enclosingDivID_selector + " svg").node(); + svgCode = putIntoIFrame(svgCode, svgEl); + } else if (!isLooseSecurityLevel) { + svgCode = import_dompurify2.default.sanitize(svgCode, { + ADD_TAGS: DOMPURIFY_TAGS, + ADD_ATTR: DOMPURIFY_ATTR + }); + } + attachFunctions(); + if (parseEncounteredException) { + throw parseEncounteredException; + } + removeTempElements(); + return { + diagramType, + svg: svgCode, + bindFunctions: diag.db.bindFunctions + }; + }, "render"); + function initialize(userOptions = {}) { + const options3 = assignWithDepth_default({}, userOptions); + if (options3?.fontFamily && !options3.themeVariables?.fontFamily) { + if (!options3.themeVariables) { + options3.themeVariables = {}; + } + options3.themeVariables.fontFamily = options3.fontFamily; + } + saveConfigFromInitialize(options3); + if (options3?.theme && options3.theme in themes_default) { + options3.themeVariables = themes_default[options3.theme].getThemeVariables( + options3.themeVariables + ); + } else if (options3) { + options3.themeVariables = themes_default.default.getThemeVariables(options3.themeVariables); + } + const config6 = typeof options3 === "object" ? setSiteConfig(options3) : getSiteConfig(); + setLogLevel(config6.logLevel); + addDiagrams(); + } + __name(initialize, "initialize"); + var getDiagramFromText = /* @__PURE__ */ __name((text2, metadata = {}) => { + const { code } = preprocessDiagram(text2); + return Diagram.fromText(code, metadata); + }, "getDiagramFromText"); + function addA11yInfo(diagramType, svgNode2, a11yTitle, a11yDescr) { + setA11yDiagramInfo(svgNode2, diagramType); + addSVGa11yTitleDescription(svgNode2, a11yTitle, a11yDescr, svgNode2.attr("id")); } - function findBounds(block2, { minX, minY, maxX, maxY } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) { - if (block2.size && block2.id !== "root") { - const { x: x2, y: y2, width: width2, height } = block2.size; - if (x2 - width2 / 2 < minX) { - minX = x2 - width2 / 2; + __name(addA11yInfo, "addA11yInfo"); + var mermaidAPI = Object.freeze({ + render: render6, + parse: parse6, + getDiagramFromText, + initialize, + getConfig, + setConfig, + getSiteConfig, + updateSiteConfig, + reset: /* @__PURE__ */ __name(() => { + reset(); + }, "reset"), + globalReset: /* @__PURE__ */ __name(() => { + reset(defaultConfig); + }, "globalReset"), + defaultConfig + }); + setLogLevel(getConfig().logLevel); + reset(getConfig()); + + // src/mermaid.ts + init_render(); + init_utils2(); + var handleError = /* @__PURE__ */ __name((error3, errors, parseError) => { + log.warn(error3); + if (isDetailedError(error3)) { + if (parseError) { + parseError(error3.str, error3.hash); + } + errors.push({ ...error3, message: error3.str, error: error3 }); + } else { + if (parseError) { + parseError(error3); + } + if (error3 instanceof Error) { + errors.push({ + str: error3.message, + message: error3.message, + hash: error3.name, + error: error3 + }); } - if (y2 - height / 2 < minY) { - minY = y2 - height / 2; + } + }, "handleError"); + var run4 = /* @__PURE__ */ __name(async function(options3 = { + querySelector: ".mermaid" + }) { + try { + await runThrowsErrors(options3); + } catch (e3) { + if (isDetailedError(e3)) { + log.error(e3.str); } - if (x2 + width2 / 2 > maxX) { - maxX = x2 + width2 / 2; + if (mermaid.parseError) { + mermaid.parseError(e3); } - if (y2 + height / 2 > maxY) { - maxY = y2 + height / 2; + if (!options3.suppressErrors) { + log.error("Use the suppressErrors option to suppress these errors"); + throw e3; } } - if (block2.children) { - for (const child of block2.children) { - ({ minX, minY, maxX, maxY } = findBounds(child, { minX, minY, maxX, maxY })); + }, "run"); + var runThrowsErrors = /* @__PURE__ */ __name(async function({ postRenderCallback, querySelector, nodes: nodes6 } = { + querySelector: ".mermaid" + }) { + const conf8 = mermaidAPI.getConfig(); + log.debug(`${!postRenderCallback ? "No " : ""}Callback function found`); + let nodesToProcess; + if (nodes6) { + nodesToProcess = nodes6; + } else if (querySelector) { + nodesToProcess = document.querySelectorAll(querySelector); + } else { + throw new Error("Nodes and querySelector are both undefined"); + } + log.debug(`Found ${nodesToProcess.length} diagrams`); + if (conf8?.startOnLoad !== void 0) { + log.debug("Start On Load: " + conf8?.startOnLoad); + mermaidAPI.updateSiteConfig({ startOnLoad: conf8?.startOnLoad }); + } + const idGenerator = new utils_default2.InitIDGenerator(conf8.deterministicIds, conf8.deterministicIDSeed); + let txt; + const errors = []; + for (const element3 of Array.from(nodesToProcess)) { + log.info("Rendering diagram: " + element3.id); + if (element3.getAttribute("data-processed")) { + continue; + } + element3.setAttribute("data-processed", "true"); + const id26 = `mermaid-${idGenerator.next()}`; + txt = element3.innerHTML; + txt = dedent(utils_default2.entityDecode(txt)).trim().replace(//gi, "
    "); + const init3 = utils_default2.detectInit(txt); + if (init3) { + log.debug("Detected early reinit: ", init3); + } + try { + const { svg, bindFunctions: bindFunctions4 } = await render7(id26, txt, element3); + element3.innerHTML = svg; + if (postRenderCallback) { + await postRenderCallback(id26); + } + if (bindFunctions4) { + bindFunctions4(element3); + } + } catch (error3) { + handleError(error3, errors, mermaid.parseError); } } - return { minX, minY, maxX, maxY }; + if (errors.length > 0) { + throw errors[0]; + } + }, "runThrowsErrors"); + var initialize2 = /* @__PURE__ */ __name(function(config6) { + mermaidAPI.initialize(config6); + }, "initialize"); + var init2 = /* @__PURE__ */ __name(async function(config6, nodes6, callback) { + log.warn("mermaid.init is deprecated. Please use run instead."); + if (config6) { + initialize2(config6); + } + const runOptions = { postRenderCallback: callback, querySelector: ".mermaid" }; + if (typeof nodes6 === "string") { + runOptions.querySelector = nodes6; + } else if (nodes6) { + if (nodes6 instanceof HTMLElement) { + runOptions.nodes = [nodes6]; + } else { + runOptions.nodes = nodes6; + } + } + await run4(runOptions); + }, "init"); + var registerExternalDiagrams = /* @__PURE__ */ __name(async (diagrams2, { + lazyLoad = true + } = {}) => { + addDiagrams(); + registerLazyLoadedDiagrams(...diagrams2); + if (lazyLoad === false) { + await loadRegisteredDiagrams(); + } + }, "registerExternalDiagrams"); + var contentLoaded = /* @__PURE__ */ __name(function() { + if (mermaid.startOnLoad) { + const { startOnLoad } = mermaidAPI.getConfig(); + if (startOnLoad) { + mermaid.run().catch((err) => log.error("Mermaid failed to initialize", err)); + } + } + }, "contentLoaded"); + if (typeof document !== "undefined") { + window.addEventListener("load", contentLoaded, false); } - function layout(db2) { - const root2 = db2.getBlock("root"); - if (!root2) { + var setParseErrorHandler = /* @__PURE__ */ __name(function(parseErrorHandler) { + mermaid.parseError = parseErrorHandler; + }, "setParseErrorHandler"); + var executionQueue = []; + var executionQueueRunning = false; + var executeQueue = /* @__PURE__ */ __name(async () => { + if (executionQueueRunning) { return; } - setBlockSizes(root2, db2, 0, 0); - layoutBlocks(root2); - log$1.debug("getBlocks", JSON.stringify(root2, null, 2)); - const { minX, minY, maxX, maxY } = findBounds(root2); - const height = maxY - minY; - const width2 = maxX - minX; - return { x: minX, y: minY, width: width2, height }; - } - const getClasses = function(text2, diagObj) { - return diagObj.db.getClasses(); - }; - const draw = async function(text2, id2, _version, diagObj) { - const { securityLevel, block: conf2 } = getConfig$2(); - const db2 = diagObj.db; - let sandboxElement; - if (securityLevel === "sandbox") { - sandboxElement = d3select("#i" + id2); - } - const root2 = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body"); - const svg2 = securityLevel === "sandbox" ? root2.select(`[id="${id2}"]`) : d3select(`[id="${id2}"]`); - const markers2 = ["point", "circle", "cross"]; - insertMarkers$4(svg2, markers2, diagObj.type, id2); - const bl = db2.getBlocks(); - const blArr = db2.getBlocksFlat(); - const edges2 = db2.getEdges(); - const nodes2 = svg2.insert("g").attr("class", "block"); - await calculateBlockSizes(nodes2, bl, db2); - const bounds2 = layout(db2); - await insertBlocks(nodes2, bl, db2); - await insertEdges(nodes2, edges2, blArr, db2, id2); - if (bounds2) { - const bounds22 = bounds2; - const magicFactor = Math.max(1, Math.round(0.125 * (bounds22.width / bounds22.height))); - const height = bounds22.height + magicFactor + 10; - const width2 = bounds22.width + 10; - const { useMaxWidth } = conf2; - configureSvgSize(svg2, height, width2, !!useMaxWidth); - log$1.debug("Here Bounds", bounds2, bounds22); - svg2.attr( - "viewBox", - `${bounds22.x - 5} ${bounds22.y - 5} ${bounds22.width + 10} ${bounds22.height + 10}` - ); + executionQueueRunning = true; + while (executionQueue.length > 0) { + const f3 = executionQueue.shift(); + if (f3) { + try { + await f3(); + } catch (e3) { + log.error("Error executing queue", e3); + } + } } - ordinal(d3schemeTableau10); - }; - const renderer = { - draw, - getClasses - }; - const diagram = { - parser: parser$1, - db: db$1, - renderer, - styles: flowStyles + executionQueueRunning = false; + }, "executeQueue"); + var parse7 = /* @__PURE__ */ __name(async (text2, parseOptions) => { + return new Promise((resolve3, reject3) => { + const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => { + mermaidAPI.parse(text2, parseOptions).then( + (r2) => { + res(r2); + resolve3(r2); + }, + (e3) => { + log.error("Error parsing", e3); + mermaid.parseError?.(e3); + rej(e3); + reject3(e3); + } + ); + }), "performCall"); + executionQueue.push(performCall); + executeQueue().catch(reject3); + }); + }, "parse"); + var render7 = /* @__PURE__ */ __name((id26, text2, container2) => { + return new Promise((resolve3, reject3) => { + const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => { + mermaidAPI.render(id26, text2, container2).then( + (r2) => { + res(r2); + resolve3(r2); + }, + (e3) => { + log.error("Error parsing", e3); + mermaid.parseError?.(e3); + rej(e3); + reject3(e3); + } + ); + }), "performCall"); + executionQueue.push(performCall); + executeQueue().catch(reject3); + }); + }, "render"); + var mermaid = { + startOnLoad: true, + mermaidAPI, + parse: parse7, + render: render7, + init: init2, + run: run4, + registerExternalDiagrams, + registerLayoutLoaders, + initialize: initialize2, + parseError: void 0, + contentLoaded, + setParseErrorHandler, + detectType }; - const blockDiagram = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - diagram - }, Symbol.toStringTag, { value: "Module" })); - return mermaid; -}); + var mermaid_default = mermaid; + return __toCommonJS(mermaid_exports); +})(); +/*! Check if previously processed */ +/*! + * Wait for document loaded before starting the execution + */ +/*! Bundled license information: + +dompurify/dist/purify.js: + (*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE *) + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + +cytoscape/dist/cytoscape.esm.mjs: + (*! + Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable + Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) + Licensed under The MIT License (http://opensource.org/licenses/MIT) + *) + (*! + Event object based on jQuery events, MIT license + + https://jquery.org/license/ + https://tldrlegal.com/license/mit-license + https://github.com/jquery/jquery/blob/master/src/event.js + *) + (*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *) + (*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *) + +js-yaml/dist/js-yaml.mjs: + (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) +*/ +globalThis.mermaid = globalThis.__esbuild_esm_mermaid.default; diff --git a/package-lock.json b/package-lock.json index 946e6d6..892fe8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gethinode/mod-mermaid", - "version": "1.1.15", + "version": "1.1.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gethinode/mod-mermaid", - "version": "1.1.15", + "version": "1.1.16", "hasInstallScript": true, "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 21025fa..9c1facf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gethinode/mod-mermaid", - "version": "1.1.15", + "version": "1.1.16", "description": "A Hugo module to add diagrams and charts powered by Mermaid to your Hinode site (work in progress)", "keywords": [ "hugo",